@salesforce/lds-adapters-revenue-sales-transaction-contexts 1.303.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/revenue-sales-transaction-contexts.js +861 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/createRampDeal.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/adapters/deleteRampDeal.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/adapters/updateRampDeal.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/adapters/viewRampDeal.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +4 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +7 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectRevenueManagementSalesTransactionContextsActionsRampDealViewByResourceId.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectRevenueManagementSalesTransactionContextsActionsRampDealCreateByResourceId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectRevenueManagementSalesTransactionContextsActionsRampDealDeleteByResourceId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectRevenueManagementSalesTransactionContextsActionsRampDealUpdateByResourceId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/ContextNodeInputRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/CreateRampDealInputRepresentation.d.ts +49 -0
- package/dist/es/es2018/types/src/generated/types/CreateRampDealInputWrapperRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/DeleteRampDealInputRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/DeleteRampDealInputWrapperRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/ExecutionSettingsInputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/RampDealServiceErrorResponseRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/RampDealServiceOutputRepresentation.d.ts +52 -0
- package/dist/es/es2018/types/src/generated/types/UpdateRampDealInputRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/UpdateRampDealInputWrapperRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +67 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +956 -0
- package/src/raml/api.raml +251 -0
- package/src/raml/luvio.raml +33 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,956 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$4, typeCheckConfig as typeCheckConfig$4, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
21
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
22
|
+
/**
|
|
23
|
+
* Validates an adapter config is well-formed.
|
|
24
|
+
* @param config The config to validate.
|
|
25
|
+
* @param adapter The adapter validation configuration.
|
|
26
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
27
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
28
|
+
*/
|
|
29
|
+
function validateConfig(config, adapter, oneOf) {
|
|
30
|
+
const { displayName } = adapter;
|
|
31
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
32
|
+
if (config === undefined ||
|
|
33
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
34
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
37
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
38
|
+
}
|
|
39
|
+
if (unsupported !== undefined &&
|
|
40
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
41
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
const supported = required.concat(optional);
|
|
44
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
45
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function untrustedIsObject(untrusted) {
|
|
49
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
50
|
+
}
|
|
51
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
52
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
53
|
+
}
|
|
54
|
+
const snapshotRefreshOptions = {
|
|
55
|
+
overrides: {
|
|
56
|
+
headers: {
|
|
57
|
+
'Cache-Control': 'no-cache',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
62
|
+
return {
|
|
63
|
+
name,
|
|
64
|
+
required,
|
|
65
|
+
resourceType,
|
|
66
|
+
typeCheckShape,
|
|
67
|
+
isArrayShape,
|
|
68
|
+
coerceFn,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
72
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
73
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
74
|
+
return {
|
|
75
|
+
displayName,
|
|
76
|
+
parameters: {
|
|
77
|
+
required,
|
|
78
|
+
optional,
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const keyPrefix = 'sales-transaction-contexts';
|
|
83
|
+
|
|
84
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
85
|
+
const { isArray: ArrayIsArray } = Array;
|
|
86
|
+
const { stringify: JSONStringify } = JSON;
|
|
87
|
+
function equalsArray(a, b, equalsItem) {
|
|
88
|
+
const aLength = a.length;
|
|
89
|
+
const bLength = b.length;
|
|
90
|
+
if (aLength !== bLength) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
for (let i = 0; i < aLength; i++) {
|
|
94
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
function equalsObject(a, b, equalsProp) {
|
|
101
|
+
const aKeys = ObjectKeys(a).sort();
|
|
102
|
+
const bKeys = ObjectKeys(b).sort();
|
|
103
|
+
const aKeysLength = aKeys.length;
|
|
104
|
+
const bKeysLength = bKeys.length;
|
|
105
|
+
if (aKeysLength !== bKeysLength) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
109
|
+
const key = aKeys[i];
|
|
110
|
+
if (key !== bKeys[i]) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (equalsProp(a[key], b[key]) === false) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
function createLink(ref) {
|
|
120
|
+
return {
|
|
121
|
+
__ref: serializeStructuredKey(ref),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function validate$4(obj, path = 'CreateRampDealInputRepresentation') {
|
|
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
|
+
const obj_executionSettings = obj.executionSettings;
|
|
131
|
+
const path_executionSettings = path + '.executionSettings';
|
|
132
|
+
if (typeof obj_executionSettings !== 'object' || ArrayIsArray(obj_executionSettings) || obj_executionSettings === null) {
|
|
133
|
+
return new TypeError('Expected "object" but received "' + typeof obj_executionSettings + '" (at "' + path_executionSettings + '")');
|
|
134
|
+
}
|
|
135
|
+
const obj_segmentType = obj.segmentType;
|
|
136
|
+
const path_segmentType = path + '.segmentType';
|
|
137
|
+
if (typeof obj_segmentType !== 'string') {
|
|
138
|
+
return new TypeError('Expected "string" but received "' + typeof obj_segmentType + '" (at "' + path_segmentType + '")');
|
|
139
|
+
}
|
|
140
|
+
const obj_subscriptionTerm = obj.subscriptionTerm;
|
|
141
|
+
const path_subscriptionTerm = path + '.subscriptionTerm';
|
|
142
|
+
if (typeof obj_subscriptionTerm !== 'number' || (typeof obj_subscriptionTerm === 'number' && Math.floor(obj_subscriptionTerm) !== obj_subscriptionTerm)) {
|
|
143
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_subscriptionTerm + '" (at "' + path_subscriptionTerm + '")');
|
|
144
|
+
}
|
|
145
|
+
const obj_subscriptionTermUnit = obj.subscriptionTermUnit;
|
|
146
|
+
const path_subscriptionTermUnit = path + '.subscriptionTermUnit';
|
|
147
|
+
if (typeof obj_subscriptionTermUnit !== 'string') {
|
|
148
|
+
return new TypeError('Expected "string" but received "' + typeof obj_subscriptionTermUnit + '" (at "' + path_subscriptionTermUnit + '")');
|
|
149
|
+
}
|
|
150
|
+
const obj_transactionId = obj.transactionId;
|
|
151
|
+
const path_transactionId = path + '.transactionId';
|
|
152
|
+
if (typeof obj_transactionId !== 'string') {
|
|
153
|
+
return new TypeError('Expected "string" but received "' + typeof obj_transactionId + '" (at "' + path_transactionId + '")');
|
|
154
|
+
}
|
|
155
|
+
const obj_transactionLineId = obj.transactionLineId;
|
|
156
|
+
const path_transactionLineId = path + '.transactionLineId';
|
|
157
|
+
if (typeof obj_transactionLineId !== 'string') {
|
|
158
|
+
return new TypeError('Expected "string" but received "' + typeof obj_transactionLineId + '" (at "' + path_transactionLineId + '")');
|
|
159
|
+
}
|
|
160
|
+
const obj_trialTerm = obj.trialTerm;
|
|
161
|
+
const path_trialTerm = path + '.trialTerm';
|
|
162
|
+
if (typeof obj_trialTerm !== 'number' || (typeof obj_trialTerm === 'number' && Math.floor(obj_trialTerm) !== obj_trialTerm)) {
|
|
163
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_trialTerm + '" (at "' + path_trialTerm + '")');
|
|
164
|
+
}
|
|
165
|
+
const obj_trialTermUnit = obj.trialTermUnit;
|
|
166
|
+
const path_trialTermUnit = path + '.trialTermUnit';
|
|
167
|
+
if (typeof obj_trialTermUnit !== 'string') {
|
|
168
|
+
return new TypeError('Expected "string" but received "' + typeof obj_trialTermUnit + '" (at "' + path_trialTermUnit + '")');
|
|
169
|
+
}
|
|
170
|
+
})();
|
|
171
|
+
return v_error === undefined ? null : v_error;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const VERSION$1 = "a0c4d1b3fd4cdd35e2f33ce19475d010";
|
|
175
|
+
function validate$3(obj, path = 'RampDealServiceErrorResponseRepresentation') {
|
|
176
|
+
const v_error = (() => {
|
|
177
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
178
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
179
|
+
}
|
|
180
|
+
const obj_errorCode = obj.errorCode;
|
|
181
|
+
const path_errorCode = path + '.errorCode';
|
|
182
|
+
if (typeof obj_errorCode !== 'string') {
|
|
183
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
|
|
184
|
+
}
|
|
185
|
+
const obj_message = obj.message;
|
|
186
|
+
const path_message = path + '.message';
|
|
187
|
+
if (typeof obj_message !== 'string') {
|
|
188
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
189
|
+
}
|
|
190
|
+
})();
|
|
191
|
+
return v_error === undefined ? null : v_error;
|
|
192
|
+
}
|
|
193
|
+
const select$5 = function RampDealServiceErrorResponseRepresentationSelect() {
|
|
194
|
+
return {
|
|
195
|
+
kind: 'Fragment',
|
|
196
|
+
version: VERSION$1,
|
|
197
|
+
private: [],
|
|
198
|
+
selections: [
|
|
199
|
+
{
|
|
200
|
+
name: 'errorCode',
|
|
201
|
+
kind: 'Scalar'
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'message',
|
|
205
|
+
kind: 'Scalar'
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
function equals$1(existing, incoming) {
|
|
211
|
+
const existing_errorCode = existing.errorCode;
|
|
212
|
+
const incoming_errorCode = incoming.errorCode;
|
|
213
|
+
if (!(existing_errorCode === incoming_errorCode)) {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
const existing_message = existing.message;
|
|
217
|
+
const incoming_message = incoming.message;
|
|
218
|
+
if (!(existing_message === incoming_message)) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const TTL = 1000;
|
|
225
|
+
const VERSION = "416cf27851f4dd8b8185076dd39a72bd";
|
|
226
|
+
function validate$2(obj, path = 'RampDealServiceOutputRepresentation') {
|
|
227
|
+
const v_error = (() => {
|
|
228
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
229
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
230
|
+
}
|
|
231
|
+
const obj_errors = obj.errors;
|
|
232
|
+
const path_errors = path + '.errors';
|
|
233
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
234
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
235
|
+
}
|
|
236
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
237
|
+
const obj_errors_item = obj_errors[i];
|
|
238
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
239
|
+
const referencepath_errors_itemValidationError = validate$3(obj_errors_item, path_errors_item);
|
|
240
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
241
|
+
let message = 'Object doesn\'t match RampDealServiceErrorResponseRepresentation (at "' + path_errors_item + '")\n';
|
|
242
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
243
|
+
return new TypeError(message);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
const obj_salesTransactionContext = obj.salesTransactionContext;
|
|
247
|
+
const path_salesTransactionContext = path + '.salesTransactionContext';
|
|
248
|
+
if (typeof obj_salesTransactionContext !== 'object' || ArrayIsArray(obj_salesTransactionContext) || obj_salesTransactionContext === null) {
|
|
249
|
+
return new TypeError('Expected "object" but received "' + typeof obj_salesTransactionContext + '" (at "' + path_salesTransactionContext + '")');
|
|
250
|
+
}
|
|
251
|
+
const obj_salesTransactionContext_keys = ObjectKeys(obj_salesTransactionContext);
|
|
252
|
+
for (let i = 0; i < obj_salesTransactionContext_keys.length; i++) {
|
|
253
|
+
const key = obj_salesTransactionContext_keys[i];
|
|
254
|
+
const obj_salesTransactionContext_prop = obj_salesTransactionContext[key];
|
|
255
|
+
const path_salesTransactionContext_prop = path_salesTransactionContext + '["' + key + '"]';
|
|
256
|
+
if (obj_salesTransactionContext_prop === undefined) {
|
|
257
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_salesTransactionContext_prop + '" (at "' + path_salesTransactionContext_prop + '")');
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
const obj_success = obj.success;
|
|
261
|
+
const path_success = path + '.success';
|
|
262
|
+
if (typeof obj_success !== 'boolean') {
|
|
263
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
264
|
+
}
|
|
265
|
+
const obj_transactionContextId = obj.transactionContextId;
|
|
266
|
+
const path_transactionContextId = path + '.transactionContextId';
|
|
267
|
+
if (typeof obj_transactionContextId !== 'string') {
|
|
268
|
+
return new TypeError('Expected "string" but received "' + typeof obj_transactionContextId + '" (at "' + path_transactionContextId + '")');
|
|
269
|
+
}
|
|
270
|
+
})();
|
|
271
|
+
return v_error === undefined ? null : v_error;
|
|
272
|
+
}
|
|
273
|
+
const RepresentationType = 'RampDealServiceOutputRepresentation';
|
|
274
|
+
function keyBuilder$2(luvio, config) {
|
|
275
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.transactionContextId;
|
|
276
|
+
}
|
|
277
|
+
function keyBuilderFromType(luvio, object) {
|
|
278
|
+
const keyParams = {
|
|
279
|
+
transactionContextId: object.transactionContextId
|
|
280
|
+
};
|
|
281
|
+
return keyBuilder$2(luvio, keyParams);
|
|
282
|
+
}
|
|
283
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
284
|
+
return input;
|
|
285
|
+
}
|
|
286
|
+
const select$4 = function RampDealServiceOutputRepresentationSelect() {
|
|
287
|
+
const { selections: RampDealServiceErrorResponseRepresentation__selections, opaque: RampDealServiceErrorResponseRepresentation__opaque, } = select$5();
|
|
288
|
+
return {
|
|
289
|
+
kind: 'Fragment',
|
|
290
|
+
version: VERSION,
|
|
291
|
+
private: [],
|
|
292
|
+
selections: [
|
|
293
|
+
{
|
|
294
|
+
name: 'errors',
|
|
295
|
+
kind: 'Object',
|
|
296
|
+
plural: true,
|
|
297
|
+
selections: RampDealServiceErrorResponseRepresentation__selections
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'salesTransactionContext',
|
|
301
|
+
kind: 'Object',
|
|
302
|
+
// any
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
name: 'success',
|
|
306
|
+
kind: 'Scalar'
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'transactionContextId',
|
|
310
|
+
kind: 'Scalar'
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
function equals(existing, incoming) {
|
|
316
|
+
const existing_success = existing.success;
|
|
317
|
+
const incoming_success = incoming.success;
|
|
318
|
+
if (!(existing_success === incoming_success)) {
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
const existing_transactionContextId = existing.transactionContextId;
|
|
322
|
+
const incoming_transactionContextId = incoming.transactionContextId;
|
|
323
|
+
if (!(existing_transactionContextId === incoming_transactionContextId)) {
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
const existing_errors = existing.errors;
|
|
327
|
+
const incoming_errors = incoming.errors;
|
|
328
|
+
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
329
|
+
if (!(equals$1(existing_errors_item, incoming_errors_item))) {
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
if (equals_errors_items === false) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
const existing_salesTransactionContext = existing.salesTransactionContext;
|
|
337
|
+
const incoming_salesTransactionContext = incoming.salesTransactionContext;
|
|
338
|
+
const equals_salesTransactionContext_props = equalsObject(existing_salesTransactionContext, incoming_salesTransactionContext, (existing_salesTransactionContext_prop, incoming_salesTransactionContext_prop) => {
|
|
339
|
+
if (JSONStringify(incoming_salesTransactionContext_prop) !== JSONStringify(existing_salesTransactionContext_prop)) {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
if (equals_salesTransactionContext_props === false) {
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
const ingest = function RampDealServiceOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
349
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
350
|
+
const validateError = validate$2(input);
|
|
351
|
+
if (validateError !== null) {
|
|
352
|
+
throw validateError;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
const key = keyBuilderFromType(luvio, input);
|
|
356
|
+
const ttlToUse = TTL;
|
|
357
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "sales-transaction-contexts", VERSION, RepresentationType, equals);
|
|
358
|
+
return createLink(key);
|
|
359
|
+
};
|
|
360
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
361
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
362
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
363
|
+
rootKeySet.set(rootKey, {
|
|
364
|
+
namespace: keyPrefix,
|
|
365
|
+
representationName: RepresentationType,
|
|
366
|
+
mergeable: false
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function select$3(luvio, params) {
|
|
371
|
+
return select$4();
|
|
372
|
+
}
|
|
373
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
374
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
375
|
+
}
|
|
376
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
377
|
+
const { body } = response;
|
|
378
|
+
const key = keyBuilderFromType(luvio, body);
|
|
379
|
+
luvio.storeIngest(key, ingest, body);
|
|
380
|
+
const snapshot = luvio.storeLookup({
|
|
381
|
+
recordId: key,
|
|
382
|
+
node: select$3(),
|
|
383
|
+
variables: {},
|
|
384
|
+
});
|
|
385
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
386
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
387
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
deepFreeze(snapshot.data);
|
|
391
|
+
return snapshot;
|
|
392
|
+
}
|
|
393
|
+
function createResourceRequest$3(config) {
|
|
394
|
+
const headers = {};
|
|
395
|
+
return {
|
|
396
|
+
baseUri: '/services/data/v62.0',
|
|
397
|
+
basePath: '/connect/revenue-management/sales-transaction-contexts/' + config.urlParams.resourceId + '/actions/ramp-deal-create',
|
|
398
|
+
method: 'post',
|
|
399
|
+
body: config.body,
|
|
400
|
+
urlParams: config.urlParams,
|
|
401
|
+
queryParams: {},
|
|
402
|
+
headers,
|
|
403
|
+
priority: 'normal',
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const adapterName$3 = 'createRampDeal';
|
|
408
|
+
const createRampDeal_ConfigPropertyMetadata = [
|
|
409
|
+
generateParamConfigMetadata('resourceId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
410
|
+
generateParamConfigMetadata('createRampDealInputParam', true, 2 /* Body */, 4 /* Unsupported */),
|
|
411
|
+
];
|
|
412
|
+
const createRampDeal_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createRampDeal_ConfigPropertyMetadata);
|
|
413
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(createRampDeal_ConfigPropertyMetadata);
|
|
414
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
415
|
+
const config = {};
|
|
416
|
+
typeCheckConfig$4(untrustedConfig, config, createRampDeal_ConfigPropertyMetadata);
|
|
417
|
+
const untrustedConfig_createRampDealInputParam = untrustedConfig.createRampDealInputParam;
|
|
418
|
+
const referenceCreateRampDealInputRepresentationValidationError = validate$4(untrustedConfig_createRampDealInputParam);
|
|
419
|
+
if (referenceCreateRampDealInputRepresentationValidationError === null) {
|
|
420
|
+
config.createRampDealInputParam = untrustedConfig_createRampDealInputParam;
|
|
421
|
+
}
|
|
422
|
+
return config;
|
|
423
|
+
}
|
|
424
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
425
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
426
|
+
return null;
|
|
427
|
+
}
|
|
428
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
429
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
430
|
+
}
|
|
431
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
432
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
433
|
+
return null;
|
|
434
|
+
}
|
|
435
|
+
return config;
|
|
436
|
+
}
|
|
437
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
438
|
+
const resourceParams = createResourceParams$3(config);
|
|
439
|
+
const request = createResourceRequest$3(resourceParams);
|
|
440
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
441
|
+
.then((response) => {
|
|
442
|
+
return luvio.handleSuccessResponse(() => {
|
|
443
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
444
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
445
|
+
}, () => {
|
|
446
|
+
const cache = new StoreKeyMap();
|
|
447
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
448
|
+
return cache;
|
|
449
|
+
});
|
|
450
|
+
}, (response) => {
|
|
451
|
+
deepFreeze(response);
|
|
452
|
+
throw response;
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
const createRampDealAdapterFactory = (luvio) => {
|
|
456
|
+
return function createRampDeal(untrustedConfig) {
|
|
457
|
+
const config = validateAdapterConfig$3(untrustedConfig, createRampDeal_ConfigPropertyNames);
|
|
458
|
+
// Invalid or incomplete config
|
|
459
|
+
if (config === null) {
|
|
460
|
+
throw new Error('Invalid config for "createRampDeal"');
|
|
461
|
+
}
|
|
462
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
function validate$1(obj, path = 'DeleteRampDealInputRepresentation') {
|
|
467
|
+
const v_error = (() => {
|
|
468
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
469
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
470
|
+
}
|
|
471
|
+
const obj_rampDealIds = obj.rampDealIds;
|
|
472
|
+
const path_rampDealIds = path + '.rampDealIds';
|
|
473
|
+
if (!ArrayIsArray(obj_rampDealIds)) {
|
|
474
|
+
return new TypeError('Expected "array" but received "' + typeof obj_rampDealIds + '" (at "' + path_rampDealIds + '")');
|
|
475
|
+
}
|
|
476
|
+
for (let i = 0; i < obj_rampDealIds.length; i++) {
|
|
477
|
+
const obj_rampDealIds_item = obj_rampDealIds[i];
|
|
478
|
+
const path_rampDealIds_item = path_rampDealIds + '[' + i + ']';
|
|
479
|
+
if (typeof obj_rampDealIds_item !== 'string') {
|
|
480
|
+
return new TypeError('Expected "string" but received "' + typeof obj_rampDealIds_item + '" (at "' + path_rampDealIds_item + '")');
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
})();
|
|
484
|
+
return v_error === undefined ? null : v_error;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function select$2(luvio, params) {
|
|
488
|
+
return select$4();
|
|
489
|
+
}
|
|
490
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
491
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
492
|
+
}
|
|
493
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
494
|
+
const { body } = response;
|
|
495
|
+
const key = keyBuilderFromType(luvio, body);
|
|
496
|
+
luvio.storeIngest(key, ingest, body);
|
|
497
|
+
const snapshot = luvio.storeLookup({
|
|
498
|
+
recordId: key,
|
|
499
|
+
node: select$2(),
|
|
500
|
+
variables: {},
|
|
501
|
+
});
|
|
502
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
503
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
504
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
deepFreeze(snapshot.data);
|
|
508
|
+
return snapshot;
|
|
509
|
+
}
|
|
510
|
+
function createResourceRequest$2(config) {
|
|
511
|
+
const headers = {};
|
|
512
|
+
return {
|
|
513
|
+
baseUri: '/services/data/v62.0',
|
|
514
|
+
basePath: '/connect/revenue-management/sales-transaction-contexts/' + config.urlParams.resourceId + '/actions/ramp-deal-delete',
|
|
515
|
+
method: 'post',
|
|
516
|
+
body: config.body,
|
|
517
|
+
urlParams: config.urlParams,
|
|
518
|
+
queryParams: {},
|
|
519
|
+
headers,
|
|
520
|
+
priority: 'normal',
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const adapterName$2 = 'deleteRampDeal';
|
|
525
|
+
const deleteRampDeal_ConfigPropertyMetadata = [
|
|
526
|
+
generateParamConfigMetadata('resourceId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
527
|
+
generateParamConfigMetadata('deleteRampDealInputParam', true, 2 /* Body */, 4 /* Unsupported */),
|
|
528
|
+
];
|
|
529
|
+
const deleteRampDeal_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, deleteRampDeal_ConfigPropertyMetadata);
|
|
530
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(deleteRampDeal_ConfigPropertyMetadata);
|
|
531
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
532
|
+
const config = {};
|
|
533
|
+
typeCheckConfig$4(untrustedConfig, config, deleteRampDeal_ConfigPropertyMetadata);
|
|
534
|
+
const untrustedConfig_deleteRampDealInputParam = untrustedConfig.deleteRampDealInputParam;
|
|
535
|
+
const referenceDeleteRampDealInputRepresentationValidationError = validate$1(untrustedConfig_deleteRampDealInputParam);
|
|
536
|
+
if (referenceDeleteRampDealInputRepresentationValidationError === null) {
|
|
537
|
+
config.deleteRampDealInputParam = untrustedConfig_deleteRampDealInputParam;
|
|
538
|
+
}
|
|
539
|
+
return config;
|
|
540
|
+
}
|
|
541
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
542
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
543
|
+
return null;
|
|
544
|
+
}
|
|
545
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
546
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
547
|
+
}
|
|
548
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
549
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
550
|
+
return null;
|
|
551
|
+
}
|
|
552
|
+
return config;
|
|
553
|
+
}
|
|
554
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
555
|
+
const resourceParams = createResourceParams$2(config);
|
|
556
|
+
const request = createResourceRequest$2(resourceParams);
|
|
557
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
558
|
+
.then((response) => {
|
|
559
|
+
return luvio.handleSuccessResponse(() => {
|
|
560
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
561
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
562
|
+
}, () => {
|
|
563
|
+
const cache = new StoreKeyMap();
|
|
564
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
565
|
+
return cache;
|
|
566
|
+
});
|
|
567
|
+
}, (response) => {
|
|
568
|
+
deepFreeze(response);
|
|
569
|
+
throw response;
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
const deleteRampDealAdapterFactory = (luvio) => {
|
|
573
|
+
return function deleteRampDeal(untrustedConfig) {
|
|
574
|
+
const config = validateAdapterConfig$2(untrustedConfig, deleteRampDeal_ConfigPropertyNames);
|
|
575
|
+
// Invalid or incomplete config
|
|
576
|
+
if (config === null) {
|
|
577
|
+
throw new Error('Invalid config for "deleteRampDeal"');
|
|
578
|
+
}
|
|
579
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
function validate(obj, path = 'UpdateRampDealInputRepresentation') {
|
|
584
|
+
const v_error = (() => {
|
|
585
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
586
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
587
|
+
}
|
|
588
|
+
const obj_addedNodes = obj.addedNodes;
|
|
589
|
+
const path_addedNodes = path + '.addedNodes';
|
|
590
|
+
if (!ArrayIsArray(obj_addedNodes)) {
|
|
591
|
+
return new TypeError('Expected "array" but received "' + typeof obj_addedNodes + '" (at "' + path_addedNodes + '")');
|
|
592
|
+
}
|
|
593
|
+
for (let i = 0; i < obj_addedNodes.length; i++) {
|
|
594
|
+
const obj_addedNodes_item = obj_addedNodes[i];
|
|
595
|
+
const path_addedNodes_item = path_addedNodes + '[' + i + ']';
|
|
596
|
+
if (typeof obj_addedNodes_item !== 'object' || ArrayIsArray(obj_addedNodes_item) || obj_addedNodes_item === null) {
|
|
597
|
+
return new TypeError('Expected "object" but received "' + typeof obj_addedNodes_item + '" (at "' + path_addedNodes_item + '")');
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
const obj_deletedNodes = obj.deletedNodes;
|
|
601
|
+
const path_deletedNodes = path + '.deletedNodes';
|
|
602
|
+
if (!ArrayIsArray(obj_deletedNodes)) {
|
|
603
|
+
return new TypeError('Expected "array" but received "' + typeof obj_deletedNodes + '" (at "' + path_deletedNodes + '")');
|
|
604
|
+
}
|
|
605
|
+
for (let i = 0; i < obj_deletedNodes.length; i++) {
|
|
606
|
+
const obj_deletedNodes_item = obj_deletedNodes[i];
|
|
607
|
+
const path_deletedNodes_item = path_deletedNodes + '[' + i + ']';
|
|
608
|
+
if (typeof obj_deletedNodes_item !== 'object' || ArrayIsArray(obj_deletedNodes_item) || obj_deletedNodes_item === null) {
|
|
609
|
+
return new TypeError('Expected "object" but received "' + typeof obj_deletedNodes_item + '" (at "' + path_deletedNodes_item + '")');
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
const obj_executionSettings = obj.executionSettings;
|
|
613
|
+
const path_executionSettings = path + '.executionSettings';
|
|
614
|
+
if (typeof obj_executionSettings !== 'object' || ArrayIsArray(obj_executionSettings) || obj_executionSettings === null) {
|
|
615
|
+
return new TypeError('Expected "object" but received "' + typeof obj_executionSettings + '" (at "' + path_executionSettings + '")');
|
|
616
|
+
}
|
|
617
|
+
const obj_updatedNodes = obj.updatedNodes;
|
|
618
|
+
const path_updatedNodes = path + '.updatedNodes';
|
|
619
|
+
if (!ArrayIsArray(obj_updatedNodes)) {
|
|
620
|
+
return new TypeError('Expected "array" but received "' + typeof obj_updatedNodes + '" (at "' + path_updatedNodes + '")');
|
|
621
|
+
}
|
|
622
|
+
for (let i = 0; i < obj_updatedNodes.length; i++) {
|
|
623
|
+
const obj_updatedNodes_item = obj_updatedNodes[i];
|
|
624
|
+
const path_updatedNodes_item = path_updatedNodes + '[' + i + ']';
|
|
625
|
+
if (typeof obj_updatedNodes_item !== 'object' || ArrayIsArray(obj_updatedNodes_item) || obj_updatedNodes_item === null) {
|
|
626
|
+
return new TypeError('Expected "object" but received "' + typeof obj_updatedNodes_item + '" (at "' + path_updatedNodes_item + '")');
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
})();
|
|
630
|
+
return v_error === undefined ? null : v_error;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
function select$1(luvio, params) {
|
|
634
|
+
return select$4();
|
|
635
|
+
}
|
|
636
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
637
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
638
|
+
}
|
|
639
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
640
|
+
const { body } = response;
|
|
641
|
+
const key = keyBuilderFromType(luvio, body);
|
|
642
|
+
luvio.storeIngest(key, ingest, body);
|
|
643
|
+
const snapshot = luvio.storeLookup({
|
|
644
|
+
recordId: key,
|
|
645
|
+
node: select$1(),
|
|
646
|
+
variables: {},
|
|
647
|
+
});
|
|
648
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
649
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
650
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
deepFreeze(snapshot.data);
|
|
654
|
+
return snapshot;
|
|
655
|
+
}
|
|
656
|
+
function createResourceRequest$1(config) {
|
|
657
|
+
const headers = {};
|
|
658
|
+
return {
|
|
659
|
+
baseUri: '/services/data/v62.0',
|
|
660
|
+
basePath: '/connect/revenue-management/sales-transaction-contexts/' + config.urlParams.resourceId + '/actions/ramp-deal-update',
|
|
661
|
+
method: 'post',
|
|
662
|
+
body: config.body,
|
|
663
|
+
urlParams: config.urlParams,
|
|
664
|
+
queryParams: {},
|
|
665
|
+
headers,
|
|
666
|
+
priority: 'normal',
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
const adapterName$1 = 'updateRampDeal';
|
|
671
|
+
const updateRampDeal_ConfigPropertyMetadata = [
|
|
672
|
+
generateParamConfigMetadata('resourceId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
673
|
+
generateParamConfigMetadata('updateRampDealInputParam', true, 2 /* Body */, 4 /* Unsupported */),
|
|
674
|
+
];
|
|
675
|
+
const updateRampDeal_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, updateRampDeal_ConfigPropertyMetadata);
|
|
676
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(updateRampDeal_ConfigPropertyMetadata);
|
|
677
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
678
|
+
const config = {};
|
|
679
|
+
typeCheckConfig$4(untrustedConfig, config, updateRampDeal_ConfigPropertyMetadata);
|
|
680
|
+
const untrustedConfig_updateRampDealInputParam = untrustedConfig.updateRampDealInputParam;
|
|
681
|
+
const referenceUpdateRampDealInputRepresentationValidationError = validate(untrustedConfig_updateRampDealInputParam);
|
|
682
|
+
if (referenceUpdateRampDealInputRepresentationValidationError === null) {
|
|
683
|
+
config.updateRampDealInputParam = untrustedConfig_updateRampDealInputParam;
|
|
684
|
+
}
|
|
685
|
+
return config;
|
|
686
|
+
}
|
|
687
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
688
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
689
|
+
return null;
|
|
690
|
+
}
|
|
691
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
692
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
693
|
+
}
|
|
694
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
695
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
698
|
+
return config;
|
|
699
|
+
}
|
|
700
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
701
|
+
const resourceParams = createResourceParams$1(config);
|
|
702
|
+
const request = createResourceRequest$1(resourceParams);
|
|
703
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
704
|
+
.then((response) => {
|
|
705
|
+
return luvio.handleSuccessResponse(() => {
|
|
706
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
707
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
708
|
+
}, () => {
|
|
709
|
+
const cache = new StoreKeyMap();
|
|
710
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
711
|
+
return cache;
|
|
712
|
+
});
|
|
713
|
+
}, (response) => {
|
|
714
|
+
deepFreeze(response);
|
|
715
|
+
throw response;
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
const updateRampDealAdapterFactory = (luvio) => {
|
|
719
|
+
return function updateRampDeal(untrustedConfig) {
|
|
720
|
+
const config = validateAdapterConfig$1(untrustedConfig, updateRampDeal_ConfigPropertyNames);
|
|
721
|
+
// Invalid or incomplete config
|
|
722
|
+
if (config === null) {
|
|
723
|
+
throw new Error('Invalid config for "updateRampDeal"');
|
|
724
|
+
}
|
|
725
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
function select(luvio, params) {
|
|
730
|
+
return select$4();
|
|
731
|
+
}
|
|
732
|
+
function keyBuilder$1(luvio, params) {
|
|
733
|
+
return keyBuilder$2(luvio, {
|
|
734
|
+
transactionContextId: params.urlParams.resourceId
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
738
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
739
|
+
}
|
|
740
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
741
|
+
const { body } = response;
|
|
742
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
743
|
+
luvio.storeIngest(key, ingest, body);
|
|
744
|
+
const snapshot = luvio.storeLookup({
|
|
745
|
+
recordId: key,
|
|
746
|
+
node: select(),
|
|
747
|
+
variables: {},
|
|
748
|
+
}, snapshotRefresh);
|
|
749
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
750
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
751
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
deepFreeze(snapshot.data);
|
|
755
|
+
return snapshot;
|
|
756
|
+
}
|
|
757
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
758
|
+
const key = keyBuilder$1(luvio, params);
|
|
759
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
760
|
+
const storeMetadataParams = {
|
|
761
|
+
ttl: TTL,
|
|
762
|
+
namespace: keyPrefix,
|
|
763
|
+
version: VERSION,
|
|
764
|
+
representationName: RepresentationType
|
|
765
|
+
};
|
|
766
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
767
|
+
return errorSnapshot;
|
|
768
|
+
}
|
|
769
|
+
function createResourceRequest(config) {
|
|
770
|
+
const headers = {};
|
|
771
|
+
return {
|
|
772
|
+
baseUri: '/services/data/v62.0',
|
|
773
|
+
basePath: '/connect/revenue-management/sales-transaction-contexts/' + config.urlParams.resourceId + '/actions/ramp-deal-view',
|
|
774
|
+
method: 'get',
|
|
775
|
+
body: null,
|
|
776
|
+
urlParams: config.urlParams,
|
|
777
|
+
queryParams: config.queryParams,
|
|
778
|
+
headers,
|
|
779
|
+
priority: 'normal',
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
function createResourceRequestFromRepresentation(representation) {
|
|
783
|
+
const config = {
|
|
784
|
+
urlParams: {},
|
|
785
|
+
queryParams: {},
|
|
786
|
+
};
|
|
787
|
+
config.urlParams.resourceId = representation.transactionContextId;
|
|
788
|
+
return createResourceRequest(config);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
const adapterName = 'viewRampDeal';
|
|
792
|
+
const viewRampDeal_ConfigPropertyMetadata = [
|
|
793
|
+
generateParamConfigMetadata('resourceId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
794
|
+
generateParamConfigMetadata('transactionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
795
|
+
generateParamConfigMetadata('transactionLineId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
796
|
+
];
|
|
797
|
+
const viewRampDeal_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, viewRampDeal_ConfigPropertyMetadata);
|
|
798
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$4(viewRampDeal_ConfigPropertyMetadata);
|
|
799
|
+
function keyBuilder(luvio, config) {
|
|
800
|
+
const resourceParams = createResourceParams(config);
|
|
801
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
802
|
+
}
|
|
803
|
+
function typeCheckConfig(untrustedConfig) {
|
|
804
|
+
const config = {};
|
|
805
|
+
typeCheckConfig$4(untrustedConfig, config, viewRampDeal_ConfigPropertyMetadata);
|
|
806
|
+
return config;
|
|
807
|
+
}
|
|
808
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
809
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
810
|
+
return null;
|
|
811
|
+
}
|
|
812
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
813
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
814
|
+
}
|
|
815
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
816
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
817
|
+
return null;
|
|
818
|
+
}
|
|
819
|
+
return config;
|
|
820
|
+
}
|
|
821
|
+
function adapterFragment(luvio, config) {
|
|
822
|
+
createResourceParams(config);
|
|
823
|
+
return select();
|
|
824
|
+
}
|
|
825
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
826
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
827
|
+
config,
|
|
828
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
829
|
+
});
|
|
830
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
831
|
+
}
|
|
832
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
833
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
834
|
+
config,
|
|
835
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
836
|
+
});
|
|
837
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
838
|
+
}
|
|
839
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
840
|
+
const resourceParams = createResourceParams(config);
|
|
841
|
+
const request = createResourceRequest(resourceParams);
|
|
842
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
843
|
+
.then((response) => {
|
|
844
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
845
|
+
const cache = new StoreKeyMap();
|
|
846
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
847
|
+
return cache;
|
|
848
|
+
});
|
|
849
|
+
}, (response) => {
|
|
850
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
854
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
855
|
+
}
|
|
856
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
857
|
+
const { luvio, config } = context;
|
|
858
|
+
const selector = {
|
|
859
|
+
recordId: keyBuilder(luvio, config),
|
|
860
|
+
node: adapterFragment(luvio, config),
|
|
861
|
+
variables: {},
|
|
862
|
+
};
|
|
863
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
864
|
+
config,
|
|
865
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
866
|
+
});
|
|
867
|
+
return cacheSnapshot;
|
|
868
|
+
}
|
|
869
|
+
const viewRampDealAdapterFactory = (luvio) => function salesTransactionContexts__viewRampDeal(untrustedConfig, requestContext) {
|
|
870
|
+
const config = validateAdapterConfig(untrustedConfig, viewRampDeal_ConfigPropertyNames);
|
|
871
|
+
// Invalid or incomplete config
|
|
872
|
+
if (config === null) {
|
|
873
|
+
return null;
|
|
874
|
+
}
|
|
875
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
876
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
877
|
+
};
|
|
878
|
+
const notifyChangeFactory = (luvio, options) => {
|
|
879
|
+
return function getConnectRevenueManagementSalesTransactionContextsActionsRampDealViewByResourceIdNotifyChange(configs) {
|
|
880
|
+
const keys = configs.map(c => keyBuilder$2(luvio, c));
|
|
881
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
882
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
883
|
+
const { key, record: val } = entries[i];
|
|
884
|
+
const refreshRequest = createResourceRequestFromRepresentation(val);
|
|
885
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
886
|
+
.then((response) => {
|
|
887
|
+
return luvio.handleSuccessResponse(() => {
|
|
888
|
+
const { body } = response;
|
|
889
|
+
luvio.storeIngest(key, ingest, body);
|
|
890
|
+
return luvio.storeBroadcast();
|
|
891
|
+
}, () => {
|
|
892
|
+
const cache = new StoreKeyMap();
|
|
893
|
+
getTypeCacheKeys(cache, luvio, response.body);
|
|
894
|
+
return cache;
|
|
895
|
+
});
|
|
896
|
+
}, (error) => {
|
|
897
|
+
return luvio.handleErrorResponse(() => {
|
|
898
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
899
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
900
|
+
ttl: TTL,
|
|
901
|
+
namespace: keyPrefix,
|
|
902
|
+
version: VERSION,
|
|
903
|
+
representationName: RepresentationType
|
|
904
|
+
});
|
|
905
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
906
|
+
});
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
});
|
|
910
|
+
};
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
let createRampDeal;
|
|
914
|
+
let deleteRampDeal;
|
|
915
|
+
let updateRampDeal;
|
|
916
|
+
let viewRampDeal;
|
|
917
|
+
let viewRampDealNotifyChange;
|
|
918
|
+
// Imperative GET Adapters
|
|
919
|
+
let viewRampDeal_imperative;
|
|
920
|
+
const viewRampDealMetadata = {
|
|
921
|
+
apiFamily: 'salestransaction-contexts',
|
|
922
|
+
name: 'viewRampDeal',
|
|
923
|
+
ttl: 1000,
|
|
924
|
+
};
|
|
925
|
+
// Notify Update Available
|
|
926
|
+
function bindExportsTo(luvio) {
|
|
927
|
+
// LDS Adapters
|
|
928
|
+
const viewRampDeal_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'viewRampDeal', viewRampDealAdapterFactory), viewRampDealMetadata);
|
|
929
|
+
function unwrapSnapshotData(factory) {
|
|
930
|
+
const adapter = factory(luvio);
|
|
931
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
932
|
+
}
|
|
933
|
+
return {
|
|
934
|
+
createRampDeal: unwrapSnapshotData(createRampDealAdapterFactory),
|
|
935
|
+
deleteRampDeal: unwrapSnapshotData(deleteRampDealAdapterFactory),
|
|
936
|
+
updateRampDeal: unwrapSnapshotData(updateRampDealAdapterFactory),
|
|
937
|
+
viewRampDeal: createWireAdapterConstructor(luvio, viewRampDeal_ldsAdapter, viewRampDealMetadata),
|
|
938
|
+
viewRampDealNotifyChange: createLDSAdapter(luvio, 'viewRampDealNotifyChange', notifyChangeFactory),
|
|
939
|
+
// Imperative GET Adapters
|
|
940
|
+
viewRampDeal_imperative: createImperativeAdapter(luvio, viewRampDeal_ldsAdapter, viewRampDealMetadata),
|
|
941
|
+
// Notify Update Availables
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
withDefaultLuvio((luvio) => {
|
|
945
|
+
({
|
|
946
|
+
createRampDeal,
|
|
947
|
+
deleteRampDeal,
|
|
948
|
+
updateRampDeal,
|
|
949
|
+
viewRampDeal,
|
|
950
|
+
viewRampDealNotifyChange,
|
|
951
|
+
viewRampDeal_imperative,
|
|
952
|
+
} = bindExportsTo(luvio));
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
export { createRampDeal, deleteRampDeal, updateRampDeal, viewRampDeal, viewRampDealNotifyChange, viewRampDeal_imperative };
|
|
956
|
+
// version: 1.303.0-b6ed223d95
|