@decohere/create 0.0.1-dev.48 → 0.0.1-dev.5
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 +9 -3
- package/commonjs/src/scaffold.js +48 -0
- package/commonjs/src/templates.js +64 -0
- package/es6/src/cli.js +9 -3
- package/es6/src/scaffold.js +38 -0
- package/es6/src/templates.js +40 -0
- package/package.json +3 -8
- package/types/src/scaffold.d.ts +4 -0
- package/types/src/templates.d.ts +4 -0
- 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/runner.js +0 -144
- package/commonjs/src/services/scaffold.service.js +0 -62
- package/commonjs/src/version.js +0 -50
- 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/runner.js +0 -146
- package/es6/src/services/scaffold.service.js +0 -52
- package/es6/src/version.js +0 -32
- 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/pack-builder-tgz.mjs +0 -177
- 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/runner.d.ts +0 -15
- package/types/src/services/scaffold.service.d.ts +0 -22
- package/types/src/version.d.ts +0 -4
- 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,72 +0,0 @@
|
|
|
1
|
-
/** Management API scopes needed for API, SPA, connections, and admin users. */
|
|
2
|
-
declare const REQUIRED_SCOPES: string;
|
|
3
|
-
/** Default API scopes matching Hello CASL Authorize decorators. */
|
|
4
|
-
export declare const HELLO_API_SCOPES: readonly ["read:Hello", "create:Hello", "update:Hello", "delete:Hello"];
|
|
5
|
-
export declare const DB_CONNECTION_NAME = "Username-Password-Authentication";
|
|
6
|
-
export declare class Auth0AuthError extends Error {
|
|
7
|
-
constructor(message: string);
|
|
8
|
-
}
|
|
9
|
-
export interface Auth0Tenant {
|
|
10
|
-
name: string;
|
|
11
|
-
active?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare function isInstalled(): boolean;
|
|
14
|
-
export declare function listTenants(): Auth0Tenant[];
|
|
15
|
-
export declare function login(): boolean;
|
|
16
|
-
export declare function listApis(): Array<{
|
|
17
|
-
identifier: string;
|
|
18
|
-
name: string;
|
|
19
|
-
}>;
|
|
20
|
-
export declare function createApi(name: string, identifier: string, scopes?: readonly string[]): {
|
|
21
|
-
identifier: string;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Replace an API's scopes and enable RBAC policy enforcement.
|
|
25
|
-
* Auth0 CLI `--scopes` replaces the full set.
|
|
26
|
-
*/
|
|
27
|
-
export declare function updateApiScopes(identifier: string, scopes?: readonly string[]): void;
|
|
28
|
-
export declare function createSpaApp(name: string, callbackUrls: string | readonly string[]): {
|
|
29
|
-
client_id: string;
|
|
30
|
-
};
|
|
31
|
-
export type Auth0App = {
|
|
32
|
-
client_id: string;
|
|
33
|
-
name: string;
|
|
34
|
-
};
|
|
35
|
-
export declare function listApps(): Auth0App[];
|
|
36
|
-
export declare function updateSpaCallbacks(clientId: string, callbackUrls: string | readonly string[]): void;
|
|
37
|
-
/**
|
|
38
|
-
* Create a Postman SPA, or reuse an existing app with the same name (re-scaffold).
|
|
39
|
-
* Always returns a client_id suitable for Postman auth0ClientId.
|
|
40
|
-
*/
|
|
41
|
-
export declare function ensureSpaApp(name: string, callbackUrls: string | readonly string[]): {
|
|
42
|
-
client_id: string;
|
|
43
|
-
reused: boolean;
|
|
44
|
-
};
|
|
45
|
-
/** Enable a database connection for an application (required for username/password login). */
|
|
46
|
-
export declare function enableConnectionForClient(connectionName: string, clientId: string): void;
|
|
47
|
-
export type AdminDatabaseUser = {
|
|
48
|
-
user_id: string;
|
|
49
|
-
email: string;
|
|
50
|
-
password: string;
|
|
51
|
-
username: string;
|
|
52
|
-
};
|
|
53
|
-
/** Strong default password when the scaffolder caller leaves password blank. */
|
|
54
|
-
export declare function generateAdminPassword(): string;
|
|
55
|
-
/** Look up a user by email (Management API users-by-email). */
|
|
56
|
-
export declare function findUserByEmail(email: string): {
|
|
57
|
-
user_id: string;
|
|
58
|
-
email: string;
|
|
59
|
-
} | null;
|
|
60
|
-
/** Reset password so a re-scaffold can write a known password to .env. */
|
|
61
|
-
export declare function updateUserPassword(userId: string, password: string): void;
|
|
62
|
-
/**
|
|
63
|
-
* Create a DB connection root-admin user for local / Postman login.
|
|
64
|
-
* If the user already exists, look them up, reset password to `input.password`,
|
|
65
|
-
* and return that identity so callers can still write .env credentials.
|
|
66
|
-
*/
|
|
67
|
-
export declare function createAdminDatabaseUser(input: {
|
|
68
|
-
email: string;
|
|
69
|
-
password: string;
|
|
70
|
-
username: string;
|
|
71
|
-
}): AdminDatabaseUser;
|
|
72
|
-
export { REQUIRED_SCOPES };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Feature } from "../../services/scaffold.service.js";
|
|
2
|
-
import { type Auth0Env } from "../postman/openapi-to-postman.js";
|
|
3
|
-
/** Postman OAuth callback URLs (popup + "Authorize using browser"). */
|
|
4
|
-
declare const POSTMAN_CALLBACKS: readonly ["https://oauth.pstmn.io/v1/callback", "https://oauth.pstmn.io/v1/browser-callback"];
|
|
5
|
-
/** Scopes requested for Auth0 access tokens (OIDC + Hello CASL permissions). */
|
|
6
|
-
declare const POSTMAN_SCOPES: string;
|
|
7
|
-
export type PostmanOptions = {
|
|
8
|
-
postmanProvider?: "api" | "local" | "none";
|
|
9
|
-
apiKey?: string;
|
|
10
|
-
workspaceId?: string;
|
|
11
|
-
};
|
|
12
|
-
/** Build Postman collection: OpenAPI routes + Auth0 auth overlay. */
|
|
13
|
-
export declare function buildHybridPostmanCollection(projectName: string, auth?: Auth0Env): Promise<import("../postman/openapi-to-postman.js").PostmanCollection>;
|
|
14
|
-
export declare const PostmanFeature: Feature<PostmanOptions>;
|
|
15
|
-
export { buildHelloOpenApiDocument } from "../postman/hello-openapi.js";
|
|
16
|
-
export { POSTMAN_CALLBACKS, POSTMAN_SCOPES };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { KeyedModel, SourceFile } from "../../models/source-file.js";
|
|
2
|
-
/**
|
|
3
|
-
* Builder for `projects/<api>/package.json`.
|
|
4
|
-
*
|
|
5
|
-
* Starts with the core cortex + crucible deps. Features can call
|
|
6
|
-
* `addDependency` / `addDevDependency` to extend.
|
|
7
|
-
*/
|
|
8
|
-
export declare class ApiPackageJson implements KeyedModel {
|
|
9
|
-
private readonly workspaceName;
|
|
10
|
-
private readonly apiName;
|
|
11
|
-
readonly key: string;
|
|
12
|
-
private readonly _dependencies;
|
|
13
|
-
private readonly _devDependencies;
|
|
14
|
-
constructor(workspaceName: string, apiName?: string);
|
|
15
|
-
addDependency(name: string, version: string): this;
|
|
16
|
-
addDevDependency(name: string, version: string): this;
|
|
17
|
-
files(): SourceFile[];
|
|
18
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { KeyedModel, SourceFile } from "../../models/source-file.js";
|
|
2
|
-
export type AdminUserConfig = {
|
|
3
|
-
sub: string;
|
|
4
|
-
email: string;
|
|
5
|
-
password: string;
|
|
6
|
-
username: string;
|
|
7
|
-
};
|
|
8
|
-
export type AuthConfig = {
|
|
9
|
-
issuerBaseUrl: string;
|
|
10
|
-
audience: string;
|
|
11
|
-
adminUser?: AdminUserConfig;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Data-carrier model for auth configuration.
|
|
15
|
-
*
|
|
16
|
-
* Registered by AuthFeature when auth0 is configured. Other features (e.g.
|
|
17
|
-
* PostmanFeature) retrieve it via workspace.getModel(WELL_KNOWN_FILES.AUTH_CONFIG).
|
|
18
|
-
* Produces no files — exists solely so features can communicate auth details.
|
|
19
|
-
*/
|
|
20
|
-
export declare class AuthConfigModel implements KeyedModel {
|
|
21
|
-
readonly config: AuthConfig;
|
|
22
|
-
readonly key: string;
|
|
23
|
-
constructor(config: AuthConfig);
|
|
24
|
-
setAdminUser(adminUser: AdminUserConfig): void;
|
|
25
|
-
files(): SourceFile[];
|
|
26
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { KeyedModel, SourceFile } from "../../models/source-file.js";
|
|
2
|
-
/**
|
|
3
|
-
* A controller method. Features call `addDecorator()` to prepend decorators
|
|
4
|
-
* before the HTTP verb decorator (e.g. `@AllowAnonymous` before `@Get()`).
|
|
5
|
-
*/
|
|
6
|
-
export declare class ControllerMethod {
|
|
7
|
-
readonly name: string;
|
|
8
|
-
private readonly _httpDecorator;
|
|
9
|
-
private readonly _params;
|
|
10
|
-
private readonly _extraDecorators;
|
|
11
|
-
private _body;
|
|
12
|
-
private _isAsync;
|
|
13
|
-
constructor(name: string, _httpDecorator: string, _params: string, isAsync: boolean, body: string[]);
|
|
14
|
-
addDecorator(decorator: string): this;
|
|
15
|
-
/** Replace the method body lines (used by features that extend generated behaviour). */
|
|
16
|
-
setBody(body: string[]): this;
|
|
17
|
-
setAsync(isAsync?: boolean): this;
|
|
18
|
-
render(): string[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Model for `projects/api/src/controllers/hello.controller.ts`.
|
|
22
|
-
*
|
|
23
|
-
* Pre-initialised with all routes and their HTTP decorators. Features mutate
|
|
24
|
-
* the model via `getMethod(name).addDecorator(...)`, `addDecorator(...)` (class
|
|
25
|
-
* level), `addCortexImport(...)`, `addImport(...)`, and `addConstructorParam(...)`.
|
|
26
|
-
*/
|
|
27
|
-
export declare class ControllerSourceFile implements KeyedModel {
|
|
28
|
-
readonly key: string;
|
|
29
|
-
private readonly _cortexImports;
|
|
30
|
-
private readonly _extraImportGroups;
|
|
31
|
-
private readonly _classDecorators;
|
|
32
|
-
private readonly _ctorParams;
|
|
33
|
-
private readonly _methods;
|
|
34
|
-
/** Retrieve a method by name to mutate its decorators. */
|
|
35
|
-
getMethod(name: string): ControllerMethod;
|
|
36
|
-
/** Add a class-level decorator (e.g. `@Authorize`). */
|
|
37
|
-
addDecorator(decorator: string): this;
|
|
38
|
-
/** Add a named import from `@decohere/cortex`. */
|
|
39
|
-
addCortexImport(name: string, typeOnly?: boolean): this;
|
|
40
|
-
/** Add a named import from any other module. */
|
|
41
|
-
addImport(name: string, from: string, typeOnly?: boolean): this;
|
|
42
|
-
/** Add a constructor parameter (e.g. an injected dependency). */
|
|
43
|
-
addConstructorParam(param: string): this;
|
|
44
|
-
files(): SourceFile[];
|
|
45
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { KeyedModel, SourceFile } from "../../models/source-file.js";
|
|
2
|
-
/**
|
|
3
|
-
* Minimal GitHub Actions for scaffolded apps: lint ∥ test, build gate on default branch,
|
|
4
|
-
* npm publish after CI (skips private packages). No default forge docker --push.
|
|
5
|
-
*/
|
|
6
|
-
export declare class GithubCiWorkflows implements KeyedModel {
|
|
7
|
-
readonly key: string;
|
|
8
|
-
files(): SourceFile[];
|
|
9
|
-
}
|
|
@@ -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;
|