@salesforce/lds-adapters-industries-documentmatrix 0.1.0-dev1

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.
@@ -0,0 +1,28 @@
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 = "8cb5e7eceb053c1f1a4cd0fd01b94bef";
3
+ export declare function validate(obj: any, path?: string): TypeError | null;
4
+ export declare const RepresentationType: string;
5
+ export declare function normalize(input: DocumentDecisionInputRepresentation, existing: DocumentDecisionInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): DocumentDecisionInputRepresentationNormalized;
6
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
7
+ export declare function equals(existing: DocumentDecisionInputRepresentationNormalized, incoming: DocumentDecisionInputRepresentationNormalized): 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: DocumentDecisionInputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
10
+ /**
11
+ * Input representation for the connect api
12
+ *
13
+ * Keys:
14
+ * (none)
15
+ */
16
+ export interface DocumentDecisionInputRepresentationNormalized {
17
+ /** List of inputs passed to Decision Table. The key should contain field name of Decision table and value should contain value of the field that is the key. An input may contain multiple fields. */
18
+ inputs: unknown;
19
+ }
20
+ /**
21
+ * Input representation for the connect api
22
+ *
23
+ * Keys:
24
+ * (none)
25
+ */
26
+ export interface DocumentDecisionInputRepresentation {
27
+ inputs: unknown;
28
+ }
@@ -0,0 +1,36 @@
1
+ import { DecisionTableDocumentDecisionRepresentation as DecisionTableDocumentDecisionRepresentation_DecisionTableDocumentDecisionRepresentation } from './DecisionTableDocumentDecisionRepresentation';
2
+ import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, BaseFragment as $64$luvio_engine_BaseFragment, 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 = 300;
4
+ export declare const VERSION = "6bd68bfab828ce0f9e1f82bd1920e04d";
5
+ export declare function validate(obj: any, path?: string): TypeError | null;
6
+ export declare const RepresentationType: string;
7
+ export declare function normalize(input: DocumentDecisionResponseRepresentation, existing: DocumentDecisionResponseRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): DocumentDecisionResponseRepresentationNormalized;
8
+ export declare const select: () => $64$luvio_engine_BaseFragment;
9
+ export declare function equals(existing: DocumentDecisionResponseRepresentationNormalized, incoming: DocumentDecisionResponseRepresentationNormalized): 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: DocumentDecisionResponseRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
12
+ /**
13
+ * Output representation of Document Matrix Decision
14
+ *
15
+ * Keys:
16
+ * (none)
17
+ */
18
+ export interface DocumentDecisionResponseRepresentationNormalized {
19
+ /** The flat data of Decision Table Output. */
20
+ decisionTableDocumentDecisions: Array<DecisionTableDocumentDecisionRepresentation_DecisionTableDocumentDecisionRepresentation>;
21
+ /** The message explaining why the request failed. */
22
+ message: string;
23
+ /** Indicates whether the request succeeded (true) or failed (false). */
24
+ status: string;
25
+ }
26
+ /**
27
+ * Output representation of Document Matrix Decision
28
+ *
29
+ * Keys:
30
+ * (none)
31
+ */
32
+ export interface DocumentDecisionResponseRepresentation {
33
+ decisionTableDocumentDecisions: Array<DecisionTableDocumentDecisionRepresentation_DecisionTableDocumentDecisionRepresentation>;
34
+ message: string;
35
+ status: string;
36
+ }
@@ -0,0 +1,37 @@
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 = "add8a5d32573407b3829466076c1cb90";
3
+ export declare function validate(obj: any, path?: string): TypeError | null;
4
+ export declare const RepresentationType: string;
5
+ export declare function normalize(input: DocumentTypesRepresentation, existing: DocumentTypesRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): DocumentTypesRepresentationNormalized;
6
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
7
+ export declare function equals(existing: DocumentTypesRepresentationNormalized, incoming: DocumentTypesRepresentationNormalized): 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: DocumentTypesRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
10
+ /**
11
+ * Output representation of Document Type
12
+ *
13
+ * Keys:
14
+ * (none)
15
+ */
16
+ export interface DocumentTypesRepresentationNormalized {
17
+ /** The Id of Document Type that is associated with document category */
18
+ documentTypeId: string;
19
+ /** The label of Document Type that is associated with document category */
20
+ documentTypeLabel: string;
21
+ /** Maximum file size in KBs for a file that can be uploaded for a document type */
22
+ maximumFileSizeAllowed: string;
23
+ /** Maximum file uploads that can be uploaded for a document type */
24
+ maximumFileUploadsAllowed: string;
25
+ }
26
+ /**
27
+ * Output representation of Document Type
28
+ *
29
+ * Keys:
30
+ * (none)
31
+ */
32
+ export interface DocumentTypesRepresentation {
33
+ documentTypeId: string;
34
+ documentTypeLabel: string;
35
+ maximumFileSizeAllowed: string;
36
+ maximumFileUploadsAllowed: string;
37
+ }
@@ -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,74 @@
1
+ {
2
+ "name": "@salesforce/lds-adapters-industries-documentmatrix",
3
+ "version": "0.1.0-dev1",
4
+ "description": "Document Matrix component is a custom OS element by Discovery Framework. It is an out-of-box solution that removes the need for Admins to create multiple Assessments with the same set of questions but with a different set of files to upload at the end.",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "main": "dist/es/es2018/industries-documentmatrix.js",
7
+ "module": "dist/es/es2018/industries-documentmatrix.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/industries-documentmatrix.js",
18
+ "require": "./dist/es/es2018/industries-documentmatrix.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": "industriesDocumentmatrixApi"
29
+ },
30
+ "contributors": [
31
+ "gkandpal@salesforce.com"
32
+ ],
33
+ "scripts": {
34
+ "build": "yarn build:services",
35
+ "build:karma": "rollup --bundleConfigAsCjs --config rollup.config.karma.js",
36
+ "build:raml": "luvio generate src/raml/luvio.raml src/generated -p '../lds-compiler-plugins'",
37
+ "build:services": "rollup --bundleConfigAsCjs --config rollup.config.js",
38
+ "clean": "rm -rf dist sfdc src/generated karma/dist",
39
+ "release:core": "../../scripts/release/core.js --adapter=lds-adapters-industries-documentmatrix",
40
+ "release:corejar": "yarn build && ../core-build/scripts/core.js --adapter=lds-adapters-industries-documentmatrix",
41
+ "start": "nx build:karma && karma start",
42
+ "test": "nx build:karma && karma start --single-run"
43
+ },
44
+ "dependencies": {
45
+ "@salesforce/lds-bindings": "^0.1.0-dev1"
46
+ },
47
+ "devDependencies": {
48
+ "@salesforce/lds-compiler-plugins": "^0.1.0-dev1",
49
+ "@salesforce/lds-karma": "^0.1.0-dev1"
50
+ },
51
+ "nx": {
52
+ "targets": {
53
+ "build": {
54
+ "outputs": [
55
+ "{projectRoot}/dist",
56
+ "{projectRoot}/sfdc"
57
+ ]
58
+ },
59
+ "build:raml": {
60
+ "outputs": [
61
+ "{projectRoot}/src/generated"
62
+ ]
63
+ },
64
+ "build:karma": {
65
+ "outputs": [
66
+ "{projectRoot}/karma/dist"
67
+ ]
68
+ }
69
+ }
70
+ },
71
+ "volta": {
72
+ "extends": "../../package.json"
73
+ }
74
+ }
@@ -0,0 +1 @@
1
+ export * from '../dist/es/es2018/types/src/generated/artifacts/sfdc';
package/sfdc/index.js ADDED
@@ -0,0 +1,416 @@
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 = 'DocumentMatrix';
83
+
84
+ const { isArray: ArrayIsArray } = Array;
85
+ const { stringify: JSONStringify } = JSON;
86
+ function createLink(ref) {
87
+ return {
88
+ __ref: serializeStructuredKey(ref),
89
+ };
90
+ }
91
+
92
+ function validate$2(obj, path = 'DocumentTypesRepresentation') {
93
+ const v_error = (() => {
94
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
95
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
96
+ }
97
+ const obj_documentTypeId = obj.documentTypeId;
98
+ const path_documentTypeId = path + '.documentTypeId';
99
+ if (typeof obj_documentTypeId !== 'string') {
100
+ return new TypeError('Expected "string" but received "' + typeof obj_documentTypeId + '" (at "' + path_documentTypeId + '")');
101
+ }
102
+ const obj_documentTypeLabel = obj.documentTypeLabel;
103
+ const path_documentTypeLabel = path + '.documentTypeLabel';
104
+ if (typeof obj_documentTypeLabel !== 'string') {
105
+ return new TypeError('Expected "string" but received "' + typeof obj_documentTypeLabel + '" (at "' + path_documentTypeLabel + '")');
106
+ }
107
+ const obj_maximumFileSizeAllowed = obj.maximumFileSizeAllowed;
108
+ const path_maximumFileSizeAllowed = path + '.maximumFileSizeAllowed';
109
+ if (typeof obj_maximumFileSizeAllowed !== 'string') {
110
+ return new TypeError('Expected "string" but received "' + typeof obj_maximumFileSizeAllowed + '" (at "' + path_maximumFileSizeAllowed + '")');
111
+ }
112
+ const obj_maximumFileUploadsAllowed = obj.maximumFileUploadsAllowed;
113
+ const path_maximumFileUploadsAllowed = path + '.maximumFileUploadsAllowed';
114
+ if (typeof obj_maximumFileUploadsAllowed !== 'string') {
115
+ return new TypeError('Expected "string" but received "' + typeof obj_maximumFileUploadsAllowed + '" (at "' + path_maximumFileUploadsAllowed + '")');
116
+ }
117
+ })();
118
+ return v_error === undefined ? null : v_error;
119
+ }
120
+
121
+ function validate$1(obj, path = 'DecisionTableDocumentDecisionRepresentation') {
122
+ const v_error = (() => {
123
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
124
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
125
+ }
126
+ const obj_defaultMaximumFileSizeAllowed = obj.defaultMaximumFileSizeAllowed;
127
+ const path_defaultMaximumFileSizeAllowed = path + '.defaultMaximumFileSizeAllowed';
128
+ if (typeof obj_defaultMaximumFileSizeAllowed !== 'string') {
129
+ return new TypeError('Expected "string" but received "' + typeof obj_defaultMaximumFileSizeAllowed + '" (at "' + path_defaultMaximumFileSizeAllowed + '")');
130
+ }
131
+ const obj_defaultMaximumFileUploadsAllowed = obj.defaultMaximumFileUploadsAllowed;
132
+ const path_defaultMaximumFileUploadsAllowed = path + '.defaultMaximumFileUploadsAllowed';
133
+ if (typeof obj_defaultMaximumFileUploadsAllowed !== 'string') {
134
+ return new TypeError('Expected "string" but received "' + typeof obj_defaultMaximumFileUploadsAllowed + '" (at "' + path_defaultMaximumFileUploadsAllowed + '")');
135
+ }
136
+ const obj_documentCategoryId = obj.documentCategoryId;
137
+ const path_documentCategoryId = path + '.documentCategoryId';
138
+ if (typeof obj_documentCategoryId !== 'string') {
139
+ return new TypeError('Expected "string" but received "' + typeof obj_documentCategoryId + '" (at "' + path_documentCategoryId + '")');
140
+ }
141
+ const obj_documentCategoryLabel = obj.documentCategoryLabel;
142
+ const path_documentCategoryLabel = path + '.documentCategoryLabel';
143
+ if (typeof obj_documentCategoryLabel !== 'string') {
144
+ return new TypeError('Expected "string" but received "' + typeof obj_documentCategoryLabel + '" (at "' + path_documentCategoryLabel + '")');
145
+ }
146
+ const obj_documentTypes = obj.documentTypes;
147
+ const path_documentTypes = path + '.documentTypes';
148
+ if (!ArrayIsArray(obj_documentTypes)) {
149
+ return new TypeError('Expected "array" but received "' + typeof obj_documentTypes + '" (at "' + path_documentTypes + '")');
150
+ }
151
+ for (let i = 0; i < obj_documentTypes.length; i++) {
152
+ const obj_documentTypes_item = obj_documentTypes[i];
153
+ const path_documentTypes_item = path_documentTypes + '[' + i + ']';
154
+ const referencepath_documentTypes_itemValidationError = validate$2(obj_documentTypes_item, path_documentTypes_item);
155
+ if (referencepath_documentTypes_itemValidationError !== null) {
156
+ let message = 'Object doesn\'t match DocumentTypesRepresentation (at "' + path_documentTypes_item + '")\n';
157
+ message += referencepath_documentTypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
158
+ return new TypeError(message);
159
+ }
160
+ }
161
+ const obj_helpText = obj.helpText;
162
+ const path_helpText = path + '.helpText';
163
+ if (typeof obj_helpText !== 'string') {
164
+ return new TypeError('Expected "string" but received "' + typeof obj_helpText + '" (at "' + path_helpText + '")');
165
+ }
166
+ const obj_isRequired = obj.isRequired;
167
+ const path_isRequired = path + '.isRequired';
168
+ if (typeof obj_isRequired !== 'boolean') {
169
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isRequired + '" (at "' + path_isRequired + '")');
170
+ }
171
+ })();
172
+ return v_error === undefined ? null : v_error;
173
+ }
174
+
175
+ const TTL = 300;
176
+ const VERSION = "6bd68bfab828ce0f9e1f82bd1920e04d";
177
+ function validate(obj, path = 'DocumentDecisionResponseRepresentation') {
178
+ const v_error = (() => {
179
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
180
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
181
+ }
182
+ const obj_decisionTableDocumentDecisions = obj.decisionTableDocumentDecisions;
183
+ const path_decisionTableDocumentDecisions = path + '.decisionTableDocumentDecisions';
184
+ if (!ArrayIsArray(obj_decisionTableDocumentDecisions)) {
185
+ return new TypeError('Expected "array" but received "' + typeof obj_decisionTableDocumentDecisions + '" (at "' + path_decisionTableDocumentDecisions + '")');
186
+ }
187
+ for (let i = 0; i < obj_decisionTableDocumentDecisions.length; i++) {
188
+ const obj_decisionTableDocumentDecisions_item = obj_decisionTableDocumentDecisions[i];
189
+ const path_decisionTableDocumentDecisions_item = path_decisionTableDocumentDecisions + '[' + i + ']';
190
+ const referencepath_decisionTableDocumentDecisions_itemValidationError = validate$1(obj_decisionTableDocumentDecisions_item, path_decisionTableDocumentDecisions_item);
191
+ if (referencepath_decisionTableDocumentDecisions_itemValidationError !== null) {
192
+ let message = 'Object doesn\'t match DecisionTableDocumentDecisionRepresentation (at "' + path_decisionTableDocumentDecisions_item + '")\n';
193
+ message += referencepath_decisionTableDocumentDecisions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
194
+ return new TypeError(message);
195
+ }
196
+ }
197
+ const obj_message = obj.message;
198
+ const path_message = path + '.message';
199
+ if (typeof obj_message !== 'string') {
200
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
201
+ }
202
+ const obj_status = obj.status;
203
+ const path_status = path + '.status';
204
+ if (typeof obj_status !== 'string') {
205
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
206
+ }
207
+ })();
208
+ return v_error === undefined ? null : v_error;
209
+ }
210
+ const RepresentationType = 'DocumentDecisionResponseRepresentation';
211
+ function normalize(input, existing, path, luvio, store, timestamp) {
212
+ return input;
213
+ }
214
+ const select$1 = function DocumentDecisionResponseRepresentationSelect() {
215
+ return {
216
+ kind: 'Fragment',
217
+ version: VERSION,
218
+ private: [],
219
+ opaque: true
220
+ };
221
+ };
222
+ function equals(existing, incoming) {
223
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
224
+ return false;
225
+ }
226
+ return true;
227
+ }
228
+ const ingest = function DocumentDecisionResponseRepresentationIngest(input, path, luvio, store, timestamp) {
229
+ if (process.env.NODE_ENV !== 'production') {
230
+ const validateError = validate(input);
231
+ if (validateError !== null) {
232
+ throw validateError;
233
+ }
234
+ }
235
+ const key = path.fullPath;
236
+ const ttlToUse = TTL;
237
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "DocumentMatrix", VERSION, RepresentationType, equals);
238
+ return createLink(key);
239
+ };
240
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
241
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
242
+ const rootKey = fullPathFactory();
243
+ rootKeySet.set(rootKey, {
244
+ namespace: keyPrefix,
245
+ representationName: RepresentationType,
246
+ mergeable: false
247
+ });
248
+ }
249
+
250
+ function select(luvio, params) {
251
+ return select$1();
252
+ }
253
+ function keyBuilder$1(luvio, params) {
254
+ return keyPrefix + '::DocumentDecisionResponseRepresentation:(' + 'decisionTableId:' + params.urlParams.decisionTableId + ',' + 'inputs:' + params.body.inputs + ')';
255
+ }
256
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
257
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
258
+ }
259
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
260
+ const { body } = response;
261
+ const key = keyBuilder$1(luvio, resourceParams);
262
+ luvio.storeIngest(key, ingest, body);
263
+ const snapshot = luvio.storeLookup({
264
+ recordId: key,
265
+ node: select(),
266
+ variables: {},
267
+ }, snapshotRefresh);
268
+ if (process.env.NODE_ENV !== 'production') {
269
+ if (snapshot.state !== 'Fulfilled') {
270
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
271
+ }
272
+ }
273
+ deepFreeze(snapshot.data);
274
+ return snapshot;
275
+ }
276
+ function ingestError(luvio, params, error, snapshotRefresh) {
277
+ const key = keyBuilder$1(luvio, params);
278
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
279
+ const storeMetadataParams = {
280
+ ttl: TTL,
281
+ namespace: keyPrefix,
282
+ version: VERSION,
283
+ representationName: RepresentationType
284
+ };
285
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
286
+ return errorSnapshot;
287
+ }
288
+ function createResourceRequest(config) {
289
+ const headers = {};
290
+ return {
291
+ baseUri: '/services/data/v66.0',
292
+ basePath: '/connect/document-matrix/document-decision/' + config.urlParams.decisionTableId + '',
293
+ method: 'post',
294
+ body: config.body,
295
+ urlParams: config.urlParams,
296
+ queryParams: {},
297
+ headers,
298
+ priority: 'normal',
299
+ };
300
+ }
301
+
302
+ const adapterName = 'getDocumentDecision';
303
+ const getDocumentDecision_ConfigPropertyMetadata = [
304
+ generateParamConfigMetadata('decisionTableId', true, 0 /* UrlParameter */, 0 /* String */),
305
+ generateParamConfigMetadata('inputs', true, 2 /* Body */, 4 /* Unsupported */),
306
+ ];
307
+ const getDocumentDecision_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getDocumentDecision_ConfigPropertyMetadata);
308
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(getDocumentDecision_ConfigPropertyMetadata);
309
+ function keyBuilder(luvio, config) {
310
+ const resourceParams = createResourceParams(config);
311
+ return keyBuilder$1(luvio, resourceParams);
312
+ }
313
+ function typeCheckConfig(untrustedConfig) {
314
+ const config = {};
315
+ typeCheckConfig$1(untrustedConfig, config, getDocumentDecision_ConfigPropertyMetadata);
316
+ const untrustedConfig_inputs = untrustedConfig.inputs;
317
+ config.inputs = untrustedConfig_inputs;
318
+ return config;
319
+ }
320
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
321
+ if (!untrustedIsObject(untrustedConfig)) {
322
+ return null;
323
+ }
324
+ if (process.env.NODE_ENV !== 'production') {
325
+ validateConfig(untrustedConfig, configPropertyNames);
326
+ }
327
+ const config = typeCheckConfig(untrustedConfig);
328
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
329
+ return null;
330
+ }
331
+ return config;
332
+ }
333
+ function adapterFragment(luvio, config) {
334
+ createResourceParams(config);
335
+ return select();
336
+ }
337
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
338
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
339
+ config,
340
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
341
+ });
342
+ return luvio.storeBroadcast().then(() => snapshot);
343
+ }
344
+ function onFetchResponseError(luvio, config, resourceParams, response) {
345
+ const snapshot = ingestError(luvio, resourceParams, response, {
346
+ config,
347
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
348
+ });
349
+ return luvio.storeBroadcast().then(() => snapshot);
350
+ }
351
+ function buildNetworkSnapshot(luvio, config, options) {
352
+ const resourceParams = createResourceParams(config);
353
+ const request = createResourceRequest(resourceParams);
354
+ return luvio.dispatchResourceRequest(request, options)
355
+ .then((response) => {
356
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
357
+ const cache = new StoreKeyMap();
358
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
359
+ return cache;
360
+ });
361
+ }, (response) => {
362
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
363
+ });
364
+ }
365
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
366
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
367
+ }
368
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
369
+ const { luvio, config } = context;
370
+ const selector = {
371
+ recordId: keyBuilder(luvio, config),
372
+ node: adapterFragment(luvio, config),
373
+ variables: {},
374
+ };
375
+ const cacheSnapshot = storeLookup(selector, {
376
+ config,
377
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
378
+ });
379
+ return cacheSnapshot;
380
+ }
381
+ const getDocumentDecisionAdapterFactory = (luvio) => function DocumentMatrix__getDocumentDecision(untrustedConfig, requestContext) {
382
+ const config = validateAdapterConfig(untrustedConfig, getDocumentDecision_ConfigPropertyNames);
383
+ // Invalid or incomplete config
384
+ if (config === null) {
385
+ return null;
386
+ }
387
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
388
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
389
+ };
390
+
391
+ let getDocumentDecision;
392
+ // Imperative GET Adapters
393
+ let getDocumentDecision_imperative;
394
+ // Adapter Metadata
395
+ const getDocumentDecisionMetadata = {
396
+ apiFamily: 'DocumentMatrix',
397
+ name: 'getDocumentDecision',
398
+ ttl: 300,
399
+ };
400
+ // Notify Update Available
401
+ function bindExportsTo(luvio) {
402
+ // LDS Adapters
403
+ const getDocumentDecision_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDocumentDecision', getDocumentDecisionAdapterFactory), getDocumentDecisionMetadata);
404
+ return {
405
+ getDocumentDecision: createWireAdapterConstructor(luvio, getDocumentDecision_ldsAdapter, getDocumentDecisionMetadata),
406
+ // Imperative GET Adapters
407
+ getDocumentDecision_imperative: createImperativeAdapter(luvio, getDocumentDecision_ldsAdapter, getDocumentDecisionMetadata),
408
+ // Notify Update Availables
409
+ };
410
+ }
411
+ withDefaultLuvio((luvio) => {
412
+ ({ getDocumentDecision, getDocumentDecision_imperative } = bindExportsTo(luvio));
413
+ });
414
+
415
+ export { getDocumentDecision, getDocumentDecision_imperative };
416
+ // version: 0.1.0-dev1-c978a7b010