@salesforce/lds-adapters-revenue-billing-batch 1.124.2 → 1.124.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/es2018/revenue-billing-batch.js +597 -597
- package/dist/{types → es/es2018/types}/src/generated/adapters/adapter-utils.d.ts +66 -66
- package/dist/{types → es/es2018/types}/src/generated/adapters/createInvoicesBatchScheduler.d.ts +15 -15
- package/dist/{types → es/es2018/types}/src/generated/adapters/createPaymentsBatchScheduler.d.ts +15 -15
- package/dist/{types → es/es2018/types}/src/generated/artifacts/main.d.ts +2 -2
- package/dist/{types → es/es2018/types}/src/generated/artifacts/sfdc.d.ts +3 -3
- package/dist/{types → es/es2018/types}/src/generated/resources/postCommerceInvoicingInvoiceSchedulers.d.ts +13 -13
- package/dist/{types → es/es2018/types}/src/generated/resources/postCommercePaymentsPaymentSchedulers.d.ts +13 -13
- package/dist/{types → es/es2018/types}/src/generated/types/BatchFilterCriteriaInputRepresentation.d.ts +35 -35
- package/dist/{types → es/es2018/types}/src/generated/types/BatchInvoiceSchedulerInputRepresentation.d.ts +30 -30
- package/dist/{types → es/es2018/types}/src/generated/types/BatchInvoiceSchedulerInputWrapperRepresentation.d.ts +29 -29
- package/dist/{types → es/es2018/types}/src/generated/types/BillingBatchSchedulerRepresentation.d.ts +29 -29
- package/dist/{types → es/es2018/types}/src/generated/types/InvoicesBatchSchedulerOutputRepresentation.d.ts +40 -40
- package/dist/{types → es/es2018/types}/src/generated/types/PaymentRunBatchFilterCriteriaInputRepresentation.d.ts +33 -33
- package/dist/{types → es/es2018/types}/src/generated/types/PaymentRunBatchFilterCriteriaInputRepresentations.d.ts +29 -29
- package/dist/{types → es/es2018/types}/src/generated/types/PaymentsBatchSchedulerInputRepresentation.d.ts +33 -33
- package/dist/{types → es/es2018/types}/src/generated/types/PaymentsBatchSchedulerInputWrapperRepresentation.d.ts +29 -29
- package/dist/{types → es/es2018/types}/src/generated/types/PaymentsBatchSchedulerOutputRepresentation.d.ts +40 -40
- package/dist/{types → es/es2018/types}/src/generated/types/ScheduleOptionsInputRepresentation.d.ts +47 -47
- package/dist/{types → es/es2018/types}/src/generated/types/ScheduleOptionsInputRepresentationForInvoice.d.ts +50 -50
- package/dist/{types → es/es2018/types}/src/generated/types/type-utils.d.ts +39 -39
- package/package.json +5 -5
- package/sfdc/index.d.ts +1 -1
- package/sfdc/index.js +616 -616
- package/dist/umd/es2018/revenue-billing-batch.js +0 -641
- package/dist/umd/es5/revenue-billing-batch.js +0 -648
|
@@ -1,648 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* For full license text, see the LICENSE.txt file
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
(function (global, factory) {
|
|
8
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
|
|
9
|
-
typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
|
|
10
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["revenueBilling-batch"] = {}, global.engine));
|
|
11
|
-
})(this, (function (exports, engine) { 'use strict';
|
|
12
|
-
|
|
13
|
-
var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
14
|
-
var ObjectKeys$1 = Object.keys;
|
|
15
|
-
var ArrayIsArray$1 = Array.isArray;
|
|
16
|
-
/**
|
|
17
|
-
* Validates an adapter config is well-formed.
|
|
18
|
-
* @param config The config to validate.
|
|
19
|
-
* @param adapter The adapter validation configuration.
|
|
20
|
-
* @param oneOf The keys the config must contain at least one of.
|
|
21
|
-
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
22
|
-
*/
|
|
23
|
-
function validateConfig(config, adapter, oneOf) {
|
|
24
|
-
var displayName = adapter.displayName;
|
|
25
|
-
var _a = adapter.parameters, required = _a.required, optional = _a.optional, unsupported = _a.unsupported;
|
|
26
|
-
if (config === undefined ||
|
|
27
|
-
required.every(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
|
|
28
|
-
throw new TypeError("adapter ".concat(displayName, " configuration must specify ").concat(required.sort().join(', ')));
|
|
29
|
-
}
|
|
30
|
-
if (oneOf && oneOf.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
|
|
31
|
-
throw new TypeError("adapter ".concat(displayName, " configuration must specify one of ").concat(oneOf.sort().join(', ')));
|
|
32
|
-
}
|
|
33
|
-
if (unsupported !== undefined &&
|
|
34
|
-
unsupported.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); })) {
|
|
35
|
-
throw new TypeError("adapter ".concat(displayName, " does not yet support ").concat(unsupported.sort().join(', ')));
|
|
36
|
-
}
|
|
37
|
-
var supported = required.concat(optional);
|
|
38
|
-
if (ObjectKeys$1(config).some(function (key) { return !supported.includes(key); })) {
|
|
39
|
-
throw new TypeError("adapter ".concat(displayName, " configuration supports only ").concat(supported.sort().join(', ')));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function untrustedIsObject(untrusted) {
|
|
43
|
-
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
44
|
-
}
|
|
45
|
-
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
46
|
-
return configPropertyNames.parameters.required.every(function (req) { return req in config; });
|
|
47
|
-
}
|
|
48
|
-
var keyPrefix = 'BillingBatch';
|
|
49
|
-
|
|
50
|
-
var ObjectFreeze = Object.freeze, ObjectKeys = Object.keys;
|
|
51
|
-
var ArrayIsArray = Array.isArray;
|
|
52
|
-
var JSONStringify = JSON.stringify;
|
|
53
|
-
function deepFreeze$3(value) {
|
|
54
|
-
// No need to freeze primitives
|
|
55
|
-
if (typeof value !== 'object' || value === null) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (ArrayIsArray(value)) {
|
|
59
|
-
for (var i = 0, len = value.length; i < len; i += 1) {
|
|
60
|
-
deepFreeze$3(value[i]);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
var keys = ObjectKeys(value);
|
|
65
|
-
for (var i = 0, len = keys.length; i < len; i += 1) {
|
|
66
|
-
deepFreeze$3(value[keys[i]]);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
ObjectFreeze(value);
|
|
70
|
-
}
|
|
71
|
-
function createLink(ref) {
|
|
72
|
-
return {
|
|
73
|
-
__ref: engine.serializeStructuredKey(ref),
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function validate$6(obj, path) {
|
|
78
|
-
if (path === void 0) { path = 'ScheduleOptionsInputRepresentation'; }
|
|
79
|
-
var v_error = (function () {
|
|
80
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
81
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
82
|
-
}
|
|
83
|
-
if (obj.endDate !== undefined) {
|
|
84
|
-
var obj_endDate = obj.endDate;
|
|
85
|
-
var path_endDate = path + '.endDate';
|
|
86
|
-
if (typeof obj_endDate !== 'string') {
|
|
87
|
-
return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
var obj_frequencyCadence = obj.frequencyCadence;
|
|
91
|
-
var path_frequencyCadence = path + '.frequencyCadence';
|
|
92
|
-
if (typeof obj_frequencyCadence !== 'string') {
|
|
93
|
-
return new TypeError('Expected "string" but received "' + typeof obj_frequencyCadence + '" (at "' + path_frequencyCadence + '")');
|
|
94
|
-
}
|
|
95
|
-
var obj_preferredTime = obj.preferredTime;
|
|
96
|
-
var path_preferredTime = path + '.preferredTime';
|
|
97
|
-
if (typeof obj_preferredTime !== 'string') {
|
|
98
|
-
return new TypeError('Expected "string" but received "' + typeof obj_preferredTime + '" (at "' + path_preferredTime + '")');
|
|
99
|
-
}
|
|
100
|
-
if (obj.recursEveryMonthOnDay !== undefined) {
|
|
101
|
-
var obj_recursEveryMonthOnDay = obj.recursEveryMonthOnDay;
|
|
102
|
-
var path_recursEveryMonthOnDay = path + '.recursEveryMonthOnDay';
|
|
103
|
-
if (typeof obj_recursEveryMonthOnDay !== 'string') {
|
|
104
|
-
return new TypeError('Expected "string" but received "' + typeof obj_recursEveryMonthOnDay + '" (at "' + path_recursEveryMonthOnDay + '")');
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
var obj_schedulerName = obj.schedulerName;
|
|
108
|
-
var path_schedulerName = path + '.schedulerName';
|
|
109
|
-
if (typeof obj_schedulerName !== 'string') {
|
|
110
|
-
return new TypeError('Expected "string" but received "' + typeof obj_schedulerName + '" (at "' + path_schedulerName + '")');
|
|
111
|
-
}
|
|
112
|
-
var obj_startDate = obj.startDate;
|
|
113
|
-
var path_startDate = path + '.startDate';
|
|
114
|
-
if (typeof obj_startDate !== 'string') {
|
|
115
|
-
return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
|
|
116
|
-
}
|
|
117
|
-
var obj_status = obj.status;
|
|
118
|
-
var path_status = path + '.status';
|
|
119
|
-
if (typeof obj_status !== 'string') {
|
|
120
|
-
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
121
|
-
}
|
|
122
|
-
})();
|
|
123
|
-
return v_error === undefined ? null : v_error;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function validate$5(obj, path) {
|
|
127
|
-
if (path === void 0) { path = 'PaymentsBatchSchedulerInputRepresentation'; }
|
|
128
|
-
var validateScheduleOptionsInputRepresentation_validateError = validate$6(obj, path);
|
|
129
|
-
if (validateScheduleOptionsInputRepresentation_validateError !== null) {
|
|
130
|
-
return validateScheduleOptionsInputRepresentation_validateError;
|
|
131
|
-
}
|
|
132
|
-
var v_error = (function () {
|
|
133
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
134
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
135
|
-
}
|
|
136
|
-
if (obj.criteriaMatchType !== undefined) {
|
|
137
|
-
var obj_criteriaMatchType = obj.criteriaMatchType;
|
|
138
|
-
var path_criteriaMatchType = path + '.criteriaMatchType';
|
|
139
|
-
if (typeof obj_criteriaMatchType !== 'string') {
|
|
140
|
-
return new TypeError('Expected "string" but received "' + typeof obj_criteriaMatchType + '" (at "' + path_criteriaMatchType + '")');
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (obj.filterCriteria !== undefined) {
|
|
144
|
-
var obj_filterCriteria = obj.filterCriteria;
|
|
145
|
-
var path_filterCriteria = path + '.filterCriteria';
|
|
146
|
-
if (!ArrayIsArray(obj_filterCriteria)) {
|
|
147
|
-
return new TypeError('Expected "array" but received "' + typeof obj_filterCriteria + '" (at "' + path_filterCriteria + '")');
|
|
148
|
-
}
|
|
149
|
-
for (var i = 0; i < obj_filterCriteria.length; i++) {
|
|
150
|
-
var obj_filterCriteria_item = obj_filterCriteria[i];
|
|
151
|
-
var path_filterCriteria_item = path_filterCriteria + '[' + i + ']';
|
|
152
|
-
if (typeof obj_filterCriteria_item !== 'object' || ArrayIsArray(obj_filterCriteria_item) || obj_filterCriteria_item === null) {
|
|
153
|
-
return new TypeError('Expected "object" but received "' + typeof obj_filterCriteria_item + '" (at "' + path_filterCriteria_item + '")');
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
})();
|
|
158
|
-
return v_error === undefined ? null : v_error;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
function validate$4(obj, path) {
|
|
162
|
-
if (path === void 0) { path = 'BillingBatchSchedulerRepresentation'; }
|
|
163
|
-
var v_error = (function () {
|
|
164
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
165
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
166
|
-
}
|
|
167
|
-
var obj_id = obj.id;
|
|
168
|
-
var path_id = path + '.id';
|
|
169
|
-
if (typeof obj_id !== 'string') {
|
|
170
|
-
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
171
|
-
}
|
|
172
|
-
})();
|
|
173
|
-
return v_error === undefined ? null : v_error;
|
|
174
|
-
}
|
|
175
|
-
function deepFreeze$2(input) {
|
|
176
|
-
ObjectFreeze(input);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
var TTL$1 = 1000;
|
|
180
|
-
var VERSION$1 = "eff71edc32270b9a1e6e1779cb811c3c";
|
|
181
|
-
function validate$3(obj, path) {
|
|
182
|
-
if (path === void 0) { path = 'PaymentsBatchSchedulerOutputRepresentation'; }
|
|
183
|
-
var v_error = (function () {
|
|
184
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
185
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
186
|
-
}
|
|
187
|
-
var obj_billingBatchScheduler = obj.billingBatchScheduler;
|
|
188
|
-
var path_billingBatchScheduler = path + '.billingBatchScheduler';
|
|
189
|
-
var referencepath_billingBatchSchedulerValidationError = validate$4(obj_billingBatchScheduler, path_billingBatchScheduler);
|
|
190
|
-
if (referencepath_billingBatchSchedulerValidationError !== null) {
|
|
191
|
-
var message = 'Object doesn\'t match BillingBatchSchedulerRepresentation (at "' + path_billingBatchScheduler + '")\n';
|
|
192
|
-
message += referencepath_billingBatchSchedulerValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
193
|
-
return new TypeError(message);
|
|
194
|
-
}
|
|
195
|
-
})();
|
|
196
|
-
return v_error === undefined ? null : v_error;
|
|
197
|
-
}
|
|
198
|
-
var RepresentationType$1 = 'PaymentsBatchSchedulerOutputRepresentation';
|
|
199
|
-
function keyBuilder$1(luvio, config) {
|
|
200
|
-
return keyPrefix + '::' + RepresentationType$1 + ':' + config.billingBatchSchedulerId;
|
|
201
|
-
}
|
|
202
|
-
function keyBuilderFromType$1(luvio, object) {
|
|
203
|
-
var keyParams = {
|
|
204
|
-
billingBatchSchedulerId: object.billingBatchScheduler.id
|
|
205
|
-
};
|
|
206
|
-
return keyBuilder$1(luvio, keyParams);
|
|
207
|
-
}
|
|
208
|
-
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
209
|
-
return input;
|
|
210
|
-
}
|
|
211
|
-
var select$3 = function PaymentsBatchSchedulerOutputRepresentationSelect() {
|
|
212
|
-
return {
|
|
213
|
-
kind: 'Fragment',
|
|
214
|
-
version: VERSION$1,
|
|
215
|
-
private: [],
|
|
216
|
-
opaque: true
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
function equals$1(existing, incoming) {
|
|
220
|
-
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
221
|
-
return false;
|
|
222
|
-
}
|
|
223
|
-
return true;
|
|
224
|
-
}
|
|
225
|
-
function deepFreeze$1(input) {
|
|
226
|
-
var input_billingBatchScheduler = input.billingBatchScheduler;
|
|
227
|
-
deepFreeze$2(input_billingBatchScheduler);
|
|
228
|
-
ObjectFreeze(input);
|
|
229
|
-
}
|
|
230
|
-
var ingest$1 = function PaymentsBatchSchedulerOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
231
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
232
|
-
var validateError = validate$3(input);
|
|
233
|
-
if (validateError !== null) {
|
|
234
|
-
throw validateError;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
var key = keyBuilderFromType$1(luvio, input);
|
|
238
|
-
var existingRecord = store.readEntry(key);
|
|
239
|
-
var ttlToUse = TTL$1;
|
|
240
|
-
var incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
241
|
-
fullPath: key,
|
|
242
|
-
parent: path.parent,
|
|
243
|
-
propertyName: path.propertyName,
|
|
244
|
-
ttl: ttlToUse
|
|
245
|
-
});
|
|
246
|
-
deepFreeze$1(input);
|
|
247
|
-
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
248
|
-
luvio.storePublish(key, incomingRecord);
|
|
249
|
-
}
|
|
250
|
-
{
|
|
251
|
-
var storeMetadataParams = {
|
|
252
|
-
ttl: ttlToUse,
|
|
253
|
-
namespace: "BillingBatch",
|
|
254
|
-
version: VERSION$1,
|
|
255
|
-
representationName: RepresentationType$1,
|
|
256
|
-
};
|
|
257
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
258
|
-
}
|
|
259
|
-
return createLink(key);
|
|
260
|
-
};
|
|
261
|
-
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
262
|
-
var rootKeySet = new engine.StoreKeyMap();
|
|
263
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
264
|
-
var rootKey = keyBuilderFromType$1(luvio, input);
|
|
265
|
-
rootKeySet.set(rootKey, {
|
|
266
|
-
namespace: keyPrefix,
|
|
267
|
-
representationName: RepresentationType$1,
|
|
268
|
-
mergeable: false
|
|
269
|
-
});
|
|
270
|
-
return rootKeySet;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
function select$2(luvio, params) {
|
|
274
|
-
return select$3();
|
|
275
|
-
}
|
|
276
|
-
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
277
|
-
return getTypeCacheKeys$1(luvio, response);
|
|
278
|
-
}
|
|
279
|
-
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
280
|
-
var body = response.body;
|
|
281
|
-
var key = keyBuilderFromType$1(luvio, body);
|
|
282
|
-
luvio.storeIngest(key, ingest$1, body);
|
|
283
|
-
var snapshot = luvio.storeLookup({
|
|
284
|
-
recordId: key,
|
|
285
|
-
node: select$2(),
|
|
286
|
-
variables: {},
|
|
287
|
-
});
|
|
288
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
289
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
290
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
return snapshot;
|
|
294
|
-
}
|
|
295
|
-
function createResourceRequest$1(config) {
|
|
296
|
-
var headers = {};
|
|
297
|
-
return {
|
|
298
|
-
baseUri: '/services/data/v58.0',
|
|
299
|
-
basePath: '/commerce/payments/payment-schedulers',
|
|
300
|
-
method: 'post',
|
|
301
|
-
body: config.body,
|
|
302
|
-
urlParams: {},
|
|
303
|
-
queryParams: {},
|
|
304
|
-
headers: headers,
|
|
305
|
-
priority: 'normal',
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
var createPaymentsBatchScheduler_ConfigPropertyNames = {
|
|
310
|
-
displayName: 'createPaymentsBatchScheduler',
|
|
311
|
-
parameters: {
|
|
312
|
-
required: ['PaymentsBatchSchedulerInput'],
|
|
313
|
-
optional: []
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
function createResourceParams$1(config) {
|
|
317
|
-
var resourceParams = {
|
|
318
|
-
body: {
|
|
319
|
-
PaymentsBatchSchedulerInput: config.PaymentsBatchSchedulerInput
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
return resourceParams;
|
|
323
|
-
}
|
|
324
|
-
function typeCheckConfig$1(untrustedConfig) {
|
|
325
|
-
var config = {};
|
|
326
|
-
var untrustedConfig_PaymentsBatchSchedulerInput = untrustedConfig.PaymentsBatchSchedulerInput;
|
|
327
|
-
var referencePaymentsBatchSchedulerInputRepresentationValidationError = validate$5(untrustedConfig_PaymentsBatchSchedulerInput);
|
|
328
|
-
if (referencePaymentsBatchSchedulerInputRepresentationValidationError === null) {
|
|
329
|
-
config.PaymentsBatchSchedulerInput = untrustedConfig_PaymentsBatchSchedulerInput;
|
|
330
|
-
}
|
|
331
|
-
return config;
|
|
332
|
-
}
|
|
333
|
-
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
334
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
335
|
-
return null;
|
|
336
|
-
}
|
|
337
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
338
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
339
|
-
}
|
|
340
|
-
var config = typeCheckConfig$1(untrustedConfig);
|
|
341
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
342
|
-
return null;
|
|
343
|
-
}
|
|
344
|
-
return config;
|
|
345
|
-
}
|
|
346
|
-
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
347
|
-
var resourceParams = createResourceParams$1(config);
|
|
348
|
-
var request = createResourceRequest$1(resourceParams);
|
|
349
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
350
|
-
.then(function (response) {
|
|
351
|
-
return luvio.handleSuccessResponse(function () {
|
|
352
|
-
var snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
353
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
354
|
-
}, function () { return getResponseCacheKeys$1(luvio, resourceParams, response.body); });
|
|
355
|
-
}, function (response) {
|
|
356
|
-
deepFreeze$3(response);
|
|
357
|
-
throw response;
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
var createPaymentsBatchSchedulerAdapterFactory = function (luvio) {
|
|
361
|
-
return function createPaymentsBatchScheduler(untrustedConfig) {
|
|
362
|
-
var config = validateAdapterConfig$1(untrustedConfig, createPaymentsBatchScheduler_ConfigPropertyNames);
|
|
363
|
-
// Invalid or incomplete config
|
|
364
|
-
if (config === null) {
|
|
365
|
-
throw new Error('Invalid config for "createPaymentsBatchScheduler"');
|
|
366
|
-
}
|
|
367
|
-
return buildNetworkSnapshot$1(luvio, config);
|
|
368
|
-
};
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
function validate$2(obj, path) {
|
|
372
|
-
if (path === void 0) { path = 'ScheduleOptionsInputRepresentationForInvoice'; }
|
|
373
|
-
var v_error = (function () {
|
|
374
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
375
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
376
|
-
}
|
|
377
|
-
if (obj.endDate !== undefined) {
|
|
378
|
-
var obj_endDate = obj.endDate;
|
|
379
|
-
var path_endDate = path + '.endDate';
|
|
380
|
-
if (typeof obj_endDate !== 'string') {
|
|
381
|
-
return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
var obj_frequencyCadence = obj.frequencyCadence;
|
|
385
|
-
var path_frequencyCadence = path + '.frequencyCadence';
|
|
386
|
-
if (typeof obj_frequencyCadence !== 'string') {
|
|
387
|
-
return new TypeError('Expected "string" but received "' + typeof obj_frequencyCadence + '" (at "' + path_frequencyCadence + '")');
|
|
388
|
-
}
|
|
389
|
-
var obj_frequencyCadenceOptions = obj.frequencyCadenceOptions;
|
|
390
|
-
var path_frequencyCadenceOptions = path + '.frequencyCadenceOptions';
|
|
391
|
-
if (typeof obj_frequencyCadenceOptions !== 'object' || ArrayIsArray(obj_frequencyCadenceOptions) || obj_frequencyCadenceOptions === null) {
|
|
392
|
-
return new TypeError('Expected "object" but received "' + typeof obj_frequencyCadenceOptions + '" (at "' + path_frequencyCadenceOptions + '")');
|
|
393
|
-
}
|
|
394
|
-
var obj_preferredTime = obj.preferredTime;
|
|
395
|
-
var path_preferredTime = path + '.preferredTime';
|
|
396
|
-
if (typeof obj_preferredTime !== 'string') {
|
|
397
|
-
return new TypeError('Expected "string" but received "' + typeof obj_preferredTime + '" (at "' + path_preferredTime + '")');
|
|
398
|
-
}
|
|
399
|
-
var obj_schedulerName = obj.schedulerName;
|
|
400
|
-
var path_schedulerName = path + '.schedulerName';
|
|
401
|
-
if (typeof obj_schedulerName !== 'string') {
|
|
402
|
-
return new TypeError('Expected "string" but received "' + typeof obj_schedulerName + '" (at "' + path_schedulerName + '")');
|
|
403
|
-
}
|
|
404
|
-
var obj_startDate = obj.startDate;
|
|
405
|
-
var path_startDate = path + '.startDate';
|
|
406
|
-
if (typeof obj_startDate !== 'string') {
|
|
407
|
-
return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
|
|
408
|
-
}
|
|
409
|
-
var obj_status = obj.status;
|
|
410
|
-
var path_status = path + '.status';
|
|
411
|
-
if (typeof obj_status !== 'string') {
|
|
412
|
-
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
413
|
-
}
|
|
414
|
-
var obj_timezone = obj.timezone;
|
|
415
|
-
var path_timezone = path + '.timezone';
|
|
416
|
-
if (typeof obj_timezone !== 'string') {
|
|
417
|
-
return new TypeError('Expected "string" but received "' + typeof obj_timezone + '" (at "' + path_timezone + '")');
|
|
418
|
-
}
|
|
419
|
-
})();
|
|
420
|
-
return v_error === undefined ? null : v_error;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
function validate$1(obj, path) {
|
|
424
|
-
if (path === void 0) { path = 'BatchInvoiceSchedulerInputRepresentation'; }
|
|
425
|
-
var validateScheduleOptionsInputRepresentationForInvoice_validateError = validate$2(obj, path);
|
|
426
|
-
if (validateScheduleOptionsInputRepresentationForInvoice_validateError !== null) {
|
|
427
|
-
return validateScheduleOptionsInputRepresentationForInvoice_validateError;
|
|
428
|
-
}
|
|
429
|
-
var v_error = (function () {
|
|
430
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
431
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
432
|
-
}
|
|
433
|
-
if (obj.filterCriteria !== undefined) {
|
|
434
|
-
var obj_filterCriteria = obj.filterCriteria;
|
|
435
|
-
var path_filterCriteria = path + '.filterCriteria';
|
|
436
|
-
if (!ArrayIsArray(obj_filterCriteria)) {
|
|
437
|
-
return new TypeError('Expected "array" but received "' + typeof obj_filterCriteria + '" (at "' + path_filterCriteria + '")');
|
|
438
|
-
}
|
|
439
|
-
for (var i = 0; i < obj_filterCriteria.length; i++) {
|
|
440
|
-
var obj_filterCriteria_item = obj_filterCriteria[i];
|
|
441
|
-
var path_filterCriteria_item = path_filterCriteria + '[' + i + ']';
|
|
442
|
-
if (typeof obj_filterCriteria_item !== 'object' || ArrayIsArray(obj_filterCriteria_item) || obj_filterCriteria_item === null) {
|
|
443
|
-
return new TypeError('Expected "object" but received "' + typeof obj_filterCriteria_item + '" (at "' + path_filterCriteria_item + '")');
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
})();
|
|
448
|
-
return v_error === undefined ? null : v_error;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
var TTL = 1000;
|
|
452
|
-
var VERSION = "15c358b0b4903143c526f63f4010b958";
|
|
453
|
-
function validate(obj, path) {
|
|
454
|
-
if (path === void 0) { path = 'InvoicesBatchSchedulerOutputRepresentation'; }
|
|
455
|
-
var v_error = (function () {
|
|
456
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
457
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
458
|
-
}
|
|
459
|
-
var obj_billingBatchScheduler = obj.billingBatchScheduler;
|
|
460
|
-
var path_billingBatchScheduler = path + '.billingBatchScheduler';
|
|
461
|
-
var referencepath_billingBatchSchedulerValidationError = validate$4(obj_billingBatchScheduler, path_billingBatchScheduler);
|
|
462
|
-
if (referencepath_billingBatchSchedulerValidationError !== null) {
|
|
463
|
-
var message = 'Object doesn\'t match BillingBatchSchedulerRepresentation (at "' + path_billingBatchScheduler + '")\n';
|
|
464
|
-
message += referencepath_billingBatchSchedulerValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
465
|
-
return new TypeError(message);
|
|
466
|
-
}
|
|
467
|
-
})();
|
|
468
|
-
return v_error === undefined ? null : v_error;
|
|
469
|
-
}
|
|
470
|
-
var RepresentationType = 'InvoicesBatchSchedulerOutputRepresentation';
|
|
471
|
-
function keyBuilder(luvio, config) {
|
|
472
|
-
return keyPrefix + '::' + RepresentationType + ':' + config.billingBatchSchedulerId;
|
|
473
|
-
}
|
|
474
|
-
function keyBuilderFromType(luvio, object) {
|
|
475
|
-
var keyParams = {
|
|
476
|
-
billingBatchSchedulerId: object.billingBatchScheduler.id
|
|
477
|
-
};
|
|
478
|
-
return keyBuilder(luvio, keyParams);
|
|
479
|
-
}
|
|
480
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
481
|
-
return input;
|
|
482
|
-
}
|
|
483
|
-
var select$1 = function InvoicesBatchSchedulerOutputRepresentationSelect() {
|
|
484
|
-
return {
|
|
485
|
-
kind: 'Fragment',
|
|
486
|
-
version: VERSION,
|
|
487
|
-
private: [],
|
|
488
|
-
opaque: true
|
|
489
|
-
};
|
|
490
|
-
};
|
|
491
|
-
function equals(existing, incoming) {
|
|
492
|
-
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
493
|
-
return false;
|
|
494
|
-
}
|
|
495
|
-
return true;
|
|
496
|
-
}
|
|
497
|
-
function deepFreeze(input) {
|
|
498
|
-
var input_billingBatchScheduler = input.billingBatchScheduler;
|
|
499
|
-
deepFreeze$2(input_billingBatchScheduler);
|
|
500
|
-
ObjectFreeze(input);
|
|
501
|
-
}
|
|
502
|
-
var ingest = function InvoicesBatchSchedulerOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
503
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
504
|
-
var validateError = validate(input);
|
|
505
|
-
if (validateError !== null) {
|
|
506
|
-
throw validateError;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
var key = keyBuilderFromType(luvio, input);
|
|
510
|
-
var existingRecord = store.readEntry(key);
|
|
511
|
-
var ttlToUse = TTL;
|
|
512
|
-
var incomingRecord = normalize(input, store.readEntry(key), {
|
|
513
|
-
fullPath: key,
|
|
514
|
-
parent: path.parent,
|
|
515
|
-
propertyName: path.propertyName,
|
|
516
|
-
ttl: ttlToUse
|
|
517
|
-
});
|
|
518
|
-
deepFreeze(input);
|
|
519
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
520
|
-
luvio.storePublish(key, incomingRecord);
|
|
521
|
-
}
|
|
522
|
-
{
|
|
523
|
-
var storeMetadataParams = {
|
|
524
|
-
ttl: ttlToUse,
|
|
525
|
-
namespace: "BillingBatch",
|
|
526
|
-
version: VERSION,
|
|
527
|
-
representationName: RepresentationType,
|
|
528
|
-
};
|
|
529
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
530
|
-
}
|
|
531
|
-
return createLink(key);
|
|
532
|
-
};
|
|
533
|
-
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
534
|
-
var rootKeySet = new engine.StoreKeyMap();
|
|
535
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
536
|
-
var rootKey = keyBuilderFromType(luvio, input);
|
|
537
|
-
rootKeySet.set(rootKey, {
|
|
538
|
-
namespace: keyPrefix,
|
|
539
|
-
representationName: RepresentationType,
|
|
540
|
-
mergeable: false
|
|
541
|
-
});
|
|
542
|
-
return rootKeySet;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
function select(luvio, params) {
|
|
546
|
-
return select$1();
|
|
547
|
-
}
|
|
548
|
-
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
549
|
-
return getTypeCacheKeys(luvio, response);
|
|
550
|
-
}
|
|
551
|
-
function ingestSuccess(luvio, resourceParams, response) {
|
|
552
|
-
var body = response.body;
|
|
553
|
-
var key = keyBuilderFromType(luvio, body);
|
|
554
|
-
luvio.storeIngest(key, ingest, body);
|
|
555
|
-
var snapshot = luvio.storeLookup({
|
|
556
|
-
recordId: key,
|
|
557
|
-
node: select(),
|
|
558
|
-
variables: {},
|
|
559
|
-
});
|
|
560
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
561
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
562
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
return snapshot;
|
|
566
|
-
}
|
|
567
|
-
function createResourceRequest(config) {
|
|
568
|
-
var headers = {};
|
|
569
|
-
return {
|
|
570
|
-
baseUri: '/services/data/v58.0',
|
|
571
|
-
basePath: '/commerce/invoicing/invoice-schedulers',
|
|
572
|
-
method: 'post',
|
|
573
|
-
body: config.body,
|
|
574
|
-
urlParams: {},
|
|
575
|
-
queryParams: {},
|
|
576
|
-
headers: headers,
|
|
577
|
-
priority: 'normal',
|
|
578
|
-
};
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
var createInvoicesBatchScheduler_ConfigPropertyNames = {
|
|
582
|
-
displayName: 'createInvoicesBatchScheduler',
|
|
583
|
-
parameters: {
|
|
584
|
-
required: ['BatchInvoiceSchedulerInput'],
|
|
585
|
-
optional: []
|
|
586
|
-
}
|
|
587
|
-
};
|
|
588
|
-
function createResourceParams(config) {
|
|
589
|
-
var resourceParams = {
|
|
590
|
-
body: {
|
|
591
|
-
BatchInvoiceSchedulerInput: config.BatchInvoiceSchedulerInput
|
|
592
|
-
}
|
|
593
|
-
};
|
|
594
|
-
return resourceParams;
|
|
595
|
-
}
|
|
596
|
-
function typeCheckConfig(untrustedConfig) {
|
|
597
|
-
var config = {};
|
|
598
|
-
var untrustedConfig_BatchInvoiceSchedulerInput = untrustedConfig.BatchInvoiceSchedulerInput;
|
|
599
|
-
var referenceBatchInvoiceSchedulerInputRepresentationValidationError = validate$1(untrustedConfig_BatchInvoiceSchedulerInput);
|
|
600
|
-
if (referenceBatchInvoiceSchedulerInputRepresentationValidationError === null) {
|
|
601
|
-
config.BatchInvoiceSchedulerInput = untrustedConfig_BatchInvoiceSchedulerInput;
|
|
602
|
-
}
|
|
603
|
-
return config;
|
|
604
|
-
}
|
|
605
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
606
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
607
|
-
return null;
|
|
608
|
-
}
|
|
609
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
610
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
611
|
-
}
|
|
612
|
-
var config = typeCheckConfig(untrustedConfig);
|
|
613
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
614
|
-
return null;
|
|
615
|
-
}
|
|
616
|
-
return config;
|
|
617
|
-
}
|
|
618
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
619
|
-
var resourceParams = createResourceParams(config);
|
|
620
|
-
var request = createResourceRequest(resourceParams);
|
|
621
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
622
|
-
.then(function (response) {
|
|
623
|
-
return luvio.handleSuccessResponse(function () {
|
|
624
|
-
var snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
625
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
626
|
-
}, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
|
|
627
|
-
}, function (response) {
|
|
628
|
-
deepFreeze$3(response);
|
|
629
|
-
throw response;
|
|
630
|
-
});
|
|
631
|
-
}
|
|
632
|
-
var createInvoicesBatchSchedulerAdapterFactory = function (luvio) {
|
|
633
|
-
return function createInvoicesBatchScheduler(untrustedConfig) {
|
|
634
|
-
var config = validateAdapterConfig(untrustedConfig, createInvoicesBatchScheduler_ConfigPropertyNames);
|
|
635
|
-
// Invalid or incomplete config
|
|
636
|
-
if (config === null) {
|
|
637
|
-
throw new Error('Invalid config for "createInvoicesBatchScheduler"');
|
|
638
|
-
}
|
|
639
|
-
return buildNetworkSnapshot(luvio, config);
|
|
640
|
-
};
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
exports.createInvoicesBatchSchedulerAdapterFactory = createInvoicesBatchSchedulerAdapterFactory;
|
|
644
|
-
exports.createPaymentsBatchSchedulerAdapterFactory = createPaymentsBatchSchedulerAdapterFactory;
|
|
645
|
-
|
|
646
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
647
|
-
|
|
648
|
-
}));
|