@cobaltio/cobalt-js 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/cobalt.js +15 -0
  2. package/package.json +1 -1
package/cobalt.js CHANGED
@@ -127,6 +127,21 @@ class Cobalt {
127
127
  });
128
128
  return await res.json();
129
129
  }
130
+
131
+ /**
132
+ * Toggle the status of the specified workflow.
133
+ * @property {string} workflowId The ID of the workflow.
134
+ * @returns {Promise<Workflow>}
135
+ */
136
+ async toggleWorkflowStatus(workflowId) {
137
+ const res = await fetch(`${this.baseUrl}/api/v2/workflow/${workflowId}/toggle-status`, {
138
+ method: "PUT",
139
+ headers: {
140
+ authorization: `Bearer ${this.token}`,
141
+ },
142
+ });
143
+ return await res.json();
144
+ }
130
145
  }
131
146
 
132
147
  module.exports = Cobalt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobaltio/cobalt-js",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Cobalt frontend SDK",
5
5
  "main": "./cobalt.js",
6
6
  "scripts": {