@salesforce/lds-adapters-industries-audit-trail-export 1.114.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.
Files changed (70) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-audit-trail-export.js +980 -0
  3. package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
  4. package/dist/types/src/generated/adapters/createAuditTrailFileExport.d.ts +15 -0
  5. package/dist/types/src/generated/adapters/deleteAuditTrailFileExport.d.ts +13 -0
  6. package/dist/types/src/generated/adapters/getAuditTrailFileExport.d.ts +26 -0
  7. package/dist/types/src/generated/adapters/getAuditTrailFileExports.d.ts +25 -0
  8. package/dist/types/src/generated/artifacts/main.d.ts +4 -0
  9. package/dist/types/src/generated/artifacts/sfdc.d.ts +7 -0
  10. package/dist/types/src/generated/resources/deleteConnectServiceExcellenceAuditTrailExportsByRequestIdentifier.d.ts +12 -0
  11. package/dist/types/src/generated/resources/deleteConnectServiceExcellenceEngagementInteractions.d.ts +8 -0
  12. package/dist/types/src/generated/resources/deleteConnectServiceExcellenceEngagementInteractionsByEngagementInteractionId.d.ts +11 -0
  13. package/dist/types/src/generated/resources/getConnectServiceExcellenceAuditTrailExports.d.ts +12 -0
  14. package/dist/types/src/generated/resources/getConnectServiceExcellenceAuditTrailExportsByRequestIdentifier.d.ts +15 -0
  15. package/dist/types/src/generated/resources/getConnectServiceExcellenceAuditTrailExportsDownloadByRequestIdentifier.d.ts +15 -0
  16. package/dist/types/src/generated/resources/getConnectServiceExcellenceEngagementInteractions.d.ts +12 -0
  17. package/dist/types/src/generated/resources/getConnectServiceExcellenceEngagementInteractionsByEngagementInteractionId.d.ts +15 -0
  18. package/dist/types/src/generated/resources/getConnectServiceExcellenceServiceCatalogItemsByRecordId.d.ts +18 -0
  19. package/dist/types/src/generated/resources/getConnectServiceExcellenceServiceCatalogItemsRecentActions.d.ts +16 -0
  20. package/dist/types/src/generated/resources/postConnectServiceExcellenceAuditTrailExports.d.ts +13 -0
  21. package/dist/types/src/generated/resources/postConnectServiceExcellenceEngagementInteractions.d.ts +12 -0
  22. package/dist/types/src/generated/resources/postConnectServiceExcellenceEngagementInteractionsByEngagementInteractionId.d.ts +15 -0
  23. package/dist/types/src/generated/resources/postConnectServiceExcellenceServiceCatalogItemsActionLaunch.d.ts +15 -0
  24. package/dist/types/src/generated/types/ActionLaunchInputRepresentation.d.ts +38 -0
  25. package/dist/types/src/generated/types/ActionLaunchStatusRepresentation.d.ts +32 -0
  26. package/dist/types/src/generated/types/AuditTrailExportInputRepresentation.d.ts +44 -0
  27. package/dist/types/src/generated/types/AuditTrailExportListOutputRepresentation.d.ts +31 -0
  28. package/dist/types/src/generated/types/AuditTrailExportOutputRepresentation.d.ts +57 -0
  29. package/dist/types/src/generated/types/AuditTrailFileDownloadOutputRepresentation.d.ts +31 -0
  30. package/dist/types/src/generated/types/AuditTrailFileExportInputRepresentation.d.ts +30 -0
  31. package/dist/types/src/generated/types/AuditTrailLogOutputRepresentation.d.ts +50 -0
  32. package/dist/types/src/generated/types/CustomFieldOutputRepresentation.d.ts +32 -0
  33. package/dist/types/src/generated/types/CustomFieldsInputRepresentation.d.ts +32 -0
  34. package/dist/types/src/generated/types/CustomFieldsListInputRepresentation.d.ts +29 -0
  35. package/dist/types/src/generated/types/EngagementAttendeeCreateInputRepresentation.d.ts +62 -0
  36. package/dist/types/src/generated/types/EngagementAttendeeCreateOutputRepresentation.d.ts +32 -0
  37. package/dist/types/src/generated/types/EngagementAttendeeFetchOutputRepresentation.d.ts +32 -0
  38. package/dist/types/src/generated/types/EngagementAttendeeListInputRepresentation.d.ts +29 -0
  39. package/dist/types/src/generated/types/EngagementAttendeeOutputRepresentation.d.ts +63 -0
  40. package/dist/types/src/generated/types/EngagementInteractionCreateInputRepresentation.d.ts +83 -0
  41. package/dist/types/src/generated/types/EngagementInteractionCreateOutputRepresentation.d.ts +32 -0
  42. package/dist/types/src/generated/types/EngagementInteractionFetchOutputRepresentation.d.ts +32 -0
  43. package/dist/types/src/generated/types/EngagementInteractionIdsCreateOutputRepresentation.d.ts +36 -0
  44. package/dist/types/src/generated/types/EngagementInteractionOutputRepresentation.d.ts +92 -0
  45. package/dist/types/src/generated/types/EngagementInteractionUpdateInputRepresentation.d.ts +77 -0
  46. package/dist/types/src/generated/types/EngagementInteractionUpdateOutputRepresentation.d.ts +38 -0
  47. package/dist/types/src/generated/types/EngagementTopicCreateInputRepresentation.d.ts +65 -0
  48. package/dist/types/src/generated/types/EngagementTopicCreateOutputRepresentation.d.ts +32 -0
  49. package/dist/types/src/generated/types/EngagementTopicDetailsOutputRepresentation.d.ts +59 -0
  50. package/dist/types/src/generated/types/EngagementTopicFetchOutputRepresentation.d.ts +32 -0
  51. package/dist/types/src/generated/types/EngagementTopicListInputRepresentation.d.ts +29 -0
  52. package/dist/types/src/generated/types/EngagementTopicOutputRepresentation.d.ts +66 -0
  53. package/dist/types/src/generated/types/EngagementsCreateInputRepresentation.d.ts +29 -0
  54. package/dist/types/src/generated/types/EngagementsFetchOutputRepresentation.d.ts +33 -0
  55. package/dist/types/src/generated/types/EngagementsUpdateInputRepresentation.d.ts +35 -0
  56. package/dist/types/src/generated/types/RecentlyUsedActionsRepresentation.d.ts +33 -0
  57. package/dist/types/src/generated/types/ServiceCatalogActionsCategoryOutputRepresentation.d.ts +35 -0
  58. package/dist/types/src/generated/types/ServiceCatalogFrequentActionsOutputRepresentation.d.ts +33 -0
  59. package/dist/types/src/generated/types/ServiceCatalogItemsFetchOutputRepresentation.d.ts +37 -0
  60. package/dist/types/src/generated/types/ServiceCatalogItemsOutputRepresentation.d.ts +41 -0
  61. package/dist/types/src/generated/types/ServiceExcellenceIdOutputRepresentation.d.ts +29 -0
  62. package/dist/types/src/generated/types/ServiceExcellenceStatusOutputRepresentation.d.ts +32 -0
  63. package/dist/types/src/generated/types/type-utils.d.ts +39 -0
  64. package/dist/umd/es2018/industries-audit-trail-export.js +991 -0
  65. package/dist/umd/es5/industries-audit-trail-export.js +996 -0
  66. package/package.json +70 -0
  67. package/sfdc/index.d.ts +1 -0
  68. package/sfdc/index.js +1029 -0
  69. package/src/raml/api.raml +1081 -0
  70. package/src/raml/luvio.raml +42 -0
@@ -0,0 +1,991 @@
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.industriesAuditTrailExport = {}, global.engine));
11
+ })(this, (function (exports, engine) { 'use strict';
12
+
13
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
14
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
15
+ const { isArray: ArrayIsArray$1 } = Array;
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
+ const { displayName } = adapter;
25
+ const { required, optional, unsupported } = adapter.parameters;
26
+ if (config === undefined ||
27
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
28
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
29
+ }
30
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
31
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
32
+ }
33
+ if (unsupported !== undefined &&
34
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
35
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
36
+ }
37
+ const supported = required.concat(optional);
38
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
39
+ throw new TypeError(`adapter ${displayName} configuration supports only ${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(req => req in config);
47
+ }
48
+ const snapshotRefreshOptions = {
49
+ overrides: {
50
+ headers: {
51
+ 'Cache-Control': 'no-cache',
52
+ },
53
+ }
54
+ };
55
+ const keyPrefix = 'audit-trail-export';
56
+
57
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
58
+ const { isArray: ArrayIsArray } = Array;
59
+ const { stringify: JSONStringify } = JSON;
60
+ function deepFreeze$4(value) {
61
+ // No need to freeze primitives
62
+ if (typeof value !== 'object' || value === null) {
63
+ return;
64
+ }
65
+ if (ArrayIsArray(value)) {
66
+ for (let i = 0, len = value.length; i < len; i += 1) {
67
+ deepFreeze$4(value[i]);
68
+ }
69
+ }
70
+ else {
71
+ const keys = ObjectKeys(value);
72
+ for (let i = 0, len = keys.length; i < len; i += 1) {
73
+ deepFreeze$4(value[keys[i]]);
74
+ }
75
+ }
76
+ ObjectFreeze(value);
77
+ }
78
+ function createLink(ref) {
79
+ return {
80
+ __ref: engine.serializeStructuredKey(ref),
81
+ };
82
+ }
83
+
84
+ const TTL$2 = 60000;
85
+ const VERSION$2 = "07151ae56c2d1593d238dce78889bae0";
86
+ function validate$4(obj, path = 'AuditTrailExportOutputRepresentation') {
87
+ const v_error = (() => {
88
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
89
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
90
+ }
91
+ const obj_completedAt = obj.completedAt;
92
+ const path_completedAt = path + '.completedAt';
93
+ if (typeof obj_completedAt !== 'string') {
94
+ return new TypeError('Expected "string" but received "' + typeof obj_completedAt + '" (at "' + path_completedAt + '")');
95
+ }
96
+ const obj_requestIdentifier = obj.requestIdentifier;
97
+ const path_requestIdentifier = path + '.requestIdentifier';
98
+ if (typeof obj_requestIdentifier !== 'string') {
99
+ return new TypeError('Expected "string" but received "' + typeof obj_requestIdentifier + '" (at "' + path_requestIdentifier + '")');
100
+ }
101
+ const obj_requestedAt = obj.requestedAt;
102
+ const path_requestedAt = path + '.requestedAt';
103
+ if (typeof obj_requestedAt !== 'string') {
104
+ return new TypeError('Expected "string" but received "' + typeof obj_requestedAt + '" (at "' + path_requestedAt + '")');
105
+ }
106
+ const obj_requestedByUserId = obj.requestedByUserId;
107
+ const path_requestedByUserId = path + '.requestedByUserId';
108
+ if (typeof obj_requestedByUserId !== 'string') {
109
+ return new TypeError('Expected "string" but received "' + typeof obj_requestedByUserId + '" (at "' + path_requestedByUserId + '")');
110
+ }
111
+ const obj_requestedByUserName = obj.requestedByUserName;
112
+ const path_requestedByUserName = path + '.requestedByUserName';
113
+ if (typeof obj_requestedByUserName !== 'string') {
114
+ return new TypeError('Expected "string" but received "' + typeof obj_requestedByUserName + '" (at "' + path_requestedByUserName + '")');
115
+ }
116
+ const obj_status = obj.status;
117
+ const path_status = path + '.status';
118
+ if (typeof obj_status !== 'string') {
119
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
120
+ }
121
+ const obj_title = obj.title;
122
+ const path_title = path + '.title';
123
+ if (typeof obj_title !== 'string') {
124
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
125
+ }
126
+ })();
127
+ return v_error === undefined ? null : v_error;
128
+ }
129
+ const RepresentationType$2 = 'AuditTrailExportOutputRepresentation';
130
+ function keyBuilder$5(luvio, config) {
131
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.requestIdentifier;
132
+ }
133
+ function keyBuilderFromType(luvio, object) {
134
+ const keyParams = {
135
+ requestIdentifier: object.requestIdentifier
136
+ };
137
+ return keyBuilder$5(luvio, keyParams);
138
+ }
139
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
140
+ return input;
141
+ }
142
+ const select$5 = function AuditTrailExportOutputRepresentationSelect() {
143
+ return {
144
+ kind: 'Fragment',
145
+ version: VERSION$2,
146
+ private: [],
147
+ opaque: true
148
+ };
149
+ };
150
+ function equals$2(existing, incoming) {
151
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
152
+ return false;
153
+ }
154
+ return true;
155
+ }
156
+ function deepFreeze$3(input) {
157
+ ObjectFreeze(input);
158
+ }
159
+ const ingest$2 = function AuditTrailExportOutputRepresentationIngest(input, path, luvio, store, timestamp) {
160
+ if (process.env.NODE_ENV !== 'production') {
161
+ const validateError = validate$4(input);
162
+ if (validateError !== null) {
163
+ throw validateError;
164
+ }
165
+ }
166
+ const key = keyBuilderFromType(luvio, input);
167
+ const existingRecord = store.readEntry(key);
168
+ const ttlToUse = TTL$2;
169
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
170
+ fullPath: key,
171
+ parent: path.parent,
172
+ propertyName: path.propertyName,
173
+ ttl: ttlToUse
174
+ });
175
+ deepFreeze$3(input);
176
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
177
+ luvio.storePublish(key, incomingRecord);
178
+ }
179
+ {
180
+ const storeMetadataParams = {
181
+ ttl: ttlToUse,
182
+ namespace: "audit-trail-export",
183
+ version: VERSION$2,
184
+ representationName: RepresentationType$2,
185
+ };
186
+ luvio.publishStoreMetadata(key, storeMetadataParams);
187
+ }
188
+ return createLink(key);
189
+ };
190
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
191
+ const rootKeySet = new engine.StoreKeyMap();
192
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
193
+ const rootKey = keyBuilderFromType(luvio, input);
194
+ rootKeySet.set(rootKey, {
195
+ namespace: keyPrefix,
196
+ representationName: RepresentationType$2,
197
+ mergeable: false
198
+ });
199
+ return rootKeySet;
200
+ }
201
+
202
+ const TTL$1 = 60000;
203
+ const VERSION$1 = "c5f1cd9d15d6671b01fc93db7067ae4a";
204
+ function validate$3(obj, path = 'AuditTrailExportListOutputRepresentation') {
205
+ const v_error = (() => {
206
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
207
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
208
+ }
209
+ const obj_auditTrailExports = obj.auditTrailExports;
210
+ const path_auditTrailExports = path + '.auditTrailExports';
211
+ if (!ArrayIsArray(obj_auditTrailExports)) {
212
+ return new TypeError('Expected "array" but received "' + typeof obj_auditTrailExports + '" (at "' + path_auditTrailExports + '")');
213
+ }
214
+ for (let i = 0; i < obj_auditTrailExports.length; i++) {
215
+ const obj_auditTrailExports_item = obj_auditTrailExports[i];
216
+ const path_auditTrailExports_item = path_auditTrailExports + '[' + i + ']';
217
+ const referencepath_auditTrailExports_itemValidationError = validate$4(obj_auditTrailExports_item, path_auditTrailExports_item);
218
+ if (referencepath_auditTrailExports_itemValidationError !== null) {
219
+ let message = 'Object doesn\'t match AuditTrailExportOutputRepresentation (at "' + path_auditTrailExports_item + '")\n';
220
+ message += referencepath_auditTrailExports_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
221
+ return new TypeError(message);
222
+ }
223
+ }
224
+ })();
225
+ return v_error === undefined ? null : v_error;
226
+ }
227
+ const RepresentationType$1 = 'AuditTrailExportListOutputRepresentation';
228
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
229
+ return input;
230
+ }
231
+ const select$4 = function AuditTrailExportListOutputRepresentationSelect() {
232
+ return {
233
+ kind: 'Fragment',
234
+ version: VERSION$1,
235
+ private: [],
236
+ opaque: true
237
+ };
238
+ };
239
+ function equals$1(existing, incoming) {
240
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
241
+ return false;
242
+ }
243
+ return true;
244
+ }
245
+ function deepFreeze$2(input) {
246
+ const input_auditTrailExports = input.auditTrailExports;
247
+ for (let i = 0; i < input_auditTrailExports.length; i++) {
248
+ const input_auditTrailExports_item = input_auditTrailExports[i];
249
+ deepFreeze$3(input_auditTrailExports_item);
250
+ }
251
+ ObjectFreeze(input_auditTrailExports);
252
+ ObjectFreeze(input);
253
+ }
254
+ const ingest$1 = function AuditTrailExportListOutputRepresentationIngest(input, path, luvio, store, timestamp) {
255
+ if (process.env.NODE_ENV !== 'production') {
256
+ const validateError = validate$3(input);
257
+ if (validateError !== null) {
258
+ throw validateError;
259
+ }
260
+ }
261
+ const key = path.fullPath;
262
+ const existingRecord = store.readEntry(key);
263
+ const ttlToUse = TTL$1;
264
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
265
+ fullPath: key,
266
+ parent: path.parent,
267
+ propertyName: path.propertyName,
268
+ ttl: ttlToUse
269
+ });
270
+ deepFreeze$2(input);
271
+ if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
272
+ luvio.storePublish(key, incomingRecord);
273
+ }
274
+ {
275
+ const storeMetadataParams = {
276
+ ttl: ttlToUse,
277
+ namespace: "audit-trail-export",
278
+ version: VERSION$1,
279
+ representationName: RepresentationType$1,
280
+ };
281
+ luvio.publishStoreMetadata(key, storeMetadataParams);
282
+ }
283
+ return createLink(key);
284
+ };
285
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
286
+ const rootKeySet = new engine.StoreKeyMap();
287
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
288
+ const rootKey = fullPathFactory();
289
+ rootKeySet.set(rootKey, {
290
+ namespace: keyPrefix,
291
+ representationName: RepresentationType$1,
292
+ mergeable: false
293
+ });
294
+ return rootKeySet;
295
+ }
296
+
297
+ function select$3(luvio, params) {
298
+ return select$4();
299
+ }
300
+ function keyBuilder$4(luvio, params) {
301
+ return keyPrefix + '::AuditTrailExportListOutputRepresentation:(' + ')';
302
+ }
303
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
304
+ return getTypeCacheKeys$1(luvio, response, () => keyBuilder$4());
305
+ }
306
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
307
+ const { body } = response;
308
+ const key = keyBuilder$4();
309
+ luvio.storeIngest(key, ingest$1, body);
310
+ const snapshot = luvio.storeLookup({
311
+ recordId: key,
312
+ node: select$3(),
313
+ variables: {},
314
+ }, snapshotRefresh);
315
+ if (process.env.NODE_ENV !== 'production') {
316
+ if (snapshot.state !== 'Fulfilled') {
317
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
318
+ }
319
+ }
320
+ return snapshot;
321
+ }
322
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
323
+ const key = keyBuilder$4();
324
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
325
+ const storeMetadataParams = {
326
+ ttl: TTL$1,
327
+ namespace: keyPrefix,
328
+ version: VERSION$1,
329
+ representationName: RepresentationType$1
330
+ };
331
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
332
+ return errorSnapshot;
333
+ }
334
+ function createResourceRequest$3(config) {
335
+ const headers = {};
336
+ return {
337
+ baseUri: '/services/data/v58.0',
338
+ basePath: '/connect/service-excellence/audit-trail-exports',
339
+ method: 'get',
340
+ body: null,
341
+ urlParams: {},
342
+ queryParams: {},
343
+ headers,
344
+ priority: 'normal',
345
+ };
346
+ }
347
+
348
+ const getAuditTrailFileExports_ConfigPropertyNames = {
349
+ displayName: 'getAuditTrailFileExports',
350
+ parameters: {
351
+ required: [],
352
+ optional: []
353
+ }
354
+ };
355
+ function createResourceParams$3(config) {
356
+ const resourceParams = {};
357
+ return resourceParams;
358
+ }
359
+ function keyBuilder$3(luvio, config) {
360
+ return keyBuilder$4();
361
+ }
362
+ function typeCheckConfig$3(untrustedConfig) {
363
+ const config = {};
364
+ return config;
365
+ }
366
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
367
+ if (!untrustedIsObject(untrustedConfig)) {
368
+ return null;
369
+ }
370
+ if (process.env.NODE_ENV !== 'production') {
371
+ validateConfig(untrustedConfig, configPropertyNames);
372
+ }
373
+ const config = typeCheckConfig$3();
374
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
375
+ return null;
376
+ }
377
+ return config;
378
+ }
379
+ function adapterFragment$1(luvio, config) {
380
+ return select$3();
381
+ }
382
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
383
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
384
+ config,
385
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
386
+ });
387
+ return luvio.storeBroadcast().then(() => snapshot);
388
+ }
389
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
390
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
391
+ config,
392
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
393
+ });
394
+ return luvio.storeBroadcast().then(() => snapshot);
395
+ }
396
+ function buildNetworkSnapshot$3(luvio, config, options) {
397
+ const resourceParams = createResourceParams$3();
398
+ const request = createResourceRequest$3();
399
+ return luvio.dispatchResourceRequest(request, options)
400
+ .then((response) => {
401
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
402
+ }, (response) => {
403
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
404
+ });
405
+ }
406
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
407
+ const { luvio, config } = context;
408
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
409
+ const dispatchOptions = {
410
+ resourceRequestContext: {
411
+ requestCorrelator,
412
+ luvioRequestMethod: undefined,
413
+ },
414
+ eventObservers
415
+ };
416
+ if (networkPriority !== 'normal') {
417
+ dispatchOptions.overrides = {
418
+ priority: networkPriority
419
+ };
420
+ }
421
+ return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
422
+ }
423
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
424
+ const { luvio, config } = context;
425
+ const selector = {
426
+ recordId: keyBuilder$3(),
427
+ node: adapterFragment$1(),
428
+ variables: {},
429
+ };
430
+ const cacheSnapshot = storeLookup(selector, {
431
+ config,
432
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
433
+ });
434
+ return cacheSnapshot;
435
+ }
436
+ const getAuditTrailFileExportsAdapterFactory = (luvio) => function auditTrailExport__getAuditTrailFileExports(untrustedConfig, requestContext) {
437
+ const config = validateAdapterConfig$3(untrustedConfig, getAuditTrailFileExports_ConfigPropertyNames);
438
+ // Invalid or incomplete config
439
+ if (config === null) {
440
+ return null;
441
+ }
442
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
443
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
444
+ };
445
+
446
+ function validate$2(obj, path = 'AuditTrailExportInputRepresentation') {
447
+ const v_error = (() => {
448
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
449
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
450
+ }
451
+ const obj_endDate = obj.endDate;
452
+ const path_endDate = path + '.endDate';
453
+ if (typeof obj_endDate !== 'string') {
454
+ return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
455
+ }
456
+ const obj_endTime = obj.endTime;
457
+ const path_endTime = path + '.endTime';
458
+ if (typeof obj_endTime !== 'string') {
459
+ return new TypeError('Expected "string" but received "' + typeof obj_endTime + '" (at "' + path_endTime + '")');
460
+ }
461
+ const obj_initiatingAttendeeId = obj.initiatingAttendeeId;
462
+ const path_initiatingAttendeeId = path + '.initiatingAttendeeId';
463
+ if (typeof obj_initiatingAttendeeId !== 'string') {
464
+ return new TypeError('Expected "string" but received "' + typeof obj_initiatingAttendeeId + '" (at "' + path_initiatingAttendeeId + '")');
465
+ }
466
+ const obj_startDate = obj.startDate;
467
+ const path_startDate = path + '.startDate';
468
+ if (typeof obj_startDate !== 'string') {
469
+ return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
470
+ }
471
+ const obj_startTime = obj.startTime;
472
+ const path_startTime = path + '.startTime';
473
+ if (typeof obj_startTime !== 'string') {
474
+ return new TypeError('Expected "string" but received "' + typeof obj_startTime + '" (at "' + path_startTime + '")');
475
+ }
476
+ const obj_verificationStatus = obj.verificationStatus;
477
+ const path_verificationStatus = path + '.verificationStatus';
478
+ if (typeof obj_verificationStatus !== 'string') {
479
+ return new TypeError('Expected "string" but received "' + typeof obj_verificationStatus + '" (at "' + path_verificationStatus + '")');
480
+ }
481
+ })();
482
+ return v_error === undefined ? null : v_error;
483
+ }
484
+
485
+ function select$2(luvio, params) {
486
+ return select$5();
487
+ }
488
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
489
+ return getTypeCacheKeys$2(luvio, response);
490
+ }
491
+ function ingestSuccess$1(luvio, resourceParams, response) {
492
+ const { body } = response;
493
+ const key = keyBuilderFromType(luvio, body);
494
+ luvio.storeIngest(key, ingest$2, body);
495
+ const snapshot = luvio.storeLookup({
496
+ recordId: key,
497
+ node: select$2(),
498
+ variables: {},
499
+ });
500
+ if (process.env.NODE_ENV !== 'production') {
501
+ if (snapshot.state !== 'Fulfilled') {
502
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
503
+ }
504
+ }
505
+ return snapshot;
506
+ }
507
+ function createResourceRequest$2(config) {
508
+ const headers = {};
509
+ return {
510
+ baseUri: '/services/data/v58.0',
511
+ basePath: '/connect/service-excellence/audit-trail-exports',
512
+ method: 'post',
513
+ body: config.body,
514
+ urlParams: {},
515
+ queryParams: {},
516
+ headers,
517
+ priority: 'normal',
518
+ };
519
+ }
520
+
521
+ const createAuditTrailFileExport_ConfigPropertyNames = {
522
+ displayName: 'createAuditTrailFileExport',
523
+ parameters: {
524
+ required: ['auditTrailExportInput'],
525
+ optional: []
526
+ }
527
+ };
528
+ function createResourceParams$2(config) {
529
+ const resourceParams = {
530
+ body: {
531
+ auditTrailExportInput: config.auditTrailExportInput
532
+ }
533
+ };
534
+ return resourceParams;
535
+ }
536
+ function typeCheckConfig$2(untrustedConfig) {
537
+ const config = {};
538
+ const untrustedConfig_auditTrailExportInput = untrustedConfig.auditTrailExportInput;
539
+ const referenceAuditTrailExportInputRepresentationValidationError = validate$2(untrustedConfig_auditTrailExportInput);
540
+ if (referenceAuditTrailExportInputRepresentationValidationError === null) {
541
+ config.auditTrailExportInput = untrustedConfig_auditTrailExportInput;
542
+ }
543
+ return config;
544
+ }
545
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
546
+ if (!untrustedIsObject(untrustedConfig)) {
547
+ return null;
548
+ }
549
+ if (process.env.NODE_ENV !== 'production') {
550
+ validateConfig(untrustedConfig, configPropertyNames);
551
+ }
552
+ const config = typeCheckConfig$2(untrustedConfig);
553
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
554
+ return null;
555
+ }
556
+ return config;
557
+ }
558
+ function buildNetworkSnapshot$2(luvio, config, options) {
559
+ const resourceParams = createResourceParams$2(config);
560
+ const request = createResourceRequest$2(resourceParams);
561
+ return luvio.dispatchResourceRequest(request, options)
562
+ .then((response) => {
563
+ return luvio.handleSuccessResponse(() => {
564
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
565
+ return luvio.storeBroadcast().then(() => snapshot);
566
+ }, () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
567
+ }, (response) => {
568
+ deepFreeze$4(response);
569
+ throw response;
570
+ });
571
+ }
572
+ const createAuditTrailFileExportAdapterFactory = (luvio) => {
573
+ return function createAuditTrailFileExport(untrustedConfig) {
574
+ const config = validateAdapterConfig$2(untrustedConfig, createAuditTrailFileExport_ConfigPropertyNames);
575
+ // Invalid or incomplete config
576
+ if (config === null) {
577
+ throw new Error('Invalid config for "createAuditTrailFileExport"');
578
+ }
579
+ return buildNetworkSnapshot$2(luvio, config);
580
+ };
581
+ };
582
+
583
+ function keyBuilder$2(luvio, params) {
584
+ return keyBuilder$5(luvio, {
585
+ requestIdentifier: params.urlParams.requestIdentifier
586
+ });
587
+ }
588
+ function getResponseCacheKeys$1(luvio, resourceParams) {
589
+ const key = keyBuilder$2(luvio, resourceParams);
590
+ const cacheKeyMap = new engine.StoreKeyMap();
591
+ cacheKeyMap.set(key, {
592
+ namespace: keyPrefix,
593
+ representationName: RepresentationType$2,
594
+ mergeable: false
595
+ });
596
+ return cacheKeyMap;
597
+ }
598
+ function evictSuccess(luvio, resourceParams) {
599
+ const key = keyBuilder$2(luvio, resourceParams);
600
+ luvio.storeEvict(key);
601
+ }
602
+ function createResourceRequest$1(config) {
603
+ const headers = {};
604
+ return {
605
+ baseUri: '/services/data/v58.0',
606
+ basePath: '/connect/service-excellence/audit-trail-exports/' + config.urlParams.requestIdentifier + '',
607
+ method: 'delete',
608
+ body: null,
609
+ urlParams: config.urlParams,
610
+ queryParams: {},
611
+ headers,
612
+ priority: 'normal',
613
+ };
614
+ }
615
+
616
+ const adapterName = 'deleteAuditTrailFileExport';
617
+ const deleteAuditTrailFileExport_ConfigPropertyNames = {
618
+ displayName: 'deleteAuditTrailFileExport',
619
+ parameters: {
620
+ required: ['requestIdentifier'],
621
+ optional: []
622
+ }
623
+ };
624
+ function createResourceParams$1(config) {
625
+ const resourceParams = {
626
+ urlParams: {
627
+ requestIdentifier: config.requestIdentifier
628
+ }
629
+ };
630
+ return resourceParams;
631
+ }
632
+ function typeCheckConfig$1(untrustedConfig) {
633
+ const config = {};
634
+ const untrustedConfig_requestIdentifier = untrustedConfig.requestIdentifier;
635
+ if (typeof untrustedConfig_requestIdentifier === 'string') {
636
+ config.requestIdentifier = untrustedConfig_requestIdentifier;
637
+ }
638
+ return config;
639
+ }
640
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
641
+ if (!untrustedIsObject(untrustedConfig)) {
642
+ return null;
643
+ }
644
+ if (process.env.NODE_ENV !== 'production') {
645
+ validateConfig(untrustedConfig, configPropertyNames);
646
+ }
647
+ const config = typeCheckConfig$1(untrustedConfig);
648
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
649
+ return null;
650
+ }
651
+ return config;
652
+ }
653
+ function buildNetworkSnapshot$1(luvio, config, options) {
654
+ const resourceParams = createResourceParams$1(config);
655
+ const request = createResourceRequest$1(resourceParams);
656
+ return luvio.dispatchResourceRequest(request, options)
657
+ .then(() => {
658
+ return luvio.handleSuccessResponse(() => {
659
+ evictSuccess(luvio, resourceParams);
660
+ return luvio.storeBroadcast();
661
+ }, () => getResponseCacheKeys$1(luvio, resourceParams));
662
+ }, (response) => {
663
+ deepFreeze$4(response);
664
+ throw response;
665
+ });
666
+ }
667
+ const deleteAuditTrailFileExportAdapterFactory = (luvio) => {
668
+ return function auditTrailExportdeleteAuditTrailFileExport(untrustedConfig) {
669
+ const config = validateAdapterConfig$1(untrustedConfig, deleteAuditTrailFileExport_ConfigPropertyNames);
670
+ // Invalid or incomplete config
671
+ if (config === null) {
672
+ throw new Error(`Invalid config for "${adapterName}"`);
673
+ }
674
+ return buildNetworkSnapshot$1(luvio, config);
675
+ };
676
+ };
677
+
678
+ function validate$1(obj, path = 'AuditTrailLogOutputRepresentation') {
679
+ const v_error = (() => {
680
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
681
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
682
+ }
683
+ const obj_communicationChannel = obj.communicationChannel;
684
+ const path_communicationChannel = path + '.communicationChannel';
685
+ if (typeof obj_communicationChannel !== 'string') {
686
+ return new TypeError('Expected "string" but received "' + typeof obj_communicationChannel + '" (at "' + path_communicationChannel + '")');
687
+ }
688
+ const obj_engagementTopic = obj.engagementTopic;
689
+ const path_engagementTopic = path + '.engagementTopic';
690
+ if (typeof obj_engagementTopic !== 'string') {
691
+ return new TypeError('Expected "string" but received "' + typeof obj_engagementTopic + '" (at "' + path_engagementTopic + '")');
692
+ }
693
+ const obj_initiatingAttendee = obj.initiatingAttendee;
694
+ const path_initiatingAttendee = path + '.initiatingAttendee';
695
+ if (typeof obj_initiatingAttendee !== 'string') {
696
+ return new TypeError('Expected "string" but received "' + typeof obj_initiatingAttendee + '" (at "' + path_initiatingAttendee + '")');
697
+ }
698
+ const obj_initiatingAttendeeType = obj.initiatingAttendeeType;
699
+ const path_initiatingAttendeeType = path + '.initiatingAttendeeType';
700
+ if (typeof obj_initiatingAttendeeType !== 'string') {
701
+ return new TypeError('Expected "string" but received "' + typeof obj_initiatingAttendeeType + '" (at "' + path_initiatingAttendeeType + '")');
702
+ }
703
+ const obj_recordName = obj.recordName;
704
+ const path_recordName = path + '.recordName';
705
+ if (typeof obj_recordName !== 'string') {
706
+ return new TypeError('Expected "string" but received "' + typeof obj_recordName + '" (at "' + path_recordName + '")');
707
+ }
708
+ const obj_verificationStatus = obj.verificationStatus;
709
+ const path_verificationStatus = path + '.verificationStatus';
710
+ if (typeof obj_verificationStatus !== 'string') {
711
+ return new TypeError('Expected "string" but received "' + typeof obj_verificationStatus + '" (at "' + path_verificationStatus + '")');
712
+ }
713
+ const obj_verificationTimestamp = obj.verificationTimestamp;
714
+ const path_verificationTimestamp = path + '.verificationTimestamp';
715
+ if (typeof obj_verificationTimestamp !== 'string') {
716
+ return new TypeError('Expected "string" but received "' + typeof obj_verificationTimestamp + '" (at "' + path_verificationTimestamp + '")');
717
+ }
718
+ const obj_verificationType = obj.verificationType;
719
+ const path_verificationType = path + '.verificationType';
720
+ if (typeof obj_verificationType !== 'string') {
721
+ return new TypeError('Expected "string" but received "' + typeof obj_verificationType + '" (at "' + path_verificationType + '")');
722
+ }
723
+ })();
724
+ return v_error === undefined ? null : v_error;
725
+ }
726
+ function deepFreeze$1(input) {
727
+ ObjectFreeze(input);
728
+ }
729
+
730
+ const TTL = 60000;
731
+ const VERSION = "19c94077a33b93089fd947bbe72c860c";
732
+ function validate(obj, path = 'AuditTrailFileDownloadOutputRepresentation') {
733
+ const v_error = (() => {
734
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
735
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
736
+ }
737
+ const obj_auditTrailLogs = obj.auditTrailLogs;
738
+ const path_auditTrailLogs = path + '.auditTrailLogs';
739
+ if (!ArrayIsArray(obj_auditTrailLogs)) {
740
+ return new TypeError('Expected "array" but received "' + typeof obj_auditTrailLogs + '" (at "' + path_auditTrailLogs + '")');
741
+ }
742
+ for (let i = 0; i < obj_auditTrailLogs.length; i++) {
743
+ const obj_auditTrailLogs_item = obj_auditTrailLogs[i];
744
+ const path_auditTrailLogs_item = path_auditTrailLogs + '[' + i + ']';
745
+ const referencepath_auditTrailLogs_itemValidationError = validate$1(obj_auditTrailLogs_item, path_auditTrailLogs_item);
746
+ if (referencepath_auditTrailLogs_itemValidationError !== null) {
747
+ let message = 'Object doesn\'t match AuditTrailLogOutputRepresentation (at "' + path_auditTrailLogs_item + '")\n';
748
+ message += referencepath_auditTrailLogs_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
749
+ return new TypeError(message);
750
+ }
751
+ }
752
+ })();
753
+ return v_error === undefined ? null : v_error;
754
+ }
755
+ const RepresentationType = 'AuditTrailFileDownloadOutputRepresentation';
756
+ function normalize(input, existing, path, luvio, store, timestamp) {
757
+ return input;
758
+ }
759
+ const select$1 = function AuditTrailFileDownloadOutputRepresentationSelect() {
760
+ return {
761
+ kind: 'Fragment',
762
+ version: VERSION,
763
+ private: [],
764
+ opaque: true
765
+ };
766
+ };
767
+ function equals(existing, incoming) {
768
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
769
+ return false;
770
+ }
771
+ return true;
772
+ }
773
+ function deepFreeze(input) {
774
+ const input_auditTrailLogs = input.auditTrailLogs;
775
+ for (let i = 0; i < input_auditTrailLogs.length; i++) {
776
+ const input_auditTrailLogs_item = input_auditTrailLogs[i];
777
+ deepFreeze$1(input_auditTrailLogs_item);
778
+ }
779
+ ObjectFreeze(input_auditTrailLogs);
780
+ ObjectFreeze(input);
781
+ }
782
+ const ingest = function AuditTrailFileDownloadOutputRepresentationIngest(input, path, luvio, store, timestamp) {
783
+ if (process.env.NODE_ENV !== 'production') {
784
+ const validateError = validate(input);
785
+ if (validateError !== null) {
786
+ throw validateError;
787
+ }
788
+ }
789
+ const key = path.fullPath;
790
+ const existingRecord = store.readEntry(key);
791
+ const ttlToUse = TTL;
792
+ let incomingRecord = normalize(input, store.readEntry(key), {
793
+ fullPath: key,
794
+ parent: path.parent,
795
+ propertyName: path.propertyName,
796
+ ttl: ttlToUse
797
+ });
798
+ deepFreeze(input);
799
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
800
+ luvio.storePublish(key, incomingRecord);
801
+ }
802
+ {
803
+ const storeMetadataParams = {
804
+ ttl: ttlToUse,
805
+ namespace: "audit-trail-export",
806
+ version: VERSION,
807
+ representationName: RepresentationType,
808
+ };
809
+ luvio.publishStoreMetadata(key, storeMetadataParams);
810
+ }
811
+ return createLink(key);
812
+ };
813
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
814
+ const rootKeySet = new engine.StoreKeyMap();
815
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
816
+ const rootKey = fullPathFactory();
817
+ rootKeySet.set(rootKey, {
818
+ namespace: keyPrefix,
819
+ representationName: RepresentationType,
820
+ mergeable: false
821
+ });
822
+ return rootKeySet;
823
+ }
824
+
825
+ function select(luvio, params) {
826
+ return select$1();
827
+ }
828
+ function keyBuilder$1(luvio, params) {
829
+ return keyPrefix + '::AuditTrailFileDownloadOutputRepresentation:(' + 'requestIdentifier:' + params.urlParams.requestIdentifier + ')';
830
+ }
831
+ function getResponseCacheKeys(luvio, resourceParams, response) {
832
+ return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
833
+ }
834
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
835
+ const { body } = response;
836
+ const key = keyBuilder$1(luvio, resourceParams);
837
+ luvio.storeIngest(key, ingest, body);
838
+ const snapshot = luvio.storeLookup({
839
+ recordId: key,
840
+ node: select(),
841
+ variables: {},
842
+ }, snapshotRefresh);
843
+ if (process.env.NODE_ENV !== 'production') {
844
+ if (snapshot.state !== 'Fulfilled') {
845
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
846
+ }
847
+ }
848
+ return snapshot;
849
+ }
850
+ function ingestError(luvio, params, error, snapshotRefresh) {
851
+ const key = keyBuilder$1(luvio, params);
852
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
853
+ const storeMetadataParams = {
854
+ ttl: TTL,
855
+ namespace: keyPrefix,
856
+ version: VERSION,
857
+ representationName: RepresentationType
858
+ };
859
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
860
+ return errorSnapshot;
861
+ }
862
+ function createResourceRequest(config) {
863
+ const headers = {};
864
+ return {
865
+ baseUri: '/services/data/v58.0',
866
+ basePath: '/connect/service-excellence/audit-trail-exports/' + config.urlParams.requestIdentifier + '/download',
867
+ method: 'get',
868
+ body: null,
869
+ urlParams: config.urlParams,
870
+ queryParams: {},
871
+ headers,
872
+ priority: 'normal',
873
+ };
874
+ }
875
+
876
+ const getAuditTrailFileExport_ConfigPropertyNames = {
877
+ displayName: 'getAuditTrailFileExport',
878
+ parameters: {
879
+ required: ['requestIdentifier'],
880
+ optional: []
881
+ }
882
+ };
883
+ function createResourceParams(config) {
884
+ const resourceParams = {
885
+ urlParams: {
886
+ requestIdentifier: config.requestIdentifier
887
+ }
888
+ };
889
+ return resourceParams;
890
+ }
891
+ function keyBuilder(luvio, config) {
892
+ const resourceParams = createResourceParams(config);
893
+ return keyBuilder$1(luvio, resourceParams);
894
+ }
895
+ function typeCheckConfig(untrustedConfig) {
896
+ const config = {};
897
+ const untrustedConfig_requestIdentifier = untrustedConfig.requestIdentifier;
898
+ if (typeof untrustedConfig_requestIdentifier === 'string') {
899
+ config.requestIdentifier = untrustedConfig_requestIdentifier;
900
+ }
901
+ return config;
902
+ }
903
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
904
+ if (!untrustedIsObject(untrustedConfig)) {
905
+ return null;
906
+ }
907
+ if (process.env.NODE_ENV !== 'production') {
908
+ validateConfig(untrustedConfig, configPropertyNames);
909
+ }
910
+ const config = typeCheckConfig(untrustedConfig);
911
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
912
+ return null;
913
+ }
914
+ return config;
915
+ }
916
+ function adapterFragment(luvio, config) {
917
+ createResourceParams(config);
918
+ return select();
919
+ }
920
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
921
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
922
+ config,
923
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
924
+ });
925
+ return luvio.storeBroadcast().then(() => snapshot);
926
+ }
927
+ function onFetchResponseError(luvio, config, resourceParams, response) {
928
+ const snapshot = ingestError(luvio, resourceParams, response, {
929
+ config,
930
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
931
+ });
932
+ return luvio.storeBroadcast().then(() => snapshot);
933
+ }
934
+ function buildNetworkSnapshot(luvio, config, options) {
935
+ const resourceParams = createResourceParams(config);
936
+ const request = createResourceRequest(resourceParams);
937
+ return luvio.dispatchResourceRequest(request, options)
938
+ .then((response) => {
939
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
940
+ }, (response) => {
941
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
942
+ });
943
+ }
944
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
945
+ const { luvio, config } = context;
946
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
947
+ const dispatchOptions = {
948
+ resourceRequestContext: {
949
+ requestCorrelator,
950
+ luvioRequestMethod: undefined,
951
+ },
952
+ eventObservers
953
+ };
954
+ if (networkPriority !== 'normal') {
955
+ dispatchOptions.overrides = {
956
+ priority: networkPriority
957
+ };
958
+ }
959
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
960
+ }
961
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
962
+ const { luvio, config } = context;
963
+ const selector = {
964
+ recordId: keyBuilder(luvio, config),
965
+ node: adapterFragment(luvio, config),
966
+ variables: {},
967
+ };
968
+ const cacheSnapshot = storeLookup(selector, {
969
+ config,
970
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
971
+ });
972
+ return cacheSnapshot;
973
+ }
974
+ const getAuditTrailFileExportAdapterFactory = (luvio) => function auditTrailExport__getAuditTrailFileExport(untrustedConfig, requestContext) {
975
+ const config = validateAdapterConfig(untrustedConfig, getAuditTrailFileExport_ConfigPropertyNames);
976
+ // Invalid or incomplete config
977
+ if (config === null) {
978
+ return null;
979
+ }
980
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
981
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
982
+ };
983
+
984
+ exports.createAuditTrailFileExportAdapterFactory = createAuditTrailFileExportAdapterFactory;
985
+ exports.deleteAuditTrailFileExportAdapterFactory = deleteAuditTrailFileExportAdapterFactory;
986
+ exports.getAuditTrailFileExportAdapterFactory = getAuditTrailFileExportAdapterFactory;
987
+ exports.getAuditTrailFileExportsAdapterFactory = getAuditTrailFileExportsAdapterFactory;
988
+
989
+ Object.defineProperty(exports, '__esModule', { value: true });
990
+
991
+ }));