@salesforce/lds-adapters-marketing-prospect 1.371.0 → 1.372.1

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.
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$2, StoreKeyMap, createResourceParams as createResourceParams$2 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, typeCheckConfig as typeCheckConfig$4, StoreKeyMap, createResourceParams as createResourceParams$4 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -79,7 +79,7 @@ function createLink(ref) {
79
79
  };
80
80
  }
81
81
 
82
- function validate$1(obj, path = 'ConversionEntryRepresentation') {
82
+ function validate$4(obj, path = 'ConversionEntryRepresentation') {
83
83
  const v_error = (() => {
84
84
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
85
85
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -128,9 +128,9 @@ function validate$1(obj, path = 'ConversionEntryRepresentation') {
128
128
  return v_error === undefined ? null : v_error;
129
129
  }
130
130
 
131
- const TTL = 60000;
132
- const VERSION = "407aa680ebc397cf36cc1727ac369a87";
133
- function validate(obj, path = 'ConversionEntriesRepresentation') {
131
+ const TTL$2 = 60000;
132
+ const VERSION$2 = "407aa680ebc397cf36cc1727ac369a87";
133
+ function validate$3(obj, path = 'ConversionEntriesRepresentation') {
134
134
  const v_error = (() => {
135
135
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
136
136
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -143,7 +143,7 @@ function validate(obj, path = 'ConversionEntriesRepresentation') {
143
143
  for (let i = 0; i < obj_conversionEntries.length; i++) {
144
144
  const obj_conversionEntries_item = obj_conversionEntries[i];
145
145
  const path_conversionEntries_item = path_conversionEntries + '[' + i + ']';
146
- const referencepath_conversionEntries_itemValidationError = validate$1(obj_conversionEntries_item, path_conversionEntries_item);
146
+ const referencepath_conversionEntries_itemValidationError = validate$4(obj_conversionEntries_item, path_conversionEntries_item);
147
147
  if (referencepath_conversionEntries_itemValidationError !== null) {
148
148
  let message = 'Object doesn\'t match ConversionEntryRepresentation (at "' + path_conversionEntries_item + '")\n';
149
149
  message += referencepath_conversionEntries_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -159,7 +159,7 @@ function validate(obj, path = 'ConversionEntriesRepresentation') {
159
159
  for (let i = 0; i < obj_postConversionEntries.length; i++) {
160
160
  const obj_postConversionEntries_item = obj_postConversionEntries[i];
161
161
  const path_postConversionEntries_item = path_postConversionEntries + '[' + i + ']';
162
- const referencepath_postConversionEntries_itemValidationError = validate$1(obj_postConversionEntries_item, path_postConversionEntries_item);
162
+ const referencepath_postConversionEntries_itemValidationError = validate$4(obj_postConversionEntries_item, path_postConversionEntries_item);
163
163
  if (referencepath_postConversionEntries_itemValidationError !== null) {
164
164
  let message = 'Object doesn\'t match ConversionEntryRepresentation (at "' + path_postConversionEntries_item + '")\n';
165
165
  message += referencepath_postConversionEntries_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -170,62 +170,62 @@ function validate(obj, path = 'ConversionEntriesRepresentation') {
170
170
  })();
171
171
  return v_error === undefined ? null : v_error;
172
172
  }
173
- const RepresentationType = 'ConversionEntriesRepresentation';
174
- function normalize(input, existing, path, luvio, store, timestamp) {
173
+ const RepresentationType$2 = 'ConversionEntriesRepresentation';
174
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
175
175
  return input;
176
176
  }
177
- const select$2 = function ConversionEntriesRepresentationSelect() {
177
+ const select$6 = function ConversionEntriesRepresentationSelect() {
178
178
  return {
179
179
  kind: 'Fragment',
180
- version: VERSION,
180
+ version: VERSION$2,
181
181
  private: [],
182
182
  opaque: true
183
183
  };
184
184
  };
185
- function equals(existing, incoming) {
185
+ function equals$2(existing, incoming) {
186
186
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
187
187
  return false;
188
188
  }
189
189
  return true;
190
190
  }
191
- const ingest = function ConversionEntriesRepresentationIngest(input, path, luvio, store, timestamp) {
191
+ const ingest$2 = function ConversionEntriesRepresentationIngest(input, path, luvio, store, timestamp) {
192
192
  if (process.env.NODE_ENV !== 'production') {
193
- const validateError = validate(input);
193
+ const validateError = validate$3(input);
194
194
  if (validateError !== null) {
195
195
  throw validateError;
196
196
  }
197
197
  }
198
198
  const key = path.fullPath;
199
- const ttlToUse = TTL;
200
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "Prospect", VERSION, RepresentationType, equals);
199
+ const ttlToUse = TTL$2;
200
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "Prospect", VERSION$2, RepresentationType$2, equals$2);
201
201
  return createLink(key);
202
202
  };
203
- function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
203
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
204
204
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
205
205
  const rootKey = fullPathFactory();
206
206
  rootKeySet.set(rootKey, {
207
207
  namespace: keyPrefix,
208
- representationName: RepresentationType,
208
+ representationName: RepresentationType$2,
209
209
  mergeable: false
210
210
  });
211
211
  }
212
212
 
213
- function select$1(luvio, params) {
214
- return select$2();
213
+ function select$5(luvio, params) {
214
+ return select$6();
215
215
  }
216
- function keyBuilder$3(luvio, params) {
216
+ function keyBuilder$6(luvio, params) {
217
217
  return keyPrefix + '::ConversionEntriesRepresentation:(' + 'contactMap:' + params.queryParams.contactMap + ',' + 'leadMap:' + params.queryParams.leadMap + ',' + 'owner:' + params.queryParams.owner + ',' + 'personAccountMap:' + params.queryParams.personAccountMap + ',' + 'prospectId:' + params.queryParams.prospectId + ',' + 'status:' + params.queryParams.status + ')';
218
218
  }
219
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
220
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
219
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
220
+ getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
221
221
  }
222
- function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
222
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
223
223
  const { body } = response;
224
- const key = keyBuilder$3(luvio, resourceParams);
225
- luvio.storeIngest(key, ingest, body);
224
+ const key = keyBuilder$6(luvio, resourceParams);
225
+ luvio.storeIngest(key, ingest$2, body);
226
226
  const snapshot = luvio.storeLookup({
227
227
  recordId: key,
228
- node: select$1(),
228
+ node: select$5(),
229
229
  variables: {},
230
230
  }, snapshotRefresh);
231
231
  if (process.env.NODE_ENV !== 'production') {
@@ -236,19 +236,19 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
236
236
  deepFreeze(snapshot.data);
237
237
  return snapshot;
238
238
  }
239
- function ingestError$1(luvio, params, error, snapshotRefresh) {
240
- const key = keyBuilder$3(luvio, params);
239
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
240
+ const key = keyBuilder$6(luvio, params);
241
241
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
242
242
  const storeMetadataParams = {
243
- ttl: TTL,
243
+ ttl: TTL$2,
244
244
  namespace: keyPrefix,
245
- version: VERSION,
246
- representationName: RepresentationType
245
+ version: VERSION$2,
246
+ representationName: RepresentationType$2
247
247
  };
248
248
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
249
249
  return errorSnapshot;
250
250
  }
251
- function createResourceRequest$1(config) {
251
+ function createResourceRequest$3(config) {
252
252
  const headers = {};
253
253
  return {
254
254
  baseUri: '/services/data/v65.0',
@@ -262,7 +262,7 @@ function createResourceRequest$1(config) {
262
262
  };
263
263
  }
264
264
 
265
- const adapterName$1 = 'getConversionEntries';
265
+ const adapterName$3 = 'getConversionEntries';
266
266
  const getConversionEntries_ConfigPropertyMetadata = [
267
267
  generateParamConfigMetadata('contactMap', false, 1 /* QueryParameter */, 0 /* String */),
268
268
  generateParamConfigMetadata('leadMap', false, 1 /* QueryParameter */, 0 /* String */),
@@ -271,104 +271,104 @@ const getConversionEntries_ConfigPropertyMetadata = [
271
271
  generateParamConfigMetadata('prospectId', false, 1 /* QueryParameter */, 0 /* String */),
272
272
  generateParamConfigMetadata('status', false, 1 /* QueryParameter */, 0 /* String */),
273
273
  ];
274
- const getConversionEntries_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getConversionEntries_ConfigPropertyMetadata);
275
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(getConversionEntries_ConfigPropertyMetadata);
276
- function keyBuilder$2(luvio, config) {
277
- const resourceParams = createResourceParams$1(config);
278
- return keyBuilder$3(luvio, resourceParams);
274
+ const getConversionEntries_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getConversionEntries_ConfigPropertyMetadata);
275
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(getConversionEntries_ConfigPropertyMetadata);
276
+ function keyBuilder$5(luvio, config) {
277
+ const resourceParams = createResourceParams$3(config);
278
+ return keyBuilder$6(luvio, resourceParams);
279
279
  }
280
- function typeCheckConfig$1(untrustedConfig) {
280
+ function typeCheckConfig$3(untrustedConfig) {
281
281
  const config = {};
282
- typeCheckConfig$2(untrustedConfig, config, getConversionEntries_ConfigPropertyMetadata);
282
+ typeCheckConfig$4(untrustedConfig, config, getConversionEntries_ConfigPropertyMetadata);
283
283
  return config;
284
284
  }
285
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
285
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
286
286
  if (!untrustedIsObject(untrustedConfig)) {
287
287
  return null;
288
288
  }
289
289
  if (process.env.NODE_ENV !== 'production') {
290
290
  validateConfig(untrustedConfig, configPropertyNames);
291
291
  }
292
- const config = typeCheckConfig$1(untrustedConfig);
292
+ const config = typeCheckConfig$3(untrustedConfig);
293
293
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
294
294
  return null;
295
295
  }
296
296
  return config;
297
297
  }
298
- function adapterFragment$1(luvio, config) {
299
- createResourceParams$1(config);
300
- return select$1();
298
+ function adapterFragment$2(luvio, config) {
299
+ createResourceParams$3(config);
300
+ return select$5();
301
301
  }
302
- function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
303
- const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
302
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
303
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
304
304
  config,
305
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
305
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
306
306
  });
307
307
  return luvio.storeBroadcast().then(() => snapshot);
308
308
  }
309
- function onFetchResponseError$1(luvio, config, resourceParams, response) {
310
- const snapshot = ingestError$1(luvio, resourceParams, response, {
309
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
310
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
311
311
  config,
312
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
312
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
313
313
  });
314
314
  return luvio.storeBroadcast().then(() => snapshot);
315
315
  }
316
- function buildNetworkSnapshot$1(luvio, config, options) {
317
- const resourceParams = createResourceParams$1(config);
318
- const request = createResourceRequest$1(resourceParams);
316
+ function buildNetworkSnapshot$3(luvio, config, options) {
317
+ const resourceParams = createResourceParams$3(config);
318
+ const request = createResourceRequest$3(resourceParams);
319
319
  return luvio.dispatchResourceRequest(request, options)
320
320
  .then((response) => {
321
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
321
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
322
322
  const cache = new StoreKeyMap();
323
- getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
323
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
324
324
  return cache;
325
325
  });
326
326
  }, (response) => {
327
- return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
327
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
328
328
  });
329
329
  }
330
- function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
331
- return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
330
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
331
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
332
332
  }
333
- function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
333
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
334
334
  const { luvio, config } = context;
335
335
  const selector = {
336
- recordId: keyBuilder$2(luvio, config),
337
- node: adapterFragment$1(luvio, config),
336
+ recordId: keyBuilder$5(luvio, config),
337
+ node: adapterFragment$2(luvio, config),
338
338
  variables: {},
339
339
  };
340
340
  const cacheSnapshot = storeLookup(selector, {
341
341
  config,
342
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
342
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
343
343
  });
344
344
  return cacheSnapshot;
345
345
  }
346
346
  const getConversionEntriesAdapterFactory = (luvio) => function Prospect__getConversionEntries(untrustedConfig, requestContext) {
347
- const config = validateAdapterConfig$1(untrustedConfig, getConversionEntries_ConfigPropertyNames);
347
+ const config = validateAdapterConfig$3(untrustedConfig, getConversionEntries_ConfigPropertyNames);
348
348
  // Invalid or incomplete config
349
349
  if (config === null) {
350
350
  return null;
351
351
  }
352
352
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
353
- buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
353
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
354
354
  };
355
355
 
356
- function select(luvio, params) {
357
- return select$2();
356
+ function select$4(luvio, params) {
357
+ return select$6();
358
358
  }
359
- function keyBuilder$1(luvio, params) {
359
+ function keyBuilder$4(luvio, params) {
360
360
  return keyPrefix + '::ConversionEntriesRepresentation:(' + 'accountName:' + params.body.accountName + '::' + 'contactFirstName:' + params.body.contactFirstName + '::' + 'contactLastName:' + params.body.contactLastName + '::' + 'contactSalutation:' + params.body.contactSalutation + '::' + 'convertedStatus:' + params.body.convertedStatus + '::' + 'createOpportunity:' + params.body.createOpportunity + '::' + 'existingAccountId:' + params.body.existingAccountId + '::' + 'existingContactId:' + params.body.existingContactId + '::' + 'existingLeadId:' + params.body.existingLeadId + '::' + 'existingOpportunityId:' + params.body.existingOpportunityId + '::' + 'leadCompany:' + params.body.leadCompany + '::' + 'leadFirstName:' + params.body.leadFirstName + '::' + 'leadLastName:' + params.body.leadLastName + '::' + 'leadSalutation:' + params.body.leadSalutation + '::' + 'opportunityName:' + params.body.opportunityName + '::' + 'ownerId:' + params.body.ownerId + '::' + 'prospectId:' + params.body.prospectId + ')';
361
361
  }
362
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
363
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
362
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
363
+ getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
364
364
  }
365
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
365
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
366
366
  const { body } = response;
367
- const key = keyBuilder$1(luvio, resourceParams);
368
- luvio.storeIngest(key, ingest, body);
367
+ const key = keyBuilder$4(luvio, resourceParams);
368
+ luvio.storeIngest(key, ingest$2, body);
369
369
  const snapshot = luvio.storeLookup({
370
370
  recordId: key,
371
- node: select(),
371
+ node: select$4(),
372
372
  variables: {},
373
373
  }, snapshotRefresh);
374
374
  if (process.env.NODE_ENV !== 'production') {
@@ -379,19 +379,19 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
379
379
  deepFreeze(snapshot.data);
380
380
  return snapshot;
381
381
  }
382
- function ingestError(luvio, params, error, snapshotRefresh) {
383
- const key = keyBuilder$1(luvio, params);
382
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
383
+ const key = keyBuilder$4(luvio, params);
384
384
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
385
385
  const storeMetadataParams = {
386
- ttl: TTL,
386
+ ttl: TTL$2,
387
387
  namespace: keyPrefix,
388
- version: VERSION,
389
- representationName: RepresentationType
388
+ version: VERSION$2,
389
+ representationName: RepresentationType$2
390
390
  };
391
391
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
392
392
  return errorSnapshot;
393
393
  }
394
- function createResourceRequest(config) {
394
+ function createResourceRequest$2(config) {
395
395
  const headers = {};
396
396
  return {
397
397
  baseUri: '/services/data/v65.0',
@@ -405,7 +405,7 @@ function createResourceRequest(config) {
405
405
  };
406
406
  }
407
407
 
408
- const adapterName = 'getPostConversionEntries';
408
+ const adapterName$2 = 'getPostConversionEntries';
409
409
  const getPostConversionEntries_ConfigPropertyMetadata = [
410
410
  generateParamConfigMetadata('accountName', true, 2 /* Body */, 0 /* String */),
411
411
  generateParamConfigMetadata('contactFirstName', true, 2 /* Body */, 0 /* String */),
@@ -425,56 +425,321 @@ const getPostConversionEntries_ConfigPropertyMetadata = [
425
425
  generateParamConfigMetadata('ownerId', true, 2 /* Body */, 0 /* String */),
426
426
  generateParamConfigMetadata('prospectId', true, 2 /* Body */, 0 /* String */),
427
427
  ];
428
- const getPostConversionEntries_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getPostConversionEntries_ConfigPropertyMetadata);
429
- const createResourceParams = /*#__PURE__*/ createResourceParams$2(getPostConversionEntries_ConfigPropertyMetadata);
430
- function keyBuilder(luvio, config) {
431
- const resourceParams = createResourceParams(config);
432
- return keyBuilder$1(luvio, resourceParams);
428
+ const getPostConversionEntries_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getPostConversionEntries_ConfigPropertyMetadata);
429
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(getPostConversionEntries_ConfigPropertyMetadata);
430
+ function keyBuilder$3(luvio, config) {
431
+ const resourceParams = createResourceParams$2(config);
432
+ return keyBuilder$4(luvio, resourceParams);
433
433
  }
434
- function typeCheckConfig(untrustedConfig) {
434
+ function typeCheckConfig$2(untrustedConfig) {
435
435
  const config = {};
436
- typeCheckConfig$2(untrustedConfig, config, getPostConversionEntries_ConfigPropertyMetadata);
436
+ typeCheckConfig$4(untrustedConfig, config, getPostConversionEntries_ConfigPropertyMetadata);
437
437
  return config;
438
438
  }
439
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
439
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
440
440
  if (!untrustedIsObject(untrustedConfig)) {
441
441
  return null;
442
442
  }
443
443
  if (process.env.NODE_ENV !== 'production') {
444
444
  validateConfig(untrustedConfig, configPropertyNames);
445
445
  }
446
- const config = typeCheckConfig(untrustedConfig);
446
+ const config = typeCheckConfig$2(untrustedConfig);
447
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
448
+ return null;
449
+ }
450
+ return config;
451
+ }
452
+ function adapterFragment$1(luvio, config) {
453
+ createResourceParams$2(config);
454
+ return select$4();
455
+ }
456
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
457
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
458
+ config,
459
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
460
+ });
461
+ return luvio.storeBroadcast().then(() => snapshot);
462
+ }
463
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
464
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
465
+ config,
466
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
467
+ });
468
+ return luvio.storeBroadcast().then(() => snapshot);
469
+ }
470
+ function buildNetworkSnapshot$2(luvio, config, options) {
471
+ const resourceParams = createResourceParams$2(config);
472
+ const request = createResourceRequest$2(resourceParams);
473
+ return luvio.dispatchResourceRequest(request, options)
474
+ .then((response) => {
475
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
476
+ const cache = new StoreKeyMap();
477
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
478
+ return cache;
479
+ });
480
+ }, (response) => {
481
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
482
+ });
483
+ }
484
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
485
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, 'get', false);
486
+ }
487
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
488
+ const { luvio, config } = context;
489
+ const selector = {
490
+ recordId: keyBuilder$3(luvio, config),
491
+ node: adapterFragment$1(luvio, config),
492
+ variables: {},
493
+ };
494
+ const cacheSnapshot = storeLookup(selector, {
495
+ config,
496
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
497
+ });
498
+ return cacheSnapshot;
499
+ }
500
+ const getPostConversionEntriesAdapterFactory = (luvio) => function Prospect__getPostConversionEntries(untrustedConfig, requestContext) {
501
+ const config = validateAdapterConfig$2(untrustedConfig, getPostConversionEntries_ConfigPropertyNames);
502
+ // Invalid or incomplete config
503
+ if (config === null) {
504
+ return null;
505
+ }
506
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
507
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
508
+ };
509
+
510
+ function validate$2(obj, path = 'OutputObjectFieldMapping') {
511
+ const v_error = (() => {
512
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
513
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
514
+ }
515
+ const obj_mappedFields = obj.mappedFields;
516
+ const path_mappedFields = path + '.mappedFields';
517
+ if (!ArrayIsArray(obj_mappedFields)) {
518
+ return new TypeError('Expected "array" but received "' + typeof obj_mappedFields + '" (at "' + path_mappedFields + '")');
519
+ }
520
+ for (let i = 0; i < obj_mappedFields.length; i++) {
521
+ const obj_mappedFields_item = obj_mappedFields[i];
522
+ const path_mappedFields_item = path_mappedFields + '[' + i + ']';
523
+ if (typeof obj_mappedFields_item !== 'object' || Array.isArray(obj_mappedFields_item)) {
524
+ return new TypeError('Expected "object" but received "' + typeof obj_mappedFields_item + '" (at "' + path_mappedFields_item + '")');
525
+ }
526
+ }
527
+ const obj_outputObject = obj.outputObject;
528
+ const path_outputObject = path + '.outputObject';
529
+ if (typeof obj_outputObject !== 'string') {
530
+ return new TypeError('Expected "string" but received "' + typeof obj_outputObject + '" (at "' + path_outputObject + '")');
531
+ }
532
+ const obj_unmappedInputObjectFields = obj.unmappedInputObjectFields;
533
+ const path_unmappedInputObjectFields = path + '.unmappedInputObjectFields';
534
+ if (!ArrayIsArray(obj_unmappedInputObjectFields)) {
535
+ return new TypeError('Expected "array" but received "' + typeof obj_unmappedInputObjectFields + '" (at "' + path_unmappedInputObjectFields + '")');
536
+ }
537
+ for (let i = 0; i < obj_unmappedInputObjectFields.length; i++) {
538
+ const obj_unmappedInputObjectFields_item = obj_unmappedInputObjectFields[i];
539
+ const path_unmappedInputObjectFields_item = path_unmappedInputObjectFields + '[' + i + ']';
540
+ if (typeof obj_unmappedInputObjectFields_item !== 'object' || Array.isArray(obj_unmappedInputObjectFields_item)) {
541
+ return new TypeError('Expected "object" but received "' + typeof obj_unmappedInputObjectFields_item + '" (at "' + path_unmappedInputObjectFields_item + '")');
542
+ }
543
+ }
544
+ const obj_unmappedOutputObjectFields = obj.unmappedOutputObjectFields;
545
+ const path_unmappedOutputObjectFields = path + '.unmappedOutputObjectFields';
546
+ if (!ArrayIsArray(obj_unmappedOutputObjectFields)) {
547
+ return new TypeError('Expected "array" but received "' + typeof obj_unmappedOutputObjectFields + '" (at "' + path_unmappedOutputObjectFields + '")');
548
+ }
549
+ for (let i = 0; i < obj_unmappedOutputObjectFields.length; i++) {
550
+ const obj_unmappedOutputObjectFields_item = obj_unmappedOutputObjectFields[i];
551
+ const path_unmappedOutputObjectFields_item = path_unmappedOutputObjectFields + '[' + i + ']';
552
+ if (typeof obj_unmappedOutputObjectFields_item !== 'object' || Array.isArray(obj_unmappedOutputObjectFields_item)) {
553
+ return new TypeError('Expected "object" but received "' + typeof obj_unmappedOutputObjectFields_item + '" (at "' + path_unmappedOutputObjectFields_item + '")');
554
+ }
555
+ }
556
+ })();
557
+ return v_error === undefined ? null : v_error;
558
+ }
559
+
560
+ const TTL$1 = 60000;
561
+ const VERSION$1 = "67ce8674432bf552758d6c31fe7b1e2c";
562
+ function validate$1(obj, path = 'ProspectFieldMappingOutputGetRepresentation') {
563
+ const v_error = (() => {
564
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
565
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
566
+ }
567
+ const obj_apiErrorCode = obj.apiErrorCode;
568
+ const path_apiErrorCode = path + '.apiErrorCode';
569
+ if (typeof obj_apiErrorCode !== 'string') {
570
+ return new TypeError('Expected "string" but received "' + typeof obj_apiErrorCode + '" (at "' + path_apiErrorCode + '")');
571
+ }
572
+ const obj_apiErrorMsg = obj.apiErrorMsg;
573
+ const path_apiErrorMsg = path + '.apiErrorMsg';
574
+ if (typeof obj_apiErrorMsg !== 'string') {
575
+ return new TypeError('Expected "string" but received "' + typeof obj_apiErrorMsg + '" (at "' + path_apiErrorMsg + '")');
576
+ }
577
+ const obj_httpStatusCode = obj.httpStatusCode;
578
+ const path_httpStatusCode = path + '.httpStatusCode';
579
+ if (typeof obj_httpStatusCode !== 'string') {
580
+ return new TypeError('Expected "string" but received "' + typeof obj_httpStatusCode + '" (at "' + path_httpStatusCode + '")');
581
+ }
582
+ const obj_outputObjectFieldMappings = obj.outputObjectFieldMappings;
583
+ const path_outputObjectFieldMappings = path + '.outputObjectFieldMappings';
584
+ if (!ArrayIsArray(obj_outputObjectFieldMappings)) {
585
+ return new TypeError('Expected "array" but received "' + typeof obj_outputObjectFieldMappings + '" (at "' + path_outputObjectFieldMappings + '")');
586
+ }
587
+ for (let i = 0; i < obj_outputObjectFieldMappings.length; i++) {
588
+ const obj_outputObjectFieldMappings_item = obj_outputObjectFieldMappings[i];
589
+ const path_outputObjectFieldMappings_item = path_outputObjectFieldMappings + '[' + i + ']';
590
+ const referencepath_outputObjectFieldMappings_itemValidationError = validate$2(obj_outputObjectFieldMappings_item, path_outputObjectFieldMappings_item);
591
+ if (referencepath_outputObjectFieldMappings_itemValidationError !== null) {
592
+ let message = 'Object doesn\'t match OutputObjectFieldMapping (at "' + path_outputObjectFieldMappings_item + '")\n';
593
+ message += referencepath_outputObjectFieldMappings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
594
+ return new TypeError(message);
595
+ }
596
+ }
597
+ })();
598
+ return v_error === undefined ? null : v_error;
599
+ }
600
+ const RepresentationType$1 = 'ProspectFieldMappingOutputGetRepresentation';
601
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
602
+ return input;
603
+ }
604
+ const select$3 = function ProspectFieldMappingOutputGetRepresentationSelect() {
605
+ return {
606
+ kind: 'Fragment',
607
+ version: VERSION$1,
608
+ private: [],
609
+ opaque: true
610
+ };
611
+ };
612
+ function equals$1(existing, incoming) {
613
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
614
+ return false;
615
+ }
616
+ return true;
617
+ }
618
+ const ingest$1 = function ProspectFieldMappingOutputGetRepresentationIngest(input, path, luvio, store, timestamp) {
619
+ if (process.env.NODE_ENV !== 'production') {
620
+ const validateError = validate$1(input);
621
+ if (validateError !== null) {
622
+ throw validateError;
623
+ }
624
+ }
625
+ const key = path.fullPath;
626
+ const ttlToUse = TTL$1;
627
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "Prospect", VERSION$1, RepresentationType$1, equals$1);
628
+ return createLink(key);
629
+ };
630
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
631
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
632
+ const rootKey = fullPathFactory();
633
+ rootKeySet.set(rootKey, {
634
+ namespace: keyPrefix,
635
+ representationName: RepresentationType$1,
636
+ mergeable: false
637
+ });
638
+ }
639
+
640
+ function select$2(luvio, params) {
641
+ return select$3();
642
+ }
643
+ function keyBuilder$2(luvio, params) {
644
+ return keyPrefix + '::ProspectFieldMappingOutputGetRepresentation:(' + ')';
645
+ }
646
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
647
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$2());
648
+ }
649
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
650
+ const { body } = response;
651
+ const key = keyBuilder$2();
652
+ luvio.storeIngest(key, ingest$1, body);
653
+ const snapshot = luvio.storeLookup({
654
+ recordId: key,
655
+ node: select$2(),
656
+ variables: {},
657
+ }, snapshotRefresh);
658
+ if (process.env.NODE_ENV !== 'production') {
659
+ if (snapshot.state !== 'Fulfilled') {
660
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
661
+ }
662
+ }
663
+ deepFreeze(snapshot.data);
664
+ return snapshot;
665
+ }
666
+ function ingestError(luvio, params, error, snapshotRefresh) {
667
+ const key = keyBuilder$2();
668
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
669
+ const storeMetadataParams = {
670
+ ttl: TTL$1,
671
+ namespace: keyPrefix,
672
+ version: VERSION$1,
673
+ representationName: RepresentationType$1
674
+ };
675
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
676
+ return errorSnapshot;
677
+ }
678
+ function createResourceRequest$1(config) {
679
+ const headers = {};
680
+ return {
681
+ baseUri: '/services/data/v65.0',
682
+ basePath: '/connect/ProspectFieldMapping',
683
+ method: 'get',
684
+ body: null,
685
+ urlParams: {},
686
+ queryParams: {},
687
+ headers,
688
+ priority: 'normal',
689
+ };
690
+ }
691
+
692
+ const adapterName$1 = 'getProspectFieldMappings';
693
+ const getProspectFieldMappings_ConfigPropertyMetadata = [];
694
+ const getProspectFieldMappings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getProspectFieldMappings_ConfigPropertyMetadata);
695
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getProspectFieldMappings_ConfigPropertyMetadata);
696
+ function keyBuilder$1(luvio, config) {
697
+ createResourceParams$1(config);
698
+ return keyBuilder$2();
699
+ }
700
+ function typeCheckConfig$1(untrustedConfig) {
701
+ const config = {};
702
+ return config;
703
+ }
704
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
705
+ if (!untrustedIsObject(untrustedConfig)) {
706
+ return null;
707
+ }
708
+ if (process.env.NODE_ENV !== 'production') {
709
+ validateConfig(untrustedConfig, configPropertyNames);
710
+ }
711
+ const config = typeCheckConfig$1();
447
712
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
448
713
  return null;
449
714
  }
450
715
  return config;
451
716
  }
452
717
  function adapterFragment(luvio, config) {
453
- createResourceParams(config);
454
- return select();
718
+ createResourceParams$1(config);
719
+ return select$2();
455
720
  }
456
721
  function onFetchResponseSuccess(luvio, config, resourceParams, response) {
457
- const snapshot = ingestSuccess(luvio, resourceParams, response, {
722
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
458
723
  config,
459
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
724
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
460
725
  });
461
726
  return luvio.storeBroadcast().then(() => snapshot);
462
727
  }
463
728
  function onFetchResponseError(luvio, config, resourceParams, response) {
464
729
  const snapshot = ingestError(luvio, resourceParams, response, {
465
730
  config,
466
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
731
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
467
732
  });
468
733
  return luvio.storeBroadcast().then(() => snapshot);
469
734
  }
470
- function buildNetworkSnapshot(luvio, config, options) {
471
- const resourceParams = createResourceParams(config);
472
- const request = createResourceRequest(resourceParams);
735
+ function buildNetworkSnapshot$1(luvio, config, options) {
736
+ const resourceParams = createResourceParams$1(config);
737
+ const request = createResourceRequest$1();
473
738
  return luvio.dispatchResourceRequest(request, options)
474
739
  .then((response) => {
475
740
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
476
741
  const cache = new StoreKeyMap();
477
- getResponseCacheKeys(cache, luvio, resourceParams, response.body);
742
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
478
743
  return cache;
479
744
  });
480
745
  }, (response) => {
@@ -482,23 +747,23 @@ function buildNetworkSnapshot(luvio, config, options) {
482
747
  });
483
748
  }
484
749
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
485
- return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
750
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
486
751
  }
487
752
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
488
753
  const { luvio, config } = context;
489
754
  const selector = {
490
- recordId: keyBuilder(luvio, config),
755
+ recordId: keyBuilder$1(luvio, config),
491
756
  node: adapterFragment(luvio, config),
492
757
  variables: {},
493
758
  };
494
759
  const cacheSnapshot = storeLookup(selector, {
495
760
  config,
496
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
761
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
497
762
  });
498
763
  return cacheSnapshot;
499
764
  }
500
- const getPostConversionEntriesAdapterFactory = (luvio) => function Prospect__getPostConversionEntries(untrustedConfig, requestContext) {
501
- const config = validateAdapterConfig(untrustedConfig, getPostConversionEntries_ConfigPropertyNames);
765
+ const getProspectFieldMappingsAdapterFactory = (luvio) => function Prospect__getProspectFieldMappings(untrustedConfig, requestContext) {
766
+ const config = validateAdapterConfig$1(untrustedConfig, getProspectFieldMappings_ConfigPropertyNames);
502
767
  // Invalid or incomplete config
503
768
  if (config === null) {
504
769
  return null;
@@ -507,4 +772,204 @@ const getPostConversionEntriesAdapterFactory = (luvio) => function Prospect__get
507
772
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
508
773
  };
509
774
 
510
- export { getConversionEntriesAdapterFactory, getPostConversionEntriesAdapterFactory };
775
+ const TTL = 500;
776
+ const VERSION = "a6993f1f7ae745dc378e2bb9a1fc610b";
777
+ function validate(obj, path = 'ProspectFieldMappingOutputPostRepresentation') {
778
+ const v_error = (() => {
779
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
780
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
781
+ }
782
+ const obj_apiErrorCode = obj.apiErrorCode;
783
+ const path_apiErrorCode = path + '.apiErrorCode';
784
+ if (typeof obj_apiErrorCode !== 'string') {
785
+ return new TypeError('Expected "string" but received "' + typeof obj_apiErrorCode + '" (at "' + path_apiErrorCode + '")');
786
+ }
787
+ const obj_apiErrorMsg = obj.apiErrorMsg;
788
+ const path_apiErrorMsg = path + '.apiErrorMsg';
789
+ if (typeof obj_apiErrorMsg !== 'string') {
790
+ return new TypeError('Expected "string" but received "' + typeof obj_apiErrorMsg + '" (at "' + path_apiErrorMsg + '")');
791
+ }
792
+ const obj_httpStatusCode = obj.httpStatusCode;
793
+ const path_httpStatusCode = path + '.httpStatusCode';
794
+ if (typeof obj_httpStatusCode !== 'string') {
795
+ return new TypeError('Expected "string" but received "' + typeof obj_httpStatusCode + '" (at "' + path_httpStatusCode + '")');
796
+ }
797
+ })();
798
+ return v_error === undefined ? null : v_error;
799
+ }
800
+ const RepresentationType = 'ProspectFieldMappingOutputPostRepresentation';
801
+ function keyBuilder(luvio, config) {
802
+ return keyPrefix + '::' + RepresentationType + ':' + config.httpStatusCode;
803
+ }
804
+ function keyBuilderFromType(luvio, object) {
805
+ const keyParams = {
806
+ httpStatusCode: object.httpStatusCode
807
+ };
808
+ return keyBuilder(luvio, keyParams);
809
+ }
810
+ function normalize(input, existing, path, luvio, store, timestamp) {
811
+ return input;
812
+ }
813
+ const select$1 = function ProspectFieldMappingOutputPostRepresentationSelect() {
814
+ return {
815
+ kind: 'Fragment',
816
+ version: VERSION,
817
+ private: [],
818
+ selections: [
819
+ {
820
+ name: 'apiErrorCode',
821
+ kind: 'Scalar'
822
+ },
823
+ {
824
+ name: 'apiErrorMsg',
825
+ kind: 'Scalar'
826
+ },
827
+ {
828
+ name: 'httpStatusCode',
829
+ kind: 'Scalar'
830
+ }
831
+ ]
832
+ };
833
+ };
834
+ function equals(existing, incoming) {
835
+ const existing_apiErrorCode = existing.apiErrorCode;
836
+ const incoming_apiErrorCode = incoming.apiErrorCode;
837
+ if (!(existing_apiErrorCode === incoming_apiErrorCode)) {
838
+ return false;
839
+ }
840
+ const existing_apiErrorMsg = existing.apiErrorMsg;
841
+ const incoming_apiErrorMsg = incoming.apiErrorMsg;
842
+ if (!(existing_apiErrorMsg === incoming_apiErrorMsg)) {
843
+ return false;
844
+ }
845
+ const existing_httpStatusCode = existing.httpStatusCode;
846
+ const incoming_httpStatusCode = incoming.httpStatusCode;
847
+ if (!(existing_httpStatusCode === incoming_httpStatusCode)) {
848
+ return false;
849
+ }
850
+ return true;
851
+ }
852
+ const ingest = function ProspectFieldMappingOutputPostRepresentationIngest(input, path, luvio, store, timestamp) {
853
+ if (process.env.NODE_ENV !== 'production') {
854
+ const validateError = validate(input);
855
+ if (validateError !== null) {
856
+ throw validateError;
857
+ }
858
+ }
859
+ const key = keyBuilderFromType(luvio, input);
860
+ const ttlToUse = TTL;
861
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "Prospect", VERSION, RepresentationType, equals);
862
+ return createLink(key);
863
+ };
864
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
865
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
866
+ const rootKey = keyBuilderFromType(luvio, input);
867
+ rootKeySet.set(rootKey, {
868
+ namespace: keyPrefix,
869
+ representationName: RepresentationType,
870
+ mergeable: false
871
+ });
872
+ }
873
+
874
+ function select(luvio, params) {
875
+ return select$1();
876
+ }
877
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
878
+ getTypeCacheKeys(storeKeyMap, luvio, response);
879
+ }
880
+ function ingestSuccess(luvio, resourceParams, response) {
881
+ const { body } = response;
882
+ const key = keyBuilderFromType(luvio, body);
883
+ luvio.storeIngest(key, ingest, body);
884
+ const snapshot = luvio.storeLookup({
885
+ recordId: key,
886
+ node: select(),
887
+ variables: {},
888
+ });
889
+ if (process.env.NODE_ENV !== 'production') {
890
+ if (snapshot.state !== 'Fulfilled') {
891
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
892
+ }
893
+ }
894
+ deepFreeze(snapshot.data);
895
+ return snapshot;
896
+ }
897
+ function createResourceRequest(config) {
898
+ const headers = {};
899
+ return {
900
+ baseUri: '/services/data/v65.0',
901
+ basePath: '/connect/ProspectFieldMapping',
902
+ method: 'post',
903
+ body: config.body,
904
+ urlParams: {},
905
+ queryParams: {},
906
+ headers,
907
+ priority: 'normal',
908
+ };
909
+ }
910
+
911
+ const adapterName = 'saveProspectFieldMappings';
912
+ const saveProspectFieldMappings_ConfigPropertyMetadata = [
913
+ generateParamConfigMetadata('outputObjectFieldMappings', false, 2 /* Body */, 4 /* Unsupported */, true),
914
+ ];
915
+ const saveProspectFieldMappings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, saveProspectFieldMappings_ConfigPropertyMetadata);
916
+ const createResourceParams = /*#__PURE__*/ createResourceParams$4(saveProspectFieldMappings_ConfigPropertyMetadata);
917
+ function typeCheckConfig(untrustedConfig) {
918
+ const config = {};
919
+ const untrustedConfig_outputObjectFieldMappings = untrustedConfig.outputObjectFieldMappings;
920
+ if (ArrayIsArray$1(untrustedConfig_outputObjectFieldMappings)) {
921
+ const untrustedConfig_outputObjectFieldMappings_array = [];
922
+ for (let i = 0, arrayLength = untrustedConfig_outputObjectFieldMappings.length; i < arrayLength; i++) {
923
+ const untrustedConfig_outputObjectFieldMappings_item = untrustedConfig_outputObjectFieldMappings[i];
924
+ const referenceOutputObjectFieldMappingValidationError = validate$2(untrustedConfig_outputObjectFieldMappings_item);
925
+ if (referenceOutputObjectFieldMappingValidationError === null) {
926
+ untrustedConfig_outputObjectFieldMappings_array.push(untrustedConfig_outputObjectFieldMappings_item);
927
+ }
928
+ }
929
+ config.outputObjectFieldMappings = untrustedConfig_outputObjectFieldMappings_array;
930
+ }
931
+ return config;
932
+ }
933
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
934
+ if (!untrustedIsObject(untrustedConfig)) {
935
+ return null;
936
+ }
937
+ if (process.env.NODE_ENV !== 'production') {
938
+ validateConfig(untrustedConfig, configPropertyNames);
939
+ }
940
+ const config = typeCheckConfig(untrustedConfig);
941
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
942
+ return null;
943
+ }
944
+ return config;
945
+ }
946
+ function buildNetworkSnapshot(luvio, config, options) {
947
+ const resourceParams = createResourceParams(config);
948
+ const request = createResourceRequest(resourceParams);
949
+ return luvio.dispatchResourceRequest(request, options)
950
+ .then((response) => {
951
+ return luvio.handleSuccessResponse(() => {
952
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
953
+ return luvio.storeBroadcast().then(() => snapshot);
954
+ }, () => {
955
+ const cache = new StoreKeyMap();
956
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
957
+ return cache;
958
+ });
959
+ }, (response) => {
960
+ deepFreeze(response);
961
+ throw response;
962
+ });
963
+ }
964
+ const saveProspectFieldMappingsAdapterFactory = (luvio) => {
965
+ return function saveProspectFieldMappings(untrustedConfig) {
966
+ const config = validateAdapterConfig(untrustedConfig, saveProspectFieldMappings_ConfigPropertyNames);
967
+ // Invalid or incomplete config
968
+ if (config === null) {
969
+ throw new Error('Invalid config for "saveProspectFieldMappings"');
970
+ }
971
+ return buildNetworkSnapshot(luvio, config);
972
+ };
973
+ };
974
+
975
+ export { getConversionEntriesAdapterFactory, getPostConversionEntriesAdapterFactory, getProspectFieldMappingsAdapterFactory, saveProspectFieldMappingsAdapterFactory };