@happyrobot-ai/sdk 0.1.20 → 0.1.21
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/package.json +1 -1
- package/resources/nodes.d.ts +11 -0
- package/resources/nodes.js +9 -0
package/package.json
CHANGED
package/resources/nodes.d.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* GET /versions/:version_id/nodes/:node_id/config-schema
|
|
11
11
|
* GET /versions/:version_id/nodes/:node_id/available-vars
|
|
12
12
|
* POST /versions/:version_id/nodes/:node_id/test
|
|
13
|
+
* PUT /versions/:version_id/nodes/:node_id/custom-output
|
|
13
14
|
*/
|
|
14
15
|
import type { HttpClient } from "../core/http";
|
|
15
16
|
import type { AvailableVarsResponse, ConfigSchemaResponse } from "../types/nodes.types";
|
|
@@ -47,4 +48,14 @@ export declare class NodesResource {
|
|
|
47
48
|
getAvailableVars(versionId: string, nodeId: string): Promise<AvailableVarsResponse>;
|
|
48
49
|
/** Test a single node. The version must not be published. */
|
|
49
50
|
test(versionId: string, nodeId: string, body?: TestNodeBody): Promise<TestNodeResponse>;
|
|
51
|
+
/** Set a custom JSON object as a node's output for testing. */
|
|
52
|
+
setCustomOutput(versionId: string, nodeId: string, data: Record<string, unknown>): Promise<CustomOutputResponse>;
|
|
53
|
+
}
|
|
54
|
+
export interface CustomOutputResponse {
|
|
55
|
+
data: {
|
|
56
|
+
id: string;
|
|
57
|
+
node_id: string;
|
|
58
|
+
data: Record<string, unknown> | null;
|
|
59
|
+
timestamp: string;
|
|
60
|
+
};
|
|
50
61
|
}
|
package/resources/nodes.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* GET /versions/:version_id/nodes/:node_id/config-schema
|
|
12
12
|
* GET /versions/:version_id/nodes/:node_id/available-vars
|
|
13
13
|
* POST /versions/:version_id/nodes/:node_id/test
|
|
14
|
+
* PUT /versions/:version_id/nodes/:node_id/custom-output
|
|
14
15
|
*/
|
|
15
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
17
|
exports.NodesResource = void 0;
|
|
@@ -78,6 +79,14 @@ class NodesResource {
|
|
|
78
79
|
body: body ?? {},
|
|
79
80
|
});
|
|
80
81
|
}
|
|
82
|
+
/** Set a custom JSON object as a node's output for testing. */
|
|
83
|
+
async setCustomOutput(versionId, nodeId, data) {
|
|
84
|
+
return this.http.request({
|
|
85
|
+
method: "PUT",
|
|
86
|
+
path: `/versions/${enc(versionId)}/nodes/${enc(nodeId)}/custom-output`,
|
|
87
|
+
body: { data },
|
|
88
|
+
});
|
|
89
|
+
}
|
|
81
90
|
}
|
|
82
91
|
exports.NodesResource = NodesResource;
|
|
83
92
|
function enc(s) {
|