jcc-express-mvc 1.2.7 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +29 -0
- package/index.d.ts.map +1 -0
- package/lib/App.d.ts +19 -0
- package/lib/App.d.ts.map +1 -0
- package/lib/Auth/AuthMiddleware.d.ts +8 -0
- package/lib/Auth/AuthMiddleware.d.ts.map +1 -0
- package/lib/Auth/index.d.ts +16 -0
- package/lib/Auth/index.d.ts.map +1 -0
- package/lib/Command-Line/NodeArtisanCommand.d.ts +7 -0
- package/lib/Command-Line/NodeArtisanCommand.d.ts.map +1 -0
- package/lib/Command-Line/command.d.ts +11 -0
- package/lib/Command-Line/command.d.ts.map +1 -0
- package/lib/Command-Line/files/Controller.d.ts +8 -0
- package/lib/Command-Line/files/Controller.d.ts.map +1 -0
- package/lib/Command-Line/files/Migration.d.ts +3 -0
- package/lib/Command-Line/files/Migration.d.ts.map +1 -0
- package/lib/Command-Line/files/Migration.js +1 -1
- package/lib/Command-Line/files/Models.d.ts +8 -0
- package/lib/Command-Line/files/Models.d.ts.map +1 -0
- package/lib/Command-Line/files/Request.d.ts +8 -0
- package/lib/Command-Line/files/Request.d.ts.map +1 -0
- package/lib/Command-Line/files/Request.js +1 -1
- package/lib/Command-Line/files/ResourcesController.d.ts +8 -0
- package/lib/Command-Line/files/ResourcesController.d.ts.map +1 -0
- package/lib/Command-Line/files/ResourcesController.js +2 -3
- package/lib/Command-Line/utils.d.ts +2 -0
- package/lib/Command-Line/utils.d.ts.map +1 -0
- package/lib/Config/Config.d.ts +8 -0
- package/lib/Config/Config.d.ts.map +1 -0
- package/lib/Database/src/BaseEntity.d.ts +67 -0
- package/lib/Database/src/BaseEntity.d.ts.map +1 -0
- package/lib/Database/src/BaseModel.d.ts +22 -0
- package/lib/Database/src/BaseModel.d.ts.map +1 -0
- package/lib/Database/src/Builder.d.ts +232 -0
- package/lib/Database/src/Builder.d.ts.map +1 -0
- package/lib/Database/src/Cast/index.d.ts +12 -0
- package/lib/Database/src/Cast/index.d.ts.map +1 -0
- package/lib/Database/src/Cast/types.d.ts +17 -0
- package/lib/Database/src/Cast/types.d.ts.map +1 -0
- package/lib/Database/src/Date/index.d.ts +11 -0
- package/lib/Database/src/Date/index.d.ts.map +1 -0
- package/lib/Database/src/Model.d.ts +26 -0
- package/lib/Database/src/Model.d.ts.map +1 -0
- package/lib/Database/src/Query.d.ts +7 -0
- package/lib/Database/src/Query.d.ts.map +1 -0
- package/lib/Database/src/QueryBuilder.d.ts +235 -0
- package/lib/Database/src/QueryBuilder.d.ts.map +1 -0
- package/lib/Database/src/QueryInstance.d.ts +8 -0
- package/lib/Database/src/QueryInstance.d.ts.map +1 -0
- package/lib/Database/src/RelationBuilder.d.ts +26 -0
- package/lib/Database/src/RelationBuilder.d.ts.map +1 -0
- package/lib/Database/src/Schema/BaseSchemaEntity/index.d.ts +10 -0
- package/lib/Database/src/Schema/BaseSchemaEntity/index.d.ts.map +1 -0
- package/lib/Database/src/Schema/BluePrint/index.d.ts +168 -0
- package/lib/Database/src/Schema/BluePrint/index.d.ts.map +1 -0
- package/lib/Database/src/Schema/index.d.ts +6 -0
- package/lib/Database/src/Schema/index.d.ts.map +1 -0
- package/lib/Database/src/db/connection.d.ts +5 -0
- package/lib/Database/src/db/connection.d.ts.map +1 -0
- package/lib/Database/src/type.d.ts +18 -0
- package/lib/Database/src/type.d.ts.map +1 -0
- package/lib/Database/src/utils/index.d.ts +45 -0
- package/lib/Database/src/utils/index.d.ts.map +1 -0
- package/lib/Error/AppError.d.ts +7 -0
- package/lib/Error/AppError.d.ts.map +1 -0
- package/lib/Error/AppErrorHandler.d.ts +10 -0
- package/lib/Error/AppErrorHandler.d.ts.map +1 -0
- package/lib/Error/Constants/error.d.ts +13 -0
- package/lib/Error/Constants/error.d.ts.map +1 -0
- package/lib/Error/Constants/index.d.ts +4 -0
- package/lib/Error/Constants/index.d.ts.map +1 -0
- package/lib/HttpKernel/HttpKernel.d.ts +7 -0
- package/lib/HttpKernel/HttpKernel.d.ts.map +1 -0
- package/lib/Interface/index.d.ts +43 -0
- package/lib/Interface/index.d.ts.map +1 -0
- package/lib/Middlewares/index.d.ts +45 -0
- package/lib/Middlewares/index.d.ts.map +1 -0
- package/lib/Middlewares/isLogin.d.ts +16 -0
- package/lib/Middlewares/isLogin.d.ts.map +1 -0
- package/lib/Passport/config.d.ts +10 -0
- package/lib/Passport/config.d.ts.map +1 -0
- package/lib/Request/FormRequest.d.ts +36 -0
- package/lib/Request/FormRequest.d.ts.map +1 -0
- package/lib/Request/request.d.ts +17 -0
- package/lib/Request/request.d.ts.map +1 -0
- package/lib/Response/index.d.ts +23 -0
- package/lib/Response/index.d.ts.map +1 -0
- package/lib/Routes/RouteBuilder.d.ts +45 -0
- package/lib/Routes/RouteBuilder.d.ts.map +1 -0
- package/lib/Routes/Router.d.ts +69 -0
- package/lib/Routes/Router.d.ts.map +1 -0
- package/lib/Server/index.d.ts +8 -0
- package/lib/Server/index.d.ts.map +1 -0
- package/lib/Services/ServiceContainer.d.ts +10 -0
- package/lib/Services/ServiceContainer.d.ts.map +1 -0
- package/lib/Services/ServiceProvider.d.ts +14 -0
- package/lib/Services/ServiceProvider.d.ts.map +1 -0
- package/lib/Templating-engine/engineHelper.d.ts +45 -0
- package/lib/Templating-engine/engineHelper.d.ts.map +1 -0
- package/lib/Templating-engine/expressions.d.ts +14 -0
- package/lib/Templating-engine/expressions.d.ts.map +1 -0
- package/lib/Templating-engine/index.d.ts +83 -0
- package/lib/Templating-engine/index.d.ts.map +1 -0
- package/lib/Type/index.d.ts +24 -0
- package/lib/Type/index.d.ts.map +1 -0
- package/lib/Validation/index.d.ts +12 -0
- package/lib/Validation/index.d.ts.map +1 -0
- package/lib/Validation/rules.d.ts +5 -0
- package/lib/Validation/rules.d.ts.map +1 -0
- package/lib/Validation/validate.d.ts +196 -0
- package/lib/Validation/validate.d.ts.map +1 -0
- package/lib/util/index.d.ts +93 -0
- package/lib/util/index.d.ts.map +1 -0
- package/package.json +2 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import appConfig from "./lib/Config/Config";
|
|
2
|
+
import Kernel from "./lib/HttpKernel/HttpKernel";
|
|
3
|
+
import Authentication from "./lib/Auth";
|
|
4
|
+
import { AppRequest, AppResponse, AppNext } from "./lib/Interface";
|
|
5
|
+
import { FormRequest as AppFormRequest } from "./lib/Request/FormRequest";
|
|
6
|
+
import { bcrypt as appBcrypt, verifyHash as appVerifyHash, jwtSign as appJwtSign, jwtVerify as appjwtVerify } from "./lib/util";
|
|
7
|
+
import { Schema as AppSchema } from "./lib/Database/src/Schema";
|
|
8
|
+
import { Model as AppModel } from "./lib/Database/src/Model";
|
|
9
|
+
import { NodeArtisanCommand } from "./lib/Command-Line/NodeArtisanCommand";
|
|
10
|
+
export declare const Route: import("./lib/Routes/Router").Router<any>;
|
|
11
|
+
export declare const ApiRoute: import("./lib/Routes/Router").Router<any>;
|
|
12
|
+
export declare const server: any;
|
|
13
|
+
export declare const HttpKernel: typeof Kernel;
|
|
14
|
+
export declare const config: typeof appConfig;
|
|
15
|
+
export declare const Auth: typeof Authentication;
|
|
16
|
+
export declare const auth: (request: AppRequest, response: AppResponse, next: AppNext) => any;
|
|
17
|
+
export declare const apiAuth: (request: AppRequest, response: AppResponse, next: AppNext) => any;
|
|
18
|
+
export declare const FormRequest: typeof AppFormRequest;
|
|
19
|
+
export declare const bcrypt: typeof appBcrypt;
|
|
20
|
+
export declare const jwtSign: typeof appJwtSign;
|
|
21
|
+
export declare const jwtVerify: typeof appjwtVerify;
|
|
22
|
+
export declare const verifyHash: typeof appVerifyHash;
|
|
23
|
+
export declare const Model: typeof AppModel;
|
|
24
|
+
export declare const Schema: typeof AppSchema;
|
|
25
|
+
export declare const artisanCommand: typeof NodeArtisanCommand;
|
|
26
|
+
export type Request = AppRequest;
|
|
27
|
+
export type Response = AppResponse;
|
|
28
|
+
export type Next = AppNext;
|
|
29
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B,CAAC;AAC3D,eAAO,MAAM,UAAU,EAAE,OAAO,aAA6B,CAAC;AAC9D,eAAO,MAAM,KAAK,EAAE,OAAO,QAAmB,CAAC;AAC/C,eAAO,MAAM,MAAM,EAAE,OAAO,SAAqB,CAAC;AAClD,eAAO,MAAM,cAAc,EAAE,OAAO,kBAAuC,CAAC;AAG5E,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC;AACjC,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC;AACnC,MAAM,MAAM,IAAI,GAAG,OAAO,CAAC"}
|
package/lib/App.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Router } from "./Routes/Router";
|
|
2
|
+
import { HttpSever } from "./Server";
|
|
3
|
+
declare class App extends HttpSever {
|
|
4
|
+
constructor();
|
|
5
|
+
webRoutes(): Router<any>;
|
|
6
|
+
/**
|
|
7
|
+
* Method to define API routes.
|
|
8
|
+
* @returns {object} - Instance of Routes class for API routes.
|
|
9
|
+
*/
|
|
10
|
+
apiRoutes(): Router<any>;
|
|
11
|
+
/**
|
|
12
|
+
* Method to configure and start the server.
|
|
13
|
+
* @returns {object} - Object containing server run method and server instance.
|
|
14
|
+
*/
|
|
15
|
+
httpServer(): any;
|
|
16
|
+
}
|
|
17
|
+
export declare const app: App;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=App.d.ts.map
|
package/lib/App.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../framework/lib/App.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAIrC,cAAM,GAAI,SAAQ,SAAS;;IAQlB,SAAS,IAAI,MAAM,CAAC,GAAG,CAAC;IAI/B;;;OAGG;IACI,SAAS,IAAI,MAAM,CAAC,GAAG,CAAC;IAI/B;;;OAGG;IACI,UAAU,IAAI,GAAG;CAYzB;AAED,eAAO,MAAM,GAAG,KAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppNext, AppRequest, AppResponse } from "../Interface";
|
|
2
|
+
declare class AuthMiddleware {
|
|
3
|
+
apiAuth(request: AppRequest, response: AppResponse, next: AppNext): any;
|
|
4
|
+
auth(request: AppRequest, response: AppResponse, next: AppNext): any;
|
|
5
|
+
}
|
|
6
|
+
export declare const authMiddleware: AuthMiddleware;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=AuthMiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthMiddleware.d.ts","sourceRoot":"","sources":["../../../framework/lib/Auth/AuthMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhE,cAAM,cAAc;IACX,OAAO,CACZ,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,OAAO,GACZ,GAAG;IA0BN,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,GAAG,GAAG;CAUrE;AAED,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AppNext, AppRequest, AppResponse } from "../Interface";
|
|
2
|
+
declare module "express-session" {
|
|
3
|
+
interface SessionData {
|
|
4
|
+
appRedirect?: string;
|
|
5
|
+
isLoggedIn?: boolean;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
declare class Authentication {
|
|
9
|
+
static login(data?: {}, password?: string): Promise<false | Error | undefined>;
|
|
10
|
+
static isAdmin(req: AppRequest, res: AppResponse, next: AppNext): Promise<AppResponse | undefined>;
|
|
11
|
+
static verifyEmail(req: AppRequest, res: AppResponse, next: AppNext): Promise<AppResponse | undefined>;
|
|
12
|
+
static attempt(req: AppRequest, res: AppResponse, next: AppNext): any;
|
|
13
|
+
static logout(req: AppRequest, res: AppResponse, next: AppNext): void;
|
|
14
|
+
}
|
|
15
|
+
export default Authentication;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../framework/lib/Auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAKhE,OAAO,QAAQ,iBAAiB,CAAC;IAC/B,UAAU,WAAW;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,OAAO,CAAC;KAEtB;CACF;AAED,cAAM,cAAc;WAEL,KAAK,CAAC,IAAI,KAAK,EAAE,QAAQ,SAAK;WAe9B,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO;WAgCxD,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO;IAmBzE,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO;WAiBjD,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO;CAQtE;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Function to parse command line arguments and execute corresponding commands
|
|
3
|
+
@param {commandArg} commandArg -string
|
|
4
|
+
@returns {any} -any
|
|
5
|
+
* */
|
|
6
|
+
export declare const NodeArtisanCommand: (commandArg?: Array<any>) => any;
|
|
7
|
+
//# sourceMappingURL=NodeArtisanCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeArtisanCommand.d.ts","sourceRoot":"","sources":["../../../framework/lib/Command-Line/NodeArtisanCommand.ts"],"names":[],"mappings":"AAEA;;;;MAIM;AACN,eAAO,MAAM,kBAAkB,gBAAgB,KAAK,CAAC,GAAG,CAAC,KAAQ,GAmFhE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare class Command {
|
|
2
|
+
addWeb(controllerName: string, modelName?: boolean): any;
|
|
3
|
+
addApi(controllerName: string, modelName?: boolean): any;
|
|
4
|
+
addModel(modelName: string): any;
|
|
5
|
+
addRequest(requestName: string): any;
|
|
6
|
+
addMigration(migrationName: string): any;
|
|
7
|
+
notFound(): any;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: Command;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../framework/lib/Command-Line/command.ts"],"names":[],"mappings":"AAaA,cAAM,OAAO;IAEX,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,GAAG;IA2BtD,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,GAAG;IA6BtD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG;IAehC,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG;IAmBpC,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,GAAG;IAuBxC,QAAQ,IAAI,GAAG;CAGhB;;AAED,wBAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Controller.d.ts","sourceRoot":"","sources":["../../../../framework/lib/Command-Line/files/Controller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,SAAU,MAAM,KAAG,MAoExC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Migration.d.ts","sourceRoot":"","sources":["../../../../framework/lib/Command-Line/files/Migration.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,eAAe,UAAW,MAAM,KAAG,MAaxC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const inflection = require("inflection");
|
|
4
4
|
const createMigration = (table) => {
|
|
5
5
|
return `
|
|
6
|
-
import {Schema} from "";
|
|
6
|
+
import {Schema} from "jcc-express-mvc";
|
|
7
7
|
class Migration {
|
|
8
8
|
up() {
|
|
9
9
|
return Schema.create("${inflection.pluralize(table)}", (table) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Models.d.ts","sourceRoot":"","sources":["../../../../framework/lib/Command-Line/files/Models.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,WAAW,SAAU,MAAM,KAAG,MAYnC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../../framework/lib/Command-Line/files/Request.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,aAAa,aAAc,MAAM,KAAG,MAwBzC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
*/
|
|
8
8
|
const createRequest = (fileName) => {
|
|
9
9
|
return `
|
|
10
|
-
import {
|
|
10
|
+
import { FormRequest } = from "jcc-express-mvc";
|
|
11
11
|
|
|
12
12
|
export class ${fileName} extends FormRequest {
|
|
13
13
|
constructor(req:Request) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function to create a resources file
|
|
3
|
+
* @param name - string
|
|
4
|
+
* @returns string
|
|
5
|
+
*/
|
|
6
|
+
declare const resourceController: (controller: string, model?: string | boolean) => string;
|
|
7
|
+
export default resourceController;
|
|
8
|
+
//# sourceMappingURL=ResourcesController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourcesController.d.ts","sourceRoot":"","sources":["../../../../framework/lib/Command-Line/files/ResourcesController.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,eAAgB,MAAM,UAAU,MAAM,GAAG,OAAO,WAoEvE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
* @returns string
|
|
7
7
|
*/
|
|
8
8
|
const resourceController = (controller, model) => {
|
|
9
|
-
return `
|
|
10
|
-
|
|
11
|
-
export class ${controller} {
|
|
9
|
+
return `import {Model}= from "jcc-express-mvc"
|
|
10
|
+
export class ${controller} extends Model {
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../framework/lib/Command-Line/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,cAUtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../framework/lib/Config/Config.ts"],"names":[],"mappings":"AAGA,cAAM,MAAM;IACV,OAAO,CAAC,MAAM,CAAwC;;IAO/C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,GAAE,MAAW,GAAG,MAAM;CAG3D;;AAED,wBAA4B"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { objType } from "./type";
|
|
2
|
+
import { Database } from "./db/connection";
|
|
3
|
+
import { QueryInstance } from "./QueryInstance";
|
|
4
|
+
export declare class BaseEntity extends Database {
|
|
5
|
+
protected attributes: objType;
|
|
6
|
+
protected _select: string | Array<string>;
|
|
7
|
+
protected _tableName: string;
|
|
8
|
+
protected _where: Array<any>;
|
|
9
|
+
protected _joins: Array<any>;
|
|
10
|
+
protected _orderBy?: string;
|
|
11
|
+
protected _limit?: string | number;
|
|
12
|
+
protected _offset?: string | number;
|
|
13
|
+
protected _groupBy?: string;
|
|
14
|
+
protected _having?: string;
|
|
15
|
+
protected _distinct: boolean;
|
|
16
|
+
protected _insertData: {
|
|
17
|
+
keys: Array<any>;
|
|
18
|
+
values: Array<any>;
|
|
19
|
+
};
|
|
20
|
+
protected _updateData: objType;
|
|
21
|
+
protected _delete?: boolean;
|
|
22
|
+
protected _count?: boolean;
|
|
23
|
+
protected _relationships: Array<any>;
|
|
24
|
+
protected fillable: Array<string>;
|
|
25
|
+
protected guard: Array<string>;
|
|
26
|
+
protected hidden: Array<string>;
|
|
27
|
+
protected casts?: object;
|
|
28
|
+
protected _max: string;
|
|
29
|
+
protected _min: string;
|
|
30
|
+
protected _sum: string;
|
|
31
|
+
protected _avg: string;
|
|
32
|
+
protected sqlQuery: string;
|
|
33
|
+
/**
|
|
34
|
+
* Resets all query builder state variables to their default values.
|
|
35
|
+
*/
|
|
36
|
+
_resetQuery(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Constructs and returns the SQL query based on the current query builder state.
|
|
39
|
+
*
|
|
40
|
+
* @returns {string} The generated SQL query.
|
|
41
|
+
*/
|
|
42
|
+
private compileToSql;
|
|
43
|
+
private buidInsert;
|
|
44
|
+
private buildUpdate;
|
|
45
|
+
private buildJoin;
|
|
46
|
+
private buildOffset;
|
|
47
|
+
private buildselect;
|
|
48
|
+
private buildDelete;
|
|
49
|
+
private buildWhere;
|
|
50
|
+
private buildCount;
|
|
51
|
+
private buildMin;
|
|
52
|
+
private buildMax;
|
|
53
|
+
private buildAvg;
|
|
54
|
+
private buildSum;
|
|
55
|
+
private buildHaving;
|
|
56
|
+
private buildGroup;
|
|
57
|
+
private buildOrderBy;
|
|
58
|
+
private buildLimit;
|
|
59
|
+
protected getCompileSqlCode(): string;
|
|
60
|
+
setGuard(values: Array<string>): void;
|
|
61
|
+
setFillable(values: Array<string>): void;
|
|
62
|
+
setHidden(values: Array<string>): void;
|
|
63
|
+
setCasts(values: objType): void;
|
|
64
|
+
private removeHiddenValues;
|
|
65
|
+
protected newInstance<T>(results: objType): QueryInstance<T>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=BaseEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseEntity.d.ts","sourceRoot":"","sources":["../../../../framework/lib/Database/src/BaseEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,qBAAa,UAAW,SAAQ,QAAQ;IACtC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAM;IACnC,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAO;IAChD,SAAS,CAAC,UAAU,EAAE,MAAM,CAAM;IAClC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAM;IAClC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAM;IAClC,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,SAAS,EAAE,OAAO,CAAS;IACrC,SAAS,CAAC,WAAW,EAAE;QAAE,IAAI,EAAE,KAAK,CAAC,GA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AAM;IAQ9B,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI;IAIrC,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI;IAIxC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI;IAItC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAItC,OAAO,CAAC,kBAAkB;IAS1B,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC;CAQ7D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { QueryBuilder } from "./QueryBuilder";
|
|
2
|
+
export declare class BaseModel extends QueryBuilder {
|
|
3
|
+
/**
|
|
4
|
+
* Defines a hasMany relationship between the current model and another model.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} relatedModel - The name of the related model.
|
|
7
|
+
* @param {string} foreingKey - The foreign key in the related model (defaults to id).
|
|
8
|
+
* @param {string} localKey - The local key in the current model (defaults to 'id').
|
|
9
|
+
* @returns {Function} A function that retrieves the related data based on the relationship.
|
|
10
|
+
*/
|
|
11
|
+
protected hasMany(relatedModel: string, foreingKey: string, localKey?: string): any;
|
|
12
|
+
/**
|
|
13
|
+
* Defines a belongsTo relationship between the current model and another model.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} relatedModel - The name of the related model.
|
|
16
|
+
* @param {string} foreingKey - The foreign key in the related model (defaults to id).
|
|
17
|
+
* @param {string} localKey - The local key in the current model (defaults to 'id').
|
|
18
|
+
* @returns {Function} A function that retrieves the related data based on the relationship.
|
|
19
|
+
*/
|
|
20
|
+
protected belongsTo(relatedModel: string, foreingKey: string, localKey?: string): any;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=BaseModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseModel.d.ts","sourceRoot":"","sources":["../../../../framework/lib/Database/src/BaseModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,qBAAa,SAAU,SAAQ,YAAY;IACzC;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CACf,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,MAAa,GACtB,GAAG;IAWN;;;;;;;OAOG;IACH,SAAS,CAAC,SAAS,CACjB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,MAAa,GACtB,GAAG;CAUP"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { objType } from "./type";
|
|
2
|
+
import { RelationBuilder } from "./RelationBuilder";
|
|
3
|
+
export declare class Builder extends RelationBuilder {
|
|
4
|
+
protected guard: Array<string>;
|
|
5
|
+
protected static query: Builder;
|
|
6
|
+
/**
|
|
7
|
+
* Specifies the columns to select in a query.
|
|
8
|
+
*
|
|
9
|
+
* @param {...string} columns - The columns to select.
|
|
10
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
11
|
+
*/
|
|
12
|
+
select(...columns: Array<any>): this;
|
|
13
|
+
/**
|
|
14
|
+
* Marks the query to return distinct results.
|
|
15
|
+
*
|
|
16
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
17
|
+
*/
|
|
18
|
+
distinct(): this;
|
|
19
|
+
/**
|
|
20
|
+
* Specifies the offset for starting the query results.
|
|
21
|
+
*
|
|
22
|
+
* @param {number} count - The number of rows to skip before starting to return rows.
|
|
23
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
24
|
+
*/
|
|
25
|
+
offset(value: string | number): this;
|
|
26
|
+
/**
|
|
27
|
+
* Specifies the table to query from.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} tableName - The name of the table to query from.
|
|
30
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
31
|
+
*/
|
|
32
|
+
from(tableName: string): this;
|
|
33
|
+
/**
|
|
34
|
+
* Adds a WHERE clause to the query.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} column - The column to apply the condition on.
|
|
37
|
+
* @param {string} operator - The operator to use for the condition (e.g., '=', '>', '<').
|
|
38
|
+
* @param {any} value - The value to compare the column against.
|
|
39
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
40
|
+
*/
|
|
41
|
+
where(column: string, operator: string | number, value?: string | number): this;
|
|
42
|
+
/**
|
|
43
|
+
* Inserts data into the database and retrieves the inserted record.
|
|
44
|
+
*
|
|
45
|
+
* @param {Object} data - The data to insert into the database.
|
|
46
|
+
* @returns {Promise<any>} The inserted record.
|
|
47
|
+
*/
|
|
48
|
+
insert(data: object, fillable: Array<any>, guard: Array<any>): Promise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* Adds an OR WHERE clause to the query.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} column - The column to apply the condition on.
|
|
53
|
+
* @param {string} operator - The operator to use for the condition (e.g., '=', '>', '<').
|
|
54
|
+
* @param {any} value - The value to compare the column against.
|
|
55
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
56
|
+
*/
|
|
57
|
+
orWhere(column: string, operator: string | number, value?: string | number): this;
|
|
58
|
+
/**
|
|
59
|
+
* Specifies the column and direction for ordering the query results.
|
|
60
|
+
*
|
|
61
|
+
* @param {string} column - The column to order by.
|
|
62
|
+
* @param {string} [direction="asc"] - The direction of ordering ("asc" for ascending, "desc" for descending).
|
|
63
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
64
|
+
*/
|
|
65
|
+
orderBy(column: string, direction?: string): this;
|
|
66
|
+
/**
|
|
67
|
+
* Limits the number of results returned by the query.
|
|
68
|
+
*
|
|
69
|
+
* @param {number} count - The maximum number of results to return.
|
|
70
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
71
|
+
*/
|
|
72
|
+
limit(count: number | string): this;
|
|
73
|
+
/**
|
|
74
|
+
* Limits the number of results returned by the query.
|
|
75
|
+
*
|
|
76
|
+
* @param {number} count - The maximum number of results to return.
|
|
77
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
78
|
+
*/
|
|
79
|
+
take(count: number): this;
|
|
80
|
+
/**
|
|
81
|
+
* Specifies the columns to group the query results by.
|
|
82
|
+
*
|
|
83
|
+
* @param {...string} columns - The columns to group by.
|
|
84
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
85
|
+
*/
|
|
86
|
+
groupBy(...columns: Array<any>): this;
|
|
87
|
+
/**
|
|
88
|
+
* Adds a HAVING clause to the query.
|
|
89
|
+
*
|
|
90
|
+
* @param {string} column - The column to apply the condition on.
|
|
91
|
+
* @param {string} operator - The operator to use for the condition (e.g., '=', '>', '<').
|
|
92
|
+
* @param {any} value - The value to compare the column against.
|
|
93
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
94
|
+
*/
|
|
95
|
+
having(column: string, operator: string, value: string): this;
|
|
96
|
+
/**
|
|
97
|
+
* Adds a JOIN clause to the query.
|
|
98
|
+
*
|
|
99
|
+
* @param {string} table - The name of the table to join.
|
|
100
|
+
* @param {string} firstColumn - The column from the current table to join on.
|
|
101
|
+
* @param {string} operator - The operator to use for the join condition (e.g., '=', '>', '<').
|
|
102
|
+
* @param {string} secondColumn - The column from the joined table to join on.
|
|
103
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
104
|
+
*/
|
|
105
|
+
join(type: string, table: string, firstColumn: string, operator: string, secondColumn: string): this;
|
|
106
|
+
/**
|
|
107
|
+
* Adds an INNER JOIN clause to the query.
|
|
108
|
+
*
|
|
109
|
+
* @param {string} table - The name of the table to join.
|
|
110
|
+
* @param {string} firstColumn - The column from the current table to join on.
|
|
111
|
+
* @param {string} operator - The operator to use for the join condition (e.g., '=', '>', '<').
|
|
112
|
+
* @param {string} secondColumn - The column from the joined table to join on.
|
|
113
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
114
|
+
*/
|
|
115
|
+
innerJoin(table: string, firstColumn: string, operator: string, secondColumn: string): this;
|
|
116
|
+
/**
|
|
117
|
+
* Adds a LEFT JOIN clause to the query.
|
|
118
|
+
*
|
|
119
|
+
* @param {string} table - The name of the table to join.
|
|
120
|
+
* @param {string} firstColumn - The column from the current table to join on.
|
|
121
|
+
* @param {string} operator - The operator to use for the join condition (e.g., '=', '>', '<').
|
|
122
|
+
* @param {string} secondColumn - The column from the joined table to join on.
|
|
123
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
124
|
+
*/
|
|
125
|
+
leftJoin(table: string, firstColumn: string, operator: string, secondColumn: string): this;
|
|
126
|
+
/**
|
|
127
|
+
* Adds a RIGHT JOIN clause to the query.
|
|
128
|
+
*
|
|
129
|
+
* @param {string} table - The name of the table to join.
|
|
130
|
+
* @param {string} firstColumn - The column from the current table to join on.
|
|
131
|
+
* @param {string} operator - The operator to use for the join condition (e.g., '=', '>', '<').
|
|
132
|
+
* @param {string} secondColumn - The column from the joined table to join on.
|
|
133
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
134
|
+
*/
|
|
135
|
+
rightJoin(table: string, firstColumn: string, operator: string, secondColumn: string): this;
|
|
136
|
+
/**
|
|
137
|
+
* Sets the data to update for the query.
|
|
138
|
+
*
|
|
139
|
+
* @param {Object} data - The data to update.
|
|
140
|
+
* @returns {Promise<any>} The instance of the model, allowing for method chaining.
|
|
141
|
+
*/
|
|
142
|
+
update(data?: objType, fillable?: Array<string>, guard?: Array<any>): Promise<any>;
|
|
143
|
+
/**
|
|
144
|
+
* Fetch the first record from the database table.
|
|
145
|
+
* The table name is derived from the current class name or the previously set table name.
|
|
146
|
+
* @returns {Object} The first record if found, otherwise an empty object.
|
|
147
|
+
*/
|
|
148
|
+
first(): Promise<any>;
|
|
149
|
+
/**
|
|
150
|
+
* Executes the constructed query, loads specified relations, and resets the query builder state.
|
|
151
|
+
*
|
|
152
|
+
* @returns {Promise<Array>} A Promise that resolves with the fetched results including loaded relations.
|
|
153
|
+
*/
|
|
154
|
+
get(): Promise<any>;
|
|
155
|
+
addGuard(columns: Array<string>): void;
|
|
156
|
+
addFillable(columns: Array<string>): void;
|
|
157
|
+
addHidden(columns: Array<string>): void;
|
|
158
|
+
latest(column?: string): this;
|
|
159
|
+
table(table: string): this;
|
|
160
|
+
/**
|
|
161
|
+
* Adds the specified relationships to the model.
|
|
162
|
+
*
|
|
163
|
+
* @param {...string} relations - The names of the relationships to add.
|
|
164
|
+
* @returns {this} The instance of the model, allowing for method chaining.
|
|
165
|
+
*/
|
|
166
|
+
with(...relations: Array<any>): this;
|
|
167
|
+
/**
|
|
168
|
+
* Iterates over each record, applies a callback function to each record, and collects the results in an array.
|
|
169
|
+
*
|
|
170
|
+
* @param {Function} callback - The function to be applied to each record. The function should accept a record as an argument and return a value.
|
|
171
|
+
* @returns {Promise<Array>} A promise that resolves to an array of results from applying the callback function to each record.
|
|
172
|
+
*/
|
|
173
|
+
each(callback: (records: Array<any>) => void): Promise<any>;
|
|
174
|
+
/**
|
|
175
|
+
* Iterates over map record returned by the query, applies a callback function to map record, and collects the results in an array.
|
|
176
|
+
*
|
|
177
|
+
* @param {Function} callback - The function to be applied to map record. The function should accept a record as an argument and return a value.
|
|
178
|
+
* @returns {Promise<Array>} A promise that resolves to an array of results from applying the callback function to each record.
|
|
179
|
+
*/
|
|
180
|
+
map(callback: (record: objType) => any): Promise<Array<any>>;
|
|
181
|
+
/**
|
|
182
|
+
* Retrieves the value of a specified field from the first record that matches the current query conditions.
|
|
183
|
+
*
|
|
184
|
+
* @param {string} field - The field name whose value is to be retrieved.
|
|
185
|
+
* @returns {Promise<any>} A promise that resolves to the value of the specified field, or null if no records are found.
|
|
186
|
+
*/
|
|
187
|
+
value(field: string): Promise<string | any>;
|
|
188
|
+
/**
|
|
189
|
+
* Checks if any records exist that match the current query conditions.
|
|
190
|
+
*
|
|
191
|
+
* @returns {Promise<boolean>} A promise that resolves to true if records exist, false otherwise.
|
|
192
|
+
*/
|
|
193
|
+
exists(): Promise<boolean>;
|
|
194
|
+
/**
|
|
195
|
+
* Checks if no records exist that match the current query conditions.
|
|
196
|
+
*
|
|
197
|
+
* @returns {Promise<boolean>} A promise that resolves to true if no records exist, false otherwise.
|
|
198
|
+
*/
|
|
199
|
+
doesntExist(): Promise<boolean>;
|
|
200
|
+
/**
|
|
201
|
+
* Executes a count query based on the current query builder state.
|
|
202
|
+
*
|
|
203
|
+
* @returns {Promise<number>} A Promise that resolves with the count of records.
|
|
204
|
+
*/
|
|
205
|
+
count(): Promise<number>;
|
|
206
|
+
/**
|
|
207
|
+
* Executes a max query based on the current query builder state.
|
|
208
|
+
*
|
|
209
|
+
* @returns {Promise<number>} A Promise that resolves with the max of records.
|
|
210
|
+
*/
|
|
211
|
+
max(column: string): Promise<number>;
|
|
212
|
+
/**
|
|
213
|
+
* Executes a min query based on the current query builder state.
|
|
214
|
+
*
|
|
215
|
+
* @returns {Promise<number>} A Promise that resolves with the min of records.
|
|
216
|
+
*/
|
|
217
|
+
min(column: string): Promise<number>;
|
|
218
|
+
/**
|
|
219
|
+
* Executes a sum of a specify column query based on the current query builder state.
|
|
220
|
+
*
|
|
221
|
+
* @returns {Promise<number>} A Promise that resolves with the min of records.
|
|
222
|
+
*/
|
|
223
|
+
sum(column: string): Promise<number>;
|
|
224
|
+
/**
|
|
225
|
+
* Executes a average query based on the current query builder state.
|
|
226
|
+
*
|
|
227
|
+
* @returns {Promise<number>} A Promise that resolves with the sum of records.
|
|
228
|
+
*/
|
|
229
|
+
avg(column: string): Promise<number>;
|
|
230
|
+
private addAttributes;
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=Builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Builder.d.ts","sourceRoot":"","sources":["../../../../framework/lib/Database/src/Builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM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,KAAK,EAAE,MAAM,GAAG,IAAI;IAKjC;;;;;OAKG;IAEI,IAAI,CAAC,GAAG,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI;IAK3C;;;;;OAKG;IACU,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;IAOxE;;;;;OAKG;IACU,GAAG,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAWzE;;;;;OAKG;IACU,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC;IAMxD;;;;OAIG;IACU,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAKvC;;;;OAIG;IACU,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAK5C;;;;OAIG;IACU,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;IAUrC;;;;OAIG;IACU,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOjD;;;;OAIG;IACU,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOjD;;;;OAIG;IACU,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMjD;;;;OAIG;IACU,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMjD,OAAO,CAAC,aAAa;CAGtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { objType } from "../type";
|
|
2
|
+
export declare class Cast {
|
|
3
|
+
static getCastType(cast: objType, query: objType): objType | undefined;
|
|
4
|
+
private static castData;
|
|
5
|
+
private static string;
|
|
6
|
+
private static dateTime;
|
|
7
|
+
private static array;
|
|
8
|
+
private static integer;
|
|
9
|
+
private static boolean;
|
|
10
|
+
private static getAttributeName;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../framework/lib/Database/src/Cast/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAalC,qBAAa,IAAI;WACD,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;IAsCvD,OAAO,CAAC,MAAM,CAAC,QAAQ;IA8CvB,OAAO,CAAC,MAAM,CAAC,MAAM;IAIrB,OAAO,CAAC,MAAM,CAAC,QAAQ;IAIvB,OAAO,CAAC,MAAM,CAAC,KAAK;IAIpB,OAAO,CAAC,MAAM,CAAC,OAAO;IAItB,OAAO,CAAC,MAAM,CAAC,OAAO;IAItB,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAK7B;CACH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { objType } from "../type";
|
|
2
|
+
export declare const STRING = "string";
|
|
3
|
+
export declare const CAPITALIZE = "capitalize";
|
|
4
|
+
export declare const UPPERCASE = "uppercase";
|
|
5
|
+
export declare const LOWERCASE = "lowercase";
|
|
6
|
+
export declare const DATETIME = "datetime";
|
|
7
|
+
export declare const ARRAY = "array";
|
|
8
|
+
export declare const TRIM = "trim";
|
|
9
|
+
export declare const TIME = "time";
|
|
10
|
+
export declare const DATE = "date";
|
|
11
|
+
export declare const BOOLEAN = "boolean";
|
|
12
|
+
export declare const INTEGER = "integer";
|
|
13
|
+
export declare const SET = "set";
|
|
14
|
+
export declare const GET = "get";
|
|
15
|
+
export declare const NOW = "now";
|
|
16
|
+
export declare const DATEFORMATS: objType;
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../framework/lib/Database/src/Cast/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,SAAS,cAAc,CAAC;AACrC,eAAO,MAAM,SAAS,cAAc,CAAC;AACrC,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,WAAW,EAAE,OAOzB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { objType } from "../type";
|
|
2
|
+
export declare class DateCasting {
|
|
3
|
+
private date;
|
|
4
|
+
formatHelper: objType;
|
|
5
|
+
constructor(date: string);
|
|
6
|
+
dateToTimestamps(): number | string;
|
|
7
|
+
timeToTimestamp(): number | string;
|
|
8
|
+
format(formatStr: string): string;
|
|
9
|
+
diffForHumans(): string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|