@salesforce/lds-adapters-service-network-data-category 0.1.0-dev1
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/LICENSE.txt +82 -0
- package/dist/es/es2018/service-network-data-category.js +2514 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getArticlesForCategory.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/adapters/getChildCategories.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/adapters/getNetworkDataCategories.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getParentNetworkDataCategoryPath.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/adapters/getServiceCatalogItems.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/adapters/getServiceCatalogItemsForCommunity.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/adapters/updateNetworkDataCategories.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/adapters/updateNetworkDataCategory.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +9 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesDataCategoryNetworkDataCategoryByCommunityId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesNetworkDataCategoryCatalogItemByNetworkDataCategoryIdAndCommunityId.d.ts +22 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesNetworkDataCategoryChildCategoryByCommunityIdAndNetworkDataCategoryId.d.ts +23 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesNetworkDataCategoryKnowledgeArticleByNetworkDataCategoryIdAndCommunityId.d.ts +23 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesNetworkDataCategoryParentPathByCommunityIdAndNetworkDataCategoryId.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectNetworkDataCategoryCatalogItemByNetworkDataCategoryId.d.ts +21 -0
- package/dist/es/es2018/types/src/generated/resources/patchConnectCommunitiesNetworkDataCategoryByCommunityIdAndNetworkDataCategoryId.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/resources/putConnectCommunitiesDataCategoryNetworkDataCategoryByCommunityId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/DataCategoryGroupCollectionInputRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/DataCategoryGroupCollectionInputWrapperRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/EmptyRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/LightningKnowledgeArticleVersionCollectionRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/LightningKnowledgeArticleVersionRepresentation.d.ts +43 -0
- package/dist/es/es2018/types/src/generated/types/NetworkDataCategoryCollectionRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/NetworkDataCategoryGroupRepresentation.d.ts +40 -0
- package/dist/es/es2018/types/src/generated/types/NetworkDataCategoryRepresentation.d.ts +61 -0
- package/dist/es/es2018/types/src/generated/types/NetworkDataCategoryTreeRepresentation.d.ts +50 -0
- package/dist/es/es2018/types/src/generated/types/ServiceCatalogItemCollectionRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/ServiceCatalogItemRepresentation.d.ts +40 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/dist/es/es2018/types/src/raml-artifacts/adapters/updateNetworkDataCategories/buildNetworkSnapshot.d.ts +3 -0
- package/dist/es/es2018/types/src/raml-artifacts/adapters/updateNetworkDataCategory/buildNetworkSnapshot.d.ts +3 -0
- package/dist/es/es2018/types/src/raml-artifacts/resources/putConnectCommunitiesDataCategoryNetworkDataCategoryByCommunityId/ingestSuccess.d.ts +4 -0
- package/dist/es/es2018/types/src/raml-artifacts/types/EmptyRepresentation/select.d.ts +2 -0
- package/dist/es/es2018/types/src/raml-artifacts/types/EmptyRepresentation/validate.d.ts +1 -0
- package/package.json +85 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +2655 -0
- package/src/raml/api.raml +390 -0
- package/src/raml/luvio.raml +59 -0
|
@@ -0,0 +1,2514 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$6, typeCheckConfig as typeCheckConfig$8, StoreKeyMap, createResourceParams as createResourceParams$8 } from '@luvio/engine';
|
|
8
|
+
|
|
9
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
11
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
12
|
+
/**
|
|
13
|
+
* Validates an adapter config is well-formed.
|
|
14
|
+
* @param config The config to validate.
|
|
15
|
+
* @param adapter The adapter validation configuration.
|
|
16
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
17
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
18
|
+
*/
|
|
19
|
+
function validateConfig(config, adapter, oneOf) {
|
|
20
|
+
const { displayName } = adapter;
|
|
21
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
22
|
+
if (config === undefined ||
|
|
23
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
24
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
25
|
+
}
|
|
26
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
27
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
28
|
+
}
|
|
29
|
+
if (unsupported !== undefined &&
|
|
30
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
31
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
const supported = required.concat(optional);
|
|
34
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
35
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function untrustedIsObject(untrusted) {
|
|
39
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
40
|
+
}
|
|
41
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
42
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
43
|
+
}
|
|
44
|
+
const snapshotRefreshOptions = {
|
|
45
|
+
overrides: {
|
|
46
|
+
headers: {
|
|
47
|
+
'Cache-Control': 'no-cache',
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
52
|
+
return {
|
|
53
|
+
name,
|
|
54
|
+
required,
|
|
55
|
+
resourceType,
|
|
56
|
+
typeCheckShape,
|
|
57
|
+
isArrayShape,
|
|
58
|
+
coerceFn,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
62
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
63
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
64
|
+
return {
|
|
65
|
+
displayName,
|
|
66
|
+
parameters: {
|
|
67
|
+
required,
|
|
68
|
+
optional,
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const keyPrefix = 'NetworkDataCategory';
|
|
73
|
+
|
|
74
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
75
|
+
const { isArray: ArrayIsArray } = Array;
|
|
76
|
+
const { stringify: JSONStringify } = JSON;
|
|
77
|
+
function equalsArray(a, b, equalsItem) {
|
|
78
|
+
const aLength = a.length;
|
|
79
|
+
const bLength = b.length;
|
|
80
|
+
if (aLength !== bLength) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
for (let i = 0; i < aLength; i++) {
|
|
84
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
function createLink(ref) {
|
|
91
|
+
return {
|
|
92
|
+
__ref: serializeStructuredKey(ref),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const VERSION$8 = "cc2167eec65221adff5b576fc069921f";
|
|
97
|
+
function validate$9(obj, path = 'ServiceCatalogItemRepresentation') {
|
|
98
|
+
const v_error = (() => {
|
|
99
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
100
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
101
|
+
}
|
|
102
|
+
if (obj.description !== undefined) {
|
|
103
|
+
const obj_description = obj.description;
|
|
104
|
+
const path_description = path + '.description';
|
|
105
|
+
let obj_description_union0 = null;
|
|
106
|
+
const obj_description_union0_error = (() => {
|
|
107
|
+
if (typeof obj_description !== 'string') {
|
|
108
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
109
|
+
}
|
|
110
|
+
})();
|
|
111
|
+
if (obj_description_union0_error != null) {
|
|
112
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
113
|
+
}
|
|
114
|
+
let obj_description_union1 = null;
|
|
115
|
+
const obj_description_union1_error = (() => {
|
|
116
|
+
if (obj_description !== null) {
|
|
117
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
118
|
+
}
|
|
119
|
+
})();
|
|
120
|
+
if (obj_description_union1_error != null) {
|
|
121
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
122
|
+
}
|
|
123
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
124
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
125
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
126
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
127
|
+
return new TypeError(message);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const obj_developerName = obj.developerName;
|
|
131
|
+
const path_developerName = path + '.developerName';
|
|
132
|
+
if (typeof obj_developerName !== 'string') {
|
|
133
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
134
|
+
}
|
|
135
|
+
const obj_id = obj.id;
|
|
136
|
+
const path_id = path + '.id';
|
|
137
|
+
if (typeof obj_id !== 'string') {
|
|
138
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
139
|
+
}
|
|
140
|
+
if (obj.imageId !== undefined) {
|
|
141
|
+
const obj_imageId = obj.imageId;
|
|
142
|
+
const path_imageId = path + '.imageId';
|
|
143
|
+
let obj_imageId_union0 = null;
|
|
144
|
+
const obj_imageId_union0_error = (() => {
|
|
145
|
+
if (typeof obj_imageId !== 'string') {
|
|
146
|
+
return new TypeError('Expected "string" but received "' + typeof obj_imageId + '" (at "' + path_imageId + '")');
|
|
147
|
+
}
|
|
148
|
+
})();
|
|
149
|
+
if (obj_imageId_union0_error != null) {
|
|
150
|
+
obj_imageId_union0 = obj_imageId_union0_error.message;
|
|
151
|
+
}
|
|
152
|
+
let obj_imageId_union1 = null;
|
|
153
|
+
const obj_imageId_union1_error = (() => {
|
|
154
|
+
if (obj_imageId !== null) {
|
|
155
|
+
return new TypeError('Expected "null" but received "' + typeof obj_imageId + '" (at "' + path_imageId + '")');
|
|
156
|
+
}
|
|
157
|
+
})();
|
|
158
|
+
if (obj_imageId_union1_error != null) {
|
|
159
|
+
obj_imageId_union1 = obj_imageId_union1_error.message;
|
|
160
|
+
}
|
|
161
|
+
if (obj_imageId_union0 && obj_imageId_union1) {
|
|
162
|
+
let message = 'Object doesn\'t match union (at "' + path_imageId + '")';
|
|
163
|
+
message += '\n' + obj_imageId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
164
|
+
message += '\n' + obj_imageId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
165
|
+
return new TypeError(message);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const obj_label = obj.label;
|
|
169
|
+
const path_label = path + '.label';
|
|
170
|
+
if (typeof obj_label !== 'string') {
|
|
171
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
172
|
+
}
|
|
173
|
+
})();
|
|
174
|
+
return v_error === undefined ? null : v_error;
|
|
175
|
+
}
|
|
176
|
+
const select$g = function ServiceCatalogItemRepresentationSelect() {
|
|
177
|
+
return {
|
|
178
|
+
kind: 'Fragment',
|
|
179
|
+
version: VERSION$8,
|
|
180
|
+
private: [],
|
|
181
|
+
selections: [
|
|
182
|
+
{
|
|
183
|
+
name: 'description',
|
|
184
|
+
kind: 'Scalar',
|
|
185
|
+
required: false
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: 'developerName',
|
|
189
|
+
kind: 'Scalar'
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'id',
|
|
193
|
+
kind: 'Scalar'
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: 'imageId',
|
|
197
|
+
kind: 'Scalar',
|
|
198
|
+
required: false
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: 'label',
|
|
202
|
+
kind: 'Scalar'
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
function equals$8(existing, incoming) {
|
|
208
|
+
const existing_developerName = existing.developerName;
|
|
209
|
+
const incoming_developerName = incoming.developerName;
|
|
210
|
+
if (!(existing_developerName === incoming_developerName)) {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
const existing_id = existing.id;
|
|
214
|
+
const incoming_id = incoming.id;
|
|
215
|
+
if (!(existing_id === incoming_id)) {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
const existing_label = existing.label;
|
|
219
|
+
const incoming_label = incoming.label;
|
|
220
|
+
if (!(existing_label === incoming_label)) {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
const existing_description = existing.description;
|
|
224
|
+
const incoming_description = incoming.description;
|
|
225
|
+
// if at least one of these optionals is defined
|
|
226
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
227
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
228
|
+
// not equal
|
|
229
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
if (!(existing_description === incoming_description)) {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const existing_imageId = existing.imageId;
|
|
237
|
+
const incoming_imageId = incoming.imageId;
|
|
238
|
+
// if at least one of these optionals is defined
|
|
239
|
+
if (existing_imageId !== undefined || incoming_imageId !== undefined) {
|
|
240
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
241
|
+
// not equal
|
|
242
|
+
if (existing_imageId === undefined || incoming_imageId === undefined) {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
if (!(existing_imageId === incoming_imageId)) {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const VERSION$7 = "0ba0c3678e2715c0af38eb8d501269ae";
|
|
253
|
+
function validate$8(obj, path = 'ServiceCatalogItemCollectionRepresentation') {
|
|
254
|
+
const v_error = (() => {
|
|
255
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
256
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
257
|
+
}
|
|
258
|
+
if (obj.baseUrl !== undefined) {
|
|
259
|
+
const obj_baseUrl = obj.baseUrl;
|
|
260
|
+
const path_baseUrl = path + '.baseUrl';
|
|
261
|
+
let obj_baseUrl_union0 = null;
|
|
262
|
+
const obj_baseUrl_union0_error = (() => {
|
|
263
|
+
if (typeof obj_baseUrl !== 'string') {
|
|
264
|
+
return new TypeError('Expected "string" but received "' + typeof obj_baseUrl + '" (at "' + path_baseUrl + '")');
|
|
265
|
+
}
|
|
266
|
+
})();
|
|
267
|
+
if (obj_baseUrl_union0_error != null) {
|
|
268
|
+
obj_baseUrl_union0 = obj_baseUrl_union0_error.message;
|
|
269
|
+
}
|
|
270
|
+
let obj_baseUrl_union1 = null;
|
|
271
|
+
const obj_baseUrl_union1_error = (() => {
|
|
272
|
+
if (obj_baseUrl !== null) {
|
|
273
|
+
return new TypeError('Expected "null" but received "' + typeof obj_baseUrl + '" (at "' + path_baseUrl + '")');
|
|
274
|
+
}
|
|
275
|
+
})();
|
|
276
|
+
if (obj_baseUrl_union1_error != null) {
|
|
277
|
+
obj_baseUrl_union1 = obj_baseUrl_union1_error.message;
|
|
278
|
+
}
|
|
279
|
+
if (obj_baseUrl_union0 && obj_baseUrl_union1) {
|
|
280
|
+
let message = 'Object doesn\'t match union (at "' + path_baseUrl + '")';
|
|
281
|
+
message += '\n' + obj_baseUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
282
|
+
message += '\n' + obj_baseUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
283
|
+
return new TypeError(message);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const obj_items = obj.items;
|
|
287
|
+
const path_items = path + '.items';
|
|
288
|
+
if (!ArrayIsArray(obj_items)) {
|
|
289
|
+
return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
|
|
290
|
+
}
|
|
291
|
+
for (let i = 0; i < obj_items.length; i++) {
|
|
292
|
+
const obj_items_item = obj_items[i];
|
|
293
|
+
const path_items_item = path_items + '[' + i + ']';
|
|
294
|
+
const referencepath_items_itemValidationError = validate$9(obj_items_item, path_items_item);
|
|
295
|
+
if (referencepath_items_itemValidationError !== null) {
|
|
296
|
+
let message = 'Object doesn\'t match ServiceCatalogItemRepresentation (at "' + path_items_item + '")\n';
|
|
297
|
+
message += referencepath_items_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
298
|
+
return new TypeError(message);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
})();
|
|
302
|
+
return v_error === undefined ? null : v_error;
|
|
303
|
+
}
|
|
304
|
+
const RepresentationType$6 = 'ServiceCatalogItemCollectionRepresentation';
|
|
305
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
306
|
+
return input;
|
|
307
|
+
}
|
|
308
|
+
const select$f = function ServiceCatalogItemCollectionRepresentationSelect() {
|
|
309
|
+
const { selections: ServiceCatalogItemRepresentation__selections, opaque: ServiceCatalogItemRepresentation__opaque, } = select$g();
|
|
310
|
+
return {
|
|
311
|
+
kind: 'Fragment',
|
|
312
|
+
version: VERSION$7,
|
|
313
|
+
private: [],
|
|
314
|
+
selections: [
|
|
315
|
+
{
|
|
316
|
+
name: 'baseUrl',
|
|
317
|
+
kind: 'Scalar',
|
|
318
|
+
required: false
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: 'items',
|
|
322
|
+
kind: 'Object',
|
|
323
|
+
plural: true,
|
|
324
|
+
selections: ServiceCatalogItemRepresentation__selections
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
function equals$7(existing, incoming) {
|
|
330
|
+
const existing_baseUrl = existing.baseUrl;
|
|
331
|
+
const incoming_baseUrl = incoming.baseUrl;
|
|
332
|
+
// if at least one of these optionals is defined
|
|
333
|
+
if (existing_baseUrl !== undefined || incoming_baseUrl !== undefined) {
|
|
334
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
335
|
+
// not equal
|
|
336
|
+
if (existing_baseUrl === undefined || incoming_baseUrl === undefined) {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
if (!(existing_baseUrl === incoming_baseUrl)) {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
const existing_items = existing.items;
|
|
344
|
+
const incoming_items = incoming.items;
|
|
345
|
+
const equals_items_items = equalsArray(existing_items, incoming_items, (existing_items_item, incoming_items_item) => {
|
|
346
|
+
if (!(equals$8(existing_items_item, incoming_items_item))) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
if (equals_items_items === false) {
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
const ingest$6 = function ServiceCatalogItemCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
356
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
357
|
+
const validateError = validate$8(input);
|
|
358
|
+
if (validateError !== null) {
|
|
359
|
+
throw validateError;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
const key = path.fullPath;
|
|
363
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
364
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "NetworkDataCategory", VERSION$7, RepresentationType$6, equals$7);
|
|
365
|
+
return createLink(key);
|
|
366
|
+
};
|
|
367
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
368
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
369
|
+
const rootKey = fullPathFactory();
|
|
370
|
+
rootKeySet.set(rootKey, {
|
|
371
|
+
namespace: keyPrefix,
|
|
372
|
+
representationName: RepresentationType$6,
|
|
373
|
+
mergeable: false
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function select$e(luvio, params) {
|
|
378
|
+
return select$f();
|
|
379
|
+
}
|
|
380
|
+
function keyBuilder$e(luvio, params) {
|
|
381
|
+
return keyPrefix + '::ServiceCatalogItemCollectionRepresentation:(' + 'pageSize:' + params.queryParams.pageSize + ',' + 'pageNumber:' + params.queryParams.pageNumber + ',' + 'sortOrder:' + params.queryParams.sortOrder + ',' + 'sortedBy:' + params.queryParams.sortedBy + ',' + 'networkDataCategoryId:' + params.urlParams.networkDataCategoryId + ')';
|
|
382
|
+
}
|
|
383
|
+
function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
|
|
384
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$e(luvio, resourceParams));
|
|
385
|
+
}
|
|
386
|
+
function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
|
|
387
|
+
const { body } = response;
|
|
388
|
+
const key = keyBuilder$e(luvio, resourceParams);
|
|
389
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
390
|
+
const snapshot = luvio.storeLookup({
|
|
391
|
+
recordId: key,
|
|
392
|
+
node: select$e(),
|
|
393
|
+
variables: {},
|
|
394
|
+
}, snapshotRefresh);
|
|
395
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
396
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
397
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
deepFreeze(snapshot.data);
|
|
401
|
+
return snapshot;
|
|
402
|
+
}
|
|
403
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
404
|
+
const key = keyBuilder$e(luvio, params);
|
|
405
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
406
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
407
|
+
return errorSnapshot;
|
|
408
|
+
}
|
|
409
|
+
function createResourceRequest$7(config) {
|
|
410
|
+
const headers = {};
|
|
411
|
+
return {
|
|
412
|
+
baseUri: '/services/data/v66.0',
|
|
413
|
+
basePath: '/connect/network-data-category/' + config.urlParams.networkDataCategoryId + '/catalog-item',
|
|
414
|
+
method: 'get',
|
|
415
|
+
body: null,
|
|
416
|
+
urlParams: config.urlParams,
|
|
417
|
+
queryParams: config.queryParams,
|
|
418
|
+
headers,
|
|
419
|
+
priority: 'normal',
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
const adapterName$7 = 'getServiceCatalogItems';
|
|
424
|
+
const getServiceCatalogItems_ConfigPropertyMetadata = [
|
|
425
|
+
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
426
|
+
generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
427
|
+
generateParamConfigMetadata('pageNumber', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
428
|
+
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
429
|
+
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
430
|
+
];
|
|
431
|
+
const getServiceCatalogItems_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, getServiceCatalogItems_ConfigPropertyMetadata);
|
|
432
|
+
const createResourceParams$7 = /*#__PURE__*/ createResourceParams$8(getServiceCatalogItems_ConfigPropertyMetadata);
|
|
433
|
+
function keyBuilder$d(luvio, config) {
|
|
434
|
+
const resourceParams = createResourceParams$7(config);
|
|
435
|
+
return keyBuilder$e(luvio, resourceParams);
|
|
436
|
+
}
|
|
437
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
438
|
+
const config = {};
|
|
439
|
+
typeCheckConfig$8(untrustedConfig, config, getServiceCatalogItems_ConfigPropertyMetadata);
|
|
440
|
+
return config;
|
|
441
|
+
}
|
|
442
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
443
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
444
|
+
return null;
|
|
445
|
+
}
|
|
446
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
447
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
448
|
+
}
|
|
449
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
450
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
451
|
+
return null;
|
|
452
|
+
}
|
|
453
|
+
return config;
|
|
454
|
+
}
|
|
455
|
+
function adapterFragment$5(luvio, config) {
|
|
456
|
+
createResourceParams$7(config);
|
|
457
|
+
return select$e();
|
|
458
|
+
}
|
|
459
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
460
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response, {
|
|
461
|
+
config,
|
|
462
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
463
|
+
});
|
|
464
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
465
|
+
}
|
|
466
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
467
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
468
|
+
config,
|
|
469
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
470
|
+
});
|
|
471
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
472
|
+
}
|
|
473
|
+
function buildNetworkSnapshot$9(luvio, config, options) {
|
|
474
|
+
const resourceParams = createResourceParams$7(config);
|
|
475
|
+
const request = createResourceRequest$7(resourceParams);
|
|
476
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
477
|
+
.then((response) => {
|
|
478
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
479
|
+
const cache = new StoreKeyMap();
|
|
480
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
481
|
+
return cache;
|
|
482
|
+
});
|
|
483
|
+
}, (response) => {
|
|
484
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
488
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$9, undefined, false);
|
|
489
|
+
}
|
|
490
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
491
|
+
const { luvio, config } = context;
|
|
492
|
+
const selector = {
|
|
493
|
+
recordId: keyBuilder$d(luvio, config),
|
|
494
|
+
node: adapterFragment$5(luvio, config),
|
|
495
|
+
variables: {},
|
|
496
|
+
};
|
|
497
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
498
|
+
config,
|
|
499
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
500
|
+
});
|
|
501
|
+
return cacheSnapshot;
|
|
502
|
+
}
|
|
503
|
+
const getServiceCatalogItemsAdapterFactory = (luvio) => function NetworkDataCategory__getServiceCatalogItems(untrustedConfig, requestContext) {
|
|
504
|
+
const config = validateAdapterConfig$7(untrustedConfig, getServiceCatalogItems_ConfigPropertyNames);
|
|
505
|
+
// Invalid or incomplete config
|
|
506
|
+
if (config === null) {
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
510
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
const VERSION$6 = "cddad6e33054c6b9860f0ea60265869e";
|
|
514
|
+
function validate$7(obj, path = 'NetworkDataCategoryRepresentation') {
|
|
515
|
+
const v_error = (() => {
|
|
516
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
517
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
518
|
+
}
|
|
519
|
+
if (obj.categoryGroupName !== undefined) {
|
|
520
|
+
const obj_categoryGroupName = obj.categoryGroupName;
|
|
521
|
+
const path_categoryGroupName = path + '.categoryGroupName';
|
|
522
|
+
let obj_categoryGroupName_union0 = null;
|
|
523
|
+
const obj_categoryGroupName_union0_error = (() => {
|
|
524
|
+
if (typeof obj_categoryGroupName !== 'string') {
|
|
525
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryGroupName + '" (at "' + path_categoryGroupName + '")');
|
|
526
|
+
}
|
|
527
|
+
})();
|
|
528
|
+
if (obj_categoryGroupName_union0_error != null) {
|
|
529
|
+
obj_categoryGroupName_union0 = obj_categoryGroupName_union0_error.message;
|
|
530
|
+
}
|
|
531
|
+
let obj_categoryGroupName_union1 = null;
|
|
532
|
+
const obj_categoryGroupName_union1_error = (() => {
|
|
533
|
+
if (obj_categoryGroupName !== null) {
|
|
534
|
+
return new TypeError('Expected "null" but received "' + typeof obj_categoryGroupName + '" (at "' + path_categoryGroupName + '")');
|
|
535
|
+
}
|
|
536
|
+
})();
|
|
537
|
+
if (obj_categoryGroupName_union1_error != null) {
|
|
538
|
+
obj_categoryGroupName_union1 = obj_categoryGroupName_union1_error.message;
|
|
539
|
+
}
|
|
540
|
+
if (obj_categoryGroupName_union0 && obj_categoryGroupName_union1) {
|
|
541
|
+
let message = 'Object doesn\'t match union (at "' + path_categoryGroupName + '")';
|
|
542
|
+
message += '\n' + obj_categoryGroupName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
543
|
+
message += '\n' + obj_categoryGroupName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
544
|
+
return new TypeError(message);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
const obj_categoryName = obj.categoryName;
|
|
548
|
+
const path_categoryName = path + '.categoryName';
|
|
549
|
+
let obj_categoryName_union0 = null;
|
|
550
|
+
const obj_categoryName_union0_error = (() => {
|
|
551
|
+
if (typeof obj_categoryName !== 'string') {
|
|
552
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
|
|
553
|
+
}
|
|
554
|
+
})();
|
|
555
|
+
if (obj_categoryName_union0_error != null) {
|
|
556
|
+
obj_categoryName_union0 = obj_categoryName_union0_error.message;
|
|
557
|
+
}
|
|
558
|
+
let obj_categoryName_union1 = null;
|
|
559
|
+
const obj_categoryName_union1_error = (() => {
|
|
560
|
+
if (obj_categoryName !== null) {
|
|
561
|
+
return new TypeError('Expected "null" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
|
|
562
|
+
}
|
|
563
|
+
})();
|
|
564
|
+
if (obj_categoryName_union1_error != null) {
|
|
565
|
+
obj_categoryName_union1 = obj_categoryName_union1_error.message;
|
|
566
|
+
}
|
|
567
|
+
if (obj_categoryName_union0 && obj_categoryName_union1) {
|
|
568
|
+
let message = 'Object doesn\'t match union (at "' + path_categoryName + '")';
|
|
569
|
+
message += '\n' + obj_categoryName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
570
|
+
message += '\n' + obj_categoryName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
571
|
+
return new TypeError(message);
|
|
572
|
+
}
|
|
573
|
+
if (obj.categoryOrGroupLabel !== undefined) {
|
|
574
|
+
const obj_categoryOrGroupLabel = obj.categoryOrGroupLabel;
|
|
575
|
+
const path_categoryOrGroupLabel = path + '.categoryOrGroupLabel';
|
|
576
|
+
let obj_categoryOrGroupLabel_union0 = null;
|
|
577
|
+
const obj_categoryOrGroupLabel_union0_error = (() => {
|
|
578
|
+
if (typeof obj_categoryOrGroupLabel !== 'string') {
|
|
579
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryOrGroupLabel + '" (at "' + path_categoryOrGroupLabel + '")');
|
|
580
|
+
}
|
|
581
|
+
})();
|
|
582
|
+
if (obj_categoryOrGroupLabel_union0_error != null) {
|
|
583
|
+
obj_categoryOrGroupLabel_union0 = obj_categoryOrGroupLabel_union0_error.message;
|
|
584
|
+
}
|
|
585
|
+
let obj_categoryOrGroupLabel_union1 = null;
|
|
586
|
+
const obj_categoryOrGroupLabel_union1_error = (() => {
|
|
587
|
+
if (obj_categoryOrGroupLabel !== null) {
|
|
588
|
+
return new TypeError('Expected "null" but received "' + typeof obj_categoryOrGroupLabel + '" (at "' + path_categoryOrGroupLabel + '")');
|
|
589
|
+
}
|
|
590
|
+
})();
|
|
591
|
+
if (obj_categoryOrGroupLabel_union1_error != null) {
|
|
592
|
+
obj_categoryOrGroupLabel_union1 = obj_categoryOrGroupLabel_union1_error.message;
|
|
593
|
+
}
|
|
594
|
+
if (obj_categoryOrGroupLabel_union0 && obj_categoryOrGroupLabel_union1) {
|
|
595
|
+
let message = 'Object doesn\'t match union (at "' + path_categoryOrGroupLabel + '")';
|
|
596
|
+
message += '\n' + obj_categoryOrGroupLabel_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
597
|
+
message += '\n' + obj_categoryOrGroupLabel_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
598
|
+
return new TypeError(message);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
const obj_childCategories = obj.childCategories;
|
|
602
|
+
const path_childCategories = path + '.childCategories';
|
|
603
|
+
if (!ArrayIsArray(obj_childCategories)) {
|
|
604
|
+
return new TypeError('Expected "array" but received "' + typeof obj_childCategories + '" (at "' + path_childCategories + '")');
|
|
605
|
+
}
|
|
606
|
+
for (let i = 0; i < obj_childCategories.length; i++) {
|
|
607
|
+
const obj_childCategories_item = obj_childCategories[i];
|
|
608
|
+
const path_childCategories_item = path_childCategories + '[' + i + ']';
|
|
609
|
+
if (obj_childCategories_item === undefined) {
|
|
610
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_childCategories_item + '" (at "' + path_childCategories_item + '")');
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
if (obj.description !== undefined) {
|
|
614
|
+
const obj_description = obj.description;
|
|
615
|
+
const path_description = path + '.description';
|
|
616
|
+
let obj_description_union0 = null;
|
|
617
|
+
const obj_description_union0_error = (() => {
|
|
618
|
+
if (typeof obj_description !== 'string') {
|
|
619
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
620
|
+
}
|
|
621
|
+
})();
|
|
622
|
+
if (obj_description_union0_error != null) {
|
|
623
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
624
|
+
}
|
|
625
|
+
let obj_description_union1 = null;
|
|
626
|
+
const obj_description_union1_error = (() => {
|
|
627
|
+
if (obj_description !== null) {
|
|
628
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
629
|
+
}
|
|
630
|
+
})();
|
|
631
|
+
if (obj_description_union1_error != null) {
|
|
632
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
633
|
+
}
|
|
634
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
635
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
636
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
637
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
638
|
+
return new TypeError(message);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
const obj_id = obj.id;
|
|
642
|
+
const path_id = path + '.id';
|
|
643
|
+
if (typeof obj_id !== 'string') {
|
|
644
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
645
|
+
}
|
|
646
|
+
if (obj.imageUrl !== undefined) {
|
|
647
|
+
const obj_imageUrl = obj.imageUrl;
|
|
648
|
+
const path_imageUrl = path + '.imageUrl';
|
|
649
|
+
let obj_imageUrl_union0 = null;
|
|
650
|
+
const obj_imageUrl_union0_error = (() => {
|
|
651
|
+
if (typeof obj_imageUrl !== 'string') {
|
|
652
|
+
return new TypeError('Expected "string" but received "' + typeof obj_imageUrl + '" (at "' + path_imageUrl + '")');
|
|
653
|
+
}
|
|
654
|
+
})();
|
|
655
|
+
if (obj_imageUrl_union0_error != null) {
|
|
656
|
+
obj_imageUrl_union0 = obj_imageUrl_union0_error.message;
|
|
657
|
+
}
|
|
658
|
+
let obj_imageUrl_union1 = null;
|
|
659
|
+
const obj_imageUrl_union1_error = (() => {
|
|
660
|
+
if (obj_imageUrl !== null) {
|
|
661
|
+
return new TypeError('Expected "null" but received "' + typeof obj_imageUrl + '" (at "' + path_imageUrl + '")');
|
|
662
|
+
}
|
|
663
|
+
})();
|
|
664
|
+
if (obj_imageUrl_union1_error != null) {
|
|
665
|
+
obj_imageUrl_union1 = obj_imageUrl_union1_error.message;
|
|
666
|
+
}
|
|
667
|
+
if (obj_imageUrl_union0 && obj_imageUrl_union1) {
|
|
668
|
+
let message = 'Object doesn\'t match union (at "' + path_imageUrl + '")';
|
|
669
|
+
message += '\n' + obj_imageUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
670
|
+
message += '\n' + obj_imageUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
671
|
+
return new TypeError(message);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
if (obj.label !== undefined) {
|
|
675
|
+
const obj_label = obj.label;
|
|
676
|
+
const path_label = path + '.label';
|
|
677
|
+
let obj_label_union0 = null;
|
|
678
|
+
const obj_label_union0_error = (() => {
|
|
679
|
+
if (typeof obj_label !== 'string') {
|
|
680
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
681
|
+
}
|
|
682
|
+
})();
|
|
683
|
+
if (obj_label_union0_error != null) {
|
|
684
|
+
obj_label_union0 = obj_label_union0_error.message;
|
|
685
|
+
}
|
|
686
|
+
let obj_label_union1 = null;
|
|
687
|
+
const obj_label_union1_error = (() => {
|
|
688
|
+
if (obj_label !== null) {
|
|
689
|
+
return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
690
|
+
}
|
|
691
|
+
})();
|
|
692
|
+
if (obj_label_union1_error != null) {
|
|
693
|
+
obj_label_union1 = obj_label_union1_error.message;
|
|
694
|
+
}
|
|
695
|
+
if (obj_label_union0 && obj_label_union1) {
|
|
696
|
+
let message = 'Object doesn\'t match union (at "' + path_label + '")';
|
|
697
|
+
message += '\n' + obj_label_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
698
|
+
message += '\n' + obj_label_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
699
|
+
return new TypeError(message);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
if (obj.relativeUrl !== undefined) {
|
|
703
|
+
const obj_relativeUrl = obj.relativeUrl;
|
|
704
|
+
const path_relativeUrl = path + '.relativeUrl';
|
|
705
|
+
let obj_relativeUrl_union0 = null;
|
|
706
|
+
const obj_relativeUrl_union0_error = (() => {
|
|
707
|
+
if (typeof obj_relativeUrl !== 'string') {
|
|
708
|
+
return new TypeError('Expected "string" but received "' + typeof obj_relativeUrl + '" (at "' + path_relativeUrl + '")');
|
|
709
|
+
}
|
|
710
|
+
})();
|
|
711
|
+
if (obj_relativeUrl_union0_error != null) {
|
|
712
|
+
obj_relativeUrl_union0 = obj_relativeUrl_union0_error.message;
|
|
713
|
+
}
|
|
714
|
+
let obj_relativeUrl_union1 = null;
|
|
715
|
+
const obj_relativeUrl_union1_error = (() => {
|
|
716
|
+
if (obj_relativeUrl !== null) {
|
|
717
|
+
return new TypeError('Expected "null" but received "' + typeof obj_relativeUrl + '" (at "' + path_relativeUrl + '")');
|
|
718
|
+
}
|
|
719
|
+
})();
|
|
720
|
+
if (obj_relativeUrl_union1_error != null) {
|
|
721
|
+
obj_relativeUrl_union1 = obj_relativeUrl_union1_error.message;
|
|
722
|
+
}
|
|
723
|
+
if (obj_relativeUrl_union0 && obj_relativeUrl_union1) {
|
|
724
|
+
let message = 'Object doesn\'t match union (at "' + path_relativeUrl + '")';
|
|
725
|
+
message += '\n' + obj_relativeUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
726
|
+
message += '\n' + obj_relativeUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
727
|
+
return new TypeError(message);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
})();
|
|
731
|
+
return v_error === undefined ? null : v_error;
|
|
732
|
+
}
|
|
733
|
+
const RepresentationType$5 = 'NetworkDataCategoryRepresentation';
|
|
734
|
+
function keyBuilder$c(luvio, config) {
|
|
735
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.id;
|
|
736
|
+
}
|
|
737
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
738
|
+
const keyParams = {
|
|
739
|
+
id: object.id
|
|
740
|
+
};
|
|
741
|
+
return keyBuilder$c(luvio, keyParams);
|
|
742
|
+
}
|
|
743
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
744
|
+
return input;
|
|
745
|
+
}
|
|
746
|
+
const select$d = function NetworkDataCategoryRepresentationSelect() {
|
|
747
|
+
return {
|
|
748
|
+
kind: 'Fragment',
|
|
749
|
+
version: VERSION$6,
|
|
750
|
+
private: [],
|
|
751
|
+
selections: [
|
|
752
|
+
{
|
|
753
|
+
name: 'categoryGroupName',
|
|
754
|
+
kind: 'Scalar',
|
|
755
|
+
required: false
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
name: 'categoryName',
|
|
759
|
+
kind: 'Scalar'
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
name: 'categoryOrGroupLabel',
|
|
763
|
+
kind: 'Scalar',
|
|
764
|
+
required: false
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
name: 'childCategories',
|
|
768
|
+
kind: 'Object',
|
|
769
|
+
// any
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
name: 'description',
|
|
773
|
+
kind: 'Scalar',
|
|
774
|
+
required: false
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
name: 'id',
|
|
778
|
+
kind: 'Scalar'
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
name: 'imageUrl',
|
|
782
|
+
kind: 'Scalar',
|
|
783
|
+
required: false
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
name: 'label',
|
|
787
|
+
kind: 'Scalar',
|
|
788
|
+
required: false
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
name: 'relativeUrl',
|
|
792
|
+
kind: 'Scalar',
|
|
793
|
+
required: false
|
|
794
|
+
}
|
|
795
|
+
]
|
|
796
|
+
};
|
|
797
|
+
};
|
|
798
|
+
function equals$6(existing, incoming) {
|
|
799
|
+
const existing_id = existing.id;
|
|
800
|
+
const incoming_id = incoming.id;
|
|
801
|
+
if (!(existing_id === incoming_id)) {
|
|
802
|
+
return false;
|
|
803
|
+
}
|
|
804
|
+
const existing_categoryGroupName = existing.categoryGroupName;
|
|
805
|
+
const incoming_categoryGroupName = incoming.categoryGroupName;
|
|
806
|
+
// if at least one of these optionals is defined
|
|
807
|
+
if (existing_categoryGroupName !== undefined || incoming_categoryGroupName !== undefined) {
|
|
808
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
809
|
+
// not equal
|
|
810
|
+
if (existing_categoryGroupName === undefined || incoming_categoryGroupName === undefined) {
|
|
811
|
+
return false;
|
|
812
|
+
}
|
|
813
|
+
if (!(existing_categoryGroupName === incoming_categoryGroupName)) {
|
|
814
|
+
return false;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
const existing_categoryName = existing.categoryName;
|
|
818
|
+
const incoming_categoryName = incoming.categoryName;
|
|
819
|
+
if (!(existing_categoryName === incoming_categoryName)) {
|
|
820
|
+
return false;
|
|
821
|
+
}
|
|
822
|
+
const existing_categoryOrGroupLabel = existing.categoryOrGroupLabel;
|
|
823
|
+
const incoming_categoryOrGroupLabel = incoming.categoryOrGroupLabel;
|
|
824
|
+
// if at least one of these optionals is defined
|
|
825
|
+
if (existing_categoryOrGroupLabel !== undefined || incoming_categoryOrGroupLabel !== undefined) {
|
|
826
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
827
|
+
// not equal
|
|
828
|
+
if (existing_categoryOrGroupLabel === undefined || incoming_categoryOrGroupLabel === undefined) {
|
|
829
|
+
return false;
|
|
830
|
+
}
|
|
831
|
+
if (!(existing_categoryOrGroupLabel === incoming_categoryOrGroupLabel)) {
|
|
832
|
+
return false;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
const existing_childCategories = existing.childCategories;
|
|
836
|
+
const incoming_childCategories = incoming.childCategories;
|
|
837
|
+
const equals_childCategories_items = equalsArray(existing_childCategories, incoming_childCategories, (existing_childCategories_item, incoming_childCategories_item) => {
|
|
838
|
+
if (JSONStringify(incoming_childCategories_item) !== JSONStringify(existing_childCategories_item)) {
|
|
839
|
+
return false;
|
|
840
|
+
}
|
|
841
|
+
});
|
|
842
|
+
if (equals_childCategories_items === false) {
|
|
843
|
+
return false;
|
|
844
|
+
}
|
|
845
|
+
const existing_description = existing.description;
|
|
846
|
+
const incoming_description = incoming.description;
|
|
847
|
+
// if at least one of these optionals is defined
|
|
848
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
849
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
850
|
+
// not equal
|
|
851
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
if (!(existing_description === incoming_description)) {
|
|
855
|
+
return false;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
const existing_imageUrl = existing.imageUrl;
|
|
859
|
+
const incoming_imageUrl = incoming.imageUrl;
|
|
860
|
+
// if at least one of these optionals is defined
|
|
861
|
+
if (existing_imageUrl !== undefined || incoming_imageUrl !== undefined) {
|
|
862
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
863
|
+
// not equal
|
|
864
|
+
if (existing_imageUrl === undefined || incoming_imageUrl === undefined) {
|
|
865
|
+
return false;
|
|
866
|
+
}
|
|
867
|
+
if (!(existing_imageUrl === incoming_imageUrl)) {
|
|
868
|
+
return false;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
const existing_label = existing.label;
|
|
872
|
+
const incoming_label = incoming.label;
|
|
873
|
+
// if at least one of these optionals is defined
|
|
874
|
+
if (existing_label !== undefined || incoming_label !== undefined) {
|
|
875
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
876
|
+
// not equal
|
|
877
|
+
if (existing_label === undefined || incoming_label === undefined) {
|
|
878
|
+
return false;
|
|
879
|
+
}
|
|
880
|
+
if (!(existing_label === incoming_label)) {
|
|
881
|
+
return false;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
const existing_relativeUrl = existing.relativeUrl;
|
|
885
|
+
const incoming_relativeUrl = incoming.relativeUrl;
|
|
886
|
+
// if at least one of these optionals is defined
|
|
887
|
+
if (existing_relativeUrl !== undefined || incoming_relativeUrl !== undefined) {
|
|
888
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
889
|
+
// not equal
|
|
890
|
+
if (existing_relativeUrl === undefined || incoming_relativeUrl === undefined) {
|
|
891
|
+
return false;
|
|
892
|
+
}
|
|
893
|
+
if (!(existing_relativeUrl === incoming_relativeUrl)) {
|
|
894
|
+
return false;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
return true;
|
|
898
|
+
}
|
|
899
|
+
const ingest$5 = function NetworkDataCategoryRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
900
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
901
|
+
const validateError = validate$7(input);
|
|
902
|
+
if (validateError !== null) {
|
|
903
|
+
throw validateError;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
907
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
908
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "NetworkDataCategory", VERSION$6, RepresentationType$5, equals$6);
|
|
909
|
+
return createLink(key);
|
|
910
|
+
};
|
|
911
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
912
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
913
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
914
|
+
rootKeySet.set(rootKey, {
|
|
915
|
+
namespace: keyPrefix,
|
|
916
|
+
representationName: RepresentationType$5,
|
|
917
|
+
mergeable: false
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
function select$c(luvio, params) {
|
|
922
|
+
return select$d();
|
|
923
|
+
}
|
|
924
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
925
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
926
|
+
}
|
|
927
|
+
function ingestSuccess$6(luvio, resourceParams, response) {
|
|
928
|
+
const { body } = response;
|
|
929
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
930
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
931
|
+
const snapshot = luvio.storeLookup({
|
|
932
|
+
recordId: key,
|
|
933
|
+
node: select$c(),
|
|
934
|
+
variables: {},
|
|
935
|
+
});
|
|
936
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
937
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
938
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
deepFreeze(snapshot.data);
|
|
942
|
+
return snapshot;
|
|
943
|
+
}
|
|
944
|
+
function createResourceRequest$6(config) {
|
|
945
|
+
const headers = {};
|
|
946
|
+
return {
|
|
947
|
+
baseUri: '/services/data/v66.0',
|
|
948
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '',
|
|
949
|
+
method: 'patch',
|
|
950
|
+
body: null,
|
|
951
|
+
urlParams: config.urlParams,
|
|
952
|
+
queryParams: config.queryParams,
|
|
953
|
+
headers,
|
|
954
|
+
priority: 'normal',
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
const VERSION$5 = "15c619f1c41ed55ac3d19e24eb94542b";
|
|
959
|
+
function validate$6(obj, path = 'NetworkDataCategoryGroupRepresentation') {
|
|
960
|
+
const v_error = (() => {
|
|
961
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
962
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
963
|
+
}
|
|
964
|
+
const obj_categoryGroupName = obj.categoryGroupName;
|
|
965
|
+
const path_categoryGroupName = path + '.categoryGroupName';
|
|
966
|
+
if (typeof obj_categoryGroupName !== 'string') {
|
|
967
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryGroupName + '" (at "' + path_categoryGroupName + '")');
|
|
968
|
+
}
|
|
969
|
+
const obj_rootCategory = obj.rootCategory;
|
|
970
|
+
const path_rootCategory = path + '.rootCategory';
|
|
971
|
+
if (typeof obj_rootCategory !== 'object' || Array.isArray(obj_rootCategory)) {
|
|
972
|
+
return new TypeError('Expected "object" but received "' + typeof obj_rootCategory + '" (at "' + path_rootCategory + '")');
|
|
973
|
+
}
|
|
974
|
+
})();
|
|
975
|
+
return v_error === undefined ? null : v_error;
|
|
976
|
+
}
|
|
977
|
+
const RepresentationType$4 = 'NetworkDataCategoryGroupRepresentation';
|
|
978
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
979
|
+
const input_rootCategory = input.rootCategory;
|
|
980
|
+
const input_rootCategory_id = path.fullPath + '__rootCategory';
|
|
981
|
+
input.rootCategory = ingest$5(input_rootCategory, {
|
|
982
|
+
fullPath: input_rootCategory_id,
|
|
983
|
+
propertyName: 'rootCategory',
|
|
984
|
+
parent: {
|
|
985
|
+
data: input,
|
|
986
|
+
key: path.fullPath,
|
|
987
|
+
existing: existing,
|
|
988
|
+
},
|
|
989
|
+
ttl: path.ttl
|
|
990
|
+
}, luvio, store, timestamp);
|
|
991
|
+
return input;
|
|
992
|
+
}
|
|
993
|
+
const select$b = function NetworkDataCategoryGroupRepresentationSelect() {
|
|
994
|
+
return {
|
|
995
|
+
kind: 'Fragment',
|
|
996
|
+
version: VERSION$5,
|
|
997
|
+
private: [],
|
|
998
|
+
selections: [
|
|
999
|
+
{
|
|
1000
|
+
name: 'categoryGroupName',
|
|
1001
|
+
kind: 'Scalar'
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
name: 'rootCategory',
|
|
1005
|
+
kind: 'Link',
|
|
1006
|
+
fragment: select$d()
|
|
1007
|
+
}
|
|
1008
|
+
]
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
function equals$5(existing, incoming) {
|
|
1012
|
+
const existing_categoryGroupName = existing.categoryGroupName;
|
|
1013
|
+
const incoming_categoryGroupName = incoming.categoryGroupName;
|
|
1014
|
+
if (!(existing_categoryGroupName === incoming_categoryGroupName)) {
|
|
1015
|
+
return false;
|
|
1016
|
+
}
|
|
1017
|
+
const existing_rootCategory = existing.rootCategory;
|
|
1018
|
+
const incoming_rootCategory = incoming.rootCategory;
|
|
1019
|
+
if (!(existing_rootCategory.__ref === incoming_rootCategory.__ref)) {
|
|
1020
|
+
return false;
|
|
1021
|
+
}
|
|
1022
|
+
return true;
|
|
1023
|
+
}
|
|
1024
|
+
const ingest$4 = function NetworkDataCategoryGroupRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1025
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1026
|
+
const validateError = validate$6(input);
|
|
1027
|
+
if (validateError !== null) {
|
|
1028
|
+
throw validateError;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
const key = path.fullPath;
|
|
1032
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
1033
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "NetworkDataCategory", VERSION$5, RepresentationType$4, equals$5);
|
|
1034
|
+
return createLink(key);
|
|
1035
|
+
};
|
|
1036
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
1037
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1038
|
+
const rootKey = fullPathFactory();
|
|
1039
|
+
rootKeySet.set(rootKey, {
|
|
1040
|
+
namespace: keyPrefix,
|
|
1041
|
+
representationName: RepresentationType$4,
|
|
1042
|
+
mergeable: false
|
|
1043
|
+
});
|
|
1044
|
+
getTypeCacheKeys$5(rootKeySet, luvio, input.rootCategory);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
const VERSION$4 = "5e66b8759100556a58fea2ff97dab767";
|
|
1048
|
+
function validate$5(obj, path = 'NetworkDataCategoryTreeRepresentation') {
|
|
1049
|
+
const v_error = (() => {
|
|
1050
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1051
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1052
|
+
}
|
|
1053
|
+
const obj_communityId = obj.communityId;
|
|
1054
|
+
const path_communityId = path + '.communityId';
|
|
1055
|
+
if (typeof obj_communityId !== 'string') {
|
|
1056
|
+
return new TypeError('Expected "string" but received "' + typeof obj_communityId + '" (at "' + path_communityId + '")');
|
|
1057
|
+
}
|
|
1058
|
+
const obj_dataCategoryGroups = obj.dataCategoryGroups;
|
|
1059
|
+
const path_dataCategoryGroups = path + '.dataCategoryGroups';
|
|
1060
|
+
if (!ArrayIsArray(obj_dataCategoryGroups)) {
|
|
1061
|
+
return new TypeError('Expected "array" but received "' + typeof obj_dataCategoryGroups + '" (at "' + path_dataCategoryGroups + '")');
|
|
1062
|
+
}
|
|
1063
|
+
for (let i = 0; i < obj_dataCategoryGroups.length; i++) {
|
|
1064
|
+
const obj_dataCategoryGroups_item = obj_dataCategoryGroups[i];
|
|
1065
|
+
const path_dataCategoryGroups_item = path_dataCategoryGroups + '[' + i + ']';
|
|
1066
|
+
if (typeof obj_dataCategoryGroups_item !== 'object' || Array.isArray(obj_dataCategoryGroups_item)) {
|
|
1067
|
+
return new TypeError('Expected "object" but received "' + typeof obj_dataCategoryGroups_item + '" (at "' + path_dataCategoryGroups_item + '")');
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
})();
|
|
1071
|
+
return v_error === undefined ? null : v_error;
|
|
1072
|
+
}
|
|
1073
|
+
const RepresentationType$3 = 'NetworkDataCategoryTreeRepresentation';
|
|
1074
|
+
function keyBuilder$b(luvio, config) {
|
|
1075
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.communityId;
|
|
1076
|
+
}
|
|
1077
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
1078
|
+
const keyParams = {
|
|
1079
|
+
communityId: object.communityId
|
|
1080
|
+
};
|
|
1081
|
+
return keyBuilder$b(luvio, keyParams);
|
|
1082
|
+
}
|
|
1083
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1084
|
+
const input_dataCategoryGroups = input.dataCategoryGroups;
|
|
1085
|
+
const input_dataCategoryGroups_id = path.fullPath + '__dataCategoryGroups';
|
|
1086
|
+
for (let i = 0; i < input_dataCategoryGroups.length; i++) {
|
|
1087
|
+
const input_dataCategoryGroups_item = input_dataCategoryGroups[i];
|
|
1088
|
+
let input_dataCategoryGroups_item_id = input_dataCategoryGroups_id + '__' + i;
|
|
1089
|
+
input_dataCategoryGroups[i] = ingest$4(input_dataCategoryGroups_item, {
|
|
1090
|
+
fullPath: input_dataCategoryGroups_item_id,
|
|
1091
|
+
propertyName: i,
|
|
1092
|
+
parent: {
|
|
1093
|
+
data: input,
|
|
1094
|
+
key: path.fullPath,
|
|
1095
|
+
existing: existing,
|
|
1096
|
+
},
|
|
1097
|
+
ttl: path.ttl
|
|
1098
|
+
}, luvio, store, timestamp);
|
|
1099
|
+
}
|
|
1100
|
+
return input;
|
|
1101
|
+
}
|
|
1102
|
+
const select$a = function NetworkDataCategoryTreeRepresentationSelect() {
|
|
1103
|
+
return {
|
|
1104
|
+
kind: 'Fragment',
|
|
1105
|
+
version: VERSION$4,
|
|
1106
|
+
private: [],
|
|
1107
|
+
selections: [
|
|
1108
|
+
{
|
|
1109
|
+
name: 'communityId',
|
|
1110
|
+
kind: 'Scalar'
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
name: 'dataCategoryGroups',
|
|
1114
|
+
kind: 'Link',
|
|
1115
|
+
plural: true,
|
|
1116
|
+
fragment: select$b()
|
|
1117
|
+
}
|
|
1118
|
+
]
|
|
1119
|
+
};
|
|
1120
|
+
};
|
|
1121
|
+
function equals$4(existing, incoming) {
|
|
1122
|
+
const existing_communityId = existing.communityId;
|
|
1123
|
+
const incoming_communityId = incoming.communityId;
|
|
1124
|
+
if (!(existing_communityId === incoming_communityId)) {
|
|
1125
|
+
return false;
|
|
1126
|
+
}
|
|
1127
|
+
const existing_dataCategoryGroups = existing.dataCategoryGroups;
|
|
1128
|
+
const incoming_dataCategoryGroups = incoming.dataCategoryGroups;
|
|
1129
|
+
const equals_dataCategoryGroups_items = equalsArray(existing_dataCategoryGroups, incoming_dataCategoryGroups, (existing_dataCategoryGroups_item, incoming_dataCategoryGroups_item) => {
|
|
1130
|
+
if (!(existing_dataCategoryGroups_item.__ref === incoming_dataCategoryGroups_item.__ref)) {
|
|
1131
|
+
return false;
|
|
1132
|
+
}
|
|
1133
|
+
});
|
|
1134
|
+
if (equals_dataCategoryGroups_items === false) {
|
|
1135
|
+
return false;
|
|
1136
|
+
}
|
|
1137
|
+
return true;
|
|
1138
|
+
}
|
|
1139
|
+
const ingest$3 = function NetworkDataCategoryTreeRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1140
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1141
|
+
const validateError = validate$5(input);
|
|
1142
|
+
if (validateError !== null) {
|
|
1143
|
+
throw validateError;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
1147
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
1148
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "NetworkDataCategory", VERSION$4, RepresentationType$3, equals$4);
|
|
1149
|
+
return createLink(key);
|
|
1150
|
+
};
|
|
1151
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
1152
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1153
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1154
|
+
rootKeySet.set(rootKey, {
|
|
1155
|
+
namespace: keyPrefix,
|
|
1156
|
+
representationName: RepresentationType$3,
|
|
1157
|
+
mergeable: false
|
|
1158
|
+
});
|
|
1159
|
+
const input_dataCategoryGroups_length = input.dataCategoryGroups.length;
|
|
1160
|
+
for (let i = 0; i < input_dataCategoryGroups_length; i++) {
|
|
1161
|
+
getTypeCacheKeys$4(rootKeySet, luvio, input.dataCategoryGroups[i], () => '');
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
const notifyUpdateAvailableFactory = (luvio) => {
|
|
1165
|
+
return function notifyNetworkDataCategoryTreeRepresentationUpdateAvailable(configs) {
|
|
1166
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1167
|
+
const requiredKeyParams = ['communityId'];
|
|
1168
|
+
configs.forEach(config => {
|
|
1169
|
+
if (false === requiredKeyParams.every(req => req in config)) {
|
|
1170
|
+
throw new Error(`one of the configs did not contain all required parameters: ${JSONStringify(ObjectKeys(config))}`);
|
|
1171
|
+
}
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
const keys = configs.map(c => keyBuilder$b(luvio, c));
|
|
1175
|
+
return luvio.notifyStoreUpdateAvailable(keys);
|
|
1176
|
+
};
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1179
|
+
function buildNetworkSnapshot$8(luvio, config) {
|
|
1180
|
+
return buildNetworkSnapshot$7(luvio, config).then((result) => {
|
|
1181
|
+
notifyUpdateAvailableFactory(luvio)([{ communityId: config.communityId }]);
|
|
1182
|
+
return result;
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
const adapterName$6 = 'updateNetworkDataCategory';
|
|
1187
|
+
const updateNetworkDataCategory_ConfigPropertyMetadata = [
|
|
1188
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1189
|
+
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1190
|
+
generateParamConfigMetadata('description', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1191
|
+
generateParamConfigMetadata('label', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1192
|
+
];
|
|
1193
|
+
const updateNetworkDataCategory_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, updateNetworkDataCategory_ConfigPropertyMetadata);
|
|
1194
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$8(updateNetworkDataCategory_ConfigPropertyMetadata);
|
|
1195
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
1196
|
+
const config = {};
|
|
1197
|
+
typeCheckConfig$8(untrustedConfig, config, updateNetworkDataCategory_ConfigPropertyMetadata);
|
|
1198
|
+
return config;
|
|
1199
|
+
}
|
|
1200
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
1201
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1202
|
+
return null;
|
|
1203
|
+
}
|
|
1204
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1205
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1206
|
+
}
|
|
1207
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
1208
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1209
|
+
return null;
|
|
1210
|
+
}
|
|
1211
|
+
return config;
|
|
1212
|
+
}
|
|
1213
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
1214
|
+
const resourceParams = createResourceParams$6(config);
|
|
1215
|
+
const request = createResourceRequest$6(resourceParams);
|
|
1216
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1217
|
+
.then((response) => {
|
|
1218
|
+
return luvio.handleSuccessResponse(() => {
|
|
1219
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response);
|
|
1220
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1221
|
+
}, () => {
|
|
1222
|
+
const cache = new StoreKeyMap();
|
|
1223
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
1224
|
+
return cache;
|
|
1225
|
+
});
|
|
1226
|
+
}, (response) => {
|
|
1227
|
+
deepFreeze(response);
|
|
1228
|
+
throw response;
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
const updateNetworkDataCategoryAdapterFactory = (luvio) => {
|
|
1232
|
+
return function updateNetworkDataCategory(untrustedConfig) {
|
|
1233
|
+
const config = validateAdapterConfig$6(untrustedConfig, updateNetworkDataCategory_ConfigPropertyNames);
|
|
1234
|
+
// Invalid or incomplete config
|
|
1235
|
+
if (config === null) {
|
|
1236
|
+
throw new Error('Invalid config for "updateNetworkDataCategory"');
|
|
1237
|
+
}
|
|
1238
|
+
return buildNetworkSnapshot$8(luvio, config);
|
|
1239
|
+
};
|
|
1240
|
+
};
|
|
1241
|
+
|
|
1242
|
+
function select$9(luvio, params) {
|
|
1243
|
+
return select$f();
|
|
1244
|
+
}
|
|
1245
|
+
function keyBuilder$a(luvio, params) {
|
|
1246
|
+
return keyPrefix + '::ServiceCatalogItemCollectionRepresentation:(' + 'pageSize:' + params.queryParams.pageSize + ',' + 'pageNumber:' + params.queryParams.pageNumber + ',' + 'sortOrder:' + params.queryParams.sortOrder + ',' + 'sortedBy:' + params.queryParams.sortedBy + ',' + 'networkDataCategoryId:' + params.urlParams.networkDataCategoryId + ',' + 'communityId:' + params.urlParams.communityId + ')';
|
|
1247
|
+
}
|
|
1248
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
1249
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$a(luvio, resourceParams));
|
|
1250
|
+
}
|
|
1251
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
1252
|
+
const { body } = response;
|
|
1253
|
+
const key = keyBuilder$a(luvio, resourceParams);
|
|
1254
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
1255
|
+
const snapshot = luvio.storeLookup({
|
|
1256
|
+
recordId: key,
|
|
1257
|
+
node: select$9(),
|
|
1258
|
+
variables: {},
|
|
1259
|
+
}, snapshotRefresh);
|
|
1260
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1261
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1262
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
deepFreeze(snapshot.data);
|
|
1266
|
+
return snapshot;
|
|
1267
|
+
}
|
|
1268
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
1269
|
+
const key = keyBuilder$a(luvio, params);
|
|
1270
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1271
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1272
|
+
return errorSnapshot;
|
|
1273
|
+
}
|
|
1274
|
+
function createResourceRequest$5(config) {
|
|
1275
|
+
const headers = {};
|
|
1276
|
+
return {
|
|
1277
|
+
baseUri: '/services/data/v66.0',
|
|
1278
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '/catalog-item',
|
|
1279
|
+
method: 'get',
|
|
1280
|
+
body: null,
|
|
1281
|
+
urlParams: config.urlParams,
|
|
1282
|
+
queryParams: config.queryParams,
|
|
1283
|
+
headers,
|
|
1284
|
+
priority: 'normal',
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
const adapterName$5 = 'getServiceCatalogItemsForCommunity';
|
|
1289
|
+
const getServiceCatalogItemsForCommunity_ConfigPropertyMetadata = [
|
|
1290
|
+
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1291
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1292
|
+
generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1293
|
+
generateParamConfigMetadata('pageNumber', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1294
|
+
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1295
|
+
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1296
|
+
];
|
|
1297
|
+
const getServiceCatalogItemsForCommunity_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getServiceCatalogItemsForCommunity_ConfigPropertyMetadata);
|
|
1298
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$8(getServiceCatalogItemsForCommunity_ConfigPropertyMetadata);
|
|
1299
|
+
function keyBuilder$9(luvio, config) {
|
|
1300
|
+
const resourceParams = createResourceParams$5(config);
|
|
1301
|
+
return keyBuilder$a(luvio, resourceParams);
|
|
1302
|
+
}
|
|
1303
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
1304
|
+
const config = {};
|
|
1305
|
+
typeCheckConfig$8(untrustedConfig, config, getServiceCatalogItemsForCommunity_ConfigPropertyMetadata);
|
|
1306
|
+
return config;
|
|
1307
|
+
}
|
|
1308
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
1309
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1310
|
+
return null;
|
|
1311
|
+
}
|
|
1312
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1313
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1314
|
+
}
|
|
1315
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
1316
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1317
|
+
return null;
|
|
1318
|
+
}
|
|
1319
|
+
return config;
|
|
1320
|
+
}
|
|
1321
|
+
function adapterFragment$4(luvio, config) {
|
|
1322
|
+
createResourceParams$5(config);
|
|
1323
|
+
return select$9();
|
|
1324
|
+
}
|
|
1325
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
1326
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
1327
|
+
config,
|
|
1328
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
1329
|
+
});
|
|
1330
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1331
|
+
}
|
|
1332
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
1333
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
1334
|
+
config,
|
|
1335
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
1336
|
+
});
|
|
1337
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1338
|
+
}
|
|
1339
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
1340
|
+
const resourceParams = createResourceParams$5(config);
|
|
1341
|
+
const request = createResourceRequest$5(resourceParams);
|
|
1342
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1343
|
+
.then((response) => {
|
|
1344
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
1345
|
+
const cache = new StoreKeyMap();
|
|
1346
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
1347
|
+
return cache;
|
|
1348
|
+
});
|
|
1349
|
+
}, (response) => {
|
|
1350
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1353
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
1354
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
1355
|
+
}
|
|
1356
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
1357
|
+
const { luvio, config } = context;
|
|
1358
|
+
const selector = {
|
|
1359
|
+
recordId: keyBuilder$9(luvio, config),
|
|
1360
|
+
node: adapterFragment$4(luvio, config),
|
|
1361
|
+
variables: {},
|
|
1362
|
+
};
|
|
1363
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1364
|
+
config,
|
|
1365
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
1366
|
+
});
|
|
1367
|
+
return cacheSnapshot;
|
|
1368
|
+
}
|
|
1369
|
+
const getServiceCatalogItemsForCommunityAdapterFactory = (luvio) => function NetworkDataCategory__getServiceCatalogItemsForCommunity(untrustedConfig, requestContext) {
|
|
1370
|
+
const config = validateAdapterConfig$5(untrustedConfig, getServiceCatalogItemsForCommunity_ConfigPropertyNames);
|
|
1371
|
+
// Invalid or incomplete config
|
|
1372
|
+
if (config === null) {
|
|
1373
|
+
return null;
|
|
1374
|
+
}
|
|
1375
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1376
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
const VERSION$3 = "1579429bf94d94aa9fe7ba4906607811";
|
|
1380
|
+
function validate$4(obj, path = 'LightningKnowledgeArticleVersionRepresentation') {
|
|
1381
|
+
const v_error = (() => {
|
|
1382
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1383
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1384
|
+
}
|
|
1385
|
+
const obj_id = obj.id;
|
|
1386
|
+
const path_id = path + '.id';
|
|
1387
|
+
if (typeof obj_id !== 'string') {
|
|
1388
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1389
|
+
}
|
|
1390
|
+
const obj_knowledgeArticleId = obj.knowledgeArticleId;
|
|
1391
|
+
const path_knowledgeArticleId = path + '.knowledgeArticleId';
|
|
1392
|
+
if (typeof obj_knowledgeArticleId !== 'string') {
|
|
1393
|
+
return new TypeError('Expected "string" but received "' + typeof obj_knowledgeArticleId + '" (at "' + path_knowledgeArticleId + '")');
|
|
1394
|
+
}
|
|
1395
|
+
const obj_lastPublishedDate = obj.lastPublishedDate;
|
|
1396
|
+
const path_lastPublishedDate = path + '.lastPublishedDate';
|
|
1397
|
+
if (typeof obj_lastPublishedDate !== 'string') {
|
|
1398
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastPublishedDate + '" (at "' + path_lastPublishedDate + '")');
|
|
1399
|
+
}
|
|
1400
|
+
if (obj.summary !== undefined) {
|
|
1401
|
+
const obj_summary = obj.summary;
|
|
1402
|
+
const path_summary = path + '.summary';
|
|
1403
|
+
let obj_summary_union0 = null;
|
|
1404
|
+
const obj_summary_union0_error = (() => {
|
|
1405
|
+
if (typeof obj_summary !== 'string') {
|
|
1406
|
+
return new TypeError('Expected "string" but received "' + typeof obj_summary + '" (at "' + path_summary + '")');
|
|
1407
|
+
}
|
|
1408
|
+
})();
|
|
1409
|
+
if (obj_summary_union0_error != null) {
|
|
1410
|
+
obj_summary_union0 = obj_summary_union0_error.message;
|
|
1411
|
+
}
|
|
1412
|
+
let obj_summary_union1 = null;
|
|
1413
|
+
const obj_summary_union1_error = (() => {
|
|
1414
|
+
if (obj_summary !== null) {
|
|
1415
|
+
return new TypeError('Expected "null" but received "' + typeof obj_summary + '" (at "' + path_summary + '")');
|
|
1416
|
+
}
|
|
1417
|
+
})();
|
|
1418
|
+
if (obj_summary_union1_error != null) {
|
|
1419
|
+
obj_summary_union1 = obj_summary_union1_error.message;
|
|
1420
|
+
}
|
|
1421
|
+
if (obj_summary_union0 && obj_summary_union1) {
|
|
1422
|
+
let message = 'Object doesn\'t match union (at "' + path_summary + '")';
|
|
1423
|
+
message += '\n' + obj_summary_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1424
|
+
message += '\n' + obj_summary_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1425
|
+
return new TypeError(message);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
const obj_title = obj.title;
|
|
1429
|
+
const path_title = path + '.title';
|
|
1430
|
+
if (typeof obj_title !== 'string') {
|
|
1431
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
1432
|
+
}
|
|
1433
|
+
const obj_urlName = obj.urlName;
|
|
1434
|
+
const path_urlName = path + '.urlName';
|
|
1435
|
+
if (typeof obj_urlName !== 'string') {
|
|
1436
|
+
return new TypeError('Expected "string" but received "' + typeof obj_urlName + '" (at "' + path_urlName + '")');
|
|
1437
|
+
}
|
|
1438
|
+
})();
|
|
1439
|
+
return v_error === undefined ? null : v_error;
|
|
1440
|
+
}
|
|
1441
|
+
const select$8 = function LightningKnowledgeArticleVersionRepresentationSelect() {
|
|
1442
|
+
return {
|
|
1443
|
+
kind: 'Fragment',
|
|
1444
|
+
version: VERSION$3,
|
|
1445
|
+
private: [],
|
|
1446
|
+
selections: [
|
|
1447
|
+
{
|
|
1448
|
+
name: 'id',
|
|
1449
|
+
kind: 'Scalar'
|
|
1450
|
+
},
|
|
1451
|
+
{
|
|
1452
|
+
name: 'knowledgeArticleId',
|
|
1453
|
+
kind: 'Scalar'
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
name: 'lastPublishedDate',
|
|
1457
|
+
kind: 'Scalar'
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
name: 'summary',
|
|
1461
|
+
kind: 'Scalar',
|
|
1462
|
+
required: false
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
name: 'title',
|
|
1466
|
+
kind: 'Scalar'
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
name: 'urlName',
|
|
1470
|
+
kind: 'Scalar'
|
|
1471
|
+
}
|
|
1472
|
+
]
|
|
1473
|
+
};
|
|
1474
|
+
};
|
|
1475
|
+
function equals$3(existing, incoming) {
|
|
1476
|
+
const existing_id = existing.id;
|
|
1477
|
+
const incoming_id = incoming.id;
|
|
1478
|
+
if (!(existing_id === incoming_id)) {
|
|
1479
|
+
return false;
|
|
1480
|
+
}
|
|
1481
|
+
const existing_knowledgeArticleId = existing.knowledgeArticleId;
|
|
1482
|
+
const incoming_knowledgeArticleId = incoming.knowledgeArticleId;
|
|
1483
|
+
if (!(existing_knowledgeArticleId === incoming_knowledgeArticleId)) {
|
|
1484
|
+
return false;
|
|
1485
|
+
}
|
|
1486
|
+
const existing_lastPublishedDate = existing.lastPublishedDate;
|
|
1487
|
+
const incoming_lastPublishedDate = incoming.lastPublishedDate;
|
|
1488
|
+
if (!(existing_lastPublishedDate === incoming_lastPublishedDate)) {
|
|
1489
|
+
return false;
|
|
1490
|
+
}
|
|
1491
|
+
const existing_title = existing.title;
|
|
1492
|
+
const incoming_title = incoming.title;
|
|
1493
|
+
if (!(existing_title === incoming_title)) {
|
|
1494
|
+
return false;
|
|
1495
|
+
}
|
|
1496
|
+
const existing_urlName = existing.urlName;
|
|
1497
|
+
const incoming_urlName = incoming.urlName;
|
|
1498
|
+
if (!(existing_urlName === incoming_urlName)) {
|
|
1499
|
+
return false;
|
|
1500
|
+
}
|
|
1501
|
+
const existing_summary = existing.summary;
|
|
1502
|
+
const incoming_summary = incoming.summary;
|
|
1503
|
+
// if at least one of these optionals is defined
|
|
1504
|
+
if (existing_summary !== undefined || incoming_summary !== undefined) {
|
|
1505
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1506
|
+
// not equal
|
|
1507
|
+
if (existing_summary === undefined || incoming_summary === undefined) {
|
|
1508
|
+
return false;
|
|
1509
|
+
}
|
|
1510
|
+
if (!(existing_summary === incoming_summary)) {
|
|
1511
|
+
return false;
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
return true;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
const VERSION$2 = "6e0f7ad284b0bacd2260182b92f0e398";
|
|
1518
|
+
function validate$3(obj, path = 'LightningKnowledgeArticleVersionCollectionRepresentation') {
|
|
1519
|
+
const v_error = (() => {
|
|
1520
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1521
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1522
|
+
}
|
|
1523
|
+
if (obj.baseUrl !== undefined) {
|
|
1524
|
+
const obj_baseUrl = obj.baseUrl;
|
|
1525
|
+
const path_baseUrl = path + '.baseUrl';
|
|
1526
|
+
let obj_baseUrl_union0 = null;
|
|
1527
|
+
const obj_baseUrl_union0_error = (() => {
|
|
1528
|
+
if (typeof obj_baseUrl !== 'string') {
|
|
1529
|
+
return new TypeError('Expected "string" but received "' + typeof obj_baseUrl + '" (at "' + path_baseUrl + '")');
|
|
1530
|
+
}
|
|
1531
|
+
})();
|
|
1532
|
+
if (obj_baseUrl_union0_error != null) {
|
|
1533
|
+
obj_baseUrl_union0 = obj_baseUrl_union0_error.message;
|
|
1534
|
+
}
|
|
1535
|
+
let obj_baseUrl_union1 = null;
|
|
1536
|
+
const obj_baseUrl_union1_error = (() => {
|
|
1537
|
+
if (obj_baseUrl !== null) {
|
|
1538
|
+
return new TypeError('Expected "null" but received "' + typeof obj_baseUrl + '" (at "' + path_baseUrl + '")');
|
|
1539
|
+
}
|
|
1540
|
+
})();
|
|
1541
|
+
if (obj_baseUrl_union1_error != null) {
|
|
1542
|
+
obj_baseUrl_union1 = obj_baseUrl_union1_error.message;
|
|
1543
|
+
}
|
|
1544
|
+
if (obj_baseUrl_union0 && obj_baseUrl_union1) {
|
|
1545
|
+
let message = 'Object doesn\'t match union (at "' + path_baseUrl + '")';
|
|
1546
|
+
message += '\n' + obj_baseUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1547
|
+
message += '\n' + obj_baseUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1548
|
+
return new TypeError(message);
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
const obj_items = obj.items;
|
|
1552
|
+
const path_items = path + '.items';
|
|
1553
|
+
if (!ArrayIsArray(obj_items)) {
|
|
1554
|
+
return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
|
|
1555
|
+
}
|
|
1556
|
+
for (let i = 0; i < obj_items.length; i++) {
|
|
1557
|
+
const obj_items_item = obj_items[i];
|
|
1558
|
+
const path_items_item = path_items + '[' + i + ']';
|
|
1559
|
+
const referencepath_items_itemValidationError = validate$4(obj_items_item, path_items_item);
|
|
1560
|
+
if (referencepath_items_itemValidationError !== null) {
|
|
1561
|
+
let message = 'Object doesn\'t match LightningKnowledgeArticleVersionRepresentation (at "' + path_items_item + '")\n';
|
|
1562
|
+
message += referencepath_items_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1563
|
+
return new TypeError(message);
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
})();
|
|
1567
|
+
return v_error === undefined ? null : v_error;
|
|
1568
|
+
}
|
|
1569
|
+
const RepresentationType$2 = 'LightningKnowledgeArticleVersionCollectionRepresentation';
|
|
1570
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1571
|
+
return input;
|
|
1572
|
+
}
|
|
1573
|
+
const select$7 = function LightningKnowledgeArticleVersionCollectionRepresentationSelect() {
|
|
1574
|
+
const { selections: LightningKnowledgeArticleVersionRepresentation__selections, opaque: LightningKnowledgeArticleVersionRepresentation__opaque, } = select$8();
|
|
1575
|
+
return {
|
|
1576
|
+
kind: 'Fragment',
|
|
1577
|
+
version: VERSION$2,
|
|
1578
|
+
private: [],
|
|
1579
|
+
selections: [
|
|
1580
|
+
{
|
|
1581
|
+
name: 'baseUrl',
|
|
1582
|
+
kind: 'Scalar',
|
|
1583
|
+
required: false
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
name: 'items',
|
|
1587
|
+
kind: 'Object',
|
|
1588
|
+
plural: true,
|
|
1589
|
+
selections: LightningKnowledgeArticleVersionRepresentation__selections
|
|
1590
|
+
}
|
|
1591
|
+
]
|
|
1592
|
+
};
|
|
1593
|
+
};
|
|
1594
|
+
function equals$2(existing, incoming) {
|
|
1595
|
+
const existing_baseUrl = existing.baseUrl;
|
|
1596
|
+
const incoming_baseUrl = incoming.baseUrl;
|
|
1597
|
+
// if at least one of these optionals is defined
|
|
1598
|
+
if (existing_baseUrl !== undefined || incoming_baseUrl !== undefined) {
|
|
1599
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1600
|
+
// not equal
|
|
1601
|
+
if (existing_baseUrl === undefined || incoming_baseUrl === undefined) {
|
|
1602
|
+
return false;
|
|
1603
|
+
}
|
|
1604
|
+
if (!(existing_baseUrl === incoming_baseUrl)) {
|
|
1605
|
+
return false;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
const existing_items = existing.items;
|
|
1609
|
+
const incoming_items = incoming.items;
|
|
1610
|
+
const equals_items_items = equalsArray(existing_items, incoming_items, (existing_items_item, incoming_items_item) => {
|
|
1611
|
+
if (!(equals$3(existing_items_item, incoming_items_item))) {
|
|
1612
|
+
return false;
|
|
1613
|
+
}
|
|
1614
|
+
});
|
|
1615
|
+
if (equals_items_items === false) {
|
|
1616
|
+
return false;
|
|
1617
|
+
}
|
|
1618
|
+
return true;
|
|
1619
|
+
}
|
|
1620
|
+
const ingest$2 = function LightningKnowledgeArticleVersionCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1621
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1622
|
+
const validateError = validate$3(input);
|
|
1623
|
+
if (validateError !== null) {
|
|
1624
|
+
throw validateError;
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
const key = path.fullPath;
|
|
1628
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
1629
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "NetworkDataCategory", VERSION$2, RepresentationType$2, equals$2);
|
|
1630
|
+
return createLink(key);
|
|
1631
|
+
};
|
|
1632
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1633
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1634
|
+
const rootKey = fullPathFactory();
|
|
1635
|
+
rootKeySet.set(rootKey, {
|
|
1636
|
+
namespace: keyPrefix,
|
|
1637
|
+
representationName: RepresentationType$2,
|
|
1638
|
+
mergeable: false
|
|
1639
|
+
});
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
function select$6(luvio, params) {
|
|
1643
|
+
return select$7();
|
|
1644
|
+
}
|
|
1645
|
+
function keyBuilder$8(luvio, params) {
|
|
1646
|
+
return keyPrefix + '::LightningKnowledgeArticleVersionCollectionRepresentation:(' + 'language:' + params.queryParams.language + ',' + 'pageNumber:' + params.queryParams.pageNumber + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'sortOrder:' + params.queryParams.sortOrder + ',' + 'sortedBy:' + params.queryParams.sortedBy + ',' + 'networkDataCategoryId:' + params.urlParams.networkDataCategoryId + ',' + 'communityId:' + params.urlParams.communityId + ')';
|
|
1647
|
+
}
|
|
1648
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
1649
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$8(luvio, resourceParams));
|
|
1650
|
+
}
|
|
1651
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
1652
|
+
const { body } = response;
|
|
1653
|
+
const key = keyBuilder$8(luvio, resourceParams);
|
|
1654
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1655
|
+
const snapshot = luvio.storeLookup({
|
|
1656
|
+
recordId: key,
|
|
1657
|
+
node: select$6(),
|
|
1658
|
+
variables: {},
|
|
1659
|
+
}, snapshotRefresh);
|
|
1660
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1661
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1662
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
deepFreeze(snapshot.data);
|
|
1666
|
+
return snapshot;
|
|
1667
|
+
}
|
|
1668
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
1669
|
+
const key = keyBuilder$8(luvio, params);
|
|
1670
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1671
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1672
|
+
return errorSnapshot;
|
|
1673
|
+
}
|
|
1674
|
+
function createResourceRequest$4(config) {
|
|
1675
|
+
const headers = {};
|
|
1676
|
+
return {
|
|
1677
|
+
baseUri: '/services/data/v66.0',
|
|
1678
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '/knowledge-article',
|
|
1679
|
+
method: 'get',
|
|
1680
|
+
body: null,
|
|
1681
|
+
urlParams: config.urlParams,
|
|
1682
|
+
queryParams: config.queryParams,
|
|
1683
|
+
headers,
|
|
1684
|
+
priority: 'normal',
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
const adapterName$4 = 'getArticlesForCategory';
|
|
1689
|
+
const getArticlesForCategory_ConfigPropertyMetadata = [
|
|
1690
|
+
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1691
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1692
|
+
generateParamConfigMetadata('language', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1693
|
+
generateParamConfigMetadata('pageNumber', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1694
|
+
generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1695
|
+
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1696
|
+
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1697
|
+
];
|
|
1698
|
+
const getArticlesForCategory_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getArticlesForCategory_ConfigPropertyMetadata);
|
|
1699
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$8(getArticlesForCategory_ConfigPropertyMetadata);
|
|
1700
|
+
function keyBuilder$7(luvio, config) {
|
|
1701
|
+
const resourceParams = createResourceParams$4(config);
|
|
1702
|
+
return keyBuilder$8(luvio, resourceParams);
|
|
1703
|
+
}
|
|
1704
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1705
|
+
const config = {};
|
|
1706
|
+
typeCheckConfig$8(untrustedConfig, config, getArticlesForCategory_ConfigPropertyMetadata);
|
|
1707
|
+
return config;
|
|
1708
|
+
}
|
|
1709
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1710
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1711
|
+
return null;
|
|
1712
|
+
}
|
|
1713
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1714
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1715
|
+
}
|
|
1716
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1717
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1718
|
+
return null;
|
|
1719
|
+
}
|
|
1720
|
+
return config;
|
|
1721
|
+
}
|
|
1722
|
+
function adapterFragment$3(luvio, config) {
|
|
1723
|
+
createResourceParams$4(config);
|
|
1724
|
+
return select$6();
|
|
1725
|
+
}
|
|
1726
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
1727
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
1728
|
+
config,
|
|
1729
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1730
|
+
});
|
|
1731
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1732
|
+
}
|
|
1733
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
1734
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
1735
|
+
config,
|
|
1736
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1737
|
+
});
|
|
1738
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1739
|
+
}
|
|
1740
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
1741
|
+
const resourceParams = createResourceParams$4(config);
|
|
1742
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1743
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1744
|
+
.then((response) => {
|
|
1745
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
1746
|
+
const cache = new StoreKeyMap();
|
|
1747
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
1748
|
+
return cache;
|
|
1749
|
+
});
|
|
1750
|
+
}, (response) => {
|
|
1751
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
1755
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
1756
|
+
}
|
|
1757
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
1758
|
+
const { luvio, config } = context;
|
|
1759
|
+
const selector = {
|
|
1760
|
+
recordId: keyBuilder$7(luvio, config),
|
|
1761
|
+
node: adapterFragment$3(luvio, config),
|
|
1762
|
+
variables: {},
|
|
1763
|
+
};
|
|
1764
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1765
|
+
config,
|
|
1766
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1767
|
+
});
|
|
1768
|
+
return cacheSnapshot;
|
|
1769
|
+
}
|
|
1770
|
+
const getArticlesForCategoryAdapterFactory = (luvio) => function NetworkDataCategory__getArticlesForCategory(untrustedConfig, requestContext) {
|
|
1771
|
+
const config = validateAdapterConfig$4(untrustedConfig, getArticlesForCategory_ConfigPropertyNames);
|
|
1772
|
+
// Invalid or incomplete config
|
|
1773
|
+
if (config === null) {
|
|
1774
|
+
return null;
|
|
1775
|
+
}
|
|
1776
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1777
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
1778
|
+
};
|
|
1779
|
+
|
|
1780
|
+
const VERSION$1 = "55e759666b11e19f41045930d9ac0dd6";
|
|
1781
|
+
function validate$2(obj, path = 'NetworkDataCategoryCollectionRepresentation') {
|
|
1782
|
+
const v_error = (() => {
|
|
1783
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1784
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1785
|
+
}
|
|
1786
|
+
if (obj.baseUrl !== undefined) {
|
|
1787
|
+
const obj_baseUrl = obj.baseUrl;
|
|
1788
|
+
const path_baseUrl = path + '.baseUrl';
|
|
1789
|
+
let obj_baseUrl_union0 = null;
|
|
1790
|
+
const obj_baseUrl_union0_error = (() => {
|
|
1791
|
+
if (typeof obj_baseUrl !== 'string') {
|
|
1792
|
+
return new TypeError('Expected "string" but received "' + typeof obj_baseUrl + '" (at "' + path_baseUrl + '")');
|
|
1793
|
+
}
|
|
1794
|
+
})();
|
|
1795
|
+
if (obj_baseUrl_union0_error != null) {
|
|
1796
|
+
obj_baseUrl_union0 = obj_baseUrl_union0_error.message;
|
|
1797
|
+
}
|
|
1798
|
+
let obj_baseUrl_union1 = null;
|
|
1799
|
+
const obj_baseUrl_union1_error = (() => {
|
|
1800
|
+
if (obj_baseUrl !== null) {
|
|
1801
|
+
return new TypeError('Expected "null" but received "' + typeof obj_baseUrl + '" (at "' + path_baseUrl + '")');
|
|
1802
|
+
}
|
|
1803
|
+
})();
|
|
1804
|
+
if (obj_baseUrl_union1_error != null) {
|
|
1805
|
+
obj_baseUrl_union1 = obj_baseUrl_union1_error.message;
|
|
1806
|
+
}
|
|
1807
|
+
if (obj_baseUrl_union0 && obj_baseUrl_union1) {
|
|
1808
|
+
let message = 'Object doesn\'t match union (at "' + path_baseUrl + '")';
|
|
1809
|
+
message += '\n' + obj_baseUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1810
|
+
message += '\n' + obj_baseUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1811
|
+
return new TypeError(message);
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
const obj_networkDataCategories = obj.networkDataCategories;
|
|
1815
|
+
const path_networkDataCategories = path + '.networkDataCategories';
|
|
1816
|
+
if (!ArrayIsArray(obj_networkDataCategories)) {
|
|
1817
|
+
return new TypeError('Expected "array" but received "' + typeof obj_networkDataCategories + '" (at "' + path_networkDataCategories + '")');
|
|
1818
|
+
}
|
|
1819
|
+
for (let i = 0; i < obj_networkDataCategories.length; i++) {
|
|
1820
|
+
const obj_networkDataCategories_item = obj_networkDataCategories[i];
|
|
1821
|
+
const path_networkDataCategories_item = path_networkDataCategories + '[' + i + ']';
|
|
1822
|
+
if (typeof obj_networkDataCategories_item !== 'object' || Array.isArray(obj_networkDataCategories_item)) {
|
|
1823
|
+
return new TypeError('Expected "object" but received "' + typeof obj_networkDataCategories_item + '" (at "' + path_networkDataCategories_item + '")');
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
})();
|
|
1827
|
+
return v_error === undefined ? null : v_error;
|
|
1828
|
+
}
|
|
1829
|
+
const RepresentationType$1 = 'NetworkDataCategoryCollectionRepresentation';
|
|
1830
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1831
|
+
const input_networkDataCategories = input.networkDataCategories;
|
|
1832
|
+
const input_networkDataCategories_id = path.fullPath + '__networkDataCategories';
|
|
1833
|
+
for (let i = 0; i < input_networkDataCategories.length; i++) {
|
|
1834
|
+
const input_networkDataCategories_item = input_networkDataCategories[i];
|
|
1835
|
+
let input_networkDataCategories_item_id = input_networkDataCategories_id + '__' + i;
|
|
1836
|
+
input_networkDataCategories[i] = ingest$5(input_networkDataCategories_item, {
|
|
1837
|
+
fullPath: input_networkDataCategories_item_id,
|
|
1838
|
+
propertyName: i,
|
|
1839
|
+
parent: {
|
|
1840
|
+
data: input,
|
|
1841
|
+
key: path.fullPath,
|
|
1842
|
+
existing: existing,
|
|
1843
|
+
},
|
|
1844
|
+
ttl: path.ttl
|
|
1845
|
+
}, luvio, store, timestamp);
|
|
1846
|
+
}
|
|
1847
|
+
return input;
|
|
1848
|
+
}
|
|
1849
|
+
const select$5 = function NetworkDataCategoryCollectionRepresentationSelect() {
|
|
1850
|
+
return {
|
|
1851
|
+
kind: 'Fragment',
|
|
1852
|
+
version: VERSION$1,
|
|
1853
|
+
private: [],
|
|
1854
|
+
selections: [
|
|
1855
|
+
{
|
|
1856
|
+
name: 'baseUrl',
|
|
1857
|
+
kind: 'Scalar',
|
|
1858
|
+
required: false
|
|
1859
|
+
},
|
|
1860
|
+
{
|
|
1861
|
+
name: 'networkDataCategories',
|
|
1862
|
+
kind: 'Link',
|
|
1863
|
+
plural: true,
|
|
1864
|
+
fragment: select$d()
|
|
1865
|
+
}
|
|
1866
|
+
]
|
|
1867
|
+
};
|
|
1868
|
+
};
|
|
1869
|
+
function equals$1(existing, incoming) {
|
|
1870
|
+
const existing_baseUrl = existing.baseUrl;
|
|
1871
|
+
const incoming_baseUrl = incoming.baseUrl;
|
|
1872
|
+
// if at least one of these optionals is defined
|
|
1873
|
+
if (existing_baseUrl !== undefined || incoming_baseUrl !== undefined) {
|
|
1874
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1875
|
+
// not equal
|
|
1876
|
+
if (existing_baseUrl === undefined || incoming_baseUrl === undefined) {
|
|
1877
|
+
return false;
|
|
1878
|
+
}
|
|
1879
|
+
if (!(existing_baseUrl === incoming_baseUrl)) {
|
|
1880
|
+
return false;
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
const existing_networkDataCategories = existing.networkDataCategories;
|
|
1884
|
+
const incoming_networkDataCategories = incoming.networkDataCategories;
|
|
1885
|
+
const equals_networkDataCategories_items = equalsArray(existing_networkDataCategories, incoming_networkDataCategories, (existing_networkDataCategories_item, incoming_networkDataCategories_item) => {
|
|
1886
|
+
if (!(existing_networkDataCategories_item.__ref === incoming_networkDataCategories_item.__ref)) {
|
|
1887
|
+
return false;
|
|
1888
|
+
}
|
|
1889
|
+
});
|
|
1890
|
+
if (equals_networkDataCategories_items === false) {
|
|
1891
|
+
return false;
|
|
1892
|
+
}
|
|
1893
|
+
return true;
|
|
1894
|
+
}
|
|
1895
|
+
const ingest$1 = function NetworkDataCategoryCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1896
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1897
|
+
const validateError = validate$2(input);
|
|
1898
|
+
if (validateError !== null) {
|
|
1899
|
+
throw validateError;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
const key = path.fullPath;
|
|
1903
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
1904
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "NetworkDataCategory", VERSION$1, RepresentationType$1, equals$1);
|
|
1905
|
+
return createLink(key);
|
|
1906
|
+
};
|
|
1907
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1908
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1909
|
+
const rootKey = fullPathFactory();
|
|
1910
|
+
rootKeySet.set(rootKey, {
|
|
1911
|
+
namespace: keyPrefix,
|
|
1912
|
+
representationName: RepresentationType$1,
|
|
1913
|
+
mergeable: false
|
|
1914
|
+
});
|
|
1915
|
+
const input_networkDataCategories_length = input.networkDataCategories.length;
|
|
1916
|
+
for (let i = 0; i < input_networkDataCategories_length; i++) {
|
|
1917
|
+
getTypeCacheKeys$5(rootKeySet, luvio, input.networkDataCategories[i]);
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
function select$4(luvio, params) {
|
|
1922
|
+
return select$5();
|
|
1923
|
+
}
|
|
1924
|
+
function keyBuilder$6(luvio, params) {
|
|
1925
|
+
return keyPrefix + '::NetworkDataCategoryCollectionRepresentation:(' + 'language:' + params.queryParams.language + ',' + 'communityId:' + params.urlParams.communityId + ',' + 'networkDataCategoryId:' + params.urlParams.networkDataCategoryId + ')';
|
|
1926
|
+
}
|
|
1927
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1928
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
|
|
1929
|
+
}
|
|
1930
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
1931
|
+
const { body } = response;
|
|
1932
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
1933
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1934
|
+
const snapshot = luvio.storeLookup({
|
|
1935
|
+
recordId: key,
|
|
1936
|
+
node: select$4(),
|
|
1937
|
+
variables: {},
|
|
1938
|
+
}, snapshotRefresh);
|
|
1939
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1940
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1941
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
deepFreeze(snapshot.data);
|
|
1945
|
+
return snapshot;
|
|
1946
|
+
}
|
|
1947
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
1948
|
+
const key = keyBuilder$6(luvio, params);
|
|
1949
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1950
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1951
|
+
return errorSnapshot;
|
|
1952
|
+
}
|
|
1953
|
+
function createResourceRequest$3(config) {
|
|
1954
|
+
const headers = {};
|
|
1955
|
+
return {
|
|
1956
|
+
baseUri: '/services/data/v66.0',
|
|
1957
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '/parent-path',
|
|
1958
|
+
method: 'get',
|
|
1959
|
+
body: null,
|
|
1960
|
+
urlParams: config.urlParams,
|
|
1961
|
+
queryParams: config.queryParams,
|
|
1962
|
+
headers,
|
|
1963
|
+
priority: 'normal',
|
|
1964
|
+
};
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
const adapterName$3 = 'getParentNetworkDataCategoryPath';
|
|
1968
|
+
const getParentNetworkDataCategoryPath_ConfigPropertyMetadata = [
|
|
1969
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1970
|
+
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1971
|
+
generateParamConfigMetadata('language', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1972
|
+
];
|
|
1973
|
+
const getParentNetworkDataCategoryPath_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getParentNetworkDataCategoryPath_ConfigPropertyMetadata);
|
|
1974
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$8(getParentNetworkDataCategoryPath_ConfigPropertyMetadata);
|
|
1975
|
+
function keyBuilder$5(luvio, config) {
|
|
1976
|
+
const resourceParams = createResourceParams$3(config);
|
|
1977
|
+
return keyBuilder$6(luvio, resourceParams);
|
|
1978
|
+
}
|
|
1979
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1980
|
+
const config = {};
|
|
1981
|
+
typeCheckConfig$8(untrustedConfig, config, getParentNetworkDataCategoryPath_ConfigPropertyMetadata);
|
|
1982
|
+
return config;
|
|
1983
|
+
}
|
|
1984
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1985
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1986
|
+
return null;
|
|
1987
|
+
}
|
|
1988
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1989
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1990
|
+
}
|
|
1991
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
1992
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1993
|
+
return null;
|
|
1994
|
+
}
|
|
1995
|
+
return config;
|
|
1996
|
+
}
|
|
1997
|
+
function adapterFragment$2(luvio, config) {
|
|
1998
|
+
createResourceParams$3(config);
|
|
1999
|
+
return select$4();
|
|
2000
|
+
}
|
|
2001
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
2002
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
2003
|
+
config,
|
|
2004
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
2005
|
+
});
|
|
2006
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2007
|
+
}
|
|
2008
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
2009
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
2010
|
+
config,
|
|
2011
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
2012
|
+
});
|
|
2013
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2014
|
+
}
|
|
2015
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
2016
|
+
const resourceParams = createResourceParams$3(config);
|
|
2017
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2018
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2019
|
+
.then((response) => {
|
|
2020
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
2021
|
+
const cache = new StoreKeyMap();
|
|
2022
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
2023
|
+
return cache;
|
|
2024
|
+
});
|
|
2025
|
+
}, (response) => {
|
|
2026
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
2027
|
+
});
|
|
2028
|
+
}
|
|
2029
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2030
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
2031
|
+
}
|
|
2032
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2033
|
+
const { luvio, config } = context;
|
|
2034
|
+
const selector = {
|
|
2035
|
+
recordId: keyBuilder$5(luvio, config),
|
|
2036
|
+
node: adapterFragment$2(luvio, config),
|
|
2037
|
+
variables: {},
|
|
2038
|
+
};
|
|
2039
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2040
|
+
config,
|
|
2041
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
2042
|
+
});
|
|
2043
|
+
return cacheSnapshot;
|
|
2044
|
+
}
|
|
2045
|
+
const getParentNetworkDataCategoryPathAdapterFactory = (luvio) => function NetworkDataCategory__getParentNetworkDataCategoryPath(untrustedConfig, requestContext) {
|
|
2046
|
+
const config = validateAdapterConfig$3(untrustedConfig, getParentNetworkDataCategoryPath_ConfigPropertyNames);
|
|
2047
|
+
// Invalid or incomplete config
|
|
2048
|
+
if (config === null) {
|
|
2049
|
+
return null;
|
|
2050
|
+
}
|
|
2051
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2052
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
2053
|
+
};
|
|
2054
|
+
|
|
2055
|
+
function select$3(luvio, params) {
|
|
2056
|
+
return select$5();
|
|
2057
|
+
}
|
|
2058
|
+
function keyBuilder$4(luvio, params) {
|
|
2059
|
+
return keyPrefix + '::NetworkDataCategoryCollectionRepresentation:(' + 'language:' + params.queryParams.language + ',' + 'pageNumber:' + params.queryParams.pageNumber + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'sortOrder:' + params.queryParams.sortOrder + ',' + 'sortedBy:' + params.queryParams.sortedBy + ',' + 'communityId:' + params.urlParams.communityId + ',' + 'networkDataCategoryId:' + params.urlParams.networkDataCategoryId + ')';
|
|
2060
|
+
}
|
|
2061
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
2062
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
|
|
2063
|
+
}
|
|
2064
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
2065
|
+
const { body } = response;
|
|
2066
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
2067
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2068
|
+
const snapshot = luvio.storeLookup({
|
|
2069
|
+
recordId: key,
|
|
2070
|
+
node: select$3(),
|
|
2071
|
+
variables: {},
|
|
2072
|
+
}, snapshotRefresh);
|
|
2073
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2074
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2075
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
deepFreeze(snapshot.data);
|
|
2079
|
+
return snapshot;
|
|
2080
|
+
}
|
|
2081
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
2082
|
+
const key = keyBuilder$4(luvio, params);
|
|
2083
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2084
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
2085
|
+
return errorSnapshot;
|
|
2086
|
+
}
|
|
2087
|
+
function createResourceRequest$2(config) {
|
|
2088
|
+
const headers = {};
|
|
2089
|
+
return {
|
|
2090
|
+
baseUri: '/services/data/v66.0',
|
|
2091
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '/child-category',
|
|
2092
|
+
method: 'get',
|
|
2093
|
+
body: null,
|
|
2094
|
+
urlParams: config.urlParams,
|
|
2095
|
+
queryParams: config.queryParams,
|
|
2096
|
+
headers,
|
|
2097
|
+
priority: 'normal',
|
|
2098
|
+
};
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
const adapterName$2 = 'getChildCategories';
|
|
2102
|
+
const getChildCategories_ConfigPropertyMetadata = [
|
|
2103
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2104
|
+
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2105
|
+
generateParamConfigMetadata('language', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2106
|
+
generateParamConfigMetadata('pageNumber', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
2107
|
+
generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
2108
|
+
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2109
|
+
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2110
|
+
];
|
|
2111
|
+
const getChildCategories_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getChildCategories_ConfigPropertyMetadata);
|
|
2112
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$8(getChildCategories_ConfigPropertyMetadata);
|
|
2113
|
+
function keyBuilder$3(luvio, config) {
|
|
2114
|
+
const resourceParams = createResourceParams$2(config);
|
|
2115
|
+
return keyBuilder$4(luvio, resourceParams);
|
|
2116
|
+
}
|
|
2117
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
2118
|
+
const config = {};
|
|
2119
|
+
typeCheckConfig$8(untrustedConfig, config, getChildCategories_ConfigPropertyMetadata);
|
|
2120
|
+
return config;
|
|
2121
|
+
}
|
|
2122
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
2123
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2124
|
+
return null;
|
|
2125
|
+
}
|
|
2126
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2127
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2128
|
+
}
|
|
2129
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
2130
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2131
|
+
return null;
|
|
2132
|
+
}
|
|
2133
|
+
return config;
|
|
2134
|
+
}
|
|
2135
|
+
function adapterFragment$1(luvio, config) {
|
|
2136
|
+
createResourceParams$2(config);
|
|
2137
|
+
return select$3();
|
|
2138
|
+
}
|
|
2139
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
2140
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
2141
|
+
config,
|
|
2142
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2143
|
+
});
|
|
2144
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2145
|
+
}
|
|
2146
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
2147
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
2148
|
+
config,
|
|
2149
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2150
|
+
});
|
|
2151
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2152
|
+
}
|
|
2153
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2154
|
+
const resourceParams = createResourceParams$2(config);
|
|
2155
|
+
const request = createResourceRequest$2(resourceParams);
|
|
2156
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2157
|
+
.then((response) => {
|
|
2158
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
2159
|
+
const cache = new StoreKeyMap();
|
|
2160
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
2161
|
+
return cache;
|
|
2162
|
+
});
|
|
2163
|
+
}, (response) => {
|
|
2164
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
2165
|
+
});
|
|
2166
|
+
}
|
|
2167
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2168
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
2169
|
+
}
|
|
2170
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2171
|
+
const { luvio, config } = context;
|
|
2172
|
+
const selector = {
|
|
2173
|
+
recordId: keyBuilder$3(luvio, config),
|
|
2174
|
+
node: adapterFragment$1(luvio, config),
|
|
2175
|
+
variables: {},
|
|
2176
|
+
};
|
|
2177
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2178
|
+
config,
|
|
2179
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2180
|
+
});
|
|
2181
|
+
return cacheSnapshot;
|
|
2182
|
+
}
|
|
2183
|
+
const getChildCategoriesAdapterFactory = (luvio) => function NetworkDataCategory__getChildCategories(untrustedConfig, requestContext) {
|
|
2184
|
+
const config = validateAdapterConfig$2(untrustedConfig, getChildCategories_ConfigPropertyNames);
|
|
2185
|
+
// Invalid or incomplete config
|
|
2186
|
+
if (config === null) {
|
|
2187
|
+
return null;
|
|
2188
|
+
}
|
|
2189
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2190
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
2191
|
+
};
|
|
2192
|
+
|
|
2193
|
+
function select$2(luvio, params) {
|
|
2194
|
+
return select$a();
|
|
2195
|
+
}
|
|
2196
|
+
function keyBuilder$2(luvio, params) {
|
|
2197
|
+
return keyBuilder$b(luvio, {
|
|
2198
|
+
communityId: params.urlParams.communityId
|
|
2199
|
+
});
|
|
2200
|
+
}
|
|
2201
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
2202
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
2203
|
+
}
|
|
2204
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
2205
|
+
const { body } = response;
|
|
2206
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
2207
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
2208
|
+
const snapshot = luvio.storeLookup({
|
|
2209
|
+
recordId: key,
|
|
2210
|
+
node: select$2(),
|
|
2211
|
+
variables: {},
|
|
2212
|
+
}, snapshotRefresh);
|
|
2213
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2214
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2215
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
deepFreeze(snapshot.data);
|
|
2219
|
+
return snapshot;
|
|
2220
|
+
}
|
|
2221
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2222
|
+
const key = keyBuilder$2(luvio, params);
|
|
2223
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2224
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
2225
|
+
return errorSnapshot;
|
|
2226
|
+
}
|
|
2227
|
+
function createResourceRequest$1(config) {
|
|
2228
|
+
const headers = {};
|
|
2229
|
+
return {
|
|
2230
|
+
baseUri: '/services/data/v66.0',
|
|
2231
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/data-category/network-data-category',
|
|
2232
|
+
method: 'get',
|
|
2233
|
+
body: null,
|
|
2234
|
+
urlParams: config.urlParams,
|
|
2235
|
+
queryParams: {},
|
|
2236
|
+
headers,
|
|
2237
|
+
priority: 'normal',
|
|
2238
|
+
};
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
const adapterName$1 = 'getNetworkDataCategories';
|
|
2242
|
+
const getNetworkDataCategories_ConfigPropertyMetadata = [
|
|
2243
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2244
|
+
];
|
|
2245
|
+
const getNetworkDataCategories_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getNetworkDataCategories_ConfigPropertyMetadata);
|
|
2246
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$8(getNetworkDataCategories_ConfigPropertyMetadata);
|
|
2247
|
+
function keyBuilder$1(luvio, config) {
|
|
2248
|
+
const resourceParams = createResourceParams$1(config);
|
|
2249
|
+
return keyBuilder$2(luvio, resourceParams);
|
|
2250
|
+
}
|
|
2251
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
2252
|
+
const config = {};
|
|
2253
|
+
typeCheckConfig$8(untrustedConfig, config, getNetworkDataCategories_ConfigPropertyMetadata);
|
|
2254
|
+
return config;
|
|
2255
|
+
}
|
|
2256
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
2257
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2258
|
+
return null;
|
|
2259
|
+
}
|
|
2260
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2261
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2262
|
+
}
|
|
2263
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
2264
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2265
|
+
return null;
|
|
2266
|
+
}
|
|
2267
|
+
return config;
|
|
2268
|
+
}
|
|
2269
|
+
function adapterFragment(luvio, config) {
|
|
2270
|
+
createResourceParams$1(config);
|
|
2271
|
+
return select$2();
|
|
2272
|
+
}
|
|
2273
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
2274
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
2275
|
+
config,
|
|
2276
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2277
|
+
});
|
|
2278
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2279
|
+
}
|
|
2280
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
2281
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
2282
|
+
config,
|
|
2283
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2284
|
+
});
|
|
2285
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2286
|
+
}
|
|
2287
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
2288
|
+
const resourceParams = createResourceParams$1(config);
|
|
2289
|
+
const request = createResourceRequest$1(resourceParams);
|
|
2290
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2291
|
+
.then((response) => {
|
|
2292
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
2293
|
+
const cache = new StoreKeyMap();
|
|
2294
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
2295
|
+
return cache;
|
|
2296
|
+
});
|
|
2297
|
+
}, (response) => {
|
|
2298
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
2299
|
+
});
|
|
2300
|
+
}
|
|
2301
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2302
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
2303
|
+
}
|
|
2304
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2305
|
+
const { luvio, config } = context;
|
|
2306
|
+
const selector = {
|
|
2307
|
+
recordId: keyBuilder$1(luvio, config),
|
|
2308
|
+
node: adapterFragment(luvio, config),
|
|
2309
|
+
variables: {},
|
|
2310
|
+
};
|
|
2311
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2312
|
+
config,
|
|
2313
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2314
|
+
});
|
|
2315
|
+
return cacheSnapshot;
|
|
2316
|
+
}
|
|
2317
|
+
const getNetworkDataCategoriesAdapterFactory = (luvio) => function NetworkDataCategory__getNetworkDataCategories(untrustedConfig, requestContext) {
|
|
2318
|
+
const config = validateAdapterConfig$1(untrustedConfig, getNetworkDataCategories_ConfigPropertyNames);
|
|
2319
|
+
// Invalid or incomplete config
|
|
2320
|
+
if (config === null) {
|
|
2321
|
+
return null;
|
|
2322
|
+
}
|
|
2323
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2324
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
2325
|
+
};
|
|
2326
|
+
|
|
2327
|
+
function validate$1(obj, path = 'DataCategoryGroupCollectionInputRepresentation') {
|
|
2328
|
+
const v_error = (() => {
|
|
2329
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2330
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2331
|
+
}
|
|
2332
|
+
const obj_dataCategoryGroups = obj.dataCategoryGroups;
|
|
2333
|
+
const path_dataCategoryGroups = path + '.dataCategoryGroups';
|
|
2334
|
+
if (!ArrayIsArray(obj_dataCategoryGroups)) {
|
|
2335
|
+
return new TypeError('Expected "array" but received "' + typeof obj_dataCategoryGroups + '" (at "' + path_dataCategoryGroups + '")');
|
|
2336
|
+
}
|
|
2337
|
+
for (let i = 0; i < obj_dataCategoryGroups.length; i++) {
|
|
2338
|
+
const obj_dataCategoryGroups_item = obj_dataCategoryGroups[i];
|
|
2339
|
+
const path_dataCategoryGroups_item = path_dataCategoryGroups + '[' + i + ']';
|
|
2340
|
+
if (obj_dataCategoryGroups_item === undefined) {
|
|
2341
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_dataCategoryGroups_item + '" (at "' + path_dataCategoryGroups_item + '")');
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
})();
|
|
2345
|
+
return v_error === undefined ? null : v_error;
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
function validate(obj, path = 'EmptyRepresentation') {
|
|
2349
|
+
const v_error = (() => {
|
|
2350
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2351
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2352
|
+
}
|
|
2353
|
+
})();
|
|
2354
|
+
return v_error === undefined ? null : v_error;
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
const VERSION = "0e01db1cd118e675190e5f67ac3610d8";
|
|
2358
|
+
const RepresentationType = 'EmptyRepresentation';
|
|
2359
|
+
function keyBuilder(luvio, config) {
|
|
2360
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.fakeKey;
|
|
2361
|
+
}
|
|
2362
|
+
function keyBuilderFromType(luvio, object) {
|
|
2363
|
+
const keyParams = {
|
|
2364
|
+
fakeKey: object.fakeKey
|
|
2365
|
+
};
|
|
2366
|
+
return keyBuilder(luvio, keyParams);
|
|
2367
|
+
}
|
|
2368
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
2369
|
+
return input;
|
|
2370
|
+
}
|
|
2371
|
+
function equals(existing, incoming) {
|
|
2372
|
+
const existing_fakeKey = existing.fakeKey;
|
|
2373
|
+
const incoming_fakeKey = incoming.fakeKey;
|
|
2374
|
+
if (!(existing_fakeKey === incoming_fakeKey)) {
|
|
2375
|
+
return false;
|
|
2376
|
+
}
|
|
2377
|
+
return true;
|
|
2378
|
+
}
|
|
2379
|
+
const ingest = function EmptyRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2380
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2381
|
+
const validateError = validate(input);
|
|
2382
|
+
if (validateError !== null) {
|
|
2383
|
+
throw validateError;
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
const key = keyBuilderFromType(luvio, input);
|
|
2387
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
2388
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "NetworkDataCategory", VERSION, RepresentationType, equals);
|
|
2389
|
+
return createLink(key);
|
|
2390
|
+
};
|
|
2391
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
2392
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2393
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
2394
|
+
rootKeySet.set(rootKey, {
|
|
2395
|
+
namespace: keyPrefix,
|
|
2396
|
+
representationName: RepresentationType,
|
|
2397
|
+
mergeable: false
|
|
2398
|
+
});
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
const select$1 = function EmptyRepresentationSelect() {
|
|
2402
|
+
return {
|
|
2403
|
+
kind: 'Fragment',
|
|
2404
|
+
version: VERSION,
|
|
2405
|
+
private: [],
|
|
2406
|
+
selections: [],
|
|
2407
|
+
};
|
|
2408
|
+
};
|
|
2409
|
+
|
|
2410
|
+
function select(luvio, params) {
|
|
2411
|
+
return select$1();
|
|
2412
|
+
}
|
|
2413
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
2414
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
2415
|
+
}
|
|
2416
|
+
function createResourceRequest(config) {
|
|
2417
|
+
const headers = {};
|
|
2418
|
+
return {
|
|
2419
|
+
baseUri: '/services/data/v66.0',
|
|
2420
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/data-category/network-data-category',
|
|
2421
|
+
method: 'put',
|
|
2422
|
+
body: config.body,
|
|
2423
|
+
urlParams: config.urlParams,
|
|
2424
|
+
queryParams: {},
|
|
2425
|
+
headers,
|
|
2426
|
+
priority: 'normal',
|
|
2427
|
+
};
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
function ingestSuccess(luvio, resourceParams, _response) {
|
|
2431
|
+
const body = {};
|
|
2432
|
+
const key = keyBuilderFromType(luvio, body);
|
|
2433
|
+
luvio.storeIngest(key, ingest, body);
|
|
2434
|
+
const snapshot = luvio.storeLookup({
|
|
2435
|
+
recordId: key,
|
|
2436
|
+
node: select(),
|
|
2437
|
+
variables: {},
|
|
2438
|
+
});
|
|
2439
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2440
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2441
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
deepFreeze(snapshot.data);
|
|
2445
|
+
return snapshot;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
function buildNetworkSnapshot$1(luvio, config) {
|
|
2449
|
+
return buildNetworkSnapshot(luvio, config).then((result) => {
|
|
2450
|
+
notifyUpdateAvailableFactory(luvio)([{ communityId: config.communityId }]);
|
|
2451
|
+
return result;
|
|
2452
|
+
});
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
const adapterName = 'updateNetworkDataCategories';
|
|
2456
|
+
const updateNetworkDataCategories_ConfigPropertyMetadata = [
|
|
2457
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2458
|
+
generateParamConfigMetadata('networkDataCategoryTree', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2459
|
+
];
|
|
2460
|
+
const updateNetworkDataCategories_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateNetworkDataCategories_ConfigPropertyMetadata);
|
|
2461
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$8(updateNetworkDataCategories_ConfigPropertyMetadata);
|
|
2462
|
+
function typeCheckConfig(untrustedConfig) {
|
|
2463
|
+
const config = {};
|
|
2464
|
+
typeCheckConfig$8(untrustedConfig, config, updateNetworkDataCategories_ConfigPropertyMetadata);
|
|
2465
|
+
const untrustedConfig_networkDataCategoryTree = untrustedConfig.networkDataCategoryTree;
|
|
2466
|
+
const referenceDataCategoryGroupCollectionInputRepresentationValidationError = validate$1(untrustedConfig_networkDataCategoryTree);
|
|
2467
|
+
if (referenceDataCategoryGroupCollectionInputRepresentationValidationError === null) {
|
|
2468
|
+
config.networkDataCategoryTree = untrustedConfig_networkDataCategoryTree;
|
|
2469
|
+
}
|
|
2470
|
+
return config;
|
|
2471
|
+
}
|
|
2472
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
2473
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2474
|
+
return null;
|
|
2475
|
+
}
|
|
2476
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2477
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2478
|
+
}
|
|
2479
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
2480
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2481
|
+
return null;
|
|
2482
|
+
}
|
|
2483
|
+
return config;
|
|
2484
|
+
}
|
|
2485
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
2486
|
+
const resourceParams = createResourceParams(config);
|
|
2487
|
+
const request = createResourceRequest(resourceParams);
|
|
2488
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2489
|
+
.then((response) => {
|
|
2490
|
+
return luvio.handleSuccessResponse(() => {
|
|
2491
|
+
const snapshot = ingestSuccess(luvio);
|
|
2492
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2493
|
+
}, () => {
|
|
2494
|
+
const cache = new StoreKeyMap();
|
|
2495
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
2496
|
+
return cache;
|
|
2497
|
+
});
|
|
2498
|
+
}, (response) => {
|
|
2499
|
+
deepFreeze(response);
|
|
2500
|
+
throw response;
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
const updateNetworkDataCategoriesAdapterFactory = (luvio) => {
|
|
2504
|
+
return function updateNetworkDataCategories(untrustedConfig) {
|
|
2505
|
+
const config = validateAdapterConfig(untrustedConfig, updateNetworkDataCategories_ConfigPropertyNames);
|
|
2506
|
+
// Invalid or incomplete config
|
|
2507
|
+
if (config === null) {
|
|
2508
|
+
throw new Error('Invalid config for "updateNetworkDataCategories"');
|
|
2509
|
+
}
|
|
2510
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
2511
|
+
};
|
|
2512
|
+
};
|
|
2513
|
+
|
|
2514
|
+
export { getArticlesForCategoryAdapterFactory, getChildCategoriesAdapterFactory, getNetworkDataCategoriesAdapterFactory, getParentNetworkDataCategoryPathAdapterFactory, getServiceCatalogItemsAdapterFactory, getServiceCatalogItemsForCommunityAdapterFactory, notifyUpdateAvailableFactory as notifyNetworkDataCategoryTreeRepresentationUpdateAvailableFactory, updateNetworkDataCategoriesAdapterFactory, updateNetworkDataCategoryAdapterFactory };
|