@retailcrm/embed-ui 0.3.7 → 0.4.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/CHANGELOG.md +13 -0
- package/dist/index.cjs +136 -11
- package/dist/index.mjs +136 -11
- package/dist/meta.json +265 -19
- package/package.json +1 -1
- package/types/context/index.d.ts +2 -0
- package/types/context/order/card.d.ts +20 -0
- package/types/context/user/current.d.ts +10 -0
- package/types/widget.d.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.4.0](https://github.com/retailcrm/embed-ui/compare/v0.3.7...v0.4.0) (2024-11-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* Удалены поля order.templates.number.api и
|
|
11
|
+
order.templates.number.crm из контекста settings
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* ref [#98287](https://github.com/retailcrm/embed-ui/issues/98287) Completed order/card with data ([23129cc](https://github.com/retailcrm/embed-ui/commit/23129cc47e8f4b84b5f357954b5fa4c4a501ea1b))
|
|
16
|
+
* ref [#98287](https://github.com/retailcrm/embed-ui/issues/98287) Контекст с данными о текущем пользователе ([a6cdb78](https://github.com/retailcrm/embed-ui/commit/a6cdb7872b0650bbda6bdac694cac2c30a4e4c55))
|
|
17
|
+
|
|
5
18
|
### [0.3.7](https://github.com/retailcrm/embed-ui/compare/v0.3.6...v0.3.7) (2024-11-25)
|
|
6
19
|
|
|
7
20
|
|
package/dist/index.cjs
CHANGED
|
@@ -71,6 +71,39 @@ const oneOf = (...predicates) => withMeta(
|
|
|
71
71
|
},
|
|
72
72
|
predicates.map((p) => p.type).join(" | ")
|
|
73
73
|
);
|
|
74
|
+
const schema$4 = {
|
|
75
|
+
"lastName": {
|
|
76
|
+
accepts: oneOf(isString, isNull),
|
|
77
|
+
defaults: () => null,
|
|
78
|
+
readonly: false
|
|
79
|
+
},
|
|
80
|
+
"firstName": {
|
|
81
|
+
accepts: oneOf(isString, isNull),
|
|
82
|
+
defaults: () => null,
|
|
83
|
+
readonly: false
|
|
84
|
+
},
|
|
85
|
+
"patronymic": {
|
|
86
|
+
accepts: oneOf(isString, isNull),
|
|
87
|
+
defaults: () => null,
|
|
88
|
+
readonly: false
|
|
89
|
+
},
|
|
90
|
+
"email": {
|
|
91
|
+
accepts: isString,
|
|
92
|
+
defaults: () => "",
|
|
93
|
+
readonly: true
|
|
94
|
+
},
|
|
95
|
+
"id": {
|
|
96
|
+
accepts: oneOf(isNumber, isNull),
|
|
97
|
+
defaults: () => null,
|
|
98
|
+
readonly: true
|
|
99
|
+
},
|
|
100
|
+
"permissions": {
|
|
101
|
+
accepts: arrayOf(isString),
|
|
102
|
+
defaults: () => [],
|
|
103
|
+
readonly: true
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const useContext$4 = defineContext("user/current", schema$4);
|
|
74
107
|
const schema$3 = {
|
|
75
108
|
"id": {
|
|
76
109
|
accepts: oneOf(isNumber, isNull),
|
|
@@ -108,7 +141,37 @@ const schema$2 = {
|
|
|
108
141
|
};
|
|
109
142
|
const useContext$2 = defineContext("customer/card:phone", schema$2);
|
|
110
143
|
const schema$1 = {
|
|
111
|
-
"
|
|
144
|
+
"id": {
|
|
145
|
+
accepts: oneOf(isNumber, isNull),
|
|
146
|
+
defaults: () => null,
|
|
147
|
+
readonly: true
|
|
148
|
+
},
|
|
149
|
+
"externalId": {
|
|
150
|
+
accepts: oneOf(isString, isNull),
|
|
151
|
+
defaults: () => null,
|
|
152
|
+
readonly: true
|
|
153
|
+
},
|
|
154
|
+
"number": {
|
|
155
|
+
accepts: oneOf(isString, isNull),
|
|
156
|
+
defaults: () => null,
|
|
157
|
+
readonly: true
|
|
158
|
+
},
|
|
159
|
+
"customer.type": {
|
|
160
|
+
accepts: oneOf(isNumber, isNull),
|
|
161
|
+
defaults: () => null,
|
|
162
|
+
readonly: false
|
|
163
|
+
},
|
|
164
|
+
"customer.lastName": {
|
|
165
|
+
accepts: oneOf(isString, isNull),
|
|
166
|
+
defaults: () => null,
|
|
167
|
+
readonly: false
|
|
168
|
+
},
|
|
169
|
+
"customer.firstName": {
|
|
170
|
+
accepts: oneOf(isString, isNull),
|
|
171
|
+
defaults: () => null,
|
|
172
|
+
readonly: false
|
|
173
|
+
},
|
|
174
|
+
"customer.patronymic": {
|
|
112
175
|
accepts: oneOf(isString, isNull),
|
|
113
176
|
defaults: () => null,
|
|
114
177
|
readonly: false
|
|
@@ -118,6 +181,76 @@ const schema$1 = {
|
|
|
118
181
|
defaults: () => null,
|
|
119
182
|
readonly: false
|
|
120
183
|
},
|
|
184
|
+
"customer.email": {
|
|
185
|
+
accepts: oneOf(isString, isNull),
|
|
186
|
+
defaults: () => null,
|
|
187
|
+
readonly: false
|
|
188
|
+
},
|
|
189
|
+
"country": {
|
|
190
|
+
accepts: oneOf(isString, isNull),
|
|
191
|
+
defaults: () => null,
|
|
192
|
+
readonly: true
|
|
193
|
+
},
|
|
194
|
+
"currency": {
|
|
195
|
+
accepts: isString,
|
|
196
|
+
defaults: () => "",
|
|
197
|
+
readonly: true
|
|
198
|
+
},
|
|
199
|
+
"status": {
|
|
200
|
+
accepts: isString,
|
|
201
|
+
defaults: () => "",
|
|
202
|
+
readonly: true
|
|
203
|
+
},
|
|
204
|
+
"company.name": {
|
|
205
|
+
accepts: oneOf(isString, isNull),
|
|
206
|
+
defaults: () => null,
|
|
207
|
+
readonly: false
|
|
208
|
+
},
|
|
209
|
+
"company.legalName": {
|
|
210
|
+
accepts: oneOf(isString, isNull),
|
|
211
|
+
defaults: () => null,
|
|
212
|
+
readonly: false
|
|
213
|
+
},
|
|
214
|
+
"company.legalAddress": {
|
|
215
|
+
accepts: oneOf(isString, isNull),
|
|
216
|
+
defaults: () => null,
|
|
217
|
+
readonly: false
|
|
218
|
+
},
|
|
219
|
+
"company.INN": {
|
|
220
|
+
accepts: oneOf(isString, isNull),
|
|
221
|
+
defaults: () => null,
|
|
222
|
+
readonly: false
|
|
223
|
+
},
|
|
224
|
+
"company.OKPO": {
|
|
225
|
+
accepts: oneOf(isString, isNull),
|
|
226
|
+
defaults: () => null,
|
|
227
|
+
readonly: false
|
|
228
|
+
},
|
|
229
|
+
"company.BIK": {
|
|
230
|
+
accepts: oneOf(isString, isNull),
|
|
231
|
+
defaults: () => null,
|
|
232
|
+
readonly: false
|
|
233
|
+
},
|
|
234
|
+
"company.bank": {
|
|
235
|
+
accepts: oneOf(isString, isNull),
|
|
236
|
+
defaults: () => null,
|
|
237
|
+
readonly: false
|
|
238
|
+
},
|
|
239
|
+
"company.bankAddress": {
|
|
240
|
+
accepts: oneOf(isString, isNull),
|
|
241
|
+
defaults: () => null,
|
|
242
|
+
readonly: false
|
|
243
|
+
},
|
|
244
|
+
"company.corrAccount": {
|
|
245
|
+
accepts: oneOf(isString, isNull),
|
|
246
|
+
defaults: () => null,
|
|
247
|
+
readonly: false
|
|
248
|
+
},
|
|
249
|
+
"company.bankAccount": {
|
|
250
|
+
accepts: oneOf(isString, isNull),
|
|
251
|
+
defaults: () => null,
|
|
252
|
+
readonly: false
|
|
253
|
+
},
|
|
121
254
|
"delivery.address": {
|
|
122
255
|
accepts: oneOf(isString, isNull),
|
|
123
256
|
defaults: () => null,
|
|
@@ -131,16 +264,6 @@ const isLocale = withMeta(
|
|
|
131
264
|
locales.map((l) => `'${l}'`).join(" | ")
|
|
132
265
|
);
|
|
133
266
|
const schema = {
|
|
134
|
-
"order.templates.number.api": {
|
|
135
|
-
accepts: isString,
|
|
136
|
-
defaults: () => "",
|
|
137
|
-
readonly: true
|
|
138
|
-
},
|
|
139
|
-
"order.templates.number.crm": {
|
|
140
|
-
accepts: isString,
|
|
141
|
-
defaults: () => "",
|
|
142
|
-
readonly: true
|
|
143
|
-
},
|
|
144
267
|
"system.locale": {
|
|
145
268
|
accepts: isLocale,
|
|
146
269
|
defaults: () => "en-GB",
|
|
@@ -216,10 +339,12 @@ const createWidgetEndpoint = (widget, messenger) => {
|
|
|
216
339
|
return endpoint;
|
|
217
340
|
};
|
|
218
341
|
exports.createWidgetEndpoint = createWidgetEndpoint;
|
|
342
|
+
exports.currentUserSchema = schema$4;
|
|
219
343
|
exports.customerCardPhoneSchema = schema$2;
|
|
220
344
|
exports.customerCardSchema = schema$3;
|
|
221
345
|
exports.orderCardSchema = schema$1;
|
|
222
346
|
exports.settingsSchema = schema;
|
|
347
|
+
exports.useCurrentUserContext = useContext$4;
|
|
223
348
|
exports.useCustomerCardContext = useContext$3;
|
|
224
349
|
exports.useCustomerCardPhoneContext = useContext$2;
|
|
225
350
|
exports.useField = useField;
|
package/dist/index.mjs
CHANGED
|
@@ -69,6 +69,39 @@ const oneOf = (...predicates) => withMeta(
|
|
|
69
69
|
},
|
|
70
70
|
predicates.map((p) => p.type).join(" | ")
|
|
71
71
|
);
|
|
72
|
+
const schema$4 = {
|
|
73
|
+
"lastName": {
|
|
74
|
+
accepts: oneOf(isString, isNull),
|
|
75
|
+
defaults: () => null,
|
|
76
|
+
readonly: false
|
|
77
|
+
},
|
|
78
|
+
"firstName": {
|
|
79
|
+
accepts: oneOf(isString, isNull),
|
|
80
|
+
defaults: () => null,
|
|
81
|
+
readonly: false
|
|
82
|
+
},
|
|
83
|
+
"patronymic": {
|
|
84
|
+
accepts: oneOf(isString, isNull),
|
|
85
|
+
defaults: () => null,
|
|
86
|
+
readonly: false
|
|
87
|
+
},
|
|
88
|
+
"email": {
|
|
89
|
+
accepts: isString,
|
|
90
|
+
defaults: () => "",
|
|
91
|
+
readonly: true
|
|
92
|
+
},
|
|
93
|
+
"id": {
|
|
94
|
+
accepts: oneOf(isNumber, isNull),
|
|
95
|
+
defaults: () => null,
|
|
96
|
+
readonly: true
|
|
97
|
+
},
|
|
98
|
+
"permissions": {
|
|
99
|
+
accepts: arrayOf(isString),
|
|
100
|
+
defaults: () => [],
|
|
101
|
+
readonly: true
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const useContext$4 = defineContext("user/current", schema$4);
|
|
72
105
|
const schema$3 = {
|
|
73
106
|
"id": {
|
|
74
107
|
accepts: oneOf(isNumber, isNull),
|
|
@@ -106,7 +139,37 @@ const schema$2 = {
|
|
|
106
139
|
};
|
|
107
140
|
const useContext$2 = defineContext("customer/card:phone", schema$2);
|
|
108
141
|
const schema$1 = {
|
|
109
|
-
"
|
|
142
|
+
"id": {
|
|
143
|
+
accepts: oneOf(isNumber, isNull),
|
|
144
|
+
defaults: () => null,
|
|
145
|
+
readonly: true
|
|
146
|
+
},
|
|
147
|
+
"externalId": {
|
|
148
|
+
accepts: oneOf(isString, isNull),
|
|
149
|
+
defaults: () => null,
|
|
150
|
+
readonly: true
|
|
151
|
+
},
|
|
152
|
+
"number": {
|
|
153
|
+
accepts: oneOf(isString, isNull),
|
|
154
|
+
defaults: () => null,
|
|
155
|
+
readonly: true
|
|
156
|
+
},
|
|
157
|
+
"customer.type": {
|
|
158
|
+
accepts: oneOf(isNumber, isNull),
|
|
159
|
+
defaults: () => null,
|
|
160
|
+
readonly: false
|
|
161
|
+
},
|
|
162
|
+
"customer.lastName": {
|
|
163
|
+
accepts: oneOf(isString, isNull),
|
|
164
|
+
defaults: () => null,
|
|
165
|
+
readonly: false
|
|
166
|
+
},
|
|
167
|
+
"customer.firstName": {
|
|
168
|
+
accepts: oneOf(isString, isNull),
|
|
169
|
+
defaults: () => null,
|
|
170
|
+
readonly: false
|
|
171
|
+
},
|
|
172
|
+
"customer.patronymic": {
|
|
110
173
|
accepts: oneOf(isString, isNull),
|
|
111
174
|
defaults: () => null,
|
|
112
175
|
readonly: false
|
|
@@ -116,6 +179,76 @@ const schema$1 = {
|
|
|
116
179
|
defaults: () => null,
|
|
117
180
|
readonly: false
|
|
118
181
|
},
|
|
182
|
+
"customer.email": {
|
|
183
|
+
accepts: oneOf(isString, isNull),
|
|
184
|
+
defaults: () => null,
|
|
185
|
+
readonly: false
|
|
186
|
+
},
|
|
187
|
+
"country": {
|
|
188
|
+
accepts: oneOf(isString, isNull),
|
|
189
|
+
defaults: () => null,
|
|
190
|
+
readonly: true
|
|
191
|
+
},
|
|
192
|
+
"currency": {
|
|
193
|
+
accepts: isString,
|
|
194
|
+
defaults: () => "",
|
|
195
|
+
readonly: true
|
|
196
|
+
},
|
|
197
|
+
"status": {
|
|
198
|
+
accepts: isString,
|
|
199
|
+
defaults: () => "",
|
|
200
|
+
readonly: true
|
|
201
|
+
},
|
|
202
|
+
"company.name": {
|
|
203
|
+
accepts: oneOf(isString, isNull),
|
|
204
|
+
defaults: () => null,
|
|
205
|
+
readonly: false
|
|
206
|
+
},
|
|
207
|
+
"company.legalName": {
|
|
208
|
+
accepts: oneOf(isString, isNull),
|
|
209
|
+
defaults: () => null,
|
|
210
|
+
readonly: false
|
|
211
|
+
},
|
|
212
|
+
"company.legalAddress": {
|
|
213
|
+
accepts: oneOf(isString, isNull),
|
|
214
|
+
defaults: () => null,
|
|
215
|
+
readonly: false
|
|
216
|
+
},
|
|
217
|
+
"company.INN": {
|
|
218
|
+
accepts: oneOf(isString, isNull),
|
|
219
|
+
defaults: () => null,
|
|
220
|
+
readonly: false
|
|
221
|
+
},
|
|
222
|
+
"company.OKPO": {
|
|
223
|
+
accepts: oneOf(isString, isNull),
|
|
224
|
+
defaults: () => null,
|
|
225
|
+
readonly: false
|
|
226
|
+
},
|
|
227
|
+
"company.BIK": {
|
|
228
|
+
accepts: oneOf(isString, isNull),
|
|
229
|
+
defaults: () => null,
|
|
230
|
+
readonly: false
|
|
231
|
+
},
|
|
232
|
+
"company.bank": {
|
|
233
|
+
accepts: oneOf(isString, isNull),
|
|
234
|
+
defaults: () => null,
|
|
235
|
+
readonly: false
|
|
236
|
+
},
|
|
237
|
+
"company.bankAddress": {
|
|
238
|
+
accepts: oneOf(isString, isNull),
|
|
239
|
+
defaults: () => null,
|
|
240
|
+
readonly: false
|
|
241
|
+
},
|
|
242
|
+
"company.corrAccount": {
|
|
243
|
+
accepts: oneOf(isString, isNull),
|
|
244
|
+
defaults: () => null,
|
|
245
|
+
readonly: false
|
|
246
|
+
},
|
|
247
|
+
"company.bankAccount": {
|
|
248
|
+
accepts: oneOf(isString, isNull),
|
|
249
|
+
defaults: () => null,
|
|
250
|
+
readonly: false
|
|
251
|
+
},
|
|
119
252
|
"delivery.address": {
|
|
120
253
|
accepts: oneOf(isString, isNull),
|
|
121
254
|
defaults: () => null,
|
|
@@ -129,16 +262,6 @@ const isLocale = withMeta(
|
|
|
129
262
|
locales.map((l) => `'${l}'`).join(" | ")
|
|
130
263
|
);
|
|
131
264
|
const schema = {
|
|
132
|
-
"order.templates.number.api": {
|
|
133
|
-
accepts: isString,
|
|
134
|
-
defaults: () => "",
|
|
135
|
-
readonly: true
|
|
136
|
-
},
|
|
137
|
-
"order.templates.number.crm": {
|
|
138
|
-
accepts: isString,
|
|
139
|
-
defaults: () => "",
|
|
140
|
-
readonly: true
|
|
141
|
-
},
|
|
142
265
|
"system.locale": {
|
|
143
266
|
accepts: isLocale,
|
|
144
267
|
defaults: () => "en-GB",
|
|
@@ -215,10 +338,12 @@ const createWidgetEndpoint = (widget, messenger) => {
|
|
|
215
338
|
};
|
|
216
339
|
export {
|
|
217
340
|
createWidgetEndpoint,
|
|
341
|
+
schema$4 as currentUserSchema,
|
|
218
342
|
schema$2 as customerCardPhoneSchema,
|
|
219
343
|
schema$3 as customerCardSchema,
|
|
220
344
|
schema$1 as orderCardSchema,
|
|
221
345
|
schema as settingsSchema,
|
|
346
|
+
useContext$4 as useCurrentUserContext,
|
|
222
347
|
useContext$3 as useCustomerCardContext,
|
|
223
348
|
useContext$2 as useCustomerCardPhoneContext,
|
|
224
349
|
useField,
|
package/dist/meta.json
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contexts": {
|
|
3
|
+
"user/current": [
|
|
4
|
+
{
|
|
5
|
+
"name": "lastName",
|
|
6
|
+
"type": "string | null",
|
|
7
|
+
"description": {
|
|
8
|
+
"en-GB": "User last name",
|
|
9
|
+
"es-ES": "Apellido del usuario",
|
|
10
|
+
"ru-RU": "Фамилия пользователя"
|
|
11
|
+
},
|
|
12
|
+
"readonly": false
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "firstName",
|
|
16
|
+
"type": "string | null",
|
|
17
|
+
"description": {
|
|
18
|
+
"en-GB": "User name",
|
|
19
|
+
"es-ES": "Nombre del usuario",
|
|
20
|
+
"ru-RU": "Имя пользователя"
|
|
21
|
+
},
|
|
22
|
+
"readonly": false
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "patronymic",
|
|
26
|
+
"type": "string | null",
|
|
27
|
+
"description": {
|
|
28
|
+
"en-GB": "Patronymic of the user",
|
|
29
|
+
"es-ES": "Patronímico del usuario",
|
|
30
|
+
"ru-RU": "Отчество пользователя"
|
|
31
|
+
},
|
|
32
|
+
"readonly": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "email",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": {
|
|
38
|
+
"en-GB": "User email",
|
|
39
|
+
"es-ES": "Correo electrónico del usuario",
|
|
40
|
+
"ru-RU": "Email пользователя"
|
|
41
|
+
},
|
|
42
|
+
"readonly": true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "id",
|
|
46
|
+
"type": "number | null",
|
|
47
|
+
"description": {
|
|
48
|
+
"en-GB": "User ID",
|
|
49
|
+
"es-ES": "ID del usuario",
|
|
50
|
+
"ru-RU": "ID пользователя"
|
|
51
|
+
},
|
|
52
|
+
"readonly": true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "permissions",
|
|
56
|
+
"type": "Array<string>",
|
|
57
|
+
"description": {
|
|
58
|
+
"en-GB": "Character codes of available user permissions",
|
|
59
|
+
"es-ES": "Códigos de caracteres de los permisos disponibles para el usuario",
|
|
60
|
+
"ru-RU": "Символьные коды доступных пользователю разрешений"
|
|
61
|
+
},
|
|
62
|
+
"readonly": true
|
|
63
|
+
}
|
|
64
|
+
],
|
|
3
65
|
"customer/card": [
|
|
4
66
|
{
|
|
5
67
|
"name": "id",
|
|
@@ -66,12 +128,72 @@
|
|
|
66
128
|
],
|
|
67
129
|
"order/card": [
|
|
68
130
|
{
|
|
69
|
-
"name": "
|
|
131
|
+
"name": "id",
|
|
132
|
+
"type": "number | null",
|
|
133
|
+
"description": {
|
|
134
|
+
"en-GB": "Order ID in CRM",
|
|
135
|
+
"es-ES": "ID del pedido en CRM",
|
|
136
|
+
"ru-RU": "Идентификатор заказа в CRM"
|
|
137
|
+
},
|
|
138
|
+
"readonly": true
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "externalId",
|
|
70
142
|
"type": "string | null",
|
|
71
143
|
"description": {
|
|
72
|
-
"en-GB": "
|
|
73
|
-
"es-ES": "
|
|
74
|
-
"ru-RU": "
|
|
144
|
+
"en-GB": "The order ID in the external source system",
|
|
145
|
+
"es-ES": "El ID del pedido en el sistema de origen externo",
|
|
146
|
+
"ru-RU": "Идентифкатор заказа во внешней системе источника"
|
|
147
|
+
},
|
|
148
|
+
"readonly": true
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "number",
|
|
152
|
+
"type": "string | null",
|
|
153
|
+
"description": {
|
|
154
|
+
"en-GB": "Displayed order number",
|
|
155
|
+
"es-ES": "Número de pedido mostrado",
|
|
156
|
+
"ru-RU": "Отображаемый номер заказа"
|
|
157
|
+
},
|
|
158
|
+
"readonly": true
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "customer.type",
|
|
162
|
+
"type": "number | null",
|
|
163
|
+
"description": {
|
|
164
|
+
"en-GB": "Client type",
|
|
165
|
+
"es-ES": "Tipo de cliente",
|
|
166
|
+
"ru-RU": "Тип клиента"
|
|
167
|
+
},
|
|
168
|
+
"readonly": false
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "customer.lastName",
|
|
172
|
+
"type": "string | null",
|
|
173
|
+
"description": {
|
|
174
|
+
"en-GB": "Client last name",
|
|
175
|
+
"es-ES": "Apellido del cliente",
|
|
176
|
+
"ru-RU": "Фамилия клиента"
|
|
177
|
+
},
|
|
178
|
+
"readonly": false
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "customer.firstName",
|
|
182
|
+
"type": "string | null",
|
|
183
|
+
"description": {
|
|
184
|
+
"en-GB": "Client name",
|
|
185
|
+
"es-ES": "Nombre del cliente",
|
|
186
|
+
"ru-RU": "Имя клиента"
|
|
187
|
+
},
|
|
188
|
+
"readonly": false
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"name": "customer.patronymic",
|
|
192
|
+
"type": "string | null",
|
|
193
|
+
"description": {
|
|
194
|
+
"en-GB": "Patronymic of the client",
|
|
195
|
+
"es-ES": "Patronímico del cliente",
|
|
196
|
+
"ru-RU": "Отчество клиента"
|
|
75
197
|
},
|
|
76
198
|
"readonly": false
|
|
77
199
|
},
|
|
@@ -86,37 +208,157 @@
|
|
|
86
208
|
"readonly": false
|
|
87
209
|
},
|
|
88
210
|
{
|
|
89
|
-
"name": "
|
|
211
|
+
"name": "customer.email",
|
|
90
212
|
"type": "string | null",
|
|
91
213
|
"description": {
|
|
92
|
-
"en-GB": "
|
|
93
|
-
"es-ES": "
|
|
94
|
-
"ru-RU": "
|
|
214
|
+
"en-GB": "Customer email",
|
|
215
|
+
"es-ES": "Correo electrónico del cliente",
|
|
216
|
+
"ru-RU": "Email клиента"
|
|
95
217
|
},
|
|
96
218
|
"readonly": false
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "country",
|
|
222
|
+
"type": "string | null",
|
|
223
|
+
"description": {
|
|
224
|
+
"en-GB": "Character code of the country",
|
|
225
|
+
"es-ES": "Código de caracteres del país",
|
|
226
|
+
"ru-RU": "Символьный код страны"
|
|
227
|
+
},
|
|
228
|
+
"readonly": true
|
|
229
|
+
},
|
|
100
230
|
{
|
|
101
|
-
"name": "
|
|
231
|
+
"name": "currency",
|
|
102
232
|
"type": "string",
|
|
103
233
|
"description": {
|
|
104
|
-
"en-GB": "
|
|
105
|
-
"es-ES": "
|
|
106
|
-
"ru-RU": "
|
|
234
|
+
"en-GB": "Currency code",
|
|
235
|
+
"es-ES": "Código de moneda",
|
|
236
|
+
"ru-RU": "Символьный код валюты"
|
|
107
237
|
},
|
|
108
238
|
"readonly": true
|
|
109
239
|
},
|
|
110
240
|
{
|
|
111
|
-
"name": "
|
|
241
|
+
"name": "status",
|
|
112
242
|
"type": "string",
|
|
113
243
|
"description": {
|
|
114
|
-
"en-GB": "
|
|
115
|
-
"es-ES": "
|
|
116
|
-
"ru-RU": "
|
|
244
|
+
"en-GB": "Order status",
|
|
245
|
+
"es-ES": "Estado del pedido",
|
|
246
|
+
"ru-RU": "Статус заказа"
|
|
117
247
|
},
|
|
118
248
|
"readonly": true
|
|
119
249
|
},
|
|
250
|
+
{
|
|
251
|
+
"name": "company.name",
|
|
252
|
+
"type": "string | null",
|
|
253
|
+
"description": {
|
|
254
|
+
"en-GB": "Company's name",
|
|
255
|
+
"es-ES": "Nombre de la empresa",
|
|
256
|
+
"ru-RU": "Название компании"
|
|
257
|
+
},
|
|
258
|
+
"readonly": false
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"name": "company.legalName",
|
|
262
|
+
"type": "string | null",
|
|
263
|
+
"description": {
|
|
264
|
+
"en-GB": "Full name of the company",
|
|
265
|
+
"es-ES": "Nombre completo de la empresa",
|
|
266
|
+
"ru-RU": "Полное наименование компании"
|
|
267
|
+
},
|
|
268
|
+
"readonly": false
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "company.legalAddress",
|
|
272
|
+
"type": "string | null",
|
|
273
|
+
"description": {
|
|
274
|
+
"en-GB": "Company's registration address",
|
|
275
|
+
"es-ES": "Dirección de registro de la empresa",
|
|
276
|
+
"ru-RU": "Адрес регистрации компании"
|
|
277
|
+
},
|
|
278
|
+
"readonly": false
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"name": "company.INN",
|
|
282
|
+
"type": "string | null",
|
|
283
|
+
"description": {
|
|
284
|
+
"en-GB": "Counterparty's INN",
|
|
285
|
+
"es-ES": "INN del contraparte",
|
|
286
|
+
"ru-RU": "ИНН контрагента"
|
|
287
|
+
},
|
|
288
|
+
"readonly": false
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "company.OKPO",
|
|
292
|
+
"type": "string | null",
|
|
293
|
+
"description": {
|
|
294
|
+
"en-GB": "OKPO of the counterparty",
|
|
295
|
+
"es-ES": "OKPO del contraparte",
|
|
296
|
+
"ru-RU": "ОКПО контрагента"
|
|
297
|
+
},
|
|
298
|
+
"readonly": false
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"name": "company.BIK",
|
|
302
|
+
"type": "string | null",
|
|
303
|
+
"description": {
|
|
304
|
+
"en-GB": "Counterparty's BIC",
|
|
305
|
+
"es-ES": "BIC del contraparte",
|
|
306
|
+
"ru-RU": "БИК контрагента"
|
|
307
|
+
},
|
|
308
|
+
"readonly": false
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"name": "company.bank",
|
|
312
|
+
"type": "string | null",
|
|
313
|
+
"description": {
|
|
314
|
+
"en-GB": "Counterparty's bank",
|
|
315
|
+
"es-ES": "Banco del contraparte",
|
|
316
|
+
"ru-RU": "Банк контрагента"
|
|
317
|
+
},
|
|
318
|
+
"readonly": false
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "company.bankAddress",
|
|
322
|
+
"type": "string | null",
|
|
323
|
+
"description": {
|
|
324
|
+
"en-GB": "The address of the counterparty's bank",
|
|
325
|
+
"es-ES": "Dirección del banco del contraparte",
|
|
326
|
+
"ru-RU": "Адрес банка контрагента"
|
|
327
|
+
},
|
|
328
|
+
"readonly": false
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "company.corrAccount",
|
|
332
|
+
"type": "string | null",
|
|
333
|
+
"description": {
|
|
334
|
+
"en-GB": "Correspondent account of the counterparty",
|
|
335
|
+
"es-ES": "Cuenta corresponsal del contraparte",
|
|
336
|
+
"ru-RU": "Корреспондентский счет контрагента"
|
|
337
|
+
},
|
|
338
|
+
"readonly": false
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"name": "company.bankAccount",
|
|
342
|
+
"type": "string | null",
|
|
343
|
+
"description": {
|
|
344
|
+
"en-GB": "Counterparty's current account",
|
|
345
|
+
"es-ES": "Cuenta corriente del contraparte",
|
|
346
|
+
"ru-RU": "Расчетный счет контрагента"
|
|
347
|
+
},
|
|
348
|
+
"readonly": false
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"name": "delivery.address",
|
|
352
|
+
"type": "string | null",
|
|
353
|
+
"description": {
|
|
354
|
+
"en-GB": "Delivery address",
|
|
355
|
+
"es-ES": "Dirección de entrega",
|
|
356
|
+
"ru-RU": "Адрес доставки"
|
|
357
|
+
},
|
|
358
|
+
"readonly": false
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
"settings": [
|
|
120
362
|
{
|
|
121
363
|
"name": "system.locale",
|
|
122
364
|
"type": "'en-GB' | 'es-ES' | 'ru-RU'",
|
|
@@ -437,6 +679,10 @@
|
|
|
437
679
|
"import": "import { useOrderCardContext } from '@retailcrm/embed-ui'",
|
|
438
680
|
"call": "const order = useOrderCardContext()"
|
|
439
681
|
},
|
|
682
|
+
"user/current": {
|
|
683
|
+
"import": "import { useCurrentUserContext } from '@retailcrm/embed-ui'",
|
|
684
|
+
"call": "const user = useCurrentUserContext()"
|
|
685
|
+
},
|
|
440
686
|
"settings": {
|
|
441
687
|
"import": "import { useSettingsContext } from '@retailcrm/embed-ui'",
|
|
442
688
|
"call": "const settings = useSettingsContext()"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retailcrm/embed-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"description": "API and components for creating RetailCRM UI extensions",
|
|
6
6
|
"repository": "git@github.com:retailcrm/embed-ui.git",
|
|
7
7
|
"author": "RetailDriverLLC <integration@retailcrm.ru>",
|
package/types/context/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { Schema as CurrentUserSchema } from './user/current'
|
|
1
2
|
import type { Schema as CustomerCardSchema } from './customer/card'
|
|
2
3
|
import type { Schema as CustomerCardPhoneSchema } from './customer/card-phone'
|
|
3
4
|
import type { Schema as OrderCardSchema } from './order/card'
|
|
4
5
|
import type { Schema as SettingsSchema } from './settings'
|
|
5
6
|
|
|
6
7
|
export type SchemaList = {
|
|
8
|
+
'user/current': CurrentUserSchema;
|
|
7
9
|
'customer/card': CustomerCardSchema;
|
|
8
10
|
'customer/card:phone': CustomerCardPhoneSchema;
|
|
9
11
|
'order/card': OrderCardSchema;
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import type { Field } from '../schema'
|
|
2
2
|
|
|
3
3
|
export type Schema = {
|
|
4
|
+
'id': ReadonlyField<number | null>;
|
|
5
|
+
'externalId': ReadonlyField<string | null>;
|
|
6
|
+
'number': ReadonlyField<string | null>;
|
|
7
|
+
'customer.type': ReadonlyField<number | null>;
|
|
8
|
+
'customer.lastName': Field<string | null>;
|
|
9
|
+
'customer.firstName': Field<string | null>;
|
|
10
|
+
'customer.patronymic': Field<string | null>;
|
|
4
11
|
'customer.email': Field<string | null>;
|
|
5
12
|
'customer.phone': Field<string | null>;
|
|
13
|
+
'country': ReadonlyField<string | null>;
|
|
14
|
+
'currency': ReadonlyField<string>;
|
|
15
|
+
'status': ReadonlyField<string>;
|
|
16
|
+
'company.name': Field<string | null>;
|
|
17
|
+
'company.legalName': Field<string | null>;
|
|
18
|
+
'company.legalAddress': Field<string | null>;
|
|
19
|
+
'company.INN': Field<string | null>;
|
|
20
|
+
'company.OKPO': Field<string | null>;
|
|
21
|
+
'company.BIK': Field<string | null>;
|
|
22
|
+
'company.bank': Field<string | null>;
|
|
23
|
+
'company.bankAddress': Field<string | null>;
|
|
24
|
+
'company.corrAccount': Field<string | null>;
|
|
25
|
+
'company.bankAccount': Field<string | null>;
|
|
6
26
|
'delivery.address': Field<string | null>;
|
|
7
27
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReadonlyField } from '../schema'
|
|
2
|
+
|
|
3
|
+
export type Schema = {
|
|
4
|
+
'lastName': ReadonlyField<string>;
|
|
5
|
+
'firstName': ReadonlyField<number | null>;
|
|
6
|
+
'patronymic': ReadonlyField<number | null>;
|
|
7
|
+
'email': ReadonlyField<string>;
|
|
8
|
+
'id': ReadonlyField<number | null>;
|
|
9
|
+
'permissions': ReadonlyField<string[]>;
|
|
10
|
+
}
|
package/types/widget.d.ts
CHANGED
|
@@ -35,62 +35,77 @@ export type SchemaListByTarget = {
|
|
|
35
35
|
'customer/card:phone': Pick<SchemaList,
|
|
36
36
|
| 'customer/card'
|
|
37
37
|
| 'customer/card:phone'
|
|
38
|
+
| 'user/current'
|
|
38
39
|
| 'settings'
|
|
39
40
|
>;
|
|
40
41
|
'order/card:common.before': Pick<SchemaList,
|
|
41
42
|
| 'order/card'
|
|
43
|
+
| 'user/current'
|
|
42
44
|
| 'settings'
|
|
43
45
|
>;
|
|
44
46
|
'order/card:common.after': Pick<SchemaList,
|
|
45
47
|
| 'order/card'
|
|
48
|
+
| 'user/current'
|
|
46
49
|
| 'settings'
|
|
47
50
|
>;
|
|
48
51
|
'order/card:customer.before': Pick<SchemaList,
|
|
49
52
|
| 'order/card'
|
|
53
|
+
| 'user/current'
|
|
50
54
|
| 'settings'
|
|
51
55
|
>;
|
|
52
56
|
'order/card:customer.after': Pick<SchemaList,
|
|
53
57
|
| 'order/card'
|
|
58
|
+
| 'user/current'
|
|
54
59
|
| 'settings'
|
|
55
60
|
>;
|
|
56
61
|
'order/card:customer.email': Pick<SchemaList,
|
|
57
62
|
| 'order/card'
|
|
63
|
+
| 'user/current'
|
|
58
64
|
| 'settings'
|
|
59
65
|
>;
|
|
60
66
|
'order/card:customer.phone': Pick<SchemaList,
|
|
61
67
|
| 'order/card'
|
|
68
|
+
| 'user/current'
|
|
62
69
|
| 'settings'
|
|
63
70
|
>;
|
|
64
71
|
'order/card:list.before': Pick<SchemaList,
|
|
65
72
|
| 'order/card'
|
|
73
|
+
| 'user/current'
|
|
66
74
|
| 'settings'
|
|
67
75
|
>;
|
|
68
76
|
'order/card:list.after': Pick<SchemaList,
|
|
69
77
|
| 'order/card'
|
|
78
|
+
| 'user/current'
|
|
70
79
|
| 'settings'
|
|
71
80
|
>;
|
|
72
81
|
'order/card:store.before': Pick<SchemaList,
|
|
73
82
|
| 'order/card'
|
|
83
|
+
| 'user/current'
|
|
74
84
|
| 'settings'
|
|
75
85
|
>;
|
|
76
86
|
'order/card:dimensions.before': Pick<SchemaList,
|
|
77
87
|
| 'order/card'
|
|
88
|
+
| 'user/current'
|
|
78
89
|
| 'settings'
|
|
79
90
|
>;
|
|
80
91
|
'order/card:delivery.before': Pick<SchemaList,
|
|
81
92
|
| 'order/card'
|
|
93
|
+
| 'user/current'
|
|
82
94
|
| 'settings'
|
|
83
95
|
>;
|
|
84
96
|
'order/card:delivery.after': Pick<SchemaList,
|
|
85
97
|
| 'order/card'
|
|
98
|
+
| 'user/current'
|
|
86
99
|
| 'settings'
|
|
87
100
|
>;
|
|
88
101
|
'order/card:delivery.address': Pick<SchemaList,
|
|
89
102
|
| 'order/card'
|
|
103
|
+
| 'user/current'
|
|
90
104
|
| 'settings'
|
|
91
105
|
>;
|
|
92
106
|
'order/card:payment.before': Pick<SchemaList,
|
|
93
107
|
| 'order/card'
|
|
108
|
+
| 'user/current'
|
|
94
109
|
| 'settings'
|
|
95
110
|
>;
|
|
96
111
|
}
|