@firfi/voila-sdk 0.1.0
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/LICENSE +21 -0
- package/README.md +165 -0
- package/dist/src/domain/cart.d.ts +10 -0
- package/dist/src/domain/cart.d.ts.map +1 -0
- package/dist/src/domain/cart.js +14 -0
- package/dist/src/domain/cart.js.map +1 -0
- package/dist/src/domain/checkout-readiness.d.ts +3 -0
- package/dist/src/domain/checkout-readiness.d.ts.map +1 -0
- package/dist/src/domain/checkout-readiness.js +18 -0
- package/dist/src/domain/checkout-readiness.js.map +1 -0
- package/dist/src/domain/parse.d.ts +5 -0
- package/dist/src/domain/parse.d.ts.map +1 -0
- package/dist/src/domain/parse.js +11 -0
- package/dist/src/domain/parse.js.map +1 -0
- package/dist/src/domain/schemas/auth.d.ts +123 -0
- package/dist/src/domain/schemas/auth.d.ts.map +1 -0
- package/dist/src/domain/schemas/auth.js +36 -0
- package/dist/src/domain/schemas/auth.js.map +1 -0
- package/dist/src/domain/schemas/cart.d.ts +1224 -0
- package/dist/src/domain/schemas/cart.d.ts.map +1 -0
- package/dist/src/domain/schemas/cart.js +123 -0
- package/dist/src/domain/schemas/cart.js.map +1 -0
- package/dist/src/domain/schemas/category-page.d.ts +187 -0
- package/dist/src/domain/schemas/category-page.d.ts.map +1 -0
- package/dist/src/domain/schemas/category-page.js +43 -0
- package/dist/src/domain/schemas/category-page.js.map +1 -0
- package/dist/src/domain/schemas/category.d.ts +25 -0
- package/dist/src/domain/schemas/category.d.ts.map +1 -0
- package/dist/src/domain/schemas/category.js +30 -0
- package/dist/src/domain/schemas/category.js.map +1 -0
- package/dist/src/domain/schemas/checkout-summary.d.ts +1035 -0
- package/dist/src/domain/schemas/checkout-summary.d.ts.map +1 -0
- package/dist/src/domain/schemas/checkout-summary.js +103 -0
- package/dist/src/domain/schemas/checkout-summary.js.map +1 -0
- package/dist/src/domain/schemas/delivery-destination.d.ts +176 -0
- package/dist/src/domain/schemas/delivery-destination.d.ts.map +1 -0
- package/dist/src/domain/schemas/delivery-destination.js +52 -0
- package/dist/src/domain/schemas/delivery-destination.js.map +1 -0
- package/dist/src/domain/schemas/index.d.ts +13 -0
- package/dist/src/domain/schemas/index.d.ts.map +1 -0
- package/dist/src/domain/schemas/index.js +13 -0
- package/dist/src/domain/schemas/index.js.map +1 -0
- package/dist/src/domain/schemas/money.d.ts +18 -0
- package/dist/src/domain/schemas/money.d.ts.map +1 -0
- package/dist/src/domain/schemas/money.js +11 -0
- package/dist/src/domain/schemas/money.js.map +1 -0
- package/dist/src/domain/schemas/product.d.ts +230 -0
- package/dist/src/domain/schemas/product.d.ts.map +1 -0
- package/dist/src/domain/schemas/product.js +32 -0
- package/dist/src/domain/schemas/product.js.map +1 -0
- package/dist/src/domain/schemas/proposition.d.ts +746 -0
- package/dist/src/domain/schemas/proposition.d.ts.map +1 -0
- package/dist/src/domain/schemas/proposition.js +110 -0
- package/dist/src/domain/schemas/proposition.js.map +1 -0
- package/dist/src/domain/schemas/search.d.ts +31 -0
- package/dist/src/domain/schemas/search.d.ts.map +1 -0
- package/dist/src/domain/schemas/search.js +16 -0
- package/dist/src/domain/schemas/search.js.map +1 -0
- package/dist/src/domain/schemas/session.d.ts +1341 -0
- package/dist/src/domain/schemas/session.d.ts.map +1 -0
- package/dist/src/domain/schemas/session.js +140 -0
- package/dist/src/domain/schemas/session.js.map +1 -0
- package/dist/src/domain/schemas/slot.d.ts +844 -0
- package/dist/src/domain/schemas/slot.d.ts.map +1 -0
- package/dist/src/domain/schemas/slot.js +130 -0
- package/dist/src/domain/schemas/slot.js.map +1 -0
- package/dist/src/index.d.ts +26 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +26 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/voila/browser-login-adapter.d.ts +108 -0
- package/dist/src/voila/browser-login-adapter.d.ts.map +1 -0
- package/dist/src/voila/browser-login-adapter.js +128 -0
- package/dist/src/voila/browser-login-adapter.js.map +1 -0
- package/dist/src/voila/browser-login.d.ts +32 -0
- package/dist/src/voila/browser-login.d.ts.map +1 -0
- package/dist/src/voila/browser-login.js +86 -0
- package/dist/src/voila/browser-login.js.map +1 -0
- package/dist/src/voila/cart-mutation.d.ts +23 -0
- package/dist/src/voila/cart-mutation.d.ts.map +1 -0
- package/dist/src/voila/cart-mutation.js +52 -0
- package/dist/src/voila/cart-mutation.js.map +1 -0
- package/dist/src/voila/cart-view.d.ts +14 -0
- package/dist/src/voila/cart-view.d.ts.map +1 -0
- package/dist/src/voila/cart-view.js +45 -0
- package/dist/src/voila/cart-view.js.map +1 -0
- package/dist/src/voila/catalog-search.d.ts +27 -0
- package/dist/src/voila/catalog-search.d.ts.map +1 -0
- package/dist/src/voila/catalog-search.js +40 -0
- package/dist/src/voila/catalog-search.js.map +1 -0
- package/dist/src/voila/categories.d.ts +4 -0
- package/dist/src/voila/categories.d.ts.map +1 -0
- package/dist/src/voila/categories.js +22 -0
- package/dist/src/voila/categories.js.map +1 -0
- package/dist/src/voila/category-products.d.ts +22 -0
- package/dist/src/voila/category-products.d.ts.map +1 -0
- package/dist/src/voila/category-products.js +32 -0
- package/dist/src/voila/category-products.js.map +1 -0
- package/dist/src/voila/checkout-summary.d.ts +15 -0
- package/dist/src/voila/checkout-summary.d.ts.map +1 -0
- package/dist/src/voila/checkout-summary.js +93 -0
- package/dist/src/voila/checkout-summary.js.map +1 -0
- package/dist/src/voila/checkout-urls.d.ts +11 -0
- package/dist/src/voila/checkout-urls.d.ts.map +1 -0
- package/dist/src/voila/checkout-urls.js +23 -0
- package/dist/src/voila/checkout-urls.js.map +1 -0
- package/dist/src/voila/delivery-destinations.d.ts +22 -0
- package/dist/src/voila/delivery-destinations.d.ts.map +1 -0
- package/dist/src/voila/delivery-destinations.js +70 -0
- package/dist/src/voila/delivery-destinations.js.map +1 -0
- package/dist/src/voila/guest-bootstrap.d.ts +40 -0
- package/dist/src/voila/guest-bootstrap.d.ts.map +1 -0
- package/dist/src/voila/guest-bootstrap.js +108 -0
- package/dist/src/voila/guest-bootstrap.js.map +1 -0
- package/dist/src/voila/headers.d.ts +5 -0
- package/dist/src/voila/headers.d.ts.map +1 -0
- package/dist/src/voila/headers.js +20 -0
- package/dist/src/voila/headers.js.map +1 -0
- package/dist/src/voila/http-client.d.ts +60 -0
- package/dist/src/voila/http-client.d.ts.map +1 -0
- package/dist/src/voila/http-client.js +124 -0
- package/dist/src/voila/http-client.js.map +1 -0
- package/dist/src/voila/initial-state.d.ts +19 -0
- package/dist/src/voila/initial-state.d.ts.map +1 -0
- package/dist/src/voila/initial-state.js +117 -0
- package/dist/src/voila/initial-state.js.map +1 -0
- package/dist/src/voila/session-health.d.ts +10 -0
- package/dist/src/voila/session-health.d.ts.map +1 -0
- package/dist/src/voila/session-health.js +176 -0
- package/dist/src/voila/session-health.js.map +1 -0
- package/dist/src/voila/session-snapshot.d.ts +41 -0
- package/dist/src/voila/session-snapshot.d.ts.map +1 -0
- package/dist/src/voila/session-snapshot.js +101 -0
- package/dist/src/voila/session-snapshot.js.map +1 -0
- package/dist/src/voila/session-storage.d.ts +22 -0
- package/dist/src/voila/session-storage.d.ts.map +1 -0
- package/dist/src/voila/session-storage.js +54 -0
- package/dist/src/voila/session-storage.js.map +1 -0
- package/dist/src/voila/shopping-context.d.ts +33 -0
- package/dist/src/voila/shopping-context.d.ts.map +1 -0
- package/dist/src/voila/shopping-context.js +159 -0
- package/dist/src/voila/shopping-context.js.map +1 -0
- package/dist/src/voila/slot-urls.d.ts +22 -0
- package/dist/src/voila/slot-urls.d.ts.map +1 -0
- package/dist/src/voila/slot-urls.js +51 -0
- package/dist/src/voila/slot-urls.js.map +1 -0
- package/dist/src/voila/slots.d.ts +41 -0
- package/dist/src/voila/slots.d.ts.map +1 -0
- package/dist/src/voila/slots.js +137 -0
- package/dist/src/voila/slots.js.map +1 -0
- package/dist/src/voila/urls.d.ts +114 -0
- package/dist/src/voila/urls.d.ts.map +1 -0
- package/dist/src/voila/urls.js +197 -0
- package/dist/src/voila/urls.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const ProductImageSchema: Schema.Struct<{
|
|
3
|
+
description: Schema.optionalWith<typeof Schema.String, {
|
|
4
|
+
exact: true;
|
|
5
|
+
}>;
|
|
6
|
+
src: typeof Schema.String;
|
|
7
|
+
}>;
|
|
8
|
+
export type ProductImage = Schema.Schema.Type<typeof ProductImageSchema>;
|
|
9
|
+
export declare const ProductSchema: Schema.Struct<{
|
|
10
|
+
available: typeof Schema.Boolean;
|
|
11
|
+
brand: Schema.optionalWith<typeof Schema.String, {
|
|
12
|
+
exact: true;
|
|
13
|
+
}>;
|
|
14
|
+
image: Schema.optionalWith<Schema.Struct<{
|
|
15
|
+
description: Schema.optionalWith<typeof Schema.String, {
|
|
16
|
+
exact: true;
|
|
17
|
+
}>;
|
|
18
|
+
src: typeof Schema.String;
|
|
19
|
+
}>, {
|
|
20
|
+
exact: true;
|
|
21
|
+
}>;
|
|
22
|
+
maxQuantityReached: typeof Schema.Boolean;
|
|
23
|
+
name: typeof Schema.String;
|
|
24
|
+
packSizeDescription: Schema.optionalWith<typeof Schema.String, {
|
|
25
|
+
exact: true;
|
|
26
|
+
}>;
|
|
27
|
+
price: Schema.Struct<{
|
|
28
|
+
amount: typeof Schema.String;
|
|
29
|
+
currency: typeof Schema.String;
|
|
30
|
+
}>;
|
|
31
|
+
productId: typeof Schema.String;
|
|
32
|
+
quantityInBasket: typeof Schema.Number;
|
|
33
|
+
retailerProductId: typeof Schema.String;
|
|
34
|
+
unitPrice: Schema.optionalWith<Schema.Struct<{
|
|
35
|
+
price: Schema.Struct<{
|
|
36
|
+
amount: typeof Schema.String;
|
|
37
|
+
currency: typeof Schema.String;
|
|
38
|
+
}>;
|
|
39
|
+
unit: typeof Schema.String;
|
|
40
|
+
unitName: Schema.optionalWith<typeof Schema.String, {
|
|
41
|
+
exact: true;
|
|
42
|
+
}>;
|
|
43
|
+
}>, {
|
|
44
|
+
exact: true;
|
|
45
|
+
}>;
|
|
46
|
+
}>;
|
|
47
|
+
export type Product = Schema.Schema.Type<typeof ProductSchema>;
|
|
48
|
+
export declare const ProductGroupSchema: Schema.Struct<{
|
|
49
|
+
decoratedProducts: Schema.optionalWith<Schema.Array$<Schema.Struct<{
|
|
50
|
+
available: typeof Schema.Boolean;
|
|
51
|
+
brand: Schema.optionalWith<typeof Schema.String, {
|
|
52
|
+
exact: true;
|
|
53
|
+
}>;
|
|
54
|
+
image: Schema.optionalWith<Schema.Struct<{
|
|
55
|
+
description: Schema.optionalWith<typeof Schema.String, {
|
|
56
|
+
exact: true;
|
|
57
|
+
}>;
|
|
58
|
+
src: typeof Schema.String;
|
|
59
|
+
}>, {
|
|
60
|
+
exact: true;
|
|
61
|
+
}>;
|
|
62
|
+
maxQuantityReached: typeof Schema.Boolean;
|
|
63
|
+
name: typeof Schema.String;
|
|
64
|
+
packSizeDescription: Schema.optionalWith<typeof Schema.String, {
|
|
65
|
+
exact: true;
|
|
66
|
+
}>;
|
|
67
|
+
price: Schema.Struct<{
|
|
68
|
+
amount: typeof Schema.String;
|
|
69
|
+
currency: typeof Schema.String;
|
|
70
|
+
}>;
|
|
71
|
+
productId: typeof Schema.String;
|
|
72
|
+
quantityInBasket: typeof Schema.Number;
|
|
73
|
+
retailerProductId: typeof Schema.String;
|
|
74
|
+
unitPrice: Schema.optionalWith<Schema.Struct<{
|
|
75
|
+
price: Schema.Struct<{
|
|
76
|
+
amount: typeof Schema.String;
|
|
77
|
+
currency: typeof Schema.String;
|
|
78
|
+
}>;
|
|
79
|
+
unit: typeof Schema.String;
|
|
80
|
+
unitName: Schema.optionalWith<typeof Schema.String, {
|
|
81
|
+
exact: true;
|
|
82
|
+
}>;
|
|
83
|
+
}>, {
|
|
84
|
+
exact: true;
|
|
85
|
+
}>;
|
|
86
|
+
}>>, {
|
|
87
|
+
exact: true;
|
|
88
|
+
}>;
|
|
89
|
+
name: Schema.optionalWith<typeof Schema.String, {
|
|
90
|
+
exact: true;
|
|
91
|
+
}>;
|
|
92
|
+
products: Schema.optionalWith<Schema.Array$<Schema.Struct<{
|
|
93
|
+
available: typeof Schema.Boolean;
|
|
94
|
+
brand: Schema.optionalWith<typeof Schema.String, {
|
|
95
|
+
exact: true;
|
|
96
|
+
}>;
|
|
97
|
+
image: Schema.optionalWith<Schema.Struct<{
|
|
98
|
+
description: Schema.optionalWith<typeof Schema.String, {
|
|
99
|
+
exact: true;
|
|
100
|
+
}>;
|
|
101
|
+
src: typeof Schema.String;
|
|
102
|
+
}>, {
|
|
103
|
+
exact: true;
|
|
104
|
+
}>;
|
|
105
|
+
maxQuantityReached: typeof Schema.Boolean;
|
|
106
|
+
name: typeof Schema.String;
|
|
107
|
+
packSizeDescription: Schema.optionalWith<typeof Schema.String, {
|
|
108
|
+
exact: true;
|
|
109
|
+
}>;
|
|
110
|
+
price: Schema.Struct<{
|
|
111
|
+
amount: typeof Schema.String;
|
|
112
|
+
currency: typeof Schema.String;
|
|
113
|
+
}>;
|
|
114
|
+
productId: typeof Schema.String;
|
|
115
|
+
quantityInBasket: typeof Schema.Number;
|
|
116
|
+
retailerProductId: typeof Schema.String;
|
|
117
|
+
unitPrice: Schema.optionalWith<Schema.Struct<{
|
|
118
|
+
price: Schema.Struct<{
|
|
119
|
+
amount: typeof Schema.String;
|
|
120
|
+
currency: typeof Schema.String;
|
|
121
|
+
}>;
|
|
122
|
+
unit: typeof Schema.String;
|
|
123
|
+
unitName: Schema.optionalWith<typeof Schema.String, {
|
|
124
|
+
exact: true;
|
|
125
|
+
}>;
|
|
126
|
+
}>, {
|
|
127
|
+
exact: true;
|
|
128
|
+
}>;
|
|
129
|
+
}>>, {
|
|
130
|
+
exact: true;
|
|
131
|
+
}>;
|
|
132
|
+
type: typeof Schema.String;
|
|
133
|
+
}>;
|
|
134
|
+
export type ProductGroup = Schema.Schema.Type<typeof ProductGroupSchema>;
|
|
135
|
+
export declare const ProductSearchResponseSchema: Schema.Struct<{
|
|
136
|
+
nextPageToken: Schema.optionalWith<typeof Schema.String, {
|
|
137
|
+
exact: true;
|
|
138
|
+
}>;
|
|
139
|
+
productGroups: Schema.Array$<Schema.Struct<{
|
|
140
|
+
decoratedProducts: Schema.optionalWith<Schema.Array$<Schema.Struct<{
|
|
141
|
+
available: typeof Schema.Boolean;
|
|
142
|
+
brand: Schema.optionalWith<typeof Schema.String, {
|
|
143
|
+
exact: true;
|
|
144
|
+
}>;
|
|
145
|
+
image: Schema.optionalWith<Schema.Struct<{
|
|
146
|
+
description: Schema.optionalWith<typeof Schema.String, {
|
|
147
|
+
exact: true;
|
|
148
|
+
}>;
|
|
149
|
+
src: typeof Schema.String;
|
|
150
|
+
}>, {
|
|
151
|
+
exact: true;
|
|
152
|
+
}>;
|
|
153
|
+
maxQuantityReached: typeof Schema.Boolean;
|
|
154
|
+
name: typeof Schema.String;
|
|
155
|
+
packSizeDescription: Schema.optionalWith<typeof Schema.String, {
|
|
156
|
+
exact: true;
|
|
157
|
+
}>;
|
|
158
|
+
price: Schema.Struct<{
|
|
159
|
+
amount: typeof Schema.String;
|
|
160
|
+
currency: typeof Schema.String;
|
|
161
|
+
}>;
|
|
162
|
+
productId: typeof Schema.String;
|
|
163
|
+
quantityInBasket: typeof Schema.Number;
|
|
164
|
+
retailerProductId: typeof Schema.String;
|
|
165
|
+
unitPrice: Schema.optionalWith<Schema.Struct<{
|
|
166
|
+
price: Schema.Struct<{
|
|
167
|
+
amount: typeof Schema.String;
|
|
168
|
+
currency: typeof Schema.String;
|
|
169
|
+
}>;
|
|
170
|
+
unit: typeof Schema.String;
|
|
171
|
+
unitName: Schema.optionalWith<typeof Schema.String, {
|
|
172
|
+
exact: true;
|
|
173
|
+
}>;
|
|
174
|
+
}>, {
|
|
175
|
+
exact: true;
|
|
176
|
+
}>;
|
|
177
|
+
}>>, {
|
|
178
|
+
exact: true;
|
|
179
|
+
}>;
|
|
180
|
+
name: Schema.optionalWith<typeof Schema.String, {
|
|
181
|
+
exact: true;
|
|
182
|
+
}>;
|
|
183
|
+
products: Schema.optionalWith<Schema.Array$<Schema.Struct<{
|
|
184
|
+
available: typeof Schema.Boolean;
|
|
185
|
+
brand: Schema.optionalWith<typeof Schema.String, {
|
|
186
|
+
exact: true;
|
|
187
|
+
}>;
|
|
188
|
+
image: Schema.optionalWith<Schema.Struct<{
|
|
189
|
+
description: Schema.optionalWith<typeof Schema.String, {
|
|
190
|
+
exact: true;
|
|
191
|
+
}>;
|
|
192
|
+
src: typeof Schema.String;
|
|
193
|
+
}>, {
|
|
194
|
+
exact: true;
|
|
195
|
+
}>;
|
|
196
|
+
maxQuantityReached: typeof Schema.Boolean;
|
|
197
|
+
name: typeof Schema.String;
|
|
198
|
+
packSizeDescription: Schema.optionalWith<typeof Schema.String, {
|
|
199
|
+
exact: true;
|
|
200
|
+
}>;
|
|
201
|
+
price: Schema.Struct<{
|
|
202
|
+
amount: typeof Schema.String;
|
|
203
|
+
currency: typeof Schema.String;
|
|
204
|
+
}>;
|
|
205
|
+
productId: typeof Schema.String;
|
|
206
|
+
quantityInBasket: typeof Schema.Number;
|
|
207
|
+
retailerProductId: typeof Schema.String;
|
|
208
|
+
unitPrice: Schema.optionalWith<Schema.Struct<{
|
|
209
|
+
price: Schema.Struct<{
|
|
210
|
+
amount: typeof Schema.String;
|
|
211
|
+
currency: typeof Schema.String;
|
|
212
|
+
}>;
|
|
213
|
+
unit: typeof Schema.String;
|
|
214
|
+
unitName: Schema.optionalWith<typeof Schema.String, {
|
|
215
|
+
exact: true;
|
|
216
|
+
}>;
|
|
217
|
+
}>, {
|
|
218
|
+
exact: true;
|
|
219
|
+
}>;
|
|
220
|
+
}>>, {
|
|
221
|
+
exact: true;
|
|
222
|
+
}>;
|
|
223
|
+
type: typeof Schema.String;
|
|
224
|
+
}>>;
|
|
225
|
+
totalProducts: Schema.optionalWith<Schema.filter<Schema.filter<Schema.filter<typeof Schema.Number>>>, {
|
|
226
|
+
exact: true;
|
|
227
|
+
}>;
|
|
228
|
+
}>;
|
|
229
|
+
export type ProductSearchResponse = Schema.Schema.Type<typeof ProductSearchResponseSchema>;
|
|
230
|
+
//# sourceMappingURL=product.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../../../../src/domain/schemas/product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAU/B,eAAO,MAAM,kBAAkB;;;;;EAG7B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAExE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYxB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,aAAa,CAAC,CAAA;AAE9D,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK7B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAExE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAItC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { MoneySchema, UnitPriceSchema } from "./money.js";
|
|
3
|
+
const NonNegativeIntegerSchema = Schema.Number.pipe(Schema.finite(), Schema.int(), Schema.nonNegative());
|
|
4
|
+
export const ProductImageSchema = Schema.Struct({
|
|
5
|
+
description: Schema.optionalWith(Schema.String, { exact: true }),
|
|
6
|
+
src: Schema.String
|
|
7
|
+
});
|
|
8
|
+
export const ProductSchema = Schema.Struct({
|
|
9
|
+
available: Schema.Boolean,
|
|
10
|
+
brand: Schema.optionalWith(Schema.String, { exact: true }),
|
|
11
|
+
image: Schema.optionalWith(ProductImageSchema, { exact: true }),
|
|
12
|
+
maxQuantityReached: Schema.Boolean,
|
|
13
|
+
name: Schema.String,
|
|
14
|
+
packSizeDescription: Schema.optionalWith(Schema.String, { exact: true }),
|
|
15
|
+
price: MoneySchema,
|
|
16
|
+
productId: Schema.String,
|
|
17
|
+
quantityInBasket: Schema.Number,
|
|
18
|
+
retailerProductId: Schema.String,
|
|
19
|
+
unitPrice: Schema.optionalWith(UnitPriceSchema, { exact: true })
|
|
20
|
+
});
|
|
21
|
+
export const ProductGroupSchema = Schema.Struct({
|
|
22
|
+
decoratedProducts: Schema.optionalWith(Schema.Array(ProductSchema), { exact: true }),
|
|
23
|
+
name: Schema.optionalWith(Schema.String, { exact: true }),
|
|
24
|
+
products: Schema.optionalWith(Schema.Array(ProductSchema), { exact: true }),
|
|
25
|
+
type: Schema.String
|
|
26
|
+
});
|
|
27
|
+
export const ProductSearchResponseSchema = Schema.Struct({
|
|
28
|
+
nextPageToken: Schema.optionalWith(Schema.String, { exact: true }),
|
|
29
|
+
productGroups: Schema.Array(ProductGroupSchema),
|
|
30
|
+
totalProducts: Schema.optionalWith(NonNegativeIntegerSchema, { exact: true })
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../../../src/domain/schemas/product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAA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