@cobaltio/cobalt-js 0.0.1 → 0.0.2
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 +1 -1
- package/cobalt.min.js +1 -1
- package/package.json +1 -1
package/cobalt.js
CHANGED
package/cobalt.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class Cobalt{constructor(options){this.apiBaseUrl=options?.baseUrl||"https://api.gocobalt.io";this.template={}}get token(){return this.templateToken}set token(token){return this.templateToken=typeof token==="string"?token:""}get baseUrl(){return this.apiBaseUrl}async installTemplate(){const res=await fetch(`${this.baseUrl}/api/v1/template/install`,{method:"POST",headers:{authorization:`Bearer ${this.token}`}});this.template=await res.json();return this.template}async saveNode(nodeId,inputData={}){const res=await fetch(`${this.baseUrl}/api/v2/workflow/${this.template?.workflow_id}/node/${nodeId}`,{method:"PUT",headers:{authorization:`Bearer ${this.token}`},body:JSON.stringify({input_data:inputData})});return await res.json()}}
|
|
1
|
+
class Cobalt{constructor(options){this.apiBaseUrl=options?.baseUrl||"https://api.gocobalt.io";this.template={}}get token(){return this.templateToken}set token(token){return this.templateToken=typeof token==="string"?token:""}get baseUrl(){return this.apiBaseUrl}async installTemplate(){const res=await fetch(`${this.baseUrl}/api/v1/template/install`,{method:"POST",headers:{authorization:`Bearer ${this.token}`}});this.template=await res.json();return this.template}async saveNode(nodeId,inputData={}){const res=await fetch(`${this.baseUrl}/api/v2/workflow/${this.template?.workflow_id}/node/${nodeId}`,{method:"PUT",headers:{authorization:`Bearer ${this.token}`},body:JSON.stringify({input_data:inputData})});return await res.json()}}module.exports=Cobalt;
|