@integry/sdk 3.3.1-beta.15 → 3.3.1-beta.17

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