@salesforce/lds-adapters-industries-assessment 1.100.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/industries-assessment.js +1688 -0
- package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
- package/dist/types/src/generated/adapters/getAssessmentEnvelope.d.ts +26 -0
- package/dist/types/src/generated/adapters/postAssessmentContextSearch.d.ts +16 -0
- package/dist/types/src/generated/adapters/postAssessmentEnvelope.d.ts +15 -0
- package/dist/types/src/generated/artifacts/main.d.ts +3 -0
- package/dist/types/src/generated/artifacts/sfdc.d.ts +5 -0
- package/dist/types/src/generated/resources/getConnectAssessmentsAssessmentenvelopes.d.ts +15 -0
- package/dist/types/src/generated/resources/postConnectAssessmentsAssessmentElementsByContextId.d.ts +16 -0
- package/dist/types/src/generated/resources/postConnectAssessmentsAssessmentenvelopes.d.ts +13 -0
- package/dist/types/src/generated/types/AssessmentContextSearchInputRepresentation.d.ts +41 -0
- package/dist/types/src/generated/types/AssessmentContextSearchResultRepresentation.d.ts +52 -0
- package/dist/types/src/generated/types/AssessmentContextSearchWrapperInputRepresentation.d.ts +30 -0
- package/dist/types/src/generated/types/AssessmentEnvelopeGetResultRepresentation.d.ts +36 -0
- package/dist/types/src/generated/types/AssessmentEnvelopeInputRepresentation.d.ts +47 -0
- package/dist/types/src/generated/types/AssessmentEnvelopeItemsListOutputRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/AssessmentEnvelopeItemsListRepresentation.d.ts +29 -0
- package/dist/types/src/generated/types/AssessmentEnvelopeItemsRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/AssessmentEnvelopeOutputRepresentation.d.ts +39 -0
- package/dist/types/src/generated/types/AssessmentEnvelopeRepresentation.d.ts +33 -0
- package/dist/types/src/generated/types/AssessmentEnvelopeResultRepresentation.d.ts +45 -0
- package/dist/types/src/generated/types/AssessmentEnvelopeWrapperInputRepresentation.d.ts +29 -0
- package/dist/types/src/generated/types/DerivedFiltersInputRepresentation.d.ts +32 -0
- package/dist/types/src/generated/types/FilterCriteriaRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/RecordOffsetRepresentation.d.ts +32 -0
- package/dist/types/src/generated/types/RecordsRepresentation.d.ts +41 -0
- package/dist/types/src/generated/types/SortOptionRepresentation.d.ts +32 -0
- package/dist/types/src/generated/types/type-utils.d.ts +39 -0
- package/dist/umd/es2018/industries-assessment.js +1698 -0
- package/dist/umd/es5/industries-assessment.js +1709 -0
- package/package.json +71 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +1730 -0
- package/src/raml/api.raml +357 -0
- package/src/raml/luvio.raml +33 -0
|
@@ -0,0 +1,1709 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
(function (global, factory) {
|
|
8
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
|
|
9
|
+
typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
|
|
10
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.industriesAssessment = {}, global.engine));
|
|
11
|
+
})(this, (function (exports, engine) { 'use strict';
|
|
12
|
+
|
|
13
|
+
var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
14
|
+
var ObjectKeys$1 = Object.keys;
|
|
15
|
+
var ArrayIsArray$1 = Array.isArray;
|
|
16
|
+
/**
|
|
17
|
+
* Validates an adapter config is well-formed.
|
|
18
|
+
* @param config The config to validate.
|
|
19
|
+
* @param adapter The adapter validation configuration.
|
|
20
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
21
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
22
|
+
*/
|
|
23
|
+
function validateConfig(config, adapter, oneOf) {
|
|
24
|
+
var displayName = adapter.displayName;
|
|
25
|
+
var _a = adapter.parameters, required = _a.required, optional = _a.optional, unsupported = _a.unsupported;
|
|
26
|
+
if (config === undefined ||
|
|
27
|
+
required.every(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
|
|
28
|
+
throw new TypeError("adapter ".concat(displayName, " configuration must specify ").concat(required.sort().join(', ')));
|
|
29
|
+
}
|
|
30
|
+
if (oneOf && oneOf.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
|
|
31
|
+
throw new TypeError("adapter ".concat(displayName, " configuration must specify one of ").concat(oneOf.sort().join(', ')));
|
|
32
|
+
}
|
|
33
|
+
if (unsupported !== undefined &&
|
|
34
|
+
unsupported.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); })) {
|
|
35
|
+
throw new TypeError("adapter ".concat(displayName, " does not yet support ").concat(unsupported.sort().join(', ')));
|
|
36
|
+
}
|
|
37
|
+
var supported = required.concat(optional);
|
|
38
|
+
if (ObjectKeys$1(config).some(function (key) { return !supported.includes(key); })) {
|
|
39
|
+
throw new TypeError("adapter ".concat(displayName, " configuration supports only ").concat(supported.sort().join(', ')));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function untrustedIsObject(untrusted) {
|
|
43
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
44
|
+
}
|
|
45
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
46
|
+
return configPropertyNames.parameters.required.every(function (req) { return req in config; });
|
|
47
|
+
}
|
|
48
|
+
var snapshotRefreshOptions = {
|
|
49
|
+
overrides: {
|
|
50
|
+
headers: {
|
|
51
|
+
'Cache-Control': 'no-cache',
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var keyPrefix = 'assessment';
|
|
56
|
+
|
|
57
|
+
var ObjectFreeze = Object.freeze, ObjectKeys = Object.keys;
|
|
58
|
+
var ArrayIsArray = Array.isArray;
|
|
59
|
+
var JSONStringify = JSON.stringify;
|
|
60
|
+
function equalsArray(a, b, equalsItem) {
|
|
61
|
+
var aLength = a.length;
|
|
62
|
+
var bLength = b.length;
|
|
63
|
+
if (aLength !== bLength) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
for (var i = 0; i < aLength; i++) {
|
|
67
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
function deepFreeze$3(value) {
|
|
74
|
+
// No need to freeze primitives
|
|
75
|
+
if (typeof value !== 'object' || value === null) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (ArrayIsArray(value)) {
|
|
79
|
+
for (var i = 0, len = value.length; i < len; i += 1) {
|
|
80
|
+
deepFreeze$3(value[i]);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
var keys = ObjectKeys(value);
|
|
85
|
+
for (var i = 0, len = keys.length; i < len; i += 1) {
|
|
86
|
+
deepFreeze$3(value[keys[i]]);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
ObjectFreeze(value);
|
|
90
|
+
}
|
|
91
|
+
function createLink(ref) {
|
|
92
|
+
return {
|
|
93
|
+
__ref: engine.serializeStructuredKey(ref),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function validate$a(obj, path) {
|
|
98
|
+
if (path === void 0) { path = 'AssessmentEnvelopeInputRepresentation'; }
|
|
99
|
+
var v_error = (function () {
|
|
100
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
101
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
102
|
+
}
|
|
103
|
+
if (obj.account !== undefined) {
|
|
104
|
+
var obj_account_1 = obj.account;
|
|
105
|
+
var path_account_1 = path + '.account';
|
|
106
|
+
var obj_account_union0 = null;
|
|
107
|
+
var obj_account_union0_error = (function () {
|
|
108
|
+
if (typeof obj_account_1 !== 'string') {
|
|
109
|
+
return new TypeError('Expected "string" but received "' + typeof obj_account_1 + '" (at "' + path_account_1 + '")');
|
|
110
|
+
}
|
|
111
|
+
})();
|
|
112
|
+
if (obj_account_union0_error != null) {
|
|
113
|
+
obj_account_union0 = obj_account_union0_error.message;
|
|
114
|
+
}
|
|
115
|
+
var obj_account_union1 = null;
|
|
116
|
+
var obj_account_union1_error = (function () {
|
|
117
|
+
if (obj_account_1 !== null) {
|
|
118
|
+
return new TypeError('Expected "null" but received "' + typeof obj_account_1 + '" (at "' + path_account_1 + '")');
|
|
119
|
+
}
|
|
120
|
+
})();
|
|
121
|
+
if (obj_account_union1_error != null) {
|
|
122
|
+
obj_account_union1 = obj_account_union1_error.message;
|
|
123
|
+
}
|
|
124
|
+
if (obj_account_union0 && obj_account_union1) {
|
|
125
|
+
var message = 'Object doesn\'t match union (at "' + path_account_1 + '")';
|
|
126
|
+
message += '\n' + obj_account_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
127
|
+
message += '\n' + obj_account_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
128
|
+
return new TypeError(message);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
var obj_assessmentEnvelopeItems = obj.assessmentEnvelopeItems;
|
|
132
|
+
var path_assessmentEnvelopeItems = path + '.assessmentEnvelopeItems';
|
|
133
|
+
if (!ArrayIsArray(obj_assessmentEnvelopeItems)) {
|
|
134
|
+
return new TypeError('Expected "array" but received "' + typeof obj_assessmentEnvelopeItems + '" (at "' + path_assessmentEnvelopeItems + '")');
|
|
135
|
+
}
|
|
136
|
+
for (var i = 0; i < obj_assessmentEnvelopeItems.length; i++) {
|
|
137
|
+
var obj_assessmentEnvelopeItems_item = obj_assessmentEnvelopeItems[i];
|
|
138
|
+
var path_assessmentEnvelopeItems_item = path_assessmentEnvelopeItems + '[' + i + ']';
|
|
139
|
+
if (typeof obj_assessmentEnvelopeItems_item !== 'object' || ArrayIsArray(obj_assessmentEnvelopeItems_item) || obj_assessmentEnvelopeItems_item === null) {
|
|
140
|
+
return new TypeError('Expected "object" but received "' + typeof obj_assessmentEnvelopeItems_item + '" (at "' + path_assessmentEnvelopeItems_item + '")');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (obj.contact !== undefined) {
|
|
144
|
+
var obj_contact_1 = obj.contact;
|
|
145
|
+
var path_contact_1 = path + '.contact';
|
|
146
|
+
var obj_contact_union0 = null;
|
|
147
|
+
var obj_contact_union0_error = (function () {
|
|
148
|
+
if (typeof obj_contact_1 !== 'string') {
|
|
149
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contact_1 + '" (at "' + path_contact_1 + '")');
|
|
150
|
+
}
|
|
151
|
+
})();
|
|
152
|
+
if (obj_contact_union0_error != null) {
|
|
153
|
+
obj_contact_union0 = obj_contact_union0_error.message;
|
|
154
|
+
}
|
|
155
|
+
var obj_contact_union1 = null;
|
|
156
|
+
var obj_contact_union1_error = (function () {
|
|
157
|
+
if (obj_contact_1 !== null) {
|
|
158
|
+
return new TypeError('Expected "null" but received "' + typeof obj_contact_1 + '" (at "' + path_contact_1 + '")');
|
|
159
|
+
}
|
|
160
|
+
})();
|
|
161
|
+
if (obj_contact_union1_error != null) {
|
|
162
|
+
obj_contact_union1 = obj_contact_union1_error.message;
|
|
163
|
+
}
|
|
164
|
+
if (obj_contact_union0 && obj_contact_union1) {
|
|
165
|
+
var message = 'Object doesn\'t match union (at "' + path_contact_1 + '")';
|
|
166
|
+
message += '\n' + obj_contact_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
167
|
+
message += '\n' + obj_contact_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
168
|
+
return new TypeError(message);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
var obj_expirationDateTime = obj.expirationDateTime;
|
|
172
|
+
var path_expirationDateTime = path + '.expirationDateTime';
|
|
173
|
+
var obj_expirationDateTime_union0 = null;
|
|
174
|
+
var obj_expirationDateTime_union0_error = (function () {
|
|
175
|
+
if (typeof obj_expirationDateTime !== 'string') {
|
|
176
|
+
return new TypeError('Expected "string" but received "' + typeof obj_expirationDateTime + '" (at "' + path_expirationDateTime + '")');
|
|
177
|
+
}
|
|
178
|
+
})();
|
|
179
|
+
if (obj_expirationDateTime_union0_error != null) {
|
|
180
|
+
obj_expirationDateTime_union0 = obj_expirationDateTime_union0_error.message;
|
|
181
|
+
}
|
|
182
|
+
var obj_expirationDateTime_union1 = null;
|
|
183
|
+
var obj_expirationDateTime_union1_error = (function () {
|
|
184
|
+
if (obj_expirationDateTime !== null) {
|
|
185
|
+
return new TypeError('Expected "null" but received "' + typeof obj_expirationDateTime + '" (at "' + path_expirationDateTime + '")');
|
|
186
|
+
}
|
|
187
|
+
})();
|
|
188
|
+
if (obj_expirationDateTime_union1_error != null) {
|
|
189
|
+
obj_expirationDateTime_union1 = obj_expirationDateTime_union1_error.message;
|
|
190
|
+
}
|
|
191
|
+
if (obj_expirationDateTime_union0 && obj_expirationDateTime_union1) {
|
|
192
|
+
var message = 'Object doesn\'t match union (at "' + path_expirationDateTime + '")';
|
|
193
|
+
message += '\n' + obj_expirationDateTime_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
194
|
+
message += '\n' + obj_expirationDateTime_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
195
|
+
return new TypeError(message);
|
|
196
|
+
}
|
|
197
|
+
var obj_name = obj.name;
|
|
198
|
+
var path_name = path + '.name';
|
|
199
|
+
var obj_name_union0 = null;
|
|
200
|
+
var obj_name_union0_error = (function () {
|
|
201
|
+
if (typeof obj_name !== 'string') {
|
|
202
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
203
|
+
}
|
|
204
|
+
})();
|
|
205
|
+
if (obj_name_union0_error != null) {
|
|
206
|
+
obj_name_union0 = obj_name_union0_error.message;
|
|
207
|
+
}
|
|
208
|
+
var obj_name_union1 = null;
|
|
209
|
+
var obj_name_union1_error = (function () {
|
|
210
|
+
if (obj_name !== null) {
|
|
211
|
+
return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
212
|
+
}
|
|
213
|
+
})();
|
|
214
|
+
if (obj_name_union1_error != null) {
|
|
215
|
+
obj_name_union1 = obj_name_union1_error.message;
|
|
216
|
+
}
|
|
217
|
+
if (obj_name_union0 && obj_name_union1) {
|
|
218
|
+
var message = 'Object doesn\'t match union (at "' + path_name + '")';
|
|
219
|
+
message += '\n' + obj_name_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
220
|
+
message += '\n' + obj_name_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
221
|
+
return new TypeError(message);
|
|
222
|
+
}
|
|
223
|
+
if (obj.requestReference !== undefined) {
|
|
224
|
+
var obj_requestReference_1 = obj.requestReference;
|
|
225
|
+
var path_requestReference_1 = path + '.requestReference';
|
|
226
|
+
var obj_requestReference_union0 = null;
|
|
227
|
+
var obj_requestReference_union0_error = (function () {
|
|
228
|
+
if (typeof obj_requestReference_1 !== 'string') {
|
|
229
|
+
return new TypeError('Expected "string" but received "' + typeof obj_requestReference_1 + '" (at "' + path_requestReference_1 + '")');
|
|
230
|
+
}
|
|
231
|
+
})();
|
|
232
|
+
if (obj_requestReference_union0_error != null) {
|
|
233
|
+
obj_requestReference_union0 = obj_requestReference_union0_error.message;
|
|
234
|
+
}
|
|
235
|
+
var obj_requestReference_union1 = null;
|
|
236
|
+
var obj_requestReference_union1_error = (function () {
|
|
237
|
+
if (obj_requestReference_1 !== null) {
|
|
238
|
+
return new TypeError('Expected "null" but received "' + typeof obj_requestReference_1 + '" (at "' + path_requestReference_1 + '")');
|
|
239
|
+
}
|
|
240
|
+
})();
|
|
241
|
+
if (obj_requestReference_union1_error != null) {
|
|
242
|
+
obj_requestReference_union1 = obj_requestReference_union1_error.message;
|
|
243
|
+
}
|
|
244
|
+
if (obj_requestReference_union0 && obj_requestReference_union1) {
|
|
245
|
+
var message = 'Object doesn\'t match union (at "' + path_requestReference_1 + '")';
|
|
246
|
+
message += '\n' + obj_requestReference_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
247
|
+
message += '\n' + obj_requestReference_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
248
|
+
return new TypeError(message);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
var obj_status = obj.status;
|
|
252
|
+
var path_status = path + '.status';
|
|
253
|
+
var obj_status_union0 = null;
|
|
254
|
+
var obj_status_union0_error = (function () {
|
|
255
|
+
if (typeof obj_status !== 'string') {
|
|
256
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
257
|
+
}
|
|
258
|
+
})();
|
|
259
|
+
if (obj_status_union0_error != null) {
|
|
260
|
+
obj_status_union0 = obj_status_union0_error.message;
|
|
261
|
+
}
|
|
262
|
+
var obj_status_union1 = null;
|
|
263
|
+
var obj_status_union1_error = (function () {
|
|
264
|
+
if (obj_status !== null) {
|
|
265
|
+
return new TypeError('Expected "null" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
266
|
+
}
|
|
267
|
+
})();
|
|
268
|
+
if (obj_status_union1_error != null) {
|
|
269
|
+
obj_status_union1 = obj_status_union1_error.message;
|
|
270
|
+
}
|
|
271
|
+
if (obj_status_union0 && obj_status_union1) {
|
|
272
|
+
var message = 'Object doesn\'t match union (at "' + path_status + '")';
|
|
273
|
+
message += '\n' + obj_status_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
274
|
+
message += '\n' + obj_status_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
275
|
+
return new TypeError(message);
|
|
276
|
+
}
|
|
277
|
+
})();
|
|
278
|
+
return v_error === undefined ? null : v_error;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
var VERSION$6 = "a3782c06460d6c648c725cfab29d83b3";
|
|
282
|
+
function validate$9(obj, path) {
|
|
283
|
+
if (path === void 0) { path = 'AssessmentEnvelopeItemsListRepresentation'; }
|
|
284
|
+
var v_error = (function () {
|
|
285
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
286
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
287
|
+
}
|
|
288
|
+
var obj_id = obj.id;
|
|
289
|
+
var path_id = path + '.id';
|
|
290
|
+
var obj_id_union0 = null;
|
|
291
|
+
var obj_id_union0_error = (function () {
|
|
292
|
+
if (typeof obj_id !== 'string') {
|
|
293
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
294
|
+
}
|
|
295
|
+
})();
|
|
296
|
+
if (obj_id_union0_error != null) {
|
|
297
|
+
obj_id_union0 = obj_id_union0_error.message;
|
|
298
|
+
}
|
|
299
|
+
var obj_id_union1 = null;
|
|
300
|
+
var obj_id_union1_error = (function () {
|
|
301
|
+
if (obj_id !== null) {
|
|
302
|
+
return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
303
|
+
}
|
|
304
|
+
})();
|
|
305
|
+
if (obj_id_union1_error != null) {
|
|
306
|
+
obj_id_union1 = obj_id_union1_error.message;
|
|
307
|
+
}
|
|
308
|
+
if (obj_id_union0 && obj_id_union1) {
|
|
309
|
+
var message = 'Object doesn\'t match union (at "' + path_id + '")';
|
|
310
|
+
message += '\n' + obj_id_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
311
|
+
message += '\n' + obj_id_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
312
|
+
return new TypeError(message);
|
|
313
|
+
}
|
|
314
|
+
})();
|
|
315
|
+
return v_error === undefined ? null : v_error;
|
|
316
|
+
}
|
|
317
|
+
var select$9 = function AssessmentEnvelopeItemsListRepresentationSelect() {
|
|
318
|
+
return {
|
|
319
|
+
kind: 'Fragment',
|
|
320
|
+
version: VERSION$6,
|
|
321
|
+
private: [],
|
|
322
|
+
selections: [
|
|
323
|
+
{
|
|
324
|
+
name: 'id',
|
|
325
|
+
kind: 'Scalar'
|
|
326
|
+
}
|
|
327
|
+
]
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
function equals$6(existing, incoming) {
|
|
331
|
+
var existing_id = existing.id;
|
|
332
|
+
var incoming_id = incoming.id;
|
|
333
|
+
if (!(existing_id === incoming_id)) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
return true;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
var VERSION$5 = "ab49eca219417dfaf0dd968d35ce3b21";
|
|
340
|
+
function validate$8(obj, path) {
|
|
341
|
+
if (path === void 0) { path = 'AssessmentEnvelopeRepresentation'; }
|
|
342
|
+
var v_error = (function () {
|
|
343
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
344
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
345
|
+
}
|
|
346
|
+
var obj_assessmentEnvelopeItems = obj.assessmentEnvelopeItems;
|
|
347
|
+
var path_assessmentEnvelopeItems = path + '.assessmentEnvelopeItems';
|
|
348
|
+
if (!ArrayIsArray(obj_assessmentEnvelopeItems)) {
|
|
349
|
+
return new TypeError('Expected "array" but received "' + typeof obj_assessmentEnvelopeItems + '" (at "' + path_assessmentEnvelopeItems + '")');
|
|
350
|
+
}
|
|
351
|
+
for (var i = 0; i < obj_assessmentEnvelopeItems.length; i++) {
|
|
352
|
+
var obj_assessmentEnvelopeItems_item = obj_assessmentEnvelopeItems[i];
|
|
353
|
+
var path_assessmentEnvelopeItems_item = path_assessmentEnvelopeItems + '[' + i + ']';
|
|
354
|
+
var referencepath_assessmentEnvelopeItems_itemValidationError = validate$9(obj_assessmentEnvelopeItems_item, path_assessmentEnvelopeItems_item);
|
|
355
|
+
if (referencepath_assessmentEnvelopeItems_itemValidationError !== null) {
|
|
356
|
+
var message = 'Object doesn\'t match AssessmentEnvelopeItemsListRepresentation (at "' + path_assessmentEnvelopeItems_item + '")\n';
|
|
357
|
+
message += referencepath_assessmentEnvelopeItems_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
358
|
+
return new TypeError(message);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
var obj_id = obj.id;
|
|
362
|
+
var path_id = path + '.id';
|
|
363
|
+
var obj_id_union0 = null;
|
|
364
|
+
var obj_id_union0_error = (function () {
|
|
365
|
+
if (typeof obj_id !== 'string') {
|
|
366
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
367
|
+
}
|
|
368
|
+
})();
|
|
369
|
+
if (obj_id_union0_error != null) {
|
|
370
|
+
obj_id_union0 = obj_id_union0_error.message;
|
|
371
|
+
}
|
|
372
|
+
var obj_id_union1 = null;
|
|
373
|
+
var obj_id_union1_error = (function () {
|
|
374
|
+
if (obj_id !== null) {
|
|
375
|
+
return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
376
|
+
}
|
|
377
|
+
})();
|
|
378
|
+
if (obj_id_union1_error != null) {
|
|
379
|
+
obj_id_union1 = obj_id_union1_error.message;
|
|
380
|
+
}
|
|
381
|
+
if (obj_id_union0 && obj_id_union1) {
|
|
382
|
+
var message = 'Object doesn\'t match union (at "' + path_id + '")';
|
|
383
|
+
message += '\n' + obj_id_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
384
|
+
message += '\n' + obj_id_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
385
|
+
return new TypeError(message);
|
|
386
|
+
}
|
|
387
|
+
})();
|
|
388
|
+
return v_error === undefined ? null : v_error;
|
|
389
|
+
}
|
|
390
|
+
var select$8 = function AssessmentEnvelopeRepresentationSelect() {
|
|
391
|
+
var _a = select$9(), AssessmentEnvelopeItemsListRepresentation__selections = _a.selections;
|
|
392
|
+
return {
|
|
393
|
+
kind: 'Fragment',
|
|
394
|
+
version: VERSION$5,
|
|
395
|
+
private: [],
|
|
396
|
+
selections: [
|
|
397
|
+
{
|
|
398
|
+
name: 'assessmentEnvelopeItems',
|
|
399
|
+
kind: 'Object',
|
|
400
|
+
plural: true,
|
|
401
|
+
selections: AssessmentEnvelopeItemsListRepresentation__selections
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
name: 'id',
|
|
405
|
+
kind: 'Scalar'
|
|
406
|
+
}
|
|
407
|
+
]
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
function equals$5(existing, incoming) {
|
|
411
|
+
var existing_assessmentEnvelopeItems = existing.assessmentEnvelopeItems;
|
|
412
|
+
var incoming_assessmentEnvelopeItems = incoming.assessmentEnvelopeItems;
|
|
413
|
+
var equals_assessmentEnvelopeItems_items = equalsArray(existing_assessmentEnvelopeItems, incoming_assessmentEnvelopeItems, function (existing_assessmentEnvelopeItems_item, incoming_assessmentEnvelopeItems_item) {
|
|
414
|
+
if (!(equals$6(existing_assessmentEnvelopeItems_item, incoming_assessmentEnvelopeItems_item))) {
|
|
415
|
+
return false;
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
if (equals_assessmentEnvelopeItems_items === false) {
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
421
|
+
var existing_id = existing.id;
|
|
422
|
+
var incoming_id = incoming.id;
|
|
423
|
+
if (!(existing_id === incoming_id)) {
|
|
424
|
+
return false;
|
|
425
|
+
}
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
var VERSION$4 = "7e489c5236b75eb23da3679e0a4afc5a";
|
|
430
|
+
function validate$7(obj, path) {
|
|
431
|
+
if (path === void 0) { path = 'AssessmentEnvelopeResultRepresentation'; }
|
|
432
|
+
var v_error = (function () {
|
|
433
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
434
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
435
|
+
}
|
|
436
|
+
var obj_assessmentEnvelope = obj.assessmentEnvelope;
|
|
437
|
+
var path_assessmentEnvelope = path + '.assessmentEnvelope';
|
|
438
|
+
var referencepath_assessmentEnvelopeValidationError = validate$8(obj_assessmentEnvelope, path_assessmentEnvelope);
|
|
439
|
+
if (referencepath_assessmentEnvelopeValidationError !== null) {
|
|
440
|
+
var message = 'Object doesn\'t match AssessmentEnvelopeRepresentation (at "' + path_assessmentEnvelope + '")\n';
|
|
441
|
+
message += referencepath_assessmentEnvelopeValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
442
|
+
return new TypeError(message);
|
|
443
|
+
}
|
|
444
|
+
var obj_isSuccess = obj.isSuccess;
|
|
445
|
+
var path_isSuccess = path + '.isSuccess';
|
|
446
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
447
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
448
|
+
}
|
|
449
|
+
var obj_message = obj.message;
|
|
450
|
+
var path_message = path + '.message';
|
|
451
|
+
var obj_message_union0 = null;
|
|
452
|
+
var obj_message_union0_error = (function () {
|
|
453
|
+
if (typeof obj_message !== 'string') {
|
|
454
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
455
|
+
}
|
|
456
|
+
})();
|
|
457
|
+
if (obj_message_union0_error != null) {
|
|
458
|
+
obj_message_union0 = obj_message_union0_error.message;
|
|
459
|
+
}
|
|
460
|
+
var obj_message_union1 = null;
|
|
461
|
+
var obj_message_union1_error = (function () {
|
|
462
|
+
if (obj_message !== null) {
|
|
463
|
+
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
464
|
+
}
|
|
465
|
+
})();
|
|
466
|
+
if (obj_message_union1_error != null) {
|
|
467
|
+
obj_message_union1 = obj_message_union1_error.message;
|
|
468
|
+
}
|
|
469
|
+
if (obj_message_union0 && obj_message_union1) {
|
|
470
|
+
var message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
471
|
+
message += '\n' + obj_message_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
472
|
+
message += '\n' + obj_message_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
473
|
+
return new TypeError(message);
|
|
474
|
+
}
|
|
475
|
+
})();
|
|
476
|
+
return v_error === undefined ? null : v_error;
|
|
477
|
+
}
|
|
478
|
+
var RepresentationType$2 = 'AssessmentEnvelopeResultRepresentation';
|
|
479
|
+
function keyBuilder$3(luvio, config) {
|
|
480
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.isSuccess;
|
|
481
|
+
}
|
|
482
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
483
|
+
var keyParams = {
|
|
484
|
+
isSuccess: object.isSuccess
|
|
485
|
+
};
|
|
486
|
+
return keyBuilder$3(luvio, keyParams);
|
|
487
|
+
}
|
|
488
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
489
|
+
return input;
|
|
490
|
+
}
|
|
491
|
+
var select$7 = function AssessmentEnvelopeResultRepresentationSelect() {
|
|
492
|
+
var _a = select$8(), AssessmentEnvelopeRepresentation__selections = _a.selections;
|
|
493
|
+
return {
|
|
494
|
+
kind: 'Fragment',
|
|
495
|
+
version: VERSION$4,
|
|
496
|
+
private: [],
|
|
497
|
+
selections: [
|
|
498
|
+
{
|
|
499
|
+
name: 'assessmentEnvelope',
|
|
500
|
+
kind: 'Object',
|
|
501
|
+
selections: AssessmentEnvelopeRepresentation__selections
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
name: 'isSuccess',
|
|
505
|
+
kind: 'Scalar'
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
name: 'message',
|
|
509
|
+
kind: 'Scalar'
|
|
510
|
+
}
|
|
511
|
+
]
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
function equals$4(existing, incoming) {
|
|
515
|
+
var existing_isSuccess = existing.isSuccess;
|
|
516
|
+
var incoming_isSuccess = incoming.isSuccess;
|
|
517
|
+
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
518
|
+
return false;
|
|
519
|
+
}
|
|
520
|
+
var existing_assessmentEnvelope = existing.assessmentEnvelope;
|
|
521
|
+
var incoming_assessmentEnvelope = incoming.assessmentEnvelope;
|
|
522
|
+
if (!(equals$5(existing_assessmentEnvelope, incoming_assessmentEnvelope))) {
|
|
523
|
+
return false;
|
|
524
|
+
}
|
|
525
|
+
var existing_message = existing.message;
|
|
526
|
+
var incoming_message = incoming.message;
|
|
527
|
+
if (!(existing_message === incoming_message)) {
|
|
528
|
+
return false;
|
|
529
|
+
}
|
|
530
|
+
return true;
|
|
531
|
+
}
|
|
532
|
+
var ingest$2 = function AssessmentEnvelopeResultRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
533
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
534
|
+
var validateError = validate$7(input);
|
|
535
|
+
if (validateError !== null) {
|
|
536
|
+
throw validateError;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
var key = keyBuilderFromType$1(luvio, input);
|
|
540
|
+
var existingRecord = store.readEntry(key);
|
|
541
|
+
var ttlToUse = path.ttl !== undefined ? path.ttl : 6000;
|
|
542
|
+
var incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
543
|
+
fullPath: key,
|
|
544
|
+
parent: path.parent,
|
|
545
|
+
propertyName: path.propertyName,
|
|
546
|
+
ttl: ttlToUse
|
|
547
|
+
});
|
|
548
|
+
if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
|
|
549
|
+
luvio.storePublish(key, incomingRecord);
|
|
550
|
+
}
|
|
551
|
+
if (ttlToUse !== undefined) {
|
|
552
|
+
var storeMetadataParams = {
|
|
553
|
+
ttl: ttlToUse,
|
|
554
|
+
namespace: "assessment",
|
|
555
|
+
version: VERSION$4,
|
|
556
|
+
representationName: RepresentationType$2,
|
|
557
|
+
};
|
|
558
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
559
|
+
}
|
|
560
|
+
return createLink(key);
|
|
561
|
+
};
|
|
562
|
+
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
563
|
+
var rootKeySet = new engine.StoreKeyMap();
|
|
564
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
565
|
+
var rootKey = keyBuilderFromType$1(luvio, input);
|
|
566
|
+
rootKeySet.set(rootKey, {
|
|
567
|
+
namespace: keyPrefix,
|
|
568
|
+
representationName: RepresentationType$2,
|
|
569
|
+
mergeable: false
|
|
570
|
+
});
|
|
571
|
+
return rootKeySet;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
function select$6(luvio, params) {
|
|
575
|
+
return select$7();
|
|
576
|
+
}
|
|
577
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
578
|
+
return getTypeCacheKeys$2(luvio, response);
|
|
579
|
+
}
|
|
580
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
581
|
+
var body = response.body;
|
|
582
|
+
var key = keyBuilderFromType$1(luvio, body);
|
|
583
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
584
|
+
var snapshot = luvio.storeLookup({
|
|
585
|
+
recordId: key,
|
|
586
|
+
node: select$6(),
|
|
587
|
+
variables: {},
|
|
588
|
+
});
|
|
589
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
590
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
591
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
return snapshot;
|
|
595
|
+
}
|
|
596
|
+
function createResourceRequest$2(config) {
|
|
597
|
+
var headers = {};
|
|
598
|
+
return {
|
|
599
|
+
baseUri: '/services/data/v58.0',
|
|
600
|
+
basePath: '/connect/assessments/assessmentenvelopes',
|
|
601
|
+
method: 'post',
|
|
602
|
+
body: config.body,
|
|
603
|
+
urlParams: {},
|
|
604
|
+
queryParams: {},
|
|
605
|
+
headers: headers,
|
|
606
|
+
priority: 'normal',
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
var postAssessmentEnvelope_ConfigPropertyNames = {
|
|
611
|
+
displayName: 'postAssessmentEnvelope',
|
|
612
|
+
parameters: {
|
|
613
|
+
required: ['AssessmentEnvelopeData'],
|
|
614
|
+
optional: []
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
function createResourceParams$2(config) {
|
|
618
|
+
var resourceParams = {
|
|
619
|
+
body: {
|
|
620
|
+
AssessmentEnvelopeData: config.AssessmentEnvelopeData
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
return resourceParams;
|
|
624
|
+
}
|
|
625
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
626
|
+
var config = {};
|
|
627
|
+
var untrustedConfig_AssessmentEnvelopeData = untrustedConfig.AssessmentEnvelopeData;
|
|
628
|
+
var referenceAssessmentEnvelopeInputRepresentationValidationError = validate$a(untrustedConfig_AssessmentEnvelopeData);
|
|
629
|
+
if (referenceAssessmentEnvelopeInputRepresentationValidationError === null) {
|
|
630
|
+
config.AssessmentEnvelopeData = untrustedConfig_AssessmentEnvelopeData;
|
|
631
|
+
}
|
|
632
|
+
return config;
|
|
633
|
+
}
|
|
634
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
635
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
636
|
+
return null;
|
|
637
|
+
}
|
|
638
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
639
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
640
|
+
}
|
|
641
|
+
var config = typeCheckConfig$2(untrustedConfig);
|
|
642
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
643
|
+
return null;
|
|
644
|
+
}
|
|
645
|
+
return config;
|
|
646
|
+
}
|
|
647
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
648
|
+
var resourceParams = createResourceParams$2(config);
|
|
649
|
+
var request = createResourceRequest$2(resourceParams);
|
|
650
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
651
|
+
.then(function (response) {
|
|
652
|
+
return luvio.handleSuccessResponse(function () {
|
|
653
|
+
var snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
654
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
655
|
+
}, function () { return getResponseCacheKeys$2(luvio, resourceParams, response.body); });
|
|
656
|
+
}, function (response) {
|
|
657
|
+
deepFreeze$3(response);
|
|
658
|
+
throw response;
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
var postAssessmentEnvelopeAdapterFactory = function (luvio) {
|
|
662
|
+
return function postAssessmentEnvelope(untrustedConfig) {
|
|
663
|
+
var config = validateAdapterConfig$2(untrustedConfig, postAssessmentEnvelope_ConfigPropertyNames);
|
|
664
|
+
// Invalid or incomplete config
|
|
665
|
+
if (config === null) {
|
|
666
|
+
throw new Error('Invalid config for "postAssessmentEnvelope"');
|
|
667
|
+
}
|
|
668
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
function validate$6(obj, path) {
|
|
673
|
+
if (path === void 0) { path = 'AssessmentEnvelopeItemsListOutputRepresentation'; }
|
|
674
|
+
var v_error = (function () {
|
|
675
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
676
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
677
|
+
}
|
|
678
|
+
if (obj.id !== undefined) {
|
|
679
|
+
var obj_id = obj.id;
|
|
680
|
+
var path_id = path + '.id';
|
|
681
|
+
if (typeof obj_id !== 'string') {
|
|
682
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
if (obj.omniProcessId !== undefined) {
|
|
686
|
+
var obj_omniProcessId = obj.omniProcessId;
|
|
687
|
+
var path_omniProcessId = path + '.omniProcessId';
|
|
688
|
+
if (typeof obj_omniProcessId !== 'string') {
|
|
689
|
+
return new TypeError('Expected "string" but received "' + typeof obj_omniProcessId + '" (at "' + path_omniProcessId + '")');
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
var obj_status = obj.status;
|
|
693
|
+
var path_status = path + '.status';
|
|
694
|
+
if (typeof obj_status !== 'string') {
|
|
695
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
696
|
+
}
|
|
697
|
+
})();
|
|
698
|
+
return v_error === undefined ? null : v_error;
|
|
699
|
+
}
|
|
700
|
+
function deepFreeze$2(input) {
|
|
701
|
+
ObjectFreeze(input);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
function validate$5(obj, path) {
|
|
705
|
+
if (path === void 0) { path = 'AssessmentEnvelopeOutputRepresentation'; }
|
|
706
|
+
var v_error = (function () {
|
|
707
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
708
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
709
|
+
}
|
|
710
|
+
if (obj.assessmentEnvelopeItems !== undefined) {
|
|
711
|
+
var obj_assessmentEnvelopeItems = obj.assessmentEnvelopeItems;
|
|
712
|
+
var path_assessmentEnvelopeItems = path + '.assessmentEnvelopeItems';
|
|
713
|
+
if (!ArrayIsArray(obj_assessmentEnvelopeItems)) {
|
|
714
|
+
return new TypeError('Expected "array" but received "' + typeof obj_assessmentEnvelopeItems + '" (at "' + path_assessmentEnvelopeItems + '")');
|
|
715
|
+
}
|
|
716
|
+
for (var i = 0; i < obj_assessmentEnvelopeItems.length; i++) {
|
|
717
|
+
var obj_assessmentEnvelopeItems_item = obj_assessmentEnvelopeItems[i];
|
|
718
|
+
var path_assessmentEnvelopeItems_item = path_assessmentEnvelopeItems + '[' + i + ']';
|
|
719
|
+
var referencepath_assessmentEnvelopeItems_itemValidationError = validate$6(obj_assessmentEnvelopeItems_item, path_assessmentEnvelopeItems_item);
|
|
720
|
+
if (referencepath_assessmentEnvelopeItems_itemValidationError !== null) {
|
|
721
|
+
var message = 'Object doesn\'t match AssessmentEnvelopeItemsListOutputRepresentation (at "' + path_assessmentEnvelopeItems_item + '")\n';
|
|
722
|
+
message += referencepath_assessmentEnvelopeItems_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
723
|
+
return new TypeError(message);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
if (obj.expirationDateTime !== undefined) {
|
|
728
|
+
var obj_expirationDateTime = obj.expirationDateTime;
|
|
729
|
+
var path_expirationDateTime = path + '.expirationDateTime';
|
|
730
|
+
if (typeof obj_expirationDateTime !== 'string') {
|
|
731
|
+
return new TypeError('Expected "string" but received "' + typeof obj_expirationDateTime + '" (at "' + path_expirationDateTime + '")');
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
if (obj.id !== undefined) {
|
|
735
|
+
var obj_id = obj.id;
|
|
736
|
+
var path_id = path + '.id';
|
|
737
|
+
if (typeof obj_id !== 'string') {
|
|
738
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
var obj_status = obj.status;
|
|
742
|
+
var path_status = path + '.status';
|
|
743
|
+
if (typeof obj_status !== 'string') {
|
|
744
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
745
|
+
}
|
|
746
|
+
})();
|
|
747
|
+
return v_error === undefined ? null : v_error;
|
|
748
|
+
}
|
|
749
|
+
function deepFreeze$1(input) {
|
|
750
|
+
var input_assessmentEnvelopeItems = input.assessmentEnvelopeItems;
|
|
751
|
+
if (input_assessmentEnvelopeItems !== undefined) {
|
|
752
|
+
for (var i = 0; i < input_assessmentEnvelopeItems.length; i++) {
|
|
753
|
+
var input_assessmentEnvelopeItems_item = input_assessmentEnvelopeItems[i];
|
|
754
|
+
deepFreeze$2(input_assessmentEnvelopeItems_item);
|
|
755
|
+
}
|
|
756
|
+
ObjectFreeze(input_assessmentEnvelopeItems);
|
|
757
|
+
}
|
|
758
|
+
ObjectFreeze(input);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
var TTL = 6000;
|
|
762
|
+
var VERSION$3 = "7b60ad6d5543265bc7066c36ff3987e4";
|
|
763
|
+
function validate$4(obj, path) {
|
|
764
|
+
if (path === void 0) { path = 'AssessmentEnvelopeGetResultRepresentation'; }
|
|
765
|
+
var v_error = (function () {
|
|
766
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
767
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
768
|
+
}
|
|
769
|
+
if (obj.assessmentEnvelope !== undefined) {
|
|
770
|
+
var obj_assessmentEnvelope = obj.assessmentEnvelope;
|
|
771
|
+
var path_assessmentEnvelope = path + '.assessmentEnvelope';
|
|
772
|
+
var referencepath_assessmentEnvelopeValidationError = validate$5(obj_assessmentEnvelope, path_assessmentEnvelope);
|
|
773
|
+
if (referencepath_assessmentEnvelopeValidationError !== null) {
|
|
774
|
+
var message = 'Object doesn\'t match AssessmentEnvelopeOutputRepresentation (at "' + path_assessmentEnvelope + '")\n';
|
|
775
|
+
message += referencepath_assessmentEnvelopeValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
776
|
+
return new TypeError(message);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
var obj_isSuccess = obj.isSuccess;
|
|
780
|
+
var path_isSuccess = path + '.isSuccess';
|
|
781
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
782
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
783
|
+
}
|
|
784
|
+
var obj_message = obj.message;
|
|
785
|
+
var path_message = path + '.message';
|
|
786
|
+
if (typeof obj_message !== 'string') {
|
|
787
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
788
|
+
}
|
|
789
|
+
})();
|
|
790
|
+
return v_error === undefined ? null : v_error;
|
|
791
|
+
}
|
|
792
|
+
var RepresentationType$1 = 'AssessmentEnvelopeGetResultRepresentation';
|
|
793
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
794
|
+
return input;
|
|
795
|
+
}
|
|
796
|
+
var select$5 = function AssessmentEnvelopeGetResultRepresentationSelect() {
|
|
797
|
+
return {
|
|
798
|
+
kind: 'Fragment',
|
|
799
|
+
version: VERSION$3,
|
|
800
|
+
private: [],
|
|
801
|
+
opaque: true
|
|
802
|
+
};
|
|
803
|
+
};
|
|
804
|
+
function equals$3(existing, incoming) {
|
|
805
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
806
|
+
return false;
|
|
807
|
+
}
|
|
808
|
+
return true;
|
|
809
|
+
}
|
|
810
|
+
function deepFreeze(input) {
|
|
811
|
+
var input_assessmentEnvelope = input.assessmentEnvelope;
|
|
812
|
+
if (input_assessmentEnvelope !== undefined) {
|
|
813
|
+
deepFreeze$1(input_assessmentEnvelope);
|
|
814
|
+
}
|
|
815
|
+
ObjectFreeze(input);
|
|
816
|
+
}
|
|
817
|
+
var ingest$1 = function AssessmentEnvelopeGetResultRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
818
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
819
|
+
var validateError = validate$4(input);
|
|
820
|
+
if (validateError !== null) {
|
|
821
|
+
throw validateError;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
var key = path.fullPath;
|
|
825
|
+
var existingRecord = store.readEntry(key);
|
|
826
|
+
var ttlToUse = TTL;
|
|
827
|
+
var incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
828
|
+
fullPath: key,
|
|
829
|
+
parent: path.parent,
|
|
830
|
+
propertyName: path.propertyName,
|
|
831
|
+
ttl: ttlToUse
|
|
832
|
+
});
|
|
833
|
+
deepFreeze(input);
|
|
834
|
+
if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
|
|
835
|
+
luvio.storePublish(key, incomingRecord);
|
|
836
|
+
}
|
|
837
|
+
{
|
|
838
|
+
var storeMetadataParams = {
|
|
839
|
+
ttl: ttlToUse,
|
|
840
|
+
namespace: "assessment",
|
|
841
|
+
version: VERSION$3,
|
|
842
|
+
representationName: RepresentationType$1,
|
|
843
|
+
};
|
|
844
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
845
|
+
}
|
|
846
|
+
return createLink(key);
|
|
847
|
+
};
|
|
848
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
849
|
+
var rootKeySet = new engine.StoreKeyMap();
|
|
850
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
851
|
+
var rootKey = fullPathFactory();
|
|
852
|
+
rootKeySet.set(rootKey, {
|
|
853
|
+
namespace: keyPrefix,
|
|
854
|
+
representationName: RepresentationType$1,
|
|
855
|
+
mergeable: false
|
|
856
|
+
});
|
|
857
|
+
return rootKeySet;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
function select$4(luvio, params) {
|
|
861
|
+
return select$5();
|
|
862
|
+
}
|
|
863
|
+
function keyBuilder$2(luvio, params) {
|
|
864
|
+
return keyPrefix + '::AssessmentEnvelopeGetResultRepresentation:(' + 'signature:' + params.queryParams.signature + ')';
|
|
865
|
+
}
|
|
866
|
+
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
867
|
+
return getTypeCacheKeys$1(luvio, response, function () { return keyBuilder$2(luvio, resourceParams); });
|
|
868
|
+
}
|
|
869
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
870
|
+
var body = response.body;
|
|
871
|
+
var key = keyBuilder$2(luvio, resourceParams);
|
|
872
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
873
|
+
var snapshot = luvio.storeLookup({
|
|
874
|
+
recordId: key,
|
|
875
|
+
node: select$4(),
|
|
876
|
+
variables: {},
|
|
877
|
+
}, snapshotRefresh);
|
|
878
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
879
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
880
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
return snapshot;
|
|
884
|
+
}
|
|
885
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
886
|
+
var key = keyBuilder$2(luvio, params);
|
|
887
|
+
var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
888
|
+
var storeMetadataParams = {
|
|
889
|
+
ttl: TTL,
|
|
890
|
+
namespace: keyPrefix,
|
|
891
|
+
version: VERSION$3,
|
|
892
|
+
representationName: RepresentationType$1
|
|
893
|
+
};
|
|
894
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
895
|
+
return errorSnapshot;
|
|
896
|
+
}
|
|
897
|
+
function createResourceRequest$1(config) {
|
|
898
|
+
var headers = {};
|
|
899
|
+
return {
|
|
900
|
+
baseUri: '/services/data/v58.0',
|
|
901
|
+
basePath: '/connect/assessments/assessmentenvelopes',
|
|
902
|
+
method: 'get',
|
|
903
|
+
body: null,
|
|
904
|
+
urlParams: {},
|
|
905
|
+
queryParams: config.queryParams,
|
|
906
|
+
headers: headers,
|
|
907
|
+
priority: 'normal',
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
var getAssessmentEnvelope_ConfigPropertyNames = {
|
|
912
|
+
displayName: 'getAssessmentEnvelope',
|
|
913
|
+
parameters: {
|
|
914
|
+
required: [],
|
|
915
|
+
optional: ['signature']
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
function createResourceParams$1(config) {
|
|
919
|
+
var resourceParams = {
|
|
920
|
+
queryParams: {
|
|
921
|
+
signature: config.signature
|
|
922
|
+
}
|
|
923
|
+
};
|
|
924
|
+
return resourceParams;
|
|
925
|
+
}
|
|
926
|
+
function keyBuilder$1(luvio, config) {
|
|
927
|
+
var resourceParams = createResourceParams$1(config);
|
|
928
|
+
return keyBuilder$2(luvio, resourceParams);
|
|
929
|
+
}
|
|
930
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
931
|
+
var config = {};
|
|
932
|
+
var untrustedConfig_signature = untrustedConfig.signature;
|
|
933
|
+
if (typeof untrustedConfig_signature === 'string') {
|
|
934
|
+
config.signature = untrustedConfig_signature;
|
|
935
|
+
}
|
|
936
|
+
return config;
|
|
937
|
+
}
|
|
938
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
939
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
940
|
+
return null;
|
|
941
|
+
}
|
|
942
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
943
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
944
|
+
}
|
|
945
|
+
var config = typeCheckConfig$1(untrustedConfig);
|
|
946
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
947
|
+
return null;
|
|
948
|
+
}
|
|
949
|
+
return config;
|
|
950
|
+
}
|
|
951
|
+
function adapterFragment(luvio, config) {
|
|
952
|
+
createResourceParams$1(config);
|
|
953
|
+
return select$4();
|
|
954
|
+
}
|
|
955
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
956
|
+
var snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
957
|
+
config: config,
|
|
958
|
+
resolve: function () { return buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions); }
|
|
959
|
+
});
|
|
960
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
961
|
+
}
|
|
962
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
963
|
+
var snapshot = ingestError(luvio, resourceParams, response, {
|
|
964
|
+
config: config,
|
|
965
|
+
resolve: function () { return buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions); }
|
|
966
|
+
});
|
|
967
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
968
|
+
}
|
|
969
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
970
|
+
var resourceParams = createResourceParams$1(config);
|
|
971
|
+
var request = createResourceRequest$1(resourceParams);
|
|
972
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
973
|
+
.then(function (response) {
|
|
974
|
+
return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$1(luvio, resourceParams, response.body); });
|
|
975
|
+
}, function (response) {
|
|
976
|
+
return luvio.handleErrorResponse(function () { return onFetchResponseError(luvio, config, resourceParams, response); });
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
980
|
+
var luvio = context.luvio, config = context.config;
|
|
981
|
+
var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
|
|
982
|
+
var dispatchOptions = {
|
|
983
|
+
resourceRequestContext: {
|
|
984
|
+
requestCorrelator: requestCorrelator,
|
|
985
|
+
luvioRequestMethod: undefined,
|
|
986
|
+
},
|
|
987
|
+
eventObservers: eventObservers
|
|
988
|
+
};
|
|
989
|
+
if (networkPriority !== 'normal') {
|
|
990
|
+
dispatchOptions.overrides = {
|
|
991
|
+
priority: networkPriority
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
|
|
995
|
+
}
|
|
996
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
997
|
+
var luvio = context.luvio, config = context.config;
|
|
998
|
+
var selector = {
|
|
999
|
+
recordId: keyBuilder$1(luvio, config),
|
|
1000
|
+
node: adapterFragment(luvio, config),
|
|
1001
|
+
variables: {},
|
|
1002
|
+
};
|
|
1003
|
+
var cacheSnapshot = storeLookup(selector, {
|
|
1004
|
+
config: config,
|
|
1005
|
+
resolve: function () { return buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions); }
|
|
1006
|
+
});
|
|
1007
|
+
return cacheSnapshot;
|
|
1008
|
+
}
|
|
1009
|
+
var getAssessmentEnvelopeAdapterFactory = function (luvio) { return function assessment__getAssessmentEnvelope(untrustedConfig, requestContext) {
|
|
1010
|
+
var config = validateAdapterConfig$1(untrustedConfig, getAssessmentEnvelope_ConfigPropertyNames);
|
|
1011
|
+
// Invalid or incomplete config
|
|
1012
|
+
if (config === null) {
|
|
1013
|
+
return null;
|
|
1014
|
+
}
|
|
1015
|
+
return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
|
|
1016
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1017
|
+
}; };
|
|
1018
|
+
|
|
1019
|
+
function validate$3(obj, path) {
|
|
1020
|
+
if (path === void 0) { path = 'AssessmentContextSearchInputRepresentation'; }
|
|
1021
|
+
var v_error = (function () {
|
|
1022
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1023
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1024
|
+
}
|
|
1025
|
+
var obj_derivedFilters = obj.derivedFilters;
|
|
1026
|
+
var path_derivedFilters = path + '.derivedFilters';
|
|
1027
|
+
if (!ArrayIsArray(obj_derivedFilters)) {
|
|
1028
|
+
return new TypeError('Expected "array" but received "' + typeof obj_derivedFilters + '" (at "' + path_derivedFilters + '")');
|
|
1029
|
+
}
|
|
1030
|
+
for (var i = 0; i < obj_derivedFilters.length; i++) {
|
|
1031
|
+
var obj_derivedFilters_item = obj_derivedFilters[i];
|
|
1032
|
+
var path_derivedFilters_item = path_derivedFilters + '[' + i + ']';
|
|
1033
|
+
if (typeof obj_derivedFilters_item !== 'object' || ArrayIsArray(obj_derivedFilters_item) || obj_derivedFilters_item === null) {
|
|
1034
|
+
return new TypeError('Expected "object" but received "' + typeof obj_derivedFilters_item + '" (at "' + path_derivedFilters_item + '")');
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
var obj_filterCriteria = obj.filterCriteria;
|
|
1038
|
+
var path_filterCriteria = path + '.filterCriteria';
|
|
1039
|
+
if (!ArrayIsArray(obj_filterCriteria)) {
|
|
1040
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filterCriteria + '" (at "' + path_filterCriteria + '")');
|
|
1041
|
+
}
|
|
1042
|
+
for (var i = 0; i < obj_filterCriteria.length; i++) {
|
|
1043
|
+
var obj_filterCriteria_item = obj_filterCriteria[i];
|
|
1044
|
+
var path_filterCriteria_item = path_filterCriteria + '[' + i + ']';
|
|
1045
|
+
if (typeof obj_filterCriteria_item !== 'object' || ArrayIsArray(obj_filterCriteria_item) || obj_filterCriteria_item === null) {
|
|
1046
|
+
return new TypeError('Expected "object" but received "' + typeof obj_filterCriteria_item + '" (at "' + path_filterCriteria_item + '")');
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
var obj_recordCount = obj.recordCount;
|
|
1050
|
+
var path_recordCount = path + '.recordCount';
|
|
1051
|
+
var obj_recordCount_union0 = null;
|
|
1052
|
+
var obj_recordCount_union0_error = (function () {
|
|
1053
|
+
if (typeof obj_recordCount !== 'number' || (typeof obj_recordCount === 'number' && Math.floor(obj_recordCount) !== obj_recordCount)) {
|
|
1054
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_recordCount + '" (at "' + path_recordCount + '")');
|
|
1055
|
+
}
|
|
1056
|
+
})();
|
|
1057
|
+
if (obj_recordCount_union0_error != null) {
|
|
1058
|
+
obj_recordCount_union0 = obj_recordCount_union0_error.message;
|
|
1059
|
+
}
|
|
1060
|
+
var obj_recordCount_union1 = null;
|
|
1061
|
+
var obj_recordCount_union1_error = (function () {
|
|
1062
|
+
if (obj_recordCount !== null) {
|
|
1063
|
+
return new TypeError('Expected "null" but received "' + typeof obj_recordCount + '" (at "' + path_recordCount + '")');
|
|
1064
|
+
}
|
|
1065
|
+
})();
|
|
1066
|
+
if (obj_recordCount_union1_error != null) {
|
|
1067
|
+
obj_recordCount_union1 = obj_recordCount_union1_error.message;
|
|
1068
|
+
}
|
|
1069
|
+
if (obj_recordCount_union0 && obj_recordCount_union1) {
|
|
1070
|
+
var message = 'Object doesn\'t match union (at "' + path_recordCount + '")';
|
|
1071
|
+
message += '\n' + obj_recordCount_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1072
|
+
message += '\n' + obj_recordCount_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1073
|
+
return new TypeError(message);
|
|
1074
|
+
}
|
|
1075
|
+
var obj_recordOffsets = obj.recordOffsets;
|
|
1076
|
+
var path_recordOffsets = path + '.recordOffsets';
|
|
1077
|
+
if (!ArrayIsArray(obj_recordOffsets)) {
|
|
1078
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recordOffsets + '" (at "' + path_recordOffsets + '")');
|
|
1079
|
+
}
|
|
1080
|
+
for (var i = 0; i < obj_recordOffsets.length; i++) {
|
|
1081
|
+
var obj_recordOffsets_item = obj_recordOffsets[i];
|
|
1082
|
+
var path_recordOffsets_item = path_recordOffsets + '[' + i + ']';
|
|
1083
|
+
if (typeof obj_recordOffsets_item !== 'object' || ArrayIsArray(obj_recordOffsets_item) || obj_recordOffsets_item === null) {
|
|
1084
|
+
return new TypeError('Expected "object" but received "' + typeof obj_recordOffsets_item + '" (at "' + path_recordOffsets_item + '")');
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
var obj_sortOptions = obj.sortOptions;
|
|
1088
|
+
var path_sortOptions = path + '.sortOptions';
|
|
1089
|
+
if (!ArrayIsArray(obj_sortOptions)) {
|
|
1090
|
+
return new TypeError('Expected "array" but received "' + typeof obj_sortOptions + '" (at "' + path_sortOptions + '")');
|
|
1091
|
+
}
|
|
1092
|
+
for (var i = 0; i < obj_sortOptions.length; i++) {
|
|
1093
|
+
var obj_sortOptions_item = obj_sortOptions[i];
|
|
1094
|
+
var path_sortOptions_item = path_sortOptions + '[' + i + ']';
|
|
1095
|
+
if (typeof obj_sortOptions_item !== 'object' || ArrayIsArray(obj_sortOptions_item) || obj_sortOptions_item === null) {
|
|
1096
|
+
return new TypeError('Expected "object" but received "' + typeof obj_sortOptions_item + '" (at "' + path_sortOptions_item + '")');
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
})();
|
|
1100
|
+
return v_error === undefined ? null : v_error;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
var VERSION$2 = "361228de698774d4d72eedff57ba707a";
|
|
1104
|
+
function validate$2(obj, path) {
|
|
1105
|
+
if (path === void 0) { path = 'RecordOffsetRepresentation'; }
|
|
1106
|
+
var v_error = (function () {
|
|
1107
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1108
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1109
|
+
}
|
|
1110
|
+
var obj_offsetName = obj.offsetName;
|
|
1111
|
+
var path_offsetName = path + '.offsetName';
|
|
1112
|
+
var obj_offsetName_union0 = null;
|
|
1113
|
+
var obj_offsetName_union0_error = (function () {
|
|
1114
|
+
if (typeof obj_offsetName !== 'string') {
|
|
1115
|
+
return new TypeError('Expected "string" but received "' + typeof obj_offsetName + '" (at "' + path_offsetName + '")');
|
|
1116
|
+
}
|
|
1117
|
+
})();
|
|
1118
|
+
if (obj_offsetName_union0_error != null) {
|
|
1119
|
+
obj_offsetName_union0 = obj_offsetName_union0_error.message;
|
|
1120
|
+
}
|
|
1121
|
+
var obj_offsetName_union1 = null;
|
|
1122
|
+
var obj_offsetName_union1_error = (function () {
|
|
1123
|
+
if (obj_offsetName !== null) {
|
|
1124
|
+
return new TypeError('Expected "null" but received "' + typeof obj_offsetName + '" (at "' + path_offsetName + '")');
|
|
1125
|
+
}
|
|
1126
|
+
})();
|
|
1127
|
+
if (obj_offsetName_union1_error != null) {
|
|
1128
|
+
obj_offsetName_union1 = obj_offsetName_union1_error.message;
|
|
1129
|
+
}
|
|
1130
|
+
if (obj_offsetName_union0 && obj_offsetName_union1) {
|
|
1131
|
+
var message = 'Object doesn\'t match union (at "' + path_offsetName + '")';
|
|
1132
|
+
message += '\n' + obj_offsetName_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1133
|
+
message += '\n' + obj_offsetName_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1134
|
+
return new TypeError(message);
|
|
1135
|
+
}
|
|
1136
|
+
var obj_value = obj.value;
|
|
1137
|
+
var path_value = path + '.value';
|
|
1138
|
+
var obj_value_union0 = null;
|
|
1139
|
+
var obj_value_union0_error = (function () {
|
|
1140
|
+
if (typeof obj_value !== 'number' || (typeof obj_value === 'number' && Math.floor(obj_value) !== obj_value)) {
|
|
1141
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
1142
|
+
}
|
|
1143
|
+
})();
|
|
1144
|
+
if (obj_value_union0_error != null) {
|
|
1145
|
+
obj_value_union0 = obj_value_union0_error.message;
|
|
1146
|
+
}
|
|
1147
|
+
var obj_value_union1 = null;
|
|
1148
|
+
var obj_value_union1_error = (function () {
|
|
1149
|
+
if (obj_value !== null) {
|
|
1150
|
+
return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
1151
|
+
}
|
|
1152
|
+
})();
|
|
1153
|
+
if (obj_value_union1_error != null) {
|
|
1154
|
+
obj_value_union1 = obj_value_union1_error.message;
|
|
1155
|
+
}
|
|
1156
|
+
if (obj_value_union0 && obj_value_union1) {
|
|
1157
|
+
var message = 'Object doesn\'t match union (at "' + path_value + '")';
|
|
1158
|
+
message += '\n' + obj_value_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1159
|
+
message += '\n' + obj_value_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1160
|
+
return new TypeError(message);
|
|
1161
|
+
}
|
|
1162
|
+
})();
|
|
1163
|
+
return v_error === undefined ? null : v_error;
|
|
1164
|
+
}
|
|
1165
|
+
var select$3 = function RecordOffsetRepresentationSelect() {
|
|
1166
|
+
return {
|
|
1167
|
+
kind: 'Fragment',
|
|
1168
|
+
version: VERSION$2,
|
|
1169
|
+
private: [],
|
|
1170
|
+
selections: [
|
|
1171
|
+
{
|
|
1172
|
+
name: 'offsetName',
|
|
1173
|
+
kind: 'Scalar'
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
name: 'value',
|
|
1177
|
+
kind: 'Scalar'
|
|
1178
|
+
}
|
|
1179
|
+
]
|
|
1180
|
+
};
|
|
1181
|
+
};
|
|
1182
|
+
function equals$2(existing, incoming) {
|
|
1183
|
+
var existing_offsetName = existing.offsetName;
|
|
1184
|
+
var incoming_offsetName = incoming.offsetName;
|
|
1185
|
+
if (!(existing_offsetName === incoming_offsetName)) {
|
|
1186
|
+
return false;
|
|
1187
|
+
}
|
|
1188
|
+
var existing_value = existing.value;
|
|
1189
|
+
var incoming_value = incoming.value;
|
|
1190
|
+
if (!(existing_value === incoming_value)) {
|
|
1191
|
+
return false;
|
|
1192
|
+
}
|
|
1193
|
+
return true;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
var VERSION$1 = "23514af8a9791ed725bda55d989be951";
|
|
1197
|
+
function validate$1(obj, path) {
|
|
1198
|
+
if (path === void 0) { path = 'RecordsRepresentation'; }
|
|
1199
|
+
var v_error = (function () {
|
|
1200
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1201
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1202
|
+
}
|
|
1203
|
+
var obj_assessmentEnvelopeId = obj.assessmentEnvelopeId;
|
|
1204
|
+
var path_assessmentEnvelopeId = path + '.assessmentEnvelopeId';
|
|
1205
|
+
var obj_assessmentEnvelopeId_union0 = null;
|
|
1206
|
+
var obj_assessmentEnvelopeId_union0_error = (function () {
|
|
1207
|
+
if (typeof obj_assessmentEnvelopeId !== 'string') {
|
|
1208
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assessmentEnvelopeId + '" (at "' + path_assessmentEnvelopeId + '")');
|
|
1209
|
+
}
|
|
1210
|
+
})();
|
|
1211
|
+
if (obj_assessmentEnvelopeId_union0_error != null) {
|
|
1212
|
+
obj_assessmentEnvelopeId_union0 = obj_assessmentEnvelopeId_union0_error.message;
|
|
1213
|
+
}
|
|
1214
|
+
var obj_assessmentEnvelopeId_union1 = null;
|
|
1215
|
+
var obj_assessmentEnvelopeId_union1_error = (function () {
|
|
1216
|
+
if (obj_assessmentEnvelopeId !== null) {
|
|
1217
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assessmentEnvelopeId + '" (at "' + path_assessmentEnvelopeId + '")');
|
|
1218
|
+
}
|
|
1219
|
+
})();
|
|
1220
|
+
if (obj_assessmentEnvelopeId_union1_error != null) {
|
|
1221
|
+
obj_assessmentEnvelopeId_union1 = obj_assessmentEnvelopeId_union1_error.message;
|
|
1222
|
+
}
|
|
1223
|
+
if (obj_assessmentEnvelopeId_union0 && obj_assessmentEnvelopeId_union1) {
|
|
1224
|
+
var message = 'Object doesn\'t match union (at "' + path_assessmentEnvelopeId + '")';
|
|
1225
|
+
message += '\n' + obj_assessmentEnvelopeId_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1226
|
+
message += '\n' + obj_assessmentEnvelopeId_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1227
|
+
return new TypeError(message);
|
|
1228
|
+
}
|
|
1229
|
+
var obj_assessmentEnvelopeItemId = obj.assessmentEnvelopeItemId;
|
|
1230
|
+
var path_assessmentEnvelopeItemId = path + '.assessmentEnvelopeItemId';
|
|
1231
|
+
var obj_assessmentEnvelopeItemId_union0 = null;
|
|
1232
|
+
var obj_assessmentEnvelopeItemId_union0_error = (function () {
|
|
1233
|
+
if (typeof obj_assessmentEnvelopeItemId !== 'string') {
|
|
1234
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assessmentEnvelopeItemId + '" (at "' + path_assessmentEnvelopeItemId + '")');
|
|
1235
|
+
}
|
|
1236
|
+
})();
|
|
1237
|
+
if (obj_assessmentEnvelopeItemId_union0_error != null) {
|
|
1238
|
+
obj_assessmentEnvelopeItemId_union0 = obj_assessmentEnvelopeItemId_union0_error.message;
|
|
1239
|
+
}
|
|
1240
|
+
var obj_assessmentEnvelopeItemId_union1 = null;
|
|
1241
|
+
var obj_assessmentEnvelopeItemId_union1_error = (function () {
|
|
1242
|
+
if (obj_assessmentEnvelopeItemId !== null) {
|
|
1243
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assessmentEnvelopeItemId + '" (at "' + path_assessmentEnvelopeItemId + '")');
|
|
1244
|
+
}
|
|
1245
|
+
})();
|
|
1246
|
+
if (obj_assessmentEnvelopeItemId_union1_error != null) {
|
|
1247
|
+
obj_assessmentEnvelopeItemId_union1 = obj_assessmentEnvelopeItemId_union1_error.message;
|
|
1248
|
+
}
|
|
1249
|
+
if (obj_assessmentEnvelopeItemId_union0 && obj_assessmentEnvelopeItemId_union1) {
|
|
1250
|
+
var message = 'Object doesn\'t match union (at "' + path_assessmentEnvelopeItemId + '")';
|
|
1251
|
+
message += '\n' + obj_assessmentEnvelopeItemId_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1252
|
+
message += '\n' + obj_assessmentEnvelopeItemId_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1253
|
+
return new TypeError(message);
|
|
1254
|
+
}
|
|
1255
|
+
var obj_assessmentId = obj.assessmentId;
|
|
1256
|
+
var path_assessmentId = path + '.assessmentId';
|
|
1257
|
+
var obj_assessmentId_union0 = null;
|
|
1258
|
+
var obj_assessmentId_union0_error = (function () {
|
|
1259
|
+
if (typeof obj_assessmentId !== 'string') {
|
|
1260
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assessmentId + '" (at "' + path_assessmentId + '")');
|
|
1261
|
+
}
|
|
1262
|
+
})();
|
|
1263
|
+
if (obj_assessmentId_union0_error != null) {
|
|
1264
|
+
obj_assessmentId_union0 = obj_assessmentId_union0_error.message;
|
|
1265
|
+
}
|
|
1266
|
+
var obj_assessmentId_union1 = null;
|
|
1267
|
+
var obj_assessmentId_union1_error = (function () {
|
|
1268
|
+
if (obj_assessmentId !== null) {
|
|
1269
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assessmentId + '" (at "' + path_assessmentId + '")');
|
|
1270
|
+
}
|
|
1271
|
+
})();
|
|
1272
|
+
if (obj_assessmentId_union1_error != null) {
|
|
1273
|
+
obj_assessmentId_union1 = obj_assessmentId_union1_error.message;
|
|
1274
|
+
}
|
|
1275
|
+
if (obj_assessmentId_union0 && obj_assessmentId_union1) {
|
|
1276
|
+
var message = 'Object doesn\'t match union (at "' + path_assessmentId + '")';
|
|
1277
|
+
message += '\n' + obj_assessmentId_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1278
|
+
message += '\n' + obj_assessmentId_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1279
|
+
return new TypeError(message);
|
|
1280
|
+
}
|
|
1281
|
+
var obj_derivedStatus = obj.derivedStatus;
|
|
1282
|
+
var path_derivedStatus = path + '.derivedStatus';
|
|
1283
|
+
var obj_derivedStatus_union0 = null;
|
|
1284
|
+
var obj_derivedStatus_union0_error = (function () {
|
|
1285
|
+
if (typeof obj_derivedStatus !== 'string') {
|
|
1286
|
+
return new TypeError('Expected "string" but received "' + typeof obj_derivedStatus + '" (at "' + path_derivedStatus + '")');
|
|
1287
|
+
}
|
|
1288
|
+
})();
|
|
1289
|
+
if (obj_derivedStatus_union0_error != null) {
|
|
1290
|
+
obj_derivedStatus_union0 = obj_derivedStatus_union0_error.message;
|
|
1291
|
+
}
|
|
1292
|
+
var obj_derivedStatus_union1 = null;
|
|
1293
|
+
var obj_derivedStatus_union1_error = (function () {
|
|
1294
|
+
if (obj_derivedStatus !== null) {
|
|
1295
|
+
return new TypeError('Expected "null" but received "' + typeof obj_derivedStatus + '" (at "' + path_derivedStatus + '")');
|
|
1296
|
+
}
|
|
1297
|
+
})();
|
|
1298
|
+
if (obj_derivedStatus_union1_error != null) {
|
|
1299
|
+
obj_derivedStatus_union1 = obj_derivedStatus_union1_error.message;
|
|
1300
|
+
}
|
|
1301
|
+
if (obj_derivedStatus_union0 && obj_derivedStatus_union1) {
|
|
1302
|
+
var message = 'Object doesn\'t match union (at "' + path_derivedStatus + '")';
|
|
1303
|
+
message += '\n' + obj_derivedStatus_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1304
|
+
message += '\n' + obj_derivedStatus_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1305
|
+
return new TypeError(message);
|
|
1306
|
+
}
|
|
1307
|
+
var obj_omniProcessId = obj.omniProcessId;
|
|
1308
|
+
var path_omniProcessId = path + '.omniProcessId';
|
|
1309
|
+
var obj_omniProcessId_union0 = null;
|
|
1310
|
+
var obj_omniProcessId_union0_error = (function () {
|
|
1311
|
+
if (typeof obj_omniProcessId !== 'string') {
|
|
1312
|
+
return new TypeError('Expected "string" but received "' + typeof obj_omniProcessId + '" (at "' + path_omniProcessId + '")');
|
|
1313
|
+
}
|
|
1314
|
+
})();
|
|
1315
|
+
if (obj_omniProcessId_union0_error != null) {
|
|
1316
|
+
obj_omniProcessId_union0 = obj_omniProcessId_union0_error.message;
|
|
1317
|
+
}
|
|
1318
|
+
var obj_omniProcessId_union1 = null;
|
|
1319
|
+
var obj_omniProcessId_union1_error = (function () {
|
|
1320
|
+
if (obj_omniProcessId !== null) {
|
|
1321
|
+
return new TypeError('Expected "null" but received "' + typeof obj_omniProcessId + '" (at "' + path_omniProcessId + '")');
|
|
1322
|
+
}
|
|
1323
|
+
})();
|
|
1324
|
+
if (obj_omniProcessId_union1_error != null) {
|
|
1325
|
+
obj_omniProcessId_union1 = obj_omniProcessId_union1_error.message;
|
|
1326
|
+
}
|
|
1327
|
+
if (obj_omniProcessId_union0 && obj_omniProcessId_union1) {
|
|
1328
|
+
var message = 'Object doesn\'t match union (at "' + path_omniProcessId + '")';
|
|
1329
|
+
message += '\n' + obj_omniProcessId_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1330
|
+
message += '\n' + obj_omniProcessId_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1331
|
+
return new TypeError(message);
|
|
1332
|
+
}
|
|
1333
|
+
})();
|
|
1334
|
+
return v_error === undefined ? null : v_error;
|
|
1335
|
+
}
|
|
1336
|
+
var select$2 = function RecordsRepresentationSelect() {
|
|
1337
|
+
return {
|
|
1338
|
+
kind: 'Fragment',
|
|
1339
|
+
version: VERSION$1,
|
|
1340
|
+
private: [],
|
|
1341
|
+
selections: [
|
|
1342
|
+
{
|
|
1343
|
+
name: 'assessmentEnvelopeId',
|
|
1344
|
+
kind: 'Scalar'
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
name: 'assessmentEnvelopeItemId',
|
|
1348
|
+
kind: 'Scalar'
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
name: 'assessmentId',
|
|
1352
|
+
kind: 'Scalar'
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
name: 'derivedStatus',
|
|
1356
|
+
kind: 'Scalar'
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
name: 'omniProcessId',
|
|
1360
|
+
kind: 'Scalar'
|
|
1361
|
+
}
|
|
1362
|
+
]
|
|
1363
|
+
};
|
|
1364
|
+
};
|
|
1365
|
+
function equals$1(existing, incoming) {
|
|
1366
|
+
var existing_assessmentEnvelopeId = existing.assessmentEnvelopeId;
|
|
1367
|
+
var incoming_assessmentEnvelopeId = incoming.assessmentEnvelopeId;
|
|
1368
|
+
if (!(existing_assessmentEnvelopeId === incoming_assessmentEnvelopeId)) {
|
|
1369
|
+
return false;
|
|
1370
|
+
}
|
|
1371
|
+
var existing_assessmentEnvelopeItemId = existing.assessmentEnvelopeItemId;
|
|
1372
|
+
var incoming_assessmentEnvelopeItemId = incoming.assessmentEnvelopeItemId;
|
|
1373
|
+
if (!(existing_assessmentEnvelopeItemId === incoming_assessmentEnvelopeItemId)) {
|
|
1374
|
+
return false;
|
|
1375
|
+
}
|
|
1376
|
+
var existing_assessmentId = existing.assessmentId;
|
|
1377
|
+
var incoming_assessmentId = incoming.assessmentId;
|
|
1378
|
+
if (!(existing_assessmentId === incoming_assessmentId)) {
|
|
1379
|
+
return false;
|
|
1380
|
+
}
|
|
1381
|
+
var existing_derivedStatus = existing.derivedStatus;
|
|
1382
|
+
var incoming_derivedStatus = incoming.derivedStatus;
|
|
1383
|
+
if (!(existing_derivedStatus === incoming_derivedStatus)) {
|
|
1384
|
+
return false;
|
|
1385
|
+
}
|
|
1386
|
+
var existing_omniProcessId = existing.omniProcessId;
|
|
1387
|
+
var incoming_omniProcessId = incoming.omniProcessId;
|
|
1388
|
+
if (!(existing_omniProcessId === incoming_omniProcessId)) {
|
|
1389
|
+
return false;
|
|
1390
|
+
}
|
|
1391
|
+
return true;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
var VERSION = "c1956ceb39431373785587564063205e";
|
|
1395
|
+
function validate(obj, path) {
|
|
1396
|
+
if (path === void 0) { path = 'AssessmentContextSearchResultRepresentation'; }
|
|
1397
|
+
var v_error = (function () {
|
|
1398
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1399
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1400
|
+
}
|
|
1401
|
+
var obj_hasMoreRecords = obj.hasMoreRecords;
|
|
1402
|
+
var path_hasMoreRecords = path + '.hasMoreRecords';
|
|
1403
|
+
if (typeof obj_hasMoreRecords !== 'boolean') {
|
|
1404
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_hasMoreRecords + '" (at "' + path_hasMoreRecords + '")');
|
|
1405
|
+
}
|
|
1406
|
+
var obj_isSuccess = obj.isSuccess;
|
|
1407
|
+
var path_isSuccess = path + '.isSuccess';
|
|
1408
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
1409
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
1410
|
+
}
|
|
1411
|
+
var obj_message = obj.message;
|
|
1412
|
+
var path_message = path + '.message';
|
|
1413
|
+
var obj_message_union0 = null;
|
|
1414
|
+
var obj_message_union0_error = (function () {
|
|
1415
|
+
if (typeof obj_message !== 'string') {
|
|
1416
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1417
|
+
}
|
|
1418
|
+
})();
|
|
1419
|
+
if (obj_message_union0_error != null) {
|
|
1420
|
+
obj_message_union0 = obj_message_union0_error.message;
|
|
1421
|
+
}
|
|
1422
|
+
var obj_message_union1 = null;
|
|
1423
|
+
var obj_message_union1_error = (function () {
|
|
1424
|
+
if (obj_message !== null) {
|
|
1425
|
+
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1426
|
+
}
|
|
1427
|
+
})();
|
|
1428
|
+
if (obj_message_union1_error != null) {
|
|
1429
|
+
obj_message_union1 = obj_message_union1_error.message;
|
|
1430
|
+
}
|
|
1431
|
+
if (obj_message_union0 && obj_message_union1) {
|
|
1432
|
+
var message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
1433
|
+
message += '\n' + obj_message_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1434
|
+
message += '\n' + obj_message_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1435
|
+
return new TypeError(message);
|
|
1436
|
+
}
|
|
1437
|
+
var obj_recordOffsets = obj.recordOffsets;
|
|
1438
|
+
var path_recordOffsets = path + '.recordOffsets';
|
|
1439
|
+
if (!ArrayIsArray(obj_recordOffsets)) {
|
|
1440
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recordOffsets + '" (at "' + path_recordOffsets + '")');
|
|
1441
|
+
}
|
|
1442
|
+
for (var i = 0; i < obj_recordOffsets.length; i++) {
|
|
1443
|
+
var obj_recordOffsets_item = obj_recordOffsets[i];
|
|
1444
|
+
var path_recordOffsets_item = path_recordOffsets + '[' + i + ']';
|
|
1445
|
+
var referencepath_recordOffsets_itemValidationError = validate$2(obj_recordOffsets_item, path_recordOffsets_item);
|
|
1446
|
+
if (referencepath_recordOffsets_itemValidationError !== null) {
|
|
1447
|
+
var message = 'Object doesn\'t match RecordOffsetRepresentation (at "' + path_recordOffsets_item + '")\n';
|
|
1448
|
+
message += referencepath_recordOffsets_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1449
|
+
return new TypeError(message);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
var obj_records = obj.records;
|
|
1453
|
+
var path_records = path + '.records';
|
|
1454
|
+
if (!ArrayIsArray(obj_records)) {
|
|
1455
|
+
return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
|
|
1456
|
+
}
|
|
1457
|
+
for (var i = 0; i < obj_records.length; i++) {
|
|
1458
|
+
var obj_records_item = obj_records[i];
|
|
1459
|
+
var path_records_item = path_records + '[' + i + ']';
|
|
1460
|
+
var referencepath_records_itemValidationError = validate$1(obj_records_item, path_records_item);
|
|
1461
|
+
if (referencepath_records_itemValidationError !== null) {
|
|
1462
|
+
var message = 'Object doesn\'t match RecordsRepresentation (at "' + path_records_item + '")\n';
|
|
1463
|
+
message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1464
|
+
return new TypeError(message);
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
})();
|
|
1468
|
+
return v_error === undefined ? null : v_error;
|
|
1469
|
+
}
|
|
1470
|
+
var RepresentationType = 'AssessmentContextSearchResultRepresentation';
|
|
1471
|
+
function keyBuilder(luvio, config) {
|
|
1472
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.isSuccess;
|
|
1473
|
+
}
|
|
1474
|
+
function keyBuilderFromType(luvio, object) {
|
|
1475
|
+
var keyParams = {
|
|
1476
|
+
isSuccess: object.isSuccess
|
|
1477
|
+
};
|
|
1478
|
+
return keyBuilder(luvio, keyParams);
|
|
1479
|
+
}
|
|
1480
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1481
|
+
return input;
|
|
1482
|
+
}
|
|
1483
|
+
var select$1 = function AssessmentContextSearchResultRepresentationSelect() {
|
|
1484
|
+
var _a = select$3(), RecordOffsetRepresentation__selections = _a.selections;
|
|
1485
|
+
var _b = select$2(), RecordsRepresentation__selections = _b.selections;
|
|
1486
|
+
return {
|
|
1487
|
+
kind: 'Fragment',
|
|
1488
|
+
version: VERSION,
|
|
1489
|
+
private: [],
|
|
1490
|
+
selections: [
|
|
1491
|
+
{
|
|
1492
|
+
name: 'hasMoreRecords',
|
|
1493
|
+
kind: 'Scalar'
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
name: 'isSuccess',
|
|
1497
|
+
kind: 'Scalar'
|
|
1498
|
+
},
|
|
1499
|
+
{
|
|
1500
|
+
name: 'message',
|
|
1501
|
+
kind: 'Scalar'
|
|
1502
|
+
},
|
|
1503
|
+
{
|
|
1504
|
+
name: 'recordOffsets',
|
|
1505
|
+
kind: 'Object',
|
|
1506
|
+
plural: true,
|
|
1507
|
+
selections: RecordOffsetRepresentation__selections
|
|
1508
|
+
},
|
|
1509
|
+
{
|
|
1510
|
+
name: 'records',
|
|
1511
|
+
kind: 'Object',
|
|
1512
|
+
plural: true,
|
|
1513
|
+
selections: RecordsRepresentation__selections
|
|
1514
|
+
}
|
|
1515
|
+
]
|
|
1516
|
+
};
|
|
1517
|
+
};
|
|
1518
|
+
function equals(existing, incoming) {
|
|
1519
|
+
var existing_hasMoreRecords = existing.hasMoreRecords;
|
|
1520
|
+
var incoming_hasMoreRecords = incoming.hasMoreRecords;
|
|
1521
|
+
if (!(existing_hasMoreRecords === incoming_hasMoreRecords)) {
|
|
1522
|
+
return false;
|
|
1523
|
+
}
|
|
1524
|
+
var existing_isSuccess = existing.isSuccess;
|
|
1525
|
+
var incoming_isSuccess = incoming.isSuccess;
|
|
1526
|
+
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
1527
|
+
return false;
|
|
1528
|
+
}
|
|
1529
|
+
var existing_message = existing.message;
|
|
1530
|
+
var incoming_message = incoming.message;
|
|
1531
|
+
if (!(existing_message === incoming_message)) {
|
|
1532
|
+
return false;
|
|
1533
|
+
}
|
|
1534
|
+
var existing_recordOffsets = existing.recordOffsets;
|
|
1535
|
+
var incoming_recordOffsets = incoming.recordOffsets;
|
|
1536
|
+
var equals_recordOffsets_items = equalsArray(existing_recordOffsets, incoming_recordOffsets, function (existing_recordOffsets_item, incoming_recordOffsets_item) {
|
|
1537
|
+
if (!(equals$2(existing_recordOffsets_item, incoming_recordOffsets_item))) {
|
|
1538
|
+
return false;
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1541
|
+
if (equals_recordOffsets_items === false) {
|
|
1542
|
+
return false;
|
|
1543
|
+
}
|
|
1544
|
+
var existing_records = existing.records;
|
|
1545
|
+
var incoming_records = incoming.records;
|
|
1546
|
+
var equals_records_items = equalsArray(existing_records, incoming_records, function (existing_records_item, incoming_records_item) {
|
|
1547
|
+
if (!(equals$1(existing_records_item, incoming_records_item))) {
|
|
1548
|
+
return false;
|
|
1549
|
+
}
|
|
1550
|
+
});
|
|
1551
|
+
if (equals_records_items === false) {
|
|
1552
|
+
return false;
|
|
1553
|
+
}
|
|
1554
|
+
return true;
|
|
1555
|
+
}
|
|
1556
|
+
var ingest = function AssessmentContextSearchResultRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1557
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1558
|
+
var validateError = validate(input);
|
|
1559
|
+
if (validateError !== null) {
|
|
1560
|
+
throw validateError;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
var key = keyBuilderFromType(luvio, input);
|
|
1564
|
+
var existingRecord = store.readEntry(key);
|
|
1565
|
+
var ttlToUse = path.ttl !== undefined ? path.ttl : 6000;
|
|
1566
|
+
var incomingRecord = normalize(input, store.readEntry(key), {
|
|
1567
|
+
fullPath: key,
|
|
1568
|
+
parent: path.parent,
|
|
1569
|
+
propertyName: path.propertyName,
|
|
1570
|
+
ttl: ttlToUse
|
|
1571
|
+
});
|
|
1572
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
1573
|
+
luvio.storePublish(key, incomingRecord);
|
|
1574
|
+
}
|
|
1575
|
+
if (ttlToUse !== undefined) {
|
|
1576
|
+
var storeMetadataParams = {
|
|
1577
|
+
ttl: ttlToUse,
|
|
1578
|
+
namespace: "assessment",
|
|
1579
|
+
version: VERSION,
|
|
1580
|
+
representationName: RepresentationType,
|
|
1581
|
+
};
|
|
1582
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1583
|
+
}
|
|
1584
|
+
return createLink(key);
|
|
1585
|
+
};
|
|
1586
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
1587
|
+
var rootKeySet = new engine.StoreKeyMap();
|
|
1588
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1589
|
+
var rootKey = keyBuilderFromType(luvio, input);
|
|
1590
|
+
rootKeySet.set(rootKey, {
|
|
1591
|
+
namespace: keyPrefix,
|
|
1592
|
+
representationName: RepresentationType,
|
|
1593
|
+
mergeable: false
|
|
1594
|
+
});
|
|
1595
|
+
return rootKeySet;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
function select(luvio, params) {
|
|
1599
|
+
return select$1();
|
|
1600
|
+
}
|
|
1601
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
1602
|
+
return getTypeCacheKeys(luvio, response);
|
|
1603
|
+
}
|
|
1604
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
1605
|
+
var body = response.body;
|
|
1606
|
+
var key = keyBuilderFromType(luvio, body);
|
|
1607
|
+
luvio.storeIngest(key, ingest, body);
|
|
1608
|
+
var snapshot = luvio.storeLookup({
|
|
1609
|
+
recordId: key,
|
|
1610
|
+
node: select(),
|
|
1611
|
+
variables: {},
|
|
1612
|
+
});
|
|
1613
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1614
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1615
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
return snapshot;
|
|
1619
|
+
}
|
|
1620
|
+
function createResourceRequest(config) {
|
|
1621
|
+
var headers = {};
|
|
1622
|
+
return {
|
|
1623
|
+
baseUri: '/services/data/v58.0',
|
|
1624
|
+
basePath: '/connect/assessments/' + config.urlParams.contextId + '/assessment-elements',
|
|
1625
|
+
method: 'post',
|
|
1626
|
+
body: config.body,
|
|
1627
|
+
urlParams: config.urlParams,
|
|
1628
|
+
queryParams: {},
|
|
1629
|
+
headers: headers,
|
|
1630
|
+
priority: 'normal',
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
var postAssessmentContextSearch_ConfigPropertyNames = {
|
|
1635
|
+
displayName: 'postAssessmentContextSearch',
|
|
1636
|
+
parameters: {
|
|
1637
|
+
required: ['contextId', 'AssessmentContextSearchData'],
|
|
1638
|
+
optional: []
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
function createResourceParams(config) {
|
|
1642
|
+
var resourceParams = {
|
|
1643
|
+
urlParams: {
|
|
1644
|
+
contextId: config.contextId
|
|
1645
|
+
},
|
|
1646
|
+
body: {
|
|
1647
|
+
AssessmentContextSearchData: config.AssessmentContextSearchData
|
|
1648
|
+
}
|
|
1649
|
+
};
|
|
1650
|
+
return resourceParams;
|
|
1651
|
+
}
|
|
1652
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1653
|
+
var config = {};
|
|
1654
|
+
var untrustedConfig_contextId = untrustedConfig.contextId;
|
|
1655
|
+
if (typeof untrustedConfig_contextId === 'string') {
|
|
1656
|
+
config.contextId = untrustedConfig_contextId;
|
|
1657
|
+
}
|
|
1658
|
+
var untrustedConfig_AssessmentContextSearchData = untrustedConfig.AssessmentContextSearchData;
|
|
1659
|
+
var referenceAssessmentContextSearchInputRepresentationValidationError = validate$3(untrustedConfig_AssessmentContextSearchData);
|
|
1660
|
+
if (referenceAssessmentContextSearchInputRepresentationValidationError === null) {
|
|
1661
|
+
config.AssessmentContextSearchData = untrustedConfig_AssessmentContextSearchData;
|
|
1662
|
+
}
|
|
1663
|
+
return config;
|
|
1664
|
+
}
|
|
1665
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1666
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1667
|
+
return null;
|
|
1668
|
+
}
|
|
1669
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1670
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1671
|
+
}
|
|
1672
|
+
var config = typeCheckConfig(untrustedConfig);
|
|
1673
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1674
|
+
return null;
|
|
1675
|
+
}
|
|
1676
|
+
return config;
|
|
1677
|
+
}
|
|
1678
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1679
|
+
var resourceParams = createResourceParams(config);
|
|
1680
|
+
var request = createResourceRequest(resourceParams);
|
|
1681
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1682
|
+
.then(function (response) {
|
|
1683
|
+
return luvio.handleSuccessResponse(function () {
|
|
1684
|
+
var snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1685
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
1686
|
+
}, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
|
|
1687
|
+
}, function (response) {
|
|
1688
|
+
deepFreeze$3(response);
|
|
1689
|
+
throw response;
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
var postAssessmentContextSearchAdapterFactory = function (luvio) {
|
|
1693
|
+
return function postAssessmentContextSearch(untrustedConfig) {
|
|
1694
|
+
var config = validateAdapterConfig(untrustedConfig, postAssessmentContextSearch_ConfigPropertyNames);
|
|
1695
|
+
// Invalid or incomplete config
|
|
1696
|
+
if (config === null) {
|
|
1697
|
+
throw new Error('Invalid config for "postAssessmentContextSearch"');
|
|
1698
|
+
}
|
|
1699
|
+
return buildNetworkSnapshot(luvio, config);
|
|
1700
|
+
};
|
|
1701
|
+
};
|
|
1702
|
+
|
|
1703
|
+
exports.getAssessmentEnvelopeAdapterFactory = getAssessmentEnvelopeAdapterFactory;
|
|
1704
|
+
exports.postAssessmentContextSearchAdapterFactory = postAssessmentContextSearchAdapterFactory;
|
|
1705
|
+
exports.postAssessmentEnvelopeAdapterFactory = postAssessmentEnvelopeAdapterFactory;
|
|
1706
|
+
|
|
1707
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1708
|
+
|
|
1709
|
+
}));
|