@vibiz/sdk 0.3.12 → 0.3.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/README.md +1 -1
- package/dist/client.d.ts +3 -0
- package/dist/index.js +7 -6
- package/dist/one-key.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @vibiz/sdk
|
|
2
2
|
|
|
3
|
-
The typed client for the [
|
|
3
|
+
The typed client for the [thelastapi](https://app.vibiz.app/docs) API: projects, hosting and
|
|
4
4
|
deploys, databases, sign-in, email, AI, usage, payments and more, with the same calls the `vibiz`
|
|
5
5
|
CLI makes.
|
|
6
6
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1069,11 +1069,14 @@ export declare class Vibiz {
|
|
|
1069
1069
|
n?: number;
|
|
1070
1070
|
size?: string;
|
|
1071
1071
|
aspect_ratio?: "16:9" | "9:16" | "1:1";
|
|
1072
|
+
/** Video: a still to animate (image to video), a public https URL. */
|
|
1073
|
+
image_url?: string;
|
|
1072
1074
|
/** With a `fal/<endpoint>` model (your own fal key): raw input for that endpoint. */
|
|
1073
1075
|
fal_input?: Record<string, unknown>;
|
|
1074
1076
|
};
|
|
1075
1077
|
}, opts?: {
|
|
1076
1078
|
idempotencyKey?: string;
|
|
1079
|
+
project?: string;
|
|
1077
1080
|
}) => Promise<AiJob>;
|
|
1078
1081
|
get: (id: string) => Promise<AiJob>;
|
|
1079
1082
|
cancel: (id: string) => Promise<AiJob>;
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ function noBodyMessage(status) {
|
|
|
5
5
|
if (status === 413) return "Too large (413): send less at once.";
|
|
6
6
|
if (status === 429) return "Too many requests (429): wait a moment and retry.";
|
|
7
7
|
if (status >= 500) {
|
|
8
|
-
return `The
|
|
8
|
+
return `The thelastapi API did not answer properly (${status}). It is usually brief: retry in a minute.`;
|
|
9
9
|
}
|
|
10
10
|
return `The request failed with ${status} and no explanation from the API.`;
|
|
11
11
|
}
|
|
@@ -41,7 +41,7 @@ var Vibiz = class {
|
|
|
41
41
|
constructor(options) {
|
|
42
42
|
this.options = options;
|
|
43
43
|
if (!options.baseUrl) {
|
|
44
|
-
throw new Error("No
|
|
44
|
+
throw new Error("No thelastapi API URL: pass baseUrl (CLI: --api, or VIBIZ_API_URL).");
|
|
45
45
|
}
|
|
46
46
|
this.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
47
47
|
this.fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -54,6 +54,7 @@ var Vibiz = class {
|
|
|
54
54
|
if (init.body !== void 0) headers["content-type"] = "application/json";
|
|
55
55
|
if (init.raw) headers["content-type"] = init.contentType ?? "application/octet-stream";
|
|
56
56
|
if (init.idempotencyKey) headers["idempotency-key"] = init.idempotencyKey;
|
|
57
|
+
if (init.project) headers["x-vibiz-project"] = init.project;
|
|
57
58
|
if (this.options.user) headers["x-vibiz-user"] = endUserHeader(this.options.user);
|
|
58
59
|
if (this.options.client) headers["x-vibiz-client"] = this.options.client;
|
|
59
60
|
return this.fetchImpl(`${this.baseUrl}/v1${path}`, {
|
|
@@ -1738,7 +1739,7 @@ function deployPathProblem(path) {
|
|
|
1738
1739
|
return "looks like a credential (a private key or a token file), which is never deployed";
|
|
1739
1740
|
if (PRIVATE_DIRS.includes(part)) return `is inside ${part}, a home or config folder`;
|
|
1740
1741
|
if (IGNORED.has(part))
|
|
1741
|
-
return part === "vibiz.json" ? "is vibiz.json, the local link to the project, which is never deployed" : `is inside ${part}, which is never deployed (dependencies, VCS data or build output:
|
|
1742
|
+
return part === "vibiz.json" ? "is vibiz.json, the local link to the project, which is never deployed" : `is inside ${part}, which is never deployed (dependencies, VCS data or build output: thelastapi installs and builds the app itself)`;
|
|
1742
1743
|
}
|
|
1743
1744
|
return null;
|
|
1744
1745
|
}
|
|
@@ -1978,14 +1979,14 @@ function formatMinor(minor, currency) {
|
|
|
1978
1979
|
}
|
|
1979
1980
|
|
|
1980
1981
|
// packages/sdk/src/one-key.ts
|
|
1981
|
-
var APP_SDK_VERSION = "0.3.
|
|
1982
|
+
var APP_SDK_VERSION = "0.3.14";
|
|
1982
1983
|
var ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
|
|
1983
1984
|
function oneKeyMessage(url, host) {
|
|
1984
1985
|
const where = host ?? "your host";
|
|
1985
|
-
return `Add one key to ${where} and your app can use everything on
|
|
1986
|
+
return `Add one key to ${where} and your app can use everything on thelastapi (${ONE_KEY_GIVES}): copy VIBIZ_APP_KEY here: ${url} , paste it into ${host ? `${host}'s` : "your host's"} production environment variables, and redeploy.`;
|
|
1986
1987
|
}
|
|
1987
1988
|
function connectHostMessage(kind, host) {
|
|
1988
|
-
return `Or connect ${host ?? "the host"} once (vibiz hosts add ${kind ?? "<host>"} <app>) and
|
|
1989
|
+
return `Or connect ${host ?? "the host"} once (vibiz hosts add ${kind ?? "<host>"} <app>) and thelastapi keeps every variable in sync.`;
|
|
1989
1990
|
}
|
|
1990
1991
|
export {
|
|
1991
1992
|
APP_SDK_VERSION,
|
package/dist/one-key.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* (`npm install --save-exact @vibiz/app@<this>`). A test keeps it, the skills
|
|
11
11
|
* and the docs equal to packages/app/package.json.
|
|
12
12
|
*/
|
|
13
|
-
export declare const APP_SDK_VERSION = "0.3.
|
|
13
|
+
export declare const APP_SDK_VERSION = "0.3.14";
|
|
14
14
|
/** Everything one app key reaches. */
|
|
15
15
|
export declare const ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
|
|
16
16
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibiz/sdk",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Typed client for the
|
|
3
|
+
"version": "0.3.14",
|
|
4
|
+
"description": "Typed client for the thelastapi API: projects, hosting, databases, sign-in, email, AI, payments and more.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vibiz",
|
|
7
7
|
"sdk",
|