fireberry-api-client 1.0.2-beta.1.3 → 1.0.2-beta.2.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.
- package/dist/index.cjs +27 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -3
- package/dist/index.js.map +1 -1
- package/dist/{relatedFieldMapping-uUVpIJk9.d.cts → relatedFieldMapping-BvTlofIU.d.cts} +2 -1
- package/dist/{relatedFieldMapping-6o0SKPT2.d.ts → relatedFieldMapping-D0fbCEeA.d.ts} +2 -1
- package/dist/utils/index.d.cts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/package.json +66 -66
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BatchCreateOptions, o as BatchDeleteOptions, s as BatchDeleteResult, q as BatchResult, m as BatchUpdateOptions, n as BatchUpdateRecord, C as CacheControl, O as CreateFieldOptions, z as CreateFieldOptionsBase, Q as CreateFieldResult, y as CreateFieldType, M as CreateFormulaFieldOptions, H as CreateLookupFieldOptions, E as CreateNumberFieldOptions, j as CreateOptions, J as CreatePicklistFieldOptions, N as CreateSimpleFieldOptions, K as CreateSummaryFieldOptions, A as CreateTextFieldOptions, D as DeleteOptions, d as FieldMetadataMap, v as FieldValue, T as FileUploadOptions, V as FileUploadResult, F as FireberryClient, f as FireberryClientConfig, u as FireberryField, t as FireberryObject, i as FireberryRecord, L as FormulaFieldType, x as GetFieldValuesResult, w as GetFieldsResult, G as GetObjectsResult, Y as HTTPTransportConfig, I as ID_FIELD_TO_OBJECT_TYPE, P as PicklistValue, b as RelatedFieldInfo, c as RelatedFieldResolution, R as RelatedFieldResolver, h as RequestOptions, Z as SDKTransportConfig, S as SummaryType, W as Transport, _ as TransportConfig, X as TransportRequestOptions, U as UpdateOptions, k as UpsertOptions, l as UpsertResult, e as expandRelatedFields, a as getObjectTypeFromReferenceField, g as getRelatedFieldInfo, $ as isHTTPTransportConfig, a0 as isSDKTransportConfig, p as parseRelatedField, r as resolveRelatedField } from './relatedFieldMapping-
|
|
1
|
+
export { B as BatchCreateOptions, o as BatchDeleteOptions, s as BatchDeleteResult, q as BatchResult, m as BatchUpdateOptions, n as BatchUpdateRecord, C as CacheControl, O as CreateFieldOptions, z as CreateFieldOptionsBase, Q as CreateFieldResult, y as CreateFieldType, M as CreateFormulaFieldOptions, H as CreateLookupFieldOptions, E as CreateNumberFieldOptions, j as CreateOptions, J as CreatePicklistFieldOptions, N as CreateSimpleFieldOptions, K as CreateSummaryFieldOptions, A as CreateTextFieldOptions, D as DeleteOptions, d as FieldMetadataMap, v as FieldValue, T as FileUploadOptions, V as FileUploadResult, F as FireberryClient, f as FireberryClientConfig, u as FireberryField, t as FireberryObject, i as FireberryRecord, L as FormulaFieldType, x as GetFieldValuesResult, w as GetFieldsResult, G as GetObjectsResult, Y as HTTPTransportConfig, I as ID_FIELD_TO_OBJECT_TYPE, P as PicklistValue, b as RelatedFieldInfo, c as RelatedFieldResolution, R as RelatedFieldResolver, h as RequestOptions, Z as SDKTransportConfig, S as SummaryType, W as Transport, _ as TransportConfig, X as TransportRequestOptions, U as UpdateOptions, k as UpsertOptions, l as UpsertResult, e as expandRelatedFields, a as getObjectTypeFromReferenceField, g as getRelatedFieldInfo, $ as isHTTPTransportConfig, a0 as isSDKTransportConfig, p as parseRelatedField, r as resolveRelatedField } from './relatedFieldMapping-BvTlofIU.cjs';
|
|
2
2
|
export { E as EXCLUDED_FIELDS_FOR_STAR_QUERY, l as FIELD_TYPE_IDS, m as FIELD_TYPE_MAPPINGS, i as FireberrySDKAPI, F as FireberrySDKClient, O as OBJECT_ID_MAP, n as OBJECT_NAME_MAP, Q as QueryBuilder, c as QueryConditionItem, h as QueryExplainResult, f as QueryItem, g as QueryOperator, a as QueryOptions, b as QueryResult, d as QuerySeparatorItem, k as SDKContext, S as SDKQueryPayload, j as SDKResponseData, e as escapeQueryValue, s as sanitizeQuery } from './excludedFields-Dk-ILROQ.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BatchCreateOptions, o as BatchDeleteOptions, s as BatchDeleteResult, q as BatchResult, m as BatchUpdateOptions, n as BatchUpdateRecord, C as CacheControl, O as CreateFieldOptions, z as CreateFieldOptionsBase, Q as CreateFieldResult, y as CreateFieldType, M as CreateFormulaFieldOptions, H as CreateLookupFieldOptions, E as CreateNumberFieldOptions, j as CreateOptions, J as CreatePicklistFieldOptions, N as CreateSimpleFieldOptions, K as CreateSummaryFieldOptions, A as CreateTextFieldOptions, D as DeleteOptions, d as FieldMetadataMap, v as FieldValue, T as FileUploadOptions, V as FileUploadResult, F as FireberryClient, f as FireberryClientConfig, u as FireberryField, t as FireberryObject, i as FireberryRecord, L as FormulaFieldType, x as GetFieldValuesResult, w as GetFieldsResult, G as GetObjectsResult, Y as HTTPTransportConfig, I as ID_FIELD_TO_OBJECT_TYPE, P as PicklistValue, b as RelatedFieldInfo, c as RelatedFieldResolution, R as RelatedFieldResolver, h as RequestOptions, Z as SDKTransportConfig, S as SummaryType, W as Transport, _ as TransportConfig, X as TransportRequestOptions, U as UpdateOptions, k as UpsertOptions, l as UpsertResult, e as expandRelatedFields, a as getObjectTypeFromReferenceField, g as getRelatedFieldInfo, $ as isHTTPTransportConfig, a0 as isSDKTransportConfig, p as parseRelatedField, r as resolveRelatedField } from './relatedFieldMapping-
|
|
1
|
+
export { B as BatchCreateOptions, o as BatchDeleteOptions, s as BatchDeleteResult, q as BatchResult, m as BatchUpdateOptions, n as BatchUpdateRecord, C as CacheControl, O as CreateFieldOptions, z as CreateFieldOptionsBase, Q as CreateFieldResult, y as CreateFieldType, M as CreateFormulaFieldOptions, H as CreateLookupFieldOptions, E as CreateNumberFieldOptions, j as CreateOptions, J as CreatePicklistFieldOptions, N as CreateSimpleFieldOptions, K as CreateSummaryFieldOptions, A as CreateTextFieldOptions, D as DeleteOptions, d as FieldMetadataMap, v as FieldValue, T as FileUploadOptions, V as FileUploadResult, F as FireberryClient, f as FireberryClientConfig, u as FireberryField, t as FireberryObject, i as FireberryRecord, L as FormulaFieldType, x as GetFieldValuesResult, w as GetFieldsResult, G as GetObjectsResult, Y as HTTPTransportConfig, I as ID_FIELD_TO_OBJECT_TYPE, P as PicklistValue, b as RelatedFieldInfo, c as RelatedFieldResolution, R as RelatedFieldResolver, h as RequestOptions, Z as SDKTransportConfig, S as SummaryType, W as Transport, _ as TransportConfig, X as TransportRequestOptions, U as UpdateOptions, k as UpsertOptions, l as UpsertResult, e as expandRelatedFields, a as getObjectTypeFromReferenceField, g as getRelatedFieldInfo, $ as isHTTPTransportConfig, a0 as isSDKTransportConfig, p as parseRelatedField, r as resolveRelatedField } from './relatedFieldMapping-D0fbCEeA.js';
|
|
2
2
|
export { E as EXCLUDED_FIELDS_FOR_STAR_QUERY, l as FIELD_TYPE_IDS, m as FIELD_TYPE_MAPPINGS, i as FireberrySDKAPI, F as FireberrySDKClient, O as OBJECT_ID_MAP, n as OBJECT_NAME_MAP, Q as QueryBuilder, c as QueryConditionItem, h as QueryExplainResult, f as QueryItem, g as QueryOperator, a as QueryOptions, b as QueryResult, d as QuerySeparatorItem, k as SDKContext, S as SDKQueryPayload, j as SDKResponseData, e as escapeQueryValue, s as sanitizeQuery } from './excludedFields-Dk-ILROQ.js';
|
|
3
3
|
|
|
4
4
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1075,6 +1075,7 @@ function chunkArray(array, size) {
|
|
|
1075
1075
|
var HTTPTransport = class {
|
|
1076
1076
|
config;
|
|
1077
1077
|
constructor(config) {
|
|
1078
|
+
console.log("[HTTPTransport] CONSTRUCTOR CALLED", config);
|
|
1078
1079
|
this.config = {
|
|
1079
1080
|
apiKey: config.apiKey,
|
|
1080
1081
|
baseUrl: config.baseUrl || "https://api.fireberry.com",
|
|
@@ -1294,14 +1295,20 @@ var HTTPTransport = class {
|
|
|
1294
1295
|
};
|
|
1295
1296
|
}
|
|
1296
1297
|
/**
|
|
1297
|
-
* Executes a fetch request with retry logic for 429 errors
|
|
1298
|
+
* Executes a fetch request with retry logic for 429 errors and timeouts
|
|
1299
|
+
* Implements exponential backoff for timeout duration
|
|
1298
1300
|
*/
|
|
1299
1301
|
async executeWithRetry(url, options, retryCount = 0) {
|
|
1300
1302
|
try {
|
|
1303
|
+
const maxTimeout = 3e5;
|
|
1304
|
+
const currentTimeout = Math.min(
|
|
1305
|
+
this.config.timeout * Math.pow(2, retryCount),
|
|
1306
|
+
maxTimeout
|
|
1307
|
+
);
|
|
1301
1308
|
const timeoutController = new AbortController();
|
|
1302
1309
|
const timeoutId = setTimeout(() => {
|
|
1303
1310
|
timeoutController.abort();
|
|
1304
|
-
},
|
|
1311
|
+
}, currentTimeout);
|
|
1305
1312
|
const combinedSignal = options.signal ? this.combineSignals([options.signal, timeoutController.signal]) : timeoutController.signal;
|
|
1306
1313
|
const response = await fetch(url, {
|
|
1307
1314
|
...options,
|
|
@@ -1332,7 +1339,17 @@ var HTTPTransport = class {
|
|
|
1332
1339
|
return body;
|
|
1333
1340
|
} catch (error) {
|
|
1334
1341
|
if (error instanceof Error && error.name === "AbortError") {
|
|
1335
|
-
|
|
1342
|
+
if (options.signal?.aborted) {
|
|
1343
|
+
throw createNetworkError(error);
|
|
1344
|
+
}
|
|
1345
|
+
if (this.config.retryOn429 && retryCount < this.config.maxRetries) {
|
|
1346
|
+
await wait(this.config.retryDelay);
|
|
1347
|
+
return this.executeWithRetry(url, options, retryCount + 1);
|
|
1348
|
+
}
|
|
1349
|
+
throw new FireberryError("Request timeout after max retries", {
|
|
1350
|
+
code: "TIMEOUT" /* TIMEOUT */,
|
|
1351
|
+
context: { retryCount }
|
|
1352
|
+
});
|
|
1336
1353
|
}
|
|
1337
1354
|
if (error instanceof FireberryError) {
|
|
1338
1355
|
throw error;
|
|
@@ -1361,6 +1378,7 @@ var BATCH_SIZE = 20;
|
|
|
1361
1378
|
var SDKTransport = class {
|
|
1362
1379
|
sdk;
|
|
1363
1380
|
constructor(config) {
|
|
1381
|
+
console.log("[SDKTransport] CONSTRUCTOR CALLED", config);
|
|
1364
1382
|
this.sdk = config.sdk;
|
|
1365
1383
|
}
|
|
1366
1384
|
getType() {
|
|
@@ -1614,10 +1632,16 @@ var SDKTransport = class {
|
|
|
1614
1632
|
|
|
1615
1633
|
// src/utils/transport.ts
|
|
1616
1634
|
function createTransport(config) {
|
|
1635
|
+
console.log("[createTransport] config:", config);
|
|
1636
|
+
console.log("[createTransport] config.sdk:", config.sdk);
|
|
1637
|
+
console.log("[createTransport] config.apiKey:", config.apiKey);
|
|
1638
|
+
console.log("[createTransport] !!config.sdk:", !!config.sdk);
|
|
1617
1639
|
if (config.sdk) {
|
|
1640
|
+
console.log("[createTransport] Using SDKTransport");
|
|
1618
1641
|
return new SDKTransport({ sdk: config.sdk });
|
|
1619
1642
|
}
|
|
1620
1643
|
if (config.apiKey) {
|
|
1644
|
+
console.log("[createTransport] Using HTTPTransport");
|
|
1621
1645
|
return new HTTPTransport({
|
|
1622
1646
|
apiKey: config.apiKey,
|
|
1623
1647
|
baseUrl: config.baseUrl,
|