@bejibun/core 0.1.24 → 0.1.25
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/dist/bases/BaseModel.js +5 -4
- package/dist/builders/ChalkBuilder.js +3 -0
- package/dist/builders/EnumBuilder.js +1 -0
- package/dist/builders/ResponseBuilder.js +3 -0
- package/dist/builders/RouterBuilder.d.ts +2 -2
- package/dist/builders/RouterBuilder.js +2 -4
- package/dist/builders/StrBuilder.js +1 -0
- package/dist/exceptions/ModelNotFoundException.js +1 -0
- package/dist/exceptions/RouterInvalidException.js +1 -0
- package/dist/exceptions/ValidatorException.js +1 -0
- package/dist/facades/Router.d.ts +2 -2
- package/dist/facades/SoftDeletes.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -1
- package/dist/types/index.d.ts +4 -14
- package/dist/types/middleware.d.ts +1 -1
- package/package.json +8 -2
package/dist/bases/BaseModel.js
CHANGED
|
@@ -18,7 +18,11 @@ class BunQueryBuilder extends SoftDeletes {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
// @ts-ignore
|
|
21
|
-
class BaseModel extends Model {
|
|
21
|
+
export default class BaseModel extends Model {
|
|
22
|
+
static tableName;
|
|
23
|
+
static idColumn;
|
|
24
|
+
static deletedColumn = "deleted_at";
|
|
25
|
+
static QueryBuilder = BunQueryBuilder;
|
|
22
26
|
static get namespace() {
|
|
23
27
|
const filePath = fileURLToPath(import.meta.url);
|
|
24
28
|
const appRoot = process.cwd();
|
|
@@ -63,6 +67,3 @@ class BaseModel extends Model {
|
|
|
63
67
|
return result;
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
|
-
BaseModel.deletedColumn = "deleted_at";
|
|
67
|
-
BaseModel.QueryBuilder = BunQueryBuilder;
|
|
68
|
-
export default BaseModel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IMiddleware } from "
|
|
2
|
-
import type { HandlerType, ResourceAction, RouterGroup } from "
|
|
1
|
+
import type { IMiddleware } from "../types/middleware";
|
|
2
|
+
import type { HandlerType, ResourceAction, RouterGroup } from "../types/router";
|
|
3
3
|
import HttpMethodEnum from "../enums/HttpMethodEnum";
|
|
4
4
|
export interface ResourceOptions {
|
|
5
5
|
only?: Array<ResourceAction>;
|
|
@@ -2,10 +2,8 @@ import RouterInvalidException from "../exceptions/RouterInvalidException";
|
|
|
2
2
|
import { isEmpty } from "../utils/utils";
|
|
3
3
|
import path from "path";
|
|
4
4
|
export default class RouterBuilder {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
this.middlewares = [];
|
|
8
|
-
}
|
|
5
|
+
basePath = "";
|
|
6
|
+
middlewares = [];
|
|
9
7
|
prefix(basePath) {
|
|
10
8
|
this.basePath = basePath;
|
|
11
9
|
return this;
|
package/dist/facades/Router.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IMiddleware } from "
|
|
2
|
-
import type { HandlerType, RouterGroup } from "
|
|
1
|
+
import type { IMiddleware } from "../types/middleware";
|
|
2
|
+
import type { HandlerType, RouterGroup } from "../types/router";
|
|
3
3
|
import RouterBuilder, { ResourceOptions } from "../builders/RouterBuilder";
|
|
4
4
|
import HttpMethodEnum from "../enums/HttpMethodEnum";
|
|
5
5
|
export default class Router {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DateTime } from "luxon";
|
|
2
2
|
import { QueryBuilder } from "objection";
|
|
3
3
|
export default class SoftDeletes extends QueryBuilder {
|
|
4
|
+
hasFilterApplied = false;
|
|
4
5
|
constructor(modelClass) {
|
|
5
6
|
// @ts-ignore
|
|
6
7
|
super(modelClass);
|
|
7
|
-
this.hasFilterApplied = false;
|
|
8
8
|
this.onBuild((builder) => {
|
|
9
9
|
const context = this.context();
|
|
10
10
|
if (!this.hasFilterApplied) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "./facades/Chalk";
|
|
2
|
+
export * from "./facades/Enum";
|
|
3
|
+
export * from "./facades/Response";
|
|
4
|
+
export * from "./facades/Router";
|
|
5
|
+
export * from "./facades/SoftDeletes";
|
|
6
|
+
export * from "./facades/Str";
|
|
7
|
+
export * from "./types/index";
|
|
8
|
+
export * from "./utils/utils";
|
|
9
|
+
export * from "./utils/vine";
|
package/dist/index.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "./facades/Chalk";
|
|
2
|
+
export * from "./facades/Enum";
|
|
3
|
+
export * from "./facades/Response";
|
|
4
|
+
export * from "./facades/Router";
|
|
5
|
+
export * from "./facades/SoftDeletes";
|
|
6
|
+
export * from "./facades/Str";
|
|
7
|
+
export * from "./types/index";
|
|
8
|
+
export * from "./utils/utils";
|
|
9
|
+
export * from "./utils/vine";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
export * from "
|
|
2
|
-
export * from "
|
|
3
|
-
export * from "
|
|
4
|
-
export * from "
|
|
5
|
-
export * from "@/facades/SoftDeletes";
|
|
6
|
-
export * from "@/facades/Str";
|
|
7
|
-
|
|
8
|
-
export * from "@/types/middleware";
|
|
9
|
-
export * from "@/types/router";
|
|
10
|
-
export * from "@/types/validator";
|
|
11
|
-
export * from "@/types/vine";
|
|
12
|
-
|
|
13
|
-
export * from "@/utils/utils";
|
|
14
|
-
export * from "@/utils/vine";
|
|
1
|
+
export * from "../types/middleware";
|
|
2
|
+
export * from "../types/router";
|
|
3
|
+
export * from "../types/validator";
|
|
4
|
+
export * from "../types/vine";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bejibun/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "Core of Bejibun Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
],
|
|
59
59
|
"scripts": {
|
|
60
60
|
"clean": "rm -rf dist",
|
|
61
|
-
"build": "bun run clean &&
|
|
61
|
+
"build": "bun run clean && bunx tsc -p tsconfig.json && cp -rf src/types dist/types && bunx tsc-alias -p tsconfig.json",
|
|
62
62
|
"deploy": "bun run build && npm publish --access public"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
@@ -70,9 +70,15 @@
|
|
|
70
70
|
"pg": "^8.16.3"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
+
"@esbuild-plugins/tsconfig-paths": "^0.1.2",
|
|
73
74
|
"@types/bun": "latest",
|
|
74
75
|
"@types/luxon": "^3.7.1",
|
|
76
|
+
"esbuild-plugin-alias": "^0.2.1",
|
|
77
|
+
"esbuild-plugin-tsconfig-paths": "^1.0.1",
|
|
78
|
+
"esbuild-ts-paths": "^1.1.3",
|
|
75
79
|
"tsc-alias": "^1.8.16",
|
|
80
|
+
"tsconfig-paths": "^4.2.0",
|
|
81
|
+
"tsup": "^8.5.0",
|
|
76
82
|
"typescript": "^5.9.3"
|
|
77
83
|
},
|
|
78
84
|
"peerDependencies": {
|