@ug.software/opposer 3.0.10 → 3.0.11
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/lib/bin/commands/build.js +15 -28
- package/lib/bin/commands/init.js +27 -30
- package/lib/esm/server/security/jwt/index.d.ts +1 -1
- package/lib/esm/server/security/jwt/index.js +21 -29
- package/lib/esm/system/index.d.ts +1 -1
- package/lib/esm/system/index.js +42 -55
- package/package.json +3 -3
- package/lib/cjs/examples/full-app/index.d.ts +0 -1
- package/lib/cjs/examples/full-app/index.js +0 -102
- package/lib/cjs/examples/full-app/models/author.d.ts +0 -7
- package/lib/cjs/examples/full-app/models/author.js +0 -42
- package/lib/cjs/examples/full-app/models/book.d.ts +0 -9
- package/lib/cjs/examples/full-app/models/book.js +0 -51
- package/lib/cjs/examples/full-app/models/category.d.ts +0 -4
- package/lib/cjs/examples/full-app/models/category.js +0 -26
- package/lib/cjs/examples/full-app/schedules/catalog-refresh.d.ts +0 -28
- package/lib/cjs/examples/full-app/schedules/catalog-refresh.js +0 -149
- package/lib/cjs/examples/full-app/schedules/inventory-sync.d.ts +0 -12
- package/lib/cjs/examples/full-app/schedules/inventory-sync.js +0 -61
- package/lib/cjs/examples/full-app/schedules/library-alerts.d.ts +0 -11
- package/lib/cjs/examples/full-app/schedules/library-alerts.js +0 -55
- package/lib/cjs/examples/minimal/src/handlers/book.d.ts +0 -11
- package/lib/cjs/examples/minimal/src/handlers/book.js +0 -51
- package/lib/cjs/examples/minimal/src/index.d.ts +0 -1
- package/lib/cjs/examples/minimal/src/index.js +0 -14
- package/lib/cjs/examples/minimal/src/models/books.d.ts +0 -4
- package/lib/cjs/examples/minimal/src/models/books.js +0 -26
- package/lib/cjs/examples/orm/models/permission.d.ts +0 -6
- package/lib/cjs/examples/orm/models/permission.js +0 -38
- package/lib/cjs/examples/orm/models/profile.d.ts +0 -7
- package/lib/cjs/examples/orm/models/profile.js +0 -42
- package/lib/cjs/examples/orm/models/user.d.ts +0 -11
- package/lib/cjs/examples/orm/models/user.js +0 -70
- package/lib/cjs/examples/orm/mysql/index.d.ts +0 -1
- package/lib/cjs/examples/orm/mysql/index.js +0 -44
- package/lib/cjs/examples/orm/postgres/index.d.ts +0 -1
- package/lib/cjs/examples/orm/postgres/index.js +0 -40
- package/lib/cjs/examples/orm/sqlite/index.d.ts +0 -1
- package/lib/cjs/examples/orm/sqlite/index.js +0 -41
- package/lib/cjs/index.d.ts +0 -2
- package/lib/cjs/index.js +0 -23
- package/lib/cjs/interfaces/controller.d.ts +0 -109
- package/lib/cjs/interfaces/controller.js +0 -2
- package/lib/cjs/interfaces/field.d.ts +0 -23
- package/lib/cjs/interfaces/field.js +0 -2
- package/lib/cjs/interfaces/handler.d.ts +0 -18
- package/lib/cjs/interfaces/handler.js +0 -2
- package/lib/cjs/interfaces/jwt.d.ts +0 -21
- package/lib/cjs/interfaces/jwt.js +0 -2
- package/lib/cjs/interfaces/model.d.ts +0 -9
- package/lib/cjs/interfaces/model.js +0 -2
- package/lib/cjs/interfaces/request.d.ts +0 -13
- package/lib/cjs/interfaces/request.js +0 -2
- package/lib/cjs/interfaces/schema.d.ts +0 -9
- package/lib/cjs/interfaces/schema.js +0 -2
- package/lib/cjs/interfaces/security.d.ts +0 -32
- package/lib/cjs/interfaces/security.js +0 -2
- package/lib/cjs/interfaces/server.d.ts +0 -37
- package/lib/cjs/interfaces/server.js +0 -2
- package/lib/cjs/interfaces/system.d.ts +0 -41
- package/lib/cjs/interfaces/system.js +0 -2
- package/lib/cjs/orm/decorators/index.d.ts +0 -33
- package/lib/cjs/orm/decorators/index.js +0 -131
- package/lib/cjs/orm/driver/mysql.d.ts +0 -14
- package/lib/cjs/orm/driver/mysql.js +0 -103
- package/lib/cjs/orm/driver/postgres.d.ts +0 -14
- package/lib/cjs/orm/driver/postgres.js +0 -105
- package/lib/cjs/orm/driver/sqlite.d.ts +0 -14
- package/lib/cjs/orm/driver/sqlite.js +0 -143
- package/lib/cjs/orm/index.d.ts +0 -8
- package/lib/cjs/orm/index.js +0 -28
- package/lib/cjs/orm/metadata.d.ts +0 -47
- package/lib/cjs/orm/metadata.js +0 -47
- package/lib/cjs/orm/opposer.d.ts +0 -30
- package/lib/cjs/orm/opposer.js +0 -33
- package/lib/cjs/orm/query-builder.d.ts +0 -32
- package/lib/cjs/orm/query-builder.js +0 -278
- package/lib/cjs/orm/repository.d.ts +0 -54
- package/lib/cjs/orm/repository.js +0 -325
- package/lib/cjs/orm/validation.d.ts +0 -44
- package/lib/cjs/orm/validation.js +0 -128
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/persistent/cache/core-context.d.ts +0 -17
- package/lib/cjs/persistent/cache/core-context.js +0 -39
- package/lib/cjs/persistent/cache/global.d.ts +0 -18
- package/lib/cjs/persistent/cache/global.js +0 -22
- package/lib/cjs/persistent/cache/index.d.ts +0 -3
- package/lib/cjs/persistent/cache/index.js +0 -12
- package/lib/cjs/persistent/cache/session.d.ts +0 -19
- package/lib/cjs/persistent/cache/session.js +0 -39
- package/lib/cjs/persistent/cache/storage.d.ts +0 -14
- package/lib/cjs/persistent/cache/storage.js +0 -88
- package/lib/cjs/persistent/cache/store.d.ts +0 -16
- package/lib/cjs/persistent/cache/store.js +0 -112
- package/lib/cjs/persistent/context/index.d.ts +0 -3
- package/lib/cjs/persistent/context/index.js +0 -5
- package/lib/cjs/persistent/decorators/global.d.ts +0 -1
- package/lib/cjs/persistent/decorators/global.js +0 -25
- package/lib/cjs/persistent/decorators/session.d.ts +0 -1
- package/lib/cjs/persistent/decorators/session.js +0 -27
- package/lib/cjs/persistent/index.d.ts +0 -6
- package/lib/cjs/persistent/index.js +0 -18
- package/lib/cjs/persistent/interfaces/context.d.ts +0 -5
- package/lib/cjs/persistent/interfaces/context.js +0 -2
- package/lib/cjs/persistent/interfaces/system.d.ts +0 -47
- package/lib/cjs/persistent/interfaces/system.js +0 -29
- package/lib/cjs/persistent/system/index.d.ts +0 -7
- package/lib/cjs/persistent/system/index.js +0 -44
- package/lib/cjs/persistent/utils/memory.d.ts +0 -8
- package/lib/cjs/persistent/utils/memory.js +0 -44
- package/lib/cjs/persistent/utils/timer.d.ts +0 -14
- package/lib/cjs/persistent/utils/timer.js +0 -21
- package/lib/cjs/playground/build/client/assets/AddRounded-ByHfnsiW.js +0 -4
- package/lib/cjs/playground/build/client/assets/Button-DLrxHRm7.js +0 -1
- package/lib/cjs/playground/build/client/assets/Container-CgITmmbk.js +0 -1
- package/lib/cjs/playground/build/client/assets/Divider-B_Wx9srO.js +0 -1
- package/lib/cjs/playground/build/client/assets/List-juBjUmfP.js +0 -1
- package/lib/cjs/playground/build/client/assets/ListItemText-DgWZmgzc.js +0 -1
- package/lib/cjs/playground/build/client/assets/MenuItem-D_5SuVKQ.js +0 -1
- package/lib/cjs/playground/build/client/assets/Modal-BwXR_5Bh.js +0 -1
- package/lib/cjs/playground/build/client/assets/TableRow-B9hAmlnV.js +0 -2
- package/lib/cjs/playground/build/client/assets/TextField-UybdTIGB.js +0 -3
- package/lib/cjs/playground/build/client/assets/Tooltip-BGcUWUcF.js +0 -1
- package/lib/cjs/playground/build/client/assets/auth-CD1rXHzz.js +0 -1
- package/lib/cjs/playground/build/client/assets/auth-GyTIVKy5.js +0 -1
- package/lib/cjs/playground/build/client/assets/confirm-Dr0pbiV6.js +0 -1
- package/lib/cjs/playground/build/client/assets/dividerClasses-CIiqeEPO.js +0 -1
- package/lib/cjs/playground/build/client/assets/entry.client-D6FYz1yh.js +0 -13
- package/lib/cjs/playground/build/client/assets/index-CJ0wdt6Z.js +0 -1
- package/lib/cjs/playground/build/client/assets/index-CQc11yq_.js +0 -1153
- package/lib/cjs/playground/build/client/assets/index-Cr4I-4J2.js +0 -1
- package/lib/cjs/playground/build/client/assets/index-CtPqstFl.js +0 -26
- package/lib/cjs/playground/build/client/assets/index-Ct_NE85o.js +0 -1
- package/lib/cjs/playground/build/client/assets/index-D0I6xwmb.js +0 -1
- package/lib/cjs/playground/build/client/assets/index-DmDCpKb3.js +0 -1
- package/lib/cjs/playground/build/client/assets/index-DsSkAwyn.js +0 -1
- package/lib/cjs/playground/build/client/assets/index-_DMgWZ3Y.js +0 -1
- package/lib/cjs/playground/build/client/assets/listItemIconClasses-39Itzgzt.js +0 -1
- package/lib/cjs/playground/build/client/assets/listItemTextClasses-EQFLPLzt.js +0 -1
- package/lib/cjs/playground/build/client/assets/manifest-c06e9a7f.js +0 -1
- package/lib/cjs/playground/build/client/assets/mergeSlotProps-DptgQgAT.js +0 -1
- package/lib/cjs/playground/build/client/assets/playground-Hl52p9f5.js +0 -108
- package/lib/cjs/playground/build/client/assets/root-CQTBmuv8.js +0 -1
- package/lib/cjs/playground/build/client/assets/toast-CsAH5FIf.js +0 -1
- package/lib/cjs/playground/build/client/assets/use-request-BZNkzlTr.js +0 -1
- package/lib/cjs/playground/build/client/favicon.ico +0 -0
- package/lib/cjs/playground/build/client/index.html +0 -6
- package/lib/cjs/playground/index.d.ts +0 -2
- package/lib/cjs/playground/index.js +0 -135
- package/lib/cjs/scheduler/controllers/index.d.ts +0 -19
- package/lib/cjs/scheduler/controllers/index.js +0 -62
- package/lib/cjs/scheduler/decorators/index.d.ts +0 -9
- package/lib/cjs/scheduler/decorators/index.js +0 -21
- package/lib/cjs/scheduler/handlers/index.d.ts +0 -19
- package/lib/cjs/scheduler/handlers/index.js +0 -62
- package/lib/cjs/scheduler/index.d.ts +0 -24
- package/lib/cjs/scheduler/index.js +0 -110
- package/lib/cjs/scheduler/models/history.d.ts +0 -10
- package/lib/cjs/scheduler/models/history.js +0 -50
- package/lib/cjs/server/constants/index.d.ts +0 -78
- package/lib/cjs/server/constants/index.js +0 -372
- package/lib/cjs/server/context/index.d.ts +0 -17
- package/lib/cjs/server/context/index.js +0 -33
- package/lib/cjs/server/controller/index.d.ts +0 -3
- package/lib/cjs/server/controller/index.js +0 -217
- package/lib/cjs/server/controllers/index.d.ts +0 -5
- package/lib/cjs/server/controllers/index.js +0 -72
- package/lib/cjs/server/core/index.d.ts +0 -16
- package/lib/cjs/server/core/index.js +0 -110
- package/lib/cjs/server/core/middleware/body-parser.d.ts +0 -2
- package/lib/cjs/server/core/middleware/body-parser.js +0 -27
- package/lib/cjs/server/core/middleware/cors.d.ts +0 -4
- package/lib/cjs/server/core/middleware/cors.js +0 -32
- package/lib/cjs/server/core/middleware/logger.d.ts +0 -2
- package/lib/cjs/server/core/middleware/logger.js +0 -15
- package/lib/cjs/server/decorators/controller.d.ts +0 -3
- package/lib/cjs/server/decorators/controller.js +0 -14
- package/lib/cjs/server/decorators/field.d.ts +0 -2
- package/lib/cjs/server/decorators/field.js +0 -36
- package/lib/cjs/server/decorators/handler.d.ts +0 -3
- package/lib/cjs/server/decorators/handler.js +0 -14
- package/lib/cjs/server/decorators/index.d.ts +0 -7
- package/lib/cjs/server/decorators/index.js +0 -26
- package/lib/cjs/server/decorators/is-public-method.d.ts +0 -3
- package/lib/cjs/server/decorators/is-public-method.js +0 -16
- package/lib/cjs/server/decorators/is-public.d.ts +0 -3
- package/lib/cjs/server/decorators/is-public.js +0 -14
- package/lib/cjs/server/decorators/method.d.ts +0 -3
- package/lib/cjs/server/decorators/method.js +0 -16
- package/lib/cjs/server/decorators/payload.d.ts +0 -3
- package/lib/cjs/server/decorators/payload.js +0 -15
- package/lib/cjs/server/handlers/index.d.ts +0 -5
- package/lib/cjs/server/handlers/index.js +0 -72
- package/lib/cjs/server/helpers/index.d.ts +0 -17
- package/lib/cjs/server/helpers/index.js +0 -39
- package/lib/cjs/server/index.d.ts +0 -12
- package/lib/cjs/server/index.js +0 -176
- package/lib/cjs/server/security/controller/auth.d.ts +0 -76
- package/lib/cjs/server/security/controller/auth.js +0 -346
- package/lib/cjs/server/security/index.d.ts +0 -2
- package/lib/cjs/server/security/index.js +0 -10
- package/lib/cjs/server/security/jwt/index.d.ts +0 -23
- package/lib/cjs/server/security/jwt/index.js +0 -108
- package/lib/cjs/server/security/middleware/autorization.d.ts +0 -3
- package/lib/cjs/server/security/middleware/autorization.js +0 -46
- package/lib/cjs/server/security/middleware/permission.d.ts +0 -3
- package/lib/cjs/server/security/middleware/permission.js +0 -138
- package/lib/cjs/server/security/models/crp.d.ts +0 -8
- package/lib/cjs/server/security/models/crp.js +0 -42
- package/lib/cjs/server/security/models/ke.d.ts +0 -7
- package/lib/cjs/server/security/models/ke.js +0 -38
- package/lib/cjs/server/security/models/rl.d.ts +0 -9
- package/lib/cjs/server/security/models/rl.js +0 -50
- package/lib/cjs/server/security/models/se.d.ts +0 -11
- package/lib/cjs/server/security/models/se.js +0 -54
- package/lib/cjs/server/security/models/usr.d.ts +0 -14
- package/lib/cjs/server/security/models/usr.js +0 -82
- package/lib/cjs/server/services/delete.d.ts +0 -13
- package/lib/cjs/server/services/delete.js +0 -49
- package/lib/cjs/server/services/get.d.ts +0 -4
- package/lib/cjs/server/services/get.js +0 -145
- package/lib/cjs/server/services/insert.d.ts +0 -13
- package/lib/cjs/server/services/insert.js +0 -74
- package/lib/cjs/server/services/update.d.ts +0 -13
- package/lib/cjs/server/services/update.js +0 -60
- package/lib/cjs/system/index.d.ts +0 -13
- package/lib/cjs/system/index.js +0 -237
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const index_js_1 = require("../../../orm/index.js");
|
|
16
|
-
const book_js_1 = __importDefault(require("./book.js"));
|
|
17
|
-
let Author = class Author {
|
|
18
|
-
};
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, index_js_1.PrimaryColumn)({ type: "uuid" }),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], Author.prototype, "id", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, index_js_1.Field)(() => (0, index_js_1.f)().string("Name is string").required("Name is required")),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], Author.prototype, "name", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, index_js_1.Field)({ type: "string" }),
|
|
29
|
-
__metadata("design:type", String)
|
|
30
|
-
], Author.prototype, "nationality", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, index_js_1.Relation)({
|
|
33
|
-
type: "one-to-many",
|
|
34
|
-
target: () => book_js_1.default,
|
|
35
|
-
inverseSide: "author"
|
|
36
|
-
}),
|
|
37
|
-
__metadata("design:type", Array)
|
|
38
|
-
], Author.prototype, "books", void 0);
|
|
39
|
-
Author = __decorate([
|
|
40
|
-
(0, index_js_1.Entity)("authors", { description: "The author of the book, which contains the name and nationality" })
|
|
41
|
-
], Author);
|
|
42
|
-
exports.default = Author;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const index_js_1 = require("../../../orm/index.js");
|
|
16
|
-
const author_js_1 = __importDefault(require("./author.js"));
|
|
17
|
-
const category_js_1 = __importDefault(require("./category.js"));
|
|
18
|
-
let Book = class Book {
|
|
19
|
-
};
|
|
20
|
-
__decorate([
|
|
21
|
-
(0, index_js_1.PrimaryColumn)({ type: "uuid" }),
|
|
22
|
-
__metadata("design:type", String)
|
|
23
|
-
], Book.prototype, "id", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, index_js_1.Field)(() => (0, index_js_1.f)().string("Title is string").required("Title is required")),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], Book.prototype, "title", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, index_js_1.Field)({ type: "number", default: 0 }),
|
|
30
|
-
__metadata("design:type", Number)
|
|
31
|
-
], Book.prototype, "price", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, index_js_1.Relation)({
|
|
34
|
-
type: "many-to-one",
|
|
35
|
-
target: () => author_js_1.default,
|
|
36
|
-
inverseSide: "books"
|
|
37
|
-
}),
|
|
38
|
-
__metadata("design:type", author_js_1.default)
|
|
39
|
-
], Book.prototype, "author", void 0);
|
|
40
|
-
__decorate([
|
|
41
|
-
(0, index_js_1.Relation)({
|
|
42
|
-
type: "many-to-one",
|
|
43
|
-
target: () => category_js_1.default,
|
|
44
|
-
inverseSide: "books"
|
|
45
|
-
}),
|
|
46
|
-
__metadata("design:type", category_js_1.default)
|
|
47
|
-
], Book.prototype, "category", void 0);
|
|
48
|
-
Book = __decorate([
|
|
49
|
-
(0, index_js_1.Entity)("books", { description: "Entity representing a book in the store" })
|
|
50
|
-
], Book);
|
|
51
|
-
exports.default = Book;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const index_js_1 = require("../../../orm/index.js");
|
|
13
|
-
let Category = class Category {
|
|
14
|
-
};
|
|
15
|
-
__decorate([
|
|
16
|
-
(0, index_js_1.PrimaryColumn)({ type: "uuid" }),
|
|
17
|
-
__metadata("design:type", String)
|
|
18
|
-
], Category.prototype, "id", void 0);
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, index_js_1.Field)(() => (0, index_js_1.f)().string("Title is string").required("Title is required")),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], Category.prototype, "title", void 0);
|
|
23
|
-
Category = __decorate([
|
|
24
|
-
(0, index_js_1.Entity)("categories")
|
|
25
|
-
], Category);
|
|
26
|
-
exports.default = Category;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { OpposerDatabase } from '../../../orm';
|
|
2
|
-
export default class CatalogRefreshSchedules {
|
|
3
|
-
refreshCatalog(): Promise<{
|
|
4
|
-
status: string;
|
|
5
|
-
imported: number;
|
|
6
|
-
timestamp: string;
|
|
7
|
-
message?: undefined;
|
|
8
|
-
} | {
|
|
9
|
-
status: string;
|
|
10
|
-
message: any;
|
|
11
|
-
imported?: undefined;
|
|
12
|
-
timestamp?: undefined;
|
|
13
|
-
}>;
|
|
14
|
-
/**
|
|
15
|
-
* Logic to wipe and refill the catalog with 10,000 books
|
|
16
|
-
*/
|
|
17
|
-
static performRefresh(db: OpposerDatabase): Promise<{
|
|
18
|
-
status: string;
|
|
19
|
-
imported: number;
|
|
20
|
-
timestamp: string;
|
|
21
|
-
message?: undefined;
|
|
22
|
-
} | {
|
|
23
|
-
status: string;
|
|
24
|
-
message: any;
|
|
25
|
-
imported?: undefined;
|
|
26
|
-
timestamp?: undefined;
|
|
27
|
-
}>;
|
|
28
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const scheduler_1 = require("../../../scheduler");
|
|
16
|
-
const server_1 = require("../../../server");
|
|
17
|
-
const book_js_1 = __importDefault(require("../models/book.js"));
|
|
18
|
-
const author_js_1 = __importDefault(require("../models/author.js"));
|
|
19
|
-
const category_js_1 = __importDefault(require("../models/category.js"));
|
|
20
|
-
const crypto_1 = require("crypto");
|
|
21
|
-
class CatalogRefreshSchedules {
|
|
22
|
-
async refreshCatalog() {
|
|
23
|
-
console.log('[schedule] Starting hourly catalog refresh...');
|
|
24
|
-
const db = server_1.Context.get('db');
|
|
25
|
-
return await CatalogRefreshSchedules.performRefresh(db);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Logic to wipe and refill the catalog with 10,000 books
|
|
29
|
-
*/
|
|
30
|
-
static async performRefresh(db) {
|
|
31
|
-
try {
|
|
32
|
-
const authorRepo = db.getRepository(author_js_1.default);
|
|
33
|
-
const categoryRepo = db.getRepository(category_js_1.default);
|
|
34
|
-
const bookRepo = db.getRepository(book_js_1.default);
|
|
35
|
-
const totalToFetch = 100;
|
|
36
|
-
const pageSize = 10;
|
|
37
|
-
const pages = totalToFetch / pageSize;
|
|
38
|
-
console.log(`[catalog-refresh] Fetching ${totalToFetch} books from Open Library...`);
|
|
39
|
-
const allBooksData = [];
|
|
40
|
-
for (let i = 0; i < pages; i += 5) {
|
|
41
|
-
const requests = [];
|
|
42
|
-
for (let j = 0; j < 5 && i + j < pages; j++) {
|
|
43
|
-
const page = i + j + 1;
|
|
44
|
-
requests.push(fetch(`https://openlibrary.org/search.json?q=has_fulltext:true&page=${page}&limit=${pageSize}`)
|
|
45
|
-
.then((res) => res.json())
|
|
46
|
-
.then((data) => data.docs || [])
|
|
47
|
-
.catch((err) => {
|
|
48
|
-
console.error(`Error fetching page ${page}:`, err.message);
|
|
49
|
-
return [];
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
const results = await Promise.all(requests);
|
|
53
|
-
allBooksData.push(...results.flat());
|
|
54
|
-
if (allBooksData.length >= totalToFetch)
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
console.log('allBooksData', allBooksData);
|
|
58
|
-
if (allBooksData.length === 0)
|
|
59
|
-
throw new Error('No books fetched from API');
|
|
60
|
-
console.log(`[catalog-refresh] Wiping current database...`);
|
|
61
|
-
//@ts-ignore
|
|
62
|
-
if (typeof db.query === 'function') {
|
|
63
|
-
//@ts-ignore
|
|
64
|
-
await db.query('DELETE FROM books');
|
|
65
|
-
//@ts-ignore
|
|
66
|
-
await db.query('DELETE FROM authors');
|
|
67
|
-
//@ts-ignore
|
|
68
|
-
await db.query('DELETE FROM categories');
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
//@ts-ignore
|
|
72
|
-
if (typeof bookRepo.delete === 'function') {
|
|
73
|
-
//@ts-ignore
|
|
74
|
-
await bookRepo.delete({});
|
|
75
|
-
//@ts-ignore
|
|
76
|
-
await authorRepo.delete({});
|
|
77
|
-
//@ts-ignore
|
|
78
|
-
await categoryRepo.delete({});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const authorsMap = new Map();
|
|
82
|
-
const categoriesMap = new Map();
|
|
83
|
-
let importedCount = 0;
|
|
84
|
-
console.log(`[catalog-refresh] Processing and inserting records...`);
|
|
85
|
-
for (const bookData of allBooksData) {
|
|
86
|
-
if (!bookData.title)
|
|
87
|
-
continue;
|
|
88
|
-
// Author
|
|
89
|
-
const authorName = (bookData.author_name && bookData.author_name[0]) || 'Unknown Author';
|
|
90
|
-
let authorId = authorsMap.get(authorName);
|
|
91
|
-
if (!authorId) {
|
|
92
|
-
authorId = (0, crypto_1.randomUUID)();
|
|
93
|
-
await authorRepo.insert({
|
|
94
|
-
id: authorId,
|
|
95
|
-
name: authorName,
|
|
96
|
-
nationality: 'Unknown',
|
|
97
|
-
});
|
|
98
|
-
authorsMap.set(authorName, authorId);
|
|
99
|
-
}
|
|
100
|
-
// Category
|
|
101
|
-
const categoryName = (bookData.subject && bookData.subject[0]) || 'General';
|
|
102
|
-
let categoryId = categoriesMap.get(categoryName);
|
|
103
|
-
if (!categoryId) {
|
|
104
|
-
categoryId = (0, crypto_1.randomUUID)();
|
|
105
|
-
await categoryRepo.insert({
|
|
106
|
-
id: categoryId,
|
|
107
|
-
title: categoryName,
|
|
108
|
-
});
|
|
109
|
-
categoriesMap.set(categoryName, categoryId);
|
|
110
|
-
}
|
|
111
|
-
// Book
|
|
112
|
-
let imageUrl = bookData.cover_i ? `https://covers.openlibrary.org/b/id/${bookData.cover_i}-L.jpg` : undefined;
|
|
113
|
-
await bookRepo.insert({
|
|
114
|
-
id: (0, crypto_1.randomUUID)(),
|
|
115
|
-
title: bookData.title,
|
|
116
|
-
price: Math.floor(Math.random() * 100) + 20,
|
|
117
|
-
imageUrl,
|
|
118
|
-
author: authorId,
|
|
119
|
-
category: categoryId,
|
|
120
|
-
});
|
|
121
|
-
importedCount++;
|
|
122
|
-
if (importedCount % 1000 === 0)
|
|
123
|
-
console.log(`[catalog-refresh] Imported ${importedCount} books...`);
|
|
124
|
-
if (importedCount >= totalToFetch)
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
console.log(`[catalog-refresh] Success! Total imported: ${importedCount}`);
|
|
128
|
-
return {
|
|
129
|
-
status: 'success',
|
|
130
|
-
imported: importedCount,
|
|
131
|
-
timestamp: new Date().toISOString(),
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
catch (error) {
|
|
135
|
-
console.error(`[catalog-refresh] Failed:`, error.message);
|
|
136
|
-
return { status: 'error', message: error.message };
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
exports.default = CatalogRefreshSchedules;
|
|
141
|
-
__decorate([
|
|
142
|
-
(0, scheduler_1.Schedule)({
|
|
143
|
-
name: 'hourly-catalog-wipe-and-refill',
|
|
144
|
-
interval: 3600000, // 1 hour
|
|
145
|
-
}),
|
|
146
|
-
__metadata("design:type", Function),
|
|
147
|
-
__metadata("design:paramtypes", []),
|
|
148
|
-
__metadata("design:returntype", Promise)
|
|
149
|
-
], CatalogRefreshSchedules.prototype, "refreshCatalog", null);
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const index_js_1 = require("../../../scheduler/index.js");
|
|
16
|
-
const index_js_2 = require("../../../server/index.js");
|
|
17
|
-
const book_js_1 = __importDefault(require("../models/book.js"));
|
|
18
|
-
class InventorySchedules {
|
|
19
|
-
async checkStock() {
|
|
20
|
-
// Using the new global Context to get the database
|
|
21
|
-
const db = index_js_2.Context.get("db");
|
|
22
|
-
const bookRepo = db.getRepository(book_js_1.default);
|
|
23
|
-
const count = await bookRepo.count({});
|
|
24
|
-
console.log(`[schedule] Inventory check: ${count} books in library.`);
|
|
25
|
-
return {
|
|
26
|
-
timestamp: new Date().toISOString(),
|
|
27
|
-
booksChecked: count,
|
|
28
|
-
status: "Inventory levels are stable"
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
async importCatalog() {
|
|
32
|
-
console.log(`[schedule] Importing new titles from external partners...`);
|
|
33
|
-
// Simulate API delay
|
|
34
|
-
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
35
|
-
return {
|
|
36
|
-
imported: 12,
|
|
37
|
-
skipped: 2,
|
|
38
|
-
errors: 0
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.default = InventorySchedules;
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, index_js_1.Schedule)({
|
|
45
|
-
name: "library-inventory-check",
|
|
46
|
-
interval: 300000, // 5 minutes
|
|
47
|
-
}),
|
|
48
|
-
__metadata("design:type", Function),
|
|
49
|
-
__metadata("design:paramtypes", []),
|
|
50
|
-
__metadata("design:returntype", Promise)
|
|
51
|
-
], InventorySchedules.prototype, "checkStock", null);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, index_js_1.Schedule)({
|
|
54
|
-
name: "import-external-catalog",
|
|
55
|
-
interval: 3600000, // 1 hour
|
|
56
|
-
enabled: false
|
|
57
|
-
}),
|
|
58
|
-
__metadata("design:type", Function),
|
|
59
|
-
__metadata("design:paramtypes", []),
|
|
60
|
-
__metadata("design:returntype", Promise)
|
|
61
|
-
], InventorySchedules.prototype, "importCatalog", null);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const index_js_1 = require("../../../scheduler/index.js");
|
|
13
|
-
class LibraryAlertSchedules {
|
|
14
|
-
async checkOverdue() {
|
|
15
|
-
console.log(`[schedule] Checking for overdue book loans...`);
|
|
16
|
-
// Simulating finding overdue loans
|
|
17
|
-
const found = 3;
|
|
18
|
-
if (found > 0) {
|
|
19
|
-
console.log(`[schedule] Sending ${found} notifications to readers.`);
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
overdueCount: found,
|
|
23
|
-
notificationsSent: true
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
async generateSalesReport() {
|
|
27
|
-
console.log(`[schedule] Generating periodic sales report for authors...`);
|
|
28
|
-
// Simulation
|
|
29
|
-
const reportId = `REP-${Math.floor(Math.random() * 10000)}`;
|
|
30
|
-
return {
|
|
31
|
-
reportId,
|
|
32
|
-
status: "Report generated and available for download.",
|
|
33
|
-
path: `/reports/${reportId}.pdf`
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.default = LibraryAlertSchedules;
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, index_js_1.Schedule)({
|
|
40
|
-
name: "overdue-book-loans",
|
|
41
|
-
interval: 600000, // 10 minutes
|
|
42
|
-
}),
|
|
43
|
-
__metadata("design:type", Function),
|
|
44
|
-
__metadata("design:paramtypes", []),
|
|
45
|
-
__metadata("design:returntype", Promise)
|
|
46
|
-
], LibraryAlertSchedules.prototype, "checkOverdue", null);
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, index_js_1.Schedule)({
|
|
49
|
-
name: "author-sales-report",
|
|
50
|
-
interval: 1800000, // 30 minutes
|
|
51
|
-
}),
|
|
52
|
-
__metadata("design:type", Function),
|
|
53
|
-
__metadata("design:paramtypes", []),
|
|
54
|
-
__metadata("design:returntype", Promise)
|
|
55
|
-
], LibraryAlertSchedules.prototype, "generateSalesReport", null);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare class GetAllPerDateDto {
|
|
2
|
-
date: Date;
|
|
3
|
-
}
|
|
4
|
-
declare class GetAllBooksPerAuthorDto {
|
|
5
|
-
author: string;
|
|
6
|
-
}
|
|
7
|
-
export default class Books {
|
|
8
|
-
getAllBooksPerDate(filter: GetAllPerDateDto): never[];
|
|
9
|
-
getAllBooksPerAuthor(filter: GetAllBooksPerAuthorDto): void;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const index_js_1 = require("../../../../server/index.js");
|
|
16
|
-
class GetAllPerDateDto {
|
|
17
|
-
}
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, index_js_1.Field)(() => (0, index_js_1.f)().date("typeof is Date").required("date is required")),
|
|
20
|
-
__metadata("design:type", Date)
|
|
21
|
-
], GetAllPerDateDto.prototype, "date", void 0);
|
|
22
|
-
class GetAllBooksPerAuthorDto {
|
|
23
|
-
}
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, index_js_1.Field)(() => (0, index_js_1.f)().string("typeof is string").required("author is required")),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], GetAllBooksPerAuthorDto.prototype, "author", void 0);
|
|
28
|
-
let Books = class Books {
|
|
29
|
-
getAllBooksPerDate(filter) {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
getAllBooksPerAuthor(filter) { }
|
|
33
|
-
};
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, index_js_1.Method)(),
|
|
36
|
-
__param(0, (0, index_js_1.Payload)(GetAllPerDateDto)),
|
|
37
|
-
__metadata("design:type", Function),
|
|
38
|
-
__metadata("design:paramtypes", [GetAllPerDateDto]),
|
|
39
|
-
__metadata("design:returntype", void 0)
|
|
40
|
-
], Books.prototype, "getAllBooksPerDate", null);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, index_js_1.Method)(),
|
|
43
|
-
__param(0, (0, index_js_1.Payload)(GetAllBooksPerAuthorDto)),
|
|
44
|
-
__metadata("design:type", Function),
|
|
45
|
-
__metadata("design:paramtypes", [GetAllBooksPerAuthorDto]),
|
|
46
|
-
__metadata("design:returntype", void 0)
|
|
47
|
-
], Books.prototype, "getAllBooksPerAuthor", null);
|
|
48
|
-
Books = __decorate([
|
|
49
|
-
(0, index_js_1.Controller)("books")
|
|
50
|
-
], Books);
|
|
51
|
-
exports.default = Books;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
const index_js_1 = __importDefault(require("../../../server/index.js"));
|
|
7
|
-
(async () => {
|
|
8
|
-
var app = await (0, index_js_1.default)({
|
|
9
|
-
cors: {
|
|
10
|
-
origin: "*",
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
app.initialize();
|
|
14
|
-
})();
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const index_js_1 = require("../../../../orm/index.js");
|
|
13
|
-
let Books = class Books {
|
|
14
|
-
};
|
|
15
|
-
__decorate([
|
|
16
|
-
(0, index_js_1.PrimaryColumn)({ generated: true }),
|
|
17
|
-
__metadata("design:type", String)
|
|
18
|
-
], Books.prototype, "id", void 0);
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, index_js_1.Field)(() => (0, index_js_1.f)().string("type of string").required("field is required")),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], Books.prototype, "name", void 0);
|
|
23
|
-
Books = __decorate([
|
|
24
|
-
(0, index_js_1.Entity)("book")
|
|
25
|
-
], Books);
|
|
26
|
-
exports.default = Books;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const index_js_1 = require("../../../orm/index.js");
|
|
16
|
-
const user_js_1 = __importDefault(require("./user.js"));
|
|
17
|
-
let Permission = class Permission {
|
|
18
|
-
};
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, index_js_1.PrimaryColumn)({ type: "uuid" }),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], Permission.prototype, "id", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, index_js_1.Field)({ type: "string" }),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], Permission.prototype, "name", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, index_js_1.Relation)({
|
|
29
|
-
type: "many-to-one",
|
|
30
|
-
target: () => user_js_1.default,
|
|
31
|
-
inverseSide: "permissions"
|
|
32
|
-
}),
|
|
33
|
-
__metadata("design:type", user_js_1.default)
|
|
34
|
-
], Permission.prototype, "user", void 0);
|
|
35
|
-
Permission = __decorate([
|
|
36
|
-
(0, index_js_1.Entity)("permissions")
|
|
37
|
-
], Permission);
|
|
38
|
-
exports.default = Permission;
|