@salesforce/lds-adapters-sales-enablement-program 1.124.2 → 1.124.3

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 (68) hide show
  1. package/dist/es/es2018/sales-enablement-program.js +1553 -1553
  2. package/dist/{types → es/es2018/types}/src/generated/adapters/adapter-utils.d.ts +66 -66
  3. package/dist/{types → es/es2018/types}/src/generated/adapters/getProgramTemplate.d.ts +26 -26
  4. package/dist/{types → es/es2018/types}/src/generated/adapters/getProgramTemplates.d.ts +25 -25
  5. package/dist/{types → es/es2018/types}/src/generated/artifacts/main.d.ts +2 -2
  6. package/dist/{types → es/es2018/types}/src/generated/artifacts/sfdc.d.ts +5 -5
  7. package/dist/{types → es/es2018/types}/src/generated/resources/deleteConnectEnablementMeasure.d.ts +8 -8
  8. package/dist/{types → es/es2018/types}/src/generated/resources/deleteConnectEnablementMeasureByMeasureId.d.ts +11 -11
  9. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectEnablementMeasure.d.ts +12 -12
  10. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectEnablementMeasureByMeasureId.d.ts +15 -15
  11. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectEnablementMeasureCloneActionBySourceMeasureId.d.ts +15 -15
  12. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectEnablementProgramByEnablementProgramId.d.ts +15 -15
  13. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectEnablementProgramDescribeByEnablementProgramId.d.ts +15 -15
  14. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectEnablementProgramSummaryAssigned.d.ts +12 -12
  15. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectEnablementProgramSummaryByEnablementProgramId.d.ts +15 -15
  16. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectEnablementProgramTemplate.d.ts +12 -12
  17. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectEnablementProgramTemplateByProgramTemplateName.d.ts +15 -15
  18. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectEnablementProgramsDescribeByEnablementProgramId.d.ts +15 -15
  19. package/dist/{types → es/es2018/types}/src/generated/resources/patchConnectEnablementMeasure.d.ts +10 -10
  20. package/dist/{types → es/es2018/types}/src/generated/resources/patchConnectEnablementMeasureByMeasureId.d.ts +13 -13
  21. package/dist/{types → es/es2018/types}/src/generated/resources/patchConnectEnablementProgram.d.ts +14 -14
  22. package/dist/{types → es/es2018/types}/src/generated/resources/patchConnectEnablementPrograms.d.ts +14 -14
  23. package/dist/{types → es/es2018/types}/src/generated/resources/patchConnectEnablementProgramsByEnablementProgramId.d.ts +17 -17
  24. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectEnablementMeasure.d.ts +20 -20
  25. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectEnablementMeasureByMeasureId.d.ts +23 -23
  26. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectEnablementProgram.d.ts +17 -17
  27. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectEnablementProgramStatus.d.ts +13 -13
  28. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectEnablementProgramStatusByEnablementProgramId.d.ts +16 -16
  29. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectEnablementPrograms.d.ts +17 -17
  30. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectEnablementProgramsByEnablementProgramId.d.ts +20 -20
  31. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectEnablementProgramsStatus.d.ts +13 -13
  32. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectEnablementProgramsStatusByEnablementProgramId.d.ts +16 -16
  33. package/dist/{types → es/es2018/types}/src/generated/resources/putConnectEnablementMeasure.d.ts +17 -17
  34. package/dist/{types → es/es2018/types}/src/generated/resources/putConnectEnablementMeasureByMeasureId.d.ts +20 -20
  35. package/dist/{types → es/es2018/types}/src/generated/types/AbstractEnablementProgramRepresentation.d.ts +49 -49
  36. package/dist/{types → es/es2018/types}/src/generated/types/AbstractEnablementProgramTaskRepresentation.d.ts +95 -95
  37. package/dist/{types → es/es2018/types}/src/generated/types/EnablementMeasureFilterInputRepresentation.d.ts +41 -41
  38. package/dist/{types → es/es2018/types}/src/generated/types/EnablementMeasureFilterRepresentation.d.ts +41 -41
  39. package/dist/{types → es/es2018/types}/src/generated/types/EnablementMeasureIdRepresentation.d.ts +29 -29
  40. package/dist/{types → es/es2018/types}/src/generated/types/EnablementMeasureInputRepresentation.d.ts +53 -53
  41. package/dist/{types → es/es2018/types}/src/generated/types/EnablementMeasureObjectInputRepresentation.d.ts +50 -50
  42. package/dist/{types → es/es2018/types}/src/generated/types/EnablementMeasureObjectRepresentation.d.ts +51 -51
  43. package/dist/{types → es/es2018/types}/src/generated/types/EnablementMeasureRepresentation.d.ts +63 -63
  44. package/dist/{types → es/es2018/types}/src/generated/types/EnablementMeasureStatusInputRepresentation.d.ts +32 -32
  45. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramInputRepresentation.d.ts +44 -44
  46. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramRepresentation.d.ts +56 -56
  47. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramRuntimeRepresentation.d.ts +64 -64
  48. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramRuntimeTaskRepresentation.d.ts +107 -107
  49. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramSectionInputRepresentation.d.ts +44 -44
  50. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramSectionRepresentation.d.ts +42 -42
  51. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramStatusRepresentation.d.ts +32 -32
  52. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramStatusUpdateInputRepresentation.d.ts +32 -32
  53. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramSummaryItemRepresentation.d.ts +47 -47
  54. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramSummaryListRepresentation.d.ts +30 -30
  55. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramSummaryRepresentation.d.ts +52 -52
  56. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramSummarySectionRepresentation.d.ts +32 -32
  57. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramSummaryTaskRepresentation.d.ts +64 -64
  58. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramTaskInputRepresentation.d.ts +77 -77
  59. package/dist/{types → es/es2018/types}/src/generated/types/EnablementProgramTaskRepresentation.d.ts +96 -96
  60. package/dist/{types → es/es2018/types}/src/generated/types/ProgramTaskWarningRepresentation.d.ts +35 -35
  61. package/dist/{types → es/es2018/types}/src/generated/types/ProgramTemplateInfoRepresentation.d.ts +35 -35
  62. package/dist/{types → es/es2018/types}/src/generated/types/ProgramTemplateListRepresentation.d.ts +31 -31
  63. package/dist/{types → es/es2018/types}/src/generated/types/type-utils.d.ts +39 -39
  64. package/package.json +5 -5
  65. package/sfdc/index.d.ts +1 -1
  66. package/sfdc/index.js +1581 -1581
  67. package/dist/umd/es2018/sales-enablement-program.js +0 -1593
  68. package/dist/umd/es5/sales-enablement-program.js +0 -1598
@@ -6,1579 +6,1579 @@
6
6
 
7
7
  import { serializeStructuredKey, StoreKeyMap } from '@luvio/engine';
8
8
 
9
- const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
- const { keys: ObjectKeys, freeze: ObjectFreeze, 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
- };
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys, freeze: ObjectFreeze, 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
51
  const keyPrefix = 'enablement-program';
52
52
 
53
- const { isArray: ArrayIsArray } = Array;
54
- const { stringify: JSONStringify } = JSON;
55
- function equalsArray(a, b, equalsItem) {
56
- const aLength = a.length;
57
- const bLength = b.length;
58
- if (aLength !== bLength) {
59
- return false;
60
- }
61
- for (let i = 0; i < aLength; i++) {
62
- if (equalsItem(a[i], b[i]) === false) {
63
- return false;
64
- }
65
- }
66
- return true;
67
- }
68
- function createLink(ref) {
69
- return {
70
- __ref: serializeStructuredKey(ref),
71
- };
53
+ const { isArray: ArrayIsArray } = Array;
54
+ const { stringify: JSONStringify } = JSON;
55
+ function equalsArray(a, b, equalsItem) {
56
+ const aLength = a.length;
57
+ const bLength = b.length;
58
+ if (aLength !== bLength) {
59
+ return false;
60
+ }
61
+ for (let i = 0; i < aLength; i++) {
62
+ if (equalsItem(a[i], b[i]) === false) {
63
+ return false;
64
+ }
65
+ }
66
+ return true;
67
+ }
68
+ function createLink(ref) {
69
+ return {
70
+ __ref: serializeStructuredKey(ref),
71
+ };
72
72
  }
73
73
 
74
- const VERSION$4 = "49baef9cf75c51988988655e614683e0";
75
- function validate$4(obj, path = 'ProgramTemplateInfoRepresentation') {
76
- const v_error = (() => {
77
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
78
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
79
- }
80
- const obj_developerName = obj.developerName;
81
- const path_developerName = path + '.developerName';
82
- if (typeof obj_developerName !== 'string') {
83
- return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
84
- }
85
- const obj_iconUrl = obj.iconUrl;
86
- const path_iconUrl = path + '.iconUrl';
87
- if (typeof obj_iconUrl !== 'string') {
88
- return new TypeError('Expected "string" but received "' + typeof obj_iconUrl + '" (at "' + path_iconUrl + '")');
89
- }
90
- const obj_label = obj.label;
91
- const path_label = path + '.label';
92
- if (typeof obj_label !== 'string') {
93
- return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
94
- }
95
- })();
96
- return v_error === undefined ? null : v_error;
97
- }
98
- const select$6 = function ProgramTemplateInfoRepresentationSelect() {
99
- return {
100
- kind: 'Fragment',
101
- version: VERSION$4,
102
- private: [],
103
- selections: [
104
- {
105
- name: 'developerName',
106
- kind: 'Scalar'
107
- },
108
- {
109
- name: 'iconUrl',
110
- kind: 'Scalar'
111
- },
112
- {
113
- name: 'label',
114
- kind: 'Scalar'
115
- }
116
- ]
117
- };
118
- };
119
- function equals$4(existing, incoming) {
120
- const existing_developerName = existing.developerName;
121
- const incoming_developerName = incoming.developerName;
122
- if (!(existing_developerName === incoming_developerName)) {
123
- return false;
124
- }
125
- const existing_iconUrl = existing.iconUrl;
126
- const incoming_iconUrl = incoming.iconUrl;
127
- if (!(existing_iconUrl === incoming_iconUrl)) {
128
- return false;
129
- }
130
- const existing_label = existing.label;
131
- const incoming_label = incoming.label;
132
- if (!(existing_label === incoming_label)) {
133
- return false;
134
- }
135
- return true;
74
+ const VERSION$4 = "49baef9cf75c51988988655e614683e0";
75
+ function validate$4(obj, path = 'ProgramTemplateInfoRepresentation') {
76
+ const v_error = (() => {
77
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
78
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
79
+ }
80
+ const obj_developerName = obj.developerName;
81
+ const path_developerName = path + '.developerName';
82
+ if (typeof obj_developerName !== 'string') {
83
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
84
+ }
85
+ const obj_iconUrl = obj.iconUrl;
86
+ const path_iconUrl = path + '.iconUrl';
87
+ if (typeof obj_iconUrl !== 'string') {
88
+ return new TypeError('Expected "string" but received "' + typeof obj_iconUrl + '" (at "' + path_iconUrl + '")');
89
+ }
90
+ const obj_label = obj.label;
91
+ const path_label = path + '.label';
92
+ if (typeof obj_label !== 'string') {
93
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
94
+ }
95
+ })();
96
+ return v_error === undefined ? null : v_error;
97
+ }
98
+ const select$6 = function ProgramTemplateInfoRepresentationSelect() {
99
+ return {
100
+ kind: 'Fragment',
101
+ version: VERSION$4,
102
+ private: [],
103
+ selections: [
104
+ {
105
+ name: 'developerName',
106
+ kind: 'Scalar'
107
+ },
108
+ {
109
+ name: 'iconUrl',
110
+ kind: 'Scalar'
111
+ },
112
+ {
113
+ name: 'label',
114
+ kind: 'Scalar'
115
+ }
116
+ ]
117
+ };
118
+ };
119
+ function equals$4(existing, incoming) {
120
+ const existing_developerName = existing.developerName;
121
+ const incoming_developerName = incoming.developerName;
122
+ if (!(existing_developerName === incoming_developerName)) {
123
+ return false;
124
+ }
125
+ const existing_iconUrl = existing.iconUrl;
126
+ const incoming_iconUrl = incoming.iconUrl;
127
+ if (!(existing_iconUrl === incoming_iconUrl)) {
128
+ return false;
129
+ }
130
+ const existing_label = existing.label;
131
+ const incoming_label = incoming.label;
132
+ if (!(existing_label === incoming_label)) {
133
+ return false;
134
+ }
135
+ return true;
136
136
  }
137
137
 
138
- const TTL$1 = 604800000;
139
- const VERSION$3 = "8872f2ed6b73d2c5ebf14059ff6642de";
140
- function validate$3(obj, path = 'ProgramTemplateListRepresentation') {
141
- const v_error = (() => {
142
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
143
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
144
- }
145
- const obj_programTemplateList = obj.programTemplateList;
146
- const path_programTemplateList = path + '.programTemplateList';
147
- if (!ArrayIsArray(obj_programTemplateList)) {
148
- return new TypeError('Expected "array" but received "' + typeof obj_programTemplateList + '" (at "' + path_programTemplateList + '")');
149
- }
150
- for (let i = 0; i < obj_programTemplateList.length; i++) {
151
- const obj_programTemplateList_item = obj_programTemplateList[i];
152
- const path_programTemplateList_item = path_programTemplateList + '[' + i + ']';
153
- const referencepath_programTemplateList_itemValidationError = validate$4(obj_programTemplateList_item, path_programTemplateList_item);
154
- if (referencepath_programTemplateList_itemValidationError !== null) {
155
- let message = 'Object doesn\'t match ProgramTemplateInfoRepresentation (at "' + path_programTemplateList_item + '")\n';
156
- message += referencepath_programTemplateList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
157
- return new TypeError(message);
158
- }
159
- }
160
- })();
161
- return v_error === undefined ? null : v_error;
162
- }
163
- const RepresentationType$1 = 'ProgramTemplateListRepresentation';
164
- function normalize$1(input, existing, path, luvio, store, timestamp) {
165
- return input;
166
- }
167
- const select$5 = function ProgramTemplateListRepresentationSelect() {
168
- const { selections: ProgramTemplateInfoRepresentation__selections, opaque: ProgramTemplateInfoRepresentation__opaque, } = select$6();
169
- return {
170
- kind: 'Fragment',
171
- version: VERSION$3,
172
- private: [],
173
- selections: [
174
- {
175
- name: 'programTemplateList',
176
- kind: 'Object',
177
- plural: true,
178
- selections: ProgramTemplateInfoRepresentation__selections
179
- }
180
- ]
181
- };
182
- };
183
- function equals$3(existing, incoming) {
184
- const existing_programTemplateList = existing.programTemplateList;
185
- const incoming_programTemplateList = incoming.programTemplateList;
186
- const equals_programTemplateList_items = equalsArray(existing_programTemplateList, incoming_programTemplateList, (existing_programTemplateList_item, incoming_programTemplateList_item) => {
187
- if (!(equals$4(existing_programTemplateList_item, incoming_programTemplateList_item))) {
188
- return false;
189
- }
190
- });
191
- if (equals_programTemplateList_items === false) {
192
- return false;
193
- }
194
- return true;
195
- }
196
- const ingest$1 = function ProgramTemplateListRepresentationIngest(input, path, luvio, store, timestamp) {
197
- if (process.env.NODE_ENV !== 'production') {
198
- const validateError = validate$3(input);
199
- if (validateError !== null) {
200
- throw validateError;
201
- }
202
- }
203
- const key = path.fullPath;
204
- const existingRecord = store.readEntry(key);
205
- const ttlToUse = TTL$1;
206
- let incomingRecord = normalize$1(input, store.readEntry(key), {
207
- fullPath: key,
208
- parent: path.parent,
209
- propertyName: path.propertyName,
210
- ttl: ttlToUse
211
- });
212
- if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
213
- luvio.storePublish(key, incomingRecord);
214
- }
215
- {
216
- const storeMetadataParams = {
217
- ttl: ttlToUse,
218
- namespace: "enablement-program",
219
- version: VERSION$3,
220
- representationName: RepresentationType$1,
221
- };
222
- luvio.publishStoreMetadata(key, storeMetadataParams);
223
- }
224
- return createLink(key);
225
- };
226
- function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
227
- const rootKeySet = new StoreKeyMap();
228
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
229
- const rootKey = fullPathFactory();
230
- rootKeySet.set(rootKey, {
231
- namespace: keyPrefix,
232
- representationName: RepresentationType$1,
233
- mergeable: false
234
- });
235
- return rootKeySet;
138
+ const TTL$1 = 604800000;
139
+ const VERSION$3 = "8872f2ed6b73d2c5ebf14059ff6642de";
140
+ function validate$3(obj, path = 'ProgramTemplateListRepresentation') {
141
+ const v_error = (() => {
142
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
143
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
144
+ }
145
+ const obj_programTemplateList = obj.programTemplateList;
146
+ const path_programTemplateList = path + '.programTemplateList';
147
+ if (!ArrayIsArray(obj_programTemplateList)) {
148
+ return new TypeError('Expected "array" but received "' + typeof obj_programTemplateList + '" (at "' + path_programTemplateList + '")');
149
+ }
150
+ for (let i = 0; i < obj_programTemplateList.length; i++) {
151
+ const obj_programTemplateList_item = obj_programTemplateList[i];
152
+ const path_programTemplateList_item = path_programTemplateList + '[' + i + ']';
153
+ const referencepath_programTemplateList_itemValidationError = validate$4(obj_programTemplateList_item, path_programTemplateList_item);
154
+ if (referencepath_programTemplateList_itemValidationError !== null) {
155
+ let message = 'Object doesn\'t match ProgramTemplateInfoRepresentation (at "' + path_programTemplateList_item + '")\n';
156
+ message += referencepath_programTemplateList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
157
+ return new TypeError(message);
158
+ }
159
+ }
160
+ })();
161
+ return v_error === undefined ? null : v_error;
162
+ }
163
+ const RepresentationType$1 = 'ProgramTemplateListRepresentation';
164
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
165
+ return input;
166
+ }
167
+ const select$5 = function ProgramTemplateListRepresentationSelect() {
168
+ const { selections: ProgramTemplateInfoRepresentation__selections, opaque: ProgramTemplateInfoRepresentation__opaque, } = select$6();
169
+ return {
170
+ kind: 'Fragment',
171
+ version: VERSION$3,
172
+ private: [],
173
+ selections: [
174
+ {
175
+ name: 'programTemplateList',
176
+ kind: 'Object',
177
+ plural: true,
178
+ selections: ProgramTemplateInfoRepresentation__selections
179
+ }
180
+ ]
181
+ };
182
+ };
183
+ function equals$3(existing, incoming) {
184
+ const existing_programTemplateList = existing.programTemplateList;
185
+ const incoming_programTemplateList = incoming.programTemplateList;
186
+ const equals_programTemplateList_items = equalsArray(existing_programTemplateList, incoming_programTemplateList, (existing_programTemplateList_item, incoming_programTemplateList_item) => {
187
+ if (!(equals$4(existing_programTemplateList_item, incoming_programTemplateList_item))) {
188
+ return false;
189
+ }
190
+ });
191
+ if (equals_programTemplateList_items === false) {
192
+ return false;
193
+ }
194
+ return true;
195
+ }
196
+ const ingest$1 = function ProgramTemplateListRepresentationIngest(input, path, luvio, store, timestamp) {
197
+ if (process.env.NODE_ENV !== 'production') {
198
+ const validateError = validate$3(input);
199
+ if (validateError !== null) {
200
+ throw validateError;
201
+ }
202
+ }
203
+ const key = path.fullPath;
204
+ const existingRecord = store.readEntry(key);
205
+ const ttlToUse = TTL$1;
206
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
207
+ fullPath: key,
208
+ parent: path.parent,
209
+ propertyName: path.propertyName,
210
+ ttl: ttlToUse
211
+ });
212
+ if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
213
+ luvio.storePublish(key, incomingRecord);
214
+ }
215
+ {
216
+ const storeMetadataParams = {
217
+ ttl: ttlToUse,
218
+ namespace: "enablement-program",
219
+ version: VERSION$3,
220
+ representationName: RepresentationType$1,
221
+ };
222
+ luvio.publishStoreMetadata(key, storeMetadataParams);
223
+ }
224
+ return createLink(key);
225
+ };
226
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
227
+ const rootKeySet = new StoreKeyMap();
228
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
229
+ const rootKey = fullPathFactory();
230
+ rootKeySet.set(rootKey, {
231
+ namespace: keyPrefix,
232
+ representationName: RepresentationType$1,
233
+ mergeable: false
234
+ });
235
+ return rootKeySet;
236
236
  }
237
237
 
238
- function select$4(luvio, params) {
239
- return select$5();
240
- }
241
- function keyBuilder$3(luvio, params) {
242
- return keyPrefix + '::ProgramTemplateListRepresentation:(' + ')';
243
- }
244
- function getResponseCacheKeys$1(luvio, resourceParams, response) {
245
- return getTypeCacheKeys$1(luvio, response, () => keyBuilder$3());
246
- }
247
- function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
248
- const { body } = response;
249
- const key = keyBuilder$3();
250
- luvio.storeIngest(key, ingest$1, body);
251
- const snapshot = luvio.storeLookup({
252
- recordId: key,
253
- node: select$4(),
254
- variables: {},
255
- }, snapshotRefresh);
256
- if (process.env.NODE_ENV !== 'production') {
257
- if (snapshot.state !== 'Fulfilled') {
258
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
259
- }
260
- }
261
- return snapshot;
262
- }
263
- function ingestError$1(luvio, params, error, snapshotRefresh) {
264
- const key = keyBuilder$3();
265
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
266
- const storeMetadataParams = {
267
- ttl: TTL$1,
268
- namespace: keyPrefix,
269
- version: VERSION$3,
270
- representationName: RepresentationType$1
271
- };
272
- luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
273
- return errorSnapshot;
274
- }
275
- function createResourceRequest$1(config) {
276
- const headers = {};
277
- return {
278
- baseUri: '/services/data/v58.0',
279
- basePath: '/connect/enablement/programTemplate',
280
- method: 'get',
281
- body: null,
282
- urlParams: {},
283
- queryParams: {},
284
- headers,
285
- priority: 'normal',
286
- };
238
+ function select$4(luvio, params) {
239
+ return select$5();
240
+ }
241
+ function keyBuilder$3(luvio, params) {
242
+ return keyPrefix + '::ProgramTemplateListRepresentation:(' + ')';
243
+ }
244
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
245
+ return getTypeCacheKeys$1(luvio, response, () => keyBuilder$3());
246
+ }
247
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
248
+ const { body } = response;
249
+ const key = keyBuilder$3();
250
+ luvio.storeIngest(key, ingest$1, body);
251
+ const snapshot = luvio.storeLookup({
252
+ recordId: key,
253
+ node: select$4(),
254
+ variables: {},
255
+ }, snapshotRefresh);
256
+ if (process.env.NODE_ENV !== 'production') {
257
+ if (snapshot.state !== 'Fulfilled') {
258
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
259
+ }
260
+ }
261
+ return snapshot;
262
+ }
263
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
264
+ const key = keyBuilder$3();
265
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
266
+ const storeMetadataParams = {
267
+ ttl: TTL$1,
268
+ namespace: keyPrefix,
269
+ version: VERSION$3,
270
+ representationName: RepresentationType$1
271
+ };
272
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
273
+ return errorSnapshot;
274
+ }
275
+ function createResourceRequest$1(config) {
276
+ const headers = {};
277
+ return {
278
+ baseUri: '/services/data/v58.0',
279
+ basePath: '/connect/enablement/programTemplate',
280
+ method: 'get',
281
+ body: null,
282
+ urlParams: {},
283
+ queryParams: {},
284
+ headers,
285
+ priority: 'normal',
286
+ };
287
287
  }
288
288
 
289
- const getProgramTemplates_ConfigPropertyNames = {
290
- displayName: 'getProgramTemplates',
291
- parameters: {
292
- required: [],
293
- optional: []
294
- }
295
- };
296
- function createResourceParams$1(config) {
297
- const resourceParams = {};
298
- return resourceParams;
299
- }
300
- function keyBuilder$2(luvio, config) {
301
- return keyBuilder$3();
302
- }
303
- function typeCheckConfig$1(untrustedConfig) {
304
- const config = {};
305
- return config;
306
- }
307
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
308
- if (!untrustedIsObject(untrustedConfig)) {
309
- return null;
310
- }
311
- if (process.env.NODE_ENV !== 'production') {
312
- validateConfig(untrustedConfig, configPropertyNames);
313
- }
314
- const config = typeCheckConfig$1();
315
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
316
- return null;
317
- }
318
- return config;
319
- }
320
- function adapterFragment$1(luvio, config) {
321
- return select$4();
322
- }
323
- function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
324
- const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
325
- config,
326
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
327
- });
328
- return luvio.storeBroadcast().then(() => snapshot);
329
- }
330
- function onFetchResponseError$1(luvio, config, resourceParams, response) {
331
- const snapshot = ingestError$1(luvio, resourceParams, response, {
332
- config,
333
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
334
- });
335
- return luvio.storeBroadcast().then(() => snapshot);
336
- }
337
- function buildNetworkSnapshot$1(luvio, config, options) {
338
- const resourceParams = createResourceParams$1();
339
- const request = createResourceRequest$1();
340
- return luvio.dispatchResourceRequest(request, options)
341
- .then((response) => {
342
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
343
- }, (response) => {
344
- return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
345
- });
346
- }
347
- function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
348
- const { luvio, config } = context;
349
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
350
- const dispatchOptions = {
351
- resourceRequestContext: {
352
- requestCorrelator,
353
- luvioRequestMethod: undefined,
354
- },
355
- eventObservers
356
- };
357
- if (networkPriority !== 'normal') {
358
- dispatchOptions.overrides = {
359
- priority: networkPriority
360
- };
361
- }
362
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
363
- }
364
- function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
365
- const { luvio, config } = context;
366
- const selector = {
367
- recordId: keyBuilder$2(),
368
- node: adapterFragment$1(),
369
- variables: {},
370
- };
371
- const cacheSnapshot = storeLookup(selector, {
372
- config,
373
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
374
- });
375
- return cacheSnapshot;
376
- }
377
- const getProgramTemplatesAdapterFactory = (luvio) => function enablementProgram__getProgramTemplates(untrustedConfig, requestContext) {
378
- const config = validateAdapterConfig$1(untrustedConfig, getProgramTemplates_ConfigPropertyNames);
379
- // Invalid or incomplete config
380
- if (config === null) {
381
- return null;
382
- }
383
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
384
- buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
289
+ const getProgramTemplates_ConfigPropertyNames = {
290
+ displayName: 'getProgramTemplates',
291
+ parameters: {
292
+ required: [],
293
+ optional: []
294
+ }
295
+ };
296
+ function createResourceParams$1(config) {
297
+ const resourceParams = {};
298
+ return resourceParams;
299
+ }
300
+ function keyBuilder$2(luvio, config) {
301
+ return keyBuilder$3();
302
+ }
303
+ function typeCheckConfig$1(untrustedConfig) {
304
+ const config = {};
305
+ return config;
306
+ }
307
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
308
+ if (!untrustedIsObject(untrustedConfig)) {
309
+ return null;
310
+ }
311
+ if (process.env.NODE_ENV !== 'production') {
312
+ validateConfig(untrustedConfig, configPropertyNames);
313
+ }
314
+ const config = typeCheckConfig$1();
315
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
316
+ return null;
317
+ }
318
+ return config;
319
+ }
320
+ function adapterFragment$1(luvio, config) {
321
+ return select$4();
322
+ }
323
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
324
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
325
+ config,
326
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
327
+ });
328
+ return luvio.storeBroadcast().then(() => snapshot);
329
+ }
330
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
331
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
332
+ config,
333
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
334
+ });
335
+ return luvio.storeBroadcast().then(() => snapshot);
336
+ }
337
+ function buildNetworkSnapshot$1(luvio, config, options) {
338
+ const resourceParams = createResourceParams$1();
339
+ const request = createResourceRequest$1();
340
+ return luvio.dispatchResourceRequest(request, options)
341
+ .then((response) => {
342
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
343
+ }, (response) => {
344
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
345
+ });
346
+ }
347
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
348
+ const { luvio, config } = context;
349
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
350
+ const dispatchOptions = {
351
+ resourceRequestContext: {
352
+ requestCorrelator,
353
+ luvioRequestMethod: undefined,
354
+ },
355
+ eventObservers
356
+ };
357
+ if (networkPriority !== 'normal') {
358
+ dispatchOptions.overrides = {
359
+ priority: networkPriority
360
+ };
361
+ }
362
+ return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
363
+ }
364
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
365
+ const { luvio, config } = context;
366
+ const selector = {
367
+ recordId: keyBuilder$2(),
368
+ node: adapterFragment$1(),
369
+ variables: {},
370
+ };
371
+ const cacheSnapshot = storeLookup(selector, {
372
+ config,
373
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
374
+ });
375
+ return cacheSnapshot;
376
+ }
377
+ const getProgramTemplatesAdapterFactory = (luvio) => function enablementProgram__getProgramTemplates(untrustedConfig, requestContext) {
378
+ const config = validateAdapterConfig$1(untrustedConfig, getProgramTemplates_ConfigPropertyNames);
379
+ // Invalid or incomplete config
380
+ if (config === null) {
381
+ return null;
382
+ }
383
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
384
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
385
385
  };
386
386
 
387
- const VERSION$2 = "d0d53cd500692d4a3a54a68f8fd5a349";
388
- function validate$2(obj, path = 'AbstractEnablementProgramTaskRepresentation') {
389
- const v_error = (() => {
390
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
391
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
392
- }
393
- const obj_contentType = obj.contentType;
394
- const path_contentType = path + '.contentType';
395
- let obj_contentType_union0 = null;
396
- const obj_contentType_union0_error = (() => {
397
- if (typeof obj_contentType !== 'string') {
398
- return new TypeError('Expected "string" but received "' + typeof obj_contentType + '" (at "' + path_contentType + '")');
399
- }
400
- })();
401
- if (obj_contentType_union0_error != null) {
402
- obj_contentType_union0 = obj_contentType_union0_error.message;
403
- }
404
- let obj_contentType_union1 = null;
405
- const obj_contentType_union1_error = (() => {
406
- if (obj_contentType !== null) {
407
- return new TypeError('Expected "null" but received "' + typeof obj_contentType + '" (at "' + path_contentType + '")');
408
- }
409
- })();
410
- if (obj_contentType_union1_error != null) {
411
- obj_contentType_union1 = obj_contentType_union1_error.message;
412
- }
413
- if (obj_contentType_union0 && obj_contentType_union1) {
414
- let message = 'Object doesn\'t match union (at "' + path_contentType + '")';
415
- message += '\n' + obj_contentType_union0.split('\n').map((line) => '\t' + line).join('\n');
416
- message += '\n' + obj_contentType_union1.split('\n').map((line) => '\t' + line).join('\n');
417
- return new TypeError(message);
418
- }
419
- const obj_description = obj.description;
420
- const path_description = path + '.description';
421
- if (typeof obj_description !== 'string') {
422
- return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
423
- }
424
- const obj_developerName = obj.developerName;
425
- const path_developerName = path + '.developerName';
426
- if (typeof obj_developerName !== 'string') {
427
- return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
428
- }
429
- const obj_durationCount = obj.durationCount;
430
- const path_durationCount = path + '.durationCount';
431
- let obj_durationCount_union0 = null;
432
- const obj_durationCount_union0_error = (() => {
433
- if (typeof obj_durationCount !== 'number' || (typeof obj_durationCount === 'number' && Math.floor(obj_durationCount) !== obj_durationCount)) {
434
- return new TypeError('Expected "integer" but received "' + typeof obj_durationCount + '" (at "' + path_durationCount + '")');
435
- }
436
- })();
437
- if (obj_durationCount_union0_error != null) {
438
- obj_durationCount_union0 = obj_durationCount_union0_error.message;
439
- }
440
- let obj_durationCount_union1 = null;
441
- const obj_durationCount_union1_error = (() => {
442
- if (obj_durationCount !== null) {
443
- return new TypeError('Expected "null" but received "' + typeof obj_durationCount + '" (at "' + path_durationCount + '")');
444
- }
445
- })();
446
- if (obj_durationCount_union1_error != null) {
447
- obj_durationCount_union1 = obj_durationCount_union1_error.message;
448
- }
449
- if (obj_durationCount_union0 && obj_durationCount_union1) {
450
- let message = 'Object doesn\'t match union (at "' + path_durationCount + '")';
451
- message += '\n' + obj_durationCount_union0.split('\n').map((line) => '\t' + line).join('\n');
452
- message += '\n' + obj_durationCount_union1.split('\n').map((line) => '\t' + line).join('\n');
453
- return new TypeError(message);
454
- }
455
- const obj_enablementProgramSectionId = obj.enablementProgramSectionId;
456
- const path_enablementProgramSectionId = path + '.enablementProgramSectionId';
457
- let obj_enablementProgramSectionId_union0 = null;
458
- const obj_enablementProgramSectionId_union0_error = (() => {
459
- if (typeof obj_enablementProgramSectionId !== 'string') {
460
- return new TypeError('Expected "string" but received "' + typeof obj_enablementProgramSectionId + '" (at "' + path_enablementProgramSectionId + '")');
461
- }
462
- })();
463
- if (obj_enablementProgramSectionId_union0_error != null) {
464
- obj_enablementProgramSectionId_union0 = obj_enablementProgramSectionId_union0_error.message;
465
- }
466
- let obj_enablementProgramSectionId_union1 = null;
467
- const obj_enablementProgramSectionId_union1_error = (() => {
468
- if (obj_enablementProgramSectionId !== null) {
469
- return new TypeError('Expected "null" but received "' + typeof obj_enablementProgramSectionId + '" (at "' + path_enablementProgramSectionId + '")');
470
- }
471
- })();
472
- if (obj_enablementProgramSectionId_union1_error != null) {
473
- obj_enablementProgramSectionId_union1 = obj_enablementProgramSectionId_union1_error.message;
474
- }
475
- if (obj_enablementProgramSectionId_union0 && obj_enablementProgramSectionId_union1) {
476
- let message = 'Object doesn\'t match union (at "' + path_enablementProgramSectionId + '")';
477
- message += '\n' + obj_enablementProgramSectionId_union0.split('\n').map((line) => '\t' + line).join('\n');
478
- message += '\n' + obj_enablementProgramSectionId_union1.split('\n').map((line) => '\t' + line).join('\n');
479
- return new TypeError(message);
480
- }
481
- const obj_enablementRoomId = obj.enablementRoomId;
482
- const path_enablementRoomId = path + '.enablementRoomId';
483
- let obj_enablementRoomId_union0 = null;
484
- const obj_enablementRoomId_union0_error = (() => {
485
- if (typeof obj_enablementRoomId !== 'string') {
486
- return new TypeError('Expected "string" but received "' + typeof obj_enablementRoomId + '" (at "' + path_enablementRoomId + '")');
487
- }
488
- })();
489
- if (obj_enablementRoomId_union0_error != null) {
490
- obj_enablementRoomId_union0 = obj_enablementRoomId_union0_error.message;
491
- }
492
- let obj_enablementRoomId_union1 = null;
493
- const obj_enablementRoomId_union1_error = (() => {
494
- if (obj_enablementRoomId !== null) {
495
- return new TypeError('Expected "null" but received "' + typeof obj_enablementRoomId + '" (at "' + path_enablementRoomId + '")');
496
- }
497
- })();
498
- if (obj_enablementRoomId_union1_error != null) {
499
- obj_enablementRoomId_union1 = obj_enablementRoomId_union1_error.message;
500
- }
501
- if (obj_enablementRoomId_union0 && obj_enablementRoomId_union1) {
502
- let message = 'Object doesn\'t match union (at "' + path_enablementRoomId + '")';
503
- message += '\n' + obj_enablementRoomId_union0.split('\n').map((line) => '\t' + line).join('\n');
504
- message += '\n' + obj_enablementRoomId_union1.split('\n').map((line) => '\t' + line).join('\n');
505
- return new TypeError(message);
506
- }
507
- const obj_id = obj.id;
508
- const path_id = path + '.id';
509
- let obj_id_union0 = null;
510
- const obj_id_union0_error = (() => {
511
- if (typeof obj_id !== 'string') {
512
- return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
513
- }
514
- })();
515
- if (obj_id_union0_error != null) {
516
- obj_id_union0 = obj_id_union0_error.message;
517
- }
518
- let obj_id_union1 = null;
519
- const obj_id_union1_error = (() => {
520
- if (obj_id !== null) {
521
- return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
522
- }
523
- })();
524
- if (obj_id_union1_error != null) {
525
- obj_id_union1 = obj_id_union1_error.message;
526
- }
527
- if (obj_id_union0 && obj_id_union1) {
528
- let message = 'Object doesn\'t match union (at "' + path_id + '")';
529
- message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
530
- message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
531
- return new TypeError(message);
532
- }
533
- const obj_isMilestoneAnOutcome = obj.isMilestoneAnOutcome;
534
- const path_isMilestoneAnOutcome = path + '.isMilestoneAnOutcome';
535
- let obj_isMilestoneAnOutcome_union0 = null;
536
- const obj_isMilestoneAnOutcome_union0_error = (() => {
537
- if (typeof obj_isMilestoneAnOutcome !== 'boolean') {
538
- return new TypeError('Expected "boolean" but received "' + typeof obj_isMilestoneAnOutcome + '" (at "' + path_isMilestoneAnOutcome + '")');
539
- }
540
- })();
541
- if (obj_isMilestoneAnOutcome_union0_error != null) {
542
- obj_isMilestoneAnOutcome_union0 = obj_isMilestoneAnOutcome_union0_error.message;
543
- }
544
- let obj_isMilestoneAnOutcome_union1 = null;
545
- const obj_isMilestoneAnOutcome_union1_error = (() => {
546
- if (obj_isMilestoneAnOutcome !== null) {
547
- return new TypeError('Expected "null" but received "' + typeof obj_isMilestoneAnOutcome + '" (at "' + path_isMilestoneAnOutcome + '")');
548
- }
549
- })();
550
- if (obj_isMilestoneAnOutcome_union1_error != null) {
551
- obj_isMilestoneAnOutcome_union1 = obj_isMilestoneAnOutcome_union1_error.message;
552
- }
553
- if (obj_isMilestoneAnOutcome_union0 && obj_isMilestoneAnOutcome_union1) {
554
- let message = 'Object doesn\'t match union (at "' + path_isMilestoneAnOutcome + '")';
555
- message += '\n' + obj_isMilestoneAnOutcome_union0.split('\n').map((line) => '\t' + line).join('\n');
556
- message += '\n' + obj_isMilestoneAnOutcome_union1.split('\n').map((line) => '\t' + line).join('\n');
557
- return new TypeError(message);
558
- }
559
- const obj_learningItemDescription = obj.learningItemDescription;
560
- const path_learningItemDescription = path + '.learningItemDescription';
561
- let obj_learningItemDescription_union0 = null;
562
- const obj_learningItemDescription_union0_error = (() => {
563
- if (typeof obj_learningItemDescription !== 'string') {
564
- return new TypeError('Expected "string" but received "' + typeof obj_learningItemDescription + '" (at "' + path_learningItemDescription + '")');
565
- }
566
- })();
567
- if (obj_learningItemDescription_union0_error != null) {
568
- obj_learningItemDescription_union0 = obj_learningItemDescription_union0_error.message;
569
- }
570
- let obj_learningItemDescription_union1 = null;
571
- const obj_learningItemDescription_union1_error = (() => {
572
- if (obj_learningItemDescription !== null) {
573
- return new TypeError('Expected "null" but received "' + typeof obj_learningItemDescription + '" (at "' + path_learningItemDescription + '")');
574
- }
575
- })();
576
- if (obj_learningItemDescription_union1_error != null) {
577
- obj_learningItemDescription_union1 = obj_learningItemDescription_union1_error.message;
578
- }
579
- if (obj_learningItemDescription_union0 && obj_learningItemDescription_union1) {
580
- let message = 'Object doesn\'t match union (at "' + path_learningItemDescription + '")';
581
- message += '\n' + obj_learningItemDescription_union0.split('\n').map((line) => '\t' + line).join('\n');
582
- message += '\n' + obj_learningItemDescription_union1.split('\n').map((line) => '\t' + line).join('\n');
583
- return new TypeError(message);
584
- }
585
- const obj_learningItemIconUrl = obj.learningItemIconUrl;
586
- const path_learningItemIconUrl = path + '.learningItemIconUrl';
587
- let obj_learningItemIconUrl_union0 = null;
588
- const obj_learningItemIconUrl_union0_error = (() => {
589
- if (typeof obj_learningItemIconUrl !== 'string') {
590
- return new TypeError('Expected "string" but received "' + typeof obj_learningItemIconUrl + '" (at "' + path_learningItemIconUrl + '")');
591
- }
592
- })();
593
- if (obj_learningItemIconUrl_union0_error != null) {
594
- obj_learningItemIconUrl_union0 = obj_learningItemIconUrl_union0_error.message;
595
- }
596
- let obj_learningItemIconUrl_union1 = null;
597
- const obj_learningItemIconUrl_union1_error = (() => {
598
- if (obj_learningItemIconUrl !== null) {
599
- return new TypeError('Expected "null" but received "' + typeof obj_learningItemIconUrl + '" (at "' + path_learningItemIconUrl + '")');
600
- }
601
- })();
602
- if (obj_learningItemIconUrl_union1_error != null) {
603
- obj_learningItemIconUrl_union1 = obj_learningItemIconUrl_union1_error.message;
604
- }
605
- if (obj_learningItemIconUrl_union0 && obj_learningItemIconUrl_union1) {
606
- let message = 'Object doesn\'t match union (at "' + path_learningItemIconUrl + '")';
607
- message += '\n' + obj_learningItemIconUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
608
- message += '\n' + obj_learningItemIconUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
609
- return new TypeError(message);
610
- }
611
- const obj_learningItemId = obj.learningItemId;
612
- const path_learningItemId = path + '.learningItemId';
613
- let obj_learningItemId_union0 = null;
614
- const obj_learningItemId_union0_error = (() => {
615
- if (typeof obj_learningItemId !== 'string') {
616
- return new TypeError('Expected "string" but received "' + typeof obj_learningItemId + '" (at "' + path_learningItemId + '")');
617
- }
618
- })();
619
- if (obj_learningItemId_union0_error != null) {
620
- obj_learningItemId_union0 = obj_learningItemId_union0_error.message;
621
- }
622
- let obj_learningItemId_union1 = null;
623
- const obj_learningItemId_union1_error = (() => {
624
- if (obj_learningItemId !== null) {
625
- return new TypeError('Expected "null" but received "' + typeof obj_learningItemId + '" (at "' + path_learningItemId + '")');
626
- }
627
- })();
628
- if (obj_learningItemId_union1_error != null) {
629
- obj_learningItemId_union1 = obj_learningItemId_union1_error.message;
630
- }
631
- if (obj_learningItemId_union0 && obj_learningItemId_union1) {
632
- let message = 'Object doesn\'t match union (at "' + path_learningItemId + '")';
633
- message += '\n' + obj_learningItemId_union0.split('\n').map((line) => '\t' + line).join('\n');
634
- message += '\n' + obj_learningItemId_union1.split('\n').map((line) => '\t' + line).join('\n');
635
- return new TypeError(message);
636
- }
637
- const obj_learningItemRelatedContentId = obj.learningItemRelatedContentId;
638
- const path_learningItemRelatedContentId = path + '.learningItemRelatedContentId';
639
- let obj_learningItemRelatedContentId_union0 = null;
640
- const obj_learningItemRelatedContentId_union0_error = (() => {
641
- if (typeof obj_learningItemRelatedContentId !== 'string') {
642
- return new TypeError('Expected "string" but received "' + typeof obj_learningItemRelatedContentId + '" (at "' + path_learningItemRelatedContentId + '")');
643
- }
644
- })();
645
- if (obj_learningItemRelatedContentId_union0_error != null) {
646
- obj_learningItemRelatedContentId_union0 = obj_learningItemRelatedContentId_union0_error.message;
647
- }
648
- let obj_learningItemRelatedContentId_union1 = null;
649
- const obj_learningItemRelatedContentId_union1_error = (() => {
650
- if (obj_learningItemRelatedContentId !== null) {
651
- return new TypeError('Expected "null" but received "' + typeof obj_learningItemRelatedContentId + '" (at "' + path_learningItemRelatedContentId + '")');
652
- }
653
- })();
654
- if (obj_learningItemRelatedContentId_union1_error != null) {
655
- obj_learningItemRelatedContentId_union1 = obj_learningItemRelatedContentId_union1_error.message;
656
- }
657
- if (obj_learningItemRelatedContentId_union0 && obj_learningItemRelatedContentId_union1) {
658
- let message = 'Object doesn\'t match union (at "' + path_learningItemRelatedContentId + '")';
659
- message += '\n' + obj_learningItemRelatedContentId_union0.split('\n').map((line) => '\t' + line).join('\n');
660
- message += '\n' + obj_learningItemRelatedContentId_union1.split('\n').map((line) => '\t' + line).join('\n');
661
- return new TypeError(message);
662
- }
663
- const obj_learningItemTitle = obj.learningItemTitle;
664
- const path_learningItemTitle = path + '.learningItemTitle';
665
- let obj_learningItemTitle_union0 = null;
666
- const obj_learningItemTitle_union0_error = (() => {
667
- if (typeof obj_learningItemTitle !== 'string') {
668
- return new TypeError('Expected "string" but received "' + typeof obj_learningItemTitle + '" (at "' + path_learningItemTitle + '")');
669
- }
670
- })();
671
- if (obj_learningItemTitle_union0_error != null) {
672
- obj_learningItemTitle_union0 = obj_learningItemTitle_union0_error.message;
673
- }
674
- let obj_learningItemTitle_union1 = null;
675
- const obj_learningItemTitle_union1_error = (() => {
676
- if (obj_learningItemTitle !== null) {
677
- return new TypeError('Expected "null" but received "' + typeof obj_learningItemTitle + '" (at "' + path_learningItemTitle + '")');
678
- }
679
- })();
680
- if (obj_learningItemTitle_union1_error != null) {
681
- obj_learningItemTitle_union1 = obj_learningItemTitle_union1_error.message;
682
- }
683
- if (obj_learningItemTitle_union0 && obj_learningItemTitle_union1) {
684
- let message = 'Object doesn\'t match union (at "' + path_learningItemTitle + '")';
685
- message += '\n' + obj_learningItemTitle_union0.split('\n').map((line) => '\t' + line).join('\n');
686
- message += '\n' + obj_learningItemTitle_union1.split('\n').map((line) => '\t' + line).join('\n');
687
- return new TypeError(message);
688
- }
689
- const obj_learningItemUrl = obj.learningItemUrl;
690
- const path_learningItemUrl = path + '.learningItemUrl';
691
- let obj_learningItemUrl_union0 = null;
692
- const obj_learningItemUrl_union0_error = (() => {
693
- if (typeof obj_learningItemUrl !== 'string') {
694
- return new TypeError('Expected "string" but received "' + typeof obj_learningItemUrl + '" (at "' + path_learningItemUrl + '")');
695
- }
696
- })();
697
- if (obj_learningItemUrl_union0_error != null) {
698
- obj_learningItemUrl_union0 = obj_learningItemUrl_union0_error.message;
699
- }
700
- let obj_learningItemUrl_union1 = null;
701
- const obj_learningItemUrl_union1_error = (() => {
702
- if (obj_learningItemUrl !== null) {
703
- return new TypeError('Expected "null" but received "' + typeof obj_learningItemUrl + '" (at "' + path_learningItemUrl + '")');
704
- }
705
- })();
706
- if (obj_learningItemUrl_union1_error != null) {
707
- obj_learningItemUrl_union1 = obj_learningItemUrl_union1_error.message;
708
- }
709
- if (obj_learningItemUrl_union0 && obj_learningItemUrl_union1) {
710
- let message = 'Object doesn\'t match union (at "' + path_learningItemUrl + '")';
711
- message += '\n' + obj_learningItemUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
712
- message += '\n' + obj_learningItemUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
713
- return new TypeError(message);
714
- }
715
- const obj_measureId = obj.measureId;
716
- const path_measureId = path + '.measureId';
717
- let obj_measureId_union0 = null;
718
- const obj_measureId_union0_error = (() => {
719
- if (typeof obj_measureId !== 'string') {
720
- return new TypeError('Expected "string" but received "' + typeof obj_measureId + '" (at "' + path_measureId + '")');
721
- }
722
- })();
723
- if (obj_measureId_union0_error != null) {
724
- obj_measureId_union0 = obj_measureId_union0_error.message;
725
- }
726
- let obj_measureId_union1 = null;
727
- const obj_measureId_union1_error = (() => {
728
- if (obj_measureId !== null) {
729
- return new TypeError('Expected "null" but received "' + typeof obj_measureId + '" (at "' + path_measureId + '")');
730
- }
731
- })();
732
- if (obj_measureId_union1_error != null) {
733
- obj_measureId_union1 = obj_measureId_union1_error.message;
734
- }
735
- if (obj_measureId_union0 && obj_measureId_union1) {
736
- let message = 'Object doesn\'t match union (at "' + path_measureId + '")';
737
- message += '\n' + obj_measureId_union0.split('\n').map((line) => '\t' + line).join('\n');
738
- message += '\n' + obj_measureId_union1.split('\n').map((line) => '\t' + line).join('\n');
739
- return new TypeError(message);
740
- }
741
- obj.milestoneTarget;
742
- const obj_minimumSampleSize = obj.minimumSampleSize;
743
- const path_minimumSampleSize = path + '.minimumSampleSize';
744
- let obj_minimumSampleSize_union0 = null;
745
- const obj_minimumSampleSize_union0_error = (() => {
746
- if (typeof obj_minimumSampleSize !== 'number' || (typeof obj_minimumSampleSize === 'number' && Math.floor(obj_minimumSampleSize) !== obj_minimumSampleSize)) {
747
- return new TypeError('Expected "integer" but received "' + typeof obj_minimumSampleSize + '" (at "' + path_minimumSampleSize + '")');
748
- }
749
- })();
750
- if (obj_minimumSampleSize_union0_error != null) {
751
- obj_minimumSampleSize_union0 = obj_minimumSampleSize_union0_error.message;
752
- }
753
- let obj_minimumSampleSize_union1 = null;
754
- const obj_minimumSampleSize_union1_error = (() => {
755
- if (obj_minimumSampleSize !== null) {
756
- return new TypeError('Expected "null" but received "' + typeof obj_minimumSampleSize + '" (at "' + path_minimumSampleSize + '")');
757
- }
758
- })();
759
- if (obj_minimumSampleSize_union1_error != null) {
760
- obj_minimumSampleSize_union1 = obj_minimumSampleSize_union1_error.message;
761
- }
762
- if (obj_minimumSampleSize_union0 && obj_minimumSampleSize_union1) {
763
- let message = 'Object doesn\'t match union (at "' + path_minimumSampleSize + '")';
764
- message += '\n' + obj_minimumSampleSize_union0.split('\n').map((line) => '\t' + line).join('\n');
765
- message += '\n' + obj_minimumSampleSize_union1.split('\n').map((line) => '\t' + line).join('\n');
766
- return new TypeError(message);
767
- }
768
- const obj_name = obj.name;
769
- const path_name = path + '.name';
770
- if (typeof obj_name !== 'string') {
771
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
772
- }
773
- const obj_programDay = obj.programDay;
774
- const path_programDay = path + '.programDay';
775
- if (typeof obj_programDay !== 'number' || (typeof obj_programDay === 'number' && Math.floor(obj_programDay) !== obj_programDay)) {
776
- return new TypeError('Expected "integer" but received "' + typeof obj_programDay + '" (at "' + path_programDay + '")');
777
- }
778
- const obj_sequenceNumber = obj.sequenceNumber;
779
- const path_sequenceNumber = path + '.sequenceNumber';
780
- if (typeof obj_sequenceNumber !== 'number' || (typeof obj_sequenceNumber === 'number' && Math.floor(obj_sequenceNumber) !== obj_sequenceNumber)) {
781
- return new TypeError('Expected "integer" but received "' + typeof obj_sequenceNumber + '" (at "' + path_sequenceNumber + '")');
782
- }
783
- const obj_taskCategory = obj.taskCategory;
784
- const path_taskCategory = path + '.taskCategory';
785
- if (typeof obj_taskCategory !== 'string') {
786
- return new TypeError('Expected "string" but received "' + typeof obj_taskCategory + '" (at "' + path_taskCategory + '")');
787
- }
788
- const obj_taskSubCategory = obj.taskSubCategory;
789
- const path_taskSubCategory = path + '.taskSubCategory';
790
- if (typeof obj_taskSubCategory !== 'string') {
791
- return new TypeError('Expected "string" but received "' + typeof obj_taskSubCategory + '" (at "' + path_taskSubCategory + '")');
792
- }
793
- const obj_warnings = obj.warnings;
794
- const path_warnings = path + '.warnings';
795
- if (obj_warnings === undefined) {
796
- return new TypeError('Expected "defined" but received "' + typeof obj_warnings + '" (at "' + path_warnings + '")');
797
- }
798
- })();
799
- return v_error === undefined ? null : v_error;
800
- }
801
- const select$3 = function AbstractEnablementProgramTaskRepresentationSelect() {
802
- return {
803
- kind: 'Fragment',
804
- version: VERSION$2,
805
- private: [],
806
- selections: [
807
- {
808
- name: 'contentType',
809
- kind: 'Scalar'
810
- },
811
- {
812
- name: 'description',
813
- kind: 'Scalar'
814
- },
815
- {
816
- name: 'developerName',
817
- kind: 'Scalar'
818
- },
819
- {
820
- name: 'durationCount',
821
- kind: 'Scalar'
822
- },
823
- {
824
- name: 'enablementProgramSectionId',
825
- kind: 'Scalar'
826
- },
827
- {
828
- name: 'enablementRoomId',
829
- kind: 'Scalar'
830
- },
831
- {
832
- name: 'id',
833
- kind: 'Scalar'
834
- },
835
- {
836
- name: 'isMilestoneAnOutcome',
837
- kind: 'Scalar'
838
- },
839
- {
840
- name: 'learningItemDescription',
841
- kind: 'Scalar'
842
- },
843
- {
844
- name: 'learningItemIconUrl',
845
- kind: 'Scalar'
846
- },
847
- {
848
- name: 'learningItemId',
849
- kind: 'Scalar'
850
- },
851
- {
852
- name: 'learningItemRelatedContentId',
853
- kind: 'Scalar'
854
- },
855
- {
856
- name: 'learningItemTitle',
857
- kind: 'Scalar'
858
- },
859
- {
860
- name: 'learningItemUrl',
861
- kind: 'Scalar'
862
- },
863
- {
864
- name: 'measureId',
865
- kind: 'Scalar'
866
- },
867
- {
868
- name: 'milestoneTarget',
869
- kind: 'Scalar'
870
- },
871
- {
872
- name: 'minimumSampleSize',
873
- kind: 'Scalar'
874
- },
875
- {
876
- name: 'name',
877
- kind: 'Scalar'
878
- },
879
- {
880
- name: 'programDay',
881
- kind: 'Scalar'
882
- },
883
- {
884
- name: 'sequenceNumber',
885
- kind: 'Scalar'
886
- },
887
- {
888
- name: 'taskCategory',
889
- kind: 'Scalar'
890
- },
891
- {
892
- name: 'taskSubCategory',
893
- kind: 'Scalar'
894
- },
895
- {
896
- name: 'warnings',
897
- kind: 'Object',
898
- // any
899
- }
900
- ]
901
- };
902
- };
903
- function equals$2(existing, incoming) {
904
- const existing_programDay = existing.programDay;
905
- const incoming_programDay = incoming.programDay;
906
- if (!(existing_programDay === incoming_programDay)) {
907
- return false;
908
- }
909
- const existing_sequenceNumber = existing.sequenceNumber;
910
- const incoming_sequenceNumber = incoming.sequenceNumber;
911
- if (!(existing_sequenceNumber === incoming_sequenceNumber)) {
912
- return false;
913
- }
914
- const existing_description = existing.description;
915
- const incoming_description = incoming.description;
916
- if (!(existing_description === incoming_description)) {
917
- return false;
918
- }
919
- const existing_developerName = existing.developerName;
920
- const incoming_developerName = incoming.developerName;
921
- if (!(existing_developerName === incoming_developerName)) {
922
- return false;
923
- }
924
- const existing_name = existing.name;
925
- const incoming_name = incoming.name;
926
- if (!(existing_name === incoming_name)) {
927
- return false;
928
- }
929
- const existing_taskCategory = existing.taskCategory;
930
- const incoming_taskCategory = incoming.taskCategory;
931
- if (!(existing_taskCategory === incoming_taskCategory)) {
932
- return false;
933
- }
934
- const existing_taskSubCategory = existing.taskSubCategory;
935
- const incoming_taskSubCategory = incoming.taskSubCategory;
936
- if (!(existing_taskSubCategory === incoming_taskSubCategory)) {
937
- return false;
938
- }
939
- const existing_milestoneTarget = existing.milestoneTarget;
940
- const incoming_milestoneTarget = incoming.milestoneTarget;
941
- if (!(existing_milestoneTarget === incoming_milestoneTarget)) {
942
- return false;
943
- }
944
- const existing_contentType = existing.contentType;
945
- const incoming_contentType = incoming.contentType;
946
- if (!(existing_contentType === incoming_contentType)) {
947
- return false;
948
- }
949
- const existing_durationCount = existing.durationCount;
950
- const incoming_durationCount = incoming.durationCount;
951
- if (!(existing_durationCount === incoming_durationCount)) {
952
- return false;
953
- }
954
- const existing_enablementProgramSectionId = existing.enablementProgramSectionId;
955
- const incoming_enablementProgramSectionId = incoming.enablementProgramSectionId;
956
- if (!(existing_enablementProgramSectionId === incoming_enablementProgramSectionId)) {
957
- return false;
958
- }
959
- const existing_enablementRoomId = existing.enablementRoomId;
960
- const incoming_enablementRoomId = incoming.enablementRoomId;
961
- if (!(existing_enablementRoomId === incoming_enablementRoomId)) {
962
- return false;
963
- }
964
- const existing_id = existing.id;
965
- const incoming_id = incoming.id;
966
- if (!(existing_id === incoming_id)) {
967
- return false;
968
- }
969
- const existing_isMilestoneAnOutcome = existing.isMilestoneAnOutcome;
970
- const incoming_isMilestoneAnOutcome = incoming.isMilestoneAnOutcome;
971
- if (!(existing_isMilestoneAnOutcome === incoming_isMilestoneAnOutcome)) {
972
- return false;
973
- }
974
- const existing_learningItemDescription = existing.learningItemDescription;
975
- const incoming_learningItemDescription = incoming.learningItemDescription;
976
- if (!(existing_learningItemDescription === incoming_learningItemDescription)) {
977
- return false;
978
- }
979
- const existing_learningItemIconUrl = existing.learningItemIconUrl;
980
- const incoming_learningItemIconUrl = incoming.learningItemIconUrl;
981
- if (!(existing_learningItemIconUrl === incoming_learningItemIconUrl)) {
982
- return false;
983
- }
984
- const existing_learningItemId = existing.learningItemId;
985
- const incoming_learningItemId = incoming.learningItemId;
986
- if (!(existing_learningItemId === incoming_learningItemId)) {
987
- return false;
988
- }
989
- const existing_learningItemRelatedContentId = existing.learningItemRelatedContentId;
990
- const incoming_learningItemRelatedContentId = incoming.learningItemRelatedContentId;
991
- if (!(existing_learningItemRelatedContentId === incoming_learningItemRelatedContentId)) {
992
- return false;
993
- }
994
- const existing_learningItemTitle = existing.learningItemTitle;
995
- const incoming_learningItemTitle = incoming.learningItemTitle;
996
- if (!(existing_learningItemTitle === incoming_learningItemTitle)) {
997
- return false;
998
- }
999
- const existing_learningItemUrl = existing.learningItemUrl;
1000
- const incoming_learningItemUrl = incoming.learningItemUrl;
1001
- if (!(existing_learningItemUrl === incoming_learningItemUrl)) {
1002
- return false;
1003
- }
1004
- const existing_measureId = existing.measureId;
1005
- const incoming_measureId = incoming.measureId;
1006
- if (!(existing_measureId === incoming_measureId)) {
1007
- return false;
1008
- }
1009
- const existing_minimumSampleSize = existing.minimumSampleSize;
1010
- const incoming_minimumSampleSize = incoming.minimumSampleSize;
1011
- if (!(existing_minimumSampleSize === incoming_minimumSampleSize)) {
1012
- return false;
1013
- }
1014
- const existing_warnings = existing.warnings;
1015
- const incoming_warnings = incoming.warnings;
1016
- if (JSONStringify(incoming_warnings) !== JSONStringify(existing_warnings)) {
1017
- return false;
1018
- }
1019
- return true;
387
+ const VERSION$2 = "d0d53cd500692d4a3a54a68f8fd5a349";
388
+ function validate$2(obj, path = 'AbstractEnablementProgramTaskRepresentation') {
389
+ const v_error = (() => {
390
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
391
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
392
+ }
393
+ const obj_contentType = obj.contentType;
394
+ const path_contentType = path + '.contentType';
395
+ let obj_contentType_union0 = null;
396
+ const obj_contentType_union0_error = (() => {
397
+ if (typeof obj_contentType !== 'string') {
398
+ return new TypeError('Expected "string" but received "' + typeof obj_contentType + '" (at "' + path_contentType + '")');
399
+ }
400
+ })();
401
+ if (obj_contentType_union0_error != null) {
402
+ obj_contentType_union0 = obj_contentType_union0_error.message;
403
+ }
404
+ let obj_contentType_union1 = null;
405
+ const obj_contentType_union1_error = (() => {
406
+ if (obj_contentType !== null) {
407
+ return new TypeError('Expected "null" but received "' + typeof obj_contentType + '" (at "' + path_contentType + '")');
408
+ }
409
+ })();
410
+ if (obj_contentType_union1_error != null) {
411
+ obj_contentType_union1 = obj_contentType_union1_error.message;
412
+ }
413
+ if (obj_contentType_union0 && obj_contentType_union1) {
414
+ let message = 'Object doesn\'t match union (at "' + path_contentType + '")';
415
+ message += '\n' + obj_contentType_union0.split('\n').map((line) => '\t' + line).join('\n');
416
+ message += '\n' + obj_contentType_union1.split('\n').map((line) => '\t' + line).join('\n');
417
+ return new TypeError(message);
418
+ }
419
+ const obj_description = obj.description;
420
+ const path_description = path + '.description';
421
+ if (typeof obj_description !== 'string') {
422
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
423
+ }
424
+ const obj_developerName = obj.developerName;
425
+ const path_developerName = path + '.developerName';
426
+ if (typeof obj_developerName !== 'string') {
427
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
428
+ }
429
+ const obj_durationCount = obj.durationCount;
430
+ const path_durationCount = path + '.durationCount';
431
+ let obj_durationCount_union0 = null;
432
+ const obj_durationCount_union0_error = (() => {
433
+ if (typeof obj_durationCount !== 'number' || (typeof obj_durationCount === 'number' && Math.floor(obj_durationCount) !== obj_durationCount)) {
434
+ return new TypeError('Expected "integer" but received "' + typeof obj_durationCount + '" (at "' + path_durationCount + '")');
435
+ }
436
+ })();
437
+ if (obj_durationCount_union0_error != null) {
438
+ obj_durationCount_union0 = obj_durationCount_union0_error.message;
439
+ }
440
+ let obj_durationCount_union1 = null;
441
+ const obj_durationCount_union1_error = (() => {
442
+ if (obj_durationCount !== null) {
443
+ return new TypeError('Expected "null" but received "' + typeof obj_durationCount + '" (at "' + path_durationCount + '")');
444
+ }
445
+ })();
446
+ if (obj_durationCount_union1_error != null) {
447
+ obj_durationCount_union1 = obj_durationCount_union1_error.message;
448
+ }
449
+ if (obj_durationCount_union0 && obj_durationCount_union1) {
450
+ let message = 'Object doesn\'t match union (at "' + path_durationCount + '")';
451
+ message += '\n' + obj_durationCount_union0.split('\n').map((line) => '\t' + line).join('\n');
452
+ message += '\n' + obj_durationCount_union1.split('\n').map((line) => '\t' + line).join('\n');
453
+ return new TypeError(message);
454
+ }
455
+ const obj_enablementProgramSectionId = obj.enablementProgramSectionId;
456
+ const path_enablementProgramSectionId = path + '.enablementProgramSectionId';
457
+ let obj_enablementProgramSectionId_union0 = null;
458
+ const obj_enablementProgramSectionId_union0_error = (() => {
459
+ if (typeof obj_enablementProgramSectionId !== 'string') {
460
+ return new TypeError('Expected "string" but received "' + typeof obj_enablementProgramSectionId + '" (at "' + path_enablementProgramSectionId + '")');
461
+ }
462
+ })();
463
+ if (obj_enablementProgramSectionId_union0_error != null) {
464
+ obj_enablementProgramSectionId_union0 = obj_enablementProgramSectionId_union0_error.message;
465
+ }
466
+ let obj_enablementProgramSectionId_union1 = null;
467
+ const obj_enablementProgramSectionId_union1_error = (() => {
468
+ if (obj_enablementProgramSectionId !== null) {
469
+ return new TypeError('Expected "null" but received "' + typeof obj_enablementProgramSectionId + '" (at "' + path_enablementProgramSectionId + '")');
470
+ }
471
+ })();
472
+ if (obj_enablementProgramSectionId_union1_error != null) {
473
+ obj_enablementProgramSectionId_union1 = obj_enablementProgramSectionId_union1_error.message;
474
+ }
475
+ if (obj_enablementProgramSectionId_union0 && obj_enablementProgramSectionId_union1) {
476
+ let message = 'Object doesn\'t match union (at "' + path_enablementProgramSectionId + '")';
477
+ message += '\n' + obj_enablementProgramSectionId_union0.split('\n').map((line) => '\t' + line).join('\n');
478
+ message += '\n' + obj_enablementProgramSectionId_union1.split('\n').map((line) => '\t' + line).join('\n');
479
+ return new TypeError(message);
480
+ }
481
+ const obj_enablementRoomId = obj.enablementRoomId;
482
+ const path_enablementRoomId = path + '.enablementRoomId';
483
+ let obj_enablementRoomId_union0 = null;
484
+ const obj_enablementRoomId_union0_error = (() => {
485
+ if (typeof obj_enablementRoomId !== 'string') {
486
+ return new TypeError('Expected "string" but received "' + typeof obj_enablementRoomId + '" (at "' + path_enablementRoomId + '")');
487
+ }
488
+ })();
489
+ if (obj_enablementRoomId_union0_error != null) {
490
+ obj_enablementRoomId_union0 = obj_enablementRoomId_union0_error.message;
491
+ }
492
+ let obj_enablementRoomId_union1 = null;
493
+ const obj_enablementRoomId_union1_error = (() => {
494
+ if (obj_enablementRoomId !== null) {
495
+ return new TypeError('Expected "null" but received "' + typeof obj_enablementRoomId + '" (at "' + path_enablementRoomId + '")');
496
+ }
497
+ })();
498
+ if (obj_enablementRoomId_union1_error != null) {
499
+ obj_enablementRoomId_union1 = obj_enablementRoomId_union1_error.message;
500
+ }
501
+ if (obj_enablementRoomId_union0 && obj_enablementRoomId_union1) {
502
+ let message = 'Object doesn\'t match union (at "' + path_enablementRoomId + '")';
503
+ message += '\n' + obj_enablementRoomId_union0.split('\n').map((line) => '\t' + line).join('\n');
504
+ message += '\n' + obj_enablementRoomId_union1.split('\n').map((line) => '\t' + line).join('\n');
505
+ return new TypeError(message);
506
+ }
507
+ const obj_id = obj.id;
508
+ const path_id = path + '.id';
509
+ let obj_id_union0 = null;
510
+ const obj_id_union0_error = (() => {
511
+ if (typeof obj_id !== 'string') {
512
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
513
+ }
514
+ })();
515
+ if (obj_id_union0_error != null) {
516
+ obj_id_union0 = obj_id_union0_error.message;
517
+ }
518
+ let obj_id_union1 = null;
519
+ const obj_id_union1_error = (() => {
520
+ if (obj_id !== null) {
521
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
522
+ }
523
+ })();
524
+ if (obj_id_union1_error != null) {
525
+ obj_id_union1 = obj_id_union1_error.message;
526
+ }
527
+ if (obj_id_union0 && obj_id_union1) {
528
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
529
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
530
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
531
+ return new TypeError(message);
532
+ }
533
+ const obj_isMilestoneAnOutcome = obj.isMilestoneAnOutcome;
534
+ const path_isMilestoneAnOutcome = path + '.isMilestoneAnOutcome';
535
+ let obj_isMilestoneAnOutcome_union0 = null;
536
+ const obj_isMilestoneAnOutcome_union0_error = (() => {
537
+ if (typeof obj_isMilestoneAnOutcome !== 'boolean') {
538
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isMilestoneAnOutcome + '" (at "' + path_isMilestoneAnOutcome + '")');
539
+ }
540
+ })();
541
+ if (obj_isMilestoneAnOutcome_union0_error != null) {
542
+ obj_isMilestoneAnOutcome_union0 = obj_isMilestoneAnOutcome_union0_error.message;
543
+ }
544
+ let obj_isMilestoneAnOutcome_union1 = null;
545
+ const obj_isMilestoneAnOutcome_union1_error = (() => {
546
+ if (obj_isMilestoneAnOutcome !== null) {
547
+ return new TypeError('Expected "null" but received "' + typeof obj_isMilestoneAnOutcome + '" (at "' + path_isMilestoneAnOutcome + '")');
548
+ }
549
+ })();
550
+ if (obj_isMilestoneAnOutcome_union1_error != null) {
551
+ obj_isMilestoneAnOutcome_union1 = obj_isMilestoneAnOutcome_union1_error.message;
552
+ }
553
+ if (obj_isMilestoneAnOutcome_union0 && obj_isMilestoneAnOutcome_union1) {
554
+ let message = 'Object doesn\'t match union (at "' + path_isMilestoneAnOutcome + '")';
555
+ message += '\n' + obj_isMilestoneAnOutcome_union0.split('\n').map((line) => '\t' + line).join('\n');
556
+ message += '\n' + obj_isMilestoneAnOutcome_union1.split('\n').map((line) => '\t' + line).join('\n');
557
+ return new TypeError(message);
558
+ }
559
+ const obj_learningItemDescription = obj.learningItemDescription;
560
+ const path_learningItemDescription = path + '.learningItemDescription';
561
+ let obj_learningItemDescription_union0 = null;
562
+ const obj_learningItemDescription_union0_error = (() => {
563
+ if (typeof obj_learningItemDescription !== 'string') {
564
+ return new TypeError('Expected "string" but received "' + typeof obj_learningItemDescription + '" (at "' + path_learningItemDescription + '")');
565
+ }
566
+ })();
567
+ if (obj_learningItemDescription_union0_error != null) {
568
+ obj_learningItemDescription_union0 = obj_learningItemDescription_union0_error.message;
569
+ }
570
+ let obj_learningItemDescription_union1 = null;
571
+ const obj_learningItemDescription_union1_error = (() => {
572
+ if (obj_learningItemDescription !== null) {
573
+ return new TypeError('Expected "null" but received "' + typeof obj_learningItemDescription + '" (at "' + path_learningItemDescription + '")');
574
+ }
575
+ })();
576
+ if (obj_learningItemDescription_union1_error != null) {
577
+ obj_learningItemDescription_union1 = obj_learningItemDescription_union1_error.message;
578
+ }
579
+ if (obj_learningItemDescription_union0 && obj_learningItemDescription_union1) {
580
+ let message = 'Object doesn\'t match union (at "' + path_learningItemDescription + '")';
581
+ message += '\n' + obj_learningItemDescription_union0.split('\n').map((line) => '\t' + line).join('\n');
582
+ message += '\n' + obj_learningItemDescription_union1.split('\n').map((line) => '\t' + line).join('\n');
583
+ return new TypeError(message);
584
+ }
585
+ const obj_learningItemIconUrl = obj.learningItemIconUrl;
586
+ const path_learningItemIconUrl = path + '.learningItemIconUrl';
587
+ let obj_learningItemIconUrl_union0 = null;
588
+ const obj_learningItemIconUrl_union0_error = (() => {
589
+ if (typeof obj_learningItemIconUrl !== 'string') {
590
+ return new TypeError('Expected "string" but received "' + typeof obj_learningItemIconUrl + '" (at "' + path_learningItemIconUrl + '")');
591
+ }
592
+ })();
593
+ if (obj_learningItemIconUrl_union0_error != null) {
594
+ obj_learningItemIconUrl_union0 = obj_learningItemIconUrl_union0_error.message;
595
+ }
596
+ let obj_learningItemIconUrl_union1 = null;
597
+ const obj_learningItemIconUrl_union1_error = (() => {
598
+ if (obj_learningItemIconUrl !== null) {
599
+ return new TypeError('Expected "null" but received "' + typeof obj_learningItemIconUrl + '" (at "' + path_learningItemIconUrl + '")');
600
+ }
601
+ })();
602
+ if (obj_learningItemIconUrl_union1_error != null) {
603
+ obj_learningItemIconUrl_union1 = obj_learningItemIconUrl_union1_error.message;
604
+ }
605
+ if (obj_learningItemIconUrl_union0 && obj_learningItemIconUrl_union1) {
606
+ let message = 'Object doesn\'t match union (at "' + path_learningItemIconUrl + '")';
607
+ message += '\n' + obj_learningItemIconUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
608
+ message += '\n' + obj_learningItemIconUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
609
+ return new TypeError(message);
610
+ }
611
+ const obj_learningItemId = obj.learningItemId;
612
+ const path_learningItemId = path + '.learningItemId';
613
+ let obj_learningItemId_union0 = null;
614
+ const obj_learningItemId_union0_error = (() => {
615
+ if (typeof obj_learningItemId !== 'string') {
616
+ return new TypeError('Expected "string" but received "' + typeof obj_learningItemId + '" (at "' + path_learningItemId + '")');
617
+ }
618
+ })();
619
+ if (obj_learningItemId_union0_error != null) {
620
+ obj_learningItemId_union0 = obj_learningItemId_union0_error.message;
621
+ }
622
+ let obj_learningItemId_union1 = null;
623
+ const obj_learningItemId_union1_error = (() => {
624
+ if (obj_learningItemId !== null) {
625
+ return new TypeError('Expected "null" but received "' + typeof obj_learningItemId + '" (at "' + path_learningItemId + '")');
626
+ }
627
+ })();
628
+ if (obj_learningItemId_union1_error != null) {
629
+ obj_learningItemId_union1 = obj_learningItemId_union1_error.message;
630
+ }
631
+ if (obj_learningItemId_union0 && obj_learningItemId_union1) {
632
+ let message = 'Object doesn\'t match union (at "' + path_learningItemId + '")';
633
+ message += '\n' + obj_learningItemId_union0.split('\n').map((line) => '\t' + line).join('\n');
634
+ message += '\n' + obj_learningItemId_union1.split('\n').map((line) => '\t' + line).join('\n');
635
+ return new TypeError(message);
636
+ }
637
+ const obj_learningItemRelatedContentId = obj.learningItemRelatedContentId;
638
+ const path_learningItemRelatedContentId = path + '.learningItemRelatedContentId';
639
+ let obj_learningItemRelatedContentId_union0 = null;
640
+ const obj_learningItemRelatedContentId_union0_error = (() => {
641
+ if (typeof obj_learningItemRelatedContentId !== 'string') {
642
+ return new TypeError('Expected "string" but received "' + typeof obj_learningItemRelatedContentId + '" (at "' + path_learningItemRelatedContentId + '")');
643
+ }
644
+ })();
645
+ if (obj_learningItemRelatedContentId_union0_error != null) {
646
+ obj_learningItemRelatedContentId_union0 = obj_learningItemRelatedContentId_union0_error.message;
647
+ }
648
+ let obj_learningItemRelatedContentId_union1 = null;
649
+ const obj_learningItemRelatedContentId_union1_error = (() => {
650
+ if (obj_learningItemRelatedContentId !== null) {
651
+ return new TypeError('Expected "null" but received "' + typeof obj_learningItemRelatedContentId + '" (at "' + path_learningItemRelatedContentId + '")');
652
+ }
653
+ })();
654
+ if (obj_learningItemRelatedContentId_union1_error != null) {
655
+ obj_learningItemRelatedContentId_union1 = obj_learningItemRelatedContentId_union1_error.message;
656
+ }
657
+ if (obj_learningItemRelatedContentId_union0 && obj_learningItemRelatedContentId_union1) {
658
+ let message = 'Object doesn\'t match union (at "' + path_learningItemRelatedContentId + '")';
659
+ message += '\n' + obj_learningItemRelatedContentId_union0.split('\n').map((line) => '\t' + line).join('\n');
660
+ message += '\n' + obj_learningItemRelatedContentId_union1.split('\n').map((line) => '\t' + line).join('\n');
661
+ return new TypeError(message);
662
+ }
663
+ const obj_learningItemTitle = obj.learningItemTitle;
664
+ const path_learningItemTitle = path + '.learningItemTitle';
665
+ let obj_learningItemTitle_union0 = null;
666
+ const obj_learningItemTitle_union0_error = (() => {
667
+ if (typeof obj_learningItemTitle !== 'string') {
668
+ return new TypeError('Expected "string" but received "' + typeof obj_learningItemTitle + '" (at "' + path_learningItemTitle + '")');
669
+ }
670
+ })();
671
+ if (obj_learningItemTitle_union0_error != null) {
672
+ obj_learningItemTitle_union0 = obj_learningItemTitle_union0_error.message;
673
+ }
674
+ let obj_learningItemTitle_union1 = null;
675
+ const obj_learningItemTitle_union1_error = (() => {
676
+ if (obj_learningItemTitle !== null) {
677
+ return new TypeError('Expected "null" but received "' + typeof obj_learningItemTitle + '" (at "' + path_learningItemTitle + '")');
678
+ }
679
+ })();
680
+ if (obj_learningItemTitle_union1_error != null) {
681
+ obj_learningItemTitle_union1 = obj_learningItemTitle_union1_error.message;
682
+ }
683
+ if (obj_learningItemTitle_union0 && obj_learningItemTitle_union1) {
684
+ let message = 'Object doesn\'t match union (at "' + path_learningItemTitle + '")';
685
+ message += '\n' + obj_learningItemTitle_union0.split('\n').map((line) => '\t' + line).join('\n');
686
+ message += '\n' + obj_learningItemTitle_union1.split('\n').map((line) => '\t' + line).join('\n');
687
+ return new TypeError(message);
688
+ }
689
+ const obj_learningItemUrl = obj.learningItemUrl;
690
+ const path_learningItemUrl = path + '.learningItemUrl';
691
+ let obj_learningItemUrl_union0 = null;
692
+ const obj_learningItemUrl_union0_error = (() => {
693
+ if (typeof obj_learningItemUrl !== 'string') {
694
+ return new TypeError('Expected "string" but received "' + typeof obj_learningItemUrl + '" (at "' + path_learningItemUrl + '")');
695
+ }
696
+ })();
697
+ if (obj_learningItemUrl_union0_error != null) {
698
+ obj_learningItemUrl_union0 = obj_learningItemUrl_union0_error.message;
699
+ }
700
+ let obj_learningItemUrl_union1 = null;
701
+ const obj_learningItemUrl_union1_error = (() => {
702
+ if (obj_learningItemUrl !== null) {
703
+ return new TypeError('Expected "null" but received "' + typeof obj_learningItemUrl + '" (at "' + path_learningItemUrl + '")');
704
+ }
705
+ })();
706
+ if (obj_learningItemUrl_union1_error != null) {
707
+ obj_learningItemUrl_union1 = obj_learningItemUrl_union1_error.message;
708
+ }
709
+ if (obj_learningItemUrl_union0 && obj_learningItemUrl_union1) {
710
+ let message = 'Object doesn\'t match union (at "' + path_learningItemUrl + '")';
711
+ message += '\n' + obj_learningItemUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
712
+ message += '\n' + obj_learningItemUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
713
+ return new TypeError(message);
714
+ }
715
+ const obj_measureId = obj.measureId;
716
+ const path_measureId = path + '.measureId';
717
+ let obj_measureId_union0 = null;
718
+ const obj_measureId_union0_error = (() => {
719
+ if (typeof obj_measureId !== 'string') {
720
+ return new TypeError('Expected "string" but received "' + typeof obj_measureId + '" (at "' + path_measureId + '")');
721
+ }
722
+ })();
723
+ if (obj_measureId_union0_error != null) {
724
+ obj_measureId_union0 = obj_measureId_union0_error.message;
725
+ }
726
+ let obj_measureId_union1 = null;
727
+ const obj_measureId_union1_error = (() => {
728
+ if (obj_measureId !== null) {
729
+ return new TypeError('Expected "null" but received "' + typeof obj_measureId + '" (at "' + path_measureId + '")');
730
+ }
731
+ })();
732
+ if (obj_measureId_union1_error != null) {
733
+ obj_measureId_union1 = obj_measureId_union1_error.message;
734
+ }
735
+ if (obj_measureId_union0 && obj_measureId_union1) {
736
+ let message = 'Object doesn\'t match union (at "' + path_measureId + '")';
737
+ message += '\n' + obj_measureId_union0.split('\n').map((line) => '\t' + line).join('\n');
738
+ message += '\n' + obj_measureId_union1.split('\n').map((line) => '\t' + line).join('\n');
739
+ return new TypeError(message);
740
+ }
741
+ obj.milestoneTarget;
742
+ const obj_minimumSampleSize = obj.minimumSampleSize;
743
+ const path_minimumSampleSize = path + '.minimumSampleSize';
744
+ let obj_minimumSampleSize_union0 = null;
745
+ const obj_minimumSampleSize_union0_error = (() => {
746
+ if (typeof obj_minimumSampleSize !== 'number' || (typeof obj_minimumSampleSize === 'number' && Math.floor(obj_minimumSampleSize) !== obj_minimumSampleSize)) {
747
+ return new TypeError('Expected "integer" but received "' + typeof obj_minimumSampleSize + '" (at "' + path_minimumSampleSize + '")');
748
+ }
749
+ })();
750
+ if (obj_minimumSampleSize_union0_error != null) {
751
+ obj_minimumSampleSize_union0 = obj_minimumSampleSize_union0_error.message;
752
+ }
753
+ let obj_minimumSampleSize_union1 = null;
754
+ const obj_minimumSampleSize_union1_error = (() => {
755
+ if (obj_minimumSampleSize !== null) {
756
+ return new TypeError('Expected "null" but received "' + typeof obj_minimumSampleSize + '" (at "' + path_minimumSampleSize + '")');
757
+ }
758
+ })();
759
+ if (obj_minimumSampleSize_union1_error != null) {
760
+ obj_minimumSampleSize_union1 = obj_minimumSampleSize_union1_error.message;
761
+ }
762
+ if (obj_minimumSampleSize_union0 && obj_minimumSampleSize_union1) {
763
+ let message = 'Object doesn\'t match union (at "' + path_minimumSampleSize + '")';
764
+ message += '\n' + obj_minimumSampleSize_union0.split('\n').map((line) => '\t' + line).join('\n');
765
+ message += '\n' + obj_minimumSampleSize_union1.split('\n').map((line) => '\t' + line).join('\n');
766
+ return new TypeError(message);
767
+ }
768
+ const obj_name = obj.name;
769
+ const path_name = path + '.name';
770
+ if (typeof obj_name !== 'string') {
771
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
772
+ }
773
+ const obj_programDay = obj.programDay;
774
+ const path_programDay = path + '.programDay';
775
+ if (typeof obj_programDay !== 'number' || (typeof obj_programDay === 'number' && Math.floor(obj_programDay) !== obj_programDay)) {
776
+ return new TypeError('Expected "integer" but received "' + typeof obj_programDay + '" (at "' + path_programDay + '")');
777
+ }
778
+ const obj_sequenceNumber = obj.sequenceNumber;
779
+ const path_sequenceNumber = path + '.sequenceNumber';
780
+ if (typeof obj_sequenceNumber !== 'number' || (typeof obj_sequenceNumber === 'number' && Math.floor(obj_sequenceNumber) !== obj_sequenceNumber)) {
781
+ return new TypeError('Expected "integer" but received "' + typeof obj_sequenceNumber + '" (at "' + path_sequenceNumber + '")');
782
+ }
783
+ const obj_taskCategory = obj.taskCategory;
784
+ const path_taskCategory = path + '.taskCategory';
785
+ if (typeof obj_taskCategory !== 'string') {
786
+ return new TypeError('Expected "string" but received "' + typeof obj_taskCategory + '" (at "' + path_taskCategory + '")');
787
+ }
788
+ const obj_taskSubCategory = obj.taskSubCategory;
789
+ const path_taskSubCategory = path + '.taskSubCategory';
790
+ if (typeof obj_taskSubCategory !== 'string') {
791
+ return new TypeError('Expected "string" but received "' + typeof obj_taskSubCategory + '" (at "' + path_taskSubCategory + '")');
792
+ }
793
+ const obj_warnings = obj.warnings;
794
+ const path_warnings = path + '.warnings';
795
+ if (obj_warnings === undefined) {
796
+ return new TypeError('Expected "defined" but received "' + typeof obj_warnings + '" (at "' + path_warnings + '")');
797
+ }
798
+ })();
799
+ return v_error === undefined ? null : v_error;
800
+ }
801
+ const select$3 = function AbstractEnablementProgramTaskRepresentationSelect() {
802
+ return {
803
+ kind: 'Fragment',
804
+ version: VERSION$2,
805
+ private: [],
806
+ selections: [
807
+ {
808
+ name: 'contentType',
809
+ kind: 'Scalar'
810
+ },
811
+ {
812
+ name: 'description',
813
+ kind: 'Scalar'
814
+ },
815
+ {
816
+ name: 'developerName',
817
+ kind: 'Scalar'
818
+ },
819
+ {
820
+ name: 'durationCount',
821
+ kind: 'Scalar'
822
+ },
823
+ {
824
+ name: 'enablementProgramSectionId',
825
+ kind: 'Scalar'
826
+ },
827
+ {
828
+ name: 'enablementRoomId',
829
+ kind: 'Scalar'
830
+ },
831
+ {
832
+ name: 'id',
833
+ kind: 'Scalar'
834
+ },
835
+ {
836
+ name: 'isMilestoneAnOutcome',
837
+ kind: 'Scalar'
838
+ },
839
+ {
840
+ name: 'learningItemDescription',
841
+ kind: 'Scalar'
842
+ },
843
+ {
844
+ name: 'learningItemIconUrl',
845
+ kind: 'Scalar'
846
+ },
847
+ {
848
+ name: 'learningItemId',
849
+ kind: 'Scalar'
850
+ },
851
+ {
852
+ name: 'learningItemRelatedContentId',
853
+ kind: 'Scalar'
854
+ },
855
+ {
856
+ name: 'learningItemTitle',
857
+ kind: 'Scalar'
858
+ },
859
+ {
860
+ name: 'learningItemUrl',
861
+ kind: 'Scalar'
862
+ },
863
+ {
864
+ name: 'measureId',
865
+ kind: 'Scalar'
866
+ },
867
+ {
868
+ name: 'milestoneTarget',
869
+ kind: 'Scalar'
870
+ },
871
+ {
872
+ name: 'minimumSampleSize',
873
+ kind: 'Scalar'
874
+ },
875
+ {
876
+ name: 'name',
877
+ kind: 'Scalar'
878
+ },
879
+ {
880
+ name: 'programDay',
881
+ kind: 'Scalar'
882
+ },
883
+ {
884
+ name: 'sequenceNumber',
885
+ kind: 'Scalar'
886
+ },
887
+ {
888
+ name: 'taskCategory',
889
+ kind: 'Scalar'
890
+ },
891
+ {
892
+ name: 'taskSubCategory',
893
+ kind: 'Scalar'
894
+ },
895
+ {
896
+ name: 'warnings',
897
+ kind: 'Object',
898
+ // any
899
+ }
900
+ ]
901
+ };
902
+ };
903
+ function equals$2(existing, incoming) {
904
+ const existing_programDay = existing.programDay;
905
+ const incoming_programDay = incoming.programDay;
906
+ if (!(existing_programDay === incoming_programDay)) {
907
+ return false;
908
+ }
909
+ const existing_sequenceNumber = existing.sequenceNumber;
910
+ const incoming_sequenceNumber = incoming.sequenceNumber;
911
+ if (!(existing_sequenceNumber === incoming_sequenceNumber)) {
912
+ return false;
913
+ }
914
+ const existing_description = existing.description;
915
+ const incoming_description = incoming.description;
916
+ if (!(existing_description === incoming_description)) {
917
+ return false;
918
+ }
919
+ const existing_developerName = existing.developerName;
920
+ const incoming_developerName = incoming.developerName;
921
+ if (!(existing_developerName === incoming_developerName)) {
922
+ return false;
923
+ }
924
+ const existing_name = existing.name;
925
+ const incoming_name = incoming.name;
926
+ if (!(existing_name === incoming_name)) {
927
+ return false;
928
+ }
929
+ const existing_taskCategory = existing.taskCategory;
930
+ const incoming_taskCategory = incoming.taskCategory;
931
+ if (!(existing_taskCategory === incoming_taskCategory)) {
932
+ return false;
933
+ }
934
+ const existing_taskSubCategory = existing.taskSubCategory;
935
+ const incoming_taskSubCategory = incoming.taskSubCategory;
936
+ if (!(existing_taskSubCategory === incoming_taskSubCategory)) {
937
+ return false;
938
+ }
939
+ const existing_milestoneTarget = existing.milestoneTarget;
940
+ const incoming_milestoneTarget = incoming.milestoneTarget;
941
+ if (!(existing_milestoneTarget === incoming_milestoneTarget)) {
942
+ return false;
943
+ }
944
+ const existing_contentType = existing.contentType;
945
+ const incoming_contentType = incoming.contentType;
946
+ if (!(existing_contentType === incoming_contentType)) {
947
+ return false;
948
+ }
949
+ const existing_durationCount = existing.durationCount;
950
+ const incoming_durationCount = incoming.durationCount;
951
+ if (!(existing_durationCount === incoming_durationCount)) {
952
+ return false;
953
+ }
954
+ const existing_enablementProgramSectionId = existing.enablementProgramSectionId;
955
+ const incoming_enablementProgramSectionId = incoming.enablementProgramSectionId;
956
+ if (!(existing_enablementProgramSectionId === incoming_enablementProgramSectionId)) {
957
+ return false;
958
+ }
959
+ const existing_enablementRoomId = existing.enablementRoomId;
960
+ const incoming_enablementRoomId = incoming.enablementRoomId;
961
+ if (!(existing_enablementRoomId === incoming_enablementRoomId)) {
962
+ return false;
963
+ }
964
+ const existing_id = existing.id;
965
+ const incoming_id = incoming.id;
966
+ if (!(existing_id === incoming_id)) {
967
+ return false;
968
+ }
969
+ const existing_isMilestoneAnOutcome = existing.isMilestoneAnOutcome;
970
+ const incoming_isMilestoneAnOutcome = incoming.isMilestoneAnOutcome;
971
+ if (!(existing_isMilestoneAnOutcome === incoming_isMilestoneAnOutcome)) {
972
+ return false;
973
+ }
974
+ const existing_learningItemDescription = existing.learningItemDescription;
975
+ const incoming_learningItemDescription = incoming.learningItemDescription;
976
+ if (!(existing_learningItemDescription === incoming_learningItemDescription)) {
977
+ return false;
978
+ }
979
+ const existing_learningItemIconUrl = existing.learningItemIconUrl;
980
+ const incoming_learningItemIconUrl = incoming.learningItemIconUrl;
981
+ if (!(existing_learningItemIconUrl === incoming_learningItemIconUrl)) {
982
+ return false;
983
+ }
984
+ const existing_learningItemId = existing.learningItemId;
985
+ const incoming_learningItemId = incoming.learningItemId;
986
+ if (!(existing_learningItemId === incoming_learningItemId)) {
987
+ return false;
988
+ }
989
+ const existing_learningItemRelatedContentId = existing.learningItemRelatedContentId;
990
+ const incoming_learningItemRelatedContentId = incoming.learningItemRelatedContentId;
991
+ if (!(existing_learningItemRelatedContentId === incoming_learningItemRelatedContentId)) {
992
+ return false;
993
+ }
994
+ const existing_learningItemTitle = existing.learningItemTitle;
995
+ const incoming_learningItemTitle = incoming.learningItemTitle;
996
+ if (!(existing_learningItemTitle === incoming_learningItemTitle)) {
997
+ return false;
998
+ }
999
+ const existing_learningItemUrl = existing.learningItemUrl;
1000
+ const incoming_learningItemUrl = incoming.learningItemUrl;
1001
+ if (!(existing_learningItemUrl === incoming_learningItemUrl)) {
1002
+ return false;
1003
+ }
1004
+ const existing_measureId = existing.measureId;
1005
+ const incoming_measureId = incoming.measureId;
1006
+ if (!(existing_measureId === incoming_measureId)) {
1007
+ return false;
1008
+ }
1009
+ const existing_minimumSampleSize = existing.minimumSampleSize;
1010
+ const incoming_minimumSampleSize = incoming.minimumSampleSize;
1011
+ if (!(existing_minimumSampleSize === incoming_minimumSampleSize)) {
1012
+ return false;
1013
+ }
1014
+ const existing_warnings = existing.warnings;
1015
+ const incoming_warnings = incoming.warnings;
1016
+ if (JSONStringify(incoming_warnings) !== JSONStringify(existing_warnings)) {
1017
+ return false;
1018
+ }
1019
+ return true;
1020
1020
  }
1021
1021
 
1022
- const VERSION$1 = "1a04a332b32cf015d23bb89ffcca76e9";
1023
- function validate$1(obj, path = 'EnablementProgramSectionRepresentation') {
1024
- const v_error = (() => {
1025
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1026
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1027
- }
1028
- const obj_description = obj.description;
1029
- const path_description = path + '.description';
1030
- let obj_description_union0 = null;
1031
- const obj_description_union0_error = (() => {
1032
- if (typeof obj_description !== 'string') {
1033
- return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1034
- }
1035
- })();
1036
- if (obj_description_union0_error != null) {
1037
- obj_description_union0 = obj_description_union0_error.message;
1038
- }
1039
- let obj_description_union1 = null;
1040
- const obj_description_union1_error = (() => {
1041
- if (obj_description !== null) {
1042
- return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1043
- }
1044
- })();
1045
- if (obj_description_union1_error != null) {
1046
- obj_description_union1 = obj_description_union1_error.message;
1047
- }
1048
- if (obj_description_union0 && obj_description_union1) {
1049
- let message = 'Object doesn\'t match union (at "' + path_description + '")';
1050
- message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
1051
- message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
1052
- return new TypeError(message);
1053
- }
1054
- const obj_id = obj.id;
1055
- const path_id = path + '.id';
1056
- let obj_id_union0 = null;
1057
- const obj_id_union0_error = (() => {
1058
- if (typeof obj_id !== 'string') {
1059
- return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1060
- }
1061
- })();
1062
- if (obj_id_union0_error != null) {
1063
- obj_id_union0 = obj_id_union0_error.message;
1064
- }
1065
- let obj_id_union1 = null;
1066
- const obj_id_union1_error = (() => {
1067
- if (obj_id !== null) {
1068
- return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1069
- }
1070
- })();
1071
- if (obj_id_union1_error != null) {
1072
- obj_id_union1 = obj_id_union1_error.message;
1073
- }
1074
- if (obj_id_union0 && obj_id_union1) {
1075
- let message = 'Object doesn\'t match union (at "' + path_id + '")';
1076
- message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
1077
- message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
1078
- return new TypeError(message);
1079
- }
1080
- const obj_name = obj.name;
1081
- const path_name = path + '.name';
1082
- if (typeof obj_name !== 'string') {
1083
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1084
- }
1085
- const obj_sequenceNumber = obj.sequenceNumber;
1086
- const path_sequenceNumber = path + '.sequenceNumber';
1087
- if (typeof obj_sequenceNumber !== 'number' || (typeof obj_sequenceNumber === 'number' && Math.floor(obj_sequenceNumber) !== obj_sequenceNumber)) {
1088
- return new TypeError('Expected "integer" but received "' + typeof obj_sequenceNumber + '" (at "' + path_sequenceNumber + '")');
1089
- }
1090
- const obj_tasks = obj.tasks;
1091
- const path_tasks = path + '.tasks';
1092
- if (!ArrayIsArray(obj_tasks)) {
1093
- return new TypeError('Expected "array" but received "' + typeof obj_tasks + '" (at "' + path_tasks + '")');
1094
- }
1095
- for (let i = 0; i < obj_tasks.length; i++) {
1096
- const obj_tasks_item = obj_tasks[i];
1097
- const path_tasks_item = path_tasks + '[' + i + ']';
1098
- const referencepath_tasks_itemValidationError = validate$2(obj_tasks_item, path_tasks_item);
1099
- if (referencepath_tasks_itemValidationError !== null) {
1100
- let message = 'Object doesn\'t match AbstractEnablementProgramTaskRepresentation (at "' + path_tasks_item + '")\n';
1101
- message += referencepath_tasks_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1102
- return new TypeError(message);
1103
- }
1104
- }
1105
- })();
1106
- return v_error === undefined ? null : v_error;
1107
- }
1108
- const select$2 = function EnablementProgramSectionRepresentationSelect() {
1109
- const { selections: AbstractEnablementProgramTaskRepresentation__selections, opaque: AbstractEnablementProgramTaskRepresentation__opaque, } = select$3();
1110
- return {
1111
- kind: 'Fragment',
1112
- version: VERSION$1,
1113
- private: [],
1114
- selections: [
1115
- {
1116
- name: 'description',
1117
- kind: 'Scalar'
1118
- },
1119
- {
1120
- name: 'id',
1121
- kind: 'Scalar'
1122
- },
1123
- {
1124
- name: 'name',
1125
- kind: 'Scalar'
1126
- },
1127
- {
1128
- name: 'sequenceNumber',
1129
- kind: 'Scalar'
1130
- },
1131
- {
1132
- name: 'tasks',
1133
- kind: 'Object',
1134
- plural: true,
1135
- selections: AbstractEnablementProgramTaskRepresentation__selections
1136
- }
1137
- ]
1138
- };
1139
- };
1140
- function equals$1(existing, incoming) {
1141
- const existing_sequenceNumber = existing.sequenceNumber;
1142
- const incoming_sequenceNumber = incoming.sequenceNumber;
1143
- if (!(existing_sequenceNumber === incoming_sequenceNumber)) {
1144
- return false;
1145
- }
1146
- const existing_name = existing.name;
1147
- const incoming_name = incoming.name;
1148
- if (!(existing_name === incoming_name)) {
1149
- return false;
1150
- }
1151
- const existing_description = existing.description;
1152
- const incoming_description = incoming.description;
1153
- if (!(existing_description === incoming_description)) {
1154
- return false;
1155
- }
1156
- const existing_id = existing.id;
1157
- const incoming_id = incoming.id;
1158
- if (!(existing_id === incoming_id)) {
1159
- return false;
1160
- }
1161
- const existing_tasks = existing.tasks;
1162
- const incoming_tasks = incoming.tasks;
1163
- const equals_tasks_items = equalsArray(existing_tasks, incoming_tasks, (existing_tasks_item, incoming_tasks_item) => {
1164
- if (!(equals$2(existing_tasks_item, incoming_tasks_item))) {
1165
- return false;
1166
- }
1167
- });
1168
- if (equals_tasks_items === false) {
1169
- return false;
1170
- }
1171
- return true;
1022
+ const VERSION$1 = "1a04a332b32cf015d23bb89ffcca76e9";
1023
+ function validate$1(obj, path = 'EnablementProgramSectionRepresentation') {
1024
+ const v_error = (() => {
1025
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1026
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1027
+ }
1028
+ const obj_description = obj.description;
1029
+ const path_description = path + '.description';
1030
+ let obj_description_union0 = null;
1031
+ const obj_description_union0_error = (() => {
1032
+ if (typeof obj_description !== 'string') {
1033
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1034
+ }
1035
+ })();
1036
+ if (obj_description_union0_error != null) {
1037
+ obj_description_union0 = obj_description_union0_error.message;
1038
+ }
1039
+ let obj_description_union1 = null;
1040
+ const obj_description_union1_error = (() => {
1041
+ if (obj_description !== null) {
1042
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1043
+ }
1044
+ })();
1045
+ if (obj_description_union1_error != null) {
1046
+ obj_description_union1 = obj_description_union1_error.message;
1047
+ }
1048
+ if (obj_description_union0 && obj_description_union1) {
1049
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
1050
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
1051
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
1052
+ return new TypeError(message);
1053
+ }
1054
+ const obj_id = obj.id;
1055
+ const path_id = path + '.id';
1056
+ let obj_id_union0 = null;
1057
+ const obj_id_union0_error = (() => {
1058
+ if (typeof obj_id !== 'string') {
1059
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1060
+ }
1061
+ })();
1062
+ if (obj_id_union0_error != null) {
1063
+ obj_id_union0 = obj_id_union0_error.message;
1064
+ }
1065
+ let obj_id_union1 = null;
1066
+ const obj_id_union1_error = (() => {
1067
+ if (obj_id !== null) {
1068
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1069
+ }
1070
+ })();
1071
+ if (obj_id_union1_error != null) {
1072
+ obj_id_union1 = obj_id_union1_error.message;
1073
+ }
1074
+ if (obj_id_union0 && obj_id_union1) {
1075
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
1076
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
1077
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
1078
+ return new TypeError(message);
1079
+ }
1080
+ const obj_name = obj.name;
1081
+ const path_name = path + '.name';
1082
+ if (typeof obj_name !== 'string') {
1083
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1084
+ }
1085
+ const obj_sequenceNumber = obj.sequenceNumber;
1086
+ const path_sequenceNumber = path + '.sequenceNumber';
1087
+ if (typeof obj_sequenceNumber !== 'number' || (typeof obj_sequenceNumber === 'number' && Math.floor(obj_sequenceNumber) !== obj_sequenceNumber)) {
1088
+ return new TypeError('Expected "integer" but received "' + typeof obj_sequenceNumber + '" (at "' + path_sequenceNumber + '")');
1089
+ }
1090
+ const obj_tasks = obj.tasks;
1091
+ const path_tasks = path + '.tasks';
1092
+ if (!ArrayIsArray(obj_tasks)) {
1093
+ return new TypeError('Expected "array" but received "' + typeof obj_tasks + '" (at "' + path_tasks + '")');
1094
+ }
1095
+ for (let i = 0; i < obj_tasks.length; i++) {
1096
+ const obj_tasks_item = obj_tasks[i];
1097
+ const path_tasks_item = path_tasks + '[' + i + ']';
1098
+ const referencepath_tasks_itemValidationError = validate$2(obj_tasks_item, path_tasks_item);
1099
+ if (referencepath_tasks_itemValidationError !== null) {
1100
+ let message = 'Object doesn\'t match AbstractEnablementProgramTaskRepresentation (at "' + path_tasks_item + '")\n';
1101
+ message += referencepath_tasks_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1102
+ return new TypeError(message);
1103
+ }
1104
+ }
1105
+ })();
1106
+ return v_error === undefined ? null : v_error;
1107
+ }
1108
+ const select$2 = function EnablementProgramSectionRepresentationSelect() {
1109
+ const { selections: AbstractEnablementProgramTaskRepresentation__selections, opaque: AbstractEnablementProgramTaskRepresentation__opaque, } = select$3();
1110
+ return {
1111
+ kind: 'Fragment',
1112
+ version: VERSION$1,
1113
+ private: [],
1114
+ selections: [
1115
+ {
1116
+ name: 'description',
1117
+ kind: 'Scalar'
1118
+ },
1119
+ {
1120
+ name: 'id',
1121
+ kind: 'Scalar'
1122
+ },
1123
+ {
1124
+ name: 'name',
1125
+ kind: 'Scalar'
1126
+ },
1127
+ {
1128
+ name: 'sequenceNumber',
1129
+ kind: 'Scalar'
1130
+ },
1131
+ {
1132
+ name: 'tasks',
1133
+ kind: 'Object',
1134
+ plural: true,
1135
+ selections: AbstractEnablementProgramTaskRepresentation__selections
1136
+ }
1137
+ ]
1138
+ };
1139
+ };
1140
+ function equals$1(existing, incoming) {
1141
+ const existing_sequenceNumber = existing.sequenceNumber;
1142
+ const incoming_sequenceNumber = incoming.sequenceNumber;
1143
+ if (!(existing_sequenceNumber === incoming_sequenceNumber)) {
1144
+ return false;
1145
+ }
1146
+ const existing_name = existing.name;
1147
+ const incoming_name = incoming.name;
1148
+ if (!(existing_name === incoming_name)) {
1149
+ return false;
1150
+ }
1151
+ const existing_description = existing.description;
1152
+ const incoming_description = incoming.description;
1153
+ if (!(existing_description === incoming_description)) {
1154
+ return false;
1155
+ }
1156
+ const existing_id = existing.id;
1157
+ const incoming_id = incoming.id;
1158
+ if (!(existing_id === incoming_id)) {
1159
+ return false;
1160
+ }
1161
+ const existing_tasks = existing.tasks;
1162
+ const incoming_tasks = incoming.tasks;
1163
+ const equals_tasks_items = equalsArray(existing_tasks, incoming_tasks, (existing_tasks_item, incoming_tasks_item) => {
1164
+ if (!(equals$2(existing_tasks_item, incoming_tasks_item))) {
1165
+ return false;
1166
+ }
1167
+ });
1168
+ if (equals_tasks_items === false) {
1169
+ return false;
1170
+ }
1171
+ return true;
1172
1172
  }
1173
1173
 
1174
- const TTL = 604800000;
1175
- const VERSION = "f9ce8118e1ad936cda186804d38b9037";
1176
- function validate(obj, path = 'EnablementProgramRepresentation') {
1177
- const v_error = (() => {
1178
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1179
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1180
- }
1181
- const obj_description = obj.description;
1182
- const path_description = path + '.description';
1183
- if (typeof obj_description !== 'string') {
1184
- return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1185
- }
1186
- const obj_id = obj.id;
1187
- const path_id = path + '.id';
1188
- let obj_id_union0 = null;
1189
- const obj_id_union0_error = (() => {
1190
- if (typeof obj_id !== 'string') {
1191
- return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1192
- }
1193
- })();
1194
- if (obj_id_union0_error != null) {
1195
- obj_id_union0 = obj_id_union0_error.message;
1196
- }
1197
- let obj_id_union1 = null;
1198
- const obj_id_union1_error = (() => {
1199
- if (obj_id !== null) {
1200
- return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1201
- }
1202
- })();
1203
- if (obj_id_union1_error != null) {
1204
- obj_id_union1 = obj_id_union1_error.message;
1205
- }
1206
- if (obj_id_union0 && obj_id_union1) {
1207
- let message = 'Object doesn\'t match union (at "' + path_id + '")';
1208
- message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
1209
- message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
1210
- return new TypeError(message);
1211
- }
1212
- const obj_isOutcomeBased = obj.isOutcomeBased;
1213
- const path_isOutcomeBased = path + '.isOutcomeBased';
1214
- if (typeof obj_isOutcomeBased !== 'boolean') {
1215
- return new TypeError('Expected "boolean" but received "' + typeof obj_isOutcomeBased + '" (at "' + path_isOutcomeBased + '")');
1216
- }
1217
- const obj_isTemplate = obj.isTemplate;
1218
- const path_isTemplate = path + '.isTemplate';
1219
- if (typeof obj_isTemplate !== 'boolean') {
1220
- return new TypeError('Expected "boolean" but received "' + typeof obj_isTemplate + '" (at "' + path_isTemplate + '")');
1221
- }
1222
- const obj_name = obj.name;
1223
- const path_name = path + '.name';
1224
- if (typeof obj_name !== 'string') {
1225
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1226
- }
1227
- const obj_sections = obj.sections;
1228
- const path_sections = path + '.sections';
1229
- if (!ArrayIsArray(obj_sections)) {
1230
- return new TypeError('Expected "array" but received "' + typeof obj_sections + '" (at "' + path_sections + '")');
1231
- }
1232
- for (let i = 0; i < obj_sections.length; i++) {
1233
- const obj_sections_item = obj_sections[i];
1234
- const path_sections_item = path_sections + '[' + i + ']';
1235
- const referencepath_sections_itemValidationError = validate$1(obj_sections_item, path_sections_item);
1236
- if (referencepath_sections_itemValidationError !== null) {
1237
- let message = 'Object doesn\'t match EnablementProgramSectionRepresentation (at "' + path_sections_item + '")\n';
1238
- message += referencepath_sections_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1239
- return new TypeError(message);
1240
- }
1241
- }
1242
- const obj_status = obj.status;
1243
- const path_status = path + '.status';
1244
- if (typeof obj_status !== 'string') {
1245
- return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1246
- }
1247
- const obj_systemModStamp = obj.systemModStamp;
1248
- const path_systemModStamp = path + '.systemModStamp';
1249
- if (typeof obj_systemModStamp !== 'string') {
1250
- return new TypeError('Expected "string" but received "' + typeof obj_systemModStamp + '" (at "' + path_systemModStamp + '")');
1251
- }
1252
- const obj_tasks = obj.tasks;
1253
- const path_tasks = path + '.tasks';
1254
- if (!ArrayIsArray(obj_tasks)) {
1255
- return new TypeError('Expected "array" but received "' + typeof obj_tasks + '" (at "' + path_tasks + '")');
1256
- }
1257
- for (let i = 0; i < obj_tasks.length; i++) {
1258
- const obj_tasks_item = obj_tasks[i];
1259
- const path_tasks_item = path_tasks + '[' + i + ']';
1260
- const referencepath_tasks_itemValidationError = validate$2(obj_tasks_item, path_tasks_item);
1261
- if (referencepath_tasks_itemValidationError !== null) {
1262
- let message = 'Object doesn\'t match AbstractEnablementProgramTaskRepresentation (at "' + path_tasks_item + '")\n';
1263
- message += referencepath_tasks_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1264
- return new TypeError(message);
1265
- }
1266
- }
1267
- })();
1268
- return v_error === undefined ? null : v_error;
1269
- }
1270
- const RepresentationType = 'EnablementProgramRepresentation';
1271
- function normalize(input, existing, path, luvio, store, timestamp) {
1272
- return input;
1273
- }
1274
- const select$1 = function EnablementProgramRepresentationSelect() {
1275
- const { selections: EnablementProgramSectionRepresentation__selections, opaque: EnablementProgramSectionRepresentation__opaque, } = select$2();
1276
- const { selections: AbstractEnablementProgramTaskRepresentation__selections, opaque: AbstractEnablementProgramTaskRepresentation__opaque, } = select$3();
1277
- return {
1278
- kind: 'Fragment',
1279
- version: VERSION,
1280
- private: [],
1281
- selections: [
1282
- {
1283
- name: 'description',
1284
- kind: 'Scalar'
1285
- },
1286
- {
1287
- name: 'id',
1288
- kind: 'Scalar'
1289
- },
1290
- {
1291
- name: 'isOutcomeBased',
1292
- kind: 'Scalar'
1293
- },
1294
- {
1295
- name: 'isTemplate',
1296
- kind: 'Scalar'
1297
- },
1298
- {
1299
- name: 'name',
1300
- kind: 'Scalar'
1301
- },
1302
- {
1303
- name: 'sections',
1304
- kind: 'Object',
1305
- plural: true,
1306
- selections: EnablementProgramSectionRepresentation__selections
1307
- },
1308
- {
1309
- name: 'status',
1310
- kind: 'Scalar'
1311
- },
1312
- {
1313
- name: 'systemModStamp',
1314
- kind: 'Scalar'
1315
- },
1316
- {
1317
- name: 'tasks',
1318
- kind: 'Object',
1319
- plural: true,
1320
- selections: AbstractEnablementProgramTaskRepresentation__selections
1321
- }
1322
- ]
1323
- };
1324
- };
1325
- function equals(existing, incoming) {
1326
- const existing_isOutcomeBased = existing.isOutcomeBased;
1327
- const incoming_isOutcomeBased = incoming.isOutcomeBased;
1328
- if (!(existing_isOutcomeBased === incoming_isOutcomeBased)) {
1329
- return false;
1330
- }
1331
- const existing_isTemplate = existing.isTemplate;
1332
- const incoming_isTemplate = incoming.isTemplate;
1333
- if (!(existing_isTemplate === incoming_isTemplate)) {
1334
- return false;
1335
- }
1336
- const existing_description = existing.description;
1337
- const incoming_description = incoming.description;
1338
- if (!(existing_description === incoming_description)) {
1339
- return false;
1340
- }
1341
- const existing_name = existing.name;
1342
- const incoming_name = incoming.name;
1343
- if (!(existing_name === incoming_name)) {
1344
- return false;
1345
- }
1346
- const existing_status = existing.status;
1347
- const incoming_status = incoming.status;
1348
- if (!(existing_status === incoming_status)) {
1349
- return false;
1350
- }
1351
- const existing_systemModStamp = existing.systemModStamp;
1352
- const incoming_systemModStamp = incoming.systemModStamp;
1353
- if (!(existing_systemModStamp === incoming_systemModStamp)) {
1354
- return false;
1355
- }
1356
- const existing_id = existing.id;
1357
- const incoming_id = incoming.id;
1358
- if (!(existing_id === incoming_id)) {
1359
- return false;
1360
- }
1361
- const existing_sections = existing.sections;
1362
- const incoming_sections = incoming.sections;
1363
- const equals_sections_items = equalsArray(existing_sections, incoming_sections, (existing_sections_item, incoming_sections_item) => {
1364
- if (!(equals$1(existing_sections_item, incoming_sections_item))) {
1365
- return false;
1366
- }
1367
- });
1368
- if (equals_sections_items === false) {
1369
- return false;
1370
- }
1371
- const existing_tasks = existing.tasks;
1372
- const incoming_tasks = incoming.tasks;
1373
- const equals_tasks_items = equalsArray(existing_tasks, incoming_tasks, (existing_tasks_item, incoming_tasks_item) => {
1374
- if (!(equals$2(existing_tasks_item, incoming_tasks_item))) {
1375
- return false;
1376
- }
1377
- });
1378
- if (equals_tasks_items === false) {
1379
- return false;
1380
- }
1381
- return true;
1382
- }
1383
- const ingest = function EnablementProgramRepresentationIngest(input, path, luvio, store, timestamp) {
1384
- if (process.env.NODE_ENV !== 'production') {
1385
- const validateError = validate(input);
1386
- if (validateError !== null) {
1387
- throw validateError;
1388
- }
1389
- }
1390
- const key = path.fullPath;
1391
- const existingRecord = store.readEntry(key);
1392
- const ttlToUse = TTL;
1393
- let incomingRecord = normalize(input, store.readEntry(key), {
1394
- fullPath: key,
1395
- parent: path.parent,
1396
- propertyName: path.propertyName,
1397
- ttl: ttlToUse
1398
- });
1399
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
1400
- luvio.storePublish(key, incomingRecord);
1401
- }
1402
- {
1403
- const storeMetadataParams = {
1404
- ttl: ttlToUse,
1405
- namespace: "enablement-program",
1406
- version: VERSION,
1407
- representationName: RepresentationType,
1408
- };
1409
- luvio.publishStoreMetadata(key, storeMetadataParams);
1410
- }
1411
- return createLink(key);
1412
- };
1413
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
1414
- const rootKeySet = new StoreKeyMap();
1415
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1416
- const rootKey = fullPathFactory();
1417
- rootKeySet.set(rootKey, {
1418
- namespace: keyPrefix,
1419
- representationName: RepresentationType,
1420
- mergeable: false
1421
- });
1422
- return rootKeySet;
1174
+ const TTL = 604800000;
1175
+ const VERSION = "f9ce8118e1ad936cda186804d38b9037";
1176
+ function validate(obj, path = 'EnablementProgramRepresentation') {
1177
+ const v_error = (() => {
1178
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1179
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1180
+ }
1181
+ const obj_description = obj.description;
1182
+ const path_description = path + '.description';
1183
+ if (typeof obj_description !== 'string') {
1184
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1185
+ }
1186
+ const obj_id = obj.id;
1187
+ const path_id = path + '.id';
1188
+ let obj_id_union0 = null;
1189
+ const obj_id_union0_error = (() => {
1190
+ if (typeof obj_id !== 'string') {
1191
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1192
+ }
1193
+ })();
1194
+ if (obj_id_union0_error != null) {
1195
+ obj_id_union0 = obj_id_union0_error.message;
1196
+ }
1197
+ let obj_id_union1 = null;
1198
+ const obj_id_union1_error = (() => {
1199
+ if (obj_id !== null) {
1200
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1201
+ }
1202
+ })();
1203
+ if (obj_id_union1_error != null) {
1204
+ obj_id_union1 = obj_id_union1_error.message;
1205
+ }
1206
+ if (obj_id_union0 && obj_id_union1) {
1207
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
1208
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
1209
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
1210
+ return new TypeError(message);
1211
+ }
1212
+ const obj_isOutcomeBased = obj.isOutcomeBased;
1213
+ const path_isOutcomeBased = path + '.isOutcomeBased';
1214
+ if (typeof obj_isOutcomeBased !== 'boolean') {
1215
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isOutcomeBased + '" (at "' + path_isOutcomeBased + '")');
1216
+ }
1217
+ const obj_isTemplate = obj.isTemplate;
1218
+ const path_isTemplate = path + '.isTemplate';
1219
+ if (typeof obj_isTemplate !== 'boolean') {
1220
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isTemplate + '" (at "' + path_isTemplate + '")');
1221
+ }
1222
+ const obj_name = obj.name;
1223
+ const path_name = path + '.name';
1224
+ if (typeof obj_name !== 'string') {
1225
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1226
+ }
1227
+ const obj_sections = obj.sections;
1228
+ const path_sections = path + '.sections';
1229
+ if (!ArrayIsArray(obj_sections)) {
1230
+ return new TypeError('Expected "array" but received "' + typeof obj_sections + '" (at "' + path_sections + '")');
1231
+ }
1232
+ for (let i = 0; i < obj_sections.length; i++) {
1233
+ const obj_sections_item = obj_sections[i];
1234
+ const path_sections_item = path_sections + '[' + i + ']';
1235
+ const referencepath_sections_itemValidationError = validate$1(obj_sections_item, path_sections_item);
1236
+ if (referencepath_sections_itemValidationError !== null) {
1237
+ let message = 'Object doesn\'t match EnablementProgramSectionRepresentation (at "' + path_sections_item + '")\n';
1238
+ message += referencepath_sections_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1239
+ return new TypeError(message);
1240
+ }
1241
+ }
1242
+ const obj_status = obj.status;
1243
+ const path_status = path + '.status';
1244
+ if (typeof obj_status !== 'string') {
1245
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1246
+ }
1247
+ const obj_systemModStamp = obj.systemModStamp;
1248
+ const path_systemModStamp = path + '.systemModStamp';
1249
+ if (typeof obj_systemModStamp !== 'string') {
1250
+ return new TypeError('Expected "string" but received "' + typeof obj_systemModStamp + '" (at "' + path_systemModStamp + '")');
1251
+ }
1252
+ const obj_tasks = obj.tasks;
1253
+ const path_tasks = path + '.tasks';
1254
+ if (!ArrayIsArray(obj_tasks)) {
1255
+ return new TypeError('Expected "array" but received "' + typeof obj_tasks + '" (at "' + path_tasks + '")');
1256
+ }
1257
+ for (let i = 0; i < obj_tasks.length; i++) {
1258
+ const obj_tasks_item = obj_tasks[i];
1259
+ const path_tasks_item = path_tasks + '[' + i + ']';
1260
+ const referencepath_tasks_itemValidationError = validate$2(obj_tasks_item, path_tasks_item);
1261
+ if (referencepath_tasks_itemValidationError !== null) {
1262
+ let message = 'Object doesn\'t match AbstractEnablementProgramTaskRepresentation (at "' + path_tasks_item + '")\n';
1263
+ message += referencepath_tasks_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1264
+ return new TypeError(message);
1265
+ }
1266
+ }
1267
+ })();
1268
+ return v_error === undefined ? null : v_error;
1269
+ }
1270
+ const RepresentationType = 'EnablementProgramRepresentation';
1271
+ function normalize(input, existing, path, luvio, store, timestamp) {
1272
+ return input;
1273
+ }
1274
+ const select$1 = function EnablementProgramRepresentationSelect() {
1275
+ const { selections: EnablementProgramSectionRepresentation__selections, opaque: EnablementProgramSectionRepresentation__opaque, } = select$2();
1276
+ const { selections: AbstractEnablementProgramTaskRepresentation__selections, opaque: AbstractEnablementProgramTaskRepresentation__opaque, } = select$3();
1277
+ return {
1278
+ kind: 'Fragment',
1279
+ version: VERSION,
1280
+ private: [],
1281
+ selections: [
1282
+ {
1283
+ name: 'description',
1284
+ kind: 'Scalar'
1285
+ },
1286
+ {
1287
+ name: 'id',
1288
+ kind: 'Scalar'
1289
+ },
1290
+ {
1291
+ name: 'isOutcomeBased',
1292
+ kind: 'Scalar'
1293
+ },
1294
+ {
1295
+ name: 'isTemplate',
1296
+ kind: 'Scalar'
1297
+ },
1298
+ {
1299
+ name: 'name',
1300
+ kind: 'Scalar'
1301
+ },
1302
+ {
1303
+ name: 'sections',
1304
+ kind: 'Object',
1305
+ plural: true,
1306
+ selections: EnablementProgramSectionRepresentation__selections
1307
+ },
1308
+ {
1309
+ name: 'status',
1310
+ kind: 'Scalar'
1311
+ },
1312
+ {
1313
+ name: 'systemModStamp',
1314
+ kind: 'Scalar'
1315
+ },
1316
+ {
1317
+ name: 'tasks',
1318
+ kind: 'Object',
1319
+ plural: true,
1320
+ selections: AbstractEnablementProgramTaskRepresentation__selections
1321
+ }
1322
+ ]
1323
+ };
1324
+ };
1325
+ function equals(existing, incoming) {
1326
+ const existing_isOutcomeBased = existing.isOutcomeBased;
1327
+ const incoming_isOutcomeBased = incoming.isOutcomeBased;
1328
+ if (!(existing_isOutcomeBased === incoming_isOutcomeBased)) {
1329
+ return false;
1330
+ }
1331
+ const existing_isTemplate = existing.isTemplate;
1332
+ const incoming_isTemplate = incoming.isTemplate;
1333
+ if (!(existing_isTemplate === incoming_isTemplate)) {
1334
+ return false;
1335
+ }
1336
+ const existing_description = existing.description;
1337
+ const incoming_description = incoming.description;
1338
+ if (!(existing_description === incoming_description)) {
1339
+ return false;
1340
+ }
1341
+ const existing_name = existing.name;
1342
+ const incoming_name = incoming.name;
1343
+ if (!(existing_name === incoming_name)) {
1344
+ return false;
1345
+ }
1346
+ const existing_status = existing.status;
1347
+ const incoming_status = incoming.status;
1348
+ if (!(existing_status === incoming_status)) {
1349
+ return false;
1350
+ }
1351
+ const existing_systemModStamp = existing.systemModStamp;
1352
+ const incoming_systemModStamp = incoming.systemModStamp;
1353
+ if (!(existing_systemModStamp === incoming_systemModStamp)) {
1354
+ return false;
1355
+ }
1356
+ const existing_id = existing.id;
1357
+ const incoming_id = incoming.id;
1358
+ if (!(existing_id === incoming_id)) {
1359
+ return false;
1360
+ }
1361
+ const existing_sections = existing.sections;
1362
+ const incoming_sections = incoming.sections;
1363
+ const equals_sections_items = equalsArray(existing_sections, incoming_sections, (existing_sections_item, incoming_sections_item) => {
1364
+ if (!(equals$1(existing_sections_item, incoming_sections_item))) {
1365
+ return false;
1366
+ }
1367
+ });
1368
+ if (equals_sections_items === false) {
1369
+ return false;
1370
+ }
1371
+ const existing_tasks = existing.tasks;
1372
+ const incoming_tasks = incoming.tasks;
1373
+ const equals_tasks_items = equalsArray(existing_tasks, incoming_tasks, (existing_tasks_item, incoming_tasks_item) => {
1374
+ if (!(equals$2(existing_tasks_item, incoming_tasks_item))) {
1375
+ return false;
1376
+ }
1377
+ });
1378
+ if (equals_tasks_items === false) {
1379
+ return false;
1380
+ }
1381
+ return true;
1382
+ }
1383
+ const ingest = function EnablementProgramRepresentationIngest(input, path, luvio, store, timestamp) {
1384
+ if (process.env.NODE_ENV !== 'production') {
1385
+ const validateError = validate(input);
1386
+ if (validateError !== null) {
1387
+ throw validateError;
1388
+ }
1389
+ }
1390
+ const key = path.fullPath;
1391
+ const existingRecord = store.readEntry(key);
1392
+ const ttlToUse = TTL;
1393
+ let incomingRecord = normalize(input, store.readEntry(key), {
1394
+ fullPath: key,
1395
+ parent: path.parent,
1396
+ propertyName: path.propertyName,
1397
+ ttl: ttlToUse
1398
+ });
1399
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
1400
+ luvio.storePublish(key, incomingRecord);
1401
+ }
1402
+ {
1403
+ const storeMetadataParams = {
1404
+ ttl: ttlToUse,
1405
+ namespace: "enablement-program",
1406
+ version: VERSION,
1407
+ representationName: RepresentationType,
1408
+ };
1409
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1410
+ }
1411
+ return createLink(key);
1412
+ };
1413
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
1414
+ const rootKeySet = new StoreKeyMap();
1415
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1416
+ const rootKey = fullPathFactory();
1417
+ rootKeySet.set(rootKey, {
1418
+ namespace: keyPrefix,
1419
+ representationName: RepresentationType,
1420
+ mergeable: false
1421
+ });
1422
+ return rootKeySet;
1423
1423
  }
1424
1424
 
1425
- function select(luvio, params) {
1426
- return select$1();
1427
- }
1428
- function keyBuilder$1(luvio, params) {
1429
- return keyPrefix + '::EnablementProgramRepresentation:(' + 'programTemplateName:' + params.urlParams.programTemplateName + ')';
1430
- }
1431
- function getResponseCacheKeys(luvio, resourceParams, response) {
1432
- return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
1433
- }
1434
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1435
- const { body } = response;
1436
- const key = keyBuilder$1(luvio, resourceParams);
1437
- luvio.storeIngest(key, ingest, body);
1438
- const snapshot = luvio.storeLookup({
1439
- recordId: key,
1440
- node: select(),
1441
- variables: {},
1442
- }, snapshotRefresh);
1443
- if (process.env.NODE_ENV !== 'production') {
1444
- if (snapshot.state !== 'Fulfilled') {
1445
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1446
- }
1447
- }
1448
- return snapshot;
1449
- }
1450
- function ingestError(luvio, params, error, snapshotRefresh) {
1451
- const key = keyBuilder$1(luvio, params);
1452
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1453
- const storeMetadataParams = {
1454
- ttl: TTL,
1455
- namespace: keyPrefix,
1456
- version: VERSION,
1457
- representationName: RepresentationType
1458
- };
1459
- luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1460
- return errorSnapshot;
1461
- }
1462
- function createResourceRequest(config) {
1463
- const headers = {};
1464
- return {
1465
- baseUri: '/services/data/v58.0',
1466
- basePath: '/connect/enablement/programTemplate/' + config.urlParams.programTemplateName + '',
1467
- method: 'get',
1468
- body: null,
1469
- urlParams: config.urlParams,
1470
- queryParams: {},
1471
- headers,
1472
- priority: 'normal',
1473
- };
1425
+ function select(luvio, params) {
1426
+ return select$1();
1427
+ }
1428
+ function keyBuilder$1(luvio, params) {
1429
+ return keyPrefix + '::EnablementProgramRepresentation:(' + 'programTemplateName:' + params.urlParams.programTemplateName + ')';
1430
+ }
1431
+ function getResponseCacheKeys(luvio, resourceParams, response) {
1432
+ return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
1433
+ }
1434
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1435
+ const { body } = response;
1436
+ const key = keyBuilder$1(luvio, resourceParams);
1437
+ luvio.storeIngest(key, ingest, body);
1438
+ const snapshot = luvio.storeLookup({
1439
+ recordId: key,
1440
+ node: select(),
1441
+ variables: {},
1442
+ }, snapshotRefresh);
1443
+ if (process.env.NODE_ENV !== 'production') {
1444
+ if (snapshot.state !== 'Fulfilled') {
1445
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1446
+ }
1447
+ }
1448
+ return snapshot;
1449
+ }
1450
+ function ingestError(luvio, params, error, snapshotRefresh) {
1451
+ const key = keyBuilder$1(luvio, params);
1452
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1453
+ const storeMetadataParams = {
1454
+ ttl: TTL,
1455
+ namespace: keyPrefix,
1456
+ version: VERSION,
1457
+ representationName: RepresentationType
1458
+ };
1459
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1460
+ return errorSnapshot;
1461
+ }
1462
+ function createResourceRequest(config) {
1463
+ const headers = {};
1464
+ return {
1465
+ baseUri: '/services/data/v58.0',
1466
+ basePath: '/connect/enablement/programTemplate/' + config.urlParams.programTemplateName + '',
1467
+ method: 'get',
1468
+ body: null,
1469
+ urlParams: config.urlParams,
1470
+ queryParams: {},
1471
+ headers,
1472
+ priority: 'normal',
1473
+ };
1474
1474
  }
1475
1475
 
1476
- const getProgramTemplate_ConfigPropertyNames = {
1477
- displayName: 'getProgramTemplate',
1478
- parameters: {
1479
- required: ['programTemplateName'],
1480
- optional: []
1481
- }
1482
- };
1483
- function createResourceParams(config) {
1484
- const resourceParams = {
1485
- urlParams: {
1486
- programTemplateName: config.programTemplateName
1487
- }
1488
- };
1489
- return resourceParams;
1490
- }
1491
- function keyBuilder(luvio, config) {
1492
- const resourceParams = createResourceParams(config);
1493
- return keyBuilder$1(luvio, resourceParams);
1494
- }
1495
- function typeCheckConfig(untrustedConfig) {
1496
- const config = {};
1497
- const untrustedConfig_programTemplateName = untrustedConfig.programTemplateName;
1498
- if (typeof untrustedConfig_programTemplateName === 'string') {
1499
- config.programTemplateName = untrustedConfig_programTemplateName;
1500
- }
1501
- return config;
1502
- }
1503
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1504
- if (!untrustedIsObject(untrustedConfig)) {
1505
- return null;
1506
- }
1507
- if (process.env.NODE_ENV !== 'production') {
1508
- validateConfig(untrustedConfig, configPropertyNames);
1509
- }
1510
- const config = typeCheckConfig(untrustedConfig);
1511
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
1512
- return null;
1513
- }
1514
- return config;
1515
- }
1516
- function adapterFragment(luvio, config) {
1517
- createResourceParams(config);
1518
- return select();
1519
- }
1520
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1521
- const snapshot = ingestSuccess(luvio, resourceParams, response, {
1522
- config,
1523
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1524
- });
1525
- return luvio.storeBroadcast().then(() => snapshot);
1526
- }
1527
- function onFetchResponseError(luvio, config, resourceParams, response) {
1528
- const snapshot = ingestError(luvio, resourceParams, response, {
1529
- config,
1530
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1531
- });
1532
- return luvio.storeBroadcast().then(() => snapshot);
1533
- }
1534
- function buildNetworkSnapshot(luvio, config, options) {
1535
- const resourceParams = createResourceParams(config);
1536
- const request = createResourceRequest(resourceParams);
1537
- return luvio.dispatchResourceRequest(request, options)
1538
- .then((response) => {
1539
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
1540
- }, (response) => {
1541
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1542
- });
1543
- }
1544
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1545
- const { luvio, config } = context;
1546
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1547
- const dispatchOptions = {
1548
- resourceRequestContext: {
1549
- requestCorrelator,
1550
- luvioRequestMethod: undefined,
1551
- },
1552
- eventObservers
1553
- };
1554
- if (networkPriority !== 'normal') {
1555
- dispatchOptions.overrides = {
1556
- priority: networkPriority
1557
- };
1558
- }
1559
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
1560
- }
1561
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
1562
- const { luvio, config } = context;
1563
- const selector = {
1564
- recordId: keyBuilder(luvio, config),
1565
- node: adapterFragment(luvio, config),
1566
- variables: {},
1567
- };
1568
- const cacheSnapshot = storeLookup(selector, {
1569
- config,
1570
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1571
- });
1572
- return cacheSnapshot;
1573
- }
1574
- const getProgramTemplateAdapterFactory = (luvio) => function enablementProgram__getProgramTemplate(untrustedConfig, requestContext) {
1575
- const config = validateAdapterConfig(untrustedConfig, getProgramTemplate_ConfigPropertyNames);
1576
- // Invalid or incomplete config
1577
- if (config === null) {
1578
- return null;
1579
- }
1580
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1581
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1476
+ const getProgramTemplate_ConfigPropertyNames = {
1477
+ displayName: 'getProgramTemplate',
1478
+ parameters: {
1479
+ required: ['programTemplateName'],
1480
+ optional: []
1481
+ }
1482
+ };
1483
+ function createResourceParams(config) {
1484
+ const resourceParams = {
1485
+ urlParams: {
1486
+ programTemplateName: config.programTemplateName
1487
+ }
1488
+ };
1489
+ return resourceParams;
1490
+ }
1491
+ function keyBuilder(luvio, config) {
1492
+ const resourceParams = createResourceParams(config);
1493
+ return keyBuilder$1(luvio, resourceParams);
1494
+ }
1495
+ function typeCheckConfig(untrustedConfig) {
1496
+ const config = {};
1497
+ const untrustedConfig_programTemplateName = untrustedConfig.programTemplateName;
1498
+ if (typeof untrustedConfig_programTemplateName === 'string') {
1499
+ config.programTemplateName = untrustedConfig_programTemplateName;
1500
+ }
1501
+ return config;
1502
+ }
1503
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1504
+ if (!untrustedIsObject(untrustedConfig)) {
1505
+ return null;
1506
+ }
1507
+ if (process.env.NODE_ENV !== 'production') {
1508
+ validateConfig(untrustedConfig, configPropertyNames);
1509
+ }
1510
+ const config = typeCheckConfig(untrustedConfig);
1511
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1512
+ return null;
1513
+ }
1514
+ return config;
1515
+ }
1516
+ function adapterFragment(luvio, config) {
1517
+ createResourceParams(config);
1518
+ return select();
1519
+ }
1520
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1521
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
1522
+ config,
1523
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1524
+ });
1525
+ return luvio.storeBroadcast().then(() => snapshot);
1526
+ }
1527
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1528
+ const snapshot = ingestError(luvio, resourceParams, response, {
1529
+ config,
1530
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1531
+ });
1532
+ return luvio.storeBroadcast().then(() => snapshot);
1533
+ }
1534
+ function buildNetworkSnapshot(luvio, config, options) {
1535
+ const resourceParams = createResourceParams(config);
1536
+ const request = createResourceRequest(resourceParams);
1537
+ return luvio.dispatchResourceRequest(request, options)
1538
+ .then((response) => {
1539
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
1540
+ }, (response) => {
1541
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1542
+ });
1543
+ }
1544
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1545
+ const { luvio, config } = context;
1546
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1547
+ const dispatchOptions = {
1548
+ resourceRequestContext: {
1549
+ requestCorrelator,
1550
+ luvioRequestMethod: undefined,
1551
+ },
1552
+ eventObservers
1553
+ };
1554
+ if (networkPriority !== 'normal') {
1555
+ dispatchOptions.overrides = {
1556
+ priority: networkPriority
1557
+ };
1558
+ }
1559
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
1560
+ }
1561
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1562
+ const { luvio, config } = context;
1563
+ const selector = {
1564
+ recordId: keyBuilder(luvio, config),
1565
+ node: adapterFragment(luvio, config),
1566
+ variables: {},
1567
+ };
1568
+ const cacheSnapshot = storeLookup(selector, {
1569
+ config,
1570
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1571
+ });
1572
+ return cacheSnapshot;
1573
+ }
1574
+ const getProgramTemplateAdapterFactory = (luvio) => function enablementProgram__getProgramTemplate(untrustedConfig, requestContext) {
1575
+ const config = validateAdapterConfig(untrustedConfig, getProgramTemplate_ConfigPropertyNames);
1576
+ // Invalid or incomplete config
1577
+ if (config === null) {
1578
+ return null;
1579
+ }
1580
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1581
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1582
1582
  };
1583
1583
 
1584
1584
  export { getProgramTemplateAdapterFactory, getProgramTemplatesAdapterFactory };