@etainabl/nodejs-sdk 1.3.159 → 1.3.161
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/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.cts +22 -2
- package/dist/index.d.ts +22 -2
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -315,6 +315,7 @@ interface Portal {
|
|
|
315
315
|
url?: string;
|
|
316
316
|
scraperId?: string;
|
|
317
317
|
scraperStartDate?: Date;
|
|
318
|
+
useNewValidation?: boolean;
|
|
318
319
|
}
|
|
319
320
|
|
|
320
321
|
interface StatusHistory {
|
|
@@ -845,6 +846,7 @@ interface InvoiceValidation<IDType = ObjectId | string> {
|
|
|
845
846
|
accountIdMatches?: object;
|
|
846
847
|
companyId: IDType;
|
|
847
848
|
userSub: string;
|
|
849
|
+
tags?: string[];
|
|
848
850
|
}
|
|
849
851
|
|
|
850
852
|
interface SupplierPortals<IDType = ObjectId | string> {
|
|
@@ -1438,6 +1440,14 @@ interface ETNPagedResponse<T = any> {
|
|
|
1438
1440
|
limit: number;
|
|
1439
1441
|
skip: number;
|
|
1440
1442
|
}
|
|
1443
|
+
interface AutomationFetchRunResponse {
|
|
1444
|
+
success: boolean;
|
|
1445
|
+
processed: number;
|
|
1446
|
+
results: Array<{
|
|
1447
|
+
automationRunId: string;
|
|
1448
|
+
accountId: string;
|
|
1449
|
+
}>;
|
|
1450
|
+
}
|
|
1441
1451
|
interface AuthOptions {
|
|
1442
1452
|
key?: string;
|
|
1443
1453
|
token?: string;
|
|
@@ -1568,7 +1578,7 @@ declare const _default$4: (auth: AuthOptions, instanceOptions?: CreateAxiosDefau
|
|
|
1568
1578
|
createScraperRun: (data: any, options?: AxiosRequestConfig) => Promise<ScraperRun<string>>;
|
|
1569
1579
|
createScraperRunLog: (id: string, data: any, options?: AxiosRequestConfig) => Promise<ScraperRun<string>>;
|
|
1570
1580
|
createAutomationRun: (data: Omit<AutomationRun<string, string>, "_id">, options?: AxiosRequestConfig) => Promise<AutomationRun<string, string | Date>>;
|
|
1571
|
-
createAutomationFetchRun: (data: any, options?: AxiosRequestConfig) => Promise<
|
|
1581
|
+
createAutomationFetchRun: (data: any, options?: AxiosRequestConfig) => Promise<AutomationFetchRunResponse>;
|
|
1572
1582
|
listAutomationRun: <P = AutomationRun<string, string | Date>>(options?: AxiosRequestConfig) => Promise<ETNPagedResponse<P>>;
|
|
1573
1583
|
getAutomationRun: (id: string, options?: AxiosRequestConfig) => Promise<AutomationRun<string, string | Date>>;
|
|
1574
1584
|
updateAutomationRun: (id: string, data: any, options?: AxiosRequestConfig) => Promise<AutomationRun<string, string>>;
|
|
@@ -1683,15 +1693,25 @@ declare class IngestHandler {
|
|
|
1683
1693
|
deleteMessage(queueUrl?: string | undefined): Promise<void>;
|
|
1684
1694
|
}
|
|
1685
1695
|
|
|
1696
|
+
/**
|
|
1697
|
+
* Determines if an error is transient and should be retried automatically.
|
|
1698
|
+
* Transient errors include network issues, timeouts, and server errors.
|
|
1699
|
+
*
|
|
1700
|
+
* @param error - The error object to check
|
|
1701
|
+
* @returns true if the error is transient and should be retried
|
|
1702
|
+
*/
|
|
1703
|
+
declare function isTransientError(error: any): boolean;
|
|
1704
|
+
|
|
1686
1705
|
type index$1_IngestHandler = IngestHandler;
|
|
1687
1706
|
declare const index$1_IngestHandler: typeof IngestHandler;
|
|
1688
1707
|
declare const index$1_automationServices: typeof automationServices;
|
|
1689
1708
|
declare const index$1_automationSources: typeof automationSources;
|
|
1690
1709
|
declare const index$1_getMeterPointNumberBottomLine: typeof getMeterPointNumberBottomLine;
|
|
1710
|
+
declare const index$1_isTransientError: typeof isTransientError;
|
|
1691
1711
|
declare const index$1_utilityTypes: typeof utilityTypes;
|
|
1692
1712
|
declare const index$1_wasteCategories: typeof wasteCategories;
|
|
1693
1713
|
declare namespace index$1 {
|
|
1694
|
-
export { index$1_IngestHandler as IngestHandler, index$1_automationServices as automationServices, index$1_automationSources as automationSources, index$1_getMeterPointNumberBottomLine as getMeterPointNumberBottomLine, units$1 as units, index$1_utilityTypes as utilityTypes, index$1_wasteCategories as wasteCategories };
|
|
1714
|
+
export { index$1_IngestHandler as IngestHandler, index$1_automationServices as automationServices, index$1_automationSources as automationSources, index$1_getMeterPointNumberBottomLine as getMeterPointNumberBottomLine, index$1_isTransientError as isTransientError, units$1 as units, index$1_utilityTypes as utilityTypes, index$1_wasteCategories as wasteCategories };
|
|
1695
1715
|
}
|
|
1696
1716
|
|
|
1697
1717
|
interface ETNModel {
|
package/dist/index.d.ts
CHANGED
|
@@ -315,6 +315,7 @@ interface Portal {
|
|
|
315
315
|
url?: string;
|
|
316
316
|
scraperId?: string;
|
|
317
317
|
scraperStartDate?: Date;
|
|
318
|
+
useNewValidation?: boolean;
|
|
318
319
|
}
|
|
319
320
|
|
|
320
321
|
interface StatusHistory {
|
|
@@ -845,6 +846,7 @@ interface InvoiceValidation<IDType = ObjectId | string> {
|
|
|
845
846
|
accountIdMatches?: object;
|
|
846
847
|
companyId: IDType;
|
|
847
848
|
userSub: string;
|
|
849
|
+
tags?: string[];
|
|
848
850
|
}
|
|
849
851
|
|
|
850
852
|
interface SupplierPortals<IDType = ObjectId | string> {
|
|
@@ -1438,6 +1440,14 @@ interface ETNPagedResponse<T = any> {
|
|
|
1438
1440
|
limit: number;
|
|
1439
1441
|
skip: number;
|
|
1440
1442
|
}
|
|
1443
|
+
interface AutomationFetchRunResponse {
|
|
1444
|
+
success: boolean;
|
|
1445
|
+
processed: number;
|
|
1446
|
+
results: Array<{
|
|
1447
|
+
automationRunId: string;
|
|
1448
|
+
accountId: string;
|
|
1449
|
+
}>;
|
|
1450
|
+
}
|
|
1441
1451
|
interface AuthOptions {
|
|
1442
1452
|
key?: string;
|
|
1443
1453
|
token?: string;
|
|
@@ -1568,7 +1578,7 @@ declare const _default$4: (auth: AuthOptions, instanceOptions?: CreateAxiosDefau
|
|
|
1568
1578
|
createScraperRun: (data: any, options?: AxiosRequestConfig) => Promise<ScraperRun<string>>;
|
|
1569
1579
|
createScraperRunLog: (id: string, data: any, options?: AxiosRequestConfig) => Promise<ScraperRun<string>>;
|
|
1570
1580
|
createAutomationRun: (data: Omit<AutomationRun<string, string>, "_id">, options?: AxiosRequestConfig) => Promise<AutomationRun<string, string | Date>>;
|
|
1571
|
-
createAutomationFetchRun: (data: any, options?: AxiosRequestConfig) => Promise<
|
|
1581
|
+
createAutomationFetchRun: (data: any, options?: AxiosRequestConfig) => Promise<AutomationFetchRunResponse>;
|
|
1572
1582
|
listAutomationRun: <P = AutomationRun<string, string | Date>>(options?: AxiosRequestConfig) => Promise<ETNPagedResponse<P>>;
|
|
1573
1583
|
getAutomationRun: (id: string, options?: AxiosRequestConfig) => Promise<AutomationRun<string, string | Date>>;
|
|
1574
1584
|
updateAutomationRun: (id: string, data: any, options?: AxiosRequestConfig) => Promise<AutomationRun<string, string>>;
|
|
@@ -1683,15 +1693,25 @@ declare class IngestHandler {
|
|
|
1683
1693
|
deleteMessage(queueUrl?: string | undefined): Promise<void>;
|
|
1684
1694
|
}
|
|
1685
1695
|
|
|
1696
|
+
/**
|
|
1697
|
+
* Determines if an error is transient and should be retried automatically.
|
|
1698
|
+
* Transient errors include network issues, timeouts, and server errors.
|
|
1699
|
+
*
|
|
1700
|
+
* @param error - The error object to check
|
|
1701
|
+
* @returns true if the error is transient and should be retried
|
|
1702
|
+
*/
|
|
1703
|
+
declare function isTransientError(error: any): boolean;
|
|
1704
|
+
|
|
1686
1705
|
type index$1_IngestHandler = IngestHandler;
|
|
1687
1706
|
declare const index$1_IngestHandler: typeof IngestHandler;
|
|
1688
1707
|
declare const index$1_automationServices: typeof automationServices;
|
|
1689
1708
|
declare const index$1_automationSources: typeof automationSources;
|
|
1690
1709
|
declare const index$1_getMeterPointNumberBottomLine: typeof getMeterPointNumberBottomLine;
|
|
1710
|
+
declare const index$1_isTransientError: typeof isTransientError;
|
|
1691
1711
|
declare const index$1_utilityTypes: typeof utilityTypes;
|
|
1692
1712
|
declare const index$1_wasteCategories: typeof wasteCategories;
|
|
1693
1713
|
declare namespace index$1 {
|
|
1694
|
-
export { index$1_IngestHandler as IngestHandler, index$1_automationServices as automationServices, index$1_automationSources as automationSources, index$1_getMeterPointNumberBottomLine as getMeterPointNumberBottomLine, units$1 as units, index$1_utilityTypes as utilityTypes, index$1_wasteCategories as wasteCategories };
|
|
1714
|
+
export { index$1_IngestHandler as IngestHandler, index$1_automationServices as automationServices, index$1_automationSources as automationSources, index$1_getMeterPointNumberBottomLine as getMeterPointNumberBottomLine, index$1_isTransientError as isTransientError, units$1 as units, index$1_utilityTypes as utilityTypes, index$1_wasteCategories as wasteCategories };
|
|
1695
1715
|
}
|
|
1696
1716
|
|
|
1697
1717
|
interface ETNModel {
|
package/dist/index.js
CHANGED
|
@@ -17144,6 +17144,7 @@ __export(utils_exports, {
|
|
|
17144
17144
|
automationServices: () => automationServices,
|
|
17145
17145
|
automationSources: () => automationSources,
|
|
17146
17146
|
getMeterPointNumberBottomLine: () => getMeterPointNumberBottomLine,
|
|
17147
|
+
isTransientError: () => isTransientError2,
|
|
17147
17148
|
units: () => units,
|
|
17148
17149
|
utilityTypes: () => utilityTypes,
|
|
17149
17150
|
wasteCategories: () => wasteCategories
|
|
@@ -23297,6 +23298,23 @@ var IngestHandler = class {
|
|
|
23297
23298
|
}
|
|
23298
23299
|
};
|
|
23299
23300
|
|
|
23301
|
+
// src/utils/errors.ts
|
|
23302
|
+
function isTransientError2(error) {
|
|
23303
|
+
if (error.code === "ETIMEDOUT" || error.code === "ECONNRESET" || error.code === "ENOTFOUND" || error.code === "ECONNREFUSED") {
|
|
23304
|
+
return true;
|
|
23305
|
+
}
|
|
23306
|
+
if (error.message?.includes("timeout") || error.message?.includes("ETIMEDOUT")) {
|
|
23307
|
+
return true;
|
|
23308
|
+
}
|
|
23309
|
+
if (error.response?.status >= 500 && error.response?.status < 600) {
|
|
23310
|
+
return true;
|
|
23311
|
+
}
|
|
23312
|
+
if (error.message?.includes("Cloudflare") || error.message?.includes("522") || error.message?.includes("524")) {
|
|
23313
|
+
return true;
|
|
23314
|
+
}
|
|
23315
|
+
return false;
|
|
23316
|
+
}
|
|
23317
|
+
|
|
23300
23318
|
// src/openai/index.ts
|
|
23301
23319
|
var openai_exports = {};
|
|
23302
23320
|
__export(openai_exports, {
|