@grandlinex/kernel 0.22.1-alpha.0 → 0.24.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 +71 -71
- package/LICENSE +29 -29
- package/README.md +30 -30
- package/dist/Kernel.d.ts +27 -22
- package/dist/Kernel.js +74 -68
- package/dist/KernelModule.d.ts +8 -8
- package/dist/KernelModule.js +89 -89
- package/dist/actions/ApiAuthTestAction.d.ts +27 -27
- package/dist/actions/ApiAuthTestAction.js +93 -93
- package/dist/actions/ApiVersionAction.d.ts +30 -30
- package/dist/actions/ApiVersionAction.js +96 -96
- package/dist/actions/GetTokenAction.d.ts +43 -43
- package/dist/actions/GetTokenAction.js +135 -135
- package/dist/actions/index.d.ts +4 -4
- package/dist/actions/index.js +12 -12
- package/dist/api/KernelEndpoint.d.ts +3 -3
- package/dist/api/KernelEndpoint.js +29 -29
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +8 -8
- package/dist/classes/BaseAction.d.ts +13 -13
- package/dist/classes/BaseAction.js +110 -103
- package/dist/classes/BaseApiAction.d.ts +9 -8
- package/dist/classes/BaseApiAction.js +67 -67
- package/dist/classes/BaseAuthProvider.d.ts +23 -23
- package/dist/classes/BaseAuthProvider.js +8 -8
- package/dist/classes/BaseEndpoint.d.ts +12 -12
- package/dist/classes/BaseEndpoint.js +61 -61
- package/dist/classes/BaseKernelModule.d.ts +4 -5
- package/dist/classes/BaseKernelModule.js +26 -26
- package/dist/classes/index.d.ts +8 -8
- package/dist/classes/index.js +38 -34
- package/dist/index.d.ts +14 -14
- package/dist/index.js +35 -31
- package/dist/lib/index.d.ts +35 -31
- package/dist/lib/index.js +2 -2
- package/dist/modules/crypto/CryptoClient.d.ts +19 -19
- package/dist/modules/crypto/CryptoClient.js +152 -152
- package/dist/modules/crypto/index.d.ts +3 -3
- package/dist/modules/crypto/index.js +23 -19
- package/dist/modules/crypto/utils/cors.d.ts +3 -3
- package/dist/modules/crypto/utils/cors.js +10 -10
- package/package.json +69 -69
- package/dist/database/KernelDB.d.ts +0 -14
- package/dist/database/KernelDB.js +0 -115
- package/dist/database/entity/GKey.d.ts +0 -8
- package/dist/database/entity/GKey.js +0 -61
package/dist/KernelModule.js
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
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;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
-
};
|
|
56
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
var core_1 = require("@grandlinex/core");
|
|
58
|
-
var BaseKernelModule_1 = __importDefault(require("./classes/BaseKernelModule"));
|
|
59
|
-
var KernelEndpoint_1 = __importDefault(require("./api/KernelEndpoint"));
|
|
60
|
-
var ApiVersionAction_1 = __importDefault(require("./actions/ApiVersionAction"));
|
|
61
|
-
var GetTokenAction_1 = __importDefault(require("./actions/GetTokenAction"));
|
|
62
|
-
var ApiAuthTestAction_1 = __importDefault(require("./actions/ApiAuthTestAction"));
|
|
63
|
-
var KernelModule = /** @class */ (function (_super) {
|
|
64
|
-
__extends(KernelModule, _super);
|
|
65
|
-
function KernelModule(kernel) {
|
|
66
|
-
var _this = _super.call(this, 'base-mod', kernel) || this;
|
|
67
|
-
_this.addAction(new ApiVersionAction_1.default(_this), new ApiAuthTestAction_1.default(_this), new GetTokenAction_1.default(_this));
|
|
68
|
-
_this.addService(new core_1.OfflineService(_this));
|
|
69
|
-
return _this;
|
|
70
|
-
}
|
|
71
|
-
KernelModule.prototype.initModule = function () {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
-
var endpoint;
|
|
74
|
-
return __generator(this, function (_a) {
|
|
75
|
-
switch (_a.label) {
|
|
76
|
-
case 0:
|
|
77
|
-
endpoint = new KernelEndpoint_1.default('api', this, this.getKernel().getAppServerPort());
|
|
78
|
-
this.setPresenter(endpoint);
|
|
79
|
-
return [4 /*yield*/, this.getKernel().triggerFunction('load')];
|
|
80
|
-
case 1:
|
|
81
|
-
_a.sent();
|
|
82
|
-
return [2 /*return*/];
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
return KernelModule;
|
|
88
|
-
}(BaseKernelModule_1.default));
|
|
89
|
-
exports.default = KernelModule;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
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;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
var core_1 = require("@grandlinex/core");
|
|
58
|
+
var BaseKernelModule_1 = __importDefault(require("./classes/BaseKernelModule"));
|
|
59
|
+
var KernelEndpoint_1 = __importDefault(require("./api/KernelEndpoint"));
|
|
60
|
+
var ApiVersionAction_1 = __importDefault(require("./actions/ApiVersionAction"));
|
|
61
|
+
var GetTokenAction_1 = __importDefault(require("./actions/GetTokenAction"));
|
|
62
|
+
var ApiAuthTestAction_1 = __importDefault(require("./actions/ApiAuthTestAction"));
|
|
63
|
+
var KernelModule = /** @class */ (function (_super) {
|
|
64
|
+
__extends(KernelModule, _super);
|
|
65
|
+
function KernelModule(kernel) {
|
|
66
|
+
var _this = _super.call(this, 'base-mod', kernel) || this;
|
|
67
|
+
_this.addAction(new ApiVersionAction_1.default(_this), new ApiAuthTestAction_1.default(_this), new GetTokenAction_1.default(_this));
|
|
68
|
+
_this.addService(new core_1.OfflineService(_this));
|
|
69
|
+
return _this;
|
|
70
|
+
}
|
|
71
|
+
KernelModule.prototype.initModule = function () {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
var endpoint;
|
|
74
|
+
return __generator(this, function (_a) {
|
|
75
|
+
switch (_a.label) {
|
|
76
|
+
case 0:
|
|
77
|
+
endpoint = new KernelEndpoint_1.default('api', this, this.getKernel().getAppServerPort());
|
|
78
|
+
this.setPresenter(endpoint);
|
|
79
|
+
return [4 /*yield*/, this.getKernel().triggerFunction('load')];
|
|
80
|
+
case 1:
|
|
81
|
+
_a.sent();
|
|
82
|
+
return [2 /*return*/];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
return KernelModule;
|
|
88
|
+
}(BaseKernelModule_1.default));
|
|
89
|
+
exports.default = KernelModule;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import e from 'express';
|
|
2
|
-
import { IBaseKernelModule } from '../lib';
|
|
3
|
-
import { BaseApiAction, JwtToken } from '../classes';
|
|
4
|
-
/**
|
|
5
|
-
* @name ApiAuthTestAction
|
|
6
|
-
*
|
|
7
|
-
* @openapi
|
|
8
|
-
* /test/auth:
|
|
9
|
-
* get:
|
|
10
|
-
* summary: test call for valid access rights
|
|
11
|
-
* tags:
|
|
12
|
-
* - Kernel
|
|
13
|
-
* responses:
|
|
14
|
-
* 200:
|
|
15
|
-
* description: OK
|
|
16
|
-
* content:
|
|
17
|
-
* text/plain:
|
|
18
|
-
* schema:
|
|
19
|
-
* type: string
|
|
20
|
-
* 401:
|
|
21
|
-
* description: invalid token / not authorized
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
export default class ApiAuthTestAction extends BaseApiAction {
|
|
25
|
-
constructor(module: IBaseKernelModule<any, any, any, any>);
|
|
26
|
-
handler(req: e.Request, res: e.Response, next: () => void, data: JwtToken): Promise<void>;
|
|
27
|
-
}
|
|
1
|
+
import e from 'express';
|
|
2
|
+
import { IBaseKernelModule } from '../lib';
|
|
3
|
+
import { BaseApiAction, JwtToken } from '../classes';
|
|
4
|
+
/**
|
|
5
|
+
* @name ApiAuthTestAction
|
|
6
|
+
*
|
|
7
|
+
* @openapi
|
|
8
|
+
* /test/auth:
|
|
9
|
+
* get:
|
|
10
|
+
* summary: test call for valid access rights
|
|
11
|
+
* tags:
|
|
12
|
+
* - Kernel
|
|
13
|
+
* responses:
|
|
14
|
+
* 200:
|
|
15
|
+
* description: OK
|
|
16
|
+
* content:
|
|
17
|
+
* text/plain:
|
|
18
|
+
* schema:
|
|
19
|
+
* type: string
|
|
20
|
+
* 401:
|
|
21
|
+
* description: invalid token / not authorized
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
export default class ApiAuthTestAction extends BaseApiAction {
|
|
25
|
+
constructor(module: IBaseKernelModule<any, any, any, any>);
|
|
26
|
+
handler(req: e.Request, res: e.Response, next: () => void, data: JwtToken): Promise<void>;
|
|
27
|
+
}
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
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;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
var classes_1 = require("../classes");
|
|
55
|
-
/**
|
|
56
|
-
* @name ApiAuthTestAction
|
|
57
|
-
*
|
|
58
|
-
* @openapi
|
|
59
|
-
* /test/auth:
|
|
60
|
-
* get:
|
|
61
|
-
* summary: test call for valid access rights
|
|
62
|
-
* tags:
|
|
63
|
-
* - Kernel
|
|
64
|
-
* responses:
|
|
65
|
-
* 200:
|
|
66
|
-
* description: OK
|
|
67
|
-
* content:
|
|
68
|
-
* text/plain:
|
|
69
|
-
* schema:
|
|
70
|
-
* type: string
|
|
71
|
-
* 401:
|
|
72
|
-
* description: invalid token / not authorized
|
|
73
|
-
*
|
|
74
|
-
*/
|
|
75
|
-
var ApiAuthTestAction = /** @class */ (function (_super) {
|
|
76
|
-
__extends(ApiAuthTestAction, _super);
|
|
77
|
-
function ApiAuthTestAction(module) {
|
|
78
|
-
var _this = _super.call(this, 'GET', '/test/auth', module) || this;
|
|
79
|
-
_this.handler = _this.handler.bind(_this);
|
|
80
|
-
return _this;
|
|
81
|
-
}
|
|
82
|
-
ApiAuthTestAction.prototype.handler = function (req, res, next, data) {
|
|
83
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
-
return __generator(this, function (_a) {
|
|
85
|
-
this.debug(data.userid);
|
|
86
|
-
res.status(200).send("It work's");
|
|
87
|
-
return [2 /*return*/];
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
return ApiAuthTestAction;
|
|
92
|
-
}(classes_1.BaseApiAction));
|
|
93
|
-
exports.default = ApiAuthTestAction;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
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;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
var classes_1 = require("../classes");
|
|
55
|
+
/**
|
|
56
|
+
* @name ApiAuthTestAction
|
|
57
|
+
*
|
|
58
|
+
* @openapi
|
|
59
|
+
* /test/auth:
|
|
60
|
+
* get:
|
|
61
|
+
* summary: test call for valid access rights
|
|
62
|
+
* tags:
|
|
63
|
+
* - Kernel
|
|
64
|
+
* responses:
|
|
65
|
+
* 200:
|
|
66
|
+
* description: OK
|
|
67
|
+
* content:
|
|
68
|
+
* text/plain:
|
|
69
|
+
* schema:
|
|
70
|
+
* type: string
|
|
71
|
+
* 401:
|
|
72
|
+
* description: invalid token / not authorized
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
var ApiAuthTestAction = /** @class */ (function (_super) {
|
|
76
|
+
__extends(ApiAuthTestAction, _super);
|
|
77
|
+
function ApiAuthTestAction(module) {
|
|
78
|
+
var _this = _super.call(this, 'GET', '/test/auth', module) || this;
|
|
79
|
+
_this.handler = _this.handler.bind(_this);
|
|
80
|
+
return _this;
|
|
81
|
+
}
|
|
82
|
+
ApiAuthTestAction.prototype.handler = function (req, res, next, data) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
this.debug(data.userid);
|
|
86
|
+
res.status(200).send("It work's");
|
|
87
|
+
return [2 /*return*/];
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
return ApiAuthTestAction;
|
|
92
|
+
}(classes_1.BaseApiAction));
|
|
93
|
+
exports.default = ApiAuthTestAction;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import e from 'express';
|
|
2
|
-
import { IBaseKernelModule } from '../lib';
|
|
3
|
-
import { BaseApiAction } from '../classes';
|
|
4
|
-
/**
|
|
5
|
-
* @name ApiVersionAction
|
|
6
|
-
*
|
|
7
|
-
* @openapi
|
|
8
|
-
* /version:
|
|
9
|
-
* get:
|
|
10
|
-
* summary: get api schema version
|
|
11
|
-
* tags:
|
|
12
|
-
* - Kernel
|
|
13
|
-
* responses:
|
|
14
|
-
* 200:
|
|
15
|
-
* description: OK
|
|
16
|
-
* content:
|
|
17
|
-
* application/json:
|
|
18
|
-
* schema:
|
|
19
|
-
* type: object
|
|
20
|
-
* properties:
|
|
21
|
-
* api:
|
|
22
|
-
* type: number
|
|
23
|
-
* 401:
|
|
24
|
-
* description: invalid token / not authorized
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
export default class ApiVersionAction extends BaseApiAction {
|
|
28
|
-
constructor(module: IBaseKernelModule<any, any, any, any>);
|
|
29
|
-
handler(req: e.Request, res: e.Response, next: () => void): Promise<void>;
|
|
30
|
-
}
|
|
1
|
+
import e from 'express';
|
|
2
|
+
import { IBaseKernelModule } from '../lib';
|
|
3
|
+
import { BaseApiAction } from '../classes';
|
|
4
|
+
/**
|
|
5
|
+
* @name ApiVersionAction
|
|
6
|
+
*
|
|
7
|
+
* @openapi
|
|
8
|
+
* /version:
|
|
9
|
+
* get:
|
|
10
|
+
* summary: get api schema version
|
|
11
|
+
* tags:
|
|
12
|
+
* - Kernel
|
|
13
|
+
* responses:
|
|
14
|
+
* 200:
|
|
15
|
+
* description: OK
|
|
16
|
+
* content:
|
|
17
|
+
* application/json:
|
|
18
|
+
* schema:
|
|
19
|
+
* type: object
|
|
20
|
+
* properties:
|
|
21
|
+
* api:
|
|
22
|
+
* type: number
|
|
23
|
+
* 401:
|
|
24
|
+
* description: invalid token / not authorized
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export default class ApiVersionAction extends BaseApiAction {
|
|
28
|
+
constructor(module: IBaseKernelModule<any, any, any, any>);
|
|
29
|
+
handler(req: e.Request, res: e.Response, next: () => void): Promise<void>;
|
|
30
|
+
}
|