@firfi/voila-sdk 0.1.1 → 0.1.2
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/README.md +2 -1
- package/dist/src/domain/schemas/index.d.ts +1 -0
- package/dist/src/domain/schemas/index.d.ts.map +1 -1
- package/dist/src/domain/schemas/index.js +1 -0
- package/dist/src/domain/schemas/index.js.map +1 -1
- package/dist/src/domain/schemas/order-history.d.ts +561 -0
- package/dist/src/domain/schemas/order-history.d.ts.map +1 -0
- package/dist/src/domain/schemas/order-history.js +108 -0
- package/dist/src/domain/schemas/order-history.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/voila/browser-login-adapter.d.ts +12 -12
- package/dist/src/voila/order-history.d.ts +14 -0
- package/dist/src/voila/order-history.d.ts.map +1 -0
- package/dist/src/voila/order-history.js +84 -0
- package/dist/src/voila/order-history.js.map +1 -0
- package/dist/src/voila/order-urls.d.ts +13 -0
- package/dist/src/voila/order-urls.d.ts.map +1 -0
- package/dist/src/voila/order-urls.js +79 -0
- package/dist/src/voila/order-urls.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,6 +78,7 @@ console.log(search.right.value.products.map((product) => product.name))
|
|
|
78
78
|
- Delivery destination/context reads and guarded delivery context changes.
|
|
79
79
|
- Slot listing and guarded slot reservation input helpers.
|
|
80
80
|
- Checkout summary/readiness review.
|
|
81
|
+
- Completed order history reads with cursor pagination.
|
|
81
82
|
- Session snapshot save/load helpers.
|
|
82
83
|
|
|
83
84
|
The SDK does not place orders. Checkout APIs stop at review/readiness so a human can confirm in Voila.
|
|
@@ -103,7 +104,7 @@ That file is sensitive and ignored by git. Use it with `loadSdkSessionSnapshot`
|
|
|
103
104
|
Import only from the package entrypoint:
|
|
104
105
|
|
|
105
106
|
```ts
|
|
106
|
-
import { addCartItems, getCart, searchProducts } from "@firfi/voila-sdk"
|
|
107
|
+
import { addCartItems, getCart, getCompletedOrders, searchProducts } from "@firfi/voila-sdk"
|
|
107
108
|
```
|
|
108
109
|
|
|
109
110
|
Deep imports are unsupported. See [docs/public-api.md](docs/public-api.md) for the full public surface and [docs/usage-examples.md](docs/usage-examples.md) for end-to-end examples.
|
|
@@ -5,6 +5,7 @@ export * from "./category.js";
|
|
|
5
5
|
export * from "./checkout-summary.js";
|
|
6
6
|
export * from "./delivery-destination.js";
|
|
7
7
|
export * from "./money.js";
|
|
8
|
+
export * from "./order-history.js";
|
|
8
9
|
export * from "./product.js";
|
|
9
10
|
export * from "./proposition.js";
|
|
10
11
|
export * from "./search.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA"}
|
|
@@ -5,6 +5,7 @@ export * from "./category.js";
|
|
|
5
5
|
export * from "./checkout-summary.js";
|
|
6
6
|
export * from "./delivery-destination.js";
|
|
7
7
|
export * from "./money.js";
|
|
8
|
+
export * from "./order-history.js";
|
|
8
9
|
export * from "./product.js";
|
|
9
10
|
export * from "./proposition.js";
|
|
10
11
|
export * from "./search.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const MIN_ORDER_PAGE_SIZE = 1;
|
|
3
|
+
export declare const MAX_ORDER_PAGE_SIZE = 50;
|
|
4
|
+
export declare const DEFAULT_ORDER_PAGE_SIZE = 20;
|
|
5
|
+
export declare const CompletedOrdersInputSchema: Schema.Struct<{
|
|
6
|
+
pageSize: Schema.optionalWith<Schema.filter<Schema.filter<Schema.filter<Schema.filter<typeof Schema.Number>>>>, {
|
|
7
|
+
default: () => number;
|
|
8
|
+
}>;
|
|
9
|
+
pageToken: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.String>>, {
|
|
10
|
+
exact: true;
|
|
11
|
+
}>;
|
|
12
|
+
}>;
|
|
13
|
+
export type CompletedOrdersInput = Schema.Schema.Type<typeof CompletedOrdersInputSchema>;
|
|
14
|
+
export declare const RawInternalCompletedOrderSlotSchema: Schema.Schema<{
|
|
15
|
+
readonly __typename: "InternalOrderSlot";
|
|
16
|
+
readonly carrier?: ({
|
|
17
|
+
readonly carrierId: string;
|
|
18
|
+
} & {
|
|
19
|
+
readonly [x: string]: unknown;
|
|
20
|
+
}) | null;
|
|
21
|
+
readonly deliveryDestination: {
|
|
22
|
+
readonly address: {
|
|
23
|
+
readonly timeZone: string;
|
|
24
|
+
} & {
|
|
25
|
+
readonly [x: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
readonly deliveryMethod: string;
|
|
28
|
+
readonly name: string;
|
|
29
|
+
} & {
|
|
30
|
+
readonly [x: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
readonly end: string;
|
|
33
|
+
readonly externalLocker?: ({
|
|
34
|
+
readonly externalLockerId: string;
|
|
35
|
+
} & {
|
|
36
|
+
readonly [x: string]: unknown;
|
|
37
|
+
}) | null;
|
|
38
|
+
readonly shippingGroupType?: string;
|
|
39
|
+
readonly start: string;
|
|
40
|
+
readonly type: string;
|
|
41
|
+
} & {
|
|
42
|
+
readonly [x: string]: unknown;
|
|
43
|
+
}, {
|
|
44
|
+
readonly __typename: "InternalOrderSlot";
|
|
45
|
+
readonly deliveryDestination: {
|
|
46
|
+
readonly address: {
|
|
47
|
+
readonly timeZone: string;
|
|
48
|
+
} & {
|
|
49
|
+
readonly [x: string]: unknown;
|
|
50
|
+
};
|
|
51
|
+
readonly deliveryMethod: string;
|
|
52
|
+
readonly name: string;
|
|
53
|
+
} & {
|
|
54
|
+
readonly [x: string]: unknown;
|
|
55
|
+
};
|
|
56
|
+
readonly end: string;
|
|
57
|
+
readonly start: string;
|
|
58
|
+
readonly type: string;
|
|
59
|
+
readonly carrier?: ({
|
|
60
|
+
readonly carrierId: string;
|
|
61
|
+
} & {
|
|
62
|
+
readonly [x: string]: unknown;
|
|
63
|
+
}) | null;
|
|
64
|
+
readonly externalLocker?: ({
|
|
65
|
+
readonly externalLockerId: string;
|
|
66
|
+
} & {
|
|
67
|
+
readonly [x: string]: unknown;
|
|
68
|
+
}) | null;
|
|
69
|
+
readonly shippingGroupType?: string;
|
|
70
|
+
} & {
|
|
71
|
+
readonly [x: string]: unknown;
|
|
72
|
+
}, never>;
|
|
73
|
+
export type RawInternalCompletedOrderSlot = Schema.Schema.Type<typeof RawInternalCompletedOrderSlotSchema>;
|
|
74
|
+
export declare const RawImportedCompletedOrderSlotSchema: Schema.Schema<{
|
|
75
|
+
readonly __typename: "ImportedOrderSlot";
|
|
76
|
+
readonly timeZone: string;
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly end: string;
|
|
79
|
+
readonly start: string;
|
|
80
|
+
} & {
|
|
81
|
+
readonly [x: string]: unknown;
|
|
82
|
+
}, {
|
|
83
|
+
readonly __typename: "ImportedOrderSlot";
|
|
84
|
+
readonly timeZone: string;
|
|
85
|
+
readonly name: string;
|
|
86
|
+
readonly end: string;
|
|
87
|
+
readonly start: string;
|
|
88
|
+
} & {
|
|
89
|
+
readonly [x: string]: unknown;
|
|
90
|
+
}, never>;
|
|
91
|
+
export type RawImportedCompletedOrderSlot = Schema.Schema.Type<typeof RawImportedCompletedOrderSlotSchema>;
|
|
92
|
+
export declare const RawCompletedOrderSlotSchema: Schema.Union<[Schema.Schema<{
|
|
93
|
+
readonly __typename: "InternalOrderSlot";
|
|
94
|
+
readonly carrier?: ({
|
|
95
|
+
readonly carrierId: string;
|
|
96
|
+
} & {
|
|
97
|
+
readonly [x: string]: unknown;
|
|
98
|
+
}) | null;
|
|
99
|
+
readonly deliveryDestination: {
|
|
100
|
+
readonly address: {
|
|
101
|
+
readonly timeZone: string;
|
|
102
|
+
} & {
|
|
103
|
+
readonly [x: string]: unknown;
|
|
104
|
+
};
|
|
105
|
+
readonly deliveryMethod: string;
|
|
106
|
+
readonly name: string;
|
|
107
|
+
} & {
|
|
108
|
+
readonly [x: string]: unknown;
|
|
109
|
+
};
|
|
110
|
+
readonly end: string;
|
|
111
|
+
readonly externalLocker?: ({
|
|
112
|
+
readonly externalLockerId: string;
|
|
113
|
+
} & {
|
|
114
|
+
readonly [x: string]: unknown;
|
|
115
|
+
}) | null;
|
|
116
|
+
readonly shippingGroupType?: string;
|
|
117
|
+
readonly start: string;
|
|
118
|
+
readonly type: string;
|
|
119
|
+
} & {
|
|
120
|
+
readonly [x: string]: unknown;
|
|
121
|
+
}, {
|
|
122
|
+
readonly __typename: "InternalOrderSlot";
|
|
123
|
+
readonly deliveryDestination: {
|
|
124
|
+
readonly address: {
|
|
125
|
+
readonly timeZone: string;
|
|
126
|
+
} & {
|
|
127
|
+
readonly [x: string]: unknown;
|
|
128
|
+
};
|
|
129
|
+
readonly deliveryMethod: string;
|
|
130
|
+
readonly name: string;
|
|
131
|
+
} & {
|
|
132
|
+
readonly [x: string]: unknown;
|
|
133
|
+
};
|
|
134
|
+
readonly end: string;
|
|
135
|
+
readonly start: string;
|
|
136
|
+
readonly type: string;
|
|
137
|
+
readonly carrier?: ({
|
|
138
|
+
readonly carrierId: string;
|
|
139
|
+
} & {
|
|
140
|
+
readonly [x: string]: unknown;
|
|
141
|
+
}) | null;
|
|
142
|
+
readonly externalLocker?: ({
|
|
143
|
+
readonly externalLockerId: string;
|
|
144
|
+
} & {
|
|
145
|
+
readonly [x: string]: unknown;
|
|
146
|
+
}) | null;
|
|
147
|
+
readonly shippingGroupType?: string;
|
|
148
|
+
} & {
|
|
149
|
+
readonly [x: string]: unknown;
|
|
150
|
+
}, never>, Schema.Schema<{
|
|
151
|
+
readonly __typename: "ImportedOrderSlot";
|
|
152
|
+
readonly timeZone: string;
|
|
153
|
+
readonly name: string;
|
|
154
|
+
readonly end: string;
|
|
155
|
+
readonly start: string;
|
|
156
|
+
} & {
|
|
157
|
+
readonly [x: string]: unknown;
|
|
158
|
+
}, {
|
|
159
|
+
readonly __typename: "ImportedOrderSlot";
|
|
160
|
+
readonly timeZone: string;
|
|
161
|
+
readonly name: string;
|
|
162
|
+
readonly end: string;
|
|
163
|
+
readonly start: string;
|
|
164
|
+
} & {
|
|
165
|
+
readonly [x: string]: unknown;
|
|
166
|
+
}, never>]>;
|
|
167
|
+
export type RawCompletedOrderSlot = Schema.Schema.Type<typeof RawCompletedOrderSlotSchema>;
|
|
168
|
+
export declare const RawCompletedOrderNodeSchema: Schema.Schema<{
|
|
169
|
+
readonly orderId: string;
|
|
170
|
+
readonly prices: {
|
|
171
|
+
readonly total: {
|
|
172
|
+
readonly amount: string;
|
|
173
|
+
readonly currency: string;
|
|
174
|
+
};
|
|
175
|
+
} & {
|
|
176
|
+
readonly [x: string]: unknown;
|
|
177
|
+
};
|
|
178
|
+
readonly recurringOrderDefinition?: ({
|
|
179
|
+
readonly name: string;
|
|
180
|
+
} & {
|
|
181
|
+
readonly [x: string]: unknown;
|
|
182
|
+
}) | null;
|
|
183
|
+
readonly region: {
|
|
184
|
+
readonly regionId: string;
|
|
185
|
+
readonly retailerRegionId: string;
|
|
186
|
+
} & {
|
|
187
|
+
readonly [x: string]: unknown;
|
|
188
|
+
};
|
|
189
|
+
readonly slot: ({
|
|
190
|
+
readonly __typename: "InternalOrderSlot";
|
|
191
|
+
readonly carrier?: ({
|
|
192
|
+
readonly carrierId: string;
|
|
193
|
+
} & {
|
|
194
|
+
readonly [x: string]: unknown;
|
|
195
|
+
}) | null;
|
|
196
|
+
readonly deliveryDestination: {
|
|
197
|
+
readonly address: {
|
|
198
|
+
readonly timeZone: string;
|
|
199
|
+
} & {
|
|
200
|
+
readonly [x: string]: unknown;
|
|
201
|
+
};
|
|
202
|
+
readonly deliveryMethod: string;
|
|
203
|
+
readonly name: string;
|
|
204
|
+
} & {
|
|
205
|
+
readonly [x: string]: unknown;
|
|
206
|
+
};
|
|
207
|
+
readonly end: string;
|
|
208
|
+
readonly externalLocker?: ({
|
|
209
|
+
readonly externalLockerId: string;
|
|
210
|
+
} & {
|
|
211
|
+
readonly [x: string]: unknown;
|
|
212
|
+
}) | null;
|
|
213
|
+
readonly shippingGroupType?: string;
|
|
214
|
+
readonly start: string;
|
|
215
|
+
readonly type: string;
|
|
216
|
+
} & {
|
|
217
|
+
readonly [x: string]: unknown;
|
|
218
|
+
}) | ({
|
|
219
|
+
readonly __typename: "ImportedOrderSlot";
|
|
220
|
+
readonly timeZone: string;
|
|
221
|
+
readonly name: string;
|
|
222
|
+
readonly end: string;
|
|
223
|
+
readonly start: string;
|
|
224
|
+
} & {
|
|
225
|
+
readonly [x: string]: unknown;
|
|
226
|
+
});
|
|
227
|
+
readonly status: string;
|
|
228
|
+
} & {
|
|
229
|
+
readonly [x: string]: unknown;
|
|
230
|
+
}, {
|
|
231
|
+
readonly orderId: string;
|
|
232
|
+
readonly prices: {
|
|
233
|
+
readonly total: {
|
|
234
|
+
readonly amount: string;
|
|
235
|
+
readonly currency: string;
|
|
236
|
+
};
|
|
237
|
+
} & {
|
|
238
|
+
readonly [x: string]: unknown;
|
|
239
|
+
};
|
|
240
|
+
readonly region: {
|
|
241
|
+
readonly regionId: string;
|
|
242
|
+
readonly retailerRegionId: string;
|
|
243
|
+
} & {
|
|
244
|
+
readonly [x: string]: unknown;
|
|
245
|
+
};
|
|
246
|
+
readonly slot: ({
|
|
247
|
+
readonly __typename: "InternalOrderSlot";
|
|
248
|
+
readonly deliveryDestination: {
|
|
249
|
+
readonly address: {
|
|
250
|
+
readonly timeZone: string;
|
|
251
|
+
} & {
|
|
252
|
+
readonly [x: string]: unknown;
|
|
253
|
+
};
|
|
254
|
+
readonly deliveryMethod: string;
|
|
255
|
+
readonly name: string;
|
|
256
|
+
} & {
|
|
257
|
+
readonly [x: string]: unknown;
|
|
258
|
+
};
|
|
259
|
+
readonly end: string;
|
|
260
|
+
readonly start: string;
|
|
261
|
+
readonly type: string;
|
|
262
|
+
readonly carrier?: ({
|
|
263
|
+
readonly carrierId: string;
|
|
264
|
+
} & {
|
|
265
|
+
readonly [x: string]: unknown;
|
|
266
|
+
}) | null;
|
|
267
|
+
readonly externalLocker?: ({
|
|
268
|
+
readonly externalLockerId: string;
|
|
269
|
+
} & {
|
|
270
|
+
readonly [x: string]: unknown;
|
|
271
|
+
}) | null;
|
|
272
|
+
readonly shippingGroupType?: string;
|
|
273
|
+
} & {
|
|
274
|
+
readonly [x: string]: unknown;
|
|
275
|
+
}) | ({
|
|
276
|
+
readonly __typename: "ImportedOrderSlot";
|
|
277
|
+
readonly timeZone: string;
|
|
278
|
+
readonly name: string;
|
|
279
|
+
readonly end: string;
|
|
280
|
+
readonly start: string;
|
|
281
|
+
} & {
|
|
282
|
+
readonly [x: string]: unknown;
|
|
283
|
+
});
|
|
284
|
+
readonly status: string;
|
|
285
|
+
readonly recurringOrderDefinition?: ({
|
|
286
|
+
readonly name: string;
|
|
287
|
+
} & {
|
|
288
|
+
readonly [x: string]: unknown;
|
|
289
|
+
}) | null;
|
|
290
|
+
} & {
|
|
291
|
+
readonly [x: string]: unknown;
|
|
292
|
+
}, never>;
|
|
293
|
+
export type RawCompletedOrderNode = Schema.Schema.Type<typeof RawCompletedOrderNodeSchema>;
|
|
294
|
+
export declare const RawCompletedOrdersGraphqlResponseSchema: Schema.Schema<{
|
|
295
|
+
readonly data: {
|
|
296
|
+
readonly completedOrders: {
|
|
297
|
+
readonly edges: readonly (({
|
|
298
|
+
readonly node: ({
|
|
299
|
+
readonly orderId: string;
|
|
300
|
+
readonly prices: {
|
|
301
|
+
readonly total: {
|
|
302
|
+
readonly amount: string;
|
|
303
|
+
readonly currency: string;
|
|
304
|
+
};
|
|
305
|
+
} & {
|
|
306
|
+
readonly [x: string]: unknown;
|
|
307
|
+
};
|
|
308
|
+
readonly recurringOrderDefinition?: ({
|
|
309
|
+
readonly name: string;
|
|
310
|
+
} & {
|
|
311
|
+
readonly [x: string]: unknown;
|
|
312
|
+
}) | null;
|
|
313
|
+
readonly region: {
|
|
314
|
+
readonly regionId: string;
|
|
315
|
+
readonly retailerRegionId: string;
|
|
316
|
+
} & {
|
|
317
|
+
readonly [x: string]: unknown;
|
|
318
|
+
};
|
|
319
|
+
readonly slot: ({
|
|
320
|
+
readonly __typename: "InternalOrderSlot";
|
|
321
|
+
readonly carrier?: ({
|
|
322
|
+
readonly carrierId: string;
|
|
323
|
+
} & {
|
|
324
|
+
readonly [x: string]: unknown;
|
|
325
|
+
}) | null;
|
|
326
|
+
readonly deliveryDestination: {
|
|
327
|
+
readonly address: {
|
|
328
|
+
readonly timeZone: string;
|
|
329
|
+
} & {
|
|
330
|
+
readonly [x: string]: unknown;
|
|
331
|
+
};
|
|
332
|
+
readonly deliveryMethod: string;
|
|
333
|
+
readonly name: string;
|
|
334
|
+
} & {
|
|
335
|
+
readonly [x: string]: unknown;
|
|
336
|
+
};
|
|
337
|
+
readonly end: string;
|
|
338
|
+
readonly externalLocker?: ({
|
|
339
|
+
readonly externalLockerId: string;
|
|
340
|
+
} & {
|
|
341
|
+
readonly [x: string]: unknown;
|
|
342
|
+
}) | null;
|
|
343
|
+
readonly shippingGroupType?: string;
|
|
344
|
+
readonly start: string;
|
|
345
|
+
readonly type: string;
|
|
346
|
+
} & {
|
|
347
|
+
readonly [x: string]: unknown;
|
|
348
|
+
}) | ({
|
|
349
|
+
readonly __typename: "ImportedOrderSlot";
|
|
350
|
+
readonly timeZone: string;
|
|
351
|
+
readonly name: string;
|
|
352
|
+
readonly end: string;
|
|
353
|
+
readonly start: string;
|
|
354
|
+
} & {
|
|
355
|
+
readonly [x: string]: unknown;
|
|
356
|
+
});
|
|
357
|
+
readonly status: string;
|
|
358
|
+
} & {
|
|
359
|
+
readonly [x: string]: unknown;
|
|
360
|
+
}) | null;
|
|
361
|
+
} & {
|
|
362
|
+
readonly [x: string]: unknown;
|
|
363
|
+
}) | null)[];
|
|
364
|
+
readonly pageInfo: {
|
|
365
|
+
readonly endCursor: string | null;
|
|
366
|
+
readonly hasNextPage: boolean;
|
|
367
|
+
} & {
|
|
368
|
+
readonly [x: string]: unknown;
|
|
369
|
+
};
|
|
370
|
+
readonly retentionPeriod?: string;
|
|
371
|
+
} & {
|
|
372
|
+
readonly [x: string]: unknown;
|
|
373
|
+
};
|
|
374
|
+
} & {
|
|
375
|
+
readonly [x: string]: unknown;
|
|
376
|
+
};
|
|
377
|
+
} & {
|
|
378
|
+
readonly [x: string]: unknown;
|
|
379
|
+
}, {
|
|
380
|
+
readonly data: {
|
|
381
|
+
readonly completedOrders: {
|
|
382
|
+
readonly edges: readonly (({
|
|
383
|
+
readonly node: ({
|
|
384
|
+
readonly orderId: string;
|
|
385
|
+
readonly prices: {
|
|
386
|
+
readonly total: {
|
|
387
|
+
readonly amount: string;
|
|
388
|
+
readonly currency: string;
|
|
389
|
+
};
|
|
390
|
+
} & {
|
|
391
|
+
readonly [x: string]: unknown;
|
|
392
|
+
};
|
|
393
|
+
readonly region: {
|
|
394
|
+
readonly regionId: string;
|
|
395
|
+
readonly retailerRegionId: string;
|
|
396
|
+
} & {
|
|
397
|
+
readonly [x: string]: unknown;
|
|
398
|
+
};
|
|
399
|
+
readonly slot: ({
|
|
400
|
+
readonly __typename: "InternalOrderSlot";
|
|
401
|
+
readonly deliveryDestination: {
|
|
402
|
+
readonly address: {
|
|
403
|
+
readonly timeZone: string;
|
|
404
|
+
} & {
|
|
405
|
+
readonly [x: string]: unknown;
|
|
406
|
+
};
|
|
407
|
+
readonly deliveryMethod: string;
|
|
408
|
+
readonly name: string;
|
|
409
|
+
} & {
|
|
410
|
+
readonly [x: string]: unknown;
|
|
411
|
+
};
|
|
412
|
+
readonly end: string;
|
|
413
|
+
readonly start: string;
|
|
414
|
+
readonly type: string;
|
|
415
|
+
readonly carrier?: ({
|
|
416
|
+
readonly carrierId: string;
|
|
417
|
+
} & {
|
|
418
|
+
readonly [x: string]: unknown;
|
|
419
|
+
}) | null;
|
|
420
|
+
readonly externalLocker?: ({
|
|
421
|
+
readonly externalLockerId: string;
|
|
422
|
+
} & {
|
|
423
|
+
readonly [x: string]: unknown;
|
|
424
|
+
}) | null;
|
|
425
|
+
readonly shippingGroupType?: string;
|
|
426
|
+
} & {
|
|
427
|
+
readonly [x: string]: unknown;
|
|
428
|
+
}) | ({
|
|
429
|
+
readonly __typename: "ImportedOrderSlot";
|
|
430
|
+
readonly timeZone: string;
|
|
431
|
+
readonly name: string;
|
|
432
|
+
readonly end: string;
|
|
433
|
+
readonly start: string;
|
|
434
|
+
} & {
|
|
435
|
+
readonly [x: string]: unknown;
|
|
436
|
+
});
|
|
437
|
+
readonly status: string;
|
|
438
|
+
readonly recurringOrderDefinition?: ({
|
|
439
|
+
readonly name: string;
|
|
440
|
+
} & {
|
|
441
|
+
readonly [x: string]: unknown;
|
|
442
|
+
}) | null;
|
|
443
|
+
} & {
|
|
444
|
+
readonly [x: string]: unknown;
|
|
445
|
+
}) | null;
|
|
446
|
+
} & {
|
|
447
|
+
readonly [x: string]: unknown;
|
|
448
|
+
}) | null)[];
|
|
449
|
+
readonly pageInfo: {
|
|
450
|
+
readonly endCursor: string | null;
|
|
451
|
+
readonly hasNextPage: boolean;
|
|
452
|
+
} & {
|
|
453
|
+
readonly [x: string]: unknown;
|
|
454
|
+
};
|
|
455
|
+
readonly retentionPeriod?: string;
|
|
456
|
+
} & {
|
|
457
|
+
readonly [x: string]: unknown;
|
|
458
|
+
};
|
|
459
|
+
} & {
|
|
460
|
+
readonly [x: string]: unknown;
|
|
461
|
+
};
|
|
462
|
+
} & {
|
|
463
|
+
readonly [x: string]: unknown;
|
|
464
|
+
}, never>;
|
|
465
|
+
export type RawCompletedOrdersGraphqlResponse = Schema.Schema.Type<typeof RawCompletedOrdersGraphqlResponseSchema>;
|
|
466
|
+
export declare const CompletedOrdersPaginationSchema: Schema.Struct<{
|
|
467
|
+
hasNextPage: typeof Schema.Boolean;
|
|
468
|
+
nextPageToken: Schema.optionalWith<typeof Schema.String, {
|
|
469
|
+
exact: true;
|
|
470
|
+
}>;
|
|
471
|
+
retentionPeriod: Schema.optionalWith<typeof Schema.String, {
|
|
472
|
+
exact: true;
|
|
473
|
+
}>;
|
|
474
|
+
}>;
|
|
475
|
+
export type CompletedOrdersPagination = Schema.Schema.Type<typeof CompletedOrdersPaginationSchema>;
|
|
476
|
+
export declare const NormalizedCompletedOrderSchema: Schema.Struct<{
|
|
477
|
+
addressNickName: typeof Schema.String;
|
|
478
|
+
carrierId: Schema.optionalWith<typeof Schema.String, {
|
|
479
|
+
exact: true;
|
|
480
|
+
}>;
|
|
481
|
+
dates: Schema.Struct<{
|
|
482
|
+
deliveryEndDate: typeof Schema.String;
|
|
483
|
+
deliveryStartDate: typeof Schema.String;
|
|
484
|
+
timeZoneId: typeof Schema.String;
|
|
485
|
+
}>;
|
|
486
|
+
deliveryMethod: typeof Schema.String;
|
|
487
|
+
externalAddress: Schema.optionalWith<Schema.Struct<{
|
|
488
|
+
externalCollectionPointId: typeof Schema.String;
|
|
489
|
+
}>, {
|
|
490
|
+
exact: true;
|
|
491
|
+
}>;
|
|
492
|
+
orderId: typeof Schema.String;
|
|
493
|
+
orderTotals: Schema.Struct<{
|
|
494
|
+
totalPrice: Schema.Struct<{
|
|
495
|
+
amount: typeof Schema.String;
|
|
496
|
+
currency: typeof Schema.String;
|
|
497
|
+
}>;
|
|
498
|
+
}>;
|
|
499
|
+
recurringShoppingDefinition: Schema.optionalWith<Schema.Struct<{
|
|
500
|
+
name: typeof Schema.String;
|
|
501
|
+
}>, {
|
|
502
|
+
exact: true;
|
|
503
|
+
}>;
|
|
504
|
+
regionId: typeof Schema.String;
|
|
505
|
+
retailerRegionId: typeof Schema.String;
|
|
506
|
+
shippingGroupType: Schema.optionalWith<typeof Schema.String, {
|
|
507
|
+
exact: true;
|
|
508
|
+
}>;
|
|
509
|
+
slotType: typeof Schema.String;
|
|
510
|
+
status: typeof Schema.String;
|
|
511
|
+
}>;
|
|
512
|
+
export type NormalizedCompletedOrder = Schema.Schema.Type<typeof NormalizedCompletedOrderSchema>;
|
|
513
|
+
export declare const NormalizedCompletedOrdersResultSchema: Schema.Struct<{
|
|
514
|
+
orders: Schema.Array$<Schema.Struct<{
|
|
515
|
+
addressNickName: typeof Schema.String;
|
|
516
|
+
carrierId: Schema.optionalWith<typeof Schema.String, {
|
|
517
|
+
exact: true;
|
|
518
|
+
}>;
|
|
519
|
+
dates: Schema.Struct<{
|
|
520
|
+
deliveryEndDate: typeof Schema.String;
|
|
521
|
+
deliveryStartDate: typeof Schema.String;
|
|
522
|
+
timeZoneId: typeof Schema.String;
|
|
523
|
+
}>;
|
|
524
|
+
deliveryMethod: typeof Schema.String;
|
|
525
|
+
externalAddress: Schema.optionalWith<Schema.Struct<{
|
|
526
|
+
externalCollectionPointId: typeof Schema.String;
|
|
527
|
+
}>, {
|
|
528
|
+
exact: true;
|
|
529
|
+
}>;
|
|
530
|
+
orderId: typeof Schema.String;
|
|
531
|
+
orderTotals: Schema.Struct<{
|
|
532
|
+
totalPrice: Schema.Struct<{
|
|
533
|
+
amount: typeof Schema.String;
|
|
534
|
+
currency: typeof Schema.String;
|
|
535
|
+
}>;
|
|
536
|
+
}>;
|
|
537
|
+
recurringShoppingDefinition: Schema.optionalWith<Schema.Struct<{
|
|
538
|
+
name: typeof Schema.String;
|
|
539
|
+
}>, {
|
|
540
|
+
exact: true;
|
|
541
|
+
}>;
|
|
542
|
+
regionId: typeof Schema.String;
|
|
543
|
+
retailerRegionId: typeof Schema.String;
|
|
544
|
+
shippingGroupType: Schema.optionalWith<typeof Schema.String, {
|
|
545
|
+
exact: true;
|
|
546
|
+
}>;
|
|
547
|
+
slotType: typeof Schema.String;
|
|
548
|
+
status: typeof Schema.String;
|
|
549
|
+
}>>;
|
|
550
|
+
pagination: Schema.Struct<{
|
|
551
|
+
hasNextPage: typeof Schema.Boolean;
|
|
552
|
+
nextPageToken: Schema.optionalWith<typeof Schema.String, {
|
|
553
|
+
exact: true;
|
|
554
|
+
}>;
|
|
555
|
+
retentionPeriod: Schema.optionalWith<typeof Schema.String, {
|
|
556
|
+
exact: true;
|
|
557
|
+
}>;
|
|
558
|
+
}>;
|
|
559
|
+
}>;
|
|
560
|
+
export type NormalizedCompletedOrdersResult = Schema.Schema.Type<typeof NormalizedCompletedOrdersResultSchema>;
|
|
561
|
+
//# sourceMappingURL=order-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-history.d.ts","sourceRoot":"","sources":["../../../../src/domain/schemas/order-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAI/B,eAAO,MAAM,mBAAmB,IAAI,CAAA;AACpC,eAAO,MAAM,mBAAmB,KAAK,CAAA;AACrC,eAAO,MAAM,uBAAuB,KAAK,CAAA;AAczC,eAAO,MAAM,0BAA0B;;;;;;;EAGrC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,0BAA0B,CAAC,CAAA;AA+BxF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAW/C,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mCAAmC,CAAC,CAAA;AAE1G,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;SAQ/C,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mCAAmC,CAAC,CAAA;AAE1G,eAA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;;;;EAGhD,CAAA;AAEF,MAAM,MAAM,+BAA+B,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,qCAAqC,CAAC,CAAA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { MoneySchema } from "./money.js";
|
|
3
|
+
export const MIN_ORDER_PAGE_SIZE = 1;
|
|
4
|
+
export const MAX_ORDER_PAGE_SIZE = 50;
|
|
5
|
+
export const DEFAULT_ORDER_PAGE_SIZE = 20;
|
|
6
|
+
const UnknownStringRecordSchema = Schema.Record({ key: Schema.String, value: Schema.Unknown });
|
|
7
|
+
const NonEmptyTrimmedStringSchema = Schema.String.pipe(Schema.trimmed(), Schema.minLength(1));
|
|
8
|
+
const OrderPageSizeSchema = Schema.Number.pipe(Schema.finite(), Schema.int(), Schema.greaterThanOrEqualTo(MIN_ORDER_PAGE_SIZE), Schema.lessThanOrEqualTo(MAX_ORDER_PAGE_SIZE));
|
|
9
|
+
export const CompletedOrdersInputSchema = Schema.Struct({
|
|
10
|
+
pageSize: Schema.optionalWith(OrderPageSizeSchema, { default: () => DEFAULT_ORDER_PAGE_SIZE }),
|
|
11
|
+
pageToken: Schema.optionalWith(NonEmptyTrimmedStringSchema, { exact: true })
|
|
12
|
+
});
|
|
13
|
+
const RawOrderRegionSchema = Schema.asSchema(Schema.Struct({
|
|
14
|
+
regionId: Schema.String,
|
|
15
|
+
retailerRegionId: Schema.String
|
|
16
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)));
|
|
17
|
+
const RawOrderCarrierSchema = Schema.asSchema(Schema.Struct({
|
|
18
|
+
carrierId: Schema.String
|
|
19
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)));
|
|
20
|
+
const RawOrderExternalLockerSchema = Schema.asSchema(Schema.Struct({
|
|
21
|
+
externalLockerId: Schema.String
|
|
22
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)));
|
|
23
|
+
const RawOrderDeliveryDestinationSchema = Schema.asSchema(Schema.Struct({
|
|
24
|
+
address: Schema.Struct({
|
|
25
|
+
timeZone: Schema.String
|
|
26
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)),
|
|
27
|
+
deliveryMethod: Schema.String,
|
|
28
|
+
name: Schema.String
|
|
29
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)));
|
|
30
|
+
export const RawInternalCompletedOrderSlotSchema = Schema.asSchema(Schema.Struct({
|
|
31
|
+
__typename: Schema.Literal("InternalOrderSlot"),
|
|
32
|
+
carrier: Schema.optionalWith(Schema.NullOr(RawOrderCarrierSchema), { exact: true }),
|
|
33
|
+
deliveryDestination: RawOrderDeliveryDestinationSchema,
|
|
34
|
+
end: Schema.String,
|
|
35
|
+
externalLocker: Schema.optionalWith(Schema.NullOr(RawOrderExternalLockerSchema), { exact: true }),
|
|
36
|
+
shippingGroupType: Schema.optionalWith(Schema.String, { exact: true }),
|
|
37
|
+
start: Schema.String,
|
|
38
|
+
type: Schema.String
|
|
39
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)));
|
|
40
|
+
export const RawImportedCompletedOrderSlotSchema = Schema.asSchema(Schema.Struct({
|
|
41
|
+
__typename: Schema.Literal("ImportedOrderSlot"),
|
|
42
|
+
end: Schema.String,
|
|
43
|
+
name: Schema.String,
|
|
44
|
+
start: Schema.String,
|
|
45
|
+
timeZone: Schema.String
|
|
46
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)));
|
|
47
|
+
export const RawCompletedOrderSlotSchema = Schema.Union(RawInternalCompletedOrderSlotSchema, RawImportedCompletedOrderSlotSchema);
|
|
48
|
+
export const RawCompletedOrderNodeSchema = Schema.asSchema(Schema.Struct({
|
|
49
|
+
orderId: Schema.String,
|
|
50
|
+
prices: Schema.Struct({
|
|
51
|
+
total: MoneySchema
|
|
52
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)),
|
|
53
|
+
recurringOrderDefinition: Schema.optionalWith(Schema.NullOr(Schema.Struct({
|
|
54
|
+
name: Schema.String
|
|
55
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema))), { exact: true }),
|
|
56
|
+
region: RawOrderRegionSchema,
|
|
57
|
+
slot: RawCompletedOrderSlotSchema,
|
|
58
|
+
status: Schema.String
|
|
59
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)));
|
|
60
|
+
export const RawCompletedOrdersGraphqlResponseSchema = Schema.asSchema(Schema.Struct({
|
|
61
|
+
data: Schema.Struct({
|
|
62
|
+
completedOrders: Schema.Struct({
|
|
63
|
+
edges: Schema.Array(Schema.NullOr(Schema.Struct({
|
|
64
|
+
node: Schema.NullOr(RawCompletedOrderNodeSchema)
|
|
65
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)))),
|
|
66
|
+
pageInfo: Schema.Struct({
|
|
67
|
+
endCursor: Schema.NullOr(Schema.String),
|
|
68
|
+
hasNextPage: Schema.Boolean
|
|
69
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)),
|
|
70
|
+
retentionPeriod: Schema.optionalWith(Schema.String, { exact: true })
|
|
71
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema))
|
|
72
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema))
|
|
73
|
+
}).pipe(Schema.extend(UnknownStringRecordSchema)));
|
|
74
|
+
export const CompletedOrdersPaginationSchema = Schema.Struct({
|
|
75
|
+
hasNextPage: Schema.Boolean,
|
|
76
|
+
nextPageToken: Schema.optionalWith(Schema.String, { exact: true }),
|
|
77
|
+
retentionPeriod: Schema.optionalWith(Schema.String, { exact: true })
|
|
78
|
+
});
|
|
79
|
+
export const NormalizedCompletedOrderSchema = Schema.Struct({
|
|
80
|
+
addressNickName: Schema.String,
|
|
81
|
+
carrierId: Schema.optionalWith(Schema.String, { exact: true }),
|
|
82
|
+
dates: Schema.Struct({
|
|
83
|
+
deliveryEndDate: Schema.String,
|
|
84
|
+
deliveryStartDate: Schema.String,
|
|
85
|
+
timeZoneId: Schema.String
|
|
86
|
+
}),
|
|
87
|
+
deliveryMethod: Schema.String,
|
|
88
|
+
externalAddress: Schema.optionalWith(Schema.Struct({
|
|
89
|
+
externalCollectionPointId: Schema.String
|
|
90
|
+
}), { exact: true }),
|
|
91
|
+
orderId: Schema.String,
|
|
92
|
+
orderTotals: Schema.Struct({
|
|
93
|
+
totalPrice: MoneySchema
|
|
94
|
+
}),
|
|
95
|
+
recurringShoppingDefinition: Schema.optionalWith(Schema.Struct({
|
|
96
|
+
name: Schema.String
|
|
97
|
+
}), { exact: true }),
|
|
98
|
+
regionId: Schema.String,
|
|
99
|
+
retailerRegionId: Schema.String,
|
|
100
|
+
shippingGroupType: Schema.optionalWith(Schema.String, { exact: true }),
|
|
101
|
+
slotType: Schema.String,
|
|
102
|
+
status: Schema.String
|
|
103
|
+
});
|
|
104
|
+
export const NormalizedCompletedOrdersResultSchema = Schema.Struct({
|
|
105
|
+
orders: Schema.Array(NormalizedCompletedOrderSchema),
|
|
106
|
+
pagination: CompletedOrdersPaginationSchema
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=order-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-history.js","sourceRoot":"","sources":["../../../../src/domain/schemas/order-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAA;AACpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AACrC,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAEzC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;AAC9F,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CACpD,M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.js";
|
|
17
17
|
export * from "./voila/http-client.js";
|
|
18
18
|
export * from "./voila/initial-state.js";
|
|
19
|
+
export * from "./voila/order-history.js";
|
|
20
|
+
export * from "./voila/order-urls.js";
|
|
19
21
|
export * from "./voila/session-health.js";
|
|
20
22
|
export * from "./voila/session-snapshot.js";
|
|
21
23
|
export * from "./voila/session-storage.js";
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA;AACzC,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,kCAAkC,CAAA;AAChD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA;AACzC,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,kCAAkC,CAAA;AAChD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -16,6 +16,8 @@ export * from "./voila/guest-bootstrap.js";
|
|
|
16
16
|
export * from "./voila/headers.js";
|
|
17
17
|
export * from "./voila/http-client.js";
|
|
18
18
|
export * from "./voila/initial-state.js";
|
|
19
|
+
export * from "./voila/order-history.js";
|
|
20
|
+
export * from "./voila/order-urls.js";
|
|
19
21
|
export * from "./voila/session-health.js";
|
|
20
22
|
export * from "./voila/session-snapshot.js";
|
|
21
23
|
export * from "./voila/session-storage.js";
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA;AACzC,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACp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c,iBAAiB,CAAA"}
|
|
@@ -33,6 +33,11 @@ export declare const createInteractiveBrowserLoginPort: (driver: InteractiveBrow
|
|
|
33
33
|
readonly message?: string;
|
|
34
34
|
readonly _tag: "BrowserLoginAdapterFailure";
|
|
35
35
|
}, {
|
|
36
|
+
readonly account?: {
|
|
37
|
+
readonly displayName?: string;
|
|
38
|
+
readonly emailHint?: string;
|
|
39
|
+
readonly stableAccountIdHash?: string;
|
|
40
|
+
};
|
|
36
41
|
readonly authenticated: boolean;
|
|
37
42
|
readonly session: {
|
|
38
43
|
readonly cookieJar: {
|
|
@@ -52,17 +57,12 @@ export declare const createInteractiveBrowserLoginPort: (driver: InteractiveBrow
|
|
|
52
57
|
readonly token: string;
|
|
53
58
|
};
|
|
54
59
|
readonly metadata: {
|
|
60
|
+
readonly regionId: string;
|
|
55
61
|
readonly assetVersion: string;
|
|
56
62
|
readonly clientRouteId: string;
|
|
57
63
|
readonly pageViewId: string;
|
|
58
|
-
readonly regionId: string;
|
|
59
64
|
};
|
|
60
65
|
};
|
|
61
|
-
readonly account?: {
|
|
62
|
-
readonly displayName?: string;
|
|
63
|
-
readonly emailHint?: string;
|
|
64
|
-
readonly stableAccountIdHash?: string;
|
|
65
|
-
};
|
|
66
66
|
}> | Either.Right<{
|
|
67
67
|
readonly message?: string;
|
|
68
68
|
readonly _tag: "BrowserLoginUserCancelled";
|
|
@@ -73,6 +73,11 @@ export declare const createInteractiveBrowserLoginPort: (driver: InteractiveBrow
|
|
|
73
73
|
readonly message?: string;
|
|
74
74
|
readonly _tag: "BrowserLoginAdapterFailure";
|
|
75
75
|
}, {
|
|
76
|
+
readonly account?: {
|
|
77
|
+
readonly displayName?: string;
|
|
78
|
+
readonly emailHint?: string;
|
|
79
|
+
readonly stableAccountIdHash?: string;
|
|
80
|
+
};
|
|
76
81
|
readonly authenticated: boolean;
|
|
77
82
|
readonly session: {
|
|
78
83
|
readonly cookieJar: {
|
|
@@ -92,17 +97,12 @@ export declare const createInteractiveBrowserLoginPort: (driver: InteractiveBrow
|
|
|
92
97
|
readonly token: string;
|
|
93
98
|
};
|
|
94
99
|
readonly metadata: {
|
|
100
|
+
readonly regionId: string;
|
|
95
101
|
readonly assetVersion: string;
|
|
96
102
|
readonly clientRouteId: string;
|
|
97
103
|
readonly pageViewId: string;
|
|
98
|
-
readonly regionId: string;
|
|
99
104
|
};
|
|
100
105
|
};
|
|
101
|
-
readonly account?: {
|
|
102
|
-
readonly displayName?: string;
|
|
103
|
-
readonly emailHint?: string;
|
|
104
|
-
readonly stableAccountIdHash?: string;
|
|
105
|
-
};
|
|
106
106
|
}>>;
|
|
107
107
|
};
|
|
108
108
|
//# sourceMappingURL=browser-login-adapter.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Either } from "effect";
|
|
2
|
+
import { type NormalizedCompletedOrdersResult, type RawCompletedOrdersGraphqlResponse, type SessionSnapshot } from "../domain/schemas/index.js";
|
|
3
|
+
import type { VoilaJsonResult, VoilaSdkError, VoilaTransport } from "./http-client.js";
|
|
4
|
+
import type { CompletedOrdersRequestError } from "./order-urls.js";
|
|
5
|
+
import type { CookieJarPort } from "./session-snapshot.js";
|
|
6
|
+
export type CompletedOrdersResponseNormalizationError = {
|
|
7
|
+
readonly _tag: "CompletedOrdersResponseSchemaMismatch";
|
|
8
|
+
readonly message: string;
|
|
9
|
+
};
|
|
10
|
+
export type GetCompletedOrdersError = CompletedOrdersRequestError | VoilaSdkError;
|
|
11
|
+
export type GetCompletedOrdersResult = VoilaJsonResult<NormalizedCompletedOrdersResult>;
|
|
12
|
+
export declare const normalizeCompletedOrdersResponse: (response: RawCompletedOrdersGraphqlResponse) => NormalizedCompletedOrdersResult;
|
|
13
|
+
export declare const getCompletedOrders: (session: SessionSnapshot, input: unknown, transport: VoilaTransport, cookieJarPort?: CookieJarPort) => Promise<Either.Either<GetCompletedOrdersResult, GetCompletedOrdersError>>;
|
|
14
|
+
//# sourceMappingURL=order-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-history.d.ts","sourceRoot":"","sources":["../../../src/voila/order-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAEL,KAAK,+BAA+B,EAEpC,KAAK,iCAAiC,EAGtC,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAA;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1D,MAAM,MAAM,yCAAyC,GAAG;IACtD,QAAQ,CAAC,IAAI,EAAE,uCAAuC,CAAA;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,GAAG,aAAa,CAAA;AAEjF,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,+BAA+B,CAAC,CAAA;AA2DvF,eAAO,MAAM,gCAAgC,GAC3C,UAAU,iCAAiC,KAC1C,+BAgBF,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,SAAS,eAAe,EACxB,OAAO,OAAO,EACd,WAAW,cAAc,EACzB,gBAAgB,aAAa,KAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE,uBAAuB,CAAC,CAmB1E,CAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Either } from "effect";
|
|
2
|
+
import { RawCompletedOrdersGraphqlResponseSchema } from "../domain/schemas/index.js";
|
|
3
|
+
import { requestVoilaJson } from "./http-client.js";
|
|
4
|
+
import { makeCompletedOrdersRequest } from "./order-urls.js";
|
|
5
|
+
const HOME_DELIVERY = "HOME_DELIVERY";
|
|
6
|
+
const STANDARD_SLOT = "STANDARD";
|
|
7
|
+
const normalizeSlot = (slot) => {
|
|
8
|
+
switch (slot.__typename) {
|
|
9
|
+
case "ImportedOrderSlot":
|
|
10
|
+
return {
|
|
11
|
+
addressNickName: slot.name,
|
|
12
|
+
dates: {
|
|
13
|
+
deliveryEndDate: slot.end,
|
|
14
|
+
deliveryStartDate: slot.start,
|
|
15
|
+
timeZoneId: slot.timeZone
|
|
16
|
+
},
|
|
17
|
+
deliveryMethod: HOME_DELIVERY,
|
|
18
|
+
slotType: STANDARD_SLOT
|
|
19
|
+
};
|
|
20
|
+
case "InternalOrderSlot":
|
|
21
|
+
return {
|
|
22
|
+
addressNickName: slot.deliveryDestination.name,
|
|
23
|
+
...(slot.carrier === undefined || slot.carrier === null ? {} : { carrierId: slot.carrier.carrierId }),
|
|
24
|
+
dates: {
|
|
25
|
+
deliveryEndDate: slot.end,
|
|
26
|
+
deliveryStartDate: slot.start,
|
|
27
|
+
timeZoneId: slot.deliveryDestination.address.timeZone
|
|
28
|
+
},
|
|
29
|
+
deliveryMethod: slot.deliveryDestination.deliveryMethod,
|
|
30
|
+
...(slot.externalLocker === undefined || slot.externalLocker === null
|
|
31
|
+
? {}
|
|
32
|
+
: {
|
|
33
|
+
externalAddress: {
|
|
34
|
+
externalCollectionPointId: slot.externalLocker.externalLockerId
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
...(slot.shippingGroupType === undefined ? {} : { shippingGroupType: slot.shippingGroupType }),
|
|
38
|
+
slotType: slot.type
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const normalizeCompletedOrder = (order) => ({
|
|
43
|
+
...normalizeSlot(order.slot),
|
|
44
|
+
orderId: order.orderId,
|
|
45
|
+
orderTotals: {
|
|
46
|
+
totalPrice: order.prices.total
|
|
47
|
+
},
|
|
48
|
+
...(order.recurringOrderDefinition === undefined || order.recurringOrderDefinition === null
|
|
49
|
+
? {}
|
|
50
|
+
: {
|
|
51
|
+
recurringShoppingDefinition: {
|
|
52
|
+
name: order.recurringOrderDefinition.name
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
regionId: order.region.regionId,
|
|
56
|
+
retailerRegionId: order.region.retailerRegionId,
|
|
57
|
+
status: order.status
|
|
58
|
+
});
|
|
59
|
+
export const normalizeCompletedOrdersResponse = (response) => {
|
|
60
|
+
const connection = response.data.completedOrders;
|
|
61
|
+
const orders = connection.edges.flatMap((edge) => edge?.node === undefined || edge.node === null
|
|
62
|
+
? []
|
|
63
|
+
: [normalizeCompletedOrder(edge.node)]);
|
|
64
|
+
return {
|
|
65
|
+
orders,
|
|
66
|
+
pagination: {
|
|
67
|
+
hasNextPage: connection.pageInfo.hasNextPage,
|
|
68
|
+
...(connection.pageInfo.endCursor === null ? {} : { nextPageToken: connection.pageInfo.endCursor }),
|
|
69
|
+
...(connection.retentionPeriod === undefined ? {} : { retentionPeriod: connection.retentionPeriod })
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export const getCompletedOrders = async (session, input, transport, cookieJarPort) => {
|
|
74
|
+
const request = makeCompletedOrdersRequest(input);
|
|
75
|
+
if (Either.isLeft(request)) {
|
|
76
|
+
return Either.left(request.left);
|
|
77
|
+
}
|
|
78
|
+
const response = await requestVoilaJson(RawCompletedOrdersGraphqlResponseSchema, session, request.right, transport, cookieJarPort);
|
|
79
|
+
return Either.map(response, (result) => ({
|
|
80
|
+
session: result.session,
|
|
81
|
+
value: normalizeCompletedOrdersResponse(result.value)
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=order-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-history.js","sourceRoot":"","sources":["../../../src/voila/order-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAKL,uCAAuC,EAGxC,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAA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MAAM;QACN,UAAU,EAAE;YACV,WAAW,EAAE,UAAU,CAAC,QAAQ,CAAC,WAAW;YAC5C,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YACnG,GAAG,CAAC,UAAU,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC;SACrG;KACF,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,OAAwB,EACxB,KAAc,EACd,SAAyB,EACzB,aAA6B,EAC8C,EAAE;IAC7E,MAAM,OAAO,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAA;IAEjD,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClC,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CACrC,uCAAuC,EACvC,OAAO,EACP,OAAO,CAAC,KAAK,EACb,SAAS,EACT,aAAa,CACd,CAAA;IAED,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACvC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,KAAK,EAAE,gCAAgC,CAAC,MAAM,CAAC,KAAK,CAAC;KACtD,CAAC,CAAC,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Either } from "effect";
|
|
2
|
+
export declare const COMPLETED_ORDERS_QUERY = "query GetCompletedOrders($first: Int!, $after: String) {\n completedOrders(first: $first, after: $after) {\n retentionPeriod\n pageInfo {\n endCursor\n hasNextPage\n }\n edges {\n node {\n orderId\n status\n region {\n retailerRegionId\n regionId\n }\n prices {\n total {\n currency\n amount\n }\n }\n recurringOrderDefinition {\n name\n }\n slot {\n __typename\n ... on InternalOrderSlot {\n start\n end\n type\n shippingGroupType\n carrier {\n carrierId\n }\n externalLocker {\n externalLockerId\n }\n deliveryDestination {\n deliveryMethod\n name\n address {\n timeZone\n }\n }\n }\n ... on ImportedOrderSlot {\n start\n end\n name\n timeZone\n }\n }\n }\n }\n }\n}";
|
|
3
|
+
export interface CompletedOrdersRequest {
|
|
4
|
+
readonly body: string;
|
|
5
|
+
readonly method: "POST";
|
|
6
|
+
readonly url: URL;
|
|
7
|
+
}
|
|
8
|
+
export type CompletedOrdersRequestError = {
|
|
9
|
+
readonly _tag: "CompletedOrdersInputInvalid";
|
|
10
|
+
readonly message: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const makeCompletedOrdersRequest: (input?: unknown) => Either.Either<CompletedOrdersRequest, CompletedOrdersRequestError>;
|
|
13
|
+
//# sourceMappingURL=order-urls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-urls.d.ts","sourceRoot":"","sources":["../../../src/voila/order-urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAQ/B,eAAO,MAAM,sBAAsB,mnCAuDjC,CAAA;AAEF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;CAClB;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,CAAC,IAAI,EAAE,6BAA6B,CAAA;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAYD,eAAO,MAAM,0BAA0B,GACrC,QAAO,OAAY,KAClB,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,2BAA2B,CAYjE,CAAA"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Either } from "effect";
|
|
2
|
+
import { parseUnknown } from "../domain/parse.js";
|
|
3
|
+
import { CompletedOrdersInputSchema } from "../domain/schemas/index.js";
|
|
4
|
+
import { VOILA_BASE_URL } from "./urls.js";
|
|
5
|
+
const COMPLETED_ORDERS_GRAPHQL_PATH = "/graphql";
|
|
6
|
+
export const COMPLETED_ORDERS_QUERY = `query GetCompletedOrders($first: Int!, $after: String) {
|
|
7
|
+
completedOrders(first: $first, after: $after) {
|
|
8
|
+
retentionPeriod
|
|
9
|
+
pageInfo {
|
|
10
|
+
endCursor
|
|
11
|
+
hasNextPage
|
|
12
|
+
}
|
|
13
|
+
edges {
|
|
14
|
+
node {
|
|
15
|
+
orderId
|
|
16
|
+
status
|
|
17
|
+
region {
|
|
18
|
+
retailerRegionId
|
|
19
|
+
regionId
|
|
20
|
+
}
|
|
21
|
+
prices {
|
|
22
|
+
total {
|
|
23
|
+
currency
|
|
24
|
+
amount
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
recurringOrderDefinition {
|
|
28
|
+
name
|
|
29
|
+
}
|
|
30
|
+
slot {
|
|
31
|
+
__typename
|
|
32
|
+
... on InternalOrderSlot {
|
|
33
|
+
start
|
|
34
|
+
end
|
|
35
|
+
type
|
|
36
|
+
shippingGroupType
|
|
37
|
+
carrier {
|
|
38
|
+
carrierId
|
|
39
|
+
}
|
|
40
|
+
externalLocker {
|
|
41
|
+
externalLockerId
|
|
42
|
+
}
|
|
43
|
+
deliveryDestination {
|
|
44
|
+
deliveryMethod
|
|
45
|
+
name
|
|
46
|
+
address {
|
|
47
|
+
timeZone
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
... on ImportedOrderSlot {
|
|
52
|
+
start
|
|
53
|
+
end
|
|
54
|
+
name
|
|
55
|
+
timeZone
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}`;
|
|
62
|
+
const completedOrdersInputInvalid = () => ({
|
|
63
|
+
_tag: "CompletedOrdersInputInvalid",
|
|
64
|
+
message: "Completed orders request input does not match the SDK schema"
|
|
65
|
+
});
|
|
66
|
+
const makeVariables = (input) => ({
|
|
67
|
+
...(input.pageToken === undefined ? {} : { after: input.pageToken }),
|
|
68
|
+
first: input.pageSize
|
|
69
|
+
});
|
|
70
|
+
export const makeCompletedOrdersRequest = (input = {}) => Either.map(Either.mapLeft(parseUnknown(CompletedOrdersInputSchema, input), completedOrdersInputInvalid), (completedOrdersInput) => ({
|
|
71
|
+
body: JSON.stringify({
|
|
72
|
+
operationName: "GetCompletedOrders",
|
|
73
|
+
query: COMPLETED_ORDERS_QUERY,
|
|
74
|
+
variables: makeVariables(completedOrdersInput)
|
|
75
|
+
}),
|
|
76
|
+
method: "POST",
|
|
77
|
+
url: new URL(COMPLETED_ORDERS_GRAPHQL_PATH, VOILA_BASE_URL)
|
|
78
|
+
}));
|
|
79
|
+
//# sourceMappingURL=order-urls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-urls.js","sourceRoot":"","sources":["../../../src/voila/order-urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAA6B,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,MAAM,6BAA6B,GAAG,UAAU,CAAA;AAEhD,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDpC,CAAA;AAaF,MAAM,2BAA2B,GAAG,GAAgC,EAAE,CAAC,CAAC;IACtE,IAAI,EAAE,6BA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