@salesforce/lds-adapters-industries-timeline 1.100.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-timeline.js +1631 -0
  3. package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
  4. package/dist/types/src/generated/adapters/getTimelineData.d.ts +32 -0
  5. package/dist/types/src/generated/adapters/getTimelineMetadata.d.ts +26 -0
  6. package/dist/types/src/generated/artifacts/main.d.ts +2 -0
  7. package/dist/types/src/generated/artifacts/sfdc.d.ts +5 -0
  8. package/dist/types/src/generated/resources/getConnectTimelineMetadataConfigurations.d.ts +15 -0
  9. package/dist/types/src/generated/resources/getConnectTimelineTimelineDefinitionsEventsByTimelineConfigFullNameAndTimelineObjRecordId.d.ts +23 -0
  10. package/dist/types/src/generated/types/TimelineDataGetResultRepresentation.d.ts +45 -0
  11. package/dist/types/src/generated/types/TimelineElementRepresentation.d.ts +35 -0
  12. package/dist/types/src/generated/types/TimelineEntityRepresentation.d.ts +44 -0
  13. package/dist/types/src/generated/types/TimelineErrorRepresentation.d.ts +32 -0
  14. package/dist/types/src/generated/types/TimelineEventFieldRepresentation.d.ts +32 -0
  15. package/dist/types/src/generated/types/TimelineEventRepresentation.d.ts +45 -0
  16. package/dist/types/src/generated/types/TimelineEventTypeMetadataRepresentation.d.ts +50 -0
  17. package/dist/types/src/generated/types/TimelineEventTypeRepresentation.d.ts +32 -0
  18. package/dist/types/src/generated/types/TimelineMetadataDefinitionRepresentation.d.ts +42 -0
  19. package/dist/types/src/generated/types/TimelineMetadataResultRepresentation.d.ts +38 -0
  20. package/dist/types/src/generated/types/type-utils.d.ts +39 -0
  21. package/dist/umd/es2018/industries-timeline.js +1640 -0
  22. package/dist/umd/es5/industries-timeline.js +1650 -0
  23. package/package.json +67 -0
  24. package/sfdc/index.d.ts +1 -0
  25. package/sfdc/index.js +1671 -0
  26. package/src/raml/api.raml +284 -0
  27. package/src/raml/luvio.raml +109 -0
@@ -0,0 +1,1650 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ (function (global, factory) {
8
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
9
+ typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.industriesTimeline = {}, global.engine));
11
+ })(this, (function (exports, engine) { 'use strict';
12
+
13
+ var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
14
+ var ObjectKeys = Object.keys;
15
+ var ArrayIsArray$1 = Array.isArray;
16
+ /**
17
+ * Validates an adapter config is well-formed.
18
+ * @param config The config to validate.
19
+ * @param adapter The adapter validation configuration.
20
+ * @param oneOf The keys the config must contain at least one of.
21
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
22
+ */
23
+ function validateConfig(config, adapter, oneOf) {
24
+ var displayName = adapter.displayName;
25
+ var _a = adapter.parameters, required = _a.required, optional = _a.optional, unsupported = _a.unsupported;
26
+ if (config === undefined ||
27
+ required.every(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
28
+ throw new TypeError("adapter ".concat(displayName, " configuration must specify ").concat(required.sort().join(', ')));
29
+ }
30
+ if (oneOf && oneOf.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
31
+ throw new TypeError("adapter ".concat(displayName, " configuration must specify one of ").concat(oneOf.sort().join(', ')));
32
+ }
33
+ if (unsupported !== undefined &&
34
+ unsupported.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); })) {
35
+ throw new TypeError("adapter ".concat(displayName, " does not yet support ").concat(unsupported.sort().join(', ')));
36
+ }
37
+ var supported = required.concat(optional);
38
+ if (ObjectKeys(config).some(function (key) { return !supported.includes(key); })) {
39
+ throw new TypeError("adapter ".concat(displayName, " configuration supports only ").concat(supported.sort().join(', ')));
40
+ }
41
+ }
42
+ function untrustedIsObject(untrusted) {
43
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
44
+ }
45
+ function areRequiredParametersPresent(config, configPropertyNames) {
46
+ return configPropertyNames.parameters.required.every(function (req) { return req in config; });
47
+ }
48
+ var snapshotRefreshOptions = {
49
+ overrides: {
50
+ headers: {
51
+ 'Cache-Control': 'no-cache',
52
+ },
53
+ }
54
+ };
55
+ var keyPrefix = 'Timeline';
56
+
57
+ var ObjectFreeze = Object.freeze;
58
+ var ArrayIsArray = Array.isArray;
59
+ var JSONStringify = JSON.stringify;
60
+ function createLink(ref) {
61
+ return {
62
+ __ref: engine.serializeStructuredKey(ref),
63
+ };
64
+ }
65
+
66
+ function validate$9(obj, path) {
67
+ if (path === void 0) { path = 'TimelineErrorRepresentation'; }
68
+ var v_error = (function () {
69
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
70
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
71
+ }
72
+ var obj_code = obj.code;
73
+ var path_code = path + '.code';
74
+ var obj_code_union0 = null;
75
+ var obj_code_union0_error = (function () {
76
+ if (typeof obj_code !== 'string') {
77
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
78
+ }
79
+ })();
80
+ if (obj_code_union0_error != null) {
81
+ obj_code_union0 = obj_code_union0_error.message;
82
+ }
83
+ var obj_code_union1 = null;
84
+ var obj_code_union1_error = (function () {
85
+ if (obj_code !== null) {
86
+ return new TypeError('Expected "null" but received "' + typeof obj_code + '" (at "' + path_code + '")');
87
+ }
88
+ })();
89
+ if (obj_code_union1_error != null) {
90
+ obj_code_union1 = obj_code_union1_error.message;
91
+ }
92
+ if (obj_code_union0 && obj_code_union1) {
93
+ var message = 'Object doesn\'t match union (at "' + path_code + '")';
94
+ message += '\n' + obj_code_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
95
+ message += '\n' + obj_code_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
96
+ return new TypeError(message);
97
+ }
98
+ var obj_message = obj.message;
99
+ var path_message = path + '.message';
100
+ var obj_message_union0 = null;
101
+ var obj_message_union0_error = (function () {
102
+ if (typeof obj_message !== 'string') {
103
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
104
+ }
105
+ })();
106
+ if (obj_message_union0_error != null) {
107
+ obj_message_union0 = obj_message_union0_error.message;
108
+ }
109
+ var obj_message_union1 = null;
110
+ var obj_message_union1_error = (function () {
111
+ if (obj_message !== null) {
112
+ return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
113
+ }
114
+ })();
115
+ if (obj_message_union1_error != null) {
116
+ obj_message_union1 = obj_message_union1_error.message;
117
+ }
118
+ if (obj_message_union0 && obj_message_union1) {
119
+ var message = 'Object doesn\'t match union (at "' + path_message + '")';
120
+ message += '\n' + obj_message_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
121
+ message += '\n' + obj_message_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
122
+ return new TypeError(message);
123
+ }
124
+ })();
125
+ return v_error === undefined ? null : v_error;
126
+ }
127
+ function deepFreeze$9(input) {
128
+ ObjectFreeze(input);
129
+ }
130
+
131
+ function validate$8(obj, path) {
132
+ if (path === void 0) { path = 'TimelineEventTypeRepresentation'; }
133
+ var v_error = (function () {
134
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
135
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
136
+ }
137
+ var obj_eventApiName = obj.eventApiName;
138
+ var path_eventApiName = path + '.eventApiName';
139
+ var obj_eventApiName_union0 = null;
140
+ var obj_eventApiName_union0_error = (function () {
141
+ if (typeof obj_eventApiName !== 'string') {
142
+ return new TypeError('Expected "string" but received "' + typeof obj_eventApiName + '" (at "' + path_eventApiName + '")');
143
+ }
144
+ })();
145
+ if (obj_eventApiName_union0_error != null) {
146
+ obj_eventApiName_union0 = obj_eventApiName_union0_error.message;
147
+ }
148
+ var obj_eventApiName_union1 = null;
149
+ var obj_eventApiName_union1_error = (function () {
150
+ if (obj_eventApiName !== null) {
151
+ return new TypeError('Expected "null" but received "' + typeof obj_eventApiName + '" (at "' + path_eventApiName + '")');
152
+ }
153
+ })();
154
+ if (obj_eventApiName_union1_error != null) {
155
+ obj_eventApiName_union1 = obj_eventApiName_union1_error.message;
156
+ }
157
+ if (obj_eventApiName_union0 && obj_eventApiName_union1) {
158
+ var message = 'Object doesn\'t match union (at "' + path_eventApiName + '")';
159
+ message += '\n' + obj_eventApiName_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
160
+ message += '\n' + obj_eventApiName_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
161
+ return new TypeError(message);
162
+ }
163
+ var obj_offset = obj.offset;
164
+ var path_offset = path + '.offset';
165
+ var obj_offset_union0 = null;
166
+ var obj_offset_union0_error = (function () {
167
+ if (typeof obj_offset !== 'number' || (typeof obj_offset === 'number' && Math.floor(obj_offset) !== obj_offset)) {
168
+ return new TypeError('Expected "integer" but received "' + typeof obj_offset + '" (at "' + path_offset + '")');
169
+ }
170
+ })();
171
+ if (obj_offset_union0_error != null) {
172
+ obj_offset_union0 = obj_offset_union0_error.message;
173
+ }
174
+ var obj_offset_union1 = null;
175
+ var obj_offset_union1_error = (function () {
176
+ if (obj_offset !== null) {
177
+ return new TypeError('Expected "null" but received "' + typeof obj_offset + '" (at "' + path_offset + '")');
178
+ }
179
+ })();
180
+ if (obj_offset_union1_error != null) {
181
+ obj_offset_union1 = obj_offset_union1_error.message;
182
+ }
183
+ if (obj_offset_union0 && obj_offset_union1) {
184
+ var message = 'Object doesn\'t match union (at "' + path_offset + '")';
185
+ message += '\n' + obj_offset_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
186
+ message += '\n' + obj_offset_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
187
+ return new TypeError(message);
188
+ }
189
+ })();
190
+ return v_error === undefined ? null : v_error;
191
+ }
192
+ function deepFreeze$8(input) {
193
+ ObjectFreeze(input);
194
+ }
195
+
196
+ function validate$7(obj, path) {
197
+ if (path === void 0) { path = 'TimelineEventFieldRepresentation'; }
198
+ var v_error = (function () {
199
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
200
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
201
+ }
202
+ var obj_name = obj.name;
203
+ var path_name = path + '.name';
204
+ var obj_name_union0 = null;
205
+ var obj_name_union0_error = (function () {
206
+ if (typeof obj_name !== 'string') {
207
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
208
+ }
209
+ })();
210
+ if (obj_name_union0_error != null) {
211
+ obj_name_union0 = obj_name_union0_error.message;
212
+ }
213
+ var obj_name_union1 = null;
214
+ var obj_name_union1_error = (function () {
215
+ if (obj_name !== null) {
216
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
217
+ }
218
+ })();
219
+ if (obj_name_union1_error != null) {
220
+ obj_name_union1 = obj_name_union1_error.message;
221
+ }
222
+ if (obj_name_union0 && obj_name_union1) {
223
+ var message = 'Object doesn\'t match union (at "' + path_name + '")';
224
+ message += '\n' + obj_name_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
225
+ message += '\n' + obj_name_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
226
+ return new TypeError(message);
227
+ }
228
+ var obj_value = obj.value;
229
+ var path_value = path + '.value';
230
+ var obj_value_union0 = null;
231
+ var obj_value_union0_error = (function () {
232
+ if (typeof obj_value !== 'string') {
233
+ return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
234
+ }
235
+ })();
236
+ if (obj_value_union0_error != null) {
237
+ obj_value_union0 = obj_value_union0_error.message;
238
+ }
239
+ var obj_value_union1 = null;
240
+ var obj_value_union1_error = (function () {
241
+ if (obj_value !== null) {
242
+ return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
243
+ }
244
+ })();
245
+ if (obj_value_union1_error != null) {
246
+ obj_value_union1 = obj_value_union1_error.message;
247
+ }
248
+ if (obj_value_union0 && obj_value_union1) {
249
+ var message = 'Object doesn\'t match union (at "' + path_value + '")';
250
+ message += '\n' + obj_value_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
251
+ message += '\n' + obj_value_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
252
+ return new TypeError(message);
253
+ }
254
+ })();
255
+ return v_error === undefined ? null : v_error;
256
+ }
257
+ function deepFreeze$7(input) {
258
+ ObjectFreeze(input);
259
+ }
260
+
261
+ function validate$6(obj, path) {
262
+ if (path === void 0) { path = 'TimelineEventRepresentation'; }
263
+ var v_error = (function () {
264
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
265
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
266
+ }
267
+ var obj_description = obj.description;
268
+ var path_description = path + '.description';
269
+ var obj_description_union0 = null;
270
+ var obj_description_union0_error = (function () {
271
+ if (typeof obj_description !== 'string') {
272
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
273
+ }
274
+ })();
275
+ if (obj_description_union0_error != null) {
276
+ obj_description_union0 = obj_description_union0_error.message;
277
+ }
278
+ var obj_description_union1 = null;
279
+ var obj_description_union1_error = (function () {
280
+ if (obj_description !== null) {
281
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
282
+ }
283
+ })();
284
+ if (obj_description_union1_error != null) {
285
+ obj_description_union1 = obj_description_union1_error.message;
286
+ }
287
+ if (obj_description_union0 && obj_description_union1) {
288
+ var message = 'Object doesn\'t match union (at "' + path_description + '")';
289
+ message += '\n' + obj_description_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
290
+ message += '\n' + obj_description_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
291
+ return new TypeError(message);
292
+ }
293
+ var obj_eventDateTime = obj.eventDateTime;
294
+ var path_eventDateTime = path + '.eventDateTime';
295
+ var obj_eventDateTime_union0 = null;
296
+ var obj_eventDateTime_union0_error = (function () {
297
+ if (typeof obj_eventDateTime !== 'string') {
298
+ return new TypeError('Expected "string" but received "' + typeof obj_eventDateTime + '" (at "' + path_eventDateTime + '")');
299
+ }
300
+ })();
301
+ if (obj_eventDateTime_union0_error != null) {
302
+ obj_eventDateTime_union0 = obj_eventDateTime_union0_error.message;
303
+ }
304
+ var obj_eventDateTime_union1 = null;
305
+ var obj_eventDateTime_union1_error = (function () {
306
+ if (obj_eventDateTime !== null) {
307
+ return new TypeError('Expected "null" but received "' + typeof obj_eventDateTime + '" (at "' + path_eventDateTime + '")');
308
+ }
309
+ })();
310
+ if (obj_eventDateTime_union1_error != null) {
311
+ obj_eventDateTime_union1 = obj_eventDateTime_union1_error.message;
312
+ }
313
+ if (obj_eventDateTime_union0 && obj_eventDateTime_union1) {
314
+ var message = 'Object doesn\'t match union (at "' + path_eventDateTime + '")';
315
+ message += '\n' + obj_eventDateTime_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
316
+ message += '\n' + obj_eventDateTime_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
317
+ return new TypeError(message);
318
+ }
319
+ if (obj.fields !== undefined) {
320
+ var obj_fields = obj.fields;
321
+ var path_fields = path + '.fields';
322
+ if (!ArrayIsArray(obj_fields)) {
323
+ return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
324
+ }
325
+ for (var i = 0; i < obj_fields.length; i++) {
326
+ var obj_fields_item = obj_fields[i];
327
+ var path_fields_item = path_fields + '[' + i + ']';
328
+ var referencepath_fields_itemValidationError = validate$7(obj_fields_item, path_fields_item);
329
+ if (referencepath_fields_itemValidationError !== null) {
330
+ var message = 'Object doesn\'t match TimelineEventFieldRepresentation (at "' + path_fields_item + '")\n';
331
+ message += referencepath_fields_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
332
+ return new TypeError(message);
333
+ }
334
+ }
335
+ }
336
+ var obj_id = obj.id;
337
+ var path_id = path + '.id';
338
+ var obj_id_union0 = null;
339
+ var obj_id_union0_error = (function () {
340
+ if (typeof obj_id !== 'string') {
341
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
342
+ }
343
+ })();
344
+ if (obj_id_union0_error != null) {
345
+ obj_id_union0 = obj_id_union0_error.message;
346
+ }
347
+ var obj_id_union1 = null;
348
+ var obj_id_union1_error = (function () {
349
+ if (obj_id !== null) {
350
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
351
+ }
352
+ })();
353
+ if (obj_id_union1_error != null) {
354
+ obj_id_union1 = obj_id_union1_error.message;
355
+ }
356
+ if (obj_id_union0 && obj_id_union1) {
357
+ var message = 'Object doesn\'t match union (at "' + path_id + '")';
358
+ message += '\n' + obj_id_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
359
+ message += '\n' + obj_id_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
360
+ return new TypeError(message);
361
+ }
362
+ var obj_title = obj.title;
363
+ var path_title = path + '.title';
364
+ var obj_title_union0 = null;
365
+ var obj_title_union0_error = (function () {
366
+ if (typeof obj_title !== 'string') {
367
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
368
+ }
369
+ })();
370
+ if (obj_title_union0_error != null) {
371
+ obj_title_union0 = obj_title_union0_error.message;
372
+ }
373
+ var obj_title_union1 = null;
374
+ var obj_title_union1_error = (function () {
375
+ if (obj_title !== null) {
376
+ return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
377
+ }
378
+ })();
379
+ if (obj_title_union1_error != null) {
380
+ obj_title_union1 = obj_title_union1_error.message;
381
+ }
382
+ if (obj_title_union0 && obj_title_union1) {
383
+ var message = 'Object doesn\'t match union (at "' + path_title + '")';
384
+ message += '\n' + obj_title_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
385
+ message += '\n' + obj_title_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
386
+ return new TypeError(message);
387
+ }
388
+ var obj_type = obj.type;
389
+ var path_type = path + '.type';
390
+ var obj_type_union0 = null;
391
+ var obj_type_union0_error = (function () {
392
+ if (typeof obj_type !== 'string') {
393
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
394
+ }
395
+ })();
396
+ if (obj_type_union0_error != null) {
397
+ obj_type_union0 = obj_type_union0_error.message;
398
+ }
399
+ var obj_type_union1 = null;
400
+ var obj_type_union1_error = (function () {
401
+ if (obj_type !== null) {
402
+ return new TypeError('Expected "null" but received "' + typeof obj_type + '" (at "' + path_type + '")');
403
+ }
404
+ })();
405
+ if (obj_type_union1_error != null) {
406
+ obj_type_union1 = obj_type_union1_error.message;
407
+ }
408
+ if (obj_type_union0 && obj_type_union1) {
409
+ var message = 'Object doesn\'t match union (at "' + path_type + '")';
410
+ message += '\n' + obj_type_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
411
+ message += '\n' + obj_type_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
412
+ return new TypeError(message);
413
+ }
414
+ })();
415
+ return v_error === undefined ? null : v_error;
416
+ }
417
+ function deepFreeze$6(input) {
418
+ var input_fields = input.fields;
419
+ if (input_fields !== undefined) {
420
+ for (var i = 0; i < input_fields.length; i++) {
421
+ var input_fields_item = input_fields[i];
422
+ deepFreeze$7(input_fields_item);
423
+ }
424
+ ObjectFreeze(input_fields);
425
+ }
426
+ ObjectFreeze(input);
427
+ }
428
+
429
+ var TTL$1 = 500;
430
+ var VERSION$1 = "fdc9f6f24a05bf6064b5dd39db6e4e4d";
431
+ function validate$5(obj, path) {
432
+ if (path === void 0) { path = 'TimelineDataGetResultRepresentation'; }
433
+ var v_error = (function () {
434
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
435
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
436
+ }
437
+ if (obj.errors !== undefined) {
438
+ var obj_errors = obj.errors;
439
+ var path_errors = path + '.errors';
440
+ if (!ArrayIsArray(obj_errors)) {
441
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
442
+ }
443
+ for (var i = 0; i < obj_errors.length; i++) {
444
+ var obj_errors_item = obj_errors[i];
445
+ var path_errors_item = path_errors + '[' + i + ']';
446
+ var referencepath_errors_itemValidationError = validate$9(obj_errors_item, path_errors_item);
447
+ if (referencepath_errors_itemValidationError !== null) {
448
+ var message = 'Object doesn\'t match TimelineErrorRepresentation (at "' + path_errors_item + '")\n';
449
+ message += referencepath_errors_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
450
+ return new TypeError(message);
451
+ }
452
+ }
453
+ }
454
+ if (obj.eventTypes !== undefined) {
455
+ var obj_eventTypes = obj.eventTypes;
456
+ var path_eventTypes = path + '.eventTypes';
457
+ if (!ArrayIsArray(obj_eventTypes)) {
458
+ return new TypeError('Expected "array" but received "' + typeof obj_eventTypes + '" (at "' + path_eventTypes + '")');
459
+ }
460
+ for (var i = 0; i < obj_eventTypes.length; i++) {
461
+ var obj_eventTypes_item = obj_eventTypes[i];
462
+ var path_eventTypes_item = path_eventTypes + '[' + i + ']';
463
+ var referencepath_eventTypes_itemValidationError = validate$8(obj_eventTypes_item, path_eventTypes_item);
464
+ if (referencepath_eventTypes_itemValidationError !== null) {
465
+ var message = 'Object doesn\'t match TimelineEventTypeRepresentation (at "' + path_eventTypes_item + '")\n';
466
+ message += referencepath_eventTypes_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
467
+ return new TypeError(message);
468
+ }
469
+ }
470
+ }
471
+ if (obj.events !== undefined) {
472
+ var obj_events = obj.events;
473
+ var path_events = path + '.events';
474
+ if (!ArrayIsArray(obj_events)) {
475
+ return new TypeError('Expected "array" but received "' + typeof obj_events + '" (at "' + path_events + '")');
476
+ }
477
+ for (var i = 0; i < obj_events.length; i++) {
478
+ var obj_events_item = obj_events[i];
479
+ var path_events_item = path_events + '[' + i + ']';
480
+ var referencepath_events_itemValidationError = validate$6(obj_events_item, path_events_item);
481
+ if (referencepath_events_itemValidationError !== null) {
482
+ var message = 'Object doesn\'t match TimelineEventRepresentation (at "' + path_events_item + '")\n';
483
+ message += referencepath_events_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
484
+ return new TypeError(message);
485
+ }
486
+ }
487
+ }
488
+ if (obj.hasMoreData !== undefined) {
489
+ var obj_hasMoreData = obj.hasMoreData;
490
+ var path_hasMoreData = path + '.hasMoreData';
491
+ if (typeof obj_hasMoreData !== 'boolean') {
492
+ return new TypeError('Expected "boolean" but received "' + typeof obj_hasMoreData + '" (at "' + path_hasMoreData + '")');
493
+ }
494
+ }
495
+ if (obj.isSuccess !== undefined) {
496
+ var obj_isSuccess = obj.isSuccess;
497
+ var path_isSuccess = path + '.isSuccess';
498
+ if (typeof obj_isSuccess !== 'boolean') {
499
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
500
+ }
501
+ }
502
+ })();
503
+ return v_error === undefined ? null : v_error;
504
+ }
505
+ var RepresentationType$1 = 'TimelineDataGetResultRepresentation';
506
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
507
+ return input;
508
+ }
509
+ var select$3 = function TimelineDataGetResultRepresentationSelect() {
510
+ return {
511
+ kind: 'Fragment',
512
+ version: VERSION$1,
513
+ private: [],
514
+ opaque: true
515
+ };
516
+ };
517
+ function equals$1(existing, incoming) {
518
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
519
+ return false;
520
+ }
521
+ return true;
522
+ }
523
+ function deepFreeze$5(input) {
524
+ var input_errors = input.errors;
525
+ if (input_errors !== undefined) {
526
+ for (var i = 0; i < input_errors.length; i++) {
527
+ var input_errors_item = input_errors[i];
528
+ deepFreeze$9(input_errors_item);
529
+ }
530
+ ObjectFreeze(input_errors);
531
+ }
532
+ var input_eventTypes = input.eventTypes;
533
+ if (input_eventTypes !== undefined) {
534
+ for (var i = 0; i < input_eventTypes.length; i++) {
535
+ var input_eventTypes_item = input_eventTypes[i];
536
+ deepFreeze$8(input_eventTypes_item);
537
+ }
538
+ ObjectFreeze(input_eventTypes);
539
+ }
540
+ var input_events = input.events;
541
+ if (input_events !== undefined) {
542
+ for (var i = 0; i < input_events.length; i++) {
543
+ var input_events_item = input_events[i];
544
+ deepFreeze$6(input_events_item);
545
+ }
546
+ ObjectFreeze(input_events);
547
+ }
548
+ ObjectFreeze(input);
549
+ }
550
+ var ingest$1 = function TimelineDataGetResultRepresentationIngest(input, path, luvio, store, timestamp) {
551
+ if (process.env.NODE_ENV !== 'production') {
552
+ var validateError = validate$5(input);
553
+ if (validateError !== null) {
554
+ throw validateError;
555
+ }
556
+ }
557
+ var key = path.fullPath;
558
+ var existingRecord = store.readEntry(key);
559
+ var ttlToUse = TTL$1;
560
+ var incomingRecord = normalize$1(input, store.readEntry(key), {
561
+ fullPath: key,
562
+ parent: path.parent,
563
+ propertyName: path.propertyName,
564
+ ttl: ttlToUse
565
+ });
566
+ deepFreeze$5(input);
567
+ if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
568
+ luvio.storePublish(key, incomingRecord);
569
+ }
570
+ {
571
+ var storeMetadataParams = {
572
+ ttl: ttlToUse,
573
+ namespace: "Timeline",
574
+ version: VERSION$1,
575
+ representationName: RepresentationType$1,
576
+ };
577
+ luvio.publishStoreMetadata(key, storeMetadataParams);
578
+ }
579
+ return createLink(key);
580
+ };
581
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
582
+ var rootKeySet = new engine.StoreKeyMap();
583
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
584
+ var rootKey = fullPathFactory();
585
+ rootKeySet.set(rootKey, {
586
+ namespace: keyPrefix,
587
+ representationName: RepresentationType$1,
588
+ mergeable: false
589
+ });
590
+ return rootKeySet;
591
+ }
592
+
593
+ function select$2(luvio, params) {
594
+ return select$3();
595
+ }
596
+ function keyBuilder$3(luvio, params) {
597
+ return keyPrefix + '::TimelineDataGetResultRepresentation:(' + 'direction:' + params.queryParams.direction + ',' + 'endDate:' + params.queryParams.endDate + ',' + 'eventTypeOffsets:' + params.queryParams.eventTypeOffsets + ',' + 'eventTypes:' + params.queryParams.eventTypes + ',' + 'startDate:' + params.queryParams.startDate + ',' + 'timelineConfigFullName:' + params.urlParams.timelineConfigFullName + ',' + 'timelineObjRecordId:' + params.urlParams.timelineObjRecordId + ')';
598
+ }
599
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
600
+ return getTypeCacheKeys$1(luvio, response, function () { return keyBuilder$3(luvio, resourceParams); });
601
+ }
602
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
603
+ var body = response.body;
604
+ var key = keyBuilder$3(luvio, resourceParams);
605
+ luvio.storeIngest(key, ingest$1, body);
606
+ var snapshot = luvio.storeLookup({
607
+ recordId: key,
608
+ node: select$2(),
609
+ variables: {},
610
+ }, snapshotRefresh);
611
+ if (process.env.NODE_ENV !== 'production') {
612
+ if (snapshot.state !== 'Fulfilled') {
613
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
614
+ }
615
+ }
616
+ return snapshot;
617
+ }
618
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
619
+ var key = keyBuilder$3(luvio, params);
620
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
621
+ var storeMetadataParams = {
622
+ ttl: TTL$1,
623
+ namespace: keyPrefix,
624
+ version: VERSION$1,
625
+ representationName: RepresentationType$1
626
+ };
627
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
628
+ return errorSnapshot;
629
+ }
630
+ function createResourceRequest$1(config) {
631
+ var headers = {};
632
+ return {
633
+ baseUri: '/services/data/v58.0',
634
+ basePath: '/connect/timeline/' + config.urlParams.timelineObjRecordId + '/timeline-definitions/' + config.urlParams.timelineConfigFullName + '/events',
635
+ method: 'get',
636
+ body: null,
637
+ urlParams: config.urlParams,
638
+ queryParams: config.queryParams,
639
+ headers: headers,
640
+ priority: 'normal',
641
+ };
642
+ }
643
+
644
+ var getTimelineData_ConfigPropertyNames = {
645
+ displayName: 'getTimelineData',
646
+ parameters: {
647
+ required: ['timelineConfigFullName', 'timelineObjRecordId'],
648
+ optional: ['direction', 'endDate', 'eventTypeOffsets', 'eventTypes', 'startDate']
649
+ }
650
+ };
651
+ function createResourceParams$1(config) {
652
+ var resourceParams = {
653
+ urlParams: {
654
+ timelineConfigFullName: config.timelineConfigFullName, timelineObjRecordId: config.timelineObjRecordId
655
+ },
656
+ queryParams: {
657
+ direction: config.direction, endDate: config.endDate, eventTypeOffsets: config.eventTypeOffsets, eventTypes: config.eventTypes, startDate: config.startDate
658
+ }
659
+ };
660
+ return resourceParams;
661
+ }
662
+ function keyBuilder$2(luvio, config) {
663
+ var resourceParams = createResourceParams$1(config);
664
+ return keyBuilder$3(luvio, resourceParams);
665
+ }
666
+ function typeCheckConfig$1(untrustedConfig) {
667
+ var config = {};
668
+ var untrustedConfig_timelineConfigFullName = untrustedConfig.timelineConfigFullName;
669
+ if (typeof untrustedConfig_timelineConfigFullName === 'string') {
670
+ config.timelineConfigFullName = untrustedConfig_timelineConfigFullName;
671
+ }
672
+ var untrustedConfig_timelineObjRecordId = untrustedConfig.timelineObjRecordId;
673
+ if (typeof untrustedConfig_timelineObjRecordId === 'string') {
674
+ config.timelineObjRecordId = untrustedConfig_timelineObjRecordId;
675
+ }
676
+ var untrustedConfig_direction = untrustedConfig.direction;
677
+ if (typeof untrustedConfig_direction === 'string') {
678
+ config.direction = untrustedConfig_direction;
679
+ }
680
+ var untrustedConfig_endDate = untrustedConfig.endDate;
681
+ if (typeof untrustedConfig_endDate === 'string') {
682
+ config.endDate = untrustedConfig_endDate;
683
+ }
684
+ var untrustedConfig_eventTypeOffsets = untrustedConfig.eventTypeOffsets;
685
+ if (typeof untrustedConfig_eventTypeOffsets === 'string') {
686
+ config.eventTypeOffsets = untrustedConfig_eventTypeOffsets;
687
+ }
688
+ var untrustedConfig_eventTypes = untrustedConfig.eventTypes;
689
+ if (typeof untrustedConfig_eventTypes === 'string') {
690
+ config.eventTypes = untrustedConfig_eventTypes;
691
+ }
692
+ var untrustedConfig_startDate = untrustedConfig.startDate;
693
+ if (typeof untrustedConfig_startDate === 'string') {
694
+ config.startDate = untrustedConfig_startDate;
695
+ }
696
+ return config;
697
+ }
698
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
699
+ if (!untrustedIsObject(untrustedConfig)) {
700
+ return null;
701
+ }
702
+ if (process.env.NODE_ENV !== 'production') {
703
+ validateConfig(untrustedConfig, configPropertyNames);
704
+ }
705
+ var config = typeCheckConfig$1(untrustedConfig);
706
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
707
+ return null;
708
+ }
709
+ return config;
710
+ }
711
+ function adapterFragment$1(luvio, config) {
712
+ createResourceParams$1(config);
713
+ return select$2();
714
+ }
715
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
716
+ var snapshot = ingestSuccess$1(luvio, resourceParams, response, {
717
+ config: config,
718
+ resolve: function () { return buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions); }
719
+ });
720
+ return luvio.storeBroadcast().then(function () { return snapshot; });
721
+ }
722
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
723
+ var snapshot = ingestError$1(luvio, resourceParams, response, {
724
+ config: config,
725
+ resolve: function () { return buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions); }
726
+ });
727
+ return luvio.storeBroadcast().then(function () { return snapshot; });
728
+ }
729
+ function buildNetworkSnapshot$1(luvio, config, options) {
730
+ var resourceParams = createResourceParams$1(config);
731
+ var request = createResourceRequest$1(resourceParams);
732
+ return luvio.dispatchResourceRequest(request, options)
733
+ .then(function (response) {
734
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$1(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$1(luvio, resourceParams, response.body); });
735
+ }, function (response) {
736
+ return luvio.handleErrorResponse(function () { return onFetchResponseError$1(luvio, config, resourceParams, response); });
737
+ });
738
+ }
739
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
740
+ var luvio = context.luvio, config = context.config;
741
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
742
+ var dispatchOptions = {
743
+ resourceRequestContext: {
744
+ requestCorrelator: requestCorrelator,
745
+ luvioRequestMethod: undefined,
746
+ },
747
+ eventObservers: eventObservers
748
+ };
749
+ if (networkPriority !== 'normal') {
750
+ dispatchOptions.overrides = {
751
+ priority: networkPriority
752
+ };
753
+ }
754
+ return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
755
+ }
756
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
757
+ var luvio = context.luvio, config = context.config;
758
+ var selector = {
759
+ recordId: keyBuilder$2(luvio, config),
760
+ node: adapterFragment$1(luvio, config),
761
+ variables: {},
762
+ };
763
+ var cacheSnapshot = storeLookup(selector, {
764
+ config: config,
765
+ resolve: function () { return buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions); }
766
+ });
767
+ return cacheSnapshot;
768
+ }
769
+ var getTimelineDataAdapterFactory = function (luvio) { return function Timeline__getTimelineData(untrustedConfig, requestContext) {
770
+ var config = validateAdapterConfig$1(untrustedConfig, getTimelineData_ConfigPropertyNames);
771
+ // Invalid or incomplete config
772
+ if (config === null) {
773
+ return null;
774
+ }
775
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
776
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
777
+ }; };
778
+
779
+ function validate$4(obj, path) {
780
+ if (path === void 0) { path = 'TimelineEntityRepresentation'; }
781
+ var v_error = (function () {
782
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
783
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
784
+ }
785
+ var obj_ageField = obj.ageField;
786
+ var path_ageField = path + '.ageField';
787
+ var obj_ageField_union0 = null;
788
+ var obj_ageField_union0_error = (function () {
789
+ if (typeof obj_ageField !== 'string') {
790
+ return new TypeError('Expected "string" but received "' + typeof obj_ageField + '" (at "' + path_ageField + '")');
791
+ }
792
+ })();
793
+ if (obj_ageField_union0_error != null) {
794
+ obj_ageField_union0 = obj_ageField_union0_error.message;
795
+ }
796
+ var obj_ageField_union1 = null;
797
+ var obj_ageField_union1_error = (function () {
798
+ if (obj_ageField !== null) {
799
+ return new TypeError('Expected "null" but received "' + typeof obj_ageField + '" (at "' + path_ageField + '")');
800
+ }
801
+ })();
802
+ if (obj_ageField_union1_error != null) {
803
+ obj_ageField_union1 = obj_ageField_union1_error.message;
804
+ }
805
+ if (obj_ageField_union0 && obj_ageField_union1) {
806
+ var message = 'Object doesn\'t match union (at "' + path_ageField + '")';
807
+ message += '\n' + obj_ageField_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
808
+ message += '\n' + obj_ageField_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
809
+ return new TypeError(message);
810
+ }
811
+ var obj_entityLabel = obj.entityLabel;
812
+ var path_entityLabel = path + '.entityLabel';
813
+ var obj_entityLabel_union0 = null;
814
+ var obj_entityLabel_union0_error = (function () {
815
+ if (typeof obj_entityLabel !== 'string') {
816
+ return new TypeError('Expected "string" but received "' + typeof obj_entityLabel + '" (at "' + path_entityLabel + '")');
817
+ }
818
+ })();
819
+ if (obj_entityLabel_union0_error != null) {
820
+ obj_entityLabel_union0 = obj_entityLabel_union0_error.message;
821
+ }
822
+ var obj_entityLabel_union1 = null;
823
+ var obj_entityLabel_union1_error = (function () {
824
+ if (obj_entityLabel !== null) {
825
+ return new TypeError('Expected "null" but received "' + typeof obj_entityLabel + '" (at "' + path_entityLabel + '")');
826
+ }
827
+ })();
828
+ if (obj_entityLabel_union1_error != null) {
829
+ obj_entityLabel_union1 = obj_entityLabel_union1_error.message;
830
+ }
831
+ if (obj_entityLabel_union0 && obj_entityLabel_union1) {
832
+ var message = 'Object doesn\'t match union (at "' + path_entityLabel + '")';
833
+ message += '\n' + obj_entityLabel_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
834
+ message += '\n' + obj_entityLabel_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
835
+ return new TypeError(message);
836
+ }
837
+ var obj_entityName = obj.entityName;
838
+ var path_entityName = path + '.entityName';
839
+ var obj_entityName_union0 = null;
840
+ var obj_entityName_union0_error = (function () {
841
+ if (typeof obj_entityName !== 'string') {
842
+ return new TypeError('Expected "string" but received "' + typeof obj_entityName + '" (at "' + path_entityName + '")');
843
+ }
844
+ })();
845
+ if (obj_entityName_union0_error != null) {
846
+ obj_entityName_union0 = obj_entityName_union0_error.message;
847
+ }
848
+ var obj_entityName_union1 = null;
849
+ var obj_entityName_union1_error = (function () {
850
+ if (obj_entityName !== null) {
851
+ return new TypeError('Expected "null" but received "' + typeof obj_entityName + '" (at "' + path_entityName + '")');
852
+ }
853
+ })();
854
+ if (obj_entityName_union1_error != null) {
855
+ obj_entityName_union1 = obj_entityName_union1_error.message;
856
+ }
857
+ if (obj_entityName_union0 && obj_entityName_union1) {
858
+ var message = 'Object doesn\'t match union (at "' + path_entityName + '")';
859
+ message += '\n' + obj_entityName_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
860
+ message += '\n' + obj_entityName_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
861
+ return new TypeError(message);
862
+ }
863
+ var obj_icon = obj.icon;
864
+ var path_icon = path + '.icon';
865
+ var obj_icon_union0 = null;
866
+ var obj_icon_union0_error = (function () {
867
+ if (typeof obj_icon !== 'string') {
868
+ return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
869
+ }
870
+ })();
871
+ if (obj_icon_union0_error != null) {
872
+ obj_icon_union0 = obj_icon_union0_error.message;
873
+ }
874
+ var obj_icon_union1 = null;
875
+ var obj_icon_union1_error = (function () {
876
+ if (obj_icon !== null) {
877
+ return new TypeError('Expected "null" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
878
+ }
879
+ })();
880
+ if (obj_icon_union1_error != null) {
881
+ obj_icon_union1 = obj_icon_union1_error.message;
882
+ }
883
+ if (obj_icon_union0 && obj_icon_union1) {
884
+ var message = 'Object doesn\'t match union (at "' + path_icon + '")';
885
+ message += '\n' + obj_icon_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
886
+ message += '\n' + obj_icon_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
887
+ return new TypeError(message);
888
+ }
889
+ if (obj.isAgeFieldSelected !== undefined) {
890
+ var obj_isAgeFieldSelected = obj.isAgeFieldSelected;
891
+ var path_isAgeFieldSelected = path + '.isAgeFieldSelected';
892
+ if (typeof obj_isAgeFieldSelected !== 'boolean') {
893
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isAgeFieldSelected + '" (at "' + path_isAgeFieldSelected + '")');
894
+ }
895
+ }
896
+ var obj_source = obj.source;
897
+ var path_source = path + '.source';
898
+ var obj_source_union0 = null;
899
+ var obj_source_union0_error = (function () {
900
+ if (typeof obj_source !== 'string') {
901
+ return new TypeError('Expected "string" but received "' + typeof obj_source + '" (at "' + path_source + '")');
902
+ }
903
+ })();
904
+ if (obj_source_union0_error != null) {
905
+ obj_source_union0 = obj_source_union0_error.message;
906
+ }
907
+ var obj_source_union1 = null;
908
+ var obj_source_union1_error = (function () {
909
+ if (obj_source !== null) {
910
+ return new TypeError('Expected "null" but received "' + typeof obj_source + '" (at "' + path_source + '")');
911
+ }
912
+ })();
913
+ if (obj_source_union1_error != null) {
914
+ obj_source_union1 = obj_source_union1_error.message;
915
+ }
916
+ if (obj_source_union0 && obj_source_union1) {
917
+ var message = 'Object doesn\'t match union (at "' + path_source + '")';
918
+ message += '\n' + obj_source_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
919
+ message += '\n' + obj_source_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
920
+ return new TypeError(message);
921
+ }
922
+ })();
923
+ return v_error === undefined ? null : v_error;
924
+ }
925
+ function deepFreeze$4(input) {
926
+ ObjectFreeze(input);
927
+ }
928
+
929
+ function validate$3(obj, path) {
930
+ if (path === void 0) { path = 'TimelineElementRepresentation'; }
931
+ var v_error = (function () {
932
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
933
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
934
+ }
935
+ var obj_apiName = obj.apiName;
936
+ var path_apiName = path + '.apiName';
937
+ var obj_apiName_union0 = null;
938
+ var obj_apiName_union0_error = (function () {
939
+ if (typeof obj_apiName !== 'string') {
940
+ return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
941
+ }
942
+ })();
943
+ if (obj_apiName_union0_error != null) {
944
+ obj_apiName_union0 = obj_apiName_union0_error.message;
945
+ }
946
+ var obj_apiName_union1 = null;
947
+ var obj_apiName_union1_error = (function () {
948
+ if (obj_apiName !== null) {
949
+ return new TypeError('Expected "null" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
950
+ }
951
+ })();
952
+ if (obj_apiName_union1_error != null) {
953
+ obj_apiName_union1 = obj_apiName_union1_error.message;
954
+ }
955
+ if (obj_apiName_union0 && obj_apiName_union1) {
956
+ var message = 'Object doesn\'t match union (at "' + path_apiName + '")';
957
+ message += '\n' + obj_apiName_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
958
+ message += '\n' + obj_apiName_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
959
+ return new TypeError(message);
960
+ }
961
+ var obj_dataType = obj.dataType;
962
+ var path_dataType = path + '.dataType';
963
+ var obj_dataType_union0 = null;
964
+ var obj_dataType_union0_error = (function () {
965
+ if (typeof obj_dataType !== 'string') {
966
+ return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
967
+ }
968
+ })();
969
+ if (obj_dataType_union0_error != null) {
970
+ obj_dataType_union0 = obj_dataType_union0_error.message;
971
+ }
972
+ var obj_dataType_union1 = null;
973
+ var obj_dataType_union1_error = (function () {
974
+ if (obj_dataType !== null) {
975
+ return new TypeError('Expected "null" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
976
+ }
977
+ })();
978
+ if (obj_dataType_union1_error != null) {
979
+ obj_dataType_union1 = obj_dataType_union1_error.message;
980
+ }
981
+ if (obj_dataType_union0 && obj_dataType_union1) {
982
+ var message = 'Object doesn\'t match union (at "' + path_dataType + '")';
983
+ message += '\n' + obj_dataType_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
984
+ message += '\n' + obj_dataType_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
985
+ return new TypeError(message);
986
+ }
987
+ var obj_label = obj.label;
988
+ var path_label = path + '.label';
989
+ var obj_label_union0 = null;
990
+ var obj_label_union0_error = (function () {
991
+ if (typeof obj_label !== 'string') {
992
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
993
+ }
994
+ })();
995
+ if (obj_label_union0_error != null) {
996
+ obj_label_union0 = obj_label_union0_error.message;
997
+ }
998
+ var obj_label_union1 = null;
999
+ var obj_label_union1_error = (function () {
1000
+ if (obj_label !== null) {
1001
+ return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
1002
+ }
1003
+ })();
1004
+ if (obj_label_union1_error != null) {
1005
+ obj_label_union1 = obj_label_union1_error.message;
1006
+ }
1007
+ if (obj_label_union0 && obj_label_union1) {
1008
+ var message = 'Object doesn\'t match union (at "' + path_label + '")';
1009
+ message += '\n' + obj_label_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1010
+ message += '\n' + obj_label_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1011
+ return new TypeError(message);
1012
+ }
1013
+ })();
1014
+ return v_error === undefined ? null : v_error;
1015
+ }
1016
+ function deepFreeze$3(input) {
1017
+ ObjectFreeze(input);
1018
+ }
1019
+
1020
+ function validate$2(obj, path) {
1021
+ if (path === void 0) { path = 'TimelineEventTypeMetadataRepresentation'; }
1022
+ var v_error = (function () {
1023
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1024
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1025
+ }
1026
+ if (obj.anchorReferenceField !== undefined) {
1027
+ var obj_anchorReferenceField = obj.anchorReferenceField;
1028
+ var path_anchorReferenceField = path + '.anchorReferenceField';
1029
+ var referencepath_anchorReferenceFieldValidationError = validate$3(obj_anchorReferenceField, path_anchorReferenceField);
1030
+ if (referencepath_anchorReferenceFieldValidationError !== null) {
1031
+ var message = 'Object doesn\'t match TimelineElementRepresentation (at "' + path_anchorReferenceField + '")\n';
1032
+ message += referencepath_anchorReferenceFieldValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1033
+ return new TypeError(message);
1034
+ }
1035
+ }
1036
+ var obj_entityApiName = obj.entityApiName;
1037
+ var path_entityApiName = path + '.entityApiName';
1038
+ var obj_entityApiName_union0 = null;
1039
+ var obj_entityApiName_union0_error = (function () {
1040
+ if (typeof obj_entityApiName !== 'string') {
1041
+ return new TypeError('Expected "string" but received "' + typeof obj_entityApiName + '" (at "' + path_entityApiName + '")');
1042
+ }
1043
+ })();
1044
+ if (obj_entityApiName_union0_error != null) {
1045
+ obj_entityApiName_union0 = obj_entityApiName_union0_error.message;
1046
+ }
1047
+ var obj_entityApiName_union1 = null;
1048
+ var obj_entityApiName_union1_error = (function () {
1049
+ if (obj_entityApiName !== null) {
1050
+ return new TypeError('Expected "null" but received "' + typeof obj_entityApiName + '" (at "' + path_entityApiName + '")');
1051
+ }
1052
+ })();
1053
+ if (obj_entityApiName_union1_error != null) {
1054
+ obj_entityApiName_union1 = obj_entityApiName_union1_error.message;
1055
+ }
1056
+ if (obj_entityApiName_union0 && obj_entityApiName_union1) {
1057
+ var message = 'Object doesn\'t match union (at "' + path_entityApiName + '")';
1058
+ message += '\n' + obj_entityApiName_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1059
+ message += '\n' + obj_entityApiName_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1060
+ return new TypeError(message);
1061
+ }
1062
+ var obj_entityLabel = obj.entityLabel;
1063
+ var path_entityLabel = path + '.entityLabel';
1064
+ var obj_entityLabel_union0 = null;
1065
+ var obj_entityLabel_union0_error = (function () {
1066
+ if (typeof obj_entityLabel !== 'string') {
1067
+ return new TypeError('Expected "string" but received "' + typeof obj_entityLabel + '" (at "' + path_entityLabel + '")');
1068
+ }
1069
+ })();
1070
+ if (obj_entityLabel_union0_error != null) {
1071
+ obj_entityLabel_union0 = obj_entityLabel_union0_error.message;
1072
+ }
1073
+ var obj_entityLabel_union1 = null;
1074
+ var obj_entityLabel_union1_error = (function () {
1075
+ if (obj_entityLabel !== null) {
1076
+ return new TypeError('Expected "null" but received "' + typeof obj_entityLabel + '" (at "' + path_entityLabel + '")');
1077
+ }
1078
+ })();
1079
+ if (obj_entityLabel_union1_error != null) {
1080
+ obj_entityLabel_union1 = obj_entityLabel_union1_error.message;
1081
+ }
1082
+ if (obj_entityLabel_union0 && obj_entityLabel_union1) {
1083
+ var message = 'Object doesn\'t match union (at "' + path_entityLabel + '")';
1084
+ message += '\n' + obj_entityLabel_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1085
+ message += '\n' + obj_entityLabel_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1086
+ return new TypeError(message);
1087
+ }
1088
+ if (obj.fieldsToDisplay !== undefined) {
1089
+ var obj_fieldsToDisplay = obj.fieldsToDisplay;
1090
+ var path_fieldsToDisplay = path + '.fieldsToDisplay';
1091
+ if (!ArrayIsArray(obj_fieldsToDisplay)) {
1092
+ return new TypeError('Expected "array" but received "' + typeof obj_fieldsToDisplay + '" (at "' + path_fieldsToDisplay + '")');
1093
+ }
1094
+ for (var i = 0; i < obj_fieldsToDisplay.length; i++) {
1095
+ var obj_fieldsToDisplay_item = obj_fieldsToDisplay[i];
1096
+ var path_fieldsToDisplay_item = path_fieldsToDisplay + '[' + i + ']';
1097
+ var referencepath_fieldsToDisplay_itemValidationError = validate$3(obj_fieldsToDisplay_item, path_fieldsToDisplay_item);
1098
+ if (referencepath_fieldsToDisplay_itemValidationError !== null) {
1099
+ var message = 'Object doesn\'t match TimelineElementRepresentation (at "' + path_fieldsToDisplay_item + '")\n';
1100
+ message += referencepath_fieldsToDisplay_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1101
+ return new TypeError(message);
1102
+ }
1103
+ }
1104
+ }
1105
+ if (obj.relatedlistsToDisplay !== undefined) {
1106
+ var obj_relatedlistsToDisplay = obj.relatedlistsToDisplay;
1107
+ var path_relatedlistsToDisplay = path + '.relatedlistsToDisplay';
1108
+ if (!ArrayIsArray(obj_relatedlistsToDisplay)) {
1109
+ return new TypeError('Expected "array" but received "' + typeof obj_relatedlistsToDisplay + '" (at "' + path_relatedlistsToDisplay + '")');
1110
+ }
1111
+ for (var i = 0; i < obj_relatedlistsToDisplay.length; i++) {
1112
+ var obj_relatedlistsToDisplay_item = obj_relatedlistsToDisplay[i];
1113
+ var path_relatedlistsToDisplay_item = path_relatedlistsToDisplay + '[' + i + ']';
1114
+ var referencepath_relatedlistsToDisplay_itemValidationError = validate$3(obj_relatedlistsToDisplay_item, path_relatedlistsToDisplay_item);
1115
+ if (referencepath_relatedlistsToDisplay_itemValidationError !== null) {
1116
+ var message = 'Object doesn\'t match TimelineElementRepresentation (at "' + path_relatedlistsToDisplay_item + '")\n';
1117
+ message += referencepath_relatedlistsToDisplay_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1118
+ return new TypeError(message);
1119
+ }
1120
+ }
1121
+ }
1122
+ var obj_relationType = obj.relationType;
1123
+ var path_relationType = path + '.relationType';
1124
+ var obj_relationType_union0 = null;
1125
+ var obj_relationType_union0_error = (function () {
1126
+ if (typeof obj_relationType !== 'string') {
1127
+ return new TypeError('Expected "string" but received "' + typeof obj_relationType + '" (at "' + path_relationType + '")');
1128
+ }
1129
+ })();
1130
+ if (obj_relationType_union0_error != null) {
1131
+ obj_relationType_union0 = obj_relationType_union0_error.message;
1132
+ }
1133
+ var obj_relationType_union1 = null;
1134
+ var obj_relationType_union1_error = (function () {
1135
+ if (obj_relationType !== null) {
1136
+ return new TypeError('Expected "null" but received "' + typeof obj_relationType + '" (at "' + path_relationType + '")');
1137
+ }
1138
+ })();
1139
+ if (obj_relationType_union1_error != null) {
1140
+ obj_relationType_union1 = obj_relationType_union1_error.message;
1141
+ }
1142
+ if (obj_relationType_union0 && obj_relationType_union1) {
1143
+ var message = 'Object doesn\'t match union (at "' + path_relationType + '")';
1144
+ message += '\n' + obj_relationType_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1145
+ message += '\n' + obj_relationType_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1146
+ return new TypeError(message);
1147
+ }
1148
+ if (obj.sortField !== undefined) {
1149
+ var obj_sortField = obj.sortField;
1150
+ var path_sortField = path + '.sortField';
1151
+ var referencepath_sortFieldValidationError = validate$3(obj_sortField, path_sortField);
1152
+ if (referencepath_sortFieldValidationError !== null) {
1153
+ var message = 'Object doesn\'t match TimelineElementRepresentation (at "' + path_sortField + '")\n';
1154
+ message += referencepath_sortFieldValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1155
+ return new TypeError(message);
1156
+ }
1157
+ }
1158
+ if (obj.subTitle !== undefined) {
1159
+ var obj_subTitle = obj.subTitle;
1160
+ var path_subTitle = path + '.subTitle';
1161
+ var referencepath_subTitleValidationError = validate$3(obj_subTitle, path_subTitle);
1162
+ if (referencepath_subTitleValidationError !== null) {
1163
+ var message = 'Object doesn\'t match TimelineElementRepresentation (at "' + path_subTitle + '")\n';
1164
+ message += referencepath_subTitleValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1165
+ return new TypeError(message);
1166
+ }
1167
+ }
1168
+ if (obj.title !== undefined) {
1169
+ var obj_title = obj.title;
1170
+ var path_title = path + '.title';
1171
+ var referencepath_titleValidationError = validate$3(obj_title, path_title);
1172
+ if (referencepath_titleValidationError !== null) {
1173
+ var message = 'Object doesn\'t match TimelineElementRepresentation (at "' + path_title + '")\n';
1174
+ message += referencepath_titleValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1175
+ return new TypeError(message);
1176
+ }
1177
+ }
1178
+ })();
1179
+ return v_error === undefined ? null : v_error;
1180
+ }
1181
+ function deepFreeze$2(input) {
1182
+ var input_anchorReferenceField = input.anchorReferenceField;
1183
+ if (input_anchorReferenceField !== undefined) {
1184
+ deepFreeze$3(input_anchorReferenceField);
1185
+ }
1186
+ var input_fieldsToDisplay = input.fieldsToDisplay;
1187
+ if (input_fieldsToDisplay !== undefined) {
1188
+ for (var i = 0; i < input_fieldsToDisplay.length; i++) {
1189
+ var input_fieldsToDisplay_item = input_fieldsToDisplay[i];
1190
+ deepFreeze$3(input_fieldsToDisplay_item);
1191
+ }
1192
+ ObjectFreeze(input_fieldsToDisplay);
1193
+ }
1194
+ var input_relatedlistsToDisplay = input.relatedlistsToDisplay;
1195
+ if (input_relatedlistsToDisplay !== undefined) {
1196
+ for (var i = 0; i < input_relatedlistsToDisplay.length; i++) {
1197
+ var input_relatedlistsToDisplay_item = input_relatedlistsToDisplay[i];
1198
+ deepFreeze$3(input_relatedlistsToDisplay_item);
1199
+ }
1200
+ ObjectFreeze(input_relatedlistsToDisplay);
1201
+ }
1202
+ var input_sortField = input.sortField;
1203
+ if (input_sortField !== undefined) {
1204
+ deepFreeze$3(input_sortField);
1205
+ }
1206
+ var input_subTitle = input.subTitle;
1207
+ if (input_subTitle !== undefined) {
1208
+ deepFreeze$3(input_subTitle);
1209
+ }
1210
+ var input_title = input.title;
1211
+ if (input_title !== undefined) {
1212
+ deepFreeze$3(input_title);
1213
+ }
1214
+ ObjectFreeze(input);
1215
+ }
1216
+
1217
+ function validate$1(obj, path) {
1218
+ if (path === void 0) { path = 'TimelineMetadataDefinitionRepresentation'; }
1219
+ var v_error = (function () {
1220
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1221
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1222
+ }
1223
+ if (obj.anchorObject !== undefined) {
1224
+ var obj_anchorObject = obj.anchorObject;
1225
+ var path_anchorObject = path + '.anchorObject';
1226
+ var referencepath_anchorObjectValidationError = validate$4(obj_anchorObject, path_anchorObject);
1227
+ if (referencepath_anchorObjectValidationError !== null) {
1228
+ var message = 'Object doesn\'t match TimelineEntityRepresentation (at "' + path_anchorObject + '")\n';
1229
+ message += referencepath_anchorObjectValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1230
+ return new TypeError(message);
1231
+ }
1232
+ }
1233
+ if (obj.eventTypes !== undefined) {
1234
+ var obj_eventTypes = obj.eventTypes;
1235
+ var path_eventTypes = path + '.eventTypes';
1236
+ if (!ArrayIsArray(obj_eventTypes)) {
1237
+ return new TypeError('Expected "array" but received "' + typeof obj_eventTypes + '" (at "' + path_eventTypes + '")');
1238
+ }
1239
+ for (var i = 0; i < obj_eventTypes.length; i++) {
1240
+ var obj_eventTypes_item = obj_eventTypes[i];
1241
+ var path_eventTypes_item = path_eventTypes + '[' + i + ']';
1242
+ var referencepath_eventTypes_itemValidationError = validate$2(obj_eventTypes_item, path_eventTypes_item);
1243
+ if (referencepath_eventTypes_itemValidationError !== null) {
1244
+ var message = 'Object doesn\'t match TimelineEventTypeMetadataRepresentation (at "' + path_eventTypes_item + '")\n';
1245
+ message += referencepath_eventTypes_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1246
+ return new TypeError(message);
1247
+ }
1248
+ }
1249
+ }
1250
+ var obj_fullName = obj.fullName;
1251
+ var path_fullName = path + '.fullName';
1252
+ var obj_fullName_union0 = null;
1253
+ var obj_fullName_union0_error = (function () {
1254
+ if (typeof obj_fullName !== 'string') {
1255
+ return new TypeError('Expected "string" but received "' + typeof obj_fullName + '" (at "' + path_fullName + '")');
1256
+ }
1257
+ })();
1258
+ if (obj_fullName_union0_error != null) {
1259
+ obj_fullName_union0 = obj_fullName_union0_error.message;
1260
+ }
1261
+ var obj_fullName_union1 = null;
1262
+ var obj_fullName_union1_error = (function () {
1263
+ if (obj_fullName !== null) {
1264
+ return new TypeError('Expected "null" but received "' + typeof obj_fullName + '" (at "' + path_fullName + '")');
1265
+ }
1266
+ })();
1267
+ if (obj_fullName_union1_error != null) {
1268
+ obj_fullName_union1 = obj_fullName_union1_error.message;
1269
+ }
1270
+ if (obj_fullName_union0 && obj_fullName_union1) {
1271
+ var message = 'Object doesn\'t match union (at "' + path_fullName + '")';
1272
+ message += '\n' + obj_fullName_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1273
+ message += '\n' + obj_fullName_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1274
+ return new TypeError(message);
1275
+ }
1276
+ if (obj.isActive !== undefined) {
1277
+ var obj_isActive = obj.isActive;
1278
+ var path_isActive = path + '.isActive';
1279
+ if (typeof obj_isActive !== 'boolean') {
1280
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isActive + '" (at "' + path_isActive + '")');
1281
+ }
1282
+ }
1283
+ var obj_masterLabel = obj.masterLabel;
1284
+ var path_masterLabel = path + '.masterLabel';
1285
+ var obj_masterLabel_union0 = null;
1286
+ var obj_masterLabel_union0_error = (function () {
1287
+ if (typeof obj_masterLabel !== 'string') {
1288
+ return new TypeError('Expected "string" but received "' + typeof obj_masterLabel + '" (at "' + path_masterLabel + '")');
1289
+ }
1290
+ })();
1291
+ if (obj_masterLabel_union0_error != null) {
1292
+ obj_masterLabel_union0 = obj_masterLabel_union0_error.message;
1293
+ }
1294
+ var obj_masterLabel_union1 = null;
1295
+ var obj_masterLabel_union1_error = (function () {
1296
+ if (obj_masterLabel !== null) {
1297
+ return new TypeError('Expected "null" but received "' + typeof obj_masterLabel + '" (at "' + path_masterLabel + '")');
1298
+ }
1299
+ })();
1300
+ if (obj_masterLabel_union1_error != null) {
1301
+ obj_masterLabel_union1 = obj_masterLabel_union1_error.message;
1302
+ }
1303
+ if (obj_masterLabel_union0 && obj_masterLabel_union1) {
1304
+ var message = 'Object doesn\'t match union (at "' + path_masterLabel + '")';
1305
+ message += '\n' + obj_masterLabel_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1306
+ message += '\n' + obj_masterLabel_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1307
+ return new TypeError(message);
1308
+ }
1309
+ })();
1310
+ return v_error === undefined ? null : v_error;
1311
+ }
1312
+ function deepFreeze$1(input) {
1313
+ var input_anchorObject = input.anchorObject;
1314
+ if (input_anchorObject !== undefined) {
1315
+ deepFreeze$4(input_anchorObject);
1316
+ }
1317
+ var input_eventTypes = input.eventTypes;
1318
+ if (input_eventTypes !== undefined) {
1319
+ for (var i = 0; i < input_eventTypes.length; i++) {
1320
+ var input_eventTypes_item = input_eventTypes[i];
1321
+ deepFreeze$2(input_eventTypes_item);
1322
+ }
1323
+ ObjectFreeze(input_eventTypes);
1324
+ }
1325
+ ObjectFreeze(input);
1326
+ }
1327
+
1328
+ var TTL = 500;
1329
+ var VERSION = "73eb5de038a20239e23e31b0a0bb3cdc";
1330
+ function validate(obj, path) {
1331
+ if (path === void 0) { path = 'TimelineMetadataResultRepresentation'; }
1332
+ var v_error = (function () {
1333
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1334
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1335
+ }
1336
+ if (obj.definitions !== undefined) {
1337
+ var obj_definitions = obj.definitions;
1338
+ var path_definitions = path + '.definitions';
1339
+ if (!ArrayIsArray(obj_definitions)) {
1340
+ return new TypeError('Expected "array" but received "' + typeof obj_definitions + '" (at "' + path_definitions + '")');
1341
+ }
1342
+ for (var i = 0; i < obj_definitions.length; i++) {
1343
+ var obj_definitions_item = obj_definitions[i];
1344
+ var path_definitions_item = path_definitions + '[' + i + ']';
1345
+ var referencepath_definitions_itemValidationError = validate$1(obj_definitions_item, path_definitions_item);
1346
+ if (referencepath_definitions_itemValidationError !== null) {
1347
+ var message = 'Object doesn\'t match TimelineMetadataDefinitionRepresentation (at "' + path_definitions_item + '")\n';
1348
+ message += referencepath_definitions_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1349
+ return new TypeError(message);
1350
+ }
1351
+ }
1352
+ }
1353
+ if (obj.errors !== undefined) {
1354
+ var obj_errors = obj.errors;
1355
+ var path_errors = path + '.errors';
1356
+ if (!ArrayIsArray(obj_errors)) {
1357
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
1358
+ }
1359
+ for (var i = 0; i < obj_errors.length; i++) {
1360
+ var obj_errors_item = obj_errors[i];
1361
+ var path_errors_item = path_errors + '[' + i + ']';
1362
+ var referencepath_errors_itemValidationError = validate$9(obj_errors_item, path_errors_item);
1363
+ if (referencepath_errors_itemValidationError !== null) {
1364
+ var message = 'Object doesn\'t match TimelineErrorRepresentation (at "' + path_errors_item + '")\n';
1365
+ message += referencepath_errors_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1366
+ return new TypeError(message);
1367
+ }
1368
+ }
1369
+ }
1370
+ var obj_status = obj.status;
1371
+ var path_status = path + '.status';
1372
+ var obj_status_union0 = null;
1373
+ var obj_status_union0_error = (function () {
1374
+ if (typeof obj_status !== 'string') {
1375
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1376
+ }
1377
+ })();
1378
+ if (obj_status_union0_error != null) {
1379
+ obj_status_union0 = obj_status_union0_error.message;
1380
+ }
1381
+ var obj_status_union1 = null;
1382
+ var obj_status_union1_error = (function () {
1383
+ if (obj_status !== null) {
1384
+ return new TypeError('Expected "null" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1385
+ }
1386
+ })();
1387
+ if (obj_status_union1_error != null) {
1388
+ obj_status_union1 = obj_status_union1_error.message;
1389
+ }
1390
+ if (obj_status_union0 && obj_status_union1) {
1391
+ var message = 'Object doesn\'t match union (at "' + path_status + '")';
1392
+ message += '\n' + obj_status_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1393
+ message += '\n' + obj_status_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1394
+ return new TypeError(message);
1395
+ }
1396
+ })();
1397
+ return v_error === undefined ? null : v_error;
1398
+ }
1399
+ var RepresentationType = 'TimelineMetadataResultRepresentation';
1400
+ function normalize(input, existing, path, luvio, store, timestamp) {
1401
+ return input;
1402
+ }
1403
+ var select$1 = function TimelineMetadataResultRepresentationSelect() {
1404
+ return {
1405
+ kind: 'Fragment',
1406
+ version: VERSION,
1407
+ private: [],
1408
+ opaque: true
1409
+ };
1410
+ };
1411
+ function equals(existing, incoming) {
1412
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1413
+ return false;
1414
+ }
1415
+ return true;
1416
+ }
1417
+ function deepFreeze(input) {
1418
+ var input_definitions = input.definitions;
1419
+ if (input_definitions !== undefined) {
1420
+ for (var i = 0; i < input_definitions.length; i++) {
1421
+ var input_definitions_item = input_definitions[i];
1422
+ deepFreeze$1(input_definitions_item);
1423
+ }
1424
+ ObjectFreeze(input_definitions);
1425
+ }
1426
+ var input_errors = input.errors;
1427
+ if (input_errors !== undefined) {
1428
+ for (var i = 0; i < input_errors.length; i++) {
1429
+ var input_errors_item = input_errors[i];
1430
+ deepFreeze$9(input_errors_item);
1431
+ }
1432
+ ObjectFreeze(input_errors);
1433
+ }
1434
+ ObjectFreeze(input);
1435
+ }
1436
+ var ingest = function TimelineMetadataResultRepresentationIngest(input, path, luvio, store, timestamp) {
1437
+ if (process.env.NODE_ENV !== 'production') {
1438
+ var validateError = validate(input);
1439
+ if (validateError !== null) {
1440
+ throw validateError;
1441
+ }
1442
+ }
1443
+ var key = path.fullPath;
1444
+ var existingRecord = store.readEntry(key);
1445
+ var ttlToUse = TTL;
1446
+ var incomingRecord = normalize(input, store.readEntry(key), {
1447
+ fullPath: key,
1448
+ parent: path.parent,
1449
+ propertyName: path.propertyName,
1450
+ ttl: ttlToUse
1451
+ });
1452
+ deepFreeze(input);
1453
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
1454
+ luvio.storePublish(key, incomingRecord);
1455
+ }
1456
+ {
1457
+ var storeMetadataParams = {
1458
+ ttl: ttlToUse,
1459
+ namespace: "Timeline",
1460
+ version: VERSION,
1461
+ representationName: RepresentationType,
1462
+ };
1463
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1464
+ }
1465
+ return createLink(key);
1466
+ };
1467
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
1468
+ var rootKeySet = new engine.StoreKeyMap();
1469
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1470
+ var rootKey = fullPathFactory();
1471
+ rootKeySet.set(rootKey, {
1472
+ namespace: keyPrefix,
1473
+ representationName: RepresentationType,
1474
+ mergeable: false
1475
+ });
1476
+ return rootKeySet;
1477
+ }
1478
+
1479
+ function select(luvio, params) {
1480
+ return select$1();
1481
+ }
1482
+ function keyBuilder$1(luvio, params) {
1483
+ return keyPrefix + '::TimelineMetadataResultRepresentation:(' + 'fullNames:' + params.queryParams.fullNames + ')';
1484
+ }
1485
+ function getResponseCacheKeys(luvio, resourceParams, response) {
1486
+ return getTypeCacheKeys(luvio, response, function () { return keyBuilder$1(luvio, resourceParams); });
1487
+ }
1488
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1489
+ var body = response.body;
1490
+ var key = keyBuilder$1(luvio, resourceParams);
1491
+ luvio.storeIngest(key, ingest, body);
1492
+ var snapshot = luvio.storeLookup({
1493
+ recordId: key,
1494
+ node: select(),
1495
+ variables: {},
1496
+ }, snapshotRefresh);
1497
+ if (process.env.NODE_ENV !== 'production') {
1498
+ if (snapshot.state !== 'Fulfilled') {
1499
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1500
+ }
1501
+ }
1502
+ return snapshot;
1503
+ }
1504
+ function ingestError(luvio, params, error, snapshotRefresh) {
1505
+ var key = keyBuilder$1(luvio, params);
1506
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1507
+ var storeMetadataParams = {
1508
+ ttl: TTL,
1509
+ namespace: keyPrefix,
1510
+ version: VERSION,
1511
+ representationName: RepresentationType
1512
+ };
1513
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1514
+ return errorSnapshot;
1515
+ }
1516
+ function createResourceRequest(config) {
1517
+ var headers = {};
1518
+ return {
1519
+ baseUri: '/services/data/v58.0',
1520
+ basePath: '/connect/timeline/metadata/configurations',
1521
+ method: 'get',
1522
+ body: null,
1523
+ urlParams: {},
1524
+ queryParams: config.queryParams,
1525
+ headers: headers,
1526
+ priority: 'normal',
1527
+ };
1528
+ }
1529
+
1530
+ var getTimelineMetadata_ConfigPropertyNames = {
1531
+ displayName: 'getTimelineMetadata',
1532
+ parameters: {
1533
+ required: [],
1534
+ optional: ['fullNames']
1535
+ }
1536
+ };
1537
+ function createResourceParams(config) {
1538
+ var resourceParams = {
1539
+ queryParams: {
1540
+ fullNames: config.fullNames
1541
+ }
1542
+ };
1543
+ return resourceParams;
1544
+ }
1545
+ function keyBuilder(luvio, config) {
1546
+ var resourceParams = createResourceParams(config);
1547
+ return keyBuilder$1(luvio, resourceParams);
1548
+ }
1549
+ function typeCheckConfig(untrustedConfig) {
1550
+ var config = {};
1551
+ var untrustedConfig_fullNames = untrustedConfig.fullNames;
1552
+ if (ArrayIsArray$1(untrustedConfig_fullNames)) {
1553
+ var untrustedConfig_fullNames_array = [];
1554
+ for (var i = 0, arrayLength = untrustedConfig_fullNames.length; i < arrayLength; i++) {
1555
+ var untrustedConfig_fullNames_item = untrustedConfig_fullNames[i];
1556
+ if (typeof untrustedConfig_fullNames_item === 'string') {
1557
+ untrustedConfig_fullNames_array.push(untrustedConfig_fullNames_item);
1558
+ }
1559
+ }
1560
+ config.fullNames = untrustedConfig_fullNames_array;
1561
+ }
1562
+ return config;
1563
+ }
1564
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1565
+ if (!untrustedIsObject(untrustedConfig)) {
1566
+ return null;
1567
+ }
1568
+ if (process.env.NODE_ENV !== 'production') {
1569
+ validateConfig(untrustedConfig, configPropertyNames);
1570
+ }
1571
+ var config = typeCheckConfig(untrustedConfig);
1572
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1573
+ return null;
1574
+ }
1575
+ return config;
1576
+ }
1577
+ function adapterFragment(luvio, config) {
1578
+ createResourceParams(config);
1579
+ return select();
1580
+ }
1581
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1582
+ var snapshot = ingestSuccess(luvio, resourceParams, response, {
1583
+ config: config,
1584
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
1585
+ });
1586
+ return luvio.storeBroadcast().then(function () { return snapshot; });
1587
+ }
1588
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1589
+ var snapshot = ingestError(luvio, resourceParams, response, {
1590
+ config: config,
1591
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
1592
+ });
1593
+ return luvio.storeBroadcast().then(function () { return snapshot; });
1594
+ }
1595
+ function buildNetworkSnapshot(luvio, config, options) {
1596
+ var resourceParams = createResourceParams(config);
1597
+ var request = createResourceRequest(resourceParams);
1598
+ return luvio.dispatchResourceRequest(request, options)
1599
+ .then(function (response) {
1600
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
1601
+ }, function (response) {
1602
+ return luvio.handleErrorResponse(function () { return onFetchResponseError(luvio, config, resourceParams, response); });
1603
+ });
1604
+ }
1605
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1606
+ var luvio = context.luvio, config = context.config;
1607
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
1608
+ var dispatchOptions = {
1609
+ resourceRequestContext: {
1610
+ requestCorrelator: requestCorrelator,
1611
+ luvioRequestMethod: undefined,
1612
+ },
1613
+ eventObservers: eventObservers
1614
+ };
1615
+ if (networkPriority !== 'normal') {
1616
+ dispatchOptions.overrides = {
1617
+ priority: networkPriority
1618
+ };
1619
+ }
1620
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
1621
+ }
1622
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1623
+ var luvio = context.luvio, config = context.config;
1624
+ var selector = {
1625
+ recordId: keyBuilder(luvio, config),
1626
+ node: adapterFragment(luvio, config),
1627
+ variables: {},
1628
+ };
1629
+ var cacheSnapshot = storeLookup(selector, {
1630
+ config: config,
1631
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
1632
+ });
1633
+ return cacheSnapshot;
1634
+ }
1635
+ var getTimelineMetadataAdapterFactory = function (luvio) { return function Timeline__getTimelineMetadata(untrustedConfig, requestContext) {
1636
+ var config = validateAdapterConfig(untrustedConfig, getTimelineMetadata_ConfigPropertyNames);
1637
+ // Invalid or incomplete config
1638
+ if (config === null) {
1639
+ return null;
1640
+ }
1641
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
1642
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1643
+ }; };
1644
+
1645
+ exports.getTimelineDataAdapterFactory = getTimelineDataAdapterFactory;
1646
+ exports.getTimelineMetadataAdapterFactory = getTimelineMetadataAdapterFactory;
1647
+
1648
+ Object.defineProperty(exports, '__esModule', { value: true });
1649
+
1650
+ }));