@onlive.ai/flow-client 0.1.48 → 0.1.49
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.
- package/client/client.service.cjs +2 -2
- package/client/client.service.js +2 -2
- package/client/client.service.spec.cjs +2 -2
- package/client/client.service.spec.js +2 -2
- package/client/client.types.cjs +2 -2
- package/client/client.types.d.cts +45 -45
- package/client/client.types.d.ts +45 -45
- package/client/client.types.js +2 -2
- package/flow.types.cjs +1 -1
- package/flow.types.js +1 -1
- package/index.cjs +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/schema-generator.cjs +1 -1
- package/schema-generator.js +1 -1
- package/tracking/tracking.service.cjs +1 -1
- package/tracking/tracking.service.js +1 -1
- package/tracking/tracking.types.cjs +1 -1
- package/tracking/tracking.types.js +1 -1
package/client/client.types.d.ts
CHANGED
|
@@ -2539,7 +2539,7 @@ declare const Step: z.ZodObject<{
|
|
|
2539
2539
|
datetime: string;
|
|
2540
2540
|
meta?: Record<string, any> | undefined;
|
|
2541
2541
|
}>]>>;
|
|
2542
|
-
operator: z.ZodOptional<z.ZodEnum<["exists", "
|
|
2542
|
+
operator: z.ZodOptional<z.ZodEnum<["exists", "equals", "not-equals", "contains", "not-contains", "greater-than", "less-than"]>>;
|
|
2543
2543
|
}, "strip", z.ZodTypeAny, {
|
|
2544
2544
|
fieldName: string;
|
|
2545
2545
|
value?: string | number | boolean | {
|
|
@@ -2556,7 +2556,7 @@ declare const Step: z.ZodObject<{
|
|
|
2556
2556
|
datetime: string;
|
|
2557
2557
|
meta?: Record<string, any> | undefined;
|
|
2558
2558
|
} | undefined;
|
|
2559
|
-
operator?: "exists" | "
|
|
2559
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
2560
2560
|
}, {
|
|
2561
2561
|
fieldName: string;
|
|
2562
2562
|
value?: string | number | boolean | {
|
|
@@ -2573,7 +2573,7 @@ declare const Step: z.ZodObject<{
|
|
|
2573
2573
|
datetime: string;
|
|
2574
2574
|
meta?: Record<string, any> | undefined;
|
|
2575
2575
|
} | undefined;
|
|
2576
|
-
operator?: "exists" | "
|
|
2576
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
2577
2577
|
}>, "many">>;
|
|
2578
2578
|
}, "strip", z.ZodTypeAny, {
|
|
2579
2579
|
label: string;
|
|
@@ -2610,7 +2610,7 @@ declare const Step: z.ZodObject<{
|
|
|
2610
2610
|
datetime: string;
|
|
2611
2611
|
meta?: Record<string, any> | undefined;
|
|
2612
2612
|
} | undefined;
|
|
2613
|
-
operator?: "exists" | "
|
|
2613
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
2614
2614
|
}[] | undefined;
|
|
2615
2615
|
attributes?: Record<string, any> | undefined;
|
|
2616
2616
|
}, {
|
|
@@ -2648,7 +2648,7 @@ declare const Step: z.ZodObject<{
|
|
|
2648
2648
|
datetime: string;
|
|
2649
2649
|
meta?: Record<string, any> | undefined;
|
|
2650
2650
|
} | undefined;
|
|
2651
|
-
operator?: "exists" | "
|
|
2651
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
2652
2652
|
}[] | undefined;
|
|
2653
2653
|
attributes?: Record<string, any> | undefined;
|
|
2654
2654
|
}>, "many">>;
|
|
@@ -4636,7 +4636,7 @@ declare const Step: z.ZodObject<{
|
|
|
4636
4636
|
datetime: string;
|
|
4637
4637
|
meta?: Record<string, any> | undefined;
|
|
4638
4638
|
} | undefined;
|
|
4639
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
4639
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
4640
4640
|
}, {
|
|
4641
4641
|
fieldName: string;
|
|
4642
4642
|
value?: string | number | boolean | {
|
|
@@ -4653,7 +4653,7 @@ declare const Step: z.ZodObject<{
|
|
|
4653
4653
|
datetime: string;
|
|
4654
4654
|
meta?: Record<string, any> | undefined;
|
|
4655
4655
|
} | undefined;
|
|
4656
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
4656
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
4657
4657
|
}>, "many">>;
|
|
4658
4658
|
dependentBehavior: z.ZodOptional<z.ZodEnum<["hidden", "disabled"]>>;
|
|
4659
4659
|
customError: z.ZodOptional<z.ZodObject<{
|
|
@@ -4746,7 +4746,7 @@ declare const Step: z.ZodObject<{
|
|
|
4746
4746
|
datetime: string;
|
|
4747
4747
|
meta?: Record<string, any> | undefined;
|
|
4748
4748
|
} | undefined;
|
|
4749
|
-
operator?: "exists" | "
|
|
4749
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
4750
4750
|
}[] | undefined;
|
|
4751
4751
|
attributes?: Record<string, any> | undefined;
|
|
4752
4752
|
}[] | undefined;
|
|
@@ -5018,7 +5018,7 @@ declare const Step: z.ZodObject<{
|
|
|
5018
5018
|
datetime: string;
|
|
5019
5019
|
meta?: Record<string, any> | undefined;
|
|
5020
5020
|
} | undefined;
|
|
5021
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
5021
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
5022
5022
|
}[] | undefined;
|
|
5023
5023
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
5024
5024
|
customError?: {
|
|
@@ -5096,7 +5096,7 @@ declare const Step: z.ZodObject<{
|
|
|
5096
5096
|
datetime: string;
|
|
5097
5097
|
meta?: Record<string, any> | undefined;
|
|
5098
5098
|
} | undefined;
|
|
5099
|
-
operator?: "exists" | "
|
|
5099
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
5100
5100
|
}[] | undefined;
|
|
5101
5101
|
attributes?: Record<string, any> | undefined;
|
|
5102
5102
|
}[] | undefined;
|
|
@@ -5368,7 +5368,7 @@ declare const Step: z.ZodObject<{
|
|
|
5368
5368
|
datetime: string;
|
|
5369
5369
|
meta?: Record<string, any> | undefined;
|
|
5370
5370
|
} | undefined;
|
|
5371
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
5371
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
5372
5372
|
}[] | undefined;
|
|
5373
5373
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
5374
5374
|
customError?: {
|
|
@@ -5603,7 +5603,7 @@ declare const Step: z.ZodObject<{
|
|
|
5603
5603
|
datetime: string;
|
|
5604
5604
|
meta?: Record<string, any> | undefined;
|
|
5605
5605
|
} | undefined;
|
|
5606
|
-
operator?: "exists" | "
|
|
5606
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
5607
5607
|
}[] | undefined;
|
|
5608
5608
|
attributes?: Record<string, any> | undefined;
|
|
5609
5609
|
}[] | undefined;
|
|
@@ -5875,7 +5875,7 @@ declare const Step: z.ZodObject<{
|
|
|
5875
5875
|
datetime: string;
|
|
5876
5876
|
meta?: Record<string, any> | undefined;
|
|
5877
5877
|
} | undefined;
|
|
5878
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
5878
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
5879
5879
|
}[] | undefined;
|
|
5880
5880
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
5881
5881
|
customError?: {
|
|
@@ -6000,7 +6000,7 @@ declare const Step: z.ZodObject<{
|
|
|
6000
6000
|
datetime: string;
|
|
6001
6001
|
meta?: Record<string, any> | undefined;
|
|
6002
6002
|
} | undefined;
|
|
6003
|
-
operator?: "exists" | "
|
|
6003
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
6004
6004
|
}[] | undefined;
|
|
6005
6005
|
attributes?: Record<string, any> | undefined;
|
|
6006
6006
|
}[] | undefined;
|
|
@@ -6272,7 +6272,7 @@ declare const Step: z.ZodObject<{
|
|
|
6272
6272
|
datetime: string;
|
|
6273
6273
|
meta?: Record<string, any> | undefined;
|
|
6274
6274
|
} | undefined;
|
|
6275
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
6275
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
6276
6276
|
}[] | undefined;
|
|
6277
6277
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
6278
6278
|
customError?: {
|
|
@@ -6875,7 +6875,7 @@ declare const Field: z.ZodObject<{
|
|
|
6875
6875
|
datetime: string;
|
|
6876
6876
|
meta?: Record<string, any> | undefined;
|
|
6877
6877
|
}>]>>;
|
|
6878
|
-
operator: z.ZodOptional<z.ZodEnum<["exists", "
|
|
6878
|
+
operator: z.ZodOptional<z.ZodEnum<["exists", "equals", "not-equals", "contains", "not-contains", "greater-than", "less-than"]>>;
|
|
6879
6879
|
}, "strip", z.ZodTypeAny, {
|
|
6880
6880
|
fieldName: string;
|
|
6881
6881
|
value?: string | number | boolean | {
|
|
@@ -6892,7 +6892,7 @@ declare const Field: z.ZodObject<{
|
|
|
6892
6892
|
datetime: string;
|
|
6893
6893
|
meta?: Record<string, any> | undefined;
|
|
6894
6894
|
} | undefined;
|
|
6895
|
-
operator?: "exists" | "
|
|
6895
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
6896
6896
|
}, {
|
|
6897
6897
|
fieldName: string;
|
|
6898
6898
|
value?: string | number | boolean | {
|
|
@@ -6909,7 +6909,7 @@ declare const Field: z.ZodObject<{
|
|
|
6909
6909
|
datetime: string;
|
|
6910
6910
|
meta?: Record<string, any> | undefined;
|
|
6911
6911
|
} | undefined;
|
|
6912
|
-
operator?: "exists" | "
|
|
6912
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
6913
6913
|
}>, "many">>;
|
|
6914
6914
|
}, "strip", z.ZodTypeAny, {
|
|
6915
6915
|
label: string;
|
|
@@ -6946,7 +6946,7 @@ declare const Field: z.ZodObject<{
|
|
|
6946
6946
|
datetime: string;
|
|
6947
6947
|
meta?: Record<string, any> | undefined;
|
|
6948
6948
|
} | undefined;
|
|
6949
|
-
operator?: "exists" | "
|
|
6949
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
6950
6950
|
}[] | undefined;
|
|
6951
6951
|
attributes?: Record<string, any> | undefined;
|
|
6952
6952
|
}, {
|
|
@@ -6984,7 +6984,7 @@ declare const Field: z.ZodObject<{
|
|
|
6984
6984
|
datetime: string;
|
|
6985
6985
|
meta?: Record<string, any> | undefined;
|
|
6986
6986
|
} | undefined;
|
|
6987
|
-
operator?: "exists" | "
|
|
6987
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
6988
6988
|
}[] | undefined;
|
|
6989
6989
|
attributes?: Record<string, any> | undefined;
|
|
6990
6990
|
}>, "many">>;
|
|
@@ -8972,7 +8972,7 @@ declare const Field: z.ZodObject<{
|
|
|
8972
8972
|
datetime: string;
|
|
8973
8973
|
meta?: Record<string, any> | undefined;
|
|
8974
8974
|
} | undefined;
|
|
8975
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
8975
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
8976
8976
|
}, {
|
|
8977
8977
|
fieldName: string;
|
|
8978
8978
|
value?: string | number | boolean | {
|
|
@@ -8989,7 +8989,7 @@ declare const Field: z.ZodObject<{
|
|
|
8989
8989
|
datetime: string;
|
|
8990
8990
|
meta?: Record<string, any> | undefined;
|
|
8991
8991
|
} | undefined;
|
|
8992
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
8992
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
8993
8993
|
}>, "many">>;
|
|
8994
8994
|
dependentBehavior: z.ZodOptional<z.ZodEnum<["hidden", "disabled"]>>;
|
|
8995
8995
|
customError: z.ZodOptional<z.ZodObject<{
|
|
@@ -9082,7 +9082,7 @@ declare const Field: z.ZodObject<{
|
|
|
9082
9082
|
datetime: string;
|
|
9083
9083
|
meta?: Record<string, any> | undefined;
|
|
9084
9084
|
} | undefined;
|
|
9085
|
-
operator?: "exists" | "
|
|
9085
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
9086
9086
|
}[] | undefined;
|
|
9087
9087
|
attributes?: Record<string, any> | undefined;
|
|
9088
9088
|
}[] | undefined;
|
|
@@ -9354,7 +9354,7 @@ declare const Field: z.ZodObject<{
|
|
|
9354
9354
|
datetime: string;
|
|
9355
9355
|
meta?: Record<string, any> | undefined;
|
|
9356
9356
|
} | undefined;
|
|
9357
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
9357
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
9358
9358
|
}[] | undefined;
|
|
9359
9359
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
9360
9360
|
customError?: {
|
|
@@ -9432,7 +9432,7 @@ declare const Field: z.ZodObject<{
|
|
|
9432
9432
|
datetime: string;
|
|
9433
9433
|
meta?: Record<string, any> | undefined;
|
|
9434
9434
|
} | undefined;
|
|
9435
|
-
operator?: "exists" | "
|
|
9435
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
9436
9436
|
}[] | undefined;
|
|
9437
9437
|
attributes?: Record<string, any> | undefined;
|
|
9438
9438
|
}[] | undefined;
|
|
@@ -9704,7 +9704,7 @@ declare const Field: z.ZodObject<{
|
|
|
9704
9704
|
datetime: string;
|
|
9705
9705
|
meta?: Record<string, any> | undefined;
|
|
9706
9706
|
} | undefined;
|
|
9707
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
9707
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
9708
9708
|
}[] | undefined;
|
|
9709
9709
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
9710
9710
|
customError?: {
|
|
@@ -10207,7 +10207,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
10207
10207
|
datetime: string;
|
|
10208
10208
|
meta?: Record<string, any> | undefined;
|
|
10209
10209
|
}>]>>;
|
|
10210
|
-
operator: z.ZodOptional<z.ZodEnum<["exists", "
|
|
10210
|
+
operator: z.ZodOptional<z.ZodEnum<["exists", "equals", "not-equals", "contains", "not-contains", "greater-than", "less-than"]>>;
|
|
10211
10211
|
}, "strip", z.ZodTypeAny, {
|
|
10212
10212
|
fieldName: string;
|
|
10213
10213
|
value?: string | number | boolean | {
|
|
@@ -10224,7 +10224,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
10224
10224
|
datetime: string;
|
|
10225
10225
|
meta?: Record<string, any> | undefined;
|
|
10226
10226
|
} | undefined;
|
|
10227
|
-
operator?: "exists" | "
|
|
10227
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
10228
10228
|
}, {
|
|
10229
10229
|
fieldName: string;
|
|
10230
10230
|
value?: string | number | boolean | {
|
|
@@ -10241,7 +10241,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
10241
10241
|
datetime: string;
|
|
10242
10242
|
meta?: Record<string, any> | undefined;
|
|
10243
10243
|
} | undefined;
|
|
10244
|
-
operator?: "exists" | "
|
|
10244
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
10245
10245
|
}>, "many">>;
|
|
10246
10246
|
}, "strip", z.ZodTypeAny, {
|
|
10247
10247
|
label: string;
|
|
@@ -10278,7 +10278,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
10278
10278
|
datetime: string;
|
|
10279
10279
|
meta?: Record<string, any> | undefined;
|
|
10280
10280
|
} | undefined;
|
|
10281
|
-
operator?: "exists" | "
|
|
10281
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
10282
10282
|
}[] | undefined;
|
|
10283
10283
|
attributes?: Record<string, any> | undefined;
|
|
10284
10284
|
}, {
|
|
@@ -10316,7 +10316,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
10316
10316
|
datetime: string;
|
|
10317
10317
|
meta?: Record<string, any> | undefined;
|
|
10318
10318
|
} | undefined;
|
|
10319
|
-
operator?: "exists" | "
|
|
10319
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
10320
10320
|
}[] | undefined;
|
|
10321
10321
|
attributes?: Record<string, any> | undefined;
|
|
10322
10322
|
}>, "many">>;
|
|
@@ -12304,7 +12304,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
12304
12304
|
datetime: string;
|
|
12305
12305
|
meta?: Record<string, any> | undefined;
|
|
12306
12306
|
} | undefined;
|
|
12307
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
12307
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
12308
12308
|
}, {
|
|
12309
12309
|
fieldName: string;
|
|
12310
12310
|
value?: string | number | boolean | {
|
|
@@ -12321,7 +12321,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
12321
12321
|
datetime: string;
|
|
12322
12322
|
meta?: Record<string, any> | undefined;
|
|
12323
12323
|
} | undefined;
|
|
12324
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
12324
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
12325
12325
|
}>, "many">>;
|
|
12326
12326
|
dependentBehavior: z.ZodOptional<z.ZodEnum<["hidden", "disabled"]>>;
|
|
12327
12327
|
customError: z.ZodOptional<z.ZodObject<{
|
|
@@ -12414,7 +12414,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
12414
12414
|
datetime: string;
|
|
12415
12415
|
meta?: Record<string, any> | undefined;
|
|
12416
12416
|
} | undefined;
|
|
12417
|
-
operator?: "exists" | "
|
|
12417
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
12418
12418
|
}[] | undefined;
|
|
12419
12419
|
attributes?: Record<string, any> | undefined;
|
|
12420
12420
|
}[] | undefined;
|
|
@@ -12686,7 +12686,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
12686
12686
|
datetime: string;
|
|
12687
12687
|
meta?: Record<string, any> | undefined;
|
|
12688
12688
|
} | undefined;
|
|
12689
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
12689
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
12690
12690
|
}[] | undefined;
|
|
12691
12691
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
12692
12692
|
customError?: {
|
|
@@ -12764,7 +12764,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
12764
12764
|
datetime: string;
|
|
12765
12765
|
meta?: Record<string, any> | undefined;
|
|
12766
12766
|
} | undefined;
|
|
12767
|
-
operator?: "exists" | "
|
|
12767
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
12768
12768
|
}[] | undefined;
|
|
12769
12769
|
attributes?: Record<string, any> | undefined;
|
|
12770
12770
|
}[] | undefined;
|
|
@@ -13036,7 +13036,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
13036
13036
|
datetime: string;
|
|
13037
13037
|
meta?: Record<string, any> | undefined;
|
|
13038
13038
|
} | undefined;
|
|
13039
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
13039
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
13040
13040
|
}[] | undefined;
|
|
13041
13041
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
13042
13042
|
customError?: {
|
|
@@ -13271,7 +13271,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
13271
13271
|
datetime: string;
|
|
13272
13272
|
meta?: Record<string, any> | undefined;
|
|
13273
13273
|
} | undefined;
|
|
13274
|
-
operator?: "exists" | "
|
|
13274
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
13275
13275
|
}[] | undefined;
|
|
13276
13276
|
attributes?: Record<string, any> | undefined;
|
|
13277
13277
|
}[] | undefined;
|
|
@@ -13543,7 +13543,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
13543
13543
|
datetime: string;
|
|
13544
13544
|
meta?: Record<string, any> | undefined;
|
|
13545
13545
|
} | undefined;
|
|
13546
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
13546
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
13547
13547
|
}[] | undefined;
|
|
13548
13548
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
13549
13549
|
customError?: {
|
|
@@ -13668,7 +13668,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
13668
13668
|
datetime: string;
|
|
13669
13669
|
meta?: Record<string, any> | undefined;
|
|
13670
13670
|
} | undefined;
|
|
13671
|
-
operator?: "exists" | "
|
|
13671
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
13672
13672
|
}[] | undefined;
|
|
13673
13673
|
attributes?: Record<string, any> | undefined;
|
|
13674
13674
|
}[] | undefined;
|
|
@@ -13940,7 +13940,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
13940
13940
|
datetime: string;
|
|
13941
13941
|
meta?: Record<string, any> | undefined;
|
|
13942
13942
|
} | undefined;
|
|
13943
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
13943
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
13944
13944
|
}[] | undefined;
|
|
13945
13945
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
13946
13946
|
customError?: {
|
|
@@ -14099,7 +14099,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
14099
14099
|
datetime: string;
|
|
14100
14100
|
meta?: Record<string, any> | undefined;
|
|
14101
14101
|
} | undefined;
|
|
14102
|
-
operator?: "exists" | "
|
|
14102
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
14103
14103
|
}[] | undefined;
|
|
14104
14104
|
attributes?: Record<string, any> | undefined;
|
|
14105
14105
|
}[] | undefined;
|
|
@@ -14371,7 +14371,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
14371
14371
|
datetime: string;
|
|
14372
14372
|
meta?: Record<string, any> | undefined;
|
|
14373
14373
|
} | undefined;
|
|
14374
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
14374
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
14375
14375
|
}[] | undefined;
|
|
14376
14376
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
14377
14377
|
customError?: {
|
|
@@ -14508,7 +14508,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
14508
14508
|
datetime: string;
|
|
14509
14509
|
meta?: Record<string, any> | undefined;
|
|
14510
14510
|
} | undefined;
|
|
14511
|
-
operator?: "exists" | "
|
|
14511
|
+
operator?: "exists" | "contains" | "equals" | "not-equals" | "not-contains" | "greater-than" | "less-than" | undefined;
|
|
14512
14512
|
}[] | undefined;
|
|
14513
14513
|
attributes?: Record<string, any> | undefined;
|
|
14514
14514
|
}[] | undefined;
|
|
@@ -14780,7 +14780,7 @@ declare const FlowContext: z.ZodObject<{
|
|
|
14780
14780
|
datetime: string;
|
|
14781
14781
|
meta?: Record<string, any> | undefined;
|
|
14782
14782
|
} | undefined;
|
|
14783
|
-
operator?: "exists" | "equal" | "contains" | "not-
|
|
14783
|
+
operator?: "exists" | "equal" | "contains" | "not-contains" | "greater-than" | "less-than" | "not-equal" | undefined;
|
|
14784
14784
|
}[] | undefined;
|
|
14785
14785
|
dependentBehavior?: "hidden" | "disabled" | undefined;
|
|
14786
14786
|
customError?: {
|
package/client/client.types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @onlive.ai/flow-client v0.1.
|
|
2
|
-
import{GetAvailabilityFilters as s,GetAvailabilityOptions as c}from"@onlive.ai/calendar";import{z as o}from"zod";import{z as t}from"zod";var l=t.object({enabled:t.boolean().default(!1).optional(),data:t.custom().optional(),removeExtraneousValues:t.boolean().default(!0).optional(),allowBotTraffic:t.boolean().default(!1).optional(),adapters:t.array(t.string()).default([]).optional(),apiUrl:t.string().url().optional(),emitters:t.object({windowEvent:t.boolean().optional(),dataLayer:t.boolean().optional(),windowPostMessage:t.boolean().optional()}).optional()});var _={tracking:{removeExtraneousValues:!0,apiUrl:"https://srvless.onlive.site/tracking",data:{widget_type:"OnliveAppFlow"}}},L=o.string().nonempty(),I=o.object({baseUrl:o.string().url().nonempty(),flowId:o.string().length(24).nonempty(),organizationId:o.string().uuid().nonempty(),lang:o.string().length(2).nonempty(),tracking:l.optional(),devMode:o.boolean().default(!1).optional()}),D=o.object({state:o.record(o.string(),o.any()).optional(),fields:o.record(o.string(),o.any()).optional()}),S=o.object({currentStepId:o.string().nonempty(),actionId:o.string().nonempty()}),p=o.enum(["text","boolean","number","email","phone","mobile_phone","date","time","datetime","password","url","color","object","void","location","availability"]),m=o.object({name:o.string(),value:o.string().optional(),icon:o.string().optional(),type:o.enum(["url","email","phone"]).optional()}),b=o.object({lat:o.number().min(-90).max(90),lng:o.number().min(-180).max(180),meta:o.record(o.string(),o.any()).optional(),properties:o.record(o.string(),m).optional()}),g=o.object({datetime:o.string().datetime(),meta:o.record(o.string(),o.any()).optional()}),e=o.union([o.string(),o.number(),o.boolean(),b,g]),i=o.object({content:o.object({icon:o.string().optional(),url:o.string().url().optional(),width:o.string().optional(),height:o.string().optional(),scale:o.number().optional()}).optional(),background:o.string().optional(),glyph:o.object({color:o.string().optional(),url:o.string().url().optional(),icon:o.string().optional()}).optional(),borderColor:o.string().optional(),scale:o.number().optional()}),a=o.custom(r=>/^\d{4}-\d{2}-\d{2}$/.test(r),{message:"Date must be in 'YYYY-MM-DD' format"}),n=o.object({text:o.string().optional(),icon:o.string().optional()}),u=o.object({name:o.string().nonempty(),label:o.string().optional(),value:o.union([e,o.array(e)]).optional(),type:p,component:o.enum(["input","textarea","select","radio","checkbox","switch","rating","carousel","button","label","map","calendar"]).optional(),disabled:o.boolean().optional(),readonly:o.boolean().optional(),multiple:o.boolean().optional(),placeholder:o.string().optional(),options:o.array(o.object({label:o.string().nonempty(),value:e.optional(),image:o.string().url().optional(),description:o.string().optional(),disabled:o.boolean().optional(),attributes:o.record(o.string(),o.any()).optional(),dependsOn:o.array(o.object({fieldName:o.string().nonempty(),value:e.optional(),operator:o.enum(["exists","
|
|
1
|
+
/*! @onlive.ai/flow-client v0.1.49 | © 2025 Onlive.ai */
|
|
2
|
+
import{GetAvailabilityFilters as s,GetAvailabilityOptions as c}from"@onlive.ai/calendar";import{z as o}from"zod";import{z as t}from"zod";var l=t.object({enabled:t.boolean().default(!1).optional(),data:t.custom().optional(),removeExtraneousValues:t.boolean().default(!0).optional(),allowBotTraffic:t.boolean().default(!1).optional(),adapters:t.array(t.string()).default([]).optional(),apiUrl:t.string().url().optional(),emitters:t.object({windowEvent:t.boolean().optional(),dataLayer:t.boolean().optional(),windowPostMessage:t.boolean().optional()}).optional()});var _={tracking:{removeExtraneousValues:!0,apiUrl:"https://srvless.onlive.site/tracking",data:{widget_type:"OnliveAppFlow"}}},L=o.string().nonempty(),I=o.object({baseUrl:o.string().url().nonempty(),flowId:o.string().length(24).nonempty(),organizationId:o.string().uuid().nonempty(),lang:o.string().length(2).nonempty(),tracking:l.optional(),devMode:o.boolean().default(!1).optional()}),D=o.object({state:o.record(o.string(),o.any()).optional(),fields:o.record(o.string(),o.any()).optional()}),S=o.object({currentStepId:o.string().nonempty(),actionId:o.string().nonempty()}),p=o.enum(["text","boolean","number","email","phone","mobile_phone","date","time","datetime","password","url","color","object","void","location","availability"]),m=o.object({name:o.string(),value:o.string().optional(),icon:o.string().optional(),type:o.enum(["url","email","phone"]).optional()}),b=o.object({lat:o.number().min(-90).max(90),lng:o.number().min(-180).max(180),meta:o.record(o.string(),o.any()).optional(),properties:o.record(o.string(),m).optional()}),g=o.object({datetime:o.string().datetime(),meta:o.record(o.string(),o.any()).optional()}),e=o.union([o.string(),o.number(),o.boolean(),b,g]),i=o.object({content:o.object({icon:o.string().optional(),url:o.string().url().optional(),width:o.string().optional(),height:o.string().optional(),scale:o.number().optional()}).optional(),background:o.string().optional(),glyph:o.object({color:o.string().optional(),url:o.string().url().optional(),icon:o.string().optional()}).optional(),borderColor:o.string().optional(),scale:o.number().optional()}),a=o.custom(r=>/^\d{4}-\d{2}-\d{2}$/.test(r),{message:"Date must be in 'YYYY-MM-DD' format"}),n=o.object({text:o.string().optional(),icon:o.string().optional()}),u=o.object({name:o.string().nonempty(),label:o.string().optional(),value:o.union([e,o.array(e)]).optional(),type:p,component:o.enum(["input","textarea","select","radio","checkbox","switch","rating","carousel","button","label","map","calendar"]).optional(),disabled:o.boolean().optional(),readonly:o.boolean().optional(),multiple:o.boolean().optional(),placeholder:o.string().optional(),options:o.array(o.object({label:o.string().nonempty(),value:e.optional(),image:o.string().url().optional(),description:o.string().optional(),disabled:o.boolean().optional(),attributes:o.record(o.string(),o.any()).optional(),dependsOn:o.array(o.object({fieldName:o.string().nonempty(),value:e.optional(),operator:o.enum(["exists","equals","not-equals","contains","not-contains","greater-than","less-than"]).optional()})).optional()})).optional(),required:o.boolean().optional(),configuration:o.object({generic:o.object({error:o.object({icon:o.string().optional(),showOn:o.enum(["input","blur"]).optional()})}).optional(),input:o.object({min:o.number().optional(),max:o.number().optional(),step:o.number().optional(),pattern:o.string().refine(r=>{try{return new RegExp(r),!0}catch{return!1}},"Invalid regex pattern").optional(),minLength:o.number().optional(),maxLength:o.number().optional(),exactLength:o.number().optional(),prefix:o.object({default:n.optional(),success:n.optional(),error:n.optional()}).optional(),suffix:o.object({default:n.optional(),success:n.optional(),error:n.optional()}).optional(),clearable:o.boolean().optional(),floatingLabel:o.boolean().optional()}).optional(),textarea:o.object({rows:o.number().optional()}).optional(),checkbox:o.object({layout:o.enum(["horizontal","vertical"])}).optional(),rating:o.object({icons:o.array(o.string()).optional(),color:o.string().optional(),precision:o.number().optional()}).optional(),map:o.object({apiKey:o.string().optional(),region:o.string().length(2).optional(),center:o.object({lat:o.number().min(-90).max(90),lng:o.number().min(-180).max(180)}).optional(),showMap:o.enum(["always","on-search","never"]).optional(),zoom:o.object({initial:o.number().optional(),focus:o.number().optional(),max:o.number().optional(),min:o.number().optional()}).optional(),controls:o.object({fullscreen:o.boolean().optional(),mapType:o.boolean().optional(),zoom:o.boolean().optional(),rotate:o.boolean().optional(),scale:o.boolean().optional(),streetView:o.boolean().optional()}).optional(),initialLocations:o.number().optional(),maxLocations:o.number().optional(),distanceUnit:o.enum(["km","mi"]).optional(),distanceFormat:o.enum(["short","long"]).optional(),options:o.object({show:o.enum(["always","on-search","never"]).optional(),component:o.enum(["list-button","list-radio","carousel"]).optional(),searchLabel:o.string().optional(),detailsLabel:o.string().optional()}).optional(),search:o.object({value:o.string().optional(),button:o.object({label:o.string().optional(),position:o.enum(["inside","outside"]).optional()}).optional(),placeholder:o.string().optional(),noResultsText:o.string().optional(),autocomplete:o.boolean().optional(),clearable:o.boolean().optional(),mode:o.enum(["address","postcode"]).default("postcode").optional(),locationButton:o.object({icon:o.string().optional(),position:o.enum(["left","right"]).optional()}).optional(),prefix:o.object({default:n.optional()}).optional(),suffix:o.object({default:n.optional()}).optional(),mappedResults:o.object({mapping:o.record(o.string(),o.array(o.object({key:o.string(),value:o.string()})))}).optional()}).optional(),distanceRange:o.object({initial:o.number().optional(),min:o.number().optional(),max:o.number().optional(),step:o.number().optional()}).optional(),mapRegion:o.object({strokeColor:o.string().optional(),fillColor:o.string().optional(),fillOpacity:o.number().optional()}).optional(),locationPin:i.optional(),markerPin:o.object({default:i.optional(),hover:i.optional(),selected:i.optional()}).optional(),infoWindow:o.object({button:o.object({label:o.string(),action:o.string()}).optional()}).optional()}).optional(),calendar:o.object({current:o.object({month:o.number().min(0).max(11).optional(),year:o.number().optional()}).optional(),range:o.object({min:a.optional(),max:a.optional(),enabled:o.array(a).optional(),disabled:o.array(a).optional()}).optional(),time:o.object({label:o.string().optional(),format:o.enum(["12h","24h"]).optional(),component:o.enum(["carousel","list"]).optional()}).optional(),api:o.object({url:o.string().url().nonempty(),organizationId:o.string().nonempty(),availability:o.object({filters:s,options:c.optional()}).optional()}).optional()}).optional()}).optional(),dependsOn:o.array(o.object({fieldName:o.string().nonempty(),value:e.optional(),operator:o.enum(["exists","equal","not-equal","contains","not-contains","greater-than","less-than"]).optional()})).optional(),dependentBehavior:o.enum(["hidden","disabled"]).optional(),customError:o.object({required:o.string().optional(),invalid:o.string().optional(),minLength:o.string().optional(),maxLength:o.string().optional(),minValue:o.string().optional(),maxValue:o.string().optional(),mismatch:o.string().optional()}).optional()}),d=o.object({src:o.string().url(),preload:o.boolean().optional(),name:o.string().nonempty(),function:o.string().nonempty(),params:o.record(o.string(),o.any()).optional()}),y=o.object({name:o.enum(["organization_call","close_panel"]),params:o.record(o.string(),o.any()).optional()}),f=o.object({id:o.string().nonempty(),type:o.enum(["submit","navigate","link","back","dispatcher","script"]),label:o.string().nonempty(),variant:o.enum(["primary","secondary","success","danger","warning","info"]),url:o.string().url().optional(),scripts:d.array().optional(),events:y.array().optional()}),x=o.enum(["INVALID_DATA","INVALID_ACTION","STEP_NOT_FOUND","UNKNOWN_ERROR","APPOINTMENT_INVALID_DATA","APPOINTMENT_BUSY_SLOT","APPOINTMENT_OUT_OF_DATE","APPOINTMENT_UNKNOWN_ERROR","LEAD_INVALID_DATA","LEAD_UNKNOWN_ERROR","CONTENT_INVALID_DATA","CONTENT_UNKNOWN_ERROR","CONTACT_INVALID_DATA","CONTACT_UNKNOWN_ERROR","LOST_OPPORTUNITY_INVALID_DATA","LOST_OPPORTUNITY_UNKNOWN_ERROR"]),j=o.object({type:o.enum(["redirect"]),params:o.record(o.string(),o.any()).optional()}),N=o.object({id:o.string().nonempty(),title:o.string().optional(),description:o.string().optional(),stageId:o.string().optional(),state:o.record(o.string(),o.any()).optional(),fields:o.array(u).optional(),actions:o.array(f).optional(),result:o.object({postActions:o.array(j).optional(),pipelines:o.array(o.object({name:o.string(),data:o.object({})})).optional(),tracking:o.record(o.string(),o.any()).optional()}).optional(),error:o.object({code:x,message:o.string().optional(),fields:o.array(o.object({name:o.string(),type:p,value:o.any(),error:o.string()})).optional()}).optional(),isFinal:o.boolean().optional()}),v=o.object({id:o.string().length(24).nonempty(),organizationId:o.string().uuid().nonempty(),updatedAt:o.string().datetime().nonempty(),stages:o.array(o.object({id:o.string().nonempty(),name:o.string().nonempty()}))}),w=o.object({status:o.enum(["ok","error"]),step:N,flow:v}),z=o.enum(["track"]);export{f as Action,y as ActionEvent,d as ActionScript,I as ClientOptions,_ as DEFAULT_CLIENT_OPTIONS,x as ErrorCode,z as EventType,u as Field,v as Flow,w as FlowContext,D as GetStepOptions,S as GetStepTrigger,j as PostAction,N as Step,L as StepId};
|
package/flow.types.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @onlive.ai/flow-client v0.1.
|
|
1
|
+
/*! @onlive.ai/flow-client v0.1.49 | © 2025 Onlive.ai */
|
|
2
2
|
"use strict";var d=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var T=(i,t)=>{for(var s in t)d(i,s,{get:t[s],enumerable:!0})},P=(i,t,s,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of F(t))!E.call(i,n)&&n!==s&&d(i,n,{get:()=>t[n],enumerable:!(p=B(t,n))||p.enumerable});return i};var R=i=>P(d({},"__esModule",{value:!0}),i);var L={};T(L,{ActionDtoSchema:()=>C,ActionPipelineDtoSchema:()=>A,ActionTypeEnumSchema:()=>j,ActionVariantEnumSchema:()=>x,ConditionalGroupOperatorDtoSchema:()=>a,ConditionalOperatorDtoSchema:()=>r,DataProviderDtoSchema:()=>c,DataProviderSourceTypeSchema:()=>v,DataTransformerDtoSchema:()=>y,DataTransformerTypeSchema:()=>g,FailFlowSchema:()=>k,FieldComponentEnumSchema:()=>b,FieldDependentBehaviorEnumSchema:()=>h,FieldDtoSchema:()=>D,FieldItemDtoSchema:()=>m,FieldSelectionModeSchema:()=>u,FieldTypeEnumSchema:()=>f,FlowDtoSchema:()=>I,NodeDtoSchema:()=>l,NodeListDtoSchema:()=>O,PipelineFunctionTypeSchema:()=>w,RoutingDtoSchema:()=>q,ScriptsDtoSchema:()=>S});module.exports=R(L);var e=require("zod"),o=e.z.record(e.z.string(),e.z.any()).describe("Represents a plain literal object."),f=e.z.enum(["text","boolean","number","email","phone","mobile_phone","date","time","datetime","password","url","void","location","availability"]).describe("Enum for field types."),b=e.z.enum(["input","textarea","select","radio","checkbox","switch","carousel","button","label","calendar","map"]).describe("Enum for field components."),u=e.z.enum(["simple","multiple"]).describe("Enum for field selection modes."),h=e.z.enum(["hidden","disabled"]).describe("Enum for field dependent behaviors."),m=e.z.object({label:e.z.union([e.z.string(),o]).optional().describe("Label for the field item."),value:o.optional().describe("Value of the field item."),description:e.z.union([e.z.string(),o]).optional().describe("Description for the field item."),image:e.z.string().url().optional().describe("URL of an image for the field item."),nextNodeId:e.z.boolean().optional().describe("ID of the next node.")}).describe("Data transfer object for a field item."),v=e.z.enum(["property","httpRequest","mqRequest","function"]).describe("Enum for data provider source types."),r=e.z.object({exists:e.z.object({valueA:e.z.unknown(),valueB:e.z.boolean()}).optional().describe("Checks if a value exists."),equal:e.z.object({valueA:e.z.unknown(),valueB:e.z.unknown()}).optional().describe("Checks if two values are equal."),notEqual:e.z.object({valueA:e.z.unknown(),valueB:e.z.unknown()}).optional().describe("Checks if two values are not equal."),equalOrGreater:e.z.object({valueA:e.z.unknown(),valueB:e.z.unknown()}).optional().describe("Checks if valueA is equal to or greater than valueB."),equalOrLess:e.z.object({valueA:e.z.unknown(),valueB:e.z.unknown()}).optional().describe("Checks if valueA is equal to or less than valueB."),greater:e.z.object({valueA:e.z.unknown(),valueB:e.z.unknown()}).optional().describe("Checks if valueA is greater than valueB."),less:e.z.object({valueA:e.z.unknown(),valueB:e.z.unknown()}).optional().describe("Checks if valueA is less than valueB."),startsWith:e.z.object({valueA:e.z.string(),valueB:e.z.string()}).optional().describe("Checks if valueA starts with valueB."),contains:e.z.object({valueA:e.z.string(),valueB:e.z.string()}).optional().describe("Checks if valueA contains valueB."),includes:e.z.object({valueA:e.z.array(e.z.unknown()),valueB:e.z.unknown()}).optional().describe("Checks if valueA includes valueB.")}).describe("Data transfer object for conditional operators."),a=e.z.object({or:e.z.array(r).optional().describe("Array of OR conditions."),and:e.z.array(r).optional().describe("Array of AND conditions.")}).describe("Data transfer object for conditional group operators."),g=e.z.enum(["map","concat","filter","reduce","unique","join","flat","flatmap","sort","delete"]).describe("Enum for data transformer types."),y=e.z.object({type:g.describe("Type of the data transformer."),params:e.z.record(e.z.string(),e.z.any()).optional().describe("Parameters for the data transformer."),conditions:e.z.array(e.z.union([r,a])).optional().describe("Conditions for the data transformer."),require:e.z.array(e.z.string()).optional().describe("Required fields for the data transformer.")}).describe("Data transfer object for data transformers."),c=e.z.object({type:v.describe("Type of the data provider source."),name:e.z.string().optional().describe("Name of the data provider."),params:e.z.union([e.z.record(e.z.string(),e.z.unknown()),e.z.string()]).optional().describe("Parameters for the data provider."),persist:e.z.boolean().optional().describe("Whether to persist the data."),conditions:e.z.array(e.z.union([r,a])).optional().describe("Conditions for the data provider."),transformers:e.z.array(y).optional().describe("Transformers for the data provider."),require:e.z.array(e.z.string()).optional().describe("Required fields for the data provider.")}).describe("Data transfer object for data providers."),D=e.z.object({name:e.z.string().describe("Name of the field."),type:f.describe("Type of the field."),label:e.z.union([e.z.string(),o]).optional().describe("Label for the field."),value:e.z.any().optional().describe("Value of the field."),component:b.optional().describe("Component for the field."),selectionMode:u.optional().describe("Selection mode for the field."),required:e.z.boolean().optional().describe("Whether the field is required."),placeholder:e.z.union([e.z.string(),o]).optional().describe("Placeholder for the field."),options:e.z.array(m).optional().describe("Options for the field."),optionsProvider:c.optional().describe("Data provider for the field options."),configuration:o.optional().describe("Configuration for the field."),dependsOn:e.z.array(o).optional().describe("Fields that this field depends on."),dependentBehavior:h.optional().describe("Behavior of the field when its dependencies are not met."),conditions:e.z.array(o).optional().describe("Conditions for the field."),customError:o.optional().describe("Custom error message for the field.")}).describe("Data transfer object for a field."),j=e.z.enum(["submit","link","forward","script"]).describe("Enum for action types."),x=e.z.enum(["primary","secondary","success","warning","info","danger"]).describe("Enum for action variants."),S=e.z.object({src:e.z.string().url().describe("Source URL of the script."),preload:e.z.boolean().optional().describe("Whether to preload the script."),name:e.z.string().describe("Name of the script."),function:e.z.string().describe("Function to execute from the script."),params:e.z.record(e.z.string(),e.z.any()).optional().describe("Parameters for the script function.")}).describe("Data transfer object for scripts."),w=e.z.string().describe("Enum for pipeline function types. TODO: Replace z.string() with z.enum([...]) with actual pipeline function types."),k=o.describe("Data transfer object for fail flow. TODO: Define the actual structure for FailFlowSchema if it's not a plain literal object."),A=e.z.object({function:w.describe("Function type for the pipeline."),params:o.optional().describe("Parameters for the pipeline function."),conditions:e.z.array(e.z.union([r,a])).optional().describe("Conditions for the pipeline."),require:e.z.array(e.z.string()).optional().describe("Required fields for the pipeline."),onFail:k.optional().describe("Fail flow configuration.")}).describe("Data transfer object for an action pipeline."),C=e.z.object({id:e.z.string().describe("ID of the action."),label:e.z.union([e.z.string(),o]).optional().describe("Label for the action."),type:j.describe("Type of the action."),variant:x.optional().describe("Variant of the action."),url:e.z.string().optional().describe("URL for link-type actions."),pipeline:e.z.array(A).optional().describe("Pipeline for the action."),conditions:e.z.array(o).optional().describe("Conditions for the action."),nextStepId:e.z.string().optional().describe("ID of the next step."),scripts:e.z.array(S).optional().describe("Scripts associated with the action.")}).describe("Data transfer object for an action."),q=e.z.object({conditions:e.z.array(e.z.union([r,a])).optional().describe("Conditions for the routing rule."),nextStepId:e.z.string().describe("ID of the next step if conditions are met.")}).describe("Data transfer object for routing."),l=e.z.object({id:e.z.string().describe("ID of the node."),initialNode:e.z.boolean().optional().describe("Whether this is the initial node."),finalNode:e.z.boolean().optional().describe("Whether this is a final node."),title:e.z.union([e.z.string(),o]).optional().describe("Title of the node."),description:e.z.string().optional().describe("Description of the node."),fields:e.z.array(D).optional().describe("Fields in the node."),actions:e.z.array(C).optional().describe("Actions available in the node."),routing:e.z.array(q).optional().describe("Routing rules for the node."),stateProviders:e.z.array(c).optional().describe("Data providers for state management."),trackingProviders:e.z.array(c).optional().describe("Data providers for tracking."),stageId:e.z.string().optional().describe("ID of the stage this node belongs to."),translations:o.optional().describe("Translations for the node.")}).describe("Data transfer object for a node."),O=e.z.array(l).describe("List of nodes."),I=e.z.object({nodes:e.z.array(l).describe("List of nodes.")});0&&(module.exports={ActionDtoSchema,ActionPipelineDtoSchema,ActionTypeEnumSchema,ActionVariantEnumSchema,ConditionalGroupOperatorDtoSchema,ConditionalOperatorDtoSchema,DataProviderDtoSchema,DataProviderSourceTypeSchema,DataTransformerDtoSchema,DataTransformerTypeSchema,FailFlowSchema,FieldComponentEnumSchema,FieldDependentBehaviorEnumSchema,FieldDtoSchema,FieldItemDtoSchema,FieldSelectionModeSchema,FieldTypeEnumSchema,FlowDtoSchema,NodeDtoSchema,NodeListDtoSchema,PipelineFunctionTypeSchema,RoutingDtoSchema,ScriptsDtoSchema});
|
package/flow.types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @onlive.ai/flow-client v0.1.
|
|
1
|
+
/*! @onlive.ai/flow-client v0.1.49 | © 2025 Onlive.ai */
|
|
2
2
|
import{z as e}from"zod";var o=e.record(e.string(),e.any()).describe("Represents a plain literal object."),a=e.enum(["text","boolean","number","email","phone","mobile_phone","date","time","datetime","password","url","void","location","availability"]).describe("Enum for field types."),s=e.enum(["input","textarea","select","radio","checkbox","switch","carousel","button","label","calendar","map"]).describe("Enum for field components."),c=e.enum(["simple","multiple"]).describe("Enum for field selection modes."),d=e.enum(["hidden","disabled"]).describe("Enum for field dependent behaviors."),l=e.object({label:e.union([e.string(),o]).optional().describe("Label for the field item."),value:o.optional().describe("Value of the field item."),description:e.union([e.string(),o]).optional().describe("Description for the field item."),image:e.string().url().optional().describe("URL of an image for the field item."),nextNodeId:e.boolean().optional().describe("ID of the next node.")}).describe("Data transfer object for a field item."),p=e.enum(["property","httpRequest","mqRequest","function"]).describe("Enum for data provider source types."),t=e.object({exists:e.object({valueA:e.unknown(),valueB:e.boolean()}).optional().describe("Checks if a value exists."),equal:e.object({valueA:e.unknown(),valueB:e.unknown()}).optional().describe("Checks if two values are equal."),notEqual:e.object({valueA:e.unknown(),valueB:e.unknown()}).optional().describe("Checks if two values are not equal."),equalOrGreater:e.object({valueA:e.unknown(),valueB:e.unknown()}).optional().describe("Checks if valueA is equal to or greater than valueB."),equalOrLess:e.object({valueA:e.unknown(),valueB:e.unknown()}).optional().describe("Checks if valueA is equal to or less than valueB."),greater:e.object({valueA:e.unknown(),valueB:e.unknown()}).optional().describe("Checks if valueA is greater than valueB."),less:e.object({valueA:e.unknown(),valueB:e.unknown()}).optional().describe("Checks if valueA is less than valueB."),startsWith:e.object({valueA:e.string(),valueB:e.string()}).optional().describe("Checks if valueA starts with valueB."),contains:e.object({valueA:e.string(),valueB:e.string()}).optional().describe("Checks if valueA contains valueB."),includes:e.object({valueA:e.array(e.unknown()),valueB:e.unknown()}).optional().describe("Checks if valueA includes valueB.")}).describe("Data transfer object for conditional operators."),i=e.object({or:e.array(t).optional().describe("Array of OR conditions."),and:e.array(t).optional().describe("Array of AND conditions.")}).describe("Data transfer object for conditional group operators."),f=e.enum(["map","concat","filter","reduce","unique","join","flat","flatmap","sort","delete"]).describe("Enum for data transformer types."),b=e.object({type:f.describe("Type of the data transformer."),params:e.record(e.string(),e.any()).optional().describe("Parameters for the data transformer."),conditions:e.array(e.union([t,i])).optional().describe("Conditions for the data transformer."),require:e.array(e.string()).optional().describe("Required fields for the data transformer.")}).describe("Data transfer object for data transformers."),r=e.object({type:p.describe("Type of the data provider source."),name:e.string().optional().describe("Name of the data provider."),params:e.union([e.record(e.string(),e.unknown()),e.string()]).optional().describe("Parameters for the data provider."),persist:e.boolean().optional().describe("Whether to persist the data."),conditions:e.array(e.union([t,i])).optional().describe("Conditions for the data provider."),transformers:e.array(b).optional().describe("Transformers for the data provider."),require:e.array(e.string()).optional().describe("Required fields for the data provider.")}).describe("Data transfer object for data providers."),u=e.object({name:e.string().describe("Name of the field."),type:a.describe("Type of the field."),label:e.union([e.string(),o]).optional().describe("Label for the field."),value:e.any().optional().describe("Value of the field."),component:s.optional().describe("Component for the field."),selectionMode:c.optional().describe("Selection mode for the field."),required:e.boolean().optional().describe("Whether the field is required."),placeholder:e.union([e.string(),o]).optional().describe("Placeholder for the field."),options:e.array(l).optional().describe("Options for the field."),optionsProvider:r.optional().describe("Data provider for the field options."),configuration:o.optional().describe("Configuration for the field."),dependsOn:e.array(o).optional().describe("Fields that this field depends on."),dependentBehavior:d.optional().describe("Behavior of the field when its dependencies are not met."),conditions:e.array(o).optional().describe("Conditions for the field."),customError:o.optional().describe("Custom error message for the field.")}).describe("Data transfer object for a field."),h=e.enum(["submit","link","forward","script"]).describe("Enum for action types."),m=e.enum(["primary","secondary","success","warning","info","danger"]).describe("Enum for action variants."),v=e.object({src:e.string().url().describe("Source URL of the script."),preload:e.boolean().optional().describe("Whether to preload the script."),name:e.string().describe("Name of the script."),function:e.string().describe("Function to execute from the script."),params:e.record(e.string(),e.any()).optional().describe("Parameters for the script function.")}).describe("Data transfer object for scripts."),g=e.string().describe("Enum for pipeline function types. TODO: Replace z.string() with z.enum([...]) with actual pipeline function types."),y=o.describe("Data transfer object for fail flow. TODO: Define the actual structure for FailFlowSchema if it's not a plain literal object."),D=e.object({function:g.describe("Function type for the pipeline."),params:o.optional().describe("Parameters for the pipeline function."),conditions:e.array(e.union([t,i])).optional().describe("Conditions for the pipeline."),require:e.array(e.string()).optional().describe("Required fields for the pipeline."),onFail:y.optional().describe("Fail flow configuration.")}).describe("Data transfer object for an action pipeline."),j=e.object({id:e.string().describe("ID of the action."),label:e.union([e.string(),o]).optional().describe("Label for the action."),type:h.describe("Type of the action."),variant:m.optional().describe("Variant of the action."),url:e.string().optional().describe("URL for link-type actions."),pipeline:e.array(D).optional().describe("Pipeline for the action."),conditions:e.array(o).optional().describe("Conditions for the action."),nextStepId:e.string().optional().describe("ID of the next step."),scripts:e.array(v).optional().describe("Scripts associated with the action.")}).describe("Data transfer object for an action."),x=e.object({conditions:e.array(e.union([t,i])).optional().describe("Conditions for the routing rule."),nextStepId:e.string().describe("ID of the next step if conditions are met.")}).describe("Data transfer object for routing."),n=e.object({id:e.string().describe("ID of the node."),initialNode:e.boolean().optional().describe("Whether this is the initial node."),finalNode:e.boolean().optional().describe("Whether this is a final node."),title:e.union([e.string(),o]).optional().describe("Title of the node."),description:e.string().optional().describe("Description of the node."),fields:e.array(u).optional().describe("Fields in the node."),actions:e.array(j).optional().describe("Actions available in the node."),routing:e.array(x).optional().describe("Routing rules for the node."),stateProviders:e.array(r).optional().describe("Data providers for state management."),trackingProviders:e.array(r).optional().describe("Data providers for tracking."),stageId:e.string().optional().describe("ID of the stage this node belongs to."),translations:o.optional().describe("Translations for the node.")}).describe("Data transfer object for a node."),w=e.array(n).describe("List of nodes."),k=e.object({nodes:e.array(n).describe("List of nodes.")});export{j as ActionDtoSchema,D as ActionPipelineDtoSchema,h as ActionTypeEnumSchema,m as ActionVariantEnumSchema,i as ConditionalGroupOperatorDtoSchema,t as ConditionalOperatorDtoSchema,r as DataProviderDtoSchema,p as DataProviderSourceTypeSchema,b as DataTransformerDtoSchema,f as DataTransformerTypeSchema,y as FailFlowSchema,s as FieldComponentEnumSchema,d as FieldDependentBehaviorEnumSchema,u as FieldDtoSchema,l as FieldItemDtoSchema,c as FieldSelectionModeSchema,a as FieldTypeEnumSchema,k as FlowDtoSchema,n as NodeDtoSchema,w as NodeListDtoSchema,g as PipelineFunctionTypeSchema,x as RoutingDtoSchema,v as ScriptsDtoSchema};
|
package/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @onlive.ai/flow-client v0.1.
|
|
2
|
-
"use strict";var b=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var G=(i,e,o)=>e in i?b(i,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[e]=o;var $=(i,e)=>{for(var o in e)b(i,o,{get:e[o],enumerable:!0})},q=(i,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of V(e))!M.call(i,r)&&r!==o&&b(i,r,{get:()=>e[r],enumerable:!(n=U(e,r))||n.enumerable});return i};var B=i=>q(b({},"__esModule",{value:!0}),i);var p=(i,e,o)=>G(i,typeof e!="symbol"?e+"":e,o);var Z={};$(Z,{Action:()=>D,ActionEvent:()=>L,ActionScript:()=>A,ClientOptions:()=>E,DEFAULT_CLIENT_OPTIONS:()=>_,ErrorCode:()=>z,EventType:()=>J,Field:()=>w,Flow:()=>P,FlowClient:()=>v,FlowContext:()=>H,GetStepOptions:()=>g,GetStepTrigger:()=>N,ONLIVE_ANALYTICS_EVENT:()=>x,ONLIVE_FLOW_FORM_NAME:()=>c,PostAction:()=>R,Step:()=>F,StepId:()=>O,TrackingOptionsSchema:()=>d});module.exports=B(Z);var C=require("@onlive.ai/common-121/utils/merge.js");var l=require("@onlive.ai/tracker"),j=require("@onlive.ai/common-121/utils/merge.js"),I=require("@onlive.ai/common-121/utils/browser-preferences.js");var a=require("zod"),c="flow_form",x="onlive-analytics-event",d=a.z.object({enabled:a.z.boolean().default(!1).optional(),data:a.z.custom().optional(),removeExtraneousValues:a.z.boolean().default(!0).optional(),allowBotTraffic:a.z.boolean().default(!1).optional(),adapters:a.z.array(a.z.string()).default([]).optional(),apiUrl:a.z.string().url().optional(),emitters:a.z.object({windowEvent:a.z.boolean().optional(),dataLayer:a.z.boolean().optional(),windowPostMessage:a.z.boolean().optional()}).optional()});var T=class{constructor(e,o,n,r){p(this,"options");p(this,"tracker");p(this,"eventListeners",[]);this.options=d.parse(n),this.tracker=new l.Tracker({apiUrl:this.options.apiUrl,removeExtraneousValues:this.options.removeExtraneousValues,allowBotTraffic:this.options.allowBotTraffic,adapters:this.options.adapters,dryRun:r}),this.tracker.setBase((0,j.merge)({},{organization_id:e,page_url:window.location.href,page_referrer:document.referrer,origin_medium:"web",guest_id:l.Session.id,interaction_id:l.Session.interactionId,extra:{flow_id:o}},this.options.data)),window.addEventListener(x,({detail:m})=>this.emit(m.event,m.data))}getTracker(){return this.tracker}preferences(){return{...(0,I.browserPreferences)(),interactionId:l.Session.interactionId,guestId:l.Session.id}}analyzeRequest(e,o){"currentStepId"in e&&(e.actionId&&this.tracker.send("element_click",{element_label:e.actionId,element_type:"button",form_name:Object.keys(o.fields||{}).length?c:void 0,step_name:e.currentStepId}),o.fields&&this.tracker.send("form_submit",{form_name:c,form_data:o.fields,step_name:e.currentStepId}))}analyzeResponse(e,o){"currentStepId"in e&&(o.step.result?.pipelines&&o.step.result.pipelines.forEach(n=>{this.tracker.send("task_success",{task_name:n.name,task_data:n.data,step_name:o.step.id})}),o.step.error&&this.tracker.send("form_error",{form_name:c,form_error:o.step.error.code,step_name:o.step.id})),this.tracker.send("impression",{impression_type:"step",form_name:void 0,step_name:o.step.id,step_initial:!("currentStepId"in e)||void 0,step_final:o.step.isFinal}),this.tracker.setBase({form_name:c,step_name:o.step.id,step_initial:!("currentStepId"in e)||void 0,step_final:o.step.isFinal,...o.step.result?.tracking})}send(e,o){this.tracker.send(e,o)}setData(e){this.tracker.setBase(e)}onEvent(e){this.eventListeners.push(e)}emit(e,o){this.eventListeners.forEach(n=>n({event:e,data:o}))}},k=T;var h=require("@onlive.ai/calendar"),t=require("zod");var _={tracking:{removeExtraneousValues:!0,apiUrl:"https://srvless.onlive.site/tracking",data:{widget_type:"OnliveAppFlow"}}},O=t.z.string().nonempty(),E=t.z.object({baseUrl:t.z.string().url().nonempty(),flowId:t.z.string().length(24).nonempty(),organizationId:t.z.string().uuid().nonempty(),lang:t.z.string().length(2).nonempty(),tracking:d.optional(),devMode:t.z.boolean().default(!1).optional()}),g=t.z.object({state:t.z.record(t.z.string(),t.z.any()).optional(),fields:t.z.record(t.z.string(),t.z.any()).optional()}),N=t.z.object({currentStepId:t.z.string().nonempty(),actionId:t.z.string().nonempty()}),S=t.z.enum(["text","boolean","number","email","phone","mobile_phone","date","time","datetime","password","url","color","object","void","location","availability"]),W=t.z.object({name:t.z.string(),value:t.z.string().optional(),icon:t.z.string().optional(),type:t.z.enum(["url","email","phone"]).optional()}),Y=t.z.object({lat:t.z.number().min(-90).max(90),lng:t.z.number().min(-180).max(180),meta:t.z.record(t.z.string(),t.z.any()).optional(),properties:t.z.record(t.z.string(),W).optional()}),K=t.z.object({datetime:t.z.string().datetime(),meta:t.z.record(t.z.string(),t.z.any()).optional()}),u=t.z.union([t.z.string(),t.z.number(),t.z.boolean(),Y,K]),f=t.z.object({content:t.z.object({icon:t.z.string().optional(),url:t.z.string().url().optional(),width:t.z.string().optional(),height:t.z.string().optional(),scale:t.z.number().optional()}).optional(),background:t.z.string().optional(),glyph:t.z.object({color:t.z.string().optional(),url:t.z.string().url().optional(),icon:t.z.string().optional()}).optional(),borderColor:t.z.string().optional(),scale:t.z.number().optional()}),y=t.z.custom(i=>/^\d{4}-\d{2}-\d{2}$/.test(i),{message:"Date must be in 'YYYY-MM-DD' format"}),s=t.z.object({text:t.z.string().optional(),icon:t.z.string().optional()}),w=t.z.object({name:t.z.string().nonempty(),label:t.z.string().optional(),value:t.z.union([u,t.z.array(u)]).optional(),type:S,component:t.z.enum(["input","textarea","select","radio","checkbox","switch","rating","carousel","button","label","map","calendar"]).optional(),disabled:t.z.boolean().optional(),readonly:t.z.boolean().optional(),multiple:t.z.boolean().optional(),placeholder:t.z.string().optional(),options:t.z.array(t.z.object({label:t.z.string().nonempty(),value:u.optional(),image:t.z.string().url().optional(),description:t.z.string().optional(),disabled:t.z.boolean().optional(),attributes:t.z.record(t.z.string(),t.z.any()).optional(),dependsOn:t.z.array(t.z.object({fieldName:t.z.string().nonempty(),value:u.optional(),operator:t.z.enum(["exists","equal","not-equal","contains","not-contains","greater-than","less-than"]).optional()})).optional()})).optional(),required:t.z.boolean().optional(),configuration:t.z.object({generic:t.z.object({error:t.z.object({icon:t.z.string().optional(),showOn:t.z.enum(["input","blur"]).optional()})}).optional(),input:t.z.object({min:t.z.number().optional(),max:t.z.number().optional(),step:t.z.number().optional(),pattern:t.z.string().refine(i=>{try{return new RegExp(i),!0}catch{return!1}},"Invalid regex pattern").optional(),minLength:t.z.number().optional(),maxLength:t.z.number().optional(),exactLength:t.z.number().optional(),prefix:t.z.object({default:s.optional(),success:s.optional(),error:s.optional()}).optional(),suffix:t.z.object({default:s.optional(),success:s.optional(),error:s.optional()}).optional(),clearable:t.z.boolean().optional(),floatingLabel:t.z.boolean().optional()}).optional(),textarea:t.z.object({rows:t.z.number().optional()}).optional(),checkbox:t.z.object({layout:t.z.enum(["horizontal","vertical"])}).optional(),rating:t.z.object({icons:t.z.array(t.z.string()).optional(),color:t.z.string().optional(),precision:t.z.number().optional()}).optional(),map:t.z.object({apiKey:t.z.string().optional(),region:t.z.string().length(2).optional(),center:t.z.object({lat:t.z.number().min(-90).max(90),lng:t.z.number().min(-180).max(180)}).optional(),showMap:t.z.enum(["always","on-search","never"]).optional(),zoom:t.z.object({initial:t.z.number().optional(),focus:t.z.number().optional(),max:t.z.number().optional(),min:t.z.number().optional()}).optional(),controls:t.z.object({fullscreen:t.z.boolean().optional(),mapType:t.z.boolean().optional(),zoom:t.z.boolean().optional(),rotate:t.z.boolean().optional(),scale:t.z.boolean().optional(),streetView:t.z.boolean().optional()}).optional(),initialLocations:t.z.number().optional(),maxLocations:t.z.number().optional(),distanceUnit:t.z.enum(["km","mi"]).optional(),distanceFormat:t.z.enum(["short","long"]).optional(),options:t.z.object({show:t.z.enum(["always","on-search","never"]).optional(),component:t.z.enum(["list-button","list-radio","carousel"]).optional(),searchLabel:t.z.string().optional(),detailsLabel:t.z.string().optional()}).optional(),search:t.z.object({value:t.z.string().optional(),button:t.z.object({label:t.z.string().optional(),position:t.z.enum(["inside","outside"]).optional()}).optional(),placeholder:t.z.string().optional(),noResultsText:t.z.string().optional(),autocomplete:t.z.boolean().optional(),clearable:t.z.boolean().optional(),mode:t.z.enum(["address","postcode"]).default("postcode").optional(),locationButton:t.z.object({icon:t.z.string().optional(),position:t.z.enum(["left","right"]).optional()}).optional(),prefix:t.z.object({default:s.optional()}).optional(),suffix:t.z.object({default:s.optional()}).optional(),mappedResults:t.z.object({mapping:t.z.record(t.z.string(),t.z.array(t.z.object({key:t.z.string(),value:t.z.string()})))}).optional()}).optional(),distanceRange:t.z.object({initial:t.z.number().optional(),min:t.z.number().optional(),max:t.z.number().optional(),step:t.z.number().optional()}).optional(),mapRegion:t.z.object({strokeColor:t.z.string().optional(),fillColor:t.z.string().optional(),fillOpacity:t.z.number().optional()}).optional(),locationPin:f.optional(),markerPin:t.z.object({default:f.optional(),hover:f.optional(),selected:f.optional()}).optional(),infoWindow:t.z.object({button:t.z.object({label:t.z.string(),action:t.z.string()}).optional()}).optional()}).optional(),calendar:t.z.object({current:t.z.object({month:t.z.number().min(0).max(11).optional(),year:t.z.number().optional()}).optional(),range:t.z.object({min:y.optional(),max:y.optional(),enabled:t.z.array(y).optional(),disabled:t.z.array(y).optional()}).optional(),time:t.z.object({label:t.z.string().optional(),format:t.z.enum(["12h","24h"]).optional(),component:t.z.enum(["carousel","list"]).optional()}).optional(),api:t.z.object({url:t.z.string().url().nonempty(),organizationId:t.z.string().nonempty(),availability:t.z.object({filters:h.GetAvailabilityFilters,options:h.GetAvailabilityOptions.optional()}).optional()}).optional()}).optional()}).optional(),dependsOn:t.z.array(t.z.object({fieldName:t.z.string().nonempty(),value:u.optional(),operator:t.z.enum(["exists","equal","not-equal","contains","not-contains","greater-than","less-than"]).optional()})).optional(),dependentBehavior:t.z.enum(["hidden","disabled"]).optional(),customError:t.z.object({required:t.z.string().optional(),invalid:t.z.string().optional(),minLength:t.z.string().optional(),maxLength:t.z.string().optional(),minValue:t.z.string().optional(),maxValue:t.z.string().optional(),mismatch:t.z.string().optional()}).optional()}),A=t.z.object({src:t.z.string().url(),preload:t.z.boolean().optional(),name:t.z.string().nonempty(),function:t.z.string().nonempty(),params:t.z.record(t.z.string(),t.z.any()).optional()}),L=t.z.object({name:t.z.enum(["organization_call","close_panel"]),params:t.z.record(t.z.string(),t.z.any()).optional()}),D=t.z.object({id:t.z.string().nonempty(),type:t.z.enum(["submit","navigate","link","back","dispatcher","script"]),label:t.z.string().nonempty(),variant:t.z.enum(["primary","secondary","success","danger","warning","info"]),url:t.z.string().url().optional(),scripts:A.array().optional(),events:L.array().optional()}),z=t.z.enum(["INVALID_DATA","INVALID_ACTION","STEP_NOT_FOUND","UNKNOWN_ERROR","APPOINTMENT_INVALID_DATA","APPOINTMENT_BUSY_SLOT","APPOINTMENT_OUT_OF_DATE","APPOINTMENT_UNKNOWN_ERROR","LEAD_INVALID_DATA","LEAD_UNKNOWN_ERROR","CONTENT_INVALID_DATA","CONTENT_UNKNOWN_ERROR","CONTACT_INVALID_DATA","CONTACT_UNKNOWN_ERROR","LOST_OPPORTUNITY_INVALID_DATA","LOST_OPPORTUNITY_UNKNOWN_ERROR"]),R=t.z.object({type:t.z.enum(["redirect"]),params:t.z.record(t.z.string(),t.z.any()).optional()}),F=t.z.object({id:t.z.string().nonempty(),title:t.z.string().optional(),description:t.z.string().optional(),stageId:t.z.string().optional(),state:t.z.record(t.z.string(),t.z.any()).optional(),fields:t.z.array(w).optional(),actions:t.z.array(D).optional(),result:t.z.object({postActions:t.z.array(R).optional(),pipelines:t.z.array(t.z.object({name:t.z.string(),data:t.z.object({})})).optional(),tracking:t.z.record(t.z.string(),t.z.any()).optional()}).optional(),error:t.z.object({code:z,message:t.z.string().optional(),fields:t.z.array(t.z.object({name:t.z.string(),type:S,value:t.z.any(),error:t.z.string()})).optional()}).optional(),isFinal:t.z.boolean().optional()}),P=t.z.object({id:t.z.string().length(24).nonempty(),organizationId:t.z.string().uuid().nonempty(),updatedAt:t.z.string().datetime().nonempty(),stages:t.z.array(t.z.object({id:t.z.string().nonempty(),name:t.z.string().nonempty()}))}),H=t.z.object({status:t.z.enum(["ok","error"]),step:F,flow:P}),J=t.z.enum(["track"]);var v=class{constructor(e){p(this,"baseURL");p(this,"headers");p(this,"flowId");p(this,"tracking");let o=(0,C.merge)({},_,E.parse(e));this.flowId=o.flowId,this.baseURL=o.baseUrl,this.headers=new Headers({"Content-Type":"application/json","X-Onlive-Organization-Id":o.organizationId,"X-Lang":o.lang}),o.tracking?.enabled&&(this.tracking=new k(o.organizationId,o.flowId,o.tracking,!!o.devMode))}async request(e,o={}){let n=await fetch(`${this.baseURL}/${e}`,{...o,headers:this.headers});if(!n?.ok)throw new Error(`HTTP error! status: ${n?.status||"unknown"}`);return n.json()}async firstStep(e={}){this.tracking?.analyzeRequest({},e);let o=this.tracking?.preferences(),n=await this.request(`flow/${this.flowId}/first-step`,{method:"POST",body:JSON.stringify(g.parse({...e,state:{preferences:o,...e.state}}))});return this.tracking?.analyzeResponse({},n),n}async getStep(e,o={}){this.tracking?.analyzeRequest({stepId:e},o);let n=this.tracking?.preferences(),r=await this.request(`flow/${this.flowId}/steps/${O.parse(e)}`,{method:"POST",body:JSON.stringify(g.parse({...o,state:{preferences:n,...o.state}}))});return this.tracking?.analyzeResponse({stepId:e},r),r}async nextStep(e,o={}){this.tracking?.analyzeRequest(e,o);let{currentStepId:n,actionId:r}=N.parse(e),m=await this.request(`flow/${this.flowId}/steps/${n}/action/${r}`,{method:"POST",body:JSON.stringify(g.parse(o))});return this.tracking?.analyzeResponse(e,m),m}};0&&(module.exports={Action,ActionEvent,ActionScript,ClientOptions,DEFAULT_CLIENT_OPTIONS,ErrorCode,EventType,Field,Flow,FlowClient,FlowContext,GetStepOptions,GetStepTrigger,ONLIVE_ANALYTICS_EVENT,ONLIVE_FLOW_FORM_NAME,PostAction,Step,StepId,TrackingOptionsSchema});
|
|
1
|
+
/*! @onlive.ai/flow-client v0.1.49 | © 2025 Onlive.ai */
|
|
2
|
+
"use strict";var b=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var G=(i,e,o)=>e in i?b(i,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[e]=o;var $=(i,e)=>{for(var o in e)b(i,o,{get:e[o],enumerable:!0})},q=(i,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of V(e))!M.call(i,r)&&r!==o&&b(i,r,{get:()=>e[r],enumerable:!(n=U(e,r))||n.enumerable});return i};var B=i=>q(b({},"__esModule",{value:!0}),i);var p=(i,e,o)=>G(i,typeof e!="symbol"?e+"":e,o);var Z={};$(Z,{Action:()=>D,ActionEvent:()=>L,ActionScript:()=>A,ClientOptions:()=>E,DEFAULT_CLIENT_OPTIONS:()=>_,ErrorCode:()=>z,EventType:()=>J,Field:()=>w,Flow:()=>P,FlowClient:()=>v,FlowContext:()=>H,GetStepOptions:()=>g,GetStepTrigger:()=>N,ONLIVE_ANALYTICS_EVENT:()=>x,ONLIVE_FLOW_FORM_NAME:()=>c,PostAction:()=>R,Step:()=>F,StepId:()=>O,TrackingOptionsSchema:()=>d});module.exports=B(Z);var C=require("@onlive.ai/common-121/utils/merge.js");var l=require("@onlive.ai/tracker"),j=require("@onlive.ai/common-121/utils/merge.js"),I=require("@onlive.ai/common-121/utils/browser-preferences.js");var a=require("zod"),c="flow_form",x="onlive-analytics-event",d=a.z.object({enabled:a.z.boolean().default(!1).optional(),data:a.z.custom().optional(),removeExtraneousValues:a.z.boolean().default(!0).optional(),allowBotTraffic:a.z.boolean().default(!1).optional(),adapters:a.z.array(a.z.string()).default([]).optional(),apiUrl:a.z.string().url().optional(),emitters:a.z.object({windowEvent:a.z.boolean().optional(),dataLayer:a.z.boolean().optional(),windowPostMessage:a.z.boolean().optional()}).optional()});var T=class{constructor(e,o,n,r){p(this,"options");p(this,"tracker");p(this,"eventListeners",[]);this.options=d.parse(n),this.tracker=new l.Tracker({apiUrl:this.options.apiUrl,removeExtraneousValues:this.options.removeExtraneousValues,allowBotTraffic:this.options.allowBotTraffic,adapters:this.options.adapters,dryRun:r}),this.tracker.setBase((0,j.merge)({},{organization_id:e,page_url:window.location.href,page_referrer:document.referrer,origin_medium:"web",guest_id:l.Session.id,interaction_id:l.Session.interactionId,extra:{flow_id:o}},this.options.data)),window.addEventListener(x,({detail:m})=>this.emit(m.event,m.data))}getTracker(){return this.tracker}preferences(){return{...(0,I.browserPreferences)(),interactionId:l.Session.interactionId,guestId:l.Session.id}}analyzeRequest(e,o){"currentStepId"in e&&(e.actionId&&this.tracker.send("element_click",{element_label:e.actionId,element_type:"button",form_name:Object.keys(o.fields||{}).length?c:void 0,step_name:e.currentStepId}),o.fields&&this.tracker.send("form_submit",{form_name:c,form_data:o.fields,step_name:e.currentStepId}))}analyzeResponse(e,o){"currentStepId"in e&&(o.step.result?.pipelines&&o.step.result.pipelines.forEach(n=>{this.tracker.send("task_success",{task_name:n.name,task_data:n.data,step_name:o.step.id})}),o.step.error&&this.tracker.send("form_error",{form_name:c,form_error:o.step.error.code,step_name:o.step.id})),this.tracker.send("impression",{impression_type:"step",form_name:void 0,step_name:o.step.id,step_initial:!("currentStepId"in e)||void 0,step_final:o.step.isFinal}),this.tracker.setBase({form_name:c,step_name:o.step.id,step_initial:!("currentStepId"in e)||void 0,step_final:o.step.isFinal,...o.step.result?.tracking})}send(e,o){this.tracker.send(e,o)}setData(e){this.tracker.setBase(e)}onEvent(e){this.eventListeners.push(e)}emit(e,o){this.eventListeners.forEach(n=>n({event:e,data:o}))}},k=T;var h=require("@onlive.ai/calendar"),t=require("zod");var _={tracking:{removeExtraneousValues:!0,apiUrl:"https://srvless.onlive.site/tracking",data:{widget_type:"OnliveAppFlow"}}},O=t.z.string().nonempty(),E=t.z.object({baseUrl:t.z.string().url().nonempty(),flowId:t.z.string().length(24).nonempty(),organizationId:t.z.string().uuid().nonempty(),lang:t.z.string().length(2).nonempty(),tracking:d.optional(),devMode:t.z.boolean().default(!1).optional()}),g=t.z.object({state:t.z.record(t.z.string(),t.z.any()).optional(),fields:t.z.record(t.z.string(),t.z.any()).optional()}),N=t.z.object({currentStepId:t.z.string().nonempty(),actionId:t.z.string().nonempty()}),S=t.z.enum(["text","boolean","number","email","phone","mobile_phone","date","time","datetime","password","url","color","object","void","location","availability"]),W=t.z.object({name:t.z.string(),value:t.z.string().optional(),icon:t.z.string().optional(),type:t.z.enum(["url","email","phone"]).optional()}),Y=t.z.object({lat:t.z.number().min(-90).max(90),lng:t.z.number().min(-180).max(180),meta:t.z.record(t.z.string(),t.z.any()).optional(),properties:t.z.record(t.z.string(),W).optional()}),K=t.z.object({datetime:t.z.string().datetime(),meta:t.z.record(t.z.string(),t.z.any()).optional()}),u=t.z.union([t.z.string(),t.z.number(),t.z.boolean(),Y,K]),f=t.z.object({content:t.z.object({icon:t.z.string().optional(),url:t.z.string().url().optional(),width:t.z.string().optional(),height:t.z.string().optional(),scale:t.z.number().optional()}).optional(),background:t.z.string().optional(),glyph:t.z.object({color:t.z.string().optional(),url:t.z.string().url().optional(),icon:t.z.string().optional()}).optional(),borderColor:t.z.string().optional(),scale:t.z.number().optional()}),y=t.z.custom(i=>/^\d{4}-\d{2}-\d{2}$/.test(i),{message:"Date must be in 'YYYY-MM-DD' format"}),s=t.z.object({text:t.z.string().optional(),icon:t.z.string().optional()}),w=t.z.object({name:t.z.string().nonempty(),label:t.z.string().optional(),value:t.z.union([u,t.z.array(u)]).optional(),type:S,component:t.z.enum(["input","textarea","select","radio","checkbox","switch","rating","carousel","button","label","map","calendar"]).optional(),disabled:t.z.boolean().optional(),readonly:t.z.boolean().optional(),multiple:t.z.boolean().optional(),placeholder:t.z.string().optional(),options:t.z.array(t.z.object({label:t.z.string().nonempty(),value:u.optional(),image:t.z.string().url().optional(),description:t.z.string().optional(),disabled:t.z.boolean().optional(),attributes:t.z.record(t.z.string(),t.z.any()).optional(),dependsOn:t.z.array(t.z.object({fieldName:t.z.string().nonempty(),value:u.optional(),operator:t.z.enum(["exists","equals","not-equals","contains","not-contains","greater-than","less-than"]).optional()})).optional()})).optional(),required:t.z.boolean().optional(),configuration:t.z.object({generic:t.z.object({error:t.z.object({icon:t.z.string().optional(),showOn:t.z.enum(["input","blur"]).optional()})}).optional(),input:t.z.object({min:t.z.number().optional(),max:t.z.number().optional(),step:t.z.number().optional(),pattern:t.z.string().refine(i=>{try{return new RegExp(i),!0}catch{return!1}},"Invalid regex pattern").optional(),minLength:t.z.number().optional(),maxLength:t.z.number().optional(),exactLength:t.z.number().optional(),prefix:t.z.object({default:s.optional(),success:s.optional(),error:s.optional()}).optional(),suffix:t.z.object({default:s.optional(),success:s.optional(),error:s.optional()}).optional(),clearable:t.z.boolean().optional(),floatingLabel:t.z.boolean().optional()}).optional(),textarea:t.z.object({rows:t.z.number().optional()}).optional(),checkbox:t.z.object({layout:t.z.enum(["horizontal","vertical"])}).optional(),rating:t.z.object({icons:t.z.array(t.z.string()).optional(),color:t.z.string().optional(),precision:t.z.number().optional()}).optional(),map:t.z.object({apiKey:t.z.string().optional(),region:t.z.string().length(2).optional(),center:t.z.object({lat:t.z.number().min(-90).max(90),lng:t.z.number().min(-180).max(180)}).optional(),showMap:t.z.enum(["always","on-search","never"]).optional(),zoom:t.z.object({initial:t.z.number().optional(),focus:t.z.number().optional(),max:t.z.number().optional(),min:t.z.number().optional()}).optional(),controls:t.z.object({fullscreen:t.z.boolean().optional(),mapType:t.z.boolean().optional(),zoom:t.z.boolean().optional(),rotate:t.z.boolean().optional(),scale:t.z.boolean().optional(),streetView:t.z.boolean().optional()}).optional(),initialLocations:t.z.number().optional(),maxLocations:t.z.number().optional(),distanceUnit:t.z.enum(["km","mi"]).optional(),distanceFormat:t.z.enum(["short","long"]).optional(),options:t.z.object({show:t.z.enum(["always","on-search","never"]).optional(),component:t.z.enum(["list-button","list-radio","carousel"]).optional(),searchLabel:t.z.string().optional(),detailsLabel:t.z.string().optional()}).optional(),search:t.z.object({value:t.z.string().optional(),button:t.z.object({label:t.z.string().optional(),position:t.z.enum(["inside","outside"]).optional()}).optional(),placeholder:t.z.string().optional(),noResultsText:t.z.string().optional(),autocomplete:t.z.boolean().optional(),clearable:t.z.boolean().optional(),mode:t.z.enum(["address","postcode"]).default("postcode").optional(),locationButton:t.z.object({icon:t.z.string().optional(),position:t.z.enum(["left","right"]).optional()}).optional(),prefix:t.z.object({default:s.optional()}).optional(),suffix:t.z.object({default:s.optional()}).optional(),mappedResults:t.z.object({mapping:t.z.record(t.z.string(),t.z.array(t.z.object({key:t.z.string(),value:t.z.string()})))}).optional()}).optional(),distanceRange:t.z.object({initial:t.z.number().optional(),min:t.z.number().optional(),max:t.z.number().optional(),step:t.z.number().optional()}).optional(),mapRegion:t.z.object({strokeColor:t.z.string().optional(),fillColor:t.z.string().optional(),fillOpacity:t.z.number().optional()}).optional(),locationPin:f.optional(),markerPin:t.z.object({default:f.optional(),hover:f.optional(),selected:f.optional()}).optional(),infoWindow:t.z.object({button:t.z.object({label:t.z.string(),action:t.z.string()}).optional()}).optional()}).optional(),calendar:t.z.object({current:t.z.object({month:t.z.number().min(0).max(11).optional(),year:t.z.number().optional()}).optional(),range:t.z.object({min:y.optional(),max:y.optional(),enabled:t.z.array(y).optional(),disabled:t.z.array(y).optional()}).optional(),time:t.z.object({label:t.z.string().optional(),format:t.z.enum(["12h","24h"]).optional(),component:t.z.enum(["carousel","list"]).optional()}).optional(),api:t.z.object({url:t.z.string().url().nonempty(),organizationId:t.z.string().nonempty(),availability:t.z.object({filters:h.GetAvailabilityFilters,options:h.GetAvailabilityOptions.optional()}).optional()}).optional()}).optional()}).optional(),dependsOn:t.z.array(t.z.object({fieldName:t.z.string().nonempty(),value:u.optional(),operator:t.z.enum(["exists","equal","not-equal","contains","not-contains","greater-than","less-than"]).optional()})).optional(),dependentBehavior:t.z.enum(["hidden","disabled"]).optional(),customError:t.z.object({required:t.z.string().optional(),invalid:t.z.string().optional(),minLength:t.z.string().optional(),maxLength:t.z.string().optional(),minValue:t.z.string().optional(),maxValue:t.z.string().optional(),mismatch:t.z.string().optional()}).optional()}),A=t.z.object({src:t.z.string().url(),preload:t.z.boolean().optional(),name:t.z.string().nonempty(),function:t.z.string().nonempty(),params:t.z.record(t.z.string(),t.z.any()).optional()}),L=t.z.object({name:t.z.enum(["organization_call","close_panel"]),params:t.z.record(t.z.string(),t.z.any()).optional()}),D=t.z.object({id:t.z.string().nonempty(),type:t.z.enum(["submit","navigate","link","back","dispatcher","script"]),label:t.z.string().nonempty(),variant:t.z.enum(["primary","secondary","success","danger","warning","info"]),url:t.z.string().url().optional(),scripts:A.array().optional(),events:L.array().optional()}),z=t.z.enum(["INVALID_DATA","INVALID_ACTION","STEP_NOT_FOUND","UNKNOWN_ERROR","APPOINTMENT_INVALID_DATA","APPOINTMENT_BUSY_SLOT","APPOINTMENT_OUT_OF_DATE","APPOINTMENT_UNKNOWN_ERROR","LEAD_INVALID_DATA","LEAD_UNKNOWN_ERROR","CONTENT_INVALID_DATA","CONTENT_UNKNOWN_ERROR","CONTACT_INVALID_DATA","CONTACT_UNKNOWN_ERROR","LOST_OPPORTUNITY_INVALID_DATA","LOST_OPPORTUNITY_UNKNOWN_ERROR"]),R=t.z.object({type:t.z.enum(["redirect"]),params:t.z.record(t.z.string(),t.z.any()).optional()}),F=t.z.object({id:t.z.string().nonempty(),title:t.z.string().optional(),description:t.z.string().optional(),stageId:t.z.string().optional(),state:t.z.record(t.z.string(),t.z.any()).optional(),fields:t.z.array(w).optional(),actions:t.z.array(D).optional(),result:t.z.object({postActions:t.z.array(R).optional(),pipelines:t.z.array(t.z.object({name:t.z.string(),data:t.z.object({})})).optional(),tracking:t.z.record(t.z.string(),t.z.any()).optional()}).optional(),error:t.z.object({code:z,message:t.z.string().optional(),fields:t.z.array(t.z.object({name:t.z.string(),type:S,value:t.z.any(),error:t.z.string()})).optional()}).optional(),isFinal:t.z.boolean().optional()}),P=t.z.object({id:t.z.string().length(24).nonempty(),organizationId:t.z.string().uuid().nonempty(),updatedAt:t.z.string().datetime().nonempty(),stages:t.z.array(t.z.object({id:t.z.string().nonempty(),name:t.z.string().nonempty()}))}),H=t.z.object({status:t.z.enum(["ok","error"]),step:F,flow:P}),J=t.z.enum(["track"]);var v=class{constructor(e){p(this,"baseURL");p(this,"headers");p(this,"flowId");p(this,"tracking");let o=(0,C.merge)({},_,E.parse(e));this.flowId=o.flowId,this.baseURL=o.baseUrl,this.headers=new Headers({"Content-Type":"application/json","X-Onlive-Organization-Id":o.organizationId,"X-Lang":o.lang}),o.tracking?.enabled&&(this.tracking=new k(o.organizationId,o.flowId,o.tracking,!!o.devMode))}async request(e,o={}){let n=await fetch(`${this.baseURL}/${e}`,{...o,headers:this.headers});if(!n?.ok)throw new Error(`HTTP error! status: ${n?.status||"unknown"}`);return n.json()}async firstStep(e={}){this.tracking?.analyzeRequest({},e);let o=this.tracking?.preferences(),n=await this.request(`flow/${this.flowId}/first-step`,{method:"POST",body:JSON.stringify(g.parse({...e,state:{preferences:o,...e.state}}))});return this.tracking?.analyzeResponse({},n),n}async getStep(e,o={}){this.tracking?.analyzeRequest({stepId:e},o);let n=this.tracking?.preferences(),r=await this.request(`flow/${this.flowId}/steps/${O.parse(e)}`,{method:"POST",body:JSON.stringify(g.parse({...o,state:{preferences:n,...o.state}}))});return this.tracking?.analyzeResponse({stepId:e},r),r}async nextStep(e,o={}){this.tracking?.analyzeRequest(e,o);let{currentStepId:n,actionId:r}=N.parse(e),m=await this.request(`flow/${this.flowId}/steps/${n}/action/${r}`,{method:"POST",body:JSON.stringify(g.parse(o))});return this.tracking?.analyzeResponse(e,m),m}};0&&(module.exports={Action,ActionEvent,ActionScript,ClientOptions,DEFAULT_CLIENT_OPTIONS,ErrorCode,EventType,Field,Flow,FlowClient,FlowContext,GetStepOptions,GetStepTrigger,ONLIVE_ANALYTICS_EVENT,ONLIVE_FLOW_FORM_NAME,PostAction,Step,StepId,TrackingOptionsSchema});
|