@onlive.ai/flow-client 0.0.3

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.
@@ -0,0 +1,1013 @@
1
+ import { z } from 'zod';
2
+
3
+ export declare type ClientOptions = z.infer<typeof ClientOptionsSchema>;
4
+
5
+ /**
6
+ * Schema for validating client options.
7
+ *
8
+ * @property {string} baseUrl - The base URL for the client. Must be a valid URL and non-empty.
9
+ * @property {string} flowId - The flow identifier. Must be a string of exactly 24 characters and non-empty.
10
+ * @property {string} organizationId - The organization identifier. Must be a valid UUID and non-empty.
11
+ * @property {string} lang - The language code. Must be a string of exactly 2 characters and non-empty.
12
+ */
13
+ declare const ClientOptionsSchema: z.ZodObject<{
14
+ baseUrl: z.ZodString;
15
+ flowId: z.ZodString;
16
+ organizationId: z.ZodString;
17
+ lang: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ organizationId: string;
20
+ baseUrl: string;
21
+ flowId: string;
22
+ lang: string;
23
+ }, {
24
+ organizationId: string;
25
+ baseUrl: string;
26
+ flowId: string;
27
+ lang: string;
28
+ }>;
29
+
30
+ declare type EventListener_2 = (type: TrackingEventType, data: TrackingEventData) => void;
31
+
32
+ declare type EventType = z.infer<typeof EventTypeSchema>;
33
+
34
+ /**
35
+ * Enum schema for event types.
36
+ *
37
+ * This schema defines the possible event types that can be used within the application.
38
+ * Currently, it supports the following event type:
39
+ * - "track": Represents a tracking event.
40
+ */
41
+ declare const EventTypeSchema: z.ZodEnum<["track"]>;
42
+
43
+ export declare class FlowClient {
44
+ private baseURL;
45
+ private headers;
46
+ private flowId;
47
+ private eventListeners;
48
+ private trackingService;
49
+ constructor(_options: ClientOptions);
50
+ /**
51
+ * Sends an HTTP request to the specified path and returns the response as a JSON object.
52
+ *
53
+ * @template T - The expected response type.
54
+ * @param {string} path - The path to which the request is sent.
55
+ * @param {RequestInit} [options={}] - Optional configuration for the request.
56
+ * @returns {Promise<T>} - A promise that resolves to the response data.
57
+ * @throws {Error} - Throws an error if the response status is not ok.
58
+ */
59
+ private request;
60
+ /**
61
+ * Initiates the first step of the flow process.
62
+ *
63
+ * @param {GetStepOptions} options - Optional parameters for getting the step.
64
+ * @returns {Promise<FlowContext>} A promise that resolves to the flow context.
65
+ */
66
+ firstStep(options?: GetStepOptions): Promise<FlowContext>;
67
+ /**
68
+ * Retrieves a specific step in the flow based on the provided step ID and options.
69
+ *
70
+ * @param {string} stepId - The unique identifier of the step to retrieve.
71
+ * @param {GetStepOptions} options - Optional parameters for retrieving the step.
72
+ * @returns {Promise<FlowContext>} A promise that resolves to the FlowContext of the requested step.
73
+ */
74
+ getStep(stepId: string, options?: GetStepOptions): Promise<FlowContext>;
75
+ /**
76
+ * Proceeds to the next step in the flow based on the provided trigger and options.
77
+ *
78
+ * @param {GetStepTrigger} trigger - The trigger information required to determine the next step.
79
+ * @param {GetStepOptions} options - Optional parameters to customize the step retrieval process.
80
+ * @returns {Promise<FlowContext>} A promise that resolves to the updated flow context.
81
+ */
82
+ nextStep(trigger: GetStepTrigger, options?: GetStepOptions): Promise<FlowContext>;
83
+ /**
84
+ * Registers an event listener for a specific event type.
85
+ *
86
+ * @param type - The type of event to listen for.
87
+ * @param listener - The callback function to be invoked when the event is emitted.
88
+ */
89
+ on(type: EventType, listener: EventListener_2): void;
90
+ /**
91
+ * Emits an event to all registered listeners for the specified event type.
92
+ *
93
+ * @param {EventType} eventType - The type of the event to emit.
94
+ * @param {EventData} eventData - The data associated with the event.
95
+ */
96
+ private emit;
97
+ }
98
+
99
+ export declare type FlowContext = z.infer<typeof FlowContextSchema>;
100
+
101
+ /**
102
+ * Schema for the Flow Context.
103
+ *
104
+ * @property {"ok" | "error"} status - An enumeration that indicates the status of the flow context.
105
+ * @property {StepSchema} step - An object that adheres to the `StepSchema`.
106
+ * @property {FlowSchema} flow - An object that adheres to the `FlowSchema`.
107
+ */
108
+ declare const FlowContextSchema: z.ZodObject<{
109
+ status: z.ZodEnum<["ok", "error"]>;
110
+ step: z.ZodObject<{
111
+ id: z.ZodString;
112
+ title: z.ZodOptional<z.ZodString>;
113
+ description: z.ZodOptional<z.ZodString>;
114
+ stageId: z.ZodOptional<z.ZodString>;
115
+ state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
116
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
117
+ name: z.ZodString;
118
+ label: z.ZodString;
119
+ value: z.ZodOptional<z.ZodAny>;
120
+ type: z.ZodEnum<["text", "boolean", "number", "email", "phone", "mobile_phone", "date", "time", "datetime", "password", "url", "void", "location", "availability"]>;
121
+ component: z.ZodOptional<z.ZodEnum<["input", "textarea", "select", "radio", "checkbox", "switch", "carousel", "button", "label", "map", "calendar"]>>;
122
+ selectionMode: z.ZodOptional<z.ZodEnum<["single", "multiple"]>>;
123
+ placeholder: z.ZodOptional<z.ZodString>;
124
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
125
+ label: z.ZodString;
126
+ value: z.ZodOptional<z.ZodAny>;
127
+ image: z.ZodOptional<z.ZodString>;
128
+ description: z.ZodOptional<z.ZodString>;
129
+ disabled: z.ZodOptional<z.ZodBoolean>;
130
+ }, "strip", z.ZodTypeAny, {
131
+ label: string;
132
+ value?: any;
133
+ image?: string | undefined;
134
+ description?: string | undefined;
135
+ disabled?: boolean | undefined;
136
+ }, {
137
+ label: string;
138
+ value?: any;
139
+ image?: string | undefined;
140
+ description?: string | undefined;
141
+ disabled?: boolean | undefined;
142
+ }>, "many">>;
143
+ required: z.ZodOptional<z.ZodBoolean>;
144
+ configuration: z.ZodOptional<z.ZodObject<{
145
+ input: z.ZodOptional<z.ZodObject<{
146
+ min: z.ZodOptional<z.ZodNumber>;
147
+ max: z.ZodOptional<z.ZodNumber>;
148
+ step: z.ZodOptional<z.ZodNumber>;
149
+ regex: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
150
+ prefix: z.ZodOptional<z.ZodString>;
151
+ suffix: z.ZodOptional<z.ZodString>;
152
+ }, "strip", z.ZodTypeAny, {
153
+ min?: number | undefined;
154
+ max?: number | undefined;
155
+ step?: number | undefined;
156
+ regex?: string | undefined;
157
+ prefix?: string | undefined;
158
+ suffix?: string | undefined;
159
+ }, {
160
+ min?: number | undefined;
161
+ max?: number | undefined;
162
+ step?: number | undefined;
163
+ regex?: string | undefined;
164
+ prefix?: string | undefined;
165
+ suffix?: string | undefined;
166
+ }>>;
167
+ map: z.ZodOptional<z.ZodObject<{
168
+ apiKey: z.ZodOptional<z.ZodString>;
169
+ region: z.ZodOptional<z.ZodString>;
170
+ maxZoom: z.ZodOptional<z.ZodNumber>;
171
+ minZoom: z.ZodOptional<z.ZodNumber>;
172
+ minLocations: z.ZodOptional<z.ZodNumber>;
173
+ maxLocations: z.ZodOptional<z.ZodNumber>;
174
+ distanceUnit: z.ZodOptional<z.ZodEnum<["km", "mi"]>>;
175
+ search: z.ZodOptional<z.ZodObject<{
176
+ placeholder: z.ZodOptional<z.ZodString>;
177
+ noResultsText: z.ZodOptional<z.ZodString>;
178
+ autocomplete: z.ZodOptional<z.ZodBoolean>;
179
+ mode: z.ZodOptional<z.ZodEnum<["address", "postcode"]>>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ placeholder?: string | undefined;
182
+ noResultsText?: string | undefined;
183
+ autocomplete?: boolean | undefined;
184
+ mode?: "address" | "postcode" | undefined;
185
+ }, {
186
+ placeholder?: string | undefined;
187
+ noResultsText?: string | undefined;
188
+ autocomplete?: boolean | undefined;
189
+ mode?: "address" | "postcode" | undefined;
190
+ }>>;
191
+ distanceRange: z.ZodOptional<z.ZodObject<{
192
+ initial: z.ZodOptional<z.ZodNumber>;
193
+ min: z.ZodOptional<z.ZodNumber>;
194
+ max: z.ZodOptional<z.ZodNumber>;
195
+ step: z.ZodOptional<z.ZodNumber>;
196
+ }, "strip", z.ZodTypeAny, {
197
+ min?: number | undefined;
198
+ max?: number | undefined;
199
+ step?: number | undefined;
200
+ initial?: number | undefined;
201
+ }, {
202
+ min?: number | undefined;
203
+ max?: number | undefined;
204
+ step?: number | undefined;
205
+ initial?: number | undefined;
206
+ }>>;
207
+ mapRegion: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
208
+ mapPin: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
209
+ }, "strip", z.ZodTypeAny, {
210
+ apiKey?: string | undefined;
211
+ region?: string | undefined;
212
+ maxZoom?: number | undefined;
213
+ minZoom?: number | undefined;
214
+ minLocations?: number | undefined;
215
+ maxLocations?: number | undefined;
216
+ distanceUnit?: "km" | "mi" | undefined;
217
+ search?: {
218
+ placeholder?: string | undefined;
219
+ noResultsText?: string | undefined;
220
+ autocomplete?: boolean | undefined;
221
+ mode?: "address" | "postcode" | undefined;
222
+ } | undefined;
223
+ distanceRange?: {
224
+ min?: number | undefined;
225
+ max?: number | undefined;
226
+ step?: number | undefined;
227
+ initial?: number | undefined;
228
+ } | undefined;
229
+ mapRegion?: {} | undefined;
230
+ mapPin?: {} | undefined;
231
+ }, {
232
+ apiKey?: string | undefined;
233
+ region?: string | undefined;
234
+ maxZoom?: number | undefined;
235
+ minZoom?: number | undefined;
236
+ minLocations?: number | undefined;
237
+ maxLocations?: number | undefined;
238
+ distanceUnit?: "km" | "mi" | undefined;
239
+ search?: {
240
+ placeholder?: string | undefined;
241
+ noResultsText?: string | undefined;
242
+ autocomplete?: boolean | undefined;
243
+ mode?: "address" | "postcode" | undefined;
244
+ } | undefined;
245
+ distanceRange?: {
246
+ min?: number | undefined;
247
+ max?: number | undefined;
248
+ step?: number | undefined;
249
+ initial?: number | undefined;
250
+ } | undefined;
251
+ mapRegion?: {} | undefined;
252
+ mapPin?: {} | undefined;
253
+ }>>;
254
+ calendar: z.ZodOptional<z.ZodObject<{
255
+ time: z.ZodOptional<z.ZodObject<{
256
+ format: z.ZodOptional<z.ZodEnum<["12h", "24h"]>>;
257
+ }, "strip", z.ZodTypeAny, {
258
+ format?: "12h" | "24h" | undefined;
259
+ }, {
260
+ format?: "12h" | "24h" | undefined;
261
+ }>>;
262
+ }, "strip", z.ZodTypeAny, {
263
+ time?: {
264
+ format?: "12h" | "24h" | undefined;
265
+ } | undefined;
266
+ }, {
267
+ time?: {
268
+ format?: "12h" | "24h" | undefined;
269
+ } | undefined;
270
+ }>>;
271
+ }, "strip", z.ZodTypeAny, {
272
+ map?: {
273
+ apiKey?: string | undefined;
274
+ region?: string | undefined;
275
+ maxZoom?: number | undefined;
276
+ minZoom?: number | undefined;
277
+ minLocations?: number | undefined;
278
+ maxLocations?: number | undefined;
279
+ distanceUnit?: "km" | "mi" | undefined;
280
+ search?: {
281
+ placeholder?: string | undefined;
282
+ noResultsText?: string | undefined;
283
+ autocomplete?: boolean | undefined;
284
+ mode?: "address" | "postcode" | undefined;
285
+ } | undefined;
286
+ distanceRange?: {
287
+ min?: number | undefined;
288
+ max?: number | undefined;
289
+ step?: number | undefined;
290
+ initial?: number | undefined;
291
+ } | undefined;
292
+ mapRegion?: {} | undefined;
293
+ mapPin?: {} | undefined;
294
+ } | undefined;
295
+ input?: {
296
+ min?: number | undefined;
297
+ max?: number | undefined;
298
+ step?: number | undefined;
299
+ regex?: string | undefined;
300
+ prefix?: string | undefined;
301
+ suffix?: string | undefined;
302
+ } | undefined;
303
+ calendar?: {
304
+ time?: {
305
+ format?: "12h" | "24h" | undefined;
306
+ } | undefined;
307
+ } | undefined;
308
+ }, {
309
+ map?: {
310
+ apiKey?: string | undefined;
311
+ region?: string | undefined;
312
+ maxZoom?: number | undefined;
313
+ minZoom?: number | undefined;
314
+ minLocations?: number | undefined;
315
+ maxLocations?: number | undefined;
316
+ distanceUnit?: "km" | "mi" | undefined;
317
+ search?: {
318
+ placeholder?: string | undefined;
319
+ noResultsText?: string | undefined;
320
+ autocomplete?: boolean | undefined;
321
+ mode?: "address" | "postcode" | undefined;
322
+ } | undefined;
323
+ distanceRange?: {
324
+ min?: number | undefined;
325
+ max?: number | undefined;
326
+ step?: number | undefined;
327
+ initial?: number | undefined;
328
+ } | undefined;
329
+ mapRegion?: {} | undefined;
330
+ mapPin?: {} | undefined;
331
+ } | undefined;
332
+ input?: {
333
+ min?: number | undefined;
334
+ max?: number | undefined;
335
+ step?: number | undefined;
336
+ regex?: string | undefined;
337
+ prefix?: string | undefined;
338
+ suffix?: string | undefined;
339
+ } | undefined;
340
+ calendar?: {
341
+ time?: {
342
+ format?: "12h" | "24h" | undefined;
343
+ } | undefined;
344
+ } | undefined;
345
+ }>>;
346
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodObject<{
347
+ fieldName: z.ZodString;
348
+ value: z.ZodOptional<z.ZodAny>;
349
+ }, "strip", z.ZodTypeAny, {
350
+ fieldName: string;
351
+ value?: any;
352
+ }, {
353
+ fieldName: string;
354
+ value?: any;
355
+ }>, "many">>;
356
+ dependentBehavior: z.ZodOptional<z.ZodEnum<["hidden", "disabled"]>>;
357
+ }, "strip", z.ZodTypeAny, {
358
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
359
+ name: string;
360
+ label: string;
361
+ value?: any;
362
+ options?: {
363
+ label: string;
364
+ value?: any;
365
+ image?: string | undefined;
366
+ description?: string | undefined;
367
+ disabled?: boolean | undefined;
368
+ }[] | undefined;
369
+ component?: "map" | "label" | "input" | "textarea" | "select" | "radio" | "checkbox" | "switch" | "carousel" | "button" | "calendar" | undefined;
370
+ selectionMode?: "single" | "multiple" | undefined;
371
+ placeholder?: string | undefined;
372
+ required?: boolean | undefined;
373
+ configuration?: {
374
+ map?: {
375
+ apiKey?: string | undefined;
376
+ region?: string | undefined;
377
+ maxZoom?: number | undefined;
378
+ minZoom?: number | undefined;
379
+ minLocations?: number | undefined;
380
+ maxLocations?: number | undefined;
381
+ distanceUnit?: "km" | "mi" | undefined;
382
+ search?: {
383
+ placeholder?: string | undefined;
384
+ noResultsText?: string | undefined;
385
+ autocomplete?: boolean | undefined;
386
+ mode?: "address" | "postcode" | undefined;
387
+ } | undefined;
388
+ distanceRange?: {
389
+ min?: number | undefined;
390
+ max?: number | undefined;
391
+ step?: number | undefined;
392
+ initial?: number | undefined;
393
+ } | undefined;
394
+ mapRegion?: {} | undefined;
395
+ mapPin?: {} | undefined;
396
+ } | undefined;
397
+ input?: {
398
+ min?: number | undefined;
399
+ max?: number | undefined;
400
+ step?: number | undefined;
401
+ regex?: string | undefined;
402
+ prefix?: string | undefined;
403
+ suffix?: string | undefined;
404
+ } | undefined;
405
+ calendar?: {
406
+ time?: {
407
+ format?: "12h" | "24h" | undefined;
408
+ } | undefined;
409
+ } | undefined;
410
+ } | undefined;
411
+ dependsOn?: {
412
+ fieldName: string;
413
+ value?: any;
414
+ }[] | undefined;
415
+ dependentBehavior?: "disabled" | "hidden" | undefined;
416
+ }, {
417
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
418
+ name: string;
419
+ label: string;
420
+ value?: any;
421
+ options?: {
422
+ label: string;
423
+ value?: any;
424
+ image?: string | undefined;
425
+ description?: string | undefined;
426
+ disabled?: boolean | undefined;
427
+ }[] | undefined;
428
+ component?: "map" | "label" | "input" | "textarea" | "select" | "radio" | "checkbox" | "switch" | "carousel" | "button" | "calendar" | undefined;
429
+ selectionMode?: "single" | "multiple" | undefined;
430
+ placeholder?: string | undefined;
431
+ required?: boolean | undefined;
432
+ configuration?: {
433
+ map?: {
434
+ apiKey?: string | undefined;
435
+ region?: string | undefined;
436
+ maxZoom?: number | undefined;
437
+ minZoom?: number | undefined;
438
+ minLocations?: number | undefined;
439
+ maxLocations?: number | undefined;
440
+ distanceUnit?: "km" | "mi" | undefined;
441
+ search?: {
442
+ placeholder?: string | undefined;
443
+ noResultsText?: string | undefined;
444
+ autocomplete?: boolean | undefined;
445
+ mode?: "address" | "postcode" | undefined;
446
+ } | undefined;
447
+ distanceRange?: {
448
+ min?: number | undefined;
449
+ max?: number | undefined;
450
+ step?: number | undefined;
451
+ initial?: number | undefined;
452
+ } | undefined;
453
+ mapRegion?: {} | undefined;
454
+ mapPin?: {} | undefined;
455
+ } | undefined;
456
+ input?: {
457
+ min?: number | undefined;
458
+ max?: number | undefined;
459
+ step?: number | undefined;
460
+ regex?: string | undefined;
461
+ prefix?: string | undefined;
462
+ suffix?: string | undefined;
463
+ } | undefined;
464
+ calendar?: {
465
+ time?: {
466
+ format?: "12h" | "24h" | undefined;
467
+ } | undefined;
468
+ } | undefined;
469
+ } | undefined;
470
+ dependsOn?: {
471
+ fieldName: string;
472
+ value?: any;
473
+ }[] | undefined;
474
+ dependentBehavior?: "disabled" | "hidden" | undefined;
475
+ }>, "many">>;
476
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
477
+ id: z.ZodString;
478
+ type: z.ZodEnum<["submit", "forward", "link", "iCall"]>;
479
+ label: z.ZodString;
480
+ variant: z.ZodEnum<["primary", "secondary", "success", "danger", "warning", "info"]>;
481
+ url: z.ZodOptional<z.ZodString>;
482
+ }, "strip", z.ZodTypeAny, {
483
+ type: "submit" | "forward" | "link" | "iCall";
484
+ label: string;
485
+ id: string;
486
+ variant: "primary" | "secondary" | "success" | "danger" | "warning" | "info";
487
+ url?: string | undefined;
488
+ }, {
489
+ type: "submit" | "forward" | "link" | "iCall";
490
+ label: string;
491
+ id: string;
492
+ variant: "primary" | "secondary" | "success" | "danger" | "warning" | "info";
493
+ url?: string | undefined;
494
+ }>, "many">>;
495
+ result: z.ZodOptional<z.ZodObject<{
496
+ pipelines: z.ZodOptional<z.ZodArray<z.ZodObject<{
497
+ name: z.ZodString;
498
+ data: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
499
+ }, "strip", z.ZodTypeAny, {
500
+ name: string;
501
+ data: {};
502
+ }, {
503
+ name: string;
504
+ data: {};
505
+ }>, "many">>;
506
+ }, "strip", z.ZodTypeAny, {
507
+ pipelines?: {
508
+ name: string;
509
+ data: {};
510
+ }[] | undefined;
511
+ }, {
512
+ pipelines?: {
513
+ name: string;
514
+ data: {};
515
+ }[] | undefined;
516
+ }>>;
517
+ error: z.ZodOptional<z.ZodObject<{
518
+ message: z.ZodOptional<z.ZodString>;
519
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
520
+ name: z.ZodString;
521
+ type: z.ZodEnum<["text", "boolean", "number", "email", "phone", "mobile_phone", "date", "time", "datetime", "password", "url", "void", "location", "availability"]>;
522
+ value: z.ZodAny;
523
+ error: z.ZodString;
524
+ }, "strip", z.ZodTypeAny, {
525
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
526
+ name: string;
527
+ error: string;
528
+ value?: any;
529
+ }, {
530
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
531
+ name: string;
532
+ error: string;
533
+ value?: any;
534
+ }>, "many">>;
535
+ }, "strip", z.ZodTypeAny, {
536
+ message?: string | undefined;
537
+ fields?: {
538
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
539
+ name: string;
540
+ error: string;
541
+ value?: any;
542
+ }[] | undefined;
543
+ }, {
544
+ message?: string | undefined;
545
+ fields?: {
546
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
547
+ name: string;
548
+ error: string;
549
+ value?: any;
550
+ }[] | undefined;
551
+ }>>;
552
+ isFinal: z.ZodOptional<z.ZodBoolean>;
553
+ }, "strip", z.ZodTypeAny, {
554
+ id: string;
555
+ state?: Record<string, any> | undefined;
556
+ fields?: {
557
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
558
+ name: string;
559
+ label: string;
560
+ value?: any;
561
+ options?: {
562
+ label: string;
563
+ value?: any;
564
+ image?: string | undefined;
565
+ description?: string | undefined;
566
+ disabled?: boolean | undefined;
567
+ }[] | undefined;
568
+ component?: "map" | "label" | "input" | "textarea" | "select" | "radio" | "checkbox" | "switch" | "carousel" | "button" | "calendar" | undefined;
569
+ selectionMode?: "single" | "multiple" | undefined;
570
+ placeholder?: string | undefined;
571
+ required?: boolean | undefined;
572
+ configuration?: {
573
+ map?: {
574
+ apiKey?: string | undefined;
575
+ region?: string | undefined;
576
+ maxZoom?: number | undefined;
577
+ minZoom?: number | undefined;
578
+ minLocations?: number | undefined;
579
+ maxLocations?: number | undefined;
580
+ distanceUnit?: "km" | "mi" | undefined;
581
+ search?: {
582
+ placeholder?: string | undefined;
583
+ noResultsText?: string | undefined;
584
+ autocomplete?: boolean | undefined;
585
+ mode?: "address" | "postcode" | undefined;
586
+ } | undefined;
587
+ distanceRange?: {
588
+ min?: number | undefined;
589
+ max?: number | undefined;
590
+ step?: number | undefined;
591
+ initial?: number | undefined;
592
+ } | undefined;
593
+ mapRegion?: {} | undefined;
594
+ mapPin?: {} | undefined;
595
+ } | undefined;
596
+ input?: {
597
+ min?: number | undefined;
598
+ max?: number | undefined;
599
+ step?: number | undefined;
600
+ regex?: string | undefined;
601
+ prefix?: string | undefined;
602
+ suffix?: string | undefined;
603
+ } | undefined;
604
+ calendar?: {
605
+ time?: {
606
+ format?: "12h" | "24h" | undefined;
607
+ } | undefined;
608
+ } | undefined;
609
+ } | undefined;
610
+ dependsOn?: {
611
+ fieldName: string;
612
+ value?: any;
613
+ }[] | undefined;
614
+ dependentBehavior?: "disabled" | "hidden" | undefined;
615
+ }[] | undefined;
616
+ description?: string | undefined;
617
+ title?: string | undefined;
618
+ stageId?: string | undefined;
619
+ actions?: {
620
+ type: "submit" | "forward" | "link" | "iCall";
621
+ label: string;
622
+ id: string;
623
+ variant: "primary" | "secondary" | "success" | "danger" | "warning" | "info";
624
+ url?: string | undefined;
625
+ }[] | undefined;
626
+ result?: {
627
+ pipelines?: {
628
+ name: string;
629
+ data: {};
630
+ }[] | undefined;
631
+ } | undefined;
632
+ error?: {
633
+ message?: string | undefined;
634
+ fields?: {
635
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
636
+ name: string;
637
+ error: string;
638
+ value?: any;
639
+ }[] | undefined;
640
+ } | undefined;
641
+ isFinal?: boolean | undefined;
642
+ }, {
643
+ id: string;
644
+ state?: Record<string, any> | undefined;
645
+ fields?: {
646
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
647
+ name: string;
648
+ label: string;
649
+ value?: any;
650
+ options?: {
651
+ label: string;
652
+ value?: any;
653
+ image?: string | undefined;
654
+ description?: string | undefined;
655
+ disabled?: boolean | undefined;
656
+ }[] | undefined;
657
+ component?: "map" | "label" | "input" | "textarea" | "select" | "radio" | "checkbox" | "switch" | "carousel" | "button" | "calendar" | undefined;
658
+ selectionMode?: "single" | "multiple" | undefined;
659
+ placeholder?: string | undefined;
660
+ required?: boolean | undefined;
661
+ configuration?: {
662
+ map?: {
663
+ apiKey?: string | undefined;
664
+ region?: string | undefined;
665
+ maxZoom?: number | undefined;
666
+ minZoom?: number | undefined;
667
+ minLocations?: number | undefined;
668
+ maxLocations?: number | undefined;
669
+ distanceUnit?: "km" | "mi" | undefined;
670
+ search?: {
671
+ placeholder?: string | undefined;
672
+ noResultsText?: string | undefined;
673
+ autocomplete?: boolean | undefined;
674
+ mode?: "address" | "postcode" | undefined;
675
+ } | undefined;
676
+ distanceRange?: {
677
+ min?: number | undefined;
678
+ max?: number | undefined;
679
+ step?: number | undefined;
680
+ initial?: number | undefined;
681
+ } | undefined;
682
+ mapRegion?: {} | undefined;
683
+ mapPin?: {} | undefined;
684
+ } | undefined;
685
+ input?: {
686
+ min?: number | undefined;
687
+ max?: number | undefined;
688
+ step?: number | undefined;
689
+ regex?: string | undefined;
690
+ prefix?: string | undefined;
691
+ suffix?: string | undefined;
692
+ } | undefined;
693
+ calendar?: {
694
+ time?: {
695
+ format?: "12h" | "24h" | undefined;
696
+ } | undefined;
697
+ } | undefined;
698
+ } | undefined;
699
+ dependsOn?: {
700
+ fieldName: string;
701
+ value?: any;
702
+ }[] | undefined;
703
+ dependentBehavior?: "disabled" | "hidden" | undefined;
704
+ }[] | undefined;
705
+ description?: string | undefined;
706
+ title?: string | undefined;
707
+ stageId?: string | undefined;
708
+ actions?: {
709
+ type: "submit" | "forward" | "link" | "iCall";
710
+ label: string;
711
+ id: string;
712
+ variant: "primary" | "secondary" | "success" | "danger" | "warning" | "info";
713
+ url?: string | undefined;
714
+ }[] | undefined;
715
+ result?: {
716
+ pipelines?: {
717
+ name: string;
718
+ data: {};
719
+ }[] | undefined;
720
+ } | undefined;
721
+ error?: {
722
+ message?: string | undefined;
723
+ fields?: {
724
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
725
+ name: string;
726
+ error: string;
727
+ value?: any;
728
+ }[] | undefined;
729
+ } | undefined;
730
+ isFinal?: boolean | undefined;
731
+ }>;
732
+ flow: z.ZodObject<{
733
+ id: z.ZodString;
734
+ organizationId: z.ZodString;
735
+ updatedAt: z.ZodString;
736
+ stages: z.ZodArray<z.ZodObject<{
737
+ id: z.ZodString;
738
+ name: z.ZodString;
739
+ }, "strip", z.ZodTypeAny, {
740
+ name: string;
741
+ id: string;
742
+ }, {
743
+ name: string;
744
+ id: string;
745
+ }>, "many">;
746
+ }, "strip", z.ZodTypeAny, {
747
+ organizationId: string;
748
+ id: string;
749
+ updatedAt: string;
750
+ stages: {
751
+ name: string;
752
+ id: string;
753
+ }[];
754
+ }, {
755
+ organizationId: string;
756
+ id: string;
757
+ updatedAt: string;
758
+ stages: {
759
+ name: string;
760
+ id: string;
761
+ }[];
762
+ }>;
763
+ }, "strip", z.ZodTypeAny, {
764
+ status: "error" | "ok";
765
+ step: {
766
+ id: string;
767
+ state?: Record<string, any> | undefined;
768
+ fields?: {
769
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
770
+ name: string;
771
+ label: string;
772
+ value?: any;
773
+ options?: {
774
+ label: string;
775
+ value?: any;
776
+ image?: string | undefined;
777
+ description?: string | undefined;
778
+ disabled?: boolean | undefined;
779
+ }[] | undefined;
780
+ component?: "map" | "label" | "input" | "textarea" | "select" | "radio" | "checkbox" | "switch" | "carousel" | "button" | "calendar" | undefined;
781
+ selectionMode?: "single" | "multiple" | undefined;
782
+ placeholder?: string | undefined;
783
+ required?: boolean | undefined;
784
+ configuration?: {
785
+ map?: {
786
+ apiKey?: string | undefined;
787
+ region?: string | undefined;
788
+ maxZoom?: number | undefined;
789
+ minZoom?: number | undefined;
790
+ minLocations?: number | undefined;
791
+ maxLocations?: number | undefined;
792
+ distanceUnit?: "km" | "mi" | undefined;
793
+ search?: {
794
+ placeholder?: string | undefined;
795
+ noResultsText?: string | undefined;
796
+ autocomplete?: boolean | undefined;
797
+ mode?: "address" | "postcode" | undefined;
798
+ } | undefined;
799
+ distanceRange?: {
800
+ min?: number | undefined;
801
+ max?: number | undefined;
802
+ step?: number | undefined;
803
+ initial?: number | undefined;
804
+ } | undefined;
805
+ mapRegion?: {} | undefined;
806
+ mapPin?: {} | undefined;
807
+ } | undefined;
808
+ input?: {
809
+ min?: number | undefined;
810
+ max?: number | undefined;
811
+ step?: number | undefined;
812
+ regex?: string | undefined;
813
+ prefix?: string | undefined;
814
+ suffix?: string | undefined;
815
+ } | undefined;
816
+ calendar?: {
817
+ time?: {
818
+ format?: "12h" | "24h" | undefined;
819
+ } | undefined;
820
+ } | undefined;
821
+ } | undefined;
822
+ dependsOn?: {
823
+ fieldName: string;
824
+ value?: any;
825
+ }[] | undefined;
826
+ dependentBehavior?: "disabled" | "hidden" | undefined;
827
+ }[] | undefined;
828
+ description?: string | undefined;
829
+ title?: string | undefined;
830
+ stageId?: string | undefined;
831
+ actions?: {
832
+ type: "submit" | "forward" | "link" | "iCall";
833
+ label: string;
834
+ id: string;
835
+ variant: "primary" | "secondary" | "success" | "danger" | "warning" | "info";
836
+ url?: string | undefined;
837
+ }[] | undefined;
838
+ result?: {
839
+ pipelines?: {
840
+ name: string;
841
+ data: {};
842
+ }[] | undefined;
843
+ } | undefined;
844
+ error?: {
845
+ message?: string | undefined;
846
+ fields?: {
847
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
848
+ name: string;
849
+ error: string;
850
+ value?: any;
851
+ }[] | undefined;
852
+ } | undefined;
853
+ isFinal?: boolean | undefined;
854
+ };
855
+ flow: {
856
+ organizationId: string;
857
+ id: string;
858
+ updatedAt: string;
859
+ stages: {
860
+ name: string;
861
+ id: string;
862
+ }[];
863
+ };
864
+ }, {
865
+ status: "error" | "ok";
866
+ step: {
867
+ id: string;
868
+ state?: Record<string, any> | undefined;
869
+ fields?: {
870
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
871
+ name: string;
872
+ label: string;
873
+ value?: any;
874
+ options?: {
875
+ label: string;
876
+ value?: any;
877
+ image?: string | undefined;
878
+ description?: string | undefined;
879
+ disabled?: boolean | undefined;
880
+ }[] | undefined;
881
+ component?: "map" | "label" | "input" | "textarea" | "select" | "radio" | "checkbox" | "switch" | "carousel" | "button" | "calendar" | undefined;
882
+ selectionMode?: "single" | "multiple" | undefined;
883
+ placeholder?: string | undefined;
884
+ required?: boolean | undefined;
885
+ configuration?: {
886
+ map?: {
887
+ apiKey?: string | undefined;
888
+ region?: string | undefined;
889
+ maxZoom?: number | undefined;
890
+ minZoom?: number | undefined;
891
+ minLocations?: number | undefined;
892
+ maxLocations?: number | undefined;
893
+ distanceUnit?: "km" | "mi" | undefined;
894
+ search?: {
895
+ placeholder?: string | undefined;
896
+ noResultsText?: string | undefined;
897
+ autocomplete?: boolean | undefined;
898
+ mode?: "address" | "postcode" | undefined;
899
+ } | undefined;
900
+ distanceRange?: {
901
+ min?: number | undefined;
902
+ max?: number | undefined;
903
+ step?: number | undefined;
904
+ initial?: number | undefined;
905
+ } | undefined;
906
+ mapRegion?: {} | undefined;
907
+ mapPin?: {} | undefined;
908
+ } | undefined;
909
+ input?: {
910
+ min?: number | undefined;
911
+ max?: number | undefined;
912
+ step?: number | undefined;
913
+ regex?: string | undefined;
914
+ prefix?: string | undefined;
915
+ suffix?: string | undefined;
916
+ } | undefined;
917
+ calendar?: {
918
+ time?: {
919
+ format?: "12h" | "24h" | undefined;
920
+ } | undefined;
921
+ } | undefined;
922
+ } | undefined;
923
+ dependsOn?: {
924
+ fieldName: string;
925
+ value?: any;
926
+ }[] | undefined;
927
+ dependentBehavior?: "disabled" | "hidden" | undefined;
928
+ }[] | undefined;
929
+ description?: string | undefined;
930
+ title?: string | undefined;
931
+ stageId?: string | undefined;
932
+ actions?: {
933
+ type: "submit" | "forward" | "link" | "iCall";
934
+ label: string;
935
+ id: string;
936
+ variant: "primary" | "secondary" | "success" | "danger" | "warning" | "info";
937
+ url?: string | undefined;
938
+ }[] | undefined;
939
+ result?: {
940
+ pipelines?: {
941
+ name: string;
942
+ data: {};
943
+ }[] | undefined;
944
+ } | undefined;
945
+ error?: {
946
+ message?: string | undefined;
947
+ fields?: {
948
+ type: "number" | "boolean" | "text" | "email" | "phone" | "mobile_phone" | "date" | "time" | "datetime" | "password" | "url" | "void" | "location" | "availability";
949
+ name: string;
950
+ error: string;
951
+ value?: any;
952
+ }[] | undefined;
953
+ } | undefined;
954
+ isFinal?: boolean | undefined;
955
+ };
956
+ flow: {
957
+ organizationId: string;
958
+ id: string;
959
+ updatedAt: string;
960
+ stages: {
961
+ name: string;
962
+ id: string;
963
+ }[];
964
+ };
965
+ }>;
966
+
967
+ export declare type GetStepOptions = z.infer<typeof GetStepOptionsSchema>;
968
+
969
+ /**
970
+ * Schema for validating the options passed to the GetStep function.
971
+ *
972
+ * @property {Record<string, any>} [state] - An optional record containing state information.
973
+ * @property {Record<string, any>} [fields] - An optional record containing field information.
974
+ */
975
+ declare const GetStepOptionsSchema: z.ZodObject<{
976
+ state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
977
+ fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
978
+ }, "strip", z.ZodTypeAny, {
979
+ state?: Record<string, any> | undefined;
980
+ fields?: Record<string, any> | undefined;
981
+ }, {
982
+ state?: Record<string, any> | undefined;
983
+ fields?: Record<string, any> | undefined;
984
+ }>;
985
+
986
+ export declare type GetStepTrigger = z.infer<typeof GetStepTriggerSchema>;
987
+
988
+ /**
989
+ * Schema for validating the trigger of a step in the flow.
990
+ *
991
+ * @property {string} currentStepId - The ID of the current step, must be a non-empty string.
992
+ * @property {string} actionId - The ID of the action, must be a non-empty string.
993
+ */
994
+ declare const GetStepTriggerSchema: z.ZodObject<{
995
+ currentStepId: z.ZodString;
996
+ actionId: z.ZodString;
997
+ }, "strip", z.ZodTypeAny, {
998
+ currentStepId: string;
999
+ actionId: string;
1000
+ }, {
1001
+ currentStepId: string;
1002
+ actionId: string;
1003
+ }>;
1004
+
1005
+ export declare type TrackingEventData = z.infer<typeof TrackingEventDataSchema>;
1006
+
1007
+ declare const TrackingEventDataSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1008
+
1009
+ export declare type TrackingEventType = z.infer<typeof TrackingEventTypeSchema>;
1010
+
1011
+ declare const TrackingEventTypeSchema: z.ZodEnum<["step_impression", "element_click", "form_submit", "form_error", "step_action"]>;
1012
+
1013
+ export { }