query-core 0.0.4
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/README.md +1 -0
- package/lib/batch.js +262 -0
- package/lib/build.js +784 -0
- package/lib/index.js +7 -0
- package/package.json +27 -0
- package/src/batch.ts +218 -0
- package/src/build.ts +683 -0
- package/src/index.ts +17 -0
- package/src/metadata.ts +73 -0
- package/tsconfig.json +26 -0
package/src/metadata.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export interface Module {
|
|
2
|
+
id?: string|number;
|
|
3
|
+
path?: string;
|
|
4
|
+
route?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Config {
|
|
7
|
+
host?: string;
|
|
8
|
+
port?: number;
|
|
9
|
+
user?: string;
|
|
10
|
+
password?: string;
|
|
11
|
+
database?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface StringMap {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
}
|
|
16
|
+
export interface Statement {
|
|
17
|
+
query: string;
|
|
18
|
+
params?: any[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type DataType = 'ObjectId' | 'date' | 'datetime' | 'time'
|
|
22
|
+
| 'boolean' | 'number' | 'integer' | 'string' | 'text'
|
|
23
|
+
| 'object' | 'array' | 'binary'
|
|
24
|
+
| 'primitives' | 'booleans' | 'numbers' | 'integers' | 'strings' | 'dates' | 'datetimes' | 'times';
|
|
25
|
+
export type FormatType = 'currency' | 'percentage' | 'email' | 'url' | 'phone' | 'fax' | 'ipv4' | 'ipv6';
|
|
26
|
+
export type MatchType = 'equal' | 'prefix' | 'contain' | 'max' | 'min'; // contain: default for string, min: default for Date, number
|
|
27
|
+
|
|
28
|
+
export interface Model {
|
|
29
|
+
name?: string;
|
|
30
|
+
attributes: Attributes;
|
|
31
|
+
source?: string;
|
|
32
|
+
table?: string;
|
|
33
|
+
collection?: string;
|
|
34
|
+
model?: any;
|
|
35
|
+
schema?: any;
|
|
36
|
+
}
|
|
37
|
+
export interface Attribute {
|
|
38
|
+
name?: string;
|
|
39
|
+
field?: string;
|
|
40
|
+
column?: string;
|
|
41
|
+
type?: DataType;
|
|
42
|
+
format?: FormatType;
|
|
43
|
+
required?: boolean;
|
|
44
|
+
match?: MatchType;
|
|
45
|
+
default?: string|number|Date|boolean;
|
|
46
|
+
key?: boolean;
|
|
47
|
+
unique?: boolean;
|
|
48
|
+
enum?: string[] | number[];
|
|
49
|
+
q?: boolean;
|
|
50
|
+
noinsert?: boolean;
|
|
51
|
+
noupdate?: boolean;
|
|
52
|
+
nopatch?: boolean;
|
|
53
|
+
version?: boolean;
|
|
54
|
+
length?: number;
|
|
55
|
+
min?: number;
|
|
56
|
+
max?: number;
|
|
57
|
+
gt?: number;
|
|
58
|
+
lt?: number;
|
|
59
|
+
precision?: number;
|
|
60
|
+
scale?: number;
|
|
61
|
+
exp?: RegExp | string;
|
|
62
|
+
code?: string;
|
|
63
|
+
noformat?: boolean;
|
|
64
|
+
ignored?: boolean;
|
|
65
|
+
jsonField?: string;
|
|
66
|
+
link?: string;
|
|
67
|
+
typeof?: Attributes;
|
|
68
|
+
true?: string|number;
|
|
69
|
+
false?: string|number;
|
|
70
|
+
}
|
|
71
|
+
export interface Attributes {
|
|
72
|
+
[key: string]: Attribute;
|
|
73
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": true,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "es5",
|
|
5
|
+
"baseUrl": "./src",
|
|
6
|
+
"outDir": "./lib",
|
|
7
|
+
"module": "commonjs",
|
|
8
|
+
"moduleResolution": "node",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"pretty": true,
|
|
11
|
+
"sourceMap": false,
|
|
12
|
+
"declaration": false,
|
|
13
|
+
"experimentalDecorators": false,
|
|
14
|
+
"removeComments": true,
|
|
15
|
+
"lib": [
|
|
16
|
+
"DOM",
|
|
17
|
+
"es7"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"include": [
|
|
21
|
+
"src/**/*.ts"
|
|
22
|
+
],
|
|
23
|
+
"exclude": [
|
|
24
|
+
"node_modules"
|
|
25
|
+
]
|
|
26
|
+
}
|