@salesforce/lds-adapters-sales-automation-rules 1.124.2 → 1.124.4

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.
@@ -6,313 +6,313 @@
6
6
 
7
7
  import { serializeStructuredKey, StoreKeyMap } from '@luvio/engine';
8
8
 
9
- const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
- const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
11
- const { isArray: ArrayIsArray$1 } = Array;
12
- /**
13
- * Validates an adapter config is well-formed.
14
- * @param config The config to validate.
15
- * @param adapter The adapter validation configuration.
16
- * @param oneOf The keys the config must contain at least one of.
17
- * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
- */
19
- function validateConfig(config, adapter, oneOf) {
20
- const { displayName } = adapter;
21
- const { required, optional, unsupported } = adapter.parameters;
22
- if (config === undefined ||
23
- required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
- throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
- }
26
- if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
- throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
- }
29
- if (unsupported !== undefined &&
30
- unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
- throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
- }
33
- const supported = required.concat(optional);
34
- if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
35
- throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
- }
37
- }
38
- function untrustedIsObject(untrusted) {
39
- return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
- }
41
- function areRequiredParametersPresent(config, configPropertyNames) {
42
- return configPropertyNames.parameters.required.every(req => req in config);
43
- }
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
11
+ const { isArray: ArrayIsArray$1 } = Array;
12
+ /**
13
+ * Validates an adapter config is well-formed.
14
+ * @param config The config to validate.
15
+ * @param adapter The adapter validation configuration.
16
+ * @param oneOf The keys the config must contain at least one of.
17
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
+ */
19
+ function validateConfig(config, adapter, oneOf) {
20
+ const { displayName } = adapter;
21
+ const { required, optional, unsupported } = adapter.parameters;
22
+ if (config === undefined ||
23
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
+ }
26
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
+ }
29
+ if (unsupported !== undefined &&
30
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
+ }
33
+ const supported = required.concat(optional);
34
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
35
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
+ }
37
+ }
38
+ function untrustedIsObject(untrusted) {
39
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
+ }
41
+ function areRequiredParametersPresent(config, configPropertyNames) {
42
+ return configPropertyNames.parameters.required.every(req => req in config);
43
+ }
44
44
  const keyPrefix = 'sales-automation-rules';
45
45
 
46
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
47
- const { isArray: ArrayIsArray } = Array;
48
- function deepFreeze(value) {
49
- // No need to freeze primitives
50
- if (typeof value !== 'object' || value === null) {
51
- return;
52
- }
53
- if (ArrayIsArray(value)) {
54
- for (let i = 0, len = value.length; i < len; i += 1) {
55
- deepFreeze(value[i]);
56
- }
57
- }
58
- else {
59
- const keys = ObjectKeys(value);
60
- for (let i = 0, len = keys.length; i < len; i += 1) {
61
- deepFreeze(value[keys[i]]);
62
- }
63
- }
64
- ObjectFreeze(value);
65
- }
66
- function createLink(ref) {
67
- return {
68
- __ref: serializeStructuredKey(ref),
69
- };
46
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
47
+ const { isArray: ArrayIsArray } = Array;
48
+ function deepFreeze(value) {
49
+ // No need to freeze primitives
50
+ if (typeof value !== 'object' || value === null) {
51
+ return;
52
+ }
53
+ if (ArrayIsArray(value)) {
54
+ for (let i = 0, len = value.length; i < len; i += 1) {
55
+ deepFreeze(value[i]);
56
+ }
57
+ }
58
+ else {
59
+ const keys = ObjectKeys(value);
60
+ for (let i = 0, len = keys.length; i < len; i += 1) {
61
+ deepFreeze(value[keys[i]]);
62
+ }
63
+ }
64
+ ObjectFreeze(value);
65
+ }
66
+ function createLink(ref) {
67
+ return {
68
+ __ref: serializeStructuredKey(ref),
69
+ };
70
70
  }
71
71
 
72
- function validate$1(obj, path = 'AutomatedActionApplyReminderInputRepresentation') {
73
- const v_error = (() => {
74
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
75
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
76
- }
77
- if (obj.id !== undefined) {
78
- const obj_id = obj.id;
79
- const path_id = path + '.id';
80
- if (typeof obj_id !== 'string') {
81
- return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
82
- }
83
- }
84
- })();
85
- return v_error === undefined ? null : v_error;
72
+ function validate$1(obj, path = 'AutomatedActionApplyReminderInputRepresentation') {
73
+ const v_error = (() => {
74
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
75
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
76
+ }
77
+ if (obj.id !== undefined) {
78
+ const obj_id = obj.id;
79
+ const path_id = path + '.id';
80
+ if (typeof obj_id !== 'string') {
81
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
82
+ }
83
+ }
84
+ })();
85
+ return v_error === undefined ? null : v_error;
86
86
  }
87
87
 
88
- const VERSION = "fd4b3e3f68670957abe851597ce776bc";
89
- function validate(obj, path = 'AutomatedActionApplyReminderRepresentation') {
90
- const v_error = (() => {
91
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
92
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
93
- }
94
- const obj_errorCode = obj.errorCode;
95
- const path_errorCode = path + '.errorCode';
96
- if (typeof obj_errorCode !== 'string') {
97
- return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
98
- }
99
- const obj_errorMessage = obj.errorMessage;
100
- const path_errorMessage = path + '.errorMessage';
101
- if (typeof obj_errorMessage !== 'string') {
102
- return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
103
- }
104
- const obj_isSuccess = obj.isSuccess;
105
- const path_isSuccess = path + '.isSuccess';
106
- if (typeof obj_isSuccess !== 'boolean') {
107
- return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
108
- }
109
- const obj_reminderId = obj.reminderId;
110
- const path_reminderId = path + '.reminderId';
111
- if (typeof obj_reminderId !== 'string') {
112
- return new TypeError('Expected "string" but received "' + typeof obj_reminderId + '" (at "' + path_reminderId + '")');
113
- }
114
- })();
115
- return v_error === undefined ? null : v_error;
116
- }
117
- const RepresentationType = 'AutomatedActionApplyReminderRepresentation';
118
- function keyBuilder(luvio, config) {
119
- return keyPrefix + '::' + RepresentationType + ':' + config.id;
120
- }
121
- function keyBuilderFromType(luvio, object) {
122
- const keyParams = {
123
- id: object.reminderId
124
- };
125
- return keyBuilder(luvio, keyParams);
126
- }
127
- function normalize(input, existing, path, luvio, store, timestamp) {
128
- return input;
129
- }
130
- const select$1 = function AutomatedActionApplyReminderRepresentationSelect() {
131
- return {
132
- kind: 'Fragment',
133
- version: VERSION,
134
- private: [],
135
- selections: [
136
- {
137
- name: 'errorCode',
138
- kind: 'Scalar'
139
- },
140
- {
141
- name: 'errorMessage',
142
- kind: 'Scalar'
143
- },
144
- {
145
- name: 'isSuccess',
146
- kind: 'Scalar'
147
- },
148
- {
149
- name: 'reminderId',
150
- kind: 'Scalar'
151
- }
152
- ]
153
- };
154
- };
155
- function equals(existing, incoming) {
156
- const existing_isSuccess = existing.isSuccess;
157
- const incoming_isSuccess = incoming.isSuccess;
158
- if (!(existing_isSuccess === incoming_isSuccess)) {
159
- return false;
160
- }
161
- const existing_errorCode = existing.errorCode;
162
- const incoming_errorCode = incoming.errorCode;
163
- if (!(existing_errorCode === incoming_errorCode)) {
164
- return false;
165
- }
166
- const existing_errorMessage = existing.errorMessage;
167
- const incoming_errorMessage = incoming.errorMessage;
168
- if (!(existing_errorMessage === incoming_errorMessage)) {
169
- return false;
170
- }
171
- const existing_reminderId = existing.reminderId;
172
- const incoming_reminderId = incoming.reminderId;
173
- if (!(existing_reminderId === incoming_reminderId)) {
174
- return false;
175
- }
176
- return true;
177
- }
178
- const ingest = function AutomatedActionApplyReminderRepresentationIngest(input, path, luvio, store, timestamp) {
179
- if (process.env.NODE_ENV !== 'production') {
180
- const validateError = validate(input);
181
- if (validateError !== null) {
182
- throw validateError;
183
- }
184
- }
185
- const key = keyBuilderFromType(luvio, input);
186
- const existingRecord = store.readEntry(key);
187
- const ttlToUse = path.ttl !== undefined ? path.ttl : 1000;
188
- let incomingRecord = normalize(input, store.readEntry(key), {
189
- fullPath: key,
190
- parent: path.parent,
191
- propertyName: path.propertyName,
192
- ttl: ttlToUse
193
- });
194
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
195
- luvio.storePublish(key, incomingRecord);
196
- }
197
- if (ttlToUse !== undefined) {
198
- const storeMetadataParams = {
199
- ttl: ttlToUse,
200
- namespace: "sales-automation-rules",
201
- version: VERSION,
202
- representationName: RepresentationType,
203
- };
204
- luvio.publishStoreMetadata(key, storeMetadataParams);
205
- }
206
- return createLink(key);
207
- };
208
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
209
- const rootKeySet = new StoreKeyMap();
210
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
211
- const rootKey = keyBuilderFromType(luvio, input);
212
- rootKeySet.set(rootKey, {
213
- namespace: keyPrefix,
214
- representationName: RepresentationType,
215
- mergeable: false
216
- });
217
- return rootKeySet;
88
+ const VERSION = "fd4b3e3f68670957abe851597ce776bc";
89
+ function validate(obj, path = 'AutomatedActionApplyReminderRepresentation') {
90
+ const v_error = (() => {
91
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
92
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
93
+ }
94
+ const obj_errorCode = obj.errorCode;
95
+ const path_errorCode = path + '.errorCode';
96
+ if (typeof obj_errorCode !== 'string') {
97
+ return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
98
+ }
99
+ const obj_errorMessage = obj.errorMessage;
100
+ const path_errorMessage = path + '.errorMessage';
101
+ if (typeof obj_errorMessage !== 'string') {
102
+ return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
103
+ }
104
+ const obj_isSuccess = obj.isSuccess;
105
+ const path_isSuccess = path + '.isSuccess';
106
+ if (typeof obj_isSuccess !== 'boolean') {
107
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
108
+ }
109
+ const obj_reminderId = obj.reminderId;
110
+ const path_reminderId = path + '.reminderId';
111
+ if (typeof obj_reminderId !== 'string') {
112
+ return new TypeError('Expected "string" but received "' + typeof obj_reminderId + '" (at "' + path_reminderId + '")');
113
+ }
114
+ })();
115
+ return v_error === undefined ? null : v_error;
116
+ }
117
+ const RepresentationType = 'AutomatedActionApplyReminderRepresentation';
118
+ function keyBuilder(luvio, config) {
119
+ return keyPrefix + '::' + RepresentationType + ':' + config.id;
120
+ }
121
+ function keyBuilderFromType(luvio, object) {
122
+ const keyParams = {
123
+ id: object.reminderId
124
+ };
125
+ return keyBuilder(luvio, keyParams);
126
+ }
127
+ function normalize(input, existing, path, luvio, store, timestamp) {
128
+ return input;
129
+ }
130
+ const select$1 = function AutomatedActionApplyReminderRepresentationSelect() {
131
+ return {
132
+ kind: 'Fragment',
133
+ version: VERSION,
134
+ private: [],
135
+ selections: [
136
+ {
137
+ name: 'errorCode',
138
+ kind: 'Scalar'
139
+ },
140
+ {
141
+ name: 'errorMessage',
142
+ kind: 'Scalar'
143
+ },
144
+ {
145
+ name: 'isSuccess',
146
+ kind: 'Scalar'
147
+ },
148
+ {
149
+ name: 'reminderId',
150
+ kind: 'Scalar'
151
+ }
152
+ ]
153
+ };
154
+ };
155
+ function equals(existing, incoming) {
156
+ const existing_isSuccess = existing.isSuccess;
157
+ const incoming_isSuccess = incoming.isSuccess;
158
+ if (!(existing_isSuccess === incoming_isSuccess)) {
159
+ return false;
160
+ }
161
+ const existing_errorCode = existing.errorCode;
162
+ const incoming_errorCode = incoming.errorCode;
163
+ if (!(existing_errorCode === incoming_errorCode)) {
164
+ return false;
165
+ }
166
+ const existing_errorMessage = existing.errorMessage;
167
+ const incoming_errorMessage = incoming.errorMessage;
168
+ if (!(existing_errorMessage === incoming_errorMessage)) {
169
+ return false;
170
+ }
171
+ const existing_reminderId = existing.reminderId;
172
+ const incoming_reminderId = incoming.reminderId;
173
+ if (!(existing_reminderId === incoming_reminderId)) {
174
+ return false;
175
+ }
176
+ return true;
177
+ }
178
+ const ingest = function AutomatedActionApplyReminderRepresentationIngest(input, path, luvio, store, timestamp) {
179
+ if (process.env.NODE_ENV !== 'production') {
180
+ const validateError = validate(input);
181
+ if (validateError !== null) {
182
+ throw validateError;
183
+ }
184
+ }
185
+ const key = keyBuilderFromType(luvio, input);
186
+ const existingRecord = store.readEntry(key);
187
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 1000;
188
+ let incomingRecord = normalize(input, store.readEntry(key), {
189
+ fullPath: key,
190
+ parent: path.parent,
191
+ propertyName: path.propertyName,
192
+ ttl: ttlToUse
193
+ });
194
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
195
+ luvio.storePublish(key, incomingRecord);
196
+ }
197
+ if (ttlToUse !== undefined) {
198
+ const storeMetadataParams = {
199
+ ttl: ttlToUse,
200
+ namespace: "sales-automation-rules",
201
+ version: VERSION,
202
+ representationName: RepresentationType,
203
+ };
204
+ luvio.publishStoreMetadata(key, storeMetadataParams);
205
+ }
206
+ return createLink(key);
207
+ };
208
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
209
+ const rootKeySet = new StoreKeyMap();
210
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
211
+ const rootKey = keyBuilderFromType(luvio, input);
212
+ rootKeySet.set(rootKey, {
213
+ namespace: keyPrefix,
214
+ representationName: RepresentationType,
215
+ mergeable: false
216
+ });
217
+ return rootKeySet;
218
218
  }
219
219
 
220
- function select(luvio, params) {
221
- return select$1();
222
- }
223
- function getResponseCacheKeys(luvio, resourceParams, response) {
224
- return getTypeCacheKeys(luvio, response);
225
- }
226
- function ingestSuccess(luvio, resourceParams, response) {
227
- const { body } = response;
228
- const key = keyBuilderFromType(luvio, body);
229
- luvio.storeIngest(key, ingest, body);
230
- const snapshot = luvio.storeLookup({
231
- recordId: key,
232
- node: select(),
233
- variables: {},
234
- });
235
- if (process.env.NODE_ENV !== 'production') {
236
- if (snapshot.state !== 'Fulfilled') {
237
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
238
- }
239
- }
240
- return snapshot;
241
- }
242
- function createResourceRequest(config) {
243
- const headers = {};
244
- return {
245
- baseUri: '/services/data/v58.0',
246
- basePath: '/connect/automated-actions/reminder/apply',
247
- method: 'put',
248
- body: config.body,
249
- urlParams: {},
250
- queryParams: {},
251
- headers,
252
- priority: 'normal',
253
- };
220
+ function select(luvio, params) {
221
+ return select$1();
222
+ }
223
+ function getResponseCacheKeys(luvio, resourceParams, response) {
224
+ return getTypeCacheKeys(luvio, response);
225
+ }
226
+ function ingestSuccess(luvio, resourceParams, response) {
227
+ const { body } = response;
228
+ const key = keyBuilderFromType(luvio, body);
229
+ luvio.storeIngest(key, ingest, body);
230
+ const snapshot = luvio.storeLookup({
231
+ recordId: key,
232
+ node: select(),
233
+ variables: {},
234
+ });
235
+ if (process.env.NODE_ENV !== 'production') {
236
+ if (snapshot.state !== 'Fulfilled') {
237
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
238
+ }
239
+ }
240
+ return snapshot;
241
+ }
242
+ function createResourceRequest(config) {
243
+ const headers = {};
244
+ return {
245
+ baseUri: '/services/data/v58.0',
246
+ basePath: '/connect/automated-actions/reminder/apply',
247
+ method: 'put',
248
+ body: config.body,
249
+ urlParams: {},
250
+ queryParams: {},
251
+ headers,
252
+ priority: 'normal',
253
+ };
254
254
  }
255
255
 
256
- const applyReminder_ConfigPropertyNames = {
257
- displayName: 'applyReminder',
258
- parameters: {
259
- required: ['ApplyReminderInput'],
260
- optional: []
261
- }
262
- };
263
- function createResourceParams(config) {
264
- const resourceParams = {
265
- body: {
266
- ApplyReminderInput: config.ApplyReminderInput
267
- }
268
- };
269
- return resourceParams;
270
- }
271
- function typeCheckConfig(untrustedConfig) {
272
- const config = {};
273
- const untrustedConfig_ApplyReminderInput = untrustedConfig.ApplyReminderInput;
274
- const referenceAutomatedActionApplyReminderInputRepresentationValidationError = validate$1(untrustedConfig_ApplyReminderInput);
275
- if (referenceAutomatedActionApplyReminderInputRepresentationValidationError === null) {
276
- config.ApplyReminderInput = untrustedConfig_ApplyReminderInput;
277
- }
278
- return config;
279
- }
280
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
281
- if (!untrustedIsObject(untrustedConfig)) {
282
- return null;
283
- }
284
- if (process.env.NODE_ENV !== 'production') {
285
- validateConfig(untrustedConfig, configPropertyNames);
286
- }
287
- const config = typeCheckConfig(untrustedConfig);
288
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
289
- return null;
290
- }
291
- return config;
292
- }
293
- function buildNetworkSnapshot(luvio, config, options) {
294
- const resourceParams = createResourceParams(config);
295
- const request = createResourceRequest(resourceParams);
296
- return luvio.dispatchResourceRequest(request, options)
297
- .then((response) => {
298
- return luvio.handleSuccessResponse(() => {
299
- const snapshot = ingestSuccess(luvio, resourceParams, response);
300
- return luvio.storeBroadcast().then(() => snapshot);
301
- }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
302
- }, (response) => {
303
- deepFreeze(response);
304
- throw response;
305
- });
306
- }
307
- const applyReminderAdapterFactory = (luvio) => {
308
- return function applyReminder(untrustedConfig) {
309
- const config = validateAdapterConfig(untrustedConfig, applyReminder_ConfigPropertyNames);
310
- // Invalid or incomplete config
311
- if (config === null) {
312
- throw new Error('Invalid config for "applyReminder"');
313
- }
314
- return buildNetworkSnapshot(luvio, config);
315
- };
256
+ const applyReminder_ConfigPropertyNames = {
257
+ displayName: 'applyReminder',
258
+ parameters: {
259
+ required: ['ApplyReminderInput'],
260
+ optional: []
261
+ }
262
+ };
263
+ function createResourceParams(config) {
264
+ const resourceParams = {
265
+ body: {
266
+ ApplyReminderInput: config.ApplyReminderInput
267
+ }
268
+ };
269
+ return resourceParams;
270
+ }
271
+ function typeCheckConfig(untrustedConfig) {
272
+ const config = {};
273
+ const untrustedConfig_ApplyReminderInput = untrustedConfig.ApplyReminderInput;
274
+ const referenceAutomatedActionApplyReminderInputRepresentationValidationError = validate$1(untrustedConfig_ApplyReminderInput);
275
+ if (referenceAutomatedActionApplyReminderInputRepresentationValidationError === null) {
276
+ config.ApplyReminderInput = untrustedConfig_ApplyReminderInput;
277
+ }
278
+ return config;
279
+ }
280
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
281
+ if (!untrustedIsObject(untrustedConfig)) {
282
+ return null;
283
+ }
284
+ if (process.env.NODE_ENV !== 'production') {
285
+ validateConfig(untrustedConfig, configPropertyNames);
286
+ }
287
+ const config = typeCheckConfig(untrustedConfig);
288
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
289
+ return null;
290
+ }
291
+ return config;
292
+ }
293
+ function buildNetworkSnapshot(luvio, config, options) {
294
+ const resourceParams = createResourceParams(config);
295
+ const request = createResourceRequest(resourceParams);
296
+ return luvio.dispatchResourceRequest(request, options)
297
+ .then((response) => {
298
+ return luvio.handleSuccessResponse(() => {
299
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
300
+ return luvio.storeBroadcast().then(() => snapshot);
301
+ }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
302
+ }, (response) => {
303
+ deepFreeze(response);
304
+ throw response;
305
+ });
306
+ }
307
+ const applyReminderAdapterFactory = (luvio) => {
308
+ return function applyReminder(untrustedConfig) {
309
+ const config = validateAdapterConfig(untrustedConfig, applyReminder_ConfigPropertyNames);
310
+ // Invalid or incomplete config
311
+ if (config === null) {
312
+ throw new Error('Invalid config for "applyReminder"');
313
+ }
314
+ return buildNetworkSnapshot(luvio, config);
315
+ };
316
316
  };
317
317
 
318
318
  export { applyReminderAdapterFactory };