@salesforce/lds-adapters-revenue-harmonizebilling 1.273.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-harmonizebilling.js +416 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/postDraftInvoices.d.ts +28 -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 +3 -0
- package/dist/es/es2018/types/src/generated/resources/postCommerceInvoicingInvoicesCollectionActionsPost.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/ErrorResponseRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/InvoiceDraftToPostedInputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/RevenueAsyncRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +66 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +451 -0
- package/src/raml/api.raml +90 -0
- package/src/raml/luvio.raml +21 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
|
+
export declare const VERSION = "264a1ff49230472acfd4ef425c9aa3c3";
|
|
3
|
+
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
4
|
+
export declare const RepresentationType: string;
|
|
5
|
+
export declare function normalize(input: InvoiceDraftToPostedInputRepresentation, existing: InvoiceDraftToPostedInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): InvoiceDraftToPostedInputRepresentationNormalized;
|
|
6
|
+
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
7
|
+
export declare function equals(existing: InvoiceDraftToPostedInputRepresentationNormalized, incoming: InvoiceDraftToPostedInputRepresentationNormalized): boolean;
|
|
8
|
+
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
9
|
+
export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: InvoiceDraftToPostedInputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
|
|
10
|
+
/**
|
|
11
|
+
* Connect API representation for Invoice Draft to Posted api
|
|
12
|
+
*
|
|
13
|
+
* Keys:
|
|
14
|
+
* (none)
|
|
15
|
+
*/
|
|
16
|
+
export interface InvoiceDraftToPostedInputRepresentationNormalized {
|
|
17
|
+
/** Correlation ID */
|
|
18
|
+
correlationId?: string;
|
|
19
|
+
/** List of draft invoices to be posted. */
|
|
20
|
+
invoiceIds: Array<string>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Connect API representation for Invoice Draft to Posted api
|
|
24
|
+
*
|
|
25
|
+
* Keys:
|
|
26
|
+
* (none)
|
|
27
|
+
*/
|
|
28
|
+
export interface InvoiceDraftToPostedInputRepresentation {
|
|
29
|
+
correlationId?: string;
|
|
30
|
+
invoiceIds: Array<string>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ErrorResponseRepresentation as ErrorResponseRepresentation_ErrorResponseRepresentation } from './ErrorResponseRepresentation';
|
|
2
|
+
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
3
|
+
export declare const TTL = 1000;
|
|
4
|
+
export declare const VERSION = "c39f40d590b6aa4fa4327c8ca997c6cc";
|
|
5
|
+
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
6
|
+
export declare const RepresentationType: string;
|
|
7
|
+
export declare function normalize(input: RevenueAsyncRepresentation, existing: RevenueAsyncRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): RevenueAsyncRepresentationNormalized;
|
|
8
|
+
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
9
|
+
export declare function equals(existing: RevenueAsyncRepresentationNormalized, incoming: RevenueAsyncRepresentationNormalized): boolean;
|
|
10
|
+
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
|
+
export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: RevenueAsyncRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
|
|
12
|
+
/**
|
|
13
|
+
* Connect API representation of an async service result
|
|
14
|
+
*
|
|
15
|
+
* Keys:
|
|
16
|
+
* (none)
|
|
17
|
+
*/
|
|
18
|
+
export interface RevenueAsyncRepresentationNormalized {
|
|
19
|
+
/** List of errors */
|
|
20
|
+
errors: Array<ErrorResponseRepresentation_ErrorResponseRepresentation>;
|
|
21
|
+
/** Unique request identifier that can be used to poll async request */
|
|
22
|
+
requestIdentifier: string;
|
|
23
|
+
/** a StatusURL for tracking this operation */
|
|
24
|
+
statusURL?: string;
|
|
25
|
+
/** Flag indicating the overall enqueue status */
|
|
26
|
+
success: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Connect API representation of an async service result
|
|
30
|
+
*
|
|
31
|
+
* Keys:
|
|
32
|
+
* (none)
|
|
33
|
+
*/
|
|
34
|
+
export interface RevenueAsyncRepresentation {
|
|
35
|
+
errors: Array<ErrorResponseRepresentation_ErrorResponseRepresentation>;
|
|
36
|
+
requestIdentifier: string;
|
|
37
|
+
statusURL?: string;
|
|
38
|
+
success: boolean;
|
|
39
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
|
+
export declare const ObjectKeys: {
|
|
3
|
+
(o: object): string[];
|
|
4
|
+
(o: {}): string[];
|
|
5
|
+
}, ObjectCreate: {
|
|
6
|
+
(o: object | null): any;
|
|
7
|
+
(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
|
|
8
|
+
}, ObjectAssign: {
|
|
9
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
10
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
11
|
+
<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;
|
|
12
|
+
(target: object, ...sources: any[]): any;
|
|
13
|
+
};
|
|
14
|
+
export declare const ArrayIsArray: (arg: any) => arg is any[];
|
|
15
|
+
export declare const JSONStringify: {
|
|
16
|
+
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
17
|
+
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
18
|
+
};
|
|
19
|
+
type AllowedPrimitives = boolean | string | number | Date | null;
|
|
20
|
+
type Value<T> = T extends AllowedPrimitives ? T : RecursivePartial<T>;
|
|
21
|
+
export type RecursivePartial<T> = null | {
|
|
22
|
+
[P in keyof T]?: T[P] extends Array<infer U> ? Array<Value<U>> | null : Value<T[P]> | null;
|
|
23
|
+
};
|
|
24
|
+
export declare function equalsArray<U, V extends U[]>(a: V, b: V, equalsItem: (itemA: U, itemB: U) => boolean | void): boolean;
|
|
25
|
+
export declare function equalsObject<U, V extends {
|
|
26
|
+
[key: string]: U;
|
|
27
|
+
}>(a: V, b: V, equalsProp: (propA: U, propB: U) => boolean | void): boolean;
|
|
28
|
+
export declare function createLink(ref: string | $64$luvio_engine_NormalizedKeyMetadata): {
|
|
29
|
+
__ref: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function assignMetadataLink(entry: any, metadataKey: string | $64$luvio_engine_NormalizedKeyMetadata): void;
|
|
32
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@salesforce/lds-adapters-revenue-harmonizebilling",
|
|
3
|
+
"version": "1.273.0",
|
|
4
|
+
"description": "Harmonize Billing APIs",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
|
+
"main": "dist/es/es2018/revenue-harmonizebilling.js",
|
|
7
|
+
"module": "dist/es/es2018/revenue-harmonizebilling.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
|
+
"types": "./dist/es/es2018/types/src/generated/artifacts/main.d.ts",
|
|
17
|
+
"import": "./dist/es/es2018/revenue-harmonizebilling.js",
|
|
18
|
+
"require": "./dist/es/es2018/revenue-harmonizebilling.js"
|
|
19
|
+
},
|
|
20
|
+
"./sfdc": {
|
|
21
|
+
"types": "./sfdc/index.d.ts",
|
|
22
|
+
"import": "./sfdc/index.js",
|
|
23
|
+
"default": "./sfdc/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"sfdc": {
|
|
27
|
+
"namespace": "lightning",
|
|
28
|
+
"module": "revenueHarmonizebillingApi"
|
|
29
|
+
},
|
|
30
|
+
"contributors": [
|
|
31
|
+
"rev-nebula-scrum@salesforce.com"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "yarn build:services",
|
|
35
|
+
"build:raml": "luvio generate src/raml/luvio.raml src/generated -p '../lds-compiler-plugins'",
|
|
36
|
+
"build:services": "rollup --bundleConfigAsCjs --config rollup.config.js",
|
|
37
|
+
"clean": "rm -rf dist sfdc src/generated",
|
|
38
|
+
"release:core": "../../scripts/release/core.js --adapter=lds-adapters-revenue-harmonizebilling",
|
|
39
|
+
"release:corejar": "yarn build && ../core-build/scripts/core.js --adapter=lds-adapters-revenue-harmonizebilling",
|
|
40
|
+
"test:unit": "jest"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@salesforce/lds-bindings": "^1.273.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@salesforce/lds-compiler-plugins": "^1.273.0"
|
|
47
|
+
},
|
|
48
|
+
"nx": {
|
|
49
|
+
"targets": {
|
|
50
|
+
"build": {
|
|
51
|
+
"outputs": [
|
|
52
|
+
"{projectRoot}/dist",
|
|
53
|
+
"{projectRoot}/sfdc"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"build:raml": {
|
|
57
|
+
"outputs": [
|
|
58
|
+
"{projectRoot}/src/generated"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"volta": {
|
|
64
|
+
"extends": "../../package.json"
|
|
65
|
+
}
|
|
66
|
+
}
|
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,451 @@
|
|
|
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, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys, create: ObjectCreate } = 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(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 = 'HarmonizeBilling';
|
|
83
|
+
|
|
84
|
+
const { isArray: ArrayIsArray } = Array;
|
|
85
|
+
function equalsArray(a, b, equalsItem) {
|
|
86
|
+
const aLength = a.length;
|
|
87
|
+
const bLength = b.length;
|
|
88
|
+
if (aLength !== bLength) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
for (let i = 0; i < aLength; i++) {
|
|
92
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
function createLink(ref) {
|
|
99
|
+
return {
|
|
100
|
+
__ref: serializeStructuredKey(ref),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const VERSION$1 = "87ee05ce3f88ad0a2dc442b213bfc776";
|
|
105
|
+
function validate$1(obj, path = 'ErrorResponseRepresentation') {
|
|
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
|
+
const obj_errorCode = obj.errorCode;
|
|
111
|
+
const path_errorCode = path + '.errorCode';
|
|
112
|
+
if (typeof obj_errorCode !== 'string') {
|
|
113
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
|
|
114
|
+
}
|
|
115
|
+
const obj_message = obj.message;
|
|
116
|
+
const path_message = path + '.message';
|
|
117
|
+
if (typeof obj_message !== 'string') {
|
|
118
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
119
|
+
}
|
|
120
|
+
})();
|
|
121
|
+
return v_error === undefined ? null : v_error;
|
|
122
|
+
}
|
|
123
|
+
const select$2 = function ErrorResponseRepresentationSelect() {
|
|
124
|
+
return {
|
|
125
|
+
kind: 'Fragment',
|
|
126
|
+
version: VERSION$1,
|
|
127
|
+
private: [],
|
|
128
|
+
selections: [
|
|
129
|
+
{
|
|
130
|
+
name: 'errorCode',
|
|
131
|
+
kind: 'Scalar'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'message',
|
|
135
|
+
kind: 'Scalar'
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
function equals$1(existing, incoming) {
|
|
141
|
+
const existing_errorCode = existing.errorCode;
|
|
142
|
+
const incoming_errorCode = incoming.errorCode;
|
|
143
|
+
if (!(existing_errorCode === incoming_errorCode)) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
const existing_message = existing.message;
|
|
147
|
+
const incoming_message = incoming.message;
|
|
148
|
+
if (!(existing_message === incoming_message)) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const TTL = 1000;
|
|
155
|
+
const VERSION = "c39f40d590b6aa4fa4327c8ca997c6cc";
|
|
156
|
+
function validate(obj, path = 'RevenueAsyncRepresentation') {
|
|
157
|
+
const v_error = (() => {
|
|
158
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
159
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
160
|
+
}
|
|
161
|
+
const obj_errors = obj.errors;
|
|
162
|
+
const path_errors = path + '.errors';
|
|
163
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
164
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
165
|
+
}
|
|
166
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
167
|
+
const obj_errors_item = obj_errors[i];
|
|
168
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
169
|
+
const referencepath_errors_itemValidationError = validate$1(obj_errors_item, path_errors_item);
|
|
170
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
171
|
+
let message = 'Object doesn\'t match ErrorResponseRepresentation (at "' + path_errors_item + '")\n';
|
|
172
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
173
|
+
return new TypeError(message);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const obj_requestIdentifier = obj.requestIdentifier;
|
|
177
|
+
const path_requestIdentifier = path + '.requestIdentifier';
|
|
178
|
+
if (typeof obj_requestIdentifier !== 'string') {
|
|
179
|
+
return new TypeError('Expected "string" but received "' + typeof obj_requestIdentifier + '" (at "' + path_requestIdentifier + '")');
|
|
180
|
+
}
|
|
181
|
+
if (obj.statusURL !== undefined) {
|
|
182
|
+
const obj_statusURL = obj.statusURL;
|
|
183
|
+
const path_statusURL = path + '.statusURL';
|
|
184
|
+
if (typeof obj_statusURL !== 'string') {
|
|
185
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statusURL + '" (at "' + path_statusURL + '")');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
const obj_success = obj.success;
|
|
189
|
+
const path_success = path + '.success';
|
|
190
|
+
if (typeof obj_success !== 'boolean') {
|
|
191
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
192
|
+
}
|
|
193
|
+
})();
|
|
194
|
+
return v_error === undefined ? null : v_error;
|
|
195
|
+
}
|
|
196
|
+
const RepresentationType = 'RevenueAsyncRepresentation';
|
|
197
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
198
|
+
return input;
|
|
199
|
+
}
|
|
200
|
+
const select$1 = function RevenueAsyncRepresentationSelect() {
|
|
201
|
+
const { selections: ErrorResponseRepresentation__selections, opaque: ErrorResponseRepresentation__opaque, } = select$2();
|
|
202
|
+
return {
|
|
203
|
+
kind: 'Fragment',
|
|
204
|
+
version: VERSION,
|
|
205
|
+
private: [],
|
|
206
|
+
selections: [
|
|
207
|
+
{
|
|
208
|
+
name: 'errors',
|
|
209
|
+
kind: 'Object',
|
|
210
|
+
plural: true,
|
|
211
|
+
selections: ErrorResponseRepresentation__selections
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'requestIdentifier',
|
|
215
|
+
kind: 'Scalar'
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'statusURL',
|
|
219
|
+
kind: 'Scalar',
|
|
220
|
+
required: false
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: 'success',
|
|
224
|
+
kind: 'Scalar'
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
function equals(existing, incoming) {
|
|
230
|
+
const existing_success = existing.success;
|
|
231
|
+
const incoming_success = incoming.success;
|
|
232
|
+
if (!(existing_success === incoming_success)) {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
const existing_requestIdentifier = existing.requestIdentifier;
|
|
236
|
+
const incoming_requestIdentifier = incoming.requestIdentifier;
|
|
237
|
+
if (!(existing_requestIdentifier === incoming_requestIdentifier)) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
const existing_statusURL = existing.statusURL;
|
|
241
|
+
const incoming_statusURL = incoming.statusURL;
|
|
242
|
+
// if at least one of these optionals is defined
|
|
243
|
+
if (existing_statusURL !== undefined || incoming_statusURL !== undefined) {
|
|
244
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
245
|
+
// not equal
|
|
246
|
+
if (existing_statusURL === undefined || incoming_statusURL === undefined) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
if (!(existing_statusURL === incoming_statusURL)) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
const existing_errors = existing.errors;
|
|
254
|
+
const incoming_errors = incoming.errors;
|
|
255
|
+
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
256
|
+
if (!(equals$1(existing_errors_item, incoming_errors_item))) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
if (equals_errors_items === false) {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
return true;
|
|
264
|
+
}
|
|
265
|
+
const ingest = function RevenueAsyncRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
266
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
267
|
+
const validateError = validate(input);
|
|
268
|
+
if (validateError !== null) {
|
|
269
|
+
throw validateError;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
const key = path.fullPath;
|
|
273
|
+
const ttlToUse = TTL;
|
|
274
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "HarmonizeBilling", VERSION, RepresentationType, equals);
|
|
275
|
+
return createLink(key);
|
|
276
|
+
};
|
|
277
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
278
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
279
|
+
const rootKey = fullPathFactory();
|
|
280
|
+
rootKeySet.set(rootKey, {
|
|
281
|
+
namespace: keyPrefix,
|
|
282
|
+
representationName: RepresentationType,
|
|
283
|
+
mergeable: false
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function select(luvio, params) {
|
|
288
|
+
return select$1();
|
|
289
|
+
}
|
|
290
|
+
function keyBuilder$1(luvio, params) {
|
|
291
|
+
return keyPrefix + '::RevenueAsyncRepresentation:(' + (params.body.correlationId === undefined ? 'correlationId' : 'correlationId:' + params.body.correlationId) + '::' + 'invoiceIds:' + params.body.invoiceIds + ')';
|
|
292
|
+
}
|
|
293
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
294
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
295
|
+
}
|
|
296
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
297
|
+
const { body } = response;
|
|
298
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
299
|
+
luvio.storeIngest(key, ingest, body);
|
|
300
|
+
const snapshot = luvio.storeLookup({
|
|
301
|
+
recordId: key,
|
|
302
|
+
node: select(),
|
|
303
|
+
variables: {},
|
|
304
|
+
}, snapshotRefresh);
|
|
305
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
306
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
307
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
deepFreeze(snapshot.data);
|
|
311
|
+
return snapshot;
|
|
312
|
+
}
|
|
313
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
314
|
+
const key = keyBuilder$1(luvio, params);
|
|
315
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
316
|
+
const storeMetadataParams = {
|
|
317
|
+
ttl: TTL,
|
|
318
|
+
namespace: keyPrefix,
|
|
319
|
+
version: VERSION,
|
|
320
|
+
representationName: RepresentationType
|
|
321
|
+
};
|
|
322
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
323
|
+
return errorSnapshot;
|
|
324
|
+
}
|
|
325
|
+
function createResourceRequest(config) {
|
|
326
|
+
const headers = {};
|
|
327
|
+
return {
|
|
328
|
+
baseUri: '/services/data/v61.0',
|
|
329
|
+
basePath: '/commerce/invoicing/invoices/collection/actions/post',
|
|
330
|
+
method: 'post',
|
|
331
|
+
body: config.body,
|
|
332
|
+
urlParams: {},
|
|
333
|
+
queryParams: {},
|
|
334
|
+
headers,
|
|
335
|
+
priority: 'normal',
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const adapterName = 'postDraftInvoices';
|
|
340
|
+
const postDraftInvoices_ConfigPropertyMetadata = [
|
|
341
|
+
generateParamConfigMetadata('correlationId', false, 2 /* Body */, 0 /* String */),
|
|
342
|
+
generateParamConfigMetadata('invoiceIds', true, 2 /* Body */, 0 /* String */, true),
|
|
343
|
+
];
|
|
344
|
+
const postDraftInvoices_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postDraftInvoices_ConfigPropertyMetadata);
|
|
345
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$1(postDraftInvoices_ConfigPropertyMetadata);
|
|
346
|
+
function keyBuilder(luvio, config) {
|
|
347
|
+
const resourceParams = createResourceParams(config);
|
|
348
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
349
|
+
}
|
|
350
|
+
function typeCheckConfig(untrustedConfig) {
|
|
351
|
+
const config = {};
|
|
352
|
+
typeCheckConfig$1(untrustedConfig, config, postDraftInvoices_ConfigPropertyMetadata);
|
|
353
|
+
return config;
|
|
354
|
+
}
|
|
355
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
356
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
360
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
361
|
+
}
|
|
362
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
363
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
return config;
|
|
367
|
+
}
|
|
368
|
+
function adapterFragment(luvio, config) {
|
|
369
|
+
createResourceParams(config);
|
|
370
|
+
return select();
|
|
371
|
+
}
|
|
372
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
373
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
374
|
+
config,
|
|
375
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
376
|
+
});
|
|
377
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
378
|
+
}
|
|
379
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
380
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
381
|
+
config,
|
|
382
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
383
|
+
});
|
|
384
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
385
|
+
}
|
|
386
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
387
|
+
const resourceParams = createResourceParams(config);
|
|
388
|
+
const request = createResourceRequest(resourceParams);
|
|
389
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
390
|
+
.then((response) => {
|
|
391
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
392
|
+
const cache = new StoreKeyMap();
|
|
393
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
394
|
+
return cache;
|
|
395
|
+
});
|
|
396
|
+
}, (response) => {
|
|
397
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
401
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
|
|
402
|
+
}
|
|
403
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
404
|
+
const { luvio, config } = context;
|
|
405
|
+
const selector = {
|
|
406
|
+
recordId: keyBuilder(luvio, config),
|
|
407
|
+
node: adapterFragment(luvio, config),
|
|
408
|
+
variables: {},
|
|
409
|
+
};
|
|
410
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
411
|
+
config,
|
|
412
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
413
|
+
});
|
|
414
|
+
return cacheSnapshot;
|
|
415
|
+
}
|
|
416
|
+
const postDraftInvoicesAdapterFactory = (luvio) => function HarmonizeBilling__postDraftInvoices(untrustedConfig, requestContext) {
|
|
417
|
+
const config = validateAdapterConfig(untrustedConfig, postDraftInvoices_ConfigPropertyNames);
|
|
418
|
+
// Invalid or incomplete config
|
|
419
|
+
if (config === null) {
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
423
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
let postDraftInvoices;
|
|
427
|
+
// Imperative GET Adapters
|
|
428
|
+
let postDraftInvoices_imperative;
|
|
429
|
+
// Adapter Metadata
|
|
430
|
+
const postDraftInvoicesMetadata = {
|
|
431
|
+
apiFamily: 'HarmonizeBilling',
|
|
432
|
+
name: 'postDraftInvoices',
|
|
433
|
+
ttl: 1000,
|
|
434
|
+
};
|
|
435
|
+
// Notify Update Available
|
|
436
|
+
function bindExportsTo(luvio) {
|
|
437
|
+
// LDS Adapters
|
|
438
|
+
const postDraftInvoices_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'postDraftInvoices', postDraftInvoicesAdapterFactory), postDraftInvoicesMetadata);
|
|
439
|
+
return {
|
|
440
|
+
postDraftInvoices: createWireAdapterConstructor(luvio, postDraftInvoices_ldsAdapter, postDraftInvoicesMetadata),
|
|
441
|
+
// Imperative GET Adapters
|
|
442
|
+
postDraftInvoices_imperative: createImperativeAdapter(luvio, postDraftInvoices_ldsAdapter, postDraftInvoicesMetadata),
|
|
443
|
+
// Notify Update Availables
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
withDefaultLuvio((luvio) => {
|
|
447
|
+
({ postDraftInvoices, postDraftInvoices_imperative } = bindExportsTo(luvio));
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
export { postDraftInvoices, postDraftInvoices_imperative };
|
|
451
|
+
// version: 1.273.0-daa4f720d
|