@grandlinex/kernel 0.30.0 → 0.30.1
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/Kernel.d.ts +3 -3
- package/dist/Kernel.js +3 -3
- package/dist/KernelModule.d.ts +3 -3
- package/dist/KernelModule.js +5 -5
- package/dist/actions/ApiAuthTestAction.d.ts +3 -19
- package/dist/actions/ApiAuthTestAction.js +1 -17
- package/dist/actions/ApiVersionAction.d.ts +3 -23
- package/dist/actions/ApiVersionAction.js +1 -21
- package/dist/actions/GetTokenAction.d.ts +3 -4
- package/dist/actions/GetTokenAction.js +1 -2
- package/dist/actions/index.d.ts +3 -3
- package/dist/actions/index.js +3 -3
- package/dist/api/KernelEndpoint.d.ts +1 -1
- package/dist/api/KernelEndpoint.js +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/classes/BaseAction.d.ts +4 -4
- package/dist/classes/BaseAction.js +2 -2
- package/dist/classes/BaseApiAction.d.ts +2 -2
- package/dist/classes/BaseApiAction.js +1 -1
- package/dist/classes/BaseAuthProvider.d.ts +3 -3
- package/dist/classes/BaseEndpoint.d.ts +4 -4
- package/dist/classes/BaseEndpoint.js +2 -2
- package/dist/classes/BaseKernelModule.d.ts +1 -1
- package/dist/classes/index.d.ts +8 -8
- package/dist/classes/index.js +8 -8
- package/dist/classes/timing/ExpressServerTiming.d.ts +2 -2
- package/dist/classes/timing/ExpressServerTiming.js +1 -1
- package/dist/classes/timing/ServerTiming.d.ts +1 -1
- package/dist/classes/timing/ServerTiming.js +1 -1
- package/dist/classes/timing/index.d.ts +3 -3
- package/dist/classes/timing/index.js +3 -3
- package/dist/index.d.ts +8 -8
- package/dist/index.js +8 -8
- package/dist/lib/index.d.ts +4 -5
- package/dist/modules/crypto/CryptoClient.d.ts +5 -5
- package/dist/modules/crypto/CryptoClient.js +3 -3
- package/dist/modules/crypto/index.d.ts +2 -2
- package/dist/modules/crypto/index.js +2 -2
- package/dist/modules/crypto/utils/cors.d.ts +1 -1
- package/package.json +3 -3
package/dist/Kernel.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ICClient, IKernel } from './lib';
|
|
3
|
-
import { XRequest } from './lib/express';
|
|
1
|
+
import { CoreLogger, CoreKernel } from '@grandlinex/core';
|
|
2
|
+
import { ICClient, IKernel } from './lib/index.js';
|
|
3
|
+
import { XRequest } from './lib/express.js';
|
|
4
4
|
/**
|
|
5
5
|
* @class Kernel
|
|
6
6
|
*/
|
package/dist/Kernel.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import CoreKernel from '@grandlinex/core';
|
|
2
|
-
import CryptoClient from './modules/crypto/CryptoClient';
|
|
3
|
-
import KernelModule from './KernelModule';
|
|
1
|
+
import { CoreKernel } from '@grandlinex/core';
|
|
2
|
+
import CryptoClient from './modules/crypto/CryptoClient.js';
|
|
3
|
+
import KernelModule from './KernelModule.js';
|
|
4
4
|
/**
|
|
5
5
|
* @class Kernel
|
|
6
6
|
*/
|
package/dist/KernelModule.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InMemCache } from '@grandlinex/core';
|
|
2
|
-
import BaseKernelModule from './classes/BaseKernelModule';
|
|
3
|
-
import { IKernel } from './lib';
|
|
4
|
-
import KernelEndpoint from './api/KernelEndpoint';
|
|
2
|
+
import BaseKernelModule from './classes/BaseKernelModule.js';
|
|
3
|
+
import { IKernel } from './lib/index.js';
|
|
4
|
+
import KernelEndpoint from './api/KernelEndpoint.js';
|
|
5
5
|
export default class KernelModule extends BaseKernelModule<IKernel, null, null, InMemCache, KernelEndpoint> {
|
|
6
6
|
constructor(kernel: IKernel);
|
|
7
7
|
initModule(): Promise<void>;
|
package/dist/KernelModule.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { OfflineService } from '@grandlinex/core';
|
|
2
|
-
import BaseKernelModule from './classes/BaseKernelModule';
|
|
3
|
-
import KernelEndpoint from './api/KernelEndpoint';
|
|
4
|
-
import ApiVersionAction from './actions/ApiVersionAction';
|
|
5
|
-
import GetTokenAction from './actions/GetTokenAction';
|
|
6
|
-
import ApiAuthTestAction from './actions/ApiAuthTestAction';
|
|
2
|
+
import BaseKernelModule from './classes/BaseKernelModule.js';
|
|
3
|
+
import KernelEndpoint from './api/KernelEndpoint.js';
|
|
4
|
+
import ApiVersionAction from './actions/ApiVersionAction.js';
|
|
5
|
+
import GetTokenAction from './actions/GetTokenAction.js';
|
|
6
|
+
import ApiAuthTestAction from './actions/ApiAuthTestAction.js';
|
|
7
7
|
export default class KernelModule extends BaseKernelModule {
|
|
8
8
|
constructor(kernel) {
|
|
9
9
|
super('base-mod', kernel);
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
import { IBaseKernelModule } from '../lib';
|
|
2
|
-
import { BaseApiAction, JwtToken } from '../classes';
|
|
3
|
-
import { XRequest, XResponse } from '../lib/express';
|
|
1
|
+
import { IBaseKernelModule } from '../lib/index.js';
|
|
2
|
+
import { BaseApiAction, JwtToken } from '../classes/index.js';
|
|
3
|
+
import { XRequest, XResponse } from '../lib/express.js';
|
|
4
4
|
/**
|
|
5
5
|
* @name ApiAuthTestAction
|
|
6
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
7
|
*/
|
|
24
8
|
export default class ApiAuthTestAction extends BaseApiAction {
|
|
25
9
|
constructor(module: IBaseKernelModule<any, any, any, any>);
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
import { BaseApiAction } from '../classes';
|
|
1
|
+
import { BaseApiAction } from '../classes/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* @name ApiAuthTestAction
|
|
4
4
|
*
|
|
5
|
-
* @openapi
|
|
6
|
-
* /test/auth:
|
|
7
|
-
* get:
|
|
8
|
-
* summary: test call for valid access rights
|
|
9
|
-
* tags:
|
|
10
|
-
* - Kernel
|
|
11
|
-
* responses:
|
|
12
|
-
* 200:
|
|
13
|
-
* description: OK
|
|
14
|
-
* content:
|
|
15
|
-
* text/plain:
|
|
16
|
-
* schema:
|
|
17
|
-
* type: string
|
|
18
|
-
* 401:
|
|
19
|
-
* description: invalid token / not authorized
|
|
20
|
-
*
|
|
21
5
|
*/
|
|
22
6
|
export default class ApiAuthTestAction extends BaseApiAction {
|
|
23
7
|
constructor(module) {
|
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
import { IBaseKernelModule } from '../lib';
|
|
2
|
-
import { BaseApiAction } from '../classes';
|
|
3
|
-
import {
|
|
4
|
-
import { XRequest, XResponse } from '../lib/express';
|
|
1
|
+
import { IBaseKernelModule } from '../lib/index.js';
|
|
2
|
+
import { BaseApiAction, IExtensionInterface } from '../classes/index.js';
|
|
3
|
+
import { XRequest, XResponse } from '../lib/express.js';
|
|
5
4
|
/**
|
|
6
5
|
* @name ApiVersionAction
|
|
7
6
|
*
|
|
8
|
-
* @openapi
|
|
9
|
-
* /version:
|
|
10
|
-
* get:
|
|
11
|
-
* summary: get api schema version
|
|
12
|
-
* tags:
|
|
13
|
-
* - Kernel
|
|
14
|
-
* responses:
|
|
15
|
-
* 200:
|
|
16
|
-
* description: OK
|
|
17
|
-
* content:
|
|
18
|
-
* application/json:
|
|
19
|
-
* schema:
|
|
20
|
-
* type: object
|
|
21
|
-
* properties:
|
|
22
|
-
* api:
|
|
23
|
-
* type: number
|
|
24
|
-
* 401:
|
|
25
|
-
* description: invalid token / not authorized
|
|
26
|
-
*
|
|
27
7
|
*/
|
|
28
8
|
export default class ApiVersionAction extends BaseApiAction {
|
|
29
9
|
constructor(module: IBaseKernelModule);
|
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
import { BaseApiAction } from '../classes';
|
|
2
|
-
import { ActionMode } from '../classes/BaseAction';
|
|
1
|
+
import { BaseApiAction, ActionMode, } from '../classes/index.js';
|
|
3
2
|
/**
|
|
4
3
|
* @name ApiVersionAction
|
|
5
4
|
*
|
|
6
|
-
* @openapi
|
|
7
|
-
* /version:
|
|
8
|
-
* get:
|
|
9
|
-
* summary: get api schema version
|
|
10
|
-
* tags:
|
|
11
|
-
* - Kernel
|
|
12
|
-
* responses:
|
|
13
|
-
* 200:
|
|
14
|
-
* description: OK
|
|
15
|
-
* content:
|
|
16
|
-
* application/json:
|
|
17
|
-
* schema:
|
|
18
|
-
* type: object
|
|
19
|
-
* properties:
|
|
20
|
-
* api:
|
|
21
|
-
* type: number
|
|
22
|
-
* 401:
|
|
23
|
-
* description: invalid token / not authorized
|
|
24
|
-
*
|
|
25
5
|
*/
|
|
26
6
|
export default class ApiVersionAction extends BaseApiAction {
|
|
27
7
|
constructor(module) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { IBaseKernelModule } from '../lib';
|
|
2
|
-
import { BaseApiAction } from '../classes';
|
|
3
|
-
import {
|
|
4
|
-
import { XRequest, XResponse } from '../lib/express';
|
|
1
|
+
import { IBaseKernelModule } from '../lib/index.js';
|
|
2
|
+
import { BaseApiAction, IExtensionInterface } from '../classes/index.js';
|
|
3
|
+
import { XRequest, XResponse } from '../lib/express.js';
|
|
5
4
|
/**
|
|
6
5
|
* @openapi
|
|
7
6
|
* /token:
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApiAuthTestAction from './ApiAuthTestAction';
|
|
2
|
-
import ApiVersionAction from './ApiVersionAction';
|
|
3
|
-
import GetTokenAction from './GetTokenAction';
|
|
1
|
+
import ApiAuthTestAction from './ApiAuthTestAction.js';
|
|
2
|
+
import ApiVersionAction from './ApiVersionAction.js';
|
|
3
|
+
import GetTokenAction from './GetTokenAction.js';
|
|
4
4
|
export { ApiVersionAction, ApiAuthTestAction, GetTokenAction };
|
package/dist/actions/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ApiAuthTestAction from './ApiAuthTestAction';
|
|
2
|
-
import ApiVersionAction from './ApiVersionAction';
|
|
3
|
-
import GetTokenAction from './GetTokenAction';
|
|
1
|
+
import ApiAuthTestAction from './ApiAuthTestAction.js';
|
|
2
|
+
import ApiVersionAction from './ApiVersionAction.js';
|
|
3
|
+
import GetTokenAction from './GetTokenAction.js';
|
|
4
4
|
export { ApiVersionAction, ApiAuthTestAction, GetTokenAction };
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import KernelEndpoint from './KernelEndpoint';
|
|
1
|
+
import KernelEndpoint from './KernelEndpoint.js';
|
|
2
2
|
export { KernelEndpoint };
|
package/dist/api/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CoreAction, IDataBase } from '@grandlinex/core';
|
|
2
|
-
import { IBaseAction, IBaseCache, IBaseClient, IBaseKernelModule, IBasePresenter, IKernel } from '../lib';
|
|
3
|
-
import { JwtToken } from './BaseAuthProvider';
|
|
4
|
-
import { IExtensionInterface } from './timing/
|
|
5
|
-
import { XNextFc, XRequest, XResponse } from '../lib/express';
|
|
2
|
+
import { IBaseAction, IBaseCache, IBaseClient, IBaseKernelModule, IBasePresenter, IKernel } from '../lib/index.js';
|
|
3
|
+
import { JwtToken } from './BaseAuthProvider.js';
|
|
4
|
+
import { IExtensionInterface } from './timing/index.js';
|
|
5
|
+
import { XNextFc, XRequest, XResponse } from '../lib/express.js';
|
|
6
6
|
export declare enum ActionMode {
|
|
7
7
|
'DEFAULT' = 0,
|
|
8
8
|
'DMZ' = 1,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CoreAction } from '@grandlinex/core';
|
|
2
|
-
import { ExpressServerTiming } from './timing';
|
|
2
|
+
import { ExpressServerTiming } from './timing/index.js';
|
|
3
3
|
export var ActionMode;
|
|
4
4
|
(function (ActionMode) {
|
|
5
5
|
ActionMode[ActionMode["DEFAULT"] = 0] = "DEFAULT";
|
|
6
6
|
ActionMode[ActionMode["DMZ"] = 1] = "DMZ";
|
|
7
7
|
ActionMode[ActionMode["DMZ_WITH_USER"] = 2] = "DMZ_WITH_USER";
|
|
8
|
-
})(ActionMode || (ActionMode = {}));
|
|
8
|
+
})(ActionMode = ActionMode || (ActionMode = {}));
|
|
9
9
|
export default class BaseAction extends CoreAction {
|
|
10
10
|
constructor(chanel, module) {
|
|
11
11
|
super(chanel, module);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDataBase } from '@grandlinex/core';
|
|
2
|
-
import { ActionTypes, IBaseAction, IBaseCache, IBaseClient, IBaseKernelModule, IBasePresenter, IKernel } from '../lib';
|
|
3
|
-
import BaseAction from './BaseAction';
|
|
2
|
+
import { ActionTypes, IBaseAction, IBaseCache, IBaseClient, IBaseKernelModule, IBasePresenter, IKernel } from '../lib/index.js';
|
|
3
|
+
import BaseAction from './BaseAction.js';
|
|
4
4
|
export default abstract class BaseApiAction<K extends IKernel = IKernel, T extends IDataBase<any, any> | null = any, P extends IBaseClient | null = any, C extends IBaseCache | null = any, E extends IBasePresenter | null = any> extends BaseAction<K, T, P, C, E> implements IBaseAction<K, T, P, C, E> {
|
|
5
5
|
exmod: undefined | IBaseKernelModule<K>;
|
|
6
6
|
type: ActionTypes;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { XRequest } from '../lib/express';
|
|
3
|
-
export interface JwtToken extends JwtPayload {
|
|
1
|
+
import * as jwt from 'jsonwebtoken';
|
|
2
|
+
import { XRequest } from '../lib/express.js';
|
|
3
|
+
export interface JwtToken extends jwt.JwtPayload {
|
|
4
4
|
username: string;
|
|
5
5
|
userid: string;
|
|
6
6
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
3
3
|
import express, { Express } from 'express';
|
|
4
4
|
import http from 'http';
|
|
5
5
|
import { CorePresenter, IDataBase } from '@grandlinex/core';
|
|
6
|
-
import { IBaseCache, IBaseClient, IBaseKernelModule, IBasePresenter, IKernel } from '../lib';
|
|
7
|
-
import { XRequest, XResponse } from '../lib/express';
|
|
6
|
+
import { IBaseCache, IBaseClient, IBaseKernelModule, IBasePresenter, IKernel } from '../lib/index.js';
|
|
7
|
+
import { XRequest, XResponse } from '../lib/express.js';
|
|
8
8
|
export declare function keepRawBody(req: XRequest, res: XResponse, buf: Buffer, encoding: string): void;
|
|
9
9
|
export default abstract class BaseEndpoint<K extends IKernel = IKernel, T extends IDataBase<any, any> | null = any, P extends IBaseClient | null = any, C extends IBaseCache | null = any, E extends IBasePresenter | null = any> extends CorePresenter<express.Express, K, T, P, C, E> implements IBasePresenter {
|
|
10
10
|
protected appServer: express.Express;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import http from 'http';
|
|
3
|
-
import
|
|
3
|
+
import parser from 'body-parser';
|
|
4
4
|
import { CorePresenter } from '@grandlinex/core';
|
|
5
5
|
export function keepRawBody(req, res, buf, encoding) {
|
|
6
6
|
if (req.headers['content-type']?.startsWith('application/json') &&
|
|
@@ -19,7 +19,7 @@ export default class BaseEndpoint extends CorePresenter {
|
|
|
19
19
|
super(`endpoint-${chanel}`, module);
|
|
20
20
|
this.port = port;
|
|
21
21
|
this.appServer = express();
|
|
22
|
-
this.appServer.use(json({ verify: keepRawBody }));
|
|
22
|
+
this.appServer.use(parser.json({ verify: keepRawBody }));
|
|
23
23
|
this.httpServer = http.createServer(this.appServer);
|
|
24
24
|
}
|
|
25
25
|
appServerOverride(app) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CoreKernelModule, IDataBase } from '@grandlinex/core';
|
|
2
|
-
import { IBaseCache, IBaseClient, IBaseKernelModule, IBasePresenter, IKernel } from '../lib';
|
|
2
|
+
import { IBaseCache, IBaseClient, IBaseKernelModule, IBasePresenter, IKernel } from '../lib/index.js';
|
|
3
3
|
export default abstract class BaseKernelModule<K extends IKernel = IKernel, T extends IDataBase<any, any> | null = any, P extends IBaseClient | null = any, C extends IBaseCache | null = any, E extends IBasePresenter | null = any> extends CoreKernelModule<K, T, P, C, E> implements IBaseKernelModule<K, T, P, C, E> {
|
|
4
4
|
}
|
package/dist/classes/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CoreBridge as BaseBridge, CoreCache as BaseCache, CoreClient as BaseClient, CoreElement as BaseElement, CoreLoopService as BaseLoopService, CoreService as BaseService } from '@grandlinex/core';
|
|
2
|
-
import BaseAction from './BaseAction';
|
|
3
|
-
import BaseEndpoint, { keepRawBody } from './BaseEndpoint';
|
|
4
|
-
import BaseKernelModule from './BaseKernelModule';
|
|
5
|
-
import BaseApiAction from './BaseApiAction';
|
|
6
|
-
import BaseAuthProvider from './BaseAuthProvider';
|
|
7
|
-
export * from './BaseAction';
|
|
8
|
-
export * from './BaseAuthProvider';
|
|
9
|
-
export * from './timing';
|
|
2
|
+
import BaseAction from './BaseAction.js';
|
|
3
|
+
import BaseEndpoint, { keepRawBody } from './BaseEndpoint.js';
|
|
4
|
+
import BaseKernelModule from './BaseKernelModule.js';
|
|
5
|
+
import BaseApiAction from './BaseApiAction.js';
|
|
6
|
+
import BaseAuthProvider from './BaseAuthProvider.js';
|
|
7
|
+
export * from './BaseAction.js';
|
|
8
|
+
export * from './BaseAuthProvider.js';
|
|
9
|
+
export * from './timing/index.js';
|
|
10
10
|
export { BaseLoopService, BaseAuthProvider, BaseKernelModule, BaseService, BaseApiAction, BaseEndpoint, BaseElement, BaseCache, BaseAction, BaseClient, BaseBridge, keepRawBody, };
|
package/dist/classes/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CoreBridge as BaseBridge, CoreCache as BaseCache, CoreClient as BaseClient, CoreElement as BaseElement, CoreLoopService as BaseLoopService, CoreService as BaseService, } from '@grandlinex/core';
|
|
2
|
-
import BaseAction from './BaseAction';
|
|
3
|
-
import BaseEndpoint, { keepRawBody } from './BaseEndpoint';
|
|
4
|
-
import BaseKernelModule from './BaseKernelModule';
|
|
5
|
-
import BaseApiAction from './BaseApiAction';
|
|
6
|
-
import BaseAuthProvider from './BaseAuthProvider';
|
|
7
|
-
export * from './BaseAction';
|
|
8
|
-
export * from './BaseAuthProvider';
|
|
9
|
-
export * from './timing';
|
|
2
|
+
import BaseAction from './BaseAction.js';
|
|
3
|
+
import BaseEndpoint, { keepRawBody } from './BaseEndpoint.js';
|
|
4
|
+
import BaseKernelModule from './BaseKernelModule.js';
|
|
5
|
+
import BaseApiAction from './BaseApiAction.js';
|
|
6
|
+
import BaseAuthProvider from './BaseAuthProvider.js';
|
|
7
|
+
export * from './BaseAction.js';
|
|
8
|
+
export * from './BaseAuthProvider.js';
|
|
9
|
+
export * from './timing/index.js';
|
|
10
10
|
export { BaseLoopService, BaseAuthProvider, BaseKernelModule, BaseService, BaseApiAction, BaseEndpoint, BaseElement, BaseCache, BaseAction, BaseClient, BaseBridge, keepRawBody, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CoreElement } from '@grandlinex/core';
|
|
2
|
-
import { XResponse } from '../../lib/express';
|
|
2
|
+
import { XResponse } from '../../lib/express.js';
|
|
3
3
|
export type IExtensionInterface = {
|
|
4
4
|
done: () => void;
|
|
5
5
|
timing: ExpressServerTiming;
|
|
@@ -8,7 +8,7 @@ export default class ExpressServerTiming {
|
|
|
8
8
|
private timing;
|
|
9
9
|
private baseApiAction;
|
|
10
10
|
constructor(baseApiAction: CoreElement<any>);
|
|
11
|
-
start(chanel: string): import("./ServerTimingElement").default;
|
|
11
|
+
start(chanel: string): import("./ServerTimingElement.js").default;
|
|
12
12
|
startFunc<T>(chanel: string, fc: () => Promise<T>): Promise<T>;
|
|
13
13
|
dbQuery<T>(fc: () => Promise<T>): Promise<T>;
|
|
14
14
|
getHeader(): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ServerTimingElement, { IServerElement } from './ServerTimingElement';
|
|
1
|
+
import ServerTimingElement, { IServerElement } from './ServerTimingElement.js';
|
|
2
2
|
export default class ServerTiming implements IServerElement {
|
|
3
3
|
map: Map<string, ServerTimingElement[]>;
|
|
4
4
|
constructor();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ExpressServerTiming, { IExtensionInterface } from './ExpressServerTiming';
|
|
2
|
-
import ServerTiming from './ServerTiming';
|
|
3
|
-
import ServerTimingElement from './ServerTimingElement';
|
|
1
|
+
import ExpressServerTiming, { IExtensionInterface } from './ExpressServerTiming.js';
|
|
2
|
+
import ServerTiming from './ServerTiming.js';
|
|
3
|
+
import ServerTimingElement from './ServerTimingElement.js';
|
|
4
4
|
export { ExpressServerTiming, ServerTimingElement, ServerTiming, IExtensionInterface, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ExpressServerTiming from './ExpressServerTiming';
|
|
2
|
-
import ServerTiming from './ServerTiming';
|
|
3
|
-
import ServerTimingElement from './ServerTimingElement';
|
|
1
|
+
import ExpressServerTiming from './ExpressServerTiming.js';
|
|
2
|
+
import ServerTiming from './ServerTiming.js';
|
|
3
|
+
import ServerTimingElement from './ServerTimingElement.js';
|
|
4
4
|
export { ExpressServerTiming, ServerTimingElement, ServerTiming, };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* @name Kernel Main Module
|
|
3
3
|
* @author David Nagy
|
|
4
4
|
*/
|
|
5
|
-
import Kernel from './Kernel';
|
|
6
|
-
import KernelModule from './KernelModule';
|
|
7
|
-
export * from './actions';
|
|
8
|
-
export * from './api';
|
|
9
|
-
export * from './classes';
|
|
10
|
-
export * from './modules/crypto';
|
|
11
|
-
export * from './lib';
|
|
12
|
-
export * from './lib/express';
|
|
5
|
+
import Kernel from './Kernel.js';
|
|
6
|
+
import KernelModule from './KernelModule.js';
|
|
7
|
+
export * from './actions/index.js';
|
|
8
|
+
export * from './api/index.js';
|
|
9
|
+
export * from './classes/index.js';
|
|
10
|
+
export * from './modules/crypto/index.js';
|
|
11
|
+
export * from './lib/index.js';
|
|
12
|
+
export * from './lib/express.js';
|
|
13
13
|
export * from '@grandlinex/core';
|
|
14
14
|
export { KernelModule, Kernel };
|
|
15
15
|
export default Kernel;
|
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* @name Kernel Main Module
|
|
3
3
|
* @author David Nagy
|
|
4
4
|
*/
|
|
5
|
-
import Kernel from './Kernel';
|
|
6
|
-
import KernelModule from './KernelModule';
|
|
7
|
-
export * from './actions';
|
|
8
|
-
export * from './api';
|
|
9
|
-
export * from './classes';
|
|
10
|
-
export * from './modules/crypto';
|
|
11
|
-
export * from './lib';
|
|
12
|
-
export * from './lib/express';
|
|
5
|
+
import Kernel from './Kernel.js';
|
|
6
|
+
import KernelModule from './KernelModule.js';
|
|
7
|
+
export * from './actions/index.js';
|
|
8
|
+
export * from './api/index.js';
|
|
9
|
+
export * from './classes/index.js';
|
|
10
|
+
export * from './modules/crypto/index.js';
|
|
11
|
+
export * from './lib/index.js';
|
|
12
|
+
export * from './lib/express.js';
|
|
13
13
|
export * from '@grandlinex/core';
|
|
14
14
|
export { KernelModule, Kernel };
|
|
15
15
|
export default Kernel;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ICoreAction, ICoreBridge, ICoreCache, ICoreCClient, ICoreClient, ICoreElement, ICoreKernel, ICoreKernelModule, ICorePresenter, ICoreService, IDataBase } from '@grandlinex/core';
|
|
2
2
|
import express from 'express';
|
|
3
|
-
import
|
|
4
|
-
import { IAuthProvider, JwtToken } from '../classes/
|
|
5
|
-
import {
|
|
6
|
-
import { XNextFc, XRequest, XResponse } from './express';
|
|
3
|
+
import * as jwt from 'jsonwebtoken';
|
|
4
|
+
import { IAuthProvider, JwtToken, IExtensionInterface } from '../classes/index.js';
|
|
5
|
+
import { XNextFc, XRequest, XResponse } from './express.js';
|
|
7
6
|
export type ActionTypes = 'POST' | 'GET' | 'USE' | 'PATCH' | 'DELETE';
|
|
8
7
|
export interface ICClient extends ICoreCClient {
|
|
9
8
|
setAuthProvider(provider: IAuthProvider): boolean;
|
|
10
9
|
jwtVerifyAccessToken(token: string): Promise<JwtToken | number>;
|
|
11
|
-
jwtDecodeAccessToken(token: string): JwtPayload | null;
|
|
10
|
+
jwtDecodeAccessToken(token: string): jwt.JwtPayload | null;
|
|
12
11
|
jwtGenerateAccessToken(data: JwtToken, expire?: string | number): string;
|
|
13
12
|
apiTokenValidation(username: string, token: string, requestType: string): Promise<{
|
|
14
13
|
valid: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { JwtPayload } from 'jsonwebtoken';
|
|
2
1
|
import { CoreCryptoClient } from '@grandlinex/core';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import * as jwt from 'jsonwebtoken';
|
|
3
|
+
import { ICClient, IKernel } from '../../lib/index.js';
|
|
4
|
+
import { IAuthProvider, JwtToken } from '../../classes/index.js';
|
|
5
|
+
import { XRequest } from '../../lib/express.js';
|
|
6
6
|
export default class CryptoClient extends CoreCryptoClient implements ICClient {
|
|
7
7
|
protected authProvider: IAuthProvider | null;
|
|
8
8
|
protected kernel: IKernel;
|
|
@@ -10,7 +10,7 @@ export default class CryptoClient extends CoreCryptoClient implements ICClient {
|
|
|
10
10
|
constructor(key: string, kernel: IKernel);
|
|
11
11
|
setAuthProvider(provider: IAuthProvider): boolean;
|
|
12
12
|
jwtVerifyAccessToken(token: string): Promise<JwtToken | number>;
|
|
13
|
-
jwtDecodeAccessToken(token: string): JwtPayload | null;
|
|
13
|
+
jwtDecodeAccessToken(token: string): jwt.JwtPayload | null;
|
|
14
14
|
jwtGenerateAccessToken(data: JwtToken, expire?: string | number): string;
|
|
15
15
|
apiTokenValidation(username: string, token: string, requestType: string): Promise<{
|
|
16
16
|
valid: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import jwt, { TokenExpiredError } from 'jsonwebtoken';
|
|
2
1
|
import { CoreCryptoClient } from '@grandlinex/core';
|
|
2
|
+
import * as jwt from 'jsonwebtoken';
|
|
3
3
|
export default class CryptoClient extends CoreCryptoClient {
|
|
4
4
|
constructor(key, kernel) {
|
|
5
5
|
super(kernel, key);
|
|
@@ -17,7 +17,7 @@ export default class CryptoClient extends CoreCryptoClient {
|
|
|
17
17
|
jwtVerifyAccessToken(token) {
|
|
18
18
|
return new Promise((resolve) => {
|
|
19
19
|
jwt.verify(token, this.AesKey, (err, user) => {
|
|
20
|
-
if (err instanceof TokenExpiredError) {
|
|
20
|
+
if (err instanceof jwt.TokenExpiredError) {
|
|
21
21
|
resolve(498);
|
|
22
22
|
}
|
|
23
23
|
else if (err || user === null) {
|
|
@@ -30,7 +30,7 @@ export default class CryptoClient extends CoreCryptoClient {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
jwtDecodeAccessToken(token) {
|
|
33
|
-
return jwt.decode(token, { json: true });
|
|
33
|
+
return jwt.default.decode(token, { json: true });
|
|
34
34
|
}
|
|
35
35
|
jwtGenerateAccessToken(data, expire) {
|
|
36
36
|
return jwt.sign(data, this.AesKey, { expiresIn: expire ?? this.expiresIn });
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CryptoClient from './CryptoClient';
|
|
1
|
+
import CryptoClient from './CryptoClient.js';
|
|
2
2
|
export { CryptoClient };
|
|
3
|
-
export * from './utils/cors';
|
|
3
|
+
export * from './utils/cors.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CryptoClient from './CryptoClient';
|
|
1
|
+
import CryptoClient from './CryptoClient.js';
|
|
2
2
|
export { CryptoClient };
|
|
3
|
-
export * from './utils/cors';
|
|
3
|
+
export * from './utils/cors.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { XNextFc, XRequest, XResponse } from '../../../lib/express';
|
|
1
|
+
import { XNextFc, XRequest, XResponse } from '../../../lib/express.js';
|
|
2
2
|
export type CorsMiddleWare = (req: XRequest, res: XResponse, next: XNextFc) => void;
|
|
3
3
|
export declare const cors: CorsMiddleWare;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grandlinex/kernel",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.1",
|
|
4
4
|
"description": "GrandLineX is an out-of-the-box server framework on top of ExpressJs.",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"buildprep": "tsc",
|
|
10
10
|
"lint": "eslint src",
|
|
11
11
|
"test": "jest --runInBand ",
|
|
12
|
-
"run": "ts-node tests/run.ts",
|
|
12
|
+
"run": "ts-node-esm src/tests/run.ts",
|
|
13
13
|
"pack-dev": "npm version -no-git-tag-version prerelease && npm run buildprep && npm pack",
|
|
14
14
|
"test-converage": "jest --runInBand --ci --collectCoverage --coverageDirectory=\"./coverage\" --reporters=default --reporters=jest-junit",
|
|
15
15
|
"makeDocs": "typedoc",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"license": "BSD-3-Clause",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@grandlinex/core": "0.30.
|
|
32
|
+
"@grandlinex/core": "0.30.1",
|
|
33
33
|
"axios": "1.3.4",
|
|
34
34
|
"body-parser": "1.20.2",
|
|
35
35
|
"express": "4.18.2",
|