@integry/sdk 3.2.24 → 3.2.25-beta.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,421 +1,425 @@
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";
3
- type IntegrySDKEventPayloads = {
4
- ready: {
5
- deploymentId: number;
6
- };
7
- "should-load-flow": {
8
- templateId: number;
9
- flowId: number;
10
- };
11
- "did-load-flows": {
12
- flows: any[];
13
- };
14
- "did-load-integrations": {
15
- integrations: any[];
16
- };
17
- "did-load-flow": {
18
- flowId: number;
19
- flowTitle: string;
20
- flowDescription: string;
21
- templateId: number;
22
- templateTitle: string;
23
- templateDescription: string;
24
- mode: "EDIT" | "CREATE";
25
- };
26
- "did-load-integration": {
27
- flowId: number;
28
- integrationId: number;
29
- };
30
- "did-delete-integration": {
31
- flowId: number;
32
- flowName: string;
33
- flowDescription: string;
34
- integrationId: number;
35
- integrationName: string;
36
- };
37
- "did-save-integration": {
38
- integrationId: number;
39
- name: string;
40
- templateId: number;
41
- flowId: number;
42
- status: string;
43
- callbackUrl: string | null;
44
- callbackUrlArray: {
45
- templateStepId: number;
46
- activityId: number;
47
- callbackUrl: string | null;
48
- }[];
49
- authorizations: {
50
- authorizationId: number;
51
- userIdentity: string;
52
- isBrandingAppAuth: boolean;
53
- }[];
54
- event: "EDIT" | "CREATE";
55
- };
56
- "did-load-preview": {
57
- flowId: number;
58
- flowTitle: string;
59
- flowDescription: string;
60
- };
61
- "did-change-step": {
62
- stepId: number;
63
- stepType: "AUTH" | "CONFIGURATION" | "SECTION" | "CONFIRMATION";
64
- };
65
- "did-add-authorization": {
66
- identity: string;
67
- authorizationId: number;
68
- flowId: number | null;
69
- appIcon: string;
70
- alreadyExists: boolean;
71
- externalId?: string;
72
- };
73
- "did-select-authorization": {
74
- authorizationId: number;
75
- };
76
- "did-remove-authorization": {
77
- authorizationId: number;
78
- };
79
- "did-begin-remove-authorization": {
80
- authorizationId: number;
81
- };
82
- "did-click-close-button": {
83
- isCloseClicked: boolean;
84
- };
85
- };
86
- type EventCallback<P extends IntegrySDKEventType> = (
87
- // @ts-expect-error P can index IntegrySDKEventPayloads
88
- payload: IntegrySDKEventPayloads[P]) => void;
89
- type IntegrySDKEvents = {
90
- authorizations: EventCallback<"authorizations">;
91
- "did-add-authorization": EventCallback<"did-add-authorization">;
92
- "did-begin-remove-authorization": EventCallback<"did-begin-remove-authorization">;
93
- "did-change-step": EventCallback<"did-change-step">;
94
- "did-fail-authorization-verification": EventCallback<"did-fail-authorization-verification">;
95
- "did-load-flow": EventCallback<"did-load-flow">;
96
- "did-load-flows": EventCallback<"did-load-flows">;
97
- "did-load-integration": EventCallback<"did-load-integration">;
98
- "did-delete-integration": EventCallback<"did-delete-integration">;
99
- "did-load-integrations": EventCallback<"did-load-integrations">;
100
- "did-load-preview": EventCallback<"did-load-preview">;
101
- "did-remove-authorization": EventCallback<"did-remove-authorization">;
102
- "did-save-integration": EventCallback<"did-save-integration">;
103
- "did-select-authorization": EventCallback<"did-select-authorization">;
104
- ready: EventCallback<"ready">;
105
- "should-load-flow": EventCallback<"should-load-flow">;
106
- "did-click-close-button": EventCallback<"did-click-close-button">;
107
- };
108
- declare enum TemplateFormRenderModes {
109
- MODAL = "MODAL",
110
- INLINE = "INLINE",
111
- DETACHED = "DETACHED",
112
- CUSTOM = "CUSTOM"
113
- }
114
- declare enum MarketplaceRenderModes {
115
- MODAL = "MODAL",
116
- INLINE = "INLINE"
117
- }
118
- declare enum TemplateListingRenderModes {
119
- GRID = "GRID",
120
- LIST = "LIST"
121
- }
122
- type Authorization = {
123
- id: number;
124
- authorization_type: string;
125
- app_user?: number;
126
- app_user_id?: number;
127
- disable_link?: string;
128
- integration_count?: number;
129
- user_identity: string;
130
- };
131
- type FlowCardProps = {
132
- imgUrl: string;
133
- name: string;
134
- description: string;
135
- tags: string;
136
- layout: TemplateListingRenderModes;
137
- handleClick: () => void;
138
- };
139
- interface UserConfig {
140
- availableFlowsLabel?: string;
141
- myFlowsLabel?: string;
142
- hideWebhookUrlScreen?: boolean;
143
- hideAppConnectionModal?: boolean;
144
- customComponents?: {
145
- flowCard?: (props: FlowCardProps) => VNode;
146
- };
147
- autoRedirectToMyFlows?: boolean;
148
- isReadOnly?: boolean;
149
- marketplaceModalTitle?: string;
150
- buttonLabelToSaveIntegration?: string;
151
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
152
- [other: string]: any;
153
- }
154
- interface SDKConfig {
155
- env?: "staging" | "production";
156
- baseUrl?: string;
157
- debug?: boolean;
158
- integrationId?: number;
159
- xIntegryConfig?: {
160
- isAnonymous?: boolean;
161
- appAuth?: {
162
- apiKey?: string;
163
- authId?: string;
164
- extras?: Record<string, string | number>;
165
- };
166
- };
167
- userConfig?: UserConfig;
168
- }
169
- interface ConfigWithObject extends SDKConfig {
170
- appKey: string;
171
- hash: string;
172
- userId: string;
173
- deploymentId: string;
174
- marketplaceId?: string;
175
- }
176
- interface ConfigWithUrlParams extends SDKConfig {
177
- useUrlParams?: boolean;
178
- }
179
- type App = {
180
- id: number;
181
- name: string;
182
- description: string;
183
- icon_url: string;
184
- color: string;
185
- publishing_status: string;
186
- category: string[];
187
- app_type?: string;
188
- action_url?: string | null;
189
- created_at?: Date;
190
- tags: string;
191
- };
192
- type Activity = {
193
- id: number;
194
- name: string;
195
- type: string;
196
- endpoint: string;
197
- auth_required: boolean;
198
- total_fields: number;
199
- app: App;
200
- activity_output: string | null;
201
- activity_output_url: string | null;
202
- dynamic_field_data_endpoint: string | null;
203
- };
204
- type AuthorizationType = {
205
- id: number;
206
- type: string;
207
- authorizations: Authorization[];
208
- provider: string;
209
- is_sandbox_enabled: boolean;
210
- is_userinfo_required?: boolean;
211
- authorization_url_sandbox: string;
212
- app: {
213
- icon_url: string;
214
- id: number;
215
- name: string;
216
- };
217
- };
218
- interface TemplateField {
219
- id: number;
220
- is_required: boolean;
221
- is_hidden: boolean;
222
- default_value: string | null;
223
- weight: number;
224
- description: string;
225
- summary: string | null;
226
- activity_field: {
227
- id: number;
228
- machine_name: string;
229
- type: string;
230
- title: string;
231
- description: string;
232
- weight: number;
233
- is_required: boolean;
234
- child_fields: string | null;
235
- placeholder: string | null;
236
- is_dynamic: boolean;
237
- data_src: string | null;
238
- data_src_endpoint: number | null;
239
- parent_fields: string | null;
240
- dynamic_field_src: string | null;
241
- default_value: string | null;
242
- auto_machine_name: string;
243
- dynamic_field_src_endpoint: number | null;
244
- regex: string | null;
245
- regex_error_message?: string | null;
246
- is_searchable: boolean;
247
- conditional_fields?: string | null;
248
- } | null;
249
- title: string | null;
250
- type: string;
251
- placeholder: string | null;
252
- // manual_template: unknown | null;
253
- child_field: string | null;
254
- child_field_value: string | null;
255
- // template_fields: unknown[];
256
- button_text: string | null;
257
- // field_actions: unknown[];
258
- icon_url: string | null;
259
- long_description: string | null;
260
- regex: string | null;
261
- regex_msg: string | null;
262
- is_visible: boolean;
263
- app_user_data?: {
264
- app_user: number;
265
- id: number;
266
- value: string | number;
267
- is_changed: boolean;
268
- changed_dynamic_fields: string;
269
- }[];
270
- added_in_mapping?: boolean;
271
- field_mapping_source?: string;
272
- }
273
- interface TemplateStep {
274
- id: number;
275
- weight: number;
276
- title: string;
277
- is_visible: boolean;
278
- activity: Activity;
279
- authorization_type: AuthorizationType;
280
- template_fields: TemplateField[];
281
- step_instance?: number | null;
282
- allow_multiple_authorizations: boolean;
283
- step_authorization: number | null;
284
- button_text: string | null;
285
- is_self_step: boolean;
286
- summary: string | null;
287
- is_workspace_app_step: boolean;
288
- auth_description: string | null;
289
- hide_authorization: boolean;
290
- // step_condition: unknown | null;
291
- machine_name: string | null;
292
- is_custom_machine_name: boolean;
293
- }
294
- interface InitConfig {
295
- containerId: string;
296
- templateContainerId?: string;
297
- renderMode: TemplateFormRenderModes;
298
- }
299
- interface MarketplaceConfig {
300
- containerId: string;
301
- renderMode: MarketplaceRenderModes;
302
- }
303
- interface TemplatePreviewData {
304
- id: number;
305
- name: string;
306
- description: string;
307
- app: App;
308
- branding_app: App;
309
- button_text: string | null;
310
- is_wizard: boolean;
311
- publishing_status: string;
312
- level?: number;
313
- parent_id?: number;
314
- steps: TemplateStep[];
315
- }
316
- interface PreviewMetadata {
317
- stepId: number | null;
318
- type: "AUTH" | "CONFIGURATION" | "CONFIRMATION" | "SECTION";
319
- }
320
- interface PreviewPayload {
321
- templateData: TemplatePreviewData;
322
- metadata: PreviewMetadata;
323
- previewContainerId: string;
324
- }
325
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
326
- type EventSet = Record<string, (...args: any[]) => void>;
327
- interface EventEmitterType<ESet extends EventSet> {
328
- on<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
329
- once<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
330
- off<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
331
- offAll(): void;
332
- emit<EventName extends keyof ESet>(eventName: EventName, ...args: Parameters<ESet[EventName]>): void;
333
- }
334
- declare class EventEmitter<ESet extends EventSet> implements EventEmitterType<EventSet> {
335
- private events;
336
- on<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
337
- once<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
338
- off<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
339
- offAll(): void;
340
- emit<EventName extends keyof ESet>(eventName: EventName, ...args: Parameters<ESet[EventName]>): void;
341
- private addEventListener;
342
- }
343
- /**
344
- * Integry JS SDK
345
- */
346
- declare class IntegryJS {
347
- static SDK_VERSION: string;
348
- private config;
349
- private apiHandler;
350
- eventEmitter: EventEmitter<IntegrySDKEvents>;
351
- // allow customers to use template tagging
352
- static html: (strings: TemplateStringsArray, ...values: any[]) => import("preact").VNode<{}>;
353
- static RenderModes: typeof TemplateFormRenderModes;
354
- static MarketplaceRenderModes: typeof MarketplaceRenderModes;
355
- static Helpers: {
356
- getAuthHash: (key: string, message: string) => Promise<string>;
357
- };
358
- private authModalId;
359
- private forceRerender;
360
- constructor(config: ConfigWithObject | ConfigWithUrlParams);
361
- /**
362
- *
363
- * @param length Length of string to randomly generate
364
- * @returns {string} Returns a random string
365
- */
366
- private getRandomFlowId;
367
- private getAuthParamsFromUrl;
368
- /**
369
- * Prints version number of this SDK version
370
- */
371
- printVersion: () => void;
372
- /**
373
- *
374
- * @param renderMode
375
- * @param templateContainerId
376
- * @returns {HTMLElement | null}
377
- */
378
- private setupFlowFormDestination;
379
- /**
380
- * Render the template form we ship
381
- * @param data
382
- */
383
- renderFlowSetupForm: (data: {
384
- flowId?: string;
385
- integrationId?: number;
386
- flowContainerId: string;
387
- versionId?: number;
388
- }) => void;
389
- /**
390
- * Render the template form we ship
391
- * @param data
392
- */
393
- renderAccountConnectionModal: (data?: {
394
- deploymentId?: string | undefined;
395
- appId?: number | undefined;
396
- authTypeId?: number | undefined;
397
- } | undefined) => void;
398
- /**
399
- * Render the template form we ship
400
- * @param params
401
- */
402
- renderPreview: (params: PreviewPayload) => void;
403
- /**
404
- *
405
- * @param initConfig
406
- */
407
- init: (initConfig: InitConfig) => void;
408
- /**
409
- *
410
- * @param marketplaceConfig
411
- */
412
- renderMarketplace: (marketplaceConfig: MarketplaceConfig) => void;
413
- verifyAuthConfig: () => Promise<{
414
- config_verified: boolean;
415
- } | null>;
416
- /**
417
- * Destroy SDK instance and cleanup store
418
- */
419
- destroy: () => void;
420
- }
421
- export { IntegryJS as default };
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";
3
+ type IntegrySDKEventPayloads = {
4
+ ready: {
5
+ deploymentId: number;
6
+ };
7
+ "should-load-flow": {
8
+ templateId: number;
9
+ flowId: number;
10
+ };
11
+ "did-load-flows": {
12
+ flows: any[];
13
+ };
14
+ "did-load-integrations": {
15
+ integrations: any[];
16
+ };
17
+ "did-load-flow": {
18
+ flowId: number;
19
+ flowTitle: string;
20
+ flowDescription: string;
21
+ templateId: number;
22
+ templateTitle: string;
23
+ templateDescription: string;
24
+ mode: "EDIT" | "CREATE";
25
+ };
26
+ "did-load-integration": {
27
+ flowId: number;
28
+ integrationId: number;
29
+ };
30
+ "did-delete-integration": {
31
+ flowId: number;
32
+ flowName: string;
33
+ flowDescription: string;
34
+ integrationId: number;
35
+ integrationName: string;
36
+ };
37
+ "did-save-integration": {
38
+ integrationId: number;
39
+ name: string;
40
+ templateId: number;
41
+ flowId: number;
42
+ status: string;
43
+ callbackUrl: string | null;
44
+ callbackUrlArray: {
45
+ templateStepId: number;
46
+ activityId: number;
47
+ callbackUrl: string | null;
48
+ }[];
49
+ authorizations: {
50
+ authorizationId: number;
51
+ userIdentity: string;
52
+ isBrandingAppAuth: boolean;
53
+ }[];
54
+ event: "EDIT" | "CREATE";
55
+ };
56
+ "did-load-preview": {
57
+ flowId: number;
58
+ flowTitle: string;
59
+ flowDescription: string;
60
+ };
61
+ "did-change-step": {
62
+ stepId: number;
63
+ stepType: "AUTH" | "CONFIGURATION" | "SECTION" | "CONFIRMATION";
64
+ };
65
+ "did-add-authorization": {
66
+ identity: string;
67
+ authorizationId: number;
68
+ flowId: number | null;
69
+ appIcon: string;
70
+ alreadyExists: boolean;
71
+ externalId?: string;
72
+ };
73
+ "did-select-authorization": {
74
+ authorizationId: number;
75
+ };
76
+ "did-remove-authorization": {
77
+ authorizationId: number;
78
+ };
79
+ "did-begin-remove-authorization": {
80
+ authorizationId: number;
81
+ };
82
+ "did-click-close-button": {
83
+ isCloseClicked: boolean;
84
+ };
85
+ };
86
+ type EventCallback<P extends IntegrySDKEventType> = (
87
+ // @ts-expect-error P can index IntegrySDKEventPayloads
88
+ payload: IntegrySDKEventPayloads[P]) => void;
89
+ type IntegrySDKEvents = {
90
+ authorizations: EventCallback<"authorizations">;
91
+ "did-add-authorization": EventCallback<"did-add-authorization">;
92
+ "did-begin-remove-authorization": EventCallback<"did-begin-remove-authorization">;
93
+ "did-change-step": EventCallback<"did-change-step">;
94
+ "did-fail-authorization-verification": EventCallback<"did-fail-authorization-verification">;
95
+ "did-load-flow": EventCallback<"did-load-flow">;
96
+ "did-load-flows": EventCallback<"did-load-flows">;
97
+ "did-load-integration": EventCallback<"did-load-integration">;
98
+ "did-delete-integration": EventCallback<"did-delete-integration">;
99
+ "did-load-integrations": EventCallback<"did-load-integrations">;
100
+ "did-load-preview": EventCallback<"did-load-preview">;
101
+ "did-remove-authorization": EventCallback<"did-remove-authorization">;
102
+ "did-save-integration": EventCallback<"did-save-integration">;
103
+ "did-select-authorization": EventCallback<"did-select-authorization">;
104
+ ready: EventCallback<"ready">;
105
+ "should-load-flow": EventCallback<"should-load-flow">;
106
+ "did-click-close-button": EventCallback<"did-click-close-button">;
107
+ };
108
+ declare enum TemplateFormRenderModes {
109
+ MODAL = "MODAL",
110
+ INLINE = "INLINE",
111
+ DETACHED = "DETACHED",
112
+ CUSTOM = "CUSTOM"
113
+ }
114
+ declare enum MarketplaceRenderModes {
115
+ MODAL = "MODAL",
116
+ INLINE = "INLINE"
117
+ }
118
+ declare enum TemplateListingRenderModes {
119
+ GRID = "GRID",
120
+ LIST = "LIST"
121
+ }
122
+ type Authorization = {
123
+ id: number;
124
+ authorization_type: string;
125
+ app_user?: number;
126
+ app_user_id?: number;
127
+ disable_link?: string;
128
+ integration_count?: number;
129
+ user_identity: string;
130
+ };
131
+ type FlowCardProps = {
132
+ imgUrl: string;
133
+ name: string;
134
+ description: string;
135
+ tags: string;
136
+ layout: TemplateListingRenderModes;
137
+ handleClick: () => void;
138
+ };
139
+ interface UserConfig {
140
+ availableFlowsLabel?: string;
141
+ myFlowsLabel?: string;
142
+ hideWebhookUrlScreen?: boolean;
143
+ hideAppConnectionModal?: boolean;
144
+ customComponents?: {
145
+ flowCard?: (props: FlowCardProps) => VNode;
146
+ };
147
+ autoRedirectToMyFlows?: boolean;
148
+ isReadOnly?: boolean;
149
+ marketplaceModalTitle?: string;
150
+ buttonLabelToSaveIntegration?: string;
151
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
152
+ [other: string]: any;
153
+ }
154
+ interface SDKConfig {
155
+ env?: "staging" | "production";
156
+ baseUrl?: string;
157
+ debug?: boolean;
158
+ integrationId?: number;
159
+ xIntegryConfig?: {
160
+ isAnonymous?: boolean;
161
+ appAuth?: {
162
+ apiKey?: string;
163
+ authId?: string;
164
+ extras?: Record<string, string | number>;
165
+ };
166
+ };
167
+ userConfig?: UserConfig;
168
+ }
169
+ interface ConfigWithObject extends SDKConfig {
170
+ appKey: string;
171
+ hash: string;
172
+ userId: string;
173
+ deploymentId: string;
174
+ marketplaceId?: string;
175
+ appId?: number;
176
+ }
177
+ interface ConfigWithUrlParams extends SDKConfig {
178
+ useUrlParams?: boolean;
179
+ }
180
+ type App = {
181
+ id: number;
182
+ name: string;
183
+ description: string;
184
+ icon_url: string;
185
+ color: string;
186
+ publishing_status: string;
187
+ category: string[];
188
+ app_type?: string;
189
+ action_url?: string | null;
190
+ created_at?: Date;
191
+ tags: string;
192
+ };
193
+ type Activity = {
194
+ id: number;
195
+ name: string;
196
+ type: string;
197
+ endpoint: string;
198
+ auth_required: boolean;
199
+ total_fields: number;
200
+ app: App;
201
+ activity_output: string | null;
202
+ activity_output_url: string | null;
203
+ dynamic_field_data_endpoint: string | null;
204
+ };
205
+ type AuthorizationType = {
206
+ id: number;
207
+ type: string;
208
+ authorizations: Authorization[];
209
+ provider: string;
210
+ is_sandbox_enabled: boolean;
211
+ is_userinfo_required?: boolean;
212
+ authorization_url_sandbox: string;
213
+ app: {
214
+ icon_url: string;
215
+ id: number;
216
+ name: string;
217
+ };
218
+ };
219
+ interface TemplateField {
220
+ id: number;
221
+ is_required: boolean;
222
+ is_hidden: boolean;
223
+ default_value: string | null;
224
+ weight: number;
225
+ description: string;
226
+ summary: string | null;
227
+ activity_field: {
228
+ id: number;
229
+ machine_name: string;
230
+ type: string;
231
+ title: string;
232
+ description: string;
233
+ weight: number;
234
+ is_required: boolean;
235
+ child_fields: string | null;
236
+ placeholder: string | null;
237
+ is_dynamic: boolean;
238
+ data_src: string | null;
239
+ data_src_endpoint: number | null;
240
+ parent_fields: string | null;
241
+ dynamic_field_src: string | null;
242
+ default_value: string | null;
243
+ auto_machine_name: string;
244
+ dynamic_field_src_endpoint: number | null;
245
+ regex: string | null;
246
+ regex_error_message?: string | null;
247
+ is_searchable: boolean;
248
+ conditional_fields?: string | null;
249
+ } | null;
250
+ title: string | null;
251
+ type: string;
252
+ placeholder: string | null;
253
+ // manual_template: unknown | null;
254
+ child_field: string | null;
255
+ child_field_value: string | null;
256
+ // template_fields: unknown[];
257
+ button_text: string | null;
258
+ // field_actions: unknown[];
259
+ icon_url: string | null;
260
+ long_description: string | null;
261
+ regex: string | null;
262
+ regex_msg: string | null;
263
+ is_visible: boolean;
264
+ app_user_data?: {
265
+ app_user: number;
266
+ id: number;
267
+ value: string | number;
268
+ is_changed: boolean;
269
+ changed_dynamic_fields: string;
270
+ }[];
271
+ added_in_mapping?: boolean;
272
+ field_mapping_source?: string;
273
+ }
274
+ interface TemplateStep {
275
+ id: number;
276
+ weight: number;
277
+ title: string;
278
+ is_visible: boolean;
279
+ activity: Activity;
280
+ authorization_type: AuthorizationType;
281
+ template_fields: TemplateField[];
282
+ step_instance?: number | null;
283
+ allow_multiple_authorizations: boolean;
284
+ step_authorization: number | null;
285
+ button_text: string | null;
286
+ is_self_step: boolean;
287
+ summary: string | null;
288
+ is_workspace_app_step: boolean;
289
+ auth_description: string | null;
290
+ hide_authorization: boolean;
291
+ // step_condition: unknown | null;
292
+ machine_name: string | null;
293
+ is_custom_machine_name: boolean;
294
+ }
295
+ interface InitConfig {
296
+ containerId: string;
297
+ templateContainerId?: string;
298
+ renderMode: TemplateFormRenderModes;
299
+ appId?: number;
300
+ }
301
+ interface MarketplaceConfig {
302
+ containerId: string;
303
+ renderMode: MarketplaceRenderModes;
304
+ }
305
+ interface TemplatePreviewData {
306
+ id: number;
307
+ name: string;
308
+ description: string;
309
+ app: App;
310
+ branding_app: App;
311
+ button_text: string | null;
312
+ is_wizard: boolean;
313
+ publishing_status: string;
314
+ level?: number;
315
+ parent_id?: number;
316
+ steps: TemplateStep[];
317
+ }
318
+ interface PreviewMetadata {
319
+ stepId: number | null;
320
+ type: "AUTH" | "CONFIGURATION" | "CONFIRMATION" | "SECTION";
321
+ }
322
+ interface PreviewPayload {
323
+ templateData: TemplatePreviewData;
324
+ metadata: PreviewMetadata;
325
+ previewContainerId: string;
326
+ }
327
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
328
+ type EventSet = Record<string, (...args: any[]) => void>;
329
+ interface EventEmitterType<ESet extends EventSet> {
330
+ on<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
331
+ once<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
332
+ off<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
333
+ offAll(): void;
334
+ emit<EventName extends keyof ESet>(eventName: EventName, ...args: Parameters<ESet[EventName]>): void;
335
+ }
336
+ declare class EventEmitter<ESet extends EventSet> implements EventEmitterType<EventSet> {
337
+ private events;
338
+ on<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
339
+ once<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
340
+ off<EventName extends keyof ESet>(eventName: EventName, handler: ESet[EventName]): void;
341
+ offAll(): void;
342
+ emit<EventName extends keyof ESet>(eventName: EventName, ...args: Parameters<ESet[EventName]>): void;
343
+ private addEventListener;
344
+ }
345
+ /**
346
+ * Integry JS SDK
347
+ */
348
+ declare class IntegryJS {
349
+ static SDK_VERSION: string;
350
+ private config;
351
+ private apiHandler;
352
+ eventEmitter: EventEmitter<IntegrySDKEvents>;
353
+ // allow customers to use template tagging
354
+ static html: (strings: TemplateStringsArray, ...values: any[]) => import("preact").VNode<{}>;
355
+ static RenderModes: typeof TemplateFormRenderModes;
356
+ static MarketplaceRenderModes: typeof MarketplaceRenderModes;
357
+ static Helpers: {
358
+ getAuthHash: (key: string, message: string) => Promise<string>;
359
+ };
360
+ private authModalId;
361
+ private forceRerender;
362
+ constructor(config: ConfigWithObject | ConfigWithUrlParams);
363
+ /**
364
+ *
365
+ * @param length Length of string to randomly generate
366
+ * @returns {string} Returns a random string
367
+ */
368
+ private getRandomFlowId;
369
+ private getAuthParamsFromUrl;
370
+ /**
371
+ * Prints version number of this SDK version
372
+ */
373
+ printVersion: () => void;
374
+ /**
375
+ *
376
+ * @param renderMode
377
+ * @param templateContainerId
378
+ * @returns {HTMLElement | null}
379
+ */
380
+ private setupFlowFormDestination;
381
+ /**
382
+ * Render the template form we ship
383
+ * @param data
384
+ */
385
+ renderFlowSetupForm: (data: {
386
+ flowId?: string;
387
+ integrationId?: number;
388
+ flowContainerId: string;
389
+ versionId?: number;
390
+ }) => void;
391
+ /**
392
+ * Render the template form we ship
393
+ * @param data
394
+ */
395
+ renderAccountConnectionModal: (data?: {
396
+ deploymentId?: string | undefined;
397
+ appId?: number | undefined;
398
+ authTypeId?: number | undefined;
399
+ } | undefined) => void;
400
+ /**
401
+ * Render the template form we ship
402
+ * @param params
403
+ */
404
+ renderPreview: (params: PreviewPayload) => void;
405
+ /**
406
+ *
407
+ * @param initConfig
408
+ */
409
+ init: (initConfig: InitConfig) => void;
410
+ initializeMarketplace: (initConfig: InitConfig) => void;
411
+ /**
412
+ *
413
+ * @param marketplaceConfig
414
+ */
415
+ renderMarketplace: (marketplaceConfig: MarketplaceConfig) => void;
416
+ renderAppFlows: (appFlowConfig: InitConfig) => void;
417
+ verifyAuthConfig: () => Promise<{
418
+ config_verified: boolean;
419
+ } | null>;
420
+ /**
421
+ * Destroy SDK instance and cleanup store
422
+ */
423
+ destroy: () => void;
424
+ }
425
+ export { IntegryJS as default };