itrm-tools 1.0.44 → 1.0.46
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/api/APIRequest.d.ts +67 -67
- package/dist/api/APIRequest.js +145 -145
- package/dist/api/APIRequest.js.map +1 -1
- package/dist/api/APIRequestBuilder.d.ts +20 -20
- package/dist/api/APIRequestBuilder.js +14 -14
- package/dist/api/APIRouter.d.ts +11 -11
- package/dist/api/APIRouter.js +21 -21
- package/dist/api/APIService.d.ts +42 -42
- package/dist/api/APIService.js +108 -108
- package/dist/api/APIService.js.map +1 -1
- package/dist/api/ExpressConfiguration.d.ts +4 -4
- package/dist/api/ExpressConfiguration.js +2 -2
- package/dist/api/HttpsAPIService.d.ts +10 -10
- package/dist/api/HttpsAPIService.js +47 -47
- package/dist/api/channel/ServerSentEventsManager.d.ts +8 -8
- package/dist/api/channel/ServerSentEventsManager.js +25 -25
- package/dist/api/check/APIChecker.d.ts +26 -26
- package/dist/api/check/APIChecker.js +40 -40
- package/dist/api/check/CheckableAPIRequest.d.ts +9 -9
- package/dist/api/check/CheckableAPIRequest.js +44 -44
- package/dist/api/check/CheckableAPIRouter.d.ts +11 -11
- package/dist/api/check/CheckableAPIRouter.js +48 -48
- package/dist/api/check/request/CheckableDeleteRequest.d.ts +8 -8
- package/dist/api/check/request/CheckableDeleteRequest.js +17 -17
- package/dist/api/check/request/CheckableFileUploadingPostRequest.d.ts +11 -11
- package/dist/api/check/request/CheckableFileUploadingPostRequest.js +22 -22
- package/dist/api/check/request/CheckableGetRequest.d.ts +8 -8
- package/dist/api/check/request/CheckableGetRequest.js +17 -17
- package/dist/api/check/request/CheckablePostRequest.d.ts +8 -8
- package/dist/api/check/request/CheckablePostRequest.js +17 -17
- package/dist/api/check/request/CheckablePutRequest.d.ts +8 -8
- package/dist/api/check/request/CheckablePutRequest.js +17 -17
- package/dist/api/check/route/SimpleCheckableAPIRouter.d.ts +7 -7
- package/dist/api/check/route/SimpleCheckableAPIRouter.js +25 -25
- package/dist/api/express/ExpressFileUploadingConfiguration.d.ts +6 -6
- package/dist/api/express/ExpressFileUploadingConfiguration.js +27 -27
- package/dist/api/express/ExpressStandardConfiguration.d.ts +11 -11
- package/dist/api/express/ExpressStandardConfiguration.js +29 -29
- package/dist/api/request/DeleteRequest.d.ts +7 -7
- package/dist/api/request/DeleteRequest.js +16 -16
- package/dist/api/request/GetRequest.d.ts +7 -7
- package/dist/api/request/GetRequest.js +16 -16
- package/dist/api/request/PostRequest.d.ts +7 -7
- package/dist/api/request/PostRequest.js +16 -16
- package/dist/api/request/PutRequest.d.ts +7 -7
- package/dist/api/request/PutRequest.js +16 -16
- package/dist/api/request/RequestAxiosCall.d.ts +7 -7
- package/dist/api/request/RequestAxiosCall.js +57 -57
- package/dist/api/request/docs/DocumentationModels.d.ts +47 -47
- package/dist/api/request/docs/DocumentationModels.js +114 -114
- package/dist/api/request/docs/DocumentationRequest.d.ts +12 -12
- package/dist/api/request/docs/DocumentationRequest.js +126 -126
- package/dist/api/route/SimpleAPIRouter.d.ts +6 -6
- package/dist/api/route/SimpleAPIRouter.js +24 -24
- package/dist/database/mongoose/MongooseModelManager.d.ts +47 -43
- package/dist/database/mongoose/MongooseModelManager.js +65 -65
- package/dist/database/mongoose/MongooseModelManager.js.map +1 -1
- package/dist/database/redis/RedisConnection.d.ts +7 -7
- package/dist/database/redis/RedisConnection.js +17 -17
- package/dist/database/redis/RedisModelManager.d.ts +10 -10
- package/dist/database/redis/RedisModelManager.js +17 -17
- package/dist/database/sequelize/SequelizeConnection.d.ts +16 -16
- package/dist/database/sequelize/SequelizeConnection.js +22 -22
- package/dist/database/sequelize/SequelizeModelManager.d.ts +26 -26
- package/dist/database/sequelize/SequelizeModelManager.js +58 -58
- package/dist/index.d.ts +31 -31
- package/dist/index.js +67 -67
- package/dist/log/Logger.d.ts +7 -7
- package/dist/log/Logger.js +28 -28
- package/dist/log/LoggerManager.d.ts +7 -7
- package/dist/log/LoggerManager.js +63 -63
- package/dist/log/LoggerWebSocket.d.ts +10 -10
- package/dist/log/LoggerWebSocket.js +15 -15
- package/dist/web3/Coin.d.ts +18 -18
- package/dist/web3/Coin.js +22 -22
- package/dist/web3/Coin.js.map +1 -1
- package/dist/web3/coingecko/CoingeckoPriceFinder.d.ts +10 -10
- package/dist/web3/coingecko/CoingeckoPriceFinder.js +88 -88
- package/package.json +25 -25
|
@@ -1,43 +1,47 @@
|
|
|
1
|
-
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
-
/// <reference types="mongoose/types/callback" />
|
|
3
|
-
/// <reference types="mongoose/types/collection" />
|
|
4
|
-
/// <reference types="mongoose/types/connection" />
|
|
5
|
-
/// <reference types="mongoose/types/cursor" />
|
|
6
|
-
/// <reference types="mongoose/types/document" />
|
|
7
|
-
/// <reference types="mongoose/types/error" />
|
|
8
|
-
/// <reference types="mongoose/types/expressions" />
|
|
9
|
-
/// <reference types="mongoose/types/helpers" />
|
|
10
|
-
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
-
/// <reference types="mongoose/types/indexes" />
|
|
12
|
-
/// <reference types="mongoose/types/models" />
|
|
13
|
-
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
-
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
-
/// <reference types="mongoose/types/populate" />
|
|
16
|
-
/// <reference types="mongoose/types/query" />
|
|
17
|
-
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
-
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
-
/// <reference types="mongoose/types/session" />
|
|
20
|
-
/// <reference types="mongoose/types/types" />
|
|
21
|
-
/// <reference types="mongoose/types/utility" />
|
|
22
|
-
/// <reference types="mongoose/types/validation" />
|
|
23
|
-
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
-
import { DefaultSchemaOptions, FilterQuery, Model, MongooseBulkWriteOptions, ObtainDocumentType, SchemaDefinition, SchemaDefinitionType, SchemaOptions, UpdateQuery, UpdateWithAggregationPipeline } from "mongoose";
|
|
26
|
-
export declare class MongooseModelManager<S> {
|
|
27
|
-
collection: string;
|
|
28
|
-
protected model: Model<S>;
|
|
29
|
-
constructor(collection: string, definition: ObtainDocumentType<any, S, DefaultSchemaOptions> | SchemaDefinition<SchemaDefinitionType<S>>, options?:
|
|
30
|
-
create(datum: S): Promise<S
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
_id:
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { DefaultSchemaOptions, FilterQuery, Model, MongooseBulkWriteOptions, ObtainDocumentType, ResolveSchemaOptions, SchemaDefinition, SchemaDefinitionType, SchemaOptions, UpdateQuery, UpdateWithAggregationPipeline } from "mongoose";
|
|
26
|
+
export declare class MongooseModelManager<S> {
|
|
27
|
+
collection: string;
|
|
28
|
+
protected model: Model<S>;
|
|
29
|
+
constructor(collection: string, definition: ObtainDocumentType<any, S, DefaultSchemaOptions> | SchemaDefinition<SchemaDefinitionType<S>>, options?: SchemaOptions | ResolveSchemaOptions<any>);
|
|
30
|
+
create(datum: S): Promise<import("mongoose").Document<unknown, {}, S> & {
|
|
31
|
+
_id?: unknown;
|
|
32
|
+
} & Required<{
|
|
33
|
+
_id: unknown;
|
|
34
|
+
}>>;
|
|
35
|
+
createMany(data: S[]): Promise<any>;
|
|
36
|
+
exists(filter: FilterQuery<S>): import("mongoose").Query<{
|
|
37
|
+
_id: import("mongoose").InferId<S>;
|
|
38
|
+
} | null, import("mongoose").IfAny<S, any, import("mongoose").Document<unknown, {}, S> & import("mongoose").Require_id<S>>, {}, S, "findOne">;
|
|
39
|
+
find(filter: FilterQuery<S>): import("mongoose").Query<import("mongoose").IfAny<S, any, import("mongoose").Document<unknown, {}, S> & import("mongoose").Require_id<S>> | null, import("mongoose").IfAny<S, any, import("mongoose").Document<unknown, {}, S> & import("mongoose").Require_id<S>>, {}, S, "findOne">;
|
|
40
|
+
findMany(filter: FilterQuery<S>): import("mongoose").Query<import("mongoose").IfAny<S, any, import("mongoose").Document<unknown, {}, S> & import("mongoose").Require_id<S>>[], import("mongoose").IfAny<S, any, import("mongoose").Document<unknown, {}, S> & import("mongoose").Require_id<S>>, {}, S, "find">;
|
|
41
|
+
batch(filter: FilterQuery<S>, from: number, size: number): import("mongoose").Query<import("mongoose").IfAny<S, any, import("mongoose").Document<unknown, {}, S> & import("mongoose").Require_id<S>>[], import("mongoose").IfAny<S, any, import("mongoose").Document<unknown, {}, S> & import("mongoose").Require_id<S>>, {}, S, "find">;
|
|
42
|
+
updateOne(filter: FilterQuery<S>, data: UpdateWithAggregationPipeline | UpdateQuery<S>): any;
|
|
43
|
+
bulkWrite(writes: any[], options?: MongooseBulkWriteOptions): Promise<any>;
|
|
44
|
+
delete(filter: FilterQuery<S>): any;
|
|
45
|
+
deleteMany(filter: FilterQuery<S>): any;
|
|
46
|
+
countDocuments(filter: FilterQuery<S>): import("mongoose").Query<number, import("mongoose").IfAny<S, any, import("mongoose").Document<unknown, {}, S> & import("mongoose").Require_id<S>>, {}, S, "countDocuments">;
|
|
47
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.MongooseModelManager = void 0;
|
|
13
|
-
const mongoose_1 = require("mongoose");
|
|
14
|
-
class MongooseModelManager {
|
|
15
|
-
constructor(collection, definition, options) {
|
|
16
|
-
this.collection = collection;
|
|
17
|
-
let schema = new mongoose_1.Schema(definition, options);
|
|
18
|
-
this.model = (0, mongoose_1.model)(collection, schema);
|
|
19
|
-
}
|
|
20
|
-
create(datum) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
let token = yield new this.model(datum);
|
|
23
|
-
return token.save();
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
createMany(data) {
|
|
27
|
-
let writes = [];
|
|
28
|
-
for (let datum of data) {
|
|
29
|
-
writes.push({
|
|
30
|
-
insertOne: {
|
|
31
|
-
document: datum
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
return this.model.bulkWrite(writes);
|
|
36
|
-
}
|
|
37
|
-
exists(filter) {
|
|
38
|
-
return this.model.exists(filter);
|
|
39
|
-
}
|
|
40
|
-
find(filter) {
|
|
41
|
-
return this.model.findOne(filter);
|
|
42
|
-
}
|
|
43
|
-
findMany(filter) {
|
|
44
|
-
return this.model.find(filter);
|
|
45
|
-
}
|
|
46
|
-
batch(filter, from, size) {
|
|
47
|
-
return this.model.find(filter).skip(from).limit(size);
|
|
48
|
-
}
|
|
49
|
-
updateOne(filter, data) {
|
|
50
|
-
return this.model.updateOne(filter, data);
|
|
51
|
-
}
|
|
52
|
-
bulkWrite(writes, options) {
|
|
53
|
-
return this.model.bulkWrite(writes, options);
|
|
54
|
-
}
|
|
55
|
-
delete(filter) {
|
|
56
|
-
return this.model.deleteOne(filter);
|
|
57
|
-
}
|
|
58
|
-
deleteMany(filter) {
|
|
59
|
-
return this.model.deleteMany(filter);
|
|
60
|
-
}
|
|
61
|
-
countDocuments(filter) {
|
|
62
|
-
return this.model.countDocuments(filter);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.MongooseModelManager = MongooseModelManager;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MongooseModelManager = void 0;
|
|
13
|
+
const mongoose_1 = require("mongoose");
|
|
14
|
+
class MongooseModelManager {
|
|
15
|
+
constructor(collection, definition, options) {
|
|
16
|
+
this.collection = collection;
|
|
17
|
+
let schema = new mongoose_1.Schema(definition, options);
|
|
18
|
+
this.model = (0, mongoose_1.model)(collection, schema);
|
|
19
|
+
}
|
|
20
|
+
create(datum) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
let token = yield new this.model(datum);
|
|
23
|
+
return token.save();
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
createMany(data) {
|
|
27
|
+
let writes = [];
|
|
28
|
+
for (let datum of data) {
|
|
29
|
+
writes.push({
|
|
30
|
+
insertOne: {
|
|
31
|
+
document: datum
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return this.model.bulkWrite(writes);
|
|
36
|
+
}
|
|
37
|
+
exists(filter) {
|
|
38
|
+
return this.model.exists(filter);
|
|
39
|
+
}
|
|
40
|
+
find(filter) {
|
|
41
|
+
return this.model.findOne(filter);
|
|
42
|
+
}
|
|
43
|
+
findMany(filter) {
|
|
44
|
+
return this.model.find(filter);
|
|
45
|
+
}
|
|
46
|
+
batch(filter, from, size) {
|
|
47
|
+
return this.model.find(filter).skip(from).limit(size);
|
|
48
|
+
}
|
|
49
|
+
updateOne(filter, data) {
|
|
50
|
+
return this.model.updateOne(filter, data);
|
|
51
|
+
}
|
|
52
|
+
bulkWrite(writes, options) {
|
|
53
|
+
return this.model.bulkWrite(writes, options);
|
|
54
|
+
}
|
|
55
|
+
delete(filter) {
|
|
56
|
+
return this.model.deleteOne(filter);
|
|
57
|
+
}
|
|
58
|
+
deleteMany(filter) {
|
|
59
|
+
return this.model.deleteMany(filter);
|
|
60
|
+
}
|
|
61
|
+
countDocuments(filter) {
|
|
62
|
+
return this.model.countDocuments(filter);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.MongooseModelManager = MongooseModelManager;
|
|
66
66
|
//# sourceMappingURL=MongooseModelManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MongooseModelManager.js","sourceRoot":"","sources":["../../../src/database/mongoose/MongooseModelManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"MongooseModelManager.js","sourceRoot":"","sources":["../../../src/database/mongoose/MongooseModelManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAA0P;AAE1P,MAAa,oBAAoB;IAI7B,YAAY,UAAkB,EAAE,UAAwG,EAAE,OAAmD;QACzL,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,MAAM,GAAG,IAAI,iBAAM,CAAI,UAAU,EAAE,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,KAAK,GAAG,IAAA,gBAAK,EAAI,UAAU,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAEY,MAAM,CAAC,KAAQ;;YACxB,IAAI,KAAK,GAAG,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACxC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;KAAA;IAEM,UAAU,CAAC,IAAS;QACvB,IAAI,MAAM,GAAU,EAAE,CAAC;QACvB,KAAK,IAAI,KAAK,IAAI,IAAI,EAAE;YACpB,MAAM,CAAC,IAAI,CAAC;gBACR,SAAS,EAAE;oBACP,QAAQ,EAAE,KAAK;iBAClB;aACJ,CAAC,CAAC;SACN;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAEM,MAAM,CAAC,MAAsB;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAEM,IAAI,CAAC,MAAsB;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAEM,QAAQ,CAAC,MAAsB;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAEM,KAAK,CAAC,MAAsB,EAAE,IAAY,EAAE,IAAY;QAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEM,SAAS,CAAC,MAAsB,EAAE,IAAoD;QACzF,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;IAEM,SAAS,CAAC,MAAa,EAAE,OAAkC;QAC9D,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAEM,MAAM,CAAC,MAAsB;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAEM,UAAU,CAAC,MAAsB;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAEM,cAAc,CAAC,MAAsB;QACxC,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;CACJ;AA9DD,oDA8DC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RedisClientOptions } from 'redis';
|
|
2
|
-
export declare class RedisConnection {
|
|
3
|
-
private client;
|
|
4
|
-
constructor(clientOptions?: RedisClientOptions);
|
|
5
|
-
connect(): Promise<
|
|
6
|
-
disconnect(): Promise<void>;
|
|
7
|
-
}
|
|
1
|
+
import { RedisClientOptions, RedisFunctions, RedisModules, RedisScripts } from 'redis';
|
|
2
|
+
export declare class RedisConnection {
|
|
3
|
+
private client;
|
|
4
|
+
constructor(clientOptions?: RedisClientOptions);
|
|
5
|
+
connect(): Promise<import("@redis/client").RedisClientType<RedisModules, RedisFunctions, RedisScripts>>;
|
|
6
|
+
disconnect(): Promise<void>;
|
|
7
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RedisConnection = void 0;
|
|
4
|
-
const redis_1 = require("redis");
|
|
5
|
-
class RedisConnection {
|
|
6
|
-
constructor(clientOptions) {
|
|
7
|
-
this.client = (0, redis_1.createClient)();
|
|
8
|
-
}
|
|
9
|
-
connect() {
|
|
10
|
-
this.client.on("error", (error) => { throw error; });
|
|
11
|
-
return this.client.connect();
|
|
12
|
-
}
|
|
13
|
-
disconnect() {
|
|
14
|
-
return this.client.disconnect();
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.RedisConnection = RedisConnection;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisConnection = void 0;
|
|
4
|
+
const redis_1 = require("redis");
|
|
5
|
+
class RedisConnection {
|
|
6
|
+
constructor(clientOptions) {
|
|
7
|
+
this.client = (0, redis_1.createClient)();
|
|
8
|
+
}
|
|
9
|
+
connect() {
|
|
10
|
+
this.client.on("error", (error) => { throw error; });
|
|
11
|
+
return this.client.connect();
|
|
12
|
+
}
|
|
13
|
+
disconnect() {
|
|
14
|
+
return this.client.disconnect();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.RedisConnection = RedisConnection;
|
|
18
18
|
//# sourceMappingURL=RedisConnection.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { RedisClientType, RedisFunctions, RedisModules, RedisScripts } from 'redis';
|
|
2
|
-
export declare interface RedisItem<D> {
|
|
3
|
-
key: string;
|
|
4
|
-
data: D;
|
|
5
|
-
}
|
|
6
|
-
export declare class RedisModelManager<D> {
|
|
7
|
-
private client;
|
|
8
|
-
constructor(client: RedisClientType<RedisModules, RedisFunctions, RedisScripts>);
|
|
9
|
-
create(datum: D): void;
|
|
10
|
-
}
|
|
1
|
+
import { RedisClientType, RedisFunctions, RedisModules, RedisScripts } from 'redis';
|
|
2
|
+
export declare interface RedisItem<D> {
|
|
3
|
+
key: string;
|
|
4
|
+
data: D;
|
|
5
|
+
}
|
|
6
|
+
export declare class RedisModelManager<D> {
|
|
7
|
+
private client;
|
|
8
|
+
constructor(client: RedisClientType<RedisModules, RedisFunctions, RedisScripts>);
|
|
9
|
+
create(datum: D): void;
|
|
10
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RedisModelManager = void 0;
|
|
4
|
-
class RedisModelManager {
|
|
5
|
-
constructor(client) {
|
|
6
|
-
this.client = client;
|
|
7
|
-
}
|
|
8
|
-
create(datum) {
|
|
9
|
-
//this.client.set("key", {});
|
|
10
|
-
/*this.client.set();
|
|
11
|
-
this.client.get();
|
|
12
|
-
this.client.del();*/
|
|
13
|
-
//set: <CommandOptions<ClientCommandOptions>>(...args: [key: RedisCommandArgument, value: number
|
|
14
|
-
//| RedisCommandArgument, options?: SetOptions | undefined] | [options: ...]) => Promise<...>
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.RedisModelManager = RedisModelManager;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisModelManager = void 0;
|
|
4
|
+
class RedisModelManager {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
create(datum) {
|
|
9
|
+
//this.client.set("key", {});
|
|
10
|
+
/*this.client.set();
|
|
11
|
+
this.client.get();
|
|
12
|
+
this.client.del();*/
|
|
13
|
+
//set: <CommandOptions<ClientCommandOptions>>(...args: [key: RedisCommandArgument, value: number
|
|
14
|
+
//| RedisCommandArgument, options?: SetOptions | undefined] | [options: ...]) => Promise<...>
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.RedisModelManager = RedisModelManager;
|
|
18
18
|
//# sourceMappingURL=RedisModelManager.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ModelAttributes, ModelOptions, Options, Sequelize } from "@sequelize/core";
|
|
2
|
-
export declare interface SequelizeConnectionConfig {
|
|
3
|
-
host: string;
|
|
4
|
-
username: string;
|
|
5
|
-
password: string;
|
|
6
|
-
database: string;
|
|
7
|
-
engine: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class SequelizeConnection {
|
|
10
|
-
private connection;
|
|
11
|
-
constructor(config: Options);
|
|
12
|
-
connect(): Promise<void>;
|
|
13
|
-
define(name: string, attributes: ModelAttributes, options?: ModelOptions): import("@sequelize/core").ModelStatic<import("@sequelize/core").Model<any, any>>;
|
|
14
|
-
sync(syncOptions?: any): Promise<Sequelize>;
|
|
15
|
-
disconnect(): Promise<void>;
|
|
16
|
-
}
|
|
1
|
+
import { ModelAttributes, ModelOptions, Options, Sequelize } from "@sequelize/core";
|
|
2
|
+
export declare interface SequelizeConnectionConfig {
|
|
3
|
+
host: string;
|
|
4
|
+
username: string;
|
|
5
|
+
password: string;
|
|
6
|
+
database: string;
|
|
7
|
+
engine: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class SequelizeConnection {
|
|
10
|
+
private connection;
|
|
11
|
+
constructor(config: Options);
|
|
12
|
+
connect(): Promise<void>;
|
|
13
|
+
define(name: string, attributes: ModelAttributes, options?: ModelOptions): import("@sequelize/core").ModelStatic<import("@sequelize/core").Model<any, any>>;
|
|
14
|
+
sync(syncOptions?: any): Promise<Sequelize>;
|
|
15
|
+
disconnect(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SequelizeConnection = void 0;
|
|
4
|
-
const core_1 = require("@sequelize/core");
|
|
5
|
-
class SequelizeConnection {
|
|
6
|
-
constructor(config) {
|
|
7
|
-
this.connection = new core_1.Sequelize(config);
|
|
8
|
-
}
|
|
9
|
-
connect() {
|
|
10
|
-
return this.connection.authenticate();
|
|
11
|
-
}
|
|
12
|
-
define(name, attributes, options) {
|
|
13
|
-
return this.connection.define(name, attributes, options);
|
|
14
|
-
}
|
|
15
|
-
sync(syncOptions) {
|
|
16
|
-
return this.connection.sync(syncOptions);
|
|
17
|
-
}
|
|
18
|
-
disconnect() {
|
|
19
|
-
return this.connection.close();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.SequelizeConnection = SequelizeConnection;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SequelizeConnection = void 0;
|
|
4
|
+
const core_1 = require("@sequelize/core");
|
|
5
|
+
class SequelizeConnection {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.connection = new core_1.Sequelize(config);
|
|
8
|
+
}
|
|
9
|
+
connect() {
|
|
10
|
+
return this.connection.authenticate();
|
|
11
|
+
}
|
|
12
|
+
define(name, attributes, options) {
|
|
13
|
+
return this.connection.define(name, attributes, options);
|
|
14
|
+
}
|
|
15
|
+
sync(syncOptions) {
|
|
16
|
+
return this.connection.sync(syncOptions);
|
|
17
|
+
}
|
|
18
|
+
disconnect() {
|
|
19
|
+
return this.connection.close();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.SequelizeConnection = SequelizeConnection;
|
|
23
23
|
//# sourceMappingURL=SequelizeConnection.js.map
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { BelongsToManyOptions, BelongsToOptions, DestroyOptions, FindOptions, HasManyOptions, HasOneOptions, ModelAttributes, ModelOptions, UpdateOptions } from "@sequelize/core";
|
|
2
|
-
import { SequelizeConnection } from "./SequelizeConnection";
|
|
3
|
-
export declare interface ModelDefinition {
|
|
4
|
-
name: string;
|
|
5
|
-
attributes: ModelAttributes;
|
|
6
|
-
options?: ModelOptions;
|
|
7
|
-
}
|
|
8
|
-
export declare class SequelizeModelManager<S> {
|
|
9
|
-
private definition;
|
|
10
|
-
model: any;
|
|
11
|
-
constructor(definition: ModelDefinition);
|
|
12
|
-
define(connection: SequelizeConnection): Promise<import("@sequelize/core").ModelStatic<import("@sequelize/core").Model<any, any>>>;
|
|
13
|
-
sync(syncOptions?: any): any;
|
|
14
|
-
create(values: S): any;
|
|
15
|
-
bulkCreate(values: S[]): any;
|
|
16
|
-
findAll(options?: FindOptions): any;
|
|
17
|
-
findAndCountAll(options?: FindOptions): any;
|
|
18
|
-
update(values: {
|
|
19
|
-
[x: string]: any;
|
|
20
|
-
}, options: UpdateOptions): any;
|
|
21
|
-
destroy(options?: DestroyOptions): any;
|
|
22
|
-
hasOne(manager: SequelizeModelManager<any>, options?: HasOneOptions<string, string>): any;
|
|
23
|
-
hasMany(manager: SequelizeModelManager<any>, options?: HasManyOptions<string, string>): any;
|
|
24
|
-
belongsTo(manager: SequelizeModelManager<any>, options?: BelongsToOptions<string, string>): any;
|
|
25
|
-
belongsToMany(manager: SequelizeModelManager<any>, options?: BelongsToManyOptions): any;
|
|
26
|
-
}
|
|
1
|
+
import { BelongsToManyOptions, BelongsToOptions, DestroyOptions, FindOptions, HasManyOptions, HasOneOptions, ModelAttributes, ModelOptions, UpdateOptions } from "@sequelize/core";
|
|
2
|
+
import { SequelizeConnection } from "./SequelizeConnection";
|
|
3
|
+
export declare interface ModelDefinition {
|
|
4
|
+
name: string;
|
|
5
|
+
attributes: ModelAttributes;
|
|
6
|
+
options?: ModelOptions;
|
|
7
|
+
}
|
|
8
|
+
export declare class SequelizeModelManager<S> {
|
|
9
|
+
private definition;
|
|
10
|
+
model: any;
|
|
11
|
+
constructor(definition: ModelDefinition);
|
|
12
|
+
define(connection: SequelizeConnection): Promise<import("@sequelize/core").ModelStatic<import("@sequelize/core").Model<any, any>>>;
|
|
13
|
+
sync(syncOptions?: any): any;
|
|
14
|
+
create(values: S): any;
|
|
15
|
+
bulkCreate(values: S[]): any;
|
|
16
|
+
findAll(options?: FindOptions): any;
|
|
17
|
+
findAndCountAll(options?: FindOptions): any;
|
|
18
|
+
update(values: {
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}, options: UpdateOptions): any;
|
|
21
|
+
destroy(options?: DestroyOptions): any;
|
|
22
|
+
hasOne(manager: SequelizeModelManager<any>, options?: HasOneOptions<string, string>): any;
|
|
23
|
+
hasMany(manager: SequelizeModelManager<any>, options?: HasManyOptions<string, string>): any;
|
|
24
|
+
belongsTo(manager: SequelizeModelManager<any>, options?: BelongsToOptions<string, string>): any;
|
|
25
|
+
belongsToMany(manager: SequelizeModelManager<any>, options?: BelongsToManyOptions): any;
|
|
26
|
+
}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SequelizeModelManager = void 0;
|
|
13
|
-
class SequelizeModelManager {
|
|
14
|
-
constructor(definition) {
|
|
15
|
-
this.definition = definition;
|
|
16
|
-
}
|
|
17
|
-
define(connection) {
|
|
18
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
let model = yield connection.define(this.definition.name, this.definition.attributes, this.definition.options);
|
|
20
|
-
this.model = model;
|
|
21
|
-
return model;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
sync(syncOptions) {
|
|
25
|
-
return this.model.sync(syncOptions);
|
|
26
|
-
}
|
|
27
|
-
create(values) {
|
|
28
|
-
return this.model.create(values);
|
|
29
|
-
}
|
|
30
|
-
bulkCreate(values) {
|
|
31
|
-
return this.model.bulkCreate(values);
|
|
32
|
-
}
|
|
33
|
-
findAll(options) {
|
|
34
|
-
return this.model.findAll(options);
|
|
35
|
-
}
|
|
36
|
-
findAndCountAll(options) {
|
|
37
|
-
return this.model.findAndCountAll(options);
|
|
38
|
-
}
|
|
39
|
-
update(values, options) {
|
|
40
|
-
return this.model.update(values, options);
|
|
41
|
-
}
|
|
42
|
-
destroy(options) {
|
|
43
|
-
return this.model.destroy(options);
|
|
44
|
-
}
|
|
45
|
-
hasOne(manager, options) {
|
|
46
|
-
return this.model.hasOne(manager.model, options);
|
|
47
|
-
}
|
|
48
|
-
hasMany(manager, options) {
|
|
49
|
-
return this.model.hasMany(manager.model, options);
|
|
50
|
-
}
|
|
51
|
-
belongsTo(manager, options) {
|
|
52
|
-
return this.model.belongsTo(manager.model, options);
|
|
53
|
-
}
|
|
54
|
-
belongsToMany(manager, options) {
|
|
55
|
-
return this.model.belongsToMany(manager.model, options);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.SequelizeModelManager = SequelizeModelManager;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SequelizeModelManager = void 0;
|
|
13
|
+
class SequelizeModelManager {
|
|
14
|
+
constructor(definition) {
|
|
15
|
+
this.definition = definition;
|
|
16
|
+
}
|
|
17
|
+
define(connection) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
let model = yield connection.define(this.definition.name, this.definition.attributes, this.definition.options);
|
|
20
|
+
this.model = model;
|
|
21
|
+
return model;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
sync(syncOptions) {
|
|
25
|
+
return this.model.sync(syncOptions);
|
|
26
|
+
}
|
|
27
|
+
create(values) {
|
|
28
|
+
return this.model.create(values);
|
|
29
|
+
}
|
|
30
|
+
bulkCreate(values) {
|
|
31
|
+
return this.model.bulkCreate(values);
|
|
32
|
+
}
|
|
33
|
+
findAll(options) {
|
|
34
|
+
return this.model.findAll(options);
|
|
35
|
+
}
|
|
36
|
+
findAndCountAll(options) {
|
|
37
|
+
return this.model.findAndCountAll(options);
|
|
38
|
+
}
|
|
39
|
+
update(values, options) {
|
|
40
|
+
return this.model.update(values, options);
|
|
41
|
+
}
|
|
42
|
+
destroy(options) {
|
|
43
|
+
return this.model.destroy(options);
|
|
44
|
+
}
|
|
45
|
+
hasOne(manager, options) {
|
|
46
|
+
return this.model.hasOne(manager.model, options);
|
|
47
|
+
}
|
|
48
|
+
hasMany(manager, options) {
|
|
49
|
+
return this.model.hasMany(manager.model, options);
|
|
50
|
+
}
|
|
51
|
+
belongsTo(manager, options) {
|
|
52
|
+
return this.model.belongsTo(manager.model, options);
|
|
53
|
+
}
|
|
54
|
+
belongsToMany(manager, options) {
|
|
55
|
+
return this.model.belongsToMany(manager.model, options);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.SequelizeModelManager = SequelizeModelManager;
|
|
59
59
|
//# sourceMappingURL=SequelizeModelManager.js.map
|