@decohere/create 0.0.1-dev.48 → 0.0.1-dev.49
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/cli.js +3 -3
- package/commonjs/src/resolve-launch.js +53 -0
- package/commonjs/src/runner.js +5 -45
- package/commonjs/src/version.js +1 -1
- package/es6/src/cli.js +3 -3
- package/es6/src/resolve-launch.js +46 -0
- package/es6/src/runner.js +8 -57
- package/es6/src/version.js +3 -3
- package/pack-builder-tgz.mjs +1 -1
- package/package.json +4 -11
- package/types/src/resolve-launch.d.ts +10 -0
- package/types/src/runner.d.ts +3 -13
- package/types/src/version.d.ts +0 -2
- package/commonjs/src/domain/prompt.js +0 -64
- package/commonjs/src/models/compose.model.js +0 -138
- package/commonjs/src/models/config-yaml.model.js +0 -88
- package/commonjs/src/models/const.js +0 -31
- package/commonjs/src/models/dev-container.model.js +0 -100
- package/commonjs/src/models/docker-image.model.js +0 -221
- package/commonjs/src/models/env-file.model.js +0 -47
- package/commonjs/src/models/gitignore.model.js +0 -31
- package/commonjs/src/models/launch-json.model.js +0 -74
- package/commonjs/src/models/package-json.model.js +0 -133
- package/commonjs/src/models/project.model.js +0 -134
- package/commonjs/src/models/source-file.js +0 -6
- package/commonjs/src/models/tsconfig.model.js +0 -34
- package/commonjs/src/models/vscode-settings.model.js +0 -31
- package/commonjs/src/program.js +0 -135
- package/commonjs/src/resolve-target-dir.js +0 -19
- package/commonjs/src/services/scaffold.service.js +0 -62
- package/commonjs/src/webapi/api-name.js +0 -95
- package/commonjs/src/webapi/const.js +0 -50
- package/commonjs/src/webapi/create-api.js +0 -285
- package/commonjs/src/webapi/features/auth.feature.js +0 -463
- package/commonjs/src/webapi/features/auth0-cli.js +0 -406
- package/commonjs/src/webapi/features/biome-format.js +0 -49
- package/commonjs/src/webapi/features/database.feature.js +0 -273
- package/commonjs/src/webapi/features/finalize.feature.js +0 -91
- package/commonjs/src/webapi/features/postman.feature.js +0 -319
- package/commonjs/src/webapi/models/api-package-json.model.js +0 -63
- package/commonjs/src/webapi/models/auth-config.model.js +0 -26
- package/commonjs/src/webapi/models/controller-source-file.model.js +0 -188
- package/commonjs/src/webapi/models/github-ci.model.js +0 -193
- package/commonjs/src/webapi/models/main-source-file.model.js +0 -165
- package/commonjs/src/webapi/models/production-dockerfile.model.js +0 -138
- package/commonjs/src/webapi/models/sample-files.model.js +0 -60
- package/commonjs/src/webapi/models/webapi-image.model.js +0 -22
- package/commonjs/src/webapi/postman/hello-openapi.js +0 -175
- package/commonjs/src/webapi/postman/local-view.js +0 -184
- package/commonjs/src/webapi/postman/openapi-to-postman.js +0 -202
- package/es6/src/domain/prompt.js +0 -43
- package/es6/src/models/compose.model.js +0 -132
- package/es6/src/models/config-yaml.model.js +0 -76
- package/es6/src/models/const.js +0 -21
- package/es6/src/models/dev-container.model.js +0 -90
- package/es6/src/models/docker-image.model.js +0 -185
- package/es6/src/models/env-file.model.js +0 -43
- package/es6/src/models/gitignore.model.js +0 -21
- package/es6/src/models/launch-json.model.js +0 -64
- package/es6/src/models/package-json.model.js +0 -129
- package/es6/src/models/project.model.js +0 -119
- package/es6/src/models/source-file.js +0 -3
- package/es6/src/models/tsconfig.model.js +0 -24
- package/es6/src/models/vscode-settings.model.js +0 -21
- package/es6/src/program.js +0 -76
- package/es6/src/resolve-target-dir.js +0 -9
- package/es6/src/services/scaffold.service.js +0 -52
- package/es6/src/webapi/api-name.js +0 -59
- package/es6/src/webapi/const.js +0 -20
- package/es6/src/webapi/create-api.js +0 -265
- package/es6/src/webapi/features/auth.feature.js +0 -412
- package/es6/src/webapi/features/auth0-cli.js +0 -348
- package/es6/src/webapi/features/biome-format.js +0 -42
- package/es6/src/webapi/features/database.feature.js +0 -263
- package/es6/src/webapi/features/finalize.feature.js +0 -81
- package/es6/src/webapi/features/postman.feature.js +0 -253
- package/es6/src/webapi/models/api-package-json.model.js +0 -58
- package/es6/src/webapi/models/auth-config.model.js +0 -22
- package/es6/src/webapi/models/controller-source-file.model.js +0 -179
- package/es6/src/webapi/models/github-ci.model.js +0 -186
- package/es6/src/webapi/models/main-source-file.model.js +0 -161
- package/es6/src/webapi/models/production-dockerfile.model.js +0 -126
- package/es6/src/webapi/models/sample-files.model.js +0 -42
- package/es6/src/webapi/models/webapi-image.model.js +0 -12
- package/es6/src/webapi/postman/hello-openapi.js +0 -168
- package/es6/src/webapi/postman/local-view.js +0 -169
- package/es6/src/webapi/postman/openapi-to-postman.js +0 -179
- package/types/src/domain/prompt.d.ts +0 -4
- package/types/src/models/compose.model.d.ts +0 -59
- package/types/src/models/config-yaml.model.d.ts +0 -27
- package/types/src/models/const.d.ts +0 -19
- package/types/src/models/dev-container.model.d.ts +0 -33
- package/types/src/models/docker-image.model.d.ts +0 -56
- package/types/src/models/env-file.model.d.ts +0 -15
- package/types/src/models/gitignore.model.d.ts +0 -6
- package/types/src/models/launch-json.model.d.ts +0 -7
- package/types/src/models/package-json.model.d.ts +0 -32
- package/types/src/models/project.model.d.ts +0 -60
- package/types/src/models/source-file.d.ts +0 -11
- package/types/src/models/tsconfig.model.d.ts +0 -5
- package/types/src/models/vscode-settings.model.d.ts +0 -7
- package/types/src/program.d.ts +0 -3
- package/types/src/resolve-target-dir.d.ts +0 -5
- package/types/src/services/scaffold.service.d.ts +0 -22
- package/types/src/webapi/api-name.d.ts +0 -14
- package/types/src/webapi/const.d.ts +0 -17
- package/types/src/webapi/create-api.d.ts +0 -15
- package/types/src/webapi/features/auth.feature.d.ts +0 -10
- package/types/src/webapi/features/auth0-cli.d.ts +0 -72
- package/types/src/webapi/features/biome-format.d.ts +0 -5
- package/types/src/webapi/features/database.feature.d.ts +0 -5
- package/types/src/webapi/features/finalize.feature.d.ts +0 -2
- package/types/src/webapi/features/postman.feature.d.ts +0 -16
- package/types/src/webapi/models/api-package-json.model.d.ts +0 -18
- package/types/src/webapi/models/auth-config.model.d.ts +0 -26
- package/types/src/webapi/models/controller-source-file.model.d.ts +0 -45
- package/types/src/webapi/models/github-ci.model.d.ts +0 -9
- package/types/src/webapi/models/main-source-file.model.d.ts +0 -54
- package/types/src/webapi/models/production-dockerfile.model.d.ts +0 -20
- package/types/src/webapi/models/sample-files.model.d.ts +0 -7
- package/types/src/webapi/models/webapi-image.model.d.ts +0 -5
- package/types/src/webapi/postman/hello-openapi.d.ts +0 -19
- package/types/src/webapi/postman/local-view.d.ts +0 -17
- package/types/src/webapi/postman/openapi-to-postman.d.ts +0 -62
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { KeyedModel, SourceFile } from "../../models/source-file.js";
|
|
2
|
-
export type TypeOrmImport = {
|
|
3
|
-
className: string;
|
|
4
|
-
importPath: string;
|
|
5
|
-
};
|
|
6
|
-
export type ServiceImport = TypeOrmImport & {
|
|
7
|
-
scope?: "singleton" | "request";
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Model for `projects/api/src/main.ts`.
|
|
11
|
-
*
|
|
12
|
-
* Starts with the minimal HTTP + YAML config setup. Features mutate the model
|
|
13
|
-
* by calling addSideEffectImport / addImport / addBuilderCall / addEntity /
|
|
14
|
-
* addRepository. files() renders whatever has been accumulated.
|
|
15
|
-
*/
|
|
16
|
-
export declare class MainSourceFile implements KeyedModel {
|
|
17
|
-
private readonly appName;
|
|
18
|
-
readonly key: string;
|
|
19
|
-
private readonly _sideEffectImports;
|
|
20
|
-
private readonly _extraImports;
|
|
21
|
-
private readonly _builderCalls;
|
|
22
|
-
private readonly _entities;
|
|
23
|
-
private readonly _repositories;
|
|
24
|
-
private readonly _services;
|
|
25
|
-
private _dataSourceName;
|
|
26
|
-
private _typeOrmSeed;
|
|
27
|
-
constructor(appName: string);
|
|
28
|
-
/** Adds a bare side-effect import, e.g. `@decohere/cortex/auth`. */
|
|
29
|
-
addSideEffectImport(path: string): this;
|
|
30
|
-
/** Adds a named import, e.g. `import { Foo } from "bar"`. */
|
|
31
|
-
addImport(name: string, from: string, typeOnly?: boolean): this;
|
|
32
|
-
/**
|
|
33
|
-
* Adds a builder call inserted after `.withConfiguration()` and before
|
|
34
|
-
* `.withServices()`. Pass the call without leading dot, e.g. `.withAuth()`.
|
|
35
|
-
*/
|
|
36
|
-
addBuilderCall(call: string): this;
|
|
37
|
-
/** Adds a TypeORM entity — import and entry in `withTypeOrm({ entities })`. */
|
|
38
|
-
addEntity(entity: TypeOrmImport): this;
|
|
39
|
-
/** Adds a TypeORM repository — import and entry in `withTypeOrm({ repositories })`. */
|
|
40
|
-
addRepository(repo: TypeOrmImport): this;
|
|
41
|
-
/** Adds a service registered in `.withServices()`. */
|
|
42
|
-
addService(service: ServiceImport): this;
|
|
43
|
-
/**
|
|
44
|
-
* Datasource name passed to `withTypeOrm({ name })`. Must match
|
|
45
|
-
* `database.dataSources[].name` in config.yaml.
|
|
46
|
-
*/
|
|
47
|
-
setDataSourceName(name: string): this;
|
|
48
|
-
/**
|
|
49
|
-
* Inline seed callback body for `withTypeOrm({ seed })`.
|
|
50
|
-
* Receives `dataSource` in scope. Example: `await dataSource.getRepository(User).save(...)`.
|
|
51
|
-
*/
|
|
52
|
-
setTypeOrmSeed(seedBody: string): this;
|
|
53
|
-
files(): SourceFile[];
|
|
54
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { KeyedModel, SourceFile } from "../../models/source-file.js";
|
|
2
|
-
export type ProductionDockerfileOptions = {
|
|
3
|
-
/** When true, only write `Dockerfile.<name>` (existing workspace — do not replace root Dockerfile). */
|
|
4
|
-
namedOnly?: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Production Dockerfiles for PaaS (Railway/Fly) and local `docker build`.
|
|
8
|
-
*
|
|
9
|
-
* Context is always the **repo root** (`docker build -f Dockerfile.billing .`).
|
|
10
|
-
* Root `Dockerfile` is the first API (`pnpm start`). Extra or custom-named APIs
|
|
11
|
-
* also get `Dockerfile.<name>` so each service can be deployed on its own.
|
|
12
|
-
*/
|
|
13
|
-
export declare class WebapiProductionDockerfile implements KeyedModel {
|
|
14
|
-
private readonly apiNames;
|
|
15
|
-
private readonly options;
|
|
16
|
-
readonly key: string;
|
|
17
|
-
constructor(apiNames?: readonly string[], options?: ProductionDockerfileOptions);
|
|
18
|
-
files(): SourceFile[];
|
|
19
|
-
}
|
|
20
|
-
export declare function renderProductionDockerfile(apiName: string, startScript: string): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SourceFile, SourceFileProvider } from "../../models/source-file.js";
|
|
2
|
-
export declare class SampleConfigModel implements SourceFileProvider {
|
|
3
|
-
files(): SourceFile[];
|
|
4
|
-
}
|
|
5
|
-
export declare class SampleServiceModel implements SourceFileProvider {
|
|
6
|
-
files(): SourceFile[];
|
|
7
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** Minimal OpenAPI 3 document shape used for Postman conversion. */
|
|
2
|
-
export type ScaffoldOpenApiDocument = {
|
|
3
|
-
openapi: "3.0.3";
|
|
4
|
-
info: {
|
|
5
|
-
title: string;
|
|
6
|
-
version: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
};
|
|
9
|
-
servers?: Array<{
|
|
10
|
-
url: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
}>;
|
|
13
|
-
paths: Record<string, Record<string, unknown>>;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Canonical Hello WebAPI OpenAPI document used to generate Postman requests.
|
|
17
|
-
* Keep paths aligned with scaffolded HelloController (`/hello`, `/hello/{id}`).
|
|
18
|
-
*/
|
|
19
|
-
export declare function buildHelloOpenApiDocument(projectName: string): ScaffoldOpenApiDocument;
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}>;
|
|
@@ -1,62 +0,0 @@
|
|
|
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;
|