oneentry 1.0.55 → 1.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -65,11 +65,11 @@ You can get a token as follows
65
65
  5) Log in to the project, go to the settings section and open the token tab
66
66
  6) Get and copy the token of your project
67
67
 
68
- Also, you can connect a tls certificate to secure your project. In this case, do not transfer the "token" at all.
68
+ You can also connect a tls certificate to protect your project. In this case, do not pass the "token" at all. When using the certificate, set up a proxy in your project. Pass an empty string as an url parameter.
69
69
  [Learn more about security](https://oneentry.ru/instructions.html#START)
70
70
 
71
71
 
72
- ```js
72
+ ```js
73
73
  const api = defineOneEntry('your-url', {token: 'my-token', langCode:'my-langCode'})
74
74
  ```
75
75
  Now you can use the following links to jump to specific entries:
@@ -1676,6 +1676,7 @@ example: 0 <br>
1676
1676
 
1677
1677
  </details>
1678
1678
 
1679
+
1679
1680
  ### Pages.getPages(langCode)
1680
1681
 
1681
1682
  ```js
@@ -2464,6 +2465,7 @@ Example return:
2464
2465
  "isSync": true,
2465
2466
  "price": 0,
2466
2467
  "templateIdentifier": "my-template",
2468
+ "sku": "0-123",
2467
2469
  "shortDescTemplateIdentifier": "my-template-short",
2468
2470
  "attributeValues": {
2469
2471
  "marker": {
@@ -2515,6 +2517,10 @@ example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "",
2515
2517
  *status identifiers of the product page (can be null)* <br>
2516
2518
  example: 1 <br>
2517
2519
 
2520
+ **sku:** string <br>
2521
+ *product SKU value taken from the index* <br>
2522
+ example: 1 <br>
2523
+
2518
2524
  **relatedIds:** array <br>
2519
2525
  *identifiers of related product pages* <br>
2520
2526
  example: List [ 1, 2, 3 ] <br>
@@ -2559,10 +2565,12 @@ Example return:
2559
2565
  3
2560
2566
  ],
2561
2567
  "attributeSetId": 7,
2568
+ "blocks": ["product_block"],
2562
2569
  "isSync": true,
2563
2570
  "price": 0,
2564
2571
  "templateIdentifier": "my-template",
2565
2572
  "shortDescTemplateIdentifier": "my-template-short",
2573
+ "sku": "0-123",
2566
2574
  "attributeValues": {
2567
2575
  "marker": {
2568
2576
  "value": "",
@@ -2600,6 +2608,10 @@ example: my-template <br>
2600
2608
  *attribute set identifier* <br>
2601
2609
  example: 7 <br>
2602
2610
 
2611
+ **blocks:** array <br>
2612
+ *product blocks* <br>
2613
+ example: ['product_block'] <br>
2614
+
2603
2615
  **isSync:** boolean <br>
2604
2616
  *indicator of page indexing (true or false)* <br>
2605
2617
  example: false <br>
@@ -2612,6 +2624,10 @@ example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "",
2612
2624
  *status identifiers of the product page (can be null)* <br>
2613
2625
  example: 1 <br>
2614
2626
 
2627
+ **sku:** string <br>
2628
+ *product SKU value taken from the index* <br>
2629
+ example: 1 <br>
2630
+
2615
2631
  **relatedIds:** array <br>
2616
2632
  *identifiers of related product pages* <br>
2617
2633
  example: List [ 1, 2, 3 ] <br>
@@ -2662,11 +2678,13 @@ Example return:
2662
2678
  }
2663
2679
  ],
2664
2680
  "attributeSetId": 7,
2681
+ "blocks": ["product_block"],
2665
2682
  "version": 10,
2666
2683
  "isSync": 0,
2667
2684
  "price": 0,
2668
2685
  "templateIdentifier": "my-template",
2669
2686
  "shortDescTemplateIdentifier": "my-template-short",
2687
+ "sku": "0-123",
2670
2688
  "attributeValues": {
2671
2689
  "marker": {
2672
2690
  "value": "",
@@ -2703,6 +2721,10 @@ example: my-template <br>
2703
2721
  *attribute set identifier* <br>
2704
2722
  example: 7 <br>
2705
2723
 
2724
+ **blocks:** array <br>
2725
+ *product blocks* <br>
2726
+ example: ['product_block'] <br>
2727
+
2706
2728
  **isSync:** boolean <br>
2707
2729
  *indicator of page indexing (true or false)* <br>
2708
2730
  example: false <br>
@@ -2715,6 +2737,10 @@ example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "",
2715
2737
  *status identifiers of the product page (can be null)* <br>
2716
2738
  example: 1 <br>
2717
2739
 
2740
+ **sku:** string <br>
2741
+ *product SKU value taken from the index* <br>
2742
+ example: 1 <br>
2743
+
2718
2744
  **relatedIds:** array <br>
2719
2745
  *identifiers of related product pages* <br>
2720
2746
  example: List [ 1, 2, 3 ] <br>
@@ -2764,11 +2790,13 @@ Example return:
2764
2790
  }
2765
2791
  ],
2766
2792
  "attributeSetId": 7,
2793
+ "blocks": ["product_block"],
2767
2794
  "version": 10,
2768
2795
  "isSync": 0,
2769
2796
  "price": 0,
2770
2797
  "templateIdentifier": "my-template",
2771
2798
  "shortDescTemplateIdentifier": "my-template-short",
2799
+ "sku": "0-123",
2772
2800
  "attributeValues": {
2773
2801
  "marker": {
2774
2802
  "value": "",
@@ -2805,6 +2833,10 @@ example: my-template <br>
2805
2833
  *attribute set identifier* <br>
2806
2834
  example: 7 <br>
2807
2835
 
2836
+ **blocks:** array <br>
2837
+ *product blocks* <br>
2838
+ example: ['product_block'] <br>
2839
+
2808
2840
  **isSync:** boolean <br>
2809
2841
  *indicator of page indexing (true or false)* <br>
2810
2842
  example: false <br>
@@ -2817,6 +2849,10 @@ example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "",
2817
2849
  *status identifiers of the product page (can be null)* <br>
2818
2850
  example: 1 <br>
2819
2851
 
2852
+ **sku:** string <br>
2853
+ *product SKU value taken from the index* <br>
2854
+ example: 1 <br>
2855
+
2820
2856
  **relatedIds:** array <br>
2821
2857
  *identifiers of related product pages* <br>
2822
2858
  example: List [ 1, 2, 3 ] <br>
@@ -2859,10 +2895,12 @@ Example return:
2859
2895
  3
2860
2896
  ],
2861
2897
  "attributeSetId": 7,
2898
+ "blocks": ["product_block"],
2862
2899
  "isSync": true,
2863
2900
  "price": 0,
2864
2901
  "templateIdentifier": "my-template",
2865
2902
  "shortDescTemplateIdentifier": "my-template-short",
2903
+ "sku": "0-123",
2866
2904
  "attributeValues": {
2867
2905
  "marker": {
2868
2906
  "value": "",
@@ -2899,6 +2937,10 @@ example: my-template <br>
2899
2937
  *attribute set identifier* <br>
2900
2938
  example: 7 <br>
2901
2939
 
2940
+ **blocks:** array <br>
2941
+ *product blocks* <br>
2942
+ example: ['product_block'] <br>
2943
+
2902
2944
  **isSync:** boolean <br>
2903
2945
  *indicator of page indexing (true or false)* <br>
2904
2946
  example: false <br>
@@ -2911,6 +2953,10 @@ example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "",
2911
2953
  *status identifiers of the product page (can be null)* <br>
2912
2954
  example: 1 <br>
2913
2955
 
2956
+ **sku:** string <br>
2957
+ *product SKU value taken from the index* <br>
2958
+ example: 1 <br>
2959
+
2914
2960
  **relatedIds:** array <br>
2915
2961
  *identifiers of related product pages* <br>
2916
2962
  example: List [ 1, 2, 3 ] <br>
@@ -2953,10 +2999,12 @@ Example return:
2953
2999
  3
2954
3000
  ],
2955
3001
  "attributeSetId": 7,
3002
+ "blocks": ["product_block"],
2956
3003
  "isSync": true,
2957
3004
  "price": 0,
2958
3005
  "templateIdentifier": "my-template",
2959
3006
  "shortDescTemplateIdentifier": "my-template-short",
3007
+ "sku": "0-123",
2960
3008
  "attributeValues": {
2961
3009
  "marker": {
2962
3010
  "value": "",
@@ -2993,6 +3041,10 @@ example: my-template <br>
2993
3041
  *attribute set identifier* <br>
2994
3042
  example: 7 <br>
2995
3043
 
3044
+ **blocks:** array <br>
3045
+ *product blocks* <br>
3046
+ example: ['product_block'] <br>
3047
+
2996
3048
  **isSync:** boolean <br>
2997
3049
  *indicator of page indexing (true or false)* <br>
2998
3050
  example: false <br>
@@ -3005,6 +3057,10 @@ example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "",
3005
3057
  *status identifiers of the product page (can be null)* <br>
3006
3058
  example: 1 <br>
3007
3059
 
3060
+ **sku:** string <br>
3061
+ *product SKU value taken from the index* <br>
3062
+ example: 1 <br>
3063
+
3008
3064
  **relatedIds:** array <br>
3009
3065
  *identifiers of related product pages* <br>
3010
3066
  example: List [ 1, 2, 3 ] <br>
@@ -3080,11 +3136,13 @@ Example return:
3080
3136
  }
3081
3137
  ],
3082
3138
  "attributeSetId": 7,
3139
+ "blocks": ["product_block"],
3083
3140
  "version": 10,
3084
3141
  "isSync": 0,
3085
3142
  "price": 0,
3086
3143
  "templateIdentifier": "my-template",
3087
3144
  "shortDescTemplateIdentifier": "my-template-short",
3145
+ "sku": "0-123",
3088
3146
  "attributeValues": {
3089
3147
  "marker": {
3090
3148
  "value": "",
@@ -3121,6 +3179,10 @@ example: my-template <br>
3121
3179
  *attribute set identifier* <br>
3122
3180
  example: 7 <br>
3123
3181
 
3182
+ **blocks:** array <br>
3183
+ *product blocks* <br>
3184
+ example: ['product_block'] <br>
3185
+
3124
3186
  **isSync:** boolean <br>
3125
3187
  *indicator of page indexing (true or false)* <br>
3126
3188
  example: false <br>
@@ -3133,6 +3195,10 @@ example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "",
3133
3195
  *status identifiers of the product page (can be null)* <br>
3134
3196
  example: 1 <br>
3135
3197
 
3198
+ **sku:** string <br>
3199
+ *product SKU value taken from the index* <br>
3200
+ example: 1 <br>
3201
+
3136
3202
  **relatedIds:** array <br>
3137
3203
  *identifiers of related product pages* <br>
3138
3204
  example: List [ 1, 2, 3 ] <br>
@@ -3183,12 +3249,14 @@ Example return:
3183
3249
  }
3184
3250
  ],
3185
3251
  "attributeSetId": 7,
3252
+ "blocks": ["product_block"],
3186
3253
  "version": 10,
3187
3254
  "isSync": 0,
3188
3255
  "price": 0,
3189
3256
  "templateIdentifier": "my-template",
3190
3257
  "shortDescTemplateIdentifier": "my-template-short",
3191
- "attributeValues": {
3258
+ "sku": "0-123",
3259
+ "attributeValues": {
3192
3260
  "marker": {
3193
3261
  "value": "",
3194
3262
  "type": "string"
@@ -3225,6 +3293,10 @@ example: my-template <br>
3225
3293
  *attribute set identifier* <br>
3226
3294
  example: 7 <br>
3227
3295
 
3296
+ **blocks:** array <br>
3297
+ *product blocks* <br>
3298
+ example: ['product_block'] <br>
3299
+
3228
3300
  **isSync:** boolean <br>
3229
3301
  *indicator of page indexing (true or false)* <br>
3230
3302
  example: false <br>
@@ -3237,6 +3309,10 @@ example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "",
3237
3309
  *status identifiers of the product page (can be null)* <br>
3238
3310
  example: 1 <br>
3239
3311
 
3312
+ **sku:** string <br>
3313
+ *product SKU value taken from the index* <br>
3314
+ example: 1 <br>
3315
+
3240
3316
  **relatedIds:** array <br>
3241
3317
  *identifiers of related product pages* <br>
3242
3318
  example: List [ 1, 2, 3 ] <br>
@@ -3258,17 +3334,17 @@ example: my-template-short <br>
3258
3334
  ---
3259
3335
 
3260
3336
 
3261
- ## <h2 id="productstatuses"> ProductstatusesSpec </h2>
3337
+ ## <h2 id="productstatuses"> ProductStatuses </h2>
3262
3338
 
3263
3339
 
3264
3340
  ```js
3265
- const { ProductstatusesSpec } = defineOneEntry('your-url');
3341
+ const { ProductStatuses } = defineOneEntry('your-url');
3266
3342
  ```
3267
3343
 
3268
- ### ProductstatusesSpec.getProductStatuses()
3344
+ ### ProductStatuses.getProductStatuses()
3269
3345
 
3270
3346
  ```js
3271
- const value = await ProductstatusesSpec.getProductStatuses()
3347
+ const value = await ProductStatuses.getProductStatuses()
3272
3348
  ```
3273
3349
 
3274
3350
  > This method searches for all product status objects from the API. It returns a Promise that resolves to an array of product status objects.
@@ -3279,8 +3355,8 @@ Example return:
3279
3355
  [
3280
3356
  {
3281
3357
  "id": 1764,
3282
- "updatedDate": "2023-11-20T22:14:19.438Z",
3283
3358
  "version": 10,
3359
+ "position": 2,
3284
3360
  "identifier": "catalog",
3285
3361
  "localizeInfos": {
3286
3362
  "title": "Status 1"
@@ -3295,9 +3371,6 @@ Example return:
3295
3371
  *object identifier* <br>
3296
3372
  example: 1764 <br>
3297
3373
 
3298
- **updatedDate:** string($date-time) <br>
3299
- *object's date of modification* <br>
3300
-
3301
3374
  **version** number <br>
3302
3375
  *object's version number of modification* <br>
3303
3376
  example: 10 <br>
@@ -3312,10 +3385,10 @@ example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent":
3312
3385
 
3313
3386
  </details>
3314
3387
 
3315
- ### ProductstatusesSpec.getProductStatusesById(id)
3388
+ ### ProductStatuses.getProductStatusesById(id)
3316
3389
 
3317
3390
  ```js
3318
- const value = await ProductstatusesSpec.getProductStatusesById(1)
3391
+ const value = await ProductStatuses.getProductStatusesById(1)
3319
3392
  ```
3320
3393
 
3321
3394
  > This method searches for a product status object based on its identifier (id) from the API. It returns a Promise that resolves to a product status object.
@@ -3325,8 +3398,8 @@ Example return:
3325
3398
  ```json
3326
3399
  {
3327
3400
  "id": 1764,
3328
- "updatedDate": "2023-09-25T13:36:05.907Z",
3329
3401
  "version": 10,
3402
+ "position": 2,
3330
3403
  "identifier": "catalog",
3331
3404
  "localizeInfos": {
3332
3405
  "title": "Status 1"
@@ -3340,9 +3413,6 @@ Example return:
3340
3413
  *object identifier* <br>
3341
3414
  example: 1764 <br>
3342
3415
 
3343
- **updatedDate:** string($date-time) <br>
3344
- *object's date of modification* <br>
3345
-
3346
3416
  **version** number <br>
3347
3417
  *object's version number of modification* <br>
3348
3418
  example: 10 <br>
@@ -3357,10 +3427,10 @@ example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent":
3357
3427
 
3358
3428
  </details>
3359
3429
 
3360
- ### ProductstatusesSpec.getProductsByStatusMarker(marker)
3430
+ ### ProductStatuses.getProductsByStatusMarker(marker)
3361
3431
 
3362
3432
  ```js
3363
- const value = await ProductstatusesSpec.getProductsByStatusMarker('my-marker')
3433
+ const value = await ProductStatuses.getProductsByStatusMarker('my-marker')
3364
3434
  ```
3365
3435
 
3366
3436
  > This method searches for a product status object based on its textual identifier (marker) from the API. It returns a Promise that resolves to a product status object.
@@ -3370,8 +3440,8 @@ Example return:
3370
3440
  ```json
3371
3441
  {
3372
3442
  "id": 1764,
3373
- "updatedDate": "2023-09-25T13:39:19.384Z",
3374
3443
  "version": 10,
3444
+ "position": 2,
3375
3445
  "identifier": "catalog",
3376
3446
  "localizeInfos": {
3377
3447
  "title": "Status 1"
@@ -3385,9 +3455,6 @@ Example return:
3385
3455
  *object identifier* <br>
3386
3456
  example: 1764 <br>
3387
3457
 
3388
- **updatedDate:** string($date-time) <br>
3389
- *object's date of modification* <br>
3390
-
3391
3458
  **version** number <br>
3392
3459
  *object's version number of modification* <br>
3393
3460
  example: 10 <br>
@@ -3402,10 +3469,10 @@ example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent":
3402
3469
 
3403
3470
  </details>
3404
3471
 
3405
- ### ProductstatusesSpec.validateMarker(marker)
3472
+ ### ProductStatuses.validateMarker(marker)
3406
3473
 
3407
3474
  ```js
3408
- const value = await ProductstatusesSpec.validateMarker('marker')
3475
+ const value = await ProductStatuses.validateMarker('marker')
3409
3476
  ```
3410
3477
 
3411
3478
  > This method checks the existence of a textual identifier (marker). It takes a marker parameter as input, representing the product marker to validate. It returns a Promise that resolves to true if the textual identifier (marker) exists or false if it doesn't.
@@ -10,6 +10,13 @@ interface IAttributesSets {
10
10
  getAttributesByMarker(marker: string, langCode: string): Promise<Array<IAttributesSetsEntity>>;
11
11
  getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode: string): Promise<IAttributesSetsEntity>;
12
12
  }
13
+ interface IListTitle {
14
+ title: string;
15
+ value: number | string;
16
+ position: string | number | null;
17
+ extendedValue: string | number | null;
18
+ extendedValueType: string | number | null;
19
+ }
13
20
  /**
14
21
  * Represents a template entity object.
15
22
  *
@@ -35,12 +42,6 @@ interface IAttributesSetsEntity {
35
42
  };
36
43
  };
37
44
  localizeInfos: Record<string, any>;
38
- listTitles: Array<{
39
- title: string;
40
- value: number | string;
41
- position: string | number | null;
42
- extendedValue: string | number | null;
43
- extendedValueType: string | number | null;
44
- }> | Record<string, any>;
45
+ listTitles: Array<IListTitle> | Record<string, any>;
45
46
  }
46
- export { IAttributesSets, IAttributesSetsEntity };
47
+ export { IAttributesSets, IAttributesSetsEntity, IListTitle };
@@ -73,4 +73,4 @@ interface ICustomSetting {
73
73
  }> | Record<string, any>;
74
74
  [key: string]: any;
75
75
  }
76
- export { IBlocks, IBlockEntity, IBlocksResponse, IBlockProduct };
76
+ export { IBlocks, IBlockEntity, IBlocksResponse, IBlockProduct, ICustomSetting };
@@ -30,8 +30,8 @@ interface IFormsEntity {
30
30
  id: number;
31
31
  identifier: string;
32
32
  localizeInfos: Record<string, any>;
33
+ templateId: number | null;
33
34
  position: number;
34
- processingData: Record<string, any> | string;
35
35
  processingType: string;
36
36
  version: number;
37
37
  }
@@ -66,4 +66,4 @@ interface IFormsPost {
66
66
  time?: Date | string;
67
67
  formData: IFormData;
68
68
  }
69
- export { IFormsPost, IFormsData, IFormsDataEntity };
69
+ export { IFormsPost, IFormsData, IFormData, IFormsDataEntity };
@@ -40,4 +40,4 @@ interface IMenusEntity {
40
40
  localizeInfos: Record<string, any>;
41
41
  pages: Array<IMenusPages> | IMenusPages;
42
42
  }
43
- export { IMenus, IMenusEntity };
43
+ export { IMenus, IMenusEntity, IMenusPages };
@@ -20,15 +20,14 @@ interface IProductStatuses {
20
20
  *
21
21
  * @interface
22
22
  * @property {number} id - The unique identifier of the position.
23
- * @property {Date | string} updatedDate - The date of last updated.
24
23
  * @property {number} version - The version number of the object.
25
24
  * @property {string} identifier - The textual identifier for the record field.
26
- * @property {boolean} isLocked - Indicates whether the position is locked or not.
25
+ * @property {number} position - Position number.
27
26
  * @property {Record<string, any>} localizeInfos - The name of the products statuses, taking into account localization.
28
27
  */
29
28
  interface IProductStatusEntity {
30
29
  id: number;
31
- updatedDate: string | Date;
30
+ position: number;
32
31
  version: number;
33
32
  identifier: string;
34
33
  localizeInfos: Record<string, any>;
@@ -70,7 +70,7 @@ interface IProductsQuery {
70
70
  * @property {number | null} conditionValue - The value that is being searched for, default null.
71
71
  * @property {string | null} conditionMarker - Id of the filter condition by which the values are filtered, default null.
72
72
  * @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered, default null.
73
- * @property {number | null} pageId - Id of the category page object.
73
+ * @property {Array<string> | null} pageUrl - Url of the category page object.
74
74
  */
75
75
  interface IFilterParams {
76
76
  attributeMarker: string;
@@ -86,7 +86,7 @@ interface IFilterParams {
86
86
  */
87
87
  conditionMarker?: 'in' | 'nin' | 'eq' | 'neq' | 'mth' | 'lth' | 'exs' | 'nexs' | null;
88
88
  conditionValue: number | string | null;
89
- pageId?: number;
89
+ pageUrl?: Array<string> | null;
90
90
  }
91
91
  /**
92
92
  * Represents a product entity object.
@@ -107,6 +107,7 @@ interface IFilterParams {
107
107
  interface IProductsEntity {
108
108
  id: number;
109
109
  localizeInfos: Record<string, any>;
110
+ blocks?: string | Array<string>;
110
111
  isVisible: boolean;
111
112
  statusId: number | null;
112
113
  relatedIds: number[];
@@ -117,6 +118,7 @@ interface IProductsEntity {
117
118
  shortDescTemplateIdentifier: string;
118
119
  attributeValues: Record<string, any>;
119
120
  position: number;
121
+ sku: string | null;
120
122
  productPages: Array<Record<string, any>> | Record<string, any>;
121
123
  }
122
- export { IFilterParams, IProductsQuery, IProductApi, IProductsEntity };
124
+ export { IFilterParams, IProductsQuery, IProductApi, IProductsEntity, };
@@ -1,5 +1,5 @@
1
1
  import OneEntry from '../base/oneEntry';
2
- import { ITemplatesApi, ITemplateEntity } from './templatesInterfaces';
2
+ import { ITemplatesApi, ITemplateEntity, ITemplateList } from './templatesInterfaces';
3
3
  import { IConfig, Types } from "../base/utils";
4
4
  /**
5
5
  * Controllers for working with template objects
@@ -12,7 +12,7 @@ export default class TemplatesPreviewApi extends OneEntry implements ITemplatesA
12
12
  *
13
13
  * @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
14
14
  */
15
- getAllTemplates(langCode?: string): Promise<Array<ITemplateEntity>>;
15
+ getAllTemplates(langCode?: string): Promise<ITemplateList>;
16
16
  /**
17
17
  * Get template objects by type.
18
18
  *
@@ -16,8 +16,12 @@ class TemplatesPreviewApi extends oneEntry_1.default {
16
16
  * @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
17
17
  */
18
18
  async getAllTemplates(langCode = this._defaultLangCode) {
19
- const result = await this._fetchGet('/all');
20
- return this._normalizeData(result, langCode);
19
+ const response = await this._fetchGet('/all');
20
+ const result = {};
21
+ for (let item in response) {
22
+ result[item] = this._normalizeData(response[item], langCode);
23
+ }
24
+ return result;
21
25
  }
22
26
  /**
23
27
  * Get template objects by type.
@@ -8,7 +8,7 @@ import { Types } from "../base/utils";
8
8
  * @property {function} getTemplateByType - Get template objects by type.
9
9
  */
10
10
  interface ITemplatesApi {
11
- getAllTemplates(langCode: string): Promise<Array<ITemplateEntity>>;
11
+ getAllTemplates(langCode: string): Promise<ITemplateList>;
12
12
  getTemplateByType(type: Types, langCode: string): Promise<Array<ITemplateEntity>>;
13
13
  }
14
14
  /**
@@ -39,4 +39,7 @@ interface ITemplateEntity {
39
39
  positionId?: number;
40
40
  generalTypeName: Types;
41
41
  }
42
- export { ITemplatesApi, ITemplateEntity };
42
+ interface ITemplateList {
43
+ [key: string]: ITemplateEntity;
44
+ }
45
+ export { ITemplatesApi, ITemplateEntity, ITemplateList };
@@ -50,4 +50,4 @@ interface ISquare {
50
50
  slide: number;
51
51
  alignmentType: string;
52
52
  }
53
- export { ITemplatesPreview, ITemplatesPreviewEntity };
53
+ export { ITemplatesPreview, ITemplatesPreviewEntity, ISquare, IProportion, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",