@brytdesigns/shopify-ajax-cart-api 1.0.19 → 1.0.21
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/dist/effect/index.d.ts +32 -137
- package/dist/effect/schema.js +4 -57
- package/dist/effect/schema.js.map +1 -1
- package/dist/esm/index.js +130 -219
- package/dist/esm/index.js.map +1 -1
- package/dist/main/effect/schema.js +4 -57
- package/dist/main/effect/schema.js.map +1 -1
- package/dist/main/index.d.ts +70 -301
- package/dist/main/index.js +1 -1
- package/dist/main/index.js.map +1 -1
- package/package.json +1 -1
package/dist/main/index.d.ts
CHANGED
|
@@ -139,12 +139,6 @@ declare const add: (input?: ({
|
|
|
139
139
|
readonly url: string;
|
|
140
140
|
readonly price: number;
|
|
141
141
|
readonly id: string | number;
|
|
142
|
-
readonly quantity_rule?: {
|
|
143
|
-
readonly min: number;
|
|
144
|
-
readonly max: number | null;
|
|
145
|
-
readonly increment: number;
|
|
146
|
-
} | undefined;
|
|
147
|
-
readonly handle: string;
|
|
148
142
|
readonly properties: {
|
|
149
143
|
readonly [x: string]: string | number | boolean | null;
|
|
150
144
|
};
|
|
@@ -176,6 +170,7 @@ declare const add: (input?: ({
|
|
|
176
170
|
readonly width: number;
|
|
177
171
|
} | undefined;
|
|
178
172
|
readonly image: string;
|
|
173
|
+
readonly handle: string;
|
|
179
174
|
readonly requires_shipping: boolean;
|
|
180
175
|
readonly product_type: string | null;
|
|
181
176
|
readonly product_title: string;
|
|
@@ -200,6 +195,11 @@ declare const add: (input?: ({
|
|
|
200
195
|
};
|
|
201
196
|
}[];
|
|
202
197
|
readonly line_level_total_discount: number;
|
|
198
|
+
readonly quantity_rule?: {
|
|
199
|
+
readonly min: number;
|
|
200
|
+
readonly max: number | null;
|
|
201
|
+
readonly increment: number;
|
|
202
|
+
} | undefined;
|
|
203
203
|
readonly has_components: boolean;
|
|
204
204
|
readonly unit_price?: number | undefined;
|
|
205
205
|
readonly unit_price_measurement?: {
|
|
@@ -237,27 +237,6 @@ declare const add: (input?: ({
|
|
|
237
237
|
};
|
|
238
238
|
} | null;
|
|
239
239
|
} & {
|
|
240
|
-
readonly product: {
|
|
241
|
-
readonly title: string;
|
|
242
|
-
readonly id: string | number;
|
|
243
|
-
readonly options: readonly {
|
|
244
|
-
readonly values: readonly string[];
|
|
245
|
-
readonly name: string;
|
|
246
|
-
readonly position: number;
|
|
247
|
-
}[];
|
|
248
|
-
readonly handle: string;
|
|
249
|
-
readonly variants: readonly {
|
|
250
|
-
readonly title: string;
|
|
251
|
-
readonly id: string | number;
|
|
252
|
-
readonly options: readonly string[];
|
|
253
|
-
readonly quantity_rule: {
|
|
254
|
-
readonly min: number | null;
|
|
255
|
-
readonly max: number | null;
|
|
256
|
-
readonly increment: number;
|
|
257
|
-
};
|
|
258
|
-
}[];
|
|
259
|
-
readonly tags: readonly string[];
|
|
260
|
-
};
|
|
261
240
|
readonly properties_array: readonly {
|
|
262
241
|
readonly key: string;
|
|
263
242
|
readonly value: string | number | boolean | null;
|
|
@@ -329,12 +308,6 @@ declare const change: (input?: ({
|
|
|
329
308
|
readonly url: string;
|
|
330
309
|
readonly price: number;
|
|
331
310
|
readonly id: string | number;
|
|
332
|
-
readonly quantity_rule?: {
|
|
333
|
-
readonly min: number;
|
|
334
|
-
readonly max: number | null;
|
|
335
|
-
readonly increment: number;
|
|
336
|
-
} | undefined;
|
|
337
|
-
readonly handle: string;
|
|
338
311
|
readonly properties: {
|
|
339
312
|
readonly [x: string]: string | number | boolean | null;
|
|
340
313
|
};
|
|
@@ -366,6 +339,7 @@ declare const change: (input?: ({
|
|
|
366
339
|
readonly width: number;
|
|
367
340
|
} | undefined;
|
|
368
341
|
readonly image: string;
|
|
342
|
+
readonly handle: string;
|
|
369
343
|
readonly requires_shipping: boolean;
|
|
370
344
|
readonly product_type: string | null;
|
|
371
345
|
readonly product_title: string;
|
|
@@ -390,6 +364,11 @@ declare const change: (input?: ({
|
|
|
390
364
|
};
|
|
391
365
|
}[];
|
|
392
366
|
readonly line_level_total_discount: number;
|
|
367
|
+
readonly quantity_rule?: {
|
|
368
|
+
readonly min: number;
|
|
369
|
+
readonly max: number | null;
|
|
370
|
+
readonly increment: number;
|
|
371
|
+
} | undefined;
|
|
393
372
|
readonly has_components: boolean;
|
|
394
373
|
readonly unit_price?: number | undefined;
|
|
395
374
|
readonly unit_price_measurement?: {
|
|
@@ -427,27 +406,6 @@ declare const change: (input?: ({
|
|
|
427
406
|
};
|
|
428
407
|
} | null;
|
|
429
408
|
} & {
|
|
430
|
-
readonly product: {
|
|
431
|
-
readonly title: string;
|
|
432
|
-
readonly id: string | number;
|
|
433
|
-
readonly options: readonly {
|
|
434
|
-
readonly values: readonly string[];
|
|
435
|
-
readonly name: string;
|
|
436
|
-
readonly position: number;
|
|
437
|
-
}[];
|
|
438
|
-
readonly handle: string;
|
|
439
|
-
readonly variants: readonly {
|
|
440
|
-
readonly title: string;
|
|
441
|
-
readonly id: string | number;
|
|
442
|
-
readonly options: readonly string[];
|
|
443
|
-
readonly quantity_rule: {
|
|
444
|
-
readonly min: number | null;
|
|
445
|
-
readonly max: number | null;
|
|
446
|
-
readonly increment: number;
|
|
447
|
-
};
|
|
448
|
-
}[];
|
|
449
|
-
readonly tags: readonly string[];
|
|
450
|
-
};
|
|
451
409
|
readonly properties_array: readonly {
|
|
452
410
|
readonly key: string;
|
|
453
411
|
readonly value: string | number | boolean | null;
|
|
@@ -531,12 +489,6 @@ declare const clear: (input?: {
|
|
|
531
489
|
readonly url: string;
|
|
532
490
|
readonly price: number;
|
|
533
491
|
readonly id: string | number;
|
|
534
|
-
readonly quantity_rule?: {
|
|
535
|
-
readonly min: number;
|
|
536
|
-
readonly max: number | null;
|
|
537
|
-
readonly increment: number;
|
|
538
|
-
} | undefined;
|
|
539
|
-
readonly handle: string;
|
|
540
492
|
readonly properties: {
|
|
541
493
|
readonly [x: string]: string | number | boolean | null;
|
|
542
494
|
};
|
|
@@ -568,6 +520,7 @@ declare const clear: (input?: {
|
|
|
568
520
|
readonly width: number;
|
|
569
521
|
} | undefined;
|
|
570
522
|
readonly image: string;
|
|
523
|
+
readonly handle: string;
|
|
571
524
|
readonly requires_shipping: boolean;
|
|
572
525
|
readonly product_type: string | null;
|
|
573
526
|
readonly product_title: string;
|
|
@@ -592,6 +545,11 @@ declare const clear: (input?: {
|
|
|
592
545
|
};
|
|
593
546
|
}[];
|
|
594
547
|
readonly line_level_total_discount: number;
|
|
548
|
+
readonly quantity_rule?: {
|
|
549
|
+
readonly min: number;
|
|
550
|
+
readonly max: number | null;
|
|
551
|
+
readonly increment: number;
|
|
552
|
+
} | undefined;
|
|
595
553
|
readonly has_components: boolean;
|
|
596
554
|
readonly unit_price?: number | undefined;
|
|
597
555
|
readonly unit_price_measurement?: {
|
|
@@ -629,27 +587,6 @@ declare const clear: (input?: {
|
|
|
629
587
|
};
|
|
630
588
|
} | null;
|
|
631
589
|
} & {
|
|
632
|
-
readonly product: {
|
|
633
|
-
readonly title: string;
|
|
634
|
-
readonly id: string | number;
|
|
635
|
-
readonly options: readonly {
|
|
636
|
-
readonly values: readonly string[];
|
|
637
|
-
readonly name: string;
|
|
638
|
-
readonly position: number;
|
|
639
|
-
}[];
|
|
640
|
-
readonly handle: string;
|
|
641
|
-
readonly variants: readonly {
|
|
642
|
-
readonly title: string;
|
|
643
|
-
readonly id: string | number;
|
|
644
|
-
readonly options: readonly string[];
|
|
645
|
-
readonly quantity_rule: {
|
|
646
|
-
readonly min: number | null;
|
|
647
|
-
readonly max: number | null;
|
|
648
|
-
readonly increment: number;
|
|
649
|
-
};
|
|
650
|
-
}[];
|
|
651
|
-
readonly tags: readonly string[];
|
|
652
|
-
};
|
|
653
590
|
readonly properties_array: readonly {
|
|
654
591
|
readonly key: string;
|
|
655
592
|
readonly value: string | number | boolean | null;
|
|
@@ -733,12 +670,6 @@ declare const get: (input?: {
|
|
|
733
670
|
readonly url: string;
|
|
734
671
|
readonly price: number;
|
|
735
672
|
readonly id: string | number;
|
|
736
|
-
readonly quantity_rule?: {
|
|
737
|
-
readonly min: number;
|
|
738
|
-
readonly max: number | null;
|
|
739
|
-
readonly increment: number;
|
|
740
|
-
} | undefined;
|
|
741
|
-
readonly handle: string;
|
|
742
673
|
readonly properties: {
|
|
743
674
|
readonly [x: string]: string | number | boolean | null;
|
|
744
675
|
};
|
|
@@ -770,6 +701,7 @@ declare const get: (input?: {
|
|
|
770
701
|
readonly width: number;
|
|
771
702
|
} | undefined;
|
|
772
703
|
readonly image: string;
|
|
704
|
+
readonly handle: string;
|
|
773
705
|
readonly requires_shipping: boolean;
|
|
774
706
|
readonly product_type: string | null;
|
|
775
707
|
readonly product_title: string;
|
|
@@ -794,6 +726,11 @@ declare const get: (input?: {
|
|
|
794
726
|
};
|
|
795
727
|
}[];
|
|
796
728
|
readonly line_level_total_discount: number;
|
|
729
|
+
readonly quantity_rule?: {
|
|
730
|
+
readonly min: number;
|
|
731
|
+
readonly max: number | null;
|
|
732
|
+
readonly increment: number;
|
|
733
|
+
} | undefined;
|
|
797
734
|
readonly has_components: boolean;
|
|
798
735
|
readonly unit_price?: number | undefined;
|
|
799
736
|
readonly unit_price_measurement?: {
|
|
@@ -831,27 +768,6 @@ declare const get: (input?: {
|
|
|
831
768
|
};
|
|
832
769
|
} | null;
|
|
833
770
|
} & {
|
|
834
|
-
readonly product: {
|
|
835
|
-
readonly title: string;
|
|
836
|
-
readonly id: string | number;
|
|
837
|
-
readonly options: readonly {
|
|
838
|
-
readonly values: readonly string[];
|
|
839
|
-
readonly name: string;
|
|
840
|
-
readonly position: number;
|
|
841
|
-
}[];
|
|
842
|
-
readonly handle: string;
|
|
843
|
-
readonly variants: readonly {
|
|
844
|
-
readonly title: string;
|
|
845
|
-
readonly id: string | number;
|
|
846
|
-
readonly options: readonly string[];
|
|
847
|
-
readonly quantity_rule: {
|
|
848
|
-
readonly min: number | null;
|
|
849
|
-
readonly max: number | null;
|
|
850
|
-
readonly increment: number;
|
|
851
|
-
};
|
|
852
|
-
}[];
|
|
853
|
-
readonly tags: readonly string[];
|
|
854
|
-
};
|
|
855
771
|
readonly properties_array: readonly {
|
|
856
772
|
readonly key: string;
|
|
857
773
|
readonly value: string | number | boolean | null;
|
|
@@ -911,9 +827,9 @@ declare const update: (input?: ({
|
|
|
911
827
|
readonly attributes?: {
|
|
912
828
|
readonly [x: string]: string | number | boolean | null;
|
|
913
829
|
} | undefined;
|
|
914
|
-
readonly updates?:
|
|
830
|
+
readonly updates?: {
|
|
915
831
|
readonly [x: string]: number;
|
|
916
|
-
} | undefined;
|
|
832
|
+
} | readonly number[] | undefined;
|
|
917
833
|
readonly discount?: readonly string[] | undefined;
|
|
918
834
|
} & {
|
|
919
835
|
readonly sections?: string | undefined;
|
|
@@ -944,12 +860,6 @@ declare const update: (input?: ({
|
|
|
944
860
|
readonly url: string;
|
|
945
861
|
readonly price: number;
|
|
946
862
|
readonly id: string | number;
|
|
947
|
-
readonly quantity_rule?: {
|
|
948
|
-
readonly min: number;
|
|
949
|
-
readonly max: number | null;
|
|
950
|
-
readonly increment: number;
|
|
951
|
-
} | undefined;
|
|
952
|
-
readonly handle: string;
|
|
953
863
|
readonly properties: {
|
|
954
864
|
readonly [x: string]: string | number | boolean | null;
|
|
955
865
|
};
|
|
@@ -981,6 +891,7 @@ declare const update: (input?: ({
|
|
|
981
891
|
readonly width: number;
|
|
982
892
|
} | undefined;
|
|
983
893
|
readonly image: string;
|
|
894
|
+
readonly handle: string;
|
|
984
895
|
readonly requires_shipping: boolean;
|
|
985
896
|
readonly product_type: string | null;
|
|
986
897
|
readonly product_title: string;
|
|
@@ -1005,6 +916,11 @@ declare const update: (input?: ({
|
|
|
1005
916
|
};
|
|
1006
917
|
}[];
|
|
1007
918
|
readonly line_level_total_discount: number;
|
|
919
|
+
readonly quantity_rule?: {
|
|
920
|
+
readonly min: number;
|
|
921
|
+
readonly max: number | null;
|
|
922
|
+
readonly increment: number;
|
|
923
|
+
} | undefined;
|
|
1008
924
|
readonly has_components: boolean;
|
|
1009
925
|
readonly unit_price?: number | undefined;
|
|
1010
926
|
readonly unit_price_measurement?: {
|
|
@@ -1042,27 +958,6 @@ declare const update: (input?: ({
|
|
|
1042
958
|
};
|
|
1043
959
|
} | null;
|
|
1044
960
|
} & {
|
|
1045
|
-
readonly product: {
|
|
1046
|
-
readonly title: string;
|
|
1047
|
-
readonly id: string | number;
|
|
1048
|
-
readonly options: readonly {
|
|
1049
|
-
readonly values: readonly string[];
|
|
1050
|
-
readonly name: string;
|
|
1051
|
-
readonly position: number;
|
|
1052
|
-
}[];
|
|
1053
|
-
readonly handle: string;
|
|
1054
|
-
readonly variants: readonly {
|
|
1055
|
-
readonly title: string;
|
|
1056
|
-
readonly id: string | number;
|
|
1057
|
-
readonly options: readonly string[];
|
|
1058
|
-
readonly quantity_rule: {
|
|
1059
|
-
readonly min: number | null;
|
|
1060
|
-
readonly max: number | null;
|
|
1061
|
-
readonly increment: number;
|
|
1062
|
-
};
|
|
1063
|
-
}[];
|
|
1064
|
-
readonly tags: readonly string[];
|
|
1065
|
-
};
|
|
1066
961
|
readonly properties_array: readonly {
|
|
1067
962
|
readonly key: string;
|
|
1068
963
|
readonly value: string | number | boolean | null;
|
|
@@ -1122,7 +1017,7 @@ export declare namespace createAjaxCartClient {
|
|
|
1122
1017
|
signal?: AbortSignal;
|
|
1123
1018
|
};
|
|
1124
1019
|
}
|
|
1125
|
-
export declare const validateCart: (cart: unknown) =>
|
|
1020
|
+
export declare const validateCart: (cart: unknown) => {
|
|
1126
1021
|
readonly total_discount: number;
|
|
1127
1022
|
readonly discounts: readonly {
|
|
1128
1023
|
readonly title: string;
|
|
@@ -1148,12 +1043,6 @@ export declare const validateCart: (cart: unknown) => Promise<{
|
|
|
1148
1043
|
readonly url: string;
|
|
1149
1044
|
readonly price: number;
|
|
1150
1045
|
readonly id: string | number;
|
|
1151
|
-
readonly quantity_rule?: {
|
|
1152
|
-
readonly min: number;
|
|
1153
|
-
readonly max: number | null;
|
|
1154
|
-
readonly increment: number;
|
|
1155
|
-
} | undefined;
|
|
1156
|
-
readonly handle: string;
|
|
1157
1046
|
readonly properties: {
|
|
1158
1047
|
readonly [x: string]: string | number | boolean | null;
|
|
1159
1048
|
};
|
|
@@ -1185,6 +1074,7 @@ export declare const validateCart: (cart: unknown) => Promise<{
|
|
|
1185
1074
|
readonly width: number;
|
|
1186
1075
|
} | undefined;
|
|
1187
1076
|
readonly image: string;
|
|
1077
|
+
readonly handle: string;
|
|
1188
1078
|
readonly requires_shipping: boolean;
|
|
1189
1079
|
readonly product_type: string | null;
|
|
1190
1080
|
readonly product_title: string;
|
|
@@ -1209,6 +1099,11 @@ export declare const validateCart: (cart: unknown) => Promise<{
|
|
|
1209
1099
|
};
|
|
1210
1100
|
}[];
|
|
1211
1101
|
readonly line_level_total_discount: number;
|
|
1102
|
+
readonly quantity_rule?: {
|
|
1103
|
+
readonly min: number;
|
|
1104
|
+
readonly max: number | null;
|
|
1105
|
+
readonly increment: number;
|
|
1106
|
+
} | undefined;
|
|
1212
1107
|
readonly has_components: boolean;
|
|
1213
1108
|
readonly unit_price?: number | undefined;
|
|
1214
1109
|
readonly unit_price_measurement?: {
|
|
@@ -1246,27 +1141,6 @@ export declare const validateCart: (cart: unknown) => Promise<{
|
|
|
1246
1141
|
};
|
|
1247
1142
|
} | null;
|
|
1248
1143
|
} & {
|
|
1249
|
-
readonly product: {
|
|
1250
|
-
readonly title: string;
|
|
1251
|
-
readonly id: string | number;
|
|
1252
|
-
readonly options: readonly {
|
|
1253
|
-
readonly values: readonly string[];
|
|
1254
|
-
readonly name: string;
|
|
1255
|
-
readonly position: number;
|
|
1256
|
-
}[];
|
|
1257
|
-
readonly handle: string;
|
|
1258
|
-
readonly variants: readonly {
|
|
1259
|
-
readonly title: string;
|
|
1260
|
-
readonly id: string | number;
|
|
1261
|
-
readonly options: readonly string[];
|
|
1262
|
-
readonly quantity_rule: {
|
|
1263
|
-
readonly min: number | null;
|
|
1264
|
-
readonly max: number | null;
|
|
1265
|
-
readonly increment: number;
|
|
1266
|
-
};
|
|
1267
|
-
}[];
|
|
1268
|
-
readonly tags: readonly string[];
|
|
1269
|
-
};
|
|
1270
1144
|
readonly properties_array: readonly {
|
|
1271
1145
|
readonly key: string;
|
|
1272
1146
|
readonly value: string | number | boolean | null;
|
|
@@ -1317,7 +1191,7 @@ export declare const validateCart: (cart: unknown) => Promise<{
|
|
|
1317
1191
|
readonly key: string;
|
|
1318
1192
|
readonly value: string | number | boolean | null;
|
|
1319
1193
|
}[];
|
|
1320
|
-
}
|
|
1194
|
+
};
|
|
1321
1195
|
export declare const createAjaxCartApi: ({ debug }: {
|
|
1322
1196
|
debug?: boolean | undefined;
|
|
1323
1197
|
}) => {
|
|
@@ -1328,12 +1202,6 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1328
1202
|
readonly url: string;
|
|
1329
1203
|
readonly price: number;
|
|
1330
1204
|
readonly id: string | number;
|
|
1331
|
-
readonly quantity_rule?: {
|
|
1332
|
-
readonly min: number;
|
|
1333
|
-
readonly max: number | null;
|
|
1334
|
-
readonly increment: number;
|
|
1335
|
-
} | undefined;
|
|
1336
|
-
readonly handle: string;
|
|
1337
1205
|
readonly properties: {
|
|
1338
1206
|
readonly [x: string]: string | number | boolean | null;
|
|
1339
1207
|
};
|
|
@@ -1365,6 +1233,7 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1365
1233
|
readonly width: number;
|
|
1366
1234
|
} | undefined;
|
|
1367
1235
|
readonly image: string;
|
|
1236
|
+
readonly handle: string;
|
|
1368
1237
|
readonly requires_shipping: boolean;
|
|
1369
1238
|
readonly product_type: string | null;
|
|
1370
1239
|
readonly product_title: string;
|
|
@@ -1389,6 +1258,11 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1389
1258
|
};
|
|
1390
1259
|
}[];
|
|
1391
1260
|
readonly line_level_total_discount: number;
|
|
1261
|
+
readonly quantity_rule?: {
|
|
1262
|
+
readonly min: number;
|
|
1263
|
+
readonly max: number | null;
|
|
1264
|
+
readonly increment: number;
|
|
1265
|
+
} | undefined;
|
|
1392
1266
|
readonly has_components: boolean;
|
|
1393
1267
|
readonly unit_price?: number | undefined;
|
|
1394
1268
|
readonly unit_price_measurement?: {
|
|
@@ -1426,27 +1300,6 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1426
1300
|
};
|
|
1427
1301
|
} | null;
|
|
1428
1302
|
} & {
|
|
1429
|
-
readonly product: {
|
|
1430
|
-
readonly title: string;
|
|
1431
|
-
readonly id: string | number;
|
|
1432
|
-
readonly options: readonly {
|
|
1433
|
-
readonly values: readonly string[];
|
|
1434
|
-
readonly name: string;
|
|
1435
|
-
readonly position: number;
|
|
1436
|
-
}[];
|
|
1437
|
-
readonly handle: string;
|
|
1438
|
-
readonly variants: readonly {
|
|
1439
|
-
readonly title: string;
|
|
1440
|
-
readonly id: string | number;
|
|
1441
|
-
readonly options: readonly string[];
|
|
1442
|
-
readonly quantity_rule: {
|
|
1443
|
-
readonly min: number | null;
|
|
1444
|
-
readonly max: number | null;
|
|
1445
|
-
readonly increment: number;
|
|
1446
|
-
};
|
|
1447
|
-
}[];
|
|
1448
|
-
readonly tags: readonly string[];
|
|
1449
|
-
};
|
|
1450
1303
|
readonly properties_array: readonly {
|
|
1451
1304
|
readonly key: string;
|
|
1452
1305
|
readonly value: string | number | boolean | null;
|
|
@@ -1493,12 +1346,6 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1493
1346
|
readonly url: string;
|
|
1494
1347
|
readonly price: number;
|
|
1495
1348
|
readonly id: string | number;
|
|
1496
|
-
readonly quantity_rule?: {
|
|
1497
|
-
readonly min: number;
|
|
1498
|
-
readonly max: number | null;
|
|
1499
|
-
readonly increment: number;
|
|
1500
|
-
} | undefined;
|
|
1501
|
-
readonly handle: string;
|
|
1502
1349
|
readonly properties: {
|
|
1503
1350
|
readonly [x: string]: string | number | boolean | null;
|
|
1504
1351
|
};
|
|
@@ -1530,6 +1377,7 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1530
1377
|
readonly width: number;
|
|
1531
1378
|
} | undefined;
|
|
1532
1379
|
readonly image: string;
|
|
1380
|
+
readonly handle: string;
|
|
1533
1381
|
readonly requires_shipping: boolean;
|
|
1534
1382
|
readonly product_type: string | null;
|
|
1535
1383
|
readonly product_title: string;
|
|
@@ -1554,6 +1402,11 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1554
1402
|
};
|
|
1555
1403
|
}[];
|
|
1556
1404
|
readonly line_level_total_discount: number;
|
|
1405
|
+
readonly quantity_rule?: {
|
|
1406
|
+
readonly min: number;
|
|
1407
|
+
readonly max: number | null;
|
|
1408
|
+
readonly increment: number;
|
|
1409
|
+
} | undefined;
|
|
1557
1410
|
readonly has_components: boolean;
|
|
1558
1411
|
readonly unit_price?: number | undefined;
|
|
1559
1412
|
readonly unit_price_measurement?: {
|
|
@@ -1591,27 +1444,6 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1591
1444
|
};
|
|
1592
1445
|
} | null;
|
|
1593
1446
|
} & {
|
|
1594
|
-
readonly product: {
|
|
1595
|
-
readonly title: string;
|
|
1596
|
-
readonly id: string | number;
|
|
1597
|
-
readonly options: readonly {
|
|
1598
|
-
readonly values: readonly string[];
|
|
1599
|
-
readonly name: string;
|
|
1600
|
-
readonly position: number;
|
|
1601
|
-
}[];
|
|
1602
|
-
readonly handle: string;
|
|
1603
|
-
readonly variants: readonly {
|
|
1604
|
-
readonly title: string;
|
|
1605
|
-
readonly id: string | number;
|
|
1606
|
-
readonly options: readonly string[];
|
|
1607
|
-
readonly quantity_rule: {
|
|
1608
|
-
readonly min: number | null;
|
|
1609
|
-
readonly max: number | null;
|
|
1610
|
-
readonly increment: number;
|
|
1611
|
-
};
|
|
1612
|
-
}[];
|
|
1613
|
-
readonly tags: readonly string[];
|
|
1614
|
-
};
|
|
1615
1447
|
readonly properties_array: readonly {
|
|
1616
1448
|
readonly key: string;
|
|
1617
1449
|
readonly value: string | number | boolean | null;
|
|
@@ -1689,12 +1521,6 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1689
1521
|
readonly url: string;
|
|
1690
1522
|
readonly price: number;
|
|
1691
1523
|
readonly id: string | number;
|
|
1692
|
-
readonly quantity_rule?: {
|
|
1693
|
-
readonly min: number;
|
|
1694
|
-
readonly max: number | null;
|
|
1695
|
-
readonly increment: number;
|
|
1696
|
-
} | undefined;
|
|
1697
|
-
readonly handle: string;
|
|
1698
1524
|
readonly properties: {
|
|
1699
1525
|
readonly [x: string]: string | number | boolean | null;
|
|
1700
1526
|
};
|
|
@@ -1726,6 +1552,7 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1726
1552
|
readonly width: number;
|
|
1727
1553
|
} | undefined;
|
|
1728
1554
|
readonly image: string;
|
|
1555
|
+
readonly handle: string;
|
|
1729
1556
|
readonly requires_shipping: boolean;
|
|
1730
1557
|
readonly product_type: string | null;
|
|
1731
1558
|
readonly product_title: string;
|
|
@@ -1750,6 +1577,11 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1750
1577
|
};
|
|
1751
1578
|
}[];
|
|
1752
1579
|
readonly line_level_total_discount: number;
|
|
1580
|
+
readonly quantity_rule?: {
|
|
1581
|
+
readonly min: number;
|
|
1582
|
+
readonly max: number | null;
|
|
1583
|
+
readonly increment: number;
|
|
1584
|
+
} | undefined;
|
|
1753
1585
|
readonly has_components: boolean;
|
|
1754
1586
|
readonly unit_price?: number | undefined;
|
|
1755
1587
|
readonly unit_price_measurement?: {
|
|
@@ -1787,27 +1619,6 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1787
1619
|
};
|
|
1788
1620
|
} | null;
|
|
1789
1621
|
} & {
|
|
1790
|
-
readonly product: {
|
|
1791
|
-
readonly title: string;
|
|
1792
|
-
readonly id: string | number;
|
|
1793
|
-
readonly options: readonly {
|
|
1794
|
-
readonly values: readonly string[];
|
|
1795
|
-
readonly name: string;
|
|
1796
|
-
readonly position: number;
|
|
1797
|
-
}[];
|
|
1798
|
-
readonly handle: string;
|
|
1799
|
-
readonly variants: readonly {
|
|
1800
|
-
readonly title: string;
|
|
1801
|
-
readonly id: string | number;
|
|
1802
|
-
readonly options: readonly string[];
|
|
1803
|
-
readonly quantity_rule: {
|
|
1804
|
-
readonly min: number | null;
|
|
1805
|
-
readonly max: number | null;
|
|
1806
|
-
readonly increment: number;
|
|
1807
|
-
};
|
|
1808
|
-
}[];
|
|
1809
|
-
readonly tags: readonly string[];
|
|
1810
|
-
};
|
|
1811
1622
|
readonly properties_array: readonly {
|
|
1812
1623
|
readonly key: string;
|
|
1813
1624
|
readonly value: string | number | boolean | null;
|
|
@@ -1885,12 +1696,6 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1885
1696
|
readonly url: string;
|
|
1886
1697
|
readonly price: number;
|
|
1887
1698
|
readonly id: string | number;
|
|
1888
|
-
readonly quantity_rule?: {
|
|
1889
|
-
readonly min: number;
|
|
1890
|
-
readonly max: number | null;
|
|
1891
|
-
readonly increment: number;
|
|
1892
|
-
} | undefined;
|
|
1893
|
-
readonly handle: string;
|
|
1894
1699
|
readonly properties: {
|
|
1895
1700
|
readonly [x: string]: string | number | boolean | null;
|
|
1896
1701
|
};
|
|
@@ -1922,6 +1727,7 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1922
1727
|
readonly width: number;
|
|
1923
1728
|
} | undefined;
|
|
1924
1729
|
readonly image: string;
|
|
1730
|
+
readonly handle: string;
|
|
1925
1731
|
readonly requires_shipping: boolean;
|
|
1926
1732
|
readonly product_type: string | null;
|
|
1927
1733
|
readonly product_title: string;
|
|
@@ -1946,6 +1752,11 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1946
1752
|
};
|
|
1947
1753
|
}[];
|
|
1948
1754
|
readonly line_level_total_discount: number;
|
|
1755
|
+
readonly quantity_rule?: {
|
|
1756
|
+
readonly min: number;
|
|
1757
|
+
readonly max: number | null;
|
|
1758
|
+
readonly increment: number;
|
|
1759
|
+
} | undefined;
|
|
1949
1760
|
readonly has_components: boolean;
|
|
1950
1761
|
readonly unit_price?: number | undefined;
|
|
1951
1762
|
readonly unit_price_measurement?: {
|
|
@@ -1983,27 +1794,6 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
1983
1794
|
};
|
|
1984
1795
|
} | null;
|
|
1985
1796
|
} & {
|
|
1986
|
-
readonly product: {
|
|
1987
|
-
readonly title: string;
|
|
1988
|
-
readonly id: string | number;
|
|
1989
|
-
readonly options: readonly {
|
|
1990
|
-
readonly values: readonly string[];
|
|
1991
|
-
readonly name: string;
|
|
1992
|
-
readonly position: number;
|
|
1993
|
-
}[];
|
|
1994
|
-
readonly handle: string;
|
|
1995
|
-
readonly variants: readonly {
|
|
1996
|
-
readonly title: string;
|
|
1997
|
-
readonly id: string | number;
|
|
1998
|
-
readonly options: readonly string[];
|
|
1999
|
-
readonly quantity_rule: {
|
|
2000
|
-
readonly min: number | null;
|
|
2001
|
-
readonly max: number | null;
|
|
2002
|
-
readonly increment: number;
|
|
2003
|
-
};
|
|
2004
|
-
}[];
|
|
2005
|
-
readonly tags: readonly string[];
|
|
2006
|
-
};
|
|
2007
1797
|
readonly properties_array: readonly {
|
|
2008
1798
|
readonly key: string;
|
|
2009
1799
|
readonly value: string | number | boolean | null;
|
|
@@ -2081,12 +1871,6 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
2081
1871
|
readonly url: string;
|
|
2082
1872
|
readonly price: number;
|
|
2083
1873
|
readonly id: string | number;
|
|
2084
|
-
readonly quantity_rule?: {
|
|
2085
|
-
readonly min: number;
|
|
2086
|
-
readonly max: number | null;
|
|
2087
|
-
readonly increment: number;
|
|
2088
|
-
} | undefined;
|
|
2089
|
-
readonly handle: string;
|
|
2090
1874
|
readonly properties: {
|
|
2091
1875
|
readonly [x: string]: string | number | boolean | null;
|
|
2092
1876
|
};
|
|
@@ -2118,6 +1902,7 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
2118
1902
|
readonly width: number;
|
|
2119
1903
|
} | undefined;
|
|
2120
1904
|
readonly image: string;
|
|
1905
|
+
readonly handle: string;
|
|
2121
1906
|
readonly requires_shipping: boolean;
|
|
2122
1907
|
readonly product_type: string | null;
|
|
2123
1908
|
readonly product_title: string;
|
|
@@ -2142,6 +1927,11 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
2142
1927
|
};
|
|
2143
1928
|
}[];
|
|
2144
1929
|
readonly line_level_total_discount: number;
|
|
1930
|
+
readonly quantity_rule?: {
|
|
1931
|
+
readonly min: number;
|
|
1932
|
+
readonly max: number | null;
|
|
1933
|
+
readonly increment: number;
|
|
1934
|
+
} | undefined;
|
|
2145
1935
|
readonly has_components: boolean;
|
|
2146
1936
|
readonly unit_price?: number | undefined;
|
|
2147
1937
|
readonly unit_price_measurement?: {
|
|
@@ -2179,27 +1969,6 @@ export declare const createAjaxCartApi: ({ debug }: {
|
|
|
2179
1969
|
};
|
|
2180
1970
|
} | null;
|
|
2181
1971
|
} & {
|
|
2182
|
-
readonly product: {
|
|
2183
|
-
readonly title: string;
|
|
2184
|
-
readonly id: string | number;
|
|
2185
|
-
readonly options: readonly {
|
|
2186
|
-
readonly values: readonly string[];
|
|
2187
|
-
readonly name: string;
|
|
2188
|
-
readonly position: number;
|
|
2189
|
-
}[];
|
|
2190
|
-
readonly handle: string;
|
|
2191
|
-
readonly variants: readonly {
|
|
2192
|
-
readonly title: string;
|
|
2193
|
-
readonly id: string | number;
|
|
2194
|
-
readonly options: readonly string[];
|
|
2195
|
-
readonly quantity_rule: {
|
|
2196
|
-
readonly min: number | null;
|
|
2197
|
-
readonly max: number | null;
|
|
2198
|
-
readonly increment: number;
|
|
2199
|
-
};
|
|
2200
|
-
}[];
|
|
2201
|
-
readonly tags: readonly string[];
|
|
2202
|
-
};
|
|
2203
1972
|
readonly properties_array: readonly {
|
|
2204
1973
|
readonly key: string;
|
|
2205
1974
|
readonly value: string | number | boolean | null;
|
package/dist/main/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import * as Schema from 'effect/Schema';
|
|
|
8
8
|
import { AjaxClientResponse } from './effect/data/index.js';
|
|
9
9
|
import { CartOutput } from './effect/schema.js';
|
|
10
10
|
|
|
11
|
-
const validateCart = (cart) => Effect.
|
|
11
|
+
const validateCart = (cart) => Effect.runSync(Schema.decodeUnknown(CartOutput)(cart));
|
|
12
12
|
const createAjaxCartApi = ({ debug = false }) => {
|
|
13
13
|
let baseLayer = Layer.empty;
|
|
14
14
|
let minimumLogLevel = LogLevel.None;
|