oneentry 1.0.87 → 1.0.89
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 +49 -1
- package/dist/admins/adminsInterfaces.d.ts +2 -1
- package/dist/base/asyncModules.js +1 -1
- package/dist/base/utils.d.ts +1 -18
- package/dist/blocks/blocksInterfaces.d.ts +2 -1
- package/dist/pages/pagesInterfaces.d.ts +3 -3
- package/dist/products/productsInterfaces.d.ts +7 -3
- package/dist/users/usersApi.d.ts +2 -1
- package/dist/users/usersApi.js +2 -1
- package/dist/users/usersInterfaces.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5447,6 +5447,48 @@ example: 12 <br>
|
|
|
5447
5447
|
|
|
5448
5448
|
## <h2 id="users"> Users </h2>
|
|
5449
5449
|
|
|
5450
|
+
You can store the data necessary for your application to work in a state object. When changing the user, add the necessary data to the state. When the user's data is subsequently received, it will contain a state object.
|
|
5451
|
+
|
|
5452
|
+
An example in which we add information to the user about how many orders he has made. Add a field "orderCount" with the value to the state object.
|
|
5453
|
+
|
|
5454
|
+
```js
|
|
5455
|
+
const data = {
|
|
5456
|
+
"formIdentifier": "reg",
|
|
5457
|
+
"authData": [
|
|
5458
|
+
{
|
|
5459
|
+
"marker": "password",
|
|
5460
|
+
"value": "12345"
|
|
5461
|
+
}
|
|
5462
|
+
],
|
|
5463
|
+
"formData": [
|
|
5464
|
+
{
|
|
5465
|
+
"marker": "last_name",
|
|
5466
|
+
"type": "string",
|
|
5467
|
+
"value": "Username"
|
|
5468
|
+
}
|
|
5469
|
+
],
|
|
5470
|
+
"notificationData": {
|
|
5471
|
+
"email": "example@oneentry.cloud",
|
|
5472
|
+
"phonePush": ["+99999999999"],
|
|
5473
|
+
"phoneSMS": "+99999999999"
|
|
5474
|
+
},
|
|
5475
|
+
"state": {
|
|
5476
|
+
"orderCount": 1
|
|
5477
|
+
}
|
|
5478
|
+
}
|
|
5479
|
+
|
|
5480
|
+
const value = await Users.updateUser(data)
|
|
5481
|
+
```
|
|
5482
|
+
|
|
5483
|
+
When the user's data is received, it will contain information about the number of orders
|
|
5484
|
+
|
|
5485
|
+
```js
|
|
5486
|
+
const value = await Users.getUser()
|
|
5487
|
+
|
|
5488
|
+
console.log(value.state.orderCount) // 1
|
|
5489
|
+
```
|
|
5490
|
+
|
|
5491
|
+
|
|
5450
5492
|
|
|
5451
5493
|
```js
|
|
5452
5494
|
const { Users } = defineOneEntry('your-url');
|
|
@@ -5470,7 +5512,10 @@ Example return:
|
|
|
5470
5512
|
"authProviderIdentifier": "email",
|
|
5471
5513
|
"groups": [
|
|
5472
5514
|
"group_1"
|
|
5473
|
-
]
|
|
5515
|
+
],
|
|
5516
|
+
"state": {
|
|
5517
|
+
"orderCount": 1
|
|
5518
|
+
}
|
|
5474
5519
|
}
|
|
5475
5520
|
```
|
|
5476
5521
|
<details>
|
|
@@ -5521,6 +5566,9 @@ const data = {
|
|
|
5521
5566
|
"email": "example@oneentry.cloud",
|
|
5522
5567
|
"phonePush": ["+99999999999"],
|
|
5523
5568
|
"phoneSMS": "+99999999999"
|
|
5569
|
+
},
|
|
5570
|
+
"state": {
|
|
5571
|
+
"orderCount": 1
|
|
5524
5572
|
}
|
|
5525
5573
|
}
|
|
5526
5574
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AttributeType } from "../base/utils";
|
|
1
2
|
/**
|
|
2
3
|
* Represents a interface object of Admins Api.
|
|
3
4
|
*
|
|
@@ -38,7 +39,7 @@ interface IPosition {
|
|
|
38
39
|
*/
|
|
39
40
|
interface IAdminEntity {
|
|
40
41
|
attributeSetId: number | null;
|
|
41
|
-
attributeValues:
|
|
42
|
+
attributeValues: AttributeType;
|
|
42
43
|
id: number;
|
|
43
44
|
identifier: string;
|
|
44
45
|
isSync: boolean;
|
package/dist/base/utils.d.ts
CHANGED
|
@@ -66,23 +66,6 @@ interface IAttributeValue {
|
|
|
66
66
|
[key: string]: any;
|
|
67
67
|
}
|
|
68
68
|
type AttributeType = IAttributeValues | IAttributeValue;
|
|
69
|
-
interface IAttributeSetEntity {
|
|
70
|
-
id: number;
|
|
71
|
-
updatedDate: string;
|
|
72
|
-
version: number;
|
|
73
|
-
identifier: string;
|
|
74
|
-
typeId: number;
|
|
75
|
-
localizeInfos: LocalizeType;
|
|
76
|
-
schema: Record<string, any>;
|
|
77
|
-
position: {
|
|
78
|
-
id: number;
|
|
79
|
-
objectId: number;
|
|
80
|
-
objectType: string;
|
|
81
|
-
position: number | string;
|
|
82
|
-
};
|
|
83
|
-
positionId: number | string;
|
|
84
|
-
isVisible: boolean;
|
|
85
|
-
}
|
|
86
69
|
type LangType = string | Array<string>;
|
|
87
70
|
type LocalizeType = ILocalizeInfos | ILocalizeInfo;
|
|
88
71
|
interface IError {
|
|
@@ -92,4 +75,4 @@ interface IError {
|
|
|
92
75
|
timestamp: string;
|
|
93
76
|
[key: string]: any;
|
|
94
77
|
}
|
|
95
|
-
export { LocalizeType, ILocalizeInfos, ILocalizeInfo, Types,
|
|
78
|
+
export { LocalizeType, ILocalizeInfos, ILocalizeInfo, Types, LangType, AttributeType, IAttributeValues, IAttributes, IConfig, IError };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AttributeType } from "../base/utils";
|
|
1
2
|
import { IProductsEntity } from "../products/productsInterfaces";
|
|
2
3
|
/**
|
|
3
4
|
* Represents a interface object of Blocks Api.
|
|
@@ -18,7 +19,7 @@ interface IBlocksResponse {
|
|
|
18
19
|
items: Array<IBlockEntity>;
|
|
19
20
|
}
|
|
20
21
|
interface IBlockEntity {
|
|
21
|
-
attributeValues:
|
|
22
|
+
attributeValues: AttributeType;
|
|
22
23
|
id: number;
|
|
23
24
|
identifier: string;
|
|
24
25
|
isVisible: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAttributes, LangType, Types } from "../base/utils";
|
|
1
|
+
import { AttributeType, IAttributes, LangType, Types } from "../base/utils";
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of Pages Api.
|
|
4
4
|
*
|
|
@@ -90,7 +90,7 @@ interface IPositionBlock {
|
|
|
90
90
|
position: number;
|
|
91
91
|
isSync: boolean;
|
|
92
92
|
isVisible: boolean;
|
|
93
|
-
attributeValues:
|
|
93
|
+
attributeValues: AttributeType;
|
|
94
94
|
attributeSetIdentifier: string | null;
|
|
95
95
|
type: string;
|
|
96
96
|
templateIdentifier: string | null;
|
|
@@ -118,7 +118,7 @@ interface IPositionBlock {
|
|
|
118
118
|
*/
|
|
119
119
|
interface IPagesEntity {
|
|
120
120
|
attributeSetIdentifier: string;
|
|
121
|
-
attributeValues:
|
|
121
|
+
attributeValues: AttributeType;
|
|
122
122
|
childrenCount?: number;
|
|
123
123
|
config?: Record<string, number>;
|
|
124
124
|
depth: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LangType, Types } from "../base/utils";
|
|
1
|
+
import { AttributeType, LangType, Types } from "../base/utils";
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of Products Api.
|
|
4
4
|
*
|
|
@@ -66,6 +66,8 @@ interface IProductsQuery {
|
|
|
66
66
|
* @property {string | null} conditionMarker - Id of the filter condition by which the values are filtered, default null.
|
|
67
67
|
* @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered, default null.
|
|
68
68
|
* @property {Array<string> | null} pageUrl - Url of the category page object.
|
|
69
|
+
* @property {string | null} statusMarker - Text identifier of the product page status (default not set).
|
|
70
|
+
* @property {string | null} title - Product name.
|
|
69
71
|
*/
|
|
70
72
|
interface IFilterParams {
|
|
71
73
|
attributeMarker: string;
|
|
@@ -82,6 +84,8 @@ interface IFilterParams {
|
|
|
82
84
|
conditionMarker?: 'in' | 'nin' | 'eq' | 'neq' | 'mth' | 'lth' | 'exs' | 'nexs' | null;
|
|
83
85
|
conditionValue: number | string | null;
|
|
84
86
|
pageUrl?: Array<string> | null;
|
|
87
|
+
statusMarker?: string;
|
|
88
|
+
title?: string;
|
|
85
89
|
}
|
|
86
90
|
/**
|
|
87
91
|
* Represents a product entity object.
|
|
@@ -120,7 +124,7 @@ interface IProductsEntity {
|
|
|
120
124
|
templateIdentifier: string | null;
|
|
121
125
|
shortDescTemplateIdentifier: string;
|
|
122
126
|
statusLocalizeInfos: Record<string, any>;
|
|
123
|
-
attributeValues:
|
|
127
|
+
attributeValues: AttributeType;
|
|
124
128
|
position: number;
|
|
125
129
|
sku: string | null;
|
|
126
130
|
}
|
|
@@ -168,6 +172,6 @@ interface IProductBlock {
|
|
|
168
172
|
templateIdentifier: string | null;
|
|
169
173
|
isVisible: boolean;
|
|
170
174
|
isSync: boolean;
|
|
171
|
-
attributeValues:
|
|
175
|
+
attributeValues: AttributeType;
|
|
172
176
|
}
|
|
173
177
|
export { IFilterParams, IProductsQuery, IProductApi, IProductsEntity, IProductsInfo, IProductInfo, IProductBlock, IProductEntity, IProductsResponse };
|
package/dist/users/usersApi.d.ts
CHANGED
|
@@ -41,7 +41,8 @@ export default class UsersApi extends AsyncModules implements IUsers {
|
|
|
41
41
|
* "email": "example@oneentry.cloud",
|
|
42
42
|
* "phonePush": ["+99999999999"],
|
|
43
43
|
* "phoneSMS": "+99999999999"
|
|
44
|
-
* }
|
|
44
|
+
* },
|
|
45
|
+
* "state": {}
|
|
45
46
|
* }
|
|
46
47
|
*/
|
|
47
48
|
updateUser(data: IUserBody, langCode?: string): Promise<boolean>;
|
package/dist/users/usersApi.js
CHANGED
|
@@ -22,6 +22,7 @@ interface IUserEntity {
|
|
|
22
22
|
formIdentifier: string;
|
|
23
23
|
authProviderIdentifier: string;
|
|
24
24
|
groups: Array<string>;
|
|
25
|
+
state: Record<string, any>;
|
|
25
26
|
}
|
|
26
27
|
interface IUserBody {
|
|
27
28
|
formIdentifier: string;
|
|
@@ -36,5 +37,6 @@ interface IUserBody {
|
|
|
36
37
|
phonePush: Array<string>;
|
|
37
38
|
phoneSMS: string;
|
|
38
39
|
};
|
|
40
|
+
state: Record<string, any>;
|
|
39
41
|
}
|
|
40
42
|
export { IUsers, IUserEntity, IUserBody, };
|