@salesforce/lds-adapters-industries-timeline 1.169.0 → 1.170.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.
@@ -58,229 +58,481 @@ function createLink(ref) {
58
58
  };
59
59
  }
60
60
 
61
- function validate$e(obj, path = 'DmoFieldsOutputRepresentation') {
61
+ function validate$f(obj, path = 'TimelineErrorRepresentation') {
62
62
  const v_error = (() => {
63
63
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
64
64
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
65
65
  }
66
- const obj_displayName = obj.displayName;
67
- const path_displayName = path + '.displayName';
68
- if (typeof obj_displayName !== 'string') {
69
- return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
66
+ const obj_code = obj.code;
67
+ const path_code = path + '.code';
68
+ let obj_code_union0 = null;
69
+ const obj_code_union0_error = (() => {
70
+ if (typeof obj_code !== 'string') {
71
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
72
+ }
73
+ })();
74
+ if (obj_code_union0_error != null) {
75
+ obj_code_union0 = obj_code_union0_error.message;
70
76
  }
71
- const obj_name = obj.name;
72
- const path_name = path + '.name';
73
- if (typeof obj_name !== 'string') {
74
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
77
+ let obj_code_union1 = null;
78
+ const obj_code_union1_error = (() => {
79
+ if (obj_code !== null) {
80
+ return new TypeError('Expected "null" but received "' + typeof obj_code + '" (at "' + path_code + '")');
81
+ }
82
+ })();
83
+ if (obj_code_union1_error != null) {
84
+ obj_code_union1 = obj_code_union1_error.message;
75
85
  }
76
- const obj_type = obj.type;
77
- const path_type = path + '.type';
78
- if (typeof obj_type !== 'string') {
79
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
86
+ if (obj_code_union0 && obj_code_union1) {
87
+ let message = 'Object doesn\'t match union (at "' + path_code + '")';
88
+ message += '\n' + obj_code_union0.split('\n').map((line) => '\t' + line).join('\n');
89
+ message += '\n' + obj_code_union1.split('\n').map((line) => '\t' + line).join('\n');
90
+ return new TypeError(message);
80
91
  }
81
- })();
82
- return v_error === undefined ? null : v_error;
83
- }
84
-
85
- function validate$d(obj, path = 'RelationshipTypeOutputRepresentation') {
86
- const v_error = (() => {
87
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
88
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
92
+ const obj_message = obj.message;
93
+ const path_message = path + '.message';
94
+ let obj_message_union0 = null;
95
+ const obj_message_union0_error = (() => {
96
+ if (typeof obj_message !== 'string') {
97
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
98
+ }
99
+ })();
100
+ if (obj_message_union0_error != null) {
101
+ obj_message_union0 = obj_message_union0_error.message;
89
102
  }
90
- const obj_attribute = obj.attribute;
91
- const path_attribute = path + '.attribute';
92
- if (typeof obj_attribute !== 'string') {
93
- return new TypeError('Expected "string" but received "' + typeof obj_attribute + '" (at "' + path_attribute + '")');
103
+ let obj_message_union1 = null;
104
+ const obj_message_union1_error = (() => {
105
+ if (obj_message !== null) {
106
+ return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
107
+ }
108
+ })();
109
+ if (obj_message_union1_error != null) {
110
+ obj_message_union1 = obj_message_union1_error.message;
94
111
  }
95
- const obj_name = obj.name;
96
- const path_name = path + '.name';
97
- if (typeof obj_name !== 'string') {
98
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
112
+ if (obj_message_union0 && obj_message_union1) {
113
+ let message = 'Object doesn\'t match union (at "' + path_message + '")';
114
+ message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
115
+ message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
116
+ return new TypeError(message);
99
117
  }
100
118
  })();
101
119
  return v_error === undefined ? null : v_error;
102
120
  }
103
121
 
104
- function validate$c(obj, path = 'DmoRelationshipsOutputRepresentation') {
122
+ function validate$e(obj, path = 'TimelineEventTypeRepresentation') {
105
123
  const v_error = (() => {
106
124
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
107
125
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
108
126
  }
109
- const obj_fromEntity = obj.fromEntity;
110
- const path_fromEntity = path + '.fromEntity';
111
- const referencepath_fromEntityValidationError = validate$d(obj_fromEntity, path_fromEntity);
112
- if (referencepath_fromEntityValidationError !== null) {
113
- let message = 'Object doesn\'t match RelationshipTypeOutputRepresentation (at "' + path_fromEntity + '")\n';
114
- message += referencepath_fromEntityValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
127
+ const obj_eventApiName = obj.eventApiName;
128
+ const path_eventApiName = path + '.eventApiName';
129
+ let obj_eventApiName_union0 = null;
130
+ const obj_eventApiName_union0_error = (() => {
131
+ if (typeof obj_eventApiName !== 'string') {
132
+ return new TypeError('Expected "string" but received "' + typeof obj_eventApiName + '" (at "' + path_eventApiName + '")');
133
+ }
134
+ })();
135
+ if (obj_eventApiName_union0_error != null) {
136
+ obj_eventApiName_union0 = obj_eventApiName_union0_error.message;
137
+ }
138
+ let obj_eventApiName_union1 = null;
139
+ const obj_eventApiName_union1_error = (() => {
140
+ if (obj_eventApiName !== null) {
141
+ return new TypeError('Expected "null" but received "' + typeof obj_eventApiName + '" (at "' + path_eventApiName + '")');
142
+ }
143
+ })();
144
+ if (obj_eventApiName_union1_error != null) {
145
+ obj_eventApiName_union1 = obj_eventApiName_union1_error.message;
146
+ }
147
+ if (obj_eventApiName_union0 && obj_eventApiName_union1) {
148
+ let message = 'Object doesn\'t match union (at "' + path_eventApiName + '")';
149
+ message += '\n' + obj_eventApiName_union0.split('\n').map((line) => '\t' + line).join('\n');
150
+ message += '\n' + obj_eventApiName_union1.split('\n').map((line) => '\t' + line).join('\n');
115
151
  return new TypeError(message);
116
152
  }
117
- const obj_toEntity = obj.toEntity;
118
- const path_toEntity = path + '.toEntity';
119
- const referencepath_toEntityValidationError = validate$d(obj_toEntity, path_toEntity);
120
- if (referencepath_toEntityValidationError !== null) {
121
- let message = 'Object doesn\'t match RelationshipTypeOutputRepresentation (at "' + path_toEntity + '")\n';
122
- message += referencepath_toEntityValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
153
+ const obj_offset = obj.offset;
154
+ const path_offset = path + '.offset';
155
+ let obj_offset_union0 = null;
156
+ const obj_offset_union0_error = (() => {
157
+ if (typeof obj_offset !== 'number' || (typeof obj_offset === 'number' && Math.floor(obj_offset) !== obj_offset)) {
158
+ return new TypeError('Expected "integer" but received "' + typeof obj_offset + '" (at "' + path_offset + '")');
159
+ }
160
+ })();
161
+ if (obj_offset_union0_error != null) {
162
+ obj_offset_union0 = obj_offset_union0_error.message;
163
+ }
164
+ let obj_offset_union1 = null;
165
+ const obj_offset_union1_error = (() => {
166
+ if (obj_offset !== null) {
167
+ return new TypeError('Expected "null" but received "' + typeof obj_offset + '" (at "' + path_offset + '")');
168
+ }
169
+ })();
170
+ if (obj_offset_union1_error != null) {
171
+ obj_offset_union1 = obj_offset_union1_error.message;
172
+ }
173
+ if (obj_offset_union0 && obj_offset_union1) {
174
+ let message = 'Object doesn\'t match union (at "' + path_offset + '")';
175
+ message += '\n' + obj_offset_union0.split('\n').map((line) => '\t' + line).join('\n');
176
+ message += '\n' + obj_offset_union1.split('\n').map((line) => '\t' + line).join('\n');
123
177
  return new TypeError(message);
124
178
  }
125
179
  })();
126
180
  return v_error === undefined ? null : v_error;
127
181
  }
128
182
 
129
- function validate$b(obj, path = 'DmoOutputRepresentation') {
183
+ function validate$d(obj, path = 'TimelineEventFieldRepresentation') {
130
184
  const v_error = (() => {
131
185
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
132
186
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
133
187
  }
134
- const obj_category = obj.category;
135
- const path_category = path + '.category';
136
- if (typeof obj_category !== 'string') {
137
- return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
138
- }
139
- const obj_displayName = obj.displayName;
140
- const path_displayName = path + '.displayName';
141
- if (typeof obj_displayName !== 'string') {
142
- return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
143
- }
144
- const obj_fields = obj.fields;
145
- const path_fields = path + '.fields';
146
- if (!ArrayIsArray(obj_fields)) {
147
- return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
188
+ const obj_name = obj.name;
189
+ const path_name = path + '.name';
190
+ let obj_name_union0 = null;
191
+ const obj_name_union0_error = (() => {
192
+ if (typeof obj_name !== 'string') {
193
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
194
+ }
195
+ })();
196
+ if (obj_name_union0_error != null) {
197
+ obj_name_union0 = obj_name_union0_error.message;
148
198
  }
149
- for (let i = 0; i < obj_fields.length; i++) {
150
- const obj_fields_item = obj_fields[i];
151
- const path_fields_item = path_fields + '[' + i + ']';
152
- const referencepath_fields_itemValidationError = validate$e(obj_fields_item, path_fields_item);
153
- if (referencepath_fields_itemValidationError !== null) {
154
- let message = 'Object doesn\'t match DmoFieldsOutputRepresentation (at "' + path_fields_item + '")\n';
155
- message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
156
- return new TypeError(message);
199
+ let obj_name_union1 = null;
200
+ const obj_name_union1_error = (() => {
201
+ if (obj_name !== null) {
202
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
157
203
  }
204
+ })();
205
+ if (obj_name_union1_error != null) {
206
+ obj_name_union1 = obj_name_union1_error.message;
158
207
  }
159
- const obj_name = obj.name;
160
- const path_name = path + '.name';
161
- if (typeof obj_name !== 'string') {
162
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
208
+ if (obj_name_union0 && obj_name_union1) {
209
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
210
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
211
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
212
+ return new TypeError(message);
163
213
  }
164
- const obj_relationships = obj.relationships;
165
- const path_relationships = path + '.relationships';
166
- if (!ArrayIsArray(obj_relationships)) {
167
- return new TypeError('Expected "array" but received "' + typeof obj_relationships + '" (at "' + path_relationships + '")');
214
+ const obj_value = obj.value;
215
+ const path_value = path + '.value';
216
+ let obj_value_union0 = null;
217
+ const obj_value_union0_error = (() => {
218
+ if (typeof obj_value !== 'string') {
219
+ return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
220
+ }
221
+ })();
222
+ if (obj_value_union0_error != null) {
223
+ obj_value_union0 = obj_value_union0_error.message;
168
224
  }
169
- for (let i = 0; i < obj_relationships.length; i++) {
170
- const obj_relationships_item = obj_relationships[i];
171
- const path_relationships_item = path_relationships + '[' + i + ']';
172
- const referencepath_relationships_itemValidationError = validate$c(obj_relationships_item, path_relationships_item);
173
- if (referencepath_relationships_itemValidationError !== null) {
174
- let message = 'Object doesn\'t match DmoRelationshipsOutputRepresentation (at "' + path_relationships_item + '")\n';
175
- message += referencepath_relationships_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
176
- return new TypeError(message);
225
+ let obj_value_union1 = null;
226
+ const obj_value_union1_error = (() => {
227
+ if (obj_value !== null) {
228
+ return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
177
229
  }
230
+ })();
231
+ if (obj_value_union1_error != null) {
232
+ obj_value_union1 = obj_value_union1_error.message;
233
+ }
234
+ if (obj_value_union0 && obj_value_union1) {
235
+ let message = 'Object doesn\'t match union (at "' + path_value + '")';
236
+ message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
237
+ message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
238
+ return new TypeError(message);
178
239
  }
179
240
  })();
180
241
  return v_error === undefined ? null : v_error;
181
242
  }
182
243
 
183
- const TTL$2 = 600000;
184
- const VERSION$2 = "84ccc17f91013e292e7b01a291dd0322";
185
- function validate$a(obj, path = 'CdpMetadataOutputRepresentation') {
244
+ function validate$c(obj, path = 'TimelineEventRepresentation') {
186
245
  const v_error = (() => {
187
246
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
188
247
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
189
248
  }
190
- const obj_dmos = obj.dmos;
191
- const path_dmos = path + '.dmos';
192
- if (!ArrayIsArray(obj_dmos)) {
193
- return new TypeError('Expected "array" but received "' + typeof obj_dmos + '" (at "' + path_dmos + '")');
249
+ const obj_description = obj.description;
250
+ const path_description = path + '.description';
251
+ let obj_description_union0 = null;
252
+ const obj_description_union0_error = (() => {
253
+ if (typeof obj_description !== 'string') {
254
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
255
+ }
256
+ })();
257
+ if (obj_description_union0_error != null) {
258
+ obj_description_union0 = obj_description_union0_error.message;
194
259
  }
195
- for (let i = 0; i < obj_dmos.length; i++) {
196
- const obj_dmos_item = obj_dmos[i];
197
- const path_dmos_item = path_dmos + '[' + i + ']';
198
- const referencepath_dmos_itemValidationError = validate$b(obj_dmos_item, path_dmos_item);
199
- if (referencepath_dmos_itemValidationError !== null) {
200
- let message = 'Object doesn\'t match DmoOutputRepresentation (at "' + path_dmos_item + '")\n';
201
- message += referencepath_dmos_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
202
- return new TypeError(message);
260
+ let obj_description_union1 = null;
261
+ const obj_description_union1_error = (() => {
262
+ if (obj_description !== null) {
263
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
203
264
  }
265
+ })();
266
+ if (obj_description_union1_error != null) {
267
+ obj_description_union1 = obj_description_union1_error.message;
204
268
  }
205
- })();
206
- return v_error === undefined ? null : v_error;
207
- }
208
- const RepresentationType$2 = 'CdpMetadataOutputRepresentation';
209
- function normalize$2(input, existing, path, luvio, store, timestamp) {
210
- return input;
211
- }
212
- const select$5 = function CdpMetadataOutputRepresentationSelect() {
213
- return {
214
- kind: 'Fragment',
215
- version: VERSION$2,
216
- private: [],
217
- opaque: true
218
- };
219
- };
220
- function equals$2(existing, incoming) {
221
- if (JSONStringify(incoming) !== JSONStringify(existing)) {
222
- return false;
269
+ if (obj_description_union0 && obj_description_union1) {
270
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
271
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
272
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
273
+ return new TypeError(message);
274
+ }
275
+ const obj_eventDateTime = obj.eventDateTime;
276
+ const path_eventDateTime = path + '.eventDateTime';
277
+ let obj_eventDateTime_union0 = null;
278
+ const obj_eventDateTime_union0_error = (() => {
279
+ if (typeof obj_eventDateTime !== 'string') {
280
+ return new TypeError('Expected "string" but received "' + typeof obj_eventDateTime + '" (at "' + path_eventDateTime + '")');
281
+ }
282
+ })();
283
+ if (obj_eventDateTime_union0_error != null) {
284
+ obj_eventDateTime_union0 = obj_eventDateTime_union0_error.message;
285
+ }
286
+ let obj_eventDateTime_union1 = null;
287
+ const obj_eventDateTime_union1_error = (() => {
288
+ if (obj_eventDateTime !== null) {
289
+ return new TypeError('Expected "null" but received "' + typeof obj_eventDateTime + '" (at "' + path_eventDateTime + '")');
290
+ }
291
+ })();
292
+ if (obj_eventDateTime_union1_error != null) {
293
+ obj_eventDateTime_union1 = obj_eventDateTime_union1_error.message;
294
+ }
295
+ if (obj_eventDateTime_union0 && obj_eventDateTime_union1) {
296
+ let message = 'Object doesn\'t match union (at "' + path_eventDateTime + '")';
297
+ message += '\n' + obj_eventDateTime_union0.split('\n').map((line) => '\t' + line).join('\n');
298
+ message += '\n' + obj_eventDateTime_union1.split('\n').map((line) => '\t' + line).join('\n');
299
+ return new TypeError(message);
300
+ }
301
+ if (obj.fields !== undefined) {
302
+ const obj_fields = obj.fields;
303
+ const path_fields = path + '.fields';
304
+ if (!ArrayIsArray(obj_fields)) {
305
+ return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
306
+ }
307
+ for (let i = 0; i < obj_fields.length; i++) {
308
+ const obj_fields_item = obj_fields[i];
309
+ const path_fields_item = path_fields + '[' + i + ']';
310
+ const referencepath_fields_itemValidationError = validate$d(obj_fields_item, path_fields_item);
311
+ if (referencepath_fields_itemValidationError !== null) {
312
+ let message = 'Object doesn\'t match TimelineEventFieldRepresentation (at "' + path_fields_item + '")\n';
313
+ message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
314
+ return new TypeError(message);
315
+ }
316
+ }
317
+ }
318
+ const obj_id = obj.id;
319
+ const path_id = path + '.id';
320
+ let obj_id_union0 = null;
321
+ const obj_id_union0_error = (() => {
322
+ if (typeof obj_id !== 'string') {
323
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
324
+ }
325
+ })();
326
+ if (obj_id_union0_error != null) {
327
+ obj_id_union0 = obj_id_union0_error.message;
328
+ }
329
+ let obj_id_union1 = null;
330
+ const obj_id_union1_error = (() => {
331
+ if (obj_id !== null) {
332
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
333
+ }
334
+ })();
335
+ if (obj_id_union1_error != null) {
336
+ obj_id_union1 = obj_id_union1_error.message;
337
+ }
338
+ if (obj_id_union0 && obj_id_union1) {
339
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
340
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
341
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
342
+ return new TypeError(message);
343
+ }
344
+ const obj_title = obj.title;
345
+ const path_title = path + '.title';
346
+ let obj_title_union0 = null;
347
+ const obj_title_union0_error = (() => {
348
+ if (typeof obj_title !== 'string') {
349
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
350
+ }
351
+ })();
352
+ if (obj_title_union0_error != null) {
353
+ obj_title_union0 = obj_title_union0_error.message;
354
+ }
355
+ let obj_title_union1 = null;
356
+ const obj_title_union1_error = (() => {
357
+ if (obj_title !== null) {
358
+ return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
359
+ }
360
+ })();
361
+ if (obj_title_union1_error != null) {
362
+ obj_title_union1 = obj_title_union1_error.message;
363
+ }
364
+ if (obj_title_union0 && obj_title_union1) {
365
+ let message = 'Object doesn\'t match union (at "' + path_title + '")';
366
+ message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
367
+ message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
368
+ return new TypeError(message);
369
+ }
370
+ const obj_type = obj.type;
371
+ const path_type = path + '.type';
372
+ let obj_type_union0 = null;
373
+ const obj_type_union0_error = (() => {
374
+ if (typeof obj_type !== 'string') {
375
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
376
+ }
377
+ })();
378
+ if (obj_type_union0_error != null) {
379
+ obj_type_union0 = obj_type_union0_error.message;
380
+ }
381
+ let obj_type_union1 = null;
382
+ const obj_type_union1_error = (() => {
383
+ if (obj_type !== null) {
384
+ return new TypeError('Expected "null" but received "' + typeof obj_type + '" (at "' + path_type + '")');
385
+ }
386
+ })();
387
+ if (obj_type_union1_error != null) {
388
+ obj_type_union1 = obj_type_union1_error.message;
389
+ }
390
+ if (obj_type_union0 && obj_type_union1) {
391
+ let message = 'Object doesn\'t match union (at "' + path_type + '")';
392
+ message += '\n' + obj_type_union0.split('\n').map((line) => '\t' + line).join('\n');
393
+ message += '\n' + obj_type_union1.split('\n').map((line) => '\t' + line).join('\n');
394
+ return new TypeError(message);
395
+ }
396
+ })();
397
+ return v_error === undefined ? null : v_error;
398
+ }
399
+
400
+ const TTL$3 = 600000;
401
+ const VERSION$3 = "321752356b84efcf9df843ceda55f23c";
402
+ function validate$b(obj, path = 'EngagementEventTimelineDataRepresentation') {
403
+ const v_error = (() => {
404
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
405
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
406
+ }
407
+ const obj_errors = obj.errors;
408
+ const path_errors = path + '.errors';
409
+ if (!ArrayIsArray(obj_errors)) {
410
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
411
+ }
412
+ for (let i = 0; i < obj_errors.length; i++) {
413
+ const obj_errors_item = obj_errors[i];
414
+ const path_errors_item = path_errors + '[' + i + ']';
415
+ const referencepath_errors_itemValidationError = validate$f(obj_errors_item, path_errors_item);
416
+ if (referencepath_errors_itemValidationError !== null) {
417
+ let message = 'Object doesn\'t match TimelineErrorRepresentation (at "' + path_errors_item + '")\n';
418
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
419
+ return new TypeError(message);
420
+ }
421
+ }
422
+ const obj_eventTypes = obj.eventTypes;
423
+ const path_eventTypes = path + '.eventTypes';
424
+ if (!ArrayIsArray(obj_eventTypes)) {
425
+ return new TypeError('Expected "array" but received "' + typeof obj_eventTypes + '" (at "' + path_eventTypes + '")');
426
+ }
427
+ for (let i = 0; i < obj_eventTypes.length; i++) {
428
+ const obj_eventTypes_item = obj_eventTypes[i];
429
+ const path_eventTypes_item = path_eventTypes + '[' + i + ']';
430
+ const referencepath_eventTypes_itemValidationError = validate$e(obj_eventTypes_item, path_eventTypes_item);
431
+ if (referencepath_eventTypes_itemValidationError !== null) {
432
+ let message = 'Object doesn\'t match TimelineEventTypeRepresentation (at "' + path_eventTypes_item + '")\n';
433
+ message += referencepath_eventTypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
434
+ return new TypeError(message);
435
+ }
436
+ }
437
+ const obj_events = obj.events;
438
+ const path_events = path + '.events';
439
+ if (!ArrayIsArray(obj_events)) {
440
+ return new TypeError('Expected "array" but received "' + typeof obj_events + '" (at "' + path_events + '")');
441
+ }
442
+ for (let i = 0; i < obj_events.length; i++) {
443
+ const obj_events_item = obj_events[i];
444
+ const path_events_item = path_events + '[' + i + ']';
445
+ const referencepath_events_itemValidationError = validate$c(obj_events_item, path_events_item);
446
+ if (referencepath_events_itemValidationError !== null) {
447
+ let message = 'Object doesn\'t match TimelineEventRepresentation (at "' + path_events_item + '")\n';
448
+ message += referencepath_events_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
449
+ return new TypeError(message);
450
+ }
451
+ }
452
+ const obj_isSuccess = obj.isSuccess;
453
+ const path_isSuccess = path + '.isSuccess';
454
+ if (typeof obj_isSuccess !== 'boolean') {
455
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
456
+ }
457
+ })();
458
+ return v_error === undefined ? null : v_error;
459
+ }
460
+ const RepresentationType$3 = 'EngagementEventTimelineDataRepresentation';
461
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
462
+ return input;
463
+ }
464
+ const select$7 = function EngagementEventTimelineDataRepresentationSelect() {
465
+ return {
466
+ kind: 'Fragment',
467
+ version: VERSION$3,
468
+ private: [],
469
+ opaque: true
470
+ };
471
+ };
472
+ function equals$3(existing, incoming) {
473
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
474
+ return false;
223
475
  }
224
476
  return true;
225
477
  }
226
- const ingest$2 = function CdpMetadataOutputRepresentationIngest(input, path, luvio, store, timestamp) {
478
+ const ingest$3 = function EngagementEventTimelineDataRepresentationIngest(input, path, luvio, store, timestamp) {
227
479
  if (process.env.NODE_ENV !== 'production') {
228
- const validateError = validate$a(input);
480
+ const validateError = validate$b(input);
229
481
  if (validateError !== null) {
230
482
  throw validateError;
231
483
  }
232
484
  }
233
485
  const key = path.fullPath;
234
486
  const existingRecord = store.readEntry(key);
235
- const ttlToUse = TTL$2;
236
- let incomingRecord = normalize$2(input, store.readEntry(key), {
487
+ const ttlToUse = TTL$3;
488
+ let incomingRecord = normalize$3(input, store.readEntry(key), {
237
489
  fullPath: key,
238
490
  parent: path.parent,
239
491
  propertyName: path.propertyName,
240
492
  ttl: ttlToUse
241
493
  });
242
- if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
494
+ if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
243
495
  luvio.storePublish(key, incomingRecord);
244
496
  }
245
497
  {
246
498
  const storeMetadataParams = {
247
499
  ttl: ttlToUse,
248
500
  namespace: "Timeline",
249
- version: VERSION$2,
250
- representationName: RepresentationType$2,
501
+ version: VERSION$3,
502
+ representationName: RepresentationType$3,
251
503
  };
252
504
  luvio.publishStoreMetadata(key, storeMetadataParams);
253
505
  }
254
506
  return createLink(key);
255
507
  };
256
- function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
508
+ function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
257
509
  const rootKeySet = new StoreKeyMap();
258
510
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
259
511
  const rootKey = fullPathFactory();
260
512
  rootKeySet.set(rootKey, {
261
513
  namespace: keyPrefix,
262
- representationName: RepresentationType$2,
514
+ representationName: RepresentationType$3,
263
515
  mergeable: false
264
516
  });
265
517
  return rootKeySet;
266
518
  }
267
519
 
268
- function select$4(luvio, params) {
269
- return select$5();
520
+ function select$6(luvio, params) {
521
+ return select$7();
270
522
  }
271
- function keyBuilder$5(luvio, params) {
272
- return keyPrefix + '::CdpMetadataOutputRepresentation:(' + 'objectCategory:' + params.queryParams.objectCategory + ')';
523
+ function keyBuilder$7(luvio, params) {
524
+ return keyPrefix + '::EngagementEventTimelineDataRepresentation:(' + 'timelineConfigFullName:' + params.urlParams.timelineConfigFullName + ',' + 'timelineObjRecordId:' + params.urlParams.timelineObjRecordId + ')';
273
525
  }
274
- function getResponseCacheKeys$2(luvio, resourceParams, response) {
275
- return getTypeCacheKeys$2(luvio, response, () => keyBuilder$5(luvio, resourceParams));
526
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
527
+ return getTypeCacheKeys$3(luvio, response, () => keyBuilder$7(luvio, resourceParams));
276
528
  }
277
- function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
529
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
278
530
  const { body } = response;
279
- const key = keyBuilder$5(luvio, resourceParams);
280
- luvio.storeIngest(key, ingest$2, body);
531
+ const key = keyBuilder$7(luvio, resourceParams);
532
+ luvio.storeIngest(key, ingest$3, body);
281
533
  const snapshot = luvio.storeLookup({
282
534
  recordId: key,
283
- node: select$4(),
535
+ node: select$6(),
284
536
  variables: {},
285
537
  }, snapshotRefresh);
286
538
  if (process.env.NODE_ENV !== 'production') {
@@ -291,101 +543,105 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
291
543
  deepFreeze(snapshot.data);
292
544
  return snapshot;
293
545
  }
294
- function ingestError$2(luvio, params, error, snapshotRefresh) {
295
- const key = keyBuilder$5(luvio, params);
546
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
547
+ const key = keyBuilder$7(luvio, params);
296
548
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
297
549
  const storeMetadataParams = {
298
- ttl: TTL$2,
550
+ ttl: TTL$3,
299
551
  namespace: keyPrefix,
300
- version: VERSION$2,
301
- representationName: RepresentationType$2
552
+ version: VERSION$3,
553
+ representationName: RepresentationType$3
302
554
  };
303
555
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
304
556
  return errorSnapshot;
305
557
  }
306
- function createResourceRequest$2(config) {
558
+ function createResourceRequest$3(config) {
307
559
  const headers = {};
308
560
  return {
309
561
  baseUri: '/services/data/v59.0',
310
- basePath: '/connect/timeline/cust-data-pfrm/data-model-objects',
562
+ basePath: '/connect/timeline/' + config.urlParams.timelineObjRecordId + '/timeline-definitions/' + config.urlParams.timelineConfigFullName + '/cust-data-pfrm/events',
311
563
  method: 'get',
312
564
  body: null,
313
- urlParams: {},
314
- queryParams: config.queryParams,
565
+ urlParams: config.urlParams,
566
+ queryParams: {},
315
567
  headers,
316
568
  priority: 'normal',
317
569
  };
318
570
  }
319
571
 
320
- const getDataModelObjects_ConfigPropertyNames = {
321
- displayName: 'getDataModelObjects',
572
+ const getEngagementEvents_ConfigPropertyNames = {
573
+ displayName: 'getEngagementEvents',
322
574
  parameters: {
323
- required: [],
324
- optional: ['objectCategory']
575
+ required: ['timelineConfigFullName', 'timelineObjRecordId'],
576
+ optional: []
325
577
  }
326
578
  };
327
- function createResourceParams$2(config) {
579
+ function createResourceParams$3(config) {
328
580
  const resourceParams = {
329
- queryParams: {
330
- objectCategory: config.objectCategory
581
+ urlParams: {
582
+ timelineConfigFullName: config.timelineConfigFullName, timelineObjRecordId: config.timelineObjRecordId
331
583
  }
332
584
  };
333
585
  return resourceParams;
334
586
  }
335
- function keyBuilder$4(luvio, config) {
336
- const resourceParams = createResourceParams$2(config);
337
- return keyBuilder$5(luvio, resourceParams);
587
+ function keyBuilder$6(luvio, config) {
588
+ const resourceParams = createResourceParams$3(config);
589
+ return keyBuilder$7(luvio, resourceParams);
338
590
  }
339
- function typeCheckConfig$2(untrustedConfig) {
591
+ function typeCheckConfig$3(untrustedConfig) {
340
592
  const config = {};
341
- const untrustedConfig_objectCategory = untrustedConfig.objectCategory;
342
- if (typeof untrustedConfig_objectCategory === 'string') {
343
- config.objectCategory = untrustedConfig_objectCategory;
593
+ const untrustedConfig_timelineConfigFullName = untrustedConfig.timelineConfigFullName;
594
+ if (typeof untrustedConfig_timelineConfigFullName === 'string') {
595
+ config.timelineConfigFullName = untrustedConfig_timelineConfigFullName;
596
+ }
597
+ const untrustedConfig_timelineObjRecordId = untrustedConfig.timelineObjRecordId;
598
+ if (typeof untrustedConfig_timelineObjRecordId === 'string') {
599
+ config.timelineObjRecordId = untrustedConfig_timelineObjRecordId;
344
600
  }
345
601
  return config;
346
602
  }
347
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
603
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
348
604
  if (!untrustedIsObject(untrustedConfig)) {
349
605
  return null;
350
606
  }
351
607
  if (process.env.NODE_ENV !== 'production') {
352
608
  validateConfig(untrustedConfig, configPropertyNames);
353
609
  }
354
- const config = typeCheckConfig$2(untrustedConfig);
610
+ const config = typeCheckConfig$3(untrustedConfig);
355
611
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
356
612
  return null;
357
613
  }
358
614
  return config;
359
615
  }
360
- function adapterFragment$2(luvio, config) {
361
- createResourceParams$2(config);
362
- return select$4();
616
+ function adapterFragment$3(luvio, config) {
617
+ createResourceParams$3(config);
618
+ return select$6();
363
619
  }
364
- function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
365
- const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
620
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
621
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
366
622
  config,
367
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
623
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
368
624
  });
369
625
  return luvio.storeBroadcast().then(() => snapshot);
370
626
  }
371
- function onFetchResponseError$2(luvio, config, resourceParams, response) {
372
- const snapshot = ingestError$2(luvio, resourceParams, response, {
627
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
628
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
373
629
  config,
374
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
630
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
375
631
  });
376
632
  return luvio.storeBroadcast().then(() => snapshot);
377
633
  }
378
- function buildNetworkSnapshot$2(luvio, config, options) {
379
- const resourceParams = createResourceParams$2(config);
380
- const request = createResourceRequest$2(resourceParams);
634
+ function buildNetworkSnapshot$3(luvio, config, options) {
635
+ const resourceParams = createResourceParams$3(config);
636
+ const request = createResourceRequest$3(resourceParams);
381
637
  return luvio.dispatchResourceRequest(request, options)
382
638
  .then((response) => {
383
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
639
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
384
640
  }, (response) => {
385
- return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
641
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
386
642
  });
387
643
  }
388
- function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
644
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
389
645
  const { luvio, config } = context;
390
646
  const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
391
647
  const dispatchOptions = {
@@ -400,450 +656,505 @@ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext
400
656
  priority: networkPriority
401
657
  };
402
658
  }
403
- return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
659
+ return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
404
660
  }
405
- function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
661
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
406
662
  const { luvio, config } = context;
407
663
  const selector = {
408
- recordId: keyBuilder$4(luvio, config),
409
- node: adapterFragment$2(luvio, config),
664
+ recordId: keyBuilder$6(luvio, config),
665
+ node: adapterFragment$3(luvio, config),
410
666
  variables: {},
411
667
  };
412
668
  const cacheSnapshot = storeLookup(selector, {
413
669
  config,
414
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
670
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
415
671
  });
416
672
  return cacheSnapshot;
417
673
  }
418
- const getDataModelObjectsAdapterFactory = (luvio) => function Timeline__getDataModelObjects(untrustedConfig, requestContext) {
419
- const config = validateAdapterConfig$2(untrustedConfig, getDataModelObjects_ConfigPropertyNames);
674
+ const getEngagementEventsAdapterFactory = (luvio) => function Timeline__getEngagementEvents(untrustedConfig, requestContext) {
675
+ const config = validateAdapterConfig$3(untrustedConfig, getEngagementEvents_ConfigPropertyNames);
420
676
  // Invalid or incomplete config
421
677
  if (config === null) {
422
678
  return null;
423
679
  }
424
680
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
425
- buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
681
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
426
682
  };
427
683
 
428
- function validate$9(obj, path = 'TimelineErrorRepresentation') {
684
+ const TTL$2 = 500;
685
+ const VERSION$2 = "fdc9f6f24a05bf6064b5dd39db6e4e4d";
686
+ function validate$a(obj, path = 'TimelineDataGetResultRepresentation') {
429
687
  const v_error = (() => {
430
688
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
431
689
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
432
690
  }
433
- const obj_code = obj.code;
434
- const path_code = path + '.code';
435
- let obj_code_union0 = null;
436
- const obj_code_union0_error = (() => {
437
- if (typeof obj_code !== 'string') {
438
- return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
439
- }
440
- })();
441
- if (obj_code_union0_error != null) {
442
- obj_code_union0 = obj_code_union0_error.message;
443
- }
444
- let obj_code_union1 = null;
445
- const obj_code_union1_error = (() => {
446
- if (obj_code !== null) {
447
- return new TypeError('Expected "null" but received "' + typeof obj_code + '" (at "' + path_code + '")');
691
+ if (obj.errors !== undefined) {
692
+ const obj_errors = obj.errors;
693
+ const path_errors = path + '.errors';
694
+ if (!ArrayIsArray(obj_errors)) {
695
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
448
696
  }
449
- })();
450
- if (obj_code_union1_error != null) {
451
- obj_code_union1 = obj_code_union1_error.message;
452
- }
453
- if (obj_code_union0 && obj_code_union1) {
454
- let message = 'Object doesn\'t match union (at "' + path_code + '")';
455
- message += '\n' + obj_code_union0.split('\n').map((line) => '\t' + line).join('\n');
456
- message += '\n' + obj_code_union1.split('\n').map((line) => '\t' + line).join('\n');
457
- return new TypeError(message);
458
- }
459
- const obj_message = obj.message;
460
- const path_message = path + '.message';
461
- let obj_message_union0 = null;
462
- const obj_message_union0_error = (() => {
463
- if (typeof obj_message !== 'string') {
464
- return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
697
+ for (let i = 0; i < obj_errors.length; i++) {
698
+ const obj_errors_item = obj_errors[i];
699
+ const path_errors_item = path_errors + '[' + i + ']';
700
+ const referencepath_errors_itemValidationError = validate$f(obj_errors_item, path_errors_item);
701
+ if (referencepath_errors_itemValidationError !== null) {
702
+ let message = 'Object doesn\'t match TimelineErrorRepresentation (at "' + path_errors_item + '")\n';
703
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
704
+ return new TypeError(message);
705
+ }
465
706
  }
466
- })();
467
- if (obj_message_union0_error != null) {
468
- obj_message_union0 = obj_message_union0_error.message;
469
707
  }
470
- let obj_message_union1 = null;
471
- const obj_message_union1_error = (() => {
472
- if (obj_message !== null) {
473
- return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
708
+ if (obj.eventTypes !== undefined) {
709
+ const obj_eventTypes = obj.eventTypes;
710
+ const path_eventTypes = path + '.eventTypes';
711
+ if (!ArrayIsArray(obj_eventTypes)) {
712
+ return new TypeError('Expected "array" but received "' + typeof obj_eventTypes + '" (at "' + path_eventTypes + '")');
474
713
  }
475
- })();
476
- if (obj_message_union1_error != null) {
477
- obj_message_union1 = obj_message_union1_error.message;
478
- }
479
- if (obj_message_union0 && obj_message_union1) {
480
- let message = 'Object doesn\'t match union (at "' + path_message + '")';
481
- message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
482
- message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
483
- return new TypeError(message);
484
- }
485
- })();
486
- return v_error === undefined ? null : v_error;
487
- }
488
-
489
- function validate$8(obj, path = 'TimelineEventTypeRepresentation') {
490
- const v_error = (() => {
491
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
492
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
493
- }
494
- const obj_eventApiName = obj.eventApiName;
495
- const path_eventApiName = path + '.eventApiName';
496
- let obj_eventApiName_union0 = null;
497
- const obj_eventApiName_union0_error = (() => {
498
- if (typeof obj_eventApiName !== 'string') {
499
- return new TypeError('Expected "string" but received "' + typeof obj_eventApiName + '" (at "' + path_eventApiName + '")');
714
+ for (let i = 0; i < obj_eventTypes.length; i++) {
715
+ const obj_eventTypes_item = obj_eventTypes[i];
716
+ const path_eventTypes_item = path_eventTypes + '[' + i + ']';
717
+ const referencepath_eventTypes_itemValidationError = validate$e(obj_eventTypes_item, path_eventTypes_item);
718
+ if (referencepath_eventTypes_itemValidationError !== null) {
719
+ let message = 'Object doesn\'t match TimelineEventTypeRepresentation (at "' + path_eventTypes_item + '")\n';
720
+ message += referencepath_eventTypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
721
+ return new TypeError(message);
722
+ }
500
723
  }
501
- })();
502
- if (obj_eventApiName_union0_error != null) {
503
- obj_eventApiName_union0 = obj_eventApiName_union0_error.message;
504
724
  }
505
- let obj_eventApiName_union1 = null;
506
- const obj_eventApiName_union1_error = (() => {
507
- if (obj_eventApiName !== null) {
508
- return new TypeError('Expected "null" but received "' + typeof obj_eventApiName + '" (at "' + path_eventApiName + '")');
725
+ if (obj.events !== undefined) {
726
+ const obj_events = obj.events;
727
+ const path_events = path + '.events';
728
+ if (!ArrayIsArray(obj_events)) {
729
+ return new TypeError('Expected "array" but received "' + typeof obj_events + '" (at "' + path_events + '")');
509
730
  }
510
- })();
511
- if (obj_eventApiName_union1_error != null) {
512
- obj_eventApiName_union1 = obj_eventApiName_union1_error.message;
513
- }
514
- if (obj_eventApiName_union0 && obj_eventApiName_union1) {
515
- let message = 'Object doesn\'t match union (at "' + path_eventApiName + '")';
516
- message += '\n' + obj_eventApiName_union0.split('\n').map((line) => '\t' + line).join('\n');
517
- message += '\n' + obj_eventApiName_union1.split('\n').map((line) => '\t' + line).join('\n');
518
- return new TypeError(message);
519
- }
520
- const obj_offset = obj.offset;
521
- const path_offset = path + '.offset';
522
- let obj_offset_union0 = null;
523
- const obj_offset_union0_error = (() => {
524
- if (typeof obj_offset !== 'number' || (typeof obj_offset === 'number' && Math.floor(obj_offset) !== obj_offset)) {
525
- return new TypeError('Expected "integer" but received "' + typeof obj_offset + '" (at "' + path_offset + '")');
731
+ for (let i = 0; i < obj_events.length; i++) {
732
+ const obj_events_item = obj_events[i];
733
+ const path_events_item = path_events + '[' + i + ']';
734
+ const referencepath_events_itemValidationError = validate$c(obj_events_item, path_events_item);
735
+ if (referencepath_events_itemValidationError !== null) {
736
+ let message = 'Object doesn\'t match TimelineEventRepresentation (at "' + path_events_item + '")\n';
737
+ message += referencepath_events_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
738
+ return new TypeError(message);
739
+ }
526
740
  }
527
- })();
528
- if (obj_offset_union0_error != null) {
529
- obj_offset_union0 = obj_offset_union0_error.message;
530
741
  }
531
- let obj_offset_union1 = null;
532
- const obj_offset_union1_error = (() => {
533
- if (obj_offset !== null) {
534
- return new TypeError('Expected "null" but received "' + typeof obj_offset + '" (at "' + path_offset + '")');
742
+ if (obj.hasMoreData !== undefined) {
743
+ const obj_hasMoreData = obj.hasMoreData;
744
+ const path_hasMoreData = path + '.hasMoreData';
745
+ if (typeof obj_hasMoreData !== 'boolean') {
746
+ return new TypeError('Expected "boolean" but received "' + typeof obj_hasMoreData + '" (at "' + path_hasMoreData + '")');
535
747
  }
536
- })();
537
- if (obj_offset_union1_error != null) {
538
- obj_offset_union1 = obj_offset_union1_error.message;
539
748
  }
540
- if (obj_offset_union0 && obj_offset_union1) {
541
- let message = 'Object doesn\'t match union (at "' + path_offset + '")';
542
- message += '\n' + obj_offset_union0.split('\n').map((line) => '\t' + line).join('\n');
543
- message += '\n' + obj_offset_union1.split('\n').map((line) => '\t' + line).join('\n');
544
- return new TypeError(message);
749
+ if (obj.isSuccess !== undefined) {
750
+ const obj_isSuccess = obj.isSuccess;
751
+ const path_isSuccess = path + '.isSuccess';
752
+ if (typeof obj_isSuccess !== 'boolean') {
753
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
754
+ }
545
755
  }
546
756
  })();
547
757
  return v_error === undefined ? null : v_error;
548
758
  }
549
-
550
- function validate$7(obj, path = 'TimelineEventFieldRepresentation') {
551
- const v_error = (() => {
552
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
553
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
554
- }
555
- const obj_name = obj.name;
556
- const path_name = path + '.name';
557
- let obj_name_union0 = null;
558
- const obj_name_union0_error = (() => {
559
- if (typeof obj_name !== 'string') {
560
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
561
- }
562
- })();
563
- if (obj_name_union0_error != null) {
564
- obj_name_union0 = obj_name_union0_error.message;
565
- }
566
- let obj_name_union1 = null;
567
- const obj_name_union1_error = (() => {
568
- if (obj_name !== null) {
569
- return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
570
- }
571
- })();
572
- if (obj_name_union1_error != null) {
573
- obj_name_union1 = obj_name_union1_error.message;
574
- }
575
- if (obj_name_union0 && obj_name_union1) {
576
- let message = 'Object doesn\'t match union (at "' + path_name + '")';
577
- message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
578
- message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
579
- return new TypeError(message);
580
- }
581
- const obj_value = obj.value;
582
- const path_value = path + '.value';
583
- let obj_value_union0 = null;
584
- const obj_value_union0_error = (() => {
585
- if (typeof obj_value !== 'string') {
586
- return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
587
- }
588
- })();
589
- if (obj_value_union0_error != null) {
590
- obj_value_union0 = obj_value_union0_error.message;
591
- }
592
- let obj_value_union1 = null;
593
- const obj_value_union1_error = (() => {
594
- if (obj_value !== null) {
595
- return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
596
- }
597
- })();
598
- if (obj_value_union1_error != null) {
599
- obj_value_union1 = obj_value_union1_error.message;
600
- }
601
- if (obj_value_union0 && obj_value_union1) {
602
- let message = 'Object doesn\'t match union (at "' + path_value + '")';
603
- message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
604
- message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
605
- return new TypeError(message);
759
+ const RepresentationType$2 = 'TimelineDataGetResultRepresentation';
760
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
761
+ return input;
762
+ }
763
+ const select$5 = function TimelineDataGetResultRepresentationSelect() {
764
+ return {
765
+ kind: 'Fragment',
766
+ version: VERSION$2,
767
+ private: [],
768
+ opaque: true
769
+ };
770
+ };
771
+ function equals$2(existing, incoming) {
772
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
773
+ return false;
774
+ }
775
+ return true;
776
+ }
777
+ const ingest$2 = function TimelineDataGetResultRepresentationIngest(input, path, luvio, store, timestamp) {
778
+ if (process.env.NODE_ENV !== 'production') {
779
+ const validateError = validate$a(input);
780
+ if (validateError !== null) {
781
+ throw validateError;
606
782
  }
607
- })();
608
- return v_error === undefined ? null : v_error;
783
+ }
784
+ const key = path.fullPath;
785
+ const existingRecord = store.readEntry(key);
786
+ const ttlToUse = TTL$2;
787
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
788
+ fullPath: key,
789
+ parent: path.parent,
790
+ propertyName: path.propertyName,
791
+ ttl: ttlToUse
792
+ });
793
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
794
+ luvio.storePublish(key, incomingRecord);
795
+ }
796
+ {
797
+ const storeMetadataParams = {
798
+ ttl: ttlToUse,
799
+ namespace: "Timeline",
800
+ version: VERSION$2,
801
+ representationName: RepresentationType$2,
802
+ };
803
+ luvio.publishStoreMetadata(key, storeMetadataParams);
804
+ }
805
+ return createLink(key);
806
+ };
807
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
808
+ const rootKeySet = new StoreKeyMap();
809
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
810
+ const rootKey = fullPathFactory();
811
+ rootKeySet.set(rootKey, {
812
+ namespace: keyPrefix,
813
+ representationName: RepresentationType$2,
814
+ mergeable: false
815
+ });
816
+ return rootKeySet;
609
817
  }
610
818
 
611
- function validate$6(obj, path = 'TimelineEventRepresentation') {
612
- const v_error = (() => {
613
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
614
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
615
- }
616
- const obj_description = obj.description;
617
- const path_description = path + '.description';
618
- let obj_description_union0 = null;
619
- const obj_description_union0_error = (() => {
620
- if (typeof obj_description !== 'string') {
621
- return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
622
- }
623
- })();
624
- if (obj_description_union0_error != null) {
625
- obj_description_union0 = obj_description_union0_error.message;
626
- }
627
- let obj_description_union1 = null;
628
- const obj_description_union1_error = (() => {
629
- if (obj_description !== null) {
630
- return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
631
- }
632
- })();
633
- if (obj_description_union1_error != null) {
634
- obj_description_union1 = obj_description_union1_error.message;
635
- }
636
- if (obj_description_union0 && obj_description_union1) {
637
- let message = 'Object doesn\'t match union (at "' + path_description + '")';
638
- message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
639
- message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
640
- return new TypeError(message);
641
- }
642
- const obj_eventDateTime = obj.eventDateTime;
643
- const path_eventDateTime = path + '.eventDateTime';
644
- let obj_eventDateTime_union0 = null;
645
- const obj_eventDateTime_union0_error = (() => {
646
- if (typeof obj_eventDateTime !== 'string') {
647
- return new TypeError('Expected "string" but received "' + typeof obj_eventDateTime + '" (at "' + path_eventDateTime + '")');
648
- }
649
- })();
650
- if (obj_eventDateTime_union0_error != null) {
651
- obj_eventDateTime_union0 = obj_eventDateTime_union0_error.message;
652
- }
653
- let obj_eventDateTime_union1 = null;
654
- const obj_eventDateTime_union1_error = (() => {
655
- if (obj_eventDateTime !== null) {
656
- return new TypeError('Expected "null" but received "' + typeof obj_eventDateTime + '" (at "' + path_eventDateTime + '")');
657
- }
658
- })();
659
- if (obj_eventDateTime_union1_error != null) {
660
- obj_eventDateTime_union1 = obj_eventDateTime_union1_error.message;
661
- }
662
- if (obj_eventDateTime_union0 && obj_eventDateTime_union1) {
663
- let message = 'Object doesn\'t match union (at "' + path_eventDateTime + '")';
664
- message += '\n' + obj_eventDateTime_union0.split('\n').map((line) => '\t' + line).join('\n');
665
- message += '\n' + obj_eventDateTime_union1.split('\n').map((line) => '\t' + line).join('\n');
666
- return new TypeError(message);
667
- }
668
- if (obj.fields !== undefined) {
669
- const obj_fields = obj.fields;
670
- const path_fields = path + '.fields';
671
- if (!ArrayIsArray(obj_fields)) {
672
- return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
673
- }
674
- for (let i = 0; i < obj_fields.length; i++) {
675
- const obj_fields_item = obj_fields[i];
676
- const path_fields_item = path_fields + '[' + i + ']';
677
- const referencepath_fields_itemValidationError = validate$7(obj_fields_item, path_fields_item);
678
- if (referencepath_fields_itemValidationError !== null) {
679
- let message = 'Object doesn\'t match TimelineEventFieldRepresentation (at "' + path_fields_item + '")\n';
680
- message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
681
- return new TypeError(message);
682
- }
683
- }
684
- }
685
- const obj_id = obj.id;
686
- const path_id = path + '.id';
687
- let obj_id_union0 = null;
688
- const obj_id_union0_error = (() => {
689
- if (typeof obj_id !== 'string') {
690
- return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
691
- }
692
- })();
693
- if (obj_id_union0_error != null) {
694
- obj_id_union0 = obj_id_union0_error.message;
695
- }
696
- let obj_id_union1 = null;
697
- const obj_id_union1_error = (() => {
698
- if (obj_id !== null) {
699
- return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
700
- }
701
- })();
702
- if (obj_id_union1_error != null) {
703
- obj_id_union1 = obj_id_union1_error.message;
819
+ function select$4(luvio, params) {
820
+ return select$5();
821
+ }
822
+ function keyBuilder$5(luvio, params) {
823
+ 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 + ')';
824
+ }
825
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
826
+ return getTypeCacheKeys$2(luvio, response, () => keyBuilder$5(luvio, resourceParams));
827
+ }
828
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
829
+ const { body } = response;
830
+ const key = keyBuilder$5(luvio, resourceParams);
831
+ luvio.storeIngest(key, ingest$2, body);
832
+ const snapshot = luvio.storeLookup({
833
+ recordId: key,
834
+ node: select$4(),
835
+ variables: {},
836
+ }, snapshotRefresh);
837
+ if (process.env.NODE_ENV !== 'production') {
838
+ if (snapshot.state !== 'Fulfilled') {
839
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
704
840
  }
705
- if (obj_id_union0 && obj_id_union1) {
706
- let message = 'Object doesn\'t match union (at "' + path_id + '")';
707
- message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
708
- message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
709
- return new TypeError(message);
841
+ }
842
+ deepFreeze(snapshot.data);
843
+ return snapshot;
844
+ }
845
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
846
+ const key = keyBuilder$5(luvio, params);
847
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
848
+ const storeMetadataParams = {
849
+ ttl: TTL$2,
850
+ namespace: keyPrefix,
851
+ version: VERSION$2,
852
+ representationName: RepresentationType$2
853
+ };
854
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
855
+ return errorSnapshot;
856
+ }
857
+ function createResourceRequest$2(config) {
858
+ const headers = {};
859
+ return {
860
+ baseUri: '/services/data/v59.0',
861
+ basePath: '/connect/timeline/' + config.urlParams.timelineObjRecordId + '/timeline-definitions/' + config.urlParams.timelineConfigFullName + '/events',
862
+ method: 'get',
863
+ body: null,
864
+ urlParams: config.urlParams,
865
+ queryParams: config.queryParams,
866
+ headers,
867
+ priority: 'normal',
868
+ };
869
+ }
870
+
871
+ const getTimelineData_ConfigPropertyNames = {
872
+ displayName: 'getTimelineData',
873
+ parameters: {
874
+ required: ['timelineConfigFullName', 'timelineObjRecordId'],
875
+ optional: ['direction', 'endDate', 'eventTypeOffsets', 'eventTypes', 'startDate']
876
+ }
877
+ };
878
+ function createResourceParams$2(config) {
879
+ const resourceParams = {
880
+ urlParams: {
881
+ timelineConfigFullName: config.timelineConfigFullName, timelineObjRecordId: config.timelineObjRecordId
882
+ },
883
+ queryParams: {
884
+ direction: config.direction, endDate: config.endDate, eventTypeOffsets: config.eventTypeOffsets, eventTypes: config.eventTypes, startDate: config.startDate
710
885
  }
711
- const obj_title = obj.title;
712
- const path_title = path + '.title';
713
- let obj_title_union0 = null;
714
- const obj_title_union0_error = (() => {
715
- if (typeof obj_title !== 'string') {
716
- return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
717
- }
718
- })();
719
- if (obj_title_union0_error != null) {
720
- obj_title_union0 = obj_title_union0_error.message;
886
+ };
887
+ return resourceParams;
888
+ }
889
+ function keyBuilder$4(luvio, config) {
890
+ const resourceParams = createResourceParams$2(config);
891
+ return keyBuilder$5(luvio, resourceParams);
892
+ }
893
+ function typeCheckConfig$2(untrustedConfig) {
894
+ const config = {};
895
+ const untrustedConfig_timelineConfigFullName = untrustedConfig.timelineConfigFullName;
896
+ if (typeof untrustedConfig_timelineConfigFullName === 'string') {
897
+ config.timelineConfigFullName = untrustedConfig_timelineConfigFullName;
898
+ }
899
+ const untrustedConfig_timelineObjRecordId = untrustedConfig.timelineObjRecordId;
900
+ if (typeof untrustedConfig_timelineObjRecordId === 'string') {
901
+ config.timelineObjRecordId = untrustedConfig_timelineObjRecordId;
902
+ }
903
+ const untrustedConfig_direction = untrustedConfig.direction;
904
+ if (typeof untrustedConfig_direction === 'string') {
905
+ config.direction = untrustedConfig_direction;
906
+ }
907
+ const untrustedConfig_endDate = untrustedConfig.endDate;
908
+ if (typeof untrustedConfig_endDate === 'string') {
909
+ config.endDate = untrustedConfig_endDate;
910
+ }
911
+ const untrustedConfig_eventTypeOffsets = untrustedConfig.eventTypeOffsets;
912
+ if (typeof untrustedConfig_eventTypeOffsets === 'string') {
913
+ config.eventTypeOffsets = untrustedConfig_eventTypeOffsets;
914
+ }
915
+ const untrustedConfig_eventTypes = untrustedConfig.eventTypes;
916
+ if (typeof untrustedConfig_eventTypes === 'string') {
917
+ config.eventTypes = untrustedConfig_eventTypes;
918
+ }
919
+ const untrustedConfig_startDate = untrustedConfig.startDate;
920
+ if (typeof untrustedConfig_startDate === 'string') {
921
+ config.startDate = untrustedConfig_startDate;
922
+ }
923
+ return config;
924
+ }
925
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
926
+ if (!untrustedIsObject(untrustedConfig)) {
927
+ return null;
928
+ }
929
+ if (process.env.NODE_ENV !== 'production') {
930
+ validateConfig(untrustedConfig, configPropertyNames);
931
+ }
932
+ const config = typeCheckConfig$2(untrustedConfig);
933
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
934
+ return null;
935
+ }
936
+ return config;
937
+ }
938
+ function adapterFragment$2(luvio, config) {
939
+ createResourceParams$2(config);
940
+ return select$4();
941
+ }
942
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
943
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
944
+ config,
945
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
946
+ });
947
+ return luvio.storeBroadcast().then(() => snapshot);
948
+ }
949
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
950
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
951
+ config,
952
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
953
+ });
954
+ return luvio.storeBroadcast().then(() => snapshot);
955
+ }
956
+ function buildNetworkSnapshot$2(luvio, config, options) {
957
+ const resourceParams = createResourceParams$2(config);
958
+ const request = createResourceRequest$2(resourceParams);
959
+ return luvio.dispatchResourceRequest(request, options)
960
+ .then((response) => {
961
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
962
+ }, (response) => {
963
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
964
+ });
965
+ }
966
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
967
+ const { luvio, config } = context;
968
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
969
+ const dispatchOptions = {
970
+ resourceRequestContext: {
971
+ requestCorrelator,
972
+ luvioRequestMethod: undefined,
973
+ },
974
+ eventObservers
975
+ };
976
+ if (networkPriority !== 'normal') {
977
+ dispatchOptions.overrides = {
978
+ priority: networkPriority
979
+ };
980
+ }
981
+ return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
982
+ }
983
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
984
+ const { luvio, config } = context;
985
+ const selector = {
986
+ recordId: keyBuilder$4(luvio, config),
987
+ node: adapterFragment$2(luvio, config),
988
+ variables: {},
989
+ };
990
+ const cacheSnapshot = storeLookup(selector, {
991
+ config,
992
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
993
+ });
994
+ return cacheSnapshot;
995
+ }
996
+ const getTimelineDataAdapterFactory = (luvio) => function Timeline__getTimelineData(untrustedConfig, requestContext) {
997
+ const config = validateAdapterConfig$2(untrustedConfig, getTimelineData_ConfigPropertyNames);
998
+ // Invalid or incomplete config
999
+ if (config === null) {
1000
+ return null;
1001
+ }
1002
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1003
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
1004
+ };
1005
+
1006
+ function validate$9(obj, path = 'DmoFieldsOutputRepresentation') {
1007
+ const v_error = (() => {
1008
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1009
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
721
1010
  }
722
- let obj_title_union1 = null;
723
- const obj_title_union1_error = (() => {
724
- if (obj_title !== null) {
725
- return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
726
- }
727
- })();
728
- if (obj_title_union1_error != null) {
729
- obj_title_union1 = obj_title_union1_error.message;
1011
+ const obj_displayName = obj.displayName;
1012
+ const path_displayName = path + '.displayName';
1013
+ if (typeof obj_displayName !== 'string') {
1014
+ return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
730
1015
  }
731
- if (obj_title_union0 && obj_title_union1) {
732
- let message = 'Object doesn\'t match union (at "' + path_title + '")';
733
- message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
734
- message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
735
- return new TypeError(message);
1016
+ const obj_name = obj.name;
1017
+ const path_name = path + '.name';
1018
+ if (typeof obj_name !== 'string') {
1019
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
736
1020
  }
737
1021
  const obj_type = obj.type;
738
1022
  const path_type = path + '.type';
739
- let obj_type_union0 = null;
740
- const obj_type_union0_error = (() => {
741
- if (typeof obj_type !== 'string') {
742
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
743
- }
744
- })();
745
- if (obj_type_union0_error != null) {
746
- obj_type_union0 = obj_type_union0_error.message;
1023
+ if (typeof obj_type !== 'string') {
1024
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
747
1025
  }
748
- let obj_type_union1 = null;
749
- const obj_type_union1_error = (() => {
750
- if (obj_type !== null) {
751
- return new TypeError('Expected "null" but received "' + typeof obj_type + '" (at "' + path_type + '")');
752
- }
753
- })();
754
- if (obj_type_union1_error != null) {
755
- obj_type_union1 = obj_type_union1_error.message;
1026
+ })();
1027
+ return v_error === undefined ? null : v_error;
1028
+ }
1029
+
1030
+ function validate$8(obj, path = 'RelationshipTypeOutputRepresentation') {
1031
+ const v_error = (() => {
1032
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1033
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
756
1034
  }
757
- if (obj_type_union0 && obj_type_union1) {
758
- let message = 'Object doesn\'t match union (at "' + path_type + '")';
759
- message += '\n' + obj_type_union0.split('\n').map((line) => '\t' + line).join('\n');
760
- message += '\n' + obj_type_union1.split('\n').map((line) => '\t' + line).join('\n');
1035
+ const obj_attribute = obj.attribute;
1036
+ const path_attribute = path + '.attribute';
1037
+ if (typeof obj_attribute !== 'string') {
1038
+ return new TypeError('Expected "string" but received "' + typeof obj_attribute + '" (at "' + path_attribute + '")');
1039
+ }
1040
+ const obj_name = obj.name;
1041
+ const path_name = path + '.name';
1042
+ if (typeof obj_name !== 'string') {
1043
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1044
+ }
1045
+ })();
1046
+ return v_error === undefined ? null : v_error;
1047
+ }
1048
+
1049
+ function validate$7(obj, path = 'DmoRelationshipsOutputRepresentation') {
1050
+ const v_error = (() => {
1051
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1052
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1053
+ }
1054
+ const obj_fromEntity = obj.fromEntity;
1055
+ const path_fromEntity = path + '.fromEntity';
1056
+ const referencepath_fromEntityValidationError = validate$8(obj_fromEntity, path_fromEntity);
1057
+ if (referencepath_fromEntityValidationError !== null) {
1058
+ let message = 'Object doesn\'t match RelationshipTypeOutputRepresentation (at "' + path_fromEntity + '")\n';
1059
+ message += referencepath_fromEntityValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1060
+ return new TypeError(message);
1061
+ }
1062
+ const obj_toEntity = obj.toEntity;
1063
+ const path_toEntity = path + '.toEntity';
1064
+ const referencepath_toEntityValidationError = validate$8(obj_toEntity, path_toEntity);
1065
+ if (referencepath_toEntityValidationError !== null) {
1066
+ let message = 'Object doesn\'t match RelationshipTypeOutputRepresentation (at "' + path_toEntity + '")\n';
1067
+ message += referencepath_toEntityValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
761
1068
  return new TypeError(message);
762
1069
  }
763
1070
  })();
764
1071
  return v_error === undefined ? null : v_error;
765
1072
  }
766
1073
 
767
- const TTL$1 = 500;
768
- const VERSION$1 = "fdc9f6f24a05bf6064b5dd39db6e4e4d";
769
- function validate$5(obj, path = 'TimelineDataGetResultRepresentation') {
1074
+ function validate$6(obj, path = 'DmoOutputRepresentation') {
770
1075
  const v_error = (() => {
771
1076
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
772
1077
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
773
1078
  }
774
- if (obj.errors !== undefined) {
775
- const obj_errors = obj.errors;
776
- const path_errors = path + '.errors';
777
- if (!ArrayIsArray(obj_errors)) {
778
- return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
779
- }
780
- for (let i = 0; i < obj_errors.length; i++) {
781
- const obj_errors_item = obj_errors[i];
782
- const path_errors_item = path_errors + '[' + i + ']';
783
- const referencepath_errors_itemValidationError = validate$9(obj_errors_item, path_errors_item);
784
- if (referencepath_errors_itemValidationError !== null) {
785
- let message = 'Object doesn\'t match TimelineErrorRepresentation (at "' + path_errors_item + '")\n';
786
- message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
787
- return new TypeError(message);
788
- }
789
- }
1079
+ const obj_category = obj.category;
1080
+ const path_category = path + '.category';
1081
+ if (typeof obj_category !== 'string') {
1082
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
790
1083
  }
791
- if (obj.eventTypes !== undefined) {
792
- const obj_eventTypes = obj.eventTypes;
793
- const path_eventTypes = path + '.eventTypes';
794
- if (!ArrayIsArray(obj_eventTypes)) {
795
- return new TypeError('Expected "array" but received "' + typeof obj_eventTypes + '" (at "' + path_eventTypes + '")');
796
- }
797
- for (let i = 0; i < obj_eventTypes.length; i++) {
798
- const obj_eventTypes_item = obj_eventTypes[i];
799
- const path_eventTypes_item = path_eventTypes + '[' + i + ']';
800
- const referencepath_eventTypes_itemValidationError = validate$8(obj_eventTypes_item, path_eventTypes_item);
801
- if (referencepath_eventTypes_itemValidationError !== null) {
802
- let message = 'Object doesn\'t match TimelineEventTypeRepresentation (at "' + path_eventTypes_item + '")\n';
803
- message += referencepath_eventTypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
804
- return new TypeError(message);
805
- }
806
- }
1084
+ const obj_displayName = obj.displayName;
1085
+ const path_displayName = path + '.displayName';
1086
+ if (typeof obj_displayName !== 'string') {
1087
+ return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
807
1088
  }
808
- if (obj.events !== undefined) {
809
- const obj_events = obj.events;
810
- const path_events = path + '.events';
811
- if (!ArrayIsArray(obj_events)) {
812
- return new TypeError('Expected "array" but received "' + typeof obj_events + '" (at "' + path_events + '")');
813
- }
814
- for (let i = 0; i < obj_events.length; i++) {
815
- const obj_events_item = obj_events[i];
816
- const path_events_item = path_events + '[' + i + ']';
817
- const referencepath_events_itemValidationError = validate$6(obj_events_item, path_events_item);
818
- if (referencepath_events_itemValidationError !== null) {
819
- let message = 'Object doesn\'t match TimelineEventRepresentation (at "' + path_events_item + '")\n';
820
- message += referencepath_events_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
821
- return new TypeError(message);
822
- }
1089
+ const obj_fields = obj.fields;
1090
+ const path_fields = path + '.fields';
1091
+ if (!ArrayIsArray(obj_fields)) {
1092
+ return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
1093
+ }
1094
+ for (let i = 0; i < obj_fields.length; i++) {
1095
+ const obj_fields_item = obj_fields[i];
1096
+ const path_fields_item = path_fields + '[' + i + ']';
1097
+ const referencepath_fields_itemValidationError = validate$9(obj_fields_item, path_fields_item);
1098
+ if (referencepath_fields_itemValidationError !== null) {
1099
+ let message = 'Object doesn\'t match DmoFieldsOutputRepresentation (at "' + path_fields_item + '")\n';
1100
+ message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1101
+ return new TypeError(message);
823
1102
  }
824
1103
  }
825
- if (obj.hasMoreData !== undefined) {
826
- const obj_hasMoreData = obj.hasMoreData;
827
- const path_hasMoreData = path + '.hasMoreData';
828
- if (typeof obj_hasMoreData !== 'boolean') {
829
- return new TypeError('Expected "boolean" but received "' + typeof obj_hasMoreData + '" (at "' + path_hasMoreData + '")');
1104
+ const obj_name = obj.name;
1105
+ const path_name = path + '.name';
1106
+ if (typeof obj_name !== 'string') {
1107
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1108
+ }
1109
+ const obj_relationships = obj.relationships;
1110
+ const path_relationships = path + '.relationships';
1111
+ if (!ArrayIsArray(obj_relationships)) {
1112
+ return new TypeError('Expected "array" but received "' + typeof obj_relationships + '" (at "' + path_relationships + '")');
1113
+ }
1114
+ for (let i = 0; i < obj_relationships.length; i++) {
1115
+ const obj_relationships_item = obj_relationships[i];
1116
+ const path_relationships_item = path_relationships + '[' + i + ']';
1117
+ const referencepath_relationships_itemValidationError = validate$7(obj_relationships_item, path_relationships_item);
1118
+ if (referencepath_relationships_itemValidationError !== null) {
1119
+ let message = 'Object doesn\'t match DmoRelationshipsOutputRepresentation (at "' + path_relationships_item + '")\n';
1120
+ message += referencepath_relationships_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1121
+ return new TypeError(message);
830
1122
  }
831
1123
  }
832
- if (obj.isSuccess !== undefined) {
833
- const obj_isSuccess = obj.isSuccess;
834
- const path_isSuccess = path + '.isSuccess';
835
- if (typeof obj_isSuccess !== 'boolean') {
836
- return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
1124
+ })();
1125
+ return v_error === undefined ? null : v_error;
1126
+ }
1127
+
1128
+ const TTL$1 = 600000;
1129
+ const VERSION$1 = "84ccc17f91013e292e7b01a291dd0322";
1130
+ function validate$5(obj, path = 'CdpMetadataOutputRepresentation') {
1131
+ const v_error = (() => {
1132
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1133
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1134
+ }
1135
+ const obj_dmos = obj.dmos;
1136
+ const path_dmos = path + '.dmos';
1137
+ if (!ArrayIsArray(obj_dmos)) {
1138
+ return new TypeError('Expected "array" but received "' + typeof obj_dmos + '" (at "' + path_dmos + '")');
1139
+ }
1140
+ for (let i = 0; i < obj_dmos.length; i++) {
1141
+ const obj_dmos_item = obj_dmos[i];
1142
+ const path_dmos_item = path_dmos + '[' + i + ']';
1143
+ const referencepath_dmos_itemValidationError = validate$6(obj_dmos_item, path_dmos_item);
1144
+ if (referencepath_dmos_itemValidationError !== null) {
1145
+ let message = 'Object doesn\'t match DmoOutputRepresentation (at "' + path_dmos_item + '")\n';
1146
+ message += referencepath_dmos_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1147
+ return new TypeError(message);
837
1148
  }
838
1149
  }
839
1150
  })();
840
1151
  return v_error === undefined ? null : v_error;
841
1152
  }
842
- const RepresentationType$1 = 'TimelineDataGetResultRepresentation';
1153
+ const RepresentationType$1 = 'CdpMetadataOutputRepresentation';
843
1154
  function normalize$1(input, existing, path, luvio, store, timestamp) {
844
1155
  return input;
845
1156
  }
846
- const select$3 = function TimelineDataGetResultRepresentationSelect() {
1157
+ const select$3 = function CdpMetadataOutputRepresentationSelect() {
847
1158
  return {
848
1159
  kind: 'Fragment',
849
1160
  version: VERSION$1,
@@ -857,7 +1168,7 @@ function equals$1(existing, incoming) {
857
1168
  }
858
1169
  return true;
859
1170
  }
860
- const ingest$1 = function TimelineDataGetResultRepresentationIngest(input, path, luvio, store, timestamp) {
1171
+ const ingest$1 = function CdpMetadataOutputRepresentationIngest(input, path, luvio, store, timestamp) {
861
1172
  if (process.env.NODE_ENV !== 'production') {
862
1173
  const validateError = validate$5(input);
863
1174
  if (validateError !== null) {
@@ -903,7 +1214,7 @@ function select$2(luvio, params) {
903
1214
  return select$3();
904
1215
  }
905
1216
  function keyBuilder$3(luvio, params) {
906
- 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 + ')';
1217
+ return keyPrefix + '::CdpMetadataOutputRepresentation:(' + 'objectCategory:' + params.queryParams.objectCategory + ')';
907
1218
  }
908
1219
  function getResponseCacheKeys$1(luvio, resourceParams, response) {
909
1220
  return getTypeCacheKeys$1(luvio, response, () => keyBuilder$3(luvio, resourceParams));
@@ -941,30 +1252,27 @@ function createResourceRequest$1(config) {
941
1252
  const headers = {};
942
1253
  return {
943
1254
  baseUri: '/services/data/v59.0',
944
- basePath: '/connect/timeline/' + config.urlParams.timelineObjRecordId + '/timeline-definitions/' + config.urlParams.timelineConfigFullName + '/events',
1255
+ basePath: '/connect/timeline/cust-data-pfrm/data-model-objects',
945
1256
  method: 'get',
946
1257
  body: null,
947
- urlParams: config.urlParams,
1258
+ urlParams: {},
948
1259
  queryParams: config.queryParams,
949
1260
  headers,
950
1261
  priority: 'normal',
951
1262
  };
952
1263
  }
953
1264
 
954
- const getTimelineData_ConfigPropertyNames = {
955
- displayName: 'getTimelineData',
1265
+ const getDataModelObjects_ConfigPropertyNames = {
1266
+ displayName: 'getDataModelObjects',
956
1267
  parameters: {
957
- required: ['timelineConfigFullName', 'timelineObjRecordId'],
958
- optional: ['direction', 'endDate', 'eventTypeOffsets', 'eventTypes', 'startDate']
1268
+ required: [],
1269
+ optional: ['objectCategory']
959
1270
  }
960
1271
  };
961
1272
  function createResourceParams$1(config) {
962
1273
  const resourceParams = {
963
- urlParams: {
964
- timelineConfigFullName: config.timelineConfigFullName, timelineObjRecordId: config.timelineObjRecordId
965
- },
966
1274
  queryParams: {
967
- direction: config.direction, endDate: config.endDate, eventTypeOffsets: config.eventTypeOffsets, eventTypes: config.eventTypes, startDate: config.startDate
1275
+ objectCategory: config.objectCategory
968
1276
  }
969
1277
  };
970
1278
  return resourceParams;
@@ -975,33 +1283,9 @@ function keyBuilder$2(luvio, config) {
975
1283
  }
976
1284
  function typeCheckConfig$1(untrustedConfig) {
977
1285
  const config = {};
978
- const untrustedConfig_timelineConfigFullName = untrustedConfig.timelineConfigFullName;
979
- if (typeof untrustedConfig_timelineConfigFullName === 'string') {
980
- config.timelineConfigFullName = untrustedConfig_timelineConfigFullName;
981
- }
982
- const untrustedConfig_timelineObjRecordId = untrustedConfig.timelineObjRecordId;
983
- if (typeof untrustedConfig_timelineObjRecordId === 'string') {
984
- config.timelineObjRecordId = untrustedConfig_timelineObjRecordId;
985
- }
986
- const untrustedConfig_direction = untrustedConfig.direction;
987
- if (typeof untrustedConfig_direction === 'string') {
988
- config.direction = untrustedConfig_direction;
989
- }
990
- const untrustedConfig_endDate = untrustedConfig.endDate;
991
- if (typeof untrustedConfig_endDate === 'string') {
992
- config.endDate = untrustedConfig_endDate;
993
- }
994
- const untrustedConfig_eventTypeOffsets = untrustedConfig.eventTypeOffsets;
995
- if (typeof untrustedConfig_eventTypeOffsets === 'string') {
996
- config.eventTypeOffsets = untrustedConfig_eventTypeOffsets;
997
- }
998
- const untrustedConfig_eventTypes = untrustedConfig.eventTypes;
999
- if (typeof untrustedConfig_eventTypes === 'string') {
1000
- config.eventTypes = untrustedConfig_eventTypes;
1001
- }
1002
- const untrustedConfig_startDate = untrustedConfig.startDate;
1003
- if (typeof untrustedConfig_startDate === 'string') {
1004
- config.startDate = untrustedConfig_startDate;
1286
+ const untrustedConfig_objectCategory = untrustedConfig.objectCategory;
1287
+ if (typeof untrustedConfig_objectCategory === 'string') {
1288
+ config.objectCategory = untrustedConfig_objectCategory;
1005
1289
  }
1006
1290
  return config;
1007
1291
  }
@@ -1076,8 +1360,8 @@ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1076
1360
  });
1077
1361
  return cacheSnapshot;
1078
1362
  }
1079
- const getTimelineDataAdapterFactory = (luvio) => function Timeline__getTimelineData(untrustedConfig, requestContext) {
1080
- const config = validateAdapterConfig$1(untrustedConfig, getTimelineData_ConfigPropertyNames);
1363
+ const getDataModelObjectsAdapterFactory = (luvio) => function Timeline__getDataModelObjects(untrustedConfig, requestContext) {
1364
+ const config = validateAdapterConfig$1(untrustedConfig, getDataModelObjects_ConfigPropertyNames);
1081
1365
  // Invalid or incomplete config
1082
1366
  if (config === null) {
1083
1367
  return null;
@@ -1608,7 +1892,7 @@ function validate(obj, path = 'TimelineMetadataResultRepresentation') {
1608
1892
  for (let i = 0; i < obj_errors.length; i++) {
1609
1893
  const obj_errors_item = obj_errors[i];
1610
1894
  const path_errors_item = path_errors + '[' + i + ']';
1611
- const referencepath_errors_itemValidationError = validate$9(obj_errors_item, path_errors_item);
1895
+ const referencepath_errors_itemValidationError = validate$f(obj_errors_item, path_errors_item);
1612
1896
  if (referencepath_errors_itemValidationError !== null) {
1613
1897
  let message = 'Object doesn\'t match TimelineErrorRepresentation (at "' + path_errors_item + '")\n';
1614
1898
  message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1872,4 +2156,4 @@ const getTimelineMetadataAdapterFactory = (luvio) => function Timeline__getTimel
1872
2156
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1873
2157
  };
1874
2158
 
1875
- export { getDataModelObjectsAdapterFactory, getTimelineDataAdapterFactory, getTimelineMetadataAdapterFactory };
2159
+ export { getDataModelObjectsAdapterFactory, getEngagementEventsAdapterFactory, getTimelineDataAdapterFactory, getTimelineMetadataAdapterFactory };