@prismatic-io/embedded
Version:
Embed Prismatic's integration marketplace and workflow designer within your existing application.
54 lines (53 loc) • 2.62 kB
TypeScript
import type { Options } from "../types/options";
type ConfigureInstancesBase = Options & {
skipRedirectOnRemove: boolean;
};
export type ConfigureInstanceWithIntegrationName = ConfigureInstancesBase & {
integrationName: string;
};
export type ConfigureInstanceWithIntegrationId = ConfigureInstancesBase & {
integrationId: string;
};
export type ConfigureInstanceWithInstanceId = ConfigureInstancesBase & {
instanceId: string;
};
export type ConfigureInstanceProps = ConfigureInstanceWithIntegrationName | ConfigureInstanceWithIntegrationId | ConfigureInstanceWithInstanceId;
/**
* Opens the configuration wizard for an integration, allowing a customer user
* to activate and configure an instance. You can identify the target by
* `integrationName`, `integrationId`, or `instanceId`.
*
* - Use `integrationName` to let a customer activate a new instance of a
* marketplace integration by its display name.
* - Use `integrationId` to target a specific integration version.
* - Use `instanceId` to reconfigure an already-deployed instance.
*
* @param props - Configuration options. Exactly one of `integrationName`, `integrationId`, or `instanceId` is required.
* @param props.skipRedirectOnRemove - When `true`, prevents redirecting to the marketplace after the instance is removed.
*
* @example
* // Configure by integration name (most common)
* prismatic.configureInstance({
* integrationName: "Salesforce",
* usePopover: true,
* skipRedirectOnRemove: false,
* });
*
* @example
* // Reconfigure an existing instance inline
* prismatic.configureInstance({
* instanceId: "SW5zdGFuY2U6OGE2YjZi...",
* selector: "#config-container",
* skipRedirectOnRemove: true,
* });
*
* @see {@link https://prismatic.io/docs/embed/marketplace/ | Embedding the Marketplace}
*/
export declare const configureInstance: ({ ...props }: ConfigureInstanceProps) => void;
/** Type guard that checks whether the props identify a target instance by `instanceId`. */
export declare const isConfigureInstanceWithInstanceId: (props: ConfigureInstanceProps) => props is ConfigureInstanceWithInstanceId;
/** Type guard that checks whether the props identify a target integration by `integrationId`. */
export declare const isConfigureInstanceWithIntegrationId: (props: ConfigureInstanceProps) => props is ConfigureInstanceWithIntegrationId;
/** Type guard that checks whether the props identify a target integration by `integrationName`. */
export declare const isConfigureInstanceWithIntegrationName: (props: ConfigureInstanceProps) => props is ConfigureInstanceWithIntegrationName;
export {};