@salesforce/lds-runtime-mobile 1.266.0-dev17 → 1.266.0-dev19

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 (3) hide show
  1. package/dist/main.js +32 -11
  2. package/package.json +16 -16
  3. package/sfdc/main.js +32 -11
package/dist/main.js CHANGED
@@ -5848,7 +5848,12 @@ class DurableDraftQueue {
5848
5848
  }
5849
5849
  finally {
5850
5850
  this.replacingAction = undefined;
5851
- await this.startQueueSafe();
5851
+ try {
5852
+ await this.startQueueSafe();
5853
+ }
5854
+ catch (_a) {
5855
+ // An error starting the queue should not bubble up from this method
5856
+ }
5852
5857
  }
5853
5858
  return updatedTarget;
5854
5859
  });
@@ -9385,6 +9390,12 @@ function addResolversToSchema(schema, polyFields) {
9385
9390
  break;
9386
9391
  case 'LastModifiedDate':
9387
9392
  field.resolve = ({ recordRepresentation: record }) => {
9393
+ // In UIAPI record reps, LastModifiedDate might be present as a field,
9394
+ // which will include both the value and displayValue
9395
+ if (record.fields['LastModifiedDate']) {
9396
+ return record.fields['LastModifiedDate'];
9397
+ }
9398
+ // If the field is not present, just return the value of the root property
9388
9399
  return record.lastModifiedDate
9389
9400
  ? { value: record.lastModifiedDate }
9390
9401
  : null;
@@ -9419,16 +9430,26 @@ function addResolversToSchema(schema, polyFields) {
9419
9430
  : null;
9420
9431
  };
9421
9432
  const { recordRepresentation: record, ingestionTimestamp } = obj;
9422
- const fieldName = field.name.endsWith('__r')
9423
- ? field.name.replace('__r', '__c')
9424
- : field.name;
9425
- const id = (record.fields[fieldName] && record.fields[fieldName].value) ||
9426
- (record.fields[`${fieldName}Id`] &&
9427
- record.fields[`${fieldName}Id`].value);
9428
- if (!id)
9433
+ let id = undefined;
9434
+ if (field.name === 'RecordType') {
9435
+ // RecordTypeId has special handling during ingest and is
9436
+ // not in record.fields, so check for it at the UIAPI root property location
9437
+ id = record.recordTypeId;
9438
+ }
9439
+ else if (field.name.endsWith('__r')) {
9440
+ // Custom relationships end in `__r` and the corresponding ID field should be `__c`
9441
+ let fieldName = field.name.replace('__r', '__c');
9442
+ id = record.fields[fieldName] && record.fields[fieldName].value;
9443
+ }
9444
+ else {
9445
+ // Standard relationships are just FieldNameId
9446
+ let fieldName = field.name + 'Id';
9447
+ id = record.fields[fieldName] && record.fields[fieldName].value;
9448
+ }
9449
+ if (!id || typeof id !== 'string') {
9450
+ // possibly field injection did not inject the necessary Id field
9451
+ // for the relationship, or we found a non-string value.
9429
9452
  return null;
9430
- if (id['__ref'] !== undefined) {
9431
- return fetchRecordOrNull(record.fields[`${field.name}Id`].value);
9432
9453
  }
9433
9454
  seenRecordIds.add(id);
9434
9455
  return fetchRecordOrNull(id);
@@ -17962,4 +17983,4 @@ register({
17962
17983
  });
17963
17984
 
17964
17985
  export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
17965
- // version: 1.266.0-dev17-880c5fb50
17986
+ // version: 1.266.0-dev19-80cc21d89
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-mobile",
3
- "version": "1.266.0-dev17",
3
+ "version": "1.266.0-dev19",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for mobile/hybrid environments.",
6
6
  "main": "dist/main.js",
@@ -32,25 +32,25 @@
32
32
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-mobile"
33
33
  },
34
34
  "dependencies": {
35
- "@salesforce/lds-adapters-uiapi": "^1.266.0-dev17",
36
- "@salesforce/lds-bindings": "^1.266.0-dev17",
37
- "@salesforce/lds-instrumentation": "^1.266.0-dev17",
38
- "@salesforce/lds-priming": "^1.266.0-dev17",
35
+ "@salesforce/lds-adapters-uiapi": "^1.266.0-dev19",
36
+ "@salesforce/lds-bindings": "^1.266.0-dev19",
37
+ "@salesforce/lds-instrumentation": "^1.266.0-dev19",
38
+ "@salesforce/lds-priming": "^1.266.0-dev19",
39
39
  "@salesforce/user": "0.0.21",
40
40
  "o11y": "244.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@salesforce/lds-adapters-graphql": "^1.266.0-dev17",
44
- "@salesforce/lds-drafts": "^1.266.0-dev17",
45
- "@salesforce/lds-drafts-adapters-uiapi": "^1.266.0-dev17",
46
- "@salesforce/lds-graphql-eval": "^1.266.0-dev17",
47
- "@salesforce/lds-network-adapter": "^1.266.0-dev17",
48
- "@salesforce/lds-network-nimbus": "^1.266.0-dev17",
49
- "@salesforce/lds-store-binary": "^1.266.0-dev17",
50
- "@salesforce/lds-store-nimbus": "^1.266.0-dev17",
51
- "@salesforce/lds-store-sql": "^1.266.0-dev17",
52
- "@salesforce/lds-utils-adapters": "^1.266.0-dev17",
53
- "@salesforce/nimbus-plugin-lds": "^1.266.0-dev17",
43
+ "@salesforce/lds-adapters-graphql": "^1.266.0-dev19",
44
+ "@salesforce/lds-drafts": "^1.266.0-dev19",
45
+ "@salesforce/lds-drafts-adapters-uiapi": "^1.266.0-dev19",
46
+ "@salesforce/lds-graphql-eval": "^1.266.0-dev19",
47
+ "@salesforce/lds-network-adapter": "^1.266.0-dev19",
48
+ "@salesforce/lds-network-nimbus": "^1.266.0-dev19",
49
+ "@salesforce/lds-store-binary": "^1.266.0-dev19",
50
+ "@salesforce/lds-store-nimbus": "^1.266.0-dev19",
51
+ "@salesforce/lds-store-sql": "^1.266.0-dev19",
52
+ "@salesforce/lds-utils-adapters": "^1.266.0-dev19",
53
+ "@salesforce/nimbus-plugin-lds": "^1.266.0-dev19",
54
54
  "babel-plugin-dynamic-import-node": "^2.3.3",
55
55
  "wait-for-expect": "^3.0.2"
56
56
  },
package/sfdc/main.js CHANGED
@@ -5848,7 +5848,12 @@ class DurableDraftQueue {
5848
5848
  }
5849
5849
  finally {
5850
5850
  this.replacingAction = undefined;
5851
- await this.startQueueSafe();
5851
+ try {
5852
+ await this.startQueueSafe();
5853
+ }
5854
+ catch (_a) {
5855
+ // An error starting the queue should not bubble up from this method
5856
+ }
5852
5857
  }
5853
5858
  return updatedTarget;
5854
5859
  });
@@ -9385,6 +9390,12 @@ function addResolversToSchema(schema, polyFields) {
9385
9390
  break;
9386
9391
  case 'LastModifiedDate':
9387
9392
  field.resolve = ({ recordRepresentation: record }) => {
9393
+ // In UIAPI record reps, LastModifiedDate might be present as a field,
9394
+ // which will include both the value and displayValue
9395
+ if (record.fields['LastModifiedDate']) {
9396
+ return record.fields['LastModifiedDate'];
9397
+ }
9398
+ // If the field is not present, just return the value of the root property
9388
9399
  return record.lastModifiedDate
9389
9400
  ? { value: record.lastModifiedDate }
9390
9401
  : null;
@@ -9419,16 +9430,26 @@ function addResolversToSchema(schema, polyFields) {
9419
9430
  : null;
9420
9431
  };
9421
9432
  const { recordRepresentation: record, ingestionTimestamp } = obj;
9422
- const fieldName = field.name.endsWith('__r')
9423
- ? field.name.replace('__r', '__c')
9424
- : field.name;
9425
- const id = (record.fields[fieldName] && record.fields[fieldName].value) ||
9426
- (record.fields[`${fieldName}Id`] &&
9427
- record.fields[`${fieldName}Id`].value);
9428
- if (!id)
9433
+ let id = undefined;
9434
+ if (field.name === 'RecordType') {
9435
+ // RecordTypeId has special handling during ingest and is
9436
+ // not in record.fields, so check for it at the UIAPI root property location
9437
+ id = record.recordTypeId;
9438
+ }
9439
+ else if (field.name.endsWith('__r')) {
9440
+ // Custom relationships end in `__r` and the corresponding ID field should be `__c`
9441
+ let fieldName = field.name.replace('__r', '__c');
9442
+ id = record.fields[fieldName] && record.fields[fieldName].value;
9443
+ }
9444
+ else {
9445
+ // Standard relationships are just FieldNameId
9446
+ let fieldName = field.name + 'Id';
9447
+ id = record.fields[fieldName] && record.fields[fieldName].value;
9448
+ }
9449
+ if (!id || typeof id !== 'string') {
9450
+ // possibly field injection did not inject the necessary Id field
9451
+ // for the relationship, or we found a non-string value.
9429
9452
  return null;
9430
- if (id['__ref'] !== undefined) {
9431
- return fetchRecordOrNull(record.fields[`${field.name}Id`].value);
9432
9453
  }
9433
9454
  seenRecordIds.add(id);
9434
9455
  return fetchRecordOrNull(id);
@@ -17962,4 +17983,4 @@ register({
17962
17983
  });
17963
17984
 
17964
17985
  export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
17965
- // version: 1.266.0-dev17-880c5fb50
17986
+ // version: 1.266.0-dev19-80cc21d89