@lambdaorm/cli 1.4.9
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/LICENSE/home/runner/work/core/core/LICENSE +9 -0
- package/README.md +337 -0
- package/application/cli.d.ts +17 -0
- package/application/cli.d.ts.map +1 -0
- package/application/cli.js +22 -0
- package/application/cli.js.map +1 -0
- package/application/helper.d.ts +16 -0
- package/application/helper.d.ts.map +1 -0
- package/application/helper.js +51 -0
- package/application/helper.js.map +1 -0
- package/application/index.d.ts +28 -0
- package/application/index.d.ts.map +1 -0
- package/application/index.js +44 -0
- package/application/index.js.map +1 -0
- package/application/ports/language.d.ts +7 -0
- package/application/ports/language.d.ts.map +1 -0
- package/application/ports/language.js +3 -0
- package/application/ports/language.js.map +1 -0
- package/application/ports/orm.d.ts +97 -0
- package/application/ports/orm.d.ts.map +1 -0
- package/application/ports/orm.js +3 -0
- package/application/ports/orm.js.map +1 -0
- package/application/ports/workspace.d.ts +8 -0
- package/application/ports/workspace.d.ts.map +1 -0
- package/application/ports/workspace.js +3 -0
- package/application/ports/workspace.js.map +1 -0
- package/application/services/languages.d.ts +8 -0
- package/application/services/languages.d.ts.map +1 -0
- package/application/services/languages.js +21 -0
- package/application/services/languages.js.map +1 -0
- package/application/services/outputService.d.ts +6 -0
- package/application/services/outputService.d.ts.map +1 -0
- package/application/services/outputService.js +48 -0
- package/application/services/outputService.js.map +1 -0
- package/application/useCases/build.d.ts +8 -0
- package/application/useCases/build.d.ts.map +1 -0
- package/application/useCases/build.js +20 -0
- package/application/useCases/build.js.map +1 -0
- package/application/useCases/constraints.d.ts +7 -0
- package/application/useCases/constraints.d.ts.map +1 -0
- package/application/useCases/constraints.js +29 -0
- package/application/useCases/constraints.js.map +1 -0
- package/application/useCases/drop.d.ts +7 -0
- package/application/useCases/drop.d.ts.map +1 -0
- package/application/useCases/drop.js +27 -0
- package/application/useCases/drop.js.map +1 -0
- package/application/useCases/execute.d.ts +7 -0
- package/application/useCases/execute.d.ts.map +1 -0
- package/application/useCases/execute.js +31 -0
- package/application/useCases/execute.js.map +1 -0
- package/application/useCases/export.d.ts +7 -0
- package/application/useCases/export.d.ts.map +1 -0
- package/application/useCases/export.js +31 -0
- package/application/useCases/export.js.map +1 -0
- package/application/useCases/fetch.d.ts +7 -0
- package/application/useCases/fetch.d.ts.map +1 -0
- package/application/useCases/fetch.js +26 -0
- package/application/useCases/fetch.js.map +1 -0
- package/application/useCases/import.d.ts +7 -0
- package/application/useCases/import.d.ts.map +1 -0
- package/application/useCases/import.js +30 -0
- package/application/useCases/import.js.map +1 -0
- package/application/useCases/incorporate.d.ts +7 -0
- package/application/useCases/incorporate.d.ts.map +1 -0
- package/application/useCases/incorporate.js +31 -0
- package/application/useCases/incorporate.js.map +1 -0
- package/application/useCases/init.d.ts +8 -0
- package/application/useCases/init.d.ts.map +1 -0
- package/application/useCases/init.js +15 -0
- package/application/useCases/init.js.map +1 -0
- package/application/useCases/introspect.d.ts +7 -0
- package/application/useCases/introspect.d.ts.map +1 -0
- package/application/useCases/introspect.js +31 -0
- package/application/useCases/introspect.js.map +1 -0
- package/application/useCases/metadata.d.ts +7 -0
- package/application/useCases/metadata.d.ts.map +1 -0
- package/application/useCases/metadata.js +29 -0
- package/application/useCases/metadata.js.map +1 -0
- package/application/useCases/model.d.ts +7 -0
- package/application/useCases/model.d.ts.map +1 -0
- package/application/useCases/model.js +29 -0
- package/application/useCases/model.js.map +1 -0
- package/application/useCases/parameters.d.ts +7 -0
- package/application/useCases/parameters.d.ts.map +1 -0
- package/application/useCases/parameters.js +29 -0
- package/application/useCases/parameters.js.map +1 -0
- package/application/useCases/plan.d.ts +7 -0
- package/application/useCases/plan.d.ts.map +1 -0
- package/application/useCases/plan.js +30 -0
- package/application/useCases/plan.js.map +1 -0
- package/application/useCases/pull.d.ts +7 -0
- package/application/useCases/pull.d.ts.map +1 -0
- package/application/useCases/pull.js +26 -0
- package/application/useCases/pull.js.map +1 -0
- package/application/useCases/push.d.ts +7 -0
- package/application/useCases/push.d.ts.map +1 -0
- package/application/useCases/push.js +27 -0
- package/application/useCases/push.js.map +1 -0
- package/application/useCases/schema.d.ts +7 -0
- package/application/useCases/schema.d.ts.map +1 -0
- package/application/useCases/schema.js +83 -0
- package/application/useCases/schema.js.map +1 -0
- package/application/useCases/version.d.ts +7 -0
- package/application/useCases/version.d.ts.map +1 -0
- package/application/useCases/version.js +15 -0
- package/application/useCases/version.js.map +1 -0
- package/application/useCases/versionGlobal.d.ts +7 -0
- package/application/useCases/versionGlobal.d.ts.map +1 -0
- package/application/useCases/versionGlobal.js +14 -0
- package/application/useCases/versionGlobal.js.map +1 -0
- package/doc.index.d.ts +2 -0
- package/doc.index.d.ts.map +1 -0
- package/doc.index.js +18 -0
- package/doc.index.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +39 -0
- package/index.js.map +1 -0
- package/infrastructure/builders/facade.d.ts +6 -0
- package/infrastructure/builders/facade.d.ts.map +1 -0
- package/infrastructure/builders/facade.js +31 -0
- package/infrastructure/builders/facade.js.map +1 -0
- package/infrastructure/builders/usesCases.d.ts +21 -0
- package/infrastructure/builders/usesCases.d.ts.map +1 -0
- package/infrastructure/builders/usesCases.js +26 -0
- package/infrastructure/builders/usesCases.js.map +1 -0
- package/infrastructure/command/build.d.ts +26 -0
- package/infrastructure/command/build.d.ts.map +1 -0
- package/infrastructure/command/build.js +82 -0
- package/infrastructure/command/build.js.map +1 -0
- package/infrastructure/command/constraints.d.ts +18 -0
- package/infrastructure/command/constraints.d.ts.map +1 -0
- package/infrastructure/command/constraints.js +57 -0
- package/infrastructure/command/constraints.js.map +1 -0
- package/infrastructure/command/drop.d.ts +20 -0
- package/infrastructure/command/drop.d.ts.map +1 -0
- package/infrastructure/command/drop.js +66 -0
- package/infrastructure/command/drop.js.map +1 -0
- package/infrastructure/command/execute.d.ts +22 -0
- package/infrastructure/command/execute.d.ts.map +1 -0
- package/infrastructure/command/execute.js +67 -0
- package/infrastructure/command/execute.js.map +1 -0
- package/infrastructure/command/export.d.ts +20 -0
- package/infrastructure/command/export.d.ts.map +1 -0
- package/infrastructure/command/export.js +56 -0
- package/infrastructure/command/export.js.map +1 -0
- package/infrastructure/command/fetch.d.ts +18 -0
- package/infrastructure/command/fetch.d.ts.map +1 -0
- package/infrastructure/command/fetch.js +51 -0
- package/infrastructure/command/fetch.js.map +1 -0
- package/infrastructure/command/import.d.ts +18 -0
- package/infrastructure/command/import.d.ts.map +1 -0
- package/infrastructure/command/import.js +52 -0
- package/infrastructure/command/import.js.map +1 -0
- package/infrastructure/command/incorporate.d.ts +20 -0
- package/infrastructure/command/incorporate.d.ts.map +1 -0
- package/infrastructure/command/incorporate.js +56 -0
- package/infrastructure/command/incorporate.js.map +1 -0
- package/infrastructure/command/init.d.ts +20 -0
- package/infrastructure/command/init.d.ts.map +1 -0
- package/infrastructure/command/init.js +58 -0
- package/infrastructure/command/init.js.map +1 -0
- package/infrastructure/command/introspect.d.ts +20 -0
- package/infrastructure/command/introspect.d.ts.map +1 -0
- package/infrastructure/command/introspect.js +56 -0
- package/infrastructure/command/introspect.js.map +1 -0
- package/infrastructure/command/metadata.d.ts +18 -0
- package/infrastructure/command/metadata.d.ts.map +1 -0
- package/infrastructure/command/metadata.js +57 -0
- package/infrastructure/command/metadata.js.map +1 -0
- package/infrastructure/command/model.d.ts +18 -0
- package/infrastructure/command/model.d.ts.map +1 -0
- package/infrastructure/command/model.js +57 -0
- package/infrastructure/command/model.js.map +1 -0
- package/infrastructure/command/parameters.d.ts +18 -0
- package/infrastructure/command/parameters.d.ts.map +1 -0
- package/infrastructure/command/parameters.js +57 -0
- package/infrastructure/command/parameters.js.map +1 -0
- package/infrastructure/command/plan.d.ts +20 -0
- package/infrastructure/command/plan.d.ts.map +1 -0
- package/infrastructure/command/plan.js +62 -0
- package/infrastructure/command/plan.js.map +1 -0
- package/infrastructure/command/pull.d.ts +16 -0
- package/infrastructure/command/pull.d.ts.map +1 -0
- package/infrastructure/command/pull.js +46 -0
- package/infrastructure/command/pull.js.map +1 -0
- package/infrastructure/command/push.d.ts +18 -0
- package/infrastructure/command/push.d.ts.map +1 -0
- package/infrastructure/command/push.js +51 -0
- package/infrastructure/command/push.js.map +1 -0
- package/infrastructure/command/schema.d.ts +18 -0
- package/infrastructure/command/schema.d.ts.map +1 -0
- package/infrastructure/command/schema.js +51 -0
- package/infrastructure/command/schema.js.map +1 -0
- package/infrastructure/command/version.d.ts +12 -0
- package/infrastructure/command/version.d.ts.map +1 -0
- package/infrastructure/command/version.js +42 -0
- package/infrastructure/command/version.js.map +1 -0
- package/infrastructure/index.d.ts +18 -0
- package/infrastructure/index.d.ts.map +1 -0
- package/infrastructure/index.js +34 -0
- package/infrastructure/index.js.map +1 -0
- package/infrastructure/languages/clientNode.d.ts +10 -0
- package/infrastructure/languages/clientNode.d.ts.map +1 -0
- package/infrastructure/languages/clientNode.js +95 -0
- package/infrastructure/languages/clientNode.js.map +1 -0
- package/infrastructure/languages/index.d.ts +3 -0
- package/infrastructure/languages/index.d.ts.map +1 -0
- package/infrastructure/languages/index.js +19 -0
- package/infrastructure/languages/index.js.map +1 -0
- package/infrastructure/languages/node.d.ts +55 -0
- package/infrastructure/languages/node.d.ts.map +1 -0
- package/infrastructure/languages/node.js +313 -0
- package/infrastructure/languages/node.js.map +1 -0
- package/infrastructure/orm/adapters/lib.d.ts +64 -0
- package/infrastructure/orm/adapters/lib.d.ts.map +1 -0
- package/infrastructure/orm/adapters/lib.js +166 -0
- package/infrastructure/orm/adapters/lib.js.map +1 -0
- package/infrastructure/orm/adapters/rest.d.ts +64 -0
- package/infrastructure/orm/adapters/rest.d.ts.map +1 -0
- package/infrastructure/orm/adapters/rest.js +191 -0
- package/infrastructure/orm/adapters/rest.js.map +1 -0
- package/infrastructure/orm/factory.d.ts +6 -0
- package/infrastructure/orm/factory.d.ts.map +1 -0
- package/infrastructure/orm/factory.js +18 -0
- package/infrastructure/orm/factory.js.map +1 -0
- package/infrastructure/workspace/adapters/client.d.ts +11 -0
- package/infrastructure/workspace/adapters/client.d.ts.map +1 -0
- package/infrastructure/workspace/adapters/client.js +38 -0
- package/infrastructure/workspace/adapters/client.js.map +1 -0
- package/infrastructure/workspace/adapters/local.d.ts +10 -0
- package/infrastructure/workspace/adapters/local.d.ts.map +1 -0
- package/infrastructure/workspace/adapters/local.js +26 -0
- package/infrastructure/workspace/adapters/local.js.map +1 -0
- package/infrastructure/workspace/factory.d.ts +9 -0
- package/infrastructure/workspace/factory.d.ts.map +1 -0
- package/infrastructure/workspace/factory.js +20 -0
- package/infrastructure/workspace/factory.js.map +1 -0
- package/jest-config.json +24 -0
- package/package.json +48 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usesCases.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/builders/usesCases.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAC3C,mDAG0B;AAE1B,MAAM,aAAa,GAAG,IAAI,yBAAgB,EAAE,CAAC,KAAK,EAAE,CAAA;AACvC,QAAA,OAAO,GAAG,IAAI,qBAAO,CAAC,aAAa,CAAC,CAAA;AACpC,QAAA,aAAa,GAAG,IAAI,2BAAa,CAAC,aAAa,CAAC,CAAA;AAChD,QAAA,IAAI,GAAG,IAAI,kBAAI,CAAC,aAAa,CAAC,CAAA;AAC9B,QAAA,IAAI,GAAG,IAAI,kBAAI,CAAC,aAAa,CAAC,CAAA;AAC9B,QAAA,KAAK,GAAG,IAAI,mBAAK,CAAC,aAAa,CAAC,CAAA;AAChC,QAAA,OAAO,GAAG,IAAI,qBAAO,CAAC,aAAa,CAAC,CAAA;AACpC,QAAA,IAAI,GAAG,IAAI,kBAAI,CAAC,aAAa,CAAC,CAAA;AAC9B,QAAA,QAAQ,GAAG,IAAI,sBAAQ,CAAC,aAAa,CAAC,CAAA;AACtC,QAAA,UAAU,GAAG,IAAI,wBAAU,CAAC,aAAa,CAAC,CAAA;AAC1C,QAAA,WAAW,GAAG,IAAI,yBAAW,CAAC,aAAa,CAAC,CAAA;AAC5C,QAAA,KAAK,GAAG,IAAI,mBAAK,CAAC,aAAa,CAAC,CAAA;AAChC,QAAA,OAAO,GAAG,IAAI,oBAAM,CAAC,aAAa,CAAC,CAAA;AACnC,QAAA,OAAO,GAAG,IAAI,oBAAM,CAAC,aAAa,CAAC,CAAA;AACnC,QAAA,IAAI,GAAG,IAAI,kBAAI,CAAC,aAAa,CAAC,CAAA;AAC9B,QAAA,MAAM,GAAG,IAAI,oBAAM,CAAC,aAAa,CAAC,CAAA;AAClC,QAAA,UAAU,GAAG,IAAI,wBAAU,CAAC,aAAa,CAAC,CAAA;AAC1C,QAAA,WAAW,GAAG,IAAI,yBAAW,CAAC,aAAa,CAAC,CAAA;AAC5C,QAAA,IAAI,GAAG,IAAI,kBAAI,CAAC,aAAa,CAAC,CAAA;AAC9B,QAAA,KAAK,GAAG,IAAI,mBAAK,CAAC,aAAa,CAAC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CommandModule, Argv, Arguments } from 'yargs';
|
|
2
|
+
export declare class BuildCommand implements CommandModule {
|
|
3
|
+
command: string;
|
|
4
|
+
describe: string;
|
|
5
|
+
builder(args: Argv): Argv<{
|
|
6
|
+
w: string | undefined;
|
|
7
|
+
} & {
|
|
8
|
+
l: unknown;
|
|
9
|
+
} & {
|
|
10
|
+
m: unknown;
|
|
11
|
+
} & {
|
|
12
|
+
r: unknown;
|
|
13
|
+
} & {
|
|
14
|
+
a: unknown;
|
|
15
|
+
} & {
|
|
16
|
+
"src-path": unknown;
|
|
17
|
+
} & {
|
|
18
|
+
"data-path": unknown;
|
|
19
|
+
} & {
|
|
20
|
+
"domain-path": unknown;
|
|
21
|
+
} & {
|
|
22
|
+
u: unknown;
|
|
23
|
+
}>;
|
|
24
|
+
handler(args: Arguments): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/build.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItD,qBAAa,YAAa,YAAW,aAAa;IACjD,OAAO,SAAU;IACjB,QAAQ,SAA8B;IAEtC,OAAO,CAAE,IAAI,EAAE,IAAI;;;;;;;;;;;;;;;;;;;IAqCb,OAAO,CAAE,IAAI,EAAE,SAAS;CA6B9B"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BuildCommand = void 0;
|
|
7
|
+
const usesCases_1 = require("../builders/usesCases");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
class BuildCommand {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.command = 'build';
|
|
12
|
+
this.describe = 'build model, repositories';
|
|
13
|
+
}
|
|
14
|
+
builder(args) {
|
|
15
|
+
return args
|
|
16
|
+
.option('w', {
|
|
17
|
+
alias: 'workspace',
|
|
18
|
+
type: 'string',
|
|
19
|
+
describe: 'project path.'
|
|
20
|
+
}).option('l', {
|
|
21
|
+
alias: 'language',
|
|
22
|
+
describe: 'develop language'
|
|
23
|
+
}).option('m', {
|
|
24
|
+
alias: 'model',
|
|
25
|
+
describe: 'build model'
|
|
26
|
+
}).option('r', {
|
|
27
|
+
alias: 'repositories',
|
|
28
|
+
describe: 'build repositories'
|
|
29
|
+
}).option('a', {
|
|
30
|
+
alias: 'all',
|
|
31
|
+
describe: 'build model and repositories'
|
|
32
|
+
})
|
|
33
|
+
.option('src-path', {
|
|
34
|
+
alias: 'srcPath',
|
|
35
|
+
describe: 'relative source code path in workspace'
|
|
36
|
+
})
|
|
37
|
+
.option('data-path', {
|
|
38
|
+
alias: 'dataPath',
|
|
39
|
+
describe: 'relative data path in workspace'
|
|
40
|
+
})
|
|
41
|
+
.option('domain-path', {
|
|
42
|
+
alias: 'domainPath',
|
|
43
|
+
describe: 'relative domain path in source code path'
|
|
44
|
+
})
|
|
45
|
+
.option('u', {
|
|
46
|
+
alias: 'url',
|
|
47
|
+
describe: 'Url of service.'
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async handler(args) {
|
|
51
|
+
const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
|
|
52
|
+
const language = args.language || 'node';
|
|
53
|
+
const model = args.model !== undefined;
|
|
54
|
+
const repositories = args.repositories !== undefined;
|
|
55
|
+
const all = args.all !== undefined;
|
|
56
|
+
const srcPath = args.srcPath;
|
|
57
|
+
const domainPath = args.domainPath;
|
|
58
|
+
const dataPath = args.dataPath;
|
|
59
|
+
const url = args.url;
|
|
60
|
+
const options = [];
|
|
61
|
+
if (!model && !repositories && !all) {
|
|
62
|
+
options.push('model');
|
|
63
|
+
options.push('repositories');
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
if (model || all) {
|
|
67
|
+
options.push('model');
|
|
68
|
+
}
|
|
69
|
+
if (repositories || all) {
|
|
70
|
+
options.push('repositories');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
await usesCases_1.build.execute({ workspace, language, options, srcPath, dataPath, domainPath, url });
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.error(`error: ${error}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.BuildCommand = BuildCommand;
|
|
82
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/build.ts"],"names":[],"mappings":";;;;;;AAEA,qDAA6C;AAC7C,gDAAuB;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straintsCommand implements CommandModule {
|
|
3
|
+
command: string;
|
|
4
|
+
describe: string;
|
|
5
|
+
builder(args: Argv): Argv<{
|
|
6
|
+
w: unknown;
|
|
7
|
+
} & {
|
|
8
|
+
q: unknown;
|
|
9
|
+
} & {
|
|
10
|
+
e: unknown;
|
|
11
|
+
} & {
|
|
12
|
+
o: unknown;
|
|
13
|
+
} & {
|
|
14
|
+
u: unknown;
|
|
15
|
+
}>;
|
|
16
|
+
handler(args: Arguments): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraints.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/constraints.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,qBAAa,kBAAmB,YAAW,aAAa;IACvD,OAAO,SAAgB;IACvB,QAAQ,SAAiD;IAEzD,OAAO,CAAE,IAAI,EAAE,IAAI;;;;;;;;;;;IAwBb,OAAO,CAAE,IAAI,EAAE,SAAS;CAiB9B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ConstraintsCommand = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const usesCases_1 = require("../builders/usesCases");
|
|
9
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
10
|
+
class ConstraintsCommand {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.command = 'constraints';
|
|
13
|
+
this.describe = 'Return constraints associated with the query';
|
|
14
|
+
}
|
|
15
|
+
builder(args) {
|
|
16
|
+
return args
|
|
17
|
+
.option('w', {
|
|
18
|
+
alias: 'workspace',
|
|
19
|
+
describe: 'project path'
|
|
20
|
+
})
|
|
21
|
+
.option('q', {
|
|
22
|
+
alias: 'query',
|
|
23
|
+
describe: 'Query expression'
|
|
24
|
+
})
|
|
25
|
+
.option('e', {
|
|
26
|
+
alias: 'envfile',
|
|
27
|
+
describe: 'Read in a file of environment variables'
|
|
28
|
+
})
|
|
29
|
+
.option('o', {
|
|
30
|
+
alias: 'output',
|
|
31
|
+
describe: 'Generates an output according to the following possible values [json|beautiful|light|yaml]'
|
|
32
|
+
})
|
|
33
|
+
.option('u', {
|
|
34
|
+
alias: 'url',
|
|
35
|
+
describe: 'Url of service.'
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async handler(args) {
|
|
39
|
+
const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
|
|
40
|
+
const query = args.query;
|
|
41
|
+
const output = args.output;
|
|
42
|
+
const envfile = args.envfile;
|
|
43
|
+
const url = args.url;
|
|
44
|
+
if (envfile) {
|
|
45
|
+
const fullPath = path_1.default.resolve(process.cwd(), envfile);
|
|
46
|
+
dotenv_1.default.config({ path: fullPath, override: true });
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
await usesCases_1.constraints.execute(workspace, query, output, url);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.error(`error: ${error}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.ConstraintsCommand = ConstraintsCommand;
|
|
57
|
+
//# sourceMappingURL=constraints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraints.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/constraints.ts"],"names":[],"mappings":";;;;;;AAEA,gDAAuB;AACvB,qDAAmD;AACnD,oDAA2B;AAE3B,MAAa,kBAAkB;IAA/B;QACC,YAAO,GAAG,aAAa,CAAA;QACvB,aAAQ,GAAG,8CAA8C,CAAA;IA2C1D,C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zD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,EAAE,CAAC,CAAA;QACjC,CAAC;IACF,CAAC;CACD;AA7CD,gDA6CC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CommandModule, Argv, Arguments } from 'yargs';
|
|
2
|
+
export declare class DropCommand implements CommandModule {
|
|
3
|
+
command: string;
|
|
4
|
+
describe: string;
|
|
5
|
+
builder(args: Argv): Argv<{
|
|
6
|
+
w: string | undefined;
|
|
7
|
+
} & {
|
|
8
|
+
s: string | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
e: string | undefined;
|
|
11
|
+
} & {
|
|
12
|
+
o: string | undefined;
|
|
13
|
+
} & {
|
|
14
|
+
f: unknown;
|
|
15
|
+
} & {
|
|
16
|
+
u: unknown;
|
|
17
|
+
}>;
|
|
18
|
+
handler(args: Arguments): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=drop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drop.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/drop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,qBAAa,WAAY,YAAW,aAAa;IAChD,OAAO,SAAS;IAChB,QAAQ,SAAuD;IAE/D,OAAO,CAAE,IAAI,EAAE,IAAI;;;;;;;;;;;;;IAgCb,OAAO,CAAE,IAAI,EAAE,SAAS;CAkB9B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DropCommand = void 0;
|
|
7
|
+
const usesCases_1 = require("../builders/usesCases");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
10
|
+
class DropCommand {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.command = 'drop';
|
|
13
|
+
this.describe = 'Removes all database objects but not the database.';
|
|
14
|
+
}
|
|
15
|
+
builder(args) {
|
|
16
|
+
return args
|
|
17
|
+
.option('w', {
|
|
18
|
+
alias: 'workspace',
|
|
19
|
+
type: 'string',
|
|
20
|
+
describe: 'project path'
|
|
21
|
+
})
|
|
22
|
+
.option('s', {
|
|
23
|
+
alias: 'stage',
|
|
24
|
+
type: 'string',
|
|
25
|
+
describe: 'Name of stage'
|
|
26
|
+
})
|
|
27
|
+
.option('e', {
|
|
28
|
+
alias: 'envfile',
|
|
29
|
+
type: 'string',
|
|
30
|
+
describe: 'Read in a file of environment variables'
|
|
31
|
+
})
|
|
32
|
+
.option('o', {
|
|
33
|
+
alias: 'output',
|
|
34
|
+
type: 'string',
|
|
35
|
+
describe: 'Generates the queries but does not apply'
|
|
36
|
+
})
|
|
37
|
+
.option('f', {
|
|
38
|
+
alias: 'force',
|
|
39
|
+
describe: 'If there is an error in a statement, continue executing the next statements'
|
|
40
|
+
})
|
|
41
|
+
.option('u', {
|
|
42
|
+
alias: 'url',
|
|
43
|
+
describe: 'Url of service.'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async handler(args) {
|
|
47
|
+
const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
|
|
48
|
+
const stage = args.stage;
|
|
49
|
+
const output = args.output;
|
|
50
|
+
const force = args.force !== undefined;
|
|
51
|
+
const envfile = args.envfile;
|
|
52
|
+
const url = args.url;
|
|
53
|
+
if (envfile) {
|
|
54
|
+
const fullPath = path_1.default.resolve(process.cwd(), envfile);
|
|
55
|
+
dotenv_1.default.config({ path: fullPath, override: true });
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
await usesCases_1.drop.execute(workspace, stage, output, url, force);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.error(`error: ${error}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.DropCommand = DropCommand;
|
|
66
|
+
//# sourceMappingURL=drop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drop.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/drop.ts"],"names":[],"mappings":";;;;;;AAEA,qDAA4C;AAC5C,gDAAuB;AACvB,oDAA2B;AAE3B,MAAa,WAAW;IAAxB;QACC,YAAO,GAAG,MAAM,CAAA;QAChB,aAAQ,GAAG,oDAAoD,CAAA;IAoDhE,CAAC;IAlDA,OAAO,CAAE,IAAU;QAClB,OAAO,IAAI;aACT,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,cAAc;SACxB,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,eAAe;SACzB,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,yCAAyC;SACnD,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,0CAA0C;SACpD,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,6EAA6E;SACvF,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,iBAAiB;SAC3B,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,IAAe;QAC7B,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,SAAmB,IAAI,GAAG,CAAC,CAAA;QAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAe,CAAA;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAgB,CAAA;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,CAAA;QACtC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAiB,CAAA;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAuB,CAAA;QAExC,IAAI,OAAO,EAAE,CAAC;YACb,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAA;YACrD,gBAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;QAClD,CAAC;QACD,IAAI,CAAC;YACJ,MAAM,gBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;QACzD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,EAAE,CAAC,CAAA;QACjC,CAAC;IACF,CAAC;CACD;AAtDD,kCAsDC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CommandModule, Argv, Arguments } from 'yargs';
|
|
2
|
+
export declare class ExecuteCommand implements CommandModule {
|
|
3
|
+
command: string;
|
|
4
|
+
describe: string;
|
|
5
|
+
builder(args: Argv): Argv<{
|
|
6
|
+
w: unknown;
|
|
7
|
+
} & {
|
|
8
|
+
s: unknown;
|
|
9
|
+
} & {
|
|
10
|
+
q: unknown;
|
|
11
|
+
} & {
|
|
12
|
+
d: unknown;
|
|
13
|
+
} & {
|
|
14
|
+
e: unknown;
|
|
15
|
+
} & {
|
|
16
|
+
o: unknown;
|
|
17
|
+
} & {
|
|
18
|
+
u: unknown;
|
|
19
|
+
}>;
|
|
20
|
+
handler(args: Arguments): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/execute.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,qBAAa,cAAe,YAAW,aAAa;IACnD,OAAO,SAAY;IACnB,QAAQ,SAAqB;IAE7B,OAAO,CAAE,IAAI,EAAE,IAAI;;;;;;;;;;;;;;;IAgCb,OAAO,CAAE,IAAI,EAAE,SAAS;CAmB9B"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExecuteCommand = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const usesCases_1 = require("../builders/usesCases");
|
|
9
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
10
|
+
class ExecuteCommand {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.command = 'execute';
|
|
13
|
+
this.describe = 'Execute an query';
|
|
14
|
+
}
|
|
15
|
+
builder(args) {
|
|
16
|
+
return args
|
|
17
|
+
.option('w', {
|
|
18
|
+
alias: 'workspace',
|
|
19
|
+
describe: 'project path'
|
|
20
|
+
})
|
|
21
|
+
.option('s', {
|
|
22
|
+
alias: 'stage',
|
|
23
|
+
describe: 'Name of stage'
|
|
24
|
+
})
|
|
25
|
+
.option('q', {
|
|
26
|
+
alias: 'query',
|
|
27
|
+
describe: 'Query expression'
|
|
28
|
+
})
|
|
29
|
+
.option('d', {
|
|
30
|
+
alias: 'data',
|
|
31
|
+
describe: 'Data used to execute query'
|
|
32
|
+
})
|
|
33
|
+
.option('e', {
|
|
34
|
+
alias: 'envfile',
|
|
35
|
+
describe: 'Read in a file of environment variables'
|
|
36
|
+
})
|
|
37
|
+
.option('o', {
|
|
38
|
+
alias: 'output',
|
|
39
|
+
describe: 'Generates an output according to the following possible values [json|beautiful|light|yaml]'
|
|
40
|
+
})
|
|
41
|
+
.option('u', {
|
|
42
|
+
alias: 'url',
|
|
43
|
+
describe: 'Url of service.'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async handler(args) {
|
|
47
|
+
const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
|
|
48
|
+
const query = args.query;
|
|
49
|
+
const data = args.data || {};
|
|
50
|
+
const stage = args.stage;
|
|
51
|
+
const output = args.output;
|
|
52
|
+
const envfile = args.envfile;
|
|
53
|
+
const url = args.url;
|
|
54
|
+
if (envfile) {
|
|
55
|
+
const fullPath = path_1.default.resolve(process.cwd(), envfile);
|
|
56
|
+
dotenv_1.default.config({ path: fullPath, override: true });
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
await usesCases_1.execute.execute(workspace, query, data, stage, output, url);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.error(`error: ${error}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.ExecuteCommand = ExecuteCommand;
|
|
67
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/execute.ts"],"names":[],"mappings":";;;;;;AAEA,gDAAuB;AACvB,qDAA+C;AAC/C,oDAA2B;AAE3B,MAAa,cAAc;IAA3B;QACC,YAAO,GAAG,SAAS,CAAA;QACnB,aAAQ,GAAG,kBAAkB,CAAA;IAqD9B,CAAC;IAnDA,OAAO,CA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AAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAA;YACrD,gBAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;QAClD,CAAC;QACD,IAAI,CAAC;YACJ,MAAM,mBAAO,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QAClE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,EAAE,CAAC,CAAA;QACjC,CAAC;IACF,CAAC;CACD;AAvDD,wCAuDC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CommandModule, Argv, Arguments } from 'yargs';
|
|
2
|
+
export declare class ExportCommand implements CommandModule {
|
|
3
|
+
command: string;
|
|
4
|
+
describe: string;
|
|
5
|
+
builder(args: Argv): Argv<{
|
|
6
|
+
w: unknown;
|
|
7
|
+
} & {
|
|
8
|
+
s: unknown;
|
|
9
|
+
} & {
|
|
10
|
+
e: unknown;
|
|
11
|
+
} & {
|
|
12
|
+
t: unknown;
|
|
13
|
+
} & {
|
|
14
|
+
f: unknown;
|
|
15
|
+
} & {
|
|
16
|
+
u: unknown;
|
|
17
|
+
}>;
|
|
18
|
+
handler(args: Arguments): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/export.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,qBAAa,aAAc,YAAW,aAAa;IAClD,OAAO,SAAW;IAClB,QAAQ,SAAgC;IAExC,OAAO,CAAE,IAAI,EAAE,IAAI;;;;;;;;;;;;;IA2Bb,OAAO,CAAE,IAAI,EAAE,SAAS;CAc9B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExportCommand = void 0;
|
|
7
|
+
const usesCases_1 = require("../builders/usesCases");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
10
|
+
class ExportCommand {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.command = 'export';
|
|
13
|
+
this.describe = 'Export data from a database';
|
|
14
|
+
}
|
|
15
|
+
builder(args) {
|
|
16
|
+
return args
|
|
17
|
+
.option('w', {
|
|
18
|
+
alias: 'workspace',
|
|
19
|
+
describe: 'project path.'
|
|
20
|
+
})
|
|
21
|
+
.option('s', {
|
|
22
|
+
alias: 'stage',
|
|
23
|
+
describe: 'Name of stage'
|
|
24
|
+
})
|
|
25
|
+
.option('e', {
|
|
26
|
+
alias: 'envfile',
|
|
27
|
+
describe: 'Read in a file of environment variables'
|
|
28
|
+
})
|
|
29
|
+
.option('t', {
|
|
30
|
+
alias: 'target',
|
|
31
|
+
describe: 'Destination file with export data.'
|
|
32
|
+
}).option('f', {
|
|
33
|
+
alias: 'force',
|
|
34
|
+
describe: 'If there is an error in a statement, continue executing the next statements'
|
|
35
|
+
})
|
|
36
|
+
.option('u', {
|
|
37
|
+
alias: 'url',
|
|
38
|
+
describe: 'Url of service.'
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async handler(args) {
|
|
42
|
+
const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
|
|
43
|
+
const stage = args.stage;
|
|
44
|
+
const target = path_1.default.resolve(process.cwd(), args.target || '.');
|
|
45
|
+
const envfile = args.envfile;
|
|
46
|
+
const force = args.force !== undefined;
|
|
47
|
+
const url = args.url;
|
|
48
|
+
if (envfile) {
|
|
49
|
+
const fullPath = path_1.default.resolve(process.cwd(), envfile);
|
|
50
|
+
dotenv_1.default.config({ path: fullPath, override: true });
|
|
51
|
+
}
|
|
52
|
+
usesCases_1._export.execute(workspace, target, stage, url, force);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.ExportCommand = ExportCommand;
|
|
56
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/export.ts"],"names":[],"mappings":";;;;;;AAEA,qDAA+C;AAC/C,gDAAuB;AACvB,oDAA2B;AAE3B,MAAa,aAAa;IAA1B;QACC,YAAO,GAAG,QAAQ,CAAA;QAClB,aAAQ,GAAG,6BAA6B,CAAA;IA2CzC,CAAC;IAzCA,OAAO,CAAE,IAAU;QAClB,OAAO,IAAI;aACT,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,eAAe;SACzB,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,eAAe;SACzB,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,yCAAyC;SACnD,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,oCAAoC;SAC9C,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;YACd,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,6EAA6E;SACvF,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,iBAAiB;SAC3B,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,IAAe;QAC7B,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,SAAmB,IAAI,GAAG,CAAC,CAAA;QAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAe,CAAA;QAClC,MAAM,MAAM,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAgB,IAAI,GAAG,CAAC,CAAA;QACxE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAiB,CAAA;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,CAAA;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAuB,CAAA;QAExC,IAAI,OAAO,EAAE,CAAC;YACb,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAA;YACrD,gBAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;QAClD,CAAC;QACD,mBAAO,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;CACD;AA7CD,sCA6CC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CommandModule, Argv, Arguments } from 'yargs';
|
|
2
|
+
export declare class FetchCommand implements CommandModule {
|
|
3
|
+
command: string;
|
|
4
|
+
describe: string;
|
|
5
|
+
builder(args: Argv): Argv<{
|
|
6
|
+
w: unknown;
|
|
7
|
+
} & {
|
|
8
|
+
u: unknown;
|
|
9
|
+
} & {
|
|
10
|
+
e: unknown;
|
|
11
|
+
} & {
|
|
12
|
+
s: unknown;
|
|
13
|
+
} & {
|
|
14
|
+
o: unknown;
|
|
15
|
+
}>;
|
|
16
|
+
handler(args: Arguments): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItD,qBAAa,YAAa,YAAW,aAAa;IACjD,OAAO,SAAU;IACjB,QAAQ,SAA6C;IAErD,OAAO,CAAE,IAAI,EAAE,IAAI;;;;;;;;;;;IAwBb,OAAO,CAAE,IAAI,EAAE,SAAS;CAW9B"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FetchCommand = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const usesCases_1 = require("../builders/usesCases");
|
|
9
|
+
class FetchCommand {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.command = 'fetch';
|
|
12
|
+
this.describe = 'Read and analyze data and update schemas';
|
|
13
|
+
}
|
|
14
|
+
builder(args) {
|
|
15
|
+
return args
|
|
16
|
+
.option('w', {
|
|
17
|
+
alias: 'workspace',
|
|
18
|
+
describe: 'project path'
|
|
19
|
+
})
|
|
20
|
+
.option('u', {
|
|
21
|
+
alias: 'url',
|
|
22
|
+
describe: 'Url of service.'
|
|
23
|
+
})
|
|
24
|
+
.option('e', {
|
|
25
|
+
alias: 'envfile',
|
|
26
|
+
describe: 'Read in a file of environment variables'
|
|
27
|
+
})
|
|
28
|
+
.option('s', {
|
|
29
|
+
alias: 'stage',
|
|
30
|
+
describe: 'Name of stage'
|
|
31
|
+
})
|
|
32
|
+
.option('o', {
|
|
33
|
+
alias: 'output',
|
|
34
|
+
describe: 'Generates an output according to the following possible values [json|beautiful|light|yaml]'
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async handler(args) {
|
|
38
|
+
const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
|
|
39
|
+
const stage = args.stage;
|
|
40
|
+
const url = args.url;
|
|
41
|
+
const output = args.output;
|
|
42
|
+
try {
|
|
43
|
+
await usesCases_1.fetch.execute(workspace, stage, output, url);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
console.error(`error: ${error}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.FetchCommand = FetchCommand;
|
|
51
|
+
//# sourceMappingURL=fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/fetch.ts"],"names":[],"mappings":";;;;;;AAEA,gDAAuB;AACvB,qDAA6C;AAE7C,MAAa,YAAY;IAAzB;QACC,YAAO,GAAG,OAAO,CAAA;QACjB,aAAQ,GAAG,0CAA0C,CAAA;IAqCtD,CAAC;IAnCA,OAAO,CAAE,IAAU;QAClB,OAAO,IAAI;aACT,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,cAAc;SACxB,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,iBAAiB;SAC3B,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,yCAAyC;SACnD,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,eAAe;SACzB,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,4FAA4F;SACtG,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,IAAe;QAC7B,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,SAAmB,IAAI,GAAG,CAAC,CAAA;QAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAe,CAAA;QAClC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAuB,CAAA;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAgB,CAAA;QACpC,IAAI,CAAC;YACJ,MAAM,iBAAK,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QACnD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,EAAE,CAAC,CAAA;QACjC,CAAC;IACF,CAAC;CACD;AAvCD,oCAuCC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CommandModule, Argv, Arguments } from 'yargs';
|
|
2
|
+
export declare class ImportCommand implements CommandModule {
|
|
3
|
+
command: string;
|
|
4
|
+
describe: string;
|
|
5
|
+
builder(args: Argv): Argv<{
|
|
6
|
+
w: unknown;
|
|
7
|
+
} & {
|
|
8
|
+
s: unknown;
|
|
9
|
+
} & {
|
|
10
|
+
d: unknown;
|
|
11
|
+
} & {
|
|
12
|
+
e: unknown;
|
|
13
|
+
} & {
|
|
14
|
+
u: unknown;
|
|
15
|
+
}>;
|
|
16
|
+
handler(args: Arguments): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/import.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,qBAAa,aAAc,YAAW,aAAa;IAClD,OAAO,SAAW;IAClB,QAAQ,SAAsC;IAE9C,OAAO,CAAE,IAAI,EAAE,IAAI;;;;;;;;;;;IAwBb,OAAO,CAAE,IAAI,EAAE,SAAS;CAa9B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ImportCommand = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const usesCases_1 = require("../builders/usesCases");
|
|
9
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
10
|
+
class ImportCommand {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.command = 'import';
|
|
13
|
+
this.describe = 'Import data from file to database';
|
|
14
|
+
}
|
|
15
|
+
builder(args) {
|
|
16
|
+
return args
|
|
17
|
+
.option('w', {
|
|
18
|
+
alias: 'workspace',
|
|
19
|
+
describe: 'project path.'
|
|
20
|
+
})
|
|
21
|
+
.option('s', {
|
|
22
|
+
alias: 'stage',
|
|
23
|
+
describe: 'Name of stage'
|
|
24
|
+
})
|
|
25
|
+
.option('d', {
|
|
26
|
+
alias: 'data',
|
|
27
|
+
describe: 'Data file to import.'
|
|
28
|
+
})
|
|
29
|
+
.option('e', {
|
|
30
|
+
alias: 'envfile',
|
|
31
|
+
describe: 'Read in a file of environment variables'
|
|
32
|
+
})
|
|
33
|
+
.option('u', {
|
|
34
|
+
alias: 'url',
|
|
35
|
+
describe: 'Url of service.'
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async handler(args) {
|
|
39
|
+
const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
|
|
40
|
+
const stage = args.stage;
|
|
41
|
+
const data = args.data || {};
|
|
42
|
+
const envfile = args.envfile;
|
|
43
|
+
const url = args.url;
|
|
44
|
+
if (envfile) {
|
|
45
|
+
const fullPath = path_1.default.resolve(process.cwd(), envfile);
|
|
46
|
+
dotenv_1.default.config({ path: fullPath, override: true });
|
|
47
|
+
}
|
|
48
|
+
await usesCases_1._import.execute(workspace, data, stage, url);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.ImportCommand = ImportCommand;
|
|
52
|
+
//# sourceMappingURL=import.js.map
|