@salesforce/lds-adapters-industries-interesttagging 1.100.2

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 (49) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-interesttagging.js +1585 -0
  3. package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
  4. package/dist/types/src/generated/adapters/createInterestTagEntityAssignment.d.ts +21 -0
  5. package/dist/types/src/generated/adapters/getInterestTagEntityAssignments.d.ts +30 -0
  6. package/dist/types/src/generated/adapters/getTagCategoriesByTagId.d.ts +30 -0
  7. package/dist/types/src/generated/adapters/getTagsByCategoryId.d.ts +30 -0
  8. package/dist/types/src/generated/adapters/getTagsByRecordId.d.ts +30 -0
  9. package/dist/types/src/generated/artifacts/main.d.ts +5 -0
  10. package/dist/types/src/generated/artifacts/sfdc.d.ts +10 -0
  11. package/dist/types/src/generated/resources/deleteConnectInterestTagsTags.d.ts +11 -0
  12. package/dist/types/src/generated/resources/deleteConnectInterestTagsTagsByTagId.d.ts +14 -0
  13. package/dist/types/src/generated/resources/getConnectInterestTagsAssignments.d.ts +18 -0
  14. package/dist/types/src/generated/resources/getConnectInterestTagsAssignmentsEntityByRecordId.d.ts +21 -0
  15. package/dist/types/src/generated/resources/getConnectInterestTagsAssignmentsTagByTagId.d.ts +21 -0
  16. package/dist/types/src/generated/resources/getConnectInterestTagsCategories.d.ts +19 -0
  17. package/dist/types/src/generated/resources/getConnectInterestTagsTags.d.ts +19 -0
  18. package/dist/types/src/generated/resources/getConnectInterestTagsTagsByTagId.d.ts +22 -0
  19. package/dist/types/src/generated/resources/patchConnectInterestTagsTags.d.ts +12 -0
  20. package/dist/types/src/generated/resources/patchConnectInterestTagsTagsByTagId.d.ts +15 -0
  21. package/dist/types/src/generated/resources/postConnectInterestTagsAssignments.d.ts +19 -0
  22. package/dist/types/src/generated/resources/postConnectInterestTagsAssignmentsTagByTagId.d.ts +22 -0
  23. package/dist/types/src/generated/resources/postConnectInterestTagsTags.d.ts +12 -0
  24. package/dist/types/src/generated/resources/postConnectInterestTagsTagsByTagId.d.ts +15 -0
  25. package/dist/types/src/generated/types/InterestTagAssignmentInputRepresentation.d.ts +44 -0
  26. package/dist/types/src/generated/types/InterestTagAssignmentOutputRepresentation.d.ts +51 -0
  27. package/dist/types/src/generated/types/InterestTagCreateCollectionOutputRepresentation.d.ts +30 -0
  28. package/dist/types/src/generated/types/InterestTagCreateInputListRepresentation.d.ts +29 -0
  29. package/dist/types/src/generated/types/InterestTagCreateInputRepresentation.d.ts +38 -0
  30. package/dist/types/src/generated/types/InterestTagCreateResult.d.ts +38 -0
  31. package/dist/types/src/generated/types/InterestTagListRepresentation.d.ts +31 -0
  32. package/dist/types/src/generated/types/InterestTagRepresentation.d.ts +39 -0
  33. package/dist/types/src/generated/types/InterestTagUpdateInputRepresentation.d.ts +38 -0
  34. package/dist/types/src/generated/types/InterestTagUpdateOutputRepresentation.d.ts +32 -0
  35. package/dist/types/src/generated/types/RecordsForTag.d.ts +32 -0
  36. package/dist/types/src/generated/types/TagCategoryListRepresentation.d.ts +30 -0
  37. package/dist/types/src/generated/types/TagCategoryRepresentation.d.ts +35 -0
  38. package/dist/types/src/generated/types/TagCategoryWithParentRepresentation.d.ts +44 -0
  39. package/dist/types/src/generated/types/TagRecordAssignment.d.ts +38 -0
  40. package/dist/types/src/generated/types/TagRecordAssignmentCollectionRepresentation.d.ts +30 -0
  41. package/dist/types/src/generated/types/TagsForRecord.d.ts +32 -0
  42. package/dist/types/src/generated/types/type-utils.d.ts +39 -0
  43. package/dist/umd/es2018/industries-interesttagging.js +1597 -0
  44. package/dist/umd/es5/industries-interesttagging.js +1605 -0
  45. package/package.json +70 -0
  46. package/sfdc/index.d.ts +1 -0
  47. package/sfdc/index.js +1647 -0
  48. package/src/raml/api.raml +529 -0
  49. package/src/raml/luvio.raml +43 -0
@@ -0,0 +1,1597 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ (function (global, factory) {
8
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
9
+ typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.industriesInteresttagging = {}, global.engine));
11
+ })(this, (function (exports, engine) { 'use strict';
12
+
13
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
14
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
15
+ const { isArray: ArrayIsArray$1 } = Array;
16
+ /**
17
+ * Validates an adapter config is well-formed.
18
+ * @param config The config to validate.
19
+ * @param adapter The adapter validation configuration.
20
+ * @param oneOf The keys the config must contain at least one of.
21
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
22
+ */
23
+ function validateConfig(config, adapter, oneOf) {
24
+ const { displayName } = adapter;
25
+ const { required, optional, unsupported } = adapter.parameters;
26
+ if (config === undefined ||
27
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
28
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
29
+ }
30
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
31
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
32
+ }
33
+ if (unsupported !== undefined &&
34
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
35
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
36
+ }
37
+ const supported = required.concat(optional);
38
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
39
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
40
+ }
41
+ }
42
+ function untrustedIsObject(untrusted) {
43
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
44
+ }
45
+ function areRequiredParametersPresent(config, configPropertyNames) {
46
+ return configPropertyNames.parameters.required.every(req => req in config);
47
+ }
48
+ const snapshotRefreshOptions = {
49
+ overrides: {
50
+ headers: {
51
+ 'Cache-Control': 'no-cache',
52
+ },
53
+ }
54
+ };
55
+ const keyPrefix = 'interesttagging';
56
+
57
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
58
+ const { isArray: ArrayIsArray } = Array;
59
+ const { stringify: JSONStringify } = JSON;
60
+ function equalsArray(a, b, equalsItem) {
61
+ const aLength = a.length;
62
+ const bLength = b.length;
63
+ if (aLength !== bLength) {
64
+ return false;
65
+ }
66
+ for (let i = 0; i < aLength; i++) {
67
+ if (equalsItem(a[i], b[i]) === false) {
68
+ return false;
69
+ }
70
+ }
71
+ return true;
72
+ }
73
+ function deepFreeze$4(value) {
74
+ // No need to freeze primitives
75
+ if (typeof value !== 'object' || value === null) {
76
+ return;
77
+ }
78
+ if (ArrayIsArray(value)) {
79
+ for (let i = 0, len = value.length; i < len; i += 1) {
80
+ deepFreeze$4(value[i]);
81
+ }
82
+ }
83
+ else {
84
+ const keys = ObjectKeys(value);
85
+ for (let i = 0, len = keys.length; i < len; i += 1) {
86
+ deepFreeze$4(value[keys[i]]);
87
+ }
88
+ }
89
+ ObjectFreeze(value);
90
+ }
91
+ function createLink(ref) {
92
+ return {
93
+ __ref: engine.serializeStructuredKey(ref),
94
+ };
95
+ }
96
+
97
+ const TTL$1 = 10000;
98
+ const VERSION$5 = "d1e3c71d06accea875e9f0c6f41bd7bd";
99
+ function validate$7(obj, path = 'InterestTagAssignmentOutputRepresentation') {
100
+ const v_error = (() => {
101
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
102
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
103
+ }
104
+ const obj_errors = obj.errors;
105
+ const path_errors = path + '.errors';
106
+ if (!ArrayIsArray(obj_errors)) {
107
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
108
+ }
109
+ for (let i = 0; i < obj_errors.length; i++) {
110
+ const obj_errors_item = obj_errors[i];
111
+ const path_errors_item = path_errors + '[' + i + ']';
112
+ if (typeof obj_errors_item !== 'string') {
113
+ return new TypeError('Expected "string" but received "' + typeof obj_errors_item + '" (at "' + path_errors_item + '")');
114
+ }
115
+ }
116
+ const obj_isCreated = obj.isCreated;
117
+ const path_isCreated = path + '.isCreated';
118
+ if (typeof obj_isCreated !== 'boolean') {
119
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isCreated + '" (at "' + path_isCreated + '")');
120
+ }
121
+ const obj_isSuccess = obj.isSuccess;
122
+ const path_isSuccess = path + '.isSuccess';
123
+ if (typeof obj_isSuccess !== 'boolean') {
124
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
125
+ }
126
+ })();
127
+ return v_error === undefined ? null : v_error;
128
+ }
129
+ const RepresentationType$3 = 'InterestTagAssignmentOutputRepresentation';
130
+ function keyBuilder$8(luvio, config) {
131
+ return keyPrefix + '::' + RepresentationType$3 + ':' + '[' + config.errors.join(',') + ']' + ':' + config.isCreated + ':' + config.isSuccess;
132
+ }
133
+ function keyBuilderFromType(luvio, object) {
134
+ const keyParams = {
135
+ errors: object.errors,
136
+ isCreated: object.isCreated,
137
+ isSuccess: object.isSuccess
138
+ };
139
+ return keyBuilder$8(luvio, keyParams);
140
+ }
141
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
142
+ return input;
143
+ }
144
+ const select$a = function InterestTagAssignmentOutputRepresentationSelect() {
145
+ return {
146
+ kind: 'Fragment',
147
+ version: VERSION$5,
148
+ private: [],
149
+ opaque: true
150
+ };
151
+ };
152
+ function equals$5(existing, incoming) {
153
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
154
+ return false;
155
+ }
156
+ return true;
157
+ }
158
+ function deepFreeze$3(input) {
159
+ const input_errors = input.errors;
160
+ ObjectFreeze(input_errors);
161
+ ObjectFreeze(input);
162
+ }
163
+ const ingest$3 = function InterestTagAssignmentOutputRepresentationIngest(input, path, luvio, store, timestamp) {
164
+ if (process.env.NODE_ENV !== 'production') {
165
+ const validateError = validate$7(input);
166
+ if (validateError !== null) {
167
+ throw validateError;
168
+ }
169
+ }
170
+ const key = keyBuilderFromType(luvio, input);
171
+ const existingRecord = store.readEntry(key);
172
+ const ttlToUse = TTL$1;
173
+ let incomingRecord = normalize$3(input, store.readEntry(key), {
174
+ fullPath: key,
175
+ parent: path.parent,
176
+ propertyName: path.propertyName,
177
+ ttl: ttlToUse
178
+ });
179
+ deepFreeze$3(input);
180
+ if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
181
+ luvio.storePublish(key, incomingRecord);
182
+ }
183
+ {
184
+ const storeMetadataParams = {
185
+ ttl: ttlToUse,
186
+ namespace: "interesttagging",
187
+ version: VERSION$5,
188
+ representationName: RepresentationType$3,
189
+ };
190
+ luvio.publishStoreMetadata(key, storeMetadataParams);
191
+ }
192
+ return createLink(key);
193
+ };
194
+ function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
195
+ const rootKeySet = new engine.StoreKeyMap();
196
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
197
+ const rootKey = keyBuilderFromType(luvio, input);
198
+ rootKeySet.set(rootKey, {
199
+ namespace: keyPrefix,
200
+ representationName: RepresentationType$3,
201
+ mergeable: false
202
+ });
203
+ return rootKeySet;
204
+ }
205
+
206
+ function select$9(luvio, params) {
207
+ return select$a();
208
+ }
209
+ function getResponseCacheKeys$4(luvio, resourceParams, response) {
210
+ return getTypeCacheKeys$3(luvio, response);
211
+ }
212
+ function ingestSuccess$4(luvio, resourceParams, response) {
213
+ const { body } = response;
214
+ const key = keyBuilderFromType(luvio, body);
215
+ luvio.storeIngest(key, ingest$3, body);
216
+ const snapshot = luvio.storeLookup({
217
+ recordId: key,
218
+ node: select$9(),
219
+ variables: {},
220
+ });
221
+ if (process.env.NODE_ENV !== 'production') {
222
+ if (snapshot.state !== 'Fulfilled') {
223
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
224
+ }
225
+ }
226
+ return snapshot;
227
+ }
228
+ function createResourceRequest$4(config) {
229
+ const headers = {};
230
+ return {
231
+ baseUri: '/services/data/v58.0',
232
+ basePath: '/connect/interest-tags/assignments',
233
+ method: 'post',
234
+ body: config.body,
235
+ urlParams: {},
236
+ queryParams: {},
237
+ headers,
238
+ priority: 'normal',
239
+ };
240
+ }
241
+
242
+ const createInterestTagEntityAssignment_ConfigPropertyNames = {
243
+ displayName: 'createInterestTagEntityAssignment',
244
+ parameters: {
245
+ required: ['recordsForTag', 'tagsForRecord'],
246
+ optional: []
247
+ }
248
+ };
249
+ function createResourceParams$4(config) {
250
+ const resourceParams = {
251
+ body: {
252
+ recordsForTag: config.recordsForTag, tagsForRecord: config.tagsForRecord
253
+ }
254
+ };
255
+ return resourceParams;
256
+ }
257
+ function typeCheckConfig$4(untrustedConfig) {
258
+ const config = {};
259
+ const untrustedConfig_recordsForTag = untrustedConfig.recordsForTag;
260
+ if (untrustedIsObject(untrustedConfig_recordsForTag)) {
261
+ const untrustedConfig_recordsForTag_object = {};
262
+ const untrustedConfig_recordsForTag_TagId = untrustedConfig_recordsForTag.TagId;
263
+ if (typeof untrustedConfig_recordsForTag_TagId === 'string') {
264
+ untrustedConfig_recordsForTag_object.TagId = untrustedConfig_recordsForTag_TagId;
265
+ }
266
+ const untrustedConfig_recordsForTag_RecordIds = untrustedConfig_recordsForTag.RecordIds;
267
+ if (ArrayIsArray$1(untrustedConfig_recordsForTag_RecordIds)) {
268
+ const untrustedConfig_recordsForTag_RecordIds_array = [];
269
+ for (let i = 0, arrayLength = untrustedConfig_recordsForTag_RecordIds.length; i < arrayLength; i++) {
270
+ const untrustedConfig_recordsForTag_RecordIds_item = untrustedConfig_recordsForTag_RecordIds[i];
271
+ if (typeof untrustedConfig_recordsForTag_RecordIds_item === 'string') {
272
+ untrustedConfig_recordsForTag_RecordIds_array.push(untrustedConfig_recordsForTag_RecordIds_item);
273
+ }
274
+ }
275
+ untrustedConfig_recordsForTag_object.RecordIds = untrustedConfig_recordsForTag_RecordIds_array;
276
+ }
277
+ if (untrustedConfig_recordsForTag_object !== undefined && Object.keys(untrustedConfig_recordsForTag_object).length >= 0) {
278
+ config.recordsForTag = untrustedConfig_recordsForTag_object;
279
+ }
280
+ }
281
+ const untrustedConfig_tagsForRecord = untrustedConfig.tagsForRecord;
282
+ if (untrustedIsObject(untrustedConfig_tagsForRecord)) {
283
+ const untrustedConfig_tagsForRecord_object = {};
284
+ const untrustedConfig_tagsForRecord_RecordId = untrustedConfig_tagsForRecord.RecordId;
285
+ if (typeof untrustedConfig_tagsForRecord_RecordId === 'string') {
286
+ untrustedConfig_tagsForRecord_object.RecordId = untrustedConfig_tagsForRecord_RecordId;
287
+ }
288
+ const untrustedConfig_tagsForRecord_TagIds = untrustedConfig_tagsForRecord.TagIds;
289
+ if (ArrayIsArray$1(untrustedConfig_tagsForRecord_TagIds)) {
290
+ const untrustedConfig_tagsForRecord_TagIds_array = [];
291
+ for (let i = 0, arrayLength = untrustedConfig_tagsForRecord_TagIds.length; i < arrayLength; i++) {
292
+ const untrustedConfig_tagsForRecord_TagIds_item = untrustedConfig_tagsForRecord_TagIds[i];
293
+ if (typeof untrustedConfig_tagsForRecord_TagIds_item === 'string') {
294
+ untrustedConfig_tagsForRecord_TagIds_array.push(untrustedConfig_tagsForRecord_TagIds_item);
295
+ }
296
+ }
297
+ untrustedConfig_tagsForRecord_object.TagIds = untrustedConfig_tagsForRecord_TagIds_array;
298
+ }
299
+ if (untrustedConfig_tagsForRecord_object !== undefined && Object.keys(untrustedConfig_tagsForRecord_object).length >= 0) {
300
+ config.tagsForRecord = untrustedConfig_tagsForRecord_object;
301
+ }
302
+ }
303
+ return config;
304
+ }
305
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
306
+ if (!untrustedIsObject(untrustedConfig)) {
307
+ return null;
308
+ }
309
+ if (process.env.NODE_ENV !== 'production') {
310
+ validateConfig(untrustedConfig, configPropertyNames);
311
+ }
312
+ const config = typeCheckConfig$4(untrustedConfig);
313
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
314
+ return null;
315
+ }
316
+ return config;
317
+ }
318
+ function buildNetworkSnapshot$4(luvio, config, options) {
319
+ const resourceParams = createResourceParams$4(config);
320
+ const request = createResourceRequest$4(resourceParams);
321
+ return luvio.dispatchResourceRequest(request, options)
322
+ .then((response) => {
323
+ return luvio.handleSuccessResponse(() => {
324
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response);
325
+ return luvio.storeBroadcast().then(() => snapshot);
326
+ }, () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
327
+ }, (response) => {
328
+ deepFreeze$4(response);
329
+ throw response;
330
+ });
331
+ }
332
+ const createInterestTagEntityAssignmentAdapterFactory = (luvio) => {
333
+ return function createInterestTagEntityAssignment(untrustedConfig) {
334
+ const config = validateAdapterConfig$4(untrustedConfig, createInterestTagEntityAssignment_ConfigPropertyNames);
335
+ // Invalid or incomplete config
336
+ if (config === null) {
337
+ throw new Error('Invalid config for "createInterestTagEntityAssignment"');
338
+ }
339
+ return buildNetworkSnapshot$4(luvio, config);
340
+ };
341
+ };
342
+
343
+ function validate$6(obj, path = 'TagCategoryRepresentation') {
344
+ const v_error = (() => {
345
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
346
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
347
+ }
348
+ const obj_categoryId = obj.categoryId;
349
+ const path_categoryId = path + '.categoryId';
350
+ if (typeof obj_categoryId !== 'string') {
351
+ return new TypeError('Expected "string" but received "' + typeof obj_categoryId + '" (at "' + path_categoryId + '")');
352
+ }
353
+ const obj_icon = obj.icon;
354
+ const path_icon = path + '.icon';
355
+ if (typeof obj_icon !== 'string') {
356
+ return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
357
+ }
358
+ const obj_name = obj.name;
359
+ const path_name = path + '.name';
360
+ if (typeof obj_name !== 'string') {
361
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
362
+ }
363
+ })();
364
+ return v_error === undefined ? null : v_error;
365
+ }
366
+ function deepFreeze$2(input) {
367
+ ObjectFreeze(input);
368
+ }
369
+
370
+ function validate$5(obj, path = 'InterestTagRepresentation') {
371
+ const v_error = (() => {
372
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
373
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
374
+ }
375
+ const obj_categories = obj.categories;
376
+ const path_categories = path + '.categories';
377
+ if (!ArrayIsArray(obj_categories)) {
378
+ return new TypeError('Expected "array" but received "' + typeof obj_categories + '" (at "' + path_categories + '")');
379
+ }
380
+ for (let i = 0; i < obj_categories.length; i++) {
381
+ const obj_categories_item = obj_categories[i];
382
+ const path_categories_item = path_categories + '[' + i + ']';
383
+ const referencepath_categories_itemValidationError = validate$6(obj_categories_item, path_categories_item);
384
+ if (referencepath_categories_itemValidationError !== null) {
385
+ let message = 'Object doesn\'t match TagCategoryRepresentation (at "' + path_categories_item + '")\n';
386
+ message += referencepath_categories_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
387
+ return new TypeError(message);
388
+ }
389
+ }
390
+ const obj_name = obj.name;
391
+ const path_name = path + '.name';
392
+ if (typeof obj_name !== 'string') {
393
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
394
+ }
395
+ const obj_recordAssignmentId = obj.recordAssignmentId;
396
+ const path_recordAssignmentId = path + '.recordAssignmentId';
397
+ if (typeof obj_recordAssignmentId !== 'string') {
398
+ return new TypeError('Expected "string" but received "' + typeof obj_recordAssignmentId + '" (at "' + path_recordAssignmentId + '")');
399
+ }
400
+ const obj_tagId = obj.tagId;
401
+ const path_tagId = path + '.tagId';
402
+ if (typeof obj_tagId !== 'string') {
403
+ return new TypeError('Expected "string" but received "' + typeof obj_tagId + '" (at "' + path_tagId + '")');
404
+ }
405
+ })();
406
+ return v_error === undefined ? null : v_error;
407
+ }
408
+ function deepFreeze$1(input) {
409
+ const input_categories = input.categories;
410
+ for (let i = 0; i < input_categories.length; i++) {
411
+ const input_categories_item = input_categories[i];
412
+ deepFreeze$2(input_categories_item);
413
+ }
414
+ ObjectFreeze(input_categories);
415
+ ObjectFreeze(input);
416
+ }
417
+
418
+ const TTL = 10000;
419
+ const VERSION$4 = "a7f32ea47ff9fb394c6f9e13003a5595";
420
+ function validate$4(obj, path = 'InterestTagListRepresentation') {
421
+ const v_error = (() => {
422
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
423
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
424
+ }
425
+ const obj_tags = obj.tags;
426
+ const path_tags = path + '.tags';
427
+ if (!ArrayIsArray(obj_tags)) {
428
+ return new TypeError('Expected "array" but received "' + typeof obj_tags + '" (at "' + path_tags + '")');
429
+ }
430
+ for (let i = 0; i < obj_tags.length; i++) {
431
+ const obj_tags_item = obj_tags[i];
432
+ const path_tags_item = path_tags + '[' + i + ']';
433
+ const referencepath_tags_itemValidationError = validate$5(obj_tags_item, path_tags_item);
434
+ if (referencepath_tags_itemValidationError !== null) {
435
+ let message = 'Object doesn\'t match InterestTagRepresentation (at "' + path_tags_item + '")\n';
436
+ message += referencepath_tags_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
437
+ return new TypeError(message);
438
+ }
439
+ }
440
+ })();
441
+ return v_error === undefined ? null : v_error;
442
+ }
443
+ const RepresentationType$2 = 'InterestTagListRepresentation';
444
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
445
+ return input;
446
+ }
447
+ const select$8 = function InterestTagListRepresentationSelect() {
448
+ return {
449
+ kind: 'Fragment',
450
+ version: VERSION$4,
451
+ private: [],
452
+ opaque: true
453
+ };
454
+ };
455
+ function equals$4(existing, incoming) {
456
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
457
+ return false;
458
+ }
459
+ return true;
460
+ }
461
+ function deepFreeze(input) {
462
+ const input_tags = input.tags;
463
+ for (let i = 0; i < input_tags.length; i++) {
464
+ const input_tags_item = input_tags[i];
465
+ deepFreeze$1(input_tags_item);
466
+ }
467
+ ObjectFreeze(input_tags);
468
+ ObjectFreeze(input);
469
+ }
470
+ const ingest$2 = function InterestTagListRepresentationIngest(input, path, luvio, store, timestamp) {
471
+ if (process.env.NODE_ENV !== 'production') {
472
+ const validateError = validate$4(input);
473
+ if (validateError !== null) {
474
+ throw validateError;
475
+ }
476
+ }
477
+ const key = path.fullPath;
478
+ const existingRecord = store.readEntry(key);
479
+ const ttlToUse = TTL;
480
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
481
+ fullPath: key,
482
+ parent: path.parent,
483
+ propertyName: path.propertyName,
484
+ ttl: ttlToUse
485
+ });
486
+ deepFreeze(input);
487
+ if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
488
+ luvio.storePublish(key, incomingRecord);
489
+ }
490
+ {
491
+ const storeMetadataParams = {
492
+ ttl: ttlToUse,
493
+ namespace: "interesttagging",
494
+ version: VERSION$4,
495
+ representationName: RepresentationType$2,
496
+ };
497
+ luvio.publishStoreMetadata(key, storeMetadataParams);
498
+ }
499
+ return createLink(key);
500
+ };
501
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
502
+ const rootKeySet = new engine.StoreKeyMap();
503
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
504
+ const rootKey = fullPathFactory();
505
+ rootKeySet.set(rootKey, {
506
+ namespace: keyPrefix,
507
+ representationName: RepresentationType$2,
508
+ mergeable: false
509
+ });
510
+ return rootKeySet;
511
+ }
512
+
513
+ function select$7(luvio, params) {
514
+ return select$8();
515
+ }
516
+ function keyBuilder$7(luvio, params) {
517
+ return keyPrefix + '::InterestTagListRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'orderBy:' + params.queryParams.orderBy + ',' + 'sort:' + params.queryParams.sort + ',' + 'recordId:' + params.urlParams.recordId + ')';
518
+ }
519
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
520
+ return getTypeCacheKeys$2(luvio, response, () => keyBuilder$7(luvio, resourceParams));
521
+ }
522
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
523
+ const { body } = response;
524
+ const key = keyBuilder$7(luvio, resourceParams);
525
+ luvio.storeIngest(key, ingest$2, body);
526
+ const snapshot = luvio.storeLookup({
527
+ recordId: key,
528
+ node: select$7(),
529
+ variables: {},
530
+ }, snapshotRefresh);
531
+ if (process.env.NODE_ENV !== 'production') {
532
+ if (snapshot.state !== 'Fulfilled') {
533
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
534
+ }
535
+ }
536
+ return snapshot;
537
+ }
538
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
539
+ const key = keyBuilder$7(luvio, params);
540
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
541
+ const storeMetadataParams = {
542
+ ttl: TTL,
543
+ namespace: keyPrefix,
544
+ version: VERSION$4,
545
+ representationName: RepresentationType$2
546
+ };
547
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
548
+ return errorSnapshot;
549
+ }
550
+ function createResourceRequest$3(config) {
551
+ const headers = {};
552
+ return {
553
+ baseUri: '/services/data/v58.0',
554
+ basePath: '/connect/interest-tags/assignments/entity/' + config.urlParams.recordId + '',
555
+ method: 'get',
556
+ body: null,
557
+ urlParams: config.urlParams,
558
+ queryParams: config.queryParams,
559
+ headers,
560
+ priority: 'normal',
561
+ };
562
+ }
563
+
564
+ const getTagsByRecordId_ConfigPropertyNames = {
565
+ displayName: 'getTagsByRecordId',
566
+ parameters: {
567
+ required: ['recordId'],
568
+ optional: ['limit', 'offset', 'orderBy', 'sort']
569
+ }
570
+ };
571
+ function createResourceParams$3(config) {
572
+ const resourceParams = {
573
+ urlParams: {
574
+ recordId: config.recordId
575
+ },
576
+ queryParams: {
577
+ limit: config.limit, offset: config.offset, orderBy: config.orderBy, sort: config.sort
578
+ }
579
+ };
580
+ return resourceParams;
581
+ }
582
+ function keyBuilder$6(luvio, config) {
583
+ const resourceParams = createResourceParams$3(config);
584
+ return keyBuilder$7(luvio, resourceParams);
585
+ }
586
+ function typeCheckConfig$3(untrustedConfig) {
587
+ const config = {};
588
+ const untrustedConfig_recordId = untrustedConfig.recordId;
589
+ if (typeof untrustedConfig_recordId === 'string') {
590
+ config.recordId = untrustedConfig_recordId;
591
+ }
592
+ const untrustedConfig_limit = untrustedConfig.limit;
593
+ if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
594
+ config.limit = untrustedConfig_limit;
595
+ }
596
+ const untrustedConfig_offset = untrustedConfig.offset;
597
+ if (typeof untrustedConfig_offset === 'number' && Math.floor(untrustedConfig_offset) === untrustedConfig_offset) {
598
+ config.offset = untrustedConfig_offset;
599
+ }
600
+ const untrustedConfig_orderBy = untrustedConfig.orderBy;
601
+ if (typeof untrustedConfig_orderBy === 'string') {
602
+ config.orderBy = untrustedConfig_orderBy;
603
+ }
604
+ const untrustedConfig_sort = untrustedConfig.sort;
605
+ if (typeof untrustedConfig_sort === 'string') {
606
+ config.sort = untrustedConfig_sort;
607
+ }
608
+ return config;
609
+ }
610
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
611
+ if (!untrustedIsObject(untrustedConfig)) {
612
+ return null;
613
+ }
614
+ if (process.env.NODE_ENV !== 'production') {
615
+ validateConfig(untrustedConfig, configPropertyNames);
616
+ }
617
+ const config = typeCheckConfig$3(untrustedConfig);
618
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
619
+ return null;
620
+ }
621
+ return config;
622
+ }
623
+ function adapterFragment$3(luvio, config) {
624
+ createResourceParams$3(config);
625
+ return select$7();
626
+ }
627
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
628
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
629
+ config,
630
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
631
+ });
632
+ return luvio.storeBroadcast().then(() => snapshot);
633
+ }
634
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
635
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
636
+ config,
637
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
638
+ });
639
+ return luvio.storeBroadcast().then(() => snapshot);
640
+ }
641
+ function buildNetworkSnapshot$3(luvio, config, options) {
642
+ const resourceParams = createResourceParams$3(config);
643
+ const request = createResourceRequest$3(resourceParams);
644
+ return luvio.dispatchResourceRequest(request, options)
645
+ .then((response) => {
646
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
647
+ }, (response) => {
648
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
649
+ });
650
+ }
651
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
652
+ const { luvio, config } = context;
653
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
654
+ const dispatchOptions = {
655
+ resourceRequestContext: {
656
+ requestCorrelator,
657
+ luvioRequestMethod: undefined,
658
+ },
659
+ eventObservers
660
+ };
661
+ if (networkPriority !== 'normal') {
662
+ dispatchOptions.overrides = {
663
+ priority: networkPriority
664
+ };
665
+ }
666
+ return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
667
+ }
668
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
669
+ const { luvio, config } = context;
670
+ const selector = {
671
+ recordId: keyBuilder$6(luvio, config),
672
+ node: adapterFragment$3(luvio, config),
673
+ variables: {},
674
+ };
675
+ const cacheSnapshot = storeLookup(selector, {
676
+ config,
677
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
678
+ });
679
+ return cacheSnapshot;
680
+ }
681
+ const getTagsByRecordIdAdapterFactory = (luvio) => function interesttagging__getTagsByRecordId(untrustedConfig, requestContext) {
682
+ const config = validateAdapterConfig$3(untrustedConfig, getTagsByRecordId_ConfigPropertyNames);
683
+ // Invalid or incomplete config
684
+ if (config === null) {
685
+ return null;
686
+ }
687
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
688
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
689
+ };
690
+
691
+ const VERSION$3 = "bead7737d6de24db2005f390553ce4bf";
692
+ function validate$3(obj, path = 'TagRecordAssignment') {
693
+ const v_error = (() => {
694
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
695
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
696
+ }
697
+ const obj_assignmentId = obj.assignmentId;
698
+ const path_assignmentId = path + '.assignmentId';
699
+ if (typeof obj_assignmentId !== 'string') {
700
+ return new TypeError('Expected "string" but received "' + typeof obj_assignmentId + '" (at "' + path_assignmentId + '")');
701
+ }
702
+ const obj_objectName = obj.objectName;
703
+ const path_objectName = path + '.objectName';
704
+ if (typeof obj_objectName !== 'string') {
705
+ return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
706
+ }
707
+ const obj_recordId = obj.recordId;
708
+ const path_recordId = path + '.recordId';
709
+ if (typeof obj_recordId !== 'string') {
710
+ return new TypeError('Expected "string" but received "' + typeof obj_recordId + '" (at "' + path_recordId + '")');
711
+ }
712
+ const obj_recordName = obj.recordName;
713
+ const path_recordName = path + '.recordName';
714
+ if (typeof obj_recordName !== 'string') {
715
+ return new TypeError('Expected "string" but received "' + typeof obj_recordName + '" (at "' + path_recordName + '")');
716
+ }
717
+ })();
718
+ return v_error === undefined ? null : v_error;
719
+ }
720
+ const select$6 = function TagRecordAssignmentSelect() {
721
+ return {
722
+ kind: 'Fragment',
723
+ version: VERSION$3,
724
+ private: [],
725
+ selections: [
726
+ {
727
+ name: 'assignmentId',
728
+ kind: 'Scalar'
729
+ },
730
+ {
731
+ name: 'objectName',
732
+ kind: 'Scalar'
733
+ },
734
+ {
735
+ name: 'recordId',
736
+ kind: 'Scalar'
737
+ },
738
+ {
739
+ name: 'recordName',
740
+ kind: 'Scalar'
741
+ }
742
+ ]
743
+ };
744
+ };
745
+ function equals$3(existing, incoming) {
746
+ const existing_assignmentId = existing.assignmentId;
747
+ const incoming_assignmentId = incoming.assignmentId;
748
+ if (!(existing_assignmentId === incoming_assignmentId)) {
749
+ return false;
750
+ }
751
+ const existing_objectName = existing.objectName;
752
+ const incoming_objectName = incoming.objectName;
753
+ if (!(existing_objectName === incoming_objectName)) {
754
+ return false;
755
+ }
756
+ const existing_recordId = existing.recordId;
757
+ const incoming_recordId = incoming.recordId;
758
+ if (!(existing_recordId === incoming_recordId)) {
759
+ return false;
760
+ }
761
+ const existing_recordName = existing.recordName;
762
+ const incoming_recordName = incoming.recordName;
763
+ if (!(existing_recordName === incoming_recordName)) {
764
+ return false;
765
+ }
766
+ return true;
767
+ }
768
+
769
+ const VERSION$2 = "2c249834bed42974b83ef01b3abacb2c";
770
+ function validate$2(obj, path = 'TagRecordAssignmentCollectionRepresentation') {
771
+ const v_error = (() => {
772
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
773
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
774
+ }
775
+ const obj_assignments = obj.assignments;
776
+ const path_assignments = path + '.assignments';
777
+ if (!ArrayIsArray(obj_assignments)) {
778
+ return new TypeError('Expected "array" but received "' + typeof obj_assignments + '" (at "' + path_assignments + '")');
779
+ }
780
+ for (let i = 0; i < obj_assignments.length; i++) {
781
+ const obj_assignments_item = obj_assignments[i];
782
+ const path_assignments_item = path_assignments + '[' + i + ']';
783
+ const referencepath_assignments_itemValidationError = validate$3(obj_assignments_item, path_assignments_item);
784
+ if (referencepath_assignments_itemValidationError !== null) {
785
+ let message = 'Object doesn\'t match TagRecordAssignment (at "' + path_assignments_item + '")\n';
786
+ message += referencepath_assignments_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
787
+ return new TypeError(message);
788
+ }
789
+ }
790
+ })();
791
+ return v_error === undefined ? null : v_error;
792
+ }
793
+ const RepresentationType$1 = 'TagRecordAssignmentCollectionRepresentation';
794
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
795
+ return input;
796
+ }
797
+ const select$5 = function TagRecordAssignmentCollectionRepresentationSelect() {
798
+ const { selections: TagRecordAssignment__selections, opaque: TagRecordAssignment__opaque, } = select$6();
799
+ return {
800
+ kind: 'Fragment',
801
+ version: VERSION$2,
802
+ private: [],
803
+ selections: [
804
+ {
805
+ name: 'assignments',
806
+ kind: 'Object',
807
+ plural: true,
808
+ selections: TagRecordAssignment__selections
809
+ }
810
+ ]
811
+ };
812
+ };
813
+ function equals$2(existing, incoming) {
814
+ const existing_assignments = existing.assignments;
815
+ const incoming_assignments = incoming.assignments;
816
+ const equals_assignments_items = equalsArray(existing_assignments, incoming_assignments, (existing_assignments_item, incoming_assignments_item) => {
817
+ if (!(equals$3(existing_assignments_item, incoming_assignments_item))) {
818
+ return false;
819
+ }
820
+ });
821
+ if (equals_assignments_items === false) {
822
+ return false;
823
+ }
824
+ return true;
825
+ }
826
+ const ingest$1 = function TagRecordAssignmentCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
827
+ if (process.env.NODE_ENV !== 'production') {
828
+ const validateError = validate$2(input);
829
+ if (validateError !== null) {
830
+ throw validateError;
831
+ }
832
+ }
833
+ const key = path.fullPath;
834
+ const existingRecord = store.readEntry(key);
835
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
836
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
837
+ fullPath: key,
838
+ parent: path.parent,
839
+ propertyName: path.propertyName,
840
+ ttl: ttlToUse
841
+ });
842
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
843
+ luvio.storePublish(key, incomingRecord);
844
+ }
845
+ if (ttlToUse !== undefined) {
846
+ const storeMetadataParams = {
847
+ ttl: ttlToUse,
848
+ namespace: "interesttagging",
849
+ version: VERSION$2,
850
+ representationName: RepresentationType$1,
851
+ };
852
+ luvio.publishStoreMetadata(key, storeMetadataParams);
853
+ }
854
+ return createLink(key);
855
+ };
856
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
857
+ const rootKeySet = new engine.StoreKeyMap();
858
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
859
+ const rootKey = fullPathFactory();
860
+ rootKeySet.set(rootKey, {
861
+ namespace: keyPrefix,
862
+ representationName: RepresentationType$1,
863
+ mergeable: false
864
+ });
865
+ return rootKeySet;
866
+ }
867
+
868
+ function select$4(luvio, params) {
869
+ return select$5();
870
+ }
871
+ function keyBuilder$5(luvio, params) {
872
+ return keyPrefix + '::TagRecordAssignmentCollectionRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'orderBy:' + params.queryParams.orderBy + ',' + 'sort:' + params.queryParams.sort + ',' + 'tagId:' + params.urlParams.tagId + ')';
873
+ }
874
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
875
+ return getTypeCacheKeys$1(luvio, response, () => keyBuilder$5(luvio, resourceParams));
876
+ }
877
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
878
+ const { body } = response;
879
+ const key = keyBuilder$5(luvio, resourceParams);
880
+ luvio.storeIngest(key, ingest$1, body);
881
+ const snapshot = luvio.storeLookup({
882
+ recordId: key,
883
+ node: select$4(),
884
+ variables: {},
885
+ }, snapshotRefresh);
886
+ if (process.env.NODE_ENV !== 'production') {
887
+ if (snapshot.state !== 'Fulfilled') {
888
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
889
+ }
890
+ }
891
+ return snapshot;
892
+ }
893
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
894
+ const key = keyBuilder$5(luvio, params);
895
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
896
+ luvio.storeIngestError(key, errorSnapshot);
897
+ return errorSnapshot;
898
+ }
899
+ function createResourceRequest$2(config) {
900
+ const headers = {};
901
+ return {
902
+ baseUri: '/services/data/v58.0',
903
+ basePath: '/connect/interest-tags/assignments/tag/' + config.urlParams.tagId + '',
904
+ method: 'get',
905
+ body: null,
906
+ urlParams: config.urlParams,
907
+ queryParams: config.queryParams,
908
+ headers,
909
+ priority: 'normal',
910
+ };
911
+ }
912
+
913
+ const getInterestTagEntityAssignments_ConfigPropertyNames = {
914
+ displayName: 'getInterestTagEntityAssignments',
915
+ parameters: {
916
+ required: ['tagId'],
917
+ optional: ['limit', 'offset', 'orderBy', 'sort']
918
+ }
919
+ };
920
+ function createResourceParams$2(config) {
921
+ const resourceParams = {
922
+ urlParams: {
923
+ tagId: config.tagId
924
+ },
925
+ queryParams: {
926
+ limit: config.limit, offset: config.offset, orderBy: config.orderBy, sort: config.sort
927
+ }
928
+ };
929
+ return resourceParams;
930
+ }
931
+ function keyBuilder$4(luvio, config) {
932
+ const resourceParams = createResourceParams$2(config);
933
+ return keyBuilder$5(luvio, resourceParams);
934
+ }
935
+ function typeCheckConfig$2(untrustedConfig) {
936
+ const config = {};
937
+ const untrustedConfig_tagId = untrustedConfig.tagId;
938
+ if (typeof untrustedConfig_tagId === 'string') {
939
+ config.tagId = untrustedConfig_tagId;
940
+ }
941
+ const untrustedConfig_limit = untrustedConfig.limit;
942
+ if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
943
+ config.limit = untrustedConfig_limit;
944
+ }
945
+ const untrustedConfig_offset = untrustedConfig.offset;
946
+ if (typeof untrustedConfig_offset === 'number' && Math.floor(untrustedConfig_offset) === untrustedConfig_offset) {
947
+ config.offset = untrustedConfig_offset;
948
+ }
949
+ const untrustedConfig_orderBy = untrustedConfig.orderBy;
950
+ if (typeof untrustedConfig_orderBy === 'string') {
951
+ config.orderBy = untrustedConfig_orderBy;
952
+ }
953
+ const untrustedConfig_sort = untrustedConfig.sort;
954
+ if (typeof untrustedConfig_sort === 'string') {
955
+ config.sort = untrustedConfig_sort;
956
+ }
957
+ return config;
958
+ }
959
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
960
+ if (!untrustedIsObject(untrustedConfig)) {
961
+ return null;
962
+ }
963
+ if (process.env.NODE_ENV !== 'production') {
964
+ validateConfig(untrustedConfig, configPropertyNames);
965
+ }
966
+ const config = typeCheckConfig$2(untrustedConfig);
967
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
968
+ return null;
969
+ }
970
+ return config;
971
+ }
972
+ function adapterFragment$2(luvio, config) {
973
+ createResourceParams$2(config);
974
+ return select$4();
975
+ }
976
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
977
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
978
+ config,
979
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
980
+ });
981
+ return luvio.storeBroadcast().then(() => snapshot);
982
+ }
983
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
984
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
985
+ config,
986
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
987
+ });
988
+ return luvio.storeBroadcast().then(() => snapshot);
989
+ }
990
+ function buildNetworkSnapshot$2(luvio, config, options) {
991
+ const resourceParams = createResourceParams$2(config);
992
+ const request = createResourceRequest$2(resourceParams);
993
+ return luvio.dispatchResourceRequest(request, options)
994
+ .then((response) => {
995
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
996
+ }, (response) => {
997
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
998
+ });
999
+ }
1000
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
1001
+ const { luvio, config } = context;
1002
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1003
+ const dispatchOptions = {
1004
+ resourceRequestContext: {
1005
+ requestCorrelator,
1006
+ luvioRequestMethod: undefined,
1007
+ },
1008
+ eventObservers
1009
+ };
1010
+ if (networkPriority !== 'normal') {
1011
+ dispatchOptions.overrides = {
1012
+ priority: networkPriority
1013
+ };
1014
+ }
1015
+ return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
1016
+ }
1017
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
1018
+ const { luvio, config } = context;
1019
+ const selector = {
1020
+ recordId: keyBuilder$4(luvio, config),
1021
+ node: adapterFragment$2(luvio, config),
1022
+ variables: {},
1023
+ };
1024
+ const cacheSnapshot = storeLookup(selector, {
1025
+ config,
1026
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1027
+ });
1028
+ return cacheSnapshot;
1029
+ }
1030
+ const getInterestTagEntityAssignmentsAdapterFactory = (luvio) => function interesttagging__getInterestTagEntityAssignments(untrustedConfig, requestContext) {
1031
+ const config = validateAdapterConfig$2(untrustedConfig, getInterestTagEntityAssignments_ConfigPropertyNames);
1032
+ // Invalid or incomplete config
1033
+ if (config === null) {
1034
+ return null;
1035
+ }
1036
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1037
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
1038
+ };
1039
+
1040
+ const VERSION$1 = "2dcce5f2b607682447018f5b9db9cd4d";
1041
+ function validate$1(obj, path = 'TagCategoryWithParentRepresentation') {
1042
+ const v_error = (() => {
1043
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1044
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1045
+ }
1046
+ const obj_categoryId = obj.categoryId;
1047
+ const path_categoryId = path + '.categoryId';
1048
+ if (typeof obj_categoryId !== 'string') {
1049
+ return new TypeError('Expected "string" but received "' + typeof obj_categoryId + '" (at "' + path_categoryId + '")');
1050
+ }
1051
+ const obj_icon = obj.icon;
1052
+ const path_icon = path + '.icon';
1053
+ if (typeof obj_icon !== 'string') {
1054
+ return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
1055
+ }
1056
+ const obj_name = obj.name;
1057
+ const path_name = path + '.name';
1058
+ if (typeof obj_name !== 'string') {
1059
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1060
+ }
1061
+ const obj_parentCategoryId = obj.parentCategoryId;
1062
+ const path_parentCategoryId = path + '.parentCategoryId';
1063
+ if (typeof obj_parentCategoryId !== 'string') {
1064
+ return new TypeError('Expected "string" but received "' + typeof obj_parentCategoryId + '" (at "' + path_parentCategoryId + '")');
1065
+ }
1066
+ const obj_parentCategoryName = obj.parentCategoryName;
1067
+ const path_parentCategoryName = path + '.parentCategoryName';
1068
+ if (typeof obj_parentCategoryName !== 'string') {
1069
+ return new TypeError('Expected "string" but received "' + typeof obj_parentCategoryName + '" (at "' + path_parentCategoryName + '")');
1070
+ }
1071
+ const obj_tagCategoryAssignmentId = obj.tagCategoryAssignmentId;
1072
+ const path_tagCategoryAssignmentId = path + '.tagCategoryAssignmentId';
1073
+ if (typeof obj_tagCategoryAssignmentId !== 'string') {
1074
+ return new TypeError('Expected "string" but received "' + typeof obj_tagCategoryAssignmentId + '" (at "' + path_tagCategoryAssignmentId + '")');
1075
+ }
1076
+ })();
1077
+ return v_error === undefined ? null : v_error;
1078
+ }
1079
+ const select$3 = function TagCategoryWithParentRepresentationSelect() {
1080
+ return {
1081
+ kind: 'Fragment',
1082
+ version: VERSION$1,
1083
+ private: [],
1084
+ selections: [
1085
+ {
1086
+ name: 'categoryId',
1087
+ kind: 'Scalar'
1088
+ },
1089
+ {
1090
+ name: 'icon',
1091
+ kind: 'Scalar'
1092
+ },
1093
+ {
1094
+ name: 'name',
1095
+ kind: 'Scalar'
1096
+ },
1097
+ {
1098
+ name: 'parentCategoryId',
1099
+ kind: 'Scalar'
1100
+ },
1101
+ {
1102
+ name: 'parentCategoryName',
1103
+ kind: 'Scalar'
1104
+ },
1105
+ {
1106
+ name: 'tagCategoryAssignmentId',
1107
+ kind: 'Scalar'
1108
+ }
1109
+ ]
1110
+ };
1111
+ };
1112
+ function equals$1(existing, incoming) {
1113
+ const existing_categoryId = existing.categoryId;
1114
+ const incoming_categoryId = incoming.categoryId;
1115
+ if (!(existing_categoryId === incoming_categoryId)) {
1116
+ return false;
1117
+ }
1118
+ const existing_icon = existing.icon;
1119
+ const incoming_icon = incoming.icon;
1120
+ if (!(existing_icon === incoming_icon)) {
1121
+ return false;
1122
+ }
1123
+ const existing_name = existing.name;
1124
+ const incoming_name = incoming.name;
1125
+ if (!(existing_name === incoming_name)) {
1126
+ return false;
1127
+ }
1128
+ const existing_parentCategoryId = existing.parentCategoryId;
1129
+ const incoming_parentCategoryId = incoming.parentCategoryId;
1130
+ if (!(existing_parentCategoryId === incoming_parentCategoryId)) {
1131
+ return false;
1132
+ }
1133
+ const existing_parentCategoryName = existing.parentCategoryName;
1134
+ const incoming_parentCategoryName = incoming.parentCategoryName;
1135
+ if (!(existing_parentCategoryName === incoming_parentCategoryName)) {
1136
+ return false;
1137
+ }
1138
+ const existing_tagCategoryAssignmentId = existing.tagCategoryAssignmentId;
1139
+ const incoming_tagCategoryAssignmentId = incoming.tagCategoryAssignmentId;
1140
+ if (!(existing_tagCategoryAssignmentId === incoming_tagCategoryAssignmentId)) {
1141
+ return false;
1142
+ }
1143
+ return true;
1144
+ }
1145
+
1146
+ const VERSION = "9b56734fafb1d500056d1c1cdb6fe22d";
1147
+ function validate(obj, path = 'TagCategoryListRepresentation') {
1148
+ const v_error = (() => {
1149
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1150
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1151
+ }
1152
+ const obj_categories = obj.categories;
1153
+ const path_categories = path + '.categories';
1154
+ if (!ArrayIsArray(obj_categories)) {
1155
+ return new TypeError('Expected "array" but received "' + typeof obj_categories + '" (at "' + path_categories + '")');
1156
+ }
1157
+ for (let i = 0; i < obj_categories.length; i++) {
1158
+ const obj_categories_item = obj_categories[i];
1159
+ const path_categories_item = path_categories + '[' + i + ']';
1160
+ const referencepath_categories_itemValidationError = validate$1(obj_categories_item, path_categories_item);
1161
+ if (referencepath_categories_itemValidationError !== null) {
1162
+ let message = 'Object doesn\'t match TagCategoryWithParentRepresentation (at "' + path_categories_item + '")\n';
1163
+ message += referencepath_categories_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1164
+ return new TypeError(message);
1165
+ }
1166
+ }
1167
+ })();
1168
+ return v_error === undefined ? null : v_error;
1169
+ }
1170
+ const RepresentationType = 'TagCategoryListRepresentation';
1171
+ function normalize(input, existing, path, luvio, store, timestamp) {
1172
+ return input;
1173
+ }
1174
+ const select$2 = function TagCategoryListRepresentationSelect() {
1175
+ const { selections: TagCategoryWithParentRepresentation__selections, opaque: TagCategoryWithParentRepresentation__opaque, } = select$3();
1176
+ return {
1177
+ kind: 'Fragment',
1178
+ version: VERSION,
1179
+ private: [],
1180
+ selections: [
1181
+ {
1182
+ name: 'categories',
1183
+ kind: 'Object',
1184
+ plural: true,
1185
+ selections: TagCategoryWithParentRepresentation__selections
1186
+ }
1187
+ ]
1188
+ };
1189
+ };
1190
+ function equals(existing, incoming) {
1191
+ const existing_categories = existing.categories;
1192
+ const incoming_categories = incoming.categories;
1193
+ const equals_categories_items = equalsArray(existing_categories, incoming_categories, (existing_categories_item, incoming_categories_item) => {
1194
+ if (!(equals$1(existing_categories_item, incoming_categories_item))) {
1195
+ return false;
1196
+ }
1197
+ });
1198
+ if (equals_categories_items === false) {
1199
+ return false;
1200
+ }
1201
+ return true;
1202
+ }
1203
+ const ingest = function TagCategoryListRepresentationIngest(input, path, luvio, store, timestamp) {
1204
+ if (process.env.NODE_ENV !== 'production') {
1205
+ const validateError = validate(input);
1206
+ if (validateError !== null) {
1207
+ throw validateError;
1208
+ }
1209
+ }
1210
+ const key = path.fullPath;
1211
+ const existingRecord = store.readEntry(key);
1212
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
1213
+ let incomingRecord = normalize(input, store.readEntry(key), {
1214
+ fullPath: key,
1215
+ parent: path.parent,
1216
+ propertyName: path.propertyName,
1217
+ ttl: ttlToUse
1218
+ });
1219
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
1220
+ luvio.storePublish(key, incomingRecord);
1221
+ }
1222
+ if (ttlToUse !== undefined) {
1223
+ const storeMetadataParams = {
1224
+ ttl: ttlToUse,
1225
+ namespace: "interesttagging",
1226
+ version: VERSION,
1227
+ representationName: RepresentationType,
1228
+ };
1229
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1230
+ }
1231
+ return createLink(key);
1232
+ };
1233
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
1234
+ const rootKeySet = new engine.StoreKeyMap();
1235
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1236
+ const rootKey = fullPathFactory();
1237
+ rootKeySet.set(rootKey, {
1238
+ namespace: keyPrefix,
1239
+ representationName: RepresentationType,
1240
+ mergeable: false
1241
+ });
1242
+ return rootKeySet;
1243
+ }
1244
+
1245
+ function select$1(luvio, params) {
1246
+ return select$2();
1247
+ }
1248
+ function keyBuilder$3(luvio, params) {
1249
+ return keyPrefix + '::TagCategoryListRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'orderBy:' + params.queryParams.orderBy + ',' + 'sort:' + params.queryParams.sort + ',' + 'tagId:' + params.queryParams.tagId + ')';
1250
+ }
1251
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
1252
+ return getTypeCacheKeys(luvio, response, () => keyBuilder$3(luvio, resourceParams));
1253
+ }
1254
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1255
+ const { body } = response;
1256
+ const key = keyBuilder$3(luvio, resourceParams);
1257
+ luvio.storeIngest(key, ingest, body);
1258
+ const snapshot = luvio.storeLookup({
1259
+ recordId: key,
1260
+ node: select$1(),
1261
+ variables: {},
1262
+ }, snapshotRefresh);
1263
+ if (process.env.NODE_ENV !== 'production') {
1264
+ if (snapshot.state !== 'Fulfilled') {
1265
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1266
+ }
1267
+ }
1268
+ return snapshot;
1269
+ }
1270
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1271
+ const key = keyBuilder$3(luvio, params);
1272
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1273
+ luvio.storeIngestError(key, errorSnapshot);
1274
+ return errorSnapshot;
1275
+ }
1276
+ function createResourceRequest$1(config) {
1277
+ const headers = {};
1278
+ return {
1279
+ baseUri: '/services/data/v58.0',
1280
+ basePath: '/connect/interest-tags/categories',
1281
+ method: 'get',
1282
+ body: null,
1283
+ urlParams: {},
1284
+ queryParams: config.queryParams,
1285
+ headers,
1286
+ priority: 'normal',
1287
+ };
1288
+ }
1289
+
1290
+ const getTagCategoriesByTagId_ConfigPropertyNames = {
1291
+ displayName: 'getTagCategoriesByTagId',
1292
+ parameters: {
1293
+ required: [],
1294
+ optional: ['limit', 'offset', 'orderBy', 'sort', 'tagId']
1295
+ }
1296
+ };
1297
+ function createResourceParams$1(config) {
1298
+ const resourceParams = {
1299
+ queryParams: {
1300
+ limit: config.limit, offset: config.offset, orderBy: config.orderBy, sort: config.sort, tagId: config.tagId
1301
+ }
1302
+ };
1303
+ return resourceParams;
1304
+ }
1305
+ function keyBuilder$2(luvio, config) {
1306
+ const resourceParams = createResourceParams$1(config);
1307
+ return keyBuilder$3(luvio, resourceParams);
1308
+ }
1309
+ function typeCheckConfig$1(untrustedConfig) {
1310
+ const config = {};
1311
+ const untrustedConfig_limit = untrustedConfig.limit;
1312
+ if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
1313
+ config.limit = untrustedConfig_limit;
1314
+ }
1315
+ const untrustedConfig_offset = untrustedConfig.offset;
1316
+ if (typeof untrustedConfig_offset === 'number' && Math.floor(untrustedConfig_offset) === untrustedConfig_offset) {
1317
+ config.offset = untrustedConfig_offset;
1318
+ }
1319
+ const untrustedConfig_orderBy = untrustedConfig.orderBy;
1320
+ if (typeof untrustedConfig_orderBy === 'string') {
1321
+ config.orderBy = untrustedConfig_orderBy;
1322
+ }
1323
+ const untrustedConfig_sort = untrustedConfig.sort;
1324
+ if (typeof untrustedConfig_sort === 'string') {
1325
+ config.sort = untrustedConfig_sort;
1326
+ }
1327
+ const untrustedConfig_tagId = untrustedConfig.tagId;
1328
+ if (typeof untrustedConfig_tagId === 'string') {
1329
+ config.tagId = untrustedConfig_tagId;
1330
+ }
1331
+ return config;
1332
+ }
1333
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1334
+ if (!untrustedIsObject(untrustedConfig)) {
1335
+ return null;
1336
+ }
1337
+ if (process.env.NODE_ENV !== 'production') {
1338
+ validateConfig(untrustedConfig, configPropertyNames);
1339
+ }
1340
+ const config = typeCheckConfig$1(untrustedConfig);
1341
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1342
+ return null;
1343
+ }
1344
+ return config;
1345
+ }
1346
+ function adapterFragment$1(luvio, config) {
1347
+ createResourceParams$1(config);
1348
+ return select$1();
1349
+ }
1350
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1351
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1352
+ config,
1353
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1354
+ });
1355
+ return luvio.storeBroadcast().then(() => snapshot);
1356
+ }
1357
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1358
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1359
+ config,
1360
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1361
+ });
1362
+ return luvio.storeBroadcast().then(() => snapshot);
1363
+ }
1364
+ function buildNetworkSnapshot$1(luvio, config, options) {
1365
+ const resourceParams = createResourceParams$1(config);
1366
+ const request = createResourceRequest$1(resourceParams);
1367
+ return luvio.dispatchResourceRequest(request, options)
1368
+ .then((response) => {
1369
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
1370
+ }, (response) => {
1371
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1372
+ });
1373
+ }
1374
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1375
+ const { luvio, config } = context;
1376
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1377
+ const dispatchOptions = {
1378
+ resourceRequestContext: {
1379
+ requestCorrelator,
1380
+ luvioRequestMethod: undefined,
1381
+ },
1382
+ eventObservers
1383
+ };
1384
+ if (networkPriority !== 'normal') {
1385
+ dispatchOptions.overrides = {
1386
+ priority: networkPriority
1387
+ };
1388
+ }
1389
+ return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
1390
+ }
1391
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1392
+ const { luvio, config } = context;
1393
+ const selector = {
1394
+ recordId: keyBuilder$2(luvio, config),
1395
+ node: adapterFragment$1(luvio, config),
1396
+ variables: {},
1397
+ };
1398
+ const cacheSnapshot = storeLookup(selector, {
1399
+ config,
1400
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1401
+ });
1402
+ return cacheSnapshot;
1403
+ }
1404
+ const getTagCategoriesByTagIdAdapterFactory = (luvio) => function interesttagging__getTagCategoriesByTagId(untrustedConfig, requestContext) {
1405
+ const config = validateAdapterConfig$1(untrustedConfig, getTagCategoriesByTagId_ConfigPropertyNames);
1406
+ // Invalid or incomplete config
1407
+ if (config === null) {
1408
+ return null;
1409
+ }
1410
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1411
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1412
+ };
1413
+
1414
+ function select(luvio, params) {
1415
+ return select$8();
1416
+ }
1417
+ function keyBuilder$1(luvio, params) {
1418
+ return keyPrefix + '::InterestTagListRepresentation:(' + 'categoryId:' + params.queryParams.categoryId + ',' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'orderBy:' + params.queryParams.orderBy + ',' + 'sort:' + params.queryParams.sort + ')';
1419
+ }
1420
+ function getResponseCacheKeys(luvio, resourceParams, response) {
1421
+ return getTypeCacheKeys$2(luvio, response, () => keyBuilder$1(luvio, resourceParams));
1422
+ }
1423
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1424
+ const { body } = response;
1425
+ const key = keyBuilder$1(luvio, resourceParams);
1426
+ luvio.storeIngest(key, ingest$2, body);
1427
+ const snapshot = luvio.storeLookup({
1428
+ recordId: key,
1429
+ node: select(),
1430
+ variables: {},
1431
+ }, snapshotRefresh);
1432
+ if (process.env.NODE_ENV !== 'production') {
1433
+ if (snapshot.state !== 'Fulfilled') {
1434
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1435
+ }
1436
+ }
1437
+ return snapshot;
1438
+ }
1439
+ function ingestError(luvio, params, error, snapshotRefresh) {
1440
+ const key = keyBuilder$1(luvio, params);
1441
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1442
+ const storeMetadataParams = {
1443
+ ttl: TTL,
1444
+ namespace: keyPrefix,
1445
+ version: VERSION$4,
1446
+ representationName: RepresentationType$2
1447
+ };
1448
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1449
+ return errorSnapshot;
1450
+ }
1451
+ function createResourceRequest(config) {
1452
+ const headers = {};
1453
+ return {
1454
+ baseUri: '/services/data/v58.0',
1455
+ basePath: '/connect/interest-tags/tags',
1456
+ method: 'get',
1457
+ body: null,
1458
+ urlParams: {},
1459
+ queryParams: config.queryParams,
1460
+ headers,
1461
+ priority: 'normal',
1462
+ };
1463
+ }
1464
+
1465
+ const getTagsByCategoryId_ConfigPropertyNames = {
1466
+ displayName: 'getTagsByCategoryId',
1467
+ parameters: {
1468
+ required: [],
1469
+ optional: ['categoryId', 'limit', 'offset', 'orderBy', 'sort']
1470
+ }
1471
+ };
1472
+ function createResourceParams(config) {
1473
+ const resourceParams = {
1474
+ queryParams: {
1475
+ categoryId: config.categoryId, limit: config.limit, offset: config.offset, orderBy: config.orderBy, sort: config.sort
1476
+ }
1477
+ };
1478
+ return resourceParams;
1479
+ }
1480
+ function keyBuilder(luvio, config) {
1481
+ const resourceParams = createResourceParams(config);
1482
+ return keyBuilder$1(luvio, resourceParams);
1483
+ }
1484
+ function typeCheckConfig(untrustedConfig) {
1485
+ const config = {};
1486
+ const untrustedConfig_categoryId = untrustedConfig.categoryId;
1487
+ if (typeof untrustedConfig_categoryId === 'string') {
1488
+ config.categoryId = untrustedConfig_categoryId;
1489
+ }
1490
+ const untrustedConfig_limit = untrustedConfig.limit;
1491
+ if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
1492
+ config.limit = untrustedConfig_limit;
1493
+ }
1494
+ const untrustedConfig_offset = untrustedConfig.offset;
1495
+ if (typeof untrustedConfig_offset === 'number' && Math.floor(untrustedConfig_offset) === untrustedConfig_offset) {
1496
+ config.offset = untrustedConfig_offset;
1497
+ }
1498
+ const untrustedConfig_orderBy = untrustedConfig.orderBy;
1499
+ if (typeof untrustedConfig_orderBy === 'string') {
1500
+ config.orderBy = untrustedConfig_orderBy;
1501
+ }
1502
+ const untrustedConfig_sort = untrustedConfig.sort;
1503
+ if (typeof untrustedConfig_sort === 'string') {
1504
+ config.sort = untrustedConfig_sort;
1505
+ }
1506
+ return config;
1507
+ }
1508
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1509
+ if (!untrustedIsObject(untrustedConfig)) {
1510
+ return null;
1511
+ }
1512
+ if (process.env.NODE_ENV !== 'production') {
1513
+ validateConfig(untrustedConfig, configPropertyNames);
1514
+ }
1515
+ const config = typeCheckConfig(untrustedConfig);
1516
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1517
+ return null;
1518
+ }
1519
+ return config;
1520
+ }
1521
+ function adapterFragment(luvio, config) {
1522
+ createResourceParams(config);
1523
+ return select();
1524
+ }
1525
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1526
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
1527
+ config,
1528
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1529
+ });
1530
+ return luvio.storeBroadcast().then(() => snapshot);
1531
+ }
1532
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1533
+ const snapshot = ingestError(luvio, resourceParams, response, {
1534
+ config,
1535
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1536
+ });
1537
+ return luvio.storeBroadcast().then(() => snapshot);
1538
+ }
1539
+ function buildNetworkSnapshot(luvio, config, options) {
1540
+ const resourceParams = createResourceParams(config);
1541
+ const request = createResourceRequest(resourceParams);
1542
+ return luvio.dispatchResourceRequest(request, options)
1543
+ .then((response) => {
1544
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
1545
+ }, (response) => {
1546
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1547
+ });
1548
+ }
1549
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1550
+ const { luvio, config } = context;
1551
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1552
+ const dispatchOptions = {
1553
+ resourceRequestContext: {
1554
+ requestCorrelator,
1555
+ luvioRequestMethod: undefined,
1556
+ },
1557
+ eventObservers
1558
+ };
1559
+ if (networkPriority !== 'normal') {
1560
+ dispatchOptions.overrides = {
1561
+ priority: networkPriority
1562
+ };
1563
+ }
1564
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
1565
+ }
1566
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1567
+ const { luvio, config } = context;
1568
+ const selector = {
1569
+ recordId: keyBuilder(luvio, config),
1570
+ node: adapterFragment(luvio, config),
1571
+ variables: {},
1572
+ };
1573
+ const cacheSnapshot = storeLookup(selector, {
1574
+ config,
1575
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1576
+ });
1577
+ return cacheSnapshot;
1578
+ }
1579
+ const getTagsByCategoryIdAdapterFactory = (luvio) => function interesttagging__getTagsByCategoryId(untrustedConfig, requestContext) {
1580
+ const config = validateAdapterConfig(untrustedConfig, getTagsByCategoryId_ConfigPropertyNames);
1581
+ // Invalid or incomplete config
1582
+ if (config === null) {
1583
+ return null;
1584
+ }
1585
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1586
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1587
+ };
1588
+
1589
+ exports.createInterestTagEntityAssignmentAdapterFactory = createInterestTagEntityAssignmentAdapterFactory;
1590
+ exports.getInterestTagEntityAssignmentsAdapterFactory = getInterestTagEntityAssignmentsAdapterFactory;
1591
+ exports.getTagCategoriesByTagIdAdapterFactory = getTagCategoriesByTagIdAdapterFactory;
1592
+ exports.getTagsByCategoryIdAdapterFactory = getTagsByCategoryIdAdapterFactory;
1593
+ exports.getTagsByRecordIdAdapterFactory = getTagsByRecordIdAdapterFactory;
1594
+
1595
+ Object.defineProperty(exports, '__esModule', { value: true });
1596
+
1597
+ }));