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