specli 0.0.18 → 0.0.20
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 +3 -1
- package/dist/ai/tools.d.ts +6 -5
- package/dist/ai/tools.js +7 -20
- package/dist/ai/tools.test.js +7 -14
- package/dist/cli/compile.js +137 -61
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -1
- package/package.json +1 -2
- package/src/ai/tools.test.ts +0 -83
- package/src/ai/tools.ts +0 -211
- package/src/cli/auth-requirements.test.ts +0 -27
- package/src/cli/auth-requirements.ts +0 -91
- package/src/cli/auth-schemes.test.ts +0 -66
- package/src/cli/auth-schemes.ts +0 -187
- package/src/cli/capabilities.test.ts +0 -94
- package/src/cli/capabilities.ts +0 -88
- package/src/cli/command-id.test.ts +0 -32
- package/src/cli/command-id.ts +0 -16
- package/src/cli/command-index.ts +0 -19
- package/src/cli/command-model.test.ts +0 -44
- package/src/cli/command-model.ts +0 -128
- package/src/cli/compile.ts +0 -109
- package/src/cli/crypto.ts +0 -9
- package/src/cli/derive-name.ts +0 -101
- package/src/cli/exec.ts +0 -72
- package/src/cli/main.ts +0 -255
- package/src/cli/naming.test.ts +0 -86
- package/src/cli/naming.ts +0 -224
- package/src/cli/operations.test.ts +0 -57
- package/src/cli/operations.ts +0 -152
- package/src/cli/params.test.ts +0 -70
- package/src/cli/params.ts +0 -71
- package/src/cli/pluralize.ts +0 -41
- package/src/cli/positional.test.ts +0 -65
- package/src/cli/positional.ts +0 -75
- package/src/cli/request-body.test.ts +0 -35
- package/src/cli/request-body.ts +0 -94
- package/src/cli/runtime/argv.ts +0 -14
- package/src/cli/runtime/auth/resolve.ts +0 -59
- package/src/cli/runtime/body-flags.test.ts +0 -261
- package/src/cli/runtime/body-flags.ts +0 -176
- package/src/cli/runtime/body.ts +0 -24
- package/src/cli/runtime/collect.ts +0 -6
- package/src/cli/runtime/compat.ts +0 -89
- package/src/cli/runtime/context.ts +0 -62
- package/src/cli/runtime/execute.ts +0 -147
- package/src/cli/runtime/generated.ts +0 -242
- package/src/cli/runtime/headers.ts +0 -37
- package/src/cli/runtime/index.ts +0 -3
- package/src/cli/runtime/profile/secrets.ts +0 -83
- package/src/cli/runtime/profile/store.ts +0 -100
- package/src/cli/runtime/request.test.ts +0 -375
- package/src/cli/runtime/request.ts +0 -390
- package/src/cli/runtime/server-url.ts +0 -45
- package/src/cli/runtime/template.ts +0 -26
- package/src/cli/runtime/validate/ajv.ts +0 -13
- package/src/cli/runtime/validate/coerce.test.ts +0 -98
- package/src/cli/runtime/validate/coerce.ts +0 -71
- package/src/cli/runtime/validate/error.ts +0 -29
- package/src/cli/runtime/validate/index.ts +0 -4
- package/src/cli/runtime/validate/schema.ts +0 -54
- package/src/cli/schema-shape.ts +0 -36
- package/src/cli/schema.ts +0 -76
- package/src/cli/server.test.ts +0 -55
- package/src/cli/server.ts +0 -167
- package/src/cli/spec-id.ts +0 -12
- package/src/cli/spec-loader.ts +0 -58
- package/src/cli/stable-json.ts +0 -35
- package/src/cli/strings.ts +0 -21
- package/src/cli/types.ts +0 -59
- package/src/cli.ts +0 -94
- package/src/compiled.ts +0 -24
- package/src/macros/env.ts +0 -21
- package/src/macros/spec.ts +0 -17
- package/src/macros/version.ts +0 -14
package/src/macros/env.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bun macro: reads an environment variable at bundle-time.
|
|
3
|
-
* Returns undefined if the env var is not set.
|
|
4
|
-
*/
|
|
5
|
-
export function env(name: string): string | undefined {
|
|
6
|
-
if (!name) throw new Error("env macro: missing variable name");
|
|
7
|
-
return process.env[name];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Bun macro: reads a required environment variable at bundle-time.
|
|
12
|
-
* Throws if the env var is not set.
|
|
13
|
-
*/
|
|
14
|
-
export function envRequired(name: string): string {
|
|
15
|
-
if (!name) throw new Error("envRequired macro: missing variable name");
|
|
16
|
-
const value = process.env[name];
|
|
17
|
-
if (value === undefined) {
|
|
18
|
-
throw new Error(`Missing required env var: ${name}`);
|
|
19
|
-
}
|
|
20
|
-
return value;
|
|
21
|
-
}
|
package/src/macros/spec.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bun macro: loads an OpenAPI spec from a URL or file path at bundle-time.
|
|
3
|
-
* The spec text is inlined into the bundle.
|
|
4
|
-
*/
|
|
5
|
-
export async function loadSpec(spec: string): Promise<string> {
|
|
6
|
-
if (!spec) throw new Error("loadSpec macro: missing spec path/URL");
|
|
7
|
-
|
|
8
|
-
if (/^https?:\/\//i.test(spec)) {
|
|
9
|
-
const res = await fetch(spec);
|
|
10
|
-
if (!res.ok) {
|
|
11
|
-
throw new Error(`Failed to fetch spec: ${res.status} ${res.statusText}`);
|
|
12
|
-
}
|
|
13
|
-
return await res.text();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return await Bun.file(spec).text();
|
|
17
|
-
}
|
package/src/macros/version.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Bun macro: reads the version from package.json at bundle-time.
|
|
7
|
-
*/
|
|
8
|
-
export function version(): string {
|
|
9
|
-
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
const packageJsonPath = join(currentDir, "../../package.json");
|
|
11
|
-
const content = readFileSync(packageJsonPath, "utf-8");
|
|
12
|
-
const packageJson = JSON.parse(content);
|
|
13
|
-
return packageJson.version;
|
|
14
|
-
}
|