@salesforce/lds-adapters-industries-externaldocument 1.164.0 → 1.165.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,9 +58,9 @@ function createLink(ref) {
58
58
  };
59
59
  }
60
60
 
61
- const TTL$2 = 60000;
62
- const VERSION$2 = "641dbe0f048b436a2f7b34ac9bf1ddd1";
63
- function validate$4(obj, path = 'ExternalDocumentOutputRepresentation') {
61
+ const TTL$3 = 60000;
62
+ const VERSION$3 = "641dbe0f048b436a2f7b34ac9bf1ddd1";
63
+ function validate$6(obj, path = 'ExternalDocumentOutputRepresentation') {
64
64
  const v_error = (() => {
65
65
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
66
66
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -98,82 +98,82 @@ function validate$4(obj, path = 'ExternalDocumentOutputRepresentation') {
98
98
  })();
99
99
  return v_error === undefined ? null : v_error;
100
100
  }
101
- const RepresentationType$2 = 'ExternalDocumentOutputRepresentation';
102
- function normalize$2(input, existing, path, luvio, store, timestamp) {
101
+ const RepresentationType$3 = 'ExternalDocumentOutputRepresentation';
102
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
103
103
  return input;
104
104
  }
105
- const select$5 = function ExternalDocumentOutputRepresentationSelect() {
105
+ const select$7 = function ExternalDocumentOutputRepresentationSelect() {
106
106
  return {
107
107
  kind: 'Fragment',
108
- version: VERSION$2,
108
+ version: VERSION$3,
109
109
  private: [],
110
110
  opaque: true
111
111
  };
112
112
  };
113
- function equals$2(existing, incoming) {
113
+ function equals$3(existing, incoming) {
114
114
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
115
115
  return false;
116
116
  }
117
117
  return true;
118
118
  }
119
- const ingest$2 = function ExternalDocumentOutputRepresentationIngest(input, path, luvio, store, timestamp) {
119
+ const ingest$3 = function ExternalDocumentOutputRepresentationIngest(input, path, luvio, store, timestamp) {
120
120
  if (process.env.NODE_ENV !== 'production') {
121
- const validateError = validate$4(input);
121
+ const validateError = validate$6(input);
122
122
  if (validateError !== null) {
123
123
  throw validateError;
124
124
  }
125
125
  }
126
126
  const key = path.fullPath;
127
127
  const existingRecord = store.readEntry(key);
128
- const ttlToUse = TTL$2;
129
- let incomingRecord = normalize$2(input, store.readEntry(key), {
128
+ const ttlToUse = TTL$3;
129
+ let incomingRecord = normalize$3(input, store.readEntry(key), {
130
130
  fullPath: key,
131
131
  parent: path.parent,
132
132
  propertyName: path.propertyName,
133
133
  ttl: ttlToUse
134
134
  });
135
- if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
135
+ if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
136
136
  luvio.storePublish(key, incomingRecord);
137
137
  }
138
138
  {
139
139
  const storeMetadataParams = {
140
140
  ttl: ttlToUse,
141
141
  namespace: "ExternalDocument",
142
- version: VERSION$2,
143
- representationName: RepresentationType$2,
142
+ version: VERSION$3,
143
+ representationName: RepresentationType$3,
144
144
  };
145
145
  luvio.publishStoreMetadata(key, storeMetadataParams);
146
146
  }
147
147
  return createLink(key);
148
148
  };
149
- function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
149
+ function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
150
150
  const rootKeySet = new StoreKeyMap();
151
151
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
152
152
  const rootKey = fullPathFactory();
153
153
  rootKeySet.set(rootKey, {
154
154
  namespace: keyPrefix,
155
- representationName: RepresentationType$2,
155
+ representationName: RepresentationType$3,
156
156
  mergeable: false
157
157
  });
158
158
  return rootKeySet;
159
159
  }
160
160
 
161
- function select$4(luvio, params) {
162
- return select$5();
161
+ function select$6(luvio, params) {
162
+ return select$7();
163
163
  }
164
- function keyBuilder$3(luvio, params) {
164
+ function keyBuilder$5(luvio, params) {
165
165
  return keyPrefix + '::ExternalDocumentOutputRepresentation:(' + 'externalDocumentId:' + params.queryParams.externalDocumentId + ',' + 'refObjectId:' + params.queryParams.refObjectId + ')';
166
166
  }
167
- function getResponseCacheKeys$2(luvio, resourceParams, response) {
168
- return getTypeCacheKeys$2(luvio, response, () => keyBuilder$3(luvio, resourceParams));
167
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
168
+ return getTypeCacheKeys$3(luvio, response, () => keyBuilder$5(luvio, resourceParams));
169
169
  }
170
- function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
170
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
171
171
  const { body } = response;
172
- const key = keyBuilder$3(luvio, resourceParams);
173
- luvio.storeIngest(key, ingest$2, body);
172
+ const key = keyBuilder$5(luvio, resourceParams);
173
+ luvio.storeIngest(key, ingest$3, body);
174
174
  const snapshot = luvio.storeLookup({
175
175
  recordId: key,
176
- node: select$4(),
176
+ node: select$6(),
177
177
  variables: {},
178
178
  }, snapshotRefresh);
179
179
  if (process.env.NODE_ENV !== 'production') {
@@ -184,19 +184,19 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
184
184
  deepFreeze(snapshot.data);
185
185
  return snapshot;
186
186
  }
187
- function ingestError(luvio, params, error, snapshotRefresh) {
188
- const key = keyBuilder$3(luvio, params);
187
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
188
+ const key = keyBuilder$5(luvio, params);
189
189
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
190
190
  const storeMetadataParams = {
191
- ttl: TTL$2,
191
+ ttl: TTL$3,
192
192
  namespace: keyPrefix,
193
- version: VERSION$2,
194
- representationName: RepresentationType$2
193
+ version: VERSION$3,
194
+ representationName: RepresentationType$3
195
195
  };
196
196
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
197
197
  return errorSnapshot;
198
198
  }
199
- function createResourceRequest$2(config) {
199
+ function createResourceRequest$3(config) {
200
200
  const headers = {};
201
201
  return {
202
202
  baseUri: '/services/data/v59.0',
@@ -217,7 +217,7 @@ const getExternalDocument_ConfigPropertyNames = {
217
217
  optional: ['externalDocumentId', 'refObjectId']
218
218
  }
219
219
  };
220
- function createResourceParams$2(config) {
220
+ function createResourceParams$3(config) {
221
221
  const resourceParams = {
222
222
  queryParams: {
223
223
  externalDocumentId: config.externalDocumentId, refObjectId: config.refObjectId
@@ -225,11 +225,11 @@ function createResourceParams$2(config) {
225
225
  };
226
226
  return resourceParams;
227
227
  }
228
- function keyBuilder$2(luvio, config) {
229
- const resourceParams = createResourceParams$2(config);
230
- return keyBuilder$3(luvio, resourceParams);
228
+ function keyBuilder$4(luvio, config) {
229
+ const resourceParams = createResourceParams$3(config);
230
+ return keyBuilder$5(luvio, resourceParams);
231
231
  }
232
- function typeCheckConfig$2(untrustedConfig) {
232
+ function typeCheckConfig$3(untrustedConfig) {
233
233
  const config = {};
234
234
  const untrustedConfig_externalDocumentId = untrustedConfig.externalDocumentId;
235
235
  if (typeof untrustedConfig_externalDocumentId === 'string') {
@@ -241,48 +241,48 @@ function typeCheckConfig$2(untrustedConfig) {
241
241
  }
242
242
  return config;
243
243
  }
244
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
244
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
245
245
  if (!untrustedIsObject(untrustedConfig)) {
246
246
  return null;
247
247
  }
248
248
  if (process.env.NODE_ENV !== 'production') {
249
249
  validateConfig(untrustedConfig, configPropertyNames);
250
250
  }
251
- const config = typeCheckConfig$2(untrustedConfig);
251
+ const config = typeCheckConfig$3(untrustedConfig);
252
252
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
253
253
  return null;
254
254
  }
255
255
  return config;
256
256
  }
257
- function adapterFragment(luvio, config) {
258
- createResourceParams$2(config);
259
- return select$4();
257
+ function adapterFragment$1(luvio, config) {
258
+ createResourceParams$3(config);
259
+ return select$6();
260
260
  }
261
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
262
- const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
261
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
262
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
263
263
  config,
264
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
264
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
265
265
  });
266
266
  return luvio.storeBroadcast().then(() => snapshot);
267
267
  }
268
- function onFetchResponseError(luvio, config, resourceParams, response) {
269
- const snapshot = ingestError(luvio, resourceParams, response, {
268
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
269
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
270
270
  config,
271
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
271
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
272
272
  });
273
273
  return luvio.storeBroadcast().then(() => snapshot);
274
274
  }
275
- function buildNetworkSnapshot$2(luvio, config, options) {
276
- const resourceParams = createResourceParams$2(config);
277
- const request = createResourceRequest$2(resourceParams);
275
+ function buildNetworkSnapshot$3(luvio, config, options) {
276
+ const resourceParams = createResourceParams$3(config);
277
+ const request = createResourceRequest$3(resourceParams);
278
278
  return luvio.dispatchResourceRequest(request, options)
279
279
  .then((response) => {
280
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
280
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
281
281
  }, (response) => {
282
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
282
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
283
283
  });
284
284
  }
285
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
285
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
286
286
  const { luvio, config } = context;
287
287
  const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
288
288
  const dispatchOptions = {
@@ -297,32 +297,32 @@ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext)
297
297
  priority: networkPriority
298
298
  };
299
299
  }
300
- return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
300
+ return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
301
301
  }
302
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
302
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
303
303
  const { luvio, config } = context;
304
304
  const selector = {
305
- recordId: keyBuilder$2(luvio, config),
306
- node: adapterFragment(luvio, config),
305
+ recordId: keyBuilder$4(luvio, config),
306
+ node: adapterFragment$1(luvio, config),
307
307
  variables: {},
308
308
  };
309
309
  const cacheSnapshot = storeLookup(selector, {
310
310
  config,
311
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
311
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
312
312
  });
313
313
  return cacheSnapshot;
314
314
  }
315
315
  const getExternalDocumentAdapterFactory = (luvio) => function ExternalDocument__getExternalDocument(untrustedConfig, requestContext) {
316
- const config = validateAdapterConfig$2(untrustedConfig, getExternalDocument_ConfigPropertyNames);
316
+ const config = validateAdapterConfig$3(untrustedConfig, getExternalDocument_ConfigPropertyNames);
317
317
  // Invalid or incomplete config
318
318
  if (config === null) {
319
319
  return null;
320
320
  }
321
321
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
322
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
322
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
323
323
  };
324
324
 
325
- function validate$3(obj, path = 'ExternalDocCreationInputRepresentation') {
325
+ function validate$5(obj, path = 'ExternalDocCreationInputRepresentation') {
326
326
  const v_error = (() => {
327
327
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
328
328
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -351,9 +351,9 @@ function validate$3(obj, path = 'ExternalDocCreationInputRepresentation') {
351
351
  return v_error === undefined ? null : v_error;
352
352
  }
353
353
 
354
- const TTL$1 = 60000;
355
- const VERSION$1 = "62b6ff2897ad48f08a170ff28e50d628";
356
- function validate$2(obj, path = 'ExternalDocCreationOutputRepresentation') {
354
+ const TTL$2 = 60000;
355
+ const VERSION$2 = "62b6ff2897ad48f08a170ff28e50d628";
356
+ function validate$4(obj, path = 'ExternalDocCreationOutputRepresentation') {
357
357
  const v_error = (() => {
358
358
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
359
359
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -381,88 +381,88 @@ function validate$2(obj, path = 'ExternalDocCreationOutputRepresentation') {
381
381
  })();
382
382
  return v_error === undefined ? null : v_error;
383
383
  }
384
- const RepresentationType$1 = 'ExternalDocCreationOutputRepresentation';
385
- function keyBuilder$1(luvio, config) {
386
- return keyPrefix + '::' + RepresentationType$1 + ':' + config.isSuccess;
384
+ const RepresentationType$2 = 'ExternalDocCreationOutputRepresentation';
385
+ function keyBuilder$3(luvio, config) {
386
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.isSuccess;
387
387
  }
388
388
  function keyBuilderFromType$1(luvio, object) {
389
389
  const keyParams = {
390
390
  isSuccess: object.isSuccess
391
391
  };
392
- return keyBuilder$1(luvio, keyParams);
392
+ return keyBuilder$3(luvio, keyParams);
393
393
  }
394
- function normalize$1(input, existing, path, luvio, store, timestamp) {
394
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
395
395
  return input;
396
396
  }
397
- const select$3 = function ExternalDocCreationOutputRepresentationSelect() {
397
+ const select$5 = function ExternalDocCreationOutputRepresentationSelect() {
398
398
  return {
399
399
  kind: 'Fragment',
400
- version: VERSION$1,
400
+ version: VERSION$2,
401
401
  private: [],
402
402
  opaque: true
403
403
  };
404
404
  };
405
- function equals$1(existing, incoming) {
405
+ function equals$2(existing, incoming) {
406
406
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
407
407
  return false;
408
408
  }
409
409
  return true;
410
410
  }
411
- const ingest$1 = function ExternalDocCreationOutputRepresentationIngest(input, path, luvio, store, timestamp) {
411
+ const ingest$2 = function ExternalDocCreationOutputRepresentationIngest(input, path, luvio, store, timestamp) {
412
412
  if (process.env.NODE_ENV !== 'production') {
413
- const validateError = validate$2(input);
413
+ const validateError = validate$4(input);
414
414
  if (validateError !== null) {
415
415
  throw validateError;
416
416
  }
417
417
  }
418
418
  const key = keyBuilderFromType$1(luvio, input);
419
419
  const existingRecord = store.readEntry(key);
420
- const ttlToUse = TTL$1;
421
- let incomingRecord = normalize$1(input, store.readEntry(key), {
420
+ const ttlToUse = TTL$2;
421
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
422
422
  fullPath: key,
423
423
  parent: path.parent,
424
424
  propertyName: path.propertyName,
425
425
  ttl: ttlToUse
426
426
  });
427
- if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
427
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
428
428
  luvio.storePublish(key, incomingRecord);
429
429
  }
430
430
  {
431
431
  const storeMetadataParams = {
432
432
  ttl: ttlToUse,
433
433
  namespace: "ExternalDocument",
434
- version: VERSION$1,
435
- representationName: RepresentationType$1,
434
+ version: VERSION$2,
435
+ representationName: RepresentationType$2,
436
436
  };
437
437
  luvio.publishStoreMetadata(key, storeMetadataParams);
438
438
  }
439
439
  return createLink(key);
440
440
  };
441
- function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
441
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
442
442
  const rootKeySet = new StoreKeyMap();
443
443
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
444
444
  const rootKey = keyBuilderFromType$1(luvio, input);
445
445
  rootKeySet.set(rootKey, {
446
446
  namespace: keyPrefix,
447
- representationName: RepresentationType$1,
447
+ representationName: RepresentationType$2,
448
448
  mergeable: false
449
449
  });
450
450
  return rootKeySet;
451
451
  }
452
452
 
453
- function select$2(luvio, params) {
454
- return select$3();
453
+ function select$4(luvio, params) {
454
+ return select$5();
455
455
  }
456
- function getResponseCacheKeys$1(luvio, resourceParams, response) {
457
- return getTypeCacheKeys$1(luvio, response);
456
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
457
+ return getTypeCacheKeys$2(luvio, response);
458
458
  }
459
- function ingestSuccess$1(luvio, resourceParams, response) {
459
+ function ingestSuccess$2(luvio, resourceParams, response) {
460
460
  const { body } = response;
461
461
  const key = keyBuilderFromType$1(luvio, body);
462
- luvio.storeIngest(key, ingest$1, body);
462
+ luvio.storeIngest(key, ingest$2, body);
463
463
  const snapshot = luvio.storeLookup({
464
464
  recordId: key,
465
- node: select$2(),
465
+ node: select$4(),
466
466
  variables: {},
467
467
  });
468
468
  if (process.env.NODE_ENV !== 'production') {
@@ -473,7 +473,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
473
473
  deepFreeze(snapshot.data);
474
474
  return snapshot;
475
475
  }
476
- function createResourceRequest$1(config) {
476
+ function createResourceRequest$2(config) {
477
477
  const headers = {};
478
478
  return {
479
479
  baseUri: '/services/data/v59.0',
@@ -494,7 +494,7 @@ const createExternalDocument_ConfigPropertyNames = {
494
494
  optional: []
495
495
  }
496
496
  };
497
- function createResourceParams$1(config) {
497
+ function createResourceParams$2(config) {
498
498
  const resourceParams = {
499
499
  body: {
500
500
  createExternalDocumentInput: config.createExternalDocumentInput
@@ -502,37 +502,37 @@ function createResourceParams$1(config) {
502
502
  };
503
503
  return resourceParams;
504
504
  }
505
- function typeCheckConfig$1(untrustedConfig) {
505
+ function typeCheckConfig$2(untrustedConfig) {
506
506
  const config = {};
507
507
  const untrustedConfig_createExternalDocumentInput = untrustedConfig.createExternalDocumentInput;
508
- const referenceExternalDocCreationInputRepresentationValidationError = validate$3(untrustedConfig_createExternalDocumentInput);
508
+ const referenceExternalDocCreationInputRepresentationValidationError = validate$5(untrustedConfig_createExternalDocumentInput);
509
509
  if (referenceExternalDocCreationInputRepresentationValidationError === null) {
510
510
  config.createExternalDocumentInput = untrustedConfig_createExternalDocumentInput;
511
511
  }
512
512
  return config;
513
513
  }
514
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
514
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
515
515
  if (!untrustedIsObject(untrustedConfig)) {
516
516
  return null;
517
517
  }
518
518
  if (process.env.NODE_ENV !== 'production') {
519
519
  validateConfig(untrustedConfig, configPropertyNames);
520
520
  }
521
- const config = typeCheckConfig$1(untrustedConfig);
521
+ const config = typeCheckConfig$2(untrustedConfig);
522
522
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
523
523
  return null;
524
524
  }
525
525
  return config;
526
526
  }
527
- function buildNetworkSnapshot$1(luvio, config, options) {
528
- const resourceParams = createResourceParams$1(config);
529
- const request = createResourceRequest$1(resourceParams);
527
+ function buildNetworkSnapshot$2(luvio, config, options) {
528
+ const resourceParams = createResourceParams$2(config);
529
+ const request = createResourceRequest$2(resourceParams);
530
530
  return luvio.dispatchResourceRequest(request, options)
531
531
  .then((response) => {
532
532
  return luvio.handleSuccessResponse(() => {
533
- const snapshot = ingestSuccess$1(luvio, resourceParams, response);
533
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
534
534
  return luvio.storeBroadcast().then(() => snapshot);
535
- }, () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
535
+ }, () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
536
536
  }, (response) => {
537
537
  deepFreeze(response);
538
538
  throw response;
@@ -540,16 +540,16 @@ function buildNetworkSnapshot$1(luvio, config, options) {
540
540
  }
541
541
  const createExternalDocumentAdapterFactory = (luvio) => {
542
542
  return function createExternalDocument(untrustedConfig) {
543
- const config = validateAdapterConfig$1(untrustedConfig, createExternalDocument_ConfigPropertyNames);
543
+ const config = validateAdapterConfig$2(untrustedConfig, createExternalDocument_ConfigPropertyNames);
544
544
  // Invalid or incomplete config
545
545
  if (config === null) {
546
546
  throw new Error('Invalid config for "createExternalDocument"');
547
547
  }
548
- return buildNetworkSnapshot$1(luvio, config);
548
+ return buildNetworkSnapshot$2(luvio, config);
549
549
  };
550
550
  };
551
551
 
552
- function validate$1(obj, path = 'SaveExternalDocumentInputRepresentation') {
552
+ function validate$3(obj, path = 'SaveExternalDocumentInputRepresentation') {
553
553
  const v_error = (() => {
554
554
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
555
555
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -573,9 +573,9 @@ function validate$1(obj, path = 'SaveExternalDocumentInputRepresentation') {
573
573
  return v_error === undefined ? null : v_error;
574
574
  }
575
575
 
576
- const TTL = 60000;
577
- const VERSION = "0073b6a90cebc73156c21fe3fd09256a";
578
- function validate(obj, path = 'SaveExternalDocumentRepresentation') {
576
+ const TTL$1 = 60000;
577
+ const VERSION$1 = "0073b6a90cebc73156c21fe3fd09256a";
578
+ function validate$2(obj, path = 'SaveExternalDocumentRepresentation') {
579
579
  const v_error = (() => {
580
580
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
581
581
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -600,88 +600,88 @@ function validate(obj, path = 'SaveExternalDocumentRepresentation') {
600
600
  })();
601
601
  return v_error === undefined ? null : v_error;
602
602
  }
603
- const RepresentationType = 'SaveExternalDocumentRepresentation';
604
- function keyBuilder(luvio, config) {
605
- return keyPrefix + '::' + RepresentationType + ':' + config.id;
603
+ const RepresentationType$1 = 'SaveExternalDocumentRepresentation';
604
+ function keyBuilder$2(luvio, config) {
605
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
606
606
  }
607
607
  function keyBuilderFromType(luvio, object) {
608
608
  const keyParams = {
609
609
  id: object.id
610
610
  };
611
- return keyBuilder(luvio, keyParams);
611
+ return keyBuilder$2(luvio, keyParams);
612
612
  }
613
- function normalize(input, existing, path, luvio, store, timestamp) {
613
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
614
614
  return input;
615
615
  }
616
- const select$1 = function SaveExternalDocumentRepresentationSelect() {
616
+ const select$3 = function SaveExternalDocumentRepresentationSelect() {
617
617
  return {
618
618
  kind: 'Fragment',
619
- version: VERSION,
619
+ version: VERSION$1,
620
620
  private: [],
621
621
  opaque: true
622
622
  };
623
623
  };
624
- function equals(existing, incoming) {
624
+ function equals$1(existing, incoming) {
625
625
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
626
626
  return false;
627
627
  }
628
628
  return true;
629
629
  }
630
- const ingest = function SaveExternalDocumentRepresentationIngest(input, path, luvio, store, timestamp) {
630
+ const ingest$1 = function SaveExternalDocumentRepresentationIngest(input, path, luvio, store, timestamp) {
631
631
  if (process.env.NODE_ENV !== 'production') {
632
- const validateError = validate(input);
632
+ const validateError = validate$2(input);
633
633
  if (validateError !== null) {
634
634
  throw validateError;
635
635
  }
636
636
  }
637
637
  const key = keyBuilderFromType(luvio, input);
638
638
  const existingRecord = store.readEntry(key);
639
- const ttlToUse = TTL;
640
- let incomingRecord = normalize(input, store.readEntry(key), {
639
+ const ttlToUse = TTL$1;
640
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
641
641
  fullPath: key,
642
642
  parent: path.parent,
643
643
  propertyName: path.propertyName,
644
644
  ttl: ttlToUse
645
645
  });
646
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
646
+ if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
647
647
  luvio.storePublish(key, incomingRecord);
648
648
  }
649
649
  {
650
650
  const storeMetadataParams = {
651
651
  ttl: ttlToUse,
652
652
  namespace: "ExternalDocument",
653
- version: VERSION,
654
- representationName: RepresentationType,
653
+ version: VERSION$1,
654
+ representationName: RepresentationType$1,
655
655
  };
656
656
  luvio.publishStoreMetadata(key, storeMetadataParams);
657
657
  }
658
658
  return createLink(key);
659
659
  };
660
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
660
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
661
661
  const rootKeySet = new StoreKeyMap();
662
662
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
663
663
  const rootKey = keyBuilderFromType(luvio, input);
664
664
  rootKeySet.set(rootKey, {
665
665
  namespace: keyPrefix,
666
- representationName: RepresentationType,
666
+ representationName: RepresentationType$1,
667
667
  mergeable: false
668
668
  });
669
669
  return rootKeySet;
670
670
  }
671
671
 
672
- function select(luvio, params) {
673
- return select$1();
672
+ function select$2(luvio, params) {
673
+ return select$3();
674
674
  }
675
- function getResponseCacheKeys(luvio, resourceParams, response) {
676
- return getTypeCacheKeys(luvio, response);
675
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
676
+ return getTypeCacheKeys$1(luvio, response);
677
677
  }
678
- function ingestSuccess(luvio, resourceParams, response) {
678
+ function ingestSuccess$1(luvio, resourceParams, response) {
679
679
  const { body } = response;
680
680
  const key = keyBuilderFromType(luvio, body);
681
- luvio.storeIngest(key, ingest, body);
681
+ luvio.storeIngest(key, ingest$1, body);
682
682
  const snapshot = luvio.storeLookup({
683
683
  recordId: key,
684
- node: select(),
684
+ node: select$2(),
685
685
  variables: {},
686
686
  });
687
687
  if (process.env.NODE_ENV !== 'production') {
@@ -692,7 +692,7 @@ function ingestSuccess(luvio, resourceParams, response) {
692
692
  deepFreeze(snapshot.data);
693
693
  return snapshot;
694
694
  }
695
- function createResourceRequest(config) {
695
+ function createResourceRequest$1(config) {
696
696
  const headers = {};
697
697
  return {
698
698
  baseUri: '/services/data/v59.0',
@@ -713,7 +713,7 @@ const saveExternalDocument_ConfigPropertyNames = {
713
713
  optional: []
714
714
  }
715
715
  };
716
- function createResourceParams(config) {
716
+ function createResourceParams$1(config) {
717
717
  const resourceParams = {
718
718
  body: {
719
719
  saveExternalDocumentInput: config.saveExternalDocumentInput
@@ -721,37 +721,37 @@ function createResourceParams(config) {
721
721
  };
722
722
  return resourceParams;
723
723
  }
724
- function typeCheckConfig(untrustedConfig) {
724
+ function typeCheckConfig$1(untrustedConfig) {
725
725
  const config = {};
726
726
  const untrustedConfig_saveExternalDocumentInput = untrustedConfig.saveExternalDocumentInput;
727
- const referenceSaveExternalDocumentInputRepresentationValidationError = validate$1(untrustedConfig_saveExternalDocumentInput);
727
+ const referenceSaveExternalDocumentInputRepresentationValidationError = validate$3(untrustedConfig_saveExternalDocumentInput);
728
728
  if (referenceSaveExternalDocumentInputRepresentationValidationError === null) {
729
729
  config.saveExternalDocumentInput = untrustedConfig_saveExternalDocumentInput;
730
730
  }
731
731
  return config;
732
732
  }
733
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
733
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
734
734
  if (!untrustedIsObject(untrustedConfig)) {
735
735
  return null;
736
736
  }
737
737
  if (process.env.NODE_ENV !== 'production') {
738
738
  validateConfig(untrustedConfig, configPropertyNames);
739
739
  }
740
- const config = typeCheckConfig(untrustedConfig);
740
+ const config = typeCheckConfig$1(untrustedConfig);
741
741
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
742
742
  return null;
743
743
  }
744
744
  return config;
745
745
  }
746
- function buildNetworkSnapshot(luvio, config, options) {
747
- const resourceParams = createResourceParams(config);
748
- const request = createResourceRequest(resourceParams);
746
+ function buildNetworkSnapshot$1(luvio, config, options) {
747
+ const resourceParams = createResourceParams$1(config);
748
+ const request = createResourceRequest$1(resourceParams);
749
749
  return luvio.dispatchResourceRequest(request, options)
750
750
  .then((response) => {
751
751
  return luvio.handleSuccessResponse(() => {
752
- const snapshot = ingestSuccess(luvio, resourceParams, response);
752
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
753
753
  return luvio.storeBroadcast().then(() => snapshot);
754
- }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
754
+ }, () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
755
755
  }, (response) => {
756
756
  deepFreeze(response);
757
757
  throw response;
@@ -759,13 +759,300 @@ function buildNetworkSnapshot(luvio, config, options) {
759
759
  }
760
760
  const saveExternalDocumentAdapterFactory = (luvio) => {
761
761
  return function saveExternalDocument(untrustedConfig) {
762
- const config = validateAdapterConfig(untrustedConfig, saveExternalDocument_ConfigPropertyNames);
762
+ const config = validateAdapterConfig$1(untrustedConfig, saveExternalDocument_ConfigPropertyNames);
763
763
  // Invalid or incomplete config
764
764
  if (config === null) {
765
765
  throw new Error('Invalid config for "saveExternalDocument"');
766
766
  }
767
- return buildNetworkSnapshot(luvio, config);
767
+ return buildNetworkSnapshot$1(luvio, config);
768
+ };
769
+ };
770
+
771
+ function validate$1(obj, path = 'ExternalDocumentUsersOutputRepresentation') {
772
+ const v_error = (() => {
773
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
774
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
775
+ }
776
+ const obj_displayName = obj.displayName;
777
+ const path_displayName = path + '.displayName';
778
+ if (typeof obj_displayName !== 'string') {
779
+ return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
780
+ }
781
+ const obj_documentUserId = obj.documentUserId;
782
+ const path_documentUserId = path + '.documentUserId';
783
+ if (typeof obj_documentUserId !== 'string') {
784
+ return new TypeError('Expected "string" but received "' + typeof obj_documentUserId + '" (at "' + path_documentUserId + '")');
785
+ }
786
+ const obj_email = obj.email;
787
+ const path_email = path + '.email';
788
+ if (typeof obj_email !== 'string') {
789
+ return new TypeError('Expected "string" but received "' + typeof obj_email + '" (at "' + path_email + '")');
790
+ }
791
+ })();
792
+ return v_error === undefined ? null : v_error;
793
+ }
794
+
795
+ const TTL = 60000;
796
+ const VERSION = "2ab4b143223f447d344e1c9628013030";
797
+ function validate(obj, path = 'ExternalDocumentUsersListOutputRepresentation') {
798
+ const v_error = (() => {
799
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
800
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
801
+ }
802
+ if (obj.code !== undefined) {
803
+ const obj_code = obj.code;
804
+ const path_code = path + '.code';
805
+ if (typeof obj_code !== 'string') {
806
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
807
+ }
808
+ }
809
+ if (obj.message !== undefined) {
810
+ const obj_message = obj.message;
811
+ const path_message = path + '.message';
812
+ if (typeof obj_message !== 'string') {
813
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
814
+ }
815
+ }
816
+ const obj_users = obj.users;
817
+ const path_users = path + '.users';
818
+ if (!ArrayIsArray(obj_users)) {
819
+ return new TypeError('Expected "array" but received "' + typeof obj_users + '" (at "' + path_users + '")');
820
+ }
821
+ for (let i = 0; i < obj_users.length; i++) {
822
+ const obj_users_item = obj_users[i];
823
+ const path_users_item = path_users + '[' + i + ']';
824
+ const referencepath_users_itemValidationError = validate$1(obj_users_item, path_users_item);
825
+ if (referencepath_users_itemValidationError !== null) {
826
+ let message = 'Object doesn\'t match ExternalDocumentUsersOutputRepresentation (at "' + path_users_item + '")\n';
827
+ message += referencepath_users_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
828
+ return new TypeError(message);
829
+ }
830
+ }
831
+ })();
832
+ return v_error === undefined ? null : v_error;
833
+ }
834
+ const RepresentationType = 'ExternalDocumentUsersListOutputRepresentation';
835
+ function normalize(input, existing, path, luvio, store, timestamp) {
836
+ return input;
837
+ }
838
+ const select$1 = function ExternalDocumentUsersListOutputRepresentationSelect() {
839
+ return {
840
+ kind: 'Fragment',
841
+ version: VERSION,
842
+ private: [],
843
+ opaque: true
844
+ };
845
+ };
846
+ function equals(existing, incoming) {
847
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
848
+ return false;
849
+ }
850
+ return true;
851
+ }
852
+ const ingest = function ExternalDocumentUsersListOutputRepresentationIngest(input, path, luvio, store, timestamp) {
853
+ if (process.env.NODE_ENV !== 'production') {
854
+ const validateError = validate(input);
855
+ if (validateError !== null) {
856
+ throw validateError;
857
+ }
858
+ }
859
+ const key = path.fullPath;
860
+ const existingRecord = store.readEntry(key);
861
+ const ttlToUse = TTL;
862
+ let incomingRecord = normalize(input, store.readEntry(key), {
863
+ fullPath: key,
864
+ parent: path.parent,
865
+ propertyName: path.propertyName,
866
+ ttl: ttlToUse
867
+ });
868
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
869
+ luvio.storePublish(key, incomingRecord);
870
+ }
871
+ {
872
+ const storeMetadataParams = {
873
+ ttl: ttlToUse,
874
+ namespace: "ExternalDocument",
875
+ version: VERSION,
876
+ representationName: RepresentationType,
877
+ };
878
+ luvio.publishStoreMetadata(key, storeMetadataParams);
879
+ }
880
+ return createLink(key);
881
+ };
882
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
883
+ const rootKeySet = new StoreKeyMap();
884
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
885
+ const rootKey = fullPathFactory();
886
+ rootKeySet.set(rootKey, {
887
+ namespace: keyPrefix,
888
+ representationName: RepresentationType,
889
+ mergeable: false
890
+ });
891
+ return rootKeySet;
892
+ }
893
+
894
+ function select(luvio, params) {
895
+ return select$1();
896
+ }
897
+ function keyBuilder$1(luvio, params) {
898
+ return keyPrefix + '::ExternalDocumentUsersListOutputRepresentation:(' + 'externalDocumentId:' + params.queryParams.externalDocumentId + ',' + 'startsWith:' + params.queryParams.startsWith + ')';
899
+ }
900
+ function getResponseCacheKeys(luvio, resourceParams, response) {
901
+ return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
902
+ }
903
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
904
+ const { body } = response;
905
+ const key = keyBuilder$1(luvio, resourceParams);
906
+ luvio.storeIngest(key, ingest, body);
907
+ const snapshot = luvio.storeLookup({
908
+ recordId: key,
909
+ node: select(),
910
+ variables: {},
911
+ }, snapshotRefresh);
912
+ if (process.env.NODE_ENV !== 'production') {
913
+ if (snapshot.state !== 'Fulfilled') {
914
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
915
+ }
916
+ }
917
+ deepFreeze(snapshot.data);
918
+ return snapshot;
919
+ }
920
+ function ingestError(luvio, params, error, snapshotRefresh) {
921
+ const key = keyBuilder$1(luvio, params);
922
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
923
+ const storeMetadataParams = {
924
+ ttl: TTL,
925
+ namespace: keyPrefix,
926
+ version: VERSION,
927
+ representationName: RepresentationType
928
+ };
929
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
930
+ return errorSnapshot;
931
+ }
932
+ function createResourceRequest(config) {
933
+ const headers = {};
934
+ return {
935
+ baseUri: '/services/data/v59.0',
936
+ basePath: '/connect/external-document/users',
937
+ method: 'get',
938
+ body: null,
939
+ urlParams: {},
940
+ queryParams: config.queryParams,
941
+ headers,
942
+ priority: 'normal',
768
943
  };
944
+ }
945
+
946
+ const getExternalDocumentUsers_ConfigPropertyNames = {
947
+ displayName: 'getExternalDocumentUsers',
948
+ parameters: {
949
+ required: [],
950
+ optional: ['externalDocumentId', 'startsWith']
951
+ }
952
+ };
953
+ function createResourceParams(config) {
954
+ const resourceParams = {
955
+ queryParams: {
956
+ externalDocumentId: config.externalDocumentId, startsWith: config.startsWith
957
+ }
958
+ };
959
+ return resourceParams;
960
+ }
961
+ function keyBuilder(luvio, config) {
962
+ const resourceParams = createResourceParams(config);
963
+ return keyBuilder$1(luvio, resourceParams);
964
+ }
965
+ function typeCheckConfig(untrustedConfig) {
966
+ const config = {};
967
+ const untrustedConfig_externalDocumentId = untrustedConfig.externalDocumentId;
968
+ if (typeof untrustedConfig_externalDocumentId === 'string') {
969
+ config.externalDocumentId = untrustedConfig_externalDocumentId;
970
+ }
971
+ const untrustedConfig_startsWith = untrustedConfig.startsWith;
972
+ if (typeof untrustedConfig_startsWith === 'string') {
973
+ config.startsWith = untrustedConfig_startsWith;
974
+ }
975
+ return config;
976
+ }
977
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
978
+ if (!untrustedIsObject(untrustedConfig)) {
979
+ return null;
980
+ }
981
+ if (process.env.NODE_ENV !== 'production') {
982
+ validateConfig(untrustedConfig, configPropertyNames);
983
+ }
984
+ const config = typeCheckConfig(untrustedConfig);
985
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
986
+ return null;
987
+ }
988
+ return config;
989
+ }
990
+ function adapterFragment(luvio, config) {
991
+ createResourceParams(config);
992
+ return select();
993
+ }
994
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
995
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
996
+ config,
997
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
998
+ });
999
+ return luvio.storeBroadcast().then(() => snapshot);
1000
+ }
1001
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1002
+ const snapshot = ingestError(luvio, resourceParams, response, {
1003
+ config,
1004
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1005
+ });
1006
+ return luvio.storeBroadcast().then(() => snapshot);
1007
+ }
1008
+ function buildNetworkSnapshot(luvio, config, options) {
1009
+ const resourceParams = createResourceParams(config);
1010
+ const request = createResourceRequest(resourceParams);
1011
+ return luvio.dispatchResourceRequest(request, options)
1012
+ .then((response) => {
1013
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
1014
+ }, (response) => {
1015
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1016
+ });
1017
+ }
1018
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1019
+ const { luvio, config } = context;
1020
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1021
+ const dispatchOptions = {
1022
+ resourceRequestContext: {
1023
+ requestCorrelator,
1024
+ luvioRequestMethod: undefined,
1025
+ },
1026
+ eventObservers
1027
+ };
1028
+ if (networkPriority !== 'normal') {
1029
+ dispatchOptions.overrides = {
1030
+ priority: networkPriority
1031
+ };
1032
+ }
1033
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
1034
+ }
1035
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1036
+ const { luvio, config } = context;
1037
+ const selector = {
1038
+ recordId: keyBuilder(luvio, config),
1039
+ node: adapterFragment(luvio, config),
1040
+ variables: {},
1041
+ };
1042
+ const cacheSnapshot = storeLookup(selector, {
1043
+ config,
1044
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1045
+ });
1046
+ return cacheSnapshot;
1047
+ }
1048
+ const getExternalDocumentUsersAdapterFactory = (luvio) => function ExternalDocument__getExternalDocumentUsers(untrustedConfig, requestContext) {
1049
+ const config = validateAdapterConfig(untrustedConfig, getExternalDocumentUsers_ConfigPropertyNames);
1050
+ // Invalid or incomplete config
1051
+ if (config === null) {
1052
+ return null;
1053
+ }
1054
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1055
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
769
1056
  };
770
1057
 
771
- export { createExternalDocumentAdapterFactory, getExternalDocumentAdapterFactory, saveExternalDocumentAdapterFactory };
1058
+ export { createExternalDocumentAdapterFactory, getExternalDocumentAdapterFactory, getExternalDocumentUsersAdapterFactory, saveExternalDocumentAdapterFactory };