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