@salesforce/lds-adapters-platform-flow-builder 1.124.2 → 1.124.4

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.
Files changed (28) hide show
  1. package/dist/es/es2018/platform-flow-builder.js +856 -856
  2. package/dist/{types → es/es2018/types}/src/generated/adapters/adapter-utils.d.ts +66 -66
  3. package/dist/{types → es/es2018/types}/src/generated/adapters/getRules.d.ts +28 -28
  4. package/dist/{types → es/es2018/types}/src/generated/artifacts/main.d.ts +1 -1
  5. package/dist/{types → es/es2018/types}/src/generated/artifacts/sfdc.d.ts +3 -3
  6. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectInteractionBuilderRules.d.ts +17 -17
  7. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectInteractionOrchestrationInstances.d.ts +15 -15
  8. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectInteractionRuntimeNavigateFlowByFlowDevName.d.ts +22 -22
  9. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectInteractionRuntimeResumeFlowByFlowDevName.d.ts +15 -15
  10. package/dist/{types → es/es2018/types}/src/generated/resources/postConnectInteractionRuntimeStartFlowByFlowDevName.d.ts +19 -19
  11. package/dist/{types → es/es2018/types}/src/generated/types/FlowOperatorParameterRepresentation.d.ts +53 -53
  12. package/dist/{types → es/es2018/types}/src/generated/types/FlowOperatorRepresentation.d.ts +29 -29
  13. package/dist/{types → es/es2018/types}/src/generated/types/FlowOperatorRuleCollectionRepresentation.d.ts +30 -30
  14. package/dist/{types → es/es2018/types}/src/generated/types/FlowOperatorRuleRepresentation.d.ts +52 -52
  15. package/dist/{types → es/es2018/types}/src/generated/types/FlowOrchestrationInstanceCollectionRepresentation.d.ts +30 -30
  16. package/dist/{types → es/es2018/types}/src/generated/types/FlowOrchestrationInstanceRepresentation.d.ts +48 -48
  17. package/dist/{types → es/es2018/types}/src/generated/types/FlowOrchestrationStageInstanceRepresentation.d.ts +42 -42
  18. package/dist/{types → es/es2018/types}/src/generated/types/FlowOrchestrationStepInstanceRepresentation.d.ts +45 -45
  19. package/dist/{types → es/es2018/types}/src/generated/types/FlowOrchestrationWorkItemRepresentation.d.ts +53 -53
  20. package/dist/{types → es/es2018/types}/src/generated/types/FlowRuntimeNavigateRequestRepresentation.d.ts +48 -48
  21. package/dist/{types → es/es2018/types}/src/generated/types/FlowRuntimeNavigationFieldValueRepresentation.d.ts +35 -35
  22. package/dist/{types → es/es2018/types}/src/generated/types/FlowRuntimeResponseRepresentation.d.ts +32 -32
  23. package/dist/{types → es/es2018/types}/src/generated/types/type-utils.d.ts +39 -39
  24. package/package.json +5 -5
  25. package/sfdc/index.d.ts +1 -1
  26. package/sfdc/index.js +876 -876
  27. package/dist/umd/es2018/platform-flow-builder.js +0 -889
  28. package/dist/umd/es5/platform-flow-builder.js +0 -893
@@ -1,893 +0,0 @@
1
- /**
2
- * Copyright (c) 2022, Salesforce, Inc.,
3
- * All rights reserved.
4
- * For full license text, see the LICENSE.txt file
5
- */
6
-
7
- (function (global, factory) {
8
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
9
- typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
10
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["platformFlow-builder"] = {}, global.engine));
11
- })(this, (function (exports, engine) { 'use strict';
12
-
13
- var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
14
- var ObjectKeys = Object.keys;
15
- var ArrayIsArray$1 = Array.isArray;
16
- /**
17
- * Validates an adapter config is well-formed.
18
- * @param config The config to validate.
19
- * @param adapter The adapter validation configuration.
20
- * @param oneOf The keys the config must contain at least one of.
21
- * @throws A TypeError if config doesn't satisfy the adapter's config validation.
22
- */
23
- function validateConfig(config, adapter, oneOf) {
24
- var displayName = adapter.displayName;
25
- var _a = adapter.parameters, required = _a.required, optional = _a.optional, unsupported = _a.unsupported;
26
- if (config === undefined ||
27
- required.every(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
28
- throw new TypeError("adapter ".concat(displayName, " configuration must specify ").concat(required.sort().join(', ')));
29
- }
30
- if (oneOf && oneOf.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
31
- throw new TypeError("adapter ".concat(displayName, " configuration must specify one of ").concat(oneOf.sort().join(', ')));
32
- }
33
- if (unsupported !== undefined &&
34
- unsupported.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); })) {
35
- throw new TypeError("adapter ".concat(displayName, " does not yet support ").concat(unsupported.sort().join(', ')));
36
- }
37
- var supported = required.concat(optional);
38
- if (ObjectKeys(config).some(function (key) { return !supported.includes(key); })) {
39
- throw new TypeError("adapter ".concat(displayName, " configuration supports only ").concat(supported.sort().join(', ')));
40
- }
41
- }
42
- function untrustedIsObject(untrusted) {
43
- return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
44
- }
45
- function areRequiredParametersPresent(config, configPropertyNames) {
46
- return configPropertyNames.parameters.required.every(function (req) { return req in config; });
47
- }
48
- var snapshotRefreshOptions = {
49
- overrides: {
50
- headers: {
51
- 'Cache-Control': 'no-cache',
52
- },
53
- }
54
- };
55
- var keyPrefix = 'flow-builder';
56
-
57
- var ArrayIsArray = Array.isArray;
58
- function equalsArray(a, b, equalsItem) {
59
- var aLength = a.length;
60
- var bLength = b.length;
61
- if (aLength !== bLength) {
62
- return false;
63
- }
64
- for (var i = 0; i < aLength; i++) {
65
- if (equalsItem(a[i], b[i]) === false) {
66
- return false;
67
- }
68
- }
69
- return true;
70
- }
71
- function createLink(ref) {
72
- return {
73
- __ref: engine.serializeStructuredKey(ref),
74
- };
75
- }
76
-
77
- var VERSION$3 = "f21baf31691a4049568a8fd0232f6f99";
78
- function validate$3(obj, path) {
79
- if (path === void 0) { path = 'FlowOperatorRepresentation'; }
80
- var v_error = (function () {
81
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
82
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
83
- }
84
- var obj_value = obj.value;
85
- var path_value = path + '.value';
86
- var obj_value_union0 = null;
87
- var obj_value_union0_error = (function () {
88
- if (typeof obj_value !== 'string') {
89
- return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
90
- }
91
- })();
92
- if (obj_value_union0_error != null) {
93
- obj_value_union0 = obj_value_union0_error.message;
94
- }
95
- var obj_value_union1 = null;
96
- var obj_value_union1_error = (function () {
97
- if (obj_value !== null) {
98
- return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
99
- }
100
- })();
101
- if (obj_value_union1_error != null) {
102
- obj_value_union1 = obj_value_union1_error.message;
103
- }
104
- if (obj_value_union0 && obj_value_union1) {
105
- var message = 'Object doesn\'t match union (at "' + path_value + '")';
106
- message += '\n' + obj_value_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
107
- message += '\n' + obj_value_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
108
- return new TypeError(message);
109
- }
110
- })();
111
- return v_error === undefined ? null : v_error;
112
- }
113
- var select$4 = function FlowOperatorRepresentationSelect() {
114
- return {
115
- kind: 'Fragment',
116
- version: VERSION$3,
117
- private: [],
118
- selections: [
119
- {
120
- name: 'value',
121
- kind: 'Scalar'
122
- }
123
- ]
124
- };
125
- };
126
- function equals$3(existing, incoming) {
127
- var existing_value = existing.value;
128
- var incoming_value = incoming.value;
129
- if (!(existing_value === incoming_value)) {
130
- return false;
131
- }
132
- return true;
133
- }
134
-
135
- var VERSION$2 = "1fbcf3729a54064347b98620da65caee";
136
- function validate$2(obj, path) {
137
- if (path === void 0) { path = 'FlowOperatorParameterRepresentation'; }
138
- var v_error = (function () {
139
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
140
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
141
- }
142
- var obj_canBeApexProperty = obj.canBeApexProperty;
143
- var path_canBeApexProperty = path + '.canBeApexProperty';
144
- var obj_canBeApexProperty_union0 = null;
145
- var obj_canBeApexProperty_union0_error = (function () {
146
- if (typeof obj_canBeApexProperty !== 'string') {
147
- return new TypeError('Expected "string" but received "' + typeof obj_canBeApexProperty + '" (at "' + path_canBeApexProperty + '")');
148
- }
149
- })();
150
- if (obj_canBeApexProperty_union0_error != null) {
151
- obj_canBeApexProperty_union0 = obj_canBeApexProperty_union0_error.message;
152
- }
153
- var obj_canBeApexProperty_union1 = null;
154
- var obj_canBeApexProperty_union1_error = (function () {
155
- if (obj_canBeApexProperty !== null) {
156
- return new TypeError('Expected "null" but received "' + typeof obj_canBeApexProperty + '" (at "' + path_canBeApexProperty + '")');
157
- }
158
- })();
159
- if (obj_canBeApexProperty_union1_error != null) {
160
- obj_canBeApexProperty_union1 = obj_canBeApexProperty_union1_error.message;
161
- }
162
- if (obj_canBeApexProperty_union0 && obj_canBeApexProperty_union1) {
163
- var message = 'Object doesn\'t match union (at "' + path_canBeApexProperty + '")';
164
- message += '\n' + obj_canBeApexProperty_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
165
- message += '\n' + obj_canBeApexProperty_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
166
- return new TypeError(message);
167
- }
168
- var obj_canBeSobjectField = obj.canBeSobjectField;
169
- var path_canBeSobjectField = path + '.canBeSobjectField';
170
- var obj_canBeSobjectField_union0 = null;
171
- var obj_canBeSobjectField_union0_error = (function () {
172
- if (typeof obj_canBeSobjectField !== 'string') {
173
- return new TypeError('Expected "string" but received "' + typeof obj_canBeSobjectField + '" (at "' + path_canBeSobjectField + '")');
174
- }
175
- })();
176
- if (obj_canBeSobjectField_union0_error != null) {
177
- obj_canBeSobjectField_union0 = obj_canBeSobjectField_union0_error.message;
178
- }
179
- var obj_canBeSobjectField_union1 = null;
180
- var obj_canBeSobjectField_union1_error = (function () {
181
- if (obj_canBeSobjectField !== null) {
182
- return new TypeError('Expected "null" but received "' + typeof obj_canBeSobjectField + '" (at "' + path_canBeSobjectField + '")');
183
- }
184
- })();
185
- if (obj_canBeSobjectField_union1_error != null) {
186
- obj_canBeSobjectField_union1 = obj_canBeSobjectField_union1_error.message;
187
- }
188
- if (obj_canBeSobjectField_union0 && obj_canBeSobjectField_union1) {
189
- var message = 'Object doesn\'t match union (at "' + path_canBeSobjectField + '")';
190
- message += '\n' + obj_canBeSobjectField_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
191
- message += '\n' + obj_canBeSobjectField_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
192
- return new TypeError(message);
193
- }
194
- var obj_canBeSystemVariable = obj.canBeSystemVariable;
195
- var path_canBeSystemVariable = path + '.canBeSystemVariable';
196
- var obj_canBeSystemVariable_union0 = null;
197
- var obj_canBeSystemVariable_union0_error = (function () {
198
- if (typeof obj_canBeSystemVariable !== 'string') {
199
- return new TypeError('Expected "string" but received "' + typeof obj_canBeSystemVariable + '" (at "' + path_canBeSystemVariable + '")');
200
- }
201
- })();
202
- if (obj_canBeSystemVariable_union0_error != null) {
203
- obj_canBeSystemVariable_union0 = obj_canBeSystemVariable_union0_error.message;
204
- }
205
- var obj_canBeSystemVariable_union1 = null;
206
- var obj_canBeSystemVariable_union1_error = (function () {
207
- if (obj_canBeSystemVariable !== null) {
208
- return new TypeError('Expected "null" but received "' + typeof obj_canBeSystemVariable + '" (at "' + path_canBeSystemVariable + '")');
209
- }
210
- })();
211
- if (obj_canBeSystemVariable_union1_error != null) {
212
- obj_canBeSystemVariable_union1 = obj_canBeSystemVariable_union1_error.message;
213
- }
214
- if (obj_canBeSystemVariable_union0 && obj_canBeSystemVariable_union1) {
215
- var message = 'Object doesn\'t match union (at "' + path_canBeSystemVariable + '")';
216
- message += '\n' + obj_canBeSystemVariable_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
217
- message += '\n' + obj_canBeSystemVariable_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
218
- return new TypeError(message);
219
- }
220
- var obj_cannotBeElements = obj.cannotBeElements;
221
- var path_cannotBeElements = path + '.cannotBeElements';
222
- if (!ArrayIsArray(obj_cannotBeElements)) {
223
- return new TypeError('Expected "array" but received "' + typeof obj_cannotBeElements + '" (at "' + path_cannotBeElements + '")');
224
- }
225
- for (var i = 0; i < obj_cannotBeElements.length; i++) {
226
- var obj_cannotBeElements_item = obj_cannotBeElements[i];
227
- var path_cannotBeElements_item = path_cannotBeElements + '[' + i + ']';
228
- if (typeof obj_cannotBeElements_item !== 'string') {
229
- return new TypeError('Expected "string" but received "' + typeof obj_cannotBeElements_item + '" (at "' + path_cannotBeElements_item + '")');
230
- }
231
- }
232
- var obj_dataType = obj.dataType;
233
- var path_dataType = path + '.dataType';
234
- var obj_dataType_union0 = null;
235
- var obj_dataType_union0_error = (function () {
236
- if (typeof obj_dataType !== 'string') {
237
- return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
238
- }
239
- })();
240
- if (obj_dataType_union0_error != null) {
241
- obj_dataType_union0 = obj_dataType_union0_error.message;
242
- }
243
- var obj_dataType_union1 = null;
244
- var obj_dataType_union1_error = (function () {
245
- if (obj_dataType !== null) {
246
- return new TypeError('Expected "null" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
247
- }
248
- })();
249
- if (obj_dataType_union1_error != null) {
250
- obj_dataType_union1 = obj_dataType_union1_error.message;
251
- }
252
- if (obj_dataType_union0 && obj_dataType_union1) {
253
- var message = 'Object doesn\'t match union (at "' + path_dataType + '")';
254
- message += '\n' + obj_dataType_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
255
- message += '\n' + obj_dataType_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
256
- return new TypeError(message);
257
- }
258
- var obj_isCollection = obj.isCollection;
259
- var path_isCollection = path + '.isCollection';
260
- if (typeof obj_isCollection !== 'boolean') {
261
- return new TypeError('Expected "boolean" but received "' + typeof obj_isCollection + '" (at "' + path_isCollection + '")');
262
- }
263
- var obj_isNull = obj.isNull;
264
- var path_isNull = path + '.isNull';
265
- if (typeof obj_isNull !== 'boolean') {
266
- return new TypeError('Expected "boolean" but received "' + typeof obj_isNull + '" (at "' + path_isNull + '")');
267
- }
268
- var obj_mustBeElements = obj.mustBeElements;
269
- var path_mustBeElements = path + '.mustBeElements';
270
- if (!ArrayIsArray(obj_mustBeElements)) {
271
- return new TypeError('Expected "array" but received "' + typeof obj_mustBeElements + '" (at "' + path_mustBeElements + '")');
272
- }
273
- for (var i = 0; i < obj_mustBeElements.length; i++) {
274
- var obj_mustBeElements_item = obj_mustBeElements[i];
275
- var path_mustBeElements_item = path_mustBeElements + '[' + i + ']';
276
- if (typeof obj_mustBeElements_item !== 'string') {
277
- return new TypeError('Expected "string" but received "' + typeof obj_mustBeElements_item + '" (at "' + path_mustBeElements_item + '")');
278
- }
279
- }
280
- var obj_paramType = obj.paramType;
281
- var path_paramType = path + '.paramType';
282
- var obj_paramType_union0 = null;
283
- var obj_paramType_union0_error = (function () {
284
- if (typeof obj_paramType !== 'string') {
285
- return new TypeError('Expected "string" but received "' + typeof obj_paramType + '" (at "' + path_paramType + '")');
286
- }
287
- })();
288
- if (obj_paramType_union0_error != null) {
289
- obj_paramType_union0 = obj_paramType_union0_error.message;
290
- }
291
- var obj_paramType_union1 = null;
292
- var obj_paramType_union1_error = (function () {
293
- if (obj_paramType !== null) {
294
- return new TypeError('Expected "null" but received "' + typeof obj_paramType + '" (at "' + path_paramType + '")');
295
- }
296
- })();
297
- if (obj_paramType_union1_error != null) {
298
- obj_paramType_union1 = obj_paramType_union1_error.message;
299
- }
300
- if (obj_paramType_union0 && obj_paramType_union1) {
301
- var message = 'Object doesn\'t match union (at "' + path_paramType + '")';
302
- message += '\n' + obj_paramType_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
303
- message += '\n' + obj_paramType_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
304
- return new TypeError(message);
305
- }
306
- })();
307
- return v_error === undefined ? null : v_error;
308
- }
309
- var select$3 = function FlowOperatorParameterRepresentationSelect() {
310
- return {
311
- kind: 'Fragment',
312
- version: VERSION$2,
313
- private: [],
314
- selections: [
315
- {
316
- name: 'canBeApexProperty',
317
- kind: 'Scalar'
318
- },
319
- {
320
- name: 'canBeSobjectField',
321
- kind: 'Scalar'
322
- },
323
- {
324
- name: 'canBeSystemVariable',
325
- kind: 'Scalar'
326
- },
327
- {
328
- name: 'cannotBeElements',
329
- kind: 'Scalar',
330
- plural: true
331
- },
332
- {
333
- name: 'dataType',
334
- kind: 'Scalar'
335
- },
336
- {
337
- name: 'isCollection',
338
- kind: 'Scalar'
339
- },
340
- {
341
- name: 'isNull',
342
- kind: 'Scalar'
343
- },
344
- {
345
- name: 'mustBeElements',
346
- kind: 'Scalar',
347
- plural: true
348
- },
349
- {
350
- name: 'paramType',
351
- kind: 'Scalar'
352
- }
353
- ]
354
- };
355
- };
356
- function equals$2(existing, incoming) {
357
- var existing_isCollection = existing.isCollection;
358
- var incoming_isCollection = incoming.isCollection;
359
- if (!(existing_isCollection === incoming_isCollection)) {
360
- return false;
361
- }
362
- var existing_isNull = existing.isNull;
363
- var incoming_isNull = incoming.isNull;
364
- if (!(existing_isNull === incoming_isNull)) {
365
- return false;
366
- }
367
- var existing_canBeApexProperty = existing.canBeApexProperty;
368
- var incoming_canBeApexProperty = incoming.canBeApexProperty;
369
- if (!(existing_canBeApexProperty === incoming_canBeApexProperty)) {
370
- return false;
371
- }
372
- var existing_canBeSobjectField = existing.canBeSobjectField;
373
- var incoming_canBeSobjectField = incoming.canBeSobjectField;
374
- if (!(existing_canBeSobjectField === incoming_canBeSobjectField)) {
375
- return false;
376
- }
377
- var existing_canBeSystemVariable = existing.canBeSystemVariable;
378
- var incoming_canBeSystemVariable = incoming.canBeSystemVariable;
379
- if (!(existing_canBeSystemVariable === incoming_canBeSystemVariable)) {
380
- return false;
381
- }
382
- var existing_cannotBeElements = existing.cannotBeElements;
383
- var incoming_cannotBeElements = incoming.cannotBeElements;
384
- var equals_cannotBeElements_items = equalsArray(existing_cannotBeElements, incoming_cannotBeElements, function (existing_cannotBeElements_item, incoming_cannotBeElements_item) {
385
- if (!(existing_cannotBeElements_item === incoming_cannotBeElements_item)) {
386
- return false;
387
- }
388
- });
389
- if (equals_cannotBeElements_items === false) {
390
- return false;
391
- }
392
- var existing_dataType = existing.dataType;
393
- var incoming_dataType = incoming.dataType;
394
- if (!(existing_dataType === incoming_dataType)) {
395
- return false;
396
- }
397
- var existing_mustBeElements = existing.mustBeElements;
398
- var incoming_mustBeElements = incoming.mustBeElements;
399
- var equals_mustBeElements_items = equalsArray(existing_mustBeElements, incoming_mustBeElements, function (existing_mustBeElements_item, incoming_mustBeElements_item) {
400
- if (!(existing_mustBeElements_item === incoming_mustBeElements_item)) {
401
- return false;
402
- }
403
- });
404
- if (equals_mustBeElements_items === false) {
405
- return false;
406
- }
407
- var existing_paramType = existing.paramType;
408
- var incoming_paramType = incoming.paramType;
409
- if (!(existing_paramType === incoming_paramType)) {
410
- return false;
411
- }
412
- return true;
413
- }
414
-
415
- var VERSION$1 = "db9c200fd0583df1c75001ba9a103995";
416
- function validate$1(obj, path) {
417
- if (path === void 0) { path = 'FlowOperatorRuleRepresentation'; }
418
- var v_error = (function () {
419
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
420
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
421
- }
422
- var obj_assignmentOperator = obj.assignmentOperator;
423
- var path_assignmentOperator = path + '.assignmentOperator';
424
- var referencepath_assignmentOperatorValidationError = validate$3(obj_assignmentOperator, path_assignmentOperator);
425
- if (referencepath_assignmentOperatorValidationError !== null) {
426
- var message = 'Object doesn\'t match FlowOperatorRepresentation (at "' + path_assignmentOperator + '")\n';
427
- message += referencepath_assignmentOperatorValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
428
- return new TypeError(message);
429
- }
430
- var obj_comparisonOperator = obj.comparisonOperator;
431
- var path_comparisonOperator = path + '.comparisonOperator';
432
- var referencepath_comparisonOperatorValidationError = validate$3(obj_comparisonOperator, path_comparisonOperator);
433
- if (referencepath_comparisonOperatorValidationError !== null) {
434
- var message = 'Object doesn\'t match FlowOperatorRepresentation (at "' + path_comparisonOperator + '")\n';
435
- message += referencepath_comparisonOperatorValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
436
- return new TypeError(message);
437
- }
438
- var obj_excludeElems = obj.excludeElems;
439
- var path_excludeElems = path + '.excludeElems';
440
- if (!ArrayIsArray(obj_excludeElems)) {
441
- return new TypeError('Expected "array" but received "' + typeof obj_excludeElems + '" (at "' + path_excludeElems + '")');
442
- }
443
- for (var i = 0; i < obj_excludeElems.length; i++) {
444
- var obj_excludeElems_item = obj_excludeElems[i];
445
- var path_excludeElems_item = path_excludeElems + '[' + i + ']';
446
- if (typeof obj_excludeElems_item !== 'string') {
447
- return new TypeError('Expected "string" but received "' + typeof obj_excludeElems_item + '" (at "' + path_excludeElems_item + '")');
448
- }
449
- }
450
- var obj_includeElems = obj.includeElems;
451
- var path_includeElems = path + '.includeElems';
452
- if (!ArrayIsArray(obj_includeElems)) {
453
- return new TypeError('Expected "array" but received "' + typeof obj_includeElems + '" (at "' + path_includeElems + '")');
454
- }
455
- for (var i = 0; i < obj_includeElems.length; i++) {
456
- var obj_includeElems_item = obj_includeElems[i];
457
- var path_includeElems_item = path_includeElems + '[' + i + ']';
458
- if (typeof obj_includeElems_item !== 'string') {
459
- return new TypeError('Expected "string" but received "' + typeof obj_includeElems_item + '" (at "' + path_includeElems_item + '")');
460
- }
461
- }
462
- var obj_left = obj.left;
463
- var path_left = path + '.left';
464
- var referencepath_leftValidationError = validate$2(obj_left, path_left);
465
- if (referencepath_leftValidationError !== null) {
466
- var message = 'Object doesn\'t match FlowOperatorParameterRepresentation (at "' + path_left + '")\n';
467
- message += referencepath_leftValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
468
- return new TypeError(message);
469
- }
470
- var obj_rhsParams = obj.rhsParams;
471
- var path_rhsParams = path + '.rhsParams';
472
- if (!ArrayIsArray(obj_rhsParams)) {
473
- return new TypeError('Expected "array" but received "' + typeof obj_rhsParams + '" (at "' + path_rhsParams + '")');
474
- }
475
- for (var i = 0; i < obj_rhsParams.length; i++) {
476
- var obj_rhsParams_item = obj_rhsParams[i];
477
- var path_rhsParams_item = path_rhsParams + '[' + i + ']';
478
- var referencepath_rhsParams_itemValidationError = validate$2(obj_rhsParams_item, path_rhsParams_item);
479
- if (referencepath_rhsParams_itemValidationError !== null) {
480
- var message = 'Object doesn\'t match FlowOperatorParameterRepresentation (at "' + path_rhsParams_item + '")\n';
481
- message += referencepath_rhsParams_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
482
- return new TypeError(message);
483
- }
484
- }
485
- var obj_ruleType = obj.ruleType;
486
- var path_ruleType = path + '.ruleType';
487
- if (typeof obj_ruleType !== 'string') {
488
- return new TypeError('Expected "string" but received "' + typeof obj_ruleType + '" (at "' + path_ruleType + '")');
489
- }
490
- var obj_validationType = obj.validationType;
491
- var path_validationType = path + '.validationType';
492
- var obj_validationType_union0 = null;
493
- var obj_validationType_union0_error = (function () {
494
- if (typeof obj_validationType !== 'string') {
495
- return new TypeError('Expected "string" but received "' + typeof obj_validationType + '" (at "' + path_validationType + '")');
496
- }
497
- })();
498
- if (obj_validationType_union0_error != null) {
499
- obj_validationType_union0 = obj_validationType_union0_error.message;
500
- }
501
- var obj_validationType_union1 = null;
502
- var obj_validationType_union1_error = (function () {
503
- if (obj_validationType !== null) {
504
- return new TypeError('Expected "null" but received "' + typeof obj_validationType + '" (at "' + path_validationType + '")');
505
- }
506
- })();
507
- if (obj_validationType_union1_error != null) {
508
- obj_validationType_union1 = obj_validationType_union1_error.message;
509
- }
510
- if (obj_validationType_union0 && obj_validationType_union1) {
511
- var message = 'Object doesn\'t match union (at "' + path_validationType + '")';
512
- message += '\n' + obj_validationType_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
513
- message += '\n' + obj_validationType_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
514
- return new TypeError(message);
515
- }
516
- })();
517
- return v_error === undefined ? null : v_error;
518
- }
519
- var select$2 = function FlowOperatorRuleRepresentationSelect() {
520
- var _a = select$4(), FlowOperatorRepresentation__selections = _a.selections;
521
- var _b = select$3(), FlowOperatorParameterRepresentation__selections = _b.selections;
522
- return {
523
- kind: 'Fragment',
524
- version: VERSION$1,
525
- private: [],
526
- selections: [
527
- {
528
- name: 'assignmentOperator',
529
- kind: 'Object',
530
- selections: FlowOperatorRepresentation__selections
531
- },
532
- {
533
- name: 'comparisonOperator',
534
- kind: 'Object',
535
- selections: FlowOperatorRepresentation__selections
536
- },
537
- {
538
- name: 'excludeElems',
539
- kind: 'Scalar',
540
- plural: true
541
- },
542
- {
543
- name: 'includeElems',
544
- kind: 'Scalar',
545
- plural: true
546
- },
547
- {
548
- name: 'left',
549
- kind: 'Object',
550
- selections: FlowOperatorParameterRepresentation__selections
551
- },
552
- {
553
- name: 'rhsParams',
554
- kind: 'Object',
555
- plural: true,
556
- selections: FlowOperatorParameterRepresentation__selections
557
- },
558
- {
559
- name: 'ruleType',
560
- kind: 'Scalar'
561
- },
562
- {
563
- name: 'validationType',
564
- kind: 'Scalar'
565
- }
566
- ]
567
- };
568
- };
569
- function equals$1(existing, incoming) {
570
- var existing_ruleType = existing.ruleType;
571
- var incoming_ruleType = incoming.ruleType;
572
- if (!(existing_ruleType === incoming_ruleType)) {
573
- return false;
574
- }
575
- var existing_assignmentOperator = existing.assignmentOperator;
576
- var incoming_assignmentOperator = incoming.assignmentOperator;
577
- if (!(equals$3(existing_assignmentOperator, incoming_assignmentOperator))) {
578
- return false;
579
- }
580
- var existing_comparisonOperator = existing.comparisonOperator;
581
- var incoming_comparisonOperator = incoming.comparisonOperator;
582
- if (!(equals$3(existing_comparisonOperator, incoming_comparisonOperator))) {
583
- return false;
584
- }
585
- var existing_excludeElems = existing.excludeElems;
586
- var incoming_excludeElems = incoming.excludeElems;
587
- var equals_excludeElems_items = equalsArray(existing_excludeElems, incoming_excludeElems, function (existing_excludeElems_item, incoming_excludeElems_item) {
588
- if (!(existing_excludeElems_item === incoming_excludeElems_item)) {
589
- return false;
590
- }
591
- });
592
- if (equals_excludeElems_items === false) {
593
- return false;
594
- }
595
- var existing_includeElems = existing.includeElems;
596
- var incoming_includeElems = incoming.includeElems;
597
- var equals_includeElems_items = equalsArray(existing_includeElems, incoming_includeElems, function (existing_includeElems_item, incoming_includeElems_item) {
598
- if (!(existing_includeElems_item === incoming_includeElems_item)) {
599
- return false;
600
- }
601
- });
602
- if (equals_includeElems_items === false) {
603
- return false;
604
- }
605
- var existing_left = existing.left;
606
- var incoming_left = incoming.left;
607
- if (!(equals$2(existing_left, incoming_left))) {
608
- return false;
609
- }
610
- var existing_rhsParams = existing.rhsParams;
611
- var incoming_rhsParams = incoming.rhsParams;
612
- var equals_rhsParams_items = equalsArray(existing_rhsParams, incoming_rhsParams, function (existing_rhsParams_item, incoming_rhsParams_item) {
613
- if (!(equals$2(existing_rhsParams_item, incoming_rhsParams_item))) {
614
- return false;
615
- }
616
- });
617
- if (equals_rhsParams_items === false) {
618
- return false;
619
- }
620
- var existing_validationType = existing.validationType;
621
- var incoming_validationType = incoming.validationType;
622
- if (!(existing_validationType === incoming_validationType)) {
623
- return false;
624
- }
625
- return true;
626
- }
627
-
628
- var VERSION = "7b00537edb93014057d98c364ea0fc84";
629
- function validate(obj, path) {
630
- if (path === void 0) { path = 'FlowOperatorRuleCollectionRepresentation'; }
631
- var v_error = (function () {
632
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
633
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
634
- }
635
- var obj_rules = obj.rules;
636
- var path_rules = path + '.rules';
637
- if (!ArrayIsArray(obj_rules)) {
638
- return new TypeError('Expected "array" but received "' + typeof obj_rules + '" (at "' + path_rules + '")');
639
- }
640
- for (var i = 0; i < obj_rules.length; i++) {
641
- var obj_rules_item = obj_rules[i];
642
- var path_rules_item = path_rules + '[' + i + ']';
643
- var referencepath_rules_itemValidationError = validate$1(obj_rules_item, path_rules_item);
644
- if (referencepath_rules_itemValidationError !== null) {
645
- var message = 'Object doesn\'t match FlowOperatorRuleRepresentation (at "' + path_rules_item + '")\n';
646
- message += referencepath_rules_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
647
- return new TypeError(message);
648
- }
649
- }
650
- })();
651
- return v_error === undefined ? null : v_error;
652
- }
653
- var RepresentationType = 'FlowOperatorRuleCollectionRepresentation';
654
- function normalize(input, existing, path, luvio, store, timestamp) {
655
- return input;
656
- }
657
- var select$1 = function FlowOperatorRuleCollectionRepresentationSelect() {
658
- var _a = select$2(), FlowOperatorRuleRepresentation__selections = _a.selections;
659
- return {
660
- kind: 'Fragment',
661
- version: VERSION,
662
- private: [],
663
- selections: [
664
- {
665
- name: 'rules',
666
- kind: 'Object',
667
- plural: true,
668
- selections: FlowOperatorRuleRepresentation__selections
669
- }
670
- ]
671
- };
672
- };
673
- function equals(existing, incoming) {
674
- var existing_rules = existing.rules;
675
- var incoming_rules = incoming.rules;
676
- var equals_rules_items = equalsArray(existing_rules, incoming_rules, function (existing_rules_item, incoming_rules_item) {
677
- if (!(equals$1(existing_rules_item, incoming_rules_item))) {
678
- return false;
679
- }
680
- });
681
- if (equals_rules_items === false) {
682
- return false;
683
- }
684
- return true;
685
- }
686
- var ingest = function FlowOperatorRuleCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
687
- if (process.env.NODE_ENV !== 'production') {
688
- var validateError = validate(input);
689
- if (validateError !== null) {
690
- throw validateError;
691
- }
692
- }
693
- var key = path.fullPath;
694
- var existingRecord = store.readEntry(key);
695
- var ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
696
- var incomingRecord = normalize(input, store.readEntry(key), {
697
- fullPath: key,
698
- parent: path.parent,
699
- propertyName: path.propertyName,
700
- ttl: ttlToUse
701
- });
702
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
703
- luvio.storePublish(key, incomingRecord);
704
- }
705
- if (ttlToUse !== undefined) {
706
- var storeMetadataParams = {
707
- ttl: ttlToUse,
708
- namespace: "flow-builder",
709
- version: VERSION,
710
- representationName: RepresentationType,
711
- };
712
- luvio.publishStoreMetadata(key, storeMetadataParams);
713
- }
714
- return createLink(key);
715
- };
716
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
717
- var rootKeySet = new engine.StoreKeyMap();
718
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
719
- var rootKey = fullPathFactory();
720
- rootKeySet.set(rootKey, {
721
- namespace: keyPrefix,
722
- representationName: RepresentationType,
723
- mergeable: false
724
- });
725
- return rootKeySet;
726
- }
727
-
728
- function select(luvio, params) {
729
- return select$1();
730
- }
731
- function keyBuilder$1(luvio, params) {
732
- return keyPrefix + '::FlowOperatorRuleCollectionRepresentation:(' + 'flowProcessType:' + params.queryParams.flowProcessType + ',' + 'flowTriggerType:' + params.queryParams.flowTriggerType + ',' + 'recordTriggerType:' + params.queryParams.recordTriggerType + ')';
733
- }
734
- function getResponseCacheKeys(luvio, resourceParams, response) {
735
- return getTypeCacheKeys(luvio, response, function () { return keyBuilder$1(luvio, resourceParams); });
736
- }
737
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
738
- var body = response.body;
739
- var key = keyBuilder$1(luvio, resourceParams);
740
- luvio.storeIngest(key, ingest, body);
741
- var snapshot = luvio.storeLookup({
742
- recordId: key,
743
- node: select(),
744
- variables: {},
745
- }, snapshotRefresh);
746
- if (process.env.NODE_ENV !== 'production') {
747
- if (snapshot.state !== 'Fulfilled') {
748
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
749
- }
750
- }
751
- return snapshot;
752
- }
753
- function ingestError(luvio, params, error, snapshotRefresh) {
754
- var key = keyBuilder$1(luvio, params);
755
- var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
756
- luvio.storeIngestError(key, errorSnapshot);
757
- return errorSnapshot;
758
- }
759
- function createResourceRequest(config) {
760
- var headers = {};
761
- return {
762
- baseUri: '/services/data/v58.0',
763
- basePath: '/connect/interaction/builder/rules',
764
- method: 'get',
765
- body: null,
766
- urlParams: {},
767
- queryParams: config.queryParams,
768
- headers: headers,
769
- priority: 'normal',
770
- };
771
- }
772
-
773
- var getRules_ConfigPropertyNames = {
774
- displayName: 'getRules',
775
- parameters: {
776
- required: [],
777
- optional: ['flowProcessType', 'flowTriggerType', 'recordTriggerType']
778
- }
779
- };
780
- function createResourceParams(config) {
781
- var resourceParams = {
782
- queryParams: {
783
- flowProcessType: config.flowProcessType, flowTriggerType: config.flowTriggerType, recordTriggerType: config.recordTriggerType
784
- }
785
- };
786
- return resourceParams;
787
- }
788
- function keyBuilder(luvio, config) {
789
- var resourceParams = createResourceParams(config);
790
- return keyBuilder$1(luvio, resourceParams);
791
- }
792
- function typeCheckConfig(untrustedConfig) {
793
- var config = {};
794
- var untrustedConfig_flowProcessType = untrustedConfig.flowProcessType;
795
- if (typeof untrustedConfig_flowProcessType === 'string') {
796
- config.flowProcessType = untrustedConfig_flowProcessType;
797
- }
798
- var untrustedConfig_flowTriggerType = untrustedConfig.flowTriggerType;
799
- if (typeof untrustedConfig_flowTriggerType === 'string') {
800
- config.flowTriggerType = untrustedConfig_flowTriggerType;
801
- }
802
- var untrustedConfig_recordTriggerType = untrustedConfig.recordTriggerType;
803
- if (typeof untrustedConfig_recordTriggerType === 'string') {
804
- config.recordTriggerType = untrustedConfig_recordTriggerType;
805
- }
806
- return config;
807
- }
808
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
809
- if (!untrustedIsObject(untrustedConfig)) {
810
- return null;
811
- }
812
- if (process.env.NODE_ENV !== 'production') {
813
- validateConfig(untrustedConfig, configPropertyNames);
814
- }
815
- var config = typeCheckConfig(untrustedConfig);
816
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
817
- return null;
818
- }
819
- return config;
820
- }
821
- function adapterFragment(luvio, config) {
822
- createResourceParams(config);
823
- return select();
824
- }
825
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
826
- var snapshot = ingestSuccess(luvio, resourceParams, response, {
827
- config: config,
828
- resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
829
- });
830
- return luvio.storeBroadcast().then(function () { return snapshot; });
831
- }
832
- function onFetchResponseError(luvio, config, resourceParams, response) {
833
- var snapshot = ingestError(luvio, resourceParams, response, {
834
- config: config,
835
- resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
836
- });
837
- return luvio.storeBroadcast().then(function () { return snapshot; });
838
- }
839
- function buildNetworkSnapshot(luvio, config, options) {
840
- var resourceParams = createResourceParams(config);
841
- var request = createResourceRequest(resourceParams);
842
- return luvio.dispatchResourceRequest(request, options)
843
- .then(function (response) {
844
- return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
845
- }, function (response) {
846
- return luvio.handleErrorResponse(function () { return onFetchResponseError(luvio, config, resourceParams, response); });
847
- });
848
- }
849
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
850
- var luvio = context.luvio, config = context.config;
851
- var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
852
- var dispatchOptions = {
853
- resourceRequestContext: {
854
- requestCorrelator: requestCorrelator,
855
- luvioRequestMethod: undefined,
856
- },
857
- eventObservers: eventObservers
858
- };
859
- if (networkPriority !== 'normal') {
860
- dispatchOptions.overrides = {
861
- priority: networkPriority
862
- };
863
- }
864
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
865
- }
866
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
867
- var luvio = context.luvio, config = context.config;
868
- var selector = {
869
- recordId: keyBuilder(luvio, config),
870
- node: adapterFragment(luvio, config),
871
- variables: {},
872
- };
873
- var cacheSnapshot = storeLookup(selector, {
874
- config: config,
875
- resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
876
- });
877
- return cacheSnapshot;
878
- }
879
- var getRulesAdapterFactory = function (luvio) { return function flowBuilder__getRules(untrustedConfig, requestContext) {
880
- var config = validateAdapterConfig(untrustedConfig, getRules_ConfigPropertyNames);
881
- // Invalid or incomplete config
882
- if (config === null) {
883
- return null;
884
- }
885
- return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
886
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
887
- }; };
888
-
889
- exports.getRulesAdapterFactory = getRulesAdapterFactory;
890
-
891
- Object.defineProperty(exports, '__esModule', { value: true });
892
-
893
- }));