@simitgroup/simpleapp-generator 1.0.20 → 1.0.22
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 copy.md +882 -0
- package/README.md +53 -824
- package/definations/category.cat.jsonschema.json +11 -13
- package/definations/level.lvl.jsonschema.json +48 -0
- package/definations/product.prd.jsonschema.json +8 -2
- package/dist/framework.js +180 -0
- package/dist/framework.js.map +1 -0
- package/dist/generate.js +5 -5
- package/dist/generate.js.map +1 -1
- package/dist/index.js +45 -28
- package/dist/index.js.map +1 -1
- package/openapitools.json +7 -0
- package/package.json +2 -10
- package/sampleconfig.json +3 -0
- package/src/framework.ts +151 -0
- package/src/generate.ts +5 -5
- package/src/index.ts +23 -42
- package/templates/nest/nest.env.eta +7 -0
- package/templates/{nest.main.eta → nest/nest.main.eta} +1 -1
- package/templates/nuxt/env.eta +5 -3
- package/backend1/.eslintrc.js +0 -25
- package/backend1/.prettierrc +0 -4
- package/backend1/README.md +0 -73
- package/backend1/nest-cli.json +0 -8
- package/backend1/package.json +0 -69
- package/backend1/pnpm-lock.yaml +0 -5208
- package/backend1/src/app.controller.js +0 -71
- package/backend1/src/app.controller.js.map +0 -1
- package/backend1/src/app.controller.spec.js +0 -21
- package/backend1/src/app.controller.spec.js.map +0 -1
- package/backend1/src/app.controller.spec.ts +0 -22
- package/backend1/src/app.controller.ts +0 -12
- package/backend1/src/app.module.js +0 -67
- package/backend1/src/app.module.js.map +0 -1
- package/backend1/src/app.module.ts +0 -10
- package/backend1/src/app.service.js +0 -64
- package/backend1/src/app.service.js.map +0 -1
- package/backend1/src/app.service.ts +0 -8
- package/backend1/src/main.js +0 -10
- package/backend1/src/main.js.map +0 -1
- package/backend1/src/main.ts +0 -8
- package/backend1/test/app.e2e-spec.js +0 -45
- package/backend1/test/app.e2e-spec.js.map +0 -1
- package/backend1/test/app.e2e-spec.ts +0 -24
- package/backend1/test/jest-e2e.json +0 -9
- package/backend1/tsconfig.build.json +0 -4
- package/backend1/tsconfig.json +0 -21
- package/src/installdependency.ts +0 -4
- package/templates/SimpleAppClient.eta +0 -116
- package/templates/app.vue.eta +0 -21
- package/templates/nest.env.eta +0 -5
- /package/templates/{SimpleAppController.eta → nest/SimpleAppController.eta} +0 -0
- /package/templates/{SimpleAppService.eta → nest/SimpleAppService.eta} +0 -0
- /package/templates/{app.module.eta → nest/app.module.eta} +0 -0
|
@@ -1,71 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,64 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/backend1/src/main.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@nestjs/core");
|
|
4
|
-
const app_module_1 = require("./app.module");
|
|
5
|
-
async function bootstrap() {
|
|
6
|
-
const app = await core_1.NestFactory.create(app_module_1.AppModule);
|
|
7
|
-
await app.listen(3000);
|
|
8
|
-
}
|
|
9
|
-
bootstrap();
|
|
10
|
-
//# sourceMappingURL=main.js.map
|
package/backend1/src/main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,6CAAyC;AAEzC,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,CAAC,CAAC;IAChD,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AACD,SAAS,EAAE,CAAC"}
|
package/backend1/src/main.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const testing_1 = require("@nestjs/testing");
|
|
27
|
-
const request = __importStar(require("supertest"));
|
|
28
|
-
const app_module_1 = require("./../src/app.module");
|
|
29
|
-
describe('AppController (e2e)', () => {
|
|
30
|
-
let app;
|
|
31
|
-
beforeEach(async () => {
|
|
32
|
-
const moduleFixture = await testing_1.Test.createTestingModule({
|
|
33
|
-
imports: [app_module_1.AppModule],
|
|
34
|
-
}).compile();
|
|
35
|
-
app = moduleFixture.createNestApplication();
|
|
36
|
-
await app.init();
|
|
37
|
-
});
|
|
38
|
-
it('/ (GET)', () => {
|
|
39
|
-
return request(app.getHttpServer())
|
|
40
|
-
.get('/')
|
|
41
|
-
.expect(200)
|
|
42
|
-
.expect('Hello World!');
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=app.e2e-spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.e2e-spec.js","sourceRoot":"","sources":["app.e2e-spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAsD;AAEtD,mDAAqC;AACrC,oDAAgD;AAEhD,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,IAAI,GAAqB,CAAC;IAE1B,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,aAAa,GAAkB,MAAM,cAAI,CAAC,mBAAmB,CAAC;YAClE,OAAO,EAAE,CAAC,sBAAS,CAAC;SACrB,CAAC,CAAC,OAAO,EAAE,CAAC;QAEb,GAAG,GAAG,aAAa,CAAC,qBAAqB,EAAE,CAAC;QAC5C,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACjB,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;aAChC,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CAAC,GAAG,CAAC;aACX,MAAM,CAAC,cAAc,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Test, TestingModule } from '@nestjs/testing';
|
|
2
|
-
import { INestApplication } from '@nestjs/common';
|
|
3
|
-
import * as request from 'supertest';
|
|
4
|
-
import { AppModule } from './../src/app.module';
|
|
5
|
-
|
|
6
|
-
describe('AppController (e2e)', () => {
|
|
7
|
-
let app: INestApplication;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
11
|
-
imports: [AppModule],
|
|
12
|
-
}).compile();
|
|
13
|
-
|
|
14
|
-
app = moduleFixture.createNestApplication();
|
|
15
|
-
await app.init();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('/ (GET)', () => {
|
|
19
|
-
return request(app.getHttpServer())
|
|
20
|
-
.get('/')
|
|
21
|
-
.expect(200)
|
|
22
|
-
.expect('Hello World!');
|
|
23
|
-
});
|
|
24
|
-
});
|
package/backend1/tsconfig.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"removeComments": true,
|
|
6
|
-
"emitDecoratorMetadata": true,
|
|
7
|
-
"experimentalDecorators": true,
|
|
8
|
-
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"target": "ES2021",
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"outDir": "./dist",
|
|
12
|
-
"baseUrl": "./",
|
|
13
|
-
"incremental": true,
|
|
14
|
-
"skipLibCheck": true,
|
|
15
|
-
"strictNullChecks": false,
|
|
16
|
-
"noImplicitAny": false,
|
|
17
|
-
"strictBindCallApply": false,
|
|
18
|
-
"forceConsistentCasingInFileNames": false,
|
|
19
|
-
"noFallthroughCasesInSwitch": false
|
|
20
|
-
}
|
|
21
|
-
}
|
package/src/installdependency.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import Ajv from 'ajv';
|
|
2
|
-
import addFormats from 'ajv-formats';
|
|
3
|
-
import { ref, Ref } from 'vue';
|
|
4
|
-
import { AxiosResponse } from 'axios';
|
|
5
|
-
import { JSONSchema7 } from 'json-schema';
|
|
6
|
-
import { Configuration } from '../openapi';
|
|
7
|
-
type crudType = {
|
|
8
|
-
runFindOne: Function;
|
|
9
|
-
runCreate: Function;
|
|
10
|
-
runUpdate: Function;
|
|
11
|
-
runList: Function;
|
|
12
|
-
runDelete: Function;
|
|
13
|
-
};
|
|
14
|
-
export class SimpleAppClient<
|
|
15
|
-
TData extends { _id?: string },
|
|
16
|
-
TApi extends crudType,
|
|
17
|
-
defaultTimeout:number = 5000;
|
|
18
|
-
> {
|
|
19
|
-
protected docapi;
|
|
20
|
-
protected data = <Ref<TData>>ref({} as TData);
|
|
21
|
-
public schema = {}; //cant define data type, cause it make autocomplete gone.
|
|
22
|
-
protected doctype = '';
|
|
23
|
-
protected errorlist = ref({});
|
|
24
|
-
constructor(apiobj: TApi) {
|
|
25
|
-
this.docapi = apiobj;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
setDocType = (doctype: string) => (this.doctype = doctype);
|
|
29
|
-
setSchema = (schema: any) => (this.schema = schema);
|
|
30
|
-
getSchema = () => this.schema;
|
|
31
|
-
getErrors = () => this.errorlist;
|
|
32
|
-
getData = () => this.data.value;
|
|
33
|
-
getReactiveData = () => this.data;
|
|
34
|
-
setData = (data: any) => {
|
|
35
|
-
// this.data.value = data;
|
|
36
|
-
Object.assign(this.data.value, data);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
async getById(id: string) {
|
|
40
|
-
return await this.docapi.runFindOne(id,{timeout:this.defaultTimeout}).then((res: AxiosResponse) => {
|
|
41
|
-
// this.data.value = { ...res.data };
|
|
42
|
-
Object.assign(this.data.value, res.data);
|
|
43
|
-
return res;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
async create() {
|
|
47
|
-
const errors = this.validateFailed();
|
|
48
|
-
if (errors) {
|
|
49
|
-
return await Promise.reject(errors);
|
|
50
|
-
} else {
|
|
51
|
-
return await this.docapi
|
|
52
|
-
.runCreate(this.data.value,{timeout:this.defaultTimeout})
|
|
53
|
-
.then((res: AxiosResponse) => {
|
|
54
|
-
this.data.value = { ...res.data };
|
|
55
|
-
return res;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
async update() {
|
|
60
|
-
const recordid: string = this.data.value._id ?? '';
|
|
61
|
-
const errors = this.validateFailed();
|
|
62
|
-
if (errors) {
|
|
63
|
-
return await Promise.reject(errors);
|
|
64
|
-
} else {
|
|
65
|
-
return await this.docapi
|
|
66
|
-
.runUpdate(recordid, this.data.value,{timeout:this.defaultTimeout})
|
|
67
|
-
.then((res: AxiosResponse) => {
|
|
68
|
-
return res;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
async delete(id: string) {
|
|
73
|
-
return await this.docapi.runDelete(id,{timeout:this.defaultTimeout});
|
|
74
|
-
}
|
|
75
|
-
async list() {
|
|
76
|
-
return await this.docapi.runList({timeout:this.defaultTimeout});
|
|
77
|
-
}
|
|
78
|
-
find() {}
|
|
79
|
-
hook(type: string, data: TData) {
|
|
80
|
-
console.log('internal save hook');
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
validateFailed() {
|
|
84
|
-
const ajv = new Ajv({ allErrors: true });
|
|
85
|
-
ajv.addKeyword({
|
|
86
|
-
keyword:'autocompletesrc',
|
|
87
|
-
type:'string'
|
|
88
|
-
});
|
|
89
|
-
addFormats(ajv);
|
|
90
|
-
this.errorlist.value = {};
|
|
91
|
-
this.hook('pre-validation', this.data.value);
|
|
92
|
-
const validate = ajv.compile(this.schema);
|
|
93
|
-
const valid = validate(this.data.value);
|
|
94
|
-
if (!valid) {
|
|
95
|
-
const errors = validate.errors;
|
|
96
|
-
const tmp: { [key: string]: any } = {};
|
|
97
|
-
if (errors) {
|
|
98
|
-
for (let i = 0; i < errors?.length; i++) {
|
|
99
|
-
const key: string = errors[i]['instancePath'];
|
|
100
|
-
if (!tmp[key]) {
|
|
101
|
-
tmp[key] = [];
|
|
102
|
-
}
|
|
103
|
-
tmp[key].push(errors[i]);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// console.error(tmp);
|
|
107
|
-
this.errorlist.value = tmp;
|
|
108
|
-
// console.error(this.errorlist);
|
|
109
|
-
|
|
110
|
-
return validate.errors;
|
|
111
|
-
} else {
|
|
112
|
-
this.hook('post-validation', this.data.value);
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
package/templates/app.vue.eta
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div>
|
|
4
|
-
<label>Firstname</label>
|
|
5
|
-
<input v-model="reactivedata.name.firstName">{{ reactivedata }}
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
<button @click="person.create().then((res)=>console.log(res.data))">try</button>
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import {PersonDoc} from './server/docs/PersonDoc'
|
|
13
|
-
const person = new PersonDoc()
|
|
14
|
-
|
|
15
|
-
// person.update().then((res)=>console.log("dosomething"))
|
|
16
|
-
// person.delete('record-id').then((res)=>console.log("dosomething"))
|
|
17
|
-
// person.getById('record-id').then((res)=>console.log("dosomething"))
|
|
18
|
-
// person.list().then((res)=>console.log(res))
|
|
19
|
-
const noreactivedata = person.getData()
|
|
20
|
-
const reactivedata = person.getReactiveData()
|
|
21
|
-
</script>
|
package/templates/nest.env.eta
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|