@joktec/mysql 0.0.60 → 0.0.62

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.
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=mysql.utils.spec.d.ts.map
@@ -1,26 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const globals_1 = require("@jest/globals");
4
- const sequelize_1 = require("sequelize");
5
- const mysql_utils_1 = require("../mysql.utils");
6
- (0, globals_1.describe)('convertOp function', () => {
7
- (0, globals_1.it)('should return the correct symbol for $ne operator', () => {
8
- const inputOp = '$ne';
9
- const expectedOp = sequelize_1.Op.ne;
10
- const actualOp = (0, mysql_utils_1.convertOp)(inputOp);
11
- (0, globals_1.expect)(actualOp).toBe(expectedOp);
12
- });
13
- (0, globals_1.it)('should return Op.eq for invalid operator', () => {
14
- const inputOp = '$invalid';
15
- const expectedOp = sequelize_1.Op.eq;
16
- const actualOp = (0, mysql_utils_1.convertOp)(inputOp);
17
- (0, globals_1.expect)(actualOp).toBe(expectedOp);
18
- });
19
- (0, globals_1.it)('should return Op.eq for undefined operator', () => {
20
- const inputOp = undefined;
21
- const expectedOp = sequelize_1.Op.eq;
22
- const actualOp = (0, mysql_utils_1.convertOp)(inputOp);
23
- (0, globals_1.expect)(actualOp).toBe(expectedOp);
24
- });
25
- });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const globals_1 = require("@jest/globals");
4
+ const sequelize_1 = require("sequelize");
5
+ const mysql_utils_1 = require("../mysql.utils");
6
+ (0, globals_1.describe)('convertOp function', () => {
7
+ (0, globals_1.it)('should return the correct symbol for $ne operator', () => {
8
+ const inputOp = '$ne';
9
+ const expectedOp = sequelize_1.Op.ne;
10
+ const actualOp = (0, mysql_utils_1.convertOp)(inputOp);
11
+ (0, globals_1.expect)(actualOp).toBe(expectedOp);
12
+ });
13
+ (0, globals_1.it)('should return Op.eq for invalid operator', () => {
14
+ const inputOp = '$invalid';
15
+ const expectedOp = sequelize_1.Op.eq;
16
+ const actualOp = (0, mysql_utils_1.convertOp)(inputOp);
17
+ (0, globals_1.expect)(actualOp).toBe(expectedOp);
18
+ });
19
+ (0, globals_1.it)('should return Op.eq for undefined operator', () => {
20
+ const inputOp = undefined;
21
+ const expectedOp = sequelize_1.Op.eq;
22
+ const actualOp = (0, mysql_utils_1.convertOp)(inputOp);
23
+ (0, globals_1.expect)(actualOp).toBe(expectedOp);
24
+ });
25
+ });
26
26
  //# sourceMappingURL=mysql.utils.spec.js.map
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- export * from './mysql.module';
2
- export * from './mysql.client';
3
- export * from './mysql.service';
4
- export * from './mysql.config';
5
- export * from './mysql.utils';
6
- export * from './mysql.repo';
7
- export * from './mysql.exception';
8
- export * from './models';
9
- export * from 'sequelize-typescript';
10
- export { Op } from 'sequelize';
1
+ export * from './mysql.module';
2
+ export * from './mysql.client';
3
+ export * from './mysql.service';
4
+ export * from './mysql.config';
5
+ export * from './mysql.utils';
6
+ export * from './mysql.repo';
7
+ export * from './mysql.exception';
8
+ export * from './models';
9
+ export * from 'sequelize-typescript';
10
+ export { Op } from 'sequelize';
11
11
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,29 +1,29 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Op = void 0;
18
- __exportStar(require("./mysql.module"), exports);
19
- __exportStar(require("./mysql.client"), exports);
20
- __exportStar(require("./mysql.service"), exports);
21
- __exportStar(require("./mysql.config"), exports);
22
- __exportStar(require("./mysql.utils"), exports);
23
- __exportStar(require("./mysql.repo"), exports);
24
- __exportStar(require("./mysql.exception"), exports);
25
- __exportStar(require("./models"), exports);
26
- __exportStar(require("sequelize-typescript"), exports);
27
- var sequelize_1 = require("sequelize");
28
- Object.defineProperty(exports, "Op", { enumerable: true, get: function () { return sequelize_1.Op; } });
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Op = void 0;
18
+ __exportStar(require("./mysql.module"), exports);
19
+ __exportStar(require("./mysql.client"), exports);
20
+ __exportStar(require("./mysql.service"), exports);
21
+ __exportStar(require("./mysql.config"), exports);
22
+ __exportStar(require("./mysql.utils"), exports);
23
+ __exportStar(require("./mysql.repo"), exports);
24
+ __exportStar(require("./mysql.exception"), exports);
25
+ __exportStar(require("./models"), exports);
26
+ __exportStar(require("sequelize-typescript"), exports);
27
+ var sequelize_1 = require("sequelize");
28
+ Object.defineProperty(exports, "Op", { enumerable: true, get: function () { return sequelize_1.Op; } });
29
29
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- export * from './mysql.model';
2
- export * from './mysql.request';
3
- export * from './mysql.response';
1
+ export * from './mysql.model';
2
+ export * from './mysql.request';
3
+ export * from './mysql.response';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,20 +1,20 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./mysql.model"), exports);
18
- __exportStar(require("./mysql.request"), exports);
19
- __exportStar(require("./mysql.response"), exports);
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./mysql.model"), exports);
18
+ __exportStar(require("./mysql.request"), exports);
19
+ __exportStar(require("./mysql.response"), exports);
20
20
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- import { Model } from 'sequelize-typescript';
2
- export declare abstract class MysqlModel<T> extends Model<T> {
3
- createdAt?: Date;
4
- updatedAt?: Date;
5
- deletedAt?: Date;
6
- }
1
+ import { Model } from 'sequelize-typescript';
2
+ export declare abstract class MysqlModel<T> extends Model<T> {
3
+ createdAt?: Date;
4
+ updatedAt?: Date;
5
+ deletedAt?: Date;
6
+ }
7
7
  //# sourceMappingURL=mysql.model.d.ts.map
@@ -1,36 +1,36 @@
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
- exports.MysqlModel = void 0;
13
- const sequelize_typescript_1 = require("sequelize-typescript");
14
- const core_1 = require("@joktec/core");
15
- class MysqlModel extends sequelize_typescript_1.Model {
16
- }
17
- __decorate([
18
- sequelize_typescript_1.CreatedAt,
19
- (0, core_1.ApiProperty)({ type: Date }),
20
- (0, core_1.Field)(() => Date, { nullable: true }),
21
- __metadata("design:type", Date)
22
- ], MysqlModel.prototype, "createdAt", void 0);
23
- __decorate([
24
- sequelize_typescript_1.UpdatedAt,
25
- (0, core_1.ApiProperty)({ type: Date }),
26
- (0, core_1.Field)(() => Date, { nullable: true }),
27
- __metadata("design:type", Date)
28
- ], MysqlModel.prototype, "updatedAt", void 0);
29
- __decorate([
30
- sequelize_typescript_1.DeletedAt,
31
- (0, core_1.ApiProperty)({ type: Date }),
32
- (0, core_1.Field)(() => Date, { nullable: true }),
33
- __metadata("design:type", Date)
34
- ], MysqlModel.prototype, "deletedAt", void 0);
35
- exports.MysqlModel = MysqlModel;
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
+ exports.MysqlModel = void 0;
13
+ const sequelize_typescript_1 = require("sequelize-typescript");
14
+ const core_1 = require("@joktec/core");
15
+ class MysqlModel extends sequelize_typescript_1.Model {
16
+ }
17
+ __decorate([
18
+ sequelize_typescript_1.CreatedAt,
19
+ (0, core_1.ApiProperty)({ type: Date }),
20
+ (0, core_1.Field)(() => Date, { nullable: true }),
21
+ __metadata("design:type", Date)
22
+ ], MysqlModel.prototype, "createdAt", void 0);
23
+ __decorate([
24
+ sequelize_typescript_1.UpdatedAt,
25
+ (0, core_1.ApiProperty)({ type: Date }),
26
+ (0, core_1.Field)(() => Date, { nullable: true }),
27
+ __metadata("design:type", Date)
28
+ ], MysqlModel.prototype, "updatedAt", void 0);
29
+ __decorate([
30
+ sequelize_typescript_1.DeletedAt,
31
+ (0, core_1.ApiProperty)({ type: Date }),
32
+ (0, core_1.Field)(() => Date, { nullable: true }),
33
+ __metadata("design:type", Date)
34
+ ], MysqlModel.prototype, "deletedAt", void 0);
35
+ exports.MysqlModel = MysqlModel;
36
36
  //# sourceMappingURL=mysql.model.js.map
@@ -1,11 +1,11 @@
1
- import { IDataType, IBaseRequest } from '@joktec/core';
2
- import { Model } from 'sequelize-typescript';
3
- export declare type MysqlId = string | number | bigint;
4
- export declare type ArrayBinding = Array<IDataType>;
5
- export declare type DictBinding = {
6
- [key: string]: IDataType;
7
- };
8
- export declare type RawBinding = ArrayBinding | DictBinding;
9
- export interface IMysqlRequest<T extends Model<T>> extends IBaseRequest<T> {
10
- }
1
+ import { IDataType, IBaseRequest } from '@joktec/core';
2
+ import { Model } from 'sequelize-typescript';
3
+ export declare type MysqlId = string | number | bigint;
4
+ export declare type ArrayBinding = Array<IDataType>;
5
+ export declare type DictBinding = {
6
+ [key: string]: IDataType;
7
+ };
8
+ export declare type RawBinding = ArrayBinding | DictBinding;
9
+ export interface IMysqlRequest<T extends Model<T>> extends IBaseRequest<T> {
10
+ }
11
11
  //# sourceMappingURL=mysql.request.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=mysql.request.js.map
@@ -1,4 +1,4 @@
1
- import { IListResponseDto } from '@joktec/core';
2
- export interface IMysqlResponse<T> extends IListResponseDto<T> {
3
- }
1
+ import { IListResponseDto } from '@joktec/core';
2
+ export interface IMysqlResponse<T> extends IListResponseDto<T> {
3
+ }
4
4
  //# sourceMappingURL=mysql.response.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=mysql.response.js.map
@@ -1,9 +1,9 @@
1
- import { BaseRepository, Client, ICondition } from '@joktec/core';
2
- import { MysqlConfig } from './mysql.config';
3
- import { Model, Sequelize } from 'sequelize-typescript';
4
- export interface MysqlClient extends Client<MysqlConfig, Sequelize> {
5
- }
6
- export interface IMysqlRepository<T extends Model<T>, ID> extends BaseRepository<T, ID> {
7
- upsert(condition: ICondition, body: Partial<T>): Promise<T>;
8
- }
1
+ import { BaseRepository, Client, ICondition } from '@joktec/core';
2
+ import { MysqlConfig } from './mysql.config';
3
+ import { Model, Sequelize } from 'sequelize-typescript';
4
+ export interface MysqlClient extends Client<MysqlConfig, Sequelize> {
5
+ }
6
+ export interface IMysqlRepository<T extends Model<T>, ID> extends BaseRepository<T, ID> {
7
+ upsert(condition: ICondition, body: Partial<T>): Promise<T>;
8
+ }
9
9
  //# sourceMappingURL=mysql.client.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=mysql.client.js.map
@@ -1,35 +1,35 @@
1
- import { ClientConfig } from '@joktec/core';
2
- import { SequelizeOptions } from 'sequelize-typescript/dist/sequelize/sequelize/sequelize-options';
3
- import { ConnectionOptions } from 'sequelize/types/sequelize';
4
- export declare class MysqlSlaveConfig implements ConnectionOptions {
5
- host: string;
6
- port: number;
7
- username: string;
8
- password: string;
9
- database: string;
10
- constructor(props: MysqlSlaveConfig);
11
- }
12
- export declare enum Dialect {
13
- MYSQL = "mysql",
14
- POSTGRES = "postgres",
15
- SQLITE = "sqlite",
16
- MARIADB = "mariadb",
17
- MSSQL = "mssql",
18
- DB2 = "db2",
19
- SNOWFLAKE = "snowflake",
20
- ORACLE = "oracle"
21
- }
22
- export declare class MysqlConfig extends ClientConfig implements SequelizeOptions {
23
- dialect: Dialect;
24
- host: string;
25
- port: number;
26
- username: string;
27
- password: string;
28
- database: string;
29
- charset?: string;
30
- timezone?: string;
31
- connectTimeout?: number;
32
- slaves?: MysqlSlaveConfig[];
33
- constructor(props: MysqlConfig);
34
- }
1
+ import { ClientConfig } from '@joktec/core';
2
+ import { SequelizeOptions } from 'sequelize-typescript/dist/sequelize/sequelize/sequelize-options';
3
+ import { ConnectionOptions } from 'sequelize/types/sequelize';
4
+ export declare class MysqlSlaveConfig implements ConnectionOptions {
5
+ host: string;
6
+ port: number;
7
+ username: string;
8
+ password: string;
9
+ database: string;
10
+ constructor(props: MysqlSlaveConfig);
11
+ }
12
+ export declare enum Dialect {
13
+ MYSQL = "mysql",
14
+ POSTGRES = "postgres",
15
+ SQLITE = "sqlite",
16
+ MARIADB = "mariadb",
17
+ MSSQL = "mssql",
18
+ DB2 = "db2",
19
+ SNOWFLAKE = "snowflake",
20
+ ORACLE = "oracle"
21
+ }
22
+ export declare class MysqlConfig extends ClientConfig implements SequelizeOptions {
23
+ dialect: Dialect;
24
+ host: string;
25
+ port: number;
26
+ username: string;
27
+ password: string;
28
+ database: string;
29
+ charset?: string;
30
+ timezone?: string;
31
+ connectTimeout?: number;
32
+ slaves?: MysqlSlaveConfig[];
33
+ constructor(props: MysqlConfig);
34
+ }
35
35
  //# sourceMappingURL=mysql.config.d.ts.map