@salesforce/lds-adapters-service-basesetup 1.308.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 (23) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/service-basesetup.js +1238 -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/enableFeatureSet.d.ts +19 -0
  5. package/dist/es/es2018/types/src/generated/adapters/getFeatureSetDetail.d.ts +29 -0
  6. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
  7. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +5 -0
  8. package/dist/es/es2018/types/src/generated/resources/getConnectBaseSetupFeatureSetDetail.d.ts +17 -0
  9. package/dist/es/es2018/types/src/generated/resources/postConnectBaseSetupEnableFeatureSet.d.ts +16 -0
  10. package/dist/es/es2018/types/src/generated/types/EnableFeatureSetInputRepresentation.d.ts +38 -0
  11. package/dist/es/es2018/types/src/generated/types/EnableFeatureSetOutputRepresentation.d.ts +48 -0
  12. package/dist/es/es2018/types/src/generated/types/FeatureActionDetailRepresentation.d.ts +34 -0
  13. package/dist/es/es2018/types/src/generated/types/FeatureActionRepresentation.d.ts +32 -0
  14. package/dist/es/es2018/types/src/generated/types/FeatureRepresentation.d.ts +45 -0
  15. package/dist/es/es2018/types/src/generated/types/FeatureSetErrorRepresentation.d.ts +31 -0
  16. package/dist/es/es2018/types/src/generated/types/FeatureSetRepresentation.d.ts +63 -0
  17. package/dist/es/es2018/types/src/generated/types/FeatureStatusRepresentation.d.ts +35 -0
  18. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  19. package/package.json +67 -0
  20. package/sfdc/index.d.ts +1 -0
  21. package/sfdc/index.js +1317 -0
  22. package/src/raml/api.raml +211 -0
  23. package/src/raml/luvio.raml +28 -0
package/sfdc/index.js ADDED
@@ -0,0 +1,1317 @@
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, StoreKeyMap, createResourceParams as createResourceParams$2, typeCheckConfig as typeCheckConfig$2, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$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 = 'basesetup';
83
+
84
+ const { isArray: ArrayIsArray } = Array;
85
+ function equalsArray(a, b, equalsItem) {
86
+ const aLength = a.length;
87
+ const bLength = b.length;
88
+ if (aLength !== bLength) {
89
+ return false;
90
+ }
91
+ for (let i = 0; i < aLength; i++) {
92
+ if (equalsItem(a[i], b[i]) === false) {
93
+ return false;
94
+ }
95
+ }
96
+ return true;
97
+ }
98
+ function createLink(ref) {
99
+ return {
100
+ __ref: serializeStructuredKey(ref),
101
+ };
102
+ }
103
+
104
+ const VERSION$6 = "57736b1397735a74a85726a28b18413d";
105
+ function validate$6(obj, path = 'FeatureSetErrorRepresentation') {
106
+ const v_error = (() => {
107
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
108
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
109
+ }
110
+ const obj_errorCode = obj.errorCode;
111
+ const path_errorCode = path + '.errorCode';
112
+ if (typeof obj_errorCode !== 'string') {
113
+ return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
114
+ }
115
+ const obj_errorMessage = obj.errorMessage;
116
+ const path_errorMessage = path + '.errorMessage';
117
+ if (typeof obj_errorMessage !== 'string') {
118
+ return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
119
+ }
120
+ })();
121
+ return v_error === undefined ? null : v_error;
122
+ }
123
+ const select$8 = function FeatureSetErrorRepresentationSelect() {
124
+ return {
125
+ kind: 'Fragment',
126
+ version: VERSION$6,
127
+ private: [],
128
+ selections: [
129
+ {
130
+ name: 'errorCode',
131
+ kind: 'Scalar'
132
+ },
133
+ {
134
+ name: 'errorMessage',
135
+ kind: 'Scalar'
136
+ }
137
+ ]
138
+ };
139
+ };
140
+ function equals$6(existing, incoming) {
141
+ const existing_errorCode = existing.errorCode;
142
+ const incoming_errorCode = incoming.errorCode;
143
+ if (!(existing_errorCode === incoming_errorCode)) {
144
+ return false;
145
+ }
146
+ const existing_errorMessage = existing.errorMessage;
147
+ const incoming_errorMessage = incoming.errorMessage;
148
+ if (!(existing_errorMessage === incoming_errorMessage)) {
149
+ return false;
150
+ }
151
+ return true;
152
+ }
153
+
154
+ const VERSION$5 = "fdf09db1e294f390c748746b14b00ea8";
155
+ function validate$5(obj, path = 'FeatureStatusRepresentation') {
156
+ const v_error = (() => {
157
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
158
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
159
+ }
160
+ const obj_errors = obj.errors;
161
+ const path_errors = path + '.errors';
162
+ if (!ArrayIsArray(obj_errors)) {
163
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
164
+ }
165
+ for (let i = 0; i < obj_errors.length; i++) {
166
+ const obj_errors_item = obj_errors[i];
167
+ const path_errors_item = path_errors + '[' + i + ']';
168
+ const referencepath_errors_itemValidationError = validate$6(obj_errors_item, path_errors_item);
169
+ if (referencepath_errors_itemValidationError !== null) {
170
+ let message = 'Object doesn\'t match FeatureSetErrorRepresentation (at "' + path_errors_item + '")\n';
171
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
172
+ return new TypeError(message);
173
+ }
174
+ }
175
+ const obj_featureApiName = obj.featureApiName;
176
+ const path_featureApiName = path + '.featureApiName';
177
+ if (typeof obj_featureApiName !== 'string') {
178
+ return new TypeError('Expected "string" but received "' + typeof obj_featureApiName + '" (at "' + path_featureApiName + '")');
179
+ }
180
+ const obj_featureStatus = obj.featureStatus;
181
+ const path_featureStatus = path + '.featureStatus';
182
+ if (typeof obj_featureStatus !== 'string') {
183
+ return new TypeError('Expected "string" but received "' + typeof obj_featureStatus + '" (at "' + path_featureStatus + '")');
184
+ }
185
+ })();
186
+ return v_error === undefined ? null : v_error;
187
+ }
188
+ const select$7 = function FeatureStatusRepresentationSelect() {
189
+ const { selections: FeatureSetErrorRepresentation__selections, opaque: FeatureSetErrorRepresentation__opaque, } = select$8();
190
+ return {
191
+ kind: 'Fragment',
192
+ version: VERSION$5,
193
+ private: [],
194
+ selections: [
195
+ {
196
+ name: 'errors',
197
+ kind: 'Object',
198
+ plural: true,
199
+ selections: FeatureSetErrorRepresentation__selections
200
+ },
201
+ {
202
+ name: 'featureApiName',
203
+ kind: 'Scalar'
204
+ },
205
+ {
206
+ name: 'featureStatus',
207
+ kind: 'Scalar'
208
+ }
209
+ ]
210
+ };
211
+ };
212
+ function equals$5(existing, incoming) {
213
+ const existing_featureApiName = existing.featureApiName;
214
+ const incoming_featureApiName = incoming.featureApiName;
215
+ if (!(existing_featureApiName === incoming_featureApiName)) {
216
+ return false;
217
+ }
218
+ const existing_featureStatus = existing.featureStatus;
219
+ const incoming_featureStatus = incoming.featureStatus;
220
+ if (!(existing_featureStatus === incoming_featureStatus)) {
221
+ return false;
222
+ }
223
+ const existing_errors = existing.errors;
224
+ const incoming_errors = incoming.errors;
225
+ const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
226
+ if (!(equals$6(existing_errors_item, incoming_errors_item))) {
227
+ return false;
228
+ }
229
+ });
230
+ if (equals_errors_items === false) {
231
+ return false;
232
+ }
233
+ return true;
234
+ }
235
+
236
+ const VERSION$4 = "83652c37c36b03098220a8a09f67bef0";
237
+ function validate$4(obj, path = 'EnableFeatureSetOutputRepresentation') {
238
+ const v_error = (() => {
239
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
240
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
241
+ }
242
+ const obj_errors = obj.errors;
243
+ const path_errors = path + '.errors';
244
+ if (!ArrayIsArray(obj_errors)) {
245
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
246
+ }
247
+ for (let i = 0; i < obj_errors.length; i++) {
248
+ const obj_errors_item = obj_errors[i];
249
+ const path_errors_item = path_errors + '[' + i + ']';
250
+ const referencepath_errors_itemValidationError = validate$6(obj_errors_item, path_errors_item);
251
+ if (referencepath_errors_itemValidationError !== null) {
252
+ let message = 'Object doesn\'t match FeatureSetErrorRepresentation (at "' + path_errors_item + '")\n';
253
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
254
+ return new TypeError(message);
255
+ }
256
+ }
257
+ const obj_featureSetApiName = obj.featureSetApiName;
258
+ const path_featureSetApiName = path + '.featureSetApiName';
259
+ if (typeof obj_featureSetApiName !== 'string') {
260
+ return new TypeError('Expected "string" but received "' + typeof obj_featureSetApiName + '" (at "' + path_featureSetApiName + '")');
261
+ }
262
+ const obj_featureSetStatus = obj.featureSetStatus;
263
+ const path_featureSetStatus = path + '.featureSetStatus';
264
+ if (typeof obj_featureSetStatus !== 'string') {
265
+ return new TypeError('Expected "string" but received "' + typeof obj_featureSetStatus + '" (at "' + path_featureSetStatus + '")');
266
+ }
267
+ const obj_featureStatusList = obj.featureStatusList;
268
+ const path_featureStatusList = path + '.featureStatusList';
269
+ if (!ArrayIsArray(obj_featureStatusList)) {
270
+ return new TypeError('Expected "array" but received "' + typeof obj_featureStatusList + '" (at "' + path_featureStatusList + '")');
271
+ }
272
+ for (let i = 0; i < obj_featureStatusList.length; i++) {
273
+ const obj_featureStatusList_item = obj_featureStatusList[i];
274
+ const path_featureStatusList_item = path_featureStatusList + '[' + i + ']';
275
+ const referencepath_featureStatusList_itemValidationError = validate$5(obj_featureStatusList_item, path_featureStatusList_item);
276
+ if (referencepath_featureStatusList_itemValidationError !== null) {
277
+ let message = 'Object doesn\'t match FeatureStatusRepresentation (at "' + path_featureStatusList_item + '")\n';
278
+ message += referencepath_featureStatusList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
279
+ return new TypeError(message);
280
+ }
281
+ }
282
+ })();
283
+ return v_error === undefined ? null : v_error;
284
+ }
285
+ const RepresentationType$1 = 'EnableFeatureSetOutputRepresentation';
286
+ function keyBuilder$3(luvio, config) {
287
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.featureSetApiName;
288
+ }
289
+ function keyBuilderFromType$1(luvio, object) {
290
+ const keyParams = {
291
+ featureSetApiName: object.featureSetApiName
292
+ };
293
+ return keyBuilder$3(luvio, keyParams);
294
+ }
295
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
296
+ return input;
297
+ }
298
+ const select$6 = function EnableFeatureSetOutputRepresentationSelect() {
299
+ const { selections: FeatureSetErrorRepresentation__selections, opaque: FeatureSetErrorRepresentation__opaque, } = select$8();
300
+ const { selections: FeatureStatusRepresentation__selections, opaque: FeatureStatusRepresentation__opaque, } = select$7();
301
+ return {
302
+ kind: 'Fragment',
303
+ version: VERSION$4,
304
+ private: [],
305
+ selections: [
306
+ {
307
+ name: 'errors',
308
+ kind: 'Object',
309
+ plural: true,
310
+ selections: FeatureSetErrorRepresentation__selections
311
+ },
312
+ {
313
+ name: 'featureSetApiName',
314
+ kind: 'Scalar'
315
+ },
316
+ {
317
+ name: 'featureSetStatus',
318
+ kind: 'Scalar'
319
+ },
320
+ {
321
+ name: 'featureStatusList',
322
+ kind: 'Object',
323
+ plural: true,
324
+ selections: FeatureStatusRepresentation__selections
325
+ }
326
+ ]
327
+ };
328
+ };
329
+ function equals$4(existing, incoming) {
330
+ const existing_featureSetApiName = existing.featureSetApiName;
331
+ const incoming_featureSetApiName = incoming.featureSetApiName;
332
+ if (!(existing_featureSetApiName === incoming_featureSetApiName)) {
333
+ return false;
334
+ }
335
+ const existing_featureSetStatus = existing.featureSetStatus;
336
+ const incoming_featureSetStatus = incoming.featureSetStatus;
337
+ if (!(existing_featureSetStatus === incoming_featureSetStatus)) {
338
+ return false;
339
+ }
340
+ const existing_errors = existing.errors;
341
+ const incoming_errors = incoming.errors;
342
+ const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
343
+ if (!(equals$6(existing_errors_item, incoming_errors_item))) {
344
+ return false;
345
+ }
346
+ });
347
+ if (equals_errors_items === false) {
348
+ return false;
349
+ }
350
+ const existing_featureStatusList = existing.featureStatusList;
351
+ const incoming_featureStatusList = incoming.featureStatusList;
352
+ const equals_featureStatusList_items = equalsArray(existing_featureStatusList, incoming_featureStatusList, (existing_featureStatusList_item, incoming_featureStatusList_item) => {
353
+ if (!(equals$5(existing_featureStatusList_item, incoming_featureStatusList_item))) {
354
+ return false;
355
+ }
356
+ });
357
+ if (equals_featureStatusList_items === false) {
358
+ return false;
359
+ }
360
+ return true;
361
+ }
362
+ const ingest$1 = function EnableFeatureSetOutputRepresentationIngest(input, path, luvio, store, timestamp) {
363
+ if (process.env.NODE_ENV !== 'production') {
364
+ const validateError = validate$4(input);
365
+ if (validateError !== null) {
366
+ throw validateError;
367
+ }
368
+ }
369
+ const key = keyBuilderFromType$1(luvio, input);
370
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 100;
371
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "basesetup", VERSION$4, RepresentationType$1, equals$4);
372
+ return createLink(key);
373
+ };
374
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
375
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
376
+ const rootKey = keyBuilderFromType$1(luvio, input);
377
+ rootKeySet.set(rootKey, {
378
+ namespace: keyPrefix,
379
+ representationName: RepresentationType$1,
380
+ mergeable: false
381
+ });
382
+ }
383
+
384
+ function select$5(luvio, params) {
385
+ return select$6();
386
+ }
387
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
388
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
389
+ }
390
+ function ingestSuccess$1(luvio, resourceParams, response) {
391
+ const { body } = response;
392
+ const key = keyBuilderFromType$1(luvio, body);
393
+ luvio.storeIngest(key, ingest$1, body);
394
+ const snapshot = luvio.storeLookup({
395
+ recordId: key,
396
+ node: select$5(),
397
+ variables: {},
398
+ });
399
+ if (process.env.NODE_ENV !== 'production') {
400
+ if (snapshot.state !== 'Fulfilled') {
401
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
402
+ }
403
+ }
404
+ deepFreeze(snapshot.data);
405
+ return snapshot;
406
+ }
407
+ function createResourceRequest$1(config) {
408
+ const headers = {};
409
+ return {
410
+ baseUri: '/services/data/v62.0',
411
+ basePath: '/connect/base-setup/enableFeatureSet',
412
+ method: 'post',
413
+ body: config.body,
414
+ urlParams: {},
415
+ queryParams: {},
416
+ headers,
417
+ priority: 'normal',
418
+ };
419
+ }
420
+
421
+ const adapterName$1 = 'enableFeatureSet';
422
+ const enableFeatureSet_ConfigPropertyMetadata = [
423
+ generateParamConfigMetadata('additionalInfo', true, 2 /* Body */, 4 /* Unsupported */),
424
+ generateParamConfigMetadata('featureApiName', true, 2 /* Body */, 0 /* String */),
425
+ generateParamConfigMetadata('featureSetApiName', true, 2 /* Body */, 0 /* String */),
426
+ ];
427
+ const enableFeatureSet_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, enableFeatureSet_ConfigPropertyMetadata);
428
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(enableFeatureSet_ConfigPropertyMetadata);
429
+ function typeCheckConfig$1(untrustedConfig) {
430
+ const config = {};
431
+ typeCheckConfig$2(untrustedConfig, config, enableFeatureSet_ConfigPropertyMetadata);
432
+ const untrustedConfig_additionalInfo = untrustedConfig.additionalInfo;
433
+ if (untrustedIsObject(untrustedConfig_additionalInfo)) {
434
+ const untrustedConfig_additionalInfo_object = {};
435
+ const untrustedConfig_additionalInfo_keys = Object.keys(untrustedConfig_additionalInfo);
436
+ for (let i = 0, arrayLength = untrustedConfig_additionalInfo_keys.length; i < arrayLength; i++) {
437
+ const key = untrustedConfig_additionalInfo_keys[i];
438
+ const untrustedConfig_additionalInfo_prop = untrustedConfig_additionalInfo[key];
439
+ if (untrustedIsObject(untrustedConfig_additionalInfo_prop)) {
440
+ const untrustedConfig_additionalInfo_prop_object = {};
441
+ if (untrustedConfig_additionalInfo_prop_object !== undefined && Object.keys(untrustedConfig_additionalInfo_prop_object).length >= 0) {
442
+ if (untrustedConfig_additionalInfo_object !== undefined) {
443
+ untrustedConfig_additionalInfo_object[key] = untrustedConfig_additionalInfo_prop_object;
444
+ }
445
+ }
446
+ }
447
+ }
448
+ if (untrustedConfig_additionalInfo_object !== undefined && Object.keys(untrustedConfig_additionalInfo_object).length >= 0) {
449
+ config.additionalInfo = untrustedConfig_additionalInfo_object;
450
+ }
451
+ }
452
+ return config;
453
+ }
454
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
455
+ if (!untrustedIsObject(untrustedConfig)) {
456
+ return null;
457
+ }
458
+ if (process.env.NODE_ENV !== 'production') {
459
+ validateConfig(untrustedConfig, configPropertyNames);
460
+ }
461
+ const config = typeCheckConfig$1(untrustedConfig);
462
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
463
+ return null;
464
+ }
465
+ return config;
466
+ }
467
+ function buildNetworkSnapshot$1(luvio, config, options) {
468
+ const resourceParams = createResourceParams$1(config);
469
+ const request = createResourceRequest$1(resourceParams);
470
+ return luvio.dispatchResourceRequest(request, options)
471
+ .then((response) => {
472
+ return luvio.handleSuccessResponse(() => {
473
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
474
+ return luvio.storeBroadcast().then(() => snapshot);
475
+ }, () => {
476
+ const cache = new StoreKeyMap();
477
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
478
+ return cache;
479
+ });
480
+ }, (response) => {
481
+ deepFreeze(response);
482
+ throw response;
483
+ });
484
+ }
485
+ const enableFeatureSetAdapterFactory = (luvio) => {
486
+ return function enableFeatureSet(untrustedConfig) {
487
+ const config = validateAdapterConfig$1(untrustedConfig, enableFeatureSet_ConfigPropertyNames);
488
+ // Invalid or incomplete config
489
+ if (config === null) {
490
+ throw new Error('Invalid config for "enableFeatureSet"');
491
+ }
492
+ return buildNetworkSnapshot$1(luvio, config);
493
+ };
494
+ };
495
+
496
+ const VERSION$3 = "2b4a6d9603edd46b3d88ae4b1f705ac3";
497
+ function validate$3(obj, path = 'FeatureActionDetailRepresentation') {
498
+ const v_error = (() => {
499
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
500
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
501
+ }
502
+ const obj_iconName = obj.iconName;
503
+ const path_iconName = path + '.iconName';
504
+ if (typeof obj_iconName !== 'string') {
505
+ return new TypeError('Expected "string" but received "' + typeof obj_iconName + '" (at "' + path_iconName + '")');
506
+ }
507
+ const obj_label = obj.label;
508
+ const path_label = path + '.label';
509
+ if (typeof obj_label !== 'string') {
510
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
511
+ }
512
+ const obj_title = obj.title;
513
+ const path_title = path + '.title';
514
+ if (typeof obj_title !== 'string') {
515
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
516
+ }
517
+ })();
518
+ return v_error === undefined ? null : v_error;
519
+ }
520
+ const select$4 = function FeatureActionDetailRepresentationSelect() {
521
+ return {
522
+ kind: 'Fragment',
523
+ version: VERSION$3,
524
+ private: [],
525
+ selections: [
526
+ {
527
+ name: 'iconName',
528
+ kind: 'Scalar'
529
+ },
530
+ {
531
+ name: 'label',
532
+ kind: 'Scalar'
533
+ },
534
+ {
535
+ name: 'title',
536
+ kind: 'Scalar'
537
+ }
538
+ ]
539
+ };
540
+ };
541
+ function equals$3(existing, incoming) {
542
+ const existing_iconName = existing.iconName;
543
+ const incoming_iconName = incoming.iconName;
544
+ if (!(existing_iconName === incoming_iconName)) {
545
+ return false;
546
+ }
547
+ const existing_label = existing.label;
548
+ const incoming_label = incoming.label;
549
+ if (!(existing_label === incoming_label)) {
550
+ return false;
551
+ }
552
+ const existing_title = existing.title;
553
+ const incoming_title = incoming.title;
554
+ if (!(existing_title === incoming_title)) {
555
+ return false;
556
+ }
557
+ return true;
558
+ }
559
+
560
+ const VERSION$2 = "2d76d68380fd0893d61124289d9a4c4e";
561
+ function validate$2(obj, path = 'FeatureActionRepresentation') {
562
+ const v_error = (() => {
563
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
564
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
565
+ }
566
+ const obj_actionDetail = obj.actionDetail;
567
+ const path_actionDetail = path + '.actionDetail';
568
+ const referencepath_actionDetailValidationError = validate$3(obj_actionDetail, path_actionDetail);
569
+ if (referencepath_actionDetailValidationError !== null) {
570
+ let message = 'Object doesn\'t match FeatureActionDetailRepresentation (at "' + path_actionDetail + '")\n';
571
+ message += referencepath_actionDetailValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
572
+ return new TypeError(message);
573
+ }
574
+ const obj_actionType = obj.actionType;
575
+ const path_actionType = path + '.actionType';
576
+ if (typeof obj_actionType !== 'string') {
577
+ return new TypeError('Expected "string" but received "' + typeof obj_actionType + '" (at "' + path_actionType + '")');
578
+ }
579
+ })();
580
+ return v_error === undefined ? null : v_error;
581
+ }
582
+ const select$3 = function FeatureActionRepresentationSelect() {
583
+ const { selections: FeatureActionDetailRepresentation__selections, opaque: FeatureActionDetailRepresentation__opaque, } = select$4();
584
+ return {
585
+ kind: 'Fragment',
586
+ version: VERSION$2,
587
+ private: [],
588
+ selections: [
589
+ {
590
+ name: 'actionDetail',
591
+ kind: 'Object',
592
+ selections: FeatureActionDetailRepresentation__selections
593
+ },
594
+ {
595
+ name: 'actionType',
596
+ kind: 'Scalar'
597
+ }
598
+ ]
599
+ };
600
+ };
601
+ function equals$2(existing, incoming) {
602
+ const existing_actionType = existing.actionType;
603
+ const incoming_actionType = incoming.actionType;
604
+ if (!(existing_actionType === incoming_actionType)) {
605
+ return false;
606
+ }
607
+ const existing_actionDetail = existing.actionDetail;
608
+ const incoming_actionDetail = incoming.actionDetail;
609
+ if (!(equals$3(existing_actionDetail, incoming_actionDetail))) {
610
+ return false;
611
+ }
612
+ return true;
613
+ }
614
+
615
+ const VERSION$1 = "03f20b1447a754c85b7558c3b032fc55";
616
+ function validate$1(obj, path = 'FeatureRepresentation') {
617
+ const v_error = (() => {
618
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
619
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
620
+ }
621
+ const obj_errors = obj.errors;
622
+ const path_errors = path + '.errors';
623
+ if (!ArrayIsArray(obj_errors)) {
624
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
625
+ }
626
+ for (let i = 0; i < obj_errors.length; i++) {
627
+ const obj_errors_item = obj_errors[i];
628
+ const path_errors_item = path_errors + '[' + i + ']';
629
+ const referencepath_errors_itemValidationError = validate$6(obj_errors_item, path_errors_item);
630
+ if (referencepath_errors_itemValidationError !== null) {
631
+ let message = 'Object doesn\'t match FeatureSetErrorRepresentation (at "' + path_errors_item + '")\n';
632
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
633
+ return new TypeError(message);
634
+ }
635
+ }
636
+ const obj_featureAction = obj.featureAction;
637
+ const path_featureAction = path + '.featureAction';
638
+ let obj_featureAction_union0 = null;
639
+ const obj_featureAction_union0_error = (() => {
640
+ const referencepath_featureActionValidationError = validate$2(obj_featureAction, path_featureAction);
641
+ if (referencepath_featureActionValidationError !== null) {
642
+ let message = 'Object doesn\'t match FeatureActionRepresentation (at "' + path_featureAction + '")\n';
643
+ message += referencepath_featureActionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
644
+ return new TypeError(message);
645
+ }
646
+ })();
647
+ if (obj_featureAction_union0_error != null) {
648
+ obj_featureAction_union0 = obj_featureAction_union0_error.message;
649
+ }
650
+ let obj_featureAction_union1 = null;
651
+ const obj_featureAction_union1_error = (() => {
652
+ if (obj_featureAction !== null) {
653
+ return new TypeError('Expected "null" but received "' + typeof obj_featureAction + '" (at "' + path_featureAction + '")');
654
+ }
655
+ })();
656
+ if (obj_featureAction_union1_error != null) {
657
+ obj_featureAction_union1 = obj_featureAction_union1_error.message;
658
+ }
659
+ if (obj_featureAction_union0 && obj_featureAction_union1) {
660
+ let message = 'Object doesn\'t match union (at "' + path_featureAction + '")';
661
+ message += '\n' + obj_featureAction_union0.split('\n').map((line) => '\t' + line).join('\n');
662
+ message += '\n' + obj_featureAction_union1.split('\n').map((line) => '\t' + line).join('\n');
663
+ return new TypeError(message);
664
+ }
665
+ const obj_featureApiName = obj.featureApiName;
666
+ const path_featureApiName = path + '.featureApiName';
667
+ if (typeof obj_featureApiName !== 'string') {
668
+ return new TypeError('Expected "string" but received "' + typeof obj_featureApiName + '" (at "' + path_featureApiName + '")');
669
+ }
670
+ const obj_featureStatus = obj.featureStatus;
671
+ const path_featureStatus = path + '.featureStatus';
672
+ if (typeof obj_featureStatus !== 'string') {
673
+ return new TypeError('Expected "string" but received "' + typeof obj_featureStatus + '" (at "' + path_featureStatus + '")');
674
+ }
675
+ const obj_resourceUrl = obj.resourceUrl;
676
+ const path_resourceUrl = path + '.resourceUrl';
677
+ let obj_resourceUrl_union0 = null;
678
+ const obj_resourceUrl_union0_error = (() => {
679
+ if (typeof obj_resourceUrl !== 'string') {
680
+ return new TypeError('Expected "string" but received "' + typeof obj_resourceUrl + '" (at "' + path_resourceUrl + '")');
681
+ }
682
+ })();
683
+ if (obj_resourceUrl_union0_error != null) {
684
+ obj_resourceUrl_union0 = obj_resourceUrl_union0_error.message;
685
+ }
686
+ let obj_resourceUrl_union1 = null;
687
+ const obj_resourceUrl_union1_error = (() => {
688
+ if (obj_resourceUrl !== null) {
689
+ return new TypeError('Expected "null" but received "' + typeof obj_resourceUrl + '" (at "' + path_resourceUrl + '")');
690
+ }
691
+ })();
692
+ if (obj_resourceUrl_union1_error != null) {
693
+ obj_resourceUrl_union1 = obj_resourceUrl_union1_error.message;
694
+ }
695
+ if (obj_resourceUrl_union0 && obj_resourceUrl_union1) {
696
+ let message = 'Object doesn\'t match union (at "' + path_resourceUrl + '")';
697
+ message += '\n' + obj_resourceUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
698
+ message += '\n' + obj_resourceUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
699
+ return new TypeError(message);
700
+ }
701
+ const obj_title = obj.title;
702
+ const path_title = path + '.title';
703
+ let obj_title_union0 = null;
704
+ const obj_title_union0_error = (() => {
705
+ if (typeof obj_title !== 'string') {
706
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
707
+ }
708
+ })();
709
+ if (obj_title_union0_error != null) {
710
+ obj_title_union0 = obj_title_union0_error.message;
711
+ }
712
+ let obj_title_union1 = null;
713
+ const obj_title_union1_error = (() => {
714
+ if (obj_title !== null) {
715
+ return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
716
+ }
717
+ })();
718
+ if (obj_title_union1_error != null) {
719
+ obj_title_union1 = obj_title_union1_error.message;
720
+ }
721
+ if (obj_title_union0 && obj_title_union1) {
722
+ let message = 'Object doesn\'t match union (at "' + path_title + '")';
723
+ message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
724
+ message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
725
+ return new TypeError(message);
726
+ }
727
+ })();
728
+ return v_error === undefined ? null : v_error;
729
+ }
730
+ const select$2 = function FeatureRepresentationSelect() {
731
+ const { selections: FeatureSetErrorRepresentation__selections, opaque: FeatureSetErrorRepresentation__opaque, } = select$8();
732
+ const { selections: FeatureActionRepresentation__selections, opaque: FeatureActionRepresentation__opaque, } = select$3();
733
+ return {
734
+ kind: 'Fragment',
735
+ version: VERSION$1,
736
+ private: [],
737
+ selections: [
738
+ {
739
+ name: 'errors',
740
+ kind: 'Object',
741
+ plural: true,
742
+ selections: FeatureSetErrorRepresentation__selections
743
+ },
744
+ {
745
+ name: 'featureAction',
746
+ kind: 'Object',
747
+ nullable: true,
748
+ selections: FeatureActionRepresentation__selections
749
+ },
750
+ {
751
+ name: 'featureApiName',
752
+ kind: 'Scalar'
753
+ },
754
+ {
755
+ name: 'featureStatus',
756
+ kind: 'Scalar'
757
+ },
758
+ {
759
+ name: 'resourceUrl',
760
+ kind: 'Scalar'
761
+ },
762
+ {
763
+ name: 'title',
764
+ kind: 'Scalar'
765
+ }
766
+ ]
767
+ };
768
+ };
769
+ function equals$1(existing, incoming) {
770
+ const existing_featureApiName = existing.featureApiName;
771
+ const incoming_featureApiName = incoming.featureApiName;
772
+ if (!(existing_featureApiName === incoming_featureApiName)) {
773
+ return false;
774
+ }
775
+ const existing_featureStatus = existing.featureStatus;
776
+ const incoming_featureStatus = incoming.featureStatus;
777
+ if (!(existing_featureStatus === incoming_featureStatus)) {
778
+ return false;
779
+ }
780
+ const existing_errors = existing.errors;
781
+ const incoming_errors = incoming.errors;
782
+ const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
783
+ if (!(equals$6(existing_errors_item, incoming_errors_item))) {
784
+ return false;
785
+ }
786
+ });
787
+ if (equals_errors_items === false) {
788
+ return false;
789
+ }
790
+ const existing_featureAction = existing.featureAction;
791
+ const incoming_featureAction = incoming.featureAction;
792
+ if (!(existing_featureAction === incoming_featureAction
793
+ || (existing_featureAction != null &&
794
+ incoming_featureAction != null &&
795
+ equals$2(existing_featureAction, incoming_featureAction)))) {
796
+ return false;
797
+ }
798
+ const existing_resourceUrl = existing.resourceUrl;
799
+ const incoming_resourceUrl = incoming.resourceUrl;
800
+ if (!(existing_resourceUrl === incoming_resourceUrl)) {
801
+ return false;
802
+ }
803
+ const existing_title = existing.title;
804
+ const incoming_title = incoming.title;
805
+ if (!(existing_title === incoming_title)) {
806
+ return false;
807
+ }
808
+ return true;
809
+ }
810
+
811
+ const VERSION = "413ee7b03b09065d1418d14d559a99ec";
812
+ function validate(obj, path = 'FeatureSetRepresentation') {
813
+ const v_error = (() => {
814
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
815
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
816
+ }
817
+ const obj_description = obj.description;
818
+ const path_description = path + '.description';
819
+ if (typeof obj_description !== 'string') {
820
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
821
+ }
822
+ const obj_errors = obj.errors;
823
+ const path_errors = path + '.errors';
824
+ if (!ArrayIsArray(obj_errors)) {
825
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
826
+ }
827
+ for (let i = 0; i < obj_errors.length; i++) {
828
+ const obj_errors_item = obj_errors[i];
829
+ const path_errors_item = path_errors + '[' + i + ']';
830
+ const referencepath_errors_itemValidationError = validate$6(obj_errors_item, path_errors_item);
831
+ if (referencepath_errors_itemValidationError !== null) {
832
+ let message = 'Object doesn\'t match FeatureSetErrorRepresentation (at "' + path_errors_item + '")\n';
833
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
834
+ return new TypeError(message);
835
+ }
836
+ }
837
+ const obj_featureCategory = obj.featureCategory;
838
+ const path_featureCategory = path + '.featureCategory';
839
+ let obj_featureCategory_union0 = null;
840
+ const obj_featureCategory_union0_error = (() => {
841
+ if (typeof obj_featureCategory !== 'string') {
842
+ return new TypeError('Expected "string" but received "' + typeof obj_featureCategory + '" (at "' + path_featureCategory + '")');
843
+ }
844
+ })();
845
+ if (obj_featureCategory_union0_error != null) {
846
+ obj_featureCategory_union0 = obj_featureCategory_union0_error.message;
847
+ }
848
+ let obj_featureCategory_union1 = null;
849
+ const obj_featureCategory_union1_error = (() => {
850
+ if (obj_featureCategory !== null) {
851
+ return new TypeError('Expected "null" but received "' + typeof obj_featureCategory + '" (at "' + path_featureCategory + '")');
852
+ }
853
+ })();
854
+ if (obj_featureCategory_union1_error != null) {
855
+ obj_featureCategory_union1 = obj_featureCategory_union1_error.message;
856
+ }
857
+ if (obj_featureCategory_union0 && obj_featureCategory_union1) {
858
+ let message = 'Object doesn\'t match union (at "' + path_featureCategory + '")';
859
+ message += '\n' + obj_featureCategory_union0.split('\n').map((line) => '\t' + line).join('\n');
860
+ message += '\n' + obj_featureCategory_union1.split('\n').map((line) => '\t' + line).join('\n');
861
+ return new TypeError(message);
862
+ }
863
+ const obj_featureSetApiName = obj.featureSetApiName;
864
+ const path_featureSetApiName = path + '.featureSetApiName';
865
+ if (typeof obj_featureSetApiName !== 'string') {
866
+ return new TypeError('Expected "string" but received "' + typeof obj_featureSetApiName + '" (at "' + path_featureSetApiName + '")');
867
+ }
868
+ const obj_featureSetStatus = obj.featureSetStatus;
869
+ const path_featureSetStatus = path + '.featureSetStatus';
870
+ if (typeof obj_featureSetStatus !== 'string') {
871
+ return new TypeError('Expected "string" but received "' + typeof obj_featureSetStatus + '" (at "' + path_featureSetStatus + '")');
872
+ }
873
+ const obj_features = obj.features;
874
+ const path_features = path + '.features';
875
+ if (!ArrayIsArray(obj_features)) {
876
+ return new TypeError('Expected "array" but received "' + typeof obj_features + '" (at "' + path_features + '")');
877
+ }
878
+ for (let i = 0; i < obj_features.length; i++) {
879
+ const obj_features_item = obj_features[i];
880
+ const path_features_item = path_features + '[' + i + ']';
881
+ const referencepath_features_itemValidationError = validate$1(obj_features_item, path_features_item);
882
+ if (referencepath_features_itemValidationError !== null) {
883
+ let message = 'Object doesn\'t match FeatureRepresentation (at "' + path_features_item + '")\n';
884
+ message += referencepath_features_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
885
+ return new TypeError(message);
886
+ }
887
+ }
888
+ const obj_order = obj.order;
889
+ const path_order = path + '.order';
890
+ let obj_order_union0 = null;
891
+ const obj_order_union0_error = (() => {
892
+ if (typeof obj_order !== 'number' || (typeof obj_order === 'number' && Math.floor(obj_order) !== obj_order)) {
893
+ return new TypeError('Expected "integer" but received "' + typeof obj_order + '" (at "' + path_order + '")');
894
+ }
895
+ })();
896
+ if (obj_order_union0_error != null) {
897
+ obj_order_union0 = obj_order_union0_error.message;
898
+ }
899
+ let obj_order_union1 = null;
900
+ const obj_order_union1_error = (() => {
901
+ if (obj_order !== null) {
902
+ return new TypeError('Expected "null" but received "' + typeof obj_order + '" (at "' + path_order + '")');
903
+ }
904
+ })();
905
+ if (obj_order_union1_error != null) {
906
+ obj_order_union1 = obj_order_union1_error.message;
907
+ }
908
+ if (obj_order_union0 && obj_order_union1) {
909
+ let message = 'Object doesn\'t match union (at "' + path_order + '")';
910
+ message += '\n' + obj_order_union0.split('\n').map((line) => '\t' + line).join('\n');
911
+ message += '\n' + obj_order_union1.split('\n').map((line) => '\t' + line).join('\n');
912
+ return new TypeError(message);
913
+ }
914
+ const obj_previewImageUrl = obj.previewImageUrl;
915
+ const path_previewImageUrl = path + '.previewImageUrl';
916
+ let obj_previewImageUrl_union0 = null;
917
+ const obj_previewImageUrl_union0_error = (() => {
918
+ if (typeof obj_previewImageUrl !== 'string') {
919
+ return new TypeError('Expected "string" but received "' + typeof obj_previewImageUrl + '" (at "' + path_previewImageUrl + '")');
920
+ }
921
+ })();
922
+ if (obj_previewImageUrl_union0_error != null) {
923
+ obj_previewImageUrl_union0 = obj_previewImageUrl_union0_error.message;
924
+ }
925
+ let obj_previewImageUrl_union1 = null;
926
+ const obj_previewImageUrl_union1_error = (() => {
927
+ if (obj_previewImageUrl !== null) {
928
+ return new TypeError('Expected "null" but received "' + typeof obj_previewImageUrl + '" (at "' + path_previewImageUrl + '")');
929
+ }
930
+ })();
931
+ if (obj_previewImageUrl_union1_error != null) {
932
+ obj_previewImageUrl_union1 = obj_previewImageUrl_union1_error.message;
933
+ }
934
+ if (obj_previewImageUrl_union0 && obj_previewImageUrl_union1) {
935
+ let message = 'Object doesn\'t match union (at "' + path_previewImageUrl + '")';
936
+ message += '\n' + obj_previewImageUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
937
+ message += '\n' + obj_previewImageUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
938
+ return new TypeError(message);
939
+ }
940
+ const obj_title = obj.title;
941
+ const path_title = path + '.title';
942
+ let obj_title_union0 = null;
943
+ const obj_title_union0_error = (() => {
944
+ if (typeof obj_title !== 'string') {
945
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
946
+ }
947
+ })();
948
+ if (obj_title_union0_error != null) {
949
+ obj_title_union0 = obj_title_union0_error.message;
950
+ }
951
+ let obj_title_union1 = null;
952
+ const obj_title_union1_error = (() => {
953
+ if (obj_title !== null) {
954
+ return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
955
+ }
956
+ })();
957
+ if (obj_title_union1_error != null) {
958
+ obj_title_union1 = obj_title_union1_error.message;
959
+ }
960
+ if (obj_title_union0 && obj_title_union1) {
961
+ let message = 'Object doesn\'t match union (at "' + path_title + '")';
962
+ message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
963
+ message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
964
+ return new TypeError(message);
965
+ }
966
+ })();
967
+ return v_error === undefined ? null : v_error;
968
+ }
969
+ const RepresentationType = 'FeatureSetRepresentation';
970
+ function keyBuilder$2(luvio, config) {
971
+ return keyPrefix + '::' + RepresentationType + ':' + config.featureSetApiName;
972
+ }
973
+ function keyBuilderFromType(luvio, object) {
974
+ const keyParams = {
975
+ featureSetApiName: object.featureSetApiName
976
+ };
977
+ return keyBuilder$2(luvio, keyParams);
978
+ }
979
+ function normalize(input, existing, path, luvio, store, timestamp) {
980
+ return input;
981
+ }
982
+ const select$1 = function FeatureSetRepresentationSelect() {
983
+ const { selections: FeatureSetErrorRepresentation__selections, opaque: FeatureSetErrorRepresentation__opaque, } = select$8();
984
+ const { selections: FeatureRepresentation__selections, opaque: FeatureRepresentation__opaque, } = select$2();
985
+ return {
986
+ kind: 'Fragment',
987
+ version: VERSION,
988
+ private: [],
989
+ selections: [
990
+ {
991
+ name: 'description',
992
+ kind: 'Scalar'
993
+ },
994
+ {
995
+ name: 'errors',
996
+ kind: 'Object',
997
+ plural: true,
998
+ selections: FeatureSetErrorRepresentation__selections
999
+ },
1000
+ {
1001
+ name: 'featureCategory',
1002
+ kind: 'Scalar'
1003
+ },
1004
+ {
1005
+ name: 'featureSetApiName',
1006
+ kind: 'Scalar'
1007
+ },
1008
+ {
1009
+ name: 'featureSetStatus',
1010
+ kind: 'Scalar'
1011
+ },
1012
+ {
1013
+ name: 'features',
1014
+ kind: 'Object',
1015
+ plural: true,
1016
+ selections: FeatureRepresentation__selections
1017
+ },
1018
+ {
1019
+ name: 'order',
1020
+ kind: 'Scalar'
1021
+ },
1022
+ {
1023
+ name: 'previewImageUrl',
1024
+ kind: 'Scalar'
1025
+ },
1026
+ {
1027
+ name: 'title',
1028
+ kind: 'Scalar'
1029
+ }
1030
+ ]
1031
+ };
1032
+ };
1033
+ function equals(existing, incoming) {
1034
+ const existing_description = existing.description;
1035
+ const incoming_description = incoming.description;
1036
+ if (!(existing_description === incoming_description)) {
1037
+ return false;
1038
+ }
1039
+ const existing_featureSetApiName = existing.featureSetApiName;
1040
+ const incoming_featureSetApiName = incoming.featureSetApiName;
1041
+ if (!(existing_featureSetApiName === incoming_featureSetApiName)) {
1042
+ return false;
1043
+ }
1044
+ const existing_featureSetStatus = existing.featureSetStatus;
1045
+ const incoming_featureSetStatus = incoming.featureSetStatus;
1046
+ if (!(existing_featureSetStatus === incoming_featureSetStatus)) {
1047
+ return false;
1048
+ }
1049
+ const existing_errors = existing.errors;
1050
+ const incoming_errors = incoming.errors;
1051
+ const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
1052
+ if (!(equals$6(existing_errors_item, incoming_errors_item))) {
1053
+ return false;
1054
+ }
1055
+ });
1056
+ if (equals_errors_items === false) {
1057
+ return false;
1058
+ }
1059
+ const existing_featureCategory = existing.featureCategory;
1060
+ const incoming_featureCategory = incoming.featureCategory;
1061
+ if (!(existing_featureCategory === incoming_featureCategory)) {
1062
+ return false;
1063
+ }
1064
+ const existing_features = existing.features;
1065
+ const incoming_features = incoming.features;
1066
+ const equals_features_items = equalsArray(existing_features, incoming_features, (existing_features_item, incoming_features_item) => {
1067
+ if (!(equals$1(existing_features_item, incoming_features_item))) {
1068
+ return false;
1069
+ }
1070
+ });
1071
+ if (equals_features_items === false) {
1072
+ return false;
1073
+ }
1074
+ const existing_order = existing.order;
1075
+ const incoming_order = incoming.order;
1076
+ if (!(existing_order === incoming_order)) {
1077
+ return false;
1078
+ }
1079
+ const existing_previewImageUrl = existing.previewImageUrl;
1080
+ const incoming_previewImageUrl = incoming.previewImageUrl;
1081
+ if (!(existing_previewImageUrl === incoming_previewImageUrl)) {
1082
+ return false;
1083
+ }
1084
+ const existing_title = existing.title;
1085
+ const incoming_title = incoming.title;
1086
+ if (!(existing_title === incoming_title)) {
1087
+ return false;
1088
+ }
1089
+ return true;
1090
+ }
1091
+ const ingest = function FeatureSetRepresentationIngest(input, path, luvio, store, timestamp) {
1092
+ if (process.env.NODE_ENV !== 'production') {
1093
+ const validateError = validate(input);
1094
+ if (validateError !== null) {
1095
+ throw validateError;
1096
+ }
1097
+ }
1098
+ const key = keyBuilderFromType(luvio, input);
1099
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 100;
1100
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "basesetup", VERSION, RepresentationType, equals);
1101
+ return createLink(key);
1102
+ };
1103
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1104
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1105
+ const rootKey = keyBuilderFromType(luvio, input);
1106
+ rootKeySet.set(rootKey, {
1107
+ namespace: keyPrefix,
1108
+ representationName: RepresentationType,
1109
+ mergeable: false
1110
+ });
1111
+ }
1112
+
1113
+ function select(luvio, params) {
1114
+ return select$1();
1115
+ }
1116
+ function keyBuilder$1(luvio, params) {
1117
+ return keyBuilder$2(luvio, {
1118
+ featureSetApiName: params.queryParams.featureSetApiName
1119
+ });
1120
+ }
1121
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1122
+ getTypeCacheKeys(storeKeyMap, luvio, response);
1123
+ }
1124
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1125
+ const { body } = response;
1126
+ const key = keyBuilder$1(luvio, resourceParams);
1127
+ luvio.storeIngest(key, ingest, body);
1128
+ const snapshot = luvio.storeLookup({
1129
+ recordId: key,
1130
+ node: select(),
1131
+ variables: {},
1132
+ }, snapshotRefresh);
1133
+ if (process.env.NODE_ENV !== 'production') {
1134
+ if (snapshot.state !== 'Fulfilled') {
1135
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1136
+ }
1137
+ }
1138
+ deepFreeze(snapshot.data);
1139
+ return snapshot;
1140
+ }
1141
+ function ingestError(luvio, params, error, snapshotRefresh) {
1142
+ const key = keyBuilder$1(luvio, params);
1143
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1144
+ luvio.storeIngestError(key, errorSnapshot);
1145
+ return errorSnapshot;
1146
+ }
1147
+ function createResourceRequest(config) {
1148
+ const headers = {};
1149
+ return {
1150
+ baseUri: '/services/data/v62.0',
1151
+ basePath: '/connect/base-setup/featureSetDetail',
1152
+ method: 'get',
1153
+ body: null,
1154
+ urlParams: {},
1155
+ queryParams: config.queryParams,
1156
+ headers,
1157
+ priority: 'normal',
1158
+ };
1159
+ }
1160
+ function createResourceRequestFromRepresentation(representation) {
1161
+ const config = {
1162
+ queryParams: {},
1163
+ };
1164
+ config.queryParams.featureSetApiName = representation.featureSetApiName;
1165
+ return createResourceRequest(config);
1166
+ }
1167
+
1168
+ const adapterName = 'getFeatureSetDetail';
1169
+ const getFeatureSetDetail_ConfigPropertyMetadata = [
1170
+ generateParamConfigMetadata('featureApiNames', false, 1 /* QueryParameter */, 0 /* String */, true),
1171
+ generateParamConfigMetadata('featureSetApiName', true, 1 /* QueryParameter */, 0 /* String */),
1172
+ ];
1173
+ const getFeatureSetDetail_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getFeatureSetDetail_ConfigPropertyMetadata);
1174
+ const createResourceParams = /*#__PURE__*/ createResourceParams$2(getFeatureSetDetail_ConfigPropertyMetadata);
1175
+ function keyBuilder(luvio, config) {
1176
+ const resourceParams = createResourceParams(config);
1177
+ return keyBuilder$1(luvio, resourceParams);
1178
+ }
1179
+ function typeCheckConfig(untrustedConfig) {
1180
+ const config = {};
1181
+ typeCheckConfig$2(untrustedConfig, config, getFeatureSetDetail_ConfigPropertyMetadata);
1182
+ return config;
1183
+ }
1184
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1185
+ if (!untrustedIsObject(untrustedConfig)) {
1186
+ return null;
1187
+ }
1188
+ if (process.env.NODE_ENV !== 'production') {
1189
+ validateConfig(untrustedConfig, configPropertyNames);
1190
+ }
1191
+ const config = typeCheckConfig(untrustedConfig);
1192
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1193
+ return null;
1194
+ }
1195
+ return config;
1196
+ }
1197
+ function adapterFragment(luvio, config) {
1198
+ createResourceParams(config);
1199
+ return select();
1200
+ }
1201
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1202
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
1203
+ config,
1204
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1205
+ });
1206
+ return luvio.storeBroadcast().then(() => snapshot);
1207
+ }
1208
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1209
+ const snapshot = ingestError(luvio, resourceParams, response, {
1210
+ config,
1211
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1212
+ });
1213
+ return luvio.storeBroadcast().then(() => snapshot);
1214
+ }
1215
+ function buildNetworkSnapshot(luvio, config, options) {
1216
+ const resourceParams = createResourceParams(config);
1217
+ const request = createResourceRequest(resourceParams);
1218
+ return luvio.dispatchResourceRequest(request, options)
1219
+ .then((response) => {
1220
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
1221
+ const cache = new StoreKeyMap();
1222
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1223
+ return cache;
1224
+ });
1225
+ }, (response) => {
1226
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1227
+ });
1228
+ }
1229
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1230
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
1231
+ }
1232
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1233
+ const { luvio, config } = context;
1234
+ const selector = {
1235
+ recordId: keyBuilder(luvio, config),
1236
+ node: adapterFragment(luvio, config),
1237
+ variables: {},
1238
+ };
1239
+ const cacheSnapshot = storeLookup(selector, {
1240
+ config,
1241
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1242
+ });
1243
+ return cacheSnapshot;
1244
+ }
1245
+ const getFeatureSetDetailAdapterFactory = (luvio) => function basesetup__getFeatureSetDetail(untrustedConfig, requestContext) {
1246
+ const config = validateAdapterConfig(untrustedConfig, getFeatureSetDetail_ConfigPropertyNames);
1247
+ // Invalid or incomplete config
1248
+ if (config === null) {
1249
+ return null;
1250
+ }
1251
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1252
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1253
+ };
1254
+ const notifyChangeFactory = (luvio, options) => {
1255
+ return function getConnectBaseSetupFeatureSetDetailNotifyChange(configs) {
1256
+ const keys = configs.map(c => keyBuilder$2(luvio, c));
1257
+ luvio.getNotifyChangeStoreEntries(keys).then(entries => {
1258
+ for (let i = 0, len = entries.length; i < len; i++) {
1259
+ const { key, record: val } = entries[i];
1260
+ const refreshRequest = createResourceRequestFromRepresentation(val);
1261
+ luvio.dispatchResourceRequest(refreshRequest, options)
1262
+ .then((response) => {
1263
+ return luvio.handleSuccessResponse(() => {
1264
+ const { body } = response;
1265
+ luvio.storeIngest(key, ingest, body);
1266
+ return luvio.storeBroadcast();
1267
+ }, () => {
1268
+ const cache = new StoreKeyMap();
1269
+ getTypeCacheKeys(cache, luvio, response.body);
1270
+ return cache;
1271
+ });
1272
+ }, (error) => {
1273
+ return luvio.handleErrorResponse(() => {
1274
+ const errorSnapshot = luvio.errorSnapshot(error);
1275
+ luvio.storeIngestError(key, errorSnapshot, undefined);
1276
+ return luvio.storeBroadcast().then(() => errorSnapshot);
1277
+ });
1278
+ });
1279
+ }
1280
+ });
1281
+ };
1282
+ };
1283
+
1284
+ let enableFeatureSet;
1285
+ let getFeatureSetDetail;
1286
+ let getFeatureSetDetailNotifyChange;
1287
+ // Imperative GET Adapters
1288
+ let getFeatureSetDetail_imperative;
1289
+ const getFeatureSetDetailMetadata = { apiFamily: 'basesetup', name: 'getFeatureSetDetail' };
1290
+ // Notify Update Available
1291
+ function bindExportsTo(luvio) {
1292
+ // LDS Adapters
1293
+ const getFeatureSetDetail_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getFeatureSetDetail', getFeatureSetDetailAdapterFactory), getFeatureSetDetailMetadata);
1294
+ function unwrapSnapshotData(factory) {
1295
+ const adapter = factory(luvio);
1296
+ return (config) => adapter(config).then((snapshot) => snapshot.data);
1297
+ }
1298
+ return {
1299
+ enableFeatureSet: unwrapSnapshotData(enableFeatureSetAdapterFactory),
1300
+ getFeatureSetDetail: createWireAdapterConstructor(luvio, getFeatureSetDetail_ldsAdapter, getFeatureSetDetailMetadata),
1301
+ getFeatureSetDetailNotifyChange: createLDSAdapter(luvio, 'getFeatureSetDetailNotifyChange', notifyChangeFactory),
1302
+ // Imperative GET Adapters
1303
+ getFeatureSetDetail_imperative: createImperativeAdapter(luvio, getFeatureSetDetail_ldsAdapter, getFeatureSetDetailMetadata),
1304
+ // Notify Update Availables
1305
+ };
1306
+ }
1307
+ withDefaultLuvio((luvio) => {
1308
+ ({
1309
+ enableFeatureSet,
1310
+ getFeatureSetDetail,
1311
+ getFeatureSetDetailNotifyChange,
1312
+ getFeatureSetDetail_imperative,
1313
+ } = bindExportsTo(luvio));
1314
+ });
1315
+
1316
+ export { enableFeatureSet, getFeatureSetDetail, getFeatureSetDetailNotifyChange, getFeatureSetDetail_imperative };
1317
+ // version: 1.308.0-e148a73d6a