@salesforce/lds-adapters-revenue-place-quote 0.131.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-place-quote.js +341 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +66 -0
- package/dist/es/es2018/types/src/generated/adapters/updateQuote.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/resources/postCommerceQuotesActionsPlace.d.ts +13 -0
- package/dist/es/es2018/types/src/generated/types/PlaceQuoteErrorResponseRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/PlaceQuoteInputRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/PlaceQuoteInputWrapperRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/PlaceQuoteOutputRepresentation.d.ts +52 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +39 -0
- package/package.json +68 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +368 -0
- package/src/raml/api.raml +96 -0
- package/src/raml/luvio.raml +72 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PlaceQuoteErrorResponseRepresentation as PlaceQuoteErrorResponseRepresentation_PlaceQuoteErrorResponseRepresentation } from './PlaceQuoteErrorResponseRepresentation';
|
|
2
|
+
import { KeyMetadata as $64$luvio_engine_KeyMetadata, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Luvio as $64$luvio_engine_Luvio, IngestPath as $64$luvio_engine_IngestPath, Store as $64$luvio_engine_Store, BaseFragment as $64$luvio_engine_BaseFragment, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap } from '@luvio/engine';
|
|
3
|
+
export declare const TTL = 1000;
|
|
4
|
+
export declare const VERSION = "32a768cba447434ebb8e37e67aed1302";
|
|
5
|
+
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
6
|
+
export declare const RepresentationType: string;
|
|
7
|
+
export interface KeyParams extends $64$luvio_engine_KeyMetadata {
|
|
8
|
+
quoteId: string;
|
|
9
|
+
}
|
|
10
|
+
export type PlaceQuoteOutputRepresentationNormalizedKeyMetadata = KeyParams & $64$luvio_engine_NormalizedKeyMetadata;
|
|
11
|
+
export type PartialPlaceQuoteOutputRepresentationNormalizedKeyMetadata = Partial<KeyParams> & $64$luvio_engine_NormalizedKeyMetadata;
|
|
12
|
+
export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: KeyParams): string;
|
|
13
|
+
export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: KeyParams): PlaceQuoteOutputRepresentationNormalizedKeyMetadata;
|
|
14
|
+
export declare function keyBuilderFromType(luvio: $64$luvio_engine_Luvio, object: PlaceQuoteOutputRepresentation): string;
|
|
15
|
+
export declare function keyBuilderFromType_StructuredKey(luvio: $64$luvio_engine_Luvio, object: PlaceQuoteOutputRepresentation): $64$luvio_engine_NormalizedKeyMetadata;
|
|
16
|
+
export declare function normalize(input: PlaceQuoteOutputRepresentation, existing: PlaceQuoteOutputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): PlaceQuoteOutputRepresentationNormalized;
|
|
17
|
+
export declare const select: () => $64$luvio_engine_BaseFragment;
|
|
18
|
+
export declare function equals(existing: PlaceQuoteOutputRepresentationNormalized, incoming: PlaceQuoteOutputRepresentationNormalized): boolean;
|
|
19
|
+
export declare function deepFreeze(input: PlaceQuoteOutputRepresentation): void;
|
|
20
|
+
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
21
|
+
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: PlaceQuoteOutputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
22
|
+
/**
|
|
23
|
+
* Place Quote output representation
|
|
24
|
+
*
|
|
25
|
+
* Keys:
|
|
26
|
+
* quoteId (string): quoteId
|
|
27
|
+
*/
|
|
28
|
+
export interface PlaceQuoteOutputRepresentationNormalized {
|
|
29
|
+
/** QUOTE ID */
|
|
30
|
+
quoteId: string;
|
|
31
|
+
/** Unique request identifier that can be used to poll async request */
|
|
32
|
+
requestIdentifier: string;
|
|
33
|
+
/** response error */
|
|
34
|
+
responseError: Array<PlaceQuoteErrorResponseRepresentation_PlaceQuoteErrorResponseRepresentation>;
|
|
35
|
+
/** a StatusURL for tracking this operation */
|
|
36
|
+
statusURL: string;
|
|
37
|
+
/** success */
|
|
38
|
+
success: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Place Quote output representation
|
|
42
|
+
*
|
|
43
|
+
* Keys:
|
|
44
|
+
* quoteId (string): quoteId
|
|
45
|
+
*/
|
|
46
|
+
export interface PlaceQuoteOutputRepresentation {
|
|
47
|
+
quoteId: string;
|
|
48
|
+
requestIdentifier: string;
|
|
49
|
+
responseError: Array<PlaceQuoteErrorResponseRepresentation_PlaceQuoteErrorResponseRepresentation>;
|
|
50
|
+
statusURL: string;
|
|
51
|
+
success: boolean;
|
|
52
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
|
+
export declare const ObjectFreeze: {
|
|
3
|
+
<T extends Function>(f: T): T;
|
|
4
|
+
<T_1 extends {
|
|
5
|
+
[idx: string]: object | U | null | undefined;
|
|
6
|
+
}, U extends string | number | bigint | boolean | symbol>(o: T_1): Readonly<T_1>;
|
|
7
|
+
<T_2>(o: T_2): Readonly<T_2>;
|
|
8
|
+
}, ObjectKeys: {
|
|
9
|
+
(o: object): string[];
|
|
10
|
+
(o: {}): string[];
|
|
11
|
+
}, ObjectCreate: {
|
|
12
|
+
(o: object | null): any;
|
|
13
|
+
(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
|
|
14
|
+
}, ObjectAssign: {
|
|
15
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
16
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
17
|
+
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
18
|
+
(target: object, ...sources: any[]): any;
|
|
19
|
+
};
|
|
20
|
+
export declare const ArrayIsArray: (arg: any) => arg is any[];
|
|
21
|
+
export declare const JSONStringify: {
|
|
22
|
+
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
23
|
+
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
24
|
+
};
|
|
25
|
+
type AllowedPrimitives = boolean | string | number | Date | null;
|
|
26
|
+
type Value<T> = T extends AllowedPrimitives ? T : RecursivePartial<T>;
|
|
27
|
+
export type RecursivePartial<T> = null | {
|
|
28
|
+
[P in keyof T]?: T[P] extends Array<infer U> ? Array<Value<U>> | null : Value<T[P]> | null;
|
|
29
|
+
};
|
|
30
|
+
export declare function equalsArray<U, V extends U[]>(a: V, b: V, equalsItem: (itemA: U, itemB: U) => boolean | void): boolean;
|
|
31
|
+
export declare function equalsObject<U, V extends {
|
|
32
|
+
[key: string]: U;
|
|
33
|
+
}>(a: V, b: V, equalsProp: (propA: U, propB: U) => boolean | void): boolean;
|
|
34
|
+
export declare function deepFreeze(value: any): void;
|
|
35
|
+
export declare function createLink(ref: string | $64$luvio_engine_NormalizedKeyMetadata): {
|
|
36
|
+
__ref: string;
|
|
37
|
+
};
|
|
38
|
+
export declare function assignMetadataLink(entry: any, metadataKey: string | $64$luvio_engine_NormalizedKeyMetadata): void;
|
|
39
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@salesforce/lds-adapters-revenue-place-quote",
|
|
3
|
+
"version": "0.131.0",
|
|
4
|
+
"description": "Place Quote API for partial items and price/taxation updates async",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
|
+
"main": "dist/es/es2018/revenue-place-quote.js",
|
|
7
|
+
"module": "dist/es/es2018/revenue-place-quote.js",
|
|
8
|
+
"types": "dist/es/es2018/types/src/generated/artifacts/main.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"sfdc",
|
|
12
|
+
"src/raml/*"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/es/es2018/revenue-place-quote.js",
|
|
17
|
+
"require": "./dist/es/es2018/revenue-place-quote.js",
|
|
18
|
+
"types": "./dist/es/es2018/types/src/generated/artifacts/main.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./sfdc": {
|
|
21
|
+
"import": "./sfdc/index.js",
|
|
22
|
+
"types": "./sfdc/index.d.ts",
|
|
23
|
+
"default": "./sfdc/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"sdfc": {
|
|
27
|
+
"namespace": "lightning",
|
|
28
|
+
"module": "revenuePlaceQuoteApi"
|
|
29
|
+
},
|
|
30
|
+
"contributors": [
|
|
31
|
+
"thane.fenton@salesforce.com"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "yarn build:raml && yarn build:services && yarn build:karma",
|
|
35
|
+
"build:karma": "rollup --config rollup.config.karma.js",
|
|
36
|
+
"build:raml": "luvio generate src/raml/luvio.raml src/generated -p '../lds-compiler-plugins'",
|
|
37
|
+
"build:services": "rollup --config rollup.config.js",
|
|
38
|
+
"clean": "rm -rf dist sfdc src/generated karma/dist",
|
|
39
|
+
"release:core": "../../scripts/release/core.js --adapter=lds-adapters-revenue-place-quote",
|
|
40
|
+
"release:corejar": "yarn build && ../core-build/scripts/core.js --adapter=lds-adapters-revenue-place-quote",
|
|
41
|
+
"start": "karma start",
|
|
42
|
+
"test": "karma start --single-run",
|
|
43
|
+
"test:compat": "karma start --single-run --compat",
|
|
44
|
+
"test:unit": "jest"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@salesforce/lds-bindings": "1.131.0-244.6"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@salesforce/lds-compiler-plugins": "1.131.0-244.6",
|
|
51
|
+
"@salesforce/lds-karma": "1.131.0-244.6"
|
|
52
|
+
},
|
|
53
|
+
"nx": {
|
|
54
|
+
"targets": {
|
|
55
|
+
"build": {
|
|
56
|
+
"outputs": [
|
|
57
|
+
"packages/lds-adapters-revenue-place-quote/dist",
|
|
58
|
+
"packages/lds-adapters-revenue-place-quote/karma/dist",
|
|
59
|
+
"packages/lds-adapters-revenue-place-quote/sfdc",
|
|
60
|
+
"packages/lds-adapters-revenue-place-quote/src/generated"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"volta": {
|
|
66
|
+
"extends": "../../package.json"
|
|
67
|
+
}
|
|
68
|
+
}
|
package/sfdc/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/es/es2018/types/src/generated/artifacts/sfdc';
|
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
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 = 'place-quote';
|
|
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$2(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$2(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$2(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 = 'PlaceQuoteInputRepresentation') {
|
|
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
|
+
const obj_graph = obj.graph;
|
|
88
|
+
const path_graph = path + '.graph';
|
|
89
|
+
if (typeof obj_graph !== 'object' || ArrayIsArray(obj_graph) || obj_graph === null) {
|
|
90
|
+
return new TypeError('Expected "object" but received "' + typeof obj_graph + '" (at "' + path_graph + '")');
|
|
91
|
+
}
|
|
92
|
+
const obj_pricingPref = obj.pricingPref;
|
|
93
|
+
const path_pricingPref = path + '.pricingPref';
|
|
94
|
+
if (typeof obj_pricingPref !== 'string') {
|
|
95
|
+
return new TypeError('Expected "string" but received "' + typeof obj_pricingPref + '" (at "' + path_pricingPref + '")');
|
|
96
|
+
}
|
|
97
|
+
})();
|
|
98
|
+
return v_error === undefined ? null : v_error;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function validate$1(obj, path = 'PlaceQuoteErrorResponseRepresentation') {
|
|
102
|
+
const v_error = (() => {
|
|
103
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
104
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
105
|
+
}
|
|
106
|
+
const obj_errorCode = obj.errorCode;
|
|
107
|
+
const path_errorCode = path + '.errorCode';
|
|
108
|
+
if (typeof obj_errorCode !== 'string') {
|
|
109
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
|
|
110
|
+
}
|
|
111
|
+
const obj_message = obj.message;
|
|
112
|
+
const path_message = path + '.message';
|
|
113
|
+
if (typeof obj_message !== 'string') {
|
|
114
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
115
|
+
}
|
|
116
|
+
const obj_referenceId = obj.referenceId;
|
|
117
|
+
const path_referenceId = path + '.referenceId';
|
|
118
|
+
if (typeof obj_referenceId !== 'string') {
|
|
119
|
+
return new TypeError('Expected "string" but received "' + typeof obj_referenceId + '" (at "' + path_referenceId + '")');
|
|
120
|
+
}
|
|
121
|
+
})();
|
|
122
|
+
return v_error === undefined ? null : v_error;
|
|
123
|
+
}
|
|
124
|
+
function deepFreeze$1(input) {
|
|
125
|
+
ObjectFreeze(input);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const TTL = 1000;
|
|
129
|
+
const VERSION = "32a768cba447434ebb8e37e67aed1302";
|
|
130
|
+
function validate(obj, path = 'PlaceQuoteOutputRepresentation') {
|
|
131
|
+
const v_error = (() => {
|
|
132
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
133
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
134
|
+
}
|
|
135
|
+
const obj_quoteId = obj.quoteId;
|
|
136
|
+
const path_quoteId = path + '.quoteId';
|
|
137
|
+
if (typeof obj_quoteId !== 'string') {
|
|
138
|
+
return new TypeError('Expected "string" but received "' + typeof obj_quoteId + '" (at "' + path_quoteId + '")');
|
|
139
|
+
}
|
|
140
|
+
const obj_requestIdentifier = obj.requestIdentifier;
|
|
141
|
+
const path_requestIdentifier = path + '.requestIdentifier';
|
|
142
|
+
if (typeof obj_requestIdentifier !== 'string') {
|
|
143
|
+
return new TypeError('Expected "string" but received "' + typeof obj_requestIdentifier + '" (at "' + path_requestIdentifier + '")');
|
|
144
|
+
}
|
|
145
|
+
const obj_responseError = obj.responseError;
|
|
146
|
+
const path_responseError = path + '.responseError';
|
|
147
|
+
if (!ArrayIsArray(obj_responseError)) {
|
|
148
|
+
return new TypeError('Expected "array" but received "' + typeof obj_responseError + '" (at "' + path_responseError + '")');
|
|
149
|
+
}
|
|
150
|
+
for (let i = 0; i < obj_responseError.length; i++) {
|
|
151
|
+
const obj_responseError_item = obj_responseError[i];
|
|
152
|
+
const path_responseError_item = path_responseError + '[' + i + ']';
|
|
153
|
+
const referencepath_responseError_itemValidationError = validate$1(obj_responseError_item, path_responseError_item);
|
|
154
|
+
if (referencepath_responseError_itemValidationError !== null) {
|
|
155
|
+
let message = 'Object doesn\'t match PlaceQuoteErrorResponseRepresentation (at "' + path_responseError_item + '")\n';
|
|
156
|
+
message += referencepath_responseError_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
157
|
+
return new TypeError(message);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const obj_statusURL = obj.statusURL;
|
|
161
|
+
const path_statusURL = path + '.statusURL';
|
|
162
|
+
if (typeof obj_statusURL !== 'string') {
|
|
163
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statusURL + '" (at "' + path_statusURL + '")');
|
|
164
|
+
}
|
|
165
|
+
const obj_success = obj.success;
|
|
166
|
+
const path_success = path + '.success';
|
|
167
|
+
if (typeof obj_success !== 'boolean') {
|
|
168
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
169
|
+
}
|
|
170
|
+
})();
|
|
171
|
+
return v_error === undefined ? null : v_error;
|
|
172
|
+
}
|
|
173
|
+
const RepresentationType = 'PlaceQuoteOutputRepresentation';
|
|
174
|
+
function keyBuilder(luvio, config) {
|
|
175
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.quoteId;
|
|
176
|
+
}
|
|
177
|
+
function keyBuilderFromType(luvio, object) {
|
|
178
|
+
const keyParams = {
|
|
179
|
+
quoteId: object.quoteId
|
|
180
|
+
};
|
|
181
|
+
return keyBuilder(luvio, keyParams);
|
|
182
|
+
}
|
|
183
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
184
|
+
return input;
|
|
185
|
+
}
|
|
186
|
+
const select$1 = function PlaceQuoteOutputRepresentationSelect() {
|
|
187
|
+
return {
|
|
188
|
+
kind: 'Fragment',
|
|
189
|
+
version: VERSION,
|
|
190
|
+
private: [],
|
|
191
|
+
opaque: true
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
function equals(existing, incoming) {
|
|
195
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
function deepFreeze(input) {
|
|
201
|
+
const input_responseError = input.responseError;
|
|
202
|
+
for (let i = 0; i < input_responseError.length; i++) {
|
|
203
|
+
const input_responseError_item = input_responseError[i];
|
|
204
|
+
deepFreeze$1(input_responseError_item);
|
|
205
|
+
}
|
|
206
|
+
ObjectFreeze(input_responseError);
|
|
207
|
+
ObjectFreeze(input);
|
|
208
|
+
}
|
|
209
|
+
const ingest = function PlaceQuoteOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
210
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
211
|
+
const validateError = validate(input);
|
|
212
|
+
if (validateError !== null) {
|
|
213
|
+
throw validateError;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const key = keyBuilderFromType(luvio, input);
|
|
217
|
+
const existingRecord = store.readEntry(key);
|
|
218
|
+
const ttlToUse = TTL;
|
|
219
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
220
|
+
fullPath: key,
|
|
221
|
+
parent: path.parent,
|
|
222
|
+
propertyName: path.propertyName,
|
|
223
|
+
ttl: ttlToUse
|
|
224
|
+
});
|
|
225
|
+
deepFreeze(input);
|
|
226
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
227
|
+
luvio.storePublish(key, incomingRecord);
|
|
228
|
+
}
|
|
229
|
+
{
|
|
230
|
+
const storeMetadataParams = {
|
|
231
|
+
ttl: ttlToUse,
|
|
232
|
+
namespace: "place-quote",
|
|
233
|
+
version: VERSION,
|
|
234
|
+
representationName: RepresentationType,
|
|
235
|
+
};
|
|
236
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
237
|
+
}
|
|
238
|
+
return createLink(key);
|
|
239
|
+
};
|
|
240
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
241
|
+
const rootKeySet = new StoreKeyMap();
|
|
242
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
243
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
244
|
+
rootKeySet.set(rootKey, {
|
|
245
|
+
namespace: keyPrefix,
|
|
246
|
+
representationName: RepresentationType,
|
|
247
|
+
mergeable: false
|
|
248
|
+
});
|
|
249
|
+
return rootKeySet;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function select(luvio, params) {
|
|
253
|
+
return select$1();
|
|
254
|
+
}
|
|
255
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
256
|
+
return getTypeCacheKeys(luvio, response);
|
|
257
|
+
}
|
|
258
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
259
|
+
const { body } = response;
|
|
260
|
+
const key = keyBuilderFromType(luvio, body);
|
|
261
|
+
luvio.storeIngest(key, ingest, body);
|
|
262
|
+
const snapshot = luvio.storeLookup({
|
|
263
|
+
recordId: key,
|
|
264
|
+
node: select(),
|
|
265
|
+
variables: {},
|
|
266
|
+
});
|
|
267
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
268
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
269
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return snapshot;
|
|
273
|
+
}
|
|
274
|
+
function createResourceRequest(config) {
|
|
275
|
+
const headers = {};
|
|
276
|
+
return {
|
|
277
|
+
baseUri: '/services/data/v58.0',
|
|
278
|
+
basePath: '/commerce/quotes/actions/place',
|
|
279
|
+
method: 'post',
|
|
280
|
+
body: config.body,
|
|
281
|
+
urlParams: {},
|
|
282
|
+
queryParams: {},
|
|
283
|
+
headers,
|
|
284
|
+
priority: 'normal',
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const updateQuote_ConfigPropertyNames = {
|
|
289
|
+
displayName: 'updateQuote',
|
|
290
|
+
parameters: {
|
|
291
|
+
required: ['PlaceQuoteInput'],
|
|
292
|
+
optional: []
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
function createResourceParams(config) {
|
|
296
|
+
const resourceParams = {
|
|
297
|
+
body: {
|
|
298
|
+
PlaceQuoteInput: config.PlaceQuoteInput
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
return resourceParams;
|
|
302
|
+
}
|
|
303
|
+
function typeCheckConfig(untrustedConfig) {
|
|
304
|
+
const config = {};
|
|
305
|
+
const untrustedConfig_PlaceQuoteInput = untrustedConfig.PlaceQuoteInput;
|
|
306
|
+
const referencePlaceQuoteInputRepresentationValidationError = validate$2(untrustedConfig_PlaceQuoteInput);
|
|
307
|
+
if (referencePlaceQuoteInputRepresentationValidationError === null) {
|
|
308
|
+
config.PlaceQuoteInput = untrustedConfig_PlaceQuoteInput;
|
|
309
|
+
}
|
|
310
|
+
return config;
|
|
311
|
+
}
|
|
312
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
313
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
317
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
318
|
+
}
|
|
319
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
320
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
return config;
|
|
324
|
+
}
|
|
325
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
326
|
+
const resourceParams = createResourceParams(config);
|
|
327
|
+
const request = createResourceRequest(resourceParams);
|
|
328
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
329
|
+
.then((response) => {
|
|
330
|
+
return luvio.handleSuccessResponse(() => {
|
|
331
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
332
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
333
|
+
}, () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
334
|
+
}, (response) => {
|
|
335
|
+
deepFreeze$2(response);
|
|
336
|
+
throw response;
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
const updateQuoteAdapterFactory = (luvio) => {
|
|
340
|
+
return function updateQuote(untrustedConfig) {
|
|
341
|
+
const config = validateAdapterConfig(untrustedConfig, updateQuote_ConfigPropertyNames);
|
|
342
|
+
// Invalid or incomplete config
|
|
343
|
+
if (config === null) {
|
|
344
|
+
throw new Error('Invalid config for "updateQuote"');
|
|
345
|
+
}
|
|
346
|
+
return buildNetworkSnapshot(luvio, config);
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
let updateQuote;
|
|
351
|
+
function bindExportsTo(luvio) {
|
|
352
|
+
function unwrapSnapshotData(factory) {
|
|
353
|
+
const adapter = factory(luvio);
|
|
354
|
+
return (config) => adapter(config).then(snapshot => snapshot.data);
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
updateQuote: unwrapSnapshotData(updateQuoteAdapterFactory),
|
|
358
|
+
// Imperative GET Adapters
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
withDefaultLuvio((luvio) => {
|
|
362
|
+
({
|
|
363
|
+
updateQuote,
|
|
364
|
+
} = bindExportsTo(luvio));
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
export { updateQuote };
|
|
368
|
+
// version: 0.131.0-c1ec5b7de
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
PlaceQuoteInputWrapperRepresentation: # TODO Hand-rolled W-8334626
|
|
29
|
+
description: Wrapper for place quote input representation
|
|
30
|
+
type: object
|
|
31
|
+
properties:
|
|
32
|
+
PlaceQuoteInput:
|
|
33
|
+
type: PlaceQuoteInputRepresentation
|
|
34
|
+
description: Place Quote Input Representation
|
|
35
|
+
PlaceQuoteInputRepresentation:
|
|
36
|
+
description: Input representation for place quote.
|
|
37
|
+
type: object
|
|
38
|
+
properties:
|
|
39
|
+
graph:
|
|
40
|
+
description: SObject Graph representing the quote structure for place quote
|
|
41
|
+
type: object
|
|
42
|
+
pricingPref:
|
|
43
|
+
description: Pricing Preference for place quote
|
|
44
|
+
type: string
|
|
45
|
+
enum:
|
|
46
|
+
- Force
|
|
47
|
+
- Skip
|
|
48
|
+
- System
|
|
49
|
+
PlaceQuoteOutputRepresentation:
|
|
50
|
+
description: Place Quote output representation
|
|
51
|
+
type: object
|
|
52
|
+
properties:
|
|
53
|
+
quoteId:
|
|
54
|
+
description: QUOTE ID
|
|
55
|
+
type: string
|
|
56
|
+
requestIdentifier:
|
|
57
|
+
description: Unique request identifier that can be used to poll async request
|
|
58
|
+
type: string
|
|
59
|
+
responseError:
|
|
60
|
+
description: response error
|
|
61
|
+
type: array
|
|
62
|
+
items:
|
|
63
|
+
type: PlaceQuoteErrorResponseRepresentation
|
|
64
|
+
statusURL:
|
|
65
|
+
description: a StatusURL for tracking this operation
|
|
66
|
+
type: string
|
|
67
|
+
success:
|
|
68
|
+
description: success
|
|
69
|
+
type: boolean
|
|
70
|
+
PlaceQuoteErrorResponseRepresentation:
|
|
71
|
+
description: Error response representation
|
|
72
|
+
type: object
|
|
73
|
+
properties:
|
|
74
|
+
errorCode:
|
|
75
|
+
description: Code for Error
|
|
76
|
+
type: string
|
|
77
|
+
referenceId:
|
|
78
|
+
description: The Id of where the error lies
|
|
79
|
+
type: string
|
|
80
|
+
message:
|
|
81
|
+
description: Message stating the reason for error, if any
|
|
82
|
+
type: string
|
|
83
|
+
/commerce/quotes/actions/place:
|
|
84
|
+
post:
|
|
85
|
+
description: place quote
|
|
86
|
+
responses:
|
|
87
|
+
'200':
|
|
88
|
+
description: Success
|
|
89
|
+
body:
|
|
90
|
+
application/json:
|
|
91
|
+
type: PlaceQuoteOutputRepresentation
|
|
92
|
+
body:
|
|
93
|
+
application/json:
|
|
94
|
+
type: PlaceQuoteInputWrapperRepresentation
|
|
95
|
+
#required: false # TODO handrolled W-9314597
|
|
96
|
+
(oas-body-name): PlaceQuoteInput
|