@hitc/netsuite-types 2025.2.5 → 2025.2.7
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/N/crypto/certificate.d.ts +11 -3
- package/N/documentCapture.d.ts +211 -0
- package/N/llm.d.ts +1 -1
- package/N.d.ts +2 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* In addition to signing XML documents, you can create signer and verifier objects and verify signed documents with this module.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import type {Encoding} from '../encode';
|
|
6
7
|
import type {File} from '../file';
|
|
7
8
|
import type {NSXMLDocument} from '../xml';
|
|
8
9
|
|
|
@@ -14,7 +15,7 @@ export interface SignedXml {
|
|
|
14
15
|
|
|
15
16
|
export interface Signer {
|
|
16
17
|
update(options: UpdateCertificateOptions): void;
|
|
17
|
-
sign(options?:
|
|
18
|
+
sign(options?: SignOptions): string;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export interface Verifier {
|
|
@@ -31,7 +32,7 @@ interface CreateSignerOptions {
|
|
|
31
32
|
/** The script ID of the digital certificate. */
|
|
32
33
|
certId: string;
|
|
33
34
|
/** The hash algorithm. */
|
|
34
|
-
algorithm:
|
|
35
|
+
algorithm: HashAlg;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
interface UpdateCertificateOptions {
|
|
@@ -44,6 +45,13 @@ interface UpdateCertificateOptions {
|
|
|
44
45
|
inputEncoding?: string;
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
interface SignOptions {
|
|
49
|
+
/** Encoding of the signed string in Base64 format. */
|
|
50
|
+
outputEncoding?: Encoding
|
|
51
|
+
/** Returns ECDSA signatures in raw format. Default value is set to false. */
|
|
52
|
+
useRawFormatForECDSA?: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
47
55
|
interface VerifyOptions {
|
|
48
56
|
/** The signature to be verified. */
|
|
49
57
|
signature: string;
|
|
@@ -52,7 +60,7 @@ interface VerifyOptions {
|
|
|
52
60
|
}
|
|
53
61
|
|
|
54
62
|
export enum HashAlg {
|
|
55
|
-
SHA1,
|
|
63
|
+
// SHA1,
|
|
56
64
|
SHA256,
|
|
57
65
|
SHA384,
|
|
58
66
|
SHA512
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load the N/documentCapture module to extract text content from supported documents.
|
|
3
|
+
*
|
|
4
|
+
* The N/documentCapture module lets you programmatically extract structured content and key information from a variety of document types (such as invoices, receipts, contracts, and so on) directly
|
|
5
|
+
* within NetSuite. This module uses the AI-driven capabilities of the Oracle Cloud Infrastructure (OCI) Document Understanding service and can automate document processing, reduce manual data entry,
|
|
6
|
+
* and enhance business workflows. For more information about the OCI Document Understanding service, refer to Document Understanding in the Oracle Cloud Infrastructure Documentation.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import file = require('N/file');
|
|
10
|
+
import { IOCIConfig } from './llm';
|
|
11
|
+
|
|
12
|
+
/** The extracted data from a document. */
|
|
13
|
+
interface Document {
|
|
14
|
+
/**
|
|
15
|
+
* The MIME type of the document.
|
|
16
|
+
* This property can contain the following MIME types, depending on the extension of the file provided to
|
|
17
|
+
* documentCapture.documentToStructure(options) or parsed using documentCapture.parseResult(options):
|
|
18
|
+
* JPG – image/jpeg
|
|
19
|
+
* PDF – application/pdf
|
|
20
|
+
* PNG – image/png
|
|
21
|
+
* TIFF – image/tiff
|
|
22
|
+
*/
|
|
23
|
+
readonly mimeType: string;
|
|
24
|
+
/**
|
|
25
|
+
* The pages of the document.
|
|
26
|
+
* The documentCapture.documentToStructure(options) method supports documents up to five pages in length, so the
|
|
27
|
+
* returned documentCapture.Document object can contain up to five pages (as documentCapture.Page objects).
|
|
28
|
+
* When you submit an asynchronous extraction task using the N/task module, you can provide documents of any length,
|
|
29
|
+
* so the returned object contains as many pages as were in the provided document.
|
|
30
|
+
*/
|
|
31
|
+
readonly pages: Page[];
|
|
32
|
+
/** Returns the entire text of the document. */
|
|
33
|
+
getText: () => string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** An extracted page from a document. */
|
|
37
|
+
interface Page {
|
|
38
|
+
/**
|
|
39
|
+
* A set of confidence levels indicating whether the page represents a particular type of document.
|
|
40
|
+
* This property is a set of objects, and each object has a documentType value and confidence value.
|
|
41
|
+
* The documentType value is a type of supported document (such as "INVOICE"), and the confidence value is a number between 0 and 1 indicating how confident the service is about whether
|
|
42
|
+
* the page is a document of that type.
|
|
43
|
+
* For example, a documentType value of "INVOICE" and a confidence value of 0.95 means that the service is 95% confident that the page represents an invoice.
|
|
44
|
+
*/
|
|
45
|
+
readonly detectedDocumentTypes: { documentType: DocumentType, confidence: number }[];
|
|
46
|
+
/** The extracted fields from the page of a document. */
|
|
47
|
+
readonly fields: Field[];
|
|
48
|
+
readonly lines: Line[];
|
|
49
|
+
readonly tables: Table[];
|
|
50
|
+
readonly words: Word[];
|
|
51
|
+
getText: () => string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface Field {
|
|
55
|
+
readonly label: string;
|
|
56
|
+
readonly type: string;
|
|
57
|
+
readonly value: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface FieldLabel {
|
|
61
|
+
readonly confidence: number;
|
|
62
|
+
readonly name: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface FieldValue {
|
|
66
|
+
readonly confidence: number;
|
|
67
|
+
readonly text: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface Cell {
|
|
71
|
+
readonly confidence: number;
|
|
72
|
+
readonly text: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
interface Table {
|
|
76
|
+
readonly bodyRows: TableRow[];
|
|
77
|
+
readonly columnCount: number;
|
|
78
|
+
readonly confidence: number;
|
|
79
|
+
readonly footerRows: TableRow[];
|
|
80
|
+
readonly headerRows: TableRow[];
|
|
81
|
+
readonly rowCount: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface TableRow {
|
|
85
|
+
readonly cells: Cell[];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** An extracted line of text from a document. */
|
|
89
|
+
interface Line {
|
|
90
|
+
readonly confidence: number;
|
|
91
|
+
readonly text: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** An extracted word from a document. */
|
|
95
|
+
interface Word {
|
|
96
|
+
readonly confidence: number;
|
|
97
|
+
readonly text: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
interface DocumentToStructureOptions {
|
|
101
|
+
file: file.File,
|
|
102
|
+
documentType?: DocumentType;
|
|
103
|
+
features?: Feature[];
|
|
104
|
+
language?: Language;
|
|
105
|
+
ociConfig?: IOCIConfig;
|
|
106
|
+
timeout?: number;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface DocumentToStructureFunction {
|
|
110
|
+
(options: DocumentToStructureOptions): Document;
|
|
111
|
+
promise(options: DocumentToStructureOptions): Promise<Document>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export const documentToStructure: DocumentToStructureFunction;
|
|
115
|
+
|
|
116
|
+
interface DocumentToTextOptions {
|
|
117
|
+
/**
|
|
118
|
+
* The PDF file to extract content from.
|
|
119
|
+
* The specified file must be located in the NetSuite File Cabinet and be in PDF format.
|
|
120
|
+
* You can specify the file using its internal ID or the path to the file in the File Cabinet.
|
|
121
|
+
* For more information, see N/file Module. Encrypted files are not supported.
|
|
122
|
+
*/
|
|
123
|
+
file: file.File;
|
|
124
|
+
/**
|
|
125
|
+
* The timeout period to wait for a response from the service.
|
|
126
|
+
* By default, the timeout period is 30,000 milliseconds (30 seconds).
|
|
127
|
+
* You can specify a longer timeout period, but you can't specify one that's shorter than 30,000 milliseconds.
|
|
128
|
+
* If you try to specify a shorter timeout period, the default value of 30,000 milliseconds is used instead.
|
|
129
|
+
*/
|
|
130
|
+
timeout?: number;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface DocumentToTextFunction {
|
|
134
|
+
(options: DocumentToTextOptions): string;
|
|
135
|
+
promise(options: DocumentToTextFunction): Promise<string>;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export const documentToText: DocumentToTextFunction;
|
|
139
|
+
|
|
140
|
+
interface GetRemainingConcurrencyFunction {
|
|
141
|
+
(): number;
|
|
142
|
+
promise(): Promise<number>;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export const getRemainingConcurrency: GetRemainingConcurrencyFunction;
|
|
146
|
+
|
|
147
|
+
interface GetRemainingFreeUsageFunction {
|
|
148
|
+
(): number;
|
|
149
|
+
promise(): Promise<number>;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const getRemainingFreeUsage: GetRemainingFreeUsageFunction;
|
|
153
|
+
|
|
154
|
+
export function parseResult(options: { file: file.File }): Document;
|
|
155
|
+
|
|
156
|
+
// @ts-ignore Ignore the fact that this interface name conflicts with others (not NetSuite related)
|
|
157
|
+
enum DocumentType {
|
|
158
|
+
BANK_STATEMEN,
|
|
159
|
+
CHECK,
|
|
160
|
+
DRIVER_LICENSE,
|
|
161
|
+
HEALTH_INSURANCE_ID,
|
|
162
|
+
INVOICE,
|
|
163
|
+
OTHERS,
|
|
164
|
+
PASSPORT,
|
|
165
|
+
PAYSLIP,
|
|
166
|
+
RECEIPT,
|
|
167
|
+
RESUME,
|
|
168
|
+
TAX_FORM
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
enum Feature {
|
|
172
|
+
DOCUMENT_CLASSIFICATION,
|
|
173
|
+
FIELD_EXTRACTION,
|
|
174
|
+
TABLE_EXTRACTION,
|
|
175
|
+
TEXT_EXTRACTION
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
enum FieldType {
|
|
179
|
+
KEY_VALUE,
|
|
180
|
+
LINE_ITEM,
|
|
181
|
+
LINE_ITEM_FIELD,
|
|
182
|
+
LINE_ITEM_GROUP,
|
|
183
|
+
UNKNOWN
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
enum Language {
|
|
187
|
+
ARA,
|
|
188
|
+
CES,
|
|
189
|
+
CHI_SIM,
|
|
190
|
+
DAN,
|
|
191
|
+
DEU,
|
|
192
|
+
ELL,
|
|
193
|
+
ENG,
|
|
194
|
+
FIN,
|
|
195
|
+
FRA,
|
|
196
|
+
HIN,
|
|
197
|
+
HUN,
|
|
198
|
+
ITA,
|
|
199
|
+
JPN,
|
|
200
|
+
KOR,
|
|
201
|
+
NLD,
|
|
202
|
+
NOR,
|
|
203
|
+
OTHERS,
|
|
204
|
+
POL,
|
|
205
|
+
POR,
|
|
206
|
+
RON,
|
|
207
|
+
RUS,
|
|
208
|
+
SLK,
|
|
209
|
+
SWE,
|
|
210
|
+
TUR
|
|
211
|
+
}
|
package/N/llm.d.ts
CHANGED
|
@@ -238,7 +238,7 @@ interface IModelParameters {
|
|
|
238
238
|
topP?: number;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
interface IOCIConfig {
|
|
241
|
+
export interface IOCIConfig { // Also referenced in N/documentCapture
|
|
242
242
|
/** Compartment OCID. For more information, refer to Managing Compartments in the Oracle Cloud Infrastructure Documentation. */
|
|
243
243
|
compartmentId?: string;
|
|
244
244
|
/**
|
package/N.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import * as N_crypto from './N/crypto';
|
|
|
8
8
|
import * as N_currency from './N/currency';
|
|
9
9
|
import * as N_currentRecord from './N/currentRecord';
|
|
10
10
|
import * as N_dataset from './N/dataset';
|
|
11
|
+
import * as N_documentCapture from './N/documentCapture';
|
|
11
12
|
import * as N_email from './N/email';
|
|
12
13
|
import * as N_encode from './N/encode';
|
|
13
14
|
import * as N_error from './N/error';
|
|
@@ -58,6 +59,7 @@ export {N_crypto as crypto};
|
|
|
58
59
|
export {N_currency as currency};
|
|
59
60
|
export {N_currentRecord as currentRecord};
|
|
60
61
|
export {N_dataset as dataset};
|
|
62
|
+
export {N_documentCapture as documentCapture};
|
|
61
63
|
export {N_email as email};
|
|
62
64
|
export {N_encode as encode};
|
|
63
65
|
export {N_error as error};
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"posttest": "npm run cleanup"
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://github.com/headintheclouddev/typings-suitescript-2.0",
|
|
11
|
-
"version": "2025.2.
|
|
11
|
+
"version": "2025.2.7",
|
|
12
12
|
"author": "Head in the Cloud Development <gurus@headintheclouddev.com> (www.headintheclouddev.com)",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": {
|