@grandlinex/kernel 0.17.1 → 0.21.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
4
 
5
+ ## [v0.18.0] - 2022-01-10
6
+ ### Changed
7
+ - Update to core 0.18.0
8
+
5
9
  ## [v0.17.0] - 2022-01-03
6
10
  ### Changed
7
11
  - Update to core 0.17.1
@@ -7,7 +7,4 @@ export default class KernelModule extends BaseKernelModule<KernelDB, null, InMem
7
7
  useLightDB: boolean;
8
8
  constructor(kernel: IKernel);
9
9
  initModule(): Promise<void>;
10
- startup(): Promise<void>;
11
- beforeServiceStart(): Promise<void>;
12
- final(): Promise<void>;
13
10
  }
@@ -14,25 +14,6 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
17
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
18
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
19
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -78,7 +59,7 @@ var core_1 = require("@grandlinex/core");
78
59
  var bundle_sqlight_1 = __importDefault(require("@grandlinex/bundle-sqlight"));
79
60
  var bundle_postgresql_1 = __importDefault(require("@grandlinex/bundle-postgresql"));
80
61
  var BaseKernelModule_1 = __importDefault(require("./classes/BaseKernelModule"));
81
- var KernelDB_1 = __importStar(require("./database/KernelDB"));
62
+ var KernelDB_1 = __importDefault(require("./database/KernelDB"));
82
63
  var KernelEndpoint_1 = __importDefault(require("./api/KernelEndpoint"));
83
64
  var ApiVersionAction_1 = __importDefault(require("./actions/ApiVersionAction"));
84
65
  var GetTokenAction_1 = __importDefault(require("./actions/GetTokenAction"));
@@ -95,42 +76,22 @@ var KernelModule = /** @class */ (function (_super) {
95
76
  }
96
77
  KernelModule.prototype.initModule = function () {
97
78
  return __awaiter(this, void 0, void 0, function () {
98
- var db, Db, Db, endpoint;
79
+ var db, endpoint;
99
80
  return __generator(this, function (_a) {
100
81
  switch (_a.label) {
101
82
  case 0:
102
83
  this.setCache(new core_1.InMemCache(this, 480000));
103
84
  if (this.useLightDB) {
104
- Db = /** @class */ (function (_super) {
105
- __extends(Db, _super);
106
- function Db(mod) {
107
- return _super.call(this, mod, KernelDB_1.KERNEL_DB_VERSION) || this;
108
- }
109
- Db.prototype.initNewDB = function () {
110
- return Promise.resolve(undefined);
111
- };
112
- return Db;
113
- }(bundle_sqlight_1.default));
114
- db = new KernelDB_1.default(new Db(this));
85
+ db = new KernelDB_1.default(new bundle_sqlight_1.default(this, '0'));
115
86
  }
116
87
  else {
117
- Db = /** @class */ (function (_super) {
118
- __extends(Db, _super);
119
- function Db(mod) {
120
- return _super.call(this, mod, KernelDB_1.KERNEL_DB_VERSION) || this;
121
- }
122
- Db.prototype.initNewDB = function () {
123
- return Promise.resolve(undefined);
124
- };
125
- return Db;
126
- }(bundle_postgresql_1.default));
127
- db = new KernelDB_1.default(new Db(this));
88
+ db = new KernelDB_1.default(new bundle_postgresql_1.default(this, '0'));
128
89
  }
129
90
  db.setEntityCache(true);
130
91
  db.registerEntity(new GKey_1.default());
131
92
  this.setDb(db);
132
93
  endpoint = new KernelEndpoint_1.default('api', this, this.getKernel().getAppServerPort());
133
- this.setEndpoint(endpoint);
94
+ this.setPresenter(endpoint);
134
95
  return [4 /*yield*/, this.getKernel().triggerFunction('load')];
135
96
  case 1:
136
97
  _a.sent();
@@ -139,27 +100,6 @@ var KernelModule = /** @class */ (function (_super) {
139
100
  });
140
101
  });
141
102
  };
142
- KernelModule.prototype.startup = function () {
143
- return __awaiter(this, void 0, void 0, function () {
144
- return __generator(this, function (_a) {
145
- return [2 /*return*/, Promise.resolve()];
146
- });
147
- });
148
- };
149
- KernelModule.prototype.beforeServiceStart = function () {
150
- return __awaiter(this, void 0, void 0, function () {
151
- return __generator(this, function (_a) {
152
- return [2 /*return*/, Promise.resolve()];
153
- });
154
- });
155
- };
156
- KernelModule.prototype.final = function () {
157
- return __awaiter(this, void 0, void 0, function () {
158
- return __generator(this, function (_a) {
159
- return [2 /*return*/, Promise.resolve()];
160
- });
161
- });
162
- };
163
103
  return KernelModule;
164
104
  }(BaseKernelModule_1.default));
165
105
  exports.default = KernelModule;
@@ -30,29 +30,29 @@ var BaseApiAction = /** @class */ (function (_super) {
30
30
  BaseApiAction.prototype.register = function () {
31
31
  var endpoint;
32
32
  if (this.exmod) {
33
- endpoint = this.exmod.getEndpoint();
33
+ endpoint = this.exmod.getPresenter();
34
34
  }
35
35
  else {
36
- endpoint = this.getModule().getEndpoint();
36
+ endpoint = this.getModule().getPresenter();
37
37
  }
38
38
  if (endpoint) {
39
- this.log("register ".concat(this.chanel));
39
+ this.log("register ".concat(this.getName()));
40
40
  var app = endpoint.getApp();
41
41
  switch (this.type) {
42
42
  case 'POST':
43
- app.post(this.chanel, this.secureHandler);
43
+ app.post(this.getName(), this.secureHandler);
44
44
  break;
45
45
  case 'USE':
46
- app.use(this.chanel, this.secureHandler);
46
+ app.use(this.getName(), this.secureHandler);
47
47
  break;
48
48
  case 'GET':
49
49
  default:
50
- app.get(this.chanel, this.secureHandler);
50
+ app.get(this.getName(), this.secureHandler);
51
51
  break;
52
52
  }
53
53
  }
54
54
  else {
55
- this.error("on register -> ".concat(this.chanel));
55
+ this.error("on register -> ".concat(this.getName()));
56
56
  this.error("No Endpoint found");
57
57
  }
58
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grandlinex/kernel",
3
- "version": "0.17.1",
3
+ "version": "0.21.0",
4
4
  "description": "GrandLineX is an out-of-the-box server framework on top of ExpressJs.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,10 +27,10 @@
27
27
  },
28
28
  "license": "BSD-3-Clause",
29
29
  "dependencies": {
30
- "@grandlinex/bundle-elogger": "^0.17.3",
31
- "@grandlinex/bundle-postgresql": "^0.17.3",
32
- "@grandlinex/bundle-sqlight": "^0.17.3",
33
- "@grandlinex/core": "^0.17.4",
30
+ "@grandlinex/bundle-elogger": "^0.21.0",
31
+ "@grandlinex/bundle-postgresql": "^0.21.0",
32
+ "@grandlinex/bundle-sqlight": "^0.21.0",
33
+ "@grandlinex/core": "^0.21.0",
34
34
  "axios": "^0.24.0",
35
35
  "body-parser": "^1.19.1",
36
36
  "express": "^4.17.2",