oneentry 1.0.40 → 1.0.42
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 +16 -16
- package/dist/base/oneEntry.js +16 -11
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ Now you can use the following links to jump to specific entries:
|
|
|
91
91
|
- [TemplatePreviews](#templatepreviews)
|
|
92
92
|
|
|
93
93
|
|
|
94
|
-
<h2 id="admins"> Admins </h2>
|
|
94
|
+
## <h2 id="admins"> Admins </h2>
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
```js
|
|
@@ -162,7 +162,7 @@ example: 192
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
|
|
165
|
-
<h2 id="attributessets"> AttributesSets </h2>
|
|
165
|
+
## <h2 id="attributessets"> AttributesSets </h2>
|
|
166
166
|
|
|
167
167
|
```js
|
|
168
168
|
const { AttributesSets } = defineOneEntry('your-url');
|
|
@@ -328,7 +328,7 @@ example: List [ OrderedMap { "title": "red", "value": 1, "position": 1, "extende
|
|
|
328
328
|
---
|
|
329
329
|
|
|
330
330
|
|
|
331
|
-
<h2 id="blocks"> Blocks </h2>
|
|
331
|
+
## <h2 id="blocks"> Blocks </h2>
|
|
332
332
|
|
|
333
333
|
```js
|
|
334
334
|
const { Blocks } = defineOneEntry('your-url');
|
|
@@ -432,7 +432,7 @@ example: null
|
|
|
432
432
|
|
|
433
433
|
|
|
434
434
|
|
|
435
|
-
<h2 id="fileuploading"> FileUploading </h2>
|
|
435
|
+
## <h2 id="fileuploading"> FileUploading </h2>
|
|
436
436
|
|
|
437
437
|
const { FileUploading } = defineOneEntry('your-url');
|
|
438
438
|
|
|
@@ -515,7 +515,7 @@ Example return:
|
|
|
515
515
|
|
|
516
516
|
|
|
517
517
|
|
|
518
|
-
<h2 id="forms"> Forms </h2>
|
|
518
|
+
## <h2 id="forms"> Forms </h2>
|
|
519
519
|
|
|
520
520
|
|
|
521
521
|
const { Forms } = defineOneEntry('your-url');
|
|
@@ -724,7 +724,7 @@ example: List [ OrderedMap { "type": "list", "marker": "l1", "position": 2, "lis
|
|
|
724
724
|
---
|
|
725
725
|
|
|
726
726
|
|
|
727
|
-
<h2 id="formdata"> FormData </h2>
|
|
727
|
+
## <h2 id="formdata"> FormData </h2>
|
|
728
728
|
|
|
729
729
|
const { FormData } = defineOneEntry('your-url');
|
|
730
730
|
|
|
@@ -870,7 +870,7 @@ example: test-form
|
|
|
870
870
|
---
|
|
871
871
|
|
|
872
872
|
|
|
873
|
-
<h2 id="generaltypes"> GeneralTypes </h2>
|
|
873
|
+
## <h2 id="generaltypes"> GeneralTypes </h2>
|
|
874
874
|
|
|
875
875
|
const { GeneralTypes } = defineOneEntry('your-url');
|
|
876
876
|
|
|
@@ -909,7 +909,7 @@ Enum:
|
|
|
909
909
|
---
|
|
910
910
|
|
|
911
911
|
|
|
912
|
-
<h2 id="locales"> Locales </h2>
|
|
912
|
+
## <h2 id="locales"> Locales </h2>
|
|
913
913
|
|
|
914
914
|
```js
|
|
915
915
|
const { Locales } = defineOneEntry('your-url')
|
|
@@ -979,7 +979,7 @@ description:position number
|
|
|
979
979
|
|
|
980
980
|
|
|
981
981
|
|
|
982
|
-
<h2 id="markers"> Markers </h2>
|
|
982
|
+
## <h2 id="markers"> Markers </h2>
|
|
983
983
|
|
|
984
984
|
|
|
985
985
|
```js
|
|
@@ -1150,7 +1150,7 @@ example: OrderedMap { "en_US": OrderedMap { "title": "My marker" } }
|
|
|
1150
1150
|
|
|
1151
1151
|
---
|
|
1152
1152
|
|
|
1153
|
-
<h2 id="menus"> Menus </h2>
|
|
1153
|
+
## <h2 id="menus"> Menus </h2>
|
|
1154
1154
|
|
|
1155
1155
|
## Menus
|
|
1156
1156
|
|
|
@@ -1215,7 +1215,7 @@ example: List [ OrderedMap { "id": 11, "pageUrl": "122", "localizeInfos": Ordere
|
|
|
1215
1215
|
|
|
1216
1216
|
---
|
|
1217
1217
|
|
|
1218
|
-
<h2 id="pages"> Pages </h2>
|
|
1218
|
+
## <h2 id="pages"> Pages </h2>
|
|
1219
1219
|
|
|
1220
1220
|
```js
|
|
1221
1221
|
const { Pages } = defineOneEntry('your-url')
|
|
@@ -2176,7 +2176,7 @@ Example return:
|
|
|
2176
2176
|
---
|
|
2177
2177
|
|
|
2178
2178
|
|
|
2179
|
-
<h2 id="products"> Products </h2>
|
|
2179
|
+
## <h2 id="products"> Products </h2>
|
|
2180
2180
|
|
|
2181
2181
|
|
|
2182
2182
|
```js
|
|
@@ -3040,7 +3040,7 @@ example: my-template-short
|
|
|
3040
3040
|
---
|
|
3041
3041
|
|
|
3042
3042
|
|
|
3043
|
-
<h2 id="productstatuses"> ProductStatuses </h2>
|
|
3043
|
+
## <h2 id="productstatuses"> ProductStatuses </h2>
|
|
3044
3044
|
|
|
3045
3045
|
|
|
3046
3046
|
```js
|
|
@@ -3201,7 +3201,7 @@ true
|
|
|
3201
3201
|
---
|
|
3202
3202
|
|
|
3203
3203
|
|
|
3204
|
-
<h2 id="system"> System </h2>
|
|
3204
|
+
## <h2 id="system"> System </h2>
|
|
3205
3205
|
|
|
3206
3206
|
## System
|
|
3207
3207
|
|
|
@@ -3226,7 +3226,7 @@ const value = await System.test500()
|
|
|
3226
3226
|
> This method allows you to redirect to the error page.
|
|
3227
3227
|
|
|
3228
3228
|
|
|
3229
|
-
<h2 id="templates"> Templates </h2>
|
|
3229
|
+
## <h2 id="templates"> Templates </h2>
|
|
3230
3230
|
|
|
3231
3231
|
## Templates
|
|
3232
3232
|
|
|
@@ -3389,7 +3389,7 @@ general type name
|
|
|
3389
3389
|
---
|
|
3390
3390
|
|
|
3391
3391
|
|
|
3392
|
-
<h2 id="templatepreviews"> TemplatePreviews </h2>
|
|
3392
|
+
## <h2 id="templatepreviews"> TemplatePreviews </h2>
|
|
3393
3393
|
|
|
3394
3394
|
## TemplatePreviews
|
|
3395
3395
|
|
package/dist/base/oneEntry.js
CHANGED
|
@@ -118,19 +118,24 @@ class OneEntry {
|
|
|
118
118
|
return result.slice(0, (result.length - 1));
|
|
119
119
|
}
|
|
120
120
|
_normalizeData(data) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
121
|
+
if (Array.isArray(data)) {
|
|
122
|
+
return data.map(item => this._normalizeData(item));
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
const normalizeData = {};
|
|
126
|
+
for (let key in data) {
|
|
127
|
+
if (Array.isArray(data[key]) || !data[key] || typeof data[key] !== 'object') {
|
|
128
|
+
normalizeData[key] = data[key];
|
|
129
|
+
}
|
|
130
|
+
else if (data[key][this._defaultLangCode]) {
|
|
131
|
+
normalizeData[key] = data[key][this._defaultLangCode];
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
normalizeData[key] = this._normalizeData(data[key]);
|
|
135
|
+
}
|
|
131
136
|
}
|
|
137
|
+
return normalizeData;
|
|
132
138
|
}
|
|
133
|
-
return normalizeData;
|
|
134
139
|
}
|
|
135
140
|
}
|
|
136
141
|
exports.default = OneEntry;
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,9 @@ interface IDefineApi {
|
|
|
36
36
|
/**
|
|
37
37
|
* Define API.
|
|
38
38
|
* @param {string} url - URl of your project.
|
|
39
|
+
* @param {IConfig} config - Custom configuration settings
|
|
40
|
+
* @param {string} [config.token] - Optional token parameter
|
|
41
|
+
* @param {string} [config.langCode] - Optional langCode parameter
|
|
39
42
|
* @returns {IDefineApi} - List of methods set.
|
|
40
43
|
*/
|
|
41
44
|
export declare function defineOneEntry(url: string, config: IConfig): IDefineApi;
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,9 @@ const markersApi_1 = require("./markers/markersApi");
|
|
|
20
20
|
/**
|
|
21
21
|
* Define API.
|
|
22
22
|
* @param {string} url - URl of your project.
|
|
23
|
+
* @param {IConfig} config - Custom configuration settings
|
|
24
|
+
* @param {string} [config.token] - Optional token parameter
|
|
25
|
+
* @param {string} [config.langCode] - Optional langCode parameter
|
|
23
26
|
* @returns {IDefineApi} - List of methods set.
|
|
24
27
|
*/
|
|
25
28
|
function defineOneEntry(url, config) {
|