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