@firmer/mesh 0.0.7 → 0.0.9

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.
Files changed (50) hide show
  1. package/dist/mesh.js +7576 -6497
  2. package/dist/mesh.umd.cjs +8 -8
  3. package/dist/psi/builtin.d.ts +10 -11
  4. package/dist/psi/cache.d.ts +15 -5
  5. package/dist/psi/cipher.d.ts +27 -24
  6. package/dist/psi/cluster.d.ts +2 -0
  7. package/dist/psi/commerce.d.ts +4 -0
  8. package/dist/psi/cryptor.d.ts +5 -0
  9. package/dist/psi/daler.d.ts +42 -20
  10. package/dist/psi/datahouse.d.ts +13 -8
  11. package/dist/psi/devops.d.ts +25 -8
  12. package/dist/psi/endpoint.d.ts +2 -2
  13. package/dist/psi/firewall.d.ts +8 -4
  14. package/dist/psi/kms.d.ts +40 -6
  15. package/dist/psi/kv.d.ts +6 -1
  16. package/dist/psi/licenser.d.ts +5 -0
  17. package/dist/psi/locker.d.ts +4 -0
  18. package/dist/psi/network.d.ts +16 -5
  19. package/dist/psi/pipeline.d.ts +7 -9
  20. package/dist/psi/publisher.d.ts +4 -2
  21. package/dist/psi/registry.d.ts +14 -5
  22. package/dist/psi/subscriber.d.ts +1 -3
  23. package/dist/psi/tokenizer.d.ts +7 -2
  24. package/dist/psi/vm.d.ts +6 -0
  25. package/dist/tool/addrs.d.ts +2 -0
  26. package/dist/tool/tool.d.ts +4 -2
  27. package/dist/types/builtin.d.ts +28 -0
  28. package/dist/types/cipher.d.ts +27 -0
  29. package/dist/types/daler.d.ts +97 -8
  30. package/dist/types/devops.d.ts +36 -22
  31. package/dist/types/document.d.ts +11 -0
  32. package/dist/types/entity.d.ts +15 -0
  33. package/dist/types/environ.d.ts +15 -0
  34. package/dist/types/event.d.ts +16 -0
  35. package/dist/types/firewall.d.ts +30 -1
  36. package/dist/types/keys.d.ts +92 -0
  37. package/dist/types/license.d.ts +26 -0
  38. package/dist/types/oauth2.d.ts +36 -0
  39. package/dist/types/payload.d.ts +6 -0
  40. package/dist/types/principal.d.ts +8 -0
  41. package/dist/types/registration.d.ts +97 -0
  42. package/dist/types/route.d.ts +52 -0
  43. package/dist/types/savepoint.d.ts +10 -0
  44. package/dist/types/schema.d.ts +48 -0
  45. package/dist/types/script.d.ts +14 -0
  46. package/dist/types/status.d.ts +3 -0
  47. package/dist/types/transport.d.ts +18 -0
  48. package/dist/types/version.d.ts +2 -0
  49. package/dist/types/workflow.d.ts +43 -0
  50. package/package.json +7 -7
@@ -3,33 +3,32 @@ import { Versions } from '../types';
3
3
  export declare abstract class Builtin {
4
4
  /**
5
5
  * Doc export the documents.
6
- *
7
- * Parameters:
8
- * name - mesh.name
9
- * formatter - document formatter
10
- * formatted - document
11
- * Returns:
12
- * formatted document
6
+ * 按格式导出文档.
13
7
  */
14
8
  doc(name: string, formatter: string, ctx?: Context): Promise<string>;
15
9
  /**
16
- * Version will get the builtin application version.
10
+ * Version get the builtin application version.
11
+ * 内置的应用版本信息.
17
12
  */
18
13
  version(ctx?: Context): Promise<Versions>;
19
14
  /**
20
- * Debug set the application log level.
15
+ * Debug set the application debug features like log.level=126.
16
+ * 设置应用调试信息,如日志级别log.level.
21
17
  */
22
18
  debug(features: Record<string, string>, ctx?: Context): Promise<void>;
23
19
  /**
24
- * Stats will collect health check stats.
20
+ * Stats collect health check stats.
21
+ * 收集应用状态信息并输出.
25
22
  */
26
23
  stats(features: string[], ctx?: Context): Promise<Record<string, string>>;
27
24
  /**
28
- * Fallback is fallback service
25
+ * Fallback is fallback service.
26
+ * GRPC降级服务能力,用于一些状态的降级,用于返回给客户端结构化数据结果.
29
27
  */
30
28
  fallback(ctx?: Context): Promise<void>;
31
29
  /**
32
30
  * Dump the application data.
31
+ * 导出应用相关数据用于分析应用运行情况.
33
32
  */
34
33
  dump(names: string[], ctx?: Context): Promise<Record<string, string>>;
35
34
  }
@@ -3,42 +3,52 @@ import { CacheBody } from '../types';
3
3
  export declare abstract class Cache {
4
4
  /**
5
5
  * Get the value from cache.
6
+ * 从缓存中取数据.
6
7
  */
7
8
  get(key: string, ctx?: Context): Promise<CacheBody>;
8
9
  /**
9
10
  * Put the value to cache.
11
+ * 写入数据到缓存.
10
12
  */
11
13
  put(cell: CacheBody, ctx?: Context): Promise<void>;
12
14
  /**
13
15
  * Remove the cache value.
16
+ * 从缓存删除数据.
14
17
  */
15
18
  remove(key: string, ctx?: Context): Promise<void>;
16
19
  /**
17
20
  * Incr the cache of expire time.
21
+ * 缓存计数器增加计数.
18
22
  */
19
23
  incr(key: string, value: number, ctx?: Context): Promise<number>;
20
24
  /**
21
25
  * Decr the cache of expire time.
26
+ * 缓存计数器减少计数.
22
27
  */
23
28
  decr(key: string, value: number, ctx?: Context): Promise<number>;
24
29
  /**
25
- * Keys the cache key set.
30
+ * Keys return the cache key set.
31
+ * 获取缓存中的KEY集合.
26
32
  */
27
33
  keys(pattern: string, ctx?: Context): Promise<string[]>;
28
34
  /**
29
- * HGet get value in hash
35
+ * HGet get value in hashtable.
36
+ * 从缓存哈希表中取值.
30
37
  */
31
38
  hget(key: string, name: string, ctx?: Context): Promise<CacheBody>;
32
39
  /**
33
- * HSet put value in hash
40
+ * HSet put value in hashtable.
41
+ * 从缓存哈希表中写值.
34
42
  */
35
43
  hset(key: string, cell: CacheBody, ctx?: Context): Promise<void>;
36
44
  /**
37
- * HDel put value in hash
45
+ * HDel del value in hashtable.
46
+ * 从缓存哈希表中删除值.
38
47
  */
39
48
  hdel(key: string, name: string, ctx?: Context): Promise<void>;
40
49
  /**
41
- * HKeys get the hash keys
50
+ * HKeys get the hash keys.
51
+ * 从缓存哈希表中获取KEY集合.
42
52
  */
43
53
  hkeys(key: string, ctx?: Context): Promise<string[]>;
44
54
  }
@@ -1,68 +1,71 @@
1
1
  import { Context } from './context';
2
- import { CipherEntity, CipherHello, CipherKey, CipherKeygen, CipherObject, CipherRegen, CipherSuite, CipherTxEntity, Keys, Page, Paging } from '../types';
2
+ import { CipherEntity, CipherHello, CipherKey, CipherKeygen, CipherObject, CipherRegen, CipherSuite, CipherTxEntity, Keys, Page, Paging, Script } from '../types';
3
3
  export declare abstract class CipherEconomy {
4
4
  /**
5
5
  * Handshake negotiate multiparty cipher keys.
6
- *
7
- * Parameters:
8
- * - hello: hello
9
- * Returns:
10
- * - string cipher group
6
+ * 多方密钥协商握手.
11
7
  */
12
8
  handshake(hello: CipherHello, ctx?: Context): Promise<string>;
13
9
  /**
14
10
  * Collect cipher objects with group. Asyncable can be invoked by multi times.
15
- *
16
- * Parameters:
17
- * - obj: obj
18
- * Returns:
19
- * - int 1 for success, 0 for failed
11
+ * 中心化归集多方密钥加密的密态数据包(胶囊)用于中心化密态计算(重加密/重匿名/全同态等)
20
12
  */
21
13
  collect(obj: CipherObject, ctx?: Context): Promise<number>;
22
14
  /**
23
- * Serve will Encrypt or Anonymize
15
+ * Serve will Encrypt or Anonymize.
16
+ * 提供加密或匿名服务托管能力,会把对应的密态服务发布为一个服务接口.
24
17
  */
25
18
  serve(suite: string, ctx?: Context): Promise<string>;
26
19
  /**
27
- * Deposit cipher object deposit
20
+ * Deposit cipher object deposit.
21
+ * 密态数据包(胶囊)归档到密态数据胶囊中心仓库.
28
22
  */
29
23
  deposit(rco: CipherObject, ctx?: Context): Promise<string>;
30
24
  /**
31
- * Objects cipher object index
25
+ * Objects cipher object index.
26
+ * 分页检索仓库中的密态数据胶囊.
32
27
  */
33
- objects(index: Paging, ctx?: Context): Promise<Page<CipherObject>>;
28
+ objects(idx: Paging, ctx?: Context): Promise<Page<CipherObject>>;
34
29
  /**
35
- * Keys key index
30
+ * Keys key index.
31
+ * 分页检索仓库中的密态数据胶囊ID,即Manifest列表检索.
36
32
  */
37
33
  keys(idx: Paging, ctx?: Context): Promise<Page<Keys>>;
38
34
  /**
39
- * Invoke
35
+ * Invoke the script in cipher objects.
36
+ * 在密态数据包上执行计算脚本,SQL等.
40
37
  */
41
- invoke(index: Paging, ctx?: Context): Promise<Uint8Array>;
38
+ invoke(script: Script, ctx?: Context): Promise<Uint8Array>;
42
39
  }
43
40
  export declare abstract class CipherProvider {
44
41
  /**
45
- * Suite
42
+ * Suite cipher suite in local party.
43
+ * 产生本方密钥协商套件.
46
44
  */
47
45
  suite(hello: CipherHello, ctx?: Context): Promise<CipherSuite>;
48
46
  /**
49
- * Keygen
47
+ * Keygen generate first phase keys.
48
+ * 协商签发第一阶段密钥,各方只提供自己的公钥或公钥片段.
50
49
  */
51
50
  keygen(keygen: CipherKeygen, ctx?: Context): Promise<CipherKey>;
52
51
  /**
53
- * Regen
52
+ * Regen generate second phase keys.
53
+ * 协商签发第二阶段密钥,各方只提供自己的公钥或公钥片段.
54
54
  */
55
55
  regen(keygen: CipherRegen, ctx?: Context): Promise<CipherKey>;
56
56
  /**
57
- * Encode
57
+ * Encode the data object, actual encrypt or anonymize.
58
+ * 数据编码,实际根据不同的密态场景底层可能是加密或匿名化.
58
59
  */
59
60
  encode(explain: CipherEntity, ctx?: Context): Promise<Uint8Array>;
60
61
  /**
61
- * Decode
62
+ * Decode the data object, actual dencrypt or deanonymize.
63
+ * 数据解码,实际根据不同的密态场景底层可能是解密或去匿名化.
62
64
  */
63
65
  decode(cipher: CipherEntity, ctx?: Context): Promise<Uint8Array>;
64
66
  /**
65
- * Recode
67
+ * Recode the data object, actual rencrypt or reanonymize.
68
+ * 数据重编码,实际根据不同的密态场景底层可能是重加密或重匿名.
66
69
  */
67
70
  recode(cipher: CipherTxEntity, ctx?: Context): Promise<Uint8Array>;
68
71
  }
@@ -2,10 +2,12 @@ import { Context } from './context';
2
2
  export declare abstract class Cluster {
3
3
  /**
4
4
  * Election will election leader of instances.
5
+ * 集群选主服务.
5
6
  */
6
7
  election(buff: Uint8Array, ctx?: Context): Promise<Uint8Array>;
7
8
  /**
8
9
  * IsLeader if same level.
10
+ * 判断自己是否Leader.
9
11
  */
10
12
  isLeader(ctx?: Context): Promise<boolean>;
11
13
  }
@@ -3,18 +3,22 @@ import { CommerceEnviron, CommerceLicense, License } from '../types';
3
3
  export declare abstract class Commercialize {
4
4
  /**
5
5
  * Sign license, only glab has permission to sign.
6
+ * 签发许可证书.
6
7
  */
7
8
  sign(lsr: License, ctx?: Context): Promise<CommerceLicense>;
8
9
  /**
9
10
  * History list the sign license in history, the latest is the first index.
11
+ * 查询历史签发许可证书列表.
10
12
  */
11
13
  history(instId: string, ctx?: Context): Promise<CommerceLicense[]>;
12
14
  /**
13
15
  * Issued mesh node identity.
16
+ * 签发节点身份证.
14
17
  */
15
18
  issued(name: string, kind: string, cname: string, ctx?: Context): Promise<CommerceEnviron>;
16
19
  /**
17
20
  * Dump the node identity.
21
+ * 导出所有的节点身份证.
18
22
  */
19
23
  dump(nodeId: string, ctx?: Context): Promise<CommerceEnviron[]>;
20
24
  }
@@ -2,22 +2,27 @@ import { Context } from './context';
2
2
  export declare abstract class Cryptor {
3
3
  /**
4
4
  * Encrypt binary to encrypted binary.
5
+ * 加密二进制数据.
5
6
  */
6
7
  encrypt(buf: Uint8Array, keys: Record<string, Uint8Array>, ctx?: Context): Promise<Uint8Array>;
7
8
  /**
8
9
  * Decrypt binary to decrypted binary.
10
+ * 解密二进制数据.
9
11
  */
10
12
  decrypt(buf: Uint8Array, keys: Record<string, Uint8Array>, ctx?: Context): Promise<Uint8Array>;
11
13
  /**
12
14
  * Hash compute the hash value.
15
+ * 对二进制数据计算摘要.
13
16
  */
14
17
  hash(buf: Uint8Array, keys: Record<string, Uint8Array>, ctx?: Context): Promise<Uint8Array>;
15
18
  /**
16
19
  * Sign compute the signature value.
20
+ * 对二进制数据计算签名.
17
21
  */
18
22
  sign(buf: Uint8Array, keys: Record<string, Uint8Array>, ctx?: Context): Promise<Uint8Array>;
19
23
  /**
20
24
  * Verify the signature value.
25
+ * 对二进制数据摘要验签.
21
26
  */
22
27
  verify(buf: Uint8Array, keys: Record<string, Uint8Array>, ctx?: Context): Promise<boolean>;
23
28
  }
@@ -2,71 +2,93 @@ import { Context } from './context';
2
2
  import { DalerBinlog, DalerCluster, DalerDTSJob, DalerSource, DalerTest, Page, Paging } from '../types';
3
3
  export declare abstract class Daler {
4
4
  /**
5
- * Query
5
+ * Query execute the script in on datasource.
6
+ * 在数据源上执行计算脚本.
6
7
  */
7
8
  query(test: DalerTest, ctx?: Context): Promise<any>;
8
9
  /**
9
- * SaveSource
10
+ * SaveSource save datasource.
11
+ * 保存数据源.
10
12
  */
11
13
  saveSource(ds: DalerSource, ctx?: Context): Promise<string>;
12
14
  /**
13
- * IndexSource
15
+ * IndexSource index datasource.
16
+ * 分页检索数据源.
14
17
  */
15
18
  indexSource(idx: Paging, ctx?: Context): Promise<Page<DalerSource>>;
16
19
  /**
17
- * DescribeSource
20
+ * DescribeSource describe the datasource.
21
+ * 获取数据源详情.
18
22
  */
19
23
  describeSource(id: string, ctx?: Context): Promise<DalerSource>;
20
24
  /**
21
- * RemoveSource
25
+ * RemoveSource remove the datasource.
26
+ * 删除数据源.
22
27
  */
23
28
  removeSource(id: string, ctx?: Context): Promise<void>;
24
29
  /**
25
- * SaveCluster
30
+ * SaveCluster save data cluster.
31
+ * 保存数据源集群.
26
32
  */
27
33
  saveCluster(cluster: DalerCluster, ctx?: Context): Promise<string>;
28
34
  /**
29
- * IndexCluster
35
+ * IndexCluster index data cluster.
36
+ * 分页检索数据集群.
30
37
  */
31
38
  indexCluster(idx: Paging, ctx?: Context): Promise<Page<DalerCluster>>;
32
39
  /**
33
- * DescribeCluster
40
+ * DescribeCluster describe data cluster.
41
+ * 获取数据集群详情.
34
42
  */
35
43
  describeCluster(id: string, ctx?: Context): Promise<DalerCluster>;
36
44
  /**
37
- * RemoveCluster
45
+ * RemoveCluster remove data cluster.
46
+ * 删除数据集群.
38
47
  */
39
48
  removeCluster(id: string, ctx?: Context): Promise<void>;
40
49
  /**
41
- * SaveDTS
50
+ * DeployCluster deploy data cluster as tcp service.
51
+ * 把数据集群发布为TCP服务,用于客户端链接数据集群.
52
+ */
53
+ deployCluster(id: string, ctx?: Context): Promise<void>;
54
+ /**
55
+ * SaveDTS dave data transfer service.
56
+ * 保存数据同步传输服务.
42
57
  */
43
58
  saveDTS(dts: DalerDTSJob, ctx?: Context): Promise<string>;
44
59
  /**
45
- * RunDTS
60
+ * RunDTS run data transfer service once.
61
+ * 运行一次数据同步服务.
46
62
  */
47
63
  runDTS(id: string, ctx?: Context): Promise<void>;
48
64
  /**
49
- * IndexDTS
65
+ * IndexDTS index data transfer service.
66
+ * 分页检索数据同步服务.
50
67
  */
51
68
  indexDTS(idx: Paging, ctx?: Context): Promise<Page<DalerDTSJob>>;
52
69
  /**
53
- * RemoveDTS
70
+ * RemoveDTS remove data transfer service.
71
+ * 删除数据同步服务.
54
72
  */
55
73
  removeDTS(id: string, ctx?: Context): Promise<void>;
56
74
  /**
57
- * ToggleDTS
58
- */
59
- toggleDTS(id: string, ctx?: Context): Promise<void>;
60
- /**
61
- * IndexBinlog
75
+ * IndexBinlog index data cluster binlog.
76
+ * 分页检索数据集群binlog.
62
77
  */
63
78
  indexBinlog(idx: Paging, ctx?: Context): Promise<Page<DalerBinlog>>;
64
79
  /**
65
- * TailBinlog
80
+ * TailBinlog tail binlog information.
81
+ * 查看binlog详情.
66
82
  */
67
83
  tailBinlog(idx: Paging, ctx?: Context): Promise<Page<Record<string, string>>>;
68
84
  /**
69
- * RedoBinlog
85
+ * RedoBinlog redo binlog.
86
+ * 重做binlog,实际是fallback.log.
70
87
  */
71
88
  redoBinlog(id: string, ctx?: Context): Promise<void>;
89
+ /**
90
+ * RemoveBinlog remove binlog.
91
+ * 删除binlog,实际是fallback.log.
92
+ */
93
+ removeBinlog(id: string, ctx?: Context): Promise<void>;
72
94
  }
@@ -2,23 +2,28 @@ import { Context } from './context';
2
2
  import { Document, Page, Paging } from '../types';
3
3
  export declare abstract class DataHouse {
4
4
  /**
5
- * Writes
5
+ * Writes bigdata to data house.
6
+ * 大数据批量写入.
6
7
  */
7
8
  writes(docs: Document[], ctx?: Context): Promise<void>;
8
9
  /**
9
- * Write
10
+ * Write bigdata to data house.
11
+ * 大数据单文档写入.
10
12
  */
11
13
  write(doc: Document, ctx?: Context): Promise<void>;
12
14
  /**
13
- * Read
15
+ * Read bigdata from data house.
16
+ * 大数据批量读.
14
17
  */
15
- read(index: Paging, ctx?: Context): Promise<Page<any>>;
18
+ read(idx: Paging, ctx?: Context): Promise<Page<any>>;
16
19
  /**
17
- * Indies
20
+ * Indies bigdata manifest index.
21
+ * 读取大数据索引明细.
18
22
  */
19
- indies(index: Paging, ctx?: Context): Promise<Page<any>>;
23
+ indies(idx: Paging, ctx?: Context): Promise<Page<any>>;
20
24
  /**
21
- * Tables
25
+ * Tables bigdata tables.
26
+ * 读取大数据存储表信息.
22
27
  */
23
- tables(index: Paging, ctx?: Context): Promise<Page<any>>;
28
+ tables(idx: Paging, ctx?: Context): Promise<Page<any>>;
24
29
  }
@@ -2,31 +2,48 @@ import { Context } from './context';
2
2
  import { Page, Paging, Replica, Settings } from '../types';
3
3
  export declare abstract class Devops {
4
4
  /**
5
- * Init
5
+ * Init the system data.
6
+ * 初始化系统数据.
6
7
  */
7
8
  init(flags: string, ctx?: Context): Promise<void>;
8
9
  /**
9
- * Settings
10
+ * Settings get the system settings.
11
+ * 获取系统设置信息,这是一个通用接口,可以设置所有的应用设置信息.
10
12
  */
11
13
  settings(ctx?: Context): Promise<Record<string, Settings>>;
12
14
  /**
13
- * Setting
15
+ * Setting write the system settings.
16
+ * 覆盖系统设置信息,按appset进行覆盖.
14
17
  */
15
18
  setting(appset: string, setting: Settings, ctx?: Context): Promise<void>;
16
19
  /**
17
- * IndexReplica
20
+ * IndexReplica index system data backups.
21
+ * 分页检索系统备份数据.
18
22
  */
19
23
  indexReplica(idx: Paging, ctx?: Context): Promise<Page<Replica>>;
20
24
  /**
21
- * ImportReplica
25
+ * ImportReplica import system data backup.
26
+ * 导入系统备份.
22
27
  */
23
28
  importReplica(raw: Uint8Array, ctx?: Context): Promise<string>;
24
29
  /**
25
- * Replicate
30
+ * RemoveReplica remove system data backup.
31
+ * 删除系统备份.
32
+ */
33
+ removeReplica(code: string, ctx?: Context): Promise<void>;
34
+ /**
35
+ * ReadReplica read system data backup.
36
+ * 读取系统备份.
37
+ */
38
+ readReplica(code: string, ctx?: Context): Promise<Uint8Array>;
39
+ /**
40
+ * Replicate make a system data backup.
41
+ * 按应用备份系统数据.
26
42
  */
27
43
  replicate(appset: string, ctx?: Context): Promise<string>;
28
44
  /**
29
- * Recover
45
+ * Recover recover backup.
46
+ * 备份数据恢复.
30
47
  */
31
- recover(id: string, ctx?: Context): Promise<string>;
48
+ recover(id: string, ctx?: Context): Promise<void>;
32
49
  }
@@ -1,8 +1,8 @@
1
1
  import { Context } from './context';
2
2
  export declare abstract class Endpoint {
3
3
  /**
4
- * Fuzzy call with generic param
5
- * In multi returns, it's an array.
4
+ * Fuzzy call with generic param, In multi returns, it's an array.
5
+ * MPI泛化实现,对于无API声明服务场景提供服务直接调用能力,典型扩展点调用模式.
6
6
  */
7
7
  fuzzy(buff: Uint8Array, ctx?: Context): Promise<Uint8Array>;
8
8
  }
@@ -2,19 +2,23 @@ import { Context } from './context';
2
2
  import { Firewall, Page, Paging } from '../types';
3
3
  export declare abstract class Firewalld {
4
4
  /**
5
- * Save 保存防火墙规则,支持保存包括黑白名单、限流熔断等逻辑.
5
+ * Save the firewalld rules.
6
+ * 保存防火墙规则,支持保存包括黑白名单、限流熔断等逻辑.
6
7
  */
7
8
  save(wall: Firewall, ctx?: Context): Promise<string>;
8
9
  /**
9
- * Remove 删除防火墙规则.
10
+ * Remove the firewalld rule.
11
+ * 删除防火墙规则.
10
12
  */
11
13
  remove(code: string, ctx?: Context): Promise<void>;
12
14
  /**
13
- * Describe 查看防火墙规则.
15
+ * Describe the firewalld rule.
16
+ * 查看防火墙规则.
14
17
  */
15
18
  describe(code: string, ctx?: Context): Promise<Firewall>;
16
19
  /**
17
- * Index 分页查看防火墙规则.
20
+ * Index the firewalld rules.
21
+ * 分页查看防火墙规则.
18
22
  */
19
23
  index(idx: Paging, ctx?: Context): Promise<Page<Firewall>>;
20
24
  }
package/dist/psi/kms.d.ts CHANGED
@@ -1,40 +1,74 @@
1
1
  import { Context } from './context';
2
- import { CrtRevokeRequest, CrtRotateRequest, Environ, KeyCsr, Keys, Page, Paging } from '../types';
2
+ import { CrtRevokeRequest, CrtRotateRequest, Environ, KeyCsr, Keys, Page, Paging, SecretCsr, SecretKey } from '../types';
3
3
  export declare abstract class KMS {
4
4
  /**
5
5
  * Reset will override the keystore environ.
6
+ * 重置MESH网络中当前节点的环境信息.
6
7
  */
7
8
  reset(env: Environ, ctx?: Context): Promise<void>;
8
9
  /**
9
10
  * Environ will return the keystore environ.
11
+ * 获取MESH网络中当前节点的环境信息.
10
12
  */
11
13
  environ(ctx?: Context): Promise<Environ>;
12
14
  /**
13
15
  * Issue will apply the certification.
16
+ * 签发证书,签发根证书和通信证书均使用该接口.
14
17
  */
15
18
  issue(csr: KeyCsr, ctx?: Context): Promise<Keys>;
19
+ /**
20
+ * Describe will return the keys by code.
21
+ * 检索KMS中存储的证书详情.
22
+ */
23
+ describe(id: string, ctx?: Context): Promise<Keys>;
16
24
  /**
17
25
  * Index will return the keystore environ.
26
+ * 分页检索KMS中存储的所有证书列表.
18
27
  */
19
28
  index(idx: Paging, ctx?: Context): Promise<Page<Keys>>;
20
29
  /**
21
- * Revoke will revoke the keys
30
+ * Revoke will revoke the keys.
31
+ * 撤销证书.
22
32
  */
23
33
  revoke(crr: CrtRevokeRequest, ctx?: Context): Promise<void>;
24
34
  /**
25
- * Rotate will rotate the keys
35
+ * Rotate will rotate the keys.
36
+ * 证书轮换.
26
37
  */
27
38
  rotate(crr: CrtRotateRequest, ctx?: Context): Promise<void>;
28
39
  /**
29
- * Remove
40
+ * Remove the keys.
41
+ * 证书删除.
30
42
  */
31
43
  remove(id: string, ctx?: Context): Promise<void>;
32
44
  /**
33
- * Append
45
+ * Append the keys.
46
+ * 上传证书.
34
47
  */
35
48
  append(car: Keys, ctx?: Context): Promise<void>;
36
49
  /**
37
- * Explain
50
+ * Explain the keys.
51
+ * 证书解释.
38
52
  */
39
53
  explain(algo: string, keys: string, ctx?: Context): Promise<string>;
54
+ /**
55
+ * IndexSecret the crypt keys.
56
+ * 分页检索密钥列表.
57
+ */
58
+ indexSecret(idx: Paging, ctx?: Context): Promise<Page<SecretKey>>;
59
+ /**
60
+ * RemoveSecret the crypt keys.
61
+ * 删除密钥.
62
+ */
63
+ removeSecret(id: string, ctx?: Context): Promise<void>;
64
+ /**
65
+ * DescribeSecret the crypt keys.
66
+ * 删除密钥.
67
+ */
68
+ describeSecret(id: string, ctx?: Context): Promise<SecretKey>;
69
+ /**
70
+ * GenerateSecret the crypt keys.
71
+ * 生成密钥.
72
+ */
73
+ generateSecret(csr: SecretCsr, ctx?: Context): Promise<string>;
40
74
  }
package/dist/psi/kv.d.ts CHANGED
@@ -3,22 +3,27 @@ import { Body, Entry, Page, Paging } from '../types';
3
3
  export declare abstract class KV {
4
4
  /**
5
5
  * Get the value from kv store.
6
+ * 从KV存储读值.
6
7
  */
7
8
  get(key: string, ctx?: Context): Promise<Body>;
8
9
  /**
9
10
  * Put the value to kv store.
11
+ * 从KV写入值.
10
12
  */
11
13
  put(key: string, value: Body, ctx?: Context): Promise<void>;
12
14
  /**
13
15
  * Remove the kv store.
16
+ * 从KV删除值.
14
17
  */
15
18
  remove(key: string, ctx?: Context): Promise<void>;
16
19
  /**
17
20
  * Keys with the pattern of kv store.
21
+ * 检索KV存储中的所有KEY.
18
22
  */
19
23
  keys(pattern: string, ctx?: Context): Promise<string[]>;
20
24
  /**
21
25
  * Index the kv for webui
26
+ * 分页检索KV存储内容.
22
27
  */
23
- index(index: Paging, ctx?: Context): Promise<Page<Entry>>;
28
+ index(idx: Paging, ctx?: Context): Promise<Page<Entry>>;
24
29
  }
@@ -3,22 +3,27 @@ import { License } from '../types';
3
3
  export declare abstract class Licenser {
4
4
  /**
5
5
  * Imports the licenses.
6
+ * 导入许可证书.
6
7
  */
7
8
  imports(license: string, ctx?: Context): Promise<void>;
8
9
  /**
9
10
  * Exports the licenses.
11
+ * 导出许可证书.
10
12
  */
11
13
  exports(ctx?: Context): Promise<string>;
12
14
  /**
13
15
  * Explain the license.
16
+ * 解释许可证书.
14
17
  */
15
18
  explain(ctx?: Context): Promise<License>;
16
19
  /**
17
20
  * Verify the license.
21
+ * 验证许可证书.
18
22
  */
19
23
  verify(ctx?: Context): Promise<number>;
20
24
  /**
21
25
  * Features is license features.
26
+ * 查询系统提供的证书签发因子.
22
27
  */
23
28
  features(ctx?: Context): Promise<Record<string, string>>;
24
29
  }
@@ -2,18 +2,22 @@ import { Context } from './context';
2
2
  export declare abstract class Locker {
3
3
  /**
4
4
  * Lock create write lock.
5
+ * 按ID加写锁.
5
6
  */
6
7
  lock(rid: string, timeout: number, ctx?: Context): Promise<boolean>;
7
8
  /**
8
9
  * Unlock release write lock.
10
+ * 按ID解写锁.
9
11
  */
10
12
  unlock(rid: string, ctx?: Context): Promise<void>;
11
13
  /**
12
14
  * ReadLock create read lock.
15
+ * 按ID加读锁.
13
16
  */
14
17
  readLock(rid: string, timeout: number, ctx?: Context): Promise<boolean>;
15
18
  /**
16
19
  * ReadUnlock release read lock.
20
+ * 按ID解读锁.
17
21
  */
18
22
  readUnlock(rid: string, ctx?: Context): Promise<void>;
19
23
  }