@maaxyz/maa-node 4.4.0-alpha.1 → 4.4.0-alpha.3
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/client.d.ts +2 -0
- package/dist/context.d.ts +7 -1
- package/dist/index-client.js +34 -171
- package/dist/index-server.js +26 -171
- package/dist/maa.d.ts +11 -1
- package/dist/pipeline.d.ts +179 -240
- package/dist/resource.d.ts +6 -0
- package/package.json +7 -7
- package/src/client.ts +10 -0
- package/src/context.ts +16 -2
- package/src/maa.d.ts +11 -1
- package/src/pipeline.ts +228 -674
- package/src/resource.ts +14 -0
package/src/resource.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Context } from './context'
|
|
2
2
|
import { Job, JobSource } from './job'
|
|
3
3
|
import maa from './maa'
|
|
4
|
+
import { Task } from './pipeline'
|
|
4
5
|
import {
|
|
5
6
|
CustomActionCallback,
|
|
6
7
|
CustomActionSelf,
|
|
@@ -151,6 +152,19 @@ export class ResourceBase {
|
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
154
|
|
|
155
|
+
get_node_data(node_name: string) {
|
|
156
|
+
return maa.resource_get_node_data(this.handle, node_name)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
get_node_data_parsed(node_name: string) {
|
|
160
|
+
const content = this.get_node_data(node_name)
|
|
161
|
+
if (content) {
|
|
162
|
+
return JSON.parse(content) as Task
|
|
163
|
+
} else {
|
|
164
|
+
return null
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
154
168
|
clear() {
|
|
155
169
|
if (!maa.resource_clear(this.handle)) {
|
|
156
170
|
throw 'Resource clear failed'
|