@avaprotocol/sdk-js 2.10.3 → 2.11.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/CHANGELOG.md +19 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +225 -106
- package/dist/index.mjs +225 -106
- package/dist/models/workflow.d.ts.map +1 -1
- package/dist/models/workflow.js +15 -8
- package/package.json +2 -2
package/dist/models/workflow.js
CHANGED
|
@@ -8,14 +8,21 @@ import { WorkflowStatus } from "@avaprotocol/types";
|
|
|
8
8
|
import { convertJSValueToProtobuf } from "../utils";
|
|
9
9
|
// Function to convert TaskStatus to string
|
|
10
10
|
export function convertStatusToString(status) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
switch (status) {
|
|
12
|
+
case avs_pb.TaskStatus.ENABLED:
|
|
13
|
+
return WorkflowStatus.Enabled;
|
|
14
|
+
case avs_pb.TaskStatus.COMPLETED:
|
|
15
|
+
return WorkflowStatus.Completed;
|
|
16
|
+
case avs_pb.TaskStatus.FAILED:
|
|
17
|
+
return WorkflowStatus.Failed;
|
|
18
|
+
case avs_pb.TaskStatus.RUNNING:
|
|
19
|
+
return WorkflowStatus.Running;
|
|
20
|
+
case avs_pb.TaskStatus.DISABLED:
|
|
21
|
+
return WorkflowStatus.Disabled;
|
|
22
|
+
default: {
|
|
23
|
+
throw new Error(`Unknown TaskStatus: ${status}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
19
26
|
}
|
|
20
27
|
class Workflow {
|
|
21
28
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "A JavaScript/TypeScript SDK designed to simplify integration with Ava Protocol's AVS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"prepare": "node ../../scripts/prepare-package.js"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@avaprotocol/types": "2.
|
|
34
|
+
"@avaprotocol/types": "2.9.0",
|
|
35
35
|
"@grpc/grpc-js": "^1.11.3",
|
|
36
36
|
"@grpc/proto-loader": "^0.7.13",
|
|
37
37
|
"dotenv": "^16.4.5",
|