@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.
- package/cobalt.js +15 -0
- 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;
|