@byted-apaas/server-sdk-node 1.1.0 → 1.1.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/context/context.d.ts +41 -2
- package/context/context.js +16 -0
- package/context/context.js.map +1 -1
- package/global/application/globalVar/globalVar.d.ts +7 -0
- package/global/application/globalVar/globalVar.js +3 -0
- package/global/application/globalVar/globalVar.js.map +1 -0
- package/package.json +1 -1
package/context/context.d.ts
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
|
+
import { _Resources } from './resources/impl/resources';
|
|
2
|
+
import { Tasks } from './tasks/tasks';
|
|
3
|
+
import { Message } from './msg/msg';
|
|
4
|
+
import { IDBGetter } from './db/db';
|
|
1
5
|
import { Context as CommonContext } from '@byted-apaas/server-common-node';
|
|
2
|
-
|
|
6
|
+
import { IMetaData } from './metadata/metadata';
|
|
7
|
+
import { _IIntegration } from './integration/IIntegration';
|
|
8
|
+
export declare class Context<T, mt, cf, gv> extends CommonContext implements IContext<T, mt, cf, gv> {
|
|
9
|
+
/**
|
|
10
|
+
* 操作数据库中的记录数据
|
|
11
|
+
*/
|
|
12
|
+
db: IDBGetter<T, mt>;
|
|
13
|
+
/**
|
|
14
|
+
* 元数据读写
|
|
15
|
+
*/
|
|
16
|
+
metadata: IMetaData<mt>;
|
|
17
|
+
/**
|
|
18
|
+
* 静态资源类操作
|
|
19
|
+
*/
|
|
20
|
+
resources: _Resources;
|
|
21
|
+
/**
|
|
22
|
+
* 全局函数
|
|
23
|
+
* @param funcName 函数名
|
|
24
|
+
*/
|
|
25
|
+
function(funcName: cf): {
|
|
26
|
+
invoke: (params: any) => Promise<any>;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 任务操作
|
|
30
|
+
*/
|
|
31
|
+
tasks: Tasks<cf>;
|
|
32
|
+
/**
|
|
33
|
+
* 向消息中心推送及更新消息
|
|
34
|
+
*/
|
|
35
|
+
msg: Message;
|
|
36
|
+
/**
|
|
37
|
+
* 根据 apiName 获取对应的全局变量
|
|
38
|
+
* @param apiName 全局变量的 API Name
|
|
39
|
+
*/
|
|
40
|
+
getVar<Key extends keyof gv>(apiName: Key): Promise<gv[Key]>;
|
|
41
|
+
integration: _IIntegration;
|
|
3
42
|
}
|
|
4
|
-
export interface IContext {
|
|
43
|
+
export interface IContext<T, mt, cf, gv> {
|
|
5
44
|
}
|
package/context/context.js
CHANGED
|
@@ -5,6 +5,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.Context = void 0;
|
|
6
6
|
const server_common_node_1 = require("@byted-apaas/server-common-node");
|
|
7
7
|
class Context extends server_common_node_1.Context {
|
|
8
|
+
/**
|
|
9
|
+
* 全局函数
|
|
10
|
+
* @param funcName 函数名
|
|
11
|
+
*/
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
function(funcName) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 根据 apiName 获取对应的全局变量
|
|
18
|
+
* @param apiName 全局变量的 API Name
|
|
19
|
+
*/
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
21
|
+
async getVar(apiName) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
8
24
|
}
|
|
9
25
|
exports.Context = Context;
|
|
10
26
|
//# sourceMappingURL=context.js.map
|
package/context/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["context.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,+BAA+B;;;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["context.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,+BAA+B;;;AAM/B,wEAA0E;AAI1E,MAAa,OAAuB,SAAQ,4BAAa;IAcrD;;;OAGG;IACH,6DAA6D;IAC7D,QAAQ,CAAC,QAAY;QACjB,OAAO,IAAI,CAAC;IAChB,CAAC;IAWD;;;OAGG;IACH,6DAA6D;IAC7D,KAAK,CAAC,MAAM,CAAuB,OAAY;QAC3C,OAAO,IAAI,CAAC;IAChB,CAAC;CAMJ;AA7CD,0BA6CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalVar.js","sourceRoot":"","sources":["globalVar.ts"],"names":[],"mappings":""}
|