@integry/sdk 3.2.6-beta.7 → 3.2.7

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,396 @@
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 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 };