@decohere/scaffold 0.0.1-dev.115 → 0.0.1-dev.116
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 +1 -1
- package/commonjs/src/add-api.command.js +1 -1
- package/commonjs/src/add.command.js +1 -1
- package/commonjs/src/add.module.js +1 -1
- package/commonjs/src/auth0-configure.action.js +1 -1
- package/commonjs/src/auth0-configure.command.js +1 -1
- package/commonjs/src/auth0-login.action.js +1 -1
- package/commonjs/src/auth0-login.command.js +1 -1
- package/commonjs/src/auth0.command.js +1 -1
- package/commonjs/src/auth0.module.js +1 -1
- package/commonjs/src/create.command.js +1 -1
- package/commonjs/src/create.module.js +1 -1
- package/commonjs/src/models/package-json.model.js +3 -3
- package/commonjs/src/webapi/features/auth.feature.js +8 -8
- package/commonjs/src/webapi/features/database.feature.js +6 -6
- package/commonjs/src/webapi/features/finalize.feature.js +1 -1
- package/commonjs/src/webapi/models/api-package-json.model.js +1 -1
- package/commonjs/src/webapi/models/controller-source-file.model.js +2 -2
- package/commonjs/src/webapi/models/main-source-file.model.js +3 -3
- package/commonjs/src/webapi/models/sample-files.model.js +2 -2
- package/commonjs/src/webapi.action.js +1 -1
- package/commonjs/src/webapi.command.js +2 -2
- package/es6/src/add-api.action.js +1 -1
- package/es6/src/add-api.command.js +1 -1
- package/es6/src/add.command.js +1 -1
- package/es6/src/add.module.js +1 -1
- package/es6/src/auth0-configure.action.js +1 -1
- package/es6/src/auth0-configure.command.js +1 -1
- package/es6/src/auth0-login.action.js +1 -1
- package/es6/src/auth0-login.command.js +1 -1
- package/es6/src/auth0.command.js +1 -1
- package/es6/src/auth0.module.js +1 -1
- package/es6/src/create.command.js +1 -1
- package/es6/src/create.module.js +1 -1
- package/es6/src/models/package-json.model.js +3 -3
- package/es6/src/webapi/features/auth.feature.js +8 -8
- package/es6/src/webapi/features/database.feature.js +6 -6
- package/es6/src/webapi/features/finalize.feature.js +1 -1
- package/es6/src/webapi/models/api-package-json.model.js +2 -2
- package/es6/src/webapi/models/controller-source-file.model.js +2 -2
- package/es6/src/webapi/models/main-source-file.model.js +3 -3
- package/es6/src/webapi/models/sample-files.model.js +2 -2
- package/es6/src/webapi.action.js +1 -1
- package/es6/src/webapi.command.js +2 -2
- package/package.json +3 -3
- package/types/src/add-api.action.d.ts +1 -1
- package/types/src/add-api.command.d.ts +1 -1
- package/types/src/add.command.d.ts +2 -2
- package/types/src/add.module.d.ts +1 -1
- package/types/src/auth0-configure.action.d.ts +1 -1
- package/types/src/auth0-configure.command.d.ts +1 -1
- package/types/src/auth0-login.action.d.ts +1 -1
- package/types/src/auth0-login.command.d.ts +1 -1
- package/types/src/auth0.command.d.ts +2 -2
- package/types/src/auth0.module.d.ts +1 -1
- package/types/src/create.command.d.ts +2 -2
- package/types/src/create.module.d.ts +1 -1
- package/types/src/webapi/models/api-package-json.model.d.ts +1 -1
- package/types/src/webapi/models/controller-source-file.model.d.ts +1 -1
- package/types/src/webapi/models/main-source-file.model.d.ts +1 -1
- package/types/src/webapi.action.d.ts +1 -1
- package/types/src/webapi.command.d.ts +1 -1
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "AddApiAction", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const _cli = require("@decohere/
|
|
12
|
+
const _cli = require("@decohere/core/cli");
|
|
13
13
|
const _clioptions = require("./webapi/cli-options.js");
|
|
14
14
|
function _ts_decorate(decorators, target, key, desc) {
|
|
15
15
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "AddApiCommand", {
|
|
|
8
8
|
return AddApiCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _addapiaction = require("./add-api.action.js");
|
|
13
13
|
const _clioptions = require("./webapi/cli-options.js");
|
|
14
14
|
class AddApiCommand extends _cli.DecohereCommand {
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "AddCommand", {
|
|
|
8
8
|
return AddCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
class AddCommand extends _cli.DecohereCommand {
|
|
13
13
|
constructor(commands, handler){
|
|
14
14
|
super(AddCommand);
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "AddModule", {
|
|
|
8
8
|
return AddModule;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _addcommand = require("./add.command.js");
|
|
13
13
|
const _addapiaction = require("./add-api.action.js");
|
|
14
14
|
const _addapicommand = require("./add-api.command.js");
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "Auth0ConfigureAction", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const _cli = require("@decohere/
|
|
12
|
+
const _cli = require("@decohere/core/cli");
|
|
13
13
|
const _auth0commands = require("./webapi/auth0-commands.js");
|
|
14
14
|
function _ts_decorate(decorators, target, key, desc) {
|
|
15
15
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "Auth0ConfigureCommand", {
|
|
|
8
8
|
return Auth0ConfigureCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _auth0configureaction = require("./auth0-configure.action.js");
|
|
13
13
|
class Auth0ConfigureCommand extends _cli.DecohereCommand {
|
|
14
14
|
get actions() {
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "Auth0LoginAction", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const _cli = require("@decohere/
|
|
12
|
+
const _cli = require("@decohere/core/cli");
|
|
13
13
|
const _auth0commands = require("./webapi/auth0-commands.js");
|
|
14
14
|
function _ts_decorate(decorators, target, key, desc) {
|
|
15
15
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "Auth0LoginCommand", {
|
|
|
8
8
|
return Auth0LoginCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _auth0loginaction = require("./auth0-login.action.js");
|
|
13
13
|
class Auth0LoginCommand extends _cli.DecohereCommand {
|
|
14
14
|
get actions() {
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "Auth0Command", {
|
|
|
8
8
|
return Auth0Command;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
class Auth0Command extends _cli.DecohereCommand {
|
|
13
13
|
constructor(commands, handler){
|
|
14
14
|
super(Auth0Command);
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "Auth0Module", {
|
|
|
8
8
|
return Auth0Module;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _auth0command = require("./auth0.command.js");
|
|
13
13
|
const _auth0configureaction = require("./auth0-configure.action.js");
|
|
14
14
|
const _auth0configurecommand = require("./auth0-configure.command.js");
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "CreateCommand", {
|
|
|
8
8
|
return CreateCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
class CreateCommand extends _cli.DecohereCommand {
|
|
13
13
|
constructor(commands, handler){
|
|
14
14
|
super(CreateCommand);
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "CreateModule", {
|
|
|
8
8
|
return CreateModule;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _createcommand = require("./create.command.js");
|
|
13
13
|
const _webapiaction = require("./webapi.action.js");
|
|
14
14
|
const _webapicommand = require("./webapi.command.js");
|
|
@@ -58,10 +58,10 @@ class PackageJson {
|
|
|
58
58
|
this._scripts[`dev:${apiName}`] = fluxDevScript(workspaceName, apiName, (0, _const.webapiPort)(index));
|
|
59
59
|
}
|
|
60
60
|
this._dependencies = {
|
|
61
|
-
"@decohere/
|
|
61
|
+
"@decohere/http": _version.CREATE_VERSION,
|
|
62
62
|
"@decohere/crucible": _version.CREATE_VERSION,
|
|
63
|
-
"@decohere/
|
|
64
|
-
"@decohere/
|
|
63
|
+
"@decohere/core": _version.CREATE_VERSION,
|
|
64
|
+
"@decohere/config": _version.CREATE_VERSION,
|
|
65
65
|
"@decohere/scribe": _version.CREATE_VERSION,
|
|
66
66
|
"@decohere/scribe-pino": _version.CREATE_VERSION,
|
|
67
67
|
"pino-pretty": "^13.0.0",
|
|
@@ -57,7 +57,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
57
57
|
}
|
|
58
58
|
const ADMIN_ROLE = "admin";
|
|
59
59
|
const USER_ENTITY_TS = `import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
60
|
-
import type { Entity as IEntity } from "@decohere/
|
|
60
|
+
import type { Entity as IEntity } from "@decohere/data";
|
|
61
61
|
|
|
62
62
|
@Entity()
|
|
63
63
|
export class UserEntity implements IEntity {
|
|
@@ -79,8 +79,8 @@ export class UserEntity implements IEntity {
|
|
|
79
79
|
}
|
|
80
80
|
`;
|
|
81
81
|
const USER_REPOSITORY_TS = `import { injectable } from "@decohere/crucible/decorators";
|
|
82
|
-
import { injectUnitOfWork } from "@decohere/
|
|
83
|
-
import { TypeOrmRepository, TypeOrmUnitOfWork } from "@decohere/
|
|
82
|
+
import { injectUnitOfWork } from "@decohere/data";
|
|
83
|
+
import { TypeOrmRepository, TypeOrmUnitOfWork } from "@decohere/data-typeorm";
|
|
84
84
|
import { UserEntity } from "../entities/user.entity.js";
|
|
85
85
|
|
|
86
86
|
@injectable()
|
|
@@ -95,7 +95,7 @@ export class UserEntityRepository extends TypeOrmRepository<UserEntity> {
|
|
|
95
95
|
}
|
|
96
96
|
`;
|
|
97
97
|
const USER_SERVICE_TS = `import { injectable } from "@decohere/crucible/decorators";
|
|
98
|
-
import type { Principal } from "@decohere/
|
|
98
|
+
import type { Principal } from "@decohere/http";
|
|
99
99
|
import { UserEntity } from "../entities/user.entity.js";
|
|
100
100
|
import { UserEntityRepository } from "../repositories/user.repository.js";
|
|
101
101
|
|
|
@@ -150,17 +150,17 @@ export class UserService {
|
|
|
150
150
|
\t}
|
|
151
151
|
}
|
|
152
152
|
`;
|
|
153
|
-
const ABILITY_FACTORY_TS = `import type { Principal } from "@decohere/
|
|
153
|
+
const ABILITY_FACTORY_TS = `import type { Principal } from "@decohere/http";
|
|
154
154
|
import {
|
|
155
155
|
\tADMIN_ROLE,
|
|
156
156
|
\tcreatePrincipalFromPayload,
|
|
157
157
|
\tdefineAbilitiesFor as defaultDefineAbilitiesFor,
|
|
158
|
-
} from "@decohere/
|
|
158
|
+
} from "@decohere/http";
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
161
|
* Customize CASL authorization here (product-specific rules).
|
|
162
162
|
*
|
|
163
|
-
* Default delegates to
|
|
163
|
+
* Default delegates to \`@decohere/http\`: \`admin\` role → \`manage\`/\`all\`; IdP scopes
|
|
164
164
|
* (\`action:Subject\`) → abilities. Replace the body when you need app rules
|
|
165
165
|
* beyond that — this file is the intentional extension point, not framework
|
|
166
166
|
* infrastructure to copy.
|
|
@@ -376,7 +376,7 @@ function scaffold(workspace, options) {
|
|
|
376
376
|
controller.getMethod("remove").addDecorator(`@Authorize("delete", "${resource}")`);
|
|
377
377
|
}
|
|
378
378
|
for (const project of workspace.getProjects()){
|
|
379
|
-
project.getModel(_const.WELL_KNOWN_FILES.MAIN_TS)?.addSideEffectImport("@decohere/
|
|
379
|
+
project.getModel(_const.WELL_KNOWN_FILES.MAIN_TS)?.addSideEffectImport("@decohere/http/auth");
|
|
380
380
|
}
|
|
381
381
|
if (withLocalUsers) {
|
|
382
382
|
scaffoldLocalUserProfile(workspace);
|
|
@@ -130,7 +130,7 @@ ENTRYPOINT ["/usr/local/bin/decohere-postgres-entrypoint.sh"]
|
|
|
130
130
|
CMD ["postgres"]
|
|
131
131
|
`;
|
|
132
132
|
const SAMPLE_ENTITY_TS = `import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
133
|
-
import type { Entity as IEntity } from "@decohere/
|
|
133
|
+
import type { Entity as IEntity } from "@decohere/data";
|
|
134
134
|
|
|
135
135
|
@Entity()
|
|
136
136
|
export class SampleEntity implements IEntity {
|
|
@@ -142,8 +142,8 @@ export class SampleEntity implements IEntity {
|
|
|
142
142
|
}
|
|
143
143
|
`;
|
|
144
144
|
const SAMPLE_REPOSITORY_TS = `import { injectable } from "@decohere/crucible/decorators";
|
|
145
|
-
import { injectUnitOfWork } from "@decohere/
|
|
146
|
-
import { TypeOrmRepository, TypeOrmUnitOfWork } from "@decohere/
|
|
145
|
+
import { injectUnitOfWork } from "@decohere/data";
|
|
146
|
+
import { TypeOrmRepository, TypeOrmUnitOfWork } from "@decohere/data-typeorm";
|
|
147
147
|
import { SampleEntity } from "../entities/sample.entity.js";
|
|
148
148
|
|
|
149
149
|
@injectable()
|
|
@@ -346,7 +346,7 @@ function scaffold(workspace, options) {
|
|
|
346
346
|
}
|
|
347
347
|
devContainer?.addExtension("mtxr.sqltools", "mtxr.sqltools-driver-pg");
|
|
348
348
|
workspace.getModel(_const.WELL_KNOWN_FILES.DOCKERFILE)?.addLayer((0, _dockerimagemodel.withPostgresqlClient)());
|
|
349
|
-
const pkg = workspace.getModel(_const.WELL_KNOWN_FILES.PACKAGE_JSON)?.addDependency("@decohere/
|
|
349
|
+
const pkg = workspace.getModel(_const.WELL_KNOWN_FILES.PACKAGE_JSON)?.addDependency("@decohere/data", _version.CREATE_VERSION).addDependency("typeorm", "^0.3.28").addDependency("@decohere/data-typeorm", _version.CREATE_VERSION).addDependency("tsx", "^4.20.5").addScript("db:up", "docker compose -f .devcontainer/docker-compose.yml up -d postgres").addScript("db:down", "docker compose -f .devcontainer/docker-compose.yml down").addScript("db:reset", DB_RESET_SCRIPT);
|
|
350
350
|
const primaryApi = apiNames[0];
|
|
351
351
|
if (pkg != null) {
|
|
352
352
|
for (const apiName of apiNames){
|
|
@@ -397,14 +397,14 @@ function writeApiDatabaseEnv(workspace, ident, apiName) {
|
|
|
397
397
|
}
|
|
398
398
|
function wireApiDatabase(project) {
|
|
399
399
|
const apiName = (0, _apiname.apiNameFromProjectDir)(project.dir);
|
|
400
|
-
project.getModel(_const.WELL_KNOWN_FILES.MAIN_TS)?.setDataSourceName(apiName).addSideEffectImport("@decohere/
|
|
400
|
+
project.getModel(_const.WELL_KNOWN_FILES.MAIN_TS)?.setDataSourceName(apiName).addSideEffectImport("@decohere/data-typeorm").addEntity({
|
|
401
401
|
className: "SampleEntity",
|
|
402
402
|
importPath: "./entities/sample.entity.js"
|
|
403
403
|
}).addRepository({
|
|
404
404
|
className: "SampleEntityRepository",
|
|
405
405
|
importPath: "./repositories/sample.repository.js"
|
|
406
406
|
});
|
|
407
|
-
project.getModel(_const.WELL_KNOWN_FILES.API_PACKAGE_JSON)?.addDependency("@decohere/
|
|
407
|
+
project.getModel(_const.WELL_KNOWN_FILES.API_PACKAGE_JSON)?.addDependency("@decohere/data", _version.CREATE_VERSION).addDependency("@decohere/data-typeorm", _version.CREATE_VERSION);
|
|
408
408
|
project.addFile({
|
|
409
409
|
files: ()=>[
|
|
410
410
|
{
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "FinalizeFeature", {
|
|
|
10
10
|
});
|
|
11
11
|
const _nodefs = require("node:fs");
|
|
12
12
|
const _nodepath = require("node:path");
|
|
13
|
-
const _interop = require("@decohere/
|
|
13
|
+
const _interop = require("@decohere/core/interop");
|
|
14
14
|
const _prompt = require("../../domain/prompt.js");
|
|
15
15
|
const _const = require("../../models/const.js");
|
|
16
16
|
const _workspacereadme = require("../workspace-readme.js");
|
|
@@ -21,7 +21,7 @@ class ApiPackageJson {
|
|
|
21
21
|
this.workspaceName = workspaceName;
|
|
22
22
|
this.apiName = apiName;
|
|
23
23
|
this._dependencies = {
|
|
24
|
-
"@decohere/
|
|
24
|
+
"@decohere/http": _version.CREATE_VERSION,
|
|
25
25
|
"@decohere/crucible": _version.CREATE_VERSION
|
|
26
26
|
};
|
|
27
27
|
}
|
|
@@ -143,7 +143,7 @@ class ControllerSourceFile {
|
|
|
143
143
|
this._classDecorators.push(decorator);
|
|
144
144
|
return this;
|
|
145
145
|
}
|
|
146
|
-
/** Add a named import from `@decohere/
|
|
146
|
+
/** Add a named import from `@decohere/http`. */ addCortexImport(name, typeOnly = false) {
|
|
147
147
|
this._cortexImports.add(name, typeOnly);
|
|
148
148
|
return this;
|
|
149
149
|
}
|
|
@@ -159,7 +159,7 @@ class ControllerSourceFile {
|
|
|
159
159
|
}
|
|
160
160
|
files() {
|
|
161
161
|
const lines = [
|
|
162
|
-
this._cortexImports.render("@decohere/
|
|
162
|
+
this._cortexImports.render("@decohere/http"),
|
|
163
163
|
'import { SampleService } from "../services/sample.service.js";'
|
|
164
164
|
];
|
|
165
165
|
for (const [from, group] of this._extraImportGroups){
|
|
@@ -53,7 +53,7 @@ class MainSourceFile {
|
|
|
53
53
|
constructor(appName){
|
|
54
54
|
this.appName = appName;
|
|
55
55
|
}
|
|
56
|
-
/** Adds a bare side-effect import, e.g. `@decohere/
|
|
56
|
+
/** Adds a bare side-effect import, e.g. `@decohere/http/auth`. */ addSideEffectImport(path) {
|
|
57
57
|
if (!this._sideEffectImports.includes(path)) this._sideEffectImports.push(path);
|
|
58
58
|
return this;
|
|
59
59
|
}
|
|
@@ -99,12 +99,12 @@ class MainSourceFile {
|
|
|
99
99
|
files() {
|
|
100
100
|
const imports = [
|
|
101
101
|
'import "@decohere/scribe-pino";',
|
|
102
|
-
'import "@decohere/
|
|
102
|
+
'import "@decohere/http/http";'
|
|
103
103
|
];
|
|
104
104
|
for (const path of this._sideEffectImports){
|
|
105
105
|
imports.push(`import "${path}";`);
|
|
106
106
|
}
|
|
107
|
-
imports.push('import "@decohere/
|
|
107
|
+
imports.push('import "@decohere/config";', 'import { YamlDataSource } from "@decohere/config";', 'import { Builder } from "@decohere/http";', 'import { FastifyProvider } from "@decohere/http/providers";', 'import { scribe } from "@decohere/scribe";', 'import { SampleService } from "./services/sample.service.js";');
|
|
108
108
|
for (const e of this._entities){
|
|
109
109
|
imports.push(`import { ${e.className} } from "${e.importPath}";`);
|
|
110
110
|
}
|
|
@@ -19,8 +19,8 @@ _export(exports, {
|
|
|
19
19
|
const SAMPLE_CONFIG_CONTENT = `export class SampleConfig {\n\tpublic greeting: string = "";\n}\n`;
|
|
20
20
|
const SAMPLE_SERVICE_CONTENT = [
|
|
21
21
|
`import { inject, injectable } from "@decohere/crucible/decorators";`,
|
|
22
|
-
`import { ConfigurationServiceToken } from "@decohere/
|
|
23
|
-
`import type { IConfigurationService } from "@decohere/
|
|
22
|
+
`import { ConfigurationServiceToken } from "@decohere/core/configuration";`,
|
|
23
|
+
`import type { IConfigurationService } from "@decohere/core/configuration";`,
|
|
24
24
|
`import { SampleConfig } from "../sample.config.js";`,
|
|
25
25
|
``,
|
|
26
26
|
`@injectable()`,
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "WebapiAction", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const _cli = require("@decohere/
|
|
12
|
+
const _cli = require("@decohere/core/cli");
|
|
13
13
|
const _clioptions = require("./webapi/cli-options.js");
|
|
14
14
|
function _ts_decorate(decorators, target, key, desc) {
|
|
15
15
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "WebapiCommand", {
|
|
|
8
8
|
return WebapiCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _clioptions = require("./webapi/cli-options.js");
|
|
13
13
|
const _webapiaction = require("./webapi.action.js");
|
|
14
14
|
class WebapiCommand extends _cli.DecohereCommand {
|
|
@@ -19,7 +19,7 @@ class WebapiCommand extends _cli.DecohereCommand {
|
|
|
19
19
|
}
|
|
20
20
|
constructor(name){
|
|
21
21
|
super(name);
|
|
22
|
-
this.description("Scaffold a
|
|
22
|
+
this.description("Scaffold a web API workspace");
|
|
23
23
|
this.argument("[directory]", "Target directory (default: -d or current directory)");
|
|
24
24
|
this.option("-d <directory>", "Target directory (default: current directory)", ".");
|
|
25
25
|
this.option("--name <slug>", "API name under projects/ (repeatable; default: api)", _clioptions.collectName, []);
|
|
@@ -5,7 +5,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
}
|
|
7
7
|
import { injectable } from "@decohere/crucible/decorators";
|
|
8
|
-
import { ActionResponse } from "@decohere/
|
|
8
|
+
import { ActionResponse } from "@decohere/core/cli";
|
|
9
9
|
import { runScaffoldApi, toApiOptions } from "./webapi/cli-options.js";
|
|
10
10
|
export class AddApiAction {
|
|
11
11
|
async run(options) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DecohereCommand } from "@decohere/
|
|
1
|
+
import { DecohereCommand } from "@decohere/core/cli";
|
|
2
2
|
import { AddApiAction } from "./add-api.action.js";
|
|
3
3
|
import { addWebapiFeatureOptions } from "./webapi/cli-options.js";
|
|
4
4
|
export class AddApiCommand extends DecohereCommand {
|
package/es6/src/add.command.js
CHANGED
package/es6/src/add.module.js
CHANGED
|
@@ -5,7 +5,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
}
|
|
7
7
|
import { injectable } from "@decohere/crucible/decorators";
|
|
8
|
-
import { ActionResponse } from "@decohere/
|
|
8
|
+
import { ActionResponse } from "@decohere/core/cli";
|
|
9
9
|
import { runAuth0Configure } from "./webapi/auth0-commands.js";
|
|
10
10
|
export class Auth0ConfigureAction {
|
|
11
11
|
async run(options) {
|
|
@@ -5,7 +5,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
}
|
|
7
7
|
import { injectable } from "@decohere/crucible/decorators";
|
|
8
|
-
import { ActionResponse } from "@decohere/
|
|
8
|
+
import { ActionResponse } from "@decohere/core/cli";
|
|
9
9
|
import { runAuth0Login } from "./webapi/auth0-commands.js";
|
|
10
10
|
export class Auth0LoginAction {
|
|
11
11
|
async run() {
|
package/es6/src/auth0.command.js
CHANGED
package/es6/src/auth0.module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleManifest } from "@decohere/
|
|
1
|
+
import { ModuleManifest } from "@decohere/core/cli";
|
|
2
2
|
import { Auth0Command } from "./auth0.command.js";
|
|
3
3
|
import { Auth0ConfigureAction } from "./auth0-configure.action.js";
|
|
4
4
|
import { Auth0ConfigureCommand } from "./auth0-configure.command.js";
|
package/es6/src/create.module.js
CHANGED
|
@@ -43,10 +43,10 @@ import { WELL_KNOWN_FILES } from "./const.js";
|
|
|
43
43
|
this._scripts[`dev:${apiName}`] = fluxDevScript(workspaceName, apiName, webapiPort(index));
|
|
44
44
|
}
|
|
45
45
|
this._dependencies = {
|
|
46
|
-
"@decohere/
|
|
46
|
+
"@decohere/http": CREATE_VERSION,
|
|
47
47
|
"@decohere/crucible": CREATE_VERSION,
|
|
48
|
-
"@decohere/
|
|
49
|
-
"@decohere/
|
|
48
|
+
"@decohere/core": CREATE_VERSION,
|
|
49
|
+
"@decohere/config": CREATE_VERSION,
|
|
50
50
|
"@decohere/scribe": CREATE_VERSION,
|
|
51
51
|
"@decohere/scribe-pino": CREATE_VERSION,
|
|
52
52
|
"pino-pretty": "^13.0.0",
|
|
@@ -6,7 +6,7 @@ import { ControllerSourceFile } from "../models/controller-source-file.model.js"
|
|
|
6
6
|
import * as auth0Cli from "./auth0-cli.js";
|
|
7
7
|
const ADMIN_ROLE = "admin";
|
|
8
8
|
const USER_ENTITY_TS = `import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
9
|
-
import type { Entity as IEntity } from "@decohere/
|
|
9
|
+
import type { Entity as IEntity } from "@decohere/data";
|
|
10
10
|
|
|
11
11
|
@Entity()
|
|
12
12
|
export class UserEntity implements IEntity {
|
|
@@ -28,8 +28,8 @@ export class UserEntity implements IEntity {
|
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
30
30
|
const USER_REPOSITORY_TS = `import { injectable } from "@decohere/crucible/decorators";
|
|
31
|
-
import { injectUnitOfWork } from "@decohere/
|
|
32
|
-
import { TypeOrmRepository, TypeOrmUnitOfWork } from "@decohere/
|
|
31
|
+
import { injectUnitOfWork } from "@decohere/data";
|
|
32
|
+
import { TypeOrmRepository, TypeOrmUnitOfWork } from "@decohere/data-typeorm";
|
|
33
33
|
import { UserEntity } from "../entities/user.entity.js";
|
|
34
34
|
|
|
35
35
|
@injectable()
|
|
@@ -44,7 +44,7 @@ export class UserEntityRepository extends TypeOrmRepository<UserEntity> {
|
|
|
44
44
|
}
|
|
45
45
|
`;
|
|
46
46
|
const USER_SERVICE_TS = `import { injectable } from "@decohere/crucible/decorators";
|
|
47
|
-
import type { Principal } from "@decohere/
|
|
47
|
+
import type { Principal } from "@decohere/http";
|
|
48
48
|
import { UserEntity } from "../entities/user.entity.js";
|
|
49
49
|
import { UserEntityRepository } from "../repositories/user.repository.js";
|
|
50
50
|
|
|
@@ -99,17 +99,17 @@ export class UserService {
|
|
|
99
99
|
\t}
|
|
100
100
|
}
|
|
101
101
|
`;
|
|
102
|
-
const ABILITY_FACTORY_TS = `import type { Principal } from "@decohere/
|
|
102
|
+
const ABILITY_FACTORY_TS = `import type { Principal } from "@decohere/http";
|
|
103
103
|
import {
|
|
104
104
|
\tADMIN_ROLE,
|
|
105
105
|
\tcreatePrincipalFromPayload,
|
|
106
106
|
\tdefineAbilitiesFor as defaultDefineAbilitiesFor,
|
|
107
|
-
} from "@decohere/
|
|
107
|
+
} from "@decohere/http";
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Customize CASL authorization here (product-specific rules).
|
|
111
111
|
*
|
|
112
|
-
* Default delegates to
|
|
112
|
+
* Default delegates to \`@decohere/http\`: \`admin\` role → \`manage\`/\`all\`; IdP scopes
|
|
113
113
|
* (\`action:Subject\`) → abilities. Replace the body when you need app rules
|
|
114
114
|
* beyond that — this file is the intentional extension point, not framework
|
|
115
115
|
* infrastructure to copy.
|
|
@@ -325,7 +325,7 @@ function scaffold(workspace, options) {
|
|
|
325
325
|
controller.getMethod("remove").addDecorator(`@Authorize("delete", "${resource}")`);
|
|
326
326
|
}
|
|
327
327
|
for (const project of workspace.getProjects()){
|
|
328
|
-
project.getModel(WELL_KNOWN_FILES.MAIN_TS)?.addSideEffectImport("@decohere/
|
|
328
|
+
project.getModel(WELL_KNOWN_FILES.MAIN_TS)?.addSideEffectImport("@decohere/http/auth");
|
|
329
329
|
}
|
|
330
330
|
if (withLocalUsers) {
|
|
331
331
|
scaffoldLocalUserProfile(workspace);
|
|
@@ -120,7 +120,7 @@ ENTRYPOINT ["/usr/local/bin/decohere-postgres-entrypoint.sh"]
|
|
|
120
120
|
CMD ["postgres"]
|
|
121
121
|
`;
|
|
122
122
|
const SAMPLE_ENTITY_TS = `import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
123
|
-
import type { Entity as IEntity } from "@decohere/
|
|
123
|
+
import type { Entity as IEntity } from "@decohere/data";
|
|
124
124
|
|
|
125
125
|
@Entity()
|
|
126
126
|
export class SampleEntity implements IEntity {
|
|
@@ -132,8 +132,8 @@ export class SampleEntity implements IEntity {
|
|
|
132
132
|
}
|
|
133
133
|
`;
|
|
134
134
|
const SAMPLE_REPOSITORY_TS = `import { injectable } from "@decohere/crucible/decorators";
|
|
135
|
-
import { injectUnitOfWork } from "@decohere/
|
|
136
|
-
import { TypeOrmRepository, TypeOrmUnitOfWork } from "@decohere/
|
|
135
|
+
import { injectUnitOfWork } from "@decohere/data";
|
|
136
|
+
import { TypeOrmRepository, TypeOrmUnitOfWork } from "@decohere/data-typeorm";
|
|
137
137
|
import { SampleEntity } from "../entities/sample.entity.js";
|
|
138
138
|
|
|
139
139
|
@injectable()
|
|
@@ -336,7 +336,7 @@ function scaffold(workspace, options) {
|
|
|
336
336
|
}
|
|
337
337
|
devContainer?.addExtension("mtxr.sqltools", "mtxr.sqltools-driver-pg");
|
|
338
338
|
workspace.getModel(WELL_KNOWN_FILES.DOCKERFILE)?.addLayer(withPostgresqlClient());
|
|
339
|
-
const pkg = workspace.getModel(WELL_KNOWN_FILES.PACKAGE_JSON)?.addDependency("@decohere/
|
|
339
|
+
const pkg = workspace.getModel(WELL_KNOWN_FILES.PACKAGE_JSON)?.addDependency("@decohere/data", CREATE_VERSION).addDependency("typeorm", "^0.3.28").addDependency("@decohere/data-typeorm", CREATE_VERSION).addDependency("tsx", "^4.20.5").addScript("db:up", "docker compose -f .devcontainer/docker-compose.yml up -d postgres").addScript("db:down", "docker compose -f .devcontainer/docker-compose.yml down").addScript("db:reset", DB_RESET_SCRIPT);
|
|
340
340
|
const primaryApi = apiNames[0];
|
|
341
341
|
if (pkg != null) {
|
|
342
342
|
for (const apiName of apiNames){
|
|
@@ -387,14 +387,14 @@ function writeApiDatabaseEnv(workspace, ident, apiName) {
|
|
|
387
387
|
}
|
|
388
388
|
function wireApiDatabase(project) {
|
|
389
389
|
const apiName = apiNameFromProjectDir(project.dir);
|
|
390
|
-
project.getModel(WELL_KNOWN_FILES.MAIN_TS)?.setDataSourceName(apiName).addSideEffectImport("@decohere/
|
|
390
|
+
project.getModel(WELL_KNOWN_FILES.MAIN_TS)?.setDataSourceName(apiName).addSideEffectImport("@decohere/data-typeorm").addEntity({
|
|
391
391
|
className: "SampleEntity",
|
|
392
392
|
importPath: "./entities/sample.entity.js"
|
|
393
393
|
}).addRepository({
|
|
394
394
|
className: "SampleEntityRepository",
|
|
395
395
|
importPath: "./repositories/sample.repository.js"
|
|
396
396
|
});
|
|
397
|
-
project.getModel(WELL_KNOWN_FILES.API_PACKAGE_JSON)?.addDependency("@decohere/
|
|
397
|
+
project.getModel(WELL_KNOWN_FILES.API_PACKAGE_JSON)?.addDependency("@decohere/data", CREATE_VERSION).addDependency("@decohere/data-typeorm", CREATE_VERSION);
|
|
398
398
|
project.addFile({
|
|
399
399
|
files: ()=>[
|
|
400
400
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { detectPackageManager, promptForPackageManager } from "@decohere/
|
|
3
|
+
import { detectPackageManager, promptForPackageManager } from "@decohere/core/interop";
|
|
4
4
|
import { ask, closePrompt } from "../../domain/prompt.js";
|
|
5
5
|
import { WELL_KNOWN_FILES } from "../../models/const.js";
|
|
6
6
|
import { writeWorkspaceReadme } from "../workspace-readme.js";
|
|
@@ -4,7 +4,7 @@ import { CREATE_VERSION } from "../../version.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Builder for `projects/<api>/package.json`.
|
|
6
6
|
*
|
|
7
|
-
* Starts with the core
|
|
7
|
+
* Starts with the core `@decohere/http` + `@decohere/crucible` deps. Features can call
|
|
8
8
|
* `addDependency` / `addDevDependency` to extend.
|
|
9
9
|
*/ export class ApiPackageJson {
|
|
10
10
|
workspaceName;
|
|
@@ -16,7 +16,7 @@ import { CREATE_VERSION } from "../../version.js";
|
|
|
16
16
|
this.workspaceName = workspaceName;
|
|
17
17
|
this.apiName = apiName;
|
|
18
18
|
this._dependencies = {
|
|
19
|
-
"@decohere/
|
|
19
|
+
"@decohere/http": CREATE_VERSION,
|
|
20
20
|
"@decohere/crucible": CREATE_VERSION
|
|
21
21
|
};
|
|
22
22
|
}
|
|
@@ -134,7 +134,7 @@ import { WELL_KNOWN_FILES } from "../../models/const.js";
|
|
|
134
134
|
this._classDecorators.push(decorator);
|
|
135
135
|
return this;
|
|
136
136
|
}
|
|
137
|
-
/** Add a named import from `@decohere/
|
|
137
|
+
/** Add a named import from `@decohere/http`. */ addCortexImport(name, typeOnly = false) {
|
|
138
138
|
this._cortexImports.add(name, typeOnly);
|
|
139
139
|
return this;
|
|
140
140
|
}
|
|
@@ -150,7 +150,7 @@ import { WELL_KNOWN_FILES } from "../../models/const.js";
|
|
|
150
150
|
}
|
|
151
151
|
files() {
|
|
152
152
|
const lines = [
|
|
153
|
-
this._cortexImports.render("@decohere/
|
|
153
|
+
this._cortexImports.render("@decohere/http"),
|
|
154
154
|
'import { SampleService } from "../services/sample.service.js";'
|
|
155
155
|
];
|
|
156
156
|
for (const [from, group] of this._extraImportGroups){
|
|
@@ -49,7 +49,7 @@ import { WELL_KNOWN_FILES } from "../../models/const.js";
|
|
|
49
49
|
constructor(appName){
|
|
50
50
|
this.appName = appName;
|
|
51
51
|
}
|
|
52
|
-
/** Adds a bare side-effect import, e.g. `@decohere/
|
|
52
|
+
/** Adds a bare side-effect import, e.g. `@decohere/http/auth`. */ addSideEffectImport(path) {
|
|
53
53
|
if (!this._sideEffectImports.includes(path)) this._sideEffectImports.push(path);
|
|
54
54
|
return this;
|
|
55
55
|
}
|
|
@@ -95,12 +95,12 @@ import { WELL_KNOWN_FILES } from "../../models/const.js";
|
|
|
95
95
|
files() {
|
|
96
96
|
const imports = [
|
|
97
97
|
'import "@decohere/scribe-pino";',
|
|
98
|
-
'import "@decohere/
|
|
98
|
+
'import "@decohere/http/http";'
|
|
99
99
|
];
|
|
100
100
|
for (const path of this._sideEffectImports){
|
|
101
101
|
imports.push(`import "${path}";`);
|
|
102
102
|
}
|
|
103
|
-
imports.push('import "@decohere/
|
|
103
|
+
imports.push('import "@decohere/config";', 'import { YamlDataSource } from "@decohere/config";', 'import { Builder } from "@decohere/http";', 'import { FastifyProvider } from "@decohere/http/providers";', 'import { scribe } from "@decohere/scribe";', 'import { SampleService } from "./services/sample.service.js";');
|
|
104
104
|
for (const e of this._entities){
|
|
105
105
|
imports.push(`import { ${e.className} } from "${e.importPath}";`);
|
|
106
106
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const SAMPLE_CONFIG_CONTENT = `export class SampleConfig {\n\tpublic greeting: string = "";\n}\n`;
|
|
2
2
|
const SAMPLE_SERVICE_CONTENT = [
|
|
3
3
|
`import { inject, injectable } from "@decohere/crucible/decorators";`,
|
|
4
|
-
`import { ConfigurationServiceToken } from "@decohere/
|
|
5
|
-
`import type { IConfigurationService } from "@decohere/
|
|
4
|
+
`import { ConfigurationServiceToken } from "@decohere/core/configuration";`,
|
|
5
|
+
`import type { IConfigurationService } from "@decohere/core/configuration";`,
|
|
6
6
|
`import { SampleConfig } from "../sample.config.js";`,
|
|
7
7
|
``,
|
|
8
8
|
`@injectable()`,
|
package/es6/src/webapi.action.js
CHANGED
|
@@ -5,7 +5,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
}
|
|
7
7
|
import { injectable } from "@decohere/crucible/decorators";
|
|
8
|
-
import { ActionResponse } from "@decohere/
|
|
8
|
+
import { ActionResponse } from "@decohere/core/cli";
|
|
9
9
|
import { runScaffoldApi, toApiOptions } from "./webapi/cli-options.js";
|
|
10
10
|
export class WebapiAction {
|
|
11
11
|
async run(options) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DecohereCommand } from "@decohere/
|
|
1
|
+
import { DecohereCommand } from "@decohere/core/cli";
|
|
2
2
|
import { addWebapiFeatureOptions, collectName } from "./webapi/cli-options.js";
|
|
3
3
|
import { WebapiAction } from "./webapi.action.js";
|
|
4
4
|
export class WebapiCommand extends DecohereCommand {
|
|
@@ -9,7 +9,7 @@ export class WebapiCommand extends DecohereCommand {
|
|
|
9
9
|
}
|
|
10
10
|
constructor(name){
|
|
11
11
|
super(name);
|
|
12
|
-
this.description("Scaffold a
|
|
12
|
+
this.description("Scaffold a web API workspace");
|
|
13
13
|
this.argument("[directory]", "Target directory (default: -d or current directory)");
|
|
14
14
|
this.option("-d <directory>", "Target directory (default: current directory)", ".");
|
|
15
15
|
this.option("--name <slug>", "API name under projects/ (repeatable; default: api)", collectName, []);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decohere/scaffold",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.116",
|
|
4
4
|
"description": "Decohere project scaffolder (runs inside ghcr.io/typesmiths/decohere/create)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"decohere",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@decohere/
|
|
26
|
-
"@decohere/
|
|
25
|
+
"@decohere/core": "0.0.1-dev.116",
|
|
26
|
+
"@decohere/crucible": "0.0.1-dev.116",
|
|
27
27
|
"commander": "^13.1.0",
|
|
28
28
|
"openapi-to-postmanv2": "^5.0.0",
|
|
29
29
|
"yaml": "^2.9.1"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Actions } from "@decohere/
|
|
2
|
-
import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/
|
|
1
|
+
import type { Actions } from "@decohere/core/cli";
|
|
2
|
+
import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/core/cli";
|
|
3
3
|
export declare class AddCommand extends DecohereCommand {
|
|
4
4
|
constructor(commands: Record<string, CommandType>, handler: CommandHandler);
|
|
5
5
|
run(_actions: Actions, _options: never): Promise<CommandResponse>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DecohereCommand } from "@decohere/
|
|
1
|
+
import { DecohereCommand } from "@decohere/core/cli";
|
|
2
2
|
import { Auth0ConfigureAction } from "./auth0-configure.action.js";
|
|
3
3
|
export declare class Auth0ConfigureCommand extends DecohereCommand {
|
|
4
4
|
get actions(): (typeof Auth0ConfigureAction)[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DecohereCommand } from "@decohere/
|
|
1
|
+
import { DecohereCommand } from "@decohere/core/cli";
|
|
2
2
|
import { Auth0LoginAction } from "./auth0-login.action.js";
|
|
3
3
|
export declare class Auth0LoginCommand extends DecohereCommand {
|
|
4
4
|
get actions(): (typeof Auth0LoginAction)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Actions } from "@decohere/
|
|
2
|
-
import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/
|
|
1
|
+
import type { Actions } from "@decohere/core/cli";
|
|
2
|
+
import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/core/cli";
|
|
3
3
|
export declare class Auth0Command extends DecohereCommand {
|
|
4
4
|
constructor(commands: Record<string, CommandType>, handler: CommandHandler);
|
|
5
5
|
run(_actions: Actions, _options: never): Promise<CommandResponse>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleManifest } from "@decohere/
|
|
1
|
+
import { ModuleManifest } from "@decohere/core/cli";
|
|
2
2
|
import { Auth0Command } from "./auth0.command.js";
|
|
3
3
|
import { Auth0ConfigureAction } from "./auth0-configure.action.js";
|
|
4
4
|
import { Auth0ConfigureCommand } from "./auth0-configure.command.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Actions } from "@decohere/
|
|
2
|
-
import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/
|
|
1
|
+
import type { Actions } from "@decohere/core/cli";
|
|
2
|
+
import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/core/cli";
|
|
3
3
|
export declare class CreateCommand extends DecohereCommand {
|
|
4
4
|
constructor(commands: Record<string, CommandType>, handler: CommandHandler);
|
|
5
5
|
run(_actions: Actions, _options: never): Promise<CommandResponse>;
|
|
@@ -2,7 +2,7 @@ import type { KeyedModel, SourceFile } from "../../models/source-file.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Builder for `projects/<api>/package.json`.
|
|
4
4
|
*
|
|
5
|
-
* Starts with the core
|
|
5
|
+
* Starts with the core `@decohere/http` + `@decohere/crucible` deps. Features can call
|
|
6
6
|
* `addDependency` / `addDevDependency` to extend.
|
|
7
7
|
*/
|
|
8
8
|
export declare class ApiPackageJson implements KeyedModel {
|
|
@@ -36,7 +36,7 @@ export declare class ControllerSourceFile implements KeyedModel {
|
|
|
36
36
|
getMethod(name: string): ControllerMethod;
|
|
37
37
|
/** Add a class-level decorator (e.g. `@Authorize`). */
|
|
38
38
|
addDecorator(decorator: string): this;
|
|
39
|
-
/** Add a named import from `@decohere/
|
|
39
|
+
/** Add a named import from `@decohere/http`. */
|
|
40
40
|
addCortexImport(name: string, typeOnly?: boolean): this;
|
|
41
41
|
/** Add a named import from any other module. */
|
|
42
42
|
addImport(name: string, from: string, typeOnly?: boolean): this;
|
|
@@ -25,7 +25,7 @@ export declare class MainSourceFile implements KeyedModel {
|
|
|
25
25
|
private _dataSourceName;
|
|
26
26
|
private _typeOrmSeed;
|
|
27
27
|
constructor(appName: string);
|
|
28
|
-
/** Adds a bare side-effect import, e.g. `@decohere/
|
|
28
|
+
/** Adds a bare side-effect import, e.g. `@decohere/http/auth`. */
|
|
29
29
|
addSideEffectImport(path: string): this;
|
|
30
30
|
/** Adds a named import, e.g. `import { Foo } from "bar"`. */
|
|
31
31
|
addImport(name: string, from: string, typeOnly?: boolean): this;
|