@kontent-ai/delivery-sdk 16.4.3 → 16.4.4

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.
Files changed (83) hide show
  1. package/.npmignore +15 -15
  2. package/LICENSE.md +9 -9
  3. package/dist/bundles/kontent-delivery.umd.js +5077 -4620
  4. package/dist/bundles/kontent-delivery.umd.js.map +1 -1
  5. package/dist/bundles/kontent-delivery.umd.min.js +1 -1
  6. package/dist/bundles/kontent-delivery.umd.min.js.map +1 -1
  7. package/dist/bundles/report.json +1 -1
  8. package/dist/bundles/report.min.json +1 -1
  9. package/dist/bundles/stats.json +7195 -5946
  10. package/dist/bundles/stats.min.json +11923 -10797
  11. package/dist/cjs/sdk-info.generated.js +1 -1
  12. package/dist/es6/sdk-info.generated.js +1 -1
  13. package/dist/esnext/sdk-info.generated.js +1 -1
  14. package/lib/client/delivery-client.factory.ts +9 -9
  15. package/lib/client/delivery-client.ts +163 -163
  16. package/lib/client/idelivery-client.interface.ts +110 -110
  17. package/lib/client/index.ts +3 -3
  18. package/lib/config/delivery-configs.ts +98 -98
  19. package/lib/config/index.ts +1 -1
  20. package/lib/contracts/contracts.ts +265 -265
  21. package/lib/contracts/index.ts +1 -1
  22. package/lib/elements/element-models.ts +89 -89
  23. package/lib/elements/element-resolver.ts +3 -3
  24. package/lib/elements/element-type.ts +16 -16
  25. package/lib/elements/elements.ts +70 -70
  26. package/lib/elements/index.ts +4 -4
  27. package/lib/images/image-url-transformation-builder.factory.ts +5 -5
  28. package/lib/images/image-url-transformation-builder.ts +181 -181
  29. package/lib/images/image.models.ts +4 -4
  30. package/lib/images/index.ts +3 -3
  31. package/lib/index.ts +12 -12
  32. package/lib/mappers/element.mapper.ts +504 -504
  33. package/lib/mappers/generic-element.mapper.ts +20 -20
  34. package/lib/mappers/index.ts +8 -8
  35. package/lib/mappers/item.mapper.ts +181 -181
  36. package/lib/mappers/language.mapper.ts +24 -24
  37. package/lib/mappers/sync.mapper.ts +32 -32
  38. package/lib/mappers/taxonomy.mapper.ts +77 -77
  39. package/lib/mappers/type.mapper.ts +76 -76
  40. package/lib/mappers/used-in.mapper.ts +20 -20
  41. package/lib/models/common/base-responses.ts +13 -13
  42. package/lib/models/common/common-models.ts +118 -118
  43. package/lib/models/common/filters.ts +280 -280
  44. package/lib/models/common/headers.ts +5 -5
  45. package/lib/models/common/index.ts +7 -7
  46. package/lib/models/common/pagination.class.ts +7 -7
  47. package/lib/models/common/parameters.ts +189 -189
  48. package/lib/models/common/sort-order.ts +1 -1
  49. package/lib/models/content-type-models.ts +42 -42
  50. package/lib/models/element-models.ts +51 -51
  51. package/lib/models/index.ts +9 -9
  52. package/lib/models/item-models.ts +192 -192
  53. package/lib/models/language-models.ts +17 -17
  54. package/lib/models/responses.ts +137 -137
  55. package/lib/models/sync-models.ts +18 -18
  56. package/lib/models/taxonomy-models.ts +25 -25
  57. package/lib/query/common/base-item-listing-query.class.ts +274 -274
  58. package/lib/query/common/base-listing-query.class.ts +95 -95
  59. package/lib/query/common/base-query.class.ts +148 -148
  60. package/lib/query/element/element-query.class.ts +45 -45
  61. package/lib/query/index.ts +13 -13
  62. package/lib/query/item/multiple-items-query.class.ts +183 -183
  63. package/lib/query/item/single-item-query.class.ts +106 -106
  64. package/lib/query/items-feed/items-feed-query.class.ts +191 -191
  65. package/lib/query/language/languages-query.class.ts +91 -91
  66. package/lib/query/sync/initialize-sync-query.class.ts +83 -83
  67. package/lib/query/sync/sync-changes-query.class.ts +56 -56
  68. package/lib/query/taxonomy/taxonomies-query.class.ts +82 -82
  69. package/lib/query/taxonomy/taxonomy-query.class.ts +50 -50
  70. package/lib/query/type/multiple-type-query.class.ts +95 -95
  71. package/lib/query/type/single-type-query.class.ts +45 -45
  72. package/lib/query/used-in/used-in-query.class.ts +126 -126
  73. package/lib/sdk-info.generated.ts +1 -1
  74. package/lib/services/base-delivery-query.service.ts +375 -375
  75. package/lib/services/delivery-query.service.ts +336 -336
  76. package/lib/services/index.ts +2 -2
  77. package/lib/services/mapping.service.ts +223 -223
  78. package/lib/utilities/codename.helper.ts +10 -10
  79. package/lib/utilities/delivery-url.helper.ts +11 -11
  80. package/lib/utilities/enum.helper.ts +38 -38
  81. package/lib/utilities/index.ts +3 -3
  82. package/package.json +96 -96
  83. package/readme.md +531 -531
@@ -1,192 +1,192 @@
1
- import { Contracts } from '../contracts';
2
- import { ElementModels } from '../elements/element-models';
3
- import { IQueryConfig } from './common/common-models';
4
-
5
- export interface IMapElementsResult<
6
- TContentItem extends IContentItem = IContentItem,
7
- TLinkedItemType extends IContentItem = IContentItem
8
- > {
9
- item: TContentItem;
10
- processedItems: IContentItemsContainer<TLinkedItemType>;
11
- preparedItems: IContentItemWithRawDataContainer;
12
- processingStartedForCodenames: string[];
13
- }
14
-
15
- export interface IContentItemSystemAttributes<
16
- TTypeCodename extends string = string,
17
- TLanguageCodenames extends string = string,
18
- TCollectionCodenames extends string = string,
19
- TWorkflowCodenames extends string = string,
20
- TWorkflowStepCodenames extends string = string
21
- > {
22
- /**
23
- * Id of the item
24
- */
25
- id: string;
26
-
27
- /**
28
- * Name of the item
29
- */
30
- name: string;
31
-
32
- /**
33
- * Codename of the item
34
- */
35
- codename: string;
36
-
37
- /**
38
- * Codename of the type this item is using
39
- */
40
- type: TTypeCodename;
41
-
42
- /**
43
- * Date when the item was last modified
44
- */
45
- lastModified: string;
46
-
47
- /**
48
- * Codename of the language
49
- */
50
- language: TLanguageCodenames;
51
-
52
- /**
53
- * Array of sitemap locations (obsolete)
54
- */
55
- sitemapLocations: string[];
56
-
57
- /**
58
- * Codename of the collection this item belongs to
59
- */
60
- collection: TCollectionCodenames;
61
-
62
- /**
63
- * Workflow step of the item
64
- */
65
- workflowStep: TWorkflowStepCodenames | null;
66
-
67
- /**
68
- * Workflow of the item
69
- */
70
- workflow: TWorkflowCodenames | null;
71
- }
72
-
73
- /**
74
- * Indexer for elements within content item
75
- */
76
- export type ContentItemElementsIndexer<TElement extends ElementModels.IElement<any> = ElementModels.IElement<any>> =
77
- TElement;
78
-
79
- export type ContentItemType = 'component' | 'linkedItem';
80
-
81
- /**
82
- * Prefix with I to keep the name consistent and prevent releasing major version
83
- */
84
- export type IContentItemElements<TElementCodenames extends string = string> = Record<
85
- TElementCodenames,
86
- ContentItemElementsIndexer
87
- >;
88
-
89
- export type Snippet<
90
- TElementCodenames extends string,
91
- TElements extends IContentItemElements<TElementCodenames>
92
- > = TElements;
93
-
94
- export interface IContentItem<
95
- TElements extends IContentItemElements<TTypeElementCodenames> = IContentItemElements,
96
- TTypeCodename extends string = string,
97
- TLanguageCodenames extends string = string,
98
- TCollectionCodenames extends string = string,
99
- TWorkflowCodenames extends string = string,
100
- TWorkflowStepCodenames extends string = string,
101
- TTypeElementCodenames extends string = string
102
- > {
103
- /**
104
- * Elements of the content item
105
- */
106
- elements: TElements;
107
-
108
- /**
109
- * System data of the content item
110
- */
111
- system: IContentItemSystemAttributes<
112
- TTypeCodename,
113
- TLanguageCodenames,
114
- TCollectionCodenames,
115
- TWorkflowCodenames,
116
- TWorkflowStepCodenames
117
- >;
118
- }
119
-
120
- export interface ILink {
121
- /**
122
- * Id of the link
123
- */
124
- linkId: string;
125
-
126
- /**
127
- * Codename of the content item
128
- */
129
- codename: string;
130
-
131
- /**
132
- * Type codename of the content item
133
- */
134
- type: string;
135
-
136
- /**
137
- * Url slug defined for the content item
138
- */
139
- urlSlug: string;
140
- }
141
-
142
- export interface IContentItemWithRawElements {
143
- item: IContentItem;
144
- rawItem: Contracts.IContentItemContract;
145
- }
146
-
147
- export interface IContentItemWithRawDataContainer {
148
- [key: string]: IContentItemWithRawElements;
149
- }
150
-
151
- export interface IContentItemsContainer<TContentItem extends IContentItem> {
152
- [key: string]: TContentItem | undefined;
153
- }
154
-
155
- export interface IRichTextImage {
156
- imageId: string;
157
- url: string;
158
- description: string | null;
159
- width: number | null;
160
- height: number | null;
161
- }
162
-
163
- export interface IItemQueryConfig extends IQueryConfig {}
164
-
165
- export interface IItemFeedQueryConfig extends IQueryConfig {
166
- disableItemLinking?: boolean;
167
- }
168
-
169
- export interface IUsedInItemRecord<TClientTypes extends ClientTypes> {
170
- readonly system: {
171
- readonly id: string;
172
- readonly name: string;
173
- readonly codename: string;
174
- readonly language: TClientTypes['languageCodenames'];
175
- readonly type: TClientTypes['contentTypeCodenames'];
176
- readonly collection: TClientTypes['collectionCodenames'];
177
- readonly workflow: TClientTypes['workflowCodenames'];
178
- readonly workflowStep: TClientTypes['workflowStepCodenames'];
179
- readonly lastModified: string;
180
- };
181
- }
182
-
183
- export type ClientTypes = {
184
- readonly contentItemType: IContentItem;
185
- readonly contentTypeCodenames: string;
186
- readonly workflowCodenames: string;
187
- readonly workflowStepCodenames: string;
188
- readonly collectionCodenames: string;
189
- readonly taxonomyCodenames: string;
190
- readonly languageCodenames: string;
191
- readonly elementCodenames: string;
192
- };
1
+ import { Contracts } from '../contracts';
2
+ import { ElementModels } from '../elements/element-models';
3
+ import { IQueryConfig } from './common/common-models';
4
+
5
+ export interface IMapElementsResult<
6
+ TContentItem extends IContentItem = IContentItem,
7
+ TLinkedItemType extends IContentItem = IContentItem
8
+ > {
9
+ item: TContentItem;
10
+ processedItems: IContentItemsContainer<TLinkedItemType>;
11
+ preparedItems: IContentItemWithRawDataContainer;
12
+ processingStartedForCodenames: string[];
13
+ }
14
+
15
+ export interface IContentItemSystemAttributes<
16
+ TTypeCodename extends string = string,
17
+ TLanguageCodenames extends string = string,
18
+ TCollectionCodenames extends string = string,
19
+ TWorkflowCodenames extends string = string,
20
+ TWorkflowStepCodenames extends string = string
21
+ > {
22
+ /**
23
+ * Id of the item
24
+ */
25
+ id: string;
26
+
27
+ /**
28
+ * Name of the item
29
+ */
30
+ name: string;
31
+
32
+ /**
33
+ * Codename of the item
34
+ */
35
+ codename: string;
36
+
37
+ /**
38
+ * Codename of the type this item is using
39
+ */
40
+ type: TTypeCodename;
41
+
42
+ /**
43
+ * Date when the item was last modified
44
+ */
45
+ lastModified: string;
46
+
47
+ /**
48
+ * Codename of the language
49
+ */
50
+ language: TLanguageCodenames;
51
+
52
+ /**
53
+ * Array of sitemap locations (obsolete)
54
+ */
55
+ sitemapLocations: string[];
56
+
57
+ /**
58
+ * Codename of the collection this item belongs to
59
+ */
60
+ collection: TCollectionCodenames;
61
+
62
+ /**
63
+ * Workflow step of the item
64
+ */
65
+ workflowStep: TWorkflowStepCodenames | null;
66
+
67
+ /**
68
+ * Workflow of the item
69
+ */
70
+ workflow: TWorkflowCodenames | null;
71
+ }
72
+
73
+ /**
74
+ * Indexer for elements within content item
75
+ */
76
+ export type ContentItemElementsIndexer<TElement extends ElementModels.IElement<any> = ElementModels.IElement<any>> =
77
+ TElement;
78
+
79
+ export type ContentItemType = 'component' | 'linkedItem';
80
+
81
+ /**
82
+ * Prefix with I to keep the name consistent and prevent releasing major version
83
+ */
84
+ export type IContentItemElements<TElementCodenames extends string = string> = Record<
85
+ TElementCodenames,
86
+ ContentItemElementsIndexer
87
+ >;
88
+
89
+ export type Snippet<
90
+ TElementCodenames extends string,
91
+ TElements extends IContentItemElements<TElementCodenames>
92
+ > = TElements;
93
+
94
+ export interface IContentItem<
95
+ TElements extends IContentItemElements<TTypeElementCodenames> = IContentItemElements,
96
+ TTypeCodename extends string = string,
97
+ TLanguageCodenames extends string = string,
98
+ TCollectionCodenames extends string = string,
99
+ TWorkflowCodenames extends string = string,
100
+ TWorkflowStepCodenames extends string = string,
101
+ TTypeElementCodenames extends string = string
102
+ > {
103
+ /**
104
+ * Elements of the content item
105
+ */
106
+ elements: TElements;
107
+
108
+ /**
109
+ * System data of the content item
110
+ */
111
+ system: IContentItemSystemAttributes<
112
+ TTypeCodename,
113
+ TLanguageCodenames,
114
+ TCollectionCodenames,
115
+ TWorkflowCodenames,
116
+ TWorkflowStepCodenames
117
+ >;
118
+ }
119
+
120
+ export interface ILink {
121
+ /**
122
+ * Id of the link
123
+ */
124
+ linkId: string;
125
+
126
+ /**
127
+ * Codename of the content item
128
+ */
129
+ codename: string;
130
+
131
+ /**
132
+ * Type codename of the content item
133
+ */
134
+ type: string;
135
+
136
+ /**
137
+ * Url slug defined for the content item
138
+ */
139
+ urlSlug: string;
140
+ }
141
+
142
+ export interface IContentItemWithRawElements {
143
+ item: IContentItem;
144
+ rawItem: Contracts.IContentItemContract;
145
+ }
146
+
147
+ export interface IContentItemWithRawDataContainer {
148
+ [key: string]: IContentItemWithRawElements;
149
+ }
150
+
151
+ export interface IContentItemsContainer<TContentItem extends IContentItem> {
152
+ [key: string]: TContentItem | undefined;
153
+ }
154
+
155
+ export interface IRichTextImage {
156
+ imageId: string;
157
+ url: string;
158
+ description: string | null;
159
+ width: number | null;
160
+ height: number | null;
161
+ }
162
+
163
+ export interface IItemQueryConfig extends IQueryConfig {}
164
+
165
+ export interface IItemFeedQueryConfig extends IQueryConfig {
166
+ disableItemLinking?: boolean;
167
+ }
168
+
169
+ export interface IUsedInItemRecord<TClientTypes extends ClientTypes> {
170
+ readonly system: {
171
+ readonly id: string;
172
+ readonly name: string;
173
+ readonly codename: string;
174
+ readonly language: TClientTypes['languageCodenames'];
175
+ readonly type: TClientTypes['contentTypeCodenames'];
176
+ readonly collection: TClientTypes['collectionCodenames'];
177
+ readonly workflow: TClientTypes['workflowCodenames'];
178
+ readonly workflowStep: TClientTypes['workflowStepCodenames'];
179
+ readonly lastModified: string;
180
+ };
181
+ }
182
+
183
+ export type ClientTypes = {
184
+ readonly contentItemType: IContentItem;
185
+ readonly contentTypeCodenames: string;
186
+ readonly workflowCodenames: string;
187
+ readonly workflowStepCodenames: string;
188
+ readonly collectionCodenames: string;
189
+ readonly taxonomyCodenames: string;
190
+ readonly languageCodenames: string;
191
+ readonly elementCodenames: string;
192
+ };
@@ -1,17 +1,17 @@
1
- import { IQueryConfig } from './common';
2
-
3
- export interface ILanguageSystem<TLanguageCodenames extends string> {
4
- id: string;
5
- name: string;
6
- codename: TLanguageCodenames;
7
- }
8
-
9
- export interface ILanguage<TLanguageCodenames extends string> {
10
- system: ILanguageSystem<TLanguageCodenames>;
11
- }
12
-
13
- export interface ILanguagesQueryConfig extends IQueryConfig {
14
- /**
15
- * No dedicated properties required at this moment
16
- */
17
- }
1
+ import { IQueryConfig } from './common';
2
+
3
+ export interface ILanguageSystem<TLanguageCodenames extends string> {
4
+ id: string;
5
+ name: string;
6
+ codename: TLanguageCodenames;
7
+ }
8
+
9
+ export interface ILanguage<TLanguageCodenames extends string> {
10
+ system: ILanguageSystem<TLanguageCodenames>;
11
+ }
12
+
13
+ export interface ILanguagesQueryConfig extends IQueryConfig {
14
+ /**
15
+ * No dedicated properties required at this moment
16
+ */
17
+ }