@simitgroup/simpleapp-generator 1.0.19 → 1.0.21
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/README.md +13 -10
- package/backend1/.env +5 -0
- package/backend1/.eslintrc.js +25 -0
- package/backend1/.prettierrc +4 -0
- package/backend1/README.md +73 -0
- package/backend1/nest-cli.json +8 -0
- package/backend1/package.json +75 -0
- package/backend1/pnpm-lock.yaml +5459 -0
- package/backend1/src/app.controller.js +71 -0
- package/backend1/src/app.controller.js.map +1 -0
- package/backend1/src/app.controller.spec.js +21 -0
- package/backend1/src/app.controller.spec.js.map +1 -0
- package/backend1/src/app.controller.spec.ts +22 -0
- package/backend1/src/app.controller.ts +12 -0
- package/backend1/src/app.module.js +67 -0
- package/backend1/src/app.module.js.map +1 -0
- package/backend1/src/app.module.ts +10 -0
- package/backend1/src/app.service.js +64 -0
- package/backend1/src/app.service.js.map +1 -0
- package/backend1/src/app.service.ts +8 -0
- package/backend1/src/class/SimpleAppController.js +38 -0
- package/backend1/src/class/SimpleAppController.js.map +1 -0
- package/backend1/src/class/SimpleAppController.ts +69 -0
- package/backend1/src/class/SimpleAppService.js +264 -0
- package/backend1/src/class/SimpleAppService.js.map +1 -0
- package/backend1/src/class/SimpleAppService.ts +213 -0
- package/backend1/src/main.js +22 -0
- package/backend1/src/main.js.map +1 -0
- package/backend1/src/main.ts +20 -0
- package/backend1/test/app.e2e-spec.js +45 -0
- package/backend1/test/app.e2e-spec.js.map +1 -0
- package/backend1/test/app.e2e-spec.ts +24 -0
- package/backend1/test/jest-e2e.json +9 -0
- package/backend1/tsconfig.build.json +4 -0
- package/backend1/tsconfig.json +1 -0
- package/dist/createproject.js +6 -1
- package/dist/createproject.js.map +1 -1
- package/dist/framework.js +161 -0
- package/dist/framework.js.map +1 -0
- package/dist/generate.js +2 -2
- package/dist/generate.js.map +1 -1
- package/dist/index.js +54 -58
- package/dist/index.js.map +1 -1
- package/dist/index2.js +118 -0
- package/dist/index2.js.map +1 -0
- package/dist/installdependency.js +20 -0
- package/dist/installdependency.js.map +1 -0
- package/dist/installnest.js +2 -0
- package/dist/installnest.js.map +1 -0
- package/dist/installnuxt.js +2 -0
- package/dist/installnuxt.js.map +1 -0
- package/dist/validation.js +2 -0
- package/dist/validation.js.map +1 -0
- package/frontend1/README.md +63 -0
- package/frontend1/app.vue +8 -0
- package/frontend1/assets/css/tailwind.css +28 -0
- package/frontend1/components/CrudSimple.vue +112 -0
- package/frontend1/components/DebugDocumentData.vue +20 -0
- package/frontend1/components/EventMonitor.vue +79 -0
- package/frontend1/components/Menus.vue +18 -0
- package/frontend1/layouts/default.vue +10 -0
- package/frontend1/nuxt.config.js +42 -0
- package/frontend1/nuxt.config.js.map +1 -0
- package/frontend1/nuxt.config.ts +42 -0
- package/frontend1/package-lock.json +11877 -0
- package/frontend1/package.json +38 -0
- package/frontend1/pages/index.vue +3 -0
- package/frontend1/plugins/simpleapp.js +73 -0
- package/frontend1/plugins/simpleapp.js.map +1 -0
- package/frontend1/plugins/simpleapp.ts +73 -0
- package/frontend1/pnpm-lock.yaml +8339 -0
- package/frontend1/public/favicon.ico +0 -0
- package/frontend1/server/api/[...].js +117 -0
- package/frontend1/server/api/[...].js.map +1 -0
- package/frontend1/server/api/[...].ts +131 -0
- package/frontend1/server/tsconfig.json +3 -0
- package/frontend1/tailwind.config.js +10 -0
- package/frontend1/tailwind.config.js.map +1 -0
- package/frontend1/tailwind.config.ts +9 -0
- package/frontend1/tsconfig.json +4 -0
- package/openapitools.json +0 -0
- package/package.json +2 -6
- package/sampleconfig.json +2 -2
- package/src/createproject.ts +5 -0
- package/src/framework.ts +133 -0
- package/src/generate.ts +2 -2
- package/src/index.ts +38 -69
- package/src/index2.ts +132 -0
- package/src/installdependency.sh +5 -0
- package/src/installdependency.ts +4 -0
- package/src/installnest.ts +0 -0
- package/src/installnuxt.ts +0 -0
- package/src/validation.ts +0 -0
- package/templates/basic/pageindex.vue.eta +9 -9
- package/templates/nuxt/plugins.simpleapp.ts.eta +3 -3
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
3
|
+
var useValue = arguments.length > 2;
|
|
4
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
5
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
6
|
+
}
|
|
7
|
+
return useValue ? value : void 0;
|
|
8
|
+
};
|
|
9
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
10
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
11
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
12
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
13
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
14
|
+
var _, done = false;
|
|
15
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
16
|
+
var context = {};
|
|
17
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
18
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
19
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
20
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
21
|
+
if (kind === "accessor") {
|
|
22
|
+
if (result === void 0) continue;
|
|
23
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
24
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
25
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
26
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
27
|
+
}
|
|
28
|
+
else if (_ = accept(result)) {
|
|
29
|
+
if (kind === "field") initializers.unshift(_);
|
|
30
|
+
else descriptor[key] = _;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
34
|
+
done = true;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.AppController = void 0;
|
|
42
|
+
const common_1 = require("@nestjs/common");
|
|
43
|
+
let AppController = (() => {
|
|
44
|
+
let _classDecorators = [(0, common_1.Controller)()];
|
|
45
|
+
let _classDescriptor;
|
|
46
|
+
let _classExtraInitializers = [];
|
|
47
|
+
let _classThis;
|
|
48
|
+
let _instanceExtraInitializers = [];
|
|
49
|
+
let _getHello_decorators;
|
|
50
|
+
var AppController = _classThis = class {
|
|
51
|
+
constructor(appService) {
|
|
52
|
+
this.appService = (__runInitializers(this, _instanceExtraInitializers), appService);
|
|
53
|
+
}
|
|
54
|
+
getHello() {
|
|
55
|
+
return this.appService.getHello();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
__setFunctionName(_classThis, "AppController");
|
|
59
|
+
(() => {
|
|
60
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
61
|
+
_getHello_decorators = [(0, common_1.Get)()];
|
|
62
|
+
__esDecorate(_classThis, null, _getHello_decorators, { kind: "method", name: "getHello", static: false, private: false, access: { has: obj => "getHello" in obj, get: obj => obj.getHello }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
63
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
64
|
+
AppController = _classThis = _classDescriptor.value;
|
|
65
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
66
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
67
|
+
})();
|
|
68
|
+
return AppController = _classThis;
|
|
69
|
+
})();
|
|
70
|
+
exports.AppController = AppController;
|
|
71
|
+
//# sourceMappingURL=app.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAiD;IAIpC,aAAa;4BADzB,IAAA,mBAAU,GAAE;;;;;;;QAEX,YAA6B,UAAsB;YAAtB,eAAU,yDAAV,UAAU,EAAY;QAAG,CAAC;QAGvD,QAAQ;YACN,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QACpC,CAAC;;;;;gCAHA,IAAA,YAAG,GAAE;QACN,iLAAA,QAAQ,6DAEP;QANH,6KAOC;;;QAPY,uDAAa;;;;AAAb,sCAAa"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const testing_1 = require("@nestjs/testing");
|
|
4
|
+
const app_controller_1 = require("./app.controller");
|
|
5
|
+
const app_service_1 = require("./app.service");
|
|
6
|
+
describe('AppController', () => {
|
|
7
|
+
let appController;
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
const app = await testing_1.Test.createTestingModule({
|
|
10
|
+
controllers: [app_controller_1.AppController],
|
|
11
|
+
providers: [app_service_1.AppService],
|
|
12
|
+
}).compile();
|
|
13
|
+
appController = app.get(app_controller_1.AppController);
|
|
14
|
+
});
|
|
15
|
+
describe('root', () => {
|
|
16
|
+
it('should return "Hello World!"', () => {
|
|
17
|
+
expect(appController.getHello()).toBe('Hello World!');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=app.controller.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.controller.spec.js","sourceRoot":"","sources":["app.controller.spec.ts"],"names":[],"mappings":";;AAAA,6CAAsD;AACtD,qDAAiD;AACjD,+CAA2C;AAE3C,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,aAA4B,CAAC;IAEjC,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,GAAG,GAAkB,MAAM,cAAI,CAAC,mBAAmB,CAAC;YACxD,WAAW,EAAE,CAAC,8BAAa,CAAC;YAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;SACxB,CAAC,CAAC,OAAO,EAAE,CAAC;QAEb,aAAa,GAAG,GAAG,CAAC,GAAG,CAAgB,8BAAa,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;YACtC,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Test, TestingModule } from '@nestjs/testing';
|
|
2
|
+
import { AppController } from './app.controller';
|
|
3
|
+
import { AppService } from './app.service';
|
|
4
|
+
|
|
5
|
+
describe('AppController', () => {
|
|
6
|
+
let appController: AppController;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
const app: TestingModule = await Test.createTestingModule({
|
|
10
|
+
controllers: [AppController],
|
|
11
|
+
providers: [AppService],
|
|
12
|
+
}).compile();
|
|
13
|
+
|
|
14
|
+
appController = app.get<AppController>(AppController);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('root', () => {
|
|
18
|
+
it('should return "Hello World!"', () => {
|
|
19
|
+
expect(appController.getHello()).toBe('Hello World!');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Controller, Get } from '@nestjs/common';
|
|
2
|
+
import { AppService } from './app.service';
|
|
3
|
+
|
|
4
|
+
@Controller()
|
|
5
|
+
export class AppController {
|
|
6
|
+
constructor(private readonly appService: AppService) {}
|
|
7
|
+
|
|
8
|
+
@Get()
|
|
9
|
+
getHello(): string {
|
|
10
|
+
return this.appService.getHello();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.AppModule = void 0;
|
|
42
|
+
const common_1 = require("@nestjs/common");
|
|
43
|
+
const app_controller_1 = require("./app.controller");
|
|
44
|
+
const app_service_1 = require("./app.service");
|
|
45
|
+
let AppModule = (() => {
|
|
46
|
+
let _classDecorators = [(0, common_1.Module)({
|
|
47
|
+
imports: [],
|
|
48
|
+
controllers: [app_controller_1.AppController],
|
|
49
|
+
providers: [app_service_1.AppService],
|
|
50
|
+
})];
|
|
51
|
+
let _classDescriptor;
|
|
52
|
+
let _classExtraInitializers = [];
|
|
53
|
+
let _classThis;
|
|
54
|
+
var AppModule = _classThis = class {
|
|
55
|
+
};
|
|
56
|
+
__setFunctionName(_classThis, "AppModule");
|
|
57
|
+
(() => {
|
|
58
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
59
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
60
|
+
AppModule = _classThis = _classDescriptor.value;
|
|
61
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
62
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
63
|
+
})();
|
|
64
|
+
return AppModule = _classThis;
|
|
65
|
+
})();
|
|
66
|
+
exports.AppModule = AppModule;
|
|
67
|
+
//# sourceMappingURL=app.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["app.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;IAO9B,SAAS;4BALrB,IAAA,eAAM,EAAC;YACN,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,CAAC,8BAAa,CAAC;YAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;SACxB,CAAC;;;;;;;;;QACF,6KAAyB;;;QAAZ,uDAAS;;;;AAAT,8BAAS"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.unshift(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
28
|
+
};
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
35
|
+
};
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.AppService = void 0;
|
|
42
|
+
const common_1 = require("@nestjs/common");
|
|
43
|
+
let AppService = (() => {
|
|
44
|
+
let _classDecorators = [(0, common_1.Injectable)()];
|
|
45
|
+
let _classDescriptor;
|
|
46
|
+
let _classExtraInitializers = [];
|
|
47
|
+
let _classThis;
|
|
48
|
+
var AppService = _classThis = class {
|
|
49
|
+
getHello() {
|
|
50
|
+
return 'Hello World!';
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
__setFunctionName(_classThis, "AppService");
|
|
54
|
+
(() => {
|
|
55
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
56
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
57
|
+
AppService = _classThis = _classDescriptor.value;
|
|
58
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
59
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
60
|
+
})();
|
|
61
|
+
return AppService = _classThis;
|
|
62
|
+
})();
|
|
63
|
+
exports.AppService = AppService;
|
|
64
|
+
//# sourceMappingURL=app.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["app.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;IAG/B,UAAU;4BADtB,IAAA,mBAAU,GAAE;;;;;QAEX,QAAQ;YACN,OAAO,cAAc,CAAC;QACxB,CAAC;;;;;QAHH,6KAIC;;;QAJY,uDAAU;;;;AAAV,gCAAU"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimpleAppController = void 0;
|
|
4
|
+
const doctype = 'person'.toUpperCase();
|
|
5
|
+
// @ApiTags(doctype)
|
|
6
|
+
// @Controller(doctype.toLowerCase())
|
|
7
|
+
class SimpleAppController {
|
|
8
|
+
// protected apiSchemaClass=
|
|
9
|
+
constructor(service) {
|
|
10
|
+
this.service = service;
|
|
11
|
+
}
|
|
12
|
+
async _list() {
|
|
13
|
+
return this.service.list();
|
|
14
|
+
}
|
|
15
|
+
async _autocomplete(keyword) {
|
|
16
|
+
return this.service.getAutoComplete(keyword);
|
|
17
|
+
}
|
|
18
|
+
async _findOne(id) {
|
|
19
|
+
const result = (await this.service.findById(id));
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
async _create(data) {
|
|
23
|
+
//const newdata: persontype.Person = { ...data };
|
|
24
|
+
const newdata = {}; //= { ...data };
|
|
25
|
+
Object.assign(newdata, data); //
|
|
26
|
+
return this.service.setData(newdata).create();
|
|
27
|
+
}
|
|
28
|
+
async _update(id, data) {
|
|
29
|
+
const newdata = {}; //= { ...data };
|
|
30
|
+
Object.assign(newdata, data); //
|
|
31
|
+
return this.service.findIdThenUpdate(id, newdata);
|
|
32
|
+
}
|
|
33
|
+
async _delete(id) {
|
|
34
|
+
return this.service.findIdThenDelete(id);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.SimpleAppController = SimpleAppController;
|
|
38
|
+
//# sourceMappingURL=SimpleAppController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleAppController.js","sourceRoot":"","sources":["SimpleAppController.ts"],"names":[],"mappings":";;;AAYA,MAAM,OAAO,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;AAavC,oBAAoB;AACpB,qCAAqC;AACrC,MAAa,mBAAmB;IAG9B,8BAA8B;IAE9B,YAAY,OAAiB;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAGD,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IACD,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,EAAU;QACvB,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAe,CAAC;QAE/D,OAAO,MAA0B,CAAC;IACpC,CAAC;IAGD,KAAK,CAAC,OAAO,CAAC,IAAgB;QAC5B,iDAAiD;QACjD,MAAM,OAAO,GAAM,EAAO,CAAC,CAAC,gBAAgB;QAC5C,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAgB,CAAC;IAC9D,CAAC;IAGD,KAAK,CAAC,OAAO,CAAE,EAAU,EAAC,IAAgB;QACxC,MAAM,OAAO,GAAM,EAAO,CAAC,CAAC,gBAAgB;QAC5C,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,EAAE,OAAO,CAAe,CAAC;IAClE,CAAC;IAGD,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;CACF;AAzCD,kDAyCC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Controller,
|
|
3
|
+
Get,
|
|
4
|
+
Put,
|
|
5
|
+
Post,
|
|
6
|
+
Delete,
|
|
7
|
+
Body,
|
|
8
|
+
Param,
|
|
9
|
+
Type,
|
|
10
|
+
} from '@nestjs/common';
|
|
11
|
+
import { ApiTags, ApiBody, ApiResponse, ApiOperation } from '@nestjs/swagger';
|
|
12
|
+
|
|
13
|
+
const doctype = 'person'.toUpperCase();
|
|
14
|
+
type ServiceType = {
|
|
15
|
+
list: Function;
|
|
16
|
+
create: Function;
|
|
17
|
+
update: Function;
|
|
18
|
+
delete: Function;
|
|
19
|
+
findById: Function;
|
|
20
|
+
findIdThenDelete: Function;
|
|
21
|
+
findIdThenUpdate: Function;
|
|
22
|
+
setData: Function;
|
|
23
|
+
getAutoComplete: Function;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// @ApiTags(doctype)
|
|
27
|
+
// @Controller(doctype.toLowerCase())
|
|
28
|
+
export class SimpleAppController<TService extends ServiceType, TApiSchema, T> {
|
|
29
|
+
protected service: TService;
|
|
30
|
+
protected tryno: number;
|
|
31
|
+
// protected apiSchemaClass=
|
|
32
|
+
|
|
33
|
+
constructor(service: TService) {
|
|
34
|
+
this.service = service;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
async _list() {
|
|
39
|
+
return this.service.list();
|
|
40
|
+
}
|
|
41
|
+
async _autocomplete(keyword: string) {
|
|
42
|
+
return this.service.getAutoComplete(keyword);
|
|
43
|
+
}
|
|
44
|
+
async _findOne(id: string) {
|
|
45
|
+
const result = (await this.service.findById(id)) as TApiSchema;
|
|
46
|
+
|
|
47
|
+
return result as Type<TApiSchema>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
async _create(data: TApiSchema) {
|
|
52
|
+
//const newdata: persontype.Person = { ...data };
|
|
53
|
+
const newdata: T = {} as T; //= { ...data };
|
|
54
|
+
Object.assign(newdata, data); //
|
|
55
|
+
return this.service.setData(newdata).create() as TApiSchema;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
async _update( id: string,data: TApiSchema) {
|
|
60
|
+
const newdata: T = {} as T; //= { ...data };
|
|
61
|
+
Object.assign(newdata, data); //
|
|
62
|
+
return this.service.findIdThenUpdate(id, newdata) as TApiSchema;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
async _delete(id: string) {
|
|
67
|
+
return this.service.findIdThenDelete(id);
|
|
68
|
+
}
|
|
69
|
+
}
|