@salesforce/lds-adapters-starter-solution-recipes 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/starter-solution-recipes.js +1159 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/postSolutionLibraryRecipes.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectSolutionLibraryRecipes.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/SolutionLibraryErrorRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/SolutionLibraryFilterInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/SolutionLibraryInputRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/SolutionLibraryOutputRepresentation.d.ts +54 -0
- package/dist/es/es2018/types/src/generated/types/SolutionLibraryPageReferenceRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/SolutionLibraryRecipeRepresentation.d.ts +73 -0
- package/dist/es/es2018/types/src/generated/types/SolutionRecipeActionParamsRepresentation.d.ts +63 -0
- package/dist/es/es2018/types/src/generated/types/SolutionRecipeActionRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +66 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +1187 -0
- package/src/raml/api.raml +227 -0
- package/src/raml/luvio.raml +21 -0
|
@@ -0,0 +1,1159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$1, typeCheckConfig as typeCheckConfig$1 } from '@luvio/engine';
|
|
8
|
+
|
|
9
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
11
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
12
|
+
/**
|
|
13
|
+
* Validates an adapter config is well-formed.
|
|
14
|
+
* @param config The config to validate.
|
|
15
|
+
* @param adapter The adapter validation configuration.
|
|
16
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
17
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
18
|
+
*/
|
|
19
|
+
function validateConfig(config, adapter, oneOf) {
|
|
20
|
+
const { displayName } = adapter;
|
|
21
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
22
|
+
if (config === undefined ||
|
|
23
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
24
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
25
|
+
}
|
|
26
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
27
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
28
|
+
}
|
|
29
|
+
if (unsupported !== undefined &&
|
|
30
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
31
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
const supported = required.concat(optional);
|
|
34
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
35
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function untrustedIsObject(untrusted) {
|
|
39
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
40
|
+
}
|
|
41
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
42
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
43
|
+
}
|
|
44
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
45
|
+
return {
|
|
46
|
+
name,
|
|
47
|
+
required,
|
|
48
|
+
resourceType,
|
|
49
|
+
typeCheckShape,
|
|
50
|
+
isArrayShape,
|
|
51
|
+
coerceFn,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
55
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
56
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
57
|
+
return {
|
|
58
|
+
displayName,
|
|
59
|
+
parameters: {
|
|
60
|
+
required,
|
|
61
|
+
optional,
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const keyPrefix = 'solution-recipes';
|
|
66
|
+
|
|
67
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
68
|
+
const { isArray: ArrayIsArray } = Array;
|
|
69
|
+
function equalsArray(a, b, equalsItem) {
|
|
70
|
+
const aLength = a.length;
|
|
71
|
+
const bLength = b.length;
|
|
72
|
+
if (aLength !== bLength) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
for (let i = 0; i < aLength; i++) {
|
|
76
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
function equalsObject(a, b, equalsProp) {
|
|
83
|
+
const aKeys = ObjectKeys(a).sort();
|
|
84
|
+
const bKeys = ObjectKeys(b).sort();
|
|
85
|
+
const aKeysLength = aKeys.length;
|
|
86
|
+
const bKeysLength = bKeys.length;
|
|
87
|
+
if (aKeysLength !== bKeysLength) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
91
|
+
const key = aKeys[i];
|
|
92
|
+
if (key !== bKeys[i]) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
if (equalsProp(a[key], b[key]) === false) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
function createLink(ref) {
|
|
102
|
+
return {
|
|
103
|
+
__ref: serializeStructuredKey(ref),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function validate$6(obj, path = 'SolutionLibraryFilterInputRepresentation') {
|
|
108
|
+
const v_error = (() => {
|
|
109
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
110
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
111
|
+
}
|
|
112
|
+
if (obj.bookMarked !== undefined) {
|
|
113
|
+
const obj_bookMarked = obj.bookMarked;
|
|
114
|
+
const path_bookMarked = path + '.bookMarked';
|
|
115
|
+
if (typeof obj_bookMarked !== 'boolean') {
|
|
116
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_bookMarked + '" (at "' + path_bookMarked + '")');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (obj.clouds !== undefined) {
|
|
120
|
+
const obj_clouds = obj.clouds;
|
|
121
|
+
const path_clouds = path + '.clouds';
|
|
122
|
+
if (!ArrayIsArray(obj_clouds)) {
|
|
123
|
+
return new TypeError('Expected "array" but received "' + typeof obj_clouds + '" (at "' + path_clouds + '")');
|
|
124
|
+
}
|
|
125
|
+
for (let i = 0; i < obj_clouds.length; i++) {
|
|
126
|
+
const obj_clouds_item = obj_clouds[i];
|
|
127
|
+
const path_clouds_item = path_clouds + '[' + i + ']';
|
|
128
|
+
if (typeof obj_clouds_item !== 'string') {
|
|
129
|
+
return new TypeError('Expected "string" but received "' + typeof obj_clouds_item + '" (at "' + path_clouds_item + '")');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (obj.markedAsDone !== undefined) {
|
|
134
|
+
const obj_markedAsDone = obj.markedAsDone;
|
|
135
|
+
const path_markedAsDone = path + '.markedAsDone';
|
|
136
|
+
if (typeof obj_markedAsDone !== 'boolean') {
|
|
137
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_markedAsDone + '" (at "' + path_markedAsDone + '")');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
})();
|
|
141
|
+
return v_error === undefined ? null : v_error;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const VERSION$5 = "deb9e2640d87eef8846f028fcf2e32d3";
|
|
145
|
+
function validate$5(obj, path = 'SolutionLibraryErrorRepresentation') {
|
|
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_code = obj.code;
|
|
151
|
+
const path_code = path + '.code';
|
|
152
|
+
if (typeof obj_code !== 'string') {
|
|
153
|
+
return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
|
|
154
|
+
}
|
|
155
|
+
const obj_message = obj.message;
|
|
156
|
+
const path_message = path + '.message';
|
|
157
|
+
if (typeof obj_message !== 'string') {
|
|
158
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
159
|
+
}
|
|
160
|
+
})();
|
|
161
|
+
return v_error === undefined ? null : v_error;
|
|
162
|
+
}
|
|
163
|
+
const select$6 = function SolutionLibraryErrorRepresentationSelect() {
|
|
164
|
+
return {
|
|
165
|
+
kind: 'Fragment',
|
|
166
|
+
version: VERSION$5,
|
|
167
|
+
private: [],
|
|
168
|
+
selections: [
|
|
169
|
+
{
|
|
170
|
+
name: 'code',
|
|
171
|
+
kind: 'Scalar'
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'message',
|
|
175
|
+
kind: 'Scalar'
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
function equals$5(existing, incoming) {
|
|
181
|
+
const existing_code = existing.code;
|
|
182
|
+
const incoming_code = incoming.code;
|
|
183
|
+
if (!(existing_code === incoming_code)) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
const existing_message = existing.message;
|
|
187
|
+
const incoming_message = incoming.message;
|
|
188
|
+
if (!(existing_message === incoming_message)) {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const VERSION$4 = "6f2b19ff90e46c3e647132b30ffe615a";
|
|
195
|
+
function validate$4(obj, path = 'SolutionLibraryPageReferenceRepresentation') {
|
|
196
|
+
const v_error = (() => {
|
|
197
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
198
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
199
|
+
}
|
|
200
|
+
const obj_attributes = obj.attributes;
|
|
201
|
+
const path_attributes = path + '.attributes';
|
|
202
|
+
if (typeof obj_attributes !== 'object' || ArrayIsArray(obj_attributes) || obj_attributes === null) {
|
|
203
|
+
return new TypeError('Expected "object" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
|
|
204
|
+
}
|
|
205
|
+
const obj_attributes_keys = ObjectKeys(obj_attributes);
|
|
206
|
+
for (let i = 0; i < obj_attributes_keys.length; i++) {
|
|
207
|
+
const key = obj_attributes_keys[i];
|
|
208
|
+
const obj_attributes_prop = obj_attributes[key];
|
|
209
|
+
const path_attributes_prop = path_attributes + '["' + key + '"]';
|
|
210
|
+
if (typeof obj_attributes_prop !== 'string') {
|
|
211
|
+
return new TypeError('Expected "string" but received "' + typeof obj_attributes_prop + '" (at "' + path_attributes_prop + '")');
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const obj_type = obj.type;
|
|
215
|
+
const path_type = path + '.type';
|
|
216
|
+
if (typeof obj_type !== 'string') {
|
|
217
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
218
|
+
}
|
|
219
|
+
})();
|
|
220
|
+
return v_error === undefined ? null : v_error;
|
|
221
|
+
}
|
|
222
|
+
const select$5 = function SolutionLibraryPageReferenceRepresentationSelect() {
|
|
223
|
+
return {
|
|
224
|
+
kind: 'Fragment',
|
|
225
|
+
version: VERSION$4,
|
|
226
|
+
private: [],
|
|
227
|
+
selections: [
|
|
228
|
+
{
|
|
229
|
+
name: 'attributes',
|
|
230
|
+
kind: 'Scalar',
|
|
231
|
+
map: true
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: 'type',
|
|
235
|
+
kind: 'Scalar'
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
function equals$4(existing, incoming) {
|
|
241
|
+
const existing_type = existing.type;
|
|
242
|
+
const incoming_type = incoming.type;
|
|
243
|
+
if (!(existing_type === incoming_type)) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
const existing_attributes = existing.attributes;
|
|
247
|
+
const incoming_attributes = incoming.attributes;
|
|
248
|
+
const equals_attributes_props = equalsObject(existing_attributes, incoming_attributes, (existing_attributes_prop, incoming_attributes_prop) => {
|
|
249
|
+
if (!(existing_attributes_prop === incoming_attributes_prop)) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
if (equals_attributes_props === false) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const VERSION$3 = "dfddf07b11ab903a46c7e322d1376f05";
|
|
260
|
+
function validate$3(obj, path = 'SolutionRecipeActionParamsRepresentation') {
|
|
261
|
+
const v_error = (() => {
|
|
262
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
263
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
264
|
+
}
|
|
265
|
+
if (obj.id !== undefined) {
|
|
266
|
+
const obj_id = obj.id;
|
|
267
|
+
const path_id = path + '.id';
|
|
268
|
+
if (typeof obj_id !== 'string') {
|
|
269
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if (obj.index !== undefined) {
|
|
273
|
+
const obj_index = obj.index;
|
|
274
|
+
const path_index = path + '.index';
|
|
275
|
+
if (typeof obj_index !== 'number' || (typeof obj_index === 'number' && Math.floor(obj_index) !== obj_index)) {
|
|
276
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_index + '" (at "' + path_index + '")');
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (obj.isDeclarative !== undefined) {
|
|
280
|
+
const obj_isDeclarative = obj.isDeclarative;
|
|
281
|
+
const path_isDeclarative = path + '.isDeclarative';
|
|
282
|
+
if (typeof obj_isDeclarative !== 'boolean') {
|
|
283
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isDeclarative + '" (at "' + path_isDeclarative + '")');
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (obj.isFolder !== undefined) {
|
|
287
|
+
const obj_isFolder = obj.isFolder;
|
|
288
|
+
const path_isFolder = path + '.isFolder';
|
|
289
|
+
if (typeof obj_isFolder !== 'boolean') {
|
|
290
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isFolder + '" (at "' + path_isFolder + '")');
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
if (obj.lsf !== undefined) {
|
|
294
|
+
const obj_lsf = obj.lsf;
|
|
295
|
+
const path_lsf = path + '.lsf';
|
|
296
|
+
if (typeof obj_lsf !== 'string') {
|
|
297
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lsf + '" (at "' + path_lsf + '")');
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (obj.lsfParams !== undefined) {
|
|
301
|
+
const obj_lsfParams = obj.lsfParams;
|
|
302
|
+
const path_lsfParams = path + '.lsfParams';
|
|
303
|
+
if (typeof obj_lsfParams !== 'object' || ArrayIsArray(obj_lsfParams) || obj_lsfParams === null) {
|
|
304
|
+
return new TypeError('Expected "object" but received "' + typeof obj_lsfParams + '" (at "' + path_lsfParams + '")');
|
|
305
|
+
}
|
|
306
|
+
const obj_lsfParams_keys = ObjectKeys(obj_lsfParams);
|
|
307
|
+
for (let i = 0; i < obj_lsfParams_keys.length; i++) {
|
|
308
|
+
const key = obj_lsfParams_keys[i];
|
|
309
|
+
const obj_lsfParams_prop = obj_lsfParams[key];
|
|
310
|
+
const path_lsfParams_prop = path_lsfParams + '["' + key + '"]';
|
|
311
|
+
if (typeof obj_lsfParams_prop !== 'string') {
|
|
312
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lsfParams_prop + '" (at "' + path_lsfParams_prop + '")');
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (obj.name !== undefined) {
|
|
317
|
+
const obj_name = obj.name;
|
|
318
|
+
const path_name = path + '.name';
|
|
319
|
+
if (typeof obj_name !== 'string') {
|
|
320
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (obj.pageReference !== undefined) {
|
|
324
|
+
const obj_pageReference = obj.pageReference;
|
|
325
|
+
const path_pageReference = path + '.pageReference';
|
|
326
|
+
const referencepath_pageReferenceValidationError = validate$4(obj_pageReference, path_pageReference);
|
|
327
|
+
if (referencepath_pageReferenceValidationError !== null) {
|
|
328
|
+
let message = 'Object doesn\'t match SolutionLibraryPageReferenceRepresentation (at "' + path_pageReference + '")\n';
|
|
329
|
+
message += referencepath_pageReferenceValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
330
|
+
return new TypeError(message);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (obj.pubSubEvents !== undefined) {
|
|
334
|
+
const obj_pubSubEvents = obj.pubSubEvents;
|
|
335
|
+
const path_pubSubEvents = path + '.pubSubEvents';
|
|
336
|
+
if (typeof obj_pubSubEvents !== 'string') {
|
|
337
|
+
return new TypeError('Expected "string" but received "' + typeof obj_pubSubEvents + '" (at "' + path_pubSubEvents + '")');
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if (obj.stepId !== undefined) {
|
|
341
|
+
const obj_stepId = obj.stepId;
|
|
342
|
+
const path_stepId = path + '.stepId';
|
|
343
|
+
if (typeof obj_stepId !== 'string') {
|
|
344
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stepId + '" (at "' + path_stepId + '")');
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
if (obj.url !== undefined) {
|
|
348
|
+
const obj_url = obj.url;
|
|
349
|
+
const path_url = path + '.url';
|
|
350
|
+
if (typeof obj_url !== 'string') {
|
|
351
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
})();
|
|
355
|
+
return v_error === undefined ? null : v_error;
|
|
356
|
+
}
|
|
357
|
+
const select$4 = function SolutionRecipeActionParamsRepresentationSelect() {
|
|
358
|
+
const { selections: SolutionLibraryPageReferenceRepresentation__selections, opaque: SolutionLibraryPageReferenceRepresentation__opaque, } = select$5();
|
|
359
|
+
return {
|
|
360
|
+
kind: 'Fragment',
|
|
361
|
+
version: VERSION$3,
|
|
362
|
+
private: [],
|
|
363
|
+
selections: [
|
|
364
|
+
{
|
|
365
|
+
name: 'id',
|
|
366
|
+
kind: 'Scalar',
|
|
367
|
+
required: false
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
name: 'index',
|
|
371
|
+
kind: 'Scalar',
|
|
372
|
+
required: false
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
name: 'isDeclarative',
|
|
376
|
+
kind: 'Scalar',
|
|
377
|
+
required: false
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
name: 'isFolder',
|
|
381
|
+
kind: 'Scalar',
|
|
382
|
+
required: false
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: 'lsf',
|
|
386
|
+
kind: 'Scalar',
|
|
387
|
+
required: false
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: 'lsfParams',
|
|
391
|
+
kind: 'Scalar',
|
|
392
|
+
map: true,
|
|
393
|
+
required: false
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
name: 'name',
|
|
397
|
+
kind: 'Scalar',
|
|
398
|
+
required: false
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: 'pageReference',
|
|
402
|
+
kind: 'Object',
|
|
403
|
+
selections: SolutionLibraryPageReferenceRepresentation__selections,
|
|
404
|
+
required: false
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: 'pubSubEvents',
|
|
408
|
+
kind: 'Scalar',
|
|
409
|
+
required: false
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
name: 'stepId',
|
|
413
|
+
kind: 'Scalar',
|
|
414
|
+
required: false
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: 'url',
|
|
418
|
+
kind: 'Scalar',
|
|
419
|
+
required: false
|
|
420
|
+
}
|
|
421
|
+
]
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
function equals$3(existing, incoming) {
|
|
425
|
+
const existing_isDeclarative = existing.isDeclarative;
|
|
426
|
+
const incoming_isDeclarative = incoming.isDeclarative;
|
|
427
|
+
// if at least one of these optionals is defined
|
|
428
|
+
if (existing_isDeclarative !== undefined || incoming_isDeclarative !== undefined) {
|
|
429
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
430
|
+
// not equal
|
|
431
|
+
if (existing_isDeclarative === undefined || incoming_isDeclarative === undefined) {
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
if (!(existing_isDeclarative === incoming_isDeclarative)) {
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
const existing_isFolder = existing.isFolder;
|
|
439
|
+
const incoming_isFolder = incoming.isFolder;
|
|
440
|
+
// if at least one of these optionals is defined
|
|
441
|
+
if (existing_isFolder !== undefined || incoming_isFolder !== undefined) {
|
|
442
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
443
|
+
// not equal
|
|
444
|
+
if (existing_isFolder === undefined || incoming_isFolder === undefined) {
|
|
445
|
+
return false;
|
|
446
|
+
}
|
|
447
|
+
if (!(existing_isFolder === incoming_isFolder)) {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
const existing_index = existing.index;
|
|
452
|
+
const incoming_index = incoming.index;
|
|
453
|
+
// if at least one of these optionals is defined
|
|
454
|
+
if (existing_index !== undefined || incoming_index !== undefined) {
|
|
455
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
456
|
+
// not equal
|
|
457
|
+
if (existing_index === undefined || incoming_index === undefined) {
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
if (!(existing_index === incoming_index)) {
|
|
461
|
+
return false;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
const existing_id = existing.id;
|
|
465
|
+
const incoming_id = incoming.id;
|
|
466
|
+
// if at least one of these optionals is defined
|
|
467
|
+
if (existing_id !== undefined || incoming_id !== undefined) {
|
|
468
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
469
|
+
// not equal
|
|
470
|
+
if (existing_id === undefined || incoming_id === undefined) {
|
|
471
|
+
return false;
|
|
472
|
+
}
|
|
473
|
+
if (!(existing_id === incoming_id)) {
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
const existing_lsf = existing.lsf;
|
|
478
|
+
const incoming_lsf = incoming.lsf;
|
|
479
|
+
// if at least one of these optionals is defined
|
|
480
|
+
if (existing_lsf !== undefined || incoming_lsf !== undefined) {
|
|
481
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
482
|
+
// not equal
|
|
483
|
+
if (existing_lsf === undefined || incoming_lsf === undefined) {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
if (!(existing_lsf === incoming_lsf)) {
|
|
487
|
+
return false;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
const existing_name = existing.name;
|
|
491
|
+
const incoming_name = incoming.name;
|
|
492
|
+
// if at least one of these optionals is defined
|
|
493
|
+
if (existing_name !== undefined || incoming_name !== undefined) {
|
|
494
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
495
|
+
// not equal
|
|
496
|
+
if (existing_name === undefined || incoming_name === undefined) {
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
if (!(existing_name === incoming_name)) {
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
const existing_pubSubEvents = existing.pubSubEvents;
|
|
504
|
+
const incoming_pubSubEvents = incoming.pubSubEvents;
|
|
505
|
+
// if at least one of these optionals is defined
|
|
506
|
+
if (existing_pubSubEvents !== undefined || incoming_pubSubEvents !== undefined) {
|
|
507
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
508
|
+
// not equal
|
|
509
|
+
if (existing_pubSubEvents === undefined || incoming_pubSubEvents === undefined) {
|
|
510
|
+
return false;
|
|
511
|
+
}
|
|
512
|
+
if (!(existing_pubSubEvents === incoming_pubSubEvents)) {
|
|
513
|
+
return false;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
const existing_stepId = existing.stepId;
|
|
517
|
+
const incoming_stepId = incoming.stepId;
|
|
518
|
+
// if at least one of these optionals is defined
|
|
519
|
+
if (existing_stepId !== undefined || incoming_stepId !== undefined) {
|
|
520
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
521
|
+
// not equal
|
|
522
|
+
if (existing_stepId === undefined || incoming_stepId === undefined) {
|
|
523
|
+
return false;
|
|
524
|
+
}
|
|
525
|
+
if (!(existing_stepId === incoming_stepId)) {
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
const existing_url = existing.url;
|
|
530
|
+
const incoming_url = incoming.url;
|
|
531
|
+
// if at least one of these optionals is defined
|
|
532
|
+
if (existing_url !== undefined || incoming_url !== undefined) {
|
|
533
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
534
|
+
// not equal
|
|
535
|
+
if (existing_url === undefined || incoming_url === undefined) {
|
|
536
|
+
return false;
|
|
537
|
+
}
|
|
538
|
+
if (!(existing_url === incoming_url)) {
|
|
539
|
+
return false;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
const existing_lsfParams = existing.lsfParams;
|
|
543
|
+
const incoming_lsfParams = incoming.lsfParams;
|
|
544
|
+
// if at least one of these optionals is defined
|
|
545
|
+
if (existing_lsfParams !== undefined || incoming_lsfParams !== undefined) {
|
|
546
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
547
|
+
// not equal
|
|
548
|
+
if (existing_lsfParams === undefined || incoming_lsfParams === undefined) {
|
|
549
|
+
return false;
|
|
550
|
+
}
|
|
551
|
+
const equals_lsfParams_props = equalsObject(existing_lsfParams, incoming_lsfParams, (existing_lsfParams_prop, incoming_lsfParams_prop) => {
|
|
552
|
+
if (!(existing_lsfParams_prop === incoming_lsfParams_prop)) {
|
|
553
|
+
return false;
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
if (equals_lsfParams_props === false) {
|
|
557
|
+
return false;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
const existing_pageReference = existing.pageReference;
|
|
561
|
+
const incoming_pageReference = incoming.pageReference;
|
|
562
|
+
// if at least one of these optionals is defined
|
|
563
|
+
if (existing_pageReference !== undefined || incoming_pageReference !== undefined) {
|
|
564
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
565
|
+
// not equal
|
|
566
|
+
if (existing_pageReference === undefined || incoming_pageReference === undefined) {
|
|
567
|
+
return false;
|
|
568
|
+
}
|
|
569
|
+
if (!(equals$4(existing_pageReference, incoming_pageReference))) {
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return true;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
const VERSION$2 = "093239ddf995094f84ebe2556ec42b34";
|
|
577
|
+
function validate$2(obj, path = 'SolutionRecipeActionRepresentation') {
|
|
578
|
+
const v_error = (() => {
|
|
579
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
580
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
581
|
+
}
|
|
582
|
+
if (obj.params !== undefined) {
|
|
583
|
+
const obj_params = obj.params;
|
|
584
|
+
const path_params = path + '.params';
|
|
585
|
+
const referencepath_paramsValidationError = validate$3(obj_params, path_params);
|
|
586
|
+
if (referencepath_paramsValidationError !== null) {
|
|
587
|
+
let message = 'Object doesn\'t match SolutionRecipeActionParamsRepresentation (at "' + path_params + '")\n';
|
|
588
|
+
message += referencepath_paramsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
589
|
+
return new TypeError(message);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
const obj_type = obj.type;
|
|
593
|
+
const path_type = path + '.type';
|
|
594
|
+
if (typeof obj_type !== 'string') {
|
|
595
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
596
|
+
}
|
|
597
|
+
})();
|
|
598
|
+
return v_error === undefined ? null : v_error;
|
|
599
|
+
}
|
|
600
|
+
const select$3 = function SolutionRecipeActionRepresentationSelect() {
|
|
601
|
+
const { selections: SolutionRecipeActionParamsRepresentation__selections, opaque: SolutionRecipeActionParamsRepresentation__opaque, } = select$4();
|
|
602
|
+
return {
|
|
603
|
+
kind: 'Fragment',
|
|
604
|
+
version: VERSION$2,
|
|
605
|
+
private: [],
|
|
606
|
+
selections: [
|
|
607
|
+
{
|
|
608
|
+
name: 'params',
|
|
609
|
+
kind: 'Object',
|
|
610
|
+
selections: SolutionRecipeActionParamsRepresentation__selections,
|
|
611
|
+
required: false
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
name: 'type',
|
|
615
|
+
kind: 'Scalar'
|
|
616
|
+
}
|
|
617
|
+
]
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
function equals$2(existing, incoming) {
|
|
621
|
+
const existing_type = existing.type;
|
|
622
|
+
const incoming_type = incoming.type;
|
|
623
|
+
if (!(existing_type === incoming_type)) {
|
|
624
|
+
return false;
|
|
625
|
+
}
|
|
626
|
+
const existing_params = existing.params;
|
|
627
|
+
const incoming_params = incoming.params;
|
|
628
|
+
// if at least one of these optionals is defined
|
|
629
|
+
if (existing_params !== undefined || incoming_params !== undefined) {
|
|
630
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
631
|
+
// not equal
|
|
632
|
+
if (existing_params === undefined || incoming_params === undefined) {
|
|
633
|
+
return false;
|
|
634
|
+
}
|
|
635
|
+
if (!(equals$3(existing_params, incoming_params))) {
|
|
636
|
+
return false;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
return true;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
const VERSION$1 = "f8503a533562a0754b07845c810b7f60";
|
|
643
|
+
function validate$1(obj, path = 'SolutionLibraryRecipeRepresentation') {
|
|
644
|
+
const v_error = (() => {
|
|
645
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
646
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
647
|
+
}
|
|
648
|
+
const obj_action = obj.action;
|
|
649
|
+
const path_action = path + '.action';
|
|
650
|
+
const referencepath_actionValidationError = validate$2(obj_action, path_action);
|
|
651
|
+
if (referencepath_actionValidationError !== null) {
|
|
652
|
+
let message = 'Object doesn\'t match SolutionRecipeActionRepresentation (at "' + path_action + '")\n';
|
|
653
|
+
message += referencepath_actionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
654
|
+
return new TypeError(message);
|
|
655
|
+
}
|
|
656
|
+
const obj_description = obj.description;
|
|
657
|
+
const path_description = path + '.description';
|
|
658
|
+
if (typeof obj_description !== 'string') {
|
|
659
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
660
|
+
}
|
|
661
|
+
const obj_icon = obj.icon;
|
|
662
|
+
const path_icon = path + '.icon';
|
|
663
|
+
if (typeof obj_icon !== 'string') {
|
|
664
|
+
return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
|
|
665
|
+
}
|
|
666
|
+
const obj_iconAltText = obj.iconAltText;
|
|
667
|
+
const path_iconAltText = path + '.iconAltText';
|
|
668
|
+
if (typeof obj_iconAltText !== 'string') {
|
|
669
|
+
return new TypeError('Expected "string" but received "' + typeof obj_iconAltText + '" (at "' + path_iconAltText + '")');
|
|
670
|
+
}
|
|
671
|
+
const obj_iconStyle = obj.iconStyle;
|
|
672
|
+
const path_iconStyle = path + '.iconStyle';
|
|
673
|
+
if (typeof obj_iconStyle !== 'string') {
|
|
674
|
+
return new TypeError('Expected "string" but received "' + typeof obj_iconStyle + '" (at "' + path_iconStyle + '")');
|
|
675
|
+
}
|
|
676
|
+
const obj_id = obj.id;
|
|
677
|
+
const path_id = path + '.id';
|
|
678
|
+
if (typeof obj_id !== 'string') {
|
|
679
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
680
|
+
}
|
|
681
|
+
const obj_isBookmarked = obj.isBookmarked;
|
|
682
|
+
const path_isBookmarked = path + '.isBookmarked';
|
|
683
|
+
if (typeof obj_isBookmarked !== 'boolean') {
|
|
684
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isBookmarked + '" (at "' + path_isBookmarked + '")');
|
|
685
|
+
}
|
|
686
|
+
const obj_isMarkedAsComplete = obj.isMarkedAsComplete;
|
|
687
|
+
const path_isMarkedAsComplete = path + '.isMarkedAsComplete';
|
|
688
|
+
if (typeof obj_isMarkedAsComplete !== 'boolean') {
|
|
689
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isMarkedAsComplete + '" (at "' + path_isMarkedAsComplete + '")');
|
|
690
|
+
}
|
|
691
|
+
const obj_recipeId = obj.recipeId;
|
|
692
|
+
const path_recipeId = path + '.recipeId';
|
|
693
|
+
if (typeof obj_recipeId !== 'string') {
|
|
694
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recipeId + '" (at "' + path_recipeId + '")');
|
|
695
|
+
}
|
|
696
|
+
const obj_score = obj.score;
|
|
697
|
+
const path_score = path + '.score';
|
|
698
|
+
if (typeof obj_score !== 'number' || (typeof obj_score === 'number' && Math.floor(obj_score) !== obj_score)) {
|
|
699
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_score + '" (at "' + path_score + '")');
|
|
700
|
+
}
|
|
701
|
+
const obj_state = obj.state;
|
|
702
|
+
const path_state = path + '.state';
|
|
703
|
+
if (typeof obj_state !== 'string') {
|
|
704
|
+
return new TypeError('Expected "string" but received "' + typeof obj_state + '" (at "' + path_state + '")');
|
|
705
|
+
}
|
|
706
|
+
const obj_tagId = obj.tagId;
|
|
707
|
+
const path_tagId = path + '.tagId';
|
|
708
|
+
if (!ArrayIsArray(obj_tagId)) {
|
|
709
|
+
return new TypeError('Expected "array" but received "' + typeof obj_tagId + '" (at "' + path_tagId + '")');
|
|
710
|
+
}
|
|
711
|
+
for (let i = 0; i < obj_tagId.length; i++) {
|
|
712
|
+
const obj_tagId_item = obj_tagId[i];
|
|
713
|
+
const path_tagId_item = path_tagId + '[' + i + ']';
|
|
714
|
+
if (typeof obj_tagId_item !== 'string') {
|
|
715
|
+
return new TypeError('Expected "string" but received "' + typeof obj_tagId_item + '" (at "' + path_tagId_item + '")');
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
const obj_title = obj.title;
|
|
719
|
+
const path_title = path + '.title';
|
|
720
|
+
if (typeof obj_title !== 'string') {
|
|
721
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
722
|
+
}
|
|
723
|
+
})();
|
|
724
|
+
return v_error === undefined ? null : v_error;
|
|
725
|
+
}
|
|
726
|
+
const RepresentationType$1 = 'SolutionLibraryRecipeRepresentation';
|
|
727
|
+
function keyBuilder$1(luvio, config) {
|
|
728
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
|
|
729
|
+
}
|
|
730
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
731
|
+
const keyParams = {
|
|
732
|
+
id: object.id
|
|
733
|
+
};
|
|
734
|
+
return keyBuilder$1(luvio, keyParams);
|
|
735
|
+
}
|
|
736
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
737
|
+
return input;
|
|
738
|
+
}
|
|
739
|
+
const select$2 = function SolutionLibraryRecipeRepresentationSelect() {
|
|
740
|
+
const { selections: SolutionRecipeActionRepresentation__selections, opaque: SolutionRecipeActionRepresentation__opaque, } = select$3();
|
|
741
|
+
return {
|
|
742
|
+
kind: 'Fragment',
|
|
743
|
+
version: VERSION$1,
|
|
744
|
+
private: [],
|
|
745
|
+
selections: [
|
|
746
|
+
{
|
|
747
|
+
name: 'action',
|
|
748
|
+
kind: 'Object',
|
|
749
|
+
selections: SolutionRecipeActionRepresentation__selections
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
name: 'description',
|
|
753
|
+
kind: 'Scalar'
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
name: 'icon',
|
|
757
|
+
kind: 'Scalar'
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
name: 'iconAltText',
|
|
761
|
+
kind: 'Scalar'
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
name: 'iconStyle',
|
|
765
|
+
kind: 'Scalar'
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
name: 'id',
|
|
769
|
+
kind: 'Scalar'
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
name: 'isBookmarked',
|
|
773
|
+
kind: 'Scalar'
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
name: 'isMarkedAsComplete',
|
|
777
|
+
kind: 'Scalar'
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
name: 'recipeId',
|
|
781
|
+
kind: 'Scalar'
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
name: 'score',
|
|
785
|
+
kind: 'Scalar'
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
name: 'state',
|
|
789
|
+
kind: 'Scalar'
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
name: 'tagId',
|
|
793
|
+
kind: 'Scalar',
|
|
794
|
+
plural: true
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
name: 'title',
|
|
798
|
+
kind: 'Scalar'
|
|
799
|
+
}
|
|
800
|
+
]
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
function equals$1(existing, incoming) {
|
|
804
|
+
const existing_isBookmarked = existing.isBookmarked;
|
|
805
|
+
const incoming_isBookmarked = incoming.isBookmarked;
|
|
806
|
+
if (!(existing_isBookmarked === incoming_isBookmarked)) {
|
|
807
|
+
return false;
|
|
808
|
+
}
|
|
809
|
+
const existing_isMarkedAsComplete = existing.isMarkedAsComplete;
|
|
810
|
+
const incoming_isMarkedAsComplete = incoming.isMarkedAsComplete;
|
|
811
|
+
if (!(existing_isMarkedAsComplete === incoming_isMarkedAsComplete)) {
|
|
812
|
+
return false;
|
|
813
|
+
}
|
|
814
|
+
const existing_score = existing.score;
|
|
815
|
+
const incoming_score = incoming.score;
|
|
816
|
+
if (!(existing_score === incoming_score)) {
|
|
817
|
+
return false;
|
|
818
|
+
}
|
|
819
|
+
const existing_description = existing.description;
|
|
820
|
+
const incoming_description = incoming.description;
|
|
821
|
+
if (!(existing_description === incoming_description)) {
|
|
822
|
+
return false;
|
|
823
|
+
}
|
|
824
|
+
const existing_icon = existing.icon;
|
|
825
|
+
const incoming_icon = incoming.icon;
|
|
826
|
+
if (!(existing_icon === incoming_icon)) {
|
|
827
|
+
return false;
|
|
828
|
+
}
|
|
829
|
+
const existing_iconAltText = existing.iconAltText;
|
|
830
|
+
const incoming_iconAltText = incoming.iconAltText;
|
|
831
|
+
if (!(existing_iconAltText === incoming_iconAltText)) {
|
|
832
|
+
return false;
|
|
833
|
+
}
|
|
834
|
+
const existing_iconStyle = existing.iconStyle;
|
|
835
|
+
const incoming_iconStyle = incoming.iconStyle;
|
|
836
|
+
if (!(existing_iconStyle === incoming_iconStyle)) {
|
|
837
|
+
return false;
|
|
838
|
+
}
|
|
839
|
+
const existing_id = existing.id;
|
|
840
|
+
const incoming_id = incoming.id;
|
|
841
|
+
if (!(existing_id === incoming_id)) {
|
|
842
|
+
return false;
|
|
843
|
+
}
|
|
844
|
+
const existing_recipeId = existing.recipeId;
|
|
845
|
+
const incoming_recipeId = incoming.recipeId;
|
|
846
|
+
if (!(existing_recipeId === incoming_recipeId)) {
|
|
847
|
+
return false;
|
|
848
|
+
}
|
|
849
|
+
const existing_state = existing.state;
|
|
850
|
+
const incoming_state = incoming.state;
|
|
851
|
+
if (!(existing_state === incoming_state)) {
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
const existing_title = existing.title;
|
|
855
|
+
const incoming_title = incoming.title;
|
|
856
|
+
if (!(existing_title === incoming_title)) {
|
|
857
|
+
return false;
|
|
858
|
+
}
|
|
859
|
+
const existing_action = existing.action;
|
|
860
|
+
const incoming_action = incoming.action;
|
|
861
|
+
if (!(equals$2(existing_action, incoming_action))) {
|
|
862
|
+
return false;
|
|
863
|
+
}
|
|
864
|
+
const existing_tagId = existing.tagId;
|
|
865
|
+
const incoming_tagId = incoming.tagId;
|
|
866
|
+
const equals_tagId_items = equalsArray(existing_tagId, incoming_tagId, (existing_tagId_item, incoming_tagId_item) => {
|
|
867
|
+
if (!(existing_tagId_item === incoming_tagId_item)) {
|
|
868
|
+
return false;
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
if (equals_tagId_items === false) {
|
|
872
|
+
return false;
|
|
873
|
+
}
|
|
874
|
+
return true;
|
|
875
|
+
}
|
|
876
|
+
const ingest$1 = function SolutionLibraryRecipeRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
877
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
878
|
+
const validateError = validate$1(input);
|
|
879
|
+
if (validateError !== null) {
|
|
880
|
+
throw validateError;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
884
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 1000;
|
|
885
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "solution-recipes", VERSION$1, RepresentationType$1, equals$1);
|
|
886
|
+
return createLink(key);
|
|
887
|
+
};
|
|
888
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
889
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
890
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
891
|
+
rootKeySet.set(rootKey, {
|
|
892
|
+
namespace: keyPrefix,
|
|
893
|
+
representationName: RepresentationType$1,
|
|
894
|
+
mergeable: false
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
const VERSION = "9e6d2fd679515b62b1f6ae0f9b4b3d26";
|
|
899
|
+
function validate(obj, path = 'SolutionLibraryOutputRepresentation') {
|
|
900
|
+
const v_error = (() => {
|
|
901
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
902
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
903
|
+
}
|
|
904
|
+
if (obj.error !== undefined) {
|
|
905
|
+
const obj_error = obj.error;
|
|
906
|
+
const path_error = path + '.error';
|
|
907
|
+
const referencepath_errorValidationError = validate$5(obj_error, path_error);
|
|
908
|
+
if (referencepath_errorValidationError !== null) {
|
|
909
|
+
let message = 'Object doesn\'t match SolutionLibraryErrorRepresentation (at "' + path_error + '")\n';
|
|
910
|
+
message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
911
|
+
return new TypeError(message);
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
const obj_isSuccess = obj.isSuccess;
|
|
915
|
+
const path_isSuccess = path + '.isSuccess';
|
|
916
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
917
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
918
|
+
}
|
|
919
|
+
if (obj.recipes !== undefined) {
|
|
920
|
+
const obj_recipes = obj.recipes;
|
|
921
|
+
const path_recipes = path + '.recipes';
|
|
922
|
+
if (!ArrayIsArray(obj_recipes)) {
|
|
923
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recipes + '" (at "' + path_recipes + '")');
|
|
924
|
+
}
|
|
925
|
+
for (let i = 0; i < obj_recipes.length; i++) {
|
|
926
|
+
const obj_recipes_item = obj_recipes[i];
|
|
927
|
+
const path_recipes_item = path_recipes + '[' + i + ']';
|
|
928
|
+
if (typeof obj_recipes_item !== 'object' || Array.isArray(obj_recipes_item)) {
|
|
929
|
+
return new TypeError('Expected "object" but received "' + typeof obj_recipes_item + '" (at "' + path_recipes_item + '")');
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
})();
|
|
934
|
+
return v_error === undefined ? null : v_error;
|
|
935
|
+
}
|
|
936
|
+
const RepresentationType = 'SolutionLibraryOutputRepresentation';
|
|
937
|
+
function keyBuilder(luvio, config) {
|
|
938
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.isSuccess;
|
|
939
|
+
}
|
|
940
|
+
function keyBuilderFromType(luvio, object) {
|
|
941
|
+
const keyParams = {
|
|
942
|
+
isSuccess: object.isSuccess
|
|
943
|
+
};
|
|
944
|
+
return keyBuilder(luvio, keyParams);
|
|
945
|
+
}
|
|
946
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
947
|
+
const input_recipes = input.recipes;
|
|
948
|
+
const input_recipes_id = path.fullPath + '__recipes';
|
|
949
|
+
if (input_recipes !== undefined) {
|
|
950
|
+
for (let i = 0; i < input_recipes.length; i++) {
|
|
951
|
+
const input_recipes_item = input_recipes[i];
|
|
952
|
+
let input_recipes_item_id = input_recipes_id + '__' + i;
|
|
953
|
+
input_recipes[i] = ingest$1(input_recipes_item, {
|
|
954
|
+
fullPath: input_recipes_item_id,
|
|
955
|
+
propertyName: i,
|
|
956
|
+
parent: {
|
|
957
|
+
data: input,
|
|
958
|
+
key: path.fullPath,
|
|
959
|
+
existing: existing,
|
|
960
|
+
},
|
|
961
|
+
ttl: path.ttl
|
|
962
|
+
}, luvio, store, timestamp);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
return input;
|
|
966
|
+
}
|
|
967
|
+
const select$1 = function SolutionLibraryOutputRepresentationSelect() {
|
|
968
|
+
const { selections: SolutionLibraryErrorRepresentation__selections, opaque: SolutionLibraryErrorRepresentation__opaque, } = select$6();
|
|
969
|
+
return {
|
|
970
|
+
kind: 'Fragment',
|
|
971
|
+
version: VERSION,
|
|
972
|
+
private: [],
|
|
973
|
+
selections: [
|
|
974
|
+
{
|
|
975
|
+
name: 'error',
|
|
976
|
+
kind: 'Object',
|
|
977
|
+
selections: SolutionLibraryErrorRepresentation__selections,
|
|
978
|
+
required: false
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
name: 'isSuccess',
|
|
982
|
+
kind: 'Scalar'
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
name: 'recipes',
|
|
986
|
+
kind: 'Link',
|
|
987
|
+
plural: true,
|
|
988
|
+
required: false,
|
|
989
|
+
fragment: select$2()
|
|
990
|
+
}
|
|
991
|
+
]
|
|
992
|
+
};
|
|
993
|
+
};
|
|
994
|
+
function equals(existing, incoming) {
|
|
995
|
+
const existing_isSuccess = existing.isSuccess;
|
|
996
|
+
const incoming_isSuccess = incoming.isSuccess;
|
|
997
|
+
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
998
|
+
return false;
|
|
999
|
+
}
|
|
1000
|
+
const existing_error = existing.error;
|
|
1001
|
+
const incoming_error = incoming.error;
|
|
1002
|
+
// if at least one of these optionals is defined
|
|
1003
|
+
if (existing_error !== undefined || incoming_error !== undefined) {
|
|
1004
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1005
|
+
// not equal
|
|
1006
|
+
if (existing_error === undefined || incoming_error === undefined) {
|
|
1007
|
+
return false;
|
|
1008
|
+
}
|
|
1009
|
+
if (!(equals$5(existing_error, incoming_error))) {
|
|
1010
|
+
return false;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
const existing_recipes = existing.recipes;
|
|
1014
|
+
const incoming_recipes = incoming.recipes;
|
|
1015
|
+
// if at least one of these optionals is defined
|
|
1016
|
+
if (existing_recipes !== undefined || incoming_recipes !== undefined) {
|
|
1017
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1018
|
+
// not equal
|
|
1019
|
+
if (existing_recipes === undefined || incoming_recipes === undefined) {
|
|
1020
|
+
return false;
|
|
1021
|
+
}
|
|
1022
|
+
const equals_recipes_items = equalsArray(existing_recipes, incoming_recipes, (existing_recipes_item, incoming_recipes_item) => {
|
|
1023
|
+
if (!(existing_recipes_item.__ref === incoming_recipes_item.__ref)) {
|
|
1024
|
+
return false;
|
|
1025
|
+
}
|
|
1026
|
+
});
|
|
1027
|
+
if (equals_recipes_items === false) {
|
|
1028
|
+
return false;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
return true;
|
|
1032
|
+
}
|
|
1033
|
+
const ingest = function SolutionLibraryOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1034
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1035
|
+
const validateError = validate(input);
|
|
1036
|
+
if (validateError !== null) {
|
|
1037
|
+
throw validateError;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
const key = keyBuilderFromType(luvio, input);
|
|
1041
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 1000;
|
|
1042
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "solution-recipes", VERSION, RepresentationType, equals);
|
|
1043
|
+
return createLink(key);
|
|
1044
|
+
};
|
|
1045
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1046
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1047
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
1048
|
+
rootKeySet.set(rootKey, {
|
|
1049
|
+
namespace: keyPrefix,
|
|
1050
|
+
representationName: RepresentationType,
|
|
1051
|
+
mergeable: false
|
|
1052
|
+
});
|
|
1053
|
+
if (input.recipes !== undefined) {
|
|
1054
|
+
const input_recipes_length = input.recipes.length;
|
|
1055
|
+
for (let i = 0; i < input_recipes_length; i++) {
|
|
1056
|
+
getTypeCacheKeys$1(rootKeySet, luvio, input.recipes[i]);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
function select(luvio, params) {
|
|
1062
|
+
return select$1();
|
|
1063
|
+
}
|
|
1064
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1065
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1066
|
+
}
|
|
1067
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
1068
|
+
const { body } = response;
|
|
1069
|
+
const key = keyBuilderFromType(luvio, body);
|
|
1070
|
+
luvio.storeIngest(key, ingest, body);
|
|
1071
|
+
const snapshot = luvio.storeLookup({
|
|
1072
|
+
recordId: key,
|
|
1073
|
+
node: select(),
|
|
1074
|
+
variables: {},
|
|
1075
|
+
});
|
|
1076
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1077
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1078
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
deepFreeze(snapshot.data);
|
|
1082
|
+
return snapshot;
|
|
1083
|
+
}
|
|
1084
|
+
function createResourceRequest(config) {
|
|
1085
|
+
const headers = {};
|
|
1086
|
+
return {
|
|
1087
|
+
baseUri: '/services/data/v66.0',
|
|
1088
|
+
basePath: '/connect/solution-library/recipes',
|
|
1089
|
+
method: 'post',
|
|
1090
|
+
body: config.body,
|
|
1091
|
+
urlParams: {},
|
|
1092
|
+
queryParams: {},
|
|
1093
|
+
headers,
|
|
1094
|
+
priority: 'normal',
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
const adapterName = 'postSolutionLibraryRecipes';
|
|
1099
|
+
const postSolutionLibraryRecipes_ConfigPropertyMetadata = [
|
|
1100
|
+
generateParamConfigMetadata('currentRecipes', false, 2 /* Body */, 0 /* String */, true),
|
|
1101
|
+
generateParamConfigMetadata('filters', false, 2 /* Body */, 4 /* Unsupported */),
|
|
1102
|
+
generateParamConfigMetadata('offset', false, 2 /* Body */, 3 /* Integer */),
|
|
1103
|
+
generateParamConfigMetadata('section', true, 2 /* Body */, 0 /* String */),
|
|
1104
|
+
];
|
|
1105
|
+
const postSolutionLibraryRecipes_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postSolutionLibraryRecipes_ConfigPropertyMetadata);
|
|
1106
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$1(postSolutionLibraryRecipes_ConfigPropertyMetadata);
|
|
1107
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1108
|
+
const config = {};
|
|
1109
|
+
typeCheckConfig$1(untrustedConfig, config, postSolutionLibraryRecipes_ConfigPropertyMetadata);
|
|
1110
|
+
const untrustedConfig_filters = untrustedConfig.filters;
|
|
1111
|
+
const referenceSolutionLibraryFilterInputRepresentationValidationError = validate$6(untrustedConfig_filters);
|
|
1112
|
+
if (referenceSolutionLibraryFilterInputRepresentationValidationError === null) {
|
|
1113
|
+
config.filters = untrustedConfig_filters;
|
|
1114
|
+
}
|
|
1115
|
+
return config;
|
|
1116
|
+
}
|
|
1117
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1118
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1119
|
+
return null;
|
|
1120
|
+
}
|
|
1121
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1122
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1123
|
+
}
|
|
1124
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1125
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1126
|
+
return null;
|
|
1127
|
+
}
|
|
1128
|
+
return config;
|
|
1129
|
+
}
|
|
1130
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1131
|
+
const resourceParams = createResourceParams(config);
|
|
1132
|
+
const request = createResourceRequest(resourceParams);
|
|
1133
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1134
|
+
.then((response) => {
|
|
1135
|
+
return luvio.handleSuccessResponse(() => {
|
|
1136
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1137
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1138
|
+
}, () => {
|
|
1139
|
+
const cache = new StoreKeyMap();
|
|
1140
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1141
|
+
return cache;
|
|
1142
|
+
});
|
|
1143
|
+
}, (response) => {
|
|
1144
|
+
deepFreeze(response);
|
|
1145
|
+
throw response;
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
const postSolutionLibraryRecipesAdapterFactory = (luvio) => {
|
|
1149
|
+
return function postSolutionLibraryRecipes(untrustedConfig) {
|
|
1150
|
+
const config = validateAdapterConfig(untrustedConfig, postSolutionLibraryRecipes_ConfigPropertyNames);
|
|
1151
|
+
// Invalid or incomplete config
|
|
1152
|
+
if (config === null) {
|
|
1153
|
+
throw new Error('Invalid config for "postSolutionLibraryRecipes"');
|
|
1154
|
+
}
|
|
1155
|
+
return buildNetworkSnapshot(luvio, config);
|
|
1156
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
export { postSolutionLibraryRecipesAdapterFactory };
|