@etainabl/nodejs-sdk 1.3.186 → 1.3.188
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 +48 -37
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.cts +28 -34
- package/dist/index.d.ts +28 -34
- package/dist/index.js +119 -108
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -474,7 +474,7 @@ interface Action {
|
|
|
474
474
|
icon?: string;
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
interface
|
|
477
|
+
interface AlertTriggerRule<ID = string, DateType = Date | string, metadataType = {
|
|
478
478
|
[key: string]: any;
|
|
479
479
|
}> {
|
|
480
480
|
_id: ID;
|
|
@@ -493,8 +493,8 @@ interface CustomAlertTrigger<ID = string, DateType = Date | string, metadataType
|
|
|
493
493
|
processedAt?: DateType;
|
|
494
494
|
lastTriggeredEvent?: DateType;
|
|
495
495
|
companyId: ID;
|
|
496
|
-
|
|
497
|
-
|
|
496
|
+
userId: ID;
|
|
497
|
+
recipientUserIds?: ID[];
|
|
498
498
|
active: boolean;
|
|
499
499
|
createdAt?: DateType;
|
|
500
500
|
updatedAt?: DateType;
|
|
@@ -503,7 +503,7 @@ interface CustomAlertTrigger<ID = string, DateType = Date | string, metadataType
|
|
|
503
503
|
deletedBy?: string;
|
|
504
504
|
}
|
|
505
505
|
|
|
506
|
-
interface
|
|
506
|
+
interface AlertTriggerQueueMessage {
|
|
507
507
|
triggerId: string;
|
|
508
508
|
jobId: string;
|
|
509
509
|
windowStart?: string;
|
|
@@ -672,7 +672,7 @@ type FormattedReading = Omit<Reading<string, string>, '_id'>;
|
|
|
672
672
|
type FormattedInvoice = Omit<Invoice<string, string>, '_id' | 's3Key'>;
|
|
673
673
|
interface HandleErrorParams {
|
|
674
674
|
context: Context;
|
|
675
|
-
etnApi: ReturnType<typeof _default$
|
|
675
|
+
etnApi: ReturnType<typeof _default$4>;
|
|
676
676
|
automationRun: AutomationRun<string>;
|
|
677
677
|
lambdaSource: string;
|
|
678
678
|
error: Error;
|
|
@@ -1313,12 +1313,10 @@ interface Job<ID = string, DateType = Date | string> {
|
|
|
1313
1313
|
windowEnd?: DateType;
|
|
1314
1314
|
startedAt?: DateType;
|
|
1315
1315
|
completedAt?: DateType;
|
|
1316
|
-
heartbeatAt?: DateType;
|
|
1317
1316
|
expiresAt?: DateType;
|
|
1318
1317
|
error?: string;
|
|
1319
1318
|
metadata?: Record<string, any>;
|
|
1320
1319
|
companyId?: ID;
|
|
1321
|
-
userSub?: string;
|
|
1322
1320
|
createdAt?: DateType;
|
|
1323
1321
|
updatedAt?: DateType;
|
|
1324
1322
|
deleted?: boolean;
|
|
@@ -1369,13 +1367,13 @@ interface Notification<ID = string, DateType = Date | string> {
|
|
|
1369
1367
|
notificationTemplateId: ID;
|
|
1370
1368
|
scheduledAt?: DateType;
|
|
1371
1369
|
scheduledBy?: string;
|
|
1372
|
-
|
|
1370
|
+
userId: ID;
|
|
1373
1371
|
toastHasShown?: boolean;
|
|
1374
1372
|
message?: string;
|
|
1375
1373
|
status: string;
|
|
1376
1374
|
isAcknowledged?: boolean;
|
|
1377
1375
|
acknowledgedAt?: DateType;
|
|
1378
|
-
|
|
1376
|
+
alertTriggerRuleId?: ID;
|
|
1379
1377
|
details?: Record<string, any>;
|
|
1380
1378
|
route?: {
|
|
1381
1379
|
name: string;
|
|
@@ -1538,14 +1536,14 @@ interface NotificationSQSMessage<E extends NotificationContextEventName = Notifi
|
|
|
1538
1536
|
eventName: E;
|
|
1539
1537
|
timestamp: string;
|
|
1540
1538
|
companyId: string;
|
|
1541
|
-
|
|
1539
|
+
userId: string;
|
|
1542
1540
|
alertTriggerId?: string;
|
|
1543
1541
|
notificationTemplateId?: string;
|
|
1544
1542
|
context: NotificationContextMap[E];
|
|
1545
1543
|
}
|
|
1546
1544
|
interface SendNotificationMessageInput {
|
|
1547
1545
|
companyId: string;
|
|
1548
|
-
|
|
1546
|
+
userId: string;
|
|
1549
1547
|
alertTriggerId?: string;
|
|
1550
1548
|
timestamp?: string;
|
|
1551
1549
|
notificationTemplateId?: string;
|
|
@@ -1790,20 +1788,20 @@ interface ETNBulkUpdateResult {
|
|
|
1790
1788
|
modifiedCount: number;
|
|
1791
1789
|
matchedCount: number;
|
|
1792
1790
|
}
|
|
1793
|
-
interface
|
|
1791
|
+
interface BulkUpdateAlertTriggerRuleItem {
|
|
1794
1792
|
id: string;
|
|
1795
1793
|
processedAt?: Date | string;
|
|
1796
1794
|
lastTriggeredEvent?: Date | string;
|
|
1797
1795
|
}
|
|
1798
|
-
interface
|
|
1799
|
-
updates:
|
|
1796
|
+
interface BulkUpdateAlertTriggerRulesRequest {
|
|
1797
|
+
updates: BulkUpdateAlertTriggerRuleItem[];
|
|
1800
1798
|
}
|
|
1801
1799
|
interface AuthOptions {
|
|
1802
1800
|
key?: string;
|
|
1803
1801
|
token?: string;
|
|
1804
1802
|
userOnly?: boolean;
|
|
1805
1803
|
}
|
|
1806
|
-
declare const _default$
|
|
1804
|
+
declare const _default$4: (auth: AuthOptions, instanceOptions?: CreateAxiosDefaults) => {
|
|
1807
1805
|
instance: AxiosInstance;
|
|
1808
1806
|
getAccount: (id: string, options?: AxiosRequestConfig) => Promise<Account<string>>;
|
|
1809
1807
|
listAccounts: <P = Account<string>>(options?: AxiosRequestConfig) => Promise<ETNPagedResponse<P>>;
|
|
@@ -1812,16 +1810,16 @@ declare const _default$5: (auth: AuthOptions, instanceOptions?: CreateAxiosDefau
|
|
|
1812
1810
|
removeAccount: (id: string, options?: AxiosRequestConfig) => Promise<Account<string>>;
|
|
1813
1811
|
getAccountSchema: (options?: AxiosRequestConfig) => Promise<any>;
|
|
1814
1812
|
invalidateAccountCache: (id: string, data: any, options?: AxiosRequestConfig) => Promise<any>;
|
|
1815
|
-
|
|
1813
|
+
getAlertTriggerRule: (id: string, options?: AxiosRequestConfig) => Promise<AlertTriggerRule<string, string, {
|
|
1816
1814
|
[key: string]: any;
|
|
1817
1815
|
}>>;
|
|
1818
|
-
|
|
1816
|
+
listAlertTriggerRules: <P = AlertTriggerRule<string, string, {
|
|
1819
1817
|
[key: string]: any;
|
|
1820
1818
|
}>>(options?: AxiosRequestConfig) => Promise<ETNPagedResponse<P>>;
|
|
1821
|
-
|
|
1819
|
+
updateAlertTriggerRule: (id: string, data: any, options?: AxiosRequestConfig) => Promise<AlertTriggerRule<string, string | Date, {
|
|
1822
1820
|
[key: string]: any;
|
|
1823
1821
|
}>>;
|
|
1824
|
-
|
|
1822
|
+
bulkUpdateAlertTriggerRules: (data: BulkUpdateAlertTriggerRulesRequest, options?: AxiosRequestConfig) => Promise<ETNBulkUpdateResult>;
|
|
1825
1823
|
getAsset: (id: string, options?: AxiosRequestConfig) => Promise<Asset<string>>;
|
|
1826
1824
|
listAssets: <P = Asset<string>>(options?: AxiosRequestConfig) => Promise<ETNPagedResponse<P>>;
|
|
1827
1825
|
updateAsset: (id: string, data: any, options?: AxiosRequestConfig) => Promise<Asset<string>>;
|
|
@@ -1980,7 +1978,7 @@ interface EmailTemplateOptions {
|
|
|
1980
1978
|
footer?: string;
|
|
1981
1979
|
includeTimestamp?: boolean;
|
|
1982
1980
|
}
|
|
1983
|
-
declare const _default$
|
|
1981
|
+
declare const _default$3: (options: EmailTemplateOptions) => string;
|
|
1984
1982
|
|
|
1985
1983
|
interface NotificationEmailOptions {
|
|
1986
1984
|
title: string;
|
|
@@ -1998,18 +1996,18 @@ interface NotificationEmailOptions {
|
|
|
1998
1996
|
}>;
|
|
1999
1997
|
}
|
|
2000
1998
|
declare function generateNotificationEmail(options: NotificationEmailOptions): string;
|
|
2001
|
-
declare const _default$
|
|
1999
|
+
declare const _default$2: {
|
|
2002
2000
|
generateNotificationEmail: typeof generateNotificationEmail;
|
|
2003
2001
|
};
|
|
2004
2002
|
|
|
2005
|
-
interface LoggerOptions {
|
|
2006
|
-
betterstack: boolean;
|
|
2007
|
-
betterStackHost: string;
|
|
2008
|
-
}
|
|
2009
2003
|
interface ExtendedLogger extends winston.Logger {
|
|
2010
2004
|
logtail?: Logtail;
|
|
2011
2005
|
}
|
|
2012
|
-
|
|
2006
|
+
interface LoggerOptions {
|
|
2007
|
+
feature?: string;
|
|
2008
|
+
}
|
|
2009
|
+
declare function logger(namespace: string, options?: LoggerOptions): ExtendedLogger;
|
|
2010
|
+
declare function loggerWithBetterStack(namespace: string, options?: LoggerOptions): Promise<ExtendedLogger>;
|
|
2013
2011
|
|
|
2014
2012
|
declare function connectToDatabase(retryAttempt?: number): Promise<Db>;
|
|
2015
2013
|
declare const _default$1: {
|
|
@@ -2020,10 +2018,6 @@ declare const _default: {
|
|
|
2020
2018
|
postMessage: (message: string) => Promise<axios.AxiosResponse<any, any>>;
|
|
2021
2019
|
};
|
|
2022
2020
|
|
|
2023
|
-
declare namespace notification {
|
|
2024
|
-
export { };
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
2021
|
interface SendNotificationMessageOptions {
|
|
2028
2022
|
queueUrl?: string;
|
|
2029
2023
|
sqsClient?: SQSClient;
|
|
@@ -2100,7 +2094,7 @@ declare const automationServices: {
|
|
|
2100
2094
|
}[];
|
|
2101
2095
|
|
|
2102
2096
|
declare function updateBatchJobStatus({ etnApi, automationRun, accountKey, status, errorMessage }: {
|
|
2103
|
-
etnApi: ReturnType<typeof _default$
|
|
2097
|
+
etnApi: ReturnType<typeof _default$4>;
|
|
2104
2098
|
automationRun: AutomationRun<string>;
|
|
2105
2099
|
accountKey?: string;
|
|
2106
2100
|
status: 'completed' | 'failed';
|
|
@@ -2118,7 +2112,7 @@ interface StepFunctionEvent {
|
|
|
2118
2112
|
}
|
|
2119
2113
|
declare class IngestHandler {
|
|
2120
2114
|
protected event: SQSEvent | SNSEvent | APIGatewayEvent | S3Event;
|
|
2121
|
-
protected log: ReturnType<typeof
|
|
2115
|
+
protected log: ReturnType<typeof logger>;
|
|
2122
2116
|
protected sqsReceiptHandle: string | undefined;
|
|
2123
2117
|
constructor(event: any);
|
|
2124
2118
|
isSQSEvent(event: any): event is SQSEvent;
|
|
@@ -2284,7 +2278,7 @@ type ETNModels = keyof typeof models;
|
|
|
2284
2278
|
declare abstract class Model {
|
|
2285
2279
|
openai: OpenAI;
|
|
2286
2280
|
protected models: Record<ETNModels, ETNModel>;
|
|
2287
|
-
protected log: ReturnType<typeof
|
|
2281
|
+
protected log: ReturnType<typeof logger>;
|
|
2288
2282
|
constructor();
|
|
2289
2283
|
}
|
|
2290
2284
|
|
|
@@ -2340,4 +2334,4 @@ declare namespace scrapers {
|
|
|
2340
2334
|
export type { scrapers_ETNAccount as ETNAccount };
|
|
2341
2335
|
}
|
|
2342
2336
|
|
|
2343
|
-
export { type AccessLevel, type Account, type AccountResult, type Action, type ActionType, type Asset, type Automation, type AutomationRun, type AutomationRunLog, type AutomationRunSummary, type AutomationService, type AutomationServiceCategory, type AutomationSource, type Company, type CompanyInvoiceValidationRule, type CompanyInvoiceValidationSettings, type Consumption, type CreateScraperRunParams, type
|
|
2337
|
+
export { type AccessLevel, type Account, type AccountResult, type Action, type ActionType, type AlertTriggerQueueMessage, type AlertTriggerRule, type Asset, type Automation, type AutomationRun, type AutomationRunLog, type AutomationRunSummary, type AutomationService, type AutomationServiceCategory, type AutomationSource, type Company, type CompanyInvoiceValidationRule, type CompanyInvoiceValidationSettings, type Consumption, type CreateScraperRunParams, type DataIngest, type DefaultField, type DeliveryStatus, type ETNEvent, type ETNPagedResponse$1 as ETNPagedResponse, type Email, type Entity, EventNamesByCategory, type FileFormat, type ImportTemplate, type Invoice, type InvoiceCapture, type InvoiceCaptureMetadata, type InvoiceCaptureMetadataResult, type InvoiceRate, type InvoiceRateType, type InvoiceValidation, type InvoiceValidationInvoice, type InvoiceValidationResults, type InvoiceValidationRule, type InvoiceValues, type Job, type JobStatus, type Log, type Notification, type NotificationAction, type NotificationCategory, NotificationCategoryList, type NotificationCategoryPreferences, type NotificationChannels, type NotificationContext, type NotificationContextEventName, type NotificationContextMap, NotificationDefaultChannels, type NotificationEventName, type NotificationPreferences, type NotificationSQSMessage, type NotificationTemplate, type NotificationTemplateConfig, type NotificationTemplateConfigOption, type NotificationTemplateConfigType, type NotificationTemplateDefaultChannel, type NotificationTemplateRoute, type NotificationTemplateSeverity, type NotificationTemplatesMap, type Portal, type PortalSupplierSchema, type Problem, type ProblemCodes, type ProblemDetails, type Reading, type Report, type ReportMetadata, type ReportSource, type ReportSourceIdItem, type ReportTemplate, type ReportType, type ScraperRun, type SendNotificationMessageInput, type Setting, type SourceType, type Supplier, type User, type UtilityType, type WasteCategories, type WasteTypes, _default$4 as api, consumption, _default$1 as db, _default$3 as emailTemplate, integrations, logger, loggerWithBetterStack, monitoring, _default$2 as notificationEmailTemplate, notificationQueue, index as openai, reporting, scrapers, _default as slack, units, index$1 as utils };
|
package/dist/index.d.ts
CHANGED
|
@@ -474,7 +474,7 @@ interface Action {
|
|
|
474
474
|
icon?: string;
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
interface
|
|
477
|
+
interface AlertTriggerRule<ID = string, DateType = Date | string, metadataType = {
|
|
478
478
|
[key: string]: any;
|
|
479
479
|
}> {
|
|
480
480
|
_id: ID;
|
|
@@ -493,8 +493,8 @@ interface CustomAlertTrigger<ID = string, DateType = Date | string, metadataType
|
|
|
493
493
|
processedAt?: DateType;
|
|
494
494
|
lastTriggeredEvent?: DateType;
|
|
495
495
|
companyId: ID;
|
|
496
|
-
|
|
497
|
-
|
|
496
|
+
userId: ID;
|
|
497
|
+
recipientUserIds?: ID[];
|
|
498
498
|
active: boolean;
|
|
499
499
|
createdAt?: DateType;
|
|
500
500
|
updatedAt?: DateType;
|
|
@@ -503,7 +503,7 @@ interface CustomAlertTrigger<ID = string, DateType = Date | string, metadataType
|
|
|
503
503
|
deletedBy?: string;
|
|
504
504
|
}
|
|
505
505
|
|
|
506
|
-
interface
|
|
506
|
+
interface AlertTriggerQueueMessage {
|
|
507
507
|
triggerId: string;
|
|
508
508
|
jobId: string;
|
|
509
509
|
windowStart?: string;
|
|
@@ -672,7 +672,7 @@ type FormattedReading = Omit<Reading<string, string>, '_id'>;
|
|
|
672
672
|
type FormattedInvoice = Omit<Invoice<string, string>, '_id' | 's3Key'>;
|
|
673
673
|
interface HandleErrorParams {
|
|
674
674
|
context: Context;
|
|
675
|
-
etnApi: ReturnType<typeof _default$
|
|
675
|
+
etnApi: ReturnType<typeof _default$4>;
|
|
676
676
|
automationRun: AutomationRun<string>;
|
|
677
677
|
lambdaSource: string;
|
|
678
678
|
error: Error;
|
|
@@ -1313,12 +1313,10 @@ interface Job<ID = string, DateType = Date | string> {
|
|
|
1313
1313
|
windowEnd?: DateType;
|
|
1314
1314
|
startedAt?: DateType;
|
|
1315
1315
|
completedAt?: DateType;
|
|
1316
|
-
heartbeatAt?: DateType;
|
|
1317
1316
|
expiresAt?: DateType;
|
|
1318
1317
|
error?: string;
|
|
1319
1318
|
metadata?: Record<string, any>;
|
|
1320
1319
|
companyId?: ID;
|
|
1321
|
-
userSub?: string;
|
|
1322
1320
|
createdAt?: DateType;
|
|
1323
1321
|
updatedAt?: DateType;
|
|
1324
1322
|
deleted?: boolean;
|
|
@@ -1369,13 +1367,13 @@ interface Notification<ID = string, DateType = Date | string> {
|
|
|
1369
1367
|
notificationTemplateId: ID;
|
|
1370
1368
|
scheduledAt?: DateType;
|
|
1371
1369
|
scheduledBy?: string;
|
|
1372
|
-
|
|
1370
|
+
userId: ID;
|
|
1373
1371
|
toastHasShown?: boolean;
|
|
1374
1372
|
message?: string;
|
|
1375
1373
|
status: string;
|
|
1376
1374
|
isAcknowledged?: boolean;
|
|
1377
1375
|
acknowledgedAt?: DateType;
|
|
1378
|
-
|
|
1376
|
+
alertTriggerRuleId?: ID;
|
|
1379
1377
|
details?: Record<string, any>;
|
|
1380
1378
|
route?: {
|
|
1381
1379
|
name: string;
|
|
@@ -1538,14 +1536,14 @@ interface NotificationSQSMessage<E extends NotificationContextEventName = Notifi
|
|
|
1538
1536
|
eventName: E;
|
|
1539
1537
|
timestamp: string;
|
|
1540
1538
|
companyId: string;
|
|
1541
|
-
|
|
1539
|
+
userId: string;
|
|
1542
1540
|
alertTriggerId?: string;
|
|
1543
1541
|
notificationTemplateId?: string;
|
|
1544
1542
|
context: NotificationContextMap[E];
|
|
1545
1543
|
}
|
|
1546
1544
|
interface SendNotificationMessageInput {
|
|
1547
1545
|
companyId: string;
|
|
1548
|
-
|
|
1546
|
+
userId: string;
|
|
1549
1547
|
alertTriggerId?: string;
|
|
1550
1548
|
timestamp?: string;
|
|
1551
1549
|
notificationTemplateId?: string;
|
|
@@ -1790,20 +1788,20 @@ interface ETNBulkUpdateResult {
|
|
|
1790
1788
|
modifiedCount: number;
|
|
1791
1789
|
matchedCount: number;
|
|
1792
1790
|
}
|
|
1793
|
-
interface
|
|
1791
|
+
interface BulkUpdateAlertTriggerRuleItem {
|
|
1794
1792
|
id: string;
|
|
1795
1793
|
processedAt?: Date | string;
|
|
1796
1794
|
lastTriggeredEvent?: Date | string;
|
|
1797
1795
|
}
|
|
1798
|
-
interface
|
|
1799
|
-
updates:
|
|
1796
|
+
interface BulkUpdateAlertTriggerRulesRequest {
|
|
1797
|
+
updates: BulkUpdateAlertTriggerRuleItem[];
|
|
1800
1798
|
}
|
|
1801
1799
|
interface AuthOptions {
|
|
1802
1800
|
key?: string;
|
|
1803
1801
|
token?: string;
|
|
1804
1802
|
userOnly?: boolean;
|
|
1805
1803
|
}
|
|
1806
|
-
declare const _default$
|
|
1804
|
+
declare const _default$4: (auth: AuthOptions, instanceOptions?: CreateAxiosDefaults) => {
|
|
1807
1805
|
instance: AxiosInstance;
|
|
1808
1806
|
getAccount: (id: string, options?: AxiosRequestConfig) => Promise<Account<string>>;
|
|
1809
1807
|
listAccounts: <P = Account<string>>(options?: AxiosRequestConfig) => Promise<ETNPagedResponse<P>>;
|
|
@@ -1812,16 +1810,16 @@ declare const _default$5: (auth: AuthOptions, instanceOptions?: CreateAxiosDefau
|
|
|
1812
1810
|
removeAccount: (id: string, options?: AxiosRequestConfig) => Promise<Account<string>>;
|
|
1813
1811
|
getAccountSchema: (options?: AxiosRequestConfig) => Promise<any>;
|
|
1814
1812
|
invalidateAccountCache: (id: string, data: any, options?: AxiosRequestConfig) => Promise<any>;
|
|
1815
|
-
|
|
1813
|
+
getAlertTriggerRule: (id: string, options?: AxiosRequestConfig) => Promise<AlertTriggerRule<string, string, {
|
|
1816
1814
|
[key: string]: any;
|
|
1817
1815
|
}>>;
|
|
1818
|
-
|
|
1816
|
+
listAlertTriggerRules: <P = AlertTriggerRule<string, string, {
|
|
1819
1817
|
[key: string]: any;
|
|
1820
1818
|
}>>(options?: AxiosRequestConfig) => Promise<ETNPagedResponse<P>>;
|
|
1821
|
-
|
|
1819
|
+
updateAlertTriggerRule: (id: string, data: any, options?: AxiosRequestConfig) => Promise<AlertTriggerRule<string, string | Date, {
|
|
1822
1820
|
[key: string]: any;
|
|
1823
1821
|
}>>;
|
|
1824
|
-
|
|
1822
|
+
bulkUpdateAlertTriggerRules: (data: BulkUpdateAlertTriggerRulesRequest, options?: AxiosRequestConfig) => Promise<ETNBulkUpdateResult>;
|
|
1825
1823
|
getAsset: (id: string, options?: AxiosRequestConfig) => Promise<Asset<string>>;
|
|
1826
1824
|
listAssets: <P = Asset<string>>(options?: AxiosRequestConfig) => Promise<ETNPagedResponse<P>>;
|
|
1827
1825
|
updateAsset: (id: string, data: any, options?: AxiosRequestConfig) => Promise<Asset<string>>;
|
|
@@ -1980,7 +1978,7 @@ interface EmailTemplateOptions {
|
|
|
1980
1978
|
footer?: string;
|
|
1981
1979
|
includeTimestamp?: boolean;
|
|
1982
1980
|
}
|
|
1983
|
-
declare const _default$
|
|
1981
|
+
declare const _default$3: (options: EmailTemplateOptions) => string;
|
|
1984
1982
|
|
|
1985
1983
|
interface NotificationEmailOptions {
|
|
1986
1984
|
title: string;
|
|
@@ -1998,18 +1996,18 @@ interface NotificationEmailOptions {
|
|
|
1998
1996
|
}>;
|
|
1999
1997
|
}
|
|
2000
1998
|
declare function generateNotificationEmail(options: NotificationEmailOptions): string;
|
|
2001
|
-
declare const _default$
|
|
1999
|
+
declare const _default$2: {
|
|
2002
2000
|
generateNotificationEmail: typeof generateNotificationEmail;
|
|
2003
2001
|
};
|
|
2004
2002
|
|
|
2005
|
-
interface LoggerOptions {
|
|
2006
|
-
betterstack: boolean;
|
|
2007
|
-
betterStackHost: string;
|
|
2008
|
-
}
|
|
2009
2003
|
interface ExtendedLogger extends winston.Logger {
|
|
2010
2004
|
logtail?: Logtail;
|
|
2011
2005
|
}
|
|
2012
|
-
|
|
2006
|
+
interface LoggerOptions {
|
|
2007
|
+
feature?: string;
|
|
2008
|
+
}
|
|
2009
|
+
declare function logger(namespace: string, options?: LoggerOptions): ExtendedLogger;
|
|
2010
|
+
declare function loggerWithBetterStack(namespace: string, options?: LoggerOptions): Promise<ExtendedLogger>;
|
|
2013
2011
|
|
|
2014
2012
|
declare function connectToDatabase(retryAttempt?: number): Promise<Db>;
|
|
2015
2013
|
declare const _default$1: {
|
|
@@ -2020,10 +2018,6 @@ declare const _default: {
|
|
|
2020
2018
|
postMessage: (message: string) => Promise<axios.AxiosResponse<any, any>>;
|
|
2021
2019
|
};
|
|
2022
2020
|
|
|
2023
|
-
declare namespace notification {
|
|
2024
|
-
export { };
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
2021
|
interface SendNotificationMessageOptions {
|
|
2028
2022
|
queueUrl?: string;
|
|
2029
2023
|
sqsClient?: SQSClient;
|
|
@@ -2100,7 +2094,7 @@ declare const automationServices: {
|
|
|
2100
2094
|
}[];
|
|
2101
2095
|
|
|
2102
2096
|
declare function updateBatchJobStatus({ etnApi, automationRun, accountKey, status, errorMessage }: {
|
|
2103
|
-
etnApi: ReturnType<typeof _default$
|
|
2097
|
+
etnApi: ReturnType<typeof _default$4>;
|
|
2104
2098
|
automationRun: AutomationRun<string>;
|
|
2105
2099
|
accountKey?: string;
|
|
2106
2100
|
status: 'completed' | 'failed';
|
|
@@ -2118,7 +2112,7 @@ interface StepFunctionEvent {
|
|
|
2118
2112
|
}
|
|
2119
2113
|
declare class IngestHandler {
|
|
2120
2114
|
protected event: SQSEvent | SNSEvent | APIGatewayEvent | S3Event;
|
|
2121
|
-
protected log: ReturnType<typeof
|
|
2115
|
+
protected log: ReturnType<typeof logger>;
|
|
2122
2116
|
protected sqsReceiptHandle: string | undefined;
|
|
2123
2117
|
constructor(event: any);
|
|
2124
2118
|
isSQSEvent(event: any): event is SQSEvent;
|
|
@@ -2284,7 +2278,7 @@ type ETNModels = keyof typeof models;
|
|
|
2284
2278
|
declare abstract class Model {
|
|
2285
2279
|
openai: OpenAI;
|
|
2286
2280
|
protected models: Record<ETNModels, ETNModel>;
|
|
2287
|
-
protected log: ReturnType<typeof
|
|
2281
|
+
protected log: ReturnType<typeof logger>;
|
|
2288
2282
|
constructor();
|
|
2289
2283
|
}
|
|
2290
2284
|
|
|
@@ -2340,4 +2334,4 @@ declare namespace scrapers {
|
|
|
2340
2334
|
export type { scrapers_ETNAccount as ETNAccount };
|
|
2341
2335
|
}
|
|
2342
2336
|
|
|
2343
|
-
export { type AccessLevel, type Account, type AccountResult, type Action, type ActionType, type Asset, type Automation, type AutomationRun, type AutomationRunLog, type AutomationRunSummary, type AutomationService, type AutomationServiceCategory, type AutomationSource, type Company, type CompanyInvoiceValidationRule, type CompanyInvoiceValidationSettings, type Consumption, type CreateScraperRunParams, type
|
|
2337
|
+
export { type AccessLevel, type Account, type AccountResult, type Action, type ActionType, type AlertTriggerQueueMessage, type AlertTriggerRule, type Asset, type Automation, type AutomationRun, type AutomationRunLog, type AutomationRunSummary, type AutomationService, type AutomationServiceCategory, type AutomationSource, type Company, type CompanyInvoiceValidationRule, type CompanyInvoiceValidationSettings, type Consumption, type CreateScraperRunParams, type DataIngest, type DefaultField, type DeliveryStatus, type ETNEvent, type ETNPagedResponse$1 as ETNPagedResponse, type Email, type Entity, EventNamesByCategory, type FileFormat, type ImportTemplate, type Invoice, type InvoiceCapture, type InvoiceCaptureMetadata, type InvoiceCaptureMetadataResult, type InvoiceRate, type InvoiceRateType, type InvoiceValidation, type InvoiceValidationInvoice, type InvoiceValidationResults, type InvoiceValidationRule, type InvoiceValues, type Job, type JobStatus, type Log, type Notification, type NotificationAction, type NotificationCategory, NotificationCategoryList, type NotificationCategoryPreferences, type NotificationChannels, type NotificationContext, type NotificationContextEventName, type NotificationContextMap, NotificationDefaultChannels, type NotificationEventName, type NotificationPreferences, type NotificationSQSMessage, type NotificationTemplate, type NotificationTemplateConfig, type NotificationTemplateConfigOption, type NotificationTemplateConfigType, type NotificationTemplateDefaultChannel, type NotificationTemplateRoute, type NotificationTemplateSeverity, type NotificationTemplatesMap, type Portal, type PortalSupplierSchema, type Problem, type ProblemCodes, type ProblemDetails, type Reading, type Report, type ReportMetadata, type ReportSource, type ReportSourceIdItem, type ReportTemplate, type ReportType, type ScraperRun, type SendNotificationMessageInput, type Setting, type SourceType, type Supplier, type User, type UtilityType, type WasteCategories, type WasteTypes, _default$4 as api, consumption, _default$1 as db, _default$3 as emailTemplate, integrations, logger, loggerWithBetterStack, monitoring, _default$2 as notificationEmailTemplate, notificationQueue, index as openai, reporting, scrapers, _default as slack, units, index$1 as utils };
|