@integry/sdk 3.2.6-beta.7 → 3.2.7-beta.1

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