@dra2020/baseclient 1.0.11 → 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/README.md +16 -5
- package/dist/all/all.d.ts +18 -2
- 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 +166 -1279
- package/dist/baseclient.js.map +1 -1
- 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/filterexpr.d.ts +0 -3
- package/dist/fsm/fsm.d.ts +0 -1
- 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/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-js/otsession.d.ts +0 -3
- package/dist/poly/union.d.ts +0 -1
- 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/docs/dbabstract.md +2 -0
- package/docs/dbdynamo.md +2 -0
- package/docs/fsmfile.md +2 -0
- package/docs/jsonstream.md +44 -0
- package/docs/lambda.md +2 -0
- package/docs/logserver.md +2 -0
- package/docs/storage.md +2 -0
- package/docs/storages3.md +2 -0
- package/lib/all/all.ts +22 -2
- package/lib/all/allclient.ts +19 -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/filterexpr.ts +5 -79
- package/lib/fsm/fsm.ts +2 -12
- 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/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-js/otsession.ts +1 -4
- package/lib/poly/hash.ts +1 -1
- package/lib/poly/topo.ts +41 -15
- package/lib/poly/union.ts +0 -17
- 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/package.json +10 -9
- package/dist/geo/all.d.ts +0 -2
- package/dist/geo/geo.d.ts +0 -67
- package/dist/geo/vfeature.d.ts +0 -4
- package/docs/filterexpr.md +0 -22
- package/lib/geo/all.ts +0 -2
- package/lib/geo/geo.ts +0 -452
- package/lib/geo/vfeature.ts +0 -34
|
@@ -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 {};
|
|
@@ -58,9 +58,6 @@ export declare class FilterExpr {
|
|
|
58
58
|
set(expr: string): void;
|
|
59
59
|
test(o: any, types?: any): boolean;
|
|
60
60
|
asString(): string;
|
|
61
|
-
containsClause(expr: string): boolean;
|
|
62
|
-
addClause(expr: string): void;
|
|
63
|
-
removeClause(expr: string): void;
|
|
64
61
|
asStringClause(clause: Clause): string;
|
|
65
62
|
testClause(o: any, types: any, clause: Clause, prop?: string, relation?: TokType): boolean;
|
|
66
63
|
}
|
package/dist/fsm/fsm.d.ts
CHANGED
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as FSM from '../fsm/all';
|
|
2
|
+
import { Environment } from './env';
|
|
3
|
+
import * as Lambda from 'aws-sdk/clients/lambda';
|
|
4
|
+
export declare class FsmInvoke extends FSM.Fsm {
|
|
5
|
+
name: string;
|
|
6
|
+
params: any;
|
|
7
|
+
result: any;
|
|
8
|
+
constructor(env: Environment, name: string, params: any);
|
|
9
|
+
get env(): Environment;
|
|
10
|
+
tick(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class Manager extends FSM.Fsm {
|
|
13
|
+
awslambda: Lambda;
|
|
14
|
+
constructor(env: Environment);
|
|
15
|
+
get env(): Environment;
|
|
16
|
+
invoke(name: string, params?: any): FsmInvoke;
|
|
17
|
+
}
|
|
18
|
+
export declare function create(env: Environment): Manager;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 interface LogEnvironment {
|
|
6
|
+
context: Context.IContext;
|
|
7
|
+
fsmManager: FSM.FsmManager;
|
|
8
|
+
storageManager: Storage.StorageManager;
|
|
9
|
+
log: LogAbstract.ILog;
|
|
10
|
+
}
|
|
11
|
+
export declare function create(env: LogEnvironment): LogAbstract.ILog;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as Context from '../context/all';
|
|
2
|
+
import * as LogAbstract from '../logabstract/all';
|
|
3
|
+
import * as FSM from '../fsm/all';
|
|
4
|
+
import * as Storage from '../storage/all';
|
|
5
|
+
import { LogBlob } from './logblob';
|
|
6
|
+
import { LogKey } from './logkey';
|
|
7
|
+
export interface Environment {
|
|
8
|
+
context: Context.IContext;
|
|
9
|
+
log: LogAbstract.ILog;
|
|
10
|
+
fsmManager: FSM.FsmManager;
|
|
11
|
+
storageManager: Storage.StorageManager;
|
|
12
|
+
}
|
|
13
|
+
export interface AccumOptions {
|
|
14
|
+
onlyAggregateClosed?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class LogItem {
|
|
17
|
+
id: string;
|
|
18
|
+
key?: LogKey;
|
|
19
|
+
present?: boolean;
|
|
20
|
+
parent?: LogItem;
|
|
21
|
+
children?: {
|
|
22
|
+
[id: string]: LogItem;
|
|
23
|
+
};
|
|
24
|
+
accum?: ILogAccumulator;
|
|
25
|
+
blob?: LogBlob;
|
|
26
|
+
constructor(id: string);
|
|
27
|
+
query(filter: (item: LogItem) => boolean): LogItem[];
|
|
28
|
+
addListing(ls: string[]): void;
|
|
29
|
+
addChild(id: string, child: LogItem): void;
|
|
30
|
+
add(item: LogItem): void;
|
|
31
|
+
}
|
|
32
|
+
export interface IValueAccumulator {
|
|
33
|
+
count: number;
|
|
34
|
+
total: number;
|
|
35
|
+
min?: number;
|
|
36
|
+
max?: number;
|
|
37
|
+
}
|
|
38
|
+
export declare class ValueAccumulator {
|
|
39
|
+
constructor();
|
|
40
|
+
static create(): IValueAccumulator;
|
|
41
|
+
static avg(va: IValueAccumulator): number;
|
|
42
|
+
static incr(va: IValueAccumulator): void;
|
|
43
|
+
static accum(va: IValueAccumulator, v: number): void;
|
|
44
|
+
static reduce(va: IValueAccumulator, reduction: IValueAccumulator): void;
|
|
45
|
+
static log(va: IValueAccumulator): string;
|
|
46
|
+
}
|
|
47
|
+
export declare type IValueAccumulatorIndex = {
|
|
48
|
+
[key: string]: IValueAccumulator;
|
|
49
|
+
};
|
|
50
|
+
export declare type IValueAccumulatorIndexIndex = {
|
|
51
|
+
[key: string]: {
|
|
52
|
+
[key: string]: IValueAccumulator;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export declare type IEventAccumulator = IValueAccumulatorIndex;
|
|
56
|
+
export declare class EventAccumulator {
|
|
57
|
+
constructor();
|
|
58
|
+
static create(): IEventAccumulator;
|
|
59
|
+
static getAccumulator(ea: IEventAccumulator, o: any, prop: string | string[]): IValueAccumulator;
|
|
60
|
+
static NUnique(ea: IEventAccumulator): number;
|
|
61
|
+
static incr(ea: IEventAccumulator, o: any, prop: string | string[]): void;
|
|
62
|
+
static accum(ea: IEventAccumulator, o: any, name: string, value: string): void;
|
|
63
|
+
static reduce(ea: IEventAccumulator, event: string, reduction: IValueAccumulator): void;
|
|
64
|
+
}
|
|
65
|
+
export declare type IEventAccumulatorIndex = {
|
|
66
|
+
[key: string]: IEventAccumulator;
|
|
67
|
+
};
|
|
68
|
+
export declare type IDayAccumulator = IEventAccumulatorIndex;
|
|
69
|
+
export declare class DayAccumulator {
|
|
70
|
+
constructor();
|
|
71
|
+
static create(): IDayAccumulator;
|
|
72
|
+
static count(da: IDayAccumulator): number;
|
|
73
|
+
static getAccumulator(da: IDayAccumulator, date: string): IEventAccumulator;
|
|
74
|
+
static incr(da: IDayAccumulator, date: string, o: any, prop: string | string[]): void;
|
|
75
|
+
static accum(da: IDayAccumulator, date: string, o: any, name: string, value: string): void;
|
|
76
|
+
static reduce(da: IDayAccumulator, event: string, reduction: IValueAccumulator): void;
|
|
77
|
+
static reduceByDateKeys(da: IDayAccumulator, dateKeys: IKeyIndex, event: string, reduction: IValueAccumulator): void;
|
|
78
|
+
static reduceByDate(da: IDayAccumulator, date: string, event: string, dayReduction: IValueAccumulator): void;
|
|
79
|
+
static reduceUniqueByDate(da: IDayAccumulator, date: string, days: IValueAccumulatorIndexIndex): void;
|
|
80
|
+
}
|
|
81
|
+
export declare type IDayAccumulatorIndex = {
|
|
82
|
+
[key: string]: IDayAccumulator;
|
|
83
|
+
};
|
|
84
|
+
export declare type IKeyIndex = {
|
|
85
|
+
[key: string]: boolean;
|
|
86
|
+
};
|
|
87
|
+
export interface IInstanceAccumulator {
|
|
88
|
+
dateKeys: IKeyIndex;
|
|
89
|
+
uniqueKeys: IKeyIndex;
|
|
90
|
+
instances: IDayAccumulatorIndex;
|
|
91
|
+
}
|
|
92
|
+
export declare class InstanceAccumulator {
|
|
93
|
+
constructor();
|
|
94
|
+
static create(): IInstanceAccumulator;
|
|
95
|
+
static getToday(ia: IInstanceAccumulator): string;
|
|
96
|
+
static getAccumulator(ia: IInstanceAccumulator, instance: string): IDayAccumulator;
|
|
97
|
+
static incr(ia: IInstanceAccumulator, instance: string, date: string, o: any, prop: string | string[]): void;
|
|
98
|
+
static accum(ia: IInstanceAccumulator, instance: string, date: string, o: any, name: string, value: string): void;
|
|
99
|
+
static NInstances(ia: IInstanceAccumulator): number;
|
|
100
|
+
static NDays(ia: IInstanceAccumulator): number;
|
|
101
|
+
static NUniques(ia: IInstanceAccumulator): number;
|
|
102
|
+
static NUniquesByDay(ia: IInstanceAccumulator, dateKeys?: IKeyIndex): IValueAccumulatorIndex;
|
|
103
|
+
static AllCountsByDay(ia: IInstanceAccumulator, dateKeys?: IKeyIndex, eventKeys?: IKeyIndex): IValueAccumulatorIndexIndex;
|
|
104
|
+
static TotalCountsByDay(ia: IInstanceAccumulator, dateKeys?: IKeyIndex, eventKeys?: IKeyIndex): IValueAccumulatorIndex;
|
|
105
|
+
static ValuesByEvent(ia: IInstanceAccumulator, dateKeys?: IKeyIndex, eventKeys?: IKeyIndex): IValueAccumulatorIndex;
|
|
106
|
+
static ValuesByDay(ia: IInstanceAccumulator, dateKeys?: IKeyIndex, eventKeys?: IKeyIndex): IValueAccumulatorIndexIndex;
|
|
107
|
+
static filterNoisyProperty(p: string): boolean;
|
|
108
|
+
static getCountRows(ia: IInstanceAccumulator, dateKeys?: IKeyIndex, eventKeys?: IKeyIndex): any[];
|
|
109
|
+
static getValueRows(ia: IInstanceAccumulator, dateKeys?: IKeyIndex, eventKeys?: IKeyIndex): any[];
|
|
110
|
+
}
|
|
111
|
+
export interface ILogAccumulator {
|
|
112
|
+
users: IInstanceAccumulator;
|
|
113
|
+
sessions: IInstanceAccumulator;
|
|
114
|
+
events: IInstanceAccumulator;
|
|
115
|
+
errors: IInstanceAccumulator;
|
|
116
|
+
values: IInstanceAccumulator;
|
|
117
|
+
syncTimers: IInstanceAccumulator;
|
|
118
|
+
asyncTimers: IInstanceAccumulator;
|
|
119
|
+
logsSeen: {
|
|
120
|
+
[id: string]: boolean;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
export declare class LogAccumulator {
|
|
124
|
+
static create(): ILogAccumulator;
|
|
125
|
+
static accumulate(la: ILogAccumulator, instance: string, dateKey: string, o: any): void;
|
|
126
|
+
static unquoteFields(fields: string[]): string[];
|
|
127
|
+
static gather(la: ILogAccumulator, logid: string, instance: string, dateKey: string, csvblob: string): void;
|
|
128
|
+
static aggregate(agg: ILogAccumulator, la: ILogAccumulator): void;
|
|
129
|
+
static datePatternToKeys(la: ILogAccumulator, pat: string): IKeyIndex;
|
|
130
|
+
static getToday(la: ILogAccumulator): IKeyIndex;
|
|
131
|
+
static getTodayRows(la: ILogAccumulator): any[];
|
|
132
|
+
static getDailyRows(la: ILogAccumulator, datePattern?: string, eventKeys?: IKeyIndex): any[];
|
|
133
|
+
static getLastDay(la: ILogAccumulator): any[];
|
|
134
|
+
static getTimerRows(la: ILogAccumulator, datePattern?: string, eventKeys?: IKeyIndex): any[];
|
|
135
|
+
static getErrorRows(la: ILogAccumulator, datePattern?: string, eventKeys?: IKeyIndex): any[];
|
|
136
|
+
static getEventRows(la: ILogAccumulator, datePattern?: string, eventKeys?: IKeyIndex): any[];
|
|
137
|
+
static getValueRows(la: ILogAccumulator, datePattern?: string, eventKeys?: IKeyIndex): any[];
|
|
138
|
+
}
|
|
139
|
+
export declare class FsmLogAccum extends FSM.Fsm {
|
|
140
|
+
options: AccumOptions;
|
|
141
|
+
root: LogItem;
|
|
142
|
+
blobLs: LogBlob;
|
|
143
|
+
lastErrorsRows: any[];
|
|
144
|
+
firstScanDone: boolean;
|
|
145
|
+
constructor(env: Environment, accum?: ILogAccumulator, options?: AccumOptions);
|
|
146
|
+
get env(): Environment;
|
|
147
|
+
resetLastErrors(): void;
|
|
148
|
+
getIncrementalErrors(): any[];
|
|
149
|
+
refresh(): void;
|
|
150
|
+
getCategories(): string[];
|
|
151
|
+
getSummaryRows(): any[];
|
|
152
|
+
getRows(category: string, datePattern?: string, eventKeys?: IKeyIndex): any[];
|
|
153
|
+
tick(): void;
|
|
154
|
+
}
|