@salesforce/lds-adapters-service-serviceemployee 0.1.0-dev1

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 (58) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/service-serviceemployee.js +3622 -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/availableUserOptions.d.ts +30 -0
  5. package/dist/es/es2018/types/src/generated/adapters/getEmpEnablementPrograms.d.ts +30 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getFieldDetailsFromCompactLayout.d.ts +16 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getUserProfileDetails.d.ts +16 -0
  8. package/dist/es/es2018/types/src/generated/adapters/getUserSettings.d.ts +27 -0
  9. package/dist/es/es2018/types/src/generated/adapters/postEmployeeUserProvisioningJob.d.ts +14 -0
  10. package/dist/es/es2018/types/src/generated/adapters/updateUserSettings.d.ts +23 -0
  11. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +7 -0
  12. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +11 -0
  13. package/dist/es/es2018/types/src/generated/resources/getConnectEmployeeEnablementPrograms.d.ts +18 -0
  14. package/dist/es/es2018/types/src/generated/resources/getConnectServiceEmployeeUserSettingsDetails.d.ts +15 -0
  15. package/dist/es/es2018/types/src/generated/resources/patchConnectServiceEmployeeUserSettings.d.ts +20 -0
  16. package/dist/es/es2018/types/src/generated/resources/postConnectEmployeeHubEmployeeProfileCardEmployeeDetails.d.ts +13 -0
  17. package/dist/es/es2018/types/src/generated/resources/postConnectEmployeeHubProfileUserByUserId.d.ts +15 -0
  18. package/dist/es/es2018/types/src/generated/resources/postConnectServiceEmployeeAvailableUserOptions.d.ts +18 -0
  19. package/dist/es/es2018/types/src/generated/resources/postConnectServiceEmployeeEmployeeUserProvisioning.d.ts +10 -0
  20. package/dist/es/es2018/types/src/generated/types/AvailableUserOptionsInputRepresentation.d.ts +31 -0
  21. package/dist/es/es2018/types/src/generated/types/AvailableUserOptionsOutputRepresentation.d.ts +44 -0
  22. package/dist/es/es2018/types/src/generated/types/EmailEncodingDetailsRepresentation.d.ts +31 -0
  23. package/dist/es/es2018/types/src/generated/types/EmployeeProfileCardFieldValueOutputRepresentation.d.ts +37 -0
  24. package/dist/es/es2018/types/src/generated/types/EmployeeProfileCardInputListRepresentation.d.ts +31 -0
  25. package/dist/es/es2018/types/src/generated/types/EmployeeProfileCardInputRepresentation.d.ts +34 -0
  26. package/dist/es/es2018/types/src/generated/types/EmployeeProfileCardListOutputRepresentation.d.ts +41 -0
  27. package/dist/es/es2018/types/src/generated/types/EmployeeProfileCardOutputRepresentation.d.ts +32 -0
  28. package/dist/es/es2018/types/src/generated/types/EmployeeProfileCardStatusOutputRepresentation.d.ts +31 -0
  29. package/dist/es/es2018/types/src/generated/types/EmployeeUserProvisioningJobInputRepresentation.d.ts +25 -0
  30. package/dist/es/es2018/types/src/generated/types/EmployeeUserProvisioningJobOutputRepresentation.d.ts +37 -0
  31. package/dist/es/es2018/types/src/generated/types/EnablementProgramItemDetailsOutputRepresentation.d.ts +46 -0
  32. package/dist/es/es2018/types/src/generated/types/EnablementProgramListOutputRepresentation.d.ts +36 -0
  33. package/dist/es/es2018/types/src/generated/types/EnablementProgramListStatusOutputRepresentation.d.ts +31 -0
  34. package/dist/es/es2018/types/src/generated/types/EnablementProgramOutputRepresentation.d.ts +83 -0
  35. package/dist/es/es2018/types/src/generated/types/EnablementProgramSectionOutputRepresentation.d.ts +31 -0
  36. package/dist/es/es2018/types/src/generated/types/EnablementProgramTaskOutputRepresentation.d.ts +55 -0
  37. package/dist/es/es2018/types/src/generated/types/GenericResultRepresentation.d.ts +40 -0
  38. package/dist/es/es2018/types/src/generated/types/LicenseDetailsInputRepresentation.d.ts +28 -0
  39. package/dist/es/es2018/types/src/generated/types/PermissionDetailsRepresentation.d.ts +37 -0
  40. package/dist/es/es2018/types/src/generated/types/PermissionSetGroupsDetailsRepresentation.d.ts +34 -0
  41. package/dist/es/es2018/types/src/generated/types/PermissionSetsDetailsRepresentation.d.ts +40 -0
  42. package/dist/es/es2018/types/src/generated/types/PermissionSetsInputRepresentation.d.ts +28 -0
  43. package/dist/es/es2018/types/src/generated/types/ProfileDetailsRepresentation.d.ts +37 -0
  44. package/dist/es/es2018/types/src/generated/types/ProgramPersonaOutputRepresentation.d.ts +34 -0
  45. package/dist/es/es2018/types/src/generated/types/ServiceEmployeeStatusOutputRepresentation.d.ts +31 -0
  46. package/dist/es/es2018/types/src/generated/types/UserProfileDetailOutputRepresentation.d.ts +31 -0
  47. package/dist/es/es2018/types/src/generated/types/UserProfileEntitySelectionInputRepresentation.d.ts +31 -0
  48. package/dist/es/es2018/types/src/generated/types/UserProfileFieldsInputRepresentation.d.ts +28 -0
  49. package/dist/es/es2018/types/src/generated/types/UserProfileInputRepresentation.d.ts +28 -0
  50. package/dist/es/es2018/types/src/generated/types/UserProfileOutputRepresentation.d.ts +41 -0
  51. package/dist/es/es2018/types/src/generated/types/UserSettingsInputRepresentation.d.ts +52 -0
  52. package/dist/es/es2018/types/src/generated/types/UserSettingsOutputRepresentations.d.ts +51 -0
  53. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  54. package/package.json +66 -0
  55. package/sfdc/index.d.ts +1 -0
  56. package/sfdc/index.js +3691 -0
  57. package/src/raml/api.raml +690 -0
  58. package/src/raml/luvio.raml +56 -0
@@ -0,0 +1,3622 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$7, typeCheckConfig as typeCheckConfig$7, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3 } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
11
+ const { isArray: ArrayIsArray$1 } = Array;
12
+ /**
13
+ * Validates an adapter config is well-formed.
14
+ * @param config The config to validate.
15
+ * @param adapter The adapter validation configuration.
16
+ * @param oneOf The keys the config must contain at least one of.
17
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
+ */
19
+ function validateConfig(config, adapter, oneOf) {
20
+ const { displayName } = adapter;
21
+ const { required, optional, unsupported } = adapter.parameters;
22
+ if (config === undefined ||
23
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
+ }
26
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
+ }
29
+ if (unsupported !== undefined &&
30
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
+ }
33
+ const supported = required.concat(optional);
34
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
35
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
+ }
37
+ }
38
+ function untrustedIsObject(untrusted) {
39
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
+ }
41
+ function areRequiredParametersPresent(config, configPropertyNames) {
42
+ return configPropertyNames.parameters.required.every(req => req in config);
43
+ }
44
+ const snapshotRefreshOptions = {
45
+ overrides: {
46
+ headers: {
47
+ 'Cache-Control': 'no-cache',
48
+ },
49
+ }
50
+ };
51
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
52
+ return {
53
+ name,
54
+ required,
55
+ resourceType,
56
+ typeCheckShape,
57
+ isArrayShape,
58
+ coerceFn,
59
+ };
60
+ }
61
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
62
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
63
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
64
+ return {
65
+ displayName,
66
+ parameters: {
67
+ required,
68
+ optional,
69
+ }
70
+ };
71
+ }
72
+ const keyPrefix = 'Service-employee';
73
+
74
+ const { isArray: ArrayIsArray } = Array;
75
+ const { stringify: JSONStringify } = JSON;
76
+ function equalsArray(a, b, equalsItem) {
77
+ const aLength = a.length;
78
+ const bLength = b.length;
79
+ if (aLength !== bLength) {
80
+ return false;
81
+ }
82
+ for (let i = 0; i < aLength; i++) {
83
+ if (equalsItem(a[i], b[i]) === false) {
84
+ return false;
85
+ }
86
+ }
87
+ return true;
88
+ }
89
+ function createLink(ref) {
90
+ return {
91
+ __ref: serializeStructuredKey(ref),
92
+ };
93
+ }
94
+
95
+ const VERSION$j = "7bf71d57246e2ee1d5ba5890c3c2bb88";
96
+ function validate$l(obj, path = 'EmployeeProfileCardFieldValueOutputRepresentation') {
97
+ const v_error = (() => {
98
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
99
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
100
+ }
101
+ const obj_displayName = obj.displayName;
102
+ const path_displayName = path + '.displayName';
103
+ if (typeof obj_displayName !== 'string') {
104
+ return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
105
+ }
106
+ const obj_fieldName = obj.fieldName;
107
+ const path_fieldName = path + '.fieldName';
108
+ if (typeof obj_fieldName !== 'string') {
109
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
110
+ }
111
+ const obj_fieldType = obj.fieldType;
112
+ const path_fieldType = path + '.fieldType';
113
+ if (typeof obj_fieldType !== 'string') {
114
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldType + '" (at "' + path_fieldType + '")');
115
+ }
116
+ const obj_fieldValue = obj.fieldValue;
117
+ const path_fieldValue = path + '.fieldValue';
118
+ let obj_fieldValue_union0 = null;
119
+ const obj_fieldValue_union0_error = (() => {
120
+ if (typeof obj_fieldValue !== 'string') {
121
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldValue + '" (at "' + path_fieldValue + '")');
122
+ }
123
+ })();
124
+ if (obj_fieldValue_union0_error != null) {
125
+ obj_fieldValue_union0 = obj_fieldValue_union0_error.message;
126
+ }
127
+ let obj_fieldValue_union1 = null;
128
+ const obj_fieldValue_union1_error = (() => {
129
+ if (obj_fieldValue !== null) {
130
+ return new TypeError('Expected "null" but received "' + typeof obj_fieldValue + '" (at "' + path_fieldValue + '")');
131
+ }
132
+ })();
133
+ if (obj_fieldValue_union1_error != null) {
134
+ obj_fieldValue_union1 = obj_fieldValue_union1_error.message;
135
+ }
136
+ if (obj_fieldValue_union0 && obj_fieldValue_union1) {
137
+ let message = 'Object doesn\'t match union (at "' + path_fieldValue + '")';
138
+ message += '\n' + obj_fieldValue_union0.split('\n').map((line) => '\t' + line).join('\n');
139
+ message += '\n' + obj_fieldValue_union1.split('\n').map((line) => '\t' + line).join('\n');
140
+ return new TypeError(message);
141
+ }
142
+ })();
143
+ return v_error === undefined ? null : v_error;
144
+ }
145
+ const select$q = function EmployeeProfileCardFieldValueOutputRepresentationSelect() {
146
+ return {
147
+ kind: 'Fragment',
148
+ version: VERSION$j,
149
+ private: [],
150
+ selections: [
151
+ {
152
+ name: 'displayName',
153
+ kind: 'Scalar'
154
+ },
155
+ {
156
+ name: 'fieldName',
157
+ kind: 'Scalar'
158
+ },
159
+ {
160
+ name: 'fieldType',
161
+ kind: 'Scalar'
162
+ },
163
+ {
164
+ name: 'fieldValue',
165
+ kind: 'Scalar'
166
+ }
167
+ ]
168
+ };
169
+ };
170
+ function equals$j(existing, incoming) {
171
+ const existing_displayName = existing.displayName;
172
+ const incoming_displayName = incoming.displayName;
173
+ if (!(existing_displayName === incoming_displayName)) {
174
+ return false;
175
+ }
176
+ const existing_fieldName = existing.fieldName;
177
+ const incoming_fieldName = incoming.fieldName;
178
+ if (!(existing_fieldName === incoming_fieldName)) {
179
+ return false;
180
+ }
181
+ const existing_fieldType = existing.fieldType;
182
+ const incoming_fieldType = incoming.fieldType;
183
+ if (!(existing_fieldType === incoming_fieldType)) {
184
+ return false;
185
+ }
186
+ const existing_fieldValue = existing.fieldValue;
187
+ const incoming_fieldValue = incoming.fieldValue;
188
+ if (!(existing_fieldValue === incoming_fieldValue)) {
189
+ return false;
190
+ }
191
+ return true;
192
+ }
193
+
194
+ const VERSION$i = "63e97aada6f756dcca30661a15f26c87";
195
+ function validate$k(obj, path = 'EmployeeProfileCardOutputRepresentation') {
196
+ const v_error = (() => {
197
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
198
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
199
+ }
200
+ const obj_entityName = obj.entityName;
201
+ const path_entityName = path + '.entityName';
202
+ if (typeof obj_entityName !== 'string') {
203
+ return new TypeError('Expected "string" but received "' + typeof obj_entityName + '" (at "' + path_entityName + '")');
204
+ }
205
+ const obj_fieldValueData = obj.fieldValueData;
206
+ const path_fieldValueData = path + '.fieldValueData';
207
+ if (!ArrayIsArray(obj_fieldValueData)) {
208
+ return new TypeError('Expected "array" but received "' + typeof obj_fieldValueData + '" (at "' + path_fieldValueData + '")');
209
+ }
210
+ for (let i = 0; i < obj_fieldValueData.length; i++) {
211
+ const obj_fieldValueData_item = obj_fieldValueData[i];
212
+ const path_fieldValueData_item = path_fieldValueData + '[' + i + ']';
213
+ const referencepath_fieldValueData_itemValidationError = validate$l(obj_fieldValueData_item, path_fieldValueData_item);
214
+ if (referencepath_fieldValueData_itemValidationError !== null) {
215
+ let message = 'Object doesn\'t match EmployeeProfileCardFieldValueOutputRepresentation (at "' + path_fieldValueData_item + '")\n';
216
+ message += referencepath_fieldValueData_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
217
+ return new TypeError(message);
218
+ }
219
+ }
220
+ })();
221
+ return v_error === undefined ? null : v_error;
222
+ }
223
+ const select$p = function EmployeeProfileCardOutputRepresentationSelect() {
224
+ const { selections: EmployeeProfileCardFieldValueOutputRepresentation__selections, opaque: EmployeeProfileCardFieldValueOutputRepresentation__opaque, } = select$q();
225
+ return {
226
+ kind: 'Fragment',
227
+ version: VERSION$i,
228
+ private: [],
229
+ selections: [
230
+ {
231
+ name: 'entityName',
232
+ kind: 'Scalar'
233
+ },
234
+ {
235
+ name: 'fieldValueData',
236
+ kind: 'Object',
237
+ plural: true,
238
+ selections: EmployeeProfileCardFieldValueOutputRepresentation__selections
239
+ }
240
+ ]
241
+ };
242
+ };
243
+ function equals$i(existing, incoming) {
244
+ const existing_entityName = existing.entityName;
245
+ const incoming_entityName = incoming.entityName;
246
+ if (!(existing_entityName === incoming_entityName)) {
247
+ return false;
248
+ }
249
+ const existing_fieldValueData = existing.fieldValueData;
250
+ const incoming_fieldValueData = incoming.fieldValueData;
251
+ const equals_fieldValueData_items = equalsArray(existing_fieldValueData, incoming_fieldValueData, (existing_fieldValueData_item, incoming_fieldValueData_item) => {
252
+ if (!(equals$j(existing_fieldValueData_item, incoming_fieldValueData_item))) {
253
+ return false;
254
+ }
255
+ });
256
+ if (equals_fieldValueData_items === false) {
257
+ return false;
258
+ }
259
+ return true;
260
+ }
261
+
262
+ const VERSION$h = "b13e8c6518c9147325425600026202eb";
263
+ function validate$j(obj, path = 'EmployeeProfileCardStatusOutputRepresentation') {
264
+ const v_error = (() => {
265
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
266
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
267
+ }
268
+ const obj_code = obj.code;
269
+ const path_code = path + '.code';
270
+ if (typeof obj_code !== 'number' || (typeof obj_code === 'number' && Math.floor(obj_code) !== obj_code)) {
271
+ return new TypeError('Expected "integer" but received "' + typeof obj_code + '" (at "' + path_code + '")');
272
+ }
273
+ const obj_message = obj.message;
274
+ const path_message = path + '.message';
275
+ if (typeof obj_message !== 'string') {
276
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
277
+ }
278
+ })();
279
+ return v_error === undefined ? null : v_error;
280
+ }
281
+ const select$o = function EmployeeProfileCardStatusOutputRepresentationSelect() {
282
+ return {
283
+ kind: 'Fragment',
284
+ version: VERSION$h,
285
+ private: [],
286
+ selections: [
287
+ {
288
+ name: 'code',
289
+ kind: 'Scalar'
290
+ },
291
+ {
292
+ name: 'message',
293
+ kind: 'Scalar'
294
+ }
295
+ ]
296
+ };
297
+ };
298
+ function equals$h(existing, incoming) {
299
+ const existing_code = existing.code;
300
+ const incoming_code = incoming.code;
301
+ if (!(existing_code === incoming_code)) {
302
+ return false;
303
+ }
304
+ const existing_message = existing.message;
305
+ const incoming_message = incoming.message;
306
+ if (!(existing_message === incoming_message)) {
307
+ return false;
308
+ }
309
+ return true;
310
+ }
311
+
312
+ const VERSION$g = "61b48f8b587aa42ecef1315aa0dca4d9";
313
+ function validate$i(obj, path = 'EmployeeProfileCardListOutputRepresentation') {
314
+ const v_error = (() => {
315
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
316
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
317
+ }
318
+ const obj_fieldValueDataList = obj.fieldValueDataList;
319
+ const path_fieldValueDataList = path + '.fieldValueDataList';
320
+ if (!ArrayIsArray(obj_fieldValueDataList)) {
321
+ return new TypeError('Expected "array" but received "' + typeof obj_fieldValueDataList + '" (at "' + path_fieldValueDataList + '")');
322
+ }
323
+ for (let i = 0; i < obj_fieldValueDataList.length; i++) {
324
+ const obj_fieldValueDataList_item = obj_fieldValueDataList[i];
325
+ const path_fieldValueDataList_item = path_fieldValueDataList + '[' + i + ']';
326
+ const referencepath_fieldValueDataList_itemValidationError = validate$k(obj_fieldValueDataList_item, path_fieldValueDataList_item);
327
+ if (referencepath_fieldValueDataList_itemValidationError !== null) {
328
+ let message = 'Object doesn\'t match EmployeeProfileCardOutputRepresentation (at "' + path_fieldValueDataList_item + '")\n';
329
+ message += referencepath_fieldValueDataList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
330
+ return new TypeError(message);
331
+ }
332
+ }
333
+ const obj_status = obj.status;
334
+ const path_status = path + '.status';
335
+ const referencepath_statusValidationError = validate$j(obj_status, path_status);
336
+ if (referencepath_statusValidationError !== null) {
337
+ let message = 'Object doesn\'t match EmployeeProfileCardStatusOutputRepresentation (at "' + path_status + '")\n';
338
+ message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
339
+ return new TypeError(message);
340
+ }
341
+ })();
342
+ return v_error === undefined ? null : v_error;
343
+ }
344
+ const RepresentationType$6 = 'EmployeeProfileCardListOutputRepresentation';
345
+ function keyBuilder$9(luvio, config) {
346
+ return keyPrefix + '::' + RepresentationType$6 + ':' + config.id;
347
+ }
348
+ function keyBuilderFromType$3(luvio, object) {
349
+ const keyParams = {
350
+ id: object.status.message
351
+ };
352
+ return keyBuilder$9(luvio, keyParams);
353
+ }
354
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
355
+ return input;
356
+ }
357
+ const select$n = function EmployeeProfileCardListOutputRepresentationSelect() {
358
+ const { selections: EmployeeProfileCardOutputRepresentation__selections, opaque: EmployeeProfileCardOutputRepresentation__opaque, } = select$p();
359
+ const { selections: EmployeeProfileCardStatusOutputRepresentation__selections, opaque: EmployeeProfileCardStatusOutputRepresentation__opaque, } = select$o();
360
+ return {
361
+ kind: 'Fragment',
362
+ version: VERSION$g,
363
+ private: [],
364
+ selections: [
365
+ {
366
+ name: 'fieldValueDataList',
367
+ kind: 'Object',
368
+ plural: true,
369
+ selections: EmployeeProfileCardOutputRepresentation__selections
370
+ },
371
+ {
372
+ name: 'status',
373
+ kind: 'Object',
374
+ selections: EmployeeProfileCardStatusOutputRepresentation__selections
375
+ }
376
+ ]
377
+ };
378
+ };
379
+ function equals$g(existing, incoming) {
380
+ const existing_fieldValueDataList = existing.fieldValueDataList;
381
+ const incoming_fieldValueDataList = incoming.fieldValueDataList;
382
+ const equals_fieldValueDataList_items = equalsArray(existing_fieldValueDataList, incoming_fieldValueDataList, (existing_fieldValueDataList_item, incoming_fieldValueDataList_item) => {
383
+ if (!(equals$i(existing_fieldValueDataList_item, incoming_fieldValueDataList_item))) {
384
+ return false;
385
+ }
386
+ });
387
+ if (equals_fieldValueDataList_items === false) {
388
+ return false;
389
+ }
390
+ const existing_status = existing.status;
391
+ const incoming_status = incoming.status;
392
+ if (!(equals$h(existing_status, incoming_status))) {
393
+ return false;
394
+ }
395
+ return true;
396
+ }
397
+ const ingest$6 = function EmployeeProfileCardListOutputRepresentationIngest(input, path, luvio, store, timestamp) {
398
+ if (process.env.NODE_ENV !== 'production') {
399
+ const validateError = validate$i(input);
400
+ if (validateError !== null) {
401
+ throw validateError;
402
+ }
403
+ }
404
+ const key = keyBuilderFromType$3(luvio, input);
405
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
406
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "Service-employee", VERSION$g, RepresentationType$6, equals$g);
407
+ return createLink(key);
408
+ };
409
+ function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
410
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
411
+ const rootKey = keyBuilderFromType$3(luvio, input);
412
+ rootKeySet.set(rootKey, {
413
+ namespace: keyPrefix,
414
+ representationName: RepresentationType$6,
415
+ mergeable: false
416
+ });
417
+ }
418
+
419
+ function select$m(luvio, params) {
420
+ return select$n();
421
+ }
422
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
423
+ getTypeCacheKeys$6(storeKeyMap, luvio, response);
424
+ }
425
+ function ingestSuccess$6(luvio, resourceParams, response) {
426
+ const { body } = response;
427
+ const key = keyBuilderFromType$3(luvio, body);
428
+ luvio.storeIngest(key, ingest$6, body);
429
+ const snapshot = luvio.storeLookup({
430
+ recordId: key,
431
+ node: select$m(),
432
+ variables: {},
433
+ });
434
+ if (process.env.NODE_ENV !== 'production') {
435
+ if (snapshot.state !== 'Fulfilled') {
436
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
437
+ }
438
+ }
439
+ deepFreeze(snapshot.data);
440
+ return snapshot;
441
+ }
442
+ function createResourceRequest$6(config) {
443
+ const headers = {};
444
+ return {
445
+ baseUri: '/services/data/v66.0',
446
+ basePath: '/connect/employee-hub/employee-profile-card/employee-details',
447
+ method: 'post',
448
+ body: config.body,
449
+ urlParams: {},
450
+ queryParams: {},
451
+ headers,
452
+ priority: 'normal',
453
+ };
454
+ }
455
+
456
+ const adapterName$6 = 'getFieldDetailsFromCompactLayout';
457
+ const getFieldDetailsFromCompactLayout_ConfigPropertyMetadata = [
458
+ generateParamConfigMetadata('fieldDetails', true, 2 /* Body */, 4 /* Unsupported */, true),
459
+ generateParamConfigMetadata('objectId', true, 2 /* Body */, 0 /* String */),
460
+ ];
461
+ const getFieldDetailsFromCompactLayout_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getFieldDetailsFromCompactLayout_ConfigPropertyMetadata);
462
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(getFieldDetailsFromCompactLayout_ConfigPropertyMetadata);
463
+ function typeCheckConfig$6(untrustedConfig) {
464
+ const config = {};
465
+ typeCheckConfig$7(untrustedConfig, config, getFieldDetailsFromCompactLayout_ConfigPropertyMetadata);
466
+ const untrustedConfig_fieldDetails = untrustedConfig.fieldDetails;
467
+ if (ArrayIsArray$1(untrustedConfig_fieldDetails)) {
468
+ const untrustedConfig_fieldDetails_array = [];
469
+ for (let i = 0, arrayLength = untrustedConfig_fieldDetails.length; i < arrayLength; i++) {
470
+ const untrustedConfig_fieldDetails_item = untrustedConfig_fieldDetails[i];
471
+ untrustedConfig_fieldDetails_array.push(untrustedConfig_fieldDetails_item);
472
+ }
473
+ config.fieldDetails = untrustedConfig_fieldDetails_array;
474
+ }
475
+ return config;
476
+ }
477
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
478
+ if (!untrustedIsObject(untrustedConfig)) {
479
+ return null;
480
+ }
481
+ if (process.env.NODE_ENV !== 'production') {
482
+ validateConfig(untrustedConfig, configPropertyNames);
483
+ }
484
+ const config = typeCheckConfig$6(untrustedConfig);
485
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
486
+ return null;
487
+ }
488
+ return config;
489
+ }
490
+ function buildNetworkSnapshot$6(luvio, config, options) {
491
+ const resourceParams = createResourceParams$6(config);
492
+ const request = createResourceRequest$6(resourceParams);
493
+ return luvio.dispatchResourceRequest(request, options)
494
+ .then((response) => {
495
+ return luvio.handleSuccessResponse(() => {
496
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response);
497
+ return luvio.storeBroadcast().then(() => snapshot);
498
+ }, () => {
499
+ const cache = new StoreKeyMap();
500
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
501
+ return cache;
502
+ });
503
+ }, (response) => {
504
+ deepFreeze(response);
505
+ throw response;
506
+ });
507
+ }
508
+ const getFieldDetailsFromCompactLayoutAdapterFactory = (luvio) => {
509
+ return function getFieldDetailsFromCompactLayout(untrustedConfig) {
510
+ const config = validateAdapterConfig$6(untrustedConfig, getFieldDetailsFromCompactLayout_ConfigPropertyNames);
511
+ // Invalid or incomplete config
512
+ if (config === null) {
513
+ throw new Error('Invalid config for "getFieldDetailsFromCompactLayout"');
514
+ }
515
+ return buildNetworkSnapshot$6(luvio, config);
516
+ };
517
+ };
518
+
519
+ const VERSION$f = "ed936bbb66e34f6168f8a0621da9e2fd";
520
+ function validate$h(obj, path = 'UserProfileDetailOutputRepresentation') {
521
+ const v_error = (() => {
522
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
523
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
524
+ }
525
+ const obj_fieldData = obj.fieldData;
526
+ const path_fieldData = path + '.fieldData';
527
+ if (!ArrayIsArray(obj_fieldData)) {
528
+ return new TypeError('Expected "array" but received "' + typeof obj_fieldData + '" (at "' + path_fieldData + '")');
529
+ }
530
+ for (let i = 0; i < obj_fieldData.length; i++) {
531
+ const obj_fieldData_item = obj_fieldData[i];
532
+ const path_fieldData_item = path_fieldData + '[' + i + ']';
533
+ if (obj_fieldData_item === undefined) {
534
+ return new TypeError('Expected "defined" but received "' + typeof obj_fieldData_item + '" (at "' + path_fieldData_item + '")');
535
+ }
536
+ }
537
+ const obj_objectName = obj.objectName;
538
+ const path_objectName = path + '.objectName';
539
+ if (typeof obj_objectName !== 'string') {
540
+ return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
541
+ }
542
+ })();
543
+ return v_error === undefined ? null : v_error;
544
+ }
545
+ const select$l = function UserProfileDetailOutputRepresentationSelect() {
546
+ return {
547
+ kind: 'Fragment',
548
+ version: VERSION$f,
549
+ private: [],
550
+ selections: [
551
+ {
552
+ name: 'fieldData',
553
+ kind: 'Object',
554
+ // any
555
+ },
556
+ {
557
+ name: 'objectName',
558
+ kind: 'Scalar'
559
+ }
560
+ ]
561
+ };
562
+ };
563
+ function equals$f(existing, incoming) {
564
+ const existing_objectName = existing.objectName;
565
+ const incoming_objectName = incoming.objectName;
566
+ if (!(existing_objectName === incoming_objectName)) {
567
+ return false;
568
+ }
569
+ const existing_fieldData = existing.fieldData;
570
+ const incoming_fieldData = incoming.fieldData;
571
+ const equals_fieldData_items = equalsArray(existing_fieldData, incoming_fieldData, (existing_fieldData_item, incoming_fieldData_item) => {
572
+ if (JSONStringify(incoming_fieldData_item) !== JSONStringify(existing_fieldData_item)) {
573
+ return false;
574
+ }
575
+ });
576
+ if (equals_fieldData_items === false) {
577
+ return false;
578
+ }
579
+ return true;
580
+ }
581
+
582
+ const VERSION$e = "f41210ee161819f019d2183a40b7702a";
583
+ function validate$g(obj, path = 'ServiceEmployeeStatusOutputRepresentation') {
584
+ const v_error = (() => {
585
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
586
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
587
+ }
588
+ const obj_code = obj.code;
589
+ const path_code = path + '.code';
590
+ if (typeof obj_code !== 'number' || (typeof obj_code === 'number' && Math.floor(obj_code) !== obj_code)) {
591
+ return new TypeError('Expected "integer" but received "' + typeof obj_code + '" (at "' + path_code + '")');
592
+ }
593
+ const obj_message = obj.message;
594
+ const path_message = path + '.message';
595
+ if (typeof obj_message !== 'string') {
596
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
597
+ }
598
+ })();
599
+ return v_error === undefined ? null : v_error;
600
+ }
601
+ const select$k = function ServiceEmployeeStatusOutputRepresentationSelect() {
602
+ return {
603
+ kind: 'Fragment',
604
+ version: VERSION$e,
605
+ private: [],
606
+ selections: [
607
+ {
608
+ name: 'code',
609
+ kind: 'Scalar'
610
+ },
611
+ {
612
+ name: 'message',
613
+ kind: 'Scalar'
614
+ }
615
+ ]
616
+ };
617
+ };
618
+ function equals$e(existing, incoming) {
619
+ const existing_code = existing.code;
620
+ const incoming_code = incoming.code;
621
+ if (!(existing_code === incoming_code)) {
622
+ return false;
623
+ }
624
+ const existing_message = existing.message;
625
+ const incoming_message = incoming.message;
626
+ if (!(existing_message === incoming_message)) {
627
+ return false;
628
+ }
629
+ return true;
630
+ }
631
+
632
+ const VERSION$d = "9e59517bf5add11ce0b6e2b89f3c6225";
633
+ function validate$f(obj, path = 'UserProfileOutputRepresentation') {
634
+ const v_error = (() => {
635
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
636
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
637
+ }
638
+ const obj_profileDetails = obj.profileDetails;
639
+ const path_profileDetails = path + '.profileDetails';
640
+ if (!ArrayIsArray(obj_profileDetails)) {
641
+ return new TypeError('Expected "array" but received "' + typeof obj_profileDetails + '" (at "' + path_profileDetails + '")');
642
+ }
643
+ for (let i = 0; i < obj_profileDetails.length; i++) {
644
+ const obj_profileDetails_item = obj_profileDetails[i];
645
+ const path_profileDetails_item = path_profileDetails + '[' + i + ']';
646
+ const referencepath_profileDetails_itemValidationError = validate$h(obj_profileDetails_item, path_profileDetails_item);
647
+ if (referencepath_profileDetails_itemValidationError !== null) {
648
+ let message = 'Object doesn\'t match UserProfileDetailOutputRepresentation (at "' + path_profileDetails_item + '")\n';
649
+ message += referencepath_profileDetails_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
650
+ return new TypeError(message);
651
+ }
652
+ }
653
+ const obj_status = obj.status;
654
+ const path_status = path + '.status';
655
+ const referencepath_statusValidationError = validate$g(obj_status, path_status);
656
+ if (referencepath_statusValidationError !== null) {
657
+ let message = 'Object doesn\'t match ServiceEmployeeStatusOutputRepresentation (at "' + path_status + '")\n';
658
+ message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
659
+ return new TypeError(message);
660
+ }
661
+ })();
662
+ return v_error === undefined ? null : v_error;
663
+ }
664
+ const RepresentationType$5 = 'UserProfileOutputRepresentation';
665
+ function keyBuilder$8(luvio, config) {
666
+ return keyPrefix + '::' + RepresentationType$5 + ':' + config.id;
667
+ }
668
+ function keyBuilderFromType$2(luvio, object) {
669
+ const keyParams = {
670
+ id: object.status.message
671
+ };
672
+ return keyBuilder$8(luvio, keyParams);
673
+ }
674
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
675
+ return input;
676
+ }
677
+ const select$j = function UserProfileOutputRepresentationSelect() {
678
+ const { selections: UserProfileDetailOutputRepresentation__selections, opaque: UserProfileDetailOutputRepresentation__opaque, } = select$l();
679
+ const { selections: ServiceEmployeeStatusOutputRepresentation__selections, opaque: ServiceEmployeeStatusOutputRepresentation__opaque, } = select$k();
680
+ return {
681
+ kind: 'Fragment',
682
+ version: VERSION$d,
683
+ private: [],
684
+ selections: [
685
+ {
686
+ name: 'profileDetails',
687
+ kind: 'Object',
688
+ plural: true,
689
+ selections: UserProfileDetailOutputRepresentation__selections
690
+ },
691
+ {
692
+ name: 'status',
693
+ kind: 'Object',
694
+ selections: ServiceEmployeeStatusOutputRepresentation__selections
695
+ }
696
+ ]
697
+ };
698
+ };
699
+ function equals$d(existing, incoming) {
700
+ const existing_profileDetails = existing.profileDetails;
701
+ const incoming_profileDetails = incoming.profileDetails;
702
+ const equals_profileDetails_items = equalsArray(existing_profileDetails, incoming_profileDetails, (existing_profileDetails_item, incoming_profileDetails_item) => {
703
+ if (!(equals$f(existing_profileDetails_item, incoming_profileDetails_item))) {
704
+ return false;
705
+ }
706
+ });
707
+ if (equals_profileDetails_items === false) {
708
+ return false;
709
+ }
710
+ const existing_status = existing.status;
711
+ const incoming_status = incoming.status;
712
+ if (!(equals$e(existing_status, incoming_status))) {
713
+ return false;
714
+ }
715
+ return true;
716
+ }
717
+ const ingest$5 = function UserProfileOutputRepresentationIngest(input, path, luvio, store, timestamp) {
718
+ if (process.env.NODE_ENV !== 'production') {
719
+ const validateError = validate$f(input);
720
+ if (validateError !== null) {
721
+ throw validateError;
722
+ }
723
+ }
724
+ const key = keyBuilderFromType$2(luvio, input);
725
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
726
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "Service-employee", VERSION$d, RepresentationType$5, equals$d);
727
+ return createLink(key);
728
+ };
729
+ function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
730
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
731
+ const rootKey = keyBuilderFromType$2(luvio, input);
732
+ rootKeySet.set(rootKey, {
733
+ namespace: keyPrefix,
734
+ representationName: RepresentationType$5,
735
+ mergeable: false
736
+ });
737
+ }
738
+
739
+ function select$i(luvio, params) {
740
+ return select$j();
741
+ }
742
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
743
+ getTypeCacheKeys$5(storeKeyMap, luvio, response);
744
+ }
745
+ function ingestSuccess$5(luvio, resourceParams, response) {
746
+ const { body } = response;
747
+ const key = keyBuilderFromType$2(luvio, body);
748
+ luvio.storeIngest(key, ingest$5, body);
749
+ const snapshot = luvio.storeLookup({
750
+ recordId: key,
751
+ node: select$i(),
752
+ variables: {},
753
+ });
754
+ if (process.env.NODE_ENV !== 'production') {
755
+ if (snapshot.state !== 'Fulfilled') {
756
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
757
+ }
758
+ }
759
+ deepFreeze(snapshot.data);
760
+ return snapshot;
761
+ }
762
+ function createResourceRequest$5(config) {
763
+ const headers = {};
764
+ return {
765
+ baseUri: '/services/data/v66.0',
766
+ basePath: '/connect/employee-hub/profile/user/' + config.urlParams.userId + '',
767
+ method: 'post',
768
+ body: config.body,
769
+ urlParams: config.urlParams,
770
+ queryParams: {},
771
+ headers,
772
+ priority: 'normal',
773
+ };
774
+ }
775
+
776
+ const adapterName$5 = 'getUserProfileDetails';
777
+ const getUserProfileDetails_ConfigPropertyMetadata = [
778
+ generateParamConfigMetadata('userId', true, 0 /* UrlParameter */, 0 /* String */),
779
+ generateParamConfigMetadata('userProfileEntity', true, 2 /* Body */, 4 /* Unsupported */, true),
780
+ ];
781
+ const getUserProfileDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getUserProfileDetails_ConfigPropertyMetadata);
782
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(getUserProfileDetails_ConfigPropertyMetadata);
783
+ function typeCheckConfig$5(untrustedConfig) {
784
+ const config = {};
785
+ typeCheckConfig$7(untrustedConfig, config, getUserProfileDetails_ConfigPropertyMetadata);
786
+ const untrustedConfig_userProfileEntity = untrustedConfig.userProfileEntity;
787
+ if (ArrayIsArray$1(untrustedConfig_userProfileEntity)) {
788
+ const untrustedConfig_userProfileEntity_array = [];
789
+ for (let i = 0, arrayLength = untrustedConfig_userProfileEntity.length; i < arrayLength; i++) {
790
+ const untrustedConfig_userProfileEntity_item = untrustedConfig_userProfileEntity[i];
791
+ untrustedConfig_userProfileEntity_array.push(untrustedConfig_userProfileEntity_item);
792
+ }
793
+ config.userProfileEntity = untrustedConfig_userProfileEntity_array;
794
+ }
795
+ return config;
796
+ }
797
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
798
+ if (!untrustedIsObject(untrustedConfig)) {
799
+ return null;
800
+ }
801
+ if (process.env.NODE_ENV !== 'production') {
802
+ validateConfig(untrustedConfig, configPropertyNames);
803
+ }
804
+ const config = typeCheckConfig$5(untrustedConfig);
805
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
806
+ return null;
807
+ }
808
+ return config;
809
+ }
810
+ function buildNetworkSnapshot$5(luvio, config, options) {
811
+ const resourceParams = createResourceParams$5(config);
812
+ const request = createResourceRequest$5(resourceParams);
813
+ return luvio.dispatchResourceRequest(request, options)
814
+ .then((response) => {
815
+ return luvio.handleSuccessResponse(() => {
816
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response);
817
+ return luvio.storeBroadcast().then(() => snapshot);
818
+ }, () => {
819
+ const cache = new StoreKeyMap();
820
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
821
+ return cache;
822
+ });
823
+ }, (response) => {
824
+ deepFreeze(response);
825
+ throw response;
826
+ });
827
+ }
828
+ const getUserProfileDetailsAdapterFactory = (luvio) => {
829
+ return function getUserProfileDetails(untrustedConfig) {
830
+ const config = validateAdapterConfig$5(untrustedConfig, getUserProfileDetails_ConfigPropertyNames);
831
+ // Invalid or incomplete config
832
+ if (config === null) {
833
+ throw new Error('Invalid config for "getUserProfileDetails"');
834
+ }
835
+ return buildNetworkSnapshot$5(luvio, config);
836
+ };
837
+ };
838
+
839
+ const VERSION$c = "35737cd6e1b361c1180c9e0b05e133bb";
840
+ function validate$e(obj, path = 'ProgramPersonaOutputRepresentation') {
841
+ const v_error = (() => {
842
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
843
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
844
+ }
845
+ const obj_name = obj.name;
846
+ const path_name = path + '.name';
847
+ let obj_name_union0 = null;
848
+ const obj_name_union0_error = (() => {
849
+ if (typeof obj_name !== 'string') {
850
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
851
+ }
852
+ })();
853
+ if (obj_name_union0_error != null) {
854
+ obj_name_union0 = obj_name_union0_error.message;
855
+ }
856
+ let obj_name_union1 = null;
857
+ const obj_name_union1_error = (() => {
858
+ if (obj_name !== null) {
859
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
860
+ }
861
+ })();
862
+ if (obj_name_union1_error != null) {
863
+ obj_name_union1 = obj_name_union1_error.message;
864
+ }
865
+ if (obj_name_union0 && obj_name_union1) {
866
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
867
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
868
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
869
+ return new TypeError(message);
870
+ }
871
+ const obj_persona = obj.persona;
872
+ const path_persona = path + '.persona';
873
+ let obj_persona_union0 = null;
874
+ const obj_persona_union0_error = (() => {
875
+ if (typeof obj_persona !== 'string') {
876
+ return new TypeError('Expected "string" but received "' + typeof obj_persona + '" (at "' + path_persona + '")');
877
+ }
878
+ })();
879
+ if (obj_persona_union0_error != null) {
880
+ obj_persona_union0 = obj_persona_union0_error.message;
881
+ }
882
+ let obj_persona_union1 = null;
883
+ const obj_persona_union1_error = (() => {
884
+ if (obj_persona !== null) {
885
+ return new TypeError('Expected "null" but received "' + typeof obj_persona + '" (at "' + path_persona + '")');
886
+ }
887
+ })();
888
+ if (obj_persona_union1_error != null) {
889
+ obj_persona_union1 = obj_persona_union1_error.message;
890
+ }
891
+ if (obj_persona_union0 && obj_persona_union1) {
892
+ let message = 'Object doesn\'t match union (at "' + path_persona + '")';
893
+ message += '\n' + obj_persona_union0.split('\n').map((line) => '\t' + line).join('\n');
894
+ message += '\n' + obj_persona_union1.split('\n').map((line) => '\t' + line).join('\n');
895
+ return new TypeError(message);
896
+ }
897
+ const obj_userId = obj.userId;
898
+ const path_userId = path + '.userId';
899
+ let obj_userId_union0 = null;
900
+ const obj_userId_union0_error = (() => {
901
+ if (typeof obj_userId !== 'string') {
902
+ return new TypeError('Expected "string" but received "' + typeof obj_userId + '" (at "' + path_userId + '")');
903
+ }
904
+ })();
905
+ if (obj_userId_union0_error != null) {
906
+ obj_userId_union0 = obj_userId_union0_error.message;
907
+ }
908
+ let obj_userId_union1 = null;
909
+ const obj_userId_union1_error = (() => {
910
+ if (obj_userId !== null) {
911
+ return new TypeError('Expected "null" but received "' + typeof obj_userId + '" (at "' + path_userId + '")');
912
+ }
913
+ })();
914
+ if (obj_userId_union1_error != null) {
915
+ obj_userId_union1 = obj_userId_union1_error.message;
916
+ }
917
+ if (obj_userId_union0 && obj_userId_union1) {
918
+ let message = 'Object doesn\'t match union (at "' + path_userId + '")';
919
+ message += '\n' + obj_userId_union0.split('\n').map((line) => '\t' + line).join('\n');
920
+ message += '\n' + obj_userId_union1.split('\n').map((line) => '\t' + line).join('\n');
921
+ return new TypeError(message);
922
+ }
923
+ })();
924
+ return v_error === undefined ? null : v_error;
925
+ }
926
+ const select$h = function ProgramPersonaOutputRepresentationSelect() {
927
+ return {
928
+ kind: 'Fragment',
929
+ version: VERSION$c,
930
+ private: [],
931
+ selections: [
932
+ {
933
+ name: 'name',
934
+ kind: 'Scalar'
935
+ },
936
+ {
937
+ name: 'persona',
938
+ kind: 'Scalar'
939
+ },
940
+ {
941
+ name: 'userId',
942
+ kind: 'Scalar'
943
+ }
944
+ ]
945
+ };
946
+ };
947
+ function equals$c(existing, incoming) {
948
+ const existing_name = existing.name;
949
+ const incoming_name = incoming.name;
950
+ if (!(existing_name === incoming_name)) {
951
+ return false;
952
+ }
953
+ const existing_persona = existing.persona;
954
+ const incoming_persona = incoming.persona;
955
+ if (!(existing_persona === incoming_persona)) {
956
+ return false;
957
+ }
958
+ const existing_userId = existing.userId;
959
+ const incoming_userId = incoming.userId;
960
+ if (!(existing_userId === incoming_userId)) {
961
+ return false;
962
+ }
963
+ return true;
964
+ }
965
+
966
+ const VERSION$b = "8a75f68ee07acfb4ce6ad72e84360b33";
967
+ function validate$d(obj, path = 'EnablementProgramOutputRepresentation') {
968
+ const v_error = (() => {
969
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
970
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
971
+ }
972
+ const obj_assigneeId = obj.assigneeId;
973
+ const path_assigneeId = path + '.assigneeId';
974
+ let obj_assigneeId_union0 = null;
975
+ const obj_assigneeId_union0_error = (() => {
976
+ if (typeof obj_assigneeId !== 'string') {
977
+ return new TypeError('Expected "string" but received "' + typeof obj_assigneeId + '" (at "' + path_assigneeId + '")');
978
+ }
979
+ })();
980
+ if (obj_assigneeId_union0_error != null) {
981
+ obj_assigneeId_union0 = obj_assigneeId_union0_error.message;
982
+ }
983
+ let obj_assigneeId_union1 = null;
984
+ const obj_assigneeId_union1_error = (() => {
985
+ if (obj_assigneeId !== null) {
986
+ return new TypeError('Expected "null" but received "' + typeof obj_assigneeId + '" (at "' + path_assigneeId + '")');
987
+ }
988
+ })();
989
+ if (obj_assigneeId_union1_error != null) {
990
+ obj_assigneeId_union1 = obj_assigneeId_union1_error.message;
991
+ }
992
+ if (obj_assigneeId_union0 && obj_assigneeId_union1) {
993
+ let message = 'Object doesn\'t match union (at "' + path_assigneeId + '")';
994
+ message += '\n' + obj_assigneeId_union0.split('\n').map((line) => '\t' + line).join('\n');
995
+ message += '\n' + obj_assigneeId_union1.split('\n').map((line) => '\t' + line).join('\n');
996
+ return new TypeError(message);
997
+ }
998
+ const obj_collaboratorPersona = obj.collaboratorPersona;
999
+ const path_collaboratorPersona = path + '.collaboratorPersona';
1000
+ let obj_collaboratorPersona_union0 = null;
1001
+ const obj_collaboratorPersona_union0_error = (() => {
1002
+ const referencepath_collaboratorPersonaValidationError = validate$e(obj_collaboratorPersona, path_collaboratorPersona);
1003
+ if (referencepath_collaboratorPersonaValidationError !== null) {
1004
+ let message = 'Object doesn\'t match ProgramPersonaOutputRepresentation (at "' + path_collaboratorPersona + '")\n';
1005
+ message += referencepath_collaboratorPersonaValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1006
+ return new TypeError(message);
1007
+ }
1008
+ })();
1009
+ if (obj_collaboratorPersona_union0_error != null) {
1010
+ obj_collaboratorPersona_union0 = obj_collaboratorPersona_union0_error.message;
1011
+ }
1012
+ let obj_collaboratorPersona_union1 = null;
1013
+ const obj_collaboratorPersona_union1_error = (() => {
1014
+ if (obj_collaboratorPersona !== null) {
1015
+ return new TypeError('Expected "null" but received "' + typeof obj_collaboratorPersona + '" (at "' + path_collaboratorPersona + '")');
1016
+ }
1017
+ })();
1018
+ if (obj_collaboratorPersona_union1_error != null) {
1019
+ obj_collaboratorPersona_union1 = obj_collaboratorPersona_union1_error.message;
1020
+ }
1021
+ if (obj_collaboratorPersona_union0 && obj_collaboratorPersona_union1) {
1022
+ let message = 'Object doesn\'t match union (at "' + path_collaboratorPersona + '")';
1023
+ message += '\n' + obj_collaboratorPersona_union0.split('\n').map((line) => '\t' + line).join('\n');
1024
+ message += '\n' + obj_collaboratorPersona_union1.split('\n').map((line) => '\t' + line).join('\n');
1025
+ return new TypeError(message);
1026
+ }
1027
+ const obj_completedDate = obj.completedDate;
1028
+ const path_completedDate = path + '.completedDate';
1029
+ let obj_completedDate_union0 = null;
1030
+ const obj_completedDate_union0_error = (() => {
1031
+ if (typeof obj_completedDate !== 'string') {
1032
+ return new TypeError('Expected "string" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
1033
+ }
1034
+ })();
1035
+ if (obj_completedDate_union0_error != null) {
1036
+ obj_completedDate_union0 = obj_completedDate_union0_error.message;
1037
+ }
1038
+ let obj_completedDate_union1 = null;
1039
+ const obj_completedDate_union1_error = (() => {
1040
+ if (obj_completedDate !== null) {
1041
+ return new TypeError('Expected "null" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
1042
+ }
1043
+ })();
1044
+ if (obj_completedDate_union1_error != null) {
1045
+ obj_completedDate_union1 = obj_completedDate_union1_error.message;
1046
+ }
1047
+ if (obj_completedDate_union0 && obj_completedDate_union1) {
1048
+ let message = 'Object doesn\'t match union (at "' + path_completedDate + '")';
1049
+ message += '\n' + obj_completedDate_union0.split('\n').map((line) => '\t' + line).join('\n');
1050
+ message += '\n' + obj_completedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
1051
+ return new TypeError(message);
1052
+ }
1053
+ obj.completedPercent;
1054
+ const obj_description = obj.description;
1055
+ const path_description = path + '.description';
1056
+ let obj_description_union0 = null;
1057
+ const obj_description_union0_error = (() => {
1058
+ if (typeof obj_description !== 'string') {
1059
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1060
+ }
1061
+ })();
1062
+ if (obj_description_union0_error != null) {
1063
+ obj_description_union0 = obj_description_union0_error.message;
1064
+ }
1065
+ let obj_description_union1 = null;
1066
+ const obj_description_union1_error = (() => {
1067
+ if (obj_description !== null) {
1068
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1069
+ }
1070
+ })();
1071
+ if (obj_description_union1_error != null) {
1072
+ obj_description_union1 = obj_description_union1_error.message;
1073
+ }
1074
+ if (obj_description_union0 && obj_description_union1) {
1075
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
1076
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
1077
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
1078
+ return new TypeError(message);
1079
+ }
1080
+ const obj_doesAllowSelfEnrollment = obj.doesAllowSelfEnrollment;
1081
+ const path_doesAllowSelfEnrollment = path + '.doesAllowSelfEnrollment';
1082
+ let obj_doesAllowSelfEnrollment_union0 = null;
1083
+ const obj_doesAllowSelfEnrollment_union0_error = (() => {
1084
+ if (typeof obj_doesAllowSelfEnrollment !== 'boolean') {
1085
+ return new TypeError('Expected "boolean" but received "' + typeof obj_doesAllowSelfEnrollment + '" (at "' + path_doesAllowSelfEnrollment + '")');
1086
+ }
1087
+ })();
1088
+ if (obj_doesAllowSelfEnrollment_union0_error != null) {
1089
+ obj_doesAllowSelfEnrollment_union0 = obj_doesAllowSelfEnrollment_union0_error.message;
1090
+ }
1091
+ let obj_doesAllowSelfEnrollment_union1 = null;
1092
+ const obj_doesAllowSelfEnrollment_union1_error = (() => {
1093
+ if (obj_doesAllowSelfEnrollment !== null) {
1094
+ return new TypeError('Expected "null" but received "' + typeof obj_doesAllowSelfEnrollment + '" (at "' + path_doesAllowSelfEnrollment + '")');
1095
+ }
1096
+ })();
1097
+ if (obj_doesAllowSelfEnrollment_union1_error != null) {
1098
+ obj_doesAllowSelfEnrollment_union1 = obj_doesAllowSelfEnrollment_union1_error.message;
1099
+ }
1100
+ if (obj_doesAllowSelfEnrollment_union0 && obj_doesAllowSelfEnrollment_union1) {
1101
+ let message = 'Object doesn\'t match union (at "' + path_doesAllowSelfEnrollment + '")';
1102
+ message += '\n' + obj_doesAllowSelfEnrollment_union0.split('\n').map((line) => '\t' + line).join('\n');
1103
+ message += '\n' + obj_doesAllowSelfEnrollment_union1.split('\n').map((line) => '\t' + line).join('\n');
1104
+ return new TypeError(message);
1105
+ }
1106
+ const obj_dueDate = obj.dueDate;
1107
+ const path_dueDate = path + '.dueDate';
1108
+ let obj_dueDate_union0 = null;
1109
+ const obj_dueDate_union0_error = (() => {
1110
+ if (typeof obj_dueDate !== 'string') {
1111
+ return new TypeError('Expected "string" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
1112
+ }
1113
+ })();
1114
+ if (obj_dueDate_union0_error != null) {
1115
+ obj_dueDate_union0 = obj_dueDate_union0_error.message;
1116
+ }
1117
+ let obj_dueDate_union1 = null;
1118
+ const obj_dueDate_union1_error = (() => {
1119
+ if (obj_dueDate !== null) {
1120
+ return new TypeError('Expected "null" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
1121
+ }
1122
+ })();
1123
+ if (obj_dueDate_union1_error != null) {
1124
+ obj_dueDate_union1 = obj_dueDate_union1_error.message;
1125
+ }
1126
+ if (obj_dueDate_union0 && obj_dueDate_union1) {
1127
+ let message = 'Object doesn\'t match union (at "' + path_dueDate + '")';
1128
+ message += '\n' + obj_dueDate_union0.split('\n').map((line) => '\t' + line).join('\n');
1129
+ message += '\n' + obj_dueDate_union1.split('\n').map((line) => '\t' + line).join('\n');
1130
+ return new TypeError(message);
1131
+ }
1132
+ const obj_id = obj.id;
1133
+ const path_id = path + '.id';
1134
+ if (typeof obj_id !== 'string') {
1135
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1136
+ }
1137
+ const obj_isCompleted = obj.isCompleted;
1138
+ const path_isCompleted = path + '.isCompleted';
1139
+ if (typeof obj_isCompleted !== 'boolean') {
1140
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isCompleted + '" (at "' + path_isCompleted + '")');
1141
+ }
1142
+ const obj_isOverdue = obj.isOverdue;
1143
+ const path_isOverdue = path + '.isOverdue';
1144
+ if (typeof obj_isOverdue !== 'boolean') {
1145
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isOverdue + '" (at "' + path_isOverdue + '")');
1146
+ }
1147
+ const obj_items = obj.items;
1148
+ const path_items = path + '.items';
1149
+ if (!ArrayIsArray(obj_items)) {
1150
+ return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
1151
+ }
1152
+ for (let i = 0; i < obj_items.length; i++) {
1153
+ const obj_items_item = obj_items[i];
1154
+ const path_items_item = path_items + '[' + i + ']';
1155
+ if (obj_items_item === undefined) {
1156
+ return new TypeError('Expected "defined" but received "' + typeof obj_items_item + '" (at "' + path_items_item + '")');
1157
+ }
1158
+ }
1159
+ const obj_learningItemId = obj.learningItemId;
1160
+ const path_learningItemId = path + '.learningItemId';
1161
+ let obj_learningItemId_union0 = null;
1162
+ const obj_learningItemId_union0_error = (() => {
1163
+ if (typeof obj_learningItemId !== 'string') {
1164
+ return new TypeError('Expected "string" but received "' + typeof obj_learningItemId + '" (at "' + path_learningItemId + '")');
1165
+ }
1166
+ })();
1167
+ if (obj_learningItemId_union0_error != null) {
1168
+ obj_learningItemId_union0 = obj_learningItemId_union0_error.message;
1169
+ }
1170
+ let obj_learningItemId_union1 = null;
1171
+ const obj_learningItemId_union1_error = (() => {
1172
+ if (obj_learningItemId !== null) {
1173
+ return new TypeError('Expected "null" but received "' + typeof obj_learningItemId + '" (at "' + path_learningItemId + '")');
1174
+ }
1175
+ })();
1176
+ if (obj_learningItemId_union1_error != null) {
1177
+ obj_learningItemId_union1 = obj_learningItemId_union1_error.message;
1178
+ }
1179
+ if (obj_learningItemId_union0 && obj_learningItemId_union1) {
1180
+ let message = 'Object doesn\'t match union (at "' + path_learningItemId + '")';
1181
+ message += '\n' + obj_learningItemId_union0.split('\n').map((line) => '\t' + line).join('\n');
1182
+ message += '\n' + obj_learningItemId_union1.split('\n').map((line) => '\t' + line).join('\n');
1183
+ return new TypeError(message);
1184
+ }
1185
+ const obj_networkId = obj.networkId;
1186
+ const path_networkId = path + '.networkId';
1187
+ let obj_networkId_union0 = null;
1188
+ const obj_networkId_union0_error = (() => {
1189
+ if (typeof obj_networkId !== 'string') {
1190
+ return new TypeError('Expected "string" but received "' + typeof obj_networkId + '" (at "' + path_networkId + '")');
1191
+ }
1192
+ })();
1193
+ if (obj_networkId_union0_error != null) {
1194
+ obj_networkId_union0 = obj_networkId_union0_error.message;
1195
+ }
1196
+ let obj_networkId_union1 = null;
1197
+ const obj_networkId_union1_error = (() => {
1198
+ if (obj_networkId !== null) {
1199
+ return new TypeError('Expected "null" but received "' + typeof obj_networkId + '" (at "' + path_networkId + '")');
1200
+ }
1201
+ })();
1202
+ if (obj_networkId_union1_error != null) {
1203
+ obj_networkId_union1 = obj_networkId_union1_error.message;
1204
+ }
1205
+ if (obj_networkId_union0 && obj_networkId_union1) {
1206
+ let message = 'Object doesn\'t match union (at "' + path_networkId + '")';
1207
+ message += '\n' + obj_networkId_union0.split('\n').map((line) => '\t' + line).join('\n');
1208
+ message += '\n' + obj_networkId_union1.split('\n').map((line) => '\t' + line).join('\n');
1209
+ return new TypeError(message);
1210
+ }
1211
+ const obj_programEnrollmentType = obj.programEnrollmentType;
1212
+ const path_programEnrollmentType = path + '.programEnrollmentType';
1213
+ let obj_programEnrollmentType_union0 = null;
1214
+ const obj_programEnrollmentType_union0_error = (() => {
1215
+ if (typeof obj_programEnrollmentType !== 'string') {
1216
+ return new TypeError('Expected "string" but received "' + typeof obj_programEnrollmentType + '" (at "' + path_programEnrollmentType + '")');
1217
+ }
1218
+ })();
1219
+ if (obj_programEnrollmentType_union0_error != null) {
1220
+ obj_programEnrollmentType_union0 = obj_programEnrollmentType_union0_error.message;
1221
+ }
1222
+ let obj_programEnrollmentType_union1 = null;
1223
+ const obj_programEnrollmentType_union1_error = (() => {
1224
+ if (obj_programEnrollmentType !== null) {
1225
+ return new TypeError('Expected "null" but received "' + typeof obj_programEnrollmentType + '" (at "' + path_programEnrollmentType + '")');
1226
+ }
1227
+ })();
1228
+ if (obj_programEnrollmentType_union1_error != null) {
1229
+ obj_programEnrollmentType_union1 = obj_programEnrollmentType_union1_error.message;
1230
+ }
1231
+ if (obj_programEnrollmentType_union0 && obj_programEnrollmentType_union1) {
1232
+ let message = 'Object doesn\'t match union (at "' + path_programEnrollmentType + '")';
1233
+ message += '\n' + obj_programEnrollmentType_union0.split('\n').map((line) => '\t' + line).join('\n');
1234
+ message += '\n' + obj_programEnrollmentType_union1.split('\n').map((line) => '\t' + line).join('\n');
1235
+ return new TypeError(message);
1236
+ }
1237
+ const obj_programOverAllStatus = obj.programOverAllStatus;
1238
+ const path_programOverAllStatus = path + '.programOverAllStatus';
1239
+ let obj_programOverAllStatus_union0 = null;
1240
+ const obj_programOverAllStatus_union0_error = (() => {
1241
+ if (typeof obj_programOverAllStatus !== 'string') {
1242
+ return new TypeError('Expected "string" but received "' + typeof obj_programOverAllStatus + '" (at "' + path_programOverAllStatus + '")');
1243
+ }
1244
+ })();
1245
+ if (obj_programOverAllStatus_union0_error != null) {
1246
+ obj_programOverAllStatus_union0 = obj_programOverAllStatus_union0_error.message;
1247
+ }
1248
+ let obj_programOverAllStatus_union1 = null;
1249
+ const obj_programOverAllStatus_union1_error = (() => {
1250
+ if (obj_programOverAllStatus !== null) {
1251
+ return new TypeError('Expected "null" but received "' + typeof obj_programOverAllStatus + '" (at "' + path_programOverAllStatus + '")');
1252
+ }
1253
+ })();
1254
+ if (obj_programOverAllStatus_union1_error != null) {
1255
+ obj_programOverAllStatus_union1 = obj_programOverAllStatus_union1_error.message;
1256
+ }
1257
+ if (obj_programOverAllStatus_union0 && obj_programOverAllStatus_union1) {
1258
+ let message = 'Object doesn\'t match union (at "' + path_programOverAllStatus + '")';
1259
+ message += '\n' + obj_programOverAllStatus_union0.split('\n').map((line) => '\t' + line).join('\n');
1260
+ message += '\n' + obj_programOverAllStatus_union1.split('\n').map((line) => '\t' + line).join('\n');
1261
+ return new TypeError(message);
1262
+ }
1263
+ const obj_programType = obj.programType;
1264
+ const path_programType = path + '.programType';
1265
+ if (typeof obj_programType !== 'string') {
1266
+ return new TypeError('Expected "string" but received "' + typeof obj_programType + '" (at "' + path_programType + '")');
1267
+ }
1268
+ const obj_status = obj.status;
1269
+ const path_status = path + '.status';
1270
+ if (typeof obj_status !== 'string') {
1271
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1272
+ }
1273
+ const obj_systemModstamp = obj.systemModstamp;
1274
+ const path_systemModstamp = path + '.systemModstamp';
1275
+ let obj_systemModstamp_union0 = null;
1276
+ const obj_systemModstamp_union0_error = (() => {
1277
+ if (typeof obj_systemModstamp !== 'string') {
1278
+ return new TypeError('Expected "string" but received "' + typeof obj_systemModstamp + '" (at "' + path_systemModstamp + '")');
1279
+ }
1280
+ })();
1281
+ if (obj_systemModstamp_union0_error != null) {
1282
+ obj_systemModstamp_union0 = obj_systemModstamp_union0_error.message;
1283
+ }
1284
+ let obj_systemModstamp_union1 = null;
1285
+ const obj_systemModstamp_union1_error = (() => {
1286
+ if (obj_systemModstamp !== null) {
1287
+ return new TypeError('Expected "null" but received "' + typeof obj_systemModstamp + '" (at "' + path_systemModstamp + '")');
1288
+ }
1289
+ })();
1290
+ if (obj_systemModstamp_union1_error != null) {
1291
+ obj_systemModstamp_union1 = obj_systemModstamp_union1_error.message;
1292
+ }
1293
+ if (obj_systemModstamp_union0 && obj_systemModstamp_union1) {
1294
+ let message = 'Object doesn\'t match union (at "' + path_systemModstamp + '")';
1295
+ message += '\n' + obj_systemModstamp_union0.split('\n').map((line) => '\t' + line).join('\n');
1296
+ message += '\n' + obj_systemModstamp_union1.split('\n').map((line) => '\t' + line).join('\n');
1297
+ return new TypeError(message);
1298
+ }
1299
+ const obj_title = obj.title;
1300
+ const path_title = path + '.title';
1301
+ let obj_title_union0 = null;
1302
+ const obj_title_union0_error = (() => {
1303
+ if (typeof obj_title !== 'string') {
1304
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1305
+ }
1306
+ })();
1307
+ if (obj_title_union0_error != null) {
1308
+ obj_title_union0 = obj_title_union0_error.message;
1309
+ }
1310
+ let obj_title_union1 = null;
1311
+ const obj_title_union1_error = (() => {
1312
+ if (obj_title !== null) {
1313
+ return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1314
+ }
1315
+ })();
1316
+ if (obj_title_union1_error != null) {
1317
+ obj_title_union1 = obj_title_union1_error.message;
1318
+ }
1319
+ if (obj_title_union0 && obj_title_union1) {
1320
+ let message = 'Object doesn\'t match union (at "' + path_title + '")';
1321
+ message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
1322
+ message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
1323
+ return new TypeError(message);
1324
+ }
1325
+ })();
1326
+ return v_error === undefined ? null : v_error;
1327
+ }
1328
+ const select$g = function EnablementProgramOutputRepresentationSelect() {
1329
+ const { selections: ProgramPersonaOutputRepresentation__selections, opaque: ProgramPersonaOutputRepresentation__opaque, } = select$h();
1330
+ return {
1331
+ kind: 'Fragment',
1332
+ version: VERSION$b,
1333
+ private: [],
1334
+ selections: [
1335
+ {
1336
+ name: 'assigneeId',
1337
+ kind: 'Scalar'
1338
+ },
1339
+ {
1340
+ name: 'collaboratorPersona',
1341
+ kind: 'Object',
1342
+ nullable: true,
1343
+ selections: ProgramPersonaOutputRepresentation__selections
1344
+ },
1345
+ {
1346
+ name: 'completedDate',
1347
+ kind: 'Scalar'
1348
+ },
1349
+ {
1350
+ name: 'completedPercent',
1351
+ kind: 'Scalar'
1352
+ },
1353
+ {
1354
+ name: 'description',
1355
+ kind: 'Scalar'
1356
+ },
1357
+ {
1358
+ name: 'doesAllowSelfEnrollment',
1359
+ kind: 'Scalar'
1360
+ },
1361
+ {
1362
+ name: 'dueDate',
1363
+ kind: 'Scalar'
1364
+ },
1365
+ {
1366
+ name: 'id',
1367
+ kind: 'Scalar'
1368
+ },
1369
+ {
1370
+ name: 'isCompleted',
1371
+ kind: 'Scalar'
1372
+ },
1373
+ {
1374
+ name: 'isOverdue',
1375
+ kind: 'Scalar'
1376
+ },
1377
+ {
1378
+ name: 'items',
1379
+ kind: 'Object',
1380
+ // any
1381
+ },
1382
+ {
1383
+ name: 'learningItemId',
1384
+ kind: 'Scalar'
1385
+ },
1386
+ {
1387
+ name: 'networkId',
1388
+ kind: 'Scalar'
1389
+ },
1390
+ {
1391
+ name: 'programEnrollmentType',
1392
+ kind: 'Scalar'
1393
+ },
1394
+ {
1395
+ name: 'programOverAllStatus',
1396
+ kind: 'Scalar'
1397
+ },
1398
+ {
1399
+ name: 'programType',
1400
+ kind: 'Scalar'
1401
+ },
1402
+ {
1403
+ name: 'status',
1404
+ kind: 'Scalar'
1405
+ },
1406
+ {
1407
+ name: 'systemModstamp',
1408
+ kind: 'Scalar'
1409
+ },
1410
+ {
1411
+ name: 'title',
1412
+ kind: 'Scalar'
1413
+ }
1414
+ ]
1415
+ };
1416
+ };
1417
+ function equals$b(existing, incoming) {
1418
+ const existing_isCompleted = existing.isCompleted;
1419
+ const incoming_isCompleted = incoming.isCompleted;
1420
+ if (!(existing_isCompleted === incoming_isCompleted)) {
1421
+ return false;
1422
+ }
1423
+ const existing_isOverdue = existing.isOverdue;
1424
+ const incoming_isOverdue = incoming.isOverdue;
1425
+ if (!(existing_isOverdue === incoming_isOverdue)) {
1426
+ return false;
1427
+ }
1428
+ const existing_id = existing.id;
1429
+ const incoming_id = incoming.id;
1430
+ if (!(existing_id === incoming_id)) {
1431
+ return false;
1432
+ }
1433
+ const existing_programType = existing.programType;
1434
+ const incoming_programType = incoming.programType;
1435
+ if (!(existing_programType === incoming_programType)) {
1436
+ return false;
1437
+ }
1438
+ const existing_status = existing.status;
1439
+ const incoming_status = incoming.status;
1440
+ if (!(existing_status === incoming_status)) {
1441
+ return false;
1442
+ }
1443
+ const existing_completedPercent = existing.completedPercent;
1444
+ const incoming_completedPercent = incoming.completedPercent;
1445
+ if (!(existing_completedPercent === incoming_completedPercent)) {
1446
+ return false;
1447
+ }
1448
+ const existing_assigneeId = existing.assigneeId;
1449
+ const incoming_assigneeId = incoming.assigneeId;
1450
+ if (!(existing_assigneeId === incoming_assigneeId)) {
1451
+ return false;
1452
+ }
1453
+ const existing_collaboratorPersona = existing.collaboratorPersona;
1454
+ const incoming_collaboratorPersona = incoming.collaboratorPersona;
1455
+ if (!(existing_collaboratorPersona === incoming_collaboratorPersona
1456
+ || (existing_collaboratorPersona != null &&
1457
+ incoming_collaboratorPersona != null &&
1458
+ equals$c(existing_collaboratorPersona, incoming_collaboratorPersona)))) {
1459
+ return false;
1460
+ }
1461
+ const existing_completedDate = existing.completedDate;
1462
+ const incoming_completedDate = incoming.completedDate;
1463
+ if (!(existing_completedDate === incoming_completedDate)) {
1464
+ return false;
1465
+ }
1466
+ const existing_description = existing.description;
1467
+ const incoming_description = incoming.description;
1468
+ if (!(existing_description === incoming_description)) {
1469
+ return false;
1470
+ }
1471
+ const existing_doesAllowSelfEnrollment = existing.doesAllowSelfEnrollment;
1472
+ const incoming_doesAllowSelfEnrollment = incoming.doesAllowSelfEnrollment;
1473
+ if (!(existing_doesAllowSelfEnrollment === incoming_doesAllowSelfEnrollment)) {
1474
+ return false;
1475
+ }
1476
+ const existing_dueDate = existing.dueDate;
1477
+ const incoming_dueDate = incoming.dueDate;
1478
+ if (!(existing_dueDate === incoming_dueDate)) {
1479
+ return false;
1480
+ }
1481
+ const existing_items = existing.items;
1482
+ const incoming_items = incoming.items;
1483
+ const equals_items_items = equalsArray(existing_items, incoming_items, (existing_items_item, incoming_items_item) => {
1484
+ if (JSONStringify(incoming_items_item) !== JSONStringify(existing_items_item)) {
1485
+ return false;
1486
+ }
1487
+ });
1488
+ if (equals_items_items === false) {
1489
+ return false;
1490
+ }
1491
+ const existing_learningItemId = existing.learningItemId;
1492
+ const incoming_learningItemId = incoming.learningItemId;
1493
+ if (!(existing_learningItemId === incoming_learningItemId)) {
1494
+ return false;
1495
+ }
1496
+ const existing_networkId = existing.networkId;
1497
+ const incoming_networkId = incoming.networkId;
1498
+ if (!(existing_networkId === incoming_networkId)) {
1499
+ return false;
1500
+ }
1501
+ const existing_programEnrollmentType = existing.programEnrollmentType;
1502
+ const incoming_programEnrollmentType = incoming.programEnrollmentType;
1503
+ if (!(existing_programEnrollmentType === incoming_programEnrollmentType)) {
1504
+ return false;
1505
+ }
1506
+ const existing_programOverAllStatus = existing.programOverAllStatus;
1507
+ const incoming_programOverAllStatus = incoming.programOverAllStatus;
1508
+ if (!(existing_programOverAllStatus === incoming_programOverAllStatus)) {
1509
+ return false;
1510
+ }
1511
+ const existing_systemModstamp = existing.systemModstamp;
1512
+ const incoming_systemModstamp = incoming.systemModstamp;
1513
+ if (!(existing_systemModstamp === incoming_systemModstamp)) {
1514
+ return false;
1515
+ }
1516
+ const existing_title = existing.title;
1517
+ const incoming_title = incoming.title;
1518
+ if (!(existing_title === incoming_title)) {
1519
+ return false;
1520
+ }
1521
+ return true;
1522
+ }
1523
+
1524
+ const VERSION$a = "3bb00d251238ad9e80923d31769684e6";
1525
+ function validate$c(obj, path = 'EnablementProgramListStatusOutputRepresentation') {
1526
+ const v_error = (() => {
1527
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1528
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1529
+ }
1530
+ const obj_code = obj.code;
1531
+ const path_code = path + '.code';
1532
+ if (typeof obj_code !== 'number' || (typeof obj_code === 'number' && Math.floor(obj_code) !== obj_code)) {
1533
+ return new TypeError('Expected "integer" but received "' + typeof obj_code + '" (at "' + path_code + '")');
1534
+ }
1535
+ const obj_message = obj.message;
1536
+ const path_message = path + '.message';
1537
+ if (typeof obj_message !== 'string') {
1538
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
1539
+ }
1540
+ })();
1541
+ return v_error === undefined ? null : v_error;
1542
+ }
1543
+ const select$f = function EnablementProgramListStatusOutputRepresentationSelect() {
1544
+ return {
1545
+ kind: 'Fragment',
1546
+ version: VERSION$a,
1547
+ private: [],
1548
+ selections: [
1549
+ {
1550
+ name: 'code',
1551
+ kind: 'Scalar'
1552
+ },
1553
+ {
1554
+ name: 'message',
1555
+ kind: 'Scalar'
1556
+ }
1557
+ ]
1558
+ };
1559
+ };
1560
+ function equals$a(existing, incoming) {
1561
+ const existing_code = existing.code;
1562
+ const incoming_code = incoming.code;
1563
+ if (!(existing_code === incoming_code)) {
1564
+ return false;
1565
+ }
1566
+ const existing_message = existing.message;
1567
+ const incoming_message = incoming.message;
1568
+ if (!(existing_message === incoming_message)) {
1569
+ return false;
1570
+ }
1571
+ return true;
1572
+ }
1573
+
1574
+ const TTL = 15000;
1575
+ const VERSION$9 = "b0d173b5c36156153eab225104b4ee90";
1576
+ function validate$b(obj, path = 'EnablementProgramListOutputRepresentation') {
1577
+ const v_error = (() => {
1578
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1579
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1580
+ }
1581
+ const obj_hasMore = obj.hasMore;
1582
+ const path_hasMore = path + '.hasMore';
1583
+ if (typeof obj_hasMore !== 'boolean') {
1584
+ return new TypeError('Expected "boolean" but received "' + typeof obj_hasMore + '" (at "' + path_hasMore + '")');
1585
+ }
1586
+ const obj_programSummaryList = obj.programSummaryList;
1587
+ const path_programSummaryList = path + '.programSummaryList';
1588
+ if (!ArrayIsArray(obj_programSummaryList)) {
1589
+ return new TypeError('Expected "array" but received "' + typeof obj_programSummaryList + '" (at "' + path_programSummaryList + '")');
1590
+ }
1591
+ for (let i = 0; i < obj_programSummaryList.length; i++) {
1592
+ const obj_programSummaryList_item = obj_programSummaryList[i];
1593
+ const path_programSummaryList_item = path_programSummaryList + '[' + i + ']';
1594
+ const referencepath_programSummaryList_itemValidationError = validate$d(obj_programSummaryList_item, path_programSummaryList_item);
1595
+ if (referencepath_programSummaryList_itemValidationError !== null) {
1596
+ let message = 'Object doesn\'t match EnablementProgramOutputRepresentation (at "' + path_programSummaryList_item + '")\n';
1597
+ message += referencepath_programSummaryList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1598
+ return new TypeError(message);
1599
+ }
1600
+ }
1601
+ const obj_status = obj.status;
1602
+ const path_status = path + '.status';
1603
+ const referencepath_statusValidationError = validate$c(obj_status, path_status);
1604
+ if (referencepath_statusValidationError !== null) {
1605
+ let message = 'Object doesn\'t match EnablementProgramListStatusOutputRepresentation (at "' + path_status + '")\n';
1606
+ message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1607
+ return new TypeError(message);
1608
+ }
1609
+ })();
1610
+ return v_error === undefined ? null : v_error;
1611
+ }
1612
+ const RepresentationType$4 = 'EnablementProgramListOutputRepresentation';
1613
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
1614
+ return input;
1615
+ }
1616
+ const select$e = function EnablementProgramListOutputRepresentationSelect() {
1617
+ const { selections: EnablementProgramOutputRepresentation__selections, opaque: EnablementProgramOutputRepresentation__opaque, } = select$g();
1618
+ const { selections: EnablementProgramListStatusOutputRepresentation__selections, opaque: EnablementProgramListStatusOutputRepresentation__opaque, } = select$f();
1619
+ return {
1620
+ kind: 'Fragment',
1621
+ version: VERSION$9,
1622
+ private: [],
1623
+ selections: [
1624
+ {
1625
+ name: 'hasMore',
1626
+ kind: 'Scalar'
1627
+ },
1628
+ {
1629
+ name: 'programSummaryList',
1630
+ kind: 'Object',
1631
+ plural: true,
1632
+ selections: EnablementProgramOutputRepresentation__selections
1633
+ },
1634
+ {
1635
+ name: 'status',
1636
+ kind: 'Object',
1637
+ selections: EnablementProgramListStatusOutputRepresentation__selections
1638
+ }
1639
+ ]
1640
+ };
1641
+ };
1642
+ function equals$9(existing, incoming) {
1643
+ const existing_hasMore = existing.hasMore;
1644
+ const incoming_hasMore = incoming.hasMore;
1645
+ if (!(existing_hasMore === incoming_hasMore)) {
1646
+ return false;
1647
+ }
1648
+ const existing_programSummaryList = existing.programSummaryList;
1649
+ const incoming_programSummaryList = incoming.programSummaryList;
1650
+ const equals_programSummaryList_items = equalsArray(existing_programSummaryList, incoming_programSummaryList, (existing_programSummaryList_item, incoming_programSummaryList_item) => {
1651
+ if (!(equals$b(existing_programSummaryList_item, incoming_programSummaryList_item))) {
1652
+ return false;
1653
+ }
1654
+ });
1655
+ if (equals_programSummaryList_items === false) {
1656
+ return false;
1657
+ }
1658
+ const existing_status = existing.status;
1659
+ const incoming_status = incoming.status;
1660
+ if (!(equals$a(existing_status, incoming_status))) {
1661
+ return false;
1662
+ }
1663
+ return true;
1664
+ }
1665
+ const ingest$4 = function EnablementProgramListOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1666
+ if (process.env.NODE_ENV !== 'production') {
1667
+ const validateError = validate$b(input);
1668
+ if (validateError !== null) {
1669
+ throw validateError;
1670
+ }
1671
+ }
1672
+ const key = path.fullPath;
1673
+ const ttlToUse = TTL;
1674
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "Service-employee", VERSION$9, RepresentationType$4, equals$9);
1675
+ return createLink(key);
1676
+ };
1677
+ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
1678
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1679
+ const rootKey = fullPathFactory();
1680
+ rootKeySet.set(rootKey, {
1681
+ namespace: keyPrefix,
1682
+ representationName: RepresentationType$4,
1683
+ mergeable: false
1684
+ });
1685
+ }
1686
+
1687
+ function select$d(luvio, params) {
1688
+ return select$e();
1689
+ }
1690
+ function keyBuilder$7(luvio, params) {
1691
+ return keyPrefix + '::EnablementProgramListOutputRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'statusFilter:' + params.queryParams.statusFilter + ',' + 'userIds:' + params.queryParams.userIds + ')';
1692
+ }
1693
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
1694
+ getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$7(luvio, resourceParams));
1695
+ }
1696
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
1697
+ const { body } = response;
1698
+ const key = keyBuilder$7(luvio, resourceParams);
1699
+ luvio.storeIngest(key, ingest$4, body);
1700
+ const snapshot = luvio.storeLookup({
1701
+ recordId: key,
1702
+ node: select$d(),
1703
+ variables: {},
1704
+ }, snapshotRefresh);
1705
+ if (process.env.NODE_ENV !== 'production') {
1706
+ if (snapshot.state !== 'Fulfilled') {
1707
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1708
+ }
1709
+ }
1710
+ deepFreeze(snapshot.data);
1711
+ return snapshot;
1712
+ }
1713
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
1714
+ const key = keyBuilder$7(luvio, params);
1715
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1716
+ const storeMetadataParams = {
1717
+ ttl: TTL,
1718
+ namespace: keyPrefix,
1719
+ version: VERSION$9,
1720
+ representationName: RepresentationType$4
1721
+ };
1722
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1723
+ return errorSnapshot;
1724
+ }
1725
+ function createResourceRequest$4(config) {
1726
+ const headers = {};
1727
+ return {
1728
+ baseUri: '/services/data/v66.0',
1729
+ basePath: '/connect/employee/enablement/programs',
1730
+ method: 'get',
1731
+ body: null,
1732
+ urlParams: {},
1733
+ queryParams: config.queryParams,
1734
+ headers,
1735
+ priority: 'normal',
1736
+ };
1737
+ }
1738
+
1739
+ const adapterName$4 = 'getEmpEnablementPrograms';
1740
+ const getEmpEnablementPrograms_ConfigPropertyMetadata = [
1741
+ generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
1742
+ generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
1743
+ generateParamConfigMetadata('statusFilter', false, 1 /* QueryParameter */, 0 /* String */, true),
1744
+ generateParamConfigMetadata('userIds', false, 1 /* QueryParameter */, 0 /* String */, true),
1745
+ ];
1746
+ const getEmpEnablementPrograms_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getEmpEnablementPrograms_ConfigPropertyMetadata);
1747
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(getEmpEnablementPrograms_ConfigPropertyMetadata);
1748
+ function keyBuilder$6(luvio, config) {
1749
+ const resourceParams = createResourceParams$4(config);
1750
+ return keyBuilder$7(luvio, resourceParams);
1751
+ }
1752
+ function typeCheckConfig$4(untrustedConfig) {
1753
+ const config = {};
1754
+ typeCheckConfig$7(untrustedConfig, config, getEmpEnablementPrograms_ConfigPropertyMetadata);
1755
+ return config;
1756
+ }
1757
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1758
+ if (!untrustedIsObject(untrustedConfig)) {
1759
+ return null;
1760
+ }
1761
+ if (process.env.NODE_ENV !== 'production') {
1762
+ validateConfig(untrustedConfig, configPropertyNames);
1763
+ }
1764
+ const config = typeCheckConfig$4(untrustedConfig);
1765
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1766
+ return null;
1767
+ }
1768
+ return config;
1769
+ }
1770
+ function adapterFragment$2(luvio, config) {
1771
+ createResourceParams$4(config);
1772
+ return select$d();
1773
+ }
1774
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
1775
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
1776
+ config,
1777
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1778
+ });
1779
+ return luvio.storeBroadcast().then(() => snapshot);
1780
+ }
1781
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
1782
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
1783
+ config,
1784
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1785
+ });
1786
+ return luvio.storeBroadcast().then(() => snapshot);
1787
+ }
1788
+ function buildNetworkSnapshot$4(luvio, config, options) {
1789
+ const resourceParams = createResourceParams$4(config);
1790
+ const request = createResourceRequest$4(resourceParams);
1791
+ return luvio.dispatchResourceRequest(request, options)
1792
+ .then((response) => {
1793
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
1794
+ const cache = new StoreKeyMap();
1795
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
1796
+ return cache;
1797
+ });
1798
+ }, (response) => {
1799
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
1800
+ });
1801
+ }
1802
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
1803
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
1804
+ }
1805
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
1806
+ const { luvio, config } = context;
1807
+ const selector = {
1808
+ recordId: keyBuilder$6(luvio, config),
1809
+ node: adapterFragment$2(luvio, config),
1810
+ variables: {},
1811
+ };
1812
+ const cacheSnapshot = storeLookup(selector, {
1813
+ config,
1814
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1815
+ });
1816
+ return cacheSnapshot;
1817
+ }
1818
+ const getEmpEnablementProgramsAdapterFactory = (luvio) => function serviceEmployee__getEmpEnablementPrograms(untrustedConfig, requestContext) {
1819
+ const config = validateAdapterConfig$4(untrustedConfig, getEmpEnablementPrograms_ConfigPropertyNames);
1820
+ // Invalid or incomplete config
1821
+ if (config === null) {
1822
+ return null;
1823
+ }
1824
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1825
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
1826
+ };
1827
+
1828
+ const VERSION$8 = "3baf9ed6d8cb5f2e9028e80971b68fae";
1829
+ function validate$a(obj, path = 'EmployeeUserProvisioningJobOutputRepresentation') {
1830
+ const v_error = (() => {
1831
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1832
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1833
+ }
1834
+ const obj_provisioningJobId = obj.provisioningJobId;
1835
+ const path_provisioningJobId = path + '.provisioningJobId';
1836
+ if (typeof obj_provisioningJobId !== 'string') {
1837
+ return new TypeError('Expected "string" but received "' + typeof obj_provisioningJobId + '" (at "' + path_provisioningJobId + '")');
1838
+ }
1839
+ })();
1840
+ return v_error === undefined ? null : v_error;
1841
+ }
1842
+ const RepresentationType$3 = 'EmployeeUserProvisioningJobOutputRepresentation';
1843
+ function keyBuilder$5(luvio, config) {
1844
+ return keyPrefix + '::' + RepresentationType$3 + ':' + config.provisioningJobId;
1845
+ }
1846
+ function keyBuilderFromType$1(luvio, object) {
1847
+ const keyParams = {
1848
+ provisioningJobId: object.provisioningJobId
1849
+ };
1850
+ return keyBuilder$5(luvio, keyParams);
1851
+ }
1852
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
1853
+ return input;
1854
+ }
1855
+ const select$c = function EmployeeUserProvisioningJobOutputRepresentationSelect() {
1856
+ return {
1857
+ kind: 'Fragment',
1858
+ version: VERSION$8,
1859
+ private: [],
1860
+ selections: [
1861
+ {
1862
+ name: 'provisioningJobId',
1863
+ kind: 'Scalar'
1864
+ }
1865
+ ]
1866
+ };
1867
+ };
1868
+ function equals$8(existing, incoming) {
1869
+ const existing_provisioningJobId = existing.provisioningJobId;
1870
+ const incoming_provisioningJobId = incoming.provisioningJobId;
1871
+ if (!(existing_provisioningJobId === incoming_provisioningJobId)) {
1872
+ return false;
1873
+ }
1874
+ return true;
1875
+ }
1876
+ const ingest$3 = function EmployeeUserProvisioningJobOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1877
+ if (process.env.NODE_ENV !== 'production') {
1878
+ const validateError = validate$a(input);
1879
+ if (validateError !== null) {
1880
+ throw validateError;
1881
+ }
1882
+ }
1883
+ const key = keyBuilderFromType$1(luvio, input);
1884
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
1885
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "Service-employee", VERSION$8, RepresentationType$3, equals$8);
1886
+ return createLink(key);
1887
+ };
1888
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
1889
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1890
+ const rootKey = keyBuilderFromType$1(luvio, input);
1891
+ rootKeySet.set(rootKey, {
1892
+ namespace: keyPrefix,
1893
+ representationName: RepresentationType$3,
1894
+ mergeable: false
1895
+ });
1896
+ }
1897
+
1898
+ function select$b(luvio, params) {
1899
+ return select$c();
1900
+ }
1901
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1902
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
1903
+ }
1904
+ function ingestSuccess$3(luvio, resourceParams, response) {
1905
+ const { body } = response;
1906
+ const key = keyBuilderFromType$1(luvio, body);
1907
+ luvio.storeIngest(key, ingest$3, body);
1908
+ const snapshot = luvio.storeLookup({
1909
+ recordId: key,
1910
+ node: select$b(),
1911
+ variables: {},
1912
+ });
1913
+ if (process.env.NODE_ENV !== 'production') {
1914
+ if (snapshot.state !== 'Fulfilled') {
1915
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1916
+ }
1917
+ }
1918
+ deepFreeze(snapshot.data);
1919
+ return snapshot;
1920
+ }
1921
+ function createResourceRequest$3(config) {
1922
+ const headers = {};
1923
+ return {
1924
+ baseUri: '/services/data/v66.0',
1925
+ basePath: '/connect/service-employee/employee-user-provisioning',
1926
+ method: 'post',
1927
+ body: config.body,
1928
+ urlParams: {},
1929
+ queryParams: {},
1930
+ headers,
1931
+ priority: 'normal',
1932
+ };
1933
+ }
1934
+
1935
+ const adapterName$3 = 'postEmployeeUserProvisioningJob';
1936
+ const postEmployeeUserProvisioningJob_ConfigPropertyMetadata = [];
1937
+ const postEmployeeUserProvisioningJob_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, postEmployeeUserProvisioningJob_ConfigPropertyMetadata);
1938
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(postEmployeeUserProvisioningJob_ConfigPropertyMetadata);
1939
+ function typeCheckConfig$3(untrustedConfig) {
1940
+ const config = {};
1941
+ return config;
1942
+ }
1943
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1944
+ if (!untrustedIsObject(untrustedConfig)) {
1945
+ return null;
1946
+ }
1947
+ if (process.env.NODE_ENV !== 'production') {
1948
+ validateConfig(untrustedConfig, configPropertyNames);
1949
+ }
1950
+ const config = typeCheckConfig$3();
1951
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1952
+ return null;
1953
+ }
1954
+ return config;
1955
+ }
1956
+ function buildNetworkSnapshot$3(luvio, config, options) {
1957
+ const resourceParams = createResourceParams$3(config);
1958
+ const request = createResourceRequest$3(resourceParams);
1959
+ return luvio.dispatchResourceRequest(request, options)
1960
+ .then((response) => {
1961
+ return luvio.handleSuccessResponse(() => {
1962
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
1963
+ return luvio.storeBroadcast().then(() => snapshot);
1964
+ }, () => {
1965
+ const cache = new StoreKeyMap();
1966
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1967
+ return cache;
1968
+ });
1969
+ }, (response) => {
1970
+ deepFreeze(response);
1971
+ throw response;
1972
+ });
1973
+ }
1974
+ const postEmployeeUserProvisioningJobAdapterFactory = (luvio) => {
1975
+ return function postEmployeeUserProvisioningJob(untrustedConfig) {
1976
+ const config = validateAdapterConfig$3(untrustedConfig, postEmployeeUserProvisioningJob_ConfigPropertyNames);
1977
+ // Invalid or incomplete config
1978
+ if (config === null) {
1979
+ throw new Error('Invalid config for "postEmployeeUserProvisioningJob"');
1980
+ }
1981
+ return buildNetworkSnapshot$3(luvio, config);
1982
+ };
1983
+ };
1984
+
1985
+ const VERSION$7 = "03d457ffd4267a71784b30031263ff9e";
1986
+ function validate$9(obj, path = 'GenericResultRepresentation') {
1987
+ const v_error = (() => {
1988
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1989
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1990
+ }
1991
+ const obj_statusCode = obj.statusCode;
1992
+ const path_statusCode = path + '.statusCode';
1993
+ let obj_statusCode_union0 = null;
1994
+ const obj_statusCode_union0_error = (() => {
1995
+ if (typeof obj_statusCode !== 'string') {
1996
+ return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
1997
+ }
1998
+ })();
1999
+ if (obj_statusCode_union0_error != null) {
2000
+ obj_statusCode_union0 = obj_statusCode_union0_error.message;
2001
+ }
2002
+ let obj_statusCode_union1 = null;
2003
+ const obj_statusCode_union1_error = (() => {
2004
+ if (obj_statusCode !== null) {
2005
+ return new TypeError('Expected "null" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
2006
+ }
2007
+ })();
2008
+ if (obj_statusCode_union1_error != null) {
2009
+ obj_statusCode_union1 = obj_statusCode_union1_error.message;
2010
+ }
2011
+ if (obj_statusCode_union0 && obj_statusCode_union1) {
2012
+ let message = 'Object doesn\'t match union (at "' + path_statusCode + '")';
2013
+ message += '\n' + obj_statusCode_union0.split('\n').map((line) => '\t' + line).join('\n');
2014
+ message += '\n' + obj_statusCode_union1.split('\n').map((line) => '\t' + line).join('\n');
2015
+ return new TypeError(message);
2016
+ }
2017
+ const obj_statusMessage = obj.statusMessage;
2018
+ const path_statusMessage = path + '.statusMessage';
2019
+ let obj_statusMessage_union0 = null;
2020
+ const obj_statusMessage_union0_error = (() => {
2021
+ if (typeof obj_statusMessage !== 'string') {
2022
+ return new TypeError('Expected "string" but received "' + typeof obj_statusMessage + '" (at "' + path_statusMessage + '")');
2023
+ }
2024
+ })();
2025
+ if (obj_statusMessage_union0_error != null) {
2026
+ obj_statusMessage_union0 = obj_statusMessage_union0_error.message;
2027
+ }
2028
+ let obj_statusMessage_union1 = null;
2029
+ const obj_statusMessage_union1_error = (() => {
2030
+ if (obj_statusMessage !== null) {
2031
+ return new TypeError('Expected "null" but received "' + typeof obj_statusMessage + '" (at "' + path_statusMessage + '")');
2032
+ }
2033
+ })();
2034
+ if (obj_statusMessage_union1_error != null) {
2035
+ obj_statusMessage_union1 = obj_statusMessage_union1_error.message;
2036
+ }
2037
+ if (obj_statusMessage_union0 && obj_statusMessage_union1) {
2038
+ let message = 'Object doesn\'t match union (at "' + path_statusMessage + '")';
2039
+ message += '\n' + obj_statusMessage_union0.split('\n').map((line) => '\t' + line).join('\n');
2040
+ message += '\n' + obj_statusMessage_union1.split('\n').map((line) => '\t' + line).join('\n');
2041
+ return new TypeError(message);
2042
+ }
2043
+ })();
2044
+ return v_error === undefined ? null : v_error;
2045
+ }
2046
+ const RepresentationType$2 = 'GenericResultRepresentation';
2047
+ function keyBuilder$4(luvio, config) {
2048
+ return keyPrefix + '::' + RepresentationType$2 + ':' + (config.statusCode === null ? '' : config.statusCode);
2049
+ }
2050
+ function keyBuilderFromType(luvio, object) {
2051
+ const keyParams = {
2052
+ statusCode: object.statusCode
2053
+ };
2054
+ return keyBuilder$4(luvio, keyParams);
2055
+ }
2056
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
2057
+ return input;
2058
+ }
2059
+ const select$a = function GenericResultRepresentationSelect() {
2060
+ return {
2061
+ kind: 'Fragment',
2062
+ version: VERSION$7,
2063
+ private: [],
2064
+ selections: [
2065
+ {
2066
+ name: 'statusCode',
2067
+ kind: 'Scalar'
2068
+ },
2069
+ {
2070
+ name: 'statusMessage',
2071
+ kind: 'Scalar'
2072
+ }
2073
+ ]
2074
+ };
2075
+ };
2076
+ function equals$7(existing, incoming) {
2077
+ const existing_statusCode = existing.statusCode;
2078
+ const incoming_statusCode = incoming.statusCode;
2079
+ if (!(existing_statusCode === incoming_statusCode)) {
2080
+ return false;
2081
+ }
2082
+ const existing_statusMessage = existing.statusMessage;
2083
+ const incoming_statusMessage = incoming.statusMessage;
2084
+ if (!(existing_statusMessage === incoming_statusMessage)) {
2085
+ return false;
2086
+ }
2087
+ return true;
2088
+ }
2089
+ const ingest$2 = function GenericResultRepresentationIngest(input, path, luvio, store, timestamp) {
2090
+ if (process.env.NODE_ENV !== 'production') {
2091
+ const validateError = validate$9(input);
2092
+ if (validateError !== null) {
2093
+ throw validateError;
2094
+ }
2095
+ }
2096
+ const key = keyBuilderFromType(luvio, input);
2097
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
2098
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "Service-employee", VERSION$7, RepresentationType$2, equals$7);
2099
+ return createLink(key);
2100
+ };
2101
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
2102
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2103
+ const rootKey = keyBuilderFromType(luvio, input);
2104
+ rootKeySet.set(rootKey, {
2105
+ namespace: keyPrefix,
2106
+ representationName: RepresentationType$2,
2107
+ mergeable: false
2108
+ });
2109
+ }
2110
+
2111
+ function select$9(luvio, params) {
2112
+ return select$a();
2113
+ }
2114
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
2115
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
2116
+ }
2117
+ function ingestSuccess$2(luvio, resourceParams, response) {
2118
+ const { body } = response;
2119
+ const key = keyBuilderFromType(luvio, body);
2120
+ luvio.storeIngest(key, ingest$2, body);
2121
+ const snapshot = luvio.storeLookup({
2122
+ recordId: key,
2123
+ node: select$9(),
2124
+ variables: {},
2125
+ });
2126
+ if (process.env.NODE_ENV !== 'production') {
2127
+ if (snapshot.state !== 'Fulfilled') {
2128
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2129
+ }
2130
+ }
2131
+ deepFreeze(snapshot.data);
2132
+ return snapshot;
2133
+ }
2134
+ function createResourceRequest$2(config) {
2135
+ const headers = {};
2136
+ return {
2137
+ baseUri: '/services/data/v66.0',
2138
+ basePath: '/connect/service-employee/user-settings',
2139
+ method: 'patch',
2140
+ body: config.body,
2141
+ urlParams: {},
2142
+ queryParams: {},
2143
+ headers,
2144
+ priority: 'normal',
2145
+ };
2146
+ }
2147
+
2148
+ const adapterName$2 = 'updateUserSettings';
2149
+ const updateUserSettings_ConfigPropertyMetadata = [
2150
+ generateParamConfigMetadata('autoCreateFlag', false, 2 /* Body */, 1 /* Boolean */),
2151
+ generateParamConfigMetadata('autoDeactivateFlag', false, 2 /* Body */, 1 /* Boolean */),
2152
+ generateParamConfigMetadata('domain', false, 2 /* Body */, 0 /* String */),
2153
+ generateParamConfigMetadata('emailEncoding', false, 2 /* Body */, 0 /* String */),
2154
+ generateParamConfigMetadata('permissionId', false, 2 /* Body */, 0 /* String */),
2155
+ generateParamConfigMetadata('profileId', false, 2 /* Body */, 0 /* String */),
2156
+ generateParamConfigMetadata('syncEmployee2Users', false, 2 /* Body */, 1 /* Boolean */),
2157
+ generateParamConfigMetadata('employeeStatus', false, 2 /* Body */, 0 /* String */),
2158
+ generateParamConfigMetadata('sourceOfInvocation', false, 2 /* Body */, 0 /* String */),
2159
+ ];
2160
+ const updateUserSettings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, updateUserSettings_ConfigPropertyMetadata);
2161
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(updateUserSettings_ConfigPropertyMetadata);
2162
+ function typeCheckConfig$2(untrustedConfig) {
2163
+ const config = {};
2164
+ typeCheckConfig$7(untrustedConfig, config, updateUserSettings_ConfigPropertyMetadata);
2165
+ return config;
2166
+ }
2167
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
2168
+ if (!untrustedIsObject(untrustedConfig)) {
2169
+ return null;
2170
+ }
2171
+ if (process.env.NODE_ENV !== 'production') {
2172
+ validateConfig(untrustedConfig, configPropertyNames);
2173
+ }
2174
+ const config = typeCheckConfig$2(untrustedConfig);
2175
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2176
+ return null;
2177
+ }
2178
+ return config;
2179
+ }
2180
+ function buildNetworkSnapshot$2(luvio, config, options) {
2181
+ const resourceParams = createResourceParams$2(config);
2182
+ const request = createResourceRequest$2(resourceParams);
2183
+ return luvio.dispatchResourceRequest(request, options)
2184
+ .then((response) => {
2185
+ return luvio.handleSuccessResponse(() => {
2186
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
2187
+ return luvio.storeBroadcast().then(() => snapshot);
2188
+ }, () => {
2189
+ const cache = new StoreKeyMap();
2190
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
2191
+ return cache;
2192
+ });
2193
+ }, (response) => {
2194
+ deepFreeze(response);
2195
+ throw response;
2196
+ });
2197
+ }
2198
+ const updateUserSettingsAdapterFactory = (luvio) => {
2199
+ return function updateUserSettings(untrustedConfig) {
2200
+ const config = validateAdapterConfig$2(untrustedConfig, updateUserSettings_ConfigPropertyNames);
2201
+ // Invalid or incomplete config
2202
+ if (config === null) {
2203
+ throw new Error('Invalid config for "updateUserSettings"');
2204
+ }
2205
+ return buildNetworkSnapshot$2(luvio, config);
2206
+ };
2207
+ };
2208
+
2209
+ const VERSION$6 = "1c67fc20b7f29ba31201342adfd39241";
2210
+ function validate$8(obj, path = 'PermissionDetailsRepresentation') {
2211
+ const v_error = (() => {
2212
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2213
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2214
+ }
2215
+ if (obj.description !== undefined) {
2216
+ const obj_description = obj.description;
2217
+ const path_description = path + '.description';
2218
+ if (typeof obj_description !== 'string') {
2219
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
2220
+ }
2221
+ }
2222
+ if (obj.label !== undefined) {
2223
+ const obj_label = obj.label;
2224
+ const path_label = path + '.label';
2225
+ if (typeof obj_label !== 'string') {
2226
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
2227
+ }
2228
+ }
2229
+ if (obj.permissionId !== undefined) {
2230
+ const obj_permissionId = obj.permissionId;
2231
+ const path_permissionId = path + '.permissionId';
2232
+ if (typeof obj_permissionId !== 'string') {
2233
+ return new TypeError('Expected "string" but received "' + typeof obj_permissionId + '" (at "' + path_permissionId + '")');
2234
+ }
2235
+ }
2236
+ if (obj.permissionName !== undefined) {
2237
+ const obj_permissionName = obj.permissionName;
2238
+ const path_permissionName = path + '.permissionName';
2239
+ if (typeof obj_permissionName !== 'string') {
2240
+ return new TypeError('Expected "string" but received "' + typeof obj_permissionName + '" (at "' + path_permissionName + '")');
2241
+ }
2242
+ }
2243
+ })();
2244
+ return v_error === undefined ? null : v_error;
2245
+ }
2246
+ const select$8 = function PermissionDetailsRepresentationSelect() {
2247
+ return {
2248
+ kind: 'Fragment',
2249
+ version: VERSION$6,
2250
+ private: [],
2251
+ selections: [
2252
+ {
2253
+ name: 'description',
2254
+ kind: 'Scalar',
2255
+ required: false
2256
+ },
2257
+ {
2258
+ name: 'label',
2259
+ kind: 'Scalar',
2260
+ required: false
2261
+ },
2262
+ {
2263
+ name: 'permissionId',
2264
+ kind: 'Scalar',
2265
+ required: false
2266
+ },
2267
+ {
2268
+ name: 'permissionName',
2269
+ kind: 'Scalar',
2270
+ required: false
2271
+ }
2272
+ ]
2273
+ };
2274
+ };
2275
+ function equals$6(existing, incoming) {
2276
+ const existing_description = existing.description;
2277
+ const incoming_description = incoming.description;
2278
+ // if at least one of these optionals is defined
2279
+ if (existing_description !== undefined || incoming_description !== undefined) {
2280
+ // if one of these is not defined we know the other is defined and therefore
2281
+ // not equal
2282
+ if (existing_description === undefined || incoming_description === undefined) {
2283
+ return false;
2284
+ }
2285
+ if (!(existing_description === incoming_description)) {
2286
+ return false;
2287
+ }
2288
+ }
2289
+ const existing_label = existing.label;
2290
+ const incoming_label = incoming.label;
2291
+ // if at least one of these optionals is defined
2292
+ if (existing_label !== undefined || incoming_label !== undefined) {
2293
+ // if one of these is not defined we know the other is defined and therefore
2294
+ // not equal
2295
+ if (existing_label === undefined || incoming_label === undefined) {
2296
+ return false;
2297
+ }
2298
+ if (!(existing_label === incoming_label)) {
2299
+ return false;
2300
+ }
2301
+ }
2302
+ const existing_permissionId = existing.permissionId;
2303
+ const incoming_permissionId = incoming.permissionId;
2304
+ // if at least one of these optionals is defined
2305
+ if (existing_permissionId !== undefined || incoming_permissionId !== undefined) {
2306
+ // if one of these is not defined we know the other is defined and therefore
2307
+ // not equal
2308
+ if (existing_permissionId === undefined || incoming_permissionId === undefined) {
2309
+ return false;
2310
+ }
2311
+ if (!(existing_permissionId === incoming_permissionId)) {
2312
+ return false;
2313
+ }
2314
+ }
2315
+ const existing_permissionName = existing.permissionName;
2316
+ const incoming_permissionName = incoming.permissionName;
2317
+ // if at least one of these optionals is defined
2318
+ if (existing_permissionName !== undefined || incoming_permissionName !== undefined) {
2319
+ // if one of these is not defined we know the other is defined and therefore
2320
+ // not equal
2321
+ if (existing_permissionName === undefined || incoming_permissionName === undefined) {
2322
+ return false;
2323
+ }
2324
+ if (!(existing_permissionName === incoming_permissionName)) {
2325
+ return false;
2326
+ }
2327
+ }
2328
+ return true;
2329
+ }
2330
+
2331
+ const VERSION$5 = "2ec510f8b59acca487c03411f66bdee0";
2332
+ function validate$7(obj, path = 'ProfileDetailsRepresentation') {
2333
+ const v_error = (() => {
2334
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2335
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2336
+ }
2337
+ if (obj.licenseId !== undefined) {
2338
+ const obj_licenseId = obj.licenseId;
2339
+ const path_licenseId = path + '.licenseId';
2340
+ let obj_licenseId_union0 = null;
2341
+ const obj_licenseId_union0_error = (() => {
2342
+ if (typeof obj_licenseId !== 'string') {
2343
+ return new TypeError('Expected "string" but received "' + typeof obj_licenseId + '" (at "' + path_licenseId + '")');
2344
+ }
2345
+ })();
2346
+ if (obj_licenseId_union0_error != null) {
2347
+ obj_licenseId_union0 = obj_licenseId_union0_error.message;
2348
+ }
2349
+ let obj_licenseId_union1 = null;
2350
+ const obj_licenseId_union1_error = (() => {
2351
+ if (obj_licenseId !== null) {
2352
+ return new TypeError('Expected "null" but received "' + typeof obj_licenseId + '" (at "' + path_licenseId + '")');
2353
+ }
2354
+ })();
2355
+ if (obj_licenseId_union1_error != null) {
2356
+ obj_licenseId_union1 = obj_licenseId_union1_error.message;
2357
+ }
2358
+ if (obj_licenseId_union0 && obj_licenseId_union1) {
2359
+ let message = 'Object doesn\'t match union (at "' + path_licenseId + '")';
2360
+ message += '\n' + obj_licenseId_union0.split('\n').map((line) => '\t' + line).join('\n');
2361
+ message += '\n' + obj_licenseId_union1.split('\n').map((line) => '\t' + line).join('\n');
2362
+ return new TypeError(message);
2363
+ }
2364
+ }
2365
+ if (obj.licenseName !== undefined) {
2366
+ const obj_licenseName = obj.licenseName;
2367
+ const path_licenseName = path + '.licenseName';
2368
+ let obj_licenseName_union0 = null;
2369
+ const obj_licenseName_union0_error = (() => {
2370
+ if (typeof obj_licenseName !== 'string') {
2371
+ return new TypeError('Expected "string" but received "' + typeof obj_licenseName + '" (at "' + path_licenseName + '")');
2372
+ }
2373
+ })();
2374
+ if (obj_licenseName_union0_error != null) {
2375
+ obj_licenseName_union0 = obj_licenseName_union0_error.message;
2376
+ }
2377
+ let obj_licenseName_union1 = null;
2378
+ const obj_licenseName_union1_error = (() => {
2379
+ if (obj_licenseName !== null) {
2380
+ return new TypeError('Expected "null" but received "' + typeof obj_licenseName + '" (at "' + path_licenseName + '")');
2381
+ }
2382
+ })();
2383
+ if (obj_licenseName_union1_error != null) {
2384
+ obj_licenseName_union1 = obj_licenseName_union1_error.message;
2385
+ }
2386
+ if (obj_licenseName_union0 && obj_licenseName_union1) {
2387
+ let message = 'Object doesn\'t match union (at "' + path_licenseName + '")';
2388
+ message += '\n' + obj_licenseName_union0.split('\n').map((line) => '\t' + line).join('\n');
2389
+ message += '\n' + obj_licenseName_union1.split('\n').map((line) => '\t' + line).join('\n');
2390
+ return new TypeError(message);
2391
+ }
2392
+ }
2393
+ if (obj.profileId !== undefined) {
2394
+ const obj_profileId = obj.profileId;
2395
+ const path_profileId = path + '.profileId';
2396
+ let obj_profileId_union0 = null;
2397
+ const obj_profileId_union0_error = (() => {
2398
+ if (typeof obj_profileId !== 'string') {
2399
+ return new TypeError('Expected "string" but received "' + typeof obj_profileId + '" (at "' + path_profileId + '")');
2400
+ }
2401
+ })();
2402
+ if (obj_profileId_union0_error != null) {
2403
+ obj_profileId_union0 = obj_profileId_union0_error.message;
2404
+ }
2405
+ let obj_profileId_union1 = null;
2406
+ const obj_profileId_union1_error = (() => {
2407
+ if (obj_profileId !== null) {
2408
+ return new TypeError('Expected "null" but received "' + typeof obj_profileId + '" (at "' + path_profileId + '")');
2409
+ }
2410
+ })();
2411
+ if (obj_profileId_union1_error != null) {
2412
+ obj_profileId_union1 = obj_profileId_union1_error.message;
2413
+ }
2414
+ if (obj_profileId_union0 && obj_profileId_union1) {
2415
+ let message = 'Object doesn\'t match union (at "' + path_profileId + '")';
2416
+ message += '\n' + obj_profileId_union0.split('\n').map((line) => '\t' + line).join('\n');
2417
+ message += '\n' + obj_profileId_union1.split('\n').map((line) => '\t' + line).join('\n');
2418
+ return new TypeError(message);
2419
+ }
2420
+ }
2421
+ if (obj.profileName !== undefined) {
2422
+ const obj_profileName = obj.profileName;
2423
+ const path_profileName = path + '.profileName';
2424
+ let obj_profileName_union0 = null;
2425
+ const obj_profileName_union0_error = (() => {
2426
+ if (typeof obj_profileName !== 'string') {
2427
+ return new TypeError('Expected "string" but received "' + typeof obj_profileName + '" (at "' + path_profileName + '")');
2428
+ }
2429
+ })();
2430
+ if (obj_profileName_union0_error != null) {
2431
+ obj_profileName_union0 = obj_profileName_union0_error.message;
2432
+ }
2433
+ let obj_profileName_union1 = null;
2434
+ const obj_profileName_union1_error = (() => {
2435
+ if (obj_profileName !== null) {
2436
+ return new TypeError('Expected "null" but received "' + typeof obj_profileName + '" (at "' + path_profileName + '")');
2437
+ }
2438
+ })();
2439
+ if (obj_profileName_union1_error != null) {
2440
+ obj_profileName_union1 = obj_profileName_union1_error.message;
2441
+ }
2442
+ if (obj_profileName_union0 && obj_profileName_union1) {
2443
+ let message = 'Object doesn\'t match union (at "' + path_profileName + '")';
2444
+ message += '\n' + obj_profileName_union0.split('\n').map((line) => '\t' + line).join('\n');
2445
+ message += '\n' + obj_profileName_union1.split('\n').map((line) => '\t' + line).join('\n');
2446
+ return new TypeError(message);
2447
+ }
2448
+ }
2449
+ })();
2450
+ return v_error === undefined ? null : v_error;
2451
+ }
2452
+ const select$7 = function ProfileDetailsRepresentationSelect() {
2453
+ return {
2454
+ kind: 'Fragment',
2455
+ version: VERSION$5,
2456
+ private: [],
2457
+ selections: [
2458
+ {
2459
+ name: 'licenseId',
2460
+ kind: 'Scalar',
2461
+ required: false
2462
+ },
2463
+ {
2464
+ name: 'licenseName',
2465
+ kind: 'Scalar',
2466
+ required: false
2467
+ },
2468
+ {
2469
+ name: 'profileId',
2470
+ kind: 'Scalar',
2471
+ required: false
2472
+ },
2473
+ {
2474
+ name: 'profileName',
2475
+ kind: 'Scalar',
2476
+ required: false
2477
+ }
2478
+ ]
2479
+ };
2480
+ };
2481
+ function equals$5(existing, incoming) {
2482
+ const existing_licenseId = existing.licenseId;
2483
+ const incoming_licenseId = incoming.licenseId;
2484
+ // if at least one of these optionals is defined
2485
+ if (existing_licenseId !== undefined || incoming_licenseId !== undefined) {
2486
+ // if one of these is not defined we know the other is defined and therefore
2487
+ // not equal
2488
+ if (existing_licenseId === undefined || incoming_licenseId === undefined) {
2489
+ return false;
2490
+ }
2491
+ if (!(existing_licenseId === incoming_licenseId)) {
2492
+ return false;
2493
+ }
2494
+ }
2495
+ const existing_licenseName = existing.licenseName;
2496
+ const incoming_licenseName = incoming.licenseName;
2497
+ // if at least one of these optionals is defined
2498
+ if (existing_licenseName !== undefined || incoming_licenseName !== undefined) {
2499
+ // if one of these is not defined we know the other is defined and therefore
2500
+ // not equal
2501
+ if (existing_licenseName === undefined || incoming_licenseName === undefined) {
2502
+ return false;
2503
+ }
2504
+ if (!(existing_licenseName === incoming_licenseName)) {
2505
+ return false;
2506
+ }
2507
+ }
2508
+ const existing_profileId = existing.profileId;
2509
+ const incoming_profileId = incoming.profileId;
2510
+ // if at least one of these optionals is defined
2511
+ if (existing_profileId !== undefined || incoming_profileId !== undefined) {
2512
+ // if one of these is not defined we know the other is defined and therefore
2513
+ // not equal
2514
+ if (existing_profileId === undefined || incoming_profileId === undefined) {
2515
+ return false;
2516
+ }
2517
+ if (!(existing_profileId === incoming_profileId)) {
2518
+ return false;
2519
+ }
2520
+ }
2521
+ const existing_profileName = existing.profileName;
2522
+ const incoming_profileName = incoming.profileName;
2523
+ // if at least one of these optionals is defined
2524
+ if (existing_profileName !== undefined || incoming_profileName !== undefined) {
2525
+ // if one of these is not defined we know the other is defined and therefore
2526
+ // not equal
2527
+ if (existing_profileName === undefined || incoming_profileName === undefined) {
2528
+ return false;
2529
+ }
2530
+ if (!(existing_profileName === incoming_profileName)) {
2531
+ return false;
2532
+ }
2533
+ }
2534
+ return true;
2535
+ }
2536
+
2537
+ const VERSION$4 = "1374eb7105fe217c4f04a7b83af4438f";
2538
+ function validate$6(obj, path = 'UserSettingsOutputRepresentations') {
2539
+ const v_error = (() => {
2540
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2541
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2542
+ }
2543
+ if (obj.autoCreateFlag !== undefined) {
2544
+ const obj_autoCreateFlag = obj.autoCreateFlag;
2545
+ const path_autoCreateFlag = path + '.autoCreateFlag';
2546
+ if (typeof obj_autoCreateFlag !== 'boolean') {
2547
+ return new TypeError('Expected "boolean" but received "' + typeof obj_autoCreateFlag + '" (at "' + path_autoCreateFlag + '")');
2548
+ }
2549
+ }
2550
+ if (obj.autoDeactivateFlag !== undefined) {
2551
+ const obj_autoDeactivateFlag = obj.autoDeactivateFlag;
2552
+ const path_autoDeactivateFlag = path + '.autoDeactivateFlag';
2553
+ if (typeof obj_autoDeactivateFlag !== 'boolean') {
2554
+ return new TypeError('Expected "boolean" but received "' + typeof obj_autoDeactivateFlag + '" (at "' + path_autoDeactivateFlag + '")');
2555
+ }
2556
+ }
2557
+ if (obj.domain !== undefined) {
2558
+ const obj_domain = obj.domain;
2559
+ const path_domain = path + '.domain';
2560
+ let obj_domain_union0 = null;
2561
+ const obj_domain_union0_error = (() => {
2562
+ if (typeof obj_domain !== 'string') {
2563
+ return new TypeError('Expected "string" but received "' + typeof obj_domain + '" (at "' + path_domain + '")');
2564
+ }
2565
+ })();
2566
+ if (obj_domain_union0_error != null) {
2567
+ obj_domain_union0 = obj_domain_union0_error.message;
2568
+ }
2569
+ let obj_domain_union1 = null;
2570
+ const obj_domain_union1_error = (() => {
2571
+ if (obj_domain !== null) {
2572
+ return new TypeError('Expected "null" but received "' + typeof obj_domain + '" (at "' + path_domain + '")');
2573
+ }
2574
+ })();
2575
+ if (obj_domain_union1_error != null) {
2576
+ obj_domain_union1 = obj_domain_union1_error.message;
2577
+ }
2578
+ if (obj_domain_union0 && obj_domain_union1) {
2579
+ let message = 'Object doesn\'t match union (at "' + path_domain + '")';
2580
+ message += '\n' + obj_domain_union0.split('\n').map((line) => '\t' + line).join('\n');
2581
+ message += '\n' + obj_domain_union1.split('\n').map((line) => '\t' + line).join('\n');
2582
+ return new TypeError(message);
2583
+ }
2584
+ }
2585
+ if (obj.emailEncoding !== undefined) {
2586
+ const obj_emailEncoding = obj.emailEncoding;
2587
+ const path_emailEncoding = path + '.emailEncoding';
2588
+ if (typeof obj_emailEncoding !== 'string') {
2589
+ return new TypeError('Expected "string" but received "' + typeof obj_emailEncoding + '" (at "' + path_emailEncoding + '")');
2590
+ }
2591
+ }
2592
+ if (obj.employeeStatus !== undefined) {
2593
+ const obj_employeeStatus = obj.employeeStatus;
2594
+ const path_employeeStatus = path + '.employeeStatus';
2595
+ let obj_employeeStatus_union0 = null;
2596
+ const obj_employeeStatus_union0_error = (() => {
2597
+ if (typeof obj_employeeStatus !== 'string') {
2598
+ return new TypeError('Expected "string" but received "' + typeof obj_employeeStatus + '" (at "' + path_employeeStatus + '")');
2599
+ }
2600
+ })();
2601
+ if (obj_employeeStatus_union0_error != null) {
2602
+ obj_employeeStatus_union0 = obj_employeeStatus_union0_error.message;
2603
+ }
2604
+ let obj_employeeStatus_union1 = null;
2605
+ const obj_employeeStatus_union1_error = (() => {
2606
+ if (obj_employeeStatus !== null) {
2607
+ return new TypeError('Expected "null" but received "' + typeof obj_employeeStatus + '" (at "' + path_employeeStatus + '")');
2608
+ }
2609
+ })();
2610
+ if (obj_employeeStatus_union1_error != null) {
2611
+ obj_employeeStatus_union1 = obj_employeeStatus_union1_error.message;
2612
+ }
2613
+ if (obj_employeeStatus_union0 && obj_employeeStatus_union1) {
2614
+ let message = 'Object doesn\'t match union (at "' + path_employeeStatus + '")';
2615
+ message += '\n' + obj_employeeStatus_union0.split('\n').map((line) => '\t' + line).join('\n');
2616
+ message += '\n' + obj_employeeStatus_union1.split('\n').map((line) => '\t' + line).join('\n');
2617
+ return new TypeError(message);
2618
+ }
2619
+ }
2620
+ if (obj.permissionSetDetailsRepresentation !== undefined) {
2621
+ const obj_permissionSetDetailsRepresentation = obj.permissionSetDetailsRepresentation;
2622
+ const path_permissionSetDetailsRepresentation = path + '.permissionSetDetailsRepresentation';
2623
+ let obj_permissionSetDetailsRepresentation_union0 = null;
2624
+ const obj_permissionSetDetailsRepresentation_union0_error = (() => {
2625
+ const referencepath_permissionSetDetailsRepresentationValidationError = validate$8(obj_permissionSetDetailsRepresentation, path_permissionSetDetailsRepresentation);
2626
+ if (referencepath_permissionSetDetailsRepresentationValidationError !== null) {
2627
+ let message = 'Object doesn\'t match PermissionDetailsRepresentation (at "' + path_permissionSetDetailsRepresentation + '")\n';
2628
+ message += referencepath_permissionSetDetailsRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2629
+ return new TypeError(message);
2630
+ }
2631
+ })();
2632
+ if (obj_permissionSetDetailsRepresentation_union0_error != null) {
2633
+ obj_permissionSetDetailsRepresentation_union0 = obj_permissionSetDetailsRepresentation_union0_error.message;
2634
+ }
2635
+ let obj_permissionSetDetailsRepresentation_union1 = null;
2636
+ const obj_permissionSetDetailsRepresentation_union1_error = (() => {
2637
+ if (obj_permissionSetDetailsRepresentation !== null) {
2638
+ return new TypeError('Expected "null" but received "' + typeof obj_permissionSetDetailsRepresentation + '" (at "' + path_permissionSetDetailsRepresentation + '")');
2639
+ }
2640
+ })();
2641
+ if (obj_permissionSetDetailsRepresentation_union1_error != null) {
2642
+ obj_permissionSetDetailsRepresentation_union1 = obj_permissionSetDetailsRepresentation_union1_error.message;
2643
+ }
2644
+ if (obj_permissionSetDetailsRepresentation_union0 && obj_permissionSetDetailsRepresentation_union1) {
2645
+ let message = 'Object doesn\'t match union (at "' + path_permissionSetDetailsRepresentation + '")';
2646
+ message += '\n' + obj_permissionSetDetailsRepresentation_union0.split('\n').map((line) => '\t' + line).join('\n');
2647
+ message += '\n' + obj_permissionSetDetailsRepresentation_union1.split('\n').map((line) => '\t' + line).join('\n');
2648
+ return new TypeError(message);
2649
+ }
2650
+ }
2651
+ if (obj.profileDetailsRepresentation !== undefined) {
2652
+ const obj_profileDetailsRepresentation = obj.profileDetailsRepresentation;
2653
+ const path_profileDetailsRepresentation = path + '.profileDetailsRepresentation';
2654
+ let obj_profileDetailsRepresentation_union0 = null;
2655
+ const obj_profileDetailsRepresentation_union0_error = (() => {
2656
+ const referencepath_profileDetailsRepresentationValidationError = validate$7(obj_profileDetailsRepresentation, path_profileDetailsRepresentation);
2657
+ if (referencepath_profileDetailsRepresentationValidationError !== null) {
2658
+ let message = 'Object doesn\'t match ProfileDetailsRepresentation (at "' + path_profileDetailsRepresentation + '")\n';
2659
+ message += referencepath_profileDetailsRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2660
+ return new TypeError(message);
2661
+ }
2662
+ })();
2663
+ if (obj_profileDetailsRepresentation_union0_error != null) {
2664
+ obj_profileDetailsRepresentation_union0 = obj_profileDetailsRepresentation_union0_error.message;
2665
+ }
2666
+ let obj_profileDetailsRepresentation_union1 = null;
2667
+ const obj_profileDetailsRepresentation_union1_error = (() => {
2668
+ if (obj_profileDetailsRepresentation !== null) {
2669
+ return new TypeError('Expected "null" but received "' + typeof obj_profileDetailsRepresentation + '" (at "' + path_profileDetailsRepresentation + '")');
2670
+ }
2671
+ })();
2672
+ if (obj_profileDetailsRepresentation_union1_error != null) {
2673
+ obj_profileDetailsRepresentation_union1 = obj_profileDetailsRepresentation_union1_error.message;
2674
+ }
2675
+ if (obj_profileDetailsRepresentation_union0 && obj_profileDetailsRepresentation_union1) {
2676
+ let message = 'Object doesn\'t match union (at "' + path_profileDetailsRepresentation + '")';
2677
+ message += '\n' + obj_profileDetailsRepresentation_union0.split('\n').map((line) => '\t' + line).join('\n');
2678
+ message += '\n' + obj_profileDetailsRepresentation_union1.split('\n').map((line) => '\t' + line).join('\n');
2679
+ return new TypeError(message);
2680
+ }
2681
+ }
2682
+ const obj_syncEmployee2Users = obj.syncEmployee2Users;
2683
+ const path_syncEmployee2Users = path + '.syncEmployee2Users';
2684
+ if (typeof obj_syncEmployee2Users !== 'boolean') {
2685
+ return new TypeError('Expected "boolean" but received "' + typeof obj_syncEmployee2Users + '" (at "' + path_syncEmployee2Users + '")');
2686
+ }
2687
+ })();
2688
+ return v_error === undefined ? null : v_error;
2689
+ }
2690
+ const RepresentationType$1 = 'UserSettingsOutputRepresentations';
2691
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
2692
+ return input;
2693
+ }
2694
+ const select$6 = function UserSettingsOutputRepresentationsSelect() {
2695
+ const { selections: PermissionDetailsRepresentation__selections, opaque: PermissionDetailsRepresentation__opaque, } = select$8();
2696
+ const { selections: ProfileDetailsRepresentation__selections, opaque: ProfileDetailsRepresentation__opaque, } = select$7();
2697
+ return {
2698
+ kind: 'Fragment',
2699
+ version: VERSION$4,
2700
+ private: [],
2701
+ selections: [
2702
+ {
2703
+ name: 'autoCreateFlag',
2704
+ kind: 'Scalar',
2705
+ required: false
2706
+ },
2707
+ {
2708
+ name: 'autoDeactivateFlag',
2709
+ kind: 'Scalar',
2710
+ required: false
2711
+ },
2712
+ {
2713
+ name: 'domain',
2714
+ kind: 'Scalar',
2715
+ required: false
2716
+ },
2717
+ {
2718
+ name: 'emailEncoding',
2719
+ kind: 'Scalar',
2720
+ required: false
2721
+ },
2722
+ {
2723
+ name: 'employeeStatus',
2724
+ kind: 'Scalar',
2725
+ required: false
2726
+ },
2727
+ {
2728
+ name: 'permissionSetDetailsRepresentation',
2729
+ kind: 'Object',
2730
+ nullable: true,
2731
+ selections: PermissionDetailsRepresentation__selections,
2732
+ required: false
2733
+ },
2734
+ {
2735
+ name: 'profileDetailsRepresentation',
2736
+ kind: 'Object',
2737
+ nullable: true,
2738
+ selections: ProfileDetailsRepresentation__selections,
2739
+ required: false
2740
+ },
2741
+ {
2742
+ name: 'syncEmployee2Users',
2743
+ kind: 'Scalar'
2744
+ }
2745
+ ]
2746
+ };
2747
+ };
2748
+ function equals$4(existing, incoming) {
2749
+ const existing_autoCreateFlag = existing.autoCreateFlag;
2750
+ const incoming_autoCreateFlag = incoming.autoCreateFlag;
2751
+ // if at least one of these optionals is defined
2752
+ if (existing_autoCreateFlag !== undefined || incoming_autoCreateFlag !== undefined) {
2753
+ // if one of these is not defined we know the other is defined and therefore
2754
+ // not equal
2755
+ if (existing_autoCreateFlag === undefined || incoming_autoCreateFlag === undefined) {
2756
+ return false;
2757
+ }
2758
+ if (!(existing_autoCreateFlag === incoming_autoCreateFlag)) {
2759
+ return false;
2760
+ }
2761
+ }
2762
+ const existing_autoDeactivateFlag = existing.autoDeactivateFlag;
2763
+ const incoming_autoDeactivateFlag = incoming.autoDeactivateFlag;
2764
+ // if at least one of these optionals is defined
2765
+ if (existing_autoDeactivateFlag !== undefined || incoming_autoDeactivateFlag !== undefined) {
2766
+ // if one of these is not defined we know the other is defined and therefore
2767
+ // not equal
2768
+ if (existing_autoDeactivateFlag === undefined || incoming_autoDeactivateFlag === undefined) {
2769
+ return false;
2770
+ }
2771
+ if (!(existing_autoDeactivateFlag === incoming_autoDeactivateFlag)) {
2772
+ return false;
2773
+ }
2774
+ }
2775
+ const existing_syncEmployee2Users = existing.syncEmployee2Users;
2776
+ const incoming_syncEmployee2Users = incoming.syncEmployee2Users;
2777
+ if (!(existing_syncEmployee2Users === incoming_syncEmployee2Users)) {
2778
+ return false;
2779
+ }
2780
+ const existing_emailEncoding = existing.emailEncoding;
2781
+ const incoming_emailEncoding = incoming.emailEncoding;
2782
+ // if at least one of these optionals is defined
2783
+ if (existing_emailEncoding !== undefined || incoming_emailEncoding !== undefined) {
2784
+ // if one of these is not defined we know the other is defined and therefore
2785
+ // not equal
2786
+ if (existing_emailEncoding === undefined || incoming_emailEncoding === undefined) {
2787
+ return false;
2788
+ }
2789
+ if (!(existing_emailEncoding === incoming_emailEncoding)) {
2790
+ return false;
2791
+ }
2792
+ }
2793
+ const existing_domain = existing.domain;
2794
+ const incoming_domain = incoming.domain;
2795
+ // if at least one of these optionals is defined
2796
+ if (existing_domain !== undefined || incoming_domain !== undefined) {
2797
+ // if one of these is not defined we know the other is defined and therefore
2798
+ // not equal
2799
+ if (existing_domain === undefined || incoming_domain === undefined) {
2800
+ return false;
2801
+ }
2802
+ if (!(existing_domain === incoming_domain)) {
2803
+ return false;
2804
+ }
2805
+ }
2806
+ const existing_employeeStatus = existing.employeeStatus;
2807
+ const incoming_employeeStatus = incoming.employeeStatus;
2808
+ // if at least one of these optionals is defined
2809
+ if (existing_employeeStatus !== undefined || incoming_employeeStatus !== undefined) {
2810
+ // if one of these is not defined we know the other is defined and therefore
2811
+ // not equal
2812
+ if (existing_employeeStatus === undefined || incoming_employeeStatus === undefined) {
2813
+ return false;
2814
+ }
2815
+ if (!(existing_employeeStatus === incoming_employeeStatus)) {
2816
+ return false;
2817
+ }
2818
+ }
2819
+ const existing_permissionSetDetailsRepresentation = existing.permissionSetDetailsRepresentation;
2820
+ const incoming_permissionSetDetailsRepresentation = incoming.permissionSetDetailsRepresentation;
2821
+ // if at least one of these optionals is defined
2822
+ if (existing_permissionSetDetailsRepresentation !== undefined || incoming_permissionSetDetailsRepresentation !== undefined) {
2823
+ // if one of these is not defined we know the other is defined and therefore
2824
+ // not equal
2825
+ if (existing_permissionSetDetailsRepresentation === undefined || incoming_permissionSetDetailsRepresentation === undefined) {
2826
+ return false;
2827
+ }
2828
+ if (!(existing_permissionSetDetailsRepresentation === incoming_permissionSetDetailsRepresentation
2829
+ || (existing_permissionSetDetailsRepresentation != null &&
2830
+ incoming_permissionSetDetailsRepresentation != null &&
2831
+ equals$6(existing_permissionSetDetailsRepresentation, incoming_permissionSetDetailsRepresentation)))) {
2832
+ return false;
2833
+ }
2834
+ }
2835
+ const existing_profileDetailsRepresentation = existing.profileDetailsRepresentation;
2836
+ const incoming_profileDetailsRepresentation = incoming.profileDetailsRepresentation;
2837
+ // if at least one of these optionals is defined
2838
+ if (existing_profileDetailsRepresentation !== undefined || incoming_profileDetailsRepresentation !== undefined) {
2839
+ // if one of these is not defined we know the other is defined and therefore
2840
+ // not equal
2841
+ if (existing_profileDetailsRepresentation === undefined || incoming_profileDetailsRepresentation === undefined) {
2842
+ return false;
2843
+ }
2844
+ if (!(existing_profileDetailsRepresentation === incoming_profileDetailsRepresentation
2845
+ || (existing_profileDetailsRepresentation != null &&
2846
+ incoming_profileDetailsRepresentation != null &&
2847
+ equals$5(existing_profileDetailsRepresentation, incoming_profileDetailsRepresentation)))) {
2848
+ return false;
2849
+ }
2850
+ }
2851
+ return true;
2852
+ }
2853
+ const ingest$1 = function UserSettingsOutputRepresentationsIngest(input, path, luvio, store, timestamp) {
2854
+ if (process.env.NODE_ENV !== 'production') {
2855
+ const validateError = validate$6(input);
2856
+ if (validateError !== null) {
2857
+ throw validateError;
2858
+ }
2859
+ }
2860
+ const key = path.fullPath;
2861
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
2862
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "Service-employee", VERSION$4, RepresentationType$1, equals$4);
2863
+ return createLink(key);
2864
+ };
2865
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
2866
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2867
+ const rootKey = fullPathFactory();
2868
+ rootKeySet.set(rootKey, {
2869
+ namespace: keyPrefix,
2870
+ representationName: RepresentationType$1,
2871
+ mergeable: false
2872
+ });
2873
+ }
2874
+
2875
+ function select$5(luvio, params) {
2876
+ return select$6();
2877
+ }
2878
+ function keyBuilder$3(luvio, params) {
2879
+ return keyPrefix + '::UserSettingsOutputRepresentations:(' + 'sourceOfInvocation:' + params.queryParams.sourceOfInvocation + ')';
2880
+ }
2881
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
2882
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
2883
+ }
2884
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
2885
+ const { body } = response;
2886
+ const key = keyBuilder$3(luvio, resourceParams);
2887
+ luvio.storeIngest(key, ingest$1, body);
2888
+ const snapshot = luvio.storeLookup({
2889
+ recordId: key,
2890
+ node: select$5(),
2891
+ variables: {},
2892
+ }, snapshotRefresh);
2893
+ if (process.env.NODE_ENV !== 'production') {
2894
+ if (snapshot.state !== 'Fulfilled') {
2895
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2896
+ }
2897
+ }
2898
+ deepFreeze(snapshot.data);
2899
+ return snapshot;
2900
+ }
2901
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
2902
+ const key = keyBuilder$3(luvio, params);
2903
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2904
+ luvio.storeIngestError(key, errorSnapshot);
2905
+ return errorSnapshot;
2906
+ }
2907
+ function createResourceRequest$1(config) {
2908
+ const headers = {};
2909
+ return {
2910
+ baseUri: '/services/data/v66.0',
2911
+ basePath: '/connect/service-employee/user-settings/details',
2912
+ method: 'get',
2913
+ body: null,
2914
+ urlParams: {},
2915
+ queryParams: config.queryParams,
2916
+ headers,
2917
+ priority: 'normal',
2918
+ };
2919
+ }
2920
+
2921
+ const adapterName$1 = 'getUserSettings';
2922
+ const getUserSettings_ConfigPropertyMetadata = [
2923
+ generateParamConfigMetadata('sourceOfInvocation', false, 1 /* QueryParameter */, 0 /* String */),
2924
+ ];
2925
+ const getUserSettings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getUserSettings_ConfigPropertyMetadata);
2926
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(getUserSettings_ConfigPropertyMetadata);
2927
+ function keyBuilder$2(luvio, config) {
2928
+ const resourceParams = createResourceParams$1(config);
2929
+ return keyBuilder$3(luvio, resourceParams);
2930
+ }
2931
+ function typeCheckConfig$1(untrustedConfig) {
2932
+ const config = {};
2933
+ typeCheckConfig$7(untrustedConfig, config, getUserSettings_ConfigPropertyMetadata);
2934
+ return config;
2935
+ }
2936
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
2937
+ if (!untrustedIsObject(untrustedConfig)) {
2938
+ return null;
2939
+ }
2940
+ if (process.env.NODE_ENV !== 'production') {
2941
+ validateConfig(untrustedConfig, configPropertyNames);
2942
+ }
2943
+ const config = typeCheckConfig$1(untrustedConfig);
2944
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2945
+ return null;
2946
+ }
2947
+ return config;
2948
+ }
2949
+ function adapterFragment$1(luvio, config) {
2950
+ createResourceParams$1(config);
2951
+ return select$5();
2952
+ }
2953
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
2954
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
2955
+ config,
2956
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
2957
+ });
2958
+ return luvio.storeBroadcast().then(() => snapshot);
2959
+ }
2960
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
2961
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
2962
+ config,
2963
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
2964
+ });
2965
+ return luvio.storeBroadcast().then(() => snapshot);
2966
+ }
2967
+ function buildNetworkSnapshot$1(luvio, config, options) {
2968
+ const resourceParams = createResourceParams$1(config);
2969
+ const request = createResourceRequest$1(resourceParams);
2970
+ return luvio.dispatchResourceRequest(request, options)
2971
+ .then((response) => {
2972
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
2973
+ const cache = new StoreKeyMap();
2974
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
2975
+ return cache;
2976
+ });
2977
+ }, (response) => {
2978
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
2979
+ });
2980
+ }
2981
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
2982
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
2983
+ }
2984
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
2985
+ const { luvio, config } = context;
2986
+ const selector = {
2987
+ recordId: keyBuilder$2(luvio, config),
2988
+ node: adapterFragment$1(luvio, config),
2989
+ variables: {},
2990
+ };
2991
+ const cacheSnapshot = storeLookup(selector, {
2992
+ config,
2993
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
2994
+ });
2995
+ return cacheSnapshot;
2996
+ }
2997
+ const getUserSettingsAdapterFactory = (luvio) => function serviceEmployee__getUserSettings(untrustedConfig, requestContext) {
2998
+ const config = validateAdapterConfig$1(untrustedConfig, getUserSettings_ConfigPropertyNames);
2999
+ // Invalid or incomplete config
3000
+ if (config === null) {
3001
+ return null;
3002
+ }
3003
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3004
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
3005
+ };
3006
+
3007
+ function validate$5(obj, path = 'PermissionSetsInputRepresentation') {
3008
+ const v_error = (() => {
3009
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3010
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3011
+ }
3012
+ const obj_licenses = obj.licenses;
3013
+ const path_licenses = path + '.licenses';
3014
+ if (!ArrayIsArray(obj_licenses)) {
3015
+ return new TypeError('Expected "array" but received "' + typeof obj_licenses + '" (at "' + path_licenses + '")');
3016
+ }
3017
+ for (let i = 0; i < obj_licenses.length; i++) {
3018
+ const obj_licenses_item = obj_licenses[i];
3019
+ const path_licenses_item = path_licenses + '[' + i + ']';
3020
+ if (typeof obj_licenses_item !== 'string') {
3021
+ return new TypeError('Expected "string" but received "' + typeof obj_licenses_item + '" (at "' + path_licenses_item + '")');
3022
+ }
3023
+ }
3024
+ })();
3025
+ return v_error === undefined ? null : v_error;
3026
+ }
3027
+
3028
+ function validate$4(obj, path = 'LicenseDetailsInputRepresentation') {
3029
+ const v_error = (() => {
3030
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3031
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3032
+ }
3033
+ const obj_licenses = obj.licenses;
3034
+ const path_licenses = path + '.licenses';
3035
+ if (!ArrayIsArray(obj_licenses)) {
3036
+ return new TypeError('Expected "array" but received "' + typeof obj_licenses + '" (at "' + path_licenses + '")');
3037
+ }
3038
+ for (let i = 0; i < obj_licenses.length; i++) {
3039
+ const obj_licenses_item = obj_licenses[i];
3040
+ const path_licenses_item = path_licenses + '[' + i + ']';
3041
+ if (typeof obj_licenses_item !== 'string') {
3042
+ return new TypeError('Expected "string" but received "' + typeof obj_licenses_item + '" (at "' + path_licenses_item + '")');
3043
+ }
3044
+ }
3045
+ })();
3046
+ return v_error === undefined ? null : v_error;
3047
+ }
3048
+
3049
+ const VERSION$3 = "4d8f51e66bfbe4fc76183de7516d01bf";
3050
+ function validate$3(obj, path = 'EmailEncodingDetailsRepresentation') {
3051
+ const v_error = (() => {
3052
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3053
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3054
+ }
3055
+ const obj_label = obj.label;
3056
+ const path_label = path + '.label';
3057
+ if (typeof obj_label !== 'string') {
3058
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
3059
+ }
3060
+ const obj_value = obj.value;
3061
+ const path_value = path + '.value';
3062
+ if (typeof obj_value !== 'string') {
3063
+ return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
3064
+ }
3065
+ })();
3066
+ return v_error === undefined ? null : v_error;
3067
+ }
3068
+ const select$4 = function EmailEncodingDetailsRepresentationSelect() {
3069
+ return {
3070
+ kind: 'Fragment',
3071
+ version: VERSION$3,
3072
+ private: [],
3073
+ selections: [
3074
+ {
3075
+ name: 'label',
3076
+ kind: 'Scalar'
3077
+ },
3078
+ {
3079
+ name: 'value',
3080
+ kind: 'Scalar'
3081
+ }
3082
+ ]
3083
+ };
3084
+ };
3085
+ function equals$3(existing, incoming) {
3086
+ const existing_label = existing.label;
3087
+ const incoming_label = incoming.label;
3088
+ if (!(existing_label === incoming_label)) {
3089
+ return false;
3090
+ }
3091
+ const existing_value = existing.value;
3092
+ const incoming_value = incoming.value;
3093
+ if (!(existing_value === incoming_value)) {
3094
+ return false;
3095
+ }
3096
+ return true;
3097
+ }
3098
+
3099
+ const VERSION$2 = "6c76c268c6383b710a0feadee62e3f30";
3100
+ function validate$2(obj, path = 'PermissionSetGroupsDetailsRepresentation') {
3101
+ const v_error = (() => {
3102
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3103
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3104
+ }
3105
+ const obj_id = obj.id;
3106
+ const path_id = path + '.id';
3107
+ if (typeof obj_id !== 'string') {
3108
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3109
+ }
3110
+ const obj_label = obj.label;
3111
+ const path_label = path + '.label';
3112
+ if (typeof obj_label !== 'string') {
3113
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
3114
+ }
3115
+ const obj_name = obj.name;
3116
+ const path_name = path + '.name';
3117
+ if (typeof obj_name !== 'string') {
3118
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
3119
+ }
3120
+ })();
3121
+ return v_error === undefined ? null : v_error;
3122
+ }
3123
+ const select$3 = function PermissionSetGroupsDetailsRepresentationSelect() {
3124
+ return {
3125
+ kind: 'Fragment',
3126
+ version: VERSION$2,
3127
+ private: [],
3128
+ selections: [
3129
+ {
3130
+ name: 'id',
3131
+ kind: 'Scalar'
3132
+ },
3133
+ {
3134
+ name: 'label',
3135
+ kind: 'Scalar'
3136
+ },
3137
+ {
3138
+ name: 'name',
3139
+ kind: 'Scalar'
3140
+ }
3141
+ ]
3142
+ };
3143
+ };
3144
+ function equals$2(existing, incoming) {
3145
+ const existing_id = existing.id;
3146
+ const incoming_id = incoming.id;
3147
+ if (!(existing_id === incoming_id)) {
3148
+ return false;
3149
+ }
3150
+ const existing_label = existing.label;
3151
+ const incoming_label = incoming.label;
3152
+ if (!(existing_label === incoming_label)) {
3153
+ return false;
3154
+ }
3155
+ const existing_name = existing.name;
3156
+ const incoming_name = incoming.name;
3157
+ if (!(existing_name === incoming_name)) {
3158
+ return false;
3159
+ }
3160
+ return true;
3161
+ }
3162
+
3163
+ const VERSION$1 = "b5f28188b1ec90d88bbd9670b482323d";
3164
+ function validate$1(obj, path = 'PermissionSetsDetailsRepresentation') {
3165
+ const v_error = (() => {
3166
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3167
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3168
+ }
3169
+ const obj_id = obj.id;
3170
+ const path_id = path + '.id';
3171
+ if (typeof obj_id !== 'string') {
3172
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3173
+ }
3174
+ const obj_label = obj.label;
3175
+ const path_label = path + '.label';
3176
+ if (typeof obj_label !== 'string') {
3177
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
3178
+ }
3179
+ const obj_licenseId = obj.licenseId;
3180
+ const path_licenseId = path + '.licenseId';
3181
+ if (typeof obj_licenseId !== 'string') {
3182
+ return new TypeError('Expected "string" but received "' + typeof obj_licenseId + '" (at "' + path_licenseId + '")');
3183
+ }
3184
+ const obj_name = obj.name;
3185
+ const path_name = path + '.name';
3186
+ if (typeof obj_name !== 'string') {
3187
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
3188
+ }
3189
+ const obj_profileId = obj.profileId;
3190
+ const path_profileId = path + '.profileId';
3191
+ if (typeof obj_profileId !== 'string') {
3192
+ return new TypeError('Expected "string" but received "' + typeof obj_profileId + '" (at "' + path_profileId + '")');
3193
+ }
3194
+ })();
3195
+ return v_error === undefined ? null : v_error;
3196
+ }
3197
+ const select$2 = function PermissionSetsDetailsRepresentationSelect() {
3198
+ return {
3199
+ kind: 'Fragment',
3200
+ version: VERSION$1,
3201
+ private: [],
3202
+ selections: [
3203
+ {
3204
+ name: 'id',
3205
+ kind: 'Scalar'
3206
+ },
3207
+ {
3208
+ name: 'label',
3209
+ kind: 'Scalar'
3210
+ },
3211
+ {
3212
+ name: 'licenseId',
3213
+ kind: 'Scalar'
3214
+ },
3215
+ {
3216
+ name: 'name',
3217
+ kind: 'Scalar'
3218
+ },
3219
+ {
3220
+ name: 'profileId',
3221
+ kind: 'Scalar'
3222
+ }
3223
+ ]
3224
+ };
3225
+ };
3226
+ function equals$1(existing, incoming) {
3227
+ const existing_id = existing.id;
3228
+ const incoming_id = incoming.id;
3229
+ if (!(existing_id === incoming_id)) {
3230
+ return false;
3231
+ }
3232
+ const existing_label = existing.label;
3233
+ const incoming_label = incoming.label;
3234
+ if (!(existing_label === incoming_label)) {
3235
+ return false;
3236
+ }
3237
+ const existing_licenseId = existing.licenseId;
3238
+ const incoming_licenseId = incoming.licenseId;
3239
+ if (!(existing_licenseId === incoming_licenseId)) {
3240
+ return false;
3241
+ }
3242
+ const existing_name = existing.name;
3243
+ const incoming_name = incoming.name;
3244
+ if (!(existing_name === incoming_name)) {
3245
+ return false;
3246
+ }
3247
+ const existing_profileId = existing.profileId;
3248
+ const incoming_profileId = incoming.profileId;
3249
+ if (!(existing_profileId === incoming_profileId)) {
3250
+ return false;
3251
+ }
3252
+ return true;
3253
+ }
3254
+
3255
+ const VERSION = "9f5cd2dc8964436292fb9585399fc8d7";
3256
+ function validate(obj, path = 'AvailableUserOptionsOutputRepresentation') {
3257
+ const v_error = (() => {
3258
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3259
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3260
+ }
3261
+ const obj_emailEncodings = obj.emailEncodings;
3262
+ const path_emailEncodings = path + '.emailEncodings';
3263
+ if (!ArrayIsArray(obj_emailEncodings)) {
3264
+ return new TypeError('Expected "array" but received "' + typeof obj_emailEncodings + '" (at "' + path_emailEncodings + '")');
3265
+ }
3266
+ for (let i = 0; i < obj_emailEncodings.length; i++) {
3267
+ const obj_emailEncodings_item = obj_emailEncodings[i];
3268
+ const path_emailEncodings_item = path_emailEncodings + '[' + i + ']';
3269
+ const referencepath_emailEncodings_itemValidationError = validate$3(obj_emailEncodings_item, path_emailEncodings_item);
3270
+ if (referencepath_emailEncodings_itemValidationError !== null) {
3271
+ let message = 'Object doesn\'t match EmailEncodingDetailsRepresentation (at "' + path_emailEncodings_item + '")\n';
3272
+ message += referencepath_emailEncodings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3273
+ return new TypeError(message);
3274
+ }
3275
+ }
3276
+ const obj_employeeStatuses = obj.employeeStatuses;
3277
+ const path_employeeStatuses = path + '.employeeStatuses';
3278
+ if (!ArrayIsArray(obj_employeeStatuses)) {
3279
+ return new TypeError('Expected "array" but received "' + typeof obj_employeeStatuses + '" (at "' + path_employeeStatuses + '")');
3280
+ }
3281
+ for (let i = 0; i < obj_employeeStatuses.length; i++) {
3282
+ const obj_employeeStatuses_item = obj_employeeStatuses[i];
3283
+ const path_employeeStatuses_item = path_employeeStatuses + '[' + i + ']';
3284
+ if (typeof obj_employeeStatuses_item !== 'string') {
3285
+ return new TypeError('Expected "string" but received "' + typeof obj_employeeStatuses_item + '" (at "' + path_employeeStatuses_item + '")');
3286
+ }
3287
+ }
3288
+ if (obj.permissionSetGroups !== undefined) {
3289
+ const obj_permissionSetGroups = obj.permissionSetGroups;
3290
+ const path_permissionSetGroups = path + '.permissionSetGroups';
3291
+ if (!ArrayIsArray(obj_permissionSetGroups)) {
3292
+ return new TypeError('Expected "array" but received "' + typeof obj_permissionSetGroups + '" (at "' + path_permissionSetGroups + '")');
3293
+ }
3294
+ for (let i = 0; i < obj_permissionSetGroups.length; i++) {
3295
+ const obj_permissionSetGroups_item = obj_permissionSetGroups[i];
3296
+ const path_permissionSetGroups_item = path_permissionSetGroups + '[' + i + ']';
3297
+ const referencepath_permissionSetGroups_itemValidationError = validate$2(obj_permissionSetGroups_item, path_permissionSetGroups_item);
3298
+ if (referencepath_permissionSetGroups_itemValidationError !== null) {
3299
+ let message = 'Object doesn\'t match PermissionSetGroupsDetailsRepresentation (at "' + path_permissionSetGroups_item + '")\n';
3300
+ message += referencepath_permissionSetGroups_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3301
+ return new TypeError(message);
3302
+ }
3303
+ }
3304
+ }
3305
+ if (obj.permissionSets !== undefined) {
3306
+ const obj_permissionSets = obj.permissionSets;
3307
+ const path_permissionSets = path + '.permissionSets';
3308
+ if (!ArrayIsArray(obj_permissionSets)) {
3309
+ return new TypeError('Expected "array" but received "' + typeof obj_permissionSets + '" (at "' + path_permissionSets + '")');
3310
+ }
3311
+ for (let i = 0; i < obj_permissionSets.length; i++) {
3312
+ const obj_permissionSets_item = obj_permissionSets[i];
3313
+ const path_permissionSets_item = path_permissionSets + '[' + i + ']';
3314
+ const referencepath_permissionSets_itemValidationError = validate$1(obj_permissionSets_item, path_permissionSets_item);
3315
+ if (referencepath_permissionSets_itemValidationError !== null) {
3316
+ let message = 'Object doesn\'t match PermissionSetsDetailsRepresentation (at "' + path_permissionSets_item + '")\n';
3317
+ message += referencepath_permissionSets_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3318
+ return new TypeError(message);
3319
+ }
3320
+ }
3321
+ }
3322
+ const obj_profiles = obj.profiles;
3323
+ const path_profiles = path + '.profiles';
3324
+ if (!ArrayIsArray(obj_profiles)) {
3325
+ return new TypeError('Expected "array" but received "' + typeof obj_profiles + '" (at "' + path_profiles + '")');
3326
+ }
3327
+ for (let i = 0; i < obj_profiles.length; i++) {
3328
+ const obj_profiles_item = obj_profiles[i];
3329
+ const path_profiles_item = path_profiles + '[' + i + ']';
3330
+ const referencepath_profiles_itemValidationError = validate$7(obj_profiles_item, path_profiles_item);
3331
+ if (referencepath_profiles_itemValidationError !== null) {
3332
+ let message = 'Object doesn\'t match ProfileDetailsRepresentation (at "' + path_profiles_item + '")\n';
3333
+ message += referencepath_profiles_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3334
+ return new TypeError(message);
3335
+ }
3336
+ }
3337
+ })();
3338
+ return v_error === undefined ? null : v_error;
3339
+ }
3340
+ const RepresentationType = 'AvailableUserOptionsOutputRepresentation';
3341
+ function normalize(input, existing, path, luvio, store, timestamp) {
3342
+ return input;
3343
+ }
3344
+ const select$1 = function AvailableUserOptionsOutputRepresentationSelect() {
3345
+ const { selections: EmailEncodingDetailsRepresentation__selections, opaque: EmailEncodingDetailsRepresentation__opaque, } = select$4();
3346
+ const { selections: PermissionSetGroupsDetailsRepresentation__selections, opaque: PermissionSetGroupsDetailsRepresentation__opaque, } = select$3();
3347
+ const { selections: PermissionSetsDetailsRepresentation__selections, opaque: PermissionSetsDetailsRepresentation__opaque, } = select$2();
3348
+ const { selections: ProfileDetailsRepresentation__selections, opaque: ProfileDetailsRepresentation__opaque, } = select$7();
3349
+ return {
3350
+ kind: 'Fragment',
3351
+ version: VERSION,
3352
+ private: [],
3353
+ selections: [
3354
+ {
3355
+ name: 'emailEncodings',
3356
+ kind: 'Object',
3357
+ plural: true,
3358
+ selections: EmailEncodingDetailsRepresentation__selections
3359
+ },
3360
+ {
3361
+ name: 'employeeStatuses',
3362
+ kind: 'Scalar',
3363
+ plural: true
3364
+ },
3365
+ {
3366
+ name: 'permissionSetGroups',
3367
+ kind: 'Object',
3368
+ plural: true,
3369
+ selections: PermissionSetGroupsDetailsRepresentation__selections,
3370
+ required: false
3371
+ },
3372
+ {
3373
+ name: 'permissionSets',
3374
+ kind: 'Object',
3375
+ plural: true,
3376
+ selections: PermissionSetsDetailsRepresentation__selections,
3377
+ required: false
3378
+ },
3379
+ {
3380
+ name: 'profiles',
3381
+ kind: 'Object',
3382
+ plural: true,
3383
+ selections: ProfileDetailsRepresentation__selections
3384
+ }
3385
+ ]
3386
+ };
3387
+ };
3388
+ function equals(existing, incoming) {
3389
+ const existing_emailEncodings = existing.emailEncodings;
3390
+ const incoming_emailEncodings = incoming.emailEncodings;
3391
+ const equals_emailEncodings_items = equalsArray(existing_emailEncodings, incoming_emailEncodings, (existing_emailEncodings_item, incoming_emailEncodings_item) => {
3392
+ if (!(equals$3(existing_emailEncodings_item, incoming_emailEncodings_item))) {
3393
+ return false;
3394
+ }
3395
+ });
3396
+ if (equals_emailEncodings_items === false) {
3397
+ return false;
3398
+ }
3399
+ const existing_employeeStatuses = existing.employeeStatuses;
3400
+ const incoming_employeeStatuses = incoming.employeeStatuses;
3401
+ const equals_employeeStatuses_items = equalsArray(existing_employeeStatuses, incoming_employeeStatuses, (existing_employeeStatuses_item, incoming_employeeStatuses_item) => {
3402
+ if (!(existing_employeeStatuses_item === incoming_employeeStatuses_item)) {
3403
+ return false;
3404
+ }
3405
+ });
3406
+ if (equals_employeeStatuses_items === false) {
3407
+ return false;
3408
+ }
3409
+ const existing_permissionSetGroups = existing.permissionSetGroups;
3410
+ const incoming_permissionSetGroups = incoming.permissionSetGroups;
3411
+ // if at least one of these optionals is defined
3412
+ if (existing_permissionSetGroups !== undefined || incoming_permissionSetGroups !== undefined) {
3413
+ // if one of these is not defined we know the other is defined and therefore
3414
+ // not equal
3415
+ if (existing_permissionSetGroups === undefined || incoming_permissionSetGroups === undefined) {
3416
+ return false;
3417
+ }
3418
+ const equals_permissionSetGroups_items = equalsArray(existing_permissionSetGroups, incoming_permissionSetGroups, (existing_permissionSetGroups_item, incoming_permissionSetGroups_item) => {
3419
+ if (!(equals$2(existing_permissionSetGroups_item, incoming_permissionSetGroups_item))) {
3420
+ return false;
3421
+ }
3422
+ });
3423
+ if (equals_permissionSetGroups_items === false) {
3424
+ return false;
3425
+ }
3426
+ }
3427
+ const existing_permissionSets = existing.permissionSets;
3428
+ const incoming_permissionSets = incoming.permissionSets;
3429
+ // if at least one of these optionals is defined
3430
+ if (existing_permissionSets !== undefined || incoming_permissionSets !== undefined) {
3431
+ // if one of these is not defined we know the other is defined and therefore
3432
+ // not equal
3433
+ if (existing_permissionSets === undefined || incoming_permissionSets === undefined) {
3434
+ return false;
3435
+ }
3436
+ const equals_permissionSets_items = equalsArray(existing_permissionSets, incoming_permissionSets, (existing_permissionSets_item, incoming_permissionSets_item) => {
3437
+ if (!(equals$1(existing_permissionSets_item, incoming_permissionSets_item))) {
3438
+ return false;
3439
+ }
3440
+ });
3441
+ if (equals_permissionSets_items === false) {
3442
+ return false;
3443
+ }
3444
+ }
3445
+ const existing_profiles = existing.profiles;
3446
+ const incoming_profiles = incoming.profiles;
3447
+ const equals_profiles_items = equalsArray(existing_profiles, incoming_profiles, (existing_profiles_item, incoming_profiles_item) => {
3448
+ if (!(equals$5(existing_profiles_item, incoming_profiles_item))) {
3449
+ return false;
3450
+ }
3451
+ });
3452
+ if (equals_profiles_items === false) {
3453
+ return false;
3454
+ }
3455
+ return true;
3456
+ }
3457
+ const ingest = function AvailableUserOptionsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
3458
+ if (process.env.NODE_ENV !== 'production') {
3459
+ const validateError = validate(input);
3460
+ if (validateError !== null) {
3461
+ throw validateError;
3462
+ }
3463
+ }
3464
+ const key = path.fullPath;
3465
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
3466
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "Service-employee", VERSION, RepresentationType, equals);
3467
+ return createLink(key);
3468
+ };
3469
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
3470
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3471
+ const rootKey = fullPathFactory();
3472
+ rootKeySet.set(rootKey, {
3473
+ namespace: keyPrefix,
3474
+ representationName: RepresentationType,
3475
+ mergeable: false
3476
+ });
3477
+ }
3478
+
3479
+ function select(luvio, params) {
3480
+ return select$1();
3481
+ }
3482
+ function keyBuilder$1(luvio, params) {
3483
+ var _a, _b, _c, _d;
3484
+ return keyPrefix + '::AvailableUserOptionsOutputRepresentation:(' + (((_a = params.body.permissionSets) === null || _a === void 0 ? void 0 : _a.licenses) === undefined ? 'permissionSets.licenses' : 'permissionSets.licenses:' + ((_b = params.body.permissionSets) === null || _b === void 0 ? void 0 : _b.licenses)) + '::' + (((_c = params.body.profiles) === null || _c === void 0 ? void 0 : _c.licenses) === undefined ? 'profiles.licenses' : 'profiles.licenses:' + ((_d = params.body.profiles) === null || _d === void 0 ? void 0 : _d.licenses)) + ')';
3485
+ }
3486
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
3487
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
3488
+ }
3489
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
3490
+ const { body } = response;
3491
+ const key = keyBuilder$1(luvio, resourceParams);
3492
+ luvio.storeIngest(key, ingest, body);
3493
+ const snapshot = luvio.storeLookup({
3494
+ recordId: key,
3495
+ node: select(),
3496
+ variables: {},
3497
+ }, snapshotRefresh);
3498
+ if (process.env.NODE_ENV !== 'production') {
3499
+ if (snapshot.state !== 'Fulfilled') {
3500
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3501
+ }
3502
+ }
3503
+ deepFreeze(snapshot.data);
3504
+ return snapshot;
3505
+ }
3506
+ function ingestError(luvio, params, error, snapshotRefresh) {
3507
+ const key = keyBuilder$1(luvio, params);
3508
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3509
+ luvio.storeIngestError(key, errorSnapshot);
3510
+ return errorSnapshot;
3511
+ }
3512
+ function createResourceRequest(config) {
3513
+ const headers = {};
3514
+ return {
3515
+ baseUri: '/services/data/v66.0',
3516
+ basePath: '/connect/serviceEmployee/availableUserOptions',
3517
+ method: 'post',
3518
+ body: config.body,
3519
+ urlParams: {},
3520
+ queryParams: {},
3521
+ headers,
3522
+ priority: 'normal',
3523
+ };
3524
+ }
3525
+
3526
+ const adapterName = 'availableUserOptions';
3527
+ const availableUserOptions_ConfigPropertyMetadata = [
3528
+ generateParamConfigMetadata('permissionSets', false, 2 /* Body */, 4 /* Unsupported */),
3529
+ generateParamConfigMetadata('profiles', false, 2 /* Body */, 4 /* Unsupported */),
3530
+ ];
3531
+ const availableUserOptions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, availableUserOptions_ConfigPropertyMetadata);
3532
+ const createResourceParams = /*#__PURE__*/ createResourceParams$7(availableUserOptions_ConfigPropertyMetadata);
3533
+ function keyBuilder(luvio, config) {
3534
+ const resourceParams = createResourceParams(config);
3535
+ return keyBuilder$1(luvio, resourceParams);
3536
+ }
3537
+ function typeCheckConfig(untrustedConfig) {
3538
+ const config = {};
3539
+ const untrustedConfig_permissionSets = untrustedConfig.permissionSets;
3540
+ const referencePermissionSetsInputRepresentationValidationError = validate$5(untrustedConfig_permissionSets);
3541
+ if (referencePermissionSetsInputRepresentationValidationError === null) {
3542
+ config.permissionSets = untrustedConfig_permissionSets;
3543
+ }
3544
+ const untrustedConfig_profiles = untrustedConfig.profiles;
3545
+ const referenceLicenseDetailsInputRepresentationValidationError = validate$4(untrustedConfig_profiles);
3546
+ if (referenceLicenseDetailsInputRepresentationValidationError === null) {
3547
+ config.profiles = untrustedConfig_profiles;
3548
+ }
3549
+ return config;
3550
+ }
3551
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
3552
+ if (!untrustedIsObject(untrustedConfig)) {
3553
+ return null;
3554
+ }
3555
+ if (process.env.NODE_ENV !== 'production') {
3556
+ validateConfig(untrustedConfig, configPropertyNames);
3557
+ }
3558
+ const config = typeCheckConfig(untrustedConfig);
3559
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3560
+ return null;
3561
+ }
3562
+ return config;
3563
+ }
3564
+ function adapterFragment(luvio, config) {
3565
+ createResourceParams(config);
3566
+ return select();
3567
+ }
3568
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
3569
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
3570
+ config,
3571
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
3572
+ });
3573
+ return luvio.storeBroadcast().then(() => snapshot);
3574
+ }
3575
+ function onFetchResponseError(luvio, config, resourceParams, response) {
3576
+ const snapshot = ingestError(luvio, resourceParams, response, {
3577
+ config,
3578
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
3579
+ });
3580
+ return luvio.storeBroadcast().then(() => snapshot);
3581
+ }
3582
+ function buildNetworkSnapshot(luvio, config, options) {
3583
+ const resourceParams = createResourceParams(config);
3584
+ const request = createResourceRequest(resourceParams);
3585
+ return luvio.dispatchResourceRequest(request, options)
3586
+ .then((response) => {
3587
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
3588
+ const cache = new StoreKeyMap();
3589
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
3590
+ return cache;
3591
+ });
3592
+ }, (response) => {
3593
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
3594
+ });
3595
+ }
3596
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
3597
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
3598
+ }
3599
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
3600
+ const { luvio, config } = context;
3601
+ const selector = {
3602
+ recordId: keyBuilder(luvio, config),
3603
+ node: adapterFragment(luvio, config),
3604
+ variables: {},
3605
+ };
3606
+ const cacheSnapshot = storeLookup(selector, {
3607
+ config,
3608
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
3609
+ });
3610
+ return cacheSnapshot;
3611
+ }
3612
+ const availableUserOptionsAdapterFactory = (luvio) => function serviceEmployee__availableUserOptions(untrustedConfig, requestContext) {
3613
+ const config = validateAdapterConfig(untrustedConfig, availableUserOptions_ConfigPropertyNames);
3614
+ // Invalid or incomplete config
3615
+ if (config === null) {
3616
+ return null;
3617
+ }
3618
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3619
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
3620
+ };
3621
+
3622
+ export { availableUserOptionsAdapterFactory, getEmpEnablementProgramsAdapterFactory, getFieldDetailsFromCompactLayoutAdapterFactory, getUserProfileDetailsAdapterFactory, getUserSettingsAdapterFactory, postEmployeeUserProvisioningJobAdapterFactory, updateUserSettingsAdapterFactory };