@salesforce/lds-adapters-cms-orchestrator 1.100.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/cms-orchestrator.js +1770 -0
- package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
- package/dist/types/src/generated/adapters/createManagedContentOrchestrationInstance.d.ts +15 -0
- package/dist/types/src/generated/adapters/getManagedContentOrchestrationDefinitions.d.ts +28 -0
- package/dist/types/src/generated/adapters/getManagedContentOrchestrationInstances.d.ts +26 -0
- package/dist/types/src/generated/adapters/getManagedContentRunningOrchestrationHistoryEvents.d.ts +26 -0
- package/dist/types/src/generated/artifacts/main.d.ts +4 -0
- package/dist/types/src/generated/artifacts/sfdc.d.ts +8 -0
- package/dist/types/src/generated/resources/getConnectCmsContentsOrchestrationDefinitions.d.ts +17 -0
- package/dist/types/src/generated/resources/getConnectCmsContentsOrchestrationHistoryEvents.d.ts +15 -0
- package/dist/types/src/generated/resources/getConnectCmsContentsOrchestrationInstances.d.ts +15 -0
- package/dist/types/src/generated/resources/postConnectCmsContentsOrchestrationInstances.d.ts +13 -0
- package/dist/types/src/generated/types/ManagedContentOrchestrationDefinitionCollectionRepresentation.d.ts +52 -0
- package/dist/types/src/generated/types/ManagedContentOrchestrationDefinitionRepresentation.d.ts +51 -0
- package/dist/types/src/generated/types/ManagedContentOrchestrationInstanceCollectionRepresentation.d.ts +40 -0
- package/dist/types/src/generated/types/ManagedContentOrchestrationInstanceInputRepresentation.d.ts +32 -0
- package/dist/types/src/generated/types/ManagedContentOrchestrationInstanceInputWrapperRepresentation.d.ts +29 -0
- package/dist/types/src/generated/types/ManagedContentOrchestrationInstanceRepresentation.d.ts +55 -0
- package/dist/types/src/generated/types/ManagedContentRunningOrchestrationHistoryEventCollectionRepresentation.d.ts +31 -0
- package/dist/types/src/generated/types/ManagedContentRunningOrchestrationHistoryEventRepresentation.d.ts +69 -0
- package/dist/types/src/generated/types/type-utils.d.ts +39 -0
- package/dist/umd/es2018/cms-orchestrator.js +1781 -0
- package/dist/umd/es5/cms-orchestrator.js +1788 -0
- package/package.json +67 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +1824 -0
- package/src/raml/api.raml +236 -0
- package/src/raml/luvio.raml +41 -0
|
@@ -0,0 +1,1788 @@
|
|
|
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["cms-orchestrator"] = {}, global.engine));
|
|
11
|
+
})(this, (function (exports, engine) { 'use strict';
|
|
12
|
+
|
|
13
|
+
var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
14
|
+
var ObjectKeys$1 = Object.keys;
|
|
15
|
+
var ArrayIsArray$1 = Array.isArray;
|
|
16
|
+
/**
|
|
17
|
+
* Validates an adapter config is well-formed.
|
|
18
|
+
* @param config The config to validate.
|
|
19
|
+
* @param adapter The adapter validation configuration.
|
|
20
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
21
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
22
|
+
*/
|
|
23
|
+
function validateConfig(config, adapter, oneOf) {
|
|
24
|
+
var displayName = adapter.displayName;
|
|
25
|
+
var _a = adapter.parameters, required = _a.required, optional = _a.optional, unsupported = _a.unsupported;
|
|
26
|
+
if (config === undefined ||
|
|
27
|
+
required.every(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
|
|
28
|
+
throw new TypeError("adapter ".concat(displayName, " configuration must specify ").concat(required.sort().join(', ')));
|
|
29
|
+
}
|
|
30
|
+
if (oneOf && oneOf.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
|
|
31
|
+
throw new TypeError("adapter ".concat(displayName, " configuration must specify one of ").concat(oneOf.sort().join(', ')));
|
|
32
|
+
}
|
|
33
|
+
if (unsupported !== undefined &&
|
|
34
|
+
unsupported.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); })) {
|
|
35
|
+
throw new TypeError("adapter ".concat(displayName, " does not yet support ").concat(unsupported.sort().join(', ')));
|
|
36
|
+
}
|
|
37
|
+
var supported = required.concat(optional);
|
|
38
|
+
if (ObjectKeys$1(config).some(function (key) { return !supported.includes(key); })) {
|
|
39
|
+
throw new TypeError("adapter ".concat(displayName, " configuration supports only ").concat(supported.sort().join(', ')));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function untrustedIsObject(untrusted) {
|
|
43
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
44
|
+
}
|
|
45
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
46
|
+
return configPropertyNames.parameters.required.every(function (req) { return req in config; });
|
|
47
|
+
}
|
|
48
|
+
var snapshotRefreshOptions = {
|
|
49
|
+
overrides: {
|
|
50
|
+
headers: {
|
|
51
|
+
'Cache-Control': 'no-cache',
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var keyPrefix = 'CMSOrchestrator';
|
|
56
|
+
|
|
57
|
+
var ObjectFreeze = Object.freeze, ObjectKeys = Object.keys;
|
|
58
|
+
var ArrayIsArray = Array.isArray;
|
|
59
|
+
function equalsArray(a, b, equalsItem) {
|
|
60
|
+
var aLength = a.length;
|
|
61
|
+
var bLength = b.length;
|
|
62
|
+
if (aLength !== bLength) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
for (var i = 0; i < aLength; i++) {
|
|
66
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
function deepFreeze(value) {
|
|
73
|
+
// No need to freeze primitives
|
|
74
|
+
if (typeof value !== 'object' || value === null) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (ArrayIsArray(value)) {
|
|
78
|
+
for (var i = 0, len = value.length; i < len; i += 1) {
|
|
79
|
+
deepFreeze(value[i]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
var keys = ObjectKeys(value);
|
|
84
|
+
for (var i = 0, len = keys.length; i < len; i += 1) {
|
|
85
|
+
deepFreeze(value[keys[i]]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
ObjectFreeze(value);
|
|
89
|
+
}
|
|
90
|
+
function createLink(ref) {
|
|
91
|
+
return {
|
|
92
|
+
__ref: engine.serializeStructuredKey(ref),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var TTL$4 = 3600000;
|
|
97
|
+
var VERSION$5 = "4972d9e3ead7c764617c098f7cdf912c";
|
|
98
|
+
function validate$6(obj, path) {
|
|
99
|
+
if (path === void 0) { path = 'ManagedContentOrchestrationDefinitionRepresentation'; }
|
|
100
|
+
var v_error = (function () {
|
|
101
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
102
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
103
|
+
}
|
|
104
|
+
var obj_definitionId = obj.definitionId;
|
|
105
|
+
var path_definitionId = path + '.definitionId';
|
|
106
|
+
if (typeof obj_definitionId !== 'string') {
|
|
107
|
+
return new TypeError('Expected "string" but received "' + typeof obj_definitionId + '" (at "' + path_definitionId + '")');
|
|
108
|
+
}
|
|
109
|
+
var obj_description = obj.description;
|
|
110
|
+
var path_description = path + '.description';
|
|
111
|
+
var obj_description_union0 = null;
|
|
112
|
+
var obj_description_union0_error = (function () {
|
|
113
|
+
if (typeof obj_description !== 'string') {
|
|
114
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
115
|
+
}
|
|
116
|
+
})();
|
|
117
|
+
if (obj_description_union0_error != null) {
|
|
118
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
119
|
+
}
|
|
120
|
+
var obj_description_union1 = null;
|
|
121
|
+
var obj_description_union1_error = (function () {
|
|
122
|
+
if (obj_description !== null) {
|
|
123
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
124
|
+
}
|
|
125
|
+
})();
|
|
126
|
+
if (obj_description_union1_error != null) {
|
|
127
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
128
|
+
}
|
|
129
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
130
|
+
var message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
131
|
+
message += '\n' + obj_description_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
132
|
+
message += '\n' + obj_description_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
133
|
+
return new TypeError(message);
|
|
134
|
+
}
|
|
135
|
+
var obj_developerName = obj.developerName;
|
|
136
|
+
var path_developerName = path + '.developerName';
|
|
137
|
+
if (typeof obj_developerName !== 'string') {
|
|
138
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
139
|
+
}
|
|
140
|
+
var obj_label = obj.label;
|
|
141
|
+
var path_label = path + '.label';
|
|
142
|
+
if (typeof obj_label !== 'string') {
|
|
143
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
144
|
+
}
|
|
145
|
+
var obj_versionId = obj.versionId;
|
|
146
|
+
var path_versionId = path + '.versionId';
|
|
147
|
+
if (typeof obj_versionId !== 'string') {
|
|
148
|
+
return new TypeError('Expected "string" but received "' + typeof obj_versionId + '" (at "' + path_versionId + '")');
|
|
149
|
+
}
|
|
150
|
+
})();
|
|
151
|
+
return v_error === undefined ? null : v_error;
|
|
152
|
+
}
|
|
153
|
+
var RepresentationType$4 = 'ManagedContentOrchestrationDefinitionRepresentation';
|
|
154
|
+
function keyBuilder$7(luvio, config) {
|
|
155
|
+
return keyPrefix + '::' + RepresentationType$4 + ':' + config.id;
|
|
156
|
+
}
|
|
157
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
158
|
+
var keyParams = {
|
|
159
|
+
id: object.developerName
|
|
160
|
+
};
|
|
161
|
+
return keyBuilder$7(luvio, keyParams);
|
|
162
|
+
}
|
|
163
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
164
|
+
return input;
|
|
165
|
+
}
|
|
166
|
+
var select$9 = function ManagedContentOrchestrationDefinitionRepresentationSelect() {
|
|
167
|
+
return {
|
|
168
|
+
kind: 'Fragment',
|
|
169
|
+
version: VERSION$5,
|
|
170
|
+
private: [],
|
|
171
|
+
selections: [
|
|
172
|
+
{
|
|
173
|
+
name: 'definitionId',
|
|
174
|
+
kind: 'Scalar'
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: 'description',
|
|
178
|
+
kind: 'Scalar'
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'developerName',
|
|
182
|
+
kind: 'Scalar'
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'label',
|
|
186
|
+
kind: 'Scalar'
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'versionId',
|
|
190
|
+
kind: 'Scalar'
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
function equals$5(existing, incoming) {
|
|
196
|
+
var existing_definitionId = existing.definitionId;
|
|
197
|
+
var incoming_definitionId = incoming.definitionId;
|
|
198
|
+
if (!(existing_definitionId === incoming_definitionId)) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
var existing_developerName = existing.developerName;
|
|
202
|
+
var incoming_developerName = incoming.developerName;
|
|
203
|
+
if (!(existing_developerName === incoming_developerName)) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
var existing_label = existing.label;
|
|
207
|
+
var incoming_label = incoming.label;
|
|
208
|
+
if (!(existing_label === incoming_label)) {
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
var existing_versionId = existing.versionId;
|
|
212
|
+
var incoming_versionId = incoming.versionId;
|
|
213
|
+
if (!(existing_versionId === incoming_versionId)) {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
var existing_description = existing.description;
|
|
217
|
+
var incoming_description = incoming.description;
|
|
218
|
+
if (!(existing_description === incoming_description)) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
var ingest$4 = function ManagedContentOrchestrationDefinitionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
224
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
225
|
+
var validateError = validate$6(input);
|
|
226
|
+
if (validateError !== null) {
|
|
227
|
+
throw validateError;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
var key = keyBuilderFromType$1(luvio, input);
|
|
231
|
+
var existingRecord = store.readEntry(key);
|
|
232
|
+
var ttlToUse = TTL$4;
|
|
233
|
+
var incomingRecord = normalize$4(input, store.readEntry(key), {
|
|
234
|
+
fullPath: key,
|
|
235
|
+
parent: path.parent,
|
|
236
|
+
propertyName: path.propertyName,
|
|
237
|
+
ttl: ttlToUse
|
|
238
|
+
});
|
|
239
|
+
if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
|
|
240
|
+
luvio.storePublish(key, incomingRecord);
|
|
241
|
+
}
|
|
242
|
+
{
|
|
243
|
+
var storeMetadataParams = {
|
|
244
|
+
ttl: ttlToUse,
|
|
245
|
+
namespace: "CMSOrchestrator",
|
|
246
|
+
version: VERSION$5,
|
|
247
|
+
representationName: RepresentationType$4,
|
|
248
|
+
};
|
|
249
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
250
|
+
}
|
|
251
|
+
return createLink(key);
|
|
252
|
+
};
|
|
253
|
+
function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
|
|
254
|
+
var rootKeySet = new engine.StoreKeyMap();
|
|
255
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
256
|
+
var rootKey = keyBuilderFromType$1(luvio, input);
|
|
257
|
+
rootKeySet.set(rootKey, {
|
|
258
|
+
namespace: keyPrefix,
|
|
259
|
+
representationName: RepresentationType$4,
|
|
260
|
+
mergeable: false
|
|
261
|
+
});
|
|
262
|
+
return rootKeySet;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
var TTL$3 = 3600000;
|
|
266
|
+
var VERSION$4 = "d2a7fad15081fd4cd737c942d3e7e5a7";
|
|
267
|
+
function validate$5(obj, path) {
|
|
268
|
+
if (path === void 0) { path = 'ManagedContentOrchestrationDefinitionCollectionRepresentation'; }
|
|
269
|
+
var v_error = (function () {
|
|
270
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
271
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
272
|
+
}
|
|
273
|
+
var obj_currentPageUri = obj.currentPageUri;
|
|
274
|
+
var path_currentPageUri = path + '.currentPageUri';
|
|
275
|
+
if (typeof obj_currentPageUri !== 'string') {
|
|
276
|
+
return new TypeError('Expected "string" but received "' + typeof obj_currentPageUri + '" (at "' + path_currentPageUri + '")');
|
|
277
|
+
}
|
|
278
|
+
var obj_nextPageUri = obj.nextPageUri;
|
|
279
|
+
var path_nextPageUri = path + '.nextPageUri';
|
|
280
|
+
var obj_nextPageUri_union0 = null;
|
|
281
|
+
var obj_nextPageUri_union0_error = (function () {
|
|
282
|
+
if (typeof obj_nextPageUri !== 'string') {
|
|
283
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nextPageUri + '" (at "' + path_nextPageUri + '")');
|
|
284
|
+
}
|
|
285
|
+
})();
|
|
286
|
+
if (obj_nextPageUri_union0_error != null) {
|
|
287
|
+
obj_nextPageUri_union0 = obj_nextPageUri_union0_error.message;
|
|
288
|
+
}
|
|
289
|
+
var obj_nextPageUri_union1 = null;
|
|
290
|
+
var obj_nextPageUri_union1_error = (function () {
|
|
291
|
+
if (obj_nextPageUri !== null) {
|
|
292
|
+
return new TypeError('Expected "null" but received "' + typeof obj_nextPageUri + '" (at "' + path_nextPageUri + '")');
|
|
293
|
+
}
|
|
294
|
+
})();
|
|
295
|
+
if (obj_nextPageUri_union1_error != null) {
|
|
296
|
+
obj_nextPageUri_union1 = obj_nextPageUri_union1_error.message;
|
|
297
|
+
}
|
|
298
|
+
if (obj_nextPageUri_union0 && obj_nextPageUri_union1) {
|
|
299
|
+
var message = 'Object doesn\'t match union (at "' + path_nextPageUri + '")';
|
|
300
|
+
message += '\n' + obj_nextPageUri_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
301
|
+
message += '\n' + obj_nextPageUri_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
302
|
+
return new TypeError(message);
|
|
303
|
+
}
|
|
304
|
+
var obj_orchestrationDefinitions = obj.orchestrationDefinitions;
|
|
305
|
+
var path_orchestrationDefinitions = path + '.orchestrationDefinitions';
|
|
306
|
+
if (!ArrayIsArray(obj_orchestrationDefinitions)) {
|
|
307
|
+
return new TypeError('Expected "array" but received "' + typeof obj_orchestrationDefinitions + '" (at "' + path_orchestrationDefinitions + '")');
|
|
308
|
+
}
|
|
309
|
+
for (var i = 0; i < obj_orchestrationDefinitions.length; i++) {
|
|
310
|
+
var obj_orchestrationDefinitions_item = obj_orchestrationDefinitions[i];
|
|
311
|
+
var path_orchestrationDefinitions_item = path_orchestrationDefinitions + '[' + i + ']';
|
|
312
|
+
if (typeof obj_orchestrationDefinitions_item !== 'object') {
|
|
313
|
+
return new TypeError('Expected "object" but received "' + typeof obj_orchestrationDefinitions_item + '" (at "' + path_orchestrationDefinitions_item + '")');
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
var obj_previousPageUri = obj.previousPageUri;
|
|
317
|
+
var path_previousPageUri = path + '.previousPageUri';
|
|
318
|
+
var obj_previousPageUri_union0 = null;
|
|
319
|
+
var obj_previousPageUri_union0_error = (function () {
|
|
320
|
+
if (typeof obj_previousPageUri !== 'string') {
|
|
321
|
+
return new TypeError('Expected "string" but received "' + typeof obj_previousPageUri + '" (at "' + path_previousPageUri + '")');
|
|
322
|
+
}
|
|
323
|
+
})();
|
|
324
|
+
if (obj_previousPageUri_union0_error != null) {
|
|
325
|
+
obj_previousPageUri_union0 = obj_previousPageUri_union0_error.message;
|
|
326
|
+
}
|
|
327
|
+
var obj_previousPageUri_union1 = null;
|
|
328
|
+
var obj_previousPageUri_union1_error = (function () {
|
|
329
|
+
if (obj_previousPageUri !== null) {
|
|
330
|
+
return new TypeError('Expected "null" but received "' + typeof obj_previousPageUri + '" (at "' + path_previousPageUri + '")');
|
|
331
|
+
}
|
|
332
|
+
})();
|
|
333
|
+
if (obj_previousPageUri_union1_error != null) {
|
|
334
|
+
obj_previousPageUri_union1 = obj_previousPageUri_union1_error.message;
|
|
335
|
+
}
|
|
336
|
+
if (obj_previousPageUri_union0 && obj_previousPageUri_union1) {
|
|
337
|
+
var message = 'Object doesn\'t match union (at "' + path_previousPageUri + '")';
|
|
338
|
+
message += '\n' + obj_previousPageUri_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
339
|
+
message += '\n' + obj_previousPageUri_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
340
|
+
return new TypeError(message);
|
|
341
|
+
}
|
|
342
|
+
var obj_totalDefinitions = obj.totalDefinitions;
|
|
343
|
+
var path_totalDefinitions = path + '.totalDefinitions';
|
|
344
|
+
if (typeof obj_totalDefinitions !== 'number' || (typeof obj_totalDefinitions === 'number' && Math.floor(obj_totalDefinitions) !== obj_totalDefinitions)) {
|
|
345
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalDefinitions + '" (at "' + path_totalDefinitions + '")');
|
|
346
|
+
}
|
|
347
|
+
})();
|
|
348
|
+
return v_error === undefined ? null : v_error;
|
|
349
|
+
}
|
|
350
|
+
var RepresentationType$3 = 'ManagedContentOrchestrationDefinitionCollectionRepresentation';
|
|
351
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
352
|
+
var input_orchestrationDefinitions = input.orchestrationDefinitions;
|
|
353
|
+
var input_orchestrationDefinitions_id = path.fullPath + '__orchestrationDefinitions';
|
|
354
|
+
for (var i = 0; i < input_orchestrationDefinitions.length; i++) {
|
|
355
|
+
var input_orchestrationDefinitions_item = input_orchestrationDefinitions[i];
|
|
356
|
+
var input_orchestrationDefinitions_item_id = input_orchestrationDefinitions_id + '__' + i;
|
|
357
|
+
input_orchestrationDefinitions[i] = ingest$4(input_orchestrationDefinitions_item, {
|
|
358
|
+
fullPath: input_orchestrationDefinitions_item_id,
|
|
359
|
+
propertyName: i,
|
|
360
|
+
parent: {
|
|
361
|
+
data: input,
|
|
362
|
+
key: path.fullPath,
|
|
363
|
+
existing: existing,
|
|
364
|
+
},
|
|
365
|
+
ttl: path.ttl
|
|
366
|
+
}, luvio, store);
|
|
367
|
+
}
|
|
368
|
+
return input;
|
|
369
|
+
}
|
|
370
|
+
var select$8 = function ManagedContentOrchestrationDefinitionCollectionRepresentationSelect() {
|
|
371
|
+
return {
|
|
372
|
+
kind: 'Fragment',
|
|
373
|
+
version: VERSION$4,
|
|
374
|
+
private: [],
|
|
375
|
+
selections: [
|
|
376
|
+
{
|
|
377
|
+
name: 'currentPageUri',
|
|
378
|
+
kind: 'Scalar'
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
name: 'nextPageUri',
|
|
382
|
+
kind: 'Scalar'
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: 'orchestrationDefinitions',
|
|
386
|
+
kind: 'Link',
|
|
387
|
+
plural: true,
|
|
388
|
+
fragment: select$9()
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
name: 'previousPageUri',
|
|
392
|
+
kind: 'Scalar'
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: 'totalDefinitions',
|
|
396
|
+
kind: 'Scalar'
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
function equals$4(existing, incoming) {
|
|
402
|
+
var existing_totalDefinitions = existing.totalDefinitions;
|
|
403
|
+
var incoming_totalDefinitions = incoming.totalDefinitions;
|
|
404
|
+
if (!(existing_totalDefinitions === incoming_totalDefinitions)) {
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
var existing_currentPageUri = existing.currentPageUri;
|
|
408
|
+
var incoming_currentPageUri = incoming.currentPageUri;
|
|
409
|
+
if (!(existing_currentPageUri === incoming_currentPageUri)) {
|
|
410
|
+
return false;
|
|
411
|
+
}
|
|
412
|
+
var existing_nextPageUri = existing.nextPageUri;
|
|
413
|
+
var incoming_nextPageUri = incoming.nextPageUri;
|
|
414
|
+
if (!(existing_nextPageUri === incoming_nextPageUri)) {
|
|
415
|
+
return false;
|
|
416
|
+
}
|
|
417
|
+
var existing_orchestrationDefinitions = existing.orchestrationDefinitions;
|
|
418
|
+
var incoming_orchestrationDefinitions = incoming.orchestrationDefinitions;
|
|
419
|
+
var equals_orchestrationDefinitions_items = equalsArray(existing_orchestrationDefinitions, incoming_orchestrationDefinitions, function (existing_orchestrationDefinitions_item, incoming_orchestrationDefinitions_item) {
|
|
420
|
+
if (!(existing_orchestrationDefinitions_item.__ref === incoming_orchestrationDefinitions_item.__ref)) {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
if (equals_orchestrationDefinitions_items === false) {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
var existing_previousPageUri = existing.previousPageUri;
|
|
428
|
+
var incoming_previousPageUri = incoming.previousPageUri;
|
|
429
|
+
if (!(existing_previousPageUri === incoming_previousPageUri)) {
|
|
430
|
+
return false;
|
|
431
|
+
}
|
|
432
|
+
return true;
|
|
433
|
+
}
|
|
434
|
+
var ingest$3 = function ManagedContentOrchestrationDefinitionCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
435
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
436
|
+
var validateError = validate$5(input);
|
|
437
|
+
if (validateError !== null) {
|
|
438
|
+
throw validateError;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
var key = path.fullPath;
|
|
442
|
+
var existingRecord = store.readEntry(key);
|
|
443
|
+
var ttlToUse = TTL$3;
|
|
444
|
+
var incomingRecord = normalize$3(input, store.readEntry(key), {
|
|
445
|
+
fullPath: key,
|
|
446
|
+
parent: path.parent,
|
|
447
|
+
propertyName: path.propertyName,
|
|
448
|
+
ttl: ttlToUse
|
|
449
|
+
}, luvio, store);
|
|
450
|
+
if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
|
|
451
|
+
luvio.storePublish(key, incomingRecord);
|
|
452
|
+
}
|
|
453
|
+
{
|
|
454
|
+
var storeMetadataParams = {
|
|
455
|
+
ttl: ttlToUse,
|
|
456
|
+
namespace: "CMSOrchestrator",
|
|
457
|
+
version: VERSION$4,
|
|
458
|
+
representationName: RepresentationType$3,
|
|
459
|
+
};
|
|
460
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
461
|
+
}
|
|
462
|
+
return createLink(key);
|
|
463
|
+
};
|
|
464
|
+
function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
|
|
465
|
+
var rootKeySet = new engine.StoreKeyMap();
|
|
466
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
467
|
+
var rootKey = fullPathFactory();
|
|
468
|
+
rootKeySet.set(rootKey, {
|
|
469
|
+
namespace: keyPrefix,
|
|
470
|
+
representationName: RepresentationType$3,
|
|
471
|
+
mergeable: false
|
|
472
|
+
});
|
|
473
|
+
var input_orchestrationDefinitions_length = input.orchestrationDefinitions.length;
|
|
474
|
+
for (var i = 0; i < input_orchestrationDefinitions_length; i++) {
|
|
475
|
+
rootKeySet.merge(getTypeCacheKeys$4(luvio, input.orchestrationDefinitions[i]));
|
|
476
|
+
}
|
|
477
|
+
return rootKeySet;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
function select$7(luvio, params) {
|
|
481
|
+
return select$8();
|
|
482
|
+
}
|
|
483
|
+
function keyBuilder$6(luvio, params) {
|
|
484
|
+
return keyPrefix + '::ManagedContentOrchestrationDefinitionCollectionRepresentation:(' + 'managedContentVariantId:' + params.queryParams.managedContentVariantId + ',' + 'page:' + params.queryParams.page + ',' + 'pageSize:' + params.queryParams.pageSize + ')';
|
|
485
|
+
}
|
|
486
|
+
function getResponseCacheKeys$3(luvio, resourceParams, response) {
|
|
487
|
+
return getTypeCacheKeys$3(luvio, response, function () { return keyBuilder$6(luvio, resourceParams); });
|
|
488
|
+
}
|
|
489
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
490
|
+
var body = response.body;
|
|
491
|
+
var key = keyBuilder$6(luvio, resourceParams);
|
|
492
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
493
|
+
var snapshot = luvio.storeLookup({
|
|
494
|
+
recordId: key,
|
|
495
|
+
node: select$7(),
|
|
496
|
+
variables: {},
|
|
497
|
+
}, snapshotRefresh);
|
|
498
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
499
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
500
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
return snapshot;
|
|
504
|
+
}
|
|
505
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
506
|
+
var key = keyBuilder$6(luvio, params);
|
|
507
|
+
var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
508
|
+
var storeMetadataParams = {
|
|
509
|
+
ttl: TTL$3,
|
|
510
|
+
namespace: keyPrefix,
|
|
511
|
+
version: VERSION$4,
|
|
512
|
+
representationName: RepresentationType$3
|
|
513
|
+
};
|
|
514
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
515
|
+
return errorSnapshot;
|
|
516
|
+
}
|
|
517
|
+
function createResourceRequest$3(config) {
|
|
518
|
+
var headers = {};
|
|
519
|
+
return {
|
|
520
|
+
baseUri: '/services/data/v58.0',
|
|
521
|
+
basePath: '/connect/cms/contents/orchestration-definitions',
|
|
522
|
+
method: 'get',
|
|
523
|
+
body: null,
|
|
524
|
+
urlParams: {},
|
|
525
|
+
queryParams: config.queryParams,
|
|
526
|
+
headers: headers,
|
|
527
|
+
priority: 'normal',
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
var getManagedContentOrchestrationDefinitions_ConfigPropertyNames = {
|
|
532
|
+
displayName: 'getManagedContentOrchestrationDefinitions',
|
|
533
|
+
parameters: {
|
|
534
|
+
required: [],
|
|
535
|
+
optional: ['managedContentVariantId', 'page', 'pageSize']
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
function createResourceParams$3(config) {
|
|
539
|
+
var resourceParams = {
|
|
540
|
+
queryParams: {
|
|
541
|
+
managedContentVariantId: config.managedContentVariantId, page: config.page, pageSize: config.pageSize
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
return resourceParams;
|
|
545
|
+
}
|
|
546
|
+
function keyBuilder$5(luvio, config) {
|
|
547
|
+
var resourceParams = createResourceParams$3(config);
|
|
548
|
+
return keyBuilder$6(luvio, resourceParams);
|
|
549
|
+
}
|
|
550
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
551
|
+
var config = {};
|
|
552
|
+
var untrustedConfig_managedContentVariantId = untrustedConfig.managedContentVariantId;
|
|
553
|
+
if (typeof untrustedConfig_managedContentVariantId === 'string') {
|
|
554
|
+
config.managedContentVariantId = untrustedConfig_managedContentVariantId;
|
|
555
|
+
}
|
|
556
|
+
var untrustedConfig_page = untrustedConfig.page;
|
|
557
|
+
if (typeof untrustedConfig_page === 'number' && Math.floor(untrustedConfig_page) === untrustedConfig_page) {
|
|
558
|
+
config.page = untrustedConfig_page;
|
|
559
|
+
}
|
|
560
|
+
var untrustedConfig_pageSize = untrustedConfig.pageSize;
|
|
561
|
+
if (typeof untrustedConfig_pageSize === 'number' && Math.floor(untrustedConfig_pageSize) === untrustedConfig_pageSize) {
|
|
562
|
+
config.pageSize = untrustedConfig_pageSize;
|
|
563
|
+
}
|
|
564
|
+
return config;
|
|
565
|
+
}
|
|
566
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
567
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
570
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
571
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
572
|
+
}
|
|
573
|
+
var config = typeCheckConfig$3(untrustedConfig);
|
|
574
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
575
|
+
return null;
|
|
576
|
+
}
|
|
577
|
+
return config;
|
|
578
|
+
}
|
|
579
|
+
function adapterFragment$2(luvio, config) {
|
|
580
|
+
createResourceParams$3(config);
|
|
581
|
+
return select$7();
|
|
582
|
+
}
|
|
583
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
584
|
+
var snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
585
|
+
config: config,
|
|
586
|
+
resolve: function () { return buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions); }
|
|
587
|
+
});
|
|
588
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
589
|
+
}
|
|
590
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
591
|
+
var snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
592
|
+
config: config,
|
|
593
|
+
resolve: function () { return buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions); }
|
|
594
|
+
});
|
|
595
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
596
|
+
}
|
|
597
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
598
|
+
var resourceParams = createResourceParams$3(config);
|
|
599
|
+
var request = createResourceRequest$3(resourceParams);
|
|
600
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
601
|
+
.then(function (response) {
|
|
602
|
+
return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$2(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$3(luvio, resourceParams, response.body); });
|
|
603
|
+
}, function (response) {
|
|
604
|
+
return luvio.handleErrorResponse(function () { return onFetchResponseError$2(luvio, config, resourceParams, response); });
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
608
|
+
var luvio = context.luvio, config = context.config;
|
|
609
|
+
var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
|
|
610
|
+
var dispatchOptions = {
|
|
611
|
+
resourceRequestContext: {
|
|
612
|
+
requestCorrelator: requestCorrelator,
|
|
613
|
+
luvioRequestMethod: undefined,
|
|
614
|
+
},
|
|
615
|
+
eventObservers: eventObservers
|
|
616
|
+
};
|
|
617
|
+
if (networkPriority !== 'normal') {
|
|
618
|
+
dispatchOptions.overrides = {
|
|
619
|
+
priority: networkPriority
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
|
|
623
|
+
}
|
|
624
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
625
|
+
var luvio = context.luvio, config = context.config;
|
|
626
|
+
var selector = {
|
|
627
|
+
recordId: keyBuilder$5(luvio, config),
|
|
628
|
+
node: adapterFragment$2(luvio, config),
|
|
629
|
+
variables: {},
|
|
630
|
+
};
|
|
631
|
+
var cacheSnapshot = storeLookup(selector, {
|
|
632
|
+
config: config,
|
|
633
|
+
resolve: function () { return buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions); }
|
|
634
|
+
});
|
|
635
|
+
return cacheSnapshot;
|
|
636
|
+
}
|
|
637
|
+
var getManagedContentOrchestrationDefinitionsAdapterFactory = function (luvio) { return function CMSOrchestrator__getManagedContentOrchestrationDefinitions(untrustedConfig, requestContext) {
|
|
638
|
+
var config = validateAdapterConfig$3(untrustedConfig, getManagedContentOrchestrationDefinitions_ConfigPropertyNames);
|
|
639
|
+
// Invalid or incomplete config
|
|
640
|
+
if (config === null) {
|
|
641
|
+
return null;
|
|
642
|
+
}
|
|
643
|
+
return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
|
|
644
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
645
|
+
}; };
|
|
646
|
+
|
|
647
|
+
var TTL$2 = 100;
|
|
648
|
+
var VERSION$3 = "fd41d1688072d0b3d7e856f50ad268a8";
|
|
649
|
+
function validate$4(obj, path) {
|
|
650
|
+
if (path === void 0) { path = 'ManagedContentOrchestrationInstanceRepresentation'; }
|
|
651
|
+
var v_error = (function () {
|
|
652
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
653
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
654
|
+
}
|
|
655
|
+
var obj_managedContentOrchestrationInstanceId = obj.managedContentOrchestrationInstanceId;
|
|
656
|
+
var path_managedContentOrchestrationInstanceId = path + '.managedContentOrchestrationInstanceId';
|
|
657
|
+
if (typeof obj_managedContentOrchestrationInstanceId !== 'string') {
|
|
658
|
+
return new TypeError('Expected "string" but received "' + typeof obj_managedContentOrchestrationInstanceId + '" (at "' + path_managedContentOrchestrationInstanceId + '")');
|
|
659
|
+
}
|
|
660
|
+
var obj_managedContentVariantId = obj.managedContentVariantId;
|
|
661
|
+
var path_managedContentVariantId = path + '.managedContentVariantId';
|
|
662
|
+
if (typeof obj_managedContentVariantId !== 'string') {
|
|
663
|
+
return new TypeError('Expected "string" but received "' + typeof obj_managedContentVariantId + '" (at "' + path_managedContentVariantId + '")');
|
|
664
|
+
}
|
|
665
|
+
var obj_orchestrationDefinition = obj.orchestrationDefinition;
|
|
666
|
+
var path_orchestrationDefinition = path + '.orchestrationDefinition';
|
|
667
|
+
if (typeof obj_orchestrationDefinition !== 'object') {
|
|
668
|
+
return new TypeError('Expected "object" but received "' + typeof obj_orchestrationDefinition + '" (at "' + path_orchestrationDefinition + '")');
|
|
669
|
+
}
|
|
670
|
+
})();
|
|
671
|
+
return v_error === undefined ? null : v_error;
|
|
672
|
+
}
|
|
673
|
+
var RepresentationType$2 = 'ManagedContentOrchestrationInstanceRepresentation';
|
|
674
|
+
function keyBuilder$4(luvio, config) {
|
|
675
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.id;
|
|
676
|
+
}
|
|
677
|
+
function keyBuilderFromType(luvio, object) {
|
|
678
|
+
var keyParams = {
|
|
679
|
+
id: object.managedContentVariantId
|
|
680
|
+
};
|
|
681
|
+
return keyBuilder$4(luvio, keyParams);
|
|
682
|
+
}
|
|
683
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
684
|
+
var input_orchestrationDefinition = input.orchestrationDefinition;
|
|
685
|
+
var input_orchestrationDefinition_id = path.fullPath + '__orchestrationDefinition';
|
|
686
|
+
input.orchestrationDefinition = ingest$4(input_orchestrationDefinition, {
|
|
687
|
+
fullPath: input_orchestrationDefinition_id,
|
|
688
|
+
propertyName: 'orchestrationDefinition',
|
|
689
|
+
parent: {
|
|
690
|
+
data: input,
|
|
691
|
+
key: path.fullPath,
|
|
692
|
+
existing: existing,
|
|
693
|
+
},
|
|
694
|
+
ttl: path.ttl
|
|
695
|
+
}, luvio, store);
|
|
696
|
+
return input;
|
|
697
|
+
}
|
|
698
|
+
var select$6 = function ManagedContentOrchestrationInstanceRepresentationSelect() {
|
|
699
|
+
return {
|
|
700
|
+
kind: 'Fragment',
|
|
701
|
+
version: VERSION$3,
|
|
702
|
+
private: [],
|
|
703
|
+
selections: [
|
|
704
|
+
{
|
|
705
|
+
name: 'managedContentOrchestrationInstanceId',
|
|
706
|
+
kind: 'Scalar'
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
name: 'managedContentVariantId',
|
|
710
|
+
kind: 'Scalar'
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
name: 'orchestrationDefinition',
|
|
714
|
+
kind: 'Link',
|
|
715
|
+
fragment: select$9()
|
|
716
|
+
}
|
|
717
|
+
]
|
|
718
|
+
};
|
|
719
|
+
};
|
|
720
|
+
function equals$3(existing, incoming) {
|
|
721
|
+
var existing_managedContentOrchestrationInstanceId = existing.managedContentOrchestrationInstanceId;
|
|
722
|
+
var incoming_managedContentOrchestrationInstanceId = incoming.managedContentOrchestrationInstanceId;
|
|
723
|
+
if (!(existing_managedContentOrchestrationInstanceId === incoming_managedContentOrchestrationInstanceId)) {
|
|
724
|
+
return false;
|
|
725
|
+
}
|
|
726
|
+
var existing_managedContentVariantId = existing.managedContentVariantId;
|
|
727
|
+
var incoming_managedContentVariantId = incoming.managedContentVariantId;
|
|
728
|
+
if (!(existing_managedContentVariantId === incoming_managedContentVariantId)) {
|
|
729
|
+
return false;
|
|
730
|
+
}
|
|
731
|
+
var existing_orchestrationDefinition = existing.orchestrationDefinition;
|
|
732
|
+
var incoming_orchestrationDefinition = incoming.orchestrationDefinition;
|
|
733
|
+
if (!(existing_orchestrationDefinition.__ref === incoming_orchestrationDefinition.__ref)) {
|
|
734
|
+
return false;
|
|
735
|
+
}
|
|
736
|
+
return true;
|
|
737
|
+
}
|
|
738
|
+
var ingest$2 = function ManagedContentOrchestrationInstanceRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
739
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
740
|
+
var validateError = validate$4(input);
|
|
741
|
+
if (validateError !== null) {
|
|
742
|
+
throw validateError;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
var key = keyBuilderFromType(luvio, input);
|
|
746
|
+
var existingRecord = store.readEntry(key);
|
|
747
|
+
var ttlToUse = TTL$2;
|
|
748
|
+
var incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
749
|
+
fullPath: key,
|
|
750
|
+
parent: path.parent,
|
|
751
|
+
propertyName: path.propertyName,
|
|
752
|
+
ttl: ttlToUse
|
|
753
|
+
}, luvio, store);
|
|
754
|
+
if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
|
|
755
|
+
luvio.storePublish(key, incomingRecord);
|
|
756
|
+
}
|
|
757
|
+
{
|
|
758
|
+
var storeMetadataParams = {
|
|
759
|
+
ttl: ttlToUse,
|
|
760
|
+
namespace: "CMSOrchestrator",
|
|
761
|
+
version: VERSION$3,
|
|
762
|
+
representationName: RepresentationType$2,
|
|
763
|
+
};
|
|
764
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
765
|
+
}
|
|
766
|
+
return createLink(key);
|
|
767
|
+
};
|
|
768
|
+
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
769
|
+
var rootKeySet = new engine.StoreKeyMap();
|
|
770
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
771
|
+
var rootKey = keyBuilderFromType(luvio, input);
|
|
772
|
+
rootKeySet.set(rootKey, {
|
|
773
|
+
namespace: keyPrefix,
|
|
774
|
+
representationName: RepresentationType$2,
|
|
775
|
+
mergeable: false
|
|
776
|
+
});
|
|
777
|
+
var input_orchestrationDefinition = getTypeCacheKeys$4(luvio, input.orchestrationDefinition);
|
|
778
|
+
rootKeySet.merge(input_orchestrationDefinition);
|
|
779
|
+
return rootKeySet;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
var TTL$1 = 100;
|
|
783
|
+
var VERSION$2 = "f9f67586e8cd826574cc122b14ced0e8";
|
|
784
|
+
function validate$3(obj, path) {
|
|
785
|
+
if (path === void 0) { path = 'ManagedContentOrchestrationInstanceCollectionRepresentation'; }
|
|
786
|
+
var v_error = (function () {
|
|
787
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
788
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
789
|
+
}
|
|
790
|
+
var obj_orchestrationInstances = obj.orchestrationInstances;
|
|
791
|
+
var path_orchestrationInstances = path + '.orchestrationInstances';
|
|
792
|
+
if (!ArrayIsArray(obj_orchestrationInstances)) {
|
|
793
|
+
return new TypeError('Expected "array" but received "' + typeof obj_orchestrationInstances + '" (at "' + path_orchestrationInstances + '")');
|
|
794
|
+
}
|
|
795
|
+
for (var i = 0; i < obj_orchestrationInstances.length; i++) {
|
|
796
|
+
var obj_orchestrationInstances_item = obj_orchestrationInstances[i];
|
|
797
|
+
var path_orchestrationInstances_item = path_orchestrationInstances + '[' + i + ']';
|
|
798
|
+
if (typeof obj_orchestrationInstances_item !== 'object') {
|
|
799
|
+
return new TypeError('Expected "object" but received "' + typeof obj_orchestrationInstances_item + '" (at "' + path_orchestrationInstances_item + '")');
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
})();
|
|
803
|
+
return v_error === undefined ? null : v_error;
|
|
804
|
+
}
|
|
805
|
+
var RepresentationType$1 = 'ManagedContentOrchestrationInstanceCollectionRepresentation';
|
|
806
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
807
|
+
var input_orchestrationInstances = input.orchestrationInstances;
|
|
808
|
+
var input_orchestrationInstances_id = path.fullPath + '__orchestrationInstances';
|
|
809
|
+
for (var i = 0; i < input_orchestrationInstances.length; i++) {
|
|
810
|
+
var input_orchestrationInstances_item = input_orchestrationInstances[i];
|
|
811
|
+
var input_orchestrationInstances_item_id = input_orchestrationInstances_id + '__' + i;
|
|
812
|
+
input_orchestrationInstances[i] = ingest$2(input_orchestrationInstances_item, {
|
|
813
|
+
fullPath: input_orchestrationInstances_item_id,
|
|
814
|
+
propertyName: i,
|
|
815
|
+
parent: {
|
|
816
|
+
data: input,
|
|
817
|
+
key: path.fullPath,
|
|
818
|
+
existing: existing,
|
|
819
|
+
},
|
|
820
|
+
ttl: path.ttl
|
|
821
|
+
}, luvio, store);
|
|
822
|
+
}
|
|
823
|
+
return input;
|
|
824
|
+
}
|
|
825
|
+
var select$5 = function ManagedContentOrchestrationInstanceCollectionRepresentationSelect() {
|
|
826
|
+
return {
|
|
827
|
+
kind: 'Fragment',
|
|
828
|
+
version: VERSION$2,
|
|
829
|
+
private: [],
|
|
830
|
+
selections: [
|
|
831
|
+
{
|
|
832
|
+
name: 'orchestrationInstances',
|
|
833
|
+
kind: 'Link',
|
|
834
|
+
plural: true,
|
|
835
|
+
fragment: select$6()
|
|
836
|
+
}
|
|
837
|
+
]
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
function equals$2(existing, incoming) {
|
|
841
|
+
var existing_orchestrationInstances = existing.orchestrationInstances;
|
|
842
|
+
var incoming_orchestrationInstances = incoming.orchestrationInstances;
|
|
843
|
+
var equals_orchestrationInstances_items = equalsArray(existing_orchestrationInstances, incoming_orchestrationInstances, function (existing_orchestrationInstances_item, incoming_orchestrationInstances_item) {
|
|
844
|
+
if (!(existing_orchestrationInstances_item.__ref === incoming_orchestrationInstances_item.__ref)) {
|
|
845
|
+
return false;
|
|
846
|
+
}
|
|
847
|
+
});
|
|
848
|
+
if (equals_orchestrationInstances_items === false) {
|
|
849
|
+
return false;
|
|
850
|
+
}
|
|
851
|
+
return true;
|
|
852
|
+
}
|
|
853
|
+
var ingest$1 = function ManagedContentOrchestrationInstanceCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
854
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
855
|
+
var validateError = validate$3(input);
|
|
856
|
+
if (validateError !== null) {
|
|
857
|
+
throw validateError;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
var key = path.fullPath;
|
|
861
|
+
var existingRecord = store.readEntry(key);
|
|
862
|
+
var ttlToUse = TTL$1;
|
|
863
|
+
var incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
864
|
+
fullPath: key,
|
|
865
|
+
parent: path.parent,
|
|
866
|
+
propertyName: path.propertyName,
|
|
867
|
+
ttl: ttlToUse
|
|
868
|
+
}, luvio, store);
|
|
869
|
+
if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
|
|
870
|
+
luvio.storePublish(key, incomingRecord);
|
|
871
|
+
}
|
|
872
|
+
{
|
|
873
|
+
var storeMetadataParams = {
|
|
874
|
+
ttl: ttlToUse,
|
|
875
|
+
namespace: "CMSOrchestrator",
|
|
876
|
+
version: VERSION$2,
|
|
877
|
+
representationName: RepresentationType$1,
|
|
878
|
+
};
|
|
879
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
880
|
+
}
|
|
881
|
+
return createLink(key);
|
|
882
|
+
};
|
|
883
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
884
|
+
var rootKeySet = new engine.StoreKeyMap();
|
|
885
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
886
|
+
var rootKey = fullPathFactory();
|
|
887
|
+
rootKeySet.set(rootKey, {
|
|
888
|
+
namespace: keyPrefix,
|
|
889
|
+
representationName: RepresentationType$1,
|
|
890
|
+
mergeable: false
|
|
891
|
+
});
|
|
892
|
+
var input_orchestrationInstances_length = input.orchestrationInstances.length;
|
|
893
|
+
for (var i = 0; i < input_orchestrationInstances_length; i++) {
|
|
894
|
+
rootKeySet.merge(getTypeCacheKeys$2(luvio, input.orchestrationInstances[i]));
|
|
895
|
+
}
|
|
896
|
+
return rootKeySet;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
function select$4(luvio, params) {
|
|
900
|
+
return select$5();
|
|
901
|
+
}
|
|
902
|
+
function keyBuilder$3(luvio, params) {
|
|
903
|
+
return keyPrefix + '::ManagedContentOrchestrationInstanceCollectionRepresentation:(' + 'managedContentVariantId:' + params.queryParams.managedContentVariantId + ')';
|
|
904
|
+
}
|
|
905
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
906
|
+
return getTypeCacheKeys$1(luvio, response, function () { return keyBuilder$3(luvio, resourceParams); });
|
|
907
|
+
}
|
|
908
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
909
|
+
var body = response.body;
|
|
910
|
+
var key = keyBuilder$3(luvio, resourceParams);
|
|
911
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
912
|
+
var snapshot = luvio.storeLookup({
|
|
913
|
+
recordId: key,
|
|
914
|
+
node: select$4(),
|
|
915
|
+
variables: {},
|
|
916
|
+
}, snapshotRefresh);
|
|
917
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
918
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
919
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
return snapshot;
|
|
923
|
+
}
|
|
924
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
925
|
+
var key = keyBuilder$3(luvio, params);
|
|
926
|
+
var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
927
|
+
var storeMetadataParams = {
|
|
928
|
+
ttl: TTL$1,
|
|
929
|
+
namespace: keyPrefix,
|
|
930
|
+
version: VERSION$2,
|
|
931
|
+
representationName: RepresentationType$1
|
|
932
|
+
};
|
|
933
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
934
|
+
return errorSnapshot;
|
|
935
|
+
}
|
|
936
|
+
function createResourceRequest$2(config) {
|
|
937
|
+
var headers = {};
|
|
938
|
+
return {
|
|
939
|
+
baseUri: '/services/data/v58.0',
|
|
940
|
+
basePath: '/connect/cms/contents/orchestration-instances',
|
|
941
|
+
method: 'get',
|
|
942
|
+
body: null,
|
|
943
|
+
urlParams: {},
|
|
944
|
+
queryParams: config.queryParams,
|
|
945
|
+
headers: headers,
|
|
946
|
+
priority: 'normal',
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
var getManagedContentOrchestrationInstances_ConfigPropertyNames = {
|
|
951
|
+
displayName: 'getManagedContentOrchestrationInstances',
|
|
952
|
+
parameters: {
|
|
953
|
+
required: [],
|
|
954
|
+
optional: ['managedContentVariantId']
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
function createResourceParams$2(config) {
|
|
958
|
+
var resourceParams = {
|
|
959
|
+
queryParams: {
|
|
960
|
+
managedContentVariantId: config.managedContentVariantId
|
|
961
|
+
}
|
|
962
|
+
};
|
|
963
|
+
return resourceParams;
|
|
964
|
+
}
|
|
965
|
+
function keyBuilder$2(luvio, config) {
|
|
966
|
+
var resourceParams = createResourceParams$2(config);
|
|
967
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
968
|
+
}
|
|
969
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
970
|
+
var config = {};
|
|
971
|
+
var untrustedConfig_managedContentVariantId = untrustedConfig.managedContentVariantId;
|
|
972
|
+
if (typeof untrustedConfig_managedContentVariantId === 'string') {
|
|
973
|
+
config.managedContentVariantId = untrustedConfig_managedContentVariantId;
|
|
974
|
+
}
|
|
975
|
+
return config;
|
|
976
|
+
}
|
|
977
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
978
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
979
|
+
return null;
|
|
980
|
+
}
|
|
981
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
982
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
983
|
+
}
|
|
984
|
+
var config = typeCheckConfig$2(untrustedConfig);
|
|
985
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
986
|
+
return null;
|
|
987
|
+
}
|
|
988
|
+
return config;
|
|
989
|
+
}
|
|
990
|
+
function adapterFragment$1(luvio, config) {
|
|
991
|
+
createResourceParams$2(config);
|
|
992
|
+
return select$4();
|
|
993
|
+
}
|
|
994
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
995
|
+
var snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
996
|
+
config: config,
|
|
997
|
+
resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
|
|
998
|
+
});
|
|
999
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
1000
|
+
}
|
|
1001
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1002
|
+
var snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1003
|
+
config: config,
|
|
1004
|
+
resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
|
|
1005
|
+
});
|
|
1006
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
1007
|
+
}
|
|
1008
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1009
|
+
var resourceParams = createResourceParams$2(config);
|
|
1010
|
+
var request = createResourceRequest$2(resourceParams);
|
|
1011
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1012
|
+
.then(function (response) {
|
|
1013
|
+
return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$1(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$2(luvio, resourceParams, response.body); });
|
|
1014
|
+
}, function (response) {
|
|
1015
|
+
return luvio.handleErrorResponse(function () { return onFetchResponseError$1(luvio, config, resourceParams, response); });
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1019
|
+
var luvio = context.luvio, config = context.config;
|
|
1020
|
+
var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
|
|
1021
|
+
var dispatchOptions = {
|
|
1022
|
+
resourceRequestContext: {
|
|
1023
|
+
requestCorrelator: requestCorrelator,
|
|
1024
|
+
luvioRequestMethod: undefined,
|
|
1025
|
+
},
|
|
1026
|
+
eventObservers: eventObservers
|
|
1027
|
+
};
|
|
1028
|
+
if (networkPriority !== 'normal') {
|
|
1029
|
+
dispatchOptions.overrides = {
|
|
1030
|
+
priority: networkPriority
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
|
|
1034
|
+
}
|
|
1035
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1036
|
+
var luvio = context.luvio, config = context.config;
|
|
1037
|
+
var selector = {
|
|
1038
|
+
recordId: keyBuilder$2(luvio, config),
|
|
1039
|
+
node: adapterFragment$1(luvio, config),
|
|
1040
|
+
variables: {},
|
|
1041
|
+
};
|
|
1042
|
+
var cacheSnapshot = storeLookup(selector, {
|
|
1043
|
+
config: config,
|
|
1044
|
+
resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
|
|
1045
|
+
});
|
|
1046
|
+
return cacheSnapshot;
|
|
1047
|
+
}
|
|
1048
|
+
var getManagedContentOrchestrationInstancesAdapterFactory = function (luvio) { return function CMSOrchestrator__getManagedContentOrchestrationInstances(untrustedConfig, requestContext) {
|
|
1049
|
+
var config = validateAdapterConfig$2(untrustedConfig, getManagedContentOrchestrationInstances_ConfigPropertyNames);
|
|
1050
|
+
// Invalid or incomplete config
|
|
1051
|
+
if (config === null) {
|
|
1052
|
+
return null;
|
|
1053
|
+
}
|
|
1054
|
+
return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
|
|
1055
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1056
|
+
}; };
|
|
1057
|
+
|
|
1058
|
+
function validate$2(obj, path) {
|
|
1059
|
+
if (path === void 0) { path = 'ManagedContentOrchestrationInstanceInputRepresentation'; }
|
|
1060
|
+
var v_error = (function () {
|
|
1061
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1062
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1063
|
+
}
|
|
1064
|
+
var obj_managedContentVariantId = obj.managedContentVariantId;
|
|
1065
|
+
var path_managedContentVariantId = path + '.managedContentVariantId';
|
|
1066
|
+
if (typeof obj_managedContentVariantId !== 'string') {
|
|
1067
|
+
return new TypeError('Expected "string" but received "' + typeof obj_managedContentVariantId + '" (at "' + path_managedContentVariantId + '")');
|
|
1068
|
+
}
|
|
1069
|
+
var obj_orchestrationDefinitionDeveloperName = obj.orchestrationDefinitionDeveloperName;
|
|
1070
|
+
var path_orchestrationDefinitionDeveloperName = path + '.orchestrationDefinitionDeveloperName';
|
|
1071
|
+
if (typeof obj_orchestrationDefinitionDeveloperName !== 'string') {
|
|
1072
|
+
return new TypeError('Expected "string" but received "' + typeof obj_orchestrationDefinitionDeveloperName + '" (at "' + path_orchestrationDefinitionDeveloperName + '")');
|
|
1073
|
+
}
|
|
1074
|
+
})();
|
|
1075
|
+
return v_error === undefined ? null : v_error;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
function select$3(luvio, params) {
|
|
1079
|
+
return select$6();
|
|
1080
|
+
}
|
|
1081
|
+
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
1082
|
+
return getTypeCacheKeys$2(luvio, response);
|
|
1083
|
+
}
|
|
1084
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
1085
|
+
var body = response.body;
|
|
1086
|
+
var key = keyBuilderFromType(luvio, body);
|
|
1087
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1088
|
+
var snapshot = luvio.storeLookup({
|
|
1089
|
+
recordId: key,
|
|
1090
|
+
node: select$3(),
|
|
1091
|
+
variables: {},
|
|
1092
|
+
});
|
|
1093
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1094
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1095
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
return snapshot;
|
|
1099
|
+
}
|
|
1100
|
+
function createResourceRequest$1(config) {
|
|
1101
|
+
var headers = {};
|
|
1102
|
+
return {
|
|
1103
|
+
baseUri: '/services/data/v58.0',
|
|
1104
|
+
basePath: '/connect/cms/contents/orchestration-instances',
|
|
1105
|
+
method: 'post',
|
|
1106
|
+
body: config.body,
|
|
1107
|
+
urlParams: {},
|
|
1108
|
+
queryParams: {},
|
|
1109
|
+
headers: headers,
|
|
1110
|
+
priority: 'normal',
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
var createManagedContentOrchestrationInstance_ConfigPropertyNames = {
|
|
1115
|
+
displayName: 'createManagedContentOrchestrationInstance',
|
|
1116
|
+
parameters: {
|
|
1117
|
+
required: ['mContentOrchInstanceInput'],
|
|
1118
|
+
optional: []
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
function createResourceParams$1(config) {
|
|
1122
|
+
var resourceParams = {
|
|
1123
|
+
body: {
|
|
1124
|
+
mContentOrchInstanceInput: config.mContentOrchInstanceInput
|
|
1125
|
+
}
|
|
1126
|
+
};
|
|
1127
|
+
return resourceParams;
|
|
1128
|
+
}
|
|
1129
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1130
|
+
var config = {};
|
|
1131
|
+
var untrustedConfig_mContentOrchInstanceInput = untrustedConfig.mContentOrchInstanceInput;
|
|
1132
|
+
var referenceManagedContentOrchestrationInstanceInputRepresentationValidationError = validate$2(untrustedConfig_mContentOrchInstanceInput);
|
|
1133
|
+
if (referenceManagedContentOrchestrationInstanceInputRepresentationValidationError === null) {
|
|
1134
|
+
config.mContentOrchInstanceInput = untrustedConfig_mContentOrchInstanceInput;
|
|
1135
|
+
}
|
|
1136
|
+
return config;
|
|
1137
|
+
}
|
|
1138
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1139
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1140
|
+
return null;
|
|
1141
|
+
}
|
|
1142
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1143
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1144
|
+
}
|
|
1145
|
+
var config = typeCheckConfig$1(untrustedConfig);
|
|
1146
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1147
|
+
return null;
|
|
1148
|
+
}
|
|
1149
|
+
return config;
|
|
1150
|
+
}
|
|
1151
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1152
|
+
var resourceParams = createResourceParams$1(config);
|
|
1153
|
+
var request = createResourceRequest$1(resourceParams);
|
|
1154
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1155
|
+
.then(function (response) {
|
|
1156
|
+
return luvio.handleSuccessResponse(function () {
|
|
1157
|
+
var snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
1158
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
1159
|
+
}, function () { return getResponseCacheKeys$1(luvio, resourceParams, response.body); });
|
|
1160
|
+
}, function (response) {
|
|
1161
|
+
deepFreeze(response);
|
|
1162
|
+
throw response;
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
var createManagedContentOrchestrationInstanceAdapterFactory = function (luvio) {
|
|
1166
|
+
return function createManagedContentOrchestrationInstance(untrustedConfig) {
|
|
1167
|
+
var config = validateAdapterConfig$1(untrustedConfig, createManagedContentOrchestrationInstance_ConfigPropertyNames);
|
|
1168
|
+
// Invalid or incomplete config
|
|
1169
|
+
if (config === null) {
|
|
1170
|
+
throw new Error('Invalid config for "createManagedContentOrchestrationInstance"');
|
|
1171
|
+
}
|
|
1172
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
1173
|
+
};
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
var VERSION$1 = "ff1ebc5f13699d99fb6b7c63f435c216";
|
|
1177
|
+
function validate$1(obj, path) {
|
|
1178
|
+
if (path === void 0) { path = 'ManagedContentRunningOrchestrationHistoryEventRepresentation'; }
|
|
1179
|
+
var v_error = (function () {
|
|
1180
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1181
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1182
|
+
}
|
|
1183
|
+
var obj_actorEmail = obj.actorEmail;
|
|
1184
|
+
var path_actorEmail = path + '.actorEmail';
|
|
1185
|
+
var obj_actorEmail_union0 = null;
|
|
1186
|
+
var obj_actorEmail_union0_error = (function () {
|
|
1187
|
+
if (typeof obj_actorEmail !== 'string') {
|
|
1188
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actorEmail + '" (at "' + path_actorEmail + '")');
|
|
1189
|
+
}
|
|
1190
|
+
})();
|
|
1191
|
+
if (obj_actorEmail_union0_error != null) {
|
|
1192
|
+
obj_actorEmail_union0 = obj_actorEmail_union0_error.message;
|
|
1193
|
+
}
|
|
1194
|
+
var obj_actorEmail_union1 = null;
|
|
1195
|
+
var obj_actorEmail_union1_error = (function () {
|
|
1196
|
+
if (obj_actorEmail !== null) {
|
|
1197
|
+
return new TypeError('Expected "null" but received "' + typeof obj_actorEmail + '" (at "' + path_actorEmail + '")');
|
|
1198
|
+
}
|
|
1199
|
+
})();
|
|
1200
|
+
if (obj_actorEmail_union1_error != null) {
|
|
1201
|
+
obj_actorEmail_union1 = obj_actorEmail_union1_error.message;
|
|
1202
|
+
}
|
|
1203
|
+
if (obj_actorEmail_union0 && obj_actorEmail_union1) {
|
|
1204
|
+
var message = 'Object doesn\'t match union (at "' + path_actorEmail + '")';
|
|
1205
|
+
message += '\n' + obj_actorEmail_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1206
|
+
message += '\n' + obj_actorEmail_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1207
|
+
return new TypeError(message);
|
|
1208
|
+
}
|
|
1209
|
+
var obj_actorName = obj.actorName;
|
|
1210
|
+
var path_actorName = path + '.actorName';
|
|
1211
|
+
var obj_actorName_union0 = null;
|
|
1212
|
+
var obj_actorName_union0_error = (function () {
|
|
1213
|
+
if (typeof obj_actorName !== 'string') {
|
|
1214
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actorName + '" (at "' + path_actorName + '")');
|
|
1215
|
+
}
|
|
1216
|
+
})();
|
|
1217
|
+
if (obj_actorName_union0_error != null) {
|
|
1218
|
+
obj_actorName_union0 = obj_actorName_union0_error.message;
|
|
1219
|
+
}
|
|
1220
|
+
var obj_actorName_union1 = null;
|
|
1221
|
+
var obj_actorName_union1_error = (function () {
|
|
1222
|
+
if (obj_actorName !== null) {
|
|
1223
|
+
return new TypeError('Expected "null" but received "' + typeof obj_actorName + '" (at "' + path_actorName + '")');
|
|
1224
|
+
}
|
|
1225
|
+
})();
|
|
1226
|
+
if (obj_actorName_union1_error != null) {
|
|
1227
|
+
obj_actorName_union1 = obj_actorName_union1_error.message;
|
|
1228
|
+
}
|
|
1229
|
+
if (obj_actorName_union0 && obj_actorName_union1) {
|
|
1230
|
+
var message = 'Object doesn\'t match union (at "' + path_actorName + '")';
|
|
1231
|
+
message += '\n' + obj_actorName_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1232
|
+
message += '\n' + obj_actorName_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1233
|
+
return new TypeError(message);
|
|
1234
|
+
}
|
|
1235
|
+
var obj_assigneeDevNameOrEmail = obj.assigneeDevNameOrEmail;
|
|
1236
|
+
var path_assigneeDevNameOrEmail = path + '.assigneeDevNameOrEmail';
|
|
1237
|
+
var obj_assigneeDevNameOrEmail_union0 = null;
|
|
1238
|
+
var obj_assigneeDevNameOrEmail_union0_error = (function () {
|
|
1239
|
+
if (typeof obj_assigneeDevNameOrEmail !== 'string') {
|
|
1240
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assigneeDevNameOrEmail + '" (at "' + path_assigneeDevNameOrEmail + '")');
|
|
1241
|
+
}
|
|
1242
|
+
})();
|
|
1243
|
+
if (obj_assigneeDevNameOrEmail_union0_error != null) {
|
|
1244
|
+
obj_assigneeDevNameOrEmail_union0 = obj_assigneeDevNameOrEmail_union0_error.message;
|
|
1245
|
+
}
|
|
1246
|
+
var obj_assigneeDevNameOrEmail_union1 = null;
|
|
1247
|
+
var obj_assigneeDevNameOrEmail_union1_error = (function () {
|
|
1248
|
+
if (obj_assigneeDevNameOrEmail !== null) {
|
|
1249
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assigneeDevNameOrEmail + '" (at "' + path_assigneeDevNameOrEmail + '")');
|
|
1250
|
+
}
|
|
1251
|
+
})();
|
|
1252
|
+
if (obj_assigneeDevNameOrEmail_union1_error != null) {
|
|
1253
|
+
obj_assigneeDevNameOrEmail_union1 = obj_assigneeDevNameOrEmail_union1_error.message;
|
|
1254
|
+
}
|
|
1255
|
+
if (obj_assigneeDevNameOrEmail_union0 && obj_assigneeDevNameOrEmail_union1) {
|
|
1256
|
+
var message = 'Object doesn\'t match union (at "' + path_assigneeDevNameOrEmail + '")';
|
|
1257
|
+
message += '\n' + obj_assigneeDevNameOrEmail_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1258
|
+
message += '\n' + obj_assigneeDevNameOrEmail_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1259
|
+
return new TypeError(message);
|
|
1260
|
+
}
|
|
1261
|
+
var obj_assigneeName = obj.assigneeName;
|
|
1262
|
+
var path_assigneeName = path + '.assigneeName';
|
|
1263
|
+
var obj_assigneeName_union0 = null;
|
|
1264
|
+
var obj_assigneeName_union0_error = (function () {
|
|
1265
|
+
if (typeof obj_assigneeName !== 'string') {
|
|
1266
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assigneeName + '" (at "' + path_assigneeName + '")');
|
|
1267
|
+
}
|
|
1268
|
+
})();
|
|
1269
|
+
if (obj_assigneeName_union0_error != null) {
|
|
1270
|
+
obj_assigneeName_union0 = obj_assigneeName_union0_error.message;
|
|
1271
|
+
}
|
|
1272
|
+
var obj_assigneeName_union1 = null;
|
|
1273
|
+
var obj_assigneeName_union1_error = (function () {
|
|
1274
|
+
if (obj_assigneeName !== null) {
|
|
1275
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assigneeName + '" (at "' + path_assigneeName + '")');
|
|
1276
|
+
}
|
|
1277
|
+
})();
|
|
1278
|
+
if (obj_assigneeName_union1_error != null) {
|
|
1279
|
+
obj_assigneeName_union1 = obj_assigneeName_union1_error.message;
|
|
1280
|
+
}
|
|
1281
|
+
if (obj_assigneeName_union0 && obj_assigneeName_union1) {
|
|
1282
|
+
var message = 'Object doesn\'t match union (at "' + path_assigneeName + '")';
|
|
1283
|
+
message += '\n' + obj_assigneeName_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1284
|
+
message += '\n' + obj_assigneeName_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1285
|
+
return new TypeError(message);
|
|
1286
|
+
}
|
|
1287
|
+
var obj_assigneeType = obj.assigneeType;
|
|
1288
|
+
var path_assigneeType = path + '.assigneeType';
|
|
1289
|
+
var obj_assigneeType_union0 = null;
|
|
1290
|
+
var obj_assigneeType_union0_error = (function () {
|
|
1291
|
+
if (typeof obj_assigneeType !== 'string') {
|
|
1292
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assigneeType + '" (at "' + path_assigneeType + '")');
|
|
1293
|
+
}
|
|
1294
|
+
})();
|
|
1295
|
+
if (obj_assigneeType_union0_error != null) {
|
|
1296
|
+
obj_assigneeType_union0 = obj_assigneeType_union0_error.message;
|
|
1297
|
+
}
|
|
1298
|
+
var obj_assigneeType_union1 = null;
|
|
1299
|
+
var obj_assigneeType_union1_error = (function () {
|
|
1300
|
+
if (obj_assigneeType !== null) {
|
|
1301
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assigneeType + '" (at "' + path_assigneeType + '")');
|
|
1302
|
+
}
|
|
1303
|
+
})();
|
|
1304
|
+
if (obj_assigneeType_union1_error != null) {
|
|
1305
|
+
obj_assigneeType_union1 = obj_assigneeType_union1_error.message;
|
|
1306
|
+
}
|
|
1307
|
+
if (obj_assigneeType_union0 && obj_assigneeType_union1) {
|
|
1308
|
+
var message = 'Object doesn\'t match union (at "' + path_assigneeType + '")';
|
|
1309
|
+
message += '\n' + obj_assigneeType_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1310
|
+
message += '\n' + obj_assigneeType_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1311
|
+
return new TypeError(message);
|
|
1312
|
+
}
|
|
1313
|
+
var obj_endTimestamp = obj.endTimestamp;
|
|
1314
|
+
var path_endTimestamp = path + '.endTimestamp';
|
|
1315
|
+
var obj_endTimestamp_union0 = null;
|
|
1316
|
+
var obj_endTimestamp_union0_error = (function () {
|
|
1317
|
+
if (typeof obj_endTimestamp !== 'string') {
|
|
1318
|
+
return new TypeError('Expected "string" but received "' + typeof obj_endTimestamp + '" (at "' + path_endTimestamp + '")');
|
|
1319
|
+
}
|
|
1320
|
+
})();
|
|
1321
|
+
if (obj_endTimestamp_union0_error != null) {
|
|
1322
|
+
obj_endTimestamp_union0 = obj_endTimestamp_union0_error.message;
|
|
1323
|
+
}
|
|
1324
|
+
var obj_endTimestamp_union1 = null;
|
|
1325
|
+
var obj_endTimestamp_union1_error = (function () {
|
|
1326
|
+
if (obj_endTimestamp !== null) {
|
|
1327
|
+
return new TypeError('Expected "null" but received "' + typeof obj_endTimestamp + '" (at "' + path_endTimestamp + '")');
|
|
1328
|
+
}
|
|
1329
|
+
})();
|
|
1330
|
+
if (obj_endTimestamp_union1_error != null) {
|
|
1331
|
+
obj_endTimestamp_union1 = obj_endTimestamp_union1_error.message;
|
|
1332
|
+
}
|
|
1333
|
+
if (obj_endTimestamp_union0 && obj_endTimestamp_union1) {
|
|
1334
|
+
var message = 'Object doesn\'t match union (at "' + path_endTimestamp + '")';
|
|
1335
|
+
message += '\n' + obj_endTimestamp_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1336
|
+
message += '\n' + obj_endTimestamp_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1337
|
+
return new TypeError(message);
|
|
1338
|
+
}
|
|
1339
|
+
var obj_orchestrationName = obj.orchestrationName;
|
|
1340
|
+
var path_orchestrationName = path + '.orchestrationName';
|
|
1341
|
+
if (typeof obj_orchestrationName !== 'string') {
|
|
1342
|
+
return new TypeError('Expected "string" but received "' + typeof obj_orchestrationName + '" (at "' + path_orchestrationName + '")');
|
|
1343
|
+
}
|
|
1344
|
+
var obj_orchestrationVersion = obj.orchestrationVersion;
|
|
1345
|
+
var path_orchestrationVersion = path + '.orchestrationVersion';
|
|
1346
|
+
if (typeof obj_orchestrationVersion !== 'number' || (typeof obj_orchestrationVersion === 'number' && Math.floor(obj_orchestrationVersion) !== obj_orchestrationVersion)) {
|
|
1347
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_orchestrationVersion + '" (at "' + path_orchestrationVersion + '")');
|
|
1348
|
+
}
|
|
1349
|
+
var obj_stageDevName = obj.stageDevName;
|
|
1350
|
+
var path_stageDevName = path + '.stageDevName';
|
|
1351
|
+
if (typeof obj_stageDevName !== 'string') {
|
|
1352
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stageDevName + '" (at "' + path_stageDevName + '")');
|
|
1353
|
+
}
|
|
1354
|
+
var obj_stageLabel = obj.stageLabel;
|
|
1355
|
+
var path_stageLabel = path + '.stageLabel';
|
|
1356
|
+
if (typeof obj_stageLabel !== 'string') {
|
|
1357
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stageLabel + '" (at "' + path_stageLabel + '")');
|
|
1358
|
+
}
|
|
1359
|
+
var obj_startTimestamp = obj.startTimestamp;
|
|
1360
|
+
var path_startTimestamp = path + '.startTimestamp';
|
|
1361
|
+
if (typeof obj_startTimestamp !== 'string') {
|
|
1362
|
+
return new TypeError('Expected "string" but received "' + typeof obj_startTimestamp + '" (at "' + path_startTimestamp + '")');
|
|
1363
|
+
}
|
|
1364
|
+
var obj_status = obj.status;
|
|
1365
|
+
var path_status = path + '.status';
|
|
1366
|
+
if (typeof obj_status !== 'string') {
|
|
1367
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1368
|
+
}
|
|
1369
|
+
var obj_stepDevName = obj.stepDevName;
|
|
1370
|
+
var path_stepDevName = path + '.stepDevName';
|
|
1371
|
+
if (typeof obj_stepDevName !== 'string') {
|
|
1372
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stepDevName + '" (at "' + path_stepDevName + '")');
|
|
1373
|
+
}
|
|
1374
|
+
var obj_stepLabel = obj.stepLabel;
|
|
1375
|
+
var path_stepLabel = path + '.stepLabel';
|
|
1376
|
+
if (typeof obj_stepLabel !== 'string') {
|
|
1377
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stepLabel + '" (at "' + path_stepLabel + '")');
|
|
1378
|
+
}
|
|
1379
|
+
})();
|
|
1380
|
+
return v_error === undefined ? null : v_error;
|
|
1381
|
+
}
|
|
1382
|
+
var select$2 = function ManagedContentRunningOrchestrationHistoryEventRepresentationSelect() {
|
|
1383
|
+
return {
|
|
1384
|
+
kind: 'Fragment',
|
|
1385
|
+
version: VERSION$1,
|
|
1386
|
+
private: [],
|
|
1387
|
+
selections: [
|
|
1388
|
+
{
|
|
1389
|
+
name: 'actorEmail',
|
|
1390
|
+
kind: 'Scalar'
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
name: 'actorName',
|
|
1394
|
+
kind: 'Scalar'
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
name: 'assigneeDevNameOrEmail',
|
|
1398
|
+
kind: 'Scalar'
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
name: 'assigneeName',
|
|
1402
|
+
kind: 'Scalar'
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
name: 'assigneeType',
|
|
1406
|
+
kind: 'Scalar'
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
name: 'endTimestamp',
|
|
1410
|
+
kind: 'Scalar'
|
|
1411
|
+
},
|
|
1412
|
+
{
|
|
1413
|
+
name: 'orchestrationName',
|
|
1414
|
+
kind: 'Scalar'
|
|
1415
|
+
},
|
|
1416
|
+
{
|
|
1417
|
+
name: 'orchestrationVersion',
|
|
1418
|
+
kind: 'Scalar'
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
name: 'stageDevName',
|
|
1422
|
+
kind: 'Scalar'
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
name: 'stageLabel',
|
|
1426
|
+
kind: 'Scalar'
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
name: 'startTimestamp',
|
|
1430
|
+
kind: 'Scalar'
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
name: 'status',
|
|
1434
|
+
kind: 'Scalar'
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
name: 'stepDevName',
|
|
1438
|
+
kind: 'Scalar'
|
|
1439
|
+
},
|
|
1440
|
+
{
|
|
1441
|
+
name: 'stepLabel',
|
|
1442
|
+
kind: 'Scalar'
|
|
1443
|
+
}
|
|
1444
|
+
]
|
|
1445
|
+
};
|
|
1446
|
+
};
|
|
1447
|
+
function equals$1(existing, incoming) {
|
|
1448
|
+
var existing_orchestrationVersion = existing.orchestrationVersion;
|
|
1449
|
+
var incoming_orchestrationVersion = incoming.orchestrationVersion;
|
|
1450
|
+
if (!(existing_orchestrationVersion === incoming_orchestrationVersion)) {
|
|
1451
|
+
return false;
|
|
1452
|
+
}
|
|
1453
|
+
var existing_orchestrationName = existing.orchestrationName;
|
|
1454
|
+
var incoming_orchestrationName = incoming.orchestrationName;
|
|
1455
|
+
if (!(existing_orchestrationName === incoming_orchestrationName)) {
|
|
1456
|
+
return false;
|
|
1457
|
+
}
|
|
1458
|
+
var existing_stageDevName = existing.stageDevName;
|
|
1459
|
+
var incoming_stageDevName = incoming.stageDevName;
|
|
1460
|
+
if (!(existing_stageDevName === incoming_stageDevName)) {
|
|
1461
|
+
return false;
|
|
1462
|
+
}
|
|
1463
|
+
var existing_stageLabel = existing.stageLabel;
|
|
1464
|
+
var incoming_stageLabel = incoming.stageLabel;
|
|
1465
|
+
if (!(existing_stageLabel === incoming_stageLabel)) {
|
|
1466
|
+
return false;
|
|
1467
|
+
}
|
|
1468
|
+
var existing_startTimestamp = existing.startTimestamp;
|
|
1469
|
+
var incoming_startTimestamp = incoming.startTimestamp;
|
|
1470
|
+
if (!(existing_startTimestamp === incoming_startTimestamp)) {
|
|
1471
|
+
return false;
|
|
1472
|
+
}
|
|
1473
|
+
var existing_status = existing.status;
|
|
1474
|
+
var incoming_status = incoming.status;
|
|
1475
|
+
if (!(existing_status === incoming_status)) {
|
|
1476
|
+
return false;
|
|
1477
|
+
}
|
|
1478
|
+
var existing_stepDevName = existing.stepDevName;
|
|
1479
|
+
var incoming_stepDevName = incoming.stepDevName;
|
|
1480
|
+
if (!(existing_stepDevName === incoming_stepDevName)) {
|
|
1481
|
+
return false;
|
|
1482
|
+
}
|
|
1483
|
+
var existing_stepLabel = existing.stepLabel;
|
|
1484
|
+
var incoming_stepLabel = incoming.stepLabel;
|
|
1485
|
+
if (!(existing_stepLabel === incoming_stepLabel)) {
|
|
1486
|
+
return false;
|
|
1487
|
+
}
|
|
1488
|
+
var existing_actorEmail = existing.actorEmail;
|
|
1489
|
+
var incoming_actorEmail = incoming.actorEmail;
|
|
1490
|
+
if (!(existing_actorEmail === incoming_actorEmail)) {
|
|
1491
|
+
return false;
|
|
1492
|
+
}
|
|
1493
|
+
var existing_actorName = existing.actorName;
|
|
1494
|
+
var incoming_actorName = incoming.actorName;
|
|
1495
|
+
if (!(existing_actorName === incoming_actorName)) {
|
|
1496
|
+
return false;
|
|
1497
|
+
}
|
|
1498
|
+
var existing_assigneeDevNameOrEmail = existing.assigneeDevNameOrEmail;
|
|
1499
|
+
var incoming_assigneeDevNameOrEmail = incoming.assigneeDevNameOrEmail;
|
|
1500
|
+
if (!(existing_assigneeDevNameOrEmail === incoming_assigneeDevNameOrEmail)) {
|
|
1501
|
+
return false;
|
|
1502
|
+
}
|
|
1503
|
+
var existing_assigneeName = existing.assigneeName;
|
|
1504
|
+
var incoming_assigneeName = incoming.assigneeName;
|
|
1505
|
+
if (!(existing_assigneeName === incoming_assigneeName)) {
|
|
1506
|
+
return false;
|
|
1507
|
+
}
|
|
1508
|
+
var existing_assigneeType = existing.assigneeType;
|
|
1509
|
+
var incoming_assigneeType = incoming.assigneeType;
|
|
1510
|
+
if (!(existing_assigneeType === incoming_assigneeType)) {
|
|
1511
|
+
return false;
|
|
1512
|
+
}
|
|
1513
|
+
var existing_endTimestamp = existing.endTimestamp;
|
|
1514
|
+
var incoming_endTimestamp = incoming.endTimestamp;
|
|
1515
|
+
if (!(existing_endTimestamp === incoming_endTimestamp)) {
|
|
1516
|
+
return false;
|
|
1517
|
+
}
|
|
1518
|
+
return true;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
var TTL = 100;
|
|
1522
|
+
var VERSION = "8d2b53591bb32ebdac40a28e64c15c48";
|
|
1523
|
+
function validate(obj, path) {
|
|
1524
|
+
if (path === void 0) { path = 'ManagedContentRunningOrchestrationHistoryEventCollectionRepresentation'; }
|
|
1525
|
+
var v_error = (function () {
|
|
1526
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1527
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1528
|
+
}
|
|
1529
|
+
var obj_historyEvents = obj.historyEvents;
|
|
1530
|
+
var path_historyEvents = path + '.historyEvents';
|
|
1531
|
+
if (!ArrayIsArray(obj_historyEvents)) {
|
|
1532
|
+
return new TypeError('Expected "array" but received "' + typeof obj_historyEvents + '" (at "' + path_historyEvents + '")');
|
|
1533
|
+
}
|
|
1534
|
+
for (var i = 0; i < obj_historyEvents.length; i++) {
|
|
1535
|
+
var obj_historyEvents_item = obj_historyEvents[i];
|
|
1536
|
+
var path_historyEvents_item = path_historyEvents + '[' + i + ']';
|
|
1537
|
+
var referencepath_historyEvents_itemValidationError = validate$1(obj_historyEvents_item, path_historyEvents_item);
|
|
1538
|
+
if (referencepath_historyEvents_itemValidationError !== null) {
|
|
1539
|
+
var message = 'Object doesn\'t match ManagedContentRunningOrchestrationHistoryEventRepresentation (at "' + path_historyEvents_item + '")\n';
|
|
1540
|
+
message += referencepath_historyEvents_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1541
|
+
return new TypeError(message);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
})();
|
|
1545
|
+
return v_error === undefined ? null : v_error;
|
|
1546
|
+
}
|
|
1547
|
+
var RepresentationType = 'ManagedContentRunningOrchestrationHistoryEventCollectionRepresentation';
|
|
1548
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1549
|
+
return input;
|
|
1550
|
+
}
|
|
1551
|
+
var select$1 = function ManagedContentRunningOrchestrationHistoryEventCollectionRepresentationSelect() {
|
|
1552
|
+
var _a = select$2(), ManagedContentRunningOrchestrationHistoryEventRepresentation__selections = _a.selections;
|
|
1553
|
+
return {
|
|
1554
|
+
kind: 'Fragment',
|
|
1555
|
+
version: VERSION,
|
|
1556
|
+
private: [],
|
|
1557
|
+
selections: [
|
|
1558
|
+
{
|
|
1559
|
+
name: 'historyEvents',
|
|
1560
|
+
kind: 'Object',
|
|
1561
|
+
plural: true,
|
|
1562
|
+
selections: ManagedContentRunningOrchestrationHistoryEventRepresentation__selections
|
|
1563
|
+
}
|
|
1564
|
+
]
|
|
1565
|
+
};
|
|
1566
|
+
};
|
|
1567
|
+
function equals(existing, incoming) {
|
|
1568
|
+
var existing_historyEvents = existing.historyEvents;
|
|
1569
|
+
var incoming_historyEvents = incoming.historyEvents;
|
|
1570
|
+
var equals_historyEvents_items = equalsArray(existing_historyEvents, incoming_historyEvents, function (existing_historyEvents_item, incoming_historyEvents_item) {
|
|
1571
|
+
if (!(equals$1(existing_historyEvents_item, incoming_historyEvents_item))) {
|
|
1572
|
+
return false;
|
|
1573
|
+
}
|
|
1574
|
+
});
|
|
1575
|
+
if (equals_historyEvents_items === false) {
|
|
1576
|
+
return false;
|
|
1577
|
+
}
|
|
1578
|
+
return true;
|
|
1579
|
+
}
|
|
1580
|
+
var ingest = function ManagedContentRunningOrchestrationHistoryEventCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1581
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1582
|
+
var validateError = validate(input);
|
|
1583
|
+
if (validateError !== null) {
|
|
1584
|
+
throw validateError;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
var key = path.fullPath;
|
|
1588
|
+
var existingRecord = store.readEntry(key);
|
|
1589
|
+
var ttlToUse = TTL;
|
|
1590
|
+
var incomingRecord = normalize(input, store.readEntry(key), {
|
|
1591
|
+
fullPath: key,
|
|
1592
|
+
parent: path.parent,
|
|
1593
|
+
propertyName: path.propertyName,
|
|
1594
|
+
ttl: ttlToUse
|
|
1595
|
+
});
|
|
1596
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
1597
|
+
luvio.storePublish(key, incomingRecord);
|
|
1598
|
+
}
|
|
1599
|
+
{
|
|
1600
|
+
var storeMetadataParams = {
|
|
1601
|
+
ttl: ttlToUse,
|
|
1602
|
+
namespace: "CMSOrchestrator",
|
|
1603
|
+
version: VERSION,
|
|
1604
|
+
representationName: RepresentationType,
|
|
1605
|
+
};
|
|
1606
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1607
|
+
}
|
|
1608
|
+
return createLink(key);
|
|
1609
|
+
};
|
|
1610
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
1611
|
+
var rootKeySet = new engine.StoreKeyMap();
|
|
1612
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1613
|
+
var rootKey = fullPathFactory();
|
|
1614
|
+
rootKeySet.set(rootKey, {
|
|
1615
|
+
namespace: keyPrefix,
|
|
1616
|
+
representationName: RepresentationType,
|
|
1617
|
+
mergeable: false
|
|
1618
|
+
});
|
|
1619
|
+
return rootKeySet;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
function select(luvio, params) {
|
|
1623
|
+
return select$1();
|
|
1624
|
+
}
|
|
1625
|
+
function keyBuilder$1(luvio, params) {
|
|
1626
|
+
return keyPrefix + '::ManagedContentRunningOrchestrationHistoryEventCollectionRepresentation:(' + 'managedContentVariantId:' + params.queryParams.managedContentVariantId + ')';
|
|
1627
|
+
}
|
|
1628
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
1629
|
+
return getTypeCacheKeys(luvio, response, function () { return keyBuilder$1(luvio, resourceParams); });
|
|
1630
|
+
}
|
|
1631
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
1632
|
+
var body = response.body;
|
|
1633
|
+
var key = keyBuilder$1(luvio, resourceParams);
|
|
1634
|
+
luvio.storeIngest(key, ingest, body);
|
|
1635
|
+
var snapshot = luvio.storeLookup({
|
|
1636
|
+
recordId: key,
|
|
1637
|
+
node: select(),
|
|
1638
|
+
variables: {},
|
|
1639
|
+
}, snapshotRefresh);
|
|
1640
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1641
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1642
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
return snapshot;
|
|
1646
|
+
}
|
|
1647
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1648
|
+
var key = keyBuilder$1(luvio, params);
|
|
1649
|
+
var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1650
|
+
var storeMetadataParams = {
|
|
1651
|
+
ttl: TTL,
|
|
1652
|
+
namespace: keyPrefix,
|
|
1653
|
+
version: VERSION,
|
|
1654
|
+
representationName: RepresentationType
|
|
1655
|
+
};
|
|
1656
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1657
|
+
return errorSnapshot;
|
|
1658
|
+
}
|
|
1659
|
+
function createResourceRequest(config) {
|
|
1660
|
+
var headers = {};
|
|
1661
|
+
return {
|
|
1662
|
+
baseUri: '/services/data/v58.0',
|
|
1663
|
+
basePath: '/connect/cms/contents/orchestration-history-events',
|
|
1664
|
+
method: 'get',
|
|
1665
|
+
body: null,
|
|
1666
|
+
urlParams: {},
|
|
1667
|
+
queryParams: config.queryParams,
|
|
1668
|
+
headers: headers,
|
|
1669
|
+
priority: 'normal',
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
var getManagedContentRunningOrchestrationHistoryEvents_ConfigPropertyNames = {
|
|
1674
|
+
displayName: 'getManagedContentRunningOrchestrationHistoryEvents',
|
|
1675
|
+
parameters: {
|
|
1676
|
+
required: [],
|
|
1677
|
+
optional: ['managedContentVariantId']
|
|
1678
|
+
}
|
|
1679
|
+
};
|
|
1680
|
+
function createResourceParams(config) {
|
|
1681
|
+
var resourceParams = {
|
|
1682
|
+
queryParams: {
|
|
1683
|
+
managedContentVariantId: config.managedContentVariantId
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
return resourceParams;
|
|
1687
|
+
}
|
|
1688
|
+
function keyBuilder(luvio, config) {
|
|
1689
|
+
var resourceParams = createResourceParams(config);
|
|
1690
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
1691
|
+
}
|
|
1692
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1693
|
+
var config = {};
|
|
1694
|
+
var untrustedConfig_managedContentVariantId = untrustedConfig.managedContentVariantId;
|
|
1695
|
+
if (typeof untrustedConfig_managedContentVariantId === 'string') {
|
|
1696
|
+
config.managedContentVariantId = untrustedConfig_managedContentVariantId;
|
|
1697
|
+
}
|
|
1698
|
+
return config;
|
|
1699
|
+
}
|
|
1700
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1701
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1702
|
+
return null;
|
|
1703
|
+
}
|
|
1704
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1705
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1706
|
+
}
|
|
1707
|
+
var config = typeCheckConfig(untrustedConfig);
|
|
1708
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1709
|
+
return null;
|
|
1710
|
+
}
|
|
1711
|
+
return config;
|
|
1712
|
+
}
|
|
1713
|
+
function adapterFragment(luvio, config) {
|
|
1714
|
+
createResourceParams(config);
|
|
1715
|
+
return select();
|
|
1716
|
+
}
|
|
1717
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1718
|
+
var snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
1719
|
+
config: config,
|
|
1720
|
+
resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
|
|
1721
|
+
});
|
|
1722
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
1723
|
+
}
|
|
1724
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1725
|
+
var snapshot = ingestError(luvio, resourceParams, response, {
|
|
1726
|
+
config: config,
|
|
1727
|
+
resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
|
|
1728
|
+
});
|
|
1729
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
1730
|
+
}
|
|
1731
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1732
|
+
var resourceParams = createResourceParams(config);
|
|
1733
|
+
var request = createResourceRequest(resourceParams);
|
|
1734
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1735
|
+
.then(function (response) {
|
|
1736
|
+
return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
|
|
1737
|
+
}, function (response) {
|
|
1738
|
+
return luvio.handleErrorResponse(function () { return onFetchResponseError(luvio, config, resourceParams, response); });
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1742
|
+
var luvio = context.luvio, config = context.config;
|
|
1743
|
+
var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
|
|
1744
|
+
var dispatchOptions = {
|
|
1745
|
+
resourceRequestContext: {
|
|
1746
|
+
requestCorrelator: requestCorrelator,
|
|
1747
|
+
luvioRequestMethod: undefined,
|
|
1748
|
+
},
|
|
1749
|
+
eventObservers: eventObservers
|
|
1750
|
+
};
|
|
1751
|
+
if (networkPriority !== 'normal') {
|
|
1752
|
+
dispatchOptions.overrides = {
|
|
1753
|
+
priority: networkPriority
|
|
1754
|
+
};
|
|
1755
|
+
}
|
|
1756
|
+
return buildNetworkSnapshot(luvio, config, dispatchOptions);
|
|
1757
|
+
}
|
|
1758
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1759
|
+
var luvio = context.luvio, config = context.config;
|
|
1760
|
+
var selector = {
|
|
1761
|
+
recordId: keyBuilder(luvio, config),
|
|
1762
|
+
node: adapterFragment(luvio, config),
|
|
1763
|
+
variables: {},
|
|
1764
|
+
};
|
|
1765
|
+
var cacheSnapshot = storeLookup(selector, {
|
|
1766
|
+
config: config,
|
|
1767
|
+
resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
|
|
1768
|
+
});
|
|
1769
|
+
return cacheSnapshot;
|
|
1770
|
+
}
|
|
1771
|
+
var getManagedContentRunningOrchestrationHistoryEventsAdapterFactory = function (luvio) { return function CMSOrchestrator__getManagedContentRunningOrchestrationHistoryEvents(untrustedConfig, requestContext) {
|
|
1772
|
+
var config = validateAdapterConfig(untrustedConfig, getManagedContentRunningOrchestrationHistoryEvents_ConfigPropertyNames);
|
|
1773
|
+
// Invalid or incomplete config
|
|
1774
|
+
if (config === null) {
|
|
1775
|
+
return null;
|
|
1776
|
+
}
|
|
1777
|
+
return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
|
|
1778
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1779
|
+
}; };
|
|
1780
|
+
|
|
1781
|
+
exports.createManagedContentOrchestrationInstanceAdapterFactory = createManagedContentOrchestrationInstanceAdapterFactory;
|
|
1782
|
+
exports.getManagedContentOrchestrationDefinitionsAdapterFactory = getManagedContentOrchestrationDefinitionsAdapterFactory;
|
|
1783
|
+
exports.getManagedContentOrchestrationInstancesAdapterFactory = getManagedContentOrchestrationInstancesAdapterFactory;
|
|
1784
|
+
exports.getManagedContentRunningOrchestrationHistoryEventsAdapterFactory = getManagedContentRunningOrchestrationHistoryEventsAdapterFactory;
|
|
1785
|
+
|
|
1786
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1787
|
+
|
|
1788
|
+
}));
|