Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cua.run/client

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cua.run/client - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

6

CHANGELOG.md
# @cua.run/client
## 0.0.7
### Patch Changes
- support multiple arguments + error handling
## 0.0.6

@@ -4,0 +10,0 @@

36

dist/cjs/index.js

@@ -10,16 +10,28 @@ "use strict";

},
push: (fn, args, options) => {
const { apiToken = token } = options || {};
return (0, fetch_1.fetch)(`${constants_js_1.DOMAIN}${constants_js_1.PATH}`, {
method: "POST",
body: JSON.stringify({
fn,
args,
}),
headers: {
"Content-type": "application/json",
Authorization: `Bearer ${apiToken}`,
},
push: (fn, ...args) => {
return new Promise((resolve, reject) => {
let body = "";
try {
body = JSON.stringify({
fn,
args,
});
}
catch (error) {
console.log(`[cua.function][${fn}] Failed to serialize arguments: ${error}`);
reject();
}
(0, fetch_1.fetch)(`${constants_js_1.DOMAIN}${constants_js_1.PATH}`, {
method: "POST",
body,
headers: {
"Content-type": "application/json",
Authorization: `Bearer ${token}`,
},
}).then(resolve, (error) => {
console.log(`[cua.function][${fn}] Failed to execute: ${error}`);
reject();
});
});
},
};

@@ -8,16 +8,28 @@ import { fetch } from "@whatwg-node/fetch";

},
push: (fn, args, options) => {
const { apiToken = token } = options || {};
return fetch(`${DOMAIN}${PATH}`, {
method: "POST",
body: JSON.stringify({
fn,
args,
}),
headers: {
"Content-type": "application/json",
Authorization: `Bearer ${apiToken}`,
},
push: (fn, ...args) => {
return new Promise((resolve, reject) => {
let body = "";
try {
body = JSON.stringify({
fn,
args,
});
}
catch (error) {
console.log(`[cua.function][${fn}] Failed to serialize arguments: ${error}`);
reject();
}
fetch(`${DOMAIN}${PATH}`, {
method: "POST",
body,
headers: {
"Content-type": "application/json",
Authorization: `Bearer ${token}`,
},
}).then(resolve, (error) => {
console.log(`[cua.function][${fn}] Failed to execute: ${error}`);
reject();
});
});
},
};
{
"name": "@cua.run/client",
"version": "0.0.5",
"version": "0.0.6",
"description": "cua JavaScript client",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -6,4 +6,4 @@ interface Options {

init: ({ apiToken }: Options) => void;
push: (fn: string, args?: any[], options?: Options) => Promise<Response>;
push: (fn: string, ...args: any[]) => Promise<unknown>;
};
export default _default;
{
"name": "@cua.run/client",
"version": "0.0.6",
"version": "0.0.7",
"description": "cua JavaScript client",

@@ -14,4 +14,3 @@ "main": "dist/cjs/index.js",

"scripts": {
"build": "bob build",
"publish": "changeset version && changeset publish"
"build": "bob build"
},

@@ -18,0 +17,0 @@ "devDependencies": {

@@ -13,16 +13,29 @@ import { fetch } from "@whatwg-node/fetch";

},
push: (fn: string, args?: any[], options?: Options) => {
const { apiToken = token } = options || {};
return fetch(`${DOMAIN}${PATH}`, {
method: "POST",
body: JSON.stringify({
fn,
args,
}),
headers: {
"Content-type": "application/json",
Authorization: `Bearer ${apiToken}`,
},
push: (fn: string, ...args: any[]) => {
return new Promise((resolve, reject) => {
let body = "";
try {
body = JSON.stringify({
fn,
args,
});
} catch (error) {
console.log(
`[cua.function][${fn}] Failed to serialize arguments: ${error}`
);
reject();
}
fetch(`${DOMAIN}${PATH}`, {
method: "POST",
body,
headers: {
"Content-type": "application/json",
Authorization: `Bearer ${token}`,
},
}).then(resolve, (error) => {
console.log(`[cua.function][${fn}] Failed to execute: ${error}`);
reject();
});
});
},
};

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc