@salesforce/lds-adapters-industries-energy-utilities 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.
package/sfdc/index.js ADDED
@@ -0,0 +1,510 @@
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 = 'energy-utilities';
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 = 'IndividualApplicationStatusOutputRepresentation') {
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_status = obj.status;
98
+ const path_status = path + '.status';
99
+ if (typeof obj_status !== 'string') {
100
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
101
+ }
102
+ const obj_value = obj.value;
103
+ const path_value = path + '.value';
104
+ if (typeof obj_value !== 'number' || (typeof obj_value === 'number' && Math.floor(obj_value) !== obj_value)) {
105
+ return new TypeError('Expected "integer" but received "' + typeof obj_value + '" (at "' + path_value + '")');
106
+ }
107
+ })();
108
+ return v_error === undefined ? null : v_error;
109
+ }
110
+
111
+ function validate$1(obj, path = 'IndividualApplicationObjectOutputRepresentation') {
112
+ const v_error = (() => {
113
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
114
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
115
+ }
116
+ if (obj.accountId !== undefined) {
117
+ const obj_accountId = obj.accountId;
118
+ const path_accountId = path + '.accountId';
119
+ if (typeof obj_accountId !== 'string') {
120
+ return new TypeError('Expected "string" but received "' + typeof obj_accountId + '" (at "' + path_accountId + '")');
121
+ }
122
+ }
123
+ if (obj.accountName !== undefined) {
124
+ const obj_accountName = obj.accountName;
125
+ const path_accountName = path + '.accountName';
126
+ if (typeof obj_accountName !== 'string') {
127
+ return new TypeError('Expected "string" but received "' + typeof obj_accountName + '" (at "' + path_accountName + '")');
128
+ }
129
+ }
130
+ if (obj.applicationName !== undefined) {
131
+ const obj_applicationName = obj.applicationName;
132
+ const path_applicationName = path + '.applicationName';
133
+ if (typeof obj_applicationName !== 'string') {
134
+ return new TypeError('Expected "string" but received "' + typeof obj_applicationName + '" (at "' + path_applicationName + '")');
135
+ }
136
+ }
137
+ if (obj.applicationType !== undefined) {
138
+ const obj_applicationType = obj.applicationType;
139
+ const path_applicationType = path + '.applicationType';
140
+ if (typeof obj_applicationType !== 'string') {
141
+ return new TypeError('Expected "string" but received "' + typeof obj_applicationType + '" (at "' + path_applicationType + '")');
142
+ }
143
+ }
144
+ if (obj.appliedDate !== undefined) {
145
+ const obj_appliedDate = obj.appliedDate;
146
+ const path_appliedDate = path + '.appliedDate';
147
+ if (typeof obj_appliedDate !== 'string') {
148
+ return new TypeError('Expected "string" but received "' + typeof obj_appliedDate + '" (at "' + path_appliedDate + '")');
149
+ }
150
+ }
151
+ if (obj.approvedDate !== undefined) {
152
+ const obj_approvedDate = obj.approvedDate;
153
+ const path_approvedDate = path + '.approvedDate';
154
+ if (typeof obj_approvedDate !== 'string') {
155
+ return new TypeError('Expected "string" but received "' + typeof obj_approvedDate + '" (at "' + path_approvedDate + '")');
156
+ }
157
+ }
158
+ if (obj.category !== undefined) {
159
+ const obj_category = obj.category;
160
+ const path_category = path + '.category';
161
+ if (typeof obj_category !== 'string') {
162
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
163
+ }
164
+ }
165
+ if (obj.description !== undefined) {
166
+ const obj_description = obj.description;
167
+ const path_description = path + '.description';
168
+ if (typeof obj_description !== 'string') {
169
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
170
+ }
171
+ }
172
+ if (obj.externalProject !== undefined) {
173
+ const obj_externalProject = obj.externalProject;
174
+ const path_externalProject = path + '.externalProject';
175
+ if (typeof obj_externalProject !== 'string') {
176
+ return new TypeError('Expected "string" but received "' + typeof obj_externalProject + '" (at "' + path_externalProject + '")');
177
+ }
178
+ }
179
+ const obj_id = obj.id;
180
+ const path_id = path + '.id';
181
+ if (typeof obj_id !== 'string') {
182
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
183
+ }
184
+ if (obj.isSubmittedByThirdParty !== undefined) {
185
+ const obj_isSubmittedByThirdParty = obj.isSubmittedByThirdParty;
186
+ const path_isSubmittedByThirdParty = path + '.isSubmittedByThirdParty';
187
+ if (typeof obj_isSubmittedByThirdParty !== 'boolean') {
188
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSubmittedByThirdParty + '" (at "' + path_isSubmittedByThirdParty + '")');
189
+ }
190
+ }
191
+ if (obj.locationId !== undefined) {
192
+ const obj_locationId = obj.locationId;
193
+ const path_locationId = path + '.locationId';
194
+ if (typeof obj_locationId !== 'string') {
195
+ return new TypeError('Expected "string" but received "' + typeof obj_locationId + '" (at "' + path_locationId + '")');
196
+ }
197
+ }
198
+ if (obj.parentApplicationId !== undefined) {
199
+ const obj_parentApplicationId = obj.parentApplicationId;
200
+ const path_parentApplicationId = path + '.parentApplicationId';
201
+ if (typeof obj_parentApplicationId !== 'string') {
202
+ return new TypeError('Expected "string" but received "' + typeof obj_parentApplicationId + '" (at "' + path_parentApplicationId + '")');
203
+ }
204
+ }
205
+ if (obj.programId !== undefined) {
206
+ const obj_programId = obj.programId;
207
+ const path_programId = path + '.programId';
208
+ if (typeof obj_programId !== 'string') {
209
+ return new TypeError('Expected "string" but received "' + typeof obj_programId + '" (at "' + path_programId + '")');
210
+ }
211
+ }
212
+ if (obj.rejectionReason !== undefined) {
213
+ const obj_rejectionReason = obj.rejectionReason;
214
+ const path_rejectionReason = path + '.rejectionReason';
215
+ if (typeof obj_rejectionReason !== 'string') {
216
+ return new TypeError('Expected "string" but received "' + typeof obj_rejectionReason + '" (at "' + path_rejectionReason + '")');
217
+ }
218
+ }
219
+ if (obj.status !== undefined) {
220
+ const obj_status = obj.status;
221
+ const path_status = path + '.status';
222
+ if (typeof obj_status !== 'string') {
223
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
224
+ }
225
+ }
226
+ if (obj.submittedByAccountId !== undefined) {
227
+ const obj_submittedByAccountId = obj.submittedByAccountId;
228
+ const path_submittedByAccountId = path + '.submittedByAccountId';
229
+ if (typeof obj_submittedByAccountId !== 'string') {
230
+ return new TypeError('Expected "string" but received "' + typeof obj_submittedByAccountId + '" (at "' + path_submittedByAccountId + '")');
231
+ }
232
+ }
233
+ if (obj.submittedByContactId !== undefined) {
234
+ const obj_submittedByContactId = obj.submittedByContactId;
235
+ const path_submittedByContactId = path + '.submittedByContactId';
236
+ if (typeof obj_submittedByContactId !== 'string') {
237
+ return new TypeError('Expected "string" but received "' + typeof obj_submittedByContactId + '" (at "' + path_submittedByContactId + '")');
238
+ }
239
+ }
240
+ if (obj.wasReturned !== undefined) {
241
+ const obj_wasReturned = obj.wasReturned;
242
+ const path_wasReturned = path + '.wasReturned';
243
+ if (typeof obj_wasReturned !== 'boolean') {
244
+ return new TypeError('Expected "boolean" but received "' + typeof obj_wasReturned + '" (at "' + path_wasReturned + '")');
245
+ }
246
+ }
247
+ })();
248
+ return v_error === undefined ? null : v_error;
249
+ }
250
+
251
+ const TTL = 10000;
252
+ const VERSION = "ec383a973177c0746f1280ceece96bf7";
253
+ function validate(obj, path = 'ProgramIndividualApplicationOutputRepresentation') {
254
+ const v_error = (() => {
255
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
256
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
257
+ }
258
+ if (obj.aggregateByStatus !== undefined) {
259
+ const obj_aggregateByStatus = obj.aggregateByStatus;
260
+ const path_aggregateByStatus = path + '.aggregateByStatus';
261
+ if (!ArrayIsArray(obj_aggregateByStatus)) {
262
+ return new TypeError('Expected "array" but received "' + typeof obj_aggregateByStatus + '" (at "' + path_aggregateByStatus + '")');
263
+ }
264
+ for (let i = 0; i < obj_aggregateByStatus.length; i++) {
265
+ const obj_aggregateByStatus_item = obj_aggregateByStatus[i];
266
+ const path_aggregateByStatus_item = path_aggregateByStatus + '[' + i + ']';
267
+ const referencepath_aggregateByStatus_itemValidationError = validate$2(obj_aggregateByStatus_item, path_aggregateByStatus_item);
268
+ if (referencepath_aggregateByStatus_itemValidationError !== null) {
269
+ let message = 'Object doesn\'t match IndividualApplicationStatusOutputRepresentation (at "' + path_aggregateByStatus_item + '")\n';
270
+ message += referencepath_aggregateByStatus_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
271
+ return new TypeError(message);
272
+ }
273
+ }
274
+ }
275
+ const obj_applications = obj.applications;
276
+ const path_applications = path + '.applications';
277
+ if (!ArrayIsArray(obj_applications)) {
278
+ return new TypeError('Expected "array" but received "' + typeof obj_applications + '" (at "' + path_applications + '")');
279
+ }
280
+ for (let i = 0; i < obj_applications.length; i++) {
281
+ const obj_applications_item = obj_applications[i];
282
+ const path_applications_item = path_applications + '[' + i + ']';
283
+ const referencepath_applications_itemValidationError = validate$1(obj_applications_item, path_applications_item);
284
+ if (referencepath_applications_itemValidationError !== null) {
285
+ let message = 'Object doesn\'t match IndividualApplicationObjectOutputRepresentation (at "' + path_applications_item + '")\n';
286
+ message += referencepath_applications_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
287
+ return new TypeError(message);
288
+ }
289
+ }
290
+ const obj_totalCount = obj.totalCount;
291
+ const path_totalCount = path + '.totalCount';
292
+ if (typeof obj_totalCount !== 'number' || (typeof obj_totalCount === 'number' && Math.floor(obj_totalCount) !== obj_totalCount)) {
293
+ return new TypeError('Expected "integer" but received "' + typeof obj_totalCount + '" (at "' + path_totalCount + '")');
294
+ }
295
+ })();
296
+ return v_error === undefined ? null : v_error;
297
+ }
298
+ const RepresentationType = 'ProgramIndividualApplicationOutputRepresentation';
299
+ function normalize(input, existing, path, luvio, store, timestamp) {
300
+ return input;
301
+ }
302
+ const select$1 = function ProgramIndividualApplicationOutputRepresentationSelect() {
303
+ return {
304
+ kind: 'Fragment',
305
+ version: VERSION,
306
+ private: [],
307
+ opaque: true
308
+ };
309
+ };
310
+ function equals(existing, incoming) {
311
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
312
+ return false;
313
+ }
314
+ return true;
315
+ }
316
+ const ingest = function ProgramIndividualApplicationOutputRepresentationIngest(input, path, luvio, store, timestamp) {
317
+ if (process.env.NODE_ENV !== 'production') {
318
+ const validateError = validate(input);
319
+ if (validateError !== null) {
320
+ throw validateError;
321
+ }
322
+ }
323
+ const key = path.fullPath;
324
+ const ttlToUse = TTL;
325
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "energy-utilities", VERSION, RepresentationType, equals);
326
+ return createLink(key);
327
+ };
328
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
329
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
330
+ const rootKey = fullPathFactory();
331
+ rootKeySet.set(rootKey, {
332
+ namespace: keyPrefix,
333
+ representationName: RepresentationType,
334
+ mergeable: false
335
+ });
336
+ }
337
+
338
+ function select(luvio, params) {
339
+ return select$1();
340
+ }
341
+ function keyBuilder$1(luvio, params) {
342
+ return keyPrefix + '::ProgramIndividualApplicationOutputRepresentation:(' + 'accountId:' + params.queryParams.accountId + ',' + 'enrolleeType:' + params.queryParams.enrolleeType + ',' + 'locationId:' + params.queryParams.locationId + ',' + 'offset:' + params.queryParams.offset + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'programId:' + params.queryParams.programId + ',' + 'shouldAggregateByStatus:' + params.queryParams.shouldAggregateByStatus + ',' + 'sortBy:' + params.queryParams.sortBy + ',' + 'sortOrder:' + params.queryParams.sortOrder + ',' + 'status:' + params.queryParams.status + ')';
343
+ }
344
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
345
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
346
+ }
347
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
348
+ const { body } = response;
349
+ const key = keyBuilder$1(luvio, resourceParams);
350
+ luvio.storeIngest(key, ingest, body);
351
+ const snapshot = luvio.storeLookup({
352
+ recordId: key,
353
+ node: select(),
354
+ variables: {},
355
+ }, snapshotRefresh);
356
+ if (process.env.NODE_ENV !== 'production') {
357
+ if (snapshot.state !== 'Fulfilled') {
358
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
359
+ }
360
+ }
361
+ deepFreeze(snapshot.data);
362
+ return snapshot;
363
+ }
364
+ function ingestError(luvio, params, error, snapshotRefresh) {
365
+ const key = keyBuilder$1(luvio, params);
366
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
367
+ const storeMetadataParams = {
368
+ ttl: TTL,
369
+ namespace: keyPrefix,
370
+ version: VERSION,
371
+ representationName: RepresentationType
372
+ };
373
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
374
+ return errorSnapshot;
375
+ }
376
+ function createResourceRequest(config) {
377
+ const headers = {};
378
+ return {
379
+ baseUri: '/services/data/v66.0',
380
+ basePath: '/connect/eu-program/applications',
381
+ method: 'get',
382
+ body: null,
383
+ urlParams: {},
384
+ queryParams: config.queryParams,
385
+ headers,
386
+ priority: 'normal',
387
+ };
388
+ }
389
+
390
+ const adapterName = 'getProgramApplications';
391
+ const getProgramApplications_ConfigPropertyMetadata = [
392
+ generateParamConfigMetadata('accountId', false, 1 /* QueryParameter */, 0 /* String */),
393
+ generateParamConfigMetadata('enrolleeType', false, 1 /* QueryParameter */, 0 /* String */),
394
+ generateParamConfigMetadata('locationId', false, 1 /* QueryParameter */, 0 /* String */),
395
+ generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
396
+ generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
397
+ generateParamConfigMetadata('programId', false, 1 /* QueryParameter */, 0 /* String */),
398
+ generateParamConfigMetadata('shouldAggregateByStatus', false, 1 /* QueryParameter */, 1 /* Boolean */),
399
+ generateParamConfigMetadata('sortBy', false, 1 /* QueryParameter */, 0 /* String */),
400
+ generateParamConfigMetadata('sortOrder', false, 1 /* QueryParameter */, 0 /* String */),
401
+ generateParamConfigMetadata('status', false, 1 /* QueryParameter */, 0 /* String */),
402
+ ];
403
+ const getProgramApplications_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getProgramApplications_ConfigPropertyMetadata);
404
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(getProgramApplications_ConfigPropertyMetadata);
405
+ function keyBuilder(luvio, config) {
406
+ const resourceParams = createResourceParams(config);
407
+ return keyBuilder$1(luvio, resourceParams);
408
+ }
409
+ function typeCheckConfig(untrustedConfig) {
410
+ const config = {};
411
+ typeCheckConfig$1(untrustedConfig, config, getProgramApplications_ConfigPropertyMetadata);
412
+ return config;
413
+ }
414
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
415
+ if (!untrustedIsObject(untrustedConfig)) {
416
+ return null;
417
+ }
418
+ if (process.env.NODE_ENV !== 'production') {
419
+ validateConfig(untrustedConfig, configPropertyNames);
420
+ }
421
+ const config = typeCheckConfig(untrustedConfig);
422
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
423
+ return null;
424
+ }
425
+ return config;
426
+ }
427
+ function adapterFragment(luvio, config) {
428
+ createResourceParams(config);
429
+ return select();
430
+ }
431
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
432
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
433
+ config,
434
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
435
+ });
436
+ return luvio.storeBroadcast().then(() => snapshot);
437
+ }
438
+ function onFetchResponseError(luvio, config, resourceParams, response) {
439
+ const snapshot = ingestError(luvio, resourceParams, response, {
440
+ config,
441
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
442
+ });
443
+ return luvio.storeBroadcast().then(() => snapshot);
444
+ }
445
+ function buildNetworkSnapshot(luvio, config, options) {
446
+ const resourceParams = createResourceParams(config);
447
+ const request = createResourceRequest(resourceParams);
448
+ return luvio.dispatchResourceRequest(request, options)
449
+ .then((response) => {
450
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
451
+ const cache = new StoreKeyMap();
452
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
453
+ return cache;
454
+ });
455
+ }, (response) => {
456
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
457
+ });
458
+ }
459
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
460
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
461
+ }
462
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
463
+ const { luvio, config } = context;
464
+ const selector = {
465
+ recordId: keyBuilder(luvio, config),
466
+ node: adapterFragment(luvio, config),
467
+ variables: {},
468
+ };
469
+ const cacheSnapshot = storeLookup(selector, {
470
+ config,
471
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
472
+ });
473
+ return cacheSnapshot;
474
+ }
475
+ const getProgramApplicationsAdapterFactory = (luvio) => function energyUtilities__getProgramApplications(untrustedConfig, requestContext) {
476
+ const config = validateAdapterConfig(untrustedConfig, getProgramApplications_ConfigPropertyNames);
477
+ // Invalid or incomplete config
478
+ if (config === null) {
479
+ return null;
480
+ }
481
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
482
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
483
+ };
484
+
485
+ let getProgramApplications;
486
+ // Imperative GET Adapters
487
+ let getProgramApplications_imperative;
488
+ // Adapter Metadata
489
+ const getProgramApplicationsMetadata = {
490
+ apiFamily: 'energyutilities',
491
+ name: 'getProgramApplications',
492
+ ttl: 10000,
493
+ };
494
+ // Notify Update Available
495
+ function bindExportsTo(luvio) {
496
+ // LDS Adapters
497
+ const getProgramApplications_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getProgramApplications', getProgramApplicationsAdapterFactory), getProgramApplicationsMetadata);
498
+ return {
499
+ getProgramApplications: createWireAdapterConstructor(luvio, getProgramApplications_ldsAdapter, getProgramApplicationsMetadata),
500
+ // Imperative GET Adapters
501
+ getProgramApplications_imperative: createImperativeAdapter(luvio, getProgramApplications_ldsAdapter, getProgramApplicationsMetadata),
502
+ // Notify Update Availables
503
+ };
504
+ }
505
+ withDefaultLuvio((luvio) => {
506
+ ({ getProgramApplications, getProgramApplications_imperative } = bindExportsTo(luvio));
507
+ });
508
+
509
+ export { getProgramApplications, getProgramApplications_imperative };
510
+ // version: 0.1.0-dev1-c978a7b010