@salesforce/lds-adapters-revenue-billing-batch 0.1.0-dev1
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/LICENSE.txt +82 -0
- package/dist/es/es2018/revenue-billing-batch.js +1737 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/batchInvoiceRunRecovery.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/adapters/createInvoicesBatchScheduler.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/adapters/createPaymentsBatchScheduler.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/adapters/editInvoicesBatchScheduler.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/adapters/postBatchDraftInvoices.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/postBatchInvoiceDocGen.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/adapters/postCronExecutionDates.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/adapters/updateInvoicesBatchScheduler.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +8 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +10 -0
- package/dist/es/es2018/types/src/generated/resources/patchCommerceInvoicingInvoiceSchedulersByBillingBatchSchedulerId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postCommerceBillingInvoicesInvoiceBatchDocgenActionsByInvoiceBatchRunIdAndActionName.d.ts +13 -0
- package/dist/es/es2018/types/src/generated/resources/postCommerceInvoicingInvoiceBatchRunsActionsDraftToPostedByInvoiceBatchRunId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postCommerceInvoicingInvoiceBatchRunsActionsRecoverByInvoiceBatchRunId.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/postCommerceInvoicingInvoiceSchedulers.d.ts +13 -0
- package/dist/es/es2018/types/src/generated/resources/postCommercePaymentsPaymentSchedulers.d.ts +13 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectBillingBatchCronExecutionDates.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/resources/putCommerceInvoicingInvoiceSchedulersByBillingBatchSchedulerId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/BatchFilterCriteriaInputRepresentation.d.ts +34 -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/dist/es/es2018/types/src/generated/types/BatchInvoiceSchedulerInputRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/BatchInvoiceSchedulerInputWrapperRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/BatchInvoiceSchedulerUpdateInputRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/BatchInvoiceSchedulerUpdateInputWrapperRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/BatchInvoiceSchedulerUpdateOutputRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/BillingBatchSchedulerRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/CronExecutionDatesInputRepresentation.d.ts +43 -0
- package/dist/es/es2018/types/src/generated/types/CronExecutionDatesOutputRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/InvoiceBatchDraftToPostedInputRepresentation.d.ts +25 -0
- package/dist/es/es2018/types/src/generated/types/InvoiceBatchDraftToPostedOutputRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/InvoiceBatchRunRecoveryOutputRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/InvoicesBatchSchedulerOutputRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/PaymentRunBatchFilterCriteriaInputRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/PaymentRunBatchFilterCriteriaInputRepresentations.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/PaymentsBatchSchedulerInputRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/PaymentsBatchSchedulerInputWrapperRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/PaymentsBatchSchedulerOutputRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/ScheduleOptionsInputRepresentation.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/ScheduleOptionsInputRepresentationForInvoice.d.ts +49 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +72 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +1799 -0
- package/src/raml/api.raml +447 -0
- package/src/raml/luvio.raml +664 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,1799 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$8, typeCheckConfig as typeCheckConfig$8, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
21
|
+
const { stringify: JSONStringify$1 } = JSON;
|
|
22
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
23
|
+
/**
|
|
24
|
+
* Validates an adapter config is well-formed.
|
|
25
|
+
* @param config The config to validate.
|
|
26
|
+
* @param adapter The adapter validation configuration.
|
|
27
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
28
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
29
|
+
*/
|
|
30
|
+
function validateConfig(config, adapter, oneOf) {
|
|
31
|
+
const { displayName } = adapter;
|
|
32
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
33
|
+
if (config === undefined ||
|
|
34
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
35
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
38
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
39
|
+
}
|
|
40
|
+
if (unsupported !== undefined &&
|
|
41
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
42
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
43
|
+
}
|
|
44
|
+
const supported = required.concat(optional);
|
|
45
|
+
if (ObjectKeys(config).some(key => !supported.includes(key))) {
|
|
46
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function untrustedIsObject(untrusted) {
|
|
50
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
51
|
+
}
|
|
52
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
53
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
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
|
+
}
|
|
117
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
118
|
+
return {
|
|
119
|
+
name,
|
|
120
|
+
required,
|
|
121
|
+
resourceType,
|
|
122
|
+
typeCheckShape,
|
|
123
|
+
isArrayShape,
|
|
124
|
+
coerceFn,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
128
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
129
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
130
|
+
return {
|
|
131
|
+
displayName,
|
|
132
|
+
parameters: {
|
|
133
|
+
required,
|
|
134
|
+
optional,
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
const keyPrefix = 'BillingBatch';
|
|
139
|
+
|
|
140
|
+
const { isArray: ArrayIsArray } = Array;
|
|
141
|
+
const { stringify: JSONStringify } = JSON;
|
|
142
|
+
function equalsArray(a, b, equalsItem) {
|
|
143
|
+
const aLength = a.length;
|
|
144
|
+
const bLength = b.length;
|
|
145
|
+
if (aLength !== bLength) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
for (let i = 0; i < aLength; i++) {
|
|
149
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
function createLink(ref) {
|
|
156
|
+
return {
|
|
157
|
+
__ref: serializeStructuredKey(ref),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const TTL$6 = 1000;
|
|
162
|
+
const VERSION$7 = "1699644fc0c840df081099c1cdf7066a";
|
|
163
|
+
function validate$d(obj, path = 'InvoiceBatchRunRecoveryOutputRepresentation') {
|
|
164
|
+
const v_error = (() => {
|
|
165
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
166
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
167
|
+
}
|
|
168
|
+
const obj_invoiceBatchRunRecoveryId = obj.invoiceBatchRunRecoveryId;
|
|
169
|
+
const path_invoiceBatchRunRecoveryId = path + '.invoiceBatchRunRecoveryId';
|
|
170
|
+
if (typeof obj_invoiceBatchRunRecoveryId !== 'string') {
|
|
171
|
+
return new TypeError('Expected "string" but received "' + typeof obj_invoiceBatchRunRecoveryId + '" (at "' + path_invoiceBatchRunRecoveryId + '")');
|
|
172
|
+
}
|
|
173
|
+
})();
|
|
174
|
+
return v_error === undefined ? null : v_error;
|
|
175
|
+
}
|
|
176
|
+
const RepresentationType$6 = 'InvoiceBatchRunRecoveryOutputRepresentation';
|
|
177
|
+
function keyBuilder$7(luvio, config) {
|
|
178
|
+
return keyPrefix + '::' + RepresentationType$6 + ':' + config.invoiceBatchRunRecoveryId;
|
|
179
|
+
}
|
|
180
|
+
function keyBuilderFromType$5(luvio, object) {
|
|
181
|
+
const keyParams = {
|
|
182
|
+
invoiceBatchRunRecoveryId: object.invoiceBatchRunRecoveryId
|
|
183
|
+
};
|
|
184
|
+
return keyBuilder$7(luvio, keyParams);
|
|
185
|
+
}
|
|
186
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
187
|
+
return input;
|
|
188
|
+
}
|
|
189
|
+
const select$f = function InvoiceBatchRunRecoveryOutputRepresentationSelect() {
|
|
190
|
+
return {
|
|
191
|
+
kind: 'Fragment',
|
|
192
|
+
version: VERSION$7,
|
|
193
|
+
private: [],
|
|
194
|
+
selections: [
|
|
195
|
+
{
|
|
196
|
+
name: 'invoiceBatchRunRecoveryId',
|
|
197
|
+
kind: 'Scalar'
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
function equals$7(existing, incoming) {
|
|
203
|
+
const existing_invoiceBatchRunRecoveryId = existing.invoiceBatchRunRecoveryId;
|
|
204
|
+
const incoming_invoiceBatchRunRecoveryId = incoming.invoiceBatchRunRecoveryId;
|
|
205
|
+
if (!(existing_invoiceBatchRunRecoveryId === incoming_invoiceBatchRunRecoveryId)) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
const ingest$6 = function InvoiceBatchRunRecoveryOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
211
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
212
|
+
const validateError = validate$d(input);
|
|
213
|
+
if (validateError !== null) {
|
|
214
|
+
throw validateError;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const key = keyBuilderFromType$5(luvio, input);
|
|
218
|
+
const ttlToUse = TTL$6;
|
|
219
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "BillingBatch", VERSION$7, RepresentationType$6, equals$7);
|
|
220
|
+
return createLink(key);
|
|
221
|
+
};
|
|
222
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
223
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
224
|
+
const rootKey = keyBuilderFromType$5(luvio, input);
|
|
225
|
+
rootKeySet.set(rootKey, {
|
|
226
|
+
namespace: keyPrefix,
|
|
227
|
+
representationName: RepresentationType$6,
|
|
228
|
+
mergeable: false
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function select$e(luvio, params) {
|
|
233
|
+
return select$f();
|
|
234
|
+
}
|
|
235
|
+
function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
|
|
236
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response);
|
|
237
|
+
}
|
|
238
|
+
function ingestSuccess$7(luvio, resourceParams, response) {
|
|
239
|
+
const { body } = response;
|
|
240
|
+
const key = keyBuilderFromType$5(luvio, body);
|
|
241
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
242
|
+
const snapshot = luvio.storeLookup({
|
|
243
|
+
recordId: key,
|
|
244
|
+
node: select$e(),
|
|
245
|
+
variables: {},
|
|
246
|
+
});
|
|
247
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
248
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
249
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
deepFreeze(snapshot.data);
|
|
253
|
+
return snapshot;
|
|
254
|
+
}
|
|
255
|
+
function createResourceRequest$7(config) {
|
|
256
|
+
const headers = {};
|
|
257
|
+
return {
|
|
258
|
+
baseUri: '/services/data/v66.0',
|
|
259
|
+
basePath: '/commerce/invoicing/invoice-batch-runs/' + config.urlParams.invoiceBatchRunId + '/actions/recover',
|
|
260
|
+
method: 'post',
|
|
261
|
+
body: null,
|
|
262
|
+
urlParams: config.urlParams,
|
|
263
|
+
queryParams: {},
|
|
264
|
+
headers,
|
|
265
|
+
priority: 'normal',
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const adapterName$7 = 'batchInvoiceRunRecovery';
|
|
270
|
+
const batchInvoiceRunRecovery_ConfigPropertyMetadata = [
|
|
271
|
+
generateParamConfigMetadata('invoiceBatchRunId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
272
|
+
];
|
|
273
|
+
const batchInvoiceRunRecovery_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, batchInvoiceRunRecovery_ConfigPropertyMetadata);
|
|
274
|
+
const createResourceParams$7 = /*#__PURE__*/ createResourceParams$8(batchInvoiceRunRecovery_ConfigPropertyMetadata);
|
|
275
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
276
|
+
const config = {};
|
|
277
|
+
typeCheckConfig$8(untrustedConfig, config, batchInvoiceRunRecovery_ConfigPropertyMetadata);
|
|
278
|
+
return config;
|
|
279
|
+
}
|
|
280
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
281
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
285
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
286
|
+
}
|
|
287
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
288
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
return config;
|
|
292
|
+
}
|
|
293
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
294
|
+
const resourceParams = createResourceParams$7(config);
|
|
295
|
+
const request = createResourceRequest$7(resourceParams);
|
|
296
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
297
|
+
.then((response) => {
|
|
298
|
+
return luvio.handleSuccessResponse(() => {
|
|
299
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response);
|
|
300
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
301
|
+
}, () => {
|
|
302
|
+
const cache = new StoreKeyMap();
|
|
303
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
304
|
+
return cache;
|
|
305
|
+
});
|
|
306
|
+
}, (response) => {
|
|
307
|
+
deepFreeze(response);
|
|
308
|
+
throw response;
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
const batchInvoiceRunRecoveryAdapterFactory = (luvio) => {
|
|
312
|
+
return function batchInvoiceRunRecovery(untrustedConfig) {
|
|
313
|
+
const config = validateAdapterConfig$7(untrustedConfig, batchInvoiceRunRecovery_ConfigPropertyNames);
|
|
314
|
+
// Invalid or incomplete config
|
|
315
|
+
if (config === null) {
|
|
316
|
+
throw new Error('Invalid config for "batchInvoiceRunRecovery"');
|
|
317
|
+
}
|
|
318
|
+
return buildNetworkSnapshot$7(luvio, config);
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
function validate$c(obj, path = 'ScheduleOptionsInputRepresentationForInvoice') {
|
|
323
|
+
const v_error = (() => {
|
|
324
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
325
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
326
|
+
}
|
|
327
|
+
if (obj.endDate !== undefined) {
|
|
328
|
+
const obj_endDate = obj.endDate;
|
|
329
|
+
const path_endDate = path + '.endDate';
|
|
330
|
+
if (typeof obj_endDate !== 'string') {
|
|
331
|
+
return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
const obj_frequencyCadence = obj.frequencyCadence;
|
|
335
|
+
const path_frequencyCadence = path + '.frequencyCadence';
|
|
336
|
+
if (typeof obj_frequencyCadence !== 'string') {
|
|
337
|
+
return new TypeError('Expected "string" but received "' + typeof obj_frequencyCadence + '" (at "' + path_frequencyCadence + '")');
|
|
338
|
+
}
|
|
339
|
+
const obj_frequencyCadenceOptions = obj.frequencyCadenceOptions;
|
|
340
|
+
const path_frequencyCadenceOptions = path + '.frequencyCadenceOptions';
|
|
341
|
+
if (typeof obj_frequencyCadenceOptions !== 'object' || ArrayIsArray(obj_frequencyCadenceOptions) || obj_frequencyCadenceOptions === null) {
|
|
342
|
+
return new TypeError('Expected "object" but received "' + typeof obj_frequencyCadenceOptions + '" (at "' + path_frequencyCadenceOptions + '")');
|
|
343
|
+
}
|
|
344
|
+
if (obj.preferredTime !== undefined) {
|
|
345
|
+
const obj_preferredTime = obj.preferredTime;
|
|
346
|
+
const path_preferredTime = path + '.preferredTime';
|
|
347
|
+
if (typeof obj_preferredTime !== 'string') {
|
|
348
|
+
return new TypeError('Expected "string" but received "' + typeof obj_preferredTime + '" (at "' + path_preferredTime + '")');
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
const obj_schedulerName = obj.schedulerName;
|
|
352
|
+
const path_schedulerName = path + '.schedulerName';
|
|
353
|
+
if (typeof obj_schedulerName !== 'string') {
|
|
354
|
+
return new TypeError('Expected "string" but received "' + typeof obj_schedulerName + '" (at "' + path_schedulerName + '")');
|
|
355
|
+
}
|
|
356
|
+
if (obj.startDate !== undefined) {
|
|
357
|
+
const obj_startDate = obj.startDate;
|
|
358
|
+
const path_startDate = path + '.startDate';
|
|
359
|
+
if (typeof obj_startDate !== 'string') {
|
|
360
|
+
return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
const obj_status = obj.status;
|
|
364
|
+
const path_status = path + '.status';
|
|
365
|
+
if (typeof obj_status !== 'string') {
|
|
366
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
367
|
+
}
|
|
368
|
+
if (obj.timezone !== undefined) {
|
|
369
|
+
const obj_timezone = obj.timezone;
|
|
370
|
+
const path_timezone = path + '.timezone';
|
|
371
|
+
if (typeof obj_timezone !== 'string') {
|
|
372
|
+
return new TypeError('Expected "string" but received "' + typeof obj_timezone + '" (at "' + path_timezone + '")');
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
})();
|
|
376
|
+
return v_error === undefined ? null : v_error;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function validate$b(obj, path = 'BatchInvoiceSchedulerInputRepresentation') {
|
|
380
|
+
const validateScheduleOptionsInputRepresentationForInvoice_validateError = validate$c(obj, path);
|
|
381
|
+
if (validateScheduleOptionsInputRepresentationForInvoice_validateError !== null) {
|
|
382
|
+
return validateScheduleOptionsInputRepresentationForInvoice_validateError;
|
|
383
|
+
}
|
|
384
|
+
const v_error = (() => {
|
|
385
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
386
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
387
|
+
}
|
|
388
|
+
if (obj.filterCriteria !== undefined) {
|
|
389
|
+
const obj_filterCriteria = obj.filterCriteria;
|
|
390
|
+
const path_filterCriteria = path + '.filterCriteria';
|
|
391
|
+
if (!ArrayIsArray(obj_filterCriteria)) {
|
|
392
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filterCriteria + '" (at "' + path_filterCriteria + '")');
|
|
393
|
+
}
|
|
394
|
+
for (let i = 0; i < obj_filterCriteria.length; i++) {
|
|
395
|
+
const obj_filterCriteria_item = obj_filterCriteria[i];
|
|
396
|
+
const path_filterCriteria_item = path_filterCriteria + '[' + i + ']';
|
|
397
|
+
if (typeof obj_filterCriteria_item !== 'object' || ArrayIsArray(obj_filterCriteria_item) || obj_filterCriteria_item === null) {
|
|
398
|
+
return new TypeError('Expected "object" but received "' + typeof obj_filterCriteria_item + '" (at "' + path_filterCriteria_item + '")');
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
})();
|
|
403
|
+
return v_error === undefined ? null : v_error;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function validate$a(obj, path = 'BillingBatchSchedulerRepresentation') {
|
|
407
|
+
const v_error = (() => {
|
|
408
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
409
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
410
|
+
}
|
|
411
|
+
const obj_id = obj.id;
|
|
412
|
+
const path_id = path + '.id';
|
|
413
|
+
if (typeof obj_id !== 'string') {
|
|
414
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
415
|
+
}
|
|
416
|
+
})();
|
|
417
|
+
return v_error === undefined ? null : v_error;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const TTL$5 = 1000;
|
|
421
|
+
const VERSION$6 = "15c358b0b4903143c526f63f4010b958";
|
|
422
|
+
function validate$9(obj, path = 'InvoicesBatchSchedulerOutputRepresentation') {
|
|
423
|
+
const v_error = (() => {
|
|
424
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
425
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
426
|
+
}
|
|
427
|
+
const obj_billingBatchScheduler = obj.billingBatchScheduler;
|
|
428
|
+
const path_billingBatchScheduler = path + '.billingBatchScheduler';
|
|
429
|
+
const referencepath_billingBatchSchedulerValidationError = validate$a(obj_billingBatchScheduler, path_billingBatchScheduler);
|
|
430
|
+
if (referencepath_billingBatchSchedulerValidationError !== null) {
|
|
431
|
+
let message = 'Object doesn\'t match BillingBatchSchedulerRepresentation (at "' + path_billingBatchScheduler + '")\n';
|
|
432
|
+
message += referencepath_billingBatchSchedulerValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
433
|
+
return new TypeError(message);
|
|
434
|
+
}
|
|
435
|
+
})();
|
|
436
|
+
return v_error === undefined ? null : v_error;
|
|
437
|
+
}
|
|
438
|
+
const RepresentationType$5 = 'InvoicesBatchSchedulerOutputRepresentation';
|
|
439
|
+
function keyBuilder$6(luvio, config) {
|
|
440
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.billingBatchSchedulerId;
|
|
441
|
+
}
|
|
442
|
+
function keyBuilderFromType$4(luvio, object) {
|
|
443
|
+
const keyParams = {
|
|
444
|
+
billingBatchSchedulerId: object.billingBatchScheduler.id
|
|
445
|
+
};
|
|
446
|
+
return keyBuilder$6(luvio, keyParams);
|
|
447
|
+
}
|
|
448
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
449
|
+
return input;
|
|
450
|
+
}
|
|
451
|
+
const select$d = function InvoicesBatchSchedulerOutputRepresentationSelect() {
|
|
452
|
+
return {
|
|
453
|
+
kind: 'Fragment',
|
|
454
|
+
version: VERSION$6,
|
|
455
|
+
private: [],
|
|
456
|
+
opaque: true
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
function equals$6(existing, incoming) {
|
|
460
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
461
|
+
return false;
|
|
462
|
+
}
|
|
463
|
+
return true;
|
|
464
|
+
}
|
|
465
|
+
const ingest$5 = function InvoicesBatchSchedulerOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
466
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
467
|
+
const validateError = validate$9(input);
|
|
468
|
+
if (validateError !== null) {
|
|
469
|
+
throw validateError;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
const key = keyBuilderFromType$4(luvio, input);
|
|
473
|
+
const ttlToUse = TTL$5;
|
|
474
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "BillingBatch", VERSION$6, RepresentationType$5, equals$6);
|
|
475
|
+
return createLink(key);
|
|
476
|
+
};
|
|
477
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
478
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
479
|
+
const rootKey = keyBuilderFromType$4(luvio, input);
|
|
480
|
+
rootKeySet.set(rootKey, {
|
|
481
|
+
namespace: keyPrefix,
|
|
482
|
+
representationName: RepresentationType$5,
|
|
483
|
+
mergeable: false
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function select$c(luvio, params) {
|
|
488
|
+
return select$d();
|
|
489
|
+
}
|
|
490
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
491
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
492
|
+
}
|
|
493
|
+
function ingestSuccess$6(luvio, resourceParams, response) {
|
|
494
|
+
const { body } = response;
|
|
495
|
+
const key = keyBuilderFromType$4(luvio, body);
|
|
496
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
497
|
+
const snapshot = luvio.storeLookup({
|
|
498
|
+
recordId: key,
|
|
499
|
+
node: select$c(),
|
|
500
|
+
variables: {},
|
|
501
|
+
});
|
|
502
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
503
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
504
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
deepFreeze(snapshot.data);
|
|
508
|
+
return snapshot;
|
|
509
|
+
}
|
|
510
|
+
function createResourceRequest$6(config) {
|
|
511
|
+
const headers = {};
|
|
512
|
+
return {
|
|
513
|
+
baseUri: '/services/data/v66.0',
|
|
514
|
+
basePath: '/commerce/invoicing/invoice-schedulers',
|
|
515
|
+
method: 'post',
|
|
516
|
+
body: config.body,
|
|
517
|
+
urlParams: {},
|
|
518
|
+
queryParams: {},
|
|
519
|
+
headers,
|
|
520
|
+
priority: 'normal',
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const adapterName$6 = 'createInvoicesBatchScheduler';
|
|
525
|
+
const createInvoicesBatchScheduler_ConfigPropertyMetadata = [
|
|
526
|
+
generateParamConfigMetadata('BatchInvoiceSchedulerInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
527
|
+
];
|
|
528
|
+
const createInvoicesBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, createInvoicesBatchScheduler_ConfigPropertyMetadata);
|
|
529
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$8(createInvoicesBatchScheduler_ConfigPropertyMetadata);
|
|
530
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
531
|
+
const config = {};
|
|
532
|
+
const untrustedConfig_BatchInvoiceSchedulerInput = untrustedConfig.BatchInvoiceSchedulerInput;
|
|
533
|
+
const referenceBatchInvoiceSchedulerInputRepresentationValidationError = validate$b(untrustedConfig_BatchInvoiceSchedulerInput);
|
|
534
|
+
if (referenceBatchInvoiceSchedulerInputRepresentationValidationError === null) {
|
|
535
|
+
config.BatchInvoiceSchedulerInput = untrustedConfig_BatchInvoiceSchedulerInput;
|
|
536
|
+
}
|
|
537
|
+
return config;
|
|
538
|
+
}
|
|
539
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
540
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
541
|
+
return null;
|
|
542
|
+
}
|
|
543
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
544
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
545
|
+
}
|
|
546
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
547
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
548
|
+
return null;
|
|
549
|
+
}
|
|
550
|
+
return config;
|
|
551
|
+
}
|
|
552
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
553
|
+
const resourceParams = createResourceParams$6(config);
|
|
554
|
+
const request = createResourceRequest$6(resourceParams);
|
|
555
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
556
|
+
.then((response) => {
|
|
557
|
+
return luvio.handleSuccessResponse(() => {
|
|
558
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response);
|
|
559
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
560
|
+
}, () => {
|
|
561
|
+
const cache = new StoreKeyMap();
|
|
562
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
563
|
+
return cache;
|
|
564
|
+
});
|
|
565
|
+
}, (response) => {
|
|
566
|
+
deepFreeze(response);
|
|
567
|
+
throw response;
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
const createInvoicesBatchSchedulerAdapterFactory = (luvio) => {
|
|
571
|
+
return function createInvoicesBatchScheduler(untrustedConfig) {
|
|
572
|
+
const config = validateAdapterConfig$6(untrustedConfig, createInvoicesBatchScheduler_ConfigPropertyNames);
|
|
573
|
+
// Invalid or incomplete config
|
|
574
|
+
if (config === null) {
|
|
575
|
+
throw new Error('Invalid config for "createInvoicesBatchScheduler"');
|
|
576
|
+
}
|
|
577
|
+
return buildNetworkSnapshot$6(luvio, config);
|
|
578
|
+
};
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
function validate$8(obj, path = 'ScheduleOptionsInputRepresentation') {
|
|
582
|
+
const v_error = (() => {
|
|
583
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
584
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
585
|
+
}
|
|
586
|
+
if (obj.endDate !== undefined) {
|
|
587
|
+
const obj_endDate = obj.endDate;
|
|
588
|
+
const path_endDate = path + '.endDate';
|
|
589
|
+
if (typeof obj_endDate !== 'string') {
|
|
590
|
+
return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
const obj_frequencyCadence = obj.frequencyCadence;
|
|
594
|
+
const path_frequencyCadence = path + '.frequencyCadence';
|
|
595
|
+
if (typeof obj_frequencyCadence !== 'string') {
|
|
596
|
+
return new TypeError('Expected "string" but received "' + typeof obj_frequencyCadence + '" (at "' + path_frequencyCadence + '")');
|
|
597
|
+
}
|
|
598
|
+
const obj_preferredTime = obj.preferredTime;
|
|
599
|
+
const path_preferredTime = path + '.preferredTime';
|
|
600
|
+
if (typeof obj_preferredTime !== 'string') {
|
|
601
|
+
return new TypeError('Expected "string" but received "' + typeof obj_preferredTime + '" (at "' + path_preferredTime + '")');
|
|
602
|
+
}
|
|
603
|
+
if (obj.recursEveryMonthOnDay !== undefined) {
|
|
604
|
+
const obj_recursEveryMonthOnDay = obj.recursEveryMonthOnDay;
|
|
605
|
+
const path_recursEveryMonthOnDay = path + '.recursEveryMonthOnDay';
|
|
606
|
+
if (typeof obj_recursEveryMonthOnDay !== 'string') {
|
|
607
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recursEveryMonthOnDay + '" (at "' + path_recursEveryMonthOnDay + '")');
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
const obj_schedulerName = obj.schedulerName;
|
|
611
|
+
const path_schedulerName = path + '.schedulerName';
|
|
612
|
+
if (typeof obj_schedulerName !== 'string') {
|
|
613
|
+
return new TypeError('Expected "string" but received "' + typeof obj_schedulerName + '" (at "' + path_schedulerName + '")');
|
|
614
|
+
}
|
|
615
|
+
const obj_startDate = obj.startDate;
|
|
616
|
+
const path_startDate = path + '.startDate';
|
|
617
|
+
if (typeof obj_startDate !== 'string') {
|
|
618
|
+
return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
|
|
619
|
+
}
|
|
620
|
+
const obj_status = obj.status;
|
|
621
|
+
const path_status = path + '.status';
|
|
622
|
+
if (typeof obj_status !== 'string') {
|
|
623
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
624
|
+
}
|
|
625
|
+
})();
|
|
626
|
+
return v_error === undefined ? null : v_error;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
function validate$7(obj, path = 'PaymentsBatchSchedulerInputRepresentation') {
|
|
630
|
+
const validateScheduleOptionsInputRepresentation_validateError = validate$8(obj, path);
|
|
631
|
+
if (validateScheduleOptionsInputRepresentation_validateError !== null) {
|
|
632
|
+
return validateScheduleOptionsInputRepresentation_validateError;
|
|
633
|
+
}
|
|
634
|
+
const v_error = (() => {
|
|
635
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
636
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
637
|
+
}
|
|
638
|
+
if (obj.criteriaMatchType !== undefined) {
|
|
639
|
+
const obj_criteriaMatchType = obj.criteriaMatchType;
|
|
640
|
+
const path_criteriaMatchType = path + '.criteriaMatchType';
|
|
641
|
+
if (typeof obj_criteriaMatchType !== 'string') {
|
|
642
|
+
return new TypeError('Expected "string" but received "' + typeof obj_criteriaMatchType + '" (at "' + path_criteriaMatchType + '")');
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
if (obj.filterCriteria !== undefined) {
|
|
646
|
+
const obj_filterCriteria = obj.filterCriteria;
|
|
647
|
+
const path_filterCriteria = path + '.filterCriteria';
|
|
648
|
+
if (!ArrayIsArray(obj_filterCriteria)) {
|
|
649
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filterCriteria + '" (at "' + path_filterCriteria + '")');
|
|
650
|
+
}
|
|
651
|
+
for (let i = 0; i < obj_filterCriteria.length; i++) {
|
|
652
|
+
const obj_filterCriteria_item = obj_filterCriteria[i];
|
|
653
|
+
const path_filterCriteria_item = path_filterCriteria + '[' + i + ']';
|
|
654
|
+
if (typeof obj_filterCriteria_item !== 'object' || ArrayIsArray(obj_filterCriteria_item) || obj_filterCriteria_item === null) {
|
|
655
|
+
return new TypeError('Expected "object" but received "' + typeof obj_filterCriteria_item + '" (at "' + path_filterCriteria_item + '")');
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
})();
|
|
660
|
+
return v_error === undefined ? null : v_error;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
const TTL$4 = 1000;
|
|
664
|
+
const VERSION$5 = "eff71edc32270b9a1e6e1779cb811c3c";
|
|
665
|
+
function validate$6(obj, path = 'PaymentsBatchSchedulerOutputRepresentation') {
|
|
666
|
+
const v_error = (() => {
|
|
667
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
668
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
669
|
+
}
|
|
670
|
+
const obj_billingBatchScheduler = obj.billingBatchScheduler;
|
|
671
|
+
const path_billingBatchScheduler = path + '.billingBatchScheduler';
|
|
672
|
+
const referencepath_billingBatchSchedulerValidationError = validate$a(obj_billingBatchScheduler, path_billingBatchScheduler);
|
|
673
|
+
if (referencepath_billingBatchSchedulerValidationError !== null) {
|
|
674
|
+
let message = 'Object doesn\'t match BillingBatchSchedulerRepresentation (at "' + path_billingBatchScheduler + '")\n';
|
|
675
|
+
message += referencepath_billingBatchSchedulerValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
676
|
+
return new TypeError(message);
|
|
677
|
+
}
|
|
678
|
+
})();
|
|
679
|
+
return v_error === undefined ? null : v_error;
|
|
680
|
+
}
|
|
681
|
+
const RepresentationType$4 = 'PaymentsBatchSchedulerOutputRepresentation';
|
|
682
|
+
function keyBuilder$5(luvio, config) {
|
|
683
|
+
return keyPrefix + '::' + RepresentationType$4 + ':' + config.billingBatchSchedulerId;
|
|
684
|
+
}
|
|
685
|
+
function keyBuilderFromType$3(luvio, object) {
|
|
686
|
+
const keyParams = {
|
|
687
|
+
billingBatchSchedulerId: object.billingBatchScheduler.id
|
|
688
|
+
};
|
|
689
|
+
return keyBuilder$5(luvio, keyParams);
|
|
690
|
+
}
|
|
691
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
692
|
+
return input;
|
|
693
|
+
}
|
|
694
|
+
const select$b = function PaymentsBatchSchedulerOutputRepresentationSelect() {
|
|
695
|
+
return {
|
|
696
|
+
kind: 'Fragment',
|
|
697
|
+
version: VERSION$5,
|
|
698
|
+
private: [],
|
|
699
|
+
opaque: true
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
function equals$5(existing, incoming) {
|
|
703
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
704
|
+
return false;
|
|
705
|
+
}
|
|
706
|
+
return true;
|
|
707
|
+
}
|
|
708
|
+
const ingest$4 = function PaymentsBatchSchedulerOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
709
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
710
|
+
const validateError = validate$6(input);
|
|
711
|
+
if (validateError !== null) {
|
|
712
|
+
throw validateError;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
const key = keyBuilderFromType$3(luvio, input);
|
|
716
|
+
const ttlToUse = TTL$4;
|
|
717
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "BillingBatch", VERSION$5, RepresentationType$4, equals$5);
|
|
718
|
+
return createLink(key);
|
|
719
|
+
};
|
|
720
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
721
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
722
|
+
const rootKey = keyBuilderFromType$3(luvio, input);
|
|
723
|
+
rootKeySet.set(rootKey, {
|
|
724
|
+
namespace: keyPrefix,
|
|
725
|
+
representationName: RepresentationType$4,
|
|
726
|
+
mergeable: false
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
function select$a(luvio, params) {
|
|
731
|
+
return select$b();
|
|
732
|
+
}
|
|
733
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
734
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response);
|
|
735
|
+
}
|
|
736
|
+
function ingestSuccess$5(luvio, resourceParams, response) {
|
|
737
|
+
const { body } = response;
|
|
738
|
+
const key = keyBuilderFromType$3(luvio, body);
|
|
739
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
740
|
+
const snapshot = luvio.storeLookup({
|
|
741
|
+
recordId: key,
|
|
742
|
+
node: select$a(),
|
|
743
|
+
variables: {},
|
|
744
|
+
});
|
|
745
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
746
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
747
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
deepFreeze(snapshot.data);
|
|
751
|
+
return snapshot;
|
|
752
|
+
}
|
|
753
|
+
function createResourceRequest$5(config) {
|
|
754
|
+
const headers = {};
|
|
755
|
+
return {
|
|
756
|
+
baseUri: '/services/data/v66.0',
|
|
757
|
+
basePath: '/commerce/payments/payment-schedulers',
|
|
758
|
+
method: 'post',
|
|
759
|
+
body: config.body,
|
|
760
|
+
urlParams: {},
|
|
761
|
+
queryParams: {},
|
|
762
|
+
headers,
|
|
763
|
+
priority: 'normal',
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
const adapterName$5 = 'createPaymentsBatchScheduler';
|
|
768
|
+
const createPaymentsBatchScheduler_ConfigPropertyMetadata = [
|
|
769
|
+
generateParamConfigMetadata('PaymentsBatchSchedulerInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
770
|
+
];
|
|
771
|
+
const createPaymentsBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, createPaymentsBatchScheduler_ConfigPropertyMetadata);
|
|
772
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$8(createPaymentsBatchScheduler_ConfigPropertyMetadata);
|
|
773
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
774
|
+
const config = {};
|
|
775
|
+
const untrustedConfig_PaymentsBatchSchedulerInput = untrustedConfig.PaymentsBatchSchedulerInput;
|
|
776
|
+
const referencePaymentsBatchSchedulerInputRepresentationValidationError = validate$7(untrustedConfig_PaymentsBatchSchedulerInput);
|
|
777
|
+
if (referencePaymentsBatchSchedulerInputRepresentationValidationError === null) {
|
|
778
|
+
config.PaymentsBatchSchedulerInput = untrustedConfig_PaymentsBatchSchedulerInput;
|
|
779
|
+
}
|
|
780
|
+
return config;
|
|
781
|
+
}
|
|
782
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
783
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
787
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
788
|
+
}
|
|
789
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
790
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
791
|
+
return null;
|
|
792
|
+
}
|
|
793
|
+
return config;
|
|
794
|
+
}
|
|
795
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
796
|
+
const resourceParams = createResourceParams$5(config);
|
|
797
|
+
const request = createResourceRequest$5(resourceParams);
|
|
798
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
799
|
+
.then((response) => {
|
|
800
|
+
return luvio.handleSuccessResponse(() => {
|
|
801
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response);
|
|
802
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
803
|
+
}, () => {
|
|
804
|
+
const cache = new StoreKeyMap();
|
|
805
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
806
|
+
return cache;
|
|
807
|
+
});
|
|
808
|
+
}, (response) => {
|
|
809
|
+
deepFreeze(response);
|
|
810
|
+
throw response;
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
const createPaymentsBatchSchedulerAdapterFactory = (luvio) => {
|
|
814
|
+
return function createPaymentsBatchScheduler(untrustedConfig) {
|
|
815
|
+
const config = validateAdapterConfig$5(untrustedConfig, createPaymentsBatchScheduler_ConfigPropertyNames);
|
|
816
|
+
// Invalid or incomplete config
|
|
817
|
+
if (config === null) {
|
|
818
|
+
throw new Error('Invalid config for "createPaymentsBatchScheduler"');
|
|
819
|
+
}
|
|
820
|
+
return buildNetworkSnapshot$5(luvio, config);
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
function select$9(luvio, params) {
|
|
825
|
+
return select$d();
|
|
826
|
+
}
|
|
827
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
828
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
829
|
+
}
|
|
830
|
+
function ingestSuccess$4(luvio, resourceParams, response) {
|
|
831
|
+
const { body } = response;
|
|
832
|
+
const key = keyBuilderFromType$4(luvio, body);
|
|
833
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
834
|
+
const snapshot = luvio.storeLookup({
|
|
835
|
+
recordId: key,
|
|
836
|
+
node: select$9(),
|
|
837
|
+
variables: {},
|
|
838
|
+
});
|
|
839
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
840
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
841
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
deepFreeze(snapshot.data);
|
|
845
|
+
return snapshot;
|
|
846
|
+
}
|
|
847
|
+
function createResourceRequest$4(config) {
|
|
848
|
+
const headers = {};
|
|
849
|
+
return {
|
|
850
|
+
baseUri: '/services/data/v66.0',
|
|
851
|
+
basePath: '/commerce/invoicing/invoice-schedulers/' + config.urlParams.billingBatchSchedulerId + '',
|
|
852
|
+
method: 'put',
|
|
853
|
+
body: config.body,
|
|
854
|
+
urlParams: config.urlParams,
|
|
855
|
+
queryParams: {},
|
|
856
|
+
headers,
|
|
857
|
+
priority: 'normal',
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
const adapterName$4 = 'editInvoicesBatchScheduler';
|
|
862
|
+
const editInvoicesBatchScheduler_ConfigPropertyMetadata = [
|
|
863
|
+
generateParamConfigMetadata('billingBatchSchedulerId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
864
|
+
generateParamConfigMetadata('BatchInvoiceSchedulerInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
865
|
+
];
|
|
866
|
+
const editInvoicesBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, editInvoicesBatchScheduler_ConfigPropertyMetadata);
|
|
867
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$8(editInvoicesBatchScheduler_ConfigPropertyMetadata);
|
|
868
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
869
|
+
const config = {};
|
|
870
|
+
typeCheckConfig$8(untrustedConfig, config, editInvoicesBatchScheduler_ConfigPropertyMetadata);
|
|
871
|
+
const untrustedConfig_BatchInvoiceSchedulerInput = untrustedConfig.BatchInvoiceSchedulerInput;
|
|
872
|
+
const referenceBatchInvoiceSchedulerInputRepresentationValidationError = validate$b(untrustedConfig_BatchInvoiceSchedulerInput);
|
|
873
|
+
if (referenceBatchInvoiceSchedulerInputRepresentationValidationError === null) {
|
|
874
|
+
config.BatchInvoiceSchedulerInput = untrustedConfig_BatchInvoiceSchedulerInput;
|
|
875
|
+
}
|
|
876
|
+
return config;
|
|
877
|
+
}
|
|
878
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
879
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
880
|
+
return null;
|
|
881
|
+
}
|
|
882
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
883
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
884
|
+
}
|
|
885
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
886
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
887
|
+
return null;
|
|
888
|
+
}
|
|
889
|
+
return config;
|
|
890
|
+
}
|
|
891
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
892
|
+
const resourceParams = createResourceParams$4(config);
|
|
893
|
+
const request = createResourceRequest$4(resourceParams);
|
|
894
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
895
|
+
.then((response) => {
|
|
896
|
+
return luvio.handleSuccessResponse(() => {
|
|
897
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response);
|
|
898
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
899
|
+
}, () => {
|
|
900
|
+
const cache = new StoreKeyMap();
|
|
901
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
902
|
+
return cache;
|
|
903
|
+
});
|
|
904
|
+
}, (response) => {
|
|
905
|
+
deepFreeze(response);
|
|
906
|
+
throw response;
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
const editInvoicesBatchSchedulerAdapterFactory = (luvio) => {
|
|
910
|
+
return function editInvoicesBatchScheduler(untrustedConfig) {
|
|
911
|
+
const config = validateAdapterConfig$4(untrustedConfig, editInvoicesBatchScheduler_ConfigPropertyNames);
|
|
912
|
+
// Invalid or incomplete config
|
|
913
|
+
if (config === null) {
|
|
914
|
+
throw new Error('Invalid config for "editInvoicesBatchScheduler"');
|
|
915
|
+
}
|
|
916
|
+
return buildNetworkSnapshot$4(luvio, config);
|
|
917
|
+
};
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
const TTL$3 = 1000;
|
|
921
|
+
const VERSION$4 = "1b89e7904345b50c1a8bfa0fc6e7dff0";
|
|
922
|
+
function validate$5(obj, path = 'InvoiceBatchDraftToPostedOutputRepresentation') {
|
|
923
|
+
const v_error = (() => {
|
|
924
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
925
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
926
|
+
}
|
|
927
|
+
const obj_invoiceBatchDraftToPostedId = obj.invoiceBatchDraftToPostedId;
|
|
928
|
+
const path_invoiceBatchDraftToPostedId = path + '.invoiceBatchDraftToPostedId';
|
|
929
|
+
if (typeof obj_invoiceBatchDraftToPostedId !== 'string') {
|
|
930
|
+
return new TypeError('Expected "string" but received "' + typeof obj_invoiceBatchDraftToPostedId + '" (at "' + path_invoiceBatchDraftToPostedId + '")');
|
|
931
|
+
}
|
|
932
|
+
const obj_success = obj.success;
|
|
933
|
+
const path_success = path + '.success';
|
|
934
|
+
if (typeof obj_success !== 'boolean') {
|
|
935
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
936
|
+
}
|
|
937
|
+
})();
|
|
938
|
+
return v_error === undefined ? null : v_error;
|
|
939
|
+
}
|
|
940
|
+
const RepresentationType$3 = 'InvoiceBatchDraftToPostedOutputRepresentation';
|
|
941
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
942
|
+
return input;
|
|
943
|
+
}
|
|
944
|
+
const select$8 = function InvoiceBatchDraftToPostedOutputRepresentationSelect() {
|
|
945
|
+
return {
|
|
946
|
+
kind: 'Fragment',
|
|
947
|
+
version: VERSION$4,
|
|
948
|
+
private: [],
|
|
949
|
+
selections: [
|
|
950
|
+
{
|
|
951
|
+
name: 'invoiceBatchDraftToPostedId',
|
|
952
|
+
kind: 'Scalar'
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
name: 'success',
|
|
956
|
+
kind: 'Scalar'
|
|
957
|
+
}
|
|
958
|
+
]
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
function equals$4(existing, incoming) {
|
|
962
|
+
const existing_success = existing.success;
|
|
963
|
+
const incoming_success = incoming.success;
|
|
964
|
+
if (!(existing_success === incoming_success)) {
|
|
965
|
+
return false;
|
|
966
|
+
}
|
|
967
|
+
const existing_invoiceBatchDraftToPostedId = existing.invoiceBatchDraftToPostedId;
|
|
968
|
+
const incoming_invoiceBatchDraftToPostedId = incoming.invoiceBatchDraftToPostedId;
|
|
969
|
+
if (!(existing_invoiceBatchDraftToPostedId === incoming_invoiceBatchDraftToPostedId)) {
|
|
970
|
+
return false;
|
|
971
|
+
}
|
|
972
|
+
return true;
|
|
973
|
+
}
|
|
974
|
+
const ingest$3 = function InvoiceBatchDraftToPostedOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
975
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
976
|
+
const validateError = validate$5(input);
|
|
977
|
+
if (validateError !== null) {
|
|
978
|
+
throw validateError;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
const key = path.fullPath;
|
|
982
|
+
const ttlToUse = TTL$3;
|
|
983
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "BillingBatch", VERSION$4, RepresentationType$3, equals$4);
|
|
984
|
+
return createLink(key);
|
|
985
|
+
};
|
|
986
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
987
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
988
|
+
const rootKey = fullPathFactory();
|
|
989
|
+
rootKeySet.set(rootKey, {
|
|
990
|
+
namespace: keyPrefix,
|
|
991
|
+
representationName: RepresentationType$3,
|
|
992
|
+
mergeable: false
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
function select$7(luvio, params) {
|
|
997
|
+
return select$8();
|
|
998
|
+
}
|
|
999
|
+
function keyBuilder$4(luvio, params) {
|
|
1000
|
+
return keyPrefix + '::InvoiceBatchDraftToPostedOutputRepresentation:(' + 'invoiceBatchRunId:' + params.urlParams.invoiceBatchRunId + ',' + stableJSONStringify(params.body) + ')';
|
|
1001
|
+
}
|
|
1002
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1003
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
|
|
1004
|
+
}
|
|
1005
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
1006
|
+
const { body } = response;
|
|
1007
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
1008
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
1009
|
+
const snapshot = luvio.storeLookup({
|
|
1010
|
+
recordId: key,
|
|
1011
|
+
node: select$7(),
|
|
1012
|
+
variables: {},
|
|
1013
|
+
}, snapshotRefresh);
|
|
1014
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1015
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1016
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
deepFreeze(snapshot.data);
|
|
1020
|
+
return snapshot;
|
|
1021
|
+
}
|
|
1022
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1023
|
+
const key = keyBuilder$4(luvio, params);
|
|
1024
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1025
|
+
const storeMetadataParams = {
|
|
1026
|
+
ttl: TTL$3,
|
|
1027
|
+
namespace: keyPrefix,
|
|
1028
|
+
version: VERSION$4,
|
|
1029
|
+
representationName: RepresentationType$3
|
|
1030
|
+
};
|
|
1031
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1032
|
+
return errorSnapshot;
|
|
1033
|
+
}
|
|
1034
|
+
function createResourceRequest$3(config) {
|
|
1035
|
+
const headers = {};
|
|
1036
|
+
return {
|
|
1037
|
+
baseUri: '/services/data/v66.0',
|
|
1038
|
+
basePath: '/commerce/invoicing/invoice-batch-runs/' + config.urlParams.invoiceBatchRunId + '/actions/draft-to-posted',
|
|
1039
|
+
method: 'post',
|
|
1040
|
+
body: config.body,
|
|
1041
|
+
urlParams: config.urlParams,
|
|
1042
|
+
queryParams: {},
|
|
1043
|
+
headers,
|
|
1044
|
+
priority: 'normal',
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
const adapterName$3 = 'postBatchDraftInvoices';
|
|
1049
|
+
const postBatchDraftInvoices_ConfigPropertyMetadata = [
|
|
1050
|
+
generateParamConfigMetadata('invoiceBatchRunId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1051
|
+
];
|
|
1052
|
+
const postBatchDraftInvoices_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, postBatchDraftInvoices_ConfigPropertyMetadata);
|
|
1053
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$8(postBatchDraftInvoices_ConfigPropertyMetadata);
|
|
1054
|
+
function keyBuilder$3(luvio, config) {
|
|
1055
|
+
const resourceParams = createResourceParams$3(config);
|
|
1056
|
+
return keyBuilder$4(luvio, resourceParams);
|
|
1057
|
+
}
|
|
1058
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1059
|
+
const config = {};
|
|
1060
|
+
typeCheckConfig$8(untrustedConfig, config, postBatchDraftInvoices_ConfigPropertyMetadata);
|
|
1061
|
+
return config;
|
|
1062
|
+
}
|
|
1063
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1064
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1065
|
+
return null;
|
|
1066
|
+
}
|
|
1067
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1068
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1069
|
+
}
|
|
1070
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
1071
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1072
|
+
return null;
|
|
1073
|
+
}
|
|
1074
|
+
return config;
|
|
1075
|
+
}
|
|
1076
|
+
function adapterFragment(luvio, config) {
|
|
1077
|
+
createResourceParams$3(config);
|
|
1078
|
+
return select$7();
|
|
1079
|
+
}
|
|
1080
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1081
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
1082
|
+
config,
|
|
1083
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1084
|
+
});
|
|
1085
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1086
|
+
}
|
|
1087
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1088
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1089
|
+
config,
|
|
1090
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1091
|
+
});
|
|
1092
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1093
|
+
}
|
|
1094
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1095
|
+
const resourceParams = createResourceParams$3(config);
|
|
1096
|
+
const request = createResourceRequest$3(resourceParams);
|
|
1097
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1098
|
+
.then((response) => {
|
|
1099
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1100
|
+
const cache = new StoreKeyMap();
|
|
1101
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
1102
|
+
return cache;
|
|
1103
|
+
});
|
|
1104
|
+
}, (response) => {
|
|
1105
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1109
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, 'get', false);
|
|
1110
|
+
}
|
|
1111
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1112
|
+
const { luvio, config } = context;
|
|
1113
|
+
const selector = {
|
|
1114
|
+
recordId: keyBuilder$3(luvio, config),
|
|
1115
|
+
node: adapterFragment(luvio, config),
|
|
1116
|
+
variables: {},
|
|
1117
|
+
};
|
|
1118
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1119
|
+
config,
|
|
1120
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1121
|
+
});
|
|
1122
|
+
return cacheSnapshot;
|
|
1123
|
+
}
|
|
1124
|
+
const postBatchDraftInvoicesAdapterFactory = (luvio) => function BillingBatch__postBatchDraftInvoices(untrustedConfig, requestContext) {
|
|
1125
|
+
const config = validateAdapterConfig$3(untrustedConfig, postBatchDraftInvoices_ConfigPropertyNames);
|
|
1126
|
+
// Invalid or incomplete config
|
|
1127
|
+
if (config === null) {
|
|
1128
|
+
return null;
|
|
1129
|
+
}
|
|
1130
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1131
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
const VERSION$3 = "ae245aac2922b53e1ff758392e317d39";
|
|
1135
|
+
function validate$4(obj, path = 'BatchInvoiceDocGenErrorRepresentation') {
|
|
1136
|
+
const v_error = (() => {
|
|
1137
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1138
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1139
|
+
}
|
|
1140
|
+
const obj_errorCode = obj.errorCode;
|
|
1141
|
+
const path_errorCode = path + '.errorCode';
|
|
1142
|
+
if (typeof obj_errorCode !== 'string') {
|
|
1143
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
|
|
1144
|
+
}
|
|
1145
|
+
const obj_errorMessage = obj.errorMessage;
|
|
1146
|
+
const path_errorMessage = path + '.errorMessage';
|
|
1147
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
1148
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
1149
|
+
}
|
|
1150
|
+
})();
|
|
1151
|
+
return v_error === undefined ? null : v_error;
|
|
1152
|
+
}
|
|
1153
|
+
const select$6 = function BatchInvoiceDocGenErrorRepresentationSelect() {
|
|
1154
|
+
return {
|
|
1155
|
+
kind: 'Fragment',
|
|
1156
|
+
version: VERSION$3,
|
|
1157
|
+
private: [],
|
|
1158
|
+
selections: [
|
|
1159
|
+
{
|
|
1160
|
+
name: 'errorCode',
|
|
1161
|
+
kind: 'Scalar'
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
name: 'errorMessage',
|
|
1165
|
+
kind: 'Scalar'
|
|
1166
|
+
}
|
|
1167
|
+
]
|
|
1168
|
+
};
|
|
1169
|
+
};
|
|
1170
|
+
function equals$3(existing, incoming) {
|
|
1171
|
+
const existing_errorCode = existing.errorCode;
|
|
1172
|
+
const incoming_errorCode = incoming.errorCode;
|
|
1173
|
+
if (!(existing_errorCode === incoming_errorCode)) {
|
|
1174
|
+
return false;
|
|
1175
|
+
}
|
|
1176
|
+
const existing_errorMessage = existing.errorMessage;
|
|
1177
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
1178
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
1179
|
+
return false;
|
|
1180
|
+
}
|
|
1181
|
+
return true;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
const TTL$2 = 1000;
|
|
1185
|
+
const VERSION$2 = "1630988ffc3067417295a90783bd1812";
|
|
1186
|
+
function validate$3(obj, path = 'BatchInvoiceDocGenOutputRepresentation') {
|
|
1187
|
+
const v_error = (() => {
|
|
1188
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1189
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1190
|
+
}
|
|
1191
|
+
const obj_errors = obj.errors;
|
|
1192
|
+
const path_errors = path + '.errors';
|
|
1193
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
1194
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
1195
|
+
}
|
|
1196
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
1197
|
+
const obj_errors_item = obj_errors[i];
|
|
1198
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
1199
|
+
const referencepath_errors_itemValidationError = validate$4(obj_errors_item, path_errors_item);
|
|
1200
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
1201
|
+
let message = 'Object doesn\'t match BatchInvoiceDocGenErrorRepresentation (at "' + path_errors_item + '")\n';
|
|
1202
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1203
|
+
return new TypeError(message);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
const obj_requestIdentifier = obj.requestIdentifier;
|
|
1207
|
+
const path_requestIdentifier = path + '.requestIdentifier';
|
|
1208
|
+
if (typeof obj_requestIdentifier !== 'string') {
|
|
1209
|
+
return new TypeError('Expected "string" but received "' + typeof obj_requestIdentifier + '" (at "' + path_requestIdentifier + '")');
|
|
1210
|
+
}
|
|
1211
|
+
const obj_success = obj.success;
|
|
1212
|
+
const path_success = path + '.success';
|
|
1213
|
+
if (typeof obj_success !== 'boolean') {
|
|
1214
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
1215
|
+
}
|
|
1216
|
+
})();
|
|
1217
|
+
return v_error === undefined ? null : v_error;
|
|
1218
|
+
}
|
|
1219
|
+
const RepresentationType$2 = 'BatchInvoiceDocGenOutputRepresentation';
|
|
1220
|
+
function keyBuilder$2(luvio, config) {
|
|
1221
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.requestIdentifier;
|
|
1222
|
+
}
|
|
1223
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
1224
|
+
const keyParams = {
|
|
1225
|
+
requestIdentifier: object.requestIdentifier
|
|
1226
|
+
};
|
|
1227
|
+
return keyBuilder$2(luvio, keyParams);
|
|
1228
|
+
}
|
|
1229
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1230
|
+
return input;
|
|
1231
|
+
}
|
|
1232
|
+
const select$5 = function BatchInvoiceDocGenOutputRepresentationSelect() {
|
|
1233
|
+
const { selections: BatchInvoiceDocGenErrorRepresentation__selections, opaque: BatchInvoiceDocGenErrorRepresentation__opaque, } = select$6();
|
|
1234
|
+
return {
|
|
1235
|
+
kind: 'Fragment',
|
|
1236
|
+
version: VERSION$2,
|
|
1237
|
+
private: [],
|
|
1238
|
+
selections: [
|
|
1239
|
+
{
|
|
1240
|
+
name: 'errors',
|
|
1241
|
+
kind: 'Object',
|
|
1242
|
+
plural: true,
|
|
1243
|
+
selections: BatchInvoiceDocGenErrorRepresentation__selections
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
name: 'requestIdentifier',
|
|
1247
|
+
kind: 'Scalar'
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
name: 'success',
|
|
1251
|
+
kind: 'Scalar'
|
|
1252
|
+
}
|
|
1253
|
+
]
|
|
1254
|
+
};
|
|
1255
|
+
};
|
|
1256
|
+
function equals$2(existing, incoming) {
|
|
1257
|
+
const existing_success = existing.success;
|
|
1258
|
+
const incoming_success = incoming.success;
|
|
1259
|
+
if (!(existing_success === incoming_success)) {
|
|
1260
|
+
return false;
|
|
1261
|
+
}
|
|
1262
|
+
const existing_requestIdentifier = existing.requestIdentifier;
|
|
1263
|
+
const incoming_requestIdentifier = incoming.requestIdentifier;
|
|
1264
|
+
if (!(existing_requestIdentifier === incoming_requestIdentifier)) {
|
|
1265
|
+
return false;
|
|
1266
|
+
}
|
|
1267
|
+
const existing_errors = existing.errors;
|
|
1268
|
+
const incoming_errors = incoming.errors;
|
|
1269
|
+
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
1270
|
+
if (!(equals$3(existing_errors_item, incoming_errors_item))) {
|
|
1271
|
+
return false;
|
|
1272
|
+
}
|
|
1273
|
+
});
|
|
1274
|
+
if (equals_errors_items === false) {
|
|
1275
|
+
return false;
|
|
1276
|
+
}
|
|
1277
|
+
return true;
|
|
1278
|
+
}
|
|
1279
|
+
const ingest$2 = function BatchInvoiceDocGenOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1280
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1281
|
+
const validateError = validate$3(input);
|
|
1282
|
+
if (validateError !== null) {
|
|
1283
|
+
throw validateError;
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
1287
|
+
const ttlToUse = TTL$2;
|
|
1288
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "BillingBatch", VERSION$2, RepresentationType$2, equals$2);
|
|
1289
|
+
return createLink(key);
|
|
1290
|
+
};
|
|
1291
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1292
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1293
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
1294
|
+
rootKeySet.set(rootKey, {
|
|
1295
|
+
namespace: keyPrefix,
|
|
1296
|
+
representationName: RepresentationType$2,
|
|
1297
|
+
mergeable: false
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
function select$4(luvio, params) {
|
|
1302
|
+
return select$5();
|
|
1303
|
+
}
|
|
1304
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
1305
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
1306
|
+
}
|
|
1307
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
1308
|
+
const { body } = response;
|
|
1309
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
1310
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1311
|
+
const snapshot = luvio.storeLookup({
|
|
1312
|
+
recordId: key,
|
|
1313
|
+
node: select$4(),
|
|
1314
|
+
variables: {},
|
|
1315
|
+
});
|
|
1316
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1317
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1318
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
deepFreeze(snapshot.data);
|
|
1322
|
+
return snapshot;
|
|
1323
|
+
}
|
|
1324
|
+
function createResourceRequest$2(config) {
|
|
1325
|
+
const headers = {};
|
|
1326
|
+
return {
|
|
1327
|
+
baseUri: '/services/data/v66.0',
|
|
1328
|
+
basePath: '/commerce/billing/invoices/invoice-batch-docgen/' + config.urlParams.invoiceBatchRunId + '/actions/' + config.urlParams.actionName + '',
|
|
1329
|
+
method: 'post',
|
|
1330
|
+
body: null,
|
|
1331
|
+
urlParams: config.urlParams,
|
|
1332
|
+
queryParams: {},
|
|
1333
|
+
headers,
|
|
1334
|
+
priority: 'normal',
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
const adapterName$2 = 'postBatchInvoiceDocGen';
|
|
1339
|
+
const postBatchInvoiceDocGen_ConfigPropertyMetadata = [
|
|
1340
|
+
generateParamConfigMetadata('invoiceBatchRunId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1341
|
+
generateParamConfigMetadata('actionName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1342
|
+
];
|
|
1343
|
+
const postBatchInvoiceDocGen_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, postBatchInvoiceDocGen_ConfigPropertyMetadata);
|
|
1344
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$8(postBatchInvoiceDocGen_ConfigPropertyMetadata);
|
|
1345
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
1346
|
+
const config = {};
|
|
1347
|
+
typeCheckConfig$8(untrustedConfig, config, postBatchInvoiceDocGen_ConfigPropertyMetadata);
|
|
1348
|
+
return config;
|
|
1349
|
+
}
|
|
1350
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1351
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1352
|
+
return null;
|
|
1353
|
+
}
|
|
1354
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1355
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1356
|
+
}
|
|
1357
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1358
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1359
|
+
return null;
|
|
1360
|
+
}
|
|
1361
|
+
return config;
|
|
1362
|
+
}
|
|
1363
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1364
|
+
const resourceParams = createResourceParams$2(config);
|
|
1365
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1366
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1367
|
+
.then((response) => {
|
|
1368
|
+
return luvio.handleSuccessResponse(() => {
|
|
1369
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
1370
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1371
|
+
}, () => {
|
|
1372
|
+
const cache = new StoreKeyMap();
|
|
1373
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
1374
|
+
return cache;
|
|
1375
|
+
});
|
|
1376
|
+
}, (response) => {
|
|
1377
|
+
deepFreeze(response);
|
|
1378
|
+
throw response;
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
const postBatchInvoiceDocGenAdapterFactory = (luvio) => {
|
|
1382
|
+
return function postBatchInvoiceDocGen(untrustedConfig) {
|
|
1383
|
+
const config = validateAdapterConfig$2(untrustedConfig, postBatchInvoiceDocGen_ConfigPropertyNames);
|
|
1384
|
+
// Invalid or incomplete config
|
|
1385
|
+
if (config === null) {
|
|
1386
|
+
throw new Error('Invalid config for "postBatchInvoiceDocGen"');
|
|
1387
|
+
}
|
|
1388
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
1389
|
+
};
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
const TTL$1 = 1000;
|
|
1393
|
+
const VERSION$1 = "c7bbc92c6b88cd62361410ec3b1597e5";
|
|
1394
|
+
function validate$2(obj, path = 'CronExecutionDatesOutputRepresentation') {
|
|
1395
|
+
const v_error = (() => {
|
|
1396
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1397
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1398
|
+
}
|
|
1399
|
+
const obj_executionDates = obj.executionDates;
|
|
1400
|
+
const path_executionDates = path + '.executionDates';
|
|
1401
|
+
if (!ArrayIsArray(obj_executionDates)) {
|
|
1402
|
+
return new TypeError('Expected "array" but received "' + typeof obj_executionDates + '" (at "' + path_executionDates + '")');
|
|
1403
|
+
}
|
|
1404
|
+
for (let i = 0; i < obj_executionDates.length; i++) {
|
|
1405
|
+
const obj_executionDates_item = obj_executionDates[i];
|
|
1406
|
+
const path_executionDates_item = path_executionDates + '[' + i + ']';
|
|
1407
|
+
if (typeof obj_executionDates_item !== 'string') {
|
|
1408
|
+
return new TypeError('Expected "string" but received "' + typeof obj_executionDates_item + '" (at "' + path_executionDates_item + '")');
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
})();
|
|
1412
|
+
return v_error === undefined ? null : v_error;
|
|
1413
|
+
}
|
|
1414
|
+
const RepresentationType$1 = 'CronExecutionDatesOutputRepresentation';
|
|
1415
|
+
function keyBuilder$1(luvio, config) {
|
|
1416
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + '[' + config.executionDates.join(',') + ']';
|
|
1417
|
+
}
|
|
1418
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
1419
|
+
const keyParams = {
|
|
1420
|
+
executionDates: object.executionDates
|
|
1421
|
+
};
|
|
1422
|
+
return keyBuilder$1(luvio, keyParams);
|
|
1423
|
+
}
|
|
1424
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1425
|
+
return input;
|
|
1426
|
+
}
|
|
1427
|
+
const select$3 = function CronExecutionDatesOutputRepresentationSelect() {
|
|
1428
|
+
return {
|
|
1429
|
+
kind: 'Fragment',
|
|
1430
|
+
version: VERSION$1,
|
|
1431
|
+
private: [],
|
|
1432
|
+
selections: [
|
|
1433
|
+
{
|
|
1434
|
+
name: 'executionDates',
|
|
1435
|
+
kind: 'Scalar',
|
|
1436
|
+
plural: true
|
|
1437
|
+
}
|
|
1438
|
+
]
|
|
1439
|
+
};
|
|
1440
|
+
};
|
|
1441
|
+
function equals$1(existing, incoming) {
|
|
1442
|
+
const existing_executionDates = existing.executionDates;
|
|
1443
|
+
const incoming_executionDates = incoming.executionDates;
|
|
1444
|
+
const equals_executionDates_items = equalsArray(existing_executionDates, incoming_executionDates, (existing_executionDates_item, incoming_executionDates_item) => {
|
|
1445
|
+
if (!(existing_executionDates_item === incoming_executionDates_item)) {
|
|
1446
|
+
return false;
|
|
1447
|
+
}
|
|
1448
|
+
});
|
|
1449
|
+
if (equals_executionDates_items === false) {
|
|
1450
|
+
return false;
|
|
1451
|
+
}
|
|
1452
|
+
return true;
|
|
1453
|
+
}
|
|
1454
|
+
const ingest$1 = function CronExecutionDatesOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1455
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1456
|
+
const validateError = validate$2(input);
|
|
1457
|
+
if (validateError !== null) {
|
|
1458
|
+
throw validateError;
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
1462
|
+
const ttlToUse = TTL$1;
|
|
1463
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "BillingBatch", VERSION$1, RepresentationType$1, equals$1);
|
|
1464
|
+
return createLink(key);
|
|
1465
|
+
};
|
|
1466
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1467
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1468
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1469
|
+
rootKeySet.set(rootKey, {
|
|
1470
|
+
namespace: keyPrefix,
|
|
1471
|
+
representationName: RepresentationType$1,
|
|
1472
|
+
mergeable: false
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
function select$2(luvio, params) {
|
|
1477
|
+
return select$3();
|
|
1478
|
+
}
|
|
1479
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1480
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
1481
|
+
}
|
|
1482
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
1483
|
+
const { body } = response;
|
|
1484
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
1485
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1486
|
+
const snapshot = luvio.storeLookup({
|
|
1487
|
+
recordId: key,
|
|
1488
|
+
node: select$2(),
|
|
1489
|
+
variables: {},
|
|
1490
|
+
});
|
|
1491
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1492
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1493
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
deepFreeze(snapshot.data);
|
|
1497
|
+
return snapshot;
|
|
1498
|
+
}
|
|
1499
|
+
function createResourceRequest$1(config) {
|
|
1500
|
+
const headers = {};
|
|
1501
|
+
return {
|
|
1502
|
+
baseUri: '/services/data/v66.0',
|
|
1503
|
+
basePath: '/connect/billing/batch/cron/execution-dates',
|
|
1504
|
+
method: 'post',
|
|
1505
|
+
body: config.body,
|
|
1506
|
+
urlParams: {},
|
|
1507
|
+
queryParams: {},
|
|
1508
|
+
headers,
|
|
1509
|
+
priority: 'normal',
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
const adapterName$1 = 'postCronExecutionDates';
|
|
1514
|
+
const postCronExecutionDates_ConfigPropertyMetadata = [
|
|
1515
|
+
generateParamConfigMetadata('numberOfNextExecutionDates', true, 2 /* Body */, 3 /* Integer */),
|
|
1516
|
+
generateParamConfigMetadata('startDate', true, 2 /* Body */, 0 /* String */),
|
|
1517
|
+
generateParamConfigMetadata('timezone', true, 2 /* Body */, 0 /* String */),
|
|
1518
|
+
generateParamConfigMetadata('frequencyCadenceOptions', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1519
|
+
generateParamConfigMetadata('frequencyCadence', true, 2 /* Body */, 0 /* String */),
|
|
1520
|
+
generateParamConfigMetadata('preferredTime', true, 2 /* Body */, 0 /* String */),
|
|
1521
|
+
];
|
|
1522
|
+
const postCronExecutionDates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, postCronExecutionDates_ConfigPropertyMetadata);
|
|
1523
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$8(postCronExecutionDates_ConfigPropertyMetadata);
|
|
1524
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1525
|
+
const config = {};
|
|
1526
|
+
typeCheckConfig$8(untrustedConfig, config, postCronExecutionDates_ConfigPropertyMetadata);
|
|
1527
|
+
const untrustedConfig_frequencyCadenceOptions = untrustedConfig.frequencyCadenceOptions;
|
|
1528
|
+
config.frequencyCadenceOptions = untrustedConfig_frequencyCadenceOptions;
|
|
1529
|
+
return config;
|
|
1530
|
+
}
|
|
1531
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1532
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1533
|
+
return null;
|
|
1534
|
+
}
|
|
1535
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1536
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1537
|
+
}
|
|
1538
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1539
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1540
|
+
return null;
|
|
1541
|
+
}
|
|
1542
|
+
return config;
|
|
1543
|
+
}
|
|
1544
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1545
|
+
const resourceParams = createResourceParams$1(config);
|
|
1546
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1547
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1548
|
+
.then((response) => {
|
|
1549
|
+
return luvio.handleSuccessResponse(() => {
|
|
1550
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
1551
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1552
|
+
}, () => {
|
|
1553
|
+
const cache = new StoreKeyMap();
|
|
1554
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
1555
|
+
return cache;
|
|
1556
|
+
});
|
|
1557
|
+
}, (response) => {
|
|
1558
|
+
deepFreeze(response);
|
|
1559
|
+
throw response;
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
const postCronExecutionDatesAdapterFactory = (luvio) => {
|
|
1563
|
+
return function postCronExecutionDates(untrustedConfig) {
|
|
1564
|
+
const config = validateAdapterConfig$1(untrustedConfig, postCronExecutionDates_ConfigPropertyNames);
|
|
1565
|
+
// Invalid or incomplete config
|
|
1566
|
+
if (config === null) {
|
|
1567
|
+
throw new Error('Invalid config for "postCronExecutionDates"');
|
|
1568
|
+
}
|
|
1569
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
1570
|
+
};
|
|
1571
|
+
};
|
|
1572
|
+
|
|
1573
|
+
function validate$1(obj, path = 'BatchInvoiceSchedulerUpdateInputRepresentation') {
|
|
1574
|
+
const v_error = (() => {
|
|
1575
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1576
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1577
|
+
}
|
|
1578
|
+
const obj_status = obj.status;
|
|
1579
|
+
const path_status = path + '.status';
|
|
1580
|
+
if (typeof obj_status !== 'string') {
|
|
1581
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1582
|
+
}
|
|
1583
|
+
})();
|
|
1584
|
+
return v_error === undefined ? null : v_error;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
const TTL = 1000;
|
|
1588
|
+
const VERSION = "b8411d559a539f8ec599e199e2e5514e";
|
|
1589
|
+
function validate(obj, path = 'BatchInvoiceSchedulerUpdateOutputRepresentation') {
|
|
1590
|
+
const v_error = (() => {
|
|
1591
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1592
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1593
|
+
}
|
|
1594
|
+
const obj_status = obj.status;
|
|
1595
|
+
const path_status = path + '.status';
|
|
1596
|
+
if (typeof obj_status !== 'string') {
|
|
1597
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1598
|
+
}
|
|
1599
|
+
})();
|
|
1600
|
+
return v_error === undefined ? null : v_error;
|
|
1601
|
+
}
|
|
1602
|
+
const RepresentationType = 'BatchInvoiceSchedulerUpdateOutputRepresentation';
|
|
1603
|
+
function keyBuilder(luvio, config) {
|
|
1604
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.status;
|
|
1605
|
+
}
|
|
1606
|
+
function keyBuilderFromType(luvio, object) {
|
|
1607
|
+
const keyParams = {
|
|
1608
|
+
status: object.status
|
|
1609
|
+
};
|
|
1610
|
+
return keyBuilder(luvio, keyParams);
|
|
1611
|
+
}
|
|
1612
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1613
|
+
return input;
|
|
1614
|
+
}
|
|
1615
|
+
const select$1 = function BatchInvoiceSchedulerUpdateOutputRepresentationSelect() {
|
|
1616
|
+
return {
|
|
1617
|
+
kind: 'Fragment',
|
|
1618
|
+
version: VERSION,
|
|
1619
|
+
private: [],
|
|
1620
|
+
opaque: true
|
|
1621
|
+
};
|
|
1622
|
+
};
|
|
1623
|
+
function equals(existing, incoming) {
|
|
1624
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1625
|
+
return false;
|
|
1626
|
+
}
|
|
1627
|
+
return true;
|
|
1628
|
+
}
|
|
1629
|
+
const ingest = function BatchInvoiceSchedulerUpdateOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1630
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1631
|
+
const validateError = validate(input);
|
|
1632
|
+
if (validateError !== null) {
|
|
1633
|
+
throw validateError;
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
const key = keyBuilderFromType(luvio, input);
|
|
1637
|
+
const ttlToUse = TTL;
|
|
1638
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "BillingBatch", VERSION, RepresentationType, equals);
|
|
1639
|
+
return createLink(key);
|
|
1640
|
+
};
|
|
1641
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1642
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1643
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
1644
|
+
rootKeySet.set(rootKey, {
|
|
1645
|
+
namespace: keyPrefix,
|
|
1646
|
+
representationName: RepresentationType,
|
|
1647
|
+
mergeable: false
|
|
1648
|
+
});
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
function select(luvio, params) {
|
|
1652
|
+
return select$1();
|
|
1653
|
+
}
|
|
1654
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1655
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1656
|
+
}
|
|
1657
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
1658
|
+
const { body } = response;
|
|
1659
|
+
const key = keyBuilderFromType(luvio, body);
|
|
1660
|
+
luvio.storeIngest(key, ingest, body);
|
|
1661
|
+
const snapshot = luvio.storeLookup({
|
|
1662
|
+
recordId: key,
|
|
1663
|
+
node: select(),
|
|
1664
|
+
variables: {},
|
|
1665
|
+
});
|
|
1666
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1667
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1668
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
deepFreeze(snapshot.data);
|
|
1672
|
+
return snapshot;
|
|
1673
|
+
}
|
|
1674
|
+
function createResourceRequest(config) {
|
|
1675
|
+
const headers = {};
|
|
1676
|
+
return {
|
|
1677
|
+
baseUri: '/services/data/v66.0',
|
|
1678
|
+
basePath: '/commerce/invoicing/invoice-schedulers/' + config.urlParams.billingBatchSchedulerId + '',
|
|
1679
|
+
method: 'patch',
|
|
1680
|
+
body: config.body,
|
|
1681
|
+
urlParams: config.urlParams,
|
|
1682
|
+
queryParams: {},
|
|
1683
|
+
headers,
|
|
1684
|
+
priority: 'normal',
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
const adapterName = 'updateInvoicesBatchScheduler';
|
|
1689
|
+
const updateInvoicesBatchScheduler_ConfigPropertyMetadata = [
|
|
1690
|
+
generateParamConfigMetadata('billingBatchSchedulerId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1691
|
+
generateParamConfigMetadata('BatchInvoiceSchedulerUpdateInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1692
|
+
];
|
|
1693
|
+
const updateInvoicesBatchScheduler_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateInvoicesBatchScheduler_ConfigPropertyMetadata);
|
|
1694
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$8(updateInvoicesBatchScheduler_ConfigPropertyMetadata);
|
|
1695
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1696
|
+
const config = {};
|
|
1697
|
+
typeCheckConfig$8(untrustedConfig, config, updateInvoicesBatchScheduler_ConfigPropertyMetadata);
|
|
1698
|
+
const untrustedConfig_BatchInvoiceSchedulerUpdateInput = untrustedConfig.BatchInvoiceSchedulerUpdateInput;
|
|
1699
|
+
const referenceBatchInvoiceSchedulerUpdateInputRepresentationValidationError = validate$1(untrustedConfig_BatchInvoiceSchedulerUpdateInput);
|
|
1700
|
+
if (referenceBatchInvoiceSchedulerUpdateInputRepresentationValidationError === null) {
|
|
1701
|
+
config.BatchInvoiceSchedulerUpdateInput = untrustedConfig_BatchInvoiceSchedulerUpdateInput;
|
|
1702
|
+
}
|
|
1703
|
+
return config;
|
|
1704
|
+
}
|
|
1705
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1706
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1707
|
+
return null;
|
|
1708
|
+
}
|
|
1709
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1710
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1711
|
+
}
|
|
1712
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1713
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1714
|
+
return null;
|
|
1715
|
+
}
|
|
1716
|
+
return config;
|
|
1717
|
+
}
|
|
1718
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1719
|
+
const resourceParams = createResourceParams(config);
|
|
1720
|
+
const request = createResourceRequest(resourceParams);
|
|
1721
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1722
|
+
.then((response) => {
|
|
1723
|
+
return luvio.handleSuccessResponse(() => {
|
|
1724
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1725
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1726
|
+
}, () => {
|
|
1727
|
+
const cache = new StoreKeyMap();
|
|
1728
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1729
|
+
return cache;
|
|
1730
|
+
});
|
|
1731
|
+
}, (response) => {
|
|
1732
|
+
deepFreeze(response);
|
|
1733
|
+
throw response;
|
|
1734
|
+
});
|
|
1735
|
+
}
|
|
1736
|
+
const updateInvoicesBatchSchedulerAdapterFactory = (luvio) => {
|
|
1737
|
+
return function updateInvoicesBatchScheduler(untrustedConfig) {
|
|
1738
|
+
const config = validateAdapterConfig(untrustedConfig, updateInvoicesBatchScheduler_ConfigPropertyNames);
|
|
1739
|
+
// Invalid or incomplete config
|
|
1740
|
+
if (config === null) {
|
|
1741
|
+
throw new Error('Invalid config for "updateInvoicesBatchScheduler"');
|
|
1742
|
+
}
|
|
1743
|
+
return buildNetworkSnapshot(luvio, config);
|
|
1744
|
+
};
|
|
1745
|
+
};
|
|
1746
|
+
|
|
1747
|
+
let batchInvoiceRunRecovery;
|
|
1748
|
+
let createInvoicesBatchScheduler;
|
|
1749
|
+
let createPaymentsBatchScheduler;
|
|
1750
|
+
let editInvoicesBatchScheduler;
|
|
1751
|
+
let postBatchDraftInvoices;
|
|
1752
|
+
let postBatchInvoiceDocGen;
|
|
1753
|
+
let postCronExecutionDates;
|
|
1754
|
+
let updateInvoicesBatchScheduler;
|
|
1755
|
+
// Imperative GET Adapters
|
|
1756
|
+
let postBatchDraftInvoices_imperative;
|
|
1757
|
+
const postBatchDraftInvoicesMetadata = {
|
|
1758
|
+
apiFamily: 'BillingBatch',
|
|
1759
|
+
name: 'postBatchDraftInvoices',
|
|
1760
|
+
ttl: 1000,
|
|
1761
|
+
};
|
|
1762
|
+
// Notify Update Available
|
|
1763
|
+
function bindExportsTo(luvio) {
|
|
1764
|
+
// LDS Adapters
|
|
1765
|
+
const postBatchDraftInvoices_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'postBatchDraftInvoices', postBatchDraftInvoicesAdapterFactory), postBatchDraftInvoicesMetadata);
|
|
1766
|
+
function unwrapSnapshotData(factory) {
|
|
1767
|
+
const adapter = factory(luvio);
|
|
1768
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
1769
|
+
}
|
|
1770
|
+
return {
|
|
1771
|
+
batchInvoiceRunRecovery: unwrapSnapshotData(batchInvoiceRunRecoveryAdapterFactory),
|
|
1772
|
+
createInvoicesBatchScheduler: unwrapSnapshotData(createInvoicesBatchSchedulerAdapterFactory),
|
|
1773
|
+
createPaymentsBatchScheduler: unwrapSnapshotData(createPaymentsBatchSchedulerAdapterFactory),
|
|
1774
|
+
editInvoicesBatchScheduler: unwrapSnapshotData(editInvoicesBatchSchedulerAdapterFactory),
|
|
1775
|
+
postBatchDraftInvoices: createWireAdapterConstructor(luvio, postBatchDraftInvoices_ldsAdapter, postBatchDraftInvoicesMetadata),
|
|
1776
|
+
postBatchInvoiceDocGen: unwrapSnapshotData(postBatchInvoiceDocGenAdapterFactory),
|
|
1777
|
+
postCronExecutionDates: unwrapSnapshotData(postCronExecutionDatesAdapterFactory),
|
|
1778
|
+
updateInvoicesBatchScheduler: unwrapSnapshotData(updateInvoicesBatchSchedulerAdapterFactory),
|
|
1779
|
+
// Imperative GET Adapters
|
|
1780
|
+
postBatchDraftInvoices_imperative: createImperativeAdapter(luvio, postBatchDraftInvoices_ldsAdapter, postBatchDraftInvoicesMetadata),
|
|
1781
|
+
// Notify Update Availables
|
|
1782
|
+
};
|
|
1783
|
+
}
|
|
1784
|
+
withDefaultLuvio((luvio) => {
|
|
1785
|
+
({
|
|
1786
|
+
batchInvoiceRunRecovery,
|
|
1787
|
+
createInvoicesBatchScheduler,
|
|
1788
|
+
createPaymentsBatchScheduler,
|
|
1789
|
+
editInvoicesBatchScheduler,
|
|
1790
|
+
postBatchDraftInvoices,
|
|
1791
|
+
postBatchInvoiceDocGen,
|
|
1792
|
+
postCronExecutionDates,
|
|
1793
|
+
updateInvoicesBatchScheduler,
|
|
1794
|
+
postBatchDraftInvoices_imperative,
|
|
1795
|
+
} = bindExportsTo(luvio));
|
|
1796
|
+
});
|
|
1797
|
+
|
|
1798
|
+
export { batchInvoiceRunRecovery, createInvoicesBatchScheduler, createPaymentsBatchScheduler, editInvoicesBatchScheduler, postBatchDraftInvoices, postBatchDraftInvoices_imperative, postBatchInvoiceDocGen, postCronExecutionDates, updateInvoicesBatchScheduler };
|
|
1799
|
+
// version: 0.1.0-dev1-c978a7b010
|