@salesforce/lds-adapters-platform-content-taxonomy 1.249.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/platform-content-taxonomy.js +479 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  4. package/dist/es/es2018/types/src/generated/adapters/getTerms.d.ts +31 -0
  5. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
  6. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +3 -0
  7. package/dist/es/es2018/types/src/generated/resources/deleteConnectContentTaxonomyTermsByTaxonomyIdAndTermId.d.ts +16 -0
  8. package/dist/es/es2018/types/src/generated/resources/getConnectContentTaxonomyTerms.d.ts +19 -0
  9. package/dist/es/es2018/types/src/generated/resources/getConnectContentTaxonomyTermsByTaxonomyIdAndTermId.d.ts +16 -0
  10. package/dist/es/es2018/types/src/generated/resources/getConnectContentTaxonomyTermsSearch.d.ts +20 -0
  11. package/dist/es/es2018/types/src/generated/resources/patchConnectContentTaxonomyTermsByTaxonomyIdAndTermId.d.ts +18 -0
  12. package/dist/es/es2018/types/src/generated/resources/postConnectContentTaxonomyTermsByTaxonomyId.d.ts +17 -0
  13. package/dist/es/es2018/types/src/generated/types/ContentTaxonomyPathFragmentRepresentation.d.ts +41 -0
  14. package/dist/es/es2018/types/src/generated/types/ContentTaxonomyPathRepresentation.d.ts +36 -0
  15. package/dist/es/es2018/types/src/generated/types/ContentTaxonomyTermCollectionRepresentation.d.ts +36 -0
  16. package/dist/es/es2018/types/src/generated/types/ContentTaxonomyTermInputRepresentation.d.ts +34 -0
  17. package/dist/es/es2018/types/src/generated/types/ContentTaxonomyTermRepresentation.d.ts +68 -0
  18. package/dist/es/es2018/types/src/generated/types/ContentTaxonomyUserSummary.d.ts +44 -0
  19. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  20. package/package.json +66 -0
  21. package/sfdc/index.d.ts +1 -0
  22. package/sfdc/index.js +511 -0
  23. package/src/raml/api.raml +265 -0
  24. package/src/raml/luvio.raml +34 -0
package/sfdc/index.js ADDED
@@ -0,0 +1,511 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /* *******************************************************************************************
8
+ * ATTENTION!
9
+ * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
+ * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
11
+ * Any changes made to this file in p4 will be automatically overwritten.
12
+ * *******************************************************************************************
13
+ */
14
+ /* proxy-compat-disable */
15
+ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
+ import { withDefaultLuvio } from 'force/ldsEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from 'force/luvioEngine';
18
+
19
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
21
+ const { isArray: ArrayIsArray$1 } = Array;
22
+ /**
23
+ * Validates an adapter config is well-formed.
24
+ * @param config The config to validate.
25
+ * @param adapter The adapter validation configuration.
26
+ * @param oneOf The keys the config must contain at least one of.
27
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
28
+ */
29
+ function validateConfig(config, adapter, oneOf) {
30
+ const { displayName } = adapter;
31
+ const { required, optional, unsupported } = adapter.parameters;
32
+ if (config === undefined ||
33
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
34
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
35
+ }
36
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
37
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
38
+ }
39
+ if (unsupported !== undefined &&
40
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
41
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
+ }
43
+ const supported = required.concat(optional);
44
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
45
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
+ }
47
+ }
48
+ function untrustedIsObject(untrusted) {
49
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
50
+ }
51
+ function areRequiredParametersPresent(config, configPropertyNames) {
52
+ return configPropertyNames.parameters.required.every(req => req in config);
53
+ }
54
+ const snapshotRefreshOptions = {
55
+ overrides: {
56
+ headers: {
57
+ 'Cache-Control': 'no-cache',
58
+ },
59
+ }
60
+ };
61
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
62
+ return {
63
+ name,
64
+ required,
65
+ resourceType,
66
+ typeCheckShape,
67
+ isArrayShape,
68
+ coerceFn,
69
+ };
70
+ }
71
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
72
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
73
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
74
+ return {
75
+ displayName,
76
+ parameters: {
77
+ required,
78
+ optional,
79
+ }
80
+ };
81
+ }
82
+ const keyPrefix = 'content-taxonomy';
83
+
84
+ const { isArray: ArrayIsArray } = Array;
85
+ const { stringify: JSONStringify } = JSON;
86
+ function createLink(ref) {
87
+ return {
88
+ __ref: serializeStructuredKey(ref),
89
+ };
90
+ }
91
+
92
+ function validate$4(obj, path = 'ContentTaxonomyUserSummary') {
93
+ const v_error = (() => {
94
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
95
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
96
+ }
97
+ const obj_id = obj.id;
98
+ const path_id = path + '.id';
99
+ if (typeof obj_id !== 'string') {
100
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
101
+ }
102
+ const obj_name = obj.name;
103
+ const path_name = path + '.name';
104
+ if (typeof obj_name !== 'string') {
105
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
106
+ }
107
+ const obj_url = obj.url;
108
+ const path_url = path + '.url';
109
+ if (typeof obj_url !== 'string') {
110
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
111
+ }
112
+ })();
113
+ return v_error === undefined ? null : v_error;
114
+ }
115
+
116
+ function validate$3(obj, path = 'ContentTaxonomyPathFragmentRepresentation') {
117
+ const v_error = (() => {
118
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
119
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
120
+ }
121
+ const obj_id = obj.id;
122
+ const path_id = path + '.id';
123
+ if (typeof obj_id !== 'string') {
124
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
125
+ }
126
+ const obj_label = obj.label;
127
+ const path_label = path + '.label';
128
+ if (typeof obj_label !== 'string') {
129
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
130
+ }
131
+ })();
132
+ return v_error === undefined ? null : v_error;
133
+ }
134
+
135
+ function validate$2(obj, path = 'ContentTaxonomyPathRepresentation') {
136
+ const v_error = (() => {
137
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
138
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
139
+ }
140
+ const obj_label = obj.label;
141
+ const path_label = path + '.label';
142
+ if (typeof obj_label !== 'string') {
143
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
144
+ }
145
+ const obj_taxonomyFragment = obj.taxonomyFragment;
146
+ const path_taxonomyFragment = path + '.taxonomyFragment';
147
+ const referencepath_taxonomyFragmentValidationError = validate$3(obj_taxonomyFragment, path_taxonomyFragment);
148
+ if (referencepath_taxonomyFragmentValidationError !== null) {
149
+ let message = 'Object doesn\'t match ContentTaxonomyPathFragmentRepresentation (at "' + path_taxonomyFragment + '")\n';
150
+ message += referencepath_taxonomyFragmentValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
151
+ return new TypeError(message);
152
+ }
153
+ const obj_termFragments = obj.termFragments;
154
+ const path_termFragments = path + '.termFragments';
155
+ if (!ArrayIsArray(obj_termFragments)) {
156
+ return new TypeError('Expected "array" but received "' + typeof obj_termFragments + '" (at "' + path_termFragments + '")');
157
+ }
158
+ for (let i = 0; i < obj_termFragments.length; i++) {
159
+ const obj_termFragments_item = obj_termFragments[i];
160
+ const path_termFragments_item = path_termFragments + '[' + i + ']';
161
+ const referencepath_termFragments_itemValidationError = validate$3(obj_termFragments_item, path_termFragments_item);
162
+ if (referencepath_termFragments_itemValidationError !== null) {
163
+ let message = 'Object doesn\'t match ContentTaxonomyPathFragmentRepresentation (at "' + path_termFragments_item + '")\n';
164
+ message += referencepath_termFragments_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
165
+ return new TypeError(message);
166
+ }
167
+ }
168
+ })();
169
+ return v_error === undefined ? null : v_error;
170
+ }
171
+
172
+ function validate$1(obj, path = 'ContentTaxonomyTermRepresentation') {
173
+ const v_error = (() => {
174
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
175
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
176
+ }
177
+ const obj_childTerms = obj.childTerms;
178
+ const path_childTerms = path + '.childTerms';
179
+ if (!ArrayIsArray(obj_childTerms)) {
180
+ return new TypeError('Expected "array" but received "' + typeof obj_childTerms + '" (at "' + path_childTerms + '")');
181
+ }
182
+ for (let i = 0; i < obj_childTerms.length; i++) {
183
+ const obj_childTerms_item = obj_childTerms[i];
184
+ const path_childTerms_item = path_childTerms + '[' + i + ']';
185
+ const referencepath_childTerms_itemValidationError = validate$1(obj_childTerms_item, path_childTerms_item);
186
+ if (referencepath_childTerms_itemValidationError !== null) {
187
+ let message = 'Object doesn\'t match ContentTaxonomyTermRepresentation (at "' + path_childTerms_item + '")\n';
188
+ message += referencepath_childTerms_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
189
+ return new TypeError(message);
190
+ }
191
+ }
192
+ const obj_createdBy = obj.createdBy;
193
+ const path_createdBy = path + '.createdBy';
194
+ const referencepath_createdByValidationError = validate$4(obj_createdBy, path_createdBy);
195
+ if (referencepath_createdByValidationError !== null) {
196
+ let message = 'Object doesn\'t match ContentTaxonomyUserSummary (at "' + path_createdBy + '")\n';
197
+ message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
198
+ return new TypeError(message);
199
+ }
200
+ const obj_createdDate = obj.createdDate;
201
+ const path_createdDate = path + '.createdDate';
202
+ if (typeof obj_createdDate !== 'string') {
203
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
204
+ }
205
+ const obj_description = obj.description;
206
+ const path_description = path + '.description';
207
+ if (typeof obj_description !== 'string') {
208
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
209
+ }
210
+ const obj_id = obj.id;
211
+ const path_id = path + '.id';
212
+ if (typeof obj_id !== 'string') {
213
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
214
+ }
215
+ const obj_isLeafTerm = obj.isLeafTerm;
216
+ const path_isLeafTerm = path + '.isLeafTerm';
217
+ if (typeof obj_isLeafTerm !== 'boolean') {
218
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isLeafTerm + '" (at "' + path_isLeafTerm + '")');
219
+ }
220
+ const obj_label = obj.label;
221
+ const path_label = path + '.label';
222
+ if (typeof obj_label !== 'string') {
223
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
224
+ }
225
+ const obj_lastModifiedBy = obj.lastModifiedBy;
226
+ const path_lastModifiedBy = path + '.lastModifiedBy';
227
+ const referencepath_lastModifiedByValidationError = validate$4(obj_lastModifiedBy, path_lastModifiedBy);
228
+ if (referencepath_lastModifiedByValidationError !== null) {
229
+ let message = 'Object doesn\'t match ContentTaxonomyUserSummary (at "' + path_lastModifiedBy + '")\n';
230
+ message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
231
+ return new TypeError(message);
232
+ }
233
+ const obj_lastModifiedDate = obj.lastModifiedDate;
234
+ const path_lastModifiedDate = path + '.lastModifiedDate';
235
+ if (typeof obj_lastModifiedDate !== 'string') {
236
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
237
+ }
238
+ const obj_parentTerms = obj.parentTerms;
239
+ const path_parentTerms = path + '.parentTerms';
240
+ if (!ArrayIsArray(obj_parentTerms)) {
241
+ return new TypeError('Expected "array" but received "' + typeof obj_parentTerms + '" (at "' + path_parentTerms + '")');
242
+ }
243
+ for (let i = 0; i < obj_parentTerms.length; i++) {
244
+ const obj_parentTerms_item = obj_parentTerms[i];
245
+ const path_parentTerms_item = path_parentTerms + '[' + i + ']';
246
+ const referencepath_parentTerms_itemValidationError = validate$1(obj_parentTerms_item, path_parentTerms_item);
247
+ if (referencepath_parentTerms_itemValidationError !== null) {
248
+ let message = 'Object doesn\'t match ContentTaxonomyTermRepresentation (at "' + path_parentTerms_item + '")\n';
249
+ message += referencepath_parentTerms_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
250
+ return new TypeError(message);
251
+ }
252
+ }
253
+ const obj_pathsFromRoot = obj.pathsFromRoot;
254
+ const path_pathsFromRoot = path + '.pathsFromRoot';
255
+ if (!ArrayIsArray(obj_pathsFromRoot)) {
256
+ return new TypeError('Expected "array" but received "' + typeof obj_pathsFromRoot + '" (at "' + path_pathsFromRoot + '")');
257
+ }
258
+ for (let i = 0; i < obj_pathsFromRoot.length; i++) {
259
+ const obj_pathsFromRoot_item = obj_pathsFromRoot[i];
260
+ const path_pathsFromRoot_item = path_pathsFromRoot + '[' + i + ']';
261
+ const referencepath_pathsFromRoot_itemValidationError = validate$2(obj_pathsFromRoot_item, path_pathsFromRoot_item);
262
+ if (referencepath_pathsFromRoot_itemValidationError !== null) {
263
+ let message = 'Object doesn\'t match ContentTaxonomyPathRepresentation (at "' + path_pathsFromRoot_item + '")\n';
264
+ message += referencepath_pathsFromRoot_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
265
+ return new TypeError(message);
266
+ }
267
+ }
268
+ })();
269
+ return v_error === undefined ? null : v_error;
270
+ }
271
+
272
+ const TTL = 100;
273
+ const VERSION = "bf2f880bd13018a781060bce49e7443e";
274
+ function validate(obj, path = 'ContentTaxonomyTermCollectionRepresentation') {
275
+ const v_error = (() => {
276
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
277
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
278
+ }
279
+ const obj_currentPageUrl = obj.currentPageUrl;
280
+ const path_currentPageUrl = path + '.currentPageUrl';
281
+ if (typeof obj_currentPageUrl !== 'string') {
282
+ return new TypeError('Expected "string" but received "' + typeof obj_currentPageUrl + '" (at "' + path_currentPageUrl + '")');
283
+ }
284
+ const obj_nextPageUrl = obj.nextPageUrl;
285
+ const path_nextPageUrl = path + '.nextPageUrl';
286
+ if (typeof obj_nextPageUrl !== 'string') {
287
+ return new TypeError('Expected "string" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
288
+ }
289
+ const obj_terms = obj.terms;
290
+ const path_terms = path + '.terms';
291
+ if (!ArrayIsArray(obj_terms)) {
292
+ return new TypeError('Expected "array" but received "' + typeof obj_terms + '" (at "' + path_terms + '")');
293
+ }
294
+ for (let i = 0; i < obj_terms.length; i++) {
295
+ const obj_terms_item = obj_terms[i];
296
+ const path_terms_item = path_terms + '[' + i + ']';
297
+ const referencepath_terms_itemValidationError = validate$1(obj_terms_item, path_terms_item);
298
+ if (referencepath_terms_itemValidationError !== null) {
299
+ let message = 'Object doesn\'t match ContentTaxonomyTermRepresentation (at "' + path_terms_item + '")\n';
300
+ message += referencepath_terms_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
301
+ return new TypeError(message);
302
+ }
303
+ }
304
+ })();
305
+ return v_error === undefined ? null : v_error;
306
+ }
307
+ const RepresentationType = 'ContentTaxonomyTermCollectionRepresentation';
308
+ function normalize(input, existing, path, luvio, store, timestamp) {
309
+ return input;
310
+ }
311
+ const select$1 = function ContentTaxonomyTermCollectionRepresentationSelect() {
312
+ return {
313
+ kind: 'Fragment',
314
+ version: VERSION,
315
+ private: [],
316
+ opaque: true
317
+ };
318
+ };
319
+ function equals(existing, incoming) {
320
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
321
+ return false;
322
+ }
323
+ return true;
324
+ }
325
+ const ingest = function ContentTaxonomyTermCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
326
+ if (process.env.NODE_ENV !== 'production') {
327
+ const validateError = validate(input);
328
+ if (validateError !== null) {
329
+ throw validateError;
330
+ }
331
+ }
332
+ const key = path.fullPath;
333
+ const ttlToUse = TTL;
334
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "content-taxonomy", VERSION, RepresentationType, equals);
335
+ return createLink(key);
336
+ };
337
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
338
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
339
+ const rootKey = fullPathFactory();
340
+ rootKeySet.set(rootKey, {
341
+ namespace: keyPrefix,
342
+ representationName: RepresentationType,
343
+ mergeable: false
344
+ });
345
+ }
346
+
347
+ function select(luvio, params) {
348
+ return select$1();
349
+ }
350
+ function keyBuilder$1(luvio, params) {
351
+ return keyPrefix + '::ContentTaxonomyTermCollectionRepresentation:(' + 'depth:' + params.queryParams.depth + ',' + 'includeMetadata:' + params.queryParams.includeMetadata + ',' + 'includePaths:' + params.queryParams.includePaths + ',' + 'initialTerms:' + params.queryParams.initialTerms + ',' + 'taxonomyId:' + params.queryParams.taxonomyId + ')';
352
+ }
353
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
354
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
355
+ }
356
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
357
+ const { body } = response;
358
+ const key = keyBuilder$1(luvio, resourceParams);
359
+ luvio.storeIngest(key, ingest, body);
360
+ const snapshot = luvio.storeLookup({
361
+ recordId: key,
362
+ node: select(),
363
+ variables: {},
364
+ }, snapshotRefresh);
365
+ if (process.env.NODE_ENV !== 'production') {
366
+ if (snapshot.state !== 'Fulfilled') {
367
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
368
+ }
369
+ }
370
+ deepFreeze(snapshot.data);
371
+ return snapshot;
372
+ }
373
+ function ingestError(luvio, params, error, snapshotRefresh) {
374
+ const key = keyBuilder$1(luvio, params);
375
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
376
+ const storeMetadataParams = {
377
+ ttl: TTL,
378
+ namespace: keyPrefix,
379
+ version: VERSION,
380
+ representationName: RepresentationType
381
+ };
382
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
383
+ return errorSnapshot;
384
+ }
385
+ function createResourceRequest(config) {
386
+ const headers = {};
387
+ return {
388
+ baseUri: '/services/data/v60.0',
389
+ basePath: '/connect/content-taxonomy/terms',
390
+ method: 'get',
391
+ body: null,
392
+ urlParams: {},
393
+ queryParams: config.queryParams,
394
+ headers,
395
+ priority: 'normal',
396
+ };
397
+ }
398
+
399
+ const adapterName = 'getTerms';
400
+ const getTerms_ConfigPropertyMetadata = [
401
+ generateParamConfigMetadata('depth', false, 1 /* QueryParameter */, 3 /* Integer */),
402
+ generateParamConfigMetadata('includeMetadata', false, 1 /* QueryParameter */, 1 /* Boolean */),
403
+ generateParamConfigMetadata('includePaths', false, 1 /* QueryParameter */, 1 /* Boolean */),
404
+ generateParamConfigMetadata('initialTerms', false, 1 /* QueryParameter */, 0 /* String */, true),
405
+ generateParamConfigMetadata('taxonomyId', false, 1 /* QueryParameter */, 0 /* String */),
406
+ ];
407
+ const getTerms_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getTerms_ConfigPropertyMetadata);
408
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(getTerms_ConfigPropertyMetadata);
409
+ function keyBuilder(luvio, config) {
410
+ const resourceParams = createResourceParams(config);
411
+ return keyBuilder$1(luvio, resourceParams);
412
+ }
413
+ function typeCheckConfig(untrustedConfig) {
414
+ const config = {};
415
+ typeCheckConfig$1(untrustedConfig, config, getTerms_ConfigPropertyMetadata);
416
+ return config;
417
+ }
418
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
419
+ if (!untrustedIsObject(untrustedConfig)) {
420
+ return null;
421
+ }
422
+ if (process.env.NODE_ENV !== 'production') {
423
+ validateConfig(untrustedConfig, configPropertyNames);
424
+ }
425
+ const config = typeCheckConfig(untrustedConfig);
426
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
427
+ return null;
428
+ }
429
+ return config;
430
+ }
431
+ function adapterFragment(luvio, config) {
432
+ createResourceParams(config);
433
+ return select();
434
+ }
435
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
436
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
437
+ config,
438
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
439
+ });
440
+ return luvio.storeBroadcast().then(() => snapshot);
441
+ }
442
+ function onFetchResponseError(luvio, config, resourceParams, response) {
443
+ const snapshot = ingestError(luvio, resourceParams, response, {
444
+ config,
445
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
446
+ });
447
+ return luvio.storeBroadcast().then(() => snapshot);
448
+ }
449
+ function buildNetworkSnapshot(luvio, config, options) {
450
+ const resourceParams = createResourceParams(config);
451
+ const request = createResourceRequest(resourceParams);
452
+ return luvio.dispatchResourceRequest(request, options)
453
+ .then((response) => {
454
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
455
+ const cache = new StoreKeyMap();
456
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
457
+ return cache;
458
+ });
459
+ }, (response) => {
460
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
461
+ });
462
+ }
463
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
464
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
465
+ }
466
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
467
+ const { luvio, config } = context;
468
+ const selector = {
469
+ recordId: keyBuilder(luvio, config),
470
+ node: adapterFragment(luvio, config),
471
+ variables: {},
472
+ };
473
+ const cacheSnapshot = storeLookup(selector, {
474
+ config,
475
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
476
+ });
477
+ return cacheSnapshot;
478
+ }
479
+ const getTermsAdapterFactory = (luvio) => function contentTaxonomy__getTerms(untrustedConfig, requestContext) {
480
+ const config = validateAdapterConfig(untrustedConfig, getTerms_ConfigPropertyNames);
481
+ // Invalid or incomplete config
482
+ if (config === null) {
483
+ return null;
484
+ }
485
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
486
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
487
+ };
488
+
489
+ let getTerms;
490
+ // Imperative GET Adapters
491
+ let getTerms_imperative;
492
+ // Adapter Metadata
493
+ const getTermsMetadata = { apiFamily: 'contenttaxonomy', name: 'getTerms', ttl: 100 };
494
+ function bindExportsTo(luvio) {
495
+ // LDS Adapters
496
+ const getTerms_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getTerms', getTermsAdapterFactory), getTermsMetadata);
497
+ return {
498
+ getTerms: createWireAdapterConstructor(luvio, getTerms_ldsAdapter, getTermsMetadata),
499
+ // Imperative GET Adapters
500
+ getTerms_imperative: createImperativeAdapter(luvio, getTerms_ldsAdapter, getTermsMetadata)
501
+ };
502
+ }
503
+ withDefaultLuvio((luvio) => {
504
+ ({
505
+ getTerms,
506
+ getTerms_imperative
507
+ } = bindExportsTo(luvio));
508
+ });
509
+
510
+ export { getTerms, getTerms_imperative };
511
+ // version: 1.249.0-15efc7f9b