@salesforce/lds-adapters-analytics-app-framework 1.303.0
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/analytics-app-framework.js +2886 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/createApp.d.ts +23 -0
- package/dist/es/es2018/types/src/generated/adapters/deleteApp.d.ts +14 -0
- package/dist/es/es2018/types/src/generated/adapters/getApp.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getAppAssets.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/adapters/getApps.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getTemplate.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getTemplateConfig.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getTemplates.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +8 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/deleteAppFrameworkAppsByAppIdOrApiName.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/getAppFrameworkApps.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/getAppFrameworkAppsAssetsByAppIdOrApiName.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/resources/getAppFrameworkAppsByAppIdOrApiName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getAppFrameworkTemplates.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/getAppFrameworkTemplatesByTemplateIdOrApiName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getAppFrameworkTemplatesConfigurationByTemplateIdOrApiName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postAppFrameworkApps.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/types/AppCollectionRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/AppInputRepresentation.d.ts +50 -0
- package/dist/es/es2018/types/src/generated/types/AppRepresentation.d.ts +87 -0
- package/dist/es/es2018/types/src/generated/types/AppResultRepresentation.d.ts +58 -0
- package/dist/es/es2018/types/src/generated/types/AppScheduleRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/AssetCollectionRepresentation.d.ts +51 -0
- package/dist/es/es2018/types/src/generated/types/AssetRepresentation.d.ts +53 -0
- package/dist/es/es2018/types/src/generated/types/ChainDefinitionInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/DailyScheduledItemRepresentation.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/types/HourlyScheduledItemRepresentation.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/types/NamespacedReferenceInputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ReleaseInfoInputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/RuleInfoInputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ScheduledItemRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/ScheduledTimeRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/ScheduledTimezoneRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/TemplateCollectionRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/TemplateConfigurationRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/TemplateIconsInputRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/TemplateInputRepresentation.d.ts +71 -0
- package/dist/es/es2018/types/src/generated/types/TemplatePreviewInputRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/TemplateRepresentation.d.ts +56 -0
- package/dist/es/es2018/types/src/generated/types/UserRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/WeeklyScheduledItemRepresentation.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +66 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +3150 -0
- package/src/raml/api.raml +601 -0
- package/src/raml/luvio.raml +80 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,3150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$8, typeCheckConfig as typeCheckConfig$8, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$6 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
21
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
22
|
+
/**
|
|
23
|
+
* Validates an adapter config is well-formed.
|
|
24
|
+
* @param config The config to validate.
|
|
25
|
+
* @param adapter The adapter validation configuration.
|
|
26
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
27
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
28
|
+
*/
|
|
29
|
+
function validateConfig(config, adapter, oneOf) {
|
|
30
|
+
const { displayName } = adapter;
|
|
31
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
32
|
+
if (config === undefined ||
|
|
33
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
34
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
37
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
38
|
+
}
|
|
39
|
+
if (unsupported !== undefined &&
|
|
40
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
41
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
const supported = required.concat(optional);
|
|
44
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
45
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function untrustedIsObject(untrusted) {
|
|
49
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
50
|
+
}
|
|
51
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
52
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
53
|
+
}
|
|
54
|
+
const snapshotRefreshOptions = {
|
|
55
|
+
overrides: {
|
|
56
|
+
headers: {
|
|
57
|
+
'Cache-Control': 'no-cache',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
62
|
+
return {
|
|
63
|
+
name,
|
|
64
|
+
required,
|
|
65
|
+
resourceType,
|
|
66
|
+
typeCheckShape,
|
|
67
|
+
isArrayShape,
|
|
68
|
+
coerceFn,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
72
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
73
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
74
|
+
return {
|
|
75
|
+
displayName,
|
|
76
|
+
parameters: {
|
|
77
|
+
required,
|
|
78
|
+
optional,
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const keyPrefix = 'AppFramework';
|
|
83
|
+
|
|
84
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
85
|
+
const { isArray: ArrayIsArray } = Array;
|
|
86
|
+
const { stringify: JSONStringify } = JSON;
|
|
87
|
+
function equalsArray(a, b, equalsItem) {
|
|
88
|
+
const aLength = a.length;
|
|
89
|
+
const bLength = b.length;
|
|
90
|
+
if (aLength !== bLength) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
for (let i = 0; i < aLength; i++) {
|
|
94
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
function equalsObject(a, b, equalsProp) {
|
|
101
|
+
const aKeys = ObjectKeys(a).sort();
|
|
102
|
+
const bKeys = ObjectKeys(b).sort();
|
|
103
|
+
const aKeysLength = aKeys.length;
|
|
104
|
+
const bKeysLength = bKeys.length;
|
|
105
|
+
if (aKeysLength !== bKeysLength) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
109
|
+
const key = aKeys[i];
|
|
110
|
+
if (key !== bKeys[i]) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (equalsProp(a[key], b[key]) === false) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
function createLink(ref) {
|
|
120
|
+
return {
|
|
121
|
+
__ref: serializeStructuredKey(ref),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const VERSION$f = "8747a45321deaf63f65cf74537b07eb6";
|
|
126
|
+
function validate$c(obj, path = 'UserRepresentation') {
|
|
127
|
+
const v_error = (() => {
|
|
128
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
129
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
130
|
+
}
|
|
131
|
+
const obj_id = obj.id;
|
|
132
|
+
const path_id = path + '.id';
|
|
133
|
+
if (typeof obj_id !== 'string') {
|
|
134
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
135
|
+
}
|
|
136
|
+
const obj_name = obj.name;
|
|
137
|
+
const path_name = path + '.name';
|
|
138
|
+
if (typeof obj_name !== 'string') {
|
|
139
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
140
|
+
}
|
|
141
|
+
const obj_profilePhotoUrl = obj.profilePhotoUrl;
|
|
142
|
+
const path_profilePhotoUrl = path + '.profilePhotoUrl';
|
|
143
|
+
let obj_profilePhotoUrl_union0 = null;
|
|
144
|
+
const obj_profilePhotoUrl_union0_error = (() => {
|
|
145
|
+
if (typeof obj_profilePhotoUrl !== 'string') {
|
|
146
|
+
return new TypeError('Expected "string" but received "' + typeof obj_profilePhotoUrl + '" (at "' + path_profilePhotoUrl + '")');
|
|
147
|
+
}
|
|
148
|
+
})();
|
|
149
|
+
if (obj_profilePhotoUrl_union0_error != null) {
|
|
150
|
+
obj_profilePhotoUrl_union0 = obj_profilePhotoUrl_union0_error.message;
|
|
151
|
+
}
|
|
152
|
+
let obj_profilePhotoUrl_union1 = null;
|
|
153
|
+
const obj_profilePhotoUrl_union1_error = (() => {
|
|
154
|
+
if (obj_profilePhotoUrl !== null) {
|
|
155
|
+
return new TypeError('Expected "null" but received "' + typeof obj_profilePhotoUrl + '" (at "' + path_profilePhotoUrl + '")');
|
|
156
|
+
}
|
|
157
|
+
})();
|
|
158
|
+
if (obj_profilePhotoUrl_union1_error != null) {
|
|
159
|
+
obj_profilePhotoUrl_union1 = obj_profilePhotoUrl_union1_error.message;
|
|
160
|
+
}
|
|
161
|
+
if (obj_profilePhotoUrl_union0 && obj_profilePhotoUrl_union1) {
|
|
162
|
+
let message = 'Object doesn\'t match union (at "' + path_profilePhotoUrl + '")';
|
|
163
|
+
message += '\n' + obj_profilePhotoUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
164
|
+
message += '\n' + obj_profilePhotoUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
165
|
+
return new TypeError(message);
|
|
166
|
+
}
|
|
167
|
+
})();
|
|
168
|
+
return v_error === undefined ? null : v_error;
|
|
169
|
+
}
|
|
170
|
+
const select$m = function UserRepresentationSelect() {
|
|
171
|
+
return {
|
|
172
|
+
kind: 'Fragment',
|
|
173
|
+
version: VERSION$f,
|
|
174
|
+
private: [],
|
|
175
|
+
selections: [
|
|
176
|
+
{
|
|
177
|
+
name: 'id',
|
|
178
|
+
kind: 'Scalar'
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'name',
|
|
182
|
+
kind: 'Scalar'
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'profilePhotoUrl',
|
|
186
|
+
kind: 'Scalar'
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
function equals$c(existing, incoming) {
|
|
192
|
+
const existing_id = existing.id;
|
|
193
|
+
const incoming_id = incoming.id;
|
|
194
|
+
if (!(existing_id === incoming_id)) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
const existing_name = existing.name;
|
|
198
|
+
const incoming_name = incoming.name;
|
|
199
|
+
if (!(existing_name === incoming_name)) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
const existing_profilePhotoUrl = existing.profilePhotoUrl;
|
|
203
|
+
const incoming_profilePhotoUrl = incoming.profilePhotoUrl;
|
|
204
|
+
if (!(existing_profilePhotoUrl === incoming_profilePhotoUrl)) {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const VERSION$e = "74662b770f974cec987197380f2580ea";
|
|
211
|
+
function validate$b(obj, path = 'ScheduledTimezoneRepresentation') {
|
|
212
|
+
const v_error = (() => {
|
|
213
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
214
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
215
|
+
}
|
|
216
|
+
obj.gmtOffset;
|
|
217
|
+
const obj_name = obj.name;
|
|
218
|
+
const path_name = path + '.name';
|
|
219
|
+
if (typeof obj_name !== 'string') {
|
|
220
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
221
|
+
}
|
|
222
|
+
const obj_zoneId = obj.zoneId;
|
|
223
|
+
const path_zoneId = path + '.zoneId';
|
|
224
|
+
if (typeof obj_zoneId !== 'string') {
|
|
225
|
+
return new TypeError('Expected "string" but received "' + typeof obj_zoneId + '" (at "' + path_zoneId + '")');
|
|
226
|
+
}
|
|
227
|
+
})();
|
|
228
|
+
return v_error === undefined ? null : v_error;
|
|
229
|
+
}
|
|
230
|
+
const select$l = function ScheduledTimezoneRepresentationSelect() {
|
|
231
|
+
return {
|
|
232
|
+
kind: 'Fragment',
|
|
233
|
+
version: VERSION$e,
|
|
234
|
+
private: [],
|
|
235
|
+
selections: [
|
|
236
|
+
{
|
|
237
|
+
name: 'gmtOffset',
|
|
238
|
+
kind: 'Scalar'
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: 'name',
|
|
242
|
+
kind: 'Scalar'
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: 'zoneId',
|
|
246
|
+
kind: 'Scalar'
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
function equals$b(existing, incoming) {
|
|
252
|
+
const existing_name = existing.name;
|
|
253
|
+
const incoming_name = incoming.name;
|
|
254
|
+
if (!(existing_name === incoming_name)) {
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
const existing_zoneId = existing.zoneId;
|
|
258
|
+
const incoming_zoneId = incoming.zoneId;
|
|
259
|
+
if (!(existing_zoneId === incoming_zoneId)) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
const existing_gmtOffset = existing.gmtOffset;
|
|
263
|
+
const incoming_gmtOffset = incoming.gmtOffset;
|
|
264
|
+
if (!(existing_gmtOffset === incoming_gmtOffset)) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const VERSION$d = "d96bf6818be64d5924beaaad8e684221";
|
|
271
|
+
function validate$a(obj, path = 'ScheduledTimeRepresentation') {
|
|
272
|
+
const v_error = (() => {
|
|
273
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
274
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
275
|
+
}
|
|
276
|
+
const obj_hour = obj.hour;
|
|
277
|
+
const path_hour = path + '.hour';
|
|
278
|
+
if (typeof obj_hour !== 'number' || (typeof obj_hour === 'number' && Math.floor(obj_hour) !== obj_hour)) {
|
|
279
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_hour + '" (at "' + path_hour + '")');
|
|
280
|
+
}
|
|
281
|
+
const obj_minute = obj.minute;
|
|
282
|
+
const path_minute = path + '.minute';
|
|
283
|
+
if (typeof obj_minute !== 'number' || (typeof obj_minute === 'number' && Math.floor(obj_minute) !== obj_minute)) {
|
|
284
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_minute + '" (at "' + path_minute + '")');
|
|
285
|
+
}
|
|
286
|
+
const obj_timezone = obj.timezone;
|
|
287
|
+
const path_timezone = path + '.timezone';
|
|
288
|
+
const referencepath_timezoneValidationError = validate$b(obj_timezone, path_timezone);
|
|
289
|
+
if (referencepath_timezoneValidationError !== null) {
|
|
290
|
+
let message = 'Object doesn\'t match ScheduledTimezoneRepresentation (at "' + path_timezone + '")\n';
|
|
291
|
+
message += referencepath_timezoneValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
292
|
+
return new TypeError(message);
|
|
293
|
+
}
|
|
294
|
+
})();
|
|
295
|
+
return v_error === undefined ? null : v_error;
|
|
296
|
+
}
|
|
297
|
+
const select$k = function ScheduledTimeRepresentationSelect() {
|
|
298
|
+
const { selections: ScheduledTimezoneRepresentation__selections, opaque: ScheduledTimezoneRepresentation__opaque, } = select$l();
|
|
299
|
+
return {
|
|
300
|
+
kind: 'Fragment',
|
|
301
|
+
version: VERSION$d,
|
|
302
|
+
private: [],
|
|
303
|
+
selections: [
|
|
304
|
+
{
|
|
305
|
+
name: 'hour',
|
|
306
|
+
kind: 'Scalar'
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'minute',
|
|
310
|
+
kind: 'Scalar'
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: 'timezone',
|
|
314
|
+
kind: 'Object',
|
|
315
|
+
selections: ScheduledTimezoneRepresentation__selections
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
function equals$a(existing, incoming) {
|
|
321
|
+
const existing_hour = existing.hour;
|
|
322
|
+
const incoming_hour = incoming.hour;
|
|
323
|
+
if (!(existing_hour === incoming_hour)) {
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
const existing_minute = existing.minute;
|
|
327
|
+
const incoming_minute = incoming.minute;
|
|
328
|
+
if (!(existing_minute === incoming_minute)) {
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
const existing_timezone = existing.timezone;
|
|
332
|
+
const incoming_timezone = incoming.timezone;
|
|
333
|
+
if (!(equals$b(existing_timezone, incoming_timezone))) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
return true;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const VERSION$c = "91838b86aa135ce828af6242b11ae888";
|
|
340
|
+
const select$j = function HourlyScheduledItemRepresentationSelect() {
|
|
341
|
+
const { selections: ScheduledItemRepresentationSelections } = select$g();
|
|
342
|
+
return {
|
|
343
|
+
kind: 'Fragment',
|
|
344
|
+
version: VERSION$c,
|
|
345
|
+
private: [],
|
|
346
|
+
selections: [
|
|
347
|
+
...ScheduledItemRepresentationSelections,
|
|
348
|
+
{
|
|
349
|
+
name: 'daysOfWeek',
|
|
350
|
+
kind: 'Scalar',
|
|
351
|
+
plural: true
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: 'hourlyInterval',
|
|
355
|
+
kind: 'Scalar'
|
|
356
|
+
}
|
|
357
|
+
]
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
const VERSION$b = "46260a34f0b2c2d7adc7f8c150a8d8fb";
|
|
362
|
+
const select$i = function WeeklyScheduledItemRepresentationSelect() {
|
|
363
|
+
const { selections: ScheduledItemRepresentationSelections } = select$g();
|
|
364
|
+
return {
|
|
365
|
+
kind: 'Fragment',
|
|
366
|
+
version: VERSION$b,
|
|
367
|
+
private: [],
|
|
368
|
+
selections: [
|
|
369
|
+
...ScheduledItemRepresentationSelections,
|
|
370
|
+
{
|
|
371
|
+
name: 'daysOfWeek',
|
|
372
|
+
kind: 'Scalar',
|
|
373
|
+
plural: true
|
|
374
|
+
}
|
|
375
|
+
]
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
const VERSION$a = "dcda6d015a01d9acde5fac241448cfe4";
|
|
380
|
+
const select$h = function DailyScheduledItemRepresentationSelect() {
|
|
381
|
+
const { selections: ScheduledItemRepresentationSelections } = select$g();
|
|
382
|
+
return {
|
|
383
|
+
kind: 'Fragment',
|
|
384
|
+
version: VERSION$a,
|
|
385
|
+
private: [],
|
|
386
|
+
selections: [
|
|
387
|
+
...ScheduledItemRepresentationSelections,
|
|
388
|
+
]
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
var DiscriminatorValues;
|
|
393
|
+
(function (DiscriminatorValues) {
|
|
394
|
+
DiscriminatorValues["Hourly"] = "Hourly";
|
|
395
|
+
DiscriminatorValues["Weekly"] = "Weekly";
|
|
396
|
+
DiscriminatorValues["Daily"] = "Daily";
|
|
397
|
+
})(DiscriminatorValues || (DiscriminatorValues = {}));
|
|
398
|
+
const VERSION$9 = "193484b4261ca5840b61caaab3dea067";
|
|
399
|
+
function validate$9(obj, path = 'ScheduledItemRepresentation') {
|
|
400
|
+
const v_error = (() => {
|
|
401
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
402
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
403
|
+
}
|
|
404
|
+
const obj_frequency = obj.frequency;
|
|
405
|
+
const path_frequency = path + '.frequency';
|
|
406
|
+
if (typeof obj_frequency !== 'string') {
|
|
407
|
+
return new TypeError('Expected "string" but received "' + typeof obj_frequency + '" (at "' + path_frequency + '")');
|
|
408
|
+
}
|
|
409
|
+
const obj_nextScheduledRun = obj.nextScheduledRun;
|
|
410
|
+
const path_nextScheduledRun = path + '.nextScheduledRun';
|
|
411
|
+
if (typeof obj_nextScheduledRun !== 'string') {
|
|
412
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nextScheduledRun + '" (at "' + path_nextScheduledRun + '")');
|
|
413
|
+
}
|
|
414
|
+
const obj_time = obj.time;
|
|
415
|
+
const path_time = path + '.time';
|
|
416
|
+
const referencepath_timeValidationError = validate$a(obj_time, path_time);
|
|
417
|
+
if (referencepath_timeValidationError !== null) {
|
|
418
|
+
let message = 'Object doesn\'t match ScheduledTimeRepresentation (at "' + path_time + '")\n';
|
|
419
|
+
message += referencepath_timeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
420
|
+
return new TypeError(message);
|
|
421
|
+
}
|
|
422
|
+
})();
|
|
423
|
+
return v_error === undefined ? null : v_error;
|
|
424
|
+
}
|
|
425
|
+
const selectChildren = function ScheduledItemRepresentationSelectChildren() {
|
|
426
|
+
const hourlyScheduledItemRepresentationSelections = select$j();
|
|
427
|
+
const weeklyScheduledItemRepresentationSelections = select$i();
|
|
428
|
+
const dailyScheduledItemRepresentationSelections = select$h();
|
|
429
|
+
return {
|
|
430
|
+
kind: 'Fragment',
|
|
431
|
+
union: true,
|
|
432
|
+
discriminator: 'frequency',
|
|
433
|
+
unionSelections: {
|
|
434
|
+
[DiscriminatorValues.Hourly]: hourlyScheduledItemRepresentationSelections,
|
|
435
|
+
[DiscriminatorValues.Weekly]: weeklyScheduledItemRepresentationSelections,
|
|
436
|
+
[DiscriminatorValues.Daily]: dailyScheduledItemRepresentationSelections
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
const select$g = function ScheduledItemRepresentationSelect() {
|
|
441
|
+
const { selections: ScheduledTimeRepresentation__selections, opaque: ScheduledTimeRepresentation__opaque, } = select$k();
|
|
442
|
+
return {
|
|
443
|
+
kind: 'Fragment',
|
|
444
|
+
version: VERSION$9,
|
|
445
|
+
private: [],
|
|
446
|
+
selections: [
|
|
447
|
+
{
|
|
448
|
+
name: 'frequency',
|
|
449
|
+
kind: 'Scalar'
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
name: 'nextScheduledRun',
|
|
453
|
+
kind: 'Scalar'
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
name: 'time',
|
|
457
|
+
kind: 'Object',
|
|
458
|
+
selections: ScheduledTimeRepresentation__selections
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
function equals$9(existing, incoming) {
|
|
464
|
+
const existing_frequency = existing.frequency;
|
|
465
|
+
const incoming_frequency = incoming.frequency;
|
|
466
|
+
if (!(existing_frequency === incoming_frequency)) {
|
|
467
|
+
return false;
|
|
468
|
+
}
|
|
469
|
+
const existing_nextScheduledRun = existing.nextScheduledRun;
|
|
470
|
+
const incoming_nextScheduledRun = incoming.nextScheduledRun;
|
|
471
|
+
if (!(existing_nextScheduledRun === incoming_nextScheduledRun)) {
|
|
472
|
+
return false;
|
|
473
|
+
}
|
|
474
|
+
const existing_time = existing.time;
|
|
475
|
+
const incoming_time = incoming.time;
|
|
476
|
+
if (!(equals$a(existing_time, incoming_time))) {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
return true;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
const VERSION$8 = "06b5da5162febff2692d819c9b718be5";
|
|
483
|
+
function validate$8(obj, path = 'AppScheduleRepresentation') {
|
|
484
|
+
const v_error = (() => {
|
|
485
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
486
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
487
|
+
}
|
|
488
|
+
const obj_dataRefreshSchedule = obj.dataRefreshSchedule;
|
|
489
|
+
const path_dataRefreshSchedule = path + '.dataRefreshSchedule';
|
|
490
|
+
let obj_dataRefreshSchedule_union0 = null;
|
|
491
|
+
const obj_dataRefreshSchedule_union0_error = (() => {
|
|
492
|
+
const referencepath_dataRefreshScheduleValidationError = validate$9(obj_dataRefreshSchedule, path_dataRefreshSchedule);
|
|
493
|
+
if (referencepath_dataRefreshScheduleValidationError !== null) {
|
|
494
|
+
let message = 'Object doesn\'t match ScheduledItemRepresentation (at "' + path_dataRefreshSchedule + '")\n';
|
|
495
|
+
message += referencepath_dataRefreshScheduleValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
496
|
+
return new TypeError(message);
|
|
497
|
+
}
|
|
498
|
+
})();
|
|
499
|
+
if (obj_dataRefreshSchedule_union0_error != null) {
|
|
500
|
+
obj_dataRefreshSchedule_union0 = obj_dataRefreshSchedule_union0_error.message;
|
|
501
|
+
}
|
|
502
|
+
let obj_dataRefreshSchedule_union1 = null;
|
|
503
|
+
const obj_dataRefreshSchedule_union1_error = (() => {
|
|
504
|
+
if (obj_dataRefreshSchedule !== null) {
|
|
505
|
+
return new TypeError('Expected "null" but received "' + typeof obj_dataRefreshSchedule + '" (at "' + path_dataRefreshSchedule + '")');
|
|
506
|
+
}
|
|
507
|
+
})();
|
|
508
|
+
if (obj_dataRefreshSchedule_union1_error != null) {
|
|
509
|
+
obj_dataRefreshSchedule_union1 = obj_dataRefreshSchedule_union1_error.message;
|
|
510
|
+
}
|
|
511
|
+
if (obj_dataRefreshSchedule_union0 && obj_dataRefreshSchedule_union1) {
|
|
512
|
+
let message = 'Object doesn\'t match union (at "' + path_dataRefreshSchedule + '")';
|
|
513
|
+
message += '\n' + obj_dataRefreshSchedule_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
514
|
+
message += '\n' + obj_dataRefreshSchedule_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
515
|
+
return new TypeError(message);
|
|
516
|
+
}
|
|
517
|
+
const obj_url = obj.url;
|
|
518
|
+
const path_url = path + '.url';
|
|
519
|
+
let obj_url_union0 = null;
|
|
520
|
+
const obj_url_union0_error = (() => {
|
|
521
|
+
if (typeof obj_url !== 'string') {
|
|
522
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
523
|
+
}
|
|
524
|
+
})();
|
|
525
|
+
if (obj_url_union0_error != null) {
|
|
526
|
+
obj_url_union0 = obj_url_union0_error.message;
|
|
527
|
+
}
|
|
528
|
+
let obj_url_union1 = null;
|
|
529
|
+
const obj_url_union1_error = (() => {
|
|
530
|
+
if (obj_url !== null) {
|
|
531
|
+
return new TypeError('Expected "null" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
532
|
+
}
|
|
533
|
+
})();
|
|
534
|
+
if (obj_url_union1_error != null) {
|
|
535
|
+
obj_url_union1 = obj_url_union1_error.message;
|
|
536
|
+
}
|
|
537
|
+
if (obj_url_union0 && obj_url_union1) {
|
|
538
|
+
let message = 'Object doesn\'t match union (at "' + path_url + '")';
|
|
539
|
+
message += '\n' + obj_url_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
540
|
+
message += '\n' + obj_url_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
541
|
+
return new TypeError(message);
|
|
542
|
+
}
|
|
543
|
+
})();
|
|
544
|
+
return v_error === undefined ? null : v_error;
|
|
545
|
+
}
|
|
546
|
+
const select$f = function AppScheduleRepresentationSelect() {
|
|
547
|
+
const ScheduledItemRepresentation__unionSelections = selectChildren();
|
|
548
|
+
return {
|
|
549
|
+
kind: 'Fragment',
|
|
550
|
+
version: VERSION$8,
|
|
551
|
+
private: [],
|
|
552
|
+
selections: [
|
|
553
|
+
{
|
|
554
|
+
kind: 'Object',
|
|
555
|
+
name: 'dataRefreshSchedule',
|
|
556
|
+
discriminator: ScheduledItemRepresentation__unionSelections.discriminator,
|
|
557
|
+
union: true,
|
|
558
|
+
nullable: true,
|
|
559
|
+
unionSelections: ScheduledItemRepresentation__unionSelections.unionSelections
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
name: 'url',
|
|
563
|
+
kind: 'Scalar'
|
|
564
|
+
}
|
|
565
|
+
]
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
function equals$8(existing, incoming) {
|
|
569
|
+
const existing_dataRefreshSchedule = existing.dataRefreshSchedule;
|
|
570
|
+
const incoming_dataRefreshSchedule = incoming.dataRefreshSchedule;
|
|
571
|
+
if (!(existing_dataRefreshSchedule === incoming_dataRefreshSchedule
|
|
572
|
+
|| (existing_dataRefreshSchedule != null &&
|
|
573
|
+
incoming_dataRefreshSchedule != null &&
|
|
574
|
+
equals$9(existing_dataRefreshSchedule, incoming_dataRefreshSchedule)))) {
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
const existing_url = existing.url;
|
|
578
|
+
const incoming_url = incoming.url;
|
|
579
|
+
if (!(existing_url === incoming_url)) {
|
|
580
|
+
return false;
|
|
581
|
+
}
|
|
582
|
+
return true;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
const TTL$7 = 5000;
|
|
586
|
+
const VERSION$7 = "27f4629fb5003a11b4c23a2bfb40ee60";
|
|
587
|
+
function validate$7(obj, path = 'AppRepresentation') {
|
|
588
|
+
const v_error = (() => {
|
|
589
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
590
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
591
|
+
}
|
|
592
|
+
const obj_applicationStatus = obj.applicationStatus;
|
|
593
|
+
const path_applicationStatus = path + '.applicationStatus';
|
|
594
|
+
if (typeof obj_applicationStatus !== 'string') {
|
|
595
|
+
return new TypeError('Expected "string" but received "' + typeof obj_applicationStatus + '" (at "' + path_applicationStatus + '")');
|
|
596
|
+
}
|
|
597
|
+
const obj_assetUrl = obj.assetUrl;
|
|
598
|
+
const path_assetUrl = path + '.assetUrl';
|
|
599
|
+
if (typeof obj_assetUrl !== 'string') {
|
|
600
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assetUrl + '" (at "' + path_assetUrl + '")');
|
|
601
|
+
}
|
|
602
|
+
const obj_createdBy = obj.createdBy;
|
|
603
|
+
const path_createdBy = path + '.createdBy';
|
|
604
|
+
const referencepath_createdByValidationError = validate$c(obj_createdBy, path_createdBy);
|
|
605
|
+
if (referencepath_createdByValidationError !== null) {
|
|
606
|
+
let message = 'Object doesn\'t match UserRepresentation (at "' + path_createdBy + '")\n';
|
|
607
|
+
message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
608
|
+
return new TypeError(message);
|
|
609
|
+
}
|
|
610
|
+
const obj_createdDate = obj.createdDate;
|
|
611
|
+
const path_createdDate = path + '.createdDate';
|
|
612
|
+
if (typeof obj_createdDate !== 'string') {
|
|
613
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
614
|
+
}
|
|
615
|
+
const obj_description = obj.description;
|
|
616
|
+
const path_description = path + '.description';
|
|
617
|
+
let obj_description_union0 = null;
|
|
618
|
+
const obj_description_union0_error = (() => {
|
|
619
|
+
if (typeof obj_description !== 'string') {
|
|
620
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
621
|
+
}
|
|
622
|
+
})();
|
|
623
|
+
if (obj_description_union0_error != null) {
|
|
624
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
625
|
+
}
|
|
626
|
+
let obj_description_union1 = null;
|
|
627
|
+
const obj_description_union1_error = (() => {
|
|
628
|
+
if (obj_description !== null) {
|
|
629
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
630
|
+
}
|
|
631
|
+
})();
|
|
632
|
+
if (obj_description_union1_error != null) {
|
|
633
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
634
|
+
}
|
|
635
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
636
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
637
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
638
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
639
|
+
return new TypeError(message);
|
|
640
|
+
}
|
|
641
|
+
const obj_id = obj.id;
|
|
642
|
+
const path_id = path + '.id';
|
|
643
|
+
if (typeof obj_id !== 'string') {
|
|
644
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
645
|
+
}
|
|
646
|
+
const obj_installationHistoryUrl = obj.installationHistoryUrl;
|
|
647
|
+
const path_installationHistoryUrl = path + '.installationHistoryUrl';
|
|
648
|
+
if (typeof obj_installationHistoryUrl !== 'string') {
|
|
649
|
+
return new TypeError('Expected "string" but received "' + typeof obj_installationHistoryUrl + '" (at "' + path_installationHistoryUrl + '")');
|
|
650
|
+
}
|
|
651
|
+
const obj_label = obj.label;
|
|
652
|
+
const path_label = path + '.label';
|
|
653
|
+
if (typeof obj_label !== 'string') {
|
|
654
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
655
|
+
}
|
|
656
|
+
const obj_lastModifiedBy = obj.lastModifiedBy;
|
|
657
|
+
const path_lastModifiedBy = path + '.lastModifiedBy';
|
|
658
|
+
const referencepath_lastModifiedByValidationError = validate$c(obj_lastModifiedBy, path_lastModifiedBy);
|
|
659
|
+
if (referencepath_lastModifiedByValidationError !== null) {
|
|
660
|
+
let message = 'Object doesn\'t match UserRepresentation (at "' + path_lastModifiedBy + '")\n';
|
|
661
|
+
message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
662
|
+
return new TypeError(message);
|
|
663
|
+
}
|
|
664
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
665
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
666
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
667
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
668
|
+
}
|
|
669
|
+
const obj_name = obj.name;
|
|
670
|
+
const path_name = path + '.name';
|
|
671
|
+
if (typeof obj_name !== 'string') {
|
|
672
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
673
|
+
}
|
|
674
|
+
const obj_schedule = obj.schedule;
|
|
675
|
+
const path_schedule = path + '.schedule';
|
|
676
|
+
let obj_schedule_union0 = null;
|
|
677
|
+
const obj_schedule_union0_error = (() => {
|
|
678
|
+
const referencepath_scheduleValidationError = validate$8(obj_schedule, path_schedule);
|
|
679
|
+
if (referencepath_scheduleValidationError !== null) {
|
|
680
|
+
let message = 'Object doesn\'t match AppScheduleRepresentation (at "' + path_schedule + '")\n';
|
|
681
|
+
message += referencepath_scheduleValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
682
|
+
return new TypeError(message);
|
|
683
|
+
}
|
|
684
|
+
})();
|
|
685
|
+
if (obj_schedule_union0_error != null) {
|
|
686
|
+
obj_schedule_union0 = obj_schedule_union0_error.message;
|
|
687
|
+
}
|
|
688
|
+
let obj_schedule_union1 = null;
|
|
689
|
+
const obj_schedule_union1_error = (() => {
|
|
690
|
+
if (obj_schedule !== null) {
|
|
691
|
+
return new TypeError('Expected "null" but received "' + typeof obj_schedule + '" (at "' + path_schedule + '")');
|
|
692
|
+
}
|
|
693
|
+
})();
|
|
694
|
+
if (obj_schedule_union1_error != null) {
|
|
695
|
+
obj_schedule_union1 = obj_schedule_union1_error.message;
|
|
696
|
+
}
|
|
697
|
+
if (obj_schedule_union0 && obj_schedule_union1) {
|
|
698
|
+
let message = 'Object doesn\'t match union (at "' + path_schedule + '")';
|
|
699
|
+
message += '\n' + obj_schedule_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
700
|
+
message += '\n' + obj_schedule_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
701
|
+
return new TypeError(message);
|
|
702
|
+
}
|
|
703
|
+
const obj_templateSourceId = obj.templateSourceId;
|
|
704
|
+
const path_templateSourceId = path + '.templateSourceId';
|
|
705
|
+
if (typeof obj_templateSourceId !== 'string') {
|
|
706
|
+
return new TypeError('Expected "string" but received "' + typeof obj_templateSourceId + '" (at "' + path_templateSourceId + '")');
|
|
707
|
+
}
|
|
708
|
+
const obj_templateValues = obj.templateValues;
|
|
709
|
+
const path_templateValues = path + '.templateValues';
|
|
710
|
+
if (typeof obj_templateValues !== 'object' || ArrayIsArray(obj_templateValues) || obj_templateValues === null) {
|
|
711
|
+
return new TypeError('Expected "object" but received "' + typeof obj_templateValues + '" (at "' + path_templateValues + '")');
|
|
712
|
+
}
|
|
713
|
+
const obj_templateValues_keys = ObjectKeys(obj_templateValues);
|
|
714
|
+
for (let i = 0; i < obj_templateValues_keys.length; i++) {
|
|
715
|
+
const key = obj_templateValues_keys[i];
|
|
716
|
+
const obj_templateValues_prop = obj_templateValues[key];
|
|
717
|
+
const path_templateValues_prop = path_templateValues + '["' + key + '"]';
|
|
718
|
+
if (obj_templateValues_prop === undefined) {
|
|
719
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_templateValues_prop + '" (at "' + path_templateValues_prop + '")');
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
const obj_templateVersion = obj.templateVersion;
|
|
723
|
+
const path_templateVersion = path + '.templateVersion';
|
|
724
|
+
if (typeof obj_templateVersion !== 'string') {
|
|
725
|
+
return new TypeError('Expected "string" but received "' + typeof obj_templateVersion + '" (at "' + path_templateVersion + '")');
|
|
726
|
+
}
|
|
727
|
+
const obj_url = obj.url;
|
|
728
|
+
const path_url = path + '.url';
|
|
729
|
+
if (typeof obj_url !== 'string') {
|
|
730
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
731
|
+
}
|
|
732
|
+
})();
|
|
733
|
+
return v_error === undefined ? null : v_error;
|
|
734
|
+
}
|
|
735
|
+
const RepresentationType$7 = 'AppRepresentation';
|
|
736
|
+
function keyBuilder$i(luvio, config) {
|
|
737
|
+
return keyPrefix + '::' + RepresentationType$7 + ':' + config.id;
|
|
738
|
+
}
|
|
739
|
+
function keyBuilderFromType$5(luvio, object) {
|
|
740
|
+
const keyParams = {
|
|
741
|
+
id: object.id
|
|
742
|
+
};
|
|
743
|
+
return keyBuilder$i(luvio, keyParams);
|
|
744
|
+
}
|
|
745
|
+
function normalize$7(input, existing, path, luvio, store, timestamp) {
|
|
746
|
+
return input;
|
|
747
|
+
}
|
|
748
|
+
const select$e = function AppRepresentationSelect() {
|
|
749
|
+
const { selections: UserRepresentation__selections, opaque: UserRepresentation__opaque, } = select$m();
|
|
750
|
+
const { selections: AppScheduleRepresentation__selections, opaque: AppScheduleRepresentation__opaque, } = select$f();
|
|
751
|
+
return {
|
|
752
|
+
kind: 'Fragment',
|
|
753
|
+
version: VERSION$7,
|
|
754
|
+
private: [],
|
|
755
|
+
selections: [
|
|
756
|
+
{
|
|
757
|
+
name: 'applicationStatus',
|
|
758
|
+
kind: 'Scalar'
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
name: 'assetUrl',
|
|
762
|
+
kind: 'Scalar'
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
name: 'createdBy',
|
|
766
|
+
kind: 'Object',
|
|
767
|
+
selections: UserRepresentation__selections
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
name: 'createdDate',
|
|
771
|
+
kind: 'Scalar'
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
name: 'description',
|
|
775
|
+
kind: 'Scalar'
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
name: 'id',
|
|
779
|
+
kind: 'Scalar'
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
name: 'installationHistoryUrl',
|
|
783
|
+
kind: 'Scalar'
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
name: 'label',
|
|
787
|
+
kind: 'Scalar'
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
name: 'lastModifiedBy',
|
|
791
|
+
kind: 'Object',
|
|
792
|
+
selections: UserRepresentation__selections
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
name: 'lastModifiedDate',
|
|
796
|
+
kind: 'Scalar'
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
name: 'name',
|
|
800
|
+
kind: 'Scalar'
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
name: 'schedule',
|
|
804
|
+
kind: 'Object',
|
|
805
|
+
nullable: true,
|
|
806
|
+
selections: AppScheduleRepresentation__selections
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
name: 'templateSourceId',
|
|
810
|
+
kind: 'Scalar'
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
name: 'templateValues',
|
|
814
|
+
kind: 'Object',
|
|
815
|
+
// any
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
name: 'templateVersion',
|
|
819
|
+
kind: 'Scalar'
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
name: 'url',
|
|
823
|
+
kind: 'Scalar'
|
|
824
|
+
}
|
|
825
|
+
]
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
function equals$7(existing, incoming) {
|
|
829
|
+
const existing_applicationStatus = existing.applicationStatus;
|
|
830
|
+
const incoming_applicationStatus = incoming.applicationStatus;
|
|
831
|
+
if (!(existing_applicationStatus === incoming_applicationStatus)) {
|
|
832
|
+
return false;
|
|
833
|
+
}
|
|
834
|
+
const existing_assetUrl = existing.assetUrl;
|
|
835
|
+
const incoming_assetUrl = incoming.assetUrl;
|
|
836
|
+
if (!(existing_assetUrl === incoming_assetUrl)) {
|
|
837
|
+
return false;
|
|
838
|
+
}
|
|
839
|
+
const existing_createdDate = existing.createdDate;
|
|
840
|
+
const incoming_createdDate = incoming.createdDate;
|
|
841
|
+
if (!(existing_createdDate === incoming_createdDate)) {
|
|
842
|
+
return false;
|
|
843
|
+
}
|
|
844
|
+
const existing_id = existing.id;
|
|
845
|
+
const incoming_id = incoming.id;
|
|
846
|
+
if (!(existing_id === incoming_id)) {
|
|
847
|
+
return false;
|
|
848
|
+
}
|
|
849
|
+
const existing_installationHistoryUrl = existing.installationHistoryUrl;
|
|
850
|
+
const incoming_installationHistoryUrl = incoming.installationHistoryUrl;
|
|
851
|
+
if (!(existing_installationHistoryUrl === incoming_installationHistoryUrl)) {
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
const existing_label = existing.label;
|
|
855
|
+
const incoming_label = incoming.label;
|
|
856
|
+
if (!(existing_label === incoming_label)) {
|
|
857
|
+
return false;
|
|
858
|
+
}
|
|
859
|
+
const existing_lastModifiedDate = existing.lastModifiedDate;
|
|
860
|
+
const incoming_lastModifiedDate = incoming.lastModifiedDate;
|
|
861
|
+
if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
|
|
862
|
+
return false;
|
|
863
|
+
}
|
|
864
|
+
const existing_name = existing.name;
|
|
865
|
+
const incoming_name = incoming.name;
|
|
866
|
+
if (!(existing_name === incoming_name)) {
|
|
867
|
+
return false;
|
|
868
|
+
}
|
|
869
|
+
const existing_templateSourceId = existing.templateSourceId;
|
|
870
|
+
const incoming_templateSourceId = incoming.templateSourceId;
|
|
871
|
+
if (!(existing_templateSourceId === incoming_templateSourceId)) {
|
|
872
|
+
return false;
|
|
873
|
+
}
|
|
874
|
+
const existing_templateVersion = existing.templateVersion;
|
|
875
|
+
const incoming_templateVersion = incoming.templateVersion;
|
|
876
|
+
if (!(existing_templateVersion === incoming_templateVersion)) {
|
|
877
|
+
return false;
|
|
878
|
+
}
|
|
879
|
+
const existing_url = existing.url;
|
|
880
|
+
const incoming_url = incoming.url;
|
|
881
|
+
if (!(existing_url === incoming_url)) {
|
|
882
|
+
return false;
|
|
883
|
+
}
|
|
884
|
+
const existing_createdBy = existing.createdBy;
|
|
885
|
+
const incoming_createdBy = incoming.createdBy;
|
|
886
|
+
if (!(equals$c(existing_createdBy, incoming_createdBy))) {
|
|
887
|
+
return false;
|
|
888
|
+
}
|
|
889
|
+
const existing_description = existing.description;
|
|
890
|
+
const incoming_description = incoming.description;
|
|
891
|
+
if (!(existing_description === incoming_description)) {
|
|
892
|
+
return false;
|
|
893
|
+
}
|
|
894
|
+
const existing_lastModifiedBy = existing.lastModifiedBy;
|
|
895
|
+
const incoming_lastModifiedBy = incoming.lastModifiedBy;
|
|
896
|
+
if (!(equals$c(existing_lastModifiedBy, incoming_lastModifiedBy))) {
|
|
897
|
+
return false;
|
|
898
|
+
}
|
|
899
|
+
const existing_schedule = existing.schedule;
|
|
900
|
+
const incoming_schedule = incoming.schedule;
|
|
901
|
+
if (!(existing_schedule === incoming_schedule
|
|
902
|
+
|| (existing_schedule != null &&
|
|
903
|
+
incoming_schedule != null &&
|
|
904
|
+
equals$8(existing_schedule, incoming_schedule)))) {
|
|
905
|
+
return false;
|
|
906
|
+
}
|
|
907
|
+
const existing_templateValues = existing.templateValues;
|
|
908
|
+
const incoming_templateValues = incoming.templateValues;
|
|
909
|
+
const equals_templateValues_props = equalsObject(existing_templateValues, incoming_templateValues, (existing_templateValues_prop, incoming_templateValues_prop) => {
|
|
910
|
+
if (JSONStringify(incoming_templateValues_prop) !== JSONStringify(existing_templateValues_prop)) {
|
|
911
|
+
return false;
|
|
912
|
+
}
|
|
913
|
+
});
|
|
914
|
+
if (equals_templateValues_props === false) {
|
|
915
|
+
return false;
|
|
916
|
+
}
|
|
917
|
+
return true;
|
|
918
|
+
}
|
|
919
|
+
const ingest$7 = function AppRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
920
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
921
|
+
const validateError = validate$7(input);
|
|
922
|
+
if (validateError !== null) {
|
|
923
|
+
throw validateError;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
const key = keyBuilderFromType$5(luvio, input);
|
|
927
|
+
const ttlToUse = TTL$7;
|
|
928
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "AppFramework", VERSION$7, RepresentationType$7, equals$7);
|
|
929
|
+
return createLink(key);
|
|
930
|
+
};
|
|
931
|
+
function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
|
|
932
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
933
|
+
const rootKey = keyBuilderFromType$5(luvio, input);
|
|
934
|
+
rootKeySet.set(rootKey, {
|
|
935
|
+
namespace: keyPrefix,
|
|
936
|
+
representationName: RepresentationType$7,
|
|
937
|
+
mergeable: false
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
const TTL$6 = 5000;
|
|
942
|
+
const VERSION$6 = "e7a1233115fcb9b27ee13367015ae7e0";
|
|
943
|
+
function validate$6(obj, path = 'AppResultRepresentation') {
|
|
944
|
+
const v_error = (() => {
|
|
945
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
946
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
947
|
+
}
|
|
948
|
+
const obj_app = obj.app;
|
|
949
|
+
const path_app = path + '.app';
|
|
950
|
+
if (typeof obj_app !== 'object') {
|
|
951
|
+
return new TypeError('Expected "object" but received "' + typeof obj_app + '" (at "' + path_app + '")');
|
|
952
|
+
}
|
|
953
|
+
const obj_runtimeRequestId = obj.runtimeRequestId;
|
|
954
|
+
const path_runtimeRequestId = path + '.runtimeRequestId';
|
|
955
|
+
if (typeof obj_runtimeRequestId !== 'string') {
|
|
956
|
+
return new TypeError('Expected "string" but received "' + typeof obj_runtimeRequestId + '" (at "' + path_runtimeRequestId + '")');
|
|
957
|
+
}
|
|
958
|
+
const obj_state = obj.state;
|
|
959
|
+
const path_state = path + '.state';
|
|
960
|
+
if (typeof obj_state !== 'object' || ArrayIsArray(obj_state) || obj_state === null) {
|
|
961
|
+
return new TypeError('Expected "object" but received "' + typeof obj_state + '" (at "' + path_state + '")');
|
|
962
|
+
}
|
|
963
|
+
const obj_state_keys = ObjectKeys(obj_state);
|
|
964
|
+
for (let i = 0; i < obj_state_keys.length; i++) {
|
|
965
|
+
const key = obj_state_keys[i];
|
|
966
|
+
const obj_state_prop = obj_state[key];
|
|
967
|
+
const path_state_prop = path_state + '["' + key + '"]';
|
|
968
|
+
if (obj_state_prop === undefined) {
|
|
969
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_state_prop + '" (at "' + path_state_prop + '")');
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
})();
|
|
973
|
+
return v_error === undefined ? null : v_error;
|
|
974
|
+
}
|
|
975
|
+
const RepresentationType$6 = 'AppResultRepresentation';
|
|
976
|
+
function keyBuilder$h(luvio, config) {
|
|
977
|
+
return keyPrefix + '::' + RepresentationType$6 + ':' + config.id;
|
|
978
|
+
}
|
|
979
|
+
function keyBuilderFromType$4(luvio, object) {
|
|
980
|
+
const keyParams = {
|
|
981
|
+
id: object.app.id
|
|
982
|
+
};
|
|
983
|
+
return keyBuilder$h(luvio, keyParams);
|
|
984
|
+
}
|
|
985
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
986
|
+
const input_app = input.app;
|
|
987
|
+
const input_app_id = path.fullPath + '__app';
|
|
988
|
+
input.app = ingest$7(input_app, {
|
|
989
|
+
fullPath: input_app_id,
|
|
990
|
+
propertyName: 'app',
|
|
991
|
+
parent: {
|
|
992
|
+
data: input,
|
|
993
|
+
key: path.fullPath,
|
|
994
|
+
existing: existing,
|
|
995
|
+
},
|
|
996
|
+
ttl: path.ttl
|
|
997
|
+
}, luvio, store, timestamp);
|
|
998
|
+
return input;
|
|
999
|
+
}
|
|
1000
|
+
const select$d = function AppResultRepresentationSelect() {
|
|
1001
|
+
return {
|
|
1002
|
+
kind: 'Fragment',
|
|
1003
|
+
version: VERSION$6,
|
|
1004
|
+
private: [],
|
|
1005
|
+
selections: [
|
|
1006
|
+
{
|
|
1007
|
+
name: 'app',
|
|
1008
|
+
kind: 'Link',
|
|
1009
|
+
fragment: select$e()
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
name: 'runtimeRequestId',
|
|
1013
|
+
kind: 'Scalar'
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
name: 'state',
|
|
1017
|
+
kind: 'Object',
|
|
1018
|
+
// any
|
|
1019
|
+
}
|
|
1020
|
+
]
|
|
1021
|
+
};
|
|
1022
|
+
};
|
|
1023
|
+
function equals$6(existing, incoming) {
|
|
1024
|
+
const existing_runtimeRequestId = existing.runtimeRequestId;
|
|
1025
|
+
const incoming_runtimeRequestId = incoming.runtimeRequestId;
|
|
1026
|
+
if (!(existing_runtimeRequestId === incoming_runtimeRequestId)) {
|
|
1027
|
+
return false;
|
|
1028
|
+
}
|
|
1029
|
+
const existing_app = existing.app;
|
|
1030
|
+
const incoming_app = incoming.app;
|
|
1031
|
+
if (!(existing_app.__ref === incoming_app.__ref)) {
|
|
1032
|
+
return false;
|
|
1033
|
+
}
|
|
1034
|
+
const existing_state = existing.state;
|
|
1035
|
+
const incoming_state = incoming.state;
|
|
1036
|
+
const equals_state_props = equalsObject(existing_state, incoming_state, (existing_state_prop, incoming_state_prop) => {
|
|
1037
|
+
if (JSONStringify(incoming_state_prop) !== JSONStringify(existing_state_prop)) {
|
|
1038
|
+
return false;
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
if (equals_state_props === false) {
|
|
1042
|
+
return false;
|
|
1043
|
+
}
|
|
1044
|
+
return true;
|
|
1045
|
+
}
|
|
1046
|
+
const ingest$6 = function AppResultRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1047
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1048
|
+
const validateError = validate$6(input);
|
|
1049
|
+
if (validateError !== null) {
|
|
1050
|
+
throw validateError;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
const key = keyBuilderFromType$4(luvio, input);
|
|
1054
|
+
const ttlToUse = TTL$6;
|
|
1055
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "AppFramework", VERSION$6, RepresentationType$6, equals$6);
|
|
1056
|
+
return createLink(key);
|
|
1057
|
+
};
|
|
1058
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
1059
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1060
|
+
const rootKey = keyBuilderFromType$4(luvio, input);
|
|
1061
|
+
rootKeySet.set(rootKey, {
|
|
1062
|
+
namespace: keyPrefix,
|
|
1063
|
+
representationName: RepresentationType$6,
|
|
1064
|
+
mergeable: false
|
|
1065
|
+
});
|
|
1066
|
+
getTypeCacheKeys$7(rootKeySet, luvio, input.app);
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
function select$c(luvio, params) {
|
|
1070
|
+
return select$d();
|
|
1071
|
+
}
|
|
1072
|
+
function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
|
|
1073
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response);
|
|
1074
|
+
}
|
|
1075
|
+
function ingestSuccess$6(luvio, resourceParams, response) {
|
|
1076
|
+
const { body } = response;
|
|
1077
|
+
const key = keyBuilderFromType$4(luvio, body);
|
|
1078
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
1079
|
+
const snapshot = luvio.storeLookup({
|
|
1080
|
+
recordId: key,
|
|
1081
|
+
node: select$c(),
|
|
1082
|
+
variables: {},
|
|
1083
|
+
});
|
|
1084
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1085
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1086
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
deepFreeze(snapshot.data);
|
|
1090
|
+
return snapshot;
|
|
1091
|
+
}
|
|
1092
|
+
function createResourceRequest$7(config) {
|
|
1093
|
+
const headers = {};
|
|
1094
|
+
return {
|
|
1095
|
+
baseUri: '/services/data/v62.0',
|
|
1096
|
+
basePath: '/app-framework/apps',
|
|
1097
|
+
method: 'post',
|
|
1098
|
+
body: config.body,
|
|
1099
|
+
urlParams: {},
|
|
1100
|
+
queryParams: {},
|
|
1101
|
+
headers,
|
|
1102
|
+
priority: 'normal',
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
const adapterName$7 = 'createApp';
|
|
1107
|
+
const createApp_ConfigPropertyMetadata = [
|
|
1108
|
+
generateParamConfigMetadata('assetIcon', false, 2 /* Body */, 0 /* String */),
|
|
1109
|
+
generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
|
|
1110
|
+
generateParamConfigMetadata('label', true, 2 /* Body */, 0 /* String */),
|
|
1111
|
+
generateParamConfigMetadata('name', true, 2 /* Body */, 0 /* String */),
|
|
1112
|
+
generateParamConfigMetadata('templateSourceId', true, 2 /* Body */, 0 /* String */),
|
|
1113
|
+
generateParamConfigMetadata('templateValues', false, 2 /* Body */, 4 /* Unsupported */),
|
|
1114
|
+
generateParamConfigMetadata('templateVersion', false, 2 /* Body */, 0 /* String */),
|
|
1115
|
+
];
|
|
1116
|
+
const createApp_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, createApp_ConfigPropertyMetadata);
|
|
1117
|
+
const createResourceParams$7 = /*#__PURE__*/ createResourceParams$8(createApp_ConfigPropertyMetadata);
|
|
1118
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
1119
|
+
const config = {};
|
|
1120
|
+
typeCheckConfig$8(untrustedConfig, config, createApp_ConfigPropertyMetadata);
|
|
1121
|
+
const untrustedConfig_templateValues = untrustedConfig.templateValues;
|
|
1122
|
+
if (untrustedIsObject(untrustedConfig_templateValues)) {
|
|
1123
|
+
const untrustedConfig_templateValues_object = {};
|
|
1124
|
+
const untrustedConfig_templateValues_keys = Object.keys(untrustedConfig_templateValues);
|
|
1125
|
+
for (let i = 0, arrayLength = untrustedConfig_templateValues_keys.length; i < arrayLength; i++) {
|
|
1126
|
+
const key = untrustedConfig_templateValues_keys[i];
|
|
1127
|
+
const untrustedConfig_templateValues_prop = untrustedConfig_templateValues[key];
|
|
1128
|
+
if (untrustedConfig_templateValues_object !== undefined) {
|
|
1129
|
+
untrustedConfig_templateValues_object[key] = untrustedConfig_templateValues_prop;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
if (untrustedConfig_templateValues_object !== undefined && Object.keys(untrustedConfig_templateValues_object).length >= 0) {
|
|
1133
|
+
config.templateValues = untrustedConfig_templateValues_object;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
return config;
|
|
1137
|
+
}
|
|
1138
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
1139
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1140
|
+
return null;
|
|
1141
|
+
}
|
|
1142
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1143
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1144
|
+
}
|
|
1145
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
1146
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1147
|
+
return null;
|
|
1148
|
+
}
|
|
1149
|
+
return config;
|
|
1150
|
+
}
|
|
1151
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
1152
|
+
const resourceParams = createResourceParams$7(config);
|
|
1153
|
+
const request = createResourceRequest$7(resourceParams);
|
|
1154
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1155
|
+
.then((response) => {
|
|
1156
|
+
return luvio.handleSuccessResponse(() => {
|
|
1157
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response);
|
|
1158
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1159
|
+
}, () => {
|
|
1160
|
+
const cache = new StoreKeyMap();
|
|
1161
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
1162
|
+
return cache;
|
|
1163
|
+
});
|
|
1164
|
+
}, (response) => {
|
|
1165
|
+
deepFreeze(response);
|
|
1166
|
+
throw response;
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
const createAppAdapterFactory = (luvio) => {
|
|
1170
|
+
return function createApp(untrustedConfig) {
|
|
1171
|
+
const config = validateAdapterConfig$7(untrustedConfig, createApp_ConfigPropertyNames);
|
|
1172
|
+
// Invalid or incomplete config
|
|
1173
|
+
if (config === null) {
|
|
1174
|
+
throw new Error('Invalid config for "createApp"');
|
|
1175
|
+
}
|
|
1176
|
+
return buildNetworkSnapshot$7(luvio, config);
|
|
1177
|
+
};
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
function keyBuilder$g(luvio, params) {
|
|
1181
|
+
return keyBuilder$i(luvio, {
|
|
1182
|
+
id: params.urlParams.appIdOrApiName
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
function getResponseCacheKeys$6(cacheKeyMap, luvio, resourceParams) {
|
|
1186
|
+
const key = keyBuilder$g(luvio, resourceParams);
|
|
1187
|
+
cacheKeyMap.set(key, {
|
|
1188
|
+
namespace: keyPrefix,
|
|
1189
|
+
representationName: RepresentationType$7,
|
|
1190
|
+
mergeable: false
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
function evictSuccess(luvio, resourceParams) {
|
|
1194
|
+
const key = keyBuilder$g(luvio, resourceParams);
|
|
1195
|
+
luvio.storeEvict(key);
|
|
1196
|
+
}
|
|
1197
|
+
function createResourceRequest$6(config) {
|
|
1198
|
+
const headers = {};
|
|
1199
|
+
return {
|
|
1200
|
+
baseUri: '/services/data/v62.0',
|
|
1201
|
+
basePath: '/app-framework/apps/' + config.urlParams.appIdOrApiName + '',
|
|
1202
|
+
method: 'delete',
|
|
1203
|
+
body: null,
|
|
1204
|
+
urlParams: config.urlParams,
|
|
1205
|
+
queryParams: {},
|
|
1206
|
+
headers,
|
|
1207
|
+
priority: 'normal',
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
const adapterName$6 = 'deleteApp';
|
|
1212
|
+
const deleteApp_ConfigPropertyMetadata = [
|
|
1213
|
+
generateParamConfigMetadata('appIdOrApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1214
|
+
];
|
|
1215
|
+
const deleteApp_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, deleteApp_ConfigPropertyMetadata);
|
|
1216
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$8(deleteApp_ConfigPropertyMetadata);
|
|
1217
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
1218
|
+
const config = {};
|
|
1219
|
+
typeCheckConfig$8(untrustedConfig, config, deleteApp_ConfigPropertyMetadata);
|
|
1220
|
+
return config;
|
|
1221
|
+
}
|
|
1222
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
1223
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1224
|
+
return null;
|
|
1225
|
+
}
|
|
1226
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1227
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1228
|
+
}
|
|
1229
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
1230
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1231
|
+
return null;
|
|
1232
|
+
}
|
|
1233
|
+
return config;
|
|
1234
|
+
}
|
|
1235
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
1236
|
+
const resourceParams = createResourceParams$6(config);
|
|
1237
|
+
const request = createResourceRequest$6(resourceParams);
|
|
1238
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1239
|
+
.then(() => {
|
|
1240
|
+
return luvio.handleSuccessResponse(() => {
|
|
1241
|
+
evictSuccess(luvio, resourceParams);
|
|
1242
|
+
return luvio.storeBroadcast();
|
|
1243
|
+
}, () => {
|
|
1244
|
+
const cache = new StoreKeyMap();
|
|
1245
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams);
|
|
1246
|
+
return cache;
|
|
1247
|
+
});
|
|
1248
|
+
}, (response) => {
|
|
1249
|
+
deepFreeze(response);
|
|
1250
|
+
throw response;
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
const deleteAppAdapterFactory = (luvio) => {
|
|
1254
|
+
return function AppFrameworkdeleteApp(untrustedConfig) {
|
|
1255
|
+
const config = validateAdapterConfig$6(untrustedConfig, deleteApp_ConfigPropertyNames);
|
|
1256
|
+
// Invalid or incomplete config
|
|
1257
|
+
if (config === null) {
|
|
1258
|
+
throw new Error(`Invalid config for "${adapterName$6}"`);
|
|
1259
|
+
}
|
|
1260
|
+
return buildNetworkSnapshot$6(luvio, config);
|
|
1261
|
+
};
|
|
1262
|
+
};
|
|
1263
|
+
|
|
1264
|
+
function select$b(luvio, params) {
|
|
1265
|
+
return select$e();
|
|
1266
|
+
}
|
|
1267
|
+
function keyBuilder$f(luvio, params) {
|
|
1268
|
+
return keyBuilder$i(luvio, {
|
|
1269
|
+
id: params.urlParams.appIdOrApiName
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
1273
|
+
getTypeCacheKeys$7(storeKeyMap, luvio, response);
|
|
1274
|
+
}
|
|
1275
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
1276
|
+
const { body } = response;
|
|
1277
|
+
const key = keyBuilder$f(luvio, resourceParams);
|
|
1278
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
1279
|
+
const snapshot = luvio.storeLookup({
|
|
1280
|
+
recordId: key,
|
|
1281
|
+
node: select$b(),
|
|
1282
|
+
variables: {},
|
|
1283
|
+
}, snapshotRefresh);
|
|
1284
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1285
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1286
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
deepFreeze(snapshot.data);
|
|
1290
|
+
return snapshot;
|
|
1291
|
+
}
|
|
1292
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
1293
|
+
const key = keyBuilder$f(luvio, params);
|
|
1294
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1295
|
+
const storeMetadataParams = {
|
|
1296
|
+
ttl: TTL$7,
|
|
1297
|
+
namespace: keyPrefix,
|
|
1298
|
+
version: VERSION$7,
|
|
1299
|
+
representationName: RepresentationType$7
|
|
1300
|
+
};
|
|
1301
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1302
|
+
return errorSnapshot;
|
|
1303
|
+
}
|
|
1304
|
+
function createResourceRequest$5(config) {
|
|
1305
|
+
const headers = {};
|
|
1306
|
+
return {
|
|
1307
|
+
baseUri: '/services/data/v62.0',
|
|
1308
|
+
basePath: '/app-framework/apps/' + config.urlParams.appIdOrApiName + '',
|
|
1309
|
+
method: 'get',
|
|
1310
|
+
body: null,
|
|
1311
|
+
urlParams: config.urlParams,
|
|
1312
|
+
queryParams: {},
|
|
1313
|
+
headers,
|
|
1314
|
+
priority: 'normal',
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
function createResourceRequestFromRepresentation$3(representation) {
|
|
1318
|
+
const config = {
|
|
1319
|
+
urlParams: {},
|
|
1320
|
+
};
|
|
1321
|
+
config.urlParams.appIdOrApiName = representation.id;
|
|
1322
|
+
return createResourceRequest$5(config);
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
const adapterName$5 = 'getApp';
|
|
1326
|
+
const getApp_ConfigPropertyMetadata = [
|
|
1327
|
+
generateParamConfigMetadata('appIdOrApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1328
|
+
];
|
|
1329
|
+
const getApp_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getApp_ConfigPropertyMetadata);
|
|
1330
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$8(getApp_ConfigPropertyMetadata);
|
|
1331
|
+
function keyBuilder$e(luvio, config) {
|
|
1332
|
+
const resourceParams = createResourceParams$5(config);
|
|
1333
|
+
return keyBuilder$f(luvio, resourceParams);
|
|
1334
|
+
}
|
|
1335
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
1336
|
+
const config = {};
|
|
1337
|
+
typeCheckConfig$8(untrustedConfig, config, getApp_ConfigPropertyMetadata);
|
|
1338
|
+
return config;
|
|
1339
|
+
}
|
|
1340
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
1341
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1342
|
+
return null;
|
|
1343
|
+
}
|
|
1344
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1345
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1346
|
+
}
|
|
1347
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
1348
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1349
|
+
return null;
|
|
1350
|
+
}
|
|
1351
|
+
return config;
|
|
1352
|
+
}
|
|
1353
|
+
function adapterFragment$5(luvio, config) {
|
|
1354
|
+
createResourceParams$5(config);
|
|
1355
|
+
return select$b();
|
|
1356
|
+
}
|
|
1357
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
1358
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
1359
|
+
config,
|
|
1360
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1361
|
+
});
|
|
1362
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1363
|
+
}
|
|
1364
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
1365
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
1366
|
+
config,
|
|
1367
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1368
|
+
});
|
|
1369
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1370
|
+
}
|
|
1371
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
1372
|
+
const resourceParams = createResourceParams$5(config);
|
|
1373
|
+
const request = createResourceRequest$5(resourceParams);
|
|
1374
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1375
|
+
.then((response) => {
|
|
1376
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
1377
|
+
const cache = new StoreKeyMap();
|
|
1378
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
1379
|
+
return cache;
|
|
1380
|
+
});
|
|
1381
|
+
}, (response) => {
|
|
1382
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
1386
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
1387
|
+
}
|
|
1388
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
1389
|
+
const { luvio, config } = context;
|
|
1390
|
+
const selector = {
|
|
1391
|
+
recordId: keyBuilder$e(luvio, config),
|
|
1392
|
+
node: adapterFragment$5(luvio, config),
|
|
1393
|
+
variables: {},
|
|
1394
|
+
};
|
|
1395
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1396
|
+
config,
|
|
1397
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1398
|
+
});
|
|
1399
|
+
return cacheSnapshot;
|
|
1400
|
+
}
|
|
1401
|
+
const getAppAdapterFactory = (luvio) => function AppFramework__getApp(untrustedConfig, requestContext) {
|
|
1402
|
+
const config = validateAdapterConfig$5(untrustedConfig, getApp_ConfigPropertyNames);
|
|
1403
|
+
// Invalid or incomplete config
|
|
1404
|
+
if (config === null) {
|
|
1405
|
+
return null;
|
|
1406
|
+
}
|
|
1407
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1408
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
1409
|
+
};
|
|
1410
|
+
const notifyChangeFactory$3 = (luvio, options) => {
|
|
1411
|
+
return function getAppFrameworkAppsByAppIdOrApiNameNotifyChange(configs) {
|
|
1412
|
+
const keys = configs.map(c => keyBuilder$i(luvio, c));
|
|
1413
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
1414
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
1415
|
+
const { key, record: val } = entries[i];
|
|
1416
|
+
const refreshRequest = createResourceRequestFromRepresentation$3(val);
|
|
1417
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
1418
|
+
.then((response) => {
|
|
1419
|
+
return luvio.handleSuccessResponse(() => {
|
|
1420
|
+
const { body } = response;
|
|
1421
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
1422
|
+
return luvio.storeBroadcast();
|
|
1423
|
+
}, () => {
|
|
1424
|
+
const cache = new StoreKeyMap();
|
|
1425
|
+
getTypeCacheKeys$7(cache, luvio, response.body);
|
|
1426
|
+
return cache;
|
|
1427
|
+
});
|
|
1428
|
+
}, (error) => {
|
|
1429
|
+
return luvio.handleErrorResponse(() => {
|
|
1430
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
1431
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
1432
|
+
ttl: TTL$7,
|
|
1433
|
+
namespace: keyPrefix,
|
|
1434
|
+
version: VERSION$7,
|
|
1435
|
+
representationName: RepresentationType$7
|
|
1436
|
+
});
|
|
1437
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
1438
|
+
});
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
});
|
|
1442
|
+
};
|
|
1443
|
+
};
|
|
1444
|
+
|
|
1445
|
+
const TTL$5 = 5000;
|
|
1446
|
+
const VERSION$5 = "522326f05ee6a404b50ed781361a75b1";
|
|
1447
|
+
function validate$5(obj, path = 'AssetRepresentation') {
|
|
1448
|
+
const v_error = (() => {
|
|
1449
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1450
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1451
|
+
}
|
|
1452
|
+
const obj_assetIdOrName = obj.assetIdOrName;
|
|
1453
|
+
const path_assetIdOrName = path + '.assetIdOrName';
|
|
1454
|
+
if (typeof obj_assetIdOrName !== 'string') {
|
|
1455
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assetIdOrName + '" (at "' + path_assetIdOrName + '")');
|
|
1456
|
+
}
|
|
1457
|
+
const obj_assetIdOrName2 = obj.assetIdOrName2;
|
|
1458
|
+
const path_assetIdOrName2 = path + '.assetIdOrName2';
|
|
1459
|
+
let obj_assetIdOrName2_union0 = null;
|
|
1460
|
+
const obj_assetIdOrName2_union0_error = (() => {
|
|
1461
|
+
if (typeof obj_assetIdOrName2 !== 'string') {
|
|
1462
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assetIdOrName2 + '" (at "' + path_assetIdOrName2 + '")');
|
|
1463
|
+
}
|
|
1464
|
+
})();
|
|
1465
|
+
if (obj_assetIdOrName2_union0_error != null) {
|
|
1466
|
+
obj_assetIdOrName2_union0 = obj_assetIdOrName2_union0_error.message;
|
|
1467
|
+
}
|
|
1468
|
+
let obj_assetIdOrName2_union1 = null;
|
|
1469
|
+
const obj_assetIdOrName2_union1_error = (() => {
|
|
1470
|
+
if (obj_assetIdOrName2 !== null) {
|
|
1471
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assetIdOrName2 + '" (at "' + path_assetIdOrName2 + '")');
|
|
1472
|
+
}
|
|
1473
|
+
})();
|
|
1474
|
+
if (obj_assetIdOrName2_union1_error != null) {
|
|
1475
|
+
obj_assetIdOrName2_union1 = obj_assetIdOrName2_union1_error.message;
|
|
1476
|
+
}
|
|
1477
|
+
if (obj_assetIdOrName2_union0 && obj_assetIdOrName2_union1) {
|
|
1478
|
+
let message = 'Object doesn\'t match union (at "' + path_assetIdOrName2 + '")';
|
|
1479
|
+
message += '\n' + obj_assetIdOrName2_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1480
|
+
message += '\n' + obj_assetIdOrName2_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1481
|
+
return new TypeError(message);
|
|
1482
|
+
}
|
|
1483
|
+
const obj_assetIdOrName3 = obj.assetIdOrName3;
|
|
1484
|
+
const path_assetIdOrName3 = path + '.assetIdOrName3';
|
|
1485
|
+
let obj_assetIdOrName3_union0 = null;
|
|
1486
|
+
const obj_assetIdOrName3_union0_error = (() => {
|
|
1487
|
+
if (typeof obj_assetIdOrName3 !== 'string') {
|
|
1488
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assetIdOrName3 + '" (at "' + path_assetIdOrName3 + '")');
|
|
1489
|
+
}
|
|
1490
|
+
})();
|
|
1491
|
+
if (obj_assetIdOrName3_union0_error != null) {
|
|
1492
|
+
obj_assetIdOrName3_union0 = obj_assetIdOrName3_union0_error.message;
|
|
1493
|
+
}
|
|
1494
|
+
let obj_assetIdOrName3_union1 = null;
|
|
1495
|
+
const obj_assetIdOrName3_union1_error = (() => {
|
|
1496
|
+
if (obj_assetIdOrName3 !== null) {
|
|
1497
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assetIdOrName3 + '" (at "' + path_assetIdOrName3 + '")');
|
|
1498
|
+
}
|
|
1499
|
+
})();
|
|
1500
|
+
if (obj_assetIdOrName3_union1_error != null) {
|
|
1501
|
+
obj_assetIdOrName3_union1 = obj_assetIdOrName3_union1_error.message;
|
|
1502
|
+
}
|
|
1503
|
+
if (obj_assetIdOrName3_union0 && obj_assetIdOrName3_union1) {
|
|
1504
|
+
let message = 'Object doesn\'t match union (at "' + path_assetIdOrName3 + '")';
|
|
1505
|
+
message += '\n' + obj_assetIdOrName3_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1506
|
+
message += '\n' + obj_assetIdOrName3_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1507
|
+
return new TypeError(message);
|
|
1508
|
+
}
|
|
1509
|
+
const obj_id = obj.id;
|
|
1510
|
+
const path_id = path + '.id';
|
|
1511
|
+
if (typeof obj_id !== 'string') {
|
|
1512
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1513
|
+
}
|
|
1514
|
+
const obj_templateAssetSourceName = obj.templateAssetSourceName;
|
|
1515
|
+
const path_templateAssetSourceName = path + '.templateAssetSourceName';
|
|
1516
|
+
let obj_templateAssetSourceName_union0 = null;
|
|
1517
|
+
const obj_templateAssetSourceName_union0_error = (() => {
|
|
1518
|
+
if (typeof obj_templateAssetSourceName !== 'string') {
|
|
1519
|
+
return new TypeError('Expected "string" but received "' + typeof obj_templateAssetSourceName + '" (at "' + path_templateAssetSourceName + '")');
|
|
1520
|
+
}
|
|
1521
|
+
})();
|
|
1522
|
+
if (obj_templateAssetSourceName_union0_error != null) {
|
|
1523
|
+
obj_templateAssetSourceName_union0 = obj_templateAssetSourceName_union0_error.message;
|
|
1524
|
+
}
|
|
1525
|
+
let obj_templateAssetSourceName_union1 = null;
|
|
1526
|
+
const obj_templateAssetSourceName_union1_error = (() => {
|
|
1527
|
+
if (obj_templateAssetSourceName !== null) {
|
|
1528
|
+
return new TypeError('Expected "null" but received "' + typeof obj_templateAssetSourceName + '" (at "' + path_templateAssetSourceName + '")');
|
|
1529
|
+
}
|
|
1530
|
+
})();
|
|
1531
|
+
if (obj_templateAssetSourceName_union1_error != null) {
|
|
1532
|
+
obj_templateAssetSourceName_union1 = obj_templateAssetSourceName_union1_error.message;
|
|
1533
|
+
}
|
|
1534
|
+
if (obj_templateAssetSourceName_union0 && obj_templateAssetSourceName_union1) {
|
|
1535
|
+
let message = 'Object doesn\'t match union (at "' + path_templateAssetSourceName + '")';
|
|
1536
|
+
message += '\n' + obj_templateAssetSourceName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1537
|
+
message += '\n' + obj_templateAssetSourceName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1538
|
+
return new TypeError(message);
|
|
1539
|
+
}
|
|
1540
|
+
const obj_type = obj.type;
|
|
1541
|
+
const path_type = path + '.type';
|
|
1542
|
+
let obj_type_union0 = null;
|
|
1543
|
+
const obj_type_union0_error = (() => {
|
|
1544
|
+
if (typeof obj_type !== 'string') {
|
|
1545
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
1546
|
+
}
|
|
1547
|
+
})();
|
|
1548
|
+
if (obj_type_union0_error != null) {
|
|
1549
|
+
obj_type_union0 = obj_type_union0_error.message;
|
|
1550
|
+
}
|
|
1551
|
+
let obj_type_union1 = null;
|
|
1552
|
+
const obj_type_union1_error = (() => {
|
|
1553
|
+
if (obj_type !== null) {
|
|
1554
|
+
return new TypeError('Expected "null" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
1555
|
+
}
|
|
1556
|
+
})();
|
|
1557
|
+
if (obj_type_union1_error != null) {
|
|
1558
|
+
obj_type_union1 = obj_type_union1_error.message;
|
|
1559
|
+
}
|
|
1560
|
+
if (obj_type_union0 && obj_type_union1) {
|
|
1561
|
+
let message = 'Object doesn\'t match union (at "' + path_type + '")';
|
|
1562
|
+
message += '\n' + obj_type_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1563
|
+
message += '\n' + obj_type_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1564
|
+
return new TypeError(message);
|
|
1565
|
+
}
|
|
1566
|
+
})();
|
|
1567
|
+
return v_error === undefined ? null : v_error;
|
|
1568
|
+
}
|
|
1569
|
+
const RepresentationType$5 = 'AssetRepresentation';
|
|
1570
|
+
function keyBuilder$d(luvio, config) {
|
|
1571
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.id;
|
|
1572
|
+
}
|
|
1573
|
+
function keyBuilderFromType$3(luvio, object) {
|
|
1574
|
+
const keyParams = {
|
|
1575
|
+
id: object.id
|
|
1576
|
+
};
|
|
1577
|
+
return keyBuilder$d(luvio, keyParams);
|
|
1578
|
+
}
|
|
1579
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
1580
|
+
return input;
|
|
1581
|
+
}
|
|
1582
|
+
const select$a = function AssetRepresentationSelect() {
|
|
1583
|
+
return {
|
|
1584
|
+
kind: 'Fragment',
|
|
1585
|
+
version: VERSION$5,
|
|
1586
|
+
private: [],
|
|
1587
|
+
selections: [
|
|
1588
|
+
{
|
|
1589
|
+
name: 'assetIdOrName',
|
|
1590
|
+
kind: 'Scalar'
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
name: 'assetIdOrName2',
|
|
1594
|
+
kind: 'Scalar'
|
|
1595
|
+
},
|
|
1596
|
+
{
|
|
1597
|
+
name: 'assetIdOrName3',
|
|
1598
|
+
kind: 'Scalar'
|
|
1599
|
+
},
|
|
1600
|
+
{
|
|
1601
|
+
name: 'id',
|
|
1602
|
+
kind: 'Scalar'
|
|
1603
|
+
},
|
|
1604
|
+
{
|
|
1605
|
+
name: 'templateAssetSourceName',
|
|
1606
|
+
kind: 'Scalar'
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
name: 'type',
|
|
1610
|
+
kind: 'Scalar'
|
|
1611
|
+
}
|
|
1612
|
+
]
|
|
1613
|
+
};
|
|
1614
|
+
};
|
|
1615
|
+
function equals$5(existing, incoming) {
|
|
1616
|
+
const existing_assetIdOrName = existing.assetIdOrName;
|
|
1617
|
+
const incoming_assetIdOrName = incoming.assetIdOrName;
|
|
1618
|
+
if (!(existing_assetIdOrName === incoming_assetIdOrName)) {
|
|
1619
|
+
return false;
|
|
1620
|
+
}
|
|
1621
|
+
const existing_id = existing.id;
|
|
1622
|
+
const incoming_id = incoming.id;
|
|
1623
|
+
if (!(existing_id === incoming_id)) {
|
|
1624
|
+
return false;
|
|
1625
|
+
}
|
|
1626
|
+
const existing_assetIdOrName2 = existing.assetIdOrName2;
|
|
1627
|
+
const incoming_assetIdOrName2 = incoming.assetIdOrName2;
|
|
1628
|
+
if (!(existing_assetIdOrName2 === incoming_assetIdOrName2)) {
|
|
1629
|
+
return false;
|
|
1630
|
+
}
|
|
1631
|
+
const existing_assetIdOrName3 = existing.assetIdOrName3;
|
|
1632
|
+
const incoming_assetIdOrName3 = incoming.assetIdOrName3;
|
|
1633
|
+
if (!(existing_assetIdOrName3 === incoming_assetIdOrName3)) {
|
|
1634
|
+
return false;
|
|
1635
|
+
}
|
|
1636
|
+
const existing_templateAssetSourceName = existing.templateAssetSourceName;
|
|
1637
|
+
const incoming_templateAssetSourceName = incoming.templateAssetSourceName;
|
|
1638
|
+
if (!(existing_templateAssetSourceName === incoming_templateAssetSourceName)) {
|
|
1639
|
+
return false;
|
|
1640
|
+
}
|
|
1641
|
+
const existing_type = existing.type;
|
|
1642
|
+
const incoming_type = incoming.type;
|
|
1643
|
+
if (!(existing_type === incoming_type)) {
|
|
1644
|
+
return false;
|
|
1645
|
+
}
|
|
1646
|
+
return true;
|
|
1647
|
+
}
|
|
1648
|
+
const ingest$5 = function AssetRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1649
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1650
|
+
const validateError = validate$5(input);
|
|
1651
|
+
if (validateError !== null) {
|
|
1652
|
+
throw validateError;
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
const key = keyBuilderFromType$3(luvio, input);
|
|
1656
|
+
const ttlToUse = TTL$5;
|
|
1657
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "AppFramework", VERSION$5, RepresentationType$5, equals$5);
|
|
1658
|
+
return createLink(key);
|
|
1659
|
+
};
|
|
1660
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
1661
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1662
|
+
const rootKey = keyBuilderFromType$3(luvio, input);
|
|
1663
|
+
rootKeySet.set(rootKey, {
|
|
1664
|
+
namespace: keyPrefix,
|
|
1665
|
+
representationName: RepresentationType$5,
|
|
1666
|
+
mergeable: false
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
const TTL$4 = 5000;
|
|
1671
|
+
const VERSION$4 = "484e47e46cb53f96b32bb3c8c9de8053";
|
|
1672
|
+
function validate$4(obj, path = 'AssetCollectionRepresentation') {
|
|
1673
|
+
const v_error = (() => {
|
|
1674
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1675
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1676
|
+
}
|
|
1677
|
+
const obj_appId = obj.appId;
|
|
1678
|
+
const path_appId = path + '.appId';
|
|
1679
|
+
if (typeof obj_appId !== 'string') {
|
|
1680
|
+
return new TypeError('Expected "string" but received "' + typeof obj_appId + '" (at "' + path_appId + '")');
|
|
1681
|
+
}
|
|
1682
|
+
const obj_assets = obj.assets;
|
|
1683
|
+
const path_assets = path + '.assets';
|
|
1684
|
+
if (!ArrayIsArray(obj_assets)) {
|
|
1685
|
+
return new TypeError('Expected "array" but received "' + typeof obj_assets + '" (at "' + path_assets + '")');
|
|
1686
|
+
}
|
|
1687
|
+
for (let i = 0; i < obj_assets.length; i++) {
|
|
1688
|
+
const obj_assets_item = obj_assets[i];
|
|
1689
|
+
const path_assets_item = path_assets + '[' + i + ']';
|
|
1690
|
+
if (typeof obj_assets_item !== 'object') {
|
|
1691
|
+
return new TypeError('Expected "object" but received "' + typeof obj_assets_item + '" (at "' + path_assets_item + '")');
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
})();
|
|
1695
|
+
return v_error === undefined ? null : v_error;
|
|
1696
|
+
}
|
|
1697
|
+
const RepresentationType$4 = 'AssetCollectionRepresentation';
|
|
1698
|
+
function keyBuilder$c(luvio, config) {
|
|
1699
|
+
return keyPrefix + '::' + RepresentationType$4 + ':' + config.id;
|
|
1700
|
+
}
|
|
1701
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
1702
|
+
const keyParams = {
|
|
1703
|
+
id: object.appId
|
|
1704
|
+
};
|
|
1705
|
+
return keyBuilder$c(luvio, keyParams);
|
|
1706
|
+
}
|
|
1707
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
1708
|
+
const input_assets = input.assets;
|
|
1709
|
+
const input_assets_id = path.fullPath + '__assets';
|
|
1710
|
+
for (let i = 0; i < input_assets.length; i++) {
|
|
1711
|
+
const input_assets_item = input_assets[i];
|
|
1712
|
+
let input_assets_item_id = input_assets_id + '__' + i;
|
|
1713
|
+
input_assets[i] = ingest$5(input_assets_item, {
|
|
1714
|
+
fullPath: input_assets_item_id,
|
|
1715
|
+
propertyName: i,
|
|
1716
|
+
parent: {
|
|
1717
|
+
data: input,
|
|
1718
|
+
key: path.fullPath,
|
|
1719
|
+
existing: existing,
|
|
1720
|
+
},
|
|
1721
|
+
ttl: path.ttl
|
|
1722
|
+
}, luvio, store, timestamp);
|
|
1723
|
+
}
|
|
1724
|
+
return input;
|
|
1725
|
+
}
|
|
1726
|
+
const select$9 = function AssetCollectionRepresentationSelect() {
|
|
1727
|
+
return {
|
|
1728
|
+
kind: 'Fragment',
|
|
1729
|
+
version: VERSION$4,
|
|
1730
|
+
private: [],
|
|
1731
|
+
selections: [
|
|
1732
|
+
{
|
|
1733
|
+
name: 'appId',
|
|
1734
|
+
kind: 'Scalar'
|
|
1735
|
+
},
|
|
1736
|
+
{
|
|
1737
|
+
name: 'assets',
|
|
1738
|
+
kind: 'Link',
|
|
1739
|
+
plural: true,
|
|
1740
|
+
fragment: select$a()
|
|
1741
|
+
}
|
|
1742
|
+
]
|
|
1743
|
+
};
|
|
1744
|
+
};
|
|
1745
|
+
function equals$4(existing, incoming) {
|
|
1746
|
+
const existing_appId = existing.appId;
|
|
1747
|
+
const incoming_appId = incoming.appId;
|
|
1748
|
+
if (!(existing_appId === incoming_appId)) {
|
|
1749
|
+
return false;
|
|
1750
|
+
}
|
|
1751
|
+
const existing_assets = existing.assets;
|
|
1752
|
+
const incoming_assets = incoming.assets;
|
|
1753
|
+
const equals_assets_items = equalsArray(existing_assets, incoming_assets, (existing_assets_item, incoming_assets_item) => {
|
|
1754
|
+
if (!(existing_assets_item.__ref === incoming_assets_item.__ref)) {
|
|
1755
|
+
return false;
|
|
1756
|
+
}
|
|
1757
|
+
});
|
|
1758
|
+
if (equals_assets_items === false) {
|
|
1759
|
+
return false;
|
|
1760
|
+
}
|
|
1761
|
+
return true;
|
|
1762
|
+
}
|
|
1763
|
+
const ingest$4 = function AssetCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1764
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1765
|
+
const validateError = validate$4(input);
|
|
1766
|
+
if (validateError !== null) {
|
|
1767
|
+
throw validateError;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
1771
|
+
const ttlToUse = TTL$4;
|
|
1772
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "AppFramework", VERSION$4, RepresentationType$4, equals$4);
|
|
1773
|
+
return createLink(key);
|
|
1774
|
+
};
|
|
1775
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
1776
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1777
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
1778
|
+
rootKeySet.set(rootKey, {
|
|
1779
|
+
namespace: keyPrefix,
|
|
1780
|
+
representationName: RepresentationType$4,
|
|
1781
|
+
mergeable: false
|
|
1782
|
+
});
|
|
1783
|
+
const input_assets_length = input.assets.length;
|
|
1784
|
+
for (let i = 0; i < input_assets_length; i++) {
|
|
1785
|
+
getTypeCacheKeys$5(rootKeySet, luvio, input.assets[i]);
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
function select$8(luvio, params) {
|
|
1790
|
+
return select$9();
|
|
1791
|
+
}
|
|
1792
|
+
function keyBuilder$b(luvio, params) {
|
|
1793
|
+
return keyBuilder$c(luvio, {
|
|
1794
|
+
id: params.urlParams.appIdOrApiName
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
1798
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response);
|
|
1799
|
+
}
|
|
1800
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
1801
|
+
const { body } = response;
|
|
1802
|
+
const key = keyBuilder$b(luvio, resourceParams);
|
|
1803
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
1804
|
+
const snapshot = luvio.storeLookup({
|
|
1805
|
+
recordId: key,
|
|
1806
|
+
node: select$8(),
|
|
1807
|
+
variables: {},
|
|
1808
|
+
}, snapshotRefresh);
|
|
1809
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1810
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1811
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
deepFreeze(snapshot.data);
|
|
1815
|
+
return snapshot;
|
|
1816
|
+
}
|
|
1817
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
1818
|
+
const key = keyBuilder$b(luvio, params);
|
|
1819
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1820
|
+
const storeMetadataParams = {
|
|
1821
|
+
ttl: TTL$4,
|
|
1822
|
+
namespace: keyPrefix,
|
|
1823
|
+
version: VERSION$4,
|
|
1824
|
+
representationName: RepresentationType$4
|
|
1825
|
+
};
|
|
1826
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1827
|
+
return errorSnapshot;
|
|
1828
|
+
}
|
|
1829
|
+
function createResourceRequest$4(config) {
|
|
1830
|
+
const headers = {};
|
|
1831
|
+
return {
|
|
1832
|
+
baseUri: '/services/data/v62.0',
|
|
1833
|
+
basePath: '/app-framework/apps/' + config.urlParams.appIdOrApiName + '/assets',
|
|
1834
|
+
method: 'get',
|
|
1835
|
+
body: null,
|
|
1836
|
+
urlParams: config.urlParams,
|
|
1837
|
+
queryParams: config.queryParams,
|
|
1838
|
+
headers,
|
|
1839
|
+
priority: 'normal',
|
|
1840
|
+
};
|
|
1841
|
+
}
|
|
1842
|
+
function createResourceRequestFromRepresentation$2(representation) {
|
|
1843
|
+
const config = {
|
|
1844
|
+
urlParams: {},
|
|
1845
|
+
queryParams: {},
|
|
1846
|
+
};
|
|
1847
|
+
config.urlParams.appIdOrApiName = representation.appId;
|
|
1848
|
+
return createResourceRequest$4(config);
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
const adapterName$4 = 'getAppAssets';
|
|
1852
|
+
const getAppAssets_ConfigPropertyMetadata = [
|
|
1853
|
+
generateParamConfigMetadata('appIdOrApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1854
|
+
generateParamConfigMetadata('assetType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1855
|
+
generateParamConfigMetadata('templateAssetName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1856
|
+
];
|
|
1857
|
+
const getAppAssets_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getAppAssets_ConfigPropertyMetadata);
|
|
1858
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$8(getAppAssets_ConfigPropertyMetadata);
|
|
1859
|
+
function keyBuilder$a(luvio, config) {
|
|
1860
|
+
const resourceParams = createResourceParams$4(config);
|
|
1861
|
+
return keyBuilder$b(luvio, resourceParams);
|
|
1862
|
+
}
|
|
1863
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1864
|
+
const config = {};
|
|
1865
|
+
typeCheckConfig$8(untrustedConfig, config, getAppAssets_ConfigPropertyMetadata);
|
|
1866
|
+
return config;
|
|
1867
|
+
}
|
|
1868
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1869
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1870
|
+
return null;
|
|
1871
|
+
}
|
|
1872
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1873
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1874
|
+
}
|
|
1875
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1876
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1877
|
+
return null;
|
|
1878
|
+
}
|
|
1879
|
+
return config;
|
|
1880
|
+
}
|
|
1881
|
+
function adapterFragment$4(luvio, config) {
|
|
1882
|
+
createResourceParams$4(config);
|
|
1883
|
+
return select$8();
|
|
1884
|
+
}
|
|
1885
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
1886
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
1887
|
+
config,
|
|
1888
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1889
|
+
});
|
|
1890
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1891
|
+
}
|
|
1892
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
1893
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
1894
|
+
config,
|
|
1895
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1896
|
+
});
|
|
1897
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1898
|
+
}
|
|
1899
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1900
|
+
const resourceParams = createResourceParams$4(config);
|
|
1901
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1902
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1903
|
+
.then((response) => {
|
|
1904
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
1905
|
+
const cache = new StoreKeyMap();
|
|
1906
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
1907
|
+
return cache;
|
|
1908
|
+
});
|
|
1909
|
+
}, (response) => {
|
|
1910
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
1911
|
+
});
|
|
1912
|
+
}
|
|
1913
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
1914
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
1915
|
+
}
|
|
1916
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
1917
|
+
const { luvio, config } = context;
|
|
1918
|
+
const selector = {
|
|
1919
|
+
recordId: keyBuilder$a(luvio, config),
|
|
1920
|
+
node: adapterFragment$4(luvio, config),
|
|
1921
|
+
variables: {},
|
|
1922
|
+
};
|
|
1923
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1924
|
+
config,
|
|
1925
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1926
|
+
});
|
|
1927
|
+
return cacheSnapshot;
|
|
1928
|
+
}
|
|
1929
|
+
const getAppAssetsAdapterFactory = (luvio) => function AppFramework__getAppAssets(untrustedConfig, requestContext) {
|
|
1930
|
+
const config = validateAdapterConfig$4(untrustedConfig, getAppAssets_ConfigPropertyNames);
|
|
1931
|
+
// Invalid or incomplete config
|
|
1932
|
+
if (config === null) {
|
|
1933
|
+
return null;
|
|
1934
|
+
}
|
|
1935
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1936
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
1937
|
+
};
|
|
1938
|
+
const notifyChangeFactory$2 = (luvio, options) => {
|
|
1939
|
+
return function getAppFrameworkAppsAssetsByAppIdOrApiNameNotifyChange(configs) {
|
|
1940
|
+
const keys = configs.map(c => keyBuilder$c(luvio, c));
|
|
1941
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
1942
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
1943
|
+
const { key, record: val } = entries[i];
|
|
1944
|
+
const refreshRequest = createResourceRequestFromRepresentation$2(val);
|
|
1945
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
1946
|
+
.then((response) => {
|
|
1947
|
+
return luvio.handleSuccessResponse(() => {
|
|
1948
|
+
const { body } = response;
|
|
1949
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
1950
|
+
return luvio.storeBroadcast();
|
|
1951
|
+
}, () => {
|
|
1952
|
+
const cache = new StoreKeyMap();
|
|
1953
|
+
getTypeCacheKeys$4(cache, luvio, response.body);
|
|
1954
|
+
return cache;
|
|
1955
|
+
});
|
|
1956
|
+
}, (error) => {
|
|
1957
|
+
return luvio.handleErrorResponse(() => {
|
|
1958
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
1959
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
1960
|
+
ttl: TTL$4,
|
|
1961
|
+
namespace: keyPrefix,
|
|
1962
|
+
version: VERSION$4,
|
|
1963
|
+
representationName: RepresentationType$4
|
|
1964
|
+
});
|
|
1965
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
1966
|
+
});
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
});
|
|
1970
|
+
};
|
|
1971
|
+
};
|
|
1972
|
+
|
|
1973
|
+
const TTL$3 = 5000;
|
|
1974
|
+
const VERSION$3 = "2dd7266897d8b84ea0207582ca533d29";
|
|
1975
|
+
function validate$3(obj, path = 'AppCollectionRepresentation') {
|
|
1976
|
+
const v_error = (() => {
|
|
1977
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1978
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1979
|
+
}
|
|
1980
|
+
const obj_apps = obj.apps;
|
|
1981
|
+
const path_apps = path + '.apps';
|
|
1982
|
+
if (!ArrayIsArray(obj_apps)) {
|
|
1983
|
+
return new TypeError('Expected "array" but received "' + typeof obj_apps + '" (at "' + path_apps + '")');
|
|
1984
|
+
}
|
|
1985
|
+
for (let i = 0; i < obj_apps.length; i++) {
|
|
1986
|
+
const obj_apps_item = obj_apps[i];
|
|
1987
|
+
const path_apps_item = path_apps + '[' + i + ']';
|
|
1988
|
+
if (typeof obj_apps_item !== 'object') {
|
|
1989
|
+
return new TypeError('Expected "object" but received "' + typeof obj_apps_item + '" (at "' + path_apps_item + '")');
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
})();
|
|
1993
|
+
return v_error === undefined ? null : v_error;
|
|
1994
|
+
}
|
|
1995
|
+
const RepresentationType$3 = 'AppCollectionRepresentation';
|
|
1996
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1997
|
+
const input_apps = input.apps;
|
|
1998
|
+
const input_apps_id = path.fullPath + '__apps';
|
|
1999
|
+
for (let i = 0; i < input_apps.length; i++) {
|
|
2000
|
+
const input_apps_item = input_apps[i];
|
|
2001
|
+
let input_apps_item_id = input_apps_id + '__' + i;
|
|
2002
|
+
input_apps[i] = ingest$7(input_apps_item, {
|
|
2003
|
+
fullPath: input_apps_item_id,
|
|
2004
|
+
propertyName: i,
|
|
2005
|
+
parent: {
|
|
2006
|
+
data: input,
|
|
2007
|
+
key: path.fullPath,
|
|
2008
|
+
existing: existing,
|
|
2009
|
+
},
|
|
2010
|
+
ttl: path.ttl
|
|
2011
|
+
}, luvio, store, timestamp);
|
|
2012
|
+
}
|
|
2013
|
+
return input;
|
|
2014
|
+
}
|
|
2015
|
+
const select$7 = function AppCollectionRepresentationSelect() {
|
|
2016
|
+
return {
|
|
2017
|
+
kind: 'Fragment',
|
|
2018
|
+
version: VERSION$3,
|
|
2019
|
+
private: [],
|
|
2020
|
+
selections: [
|
|
2021
|
+
{
|
|
2022
|
+
name: 'apps',
|
|
2023
|
+
kind: 'Link',
|
|
2024
|
+
plural: true,
|
|
2025
|
+
fragment: select$e()
|
|
2026
|
+
}
|
|
2027
|
+
]
|
|
2028
|
+
};
|
|
2029
|
+
};
|
|
2030
|
+
function equals$3(existing, incoming) {
|
|
2031
|
+
const existing_apps = existing.apps;
|
|
2032
|
+
const incoming_apps = incoming.apps;
|
|
2033
|
+
const equals_apps_items = equalsArray(existing_apps, incoming_apps, (existing_apps_item, incoming_apps_item) => {
|
|
2034
|
+
if (!(existing_apps_item.__ref === incoming_apps_item.__ref)) {
|
|
2035
|
+
return false;
|
|
2036
|
+
}
|
|
2037
|
+
});
|
|
2038
|
+
if (equals_apps_items === false) {
|
|
2039
|
+
return false;
|
|
2040
|
+
}
|
|
2041
|
+
return true;
|
|
2042
|
+
}
|
|
2043
|
+
const ingest$3 = function AppCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2044
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2045
|
+
const validateError = validate$3(input);
|
|
2046
|
+
if (validateError !== null) {
|
|
2047
|
+
throw validateError;
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
const key = path.fullPath;
|
|
2051
|
+
const ttlToUse = TTL$3;
|
|
2052
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "AppFramework", VERSION$3, RepresentationType$3, equals$3);
|
|
2053
|
+
return createLink(key);
|
|
2054
|
+
};
|
|
2055
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
2056
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2057
|
+
const rootKey = fullPathFactory();
|
|
2058
|
+
rootKeySet.set(rootKey, {
|
|
2059
|
+
namespace: keyPrefix,
|
|
2060
|
+
representationName: RepresentationType$3,
|
|
2061
|
+
mergeable: false
|
|
2062
|
+
});
|
|
2063
|
+
const input_apps_length = input.apps.length;
|
|
2064
|
+
for (let i = 0; i < input_apps_length; i++) {
|
|
2065
|
+
getTypeCacheKeys$7(rootKeySet, luvio, input.apps[i]);
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
function select$6(luvio, params) {
|
|
2070
|
+
return select$7();
|
|
2071
|
+
}
|
|
2072
|
+
function keyBuilder$9(luvio, params) {
|
|
2073
|
+
return keyPrefix + '::AppCollectionRepresentation:(' + 'templateSourceId:' + params.queryParams.templateSourceId + ')';
|
|
2074
|
+
}
|
|
2075
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
2076
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$9(luvio, resourceParams));
|
|
2077
|
+
}
|
|
2078
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
2079
|
+
const { body } = response;
|
|
2080
|
+
const key = keyBuilder$9(luvio, resourceParams);
|
|
2081
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
2082
|
+
const snapshot = luvio.storeLookup({
|
|
2083
|
+
recordId: key,
|
|
2084
|
+
node: select$6(),
|
|
2085
|
+
variables: {},
|
|
2086
|
+
}, snapshotRefresh);
|
|
2087
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2088
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2089
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
deepFreeze(snapshot.data);
|
|
2093
|
+
return snapshot;
|
|
2094
|
+
}
|
|
2095
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
2096
|
+
const key = keyBuilder$9(luvio, params);
|
|
2097
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2098
|
+
const storeMetadataParams = {
|
|
2099
|
+
ttl: TTL$3,
|
|
2100
|
+
namespace: keyPrefix,
|
|
2101
|
+
version: VERSION$3,
|
|
2102
|
+
representationName: RepresentationType$3
|
|
2103
|
+
};
|
|
2104
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2105
|
+
return errorSnapshot;
|
|
2106
|
+
}
|
|
2107
|
+
function createResourceRequest$3(config) {
|
|
2108
|
+
const headers = {};
|
|
2109
|
+
return {
|
|
2110
|
+
baseUri: '/services/data/v62.0',
|
|
2111
|
+
basePath: '/app-framework/apps',
|
|
2112
|
+
method: 'get',
|
|
2113
|
+
body: null,
|
|
2114
|
+
urlParams: {},
|
|
2115
|
+
queryParams: config.queryParams,
|
|
2116
|
+
headers,
|
|
2117
|
+
priority: 'normal',
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
const adapterName$3 = 'getApps';
|
|
2122
|
+
const getApps_ConfigPropertyMetadata = [
|
|
2123
|
+
generateParamConfigMetadata('templateSourceId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2124
|
+
];
|
|
2125
|
+
const getApps_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getApps_ConfigPropertyMetadata);
|
|
2126
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$8(getApps_ConfigPropertyMetadata);
|
|
2127
|
+
function keyBuilder$8(luvio, config) {
|
|
2128
|
+
const resourceParams = createResourceParams$3(config);
|
|
2129
|
+
return keyBuilder$9(luvio, resourceParams);
|
|
2130
|
+
}
|
|
2131
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
2132
|
+
const config = {};
|
|
2133
|
+
typeCheckConfig$8(untrustedConfig, config, getApps_ConfigPropertyMetadata);
|
|
2134
|
+
return config;
|
|
2135
|
+
}
|
|
2136
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
2137
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2138
|
+
return null;
|
|
2139
|
+
}
|
|
2140
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2141
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2142
|
+
}
|
|
2143
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
2144
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2145
|
+
return null;
|
|
2146
|
+
}
|
|
2147
|
+
return config;
|
|
2148
|
+
}
|
|
2149
|
+
function adapterFragment$3(luvio, config) {
|
|
2150
|
+
createResourceParams$3(config);
|
|
2151
|
+
return select$6();
|
|
2152
|
+
}
|
|
2153
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
2154
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
2155
|
+
config,
|
|
2156
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2157
|
+
});
|
|
2158
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2159
|
+
}
|
|
2160
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
2161
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
2162
|
+
config,
|
|
2163
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2164
|
+
});
|
|
2165
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2166
|
+
}
|
|
2167
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2168
|
+
const resourceParams = createResourceParams$3(config);
|
|
2169
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2170
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2171
|
+
.then((response) => {
|
|
2172
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
2173
|
+
const cache = new StoreKeyMap();
|
|
2174
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
2175
|
+
return cache;
|
|
2176
|
+
});
|
|
2177
|
+
}, (response) => {
|
|
2178
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
2179
|
+
});
|
|
2180
|
+
}
|
|
2181
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
2182
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
2183
|
+
}
|
|
2184
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
2185
|
+
const { luvio, config } = context;
|
|
2186
|
+
const selector = {
|
|
2187
|
+
recordId: keyBuilder$8(luvio, config),
|
|
2188
|
+
node: adapterFragment$3(luvio, config),
|
|
2189
|
+
variables: {},
|
|
2190
|
+
};
|
|
2191
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2192
|
+
config,
|
|
2193
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2194
|
+
});
|
|
2195
|
+
return cacheSnapshot;
|
|
2196
|
+
}
|
|
2197
|
+
const getAppsAdapterFactory = (luvio) => function AppFramework__getApps(untrustedConfig, requestContext) {
|
|
2198
|
+
const config = validateAdapterConfig$3(untrustedConfig, getApps_ConfigPropertyNames);
|
|
2199
|
+
// Invalid or incomplete config
|
|
2200
|
+
if (config === null) {
|
|
2201
|
+
return null;
|
|
2202
|
+
}
|
|
2203
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2204
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
2205
|
+
};
|
|
2206
|
+
|
|
2207
|
+
const TTL$2 = 5000;
|
|
2208
|
+
const VERSION$2 = "85c6e0101e9036689e3419fa8307a5c4";
|
|
2209
|
+
function validate$2(obj, path = 'TemplateRepresentation') {
|
|
2210
|
+
const v_error = (() => {
|
|
2211
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2212
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2213
|
+
}
|
|
2214
|
+
const obj_configurationUrl = obj.configurationUrl;
|
|
2215
|
+
const path_configurationUrl = path + '.configurationUrl';
|
|
2216
|
+
if (typeof obj_configurationUrl !== 'string') {
|
|
2217
|
+
return new TypeError('Expected "string" but received "' + typeof obj_configurationUrl + '" (at "' + path_configurationUrl + '")');
|
|
2218
|
+
}
|
|
2219
|
+
const obj_description = obj.description;
|
|
2220
|
+
const path_description = path + '.description';
|
|
2221
|
+
let obj_description_union0 = null;
|
|
2222
|
+
const obj_description_union0_error = (() => {
|
|
2223
|
+
if (typeof obj_description !== 'string') {
|
|
2224
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2225
|
+
}
|
|
2226
|
+
})();
|
|
2227
|
+
if (obj_description_union0_error != null) {
|
|
2228
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
2229
|
+
}
|
|
2230
|
+
let obj_description_union1 = null;
|
|
2231
|
+
const obj_description_union1_error = (() => {
|
|
2232
|
+
if (obj_description !== null) {
|
|
2233
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2234
|
+
}
|
|
2235
|
+
})();
|
|
2236
|
+
if (obj_description_union1_error != null) {
|
|
2237
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
2238
|
+
}
|
|
2239
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
2240
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
2241
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2242
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2243
|
+
return new TypeError(message);
|
|
2244
|
+
}
|
|
2245
|
+
const obj_id = obj.id;
|
|
2246
|
+
const path_id = path + '.id';
|
|
2247
|
+
if (typeof obj_id !== 'string') {
|
|
2248
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2249
|
+
}
|
|
2250
|
+
const obj_label = obj.label;
|
|
2251
|
+
const path_label = path + '.label';
|
|
2252
|
+
if (typeof obj_label !== 'string') {
|
|
2253
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
2254
|
+
}
|
|
2255
|
+
const obj_name = obj.name;
|
|
2256
|
+
const path_name = path + '.name';
|
|
2257
|
+
if (typeof obj_name !== 'string') {
|
|
2258
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2259
|
+
}
|
|
2260
|
+
const obj_type = obj.type;
|
|
2261
|
+
const path_type = path + '.type';
|
|
2262
|
+
if (typeof obj_type !== 'string') {
|
|
2263
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
2264
|
+
}
|
|
2265
|
+
const obj_url = obj.url;
|
|
2266
|
+
const path_url = path + '.url';
|
|
2267
|
+
if (typeof obj_url !== 'string') {
|
|
2268
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
2269
|
+
}
|
|
2270
|
+
})();
|
|
2271
|
+
return v_error === undefined ? null : v_error;
|
|
2272
|
+
}
|
|
2273
|
+
const RepresentationType$2 = 'TemplateRepresentation';
|
|
2274
|
+
function keyBuilder$7(luvio, config) {
|
|
2275
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.id;
|
|
2276
|
+
}
|
|
2277
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
2278
|
+
const keyParams = {
|
|
2279
|
+
id: object.id
|
|
2280
|
+
};
|
|
2281
|
+
return keyBuilder$7(luvio, keyParams);
|
|
2282
|
+
}
|
|
2283
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
2284
|
+
return input;
|
|
2285
|
+
}
|
|
2286
|
+
const select$5 = function TemplateRepresentationSelect() {
|
|
2287
|
+
return {
|
|
2288
|
+
kind: 'Fragment',
|
|
2289
|
+
version: VERSION$2,
|
|
2290
|
+
private: [],
|
|
2291
|
+
selections: [
|
|
2292
|
+
{
|
|
2293
|
+
name: 'configurationUrl',
|
|
2294
|
+
kind: 'Scalar'
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
name: 'description',
|
|
2298
|
+
kind: 'Scalar'
|
|
2299
|
+
},
|
|
2300
|
+
{
|
|
2301
|
+
name: 'id',
|
|
2302
|
+
kind: 'Scalar'
|
|
2303
|
+
},
|
|
2304
|
+
{
|
|
2305
|
+
name: 'label',
|
|
2306
|
+
kind: 'Scalar'
|
|
2307
|
+
},
|
|
2308
|
+
{
|
|
2309
|
+
name: 'name',
|
|
2310
|
+
kind: 'Scalar'
|
|
2311
|
+
},
|
|
2312
|
+
{
|
|
2313
|
+
name: 'type',
|
|
2314
|
+
kind: 'Scalar'
|
|
2315
|
+
},
|
|
2316
|
+
{
|
|
2317
|
+
name: 'url',
|
|
2318
|
+
kind: 'Scalar'
|
|
2319
|
+
}
|
|
2320
|
+
]
|
|
2321
|
+
};
|
|
2322
|
+
};
|
|
2323
|
+
function equals$2(existing, incoming) {
|
|
2324
|
+
const existing_configurationUrl = existing.configurationUrl;
|
|
2325
|
+
const incoming_configurationUrl = incoming.configurationUrl;
|
|
2326
|
+
if (!(existing_configurationUrl === incoming_configurationUrl)) {
|
|
2327
|
+
return false;
|
|
2328
|
+
}
|
|
2329
|
+
const existing_id = existing.id;
|
|
2330
|
+
const incoming_id = incoming.id;
|
|
2331
|
+
if (!(existing_id === incoming_id)) {
|
|
2332
|
+
return false;
|
|
2333
|
+
}
|
|
2334
|
+
const existing_label = existing.label;
|
|
2335
|
+
const incoming_label = incoming.label;
|
|
2336
|
+
if (!(existing_label === incoming_label)) {
|
|
2337
|
+
return false;
|
|
2338
|
+
}
|
|
2339
|
+
const existing_name = existing.name;
|
|
2340
|
+
const incoming_name = incoming.name;
|
|
2341
|
+
if (!(existing_name === incoming_name)) {
|
|
2342
|
+
return false;
|
|
2343
|
+
}
|
|
2344
|
+
const existing_type = existing.type;
|
|
2345
|
+
const incoming_type = incoming.type;
|
|
2346
|
+
if (!(existing_type === incoming_type)) {
|
|
2347
|
+
return false;
|
|
2348
|
+
}
|
|
2349
|
+
const existing_url = existing.url;
|
|
2350
|
+
const incoming_url = incoming.url;
|
|
2351
|
+
if (!(existing_url === incoming_url)) {
|
|
2352
|
+
return false;
|
|
2353
|
+
}
|
|
2354
|
+
const existing_description = existing.description;
|
|
2355
|
+
const incoming_description = incoming.description;
|
|
2356
|
+
if (!(existing_description === incoming_description)) {
|
|
2357
|
+
return false;
|
|
2358
|
+
}
|
|
2359
|
+
return true;
|
|
2360
|
+
}
|
|
2361
|
+
const ingest$2 = function TemplateRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2362
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2363
|
+
const validateError = validate$2(input);
|
|
2364
|
+
if (validateError !== null) {
|
|
2365
|
+
throw validateError;
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
2369
|
+
const ttlToUse = TTL$2;
|
|
2370
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "AppFramework", VERSION$2, RepresentationType$2, equals$2);
|
|
2371
|
+
return createLink(key);
|
|
2372
|
+
};
|
|
2373
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
2374
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2375
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
2376
|
+
rootKeySet.set(rootKey, {
|
|
2377
|
+
namespace: keyPrefix,
|
|
2378
|
+
representationName: RepresentationType$2,
|
|
2379
|
+
mergeable: false
|
|
2380
|
+
});
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
function select$4(luvio, params) {
|
|
2384
|
+
return select$5();
|
|
2385
|
+
}
|
|
2386
|
+
function keyBuilder$6(luvio, params) {
|
|
2387
|
+
return keyBuilder$7(luvio, {
|
|
2388
|
+
id: params.urlParams.templateIdOrApiName
|
|
2389
|
+
});
|
|
2390
|
+
}
|
|
2391
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
2392
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
2393
|
+
}
|
|
2394
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
2395
|
+
const { body } = response;
|
|
2396
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
2397
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
2398
|
+
const snapshot = luvio.storeLookup({
|
|
2399
|
+
recordId: key,
|
|
2400
|
+
node: select$4(),
|
|
2401
|
+
variables: {},
|
|
2402
|
+
}, snapshotRefresh);
|
|
2403
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2404
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2405
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
deepFreeze(snapshot.data);
|
|
2409
|
+
return snapshot;
|
|
2410
|
+
}
|
|
2411
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
2412
|
+
const key = keyBuilder$6(luvio, params);
|
|
2413
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2414
|
+
const storeMetadataParams = {
|
|
2415
|
+
ttl: TTL$2,
|
|
2416
|
+
namespace: keyPrefix,
|
|
2417
|
+
version: VERSION$2,
|
|
2418
|
+
representationName: RepresentationType$2
|
|
2419
|
+
};
|
|
2420
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2421
|
+
return errorSnapshot;
|
|
2422
|
+
}
|
|
2423
|
+
function createResourceRequest$2(config) {
|
|
2424
|
+
const headers = {};
|
|
2425
|
+
return {
|
|
2426
|
+
baseUri: '/services/data/v62.0',
|
|
2427
|
+
basePath: '/app-framework/templates/' + config.urlParams.templateIdOrApiName + '',
|
|
2428
|
+
method: 'get',
|
|
2429
|
+
body: null,
|
|
2430
|
+
urlParams: config.urlParams,
|
|
2431
|
+
queryParams: {},
|
|
2432
|
+
headers,
|
|
2433
|
+
priority: 'normal',
|
|
2434
|
+
};
|
|
2435
|
+
}
|
|
2436
|
+
function createResourceRequestFromRepresentation$1(representation) {
|
|
2437
|
+
const config = {
|
|
2438
|
+
urlParams: {},
|
|
2439
|
+
};
|
|
2440
|
+
config.urlParams.templateIdOrApiName = representation.id;
|
|
2441
|
+
return createResourceRequest$2(config);
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
const adapterName$2 = 'getTemplate';
|
|
2445
|
+
const getTemplate_ConfigPropertyMetadata = [
|
|
2446
|
+
generateParamConfigMetadata('templateIdOrApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2447
|
+
];
|
|
2448
|
+
const getTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getTemplate_ConfigPropertyMetadata);
|
|
2449
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$8(getTemplate_ConfigPropertyMetadata);
|
|
2450
|
+
function keyBuilder$5(luvio, config) {
|
|
2451
|
+
const resourceParams = createResourceParams$2(config);
|
|
2452
|
+
return keyBuilder$6(luvio, resourceParams);
|
|
2453
|
+
}
|
|
2454
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
2455
|
+
const config = {};
|
|
2456
|
+
typeCheckConfig$8(untrustedConfig, config, getTemplate_ConfigPropertyMetadata);
|
|
2457
|
+
return config;
|
|
2458
|
+
}
|
|
2459
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
2460
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2461
|
+
return null;
|
|
2462
|
+
}
|
|
2463
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2464
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2465
|
+
}
|
|
2466
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
2467
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2468
|
+
return null;
|
|
2469
|
+
}
|
|
2470
|
+
return config;
|
|
2471
|
+
}
|
|
2472
|
+
function adapterFragment$2(luvio, config) {
|
|
2473
|
+
createResourceParams$2(config);
|
|
2474
|
+
return select$4();
|
|
2475
|
+
}
|
|
2476
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
2477
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
2478
|
+
config,
|
|
2479
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2480
|
+
});
|
|
2481
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2482
|
+
}
|
|
2483
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
2484
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
2485
|
+
config,
|
|
2486
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2487
|
+
});
|
|
2488
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2489
|
+
}
|
|
2490
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
2491
|
+
const resourceParams = createResourceParams$2(config);
|
|
2492
|
+
const request = createResourceRequest$2(resourceParams);
|
|
2493
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2494
|
+
.then((response) => {
|
|
2495
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
2496
|
+
const cache = new StoreKeyMap();
|
|
2497
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
2498
|
+
return cache;
|
|
2499
|
+
});
|
|
2500
|
+
}, (response) => {
|
|
2501
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
2502
|
+
});
|
|
2503
|
+
}
|
|
2504
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2505
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
2506
|
+
}
|
|
2507
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2508
|
+
const { luvio, config } = context;
|
|
2509
|
+
const selector = {
|
|
2510
|
+
recordId: keyBuilder$5(luvio, config),
|
|
2511
|
+
node: adapterFragment$2(luvio, config),
|
|
2512
|
+
variables: {},
|
|
2513
|
+
};
|
|
2514
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2515
|
+
config,
|
|
2516
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2517
|
+
});
|
|
2518
|
+
return cacheSnapshot;
|
|
2519
|
+
}
|
|
2520
|
+
const getTemplateAdapterFactory = (luvio) => function AppFramework__getTemplate(untrustedConfig, requestContext) {
|
|
2521
|
+
const config = validateAdapterConfig$2(untrustedConfig, getTemplate_ConfigPropertyNames);
|
|
2522
|
+
// Invalid or incomplete config
|
|
2523
|
+
if (config === null) {
|
|
2524
|
+
return null;
|
|
2525
|
+
}
|
|
2526
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2527
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
2528
|
+
};
|
|
2529
|
+
const notifyChangeFactory$1 = (luvio, options) => {
|
|
2530
|
+
return function getAppFrameworkTemplatesByTemplateIdOrApiNameNotifyChange(configs) {
|
|
2531
|
+
const keys = configs.map(c => keyBuilder$7(luvio, c));
|
|
2532
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
2533
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
2534
|
+
const { key, record: val } = entries[i];
|
|
2535
|
+
const refreshRequest = createResourceRequestFromRepresentation$1(val);
|
|
2536
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
2537
|
+
.then((response) => {
|
|
2538
|
+
return luvio.handleSuccessResponse(() => {
|
|
2539
|
+
const { body } = response;
|
|
2540
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
2541
|
+
return luvio.storeBroadcast();
|
|
2542
|
+
}, () => {
|
|
2543
|
+
const cache = new StoreKeyMap();
|
|
2544
|
+
getTypeCacheKeys$2(cache, luvio, response.body);
|
|
2545
|
+
return cache;
|
|
2546
|
+
});
|
|
2547
|
+
}, (error) => {
|
|
2548
|
+
return luvio.handleErrorResponse(() => {
|
|
2549
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
2550
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
2551
|
+
ttl: TTL$2,
|
|
2552
|
+
namespace: keyPrefix,
|
|
2553
|
+
version: VERSION$2,
|
|
2554
|
+
representationName: RepresentationType$2
|
|
2555
|
+
});
|
|
2556
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
2557
|
+
});
|
|
2558
|
+
});
|
|
2559
|
+
}
|
|
2560
|
+
});
|
|
2561
|
+
};
|
|
2562
|
+
};
|
|
2563
|
+
|
|
2564
|
+
const TTL$1 = 5000;
|
|
2565
|
+
const VERSION$1 = "e6fefdec79109bdf21676f6faa21f07d";
|
|
2566
|
+
function validate$1(obj, path = 'TemplateConfigurationRepresentation') {
|
|
2567
|
+
const v_error = (() => {
|
|
2568
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2569
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2570
|
+
}
|
|
2571
|
+
const obj_id = obj.id;
|
|
2572
|
+
const path_id = path + '.id';
|
|
2573
|
+
if (typeof obj_id !== 'string') {
|
|
2574
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2575
|
+
}
|
|
2576
|
+
const obj_name = obj.name;
|
|
2577
|
+
const path_name = path + '.name';
|
|
2578
|
+
if (typeof obj_name !== 'string') {
|
|
2579
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2580
|
+
}
|
|
2581
|
+
})();
|
|
2582
|
+
return v_error === undefined ? null : v_error;
|
|
2583
|
+
}
|
|
2584
|
+
const RepresentationType$1 = 'TemplateConfigurationRepresentation';
|
|
2585
|
+
function keyBuilder$4(luvio, config) {
|
|
2586
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
|
|
2587
|
+
}
|
|
2588
|
+
function keyBuilderFromType(luvio, object) {
|
|
2589
|
+
const keyParams = {
|
|
2590
|
+
id: object.id
|
|
2591
|
+
};
|
|
2592
|
+
return keyBuilder$4(luvio, keyParams);
|
|
2593
|
+
}
|
|
2594
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
2595
|
+
return input;
|
|
2596
|
+
}
|
|
2597
|
+
const select$3 = function TemplateConfigurationRepresentationSelect() {
|
|
2598
|
+
return {
|
|
2599
|
+
kind: 'Fragment',
|
|
2600
|
+
version: VERSION$1,
|
|
2601
|
+
private: [],
|
|
2602
|
+
selections: [
|
|
2603
|
+
{
|
|
2604
|
+
name: 'id',
|
|
2605
|
+
kind: 'Scalar'
|
|
2606
|
+
},
|
|
2607
|
+
{
|
|
2608
|
+
name: 'name',
|
|
2609
|
+
kind: 'Scalar'
|
|
2610
|
+
}
|
|
2611
|
+
]
|
|
2612
|
+
};
|
|
2613
|
+
};
|
|
2614
|
+
function equals$1(existing, incoming) {
|
|
2615
|
+
const existing_id = existing.id;
|
|
2616
|
+
const incoming_id = incoming.id;
|
|
2617
|
+
if (!(existing_id === incoming_id)) {
|
|
2618
|
+
return false;
|
|
2619
|
+
}
|
|
2620
|
+
const existing_name = existing.name;
|
|
2621
|
+
const incoming_name = incoming.name;
|
|
2622
|
+
if (!(existing_name === incoming_name)) {
|
|
2623
|
+
return false;
|
|
2624
|
+
}
|
|
2625
|
+
return true;
|
|
2626
|
+
}
|
|
2627
|
+
const ingest$1 = function TemplateConfigurationRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2628
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2629
|
+
const validateError = validate$1(input);
|
|
2630
|
+
if (validateError !== null) {
|
|
2631
|
+
throw validateError;
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
const key = keyBuilderFromType(luvio, input);
|
|
2635
|
+
const ttlToUse = TTL$1;
|
|
2636
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "AppFramework", VERSION$1, RepresentationType$1, equals$1);
|
|
2637
|
+
return createLink(key);
|
|
2638
|
+
};
|
|
2639
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
2640
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2641
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
2642
|
+
rootKeySet.set(rootKey, {
|
|
2643
|
+
namespace: keyPrefix,
|
|
2644
|
+
representationName: RepresentationType$1,
|
|
2645
|
+
mergeable: false
|
|
2646
|
+
});
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
function select$2(luvio, params) {
|
|
2650
|
+
return select$3();
|
|
2651
|
+
}
|
|
2652
|
+
function keyBuilder$3(luvio, params) {
|
|
2653
|
+
return keyBuilder$4(luvio, {
|
|
2654
|
+
id: params.urlParams.templateIdOrApiName
|
|
2655
|
+
});
|
|
2656
|
+
}
|
|
2657
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
2658
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
2659
|
+
}
|
|
2660
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
2661
|
+
const { body } = response;
|
|
2662
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
2663
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2664
|
+
const snapshot = luvio.storeLookup({
|
|
2665
|
+
recordId: key,
|
|
2666
|
+
node: select$2(),
|
|
2667
|
+
variables: {},
|
|
2668
|
+
}, snapshotRefresh);
|
|
2669
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2670
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2671
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
deepFreeze(snapshot.data);
|
|
2675
|
+
return snapshot;
|
|
2676
|
+
}
|
|
2677
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
2678
|
+
const key = keyBuilder$3(luvio, params);
|
|
2679
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2680
|
+
const storeMetadataParams = {
|
|
2681
|
+
ttl: TTL$1,
|
|
2682
|
+
namespace: keyPrefix,
|
|
2683
|
+
version: VERSION$1,
|
|
2684
|
+
representationName: RepresentationType$1
|
|
2685
|
+
};
|
|
2686
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2687
|
+
return errorSnapshot;
|
|
2688
|
+
}
|
|
2689
|
+
function createResourceRequest$1(config) {
|
|
2690
|
+
const headers = {};
|
|
2691
|
+
return {
|
|
2692
|
+
baseUri: '/services/data/v62.0',
|
|
2693
|
+
basePath: '/app-framework/templates/' + config.urlParams.templateIdOrApiName + '/configuration',
|
|
2694
|
+
method: 'get',
|
|
2695
|
+
body: null,
|
|
2696
|
+
urlParams: config.urlParams,
|
|
2697
|
+
queryParams: {},
|
|
2698
|
+
headers,
|
|
2699
|
+
priority: 'normal',
|
|
2700
|
+
};
|
|
2701
|
+
}
|
|
2702
|
+
function createResourceRequestFromRepresentation(representation) {
|
|
2703
|
+
const config = {
|
|
2704
|
+
urlParams: {},
|
|
2705
|
+
};
|
|
2706
|
+
config.urlParams.templateIdOrApiName = representation.id;
|
|
2707
|
+
return createResourceRequest$1(config);
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2710
|
+
const adapterName$1 = 'getTemplateConfig';
|
|
2711
|
+
const getTemplateConfig_ConfigPropertyMetadata = [
|
|
2712
|
+
generateParamConfigMetadata('templateIdOrApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2713
|
+
];
|
|
2714
|
+
const getTemplateConfig_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getTemplateConfig_ConfigPropertyMetadata);
|
|
2715
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$8(getTemplateConfig_ConfigPropertyMetadata);
|
|
2716
|
+
function keyBuilder$2(luvio, config) {
|
|
2717
|
+
const resourceParams = createResourceParams$1(config);
|
|
2718
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
2719
|
+
}
|
|
2720
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
2721
|
+
const config = {};
|
|
2722
|
+
typeCheckConfig$8(untrustedConfig, config, getTemplateConfig_ConfigPropertyMetadata);
|
|
2723
|
+
return config;
|
|
2724
|
+
}
|
|
2725
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
2726
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2727
|
+
return null;
|
|
2728
|
+
}
|
|
2729
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2730
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2731
|
+
}
|
|
2732
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
2733
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2734
|
+
return null;
|
|
2735
|
+
}
|
|
2736
|
+
return config;
|
|
2737
|
+
}
|
|
2738
|
+
function adapterFragment$1(luvio, config) {
|
|
2739
|
+
createResourceParams$1(config);
|
|
2740
|
+
return select$2();
|
|
2741
|
+
}
|
|
2742
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
2743
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
2744
|
+
config,
|
|
2745
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2746
|
+
});
|
|
2747
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2748
|
+
}
|
|
2749
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
2750
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
2751
|
+
config,
|
|
2752
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2753
|
+
});
|
|
2754
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2755
|
+
}
|
|
2756
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
2757
|
+
const resourceParams = createResourceParams$1(config);
|
|
2758
|
+
const request = createResourceRequest$1(resourceParams);
|
|
2759
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2760
|
+
.then((response) => {
|
|
2761
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
2762
|
+
const cache = new StoreKeyMap();
|
|
2763
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
2764
|
+
return cache;
|
|
2765
|
+
});
|
|
2766
|
+
}, (response) => {
|
|
2767
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2771
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
2772
|
+
}
|
|
2773
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2774
|
+
const { luvio, config } = context;
|
|
2775
|
+
const selector = {
|
|
2776
|
+
recordId: keyBuilder$2(luvio, config),
|
|
2777
|
+
node: adapterFragment$1(luvio, config),
|
|
2778
|
+
variables: {},
|
|
2779
|
+
};
|
|
2780
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2781
|
+
config,
|
|
2782
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2783
|
+
});
|
|
2784
|
+
return cacheSnapshot;
|
|
2785
|
+
}
|
|
2786
|
+
const getTemplateConfigAdapterFactory = (luvio) => function AppFramework__getTemplateConfig(untrustedConfig, requestContext) {
|
|
2787
|
+
const config = validateAdapterConfig$1(untrustedConfig, getTemplateConfig_ConfigPropertyNames);
|
|
2788
|
+
// Invalid or incomplete config
|
|
2789
|
+
if (config === null) {
|
|
2790
|
+
return null;
|
|
2791
|
+
}
|
|
2792
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2793
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
2794
|
+
};
|
|
2795
|
+
const notifyChangeFactory = (luvio, options) => {
|
|
2796
|
+
return function getAppFrameworkTemplatesConfigurationByTemplateIdOrApiNameNotifyChange(configs) {
|
|
2797
|
+
const keys = configs.map(c => keyBuilder$4(luvio, c));
|
|
2798
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
2799
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
2800
|
+
const { key, record: val } = entries[i];
|
|
2801
|
+
const refreshRequest = createResourceRequestFromRepresentation(val);
|
|
2802
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
2803
|
+
.then((response) => {
|
|
2804
|
+
return luvio.handleSuccessResponse(() => {
|
|
2805
|
+
const { body } = response;
|
|
2806
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2807
|
+
return luvio.storeBroadcast();
|
|
2808
|
+
}, () => {
|
|
2809
|
+
const cache = new StoreKeyMap();
|
|
2810
|
+
getTypeCacheKeys$1(cache, luvio, response.body);
|
|
2811
|
+
return cache;
|
|
2812
|
+
});
|
|
2813
|
+
}, (error) => {
|
|
2814
|
+
return luvio.handleErrorResponse(() => {
|
|
2815
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
2816
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
2817
|
+
ttl: TTL$1,
|
|
2818
|
+
namespace: keyPrefix,
|
|
2819
|
+
version: VERSION$1,
|
|
2820
|
+
representationName: RepresentationType$1
|
|
2821
|
+
});
|
|
2822
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
2823
|
+
});
|
|
2824
|
+
});
|
|
2825
|
+
}
|
|
2826
|
+
});
|
|
2827
|
+
};
|
|
2828
|
+
};
|
|
2829
|
+
|
|
2830
|
+
const TTL = 5000;
|
|
2831
|
+
const VERSION = "4d3fc84707ae344f06fb99bd22e68f46";
|
|
2832
|
+
function validate(obj, path = 'TemplateCollectionRepresentation') {
|
|
2833
|
+
const v_error = (() => {
|
|
2834
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2835
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2836
|
+
}
|
|
2837
|
+
const obj_templates = obj.templates;
|
|
2838
|
+
const path_templates = path + '.templates';
|
|
2839
|
+
if (!ArrayIsArray(obj_templates)) {
|
|
2840
|
+
return new TypeError('Expected "array" but received "' + typeof obj_templates + '" (at "' + path_templates + '")');
|
|
2841
|
+
}
|
|
2842
|
+
for (let i = 0; i < obj_templates.length; i++) {
|
|
2843
|
+
const obj_templates_item = obj_templates[i];
|
|
2844
|
+
const path_templates_item = path_templates + '[' + i + ']';
|
|
2845
|
+
if (typeof obj_templates_item !== 'object') {
|
|
2846
|
+
return new TypeError('Expected "object" but received "' + typeof obj_templates_item + '" (at "' + path_templates_item + '")');
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
})();
|
|
2850
|
+
return v_error === undefined ? null : v_error;
|
|
2851
|
+
}
|
|
2852
|
+
const RepresentationType = 'TemplateCollectionRepresentation';
|
|
2853
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
2854
|
+
const input_templates = input.templates;
|
|
2855
|
+
const input_templates_id = path.fullPath + '__templates';
|
|
2856
|
+
for (let i = 0; i < input_templates.length; i++) {
|
|
2857
|
+
const input_templates_item = input_templates[i];
|
|
2858
|
+
let input_templates_item_id = input_templates_id + '__' + i;
|
|
2859
|
+
input_templates[i] = ingest$2(input_templates_item, {
|
|
2860
|
+
fullPath: input_templates_item_id,
|
|
2861
|
+
propertyName: i,
|
|
2862
|
+
parent: {
|
|
2863
|
+
data: input,
|
|
2864
|
+
key: path.fullPath,
|
|
2865
|
+
existing: existing,
|
|
2866
|
+
},
|
|
2867
|
+
ttl: path.ttl
|
|
2868
|
+
}, luvio, store, timestamp);
|
|
2869
|
+
}
|
|
2870
|
+
return input;
|
|
2871
|
+
}
|
|
2872
|
+
const select$1 = function TemplateCollectionRepresentationSelect() {
|
|
2873
|
+
return {
|
|
2874
|
+
kind: 'Fragment',
|
|
2875
|
+
version: VERSION,
|
|
2876
|
+
private: [],
|
|
2877
|
+
selections: [
|
|
2878
|
+
{
|
|
2879
|
+
name: 'templates',
|
|
2880
|
+
kind: 'Link',
|
|
2881
|
+
plural: true,
|
|
2882
|
+
fragment: select$5()
|
|
2883
|
+
}
|
|
2884
|
+
]
|
|
2885
|
+
};
|
|
2886
|
+
};
|
|
2887
|
+
function equals(existing, incoming) {
|
|
2888
|
+
const existing_templates = existing.templates;
|
|
2889
|
+
const incoming_templates = incoming.templates;
|
|
2890
|
+
const equals_templates_items = equalsArray(existing_templates, incoming_templates, (existing_templates_item, incoming_templates_item) => {
|
|
2891
|
+
if (!(existing_templates_item.__ref === incoming_templates_item.__ref)) {
|
|
2892
|
+
return false;
|
|
2893
|
+
}
|
|
2894
|
+
});
|
|
2895
|
+
if (equals_templates_items === false) {
|
|
2896
|
+
return false;
|
|
2897
|
+
}
|
|
2898
|
+
return true;
|
|
2899
|
+
}
|
|
2900
|
+
const ingest = function TemplateCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2901
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2902
|
+
const validateError = validate(input);
|
|
2903
|
+
if (validateError !== null) {
|
|
2904
|
+
throw validateError;
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
const key = path.fullPath;
|
|
2908
|
+
const ttlToUse = TTL;
|
|
2909
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "AppFramework", VERSION, RepresentationType, equals);
|
|
2910
|
+
return createLink(key);
|
|
2911
|
+
};
|
|
2912
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
2913
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2914
|
+
const rootKey = fullPathFactory();
|
|
2915
|
+
rootKeySet.set(rootKey, {
|
|
2916
|
+
namespace: keyPrefix,
|
|
2917
|
+
representationName: RepresentationType,
|
|
2918
|
+
mergeable: false
|
|
2919
|
+
});
|
|
2920
|
+
const input_templates_length = input.templates.length;
|
|
2921
|
+
for (let i = 0; i < input_templates_length; i++) {
|
|
2922
|
+
getTypeCacheKeys$2(rootKeySet, luvio, input.templates[i]);
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
function select(luvio, params) {
|
|
2927
|
+
return select$1();
|
|
2928
|
+
}
|
|
2929
|
+
function keyBuilder$1(luvio, params) {
|
|
2930
|
+
return keyPrefix + '::TemplateCollectionRepresentation:(' + ')';
|
|
2931
|
+
}
|
|
2932
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
2933
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1());
|
|
2934
|
+
}
|
|
2935
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
2936
|
+
const { body } = response;
|
|
2937
|
+
const key = keyBuilder$1();
|
|
2938
|
+
luvio.storeIngest(key, ingest, body);
|
|
2939
|
+
const snapshot = luvio.storeLookup({
|
|
2940
|
+
recordId: key,
|
|
2941
|
+
node: select(),
|
|
2942
|
+
variables: {},
|
|
2943
|
+
}, snapshotRefresh);
|
|
2944
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2945
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2946
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
deepFreeze(snapshot.data);
|
|
2950
|
+
return snapshot;
|
|
2951
|
+
}
|
|
2952
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2953
|
+
const key = keyBuilder$1();
|
|
2954
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2955
|
+
const storeMetadataParams = {
|
|
2956
|
+
ttl: TTL,
|
|
2957
|
+
namespace: keyPrefix,
|
|
2958
|
+
version: VERSION,
|
|
2959
|
+
representationName: RepresentationType
|
|
2960
|
+
};
|
|
2961
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2962
|
+
return errorSnapshot;
|
|
2963
|
+
}
|
|
2964
|
+
function createResourceRequest(config) {
|
|
2965
|
+
const headers = {};
|
|
2966
|
+
return {
|
|
2967
|
+
baseUri: '/services/data/v62.0',
|
|
2968
|
+
basePath: '/app-framework/templates',
|
|
2969
|
+
method: 'get',
|
|
2970
|
+
body: null,
|
|
2971
|
+
urlParams: {},
|
|
2972
|
+
queryParams: {},
|
|
2973
|
+
headers,
|
|
2974
|
+
priority: 'normal',
|
|
2975
|
+
};
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
const adapterName = 'getTemplates';
|
|
2979
|
+
const getTemplates_ConfigPropertyMetadata = [];
|
|
2980
|
+
const getTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getTemplates_ConfigPropertyMetadata);
|
|
2981
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$8(getTemplates_ConfigPropertyMetadata);
|
|
2982
|
+
function keyBuilder(luvio, config) {
|
|
2983
|
+
createResourceParams(config);
|
|
2984
|
+
return keyBuilder$1();
|
|
2985
|
+
}
|
|
2986
|
+
function typeCheckConfig(untrustedConfig) {
|
|
2987
|
+
const config = {};
|
|
2988
|
+
return config;
|
|
2989
|
+
}
|
|
2990
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
2991
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2992
|
+
return null;
|
|
2993
|
+
}
|
|
2994
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2995
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2996
|
+
}
|
|
2997
|
+
const config = typeCheckConfig();
|
|
2998
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2999
|
+
return null;
|
|
3000
|
+
}
|
|
3001
|
+
return config;
|
|
3002
|
+
}
|
|
3003
|
+
function adapterFragment(luvio, config) {
|
|
3004
|
+
createResourceParams(config);
|
|
3005
|
+
return select();
|
|
3006
|
+
}
|
|
3007
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
3008
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
3009
|
+
config,
|
|
3010
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
3011
|
+
});
|
|
3012
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3013
|
+
}
|
|
3014
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
3015
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
3016
|
+
config,
|
|
3017
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
3018
|
+
});
|
|
3019
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3020
|
+
}
|
|
3021
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
3022
|
+
const resourceParams = createResourceParams(config);
|
|
3023
|
+
const request = createResourceRequest();
|
|
3024
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3025
|
+
.then((response) => {
|
|
3026
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
3027
|
+
const cache = new StoreKeyMap();
|
|
3028
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
3029
|
+
return cache;
|
|
3030
|
+
});
|
|
3031
|
+
}, (response) => {
|
|
3032
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
3033
|
+
});
|
|
3034
|
+
}
|
|
3035
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
3036
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
3037
|
+
}
|
|
3038
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
3039
|
+
const { luvio, config } = context;
|
|
3040
|
+
const selector = {
|
|
3041
|
+
recordId: keyBuilder(luvio, config),
|
|
3042
|
+
node: adapterFragment(luvio, config),
|
|
3043
|
+
variables: {},
|
|
3044
|
+
};
|
|
3045
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3046
|
+
config,
|
|
3047
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
3048
|
+
});
|
|
3049
|
+
return cacheSnapshot;
|
|
3050
|
+
}
|
|
3051
|
+
const getTemplatesAdapterFactory = (luvio) => function AppFramework__getTemplates(untrustedConfig, requestContext) {
|
|
3052
|
+
const config = validateAdapterConfig(untrustedConfig, getTemplates_ConfigPropertyNames);
|
|
3053
|
+
// Invalid or incomplete config
|
|
3054
|
+
if (config === null) {
|
|
3055
|
+
return null;
|
|
3056
|
+
}
|
|
3057
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3058
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
3059
|
+
};
|
|
3060
|
+
|
|
3061
|
+
let createApp;
|
|
3062
|
+
let deleteApp;
|
|
3063
|
+
let getApp;
|
|
3064
|
+
let getAppAssets;
|
|
3065
|
+
let getAppAssetsNotifyChange;
|
|
3066
|
+
let getAppNotifyChange;
|
|
3067
|
+
let getApps;
|
|
3068
|
+
let getTemplate;
|
|
3069
|
+
let getTemplateConfig;
|
|
3070
|
+
let getTemplateConfigNotifyChange;
|
|
3071
|
+
let getTemplateNotifyChange;
|
|
3072
|
+
let getTemplates;
|
|
3073
|
+
// Imperative GET Adapters
|
|
3074
|
+
let getApp_imperative;
|
|
3075
|
+
let getAppAssets_imperative;
|
|
3076
|
+
let getApps_imperative;
|
|
3077
|
+
let getTemplate_imperative;
|
|
3078
|
+
let getTemplateConfig_imperative;
|
|
3079
|
+
let getTemplates_imperative;
|
|
3080
|
+
const getAppMetadata = { apiFamily: 'AppFramework', name: 'getApp', ttl: 5000 };
|
|
3081
|
+
const getAppAssetsMetadata = { apiFamily: 'AppFramework', name: 'getAppAssets', ttl: 5000 };
|
|
3082
|
+
const getAppsMetadata = { apiFamily: 'AppFramework', name: 'getApps', ttl: 5000 };
|
|
3083
|
+
const getTemplateMetadata = { apiFamily: 'AppFramework', name: 'getTemplate', ttl: 5000 };
|
|
3084
|
+
const getTemplateConfigMetadata = {
|
|
3085
|
+
apiFamily: 'AppFramework',
|
|
3086
|
+
name: 'getTemplateConfig',
|
|
3087
|
+
ttl: 5000,
|
|
3088
|
+
};
|
|
3089
|
+
const getTemplatesMetadata = { apiFamily: 'AppFramework', name: 'getTemplates', ttl: 5000 };
|
|
3090
|
+
// Notify Update Available
|
|
3091
|
+
function bindExportsTo(luvio) {
|
|
3092
|
+
// LDS Adapters
|
|
3093
|
+
const getApp_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getApp', getAppAdapterFactory), getAppMetadata);
|
|
3094
|
+
const getAppAssets_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getAppAssets', getAppAssetsAdapterFactory), getAppAssetsMetadata);
|
|
3095
|
+
const getApps_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getApps', getAppsAdapterFactory), getAppsMetadata);
|
|
3096
|
+
const getTemplate_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getTemplate', getTemplateAdapterFactory), getTemplateMetadata);
|
|
3097
|
+
const getTemplateConfig_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getTemplateConfig', getTemplateConfigAdapterFactory), getTemplateConfigMetadata);
|
|
3098
|
+
const getTemplates_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getTemplates', getTemplatesAdapterFactory), getTemplatesMetadata);
|
|
3099
|
+
function unwrapSnapshotData(factory) {
|
|
3100
|
+
const adapter = factory(luvio);
|
|
3101
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
3102
|
+
}
|
|
3103
|
+
return {
|
|
3104
|
+
createApp: unwrapSnapshotData(createAppAdapterFactory),
|
|
3105
|
+
deleteApp: createLDSAdapter(luvio, adapterName$6, deleteAppAdapterFactory),
|
|
3106
|
+
getApp: createWireAdapterConstructor(luvio, getApp_ldsAdapter, getAppMetadata),
|
|
3107
|
+
getAppAssets: createWireAdapterConstructor(luvio, getAppAssets_ldsAdapter, getAppAssetsMetadata),
|
|
3108
|
+
getAppAssetsNotifyChange: createLDSAdapter(luvio, 'getAppAssetsNotifyChange', notifyChangeFactory$2),
|
|
3109
|
+
getAppNotifyChange: createLDSAdapter(luvio, 'getAppNotifyChange', notifyChangeFactory$3),
|
|
3110
|
+
getApps: createWireAdapterConstructor(luvio, getApps_ldsAdapter, getAppsMetadata),
|
|
3111
|
+
getTemplate: createWireAdapterConstructor(luvio, getTemplate_ldsAdapter, getTemplateMetadata),
|
|
3112
|
+
getTemplateConfig: createWireAdapterConstructor(luvio, getTemplateConfig_ldsAdapter, getTemplateConfigMetadata),
|
|
3113
|
+
getTemplateConfigNotifyChange: createLDSAdapter(luvio, 'getTemplateConfigNotifyChange', notifyChangeFactory),
|
|
3114
|
+
getTemplateNotifyChange: createLDSAdapter(luvio, 'getTemplateNotifyChange', notifyChangeFactory$1),
|
|
3115
|
+
getTemplates: createWireAdapterConstructor(luvio, getTemplates_ldsAdapter, getTemplatesMetadata),
|
|
3116
|
+
// Imperative GET Adapters
|
|
3117
|
+
getApp_imperative: createImperativeAdapter(luvio, getApp_ldsAdapter, getAppMetadata),
|
|
3118
|
+
getAppAssets_imperative: createImperativeAdapter(luvio, getAppAssets_ldsAdapter, getAppAssetsMetadata),
|
|
3119
|
+
getApps_imperative: createImperativeAdapter(luvio, getApps_ldsAdapter, getAppsMetadata),
|
|
3120
|
+
getTemplate_imperative: createImperativeAdapter(luvio, getTemplate_ldsAdapter, getTemplateMetadata),
|
|
3121
|
+
getTemplateConfig_imperative: createImperativeAdapter(luvio, getTemplateConfig_ldsAdapter, getTemplateConfigMetadata),
|
|
3122
|
+
getTemplates_imperative: createImperativeAdapter(luvio, getTemplates_ldsAdapter, getTemplatesMetadata),
|
|
3123
|
+
// Notify Update Availables
|
|
3124
|
+
};
|
|
3125
|
+
}
|
|
3126
|
+
withDefaultLuvio((luvio) => {
|
|
3127
|
+
({
|
|
3128
|
+
createApp,
|
|
3129
|
+
deleteApp,
|
|
3130
|
+
getApp,
|
|
3131
|
+
getAppAssets,
|
|
3132
|
+
getAppAssetsNotifyChange,
|
|
3133
|
+
getAppNotifyChange,
|
|
3134
|
+
getApps,
|
|
3135
|
+
getTemplate,
|
|
3136
|
+
getTemplateConfig,
|
|
3137
|
+
getTemplateConfigNotifyChange,
|
|
3138
|
+
getTemplateNotifyChange,
|
|
3139
|
+
getTemplates,
|
|
3140
|
+
getApp_imperative,
|
|
3141
|
+
getAppAssets_imperative,
|
|
3142
|
+
getApps_imperative,
|
|
3143
|
+
getTemplate_imperative,
|
|
3144
|
+
getTemplateConfig_imperative,
|
|
3145
|
+
getTemplates_imperative,
|
|
3146
|
+
} = bindExportsTo(luvio));
|
|
3147
|
+
});
|
|
3148
|
+
|
|
3149
|
+
export { createApp, deleteApp, getApp, getAppAssets, getAppAssetsNotifyChange, getAppAssets_imperative, getAppNotifyChange, getApp_imperative, getApps, getApps_imperative, getTemplate, getTemplateConfig, getTemplateConfigNotifyChange, getTemplateConfig_imperative, getTemplateNotifyChange, getTemplate_imperative, getTemplates, getTemplates_imperative };
|
|
3150
|
+
// version: 1.303.0-b6ed223d95
|