@integry/sdk 4.4.0 → 4.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,10 @@
1
1
  import { VNode } from "preact";
2
- type IntegrySDKEventType = "authorizations" | "did-add-authorization" | "did-begin-remove-authorization" | "did-change-step" | "did-fail-authorization-verification" | "did-load-flow" | "did-load-flows" | "did-load-integration" | "did-load-integrations" | "did-load-preview" | "did-remove-authorization" | "did-save-integration" | "did-delete-integration" | "did-select-authorization" | "ready" | "should-load-flow" | "did-click-close-button" | "did-app-load" | "did-enable-integration" | "did-disable-integration" | "did-rename-integration" | "did-raise-sdk-embed-warning";
2
+ type IntegrySDKEventType = "authorizations" | "did-add-authorization" | "did-begin-remove-authorization" | "did-change-step" | "did-fail-authorization-verification" | "did-load-flow" | "did-load-flows" | "did-load-integration" | "did-load-integrations" | "did-load-preview" | "did-remove-authorization" | "did-save-integration" | "did-delete-integration" | "did-select-authorization" | "ready" | "should-load-flow" | "did-click-close-button" | "did-app-load" | "did-enable-integration" | "did-disable-integration" | "did-rename-integration" | "did-raise-sdk-embed-warning" | "app-connected" | "app-disconnected";
3
+ type ConnectedAccount = {
4
+ id: string;
5
+ display_name: string;
6
+ modified_at: string;
7
+ };
3
8
  type IntegrySDKEventPayloads = {
4
9
  ready: {
5
10
  isReady: boolean;
@@ -108,6 +113,22 @@ type IntegrySDKEventPayloads = {
108
113
  type: string;
109
114
  message: string;
110
115
  };
116
+ "app-connected": {
117
+ id: number;
118
+ name: string;
119
+ title: string;
120
+ connected_accounts?: ConnectedAccount[];
121
+ icon_url: string;
122
+ docs_url: string;
123
+ } | null;
124
+ "app-disconnected": {
125
+ id: number;
126
+ name: string;
127
+ title: string;
128
+ connected_accounts?: ConnectedAccount[];
129
+ icon_url: string;
130
+ docs_url: string;
131
+ } | null;
111
132
  };
112
133
  type EventCallback<P extends IntegrySDKEventType> = (
113
134
  // @ts-expect-error P can index IntegrySDKEventPayloads
@@ -135,6 +156,8 @@ type IntegrySDKEvents = {
135
156
  "did-disable-integration": EventCallback<"did-disable-integration">;
136
157
  "did-rename-integration": EventCallback<"did-rename-integration">;
137
158
  "did-raise-sdk-embed-warning": EventCallback<"did-raise-sdk-embed-warning">;
159
+ "app-connected": EventCallback<"app-connected">;
160
+ "app-disconnected": EventCallback<"app-disconnected">;
138
161
  };
139
162
  declare enum ViewStyles {
140
163
  COMPACT = "COMPACT",
@@ -429,6 +452,11 @@ interface PreviewPayload {
429
452
  metadata: PreviewMetadata;
430
453
  previewContainerId: string;
431
454
  }
455
+ interface ConnectedAccount$0 {
456
+ id: string;
457
+ display_name: string;
458
+ modified_at: string;
459
+ }
432
460
  // interface for app flows
433
461
  interface Instance {
434
462
  status: string;
@@ -476,11 +504,6 @@ interface MultipurposeFieldType {
476
504
  fieldId?: string;
477
505
  enableTagify?: boolean;
478
506
  }
479
- interface ConnectedAccount {
480
- id: string;
481
- display_name: string;
482
- modified_at: string;
483
- }
484
507
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
485
508
  type EventSet = Record<string, (...args: any[]) => void>;
486
509
  interface EventEmitterType<ESet extends EventSet> {
@@ -552,9 +575,9 @@ declare class IntegryJS {
552
575
  versionId?: number;
553
576
  viewStyle?: string;
554
577
  }) => void;
555
- showFunctionUI: (functionName: string, functionArguments: {
578
+ showFunctionUI: (functionName: string, functionArguments?: {
556
579
  [key: string]: any;
557
- }, connectedAccountId: string) => Promise<Record<any, any>>;
580
+ }, connectedAccountId?: string | undefined) => Promise<Record<any, any>>;
558
581
  invokeFunction: (functionName: string, params: {
559
582
  [key: string]: any;
560
583
  }, connectedAccountId: string) => Promise<Record<any, any>>;
@@ -562,7 +585,8 @@ declare class IntegryJS {
562
585
  disconnectApp: (appName: string, connectedAccountId?: string | undefined) => Promise<any>;
563
586
  isAppConnected: (appName: string) => Promise<any>;
564
587
  getFunction: (functionName: string) => Promise<any>;
565
- getConnectedAccounts: (appName: string) => Promise<ConnectedAccount[] | null>;
588
+ getConnectedAccounts: (appName: string) => Promise<ConnectedAccount$0[] | null>;
589
+ private getApp;
566
590
  /**
567
591
  * Render the template form we ship
568
592
  * @param data