oneentry 1.0.18 → 1.0.20
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 +41 -41
- package/dist/base/oneEntry.d.ts +5 -0
- package/dist/base/oneEntry.js +58 -0
- package/dist/base/oneEntry.js.map +1 -1
- package/dist/base/utils.d.ts +19 -1
- package/dist/forms/formsInterfaces.d.ts +2 -2
- package/dist/pages/pagesApi.d.ts +15 -14
- package/dist/pages/pagesApi.js +14 -14
- package/dist/pages/pagesApi.js.map +1 -1
- package/dist/pages/pagesInterfaces.d.ts +11 -11
- package/dist/products/productsApi.d.ts +15 -15
- package/dist/products/productsApi.js +24 -51
- package/dist/products/productsApi.js.map +1 -1
- package/dist/products/productsInterfaces.d.ts +7 -8
- package/dist/templates/templatesInterfaces.d.ts +2 -2
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +2 -2
- package/package.json +3 -5
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ To install the OneEntry Headless CMS SDK in your project, run the following comm
|
|
|
18
18
|
```
|
|
19
19
|
npm install oneentry
|
|
20
20
|
```
|
|
21
|
-
>
|
|
21
|
+
>
|
|
22
22
|
|
|
23
23
|
# Usage
|
|
24
24
|
|
|
@@ -100,7 +100,7 @@ const value = await Forms.getAllForms()
|
|
|
100
100
|
|
|
101
101
|
> This method retrieves all form objects from the API. It returns a Promise that resolves to an array of FormEntity objects.
|
|
102
102
|
|
|
103
|
-
Example return:
|
|
103
|
+
Example return:
|
|
104
104
|
```
|
|
105
105
|
[
|
|
106
106
|
{
|
|
@@ -108,7 +108,7 @@ Example return:
|
|
|
108
108
|
"attributeSetId": 0,
|
|
109
109
|
"processingType": "email",
|
|
110
110
|
"localizeInfos": {
|
|
111
|
-
"
|
|
111
|
+
"en_US": {
|
|
112
112
|
"title": "My form",
|
|
113
113
|
"titleForSite": "",
|
|
114
114
|
"successMessage": "",
|
|
@@ -150,7 +150,7 @@ Example return:
|
|
|
150
150
|
"attributeSetId": 0,
|
|
151
151
|
"processingType": "email",
|
|
152
152
|
"localizeInfos": {
|
|
153
|
-
"
|
|
153
|
+
"en_US": {
|
|
154
154
|
"title": "Моя форма",
|
|
155
155
|
"titleForSite": "",
|
|
156
156
|
"successMessage": "",
|
|
@@ -380,7 +380,7 @@ Example return:
|
|
|
380
380
|
"pageUrl": "string",
|
|
381
381
|
"depth": 3,
|
|
382
382
|
"localizeInfos": {
|
|
383
|
-
|
|
383
|
+
{
|
|
384
384
|
"title": "Catalog",
|
|
385
385
|
"content": "Content from catalog",
|
|
386
386
|
"menuTitle": "Catalog"
|
|
@@ -398,7 +398,7 @@ Example return:
|
|
|
398
398
|
],
|
|
399
399
|
"templateIdentifier": "my-template",
|
|
400
400
|
"attributeValues": {
|
|
401
|
-
|
|
401
|
+
{
|
|
402
402
|
"marker": {
|
|
403
403
|
"value": "",
|
|
404
404
|
"type": "string"
|
|
@@ -432,7 +432,7 @@ Example return:
|
|
|
432
432
|
"pageUrl": "string",
|
|
433
433
|
"depth": 3,
|
|
434
434
|
"localizeInfos": {
|
|
435
|
-
|
|
435
|
+
{
|
|
436
436
|
"title": "Catalog",
|
|
437
437
|
"content": "Content from catalog",
|
|
438
438
|
"menuTitle": "Catalog"
|
|
@@ -450,7 +450,7 @@ Example return:
|
|
|
450
450
|
],
|
|
451
451
|
"templateIdentifier": "my-template",
|
|
452
452
|
"attributeValues": {
|
|
453
|
-
|
|
453
|
+
{
|
|
454
454
|
"marker": {
|
|
455
455
|
"value": "",
|
|
456
456
|
"type": "string"
|
|
@@ -483,7 +483,7 @@ Example return:
|
|
|
483
483
|
"pageUrl": "string",
|
|
484
484
|
"depth": 3,
|
|
485
485
|
"localizeInfos": {
|
|
486
|
-
|
|
486
|
+
{
|
|
487
487
|
"title": "Catalog",
|
|
488
488
|
"content": "Content for catalog",
|
|
489
489
|
"menuTitle": "Catalog"
|
|
@@ -501,7 +501,7 @@ Example return:
|
|
|
501
501
|
],
|
|
502
502
|
"templateIdentifier": "my-template",
|
|
503
503
|
"attributeValues": {
|
|
504
|
-
|
|
504
|
+
{
|
|
505
505
|
"marker": {
|
|
506
506
|
"value": "",
|
|
507
507
|
"type": "string"
|
|
@@ -528,7 +528,7 @@ const value = await Pages.getPageById(1, 'en_US')
|
|
|
528
528
|
"pageUrl": "string",
|
|
529
529
|
"depth": 3,
|
|
530
530
|
"localizeInfos": {
|
|
531
|
-
|
|
531
|
+
{
|
|
532
532
|
"title": "Catalog",
|
|
533
533
|
"content": "Content from catalog",
|
|
534
534
|
"menuTitle": "Catalog"
|
|
@@ -546,7 +546,7 @@ const value = await Pages.getPageById(1, 'en_US')
|
|
|
546
546
|
"templateIdentifier": "my-template",
|
|
547
547
|
"attributeSetId": 7,
|
|
548
548
|
"attributeValues": {
|
|
549
|
-
|
|
549
|
+
{
|
|
550
550
|
"marker": "opisanine",
|
|
551
551
|
"type": "string",
|
|
552
552
|
"value": ""
|
|
@@ -571,7 +571,7 @@ Example return:
|
|
|
571
571
|
"pageUrl": "string",
|
|
572
572
|
"depth": 3,
|
|
573
573
|
"localizeInfos": {
|
|
574
|
-
|
|
574
|
+
{
|
|
575
575
|
"title": "Catalog",
|
|
576
576
|
"content": "Content from catalog",
|
|
577
577
|
"menuTitle": "Catalog"
|
|
@@ -589,7 +589,7 @@ Example return:
|
|
|
589
589
|
"templateIdentifier": "my-template",
|
|
590
590
|
"attributeSetId": 7,
|
|
591
591
|
"attributeValues": {
|
|
592
|
-
|
|
592
|
+
{
|
|
593
593
|
"marker": "opisanine",
|
|
594
594
|
"type": "string",
|
|
595
595
|
"value": ""
|
|
@@ -628,7 +628,7 @@ Example return:
|
|
|
628
628
|
{
|
|
629
629
|
"id": 1764,
|
|
630
630
|
"localizeInfos": {
|
|
631
|
-
|
|
631
|
+
{
|
|
632
632
|
"title": "Product"
|
|
633
633
|
}
|
|
634
634
|
},
|
|
@@ -653,7 +653,7 @@ Example return:
|
|
|
653
653
|
"templateIdentifier": "my-template",
|
|
654
654
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
655
655
|
"attributeValues": {
|
|
656
|
-
|
|
656
|
+
{
|
|
657
657
|
"marker": {
|
|
658
658
|
"value": "",
|
|
659
659
|
"type": "string"
|
|
@@ -688,19 +688,19 @@ This module accepts a set of user parameters called userQuery. If the parameters
|
|
|
688
688
|
```
|
|
689
689
|
"conditionMarker" by which values are filtered (not set by default), possible values:
|
|
690
690
|
> 'in' - Contains,
|
|
691
|
-
>
|
|
691
|
+
>
|
|
692
692
|
> 'nin' - Does not contain,
|
|
693
|
-
>
|
|
693
|
+
>
|
|
694
694
|
> 'eq' - Equal,
|
|
695
|
-
>
|
|
695
|
+
>
|
|
696
696
|
> 'neq' - Not equal,
|
|
697
|
-
>
|
|
697
|
+
>
|
|
698
698
|
> 'mth' - Greater than,
|
|
699
|
-
>
|
|
699
|
+
>
|
|
700
700
|
> 'lth' - Less than,
|
|
701
|
-
>
|
|
701
|
+
>
|
|
702
702
|
> 'exs' - Exists,
|
|
703
|
-
>
|
|
703
|
+
>
|
|
704
704
|
> 'nexs' - Does not exist
|
|
705
705
|
|
|
706
706
|
### getProducts
|
|
@@ -716,7 +716,7 @@ Example return:
|
|
|
716
716
|
{
|
|
717
717
|
"id": 1764,
|
|
718
718
|
"localizeInfos": {
|
|
719
|
-
|
|
719
|
+
{
|
|
720
720
|
"title": "Product"
|
|
721
721
|
}
|
|
722
722
|
},
|
|
@@ -741,7 +741,7 @@ Example return:
|
|
|
741
741
|
"templateIdentifier": "my-template",
|
|
742
742
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
743
743
|
"attributeValues": {
|
|
744
|
-
|
|
744
|
+
{
|
|
745
745
|
"marker": {
|
|
746
746
|
"value": "",
|
|
747
747
|
"type": "string"
|
|
@@ -765,7 +765,7 @@ Example return:
|
|
|
765
765
|
{
|
|
766
766
|
"id": 1764,
|
|
767
767
|
"localizeInfos": {
|
|
768
|
-
|
|
768
|
+
{
|
|
769
769
|
"title": "Product"
|
|
770
770
|
}
|
|
771
771
|
},
|
|
@@ -790,7 +790,7 @@ Example return:
|
|
|
790
790
|
"templateIdentifier": "my-template",
|
|
791
791
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
792
792
|
"attributeValues": {
|
|
793
|
-
|
|
793
|
+
{
|
|
794
794
|
"marker": {
|
|
795
795
|
"value": "",
|
|
796
796
|
"type": "string"
|
|
@@ -814,7 +814,7 @@ Example return:
|
|
|
814
814
|
{
|
|
815
815
|
"id": 1764,
|
|
816
816
|
"localizeInfos": {
|
|
817
|
-
|
|
817
|
+
{
|
|
818
818
|
"title": "Product"
|
|
819
819
|
}
|
|
820
820
|
},
|
|
@@ -839,7 +839,7 @@ Example return:
|
|
|
839
839
|
"templateIdentifier": "my-template",
|
|
840
840
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
841
841
|
"attributeValues": {
|
|
842
|
-
|
|
842
|
+
{
|
|
843
843
|
"marker": {
|
|
844
844
|
"value": "",
|
|
845
845
|
"type": "string"
|
|
@@ -863,7 +863,7 @@ Example return:
|
|
|
863
863
|
{
|
|
864
864
|
"id": 1764,
|
|
865
865
|
"localizeInfos": {
|
|
866
|
-
|
|
866
|
+
{
|
|
867
867
|
"title": "Product"
|
|
868
868
|
}
|
|
869
869
|
},
|
|
@@ -888,7 +888,7 @@ Example return:
|
|
|
888
888
|
"templateIdentifier": "my-template",
|
|
889
889
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
890
890
|
"attributeValues": {
|
|
891
|
-
|
|
891
|
+
{
|
|
892
892
|
"marker": {
|
|
893
893
|
"value": "",
|
|
894
894
|
"type": "string"
|
|
@@ -912,7 +912,7 @@ Example return:
|
|
|
912
912
|
{
|
|
913
913
|
"id": 1764,
|
|
914
914
|
"localizeInfos": {
|
|
915
|
-
|
|
915
|
+
{
|
|
916
916
|
"title": "Product"
|
|
917
917
|
}
|
|
918
918
|
},
|
|
@@ -937,7 +937,7 @@ Example return:
|
|
|
937
937
|
"templateIdentifier": "my-template",
|
|
938
938
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
939
939
|
"attributeValues": {
|
|
940
|
-
|
|
940
|
+
{
|
|
941
941
|
"marker": {
|
|
942
942
|
"value": "",
|
|
943
943
|
"type": "string"
|
|
@@ -960,7 +960,7 @@ Example return:
|
|
|
960
960
|
{
|
|
961
961
|
"id": 1764,
|
|
962
962
|
"localizeInfos": {
|
|
963
|
-
|
|
963
|
+
{
|
|
964
964
|
"title": "Product"
|
|
965
965
|
}
|
|
966
966
|
},
|
|
@@ -985,7 +985,7 @@ Example return:
|
|
|
985
985
|
"templateIdentifier": "my-template",
|
|
986
986
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
987
987
|
"attributeValues": {
|
|
988
|
-
|
|
988
|
+
{
|
|
989
989
|
"marker": {
|
|
990
990
|
"value": "",
|
|
991
991
|
"type": "string"
|
|
@@ -1026,7 +1026,7 @@ Example return:
|
|
|
1026
1026
|
{
|
|
1027
1027
|
"id": 1764,
|
|
1028
1028
|
"localizeInfos": {
|
|
1029
|
-
|
|
1029
|
+
{
|
|
1030
1030
|
"title": "Product"
|
|
1031
1031
|
}
|
|
1032
1032
|
},
|
|
@@ -1051,7 +1051,7 @@ Example return:
|
|
|
1051
1051
|
"templateIdentifier": "my-template",
|
|
1052
1052
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
1053
1053
|
"attributeValues": {
|
|
1054
|
-
|
|
1054
|
+
{
|
|
1055
1055
|
"marker": {
|
|
1056
1056
|
"value": "",
|
|
1057
1057
|
"type": "string"
|
|
@@ -1075,7 +1075,7 @@ Example return:
|
|
|
1075
1075
|
{
|
|
1076
1076
|
"id": 1764,
|
|
1077
1077
|
"localizeInfos": {
|
|
1078
|
-
|
|
1078
|
+
{
|
|
1079
1079
|
"title": "Product"
|
|
1080
1080
|
}
|
|
1081
1081
|
},
|
|
@@ -1100,7 +1100,7 @@ Example return:
|
|
|
1100
1100
|
"templateIdentifier": "my-template",
|
|
1101
1101
|
"shortDescTemplateIdentifier": "my-template-short",
|
|
1102
1102
|
"attributeValues": {
|
|
1103
|
-
|
|
1103
|
+
{
|
|
1104
1104
|
"marker": {
|
|
1105
1105
|
"value": "",
|
|
1106
1106
|
"type": "string"
|
|
@@ -1222,7 +1222,7 @@ Example return:
|
|
|
1222
1222
|
"generalTypeId": 2,
|
|
1223
1223
|
"generalTypeName": "forProductPreview",
|
|
1224
1224
|
"localizeInfos": {
|
|
1225
|
-
"
|
|
1225
|
+
"en_US": {
|
|
1226
1226
|
"title": "Product"
|
|
1227
1227
|
}
|
|
1228
1228
|
},
|
|
@@ -1257,7 +1257,7 @@ Example return:
|
|
|
1257
1257
|
"generalTypeId": 2,
|
|
1258
1258
|
"generalTypeName": "forCatalogProducts",
|
|
1259
1259
|
"localizeInfos": {
|
|
1260
|
-
"
|
|
1260
|
+
"en_US": {
|
|
1261
1261
|
"title": "Product"
|
|
1262
1262
|
}
|
|
1263
1263
|
},
|
package/dist/base/oneEntry.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { IProductsQuery } from '../products/productsInterfaces';
|
|
2
|
+
import { LangType } from "./utils";
|
|
2
3
|
export default abstract class OneEntry {
|
|
3
4
|
protected _url: string;
|
|
5
|
+
protected _LANGCODE_KEY: string;
|
|
4
6
|
constructor(url: string);
|
|
5
7
|
protected _getFullPath(path: string): string;
|
|
6
8
|
protected _fetchGet(path: string): Promise<any>;
|
|
7
9
|
protected _fetchPost(path: string, data: object): Promise<any>;
|
|
8
10
|
protected _queryParamsToString(query: IProductsQuery): string;
|
|
11
|
+
protected _parseLangFromString(str: string, lang: string): string;
|
|
12
|
+
protected _fetchRequests(url: string, lang: LangType): Promise<any>;
|
|
13
|
+
protected _normalizeData(data: any): any;
|
|
9
14
|
}
|
package/dist/base/oneEntry.js
CHANGED
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
class OneEntry {
|
|
13
13
|
constructor(url) {
|
|
14
|
+
this._LANGCODE_KEY = '$LANGCODE';
|
|
14
15
|
this._url = url;
|
|
15
16
|
}
|
|
16
17
|
_getFullPath(path) {
|
|
@@ -50,6 +51,63 @@ class OneEntry {
|
|
|
50
51
|
}
|
|
51
52
|
return result.slice(0, (result.length - 1));
|
|
52
53
|
}
|
|
54
|
+
_parseLangFromString(str, lang) {
|
|
55
|
+
const index = str.indexOf(this._LANGCODE_KEY);
|
|
56
|
+
if (index === -1) {
|
|
57
|
+
console.error('The endpoint does not contain a language template $LANGCODE');
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return str.slice(0, index) + lang + str.slice(index + this._LANGCODE_KEY.length);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_fetchRequests(url, lang) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const langCode = (typeof lang === 'string') ? [lang] : lang;
|
|
66
|
+
if (langCode.length === 1) {
|
|
67
|
+
const response = yield this._fetchGet(this._parseLangFromString(url, langCode[0]));
|
|
68
|
+
if (response.hasOwnProperty('items') || Array.isArray(response)) {
|
|
69
|
+
let result = Array.isArray(response) ? response : response.items;
|
|
70
|
+
result = result.map(item => this._normalizeData(item));
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
return this._normalizeData(response);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
const dataList = [];
|
|
77
|
+
yield Promise.all(langCode.map((lang) => __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
yield this._fetchGet(this._parseLangFromString(url, lang)).then((result) => {
|
|
79
|
+
result.hasOwnProperty('items') ? dataList.push(result.items) : dataList.push(result);
|
|
80
|
+
});
|
|
81
|
+
})));
|
|
82
|
+
const baseData = dataList.splice(0, 1)[0];
|
|
83
|
+
dataList.map(item => {
|
|
84
|
+
if (Array.isArray(item)) {
|
|
85
|
+
item.map((subitem, index) => {
|
|
86
|
+
Object.assign(baseData[index].attributeValues, subitem.attributeValues);
|
|
87
|
+
Object.assign(baseData[index].localizeInfos, subitem.localizeInfos);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
Object.assign(baseData.attributeValues, item.attributeValues);
|
|
92
|
+
Object.assign(baseData.localizeInfos, item.localizeInfos);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return baseData;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
_normalizeData(data) {
|
|
100
|
+
const normalizeData = Object.assign({}, data);
|
|
101
|
+
if (data.hasOwnProperty('attributeValues')) {
|
|
102
|
+
const key = Object.keys(data.attributeValues);
|
|
103
|
+
normalizeData.attributeValues = data.attributeValues[key[0]];
|
|
104
|
+
}
|
|
105
|
+
if (data.hasOwnProperty('localizeInfos')) {
|
|
106
|
+
const key = Object.keys(data.localizeInfos);
|
|
107
|
+
normalizeData.localizeInfos = data.localizeInfos[key[0]];
|
|
108
|
+
}
|
|
109
|
+
return normalizeData;
|
|
110
|
+
}
|
|
53
111
|
}
|
|
54
112
|
exports.default = OneEntry;
|
|
55
113
|
//# sourceMappingURL=oneEntry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oneEntry.js","sourceRoot":"","sources":["../../src/base/oneEntry.ts"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"oneEntry.js","sourceRoot":"","sources":["../../src/base/oneEntry.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,MAA8B,QAAQ;IAIlC,YAAY,GAAU;QAFZ,kBAAa,GAAU,WAAW,CAAA;QAGxC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;IAEnB,CAAC;IAES,YAAY,CAAC,IAAW;QAC9B,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;IAC7B,CAAC;IAEe,SAAS,CAAC,IAAW;;YACjC,MAAM,QAAQ,GAAG,MAAM,KAAK,C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7C,aAAa,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;SAC/D;QACD,IAAI,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE;YACtC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3C,aAAa,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;SAC3D;QACD,OAAO,aAAa,CAAA;IACxB,CAAC;CACJ;AAnHD,2BAmHC"}
|
package/dist/base/utils.d.ts
CHANGED
|
@@ -29,4 +29,22 @@ interface ILocalizeInfos {
|
|
|
29
29
|
[key: string]: string;
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
interface IAttributeSetEntity {
|
|
33
|
+
id: number;
|
|
34
|
+
updatedDate: string;
|
|
35
|
+
version: number;
|
|
36
|
+
identifier: string;
|
|
37
|
+
typeId: number;
|
|
38
|
+
localizeInfos: ILocalizeInfos;
|
|
39
|
+
schema: object;
|
|
40
|
+
position: {
|
|
41
|
+
id: number;
|
|
42
|
+
objectId: number;
|
|
43
|
+
objectType: string;
|
|
44
|
+
position: number | string;
|
|
45
|
+
};
|
|
46
|
+
positionId: number | string;
|
|
47
|
+
isVisible: boolean;
|
|
48
|
+
}
|
|
49
|
+
type LangType = string | Array<string>;
|
|
50
|
+
export { LanguageCode, ILocalizeInfos, Types, IAttributeSetEntity, LangType };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ILocalizeInfos } from "../base/utils";
|
|
2
|
-
import {
|
|
2
|
+
import { IAttributeSetEntity } from "../base/utils";
|
|
3
3
|
/**
|
|
4
4
|
* Represents an interface object of Forms Api.
|
|
5
5
|
*
|
|
@@ -31,7 +31,7 @@ interface IFormsEntity {
|
|
|
31
31
|
processingType: string;
|
|
32
32
|
localizeInfos: ILocalizeInfos;
|
|
33
33
|
processingData: object | string;
|
|
34
|
-
attributesValues:
|
|
34
|
+
attributesValues: IAttributeSetEntity;
|
|
35
35
|
version: number;
|
|
36
36
|
identifier: string;
|
|
37
37
|
position: number;
|
package/dist/pages/pagesApi.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import OneEntry from "../base/oneEntry";
|
|
2
2
|
import { IPageApi, IPageConfig, IPagesEntity, IPositionForm } from "./pagesInterfaces";
|
|
3
|
+
import { LangType } from "../base/utils";
|
|
3
4
|
/**
|
|
4
5
|
* Controllers for working with page objects, including catalog pages
|
|
5
6
|
*/
|
|
@@ -8,15 +9,15 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
8
9
|
/**
|
|
9
10
|
* Get all top-level page objects.
|
|
10
11
|
*
|
|
11
|
-
* @param {string} [langCode] Required parameter lang code
|
|
12
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
12
13
|
*
|
|
13
14
|
* @returns Returns all created pages without parents as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
14
15
|
*/
|
|
15
|
-
getRootPages(langCode:
|
|
16
|
+
getRootPages(langCode: LangType): Promise<Array<IPagesEntity>>;
|
|
16
17
|
/**
|
|
17
18
|
* Get all page objects with product information as an array.
|
|
18
19
|
*
|
|
19
|
-
* @param {string} [langCode] Required parameter lang code
|
|
20
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
20
21
|
*
|
|
21
22
|
* @param {number} [limit] - Optional parameter for pagination, default is 30
|
|
22
23
|
*
|
|
@@ -24,55 +25,55 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
24
25
|
*
|
|
25
26
|
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
26
27
|
*/
|
|
27
|
-
getCatalogPages(langCode:
|
|
28
|
+
getCatalogPages(langCode: LangType, limit?: number, offset?: number): Promise<Array<IPagesEntity>>;
|
|
28
29
|
/**
|
|
29
30
|
* Get all page objects with product information as an array.
|
|
30
31
|
*
|
|
31
|
-
* @param {string} [langCode] Required parameter lang code
|
|
32
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
32
33
|
*
|
|
33
34
|
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
34
35
|
*/
|
|
35
|
-
getPages(langCode:
|
|
36
|
+
getPages(langCode: LangType): Promise<Array<IPagesEntity>>;
|
|
36
37
|
/**
|
|
37
38
|
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
38
39
|
*
|
|
39
|
-
* @param {string} [langCode] Required parameter lang code
|
|
40
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
40
41
|
*
|
|
41
42
|
* @param {number} [id] - Page object identifier
|
|
42
43
|
*
|
|
43
44
|
* @returns Returns page object (DTO depends on the type of page being returned)
|
|
44
45
|
*/
|
|
45
|
-
getPageById(id: number, langCode:
|
|
46
|
+
getPageById(id: number, langCode: LangType): Promise<IPagesEntity>;
|
|
46
47
|
/**
|
|
47
48
|
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
48
49
|
*
|
|
49
|
-
* @param {string} [langCode] Required parameter lang code
|
|
50
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
50
51
|
*
|
|
51
52
|
* @param {string} [url] - Page URL
|
|
52
53
|
*
|
|
53
54
|
* @returns Returns page object (DTO depends on the type of page being returned)
|
|
54
55
|
*/
|
|
55
|
-
getPageByUrl(url: string, langCode:
|
|
56
|
+
getPageByUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
56
57
|
/**
|
|
57
58
|
* Get child pages object with information as an array.
|
|
58
59
|
*
|
|
59
|
-
* @param {string} [langCode] Required parameter lang code
|
|
60
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
60
61
|
*
|
|
61
62
|
* @param {string} [url] - Page URL
|
|
62
63
|
*
|
|
63
64
|
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data) for the selected parent
|
|
64
65
|
*/
|
|
65
|
-
getChildPagesByParentUrl(url: string, langCode:
|
|
66
|
+
getChildPagesByParentUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
66
67
|
/**
|
|
67
68
|
* Get all forms by page url.
|
|
68
69
|
*
|
|
69
|
-
* @param {string} [langCode] Required parameter lang code
|
|
70
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
70
71
|
*
|
|
71
72
|
* @param {string} [url] - Page URL
|
|
72
73
|
*
|
|
73
74
|
* @returns Returns all forms as an array of PositionFormDto objects or an empty array [] (if there is no data) for the selected parent
|
|
74
75
|
*/
|
|
75
|
-
getFormsByPageUrl(url: string, langCode:
|
|
76
|
+
getFormsByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionForm>>;
|
|
76
77
|
/**
|
|
77
78
|
* Get settings for the page.
|
|
78
79
|
*
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -21,20 +21,20 @@ class PageApi extends oneEntry_1.default {
|
|
|
21
21
|
/**
|
|
22
22
|
* Get all top-level page objects.
|
|
23
23
|
*
|
|
24
|
-
* @param {string} [langCode] Required parameter lang code
|
|
24
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
25
25
|
*
|
|
26
26
|
* @returns Returns all created pages without parents as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
27
27
|
*/
|
|
28
28
|
getRootPages(langCode) {
|
|
29
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const result = yield this.
|
|
30
|
+
const result = yield this._fetchRequests(`/root?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
31
31
|
return result;
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Get all page objects with product information as an array.
|
|
36
36
|
*
|
|
37
|
-
* @param {string} [langCode] Required parameter lang code
|
|
37
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
38
38
|
*
|
|
39
39
|
* @param {number} [limit] - Optional parameter for pagination, default is 30
|
|
40
40
|
*
|
|
@@ -44,27 +44,27 @@ class PageApi extends oneEntry_1.default {
|
|
|
44
44
|
*/
|
|
45
45
|
getCatalogPages(langCode, limit = 30, offset = 0) {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
const result = yield this.
|
|
47
|
+
const result = yield this._fetchRequests(`/catalog?langCode=${this._LANGCODE_KEY}&limit=${limit}&offset=${offset}`, langCode);
|
|
48
48
|
return result;
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Get all page objects with product information as an array.
|
|
53
53
|
*
|
|
54
|
-
* @param {string} [langCode] Required parameter lang code
|
|
54
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
55
55
|
*
|
|
56
56
|
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
57
57
|
*/
|
|
58
58
|
getPages(langCode) {
|
|
59
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
const result = yield this.
|
|
60
|
+
const result = yield this._fetchRequests(`?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
61
61
|
return result;
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
66
66
|
*
|
|
67
|
-
* @param {string} [langCode] Required parameter lang code
|
|
67
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
68
68
|
*
|
|
69
69
|
* @param {number} [id] - Page object identifier
|
|
70
70
|
*
|
|
@@ -72,14 +72,14 @@ class PageApi extends oneEntry_1.default {
|
|
|
72
72
|
*/
|
|
73
73
|
getPageById(id, langCode) {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
const result = yield this.
|
|
75
|
+
const result = yield this._fetchRequests(`?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
76
76
|
return result;
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
81
81
|
*
|
|
82
|
-
* @param {string} [langCode] Required parameter lang code
|
|
82
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
83
83
|
*
|
|
84
84
|
* @param {string} [url] - Page URL
|
|
85
85
|
*
|
|
@@ -87,14 +87,14 @@ class PageApi extends oneEntry_1.default {
|
|
|
87
87
|
*/
|
|
88
88
|
getPageByUrl(url, langCode) {
|
|
89
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
const result = yield this.
|
|
90
|
+
const result = yield this._fetchRequests(`/url/${url}?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
91
91
|
return result;
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* Get child pages object with information as an array.
|
|
96
96
|
*
|
|
97
|
-
* @param {string} [langCode] Required parameter lang code
|
|
97
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
98
98
|
*
|
|
99
99
|
* @param {string} [url] - Page URL
|
|
100
100
|
*
|
|
@@ -102,14 +102,14 @@ class PageApi extends oneEntry_1.default {
|
|
|
102
102
|
*/
|
|
103
103
|
getChildPagesByParentUrl(url, langCode) {
|
|
104
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
const result = yield this.
|
|
105
|
+
const result = yield this._fetchRequests(`/${url}/children?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
106
106
|
return result;
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Get all forms by page url.
|
|
111
111
|
*
|
|
112
|
-
* @param {string} [langCode] Required parameter lang code
|
|
112
|
+
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
113
113
|
*
|
|
114
114
|
* @param {string} [url] - Page URL
|
|
115
115
|
*
|
|
@@ -117,7 +117,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
117
117
|
*/
|
|
118
118
|
getFormsByPageUrl(url, langCode) {
|
|
119
119
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
const result = yield this.
|
|
120
|
+
const result = yield this._fetchRequests(`/${url}/forms?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
121
121
|
return result;
|
|
122
122
|
});
|
|
123
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagesApi.js","sourceRoot":"","sources":["../../src/pages/pagesApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAwC;
|
|
1
|
+
{"version":3,"file":"pagesApi.js","sourceRoot":"","sources":["../../src/pages/pagesApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAwC;AAIxC;;GAEG;AACH,MAAqB,OAAQ,SAAQ,kBAAQ;IACzC,YAAY,GAAW;QACnB,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAA;IACrC,CAAC;IAED;;;;;;OAMG;IACU,YAAY,CAAC,QAAiB;;YACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,kBAAkB,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;YACzF,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;;;;;OAUG;IACU,eAAe,CAAC,QAAiB,EAAE,QAAe,EAAE,EAAE,SAAgB,CAAC;;YAChF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,qBAAqB,IAAI,CAAC,aAAa,UAAU,KAAK,WAAW,MAAM,EAAE,EAAC,QAAQ,CAAC,CAAA;YAE5H,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,QAAQ,CAAC,QAAiB;;YACnC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;YAEpF,OAAO,MAAM,CAAA;Q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,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CAEJ;AAtID,0BAsIC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ILocalizeInfos, Types } from "../base/utils";
|
|
2
|
-
import {
|
|
1
|
+
import { ILocalizeInfos, LangType, Types } from "../base/utils";
|
|
2
|
+
import { IAttributeSetEntity } from "../base/utils";
|
|
3
3
|
import { IFormsEntity } from "../forms/formsInterfaces";
|
|
4
4
|
/**
|
|
5
5
|
* Represents an interface object of Pages Api.
|
|
@@ -23,15 +23,15 @@ import { IFormsEntity } from "../forms/formsInterfaces";
|
|
|
23
23
|
* @property {function} searchPage - Quick search for page objects with limited output.
|
|
24
24
|
*/
|
|
25
25
|
interface IPageApi {
|
|
26
|
-
getRootPages(langCode
|
|
27
|
-
getCatalogPages(langCode:
|
|
28
|
-
getPages(langCode:
|
|
29
|
-
getPageById(id: number, langCode:
|
|
30
|
-
getPageByUrl(url: string, langCode:
|
|
31
|
-
getChildPagesByParentUrl(url: string, langCode:
|
|
32
|
-
getFormsByPageUrl(url: string, langCode:
|
|
26
|
+
getRootPages(langCode?: LangType): Promise<Array<IPagesEntity>>;
|
|
27
|
+
getCatalogPages(langCode: LangType, limit: number, offset: number): Promise<Array<IPagesEntity>>;
|
|
28
|
+
getPages(langCode: LangType): Promise<Array<IPagesEntity>>;
|
|
29
|
+
getPageById(id: number, langCode: LangType): Promise<IPagesEntity>;
|
|
30
|
+
getPageByUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
31
|
+
getChildPagesByParentUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
32
|
+
getFormsByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionForm>>;
|
|
33
33
|
getConfigPageByUrl(url: string): Promise<IPageConfig>;
|
|
34
|
-
searchPage(name: string, langCode:
|
|
34
|
+
searchPage(name: string, langCode: LangType): Promise<Array<IPagesEntity>>;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Represents a config object.
|
|
@@ -66,7 +66,7 @@ interface IPositionForm {
|
|
|
66
66
|
updatedDate: Date | string;
|
|
67
67
|
version: number;
|
|
68
68
|
identifier: string;
|
|
69
|
-
attributesSets:
|
|
69
|
+
attributesSets: IAttributeSetEntity;
|
|
70
70
|
attributeSetId: number;
|
|
71
71
|
processingType: string;
|
|
72
72
|
localizeInfos: ILocalizeInfos;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IProductsQuery, IFilterParams, IProductApi, IProductsEntity } from './productsInterfaces';
|
|
2
2
|
import OneEntry from '../base/oneEntry';
|
|
3
|
+
import { LangType } from "../base/utils";
|
|
3
4
|
/**
|
|
4
5
|
* Controllers for working with product pages
|
|
5
6
|
*/
|
|
@@ -9,6 +10,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
9
10
|
/**
|
|
10
11
|
* Search for all product page objects with pagination and filtering.
|
|
11
12
|
*
|
|
13
|
+
* @param {string | Array<string>} [langCode] - Language code parameter. Default "en_US"
|
|
12
14
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
13
15
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
14
16
|
*
|
|
@@ -30,10 +32,11 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
30
32
|
*
|
|
31
33
|
* @returns {Promise<IProductsEntity[]>} - List of products.
|
|
32
34
|
*/
|
|
33
|
-
getProducts(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
35
|
+
getProducts(langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
34
36
|
/**
|
|
35
37
|
* Search for all product page objects with pagination that do not have a category.
|
|
36
38
|
*
|
|
39
|
+
* @param {string | Array<string>} [langCode] - Language code parameter. Default "en_US"
|
|
37
40
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
38
41
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
39
42
|
*
|
|
@@ -47,20 +50,20 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
47
50
|
*
|
|
48
51
|
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
49
52
|
*
|
|
50
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
51
|
-
*
|
|
52
53
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
53
54
|
*
|
|
54
55
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
55
56
|
*
|
|
56
57
|
* @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
57
58
|
*/
|
|
58
|
-
getProductsEmptyPage(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
59
|
+
getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
59
60
|
/**
|
|
60
61
|
* Search for all product page objects with pagination for the selected category.
|
|
61
62
|
*
|
|
62
63
|
* @param {number} [id] - Page identifier.
|
|
63
64
|
*
|
|
65
|
+
* @param {string | Array<string>} [langCode] - Language code parameter. Default "en_US"
|
|
66
|
+
*
|
|
64
67
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
65
68
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
66
69
|
*
|
|
@@ -74,20 +77,20 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
74
77
|
*
|
|
75
78
|
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
76
79
|
*
|
|
77
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
78
|
-
*
|
|
79
80
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
80
81
|
*
|
|
81
82
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
82
83
|
*
|
|
83
84
|
* @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
84
85
|
*/
|
|
85
|
-
getProductsPageById(id: number, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
86
|
+
getProductsPageById(id: number, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
86
87
|
/**
|
|
87
88
|
* Search for all product page objects with pagination for the selected category (by its URL).
|
|
88
89
|
*
|
|
89
90
|
* @param {string} [url] - URL of the category page.
|
|
90
91
|
*
|
|
92
|
+
* @param {string | Array<string>} [langCode] - Language code parameter. Default "en_US"
|
|
93
|
+
*
|
|
91
94
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
92
95
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
93
96
|
*
|
|
@@ -103,18 +106,18 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
103
106
|
*
|
|
104
107
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
105
108
|
*
|
|
106
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
107
|
-
*
|
|
108
109
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
109
110
|
*
|
|
110
111
|
* @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
111
112
|
*/
|
|
112
|
-
getProductsPageByUrl(url: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
113
|
+
getProductsPageByUrl(url: string, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
113
114
|
/**
|
|
114
115
|
* Find all related product page objects.
|
|
115
116
|
*
|
|
116
117
|
* @param {number} [id] - Product page identifier for which to find relationship.
|
|
117
118
|
*
|
|
119
|
+
* @param {string | Array<string>} [langCode] - Language code parameter. Default "en_US"
|
|
120
|
+
*
|
|
118
121
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
119
122
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
120
123
|
*
|
|
@@ -122,13 +125,11 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
122
125
|
*
|
|
123
126
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
124
127
|
*
|
|
125
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
126
|
-
*
|
|
127
128
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
128
129
|
*
|
|
129
130
|
* @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
130
131
|
*/
|
|
131
|
-
getRelatedProductsById(id: number, userQuery?: IProductsQuery): Promise<IProductsEntity>;
|
|
132
|
+
getRelatedProductsById(id: number, langCode?: LangType, userQuery?: IProductsQuery): Promise<IProductsEntity>;
|
|
132
133
|
/**
|
|
133
134
|
* Retrieve one product object.
|
|
134
135
|
*
|
|
@@ -138,7 +139,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
138
139
|
*
|
|
139
140
|
* @returns {Promise<IProductsEntity>} - Returns ContentIndexedProductDto object for the product.
|
|
140
141
|
*/
|
|
141
|
-
getProductById(id: number, langCode?:
|
|
142
|
+
getProductById(id: number, langCode?: LangType): Promise<IProductsEntity>;
|
|
142
143
|
/**
|
|
143
144
|
* Find all product page objects with pagination and multiple filtering.
|
|
144
145
|
*
|
|
@@ -183,5 +184,4 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
183
184
|
* @returns {Promise<IProductsEntity[]>} - Returns array of ContentIndexedProductDto object for the product.
|
|
184
185
|
*/
|
|
185
186
|
searchProduct(name: string, langCode?: string): Promise<Array<IProductsEntity>>;
|
|
186
|
-
private _normalizeProductData;
|
|
187
187
|
}
|
|
@@ -23,7 +23,6 @@ class ProductApi extends oneEntry_1.default {
|
|
|
23
23
|
conditionValue: null,
|
|
24
24
|
conditionMarker: null,
|
|
25
25
|
attributeMarker: null,
|
|
26
|
-
langCode: 'en_US',
|
|
27
26
|
sortOrder: 'DESC',
|
|
28
27
|
sortKey: 'id'
|
|
29
28
|
};
|
|
@@ -32,6 +31,7 @@ class ProductApi extends oneEntry_1.default {
|
|
|
32
31
|
/**
|
|
33
32
|
* Search for all product page objects with pagination and filtering.
|
|
34
33
|
*
|
|
34
|
+
* @param {string | Array<string>} [langCode] - Language code parameter. Default "en_US"
|
|
35
35
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
36
36
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
37
37
|
*
|
|
@@ -53,16 +53,17 @@ class ProductApi extends oneEntry_1.default {
|
|
|
53
53
|
*
|
|
54
54
|
* @returns {Promise<IProductsEntity[]>} - List of products.
|
|
55
55
|
*/
|
|
56
|
-
getProducts(userQuery) {
|
|
56
|
+
getProducts(langCode = 'en_US', userQuery) {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
58
|
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
59
|
-
const result = yield this.
|
|
60
|
-
return result
|
|
59
|
+
const result = yield this._fetchRequests(`?langCode=${this._LANGCODE_KEY}&` + this._queryParamsToString(query), langCode);
|
|
60
|
+
return result;
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Search for all product page objects with pagination that do not have a category.
|
|
65
65
|
*
|
|
66
|
+
* @param {string | Array<string>} [langCode] - Language code parameter. Default "en_US"
|
|
66
67
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
67
68
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
68
69
|
*
|
|
@@ -76,18 +77,16 @@ class ProductApi extends oneEntry_1.default {
|
|
|
76
77
|
*
|
|
77
78
|
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
78
79
|
*
|
|
79
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
80
|
-
*
|
|
81
80
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
82
81
|
*
|
|
83
82
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
84
83
|
*
|
|
85
84
|
* @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
86
85
|
*/
|
|
87
|
-
getProductsEmptyPage(userQuery) {
|
|
86
|
+
getProductsEmptyPage(langCode = 'en_US', userQuery) {
|
|
88
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
88
|
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
90
|
-
const result = yield this.
|
|
89
|
+
const result = yield this._fetchRequests(`/empty-page?langCode=${this._LANGCODE_KEY}&` + this._queryParamsToString(query), langCode);
|
|
91
90
|
return result;
|
|
92
91
|
});
|
|
93
92
|
}
|
|
@@ -96,6 +95,8 @@ class ProductApi extends oneEntry_1.default {
|
|
|
96
95
|
*
|
|
97
96
|
* @param {number} [id] - Page identifier.
|
|
98
97
|
*
|
|
98
|
+
* @param {string | Array<string>} [langCode] - Language code parameter. Default "en_US"
|
|
99
|
+
*
|
|
99
100
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
100
101
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
101
102
|
*
|
|
@@ -109,19 +110,17 @@ class ProductApi extends oneEntry_1.default {
|
|
|
109
110
|
*
|
|
110
111
|
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
111
112
|
*
|
|
112
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
113
|
-
*
|
|
114
113
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
115
114
|
*
|
|
116
115
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
117
116
|
*
|
|
118
117
|
* @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
119
118
|
*/
|
|
120
|
-
getProductsPageById(id, userQuery) {
|
|
119
|
+
getProductsPageById(id, langCode = 'en_US', userQuery) {
|
|
121
120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
121
|
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
123
|
-
const result = yield this.
|
|
124
|
-
return result
|
|
122
|
+
const result = yield this._fetchRequests(`/page/${id}?langCode=${this._LANGCODE_KEY}&` + this._queryParamsToString(query), langCode);
|
|
123
|
+
return result;
|
|
125
124
|
});
|
|
126
125
|
}
|
|
127
126
|
/**
|
|
@@ -129,6 +128,8 @@ class ProductApi extends oneEntry_1.default {
|
|
|
129
128
|
*
|
|
130
129
|
* @param {string} [url] - URL of the category page.
|
|
131
130
|
*
|
|
131
|
+
* @param {string | Array<string>} [langCode] - Language code parameter. Default "en_US"
|
|
132
|
+
*
|
|
132
133
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
133
134
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
134
135
|
*
|
|
@@ -144,17 +145,15 @@ class ProductApi extends oneEntry_1.default {
|
|
|
144
145
|
*
|
|
145
146
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
146
147
|
*
|
|
147
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
148
|
-
*
|
|
149
148
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
150
149
|
*
|
|
151
150
|
* @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
152
151
|
*/
|
|
153
|
-
getProductsPageByUrl(url, userQuery) {
|
|
152
|
+
getProductsPageByUrl(url, langCode = 'en_US', userQuery) {
|
|
154
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
155
154
|
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
156
|
-
const result = yield this.
|
|
157
|
-
return result
|
|
155
|
+
const result = yield this._fetchRequests(`/page/url/${url}?langCode=${this._LANGCODE_KEY}&` + this._queryParamsToString(query), langCode);
|
|
156
|
+
return result;
|
|
158
157
|
});
|
|
159
158
|
}
|
|
160
159
|
/**
|
|
@@ -162,6 +161,8 @@ class ProductApi extends oneEntry_1.default {
|
|
|
162
161
|
*
|
|
163
162
|
* @param {number} [id] - Product page identifier for which to find relationship.
|
|
164
163
|
*
|
|
164
|
+
* @param {string | Array<string>} [langCode] - Language code parameter. Default "en_US"
|
|
165
|
+
*
|
|
165
166
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
166
167
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
167
168
|
*
|
|
@@ -169,17 +170,15 @@ class ProductApi extends oneEntry_1.default {
|
|
|
169
170
|
*
|
|
170
171
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
171
172
|
*
|
|
172
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
173
|
-
*
|
|
174
173
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
175
174
|
*
|
|
176
175
|
* @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
177
176
|
*/
|
|
178
|
-
getRelatedProductsById(id, userQuery) {
|
|
177
|
+
getRelatedProductsById(id, langCode = 'en_US', userQuery) {
|
|
179
178
|
return __awaiter(this, void 0, void 0, function* () {
|
|
180
179
|
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
181
|
-
const result = yield this.
|
|
182
|
-
return result
|
|
180
|
+
const result = yield this._fetchRequests(`/${id}/related?langCode=${this._LANGCODE_KEY}&` + this._queryParamsToString(query), langCode);
|
|
181
|
+
return result;
|
|
183
182
|
});
|
|
184
183
|
}
|
|
185
184
|
/**
|
|
@@ -193,15 +192,8 @@ class ProductApi extends oneEntry_1.default {
|
|
|
193
192
|
*/
|
|
194
193
|
getProductById(id, langCode = 'en_US') {
|
|
195
194
|
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return response;
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
const response = yield this._fetchGet(`/${id}?langCode=${langCode[0]}`);
|
|
202
|
-
const product = yield this._normalizeProductData(response, langCode);
|
|
203
|
-
return product;
|
|
204
|
-
}
|
|
195
|
+
const result = yield this._fetchRequests(`/${id}?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
196
|
+
return result;
|
|
205
197
|
});
|
|
206
198
|
}
|
|
207
199
|
/**
|
|
@@ -265,25 +257,6 @@ class ProductApi extends oneEntry_1.default {
|
|
|
265
257
|
return productsList;
|
|
266
258
|
});
|
|
267
259
|
}
|
|
268
|
-
_normalizeProductData(product, langSet) {
|
|
269
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
270
|
-
const normalizeProduct = Object.assign({}, product);
|
|
271
|
-
if (typeof langSet === 'string') {
|
|
272
|
-
normalizeProduct.attributeValues = product.attributeValues[langSet];
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
const attrs = [];
|
|
276
|
-
const id = product.id;
|
|
277
|
-
yield Promise.all(langSet.map((lang) => __awaiter(this, void 0, void 0, function* () {
|
|
278
|
-
yield this.getProductById(id, lang).then((result) => {
|
|
279
|
-
attrs.push(result.attributeValues);
|
|
280
|
-
});
|
|
281
|
-
})));
|
|
282
|
-
Object.assign(normalizeProduct.attributeValues, ...attrs);
|
|
283
|
-
}
|
|
284
|
-
return normalizeProduct;
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
260
|
}
|
|
288
261
|
exports.default = ProductApi;
|
|
289
262
|
//# sourceMappingURL=productsApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productsApi.js","sourceRoot":"","sources":["../../src/products/productsApi.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,+CAAuC;
|
|
1
|
+
{"version":3,"file":"productsApi.js","sourceRoot":"","sources":["../../src/products/productsApi.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,+CAAuC;AAGvC;;GAEG;AACH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OAgCG;IACU,aAAa,CAAC,IAAyB,EAAE,SAAyB;;YAC3E,MAAM,KAAK,mCAAsB,IAAI,CAAC,aAAa,GAAK,SAAS,CAAC,CAAA;YAElE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,qBAAqB,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAC,IAAI,CAAC,CAAA;YACnG,OAAO,MAAM,CAAC,KAAK,CAAA;QACvB,CAAC;KAAA;IAED;;;;;;;;OAQG;IACU,aAAa,CAAC,IAAW,EAAE,WAAkB,OAAO;;YAC7D,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,sBAAsB,QAAQ,SAAS,IAAI,EAAE,CAAC,CAAA;YAC1F,MAAM,YAAY,GAA0B,EAAE,CAAA;YAI9C,MAAM,OAAO,CAAC,GAAG,CACb,cAAc,CAAC,GAAG,CAAC,CAAO,OAAsB,EAAE,EAAE;gBAChD,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;oBAClD,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC7B,CAAC,CAAC,CAAA;YACN,CAAC,CAAA,CAAC,CACL,CAAA;YACD,OAAO,YAAY,CAAA;QACvB,CAAC;KAAA;CACJ;AAxPD,6BAwPC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILocalizeInfos } from "../base/utils";
|
|
1
|
+
import { ILocalizeInfos, LangType } from "../base/utils";
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of Products Api.
|
|
4
4
|
*
|
|
@@ -19,12 +19,12 @@ import { ILocalizeInfos } from "../base/utils";
|
|
|
19
19
|
* @property {function} searchProduct - Quick search for product page objects with limited output.
|
|
20
20
|
*/
|
|
21
21
|
interface IProductApi {
|
|
22
|
-
getProducts(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
23
|
-
getProductsEmptyPage(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
24
|
-
getProductsPageById(id: number, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
25
|
-
getProductsPageByUrl(url: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
26
|
-
getRelatedProductsById(id: number, userQuery?: IProductsQuery): Promise<IProductsEntity>;
|
|
27
|
-
getProductById(id: number, langCode:
|
|
22
|
+
getProducts(langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
23
|
+
getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
24
|
+
getProductsPageById(id: number, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
25
|
+
getProductsPageByUrl(url: string, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
26
|
+
getRelatedProductsById(id: number, langCode?: LangType, userQuery?: IProductsQuery): Promise<IProductsEntity>;
|
|
27
|
+
getProductById(id: number, langCode: LangType): Promise<IProductsEntity>;
|
|
28
28
|
filterProduct(data: Array<IFilterParams>, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
29
29
|
searchProduct(name: string, langCode: string): Promise<Array<IProductsEntity>>;
|
|
30
30
|
}
|
|
@@ -60,7 +60,6 @@ interface IProductsQuery {
|
|
|
60
60
|
conditionMarker?: 'in' | 'nin' | 'eq' | 'neq' | 'mth' | 'lth' | 'exs' | 'nexs' | null;
|
|
61
61
|
attributeMarker?: string | null;
|
|
62
62
|
sortOrder?: 'DESC' | 'ASC';
|
|
63
|
-
langCode?: string;
|
|
64
63
|
sortKey?: string;
|
|
65
64
|
[key: string]: string | number | null;
|
|
66
65
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ILocalizeInfos, Types } from "../base/utils";
|
|
2
2
|
import { IPosition } from "../admins/adminsInterfaces";
|
|
3
|
-
import {
|
|
3
|
+
import { IAttributeSetEntity } from "../base/utils";
|
|
4
4
|
/**
|
|
5
5
|
* Represents an interface object of Templates Api.
|
|
6
6
|
*
|
|
@@ -32,7 +32,7 @@ interface ITemplatesApi {
|
|
|
32
32
|
interface ITemplateEntity {
|
|
33
33
|
id: number;
|
|
34
34
|
identifier: string;
|
|
35
|
-
attributesValues:
|
|
35
|
+
attributesValues: IAttributeSetEntity;
|
|
36
36
|
attributeSetId: number;
|
|
37
37
|
isSync: boolean;
|
|
38
38
|
generalTypeName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ILocalizeInfos } from "../base/utils";
|
|
2
2
|
import { IPosition } from "../admins/adminsInterfaces";
|
|
3
|
-
import {
|
|
3
|
+
import { IAttributeSetEntity } from "../base/utils";
|
|
4
4
|
/**
|
|
5
5
|
* Represents an interface object of Templates Preview Api.
|
|
6
6
|
*
|
|
@@ -34,7 +34,7 @@ interface ITemplatesPreviewEntity {
|
|
|
34
34
|
updatedDate: string;
|
|
35
35
|
version: number;
|
|
36
36
|
identifier: string;
|
|
37
|
-
attributesSets:
|
|
37
|
+
attributesSets: IAttributeSetEntity;
|
|
38
38
|
attributeSetId: number;
|
|
39
39
|
localizeInfos: ILocalizeInfos;
|
|
40
40
|
position: IPosition;
|
package/package.json
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oneentry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"/dist"
|
|
9
9
|
],
|
|
10
|
-
|
|
11
|
-
"author": "ONEENTRY PORTAL CO.",
|
|
12
|
-
"license": "ISC",
|
|
10
|
+
"author": "OneEntry",
|
|
13
11
|
"dependencies": {
|
|
14
12
|
"jsdoc": "^4.0.2",
|
|
15
13
|
"typescript": "^5.2.2"
|
|
16
14
|
}
|
|
17
|
-
}
|
|
15
|
+
}
|