@etainabl/nodejs-sdk 1.3.130 → 1.3.132
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/{chunk-XSPB2DRU.js → chunk-6ZE6VFBF.js} +52 -1
- package/dist/esm/{chunk-XSPB2DRU.js.map → chunk-6ZE6VFBF.js.map} +1 -1
- package/dist/esm/{chunk-VSMDPKQT.js → chunk-AFIWRSL2.js} +2 -2
- package/dist/esm/{chunk-EAEPE6LV.js → chunk-GEJJRBZZ.js} +3 -3
- package/dist/esm/{chunk-DDCT4ZYV.js → chunk-JFJBZL6W.js} +2 -2
- package/dist/esm/{chunk-YUPOEH3S.js → chunk-UGK43V2L.js} +2 -2
- package/dist/esm/{dist-es-LEN5TBON.js → dist-es-AV5FKRC6.js} +2 -2
- package/dist/esm/{dist-es-MTQJIBCO.js → dist-es-HQRLUYWI.js} +2 -2
- package/dist/esm/{dist-es-4PZVI2OP.js → dist-es-N5B4V37N.js} +5 -5
- package/dist/esm/{dist-es-43LBWNIP.js → dist-es-T2FMHNMU.js} +4 -4
- package/dist/esm/index.js +689 -212
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{loadSso-TNKRSJIY.js → loadSso-KRYOAJJX.js} +5 -5
- package/dist/esm/{sso-oidc-LXV5UW7C.js → sso-oidc-RASI2Q3K.js} +5 -5
- package/dist/esm/{sts-7CU5WIQI.js → sts-IERANB7E.js} +4 -4
- package/dist/index.d.cts +55 -16
- package/dist/index.d.ts +55 -16
- package/dist/index.js +755 -229
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- /package/dist/esm/{chunk-VSMDPKQT.js.map → chunk-AFIWRSL2.js.map} +0 -0
- /package/dist/esm/{chunk-EAEPE6LV.js.map → chunk-GEJJRBZZ.js.map} +0 -0
- /package/dist/esm/{chunk-DDCT4ZYV.js.map → chunk-JFJBZL6W.js.map} +0 -0
- /package/dist/esm/{chunk-YUPOEH3S.js.map → chunk-UGK43V2L.js.map} +0 -0
- /package/dist/esm/{dist-es-LEN5TBON.js.map → dist-es-AV5FKRC6.js.map} +0 -0
- /package/dist/esm/{dist-es-MTQJIBCO.js.map → dist-es-HQRLUYWI.js.map} +0 -0
- /package/dist/esm/{dist-es-4PZVI2OP.js.map → dist-es-N5B4V37N.js.map} +0 -0
- /package/dist/esm/{dist-es-43LBWNIP.js.map → dist-es-T2FMHNMU.js.map} +0 -0
- /package/dist/esm/{loadSso-TNKRSJIY.js.map → loadSso-KRYOAJJX.js.map} +0 -0
- /package/dist/esm/{sso-oidc-LXV5UW7C.js.map → sso-oidc-RASI2Q3K.js.map} +0 -0
- /package/dist/esm/{sts-7CU5WIQI.js.map → sts-IERANB7E.js.map} +0 -0
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
loadRestJsonErrorCode,
|
|
3
3
|
parseJsonBody,
|
|
4
4
|
parseJsonErrorBody
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AFIWRSL2.js";
|
|
6
6
|
import {
|
|
7
7
|
requestBuilder
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UGK43V2L.js";
|
|
9
9
|
import {
|
|
10
10
|
NoAuthSigner
|
|
11
11
|
} from "./chunk-UQAJZJ7E.js";
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
resolveRegionConfig,
|
|
51
51
|
resolveRetryConfig,
|
|
52
52
|
resolveUserAgentConfig
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-JFJBZL6W.js";
|
|
54
54
|
import {
|
|
55
55
|
loadConfig,
|
|
56
56
|
parseUrl
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
toBase64,
|
|
83
83
|
toUtf8,
|
|
84
84
|
withBaseException
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-6ZE6VFBF.js";
|
|
86
86
|
import "./chunk-HAEAETXR.js";
|
|
87
87
|
import "./chunk-UZGMBQZB.js";
|
|
88
88
|
import "./chunk-3YGWW265.js";
|
|
@@ -656,4 +656,4 @@ export {
|
|
|
656
656
|
GetRoleCredentialsCommand,
|
|
657
657
|
SSOClient
|
|
658
658
|
};
|
|
659
|
-
//# sourceMappingURL=loadSso-
|
|
659
|
+
//# sourceMappingURL=loadSso-KRYOAJJX.js.map
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
loadRestJsonErrorCode,
|
|
3
3
|
parseJsonBody,
|
|
4
4
|
parseJsonErrorBody
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AFIWRSL2.js";
|
|
6
6
|
import {
|
|
7
7
|
requestBuilder
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UGK43V2L.js";
|
|
9
9
|
import {
|
|
10
10
|
package_default
|
|
11
11
|
} from "./chunk-V42NON4H.js";
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
resolveRegionConfig,
|
|
54
54
|
resolveRetryConfig,
|
|
55
55
|
resolveUserAgentConfig
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-JFJBZL6W.js";
|
|
57
57
|
import {
|
|
58
58
|
loadConfig,
|
|
59
59
|
parseUrl
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
toBase64,
|
|
87
87
|
toUtf8,
|
|
88
88
|
withBaseException
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-6ZE6VFBF.js";
|
|
90
90
|
import "./chunk-HAEAETXR.js";
|
|
91
91
|
import "./chunk-UZGMBQZB.js";
|
|
92
92
|
import "./chunk-3YGWW265.js";
|
|
@@ -828,4 +828,4 @@ export {
|
|
|
828
828
|
UnsupportedGrantTypeException,
|
|
829
829
|
Client as __Client
|
|
830
830
|
};
|
|
831
|
-
//# sourceMappingURL=sso-oidc-
|
|
831
|
+
//# sourceMappingURL=sso-oidc-RASI2Q3K.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseXmlBody,
|
|
3
3
|
parseXmlErrorBody
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GEJJRBZZ.js";
|
|
5
5
|
import {
|
|
6
6
|
package_default
|
|
7
7
|
} from "./chunk-V42NON4H.js";
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
resolveRegionConfig,
|
|
50
50
|
resolveRetryConfig,
|
|
51
51
|
resolveUserAgentConfig
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-JFJBZL6W.js";
|
|
53
53
|
import {
|
|
54
54
|
loadConfig,
|
|
55
55
|
parseUrl
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
toBase64,
|
|
82
82
|
toUtf8,
|
|
83
83
|
withBaseException
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-6ZE6VFBF.js";
|
|
85
85
|
import "./chunk-HAEAETXR.js";
|
|
86
86
|
import {
|
|
87
87
|
setCredentialFeature
|
|
@@ -1161,4 +1161,4 @@ export {
|
|
|
1161
1161
|
getDefaultRoleAssumer2 as getDefaultRoleAssumer,
|
|
1162
1162
|
getDefaultRoleAssumerWithWebIdentity2 as getDefaultRoleAssumerWithWebIdentity
|
|
1163
1163
|
};
|
|
1164
|
-
//# sourceMappingURL=sts-
|
|
1164
|
+
//# sourceMappingURL=sts-IERANB7E.js.map
|
package/dist/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { ObjectId, Db } from 'mongodb';
|
|
|
4
4
|
export { ObjectId } from 'mongodb';
|
|
5
5
|
import * as _aws_sdk_client_ses from '@aws-sdk/client-ses';
|
|
6
6
|
import { S3Client } from '@aws-sdk/client-s3';
|
|
7
|
-
import { Context } from 'aws-lambda';
|
|
7
|
+
import { Context, SQSEvent, SNSEvent, APIGatewayEvent, S3Event } from 'aws-lambda';
|
|
8
8
|
import { SQSClient } from '@aws-sdk/client-sqs';
|
|
9
9
|
import winston from 'winston';
|
|
10
10
|
import moment from 'moment';
|
|
@@ -624,6 +624,7 @@ interface HandleErrorParams {
|
|
|
624
624
|
lambdaSource: string;
|
|
625
625
|
error: Error;
|
|
626
626
|
accountId?: string;
|
|
627
|
+
messageId: string;
|
|
627
628
|
automation: Automation<string>;
|
|
628
629
|
}
|
|
629
630
|
declare const collectionTypes: readonly ["readings", "consumptions", "invoices"];
|
|
@@ -640,7 +641,7 @@ interface UploadCsv {
|
|
|
640
641
|
declare function sendEmail(lambdaSource: string, context: Context, error: Error, destinations: string[]): Promise<_aws_sdk_client_ses.SendEmailCommandOutput>;
|
|
641
642
|
declare function createCsv(data: (FormattedConsumption | FormattedReading | FormattedInvoice)[]): string;
|
|
642
643
|
declare function uploadCsv({ csvContent, automationRun, s3Client, orgFilename, collectionType }: UploadCsv): Promise<string>;
|
|
643
|
-
declare function handleError({ etnApi, automationRun, error, lambdaSource, accountId, automation }: HandleErrorParams): Promise<void>;
|
|
644
|
+
declare function handleError({ etnApi, automationRun, error, lambdaSource, accountId, automation, messageId }: HandleErrorParams): Promise<void>;
|
|
644
645
|
declare function deleteMessage(queueUrl: string, receiptHandle: string, sqsClient?: SQSClient): Promise<void>;
|
|
645
646
|
|
|
646
647
|
type integrations_CollectionType = CollectionType;
|
|
@@ -662,12 +663,12 @@ declare namespace integrations {
|
|
|
662
663
|
interface AutomationRunLog<DateType = Date | string> {
|
|
663
664
|
date: DateType;
|
|
664
665
|
message: string;
|
|
665
|
-
status: 'error' | 'running' | 'success';
|
|
666
|
+
status: 'error' | 'running' | 'success' | 'warning';
|
|
666
667
|
errorMessage?: string;
|
|
667
|
-
lambdaSource
|
|
668
|
+
lambdaSource: string;
|
|
668
669
|
lambdaRequestId?: string;
|
|
669
670
|
lambdaLogStreamName?: string;
|
|
670
|
-
lambdaMessageId
|
|
671
|
+
lambdaMessageId: string;
|
|
671
672
|
}
|
|
672
673
|
interface AccountResult<IDType = ObjectId | string, DateType = Date | string> {
|
|
673
674
|
accountId: IDType;
|
|
@@ -723,7 +724,6 @@ interface SourceMetadata {
|
|
|
723
724
|
}
|
|
724
725
|
interface AutomationRunSummary {
|
|
725
726
|
totalRows?: number;
|
|
726
|
-
processedRows?: number;
|
|
727
727
|
failedRows?: number;
|
|
728
728
|
accountsNotFound?: number;
|
|
729
729
|
accountsFound?: number;
|
|
@@ -736,7 +736,7 @@ interface AutomationRun<IDType = ObjectId | string, DateType = Date | string> {
|
|
|
736
736
|
companyId: IDType;
|
|
737
737
|
active: boolean;
|
|
738
738
|
category: 'dataFetcher' | 'dataExtractor';
|
|
739
|
-
status: 'running' | 'success' | 'failed' | '
|
|
739
|
+
status: 'running' | 'success' | 'failed' | 'warning';
|
|
740
740
|
collectionType?: CollectionType;
|
|
741
741
|
source?: SourceMetadata;
|
|
742
742
|
summary?: AutomationRunSummary;
|
|
@@ -747,6 +747,8 @@ interface AutomationRun<IDType = ObjectId | string, DateType = Date | string> {
|
|
|
747
747
|
s3Bucket: string;
|
|
748
748
|
s3Key: string;
|
|
749
749
|
fileName: string;
|
|
750
|
+
totalRecords: number;
|
|
751
|
+
fileSize: number;
|
|
750
752
|
};
|
|
751
753
|
chunkProcessing?: {
|
|
752
754
|
totalChunks: number;
|
|
@@ -1024,6 +1026,9 @@ interface InvoiceValues<DateType = Date | string> {
|
|
|
1024
1026
|
totalDaily?: number;
|
|
1025
1027
|
totalLevy?: number;
|
|
1026
1028
|
totalKva?: number;
|
|
1029
|
+
totalCCL?: number;
|
|
1030
|
+
totalFeedInTariff?: number;
|
|
1031
|
+
totalLatePayment?: number;
|
|
1027
1032
|
totalUnits?: number;
|
|
1028
1033
|
totalWaterVolume?: number;
|
|
1029
1034
|
totalWasteVolume?: number;
|
|
@@ -1035,6 +1040,8 @@ interface InvoiceValues<DateType = Date | string> {
|
|
|
1035
1040
|
correctionFactor?: string;
|
|
1036
1041
|
calorificValue?: string;
|
|
1037
1042
|
readFactor?: string;
|
|
1043
|
+
capacity?: number;
|
|
1044
|
+
sewerageReturnPercentage?: number;
|
|
1038
1045
|
type?: string;
|
|
1039
1046
|
startRead?: string;
|
|
1040
1047
|
endRead?: string;
|
|
@@ -1059,7 +1066,7 @@ interface InvoiceRate {
|
|
|
1059
1066
|
}
|
|
1060
1067
|
type InvoiceStatus = 'processing' | 'pending' | 'uploading' | 'queued' | 'captured' | 'error' | 'completed';
|
|
1061
1068
|
type FinancialStatus = 'approved' | 'new' | 'not-approved' | 'paid' | 'sent-for-payment';
|
|
1062
|
-
type InvoiceRateType = 'unitRate' | 'daily' | 'levy' | 'tax' | 'kva' | 'waterRate' | 'wasteRate' | 'discount';
|
|
1069
|
+
type InvoiceRateType = 'unitRate' | 'daily' | 'levy' | 'tax' | 'kva' | 'waterRate' | 'wasteRate' | 'discount' | 'misc' | 'feedInTariff' | 'latePaymentCharge';
|
|
1063
1070
|
interface Invoice<IDType = ObjectId | string, DateType = Date> {
|
|
1064
1071
|
_id: IDType;
|
|
1065
1072
|
jobId?: string | null;
|
|
@@ -1168,13 +1175,14 @@ interface InvoiceCapture<IDType = ObjectId | string> {
|
|
|
1168
1175
|
extractExpiry?: Date;
|
|
1169
1176
|
version: number;
|
|
1170
1177
|
status: 'pending' | 'uploading' | 'uploaded' | 'extracting' | 'extracted' | 'capturing' | 'captured' | 'failed';
|
|
1171
|
-
extractType
|
|
1172
|
-
metrics
|
|
1173
|
-
captureStartTime
|
|
1174
|
-
captureEndTime
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
+
extractType: 'parser-edi' | 'textract' | 'llmwhisperer' | null;
|
|
1179
|
+
metrics: {
|
|
1180
|
+
captureStartTime: Date | null;
|
|
1181
|
+
captureEndTime: Date | null;
|
|
1182
|
+
captureDmg: number;
|
|
1183
|
+
extractStartTime: Date | null;
|
|
1184
|
+
extractEndTime: Date | null;
|
|
1185
|
+
extractDmg: number;
|
|
1178
1186
|
};
|
|
1179
1187
|
results?: any;
|
|
1180
1188
|
metadata?: InvoiceCaptureMetadata;
|
|
@@ -1595,13 +1603,44 @@ declare const automationServices: {
|
|
|
1595
1603
|
category: AutomationServiceCategory;
|
|
1596
1604
|
}[];
|
|
1597
1605
|
|
|
1606
|
+
interface StepFunctionEvent {
|
|
1607
|
+
params: any;
|
|
1608
|
+
input: {
|
|
1609
|
+
companyId: string;
|
|
1610
|
+
userSub: string;
|
|
1611
|
+
[key: string]: any;
|
|
1612
|
+
};
|
|
1613
|
+
name: string;
|
|
1614
|
+
}
|
|
1615
|
+
declare class IngestHandler {
|
|
1616
|
+
protected event: SQSEvent | SNSEvent | APIGatewayEvent | S3Event;
|
|
1617
|
+
protected log: ReturnType<typeof _default$2>;
|
|
1618
|
+
protected sqsReceiptHandle: string | undefined;
|
|
1619
|
+
constructor(event: any);
|
|
1620
|
+
isSQSEvent(event: any): event is SQSEvent;
|
|
1621
|
+
isSNSEvent(event: any): event is SNSEvent;
|
|
1622
|
+
isAPIGatewayEvent(event: any): event is APIGatewayEvent;
|
|
1623
|
+
isS3Event(event: any): event is S3Event;
|
|
1624
|
+
isStepFunction(event: any): event is StepFunctionEvent;
|
|
1625
|
+
handleEvent(): Promise<ETNEvent>;
|
|
1626
|
+
handleSQSEvent(eventType?: ETNEvent['eventType']): Promise<ETNEvent>;
|
|
1627
|
+
handleSNSEvent(eventType?: ETNEvent['eventType']): Promise<ETNEvent>;
|
|
1628
|
+
handleAPIGatewayEvent(): ETNEvent;
|
|
1629
|
+
handleS3Event(eventType?: ETNEvent['eventType']): Promise<ETNEvent>;
|
|
1630
|
+
handleStepFunctionEvent(eventType?: ETNEvent['eventType']): Promise<ETNEvent>;
|
|
1631
|
+
getS3ObjectMetadata(bucket: string, key: string): Promise<Record<string, string>>;
|
|
1632
|
+
deleteMessage(queueUrl?: string | undefined): Promise<void>;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
type index$1_IngestHandler = IngestHandler;
|
|
1636
|
+
declare const index$1_IngestHandler: typeof IngestHandler;
|
|
1598
1637
|
declare const index$1_automationServices: typeof automationServices;
|
|
1599
1638
|
declare const index$1_automationSources: typeof automationSources;
|
|
1600
1639
|
declare const index$1_getMeterPointNumberBottomLine: typeof getMeterPointNumberBottomLine;
|
|
1601
1640
|
declare const index$1_utilityTypes: typeof utilityTypes;
|
|
1602
1641
|
declare const index$1_wasteCategories: typeof wasteCategories;
|
|
1603
1642
|
declare namespace index$1 {
|
|
1604
|
-
export { 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 };
|
|
1643
|
+
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 };
|
|
1605
1644
|
}
|
|
1606
1645
|
|
|
1607
1646
|
interface ETNModel {
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ObjectId, Db } from 'mongodb';
|
|
|
4
4
|
export { ObjectId } from 'mongodb';
|
|
5
5
|
import * as _aws_sdk_client_ses from '@aws-sdk/client-ses';
|
|
6
6
|
import { S3Client } from '@aws-sdk/client-s3';
|
|
7
|
-
import { Context } from 'aws-lambda';
|
|
7
|
+
import { Context, SQSEvent, SNSEvent, APIGatewayEvent, S3Event } from 'aws-lambda';
|
|
8
8
|
import { SQSClient } from '@aws-sdk/client-sqs';
|
|
9
9
|
import winston from 'winston';
|
|
10
10
|
import moment from 'moment';
|
|
@@ -624,6 +624,7 @@ interface HandleErrorParams {
|
|
|
624
624
|
lambdaSource: string;
|
|
625
625
|
error: Error;
|
|
626
626
|
accountId?: string;
|
|
627
|
+
messageId: string;
|
|
627
628
|
automation: Automation<string>;
|
|
628
629
|
}
|
|
629
630
|
declare const collectionTypes: readonly ["readings", "consumptions", "invoices"];
|
|
@@ -640,7 +641,7 @@ interface UploadCsv {
|
|
|
640
641
|
declare function sendEmail(lambdaSource: string, context: Context, error: Error, destinations: string[]): Promise<_aws_sdk_client_ses.SendEmailCommandOutput>;
|
|
641
642
|
declare function createCsv(data: (FormattedConsumption | FormattedReading | FormattedInvoice)[]): string;
|
|
642
643
|
declare function uploadCsv({ csvContent, automationRun, s3Client, orgFilename, collectionType }: UploadCsv): Promise<string>;
|
|
643
|
-
declare function handleError({ etnApi, automationRun, error, lambdaSource, accountId, automation }: HandleErrorParams): Promise<void>;
|
|
644
|
+
declare function handleError({ etnApi, automationRun, error, lambdaSource, accountId, automation, messageId }: HandleErrorParams): Promise<void>;
|
|
644
645
|
declare function deleteMessage(queueUrl: string, receiptHandle: string, sqsClient?: SQSClient): Promise<void>;
|
|
645
646
|
|
|
646
647
|
type integrations_CollectionType = CollectionType;
|
|
@@ -662,12 +663,12 @@ declare namespace integrations {
|
|
|
662
663
|
interface AutomationRunLog<DateType = Date | string> {
|
|
663
664
|
date: DateType;
|
|
664
665
|
message: string;
|
|
665
|
-
status: 'error' | 'running' | 'success';
|
|
666
|
+
status: 'error' | 'running' | 'success' | 'warning';
|
|
666
667
|
errorMessage?: string;
|
|
667
|
-
lambdaSource
|
|
668
|
+
lambdaSource: string;
|
|
668
669
|
lambdaRequestId?: string;
|
|
669
670
|
lambdaLogStreamName?: string;
|
|
670
|
-
lambdaMessageId
|
|
671
|
+
lambdaMessageId: string;
|
|
671
672
|
}
|
|
672
673
|
interface AccountResult<IDType = ObjectId | string, DateType = Date | string> {
|
|
673
674
|
accountId: IDType;
|
|
@@ -723,7 +724,6 @@ interface SourceMetadata {
|
|
|
723
724
|
}
|
|
724
725
|
interface AutomationRunSummary {
|
|
725
726
|
totalRows?: number;
|
|
726
|
-
processedRows?: number;
|
|
727
727
|
failedRows?: number;
|
|
728
728
|
accountsNotFound?: number;
|
|
729
729
|
accountsFound?: number;
|
|
@@ -736,7 +736,7 @@ interface AutomationRun<IDType = ObjectId | string, DateType = Date | string> {
|
|
|
736
736
|
companyId: IDType;
|
|
737
737
|
active: boolean;
|
|
738
738
|
category: 'dataFetcher' | 'dataExtractor';
|
|
739
|
-
status: 'running' | 'success' | 'failed' | '
|
|
739
|
+
status: 'running' | 'success' | 'failed' | 'warning';
|
|
740
740
|
collectionType?: CollectionType;
|
|
741
741
|
source?: SourceMetadata;
|
|
742
742
|
summary?: AutomationRunSummary;
|
|
@@ -747,6 +747,8 @@ interface AutomationRun<IDType = ObjectId | string, DateType = Date | string> {
|
|
|
747
747
|
s3Bucket: string;
|
|
748
748
|
s3Key: string;
|
|
749
749
|
fileName: string;
|
|
750
|
+
totalRecords: number;
|
|
751
|
+
fileSize: number;
|
|
750
752
|
};
|
|
751
753
|
chunkProcessing?: {
|
|
752
754
|
totalChunks: number;
|
|
@@ -1024,6 +1026,9 @@ interface InvoiceValues<DateType = Date | string> {
|
|
|
1024
1026
|
totalDaily?: number;
|
|
1025
1027
|
totalLevy?: number;
|
|
1026
1028
|
totalKva?: number;
|
|
1029
|
+
totalCCL?: number;
|
|
1030
|
+
totalFeedInTariff?: number;
|
|
1031
|
+
totalLatePayment?: number;
|
|
1027
1032
|
totalUnits?: number;
|
|
1028
1033
|
totalWaterVolume?: number;
|
|
1029
1034
|
totalWasteVolume?: number;
|
|
@@ -1035,6 +1040,8 @@ interface InvoiceValues<DateType = Date | string> {
|
|
|
1035
1040
|
correctionFactor?: string;
|
|
1036
1041
|
calorificValue?: string;
|
|
1037
1042
|
readFactor?: string;
|
|
1043
|
+
capacity?: number;
|
|
1044
|
+
sewerageReturnPercentage?: number;
|
|
1038
1045
|
type?: string;
|
|
1039
1046
|
startRead?: string;
|
|
1040
1047
|
endRead?: string;
|
|
@@ -1059,7 +1066,7 @@ interface InvoiceRate {
|
|
|
1059
1066
|
}
|
|
1060
1067
|
type InvoiceStatus = 'processing' | 'pending' | 'uploading' | 'queued' | 'captured' | 'error' | 'completed';
|
|
1061
1068
|
type FinancialStatus = 'approved' | 'new' | 'not-approved' | 'paid' | 'sent-for-payment';
|
|
1062
|
-
type InvoiceRateType = 'unitRate' | 'daily' | 'levy' | 'tax' | 'kva' | 'waterRate' | 'wasteRate' | 'discount';
|
|
1069
|
+
type InvoiceRateType = 'unitRate' | 'daily' | 'levy' | 'tax' | 'kva' | 'waterRate' | 'wasteRate' | 'discount' | 'misc' | 'feedInTariff' | 'latePaymentCharge';
|
|
1063
1070
|
interface Invoice<IDType = ObjectId | string, DateType = Date> {
|
|
1064
1071
|
_id: IDType;
|
|
1065
1072
|
jobId?: string | null;
|
|
@@ -1168,13 +1175,14 @@ interface InvoiceCapture<IDType = ObjectId | string> {
|
|
|
1168
1175
|
extractExpiry?: Date;
|
|
1169
1176
|
version: number;
|
|
1170
1177
|
status: 'pending' | 'uploading' | 'uploaded' | 'extracting' | 'extracted' | 'capturing' | 'captured' | 'failed';
|
|
1171
|
-
extractType
|
|
1172
|
-
metrics
|
|
1173
|
-
captureStartTime
|
|
1174
|
-
captureEndTime
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
+
extractType: 'parser-edi' | 'textract' | 'llmwhisperer' | null;
|
|
1179
|
+
metrics: {
|
|
1180
|
+
captureStartTime: Date | null;
|
|
1181
|
+
captureEndTime: Date | null;
|
|
1182
|
+
captureDmg: number;
|
|
1183
|
+
extractStartTime: Date | null;
|
|
1184
|
+
extractEndTime: Date | null;
|
|
1185
|
+
extractDmg: number;
|
|
1178
1186
|
};
|
|
1179
1187
|
results?: any;
|
|
1180
1188
|
metadata?: InvoiceCaptureMetadata;
|
|
@@ -1595,13 +1603,44 @@ declare const automationServices: {
|
|
|
1595
1603
|
category: AutomationServiceCategory;
|
|
1596
1604
|
}[];
|
|
1597
1605
|
|
|
1606
|
+
interface StepFunctionEvent {
|
|
1607
|
+
params: any;
|
|
1608
|
+
input: {
|
|
1609
|
+
companyId: string;
|
|
1610
|
+
userSub: string;
|
|
1611
|
+
[key: string]: any;
|
|
1612
|
+
};
|
|
1613
|
+
name: string;
|
|
1614
|
+
}
|
|
1615
|
+
declare class IngestHandler {
|
|
1616
|
+
protected event: SQSEvent | SNSEvent | APIGatewayEvent | S3Event;
|
|
1617
|
+
protected log: ReturnType<typeof _default$2>;
|
|
1618
|
+
protected sqsReceiptHandle: string | undefined;
|
|
1619
|
+
constructor(event: any);
|
|
1620
|
+
isSQSEvent(event: any): event is SQSEvent;
|
|
1621
|
+
isSNSEvent(event: any): event is SNSEvent;
|
|
1622
|
+
isAPIGatewayEvent(event: any): event is APIGatewayEvent;
|
|
1623
|
+
isS3Event(event: any): event is S3Event;
|
|
1624
|
+
isStepFunction(event: any): event is StepFunctionEvent;
|
|
1625
|
+
handleEvent(): Promise<ETNEvent>;
|
|
1626
|
+
handleSQSEvent(eventType?: ETNEvent['eventType']): Promise<ETNEvent>;
|
|
1627
|
+
handleSNSEvent(eventType?: ETNEvent['eventType']): Promise<ETNEvent>;
|
|
1628
|
+
handleAPIGatewayEvent(): ETNEvent;
|
|
1629
|
+
handleS3Event(eventType?: ETNEvent['eventType']): Promise<ETNEvent>;
|
|
1630
|
+
handleStepFunctionEvent(eventType?: ETNEvent['eventType']): Promise<ETNEvent>;
|
|
1631
|
+
getS3ObjectMetadata(bucket: string, key: string): Promise<Record<string, string>>;
|
|
1632
|
+
deleteMessage(queueUrl?: string | undefined): Promise<void>;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
type index$1_IngestHandler = IngestHandler;
|
|
1636
|
+
declare const index$1_IngestHandler: typeof IngestHandler;
|
|
1598
1637
|
declare const index$1_automationServices: typeof automationServices;
|
|
1599
1638
|
declare const index$1_automationSources: typeof automationSources;
|
|
1600
1639
|
declare const index$1_getMeterPointNumberBottomLine: typeof getMeterPointNumberBottomLine;
|
|
1601
1640
|
declare const index$1_utilityTypes: typeof utilityTypes;
|
|
1602
1641
|
declare const index$1_wasteCategories: typeof wasteCategories;
|
|
1603
1642
|
declare namespace index$1 {
|
|
1604
|
-
export { 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 };
|
|
1643
|
+
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 };
|
|
1605
1644
|
}
|
|
1606
1645
|
|
|
1607
1646
|
interface ETNModel {
|