@salesforce/lwc-adapters-uiapi 1.313.0 → 1.314.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +99 -74
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -7297,34 +7297,26 @@ function deepMerge(target, ...sources) {
7297
7297
  /**
7298
7298
  * Defines configuration for the module with a default value which can be overridden by the runtime environment.
7299
7299
  */
7300
- /**
7301
- * Environment Aware GraphQLBatch adapter
7302
- */
7303
- let environmentAwareGraphQLBatchAdapter = undefined;
7304
- /**
7305
- * Draft-aware GraphQL adapter
7306
- */
7307
- let draftAwareGraphQLAdapter = undefined;
7308
- /**
7309
- * Draft-aware createRecord adapter
7310
- */
7311
- let draftAwareCreateRecordAdapter = undefined;
7312
- /**
7313
- * Draft-aware updateRecord adapter
7314
- */
7315
- let draftAwareUpdateRecordAdapter = undefined;
7316
- /**
7317
- * Draft-aware deleteRecord adapter
7318
- */
7319
- let draftAwareDeleteRecordAdapter = undefined;
7320
- /**
7321
- * Draft-aware createContentDocumentAndVersion adapter
7322
- */
7323
- let draftAwareCreateContentDocumentAndVersionAdapter = undefined;
7324
- /**
7325
- * Draft-aware createContentVersion adapter
7326
- */
7327
- let draftAwareCreateContentVersionAdapter = undefined;
7300
+ // A holder for a configurable adapter override
7301
+ class Configurable {
7302
+ constructor() {
7303
+ this.getAdapter = () => {
7304
+ return this.adapter;
7305
+ };
7306
+ this.setAdapter = (value) => {
7307
+ this.adapter = value;
7308
+ };
7309
+ this.adapter = undefined;
7310
+ }
7311
+ }
7312
+ // Configurable adapters that can have environmental overrides
7313
+ let configurableCreateRecordAdapter = new Configurable();
7314
+ let configurableUpdateRecordAdapter = new Configurable();
7315
+ let configurableDeleteRecordAdapter = new Configurable();
7316
+ let configurablePerformQuickActionAdapter = new Configurable();
7317
+ let configurablePerformUpdateRecordQuickActionAdapter = new Configurable();
7318
+ let configurableCreateContentDocumentAndVersion = new Configurable();
7319
+ let configurableCreateContentVersion = new Configurable();
7328
7320
  /**
7329
7321
  * Depth to which tracked fields will be added to a request that results from a cache miss.
7330
7322
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
@@ -7381,6 +7373,52 @@ const configurationForOneStoreEnabledAdapters = {
7381
7373
  return oneStoreGetObjectInfosAdapter;
7382
7374
  },
7383
7375
  };
7376
+ const getKeywordSearchResultsFactory = new Configurable();
7377
+ const getListRecordsByNameFactory = new Configurable();
7378
+ const getListUiFactory = new Configurable();
7379
+ const getLookupRecordsFactory = new Configurable();
7380
+ const getQuickActionDefaultsFactory = new Configurable();
7381
+ const getRecordCreateDefaultsFactory = new Configurable();
7382
+ const getRecordTemplateCloneFactory = new Configurable();
7383
+ const getRecordTemplateCreateFactory = new Configurable();
7384
+ const getRecordUiFactory = new Configurable();
7385
+ const getRecordFactory = new Configurable();
7386
+ const getRecordsFactory = new Configurable();
7387
+ const getRelatedListRecordsFactory = new Configurable();
7388
+ const getRelatedListRecordsBatchFactory = new Configurable();
7389
+ const getSearchResultsFactory = new Configurable();
7390
+ // The following set of adapters all touch RecordRepresentation directly or indirectly,
7391
+ // so they need to support having a custom factory provided by the mobile environment.
7392
+ const configurationForEnvironmentFactoryOverrides = {
7393
+ getKeywordSearchResultsAdapterFactory: getKeywordSearchResultsFactory.getAdapter,
7394
+ setGetKeywordSearchResultsAdapterFactory: getKeywordSearchResultsFactory.setAdapter,
7395
+ getListRecordsByNameAdapterFactory: getListRecordsByNameFactory.getAdapter,
7396
+ setGetListRecordsByNameAdapterFactory: getListRecordsByNameFactory.setAdapter,
7397
+ getListUiAdapterFactory: getListUiFactory.getAdapter,
7398
+ setGetListUiAdapterFactory: getListUiFactory.setAdapter,
7399
+ getLookupRecordsAdapterFactory: getLookupRecordsFactory.getAdapter,
7400
+ setGetLookupRecordsAdapterFactory: getLookupRecordsFactory.setAdapter,
7401
+ getQuickActionDefaultsAdapterFactory: getQuickActionDefaultsFactory.getAdapter,
7402
+ setGetQuickActionDefaultsAdapterFactory: getQuickActionDefaultsFactory.setAdapter,
7403
+ getRecordCreateDefaultsAdapterFactory: getRecordCreateDefaultsFactory.getAdapter,
7404
+ setGetRecordCreateDefaultsAdapterFactory: getRecordCreateDefaultsFactory.setAdapter,
7405
+ getRecordTemplateCloneAdapterFactory: getRecordTemplateCloneFactory.getAdapter,
7406
+ setGetRecordTemplateCloneAdapterFactory: getRecordTemplateCloneFactory.setAdapter,
7407
+ getRecordTemplateCreateAdapterFactory: getRecordTemplateCreateFactory.getAdapter,
7408
+ setGetRecordTemplateCreateAdapterFactory: getRecordTemplateCreateFactory.setAdapter,
7409
+ getRecordUiAdapterFactory: getRecordUiFactory.getAdapter,
7410
+ setGetRecordUiAdapterFactory: getRecordUiFactory.setAdapter,
7411
+ getRecordAdapterFactory: getRecordFactory.getAdapter,
7412
+ setGetRecordAdapterFactory: getRecordFactory.setAdapter,
7413
+ getRecordsAdapterFactory: getRecordsFactory.getAdapter,
7414
+ setGetRecordsAdapterFactory: getRecordsFactory.setAdapter,
7415
+ getRelatedListRecordsAdapterFactory: getRelatedListRecordsFactory.getAdapter,
7416
+ setGetRelatedListRecordsAdapterFactory: getRelatedListRecordsFactory.setAdapter,
7417
+ getRelatedListRecordsBatchAdapterFactory: getRelatedListRecordsBatchFactory.getAdapter,
7418
+ setGetRelatedListRecordsBatchAdapterFactory: getRelatedListRecordsBatchFactory.setAdapter,
7419
+ getSearchResultsAdapterFactory: getSearchResultsFactory.getAdapter,
7420
+ setGetSearchResultsAdapterFactory: getSearchResultsFactory.setAdapter,
7421
+ };
7384
7422
  /**
7385
7423
  * Defines the configuration API and is exposed internally as well as externally.
7386
7424
  * Configuration for REST adapters only.
@@ -7410,66 +7448,47 @@ const configurationForRestAdapters = {
7410
7448
  getTrackedFieldLeafNodeIdAndNameOnly: function () {
7411
7449
  return trackedFieldLeafNodeIdAndNameOnly;
7412
7450
  },
7413
- // createRecord
7414
- setDraftAwareCreateRecordAdapter: function (adapter) {
7415
- draftAwareCreateRecordAdapter = adapter;
7416
- },
7417
- getDraftAwareCreateRecordAdapter: function () {
7418
- return draftAwareCreateRecordAdapter;
7419
- },
7420
- // updateRecord
7421
- setDraftAwareUpdateRecordAdapter: function (adapter) {
7422
- draftAwareUpdateRecordAdapter = adapter;
7423
- },
7424
- getDraftAwareUpdateRecordAdapter: function () {
7425
- return draftAwareUpdateRecordAdapter;
7426
- },
7427
- // deleteRecord
7428
- setDraftAwareDeleteRecordAdapter: function (adapter) {
7429
- draftAwareDeleteRecordAdapter = adapter;
7430
- },
7431
- getDraftAwareDeleteRecordAdapter: function () {
7432
- return draftAwareDeleteRecordAdapter;
7433
- },
7434
- // createContentDocumentAndVersion
7435
- setDraftAwareCreateContentDocumentAndVersionAdapter: function (adapter) {
7436
- draftAwareCreateContentDocumentAndVersionAdapter = adapter;
7437
- },
7438
- getDraftAwareCreateContentDocumentAndVersionAdapter: function () {
7439
- return draftAwareCreateContentDocumentAndVersionAdapter;
7440
- },
7441
7451
  setRelatedListsPredictionsEnabled: function (f) {
7442
7452
  relatedListsPredictionsEnabled = f;
7443
7453
  },
7444
7454
  areRelatedListsPredictionsEnabled: function () {
7445
7455
  return relatedListsPredictionsEnabled === true;
7446
7456
  },
7457
+ // createRecord
7458
+ getDraftAwareCreateRecordAdapter: configurableCreateRecordAdapter.getAdapter,
7459
+ setDraftAwareCreateRecordAdapter: configurableCreateRecordAdapter.setAdapter,
7460
+ // updateRecord
7461
+ getDraftAwareUpdateRecordAdapter: configurableUpdateRecordAdapter.getAdapter,
7462
+ setDraftAwareUpdateRecordAdapter: configurableUpdateRecordAdapter.setAdapter,
7463
+ // deleteRecord
7464
+ getDraftAwareDeleteRecordAdapter: configurableDeleteRecordAdapter.getAdapter,
7465
+ setDraftAwareDeleteRecordAdapter: configurableDeleteRecordAdapter.setAdapter,
7466
+ // performQuickAction
7467
+ getDraftAwarePerformQuickActionAdapter: configurablePerformQuickActionAdapter.getAdapter,
7468
+ setDraftAwarePerformQuickActionAdapter: configurablePerformQuickActionAdapter.setAdapter,
7469
+ // performRecordUpdateQuickAction
7470
+ getDraftAwarePerformUpdateRecordQuickActionAdapter: configurablePerformUpdateRecordQuickActionAdapter.getAdapter,
7471
+ setDraftAwarePerformUpdateRecordQuickActionAdapter: configurablePerformUpdateRecordQuickActionAdapter.setAdapter,
7472
+ // createContentDocumentAndVersion
7473
+ getDraftAwareCreateContentDocumentAndVersionAdapter: configurableCreateContentDocumentAndVersion.getAdapter,
7474
+ setDraftAwareCreateContentDocumentAndVersionAdapter: configurableCreateContentDocumentAndVersion.setAdapter,
7447
7475
  // createContentVersion
7448
- setDraftAwareCreateContentVersionAdapter: function (adapter) {
7449
- draftAwareCreateContentVersionAdapter = adapter;
7450
- },
7451
- getDraftAwareCreateContentVersionAdapter: function () {
7452
- return draftAwareCreateContentVersionAdapter;
7453
- },
7476
+ getDraftAwareCreateContentVersionAdapter: configurableCreateContentVersion.getAdapter,
7477
+ setDraftAwareCreateContentVersionAdapter: configurableCreateContentVersion.setAdapter,
7454
7478
  ...configurationForOneStoreEnabledAdapters,
7479
+ ...configurationForEnvironmentFactoryOverrides,
7455
7480
  };
7481
+ let configurableGraphQLAdapter = new Configurable();
7482
+ let configurableGraphQLBatchAdapter = new Configurable();
7456
7483
  /**
7457
7484
  * Defines the configuration API and is exposed internally as well as externally.
7458
7485
  * Configuration for GraphQL adapters only.
7459
7486
  */
7460
7487
  const configurationForGraphQLAdapters = {
7461
- setDraftAwareGraphQLAdapter: function (adapter) {
7462
- draftAwareGraphQLAdapter = adapter;
7463
- },
7464
- getDraftAwareGraphQLAdapter: function () {
7465
- return draftAwareGraphQLAdapter;
7466
- },
7467
- setEnvironmentAwareGraphQLBatchAdapter: function (adapter) {
7468
- environmentAwareGraphQLBatchAdapter = adapter;
7469
- },
7470
- getEnvironmentAwareGraphQLBatchAdapter: function () {
7471
- return environmentAwareGraphQLBatchAdapter;
7472
- },
7488
+ getDraftAwareGraphQLAdapter: configurableGraphQLAdapter.getAdapter,
7489
+ setDraftAwareGraphQLAdapter: configurableGraphQLAdapter.setAdapter,
7490
+ getEnvironmentAwareGraphQLBatchAdapter: configurableGraphQLBatchAdapter.getAdapter,
7491
+ setEnvironmentAwareGraphQLBatchAdapter: configurableGraphQLBatchAdapter.setAdapter,
7473
7492
  };
7474
7493
  const registrations = new Set();
7475
7494
  /**
@@ -65313,6 +65332,12 @@ function createDispatchResourceRequestContext(requestContext) {
65313
65332
  }
65314
65333
  return dispatchOptions;
65315
65334
  }
65335
+
65336
+ ({
65337
+ ...configurationForRestAdapters,
65338
+ ...configurationForGraphQLAdapters,
65339
+ ...configurationForOneStoreEnabledAdapters,
65340
+ });
65316
65341
  ensureRegisteredOnce({
65317
65342
  id: '@salesforce/lds-adapters-uiapi',
65318
65343
  configuration: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lwc-adapters-uiapi",
3
- "version": "1.313.0",
3
+ "version": "1.314.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "UIAPI adapters with LWC bindings",
6
6
  "module": "dist/main.js",
@@ -31,10 +31,10 @@
31
31
  "clean": "rm -rf dist src/generated"
32
32
  },
33
33
  "devDependencies": {
34
- "@salesforce/lds-adapters-uiapi": "^1.313.0"
34
+ "@salesforce/lds-adapters-uiapi": "^1.314.0"
35
35
  },
36
36
  "dependencies": {
37
37
  "@luvio/lwc-luvio": "0.156.4",
38
- "@salesforce/lds-default-luvio": "^1.313.0"
38
+ "@salesforce/lds-default-luvio": "^1.314.0"
39
39
  }
40
40
  }