@resolveio/server-lib 12.2.14 → 12.2.16
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/index.d.ts +2 -1
- package/index.js +3 -49
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Db, MongoClient } from 'mongodb';
|
|
2
2
|
import { MongoManager } from './managers/mongo.manager';
|
|
3
|
+
import serverApp from './server-app';
|
|
3
4
|
export declare class ResolveIOServer {
|
|
4
5
|
private static _serverConfig;
|
|
5
6
|
private static _clientRoutes;
|
|
@@ -14,7 +15,7 @@ export declare class ResolveIOServer {
|
|
|
14
15
|
constructor(serverConfig: any, clientRoutes: string[], client: string, clientDir: any, sesMail?: boolean, standardProgram?: boolean);
|
|
15
16
|
static connectAndRun(): Promise<unknown>;
|
|
16
17
|
static getClientName(): string;
|
|
17
|
-
static getMainServer():
|
|
18
|
+
static getMainServer(): serverApp;
|
|
18
19
|
static getMongoConnection(): MongoClient;
|
|
19
20
|
static getMainDB(): Db;
|
|
20
21
|
static getMongoManager(): MongoManager;
|
package/index.js
CHANGED
|
@@ -9,46 +9,11 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
13
|
exports.ResolveIOServer = void 0;
|
|
50
14
|
var mongodb_1 = require("mongodb");
|
|
51
15
|
var mongo_manager_1 = require("./managers/mongo.manager");
|
|
16
|
+
var server_app_1 = require("./server-app");
|
|
52
17
|
var ResolveIOServer = /** @class */ (function () {
|
|
53
18
|
function ResolveIOServer(serverConfig, clientRoutes, client, clientDir, sesMail, standardProgram) {
|
|
54
19
|
if (sesMail === void 0) { sesMail = true; }
|
|
@@ -68,19 +33,8 @@ var ResolveIOServer = /** @class */ (function () {
|
|
|
68
33
|
ResolveIOServer._mongoConnection = dbConnection;
|
|
69
34
|
ResolveIOServer._mainDB = dbConnection.db(ResolveIOServer._serverConfig['DATABASE']);
|
|
70
35
|
ResolveIOServer._mongoManager = new mongo_manager_1.MongoManager(collections);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return __generator(this, function (_a) {
|
|
74
|
-
switch (_a.label) {
|
|
75
|
-
case 0: return [4 /*yield*/, Promise.resolve().then(function () { return require('./server-app'); })];
|
|
76
|
-
case 1:
|
|
77
|
-
serverApp = (_a.sent()).default;
|
|
78
|
-
ResolveIOServer._mainServer = new serverApp(this, ResolveIOServer._serverConfig, ResolveIOServer._clientRoutes, this._clientDir, this._sesMail, this._standardProgram);
|
|
79
|
-
resolve(true);
|
|
80
|
-
return [2 /*return*/];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
}); }, 1);
|
|
36
|
+
ResolveIOServer._mainServer = new server_app_1.default(_this, ResolveIOServer._serverConfig, ResolveIOServer._clientRoutes, _this._clientDir, _this._sesMail, _this._standardProgram);
|
|
37
|
+
resolve(true);
|
|
84
38
|
});
|
|
85
39
|
}, function (err) {
|
|
86
40
|
console.error(new Date(), 'MONGO CLIENT CONNECT FAILED', JSON.stringify(err, null, 2));
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAA0C;AAC1C,0DAAwD;AACxD,2CAAqC;AAGrC;IAYC,yBAAY,YAAY,EAAE,YAAsB,EAAE,MAAc,EAAE,SAAS,EAAE,OAAc,EAAE,eAAuB;QAAvC,wBAAA,EAAA,cAAc;QAAE,gCAAA,EAAA,uBAAuB;QACnH,eAAe,CAAC,aAAa,GAAG,YAAY,CAAC;QAC7C,eAAe,CAAC,aAAa,GAAG,YAAY,CAAC;QAC7C,eAAe,CAAC,OAAO,GAAG,MAAM,CAAC;QACjC,eAAe,CAAC,UAAU,GAAG,SAAS,CAAC;QACvC,eAAe,CAAC,QAAQ,GAAG,OAAO,CAAC;QACnC,eAAe,CAAC,gBAAgB,GAAG,eAAe,CAAC;IACpD,CAAC;IAEa,6BAAa,GAA3B;QAAA,iBAiBC;QAhBA,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;YAClC,qBAAW,CAAC,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,UAAA,YAAY;gBAChF,YAAY,CAAC,EAAE,EAAE,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,UAAA,WAAW;oBAC7D,eAAe,CAAC,gBAAgB,GAAG,YAAY,CAAC;oBAChD,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;oBACrF,eAAe,CAAC,aAAa,GAAG,IAAI,4BAAY,CAAC,WAAW,CAAC,CAAC;oBAC9D,eAAe,CAAC,WAAW,GAAG,IAAI,oBAAS,CAAC,KAAI,EAAE,eAAe,CAAC,aAAa,EAAE,eAAe,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odb';\nimport { MongoManager } from './managers/mongo.manager';\nimport serverApp from './server-app';\nimport ResolveIOMainServer from './server-app';\n\nexport class ResolveIOServer {\n\tprivate static _serverConfig = null;\n\tprivate static _clientRoutes = [];\n\tprivate static _mongoConnection: MongoClient = null;\n\tprivate static _mainDB: Db = null;\n\tprivate static _mainServer: ResolveIOMainServer = null;\n\tprivate static _mongoManager: MongoManager = null;\n\tprivate static _client = '';\n\tprivate static _clientDir = '';\n\tprivate static _sesMail = true;\n\tprivate static _standardProgram = false;\n\n\tconstructor(serverConfig, clientRoutes: string[], client: string, clientDir, sesMail = true, standardProgram = false) {\n\t\tResolveIOServer._serverConfig = serverConfig;\n\t\tResolveIOServer._clientRoutes = clientRoutes;\n\t\tResolveIOServer._client = client;\n\t\tResolveIOServer._clientDir = clientDir;\n\t\tResolveIOServer._sesMail = sesMail;\n\t\tResolveIOServer._standardProgram = standardProgram;\n\t}\n\n\tpublic static connectAndRun() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tMongoClient.connect(ResolveIOServer._serverConfig['MONGO_URL']).then(dbConnection => {\n\t\t\t\tdbConnection.db().listCollections().toArray().then(collections => {\n\t\t\t\t\tResolveIOServer._mongoConnection = dbConnection;\n\t\t\t\t\tResolveIOServer._mainDB = dbConnection.db(ResolveIOServer._serverConfig['DATABASE']);\n\t\t\t\t\tResolveIOServer._mongoManager = new MongoManager(collections);\n\t\t\t\t\tResolveIOServer._mainServer = new serverApp(this, ResolveIOServer._serverConfig, ResolveIOServer._clientRoutes, this._clientDir, this._sesMail, this._standardProgram);\n\n\t\t\t\t\tresolve(true);\n\t\t\t\t});\n\t\t\t}, err => {\n\t\t\t\tconsole.error(new Date(), 'MONGO CLIENT CONNECT FAILED', JSON.stringify(err, null, 2));\n\t\t\t\treject();\n\t\t\t\tprocess.exit(1);\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic static getClientName() {\n\t\treturn this._client;\n\t}\n\n\tpublic static getMainServer() {\n\t\treturn ResolveIOServer._mainServer;\n\t}\n\n\tpublic static getMongoConnection() {\n\t\treturn ResolveIOServer._mongoConnection;\n\t}\n\n\tpublic static getMainDB() {\n\t\treturn ResolveIOServer._mainDB;\n\t}\n\n\tpublic static getMongoManager() {\n\t\treturn ResolveIOServer._mongoManager;\n\t}\n}\n\nexport * from './public_api';"]}
|