@conduitplatform/grpc-sdk 0.13.0-rc0 → 0.13.2
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/classes/ConduitModule.js +5 -1
- package/dist/classes/ConduitModule.js.map +1 -1
- package/dist/classes/ConduitParser.d.ts +1 -0
- package/dist/classes/ConduitParser.js.map +1 -1
- package/dist/classes/GrpcServer.js +10 -6
- package/dist/classes/GrpcServer.js.map +1 -1
- package/dist/classes/ManagedModule.js +21 -2
- package/dist/classes/ManagedModule.js.map +1 -1
- package/dist/classes/ModuleManager.js +4 -4
- package/dist/classes/ModuleManager.js.map +1 -1
- package/dist/classes/Routing/RoutingManager.js.map +1 -1
- package/dist/constants/enums/PlatformTypesEnum.d.ts +2 -1
- package/dist/constants/enums/PlatformTypesEnum.js +1 -0
- package/dist/constants/enums/PlatformTypesEnum.js.map +1 -1
- package/dist/helpers/RoutingJsonConstructor.js.map +1 -1
- package/dist/helpers/RoutingUtilities.js.map +1 -1
- package/dist/helpers/TypeHelpers.d.ts +7 -7
- package/dist/helpers/TypeHelpers.js.map +1 -1
- package/dist/helpers/wrapRouterFunctions.js +7 -3
- package/dist/helpers/wrapRouterFunctions.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/dist/modules/admin/index.js.map +1 -1
- package/dist/modules/config/index.js +8 -4
- package/dist/modules/config/index.js.map +1 -1
- package/dist/modules/database/index.js.map +1 -1
- package/dist/protoUtils/authentication.js +0 -8
- package/dist/protoUtils/authentication.js.map +1 -1
- package/dist/protoUtils/chat.js +0 -8
- package/dist/protoUtils/chat.js.map +1 -1
- package/dist/protoUtils/core.js +0 -8
- package/dist/protoUtils/core.js.map +1 -1
- package/dist/protoUtils/database.js +0 -8
- package/dist/protoUtils/database.js.map +1 -1
- package/dist/protoUtils/email.js +0 -8
- package/dist/protoUtils/email.js.map +1 -1
- package/dist/protoUtils/forms.js +0 -8
- package/dist/protoUtils/forms.js.map +1 -1
- package/dist/protoUtils/grpc_health_check.js +0 -8
- package/dist/protoUtils/grpc_health_check.js.map +1 -1
- package/dist/protoUtils/push-notifications.js +0 -8
- package/dist/protoUtils/push-notifications.js.map +1 -1
- package/dist/protoUtils/sms.js +0 -8
- package/dist/protoUtils/sms.js.map +1 -1
- package/dist/protoUtils/storage.js +0 -8
- package/dist/protoUtils/storage.js.map +1 -1
- package/dist/utilities/EventBus.js +2 -1
- package/dist/utilities/EventBus.js.map +1 -1
- package/dist/utilities/Logger.d.ts +13 -0
- package/dist/utilities/Logger.js +104 -0
- package/dist/utilities/Logger.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
22
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
23
|
+
if (!m) return o;
|
|
24
|
+
var i = m.call(o), r, ar = [], e;
|
|
25
|
+
try {
|
|
26
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
27
|
+
}
|
|
28
|
+
catch (error) { e = { error: error }; }
|
|
29
|
+
finally {
|
|
30
|
+
try {
|
|
31
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
32
|
+
}
|
|
33
|
+
finally { if (e) throw e.error; }
|
|
34
|
+
}
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
38
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
39
|
+
to[j] = from[i];
|
|
40
|
+
return to;
|
|
41
|
+
};
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.ConduitLogger = void 0;
|
|
44
|
+
var winston_1 = __importStar(require("winston"));
|
|
45
|
+
var lodash_1 = require("lodash");
|
|
46
|
+
var Format = winston_1.format.combine(winston_1.format.printf(function (info) {
|
|
47
|
+
// This will customize the Error Message
|
|
48
|
+
if (info.stack) {
|
|
49
|
+
return "[" + info.timestamp + "] [" + info.level.toUpperCase() + "]: " + info.message + " " + info.stack;
|
|
50
|
+
}
|
|
51
|
+
return "[" + info.timestamp + "] [" + info.level.toUpperCase() + "]: " + info.message + " " + (!lodash_1.isEmpty(info.meta)
|
|
52
|
+
? info.meta.reduce(function (message, meta) {
|
|
53
|
+
return message + " \n " + JSON.stringify(meta, null, 2);
|
|
54
|
+
}, '')
|
|
55
|
+
: '');
|
|
56
|
+
}));
|
|
57
|
+
var defaultTransport = new winston_1.default.transports.Console({
|
|
58
|
+
level: 'debug',
|
|
59
|
+
format: winston_1.format.combine(winston_1.format.prettyPrint(), winston_1.format.errors({ stack: true }), winston_1.format.timestamp({
|
|
60
|
+
format: 'YYYY-MM-DD HH:mm:ss',
|
|
61
|
+
}), Format, winston_1.format.colorize({
|
|
62
|
+
all: true,
|
|
63
|
+
})),
|
|
64
|
+
});
|
|
65
|
+
var ConduitLogger = /** @class */ (function () {
|
|
66
|
+
function ConduitLogger(transports) {
|
|
67
|
+
this._winston = winston_1.default.createLogger({
|
|
68
|
+
format: winston_1.format.combine(winston_1.format.prettyPrint(), winston_1.format.errors({ stack: true }), winston_1.format.timestamp({
|
|
69
|
+
format: 'YYYY-MM-DD HH:mm:ss',
|
|
70
|
+
}), Format),
|
|
71
|
+
transports: transports ? __spreadArray(__spreadArray([], __read(transports)), [defaultTransport]) : [defaultTransport],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
ConduitLogger.prototype.log = function (message, level, cb) {
|
|
75
|
+
if (level === void 0) { level = 'info'; }
|
|
76
|
+
return this._winston.log(level, message, cb);
|
|
77
|
+
};
|
|
78
|
+
ConduitLogger.prototype.logObject = function (object, message, level, cb) {
|
|
79
|
+
if (message === void 0) { message = ''; }
|
|
80
|
+
if (level === void 0) { level = 'info'; }
|
|
81
|
+
return this._winston.log(level, message, object, cb);
|
|
82
|
+
};
|
|
83
|
+
ConduitLogger.prototype.info = function (message, cb) {
|
|
84
|
+
return this._winston.info(message, cb);
|
|
85
|
+
};
|
|
86
|
+
ConduitLogger.prototype.warn = function (message, cb) {
|
|
87
|
+
return this._winston.warn(message, cb);
|
|
88
|
+
};
|
|
89
|
+
ConduitLogger.prototype.error = function (message, cb) {
|
|
90
|
+
if (typeof message === 'object') {
|
|
91
|
+
return this._winston.error(message);
|
|
92
|
+
}
|
|
93
|
+
return this._winston.error(message, cb);
|
|
94
|
+
};
|
|
95
|
+
ConduitLogger.prototype.http = function (message, cb) {
|
|
96
|
+
return this._winston.http(message, cb);
|
|
97
|
+
};
|
|
98
|
+
ConduitLogger.prototype.verbose = function (message, cb) {
|
|
99
|
+
return this._winston.verbose(message, cb);
|
|
100
|
+
};
|
|
101
|
+
return ConduitLogger;
|
|
102
|
+
}());
|
|
103
|
+
exports.ConduitLogger = ConduitLogger;
|
|
104
|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,EAAgB;QAC7C,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACrC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,4BAAI,GAAJ,UAAK,OAAe,EAAE,EAAgB;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,+BAAO,GAAP,UAAQ,OAAe,EAAE,EAAgB;QACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5C,CAAC;IACH,oBAAC;AAAD,CAAC,AAnDD,IAmDC;AAnDY,sCAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conduitplatform/grpc-sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"engines": {
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"ioredis": "^4.28.3",
|
|
25
25
|
"lodash": "^4.17.21",
|
|
26
26
|
"nice-grpc": "^1.0.6",
|
|
27
|
-
"protobufjs": "^6.11.2"
|
|
27
|
+
"protobufjs": "^6.11.2",
|
|
28
|
+
"winston": "^3.7.2"
|
|
28
29
|
},
|
|
29
30
|
"directories": {
|
|
30
31
|
"lib": "dist",
|