@leyyo/query 1.2.2 → 1.3.3
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/error/index.d.ts +2 -2
- package/dist/error/index.js +2 -18
- package/dist/error/index.types.js +1 -2
- package/dist/error/invalid-query-value.error.d.ts +3 -2
- package/dist/error/invalid-query-value.error.js +4 -5
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js +1 -17
- package/dist/field/index.types.js +1 -2
- package/dist/group-by/index.d.ts +1 -1
- package/dist/group-by/index.js +1 -17
- package/dist/group-by/index.types.d.ts +1 -1
- package/dist/group-by/index.types.js +1 -2
- package/dist/index.d.ts +12 -10
- package/dist/index.foretell.d.ts +1 -0
- package/dist/index.foretell.js +17 -0
- package/dist/index.js +12 -26
- package/dist/index.loader.d.ts +1 -0
- package/dist/index.loader.js +12 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +1 -0
- package/dist/operation/index.d.ts +1 -1
- package/dist/operation/index.js +1 -17
- package/dist/operation/operation-type.d.ts +7 -2
- package/dist/operation/operation-type.js +3 -5
- package/dist/order-by/index.d.ts +1 -1
- package/dist/order-by/index.js +1 -17
- package/dist/order-by/index.types.d.ts +2 -2
- package/dist/order-by/index.types.js +1 -2
- package/dist/order-type/index.d.ts +1 -0
- package/dist/order-type/index.js +1 -0
- package/dist/order-type/order-type.d.ts +7 -0
- package/dist/order-type/order-type.js +2 -0
- package/dist/pagination/index.d.ts +1 -1
- package/dist/pagination/index.js +1 -17
- package/dist/pagination/index.types.js +1 -2
- package/dist/parser/index.d.ts +2 -2
- package/dist/parser/index.js +2 -18
- package/dist/parser/index.types.d.ts +1 -1
- package/dist/parser/index.types.js +1 -2
- package/dist/parser/query.parser.d.ts +1 -1
- package/dist/parser/query.parser.js +56 -60
- package/dist/query/index.d.ts +1 -1
- package/dist/query/index.js +1 -17
- package/dist/query/index.types.d.ts +5 -5
- package/dist/query/index.types.js +1 -2
- package/dist/select/index.d.ts +1 -1
- package/dist/select/index.js +1 -17
- package/dist/select/index.types.d.ts +1 -1
- package/dist/select/index.types.js +1 -2
- package/dist/where/index.d.ts +1 -1
- package/dist/where/index.js +1 -17
- package/dist/where/index.types.d.ts +2 -2
- package/dist/where/index.types.js +1 -2
- package/package.json +4 -5
- package/dist/assets/.gitkeep +0 -0
package/dist/error/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './invalid-query-value.error';
|
|
2
|
-
export * from './index.types';
|
|
1
|
+
export * from './invalid-query-value.error.js';
|
|
2
|
+
export * from './index.types.js';
|
package/dist/error/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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("./invalid-query-value.error"), exports);
|
|
18
|
-
__exportStar(require("./index.types"), exports);
|
|
1
|
+
export * from './invalid-query-value.error.js';
|
|
2
|
+
export * from './index.types.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { QueryErrorCode } from "./index.types";
|
|
2
|
-
|
|
1
|
+
import { QueryErrorCode } from "./index.types.js";
|
|
2
|
+
import { LeyyoError } from "@leyyo/common";
|
|
3
|
+
export declare class InvalidQueryValueError extends LeyyoError {
|
|
3
4
|
readonly message: string;
|
|
4
5
|
readonly path: string;
|
|
5
6
|
constructor(code: QueryErrorCode, message: string, path: string);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { LeyyoError } from "@leyyo/common";
|
|
2
|
+
export class InvalidQueryValueError extends LeyyoError {
|
|
3
|
+
message;
|
|
4
|
+
path;
|
|
5
5
|
constructor(code, message, path) {
|
|
6
6
|
super(`[${code}] ${message} at ${path}`);
|
|
7
7
|
this.message = message;
|
|
8
8
|
this.path = path;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
exports.InvalidQueryValueError = InvalidQueryValueError;
|
package/dist/field/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './index.types';
|
|
1
|
+
export * from './index.types.js';
|
package/dist/field/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
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("./index.types"), exports);
|
|
1
|
+
export * from './index.types.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/group-by/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './index.types';
|
|
1
|
+
export * from './index.types.js';
|
package/dist/group-by/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
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("./index.types"), exports);
|
|
1
|
+
export * from './index.types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FieldRaw, FieldRegular } from "../field/index.js";
|
|
2
2
|
export type GroupByAny<K extends string> = Array<K | GroupByGivenRegular<K> | GroupByGivenRaw>;
|
|
3
3
|
export type GroupByGivenRegular<K extends string> = FieldRegular<K>;
|
|
4
4
|
export type GroupByGivenRaw = FieldRaw;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export * from './operation';
|
|
2
|
-
export * from './error';
|
|
3
|
-
export * from './field';
|
|
4
|
-
export * from './group-by';
|
|
5
|
-
export * from './order-by';
|
|
6
|
-
export * from './pagination';
|
|
7
|
-
export * from './parser';
|
|
8
|
-
export * from './query';
|
|
9
|
-
export * from './select';
|
|
10
|
-
export * from './where';
|
|
1
|
+
export * from './operation/index.js';
|
|
2
|
+
export * from './error/index.js';
|
|
3
|
+
export * from './field/index.js';
|
|
4
|
+
export * from './group-by/index.js';
|
|
5
|
+
export * from './order-by/index.js';
|
|
6
|
+
export * from './pagination/index.js';
|
|
7
|
+
export * from './parser/index.js';
|
|
8
|
+
export * from './query/index.js';
|
|
9
|
+
export * from './select/index.js';
|
|
10
|
+
export * from './where/index.js';
|
|
11
|
+
export * from './index.foretell.js';
|
|
12
|
+
export * from './index.loader.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const foretell_leyyoQuery: (() => void)[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FQN } from "./internal.js";
|
|
2
|
+
import { errorPool, foretell_leyyoCommon, literalPool } from "@leyyo/common";
|
|
3
|
+
// noinspection JSUnusedGlobalSymbols
|
|
4
|
+
export const foretell_leyyoQuery = [
|
|
5
|
+
// dependencies
|
|
6
|
+
...foretell_leyyoCommon,
|
|
7
|
+
// errors
|
|
8
|
+
() => errorPool.lazy(FQN, 'InvalidQueryValueError', import('./error/invalid-query-value.error.js').then(m => m.InvalidQueryValueError), { i18n: true, emit: true }),
|
|
9
|
+
// enums
|
|
10
|
+
() => literalPool.register({
|
|
11
|
+
name: 'OperationType',
|
|
12
|
+
fqn: FQN,
|
|
13
|
+
i18n: true,
|
|
14
|
+
lazyTarget: import('./operation/operation-type.js').then(m => m.OperationTypeItems),
|
|
15
|
+
lazyAlt: import('./operation/operation-type.js').then(m => m.OperationTypeMap),
|
|
16
|
+
}),
|
|
17
|
+
];
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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("./operation"), exports);
|
|
18
|
-
__exportStar(require("./error"), exports);
|
|
19
|
-
__exportStar(require("./field"), exports);
|
|
20
|
-
__exportStar(require("./group-by"), exports);
|
|
21
|
-
__exportStar(require("./order-by"), exports);
|
|
22
|
-
__exportStar(require("./pagination"), exports);
|
|
23
|
-
__exportStar(require("./parser"), exports);
|
|
24
|
-
__exportStar(require("./query"), exports);
|
|
25
|
-
__exportStar(require("./select"), exports);
|
|
26
|
-
__exportStar(require("./where"), exports);
|
|
1
|
+
export * from './operation/index.js';
|
|
2
|
+
export * from './error/index.js';
|
|
3
|
+
export * from './field/index.js';
|
|
4
|
+
export * from './group-by/index.js';
|
|
5
|
+
export * from './order-by/index.js';
|
|
6
|
+
export * from './pagination/index.js';
|
|
7
|
+
export * from './parser/index.js';
|
|
8
|
+
export * from './query/index.js';
|
|
9
|
+
export * from './select/index.js';
|
|
10
|
+
export * from './where/index.js';
|
|
11
|
+
export * from './index.foretell.js';
|
|
12
|
+
export * from './index.loader.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loader_leyyoQuery: import("@leyyo/common").LoaderLike;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineLoader, loader_leyyoCommon } from "@leyyo/common";
|
|
2
|
+
import { FQN } from "./internal.js";
|
|
3
|
+
// noinspection JSUnusedGlobalSymbols
|
|
4
|
+
export const loader_leyyoQuery = defineLoader(FQN,
|
|
5
|
+
// dependencies
|
|
6
|
+
...loader_leyyoCommon,
|
|
7
|
+
// errors
|
|
8
|
+
() => import('./error/invalid-query-value.error.js').then(m => m.InvalidQueryValueError),
|
|
9
|
+
// enums
|
|
10
|
+
() => import('./operation/operation-type.js').then(m => m.OperationTypeItems),
|
|
11
|
+
// classes
|
|
12
|
+
() => import('./parser/query.parser.js').then(m => m.queryParser));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FQN = "leyyo.query";
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const FQN = 'leyyo.query';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './operation-type';
|
|
1
|
+
export * from './operation-type.js';
|
package/dist/operation/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
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("./operation-type"), exports);
|
|
1
|
+
export * from './operation-type.js';
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const literals: readonly ["eq", "ne", "null", "!null", "missing", "!missing", "gt", "gte", "lt", "lte", "between", "!between", "in", "!in", "starts", "!starts", "ends", "!ends", "matches", "!matches", "contains", "!contains", "contained", "!contained", "true", "false", "includes", "!includes", "intersects", "!intersects", "exists", "!exists"];
|
|
2
|
+
/**
|
|
3
|
+
* Operation Type
|
|
4
|
+
* */
|
|
5
|
+
export type OperationType = typeof literals[number];
|
|
6
|
+
export declare const OperationTypeItems: ReadonlyArray<OperationType>;
|
|
3
7
|
export declare const OperationTypeMap: Record<string, OperationType>;
|
|
8
|
+
export {};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OperationTypeMap = exports.ConditionTypeItems = void 0;
|
|
4
|
-
exports.ConditionTypeItems = [
|
|
1
|
+
const literals = [
|
|
5
2
|
// all
|
|
6
3
|
'eq',
|
|
7
4
|
'ne',
|
|
@@ -41,8 +38,9 @@ exports.ConditionTypeItems = [
|
|
|
41
38
|
'exists',
|
|
42
39
|
'!exists',
|
|
43
40
|
];
|
|
41
|
+
export const OperationTypeItems = literals;
|
|
44
42
|
// noinspection JSUnusedGlobalSymbols
|
|
45
|
-
|
|
43
|
+
export const OperationTypeMap = {
|
|
46
44
|
// all
|
|
47
45
|
'=': 'eq',
|
|
48
46
|
'==': 'eq',
|
package/dist/order-by/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './index.types';
|
|
1
|
+
export * from './index.types.js';
|
package/dist/order-by/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
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("./index.types"), exports);
|
|
1
|
+
export * from './index.types.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { FieldRaw, FieldRegular } from "../field/index.js";
|
|
2
|
+
import { OrderType } from "../order-type/index.js";
|
|
3
3
|
export type OrderByAny<K extends string> = K | Array<OrderByGiven<K> | K | OrderByGivenRaw> | OrderByValue<K>;
|
|
4
4
|
export type OrderByValue<K extends string> = {
|
|
5
5
|
[field in K]: boolean | OrderType;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './order-type.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './order-type.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './index.types';
|
|
1
|
+
export * from './index.types.js';
|
package/dist/pagination/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
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("./index.types"), exports);
|
|
1
|
+
export * from './index.types.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/parser/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './index.types';
|
|
2
|
-
export * from './query.parser';
|
|
1
|
+
export * from './index.types.js';
|
|
2
|
+
export * from './query.parser.js';
|
package/dist/parser/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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("./index.types"), exports);
|
|
18
|
-
__exportStar(require("./query.parser"), exports);
|
|
1
|
+
export * from './index.types.js';
|
|
2
|
+
export * from './query.parser.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { QueryAny, QueryRegular } from "../query/index.js";
|
|
2
2
|
import { BasicType } from "@leyyo/common";
|
|
3
3
|
export interface QueryParserLike {
|
|
4
4
|
exec<K extends string>(query: QueryAny<K>, availableFields: Array<K | string>, name?: string): QueryRegular<K>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { QueryParserLike } from "./index.types.js";
|
|
2
2
|
export declare const queryParser: QueryParserLike;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const operation_1 = require("../operation");
|
|
5
|
-
const error_1 = require("../error");
|
|
6
|
-
const type_1 = require("@leyyo/type");
|
|
1
|
+
import { isEmpty, isFilledObj, isText } from "@leyyo/common";
|
|
2
|
+
import { OperationTypeItems, OperationTypeMap } from "../operation/index.js";
|
|
3
|
+
import { InvalidQueryValueError } from "../error/index.js";
|
|
7
4
|
class QueryParser {
|
|
8
5
|
// region private
|
|
9
6
|
_error(code, message, path) {
|
|
10
|
-
return new
|
|
7
|
+
return new InvalidQueryValueError(code, message, path);
|
|
11
8
|
}
|
|
12
9
|
_invalid(value, path, expected, code) {
|
|
13
10
|
const ex = Array.isArray(expected) ? `[${expected.join(', ')}]` : expected;
|
|
14
11
|
return this._error(code, `It's expected as ${ex}, but it's type: ${typeof value}`, path);
|
|
15
12
|
}
|
|
16
13
|
_emptyOrInvalid(value, path, expected, empty, invalid) {
|
|
17
|
-
if (
|
|
14
|
+
if (isEmpty(value)) {
|
|
18
15
|
return this._error(empty, `It's empty`, path);
|
|
19
16
|
}
|
|
20
17
|
if (typeof value === 'string' && value.trim() === '') {
|
|
@@ -23,13 +20,13 @@ class QueryParser {
|
|
|
23
20
|
return this._invalid(value, path, expected, invalid);
|
|
24
21
|
}
|
|
25
22
|
_asc(value, path) {
|
|
26
|
-
if (
|
|
23
|
+
if (isEmpty(value)) {
|
|
27
24
|
return true;
|
|
28
25
|
}
|
|
29
26
|
if (typeof value === 'boolean') {
|
|
30
27
|
return value;
|
|
31
28
|
}
|
|
32
|
-
else if (
|
|
29
|
+
else if (isText(value)) {
|
|
33
30
|
if (value.toLowerCase() === 'asc') {
|
|
34
31
|
return true;
|
|
35
32
|
}
|
|
@@ -41,37 +38,37 @@ class QueryParser {
|
|
|
41
38
|
throw this._invalid(value, path, ['boolean', 'string'], 'asc:invalid-type');
|
|
42
39
|
}
|
|
43
40
|
_field(value, path) {
|
|
44
|
-
if (
|
|
41
|
+
if (isText(value)) {
|
|
45
42
|
return value;
|
|
46
43
|
}
|
|
47
44
|
throw this._emptyOrInvalid(value, path, 'string', 'field:empty', 'field:invalid');
|
|
48
45
|
}
|
|
49
46
|
_raw(value, path) {
|
|
50
|
-
if (
|
|
47
|
+
if (isText(value)) {
|
|
51
48
|
return value;
|
|
52
49
|
}
|
|
53
50
|
throw this._emptyOrInvalid(value, path, 'string', 'raw:empty', 'raw:invalid');
|
|
54
51
|
}
|
|
55
52
|
_as(value, path) {
|
|
56
|
-
if (
|
|
53
|
+
if (isEmpty(value)) {
|
|
57
54
|
return undefined;
|
|
58
55
|
}
|
|
59
|
-
else if (
|
|
56
|
+
else if (isText(value)) {
|
|
60
57
|
return value;
|
|
61
58
|
}
|
|
62
59
|
throw this._invalid(value, path, 'string', 'as:invalid');
|
|
63
60
|
}
|
|
64
61
|
_operation(value, path) {
|
|
65
|
-
if (
|
|
62
|
+
if (isEmpty(value)) {
|
|
66
63
|
return 'eq';
|
|
67
64
|
}
|
|
68
|
-
else if (
|
|
65
|
+
else if (isText(value)) {
|
|
69
66
|
const key = value;
|
|
70
|
-
if ((
|
|
67
|
+
if (isText(key) && OperationTypeItems.includes(key)) {
|
|
71
68
|
return key;
|
|
72
69
|
}
|
|
73
|
-
if (
|
|
74
|
-
return
|
|
70
|
+
if (OperationTypeMap[key] !== undefined) {
|
|
71
|
+
return OperationTypeMap[key];
|
|
75
72
|
}
|
|
76
73
|
throw this._error('op:invalid-key', `It should be [@see operations], but it's value: ${value}`, path);
|
|
77
74
|
}
|
|
@@ -98,7 +95,7 @@ class QueryParser {
|
|
|
98
95
|
if (Array.isArray(value)) {
|
|
99
96
|
let index = 0;
|
|
100
97
|
for (const item of value) {
|
|
101
|
-
if (!
|
|
98
|
+
if (!isText(item) && typeof value !== 'number' && typeof value !== 'boolean') {
|
|
102
99
|
throw this._invalid(item, `${path}[${index}]`, ['string', 'number', 'boolean', 'array', 'number'], 'value:invalid-item');
|
|
103
100
|
}
|
|
104
101
|
index++;
|
|
@@ -110,10 +107,10 @@ class QueryParser {
|
|
|
110
107
|
throw this._invalid(value, path, ['string', 'number', 'boolean', 'array', 'number'], 'value:invalid-type');
|
|
111
108
|
}
|
|
112
109
|
_num(value, path, min) {
|
|
113
|
-
if (
|
|
110
|
+
if (isEmpty(value)) {
|
|
114
111
|
return undefined;
|
|
115
112
|
}
|
|
116
|
-
else if (
|
|
113
|
+
else if (Number.isSafeInteger(value)) {
|
|
117
114
|
if (value >= min) {
|
|
118
115
|
return value;
|
|
119
116
|
}
|
|
@@ -132,7 +129,7 @@ class QueryParser {
|
|
|
132
129
|
// endregion private
|
|
133
130
|
// region parts
|
|
134
131
|
_select(given, _availableFields, _name) {
|
|
135
|
-
if (
|
|
132
|
+
if (isEmpty(given)) {
|
|
136
133
|
return { all: true };
|
|
137
134
|
}
|
|
138
135
|
// Cases:
|
|
@@ -151,7 +148,7 @@ class QueryParser {
|
|
|
151
148
|
const arr = given;
|
|
152
149
|
arr.forEach((item, index) => {
|
|
153
150
|
// Case 2A: K
|
|
154
|
-
if (
|
|
151
|
+
if (isText(item)) {
|
|
155
152
|
newSelect.fields.push({
|
|
156
153
|
field: item,
|
|
157
154
|
});
|
|
@@ -164,15 +161,15 @@ class QueryParser {
|
|
|
164
161
|
newSelect.fields.push({ field, as, });
|
|
165
162
|
}
|
|
166
163
|
// Case 2C: SelectGiven<K> | SelectGivenRaw
|
|
167
|
-
else if ((
|
|
164
|
+
else if (isFilledObj(item)) {
|
|
168
165
|
let as;
|
|
169
166
|
let field;
|
|
170
167
|
let raw;
|
|
171
168
|
const obj = item;
|
|
172
|
-
if (!
|
|
169
|
+
if (!isEmpty(obj.raw)) {
|
|
173
170
|
raw = this._raw(obj.raw, `select[${index}].raw`);
|
|
174
171
|
}
|
|
175
|
-
if (!
|
|
172
|
+
if (!isEmpty(obj.field)) {
|
|
176
173
|
field = this._field(obj.field, `select[${index}].field`);
|
|
177
174
|
}
|
|
178
175
|
this._fieldXorRaw(field, raw, `select[${index}].field`);
|
|
@@ -197,7 +194,7 @@ class QueryParser {
|
|
|
197
194
|
return newSelect;
|
|
198
195
|
}
|
|
199
196
|
_where(scope, given, _availableFields, _name) {
|
|
200
|
-
if (
|
|
197
|
+
if (isEmpty(given)) {
|
|
201
198
|
return [];
|
|
202
199
|
}
|
|
203
200
|
// Cases:
|
|
@@ -205,7 +202,7 @@ class QueryParser {
|
|
|
205
202
|
// 2 - Array<WhereGiven<K>|WhereGivenRaw|[K, unknown]>
|
|
206
203
|
const newWhere = [];
|
|
207
204
|
// case 1: WhereValue<K>
|
|
208
|
-
if ((
|
|
205
|
+
if (isFilledObj(given)) {
|
|
209
206
|
let index = 0;
|
|
210
207
|
for (let [k, v] of Object.entries(given)) {
|
|
211
208
|
const field = this._field(k, `${scope}(key=${index})`);
|
|
@@ -222,22 +219,22 @@ class QueryParser {
|
|
|
222
219
|
const arr = given;
|
|
223
220
|
arr.forEach((item, index) => {
|
|
224
221
|
// Case 2A: WhereGiven<K>|WhereGivenRaw
|
|
225
|
-
if ((
|
|
222
|
+
if (isFilledObj(item)) {
|
|
226
223
|
let field;
|
|
227
224
|
let raw;
|
|
228
225
|
let op;
|
|
229
226
|
let value;
|
|
230
227
|
let fullRaw;
|
|
231
228
|
const obj = item;
|
|
232
|
-
if (!
|
|
229
|
+
if (!isEmpty(obj.raw)) {
|
|
233
230
|
raw = this._raw(obj.raw, `${scope}[${index}].raw`);
|
|
234
231
|
}
|
|
235
|
-
if (!
|
|
232
|
+
if (!isEmpty(obj.field)) {
|
|
236
233
|
field = this._field(obj.field, `${scope}[${index}].field`);
|
|
237
234
|
}
|
|
238
235
|
this._fieldXorRaw(field, raw, `${scope}[${index}].field`);
|
|
239
236
|
const whereItem = obj;
|
|
240
|
-
if (raw &&
|
|
237
|
+
if (raw && isEmpty(whereItem.op) && isEmpty(whereItem.value)) {
|
|
241
238
|
fullRaw = true;
|
|
242
239
|
}
|
|
243
240
|
op = this._operation(whereItem.op, `${scope}[${index}].op`);
|
|
@@ -269,7 +266,7 @@ class QueryParser {
|
|
|
269
266
|
return newWhere;
|
|
270
267
|
}
|
|
271
268
|
_groupBy(given, _availableFields, _name) {
|
|
272
|
-
if (
|
|
269
|
+
if (isEmpty(given)) {
|
|
273
270
|
return [];
|
|
274
271
|
}
|
|
275
272
|
// Cases:
|
|
@@ -283,14 +280,14 @@ class QueryParser {
|
|
|
283
280
|
const arr = given;
|
|
284
281
|
arr.forEach((item, index) => {
|
|
285
282
|
// Case 2A: GroupByGivenRegular<K> | GroupByGivenRaw
|
|
286
|
-
if ((
|
|
283
|
+
if (isFilledObj(item)) {
|
|
287
284
|
let field;
|
|
288
285
|
let raw;
|
|
289
286
|
const obj = item;
|
|
290
|
-
if (!
|
|
287
|
+
if (!isEmpty(obj.raw)) {
|
|
291
288
|
raw = this._raw(obj.raw, `groupBy[${index}].raw`);
|
|
292
289
|
}
|
|
293
|
-
if (!
|
|
290
|
+
if (!isEmpty(obj.field)) {
|
|
294
291
|
field = this._field(obj.field, `groupBy[${index}].field`);
|
|
295
292
|
}
|
|
296
293
|
this._fieldXorRaw(field, raw, `groupBy[${index}].field`);
|
|
@@ -302,7 +299,7 @@ class QueryParser {
|
|
|
302
299
|
}
|
|
303
300
|
}
|
|
304
301
|
// Case 2B: K
|
|
305
|
-
else if (
|
|
302
|
+
else if (isText(item)) {
|
|
306
303
|
newGroup.push({ field: item });
|
|
307
304
|
}
|
|
308
305
|
else {
|
|
@@ -317,7 +314,7 @@ class QueryParser {
|
|
|
317
314
|
return newGroup;
|
|
318
315
|
}
|
|
319
316
|
_orderBy(given, _availableFields, _name) {
|
|
320
|
-
if (
|
|
317
|
+
if (isEmpty(given)) {
|
|
321
318
|
return [];
|
|
322
319
|
}
|
|
323
320
|
// Cases:
|
|
@@ -326,7 +323,7 @@ class QueryParser {
|
|
|
326
323
|
// 3 - OrderByValue<K>
|
|
327
324
|
const newOrder = [];
|
|
328
325
|
// case 1: string as K
|
|
329
|
-
if (
|
|
326
|
+
if (isText(given)) {
|
|
330
327
|
newOrder.push({ field: given, asc: true });
|
|
331
328
|
}
|
|
332
329
|
// case 2: array as Array<OrderByGiven<K>|K|OrderByGivenRaw>
|
|
@@ -337,15 +334,15 @@ class QueryParser {
|
|
|
337
334
|
const arr = given;
|
|
338
335
|
arr.forEach((item, index) => {
|
|
339
336
|
// Case 2A: OrderByGiven<K>|OrderByGivenRaw
|
|
340
|
-
if ((
|
|
337
|
+
if (isFilledObj(item)) {
|
|
341
338
|
let asc;
|
|
342
339
|
let field;
|
|
343
340
|
let raw;
|
|
344
341
|
const obj = item;
|
|
345
|
-
if (!
|
|
342
|
+
if (!isEmpty(obj.raw)) {
|
|
346
343
|
raw = this._raw(obj.raw, `orderBy[${index}].raw`);
|
|
347
344
|
}
|
|
348
|
-
if (!
|
|
345
|
+
if (!isEmpty(obj.field)) {
|
|
349
346
|
field = this._field(obj.field, `orderBy[${index}].field`);
|
|
350
347
|
}
|
|
351
348
|
this._fieldXorRaw(field, raw, `orderBy[${index}].field`);
|
|
@@ -358,7 +355,7 @@ class QueryParser {
|
|
|
358
355
|
}
|
|
359
356
|
}
|
|
360
357
|
// Case 2B: K
|
|
361
|
-
else if (
|
|
358
|
+
else if (isText(item)) {
|
|
362
359
|
newOrder.push({ field: this._field(item, ''), asc: true });
|
|
363
360
|
}
|
|
364
361
|
// other
|
|
@@ -368,7 +365,7 @@ class QueryParser {
|
|
|
368
365
|
});
|
|
369
366
|
}
|
|
370
367
|
// case 3: {'id': true, name: true, ...} as OrderByValue<K>
|
|
371
|
-
else if ((
|
|
368
|
+
else if (isFilledObj(given)) {
|
|
372
369
|
let index = 0;
|
|
373
370
|
for (let [k, v] of Object.entries(given)) {
|
|
374
371
|
const field = this._field(k, `orderBy(key=${index})`);
|
|
@@ -384,8 +381,7 @@ class QueryParser {
|
|
|
384
381
|
return newOrder;
|
|
385
382
|
}
|
|
386
383
|
_pagination(given, _name) {
|
|
387
|
-
|
|
388
|
-
if ((0, type_1.isEmpty)(given)) {
|
|
384
|
+
if (isEmpty(given)) {
|
|
389
385
|
return {};
|
|
390
386
|
}
|
|
391
387
|
// Case 1: PaginationLiteral
|
|
@@ -399,16 +395,16 @@ class QueryParser {
|
|
|
399
395
|
};
|
|
400
396
|
}
|
|
401
397
|
// Case 2: PaginationPage | PaginationLimit
|
|
402
|
-
else if ((
|
|
398
|
+
else if (isFilledObj(given)) {
|
|
403
399
|
if (Object.keys(given).length < 1) {
|
|
404
400
|
return {};
|
|
405
401
|
}
|
|
406
402
|
const obj = given;
|
|
407
|
-
if (!
|
|
403
|
+
if (!isEmpty(obj.page)) {
|
|
408
404
|
const page = this._num(obj.page, `pagination.page`, 1);
|
|
409
|
-
const size =
|
|
405
|
+
const size = this._num(obj.size, `pagination.size`, 1) ?? 50;
|
|
410
406
|
['limit', 'offset'].forEach(f => {
|
|
411
|
-
if (!
|
|
407
|
+
if (!isEmpty(given[f])) {
|
|
412
408
|
throw this._error('page:conflict', 'If you give page; limit and offset can not be used anymore', `pagination.page`);
|
|
413
409
|
}
|
|
414
410
|
});
|
|
@@ -417,9 +413,9 @@ class QueryParser {
|
|
|
417
413
|
offset: (page - 1) * size
|
|
418
414
|
};
|
|
419
415
|
}
|
|
420
|
-
if (!
|
|
416
|
+
if (!isEmpty(obj.limit)) {
|
|
421
417
|
['page', 'size'].forEach(f => {
|
|
422
|
-
if (!
|
|
418
|
+
if (!isEmpty(obj[f])) {
|
|
423
419
|
throw this._error('limit:conflict', 'If you give limit; page and size can not be used anymore', `pagination.limit`);
|
|
424
420
|
}
|
|
425
421
|
});
|
|
@@ -435,14 +431,14 @@ class QueryParser {
|
|
|
435
431
|
// endregion parts
|
|
436
432
|
exec(query, availableFields, name) {
|
|
437
433
|
return {
|
|
438
|
-
select: this._select(query
|
|
439
|
-
where: this._where('where', query
|
|
440
|
-
having: this._where('having', query
|
|
441
|
-
groupBy: this._groupBy(query
|
|
442
|
-
orderBy: this._orderBy(query
|
|
443
|
-
pagination: this._pagination(query
|
|
434
|
+
select: this._select(query?.select, availableFields, name),
|
|
435
|
+
where: this._where('where', query?.where, availableFields, name),
|
|
436
|
+
having: this._where('having', query?.having, availableFields, name),
|
|
437
|
+
groupBy: this._groupBy(query?.groupBy, availableFields, name),
|
|
438
|
+
orderBy: this._orderBy(query?.orderBy, availableFields, name),
|
|
439
|
+
pagination: this._pagination(query?.pagination, name),
|
|
444
440
|
};
|
|
445
441
|
}
|
|
446
442
|
}
|
|
447
443
|
// noinspection JSUnusedGlobalSymbols
|
|
448
|
-
|
|
444
|
+
export const queryParser = new QueryParser();
|
package/dist/query/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './index.types';
|
|
1
|
+
export * from './index.types.js';
|
package/dist/query/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
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("./index.types"), exports);
|
|
1
|
+
export * from './index.types.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { Select, SelectAny } from "../select/index.js";
|
|
2
|
+
import { Where, WhereAny } from "../where/index.js";
|
|
3
|
+
import { GroupBy, GroupByAny } from "../group-by/index.js";
|
|
4
|
+
import { OrderBy, OrderByAny } from "../order-by/index.js";
|
|
5
|
+
import { PaginationAny, PaginationLimit } from "../pagination/index.js";
|
|
6
6
|
export interface QueryAny<K extends string> {
|
|
7
7
|
select?: SelectAny<K>;
|
|
8
8
|
where?: WhereAny<K>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/select/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './index.types';
|
|
1
|
+
export * from './index.types.js';
|
package/dist/select/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
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("./index.types"), exports);
|
|
1
|
+
export * from './index.types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FieldAs, FieldRaw, FieldRegular } from "../field/index.js";
|
|
2
2
|
export type SelectAny<K extends string> = '*' | Array<K | [K, string] | SelectGiven<K> | SelectGivenRaw>;
|
|
3
3
|
export type SelectGiven<K extends string> = FieldRegular<K> & FieldAs;
|
|
4
4
|
export type SelectGivenRaw = FieldRaw & FieldAs;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/where/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './index.types';
|
|
1
|
+
export * from './index.types.js';
|
package/dist/where/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
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("./index.types"), exports);
|
|
1
|
+
export * from './index.types.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { OperationType } from "../operation/index.js";
|
|
2
|
+
import { FieldRaw, FieldRegular } from "../field/index.js";
|
|
3
3
|
export type WhereValue<K extends string> = {
|
|
4
4
|
[P in K]: unknown;
|
|
5
5
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leyyo/query",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Query common component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Query"
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"email": "mustafayelmer@gmail.com"
|
|
20
20
|
},
|
|
21
21
|
"main": "dist/index.js",
|
|
22
|
-
"type": "
|
|
22
|
+
"type": "module",
|
|
23
23
|
"scripts": {
|
|
24
24
|
"clear": "rimraf dist && rimraf coverage",
|
|
25
25
|
"clear:nm": "rimraf node_modules && npm run clear",
|
|
26
26
|
"lint": "eslint src/**/*.ts --quiet",
|
|
27
27
|
"lint:verbose": "eslint src/**/*.ts",
|
|
28
|
-
"asset": "node -r ts-node/register commands/assets.
|
|
28
|
+
"asset": "node -r ts-node/register commands/assets.js",
|
|
29
29
|
"build": "npm run clear && tsc && npm run asset",
|
|
30
30
|
"test": "jest --config=jest.json --detectOpenHandles",
|
|
31
31
|
"coverage": "rimraf coverage && jest --config=jest.json --coverage --coverageDirectory=coverage",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@leyyo/common": "^1.
|
|
70
|
-
"@leyyo/type": "^1.1.1"
|
|
69
|
+
"@leyyo/common": "^1.3.10"
|
|
71
70
|
}
|
|
72
71
|
}
|
package/dist/assets/.gitkeep
DELETED
|
File without changes
|