@retailcrm/embed-ui-v1-contexts 0.9.0 → 0.9.1-alpha.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/dist/common/order/card.d.ts +1 -1
- package/dist/meta.json +95 -95
- package/dist/predicates/order/card.d.ts +53 -53
- package/dist/predicates.es.js +2 -2
- package/dist/remote/order/card.cjs +30 -30
- package/dist/remote/order/card.js +31 -31
- package/dist/remote/settings.js +1 -1
- package/package.json +3 -3
- package/types/order/card.d.ts +32 -32
- package/types/order/mg.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActionSchema } from '@retailcrm/embed-ui-v1-types/context';
|
|
2
2
|
import { ObjectDescription, ContextSchemaDescription, ContextSchemaUsage } from '@retailcrm/embed-ui-v1-types/context-doc';
|
|
3
|
-
import { KnownTypes } from '../../../generated/
|
|
3
|
+
import { KnownTypes } from '../../../generated/order/card.d.ts';
|
|
4
4
|
import { MethodList, Schema } from '../../../types/order/card';
|
|
5
5
|
export declare const id = "order/card";
|
|
6
6
|
export declare const schema: Schema;
|
package/dist/meta.json
CHANGED
|
@@ -73,6 +73,101 @@
|
|
|
73
73
|
}
|
|
74
74
|
]
|
|
75
75
|
},
|
|
76
|
+
{
|
|
77
|
+
"name": "Offer",
|
|
78
|
+
"fields": [
|
|
79
|
+
{
|
|
80
|
+
"name": "id",
|
|
81
|
+
"type": "number",
|
|
82
|
+
"description": {
|
|
83
|
+
"en-GB": "ID",
|
|
84
|
+
"es-ES": "ID",
|
|
85
|
+
"ru-RU": "Идентификатор"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "name",
|
|
90
|
+
"type": "string",
|
|
91
|
+
"description": {
|
|
92
|
+
"en-GB": "Name",
|
|
93
|
+
"es-ES": "Nombre",
|
|
94
|
+
"ru-RU": "Наименование"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "image",
|
|
99
|
+
"type": "string|null",
|
|
100
|
+
"description": {
|
|
101
|
+
"en-GB": "Image URL",
|
|
102
|
+
"es-ES": "URL de la imagen",
|
|
103
|
+
"ru-RU": "URL изображения"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "dimensions",
|
|
108
|
+
"type": "Dimensions",
|
|
109
|
+
"description": {
|
|
110
|
+
"en-GB": "Product dimensions L - length, W - width, H - height",
|
|
111
|
+
"es-ES": "Dimensiones del producto L - longitud, W - ancho, H - altura",
|
|
112
|
+
"ru-RU": "Размеры товара L - длина, W - ширина, H - высота"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "weight",
|
|
117
|
+
"type": "Weight|null",
|
|
118
|
+
"description": {
|
|
119
|
+
"en-GB": "Weight",
|
|
120
|
+
"es-ES": "Peso",
|
|
121
|
+
"ru-RU": "Вес"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "article",
|
|
126
|
+
"type": "string|null",
|
|
127
|
+
"description": {
|
|
128
|
+
"en-GB": "Article",
|
|
129
|
+
"es-ES": "Artículo",
|
|
130
|
+
"ru-RU": "Артикул"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "barcode",
|
|
135
|
+
"type": "string|null",
|
|
136
|
+
"description": {
|
|
137
|
+
"en-GB": "Barcode",
|
|
138
|
+
"es-ES": "Código de barras",
|
|
139
|
+
"ru-RU": "Штрих-код"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "properties",
|
|
144
|
+
"type": "Array<Property>",
|
|
145
|
+
"description": {
|
|
146
|
+
"en-GB": "Array of custom properties",
|
|
147
|
+
"es-ES": "Matriz de propiedades personalizadas",
|
|
148
|
+
"ru-RU": "Массив пользовательских свойств"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "unit",
|
|
153
|
+
"type": "string|null",
|
|
154
|
+
"description": {
|
|
155
|
+
"en-GB": "Unit of quantity measurement, if not specified (null), will be set to \"pcs.\"",
|
|
156
|
+
"es-ES": "Unidad de medida de cantidad, si no se especifica (null), se establecerá en \"pcs.\"",
|
|
157
|
+
"ru-RU": "Единица измерения количества, если не указана (null), будет указано \"шт.\""
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "purchasePrice",
|
|
162
|
+
"type": "Money|null",
|
|
163
|
+
"description": {
|
|
164
|
+
"en-GB": "Purchase price, value + currency",
|
|
165
|
+
"es-ES": "Precio de compra, valor + moneda",
|
|
166
|
+
"ru-RU": "Закупочная цена, значение + валюта"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
76
171
|
{
|
|
77
172
|
"name": "PriceType",
|
|
78
173
|
"fields": [
|
|
@@ -282,101 +377,6 @@
|
|
|
282
377
|
}
|
|
283
378
|
]
|
|
284
379
|
},
|
|
285
|
-
{
|
|
286
|
-
"name": "Offer",
|
|
287
|
-
"fields": [
|
|
288
|
-
{
|
|
289
|
-
"name": "id",
|
|
290
|
-
"type": "number",
|
|
291
|
-
"description": {
|
|
292
|
-
"en-GB": "ID",
|
|
293
|
-
"es-ES": "ID",
|
|
294
|
-
"ru-RU": "Идентификатор"
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
"name": "name",
|
|
299
|
-
"type": "string",
|
|
300
|
-
"description": {
|
|
301
|
-
"en-GB": "Name",
|
|
302
|
-
"es-ES": "Nombre",
|
|
303
|
-
"ru-RU": "Наименование"
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
"name": "image",
|
|
308
|
-
"type": "string|null",
|
|
309
|
-
"description": {
|
|
310
|
-
"en-GB": "Image URL",
|
|
311
|
-
"es-ES": "URL de la imagen",
|
|
312
|
-
"ru-RU": "URL изображения"
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
"name": "dimensions",
|
|
317
|
-
"type": "Dimensions",
|
|
318
|
-
"description": {
|
|
319
|
-
"en-GB": "Product dimensions L - length, W - width, H - height",
|
|
320
|
-
"es-ES": "Dimensiones del producto L - longitud, W - ancho, H - altura",
|
|
321
|
-
"ru-RU": "Размеры товара L - длина, W - ширина, H - высота"
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
"name": "weight",
|
|
326
|
-
"type": "Weight|null",
|
|
327
|
-
"description": {
|
|
328
|
-
"en-GB": "Weight",
|
|
329
|
-
"es-ES": "Peso",
|
|
330
|
-
"ru-RU": "Вес"
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
"name": "article",
|
|
335
|
-
"type": "string|null",
|
|
336
|
-
"description": {
|
|
337
|
-
"en-GB": "Article",
|
|
338
|
-
"es-ES": "Artículo",
|
|
339
|
-
"ru-RU": "Артикул"
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
"name": "barcode",
|
|
344
|
-
"type": "string|null",
|
|
345
|
-
"description": {
|
|
346
|
-
"en-GB": "Barcode",
|
|
347
|
-
"es-ES": "Código de barras",
|
|
348
|
-
"ru-RU": "Штрих-код"
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
"name": "properties",
|
|
353
|
-
"type": "Array<Property>",
|
|
354
|
-
"description": {
|
|
355
|
-
"en-GB": "Array of custom properties",
|
|
356
|
-
"es-ES": "Matriz de propiedades personalizadas",
|
|
357
|
-
"ru-RU": "Массив пользовательских свойств"
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
"name": "unit",
|
|
362
|
-
"type": "string|null",
|
|
363
|
-
"description": {
|
|
364
|
-
"en-GB": "Unit of quantity measurement, if not specified (null), will be set to \"pcs.\"",
|
|
365
|
-
"es-ES": "Unidad de medida de cantidad, si no se especifica (null), se establecerá en \"pcs.\"",
|
|
366
|
-
"ru-RU": "Единица измерения количества, если не указана (null), будет указано \"шт.\""
|
|
367
|
-
}
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
"name": "purchasePrice",
|
|
371
|
-
"type": "Money|null",
|
|
372
|
-
"description": {
|
|
373
|
-
"en-GB": "Purchase price, value + currency",
|
|
374
|
-
"es-ES": "Precio de compra, valor + moneda",
|
|
375
|
-
"ru-RU": "Закупочная цена, значение + валюта"
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
]
|
|
379
|
-
},
|
|
380
380
|
{
|
|
381
381
|
"name": "OrderItem",
|
|
382
382
|
"fields": [
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PredicateWithMeta, Predicate } from '..';
|
|
2
|
+
export declare const isProductType: PredicateWithMeta<"PRODUCT" | "SERVICE">;
|
|
2
3
|
export declare const isDimensions: Predicate<{
|
|
3
4
|
L: number | null;
|
|
4
5
|
W: number | null;
|
|
@@ -17,21 +18,6 @@ export declare const isDimensions: Predicate<{
|
|
|
17
18
|
H: [ PredicateWithMeta<number | null>, true];
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
|
-
export declare const isMoney: Predicate<{
|
|
21
|
-
amount: number;
|
|
22
|
-
currency: string;
|
|
23
|
-
}> & {
|
|
24
|
-
type: string;
|
|
25
|
-
} & {
|
|
26
|
-
readonly fields: {
|
|
27
|
-
amount: string;
|
|
28
|
-
currency: string;
|
|
29
|
-
};
|
|
30
|
-
readonly shape: {
|
|
31
|
-
amount: [ PredicateWithMeta<number>, true];
|
|
32
|
-
currency: [ PredicateWithMeta<string>, true];
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
21
|
export declare const isWeightUnit: PredicateWithMeta<"grams" | "kilograms" | "tons">;
|
|
36
22
|
export declare const isWeight: Predicate<{
|
|
37
23
|
value: number;
|
|
@@ -66,20 +52,19 @@ export declare const isProperty: Predicate<{
|
|
|
66
52
|
value: [ PredicateWithMeta<string>, true];
|
|
67
53
|
};
|
|
68
54
|
};
|
|
69
|
-
export declare const
|
|
70
|
-
export declare const isDiscount: Predicate<{
|
|
71
|
-
type: "bonus_charge" | "loyalty_event" | "loyalty_level" | "manual_order" | "manual_product" | "personal" | "round";
|
|
55
|
+
export declare const isMoney: Predicate<{
|
|
72
56
|
amount: number;
|
|
57
|
+
currency: string;
|
|
73
58
|
}> & {
|
|
74
59
|
type: string;
|
|
75
60
|
} & {
|
|
76
61
|
readonly fields: {
|
|
77
|
-
type: string;
|
|
78
62
|
amount: string;
|
|
63
|
+
currency: string;
|
|
79
64
|
};
|
|
80
65
|
readonly shape: {
|
|
81
|
-
type: [ PredicateWithMeta<"bonus_charge" | "loyalty_event" | "loyalty_level" | "manual_order" | "manual_product" | "personal" | "round">, true];
|
|
82
66
|
amount: [ PredicateWithMeta<number>, true];
|
|
67
|
+
currency: [ PredicateWithMeta<string>, true];
|
|
83
68
|
};
|
|
84
69
|
};
|
|
85
70
|
export declare const isOffer: Predicate<{
|
|
@@ -162,34 +147,6 @@ export declare const isOffer: Predicate<{
|
|
|
162
147
|
} | null>, true];
|
|
163
148
|
};
|
|
164
149
|
};
|
|
165
|
-
export declare const isPriceType: Predicate<{
|
|
166
|
-
id: number;
|
|
167
|
-
code: string;
|
|
168
|
-
name: string;
|
|
169
|
-
title: string;
|
|
170
|
-
default: boolean;
|
|
171
|
-
currency: string;
|
|
172
|
-
}> & {
|
|
173
|
-
type: string;
|
|
174
|
-
} & {
|
|
175
|
-
readonly fields: {
|
|
176
|
-
id: string;
|
|
177
|
-
code: string;
|
|
178
|
-
name: string;
|
|
179
|
-
title: string;
|
|
180
|
-
default: string;
|
|
181
|
-
currency: string;
|
|
182
|
-
};
|
|
183
|
-
readonly shape: {
|
|
184
|
-
id: [ PredicateWithMeta<number>, true];
|
|
185
|
-
code: [ PredicateWithMeta<string>, true];
|
|
186
|
-
name: [ PredicateWithMeta<string>, true];
|
|
187
|
-
title: [ PredicateWithMeta<string>, true];
|
|
188
|
-
default: [ PredicateWithMeta<boolean>, true];
|
|
189
|
-
currency: [ PredicateWithMeta<string>, true];
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
export declare const isProductType: PredicateWithMeta<"PRODUCT" | "SERVICE">;
|
|
193
150
|
export declare const isProductGroup: Predicate<{
|
|
194
151
|
id: number;
|
|
195
152
|
name: string;
|
|
@@ -250,11 +207,54 @@ export declare const isProduct: Predicate<{
|
|
|
250
207
|
url: [ PredicateWithMeta<string | null>, true];
|
|
251
208
|
};
|
|
252
209
|
};
|
|
210
|
+
export declare const isPriceType: Predicate<{
|
|
211
|
+
id: number;
|
|
212
|
+
code: string;
|
|
213
|
+
name: string;
|
|
214
|
+
title: string;
|
|
215
|
+
default: boolean;
|
|
216
|
+
currency: string;
|
|
217
|
+
}> & {
|
|
218
|
+
type: string;
|
|
219
|
+
} & {
|
|
220
|
+
readonly fields: {
|
|
221
|
+
id: string;
|
|
222
|
+
code: string;
|
|
223
|
+
name: string;
|
|
224
|
+
title: string;
|
|
225
|
+
default: string;
|
|
226
|
+
currency: string;
|
|
227
|
+
};
|
|
228
|
+
readonly shape: {
|
|
229
|
+
id: [ PredicateWithMeta<number>, true];
|
|
230
|
+
code: [ PredicateWithMeta<string>, true];
|
|
231
|
+
name: [ PredicateWithMeta<string>, true];
|
|
232
|
+
title: [ PredicateWithMeta<string>, true];
|
|
233
|
+
default: [ PredicateWithMeta<boolean>, true];
|
|
234
|
+
currency: [ PredicateWithMeta<string>, true];
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
export declare const isDiscountType: PredicateWithMeta<"bonus_charge" | "loyalty_event" | "loyalty_level" | "manual_order" | "manual_product" | "personal" | "round">;
|
|
238
|
+
export declare const isDiscount: Predicate<{
|
|
239
|
+
type: "bonus_charge" | "loyalty_event" | "loyalty_level" | "manual_order" | "manual_product" | "personal" | "round";
|
|
240
|
+
amount: number;
|
|
241
|
+
}> & {
|
|
242
|
+
type: string;
|
|
243
|
+
} & {
|
|
244
|
+
readonly fields: {
|
|
245
|
+
type: string;
|
|
246
|
+
amount: string;
|
|
247
|
+
};
|
|
248
|
+
readonly shape: {
|
|
249
|
+
type: [ PredicateWithMeta<"bonus_charge" | "loyalty_event" | "loyalty_level" | "manual_order" | "manual_product" | "personal" | "round">, true];
|
|
250
|
+
amount: [ PredicateWithMeta<number>, true];
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
253
|
export declare const isStatus: Predicate<{
|
|
254
254
|
id: number;
|
|
255
255
|
code: string;
|
|
256
256
|
name: string;
|
|
257
|
-
isCancel: boolean
|
|
257
|
+
isCancel: boolean;
|
|
258
258
|
}> & {
|
|
259
259
|
type: string;
|
|
260
260
|
} & {
|
|
@@ -268,7 +268,7 @@ export declare const isStatus: Predicate<{
|
|
|
268
268
|
id: [ PredicateWithMeta<number>, true];
|
|
269
269
|
code: [ PredicateWithMeta<string>, true];
|
|
270
270
|
name: [ PredicateWithMeta<string>, true];
|
|
271
|
-
isCancel: [ PredicateWithMeta<boolean>,
|
|
271
|
+
isCancel: [ PredicateWithMeta<boolean>, true];
|
|
272
272
|
};
|
|
273
273
|
};
|
|
274
274
|
export declare const isItem: Predicate<{
|
|
@@ -352,7 +352,7 @@ export declare const isItem: Predicate<{
|
|
|
352
352
|
id: number;
|
|
353
353
|
code: string;
|
|
354
354
|
name: string;
|
|
355
|
-
isCancel: boolean
|
|
355
|
+
isCancel: boolean;
|
|
356
356
|
} | null;
|
|
357
357
|
}> & {
|
|
358
358
|
type: string;
|
|
@@ -458,7 +458,7 @@ export declare const isItem: Predicate<{
|
|
|
458
458
|
id: number;
|
|
459
459
|
code: string;
|
|
460
460
|
name: string;
|
|
461
|
-
isCancel: boolean
|
|
461
|
+
isCancel: boolean;
|
|
462
462
|
} | null>, true];
|
|
463
463
|
};
|
|
464
464
|
};
|
package/dist/predicates.es.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const remote = require("../../remote.cjs");
|
|
4
4
|
const predicates = require("../../predicates.cjs.js");
|
|
5
|
+
const isProductType = predicates.oneOf(
|
|
6
|
+
predicates.isExactly("PRODUCT"),
|
|
7
|
+
predicates.isExactly("SERVICE")
|
|
8
|
+
);
|
|
5
9
|
const isDimensions = predicates.isShape({
|
|
6
10
|
L: [predicates.oneOf(predicates.isNumber, predicates.isNull), true],
|
|
7
11
|
W: [predicates.oneOf(predicates.isNumber, predicates.isNull), true],
|
|
8
12
|
H: [predicates.oneOf(predicates.isNumber, predicates.isNull), true]
|
|
9
13
|
}, "Dimensions");
|
|
10
|
-
const isMoney = predicates.isShape({
|
|
11
|
-
amount: [predicates.isNumber, true],
|
|
12
|
-
currency: [predicates.isString, true]
|
|
13
|
-
}, "Money");
|
|
14
14
|
const isWeightUnit = predicates.oneOf(
|
|
15
15
|
predicates.isExactly("grams"),
|
|
16
16
|
predicates.isExactly("kilograms"),
|
|
@@ -25,19 +25,10 @@ const isProperty = predicates.isShape({
|
|
|
25
25
|
name: [predicates.isString, true],
|
|
26
26
|
value: [predicates.isString, true]
|
|
27
27
|
}, "Property");
|
|
28
|
-
const
|
|
29
|
-
predicates.
|
|
30
|
-
predicates.
|
|
31
|
-
|
|
32
|
-
predicates.isExactly("manual_order"),
|
|
33
|
-
predicates.isExactly("manual_product"),
|
|
34
|
-
predicates.isExactly("personal"),
|
|
35
|
-
predicates.isExactly("round")
|
|
36
|
-
);
|
|
37
|
-
const isDiscount = predicates.isShape({
|
|
38
|
-
type: [isDiscountType, true],
|
|
39
|
-
amount: [predicates.isNumber, true]
|
|
40
|
-
}, "Discount");
|
|
28
|
+
const isMoney = predicates.isShape({
|
|
29
|
+
amount: [predicates.isNumber, true],
|
|
30
|
+
currency: [predicates.isString, true]
|
|
31
|
+
}, "Money");
|
|
41
32
|
const isOffer = predicates.isShape({
|
|
42
33
|
id: [predicates.isNumber, true],
|
|
43
34
|
name: [predicates.isString, true],
|
|
@@ -50,18 +41,6 @@ const isOffer = predicates.isShape({
|
|
|
50
41
|
unit: [predicates.oneOf(predicates.isString, predicates.isNull), true],
|
|
51
42
|
purchasePrice: [predicates.oneOf(isMoney, predicates.isNull), true]
|
|
52
43
|
}, "Offer");
|
|
53
|
-
const isPriceType = predicates.isShape({
|
|
54
|
-
id: [predicates.isNumber, true],
|
|
55
|
-
code: [predicates.isString, true],
|
|
56
|
-
name: [predicates.isString, true],
|
|
57
|
-
title: [predicates.isString, true],
|
|
58
|
-
default: [predicates.isBoolean, true],
|
|
59
|
-
currency: [predicates.isString, true]
|
|
60
|
-
}, "PriceType");
|
|
61
|
-
const isProductType = predicates.oneOf(
|
|
62
|
-
predicates.isExactly("PRODUCT"),
|
|
63
|
-
predicates.isExactly("SERVICE")
|
|
64
|
-
);
|
|
65
44
|
const isProductGroup = predicates.isShape({
|
|
66
45
|
id: [predicates.isNumber, true],
|
|
67
46
|
name: [predicates.isString, true]
|
|
@@ -78,11 +57,32 @@ const isProduct = predicates.isShape({
|
|
|
78
57
|
unit: [predicates.oneOf(predicates.isString, predicates.isNull), true],
|
|
79
58
|
url: [predicates.oneOf(predicates.isString, predicates.isNull), true]
|
|
80
59
|
}, "Product");
|
|
60
|
+
const isPriceType = predicates.isShape({
|
|
61
|
+
id: [predicates.isNumber, true],
|
|
62
|
+
code: [predicates.isString, true],
|
|
63
|
+
name: [predicates.isString, true],
|
|
64
|
+
title: [predicates.isString, true],
|
|
65
|
+
default: [predicates.isBoolean, true],
|
|
66
|
+
currency: [predicates.isString, true]
|
|
67
|
+
}, "PriceType");
|
|
68
|
+
const isDiscountType = predicates.oneOf(
|
|
69
|
+
predicates.isExactly("bonus_charge"),
|
|
70
|
+
predicates.isExactly("loyalty_event"),
|
|
71
|
+
predicates.isExactly("loyalty_level"),
|
|
72
|
+
predicates.isExactly("manual_order"),
|
|
73
|
+
predicates.isExactly("manual_product"),
|
|
74
|
+
predicates.isExactly("personal"),
|
|
75
|
+
predicates.isExactly("round")
|
|
76
|
+
);
|
|
77
|
+
const isDiscount = predicates.isShape({
|
|
78
|
+
type: [isDiscountType, true],
|
|
79
|
+
amount: [predicates.isNumber, true]
|
|
80
|
+
}, "Discount");
|
|
81
81
|
const isStatus = predicates.isShape({
|
|
82
82
|
id: [predicates.isNumber, true],
|
|
83
83
|
code: [predicates.isString, true],
|
|
84
84
|
name: [predicates.isString, true],
|
|
85
|
-
isCancel: [predicates.isBoolean,
|
|
85
|
+
isCancel: [predicates.isBoolean, true]
|
|
86
86
|
}, "OrderItemStatus");
|
|
87
87
|
const isItem = predicates.isShape({
|
|
88
88
|
id: [predicates.oneOf(predicates.isNumber, predicates.isNull), true],
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineActions, defineContext } from "../../remote.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as oneOf, d as isExactly, e as isShape, c as isNumber, i as isString, a as arrayOf, f as isBoolean, b as isNull, g as isNumeric, h as cortegeOf, j as isVoid } from "../../predicates.es.js";
|
|
3
|
+
const isProductType = oneOf(
|
|
4
|
+
isExactly("PRODUCT"),
|
|
5
|
+
isExactly("SERVICE")
|
|
6
|
+
);
|
|
3
7
|
const isDimensions = isShape({
|
|
4
8
|
L: [oneOf(isNumber, isNull), true],
|
|
5
9
|
W: [oneOf(isNumber, isNull), true],
|
|
6
10
|
H: [oneOf(isNumber, isNull), true]
|
|
7
11
|
}, "Dimensions");
|
|
8
|
-
const isMoney = isShape({
|
|
9
|
-
amount: [isNumber, true],
|
|
10
|
-
currency: [isString, true]
|
|
11
|
-
}, "Money");
|
|
12
12
|
const isWeightUnit = oneOf(
|
|
13
13
|
isExactly("grams"),
|
|
14
14
|
isExactly("kilograms"),
|
|
@@ -23,19 +23,10 @@ const isProperty = isShape({
|
|
|
23
23
|
name: [isString, true],
|
|
24
24
|
value: [isString, true]
|
|
25
25
|
}, "Property");
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
isExactly("manual_order"),
|
|
31
|
-
isExactly("manual_product"),
|
|
32
|
-
isExactly("personal"),
|
|
33
|
-
isExactly("round")
|
|
34
|
-
);
|
|
35
|
-
const isDiscount = isShape({
|
|
36
|
-
type: [isDiscountType, true],
|
|
37
|
-
amount: [isNumber, true]
|
|
38
|
-
}, "Discount");
|
|
26
|
+
const isMoney = isShape({
|
|
27
|
+
amount: [isNumber, true],
|
|
28
|
+
currency: [isString, true]
|
|
29
|
+
}, "Money");
|
|
39
30
|
const isOffer = isShape({
|
|
40
31
|
id: [isNumber, true],
|
|
41
32
|
name: [isString, true],
|
|
@@ -48,18 +39,6 @@ const isOffer = isShape({
|
|
|
48
39
|
unit: [oneOf(isString, isNull), true],
|
|
49
40
|
purchasePrice: [oneOf(isMoney, isNull), true]
|
|
50
41
|
}, "Offer");
|
|
51
|
-
const isPriceType = isShape({
|
|
52
|
-
id: [isNumber, true],
|
|
53
|
-
code: [isString, true],
|
|
54
|
-
name: [isString, true],
|
|
55
|
-
title: [isString, true],
|
|
56
|
-
default: [isBoolean, true],
|
|
57
|
-
currency: [isString, true]
|
|
58
|
-
}, "PriceType");
|
|
59
|
-
const isProductType = oneOf(
|
|
60
|
-
isExactly("PRODUCT"),
|
|
61
|
-
isExactly("SERVICE")
|
|
62
|
-
);
|
|
63
42
|
const isProductGroup = isShape({
|
|
64
43
|
id: [isNumber, true],
|
|
65
44
|
name: [isString, true]
|
|
@@ -76,11 +55,32 @@ const isProduct = isShape({
|
|
|
76
55
|
unit: [oneOf(isString, isNull), true],
|
|
77
56
|
url: [oneOf(isString, isNull), true]
|
|
78
57
|
}, "Product");
|
|
58
|
+
const isPriceType = isShape({
|
|
59
|
+
id: [isNumber, true],
|
|
60
|
+
code: [isString, true],
|
|
61
|
+
name: [isString, true],
|
|
62
|
+
title: [isString, true],
|
|
63
|
+
default: [isBoolean, true],
|
|
64
|
+
currency: [isString, true]
|
|
65
|
+
}, "PriceType");
|
|
66
|
+
const isDiscountType = oneOf(
|
|
67
|
+
isExactly("bonus_charge"),
|
|
68
|
+
isExactly("loyalty_event"),
|
|
69
|
+
isExactly("loyalty_level"),
|
|
70
|
+
isExactly("manual_order"),
|
|
71
|
+
isExactly("manual_product"),
|
|
72
|
+
isExactly("personal"),
|
|
73
|
+
isExactly("round")
|
|
74
|
+
);
|
|
75
|
+
const isDiscount = isShape({
|
|
76
|
+
type: [isDiscountType, true],
|
|
77
|
+
amount: [isNumber, true]
|
|
78
|
+
}, "Discount");
|
|
79
79
|
const isStatus = isShape({
|
|
80
80
|
id: [isNumber, true],
|
|
81
81
|
code: [isString, true],
|
|
82
82
|
name: [isString, true],
|
|
83
|
-
isCancel: [isBoolean,
|
|
83
|
+
isCancel: [isBoolean, true]
|
|
84
84
|
}, "OrderItemStatus");
|
|
85
85
|
const isItem = isShape({
|
|
86
86
|
id: [oneOf(isNumber, isNull), true],
|
package/dist/remote/settings.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineContext } from "../remote.js";
|
|
2
|
-
import { a as arrayOf, o as oneOf, i as isString,
|
|
2
|
+
import { a as arrayOf, o as oneOf, i as isString, d as isExactly, w as withMeta, f as isBoolean, k as isObject, l as isArray } from "../predicates.es.js";
|
|
3
3
|
import { k as keysOf } from "../utilities.es.js";
|
|
4
4
|
const id = "settings";
|
|
5
5
|
const locales = ["en-GB", "es-ES", "ru-RU"];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@retailcrm/embed-ui-v1-contexts",
|
|
3
3
|
"description": "Reactive contexts for RetailCRM JS API",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.1-alpha.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "RetailDriverLLC <integration@retailcrm.ru>",
|
|
8
8
|
"repository": "git@github.com:retailcrm/embed-ui.git",
|
|
@@ -104,10 +104,10 @@
|
|
|
104
104
|
"@floating-ui/core": "^1.6.9",
|
|
105
105
|
"@floating-ui/dom": "^1.6.13",
|
|
106
106
|
"@omnicajs/symfony-router": "^1.0.0",
|
|
107
|
-
"@retailcrm/embed-ui-v1-types": "^0.9.
|
|
107
|
+
"@retailcrm/embed-ui-v1-types": "^0.9.1-alpha.2"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
|
-
"@retailcrm/embed-ui-v1-testing": "^0.9.
|
|
110
|
+
"@retailcrm/embed-ui-v1-testing": "^0.9.1-alpha.2",
|
|
111
111
|
"tsx": "^4.19.2",
|
|
112
112
|
"typescript": "^5.6.3",
|
|
113
113
|
"vite": "^5.4.11",
|
package/types/order/card.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Dimensions } from '@retailcrm/embed-ui-v1-types/domain'
|
|
2
1
|
import type { Money } from '@retailcrm/embed-ui-v1-types/domain'
|
|
2
|
+
import type { Dimensions } from '@retailcrm/embed-ui-v1-types/domain'
|
|
3
3
|
import type { Weight } from '@retailcrm/embed-ui-v1-types/domain'
|
|
4
4
|
|
|
5
5
|
import type { Field, ReadonlyField } from '@retailcrm/embed-ui-v1-types/context'
|
|
@@ -63,29 +63,6 @@ export type CreateOrderItemInput = {
|
|
|
63
63
|
quantity: number | undefined;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export type DiscountType =
|
|
67
|
-
| 'bonus_charge'
|
|
68
|
-
| 'loyalty_event'
|
|
69
|
-
| 'loyalty_level'
|
|
70
|
-
| 'manual_order'
|
|
71
|
-
| 'manual_product'
|
|
72
|
-
| 'personal'
|
|
73
|
-
| 'round'
|
|
74
|
-
|
|
75
|
-
export type Discount = {
|
|
76
|
-
type: DiscountType;
|
|
77
|
-
amount: number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export type PriceType = {
|
|
81
|
-
id: number;
|
|
82
|
-
code: string;
|
|
83
|
-
name: string;
|
|
84
|
-
title: string;
|
|
85
|
-
default: boolean;
|
|
86
|
-
currency: string;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
66
|
export type Property = {
|
|
90
67
|
code: string;
|
|
91
68
|
name: string;
|
|
@@ -105,6 +82,11 @@ export type Offer = {
|
|
|
105
82
|
purchasePrice: Money | null;
|
|
106
83
|
}
|
|
107
84
|
|
|
85
|
+
export type ProductGroup = {
|
|
86
|
+
id: number;
|
|
87
|
+
name: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
108
90
|
export type Product = {
|
|
109
91
|
id: number;
|
|
110
92
|
type: 'PRODUCT' | 'SERVICE';
|
|
@@ -118,9 +100,34 @@ export type Product = {
|
|
|
118
100
|
url: string | null;
|
|
119
101
|
}
|
|
120
102
|
|
|
121
|
-
export type
|
|
103
|
+
export type PriceType = {
|
|
122
104
|
id: number;
|
|
105
|
+
code: string;
|
|
123
106
|
name: string;
|
|
107
|
+
title: string;
|
|
108
|
+
default: boolean;
|
|
109
|
+
currency: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type DiscountType =
|
|
113
|
+
| 'bonus_charge'
|
|
114
|
+
| 'loyalty_event'
|
|
115
|
+
| 'loyalty_level'
|
|
116
|
+
| 'manual_order'
|
|
117
|
+
| 'manual_product'
|
|
118
|
+
| 'personal'
|
|
119
|
+
| 'round'
|
|
120
|
+
|
|
121
|
+
export type Discount = {
|
|
122
|
+
type: DiscountType;
|
|
123
|
+
amount: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type OrderItemStatus = {
|
|
127
|
+
id: number;
|
|
128
|
+
code: string;
|
|
129
|
+
name: string;
|
|
130
|
+
isCancel: boolean;
|
|
124
131
|
}
|
|
125
132
|
|
|
126
133
|
export type OrderItem = {
|
|
@@ -146,10 +153,3 @@ export type OrderItem = {
|
|
|
146
153
|
comment: string;
|
|
147
154
|
status: OrderItemStatus | null;
|
|
148
155
|
}
|
|
149
|
-
|
|
150
|
-
export type OrderItemStatus = {
|
|
151
|
-
id: number;
|
|
152
|
-
code: string;
|
|
153
|
-
name: string;
|
|
154
|
-
isCancel?: boolean;
|
|
155
|
-
}
|
|
File without changes
|