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