@firmer/mesh 0.0.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/README.md +24 -0
- package/dist/asm/index.d.ts +11 -0
- package/dist/cause/codeable.d.ts +5 -0
- package/dist/cause/errors.d.ts +1 -0
- package/dist/cause/index.d.ts +3 -0
- package/dist/cause/status.d.ts +46 -0
- package/dist/codec/codec.d.ts +43 -0
- package/dist/codec/index.d.ts +2 -0
- package/dist/codec/json.d.ts +12 -0
- package/dist/grpc/consumer.d.ts +8 -0
- package/dist/grpc/index.d.ts +3 -0
- package/dist/grpc/interceptor.d.ts +2 -0
- package/dist/grpc/provider.d.ts +5 -0
- package/dist/http/consumer.d.ts +12 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/http/provider.d.ts +5 -0
- package/dist/index.d.ts +116 -0
- package/dist/macro/ark.d.ts +84 -0
- package/dist/macro/binding.d.ts +1 -0
- package/dist/macro/dsa.d.ts +20 -0
- package/dist/macro/env.d.ts +43 -0
- package/dist/macro/idx.d.ts +12 -0
- package/dist/macro/index.d.ts +10 -0
- package/dist/macro/inspector.d.ts +144 -0
- package/dist/macro/loader.d.ts +15 -0
- package/dist/macro/mpi.d.ts +21 -0
- package/dist/macro/mps.d.ts +12 -0
- package/dist/macro/spi.d.ts +13 -0
- package/dist/mesh.d.ts +2 -0
- package/dist/mesh.js +11088 -0
- package/dist/mesh.umd.cjs +24 -0
- package/dist/mpc/compiler.d.ts +23 -0
- package/dist/mpc/consumer.d.ts +28 -0
- package/dist/mpc/consumer_filter.d.ts +6 -0
- package/dist/mpc/context.d.ts +33 -0
- package/dist/mpc/eden.d.ts +44 -0
- package/dist/mpc/execution.d.ts +74 -0
- package/dist/mpc/filter.d.ts +19 -0
- package/dist/mpc/hook.d.ts +23 -0
- package/dist/mpc/index.d.ts +16 -0
- package/dist/mpc/invoker.d.ts +57 -0
- package/dist/mpc/mesh.d.ts +42 -0
- package/dist/mpc/mesh_eden.d.ts +25 -0
- package/dist/mpc/mock.d.ts +7 -0
- package/dist/mpc/provider.d.ts +10 -0
- package/dist/mpc/proxy.d.ts +6 -0
- package/dist/mpc/reference.d.ts +21 -0
- package/dist/mpc/service.d.ts +7 -0
- package/dist/mpc/urn.d.ts +32 -0
- package/dist/psi/builtin.d.ts +49 -0
- package/dist/psi/cache.d.ts +44 -0
- package/dist/psi/cipher.d.ts +73 -0
- package/dist/psi/cluster.d.ts +11 -0
- package/dist/psi/commerce.d.ts +20 -0
- package/dist/psi/context.d.ts +148 -0
- package/dist/psi/cryptor.d.ts +23 -0
- package/dist/psi/datahouse.d.ts +24 -0
- package/dist/psi/dispatcher.d.ts +13 -0
- package/dist/psi/endpoint.d.ts +14 -0
- package/dist/psi/evaluator.d.ts +20 -0
- package/dist/psi/graph.d.ts +11 -0
- package/dist/psi/index.d.ts +29 -0
- package/dist/psi/kms.d.ts +20 -0
- package/dist/psi/kv.d.ts +24 -0
- package/dist/psi/licenser.d.ts +24 -0
- package/dist/psi/locker.d.ts +19 -0
- package/dist/psi/network.d.ts +49 -0
- package/dist/psi/pipeline.d.ts +28 -0
- package/dist/psi/publisher.d.ts +12 -0
- package/dist/psi/registry.d.ts +20 -0
- package/dist/psi/routable.d.ts +37 -0
- package/dist/psi/savepoint.d.ts +24 -0
- package/dist/psi/scheduler.d.ts +47 -0
- package/dist/psi/sequence.d.ts +20 -0
- package/dist/psi/subscriber.d.ts +11 -0
- package/dist/psi/tokenizer.d.ts +48 -0
- package/dist/psi/transport.d.ts +33 -0
- package/dist/psi/vfs.d.ts +32 -0
- package/dist/psi/workflow.d.ts +35 -0
- package/dist/schema/citizen.d.ts +25 -0
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/schema.d.ts +2 -0
- package/dist/system/index.d.ts +1 -0
- package/dist/system/mesh_network.d.ts +15 -0
- package/dist/test/network.test.d.ts +4 -0
- package/dist/tool/addrs.d.ts +11 -0
- package/dist/tool/index.d.ts +3 -0
- package/dist/tool/table.d.ts +7 -0
- package/dist/tool/tool.d.ts +31 -0
- package/dist/types/builtin.d.ts +121 -0
- package/dist/types/cipher.d.ts +111 -0
- package/dist/types/document.d.ts +34 -0
- package/dist/types/entity.d.ts +59 -0
- package/dist/types/enums.d.ts +2 -0
- package/dist/types/environ.d.ts +52 -0
- package/dist/types/event.d.ts +55 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/keys.d.ts +41 -0
- package/dist/types/license.d.ts +111 -0
- package/dist/types/oauth2.d.ts +138 -0
- package/dist/types/payload.d.ts +29 -0
- package/dist/types/principal.d.ts +35 -0
- package/dist/types/registration.d.ts +114 -0
- package/dist/types/route.d.ts +90 -0
- package/dist/types/savepoint.d.ts +34 -0
- package/dist/types/script.d.ts +26 -0
- package/dist/types/status.d.ts +13 -0
- package/dist/types/transport.d.ts +40 -0
- package/dist/types/version.d.ts +10 -0
- package/dist/types/workflow.d.ts +190 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Mesh TypeScript Client
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/ducesoft/babel)
|
|
4
|
+
[](https://opencollective.com/babel) [](https://codecov.io/gh/babel/babel)
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
中文版 [README](README_CN.md)
|
|
8
|
+
|
|
9
|
+
## Introduction
|
|
10
|
+
|
|
11
|
+
Mesh TypeScript client develop kits.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cargo install git.firmer.tech/firmer/mesh/client/rust
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
Any
|
|
20
|
+
|
|
21
|
+
## Get Started
|
|
22
|
+
|
|
23
|
+
Java
|
|
24
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from '../cause';
|
|
2
|
+
export * from '../codec';
|
|
3
|
+
export * from '../grpc';
|
|
4
|
+
export * from '../http';
|
|
5
|
+
export * from '../macro';
|
|
6
|
+
export * from '../mpc';
|
|
7
|
+
export * from '../psi';
|
|
8
|
+
export * from '../schema';
|
|
9
|
+
export * from '../system';
|
|
10
|
+
export * from '../tool';
|
|
11
|
+
export * from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function errorf(e: any): Error;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Codeable } from './codeable';
|
|
2
|
+
export declare class MeshCode extends Error implements Codeable {
|
|
3
|
+
constructor(code: string, message: string);
|
|
4
|
+
readonly code: string;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
getCode(): string;
|
|
7
|
+
getMessage(): string;
|
|
8
|
+
}
|
|
9
|
+
export declare class Status {
|
|
10
|
+
static SUCCESS: MeshCode;
|
|
11
|
+
static NOT_FOUND: MeshCode;
|
|
12
|
+
static SYSTEM_ERROR: MeshCode;
|
|
13
|
+
static SERVICE_UNAVAILABLE: MeshCode;
|
|
14
|
+
static VALIDATE: MeshCode;
|
|
15
|
+
static UNAUTHORIZED: MeshCode;
|
|
16
|
+
static UNKNOWN: MeshCode;
|
|
17
|
+
static COMPATIBLE: MeshCode;
|
|
18
|
+
static TIMEOUT: MeshCode;
|
|
19
|
+
static NO_PROVIDER: MeshCode;
|
|
20
|
+
static CRYPT_ERROR: MeshCode;
|
|
21
|
+
static TOKEN_EXPIRE: MeshCode;
|
|
22
|
+
static NET_EXPIRE: MeshCode;
|
|
23
|
+
static NET_DISABLE: MeshCode;
|
|
24
|
+
static NET_UNAVAILABLE: MeshCode;
|
|
25
|
+
static LICENSE_FORMAT_ERROR: MeshCode;
|
|
26
|
+
static LICENSE_EXPIRED: MeshCode;
|
|
27
|
+
static MAX_REPLICAS_LIMIT: MeshCode;
|
|
28
|
+
static MAX_COOP_LIMIT: MeshCode;
|
|
29
|
+
static MAX_TENANT_LIMIT: MeshCode;
|
|
30
|
+
static MAX_USER_LIMIT: MeshCode;
|
|
31
|
+
static URN_NOT_PERMIT: MeshCode;
|
|
32
|
+
static SIGNATURE_ERROR: MeshCode;
|
|
33
|
+
static CRYPT_CODEC_ERROR: MeshCode;
|
|
34
|
+
static NO_SERVICE: MeshCode;
|
|
35
|
+
static NET_NOT_WEAVE: MeshCode;
|
|
36
|
+
static ADDRESS_ERROR: MeshCode;
|
|
37
|
+
static UNEXPECTED_SYNTAX: MeshCode;
|
|
38
|
+
static UNKNOWN_SCRIPT: MeshCode;
|
|
39
|
+
static DATA_ID_ERROR: MeshCode;
|
|
40
|
+
static START_PENDING: MeshCode;
|
|
41
|
+
static UNEXPECTED_SQL_SYNTAX: MeshCode;
|
|
42
|
+
static NO_DATABASE: MeshCode;
|
|
43
|
+
static NO_TRANSACTION: MeshCode;
|
|
44
|
+
static SQL_EXECUTE_ERROR: MeshCode;
|
|
45
|
+
static DUPLICATE_KEY: MeshCode;
|
|
46
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Type } from '../macro';
|
|
2
|
+
export declare abstract class Codec {
|
|
3
|
+
static JSON: string;
|
|
4
|
+
static PROTOBUF: string;
|
|
5
|
+
static XML: string;
|
|
6
|
+
static YAML: string;
|
|
7
|
+
static THRIFT: string;
|
|
8
|
+
static MESH: string;
|
|
9
|
+
/**
|
|
10
|
+
* Encode object to binary array.
|
|
11
|
+
*
|
|
12
|
+
* @param value object
|
|
13
|
+
* @return binary array
|
|
14
|
+
*/
|
|
15
|
+
abstract encode(value: any): Uint8Array;
|
|
16
|
+
/**
|
|
17
|
+
* Decode to binary array to object.
|
|
18
|
+
*
|
|
19
|
+
* @param buffer binary array
|
|
20
|
+
* @param type object type
|
|
21
|
+
* @return typed object
|
|
22
|
+
*/
|
|
23
|
+
abstract decode<T>(buffer: Uint8Array, type: Type<T>): T;
|
|
24
|
+
/**
|
|
25
|
+
* Encode object to string.
|
|
26
|
+
* @param value
|
|
27
|
+
*/
|
|
28
|
+
encodeString(value: any): string;
|
|
29
|
+
/**
|
|
30
|
+
* Decode object from string.
|
|
31
|
+
* @param value
|
|
32
|
+
* @param type
|
|
33
|
+
*/
|
|
34
|
+
decodeString<T>(value: string, type: Type<T>): T;
|
|
35
|
+
/**
|
|
36
|
+
* String to Uint8array
|
|
37
|
+
*/
|
|
38
|
+
abstract uint8ify<T>(buffer: string): Uint8Array;
|
|
39
|
+
/**
|
|
40
|
+
* Uint8array to string.
|
|
41
|
+
*/
|
|
42
|
+
abstract stringify<T>(buffer: Uint8Array): string;
|
|
43
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Type } from '../macro';
|
|
2
|
+
import { Codec } from './codec';
|
|
3
|
+
export declare class JSONCodec extends Codec {
|
|
4
|
+
private encoder;
|
|
5
|
+
private decoder;
|
|
6
|
+
decode<T>(buffer: Uint8Array, type: Type<T>): T;
|
|
7
|
+
decorateAny(type: Type<any>, dict: any): any;
|
|
8
|
+
encode(value: any): Uint8Array;
|
|
9
|
+
encodeAny(value: any): any;
|
|
10
|
+
uint8ify<T>(buffer: string): Uint8Array;
|
|
11
|
+
stringify<T>(buffer: Uint8Array): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Consumer, Execution } from '../mpc';
|
|
2
|
+
import { Context } from '../psi';
|
|
3
|
+
import { Reference } from '../types';
|
|
4
|
+
export declare class GRPCConsumer extends Consumer {
|
|
5
|
+
start(): void;
|
|
6
|
+
close(): void;
|
|
7
|
+
consume(ctx: Context, address: string, urn: string, execution: Execution<Reference>, inbound: Uint8Array): Promise<Uint8Array>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Consumer, Execution } from '../mpc';
|
|
2
|
+
import { Context } from '../psi';
|
|
3
|
+
import { Reference } from '../types';
|
|
4
|
+
import { AxiosInstance } from 'axios';
|
|
5
|
+
export declare class HTTPConsumer extends Consumer {
|
|
6
|
+
private c;
|
|
7
|
+
getClient(): Promise<AxiosInstance>;
|
|
8
|
+
start(): void;
|
|
9
|
+
close(): void;
|
|
10
|
+
consume(ctx: Context, address: string, urn: string, execution: Execution<Reference>, inbound: Uint8Array): Promise<Uint8Array>;
|
|
11
|
+
invoke<T>(param: any, type: T, urn: string, timeout: number): Promise<T>;
|
|
12
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Builtin, Cache, CipherEconomy, CipherProvider, Cluster, Commercialize, Cryptor, DataHouse, Endpoint, Evaluator, Graph, KMS, KV, Licenser, Locker, Network, Pipeline, Publisher, Registry, Savepoint, Scheduler, Sequence, Subscriber, Tokenizer, Transporter, FileSystem, Workflow } from './psi';
|
|
2
|
+
export * from './psi';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './asm';
|
|
5
|
+
interface MeshServices {
|
|
6
|
+
/**
|
|
7
|
+
* Builtin
|
|
8
|
+
*/
|
|
9
|
+
builtin: Builtin;
|
|
10
|
+
/**
|
|
11
|
+
* Cache
|
|
12
|
+
*/
|
|
13
|
+
cache: Cache;
|
|
14
|
+
/**
|
|
15
|
+
* CipherEconomy
|
|
16
|
+
*/
|
|
17
|
+
cipherEconomy: CipherEconomy;
|
|
18
|
+
/**
|
|
19
|
+
* CipherProvider
|
|
20
|
+
*/
|
|
21
|
+
cipherProvider: CipherProvider;
|
|
22
|
+
/**
|
|
23
|
+
* Cluster
|
|
24
|
+
*/
|
|
25
|
+
cluster: Cluster;
|
|
26
|
+
/**
|
|
27
|
+
* Commercialize
|
|
28
|
+
*/
|
|
29
|
+
commercialize: Commercialize;
|
|
30
|
+
/**
|
|
31
|
+
* Cryptor
|
|
32
|
+
*/
|
|
33
|
+
cryptor: Cryptor;
|
|
34
|
+
/**
|
|
35
|
+
* DataHouse
|
|
36
|
+
*/
|
|
37
|
+
dataHouse: DataHouse;
|
|
38
|
+
/**
|
|
39
|
+
* Endpoint
|
|
40
|
+
*/
|
|
41
|
+
endpoint: Endpoint;
|
|
42
|
+
/**
|
|
43
|
+
* Evaluator
|
|
44
|
+
*/
|
|
45
|
+
evaluator: Evaluator;
|
|
46
|
+
/**
|
|
47
|
+
* Graph
|
|
48
|
+
*/
|
|
49
|
+
graph: Graph;
|
|
50
|
+
/**
|
|
51
|
+
* KMS
|
|
52
|
+
*/
|
|
53
|
+
kms: KMS;
|
|
54
|
+
/**
|
|
55
|
+
* KV
|
|
56
|
+
*/
|
|
57
|
+
kv: KV;
|
|
58
|
+
/**
|
|
59
|
+
* Licenser
|
|
60
|
+
*/
|
|
61
|
+
licenser: Licenser;
|
|
62
|
+
/**
|
|
63
|
+
* Locker
|
|
64
|
+
*/
|
|
65
|
+
locker: Locker;
|
|
66
|
+
/**
|
|
67
|
+
* Network
|
|
68
|
+
*/
|
|
69
|
+
network: Network;
|
|
70
|
+
/**
|
|
71
|
+
* Pipeline
|
|
72
|
+
*/
|
|
73
|
+
pipeline: Pipeline;
|
|
74
|
+
/**
|
|
75
|
+
* Publisher
|
|
76
|
+
*/
|
|
77
|
+
publisher: Publisher;
|
|
78
|
+
/**
|
|
79
|
+
* Registry
|
|
80
|
+
*/
|
|
81
|
+
registry: Registry;
|
|
82
|
+
/**
|
|
83
|
+
* Savepoint
|
|
84
|
+
*/
|
|
85
|
+
savepoint: Savepoint;
|
|
86
|
+
/**
|
|
87
|
+
* Scheduler
|
|
88
|
+
*/
|
|
89
|
+
scheduler: Scheduler;
|
|
90
|
+
/**
|
|
91
|
+
* Sequence
|
|
92
|
+
*/
|
|
93
|
+
sequence: Sequence;
|
|
94
|
+
/**
|
|
95
|
+
* Subscriber
|
|
96
|
+
*/
|
|
97
|
+
subscriber: Subscriber;
|
|
98
|
+
/**
|
|
99
|
+
* Tokenizer
|
|
100
|
+
*/
|
|
101
|
+
tokenizer: Tokenizer;
|
|
102
|
+
/**
|
|
103
|
+
* Transporter
|
|
104
|
+
*/
|
|
105
|
+
transporter: Transporter;
|
|
106
|
+
/**
|
|
107
|
+
* FileSystem
|
|
108
|
+
*/
|
|
109
|
+
fileSystem: FileSystem;
|
|
110
|
+
/**
|
|
111
|
+
* Workflow
|
|
112
|
+
*/
|
|
113
|
+
workflow: Workflow;
|
|
114
|
+
}
|
|
115
|
+
declare const MeshService: MeshServices;
|
|
116
|
+
export { MeshService };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Dict, List } from './dsa';
|
|
2
|
+
export type Type<T> = Function & {
|
|
3
|
+
prototype: T;
|
|
4
|
+
};
|
|
5
|
+
export type Class<T> = Type<T> & {
|
|
6
|
+
new (...args: any[]): T;
|
|
7
|
+
};
|
|
8
|
+
export declare class Types implements Function {
|
|
9
|
+
readonly raw: Type<any>;
|
|
10
|
+
readonly parameters: Types[];
|
|
11
|
+
prototype: any;
|
|
12
|
+
length: number;
|
|
13
|
+
arguments: any;
|
|
14
|
+
caller: Function;
|
|
15
|
+
name: string;
|
|
16
|
+
[Symbol.metadata]: DecoratorMetadataObject;
|
|
17
|
+
constructor(types: any);
|
|
18
|
+
parse(types: any): any[];
|
|
19
|
+
apply: (thisArg: any, argArray?: any) => any;
|
|
20
|
+
call: (thisArg: any, ...argArray: any[]) => any;
|
|
21
|
+
bind: (thisArg: any, ...argArray: any[]) => any;
|
|
22
|
+
toString(): string;
|
|
23
|
+
[Symbol.hasInstance](value: any): boolean;
|
|
24
|
+
}
|
|
25
|
+
declare class ark {
|
|
26
|
+
private tinder;
|
|
27
|
+
private annotations;
|
|
28
|
+
private ak;
|
|
29
|
+
/**
|
|
30
|
+
* Annotate handler.
|
|
31
|
+
* @param target
|
|
32
|
+
* @param parent
|
|
33
|
+
* @param macro
|
|
34
|
+
* @param metadata
|
|
35
|
+
*/
|
|
36
|
+
annotate(macro: any, target: any, parent: any, metadata: any): void;
|
|
37
|
+
annotated<T>(parent: any): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Inspect the metadata of target object.
|
|
40
|
+
* @param parent
|
|
41
|
+
* @param target
|
|
42
|
+
* @param macro
|
|
43
|
+
*/
|
|
44
|
+
metadata<T>(macro: Type<T>, parent: any, target: any): T | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Get all the superclass of kind.
|
|
47
|
+
*/
|
|
48
|
+
superclass(kind: Type<any>, fn: (sc: Type<any>) => boolean): Type<any>[];
|
|
49
|
+
/**
|
|
50
|
+
* Register a annotated object as a metadata.
|
|
51
|
+
* @param macro annotated decorator
|
|
52
|
+
* @param name object name
|
|
53
|
+
* @param kind object type
|
|
54
|
+
* @param metadata decorated object
|
|
55
|
+
*/
|
|
56
|
+
register(macro: Type<any>, name: string, kind: Type<any>, metadata: any): void;
|
|
57
|
+
/**
|
|
58
|
+
* Unregister the class metadata.
|
|
59
|
+
* @param macro
|
|
60
|
+
* @param kind
|
|
61
|
+
*/
|
|
62
|
+
unregister(macro: Type<any>, kind: Type<any>): void;
|
|
63
|
+
/**
|
|
64
|
+
* Export all classes.
|
|
65
|
+
* @param macro
|
|
66
|
+
*/
|
|
67
|
+
export(macro: any): Dict<Type<any>, Dict<string, List<Class<any>>>>;
|
|
68
|
+
/**
|
|
69
|
+
* Inspect the subclass of kind annotated with macro.
|
|
70
|
+
* @param macro
|
|
71
|
+
* @param kind
|
|
72
|
+
*/
|
|
73
|
+
providers<T>(macro: any, kind: Type<T>): List<Class<T>>;
|
|
74
|
+
/**
|
|
75
|
+
* Inspect the subclass of kind annotated with macro for name.
|
|
76
|
+
* @param macro
|
|
77
|
+
* @param kind
|
|
78
|
+
* @param name
|
|
79
|
+
*/
|
|
80
|
+
provider<T>(macro: Type<any>, kind: Type<T>, name: string): List<Class<T>>;
|
|
81
|
+
inspect<T>(kind: Type<T>): Dict<string, any>;
|
|
82
|
+
}
|
|
83
|
+
declare const Ark: ark;
|
|
84
|
+
export { Ark };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function binding(topic?: string, code?: string, version?: string, proto?: string, codec?: string, flags?: number, timeout?: number, meshable?: boolean): ClassDecorator;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Dict<K, V> extends Map<K, V> {
|
|
2
|
+
computeIfy(key: K, value: (key: K) => V): V;
|
|
3
|
+
groupBy<GK>(group: (key: K, value: V) => GK): Dict<GK, V[]>;
|
|
4
|
+
map<T>(m: (key: K, value: V) => T): List<T>;
|
|
5
|
+
groupKV<KK, VV>(key: (key: K) => KK, value: (key: K, value: V) => VV): Dict<KK, VV>;
|
|
6
|
+
}
|
|
7
|
+
export declare class dict<K, V> extends Map<K, V> implements Dict<K, V> {
|
|
8
|
+
computeIfy(key: K, value: (key: K) => V): V;
|
|
9
|
+
groupBy<GK>(group: (key: K, value: V) => GK): Dict<GK, V[]>;
|
|
10
|
+
map<T>(m: (key: K, value: V) => T): List<T>;
|
|
11
|
+
groupKV<KK, VV>(key: (key: K) => KK, value: (key: K, value: V) => VV): Dict<KK, VV>;
|
|
12
|
+
}
|
|
13
|
+
export interface List<T> extends Array<T> {
|
|
14
|
+
groupBy<K>(group: (value: T) => K): Dict<K, List<T>>;
|
|
15
|
+
groupKV<K, V>(group: (value: T) => K, value: (key: K, value: T[]) => V): Dict<K, V>;
|
|
16
|
+
}
|
|
17
|
+
export declare class list<T> extends Array implements List<T> {
|
|
18
|
+
groupBy<K>(group: (value: T) => K): Dict<K, List<T>>;
|
|
19
|
+
groupKV<K, V>(group: (value: T) => K, value: (key: K, value: T[]) => V): Dict<K, V>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const globalPtr: () => any;
|
|
2
|
+
export declare class Env<T> {
|
|
3
|
+
static readonly Name: Env<string>;
|
|
4
|
+
static readonly Direct: Env<string>;
|
|
5
|
+
static readonly Subset: Env<string>;
|
|
6
|
+
static readonly Mode: Env<number>;
|
|
7
|
+
static readonly Proxy: Env<string>;
|
|
8
|
+
static readonly Address: Env<string>;
|
|
9
|
+
static readonly Runtime: Env<string>;
|
|
10
|
+
static readonly MDC: Env<string>;
|
|
11
|
+
static readonly SPA: Env<string>;
|
|
12
|
+
static readonly TCP: Env<string>;
|
|
13
|
+
static readonly Home: Env<string>;
|
|
14
|
+
static readonly DSN: Env<string>;
|
|
15
|
+
private readonly name;
|
|
16
|
+
private readonly value;
|
|
17
|
+
constructor(name: string, value: () => T);
|
|
18
|
+
private cache;
|
|
19
|
+
get(): T;
|
|
20
|
+
set(v: T): void;
|
|
21
|
+
}
|
|
22
|
+
export declare class Mode {
|
|
23
|
+
static readonly Disable: Mode;
|
|
24
|
+
static readonly Failfast: Mode;
|
|
25
|
+
static readonly Nolog: Mode;
|
|
26
|
+
static readonly JsonLogFormat: Mode;
|
|
27
|
+
static readonly PHeader: Mode;
|
|
28
|
+
static readonly Metrics: Mode;
|
|
29
|
+
static readonly Debug: Mode;
|
|
30
|
+
static readonly PermitCirculate: Mode;
|
|
31
|
+
static readonly NoStdColor: Mode;
|
|
32
|
+
static readonly Isolate: Mode;
|
|
33
|
+
static readonly Mock: Mode;
|
|
34
|
+
private readonly v;
|
|
35
|
+
constructor(v: number);
|
|
36
|
+
matches(v: number): boolean;
|
|
37
|
+
enable(): boolean;
|
|
38
|
+
value(): number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* With mesh mode.
|
|
42
|
+
*/
|
|
43
|
+
export declare function withMode(m: number): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Type } from './ark';
|
|
2
|
+
export declare class Idx {
|
|
3
|
+
value: number;
|
|
4
|
+
name: string;
|
|
5
|
+
transparent: boolean;
|
|
6
|
+
kind: Type<any>;
|
|
7
|
+
clas: Type<any>;
|
|
8
|
+
index: number;
|
|
9
|
+
constructor(value: number, name: string, transparent: boolean, kind: any);
|
|
10
|
+
decorate(target: Object, propertyKey: string | symbol | undefined, parameterIndex?: number): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function index(value?: number, name?: string, kind?: any, transparent?: boolean): PropertyDecorator & ParameterDecorator;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './ark';
|
|
2
|
+
export * from './binding';
|
|
3
|
+
export * from './dsa';
|
|
4
|
+
export * from './env';
|
|
5
|
+
export * from './idx';
|
|
6
|
+
export * from './inspector';
|
|
7
|
+
export * from './loader';
|
|
8
|
+
export * from './mpi';
|
|
9
|
+
export * from './mps';
|
|
10
|
+
export * from './spi';
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Type, Types } from './ark';
|
|
2
|
+
import { Codeable } from '../cause/codeable';
|
|
3
|
+
export interface Inspector {
|
|
4
|
+
/**
|
|
5
|
+
* Get inspect parent type.
|
|
6
|
+
*/
|
|
7
|
+
getType<T>(): Type<T>;
|
|
8
|
+
/**
|
|
9
|
+
* Get the name of inspector.
|
|
10
|
+
*/
|
|
11
|
+
getName(): string;
|
|
12
|
+
/**
|
|
13
|
+
* Get the annotations of inspector.
|
|
14
|
+
*/
|
|
15
|
+
getAnnotation<T>(kind: Type<T>): T | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Get the return type of inspector.
|
|
18
|
+
*/
|
|
19
|
+
getParameters(): Argument[];
|
|
20
|
+
/**
|
|
21
|
+
* Get the origin method.
|
|
22
|
+
*/
|
|
23
|
+
getReturnType(): Types;
|
|
24
|
+
/**
|
|
25
|
+
* Get the executable reference.
|
|
26
|
+
*/
|
|
27
|
+
getExecutable(): any;
|
|
28
|
+
/**
|
|
29
|
+
* Get the symbol of inspector.
|
|
30
|
+
*/
|
|
31
|
+
getSymbol(): any;
|
|
32
|
+
/**
|
|
33
|
+
* Invoke the inspector object.
|
|
34
|
+
*/
|
|
35
|
+
invoke(target: any, args: any[]): any;
|
|
36
|
+
}
|
|
37
|
+
export interface Accessor {
|
|
38
|
+
/**
|
|
39
|
+
* Get the executable accessors.
|
|
40
|
+
*/
|
|
41
|
+
getMethods(): Inspector[];
|
|
42
|
+
}
|
|
43
|
+
export declare abstract class MethodProxy {
|
|
44
|
+
/**
|
|
45
|
+
* Proxy interface.
|
|
46
|
+
*/
|
|
47
|
+
abstract proxy<T>(kind: Type<T>): T;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* InvocationHandler is the interface implemented by the invocation handler of a proxy instance.
|
|
51
|
+
* Each proxy instance has an associated invocation handler. When a method is invoked on a proxy instance,
|
|
52
|
+
* the method invocation is encoded and dispatched to the invoke method of its invocation handler.
|
|
53
|
+
*/
|
|
54
|
+
export interface InvocationHandler {
|
|
55
|
+
invoke(proxy: any, method: Inspector, args: any[]): any;
|
|
56
|
+
}
|
|
57
|
+
export interface Stacktrace {
|
|
58
|
+
name: string;
|
|
59
|
+
pos: string;
|
|
60
|
+
text: string;
|
|
61
|
+
buff: Uint8Array;
|
|
62
|
+
}
|
|
63
|
+
export interface Parameter {
|
|
64
|
+
/**
|
|
65
|
+
* Convert parameters to map.
|
|
66
|
+
*/
|
|
67
|
+
map(): Map<string, any>;
|
|
68
|
+
/**
|
|
69
|
+
* Generic arguments array.
|
|
70
|
+
*/
|
|
71
|
+
getArguments(): any[];
|
|
72
|
+
/**
|
|
73
|
+
* Generic arguments array.
|
|
74
|
+
*/
|
|
75
|
+
setArguments(args: any[]): void;
|
|
76
|
+
/**
|
|
77
|
+
* Get the generic attachments. The attributes will be serialized. The attachments are mutable.
|
|
78
|
+
*/
|
|
79
|
+
getAttachments(): Map<string, string>;
|
|
80
|
+
/**
|
|
81
|
+
* Attachment arguments.
|
|
82
|
+
*/
|
|
83
|
+
setAttachments(attachments: Map<string, string>): void;
|
|
84
|
+
}
|
|
85
|
+
export interface Return extends Codeable {
|
|
86
|
+
/**
|
|
87
|
+
* Return code.
|
|
88
|
+
*/
|
|
89
|
+
getCode(): string;
|
|
90
|
+
/**
|
|
91
|
+
* Return code.
|
|
92
|
+
*/
|
|
93
|
+
setCode(code: string): void;
|
|
94
|
+
/**
|
|
95
|
+
* Return message.
|
|
96
|
+
*/
|
|
97
|
+
getMessage(): string;
|
|
98
|
+
/**
|
|
99
|
+
* Return message.
|
|
100
|
+
*/
|
|
101
|
+
setMessage(message: string): void;
|
|
102
|
+
/**
|
|
103
|
+
* Return cause.
|
|
104
|
+
*/
|
|
105
|
+
getCause(): Stacktrace | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Return cause.
|
|
108
|
+
*/
|
|
109
|
+
setCause(cause: Stacktrace): void;
|
|
110
|
+
/**
|
|
111
|
+
* Return content.
|
|
112
|
+
*/
|
|
113
|
+
getContent(): any;
|
|
114
|
+
/**
|
|
115
|
+
* Return content.
|
|
116
|
+
*/
|
|
117
|
+
setContent(content: any): void;
|
|
118
|
+
}
|
|
119
|
+
export declare class Argument {
|
|
120
|
+
index: number;
|
|
121
|
+
name: string;
|
|
122
|
+
kind: any;
|
|
123
|
+
constructor(index: number, name: string, kind: any);
|
|
124
|
+
}
|
|
125
|
+
export declare class MethodInspector implements Inspector {
|
|
126
|
+
private readonly kind;
|
|
127
|
+
private readonly name;
|
|
128
|
+
private readonly method;
|
|
129
|
+
constructor(kind: any, name: string, method: any);
|
|
130
|
+
getAnnotation<T>(macro: Type<T>): T | undefined;
|
|
131
|
+
getName(): string;
|
|
132
|
+
getParameters(): Argument[];
|
|
133
|
+
getType<T>(): Type<T>;
|
|
134
|
+
getReturnType(): Types;
|
|
135
|
+
getExecutable(): any;
|
|
136
|
+
getSymbol(): string;
|
|
137
|
+
invoke(target: any, args: any[]): any;
|
|
138
|
+
}
|
|
139
|
+
export declare class Dynamic {
|
|
140
|
+
private static proxies;
|
|
141
|
+
private static inspectors;
|
|
142
|
+
static newProxyInstance<T>(kind: Type<T>, h: InvocationHandler): T;
|
|
143
|
+
static getMethods<T>(kind: Type<T>): Inspector[];
|
|
144
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Type } from './ark';
|
|
2
|
+
export declare class ServiceLoader<T> {
|
|
3
|
+
private static loaders;
|
|
4
|
+
static load<T>(kind: Type<T>): ServiceLoader<T>;
|
|
5
|
+
private providers;
|
|
6
|
+
private readonly spi;
|
|
7
|
+
private readonly fist;
|
|
8
|
+
constructor(spi: Type<T>);
|
|
9
|
+
defaultName(): string;
|
|
10
|
+
getDefault(): T;
|
|
11
|
+
get(name: string): T;
|
|
12
|
+
want(name: string): T | null;
|
|
13
|
+
list(): T[];
|
|
14
|
+
private getInstances;
|
|
15
|
+
}
|