@salesforce/lds-adapters-service-network-data-category 1.247.0 → 1.249.0
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/dist/es/es2018/service-network-data-category.js +633 -190
- package/dist/es/es2018/types/src/generated/adapters/getChildCategories.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/adapters/getParentNetworkDataCategoryPath.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +5 -1
- package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesNetworkDataCategoryChildCategoryByCommunityIdAndNetworkDataCategoryId.d.ts +23 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesNetworkDataCategoryParentPathByCommunityIdAndNetworkDataCategoryId.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/types/NetworkDataCategoryCollectionRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/NetworkDataCategoryRepresentation.d.ts +7 -1
- package/package.json +4 -5
- package/sfdc/index.js +595 -136
- package/src/raml/api.raml +72 -1
- package/src/raml/luvio.raml +8 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$6, typeCheckConfig as typeCheckConfig$7, StoreKeyMap, createResourceParams as createResourceParams$7 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -93,8 +93,8 @@ function createLink(ref) {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
const VERSION$
|
|
97
|
-
function validate$
|
|
96
|
+
const VERSION$8 = "e09f2c8e969b05cce02145ff503c5764";
|
|
97
|
+
function validate$9(obj, path = 'ServiceCatalogItemRepresentation') {
|
|
98
98
|
const v_error = (() => {
|
|
99
99
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
100
100
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -173,10 +173,10 @@ function validate$8(obj, path = 'ServiceCatalogItemRepresentation') {
|
|
|
173
173
|
})();
|
|
174
174
|
return v_error === undefined ? null : v_error;
|
|
175
175
|
}
|
|
176
|
-
const select$
|
|
176
|
+
const select$f = function ServiceCatalogItemRepresentationSelect() {
|
|
177
177
|
return {
|
|
178
178
|
kind: 'Fragment',
|
|
179
|
-
version: VERSION$
|
|
179
|
+
version: VERSION$8,
|
|
180
180
|
private: [],
|
|
181
181
|
selections: [
|
|
182
182
|
{
|
|
@@ -204,7 +204,7 @@ const select$c = function ServiceCatalogItemRepresentationSelect() {
|
|
|
204
204
|
]
|
|
205
205
|
};
|
|
206
206
|
};
|
|
207
|
-
function equals$
|
|
207
|
+
function equals$8(existing, incoming) {
|
|
208
208
|
const existing_developerName = existing.developerName;
|
|
209
209
|
const incoming_developerName = incoming.developerName;
|
|
210
210
|
if (!(existing_developerName === incoming_developerName)) {
|
|
@@ -249,8 +249,8 @@ function equals$7(existing, incoming) {
|
|
|
249
249
|
return true;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
const VERSION$
|
|
253
|
-
function validate$
|
|
252
|
+
const VERSION$7 = "b91519c31db3334a2902f3847c66f5df";
|
|
253
|
+
function validate$8(obj, path = 'ServiceCatalogItemCollectionRepresentation') {
|
|
254
254
|
const v_error = (() => {
|
|
255
255
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
256
256
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -263,7 +263,7 @@ function validate$7(obj, path = 'ServiceCatalogItemCollectionRepresentation') {
|
|
|
263
263
|
for (let i = 0; i < obj_items.length; i++) {
|
|
264
264
|
const obj_items_item = obj_items[i];
|
|
265
265
|
const path_items_item = path_items + '[' + i + ']';
|
|
266
|
-
const referencepath_items_itemValidationError = validate$
|
|
266
|
+
const referencepath_items_itemValidationError = validate$9(obj_items_item, path_items_item);
|
|
267
267
|
if (referencepath_items_itemValidationError !== null) {
|
|
268
268
|
let message = 'Object doesn\'t match ServiceCatalogItemRepresentation (at "' + path_items_item + '")\n';
|
|
269
269
|
message += referencepath_items_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -273,15 +273,15 @@ function validate$7(obj, path = 'ServiceCatalogItemCollectionRepresentation') {
|
|
|
273
273
|
})();
|
|
274
274
|
return v_error === undefined ? null : v_error;
|
|
275
275
|
}
|
|
276
|
-
const RepresentationType$
|
|
277
|
-
function normalize$
|
|
276
|
+
const RepresentationType$4 = 'ServiceCatalogItemCollectionRepresentation';
|
|
277
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
278
278
|
return input;
|
|
279
279
|
}
|
|
280
|
-
const select$
|
|
281
|
-
const { selections: ServiceCatalogItemRepresentation__selections, opaque: ServiceCatalogItemRepresentation__opaque, } = select$
|
|
280
|
+
const select$e = function ServiceCatalogItemCollectionRepresentationSelect() {
|
|
281
|
+
const { selections: ServiceCatalogItemRepresentation__selections, opaque: ServiceCatalogItemRepresentation__opaque, } = select$f();
|
|
282
282
|
return {
|
|
283
283
|
kind: 'Fragment',
|
|
284
|
-
version: VERSION$
|
|
284
|
+
version: VERSION$7,
|
|
285
285
|
private: [],
|
|
286
286
|
selections: [
|
|
287
287
|
{
|
|
@@ -293,11 +293,11 @@ const select$b = function ServiceCatalogItemCollectionRepresentationSelect() {
|
|
|
293
293
|
]
|
|
294
294
|
};
|
|
295
295
|
};
|
|
296
|
-
function equals$
|
|
296
|
+
function equals$7(existing, incoming) {
|
|
297
297
|
const existing_items = existing.items;
|
|
298
298
|
const incoming_items = incoming.items;
|
|
299
299
|
const equals_items_items = equalsArray(existing_items, incoming_items, (existing_items_item, incoming_items_item) => {
|
|
300
|
-
if (!(equals$
|
|
300
|
+
if (!(equals$8(existing_items_item, incoming_items_item))) {
|
|
301
301
|
return false;
|
|
302
302
|
}
|
|
303
303
|
});
|
|
@@ -306,44 +306,44 @@ function equals$6(existing, incoming) {
|
|
|
306
306
|
}
|
|
307
307
|
return true;
|
|
308
308
|
}
|
|
309
|
-
const ingest$
|
|
309
|
+
const ingest$4 = function ServiceCatalogItemCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
310
310
|
if (process.env.NODE_ENV !== 'production') {
|
|
311
|
-
const validateError = validate$
|
|
311
|
+
const validateError = validate$8(input);
|
|
312
312
|
if (validateError !== null) {
|
|
313
313
|
throw validateError;
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
const key = path.fullPath;
|
|
317
317
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
318
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
318
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "NetworkDataCategory", VERSION$7, RepresentationType$4, equals$7);
|
|
319
319
|
return createLink(key);
|
|
320
320
|
};
|
|
321
|
-
function getTypeCacheKeys$
|
|
321
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
322
322
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
323
323
|
const rootKey = fullPathFactory();
|
|
324
324
|
rootKeySet.set(rootKey, {
|
|
325
325
|
namespace: keyPrefix,
|
|
326
|
-
representationName: RepresentationType$
|
|
326
|
+
representationName: RepresentationType$4,
|
|
327
327
|
mergeable: false
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
function select$
|
|
332
|
-
return select$
|
|
331
|
+
function select$d(luvio, params) {
|
|
332
|
+
return select$e();
|
|
333
333
|
}
|
|
334
|
-
function keyBuilder$
|
|
334
|
+
function keyBuilder$d(luvio, params) {
|
|
335
335
|
return keyPrefix + '::ServiceCatalogItemCollectionRepresentation:(' + 'pageSize:' + params.queryParams.pageSize + ',' + 'pageNumber:' + params.queryParams.pageNumber + ',' + 'sortOrder:' + params.queryParams.sortOrder + ',' + 'sortedBy:' + params.queryParams.sortedBy + ',' + 'networkDataCategoryId:' + params.urlParams.networkDataCategoryId + ')';
|
|
336
336
|
}
|
|
337
|
-
function getResponseCacheKeys$
|
|
338
|
-
getTypeCacheKeys$
|
|
337
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
338
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$d(luvio, resourceParams));
|
|
339
339
|
}
|
|
340
|
-
function ingestSuccess$
|
|
340
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
341
341
|
const { body } = response;
|
|
342
|
-
const key = keyBuilder$
|
|
343
|
-
luvio.storeIngest(key, ingest$
|
|
342
|
+
const key = keyBuilder$d(luvio, resourceParams);
|
|
343
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
344
344
|
const snapshot = luvio.storeLookup({
|
|
345
345
|
recordId: key,
|
|
346
|
-
node: select$
|
|
346
|
+
node: select$d(),
|
|
347
347
|
variables: {},
|
|
348
348
|
}, snapshotRefresh);
|
|
349
349
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -354,13 +354,13 @@ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
354
354
|
deepFreeze(snapshot.data);
|
|
355
355
|
return snapshot;
|
|
356
356
|
}
|
|
357
|
-
function ingestError$
|
|
358
|
-
const key = keyBuilder$
|
|
357
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
358
|
+
const key = keyBuilder$d(luvio, params);
|
|
359
359
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
360
360
|
luvio.storeIngestError(key, errorSnapshot);
|
|
361
361
|
return errorSnapshot;
|
|
362
362
|
}
|
|
363
|
-
function createResourceRequest$
|
|
363
|
+
function createResourceRequest$6(config) {
|
|
364
364
|
const headers = {};
|
|
365
365
|
return {
|
|
366
366
|
baseUri: '/services/data/v60.0',
|
|
@@ -374,7 +374,7 @@ function createResourceRequest$4(config) {
|
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
-
const adapterName$
|
|
377
|
+
const adapterName$6 = 'getServiceCatalogItems';
|
|
378
378
|
const getServiceCatalogItems_ConfigPropertyMetadata = [
|
|
379
379
|
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
380
380
|
generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
@@ -382,104 +382,104 @@ const getServiceCatalogItems_ConfigPropertyMetadata = [
|
|
|
382
382
|
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
383
383
|
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
384
384
|
];
|
|
385
|
-
const getServiceCatalogItems_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
386
|
-
const createResourceParams$
|
|
387
|
-
function keyBuilder$
|
|
388
|
-
const resourceParams = createResourceParams$
|
|
389
|
-
return keyBuilder$
|
|
385
|
+
const getServiceCatalogItems_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getServiceCatalogItems_ConfigPropertyMetadata);
|
|
386
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(getServiceCatalogItems_ConfigPropertyMetadata);
|
|
387
|
+
function keyBuilder$c(luvio, config) {
|
|
388
|
+
const resourceParams = createResourceParams$6(config);
|
|
389
|
+
return keyBuilder$d(luvio, resourceParams);
|
|
390
390
|
}
|
|
391
|
-
function typeCheckConfig$
|
|
391
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
392
392
|
const config = {};
|
|
393
|
-
typeCheckConfig$
|
|
393
|
+
typeCheckConfig$7(untrustedConfig, config, getServiceCatalogItems_ConfigPropertyMetadata);
|
|
394
394
|
return config;
|
|
395
395
|
}
|
|
396
|
-
function validateAdapterConfig$
|
|
396
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
397
397
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
398
398
|
return null;
|
|
399
399
|
}
|
|
400
400
|
if (process.env.NODE_ENV !== 'production') {
|
|
401
401
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
402
402
|
}
|
|
403
|
-
const config = typeCheckConfig$
|
|
403
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
404
404
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
405
405
|
return null;
|
|
406
406
|
}
|
|
407
407
|
return config;
|
|
408
408
|
}
|
|
409
|
-
function adapterFragment$
|
|
410
|
-
createResourceParams$
|
|
411
|
-
return select$
|
|
409
|
+
function adapterFragment$5(luvio, config) {
|
|
410
|
+
createResourceParams$6(config);
|
|
411
|
+
return select$d();
|
|
412
412
|
}
|
|
413
|
-
function onFetchResponseSuccess$
|
|
414
|
-
const snapshot = ingestSuccess$
|
|
413
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
414
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
415
415
|
config,
|
|
416
|
-
resolve: () => buildNetworkSnapshot$
|
|
416
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
417
417
|
});
|
|
418
418
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
419
419
|
}
|
|
420
|
-
function onFetchResponseError$
|
|
421
|
-
const snapshot = ingestError$
|
|
420
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
421
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
422
422
|
config,
|
|
423
|
-
resolve: () => buildNetworkSnapshot$
|
|
423
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
424
424
|
});
|
|
425
425
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
426
426
|
}
|
|
427
|
-
function buildNetworkSnapshot$
|
|
428
|
-
const resourceParams = createResourceParams$
|
|
429
|
-
const request = createResourceRequest$
|
|
427
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
428
|
+
const resourceParams = createResourceParams$6(config);
|
|
429
|
+
const request = createResourceRequest$6(resourceParams);
|
|
430
430
|
return luvio.dispatchResourceRequest(request, options)
|
|
431
431
|
.then((response) => {
|
|
432
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
432
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
433
433
|
const cache = new StoreKeyMap();
|
|
434
|
-
getResponseCacheKeys$
|
|
434
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
435
435
|
return cache;
|
|
436
436
|
});
|
|
437
437
|
}, (response) => {
|
|
438
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
438
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
|
-
function buildNetworkSnapshotCachePolicy$
|
|
442
|
-
return buildNetworkSnapshotCachePolicy$
|
|
441
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
442
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$7, undefined, false);
|
|
443
443
|
}
|
|
444
|
-
function buildCachedSnapshotCachePolicy$
|
|
444
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
445
445
|
const { luvio, config } = context;
|
|
446
446
|
const selector = {
|
|
447
|
-
recordId: keyBuilder$
|
|
448
|
-
node: adapterFragment$
|
|
447
|
+
recordId: keyBuilder$c(luvio, config),
|
|
448
|
+
node: adapterFragment$5(luvio, config),
|
|
449
449
|
variables: {},
|
|
450
450
|
};
|
|
451
451
|
const cacheSnapshot = storeLookup(selector, {
|
|
452
452
|
config,
|
|
453
|
-
resolve: () => buildNetworkSnapshot$
|
|
453
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
454
454
|
});
|
|
455
455
|
return cacheSnapshot;
|
|
456
456
|
}
|
|
457
457
|
const getServiceCatalogItemsAdapterFactory = (luvio) => function NetworkDataCategory__getServiceCatalogItems(untrustedConfig, requestContext) {
|
|
458
|
-
const config = validateAdapterConfig$
|
|
458
|
+
const config = validateAdapterConfig$6(untrustedConfig, getServiceCatalogItems_ConfigPropertyNames);
|
|
459
459
|
// Invalid or incomplete config
|
|
460
460
|
if (config === null) {
|
|
461
461
|
return null;
|
|
462
462
|
}
|
|
463
463
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
464
|
-
buildCachedSnapshotCachePolicy$
|
|
464
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
465
465
|
};
|
|
466
466
|
|
|
467
|
-
function select$
|
|
468
|
-
return select$
|
|
467
|
+
function select$c(luvio, params) {
|
|
468
|
+
return select$e();
|
|
469
469
|
}
|
|
470
|
-
function keyBuilder$
|
|
470
|
+
function keyBuilder$b(luvio, params) {
|
|
471
471
|
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 + ')';
|
|
472
472
|
}
|
|
473
|
-
function getResponseCacheKeys$
|
|
474
|
-
getTypeCacheKeys$
|
|
473
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
474
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$b(luvio, resourceParams));
|
|
475
475
|
}
|
|
476
|
-
function ingestSuccess$
|
|
476
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
477
477
|
const { body } = response;
|
|
478
|
-
const key = keyBuilder$
|
|
479
|
-
luvio.storeIngest(key, ingest$
|
|
478
|
+
const key = keyBuilder$b(luvio, resourceParams);
|
|
479
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
480
480
|
const snapshot = luvio.storeLookup({
|
|
481
481
|
recordId: key,
|
|
482
|
-
node: select$
|
|
482
|
+
node: select$c(),
|
|
483
483
|
variables: {},
|
|
484
484
|
}, snapshotRefresh);
|
|
485
485
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -490,13 +490,13 @@ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
490
490
|
deepFreeze(snapshot.data);
|
|
491
491
|
return snapshot;
|
|
492
492
|
}
|
|
493
|
-
function ingestError$
|
|
494
|
-
const key = keyBuilder$
|
|
493
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
494
|
+
const key = keyBuilder$b(luvio, params);
|
|
495
495
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
496
496
|
luvio.storeIngestError(key, errorSnapshot);
|
|
497
497
|
return errorSnapshot;
|
|
498
498
|
}
|
|
499
|
-
function createResourceRequest$
|
|
499
|
+
function createResourceRequest$5(config) {
|
|
500
500
|
const headers = {};
|
|
501
501
|
return {
|
|
502
502
|
baseUri: '/services/data/v60.0',
|
|
@@ -510,7 +510,7 @@ function createResourceRequest$3(config) {
|
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
-
const adapterName$
|
|
513
|
+
const adapterName$5 = 'getServiceCatalogItemsForCommunity';
|
|
514
514
|
const getServiceCatalogItemsForCommunity_ConfigPropertyMetadata = [
|
|
515
515
|
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
516
516
|
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
@@ -519,90 +519,90 @@ const getServiceCatalogItemsForCommunity_ConfigPropertyMetadata = [
|
|
|
519
519
|
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
520
520
|
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
521
521
|
];
|
|
522
|
-
const getServiceCatalogItemsForCommunity_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
523
|
-
const createResourceParams$
|
|
524
|
-
function keyBuilder$
|
|
525
|
-
const resourceParams = createResourceParams$
|
|
526
|
-
return keyBuilder$
|
|
522
|
+
const getServiceCatalogItemsForCommunity_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getServiceCatalogItemsForCommunity_ConfigPropertyMetadata);
|
|
523
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(getServiceCatalogItemsForCommunity_ConfigPropertyMetadata);
|
|
524
|
+
function keyBuilder$a(luvio, config) {
|
|
525
|
+
const resourceParams = createResourceParams$5(config);
|
|
526
|
+
return keyBuilder$b(luvio, resourceParams);
|
|
527
527
|
}
|
|
528
|
-
function typeCheckConfig$
|
|
528
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
529
529
|
const config = {};
|
|
530
|
-
typeCheckConfig$
|
|
530
|
+
typeCheckConfig$7(untrustedConfig, config, getServiceCatalogItemsForCommunity_ConfigPropertyMetadata);
|
|
531
531
|
return config;
|
|
532
532
|
}
|
|
533
|
-
function validateAdapterConfig$
|
|
533
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
534
534
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
535
535
|
return null;
|
|
536
536
|
}
|
|
537
537
|
if (process.env.NODE_ENV !== 'production') {
|
|
538
538
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
539
539
|
}
|
|
540
|
-
const config = typeCheckConfig$
|
|
540
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
541
541
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
542
542
|
return null;
|
|
543
543
|
}
|
|
544
544
|
return config;
|
|
545
545
|
}
|
|
546
|
-
function adapterFragment$
|
|
547
|
-
createResourceParams$
|
|
548
|
-
return select$
|
|
546
|
+
function adapterFragment$4(luvio, config) {
|
|
547
|
+
createResourceParams$5(config);
|
|
548
|
+
return select$c();
|
|
549
549
|
}
|
|
550
|
-
function onFetchResponseSuccess$
|
|
551
|
-
const snapshot = ingestSuccess$
|
|
550
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
551
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
552
552
|
config,
|
|
553
|
-
resolve: () => buildNetworkSnapshot$
|
|
553
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
554
554
|
});
|
|
555
555
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
556
556
|
}
|
|
557
|
-
function onFetchResponseError$
|
|
558
|
-
const snapshot = ingestError$
|
|
557
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
558
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
559
559
|
config,
|
|
560
|
-
resolve: () => buildNetworkSnapshot$
|
|
560
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
561
561
|
});
|
|
562
562
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
563
563
|
}
|
|
564
|
-
function buildNetworkSnapshot$
|
|
565
|
-
const resourceParams = createResourceParams$
|
|
566
|
-
const request = createResourceRequest$
|
|
564
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
565
|
+
const resourceParams = createResourceParams$5(config);
|
|
566
|
+
const request = createResourceRequest$5(resourceParams);
|
|
567
567
|
return luvio.dispatchResourceRequest(request, options)
|
|
568
568
|
.then((response) => {
|
|
569
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
569
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
570
570
|
const cache = new StoreKeyMap();
|
|
571
|
-
getResponseCacheKeys$
|
|
571
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
572
572
|
return cache;
|
|
573
573
|
});
|
|
574
574
|
}, (response) => {
|
|
575
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
575
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
576
576
|
});
|
|
577
577
|
}
|
|
578
|
-
function buildNetworkSnapshotCachePolicy$
|
|
579
|
-
return buildNetworkSnapshotCachePolicy$
|
|
578
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
579
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
580
580
|
}
|
|
581
|
-
function buildCachedSnapshotCachePolicy$
|
|
581
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
582
582
|
const { luvio, config } = context;
|
|
583
583
|
const selector = {
|
|
584
|
-
recordId: keyBuilder$
|
|
585
|
-
node: adapterFragment$
|
|
584
|
+
recordId: keyBuilder$a(luvio, config),
|
|
585
|
+
node: adapterFragment$4(luvio, config),
|
|
586
586
|
variables: {},
|
|
587
587
|
};
|
|
588
588
|
const cacheSnapshot = storeLookup(selector, {
|
|
589
589
|
config,
|
|
590
|
-
resolve: () => buildNetworkSnapshot$
|
|
590
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
591
591
|
});
|
|
592
592
|
return cacheSnapshot;
|
|
593
593
|
}
|
|
594
594
|
const getServiceCatalogItemsForCommunityAdapterFactory = (luvio) => function NetworkDataCategory__getServiceCatalogItemsForCommunity(untrustedConfig, requestContext) {
|
|
595
|
-
const config = validateAdapterConfig$
|
|
595
|
+
const config = validateAdapterConfig$5(untrustedConfig, getServiceCatalogItemsForCommunity_ConfigPropertyNames);
|
|
596
596
|
// Invalid or incomplete config
|
|
597
597
|
if (config === null) {
|
|
598
598
|
return null;
|
|
599
599
|
}
|
|
600
600
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
601
|
-
buildCachedSnapshotCachePolicy$
|
|
601
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
602
602
|
};
|
|
603
603
|
|
|
604
|
-
const VERSION$
|
|
605
|
-
function validate$
|
|
604
|
+
const VERSION$6 = "f3960577caf41d925ed00b2cc2e508e8";
|
|
605
|
+
function validate$7(obj, path = 'LightningKnowledgeArticleVersionRepresentation') {
|
|
606
606
|
const v_error = (() => {
|
|
607
607
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
608
608
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -640,10 +640,10 @@ function validate$6(obj, path = 'LightningKnowledgeArticleVersionRepresentation'
|
|
|
640
640
|
})();
|
|
641
641
|
return v_error === undefined ? null : v_error;
|
|
642
642
|
}
|
|
643
|
-
const select$
|
|
643
|
+
const select$b = function LightningKnowledgeArticleVersionRepresentationSelect() {
|
|
644
644
|
return {
|
|
645
645
|
kind: 'Fragment',
|
|
646
|
-
version: VERSION$
|
|
646
|
+
version: VERSION$6,
|
|
647
647
|
private: [],
|
|
648
648
|
selections: [
|
|
649
649
|
{
|
|
@@ -673,7 +673,7 @@ const select$8 = function LightningKnowledgeArticleVersionRepresentationSelect()
|
|
|
673
673
|
]
|
|
674
674
|
};
|
|
675
675
|
};
|
|
676
|
-
function equals$
|
|
676
|
+
function equals$6(existing, incoming) {
|
|
677
677
|
const existing_id = existing.id;
|
|
678
678
|
const incoming_id = incoming.id;
|
|
679
679
|
if (!(existing_id === incoming_id)) {
|
|
@@ -707,8 +707,8 @@ function equals$5(existing, incoming) {
|
|
|
707
707
|
return true;
|
|
708
708
|
}
|
|
709
709
|
|
|
710
|
-
const VERSION$
|
|
711
|
-
function validate$
|
|
710
|
+
const VERSION$5 = "89a6fdc1ed7c0b0e7bd5980d6fdecf09";
|
|
711
|
+
function validate$6(obj, path = 'LightningKnowledgeArticleVersionCollectionRepresentation') {
|
|
712
712
|
const v_error = (() => {
|
|
713
713
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
714
714
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -721,7 +721,7 @@ function validate$5(obj, path = 'LightningKnowledgeArticleVersionCollectionRepre
|
|
|
721
721
|
for (let i = 0; i < obj_items.length; i++) {
|
|
722
722
|
const obj_items_item = obj_items[i];
|
|
723
723
|
const path_items_item = path_items + '[' + i + ']';
|
|
724
|
-
const referencepath_items_itemValidationError = validate$
|
|
724
|
+
const referencepath_items_itemValidationError = validate$7(obj_items_item, path_items_item);
|
|
725
725
|
if (referencepath_items_itemValidationError !== null) {
|
|
726
726
|
let message = 'Object doesn\'t match LightningKnowledgeArticleVersionRepresentation (at "' + path_items_item + '")\n';
|
|
727
727
|
message += referencepath_items_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -731,15 +731,15 @@ function validate$5(obj, path = 'LightningKnowledgeArticleVersionCollectionRepre
|
|
|
731
731
|
})();
|
|
732
732
|
return v_error === undefined ? null : v_error;
|
|
733
733
|
}
|
|
734
|
-
const RepresentationType$
|
|
735
|
-
function normalize$
|
|
734
|
+
const RepresentationType$3 = 'LightningKnowledgeArticleVersionCollectionRepresentation';
|
|
735
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
736
736
|
return input;
|
|
737
737
|
}
|
|
738
|
-
const select$
|
|
739
|
-
const { selections: LightningKnowledgeArticleVersionRepresentation__selections, opaque: LightningKnowledgeArticleVersionRepresentation__opaque, } = select$
|
|
738
|
+
const select$a = function LightningKnowledgeArticleVersionCollectionRepresentationSelect() {
|
|
739
|
+
const { selections: LightningKnowledgeArticleVersionRepresentation__selections, opaque: LightningKnowledgeArticleVersionRepresentation__opaque, } = select$b();
|
|
740
740
|
return {
|
|
741
741
|
kind: 'Fragment',
|
|
742
|
-
version: VERSION$
|
|
742
|
+
version: VERSION$5,
|
|
743
743
|
private: [],
|
|
744
744
|
selections: [
|
|
745
745
|
{
|
|
@@ -751,11 +751,11 @@ const select$7 = function LightningKnowledgeArticleVersionCollectionRepresentati
|
|
|
751
751
|
]
|
|
752
752
|
};
|
|
753
753
|
};
|
|
754
|
-
function equals$
|
|
754
|
+
function equals$5(existing, incoming) {
|
|
755
755
|
const existing_items = existing.items;
|
|
756
756
|
const incoming_items = incoming.items;
|
|
757
757
|
const equals_items_items = equalsArray(existing_items, incoming_items, (existing_items_item, incoming_items_item) => {
|
|
758
|
-
if (!(equals$
|
|
758
|
+
if (!(equals$6(existing_items_item, incoming_items_item))) {
|
|
759
759
|
return false;
|
|
760
760
|
}
|
|
761
761
|
});
|
|
@@ -764,44 +764,44 @@ function equals$4(existing, incoming) {
|
|
|
764
764
|
}
|
|
765
765
|
return true;
|
|
766
766
|
}
|
|
767
|
-
const ingest$
|
|
767
|
+
const ingest$3 = function LightningKnowledgeArticleVersionCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
768
768
|
if (process.env.NODE_ENV !== 'production') {
|
|
769
|
-
const validateError = validate$
|
|
769
|
+
const validateError = validate$6(input);
|
|
770
770
|
if (validateError !== null) {
|
|
771
771
|
throw validateError;
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
774
|
const key = path.fullPath;
|
|
775
775
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
776
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
776
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "NetworkDataCategory", VERSION$5, RepresentationType$3, equals$5);
|
|
777
777
|
return createLink(key);
|
|
778
778
|
};
|
|
779
|
-
function getTypeCacheKeys$
|
|
779
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
780
780
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
781
781
|
const rootKey = fullPathFactory();
|
|
782
782
|
rootKeySet.set(rootKey, {
|
|
783
783
|
namespace: keyPrefix,
|
|
784
|
-
representationName: RepresentationType$
|
|
784
|
+
representationName: RepresentationType$3,
|
|
785
785
|
mergeable: false
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
|
|
789
|
-
function select$
|
|
790
|
-
return select$
|
|
789
|
+
function select$9(luvio, params) {
|
|
790
|
+
return select$a();
|
|
791
791
|
}
|
|
792
|
-
function keyBuilder$
|
|
792
|
+
function keyBuilder$9(luvio, params) {
|
|
793
793
|
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 + ')';
|
|
794
794
|
}
|
|
795
|
-
function getResponseCacheKeys$
|
|
796
|
-
getTypeCacheKeys$
|
|
795
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
796
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$9(luvio, resourceParams));
|
|
797
797
|
}
|
|
798
|
-
function ingestSuccess$
|
|
798
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
799
799
|
const { body } = response;
|
|
800
|
-
const key = keyBuilder$
|
|
801
|
-
luvio.storeIngest(key, ingest$
|
|
800
|
+
const key = keyBuilder$9(luvio, resourceParams);
|
|
801
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
802
802
|
const snapshot = luvio.storeLookup({
|
|
803
803
|
recordId: key,
|
|
804
|
-
node: select$
|
|
804
|
+
node: select$9(),
|
|
805
805
|
variables: {},
|
|
806
806
|
}, snapshotRefresh);
|
|
807
807
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -812,13 +812,13 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
812
812
|
deepFreeze(snapshot.data);
|
|
813
813
|
return snapshot;
|
|
814
814
|
}
|
|
815
|
-
function ingestError$
|
|
816
|
-
const key = keyBuilder$
|
|
815
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
816
|
+
const key = keyBuilder$9(luvio, params);
|
|
817
817
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
818
818
|
luvio.storeIngestError(key, errorSnapshot);
|
|
819
819
|
return errorSnapshot;
|
|
820
820
|
}
|
|
821
|
-
function createResourceRequest$
|
|
821
|
+
function createResourceRequest$4(config) {
|
|
822
822
|
const headers = {};
|
|
823
823
|
return {
|
|
824
824
|
baseUri: '/services/data/v60.0',
|
|
@@ -832,7 +832,7 @@ function createResourceRequest$2(config) {
|
|
|
832
832
|
};
|
|
833
833
|
}
|
|
834
834
|
|
|
835
|
-
const adapterName$
|
|
835
|
+
const adapterName$4 = 'getArticlesForCategory';
|
|
836
836
|
const getArticlesForCategory_ConfigPropertyMetadata = [
|
|
837
837
|
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
838
838
|
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
@@ -842,94 +842,122 @@ const getArticlesForCategory_ConfigPropertyMetadata = [
|
|
|
842
842
|
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
843
843
|
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
844
844
|
];
|
|
845
|
-
const getArticlesForCategory_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
846
|
-
const createResourceParams$
|
|
847
|
-
function keyBuilder$
|
|
848
|
-
const resourceParams = createResourceParams$
|
|
849
|
-
return keyBuilder$
|
|
845
|
+
const getArticlesForCategory_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getArticlesForCategory_ConfigPropertyMetadata);
|
|
846
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(getArticlesForCategory_ConfigPropertyMetadata);
|
|
847
|
+
function keyBuilder$8(luvio, config) {
|
|
848
|
+
const resourceParams = createResourceParams$4(config);
|
|
849
|
+
return keyBuilder$9(luvio, resourceParams);
|
|
850
850
|
}
|
|
851
|
-
function typeCheckConfig$
|
|
851
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
852
852
|
const config = {};
|
|
853
|
-
typeCheckConfig$
|
|
853
|
+
typeCheckConfig$7(untrustedConfig, config, getArticlesForCategory_ConfigPropertyMetadata);
|
|
854
854
|
return config;
|
|
855
855
|
}
|
|
856
|
-
function validateAdapterConfig$
|
|
856
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
857
857
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
858
858
|
return null;
|
|
859
859
|
}
|
|
860
860
|
if (process.env.NODE_ENV !== 'production') {
|
|
861
861
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
862
862
|
}
|
|
863
|
-
const config = typeCheckConfig$
|
|
863
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
864
864
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
865
865
|
return null;
|
|
866
866
|
}
|
|
867
867
|
return config;
|
|
868
868
|
}
|
|
869
|
-
function adapterFragment$
|
|
870
|
-
createResourceParams$
|
|
871
|
-
return select$
|
|
869
|
+
function adapterFragment$3(luvio, config) {
|
|
870
|
+
createResourceParams$4(config);
|
|
871
|
+
return select$9();
|
|
872
872
|
}
|
|
873
|
-
function onFetchResponseSuccess$
|
|
874
|
-
const snapshot = ingestSuccess$
|
|
873
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
874
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
875
875
|
config,
|
|
876
|
-
resolve: () => buildNetworkSnapshot$
|
|
876
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
877
877
|
});
|
|
878
878
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
879
879
|
}
|
|
880
|
-
function onFetchResponseError$
|
|
881
|
-
const snapshot = ingestError$
|
|
880
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
881
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
882
882
|
config,
|
|
883
|
-
resolve: () => buildNetworkSnapshot$
|
|
883
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
884
884
|
});
|
|
885
885
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
886
886
|
}
|
|
887
|
-
function buildNetworkSnapshot$
|
|
888
|
-
const resourceParams = createResourceParams$
|
|
889
|
-
const request = createResourceRequest$
|
|
887
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
888
|
+
const resourceParams = createResourceParams$4(config);
|
|
889
|
+
const request = createResourceRequest$4(resourceParams);
|
|
890
890
|
return luvio.dispatchResourceRequest(request, options)
|
|
891
891
|
.then((response) => {
|
|
892
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
892
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
893
893
|
const cache = new StoreKeyMap();
|
|
894
|
-
getResponseCacheKeys$
|
|
894
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
895
895
|
return cache;
|
|
896
896
|
});
|
|
897
897
|
}, (response) => {
|
|
898
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
898
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
899
899
|
});
|
|
900
900
|
}
|
|
901
|
-
function buildNetworkSnapshotCachePolicy$
|
|
902
|
-
return buildNetworkSnapshotCachePolicy$
|
|
901
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
902
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
903
903
|
}
|
|
904
|
-
function buildCachedSnapshotCachePolicy$
|
|
904
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
905
905
|
const { luvio, config } = context;
|
|
906
906
|
const selector = {
|
|
907
|
-
recordId: keyBuilder$
|
|
908
|
-
node: adapterFragment$
|
|
907
|
+
recordId: keyBuilder$8(luvio, config),
|
|
908
|
+
node: adapterFragment$3(luvio, config),
|
|
909
909
|
variables: {},
|
|
910
910
|
};
|
|
911
911
|
const cacheSnapshot = storeLookup(selector, {
|
|
912
912
|
config,
|
|
913
|
-
resolve: () => buildNetworkSnapshot$
|
|
913
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
914
914
|
});
|
|
915
915
|
return cacheSnapshot;
|
|
916
916
|
}
|
|
917
917
|
const getArticlesForCategoryAdapterFactory = (luvio) => function NetworkDataCategory__getArticlesForCategory(untrustedConfig, requestContext) {
|
|
918
|
-
const config = validateAdapterConfig$
|
|
918
|
+
const config = validateAdapterConfig$4(untrustedConfig, getArticlesForCategory_ConfigPropertyNames);
|
|
919
919
|
// Invalid or incomplete config
|
|
920
920
|
if (config === null) {
|
|
921
921
|
return null;
|
|
922
922
|
}
|
|
923
923
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
924
|
-
buildCachedSnapshotCachePolicy$
|
|
924
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
925
925
|
};
|
|
926
926
|
|
|
927
|
-
const VERSION$
|
|
928
|
-
function validate$
|
|
927
|
+
const VERSION$4 = "249fa1fed903149ddf5e310c3fc8c1a9";
|
|
928
|
+
function validate$5(obj, path = 'NetworkDataCategoryRepresentation') {
|
|
929
929
|
const v_error = (() => {
|
|
930
930
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
931
931
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
932
932
|
}
|
|
933
|
+
if (obj.categoryGroupName !== undefined) {
|
|
934
|
+
const obj_categoryGroupName = obj.categoryGroupName;
|
|
935
|
+
const path_categoryGroupName = path + '.categoryGroupName';
|
|
936
|
+
let obj_categoryGroupName_union0 = null;
|
|
937
|
+
const obj_categoryGroupName_union0_error = (() => {
|
|
938
|
+
if (typeof obj_categoryGroupName !== 'string') {
|
|
939
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryGroupName + '" (at "' + path_categoryGroupName + '")');
|
|
940
|
+
}
|
|
941
|
+
})();
|
|
942
|
+
if (obj_categoryGroupName_union0_error != null) {
|
|
943
|
+
obj_categoryGroupName_union0 = obj_categoryGroupName_union0_error.message;
|
|
944
|
+
}
|
|
945
|
+
let obj_categoryGroupName_union1 = null;
|
|
946
|
+
const obj_categoryGroupName_union1_error = (() => {
|
|
947
|
+
if (obj_categoryGroupName !== null) {
|
|
948
|
+
return new TypeError('Expected "null" but received "' + typeof obj_categoryGroupName + '" (at "' + path_categoryGroupName + '")');
|
|
949
|
+
}
|
|
950
|
+
})();
|
|
951
|
+
if (obj_categoryGroupName_union1_error != null) {
|
|
952
|
+
obj_categoryGroupName_union1 = obj_categoryGroupName_union1_error.message;
|
|
953
|
+
}
|
|
954
|
+
if (obj_categoryGroupName_union0 && obj_categoryGroupName_union1) {
|
|
955
|
+
let message = 'Object doesn\'t match union (at "' + path_categoryGroupName + '")';
|
|
956
|
+
message += '\n' + obj_categoryGroupName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
957
|
+
message += '\n' + obj_categoryGroupName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
958
|
+
return new TypeError(message);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
933
961
|
const obj_categoryName = obj.categoryName;
|
|
934
962
|
const path_categoryName = path + '.categoryName';
|
|
935
963
|
if (typeof obj_categoryName !== 'string') {
|
|
@@ -1036,15 +1064,48 @@ function validate$4(obj, path = 'NetworkDataCategoryRepresentation') {
|
|
|
1036
1064
|
return new TypeError(message);
|
|
1037
1065
|
}
|
|
1038
1066
|
}
|
|
1067
|
+
if (obj.relativeUrl !== undefined) {
|
|
1068
|
+
const obj_relativeUrl = obj.relativeUrl;
|
|
1069
|
+
const path_relativeUrl = path + '.relativeUrl';
|
|
1070
|
+
let obj_relativeUrl_union0 = null;
|
|
1071
|
+
const obj_relativeUrl_union0_error = (() => {
|
|
1072
|
+
if (typeof obj_relativeUrl !== 'string') {
|
|
1073
|
+
return new TypeError('Expected "string" but received "' + typeof obj_relativeUrl + '" (at "' + path_relativeUrl + '")');
|
|
1074
|
+
}
|
|
1075
|
+
})();
|
|
1076
|
+
if (obj_relativeUrl_union0_error != null) {
|
|
1077
|
+
obj_relativeUrl_union0 = obj_relativeUrl_union0_error.message;
|
|
1078
|
+
}
|
|
1079
|
+
let obj_relativeUrl_union1 = null;
|
|
1080
|
+
const obj_relativeUrl_union1_error = (() => {
|
|
1081
|
+
if (obj_relativeUrl !== null) {
|
|
1082
|
+
return new TypeError('Expected "null" but received "' + typeof obj_relativeUrl + '" (at "' + path_relativeUrl + '")');
|
|
1083
|
+
}
|
|
1084
|
+
})();
|
|
1085
|
+
if (obj_relativeUrl_union1_error != null) {
|
|
1086
|
+
obj_relativeUrl_union1 = obj_relativeUrl_union1_error.message;
|
|
1087
|
+
}
|
|
1088
|
+
if (obj_relativeUrl_union0 && obj_relativeUrl_union1) {
|
|
1089
|
+
let message = 'Object doesn\'t match union (at "' + path_relativeUrl + '")';
|
|
1090
|
+
message += '\n' + obj_relativeUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1091
|
+
message += '\n' + obj_relativeUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1092
|
+
return new TypeError(message);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1039
1095
|
})();
|
|
1040
1096
|
return v_error === undefined ? null : v_error;
|
|
1041
1097
|
}
|
|
1042
|
-
const select$
|
|
1098
|
+
const select$8 = function NetworkDataCategoryRepresentationSelect() {
|
|
1043
1099
|
return {
|
|
1044
1100
|
kind: 'Fragment',
|
|
1045
|
-
version: VERSION$
|
|
1101
|
+
version: VERSION$4,
|
|
1046
1102
|
private: [],
|
|
1047
1103
|
selections: [
|
|
1104
|
+
{
|
|
1105
|
+
name: 'categoryGroupName',
|
|
1106
|
+
kind: 'Scalar',
|
|
1107
|
+
required: false
|
|
1108
|
+
},
|
|
1048
1109
|
{
|
|
1049
1110
|
name: 'categoryName',
|
|
1050
1111
|
kind: 'Scalar'
|
|
@@ -1072,11 +1133,16 @@ const select$5 = function NetworkDataCategoryRepresentationSelect() {
|
|
|
1072
1133
|
name: 'label',
|
|
1073
1134
|
kind: 'Scalar',
|
|
1074
1135
|
required: false
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
name: 'relativeUrl',
|
|
1139
|
+
kind: 'Scalar',
|
|
1140
|
+
required: false
|
|
1075
1141
|
}
|
|
1076
1142
|
]
|
|
1077
1143
|
};
|
|
1078
1144
|
};
|
|
1079
|
-
function equals$
|
|
1145
|
+
function equals$4(existing, incoming) {
|
|
1080
1146
|
const existing_categoryName = existing.categoryName;
|
|
1081
1147
|
const incoming_categoryName = incoming.categoryName;
|
|
1082
1148
|
if (!(existing_categoryName === incoming_categoryName)) {
|
|
@@ -1087,6 +1153,19 @@ function equals$3(existing, incoming) {
|
|
|
1087
1153
|
if (!(existing_id === incoming_id)) {
|
|
1088
1154
|
return false;
|
|
1089
1155
|
}
|
|
1156
|
+
const existing_categoryGroupName = existing.categoryGroupName;
|
|
1157
|
+
const incoming_categoryGroupName = incoming.categoryGroupName;
|
|
1158
|
+
// if at least one of these optionals is defined
|
|
1159
|
+
if (existing_categoryGroupName !== undefined || incoming_categoryGroupName !== undefined) {
|
|
1160
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1161
|
+
// not equal
|
|
1162
|
+
if (existing_categoryGroupName === undefined || incoming_categoryGroupName === undefined) {
|
|
1163
|
+
return false;
|
|
1164
|
+
}
|
|
1165
|
+
if (!(existing_categoryGroupName === incoming_categoryGroupName)) {
|
|
1166
|
+
return false;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1090
1169
|
const existing_childCategories = existing.childCategories;
|
|
1091
1170
|
const incoming_childCategories = incoming.childCategories;
|
|
1092
1171
|
const equals_childCategories_items = equalsArray(existing_childCategories, incoming_childCategories, (existing_childCategories_item, incoming_childCategories_item) => {
|
|
@@ -1136,9 +1215,373 @@ function equals$3(existing, incoming) {
|
|
|
1136
1215
|
return false;
|
|
1137
1216
|
}
|
|
1138
1217
|
}
|
|
1218
|
+
const existing_relativeUrl = existing.relativeUrl;
|
|
1219
|
+
const incoming_relativeUrl = incoming.relativeUrl;
|
|
1220
|
+
// if at least one of these optionals is defined
|
|
1221
|
+
if (existing_relativeUrl !== undefined || incoming_relativeUrl !== undefined) {
|
|
1222
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1223
|
+
// not equal
|
|
1224
|
+
if (existing_relativeUrl === undefined || incoming_relativeUrl === undefined) {
|
|
1225
|
+
return false;
|
|
1226
|
+
}
|
|
1227
|
+
if (!(existing_relativeUrl === incoming_relativeUrl)) {
|
|
1228
|
+
return false;
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1139
1231
|
return true;
|
|
1140
1232
|
}
|
|
1141
1233
|
|
|
1234
|
+
const VERSION$3 = "cb54e1b826cb600a290051de4121383a";
|
|
1235
|
+
function validate$4(obj, path = 'NetworkDataCategoryCollectionRepresentation') {
|
|
1236
|
+
const v_error = (() => {
|
|
1237
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1238
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1239
|
+
}
|
|
1240
|
+
const obj_networkDataCategories = obj.networkDataCategories;
|
|
1241
|
+
const path_networkDataCategories = path + '.networkDataCategories';
|
|
1242
|
+
if (!ArrayIsArray(obj_networkDataCategories)) {
|
|
1243
|
+
return new TypeError('Expected "array" but received "' + typeof obj_networkDataCategories + '" (at "' + path_networkDataCategories + '")');
|
|
1244
|
+
}
|
|
1245
|
+
for (let i = 0; i < obj_networkDataCategories.length; i++) {
|
|
1246
|
+
const obj_networkDataCategories_item = obj_networkDataCategories[i];
|
|
1247
|
+
const path_networkDataCategories_item = path_networkDataCategories + '[' + i + ']';
|
|
1248
|
+
const referencepath_networkDataCategories_itemValidationError = validate$5(obj_networkDataCategories_item, path_networkDataCategories_item);
|
|
1249
|
+
if (referencepath_networkDataCategories_itemValidationError !== null) {
|
|
1250
|
+
let message = 'Object doesn\'t match NetworkDataCategoryRepresentation (at "' + path_networkDataCategories_item + '")\n';
|
|
1251
|
+
message += referencepath_networkDataCategories_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1252
|
+
return new TypeError(message);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
})();
|
|
1256
|
+
return v_error === undefined ? null : v_error;
|
|
1257
|
+
}
|
|
1258
|
+
const RepresentationType$2 = 'NetworkDataCategoryCollectionRepresentation';
|
|
1259
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1260
|
+
return input;
|
|
1261
|
+
}
|
|
1262
|
+
const select$7 = function NetworkDataCategoryCollectionRepresentationSelect() {
|
|
1263
|
+
const { selections: NetworkDataCategoryRepresentation__selections, opaque: NetworkDataCategoryRepresentation__opaque, } = select$8();
|
|
1264
|
+
return {
|
|
1265
|
+
kind: 'Fragment',
|
|
1266
|
+
version: VERSION$3,
|
|
1267
|
+
private: [],
|
|
1268
|
+
selections: [
|
|
1269
|
+
{
|
|
1270
|
+
name: 'networkDataCategories',
|
|
1271
|
+
kind: 'Object',
|
|
1272
|
+
plural: true,
|
|
1273
|
+
selections: NetworkDataCategoryRepresentation__selections
|
|
1274
|
+
}
|
|
1275
|
+
]
|
|
1276
|
+
};
|
|
1277
|
+
};
|
|
1278
|
+
function equals$3(existing, incoming) {
|
|
1279
|
+
const existing_networkDataCategories = existing.networkDataCategories;
|
|
1280
|
+
const incoming_networkDataCategories = incoming.networkDataCategories;
|
|
1281
|
+
const equals_networkDataCategories_items = equalsArray(existing_networkDataCategories, incoming_networkDataCategories, (existing_networkDataCategories_item, incoming_networkDataCategories_item) => {
|
|
1282
|
+
if (!(equals$4(existing_networkDataCategories_item, incoming_networkDataCategories_item))) {
|
|
1283
|
+
return false;
|
|
1284
|
+
}
|
|
1285
|
+
});
|
|
1286
|
+
if (equals_networkDataCategories_items === false) {
|
|
1287
|
+
return false;
|
|
1288
|
+
}
|
|
1289
|
+
return true;
|
|
1290
|
+
}
|
|
1291
|
+
const ingest$2 = function NetworkDataCategoryCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1292
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1293
|
+
const validateError = validate$4(input);
|
|
1294
|
+
if (validateError !== null) {
|
|
1295
|
+
throw validateError;
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
const key = path.fullPath;
|
|
1299
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
1300
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "NetworkDataCategory", VERSION$3, RepresentationType$2, equals$3);
|
|
1301
|
+
return createLink(key);
|
|
1302
|
+
};
|
|
1303
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1304
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1305
|
+
const rootKey = fullPathFactory();
|
|
1306
|
+
rootKeySet.set(rootKey, {
|
|
1307
|
+
namespace: keyPrefix,
|
|
1308
|
+
representationName: RepresentationType$2,
|
|
1309
|
+
mergeable: false
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
function select$6(luvio, params) {
|
|
1314
|
+
return select$7();
|
|
1315
|
+
}
|
|
1316
|
+
function keyBuilder$7(luvio, params) {
|
|
1317
|
+
return keyPrefix + '::NetworkDataCategoryCollectionRepresentation:(' + 'language:' + params.queryParams.language + ',' + 'communityId:' + params.urlParams.communityId + ',' + 'networkDataCategoryId:' + params.urlParams.networkDataCategoryId + ')';
|
|
1318
|
+
}
|
|
1319
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1320
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$7(luvio, resourceParams));
|
|
1321
|
+
}
|
|
1322
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
1323
|
+
const { body } = response;
|
|
1324
|
+
const key = keyBuilder$7(luvio, resourceParams);
|
|
1325
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1326
|
+
const snapshot = luvio.storeLookup({
|
|
1327
|
+
recordId: key,
|
|
1328
|
+
node: select$6(),
|
|
1329
|
+
variables: {},
|
|
1330
|
+
}, snapshotRefresh);
|
|
1331
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1332
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1333
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
deepFreeze(snapshot.data);
|
|
1337
|
+
return snapshot;
|
|
1338
|
+
}
|
|
1339
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
1340
|
+
const key = keyBuilder$7(luvio, params);
|
|
1341
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1342
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1343
|
+
return errorSnapshot;
|
|
1344
|
+
}
|
|
1345
|
+
function createResourceRequest$3(config) {
|
|
1346
|
+
const headers = {};
|
|
1347
|
+
return {
|
|
1348
|
+
baseUri: '/services/data/v60.0',
|
|
1349
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '/parent-path',
|
|
1350
|
+
method: 'get',
|
|
1351
|
+
body: null,
|
|
1352
|
+
urlParams: config.urlParams,
|
|
1353
|
+
queryParams: config.queryParams,
|
|
1354
|
+
headers,
|
|
1355
|
+
priority: 'normal',
|
|
1356
|
+
};
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
const adapterName$3 = 'getParentNetworkDataCategoryPath';
|
|
1360
|
+
const getParentNetworkDataCategoryPath_ConfigPropertyMetadata = [
|
|
1361
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1362
|
+
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1363
|
+
generateParamConfigMetadata('language', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1364
|
+
];
|
|
1365
|
+
const getParentNetworkDataCategoryPath_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getParentNetworkDataCategoryPath_ConfigPropertyMetadata);
|
|
1366
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(getParentNetworkDataCategoryPath_ConfigPropertyMetadata);
|
|
1367
|
+
function keyBuilder$6(luvio, config) {
|
|
1368
|
+
const resourceParams = createResourceParams$3(config);
|
|
1369
|
+
return keyBuilder$7(luvio, resourceParams);
|
|
1370
|
+
}
|
|
1371
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1372
|
+
const config = {};
|
|
1373
|
+
typeCheckConfig$7(untrustedConfig, config, getParentNetworkDataCategoryPath_ConfigPropertyMetadata);
|
|
1374
|
+
return config;
|
|
1375
|
+
}
|
|
1376
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1377
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1378
|
+
return null;
|
|
1379
|
+
}
|
|
1380
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1381
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1382
|
+
}
|
|
1383
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
1384
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1385
|
+
return null;
|
|
1386
|
+
}
|
|
1387
|
+
return config;
|
|
1388
|
+
}
|
|
1389
|
+
function adapterFragment$2(luvio, config) {
|
|
1390
|
+
createResourceParams$3(config);
|
|
1391
|
+
return select$6();
|
|
1392
|
+
}
|
|
1393
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
1394
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
1395
|
+
config,
|
|
1396
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1397
|
+
});
|
|
1398
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1399
|
+
}
|
|
1400
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
1401
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
1402
|
+
config,
|
|
1403
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1404
|
+
});
|
|
1405
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1406
|
+
}
|
|
1407
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1408
|
+
const resourceParams = createResourceParams$3(config);
|
|
1409
|
+
const request = createResourceRequest$3(resourceParams);
|
|
1410
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1411
|
+
.then((response) => {
|
|
1412
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
1413
|
+
const cache = new StoreKeyMap();
|
|
1414
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
1415
|
+
return cache;
|
|
1416
|
+
});
|
|
1417
|
+
}, (response) => {
|
|
1418
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
1422
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
1423
|
+
}
|
|
1424
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
1425
|
+
const { luvio, config } = context;
|
|
1426
|
+
const selector = {
|
|
1427
|
+
recordId: keyBuilder$6(luvio, config),
|
|
1428
|
+
node: adapterFragment$2(luvio, config),
|
|
1429
|
+
variables: {},
|
|
1430
|
+
};
|
|
1431
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1432
|
+
config,
|
|
1433
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1434
|
+
});
|
|
1435
|
+
return cacheSnapshot;
|
|
1436
|
+
}
|
|
1437
|
+
const getParentNetworkDataCategoryPathAdapterFactory = (luvio) => function NetworkDataCategory__getParentNetworkDataCategoryPath(untrustedConfig, requestContext) {
|
|
1438
|
+
const config = validateAdapterConfig$3(untrustedConfig, getParentNetworkDataCategoryPath_ConfigPropertyNames);
|
|
1439
|
+
// Invalid or incomplete config
|
|
1440
|
+
if (config === null) {
|
|
1441
|
+
return null;
|
|
1442
|
+
}
|
|
1443
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1444
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
1445
|
+
};
|
|
1446
|
+
|
|
1447
|
+
function select$5(luvio, params) {
|
|
1448
|
+
return select$7();
|
|
1449
|
+
}
|
|
1450
|
+
function keyBuilder$5(luvio, params) {
|
|
1451
|
+
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 + ')';
|
|
1452
|
+
}
|
|
1453
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
1454
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
1455
|
+
}
|
|
1456
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
1457
|
+
const { body } = response;
|
|
1458
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
1459
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1460
|
+
const snapshot = luvio.storeLookup({
|
|
1461
|
+
recordId: key,
|
|
1462
|
+
node: select$5(),
|
|
1463
|
+
variables: {},
|
|
1464
|
+
}, snapshotRefresh);
|
|
1465
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1466
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1467
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
deepFreeze(snapshot.data);
|
|
1471
|
+
return snapshot;
|
|
1472
|
+
}
|
|
1473
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1474
|
+
const key = keyBuilder$5(luvio, params);
|
|
1475
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1476
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1477
|
+
return errorSnapshot;
|
|
1478
|
+
}
|
|
1479
|
+
function createResourceRequest$2(config) {
|
|
1480
|
+
const headers = {};
|
|
1481
|
+
return {
|
|
1482
|
+
baseUri: '/services/data/v60.0',
|
|
1483
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '/child-category',
|
|
1484
|
+
method: 'get',
|
|
1485
|
+
body: null,
|
|
1486
|
+
urlParams: config.urlParams,
|
|
1487
|
+
queryParams: config.queryParams,
|
|
1488
|
+
headers,
|
|
1489
|
+
priority: 'normal',
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
const adapterName$2 = 'getChildCategories';
|
|
1494
|
+
const getChildCategories_ConfigPropertyMetadata = [
|
|
1495
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1496
|
+
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1497
|
+
generateParamConfigMetadata('language', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1498
|
+
generateParamConfigMetadata('pageNumber', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1499
|
+
generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1500
|
+
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1501
|
+
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1502
|
+
];
|
|
1503
|
+
const getChildCategories_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getChildCategories_ConfigPropertyMetadata);
|
|
1504
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(getChildCategories_ConfigPropertyMetadata);
|
|
1505
|
+
function keyBuilder$4(luvio, config) {
|
|
1506
|
+
const resourceParams = createResourceParams$2(config);
|
|
1507
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
1508
|
+
}
|
|
1509
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
1510
|
+
const config = {};
|
|
1511
|
+
typeCheckConfig$7(untrustedConfig, config, getChildCategories_ConfigPropertyMetadata);
|
|
1512
|
+
return config;
|
|
1513
|
+
}
|
|
1514
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1515
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1516
|
+
return null;
|
|
1517
|
+
}
|
|
1518
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1519
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1520
|
+
}
|
|
1521
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1522
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1523
|
+
return null;
|
|
1524
|
+
}
|
|
1525
|
+
return config;
|
|
1526
|
+
}
|
|
1527
|
+
function adapterFragment$1(luvio, config) {
|
|
1528
|
+
createResourceParams$2(config);
|
|
1529
|
+
return select$5();
|
|
1530
|
+
}
|
|
1531
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1532
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
1533
|
+
config,
|
|
1534
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1535
|
+
});
|
|
1536
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1537
|
+
}
|
|
1538
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1539
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1540
|
+
config,
|
|
1541
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1542
|
+
});
|
|
1543
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1544
|
+
}
|
|
1545
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1546
|
+
const resourceParams = createResourceParams$2(config);
|
|
1547
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1548
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1549
|
+
.then((response) => {
|
|
1550
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1551
|
+
const cache = new StoreKeyMap();
|
|
1552
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
1553
|
+
return cache;
|
|
1554
|
+
});
|
|
1555
|
+
}, (response) => {
|
|
1556
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1560
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
1561
|
+
}
|
|
1562
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1563
|
+
const { luvio, config } = context;
|
|
1564
|
+
const selector = {
|
|
1565
|
+
recordId: keyBuilder$4(luvio, config),
|
|
1566
|
+
node: adapterFragment$1(luvio, config),
|
|
1567
|
+
variables: {},
|
|
1568
|
+
};
|
|
1569
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1570
|
+
config,
|
|
1571
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1572
|
+
});
|
|
1573
|
+
return cacheSnapshot;
|
|
1574
|
+
}
|
|
1575
|
+
const getChildCategoriesAdapterFactory = (luvio) => function NetworkDataCategory__getChildCategories(untrustedConfig, requestContext) {
|
|
1576
|
+
const config = validateAdapterConfig$2(untrustedConfig, getChildCategories_ConfigPropertyNames);
|
|
1577
|
+
// Invalid or incomplete config
|
|
1578
|
+
if (config === null) {
|
|
1579
|
+
return null;
|
|
1580
|
+
}
|
|
1581
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1582
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1583
|
+
};
|
|
1584
|
+
|
|
1142
1585
|
const VERSION$2 = "971192bd937efc9d89177c7289adf241";
|
|
1143
1586
|
function validate$3(obj, path = 'NetworkDataCategoryGroupRepresentation') {
|
|
1144
1587
|
const v_error = (() => {
|
|
@@ -1155,7 +1598,7 @@ function validate$3(obj, path = 'NetworkDataCategoryGroupRepresentation') {
|
|
|
1155
1598
|
const path_rootCategory = path + '.rootCategory';
|
|
1156
1599
|
let obj_rootCategory_union0 = null;
|
|
1157
1600
|
const obj_rootCategory_union0_error = (() => {
|
|
1158
|
-
const referencepath_rootCategoryValidationError = validate$
|
|
1601
|
+
const referencepath_rootCategoryValidationError = validate$5(obj_rootCategory, path_rootCategory);
|
|
1159
1602
|
if (referencepath_rootCategoryValidationError !== null) {
|
|
1160
1603
|
let message = 'Object doesn\'t match NetworkDataCategoryRepresentation (at "' + path_rootCategory + '")\n';
|
|
1161
1604
|
message += referencepath_rootCategoryValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1185,7 +1628,7 @@ function validate$3(obj, path = 'NetworkDataCategoryGroupRepresentation') {
|
|
|
1185
1628
|
return v_error === undefined ? null : v_error;
|
|
1186
1629
|
}
|
|
1187
1630
|
const select$4 = function NetworkDataCategoryGroupRepresentationSelect() {
|
|
1188
|
-
const { selections: NetworkDataCategoryRepresentation__selections, opaque: NetworkDataCategoryRepresentation__opaque, } = select$
|
|
1631
|
+
const { selections: NetworkDataCategoryRepresentation__selections, opaque: NetworkDataCategoryRepresentation__opaque, } = select$8();
|
|
1189
1632
|
return {
|
|
1190
1633
|
kind: 'Fragment',
|
|
1191
1634
|
version: VERSION$2,
|
|
@@ -1223,7 +1666,7 @@ function equals$2(existing, incoming) {
|
|
|
1223
1666
|
if (!(existing_rootCategory === incoming_rootCategory
|
|
1224
1667
|
|| (existing_rootCategory != null &&
|
|
1225
1668
|
incoming_rootCategory != null &&
|
|
1226
|
-
equals$
|
|
1669
|
+
equals$4(existing_rootCategory, incoming_rootCategory)))) {
|
|
1227
1670
|
return false;
|
|
1228
1671
|
}
|
|
1229
1672
|
}
|
|
@@ -1399,14 +1842,14 @@ const getNetworkDataCategories_ConfigPropertyMetadata = [
|
|
|
1399
1842
|
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1400
1843
|
];
|
|
1401
1844
|
const getNetworkDataCategories_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getNetworkDataCategories_ConfigPropertyMetadata);
|
|
1402
|
-
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$
|
|
1845
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(getNetworkDataCategories_ConfigPropertyMetadata);
|
|
1403
1846
|
function keyBuilder$1(luvio, config) {
|
|
1404
1847
|
const resourceParams = createResourceParams$1(config);
|
|
1405
1848
|
return keyBuilder$2(luvio, resourceParams);
|
|
1406
1849
|
}
|
|
1407
1850
|
function typeCheckConfig$1(untrustedConfig) {
|
|
1408
1851
|
const config = {};
|
|
1409
|
-
typeCheckConfig$
|
|
1852
|
+
typeCheckConfig$7(untrustedConfig, config, getNetworkDataCategories_ConfigPropertyMetadata);
|
|
1410
1853
|
return config;
|
|
1411
1854
|
}
|
|
1412
1855
|
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
@@ -1455,7 +1898,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
1455
1898
|
});
|
|
1456
1899
|
}
|
|
1457
1900
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1458
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1901
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
1459
1902
|
}
|
|
1460
1903
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1461
1904
|
const { luvio, config } = context;
|
|
@@ -1614,10 +2057,10 @@ const updateNetworkDataCategories_ConfigPropertyMetadata = [
|
|
|
1614
2057
|
generateParamConfigMetadata('networkDataCategoryTree', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1615
2058
|
];
|
|
1616
2059
|
const updateNetworkDataCategories_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateNetworkDataCategories_ConfigPropertyMetadata);
|
|
1617
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
2060
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$7(updateNetworkDataCategories_ConfigPropertyMetadata);
|
|
1618
2061
|
function typeCheckConfig(untrustedConfig) {
|
|
1619
2062
|
const config = {};
|
|
1620
|
-
typeCheckConfig$
|
|
2063
|
+
typeCheckConfig$7(untrustedConfig, config, updateNetworkDataCategories_ConfigPropertyMetadata);
|
|
1621
2064
|
const untrustedConfig_networkDataCategoryTree = untrustedConfig.networkDataCategoryTree;
|
|
1622
2065
|
const referenceDataCategoryGroupCollectionInputRepresentationValidationError = validate$1(untrustedConfig_networkDataCategoryTree);
|
|
1623
2066
|
if (referenceDataCategoryGroupCollectionInputRepresentationValidationError === null) {
|
|
@@ -1667,4 +2110,4 @@ const updateNetworkDataCategoriesAdapterFactory = (luvio) => {
|
|
|
1667
2110
|
};
|
|
1668
2111
|
};
|
|
1669
2112
|
|
|
1670
|
-
export { getArticlesForCategoryAdapterFactory, getNetworkDataCategoriesAdapterFactory, getServiceCatalogItemsAdapterFactory, getServiceCatalogItemsForCommunityAdapterFactory, updateNetworkDataCategoriesAdapterFactory };
|
|
2113
|
+
export { getArticlesForCategoryAdapterFactory, getChildCategoriesAdapterFactory, getNetworkDataCategoriesAdapterFactory, getParentNetworkDataCategoryPathAdapterFactory, getServiceCatalogItemsAdapterFactory, getServiceCatalogItemsForCommunityAdapterFactory, updateNetworkDataCategoriesAdapterFactory };
|