oneentry 1.0.109 → 1.0.111
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 +455 -437
- package/dist/auth-provider/authProviderApi.d.ts +1 -1
- package/dist/auth-provider/authProviderApi.js +2 -2
- package/dist/base/asyncModules.d.ts +42 -0
- package/dist/base/asyncModules.js +42 -0
- package/dist/base/syncModules.d.ts +73 -0
- package/dist/base/syncModules.js +137 -0
- package/dist/events/eventsApi.js +1 -1
- package/dist/formsData/formsDataApi.d.ts +1 -1
- package/dist/formsData/formsDataApi.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +4 -4
- package/dist/integration-collections/integrationCollectionsApi.js +4 -4
- package/dist/pages/pagesApi.js +4 -4
- package/dist/users/usersApi.d.ts +3 -4
- package/dist/users/usersApi.js +4 -11
- package/package.json +21 -21
- package/readme.js +0 -103
|
@@ -113,8 +113,8 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
113
113
|
*
|
|
114
114
|
* @param {string} [marker] - The text identifier of the authorization provider. Example - email
|
|
115
115
|
* @param {string} [userIdentifier] - The text identifier of the user's object (user login)
|
|
116
|
+
* @param {string} [type] - Operation type (1 - for changing password, 2 - for recovery)
|
|
116
117
|
* @param {string} [code] - Service code
|
|
117
|
-
* @param {number} [type] - Operation type (1 - for changing password, 2 - for recovery)
|
|
118
118
|
* @param {string} [newPassword] - New password
|
|
119
119
|
* @param {string} [repeatPassword] - Optional variable contains repeat new password for validation
|
|
120
120
|
*/
|
|
@@ -78,8 +78,8 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
78
78
|
async checkCode(marker, userIdentifier, eventIdentifier, code) {
|
|
79
79
|
const data = {
|
|
80
80
|
userIdentifier,
|
|
81
|
-
code,
|
|
82
81
|
eventIdentifier,
|
|
82
|
+
code,
|
|
83
83
|
};
|
|
84
84
|
const result = await this._fetchPost(`/marker/${marker}/users/check-code`, data);
|
|
85
85
|
return result;
|
|
@@ -173,8 +173,8 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
173
173
|
*
|
|
174
174
|
* @param {string} [marker] - The text identifier of the authorization provider. Example - email
|
|
175
175
|
* @param {string} [userIdentifier] - The text identifier of the user's object (user login)
|
|
176
|
+
* @param {string} [type] - Operation type (1 - for changing password, 2 - for recovery)
|
|
176
177
|
* @param {string} [code] - Service code
|
|
177
|
-
* @param {number} [type] - Operation type (1 - for changing password, 2 - for recovery)
|
|
178
178
|
* @param {string} [newPassword] - New password
|
|
179
179
|
* @param {string} [repeatPassword] - Optional variable contains repeat new password for validation
|
|
180
180
|
*/
|
|
@@ -6,11 +6,53 @@ export default abstract class AsyncModules extends SyncModules {
|
|
|
6
6
|
protected _https: any;
|
|
7
7
|
protected _url: string;
|
|
8
8
|
protected constructor(state: StateModule);
|
|
9
|
+
/**
|
|
10
|
+
* fetchGet
|
|
11
|
+
*
|
|
12
|
+
* @param path
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
9
15
|
protected _fetchGet(path: string): Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* fetchPost
|
|
18
|
+
*
|
|
19
|
+
* @param path
|
|
20
|
+
* @param data
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
10
23
|
protected _fetchPost(path: string, data?: any): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* fetchPut
|
|
26
|
+
* @param path
|
|
27
|
+
* @param data
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
11
30
|
protected _fetchPut(path: string, data: any): Promise<any>;
|
|
31
|
+
/**
|
|
32
|
+
* _fetchDelete
|
|
33
|
+
* @param path
|
|
34
|
+
* @param data
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
12
37
|
protected _fetchDelete(path: string, data?: any): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* refreshToken
|
|
40
|
+
*
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
13
43
|
protected refreshToken(): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* makeOptions
|
|
46
|
+
* @param method
|
|
47
|
+
* @param data
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
14
50
|
private makeOptions;
|
|
51
|
+
/**
|
|
52
|
+
* browserResponse
|
|
53
|
+
* @param path
|
|
54
|
+
* @param options
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
15
57
|
private browserResponse;
|
|
16
58
|
}
|
|
@@ -14,6 +14,12 @@ class AsyncModules extends syncModules_1.default {
|
|
|
14
14
|
this._NO_FETCH = state._NO_FETCH;
|
|
15
15
|
this._https = (_a = state._https) !== null && _a !== void 0 ? _a : null;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* fetchGet
|
|
19
|
+
*
|
|
20
|
+
* @param path
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
17
23
|
async _fetchGet(path) {
|
|
18
24
|
const options = this.makeOptions('GET');
|
|
19
25
|
if (!this._NO_FETCH) {
|
|
@@ -36,6 +42,13 @@ class AsyncModules extends syncModules_1.default {
|
|
|
36
42
|
});
|
|
37
43
|
}
|
|
38
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* fetchPost
|
|
47
|
+
*
|
|
48
|
+
* @param path
|
|
49
|
+
* @param data
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
39
52
|
async _fetchPost(path, data) {
|
|
40
53
|
const options = this.makeOptions('POST', data);
|
|
41
54
|
if (!this._NO_FETCH) {
|
|
@@ -66,6 +79,12 @@ class AsyncModules extends syncModules_1.default {
|
|
|
66
79
|
});
|
|
67
80
|
}
|
|
68
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* fetchPut
|
|
84
|
+
* @param path
|
|
85
|
+
* @param data
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
69
88
|
async _fetchPut(path, data) {
|
|
70
89
|
const options = this.makeOptions('PUT', data);
|
|
71
90
|
if (!this._NO_FETCH) {
|
|
@@ -90,6 +109,12 @@ class AsyncModules extends syncModules_1.default {
|
|
|
90
109
|
});
|
|
91
110
|
}
|
|
92
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* _fetchDelete
|
|
114
|
+
* @param path
|
|
115
|
+
* @param data
|
|
116
|
+
* @returns
|
|
117
|
+
*/
|
|
93
118
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
94
119
|
async _fetchDelete(path, data) {
|
|
95
120
|
const options = this.makeOptions('DELETE');
|
|
@@ -113,6 +138,11 @@ class AsyncModules extends syncModules_1.default {
|
|
|
113
138
|
});
|
|
114
139
|
}
|
|
115
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* refreshToken
|
|
143
|
+
*
|
|
144
|
+
* @returns
|
|
145
|
+
*/
|
|
116
146
|
async refreshToken() {
|
|
117
147
|
const response = await fetch(this.state.url +
|
|
118
148
|
`/api/content/users-auth-providers/marker/email/users/refresh`, {
|
|
@@ -136,6 +166,12 @@ class AsyncModules extends syncModules_1.default {
|
|
|
136
166
|
return false;
|
|
137
167
|
}
|
|
138
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* makeOptions
|
|
171
|
+
* @param method
|
|
172
|
+
* @param data
|
|
173
|
+
* @returns
|
|
174
|
+
*/
|
|
139
175
|
makeOptions(method, data) {
|
|
140
176
|
const options = {
|
|
141
177
|
method: method,
|
|
@@ -155,6 +191,12 @@ class AsyncModules extends syncModules_1.default {
|
|
|
155
191
|
}
|
|
156
192
|
return options;
|
|
157
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* browserResponse
|
|
196
|
+
* @param path
|
|
197
|
+
* @param options
|
|
198
|
+
* @returns
|
|
199
|
+
*/
|
|
158
200
|
async browserResponse(path, options) {
|
|
159
201
|
try {
|
|
160
202
|
const response = await fetch(this._getFullPath(path), options);
|
|
@@ -5,13 +5,86 @@ export default abstract class SyncModules {
|
|
|
5
5
|
protected state: StateModule;
|
|
6
6
|
protected _url: string;
|
|
7
7
|
protected constructor(state: StateModule);
|
|
8
|
+
/**
|
|
9
|
+
* getFullPath
|
|
10
|
+
*
|
|
11
|
+
* @param path
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
8
14
|
protected _getFullPath(path: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* queryParamsToString
|
|
17
|
+
*
|
|
18
|
+
* @param query
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
9
21
|
protected _queryParamsToString(query: IProductsQuery | IUploadingQuery | any): string;
|
|
22
|
+
/**
|
|
23
|
+
* normalizeData
|
|
24
|
+
*
|
|
25
|
+
* @param data
|
|
26
|
+
* @param langCode
|
|
27
|
+
* @returns normalized data
|
|
28
|
+
*/
|
|
10
29
|
protected _normalizeData(data: any, langCode?: string): any;
|
|
30
|
+
/**
|
|
31
|
+
* normalizePostBody
|
|
32
|
+
*
|
|
33
|
+
* @param body
|
|
34
|
+
* @param langCode
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
11
37
|
protected _normalizePostBody(body: any, langCode?: string): any;
|
|
38
|
+
/**
|
|
39
|
+
* clearArray
|
|
40
|
+
*
|
|
41
|
+
* @param data
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
12
44
|
protected _clearArray(data: Record<string, any>): any;
|
|
45
|
+
/**
|
|
46
|
+
* sortAttributes
|
|
47
|
+
*
|
|
48
|
+
* @param data
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
protected _sortAttributes: (data: any) => {
|
|
52
|
+
[k: string]: unknown;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* addTimeIntervalsToSchedules
|
|
56
|
+
*
|
|
57
|
+
* @param schedules
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
60
|
+
protected _addTimeIntervalsToSchedules(schedules: any[]): any[];
|
|
61
|
+
/**
|
|
62
|
+
* normalizeAttr
|
|
63
|
+
*
|
|
64
|
+
* @param data
|
|
65
|
+
* @returns normalized Attrs
|
|
66
|
+
*/
|
|
13
67
|
protected _normalizeAttr(data: any): any;
|
|
68
|
+
/**
|
|
69
|
+
* dataPostProcess
|
|
70
|
+
*
|
|
71
|
+
* @param data
|
|
72
|
+
* @param langCode
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
14
75
|
protected _dataPostProcess(data: any, langCode?: string): any;
|
|
76
|
+
/**
|
|
77
|
+
* setAccessToken
|
|
78
|
+
*
|
|
79
|
+
* @param accessToken
|
|
80
|
+
* @returns
|
|
81
|
+
*/
|
|
15
82
|
setAccessToken(accessToken: string): this;
|
|
83
|
+
/**
|
|
84
|
+
* setRefreshToken
|
|
85
|
+
*
|
|
86
|
+
* @param refreshToken
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
16
89
|
setRefreshToken(refreshToken: string): this;
|
|
17
90
|
}
|
package/dist/base/syncModules.js
CHANGED
|
@@ -2,12 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class SyncModules {
|
|
4
4
|
constructor(state) {
|
|
5
|
+
/**
|
|
6
|
+
* sortAttributes
|
|
7
|
+
*
|
|
8
|
+
* @param data
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
this._sortAttributes = (data) => Object.fromEntries(Object.entries(data).sort(([, a], [, b]) => a.position - b.position));
|
|
5
12
|
this.state = state;
|
|
6
13
|
this._url = state.url;
|
|
7
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* getFullPath
|
|
17
|
+
*
|
|
18
|
+
* @param path
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
8
21
|
_getFullPath(path) {
|
|
9
22
|
return this._url + path;
|
|
10
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* queryParamsToString
|
|
26
|
+
*
|
|
27
|
+
* @param query
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
11
30
|
_queryParamsToString(query) {
|
|
12
31
|
let result = '';
|
|
13
32
|
for (const key in query) {
|
|
@@ -17,6 +36,13 @@ class SyncModules {
|
|
|
17
36
|
}
|
|
18
37
|
return result.slice(0, result.length - 1);
|
|
19
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* normalizeData
|
|
41
|
+
*
|
|
42
|
+
* @param data
|
|
43
|
+
* @param langCode
|
|
44
|
+
* @returns normalized data
|
|
45
|
+
*/
|
|
20
46
|
_normalizeData(data, langCode = this.state.lang) {
|
|
21
47
|
if (Array.isArray(data)) {
|
|
22
48
|
return this._normalizeAttr(data.map((item) => this._normalizeData(item, langCode)));
|
|
@@ -43,6 +69,13 @@ class SyncModules {
|
|
|
43
69
|
return data;
|
|
44
70
|
}
|
|
45
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* normalizePostBody
|
|
74
|
+
*
|
|
75
|
+
* @param body
|
|
76
|
+
* @param langCode
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
46
79
|
_normalizePostBody(body, langCode = this.state.lang) {
|
|
47
80
|
const formData = {};
|
|
48
81
|
formData[langCode] = Array.isArray(body.formData)
|
|
@@ -51,6 +84,12 @@ class SyncModules {
|
|
|
51
84
|
body.formData = formData;
|
|
52
85
|
return body;
|
|
53
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* clearArray
|
|
89
|
+
*
|
|
90
|
+
* @param data
|
|
91
|
+
* @returns
|
|
92
|
+
*/
|
|
54
93
|
_clearArray(data) {
|
|
55
94
|
if (Array.isArray(data)) {
|
|
56
95
|
return data.map((item) => this._clearArray(item));
|
|
@@ -84,26 +123,124 @@ class SyncModules {
|
|
|
84
123
|
return data;
|
|
85
124
|
}
|
|
86
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* addTimeIntervalsToSchedules
|
|
128
|
+
*
|
|
129
|
+
* @param schedules
|
|
130
|
+
* @returns
|
|
131
|
+
*/
|
|
132
|
+
_addTimeIntervalsToSchedules(schedules) {
|
|
133
|
+
// Function to add days
|
|
134
|
+
function addDays(date, days) {
|
|
135
|
+
const result = new Date(date);
|
|
136
|
+
result.setUTCDate(result.getUTCDate() + days);
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
// Function to add months
|
|
140
|
+
function addMonths(date, months) {
|
|
141
|
+
const result = new Date(date);
|
|
142
|
+
result.setUTCMonth(result.getUTCMonth() + months);
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
schedules.forEach((scheduleGroup) => {
|
|
146
|
+
scheduleGroup.values.forEach((schedule) => {
|
|
147
|
+
const utcIntervals = [];
|
|
148
|
+
const baseDate = new Date(schedule.dates[0]); // We use the first date as the base date
|
|
149
|
+
// Generate intervals based on weekly repetition
|
|
150
|
+
if (schedule.inEveryWeek) {
|
|
151
|
+
for (let week = 0; week < 4; week++) {
|
|
152
|
+
schedule.times.forEach((timeRange) => {
|
|
153
|
+
const [startTime, endTime] = timeRange;
|
|
154
|
+
const startDate = addDays(baseDate, week * 7);
|
|
155
|
+
startDate.setUTCHours(startTime.hours, startTime.minutes, 0, 0);
|
|
156
|
+
const endDate = addDays(baseDate, week * 7);
|
|
157
|
+
endDate.setUTCHours(endTime.hours, endTime.minutes, 0, 0);
|
|
158
|
+
utcIntervals.push([
|
|
159
|
+
startDate.toISOString(),
|
|
160
|
+
endDate.toISOString(),
|
|
161
|
+
]);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// Generate intervals based on monthly repetition
|
|
166
|
+
if (schedule.inEveryMonth) {
|
|
167
|
+
for (let month = 0; month < 12; month++) {
|
|
168
|
+
// Предполагаем 12 месяцев в году
|
|
169
|
+
schedule.times.forEach((timeRange) => {
|
|
170
|
+
const [startTime, endTime] = timeRange;
|
|
171
|
+
const startDate = addMonths(baseDate, month);
|
|
172
|
+
startDate.setUTCHours(startTime.hours, startTime.minutes, 0, 0);
|
|
173
|
+
const endDate = addMonths(baseDate, month);
|
|
174
|
+
endDate.setUTCHours(endTime.hours, endTime.minutes, 0, 0);
|
|
175
|
+
utcIntervals.push([
|
|
176
|
+
startDate.toISOString(),
|
|
177
|
+
endDate.toISOString(),
|
|
178
|
+
]);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// Add the calculated intervals to the new timeIntervals field
|
|
183
|
+
schedule.timeIntervals = utcIntervals;
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
return schedules;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* normalizeAttr
|
|
190
|
+
*
|
|
191
|
+
* @param data
|
|
192
|
+
* @returns normalized Attrs
|
|
193
|
+
*/
|
|
87
194
|
_normalizeAttr(data) {
|
|
88
195
|
if ('attributeValues' in data) {
|
|
89
196
|
for (const attr in data.attributeValues) {
|
|
197
|
+
// normalize numbers
|
|
90
198
|
if (data.attributeValues[attr].type === 'integer' ||
|
|
91
199
|
data.attributeValues[attr].type === 'float') {
|
|
92
200
|
data.attributeValues[attr].value = Number(data.attributeValues[attr].value);
|
|
93
201
|
}
|
|
202
|
+
// add timeIntervals
|
|
203
|
+
if (data.attributeValues[attr].type === 'timeInterval') {
|
|
204
|
+
const schedules = data.attributeValues[attr].value;
|
|
205
|
+
const result = this._addTimeIntervalsToSchedules(schedules);
|
|
206
|
+
data.attributeValues[attr].value = result;
|
|
207
|
+
}
|
|
94
208
|
}
|
|
209
|
+
return {
|
|
210
|
+
...data,
|
|
211
|
+
attributeValues: this._sortAttributes(data.attributeValues),
|
|
212
|
+
};
|
|
95
213
|
}
|
|
96
214
|
return data;
|
|
97
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* dataPostProcess
|
|
218
|
+
*
|
|
219
|
+
* @param data
|
|
220
|
+
* @param langCode
|
|
221
|
+
* @returns
|
|
222
|
+
*/
|
|
98
223
|
_dataPostProcess(data, langCode = this.state.lang) {
|
|
99
224
|
const normalize = this._normalizeData(data, langCode);
|
|
100
225
|
const result = this._clearArray(normalize);
|
|
101
226
|
return result;
|
|
102
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* setAccessToken
|
|
230
|
+
*
|
|
231
|
+
* @param accessToken
|
|
232
|
+
* @returns
|
|
233
|
+
*/
|
|
103
234
|
setAccessToken(accessToken) {
|
|
104
235
|
this.state.accessToken = accessToken;
|
|
105
236
|
return this;
|
|
106
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* setRefreshToken
|
|
240
|
+
*
|
|
241
|
+
* @param refreshToken
|
|
242
|
+
* @returns
|
|
243
|
+
*/
|
|
107
244
|
setRefreshToken(refreshToken) {
|
|
108
245
|
this.state.refreshToken = refreshToken;
|
|
109
246
|
return this;
|
package/dist/events/eventsApi.js
CHANGED
|
@@ -40,7 +40,7 @@ class EventsApi extends asyncModules_1.default {
|
|
|
40
40
|
async subscribeByMarker(marker, productId, langCode = this.state.lang, threshold = 0) {
|
|
41
41
|
const data = {
|
|
42
42
|
locale: langCode,
|
|
43
|
-
productId
|
|
43
|
+
productId,
|
|
44
44
|
};
|
|
45
45
|
if (threshold) {
|
|
46
46
|
data.threshold = threshold;
|
|
@@ -74,9 +74,9 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
74
74
|
"formData": {
|
|
75
75
|
"en_US": [
|
|
76
76
|
{
|
|
77
|
-
"marker": "
|
|
77
|
+
"marker": "collection_marker",
|
|
78
78
|
"type": "string",
|
|
79
|
-
"value": "
|
|
79
|
+
"value": "Collection marker"
|
|
80
80
|
}
|
|
81
81
|
]
|
|
82
82
|
}
|
|
@@ -98,9 +98,9 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
98
98
|
"formData": {
|
|
99
99
|
"en_US": [
|
|
100
100
|
{
|
|
101
|
-
"marker": "
|
|
101
|
+
"marker": "collection_marker",
|
|
102
102
|
"type": "string",
|
|
103
|
-
"value": "
|
|
103
|
+
"value": "Collection marker"
|
|
104
104
|
}
|
|
105
105
|
]
|
|
106
106
|
}
|
|
@@ -98,9 +98,9 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
98
98
|
"formData": {
|
|
99
99
|
"en_US": [
|
|
100
100
|
{
|
|
101
|
-
"marker": "
|
|
101
|
+
"marker": "collection_marker",
|
|
102
102
|
"type": "string",
|
|
103
|
-
"value": "
|
|
103
|
+
"value": "Collection marker"
|
|
104
104
|
}
|
|
105
105
|
]
|
|
106
106
|
}
|
|
@@ -125,9 +125,9 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
125
125
|
"formData": {
|
|
126
126
|
"en_US": [
|
|
127
127
|
{
|
|
128
|
-
"marker": "
|
|
128
|
+
"marker": "collection_marker",
|
|
129
129
|
"type": "string",
|
|
130
|
-
"value": "
|
|
130
|
+
"value": "Collection marker"
|
|
131
131
|
}
|
|
132
132
|
]
|
|
133
133
|
}
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -56,8 +56,8 @@ class PageApi extends asyncModules_1.default {
|
|
|
56
56
|
* @returns Returns PageEntity object
|
|
57
57
|
*/
|
|
58
58
|
async getPageByUrl(url, langCode = this.state.lang) {
|
|
59
|
-
const
|
|
60
|
-
return this._normalizeData(
|
|
59
|
+
const data = await this._fetchGet(`/url/${url}?langCode=${langCode}`);
|
|
60
|
+
return this._normalizeData(data, langCode);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Get child pages object with information as an array.
|
|
@@ -68,8 +68,8 @@ class PageApi extends asyncModules_1.default {
|
|
|
68
68
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
69
69
|
*/
|
|
70
70
|
async getChildPagesByParentUrl(url, langCode = this.state.lang) {
|
|
71
|
-
const
|
|
72
|
-
return this._normalizeData(
|
|
71
|
+
const data = await this._fetchGet(`/${url}/children?langCode=${langCode}`);
|
|
72
|
+
return this._normalizeData(data, langCode);
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Get all blocks by page url.
|
package/dist/users/usersApi.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export default class UsersApi extends AsyncModules implements IUsers {
|
|
|
19
19
|
getUser(langCode?: string): Promise<IUserEntity | IError>;
|
|
20
20
|
/**
|
|
21
21
|
* Updating a single user object.
|
|
22
|
+
*
|
|
22
23
|
* @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.
|
|
23
24
|
*
|
|
24
25
|
* @param {object} [body] - Request body.
|
|
@@ -49,13 +50,11 @@ export default class UsersApi extends AsyncModules implements IUsers {
|
|
|
49
50
|
updateUser(body: IUserBody, langCode?: string): Promise<boolean | IError>;
|
|
50
51
|
/**
|
|
51
52
|
* Delete a single user object.
|
|
52
|
-
* @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.
|
|
53
53
|
*
|
|
54
|
-
* @
|
|
55
|
-
* @param {string} [langCode] - Optional language field
|
|
54
|
+
* @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.
|
|
56
55
|
*
|
|
57
56
|
*/
|
|
58
|
-
deleteUser(
|
|
57
|
+
deleteUser(): Promise<boolean | IError>;
|
|
59
58
|
/**
|
|
60
59
|
* Adds FCM token for sending Push notification.
|
|
61
60
|
*
|
package/dist/users/usersApi.js
CHANGED
|
@@ -25,6 +25,7 @@ class UsersApi extends asyncModules_1.default {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Updating a single user object.
|
|
28
|
+
*
|
|
28
29
|
* @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.
|
|
29
30
|
*
|
|
30
31
|
* @param {object} [body] - Request body.
|
|
@@ -64,20 +65,12 @@ class UsersApi extends asyncModules_1.default {
|
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
66
67
|
* Delete a single user object.
|
|
67
|
-
* @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.
|
|
68
68
|
*
|
|
69
|
-
* @
|
|
70
|
-
* @param {string} [langCode] - Optional language field
|
|
69
|
+
* @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.
|
|
71
70
|
*
|
|
72
71
|
*/
|
|
73
|
-
async deleteUser(
|
|
74
|
-
|
|
75
|
-
body['langCode'] = langCode;
|
|
76
|
-
const result = await this._fetchDelete('/me',
|
|
77
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
78
|
-
body.hasOwnProperty('formData')
|
|
79
|
-
? this._normalizePostBody(body, langCode)
|
|
80
|
-
: body);
|
|
72
|
+
async deleteUser() {
|
|
73
|
+
const result = await this._fetchDelete('/me');
|
|
81
74
|
return result;
|
|
82
75
|
}
|
|
83
76
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oneentry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.111",
|
|
4
4
|
"description": "OneEntry NPM package",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,28 +10,28 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"productionBuild": "run-s lint testAll build readme",
|
|
12
12
|
"testAll": "run-s admins attributesets authProvider blocks fileuploading forms formsdata generaltypes integrationcollections locales menus orders pages payments payments productstatuses products templates templatespreview users",
|
|
13
|
-
"admins": "npx jest src/admins/admins.spec.ts",
|
|
14
|
-
"attributesets": "npx jest src/attribute-sets/attributesets.spec.ts",
|
|
15
|
-
"authProvider": "npx jest src/auth-provider/authProvider.spec.ts",
|
|
16
|
-
"blocks": "npx jest src/blocks/blocks.spec.ts",
|
|
17
|
-
"fileuploading": "npx jest src/file-uploading/fileuploading.spec.ts",
|
|
18
|
-
"forms": "npx jest src/forms/forms.spec.ts",
|
|
19
|
-
"formsdata": "npx jest src/formsData/formsdata.spec.ts",
|
|
20
|
-
"generaltypes": "npx jest src/general-types/generaltypes.spec.ts",
|
|
21
|
-
"integrationcollections": "npx jest src/integration-collections/integrationcollections.spec.ts",
|
|
22
|
-
"locales": "npx jest src/locales/locales.spec.ts",
|
|
23
|
-
"menus": "npx jest src/menus/menus.spec.ts",
|
|
24
|
-
"orders": "npx jest src/orders/orders.spec.ts",
|
|
25
|
-
"pages": "npx jest src/pages/pages.spec.ts",
|
|
26
|
-
"payments": "npx jest src/payments/payments.spec.ts",
|
|
27
|
-
"productstatuses": "npx jest src/product-statuses/productstatuses.spec.ts",
|
|
28
|
-
"products": "npx jest src/products/products.spec.ts",
|
|
29
|
-
"templates": "npx jest src/templates/templates.spec.ts",
|
|
30
|
-
"templatespreview": "npx jest src/templates-preview/templatespreview.spec.ts",
|
|
31
|
-
"users": "npx jest src/users/users.spec.ts",
|
|
13
|
+
"admins": "npx jest src/admins/tests/admins.spec.ts",
|
|
14
|
+
"attributesets": "npx jest src/attribute-sets/tests/attributesets.spec.ts",
|
|
15
|
+
"authProvider": "npx jest src/auth-provider/tests/authProvider.spec.ts",
|
|
16
|
+
"blocks": "npx jest src/blocks/tests/blocks.spec.ts",
|
|
17
|
+
"fileuploading": "npx jest src/file-uploading/tests/fileuploading.spec.ts",
|
|
18
|
+
"forms": "npx jest src/forms/tests/forms.spec.ts",
|
|
19
|
+
"formsdata": "npx jest src/formsData/tests/formsdata.spec.ts",
|
|
20
|
+
"generaltypes": "npx jest src/general-types/tests/generaltypes.spec.ts",
|
|
21
|
+
"integrationcollections": "npx jest src/integration-collections/tests/integrationcollections.spec.ts",
|
|
22
|
+
"locales": "npx jest src/locales/tests/locales.spec.ts",
|
|
23
|
+
"menus": "npx jest src/menus/tests/menus.spec.ts",
|
|
24
|
+
"orders": "npx jest src/orders/tests/orders.spec.ts",
|
|
25
|
+
"pages": "npx jest src/pages/tests/pages.spec.ts",
|
|
26
|
+
"payments": "npx jest src/payments/tests/payments.spec.ts",
|
|
27
|
+
"productstatuses": "npx jest src/product-statuses/tests/productstatuses.spec.ts",
|
|
28
|
+
"products": "npx jest src/products/tests/products.spec.ts",
|
|
29
|
+
"templates": "npx jest src/templates/tests/templates.spec.ts",
|
|
30
|
+
"templatespreview": "npx jest src/templates-preview/tests/templatespreview.spec.ts",
|
|
31
|
+
"users": "npx jest src/users/tests/users.spec.ts",
|
|
32
32
|
"lint": "npx eslint",
|
|
33
33
|
"build": "npx tsc",
|
|
34
|
-
"readme": "node readme.js"
|
|
34
|
+
"readme": "node ./src/readme.js"
|
|
35
35
|
},
|
|
36
36
|
"bin": {
|
|
37
37
|
"oneentry": "./configure.js"
|