@vibiz/sdk 0.0.0-stage → 0.2.0
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 +24 -2
- package/dist/client.d.ts +1191 -0
- package/dist/deploy.d.ts +25 -0
- package/dist/env.d.ts +14 -0
- package/dist/format.d.ts +11 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1440 -0
- package/dist/types.d.ts +3178 -0
- package/package.json +36 -4
package/dist/deploy.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Vibiz } from './client.js';
|
|
2
|
+
import type { DeployFile, Deployment } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Refuse folders that are clearly not an app: the filesystem root, a home
|
|
5
|
+
* directory, or anything holding credentials folders. Deploys are public, and
|
|
6
|
+
* an agent passing the wrong path must not publish someone's ~/.ssh.
|
|
7
|
+
*/
|
|
8
|
+
export declare function assertDeployableRoot(root: string): Promise<void>;
|
|
9
|
+
export interface LocalFile extends DeployFile {
|
|
10
|
+
absolute: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function collectFiles(root: string): Promise<LocalFile[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Deploy a directory the way Vercel's CLI does: hash every file, upload only
|
|
15
|
+
* the hashes the server does not have, then create the deployment from the
|
|
16
|
+
* manifest. A redeploy of an unchanged project uploads nothing.
|
|
17
|
+
*/
|
|
18
|
+
export declare function deployDirectory(vibiz: Vibiz, projectId: string, root: string, opts?: {
|
|
19
|
+
target?: 'preview' | 'production';
|
|
20
|
+
onProgress?: (msg: string) => void;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
deployment: Deployment;
|
|
23
|
+
uploaded: number;
|
|
24
|
+
total: number;
|
|
25
|
+
}>;
|
package/dist/env.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value as dotenv, Node's `parseEnv` and Next.js read it back exactly: they
|
|
3
|
+
* take '…' and `…` literally and expand only \n inside "…", with no escape
|
|
4
|
+
* for a quote. Plain values keep the usual "…"; others go in a quote they
|
|
5
|
+
* don't contain.
|
|
6
|
+
*/
|
|
7
|
+
export declare function dotenvValue(value: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Merge env into a dotenv file's text: keys we manage are replaced in place
|
|
10
|
+
* or appended, every other line (the user's own variables, comments) is kept.
|
|
11
|
+
*/
|
|
12
|
+
export declare function mergeEnvFile(existing: string, env: Record<string, string>): string;
|
|
13
|
+
/** Merge env into a dotenv file on disk (created if missing), readable only by its owner. */
|
|
14
|
+
export declare function writeEnvFile(path: string, env: Record<string, string>): Promise<void>;
|
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display helpers shared by the CLI and the hosted dashboard, so both say the
|
|
3
|
+
* same thing about the same numbers.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Money with adaptive precision: two decimals from a cent up; below a cent,
|
|
7
|
+
* two significant digits ($0.00003); never "$0" for an amount that isn't zero.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatUsd(usd: number): string;
|
|
10
|
+
/** "339 in · 252 out tok", "7 img", "1 call": one short line per row. */
|
|
11
|
+
export declare function formatUnits(units: Record<string, number>): string;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { endUserHeader, Vibiz, VibizApiError, type VibizOptions, type WhoAmI } from './client.js';
|
|
2
|
+
export { assertDeployableRoot, collectFiles, deployDirectory, type LocalFile } from './deploy.js';
|
|
3
|
+
export { mergeEnvFile, writeEnvFile } from './env.js';
|
|
4
|
+
export { formatUnits, formatUsd } from './format.js';
|
|
5
|
+
export type * from './types.js';
|