@salesforce/lds-adapters-revenue-billing-batch 1.284.0 → 1.285.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.
- package/dist/es/es2018/revenue-billing-batch.js +418 -148
- package/dist/es/es2018/types/src/generated/adapters/postBatchInvoiceDocGen.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +2 -1
- package/dist/es/es2018/types/src/generated/resources/postCommerceBillingInvoicesInvoiceBatchDocgenActionsRunByInvoiceBatchRunId.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/types/BatchInvoiceDocGenErrorRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/BatchInvoiceDocGenOutputRepresentation.d.ts +45 -0
- package/package.json +4 -4
- package/sfdc/index.js +422 -149
- package/src/raml/api.raml +43 -1
- package/src/raml/luvio.raml +10 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$4, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$4 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
@@ -129,13 +129,26 @@ const keyPrefix = 'BillingBatch';
|
|
|
129
129
|
|
|
130
130
|
const { isArray: ArrayIsArray } = Array;
|
|
131
131
|
const { stringify: JSONStringify } = JSON;
|
|
132
|
+
function equalsArray(a, b, equalsItem) {
|
|
133
|
+
const aLength = a.length;
|
|
134
|
+
const bLength = b.length;
|
|
135
|
+
if (aLength !== bLength) {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
for (let i = 0; i < aLength; i++) {
|
|
139
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
132
145
|
function createLink(ref) {
|
|
133
146
|
return {
|
|
134
147
|
__ref: serializeStructuredKey(ref),
|
|
135
148
|
};
|
|
136
149
|
}
|
|
137
150
|
|
|
138
|
-
function validate$
|
|
151
|
+
function validate$9(obj, path = 'ScheduleOptionsInputRepresentation') {
|
|
139
152
|
const v_error = (() => {
|
|
140
153
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
141
154
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -183,8 +196,8 @@ function validate$7(obj, path = 'ScheduleOptionsInputRepresentation') {
|
|
|
183
196
|
return v_error === undefined ? null : v_error;
|
|
184
197
|
}
|
|
185
198
|
|
|
186
|
-
function validate$
|
|
187
|
-
const validateScheduleOptionsInputRepresentation_validateError = validate$
|
|
199
|
+
function validate$8(obj, path = 'PaymentsBatchSchedulerInputRepresentation') {
|
|
200
|
+
const validateScheduleOptionsInputRepresentation_validateError = validate$9(obj, path);
|
|
188
201
|
if (validateScheduleOptionsInputRepresentation_validateError !== null) {
|
|
189
202
|
return validateScheduleOptionsInputRepresentation_validateError;
|
|
190
203
|
}
|
|
@@ -217,7 +230,7 @@ function validate$6(obj, path = 'PaymentsBatchSchedulerInputRepresentation') {
|
|
|
217
230
|
return v_error === undefined ? null : v_error;
|
|
218
231
|
}
|
|
219
232
|
|
|
220
|
-
function validate$
|
|
233
|
+
function validate$7(obj, path = 'BillingBatchSchedulerRepresentation') {
|
|
221
234
|
const v_error = (() => {
|
|
222
235
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
223
236
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -231,16 +244,16 @@ function validate$5(obj, path = 'BillingBatchSchedulerRepresentation') {
|
|
|
231
244
|
return v_error === undefined ? null : v_error;
|
|
232
245
|
}
|
|
233
246
|
|
|
234
|
-
const TTL$
|
|
235
|
-
const VERSION$
|
|
236
|
-
function validate$
|
|
247
|
+
const TTL$3 = 1000;
|
|
248
|
+
const VERSION$4 = "eff71edc32270b9a1e6e1779cb811c3c";
|
|
249
|
+
function validate$6(obj, path = 'PaymentsBatchSchedulerOutputRepresentation') {
|
|
237
250
|
const v_error = (() => {
|
|
238
251
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
239
252
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
240
253
|
}
|
|
241
254
|
const obj_billingBatchScheduler = obj.billingBatchScheduler;
|
|
242
255
|
const path_billingBatchScheduler = path + '.billingBatchScheduler';
|
|
243
|
-
const referencepath_billingBatchSchedulerValidationError = validate$
|
|
256
|
+
const referencepath_billingBatchSchedulerValidationError = validate$7(obj_billingBatchScheduler, path_billingBatchScheduler);
|
|
244
257
|
if (referencepath_billingBatchSchedulerValidationError !== null) {
|
|
245
258
|
let message = 'Object doesn\'t match BillingBatchSchedulerRepresentation (at "' + path_billingBatchScheduler + '")\n';
|
|
246
259
|
message += referencepath_billingBatchSchedulerValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -249,68 +262,68 @@ function validate$4(obj, path = 'PaymentsBatchSchedulerOutputRepresentation') {
|
|
|
249
262
|
})();
|
|
250
263
|
return v_error === undefined ? null : v_error;
|
|
251
264
|
}
|
|
252
|
-
const RepresentationType$
|
|
253
|
-
function keyBuilder$
|
|
254
|
-
return keyPrefix + '::' + RepresentationType$
|
|
265
|
+
const RepresentationType$3 = 'PaymentsBatchSchedulerOutputRepresentation';
|
|
266
|
+
function keyBuilder$4(luvio, config) {
|
|
267
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.billingBatchSchedulerId;
|
|
255
268
|
}
|
|
256
|
-
function keyBuilderFromType$
|
|
269
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
257
270
|
const keyParams = {
|
|
258
271
|
billingBatchSchedulerId: object.billingBatchScheduler.id
|
|
259
272
|
};
|
|
260
|
-
return keyBuilder$
|
|
273
|
+
return keyBuilder$4(luvio, keyParams);
|
|
261
274
|
}
|
|
262
|
-
function normalize$
|
|
275
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
263
276
|
return input;
|
|
264
277
|
}
|
|
265
|
-
const select$
|
|
278
|
+
const select$8 = function PaymentsBatchSchedulerOutputRepresentationSelect() {
|
|
266
279
|
return {
|
|
267
280
|
kind: 'Fragment',
|
|
268
|
-
version: VERSION$
|
|
281
|
+
version: VERSION$4,
|
|
269
282
|
private: [],
|
|
270
283
|
opaque: true
|
|
271
284
|
};
|
|
272
285
|
};
|
|
273
|
-
function equals$
|
|
286
|
+
function equals$4(existing, incoming) {
|
|
274
287
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
275
288
|
return false;
|
|
276
289
|
}
|
|
277
290
|
return true;
|
|
278
291
|
}
|
|
279
|
-
const ingest$
|
|
292
|
+
const ingest$3 = function PaymentsBatchSchedulerOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
280
293
|
if (process.env.NODE_ENV !== 'production') {
|
|
281
|
-
const validateError = validate$
|
|
294
|
+
const validateError = validate$6(input);
|
|
282
295
|
if (validateError !== null) {
|
|
283
296
|
throw validateError;
|
|
284
297
|
}
|
|
285
298
|
}
|
|
286
|
-
const key = keyBuilderFromType$
|
|
287
|
-
const ttlToUse = TTL$
|
|
288
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
299
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
300
|
+
const ttlToUse = TTL$3;
|
|
301
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "BillingBatch", VERSION$4, RepresentationType$3, equals$4);
|
|
289
302
|
return createLink(key);
|
|
290
303
|
};
|
|
291
|
-
function getTypeCacheKeys$
|
|
304
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
292
305
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
293
|
-
const rootKey = keyBuilderFromType$
|
|
306
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
294
307
|
rootKeySet.set(rootKey, {
|
|
295
308
|
namespace: keyPrefix,
|
|
296
|
-
representationName: RepresentationType$
|
|
309
|
+
representationName: RepresentationType$3,
|
|
297
310
|
mergeable: false
|
|
298
311
|
});
|
|
299
312
|
}
|
|
300
313
|
|
|
301
|
-
function select$
|
|
302
|
-
return select$
|
|
314
|
+
function select$7(luvio, params) {
|
|
315
|
+
return select$8();
|
|
303
316
|
}
|
|
304
|
-
function getResponseCacheKeys$
|
|
305
|
-
getTypeCacheKeys$
|
|
317
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
318
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
306
319
|
}
|
|
307
|
-
function ingestSuccess$
|
|
320
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
308
321
|
const { body } = response;
|
|
309
|
-
const key = keyBuilderFromType$
|
|
310
|
-
luvio.storeIngest(key, ingest$
|
|
322
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
323
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
311
324
|
const snapshot = luvio.storeLookup({
|
|
312
325
|
recordId: key,
|
|
313
|
-
node: select$
|
|
326
|
+
node: select$7(),
|
|
314
327
|
variables: {},
|
|
315
328
|
});
|
|
316
329
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -321,7 +334,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
|
|
|
321
334
|
deepFreeze(snapshot.data);
|
|
322
335
|
return snapshot;
|
|
323
336
|
}
|
|
324
|
-
function createResourceRequest$
|
|
337
|
+
function createResourceRequest$3(config) {
|
|
325
338
|
const headers = {};
|
|
326
339
|
return {
|
|
327
340
|
baseUri: '/services/data/v61.0',
|
|
@@ -335,45 +348,45 @@ function createResourceRequest$2(config) {
|
|
|
335
348
|
};
|
|
336
349
|
}
|
|
337
350
|
|
|
338
|
-
const adapterName$
|
|
351
|
+
const adapterName$3 = 'createPaymentsBatchScheduler';
|
|
339
352
|
const createPaymentsBatchScheduler_ConfigPropertyMetadata = [
|
|
340
353
|
generateParamConfigMetadata('PaymentsBatchSchedulerInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
341
354
|
];
|
|
342
|
-
const createPaymentsBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
343
|
-
const createResourceParams$
|
|
344
|
-
function typeCheckConfig$
|
|
355
|
+
const createPaymentsBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createPaymentsBatchScheduler_ConfigPropertyMetadata);
|
|
356
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(createPaymentsBatchScheduler_ConfigPropertyMetadata);
|
|
357
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
345
358
|
const config = {};
|
|
346
359
|
const untrustedConfig_PaymentsBatchSchedulerInput = untrustedConfig.PaymentsBatchSchedulerInput;
|
|
347
|
-
const referencePaymentsBatchSchedulerInputRepresentationValidationError = validate$
|
|
360
|
+
const referencePaymentsBatchSchedulerInputRepresentationValidationError = validate$8(untrustedConfig_PaymentsBatchSchedulerInput);
|
|
348
361
|
if (referencePaymentsBatchSchedulerInputRepresentationValidationError === null) {
|
|
349
362
|
config.PaymentsBatchSchedulerInput = untrustedConfig_PaymentsBatchSchedulerInput;
|
|
350
363
|
}
|
|
351
364
|
return config;
|
|
352
365
|
}
|
|
353
|
-
function validateAdapterConfig$
|
|
366
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
354
367
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
355
368
|
return null;
|
|
356
369
|
}
|
|
357
370
|
if (process.env.NODE_ENV !== 'production') {
|
|
358
371
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
359
372
|
}
|
|
360
|
-
const config = typeCheckConfig$
|
|
373
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
361
374
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
362
375
|
return null;
|
|
363
376
|
}
|
|
364
377
|
return config;
|
|
365
378
|
}
|
|
366
|
-
function buildNetworkSnapshot$
|
|
367
|
-
const resourceParams = createResourceParams$
|
|
368
|
-
const request = createResourceRequest$
|
|
379
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
380
|
+
const resourceParams = createResourceParams$3(config);
|
|
381
|
+
const request = createResourceRequest$3(resourceParams);
|
|
369
382
|
return luvio.dispatchResourceRequest(request, options)
|
|
370
383
|
.then((response) => {
|
|
371
384
|
return luvio.handleSuccessResponse(() => {
|
|
372
|
-
const snapshot = ingestSuccess$
|
|
385
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
373
386
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
374
387
|
}, () => {
|
|
375
388
|
const cache = new StoreKeyMap();
|
|
376
|
-
getResponseCacheKeys$
|
|
389
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
377
390
|
return cache;
|
|
378
391
|
});
|
|
379
392
|
}, (response) => {
|
|
@@ -383,16 +396,16 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
383
396
|
}
|
|
384
397
|
const createPaymentsBatchSchedulerAdapterFactory = (luvio) => {
|
|
385
398
|
return function createPaymentsBatchScheduler(untrustedConfig) {
|
|
386
|
-
const config = validateAdapterConfig$
|
|
399
|
+
const config = validateAdapterConfig$3(untrustedConfig, createPaymentsBatchScheduler_ConfigPropertyNames);
|
|
387
400
|
// Invalid or incomplete config
|
|
388
401
|
if (config === null) {
|
|
389
402
|
throw new Error('Invalid config for "createPaymentsBatchScheduler"');
|
|
390
403
|
}
|
|
391
|
-
return buildNetworkSnapshot$
|
|
404
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
392
405
|
};
|
|
393
406
|
};
|
|
394
407
|
|
|
395
|
-
function validate$
|
|
408
|
+
function validate$5(obj, path = 'ScheduleOptionsInputRepresentationForInvoice') {
|
|
396
409
|
const v_error = (() => {
|
|
397
410
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
398
411
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -443,8 +456,8 @@ function validate$3(obj, path = 'ScheduleOptionsInputRepresentationForInvoice')
|
|
|
443
456
|
return v_error === undefined ? null : v_error;
|
|
444
457
|
}
|
|
445
458
|
|
|
446
|
-
function validate$
|
|
447
|
-
const validateScheduleOptionsInputRepresentationForInvoice_validateError = validate$
|
|
459
|
+
function validate$4(obj, path = 'BatchInvoiceSchedulerInputRepresentation') {
|
|
460
|
+
const validateScheduleOptionsInputRepresentationForInvoice_validateError = validate$5(obj, path);
|
|
448
461
|
if (validateScheduleOptionsInputRepresentationForInvoice_validateError !== null) {
|
|
449
462
|
return validateScheduleOptionsInputRepresentationForInvoice_validateError;
|
|
450
463
|
}
|
|
@@ -470,16 +483,16 @@ function validate$2(obj, path = 'BatchInvoiceSchedulerInputRepresentation') {
|
|
|
470
483
|
return v_error === undefined ? null : v_error;
|
|
471
484
|
}
|
|
472
485
|
|
|
473
|
-
const TTL$
|
|
474
|
-
const VERSION$
|
|
475
|
-
function validate$
|
|
486
|
+
const TTL$2 = 1000;
|
|
487
|
+
const VERSION$3 = "15c358b0b4903143c526f63f4010b958";
|
|
488
|
+
function validate$3(obj, path = 'InvoicesBatchSchedulerOutputRepresentation') {
|
|
476
489
|
const v_error = (() => {
|
|
477
490
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
478
491
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
479
492
|
}
|
|
480
493
|
const obj_billingBatchScheduler = obj.billingBatchScheduler;
|
|
481
494
|
const path_billingBatchScheduler = path + '.billingBatchScheduler';
|
|
482
|
-
const referencepath_billingBatchSchedulerValidationError = validate$
|
|
495
|
+
const referencepath_billingBatchSchedulerValidationError = validate$7(obj_billingBatchScheduler, path_billingBatchScheduler);
|
|
483
496
|
if (referencepath_billingBatchSchedulerValidationError !== null) {
|
|
484
497
|
let message = 'Object doesn\'t match BillingBatchSchedulerRepresentation (at "' + path_billingBatchScheduler + '")\n';
|
|
485
498
|
message += referencepath_billingBatchSchedulerValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -488,68 +501,68 @@ function validate$1(obj, path = 'InvoicesBatchSchedulerOutputRepresentation') {
|
|
|
488
501
|
})();
|
|
489
502
|
return v_error === undefined ? null : v_error;
|
|
490
503
|
}
|
|
491
|
-
const RepresentationType$
|
|
492
|
-
function keyBuilder$
|
|
493
|
-
return keyPrefix + '::' + RepresentationType$
|
|
504
|
+
const RepresentationType$2 = 'InvoicesBatchSchedulerOutputRepresentation';
|
|
505
|
+
function keyBuilder$3(luvio, config) {
|
|
506
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.billingBatchSchedulerId;
|
|
494
507
|
}
|
|
495
|
-
function keyBuilderFromType(luvio, object) {
|
|
508
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
496
509
|
const keyParams = {
|
|
497
510
|
billingBatchSchedulerId: object.billingBatchScheduler.id
|
|
498
511
|
};
|
|
499
|
-
return keyBuilder$
|
|
512
|
+
return keyBuilder$3(luvio, keyParams);
|
|
500
513
|
}
|
|
501
|
-
function normalize$
|
|
514
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
502
515
|
return input;
|
|
503
516
|
}
|
|
504
|
-
const select$
|
|
517
|
+
const select$6 = function InvoicesBatchSchedulerOutputRepresentationSelect() {
|
|
505
518
|
return {
|
|
506
519
|
kind: 'Fragment',
|
|
507
|
-
version: VERSION$
|
|
520
|
+
version: VERSION$3,
|
|
508
521
|
private: [],
|
|
509
522
|
opaque: true
|
|
510
523
|
};
|
|
511
524
|
};
|
|
512
|
-
function equals$
|
|
525
|
+
function equals$3(existing, incoming) {
|
|
513
526
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
514
527
|
return false;
|
|
515
528
|
}
|
|
516
529
|
return true;
|
|
517
530
|
}
|
|
518
|
-
const ingest$
|
|
531
|
+
const ingest$2 = function InvoicesBatchSchedulerOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
519
532
|
if (process.env.NODE_ENV !== 'production') {
|
|
520
|
-
const validateError = validate$
|
|
533
|
+
const validateError = validate$3(input);
|
|
521
534
|
if (validateError !== null) {
|
|
522
535
|
throw validateError;
|
|
523
536
|
}
|
|
524
537
|
}
|
|
525
|
-
const key = keyBuilderFromType(luvio, input);
|
|
526
|
-
const ttlToUse = TTL$
|
|
527
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
538
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
539
|
+
const ttlToUse = TTL$2;
|
|
540
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "BillingBatch", VERSION$3, RepresentationType$2, equals$3);
|
|
528
541
|
return createLink(key);
|
|
529
542
|
};
|
|
530
|
-
function getTypeCacheKeys$
|
|
543
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
531
544
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
532
|
-
const rootKey = keyBuilderFromType(luvio, input);
|
|
545
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
533
546
|
rootKeySet.set(rootKey, {
|
|
534
547
|
namespace: keyPrefix,
|
|
535
|
-
representationName: RepresentationType$
|
|
548
|
+
representationName: RepresentationType$2,
|
|
536
549
|
mergeable: false
|
|
537
550
|
});
|
|
538
551
|
}
|
|
539
552
|
|
|
540
|
-
function select$
|
|
541
|
-
return select$
|
|
553
|
+
function select$5(luvio, params) {
|
|
554
|
+
return select$6();
|
|
542
555
|
}
|
|
543
|
-
function getResponseCacheKeys$
|
|
544
|
-
getTypeCacheKeys$
|
|
556
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
557
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
545
558
|
}
|
|
546
|
-
function ingestSuccess$
|
|
559
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
547
560
|
const { body } = response;
|
|
548
|
-
const key = keyBuilderFromType(luvio, body);
|
|
549
|
-
luvio.storeIngest(key, ingest$
|
|
561
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
562
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
550
563
|
const snapshot = luvio.storeLookup({
|
|
551
564
|
recordId: key,
|
|
552
|
-
node: select$
|
|
565
|
+
node: select$5(),
|
|
553
566
|
variables: {},
|
|
554
567
|
});
|
|
555
568
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -560,7 +573,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
560
573
|
deepFreeze(snapshot.data);
|
|
561
574
|
return snapshot;
|
|
562
575
|
}
|
|
563
|
-
function createResourceRequest$
|
|
576
|
+
function createResourceRequest$2(config) {
|
|
564
577
|
const headers = {};
|
|
565
578
|
return {
|
|
566
579
|
baseUri: '/services/data/v61.0',
|
|
@@ -574,45 +587,45 @@ function createResourceRequest$1(config) {
|
|
|
574
587
|
};
|
|
575
588
|
}
|
|
576
589
|
|
|
577
|
-
const adapterName$
|
|
590
|
+
const adapterName$2 = 'createInvoicesBatchScheduler';
|
|
578
591
|
const createInvoicesBatchScheduler_ConfigPropertyMetadata = [
|
|
579
592
|
generateParamConfigMetadata('BatchInvoiceSchedulerInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
580
593
|
];
|
|
581
|
-
const createInvoicesBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
582
|
-
const createResourceParams$
|
|
583
|
-
function typeCheckConfig$
|
|
594
|
+
const createInvoicesBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createInvoicesBatchScheduler_ConfigPropertyMetadata);
|
|
595
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(createInvoicesBatchScheduler_ConfigPropertyMetadata);
|
|
596
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
584
597
|
const config = {};
|
|
585
598
|
const untrustedConfig_BatchInvoiceSchedulerInput = untrustedConfig.BatchInvoiceSchedulerInput;
|
|
586
|
-
const referenceBatchInvoiceSchedulerInputRepresentationValidationError = validate$
|
|
599
|
+
const referenceBatchInvoiceSchedulerInputRepresentationValidationError = validate$4(untrustedConfig_BatchInvoiceSchedulerInput);
|
|
587
600
|
if (referenceBatchInvoiceSchedulerInputRepresentationValidationError === null) {
|
|
588
601
|
config.BatchInvoiceSchedulerInput = untrustedConfig_BatchInvoiceSchedulerInput;
|
|
589
602
|
}
|
|
590
603
|
return config;
|
|
591
604
|
}
|
|
592
|
-
function validateAdapterConfig$
|
|
605
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
593
606
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
594
607
|
return null;
|
|
595
608
|
}
|
|
596
609
|
if (process.env.NODE_ENV !== 'production') {
|
|
597
610
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
598
611
|
}
|
|
599
|
-
const config = typeCheckConfig$
|
|
612
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
600
613
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
601
614
|
return null;
|
|
602
615
|
}
|
|
603
616
|
return config;
|
|
604
617
|
}
|
|
605
|
-
function buildNetworkSnapshot$
|
|
606
|
-
const resourceParams = createResourceParams$
|
|
607
|
-
const request = createResourceRequest$
|
|
618
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
619
|
+
const resourceParams = createResourceParams$2(config);
|
|
620
|
+
const request = createResourceRequest$2(resourceParams);
|
|
608
621
|
return luvio.dispatchResourceRequest(request, options)
|
|
609
622
|
.then((response) => {
|
|
610
623
|
return luvio.handleSuccessResponse(() => {
|
|
611
|
-
const snapshot = ingestSuccess$
|
|
624
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
612
625
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
613
626
|
}, () => {
|
|
614
627
|
const cache = new StoreKeyMap();
|
|
615
|
-
getResponseCacheKeys$
|
|
628
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
616
629
|
return cache;
|
|
617
630
|
});
|
|
618
631
|
}, (response) => {
|
|
@@ -622,18 +635,18 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
622
635
|
}
|
|
623
636
|
const createInvoicesBatchSchedulerAdapterFactory = (luvio) => {
|
|
624
637
|
return function createInvoicesBatchScheduler(untrustedConfig) {
|
|
625
|
-
const config = validateAdapterConfig$
|
|
638
|
+
const config = validateAdapterConfig$2(untrustedConfig, createInvoicesBatchScheduler_ConfigPropertyNames);
|
|
626
639
|
// Invalid or incomplete config
|
|
627
640
|
if (config === null) {
|
|
628
641
|
throw new Error('Invalid config for "createInvoicesBatchScheduler"');
|
|
629
642
|
}
|
|
630
|
-
return buildNetworkSnapshot$
|
|
643
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
631
644
|
};
|
|
632
645
|
};
|
|
633
646
|
|
|
634
|
-
const TTL = 1000;
|
|
635
|
-
const VERSION = "1b89e7904345b50c1a8bfa0fc6e7dff0";
|
|
636
|
-
function validate(obj, path = 'InvoiceBatchDraftToPostedOutputRepresentation') {
|
|
647
|
+
const TTL$1 = 1000;
|
|
648
|
+
const VERSION$2 = "1b89e7904345b50c1a8bfa0fc6e7dff0";
|
|
649
|
+
function validate$2(obj, path = 'InvoiceBatchDraftToPostedOutputRepresentation') {
|
|
637
650
|
const v_error = (() => {
|
|
638
651
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
639
652
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -651,14 +664,14 @@ function validate(obj, path = 'InvoiceBatchDraftToPostedOutputRepresentation') {
|
|
|
651
664
|
})();
|
|
652
665
|
return v_error === undefined ? null : v_error;
|
|
653
666
|
}
|
|
654
|
-
const RepresentationType = 'InvoiceBatchDraftToPostedOutputRepresentation';
|
|
655
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
667
|
+
const RepresentationType$1 = 'InvoiceBatchDraftToPostedOutputRepresentation';
|
|
668
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
656
669
|
return input;
|
|
657
670
|
}
|
|
658
|
-
const select$
|
|
671
|
+
const select$4 = function InvoiceBatchDraftToPostedOutputRepresentationSelect() {
|
|
659
672
|
return {
|
|
660
673
|
kind: 'Fragment',
|
|
661
|
-
version: VERSION,
|
|
674
|
+
version: VERSION$2,
|
|
662
675
|
private: [],
|
|
663
676
|
selections: [
|
|
664
677
|
{
|
|
@@ -672,7 +685,7 @@ const select$1 = function InvoiceBatchDraftToPostedOutputRepresentationSelect()
|
|
|
672
685
|
]
|
|
673
686
|
};
|
|
674
687
|
};
|
|
675
|
-
function equals(existing, incoming) {
|
|
688
|
+
function equals$2(existing, incoming) {
|
|
676
689
|
const existing_success = existing.success;
|
|
677
690
|
const incoming_success = incoming.success;
|
|
678
691
|
if (!(existing_success === incoming_success)) {
|
|
@@ -685,44 +698,44 @@ function equals(existing, incoming) {
|
|
|
685
698
|
}
|
|
686
699
|
return true;
|
|
687
700
|
}
|
|
688
|
-
const ingest = function InvoiceBatchDraftToPostedOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
701
|
+
const ingest$1 = function InvoiceBatchDraftToPostedOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
689
702
|
if (process.env.NODE_ENV !== 'production') {
|
|
690
|
-
const validateError = validate(input);
|
|
703
|
+
const validateError = validate$2(input);
|
|
691
704
|
if (validateError !== null) {
|
|
692
705
|
throw validateError;
|
|
693
706
|
}
|
|
694
707
|
}
|
|
695
708
|
const key = path.fullPath;
|
|
696
|
-
const ttlToUse = TTL;
|
|
697
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "BillingBatch", VERSION, RepresentationType, equals);
|
|
709
|
+
const ttlToUse = TTL$1;
|
|
710
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "BillingBatch", VERSION$2, RepresentationType$1, equals$2);
|
|
698
711
|
return createLink(key);
|
|
699
712
|
};
|
|
700
|
-
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
713
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
701
714
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
702
715
|
const rootKey = fullPathFactory();
|
|
703
716
|
rootKeySet.set(rootKey, {
|
|
704
717
|
namespace: keyPrefix,
|
|
705
|
-
representationName: RepresentationType,
|
|
718
|
+
representationName: RepresentationType$1,
|
|
706
719
|
mergeable: false
|
|
707
720
|
});
|
|
708
721
|
}
|
|
709
722
|
|
|
710
|
-
function select(luvio, params) {
|
|
711
|
-
return select$
|
|
723
|
+
function select$3(luvio, params) {
|
|
724
|
+
return select$4();
|
|
712
725
|
}
|
|
713
|
-
function keyBuilder$
|
|
726
|
+
function keyBuilder$2(luvio, params) {
|
|
714
727
|
return keyPrefix + '::InvoiceBatchDraftToPostedOutputRepresentation:(' + 'invoiceBatchRunId:' + params.urlParams.invoiceBatchRunId + ',' + stableJSONStringify(params.body) + ')';
|
|
715
728
|
}
|
|
716
|
-
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
717
|
-
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$
|
|
729
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
730
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
|
|
718
731
|
}
|
|
719
|
-
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
732
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
720
733
|
const { body } = response;
|
|
721
|
-
const key = keyBuilder$
|
|
722
|
-
luvio.storeIngest(key, ingest, body);
|
|
734
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
735
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
723
736
|
const snapshot = luvio.storeLookup({
|
|
724
737
|
recordId: key,
|
|
725
|
-
node: select(),
|
|
738
|
+
node: select$3(),
|
|
726
739
|
variables: {},
|
|
727
740
|
}, snapshotRefresh);
|
|
728
741
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -734,18 +747,18 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
734
747
|
return snapshot;
|
|
735
748
|
}
|
|
736
749
|
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
737
|
-
const key = keyBuilder$
|
|
750
|
+
const key = keyBuilder$2(luvio, params);
|
|
738
751
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
739
752
|
const storeMetadataParams = {
|
|
740
|
-
ttl: TTL,
|
|
753
|
+
ttl: TTL$1,
|
|
741
754
|
namespace: keyPrefix,
|
|
742
|
-
version: VERSION,
|
|
743
|
-
representationName: RepresentationType
|
|
755
|
+
version: VERSION$2,
|
|
756
|
+
representationName: RepresentationType$1
|
|
744
757
|
};
|
|
745
758
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
746
759
|
return errorSnapshot;
|
|
747
760
|
}
|
|
748
|
-
function createResourceRequest(config) {
|
|
761
|
+
function createResourceRequest$1(config) {
|
|
749
762
|
const headers = {};
|
|
750
763
|
return {
|
|
751
764
|
baseUri: '/services/data/v61.0',
|
|
@@ -759,60 +772,60 @@ function createResourceRequest(config) {
|
|
|
759
772
|
};
|
|
760
773
|
}
|
|
761
774
|
|
|
762
|
-
const adapterName = 'postBatchDraftInvoices';
|
|
775
|
+
const adapterName$1 = 'postBatchDraftInvoices';
|
|
763
776
|
const postBatchDraftInvoices_ConfigPropertyMetadata = [
|
|
764
777
|
generateParamConfigMetadata('invoiceBatchRunId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
765
778
|
];
|
|
766
|
-
const postBatchDraftInvoices_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postBatchDraftInvoices_ConfigPropertyMetadata);
|
|
767
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
768
|
-
function keyBuilder(luvio, config) {
|
|
769
|
-
const resourceParams = createResourceParams(config);
|
|
770
|
-
return keyBuilder$
|
|
779
|
+
const postBatchDraftInvoices_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, postBatchDraftInvoices_ConfigPropertyMetadata);
|
|
780
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(postBatchDraftInvoices_ConfigPropertyMetadata);
|
|
781
|
+
function keyBuilder$1(luvio, config) {
|
|
782
|
+
const resourceParams = createResourceParams$1(config);
|
|
783
|
+
return keyBuilder$2(luvio, resourceParams);
|
|
771
784
|
}
|
|
772
|
-
function typeCheckConfig(untrustedConfig) {
|
|
785
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
773
786
|
const config = {};
|
|
774
|
-
typeCheckConfig$
|
|
787
|
+
typeCheckConfig$4(untrustedConfig, config, postBatchDraftInvoices_ConfigPropertyMetadata);
|
|
775
788
|
return config;
|
|
776
789
|
}
|
|
777
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
790
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
778
791
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
779
792
|
return null;
|
|
780
793
|
}
|
|
781
794
|
if (process.env.NODE_ENV !== 'production') {
|
|
782
795
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
783
796
|
}
|
|
784
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
797
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
785
798
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
786
799
|
return null;
|
|
787
800
|
}
|
|
788
801
|
return config;
|
|
789
802
|
}
|
|
790
803
|
function adapterFragment(luvio, config) {
|
|
791
|
-
createResourceParams(config);
|
|
792
|
-
return select();
|
|
804
|
+
createResourceParams$1(config);
|
|
805
|
+
return select$3();
|
|
793
806
|
}
|
|
794
807
|
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
795
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
808
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
796
809
|
config,
|
|
797
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
810
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
798
811
|
});
|
|
799
812
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
800
813
|
}
|
|
801
814
|
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
802
815
|
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
803
816
|
config,
|
|
804
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
817
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
805
818
|
});
|
|
806
819
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
807
820
|
}
|
|
808
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
809
|
-
const resourceParams = createResourceParams(config);
|
|
810
|
-
const request = createResourceRequest(resourceParams);
|
|
821
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
822
|
+
const resourceParams = createResourceParams$1(config);
|
|
823
|
+
const request = createResourceRequest$1(resourceParams);
|
|
811
824
|
return luvio.dispatchResourceRequest(request, options)
|
|
812
825
|
.then((response) => {
|
|
813
826
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
814
827
|
const cache = new StoreKeyMap();
|
|
815
|
-
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
828
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
816
829
|
return cache;
|
|
817
830
|
});
|
|
818
831
|
}, (response) => {
|
|
@@ -820,23 +833,23 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
820
833
|
});
|
|
821
834
|
}
|
|
822
835
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
823
|
-
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
|
|
836
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, 'get', false);
|
|
824
837
|
}
|
|
825
838
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
826
839
|
const { luvio, config } = context;
|
|
827
840
|
const selector = {
|
|
828
|
-
recordId: keyBuilder(luvio, config),
|
|
841
|
+
recordId: keyBuilder$1(luvio, config),
|
|
829
842
|
node: adapterFragment(luvio, config),
|
|
830
843
|
variables: {},
|
|
831
844
|
};
|
|
832
845
|
const cacheSnapshot = storeLookup(selector, {
|
|
833
846
|
config,
|
|
834
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
847
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
835
848
|
});
|
|
836
849
|
return cacheSnapshot;
|
|
837
850
|
}
|
|
838
851
|
const postBatchDraftInvoicesAdapterFactory = (luvio) => function BillingBatch__postBatchDraftInvoices(untrustedConfig, requestContext) {
|
|
839
|
-
const config = validateAdapterConfig(untrustedConfig, postBatchDraftInvoices_ConfigPropertyNames);
|
|
852
|
+
const config = validateAdapterConfig$1(untrustedConfig, postBatchDraftInvoices_ConfigPropertyNames);
|
|
840
853
|
// Invalid or incomplete config
|
|
841
854
|
if (config === null) {
|
|
842
855
|
return null;
|
|
@@ -845,4 +858,261 @@ const postBatchDraftInvoicesAdapterFactory = (luvio) => function BillingBatch__p
|
|
|
845
858
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
846
859
|
};
|
|
847
860
|
|
|
848
|
-
|
|
861
|
+
const VERSION$1 = "ae245aac2922b53e1ff758392e317d39";
|
|
862
|
+
function validate$1(obj, path = 'BatchInvoiceDocGenErrorRepresentation') {
|
|
863
|
+
const v_error = (() => {
|
|
864
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
865
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
866
|
+
}
|
|
867
|
+
const obj_errorCode = obj.errorCode;
|
|
868
|
+
const path_errorCode = path + '.errorCode';
|
|
869
|
+
if (typeof obj_errorCode !== 'string') {
|
|
870
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
|
|
871
|
+
}
|
|
872
|
+
const obj_errorMessage = obj.errorMessage;
|
|
873
|
+
const path_errorMessage = path + '.errorMessage';
|
|
874
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
875
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
876
|
+
}
|
|
877
|
+
})();
|
|
878
|
+
return v_error === undefined ? null : v_error;
|
|
879
|
+
}
|
|
880
|
+
const select$2 = function BatchInvoiceDocGenErrorRepresentationSelect() {
|
|
881
|
+
return {
|
|
882
|
+
kind: 'Fragment',
|
|
883
|
+
version: VERSION$1,
|
|
884
|
+
private: [],
|
|
885
|
+
selections: [
|
|
886
|
+
{
|
|
887
|
+
name: 'errorCode',
|
|
888
|
+
kind: 'Scalar'
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
name: 'errorMessage',
|
|
892
|
+
kind: 'Scalar'
|
|
893
|
+
}
|
|
894
|
+
]
|
|
895
|
+
};
|
|
896
|
+
};
|
|
897
|
+
function equals$1(existing, incoming) {
|
|
898
|
+
const existing_errorCode = existing.errorCode;
|
|
899
|
+
const incoming_errorCode = incoming.errorCode;
|
|
900
|
+
if (!(existing_errorCode === incoming_errorCode)) {
|
|
901
|
+
return false;
|
|
902
|
+
}
|
|
903
|
+
const existing_errorMessage = existing.errorMessage;
|
|
904
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
905
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
906
|
+
return false;
|
|
907
|
+
}
|
|
908
|
+
return true;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
const TTL = 1000;
|
|
912
|
+
const VERSION = "1630988ffc3067417295a90783bd1812";
|
|
913
|
+
function validate(obj, path = 'BatchInvoiceDocGenOutputRepresentation') {
|
|
914
|
+
const v_error = (() => {
|
|
915
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
916
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
917
|
+
}
|
|
918
|
+
const obj_errors = obj.errors;
|
|
919
|
+
const path_errors = path + '.errors';
|
|
920
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
921
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
922
|
+
}
|
|
923
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
924
|
+
const obj_errors_item = obj_errors[i];
|
|
925
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
926
|
+
const referencepath_errors_itemValidationError = validate$1(obj_errors_item, path_errors_item);
|
|
927
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
928
|
+
let message = 'Object doesn\'t match BatchInvoiceDocGenErrorRepresentation (at "' + path_errors_item + '")\n';
|
|
929
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
930
|
+
return new TypeError(message);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
const obj_requestIdentifier = obj.requestIdentifier;
|
|
934
|
+
const path_requestIdentifier = path + '.requestIdentifier';
|
|
935
|
+
if (typeof obj_requestIdentifier !== 'string') {
|
|
936
|
+
return new TypeError('Expected "string" but received "' + typeof obj_requestIdentifier + '" (at "' + path_requestIdentifier + '")');
|
|
937
|
+
}
|
|
938
|
+
const obj_success = obj.success;
|
|
939
|
+
const path_success = path + '.success';
|
|
940
|
+
if (typeof obj_success !== 'boolean') {
|
|
941
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
942
|
+
}
|
|
943
|
+
})();
|
|
944
|
+
return v_error === undefined ? null : v_error;
|
|
945
|
+
}
|
|
946
|
+
const RepresentationType = 'BatchInvoiceDocGenOutputRepresentation';
|
|
947
|
+
function keyBuilder(luvio, config) {
|
|
948
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.requestIdentifier;
|
|
949
|
+
}
|
|
950
|
+
function keyBuilderFromType(luvio, object) {
|
|
951
|
+
const keyParams = {
|
|
952
|
+
requestIdentifier: object.requestIdentifier
|
|
953
|
+
};
|
|
954
|
+
return keyBuilder(luvio, keyParams);
|
|
955
|
+
}
|
|
956
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
957
|
+
return input;
|
|
958
|
+
}
|
|
959
|
+
const select$1 = function BatchInvoiceDocGenOutputRepresentationSelect() {
|
|
960
|
+
const { selections: BatchInvoiceDocGenErrorRepresentation__selections, opaque: BatchInvoiceDocGenErrorRepresentation__opaque, } = select$2();
|
|
961
|
+
return {
|
|
962
|
+
kind: 'Fragment',
|
|
963
|
+
version: VERSION,
|
|
964
|
+
private: [],
|
|
965
|
+
selections: [
|
|
966
|
+
{
|
|
967
|
+
name: 'errors',
|
|
968
|
+
kind: 'Object',
|
|
969
|
+
plural: true,
|
|
970
|
+
selections: BatchInvoiceDocGenErrorRepresentation__selections
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
name: 'requestIdentifier',
|
|
974
|
+
kind: 'Scalar'
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
name: 'success',
|
|
978
|
+
kind: 'Scalar'
|
|
979
|
+
}
|
|
980
|
+
]
|
|
981
|
+
};
|
|
982
|
+
};
|
|
983
|
+
function equals(existing, incoming) {
|
|
984
|
+
const existing_success = existing.success;
|
|
985
|
+
const incoming_success = incoming.success;
|
|
986
|
+
if (!(existing_success === incoming_success)) {
|
|
987
|
+
return false;
|
|
988
|
+
}
|
|
989
|
+
const existing_requestIdentifier = existing.requestIdentifier;
|
|
990
|
+
const incoming_requestIdentifier = incoming.requestIdentifier;
|
|
991
|
+
if (!(existing_requestIdentifier === incoming_requestIdentifier)) {
|
|
992
|
+
return false;
|
|
993
|
+
}
|
|
994
|
+
const existing_errors = existing.errors;
|
|
995
|
+
const incoming_errors = incoming.errors;
|
|
996
|
+
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
997
|
+
if (!(equals$1(existing_errors_item, incoming_errors_item))) {
|
|
998
|
+
return false;
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
if (equals_errors_items === false) {
|
|
1002
|
+
return false;
|
|
1003
|
+
}
|
|
1004
|
+
return true;
|
|
1005
|
+
}
|
|
1006
|
+
const ingest = function BatchInvoiceDocGenOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1007
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1008
|
+
const validateError = validate(input);
|
|
1009
|
+
if (validateError !== null) {
|
|
1010
|
+
throw validateError;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
const key = keyBuilderFromType(luvio, input);
|
|
1014
|
+
const ttlToUse = TTL;
|
|
1015
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "BillingBatch", VERSION, RepresentationType, equals);
|
|
1016
|
+
return createLink(key);
|
|
1017
|
+
};
|
|
1018
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1019
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1020
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
1021
|
+
rootKeySet.set(rootKey, {
|
|
1022
|
+
namespace: keyPrefix,
|
|
1023
|
+
representationName: RepresentationType,
|
|
1024
|
+
mergeable: false
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
function select(luvio, params) {
|
|
1029
|
+
return select$1();
|
|
1030
|
+
}
|
|
1031
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1032
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1033
|
+
}
|
|
1034
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
1035
|
+
const { body } = response;
|
|
1036
|
+
const key = keyBuilderFromType(luvio, body);
|
|
1037
|
+
luvio.storeIngest(key, ingest, body);
|
|
1038
|
+
const snapshot = luvio.storeLookup({
|
|
1039
|
+
recordId: key,
|
|
1040
|
+
node: select(),
|
|
1041
|
+
variables: {},
|
|
1042
|
+
});
|
|
1043
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1044
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1045
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
deepFreeze(snapshot.data);
|
|
1049
|
+
return snapshot;
|
|
1050
|
+
}
|
|
1051
|
+
function createResourceRequest(config) {
|
|
1052
|
+
const headers = {};
|
|
1053
|
+
return {
|
|
1054
|
+
baseUri: '/services/data/v61.0',
|
|
1055
|
+
basePath: '/commerce/billing/invoices/invoice-batch-docgen/' + config.urlParams.invoiceBatchRunId + '/actions/run',
|
|
1056
|
+
method: 'post',
|
|
1057
|
+
body: null,
|
|
1058
|
+
urlParams: config.urlParams,
|
|
1059
|
+
queryParams: {},
|
|
1060
|
+
headers,
|
|
1061
|
+
priority: 'normal',
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
const adapterName = 'postBatchInvoiceDocGen';
|
|
1066
|
+
const postBatchInvoiceDocGen_ConfigPropertyMetadata = [
|
|
1067
|
+
generateParamConfigMetadata('invoiceBatchRunId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1068
|
+
];
|
|
1069
|
+
const postBatchInvoiceDocGen_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postBatchInvoiceDocGen_ConfigPropertyMetadata);
|
|
1070
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$4(postBatchInvoiceDocGen_ConfigPropertyMetadata);
|
|
1071
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1072
|
+
const config = {};
|
|
1073
|
+
typeCheckConfig$4(untrustedConfig, config, postBatchInvoiceDocGen_ConfigPropertyMetadata);
|
|
1074
|
+
return config;
|
|
1075
|
+
}
|
|
1076
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1077
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1078
|
+
return null;
|
|
1079
|
+
}
|
|
1080
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1081
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1082
|
+
}
|
|
1083
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1084
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1085
|
+
return null;
|
|
1086
|
+
}
|
|
1087
|
+
return config;
|
|
1088
|
+
}
|
|
1089
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1090
|
+
const resourceParams = createResourceParams(config);
|
|
1091
|
+
const request = createResourceRequest(resourceParams);
|
|
1092
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1093
|
+
.then((response) => {
|
|
1094
|
+
return luvio.handleSuccessResponse(() => {
|
|
1095
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1096
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1097
|
+
}, () => {
|
|
1098
|
+
const cache = new StoreKeyMap();
|
|
1099
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1100
|
+
return cache;
|
|
1101
|
+
});
|
|
1102
|
+
}, (response) => {
|
|
1103
|
+
deepFreeze(response);
|
|
1104
|
+
throw response;
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
const postBatchInvoiceDocGenAdapterFactory = (luvio) => {
|
|
1108
|
+
return function postBatchInvoiceDocGen(untrustedConfig) {
|
|
1109
|
+
const config = validateAdapterConfig(untrustedConfig, postBatchInvoiceDocGen_ConfigPropertyNames);
|
|
1110
|
+
// Invalid or incomplete config
|
|
1111
|
+
if (config === null) {
|
|
1112
|
+
throw new Error('Invalid config for "postBatchInvoiceDocGen"');
|
|
1113
|
+
}
|
|
1114
|
+
return buildNetworkSnapshot(luvio, config);
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
|
|
1118
|
+
export { createInvoicesBatchSchedulerAdapterFactory, createPaymentsBatchSchedulerAdapterFactory, postBatchDraftInvoicesAdapterFactory, postBatchInvoiceDocGenAdapterFactory };
|