@salesforce/lds-adapters-service-ecm 1.322.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.
@@ -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 = "502197caab7f9968a8948a523f3e3937";
3
+ export declare function validate(obj: any, path?: string): TypeError | null;
4
+ export declare const RepresentationType: string;
5
+ export declare function normalize(input: ServiceAutomationDepReadInputRepresentation, existing: ServiceAutomationDepReadInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ServiceAutomationDepReadInputRepresentationNormalized;
6
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
7
+ export declare function equals(existing: ServiceAutomationDepReadInputRepresentationNormalized, incoming: ServiceAutomationDepReadInputRepresentationNormalized): 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: ServiceAutomationDepReadInputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
10
+ /**
11
+ * Representation of the ServiceAutomation Input Request
12
+ *
13
+ * Keys:
14
+ * (none)
15
+ */
16
+ export interface ServiceAutomationDepReadInputRepresentationNormalized {
17
+ /** The name of the entity records to be fetched */
18
+ entityName: string;
19
+ /** The fields to be fetched for the entity */
20
+ fields: Array<string>;
21
+ /** The filter to be applied while fetching records */
22
+ filters: Array<{}>;
23
+ /** The limit to be applied while fetching records */
24
+ limit: number;
25
+ }
26
+ /**
27
+ * Representation of the ServiceAutomation Input Request
28
+ *
29
+ * Keys:
30
+ * (none)
31
+ */
32
+ export interface ServiceAutomationDepReadInputRepresentation {
33
+ entityName: string;
34
+ fields: Array<string>;
35
+ filters: Array<{}>;
36
+ limit: number;
37
+ }
@@ -0,0 +1,32 @@
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 = "7ff268b7eca262fb371bd3338cc33494";
3
+ export declare function validate(obj: any, path?: string): TypeError | null;
4
+ export declare const RepresentationType: string;
5
+ export declare function normalize(input: ServiceAutomationOutputRecordRepresentation, existing: ServiceAutomationOutputRecordRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ServiceAutomationOutputRecordRepresentationNormalized;
6
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
7
+ export declare function equals(existing: ServiceAutomationOutputRecordRepresentationNormalized, incoming: ServiceAutomationOutputRecordRepresentationNormalized): 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: ServiceAutomationOutputRecordRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
10
+ /**
11
+ * Output Representation of Service Automation Record List
12
+ *
13
+ * Keys:
14
+ * (none)
15
+ */
16
+ export interface ServiceAutomationOutputRecordRepresentationNormalized {
17
+ /** Fields Map of the record. */
18
+ fields: {
19
+ [key: string]: {};
20
+ };
21
+ }
22
+ /**
23
+ * Output Representation of Service Automation Record List
24
+ *
25
+ * Keys:
26
+ * (none)
27
+ */
28
+ export interface ServiceAutomationOutputRecordRepresentation {
29
+ fields: {
30
+ [key: string]: {};
31
+ };
32
+ }
@@ -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-service-ecm",
3
+ "version": "1.322.0",
4
+ "description": "Service Automation Request",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "main": "dist/es/es2018/service-ecm.js",
7
+ "module": "dist/es/es2018/service-ecm.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/service-ecm.js",
18
+ "require": "./dist/es/es2018/service-ecm.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": "serviceEcmApi"
29
+ },
30
+ "contributors": [
31
+ "kshama.singh@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-service-ecm",
39
+ "release:corejar": "yarn build && ../core-build/scripts/core.js --adapter=lds-adapters-service-ecm",
40
+ "test:unit": "jest"
41
+ },
42
+ "dependencies": {
43
+ "@salesforce/lds-bindings": "^1.322.0"
44
+ },
45
+ "devDependencies": {
46
+ "@salesforce/lds-compiler-plugins": "^1.322.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
+ }
@@ -0,0 +1 @@
1
+ export * from '../dist/es/es2018/types/src/generated/artifacts/sfdc';
package/sfdc/index.js ADDED
@@ -0,0 +1,422 @@
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$1, create: ObjectCreate$1 } = Object;
21
+ const { stringify: JSONStringify$1 } = JSON;
22
+ const { isArray: ArrayIsArray$1 } = Array;
23
+ /**
24
+ * Validates an adapter config is well-formed.
25
+ * @param config The config to validate.
26
+ * @param adapter The adapter validation configuration.
27
+ * @param oneOf The keys the config must contain at least one of.
28
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
29
+ */
30
+ function validateConfig(config, adapter, oneOf) {
31
+ const { displayName } = adapter;
32
+ const { required, optional, unsupported } = adapter.parameters;
33
+ if (config === undefined ||
34
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
35
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
36
+ }
37
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
38
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
39
+ }
40
+ if (unsupported !== undefined &&
41
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
42
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
43
+ }
44
+ const supported = required.concat(optional);
45
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
46
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
47
+ }
48
+ }
49
+ function untrustedIsObject(untrusted) {
50
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
51
+ }
52
+ function areRequiredParametersPresent(config, configPropertyNames) {
53
+ return configPropertyNames.parameters.required.every(req => req in config);
54
+ }
55
+ const snapshotRefreshOptions = {
56
+ overrides: {
57
+ headers: {
58
+ 'Cache-Control': 'no-cache',
59
+ },
60
+ }
61
+ };
62
+ /**
63
+ * A deterministic JSON stringify implementation. Heavily adapted from https://github.com/epoberezkin/fast-json-stable-stringify.
64
+ * This is needed because insertion order for JSON.stringify(object) affects output:
65
+ * JSON.stringify({a: 1, b: 2})
66
+ * "{"a":1,"b":2}"
67
+ * JSON.stringify({b: 2, a: 1})
68
+ * "{"b":2,"a":1}"
69
+ * @param data Data to be JSON-stringified.
70
+ * @returns JSON.stringified value with consistent ordering of keys.
71
+ */
72
+ function stableJSONStringify(node) {
73
+ // This is for Date values.
74
+ if (node && node.toJSON && typeof node.toJSON === 'function') {
75
+ // eslint-disable-next-line no-param-reassign
76
+ node = node.toJSON();
77
+ }
78
+ if (node === undefined) {
79
+ return;
80
+ }
81
+ if (typeof node === 'number') {
82
+ return isFinite(node) ? '' + node : 'null';
83
+ }
84
+ if (typeof node !== 'object') {
85
+ return JSONStringify$1(node);
86
+ }
87
+ let i;
88
+ let out;
89
+ if (ArrayIsArray$1(node)) {
90
+ out = '[';
91
+ for (i = 0; i < node.length; i++) {
92
+ if (i) {
93
+ out += ',';
94
+ }
95
+ out += stableJSONStringify(node[i]) || 'null';
96
+ }
97
+ return out + ']';
98
+ }
99
+ if (node === null) {
100
+ return 'null';
101
+ }
102
+ const keys = ObjectKeys$1(node).sort();
103
+ out = '';
104
+ for (i = 0; i < keys.length; i++) {
105
+ const key = keys[i];
106
+ const value = stableJSONStringify(node[key]);
107
+ if (!value) {
108
+ continue;
109
+ }
110
+ if (out) {
111
+ out += ',';
112
+ }
113
+ out += JSONStringify$1(key) + ':' + value;
114
+ }
115
+ return '{' + out + '}';
116
+ }
117
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
118
+ return {
119
+ name,
120
+ required,
121
+ resourceType,
122
+ typeCheckShape,
123
+ isArrayShape,
124
+ coerceFn,
125
+ };
126
+ }
127
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
128
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
129
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
130
+ return {
131
+ displayName,
132
+ parameters: {
133
+ required,
134
+ optional,
135
+ }
136
+ };
137
+ }
138
+ const keyPrefix = 'ecm';
139
+
140
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
141
+ const { isArray: ArrayIsArray } = Array;
142
+ const { stringify: JSONStringify } = JSON;
143
+ function createLink(ref) {
144
+ return {
145
+ __ref: serializeStructuredKey(ref),
146
+ };
147
+ }
148
+
149
+ function validate$1(obj, path = 'ServiceAutomationOutputRecordRepresentation') {
150
+ const v_error = (() => {
151
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
152
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
153
+ }
154
+ const obj_fields = obj.fields;
155
+ const path_fields = path + '.fields';
156
+ if (typeof obj_fields !== 'object' || ArrayIsArray(obj_fields) || obj_fields === null) {
157
+ return new TypeError('Expected "object" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
158
+ }
159
+ const obj_fields_keys = ObjectKeys(obj_fields);
160
+ for (let i = 0; i < obj_fields_keys.length; i++) {
161
+ const key = obj_fields_keys[i];
162
+ const obj_fields_prop = obj_fields[key];
163
+ const path_fields_prop = path_fields + '["' + key + '"]';
164
+ if (typeof obj_fields_prop !== 'object' || ArrayIsArray(obj_fields_prop) || obj_fields_prop === null) {
165
+ return new TypeError('Expected "object" but received "' + typeof obj_fields_prop + '" (at "' + path_fields_prop + '")');
166
+ }
167
+ }
168
+ })();
169
+ return v_error === undefined ? null : v_error;
170
+ }
171
+
172
+ const TTL = 6000;
173
+ const VERSION = "7860ae260a600243129acb4ea01e75be";
174
+ function validate(obj, path = 'ServiceAutomationDepOutputRepresentation') {
175
+ const v_error = (() => {
176
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
177
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
178
+ }
179
+ const obj_entityApiName = obj.entityApiName;
180
+ const path_entityApiName = path + '.entityApiName';
181
+ if (typeof obj_entityApiName !== 'string') {
182
+ return new TypeError('Expected "string" but received "' + typeof obj_entityApiName + '" (at "' + path_entityApiName + '")');
183
+ }
184
+ const obj_records = obj.records;
185
+ const path_records = path + '.records';
186
+ if (!ArrayIsArray(obj_records)) {
187
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
188
+ }
189
+ for (let i = 0; i < obj_records.length; i++) {
190
+ const obj_records_item = obj_records[i];
191
+ const path_records_item = path_records + '[' + i + ']';
192
+ const referencepath_records_itemValidationError = validate$1(obj_records_item, path_records_item);
193
+ if (referencepath_records_itemValidationError !== null) {
194
+ let message = 'Object doesn\'t match ServiceAutomationOutputRecordRepresentation (at "' + path_records_item + '")\n';
195
+ message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
196
+ return new TypeError(message);
197
+ }
198
+ }
199
+ })();
200
+ return v_error === undefined ? null : v_error;
201
+ }
202
+ const RepresentationType = 'ServiceAutomationDepOutputRepresentation';
203
+ function normalize(input, existing, path, luvio, store, timestamp) {
204
+ return input;
205
+ }
206
+ const select$1 = function ServiceAutomationDepOutputRepresentationSelect() {
207
+ return {
208
+ kind: 'Fragment',
209
+ version: VERSION,
210
+ private: [],
211
+ opaque: true
212
+ };
213
+ };
214
+ function equals(existing, incoming) {
215
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
216
+ return false;
217
+ }
218
+ return true;
219
+ }
220
+ const ingest = function ServiceAutomationDepOutputRepresentationIngest(input, path, luvio, store, timestamp) {
221
+ if (process.env.NODE_ENV !== 'production') {
222
+ const validateError = validate(input);
223
+ if (validateError !== null) {
224
+ throw validateError;
225
+ }
226
+ }
227
+ const key = path.fullPath;
228
+ const ttlToUse = TTL;
229
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "ecm", VERSION, RepresentationType, equals);
230
+ return createLink(key);
231
+ };
232
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
233
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
234
+ const rootKey = fullPathFactory();
235
+ rootKeySet.set(rootKey, {
236
+ namespace: keyPrefix,
237
+ representationName: RepresentationType,
238
+ mergeable: false
239
+ });
240
+ }
241
+
242
+ function select(luvio, params) {
243
+ return select$1();
244
+ }
245
+ function keyBuilder$1(luvio, params) {
246
+ return keyPrefix + '::ServiceAutomationDepOutputRepresentation:(' + 'entityName:' + params.body.entityName + '::' + 'fields:' + params.body.fields + '::' + '[' + params.body.filters.map(element => stableJSONStringify(element)).join(',') + ']' + '::' + 'limit:' + params.body.limit + ')';
247
+ }
248
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
249
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
250
+ }
251
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
252
+ const { body } = response;
253
+ const key = keyBuilder$1(luvio, resourceParams);
254
+ luvio.storeIngest(key, ingest, body);
255
+ const snapshot = luvio.storeLookup({
256
+ recordId: key,
257
+ node: select(),
258
+ variables: {},
259
+ }, snapshotRefresh);
260
+ if (process.env.NODE_ENV !== 'production') {
261
+ if (snapshot.state !== 'Fulfilled') {
262
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
263
+ }
264
+ }
265
+ deepFreeze(snapshot.data);
266
+ return snapshot;
267
+ }
268
+ function ingestError(luvio, params, error, snapshotRefresh) {
269
+ const key = keyBuilder$1(luvio, params);
270
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
271
+ const storeMetadataParams = {
272
+ ttl: TTL,
273
+ namespace: keyPrefix,
274
+ version: VERSION,
275
+ representationName: RepresentationType
276
+ };
277
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
278
+ return errorSnapshot;
279
+ }
280
+ function createResourceRequest(config) {
281
+ const headers = {};
282
+ return {
283
+ baseUri: '/services/data/v63.0',
284
+ basePath: '/connect/service-automation',
285
+ method: 'post',
286
+ body: config.body,
287
+ urlParams: {},
288
+ queryParams: {},
289
+ headers,
290
+ priority: 'normal',
291
+ };
292
+ }
293
+
294
+ const adapterName = 'getAllServiceAutomationDep';
295
+ const getAllServiceAutomationDep_ConfigPropertyMetadata = [
296
+ generateParamConfigMetadata('entityName', true, 2 /* Body */, 0 /* String */),
297
+ generateParamConfigMetadata('fields', true, 2 /* Body */, 0 /* String */, true),
298
+ generateParamConfigMetadata('filters', true, 2 /* Body */, 4 /* Unsupported */, true),
299
+ generateParamConfigMetadata('limit', true, 2 /* Body */, 3 /* Integer */),
300
+ ];
301
+ const getAllServiceAutomationDep_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getAllServiceAutomationDep_ConfigPropertyMetadata);
302
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(getAllServiceAutomationDep_ConfigPropertyMetadata);
303
+ function keyBuilder(luvio, config) {
304
+ const resourceParams = createResourceParams(config);
305
+ return keyBuilder$1(luvio, resourceParams);
306
+ }
307
+ function typeCheckConfig(untrustedConfig) {
308
+ const config = {};
309
+ typeCheckConfig$1(untrustedConfig, config, getAllServiceAutomationDep_ConfigPropertyMetadata);
310
+ const untrustedConfig_filters = untrustedConfig.filters;
311
+ if (ArrayIsArray$1(untrustedConfig_filters)) {
312
+ const untrustedConfig_filters_array = [];
313
+ for (let i = 0, arrayLength = untrustedConfig_filters.length; i < arrayLength; i++) {
314
+ const untrustedConfig_filters_item = untrustedConfig_filters[i];
315
+ if (untrustedIsObject(untrustedConfig_filters_item)) {
316
+ const untrustedConfig_filters_item_object = {};
317
+ if (untrustedConfig_filters_item_object !== undefined && Object.keys(untrustedConfig_filters_item_object).length >= 0) {
318
+ untrustedConfig_filters_array.push(untrustedConfig_filters_item_object);
319
+ }
320
+ }
321
+ }
322
+ config.filters = untrustedConfig_filters_array;
323
+ }
324
+ return config;
325
+ }
326
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
327
+ if (!untrustedIsObject(untrustedConfig)) {
328
+ return null;
329
+ }
330
+ if (process.env.NODE_ENV !== 'production') {
331
+ validateConfig(untrustedConfig, configPropertyNames);
332
+ }
333
+ const config = typeCheckConfig(untrustedConfig);
334
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
335
+ return null;
336
+ }
337
+ return config;
338
+ }
339
+ function adapterFragment(luvio, config) {
340
+ createResourceParams(config);
341
+ return select();
342
+ }
343
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
344
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
345
+ config,
346
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
347
+ });
348
+ return luvio.storeBroadcast().then(() => snapshot);
349
+ }
350
+ function onFetchResponseError(luvio, config, resourceParams, response) {
351
+ const snapshot = ingestError(luvio, resourceParams, response, {
352
+ config,
353
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
354
+ });
355
+ return luvio.storeBroadcast().then(() => snapshot);
356
+ }
357
+ function buildNetworkSnapshot(luvio, config, options) {
358
+ const resourceParams = createResourceParams(config);
359
+ const request = createResourceRequest(resourceParams);
360
+ return luvio.dispatchResourceRequest(request, options)
361
+ .then((response) => {
362
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
363
+ const cache = new StoreKeyMap();
364
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
365
+ return cache;
366
+ });
367
+ }, (response) => {
368
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
369
+ });
370
+ }
371
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
372
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
373
+ }
374
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
375
+ const { luvio, config } = context;
376
+ const selector = {
377
+ recordId: keyBuilder(luvio, config),
378
+ node: adapterFragment(luvio, config),
379
+ variables: {},
380
+ };
381
+ const cacheSnapshot = storeLookup(selector, {
382
+ config,
383
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
384
+ });
385
+ return cacheSnapshot;
386
+ }
387
+ const getAllServiceAutomationDepAdapterFactory = (luvio) => function ecm__getAllServiceAutomationDep(untrustedConfig, requestContext) {
388
+ const config = validateAdapterConfig(untrustedConfig, getAllServiceAutomationDep_ConfigPropertyNames);
389
+ // Invalid or incomplete config
390
+ if (config === null) {
391
+ return null;
392
+ }
393
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
394
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
395
+ };
396
+
397
+ let getAllServiceAutomationDep;
398
+ // Imperative GET Adapters
399
+ let getAllServiceAutomationDep_imperative;
400
+ // Adapter Metadata
401
+ const getAllServiceAutomationDepMetadata = {
402
+ apiFamily: 'ecm',
403
+ name: 'getAllServiceAutomationDep',
404
+ ttl: 6000,
405
+ };
406
+ // Notify Update Available
407
+ function bindExportsTo(luvio) {
408
+ // LDS Adapters
409
+ const getAllServiceAutomationDep_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getAllServiceAutomationDep', getAllServiceAutomationDepAdapterFactory), getAllServiceAutomationDepMetadata);
410
+ return {
411
+ getAllServiceAutomationDep: createWireAdapterConstructor(luvio, getAllServiceAutomationDep_ldsAdapter, getAllServiceAutomationDepMetadata),
412
+ // Imperative GET Adapters
413
+ getAllServiceAutomationDep_imperative: createImperativeAdapter(luvio, getAllServiceAutomationDep_ldsAdapter, getAllServiceAutomationDepMetadata),
414
+ // Notify Update Availables
415
+ };
416
+ }
417
+ withDefaultLuvio((luvio) => {
418
+ ({ getAllServiceAutomationDep, getAllServiceAutomationDep_imperative } = bindExportsTo(luvio));
419
+ });
420
+
421
+ export { getAllServiceAutomationDep, getAllServiceAutomationDep_imperative };
422
+ // version: 1.322.0-87f682c9f3