@salesforce/lds-adapters-uiapi 1.214.1 → 1.214.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Utility function to run a given function in NODE_ENV=production, then reset NODE_ENV to the previous value.
3
+ * Should only be used in tests.
4
+ *
5
+ * @param fn function to run in production environment
6
+ */
7
+ export declare function runInProductionEnvironment(fn: () => void): void;
@@ -1489,26 +1489,32 @@ const RECORD_ID_DECODER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456';
1489
1489
  * @returns An 18-char record id, and throws error if an invalid record id was provided.
1490
1490
  */
1491
1491
  function getRecordId18(value) {
1492
- if (!isString(value)) {
1493
- return undefined;
1494
- }
1495
- else if (value.length === 18) {
1496
- return value;
1497
- }
1498
- else if (value.length === 15) {
1499
- // Add the 3 character suffix
1500
- let recordId = value;
1501
- for (let offset = 0; offset < 15; offset += 5) {
1502
- let decodeValue = 0;
1503
- for (let bit = 0; bit < 5; bit++) {
1504
- const c = value[offset + bit];
1505
- if (c >= 'A' && c <= 'Z') {
1506
- decodeValue += 1 << bit;
1492
+ if (isString(value)) {
1493
+ if (value.length === 18) {
1494
+ return value;
1495
+ }
1496
+ else if (value.length === 15) {
1497
+ // Add the 3 character suffix
1498
+ let recordId = value;
1499
+ for (let offset = 0; offset < 15; offset += 5) {
1500
+ let decodeValue = 0;
1501
+ for (let bit = 0; bit < 5; bit++) {
1502
+ const c = value[offset + bit];
1503
+ if (c >= 'A' && c <= 'Z') {
1504
+ decodeValue += 1 << bit;
1505
+ }
1507
1506
  }
1507
+ recordId += RECORD_ID_DECODER[decodeValue];
1508
1508
  }
1509
- recordId += RECORD_ID_DECODER[decodeValue];
1509
+ return recordId;
1510
1510
  }
1511
- return recordId;
1511
+ }
1512
+ else if (value === undefined || value === null) {
1513
+ // Not throwing here - input params might not have settled
1514
+ return undefined;
1515
+ }
1516
+ if (process.env.NODE_ENV !== 'production') {
1517
+ throw new Error(`Configuration Error: Invalid RecordId passed: ${JSON.stringify(value)}. RecordIds must be 15 or 18 character strings.`);
1512
1518
  }
1513
1519
  return undefined;
1514
1520
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-uiapi",
3
- "version": "1.214.1",
3
+ "version": "1.214.2",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "Wire adapters for record related UI API endpoints",
6
6
  "main": "dist/es/es2018/uiapi-records-service.js",
@@ -18230,4 +18230,4 @@ register({
18230
18230
  });
18231
18231
 
18232
18232
  export { configurationForGraphQLAdapters as configuration, graphql, factory$1 as graphqlAdapterFactory, graphqlBatch, graphqlBatch_imperative, graphql_imperative };
18233
- // version: 1.214.1-e4e4d8399
18233
+ // version: 1.214.2-2e2871620
package/sfdc/index.js CHANGED
@@ -1537,26 +1537,32 @@ const RECORD_ID_DECODER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456';
1537
1537
  * @returns An 18-char record id, and throws error if an invalid record id was provided.
1538
1538
  */
1539
1539
  function getRecordId18(value) {
1540
- if (!isString(value)) {
1541
- return undefined;
1542
- }
1543
- else if (value.length === 18) {
1544
- return value;
1545
- }
1546
- else if (value.length === 15) {
1547
- // Add the 3 character suffix
1548
- let recordId = value;
1549
- for (let offset = 0; offset < 15; offset += 5) {
1550
- let decodeValue = 0;
1551
- for (let bit = 0; bit < 5; bit++) {
1552
- const c = value[offset + bit];
1553
- if (c >= 'A' && c <= 'Z') {
1554
- decodeValue += 1 << bit;
1540
+ if (isString(value)) {
1541
+ if (value.length === 18) {
1542
+ return value;
1543
+ }
1544
+ else if (value.length === 15) {
1545
+ // Add the 3 character suffix
1546
+ let recordId = value;
1547
+ for (let offset = 0; offset < 15; offset += 5) {
1548
+ let decodeValue = 0;
1549
+ for (let bit = 0; bit < 5; bit++) {
1550
+ const c = value[offset + bit];
1551
+ if (c >= 'A' && c <= 'Z') {
1552
+ decodeValue += 1 << bit;
1553
+ }
1555
1554
  }
1555
+ recordId += RECORD_ID_DECODER[decodeValue];
1556
1556
  }
1557
- recordId += RECORD_ID_DECODER[decodeValue];
1557
+ return recordId;
1558
1558
  }
1559
- return recordId;
1559
+ }
1560
+ else if (value === undefined || value === null) {
1561
+ // Not throwing here - input params might not have settled
1562
+ return undefined;
1563
+ }
1564
+ if (process.env.NODE_ENV !== 'production') {
1565
+ throw new Error(`Configuration Error: Invalid RecordId passed: ${JSON.stringify(value)}. RecordIds must be 15 or 18 character strings.`);
1560
1566
  }
1561
1567
  return undefined;
1562
1568
  }
@@ -33711,4 +33717,4 @@ withDefaultLuvio((luvio) => {
33711
33717
  });
33712
33718
 
33713
33719
  export { InMemoryRecordRepresentationQueryEvaluator, MRU, RepresentationType$J as ObjectInfoRepresentationType, RepresentationType$O as RecordRepresentationRepresentationType, TTL$w as RecordRepresentationTTL, RepresentationType$O as RecordRepresentationType, VERSION$17 as RecordRepresentationVersion, keyPrefix as UiApiNamespace, configurationForRestAdapters as configuration, createContentDocumentAndVersion, createContentVersion, createIngestRecordWithFields, createRecord, deleteRecord, getActionOverrides, getActionOverrides_imperative, getAllApps, getAllApps_imperative, getAppDetails, getAppDetails_imperative, getDuplicateConfiguration, getDuplicateConfiguration_imperative, getDuplicates, getDuplicates_imperative, getGlobalActions, getGlobalActions_imperative, getKeywordSearchResults, getKeywordSearchResults_imperative, getLayout, getLayoutUserState, getLayoutUserState_imperative, getLayout_imperative, getListInfoByName, getListInfoByName_imperative, getListInfosByName, getListInfosByName_imperative, getListObjectInfo, getListObjectInfo_imperative, getListRecordsByName, getListRecordsByName_imperative, getListUi, getListUi_imperative, getLookupActions, getLookupActions_imperative, getLookupMetadata, getLookupMetadata_imperative, getLookupRecords, getLookupRecords_imperative, getNavItems, getNavItems_imperative, getObjectCreateActions, getObjectCreateActions_imperative, getObjectInfo, getObjectInfoAdapterFactory, getObjectInfo_imperative, getObjectInfos, getObjectInfosAdapterFactory, getObjectInfos_imperative, getPicklistValues, getPicklistValuesByRecordType, getPicklistValuesByRecordType_imperative, getPicklistValues_imperative, getQuickActionDefaults, getQuickActionDefaults_imperative, getQuickActionLayout, getQuickActionLayout_imperative, getRecord, getRecordActions, getRecordActions_imperative, factory$e as getRecordAdapterFactory, getRecordAvatars, getRecordAvatars_imperative, getRecordCreateDefaults, getRecordCreateDefaults_imperative, getRecordEditActions, getRecordEditActions_imperative, getRecordId18, getRecordNotifyChange, getRecordTemplateClone, getRecordTemplateClone_imperative, getRecordTemplateCreate, getRecordTemplateCreate_imperative, getRecordUi, getRecordUi_imperative, getRecord_imperative, getRecords, getRecordsAdapterFactory, getRecords_imperative, getRelatedListActions, getRelatedListActions_imperative, getRelatedListCount, getRelatedListCount_imperative, getRelatedListInfo, getRelatedListInfoBatch, getRelatedListInfoBatch_imperative, getRelatedListInfo_imperative, getRelatedListPreferences, getRelatedListPreferencesBatch, getRelatedListPreferencesBatch_imperative, getRelatedListPreferences_imperative, getRelatedListRecordActions, getRelatedListRecordActions_imperative, getRelatedListRecords, getRelatedListRecordsBatch, getRelatedListRecordsBatch_imperative, getRelatedListRecords_imperative, getRelatedListsActions, getRelatedListsActions_imperative, getRelatedListsCount, getRelatedListsCount_imperative, getRelatedListsInfo, getRelatedListsInfo_imperative, getResponseCacheKeys as getResponseCacheKeysContentDocumentCompositeRepresentation, getSearchFilterMetadata, getSearchFilterMetadata_imperative, getSearchFilterOptions, getSearchFilterOptions_imperative, getSearchResults, getSearchResults_imperative, getTypeCacheKeys$Q as getTypeCacheKeysRecord, ingest as ingestContentDocumentCompositeRepresentation, ingest$C as ingestObjectInfo, ingest$y as ingestQuickActionExecutionRepresentation, ingest$H as ingestRecord, instrument, keyBuilder as keyBuilderContentDocumentCompositeRepresentation, keyBuilderFromType as keyBuilderFromTypeContentDocumentCompositeRepresentation, keyBuilderFromType$y as keyBuilderFromTypeRecordRepresentation, keyBuilder$1J as keyBuilderObjectInfo, keyBuilder$1D as keyBuilderQuickActionExecutionRepresentation, keyBuilder$1U as keyBuilderRecord, notifyListViewSummaryUpdateAvailable, notifyRecordUpdateAvailable, performQuickAction, performUpdateRecordQuickAction, refresh, updateLayoutUserState, updateListInfoByName, updateRecord, updateRecordAvatar, updateRelatedListInfo, updateRelatedListPreferences };
33714
- // version: 1.214.1-e4e4d8399
33720
+ // version: 1.214.2-2e2871620