@salesforce/lds-adapters-industries-actionplan 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-actionplan.js +1205 -0
- package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
- package/dist/types/src/generated/adapters/getActionPlanItems.d.ts +27 -0
- package/dist/types/src/generated/adapters/getActionPlanStatusInfo.d.ts +26 -0
- package/dist/types/src/generated/adapters/getActionPlans.d.ts +30 -0
- package/dist/types/src/generated/artifacts/main.d.ts +3 -0
- package/dist/types/src/generated/artifacts/sfdc.d.ts +7 -0
- package/dist/types/src/generated/resources/getConnectActionPlan.d.ts +19 -0
- package/dist/types/src/generated/resources/getConnectActionPlanActionPlanItemsByActionPlanId.d.ts +18 -0
- package/dist/types/src/generated/resources/getConnectActionPlanStatusInfoByActionPlanId.d.ts +15 -0
- package/dist/types/src/generated/types/ActionPlanItemCollectionRepresentation.d.ts +30 -0
- package/dist/types/src/generated/types/ActionPlanItemDetailedRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/ActionPlanItemListRepresentation.d.ts +30 -0
- package/dist/types/src/generated/types/ActionPlanItemRepresentation.d.ts +29 -0
- package/dist/types/src/generated/types/ActionPlanItemTaskRepresentation.d.ts +39 -0
- package/dist/types/src/generated/types/ActionPlanItemsWrapperRepresentation.d.ts +31 -0
- package/dist/types/src/generated/types/ActionPlanListRepresentation.d.ts +30 -0
- package/dist/types/src/generated/types/ActionPlanRepresentation.d.ts +38 -0
- package/dist/types/src/generated/types/ActionPlanStatusInfoOutputRepresentation.d.ts +40 -0
- package/dist/types/src/generated/types/ActionPlansWrapperOutputRepresentation.d.ts +31 -0
- package/dist/types/src/generated/types/ComputedFieldsWrapperRepresentation.d.ts +33 -0
- package/dist/types/src/generated/types/FieldRepresentation.d.ts +38 -0
- package/dist/types/src/generated/types/TaskProgressRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/type-utils.d.ts +39 -0
- package/dist/umd/es2018/industries-actionplan.js +1215 -0
- package/dist/umd/es5/industries-actionplan.js +1228 -0
- package/package.json +71 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +1253 -0
- package/src/raml/api.raml +262 -0
- package/src/raml/luvio.raml +38 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,1253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* *******************************************************************************************
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
+
import { serializeStructuredKey, StoreKeyMap } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
|
|
21
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
22
|
+
/**
|
|
23
|
+
* Validates an adapter config is well-formed.
|
|
24
|
+
* @param config The config to validate.
|
|
25
|
+
* @param adapter The adapter validation configuration.
|
|
26
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
27
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
28
|
+
*/
|
|
29
|
+
function validateConfig(config, adapter, oneOf) {
|
|
30
|
+
const { displayName } = adapter;
|
|
31
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
32
|
+
if (config === undefined ||
|
|
33
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
34
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
37
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
38
|
+
}
|
|
39
|
+
if (unsupported !== undefined &&
|
|
40
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
41
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
const supported = required.concat(optional);
|
|
44
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
45
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function untrustedIsObject(untrusted) {
|
|
49
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
50
|
+
}
|
|
51
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
52
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
53
|
+
}
|
|
54
|
+
const snapshotRefreshOptions = {
|
|
55
|
+
overrides: {
|
|
56
|
+
headers: {
|
|
57
|
+
'Cache-Control': 'no-cache',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const keyPrefix = 'ActionPlan';
|
|
62
|
+
|
|
63
|
+
const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
64
|
+
const { isArray: ArrayIsArray } = Array;
|
|
65
|
+
const { stringify: JSONStringify } = JSON;
|
|
66
|
+
function deepFreeze$d(value) {
|
|
67
|
+
// No need to freeze primitives
|
|
68
|
+
if (typeof value !== 'object' || value === null) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (ArrayIsArray(value)) {
|
|
72
|
+
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
73
|
+
deepFreeze$d(value[i]);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
const keys = ObjectKeys(value);
|
|
78
|
+
for (let i = 0, len = keys.length; i < len; i += 1) {
|
|
79
|
+
deepFreeze$d(value[keys[i]]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
ObjectFreeze(value);
|
|
83
|
+
}
|
|
84
|
+
function createLink(ref) {
|
|
85
|
+
return {
|
|
86
|
+
__ref: serializeStructuredKey(ref),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function validate$c(obj, path = 'ComputedFieldsWrapperRepresentation') {
|
|
91
|
+
const v_error = (() => {
|
|
92
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
93
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
94
|
+
}
|
|
95
|
+
const obj_fields = obj.fields;
|
|
96
|
+
const path_fields = path + '.fields';
|
|
97
|
+
if (typeof obj_fields !== 'object' || ArrayIsArray(obj_fields) || obj_fields === null) {
|
|
98
|
+
return new TypeError('Expected "object" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
99
|
+
}
|
|
100
|
+
const obj_fields_keys = ObjectKeys(obj_fields);
|
|
101
|
+
for (let i = 0; i < obj_fields_keys.length; i++) {
|
|
102
|
+
const key = obj_fields_keys[i];
|
|
103
|
+
const obj_fields_prop = obj_fields[key];
|
|
104
|
+
const path_fields_prop = path_fields + '["' + key + '"]';
|
|
105
|
+
if (obj_fields_prop === undefined) {
|
|
106
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_fields_prop + '" (at "' + path_fields_prop + '")');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
})();
|
|
110
|
+
return v_error === undefined ? null : v_error;
|
|
111
|
+
}
|
|
112
|
+
function deepFreeze$c(input) {
|
|
113
|
+
const input_fields = input.fields;
|
|
114
|
+
const input_fields_keys = Object.keys(input_fields);
|
|
115
|
+
const input_fields_length = input_fields_keys.length;
|
|
116
|
+
for (let i = 0; i < input_fields_length; i++) {
|
|
117
|
+
const key = input_fields_keys[i];
|
|
118
|
+
const input_fields_prop = input_fields[key];
|
|
119
|
+
deepFreeze$d(input_fields_prop);
|
|
120
|
+
}
|
|
121
|
+
ObjectFreeze(input_fields);
|
|
122
|
+
ObjectFreeze(input);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function validate$b(obj, path = 'FieldRepresentation') {
|
|
126
|
+
const v_error = (() => {
|
|
127
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
128
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
129
|
+
}
|
|
130
|
+
const obj_colType = obj.colType;
|
|
131
|
+
const path_colType = path + '.colType';
|
|
132
|
+
if (typeof obj_colType !== 'string') {
|
|
133
|
+
return new TypeError('Expected "string" but received "' + typeof obj_colType + '" (at "' + path_colType + '")');
|
|
134
|
+
}
|
|
135
|
+
const obj_fieldName = obj.fieldName;
|
|
136
|
+
const path_fieldName = path + '.fieldName';
|
|
137
|
+
if (typeof obj_fieldName !== 'string') {
|
|
138
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
|
|
139
|
+
}
|
|
140
|
+
const obj_label = obj.label;
|
|
141
|
+
const path_label = path + '.label';
|
|
142
|
+
if (typeof obj_label !== 'string') {
|
|
143
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
144
|
+
}
|
|
145
|
+
const obj_value = obj.value;
|
|
146
|
+
const path_value = path + '.value';
|
|
147
|
+
if (typeof obj_value !== 'string') {
|
|
148
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
149
|
+
}
|
|
150
|
+
})();
|
|
151
|
+
return v_error === undefined ? null : v_error;
|
|
152
|
+
}
|
|
153
|
+
function deepFreeze$b(input) {
|
|
154
|
+
ObjectFreeze(input);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function validate$a(obj, path = 'TaskProgressRepresentation') {
|
|
158
|
+
const v_error = (() => {
|
|
159
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
160
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
161
|
+
}
|
|
162
|
+
const obj_currentValue = obj.currentValue;
|
|
163
|
+
const path_currentValue = path + '.currentValue';
|
|
164
|
+
if (typeof obj_currentValue !== 'number' || (typeof obj_currentValue === 'number' && Math.floor(obj_currentValue) !== obj_currentValue)) {
|
|
165
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_currentValue + '" (at "' + path_currentValue + '")');
|
|
166
|
+
}
|
|
167
|
+
const obj_maxValue = obj.maxValue;
|
|
168
|
+
const path_maxValue = path + '.maxValue';
|
|
169
|
+
if (typeof obj_maxValue !== 'number' || (typeof obj_maxValue === 'number' && Math.floor(obj_maxValue) !== obj_maxValue)) {
|
|
170
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_maxValue + '" (at "' + path_maxValue + '")');
|
|
171
|
+
}
|
|
172
|
+
const obj_minValue = obj.minValue;
|
|
173
|
+
const path_minValue = path + '.minValue';
|
|
174
|
+
if (typeof obj_minValue !== 'number' || (typeof obj_minValue === 'number' && Math.floor(obj_minValue) !== obj_minValue)) {
|
|
175
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_minValue + '" (at "' + path_minValue + '")');
|
|
176
|
+
}
|
|
177
|
+
})();
|
|
178
|
+
return v_error === undefined ? null : v_error;
|
|
179
|
+
}
|
|
180
|
+
function deepFreeze$a(input) {
|
|
181
|
+
ObjectFreeze(input);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function validate$9(obj, path = 'ActionPlanItemTaskRepresentation') {
|
|
185
|
+
const v_error = (() => {
|
|
186
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
187
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
188
|
+
}
|
|
189
|
+
if (obj.computedFields !== undefined) {
|
|
190
|
+
const obj_computedFields = obj.computedFields;
|
|
191
|
+
const path_computedFields = path + '.computedFields';
|
|
192
|
+
const referencepath_computedFieldsValidationError = validate$c(obj_computedFields, path_computedFields);
|
|
193
|
+
if (referencepath_computedFieldsValidationError !== null) {
|
|
194
|
+
let message = 'Object doesn\'t match ComputedFieldsWrapperRepresentation (at "' + path_computedFields + '")\n';
|
|
195
|
+
message += referencepath_computedFieldsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
196
|
+
return new TypeError(message);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (obj.fields !== undefined) {
|
|
200
|
+
const obj_fields = obj.fields;
|
|
201
|
+
const path_fields = path + '.fields';
|
|
202
|
+
if (!ArrayIsArray(obj_fields)) {
|
|
203
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
204
|
+
}
|
|
205
|
+
for (let i = 0; i < obj_fields.length; i++) {
|
|
206
|
+
const obj_fields_item = obj_fields[i];
|
|
207
|
+
const path_fields_item = path_fields + '[' + i + ']';
|
|
208
|
+
const referencepath_fields_itemValidationError = validate$b(obj_fields_item, path_fields_item);
|
|
209
|
+
if (referencepath_fields_itemValidationError !== null) {
|
|
210
|
+
let message = 'Object doesn\'t match FieldRepresentation (at "' + path_fields_item + '")\n';
|
|
211
|
+
message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
212
|
+
return new TypeError(message);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const obj_id = obj.id;
|
|
217
|
+
const path_id = path + '.id';
|
|
218
|
+
if (typeof obj_id !== 'string') {
|
|
219
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
220
|
+
}
|
|
221
|
+
if (obj.progress !== undefined) {
|
|
222
|
+
const obj_progress = obj.progress;
|
|
223
|
+
const path_progress = path + '.progress';
|
|
224
|
+
const referencepath_progressValidationError = validate$a(obj_progress, path_progress);
|
|
225
|
+
if (referencepath_progressValidationError !== null) {
|
|
226
|
+
let message = 'Object doesn\'t match TaskProgressRepresentation (at "' + path_progress + '")\n';
|
|
227
|
+
message += referencepath_progressValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
228
|
+
return new TypeError(message);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
})();
|
|
232
|
+
return v_error === undefined ? null : v_error;
|
|
233
|
+
}
|
|
234
|
+
function deepFreeze$9(input) {
|
|
235
|
+
const input_computedFields = input.computedFields;
|
|
236
|
+
if (input_computedFields !== undefined) {
|
|
237
|
+
deepFreeze$c(input_computedFields);
|
|
238
|
+
}
|
|
239
|
+
const input_fields = input.fields;
|
|
240
|
+
if (input_fields !== undefined) {
|
|
241
|
+
for (let i = 0; i < input_fields.length; i++) {
|
|
242
|
+
const input_fields_item = input_fields[i];
|
|
243
|
+
deepFreeze$b(input_fields_item);
|
|
244
|
+
}
|
|
245
|
+
ObjectFreeze(input_fields);
|
|
246
|
+
}
|
|
247
|
+
const input_progress = input.progress;
|
|
248
|
+
if (input_progress !== undefined) {
|
|
249
|
+
deepFreeze$a(input_progress);
|
|
250
|
+
}
|
|
251
|
+
ObjectFreeze(input);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function validate$8(obj, path = 'ActionPlanItemDetailedRepresentation') {
|
|
255
|
+
const v_error = (() => {
|
|
256
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
257
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
258
|
+
}
|
|
259
|
+
if (obj.actionPlanItemTask !== undefined) {
|
|
260
|
+
const obj_actionPlanItemTask = obj.actionPlanItemTask;
|
|
261
|
+
const path_actionPlanItemTask = path + '.actionPlanItemTask';
|
|
262
|
+
const referencepath_actionPlanItemTaskValidationError = validate$9(obj_actionPlanItemTask, path_actionPlanItemTask);
|
|
263
|
+
if (referencepath_actionPlanItemTaskValidationError !== null) {
|
|
264
|
+
let message = 'Object doesn\'t match ActionPlanItemTaskRepresentation (at "' + path_actionPlanItemTask + '")\n';
|
|
265
|
+
message += referencepath_actionPlanItemTaskValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
266
|
+
return new TypeError(message);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
const obj_id = obj.id;
|
|
270
|
+
const path_id = path + '.id';
|
|
271
|
+
if (typeof obj_id !== 'string') {
|
|
272
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
273
|
+
}
|
|
274
|
+
const obj_isRequired = obj.isRequired;
|
|
275
|
+
const path_isRequired = path + '.isRequired';
|
|
276
|
+
if (typeof obj_isRequired !== 'boolean') {
|
|
277
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isRequired + '" (at "' + path_isRequired + '")');
|
|
278
|
+
}
|
|
279
|
+
})();
|
|
280
|
+
return v_error === undefined ? null : v_error;
|
|
281
|
+
}
|
|
282
|
+
function deepFreeze$8(input) {
|
|
283
|
+
const input_actionPlanItemTask = input.actionPlanItemTask;
|
|
284
|
+
if (input_actionPlanItemTask !== undefined) {
|
|
285
|
+
deepFreeze$9(input_actionPlanItemTask);
|
|
286
|
+
}
|
|
287
|
+
ObjectFreeze(input);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function validate$7(obj, path = 'ActionPlanItemCollectionRepresentation') {
|
|
291
|
+
const v_error = (() => {
|
|
292
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
293
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
294
|
+
}
|
|
295
|
+
const obj_records = obj.records;
|
|
296
|
+
const path_records = path + '.records';
|
|
297
|
+
if (!ArrayIsArray(obj_records)) {
|
|
298
|
+
return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
|
|
299
|
+
}
|
|
300
|
+
for (let i = 0; i < obj_records.length; i++) {
|
|
301
|
+
const obj_records_item = obj_records[i];
|
|
302
|
+
const path_records_item = path_records + '[' + i + ']';
|
|
303
|
+
const referencepath_records_itemValidationError = validate$8(obj_records_item, path_records_item);
|
|
304
|
+
if (referencepath_records_itemValidationError !== null) {
|
|
305
|
+
let message = 'Object doesn\'t match ActionPlanItemDetailedRepresentation (at "' + path_records_item + '")\n';
|
|
306
|
+
message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
307
|
+
return new TypeError(message);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
})();
|
|
311
|
+
return v_error === undefined ? null : v_error;
|
|
312
|
+
}
|
|
313
|
+
function deepFreeze$7(input) {
|
|
314
|
+
const input_records = input.records;
|
|
315
|
+
for (let i = 0; i < input_records.length; i++) {
|
|
316
|
+
const input_records_item = input_records[i];
|
|
317
|
+
deepFreeze$8(input_records_item);
|
|
318
|
+
}
|
|
319
|
+
ObjectFreeze(input_records);
|
|
320
|
+
ObjectFreeze(input);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const TTL$2 = 1000;
|
|
324
|
+
const VERSION$2 = "01f1998519e78c50e1b67804b6fcb652";
|
|
325
|
+
function validate$6(obj, path = 'ActionPlanItemsWrapperRepresentation') {
|
|
326
|
+
const v_error = (() => {
|
|
327
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
328
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
329
|
+
}
|
|
330
|
+
const obj_actionPlanItems = obj.actionPlanItems;
|
|
331
|
+
const path_actionPlanItems = path + '.actionPlanItems';
|
|
332
|
+
const referencepath_actionPlanItemsValidationError = validate$7(obj_actionPlanItems, path_actionPlanItems);
|
|
333
|
+
if (referencepath_actionPlanItemsValidationError !== null) {
|
|
334
|
+
let message = 'Object doesn\'t match ActionPlanItemCollectionRepresentation (at "' + path_actionPlanItems + '")\n';
|
|
335
|
+
message += referencepath_actionPlanItemsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
336
|
+
return new TypeError(message);
|
|
337
|
+
}
|
|
338
|
+
})();
|
|
339
|
+
return v_error === undefined ? null : v_error;
|
|
340
|
+
}
|
|
341
|
+
const RepresentationType$2 = 'ActionPlanItemsWrapperRepresentation';
|
|
342
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
343
|
+
return input;
|
|
344
|
+
}
|
|
345
|
+
const select$5 = function ActionPlanItemsWrapperRepresentationSelect() {
|
|
346
|
+
return {
|
|
347
|
+
kind: 'Fragment',
|
|
348
|
+
version: VERSION$2,
|
|
349
|
+
private: [],
|
|
350
|
+
opaque: true
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
function equals$2(existing, incoming) {
|
|
354
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
return true;
|
|
358
|
+
}
|
|
359
|
+
function deepFreeze$6(input) {
|
|
360
|
+
const input_actionPlanItems = input.actionPlanItems;
|
|
361
|
+
deepFreeze$7(input_actionPlanItems);
|
|
362
|
+
ObjectFreeze(input);
|
|
363
|
+
}
|
|
364
|
+
const ingest$2 = function ActionPlanItemsWrapperRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
365
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
366
|
+
const validateError = validate$6(input);
|
|
367
|
+
if (validateError !== null) {
|
|
368
|
+
throw validateError;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
const key = path.fullPath;
|
|
372
|
+
const existingRecord = store.readEntry(key);
|
|
373
|
+
const ttlToUse = TTL$2;
|
|
374
|
+
let incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
375
|
+
fullPath: key,
|
|
376
|
+
parent: path.parent,
|
|
377
|
+
propertyName: path.propertyName,
|
|
378
|
+
ttl: ttlToUse
|
|
379
|
+
});
|
|
380
|
+
deepFreeze$6(input);
|
|
381
|
+
if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
|
|
382
|
+
luvio.storePublish(key, incomingRecord);
|
|
383
|
+
}
|
|
384
|
+
{
|
|
385
|
+
const storeMetadataParams = {
|
|
386
|
+
ttl: ttlToUse,
|
|
387
|
+
namespace: "ActionPlan",
|
|
388
|
+
version: VERSION$2,
|
|
389
|
+
representationName: RepresentationType$2,
|
|
390
|
+
};
|
|
391
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
392
|
+
}
|
|
393
|
+
return createLink(key);
|
|
394
|
+
};
|
|
395
|
+
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
396
|
+
const rootKeySet = new StoreKeyMap();
|
|
397
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
398
|
+
const rootKey = fullPathFactory();
|
|
399
|
+
rootKeySet.set(rootKey, {
|
|
400
|
+
namespace: keyPrefix,
|
|
401
|
+
representationName: RepresentationType$2,
|
|
402
|
+
mergeable: false
|
|
403
|
+
});
|
|
404
|
+
return rootKeySet;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
function select$4(luvio, params) {
|
|
408
|
+
return select$5();
|
|
409
|
+
}
|
|
410
|
+
function keyBuilder$5(luvio, params) {
|
|
411
|
+
return keyPrefix + '::ActionPlanItemsWrapperRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'actionPlanId:' + params.urlParams.actionPlanId + ')';
|
|
412
|
+
}
|
|
413
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
414
|
+
return getTypeCacheKeys$2(luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
415
|
+
}
|
|
416
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
417
|
+
const { body } = response;
|
|
418
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
419
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
420
|
+
const snapshot = luvio.storeLookup({
|
|
421
|
+
recordId: key,
|
|
422
|
+
node: select$4(),
|
|
423
|
+
variables: {},
|
|
424
|
+
}, snapshotRefresh);
|
|
425
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
426
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
427
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return snapshot;
|
|
431
|
+
}
|
|
432
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
433
|
+
const key = keyBuilder$5(luvio, params);
|
|
434
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
435
|
+
const storeMetadataParams = {
|
|
436
|
+
ttl: TTL$2,
|
|
437
|
+
namespace: keyPrefix,
|
|
438
|
+
version: VERSION$2,
|
|
439
|
+
representationName: RepresentationType$2
|
|
440
|
+
};
|
|
441
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
442
|
+
return errorSnapshot;
|
|
443
|
+
}
|
|
444
|
+
function createResourceRequest$2(config) {
|
|
445
|
+
const headers = {};
|
|
446
|
+
return {
|
|
447
|
+
baseUri: '/services/data/v58.0',
|
|
448
|
+
basePath: '/connect/action-plan/' + config.urlParams.actionPlanId + '/action-plan-items',
|
|
449
|
+
method: 'get',
|
|
450
|
+
body: null,
|
|
451
|
+
urlParams: config.urlParams,
|
|
452
|
+
queryParams: config.queryParams,
|
|
453
|
+
headers,
|
|
454
|
+
priority: 'normal',
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const getActionPlanItems_ConfigPropertyNames = {
|
|
459
|
+
displayName: 'getActionPlanItems',
|
|
460
|
+
parameters: {
|
|
461
|
+
required: ['actionPlanId'],
|
|
462
|
+
optional: ['limit']
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
function createResourceParams$2(config) {
|
|
466
|
+
const resourceParams = {
|
|
467
|
+
urlParams: {
|
|
468
|
+
actionPlanId: config.actionPlanId
|
|
469
|
+
},
|
|
470
|
+
queryParams: {
|
|
471
|
+
limit: config.limit
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
return resourceParams;
|
|
475
|
+
}
|
|
476
|
+
function keyBuilder$4(luvio, config) {
|
|
477
|
+
const resourceParams = createResourceParams$2(config);
|
|
478
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
479
|
+
}
|
|
480
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
481
|
+
const config = {};
|
|
482
|
+
const untrustedConfig_actionPlanId = untrustedConfig.actionPlanId;
|
|
483
|
+
if (typeof untrustedConfig_actionPlanId === 'string') {
|
|
484
|
+
config.actionPlanId = untrustedConfig_actionPlanId;
|
|
485
|
+
}
|
|
486
|
+
const untrustedConfig_limit = untrustedConfig.limit;
|
|
487
|
+
if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
|
|
488
|
+
config.limit = untrustedConfig_limit;
|
|
489
|
+
}
|
|
490
|
+
return config;
|
|
491
|
+
}
|
|
492
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
493
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
494
|
+
return null;
|
|
495
|
+
}
|
|
496
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
497
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
498
|
+
}
|
|
499
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
500
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
503
|
+
return config;
|
|
504
|
+
}
|
|
505
|
+
function adapterFragment$2(luvio, config) {
|
|
506
|
+
createResourceParams$2(config);
|
|
507
|
+
return select$4();
|
|
508
|
+
}
|
|
509
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
510
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
511
|
+
config,
|
|
512
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
513
|
+
});
|
|
514
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
515
|
+
}
|
|
516
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
517
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
518
|
+
config,
|
|
519
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
520
|
+
});
|
|
521
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
522
|
+
}
|
|
523
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
524
|
+
const resourceParams = createResourceParams$2(config);
|
|
525
|
+
const request = createResourceRequest$2(resourceParams);
|
|
526
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
527
|
+
.then((response) => {
|
|
528
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
|
|
529
|
+
}, (response) => {
|
|
530
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
534
|
+
const { luvio, config } = context;
|
|
535
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
536
|
+
const dispatchOptions = {
|
|
537
|
+
resourceRequestContext: {
|
|
538
|
+
requestCorrelator,
|
|
539
|
+
luvioRequestMethod: undefined,
|
|
540
|
+
},
|
|
541
|
+
eventObservers
|
|
542
|
+
};
|
|
543
|
+
if (networkPriority !== 'normal') {
|
|
544
|
+
dispatchOptions.overrides = {
|
|
545
|
+
priority: networkPriority
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
|
|
549
|
+
}
|
|
550
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
551
|
+
const { luvio, config } = context;
|
|
552
|
+
const selector = {
|
|
553
|
+
recordId: keyBuilder$4(luvio, config),
|
|
554
|
+
node: adapterFragment$2(luvio, config),
|
|
555
|
+
variables: {},
|
|
556
|
+
};
|
|
557
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
558
|
+
config,
|
|
559
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
560
|
+
});
|
|
561
|
+
return cacheSnapshot;
|
|
562
|
+
}
|
|
563
|
+
const getActionPlanItemsAdapterFactory = (luvio) => function ActionPlan__getActionPlanItems(untrustedConfig, requestContext) {
|
|
564
|
+
const config = validateAdapterConfig$2(untrustedConfig, getActionPlanItems_ConfigPropertyNames);
|
|
565
|
+
// Invalid or incomplete config
|
|
566
|
+
if (config === null) {
|
|
567
|
+
return null;
|
|
568
|
+
}
|
|
569
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
570
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
function validate$5(obj, path = 'ActionPlanItemRepresentation') {
|
|
574
|
+
const v_error = (() => {
|
|
575
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
576
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
577
|
+
}
|
|
578
|
+
const obj_id = obj.id;
|
|
579
|
+
const path_id = path + '.id';
|
|
580
|
+
if (typeof obj_id !== 'string') {
|
|
581
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
582
|
+
}
|
|
583
|
+
})();
|
|
584
|
+
return v_error === undefined ? null : v_error;
|
|
585
|
+
}
|
|
586
|
+
function deepFreeze$5(input) {
|
|
587
|
+
ObjectFreeze(input);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
function validate$4(obj, path = 'ActionPlanItemListRepresentation') {
|
|
591
|
+
const v_error = (() => {
|
|
592
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
593
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
594
|
+
}
|
|
595
|
+
const obj_records = obj.records;
|
|
596
|
+
const path_records = path + '.records';
|
|
597
|
+
if (!ArrayIsArray(obj_records)) {
|
|
598
|
+
return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
|
|
599
|
+
}
|
|
600
|
+
for (let i = 0; i < obj_records.length; i++) {
|
|
601
|
+
const obj_records_item = obj_records[i];
|
|
602
|
+
const path_records_item = path_records + '[' + i + ']';
|
|
603
|
+
const referencepath_records_itemValidationError = validate$5(obj_records_item, path_records_item);
|
|
604
|
+
if (referencepath_records_itemValidationError !== null) {
|
|
605
|
+
let message = 'Object doesn\'t match ActionPlanItemRepresentation (at "' + path_records_item + '")\n';
|
|
606
|
+
message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
607
|
+
return new TypeError(message);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
})();
|
|
611
|
+
return v_error === undefined ? null : v_error;
|
|
612
|
+
}
|
|
613
|
+
function deepFreeze$4(input) {
|
|
614
|
+
const input_records = input.records;
|
|
615
|
+
for (let i = 0; i < input_records.length; i++) {
|
|
616
|
+
const input_records_item = input_records[i];
|
|
617
|
+
deepFreeze$5(input_records_item);
|
|
618
|
+
}
|
|
619
|
+
ObjectFreeze(input_records);
|
|
620
|
+
ObjectFreeze(input);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
const TTL$1 = 1000;
|
|
624
|
+
const VERSION$1 = "8d866f38a882381bbdafb2496aa6f6b8";
|
|
625
|
+
function validate$3(obj, path = 'ActionPlanStatusInfoOutputRepresentation') {
|
|
626
|
+
const v_error = (() => {
|
|
627
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
628
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
629
|
+
}
|
|
630
|
+
const obj_mandatoryItemsCompleted = obj.mandatoryItemsCompleted;
|
|
631
|
+
const path_mandatoryItemsCompleted = path + '.mandatoryItemsCompleted';
|
|
632
|
+
if (typeof obj_mandatoryItemsCompleted !== 'boolean') {
|
|
633
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_mandatoryItemsCompleted + '" (at "' + path_mandatoryItemsCompleted + '")');
|
|
634
|
+
}
|
|
635
|
+
if (obj.mandatoryItemsPending !== undefined) {
|
|
636
|
+
const obj_mandatoryItemsPending = obj.mandatoryItemsPending;
|
|
637
|
+
const path_mandatoryItemsPending = path + '.mandatoryItemsPending';
|
|
638
|
+
const referencepath_mandatoryItemsPendingValidationError = validate$4(obj_mandatoryItemsPending, path_mandatoryItemsPending);
|
|
639
|
+
if (referencepath_mandatoryItemsPendingValidationError !== null) {
|
|
640
|
+
let message = 'Object doesn\'t match ActionPlanItemListRepresentation (at "' + path_mandatoryItemsPending + '")\n';
|
|
641
|
+
message += referencepath_mandatoryItemsPendingValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
642
|
+
return new TypeError(message);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
const obj_optionalItemsCompleted = obj.optionalItemsCompleted;
|
|
646
|
+
const path_optionalItemsCompleted = path + '.optionalItemsCompleted';
|
|
647
|
+
if (typeof obj_optionalItemsCompleted !== 'boolean') {
|
|
648
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_optionalItemsCompleted + '" (at "' + path_optionalItemsCompleted + '")');
|
|
649
|
+
}
|
|
650
|
+
if (obj.statusCode !== undefined) {
|
|
651
|
+
const obj_statusCode = obj.statusCode;
|
|
652
|
+
const path_statusCode = path + '.statusCode';
|
|
653
|
+
if (typeof obj_statusCode !== 'string') {
|
|
654
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
})();
|
|
658
|
+
return v_error === undefined ? null : v_error;
|
|
659
|
+
}
|
|
660
|
+
const RepresentationType$1 = 'ActionPlanStatusInfoOutputRepresentation';
|
|
661
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
662
|
+
return input;
|
|
663
|
+
}
|
|
664
|
+
const select$3 = function ActionPlanStatusInfoOutputRepresentationSelect() {
|
|
665
|
+
return {
|
|
666
|
+
kind: 'Fragment',
|
|
667
|
+
version: VERSION$1,
|
|
668
|
+
private: [],
|
|
669
|
+
opaque: true
|
|
670
|
+
};
|
|
671
|
+
};
|
|
672
|
+
function equals$1(existing, incoming) {
|
|
673
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
674
|
+
return false;
|
|
675
|
+
}
|
|
676
|
+
return true;
|
|
677
|
+
}
|
|
678
|
+
function deepFreeze$3(input) {
|
|
679
|
+
const input_mandatoryItemsPending = input.mandatoryItemsPending;
|
|
680
|
+
if (input_mandatoryItemsPending !== undefined) {
|
|
681
|
+
deepFreeze$4(input_mandatoryItemsPending);
|
|
682
|
+
}
|
|
683
|
+
ObjectFreeze(input);
|
|
684
|
+
}
|
|
685
|
+
const ingest$1 = function ActionPlanStatusInfoOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
686
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
687
|
+
const validateError = validate$3(input);
|
|
688
|
+
if (validateError !== null) {
|
|
689
|
+
throw validateError;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
const key = path.fullPath;
|
|
693
|
+
const existingRecord = store.readEntry(key);
|
|
694
|
+
const ttlToUse = TTL$1;
|
|
695
|
+
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
696
|
+
fullPath: key,
|
|
697
|
+
parent: path.parent,
|
|
698
|
+
propertyName: path.propertyName,
|
|
699
|
+
ttl: ttlToUse
|
|
700
|
+
});
|
|
701
|
+
deepFreeze$3(input);
|
|
702
|
+
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
703
|
+
luvio.storePublish(key, incomingRecord);
|
|
704
|
+
}
|
|
705
|
+
{
|
|
706
|
+
const storeMetadataParams = {
|
|
707
|
+
ttl: ttlToUse,
|
|
708
|
+
namespace: "ActionPlan",
|
|
709
|
+
version: VERSION$1,
|
|
710
|
+
representationName: RepresentationType$1,
|
|
711
|
+
};
|
|
712
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
713
|
+
}
|
|
714
|
+
return createLink(key);
|
|
715
|
+
};
|
|
716
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
717
|
+
const rootKeySet = new StoreKeyMap();
|
|
718
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
719
|
+
const rootKey = fullPathFactory();
|
|
720
|
+
rootKeySet.set(rootKey, {
|
|
721
|
+
namespace: keyPrefix,
|
|
722
|
+
representationName: RepresentationType$1,
|
|
723
|
+
mergeable: false
|
|
724
|
+
});
|
|
725
|
+
return rootKeySet;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
function select$2(luvio, params) {
|
|
729
|
+
return select$3();
|
|
730
|
+
}
|
|
731
|
+
function keyBuilder$3(luvio, params) {
|
|
732
|
+
return keyPrefix + '::ActionPlanStatusInfoOutputRepresentation:(' + 'actionPlanId:' + params.urlParams.actionPlanId + ')';
|
|
733
|
+
}
|
|
734
|
+
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
735
|
+
return getTypeCacheKeys$1(luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
736
|
+
}
|
|
737
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
738
|
+
const { body } = response;
|
|
739
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
740
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
741
|
+
const snapshot = luvio.storeLookup({
|
|
742
|
+
recordId: key,
|
|
743
|
+
node: select$2(),
|
|
744
|
+
variables: {},
|
|
745
|
+
}, snapshotRefresh);
|
|
746
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
747
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
748
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
return snapshot;
|
|
752
|
+
}
|
|
753
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
754
|
+
const key = keyBuilder$3(luvio, params);
|
|
755
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
756
|
+
const storeMetadataParams = {
|
|
757
|
+
ttl: TTL$1,
|
|
758
|
+
namespace: keyPrefix,
|
|
759
|
+
version: VERSION$1,
|
|
760
|
+
representationName: RepresentationType$1
|
|
761
|
+
};
|
|
762
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
763
|
+
return errorSnapshot;
|
|
764
|
+
}
|
|
765
|
+
function createResourceRequest$1(config) {
|
|
766
|
+
const headers = {};
|
|
767
|
+
return {
|
|
768
|
+
baseUri: '/services/data/v58.0',
|
|
769
|
+
basePath: '/connect/action-plan/' + config.urlParams.actionPlanId + '/status-info',
|
|
770
|
+
method: 'get',
|
|
771
|
+
body: null,
|
|
772
|
+
urlParams: config.urlParams,
|
|
773
|
+
queryParams: {},
|
|
774
|
+
headers,
|
|
775
|
+
priority: 'normal',
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
const getActionPlanStatusInfo_ConfigPropertyNames = {
|
|
780
|
+
displayName: 'getActionPlanStatusInfo',
|
|
781
|
+
parameters: {
|
|
782
|
+
required: ['actionPlanId'],
|
|
783
|
+
optional: []
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
function createResourceParams$1(config) {
|
|
787
|
+
const resourceParams = {
|
|
788
|
+
urlParams: {
|
|
789
|
+
actionPlanId: config.actionPlanId
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
return resourceParams;
|
|
793
|
+
}
|
|
794
|
+
function keyBuilder$2(luvio, config) {
|
|
795
|
+
const resourceParams = createResourceParams$1(config);
|
|
796
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
797
|
+
}
|
|
798
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
799
|
+
const config = {};
|
|
800
|
+
const untrustedConfig_actionPlanId = untrustedConfig.actionPlanId;
|
|
801
|
+
if (typeof untrustedConfig_actionPlanId === 'string') {
|
|
802
|
+
config.actionPlanId = untrustedConfig_actionPlanId;
|
|
803
|
+
}
|
|
804
|
+
return config;
|
|
805
|
+
}
|
|
806
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
807
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
808
|
+
return null;
|
|
809
|
+
}
|
|
810
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
811
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
812
|
+
}
|
|
813
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
814
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
815
|
+
return null;
|
|
816
|
+
}
|
|
817
|
+
return config;
|
|
818
|
+
}
|
|
819
|
+
function adapterFragment$1(luvio, config) {
|
|
820
|
+
createResourceParams$1(config);
|
|
821
|
+
return select$2();
|
|
822
|
+
}
|
|
823
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
824
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
825
|
+
config,
|
|
826
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
827
|
+
});
|
|
828
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
829
|
+
}
|
|
830
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
831
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
832
|
+
config,
|
|
833
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
834
|
+
});
|
|
835
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
836
|
+
}
|
|
837
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
838
|
+
const resourceParams = createResourceParams$1(config);
|
|
839
|
+
const request = createResourceRequest$1(resourceParams);
|
|
840
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
841
|
+
.then((response) => {
|
|
842
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
|
|
843
|
+
}, (response) => {
|
|
844
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
848
|
+
const { luvio, config } = context;
|
|
849
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
850
|
+
const dispatchOptions = {
|
|
851
|
+
resourceRequestContext: {
|
|
852
|
+
requestCorrelator,
|
|
853
|
+
luvioRequestMethod: undefined,
|
|
854
|
+
},
|
|
855
|
+
eventObservers
|
|
856
|
+
};
|
|
857
|
+
if (networkPriority !== 'normal') {
|
|
858
|
+
dispatchOptions.overrides = {
|
|
859
|
+
priority: networkPriority
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
|
|
863
|
+
}
|
|
864
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
865
|
+
const { luvio, config } = context;
|
|
866
|
+
const selector = {
|
|
867
|
+
recordId: keyBuilder$2(luvio, config),
|
|
868
|
+
node: adapterFragment$1(luvio, config),
|
|
869
|
+
variables: {},
|
|
870
|
+
};
|
|
871
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
872
|
+
config,
|
|
873
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
874
|
+
});
|
|
875
|
+
return cacheSnapshot;
|
|
876
|
+
}
|
|
877
|
+
const getActionPlanStatusInfoAdapterFactory = (luvio) => function ActionPlan__getActionPlanStatusInfo(untrustedConfig, requestContext) {
|
|
878
|
+
const config = validateAdapterConfig$1(untrustedConfig, getActionPlanStatusInfo_ConfigPropertyNames);
|
|
879
|
+
// Invalid or incomplete config
|
|
880
|
+
if (config === null) {
|
|
881
|
+
return null;
|
|
882
|
+
}
|
|
883
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
884
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
function validate$2(obj, path = 'ActionPlanRepresentation') {
|
|
888
|
+
const v_error = (() => {
|
|
889
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
890
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
891
|
+
}
|
|
892
|
+
const obj_id = obj.id;
|
|
893
|
+
const path_id = path + '.id';
|
|
894
|
+
if (typeof obj_id !== 'string') {
|
|
895
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
896
|
+
}
|
|
897
|
+
if (obj.itemCount !== undefined) {
|
|
898
|
+
const obj_itemCount = obj.itemCount;
|
|
899
|
+
const path_itemCount = path + '.itemCount';
|
|
900
|
+
if (typeof obj_itemCount !== 'number' || (typeof obj_itemCount === 'number' && Math.floor(obj_itemCount) !== obj_itemCount)) {
|
|
901
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_itemCount + '" (at "' + path_itemCount + '")');
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
const obj_name = obj.name;
|
|
905
|
+
const path_name = path + '.name';
|
|
906
|
+
if (typeof obj_name !== 'string') {
|
|
907
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
908
|
+
}
|
|
909
|
+
if (obj.statusCode !== undefined) {
|
|
910
|
+
const obj_statusCode = obj.statusCode;
|
|
911
|
+
const path_statusCode = path + '.statusCode';
|
|
912
|
+
if (typeof obj_statusCode !== 'string') {
|
|
913
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
})();
|
|
917
|
+
return v_error === undefined ? null : v_error;
|
|
918
|
+
}
|
|
919
|
+
function deepFreeze$2(input) {
|
|
920
|
+
ObjectFreeze(input);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
function validate$1(obj, path = 'ActionPlanListRepresentation') {
|
|
924
|
+
const v_error = (() => {
|
|
925
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
926
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
927
|
+
}
|
|
928
|
+
const obj_records = obj.records;
|
|
929
|
+
const path_records = path + '.records';
|
|
930
|
+
if (!ArrayIsArray(obj_records)) {
|
|
931
|
+
return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
|
|
932
|
+
}
|
|
933
|
+
for (let i = 0; i < obj_records.length; i++) {
|
|
934
|
+
const obj_records_item = obj_records[i];
|
|
935
|
+
const path_records_item = path_records + '[' + i + ']';
|
|
936
|
+
const referencepath_records_itemValidationError = validate$2(obj_records_item, path_records_item);
|
|
937
|
+
if (referencepath_records_itemValidationError !== null) {
|
|
938
|
+
let message = 'Object doesn\'t match ActionPlanRepresentation (at "' + path_records_item + '")\n';
|
|
939
|
+
message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
940
|
+
return new TypeError(message);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
})();
|
|
944
|
+
return v_error === undefined ? null : v_error;
|
|
945
|
+
}
|
|
946
|
+
function deepFreeze$1(input) {
|
|
947
|
+
const input_records = input.records;
|
|
948
|
+
for (let i = 0; i < input_records.length; i++) {
|
|
949
|
+
const input_records_item = input_records[i];
|
|
950
|
+
deepFreeze$2(input_records_item);
|
|
951
|
+
}
|
|
952
|
+
ObjectFreeze(input_records);
|
|
953
|
+
ObjectFreeze(input);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
const TTL = 1000;
|
|
957
|
+
const VERSION = "0ec040ec594b42ffdf6182e2b338e7ff";
|
|
958
|
+
function validate(obj, path = 'ActionPlansWrapperOutputRepresentation') {
|
|
959
|
+
const v_error = (() => {
|
|
960
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
961
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
962
|
+
}
|
|
963
|
+
const obj_actionPlan = obj.actionPlan;
|
|
964
|
+
const path_actionPlan = path + '.actionPlan';
|
|
965
|
+
const referencepath_actionPlanValidationError = validate$1(obj_actionPlan, path_actionPlan);
|
|
966
|
+
if (referencepath_actionPlanValidationError !== null) {
|
|
967
|
+
let message = 'Object doesn\'t match ActionPlanListRepresentation (at "' + path_actionPlan + '")\n';
|
|
968
|
+
message += referencepath_actionPlanValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
969
|
+
return new TypeError(message);
|
|
970
|
+
}
|
|
971
|
+
})();
|
|
972
|
+
return v_error === undefined ? null : v_error;
|
|
973
|
+
}
|
|
974
|
+
const RepresentationType = 'ActionPlansWrapperOutputRepresentation';
|
|
975
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
976
|
+
return input;
|
|
977
|
+
}
|
|
978
|
+
const select$1 = function ActionPlansWrapperOutputRepresentationSelect() {
|
|
979
|
+
return {
|
|
980
|
+
kind: 'Fragment',
|
|
981
|
+
version: VERSION,
|
|
982
|
+
private: [],
|
|
983
|
+
opaque: true
|
|
984
|
+
};
|
|
985
|
+
};
|
|
986
|
+
function equals(existing, incoming) {
|
|
987
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
988
|
+
return false;
|
|
989
|
+
}
|
|
990
|
+
return true;
|
|
991
|
+
}
|
|
992
|
+
function deepFreeze(input) {
|
|
993
|
+
const input_actionPlan = input.actionPlan;
|
|
994
|
+
deepFreeze$1(input_actionPlan);
|
|
995
|
+
ObjectFreeze(input);
|
|
996
|
+
}
|
|
997
|
+
const ingest = function ActionPlansWrapperOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
998
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
999
|
+
const validateError = validate(input);
|
|
1000
|
+
if (validateError !== null) {
|
|
1001
|
+
throw validateError;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
const key = path.fullPath;
|
|
1005
|
+
const existingRecord = store.readEntry(key);
|
|
1006
|
+
const ttlToUse = TTL;
|
|
1007
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
1008
|
+
fullPath: key,
|
|
1009
|
+
parent: path.parent,
|
|
1010
|
+
propertyName: path.propertyName,
|
|
1011
|
+
ttl: ttlToUse
|
|
1012
|
+
});
|
|
1013
|
+
deepFreeze(input);
|
|
1014
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
1015
|
+
luvio.storePublish(key, incomingRecord);
|
|
1016
|
+
}
|
|
1017
|
+
{
|
|
1018
|
+
const storeMetadataParams = {
|
|
1019
|
+
ttl: ttlToUse,
|
|
1020
|
+
namespace: "ActionPlan",
|
|
1021
|
+
version: VERSION,
|
|
1022
|
+
representationName: RepresentationType,
|
|
1023
|
+
};
|
|
1024
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1025
|
+
}
|
|
1026
|
+
return createLink(key);
|
|
1027
|
+
};
|
|
1028
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
1029
|
+
const rootKeySet = new StoreKeyMap();
|
|
1030
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1031
|
+
const rootKey = fullPathFactory();
|
|
1032
|
+
rootKeySet.set(rootKey, {
|
|
1033
|
+
namespace: keyPrefix,
|
|
1034
|
+
representationName: RepresentationType,
|
|
1035
|
+
mergeable: false
|
|
1036
|
+
});
|
|
1037
|
+
return rootKeySet;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
function select(luvio, params) {
|
|
1041
|
+
return select$1();
|
|
1042
|
+
}
|
|
1043
|
+
function keyBuilder$1(luvio, params) {
|
|
1044
|
+
return keyPrefix + '::ActionPlansWrapperOutputRepresentation:(' + 'actionPlanType:' + params.queryParams.actionPlanType + ',' + 'limit:' + params.queryParams.limit + ',' + 'order:' + params.queryParams.order + ',' + 'orderingParam:' + params.queryParams.orderingParam + ',' + 'targetId:' + params.queryParams.targetId + ')';
|
|
1045
|
+
}
|
|
1046
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
1047
|
+
return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
1048
|
+
}
|
|
1049
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
1050
|
+
const { body } = response;
|
|
1051
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
1052
|
+
luvio.storeIngest(key, ingest, body);
|
|
1053
|
+
const snapshot = luvio.storeLookup({
|
|
1054
|
+
recordId: key,
|
|
1055
|
+
node: select(),
|
|
1056
|
+
variables: {},
|
|
1057
|
+
}, snapshotRefresh);
|
|
1058
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1059
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1060
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
return snapshot;
|
|
1064
|
+
}
|
|
1065
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1066
|
+
const key = keyBuilder$1(luvio, params);
|
|
1067
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1068
|
+
const storeMetadataParams = {
|
|
1069
|
+
ttl: TTL,
|
|
1070
|
+
namespace: keyPrefix,
|
|
1071
|
+
version: VERSION,
|
|
1072
|
+
representationName: RepresentationType
|
|
1073
|
+
};
|
|
1074
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1075
|
+
return errorSnapshot;
|
|
1076
|
+
}
|
|
1077
|
+
function createResourceRequest(config) {
|
|
1078
|
+
const headers = {};
|
|
1079
|
+
return {
|
|
1080
|
+
baseUri: '/services/data/v58.0',
|
|
1081
|
+
basePath: '/connect/action-plan',
|
|
1082
|
+
method: 'get',
|
|
1083
|
+
body: null,
|
|
1084
|
+
urlParams: {},
|
|
1085
|
+
queryParams: config.queryParams,
|
|
1086
|
+
headers,
|
|
1087
|
+
priority: 'normal',
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
const getActionPlans_ConfigPropertyNames = {
|
|
1092
|
+
displayName: 'getActionPlans',
|
|
1093
|
+
parameters: {
|
|
1094
|
+
required: [],
|
|
1095
|
+
optional: ['actionPlanType', 'limit', 'order', 'orderingParam', 'targetId']
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
function createResourceParams(config) {
|
|
1099
|
+
const resourceParams = {
|
|
1100
|
+
queryParams: {
|
|
1101
|
+
actionPlanType: config.actionPlanType, limit: config.limit, order: config.order, orderingParam: config.orderingParam, targetId: config.targetId
|
|
1102
|
+
}
|
|
1103
|
+
};
|
|
1104
|
+
return resourceParams;
|
|
1105
|
+
}
|
|
1106
|
+
function keyBuilder(luvio, config) {
|
|
1107
|
+
const resourceParams = createResourceParams(config);
|
|
1108
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
1109
|
+
}
|
|
1110
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1111
|
+
const config = {};
|
|
1112
|
+
const untrustedConfig_actionPlanType = untrustedConfig.actionPlanType;
|
|
1113
|
+
if (typeof untrustedConfig_actionPlanType === 'string') {
|
|
1114
|
+
config.actionPlanType = untrustedConfig_actionPlanType;
|
|
1115
|
+
}
|
|
1116
|
+
const untrustedConfig_limit = untrustedConfig.limit;
|
|
1117
|
+
if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
|
|
1118
|
+
config.limit = untrustedConfig_limit;
|
|
1119
|
+
}
|
|
1120
|
+
const untrustedConfig_order = untrustedConfig.order;
|
|
1121
|
+
if (typeof untrustedConfig_order === 'string') {
|
|
1122
|
+
config.order = untrustedConfig_order;
|
|
1123
|
+
}
|
|
1124
|
+
const untrustedConfig_orderingParam = untrustedConfig.orderingParam;
|
|
1125
|
+
if (typeof untrustedConfig_orderingParam === 'string') {
|
|
1126
|
+
config.orderingParam = untrustedConfig_orderingParam;
|
|
1127
|
+
}
|
|
1128
|
+
const untrustedConfig_targetId = untrustedConfig.targetId;
|
|
1129
|
+
if (typeof untrustedConfig_targetId === 'string') {
|
|
1130
|
+
config.targetId = untrustedConfig_targetId;
|
|
1131
|
+
}
|
|
1132
|
+
return config;
|
|
1133
|
+
}
|
|
1134
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1135
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1136
|
+
return null;
|
|
1137
|
+
}
|
|
1138
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1139
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1140
|
+
}
|
|
1141
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1142
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1143
|
+
return null;
|
|
1144
|
+
}
|
|
1145
|
+
return config;
|
|
1146
|
+
}
|
|
1147
|
+
function adapterFragment(luvio, config) {
|
|
1148
|
+
createResourceParams(config);
|
|
1149
|
+
return select();
|
|
1150
|
+
}
|
|
1151
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1152
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
1153
|
+
config,
|
|
1154
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1155
|
+
});
|
|
1156
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1157
|
+
}
|
|
1158
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1159
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1160
|
+
config,
|
|
1161
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1162
|
+
});
|
|
1163
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1164
|
+
}
|
|
1165
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1166
|
+
const resourceParams = createResourceParams(config);
|
|
1167
|
+
const request = createResourceRequest(resourceParams);
|
|
1168
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1169
|
+
.then((response) => {
|
|
1170
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
1171
|
+
}, (response) => {
|
|
1172
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1176
|
+
const { luvio, config } = context;
|
|
1177
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1178
|
+
const dispatchOptions = {
|
|
1179
|
+
resourceRequestContext: {
|
|
1180
|
+
requestCorrelator,
|
|
1181
|
+
luvioRequestMethod: undefined,
|
|
1182
|
+
},
|
|
1183
|
+
eventObservers
|
|
1184
|
+
};
|
|
1185
|
+
if (networkPriority !== 'normal') {
|
|
1186
|
+
dispatchOptions.overrides = {
|
|
1187
|
+
priority: networkPriority
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
return buildNetworkSnapshot(luvio, config, dispatchOptions);
|
|
1191
|
+
}
|
|
1192
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1193
|
+
const { luvio, config } = context;
|
|
1194
|
+
const selector = {
|
|
1195
|
+
recordId: keyBuilder(luvio, config),
|
|
1196
|
+
node: adapterFragment(luvio, config),
|
|
1197
|
+
variables: {},
|
|
1198
|
+
};
|
|
1199
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1200
|
+
config,
|
|
1201
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1202
|
+
});
|
|
1203
|
+
return cacheSnapshot;
|
|
1204
|
+
}
|
|
1205
|
+
const getActionPlansAdapterFactory = (luvio) => function ActionPlan__getActionPlans(untrustedConfig, requestContext) {
|
|
1206
|
+
const config = validateAdapterConfig(untrustedConfig, getActionPlans_ConfigPropertyNames);
|
|
1207
|
+
// Invalid or incomplete config
|
|
1208
|
+
if (config === null) {
|
|
1209
|
+
return null;
|
|
1210
|
+
}
|
|
1211
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1212
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
let getActionPlanItems;
|
|
1216
|
+
let getActionPlanStatusInfo;
|
|
1217
|
+
let getActionPlans;
|
|
1218
|
+
// Imperative GET Adapters
|
|
1219
|
+
let getActionPlanItems_imperative;
|
|
1220
|
+
let getActionPlanStatusInfo_imperative;
|
|
1221
|
+
let getActionPlans_imperative;
|
|
1222
|
+
// Adapter Metadata
|
|
1223
|
+
const getActionPlanItemsMetadata = { apiFamily: 'ActionPlan', name: 'getActionPlanItems', ttl: 1000 };
|
|
1224
|
+
const getActionPlanStatusInfoMetadata = { apiFamily: 'ActionPlan', name: 'getActionPlanStatusInfo', ttl: 1000 };
|
|
1225
|
+
const getActionPlansMetadata = { apiFamily: 'ActionPlan', name: 'getActionPlans', ttl: 1000 };
|
|
1226
|
+
function bindExportsTo(luvio) {
|
|
1227
|
+
// LDS Adapters
|
|
1228
|
+
const getActionPlanItems_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getActionPlanItems', getActionPlanItemsAdapterFactory), getActionPlanItemsMetadata);
|
|
1229
|
+
const getActionPlanStatusInfo_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getActionPlanStatusInfo', getActionPlanStatusInfoAdapterFactory), getActionPlanStatusInfoMetadata);
|
|
1230
|
+
const getActionPlans_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getActionPlans', getActionPlansAdapterFactory), getActionPlansMetadata);
|
|
1231
|
+
return {
|
|
1232
|
+
getActionPlanItems: createWireAdapterConstructor(luvio, getActionPlanItems_ldsAdapter, getActionPlanItemsMetadata),
|
|
1233
|
+
getActionPlanStatusInfo: createWireAdapterConstructor(luvio, getActionPlanStatusInfo_ldsAdapter, getActionPlanStatusInfoMetadata),
|
|
1234
|
+
getActionPlans: createWireAdapterConstructor(luvio, getActionPlans_ldsAdapter, getActionPlansMetadata),
|
|
1235
|
+
// Imperative GET Adapters
|
|
1236
|
+
getActionPlanItems_imperative: createImperativeAdapter(luvio, getActionPlanItems_ldsAdapter, getActionPlanItemsMetadata),
|
|
1237
|
+
getActionPlanStatusInfo_imperative: createImperativeAdapter(luvio, getActionPlanStatusInfo_ldsAdapter, getActionPlanStatusInfoMetadata),
|
|
1238
|
+
getActionPlans_imperative: createImperativeAdapter(luvio, getActionPlans_ldsAdapter, getActionPlansMetadata)
|
|
1239
|
+
};
|
|
1240
|
+
}
|
|
1241
|
+
withDefaultLuvio((luvio) => {
|
|
1242
|
+
({
|
|
1243
|
+
getActionPlanItems,
|
|
1244
|
+
getActionPlanStatusInfo,
|
|
1245
|
+
getActionPlans,
|
|
1246
|
+
getActionPlanItems_imperative,
|
|
1247
|
+
getActionPlanStatusInfo_imperative,
|
|
1248
|
+
getActionPlans_imperative
|
|
1249
|
+
} = bindExportsTo(luvio));
|
|
1250
|
+
});
|
|
1251
|
+
|
|
1252
|
+
export { getActionPlanItems, getActionPlanItems_imperative, getActionPlanStatusInfo, getActionPlanStatusInfo_imperative, getActionPlans, getActionPlans_imperative };
|
|
1253
|
+
// version: 1.100.2-ca56bb821
|