@salesforce/lds-adapters-revenue-billing-batch 1.272.0 → 1.273.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sfdc/index.js CHANGED
@@ -12,11 +12,13 @@
12
12
  * *******************************************************************************************
13
13
  */
14
14
  /* proxy-compat-disable */
15
+ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
15
16
  import { withDefaultLuvio } from 'force/ldsEngine';
16
- import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$2 } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$3, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$3 } from 'force/luvioEngine';
17
18
 
18
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
19
20
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
21
+ const { stringify: JSONStringify$1 } = JSON;
20
22
  const { isArray: ArrayIsArray$1 } = Array;
21
23
  /**
22
24
  * Validates an adapter config is well-formed.
@@ -50,6 +52,68 @@ function untrustedIsObject(untrusted) {
50
52
  function areRequiredParametersPresent(config, configPropertyNames) {
51
53
  return configPropertyNames.parameters.required.every(req => req in config);
52
54
  }
55
+ const snapshotRefreshOptions = {
56
+ overrides: {
57
+ headers: {
58
+ 'Cache-Control': 'no-cache',
59
+ },
60
+ }
61
+ };
62
+ /**
63
+ * A deterministic JSON stringify implementation. Heavily adapted from https://github.com/epoberezkin/fast-json-stable-stringify.
64
+ * This is needed because insertion order for JSON.stringify(object) affects output:
65
+ * JSON.stringify({a: 1, b: 2})
66
+ * "{"a":1,"b":2}"
67
+ * JSON.stringify({b: 2, a: 1})
68
+ * "{"b":2,"a":1}"
69
+ * @param data Data to be JSON-stringified.
70
+ * @returns JSON.stringified value with consistent ordering of keys.
71
+ */
72
+ function stableJSONStringify(node) {
73
+ // This is for Date values.
74
+ if (node && node.toJSON && typeof node.toJSON === 'function') {
75
+ // eslint-disable-next-line no-param-reassign
76
+ node = node.toJSON();
77
+ }
78
+ if (node === undefined) {
79
+ return;
80
+ }
81
+ if (typeof node === 'number') {
82
+ return isFinite(node) ? '' + node : 'null';
83
+ }
84
+ if (typeof node !== 'object') {
85
+ return JSONStringify$1(node);
86
+ }
87
+ let i;
88
+ let out;
89
+ if (ArrayIsArray$1(node)) {
90
+ out = '[';
91
+ for (i = 0; i < node.length; i++) {
92
+ if (i) {
93
+ out += ',';
94
+ }
95
+ out += stableJSONStringify(node[i]) || 'null';
96
+ }
97
+ return out + ']';
98
+ }
99
+ if (node === null) {
100
+ return 'null';
101
+ }
102
+ const keys = ObjectKeys(node).sort();
103
+ out = '';
104
+ for (i = 0; i < keys.length; i++) {
105
+ const key = keys[i];
106
+ const value = stableJSONStringify(node[key]);
107
+ if (!value) {
108
+ continue;
109
+ }
110
+ if (out) {
111
+ out += ',';
112
+ }
113
+ out += JSONStringify$1(key) + ':' + value;
114
+ }
115
+ return '{' + out + '}';
116
+ }
53
117
  function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
54
118
  return {
55
119
  name,
@@ -81,7 +145,7 @@ function createLink(ref) {
81
145
  };
82
146
  }
83
147
 
84
- function validate$6(obj, path = 'ScheduleOptionsInputRepresentationForInvoice') {
148
+ function validate$7(obj, path = 'ScheduleOptionsInputRepresentationForInvoice') {
85
149
  const v_error = (() => {
86
150
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
87
151
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -132,8 +196,8 @@ function validate$6(obj, path = 'ScheduleOptionsInputRepresentationForInvoice')
132
196
  return v_error === undefined ? null : v_error;
133
197
  }
134
198
 
135
- function validate$5(obj, path = 'BatchInvoiceSchedulerInputRepresentation') {
136
- const validateScheduleOptionsInputRepresentationForInvoice_validateError = validate$6(obj, path);
199
+ function validate$6(obj, path = 'BatchInvoiceSchedulerInputRepresentation') {
200
+ const validateScheduleOptionsInputRepresentationForInvoice_validateError = validate$7(obj, path);
137
201
  if (validateScheduleOptionsInputRepresentationForInvoice_validateError !== null) {
138
202
  return validateScheduleOptionsInputRepresentationForInvoice_validateError;
139
203
  }
@@ -159,7 +223,7 @@ function validate$5(obj, path = 'BatchInvoiceSchedulerInputRepresentation') {
159
223
  return v_error === undefined ? null : v_error;
160
224
  }
161
225
 
162
- function validate$4(obj, path = 'BillingBatchSchedulerRepresentation') {
226
+ function validate$5(obj, path = 'BillingBatchSchedulerRepresentation') {
163
227
  const v_error = (() => {
164
228
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
165
229
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -173,16 +237,16 @@ function validate$4(obj, path = 'BillingBatchSchedulerRepresentation') {
173
237
  return v_error === undefined ? null : v_error;
174
238
  }
175
239
 
176
- const TTL$1 = 1000;
177
- const VERSION$1 = "15c358b0b4903143c526f63f4010b958";
178
- function validate$3(obj, path = 'InvoicesBatchSchedulerOutputRepresentation') {
240
+ const TTL$2 = 1000;
241
+ const VERSION$2 = "15c358b0b4903143c526f63f4010b958";
242
+ function validate$4(obj, path = 'InvoicesBatchSchedulerOutputRepresentation') {
179
243
  const v_error = (() => {
180
244
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
181
245
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
182
246
  }
183
247
  const obj_billingBatchScheduler = obj.billingBatchScheduler;
184
248
  const path_billingBatchScheduler = path + '.billingBatchScheduler';
185
- const referencepath_billingBatchSchedulerValidationError = validate$4(obj_billingBatchScheduler, path_billingBatchScheduler);
249
+ const referencepath_billingBatchSchedulerValidationError = validate$5(obj_billingBatchScheduler, path_billingBatchScheduler);
186
250
  if (referencepath_billingBatchSchedulerValidationError !== null) {
187
251
  let message = 'Object doesn\'t match BillingBatchSchedulerRepresentation (at "' + path_billingBatchScheduler + '")\n';
188
252
  message += referencepath_billingBatchSchedulerValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -191,68 +255,68 @@ function validate$3(obj, path = 'InvoicesBatchSchedulerOutputRepresentation') {
191
255
  })();
192
256
  return v_error === undefined ? null : v_error;
193
257
  }
194
- const RepresentationType$1 = 'InvoicesBatchSchedulerOutputRepresentation';
195
- function keyBuilder$1(luvio, config) {
196
- return keyPrefix + '::' + RepresentationType$1 + ':' + config.billingBatchSchedulerId;
258
+ const RepresentationType$2 = 'InvoicesBatchSchedulerOutputRepresentation';
259
+ function keyBuilder$3(luvio, config) {
260
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.billingBatchSchedulerId;
197
261
  }
198
262
  function keyBuilderFromType$1(luvio, object) {
199
263
  const keyParams = {
200
264
  billingBatchSchedulerId: object.billingBatchScheduler.id
201
265
  };
202
- return keyBuilder$1(luvio, keyParams);
266
+ return keyBuilder$3(luvio, keyParams);
203
267
  }
204
- function normalize$1(input, existing, path, luvio, store, timestamp) {
268
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
205
269
  return input;
206
270
  }
207
- const select$3 = function InvoicesBatchSchedulerOutputRepresentationSelect() {
271
+ const select$5 = function InvoicesBatchSchedulerOutputRepresentationSelect() {
208
272
  return {
209
273
  kind: 'Fragment',
210
- version: VERSION$1,
274
+ version: VERSION$2,
211
275
  private: [],
212
276
  opaque: true
213
277
  };
214
278
  };
215
- function equals$1(existing, incoming) {
279
+ function equals$2(existing, incoming) {
216
280
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
217
281
  return false;
218
282
  }
219
283
  return true;
220
284
  }
221
- const ingest$1 = function InvoicesBatchSchedulerOutputRepresentationIngest(input, path, luvio, store, timestamp) {
285
+ const ingest$2 = function InvoicesBatchSchedulerOutputRepresentationIngest(input, path, luvio, store, timestamp) {
222
286
  if (process.env.NODE_ENV !== 'production') {
223
- const validateError = validate$3(input);
287
+ const validateError = validate$4(input);
224
288
  if (validateError !== null) {
225
289
  throw validateError;
226
290
  }
227
291
  }
228
292
  const key = keyBuilderFromType$1(luvio, input);
229
- const ttlToUse = TTL$1;
230
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "BillingBatch", VERSION$1, RepresentationType$1, equals$1);
293
+ const ttlToUse = TTL$2;
294
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "BillingBatch", VERSION$2, RepresentationType$2, equals$2);
231
295
  return createLink(key);
232
296
  };
233
- function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
297
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
234
298
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
235
299
  const rootKey = keyBuilderFromType$1(luvio, input);
236
300
  rootKeySet.set(rootKey, {
237
301
  namespace: keyPrefix,
238
- representationName: RepresentationType$1,
302
+ representationName: RepresentationType$2,
239
303
  mergeable: false
240
304
  });
241
305
  }
242
306
 
243
- function select$2(luvio, params) {
244
- return select$3();
307
+ function select$4(luvio, params) {
308
+ return select$5();
245
309
  }
246
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
247
- getTypeCacheKeys$1(storeKeyMap, luvio, response);
310
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
311
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
248
312
  }
249
- function ingestSuccess$1(luvio, resourceParams, response) {
313
+ function ingestSuccess$2(luvio, resourceParams, response) {
250
314
  const { body } = response;
251
315
  const key = keyBuilderFromType$1(luvio, body);
252
- luvio.storeIngest(key, ingest$1, body);
316
+ luvio.storeIngest(key, ingest$2, body);
253
317
  const snapshot = luvio.storeLookup({
254
318
  recordId: key,
255
- node: select$2(),
319
+ node: select$4(),
256
320
  variables: {},
257
321
  });
258
322
  if (process.env.NODE_ENV !== 'production') {
@@ -263,7 +327,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
263
327
  deepFreeze(snapshot.data);
264
328
  return snapshot;
265
329
  }
266
- function createResourceRequest$1(config) {
330
+ function createResourceRequest$2(config) {
267
331
  const headers = {};
268
332
  return {
269
333
  baseUri: '/services/data/v61.0',
@@ -277,45 +341,45 @@ function createResourceRequest$1(config) {
277
341
  };
278
342
  }
279
343
 
280
- const adapterName$1 = 'createInvoicesBatchScheduler';
344
+ const adapterName$2 = 'createInvoicesBatchScheduler';
281
345
  const createInvoicesBatchScheduler_ConfigPropertyMetadata = [
282
346
  generateParamConfigMetadata('BatchInvoiceSchedulerInput', true, 2 /* Body */, 4 /* Unsupported */),
283
347
  ];
284
- const createInvoicesBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createInvoicesBatchScheduler_ConfigPropertyMetadata);
285
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(createInvoicesBatchScheduler_ConfigPropertyMetadata);
286
- function typeCheckConfig$1(untrustedConfig) {
348
+ const createInvoicesBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createInvoicesBatchScheduler_ConfigPropertyMetadata);
349
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(createInvoicesBatchScheduler_ConfigPropertyMetadata);
350
+ function typeCheckConfig$2(untrustedConfig) {
287
351
  const config = {};
288
352
  const untrustedConfig_BatchInvoiceSchedulerInput = untrustedConfig.BatchInvoiceSchedulerInput;
289
- const referenceBatchInvoiceSchedulerInputRepresentationValidationError = validate$5(untrustedConfig_BatchInvoiceSchedulerInput);
353
+ const referenceBatchInvoiceSchedulerInputRepresentationValidationError = validate$6(untrustedConfig_BatchInvoiceSchedulerInput);
290
354
  if (referenceBatchInvoiceSchedulerInputRepresentationValidationError === null) {
291
355
  config.BatchInvoiceSchedulerInput = untrustedConfig_BatchInvoiceSchedulerInput;
292
356
  }
293
357
  return config;
294
358
  }
295
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
359
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
296
360
  if (!untrustedIsObject(untrustedConfig)) {
297
361
  return null;
298
362
  }
299
363
  if (process.env.NODE_ENV !== 'production') {
300
364
  validateConfig(untrustedConfig, configPropertyNames);
301
365
  }
302
- const config = typeCheckConfig$1(untrustedConfig);
366
+ const config = typeCheckConfig$2(untrustedConfig);
303
367
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
304
368
  return null;
305
369
  }
306
370
  return config;
307
371
  }
308
- function buildNetworkSnapshot$1(luvio, config, options) {
309
- const resourceParams = createResourceParams$1(config);
310
- const request = createResourceRequest$1(resourceParams);
372
+ function buildNetworkSnapshot$2(luvio, config, options) {
373
+ const resourceParams = createResourceParams$2(config);
374
+ const request = createResourceRequest$2(resourceParams);
311
375
  return luvio.dispatchResourceRequest(request, options)
312
376
  .then((response) => {
313
377
  return luvio.handleSuccessResponse(() => {
314
- const snapshot = ingestSuccess$1(luvio, resourceParams, response);
378
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
315
379
  return luvio.storeBroadcast().then(() => snapshot);
316
380
  }, () => {
317
381
  const cache = new StoreKeyMap();
318
- getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
382
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
319
383
  return cache;
320
384
  });
321
385
  }, (response) => {
@@ -325,16 +389,16 @@ function buildNetworkSnapshot$1(luvio, config, options) {
325
389
  }
326
390
  const createInvoicesBatchSchedulerAdapterFactory = (luvio) => {
327
391
  return function createInvoicesBatchScheduler(untrustedConfig) {
328
- const config = validateAdapterConfig$1(untrustedConfig, createInvoicesBatchScheduler_ConfigPropertyNames);
392
+ const config = validateAdapterConfig$2(untrustedConfig, createInvoicesBatchScheduler_ConfigPropertyNames);
329
393
  // Invalid or incomplete config
330
394
  if (config === null) {
331
395
  throw new Error('Invalid config for "createInvoicesBatchScheduler"');
332
396
  }
333
- return buildNetworkSnapshot$1(luvio, config);
397
+ return buildNetworkSnapshot$2(luvio, config);
334
398
  };
335
399
  };
336
400
 
337
- function validate$2(obj, path = 'ScheduleOptionsInputRepresentation') {
401
+ function validate$3(obj, path = 'ScheduleOptionsInputRepresentation') {
338
402
  const v_error = (() => {
339
403
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
340
404
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -382,8 +446,8 @@ function validate$2(obj, path = 'ScheduleOptionsInputRepresentation') {
382
446
  return v_error === undefined ? null : v_error;
383
447
  }
384
448
 
385
- function validate$1(obj, path = 'PaymentsBatchSchedulerInputRepresentation') {
386
- const validateScheduleOptionsInputRepresentation_validateError = validate$2(obj, path);
449
+ function validate$2(obj, path = 'PaymentsBatchSchedulerInputRepresentation') {
450
+ const validateScheduleOptionsInputRepresentation_validateError = validate$3(obj, path);
387
451
  if (validateScheduleOptionsInputRepresentation_validateError !== null) {
388
452
  return validateScheduleOptionsInputRepresentation_validateError;
389
453
  }
@@ -416,16 +480,16 @@ function validate$1(obj, path = 'PaymentsBatchSchedulerInputRepresentation') {
416
480
  return v_error === undefined ? null : v_error;
417
481
  }
418
482
 
419
- const TTL = 1000;
420
- const VERSION = "eff71edc32270b9a1e6e1779cb811c3c";
421
- function validate(obj, path = 'PaymentsBatchSchedulerOutputRepresentation') {
483
+ const TTL$1 = 1000;
484
+ const VERSION$1 = "eff71edc32270b9a1e6e1779cb811c3c";
485
+ function validate$1(obj, path = 'PaymentsBatchSchedulerOutputRepresentation') {
422
486
  const v_error = (() => {
423
487
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
424
488
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
425
489
  }
426
490
  const obj_billingBatchScheduler = obj.billingBatchScheduler;
427
491
  const path_billingBatchScheduler = path + '.billingBatchScheduler';
428
- const referencepath_billingBatchSchedulerValidationError = validate$4(obj_billingBatchScheduler, path_billingBatchScheduler);
492
+ const referencepath_billingBatchSchedulerValidationError = validate$5(obj_billingBatchScheduler, path_billingBatchScheduler);
429
493
  if (referencepath_billingBatchSchedulerValidationError !== null) {
430
494
  let message = 'Object doesn\'t match BillingBatchSchedulerRepresentation (at "' + path_billingBatchScheduler + '")\n';
431
495
  message += referencepath_billingBatchSchedulerValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -434,68 +498,68 @@ function validate(obj, path = 'PaymentsBatchSchedulerOutputRepresentation') {
434
498
  })();
435
499
  return v_error === undefined ? null : v_error;
436
500
  }
437
- const RepresentationType = 'PaymentsBatchSchedulerOutputRepresentation';
438
- function keyBuilder(luvio, config) {
439
- return keyPrefix + '::' + RepresentationType + ':' + config.billingBatchSchedulerId;
501
+ const RepresentationType$1 = 'PaymentsBatchSchedulerOutputRepresentation';
502
+ function keyBuilder$2(luvio, config) {
503
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.billingBatchSchedulerId;
440
504
  }
441
505
  function keyBuilderFromType(luvio, object) {
442
506
  const keyParams = {
443
507
  billingBatchSchedulerId: object.billingBatchScheduler.id
444
508
  };
445
- return keyBuilder(luvio, keyParams);
509
+ return keyBuilder$2(luvio, keyParams);
446
510
  }
447
- function normalize(input, existing, path, luvio, store, timestamp) {
511
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
448
512
  return input;
449
513
  }
450
- const select$1 = function PaymentsBatchSchedulerOutputRepresentationSelect() {
514
+ const select$3 = function PaymentsBatchSchedulerOutputRepresentationSelect() {
451
515
  return {
452
516
  kind: 'Fragment',
453
- version: VERSION,
517
+ version: VERSION$1,
454
518
  private: [],
455
519
  opaque: true
456
520
  };
457
521
  };
458
- function equals(existing, incoming) {
522
+ function equals$1(existing, incoming) {
459
523
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
460
524
  return false;
461
525
  }
462
526
  return true;
463
527
  }
464
- const ingest = function PaymentsBatchSchedulerOutputRepresentationIngest(input, path, luvio, store, timestamp) {
528
+ const ingest$1 = function PaymentsBatchSchedulerOutputRepresentationIngest(input, path, luvio, store, timestamp) {
465
529
  if (process.env.NODE_ENV !== 'production') {
466
- const validateError = validate(input);
530
+ const validateError = validate$1(input);
467
531
  if (validateError !== null) {
468
532
  throw validateError;
469
533
  }
470
534
  }
471
535
  const key = keyBuilderFromType(luvio, input);
472
- const ttlToUse = TTL;
473
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "BillingBatch", VERSION, RepresentationType, equals);
536
+ const ttlToUse = TTL$1;
537
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "BillingBatch", VERSION$1, RepresentationType$1, equals$1);
474
538
  return createLink(key);
475
539
  };
476
- function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
540
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
477
541
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
478
542
  const rootKey = keyBuilderFromType(luvio, input);
479
543
  rootKeySet.set(rootKey, {
480
544
  namespace: keyPrefix,
481
- representationName: RepresentationType,
545
+ representationName: RepresentationType$1,
482
546
  mergeable: false
483
547
  });
484
548
  }
485
549
 
486
- function select(luvio, params) {
487
- return select$1();
550
+ function select$2(luvio, params) {
551
+ return select$3();
488
552
  }
489
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
490
- getTypeCacheKeys(storeKeyMap, luvio, response);
553
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
554
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
491
555
  }
492
- function ingestSuccess(luvio, resourceParams, response) {
556
+ function ingestSuccess$1(luvio, resourceParams, response) {
493
557
  const { body } = response;
494
558
  const key = keyBuilderFromType(luvio, body);
495
- luvio.storeIngest(key, ingest, body);
559
+ luvio.storeIngest(key, ingest$1, body);
496
560
  const snapshot = luvio.storeLookup({
497
561
  recordId: key,
498
- node: select(),
562
+ node: select$2(),
499
563
  variables: {},
500
564
  });
501
565
  if (process.env.NODE_ENV !== 'production') {
@@ -506,7 +570,7 @@ function ingestSuccess(luvio, resourceParams, response) {
506
570
  deepFreeze(snapshot.data);
507
571
  return snapshot;
508
572
  }
509
- function createResourceRequest(config) {
573
+ function createResourceRequest$1(config) {
510
574
  const headers = {};
511
575
  return {
512
576
  baseUri: '/services/data/v61.0',
@@ -520,45 +584,45 @@ function createResourceRequest(config) {
520
584
  };
521
585
  }
522
586
 
523
- const adapterName = 'createPaymentsBatchScheduler';
587
+ const adapterName$1 = 'createPaymentsBatchScheduler';
524
588
  const createPaymentsBatchScheduler_ConfigPropertyMetadata = [
525
589
  generateParamConfigMetadata('PaymentsBatchSchedulerInput', true, 2 /* Body */, 4 /* Unsupported */),
526
590
  ];
527
- const createPaymentsBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createPaymentsBatchScheduler_ConfigPropertyMetadata);
528
- const createResourceParams = /*#__PURE__*/ createResourceParams$2(createPaymentsBatchScheduler_ConfigPropertyMetadata);
529
- function typeCheckConfig(untrustedConfig) {
591
+ const createPaymentsBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createPaymentsBatchScheduler_ConfigPropertyMetadata);
592
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(createPaymentsBatchScheduler_ConfigPropertyMetadata);
593
+ function typeCheckConfig$1(untrustedConfig) {
530
594
  const config = {};
531
595
  const untrustedConfig_PaymentsBatchSchedulerInput = untrustedConfig.PaymentsBatchSchedulerInput;
532
- const referencePaymentsBatchSchedulerInputRepresentationValidationError = validate$1(untrustedConfig_PaymentsBatchSchedulerInput);
596
+ const referencePaymentsBatchSchedulerInputRepresentationValidationError = validate$2(untrustedConfig_PaymentsBatchSchedulerInput);
533
597
  if (referencePaymentsBatchSchedulerInputRepresentationValidationError === null) {
534
598
  config.PaymentsBatchSchedulerInput = untrustedConfig_PaymentsBatchSchedulerInput;
535
599
  }
536
600
  return config;
537
601
  }
538
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
602
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
539
603
  if (!untrustedIsObject(untrustedConfig)) {
540
604
  return null;
541
605
  }
542
606
  if (process.env.NODE_ENV !== 'production') {
543
607
  validateConfig(untrustedConfig, configPropertyNames);
544
608
  }
545
- const config = typeCheckConfig(untrustedConfig);
609
+ const config = typeCheckConfig$1(untrustedConfig);
546
610
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
547
611
  return null;
548
612
  }
549
613
  return config;
550
614
  }
551
- function buildNetworkSnapshot(luvio, config, options) {
552
- const resourceParams = createResourceParams(config);
553
- const request = createResourceRequest(resourceParams);
615
+ function buildNetworkSnapshot$1(luvio, config, options) {
616
+ const resourceParams = createResourceParams$1(config);
617
+ const request = createResourceRequest$1(resourceParams);
554
618
  return luvio.dispatchResourceRequest(request, options)
555
619
  .then((response) => {
556
620
  return luvio.handleSuccessResponse(() => {
557
- const snapshot = ingestSuccess(luvio, resourceParams, response);
621
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
558
622
  return luvio.storeBroadcast().then(() => snapshot);
559
623
  }, () => {
560
624
  const cache = new StoreKeyMap();
561
- getResponseCacheKeys(cache, luvio, resourceParams, response.body);
625
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
562
626
  return cache;
563
627
  });
564
628
  }, (response) => {
@@ -568,20 +632,257 @@ function buildNetworkSnapshot(luvio, config, options) {
568
632
  }
569
633
  const createPaymentsBatchSchedulerAdapterFactory = (luvio) => {
570
634
  return function createPaymentsBatchScheduler(untrustedConfig) {
571
- const config = validateAdapterConfig(untrustedConfig, createPaymentsBatchScheduler_ConfigPropertyNames);
635
+ const config = validateAdapterConfig$1(untrustedConfig, createPaymentsBatchScheduler_ConfigPropertyNames);
572
636
  // Invalid or incomplete config
573
637
  if (config === null) {
574
638
  throw new Error('Invalid config for "createPaymentsBatchScheduler"');
575
639
  }
576
- return buildNetworkSnapshot(luvio, config);
640
+ return buildNetworkSnapshot$1(luvio, config);
641
+ };
642
+ };
643
+
644
+ const TTL = 1000;
645
+ const VERSION = "4f294efd1302feb8c06cda89d151e387";
646
+ function validate(obj, path = 'InvoiceBatchDraftToPostedOutputRepresentation') {
647
+ const v_error = (() => {
648
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
649
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
650
+ }
651
+ const obj_invoiceBatchDraftToPostedId = obj.invoiceBatchDraftToPostedId;
652
+ const path_invoiceBatchDraftToPostedId = path + '.invoiceBatchDraftToPostedId';
653
+ if (typeof obj_invoiceBatchDraftToPostedId !== 'string') {
654
+ return new TypeError('Expected "string" but received "' + typeof obj_invoiceBatchDraftToPostedId + '" (at "' + path_invoiceBatchDraftToPostedId + '")');
655
+ }
656
+ const obj_requestIdentifier = obj.requestIdentifier;
657
+ const path_requestIdentifier = path + '.requestIdentifier';
658
+ if (typeof obj_requestIdentifier !== 'string') {
659
+ return new TypeError('Expected "string" but received "' + typeof obj_requestIdentifier + '" (at "' + path_requestIdentifier + '")');
660
+ }
661
+ const obj_success = obj.success;
662
+ const path_success = path + '.success';
663
+ if (typeof obj_success !== 'boolean') {
664
+ return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
665
+ }
666
+ })();
667
+ return v_error === undefined ? null : v_error;
668
+ }
669
+ const RepresentationType = 'InvoiceBatchDraftToPostedOutputRepresentation';
670
+ function normalize(input, existing, path, luvio, store, timestamp) {
671
+ return input;
672
+ }
673
+ const select$1 = function InvoiceBatchDraftToPostedOutputRepresentationSelect() {
674
+ return {
675
+ kind: 'Fragment',
676
+ version: VERSION,
677
+ private: [],
678
+ selections: [
679
+ {
680
+ name: 'invoiceBatchDraftToPostedId',
681
+ kind: 'Scalar'
682
+ },
683
+ {
684
+ name: 'requestIdentifier',
685
+ kind: 'Scalar'
686
+ },
687
+ {
688
+ name: 'success',
689
+ kind: 'Scalar'
690
+ }
691
+ ]
692
+ };
693
+ };
694
+ function equals(existing, incoming) {
695
+ const existing_success = existing.success;
696
+ const incoming_success = incoming.success;
697
+ if (!(existing_success === incoming_success)) {
698
+ return false;
699
+ }
700
+ const existing_invoiceBatchDraftToPostedId = existing.invoiceBatchDraftToPostedId;
701
+ const incoming_invoiceBatchDraftToPostedId = incoming.invoiceBatchDraftToPostedId;
702
+ if (!(existing_invoiceBatchDraftToPostedId === incoming_invoiceBatchDraftToPostedId)) {
703
+ return false;
704
+ }
705
+ const existing_requestIdentifier = existing.requestIdentifier;
706
+ const incoming_requestIdentifier = incoming.requestIdentifier;
707
+ if (!(existing_requestIdentifier === incoming_requestIdentifier)) {
708
+ return false;
709
+ }
710
+ return true;
711
+ }
712
+ const ingest = function InvoiceBatchDraftToPostedOutputRepresentationIngest(input, path, luvio, store, timestamp) {
713
+ if (process.env.NODE_ENV !== 'production') {
714
+ const validateError = validate(input);
715
+ if (validateError !== null) {
716
+ throw validateError;
717
+ }
718
+ }
719
+ const key = path.fullPath;
720
+ const ttlToUse = TTL;
721
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "BillingBatch", VERSION, RepresentationType, equals);
722
+ return createLink(key);
723
+ };
724
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
725
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
726
+ const rootKey = fullPathFactory();
727
+ rootKeySet.set(rootKey, {
728
+ namespace: keyPrefix,
729
+ representationName: RepresentationType,
730
+ mergeable: false
731
+ });
732
+ }
733
+
734
+ function select(luvio, params) {
735
+ return select$1();
736
+ }
737
+ function keyBuilder$1(luvio, params) {
738
+ return keyPrefix + '::InvoiceBatchDraftToPostedOutputRepresentation:(' + 'invoiceBatchRunId:' + params.urlParams.invoiceBatchRunId + ',' + stableJSONStringify(params.body) + ')';
739
+ }
740
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
741
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
742
+ }
743
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
744
+ const { body } = response;
745
+ const key = keyBuilder$1(luvio, resourceParams);
746
+ luvio.storeIngest(key, ingest, body);
747
+ const snapshot = luvio.storeLookup({
748
+ recordId: key,
749
+ node: select(),
750
+ variables: {},
751
+ }, snapshotRefresh);
752
+ if (process.env.NODE_ENV !== 'production') {
753
+ if (snapshot.state !== 'Fulfilled') {
754
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
755
+ }
756
+ }
757
+ deepFreeze(snapshot.data);
758
+ return snapshot;
759
+ }
760
+ function ingestError(luvio, params, error, snapshotRefresh) {
761
+ const key = keyBuilder$1(luvio, params);
762
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
763
+ const storeMetadataParams = {
764
+ ttl: TTL,
765
+ namespace: keyPrefix,
766
+ version: VERSION,
767
+ representationName: RepresentationType
577
768
  };
769
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
770
+ return errorSnapshot;
771
+ }
772
+ function createResourceRequest(config) {
773
+ const headers = {};
774
+ return {
775
+ baseUri: '/services/data/v61.0',
776
+ basePath: '/commerce/invoicing/invoice-batch-runs/' + config.urlParams.invoiceBatchRunId + '/actions/draft-to-posted',
777
+ method: 'post',
778
+ body: config.body,
779
+ urlParams: config.urlParams,
780
+ queryParams: {},
781
+ headers,
782
+ priority: 'normal',
783
+ };
784
+ }
785
+
786
+ const adapterName = 'postBatchDraftInvoices';
787
+ const postBatchDraftInvoices_ConfigPropertyMetadata = [
788
+ generateParamConfigMetadata('invoiceBatchRunId', true, 0 /* UrlParameter */, 0 /* String */),
789
+ ];
790
+ const postBatchDraftInvoices_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postBatchDraftInvoices_ConfigPropertyMetadata);
791
+ const createResourceParams = /*#__PURE__*/ createResourceParams$3(postBatchDraftInvoices_ConfigPropertyMetadata);
792
+ function keyBuilder(luvio, config) {
793
+ const resourceParams = createResourceParams(config);
794
+ return keyBuilder$1(luvio, resourceParams);
795
+ }
796
+ function typeCheckConfig(untrustedConfig) {
797
+ const config = {};
798
+ typeCheckConfig$3(untrustedConfig, config, postBatchDraftInvoices_ConfigPropertyMetadata);
799
+ return config;
800
+ }
801
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
802
+ if (!untrustedIsObject(untrustedConfig)) {
803
+ return null;
804
+ }
805
+ if (process.env.NODE_ENV !== 'production') {
806
+ validateConfig(untrustedConfig, configPropertyNames);
807
+ }
808
+ const config = typeCheckConfig(untrustedConfig);
809
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
810
+ return null;
811
+ }
812
+ return config;
813
+ }
814
+ function adapterFragment(luvio, config) {
815
+ createResourceParams(config);
816
+ return select();
817
+ }
818
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
819
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
820
+ config,
821
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
822
+ });
823
+ return luvio.storeBroadcast().then(() => snapshot);
824
+ }
825
+ function onFetchResponseError(luvio, config, resourceParams, response) {
826
+ const snapshot = ingestError(luvio, resourceParams, response, {
827
+ config,
828
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
829
+ });
830
+ return luvio.storeBroadcast().then(() => snapshot);
831
+ }
832
+ function buildNetworkSnapshot(luvio, config, options) {
833
+ const resourceParams = createResourceParams(config);
834
+ const request = createResourceRequest(resourceParams);
835
+ return luvio.dispatchResourceRequest(request, options)
836
+ .then((response) => {
837
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
838
+ const cache = new StoreKeyMap();
839
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
840
+ return cache;
841
+ });
842
+ }, (response) => {
843
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
844
+ });
845
+ }
846
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
847
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
848
+ }
849
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
850
+ const { luvio, config } = context;
851
+ const selector = {
852
+ recordId: keyBuilder(luvio, config),
853
+ node: adapterFragment(luvio, config),
854
+ variables: {},
855
+ };
856
+ const cacheSnapshot = storeLookup(selector, {
857
+ config,
858
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
859
+ });
860
+ return cacheSnapshot;
861
+ }
862
+ const postBatchDraftInvoicesAdapterFactory = (luvio) => function BillingBatch__postBatchDraftInvoices(untrustedConfig, requestContext) {
863
+ const config = validateAdapterConfig(untrustedConfig, postBatchDraftInvoices_ConfigPropertyNames);
864
+ // Invalid or incomplete config
865
+ if (config === null) {
866
+ return null;
867
+ }
868
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
869
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
578
870
  };
579
871
 
580
872
  let createInvoicesBatchScheduler;
581
873
  let createPaymentsBatchScheduler;
874
+ let postBatchDraftInvoices;
875
+ // Imperative GET Adapters
876
+ let postBatchDraftInvoices_imperative;
877
+ const postBatchDraftInvoicesMetadata = {
878
+ apiFamily: 'BillingBatch',
879
+ name: 'postBatchDraftInvoices',
880
+ ttl: 1000,
881
+ };
582
882
  // Notify Update Available
583
883
  function bindExportsTo(luvio) {
584
884
  // LDS Adapters
885
+ const postBatchDraftInvoices_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'postBatchDraftInvoices', postBatchDraftInvoicesAdapterFactory), postBatchDraftInvoicesMetadata);
585
886
  function unwrapSnapshotData(factory) {
586
887
  const adapter = factory(luvio);
587
888
  return (config) => adapter(config).then((snapshot) => snapshot.data);
@@ -589,13 +890,20 @@ function bindExportsTo(luvio) {
589
890
  return {
590
891
  createInvoicesBatchScheduler: unwrapSnapshotData(createInvoicesBatchSchedulerAdapterFactory),
591
892
  createPaymentsBatchScheduler: unwrapSnapshotData(createPaymentsBatchSchedulerAdapterFactory),
893
+ postBatchDraftInvoices: createWireAdapterConstructor(luvio, postBatchDraftInvoices_ldsAdapter, postBatchDraftInvoicesMetadata),
592
894
  // Imperative GET Adapters
895
+ postBatchDraftInvoices_imperative: createImperativeAdapter(luvio, postBatchDraftInvoices_ldsAdapter, postBatchDraftInvoicesMetadata),
593
896
  // Notify Update Availables
594
897
  };
595
898
  }
596
899
  withDefaultLuvio((luvio) => {
597
- ({ createInvoicesBatchScheduler, createPaymentsBatchScheduler } = bindExportsTo(luvio));
900
+ ({
901
+ createInvoicesBatchScheduler,
902
+ createPaymentsBatchScheduler,
903
+ postBatchDraftInvoices,
904
+ postBatchDraftInvoices_imperative,
905
+ } = bindExportsTo(luvio));
598
906
  });
599
907
 
600
- export { createInvoicesBatchScheduler, createPaymentsBatchScheduler };
601
- // version: 1.272.0-579ff1ba0
908
+ export { createInvoicesBatchScheduler, createPaymentsBatchScheduler, postBatchDraftInvoices, postBatchDraftInvoices_imperative };
909
+ // version: 1.273.1-e93c18811