@salesforce/lds-adapters-platform-content-taxonomy 1.251.0 → 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.
@@ -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$2, typeCheckConfig as typeCheckConfig$2, StoreKeyMap, createResourceParams as createResourceParams$2 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, typeCheckConfig as typeCheckConfig$5, StoreKeyMap, createResourceParams as createResourceParams$5 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -96,8 +96,29 @@ function validate$4(obj, path = 'ContentTaxonomyUserSummary') {
96
96
  }
97
97
  const obj_url = obj.url;
98
98
  const path_url = path + '.url';
99
- if (typeof obj_url !== 'string') {
100
- return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
99
+ let obj_url_union0 = null;
100
+ const obj_url_union0_error = (() => {
101
+ if (typeof obj_url !== 'string') {
102
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
103
+ }
104
+ })();
105
+ if (obj_url_union0_error != null) {
106
+ obj_url_union0 = obj_url_union0_error.message;
107
+ }
108
+ let obj_url_union1 = null;
109
+ const obj_url_union1_error = (() => {
110
+ if (obj_url !== null) {
111
+ return new TypeError('Expected "null" but received "' + typeof obj_url + '" (at "' + path_url + '")');
112
+ }
113
+ })();
114
+ if (obj_url_union1_error != null) {
115
+ obj_url_union1 = obj_url_union1_error.message;
116
+ }
117
+ if (obj_url_union0 && obj_url_union1) {
118
+ let message = 'Object doesn\'t match union (at "' + path_url + '")';
119
+ message += '\n' + obj_url_union0.split('\n').map((line) => '\t' + line).join('\n');
120
+ message += '\n' + obj_url_union1.split('\n').map((line) => '\t' + line).join('\n');
121
+ return new TypeError(message);
101
122
  }
102
123
  })();
103
124
  return v_error === undefined ? null : v_error;
@@ -160,7 +181,7 @@ function validate$2(obj, path = 'ContentTaxonomyPathRepresentation') {
160
181
  }
161
182
 
162
183
  const TTL$1 = 100;
163
- const VERSION$1 = "35db0293aedefd4b0aa4ed3f95c57f71";
184
+ const VERSION$1 = "9861aac63d27c0ee5c1c0708df316215";
164
185
  function validate$1(obj, path = 'ContentTaxonomyTermRepresentation') {
165
186
  const v_error = (() => {
166
187
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -183,21 +204,84 @@ function validate$1(obj, path = 'ContentTaxonomyTermRepresentation') {
183
204
  }
184
205
  const obj_createdBy = obj.createdBy;
185
206
  const path_createdBy = path + '.createdBy';
186
- const referencepath_createdByValidationError = validate$4(obj_createdBy, path_createdBy);
187
- if (referencepath_createdByValidationError !== null) {
188
- let message = 'Object doesn\'t match ContentTaxonomyUserSummary (at "' + path_createdBy + '")\n';
189
- message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
207
+ let obj_createdBy_union0 = null;
208
+ const obj_createdBy_union0_error = (() => {
209
+ const referencepath_createdByValidationError = validate$4(obj_createdBy, path_createdBy);
210
+ if (referencepath_createdByValidationError !== null) {
211
+ let message = 'Object doesn\'t match ContentTaxonomyUserSummary (at "' + path_createdBy + '")\n';
212
+ message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
213
+ return new TypeError(message);
214
+ }
215
+ })();
216
+ if (obj_createdBy_union0_error != null) {
217
+ obj_createdBy_union0 = obj_createdBy_union0_error.message;
218
+ }
219
+ let obj_createdBy_union1 = null;
220
+ const obj_createdBy_union1_error = (() => {
221
+ if (obj_createdBy !== null) {
222
+ return new TypeError('Expected "null" but received "' + typeof obj_createdBy + '" (at "' + path_createdBy + '")');
223
+ }
224
+ })();
225
+ if (obj_createdBy_union1_error != null) {
226
+ obj_createdBy_union1 = obj_createdBy_union1_error.message;
227
+ }
228
+ if (obj_createdBy_union0 && obj_createdBy_union1) {
229
+ let message = 'Object doesn\'t match union (at "' + path_createdBy + '")';
230
+ message += '\n' + obj_createdBy_union0.split('\n').map((line) => '\t' + line).join('\n');
231
+ message += '\n' + obj_createdBy_union1.split('\n').map((line) => '\t' + line).join('\n');
190
232
  return new TypeError(message);
191
233
  }
192
234
  const obj_createdDate = obj.createdDate;
193
235
  const path_createdDate = path + '.createdDate';
194
- if (typeof obj_createdDate !== 'string') {
195
- return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
236
+ let obj_createdDate_union0 = null;
237
+ const obj_createdDate_union0_error = (() => {
238
+ if (typeof obj_createdDate !== 'string') {
239
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
240
+ }
241
+ })();
242
+ if (obj_createdDate_union0_error != null) {
243
+ obj_createdDate_union0 = obj_createdDate_union0_error.message;
244
+ }
245
+ let obj_createdDate_union1 = null;
246
+ const obj_createdDate_union1_error = (() => {
247
+ if (obj_createdDate !== null) {
248
+ return new TypeError('Expected "null" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
249
+ }
250
+ })();
251
+ if (obj_createdDate_union1_error != null) {
252
+ obj_createdDate_union1 = obj_createdDate_union1_error.message;
253
+ }
254
+ if (obj_createdDate_union0 && obj_createdDate_union1) {
255
+ let message = 'Object doesn\'t match union (at "' + path_createdDate + '")';
256
+ message += '\n' + obj_createdDate_union0.split('\n').map((line) => '\t' + line).join('\n');
257
+ message += '\n' + obj_createdDate_union1.split('\n').map((line) => '\t' + line).join('\n');
258
+ return new TypeError(message);
196
259
  }
197
260
  const obj_description = obj.description;
198
261
  const path_description = path + '.description';
199
- if (typeof obj_description !== 'string') {
200
- return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
262
+ let obj_description_union0 = null;
263
+ const obj_description_union0_error = (() => {
264
+ if (typeof obj_description !== 'string') {
265
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
266
+ }
267
+ })();
268
+ if (obj_description_union0_error != null) {
269
+ obj_description_union0 = obj_description_union0_error.message;
270
+ }
271
+ let obj_description_union1 = null;
272
+ const obj_description_union1_error = (() => {
273
+ if (obj_description !== null) {
274
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
275
+ }
276
+ })();
277
+ if (obj_description_union1_error != null) {
278
+ obj_description_union1 = obj_description_union1_error.message;
279
+ }
280
+ if (obj_description_union0 && obj_description_union1) {
281
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
282
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
283
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
284
+ return new TypeError(message);
201
285
  }
202
286
  const obj_id = obj.id;
203
287
  const path_id = path + '.id';
@@ -206,8 +290,29 @@ function validate$1(obj, path = 'ContentTaxonomyTermRepresentation') {
206
290
  }
207
291
  const obj_isLeafTerm = obj.isLeafTerm;
208
292
  const path_isLeafTerm = path + '.isLeafTerm';
209
- if (typeof obj_isLeafTerm !== 'boolean') {
210
- return new TypeError('Expected "boolean" but received "' + typeof obj_isLeafTerm + '" (at "' + path_isLeafTerm + '")');
293
+ let obj_isLeafTerm_union0 = null;
294
+ const obj_isLeafTerm_union0_error = (() => {
295
+ if (typeof obj_isLeafTerm !== 'boolean') {
296
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isLeafTerm + '" (at "' + path_isLeafTerm + '")');
297
+ }
298
+ })();
299
+ if (obj_isLeafTerm_union0_error != null) {
300
+ obj_isLeafTerm_union0 = obj_isLeafTerm_union0_error.message;
301
+ }
302
+ let obj_isLeafTerm_union1 = null;
303
+ const obj_isLeafTerm_union1_error = (() => {
304
+ if (obj_isLeafTerm !== null) {
305
+ return new TypeError('Expected "null" but received "' + typeof obj_isLeafTerm + '" (at "' + path_isLeafTerm + '")');
306
+ }
307
+ })();
308
+ if (obj_isLeafTerm_union1_error != null) {
309
+ obj_isLeafTerm_union1 = obj_isLeafTerm_union1_error.message;
310
+ }
311
+ if (obj_isLeafTerm_union0 && obj_isLeafTerm_union1) {
312
+ let message = 'Object doesn\'t match union (at "' + path_isLeafTerm + '")';
313
+ message += '\n' + obj_isLeafTerm_union0.split('\n').map((line) => '\t' + line).join('\n');
314
+ message += '\n' + obj_isLeafTerm_union1.split('\n').map((line) => '\t' + line).join('\n');
315
+ return new TypeError(message);
211
316
  }
212
317
  const obj_label = obj.label;
213
318
  const path_label = path + '.label';
@@ -216,16 +321,58 @@ function validate$1(obj, path = 'ContentTaxonomyTermRepresentation') {
216
321
  }
217
322
  const obj_lastModifiedBy = obj.lastModifiedBy;
218
323
  const path_lastModifiedBy = path + '.lastModifiedBy';
219
- const referencepath_lastModifiedByValidationError = validate$4(obj_lastModifiedBy, path_lastModifiedBy);
220
- if (referencepath_lastModifiedByValidationError !== null) {
221
- let message = 'Object doesn\'t match ContentTaxonomyUserSummary (at "' + path_lastModifiedBy + '")\n';
222
- message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
324
+ let obj_lastModifiedBy_union0 = null;
325
+ const obj_lastModifiedBy_union0_error = (() => {
326
+ const referencepath_lastModifiedByValidationError = validate$4(obj_lastModifiedBy, path_lastModifiedBy);
327
+ if (referencepath_lastModifiedByValidationError !== null) {
328
+ let message = 'Object doesn\'t match ContentTaxonomyUserSummary (at "' + path_lastModifiedBy + '")\n';
329
+ message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
330
+ return new TypeError(message);
331
+ }
332
+ })();
333
+ if (obj_lastModifiedBy_union0_error != null) {
334
+ obj_lastModifiedBy_union0 = obj_lastModifiedBy_union0_error.message;
335
+ }
336
+ let obj_lastModifiedBy_union1 = null;
337
+ const obj_lastModifiedBy_union1_error = (() => {
338
+ if (obj_lastModifiedBy !== null) {
339
+ return new TypeError('Expected "null" but received "' + typeof obj_lastModifiedBy + '" (at "' + path_lastModifiedBy + '")');
340
+ }
341
+ })();
342
+ if (obj_lastModifiedBy_union1_error != null) {
343
+ obj_lastModifiedBy_union1 = obj_lastModifiedBy_union1_error.message;
344
+ }
345
+ if (obj_lastModifiedBy_union0 && obj_lastModifiedBy_union1) {
346
+ let message = 'Object doesn\'t match union (at "' + path_lastModifiedBy + '")';
347
+ message += '\n' + obj_lastModifiedBy_union0.split('\n').map((line) => '\t' + line).join('\n');
348
+ message += '\n' + obj_lastModifiedBy_union1.split('\n').map((line) => '\t' + line).join('\n');
223
349
  return new TypeError(message);
224
350
  }
225
351
  const obj_lastModifiedDate = obj.lastModifiedDate;
226
352
  const path_lastModifiedDate = path + '.lastModifiedDate';
227
- if (typeof obj_lastModifiedDate !== 'string') {
228
- return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
353
+ let obj_lastModifiedDate_union0 = null;
354
+ const obj_lastModifiedDate_union0_error = (() => {
355
+ if (typeof obj_lastModifiedDate !== 'string') {
356
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
357
+ }
358
+ })();
359
+ if (obj_lastModifiedDate_union0_error != null) {
360
+ obj_lastModifiedDate_union0 = obj_lastModifiedDate_union0_error.message;
361
+ }
362
+ let obj_lastModifiedDate_union1 = null;
363
+ const obj_lastModifiedDate_union1_error = (() => {
364
+ if (obj_lastModifiedDate !== null) {
365
+ return new TypeError('Expected "null" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
366
+ }
367
+ })();
368
+ if (obj_lastModifiedDate_union1_error != null) {
369
+ obj_lastModifiedDate_union1 = obj_lastModifiedDate_union1_error.message;
370
+ }
371
+ if (obj_lastModifiedDate_union0 && obj_lastModifiedDate_union1) {
372
+ let message = 'Object doesn\'t match union (at "' + path_lastModifiedDate + '")';
373
+ message += '\n' + obj_lastModifiedDate_union0.split('\n').map((line) => '\t' + line).join('\n');
374
+ message += '\n' + obj_lastModifiedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
375
+ return new TypeError(message);
229
376
  }
230
377
  const obj_parentTerms = obj.parentTerms;
231
378
  const path_parentTerms = path + '.parentTerms';
@@ -261,19 +408,19 @@ function validate$1(obj, path = 'ContentTaxonomyTermRepresentation') {
261
408
  return v_error === undefined ? null : v_error;
262
409
  }
263
410
  const RepresentationType$1 = 'ContentTaxonomyTermRepresentation';
264
- function keyBuilder$4(luvio, config) {
411
+ function keyBuilder$6(luvio, config) {
265
412
  return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
266
413
  }
267
414
  function keyBuilderFromType(luvio, object) {
268
415
  const keyParams = {
269
416
  id: object.id
270
417
  };
271
- return keyBuilder$4(luvio, keyParams);
418
+ return keyBuilder$6(luvio, keyParams);
272
419
  }
273
420
  function normalize$1(input, existing, path, luvio, store, timestamp) {
274
421
  return input;
275
422
  }
276
- const select$3 = function ContentTaxonomyTermRepresentationSelect() {
423
+ const select$6 = function ContentTaxonomyTermRepresentationSelect() {
277
424
  return {
278
425
  kind: 'Fragment',
279
426
  version: VERSION$1,
@@ -348,7 +495,7 @@ const RepresentationType = 'ContentTaxonomyTermCollectionRepresentation';
348
495
  function normalize(input, existing, path, luvio, store, timestamp) {
349
496
  return input;
350
497
  }
351
- const select$2 = function ContentTaxonomyTermCollectionRepresentationSelect() {
498
+ const select$5 = function ContentTaxonomyTermCollectionRepresentationSelect() {
352
499
  return {
353
500
  kind: 'Fragment',
354
501
  version: VERSION,
@@ -384,22 +531,22 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
384
531
  });
385
532
  }
386
533
 
387
- function select$1(luvio, params) {
388
- return select$2();
534
+ function select$4(luvio, params) {
535
+ return select$5();
389
536
  }
390
- function keyBuilder$3(luvio, params) {
537
+ function keyBuilder$5(luvio, params) {
391
538
  return keyPrefix + '::ContentTaxonomyTermCollectionRepresentation:(' + 'depth:' + params.queryParams.depth + ',' + 'includeMetadata:' + params.queryParams.includeMetadata + ',' + 'includePaths:' + params.queryParams.includePaths + ',' + 'initialTerms:' + params.queryParams.initialTerms + ',' + 'taxonomyId:' + params.queryParams.taxonomyId + ')';
392
539
  }
393
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
394
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
540
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
541
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
395
542
  }
396
- function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
543
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
397
544
  const { body } = response;
398
- const key = keyBuilder$3(luvio, resourceParams);
545
+ const key = keyBuilder$5(luvio, resourceParams);
399
546
  luvio.storeIngest(key, ingest, body);
400
547
  const snapshot = luvio.storeLookup({
401
548
  recordId: key,
402
- node: select$1(),
549
+ node: select$4(),
403
550
  variables: {},
404
551
  }, snapshotRefresh);
405
552
  if (process.env.NODE_ENV !== 'production') {
@@ -410,8 +557,8 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
410
557
  deepFreeze(snapshot.data);
411
558
  return snapshot;
412
559
  }
413
- function ingestError$1(luvio, params, error, snapshotRefresh) {
414
- const key = keyBuilder$3(luvio, params);
560
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
561
+ const key = keyBuilder$5(luvio, params);
415
562
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
416
563
  const storeMetadataParams = {
417
564
  ttl: TTL,
@@ -422,7 +569,7 @@ function ingestError$1(luvio, params, error, snapshotRefresh) {
422
569
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
423
570
  return errorSnapshot;
424
571
  }
425
- function createResourceRequest$1(config) {
572
+ function createResourceRequest$4(config) {
426
573
  const headers = {};
427
574
  return {
428
575
  baseUri: '/services/data/v60.0',
@@ -436,7 +583,7 @@ function createResourceRequest$1(config) {
436
583
  };
437
584
  }
438
585
 
439
- const adapterName$1 = 'getTerms';
586
+ const adapterName$4 = 'getTerms';
440
587
  const getTerms_ConfigPropertyMetadata = [
441
588
  generateParamConfigMetadata('depth', false, 1 /* QueryParameter */, 3 /* Integer */),
442
589
  generateParamConfigMetadata('includeMetadata', false, 1 /* QueryParameter */, 1 /* Boolean */),
@@ -444,56 +591,199 @@ const getTerms_ConfigPropertyMetadata = [
444
591
  generateParamConfigMetadata('initialTerms', false, 1 /* QueryParameter */, 0 /* String */, true),
445
592
  generateParamConfigMetadata('taxonomyId', false, 1 /* QueryParameter */, 0 /* String */),
446
593
  ];
447
- const getTerms_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getTerms_ConfigPropertyMetadata);
448
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(getTerms_ConfigPropertyMetadata);
594
+ const getTerms_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getTerms_ConfigPropertyMetadata);
595
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$5(getTerms_ConfigPropertyMetadata);
596
+ function keyBuilder$4(luvio, config) {
597
+ const resourceParams = createResourceParams$4(config);
598
+ return keyBuilder$5(luvio, resourceParams);
599
+ }
600
+ function typeCheckConfig$4(untrustedConfig) {
601
+ const config = {};
602
+ typeCheckConfig$5(untrustedConfig, config, getTerms_ConfigPropertyMetadata);
603
+ return config;
604
+ }
605
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
606
+ if (!untrustedIsObject(untrustedConfig)) {
607
+ return null;
608
+ }
609
+ if (process.env.NODE_ENV !== 'production') {
610
+ validateConfig(untrustedConfig, configPropertyNames);
611
+ }
612
+ const config = typeCheckConfig$4(untrustedConfig);
613
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
614
+ return null;
615
+ }
616
+ return config;
617
+ }
618
+ function adapterFragment$2(luvio, config) {
619
+ createResourceParams$4(config);
620
+ return select$4();
621
+ }
622
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
623
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
624
+ config,
625
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
626
+ });
627
+ return luvio.storeBroadcast().then(() => snapshot);
628
+ }
629
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
630
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
631
+ config,
632
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
633
+ });
634
+ return luvio.storeBroadcast().then(() => snapshot);
635
+ }
636
+ function buildNetworkSnapshot$4(luvio, config, options) {
637
+ const resourceParams = createResourceParams$4(config);
638
+ const request = createResourceRequest$4(resourceParams);
639
+ return luvio.dispatchResourceRequest(request, options)
640
+ .then((response) => {
641
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
642
+ const cache = new StoreKeyMap();
643
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
644
+ return cache;
645
+ });
646
+ }, (response) => {
647
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
648
+ });
649
+ }
650
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
651
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
652
+ }
653
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
654
+ const { luvio, config } = context;
655
+ const selector = {
656
+ recordId: keyBuilder$4(luvio, config),
657
+ node: adapterFragment$2(luvio, config),
658
+ variables: {},
659
+ };
660
+ const cacheSnapshot = storeLookup(selector, {
661
+ config,
662
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
663
+ });
664
+ return cacheSnapshot;
665
+ }
666
+ const getTermsAdapterFactory = (luvio) => function contentTaxonomy__getTerms(untrustedConfig, requestContext) {
667
+ const config = validateAdapterConfig$4(untrustedConfig, getTerms_ConfigPropertyNames);
668
+ // Invalid or incomplete config
669
+ if (config === null) {
670
+ return null;
671
+ }
672
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
673
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
674
+ };
675
+
676
+ function select$3(luvio, params) {
677
+ return select$5();
678
+ }
679
+ function keyBuilder$3(luvio, params) {
680
+ return keyPrefix + '::ContentTaxonomyTermCollectionRepresentation:(' + 'includeHierarchyWithDepth:' + params.queryParams.includeHierarchyWithDepth + ',' + 'includeMetadata:' + params.queryParams.includeMetadata + ',' + 'page:' + params.queryParams.page + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'queryText:' + params.queryParams.queryText + ',' + 'taxonomyIds:' + params.queryParams.taxonomyIds + ')';
681
+ }
682
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
683
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
684
+ }
685
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
686
+ const { body } = response;
687
+ const key = keyBuilder$3(luvio, resourceParams);
688
+ luvio.storeIngest(key, ingest, body);
689
+ const snapshot = luvio.storeLookup({
690
+ recordId: key,
691
+ node: select$3(),
692
+ variables: {},
693
+ }, snapshotRefresh);
694
+ if (process.env.NODE_ENV !== 'production') {
695
+ if (snapshot.state !== 'Fulfilled') {
696
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
697
+ }
698
+ }
699
+ deepFreeze(snapshot.data);
700
+ return snapshot;
701
+ }
702
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
703
+ const key = keyBuilder$3(luvio, params);
704
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
705
+ const storeMetadataParams = {
706
+ ttl: TTL,
707
+ namespace: keyPrefix,
708
+ version: VERSION,
709
+ representationName: RepresentationType
710
+ };
711
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
712
+ return errorSnapshot;
713
+ }
714
+ function createResourceRequest$3(config) {
715
+ const headers = {};
716
+ return {
717
+ baseUri: '/services/data/v60.0',
718
+ basePath: '/connect/content-taxonomy/terms/search',
719
+ method: 'get',
720
+ body: null,
721
+ urlParams: {},
722
+ queryParams: config.queryParams,
723
+ headers,
724
+ priority: 'normal',
725
+ };
726
+ }
727
+
728
+ const adapterName$3 = 'searchTerms';
729
+ const searchTerms_ConfigPropertyMetadata = [
730
+ generateParamConfigMetadata('includeHierarchyWithDepth', false, 1 /* QueryParameter */, 3 /* Integer */),
731
+ generateParamConfigMetadata('includeMetadata', false, 1 /* QueryParameter */, 1 /* Boolean */),
732
+ generateParamConfigMetadata('page', false, 1 /* QueryParameter */, 3 /* Integer */),
733
+ generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
734
+ generateParamConfigMetadata('queryText', false, 1 /* QueryParameter */, 0 /* String */),
735
+ generateParamConfigMetadata('taxonomyIds', false, 1 /* QueryParameter */, 0 /* String */, true),
736
+ ];
737
+ const searchTerms_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, searchTerms_ConfigPropertyMetadata);
738
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$5(searchTerms_ConfigPropertyMetadata);
449
739
  function keyBuilder$2(luvio, config) {
450
- const resourceParams = createResourceParams$1(config);
740
+ const resourceParams = createResourceParams$3(config);
451
741
  return keyBuilder$3(luvio, resourceParams);
452
742
  }
453
- function typeCheckConfig$1(untrustedConfig) {
743
+ function typeCheckConfig$3(untrustedConfig) {
454
744
  const config = {};
455
- typeCheckConfig$2(untrustedConfig, config, getTerms_ConfigPropertyMetadata);
745
+ typeCheckConfig$5(untrustedConfig, config, searchTerms_ConfigPropertyMetadata);
456
746
  return config;
457
747
  }
458
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
748
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
459
749
  if (!untrustedIsObject(untrustedConfig)) {
460
750
  return null;
461
751
  }
462
752
  if (process.env.NODE_ENV !== 'production') {
463
753
  validateConfig(untrustedConfig, configPropertyNames);
464
754
  }
465
- const config = typeCheckConfig$1(untrustedConfig);
755
+ const config = typeCheckConfig$3(untrustedConfig);
466
756
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
467
757
  return null;
468
758
  }
469
759
  return config;
470
760
  }
471
761
  function adapterFragment$1(luvio, config) {
472
- createResourceParams$1(config);
473
- return select$1();
762
+ createResourceParams$3(config);
763
+ return select$3();
474
764
  }
475
765
  function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
476
- const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
766
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
477
767
  config,
478
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
768
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
479
769
  });
480
770
  return luvio.storeBroadcast().then(() => snapshot);
481
771
  }
482
772
  function onFetchResponseError$1(luvio, config, resourceParams, response) {
483
773
  const snapshot = ingestError$1(luvio, resourceParams, response, {
484
774
  config,
485
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
775
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
486
776
  });
487
777
  return luvio.storeBroadcast().then(() => snapshot);
488
778
  }
489
- function buildNetworkSnapshot$1(luvio, config, options) {
490
- const resourceParams = createResourceParams$1(config);
491
- const request = createResourceRequest$1(resourceParams);
779
+ function buildNetworkSnapshot$3(luvio, config, options) {
780
+ const resourceParams = createResourceParams$3(config);
781
+ const request = createResourceRequest$3(resourceParams);
492
782
  return luvio.dispatchResourceRequest(request, options)
493
783
  .then((response) => {
494
784
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
495
785
  const cache = new StoreKeyMap();
496
- getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
786
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
497
787
  return cache;
498
788
  });
499
789
  }, (response) => {
@@ -501,7 +791,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
501
791
  });
502
792
  }
503
793
  function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
504
- return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
794
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
505
795
  }
506
796
  function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
507
797
  const { luvio, config } = context;
@@ -512,12 +802,12 @@ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
512
802
  };
513
803
  const cacheSnapshot = storeLookup(selector, {
514
804
  config,
515
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
805
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
516
806
  });
517
807
  return cacheSnapshot;
518
808
  }
519
- const getTermsAdapterFactory = (luvio) => function contentTaxonomy__getTerms(untrustedConfig, requestContext) {
520
- const config = validateAdapterConfig$1(untrustedConfig, getTerms_ConfigPropertyNames);
809
+ const searchTermsAdapterFactory = (luvio) => function contentTaxonomy__searchTerms(untrustedConfig, requestContext) {
810
+ const config = validateAdapterConfig$3(untrustedConfig, searchTerms_ConfigPropertyNames);
521
811
  // Invalid or incomplete config
522
812
  if (config === null) {
523
813
  return null;
@@ -526,24 +816,117 @@ const getTermsAdapterFactory = (luvio) => function contentTaxonomy__getTerms(unt
526
816
  buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
527
817
  };
528
818
 
529
- function select(luvio, params) {
530
- return select$3();
819
+ function select$2(luvio, params) {
820
+ return select$6();
821
+ }
822
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
823
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
824
+ }
825
+ function ingestSuccess$2(luvio, resourceParams, response) {
826
+ const { body } = response;
827
+ const key = keyBuilderFromType(luvio, body);
828
+ luvio.storeIngest(key, ingest$1, body);
829
+ const snapshot = luvio.storeLookup({
830
+ recordId: key,
831
+ node: select$2(),
832
+ variables: {},
833
+ });
834
+ if (process.env.NODE_ENV !== 'production') {
835
+ if (snapshot.state !== 'Fulfilled') {
836
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
837
+ }
838
+ }
839
+ deepFreeze(snapshot.data);
840
+ return snapshot;
841
+ }
842
+ function createResourceRequest$2(config) {
843
+ const headers = {};
844
+ return {
845
+ baseUri: '/services/data/v60.0',
846
+ basePath: '/connect/content-taxonomy/' + config.urlParams.taxonomyId + '/terms',
847
+ method: 'post',
848
+ body: config.body,
849
+ urlParams: config.urlParams,
850
+ queryParams: {},
851
+ headers,
852
+ priority: 'normal',
853
+ };
854
+ }
855
+
856
+ const adapterName$2 = 'createTerm';
857
+ const createTerm_ConfigPropertyMetadata = [
858
+ generateParamConfigMetadata('taxonomyId', true, 0 /* UrlParameter */, 0 /* String */),
859
+ generateParamConfigMetadata('description', true, 2 /* Body */, 0 /* String */),
860
+ generateParamConfigMetadata('label', true, 2 /* Body */, 0 /* String */),
861
+ generateParamConfigMetadata('parentTermId', true, 2 /* Body */, 0 /* String */),
862
+ ];
863
+ const createTerm_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createTerm_ConfigPropertyMetadata);
864
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$5(createTerm_ConfigPropertyMetadata);
865
+ function typeCheckConfig$2(untrustedConfig) {
866
+ const config = {};
867
+ typeCheckConfig$5(untrustedConfig, config, createTerm_ConfigPropertyMetadata);
868
+ return config;
869
+ }
870
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
871
+ if (!untrustedIsObject(untrustedConfig)) {
872
+ return null;
873
+ }
874
+ if (process.env.NODE_ENV !== 'production') {
875
+ validateConfig(untrustedConfig, configPropertyNames);
876
+ }
877
+ const config = typeCheckConfig$2(untrustedConfig);
878
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
879
+ return null;
880
+ }
881
+ return config;
882
+ }
883
+ function buildNetworkSnapshot$2(luvio, config, options) {
884
+ const resourceParams = createResourceParams$2(config);
885
+ const request = createResourceRequest$2(resourceParams);
886
+ return luvio.dispatchResourceRequest(request, options)
887
+ .then((response) => {
888
+ return luvio.handleSuccessResponse(() => {
889
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
890
+ return luvio.storeBroadcast().then(() => snapshot);
891
+ }, () => {
892
+ const cache = new StoreKeyMap();
893
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
894
+ return cache;
895
+ });
896
+ }, (response) => {
897
+ deepFreeze(response);
898
+ throw response;
899
+ });
900
+ }
901
+ const createTermAdapterFactory = (luvio) => {
902
+ return function createTerm(untrustedConfig) {
903
+ const config = validateAdapterConfig$2(untrustedConfig, createTerm_ConfigPropertyNames);
904
+ // Invalid or incomplete config
905
+ if (config === null) {
906
+ throw new Error('Invalid config for "createTerm"');
907
+ }
908
+ return buildNetworkSnapshot$2(luvio, config);
909
+ };
910
+ };
911
+
912
+ function select$1(luvio, params) {
913
+ return select$6();
531
914
  }
532
915
  function keyBuilder$1(luvio, params) {
533
- return keyBuilder$4(luvio, {
916
+ return keyBuilder$6(luvio, {
534
917
  id: params.urlParams.termId
535
918
  });
536
919
  }
537
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
920
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
538
921
  getTypeCacheKeys$1(storeKeyMap, luvio, response);
539
922
  }
540
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
923
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
541
924
  const { body } = response;
542
925
  const key = keyBuilder$1(luvio, resourceParams);
543
926
  luvio.storeIngest(key, ingest$1, body);
544
927
  const snapshot = luvio.storeLookup({
545
928
  recordId: key,
546
- node: select(),
929
+ node: select$1(),
547
930
  variables: {},
548
931
  }, snapshotRefresh);
549
932
  if (process.env.NODE_ENV !== 'production') {
@@ -566,7 +949,7 @@ function ingestError(luvio, params, error, snapshotRefresh) {
566
949
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
567
950
  return errorSnapshot;
568
951
  }
569
- function createResourceRequest(config) {
952
+ function createResourceRequest$1(config) {
570
953
  const headers = {};
571
954
  return {
572
955
  baseUri: '/services/data/v60.0',
@@ -580,61 +963,61 @@ function createResourceRequest(config) {
580
963
  };
581
964
  }
582
965
 
583
- const adapterName = 'getTerm';
966
+ const adapterName$1 = 'getTerm';
584
967
  const getTerm_ConfigPropertyMetadata = [
585
968
  generateParamConfigMetadata('taxonomyId', true, 0 /* UrlParameter */, 0 /* String */),
586
969
  generateParamConfigMetadata('termId', true, 0 /* UrlParameter */, 0 /* String */),
587
970
  ];
588
- const getTerm_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getTerm_ConfigPropertyMetadata);
589
- const createResourceParams = /*#__PURE__*/ createResourceParams$2(getTerm_ConfigPropertyMetadata);
971
+ const getTerm_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getTerm_ConfigPropertyMetadata);
972
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$5(getTerm_ConfigPropertyMetadata);
590
973
  function keyBuilder(luvio, config) {
591
- const resourceParams = createResourceParams(config);
974
+ const resourceParams = createResourceParams$1(config);
592
975
  return keyBuilder$1(luvio, resourceParams);
593
976
  }
594
- function typeCheckConfig(untrustedConfig) {
977
+ function typeCheckConfig$1(untrustedConfig) {
595
978
  const config = {};
596
- typeCheckConfig$2(untrustedConfig, config, getTerm_ConfigPropertyMetadata);
979
+ typeCheckConfig$5(untrustedConfig, config, getTerm_ConfigPropertyMetadata);
597
980
  return config;
598
981
  }
599
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
982
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
600
983
  if (!untrustedIsObject(untrustedConfig)) {
601
984
  return null;
602
985
  }
603
986
  if (process.env.NODE_ENV !== 'production') {
604
987
  validateConfig(untrustedConfig, configPropertyNames);
605
988
  }
606
- const config = typeCheckConfig(untrustedConfig);
989
+ const config = typeCheckConfig$1(untrustedConfig);
607
990
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
608
991
  return null;
609
992
  }
610
993
  return config;
611
994
  }
612
995
  function adapterFragment(luvio, config) {
613
- createResourceParams(config);
614
- return select();
996
+ createResourceParams$1(config);
997
+ return select$1();
615
998
  }
616
999
  function onFetchResponseSuccess(luvio, config, resourceParams, response) {
617
- const snapshot = ingestSuccess(luvio, resourceParams, response, {
1000
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
618
1001
  config,
619
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1002
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
620
1003
  });
621
1004
  return luvio.storeBroadcast().then(() => snapshot);
622
1005
  }
623
1006
  function onFetchResponseError(luvio, config, resourceParams, response) {
624
1007
  const snapshot = ingestError(luvio, resourceParams, response, {
625
1008
  config,
626
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1009
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
627
1010
  });
628
1011
  return luvio.storeBroadcast().then(() => snapshot);
629
1012
  }
630
- function buildNetworkSnapshot(luvio, config, options) {
631
- const resourceParams = createResourceParams(config);
632
- const request = createResourceRequest(resourceParams);
1013
+ function buildNetworkSnapshot$1(luvio, config, options) {
1014
+ const resourceParams = createResourceParams$1(config);
1015
+ const request = createResourceRequest$1(resourceParams);
633
1016
  return luvio.dispatchResourceRequest(request, options)
634
1017
  .then((response) => {
635
1018
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
636
1019
  const cache = new StoreKeyMap();
637
- getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1020
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
638
1021
  return cache;
639
1022
  });
640
1023
  }, (response) => {
@@ -642,7 +1025,7 @@ function buildNetworkSnapshot(luvio, config, options) {
642
1025
  });
643
1026
  }
644
1027
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
645
- return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
1028
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
646
1029
  }
647
1030
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
648
1031
  const { luvio, config } = context;
@@ -653,12 +1036,12 @@ function buildCachedSnapshotCachePolicy(context, storeLookup) {
653
1036
  };
654
1037
  const cacheSnapshot = storeLookup(selector, {
655
1038
  config,
656
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1039
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
657
1040
  });
658
1041
  return cacheSnapshot;
659
1042
  }
660
1043
  const getTermAdapterFactory = (luvio) => function contentTaxonomy__getTerm(untrustedConfig, requestContext) {
661
- const config = validateAdapterConfig(untrustedConfig, getTerm_ConfigPropertyNames);
1044
+ const config = validateAdapterConfig$1(untrustedConfig, getTerm_ConfigPropertyNames);
662
1045
  // Invalid or incomplete config
663
1046
  if (config === null) {
664
1047
  return null;
@@ -667,4 +1050,98 @@ const getTermAdapterFactory = (luvio) => function contentTaxonomy__getTerm(untru
667
1050
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
668
1051
  };
669
1052
 
670
- export { getTermAdapterFactory, getTermsAdapterFactory };
1053
+ function select(luvio, params) {
1054
+ return select$6();
1055
+ }
1056
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1057
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
1058
+ }
1059
+ function ingestSuccess(luvio, resourceParams, response) {
1060
+ const { body } = response;
1061
+ const key = keyBuilderFromType(luvio, body);
1062
+ luvio.storeIngest(key, ingest$1, body);
1063
+ const snapshot = luvio.storeLookup({
1064
+ recordId: key,
1065
+ node: select(),
1066
+ variables: {},
1067
+ });
1068
+ if (process.env.NODE_ENV !== 'production') {
1069
+ if (snapshot.state !== 'Fulfilled') {
1070
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1071
+ }
1072
+ }
1073
+ deepFreeze(snapshot.data);
1074
+ return snapshot;
1075
+ }
1076
+ function createResourceRequest(config) {
1077
+ const headers = {};
1078
+ return {
1079
+ baseUri: '/services/data/v60.0',
1080
+ basePath: '/connect/content-taxonomy/' + config.urlParams.taxonomyId + '/terms/' + config.urlParams.termId + '',
1081
+ method: 'patch',
1082
+ body: config.body,
1083
+ urlParams: config.urlParams,
1084
+ queryParams: {},
1085
+ headers,
1086
+ priority: 'normal',
1087
+ };
1088
+ }
1089
+
1090
+ const adapterName = 'updateTerm';
1091
+ const updateTerm_ConfigPropertyMetadata = [
1092
+ generateParamConfigMetadata('taxonomyId', true, 0 /* UrlParameter */, 0 /* String */),
1093
+ generateParamConfigMetadata('termId', true, 0 /* UrlParameter */, 0 /* String */),
1094
+ generateParamConfigMetadata('description', true, 2 /* Body */, 0 /* String */),
1095
+ generateParamConfigMetadata('label', true, 2 /* Body */, 0 /* String */),
1096
+ generateParamConfigMetadata('parentTermId', true, 2 /* Body */, 0 /* String */),
1097
+ ];
1098
+ const updateTerm_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateTerm_ConfigPropertyMetadata);
1099
+ const createResourceParams = /*#__PURE__*/ createResourceParams$5(updateTerm_ConfigPropertyMetadata);
1100
+ function typeCheckConfig(untrustedConfig) {
1101
+ const config = {};
1102
+ typeCheckConfig$5(untrustedConfig, config, updateTerm_ConfigPropertyMetadata);
1103
+ return config;
1104
+ }
1105
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1106
+ if (!untrustedIsObject(untrustedConfig)) {
1107
+ return null;
1108
+ }
1109
+ if (process.env.NODE_ENV !== 'production') {
1110
+ validateConfig(untrustedConfig, configPropertyNames);
1111
+ }
1112
+ const config = typeCheckConfig(untrustedConfig);
1113
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1114
+ return null;
1115
+ }
1116
+ return config;
1117
+ }
1118
+ function buildNetworkSnapshot(luvio, config, options) {
1119
+ const resourceParams = createResourceParams(config);
1120
+ const request = createResourceRequest(resourceParams);
1121
+ return luvio.dispatchResourceRequest(request, options)
1122
+ .then((response) => {
1123
+ return luvio.handleSuccessResponse(() => {
1124
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
1125
+ return luvio.storeBroadcast().then(() => snapshot);
1126
+ }, () => {
1127
+ const cache = new StoreKeyMap();
1128
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1129
+ return cache;
1130
+ });
1131
+ }, (response) => {
1132
+ deepFreeze(response);
1133
+ throw response;
1134
+ });
1135
+ }
1136
+ const updateTermAdapterFactory = (luvio) => {
1137
+ return function updateTerm(untrustedConfig) {
1138
+ const config = validateAdapterConfig(untrustedConfig, updateTerm_ConfigPropertyNames);
1139
+ // Invalid or incomplete config
1140
+ if (config === null) {
1141
+ throw new Error('Invalid config for "updateTerm"');
1142
+ }
1143
+ return buildNetworkSnapshot(luvio, config);
1144
+ };
1145
+ };
1146
+
1147
+ export { createTermAdapterFactory, getTermAdapterFactory, getTermsAdapterFactory, searchTermsAdapterFactory, updateTermAdapterFactory };