fireberry-api-client 1.0.0-beta.2.1 → 1.0.0-beta.2.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.
- package/README.md +6 -8
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -231,18 +231,18 @@ declare class MetadataAPI {
|
|
|
231
231
|
*
|
|
232
232
|
* @param objectType - The object type ID (e.g., '1' for Account)
|
|
233
233
|
* @param options - Optional settings
|
|
234
|
-
* @param options.includeLookupRelations -
|
|
234
|
+
* @param options.includeLookupRelations - Fetches related object types for lookup fields (default: true)
|
|
235
235
|
* @param options.signal - Optional AbortSignal for cancellation
|
|
236
236
|
* @returns List of fields with metadata
|
|
237
237
|
*
|
|
238
238
|
* @example
|
|
239
239
|
* ```typescript
|
|
240
|
+
* // Lookup relations are included by default
|
|
240
241
|
* const result = await client.metadata.getFields('1');
|
|
241
|
-
* console.log(result.fields); // [{ fieldName: 'accountid', label: 'Account ID', ... }, ...]
|
|
242
|
-
*
|
|
243
|
-
* // With lookup relations
|
|
244
|
-
* const result = await client.metadata.getFields('1', { includeLookupRelations: true });
|
|
245
242
|
* console.log(result.fields.find(f => f.fieldName === 'primarycontactid')?.relatedObjectType); // 2
|
|
243
|
+
*
|
|
244
|
+
* // Disable lookup relations for faster response
|
|
245
|
+
* const result = await client.metadata.getFields('1', { includeLookupRelations: false });
|
|
246
246
|
* ```
|
|
247
247
|
*/
|
|
248
248
|
getFields(objectType: string | number, options?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -231,18 +231,18 @@ declare class MetadataAPI {
|
|
|
231
231
|
*
|
|
232
232
|
* @param objectType - The object type ID (e.g., '1' for Account)
|
|
233
233
|
* @param options - Optional settings
|
|
234
|
-
* @param options.includeLookupRelations -
|
|
234
|
+
* @param options.includeLookupRelations - Fetches related object types for lookup fields (default: true)
|
|
235
235
|
* @param options.signal - Optional AbortSignal for cancellation
|
|
236
236
|
* @returns List of fields with metadata
|
|
237
237
|
*
|
|
238
238
|
* @example
|
|
239
239
|
* ```typescript
|
|
240
|
+
* // Lookup relations are included by default
|
|
240
241
|
* const result = await client.metadata.getFields('1');
|
|
241
|
-
* console.log(result.fields); // [{ fieldName: 'accountid', label: 'Account ID', ... }, ...]
|
|
242
|
-
*
|
|
243
|
-
* // With lookup relations
|
|
244
|
-
* const result = await client.metadata.getFields('1', { includeLookupRelations: true });
|
|
245
242
|
* console.log(result.fields.find(f => f.fieldName === 'primarycontactid')?.relatedObjectType); // 2
|
|
243
|
+
*
|
|
244
|
+
* // Disable lookup relations for faster response
|
|
245
|
+
* const result = await client.metadata.getFields('1', { includeLookupRelations: false });
|
|
246
246
|
* ```
|
|
247
247
|
*/
|
|
248
248
|
getFields(objectType: string | number, options?: {
|
package/dist/index.js
CHANGED
|
@@ -568,23 +568,23 @@ var MetadataAPI = class {
|
|
|
568
568
|
*
|
|
569
569
|
* @param objectType - The object type ID (e.g., '1' for Account)
|
|
570
570
|
* @param options - Optional settings
|
|
571
|
-
* @param options.includeLookupRelations -
|
|
571
|
+
* @param options.includeLookupRelations - Fetches related object types for lookup fields (default: true)
|
|
572
572
|
* @param options.signal - Optional AbortSignal for cancellation
|
|
573
573
|
* @returns List of fields with metadata
|
|
574
574
|
*
|
|
575
575
|
* @example
|
|
576
576
|
* ```typescript
|
|
577
|
+
* // Lookup relations are included by default
|
|
577
578
|
* const result = await client.metadata.getFields('1');
|
|
578
|
-
* console.log(result.fields); // [{ fieldName: 'accountid', label: 'Account ID', ... }, ...]
|
|
579
|
-
*
|
|
580
|
-
* // With lookup relations
|
|
581
|
-
* const result = await client.metadata.getFields('1', { includeLookupRelations: true });
|
|
582
579
|
* console.log(result.fields.find(f => f.fieldName === 'primarycontactid')?.relatedObjectType); // 2
|
|
580
|
+
*
|
|
581
|
+
* // Disable lookup relations for faster response
|
|
582
|
+
* const result = await client.metadata.getFields('1', { includeLookupRelations: false });
|
|
583
583
|
* ```
|
|
584
584
|
*/
|
|
585
585
|
async getFields(objectType, options) {
|
|
586
586
|
const objectTypeStr = String(objectType);
|
|
587
|
-
const opts = options instanceof AbortSignal ? { signal: options, includeLookupRelations:
|
|
587
|
+
const opts = options instanceof AbortSignal ? { signal: options, includeLookupRelations: true } : { signal: options?.signal, includeLookupRelations: options?.includeLookupRelations ?? true };
|
|
588
588
|
if (!opts.includeLookupRelations) {
|
|
589
589
|
const cached = this.client.getCached("fields", objectTypeStr);
|
|
590
590
|
if (cached) {
|