@hitc/netsuite-types 2024.2.11 → 2025.1.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/http.d.ts CHANGED
@@ -115,7 +115,7 @@ export interface RequestOptions extends GetOptions {
115
115
  * Allow usage as string here as N/http is a heavy import just
116
116
  * to get an enum.
117
117
  */
118
- method: Method | string;
118
+ method: Method | `${Method}`;
119
119
  /**
120
120
  * -optional- The POST data if the method is POST. If method is DELETE, body data is ignored.
121
121
  */
@@ -207,7 +207,7 @@ export interface ServerRequest {
207
207
  * Allow usage as string here as N/http is a heavy import just
208
208
  * to get an enum.
209
209
  */
210
- method: Method | "DELETE" | "GET" | "POST" | "PUT";
210
+ method: Method | `${Method}`;
211
211
  /**
212
212
  * The server request parameters.
213
213
  */
package/N/llm.d.ts ADDED
@@ -0,0 +1,118 @@
1
+ /**
2
+ * The N/llm module supports generative artificial intelligence (AI) capabilities in SuiteScript.
3
+ * You can use this module to send requests to the large language models (LLMs) supported by NetSuite and to receive LLM responses to use in your scripts.
4
+ */
5
+
6
+ /** The chat message object returned by the llm.createChatMessage(options) method. */
7
+ interface ChatMessage {
8
+ text: string;
9
+ readonly role: ChatRole;
10
+ }
11
+
12
+ /** The response returned from LLM. Use the llm.generateText(options) or the llm.generateText.promise(options) method to retrieve a response from the LLM. */
13
+ interface Response {
14
+ readonly text: string;
15
+ readonly model: string;
16
+ readonly chatHistory: ChatMessage[];
17
+ }
18
+
19
+ export function createChatMessage(options: { role: string, text: string }): ChatMessage;
20
+
21
+ export const generateText: GenerateTextFunction;
22
+
23
+ /** Returns the number of free requests in the current month. */
24
+ export const getRemainingFreeUsage: GetRemainingFreeUsageFunction;
25
+
26
+ interface GenerateTextFunction {
27
+ (options: IGenerateTextOptions): Response;
28
+ promise(options: IGenerateTextOptions): Response;
29
+ }
30
+
31
+ interface GetRemainingFreeUsageFunction {
32
+ (): number;
33
+ promise(): number;
34
+ }
35
+
36
+ interface IGenerateTextOptions {
37
+ /** Prompt for the LLM. */
38
+ prompt: string;
39
+ /** Chat history to be taken into consideration. */
40
+ chatHistory?: ChatMessage[];
41
+ /** Specifies the LLM to use. Use llm.ModelFamily to set the value. If not specified, the Cohere Command R LLM is used. */
42
+ modelFamily?: ModelFamily;
43
+ modelParameters?: IModelParameters;
44
+ /**
45
+ * Configuration needed for unlimited usage through OCI Generative AI Service.
46
+ * Required only when accessing the LLM through an Oracle Cloud Account and the OCI Generative AI Service.
47
+ * SuiteApps installed to target accounts are prevented from using the free usage pool for N/llm and must use the OCI configuration.
48
+ */
49
+ ociConfig?: IOCIConfig;
50
+ preamble?: string;
51
+ timeout?: number;
52
+ }
53
+
54
+ interface IModelParameters {
55
+ /** A penalty that is assigned to a token when that token appears frequently. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation. See Model Parameter Values by LLM for valid values. */
56
+ frequencyPenalty?: number;
57
+ /** The maximum number of tokens the LLM is allowed to generate. The average number of tokens per word is 3. See Model Parameter Values by LLM for valid values. */
58
+ maxTokens?: number;
59
+ /**
60
+ * A penalty that is assigned to each token when it appears in the output to encourage generating outputs with tokens that haven't been used.
61
+ * Similar to frequencyPenalty, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.
62
+ * See Model Parameter Values by LLM for valid values.
63
+ */
64
+ presencePenalty?: number;
65
+ /**
66
+ * Defines a range of randomness for the response.
67
+ * A lower temperature will lean toward the highest probability tokens and expected answers, while a higher temperature will deviate toward random and unconventional responses.
68
+ * A lower value works best for responses that must be more factual or accurate, and a higher value works best for getting more creative responses.
69
+ * See Model Parameter Values by LLM for valid values.
70
+ */
71
+ temperature?: number;
72
+ /** Determines how many tokens are considered for generation at each step. See Model Parameter Values by LLM for valid values. */
73
+ topK?: number;
74
+ /**
75
+ * Sets the probability, which ensures that only the most likely tokens with total probability mass of p are considered for generation at each step.
76
+ * If both topK and topP are set, topP acts after topK. See Model Parameter Values by LLM for valid values.
77
+ */
78
+ topP?: number;
79
+ }
80
+
81
+ interface IOCIConfig {
82
+ /** Compartment OCID. For more information, refer to Managing Compartments in the Oracle Cloud Infrastructure Documentation. */
83
+ compartmentId?: string;
84
+ /**
85
+ * Endpoint ID. This value is needed only when a custom OCI DAC (dedicated AI cluster) is to be used.
86
+ * For more information, refer to Managing an Endpoint in Generative AI in the Oracle Cloud Infrastructure Documentation.
87
+ */
88
+ endpointId?: string;
89
+ /**
90
+ * Fingerprint of the public key (only a NetSuite secret is accepted—see Creating Secrets).
91
+ * For more information, refer to Required Keys and OCIDs in the Oracle Cloud Infrastructure Documentation.
92
+ */
93
+ fingerprint?: string;
94
+ /**
95
+ * Private key of the OCI user (only a NetSuite secret is accepted—see Creating Secrets).
96
+ * For more information, refer to Required Keys and OCIDs in the Oracle Cloud Infrastructure Documentation.
97
+ */
98
+ privateKey?: string;
99
+ /** Tenancy OCID. For more information, refer to Managing the Tenancy in the Oracle Cloud Infrastructure Documentation. */
100
+ tenancyId?: string;
101
+ /** User OCID. For more information, refer to Managing Users in the Oracle Cloud Infrastructure Documentation. */
102
+ userId?: string;
103
+ }
104
+
105
+ declare enum ChatRole {
106
+ /** Identifies the author of the chat message (prompt) sent to the large language model. */
107
+ USER = "USER",
108
+ /** Identifies the author of the chat message (response text) received from the large language model. */
109
+ CHATBOT = "CHATBOT"
110
+ }
111
+
112
+ /** The large language model to be used. */
113
+ declare enum ModelFamily {
114
+ /** Always uses the latest supported Cohere model. Cohere Command-R is the default when the options.modelFamily parameter is omitted. */
115
+ COHERE_COMMAND = 'cohere.command-r-16k',
116
+ /** Always uses the latest supported Meta Llama model. */
117
+ META_LLAMA = 'meta.llama-3.1-70b-instruct'
118
+ }
package/N/query.d.ts CHANGED
@@ -602,7 +602,8 @@ export interface Condition {
602
602
  readonly component: Component;
603
603
  }
604
604
 
605
- export type QueryResultMap = { [fieldId: string]: string | boolean | number | null }
605
+ export type QueryResultValue = string | boolean | number | bigint | null;
606
+ export type QueryResultMap = { [fieldId: string]: QueryResultValue };
606
607
  /**
607
608
  * Set of results returned by the query.
608
609
  */
@@ -648,7 +649,7 @@ export interface Result {
648
649
  * the array exactly matches the ResultSet.types, ResultSet.columns or Result.columns property.
649
650
  * @throws {SuiteScriptError} READ_ONLY when setting the property is attempted
650
651
  */
651
- readonly values: Array<boolean | string | number | null>;
652
+ readonly values: Array<QueryResultValue>;
652
653
 
653
654
  /**
654
655
  * The return columns. This is equivalent to ResultSet.columns.
package/N/task.d.ts CHANGED
@@ -153,7 +153,7 @@ interface SearchTaskStatus {
153
153
  toString(): string;
154
154
  savedSearchId: number;
155
155
  fileId: number;
156
- status: TaskStatus;
156
+ status: TaskStatus | `${TaskStatus}`;
157
157
  taskId: number;
158
158
  }
159
159
 
@@ -178,7 +178,7 @@ interface CsvImportTask {
178
178
 
179
179
  interface CsvImportTaskStatus {
180
180
  toString(): string;
181
- status: TaskStatus;
181
+ status: TaskStatus | `${TaskStatus}`;
182
182
  }
183
183
 
184
184
  interface EntityDeduplicationTaskCreateOptions {
@@ -202,7 +202,7 @@ interface EntityDeduplicationTask {
202
202
 
203
203
  interface EntityDeduplicationTaskStatus {
204
204
  toString(): string;
205
- status: TaskStatus;
205
+ status: TaskStatus | `${TaskStatus}`;
206
206
  }
207
207
 
208
208
  interface MapReduceScriptTaskCreateOptions {
@@ -235,8 +235,8 @@ interface MapReduceScriptTaskStatus {
235
235
  toString(): string;
236
236
  scriptId: string;
237
237
  deploymentId: string;
238
- stage: MapReduceStage;
239
- status: TaskStatus;
238
+ stage: MapReduceStage | `${MapReduceStage}`;
239
+ status: TaskStatus | `${TaskStatus}`;
240
240
  }
241
241
 
242
242
  interface ScheduledScriptTaskCreateOptions {
@@ -258,7 +258,7 @@ interface ScheduledScriptTaskStatus {
258
258
  toString(): string;
259
259
  scriptId: string;
260
260
  deploymentId: string;
261
- status: TaskStatus;
261
+ status: TaskStatus | `${TaskStatus}`;
262
262
  }
263
263
 
264
264
  interface WorkflowTriggerTaskCreateOptions {
@@ -280,7 +280,7 @@ interface WorkflowTriggerTask {
280
280
 
281
281
  interface WorkflowTriggerTaskStatus {
282
282
  toString(): string;
283
- status: TaskStatus;
283
+ status: TaskStatus | `${TaskStatus}`;
284
284
  }
285
285
 
286
286
  export function create(options: CsvImportTaskCreateOptions): CsvImportTask;
@@ -314,11 +314,11 @@ export enum DedupeMode {
314
314
  MARK_AS_NOT_DUPES,
315
315
  }
316
316
  export enum MapReduceStage {
317
- GET_INPUT,
318
- MAP,
319
- SHUFFLE,
320
- REDUCE,
321
- SUMMARIZE,
317
+ GET_INPUT = "GET_INPUT",
318
+ MAP = "MAP",
319
+ SHUFFLE = "SHUFFLE",
320
+ REDUCE = "REDUCE",
321
+ SUMMARIZE = "SUMMARIZE"
322
322
  }
323
323
  export enum MasterSelectionMode {
324
324
  CREATED_EARLIEST,
@@ -327,10 +327,10 @@ export enum MasterSelectionMode {
327
327
  SELECT_BY_ID,
328
328
  }
329
329
  export enum TaskStatus {
330
- PENDING,
331
- PROCESSING,
332
- COMPLETE,
333
- FAILED,
330
+ PENDING = "PENDING",
331
+ PROCESSING = "PROCESSING",
332
+ COMPLETE = "COMPLETE",
333
+ FAILED = "FAILED",
334
334
  }
335
335
  export enum TaskType {
336
336
  SCHEDULED_SCRIPT = "SCHEDULED_SCRIPT",
package/N.d.ts CHANGED
@@ -17,6 +17,8 @@ import * as N_http from './N/http';
17
17
  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
+ import * as N_llm from './N/llm';
21
+ import * as N_pgp from './N/pgp';
20
22
  import * as N_plugin from './N/plugin';
21
23
  import * as N_portlet from './N/portlet';
22
24
  import * as N_query from './N/query';
@@ -64,6 +66,8 @@ export {N_http as http};
64
66
  export {N_https as https};
65
67
  export {N_keyControl as keyControl}
66
68
  export {N_log as log};
69
+ export {N_llm as llm};
70
+ export {N_pgp as pgp};
67
71
  export {N_piRemoval as piremoval};
68
72
  export {N_plugin as plugin};
69
73
  export {N_portlet as portlet};
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": "2024.2.11",
11
+ "version": "2025.1.0",
12
12
  "author": "Head in the Cloud Development <gurus@headintheclouddev.com> (www.headintheclouddev.com)",
13
13
  "license": "MIT",
14
14
  "repository": {