oneentry 1.0.78 → 1.0.80

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
@@ -29,6 +29,7 @@ type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' |
29
29
  * @property {Record<string, any>} validators - Set of validators for validation.
30
30
  * @property {Record<string, any>} localizeInfos - The name of the template, taking into account localization.
31
31
  * @property {Array<Record<string, any>>} listTitles - Array of values (with extended data) for list and radioButton attributes.
32
+ * @property {Array<Record<string, any>>} settings - Additional attribute settings (optional).
32
33
  *
33
34
  */
34
35
  interface IAttributesSetsEntity {
@@ -45,5 +46,6 @@ interface IAttributesSetsEntity {
45
46
  };
46
47
  localizeInfos: Record<string, any>;
47
48
  listTitles: Array<IListTitle> | Record<string, any>;
49
+ settings?: Record<string, any>;
48
50
  }
49
51
  export { IAttributesSets, IAttributesSetsEntity, IListTitle, AttributeType };
@@ -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
  * }
@@ -105,7 +105,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
105
105
  * @param {string} marker - The text identifier of the authorization provider. Example - email
106
106
  * @param {string} userIdentifier - The text identifier of the user's object (user login)
107
107
  * @param {string} code - Service code
108
- * @param {string} type - Operation type (1 - for changing password, 2 - for recovery)
108
+ * @param {number} type - Operation type (1 - for changing password, 2 - for recovery)
109
109
  * @param {string} newPassword - New password
110
110
  * @param {string} [repeatPassword] - Optional variable contains repeat new password for validation
111
111
  */
@@ -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
  * }
@@ -161,7 +161,7 @@ class AuthProviderApi extends asyncModules_1.default {
161
161
  * @param {string} marker - The text identifier of the authorization provider. Example - email
162
162
  * @param {string} userIdentifier - The text identifier of the user's object (user login)
163
163
  * @param {string} code - Service code
164
- * @param {string} type - Operation type (1 - for changing password, 2 - for recovery)
164
+ * @param {number} type - Operation type (1 - for changing password, 2 - for recovery)
165
165
  * @param {string} newPassword - New password
166
166
  * @param {string} [repeatPassword] - Optional variable contains repeat new password for validation
167
167
  */
@@ -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
  }
@@ -40,13 +40,17 @@ interface IAttributes {
40
40
  title: string;
41
41
  value: number | string | null;
42
42
  position: number;
43
- extendedValue: number | string | null;
44
- extendedValueType: number | string | null;
43
+ extended: {
44
+ value: string | number | null;
45
+ type: string | number | null;
46
+ };
45
47
  }>;
46
48
  localizeInfos: ILocalizeInfo;
47
49
  marker: string;
48
50
  position: number;
51
+ isVisible: boolean;
49
52
  type: string;
53
+ settings?: Record<string, any>;
50
54
  validators: Record<string, any>;
51
55
  }
52
56
  interface ILocalizeInfos {
@@ -75,6 +75,15 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
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.
@@ -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
  }
@@ -59,9 +61,11 @@ interface IOrderProductData {
59
61
  * @interface
60
62
  * @property {string} statusIdentifier - Text identifier of the order status.
61
63
  * @property {string} formIdentifier - Text identifier of the form status.
64
+ * @property {string} statusIdentifier - Text identifier of order status object (if not set, default status will be assigned).
62
65
  * @property {string} paymentAccountIdentifier - Text identifier of the order payment.
63
66
  * @property {Array<IOrdersFormData>} formData - Data submitted by the form linked to the order store.
64
67
  * @property {Array<IOrderProducts>} products - Array of products added to order.
68
+ * @property {string} createdDate - Order creation date.
65
69
  * @property {string} totalSum - Total order amount.
66
70
  * @property {string} currency - Currency used to pay for the order.
67
71
  * @property {string} createdDate - Date when the order was created.
@@ -69,8 +73,10 @@ interface IOrderProductData {
69
73
  interface IBaseOrdersEntity {
70
74
  formIdentifier: string;
71
75
  paymentAccountIdentifier: string;
76
+ statusIdentifier: string;
72
77
  formData: Array<IOrdersFormData>;
73
78
  products: Array<IOrderProductData>;
79
+ createdDate: string;
74
80
  totalSum: string;
75
81
  currency: string;
76
82
  id: number;
@@ -124,7 +130,7 @@ interface IOrderData {
124
130
  * @property {boolean} isHistory - Indicates that the order has been saved in the order history.
125
131
  */
126
132
  interface IOrdersByMarkersEntity {
127
- attributeSetIdentifier: string;
133
+ attributeSetIdentifier?: string;
128
134
  statusIdentifier: string;
129
135
  formIdentifier: string;
130
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.78",
3
+ "version": "1.0.80",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",