@hitc/netsuite-types 2022.2.7 → 2022.2.9

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/task.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import {File} from './file';
2
+ import {Query} from './query';
2
3
 
3
4
  interface CheckStatusOptions {
4
5
  taskId: string;
@@ -10,8 +11,103 @@ type TaskCreateOptions =
10
11
  | MapReduceScriptTaskCreateOptions
11
12
  | ScheduledScriptTaskCreateOptions
12
13
  | WorkflowTriggerTaskCreateOptions
14
+ | QueryTaskCreateOptions
15
+ | RecordActionTaskCreateOptions
16
+ | SuiteQLTaskCreateOptions
13
17
  | SearchTaskCreateOptions;
14
18
 
19
+ interface RecordActionTaskCreateOptions {
20
+ taskType: TaskType.RECORD_ACTION
21
+ action: string;
22
+ condition: ActionCondition;
23
+ params: {}[];
24
+ recordType: string;
25
+ }
26
+
27
+ interface RecordActionTaskStatus {
28
+ readonly complete: number;
29
+ readonly errors: {};
30
+ readonly failed: number;
31
+ readonly pending: number;
32
+ readonly results: {};
33
+ readonly status: string;
34
+ readonly succeeded: number;
35
+ readonly taskId: string;
36
+ }
37
+
38
+ /** The properties of a record action task. Use the methods and properties for this object to submit a record action task into the task queue and to execute it asynchronously. */
39
+ interface RecordActionTask {
40
+ /** Submits a record action task script deployment for processing and returns its task ID. */
41
+ submit(): string;
42
+ action: string;
43
+ condition: ActionCondition;
44
+ id: string;
45
+ /**
46
+ * Property of type function that takes record ID and returns the parameter object for the specified record ID. Is to be used in conjunction with task.ActionCondition.
47
+ * This parameter cannot be specified when RecordActionTask.params is specified.
48
+ */
49
+ paramCallback?(taskId: string): {};
50
+ /**
51
+ * An array of parameter objects. Each object corresponds to one record ID of the record for which the action is to be executed.
52
+ * The object has the following form: {recordId: 1, someParam: 'example1', otherParam: 'example2'}
53
+ */
54
+ params: {}[];
55
+ recordType: string;
56
+ }
57
+
58
+ interface AddInboundDependencyOptions {
59
+ /** The script ID of the scheduled script record or map/reduce script record for the dependent task. */
60
+ scriptId: string;
61
+ /** The type of dependent task. This property uses one of the following values in the task.TaskType enum. */
62
+ taskType: string;
63
+ /** The script ID of the script deployment record for the dependent task. */
64
+ deploymentId?: string;
65
+ /** The parameters for the scheduled script or map/reduce script. */
66
+ params?: {}
67
+ }
68
+
69
+ interface SuiteQLTaskCreateOptions {
70
+ taskType: TaskType.SUITE_QL;
71
+ /** The internal ID of the CSV file to export search results to. */
72
+ fileId?: number;
73
+ /**
74
+ * The path of the CSV file to export search results to.
75
+ * This parameter is mutually exclusive with the options.fileId parameter. If you specify values for both parameters, an error occurs.
76
+ */
77
+ filePath?: string;
78
+ params?: (string|boolean|number)[];
79
+ query?: Query|string;
80
+ }
81
+
82
+ /** The status of an asynchronous SuiteQL task (task.SuiteQLTask) in the NetSuite task queue. */
83
+ interface SuiteQLTaskStatus {
84
+ readonly fileId: number;
85
+ params: (string|boolean|number)[];
86
+ readonly query: string;
87
+ readonly status: string;
88
+ readonly taskId: string;
89
+ }
90
+
91
+ interface SuiteQLTask {
92
+ /** Submits the SuiteQL task for asynchronous processing. */
93
+ submit(): string;
94
+ /** Adds a scheduled script task or map/reduce script task as a dependent task to the SuiteQL task. */
95
+ addInboundDependency(dependency: ScheduledScriptTask | MapReduceScriptTask | { taskType: TaskType, scriptId: string, deploymentId?: string, params?: {} } ): void;
96
+ query: string;
97
+ fileId: number;
98
+ filePath: string;
99
+ /**
100
+ * Key-value pairs that contain information about the dependent tasks added to the SuiteQL task.
101
+ * Use this property to verify the properties of dependent tasks after you add the tasks using SuiteQLTask.addInboundDependency(options).
102
+ * This property uses nested objects to store information about each dependent task.
103
+ * A nested object is included for each dependent task added to the SuiteQL task, and these objects are referenced by their index (starting at 0).
104
+ * Dependent tasks are indexed in the order they are added to the SuiteQL task.
105
+ * Each nested object contains the task type, script ID, script deployment ID, and script parameters.
106
+ */
107
+ readonly inboundDependencies: {}[];
108
+ /** Parameters for the SuiteQL query. */
109
+ params: (string|boolean|number)[];
110
+ }
15
111
 
16
112
  interface SearchTaskCreateOptions {
17
113
  taskType: TaskType.SEARCH
@@ -20,6 +116,29 @@ interface SearchTaskCreateOptions {
20
116
  filePath?: string;
21
117
  }
22
118
 
119
+ interface QueryTaskCreateOptions {
120
+ taskType: TaskType.QUERY
121
+ query: Query;
122
+ fileId?: number;
123
+ filePath?: string;
124
+ }
125
+
126
+ interface QueryTaskStatus {
127
+ readonly fileId: number;
128
+ readonly query: string;
129
+ readonly status: string;
130
+ readonly taskId: string;
131
+ }
132
+
133
+ interface QueryTask {
134
+ submit(): string;
135
+ addInboundDependency(dependency: ScheduledScriptTask | MapReduceScriptTask): void;
136
+ toString(): string;
137
+ query: Query;
138
+ fileId: number;
139
+ filePath: string;
140
+ }
141
+
23
142
  interface SearchTask {
24
143
  submit(): string;
25
144
  addInboundDependency(dependency: ScheduledScriptTask | MapReduceScriptTask): void;
@@ -169,7 +288,16 @@ export function create(options: MapReduceScriptTaskCreateOptions): MapReduceScri
169
288
  export function create(options: ScheduledScriptTaskCreateOptions): ScheduledScriptTask;
170
289
  export function create(options: WorkflowTriggerTaskCreateOptions): WorkflowTriggerTask;
171
290
  export function create(options: SearchTaskCreateOptions): SearchTask;
172
- export function checkStatus(options: CheckStatusOptions): ScheduledScriptTaskStatus | MapReduceScriptTaskStatus | CsvImportTaskStatus | EntityDeduplicationTaskStatus | WorkflowTriggerTaskStatus;
291
+ export function create(options: QueryTaskCreateOptions): QueryTask;
292
+ export function create(options: RecordActionTaskCreateOptions): RecordActionTask;
293
+ export function create(options: SuiteQLTaskCreateOptions): SuiteQLTask;
294
+ export function checkStatus(options: CheckStatusOptions): ScheduledScriptTaskStatus | MapReduceScriptTaskStatus | CsvImportTaskStatus | EntityDeduplicationTaskStatus | WorkflowTriggerTaskStatus | SuiteQLTaskStatus | QueryTaskStatus | RecordActionTaskStatus;
295
+
296
+ /** Holds the string values for the possible record action conditions. */
297
+ declare enum ActionCondition {
298
+ ALL_QUALIFIED_INSTANCES
299
+ }
300
+
173
301
  export enum DedupeEntityType {
174
302
  CUSTOMER,
175
303
  CONTACT,
@@ -209,5 +337,8 @@ export enum TaskType {
209
337
  CSV_IMPORT = "CSV_IMPORT",
210
338
  ENTITY_DEDUPLICATION = "ENTITY_DEDUPLICATION",
211
339
  WORKFLOW_TRIGGER = "WORKFLOW_TRIGGER",
212
- SEARCH = "SEARCH"
340
+ SEARCH = "SEARCH",
341
+ RECORD_ACTION = "RECORD_ACTION",
342
+ SUITE_QL = "SUITE_QL",
343
+ QUERY = "QUERY"
213
344
  }
package/N/types.d.ts CHANGED
@@ -369,10 +369,10 @@ export namespace EntryPoints {
369
369
  }
370
370
 
371
371
  namespace RESTlet {
372
- type get = (requestParameters: object) => object | string;
373
- type delete_ = (requestParameters: object) => object | string;
374
- type post = (requestBody: object | string) => object | string;
375
- type put = (requestBody: object | string) => object | string;
372
+ type get = (requestParameters: {[key: string]: any}) => {[key: string]: any} | string;
373
+ type delete_ = (requestParameters: {[key: string]: any}) => {[key: string]: any} | string;
374
+ type post = (requestBody: {[key: string]: any} | string) => {[key: string]: any} | string;
375
+ type put = (requestBody: {[key: string]: any} | string) => {[key: string]: any} | string;
376
376
  }
377
377
 
378
378
  namespace BundleInstallation {
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": "2022.2.7",
11
+ "version": "2022.2.9",
12
12
  "author": "Head in the Cloud Development <gurus@headintheclouddev.com> (www.headintheclouddev.com)",
13
13
  "license": "MIT",
14
14
  "repository": {