@decohere/scaffold 0.0.1-dev.100
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/commonjs/src/add-api.action.js +37 -0
- package/commonjs/src/add-api.command.js +39 -0
- package/commonjs/src/add.command.js +22 -0
- package/commonjs/src/add.module.js +24 -0
- package/commonjs/src/auth0-configure.action.js +28 -0
- package/commonjs/src/auth0-configure.command.js +24 -0
- package/commonjs/src/auth0-login.action.js +28 -0
- package/commonjs/src/auth0-login.command.js +23 -0
- package/commonjs/src/auth0.command.js +22 -0
- package/commonjs/src/auth0.module.js +28 -0
- package/commonjs/src/cli.js +7 -0
- package/commonjs/src/create.command.js +22 -0
- package/commonjs/src/create.module.js +24 -0
- package/commonjs/src/domain/prompt.js +62 -0
- package/commonjs/src/index.js +48 -0
- package/commonjs/src/models/compose.model.js +258 -0
- package/commonjs/src/models/config-yaml.model.js +86 -0
- package/commonjs/src/models/const.js +30 -0
- package/commonjs/src/models/dev-container.model.js +172 -0
- package/commonjs/src/models/docker-image.model.js +277 -0
- package/commonjs/src/models/env-file.model.js +48 -0
- package/commonjs/src/models/gitignore.model.js +48 -0
- package/commonjs/src/models/launch-json.model.js +70 -0
- package/commonjs/src/models/package-json.model.js +156 -0
- package/commonjs/src/models/project.model.js +132 -0
- package/commonjs/src/models/source-file.js +4 -0
- package/commonjs/src/models/tsconfig.model.js +32 -0
- package/commonjs/src/models/vitest-config.model.js +33 -0
- package/commonjs/src/models/vscode-settings.model.js +29 -0
- package/commonjs/src/program.js +64 -0
- package/commonjs/src/resolve-target-dir.js +17 -0
- package/commonjs/src/services/scaffold.service.js +60 -0
- package/commonjs/src/version.js +55 -0
- package/commonjs/src/webapi/api-name.js +93 -0
- package/commonjs/src/webapi/auth0-commands.js +250 -0
- package/commonjs/src/webapi/authorize-scopes.js +79 -0
- package/commonjs/src/webapi/cli-options.js +99 -0
- package/commonjs/src/webapi/const.js +54 -0
- package/commonjs/src/webapi/create-api.js +265 -0
- package/commonjs/src/webapi/devcontainer/codebase-rag-mcp.js +164 -0
- package/commonjs/src/webapi/devcontainer/codebase-rag-mcp.ts +182 -0
- package/commonjs/src/webapi/devcontainer/host-scripts.js +50 -0
- package/commonjs/src/webapi/devcontainer/templates/codebase-rag.env.example +3 -0
- package/commonjs/src/webapi/devcontainer/templates/initialize.sh +169 -0
- package/commonjs/src/webapi/devcontainer/templates/post-create.sh +35 -0
- package/commonjs/src/webapi/devcontainer/templates/post-start.sh +65 -0
- package/commonjs/src/webapi/devcontainer/templates/tty-prompt.sh +38 -0
- package/commonjs/src/webapi/features/auth.feature.js +408 -0
- package/commonjs/src/webapi/features/auth0-cli.js +472 -0
- package/commonjs/src/webapi/features/biome-format.js +47 -0
- package/commonjs/src/webapi/features/database.feature.js +432 -0
- package/commonjs/src/webapi/features/finalize.feature.js +93 -0
- package/commonjs/src/webapi/features/postman.feature.js +322 -0
- package/commonjs/src/webapi/models/api-package-json.model.js +58 -0
- package/commonjs/src/webapi/models/auth-config.model.js +24 -0
- package/commonjs/src/webapi/models/controller-source-file.model.js +190 -0
- package/commonjs/src/webapi/models/github-ci.model.js +193 -0
- package/commonjs/src/webapi/models/main-source-file.model.js +165 -0
- package/commonjs/src/webapi/models/production-dockerfile.model.js +75 -0
- package/commonjs/src/webapi/models/sample-files.model.js +58 -0
- package/commonjs/src/webapi/models/webapi-image.model.js +25 -0
- package/commonjs/src/webapi/postman/hello-openapi.js +173 -0
- package/commonjs/src/webapi/postman/local-view.js +182 -0
- package/commonjs/src/webapi/postman/openapi-to-postman.js +200 -0
- package/commonjs/src/webapi/workspace-readme.js +109 -0
- package/commonjs/src/webapi.action.js +28 -0
- package/commonjs/src/webapi.command.js +43 -0
- package/es6/src/add-api.action.js +27 -0
- package/es6/src/add-api.command.js +29 -0
- package/es6/src/add.command.js +12 -0
- package/es6/src/add.module.js +14 -0
- package/es6/src/auth0-configure.action.js +18 -0
- package/es6/src/auth0-configure.command.js +14 -0
- package/es6/src/auth0-login.action.js +18 -0
- package/es6/src/auth0-login.command.js +13 -0
- package/es6/src/auth0.command.js +12 -0
- package/es6/src/auth0.module.js +18 -0
- package/es6/src/cli.js +3 -0
- package/es6/src/create.command.js +12 -0
- package/es6/src/create.module.js +14 -0
- package/es6/src/domain/prompt.js +41 -0
- package/es6/src/index.js +9 -0
- package/es6/src/models/compose.model.js +254 -0
- package/es6/src/models/config-yaml.model.js +74 -0
- package/es6/src/models/const.js +20 -0
- package/es6/src/models/dev-container.model.js +162 -0
- package/es6/src/models/docker-image.model.js +235 -0
- package/es6/src/models/env-file.model.js +44 -0
- package/es6/src/models/gitignore.model.js +38 -0
- package/es6/src/models/launch-json.model.js +60 -0
- package/es6/src/models/package-json.model.js +141 -0
- package/es6/src/models/project.model.js +117 -0
- package/es6/src/models/source-file.js +1 -0
- package/es6/src/models/tsconfig.model.js +22 -0
- package/es6/src/models/vitest-config.model.js +23 -0
- package/es6/src/models/vscode-settings.model.js +19 -0
- package/es6/src/program.js +46 -0
- package/es6/src/resolve-target-dir.js +7 -0
- package/es6/src/services/scaffold.service.js +50 -0
- package/es6/src/version.js +34 -0
- package/es6/src/webapi/api-name.js +57 -0
- package/es6/src/webapi/auth0-commands.js +185 -0
- package/es6/src/webapi/authorize-scopes.js +55 -0
- package/es6/src/webapi/cli-options.js +34 -0
- package/es6/src/webapi/const.js +21 -0
- package/es6/src/webapi/create-api.js +245 -0
- package/es6/src/webapi/devcontainer/codebase-rag-mcp.js +154 -0
- package/es6/src/webapi/devcontainer/codebase-rag-mcp.ts +182 -0
- package/es6/src/webapi/devcontainer/host-scripts.js +29 -0
- package/es6/src/webapi/devcontainer/templates/codebase-rag.env.example +3 -0
- package/es6/src/webapi/devcontainer/templates/initialize.sh +169 -0
- package/es6/src/webapi/devcontainer/templates/post-create.sh +35 -0
- package/es6/src/webapi/devcontainer/templates/post-start.sh +65 -0
- package/es6/src/webapi/devcontainer/templates/tty-prompt.sh +38 -0
- package/es6/src/webapi/features/auth.feature.js +357 -0
- package/es6/src/webapi/features/auth0-cli.js +406 -0
- package/es6/src/webapi/features/biome-format.js +40 -0
- package/es6/src/webapi/features/database.feature.js +422 -0
- package/es6/src/webapi/features/finalize.feature.js +83 -0
- package/es6/src/webapi/features/postman.feature.js +256 -0
- package/es6/src/webapi/models/api-package-json.model.js +53 -0
- package/es6/src/webapi/models/auth-config.model.js +20 -0
- package/es6/src/webapi/models/controller-source-file.model.js +181 -0
- package/es6/src/webapi/models/github-ci.model.js +186 -0
- package/es6/src/webapi/models/main-source-file.model.js +161 -0
- package/es6/src/webapi/models/production-dockerfile.model.js +66 -0
- package/es6/src/webapi/models/sample-files.model.js +40 -0
- package/es6/src/webapi/models/webapi-image.model.js +18 -0
- package/es6/src/webapi/postman/hello-openapi.js +166 -0
- package/es6/src/webapi/postman/local-view.js +167 -0
- package/es6/src/webapi/postman/openapi-to-postman.js +177 -0
- package/es6/src/webapi/workspace-readme.js +88 -0
- package/es6/src/webapi.action.js +18 -0
- package/es6/src/webapi.command.js +33 -0
- package/package.json +36 -0
- package/src/webapi/devcontainer/codebase-rag-mcp.ts +182 -0
- package/src/webapi/devcontainer/templates/codebase-rag.env.example +3 -0
- package/src/webapi/devcontainer/templates/initialize.sh +169 -0
- package/src/webapi/devcontainer/templates/post-create.sh +35 -0
- package/src/webapi/devcontainer/templates/post-start.sh +65 -0
- package/src/webapi/devcontainer/templates/tty-prompt.sh +38 -0
- package/types/src/add-api.action.d.ts +13 -0
- package/types/src/add-api.command.d.ts +7 -0
- package/types/src/add.command.d.ts +6 -0
- package/types/src/add.module.d.ts +14 -0
- package/types/src/auth0-configure.action.d.ts +7 -0
- package/types/src/auth0-configure.command.d.ts +6 -0
- package/types/src/auth0-login.action.d.ts +4 -0
- package/types/src/auth0-login.command.d.ts +6 -0
- package/types/src/auth0.command.d.ts +6 -0
- package/types/src/auth0.module.d.ts +18 -0
- package/types/src/cli.d.ts +2 -0
- package/types/src/create.command.d.ts +6 -0
- package/types/src/create.module.d.ts +14 -0
- package/types/src/domain/prompt.d.ts +4 -0
- package/types/src/index.d.ts +13 -0
- package/types/src/models/compose.model.d.ts +73 -0
- package/types/src/models/config-yaml.model.d.ts +27 -0
- package/types/src/models/const.d.ts +20 -0
- package/types/src/models/dev-container.model.d.ts +49 -0
- package/types/src/models/docker-image.model.d.ts +90 -0
- package/types/src/models/env-file.model.d.ts +16 -0
- package/types/src/models/gitignore.model.d.ts +9 -0
- package/types/src/models/launch-json.model.d.ts +7 -0
- package/types/src/models/package-json.model.d.ts +36 -0
- package/types/src/models/project.model.d.ts +60 -0
- package/types/src/models/source-file.d.ts +11 -0
- package/types/src/models/tsconfig.model.d.ts +5 -0
- package/types/src/models/vitest-config.model.d.ts +5 -0
- package/types/src/models/vscode-settings.model.d.ts +7 -0
- package/types/src/program.d.ts +3 -0
- package/types/src/resolve-target-dir.d.ts +5 -0
- package/types/src/services/scaffold.service.d.ts +22 -0
- package/types/src/version.d.ts +6 -0
- package/types/src/webapi/api-name.d.ts +14 -0
- package/types/src/webapi/auth0-commands.d.ts +11 -0
- package/types/src/webapi/authorize-scopes.d.ts +7 -0
- package/types/src/webapi/cli-options.d.ts +6 -0
- package/types/src/webapi/const.d.ts +19 -0
- package/types/src/webapi/create-api.d.ts +15 -0
- package/types/src/webapi/devcontainer/codebase-rag-mcp.d.ts +32 -0
- package/types/src/webapi/devcontainer/codebase-rag-mcp.ts +182 -0
- package/types/src/webapi/devcontainer/host-scripts.d.ts +7 -0
- package/types/src/webapi/devcontainer/templates/codebase-rag.env.example +3 -0
- package/types/src/webapi/devcontainer/templates/initialize.sh +169 -0
- package/types/src/webapi/devcontainer/templates/post-create.sh +35 -0
- package/types/src/webapi/devcontainer/templates/post-start.sh +65 -0
- package/types/src/webapi/devcontainer/templates/tty-prompt.sh +38 -0
- package/types/src/webapi/features/auth.feature.d.ts +10 -0
- package/types/src/webapi/features/auth0-cli.d.ts +84 -0
- package/types/src/webapi/features/biome-format.d.ts +5 -0
- package/types/src/webapi/features/database.feature.d.ts +7 -0
- package/types/src/webapi/features/finalize.feature.d.ts +2 -0
- package/types/src/webapi/features/postman.feature.d.ts +16 -0
- package/types/src/webapi/models/api-package-json.model.d.ts +18 -0
- package/types/src/webapi/models/auth-config.model.d.ts +26 -0
- package/types/src/webapi/models/controller-source-file.model.d.ts +46 -0
- package/types/src/webapi/models/github-ci.model.d.ts +9 -0
- package/types/src/webapi/models/main-source-file.model.d.ts +54 -0
- package/types/src/webapi/models/production-dockerfile.model.d.ts +18 -0
- package/types/src/webapi/models/sample-files.model.d.ts +7 -0
- package/types/src/webapi/models/webapi-image.model.d.ts +12 -0
- package/types/src/webapi/postman/hello-openapi.d.ts +19 -0
- package/types/src/webapi/postman/local-view.d.ts +17 -0
- package/types/src/webapi/postman/openapi-to-postman.d.ts +62 -0
- package/types/src/webapi/workspace-readme.d.ts +18 -0
- package/types/src/webapi.action.d.ts +14 -0
- package/types/src/webapi.command.d.ts +11 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Auth0Env, type PostmanCollection } from "./openapi-to-postman.js";
|
|
2
|
+
/** Local View / Native Git environment (YAML). */
|
|
3
|
+
export declare function buildEnvironmentYaml(name: string, auth: Auth0Env | undefined, options: {
|
|
4
|
+
callbacks: readonly string[];
|
|
5
|
+
scopes: string;
|
|
6
|
+
}): string;
|
|
7
|
+
/**
|
|
8
|
+
* Build Postman Local View multi-file YAML from a v2.1 collection (routes)
|
|
9
|
+
* plus hand-authored Auth0 overlay.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildLocalViewFilesFromCollection(collection: PostmanCollection, projectName: string, auth: Auth0Env | undefined, options: {
|
|
12
|
+
callbacks: readonly string[];
|
|
13
|
+
scopes: string;
|
|
14
|
+
}): Array<{
|
|
15
|
+
filePath: string;
|
|
16
|
+
content: string;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ScaffoldOpenApiDocument } from "./hello-openapi.js";
|
|
2
|
+
export type PostmanCollection = {
|
|
3
|
+
info: {
|
|
4
|
+
_postman_id?: string;
|
|
5
|
+
name: string;
|
|
6
|
+
schema: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
};
|
|
9
|
+
auth?: unknown;
|
|
10
|
+
item?: PostmanItem[];
|
|
11
|
+
variable?: Array<{
|
|
12
|
+
key: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}>;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
export type PostmanItem = {
|
|
18
|
+
name?: string;
|
|
19
|
+
item?: PostmanItem[];
|
|
20
|
+
request?: PostmanRequest;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
export type PostmanRequest = {
|
|
24
|
+
method?: string;
|
|
25
|
+
header?: Array<{
|
|
26
|
+
key: string;
|
|
27
|
+
value: string;
|
|
28
|
+
}>;
|
|
29
|
+
body?: {
|
|
30
|
+
mode?: string;
|
|
31
|
+
raw?: string;
|
|
32
|
+
};
|
|
33
|
+
url?: string | {
|
|
34
|
+
raw?: string;
|
|
35
|
+
host?: string[];
|
|
36
|
+
path?: string[];
|
|
37
|
+
variable?: unknown[];
|
|
38
|
+
};
|
|
39
|
+
auth?: {
|
|
40
|
+
type: string;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
};
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
export type Auth0Env = {
|
|
46
|
+
auth0Domain?: string;
|
|
47
|
+
auth0Audience?: string;
|
|
48
|
+
auth0ClientId?: string;
|
|
49
|
+
};
|
|
50
|
+
/** Convert an OpenAPI document to a Postman Collection v2.1 via openapi-to-postmanv2. */
|
|
51
|
+
export declare function openApiToPostmanCollection(document: ScaffoldOpenApiDocument): Promise<PostmanCollection>;
|
|
52
|
+
/**
|
|
53
|
+
* Overlay Auth0 OAuth2 (PKCE) collection auth and fix Local View-friendly URLs.
|
|
54
|
+
* Route items come from OpenAPI; auth/env remain hand-authored.
|
|
55
|
+
*/
|
|
56
|
+
export declare function applyPostmanAuthOverlay(collection: PostmanCollection, projectName: string, auth: Auth0Env | undefined, options: {
|
|
57
|
+
callbacks: readonly string[];
|
|
58
|
+
scopes: string;
|
|
59
|
+
description: string;
|
|
60
|
+
}): PostmanCollection;
|
|
61
|
+
/** OpenAPI `{id}` → Postman `:id`, without touching `{{variables}}`. */
|
|
62
|
+
export declare function openApiPathParamsToColon(url: string): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WorkspaceScaffold } from "../models/project.model.js";
|
|
2
|
+
export type WorkspaceReadmeOptions = {
|
|
3
|
+
add?: boolean;
|
|
4
|
+
databaseProvider?: "none" | "postgres/typeorm";
|
|
5
|
+
authProvider?: "auth0" | "none";
|
|
6
|
+
postmanProvider?: "api" | "local" | "none";
|
|
7
|
+
};
|
|
8
|
+
export type WorkspaceReadmeInput = {
|
|
9
|
+
projectName: string;
|
|
10
|
+
apiNames: readonly string[];
|
|
11
|
+
hasPostgres: boolean;
|
|
12
|
+
hasAuth0: boolean;
|
|
13
|
+
hasPostman: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** Pure renderer — keep feature sections short and copy-paste ready. */
|
|
16
|
+
export declare function renderWorkspaceReadme(input: WorkspaceReadmeInput): string;
|
|
17
|
+
export declare function resolveWorkspaceReadmeInput(workspace: WorkspaceScaffold, options: WorkspaceReadmeOptions): WorkspaceReadmeInput;
|
|
18
|
+
export declare function writeWorkspaceReadme(workspace: WorkspaceScaffold, options: WorkspaceReadmeOptions): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Action, ActionResponse } from "@decohere/nexus/cli";
|
|
2
|
+
export type WebapiOptions = {
|
|
3
|
+
directory?: string;
|
|
4
|
+
d?: string;
|
|
5
|
+
name?: string | string[];
|
|
6
|
+
database?: string;
|
|
7
|
+
auth?: string;
|
|
8
|
+
postman?: string;
|
|
9
|
+
yes?: boolean;
|
|
10
|
+
install?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare class WebapiAction implements Action<WebapiOptions> {
|
|
13
|
+
run(options: WebapiOptions): Promise<ActionResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DecohereCommand } from "@decohere/nexus/cli";
|
|
2
|
+
import { WebapiAction } from "./webapi.action.js";
|
|
3
|
+
export declare class WebapiCommand extends DecohereCommand {
|
|
4
|
+
get actions(): (typeof WebapiAction)[];
|
|
5
|
+
constructor(name: string);
|
|
6
|
+
/**
|
|
7
|
+
* Commander passes positional args before options when `[directory]` is declared.
|
|
8
|
+
* ModuleFactory expects `(opts, cmd)` — stash the directory on the command.
|
|
9
|
+
*/
|
|
10
|
+
action(fn: (...args: unknown[]) => void | Promise<void>): this;
|
|
11
|
+
}
|