@dra2020/baseclient 1.0.13 → 1.0.14
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/LICENSE +21 -0
- package/README.md +37 -0
- package/dist/all/all.d.ts +36 -0
- package/dist/all/allclient.d.ts +18 -0
- package/dist/base.js +33010 -0
- package/dist/base.js.map +1 -0
- package/dist/baseclient.js +8991 -0
- package/dist/baseclient.js.map +1 -0
- package/dist/context/all.d.ts +1 -0
- package/dist/context/context.d.ts +13 -0
- package/dist/dbabstract/all.d.ts +1 -0
- package/dist/dbabstract/db.d.ts +83 -0
- package/dist/dbdynamo/all.d.ts +1 -0
- package/dist/dbdynamo/dbdynamo.d.ts +190 -0
- package/dist/filterexpr/all.d.ts +1 -0
- package/dist/filterexpr/filterexpr.d.ts +64 -0
- package/dist/fsm/all.d.ts +1 -0
- package/dist/fsm/fsm.d.ts +118 -0
- package/dist/fsmfile/all.d.ts +1 -0
- package/dist/fsmfile/fsmfile.d.ts +47 -0
- package/dist/jsonstream/all.d.ts +1 -0
- package/dist/jsonstream/jsonstream.d.ts +130 -0
- package/dist/lambda/all.d.ts +1 -0
- package/dist/lambda/env.d.ts +10 -0
- package/dist/lambda/lambda.d.ts +18 -0
- package/dist/logabstract/all.d.ts +1 -0
- package/dist/logabstract/log.d.ts +26 -0
- package/dist/logclient/all.d.ts +1 -0
- package/dist/logclient/log.d.ts +6 -0
- package/dist/logserver/all.d.ts +5 -0
- package/dist/logserver/log.d.ts +11 -0
- package/dist/logserver/logaccum.d.ts +154 -0
- package/dist/logserver/logblob.d.ts +24 -0
- package/dist/logserver/logconcat.d.ts +55 -0
- package/dist/logserver/logkey.d.ts +28 -0
- package/dist/memsqs/all.d.ts +4 -0
- package/dist/memsqs/client.d.ts +13 -0
- package/dist/memsqs/loopback.d.ts +11 -0
- package/dist/memsqs/orderedlist.d.ts +19 -0
- package/dist/memsqs/queue.d.ts +84 -0
- package/dist/memsqs/server.d.ts +37 -0
- package/dist/ot-editutil/all.d.ts +2 -0
- package/dist/ot-editutil/oteditutil.d.ts +14 -0
- package/dist/ot-editutil/otmaputil.d.ts +21 -0
- package/dist/ot-js/all.d.ts +9 -0
- package/dist/ot-js/otarray.d.ts +111 -0
- package/dist/ot-js/otclientengine.d.ts +38 -0
- package/dist/ot-js/otcomposite.d.ts +37 -0
- package/dist/ot-js/otcounter.d.ts +17 -0
- package/dist/ot-js/otengine.d.ts +22 -0
- package/dist/ot-js/otmap.d.ts +19 -0
- package/dist/ot-js/otserverengine.d.ts +38 -0
- package/dist/ot-js/otsession.d.ts +111 -0
- package/dist/ot-js/ottypes.d.ts +29 -0
- package/dist/poly/all.d.ts +15 -0
- package/dist/poly/blend.d.ts +1 -0
- package/dist/poly/boundbox.d.ts +16 -0
- package/dist/poly/cartesian.d.ts +5 -0
- package/dist/poly/graham-scan.d.ts +8 -0
- package/dist/poly/hash.d.ts +1 -0
- package/dist/poly/matrix.d.ts +24 -0
- package/dist/poly/minbound.d.ts +1 -0
- package/dist/poly/poly.d.ts +52 -0
- package/dist/poly/polybin.d.ts +5 -0
- package/dist/poly/polylabel.d.ts +7 -0
- package/dist/poly/polypack.d.ts +30 -0
- package/dist/poly/polyround.d.ts +1 -0
- package/dist/poly/polysimplify.d.ts +1 -0
- package/dist/poly/quad.d.ts +48 -0
- package/dist/poly/selfintersect.d.ts +1 -0
- package/dist/poly/shamos.d.ts +1 -0
- package/dist/poly/simplify.d.ts +2 -0
- package/dist/poly/topo.d.ts +46 -0
- package/dist/poly/union.d.ts +48 -0
- package/dist/storage/all.d.ts +4 -0
- package/dist/storage/datablob.d.ts +9 -0
- package/dist/storage/env.d.ts +10 -0
- package/dist/storage/splitsblob.d.ts +13 -0
- package/dist/storage/storage.d.ts +166 -0
- package/dist/storages3/all.d.ts +1 -0
- package/dist/storages3/s3.d.ts +62 -0
- package/dist/util/all.d.ts +5 -0
- package/dist/util/bintrie.d.ts +93 -0
- package/dist/util/countedhash.d.ts +19 -0
- package/dist/util/gradient.d.ts +15 -0
- package/dist/util/indexedarray.d.ts +15 -0
- package/dist/util/util.d.ts +68 -0
- package/docs/context.md +2 -0
- package/docs/dbabstract.md +2 -0
- package/docs/dbdynamo.md +2 -0
- package/docs/fsm.md +243 -0
- package/docs/fsmfile.md +2 -0
- package/docs/jsonstream.md +44 -0
- package/docs/lambda.md +2 -0
- package/docs/logabstract.md +2 -0
- package/docs/logclient.md +2 -0
- package/docs/logserver.md +2 -0
- package/docs/ot-editutil.md +2 -0
- package/docs/ot-js.md +95 -0
- package/docs/poly.md +103 -0
- package/docs/storage.md +2 -0
- package/docs/storages3.md +2 -0
- package/docs/util.md +2 -0
- package/lib/all/all.ts +41 -0
- package/lib/all/allclient.ts +19 -0
- package/lib/context/all.ts +1 -0
- package/lib/context/context.ts +82 -0
- package/lib/dbabstract/all.ts +1 -0
- package/lib/dbabstract/db.ts +246 -0
- package/lib/dbdynamo/all.ts +1 -0
- package/lib/dbdynamo/dbdynamo.ts +1551 -0
- package/lib/filterexpr/all.ts +1 -0
- package/lib/filterexpr/filterexpr.ts +625 -0
- package/lib/fsm/all.ts +1 -0
- package/lib/fsm/fsm.ts +549 -0
- package/lib/fsmfile/all.ts +1 -0
- package/lib/fsmfile/fsmfile.ts +236 -0
- package/lib/jsonstream/all.ts +1 -0
- package/lib/jsonstream/jsonstream.ts +940 -0
- package/lib/lambda/all.ts +1 -0
- package/lib/lambda/env.ts +13 -0
- package/lib/lambda/lambda.ts +120 -0
- package/lib/logabstract/all.ts +1 -0
- package/lib/logabstract/log.ts +55 -0
- package/lib/logclient/all.ts +1 -0
- package/lib/logclient/log.ts +105 -0
- package/lib/logserver/all.ts +5 -0
- package/lib/logserver/log.ts +565 -0
- package/lib/logserver/logaccum.ts +1445 -0
- package/lib/logserver/logblob.ts +84 -0
- package/lib/logserver/logconcat.ts +313 -0
- package/lib/logserver/logkey.ts +125 -0
- package/lib/memsqs/all.ts +4 -0
- package/lib/memsqs/client.ts +268 -0
- package/lib/memsqs/loopback.ts +64 -0
- package/lib/memsqs/orderedlist.ts +74 -0
- package/lib/memsqs/queue.ts +395 -0
- package/lib/memsqs/server.ts +262 -0
- package/lib/ot-editutil/all.ts +2 -0
- package/lib/ot-editutil/oteditutil.ts +180 -0
- package/lib/ot-editutil/otmaputil.ts +209 -0
- package/lib/ot-js/all.ts +9 -0
- package/lib/ot-js/otarray.ts +1168 -0
- package/lib/ot-js/otclientengine.ts +327 -0
- package/lib/ot-js/otcomposite.ts +247 -0
- package/lib/ot-js/otcounter.ts +145 -0
- package/lib/ot-js/otengine.ts +71 -0
- package/lib/ot-js/otmap.ts +144 -0
- package/lib/ot-js/otserverengine.ts +329 -0
- package/lib/ot-js/otsession.ts +199 -0
- package/lib/ot-js/ottypes.ts +98 -0
- package/lib/poly/all.ts +15 -0
- package/lib/poly/blend.ts +27 -0
- package/lib/poly/boundbox.ts +102 -0
- package/lib/poly/cartesian.ts +130 -0
- package/lib/poly/graham-scan.ts +401 -0
- package/lib/poly/hash.ts +15 -0
- package/lib/poly/matrix.ts +309 -0
- package/lib/poly/minbound.ts +211 -0
- package/lib/poly/poly.ts +767 -0
- package/lib/poly/polybin.ts +218 -0
- package/lib/poly/polylabel.ts +204 -0
- package/lib/poly/polypack.ts +458 -0
- package/lib/poly/polyround.ts +30 -0
- package/lib/poly/polysimplify.ts +24 -0
- package/lib/poly/quad.ts +272 -0
- package/lib/poly/selfintersect.ts +87 -0
- package/lib/poly/shamos.ts +297 -0
- package/lib/poly/simplify.ts +119 -0
- package/lib/poly/topo.ts +525 -0
- package/lib/poly/union.ts +371 -0
- package/lib/storage/all.ts +4 -0
- package/lib/storage/datablob.ts +36 -0
- package/lib/storage/env.ts +14 -0
- package/lib/storage/splitsblob.ts +63 -0
- package/lib/storage/storage.ts +604 -0
- package/lib/storages3/all.ts +1 -0
- package/lib/storages3/s3.ts +576 -0
- package/lib/util/all.ts +5 -0
- package/lib/util/bintrie.ts +603 -0
- package/lib/util/countedhash.ts +83 -0
- package/lib/util/gradient.ts +108 -0
- package/lib/util/indexedarray.ts +80 -0
- package/lib/util/util.ts +695 -0
- package/package.json +8 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './context';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare type ContextValues = {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
};
|
|
4
|
+
export interface IContext {
|
|
5
|
+
setDefaults: (o: ContextValues) => void;
|
|
6
|
+
setValues: (o: ContextValues) => void;
|
|
7
|
+
xvalue: (prop: string) => any;
|
|
8
|
+
xset: (prop: string) => boolean;
|
|
9
|
+
xflag: (prop: string) => boolean;
|
|
10
|
+
xnumber: (prop: string) => number;
|
|
11
|
+
xstring: (prop: string) => string;
|
|
12
|
+
}
|
|
13
|
+
export declare function create(): IContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './db';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as LogAbstract from '../logabstract/all';
|
|
2
|
+
import * as Context from '../context/all';
|
|
3
|
+
import * as Storage from '../storage/all';
|
|
4
|
+
import * as FSM from '../fsm/all';
|
|
5
|
+
export declare const FSM_CREATING: number;
|
|
6
|
+
export declare const FSM_NEEDRELEASE: number;
|
|
7
|
+
export declare const FSM_RELEASING: number;
|
|
8
|
+
export declare const FSM_READING: number;
|
|
9
|
+
export interface DBEnvironment {
|
|
10
|
+
context: Context.IContext;
|
|
11
|
+
log: LogAbstract.ILog;
|
|
12
|
+
fsmManager: FSM.FsmManager;
|
|
13
|
+
storageManager: Storage.StorageManager;
|
|
14
|
+
}
|
|
15
|
+
export declare function fromCompactSchema(c: any): any;
|
|
16
|
+
export declare function fromCompactKey(c: any): any;
|
|
17
|
+
export declare function fromCompactIndex(c: any): any;
|
|
18
|
+
export declare function toCompactSchema(s: any): any;
|
|
19
|
+
export declare class DBClient extends FSM.Fsm {
|
|
20
|
+
constructor(env: DBEnvironment);
|
|
21
|
+
get env(): DBEnvironment;
|
|
22
|
+
createCollection(name: string, options: any): DBCollection;
|
|
23
|
+
createStream(col: DBCollection): FSM.FsmArray;
|
|
24
|
+
closeStream(col: DBCollection): void;
|
|
25
|
+
createUpdate(col: DBCollection, query: any, values: any): DBUpdate;
|
|
26
|
+
createUnset(col: DBCollection, query: any, values: any): DBUnset;
|
|
27
|
+
createDelete(col: DBCollection, query: any): DBDelete;
|
|
28
|
+
createFind(col: DBCollection, filter: any): DBFind;
|
|
29
|
+
createQuery(col: DBCollection, filter: any): DBQuery;
|
|
30
|
+
createIndex(col: DBCollection, uid: string): DBIndex;
|
|
31
|
+
createClose(): DBClose;
|
|
32
|
+
close(): void;
|
|
33
|
+
}
|
|
34
|
+
export declare class DBCollection extends FSM.Fsm {
|
|
35
|
+
name: string;
|
|
36
|
+
options: any;
|
|
37
|
+
col: any;
|
|
38
|
+
client: DBClient;
|
|
39
|
+
constructor(env: DBEnvironment, client: DBClient, name: string, options: any);
|
|
40
|
+
}
|
|
41
|
+
export declare class DBUpdate extends FSM.Fsm {
|
|
42
|
+
col: DBCollection;
|
|
43
|
+
query: any;
|
|
44
|
+
values: any;
|
|
45
|
+
result: any;
|
|
46
|
+
constructor(env: DBEnvironment, col: DBCollection, query: any, values: any);
|
|
47
|
+
}
|
|
48
|
+
export declare class DBUnset extends FSM.Fsm {
|
|
49
|
+
col: DBCollection;
|
|
50
|
+
query: any;
|
|
51
|
+
values: any;
|
|
52
|
+
result: any;
|
|
53
|
+
constructor(env: DBEnvironment, col: DBCollection, query: any, values: any);
|
|
54
|
+
}
|
|
55
|
+
export declare class DBDelete extends FSM.Fsm {
|
|
56
|
+
col: DBCollection;
|
|
57
|
+
query: any;
|
|
58
|
+
result: any;
|
|
59
|
+
constructor(env: DBEnvironment, col: DBCollection, query: any);
|
|
60
|
+
}
|
|
61
|
+
export declare class DBFind extends FSM.Fsm {
|
|
62
|
+
col: DBCollection;
|
|
63
|
+
filter: any;
|
|
64
|
+
result: any;
|
|
65
|
+
constructor(env: DBEnvironment, col: DBCollection, filter: any);
|
|
66
|
+
}
|
|
67
|
+
export declare class DBQuery extends FSM.Fsm {
|
|
68
|
+
col: DBCollection;
|
|
69
|
+
filter: any;
|
|
70
|
+
fsmResult: FSM.FsmArray;
|
|
71
|
+
constructor(env: DBEnvironment, col: DBCollection, filter: any);
|
|
72
|
+
get result(): any[];
|
|
73
|
+
}
|
|
74
|
+
export declare class DBIndex extends FSM.Fsm {
|
|
75
|
+
col: DBCollection;
|
|
76
|
+
uid: string;
|
|
77
|
+
constructor(env: DBEnvironment, col: DBCollection, uid: string);
|
|
78
|
+
}
|
|
79
|
+
export declare class DBClose extends FSM.Fsm {
|
|
80
|
+
client: DBClient;
|
|
81
|
+
constructor(env: DBEnvironment, client: DBClient);
|
|
82
|
+
tick(): void;
|
|
83
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dbdynamo';
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import * as DynamoDB from 'aws-sdk/clients/dynamodb';
|
|
2
|
+
import * as DynamoDBStreams from 'aws-sdk/clients/dynamodbstreams';
|
|
3
|
+
import * as Util from '../util/all';
|
|
4
|
+
import * as Context from '../context/all';
|
|
5
|
+
import * as LogAbstract from '../logabstract/all';
|
|
6
|
+
import * as FSM from '../fsm/all';
|
|
7
|
+
import * as DB from '../dbabstract/all';
|
|
8
|
+
import * as Storage from '../storage/all';
|
|
9
|
+
export interface Environment {
|
|
10
|
+
context: Context.IContext;
|
|
11
|
+
log: LogAbstract.ILog;
|
|
12
|
+
fsmManager: FSM.FsmManager;
|
|
13
|
+
storageManager: Storage.StorageManager;
|
|
14
|
+
}
|
|
15
|
+
export interface EnvironmentEx {
|
|
16
|
+
context: Context.IContext;
|
|
17
|
+
log: LogAbstract.ILog;
|
|
18
|
+
fsmManager: FSM.FsmManager;
|
|
19
|
+
storageManager: Storage.StorageManager;
|
|
20
|
+
dbx: DynamoClient;
|
|
21
|
+
}
|
|
22
|
+
declare class Deadline {
|
|
23
|
+
elapsed: Util.Elapsed;
|
|
24
|
+
msDeadline: number;
|
|
25
|
+
constructor(msDeadline: number);
|
|
26
|
+
start(): void;
|
|
27
|
+
get msRemaining(): number;
|
|
28
|
+
get passed(): boolean;
|
|
29
|
+
}
|
|
30
|
+
declare class FsmAPIWatch extends FSM.Fsm {
|
|
31
|
+
constructor(env: Environment);
|
|
32
|
+
get env(): Environment;
|
|
33
|
+
tick(): void;
|
|
34
|
+
}
|
|
35
|
+
declare class FsmListTables extends FSM.Fsm {
|
|
36
|
+
tables: any;
|
|
37
|
+
workStack: string[];
|
|
38
|
+
constructor(env: Environment);
|
|
39
|
+
get env(): EnvironmentEx;
|
|
40
|
+
tick(): void;
|
|
41
|
+
}
|
|
42
|
+
export declare function create(env: Environment): DB.DBClient;
|
|
43
|
+
export declare class DynamoClient extends DB.DBClient {
|
|
44
|
+
serializerUpdate: FSM.FsmSerializer;
|
|
45
|
+
fsmAPIWatch: FsmAPIWatch;
|
|
46
|
+
fsmListTables: FsmListTables;
|
|
47
|
+
dynamodb: DynamoDB;
|
|
48
|
+
dynamostream: DynamoDBStreams;
|
|
49
|
+
pendingCols: DynamoCollection[];
|
|
50
|
+
existingCols: {
|
|
51
|
+
[name: string]: DynamoCollection;
|
|
52
|
+
};
|
|
53
|
+
bList: boolean;
|
|
54
|
+
constructor(env: Environment);
|
|
55
|
+
get env(): EnvironmentEx;
|
|
56
|
+
get Production(): boolean;
|
|
57
|
+
get DBName(): string;
|
|
58
|
+
get dynamoErrorFrequency(): number;
|
|
59
|
+
createCollection(name: string, options: any): DB.DBCollection;
|
|
60
|
+
createStream(col: DynamoCollection): FSM.FsmArray;
|
|
61
|
+
closeStream(col: DynamoCollection): void;
|
|
62
|
+
ensureCollection(col: DynamoCollection): void;
|
|
63
|
+
createUpdate(col: DynamoCollection, query: any, values: any): DB.DBUpdate;
|
|
64
|
+
createUnset(col: DynamoCollection, query: any, values: any): DB.DBUnset;
|
|
65
|
+
createDelete(col: DynamoCollection, query: any): DB.DBDelete;
|
|
66
|
+
createFind(col: DynamoCollection, filter: any): DB.DBFind;
|
|
67
|
+
createQuery(col: DynamoCollection, filter: any): DB.DBQuery;
|
|
68
|
+
createIndex(col: DynamoCollection, uid: string): DB.DBIndex;
|
|
69
|
+
createClose(): DB.DBClose;
|
|
70
|
+
forceError(): boolean;
|
|
71
|
+
tick(): void;
|
|
72
|
+
}
|
|
73
|
+
export declare class DynamoCollection extends DB.DBCollection {
|
|
74
|
+
attributeIndex: any;
|
|
75
|
+
keyIndex: any;
|
|
76
|
+
fsmStream: FsmTableStream;
|
|
77
|
+
constructor(env: Environment, client: DynamoClient, name: string, options: any);
|
|
78
|
+
get env(): Environment;
|
|
79
|
+
get dynclient(): DynamoClient;
|
|
80
|
+
get dynamodb(): DynamoDB;
|
|
81
|
+
createStream(): FSM.FsmArray;
|
|
82
|
+
closeStream(): void;
|
|
83
|
+
constructIndex(): void;
|
|
84
|
+
addConditionExpression(query: any, key: any): void;
|
|
85
|
+
toInternalQuery(query: any): any;
|
|
86
|
+
toInternalExpression(o: any): any;
|
|
87
|
+
toTestExpression(expr: any): string;
|
|
88
|
+
toUpdateExpression(expr: any): string;
|
|
89
|
+
toRemoveExpression(expr: any): string;
|
|
90
|
+
toExternal(result: any): any;
|
|
91
|
+
forceError(): boolean;
|
|
92
|
+
tick(): void;
|
|
93
|
+
}
|
|
94
|
+
export declare class DynamoUpdate extends DB.DBUpdate {
|
|
95
|
+
trace: LogAbstract.AsyncTimer;
|
|
96
|
+
constructor(env: Environment, col: DynamoCollection, query: any, values: any);
|
|
97
|
+
get env(): Environment;
|
|
98
|
+
get dyncol(): DynamoCollection;
|
|
99
|
+
forceError(): boolean;
|
|
100
|
+
tick(): void;
|
|
101
|
+
}
|
|
102
|
+
export declare class DynamoUnset extends DB.DBUnset {
|
|
103
|
+
trace: LogAbstract.AsyncTimer;
|
|
104
|
+
constructor(env: Environment, col: DynamoCollection, query: any, values: any);
|
|
105
|
+
get env(): Environment;
|
|
106
|
+
get dyncol(): DynamoCollection;
|
|
107
|
+
forceError(): boolean;
|
|
108
|
+
tick(): void;
|
|
109
|
+
}
|
|
110
|
+
export declare class DynamoDelete extends DB.DBDelete {
|
|
111
|
+
trace: LogAbstract.AsyncTimer;
|
|
112
|
+
constructor(env: Environment, col: DynamoCollection, query: any);
|
|
113
|
+
get env(): Environment;
|
|
114
|
+
get dyncol(): DynamoCollection;
|
|
115
|
+
forceError(): boolean;
|
|
116
|
+
tick(): void;
|
|
117
|
+
}
|
|
118
|
+
export declare class DynamoFind extends DB.DBFind {
|
|
119
|
+
trace: LogAbstract.AsyncTimer;
|
|
120
|
+
constructor(env: Environment, col: DynamoCollection, filter: any);
|
|
121
|
+
get env(): Environment;
|
|
122
|
+
get dyncol(): DynamoCollection;
|
|
123
|
+
forceError(): boolean;
|
|
124
|
+
tick(): void;
|
|
125
|
+
}
|
|
126
|
+
export declare class DynamoQuery extends DB.DBQuery {
|
|
127
|
+
trace: LogAbstract.AsyncTimer;
|
|
128
|
+
lastKey: any;
|
|
129
|
+
constructor(env: Environment, col: DynamoCollection, filter: any);
|
|
130
|
+
get env(): Environment;
|
|
131
|
+
get dyncol(): DynamoCollection;
|
|
132
|
+
forceError(): boolean;
|
|
133
|
+
doScan(): void;
|
|
134
|
+
tick(): void;
|
|
135
|
+
}
|
|
136
|
+
export declare class DynamoIndex extends DB.DBIndex {
|
|
137
|
+
constructor(env: Environment, col: DynamoCollection, uid: string);
|
|
138
|
+
}
|
|
139
|
+
export declare class DynamoClose extends DB.DBClose {
|
|
140
|
+
constructor(env: Environment, client: DynamoClient);
|
|
141
|
+
}
|
|
142
|
+
interface RangeDescription {
|
|
143
|
+
StartingSequenceNumber: string;
|
|
144
|
+
EndingSequenceNumber?: string;
|
|
145
|
+
}
|
|
146
|
+
interface ShardDescription {
|
|
147
|
+
ShardId: string;
|
|
148
|
+
SequenceNumberRange: RangeDescription;
|
|
149
|
+
ShardIterator?: string;
|
|
150
|
+
ParentShardId?: string;
|
|
151
|
+
LastSequenceNumber?: string;
|
|
152
|
+
}
|
|
153
|
+
export declare class FsmTableShards extends FSM.Fsm {
|
|
154
|
+
table: any;
|
|
155
|
+
stream: any;
|
|
156
|
+
lastKey: string;
|
|
157
|
+
fsmResult: FSM.FsmArray;
|
|
158
|
+
constructor(env: Environment, table: any);
|
|
159
|
+
get env(): EnvironmentEx;
|
|
160
|
+
tick(): void;
|
|
161
|
+
}
|
|
162
|
+
declare class FsmReadOneShard extends FSM.Fsm {
|
|
163
|
+
col: DynamoCollection;
|
|
164
|
+
stream: any;
|
|
165
|
+
shard: ShardDescription;
|
|
166
|
+
shardClosed: boolean;
|
|
167
|
+
fsmResult: FSM.FsmArray;
|
|
168
|
+
elapsed: Util.Elapsed;
|
|
169
|
+
nTries: number;
|
|
170
|
+
deadline: Deadline;
|
|
171
|
+
constructor(env: Environment, col: DynamoCollection, stream: any, shard: ShardDescription, fsmResult: FSM.FsmArray);
|
|
172
|
+
get env(): EnvironmentEx;
|
|
173
|
+
tick(): void;
|
|
174
|
+
}
|
|
175
|
+
export declare class FsmTableStream extends FSM.Fsm {
|
|
176
|
+
col: DynamoCollection;
|
|
177
|
+
table: any;
|
|
178
|
+
fsmShards: FsmTableShards;
|
|
179
|
+
shardsDone: any;
|
|
180
|
+
shardsLast: any;
|
|
181
|
+
shardsQueue: FsmReadOneShard[];
|
|
182
|
+
fsmResult: FSM.FsmArray;
|
|
183
|
+
deadline: Deadline;
|
|
184
|
+
constructor(env: Environment, col: DB.DBCollection);
|
|
185
|
+
get env(): Environment;
|
|
186
|
+
end(): void;
|
|
187
|
+
error(): void;
|
|
188
|
+
tick(): void;
|
|
189
|
+
}
|
|
190
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './filterexpr';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as Util from '../util/all';
|
|
2
|
+
declare enum TokType {
|
|
3
|
+
Text = 0,
|
|
4
|
+
OpenParen = 1,
|
|
5
|
+
CloseParen = 2,
|
|
6
|
+
Not = 3,
|
|
7
|
+
And = 4,
|
|
8
|
+
Or = 5,
|
|
9
|
+
Colon = 6,
|
|
10
|
+
GreaterThan = 7,
|
|
11
|
+
GreaterThanEqual = 8,
|
|
12
|
+
Equal = 9,
|
|
13
|
+
LessThan = 10,
|
|
14
|
+
LessThanEqual = 11,
|
|
15
|
+
NotEqual = 12
|
|
16
|
+
}
|
|
17
|
+
interface Token {
|
|
18
|
+
tt: TokType;
|
|
19
|
+
text?: string;
|
|
20
|
+
}
|
|
21
|
+
interface Clause {
|
|
22
|
+
op: Token;
|
|
23
|
+
operand1?: Clause;
|
|
24
|
+
operand2?: Clause;
|
|
25
|
+
}
|
|
26
|
+
declare class Lexer {
|
|
27
|
+
coder: Util.Coder;
|
|
28
|
+
tokens: Token[];
|
|
29
|
+
buf: Uint8Array;
|
|
30
|
+
tok: Uint8Array;
|
|
31
|
+
toklen: number;
|
|
32
|
+
n: number;
|
|
33
|
+
constructor(coder: Util.Coder, expr?: string);
|
|
34
|
+
set(expr: string): void;
|
|
35
|
+
pushString(s: string): void;
|
|
36
|
+
pushText(bForce?: boolean): void;
|
|
37
|
+
pushSpecial(tt: TokType): void;
|
|
38
|
+
lex(): void;
|
|
39
|
+
}
|
|
40
|
+
declare class Parser {
|
|
41
|
+
clauses: Clause[];
|
|
42
|
+
constructor();
|
|
43
|
+
get clause(): Clause;
|
|
44
|
+
initFromTokens(tokens: Token[]): void;
|
|
45
|
+
initFromClauses(clauses: Clause[]): void;
|
|
46
|
+
convertOpToText(): void;
|
|
47
|
+
combineParenthetical(): void;
|
|
48
|
+
combineUnary(): void;
|
|
49
|
+
combineColon(): void;
|
|
50
|
+
combineBinary(tt: TokType): void;
|
|
51
|
+
combineImplicitAnd(): void;
|
|
52
|
+
clausesFromTokens(tokens: Token[]): void;
|
|
53
|
+
}
|
|
54
|
+
export declare class FilterExpr {
|
|
55
|
+
lexer: Lexer;
|
|
56
|
+
parser: Parser;
|
|
57
|
+
constructor(coder: Util.Coder, expr?: string);
|
|
58
|
+
set(expr: string): void;
|
|
59
|
+
test(o: any, types?: any): boolean;
|
|
60
|
+
asString(): string;
|
|
61
|
+
asStringClause(clause: Clause): string;
|
|
62
|
+
testClause(o: any, types: any, clause: Clause, prop?: string, relation?: TokType): boolean;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fsm';
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as Util from '../util/all';
|
|
2
|
+
export declare const FSM_STARTING: number;
|
|
3
|
+
export declare const FSM_PENDING: number;
|
|
4
|
+
export declare const FSM_DONE: number;
|
|
5
|
+
export declare const FSM_ERROR: number;
|
|
6
|
+
export declare const FSM_RELEASED: number;
|
|
7
|
+
export declare const FSM_CUSTOM1: number;
|
|
8
|
+
export declare const FSM_CUSTOM2: number;
|
|
9
|
+
export declare const FSM_CUSTOM3: number;
|
|
10
|
+
export declare const FSM_CUSTOM4: number;
|
|
11
|
+
export declare const FSM_CUSTOM5: number;
|
|
12
|
+
export declare const FSM_CUSTOM6: number;
|
|
13
|
+
export declare const FSM_CUSTOM7: number;
|
|
14
|
+
export declare const FSM_CUSTOM8: number;
|
|
15
|
+
export declare const FSM_CUSTOM9: number;
|
|
16
|
+
export declare type FsmIndex = {
|
|
17
|
+
[key: number]: Fsm;
|
|
18
|
+
};
|
|
19
|
+
export declare class FsmManager {
|
|
20
|
+
theId: number;
|
|
21
|
+
theEpoch: number;
|
|
22
|
+
bTickSet: boolean;
|
|
23
|
+
theTickList: FsmIndex;
|
|
24
|
+
theBusyLoopCount: number;
|
|
25
|
+
constructor();
|
|
26
|
+
forceTick(fsm: Fsm): void;
|
|
27
|
+
doTick(): void;
|
|
28
|
+
}
|
|
29
|
+
export interface FsmEnvironment {
|
|
30
|
+
fsmManager: FsmManager;
|
|
31
|
+
}
|
|
32
|
+
export declare class Fsm {
|
|
33
|
+
id: number;
|
|
34
|
+
state: number;
|
|
35
|
+
dependentError: boolean;
|
|
36
|
+
epochDone: number;
|
|
37
|
+
_env: FsmEnvironment;
|
|
38
|
+
_waitOn: FsmIndex;
|
|
39
|
+
_waitedOn: FsmIndex;
|
|
40
|
+
constructor(env: FsmEnvironment);
|
|
41
|
+
get env(): FsmEnvironment;
|
|
42
|
+
get manager(): FsmManager;
|
|
43
|
+
get done(): boolean;
|
|
44
|
+
get ready(): boolean;
|
|
45
|
+
get iserror(): boolean;
|
|
46
|
+
get isDependentError(): boolean;
|
|
47
|
+
setDependentError(): void;
|
|
48
|
+
clearDependentError(): void;
|
|
49
|
+
get ticked(): boolean;
|
|
50
|
+
get nWaitOn(): number;
|
|
51
|
+
get nWaitedOn(): number;
|
|
52
|
+
waitOn(fsm: Fsm | Fsm[]): Fsm;
|
|
53
|
+
setState(state: number): void;
|
|
54
|
+
end(state?: number): void;
|
|
55
|
+
preTick(): void;
|
|
56
|
+
tick(): void;
|
|
57
|
+
}
|
|
58
|
+
export declare class FsmOnDone extends Fsm {
|
|
59
|
+
cb: any;
|
|
60
|
+
fsm: Fsm | Fsm[];
|
|
61
|
+
constructor(env: FsmEnvironment, fsm: Fsm | Fsm[], cb: any);
|
|
62
|
+
tick(): void;
|
|
63
|
+
}
|
|
64
|
+
export declare class FsmSleep extends Fsm {
|
|
65
|
+
delay: number;
|
|
66
|
+
constructor(env: FsmEnvironment, delay: number);
|
|
67
|
+
tick(): void;
|
|
68
|
+
}
|
|
69
|
+
export declare type SerializerIndex = {
|
|
70
|
+
[key: string]: Fsm;
|
|
71
|
+
};
|
|
72
|
+
export declare class FsmSerializer extends Fsm {
|
|
73
|
+
index: SerializerIndex;
|
|
74
|
+
constructor(env: FsmEnvironment);
|
|
75
|
+
serialize(id: string, fsm?: Fsm): Fsm;
|
|
76
|
+
tick(): void;
|
|
77
|
+
}
|
|
78
|
+
declare type FsmArrayMap = {
|
|
79
|
+
[key: string]: Fsm[];
|
|
80
|
+
};
|
|
81
|
+
export declare class FsmTracker {
|
|
82
|
+
env: FsmEnvironment;
|
|
83
|
+
map: FsmArrayMap;
|
|
84
|
+
constructor(env: FsmEnvironment);
|
|
85
|
+
_track(uid: string, fsm: Fsm): void;
|
|
86
|
+
_untrack(uid: string, fsm: Fsm): void;
|
|
87
|
+
track(uid: string, fsm: Fsm): Fsm;
|
|
88
|
+
maybeWait(uid: string, fsm: Fsm): void;
|
|
89
|
+
}
|
|
90
|
+
export interface LoopOptions {
|
|
91
|
+
minRepeatInterval?: number;
|
|
92
|
+
exitOnError?: boolean;
|
|
93
|
+
}
|
|
94
|
+
export declare const DefaultLoopOptions: {
|
|
95
|
+
minRepeatInterval: number;
|
|
96
|
+
exitOnError: boolean;
|
|
97
|
+
};
|
|
98
|
+
export declare class FsmLoop extends Fsm {
|
|
99
|
+
fsm: Fsm;
|
|
100
|
+
options: LoopOptions;
|
|
101
|
+
elapsed: Util.Elapsed;
|
|
102
|
+
constructor(env: FsmEnvironment, fsm: Fsm, options?: LoopOptions);
|
|
103
|
+
tick(): void;
|
|
104
|
+
}
|
|
105
|
+
export interface ISet {
|
|
106
|
+
test: (o: any) => boolean;
|
|
107
|
+
reset: () => void;
|
|
108
|
+
}
|
|
109
|
+
export declare class FsmArray extends Fsm {
|
|
110
|
+
a: any[];
|
|
111
|
+
iset: ISet;
|
|
112
|
+
constructor(env: FsmEnvironment, iset?: ISet);
|
|
113
|
+
push(o: any): void;
|
|
114
|
+
concat(a: any[]): void;
|
|
115
|
+
splice(i?: number, n?: number): void;
|
|
116
|
+
reset(): void;
|
|
117
|
+
}
|
|
118
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fsmfile';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as LogAbstract from '../logabstract/all';
|
|
3
|
+
import * as FSM from '../fsm/all';
|
|
4
|
+
export interface Environment {
|
|
5
|
+
log: LogAbstract.ILog;
|
|
6
|
+
fsmManager: FSM.FsmManager;
|
|
7
|
+
}
|
|
8
|
+
export declare class FsmUnlink extends FSM.Fsm {
|
|
9
|
+
path: string;
|
|
10
|
+
err: any;
|
|
11
|
+
constructor(env: Environment, path: string);
|
|
12
|
+
tick(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class FsmMkdir extends FSM.Fsm {
|
|
15
|
+
dir: string;
|
|
16
|
+
bAllowExist: boolean;
|
|
17
|
+
err: any;
|
|
18
|
+
constructor(env: Environment, dir: string, bAllowExist?: boolean);
|
|
19
|
+
tick(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class FsmRmdir extends FSM.Fsm {
|
|
22
|
+
dir: string;
|
|
23
|
+
err: any;
|
|
24
|
+
constructor(env: Environment, dir: string);
|
|
25
|
+
tick(): void;
|
|
26
|
+
}
|
|
27
|
+
export declare class FsmLs extends FSM.Fsm {
|
|
28
|
+
dir: string;
|
|
29
|
+
err: any;
|
|
30
|
+
entries: string[];
|
|
31
|
+
constructor(env: Environment, dir: string);
|
|
32
|
+
tick(): void;
|
|
33
|
+
}
|
|
34
|
+
export declare class FsmReadFile extends FSM.Fsm {
|
|
35
|
+
path: string;
|
|
36
|
+
result: string;
|
|
37
|
+
err: any;
|
|
38
|
+
constructor(env: Environment, path: string);
|
|
39
|
+
tick(): void;
|
|
40
|
+
}
|
|
41
|
+
export declare class FsmWriteFile extends FSM.Fsm {
|
|
42
|
+
path: string;
|
|
43
|
+
contents: string | Buffer;
|
|
44
|
+
err: any;
|
|
45
|
+
constructor(env: Environment, path: string, contents: string | Buffer);
|
|
46
|
+
tick(): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './jsonstream';
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as Stream from 'stream';
|
|
3
|
+
import * as Events from 'events';
|
|
4
|
+
export declare class Readable extends Events.EventEmitter {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export declare class Writable extends Events.EventEmitter {
|
|
8
|
+
constructor();
|
|
9
|
+
write(b: any, encoding?: BufferEncoding, cb?: () => void): boolean;
|
|
10
|
+
end(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class BufferWritable extends Writable {
|
|
13
|
+
_bufs: Buffer[];
|
|
14
|
+
_buf: Buffer;
|
|
15
|
+
constructor();
|
|
16
|
+
write(b: any, encoding?: BufferEncoding, cb?: () => void): boolean;
|
|
17
|
+
end(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class BufferReadable extends Stream.Readable {
|
|
20
|
+
_b: Buffer;
|
|
21
|
+
constructor(b: Buffer);
|
|
22
|
+
_read(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare class MultiBufferReadable extends Stream.Readable {
|
|
25
|
+
constructor();
|
|
26
|
+
_read(): void;
|
|
27
|
+
more(buf: Buffer): void;
|
|
28
|
+
end(): void;
|
|
29
|
+
}
|
|
30
|
+
declare enum ReadState {
|
|
31
|
+
Start = 0,
|
|
32
|
+
ObjectPropertyStart = 1,
|
|
33
|
+
ObjectPropertyEnd = 2,
|
|
34
|
+
ValueStart = 3,
|
|
35
|
+
ValueEnd = 4,
|
|
36
|
+
InName = 5,
|
|
37
|
+
InNameBackslash = 6,
|
|
38
|
+
NeedColon = 7,
|
|
39
|
+
InNumber = 8,
|
|
40
|
+
InString = 9,
|
|
41
|
+
InStringBackslash = 10,
|
|
42
|
+
InTrue = 11,
|
|
43
|
+
InFalse = 12,
|
|
44
|
+
InNull = 13,
|
|
45
|
+
InUndefined = 14,
|
|
46
|
+
Error = 15,
|
|
47
|
+
Ended = 16
|
|
48
|
+
}
|
|
49
|
+
declare enum TokType {
|
|
50
|
+
TTNone = 0,
|
|
51
|
+
TTArray = 1,
|
|
52
|
+
TTObject = 2,
|
|
53
|
+
TTName = 3,
|
|
54
|
+
TTString = 4,
|
|
55
|
+
TTNumber = 5,
|
|
56
|
+
TTTrue = 6,
|
|
57
|
+
TTFalse = 7,
|
|
58
|
+
TTNull = 8,
|
|
59
|
+
TTUndefined = 9
|
|
60
|
+
}
|
|
61
|
+
interface Token {
|
|
62
|
+
tt: TokType;
|
|
63
|
+
v: any;
|
|
64
|
+
emit?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface JSONStreamOptions {
|
|
67
|
+
maxTokenSize?: number;
|
|
68
|
+
outBufferSize?: number;
|
|
69
|
+
encoding?: BufferEncoding;
|
|
70
|
+
syncChunkSize?: number;
|
|
71
|
+
}
|
|
72
|
+
export declare class JSONStreamReader extends Events.EventEmitter {
|
|
73
|
+
_s: Readable;
|
|
74
|
+
_charCount: number;
|
|
75
|
+
_lineCount: number;
|
|
76
|
+
_state: ReadState;
|
|
77
|
+
_tok: Buffer;
|
|
78
|
+
_tokLen: number;
|
|
79
|
+
_stack: Token[];
|
|
80
|
+
_result: any;
|
|
81
|
+
_incr: any;
|
|
82
|
+
_options: JSONStreamOptions;
|
|
83
|
+
_chunks: Buffer[];
|
|
84
|
+
_chunkCur: number;
|
|
85
|
+
_chunkIndex: number;
|
|
86
|
+
_chunkScheduled: boolean;
|
|
87
|
+
_ended: boolean;
|
|
88
|
+
_closed: boolean;
|
|
89
|
+
constructor(options?: JSONStreamOptions);
|
|
90
|
+
start(s: Readable): void;
|
|
91
|
+
finish(): void;
|
|
92
|
+
emitIncremental(name: string): void;
|
|
93
|
+
pushToken(tok: Token): void;
|
|
94
|
+
private badJSON;
|
|
95
|
+
private startTok;
|
|
96
|
+
private addToTok;
|
|
97
|
+
private consumeTok;
|
|
98
|
+
private produceValue;
|
|
99
|
+
private produceValidatedValue;
|
|
100
|
+
private onData;
|
|
101
|
+
private scheduleNext;
|
|
102
|
+
private nextChunk;
|
|
103
|
+
private onClose;
|
|
104
|
+
private doClose;
|
|
105
|
+
private onError;
|
|
106
|
+
private onEnd;
|
|
107
|
+
private doEnd;
|
|
108
|
+
}
|
|
109
|
+
interface ObjectWriteState {
|
|
110
|
+
o: any;
|
|
111
|
+
keys: string[];
|
|
112
|
+
index: number;
|
|
113
|
+
}
|
|
114
|
+
export declare class JSONStreamWriter extends Events.EventEmitter {
|
|
115
|
+
_s: Writable;
|
|
116
|
+
_stack: ObjectWriteState[];
|
|
117
|
+
_chunk: Buffer;
|
|
118
|
+
_chunkLen: number;
|
|
119
|
+
_options: JSONStreamOptions;
|
|
120
|
+
_bDone: boolean;
|
|
121
|
+
constructor(options?: JSONStreamOptions);
|
|
122
|
+
start(o: any, s: Writable): void;
|
|
123
|
+
addToChunk(s: string): boolean;
|
|
124
|
+
drainChunk(): boolean;
|
|
125
|
+
onDrain(): void;
|
|
126
|
+
onError(e: Error): void;
|
|
127
|
+
onClose(): void;
|
|
128
|
+
onFinish(): void;
|
|
129
|
+
}
|
|
130
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lambda';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Context from '../context/all';
|
|
2
|
+
import * as LogAbstract from '../logabstract/all';
|
|
3
|
+
import * as FSM from '../fsm/all';
|
|
4
|
+
import * as Lambda from './lambda';
|
|
5
|
+
export interface Environment {
|
|
6
|
+
context: Context.IContext;
|
|
7
|
+
log: LogAbstract.ILog;
|
|
8
|
+
fsmManager: FSM.FsmManager;
|
|
9
|
+
lambdaManager: Lambda.Manager;
|
|
10
|
+
}
|