@shophost/rest-api 2.0.51 → 2.0.52
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/package.json +1 -1
- package/schema.prisma +4 -0
- package/src/bootstrap.js +1 -1
- package/src/bootstrap.js.map +1 -1
- package/src/{app-services.d.ts → container.d.ts} +7 -5
- package/src/container.js +1 -0
- package/src/container.js.map +1 -0
- package/src/core/db/__generated__/client/internal/class.js +33 -29
- package/src/core/db/__generated__/client/internal/class.js.map +1 -1
- package/src/core/db/__generated__/client/internal/prismaNamespace.d.ts +4 -0
- package/src/core/db/__generated__/client/internal/prismaNamespace.js +1 -1
- package/src/core/db/__generated__/client/internal/prismaNamespace.js.map +1 -1
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.d.ts +4 -0
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.js +1 -1
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.js.map +1 -1
- package/src/core/db/__generated__/client/models/Order.d.ts +178 -1
- package/src/core/db/__generated__/client/models/Product.d.ts +75 -1
- package/src/core/utils/zod.util.js +1 -1
- package/src/core/utils/zod.util.js.map +1 -1
- package/src/features/cart/cart.route.d.ts +29 -0
- package/src/features/cart/cart.route.js +1 -1
- package/src/features/cart/cart.route.js.map +1 -1
- package/src/features/cart/cart.schema.d.ts +399 -0
- package/src/features/cart/cart.schema.js +1 -1
- package/src/features/cart/cart.schema.js.map +1 -1
- package/src/features/cart/cart.service.d.ts +30 -3
- package/src/features/cart/cart.service.js +1 -1
- package/src/features/cart/cart.service.js.map +1 -1
- package/src/features/inventory/inventory.service.d.ts +24 -0
- package/src/features/inventory/inventory.service.js +1 -0
- package/src/features/inventory/inventory.service.js.map +1 -0
- package/src/features/order/order.handler.js +1 -1
- package/src/features/order/order.handler.js.map +1 -1
- package/src/features/order/order.route.d.ts +314 -0
- package/src/features/order/order.route.js +1 -1
- package/src/features/order/order.route.js.map +1 -1
- package/src/features/order/order.schema.d.ts +33 -0
- package/src/features/order/order.schema.js +1 -1
- package/src/features/order/order.schema.js.map +1 -1
- package/src/features/order/order.service.d.ts +55 -1
- package/src/features/order/order.service.js +1 -1
- package/src/features/order/order.service.js.map +1 -1
- package/src/features/payment/payment.service.d.ts +4 -1
- package/src/features/payment/payment.service.js +1 -1
- package/src/features/payment/payment.service.js.map +1 -1
- package/src/features/payment/stripe.service.d.ts +2 -2
- package/src/features/payment/stripe.service.js +1 -1
- package/src/features/payment/stripe.service.js.map +1 -1
- package/src/features/product/product.route.d.ts +10 -0
- package/src/features/product/product.schema.d.ts +4 -0
- package/src/features/product/product.schema.js +1 -1
- package/src/features/product/product.schema.js.map +1 -1
- package/src/features/product/product.service.d.ts +8 -0
- package/src/features/product/product.service.js +1 -1
- package/src/features/product/product.service.js.map +1 -1
- package/src/schemas/number.schema.d.ts +1 -0
- package/src/schemas/number.schema.js +1 -1
- package/src/schemas/number.schema.js.map +1 -1
- package/src/app-services.js +0 -1
- package/src/app-services.js.map +0 -1
|
@@ -336,6 +336,14 @@ export declare const orderRoute: {
|
|
|
336
336
|
createdAt: z.ZodDate;
|
|
337
337
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
338
338
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
339
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
340
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
341
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
342
|
+
productId: z.ZodString;
|
|
343
|
+
title: z.ZodString;
|
|
344
|
+
requestedQuantity: z.ZodNumber;
|
|
345
|
+
availableQuantity: z.ZodNumber;
|
|
346
|
+
}, z.core.$strip>>>>;
|
|
339
347
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
340
348
|
id: z.ZodString;
|
|
341
349
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -535,6 +543,14 @@ export declare const orderRoute: {
|
|
|
535
543
|
readyForDispatchAt?: Date | null | undefined;
|
|
536
544
|
completedAt?: Date | null | undefined;
|
|
537
545
|
cancelledAt?: Date | null | undefined;
|
|
546
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
547
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
548
|
+
inventoryConflictItems?: {
|
|
549
|
+
productId: string;
|
|
550
|
+
title: string;
|
|
551
|
+
requestedQuantity: number;
|
|
552
|
+
availableQuantity: number;
|
|
553
|
+
}[] | null | undefined;
|
|
538
554
|
shippingAddress?: {
|
|
539
555
|
id: string;
|
|
540
556
|
addressLineOne: string;
|
|
@@ -634,6 +650,14 @@ export declare const orderRoute: {
|
|
|
634
650
|
readyForDispatchAt?: Date | null | undefined;
|
|
635
651
|
completedAt?: Date | null | undefined;
|
|
636
652
|
cancelledAt?: Date | null | undefined;
|
|
653
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
654
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
655
|
+
inventoryConflictItems?: {
|
|
656
|
+
productId: string;
|
|
657
|
+
title: string;
|
|
658
|
+
requestedQuantity: number;
|
|
659
|
+
availableQuantity: number;
|
|
660
|
+
}[] | null | undefined;
|
|
637
661
|
shippingAddress?: {
|
|
638
662
|
id: string;
|
|
639
663
|
addressLineOne: string;
|
|
@@ -1027,6 +1051,14 @@ export declare const orderRoute: {
|
|
|
1027
1051
|
createdAt: z.ZodDate;
|
|
1028
1052
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1029
1053
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1054
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1055
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1056
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1057
|
+
productId: z.ZodString;
|
|
1058
|
+
title: z.ZodString;
|
|
1059
|
+
requestedQuantity: z.ZodNumber;
|
|
1060
|
+
availableQuantity: z.ZodNumber;
|
|
1061
|
+
}, z.core.$strip>>>>;
|
|
1030
1062
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1031
1063
|
id: z.ZodString;
|
|
1032
1064
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -1226,6 +1258,14 @@ export declare const orderRoute: {
|
|
|
1226
1258
|
readyForDispatchAt?: Date | null | undefined;
|
|
1227
1259
|
completedAt?: Date | null | undefined;
|
|
1228
1260
|
cancelledAt?: Date | null | undefined;
|
|
1261
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
1262
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
1263
|
+
inventoryConflictItems?: {
|
|
1264
|
+
productId: string;
|
|
1265
|
+
title: string;
|
|
1266
|
+
requestedQuantity: number;
|
|
1267
|
+
availableQuantity: number;
|
|
1268
|
+
}[] | null | undefined;
|
|
1229
1269
|
shippingAddress?: {
|
|
1230
1270
|
id: string;
|
|
1231
1271
|
addressLineOne: string;
|
|
@@ -1325,6 +1365,14 @@ export declare const orderRoute: {
|
|
|
1325
1365
|
readyForDispatchAt?: Date | null | undefined;
|
|
1326
1366
|
completedAt?: Date | null | undefined;
|
|
1327
1367
|
cancelledAt?: Date | null | undefined;
|
|
1368
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
1369
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
1370
|
+
inventoryConflictItems?: {
|
|
1371
|
+
productId: string;
|
|
1372
|
+
title: string;
|
|
1373
|
+
requestedQuantity: number;
|
|
1374
|
+
availableQuantity: number;
|
|
1375
|
+
}[] | null | undefined;
|
|
1328
1376
|
shippingAddress?: {
|
|
1329
1377
|
id: string;
|
|
1330
1378
|
addressLineOne: string;
|
|
@@ -1637,6 +1685,14 @@ export declare const orderRoute: {
|
|
|
1637
1685
|
createdAt: z.ZodDate;
|
|
1638
1686
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1639
1687
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1688
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1689
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1690
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1691
|
+
productId: z.ZodString;
|
|
1692
|
+
title: z.ZodString;
|
|
1693
|
+
requestedQuantity: z.ZodNumber;
|
|
1694
|
+
availableQuantity: z.ZodNumber;
|
|
1695
|
+
}, z.core.$strip>>>>;
|
|
1640
1696
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1641
1697
|
id: z.ZodString;
|
|
1642
1698
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -1836,6 +1892,14 @@ export declare const orderRoute: {
|
|
|
1836
1892
|
readyForDispatchAt?: Date | null | undefined;
|
|
1837
1893
|
completedAt?: Date | null | undefined;
|
|
1838
1894
|
cancelledAt?: Date | null | undefined;
|
|
1895
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
1896
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
1897
|
+
inventoryConflictItems?: {
|
|
1898
|
+
productId: string;
|
|
1899
|
+
title: string;
|
|
1900
|
+
requestedQuantity: number;
|
|
1901
|
+
availableQuantity: number;
|
|
1902
|
+
}[] | null | undefined;
|
|
1839
1903
|
shippingAddress?: {
|
|
1840
1904
|
id: string;
|
|
1841
1905
|
addressLineOne: string;
|
|
@@ -1935,6 +1999,14 @@ export declare const orderRoute: {
|
|
|
1935
1999
|
readyForDispatchAt?: Date | null | undefined;
|
|
1936
2000
|
completedAt?: Date | null | undefined;
|
|
1937
2001
|
cancelledAt?: Date | null | undefined;
|
|
2002
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
2003
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
2004
|
+
inventoryConflictItems?: {
|
|
2005
|
+
productId: string;
|
|
2006
|
+
title: string;
|
|
2007
|
+
requestedQuantity: number;
|
|
2008
|
+
availableQuantity: number;
|
|
2009
|
+
}[] | null | undefined;
|
|
1938
2010
|
shippingAddress?: {
|
|
1939
2011
|
id: string;
|
|
1940
2012
|
addressLineOne: string;
|
|
@@ -1956,6 +2028,200 @@ export declare const orderRoute: {
|
|
|
1956
2028
|
};
|
|
1957
2029
|
description: string;
|
|
1958
2030
|
};
|
|
2031
|
+
409: {
|
|
2032
|
+
content: {
|
|
2033
|
+
"application/json": {
|
|
2034
|
+
schema: z.ZodObject<{
|
|
2035
|
+
invalidProductIds: z.ZodArray<z.ZodString>;
|
|
2036
|
+
normalizedItems: z.ZodArray<z.ZodObject<{
|
|
2037
|
+
productId: z.ZodString;
|
|
2038
|
+
quantity: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
2039
|
+
modifierGroups: z.ZodArray<z.ZodObject<{
|
|
2040
|
+
id: z.ZodString;
|
|
2041
|
+
modifiers: z.ZodArray<z.ZodObject<{
|
|
2042
|
+
id: z.ZodString;
|
|
2043
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
2044
|
+
}, z.core.$strip>>;
|
|
2045
|
+
}, z.core.$strip>>;
|
|
2046
|
+
}, z.core.$strip>>;
|
|
2047
|
+
adjustments: z.ZodArray<z.ZodObject<{
|
|
2048
|
+
productId: z.ZodString;
|
|
2049
|
+
modifierGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2050
|
+
id: z.ZodString;
|
|
2051
|
+
modifiers: z.ZodArray<z.ZodObject<{
|
|
2052
|
+
id: z.ZodString;
|
|
2053
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
2054
|
+
}, z.core.$strip>>;
|
|
2055
|
+
}, z.core.$strip>>>;
|
|
2056
|
+
reason: z.ZodEnum<{
|
|
2057
|
+
invalid_product: "invalid_product";
|
|
2058
|
+
out_of_stock: "out_of_stock";
|
|
2059
|
+
insufficient_stock: "insufficient_stock";
|
|
2060
|
+
}>;
|
|
2061
|
+
requestedQuantity: z.ZodNumber;
|
|
2062
|
+
resolvedQuantity: z.ZodNumber;
|
|
2063
|
+
}, z.core.$strip>>;
|
|
2064
|
+
products: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2065
|
+
description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
2066
|
+
title: z.ZodDefault<z.ZodString>;
|
|
2067
|
+
currency: z.ZodString;
|
|
2068
|
+
id: z.ZodString;
|
|
2069
|
+
createdAt: z.ZodDate;
|
|
2070
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
2071
|
+
publishedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2072
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
2073
|
+
basePrice: z.ZodCoercedNumber<unknown>;
|
|
2074
|
+
discountedBasePrice: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
|
|
2075
|
+
availableQuantity: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
|
|
2076
|
+
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2077
|
+
id: z.ZodString;
|
|
2078
|
+
url: z.ZodString;
|
|
2079
|
+
mimeType: z.ZodString;
|
|
2080
|
+
size: z.ZodNumber;
|
|
2081
|
+
filename: z.ZodString;
|
|
2082
|
+
}, z.core.$strip>>>;
|
|
2083
|
+
modifierGroups: z.ZodArray<z.ZodObject<{
|
|
2084
|
+
title: z.ZodNullable<z.ZodDefault<z.ZodString>>;
|
|
2085
|
+
id: z.ZodString;
|
|
2086
|
+
defaultLocale: z.ZodOptional<z.ZodEnum<{
|
|
2087
|
+
id: "id";
|
|
2088
|
+
af: "af";
|
|
2089
|
+
sq: "sq";
|
|
2090
|
+
ar_dz: "ar_dz";
|
|
2091
|
+
ar_bh: "ar_bh";
|
|
2092
|
+
ar_eg: "ar_eg";
|
|
2093
|
+
ar_iq: "ar_iq";
|
|
2094
|
+
ar_jo: "ar_jo";
|
|
2095
|
+
ar_kw: "ar_kw";
|
|
2096
|
+
ar_lb: "ar_lb";
|
|
2097
|
+
ar_ly: "ar_ly";
|
|
2098
|
+
ar_ma: "ar_ma";
|
|
2099
|
+
ar_om: "ar_om";
|
|
2100
|
+
ar_qa: "ar_qa";
|
|
2101
|
+
ar_sa: "ar_sa";
|
|
2102
|
+
ar_sy: "ar_sy";
|
|
2103
|
+
ar_tn: "ar_tn";
|
|
2104
|
+
ar_ae: "ar_ae";
|
|
2105
|
+
ar_ye: "ar_ye";
|
|
2106
|
+
eu: "eu";
|
|
2107
|
+
be: "be";
|
|
2108
|
+
bg: "bg";
|
|
2109
|
+
ca: "ca";
|
|
2110
|
+
zh_hk: "zh_hk";
|
|
2111
|
+
zh_cn: "zh_cn";
|
|
2112
|
+
zh_sg: "zh_sg";
|
|
2113
|
+
zh_tw: "zh_tw";
|
|
2114
|
+
hr: "hr";
|
|
2115
|
+
cs: "cs";
|
|
2116
|
+
da: "da";
|
|
2117
|
+
nl_be: "nl_be";
|
|
2118
|
+
nl: "nl";
|
|
2119
|
+
en: "en";
|
|
2120
|
+
en_au: "en_au";
|
|
2121
|
+
en_bz: "en_bz";
|
|
2122
|
+
en_ca: "en_ca";
|
|
2123
|
+
en_ie: "en_ie";
|
|
2124
|
+
en_jm: "en_jm";
|
|
2125
|
+
en_nz: "en_nz";
|
|
2126
|
+
en_za: "en_za";
|
|
2127
|
+
en_tt: "en_tt";
|
|
2128
|
+
en_gb: "en_gb";
|
|
2129
|
+
en_us: "en_us";
|
|
2130
|
+
et: "et";
|
|
2131
|
+
fo: "fo";
|
|
2132
|
+
fa: "fa";
|
|
2133
|
+
fi: "fi";
|
|
2134
|
+
fr_be: "fr_be";
|
|
2135
|
+
fr_ca: "fr_ca";
|
|
2136
|
+
fr_lu: "fr_lu";
|
|
2137
|
+
fr: "fr";
|
|
2138
|
+
fr_ch: "fr_ch";
|
|
2139
|
+
gd: "gd";
|
|
2140
|
+
de_at: "de_at";
|
|
2141
|
+
de_li: "de_li";
|
|
2142
|
+
de_lu: "de_lu";
|
|
2143
|
+
de: "de";
|
|
2144
|
+
de_ch: "de_ch";
|
|
2145
|
+
el: "el";
|
|
2146
|
+
he: "he";
|
|
2147
|
+
hi: "hi";
|
|
2148
|
+
hu: "hu";
|
|
2149
|
+
is: "is";
|
|
2150
|
+
ga: "ga";
|
|
2151
|
+
it: "it";
|
|
2152
|
+
it_ch: "it_ch";
|
|
2153
|
+
ja: "ja";
|
|
2154
|
+
ko: "ko";
|
|
2155
|
+
ku: "ku";
|
|
2156
|
+
lv: "lv";
|
|
2157
|
+
lt: "lt";
|
|
2158
|
+
mk: "mk";
|
|
2159
|
+
ml: "ml";
|
|
2160
|
+
ms: "ms";
|
|
2161
|
+
mt: "mt";
|
|
2162
|
+
no: "no";
|
|
2163
|
+
nb: "nb";
|
|
2164
|
+
nn: "nn";
|
|
2165
|
+
pl: "pl";
|
|
2166
|
+
pt_br: "pt_br";
|
|
2167
|
+
pt: "pt";
|
|
2168
|
+
pa: "pa";
|
|
2169
|
+
rm: "rm";
|
|
2170
|
+
ro: "ro";
|
|
2171
|
+
ro_md: "ro_md";
|
|
2172
|
+
ru: "ru";
|
|
2173
|
+
ru_md: "ru_md";
|
|
2174
|
+
sr: "sr";
|
|
2175
|
+
sk: "sk";
|
|
2176
|
+
sl: "sl";
|
|
2177
|
+
sb: "sb";
|
|
2178
|
+
es_ar: "es_ar";
|
|
2179
|
+
es_bo: "es_bo";
|
|
2180
|
+
es_cl: "es_cl";
|
|
2181
|
+
es_co: "es_co";
|
|
2182
|
+
es_cr: "es_cr";
|
|
2183
|
+
es_do: "es_do";
|
|
2184
|
+
es_ec: "es_ec";
|
|
2185
|
+
es_sv: "es_sv";
|
|
2186
|
+
es_gt: "es_gt";
|
|
2187
|
+
es_hn: "es_hn";
|
|
2188
|
+
es_mx: "es_mx";
|
|
2189
|
+
es: "es";
|
|
2190
|
+
sv: "sv";
|
|
2191
|
+
sv_fi: "sv_fi";
|
|
2192
|
+
th: "th";
|
|
2193
|
+
tr: "tr";
|
|
2194
|
+
uk: "uk";
|
|
2195
|
+
ur: "ur";
|
|
2196
|
+
vi: "vi";
|
|
2197
|
+
cy: "cy";
|
|
2198
|
+
ji: "ji";
|
|
2199
|
+
zu: "zu";
|
|
2200
|
+
}>>;
|
|
2201
|
+
selectMin: z.ZodCoercedNumber<unknown>;
|
|
2202
|
+
selectMax: z.ZodCoercedNumber<unknown>;
|
|
2203
|
+
modifiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2204
|
+
id: z.ZodOptional<z.ZodString>;
|
|
2205
|
+
title: z.ZodString;
|
|
2206
|
+
sku: z.ZodOptional<z.ZodCoercedString<unknown>>;
|
|
2207
|
+
price: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
2208
|
+
}, z.core.$strip>>>;
|
|
2209
|
+
}, z.core.$strip>>;
|
|
2210
|
+
categories: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2211
|
+
id: z.ZodString;
|
|
2212
|
+
}, z.core.$strip>>>;
|
|
2213
|
+
manufacturerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2214
|
+
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
2215
|
+
}, z.core.$strip>>;
|
|
2216
|
+
shipping: z.ZodOptional<z.ZodNumber>;
|
|
2217
|
+
subtotal: z.ZodNumber;
|
|
2218
|
+
total: z.ZodNumber;
|
|
2219
|
+
message: z.ZodString;
|
|
2220
|
+
}, z.core.$strip>;
|
|
2221
|
+
};
|
|
2222
|
+
};
|
|
2223
|
+
description: string;
|
|
2224
|
+
};
|
|
1959
2225
|
400: {
|
|
1960
2226
|
content: {
|
|
1961
2227
|
"application/json": {
|
|
@@ -2209,6 +2475,14 @@ export declare const orderRoute: {
|
|
|
2209
2475
|
createdAt: z.ZodDate;
|
|
2210
2476
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2211
2477
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2478
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2479
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2480
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
2481
|
+
productId: z.ZodString;
|
|
2482
|
+
title: z.ZodString;
|
|
2483
|
+
requestedQuantity: z.ZodNumber;
|
|
2484
|
+
availableQuantity: z.ZodNumber;
|
|
2485
|
+
}, z.core.$strip>>>>;
|
|
2212
2486
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2213
2487
|
id: z.ZodString;
|
|
2214
2488
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -2408,6 +2682,14 @@ export declare const orderRoute: {
|
|
|
2408
2682
|
readyForDispatchAt?: Date | null | undefined;
|
|
2409
2683
|
completedAt?: Date | null | undefined;
|
|
2410
2684
|
cancelledAt?: Date | null | undefined;
|
|
2685
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
2686
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
2687
|
+
inventoryConflictItems?: {
|
|
2688
|
+
productId: string;
|
|
2689
|
+
title: string;
|
|
2690
|
+
requestedQuantity: number;
|
|
2691
|
+
availableQuantity: number;
|
|
2692
|
+
}[] | null | undefined;
|
|
2411
2693
|
shippingAddress?: {
|
|
2412
2694
|
id: string;
|
|
2413
2695
|
addressLineOne: string;
|
|
@@ -2507,6 +2789,14 @@ export declare const orderRoute: {
|
|
|
2507
2789
|
readyForDispatchAt?: Date | null | undefined;
|
|
2508
2790
|
completedAt?: Date | null | undefined;
|
|
2509
2791
|
cancelledAt?: Date | null | undefined;
|
|
2792
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
2793
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
2794
|
+
inventoryConflictItems?: {
|
|
2795
|
+
productId: string;
|
|
2796
|
+
title: string;
|
|
2797
|
+
requestedQuantity: number;
|
|
2798
|
+
availableQuantity: number;
|
|
2799
|
+
}[] | null | undefined;
|
|
2510
2800
|
shippingAddress?: {
|
|
2511
2801
|
id: string;
|
|
2512
2802
|
addressLineOne: string;
|
|
@@ -2777,6 +3067,14 @@ export declare const orderRoute: {
|
|
|
2777
3067
|
createdAt: z.ZodDate;
|
|
2778
3068
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2779
3069
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
3070
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
3071
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
3072
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
3073
|
+
productId: z.ZodString;
|
|
3074
|
+
title: z.ZodString;
|
|
3075
|
+
requestedQuantity: z.ZodNumber;
|
|
3076
|
+
availableQuantity: z.ZodNumber;
|
|
3077
|
+
}, z.core.$strip>>>>;
|
|
2780
3078
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2781
3079
|
id: z.ZodString;
|
|
2782
3080
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -2976,6 +3274,14 @@ export declare const orderRoute: {
|
|
|
2976
3274
|
readyForDispatchAt?: Date | null | undefined;
|
|
2977
3275
|
completedAt?: Date | null | undefined;
|
|
2978
3276
|
cancelledAt?: Date | null | undefined;
|
|
3277
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
3278
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
3279
|
+
inventoryConflictItems?: {
|
|
3280
|
+
productId: string;
|
|
3281
|
+
title: string;
|
|
3282
|
+
requestedQuantity: number;
|
|
3283
|
+
availableQuantity: number;
|
|
3284
|
+
}[] | null | undefined;
|
|
2979
3285
|
shippingAddress?: {
|
|
2980
3286
|
id: string;
|
|
2981
3287
|
addressLineOne: string;
|
|
@@ -3075,6 +3381,14 @@ export declare const orderRoute: {
|
|
|
3075
3381
|
readyForDispatchAt?: Date | null | undefined;
|
|
3076
3382
|
completedAt?: Date | null | undefined;
|
|
3077
3383
|
cancelledAt?: Date | null | undefined;
|
|
3384
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
3385
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
3386
|
+
inventoryConflictItems?: {
|
|
3387
|
+
productId: string;
|
|
3388
|
+
title: string;
|
|
3389
|
+
requestedQuantity: number;
|
|
3390
|
+
availableQuantity: number;
|
|
3391
|
+
}[] | null | undefined;
|
|
3078
3392
|
shippingAddress?: {
|
|
3079
3393
|
id: string;
|
|
3080
3394
|
addressLineOne: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as r}from"@hono/zod-openapi";import{createApiRoute as t}from"../../core/hono/hono";import{CreateOrderSchema as
|
|
1
|
+
import{z as r}from"@hono/zod-openapi";import{createApiRoute as t}from"../../core/hono/hono";import{CartConflictSchema as p}from"../cart/cart.schema";import{CreateOrderSchema as m,ErrorSchema as e,HeaderSchema as a,OrderSchema as o,OrderStatusSchema as h,OrganizationParams as s,OrganizationWithIdParams as d,PaginationMetaSchema as n,PaginationQuerySchema as i}from"../../schemas";const c=t({description:"Fetches paginated list of orders",headers:a,method:"GET",operationId:"getOrders",path:"/:organizationId/orders",pathParams:s,query:i,responses:{200:r.object({list:r.array(o),meta:n}),400:e,401:e},summary:"Get Orders",tags:["Order"]}),g=t({description:"Fetches paginated list of orders for the authenticated user",headers:a,method:"GET",operationId:"getMyOrders",path:"/:organizationId/orders/me",pathParams:s,query:i,responses:{200:r.object({list:r.array(o),meta:n}),400:e,401:e},summary:"Get My Orders",tags:["Order"]}),O=t({body:m,description:"Creates a new order",headers:a,method:"POST",operationId:"createOrder",path:"/:organizationId/orders",pathParams:r.object({organizationId:r.string().cuid().min(1).openapi({description:"The organization ID",example:"ckel0e8qw00004n5p5w6fznym",param:{in:"path",name:"organizationId"}})}),responses:{201:r.object({order:o,redirectUrl:r.string().url().optional()}),409:p,400:e,401:e,404:e},summary:"Create Order",tags:["Order"]}),u=t({headers:a,method:"GET",operationId:"getOrder",path:"/:organizationId/orders/:id",pathParams:d,responses:{200:o,401:e,404:e},summary:"Get Order",tags:["Order"]}),l=t({description:"Changes the status of an existing order based on the operation",headers:a,method:"POST",operationId:"updateOrderStatus",path:"/:organizationId/orders/:id/status/:operation",pathParams:d.extend({operation:h}),responses:{200:o,400:e,401:e,404:e},summary:"Change Order Status",tags:["Order"]}),y=t({description:"Soft deletes order",headers:a,method:"DELETE",operationId:"deleteOrder",path:"/:organizationId/orders/:id",pathParams:d,responses:{204:null,400:e,401:e,404:e},summary:"Delete Order",tags:["Order"]});export const orderRoute={getOrders:c,getMyOrders:g,createOrder:O,getOrder:u,updateStatus:l,deleteOrder:y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.route.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/order/order.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,WA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1C,SAAS,EAAE,iBAAiB;KAC7B,CAAC;IACF,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;KACjB;IACD,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,cAAc,CAAC;IACtC,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,6BAA6B;IACnC,UAAU,EAAE,wBAAwB;IACpC,SAAS,EAAE;QACT,GAAG,EAAE,IAAI;QACT,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;KACjB;IACD,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,SAAS,EAAE,cAAc;IACzB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,gBAAgB;IAC7B,QAAQ,EAAE,aAAa;IACvB,YAAY,EAAE,iBAAiB;IAC/B,WAAW,EAAE,gBAAgB;CAC9B,CAAC"}
|
|
1
|
+
{"version":3,"file":"order.route.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/order/order.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,eAAe,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AAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;KACjB;IACD,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,cAAc,CAAC;IACtC,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,6BAA6B;IACnC,UAAU,EAAE,wBAAwB;IACpC,SAAS,EAAE;QACT,GAAG,EAAE,IAAI;QACT,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;KACjB;IACD,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,SAAS,EAAE,cAAc;IACzB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,gBAAgB;IAC7B,QAAQ,EAAE,aAAa;IACvB,YAAY,EAAE,iBAAiB;IAC/B,WAAW,EAAE,gBAAgB;CAC9B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
+
import { CartConflictSchema } from "../cart/cart.schema";
|
|
2
3
|
export declare const OrderStatusSchema: z.ZodEnum<{
|
|
3
4
|
pending: "pending";
|
|
4
5
|
draft: "draft";
|
|
@@ -151,6 +152,12 @@ export declare const OrderItemSchema: z.ZodObject<{
|
|
|
151
152
|
quantity: z.ZodNumber;
|
|
152
153
|
productSnapshotId: z.ZodString;
|
|
153
154
|
}, z.core.$strip>;
|
|
155
|
+
export declare const InventoryConflictItemSchema: z.ZodObject<{
|
|
156
|
+
productId: z.ZodString;
|
|
157
|
+
title: z.ZodString;
|
|
158
|
+
requestedQuantity: z.ZodNumber;
|
|
159
|
+
availableQuantity: z.ZodNumber;
|
|
160
|
+
}, z.core.$strip>;
|
|
154
161
|
export declare const OrderSchema: z.ZodPipe<z.ZodObject<{
|
|
155
162
|
id: z.ZodString;
|
|
156
163
|
referenceId: z.ZodString;
|
|
@@ -345,6 +352,14 @@ export declare const OrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
345
352
|
createdAt: z.ZodDate;
|
|
346
353
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
347
354
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
355
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
356
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
357
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
358
|
+
productId: z.ZodString;
|
|
359
|
+
title: z.ZodString;
|
|
360
|
+
requestedQuantity: z.ZodNumber;
|
|
361
|
+
availableQuantity: z.ZodNumber;
|
|
362
|
+
}, z.core.$strip>>>>;
|
|
348
363
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
349
364
|
id: z.ZodString;
|
|
350
365
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -544,6 +559,14 @@ export declare const OrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
544
559
|
readyForDispatchAt?: Date | null | undefined;
|
|
545
560
|
completedAt?: Date | null | undefined;
|
|
546
561
|
cancelledAt?: Date | null | undefined;
|
|
562
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
563
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
564
|
+
inventoryConflictItems?: {
|
|
565
|
+
productId: string;
|
|
566
|
+
title: string;
|
|
567
|
+
requestedQuantity: number;
|
|
568
|
+
availableQuantity: number;
|
|
569
|
+
}[] | null | undefined;
|
|
547
570
|
shippingAddress?: {
|
|
548
571
|
id: string;
|
|
549
572
|
addressLineOne: string;
|
|
@@ -643,6 +666,14 @@ export declare const OrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
643
666
|
readyForDispatchAt?: Date | null | undefined;
|
|
644
667
|
completedAt?: Date | null | undefined;
|
|
645
668
|
cancelledAt?: Date | null | undefined;
|
|
669
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
670
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
671
|
+
inventoryConflictItems?: {
|
|
672
|
+
productId: string;
|
|
673
|
+
title: string;
|
|
674
|
+
requestedQuantity: number;
|
|
675
|
+
availableQuantity: number;
|
|
676
|
+
}[] | null | undefined;
|
|
646
677
|
shippingAddress?: {
|
|
647
678
|
id: string;
|
|
648
679
|
addressLineOne: string;
|
|
@@ -695,3 +726,5 @@ export type OrderItem = z.infer<typeof OrderItemSchema>;
|
|
|
695
726
|
export type Order = z.infer<typeof OrderSchema>;
|
|
696
727
|
export type CreateOrder = z.infer<typeof CreateOrderSchema>;
|
|
697
728
|
export type OrderStatus = z.infer<typeof OrderStatusSchema>;
|
|
729
|
+
export type InventoryConflictItem = z.infer<typeof InventoryConflictItemSchema>;
|
|
730
|
+
export type OrderConflict = z.infer<typeof CartConflictSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"@hono/zod-openapi";import{AddressSchema as a}from"../../schemas/address.schema";import{currency as o}from"../../schemas/currency.schema";import{locale as
|
|
1
|
+
import{z as e}from"@hono/zod-openapi";import{AddressSchema as a}from"../../schemas/address.schema";import{currency as o}from"../../schemas/currency.schema";import{locale as n}from"../../schemas/locales.schema";import{CartItemSchema as p,CartSchema as d}from"../cart/cart.schema";import{FileSchema as l}from"../file/file.schema";import{PaymentMethodSchema as c,PaymentProviderSchema as s,PaymentSchema as m}from"../payment/payment.schema";import{ShippingMethodSchema as h}from"../shipping-method/shipping-method.schema";import{fulfilmentMethod as r}from"./fulfilment.schema";export const OrderStatusSchema=e.enum(["draft","pending","accepted","ready-for-dispatch","dispatched","completed","cancelled"]).openapi({description:"Status of the order",example:"accepted"}),OrderItemSchema=e.object({translations:e.array(e.object({locale:n.openapi({description:"Locale of the translation",example:"en-US"}),title:e.string().openapi({description:"Title of the ordered product",example:"Premium Watch"}),subtitle:e.string().openapi({description:"Additional details about the ordered item, including modifiers",example:"Color: Silver, Size: Large"})})).openapi({description:"Translations for the order item"}),rawData:p,unitPrice:e.number().min(0).openapi({description:"Price per unit of the item",example:299.99}),image:l.nullable().optional(),totalPrice:e.number().min(0).openapi({description:"Total price for this item (unitPrice \xD7 quantity)",example:599.98}),quantity:e.number().min(1).openapi({description:"Number of units ordered",example:2}),productSnapshotId:e.string().cuid()}).openapi("OrderItem"),InventoryConflictItemSchema=e.object({productId:e.string().cuid(),title:e.string(),requestedQuantity:e.number().int().min(1),availableQuantity:e.number().int().min(0)}).openapi("InventoryConflictItem"),OrderSchema=e.object({id:e.string().openapi({description:"Unique identifier for the order",example:"clj1234567890abcdef"}),referenceId:e.string().openapi({description:"External reference ID for the order",example:"ORD-12345"}),status:OrderStatusSchema.optional(),token:e.string().openapi({description:"Security token for order verification",example:"a1b2c3d4e5f6g7h8i9j0"}),expiresAt:e.date().openapi({description:"Expiration date for the order",example:"2023-12-31T23:59:59Z"}),items:e.array(OrderItemSchema).min(1).openapi({description:"Array of items in the order"}),shippingMethod:h.nullable().openapi({description:"Shipping method selected for the order"}),acceptedAt:e.date().nullable().optional().openapi({description:"Date when the order was accepted",example:"2023-06-15T14:30:00Z"}),dispatchedAt:e.date().nullable().optional().openapi({description:"Date when the order was dispatched",example:"2023-06-16T09:15:00Z"}),readyForDispatchAt:e.date().nullable().optional().openapi({description:"Date when the order was ready for dispatch",example:"2023-06-16T09:15:00Z"}),createdAt:e.date().openapi({description:"Date when the order was created",example:"2023-06-15T14:30:00Z"}),completedAt:e.date().nullable().optional().openapi({description:"Date when the order was completed",example:"2023-06-18T11:45:00Z"}),cancelledAt:e.date().nullable().optional().openapi({description:"Date when the order was cancelled",example:"2023-06-14T16:20:00Z"}),inventoryDeductedAt:e.date().nullable().optional().openapi({description:"Date when the paid order inventory was deducted",example:"2023-06-15T14:30:00Z"}),inventoryConflictAt:e.date().nullable().optional().openapi({description:"Date when the paid order was flagged for manual inventory review",example:"2023-06-15T14:30:00Z"}),inventoryConflictItems:e.array(InventoryConflictItemSchema).nullable().optional().openapi({description:"List of line items that could not be deducted after payment"}),shippingAddress:a.nullable().optional(),fulfilmentMethod:r.openapi({description:"Method of order fulfilment (pickup or delivery)",example:"delivery"}),currency:o.openapi({description:"Currency used for the order",example:"USD"}),payment:m}).transform(t=>{let i;return t.cancelledAt?i="cancelled":t.completedAt?i="completed":t.dispatchedAt?i="dispatched":t.readyForDispatchAt?i="ready-for-dispatch":t.acceptedAt?i="accepted":i="pending",Object.assign(Object.assign({},t),{status:i})}).openapi("Order"),CreateOrderSchema=d.extend({fulfilmentMethod:r.default("delivery"),payment:e.object({provider:s,method:c}),checkoutBaseUrl:e.string().url()}).refine(t=>t.fulfilmentMethod!=="delivery"||t.shippingMethodId!==void 0,{message:"shippingMethodId is required when fulfilmentMethod is 'delivery'",path:["shippingMethodId"]}).openapi("CreateOrder");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.schema.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/order/order.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"order.schema.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/order/order.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,aAAa,EA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