fireberry-api-client 1.0.2-beta.2.2 → 1.0.2-beta.2.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.
@@ -320,6 +320,10 @@ var FIELDS_WITHOUT_LABEL_FIELD = [
320
320
  // Object 7 - no name field exists
321
321
  ];
322
322
  var OBJECT_TYPE_OVERRIDES = {
323
+ // Account (1) - uses *codename pattern for some fields
324
+ 1: {
325
+ excludedCodeFields: ["actionstatuscode", "businesstypecode"]
326
+ },
323
327
  // CRM Orders (13) - uses *idname and *codename patterns
324
328
  13: {
325
329
  excludedIdFields: ["ownerid", "accountid", "printtemplateid", "pcfaccountid"],
@@ -443,6 +447,21 @@ var OBJECT_TYPE_OVERRIDES = {
443
447
  excludedIdFields: ["ownerid"]
444
448
  }
445
449
  };
450
+ function isLabelOnlyField(fieldName, allFieldNames, objectType) {
451
+ for (const otherField of allFieldNames) {
452
+ if (otherField === fieldName) continue;
453
+ const labelField = getLabelFieldForField(otherField, objectType);
454
+ if (labelField === fieldName) {
455
+ return true;
456
+ }
457
+ }
458
+ return false;
459
+ }
460
+ function filterLabelOnlyFields(fieldNames, objectType) {
461
+ return fieldNames.filter(
462
+ (fieldName) => !isLabelOnlyField(fieldName, fieldNames, objectType)
463
+ );
464
+ }
446
465
  function getLabelFieldForField(fieldName, objectType) {
447
466
  if (SPECIAL_LABEL_FIELD_MAPPINGS[fieldName]) {
448
467
  return SPECIAL_LABEL_FIELD_MAPPINGS[fieldName];
@@ -2138,6 +2157,7 @@ exports.deepClone = deepClone;
2138
2157
  exports.erdBuilder = erdBuilder;
2139
2158
  exports.escapeQueryValue = escapeQueryValue;
2140
2159
  exports.expandRelatedFields = expandRelatedFields;
2160
+ exports.filterLabelOnlyFields = filterLabelOnlyFields;
2141
2161
  exports.generateFireberryERD = generateFireberryERD;
2142
2162
  exports.generateSchema = generateSchema;
2143
2163
  exports.getCodeFieldFromLabel = getCodeFieldFromLabel;
@@ -2158,6 +2178,7 @@ exports.isDropdownField = isDropdownField;
2158
2178
  exports.isDropdownFieldByMetadata = isDropdownFieldByMetadata;
2159
2179
  exports.isDropdownOrLookupField = isDropdownOrLookupField;
2160
2180
  exports.isExcludedFromStarQuery = isExcludedFromStarQuery;
2181
+ exports.isLabelOnlyField = isLabelOnlyField;
2161
2182
  exports.isLookupField = isLookupField;
2162
2183
  exports.isNumericField = isNumericField;
2163
2184
  exports.isPlainObject = isPlainObject;