@spinajs/orm 1.2.48 → 1.2.49
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/package.json +5 -5
- package/lib/helpers.d.ts +0 -1
- package/lib/helpers.js +0 -14
- package/lib/helpers.js.map +0 -1
- package/lib/log-common/src/index.d.ts +0 -180
- package/lib/log-common/src/index.js +0 -49
- package/lib/log-common/src/index.js.map +0 -1
- package/lib/orm/src/builders.d.ts +0 -429
- package/lib/orm/src/builders.js +0 -1082
- package/lib/orm/src/builders.js.map +0 -1
- package/lib/orm/src/cli.d.ts +0 -1
- package/lib/orm/src/cli.js +0 -2
- package/lib/orm/src/cli.js.map +0 -1
- package/lib/orm/src/converters.d.ts +0 -9
- package/lib/orm/src/converters.js +0 -22
- package/lib/orm/src/converters.js.map +0 -1
- package/lib/orm/src/decorators.d.ts +0 -122
- package/lib/orm/src/decorators.js +0 -380
- package/lib/orm/src/decorators.js.map +0 -1
- package/lib/orm/src/driver.d.ts +0 -77
- package/lib/orm/src/driver.js +0 -84
- package/lib/orm/src/driver.js.map +0 -1
- package/lib/orm/src/enums.d.ts +0 -111
- package/lib/orm/src/enums.js +0 -122
- package/lib/orm/src/enums.js.map +0 -1
- package/lib/orm/src/exceptions.d.ts +0 -6
- package/lib/orm/src/exceptions.js +0 -11
- package/lib/orm/src/exceptions.js.map +0 -1
- package/lib/orm/src/hydrators.d.ts +0 -16
- package/lib/orm/src/hydrators.js +0 -70
- package/lib/orm/src/hydrators.js.map +0 -1
- package/lib/orm/src/index.d.ts +0 -12
- package/lib/orm/src/index.js +0 -25
- package/lib/orm/src/index.js.map +0 -1
- package/lib/orm/src/interfaces.d.ts +0 -615
- package/lib/orm/src/interfaces.js +0 -186
- package/lib/orm/src/interfaces.js.map +0 -1
- package/lib/orm/src/model.d.ts +0 -135
- package/lib/orm/src/model.js +0 -449
- package/lib/orm/src/model.js.map +0 -1
- package/lib/orm/src/orm.d.ts +0 -59
- package/lib/orm/src/orm.js +0 -278
- package/lib/orm/src/orm.js.map +0 -1
- package/lib/orm/src/relations.d.ts +0 -96
- package/lib/orm/src/relations.js +0 -503
- package/lib/orm/src/relations.js.map +0 -1
- package/lib/orm/src/statements.d.ts +0 -132
- package/lib/orm/src/statements.js +0 -257
- package/lib/orm/src/statements.js.map +0 -1
- package/lib/orm/src/types.d.ts +0 -2
- package/lib/orm/src/types.js +0 -3
- package/lib/orm/src/types.js.map +0 -1
- package/lib/orm/src/wrappers.d.ts +0 -5
- package/lib/orm/src/wrappers.js +0 -13
- package/lib/orm/src/wrappers.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinajs/orm",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.49",
|
|
4
4
|
"description": "framework orm module",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/spinajs/main#readme",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@spinajs/configuration": "^1.2.
|
|
43
|
+
"@spinajs/configuration": "^1.2.49",
|
|
44
44
|
"@spinajs/di": "^1.2.32",
|
|
45
45
|
"@spinajs/exceptions": "^1.2.7",
|
|
46
46
|
"@spinajs/internal-logger": "^1.2.32",
|
|
47
|
-
"@spinajs/log": "^1.2.
|
|
48
|
-
"@spinajs/reflection": "^1.2.
|
|
47
|
+
"@spinajs/log": "^1.2.49",
|
|
48
|
+
"@spinajs/reflection": "^1.2.49",
|
|
49
49
|
"lodash": "^4.17.14",
|
|
50
50
|
"luxon": "^2.3.0",
|
|
51
51
|
"typescript-mix": "^3.1.3",
|
|
52
52
|
"uuid": "^8.3.2"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "b99fad4bd66e441a62707c689e96d94ebeb483ad"
|
|
55
55
|
}
|
package/lib/helpers.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function applyMixins(derivedCtor: any, baseCtors: any[]): void;
|
package/lib/helpers.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyMixins = void 0;
|
|
4
|
-
function applyMixins(derivedCtor, baseCtors) {
|
|
5
|
-
baseCtors.forEach((baseCtor) => {
|
|
6
|
-
Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
|
|
7
|
-
if (name !== 'constructor') {
|
|
8
|
-
derivedCtor.prototype[name] = baseCtor.prototype[name];
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
exports.applyMixins = applyMixins;
|
|
14
|
-
//# sourceMappingURL=helpers.js.map
|
package/lib/helpers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,WAAgB,EAAE,SAAgB;IAC5D,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC7B,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9D,IAAI,IAAI,KAAK,aAAa,EAAE;gBAC1B,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;aACxD;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AARD,kCAQC"}
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
export declare enum LogLevel {
|
|
2
|
-
Security = 999,
|
|
3
|
-
Fatal = 6,
|
|
4
|
-
Error = 5,
|
|
5
|
-
Warn = 4,
|
|
6
|
-
Success = 3,
|
|
7
|
-
Info = 2,
|
|
8
|
-
Debug = 1,
|
|
9
|
-
Trace = 0
|
|
10
|
-
}
|
|
11
|
-
export declare const StrToLogLevel: {
|
|
12
|
-
trace: LogLevel;
|
|
13
|
-
debug: LogLevel;
|
|
14
|
-
info: LogLevel;
|
|
15
|
-
success: LogLevel;
|
|
16
|
-
warn: LogLevel;
|
|
17
|
-
error: LogLevel;
|
|
18
|
-
fatal: LogLevel;
|
|
19
|
-
security: LogLevel;
|
|
20
|
-
};
|
|
21
|
-
export declare const LogLevelStrings: {
|
|
22
|
-
1: string;
|
|
23
|
-
5: string;
|
|
24
|
-
6: string;
|
|
25
|
-
2: string;
|
|
26
|
-
999: string;
|
|
27
|
-
3: string;
|
|
28
|
-
0: string;
|
|
29
|
-
4: string;
|
|
30
|
-
};
|
|
31
|
-
export declare abstract class LogVariable {
|
|
32
|
-
abstract get Name(): string;
|
|
33
|
-
abstract Value(option?: string): string;
|
|
34
|
-
}
|
|
35
|
-
export interface ILogRule {
|
|
36
|
-
name: string;
|
|
37
|
-
level: "trace" | "debug" | "info" | "warn" | "error" | "fatal" | "security" | "success";
|
|
38
|
-
target: string | string[];
|
|
39
|
-
}
|
|
40
|
-
export interface ITargetsOption {
|
|
41
|
-
name: string;
|
|
42
|
-
type: string;
|
|
43
|
-
options: ICommonTargetOptions;
|
|
44
|
-
}
|
|
45
|
-
export interface ILogOptions {
|
|
46
|
-
targets: ITargetsOption[];
|
|
47
|
-
rules: ILogRule[];
|
|
48
|
-
variables: Record<string, unknown>;
|
|
49
|
-
}
|
|
50
|
-
export interface ICommonTargetOptions {
|
|
51
|
-
/**
|
|
52
|
-
* Message layout. You can use variables
|
|
53
|
-
*
|
|
54
|
-
* Default message layout is: datetime level message (logger)
|
|
55
|
-
*/
|
|
56
|
-
layout: string;
|
|
57
|
-
/**
|
|
58
|
-
* Target name
|
|
59
|
-
*/
|
|
60
|
-
name: string;
|
|
61
|
-
/**
|
|
62
|
-
* Target type
|
|
63
|
-
*/
|
|
64
|
-
type: string;
|
|
65
|
-
/**
|
|
66
|
-
* Is logger enabled
|
|
67
|
-
*/
|
|
68
|
-
enabled: boolean;
|
|
69
|
-
}
|
|
70
|
-
export interface IColoredConsoleTargetOptions extends ICommonTargetOptions {
|
|
71
|
-
/**
|
|
72
|
-
* Color theme for console message. Best leave it for default.
|
|
73
|
-
*/
|
|
74
|
-
theme: {
|
|
75
|
-
security: string | string[];
|
|
76
|
-
fatal: string | string[];
|
|
77
|
-
error: string | string[];
|
|
78
|
-
warn: string | string[];
|
|
79
|
-
success: string | string[];
|
|
80
|
-
info: string | string[];
|
|
81
|
-
debug: string | string[];
|
|
82
|
-
trace: string | string[];
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
export interface IFileTargetOptions extends ICommonTargetOptions {
|
|
86
|
-
options: {
|
|
87
|
-
/**
|
|
88
|
-
* path whre log is stored. It is allowed to use variables to create path eg. date / time etc.
|
|
89
|
-
*/
|
|
90
|
-
path: string;
|
|
91
|
-
/**
|
|
92
|
-
* Archive path for logs eg. when size is exceeded. Is is allowed to use variables eg. date / time etc.
|
|
93
|
-
*
|
|
94
|
-
* Default is none. When not set archive files are stored in same folder as logs.
|
|
95
|
-
*/
|
|
96
|
-
archivePath: string;
|
|
97
|
-
/**
|
|
98
|
-
* Maximum log file size, if exceeded it is moved to archive, and new log file is created
|
|
99
|
-
*
|
|
100
|
-
* Default is 1mb
|
|
101
|
-
*/
|
|
102
|
-
maxSize: number;
|
|
103
|
-
/**
|
|
104
|
-
* Should compress log file when moved to archive
|
|
105
|
-
*
|
|
106
|
-
* Default is false
|
|
107
|
-
*/
|
|
108
|
-
compress: boolean;
|
|
109
|
-
/**
|
|
110
|
-
* Should rotate log file eg. new file every new day.
|
|
111
|
-
* You should use cron like definition eg. at 1am every day: 0 1 * * *
|
|
112
|
-
* When rotate event occurs, old file is moved to archive, and new one is created
|
|
113
|
-
*
|
|
114
|
-
* Default is not set
|
|
115
|
-
*/
|
|
116
|
-
rotate: string;
|
|
117
|
-
/**
|
|
118
|
-
* How mutch archive files should be preserved before deletion. Default is 0
|
|
119
|
-
* Eg. to store max 5 archive files, set it to 5. Oldest by modification time are deleted.
|
|
120
|
-
*/
|
|
121
|
-
maxArchiveFiles: number;
|
|
122
|
-
/**
|
|
123
|
-
* Buffer size for incoming log messages. Messages are stored in buffer before write to file.
|
|
124
|
-
*
|
|
125
|
-
* Default is 8kb
|
|
126
|
-
*/
|
|
127
|
-
bufferSize: number;
|
|
128
|
-
/**
|
|
129
|
-
* Time in ms after whitch flush will be forced. If set to 0 feature is disabled ( any data hangin in temp buffer will not be saved before it reaches bufferSize)
|
|
130
|
-
* Default time is 10s.
|
|
131
|
-
*/
|
|
132
|
-
flushTimeout: number;
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
export interface ILogStaticVariables {
|
|
136
|
-
error: Error | undefined;
|
|
137
|
-
level: string;
|
|
138
|
-
logger: string;
|
|
139
|
-
message: string;
|
|
140
|
-
}
|
|
141
|
-
export interface ILogVariable {
|
|
142
|
-
[key: string]: unknown | (() => unknown);
|
|
143
|
-
}
|
|
144
|
-
export interface ILogEntry {
|
|
145
|
-
Level: LogLevel;
|
|
146
|
-
Variables: LogVariables;
|
|
147
|
-
}
|
|
148
|
-
export interface ILog {
|
|
149
|
-
trace(message: string, ...args: any[]): void;
|
|
150
|
-
trace(err: Error, message: string, ...args: any[]): void;
|
|
151
|
-
trace(err: Error | string, message: string | any[], ...args: any[]): void;
|
|
152
|
-
debug(message: string, ...args: any[]): void;
|
|
153
|
-
debug(err: Error, message: string, ...args: any[]): void;
|
|
154
|
-
debug(err: Error | string, message: string | any[], ...args: any[]): void;
|
|
155
|
-
info(message: string, ...args: any[]): void;
|
|
156
|
-
info(err: Error, message: string, ...args: any[]): void;
|
|
157
|
-
info(err: Error | string, message: string | any[], ...args: any[]): void;
|
|
158
|
-
warn(message: string, ...args: any[]): void;
|
|
159
|
-
warn(err: Error, message: string, ...args: any[]): void;
|
|
160
|
-
warn(err: Error | string, message: string | any[], ...args: any[]): void;
|
|
161
|
-
error(message: string, ...args: any[]): void;
|
|
162
|
-
error(err: Error, message: string, ...args: any[]): void;
|
|
163
|
-
error(err: Error | string, message: string | any[], ...args: any[]): void;
|
|
164
|
-
fatal(message: string, ...args: any[]): void;
|
|
165
|
-
fatal(err: Error, message: string, ...args: any[]): void;
|
|
166
|
-
fatal(err: Error | string, message: string | any[], ...args: any[]): void;
|
|
167
|
-
security(message: string, ...args: any[]): void;
|
|
168
|
-
security(err: Error, message: string, ...args: any[]): void;
|
|
169
|
-
security(err: Error | string, message: string | any[], ...args: any[]): void;
|
|
170
|
-
success(message: string, ...args: any[]): void;
|
|
171
|
-
success(err: Error, message: string, ...args: any[]): void;
|
|
172
|
-
success(err: Error | string, message: string | any[], ...args: any[]): void;
|
|
173
|
-
child(name: string, variables?: LogVariables): ILog;
|
|
174
|
-
write(entry: ILogEntry): Promise<PromiseSettledResult<void>[]>;
|
|
175
|
-
addVariable(name: string, value: unknown): void;
|
|
176
|
-
timeStart(name: string): void;
|
|
177
|
-
timeEnd(name: string): number;
|
|
178
|
-
}
|
|
179
|
-
export declare type LogVariables = ILogStaticVariables & ILogVariable;
|
|
180
|
-
export declare function createLogMessageObject(err: Error | string, message: string | any[], level: LogLevel, logger: string, variables: any, ...args: any[]): ILogEntry;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLogMessageObject = exports.LogVariable = exports.LogLevelStrings = exports.StrToLogLevel = exports.LogLevel = void 0;
|
|
4
|
-
const util = require("util");
|
|
5
|
-
var LogLevel;
|
|
6
|
-
(function (LogLevel) {
|
|
7
|
-
LogLevel[LogLevel["Security"] = 999] = "Security";
|
|
8
|
-
LogLevel[LogLevel["Fatal"] = 6] = "Fatal";
|
|
9
|
-
LogLevel[LogLevel["Error"] = 5] = "Error";
|
|
10
|
-
LogLevel[LogLevel["Warn"] = 4] = "Warn";
|
|
11
|
-
LogLevel[LogLevel["Success"] = 3] = "Success";
|
|
12
|
-
LogLevel[LogLevel["Info"] = 2] = "Info";
|
|
13
|
-
LogLevel[LogLevel["Debug"] = 1] = "Debug";
|
|
14
|
-
LogLevel[LogLevel["Trace"] = 0] = "Trace";
|
|
15
|
-
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
|
|
16
|
-
exports.StrToLogLevel = {
|
|
17
|
-
trace: LogLevel.Trace,
|
|
18
|
-
debug: LogLevel.Debug,
|
|
19
|
-
info: LogLevel.Info,
|
|
20
|
-
success: LogLevel.Success,
|
|
21
|
-
warn: LogLevel.Warn,
|
|
22
|
-
error: LogLevel.Error,
|
|
23
|
-
fatal: LogLevel.Fatal,
|
|
24
|
-
security: LogLevel.Security,
|
|
25
|
-
};
|
|
26
|
-
exports.LogLevelStrings = {
|
|
27
|
-
[LogLevel.Debug]: "debug",
|
|
28
|
-
[LogLevel.Error]: "error",
|
|
29
|
-
[LogLevel.Fatal]: "fatal",
|
|
30
|
-
[LogLevel.Info]: "info",
|
|
31
|
-
[LogLevel.Security]: "security",
|
|
32
|
-
[LogLevel.Success]: "success",
|
|
33
|
-
[LogLevel.Trace]: "trace",
|
|
34
|
-
[LogLevel.Warn]: "warn",
|
|
35
|
-
};
|
|
36
|
-
class LogVariable {
|
|
37
|
-
}
|
|
38
|
-
exports.LogVariable = LogVariable;
|
|
39
|
-
function createLogMessageObject(err, message, level, logger, variables, ...args) {
|
|
40
|
-
const sMsg = err instanceof Error ? message : err;
|
|
41
|
-
const tMsg = args.length !== 0 ? util.format(sMsg, ...args) : sMsg;
|
|
42
|
-
const lName = logger !== null && logger !== void 0 ? logger : message;
|
|
43
|
-
return {
|
|
44
|
-
Level: level,
|
|
45
|
-
Variables: Object.assign({ error: err instanceof Error ? err : undefined, level: exports.LogLevelStrings[`${level}`].toUpperCase(), logger: lName, message: tMsg }, variables),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
exports.createLogMessageObject = createLogMessageObject;
|
|
49
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../log-common/src/index.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAE7B,IAAY,QAgBX;AAhBD,WAAY,QAAQ;IAClB,iDAAc,CAAA;IAEd,yCAAS,CAAA;IAET,yCAAS,CAAA;IAET,uCAAQ,CAAA;IAER,6CAAW,CAAA;IAEX,uCAAQ,CAAA;IAER,yCAAS,CAAA;IAET,yCAAS,CAAA;AACX,CAAC,EAhBW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAgBnB;AAEY,QAAA,aAAa,GAAG;IAC3B,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;IACzB,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;CAC5B,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU;IAC/B,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS;IAC7B,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;CACxB,CAAC;AAEF,MAAsB,WAAW;CAGhC;AAHD,kCAGC;AAmLD,SAAgB,sBAAsB,CAAC,GAAmB,EAAE,OAAuB,EAAE,KAAe,EAAE,MAAc,EAAE,SAAc,EAAE,GAAG,IAAW;IAClJ,MAAM,IAAI,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAE,OAAkB,CAAC,CAAC,CAAC,GAAG,CAAC;IAC9D,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,MAAM,KAAK,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,OAAO,CAAC;IAEhC,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,SAAS,kBACP,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAC7C,KAAK,EAAE,uBAAe,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,EAChD,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,IAAI,IACV,SAAS,CACb;KACF,CAAC;AACJ,CAAC;AAfD,wDAeC"}
|