@hitc/netsuite-types 2025.1.15 → 2025.2.0
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/machineTranslation.d.ts +97 -0
- package/N.d.ts +2 -8
- package/package.json +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use the N/machineTranslation module to translate text into supported languages using generative AI.
|
|
3
|
+
* This module uses the Oracle Cloud Infrastructure (OCI) Language service to translate text in documents you provide.
|
|
4
|
+
* For more information about this service, see Language in the OCI documentation.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A document returned from machineTranslation.createDocument(options) or machineTranslation.translate(options).
|
|
9
|
+
* A document represents text that you send to or receive from the translation service.
|
|
10
|
+
* This object includes properties for the document ID (Document.id), document language (Document.language), and document text (Document.text).
|
|
11
|
+
*/
|
|
12
|
+
interface Document {
|
|
13
|
+
/** The ID of the document. When passing documents to machineTranslation.translate(options), all document IDs must be unique. */
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly language: string;
|
|
16
|
+
readonly text: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* An error returned from the translation service when calling machineTranslation.translate(options).
|
|
21
|
+
* The translation service returns an error if a provided document couldn't be translated.
|
|
22
|
+
* An error might occur if the text to translate isn't formatted correctly (for example, if it contains unrecognized characters).
|
|
23
|
+
* This object includes properties for the ID of the document that the error relates to (Error.documentId) and the text of the error message (Error.message).
|
|
24
|
+
*/
|
|
25
|
+
interface IMachineTranslationError {
|
|
26
|
+
/** The ID of the document that the error relates to. */
|
|
27
|
+
readonly documentId: string;
|
|
28
|
+
/** The text of the error message. */
|
|
29
|
+
readonly message: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** A response returned from machineTranslation.translate(options). */
|
|
33
|
+
interface Response {
|
|
34
|
+
/** The errors returned from the translation service. */
|
|
35
|
+
readonly errors: IMachineTranslationError[];
|
|
36
|
+
/** The translation documents. */
|
|
37
|
+
readonly results: Document[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Creates a document with the specified ID, source language, and text content.
|
|
42
|
+
* A document represents text to translate using machineTranslation.translate(options).
|
|
43
|
+
* When you create a document for translation, you can specify the source language of the document.
|
|
44
|
+
* If you don't specify the source language, the translation service detects the language automatically.
|
|
45
|
+
*
|
|
46
|
+
* Note For best translation results, each document should contain text in a single language only.
|
|
47
|
+
* The translation service supports documents that use multiple languages, but the accuracy and completeness of the resulting translation may vary.
|
|
48
|
+
*
|
|
49
|
+
* When passing documents to machineTranslation.translate(options) for translation, keep the following considerations in mind:
|
|
50
|
+
* - All document IDs must be unique.
|
|
51
|
+
* - The maximum length for a single document is 5,000 characters.
|
|
52
|
+
* - The overall maximum length for all documents is 20,000 characters.
|
|
53
|
+
* - You can't pass an empty document (one where the Document.text property is empty).
|
|
54
|
+
* - If you pass a document that doesn't specify its source language (one where the Document.language property is null or undefined), the translation service detects the source language automatically.
|
|
55
|
+
*/
|
|
56
|
+
export function createDocument(options: { id: string, text: string, language?: string }): Document;
|
|
57
|
+
|
|
58
|
+
interface ITranslateFunction {
|
|
59
|
+
(options: { documents: Document[], targetLanguage: string, timeout?: number }): Response;
|
|
60
|
+
promise(options: { documents: Document[], targetLanguage: string, timeout?: number }): Promise<Response>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const translate: ITranslateFunction;
|
|
64
|
+
|
|
65
|
+
declare enum Language {
|
|
66
|
+
ARABIC = 'ARABIC',
|
|
67
|
+
BRAZILIAN_PORTUGUESE = 'BRAZILIAN_PORTUGUESE',
|
|
68
|
+
CANADIAN_FRENCH = 'CANADIAN_FRENCH',
|
|
69
|
+
CROATIAN = 'CROATIAN',
|
|
70
|
+
CZECH = 'CZECH',
|
|
71
|
+
DANISH = 'DANISH',
|
|
72
|
+
DUTCH = 'DUTCH',
|
|
73
|
+
ENGLISH = 'ENGLISH',
|
|
74
|
+
FINNISH = 'FINNISH',
|
|
75
|
+
FRENCH = 'FRENCH',
|
|
76
|
+
GERMAN = 'GERMAN',
|
|
77
|
+
GREEK = 'GREEK',
|
|
78
|
+
HEBREW = 'HEBREW',
|
|
79
|
+
HUNGARIAN = 'HUNGARIAN',
|
|
80
|
+
ITALIAN = 'ITALIAN',
|
|
81
|
+
JAPANESE = 'JAPANESE',
|
|
82
|
+
KOREAN = 'KOREAN',
|
|
83
|
+
NORWEGIAN = 'NORWEGIAN',
|
|
84
|
+
POLISH = 'POLISH',
|
|
85
|
+
PORTUGUESE = 'PORTUGUESE',
|
|
86
|
+
ROMANIAN = 'ROMANIAN',
|
|
87
|
+
RUSSIAN = 'RUSSIAN',
|
|
88
|
+
SIMPLIFIED_CHINESE = 'SIMPLIFIED_CHINESE',
|
|
89
|
+
SLOVAK = 'SLOVAK',
|
|
90
|
+
SLOVENIAN = 'SLOVENIAN',
|
|
91
|
+
SPANISH = 'SPANISH',
|
|
92
|
+
SWEDISH = 'SWEDISH',
|
|
93
|
+
THAI = 'THAI',
|
|
94
|
+
TRADITIONAL_CHINESE = 'TRADITIONAL_CHINESE',
|
|
95
|
+
TURKISH = 'TURKISH',
|
|
96
|
+
VIETNAMESE = 'VIETNAMESE',
|
|
97
|
+
}
|
package/N.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import * as N_https from './N/https';
|
|
|
18
18
|
import * as N_keyControl from './N/keyControl';
|
|
19
19
|
import * as N_log from './N/log';
|
|
20
20
|
import * as N_llm from './N/llm';
|
|
21
|
+
import * as N_machineTranslation from './N/machineTranslation';
|
|
21
22
|
import * as N_pgp from './N/pgp';
|
|
22
23
|
import * as N_plugin from './N/plugin';
|
|
23
24
|
import * as N_portlet from './N/portlet';
|
|
@@ -67,6 +68,7 @@ export {N_https as https};
|
|
|
67
68
|
export {N_keyControl as keyControl}
|
|
68
69
|
export {N_log as log};
|
|
69
70
|
export {N_llm as llm};
|
|
71
|
+
export {N_machineTranslation as machineTranslation};
|
|
70
72
|
export {N_pgp as pgp};
|
|
71
73
|
export {N_piRemoval as piremoval};
|
|
72
74
|
export {N_plugin as plugin};
|
|
@@ -100,14 +102,6 @@ declare interface N_Commerce_Module {
|
|
|
100
102
|
recordView: typeof N_commerce_recordView;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
|
-
// declare interface N_Crypto_Module {
|
|
104
|
-
// certificate: typeof N_crypto_certificate;
|
|
105
|
-
// }
|
|
106
|
-
//
|
|
107
|
-
// declare interface N_Https_Module {
|
|
108
|
-
// clientCertificate: typeof N_https_clientCertificate;
|
|
109
|
-
// }
|
|
110
|
-
|
|
111
105
|
declare const N_ui: N_UI_Module;
|
|
112
106
|
declare const N_commerce: N_Commerce_Module;
|
|
113
107
|
// declare const N_crypto_: N_Crypto_Module;
|
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.
|
|
11
|
+
"version": "2025.2.0",
|
|
12
12
|
"author": "Head in the Cloud Development <gurus@headintheclouddev.com> (www.headintheclouddev.com)",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": {
|