@etainabl/nodejs-sdk 1.3.128 → 1.3.130
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 +9 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.cts +25 -4
- package/dist/index.d.ts +25 -4
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -10,6 +10,8 @@ import winston from 'winston';
|
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
import { ZodObject } from 'zod';
|
|
12
12
|
import OpenAI from 'openai';
|
|
13
|
+
import { ResponseTextConfig } from 'openai/resources/responses/responses';
|
|
14
|
+
import { Reasoning } from 'openai/resources.mjs';
|
|
13
15
|
|
|
14
16
|
declare const wasteCategories: readonly [{
|
|
15
17
|
readonly name: "General Waste";
|
|
@@ -454,7 +456,6 @@ interface Address {
|
|
|
454
456
|
postCode: string;
|
|
455
457
|
province?: string;
|
|
456
458
|
countryCode?: string;
|
|
457
|
-
jurisdictionCode?: string;
|
|
458
459
|
latitude?: string;
|
|
459
460
|
longitude?: string;
|
|
460
461
|
}
|
|
@@ -795,8 +796,8 @@ interface InvoiceValidationInvoice {
|
|
|
795
796
|
supplyAddress: string;
|
|
796
797
|
utilityType: string;
|
|
797
798
|
meterId: string;
|
|
798
|
-
accountId?: string;
|
|
799
|
-
supplierId?: string;
|
|
799
|
+
accountId?: string | null;
|
|
800
|
+
supplierId?: string | null;
|
|
800
801
|
}
|
|
801
802
|
interface InvoiceValidationRule<IDType = ObjectId | string> {
|
|
802
803
|
_id: IDType;
|
|
@@ -1090,6 +1091,21 @@ interface Invoice<IDType = ObjectId | string, DateType = Date> {
|
|
|
1090
1091
|
assignedTo?: string;
|
|
1091
1092
|
noScrape?: boolean;
|
|
1092
1093
|
scraperInvoiceId?: string;
|
|
1094
|
+
captureComments: {
|
|
1095
|
+
recipient: string;
|
|
1096
|
+
supplier: string;
|
|
1097
|
+
invoiceCosts: string;
|
|
1098
|
+
utilityTypes: string;
|
|
1099
|
+
invoiceDueDate: string;
|
|
1100
|
+
meter: string;
|
|
1101
|
+
meterPointNumber: string;
|
|
1102
|
+
utilityType: string;
|
|
1103
|
+
costs: string;
|
|
1104
|
+
consumption: string;
|
|
1105
|
+
rates: string;
|
|
1106
|
+
readings: string;
|
|
1107
|
+
contractDates: string;
|
|
1108
|
+
};
|
|
1093
1109
|
confirmedAt?: DateType | null;
|
|
1094
1110
|
confirmedBy?: string | null;
|
|
1095
1111
|
supplierId: IDType;
|
|
@@ -1121,12 +1137,13 @@ interface InvoiceCaptureMetadataResult {
|
|
|
1121
1137
|
}
|
|
1122
1138
|
interface InvoiceCaptureMetadata {
|
|
1123
1139
|
totalDmg: Number;
|
|
1124
|
-
totalDuration: Number;
|
|
1125
1140
|
pdfPageCount: number;
|
|
1126
1141
|
extractPageCount: number;
|
|
1142
|
+
extracted: boolean;
|
|
1127
1143
|
split: boolean;
|
|
1128
1144
|
splitQuantity: number;
|
|
1129
1145
|
invoices: {
|
|
1146
|
+
uuid: string;
|
|
1130
1147
|
startPage: number;
|
|
1131
1148
|
endPage: number;
|
|
1132
1149
|
index: number;
|
|
@@ -1318,6 +1335,7 @@ interface InvoiceOptionsSchema {
|
|
|
1318
1335
|
interface Supplier<IDType = ObjectId | string> {
|
|
1319
1336
|
_id: IDType;
|
|
1320
1337
|
name: string;
|
|
1338
|
+
aliases?: string[];
|
|
1321
1339
|
logoUrl?: string;
|
|
1322
1340
|
websiteUrl?: string;
|
|
1323
1341
|
portalUrl?: string;
|
|
@@ -1673,6 +1691,9 @@ interface PromptOptions {
|
|
|
1673
1691
|
model: ETNModels;
|
|
1674
1692
|
instructions: string;
|
|
1675
1693
|
temperature?: number;
|
|
1694
|
+
cacheKey?: string;
|
|
1695
|
+
reasoning?: Reasoning;
|
|
1696
|
+
verbosity?: ResponseTextConfig['verbosity'];
|
|
1676
1697
|
}
|
|
1677
1698
|
interface PromptInput {
|
|
1678
1699
|
type: 'text' | 'file';
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ import winston from 'winston';
|
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
import { ZodObject } from 'zod';
|
|
12
12
|
import OpenAI from 'openai';
|
|
13
|
+
import { ResponseTextConfig } from 'openai/resources/responses/responses';
|
|
14
|
+
import { Reasoning } from 'openai/resources.mjs';
|
|
13
15
|
|
|
14
16
|
declare const wasteCategories: readonly [{
|
|
15
17
|
readonly name: "General Waste";
|
|
@@ -454,7 +456,6 @@ interface Address {
|
|
|
454
456
|
postCode: string;
|
|
455
457
|
province?: string;
|
|
456
458
|
countryCode?: string;
|
|
457
|
-
jurisdictionCode?: string;
|
|
458
459
|
latitude?: string;
|
|
459
460
|
longitude?: string;
|
|
460
461
|
}
|
|
@@ -795,8 +796,8 @@ interface InvoiceValidationInvoice {
|
|
|
795
796
|
supplyAddress: string;
|
|
796
797
|
utilityType: string;
|
|
797
798
|
meterId: string;
|
|
798
|
-
accountId?: string;
|
|
799
|
-
supplierId?: string;
|
|
799
|
+
accountId?: string | null;
|
|
800
|
+
supplierId?: string | null;
|
|
800
801
|
}
|
|
801
802
|
interface InvoiceValidationRule<IDType = ObjectId | string> {
|
|
802
803
|
_id: IDType;
|
|
@@ -1090,6 +1091,21 @@ interface Invoice<IDType = ObjectId | string, DateType = Date> {
|
|
|
1090
1091
|
assignedTo?: string;
|
|
1091
1092
|
noScrape?: boolean;
|
|
1092
1093
|
scraperInvoiceId?: string;
|
|
1094
|
+
captureComments: {
|
|
1095
|
+
recipient: string;
|
|
1096
|
+
supplier: string;
|
|
1097
|
+
invoiceCosts: string;
|
|
1098
|
+
utilityTypes: string;
|
|
1099
|
+
invoiceDueDate: string;
|
|
1100
|
+
meter: string;
|
|
1101
|
+
meterPointNumber: string;
|
|
1102
|
+
utilityType: string;
|
|
1103
|
+
costs: string;
|
|
1104
|
+
consumption: string;
|
|
1105
|
+
rates: string;
|
|
1106
|
+
readings: string;
|
|
1107
|
+
contractDates: string;
|
|
1108
|
+
};
|
|
1093
1109
|
confirmedAt?: DateType | null;
|
|
1094
1110
|
confirmedBy?: string | null;
|
|
1095
1111
|
supplierId: IDType;
|
|
@@ -1121,12 +1137,13 @@ interface InvoiceCaptureMetadataResult {
|
|
|
1121
1137
|
}
|
|
1122
1138
|
interface InvoiceCaptureMetadata {
|
|
1123
1139
|
totalDmg: Number;
|
|
1124
|
-
totalDuration: Number;
|
|
1125
1140
|
pdfPageCount: number;
|
|
1126
1141
|
extractPageCount: number;
|
|
1142
|
+
extracted: boolean;
|
|
1127
1143
|
split: boolean;
|
|
1128
1144
|
splitQuantity: number;
|
|
1129
1145
|
invoices: {
|
|
1146
|
+
uuid: string;
|
|
1130
1147
|
startPage: number;
|
|
1131
1148
|
endPage: number;
|
|
1132
1149
|
index: number;
|
|
@@ -1318,6 +1335,7 @@ interface InvoiceOptionsSchema {
|
|
|
1318
1335
|
interface Supplier<IDType = ObjectId | string> {
|
|
1319
1336
|
_id: IDType;
|
|
1320
1337
|
name: string;
|
|
1338
|
+
aliases?: string[];
|
|
1321
1339
|
logoUrl?: string;
|
|
1322
1340
|
websiteUrl?: string;
|
|
1323
1341
|
portalUrl?: string;
|
|
@@ -1673,6 +1691,9 @@ interface PromptOptions {
|
|
|
1673
1691
|
model: ETNModels;
|
|
1674
1692
|
instructions: string;
|
|
1675
1693
|
temperature?: number;
|
|
1694
|
+
cacheKey?: string;
|
|
1695
|
+
reasoning?: Reasoning;
|
|
1696
|
+
verbosity?: ResponseTextConfig['verbosity'];
|
|
1676
1697
|
}
|
|
1677
1698
|
interface PromptInput {
|
|
1678
1699
|
type: 'text' | 'file';
|
package/dist/index.js
CHANGED
|
@@ -17471,6 +17471,15 @@ ${additionalInstructions.join("\n\n")}`,
|
|
|
17471
17471
|
if (this.options.temperature !== void 0 && !model.id.startsWith("gpt-5")) {
|
|
17472
17472
|
responsesInput.temperature = this.options.temperature;
|
|
17473
17473
|
}
|
|
17474
|
+
if (this.options.cacheKey) {
|
|
17475
|
+
responsesInput.prompt_cache_key = this.options.cacheKey;
|
|
17476
|
+
}
|
|
17477
|
+
if (this.options.reasoning) {
|
|
17478
|
+
responsesInput.reasoning = this.options.reasoning;
|
|
17479
|
+
}
|
|
17480
|
+
if (this.options.verbosity) {
|
|
17481
|
+
responsesInput.text.verbosity = this.options.verbosity;
|
|
17482
|
+
}
|
|
17474
17483
|
const response = await this.openai.responses.create(responsesInput);
|
|
17475
17484
|
const inputTokens = response.usage?.input_tokens || 0;
|
|
17476
17485
|
const outputTokens = response.usage?.output_tokens || 0;
|