@salesforce/lds-adapters-service-network-data-category 1.250.1 → 1.252.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 +876 -719
- package/dist/es/es2018/types/src/generated/adapters/updateNetworkDataCategory.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +2 -1
- package/dist/es/es2018/types/src/generated/resources/patchConnectCommunitiesNetworkDataCategoryByCommunityIdAndNetworkDataCategoryId.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/types/NetworkDataCategoryCollectionRepresentation.d.ts +12 -3
- package/dist/es/es2018/types/src/generated/types/NetworkDataCategoryGroupRepresentation.d.ts +13 -5
- package/dist/es/es2018/types/src/generated/types/NetworkDataCategoryRepresentation.d.ts +13 -4
- package/dist/es/es2018/types/src/generated/types/NetworkDataCategoryTreeRepresentation.d.ts +12 -3
- package/package.json +1 -1
- package/sfdc/index.js +444 -284
- package/src/raml/api.raml +26 -2
- package/src/raml/luvio.raml +6 -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$6, typeCheckConfig as typeCheckConfig$
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$6, typeCheckConfig as typeCheckConfig$8, StoreKeyMap, createResourceParams as createResourceParams$8 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -173,7 +173,7 @@ function validate$9(obj, path = 'ServiceCatalogItemRepresentation') {
|
|
|
173
173
|
})();
|
|
174
174
|
return v_error === undefined ? null : v_error;
|
|
175
175
|
}
|
|
176
|
-
const select$
|
|
176
|
+
const select$g = function ServiceCatalogItemRepresentationSelect() {
|
|
177
177
|
return {
|
|
178
178
|
kind: 'Fragment',
|
|
179
179
|
version: VERSION$8,
|
|
@@ -273,12 +273,12 @@ function validate$8(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$6 = 'ServiceCatalogItemCollectionRepresentation';
|
|
277
|
+
function normalize$6(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$f = function ServiceCatalogItemCollectionRepresentationSelect() {
|
|
281
|
+
const { selections: ServiceCatalogItemRepresentation__selections, opaque: ServiceCatalogItemRepresentation__opaque, } = select$g();
|
|
282
282
|
return {
|
|
283
283
|
kind: 'Fragment',
|
|
284
284
|
version: VERSION$7,
|
|
@@ -306,7 +306,7 @@ function equals$7(existing, incoming) {
|
|
|
306
306
|
}
|
|
307
307
|
return true;
|
|
308
308
|
}
|
|
309
|
-
const ingest$
|
|
309
|
+
const ingest$6 = function ServiceCatalogItemCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
310
310
|
if (process.env.NODE_ENV !== 'production') {
|
|
311
311
|
const validateError = validate$8(input);
|
|
312
312
|
if (validateError !== null) {
|
|
@@ -315,35 +315,35 @@ const ingest$4 = function ServiceCatalogItemCollectionRepresentationIngest(input
|
|
|
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$6, "NetworkDataCategory", VERSION$7, RepresentationType$6, equals$7);
|
|
319
319
|
return createLink(key);
|
|
320
320
|
};
|
|
321
|
-
function getTypeCacheKeys$
|
|
321
|
+
function getTypeCacheKeys$6(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$6,
|
|
327
327
|
mergeable: false
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
function select$
|
|
332
|
-
return select$
|
|
331
|
+
function select$e(luvio, params) {
|
|
332
|
+
return select$f();
|
|
333
333
|
}
|
|
334
|
-
function keyBuilder$
|
|
334
|
+
function keyBuilder$e(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$7(storeKeyMap, luvio, resourceParams, response) {
|
|
338
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$e(luvio, resourceParams));
|
|
339
339
|
}
|
|
340
|
-
function ingestSuccess$
|
|
340
|
+
function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
|
|
341
341
|
const { body } = response;
|
|
342
|
-
const key = keyBuilder$
|
|
343
|
-
luvio.storeIngest(key, ingest$
|
|
342
|
+
const key = keyBuilder$e(luvio, resourceParams);
|
|
343
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
344
344
|
const snapshot = luvio.storeLookup({
|
|
345
345
|
recordId: key,
|
|
346
|
-
node: select$
|
|
346
|
+
node: select$e(),
|
|
347
347
|
variables: {},
|
|
348
348
|
}, snapshotRefresh);
|
|
349
349
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -355,12 +355,12 @@ function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
355
355
|
return snapshot;
|
|
356
356
|
}
|
|
357
357
|
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
358
|
-
const key = keyBuilder$
|
|
358
|
+
const key = keyBuilder$e(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$7(config) {
|
|
364
364
|
const headers = {};
|
|
365
365
|
return {
|
|
366
366
|
baseUri: '/services/data/v60.0',
|
|
@@ -374,7 +374,7 @@ function createResourceRequest$6(config) {
|
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
-
const adapterName$
|
|
377
|
+
const adapterName$7 = '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,56 +382,56 @@ 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$7, getServiceCatalogItems_ConfigPropertyMetadata);
|
|
386
|
+
const createResourceParams$7 = /*#__PURE__*/ createResourceParams$8(getServiceCatalogItems_ConfigPropertyMetadata);
|
|
387
|
+
function keyBuilder$d(luvio, config) {
|
|
388
|
+
const resourceParams = createResourceParams$7(config);
|
|
389
|
+
return keyBuilder$e(luvio, resourceParams);
|
|
390
390
|
}
|
|
391
|
-
function typeCheckConfig$
|
|
391
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
392
392
|
const config = {};
|
|
393
|
-
typeCheckConfig$
|
|
393
|
+
typeCheckConfig$8(untrustedConfig, config, getServiceCatalogItems_ConfigPropertyMetadata);
|
|
394
394
|
return config;
|
|
395
395
|
}
|
|
396
|
-
function validateAdapterConfig$
|
|
396
|
+
function validateAdapterConfig$7(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$7(untrustedConfig);
|
|
404
404
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
405
405
|
return null;
|
|
406
406
|
}
|
|
407
407
|
return config;
|
|
408
408
|
}
|
|
409
409
|
function adapterFragment$5(luvio, config) {
|
|
410
|
-
createResourceParams$
|
|
411
|
-
return select$
|
|
410
|
+
createResourceParams$7(config);
|
|
411
|
+
return select$e();
|
|
412
412
|
}
|
|
413
413
|
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
414
|
-
const snapshot = ingestSuccess$
|
|
414
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response, {
|
|
415
415
|
config,
|
|
416
|
-
resolve: () => buildNetworkSnapshot$
|
|
416
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
417
417
|
});
|
|
418
418
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
419
419
|
}
|
|
420
420
|
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
421
421
|
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
422
422
|
config,
|
|
423
|
-
resolve: () => buildNetworkSnapshot$
|
|
423
|
+
resolve: () => buildNetworkSnapshot$8(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$8(luvio, config, options) {
|
|
428
|
+
const resourceParams = createResourceParams$7(config);
|
|
429
|
+
const request = createResourceRequest$7(resourceParams);
|
|
430
430
|
return luvio.dispatchResourceRequest(request, options)
|
|
431
431
|
.then((response) => {
|
|
432
432
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
433
433
|
const cache = new StoreKeyMap();
|
|
434
|
-
getResponseCacheKeys$
|
|
434
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
435
435
|
return cache;
|
|
436
436
|
});
|
|
437
437
|
}, (response) => {
|
|
@@ -439,23 +439,23 @@ function buildNetworkSnapshot$7(luvio, config, options) {
|
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
441
|
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
442
|
-
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
442
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$8, undefined, false);
|
|
443
443
|
}
|
|
444
444
|
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
445
445
|
const { luvio, config } = context;
|
|
446
446
|
const selector = {
|
|
447
|
-
recordId: keyBuilder$
|
|
447
|
+
recordId: keyBuilder$d(luvio, config),
|
|
448
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$8(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$7(untrustedConfig, getServiceCatalogItems_ConfigPropertyNames);
|
|
459
459
|
// Invalid or incomplete config
|
|
460
460
|
if (config === null) {
|
|
461
461
|
return null;
|
|
@@ -464,344 +464,456 @@ const getServiceCatalogItemsAdapterFactory = (luvio) => function NetworkDataCate
|
|
|
464
464
|
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
465
465
|
};
|
|
466
466
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
function keyBuilder$b(luvio, params) {
|
|
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
|
-
}
|
|
473
|
-
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
474
|
-
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$b(luvio, resourceParams));
|
|
475
|
-
}
|
|
476
|
-
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
477
|
-
const { body } = response;
|
|
478
|
-
const key = keyBuilder$b(luvio, resourceParams);
|
|
479
|
-
luvio.storeIngest(key, ingest$4, body);
|
|
480
|
-
const snapshot = luvio.storeLookup({
|
|
481
|
-
recordId: key,
|
|
482
|
-
node: select$c(),
|
|
483
|
-
variables: {},
|
|
484
|
-
}, snapshotRefresh);
|
|
485
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
486
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
487
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
deepFreeze(snapshot.data);
|
|
491
|
-
return snapshot;
|
|
492
|
-
}
|
|
493
|
-
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
494
|
-
const key = keyBuilder$b(luvio, params);
|
|
495
|
-
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
496
|
-
luvio.storeIngestError(key, errorSnapshot);
|
|
497
|
-
return errorSnapshot;
|
|
498
|
-
}
|
|
499
|
-
function createResourceRequest$5(config) {
|
|
500
|
-
const headers = {};
|
|
501
|
-
return {
|
|
502
|
-
baseUri: '/services/data/v60.0',
|
|
503
|
-
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '/catalog-item',
|
|
504
|
-
method: 'get',
|
|
505
|
-
body: null,
|
|
506
|
-
urlParams: config.urlParams,
|
|
507
|
-
queryParams: config.queryParams,
|
|
508
|
-
headers,
|
|
509
|
-
priority: 'normal',
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
const adapterName$5 = 'getServiceCatalogItemsForCommunity';
|
|
514
|
-
const getServiceCatalogItemsForCommunity_ConfigPropertyMetadata = [
|
|
515
|
-
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
516
|
-
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
517
|
-
generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
518
|
-
generateParamConfigMetadata('pageNumber', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
519
|
-
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
520
|
-
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
521
|
-
];
|
|
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
|
-
}
|
|
528
|
-
function typeCheckConfig$5(untrustedConfig) {
|
|
529
|
-
const config = {};
|
|
530
|
-
typeCheckConfig$7(untrustedConfig, config, getServiceCatalogItemsForCommunity_ConfigPropertyMetadata);
|
|
531
|
-
return config;
|
|
532
|
-
}
|
|
533
|
-
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
534
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
535
|
-
return null;
|
|
536
|
-
}
|
|
537
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
538
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
539
|
-
}
|
|
540
|
-
const config = typeCheckConfig$5(untrustedConfig);
|
|
541
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
542
|
-
return null;
|
|
543
|
-
}
|
|
544
|
-
return config;
|
|
545
|
-
}
|
|
546
|
-
function adapterFragment$4(luvio, config) {
|
|
547
|
-
createResourceParams$5(config);
|
|
548
|
-
return select$c();
|
|
549
|
-
}
|
|
550
|
-
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
551
|
-
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
552
|
-
config,
|
|
553
|
-
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
554
|
-
});
|
|
555
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
556
|
-
}
|
|
557
|
-
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
558
|
-
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
559
|
-
config,
|
|
560
|
-
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
561
|
-
});
|
|
562
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
563
|
-
}
|
|
564
|
-
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
565
|
-
const resourceParams = createResourceParams$5(config);
|
|
566
|
-
const request = createResourceRequest$5(resourceParams);
|
|
567
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
568
|
-
.then((response) => {
|
|
569
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
570
|
-
const cache = new StoreKeyMap();
|
|
571
|
-
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
572
|
-
return cache;
|
|
573
|
-
});
|
|
574
|
-
}, (response) => {
|
|
575
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
579
|
-
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
580
|
-
}
|
|
581
|
-
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
582
|
-
const { luvio, config } = context;
|
|
583
|
-
const selector = {
|
|
584
|
-
recordId: keyBuilder$a(luvio, config),
|
|
585
|
-
node: adapterFragment$4(luvio, config),
|
|
586
|
-
variables: {},
|
|
587
|
-
};
|
|
588
|
-
const cacheSnapshot = storeLookup(selector, {
|
|
589
|
-
config,
|
|
590
|
-
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
591
|
-
});
|
|
592
|
-
return cacheSnapshot;
|
|
593
|
-
}
|
|
594
|
-
const getServiceCatalogItemsForCommunityAdapterFactory = (luvio) => function NetworkDataCategory__getServiceCatalogItemsForCommunity(untrustedConfig, requestContext) {
|
|
595
|
-
const config = validateAdapterConfig$5(untrustedConfig, getServiceCatalogItemsForCommunity_ConfigPropertyNames);
|
|
596
|
-
// Invalid or incomplete config
|
|
597
|
-
if (config === null) {
|
|
598
|
-
return null;
|
|
599
|
-
}
|
|
600
|
-
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
601
|
-
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
const VERSION$6 = "f3960577caf41d925ed00b2cc2e508e8";
|
|
605
|
-
function validate$7(obj, path = 'LightningKnowledgeArticleVersionRepresentation') {
|
|
467
|
+
const VERSION$6 = "10056afa07419528d3eb028a828b42cc";
|
|
468
|
+
function validate$7(obj, path = 'NetworkDataCategoryRepresentation') {
|
|
606
469
|
const v_error = (() => {
|
|
607
470
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
608
471
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
609
472
|
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
473
|
+
if (obj.categoryGroupName !== undefined) {
|
|
474
|
+
const obj_categoryGroupName = obj.categoryGroupName;
|
|
475
|
+
const path_categoryGroupName = path + '.categoryGroupName';
|
|
476
|
+
let obj_categoryGroupName_union0 = null;
|
|
477
|
+
const obj_categoryGroupName_union0_error = (() => {
|
|
478
|
+
if (typeof obj_categoryGroupName !== 'string') {
|
|
479
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryGroupName + '" (at "' + path_categoryGroupName + '")');
|
|
480
|
+
}
|
|
481
|
+
})();
|
|
482
|
+
if (obj_categoryGroupName_union0_error != null) {
|
|
483
|
+
obj_categoryGroupName_union0 = obj_categoryGroupName_union0_error.message;
|
|
484
|
+
}
|
|
485
|
+
let obj_categoryGroupName_union1 = null;
|
|
486
|
+
const obj_categoryGroupName_union1_error = (() => {
|
|
487
|
+
if (obj_categoryGroupName !== null) {
|
|
488
|
+
return new TypeError('Expected "null" but received "' + typeof obj_categoryGroupName + '" (at "' + path_categoryGroupName + '")');
|
|
489
|
+
}
|
|
490
|
+
})();
|
|
491
|
+
if (obj_categoryGroupName_union1_error != null) {
|
|
492
|
+
obj_categoryGroupName_union1 = obj_categoryGroupName_union1_error.message;
|
|
493
|
+
}
|
|
494
|
+
if (obj_categoryGroupName_union0 && obj_categoryGroupName_union1) {
|
|
495
|
+
let message = 'Object doesn\'t match union (at "' + path_categoryGroupName + '")';
|
|
496
|
+
message += '\n' + obj_categoryGroupName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
497
|
+
message += '\n' + obj_categoryGroupName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
498
|
+
return new TypeError(message);
|
|
499
|
+
}
|
|
614
500
|
}
|
|
615
|
-
const
|
|
616
|
-
const
|
|
617
|
-
if (typeof
|
|
618
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
501
|
+
const obj_categoryName = obj.categoryName;
|
|
502
|
+
const path_categoryName = path + '.categoryName';
|
|
503
|
+
if (typeof obj_categoryName !== 'string') {
|
|
504
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
|
|
619
505
|
}
|
|
620
|
-
const
|
|
621
|
-
const
|
|
622
|
-
if (
|
|
623
|
-
return new TypeError('Expected "
|
|
506
|
+
const obj_childCategories = obj.childCategories;
|
|
507
|
+
const path_childCategories = path + '.childCategories';
|
|
508
|
+
if (!ArrayIsArray(obj_childCategories)) {
|
|
509
|
+
return new TypeError('Expected "array" but received "' + typeof obj_childCategories + '" (at "' + path_childCategories + '")');
|
|
624
510
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
511
|
+
for (let i = 0; i < obj_childCategories.length; i++) {
|
|
512
|
+
const obj_childCategories_item = obj_childCategories[i];
|
|
513
|
+
const path_childCategories_item = path_childCategories + '[' + i + ']';
|
|
514
|
+
if (obj_childCategories_item === undefined) {
|
|
515
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_childCategories_item + '" (at "' + path_childCategories_item + '")');
|
|
516
|
+
}
|
|
629
517
|
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
518
|
+
if (obj.description !== undefined) {
|
|
519
|
+
const obj_description = obj.description;
|
|
520
|
+
const path_description = path + '.description';
|
|
521
|
+
let obj_description_union0 = null;
|
|
522
|
+
const obj_description_union0_error = (() => {
|
|
523
|
+
if (typeof obj_description !== 'string') {
|
|
524
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
525
|
+
}
|
|
526
|
+
})();
|
|
527
|
+
if (obj_description_union0_error != null) {
|
|
528
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
529
|
+
}
|
|
530
|
+
let obj_description_union1 = null;
|
|
531
|
+
const obj_description_union1_error = (() => {
|
|
532
|
+
if (obj_description !== null) {
|
|
533
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
534
|
+
}
|
|
535
|
+
})();
|
|
536
|
+
if (obj_description_union1_error != null) {
|
|
537
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
538
|
+
}
|
|
539
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
540
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
541
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
542
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
543
|
+
return new TypeError(message);
|
|
544
|
+
}
|
|
634
545
|
}
|
|
635
|
-
const
|
|
636
|
-
const
|
|
637
|
-
if (typeof
|
|
638
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
546
|
+
const obj_id = obj.id;
|
|
547
|
+
const path_id = path + '.id';
|
|
548
|
+
if (typeof obj_id !== 'string') {
|
|
549
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
639
550
|
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
{
|
|
650
|
-
|
|
651
|
-
|
|
551
|
+
if (obj.imageUrl !== undefined) {
|
|
552
|
+
const obj_imageUrl = obj.imageUrl;
|
|
553
|
+
const path_imageUrl = path + '.imageUrl';
|
|
554
|
+
let obj_imageUrl_union0 = null;
|
|
555
|
+
const obj_imageUrl_union0_error = (() => {
|
|
556
|
+
if (typeof obj_imageUrl !== 'string') {
|
|
557
|
+
return new TypeError('Expected "string" but received "' + typeof obj_imageUrl + '" (at "' + path_imageUrl + '")');
|
|
558
|
+
}
|
|
559
|
+
})();
|
|
560
|
+
if (obj_imageUrl_union0_error != null) {
|
|
561
|
+
obj_imageUrl_union0 = obj_imageUrl_union0_error.message;
|
|
562
|
+
}
|
|
563
|
+
let obj_imageUrl_union1 = null;
|
|
564
|
+
const obj_imageUrl_union1_error = (() => {
|
|
565
|
+
if (obj_imageUrl !== null) {
|
|
566
|
+
return new TypeError('Expected "null" but received "' + typeof obj_imageUrl + '" (at "' + path_imageUrl + '")');
|
|
567
|
+
}
|
|
568
|
+
})();
|
|
569
|
+
if (obj_imageUrl_union1_error != null) {
|
|
570
|
+
obj_imageUrl_union1 = obj_imageUrl_union1_error.message;
|
|
571
|
+
}
|
|
572
|
+
if (obj_imageUrl_union0 && obj_imageUrl_union1) {
|
|
573
|
+
let message = 'Object doesn\'t match union (at "' + path_imageUrl + '")';
|
|
574
|
+
message += '\n' + obj_imageUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
575
|
+
message += '\n' + obj_imageUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
576
|
+
return new TypeError(message);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
if (obj.label !== undefined) {
|
|
580
|
+
const obj_label = obj.label;
|
|
581
|
+
const path_label = path + '.label';
|
|
582
|
+
let obj_label_union0 = null;
|
|
583
|
+
const obj_label_union0_error = (() => {
|
|
584
|
+
if (typeof obj_label !== 'string') {
|
|
585
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
586
|
+
}
|
|
587
|
+
})();
|
|
588
|
+
if (obj_label_union0_error != null) {
|
|
589
|
+
obj_label_union0 = obj_label_union0_error.message;
|
|
590
|
+
}
|
|
591
|
+
let obj_label_union1 = null;
|
|
592
|
+
const obj_label_union1_error = (() => {
|
|
593
|
+
if (obj_label !== null) {
|
|
594
|
+
return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
595
|
+
}
|
|
596
|
+
})();
|
|
597
|
+
if (obj_label_union1_error != null) {
|
|
598
|
+
obj_label_union1 = obj_label_union1_error.message;
|
|
599
|
+
}
|
|
600
|
+
if (obj_label_union0 && obj_label_union1) {
|
|
601
|
+
let message = 'Object doesn\'t match union (at "' + path_label + '")';
|
|
602
|
+
message += '\n' + obj_label_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
603
|
+
message += '\n' + obj_label_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
604
|
+
return new TypeError(message);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
if (obj.relativeUrl !== undefined) {
|
|
608
|
+
const obj_relativeUrl = obj.relativeUrl;
|
|
609
|
+
const path_relativeUrl = path + '.relativeUrl';
|
|
610
|
+
let obj_relativeUrl_union0 = null;
|
|
611
|
+
const obj_relativeUrl_union0_error = (() => {
|
|
612
|
+
if (typeof obj_relativeUrl !== 'string') {
|
|
613
|
+
return new TypeError('Expected "string" but received "' + typeof obj_relativeUrl + '" (at "' + path_relativeUrl + '")');
|
|
614
|
+
}
|
|
615
|
+
})();
|
|
616
|
+
if (obj_relativeUrl_union0_error != null) {
|
|
617
|
+
obj_relativeUrl_union0 = obj_relativeUrl_union0_error.message;
|
|
618
|
+
}
|
|
619
|
+
let obj_relativeUrl_union1 = null;
|
|
620
|
+
const obj_relativeUrl_union1_error = (() => {
|
|
621
|
+
if (obj_relativeUrl !== null) {
|
|
622
|
+
return new TypeError('Expected "null" but received "' + typeof obj_relativeUrl + '" (at "' + path_relativeUrl + '")');
|
|
623
|
+
}
|
|
624
|
+
})();
|
|
625
|
+
if (obj_relativeUrl_union1_error != null) {
|
|
626
|
+
obj_relativeUrl_union1 = obj_relativeUrl_union1_error.message;
|
|
627
|
+
}
|
|
628
|
+
if (obj_relativeUrl_union0 && obj_relativeUrl_union1) {
|
|
629
|
+
let message = 'Object doesn\'t match union (at "' + path_relativeUrl + '")';
|
|
630
|
+
message += '\n' + obj_relativeUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
631
|
+
message += '\n' + obj_relativeUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
632
|
+
return new TypeError(message);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
})();
|
|
636
|
+
return v_error === undefined ? null : v_error;
|
|
637
|
+
}
|
|
638
|
+
const RepresentationType$5 = 'NetworkDataCategoryRepresentation';
|
|
639
|
+
function keyBuilder$c(luvio, config) {
|
|
640
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.id;
|
|
641
|
+
}
|
|
642
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
643
|
+
const keyParams = {
|
|
644
|
+
id: object.id
|
|
645
|
+
};
|
|
646
|
+
return keyBuilder$c(luvio, keyParams);
|
|
647
|
+
}
|
|
648
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
649
|
+
return input;
|
|
650
|
+
}
|
|
651
|
+
const select$d = function NetworkDataCategoryRepresentationSelect() {
|
|
652
|
+
return {
|
|
653
|
+
kind: 'Fragment',
|
|
654
|
+
version: VERSION$6,
|
|
655
|
+
private: [],
|
|
656
|
+
selections: [
|
|
657
|
+
{
|
|
658
|
+
name: 'categoryGroupName',
|
|
659
|
+
kind: 'Scalar',
|
|
660
|
+
required: false
|
|
652
661
|
},
|
|
653
662
|
{
|
|
654
|
-
name: '
|
|
663
|
+
name: 'categoryName',
|
|
655
664
|
kind: 'Scalar'
|
|
656
665
|
},
|
|
657
666
|
{
|
|
658
|
-
name: '
|
|
659
|
-
kind: '
|
|
667
|
+
name: 'childCategories',
|
|
668
|
+
kind: 'Object',
|
|
669
|
+
// any
|
|
660
670
|
},
|
|
661
671
|
{
|
|
662
|
-
name: '
|
|
663
|
-
kind: 'Scalar'
|
|
672
|
+
name: 'description',
|
|
673
|
+
kind: 'Scalar',
|
|
674
|
+
required: false
|
|
664
675
|
},
|
|
665
676
|
{
|
|
666
|
-
name: '
|
|
677
|
+
name: 'id',
|
|
667
678
|
kind: 'Scalar'
|
|
668
679
|
},
|
|
669
680
|
{
|
|
670
|
-
name: '
|
|
671
|
-
kind: 'Scalar'
|
|
681
|
+
name: 'imageUrl',
|
|
682
|
+
kind: 'Scalar',
|
|
683
|
+
required: false
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
name: 'label',
|
|
687
|
+
kind: 'Scalar',
|
|
688
|
+
required: false
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
name: 'relativeUrl',
|
|
692
|
+
kind: 'Scalar',
|
|
693
|
+
required: false
|
|
672
694
|
}
|
|
673
695
|
]
|
|
674
696
|
};
|
|
675
697
|
};
|
|
676
698
|
function equals$6(existing, incoming) {
|
|
699
|
+
const existing_categoryName = existing.categoryName;
|
|
700
|
+
const incoming_categoryName = incoming.categoryName;
|
|
701
|
+
if (!(existing_categoryName === incoming_categoryName)) {
|
|
702
|
+
return false;
|
|
703
|
+
}
|
|
677
704
|
const existing_id = existing.id;
|
|
678
705
|
const incoming_id = incoming.id;
|
|
679
706
|
if (!(existing_id === incoming_id)) {
|
|
680
707
|
return false;
|
|
681
708
|
}
|
|
682
|
-
const
|
|
683
|
-
const
|
|
684
|
-
if
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
if (!(existing_summary === incoming_summary)) {
|
|
695
|
-
return false;
|
|
709
|
+
const existing_categoryGroupName = existing.categoryGroupName;
|
|
710
|
+
const incoming_categoryGroupName = incoming.categoryGroupName;
|
|
711
|
+
// if at least one of these optionals is defined
|
|
712
|
+
if (existing_categoryGroupName !== undefined || incoming_categoryGroupName !== undefined) {
|
|
713
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
714
|
+
// not equal
|
|
715
|
+
if (existing_categoryGroupName === undefined || incoming_categoryGroupName === undefined) {
|
|
716
|
+
return false;
|
|
717
|
+
}
|
|
718
|
+
if (!(existing_categoryGroupName === incoming_categoryGroupName)) {
|
|
719
|
+
return false;
|
|
720
|
+
}
|
|
696
721
|
}
|
|
697
|
-
const
|
|
698
|
-
const
|
|
699
|
-
|
|
722
|
+
const existing_childCategories = existing.childCategories;
|
|
723
|
+
const incoming_childCategories = incoming.childCategories;
|
|
724
|
+
const equals_childCategories_items = equalsArray(existing_childCategories, incoming_childCategories, (existing_childCategories_item, incoming_childCategories_item) => {
|
|
725
|
+
if (JSONStringify(incoming_childCategories_item) !== JSONStringify(existing_childCategories_item)) {
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
if (equals_childCategories_items === false) {
|
|
700
730
|
return false;
|
|
701
731
|
}
|
|
702
|
-
const
|
|
703
|
-
const
|
|
704
|
-
if
|
|
705
|
-
|
|
732
|
+
const existing_description = existing.description;
|
|
733
|
+
const incoming_description = incoming.description;
|
|
734
|
+
// if at least one of these optionals is defined
|
|
735
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
736
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
737
|
+
// not equal
|
|
738
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
741
|
+
if (!(existing_description === incoming_description)) {
|
|
742
|
+
return false;
|
|
743
|
+
}
|
|
706
744
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
if (
|
|
714
|
-
return
|
|
745
|
+
const existing_imageUrl = existing.imageUrl;
|
|
746
|
+
const incoming_imageUrl = incoming.imageUrl;
|
|
747
|
+
// if at least one of these optionals is defined
|
|
748
|
+
if (existing_imageUrl !== undefined || incoming_imageUrl !== undefined) {
|
|
749
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
750
|
+
// not equal
|
|
751
|
+
if (existing_imageUrl === undefined || incoming_imageUrl === undefined) {
|
|
752
|
+
return false;
|
|
715
753
|
}
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
if (!ArrayIsArray(obj_items)) {
|
|
719
|
-
return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
|
|
754
|
+
if (!(existing_imageUrl === incoming_imageUrl)) {
|
|
755
|
+
return false;
|
|
720
756
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
757
|
+
}
|
|
758
|
+
const existing_label = existing.label;
|
|
759
|
+
const incoming_label = incoming.label;
|
|
760
|
+
// if at least one of these optionals is defined
|
|
761
|
+
if (existing_label !== undefined || incoming_label !== undefined) {
|
|
762
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
763
|
+
// not equal
|
|
764
|
+
if (existing_label === undefined || incoming_label === undefined) {
|
|
765
|
+
return false;
|
|
730
766
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
{
|
|
746
|
-
name: 'items',
|
|
747
|
-
kind: 'Object',
|
|
748
|
-
plural: true,
|
|
749
|
-
selections: LightningKnowledgeArticleVersionRepresentation__selections
|
|
750
|
-
}
|
|
751
|
-
]
|
|
752
|
-
};
|
|
753
|
-
};
|
|
754
|
-
function equals$5(existing, incoming) {
|
|
755
|
-
const existing_items = existing.items;
|
|
756
|
-
const incoming_items = incoming.items;
|
|
757
|
-
const equals_items_items = equalsArray(existing_items, incoming_items, (existing_items_item, incoming_items_item) => {
|
|
758
|
-
if (!(equals$6(existing_items_item, incoming_items_item))) {
|
|
767
|
+
if (!(existing_label === incoming_label)) {
|
|
768
|
+
return false;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
const existing_relativeUrl = existing.relativeUrl;
|
|
772
|
+
const incoming_relativeUrl = incoming.relativeUrl;
|
|
773
|
+
// if at least one of these optionals is defined
|
|
774
|
+
if (existing_relativeUrl !== undefined || incoming_relativeUrl !== undefined) {
|
|
775
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
776
|
+
// not equal
|
|
777
|
+
if (existing_relativeUrl === undefined || incoming_relativeUrl === undefined) {
|
|
778
|
+
return false;
|
|
779
|
+
}
|
|
780
|
+
if (!(existing_relativeUrl === incoming_relativeUrl)) {
|
|
759
781
|
return false;
|
|
760
782
|
}
|
|
761
|
-
});
|
|
762
|
-
if (equals_items_items === false) {
|
|
763
|
-
return false;
|
|
764
783
|
}
|
|
765
784
|
return true;
|
|
766
785
|
}
|
|
767
|
-
const ingest$
|
|
786
|
+
const ingest$5 = function NetworkDataCategoryRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
768
787
|
if (process.env.NODE_ENV !== 'production') {
|
|
769
|
-
const validateError = validate$
|
|
788
|
+
const validateError = validate$7(input);
|
|
770
789
|
if (validateError !== null) {
|
|
771
790
|
throw validateError;
|
|
772
791
|
}
|
|
773
792
|
}
|
|
774
|
-
const key =
|
|
793
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
775
794
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
776
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
795
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "NetworkDataCategory", VERSION$6, RepresentationType$5, equals$6);
|
|
777
796
|
return createLink(key);
|
|
778
797
|
};
|
|
779
|
-
function getTypeCacheKeys$
|
|
798
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
780
799
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
781
|
-
const rootKey =
|
|
800
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
782
801
|
rootKeySet.set(rootKey, {
|
|
783
802
|
namespace: keyPrefix,
|
|
784
|
-
representationName: RepresentationType$
|
|
803
|
+
representationName: RepresentationType$5,
|
|
785
804
|
mergeable: false
|
|
786
805
|
});
|
|
787
806
|
}
|
|
788
807
|
|
|
789
|
-
function select$
|
|
790
|
-
return select$
|
|
808
|
+
function select$c(luvio, params) {
|
|
809
|
+
return select$d();
|
|
791
810
|
}
|
|
792
|
-
function
|
|
793
|
-
|
|
811
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
812
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
794
813
|
}
|
|
795
|
-
function
|
|
796
|
-
|
|
814
|
+
function ingestSuccess$6(luvio, resourceParams, response) {
|
|
815
|
+
const { body } = response;
|
|
816
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
817
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
818
|
+
const snapshot = luvio.storeLookup({
|
|
819
|
+
recordId: key,
|
|
820
|
+
node: select$c(),
|
|
821
|
+
variables: {},
|
|
822
|
+
});
|
|
823
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
824
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
825
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
deepFreeze(snapshot.data);
|
|
829
|
+
return snapshot;
|
|
797
830
|
}
|
|
798
|
-
function
|
|
831
|
+
function createResourceRequest$6(config) {
|
|
832
|
+
const headers = {};
|
|
833
|
+
return {
|
|
834
|
+
baseUri: '/services/data/v60.0',
|
|
835
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '',
|
|
836
|
+
method: 'patch',
|
|
837
|
+
body: null,
|
|
838
|
+
urlParams: config.urlParams,
|
|
839
|
+
queryParams: config.queryParams,
|
|
840
|
+
headers,
|
|
841
|
+
priority: 'normal',
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
const adapterName$6 = 'updateNetworkDataCategory';
|
|
846
|
+
const updateNetworkDataCategory_ConfigPropertyMetadata = [
|
|
847
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
848
|
+
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
849
|
+
generateParamConfigMetadata('description', false, 1 /* QueryParameter */, 0 /* String */),
|
|
850
|
+
generateParamConfigMetadata('label', false, 1 /* QueryParameter */, 0 /* String */),
|
|
851
|
+
];
|
|
852
|
+
const updateNetworkDataCategory_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, updateNetworkDataCategory_ConfigPropertyMetadata);
|
|
853
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$8(updateNetworkDataCategory_ConfigPropertyMetadata);
|
|
854
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
855
|
+
const config = {};
|
|
856
|
+
typeCheckConfig$8(untrustedConfig, config, updateNetworkDataCategory_ConfigPropertyMetadata);
|
|
857
|
+
return config;
|
|
858
|
+
}
|
|
859
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
860
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
861
|
+
return null;
|
|
862
|
+
}
|
|
863
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
864
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
865
|
+
}
|
|
866
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
867
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
868
|
+
return null;
|
|
869
|
+
}
|
|
870
|
+
return config;
|
|
871
|
+
}
|
|
872
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
873
|
+
const resourceParams = createResourceParams$6(config);
|
|
874
|
+
const request = createResourceRequest$6(resourceParams);
|
|
875
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
876
|
+
.then((response) => {
|
|
877
|
+
return luvio.handleSuccessResponse(() => {
|
|
878
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response);
|
|
879
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
880
|
+
}, () => {
|
|
881
|
+
const cache = new StoreKeyMap();
|
|
882
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
883
|
+
return cache;
|
|
884
|
+
});
|
|
885
|
+
}, (response) => {
|
|
886
|
+
deepFreeze(response);
|
|
887
|
+
throw response;
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
const updateNetworkDataCategoryAdapterFactory = (luvio) => {
|
|
891
|
+
return function updateNetworkDataCategory(untrustedConfig) {
|
|
892
|
+
const config = validateAdapterConfig$6(untrustedConfig, updateNetworkDataCategory_ConfigPropertyNames);
|
|
893
|
+
// Invalid or incomplete config
|
|
894
|
+
if (config === null) {
|
|
895
|
+
throw new Error('Invalid config for "updateNetworkDataCategory"');
|
|
896
|
+
}
|
|
897
|
+
return buildNetworkSnapshot$7(luvio, config);
|
|
898
|
+
};
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
function select$b(luvio, params) {
|
|
902
|
+
return select$f();
|
|
903
|
+
}
|
|
904
|
+
function keyBuilder$b(luvio, params) {
|
|
905
|
+
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 + ')';
|
|
906
|
+
}
|
|
907
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
908
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$b(luvio, resourceParams));
|
|
909
|
+
}
|
|
910
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
799
911
|
const { body } = response;
|
|
800
|
-
const key = keyBuilder$
|
|
801
|
-
luvio.storeIngest(key, ingest$
|
|
912
|
+
const key = keyBuilder$b(luvio, resourceParams);
|
|
913
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
802
914
|
const snapshot = luvio.storeLookup({
|
|
803
915
|
recordId: key,
|
|
804
|
-
node: select$
|
|
916
|
+
node: select$b(),
|
|
805
917
|
variables: {},
|
|
806
918
|
}, snapshotRefresh);
|
|
807
919
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -812,17 +924,17 @@ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
812
924
|
deepFreeze(snapshot.data);
|
|
813
925
|
return snapshot;
|
|
814
926
|
}
|
|
815
|
-
function ingestError$
|
|
816
|
-
const key = keyBuilder$
|
|
927
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
928
|
+
const key = keyBuilder$b(luvio, params);
|
|
817
929
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
818
930
|
luvio.storeIngestError(key, errorSnapshot);
|
|
819
931
|
return errorSnapshot;
|
|
820
932
|
}
|
|
821
|
-
function createResourceRequest$
|
|
933
|
+
function createResourceRequest$5(config) {
|
|
822
934
|
const headers = {};
|
|
823
935
|
return {
|
|
824
936
|
baseUri: '/services/data/v60.0',
|
|
825
|
-
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '/
|
|
937
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '/catalog-item',
|
|
826
938
|
method: 'get',
|
|
827
939
|
body: null,
|
|
828
940
|
urlParams: config.urlParams,
|
|
@@ -832,406 +944,421 @@ function createResourceRequest$4(config) {
|
|
|
832
944
|
};
|
|
833
945
|
}
|
|
834
946
|
|
|
835
|
-
const adapterName$
|
|
836
|
-
const
|
|
947
|
+
const adapterName$5 = 'getServiceCatalogItemsForCommunity';
|
|
948
|
+
const getServiceCatalogItemsForCommunity_ConfigPropertyMetadata = [
|
|
837
949
|
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
838
950
|
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
839
|
-
generateParamConfigMetadata('language', false, 1 /* QueryParameter */, 0 /* String */),
|
|
840
|
-
generateParamConfigMetadata('pageNumber', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
841
951
|
generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
952
|
+
generateParamConfigMetadata('pageNumber', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
842
953
|
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
843
954
|
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
844
955
|
];
|
|
845
|
-
const
|
|
846
|
-
const createResourceParams$
|
|
847
|
-
function keyBuilder$
|
|
848
|
-
const resourceParams = createResourceParams$
|
|
849
|
-
return keyBuilder$
|
|
956
|
+
const getServiceCatalogItemsForCommunity_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getServiceCatalogItemsForCommunity_ConfigPropertyMetadata);
|
|
957
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$8(getServiceCatalogItemsForCommunity_ConfigPropertyMetadata);
|
|
958
|
+
function keyBuilder$a(luvio, config) {
|
|
959
|
+
const resourceParams = createResourceParams$5(config);
|
|
960
|
+
return keyBuilder$b(luvio, resourceParams);
|
|
850
961
|
}
|
|
851
|
-
function typeCheckConfig$
|
|
962
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
852
963
|
const config = {};
|
|
853
|
-
typeCheckConfig$
|
|
964
|
+
typeCheckConfig$8(untrustedConfig, config, getServiceCatalogItemsForCommunity_ConfigPropertyMetadata);
|
|
854
965
|
return config;
|
|
855
966
|
}
|
|
856
|
-
function validateAdapterConfig$
|
|
967
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
857
968
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
858
969
|
return null;
|
|
859
970
|
}
|
|
860
971
|
if (process.env.NODE_ENV !== 'production') {
|
|
861
972
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
862
973
|
}
|
|
863
|
-
const config = typeCheckConfig$
|
|
974
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
864
975
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
865
976
|
return null;
|
|
866
977
|
}
|
|
867
978
|
return config;
|
|
868
979
|
}
|
|
869
|
-
function adapterFragment$
|
|
870
|
-
createResourceParams$
|
|
871
|
-
return select$
|
|
980
|
+
function adapterFragment$4(luvio, config) {
|
|
981
|
+
createResourceParams$5(config);
|
|
982
|
+
return select$b();
|
|
872
983
|
}
|
|
873
|
-
function onFetchResponseSuccess$
|
|
874
|
-
const snapshot = ingestSuccess$
|
|
984
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
985
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
875
986
|
config,
|
|
876
|
-
resolve: () => buildNetworkSnapshot$
|
|
987
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
877
988
|
});
|
|
878
989
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
879
990
|
}
|
|
880
|
-
function onFetchResponseError$
|
|
881
|
-
const snapshot = ingestError$
|
|
991
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
992
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
882
993
|
config,
|
|
883
|
-
resolve: () => buildNetworkSnapshot$
|
|
994
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
884
995
|
});
|
|
885
996
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
886
997
|
}
|
|
887
|
-
function buildNetworkSnapshot$
|
|
888
|
-
const resourceParams = createResourceParams$
|
|
889
|
-
const request = createResourceRequest$
|
|
998
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
999
|
+
const resourceParams = createResourceParams$5(config);
|
|
1000
|
+
const request = createResourceRequest$5(resourceParams);
|
|
890
1001
|
return luvio.dispatchResourceRequest(request, options)
|
|
891
1002
|
.then((response) => {
|
|
892
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
1003
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
893
1004
|
const cache = new StoreKeyMap();
|
|
894
|
-
getResponseCacheKeys$
|
|
1005
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
895
1006
|
return cache;
|
|
896
1007
|
});
|
|
897
1008
|
}, (response) => {
|
|
898
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
899
|
-
});
|
|
900
|
-
}
|
|
901
|
-
function buildNetworkSnapshotCachePolicy$
|
|
902
|
-
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
903
|
-
}
|
|
904
|
-
function buildCachedSnapshotCachePolicy$
|
|
905
|
-
const { luvio, config } = context;
|
|
906
|
-
const selector = {
|
|
907
|
-
recordId: keyBuilder$
|
|
908
|
-
node: adapterFragment$
|
|
909
|
-
variables: {},
|
|
910
|
-
};
|
|
911
|
-
const cacheSnapshot = storeLookup(selector, {
|
|
912
|
-
config,
|
|
913
|
-
resolve: () => buildNetworkSnapshot$
|
|
914
|
-
});
|
|
915
|
-
return cacheSnapshot;
|
|
916
|
-
}
|
|
917
|
-
const
|
|
918
|
-
const config = validateAdapterConfig$
|
|
919
|
-
// Invalid or incomplete config
|
|
920
|
-
if (config === null) {
|
|
921
|
-
return null;
|
|
922
|
-
}
|
|
923
|
-
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
924
|
-
buildCachedSnapshotCachePolicy$
|
|
925
|
-
};
|
|
926
|
-
|
|
927
|
-
const VERSION$
|
|
928
|
-
function validate$
|
|
929
|
-
const v_error = (() => {
|
|
930
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
931
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
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
|
-
}
|
|
961
|
-
const obj_categoryName = obj.categoryName;
|
|
962
|
-
const path_categoryName = path + '.categoryName';
|
|
963
|
-
if (typeof obj_categoryName !== 'string') {
|
|
964
|
-
return new TypeError('Expected "string" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
|
|
965
|
-
}
|
|
966
|
-
const obj_childCategories = obj.childCategories;
|
|
967
|
-
const path_childCategories = path + '.childCategories';
|
|
968
|
-
if (!ArrayIsArray(obj_childCategories)) {
|
|
969
|
-
return new TypeError('Expected "array" but received "' + typeof obj_childCategories + '" (at "' + path_childCategories + '")');
|
|
970
|
-
}
|
|
971
|
-
for (let i = 0; i < obj_childCategories.length; i++) {
|
|
972
|
-
const obj_childCategories_item = obj_childCategories[i];
|
|
973
|
-
const path_childCategories_item = path_childCategories + '[' + i + ']';
|
|
974
|
-
if (obj_childCategories_item === undefined) {
|
|
975
|
-
return new TypeError('Expected "defined" but received "' + typeof obj_childCategories_item + '" (at "' + path_childCategories_item + '")');
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
if (obj.description !== undefined) {
|
|
979
|
-
const obj_description = obj.description;
|
|
980
|
-
const path_description = path + '.description';
|
|
981
|
-
let obj_description_union0 = null;
|
|
982
|
-
const obj_description_union0_error = (() => {
|
|
983
|
-
if (typeof obj_description !== 'string') {
|
|
984
|
-
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
985
|
-
}
|
|
986
|
-
})();
|
|
987
|
-
if (obj_description_union0_error != null) {
|
|
988
|
-
obj_description_union0 = obj_description_union0_error.message;
|
|
989
|
-
}
|
|
990
|
-
let obj_description_union1 = null;
|
|
991
|
-
const obj_description_union1_error = (() => {
|
|
992
|
-
if (obj_description !== null) {
|
|
993
|
-
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
994
|
-
}
|
|
995
|
-
})();
|
|
996
|
-
if (obj_description_union1_error != null) {
|
|
997
|
-
obj_description_union1 = obj_description_union1_error.message;
|
|
998
|
-
}
|
|
999
|
-
if (obj_description_union0 && obj_description_union1) {
|
|
1000
|
-
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
1001
|
-
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1002
|
-
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1003
|
-
return new TypeError(message);
|
|
1004
|
-
}
|
|
1009
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
1013
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
1014
|
+
}
|
|
1015
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
1016
|
+
const { luvio, config } = context;
|
|
1017
|
+
const selector = {
|
|
1018
|
+
recordId: keyBuilder$a(luvio, config),
|
|
1019
|
+
node: adapterFragment$4(luvio, config),
|
|
1020
|
+
variables: {},
|
|
1021
|
+
};
|
|
1022
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1023
|
+
config,
|
|
1024
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
1025
|
+
});
|
|
1026
|
+
return cacheSnapshot;
|
|
1027
|
+
}
|
|
1028
|
+
const getServiceCatalogItemsForCommunityAdapterFactory = (luvio) => function NetworkDataCategory__getServiceCatalogItemsForCommunity(untrustedConfig, requestContext) {
|
|
1029
|
+
const config = validateAdapterConfig$5(untrustedConfig, getServiceCatalogItemsForCommunity_ConfigPropertyNames);
|
|
1030
|
+
// Invalid or incomplete config
|
|
1031
|
+
if (config === null) {
|
|
1032
|
+
return null;
|
|
1033
|
+
}
|
|
1034
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1035
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
1036
|
+
};
|
|
1037
|
+
|
|
1038
|
+
const VERSION$5 = "f3960577caf41d925ed00b2cc2e508e8";
|
|
1039
|
+
function validate$6(obj, path = 'LightningKnowledgeArticleVersionRepresentation') {
|
|
1040
|
+
const v_error = (() => {
|
|
1041
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1042
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1005
1043
|
}
|
|
1006
1044
|
const obj_id = obj.id;
|
|
1007
1045
|
const path_id = path + '.id';
|
|
1008
1046
|
if (typeof obj_id !== 'string') {
|
|
1009
1047
|
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1010
1048
|
}
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
const obj_imageUrl_union0_error = (() => {
|
|
1016
|
-
if (typeof obj_imageUrl !== 'string') {
|
|
1017
|
-
return new TypeError('Expected "string" but received "' + typeof obj_imageUrl + '" (at "' + path_imageUrl + '")');
|
|
1018
|
-
}
|
|
1019
|
-
})();
|
|
1020
|
-
if (obj_imageUrl_union0_error != null) {
|
|
1021
|
-
obj_imageUrl_union0 = obj_imageUrl_union0_error.message;
|
|
1022
|
-
}
|
|
1023
|
-
let obj_imageUrl_union1 = null;
|
|
1024
|
-
const obj_imageUrl_union1_error = (() => {
|
|
1025
|
-
if (obj_imageUrl !== null) {
|
|
1026
|
-
return new TypeError('Expected "null" but received "' + typeof obj_imageUrl + '" (at "' + path_imageUrl + '")');
|
|
1027
|
-
}
|
|
1028
|
-
})();
|
|
1029
|
-
if (obj_imageUrl_union1_error != null) {
|
|
1030
|
-
obj_imageUrl_union1 = obj_imageUrl_union1_error.message;
|
|
1031
|
-
}
|
|
1032
|
-
if (obj_imageUrl_union0 && obj_imageUrl_union1) {
|
|
1033
|
-
let message = 'Object doesn\'t match union (at "' + path_imageUrl + '")';
|
|
1034
|
-
message += '\n' + obj_imageUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1035
|
-
message += '\n' + obj_imageUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1036
|
-
return new TypeError(message);
|
|
1037
|
-
}
|
|
1049
|
+
const obj_knowledgeArticleId = obj.knowledgeArticleId;
|
|
1050
|
+
const path_knowledgeArticleId = path + '.knowledgeArticleId';
|
|
1051
|
+
if (typeof obj_knowledgeArticleId !== 'string') {
|
|
1052
|
+
return new TypeError('Expected "string" but received "' + typeof obj_knowledgeArticleId + '" (at "' + path_knowledgeArticleId + '")');
|
|
1038
1053
|
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
const obj_label_union0_error = (() => {
|
|
1044
|
-
if (typeof obj_label !== 'string') {
|
|
1045
|
-
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
1046
|
-
}
|
|
1047
|
-
})();
|
|
1048
|
-
if (obj_label_union0_error != null) {
|
|
1049
|
-
obj_label_union0 = obj_label_union0_error.message;
|
|
1050
|
-
}
|
|
1051
|
-
let obj_label_union1 = null;
|
|
1052
|
-
const obj_label_union1_error = (() => {
|
|
1053
|
-
if (obj_label !== null) {
|
|
1054
|
-
return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
1055
|
-
}
|
|
1056
|
-
})();
|
|
1057
|
-
if (obj_label_union1_error != null) {
|
|
1058
|
-
obj_label_union1 = obj_label_union1_error.message;
|
|
1059
|
-
}
|
|
1060
|
-
if (obj_label_union0 && obj_label_union1) {
|
|
1061
|
-
let message = 'Object doesn\'t match union (at "' + path_label + '")';
|
|
1062
|
-
message += '\n' + obj_label_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1063
|
-
message += '\n' + obj_label_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1064
|
-
return new TypeError(message);
|
|
1065
|
-
}
|
|
1054
|
+
const obj_lastPublishedDate = obj.lastPublishedDate;
|
|
1055
|
+
const path_lastPublishedDate = path + '.lastPublishedDate';
|
|
1056
|
+
if (typeof obj_lastPublishedDate !== 'string') {
|
|
1057
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastPublishedDate + '" (at "' + path_lastPublishedDate + '")');
|
|
1066
1058
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
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
|
-
}
|
|
1059
|
+
const obj_summary = obj.summary;
|
|
1060
|
+
const path_summary = path + '.summary';
|
|
1061
|
+
if (typeof obj_summary !== 'string') {
|
|
1062
|
+
return new TypeError('Expected "string" but received "' + typeof obj_summary + '" (at "' + path_summary + '")');
|
|
1063
|
+
}
|
|
1064
|
+
const obj_title = obj.title;
|
|
1065
|
+
const path_title = path + '.title';
|
|
1066
|
+
if (typeof obj_title !== 'string') {
|
|
1067
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
1068
|
+
}
|
|
1069
|
+
const obj_urlName = obj.urlName;
|
|
1070
|
+
const path_urlName = path + '.urlName';
|
|
1071
|
+
if (typeof obj_urlName !== 'string') {
|
|
1072
|
+
return new TypeError('Expected "string" but received "' + typeof obj_urlName + '" (at "' + path_urlName + '")');
|
|
1094
1073
|
}
|
|
1095
1074
|
})();
|
|
1096
1075
|
return v_error === undefined ? null : v_error;
|
|
1097
1076
|
}
|
|
1098
|
-
const select$
|
|
1077
|
+
const select$a = function LightningKnowledgeArticleVersionRepresentationSelect() {
|
|
1099
1078
|
return {
|
|
1100
1079
|
kind: 'Fragment',
|
|
1101
|
-
version: VERSION$
|
|
1080
|
+
version: VERSION$5,
|
|
1102
1081
|
private: [],
|
|
1103
1082
|
selections: [
|
|
1104
1083
|
{
|
|
1105
|
-
name: '
|
|
1106
|
-
kind: 'Scalar',
|
|
1107
|
-
required: false
|
|
1108
|
-
},
|
|
1109
|
-
{
|
|
1110
|
-
name: 'categoryName',
|
|
1084
|
+
name: 'id',
|
|
1111
1085
|
kind: 'Scalar'
|
|
1112
1086
|
},
|
|
1113
1087
|
{
|
|
1114
|
-
name: '
|
|
1115
|
-
kind: '
|
|
1116
|
-
// any
|
|
1117
|
-
},
|
|
1118
|
-
{
|
|
1119
|
-
name: 'description',
|
|
1120
|
-
kind: 'Scalar',
|
|
1121
|
-
required: false
|
|
1088
|
+
name: 'knowledgeArticleId',
|
|
1089
|
+
kind: 'Scalar'
|
|
1122
1090
|
},
|
|
1123
1091
|
{
|
|
1124
|
-
name: '
|
|
1092
|
+
name: 'lastPublishedDate',
|
|
1125
1093
|
kind: 'Scalar'
|
|
1126
1094
|
},
|
|
1127
1095
|
{
|
|
1128
|
-
name: '
|
|
1129
|
-
kind: 'Scalar'
|
|
1130
|
-
required: false
|
|
1096
|
+
name: 'summary',
|
|
1097
|
+
kind: 'Scalar'
|
|
1131
1098
|
},
|
|
1132
1099
|
{
|
|
1133
|
-
name: '
|
|
1134
|
-
kind: 'Scalar'
|
|
1135
|
-
required: false
|
|
1100
|
+
name: 'title',
|
|
1101
|
+
kind: 'Scalar'
|
|
1136
1102
|
},
|
|
1137
1103
|
{
|
|
1138
|
-
name: '
|
|
1139
|
-
kind: 'Scalar'
|
|
1140
|
-
required: false
|
|
1104
|
+
name: 'urlName',
|
|
1105
|
+
kind: 'Scalar'
|
|
1141
1106
|
}
|
|
1142
1107
|
]
|
|
1143
1108
|
};
|
|
1144
1109
|
};
|
|
1145
|
-
function equals$
|
|
1146
|
-
const existing_categoryName = existing.categoryName;
|
|
1147
|
-
const incoming_categoryName = incoming.categoryName;
|
|
1148
|
-
if (!(existing_categoryName === incoming_categoryName)) {
|
|
1149
|
-
return false;
|
|
1150
|
-
}
|
|
1110
|
+
function equals$5(existing, incoming) {
|
|
1151
1111
|
const existing_id = existing.id;
|
|
1152
1112
|
const incoming_id = incoming.id;
|
|
1153
1113
|
if (!(existing_id === incoming_id)) {
|
|
1154
1114
|
return false;
|
|
1155
1115
|
}
|
|
1156
|
-
const
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1116
|
+
const existing_knowledgeArticleId = existing.knowledgeArticleId;
|
|
1117
|
+
const incoming_knowledgeArticleId = incoming.knowledgeArticleId;
|
|
1118
|
+
if (!(existing_knowledgeArticleId === incoming_knowledgeArticleId)) {
|
|
1119
|
+
return false;
|
|
1120
|
+
}
|
|
1121
|
+
const existing_lastPublishedDate = existing.lastPublishedDate;
|
|
1122
|
+
const incoming_lastPublishedDate = incoming.lastPublishedDate;
|
|
1123
|
+
if (!(existing_lastPublishedDate === incoming_lastPublishedDate)) {
|
|
1124
|
+
return false;
|
|
1125
|
+
}
|
|
1126
|
+
const existing_summary = existing.summary;
|
|
1127
|
+
const incoming_summary = incoming.summary;
|
|
1128
|
+
if (!(existing_summary === incoming_summary)) {
|
|
1129
|
+
return false;
|
|
1130
|
+
}
|
|
1131
|
+
const existing_title = existing.title;
|
|
1132
|
+
const incoming_title = incoming.title;
|
|
1133
|
+
if (!(existing_title === incoming_title)) {
|
|
1134
|
+
return false;
|
|
1135
|
+
}
|
|
1136
|
+
const existing_urlName = existing.urlName;
|
|
1137
|
+
const incoming_urlName = incoming.urlName;
|
|
1138
|
+
if (!(existing_urlName === incoming_urlName)) {
|
|
1139
|
+
return false;
|
|
1140
|
+
}
|
|
1141
|
+
return true;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
const VERSION$4 = "89a6fdc1ed7c0b0e7bd5980d6fdecf09";
|
|
1145
|
+
function validate$5(obj, path = 'LightningKnowledgeArticleVersionCollectionRepresentation') {
|
|
1146
|
+
const v_error = (() => {
|
|
1147
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1148
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1164
1149
|
}
|
|
1165
|
-
|
|
1166
|
-
|
|
1150
|
+
const obj_items = obj.items;
|
|
1151
|
+
const path_items = path + '.items';
|
|
1152
|
+
if (!ArrayIsArray(obj_items)) {
|
|
1153
|
+
return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
|
|
1167
1154
|
}
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1155
|
+
for (let i = 0; i < obj_items.length; i++) {
|
|
1156
|
+
const obj_items_item = obj_items[i];
|
|
1157
|
+
const path_items_item = path_items + '[' + i + ']';
|
|
1158
|
+
const referencepath_items_itemValidationError = validate$6(obj_items_item, path_items_item);
|
|
1159
|
+
if (referencepath_items_itemValidationError !== null) {
|
|
1160
|
+
let message = 'Object doesn\'t match LightningKnowledgeArticleVersionRepresentation (at "' + path_items_item + '")\n';
|
|
1161
|
+
message += referencepath_items_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1162
|
+
return new TypeError(message);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
})();
|
|
1166
|
+
return v_error === undefined ? null : v_error;
|
|
1167
|
+
}
|
|
1168
|
+
const RepresentationType$4 = 'LightningKnowledgeArticleVersionCollectionRepresentation';
|
|
1169
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
1170
|
+
return input;
|
|
1171
|
+
}
|
|
1172
|
+
const select$9 = function LightningKnowledgeArticleVersionCollectionRepresentationSelect() {
|
|
1173
|
+
const { selections: LightningKnowledgeArticleVersionRepresentation__selections, opaque: LightningKnowledgeArticleVersionRepresentation__opaque, } = select$a();
|
|
1174
|
+
return {
|
|
1175
|
+
kind: 'Fragment',
|
|
1176
|
+
version: VERSION$4,
|
|
1177
|
+
private: [],
|
|
1178
|
+
selections: [
|
|
1179
|
+
{
|
|
1180
|
+
name: 'items',
|
|
1181
|
+
kind: 'Object',
|
|
1182
|
+
plural: true,
|
|
1183
|
+
selections: LightningKnowledgeArticleVersionRepresentation__selections
|
|
1184
|
+
}
|
|
1185
|
+
]
|
|
1186
|
+
};
|
|
1187
|
+
};
|
|
1188
|
+
function equals$4(existing, incoming) {
|
|
1189
|
+
const existing_items = existing.items;
|
|
1190
|
+
const incoming_items = incoming.items;
|
|
1191
|
+
const equals_items_items = equalsArray(existing_items, incoming_items, (existing_items_item, incoming_items_item) => {
|
|
1192
|
+
if (!(equals$5(existing_items_item, incoming_items_item))) {
|
|
1173
1193
|
return false;
|
|
1174
1194
|
}
|
|
1175
1195
|
});
|
|
1176
|
-
if (
|
|
1196
|
+
if (equals_items_items === false) {
|
|
1177
1197
|
return false;
|
|
1178
1198
|
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
if (
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
return false;
|
|
1187
|
-
}
|
|
1188
|
-
if (!(existing_description === incoming_description)) {
|
|
1189
|
-
return false;
|
|
1199
|
+
return true;
|
|
1200
|
+
}
|
|
1201
|
+
const ingest$4 = function LightningKnowledgeArticleVersionCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1202
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1203
|
+
const validateError = validate$5(input);
|
|
1204
|
+
if (validateError !== null) {
|
|
1205
|
+
throw validateError;
|
|
1190
1206
|
}
|
|
1191
1207
|
}
|
|
1192
|
-
const
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1208
|
+
const key = path.fullPath;
|
|
1209
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
1210
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "NetworkDataCategory", VERSION$4, RepresentationType$4, equals$4);
|
|
1211
|
+
return createLink(key);
|
|
1212
|
+
};
|
|
1213
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
1214
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1215
|
+
const rootKey = fullPathFactory();
|
|
1216
|
+
rootKeySet.set(rootKey, {
|
|
1217
|
+
namespace: keyPrefix,
|
|
1218
|
+
representationName: RepresentationType$4,
|
|
1219
|
+
mergeable: false
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
function select$8(luvio, params) {
|
|
1224
|
+
return select$9();
|
|
1225
|
+
}
|
|
1226
|
+
function keyBuilder$9(luvio, params) {
|
|
1227
|
+
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 + ')';
|
|
1228
|
+
}
|
|
1229
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
1230
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$9(luvio, resourceParams));
|
|
1231
|
+
}
|
|
1232
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
1233
|
+
const { body } = response;
|
|
1234
|
+
const key = keyBuilder$9(luvio, resourceParams);
|
|
1235
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
1236
|
+
const snapshot = luvio.storeLookup({
|
|
1237
|
+
recordId: key,
|
|
1238
|
+
node: select$8(),
|
|
1239
|
+
variables: {},
|
|
1240
|
+
}, snapshotRefresh);
|
|
1241
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1242
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1243
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1203
1244
|
}
|
|
1204
1245
|
}
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1246
|
+
deepFreeze(snapshot.data);
|
|
1247
|
+
return snapshot;
|
|
1248
|
+
}
|
|
1249
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
1250
|
+
const key = keyBuilder$9(luvio, params);
|
|
1251
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1252
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1253
|
+
return errorSnapshot;
|
|
1254
|
+
}
|
|
1255
|
+
function createResourceRequest$4(config) {
|
|
1256
|
+
const headers = {};
|
|
1257
|
+
return {
|
|
1258
|
+
baseUri: '/services/data/v60.0',
|
|
1259
|
+
basePath: '/connect/communities/' + config.urlParams.communityId + '/network-data-category/' + config.urlParams.networkDataCategoryId + '/knowledge-article',
|
|
1260
|
+
method: 'get',
|
|
1261
|
+
body: null,
|
|
1262
|
+
urlParams: config.urlParams,
|
|
1263
|
+
queryParams: config.queryParams,
|
|
1264
|
+
headers,
|
|
1265
|
+
priority: 'normal',
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
const adapterName$4 = 'getArticlesForCategory';
|
|
1270
|
+
const getArticlesForCategory_ConfigPropertyMetadata = [
|
|
1271
|
+
generateParamConfigMetadata('networkDataCategoryId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1272
|
+
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1273
|
+
generateParamConfigMetadata('language', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1274
|
+
generateParamConfigMetadata('pageNumber', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1275
|
+
generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1276
|
+
generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1277
|
+
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1278
|
+
];
|
|
1279
|
+
const getArticlesForCategory_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getArticlesForCategory_ConfigPropertyMetadata);
|
|
1280
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$8(getArticlesForCategory_ConfigPropertyMetadata);
|
|
1281
|
+
function keyBuilder$8(luvio, config) {
|
|
1282
|
+
const resourceParams = createResourceParams$4(config);
|
|
1283
|
+
return keyBuilder$9(luvio, resourceParams);
|
|
1284
|
+
}
|
|
1285
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1286
|
+
const config = {};
|
|
1287
|
+
typeCheckConfig$8(untrustedConfig, config, getArticlesForCategory_ConfigPropertyMetadata);
|
|
1288
|
+
return config;
|
|
1289
|
+
}
|
|
1290
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1291
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1292
|
+
return null;
|
|
1217
1293
|
}
|
|
1218
|
-
|
|
1219
|
-
|
|
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
|
-
}
|
|
1294
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1295
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1230
1296
|
}
|
|
1231
|
-
|
|
1297
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1298
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1299
|
+
return null;
|
|
1300
|
+
}
|
|
1301
|
+
return config;
|
|
1302
|
+
}
|
|
1303
|
+
function adapterFragment$3(luvio, config) {
|
|
1304
|
+
createResourceParams$4(config);
|
|
1305
|
+
return select$8();
|
|
1306
|
+
}
|
|
1307
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
1308
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
1309
|
+
config,
|
|
1310
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1311
|
+
});
|
|
1312
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1313
|
+
}
|
|
1314
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
1315
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
1316
|
+
config,
|
|
1317
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1318
|
+
});
|
|
1319
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1320
|
+
}
|
|
1321
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
1322
|
+
const resourceParams = createResourceParams$4(config);
|
|
1323
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1324
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1325
|
+
.then((response) => {
|
|
1326
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
1327
|
+
const cache = new StoreKeyMap();
|
|
1328
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
1329
|
+
return cache;
|
|
1330
|
+
});
|
|
1331
|
+
}, (response) => {
|
|
1332
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
1336
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
1232
1337
|
}
|
|
1338
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
1339
|
+
const { luvio, config } = context;
|
|
1340
|
+
const selector = {
|
|
1341
|
+
recordId: keyBuilder$8(luvio, config),
|
|
1342
|
+
node: adapterFragment$3(luvio, config),
|
|
1343
|
+
variables: {},
|
|
1344
|
+
};
|
|
1345
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1346
|
+
config,
|
|
1347
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1348
|
+
});
|
|
1349
|
+
return cacheSnapshot;
|
|
1350
|
+
}
|
|
1351
|
+
const getArticlesForCategoryAdapterFactory = (luvio) => function NetworkDataCategory__getArticlesForCategory(untrustedConfig, requestContext) {
|
|
1352
|
+
const config = validateAdapterConfig$4(untrustedConfig, getArticlesForCategory_ConfigPropertyNames);
|
|
1353
|
+
// Invalid or incomplete config
|
|
1354
|
+
if (config === null) {
|
|
1355
|
+
return null;
|
|
1356
|
+
}
|
|
1357
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1358
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
1359
|
+
};
|
|
1233
1360
|
|
|
1234
|
-
const VERSION$3 = "
|
|
1361
|
+
const VERSION$3 = "a632e4b22d40a2cfc312f36451d5319a";
|
|
1235
1362
|
function validate$4(obj, path = 'NetworkDataCategoryCollectionRepresentation') {
|
|
1236
1363
|
const v_error = (() => {
|
|
1237
1364
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -1245,22 +1372,34 @@ function validate$4(obj, path = 'NetworkDataCategoryCollectionRepresentation') {
|
|
|
1245
1372
|
for (let i = 0; i < obj_networkDataCategories.length; i++) {
|
|
1246
1373
|
const obj_networkDataCategories_item = obj_networkDataCategories[i];
|
|
1247
1374
|
const path_networkDataCategories_item = path_networkDataCategories + '[' + i + ']';
|
|
1248
|
-
|
|
1249
|
-
|
|
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);
|
|
1375
|
+
if (typeof obj_networkDataCategories_item !== 'object') {
|
|
1376
|
+
return new TypeError('Expected "object" but received "' + typeof obj_networkDataCategories_item + '" (at "' + path_networkDataCategories_item + '")');
|
|
1253
1377
|
}
|
|
1254
1378
|
}
|
|
1255
1379
|
})();
|
|
1256
1380
|
return v_error === undefined ? null : v_error;
|
|
1257
1381
|
}
|
|
1258
|
-
const RepresentationType$
|
|
1259
|
-
function normalize$
|
|
1382
|
+
const RepresentationType$3 = 'NetworkDataCategoryCollectionRepresentation';
|
|
1383
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1384
|
+
const input_networkDataCategories = input.networkDataCategories;
|
|
1385
|
+
const input_networkDataCategories_id = path.fullPath + '__networkDataCategories';
|
|
1386
|
+
for (let i = 0; i < input_networkDataCategories.length; i++) {
|
|
1387
|
+
const input_networkDataCategories_item = input_networkDataCategories[i];
|
|
1388
|
+
let input_networkDataCategories_item_id = input_networkDataCategories_id + '__' + i;
|
|
1389
|
+
input_networkDataCategories[i] = ingest$5(input_networkDataCategories_item, {
|
|
1390
|
+
fullPath: input_networkDataCategories_item_id,
|
|
1391
|
+
propertyName: i,
|
|
1392
|
+
parent: {
|
|
1393
|
+
data: input,
|
|
1394
|
+
key: path.fullPath,
|
|
1395
|
+
existing: existing,
|
|
1396
|
+
},
|
|
1397
|
+
ttl: path.ttl
|
|
1398
|
+
}, luvio, store, timestamp);
|
|
1399
|
+
}
|
|
1260
1400
|
return input;
|
|
1261
1401
|
}
|
|
1262
1402
|
const select$7 = function NetworkDataCategoryCollectionRepresentationSelect() {
|
|
1263
|
-
const { selections: NetworkDataCategoryRepresentation__selections, opaque: NetworkDataCategoryRepresentation__opaque, } = select$8();
|
|
1264
1403
|
return {
|
|
1265
1404
|
kind: 'Fragment',
|
|
1266
1405
|
version: VERSION$3,
|
|
@@ -1268,9 +1407,9 @@ const select$7 = function NetworkDataCategoryCollectionRepresentationSelect() {
|
|
|
1268
1407
|
selections: [
|
|
1269
1408
|
{
|
|
1270
1409
|
name: 'networkDataCategories',
|
|
1271
|
-
kind: '
|
|
1410
|
+
kind: 'Link',
|
|
1272
1411
|
plural: true,
|
|
1273
|
-
|
|
1412
|
+
fragment: select$d()
|
|
1274
1413
|
}
|
|
1275
1414
|
]
|
|
1276
1415
|
};
|
|
@@ -1279,7 +1418,7 @@ function equals$3(existing, incoming) {
|
|
|
1279
1418
|
const existing_networkDataCategories = existing.networkDataCategories;
|
|
1280
1419
|
const incoming_networkDataCategories = incoming.networkDataCategories;
|
|
1281
1420
|
const equals_networkDataCategories_items = equalsArray(existing_networkDataCategories, incoming_networkDataCategories, (existing_networkDataCategories_item, incoming_networkDataCategories_item) => {
|
|
1282
|
-
if (!(
|
|
1421
|
+
if (!(existing_networkDataCategories_item.__ref === incoming_networkDataCategories_item.__ref)) {
|
|
1283
1422
|
return false;
|
|
1284
1423
|
}
|
|
1285
1424
|
});
|
|
@@ -1288,7 +1427,7 @@ function equals$3(existing, incoming) {
|
|
|
1288
1427
|
}
|
|
1289
1428
|
return true;
|
|
1290
1429
|
}
|
|
1291
|
-
const ingest$
|
|
1430
|
+
const ingest$3 = function NetworkDataCategoryCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1292
1431
|
if (process.env.NODE_ENV !== 'production') {
|
|
1293
1432
|
const validateError = validate$4(input);
|
|
1294
1433
|
if (validateError !== null) {
|
|
@@ -1297,17 +1436,21 @@ const ingest$2 = function NetworkDataCategoryCollectionRepresentationIngest(inpu
|
|
|
1297
1436
|
}
|
|
1298
1437
|
const key = path.fullPath;
|
|
1299
1438
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
1300
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1439
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "NetworkDataCategory", VERSION$3, RepresentationType$3, equals$3);
|
|
1301
1440
|
return createLink(key);
|
|
1302
1441
|
};
|
|
1303
|
-
function getTypeCacheKeys$
|
|
1442
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
1304
1443
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1305
1444
|
const rootKey = fullPathFactory();
|
|
1306
1445
|
rootKeySet.set(rootKey, {
|
|
1307
1446
|
namespace: keyPrefix,
|
|
1308
|
-
representationName: RepresentationType$
|
|
1447
|
+
representationName: RepresentationType$3,
|
|
1309
1448
|
mergeable: false
|
|
1310
1449
|
});
|
|
1450
|
+
const input_networkDataCategories_length = input.networkDataCategories.length;
|
|
1451
|
+
for (let i = 0; i < input_networkDataCategories_length; i++) {
|
|
1452
|
+
getTypeCacheKeys$5(rootKeySet, luvio, input.networkDataCategories[i]);
|
|
1453
|
+
}
|
|
1311
1454
|
}
|
|
1312
1455
|
|
|
1313
1456
|
function select$6(luvio, params) {
|
|
@@ -1317,12 +1460,12 @@ function keyBuilder$7(luvio, params) {
|
|
|
1317
1460
|
return keyPrefix + '::NetworkDataCategoryCollectionRepresentation:(' + 'language:' + params.queryParams.language + ',' + 'communityId:' + params.urlParams.communityId + ',' + 'networkDataCategoryId:' + params.urlParams.networkDataCategoryId + ')';
|
|
1318
1461
|
}
|
|
1319
1462
|
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1320
|
-
getTypeCacheKeys$
|
|
1463
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$7(luvio, resourceParams));
|
|
1321
1464
|
}
|
|
1322
1465
|
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
1323
1466
|
const { body } = response;
|
|
1324
1467
|
const key = keyBuilder$7(luvio, resourceParams);
|
|
1325
|
-
luvio.storeIngest(key, ingest$
|
|
1468
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
1326
1469
|
const snapshot = luvio.storeLookup({
|
|
1327
1470
|
recordId: key,
|
|
1328
1471
|
node: select$6(),
|
|
@@ -1363,14 +1506,14 @@ const getParentNetworkDataCategoryPath_ConfigPropertyMetadata = [
|
|
|
1363
1506
|
generateParamConfigMetadata('language', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1364
1507
|
];
|
|
1365
1508
|
const getParentNetworkDataCategoryPath_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getParentNetworkDataCategoryPath_ConfigPropertyMetadata);
|
|
1366
|
-
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$
|
|
1509
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$8(getParentNetworkDataCategoryPath_ConfigPropertyMetadata);
|
|
1367
1510
|
function keyBuilder$6(luvio, config) {
|
|
1368
1511
|
const resourceParams = createResourceParams$3(config);
|
|
1369
1512
|
return keyBuilder$7(luvio, resourceParams);
|
|
1370
1513
|
}
|
|
1371
1514
|
function typeCheckConfig$3(untrustedConfig) {
|
|
1372
1515
|
const config = {};
|
|
1373
|
-
typeCheckConfig$
|
|
1516
|
+
typeCheckConfig$8(untrustedConfig, config, getParentNetworkDataCategoryPath_ConfigPropertyMetadata);
|
|
1374
1517
|
return config;
|
|
1375
1518
|
}
|
|
1376
1519
|
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
@@ -1451,12 +1594,12 @@ function keyBuilder$5(luvio, params) {
|
|
|
1451
1594
|
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
1595
|
}
|
|
1453
1596
|
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
1454
|
-
getTypeCacheKeys$
|
|
1597
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
1455
1598
|
}
|
|
1456
1599
|
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
1457
1600
|
const { body } = response;
|
|
1458
1601
|
const key = keyBuilder$5(luvio, resourceParams);
|
|
1459
|
-
luvio.storeIngest(key, ingest$
|
|
1602
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
1460
1603
|
const snapshot = luvio.storeLookup({
|
|
1461
1604
|
recordId: key,
|
|
1462
1605
|
node: select$5(),
|
|
@@ -1501,14 +1644,14 @@ const getChildCategories_ConfigPropertyMetadata = [
|
|
|
1501
1644
|
generateParamConfigMetadata('sortedBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1502
1645
|
];
|
|
1503
1646
|
const getChildCategories_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getChildCategories_ConfigPropertyMetadata);
|
|
1504
|
-
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$
|
|
1647
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$8(getChildCategories_ConfigPropertyMetadata);
|
|
1505
1648
|
function keyBuilder$4(luvio, config) {
|
|
1506
1649
|
const resourceParams = createResourceParams$2(config);
|
|
1507
1650
|
return keyBuilder$5(luvio, resourceParams);
|
|
1508
1651
|
}
|
|
1509
1652
|
function typeCheckConfig$2(untrustedConfig) {
|
|
1510
1653
|
const config = {};
|
|
1511
|
-
typeCheckConfig$
|
|
1654
|
+
typeCheckConfig$8(untrustedConfig, config, getChildCategories_ConfigPropertyMetadata);
|
|
1512
1655
|
return config;
|
|
1513
1656
|
}
|
|
1514
1657
|
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
@@ -1582,7 +1725,7 @@ const getChildCategoriesAdapterFactory = (luvio) => function NetworkDataCategory
|
|
|
1582
1725
|
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1583
1726
|
};
|
|
1584
1727
|
|
|
1585
|
-
const VERSION$2 = "
|
|
1728
|
+
const VERSION$2 = "15c619f1c41ed55ac3d19e24eb94542b";
|
|
1586
1729
|
function validate$3(obj, path = 'NetworkDataCategoryGroupRepresentation') {
|
|
1587
1730
|
const v_error = (() => {
|
|
1588
1731
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -1593,42 +1736,31 @@ function validate$3(obj, path = 'NetworkDataCategoryGroupRepresentation') {
|
|
|
1593
1736
|
if (typeof obj_categoryGroupName !== 'string') {
|
|
1594
1737
|
return new TypeError('Expected "string" but received "' + typeof obj_categoryGroupName + '" (at "' + path_categoryGroupName + '")');
|
|
1595
1738
|
}
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
const obj_rootCategory_union0_error = (() => {
|
|
1601
|
-
const referencepath_rootCategoryValidationError = validate$5(obj_rootCategory, path_rootCategory);
|
|
1602
|
-
if (referencepath_rootCategoryValidationError !== null) {
|
|
1603
|
-
let message = 'Object doesn\'t match NetworkDataCategoryRepresentation (at "' + path_rootCategory + '")\n';
|
|
1604
|
-
message += referencepath_rootCategoryValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1605
|
-
return new TypeError(message);
|
|
1606
|
-
}
|
|
1607
|
-
})();
|
|
1608
|
-
if (obj_rootCategory_union0_error != null) {
|
|
1609
|
-
obj_rootCategory_union0 = obj_rootCategory_union0_error.message;
|
|
1610
|
-
}
|
|
1611
|
-
let obj_rootCategory_union1 = null;
|
|
1612
|
-
const obj_rootCategory_union1_error = (() => {
|
|
1613
|
-
if (obj_rootCategory !== null) {
|
|
1614
|
-
return new TypeError('Expected "null" but received "' + typeof obj_rootCategory + '" (at "' + path_rootCategory + '")');
|
|
1615
|
-
}
|
|
1616
|
-
})();
|
|
1617
|
-
if (obj_rootCategory_union1_error != null) {
|
|
1618
|
-
obj_rootCategory_union1 = obj_rootCategory_union1_error.message;
|
|
1619
|
-
}
|
|
1620
|
-
if (obj_rootCategory_union0 && obj_rootCategory_union1) {
|
|
1621
|
-
let message = 'Object doesn\'t match union (at "' + path_rootCategory + '")';
|
|
1622
|
-
message += '\n' + obj_rootCategory_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1623
|
-
message += '\n' + obj_rootCategory_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1624
|
-
return new TypeError(message);
|
|
1625
|
-
}
|
|
1739
|
+
const obj_rootCategory = obj.rootCategory;
|
|
1740
|
+
const path_rootCategory = path + '.rootCategory';
|
|
1741
|
+
if (typeof obj_rootCategory !== 'object') {
|
|
1742
|
+
return new TypeError('Expected "object" but received "' + typeof obj_rootCategory + '" (at "' + path_rootCategory + '")');
|
|
1626
1743
|
}
|
|
1627
1744
|
})();
|
|
1628
1745
|
return v_error === undefined ? null : v_error;
|
|
1629
1746
|
}
|
|
1747
|
+
const RepresentationType$2 = 'NetworkDataCategoryGroupRepresentation';
|
|
1748
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1749
|
+
const input_rootCategory = input.rootCategory;
|
|
1750
|
+
const input_rootCategory_id = path.fullPath + '__rootCategory';
|
|
1751
|
+
input.rootCategory = ingest$5(input_rootCategory, {
|
|
1752
|
+
fullPath: input_rootCategory_id,
|
|
1753
|
+
propertyName: 'rootCategory',
|
|
1754
|
+
parent: {
|
|
1755
|
+
data: input,
|
|
1756
|
+
key: path.fullPath,
|
|
1757
|
+
existing: existing,
|
|
1758
|
+
},
|
|
1759
|
+
ttl: path.ttl
|
|
1760
|
+
}, luvio, store, timestamp);
|
|
1761
|
+
return input;
|
|
1762
|
+
}
|
|
1630
1763
|
const select$4 = function NetworkDataCategoryGroupRepresentationSelect() {
|
|
1631
|
-
const { selections: NetworkDataCategoryRepresentation__selections, opaque: NetworkDataCategoryRepresentation__opaque, } = select$8();
|
|
1632
1764
|
return {
|
|
1633
1765
|
kind: 'Fragment',
|
|
1634
1766
|
version: VERSION$2,
|
|
@@ -1640,10 +1772,8 @@ const select$4 = function NetworkDataCategoryGroupRepresentationSelect() {
|
|
|
1640
1772
|
},
|
|
1641
1773
|
{
|
|
1642
1774
|
name: 'rootCategory',
|
|
1643
|
-
kind: '
|
|
1644
|
-
|
|
1645
|
-
selections: NetworkDataCategoryRepresentation__selections,
|
|
1646
|
-
required: false
|
|
1775
|
+
kind: 'Link',
|
|
1776
|
+
fragment: select$d()
|
|
1647
1777
|
}
|
|
1648
1778
|
]
|
|
1649
1779
|
};
|
|
@@ -1656,24 +1786,35 @@ function equals$2(existing, incoming) {
|
|
|
1656
1786
|
}
|
|
1657
1787
|
const existing_rootCategory = existing.rootCategory;
|
|
1658
1788
|
const incoming_rootCategory = incoming.rootCategory;
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
// if one of these is not defined we know the other is defined and therefore
|
|
1662
|
-
// not equal
|
|
1663
|
-
if (existing_rootCategory === undefined || incoming_rootCategory === undefined) {
|
|
1664
|
-
return false;
|
|
1665
|
-
}
|
|
1666
|
-
if (!(existing_rootCategory === incoming_rootCategory
|
|
1667
|
-
|| (existing_rootCategory != null &&
|
|
1668
|
-
incoming_rootCategory != null &&
|
|
1669
|
-
equals$4(existing_rootCategory, incoming_rootCategory)))) {
|
|
1670
|
-
return false;
|
|
1671
|
-
}
|
|
1789
|
+
if (!(existing_rootCategory.__ref === incoming_rootCategory.__ref)) {
|
|
1790
|
+
return false;
|
|
1672
1791
|
}
|
|
1673
1792
|
return true;
|
|
1674
1793
|
}
|
|
1794
|
+
const ingest$2 = function NetworkDataCategoryGroupRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1795
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1796
|
+
const validateError = validate$3(input);
|
|
1797
|
+
if (validateError !== null) {
|
|
1798
|
+
throw validateError;
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
const key = path.fullPath;
|
|
1802
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 900000;
|
|
1803
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "NetworkDataCategory", VERSION$2, RepresentationType$2, equals$2);
|
|
1804
|
+
return createLink(key);
|
|
1805
|
+
};
|
|
1806
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1807
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1808
|
+
const rootKey = fullPathFactory();
|
|
1809
|
+
rootKeySet.set(rootKey, {
|
|
1810
|
+
namespace: keyPrefix,
|
|
1811
|
+
representationName: RepresentationType$2,
|
|
1812
|
+
mergeable: false
|
|
1813
|
+
});
|
|
1814
|
+
getTypeCacheKeys$5(rootKeySet, luvio, input.rootCategory);
|
|
1815
|
+
}
|
|
1675
1816
|
|
|
1676
|
-
const VERSION$1 = "
|
|
1817
|
+
const VERSION$1 = "5e66b8759100556a58fea2ff97dab767";
|
|
1677
1818
|
function validate$2(obj, path = 'NetworkDataCategoryTreeRepresentation') {
|
|
1678
1819
|
const v_error = (() => {
|
|
1679
1820
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -1692,11 +1833,8 @@ function validate$2(obj, path = 'NetworkDataCategoryTreeRepresentation') {
|
|
|
1692
1833
|
for (let i = 0; i < obj_dataCategoryGroups.length; i++) {
|
|
1693
1834
|
const obj_dataCategoryGroups_item = obj_dataCategoryGroups[i];
|
|
1694
1835
|
const path_dataCategoryGroups_item = path_dataCategoryGroups + '[' + i + ']';
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
let message = 'Object doesn\'t match NetworkDataCategoryGroupRepresentation (at "' + path_dataCategoryGroups_item + '")\n';
|
|
1698
|
-
message += referencepath_dataCategoryGroups_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1699
|
-
return new TypeError(message);
|
|
1836
|
+
if (typeof obj_dataCategoryGroups_item !== 'object') {
|
|
1837
|
+
return new TypeError('Expected "object" but received "' + typeof obj_dataCategoryGroups_item + '" (at "' + path_dataCategoryGroups_item + '")');
|
|
1700
1838
|
}
|
|
1701
1839
|
}
|
|
1702
1840
|
})();
|
|
@@ -1713,10 +1851,25 @@ function keyBuilderFromType$1(luvio, object) {
|
|
|
1713
1851
|
return keyBuilder$3(luvio, keyParams);
|
|
1714
1852
|
}
|
|
1715
1853
|
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1854
|
+
const input_dataCategoryGroups = input.dataCategoryGroups;
|
|
1855
|
+
const input_dataCategoryGroups_id = path.fullPath + '__dataCategoryGroups';
|
|
1856
|
+
for (let i = 0; i < input_dataCategoryGroups.length; i++) {
|
|
1857
|
+
const input_dataCategoryGroups_item = input_dataCategoryGroups[i];
|
|
1858
|
+
let input_dataCategoryGroups_item_id = input_dataCategoryGroups_id + '__' + i;
|
|
1859
|
+
input_dataCategoryGroups[i] = ingest$2(input_dataCategoryGroups_item, {
|
|
1860
|
+
fullPath: input_dataCategoryGroups_item_id,
|
|
1861
|
+
propertyName: i,
|
|
1862
|
+
parent: {
|
|
1863
|
+
data: input,
|
|
1864
|
+
key: path.fullPath,
|
|
1865
|
+
existing: existing,
|
|
1866
|
+
},
|
|
1867
|
+
ttl: path.ttl
|
|
1868
|
+
}, luvio, store, timestamp);
|
|
1869
|
+
}
|
|
1716
1870
|
return input;
|
|
1717
1871
|
}
|
|
1718
1872
|
const select$3 = function NetworkDataCategoryTreeRepresentationSelect() {
|
|
1719
|
-
const { selections: NetworkDataCategoryGroupRepresentation__selections, opaque: NetworkDataCategoryGroupRepresentation__opaque, } = select$4();
|
|
1720
1873
|
return {
|
|
1721
1874
|
kind: 'Fragment',
|
|
1722
1875
|
version: VERSION$1,
|
|
@@ -1728,9 +1881,9 @@ const select$3 = function NetworkDataCategoryTreeRepresentationSelect() {
|
|
|
1728
1881
|
},
|
|
1729
1882
|
{
|
|
1730
1883
|
name: 'dataCategoryGroups',
|
|
1731
|
-
kind: '
|
|
1884
|
+
kind: 'Link',
|
|
1732
1885
|
plural: true,
|
|
1733
|
-
|
|
1886
|
+
fragment: select$4()
|
|
1734
1887
|
}
|
|
1735
1888
|
]
|
|
1736
1889
|
};
|
|
@@ -1744,7 +1897,7 @@ function equals$1(existing, incoming) {
|
|
|
1744
1897
|
const existing_dataCategoryGroups = existing.dataCategoryGroups;
|
|
1745
1898
|
const incoming_dataCategoryGroups = incoming.dataCategoryGroups;
|
|
1746
1899
|
const equals_dataCategoryGroups_items = equalsArray(existing_dataCategoryGroups, incoming_dataCategoryGroups, (existing_dataCategoryGroups_item, incoming_dataCategoryGroups_item) => {
|
|
1747
|
-
if (!(
|
|
1900
|
+
if (!(existing_dataCategoryGroups_item.__ref === incoming_dataCategoryGroups_item.__ref)) {
|
|
1748
1901
|
return false;
|
|
1749
1902
|
}
|
|
1750
1903
|
});
|
|
@@ -1773,6 +1926,10 @@ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
1773
1926
|
representationName: RepresentationType$1,
|
|
1774
1927
|
mergeable: false
|
|
1775
1928
|
});
|
|
1929
|
+
const input_dataCategoryGroups_length = input.dataCategoryGroups.length;
|
|
1930
|
+
for (let i = 0; i < input_dataCategoryGroups_length; i++) {
|
|
1931
|
+
getTypeCacheKeys$2(rootKeySet, luvio, input.dataCategoryGroups[i], () => '');
|
|
1932
|
+
}
|
|
1776
1933
|
}
|
|
1777
1934
|
const notifyUpdateAvailableFactory = (luvio) => {
|
|
1778
1935
|
return function notifyNetworkDataCategoryTreeRepresentationUpdateAvailable(configs) {
|
|
@@ -1842,14 +1999,14 @@ const getNetworkDataCategories_ConfigPropertyMetadata = [
|
|
|
1842
1999
|
generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1843
2000
|
];
|
|
1844
2001
|
const getNetworkDataCategories_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getNetworkDataCategories_ConfigPropertyMetadata);
|
|
1845
|
-
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$
|
|
2002
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$8(getNetworkDataCategories_ConfigPropertyMetadata);
|
|
1846
2003
|
function keyBuilder$1(luvio, config) {
|
|
1847
2004
|
const resourceParams = createResourceParams$1(config);
|
|
1848
2005
|
return keyBuilder$2(luvio, resourceParams);
|
|
1849
2006
|
}
|
|
1850
2007
|
function typeCheckConfig$1(untrustedConfig) {
|
|
1851
2008
|
const config = {};
|
|
1852
|
-
typeCheckConfig$
|
|
2009
|
+
typeCheckConfig$8(untrustedConfig, config, getNetworkDataCategories_ConfigPropertyMetadata);
|
|
1853
2010
|
return config;
|
|
1854
2011
|
}
|
|
1855
2012
|
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
@@ -2057,10 +2214,10 @@ const updateNetworkDataCategories_ConfigPropertyMetadata = [
|
|
|
2057
2214
|
generateParamConfigMetadata('networkDataCategoryTree', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2058
2215
|
];
|
|
2059
2216
|
const updateNetworkDataCategories_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateNetworkDataCategories_ConfigPropertyMetadata);
|
|
2060
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
2217
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$8(updateNetworkDataCategories_ConfigPropertyMetadata);
|
|
2061
2218
|
function typeCheckConfig(untrustedConfig) {
|
|
2062
2219
|
const config = {};
|
|
2063
|
-
typeCheckConfig$
|
|
2220
|
+
typeCheckConfig$8(untrustedConfig, config, updateNetworkDataCategories_ConfigPropertyMetadata);
|
|
2064
2221
|
const untrustedConfig_networkDataCategoryTree = untrustedConfig.networkDataCategoryTree;
|
|
2065
2222
|
const referenceDataCategoryGroupCollectionInputRepresentationValidationError = validate$1(untrustedConfig_networkDataCategoryTree);
|
|
2066
2223
|
if (referenceDataCategoryGroupCollectionInputRepresentationValidationError === null) {
|
|
@@ -2110,4 +2267,4 @@ const updateNetworkDataCategoriesAdapterFactory = (luvio) => {
|
|
|
2110
2267
|
};
|
|
2111
2268
|
};
|
|
2112
2269
|
|
|
2113
|
-
export { getArticlesForCategoryAdapterFactory, getChildCategoriesAdapterFactory, getNetworkDataCategoriesAdapterFactory, getParentNetworkDataCategoryPathAdapterFactory, getServiceCatalogItemsAdapterFactory, getServiceCatalogItemsForCommunityAdapterFactory, updateNetworkDataCategoriesAdapterFactory };
|
|
2270
|
+
export { getArticlesForCategoryAdapterFactory, getChildCategoriesAdapterFactory, getNetworkDataCategoriesAdapterFactory, getParentNetworkDataCategoryPathAdapterFactory, getServiceCatalogItemsAdapterFactory, getServiceCatalogItemsForCommunityAdapterFactory, updateNetworkDataCategoriesAdapterFactory, updateNetworkDataCategoryAdapterFactory };
|