oneentry 1.0.79 → 1.0.81

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 CHANGED
@@ -436,7 +436,7 @@ const data = {
436
436
  ],
437
437
  "notificationData": {
438
438
  "email": "test@test.com",
439
- "phonePush": "",
439
+ "phonePush": [],
440
440
  "phoneSMS": "+99999999999"
441
441
  }
442
442
  }
@@ -1289,6 +1289,7 @@ Example return:
1289
1289
  "type": "list",
1290
1290
  "marker": "l1",
1291
1291
  "position": 2,
1292
+ "settings": {},
1292
1293
  "listTitles": [
1293
1294
  {
1294
1295
  "title": "red",
@@ -1395,6 +1396,7 @@ Example return:
1395
1396
  "type": "list",
1396
1397
  "marker": "l1",
1397
1398
  "position": 2,
1399
+ "settings": {},
1398
1400
  "listTitles": [
1399
1401
  {
1400
1402
  "title": "red",
@@ -2183,6 +2185,85 @@ example: 2023-01-01 12:12 <br>
2183
2185
  </details>
2184
2186
 
2185
2187
 
2188
+ ### Orders.getOrderByMarkerAndId(marker, id, langCode)
2189
+
2190
+ ```js
2191
+ const value = await Orders.getOrderByMarkerAndId('my-order', 1764)
2192
+ ```
2193
+
2194
+ > This method retrieves one order storage object by marker and id.
2195
+
2196
+ Example return:
2197
+ ```json
2198
+ {
2199
+ "id": 1764,
2200
+ "statusIdentifier": "inprogress",
2201
+ "formIdentifier": "order-form",
2202
+ "formData": [
2203
+ {
2204
+ "marker": "name_1",
2205
+ "type": "string",
2206
+ "value": "Name"
2207
+ }
2208
+ ],
2209
+ "products": [
2210
+ {
2211
+ "id": 1,
2212
+ "title": "Floorwood Maxima Laminate, 9811 Oak Mistral",
2213
+ "sku": null,
2214
+ "price": "1.00",
2215
+ "quantity": 10,
2216
+ "previewImage": [
2217
+ {
2218
+ "filename": "files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
2219
+ "downloadLink": "http://my-site.zone/files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
2220
+ "size": 296391,
2221
+ "previewLink": ""
2222
+ }
2223
+ ]
2224
+ }
2225
+ ],
2226
+ "totalSum": "12.00",
2227
+ "currency": "USD",
2228
+ "createdDate": "2023-01-01 12:12",
2229
+ "paymentAccountIdentifier": "payment-1",
2230
+ "paymentAccountLocalizeInfos": {
2231
+ "en_US": {
2232
+ "title": "Account 1"
2233
+ }
2234
+ },
2235
+ "isHistory": true
2236
+ }
2237
+ ```
2238
+ <details>
2239
+ <summary>Schema</summary>
2240
+
2241
+ **id:** number <br>
2242
+ *object identifier* <br>
2243
+ example: 1764 <br>
2244
+
2245
+ **localizeInfos:** Record<string, any> <br>
2246
+ *json description of the main page data object taking into account the language "en_US" (for example)* <br>
2247
+ example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "<b>Content for catalog</b>", "menuTitle": "Catalog" } } <br>
2248
+
2249
+ **identifier** string <br>
2250
+ *textual identifier for the record field* <br>
2251
+ example: catalog <br>
2252
+
2253
+ **generalTypeId** number <br>
2254
+ *type identifier* <br>
2255
+ example: 4 <br>
2256
+
2257
+ **formIdentifier** string <br>
2258
+ *textual identifier for the form used by the order storage* <br>
2259
+ example: catalog-form <br>
2260
+
2261
+ **paymentAccountIdentifiers** Array<{identifier:string} <br>
2262
+ *array of textual identifiers of payment accounts used by the order storage* <br>
2263
+ example: [{ "identifier": "p1" }] <br>
2264
+
2265
+ </details>
2266
+
2186
2267
  ### Orders.getAllOrders(langCode, limit, offset)
2187
2268
 
2188
2269
  ```js
@@ -36,7 +36,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
36
36
  * ],
37
37
  * "notificationData": {
38
38
  * "email": "example@oneentry.cloud",
39
- * "phonePush": "+99999999999",
39
+ * "phonePush": ["+99999999999"],
40
40
  * "phoneSMS": "+99999999999"
41
41
  * }
42
42
  * }
@@ -37,7 +37,7 @@ class AuthProviderApi extends asyncModules_1.default {
37
37
  * ],
38
38
  * "notificationData": {
39
39
  * "email": "example@oneentry.cloud",
40
- * "phonePush": "+99999999999",
40
+ * "phonePush": ["+99999999999"],
41
41
  * "phoneSMS": "+99999999999"
42
42
  * }
43
43
  * }
@@ -40,7 +40,7 @@ interface ISignUpData {
40
40
  formData: IAuthFormData | Array<IAuthFormData>;
41
41
  notificationData: {
42
42
  email: string;
43
- phonePush: string;
43
+ phonePush: Array<string>;
44
44
  phoneSMS: string;
45
45
  };
46
46
  }
@@ -50,6 +50,7 @@ interface IAttributes {
50
50
  position: number;
51
51
  isVisible: boolean;
52
52
  type: string;
53
+ settings?: Record<string, any>;
53
54
  validators: Record<string, any>;
54
55
  }
55
56
  interface ILocalizeInfos {
@@ -70,11 +70,20 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
70
70
  * "productId": 1,
71
71
  * "quantity": 2
72
72
  * }
73
- * ],Сочи
73
+ * ],
74
74
  * "currency": "USD"
75
75
  * }
76
76
  */
77
77
  updateOrderByMarkerAndId(marker: string, id: number, data: IOrderData, langCode?: string): Promise<IBaseOrdersEntity>;
78
+ /**
79
+ * Getting a single order from the order storage object created by the user
80
+ *
81
+ * @param marker - The text identifier of the order storage object
82
+ * @param id - ID of the order object
83
+ * @param langCode Optional language field
84
+ *
85
+ */
86
+ getOrderByMarkerAndId(marker: string, id: number, langCode?: string): Promise<IOrdersByMarkersEntity>;
78
87
  /**
79
88
  * Getting all the order storage objects
80
89
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
@@ -80,7 +80,7 @@ class OrdersApi extends asyncModules_1.default {
80
80
  * "productId": 1,
81
81
  * "quantity": 2
82
82
  * }
83
- * ],Сочи
83
+ * ],
84
84
  * "currency": "USD"
85
85
  * }
86
86
  */
@@ -91,6 +91,18 @@ class OrdersApi extends asyncModules_1.default {
91
91
  const result = await this._fetchPut(`/marker/${marker}/orders/${id}?langCode=${langCode}`, data);
92
92
  return this._normalizeData(result);
93
93
  }
94
+ /**
95
+ * Getting a single order from the order storage object created by the user
96
+ *
97
+ * @param marker - The text identifier of the order storage object
98
+ * @param id - ID of the order object
99
+ * @param langCode Optional language field
100
+ *
101
+ */
102
+ async getOrderByMarkerAndId(marker, id, langCode = this.state.lang) {
103
+ const result = await this._fetchGet(`/marker/${marker}/orders/${id}?langCode=${langCode}`);
104
+ return this._normalizeData(result);
105
+ }
94
106
  /**
95
107
  * Getting all the order storage objects
96
108
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
@@ -4,6 +4,7 @@
4
4
  * @property {function} getOrderByMarker - Retrieve one order storage object by marker.
5
5
  * @property {function} createOrder - Creation of an order in the order storage.
6
6
  * @property {function} updateOrderByMarkerAndId - Changing an order in the order store.
7
+ * @property {function} getOrderByMarkerAndId - Getting a single order from the order storage object created by the user.
7
8
  * @property {function} getAllOrders - Getting all the order storage objects.
8
9
  * @property {function} getAllOrdersByMarker - Getting one order storage object by marker.
9
10
  * @property {function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
@@ -13,6 +14,7 @@ interface IOrdersApi {
13
14
  getOrderByMarker(marker: string, langCode?: string): Promise<IOrdersEntity>;
14
15
  createOrder(marker: string, data: IOrderData): Promise<IBaseOrdersEntity>;
15
16
  updateOrderByMarkerAndId(marker: string, id: number, data: IOrderData, langCode?: string): Promise<IBaseOrdersEntity>;
17
+ getOrderByMarkerAndId(marker: string, id: number, langCode?: string): Promise<IOrdersByMarkersEntity>;
16
18
  getAllOrders(langCode?: string, limit?: number, offset?: number): Promise<Array<IOrdersEntity>>;
17
19
  getAllOrdersByMarker(marker: string, langCode?: string, limit?: number, offset?: number): Promise<Array<IOrdersByMarkersEntity>>;
18
20
  }
@@ -128,7 +130,7 @@ interface IOrderData {
128
130
  * @property {boolean} isHistory - Indicates that the order has been saved in the order history.
129
131
  */
130
132
  interface IOrdersByMarkersEntity {
131
- attributeSetIdentifier: string;
133
+ attributeSetIdentifier?: string;
132
134
  statusIdentifier: string;
133
135
  formIdentifier: string;
134
136
  formData: Array<IOrdersFormData>;
@@ -120,7 +120,7 @@ interface IProductsEntity {
120
120
  localizeInfos: Record<string, any>;
121
121
  blocks?: string | Array<string>;
122
122
  isVisible: boolean;
123
- statusIdentifier: number | null;
123
+ statusIdentifier: string | null;
124
124
  attributeSetIdentifier: string;
125
125
  isSync: number | boolean;
126
126
  price: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.79",
3
+ "version": "1.0.81",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,4 +26,4 @@
26
26
  "ts-jest": "^29.1.1",
27
27
  "typescript": "^5.3.3"
28
28
  }
29
- }
29
+ }