@salesforce/lds-adapters-industries-cpq 1.100.2

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/sfdc/index.js ADDED
@@ -0,0 +1,475 @@
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 { withDefaultLuvio } from 'force/ldsEngine';
16
+ import { serializeStructuredKey, StoreKeyMap } from 'force/luvioEngine';
17
+
18
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
19
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
20
+ const { isArray: ArrayIsArray$1 } = Array;
21
+ /**
22
+ * Validates an adapter config is well-formed.
23
+ * @param config The config to validate.
24
+ * @param adapter The adapter validation configuration.
25
+ * @param oneOf The keys the config must contain at least one of.
26
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
27
+ */
28
+ function validateConfig(config, adapter, oneOf) {
29
+ const { displayName } = adapter;
30
+ const { required, optional, unsupported } = adapter.parameters;
31
+ if (config === undefined ||
32
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
33
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
34
+ }
35
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
36
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
37
+ }
38
+ if (unsupported !== undefined &&
39
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
40
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
41
+ }
42
+ const supported = required.concat(optional);
43
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
44
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
45
+ }
46
+ }
47
+ function untrustedIsObject(untrusted) {
48
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
49
+ }
50
+ function areRequiredParametersPresent(config, configPropertyNames) {
51
+ return configPropertyNames.parameters.required.every(req => req in config);
52
+ }
53
+ const keyPrefix = 'cpq';
54
+
55
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
56
+ const { isArray: ArrayIsArray } = Array;
57
+ const { stringify: JSONStringify } = JSON;
58
+ function deepFreeze$1(value) {
59
+ // No need to freeze primitives
60
+ if (typeof value !== 'object' || value === null) {
61
+ return;
62
+ }
63
+ if (ArrayIsArray(value)) {
64
+ for (let i = 0, len = value.length; i < len; i += 1) {
65
+ deepFreeze$1(value[i]);
66
+ }
67
+ }
68
+ else {
69
+ const keys = ObjectKeys(value);
70
+ for (let i = 0, len = keys.length; i < len; i += 1) {
71
+ deepFreeze$1(value[keys[i]]);
72
+ }
73
+ }
74
+ ObjectFreeze(value);
75
+ }
76
+ function createLink(ref) {
77
+ return {
78
+ __ref: serializeStructuredKey(ref),
79
+ };
80
+ }
81
+
82
+ function validate$2(obj, path = 'ProductConfigurationInputRepresentation') {
83
+ const v_error = (() => {
84
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
85
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
86
+ }
87
+ if (obj.configuration !== undefined) {
88
+ const obj_configuration = obj.configuration;
89
+ const path_configuration = path + '.configuration';
90
+ if (typeof obj_configuration !== 'object' || ArrayIsArray(obj_configuration) || obj_configuration === null) {
91
+ return new TypeError('Expected "object" but received "' + typeof obj_configuration + '" (at "' + path_configuration + '")');
92
+ }
93
+ }
94
+ if (obj.productId !== undefined) {
95
+ const obj_productId = obj.productId;
96
+ const path_productId = path + '.productId';
97
+ if (typeof obj_productId !== 'string') {
98
+ return new TypeError('Expected "string" but received "' + typeof obj_productId + '" (at "' + path_productId + '")');
99
+ }
100
+ }
101
+ })();
102
+ return v_error === undefined ? null : v_error;
103
+ }
104
+
105
+ function validate$1(obj, path = 'PreviewInputRepresentation') {
106
+ const v_error = (() => {
107
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
108
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
109
+ }
110
+ if (obj.cartId !== undefined) {
111
+ const obj_cartId = obj.cartId;
112
+ const path_cartId = path + '.cartId';
113
+ if (typeof obj_cartId !== 'string') {
114
+ return new TypeError('Expected "string" but received "' + typeof obj_cartId + '" (at "' + path_cartId + '")');
115
+ }
116
+ }
117
+ if (obj.configuredItems !== undefined) {
118
+ const obj_configuredItems = obj.configuredItems;
119
+ const path_configuredItems = path + '.configuredItems';
120
+ if (!ArrayIsArray(obj_configuredItems)) {
121
+ return new TypeError('Expected "array" but received "' + typeof obj_configuredItems + '" (at "' + path_configuredItems + '")');
122
+ }
123
+ for (let i = 0; i < obj_configuredItems.length; i++) {
124
+ const obj_configuredItems_item = obj_configuredItems[i];
125
+ const path_configuredItems_item = path_configuredItems + '[' + i + ']';
126
+ const referencepath_configuredItems_itemValidationError = validate$2(obj_configuredItems_item, path_configuredItems_item);
127
+ if (referencepath_configuredItems_itemValidationError !== null) {
128
+ let message = 'Object doesn\'t match ProductConfigurationInputRepresentation (at "' + path_configuredItems_item + '")\n';
129
+ message += referencepath_configuredItems_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
130
+ return new TypeError(message);
131
+ }
132
+ }
133
+ }
134
+ if (obj.correlationId !== undefined) {
135
+ const obj_correlationId = obj.correlationId;
136
+ const path_correlationId = path + '.correlationId';
137
+ if (typeof obj_correlationId !== 'string') {
138
+ return new TypeError('Expected "string" but received "' + typeof obj_correlationId + '" (at "' + path_correlationId + '")');
139
+ }
140
+ }
141
+ if (obj.customFields !== undefined) {
142
+ const obj_customFields = obj.customFields;
143
+ const path_customFields = path + '.customFields';
144
+ if (typeof obj_customFields !== 'object' || ArrayIsArray(obj_customFields) || obj_customFields === null) {
145
+ return new TypeError('Expected "object" but received "' + typeof obj_customFields + '" (at "' + path_customFields + '")');
146
+ }
147
+ const obj_customFields_keys = ObjectKeys(obj_customFields);
148
+ for (let i = 0; i < obj_customFields_keys.length; i++) {
149
+ const key = obj_customFields_keys[i];
150
+ const obj_customFields_prop = obj_customFields[key];
151
+ const path_customFields_prop = path_customFields + '["' + key + '"]';
152
+ if (typeof obj_customFields_prop !== 'string') {
153
+ return new TypeError('Expected "string" but received "' + typeof obj_customFields_prop + '" (at "' + path_customFields_prop + '")');
154
+ }
155
+ }
156
+ }
157
+ if (obj.userContext !== undefined) {
158
+ const obj_userContext = obj.userContext;
159
+ const path_userContext = path + '.userContext';
160
+ if (typeof obj_userContext !== 'object' || ArrayIsArray(obj_userContext) || obj_userContext === null) {
161
+ return new TypeError('Expected "object" but received "' + typeof obj_userContext + '" (at "' + path_userContext + '")');
162
+ }
163
+ }
164
+ })();
165
+ return v_error === undefined ? null : v_error;
166
+ }
167
+
168
+ const TTL = 1000;
169
+ const VERSION = "5f42d9d8a2278fc45355868ea236f9c6";
170
+ function validate(obj, path = 'CpqBaseListOutputRepresentation') {
171
+ const v_error = (() => {
172
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
173
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
174
+ }
175
+ if (obj.errorCode !== undefined) {
176
+ const obj_errorCode = obj.errorCode;
177
+ const path_errorCode = path + '.errorCode';
178
+ if (typeof obj_errorCode !== 'string') {
179
+ return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
180
+ }
181
+ }
182
+ if (obj.errorDetails !== undefined) {
183
+ const obj_errorDetails = obj.errorDetails;
184
+ const path_errorDetails = path + '.errorDetails';
185
+ if (typeof obj_errorDetails !== 'string') {
186
+ return new TypeError('Expected "string" but received "' + typeof obj_errorDetails + '" (at "' + path_errorDetails + '")');
187
+ }
188
+ }
189
+ if (obj.errorMessage !== undefined) {
190
+ const obj_errorMessage = obj.errorMessage;
191
+ const path_errorMessage = path + '.errorMessage';
192
+ if (typeof obj_errorMessage !== 'string') {
193
+ return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
194
+ }
195
+ }
196
+ if (obj.limit !== undefined) {
197
+ const obj_limit = obj.limit;
198
+ const path_limit = path + '.limit';
199
+ if (typeof obj_limit !== 'number' || (typeof obj_limit === 'number' && Math.floor(obj_limit) !== obj_limit)) {
200
+ return new TypeError('Expected "integer" but received "' + typeof obj_limit + '" (at "' + path_limit + '")');
201
+ }
202
+ }
203
+ if (obj.offSet !== undefined) {
204
+ const obj_offSet = obj.offSet;
205
+ const path_offSet = path + '.offSet';
206
+ if (typeof obj_offSet !== 'number' || (typeof obj_offSet === 'number' && Math.floor(obj_offSet) !== obj_offSet)) {
207
+ return new TypeError('Expected "integer" but received "' + typeof obj_offSet + '" (at "' + path_offSet + '")');
208
+ }
209
+ }
210
+ if (obj.query !== undefined) {
211
+ const obj_query = obj.query;
212
+ const path_query = path + '.query';
213
+ if (typeof obj_query !== 'object' || ArrayIsArray(obj_query) || obj_query === null) {
214
+ return new TypeError('Expected "object" but received "' + typeof obj_query + '" (at "' + path_query + '")');
215
+ }
216
+ const obj_query_keys = ObjectKeys(obj_query);
217
+ for (let i = 0; i < obj_query_keys.length; i++) {
218
+ const key = obj_query_keys[i];
219
+ const obj_query_prop = obj_query[key];
220
+ const path_query_prop = path_query + '["' + key + '"]';
221
+ if (typeof obj_query_prop !== 'object' || ArrayIsArray(obj_query_prop) || obj_query_prop === null) {
222
+ return new TypeError('Expected "object" but received "' + typeof obj_query_prop + '" (at "' + path_query_prop + '")');
223
+ }
224
+ const obj_query_prop_keys = ObjectKeys(obj_query_prop);
225
+ for (let i = 0; i < obj_query_prop_keys.length; i++) {
226
+ const key = obj_query_prop_keys[i];
227
+ const obj_query_prop_prop = obj_query_prop[key];
228
+ const path_query_prop_prop = path_query_prop + '["' + key + '"]';
229
+ if (typeof obj_query_prop_prop !== 'object' || ArrayIsArray(obj_query_prop_prop) || obj_query_prop_prop === null) {
230
+ return new TypeError('Expected "object" but received "' + typeof obj_query_prop_prop + '" (at "' + path_query_prop_prop + '")');
231
+ }
232
+ }
233
+ }
234
+ }
235
+ const obj_result = obj.result;
236
+ const path_result = path + '.result';
237
+ if (!ArrayIsArray(obj_result)) {
238
+ return new TypeError('Expected "array" but received "' + typeof obj_result + '" (at "' + path_result + '")');
239
+ }
240
+ for (let i = 0; i < obj_result.length; i++) {
241
+ const obj_result_item = obj_result[i];
242
+ const path_result_item = path_result + '[' + i + ']';
243
+ if (obj_result_item === undefined) {
244
+ return new TypeError('Expected "defined" but received "' + typeof obj_result_item + '" (at "' + path_result_item + '")');
245
+ }
246
+ }
247
+ const obj_status = obj.status;
248
+ const path_status = path + '.status';
249
+ if (typeof obj_status !== 'string') {
250
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
251
+ }
252
+ if (obj.total !== undefined) {
253
+ const obj_total = obj.total;
254
+ const path_total = path + '.total';
255
+ if (typeof obj_total !== 'number' || (typeof obj_total === 'number' && Math.floor(obj_total) !== obj_total)) {
256
+ return new TypeError('Expected "integer" but received "' + typeof obj_total + '" (at "' + path_total + '")');
257
+ }
258
+ }
259
+ })();
260
+ return v_error === undefined ? null : v_error;
261
+ }
262
+ const RepresentationType = 'CpqBaseListOutputRepresentation';
263
+ function keyBuilder(luvio, config) {
264
+ return keyPrefix + '::' + RepresentationType + ':' + config.message;
265
+ }
266
+ function keyBuilderFromType(luvio, object) {
267
+ const keyParams = {
268
+ message: object.status
269
+ };
270
+ return keyBuilder(luvio, keyParams);
271
+ }
272
+ function normalize(input, existing, path, luvio, store, timestamp) {
273
+ return input;
274
+ }
275
+ const select$1 = function CpqBaseListOutputRepresentationSelect() {
276
+ return {
277
+ kind: 'Fragment',
278
+ version: VERSION,
279
+ private: [],
280
+ opaque: true
281
+ };
282
+ };
283
+ function equals(existing, incoming) {
284
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
285
+ return false;
286
+ }
287
+ return true;
288
+ }
289
+ function deepFreeze(input) {
290
+ const input_query = input.query;
291
+ if (input_query !== undefined) {
292
+ const input_query_keys = Object.keys(input_query);
293
+ const input_query_length = input_query_keys.length;
294
+ for (let i = 0; i < input_query_length; i++) {
295
+ const key = input_query_keys[i];
296
+ const input_query_prop = input_query[key];
297
+ const input_query_prop_keys = Object.keys(input_query_prop);
298
+ const input_query_prop_length = input_query_prop_keys.length;
299
+ for (let i = 0; i < input_query_prop_length; i++) {
300
+ const key = input_query_prop_keys[i];
301
+ const input_query_prop_prop = input_query_prop[key];
302
+ ObjectFreeze(input_query_prop_prop);
303
+ }
304
+ ObjectFreeze(input_query_prop);
305
+ }
306
+ ObjectFreeze(input_query);
307
+ }
308
+ const input_result = input.result;
309
+ for (let i = 0; i < input_result.length; i++) {
310
+ const input_result_item = input_result[i];
311
+ deepFreeze$1(input_result_item);
312
+ }
313
+ ObjectFreeze(input_result);
314
+ ObjectFreeze(input);
315
+ }
316
+ const ingest = function CpqBaseListOutputRepresentationIngest(input, path, luvio, store, timestamp) {
317
+ if (process.env.NODE_ENV !== 'production') {
318
+ const validateError = validate(input);
319
+ if (validateError !== null) {
320
+ throw validateError;
321
+ }
322
+ }
323
+ const key = keyBuilderFromType(luvio, input);
324
+ const existingRecord = store.readEntry(key);
325
+ const ttlToUse = TTL;
326
+ let incomingRecord = normalize(input, store.readEntry(key), {
327
+ fullPath: key,
328
+ parent: path.parent,
329
+ propertyName: path.propertyName,
330
+ ttl: ttlToUse
331
+ });
332
+ deepFreeze(input);
333
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
334
+ luvio.storePublish(key, incomingRecord);
335
+ }
336
+ {
337
+ const storeMetadataParams = {
338
+ ttl: ttlToUse,
339
+ namespace: "cpq",
340
+ version: VERSION,
341
+ representationName: RepresentationType,
342
+ };
343
+ luvio.publishStoreMetadata(key, storeMetadataParams);
344
+ }
345
+ return createLink(key);
346
+ };
347
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
348
+ const rootKeySet = new StoreKeyMap();
349
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
350
+ const rootKey = keyBuilderFromType(luvio, input);
351
+ rootKeySet.set(rootKey, {
352
+ namespace: keyPrefix,
353
+ representationName: RepresentationType,
354
+ mergeable: false
355
+ });
356
+ return rootKeySet;
357
+ }
358
+
359
+ function select(luvio, params) {
360
+ return select$1();
361
+ }
362
+ function getResponseCacheKeys(luvio, resourceParams, response) {
363
+ return getTypeCacheKeys(luvio, response);
364
+ }
365
+ function ingestSuccess(luvio, resourceParams, response) {
366
+ const { body } = response;
367
+ const key = keyBuilderFromType(luvio, body);
368
+ luvio.storeIngest(key, ingest, body);
369
+ const snapshot = luvio.storeLookup({
370
+ recordId: key,
371
+ node: select(),
372
+ variables: {},
373
+ });
374
+ if (process.env.NODE_ENV !== 'production') {
375
+ if (snapshot.state !== 'Fulfilled') {
376
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
377
+ }
378
+ }
379
+ return snapshot;
380
+ }
381
+ function createResourceRequest(config) {
382
+ const headers = {};
383
+ return {
384
+ baseUri: '/services/data/v58.0',
385
+ basePath: '/connect/cpq/preview',
386
+ method: 'post',
387
+ body: config.body,
388
+ urlParams: {},
389
+ queryParams: {},
390
+ headers,
391
+ priority: 'normal',
392
+ };
393
+ }
394
+
395
+ const preview_ConfigPropertyNames = {
396
+ displayName: 'preview',
397
+ parameters: {
398
+ required: ['previewInput'],
399
+ optional: []
400
+ }
401
+ };
402
+ function createResourceParams(config) {
403
+ const resourceParams = {
404
+ body: {
405
+ previewInput: config.previewInput
406
+ }
407
+ };
408
+ return resourceParams;
409
+ }
410
+ function typeCheckConfig(untrustedConfig) {
411
+ const config = {};
412
+ const untrustedConfig_previewInput = untrustedConfig.previewInput;
413
+ const referencePreviewInputRepresentationValidationError = validate$1(untrustedConfig_previewInput);
414
+ if (referencePreviewInputRepresentationValidationError === null) {
415
+ config.previewInput = untrustedConfig_previewInput;
416
+ }
417
+ return config;
418
+ }
419
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
420
+ if (!untrustedIsObject(untrustedConfig)) {
421
+ return null;
422
+ }
423
+ if (process.env.NODE_ENV !== 'production') {
424
+ validateConfig(untrustedConfig, configPropertyNames);
425
+ }
426
+ const config = typeCheckConfig(untrustedConfig);
427
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
428
+ return null;
429
+ }
430
+ return config;
431
+ }
432
+ function buildNetworkSnapshot(luvio, config, options) {
433
+ const resourceParams = createResourceParams(config);
434
+ const request = createResourceRequest(resourceParams);
435
+ return luvio.dispatchResourceRequest(request, options)
436
+ .then((response) => {
437
+ return luvio.handleSuccessResponse(() => {
438
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
439
+ return luvio.storeBroadcast().then(() => snapshot);
440
+ }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
441
+ }, (response) => {
442
+ deepFreeze$1(response);
443
+ throw response;
444
+ });
445
+ }
446
+ const previewAdapterFactory = (luvio) => {
447
+ return function preview(untrustedConfig) {
448
+ const config = validateAdapterConfig(untrustedConfig, preview_ConfigPropertyNames);
449
+ // Invalid or incomplete config
450
+ if (config === null) {
451
+ throw new Error('Invalid config for "preview"');
452
+ }
453
+ return buildNetworkSnapshot(luvio, config);
454
+ };
455
+ };
456
+
457
+ let preview;
458
+ function bindExportsTo(luvio) {
459
+ function unwrapSnapshotData(factory) {
460
+ const adapter = factory(luvio);
461
+ return (config) => adapter(config).then(snapshot => snapshot.data);
462
+ }
463
+ return {
464
+ preview: unwrapSnapshotData(previewAdapterFactory),
465
+ // Imperative GET Adapters
466
+ };
467
+ }
468
+ withDefaultLuvio((luvio) => {
469
+ ({
470
+ preview,
471
+ } = bindExportsTo(luvio));
472
+ });
473
+
474
+ export { preview };
475
+ // version: 1.100.2-ca56bb821
@@ -0,0 +1,135 @@
1
+ #%RAML 1.0
2
+ securedBy:
3
+ - OAuth2
4
+ title: Salesforce Connect API
5
+ version: '58.0'
6
+ mediaType: application/json
7
+ protocols:
8
+ - https
9
+ baseUri: /services/data/v58.0
10
+ securitySchemes:
11
+ OAuth2:
12
+ type: OAuth 2.0
13
+ settings:
14
+ authorizationUri: https://example.com/oauth/authorize
15
+ accessTokenUri: ''
16
+ authorizationGrants:
17
+ - implicit
18
+ annotationTypes:
19
+ oas-readOnly:
20
+ type: boolean
21
+ allowedTargets: TypeDeclaration
22
+ oas-collectionFormat:
23
+ type: string
24
+ oas-body-name:
25
+ type: string
26
+ allowedTargets: TypeDeclaration
27
+ types:
28
+ CpqBaseListOutputRepresentation:
29
+ description: Base representation for list apis
30
+ type: object
31
+ properties:
32
+ limit:
33
+ description: Limit
34
+ type: integer
35
+ required: false
36
+ offSet:
37
+ description: Offset
38
+ type: integer
39
+ required: false
40
+ query:
41
+ description: Input Query Object
42
+ type: object
43
+ required: false
44
+ properties:
45
+ //:
46
+ type: object
47
+ properties:
48
+ //:
49
+ type: object
50
+ result:
51
+ description: Result object
52
+ type: array
53
+ items:
54
+ type: any
55
+ total:
56
+ description: Totals
57
+ type: integer
58
+ required: false
59
+ errorCode:
60
+ description: Error Code
61
+ type: string
62
+ required: false
63
+ errorDetails:
64
+ description: Error Details
65
+ type: string
66
+ required: false
67
+ errorMessage:
68
+ description: Error Message
69
+ type: string
70
+ required: false
71
+ status:
72
+ description: Error Status
73
+ type: string
74
+ ProductConfigurationInputRepresentation:
75
+ description: Input Representation for Product Configuration.
76
+ type: object
77
+ properties:
78
+ configuration:
79
+ description: Product delta configurations
80
+ type: object
81
+ required: false
82
+ productId:
83
+ description: Product Id
84
+ type: string
85
+ required: false
86
+ PreviewInputRepresentation:
87
+ description: Input Representation for Preview Product or cart item.
88
+ type: object
89
+ properties:
90
+ cartId:
91
+ description: Id of the Cart to which ths conigured items belongs to.
92
+ type: string
93
+ required: false
94
+ configuredItems:
95
+ description: Items to be configure and update to the cart.
96
+ type: array
97
+ required: false
98
+ items:
99
+ type: ProductConfigurationInputRepresentation
100
+ correlationId:
101
+ description: CorrelationId
102
+ type: string
103
+ required: false
104
+ customFields:
105
+ description: Key value pair of custom fields.
106
+ type: object
107
+ properties:
108
+ //:
109
+ type: string
110
+ required: false
111
+ userContext:
112
+ description: User context in which cart would be created.
113
+ type: object
114
+ required: false
115
+ PreviewInputRepresentationWrapper:
116
+ description: Wrapper representation for input params
117
+ type: object
118
+ properties:
119
+ previewInput:
120
+ description: Key for api call
121
+ type: PreviewInputRepresentation
122
+ /connect/cpq/preview:
123
+ post:
124
+ description: Preview product
125
+ responses:
126
+ '200':
127
+ description: Success
128
+ body:
129
+ application/json:
130
+ type: CpqBaseListOutputRepresentation
131
+ body:
132
+ application/json:
133
+ type: PreviewInputRepresentationWrapper
134
+ #required: false
135
+ (oas-body-name): previewInput
@@ -0,0 +1,19 @@
1
+ #%RAML 1.0 Overlay
2
+ extends: ./api.raml
3
+
4
+ uses:
5
+ luvio: luvio://annotations.raml
6
+
7
+ (luvio.keyPrefix): 'cpq'
8
+ (luvio.ttl): 360000
9
+
10
+ types:
11
+ CpqBaseListOutputRepresentation:
12
+ (luvio.ttl): 1000
13
+ (luvio.opaque): true
14
+ (luvio.key):
15
+ message: status
16
+ /connect/cpq/preview:
17
+ post:
18
+ (luvio.adapter):
19
+ name: preview