@salesforce/lds-adapters-industries-actionplan 0.1.0-dev1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/industries-actionplan.js +1933 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getActionPlanItems.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getActionPlanStatusInfo.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getActionPlanTemplateItemsLabel.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getActionPlans.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/adapters/updateActionPlanTasks.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/adapters/updateActionPlanTemplateTasks.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +6 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +11 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectActionPlan.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectActionPlanActionPlanItemsByActionPlanId.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectActionPlanStatusInfoByActionPlanId.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectActionPlanTemplateVersionByActionPlanTemplateVersionId.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/patchConnectActionPlanTemplateUpdateByActionPlanTemplateVersionId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/patchConnectActionPlanUpdateByActionPlanId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanItemCollectionRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanItemDetailedRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanItemListRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanItemRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanItemTaskRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanItemsWrapperRepresentation.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanListRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanStatusInfoOutputRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTaskFieldValueUpdateInputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTaskUpdateInputRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTemplateDCIItemsLabelOutputRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTemplateItemUpdateInputRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTemplateItemValueUpdateInputRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTemplateItemValuesLabelOutputRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTemplateItemsLabelOutputRepresentation.d.ts +49 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTemplateTaskItemsLabelOutputRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTemplateUpdateErrorOutputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTemplateUpdateInputRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanTemplateUpdateOutputRepresentation.d.ts +48 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanUpdateErrorOutputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanUpdateInputRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlanUpdateOutputRepresentation.d.ts +48 -0
- package/dist/es/es2018/types/src/generated/types/ActionPlansWrapperOutputRepresentation.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/ComputedFieldsWrapperRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/FieldRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/TaskProgressRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +75 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +2013 -0
- package/src/raml/api.raml +541 -0
- package/src/raml/luvio.raml +63 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,2013 @@
|
|
|
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, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$4, typeCheckConfig as typeCheckConfig$6, StoreKeyMap, createResourceParams as createResourceParams$6 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys$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
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
62
|
+
return {
|
|
63
|
+
name,
|
|
64
|
+
required,
|
|
65
|
+
resourceType,
|
|
66
|
+
typeCheckShape,
|
|
67
|
+
isArrayShape,
|
|
68
|
+
coerceFn,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
72
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
73
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
74
|
+
return {
|
|
75
|
+
displayName,
|
|
76
|
+
parameters: {
|
|
77
|
+
required,
|
|
78
|
+
optional,
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const keyPrefix = 'ActionPlan';
|
|
83
|
+
|
|
84
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
85
|
+
const { isArray: ArrayIsArray } = Array;
|
|
86
|
+
const { stringify: JSONStringify } = JSON;
|
|
87
|
+
function createLink(ref) {
|
|
88
|
+
return {
|
|
89
|
+
__ref: serializeStructuredKey(ref),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function validate$o(obj, path = 'ComputedFieldsWrapperRepresentation') {
|
|
94
|
+
const v_error = (() => {
|
|
95
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
96
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
97
|
+
}
|
|
98
|
+
const obj_fields = obj.fields;
|
|
99
|
+
const path_fields = path + '.fields';
|
|
100
|
+
if (typeof obj_fields !== 'object' || ArrayIsArray(obj_fields) || obj_fields === null) {
|
|
101
|
+
return new TypeError('Expected "object" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
102
|
+
}
|
|
103
|
+
const obj_fields_keys = ObjectKeys(obj_fields);
|
|
104
|
+
for (let i = 0; i < obj_fields_keys.length; i++) {
|
|
105
|
+
const key = obj_fields_keys[i];
|
|
106
|
+
const obj_fields_prop = obj_fields[key];
|
|
107
|
+
const path_fields_prop = path_fields + '["' + key + '"]';
|
|
108
|
+
if (obj_fields_prop === undefined) {
|
|
109
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_fields_prop + '" (at "' + path_fields_prop + '")');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
})();
|
|
113
|
+
return v_error === undefined ? null : v_error;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function validate$n(obj, path = 'FieldRepresentation') {
|
|
117
|
+
const v_error = (() => {
|
|
118
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
119
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
120
|
+
}
|
|
121
|
+
const obj_colType = obj.colType;
|
|
122
|
+
const path_colType = path + '.colType';
|
|
123
|
+
if (typeof obj_colType !== 'string') {
|
|
124
|
+
return new TypeError('Expected "string" but received "' + typeof obj_colType + '" (at "' + path_colType + '")');
|
|
125
|
+
}
|
|
126
|
+
const obj_fieldName = obj.fieldName;
|
|
127
|
+
const path_fieldName = path + '.fieldName';
|
|
128
|
+
if (typeof obj_fieldName !== 'string') {
|
|
129
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
|
|
130
|
+
}
|
|
131
|
+
const obj_label = obj.label;
|
|
132
|
+
const path_label = path + '.label';
|
|
133
|
+
if (typeof obj_label !== 'string') {
|
|
134
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
135
|
+
}
|
|
136
|
+
const obj_value = obj.value;
|
|
137
|
+
const path_value = path + '.value';
|
|
138
|
+
if (typeof obj_value !== 'string') {
|
|
139
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
140
|
+
}
|
|
141
|
+
})();
|
|
142
|
+
return v_error === undefined ? null : v_error;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function validate$m(obj, path = 'TaskProgressRepresentation') {
|
|
146
|
+
const v_error = (() => {
|
|
147
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
148
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
149
|
+
}
|
|
150
|
+
const obj_currentValue = obj.currentValue;
|
|
151
|
+
const path_currentValue = path + '.currentValue';
|
|
152
|
+
if (typeof obj_currentValue !== 'number' || (typeof obj_currentValue === 'number' && Math.floor(obj_currentValue) !== obj_currentValue)) {
|
|
153
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_currentValue + '" (at "' + path_currentValue + '")');
|
|
154
|
+
}
|
|
155
|
+
const obj_maxValue = obj.maxValue;
|
|
156
|
+
const path_maxValue = path + '.maxValue';
|
|
157
|
+
if (typeof obj_maxValue !== 'number' || (typeof obj_maxValue === 'number' && Math.floor(obj_maxValue) !== obj_maxValue)) {
|
|
158
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_maxValue + '" (at "' + path_maxValue + '")');
|
|
159
|
+
}
|
|
160
|
+
const obj_minValue = obj.minValue;
|
|
161
|
+
const path_minValue = path + '.minValue';
|
|
162
|
+
if (typeof obj_minValue !== 'number' || (typeof obj_minValue === 'number' && Math.floor(obj_minValue) !== obj_minValue)) {
|
|
163
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_minValue + '" (at "' + path_minValue + '")');
|
|
164
|
+
}
|
|
165
|
+
})();
|
|
166
|
+
return v_error === undefined ? null : v_error;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function validate$l(obj, path = 'ActionPlanItemTaskRepresentation') {
|
|
170
|
+
const v_error = (() => {
|
|
171
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
172
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
173
|
+
}
|
|
174
|
+
if (obj.computedFields !== undefined) {
|
|
175
|
+
const obj_computedFields = obj.computedFields;
|
|
176
|
+
const path_computedFields = path + '.computedFields';
|
|
177
|
+
const referencepath_computedFieldsValidationError = validate$o(obj_computedFields, path_computedFields);
|
|
178
|
+
if (referencepath_computedFieldsValidationError !== null) {
|
|
179
|
+
let message = 'Object doesn\'t match ComputedFieldsWrapperRepresentation (at "' + path_computedFields + '")\n';
|
|
180
|
+
message += referencepath_computedFieldsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
181
|
+
return new TypeError(message);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (obj.fields !== undefined) {
|
|
185
|
+
const obj_fields = obj.fields;
|
|
186
|
+
const path_fields = path + '.fields';
|
|
187
|
+
if (!ArrayIsArray(obj_fields)) {
|
|
188
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
189
|
+
}
|
|
190
|
+
for (let i = 0; i < obj_fields.length; i++) {
|
|
191
|
+
const obj_fields_item = obj_fields[i];
|
|
192
|
+
const path_fields_item = path_fields + '[' + i + ']';
|
|
193
|
+
const referencepath_fields_itemValidationError = validate$n(obj_fields_item, path_fields_item);
|
|
194
|
+
if (referencepath_fields_itemValidationError !== null) {
|
|
195
|
+
let message = 'Object doesn\'t match FieldRepresentation (at "' + path_fields_item + '")\n';
|
|
196
|
+
message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
197
|
+
return new TypeError(message);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const obj_id = obj.id;
|
|
202
|
+
const path_id = path + '.id';
|
|
203
|
+
if (typeof obj_id !== 'string') {
|
|
204
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
205
|
+
}
|
|
206
|
+
if (obj.progress !== undefined) {
|
|
207
|
+
const obj_progress = obj.progress;
|
|
208
|
+
const path_progress = path + '.progress';
|
|
209
|
+
const referencepath_progressValidationError = validate$m(obj_progress, path_progress);
|
|
210
|
+
if (referencepath_progressValidationError !== null) {
|
|
211
|
+
let message = 'Object doesn\'t match TaskProgressRepresentation (at "' + path_progress + '")\n';
|
|
212
|
+
message += referencepath_progressValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
213
|
+
return new TypeError(message);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
})();
|
|
217
|
+
return v_error === undefined ? null : v_error;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function validate$k(obj, path = 'ActionPlanItemDetailedRepresentation') {
|
|
221
|
+
const v_error = (() => {
|
|
222
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
223
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
224
|
+
}
|
|
225
|
+
if (obj.actionPlanItemTask !== undefined) {
|
|
226
|
+
const obj_actionPlanItemTask = obj.actionPlanItemTask;
|
|
227
|
+
const path_actionPlanItemTask = path + '.actionPlanItemTask';
|
|
228
|
+
const referencepath_actionPlanItemTaskValidationError = validate$l(obj_actionPlanItemTask, path_actionPlanItemTask);
|
|
229
|
+
if (referencepath_actionPlanItemTaskValidationError !== null) {
|
|
230
|
+
let message = 'Object doesn\'t match ActionPlanItemTaskRepresentation (at "' + path_actionPlanItemTask + '")\n';
|
|
231
|
+
message += referencepath_actionPlanItemTaskValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
232
|
+
return new TypeError(message);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const obj_id = obj.id;
|
|
236
|
+
const path_id = path + '.id';
|
|
237
|
+
if (typeof obj_id !== 'string') {
|
|
238
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
239
|
+
}
|
|
240
|
+
const obj_isRequired = obj.isRequired;
|
|
241
|
+
const path_isRequired = path + '.isRequired';
|
|
242
|
+
if (typeof obj_isRequired !== 'boolean') {
|
|
243
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isRequired + '" (at "' + path_isRequired + '")');
|
|
244
|
+
}
|
|
245
|
+
})();
|
|
246
|
+
return v_error === undefined ? null : v_error;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function validate$j(obj, path = 'ActionPlanItemCollectionRepresentation') {
|
|
250
|
+
const v_error = (() => {
|
|
251
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
252
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
253
|
+
}
|
|
254
|
+
const obj_records = obj.records;
|
|
255
|
+
const path_records = path + '.records';
|
|
256
|
+
if (!ArrayIsArray(obj_records)) {
|
|
257
|
+
return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
|
|
258
|
+
}
|
|
259
|
+
for (let i = 0; i < obj_records.length; i++) {
|
|
260
|
+
const obj_records_item = obj_records[i];
|
|
261
|
+
const path_records_item = path_records + '[' + i + ']';
|
|
262
|
+
const referencepath_records_itemValidationError = validate$k(obj_records_item, path_records_item);
|
|
263
|
+
if (referencepath_records_itemValidationError !== null) {
|
|
264
|
+
let message = 'Object doesn\'t match ActionPlanItemDetailedRepresentation (at "' + path_records_item + '")\n';
|
|
265
|
+
message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
266
|
+
return new TypeError(message);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
})();
|
|
270
|
+
return v_error === undefined ? null : v_error;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const TTL$5 = 1000;
|
|
274
|
+
const VERSION$5 = "01f1998519e78c50e1b67804b6fcb652";
|
|
275
|
+
function validate$i(obj, path = 'ActionPlanItemsWrapperRepresentation') {
|
|
276
|
+
const v_error = (() => {
|
|
277
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
278
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
279
|
+
}
|
|
280
|
+
const obj_actionPlanItems = obj.actionPlanItems;
|
|
281
|
+
const path_actionPlanItems = path + '.actionPlanItems';
|
|
282
|
+
const referencepath_actionPlanItemsValidationError = validate$j(obj_actionPlanItems, path_actionPlanItems);
|
|
283
|
+
if (referencepath_actionPlanItemsValidationError !== null) {
|
|
284
|
+
let message = 'Object doesn\'t match ActionPlanItemCollectionRepresentation (at "' + path_actionPlanItems + '")\n';
|
|
285
|
+
message += referencepath_actionPlanItemsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
286
|
+
return new TypeError(message);
|
|
287
|
+
}
|
|
288
|
+
})();
|
|
289
|
+
return v_error === undefined ? null : v_error;
|
|
290
|
+
}
|
|
291
|
+
const RepresentationType$5 = 'ActionPlanItemsWrapperRepresentation';
|
|
292
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
293
|
+
return input;
|
|
294
|
+
}
|
|
295
|
+
const select$b = function ActionPlanItemsWrapperRepresentationSelect() {
|
|
296
|
+
return {
|
|
297
|
+
kind: 'Fragment',
|
|
298
|
+
version: VERSION$5,
|
|
299
|
+
private: [],
|
|
300
|
+
opaque: true
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
function equals$5(existing, incoming) {
|
|
304
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
const ingest$5 = function ActionPlanItemsWrapperRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
310
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
311
|
+
const validateError = validate$i(input);
|
|
312
|
+
if (validateError !== null) {
|
|
313
|
+
throw validateError;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
const key = path.fullPath;
|
|
317
|
+
const ttlToUse = TTL$5;
|
|
318
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "ActionPlan", VERSION$5, RepresentationType$5, equals$5);
|
|
319
|
+
return createLink(key);
|
|
320
|
+
};
|
|
321
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
322
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
323
|
+
const rootKey = fullPathFactory();
|
|
324
|
+
rootKeySet.set(rootKey, {
|
|
325
|
+
namespace: keyPrefix,
|
|
326
|
+
representationName: RepresentationType$5,
|
|
327
|
+
mergeable: false
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function select$a(luvio, params) {
|
|
332
|
+
return select$b();
|
|
333
|
+
}
|
|
334
|
+
function keyBuilder$9(luvio, params) {
|
|
335
|
+
return keyPrefix + '::ActionPlanItemsWrapperRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'actionPlanId:' + params.urlParams.actionPlanId + ')';
|
|
336
|
+
}
|
|
337
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
338
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response, () => keyBuilder$9(luvio, resourceParams));
|
|
339
|
+
}
|
|
340
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
341
|
+
const { body } = response;
|
|
342
|
+
const key = keyBuilder$9(luvio, resourceParams);
|
|
343
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
344
|
+
const snapshot = luvio.storeLookup({
|
|
345
|
+
recordId: key,
|
|
346
|
+
node: select$a(),
|
|
347
|
+
variables: {},
|
|
348
|
+
}, snapshotRefresh);
|
|
349
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
350
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
351
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
deepFreeze(snapshot.data);
|
|
355
|
+
return snapshot;
|
|
356
|
+
}
|
|
357
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
358
|
+
const key = keyBuilder$9(luvio, params);
|
|
359
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
360
|
+
const storeMetadataParams = {
|
|
361
|
+
ttl: TTL$5,
|
|
362
|
+
namespace: keyPrefix,
|
|
363
|
+
version: VERSION$5,
|
|
364
|
+
representationName: RepresentationType$5
|
|
365
|
+
};
|
|
366
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
367
|
+
return errorSnapshot;
|
|
368
|
+
}
|
|
369
|
+
function createResourceRequest$5(config) {
|
|
370
|
+
const headers = {};
|
|
371
|
+
return {
|
|
372
|
+
baseUri: '/services/data/v66.0',
|
|
373
|
+
basePath: '/connect/action-plan/' + config.urlParams.actionPlanId + '/action-plan-items',
|
|
374
|
+
method: 'get',
|
|
375
|
+
body: null,
|
|
376
|
+
urlParams: config.urlParams,
|
|
377
|
+
queryParams: config.queryParams,
|
|
378
|
+
headers,
|
|
379
|
+
priority: 'normal',
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const adapterName$5 = 'getActionPlanItems';
|
|
384
|
+
const getActionPlanItems_ConfigPropertyMetadata = [
|
|
385
|
+
generateParamConfigMetadata('actionPlanId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
386
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
387
|
+
];
|
|
388
|
+
const getActionPlanItems_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getActionPlanItems_ConfigPropertyMetadata);
|
|
389
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$6(getActionPlanItems_ConfigPropertyMetadata);
|
|
390
|
+
function keyBuilder$8(luvio, config) {
|
|
391
|
+
const resourceParams = createResourceParams$5(config);
|
|
392
|
+
return keyBuilder$9(luvio, resourceParams);
|
|
393
|
+
}
|
|
394
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
395
|
+
const config = {};
|
|
396
|
+
typeCheckConfig$6(untrustedConfig, config, getActionPlanItems_ConfigPropertyMetadata);
|
|
397
|
+
return config;
|
|
398
|
+
}
|
|
399
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
400
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
404
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
405
|
+
}
|
|
406
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
407
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
return config;
|
|
411
|
+
}
|
|
412
|
+
function adapterFragment$3(luvio, config) {
|
|
413
|
+
createResourceParams$5(config);
|
|
414
|
+
return select$a();
|
|
415
|
+
}
|
|
416
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
417
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
418
|
+
config,
|
|
419
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
420
|
+
});
|
|
421
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
422
|
+
}
|
|
423
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
424
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
425
|
+
config,
|
|
426
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
427
|
+
});
|
|
428
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
429
|
+
}
|
|
430
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
431
|
+
const resourceParams = createResourceParams$5(config);
|
|
432
|
+
const request = createResourceRequest$5(resourceParams);
|
|
433
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
434
|
+
.then((response) => {
|
|
435
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
436
|
+
const cache = new StoreKeyMap();
|
|
437
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
438
|
+
return cache;
|
|
439
|
+
});
|
|
440
|
+
}, (response) => {
|
|
441
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
445
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
446
|
+
}
|
|
447
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
448
|
+
const { luvio, config } = context;
|
|
449
|
+
const selector = {
|
|
450
|
+
recordId: keyBuilder$8(luvio, config),
|
|
451
|
+
node: adapterFragment$3(luvio, config),
|
|
452
|
+
variables: {},
|
|
453
|
+
};
|
|
454
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
455
|
+
config,
|
|
456
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
457
|
+
});
|
|
458
|
+
return cacheSnapshot;
|
|
459
|
+
}
|
|
460
|
+
const getActionPlanItemsAdapterFactory = (luvio) => function ActionPlan__getActionPlanItems(untrustedConfig, requestContext) {
|
|
461
|
+
const config = validateAdapterConfig$5(untrustedConfig, getActionPlanItems_ConfigPropertyNames);
|
|
462
|
+
// Invalid or incomplete config
|
|
463
|
+
if (config === null) {
|
|
464
|
+
return null;
|
|
465
|
+
}
|
|
466
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
467
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
function validate$h(obj, path = 'ActionPlanItemRepresentation') {
|
|
471
|
+
const v_error = (() => {
|
|
472
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
473
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
474
|
+
}
|
|
475
|
+
const obj_id = obj.id;
|
|
476
|
+
const path_id = path + '.id';
|
|
477
|
+
if (typeof obj_id !== 'string') {
|
|
478
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
479
|
+
}
|
|
480
|
+
})();
|
|
481
|
+
return v_error === undefined ? null : v_error;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function validate$g(obj, path = 'ActionPlanItemListRepresentation') {
|
|
485
|
+
const v_error = (() => {
|
|
486
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
487
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
488
|
+
}
|
|
489
|
+
const obj_records = obj.records;
|
|
490
|
+
const path_records = path + '.records';
|
|
491
|
+
if (!ArrayIsArray(obj_records)) {
|
|
492
|
+
return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
|
|
493
|
+
}
|
|
494
|
+
for (let i = 0; i < obj_records.length; i++) {
|
|
495
|
+
const obj_records_item = obj_records[i];
|
|
496
|
+
const path_records_item = path_records + '[' + i + ']';
|
|
497
|
+
const referencepath_records_itemValidationError = validate$h(obj_records_item, path_records_item);
|
|
498
|
+
if (referencepath_records_itemValidationError !== null) {
|
|
499
|
+
let message = 'Object doesn\'t match ActionPlanItemRepresentation (at "' + path_records_item + '")\n';
|
|
500
|
+
message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
501
|
+
return new TypeError(message);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
})();
|
|
505
|
+
return v_error === undefined ? null : v_error;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
const TTL$4 = 1000;
|
|
509
|
+
const VERSION$4 = "8d866f38a882381bbdafb2496aa6f6b8";
|
|
510
|
+
function validate$f(obj, path = 'ActionPlanStatusInfoOutputRepresentation') {
|
|
511
|
+
const v_error = (() => {
|
|
512
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
513
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
514
|
+
}
|
|
515
|
+
const obj_mandatoryItemsCompleted = obj.mandatoryItemsCompleted;
|
|
516
|
+
const path_mandatoryItemsCompleted = path + '.mandatoryItemsCompleted';
|
|
517
|
+
if (typeof obj_mandatoryItemsCompleted !== 'boolean') {
|
|
518
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_mandatoryItemsCompleted + '" (at "' + path_mandatoryItemsCompleted + '")');
|
|
519
|
+
}
|
|
520
|
+
if (obj.mandatoryItemsPending !== undefined) {
|
|
521
|
+
const obj_mandatoryItemsPending = obj.mandatoryItemsPending;
|
|
522
|
+
const path_mandatoryItemsPending = path + '.mandatoryItemsPending';
|
|
523
|
+
const referencepath_mandatoryItemsPendingValidationError = validate$g(obj_mandatoryItemsPending, path_mandatoryItemsPending);
|
|
524
|
+
if (referencepath_mandatoryItemsPendingValidationError !== null) {
|
|
525
|
+
let message = 'Object doesn\'t match ActionPlanItemListRepresentation (at "' + path_mandatoryItemsPending + '")\n';
|
|
526
|
+
message += referencepath_mandatoryItemsPendingValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
527
|
+
return new TypeError(message);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
const obj_optionalItemsCompleted = obj.optionalItemsCompleted;
|
|
531
|
+
const path_optionalItemsCompleted = path + '.optionalItemsCompleted';
|
|
532
|
+
if (typeof obj_optionalItemsCompleted !== 'boolean') {
|
|
533
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_optionalItemsCompleted + '" (at "' + path_optionalItemsCompleted + '")');
|
|
534
|
+
}
|
|
535
|
+
if (obj.statusCode !== undefined) {
|
|
536
|
+
const obj_statusCode = obj.statusCode;
|
|
537
|
+
const path_statusCode = path + '.statusCode';
|
|
538
|
+
if (typeof obj_statusCode !== 'string') {
|
|
539
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
})();
|
|
543
|
+
return v_error === undefined ? null : v_error;
|
|
544
|
+
}
|
|
545
|
+
const RepresentationType$4 = 'ActionPlanStatusInfoOutputRepresentation';
|
|
546
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
547
|
+
return input;
|
|
548
|
+
}
|
|
549
|
+
const select$9 = function ActionPlanStatusInfoOutputRepresentationSelect() {
|
|
550
|
+
return {
|
|
551
|
+
kind: 'Fragment',
|
|
552
|
+
version: VERSION$4,
|
|
553
|
+
private: [],
|
|
554
|
+
opaque: true
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
function equals$4(existing, incoming) {
|
|
558
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
559
|
+
return false;
|
|
560
|
+
}
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
const ingest$4 = function ActionPlanStatusInfoOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
564
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
565
|
+
const validateError = validate$f(input);
|
|
566
|
+
if (validateError !== null) {
|
|
567
|
+
throw validateError;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
const key = path.fullPath;
|
|
571
|
+
const ttlToUse = TTL$4;
|
|
572
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "ActionPlan", VERSION$4, RepresentationType$4, equals$4);
|
|
573
|
+
return createLink(key);
|
|
574
|
+
};
|
|
575
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
576
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
577
|
+
const rootKey = fullPathFactory();
|
|
578
|
+
rootKeySet.set(rootKey, {
|
|
579
|
+
namespace: keyPrefix,
|
|
580
|
+
representationName: RepresentationType$4,
|
|
581
|
+
mergeable: false
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
function select$8(luvio, params) {
|
|
586
|
+
return select$9();
|
|
587
|
+
}
|
|
588
|
+
function keyBuilder$7(luvio, params) {
|
|
589
|
+
return keyPrefix + '::ActionPlanStatusInfoOutputRepresentation:(' + 'actionPlanId:' + params.urlParams.actionPlanId + ')';
|
|
590
|
+
}
|
|
591
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
592
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$7(luvio, resourceParams));
|
|
593
|
+
}
|
|
594
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
595
|
+
const { body } = response;
|
|
596
|
+
const key = keyBuilder$7(luvio, resourceParams);
|
|
597
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
598
|
+
const snapshot = luvio.storeLookup({
|
|
599
|
+
recordId: key,
|
|
600
|
+
node: select$8(),
|
|
601
|
+
variables: {},
|
|
602
|
+
}, snapshotRefresh);
|
|
603
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
604
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
605
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
deepFreeze(snapshot.data);
|
|
609
|
+
return snapshot;
|
|
610
|
+
}
|
|
611
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
612
|
+
const key = keyBuilder$7(luvio, params);
|
|
613
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
614
|
+
const storeMetadataParams = {
|
|
615
|
+
ttl: TTL$4,
|
|
616
|
+
namespace: keyPrefix,
|
|
617
|
+
version: VERSION$4,
|
|
618
|
+
representationName: RepresentationType$4
|
|
619
|
+
};
|
|
620
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
621
|
+
return errorSnapshot;
|
|
622
|
+
}
|
|
623
|
+
function createResourceRequest$4(config) {
|
|
624
|
+
const headers = {};
|
|
625
|
+
return {
|
|
626
|
+
baseUri: '/services/data/v66.0',
|
|
627
|
+
basePath: '/connect/action-plan/' + config.urlParams.actionPlanId + '/status-info',
|
|
628
|
+
method: 'get',
|
|
629
|
+
body: null,
|
|
630
|
+
urlParams: config.urlParams,
|
|
631
|
+
queryParams: {},
|
|
632
|
+
headers,
|
|
633
|
+
priority: 'normal',
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
const adapterName$4 = 'getActionPlanStatusInfo';
|
|
638
|
+
const getActionPlanStatusInfo_ConfigPropertyMetadata = [
|
|
639
|
+
generateParamConfigMetadata('actionPlanId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
640
|
+
];
|
|
641
|
+
const getActionPlanStatusInfo_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getActionPlanStatusInfo_ConfigPropertyMetadata);
|
|
642
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$6(getActionPlanStatusInfo_ConfigPropertyMetadata);
|
|
643
|
+
function keyBuilder$6(luvio, config) {
|
|
644
|
+
const resourceParams = createResourceParams$4(config);
|
|
645
|
+
return keyBuilder$7(luvio, resourceParams);
|
|
646
|
+
}
|
|
647
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
648
|
+
const config = {};
|
|
649
|
+
typeCheckConfig$6(untrustedConfig, config, getActionPlanStatusInfo_ConfigPropertyMetadata);
|
|
650
|
+
return config;
|
|
651
|
+
}
|
|
652
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
653
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
654
|
+
return null;
|
|
655
|
+
}
|
|
656
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
657
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
658
|
+
}
|
|
659
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
660
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
661
|
+
return null;
|
|
662
|
+
}
|
|
663
|
+
return config;
|
|
664
|
+
}
|
|
665
|
+
function adapterFragment$2(luvio, config) {
|
|
666
|
+
createResourceParams$4(config);
|
|
667
|
+
return select$8();
|
|
668
|
+
}
|
|
669
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
670
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
671
|
+
config,
|
|
672
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
673
|
+
});
|
|
674
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
675
|
+
}
|
|
676
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
677
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
678
|
+
config,
|
|
679
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
680
|
+
});
|
|
681
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
682
|
+
}
|
|
683
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
684
|
+
const resourceParams = createResourceParams$4(config);
|
|
685
|
+
const request = createResourceRequest$4(resourceParams);
|
|
686
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
687
|
+
.then((response) => {
|
|
688
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
689
|
+
const cache = new StoreKeyMap();
|
|
690
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
691
|
+
return cache;
|
|
692
|
+
});
|
|
693
|
+
}, (response) => {
|
|
694
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
698
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
699
|
+
}
|
|
700
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
701
|
+
const { luvio, config } = context;
|
|
702
|
+
const selector = {
|
|
703
|
+
recordId: keyBuilder$6(luvio, config),
|
|
704
|
+
node: adapterFragment$2(luvio, config),
|
|
705
|
+
variables: {},
|
|
706
|
+
};
|
|
707
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
708
|
+
config,
|
|
709
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
710
|
+
});
|
|
711
|
+
return cacheSnapshot;
|
|
712
|
+
}
|
|
713
|
+
const getActionPlanStatusInfoAdapterFactory = (luvio) => function ActionPlan__getActionPlanStatusInfo(untrustedConfig, requestContext) {
|
|
714
|
+
const config = validateAdapterConfig$4(untrustedConfig, getActionPlanStatusInfo_ConfigPropertyNames);
|
|
715
|
+
// Invalid or incomplete config
|
|
716
|
+
if (config === null) {
|
|
717
|
+
return null;
|
|
718
|
+
}
|
|
719
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
720
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
function validate$e(obj, path = 'ActionPlanTemplateItemValuesLabelOutputRepresentation') {
|
|
724
|
+
const v_error = (() => {
|
|
725
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
726
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
727
|
+
}
|
|
728
|
+
const obj_itemEntityFieldName = obj.itemEntityFieldName;
|
|
729
|
+
const path_itemEntityFieldName = path + '.itemEntityFieldName';
|
|
730
|
+
if (typeof obj_itemEntityFieldName !== 'string') {
|
|
731
|
+
return new TypeError('Expected "string" but received "' + typeof obj_itemEntityFieldName + '" (at "' + path_itemEntityFieldName + '")');
|
|
732
|
+
}
|
|
733
|
+
const obj_label = obj.label;
|
|
734
|
+
const path_label = path + '.label';
|
|
735
|
+
if (typeof obj_label !== 'string') {
|
|
736
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
737
|
+
}
|
|
738
|
+
const obj_valueFormula = obj.valueFormula;
|
|
739
|
+
const path_valueFormula = path + '.valueFormula';
|
|
740
|
+
if (typeof obj_valueFormula !== 'string') {
|
|
741
|
+
return new TypeError('Expected "string" but received "' + typeof obj_valueFormula + '" (at "' + path_valueFormula + '")');
|
|
742
|
+
}
|
|
743
|
+
const obj_valueLiteral = obj.valueLiteral;
|
|
744
|
+
const path_valueLiteral = path + '.valueLiteral';
|
|
745
|
+
if (typeof obj_valueLiteral !== 'string') {
|
|
746
|
+
return new TypeError('Expected "string" but received "' + typeof obj_valueLiteral + '" (at "' + path_valueLiteral + '")');
|
|
747
|
+
}
|
|
748
|
+
})();
|
|
749
|
+
return v_error === undefined ? null : v_error;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
function validate$d(obj, path = 'ActionPlanTemplateDCIItemsLabelOutputRepresentation') {
|
|
753
|
+
const v_error = (() => {
|
|
754
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
755
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
756
|
+
}
|
|
757
|
+
const obj_isRequired = obj.isRequired;
|
|
758
|
+
const path_isRequired = path + '.isRequired';
|
|
759
|
+
if (typeof obj_isRequired !== 'boolean') {
|
|
760
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isRequired + '" (at "' + path_isRequired + '")');
|
|
761
|
+
}
|
|
762
|
+
const obj_itemValues = obj.itemValues;
|
|
763
|
+
const path_itemValues = path + '.itemValues';
|
|
764
|
+
if (!ArrayIsArray(obj_itemValues)) {
|
|
765
|
+
return new TypeError('Expected "array" but received "' + typeof obj_itemValues + '" (at "' + path_itemValues + '")');
|
|
766
|
+
}
|
|
767
|
+
for (let i = 0; i < obj_itemValues.length; i++) {
|
|
768
|
+
const obj_itemValues_item = obj_itemValues[i];
|
|
769
|
+
const path_itemValues_item = path_itemValues + '[' + i + ']';
|
|
770
|
+
const referencepath_itemValues_itemValidationError = validate$e(obj_itemValues_item, path_itemValues_item);
|
|
771
|
+
if (referencepath_itemValues_itemValidationError !== null) {
|
|
772
|
+
let message = 'Object doesn\'t match ActionPlanTemplateItemValuesLabelOutputRepresentation (at "' + path_itemValues_item + '")\n';
|
|
773
|
+
message += referencepath_itemValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
774
|
+
return new TypeError(message);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
})();
|
|
778
|
+
return v_error === undefined ? null : v_error;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
function validate$c(obj, path = 'ActionPlanTemplateTaskItemsLabelOutputRepresentation') {
|
|
782
|
+
const v_error = (() => {
|
|
783
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
784
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
785
|
+
}
|
|
786
|
+
const obj_assignedToUserName = obj.assignedToUserName;
|
|
787
|
+
const path_assignedToUserName = path + '.assignedToUserName';
|
|
788
|
+
if (typeof obj_assignedToUserName !== 'string') {
|
|
789
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assignedToUserName + '" (at "' + path_assignedToUserName + '")');
|
|
790
|
+
}
|
|
791
|
+
const obj_isRequired = obj.isRequired;
|
|
792
|
+
const path_isRequired = path + '.isRequired';
|
|
793
|
+
if (typeof obj_isRequired !== 'boolean') {
|
|
794
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isRequired + '" (at "' + path_isRequired + '")');
|
|
795
|
+
}
|
|
796
|
+
const obj_itemValues = obj.itemValues;
|
|
797
|
+
const path_itemValues = path + '.itemValues';
|
|
798
|
+
if (!ArrayIsArray(obj_itemValues)) {
|
|
799
|
+
return new TypeError('Expected "array" but received "' + typeof obj_itemValues + '" (at "' + path_itemValues + '")');
|
|
800
|
+
}
|
|
801
|
+
for (let i = 0; i < obj_itemValues.length; i++) {
|
|
802
|
+
const obj_itemValues_item = obj_itemValues[i];
|
|
803
|
+
const path_itemValues_item = path_itemValues + '[' + i + ']';
|
|
804
|
+
const referencepath_itemValues_itemValidationError = validate$e(obj_itemValues_item, path_itemValues_item);
|
|
805
|
+
if (referencepath_itemValues_itemValidationError !== null) {
|
|
806
|
+
let message = 'Object doesn\'t match ActionPlanTemplateItemValuesLabelOutputRepresentation (at "' + path_itemValues_item + '")\n';
|
|
807
|
+
message += referencepath_itemValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
808
|
+
return new TypeError(message);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
const obj_prerequisiteTasks = obj.prerequisiteTasks;
|
|
812
|
+
const path_prerequisiteTasks = path + '.prerequisiteTasks';
|
|
813
|
+
if (!ArrayIsArray(obj_prerequisiteTasks)) {
|
|
814
|
+
return new TypeError('Expected "array" but received "' + typeof obj_prerequisiteTasks + '" (at "' + path_prerequisiteTasks + '")');
|
|
815
|
+
}
|
|
816
|
+
for (let i = 0; i < obj_prerequisiteTasks.length; i++) {
|
|
817
|
+
const obj_prerequisiteTasks_item = obj_prerequisiteTasks[i];
|
|
818
|
+
const path_prerequisiteTasks_item = path_prerequisiteTasks + '[' + i + ']';
|
|
819
|
+
if (typeof obj_prerequisiteTasks_item !== 'string') {
|
|
820
|
+
return new TypeError('Expected "string" but received "' + typeof obj_prerequisiteTasks_item + '" (at "' + path_prerequisiteTasks_item + '")');
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
})();
|
|
824
|
+
return v_error === undefined ? null : v_error;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
const TTL$3 = 1000;
|
|
828
|
+
const VERSION$3 = "27f870344e4c00862a006458ee9bab53";
|
|
829
|
+
function validate$b(obj, path = 'ActionPlanTemplateItemsLabelOutputRepresentation') {
|
|
830
|
+
const v_error = (() => {
|
|
831
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
832
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
833
|
+
}
|
|
834
|
+
const obj_actionPlanTemplateName = obj.actionPlanTemplateName;
|
|
835
|
+
const path_actionPlanTemplateName = path + '.actionPlanTemplateName';
|
|
836
|
+
if (typeof obj_actionPlanTemplateName !== 'string') {
|
|
837
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionPlanTemplateName + '" (at "' + path_actionPlanTemplateName + '")');
|
|
838
|
+
}
|
|
839
|
+
const obj_actionPlanType = obj.actionPlanType;
|
|
840
|
+
const path_actionPlanType = path + '.actionPlanType';
|
|
841
|
+
if (typeof obj_actionPlanType !== 'string') {
|
|
842
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionPlanType + '" (at "' + path_actionPlanType + '")');
|
|
843
|
+
}
|
|
844
|
+
const obj_createdByUserName = obj.createdByUserName;
|
|
845
|
+
const path_createdByUserName = path + '.createdByUserName';
|
|
846
|
+
if (typeof obj_createdByUserName !== 'string') {
|
|
847
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdByUserName + '" (at "' + path_createdByUserName + '")');
|
|
848
|
+
}
|
|
849
|
+
const obj_dciItemList = obj.dciItemList;
|
|
850
|
+
const path_dciItemList = path + '.dciItemList';
|
|
851
|
+
if (!ArrayIsArray(obj_dciItemList)) {
|
|
852
|
+
return new TypeError('Expected "array" but received "' + typeof obj_dciItemList + '" (at "' + path_dciItemList + '")');
|
|
853
|
+
}
|
|
854
|
+
for (let i = 0; i < obj_dciItemList.length; i++) {
|
|
855
|
+
const obj_dciItemList_item = obj_dciItemList[i];
|
|
856
|
+
const path_dciItemList_item = path_dciItemList + '[' + i + ']';
|
|
857
|
+
const referencepath_dciItemList_itemValidationError = validate$d(obj_dciItemList_item, path_dciItemList_item);
|
|
858
|
+
if (referencepath_dciItemList_itemValidationError !== null) {
|
|
859
|
+
let message = 'Object doesn\'t match ActionPlanTemplateDCIItemsLabelOutputRepresentation (at "' + path_dciItemList_item + '")\n';
|
|
860
|
+
message += referencepath_dciItemList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
861
|
+
return new TypeError(message);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
const obj_isCreateAdhocItemsAllowed = obj.isCreateAdhocItemsAllowed;
|
|
865
|
+
const path_isCreateAdhocItemsAllowed = path + '.isCreateAdhocItemsAllowed';
|
|
866
|
+
if (typeof obj_isCreateAdhocItemsAllowed !== 'boolean') {
|
|
867
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isCreateAdhocItemsAllowed + '" (at "' + path_isCreateAdhocItemsAllowed + '")');
|
|
868
|
+
}
|
|
869
|
+
const obj_targetEntityType = obj.targetEntityType;
|
|
870
|
+
const path_targetEntityType = path + '.targetEntityType';
|
|
871
|
+
if (typeof obj_targetEntityType !== 'string') {
|
|
872
|
+
return new TypeError('Expected "string" but received "' + typeof obj_targetEntityType + '" (at "' + path_targetEntityType + '")');
|
|
873
|
+
}
|
|
874
|
+
const obj_taskItemList = obj.taskItemList;
|
|
875
|
+
const path_taskItemList = path + '.taskItemList';
|
|
876
|
+
if (!ArrayIsArray(obj_taskItemList)) {
|
|
877
|
+
return new TypeError('Expected "array" but received "' + typeof obj_taskItemList + '" (at "' + path_taskItemList + '")');
|
|
878
|
+
}
|
|
879
|
+
for (let i = 0; i < obj_taskItemList.length; i++) {
|
|
880
|
+
const obj_taskItemList_item = obj_taskItemList[i];
|
|
881
|
+
const path_taskItemList_item = path_taskItemList + '[' + i + ']';
|
|
882
|
+
const referencepath_taskItemList_itemValidationError = validate$c(obj_taskItemList_item, path_taskItemList_item);
|
|
883
|
+
if (referencepath_taskItemList_itemValidationError !== null) {
|
|
884
|
+
let message = 'Object doesn\'t match ActionPlanTemplateTaskItemsLabelOutputRepresentation (at "' + path_taskItemList_item + '")\n';
|
|
885
|
+
message += referencepath_taskItemList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
886
|
+
return new TypeError(message);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
})();
|
|
890
|
+
return v_error === undefined ? null : v_error;
|
|
891
|
+
}
|
|
892
|
+
const RepresentationType$3 = 'ActionPlanTemplateItemsLabelOutputRepresentation';
|
|
893
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
894
|
+
return input;
|
|
895
|
+
}
|
|
896
|
+
const select$7 = function ActionPlanTemplateItemsLabelOutputRepresentationSelect() {
|
|
897
|
+
return {
|
|
898
|
+
kind: 'Fragment',
|
|
899
|
+
version: VERSION$3,
|
|
900
|
+
private: [],
|
|
901
|
+
opaque: true
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
function equals$3(existing, incoming) {
|
|
905
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
906
|
+
return false;
|
|
907
|
+
}
|
|
908
|
+
return true;
|
|
909
|
+
}
|
|
910
|
+
const ingest$3 = function ActionPlanTemplateItemsLabelOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
911
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
912
|
+
const validateError = validate$b(input);
|
|
913
|
+
if (validateError !== null) {
|
|
914
|
+
throw validateError;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
const key = path.fullPath;
|
|
918
|
+
const ttlToUse = TTL$3;
|
|
919
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "ActionPlan", VERSION$3, RepresentationType$3, equals$3);
|
|
920
|
+
return createLink(key);
|
|
921
|
+
};
|
|
922
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
923
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
924
|
+
const rootKey = fullPathFactory();
|
|
925
|
+
rootKeySet.set(rootKey, {
|
|
926
|
+
namespace: keyPrefix,
|
|
927
|
+
representationName: RepresentationType$3,
|
|
928
|
+
mergeable: false
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
function select$6(luvio, params) {
|
|
933
|
+
return select$7();
|
|
934
|
+
}
|
|
935
|
+
function keyBuilder$5(luvio, params) {
|
|
936
|
+
return keyPrefix + '::ActionPlanTemplateItemsLabelOutputRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'actionPlanTemplateVersionId:' + params.urlParams.actionPlanTemplateVersionId + ')';
|
|
937
|
+
}
|
|
938
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
939
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
940
|
+
}
|
|
941
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
942
|
+
const { body } = response;
|
|
943
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
944
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
945
|
+
const snapshot = luvio.storeLookup({
|
|
946
|
+
recordId: key,
|
|
947
|
+
node: select$6(),
|
|
948
|
+
variables: {},
|
|
949
|
+
}, snapshotRefresh);
|
|
950
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
951
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
952
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
deepFreeze(snapshot.data);
|
|
956
|
+
return snapshot;
|
|
957
|
+
}
|
|
958
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
959
|
+
const key = keyBuilder$5(luvio, params);
|
|
960
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
961
|
+
const storeMetadataParams = {
|
|
962
|
+
ttl: TTL$3,
|
|
963
|
+
namespace: keyPrefix,
|
|
964
|
+
version: VERSION$3,
|
|
965
|
+
representationName: RepresentationType$3
|
|
966
|
+
};
|
|
967
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
968
|
+
return errorSnapshot;
|
|
969
|
+
}
|
|
970
|
+
function createResourceRequest$3(config) {
|
|
971
|
+
const headers = {};
|
|
972
|
+
return {
|
|
973
|
+
baseUri: '/services/data/v66.0',
|
|
974
|
+
basePath: '/connect/action-plan-template-version/' + config.urlParams.actionPlanTemplateVersionId + '',
|
|
975
|
+
method: 'get',
|
|
976
|
+
body: null,
|
|
977
|
+
urlParams: config.urlParams,
|
|
978
|
+
queryParams: config.queryParams,
|
|
979
|
+
headers,
|
|
980
|
+
priority: 'normal',
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
const adapterName$3 = 'getActionPlanTemplateItemsLabel';
|
|
985
|
+
const getActionPlanTemplateItemsLabel_ConfigPropertyMetadata = [
|
|
986
|
+
generateParamConfigMetadata('actionPlanTemplateVersionId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
987
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
988
|
+
];
|
|
989
|
+
const getActionPlanTemplateItemsLabel_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getActionPlanTemplateItemsLabel_ConfigPropertyMetadata);
|
|
990
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$6(getActionPlanTemplateItemsLabel_ConfigPropertyMetadata);
|
|
991
|
+
function keyBuilder$4(luvio, config) {
|
|
992
|
+
const resourceParams = createResourceParams$3(config);
|
|
993
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
994
|
+
}
|
|
995
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
996
|
+
const config = {};
|
|
997
|
+
typeCheckConfig$6(untrustedConfig, config, getActionPlanTemplateItemsLabel_ConfigPropertyMetadata);
|
|
998
|
+
return config;
|
|
999
|
+
}
|
|
1000
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1001
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1002
|
+
return null;
|
|
1003
|
+
}
|
|
1004
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1005
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1006
|
+
}
|
|
1007
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
1008
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1009
|
+
return null;
|
|
1010
|
+
}
|
|
1011
|
+
return config;
|
|
1012
|
+
}
|
|
1013
|
+
function adapterFragment$1(luvio, config) {
|
|
1014
|
+
createResourceParams$3(config);
|
|
1015
|
+
return select$6();
|
|
1016
|
+
}
|
|
1017
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1018
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
1019
|
+
config,
|
|
1020
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1021
|
+
});
|
|
1022
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1023
|
+
}
|
|
1024
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1025
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1026
|
+
config,
|
|
1027
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1028
|
+
});
|
|
1029
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1030
|
+
}
|
|
1031
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1032
|
+
const resourceParams = createResourceParams$3(config);
|
|
1033
|
+
const request = createResourceRequest$3(resourceParams);
|
|
1034
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1035
|
+
.then((response) => {
|
|
1036
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1037
|
+
const cache = new StoreKeyMap();
|
|
1038
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
1039
|
+
return cache;
|
|
1040
|
+
});
|
|
1041
|
+
}, (response) => {
|
|
1042
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1046
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
1047
|
+
}
|
|
1048
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1049
|
+
const { luvio, config } = context;
|
|
1050
|
+
const selector = {
|
|
1051
|
+
recordId: keyBuilder$4(luvio, config),
|
|
1052
|
+
node: adapterFragment$1(luvio, config),
|
|
1053
|
+
variables: {},
|
|
1054
|
+
};
|
|
1055
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1056
|
+
config,
|
|
1057
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1058
|
+
});
|
|
1059
|
+
return cacheSnapshot;
|
|
1060
|
+
}
|
|
1061
|
+
const getActionPlanTemplateItemsLabelAdapterFactory = (luvio) => function ActionPlan__getActionPlanTemplateItemsLabel(untrustedConfig, requestContext) {
|
|
1062
|
+
const config = validateAdapterConfig$3(untrustedConfig, getActionPlanTemplateItemsLabel_ConfigPropertyNames);
|
|
1063
|
+
// Invalid or incomplete config
|
|
1064
|
+
if (config === null) {
|
|
1065
|
+
return null;
|
|
1066
|
+
}
|
|
1067
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1068
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1069
|
+
};
|
|
1070
|
+
|
|
1071
|
+
function validate$a(obj, path = 'ActionPlanRepresentation') {
|
|
1072
|
+
const v_error = (() => {
|
|
1073
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1074
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1075
|
+
}
|
|
1076
|
+
const obj_id = obj.id;
|
|
1077
|
+
const path_id = path + '.id';
|
|
1078
|
+
if (typeof obj_id !== 'string') {
|
|
1079
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1080
|
+
}
|
|
1081
|
+
if (obj.itemCount !== undefined) {
|
|
1082
|
+
const obj_itemCount = obj.itemCount;
|
|
1083
|
+
const path_itemCount = path + '.itemCount';
|
|
1084
|
+
if (typeof obj_itemCount !== 'number' || (typeof obj_itemCount === 'number' && Math.floor(obj_itemCount) !== obj_itemCount)) {
|
|
1085
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_itemCount + '" (at "' + path_itemCount + '")');
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
const obj_name = obj.name;
|
|
1089
|
+
const path_name = path + '.name';
|
|
1090
|
+
if (typeof obj_name !== 'string') {
|
|
1091
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1092
|
+
}
|
|
1093
|
+
if (obj.statusCode !== undefined) {
|
|
1094
|
+
const obj_statusCode = obj.statusCode;
|
|
1095
|
+
const path_statusCode = path + '.statusCode';
|
|
1096
|
+
if (typeof obj_statusCode !== 'string') {
|
|
1097
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
})();
|
|
1101
|
+
return v_error === undefined ? null : v_error;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
function validate$9(obj, path = 'ActionPlanListRepresentation') {
|
|
1105
|
+
const v_error = (() => {
|
|
1106
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1107
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1108
|
+
}
|
|
1109
|
+
const obj_records = obj.records;
|
|
1110
|
+
const path_records = path + '.records';
|
|
1111
|
+
if (!ArrayIsArray(obj_records)) {
|
|
1112
|
+
return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
|
|
1113
|
+
}
|
|
1114
|
+
for (let i = 0; i < obj_records.length; i++) {
|
|
1115
|
+
const obj_records_item = obj_records[i];
|
|
1116
|
+
const path_records_item = path_records + '[' + i + ']';
|
|
1117
|
+
const referencepath_records_itemValidationError = validate$a(obj_records_item, path_records_item);
|
|
1118
|
+
if (referencepath_records_itemValidationError !== null) {
|
|
1119
|
+
let message = 'Object doesn\'t match ActionPlanRepresentation (at "' + path_records_item + '")\n';
|
|
1120
|
+
message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1121
|
+
return new TypeError(message);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
})();
|
|
1125
|
+
return v_error === undefined ? null : v_error;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
const TTL$2 = 1000;
|
|
1129
|
+
const VERSION$2 = "0ec040ec594b42ffdf6182e2b338e7ff";
|
|
1130
|
+
function validate$8(obj, path = 'ActionPlansWrapperOutputRepresentation') {
|
|
1131
|
+
const v_error = (() => {
|
|
1132
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1133
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1134
|
+
}
|
|
1135
|
+
const obj_actionPlan = obj.actionPlan;
|
|
1136
|
+
const path_actionPlan = path + '.actionPlan';
|
|
1137
|
+
const referencepath_actionPlanValidationError = validate$9(obj_actionPlan, path_actionPlan);
|
|
1138
|
+
if (referencepath_actionPlanValidationError !== null) {
|
|
1139
|
+
let message = 'Object doesn\'t match ActionPlanListRepresentation (at "' + path_actionPlan + '")\n';
|
|
1140
|
+
message += referencepath_actionPlanValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1141
|
+
return new TypeError(message);
|
|
1142
|
+
}
|
|
1143
|
+
})();
|
|
1144
|
+
return v_error === undefined ? null : v_error;
|
|
1145
|
+
}
|
|
1146
|
+
const RepresentationType$2 = 'ActionPlansWrapperOutputRepresentation';
|
|
1147
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1148
|
+
return input;
|
|
1149
|
+
}
|
|
1150
|
+
const select$5 = function ActionPlansWrapperOutputRepresentationSelect() {
|
|
1151
|
+
return {
|
|
1152
|
+
kind: 'Fragment',
|
|
1153
|
+
version: VERSION$2,
|
|
1154
|
+
private: [],
|
|
1155
|
+
opaque: true
|
|
1156
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
function equals$2(existing, incoming) {
|
|
1159
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1160
|
+
return false;
|
|
1161
|
+
}
|
|
1162
|
+
return true;
|
|
1163
|
+
}
|
|
1164
|
+
const ingest$2 = function ActionPlansWrapperOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1165
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1166
|
+
const validateError = validate$8(input);
|
|
1167
|
+
if (validateError !== null) {
|
|
1168
|
+
throw validateError;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
const key = path.fullPath;
|
|
1172
|
+
const ttlToUse = TTL$2;
|
|
1173
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "ActionPlan", VERSION$2, RepresentationType$2, equals$2);
|
|
1174
|
+
return createLink(key);
|
|
1175
|
+
};
|
|
1176
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1177
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1178
|
+
const rootKey = fullPathFactory();
|
|
1179
|
+
rootKeySet.set(rootKey, {
|
|
1180
|
+
namespace: keyPrefix,
|
|
1181
|
+
representationName: RepresentationType$2,
|
|
1182
|
+
mergeable: false
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
function select$4(luvio, params) {
|
|
1187
|
+
return select$5();
|
|
1188
|
+
}
|
|
1189
|
+
function keyBuilder$3(luvio, params) {
|
|
1190
|
+
return keyPrefix + '::ActionPlansWrapperOutputRepresentation:(' + 'actionPlanType:' + params.queryParams.actionPlanType + ',' + 'limit:' + params.queryParams.limit + ',' + 'order:' + params.queryParams.order + ',' + 'orderingParam:' + params.queryParams.orderingParam + ',' + 'targetId:' + params.queryParams.targetId + ')';
|
|
1191
|
+
}
|
|
1192
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
1193
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
1194
|
+
}
|
|
1195
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
1196
|
+
const { body } = response;
|
|
1197
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
1198
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1199
|
+
const snapshot = luvio.storeLookup({
|
|
1200
|
+
recordId: key,
|
|
1201
|
+
node: select$4(),
|
|
1202
|
+
variables: {},
|
|
1203
|
+
}, snapshotRefresh);
|
|
1204
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1205
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1206
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
deepFreeze(snapshot.data);
|
|
1210
|
+
return snapshot;
|
|
1211
|
+
}
|
|
1212
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1213
|
+
const key = keyBuilder$3(luvio, params);
|
|
1214
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1215
|
+
const storeMetadataParams = {
|
|
1216
|
+
ttl: TTL$2,
|
|
1217
|
+
namespace: keyPrefix,
|
|
1218
|
+
version: VERSION$2,
|
|
1219
|
+
representationName: RepresentationType$2
|
|
1220
|
+
};
|
|
1221
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1222
|
+
return errorSnapshot;
|
|
1223
|
+
}
|
|
1224
|
+
function createResourceRequest$2(config) {
|
|
1225
|
+
const headers = {};
|
|
1226
|
+
return {
|
|
1227
|
+
baseUri: '/services/data/v66.0',
|
|
1228
|
+
basePath: '/connect/action-plan',
|
|
1229
|
+
method: 'get',
|
|
1230
|
+
body: null,
|
|
1231
|
+
urlParams: {},
|
|
1232
|
+
queryParams: config.queryParams,
|
|
1233
|
+
headers,
|
|
1234
|
+
priority: 'normal',
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
const adapterName$2 = 'getActionPlans';
|
|
1239
|
+
const getActionPlans_ConfigPropertyMetadata = [
|
|
1240
|
+
generateParamConfigMetadata('actionPlanType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1241
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1242
|
+
generateParamConfigMetadata('order', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1243
|
+
generateParamConfigMetadata('orderingParam', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1244
|
+
generateParamConfigMetadata('targetId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1245
|
+
];
|
|
1246
|
+
const getActionPlans_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getActionPlans_ConfigPropertyMetadata);
|
|
1247
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$6(getActionPlans_ConfigPropertyMetadata);
|
|
1248
|
+
function keyBuilder$2(luvio, config) {
|
|
1249
|
+
const resourceParams = createResourceParams$2(config);
|
|
1250
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
1251
|
+
}
|
|
1252
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
1253
|
+
const config = {};
|
|
1254
|
+
typeCheckConfig$6(untrustedConfig, config, getActionPlans_ConfigPropertyMetadata);
|
|
1255
|
+
return config;
|
|
1256
|
+
}
|
|
1257
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1258
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1259
|
+
return null;
|
|
1260
|
+
}
|
|
1261
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1262
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1263
|
+
}
|
|
1264
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1265
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1266
|
+
return null;
|
|
1267
|
+
}
|
|
1268
|
+
return config;
|
|
1269
|
+
}
|
|
1270
|
+
function adapterFragment(luvio, config) {
|
|
1271
|
+
createResourceParams$2(config);
|
|
1272
|
+
return select$4();
|
|
1273
|
+
}
|
|
1274
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1275
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
1276
|
+
config,
|
|
1277
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1278
|
+
});
|
|
1279
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1280
|
+
}
|
|
1281
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1282
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1283
|
+
config,
|
|
1284
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1285
|
+
});
|
|
1286
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1287
|
+
}
|
|
1288
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1289
|
+
const resourceParams = createResourceParams$2(config);
|
|
1290
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1291
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1292
|
+
.then((response) => {
|
|
1293
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1294
|
+
const cache = new StoreKeyMap();
|
|
1295
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
1296
|
+
return cache;
|
|
1297
|
+
});
|
|
1298
|
+
}, (response) => {
|
|
1299
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1303
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
1304
|
+
}
|
|
1305
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1306
|
+
const { luvio, config } = context;
|
|
1307
|
+
const selector = {
|
|
1308
|
+
recordId: keyBuilder$2(luvio, config),
|
|
1309
|
+
node: adapterFragment(luvio, config),
|
|
1310
|
+
variables: {},
|
|
1311
|
+
};
|
|
1312
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1313
|
+
config,
|
|
1314
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1315
|
+
});
|
|
1316
|
+
return cacheSnapshot;
|
|
1317
|
+
}
|
|
1318
|
+
const getActionPlansAdapterFactory = (luvio) => function ActionPlan__getActionPlans(untrustedConfig, requestContext) {
|
|
1319
|
+
const config = validateAdapterConfig$2(untrustedConfig, getActionPlans_ConfigPropertyNames);
|
|
1320
|
+
// Invalid or incomplete config
|
|
1321
|
+
if (config === null) {
|
|
1322
|
+
return null;
|
|
1323
|
+
}
|
|
1324
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1325
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
function validate$7(obj, path = 'ActionPlanTaskFieldValueUpdateInputRepresentation') {
|
|
1329
|
+
const v_error = (() => {
|
|
1330
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1331
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1332
|
+
}
|
|
1333
|
+
const obj_fieldApiName = obj.fieldApiName;
|
|
1334
|
+
const path_fieldApiName = path + '.fieldApiName';
|
|
1335
|
+
if (typeof obj_fieldApiName !== 'string') {
|
|
1336
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldApiName + '" (at "' + path_fieldApiName + '")');
|
|
1337
|
+
}
|
|
1338
|
+
const obj_fieldValue = obj.fieldValue;
|
|
1339
|
+
const path_fieldValue = path + '.fieldValue';
|
|
1340
|
+
if (typeof obj_fieldValue !== 'string') {
|
|
1341
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldValue + '" (at "' + path_fieldValue + '")');
|
|
1342
|
+
}
|
|
1343
|
+
})();
|
|
1344
|
+
return v_error === undefined ? null : v_error;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
function validate$6(obj, path = 'ActionPlanTaskUpdateInputRepresentation') {
|
|
1348
|
+
const v_error = (() => {
|
|
1349
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1350
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1351
|
+
}
|
|
1352
|
+
if (obj.actionPlanItemId !== undefined) {
|
|
1353
|
+
const obj_actionPlanItemId = obj.actionPlanItemId;
|
|
1354
|
+
const path_actionPlanItemId = path + '.actionPlanItemId';
|
|
1355
|
+
if (typeof obj_actionPlanItemId !== 'string') {
|
|
1356
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionPlanItemId + '" (at "' + path_actionPlanItemId + '")');
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
const obj_taskFieldValues = obj.taskFieldValues;
|
|
1360
|
+
const path_taskFieldValues = path + '.taskFieldValues';
|
|
1361
|
+
if (!ArrayIsArray(obj_taskFieldValues)) {
|
|
1362
|
+
return new TypeError('Expected "array" but received "' + typeof obj_taskFieldValues + '" (at "' + path_taskFieldValues + '")');
|
|
1363
|
+
}
|
|
1364
|
+
for (let i = 0; i < obj_taskFieldValues.length; i++) {
|
|
1365
|
+
const obj_taskFieldValues_item = obj_taskFieldValues[i];
|
|
1366
|
+
const path_taskFieldValues_item = path_taskFieldValues + '[' + i + ']';
|
|
1367
|
+
const referencepath_taskFieldValues_itemValidationError = validate$7(obj_taskFieldValues_item, path_taskFieldValues_item);
|
|
1368
|
+
if (referencepath_taskFieldValues_itemValidationError !== null) {
|
|
1369
|
+
let message = 'Object doesn\'t match ActionPlanTaskFieldValueUpdateInputRepresentation (at "' + path_taskFieldValues_item + '")\n';
|
|
1370
|
+
message += referencepath_taskFieldValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1371
|
+
return new TypeError(message);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
const obj_taskId = obj.taskId;
|
|
1375
|
+
const path_taskId = path + '.taskId';
|
|
1376
|
+
if (typeof obj_taskId !== 'string') {
|
|
1377
|
+
return new TypeError('Expected "string" but received "' + typeof obj_taskId + '" (at "' + path_taskId + '")');
|
|
1378
|
+
}
|
|
1379
|
+
})();
|
|
1380
|
+
return v_error === undefined ? null : v_error;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
function validate$5(obj, path = 'ActionPlanUpdateErrorOutputRepresentation') {
|
|
1384
|
+
const v_error = (() => {
|
|
1385
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1386
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1387
|
+
}
|
|
1388
|
+
const obj_errorMessageList = obj.errorMessageList;
|
|
1389
|
+
const path_errorMessageList = path + '.errorMessageList';
|
|
1390
|
+
if (!ArrayIsArray(obj_errorMessageList)) {
|
|
1391
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errorMessageList + '" (at "' + path_errorMessageList + '")');
|
|
1392
|
+
}
|
|
1393
|
+
for (let i = 0; i < obj_errorMessageList.length; i++) {
|
|
1394
|
+
const obj_errorMessageList_item = obj_errorMessageList[i];
|
|
1395
|
+
const path_errorMessageList_item = path_errorMessageList + '[' + i + ']';
|
|
1396
|
+
if (typeof obj_errorMessageList_item !== 'string') {
|
|
1397
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessageList_item + '" (at "' + path_errorMessageList_item + '")');
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
const obj_taskId = obj.taskId;
|
|
1401
|
+
const path_taskId = path + '.taskId';
|
|
1402
|
+
if (typeof obj_taskId !== 'string') {
|
|
1403
|
+
return new TypeError('Expected "string" but received "' + typeof obj_taskId + '" (at "' + path_taskId + '")');
|
|
1404
|
+
}
|
|
1405
|
+
})();
|
|
1406
|
+
return v_error === undefined ? null : v_error;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
const TTL$1 = 1000;
|
|
1410
|
+
const VERSION$1 = "d6f8327bd45d41494638825f18251f24";
|
|
1411
|
+
function validate$4(obj, path = 'ActionPlanUpdateOutputRepresentation') {
|
|
1412
|
+
const v_error = (() => {
|
|
1413
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1414
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1415
|
+
}
|
|
1416
|
+
const obj_actionPlanId = obj.actionPlanId;
|
|
1417
|
+
const path_actionPlanId = path + '.actionPlanId';
|
|
1418
|
+
if (typeof obj_actionPlanId !== 'string') {
|
|
1419
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionPlanId + '" (at "' + path_actionPlanId + '")');
|
|
1420
|
+
}
|
|
1421
|
+
const obj_errors = obj.errors;
|
|
1422
|
+
const path_errors = path + '.errors';
|
|
1423
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
1424
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
1425
|
+
}
|
|
1426
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
1427
|
+
const obj_errors_item = obj_errors[i];
|
|
1428
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
1429
|
+
const referencepath_errors_itemValidationError = validate$5(obj_errors_item, path_errors_item);
|
|
1430
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
1431
|
+
let message = 'Object doesn\'t match ActionPlanUpdateErrorOutputRepresentation (at "' + path_errors_item + '")\n';
|
|
1432
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1433
|
+
return new TypeError(message);
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
const obj_message = obj.message;
|
|
1437
|
+
const path_message = path + '.message';
|
|
1438
|
+
let obj_message_union0 = null;
|
|
1439
|
+
const obj_message_union0_error = (() => {
|
|
1440
|
+
if (typeof obj_message !== 'string') {
|
|
1441
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1442
|
+
}
|
|
1443
|
+
})();
|
|
1444
|
+
if (obj_message_union0_error != null) {
|
|
1445
|
+
obj_message_union0 = obj_message_union0_error.message;
|
|
1446
|
+
}
|
|
1447
|
+
let obj_message_union1 = null;
|
|
1448
|
+
const obj_message_union1_error = (() => {
|
|
1449
|
+
if (obj_message !== null) {
|
|
1450
|
+
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1451
|
+
}
|
|
1452
|
+
})();
|
|
1453
|
+
if (obj_message_union1_error != null) {
|
|
1454
|
+
obj_message_union1 = obj_message_union1_error.message;
|
|
1455
|
+
}
|
|
1456
|
+
if (obj_message_union0 && obj_message_union1) {
|
|
1457
|
+
let message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
1458
|
+
message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1459
|
+
message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1460
|
+
return new TypeError(message);
|
|
1461
|
+
}
|
|
1462
|
+
const obj_status = obj.status;
|
|
1463
|
+
const path_status = path + '.status';
|
|
1464
|
+
if (typeof obj_status !== 'string') {
|
|
1465
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1466
|
+
}
|
|
1467
|
+
})();
|
|
1468
|
+
return v_error === undefined ? null : v_error;
|
|
1469
|
+
}
|
|
1470
|
+
const RepresentationType$1 = 'ActionPlanUpdateOutputRepresentation';
|
|
1471
|
+
function keyBuilder$1(luvio, config) {
|
|
1472
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
|
|
1473
|
+
}
|
|
1474
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
1475
|
+
const keyParams = {
|
|
1476
|
+
id: object.actionPlanId
|
|
1477
|
+
};
|
|
1478
|
+
return keyBuilder$1(luvio, keyParams);
|
|
1479
|
+
}
|
|
1480
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1481
|
+
return input;
|
|
1482
|
+
}
|
|
1483
|
+
const select$3 = function ActionPlanUpdateOutputRepresentationSelect() {
|
|
1484
|
+
return {
|
|
1485
|
+
kind: 'Fragment',
|
|
1486
|
+
version: VERSION$1,
|
|
1487
|
+
private: [],
|
|
1488
|
+
opaque: true
|
|
1489
|
+
};
|
|
1490
|
+
};
|
|
1491
|
+
function equals$1(existing, incoming) {
|
|
1492
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1493
|
+
return false;
|
|
1494
|
+
}
|
|
1495
|
+
return true;
|
|
1496
|
+
}
|
|
1497
|
+
const ingest$1 = function ActionPlanUpdateOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1498
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1499
|
+
const validateError = validate$4(input);
|
|
1500
|
+
if (validateError !== null) {
|
|
1501
|
+
throw validateError;
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
1505
|
+
const ttlToUse = TTL$1;
|
|
1506
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "ActionPlan", VERSION$1, RepresentationType$1, equals$1);
|
|
1507
|
+
return createLink(key);
|
|
1508
|
+
};
|
|
1509
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1510
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1511
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1512
|
+
rootKeySet.set(rootKey, {
|
|
1513
|
+
namespace: keyPrefix,
|
|
1514
|
+
representationName: RepresentationType$1,
|
|
1515
|
+
mergeable: false
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
function select$2(luvio, params) {
|
|
1520
|
+
return select$3();
|
|
1521
|
+
}
|
|
1522
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1523
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
1524
|
+
}
|
|
1525
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
1526
|
+
const { body } = response;
|
|
1527
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
1528
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1529
|
+
const snapshot = luvio.storeLookup({
|
|
1530
|
+
recordId: key,
|
|
1531
|
+
node: select$2(),
|
|
1532
|
+
variables: {},
|
|
1533
|
+
});
|
|
1534
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1535
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1536
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
deepFreeze(snapshot.data);
|
|
1540
|
+
return snapshot;
|
|
1541
|
+
}
|
|
1542
|
+
function createResourceRequest$1(config) {
|
|
1543
|
+
const headers = {};
|
|
1544
|
+
return {
|
|
1545
|
+
baseUri: '/services/data/v66.0',
|
|
1546
|
+
basePath: '/connect/action-plan-update/' + config.urlParams.actionPlanId + '',
|
|
1547
|
+
method: 'patch',
|
|
1548
|
+
body: config.body,
|
|
1549
|
+
urlParams: config.urlParams,
|
|
1550
|
+
queryParams: {},
|
|
1551
|
+
headers,
|
|
1552
|
+
priority: 'normal',
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
const adapterName$1 = 'updateActionPlanTasks';
|
|
1557
|
+
const updateActionPlanTasks_ConfigPropertyMetadata = [
|
|
1558
|
+
generateParamConfigMetadata('actionPlanId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1559
|
+
generateParamConfigMetadata('actionPlanTasks', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1560
|
+
];
|
|
1561
|
+
const updateActionPlanTasks_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, updateActionPlanTasks_ConfigPropertyMetadata);
|
|
1562
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$6(updateActionPlanTasks_ConfigPropertyMetadata);
|
|
1563
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1564
|
+
const config = {};
|
|
1565
|
+
typeCheckConfig$6(untrustedConfig, config, updateActionPlanTasks_ConfigPropertyMetadata);
|
|
1566
|
+
const untrustedConfig_actionPlanTasks = untrustedConfig.actionPlanTasks;
|
|
1567
|
+
if (ArrayIsArray$1(untrustedConfig_actionPlanTasks)) {
|
|
1568
|
+
const untrustedConfig_actionPlanTasks_array = [];
|
|
1569
|
+
for (let i = 0, arrayLength = untrustedConfig_actionPlanTasks.length; i < arrayLength; i++) {
|
|
1570
|
+
const untrustedConfig_actionPlanTasks_item = untrustedConfig_actionPlanTasks[i];
|
|
1571
|
+
const referenceActionPlanTaskUpdateInputRepresentationValidationError = validate$6(untrustedConfig_actionPlanTasks_item);
|
|
1572
|
+
if (referenceActionPlanTaskUpdateInputRepresentationValidationError === null) {
|
|
1573
|
+
untrustedConfig_actionPlanTasks_array.push(untrustedConfig_actionPlanTasks_item);
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
config.actionPlanTasks = untrustedConfig_actionPlanTasks_array;
|
|
1577
|
+
}
|
|
1578
|
+
return config;
|
|
1579
|
+
}
|
|
1580
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1581
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1582
|
+
return null;
|
|
1583
|
+
}
|
|
1584
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1585
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1586
|
+
}
|
|
1587
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1588
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1589
|
+
return null;
|
|
1590
|
+
}
|
|
1591
|
+
return config;
|
|
1592
|
+
}
|
|
1593
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1594
|
+
const resourceParams = createResourceParams$1(config);
|
|
1595
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1596
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1597
|
+
.then((response) => {
|
|
1598
|
+
return luvio.handleSuccessResponse(() => {
|
|
1599
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
1600
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1601
|
+
}, () => {
|
|
1602
|
+
const cache = new StoreKeyMap();
|
|
1603
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
1604
|
+
return cache;
|
|
1605
|
+
});
|
|
1606
|
+
}, (response) => {
|
|
1607
|
+
deepFreeze(response);
|
|
1608
|
+
throw response;
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1611
|
+
const updateActionPlanTasksAdapterFactory = (luvio) => {
|
|
1612
|
+
return function updateActionPlanTasks(untrustedConfig) {
|
|
1613
|
+
const config = validateAdapterConfig$1(untrustedConfig, updateActionPlanTasks_ConfigPropertyNames);
|
|
1614
|
+
// Invalid or incomplete config
|
|
1615
|
+
if (config === null) {
|
|
1616
|
+
throw new Error('Invalid config for "updateActionPlanTasks"');
|
|
1617
|
+
}
|
|
1618
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
1619
|
+
};
|
|
1620
|
+
};
|
|
1621
|
+
|
|
1622
|
+
function validate$3(obj, path = 'ActionPlanTemplateItemValueUpdateInputRepresentation') {
|
|
1623
|
+
const v_error = (() => {
|
|
1624
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1625
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1626
|
+
}
|
|
1627
|
+
if (obj.actionPlanTemplateItemValueId !== undefined) {
|
|
1628
|
+
const obj_actionPlanTemplateItemValueId = obj.actionPlanTemplateItemValueId;
|
|
1629
|
+
const path_actionPlanTemplateItemValueId = path + '.actionPlanTemplateItemValueId';
|
|
1630
|
+
if (typeof obj_actionPlanTemplateItemValueId !== 'string') {
|
|
1631
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionPlanTemplateItemValueId + '" (at "' + path_actionPlanTemplateItemValueId + '")');
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
if (obj.fieldValueFormula !== undefined) {
|
|
1635
|
+
const obj_fieldValueFormula = obj.fieldValueFormula;
|
|
1636
|
+
const path_fieldValueFormula = path + '.fieldValueFormula';
|
|
1637
|
+
if (typeof obj_fieldValueFormula !== 'string') {
|
|
1638
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldValueFormula + '" (at "' + path_fieldValueFormula + '")');
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
if (obj.fieldValueLiteral !== undefined) {
|
|
1642
|
+
const obj_fieldValueLiteral = obj.fieldValueLiteral;
|
|
1643
|
+
const path_fieldValueLiteral = path + '.fieldValueLiteral';
|
|
1644
|
+
if (obj_fieldValueLiteral === undefined) {
|
|
1645
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_fieldValueLiteral + '" (at "' + path_fieldValueLiteral + '")');
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
if (obj.itemEntityFieldName !== undefined) {
|
|
1649
|
+
const obj_itemEntityFieldName = obj.itemEntityFieldName;
|
|
1650
|
+
const path_itemEntityFieldName = path + '.itemEntityFieldName';
|
|
1651
|
+
if (typeof obj_itemEntityFieldName !== 'string') {
|
|
1652
|
+
return new TypeError('Expected "string" but received "' + typeof obj_itemEntityFieldName + '" (at "' + path_itemEntityFieldName + '")');
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
})();
|
|
1656
|
+
return v_error === undefined ? null : v_error;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
function validate$2(obj, path = 'ActionPlanTemplateItemUpdateInputRepresentation') {
|
|
1660
|
+
const v_error = (() => {
|
|
1661
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1662
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1663
|
+
}
|
|
1664
|
+
const obj_actionPlanTemplateItemId = obj.actionPlanTemplateItemId;
|
|
1665
|
+
const path_actionPlanTemplateItemId = path + '.actionPlanTemplateItemId';
|
|
1666
|
+
if (typeof obj_actionPlanTemplateItemId !== 'string') {
|
|
1667
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionPlanTemplateItemId + '" (at "' + path_actionPlanTemplateItemId + '")');
|
|
1668
|
+
}
|
|
1669
|
+
if (obj.actionPlanTemplateItemValues !== undefined) {
|
|
1670
|
+
const obj_actionPlanTemplateItemValues = obj.actionPlanTemplateItemValues;
|
|
1671
|
+
const path_actionPlanTemplateItemValues = path + '.actionPlanTemplateItemValues';
|
|
1672
|
+
if (!ArrayIsArray(obj_actionPlanTemplateItemValues)) {
|
|
1673
|
+
return new TypeError('Expected "array" but received "' + typeof obj_actionPlanTemplateItemValues + '" (at "' + path_actionPlanTemplateItemValues + '")');
|
|
1674
|
+
}
|
|
1675
|
+
for (let i = 0; i < obj_actionPlanTemplateItemValues.length; i++) {
|
|
1676
|
+
const obj_actionPlanTemplateItemValues_item = obj_actionPlanTemplateItemValues[i];
|
|
1677
|
+
const path_actionPlanTemplateItemValues_item = path_actionPlanTemplateItemValues + '[' + i + ']';
|
|
1678
|
+
const referencepath_actionPlanTemplateItemValues_itemValidationError = validate$3(obj_actionPlanTemplateItemValues_item, path_actionPlanTemplateItemValues_item);
|
|
1679
|
+
if (referencepath_actionPlanTemplateItemValues_itemValidationError !== null) {
|
|
1680
|
+
let message = 'Object doesn\'t match ActionPlanTemplateItemValueUpdateInputRepresentation (at "' + path_actionPlanTemplateItemValues_item + '")\n';
|
|
1681
|
+
message += referencepath_actionPlanTemplateItemValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1682
|
+
return new TypeError(message);
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
if (obj.isRequired !== undefined) {
|
|
1687
|
+
const obj_isRequired = obj.isRequired;
|
|
1688
|
+
const path_isRequired = path + '.isRequired';
|
|
1689
|
+
if (typeof obj_isRequired !== 'boolean') {
|
|
1690
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isRequired + '" (at "' + path_isRequired + '")');
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
if (obj.subject !== undefined) {
|
|
1694
|
+
const obj_subject = obj.subject;
|
|
1695
|
+
const path_subject = path + '.subject';
|
|
1696
|
+
if (typeof obj_subject !== 'string') {
|
|
1697
|
+
return new TypeError('Expected "string" but received "' + typeof obj_subject + '" (at "' + path_subject + '")');
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
})();
|
|
1701
|
+
return v_error === undefined ? null : v_error;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
function validate$1(obj, path = 'ActionPlanTemplateUpdateErrorOutputRepresentation') {
|
|
1705
|
+
const v_error = (() => {
|
|
1706
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1707
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1708
|
+
}
|
|
1709
|
+
const obj_actionPlanTemplateItemId = obj.actionPlanTemplateItemId;
|
|
1710
|
+
const path_actionPlanTemplateItemId = path + '.actionPlanTemplateItemId';
|
|
1711
|
+
if (typeof obj_actionPlanTemplateItemId !== 'string') {
|
|
1712
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionPlanTemplateItemId + '" (at "' + path_actionPlanTemplateItemId + '")');
|
|
1713
|
+
}
|
|
1714
|
+
const obj_errorMessage = obj.errorMessage;
|
|
1715
|
+
const path_errorMessage = path + '.errorMessage';
|
|
1716
|
+
if (!ArrayIsArray(obj_errorMessage)) {
|
|
1717
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
1718
|
+
}
|
|
1719
|
+
for (let i = 0; i < obj_errorMessage.length; i++) {
|
|
1720
|
+
const obj_errorMessage_item = obj_errorMessage[i];
|
|
1721
|
+
const path_errorMessage_item = path_errorMessage + '[' + i + ']';
|
|
1722
|
+
if (typeof obj_errorMessage_item !== 'string') {
|
|
1723
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage_item + '" (at "' + path_errorMessage_item + '")');
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
})();
|
|
1727
|
+
return v_error === undefined ? null : v_error;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
const TTL = 1000;
|
|
1731
|
+
const VERSION = "5d4c1520638de11c3fb6993336f85ac6";
|
|
1732
|
+
function validate(obj, path = 'ActionPlanTemplateUpdateOutputRepresentation') {
|
|
1733
|
+
const v_error = (() => {
|
|
1734
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1735
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1736
|
+
}
|
|
1737
|
+
const obj_actionPlanTemplateVersionId = obj.actionPlanTemplateVersionId;
|
|
1738
|
+
const path_actionPlanTemplateVersionId = path + '.actionPlanTemplateVersionId';
|
|
1739
|
+
if (typeof obj_actionPlanTemplateVersionId !== 'string') {
|
|
1740
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionPlanTemplateVersionId + '" (at "' + path_actionPlanTemplateVersionId + '")');
|
|
1741
|
+
}
|
|
1742
|
+
const obj_errors = obj.errors;
|
|
1743
|
+
const path_errors = path + '.errors';
|
|
1744
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
1745
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
1746
|
+
}
|
|
1747
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
1748
|
+
const obj_errors_item = obj_errors[i];
|
|
1749
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
1750
|
+
const referencepath_errors_itemValidationError = validate$1(obj_errors_item, path_errors_item);
|
|
1751
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
1752
|
+
let message = 'Object doesn\'t match ActionPlanTemplateUpdateErrorOutputRepresentation (at "' + path_errors_item + '")\n';
|
|
1753
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1754
|
+
return new TypeError(message);
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
const obj_message = obj.message;
|
|
1758
|
+
const path_message = path + '.message';
|
|
1759
|
+
let obj_message_union0 = null;
|
|
1760
|
+
const obj_message_union0_error = (() => {
|
|
1761
|
+
if (typeof obj_message !== 'string') {
|
|
1762
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1763
|
+
}
|
|
1764
|
+
})();
|
|
1765
|
+
if (obj_message_union0_error != null) {
|
|
1766
|
+
obj_message_union0 = obj_message_union0_error.message;
|
|
1767
|
+
}
|
|
1768
|
+
let obj_message_union1 = null;
|
|
1769
|
+
const obj_message_union1_error = (() => {
|
|
1770
|
+
if (obj_message !== null) {
|
|
1771
|
+
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1772
|
+
}
|
|
1773
|
+
})();
|
|
1774
|
+
if (obj_message_union1_error != null) {
|
|
1775
|
+
obj_message_union1 = obj_message_union1_error.message;
|
|
1776
|
+
}
|
|
1777
|
+
if (obj_message_union0 && obj_message_union1) {
|
|
1778
|
+
let message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
1779
|
+
message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1780
|
+
message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1781
|
+
return new TypeError(message);
|
|
1782
|
+
}
|
|
1783
|
+
const obj_status = obj.status;
|
|
1784
|
+
const path_status = path + '.status';
|
|
1785
|
+
if (typeof obj_status !== 'string') {
|
|
1786
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1787
|
+
}
|
|
1788
|
+
})();
|
|
1789
|
+
return v_error === undefined ? null : v_error;
|
|
1790
|
+
}
|
|
1791
|
+
const RepresentationType = 'ActionPlanTemplateUpdateOutputRepresentation';
|
|
1792
|
+
function keyBuilder(luvio, config) {
|
|
1793
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.id;
|
|
1794
|
+
}
|
|
1795
|
+
function keyBuilderFromType(luvio, object) {
|
|
1796
|
+
const keyParams = {
|
|
1797
|
+
id: object.actionPlanTemplateVersionId
|
|
1798
|
+
};
|
|
1799
|
+
return keyBuilder(luvio, keyParams);
|
|
1800
|
+
}
|
|
1801
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1802
|
+
return input;
|
|
1803
|
+
}
|
|
1804
|
+
const select$1 = function ActionPlanTemplateUpdateOutputRepresentationSelect() {
|
|
1805
|
+
return {
|
|
1806
|
+
kind: 'Fragment',
|
|
1807
|
+
version: VERSION,
|
|
1808
|
+
private: [],
|
|
1809
|
+
opaque: true
|
|
1810
|
+
};
|
|
1811
|
+
};
|
|
1812
|
+
function equals(existing, incoming) {
|
|
1813
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1814
|
+
return false;
|
|
1815
|
+
}
|
|
1816
|
+
return true;
|
|
1817
|
+
}
|
|
1818
|
+
const ingest = function ActionPlanTemplateUpdateOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1819
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1820
|
+
const validateError = validate(input);
|
|
1821
|
+
if (validateError !== null) {
|
|
1822
|
+
throw validateError;
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
const key = keyBuilderFromType(luvio, input);
|
|
1826
|
+
const ttlToUse = TTL;
|
|
1827
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "ActionPlan", VERSION, RepresentationType, equals);
|
|
1828
|
+
return createLink(key);
|
|
1829
|
+
};
|
|
1830
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1831
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1832
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
1833
|
+
rootKeySet.set(rootKey, {
|
|
1834
|
+
namespace: keyPrefix,
|
|
1835
|
+
representationName: RepresentationType,
|
|
1836
|
+
mergeable: false
|
|
1837
|
+
});
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
function select(luvio, params) {
|
|
1841
|
+
return select$1();
|
|
1842
|
+
}
|
|
1843
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1844
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1845
|
+
}
|
|
1846
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
1847
|
+
const { body } = response;
|
|
1848
|
+
const key = keyBuilderFromType(luvio, body);
|
|
1849
|
+
luvio.storeIngest(key, ingest, body);
|
|
1850
|
+
const snapshot = luvio.storeLookup({
|
|
1851
|
+
recordId: key,
|
|
1852
|
+
node: select(),
|
|
1853
|
+
variables: {},
|
|
1854
|
+
});
|
|
1855
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1856
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1857
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
deepFreeze(snapshot.data);
|
|
1861
|
+
return snapshot;
|
|
1862
|
+
}
|
|
1863
|
+
function createResourceRequest(config) {
|
|
1864
|
+
const headers = {};
|
|
1865
|
+
return {
|
|
1866
|
+
baseUri: '/services/data/v66.0',
|
|
1867
|
+
basePath: '/connect/action-plan-template-update/' + config.urlParams.actionPlanTemplateVersionId + '',
|
|
1868
|
+
method: 'patch',
|
|
1869
|
+
body: config.body,
|
|
1870
|
+
urlParams: config.urlParams,
|
|
1871
|
+
queryParams: {},
|
|
1872
|
+
headers,
|
|
1873
|
+
priority: 'normal',
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
const adapterName = 'updateActionPlanTemplateTasks';
|
|
1878
|
+
const updateActionPlanTemplateTasks_ConfigPropertyMetadata = [
|
|
1879
|
+
generateParamConfigMetadata('actionPlanTemplateVersionId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1880
|
+
generateParamConfigMetadata('actionPlanTemplateItems', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1881
|
+
];
|
|
1882
|
+
const updateActionPlanTemplateTasks_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateActionPlanTemplateTasks_ConfigPropertyMetadata);
|
|
1883
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$6(updateActionPlanTemplateTasks_ConfigPropertyMetadata);
|
|
1884
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1885
|
+
const config = {};
|
|
1886
|
+
typeCheckConfig$6(untrustedConfig, config, updateActionPlanTemplateTasks_ConfigPropertyMetadata);
|
|
1887
|
+
const untrustedConfig_actionPlanTemplateItems = untrustedConfig.actionPlanTemplateItems;
|
|
1888
|
+
if (ArrayIsArray$1(untrustedConfig_actionPlanTemplateItems)) {
|
|
1889
|
+
const untrustedConfig_actionPlanTemplateItems_array = [];
|
|
1890
|
+
for (let i = 0, arrayLength = untrustedConfig_actionPlanTemplateItems.length; i < arrayLength; i++) {
|
|
1891
|
+
const untrustedConfig_actionPlanTemplateItems_item = untrustedConfig_actionPlanTemplateItems[i];
|
|
1892
|
+
const referenceActionPlanTemplateItemUpdateInputRepresentationValidationError = validate$2(untrustedConfig_actionPlanTemplateItems_item);
|
|
1893
|
+
if (referenceActionPlanTemplateItemUpdateInputRepresentationValidationError === null) {
|
|
1894
|
+
untrustedConfig_actionPlanTemplateItems_array.push(untrustedConfig_actionPlanTemplateItems_item);
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
config.actionPlanTemplateItems = untrustedConfig_actionPlanTemplateItems_array;
|
|
1898
|
+
}
|
|
1899
|
+
return config;
|
|
1900
|
+
}
|
|
1901
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1902
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1903
|
+
return null;
|
|
1904
|
+
}
|
|
1905
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1906
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1907
|
+
}
|
|
1908
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1909
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1910
|
+
return null;
|
|
1911
|
+
}
|
|
1912
|
+
return config;
|
|
1913
|
+
}
|
|
1914
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1915
|
+
const resourceParams = createResourceParams(config);
|
|
1916
|
+
const request = createResourceRequest(resourceParams);
|
|
1917
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1918
|
+
.then((response) => {
|
|
1919
|
+
return luvio.handleSuccessResponse(() => {
|
|
1920
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1921
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1922
|
+
}, () => {
|
|
1923
|
+
const cache = new StoreKeyMap();
|
|
1924
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1925
|
+
return cache;
|
|
1926
|
+
});
|
|
1927
|
+
}, (response) => {
|
|
1928
|
+
deepFreeze(response);
|
|
1929
|
+
throw response;
|
|
1930
|
+
});
|
|
1931
|
+
}
|
|
1932
|
+
const updateActionPlanTemplateTasksAdapterFactory = (luvio) => {
|
|
1933
|
+
return function updateActionPlanTemplateTasks(untrustedConfig) {
|
|
1934
|
+
const config = validateAdapterConfig(untrustedConfig, updateActionPlanTemplateTasks_ConfigPropertyNames);
|
|
1935
|
+
// Invalid or incomplete config
|
|
1936
|
+
if (config === null) {
|
|
1937
|
+
throw new Error('Invalid config for "updateActionPlanTemplateTasks"');
|
|
1938
|
+
}
|
|
1939
|
+
return buildNetworkSnapshot(luvio, config);
|
|
1940
|
+
};
|
|
1941
|
+
};
|
|
1942
|
+
|
|
1943
|
+
let getActionPlanItems;
|
|
1944
|
+
let getActionPlanStatusInfo;
|
|
1945
|
+
let getActionPlanTemplateItemsLabel;
|
|
1946
|
+
let getActionPlans;
|
|
1947
|
+
let updateActionPlanTasks;
|
|
1948
|
+
let updateActionPlanTemplateTasks;
|
|
1949
|
+
// Imperative GET Adapters
|
|
1950
|
+
let getActionPlanItems_imperative;
|
|
1951
|
+
let getActionPlanStatusInfo_imperative;
|
|
1952
|
+
let getActionPlanTemplateItemsLabel_imperative;
|
|
1953
|
+
let getActionPlans_imperative;
|
|
1954
|
+
// Adapter Metadata
|
|
1955
|
+
const getActionPlanItemsMetadata = {
|
|
1956
|
+
apiFamily: 'ActionPlan',
|
|
1957
|
+
name: 'getActionPlanItems',
|
|
1958
|
+
ttl: 1000,
|
|
1959
|
+
};
|
|
1960
|
+
const getActionPlanStatusInfoMetadata = {
|
|
1961
|
+
apiFamily: 'ActionPlan',
|
|
1962
|
+
name: 'getActionPlanStatusInfo',
|
|
1963
|
+
ttl: 1000,
|
|
1964
|
+
};
|
|
1965
|
+
const getActionPlanTemplateItemsLabelMetadata = {
|
|
1966
|
+
apiFamily: 'ActionPlan',
|
|
1967
|
+
name: 'getActionPlanTemplateItemsLabel',
|
|
1968
|
+
ttl: 1000,
|
|
1969
|
+
};
|
|
1970
|
+
const getActionPlansMetadata = { apiFamily: 'ActionPlan', name: 'getActionPlans', ttl: 1000 };
|
|
1971
|
+
// Notify Update Available
|
|
1972
|
+
function bindExportsTo(luvio) {
|
|
1973
|
+
// LDS Adapters
|
|
1974
|
+
const getActionPlanItems_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getActionPlanItems', getActionPlanItemsAdapterFactory), getActionPlanItemsMetadata);
|
|
1975
|
+
const getActionPlanStatusInfo_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getActionPlanStatusInfo', getActionPlanStatusInfoAdapterFactory), getActionPlanStatusInfoMetadata);
|
|
1976
|
+
const getActionPlanTemplateItemsLabel_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getActionPlanTemplateItemsLabel', getActionPlanTemplateItemsLabelAdapterFactory), getActionPlanTemplateItemsLabelMetadata);
|
|
1977
|
+
const getActionPlans_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getActionPlans', getActionPlansAdapterFactory), getActionPlansMetadata);
|
|
1978
|
+
function unwrapSnapshotData(factory) {
|
|
1979
|
+
const adapter = factory(luvio);
|
|
1980
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
1981
|
+
}
|
|
1982
|
+
return {
|
|
1983
|
+
getActionPlanItems: createWireAdapterConstructor(luvio, getActionPlanItems_ldsAdapter, getActionPlanItemsMetadata),
|
|
1984
|
+
getActionPlanStatusInfo: createWireAdapterConstructor(luvio, getActionPlanStatusInfo_ldsAdapter, getActionPlanStatusInfoMetadata),
|
|
1985
|
+
getActionPlanTemplateItemsLabel: createWireAdapterConstructor(luvio, getActionPlanTemplateItemsLabel_ldsAdapter, getActionPlanTemplateItemsLabelMetadata),
|
|
1986
|
+
getActionPlans: createWireAdapterConstructor(luvio, getActionPlans_ldsAdapter, getActionPlansMetadata),
|
|
1987
|
+
updateActionPlanTasks: unwrapSnapshotData(updateActionPlanTasksAdapterFactory),
|
|
1988
|
+
updateActionPlanTemplateTasks: unwrapSnapshotData(updateActionPlanTemplateTasksAdapterFactory),
|
|
1989
|
+
// Imperative GET Adapters
|
|
1990
|
+
getActionPlanItems_imperative: createImperativeAdapter(luvio, getActionPlanItems_ldsAdapter, getActionPlanItemsMetadata),
|
|
1991
|
+
getActionPlanStatusInfo_imperative: createImperativeAdapter(luvio, getActionPlanStatusInfo_ldsAdapter, getActionPlanStatusInfoMetadata),
|
|
1992
|
+
getActionPlanTemplateItemsLabel_imperative: createImperativeAdapter(luvio, getActionPlanTemplateItemsLabel_ldsAdapter, getActionPlanTemplateItemsLabelMetadata),
|
|
1993
|
+
getActionPlans_imperative: createImperativeAdapter(luvio, getActionPlans_ldsAdapter, getActionPlansMetadata),
|
|
1994
|
+
// Notify Update Availables
|
|
1995
|
+
};
|
|
1996
|
+
}
|
|
1997
|
+
withDefaultLuvio((luvio) => {
|
|
1998
|
+
({
|
|
1999
|
+
getActionPlanItems,
|
|
2000
|
+
getActionPlanStatusInfo,
|
|
2001
|
+
getActionPlanTemplateItemsLabel,
|
|
2002
|
+
getActionPlans,
|
|
2003
|
+
updateActionPlanTasks,
|
|
2004
|
+
updateActionPlanTemplateTasks,
|
|
2005
|
+
getActionPlanItems_imperative,
|
|
2006
|
+
getActionPlanStatusInfo_imperative,
|
|
2007
|
+
getActionPlanTemplateItemsLabel_imperative,
|
|
2008
|
+
getActionPlans_imperative,
|
|
2009
|
+
} = bindExportsTo(luvio));
|
|
2010
|
+
});
|
|
2011
|
+
|
|
2012
|
+
export { getActionPlanItems, getActionPlanItems_imperative, getActionPlanStatusInfo, getActionPlanStatusInfo_imperative, getActionPlanTemplateItemsLabel, getActionPlanTemplateItemsLabel_imperative, getActionPlans, getActionPlans_imperative, updateActionPlanTasks, updateActionPlanTemplateTasks };
|
|
2013
|
+
// version: 0.1.0-dev1-c978a7b010
|