@reduck-ai/sdk 1.1.13 → 1.1.14
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/dist/client.d.ts +0 -1
- package/dist/client.js +0 -24
- package/package.json +12 -12
package/dist/client.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export declare class ReduckClient {
|
|
|
5
5
|
private readonly _appBaseUrl;
|
|
6
6
|
private readonly _headers;
|
|
7
7
|
constructor(opts: ReduckClientOptions);
|
|
8
|
-
consentNotice(): Promise<void>;
|
|
9
8
|
run(query: string, { mount, deviceId, method, methodArgs, pasteSlots, outputSchema, slug }: RunOptions): Run;
|
|
10
9
|
listDevices(): Promise<Device[]>;
|
|
11
10
|
listRuns(page?: number): Promise<RunsPage>;
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { cp, mkdir } from "node:fs/promises";
|
|
2
|
-
import { createInterface } from "node:readline";
|
|
3
2
|
import { basename, join } from "node:path";
|
|
4
3
|
import { homedir } from "node:os";
|
|
5
4
|
import { ReduckError } from "./errors.js";
|
|
@@ -19,29 +18,6 @@ export class ReduckClient {
|
|
|
19
18
|
this._appBaseUrl = (opts.appBaseUrl ?? APP_URL).replace(/\/$/, "");
|
|
20
19
|
this._headers = { ...opts.headers, ...authHeader(opts) };
|
|
21
20
|
}
|
|
22
|
-
async consentNotice() {
|
|
23
|
-
const res = await fetch(`${this._runnerBaseUrl}/consent-notice`, {
|
|
24
|
-
headers: this._headers,
|
|
25
|
-
});
|
|
26
|
-
if (!res.ok)
|
|
27
|
-
throw ReduckError.fromResponse("GET /consent-notice", res.status);
|
|
28
|
-
const data = (await res.json());
|
|
29
|
-
if (!data.content)
|
|
30
|
-
return;
|
|
31
|
-
const answer = await new Promise((resolve) => {
|
|
32
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
33
|
-
rl.question(`${data.content} (y/n) `, (a) => { rl.close(); resolve(a.trim().toLowerCase()); });
|
|
34
|
-
});
|
|
35
|
-
if (answer !== "y" && answer !== "yes")
|
|
36
|
-
throw new ReduckError("Consent not accepted", { code: "CONSENT_REFUSED" });
|
|
37
|
-
const post = await fetch(`${this._runnerBaseUrl}/consent-notice`, {
|
|
38
|
-
method: "POST",
|
|
39
|
-
headers: { "Content-Type": "application/json", ...this._headers },
|
|
40
|
-
body: JSON.stringify({ version: data.version }),
|
|
41
|
-
});
|
|
42
|
-
if (!post.ok)
|
|
43
|
-
throw ReduckError.fromResponse("POST /consent-notice", post.status);
|
|
44
|
-
}
|
|
45
21
|
run(query, { mount, deviceId, method, methodArgs, pasteSlots, outputSchema, slug }) {
|
|
46
22
|
if (!deviceId)
|
|
47
23
|
throw new ReduckError("deviceId is required to start a run", { code: "MISSING_DEVICE" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reduck-ai/sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"description": "TypeScript SDK for Reduck — run browser automations programmatically.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Reduck AI <contact@reduck.ai> (https://reduck.ai)",
|
|
@@ -33,16 +33,6 @@
|
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"generate-env": "node ../scripts/generate-build-env.mjs ./src/build-env.generated.ts",
|
|
38
|
-
"prebuild": "pnpm generate-env",
|
|
39
|
-
"build": "pnpm exec tsc",
|
|
40
|
-
"build:production": "REDUCK_BUILD_ENV=production pnpm build",
|
|
41
|
-
"build:staging": "REDUCK_BUILD_ENV=staging pnpm build",
|
|
42
|
-
"precheck": "pnpm generate-env",
|
|
43
|
-
"check": "pnpm exec tsc --noEmit",
|
|
44
|
-
"dev": "pnpm exec tsc --watch"
|
|
45
|
-
},
|
|
46
36
|
"dependencies": {
|
|
47
37
|
"ws": "^8.0.0"
|
|
48
38
|
},
|
|
@@ -53,5 +43,15 @@
|
|
|
53
43
|
"repository": {
|
|
54
44
|
"type": "git",
|
|
55
45
|
"url": "git+https://github.com/conception-ai/conception-clean-for-real.git"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"generate-env": "node ../scripts/generate-build-env.mjs ./src/build-env.generated.ts",
|
|
49
|
+
"prebuild": "pnpm generate-env",
|
|
50
|
+
"build": "pnpm exec tsc",
|
|
51
|
+
"build:production": "REDUCK_BUILD_ENV=production pnpm build",
|
|
52
|
+
"build:staging": "REDUCK_BUILD_ENV=staging pnpm build",
|
|
53
|
+
"precheck": "pnpm generate-env",
|
|
54
|
+
"check": "pnpm exec tsc --noEmit",
|
|
55
|
+
"dev": "pnpm exec tsc --watch"
|
|
56
56
|
}
|
|
57
|
-
}
|
|
57
|
+
}
|