@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,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 @@
|
|
|
1
|
+
export * from './log';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as Util from '../util/all';
|
|
2
|
+
import * as FSM from '../fsm/all';
|
|
3
|
+
export interface ILog {
|
|
4
|
+
dump: () => FSM.Fsm;
|
|
5
|
+
stamp: (o: any) => void;
|
|
6
|
+
log: (o: any, verbosity?: number) => void;
|
|
7
|
+
event: (o: any, verbosity?: number) => void;
|
|
8
|
+
error: (o: any) => void;
|
|
9
|
+
value: (o: any, verbosity?: number) => void;
|
|
10
|
+
chatter: (s: string) => void;
|
|
11
|
+
chatters: () => string[];
|
|
12
|
+
}
|
|
13
|
+
export declare class Timer {
|
|
14
|
+
ilog: ILog;
|
|
15
|
+
o: any;
|
|
16
|
+
verbosity: number;
|
|
17
|
+
elapsed: Util.Elapsed;
|
|
18
|
+
constructor(ilog: ILog, kind: string, o: any, verbosity?: number);
|
|
19
|
+
log(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class AsyncTimer extends Timer {
|
|
22
|
+
constructor(ilog: ILog, o: any, verbosity?: number);
|
|
23
|
+
}
|
|
24
|
+
export declare class SyncTimer extends Timer {
|
|
25
|
+
constructor(ilog: ILog, o: any, verbosity?: number);
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './log';
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { LogKey } from './logkey';
|
|
6
|
+
interface Environment {
|
|
7
|
+
context: Context.IContext;
|
|
8
|
+
log: LogAbstract.ILog;
|
|
9
|
+
fsmManager: FSM.FsmManager;
|
|
10
|
+
storageManager: Storage.StorageManager;
|
|
11
|
+
}
|
|
12
|
+
export declare class LogBlob extends Storage.StorageBlob {
|
|
13
|
+
key: LogKey;
|
|
14
|
+
constructor(env: Environment, params: Storage.BlobParams);
|
|
15
|
+
get env(): Environment;
|
|
16
|
+
get result(): string;
|
|
17
|
+
static createForDownload(env: Environment, id: string): LogBlob;
|
|
18
|
+
static createForUpload(env: Environment, id: string, data: string): LogBlob;
|
|
19
|
+
static createForDelete(env: Environment, id: string): LogBlob;
|
|
20
|
+
static createForLs(env: Environment): LogBlob;
|
|
21
|
+
filter(s: string): boolean;
|
|
22
|
+
asString(): string;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
interface Environment {
|
|
7
|
+
context: Context.IContext;
|
|
8
|
+
log: LogAbstract.ILog;
|
|
9
|
+
fsmManager: FSM.FsmManager;
|
|
10
|
+
storageManager: Storage.StorageManager;
|
|
11
|
+
}
|
|
12
|
+
export declare class FsmCompact extends FSM.Fsm {
|
|
13
|
+
blobLs: LogBlob;
|
|
14
|
+
clusters: {
|
|
15
|
+
[key: string]: string[];
|
|
16
|
+
};
|
|
17
|
+
constructor(env: Environment);
|
|
18
|
+
get env(): Environment;
|
|
19
|
+
gatherLogList(logs: string[]): void;
|
|
20
|
+
tick(): void;
|
|
21
|
+
}
|
|
22
|
+
declare class Permuter {
|
|
23
|
+
tag: string;
|
|
24
|
+
entries: {
|
|
25
|
+
[key: string]: {
|
|
26
|
+
key: string;
|
|
27
|
+
to: string;
|
|
28
|
+
from: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
mapper: {
|
|
32
|
+
[from: string]: string;
|
|
33
|
+
};
|
|
34
|
+
length: number;
|
|
35
|
+
constructor(tag: string);
|
|
36
|
+
reset(): void;
|
|
37
|
+
add(fields: string[]): void;
|
|
38
|
+
map(from: string): string;
|
|
39
|
+
asCSV(): string[];
|
|
40
|
+
}
|
|
41
|
+
export declare class FsmCompactOne extends FSM.Fsm {
|
|
42
|
+
key: string;
|
|
43
|
+
cluster: string[];
|
|
44
|
+
blobs: LogBlob[];
|
|
45
|
+
csv: string[];
|
|
46
|
+
schemas: Permuter;
|
|
47
|
+
templates: Permuter;
|
|
48
|
+
constructor(env: Environment, key: string, cluster: string[]);
|
|
49
|
+
get env(): Environment;
|
|
50
|
+
loadBlobs(): void;
|
|
51
|
+
saveBlobs(): void;
|
|
52
|
+
deleteBlobs(): void;
|
|
53
|
+
tick(): void;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare function dateToKey(d: Date): string;
|
|
2
|
+
export declare function dateToMonthKey(d: Date): string;
|
|
3
|
+
export declare function dateToYearKey(d: Date): string;
|
|
4
|
+
export declare class LogKey {
|
|
5
|
+
kind: string;
|
|
6
|
+
mode: string;
|
|
7
|
+
date: string;
|
|
8
|
+
dateKey: string;
|
|
9
|
+
monthKey: string;
|
|
10
|
+
yearKey: string;
|
|
11
|
+
count: string;
|
|
12
|
+
instance: string;
|
|
13
|
+
ext: string;
|
|
14
|
+
constructor();
|
|
15
|
+
static root(): LogKey;
|
|
16
|
+
static create(s: string): LogKey;
|
|
17
|
+
yearClosed(): boolean;
|
|
18
|
+
monthClosed(): boolean;
|
|
19
|
+
dateClosed(): boolean;
|
|
20
|
+
get closed(): boolean;
|
|
21
|
+
get yearID(): string;
|
|
22
|
+
get monthID(): string;
|
|
23
|
+
get dateID(): string;
|
|
24
|
+
get isYear(): boolean;
|
|
25
|
+
get isMonth(): boolean;
|
|
26
|
+
get isDate(): boolean;
|
|
27
|
+
get isLog(): boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as Q from './queue';
|
|
2
|
+
export declare type SQSCallback = (err: any, result: Q.QMessages) => void;
|
|
3
|
+
export declare class SQSClient {
|
|
4
|
+
private targeturl?;
|
|
5
|
+
private httpoptions?;
|
|
6
|
+
private agentPool?;
|
|
7
|
+
constructor(urlstring?: string);
|
|
8
|
+
setOptions(queueid: string, options: Q.QQueueOptions, cb: SQSCallback): void;
|
|
9
|
+
claim(queueid: string, owner: string, groupid: string, cb: SQSCallback): void;
|
|
10
|
+
send(queueid: string, m: Q.QMessage, cb: SQSCallback): void;
|
|
11
|
+
remove(queueid: string, m: Q.QMessage, cb: SQSCallback): void;
|
|
12
|
+
receive(queueid: string, owner: string, cb: SQSCallback): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Q from './queue';
|
|
2
|
+
import * as C from './client';
|
|
3
|
+
export declare class SQSClientLoopback {
|
|
4
|
+
constructor(urlstring?: string);
|
|
5
|
+
setOptions(queueid: string, options: Q.QQueueOptions, cb: C.SQSCallback): void;
|
|
6
|
+
claim(queueid: string, owner: string, groupid: string, cb: C.SQSCallback): void;
|
|
7
|
+
send(queueid: string, m: Q.QMessage, cb: C.SQSCallback): void;
|
|
8
|
+
remove(queueid: string, m: Q.QMessage, cb: C.SQSCallback): void;
|
|
9
|
+
receive(queueid: string, owner: string, cb: C.SQSCallback): void;
|
|
10
|
+
doReceive(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface OrderedListEntry<T> {
|
|
2
|
+
prev: OrderedListEntry<T>;
|
|
3
|
+
next: OrderedListEntry<T>;
|
|
4
|
+
value: T;
|
|
5
|
+
}
|
|
6
|
+
export declare type OrderedListIndex<T> = {
|
|
7
|
+
[key: string]: OrderedListEntry<T>;
|
|
8
|
+
};
|
|
9
|
+
export declare class OrderedList<T> {
|
|
10
|
+
head: OrderedListEntry<T>;
|
|
11
|
+
tail: OrderedListEntry<T>;
|
|
12
|
+
index: OrderedListIndex<T>;
|
|
13
|
+
constructor();
|
|
14
|
+
isempty(): boolean;
|
|
15
|
+
clear(): void;
|
|
16
|
+
insert(key: string, value: T): string;
|
|
17
|
+
remove(key: string): string;
|
|
18
|
+
forEach(cb: (value: T) => boolean): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as Util from '../util/all';
|
|
2
|
+
import * as OL from './orderedlist';
|
|
3
|
+
export declare const DefaultPort: number;
|
|
4
|
+
export declare const DefaultServerUrl: string;
|
|
5
|
+
export interface QMessage {
|
|
6
|
+
messageid: string;
|
|
7
|
+
groupid: string;
|
|
8
|
+
seqno?: number;
|
|
9
|
+
contents?: any;
|
|
10
|
+
blobid?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare type QMessages = QMessage[];
|
|
13
|
+
interface QMessageHolder {
|
|
14
|
+
m: QMessage;
|
|
15
|
+
pending: boolean;
|
|
16
|
+
deadline: Util.Deadline;
|
|
17
|
+
}
|
|
18
|
+
declare type QMessageList = OL.OrderedList<QMessageHolder>;
|
|
19
|
+
declare type QMessageIndex = {
|
|
20
|
+
[key: string]: boolean;
|
|
21
|
+
};
|
|
22
|
+
interface QVisibility {
|
|
23
|
+
owner: string;
|
|
24
|
+
deadline: Util.Deadline;
|
|
25
|
+
index: QMessageIndex;
|
|
26
|
+
}
|
|
27
|
+
interface QGroup {
|
|
28
|
+
id: string;
|
|
29
|
+
messages: QMessageList;
|
|
30
|
+
visibility: QVisibility;
|
|
31
|
+
}
|
|
32
|
+
declare type QGroupIndex = {
|
|
33
|
+
[id: string]: QGroup;
|
|
34
|
+
};
|
|
35
|
+
export interface QQueueOptions {
|
|
36
|
+
timeoutVisibility: number;
|
|
37
|
+
timeoutDead: number;
|
|
38
|
+
timeoutQueueDead: number;
|
|
39
|
+
receiveLimit: number;
|
|
40
|
+
longpoll: boolean;
|
|
41
|
+
}
|
|
42
|
+
declare class QQueue {
|
|
43
|
+
id: string;
|
|
44
|
+
groups: QGroupIndex;
|
|
45
|
+
seqno: number;
|
|
46
|
+
options: QQueueOptions;
|
|
47
|
+
nHeld: number;
|
|
48
|
+
lastActive: Util.Elapsed;
|
|
49
|
+
constructor(id: string, options?: QQueueOptions);
|
|
50
|
+
dumpLog(): void;
|
|
51
|
+
setOptions(options: QQueueOptions): void;
|
|
52
|
+
_group(id: string): QGroup;
|
|
53
|
+
forEachGroup(cb: (g: QGroup) => boolean): void;
|
|
54
|
+
forEachMessageHolder(g: QGroup, cb: (h: QMessageHolder) => boolean): void;
|
|
55
|
+
get isActive(): boolean;
|
|
56
|
+
checkTimeout(): void;
|
|
57
|
+
send(m: QMessage): string;
|
|
58
|
+
claim(owner: string, groupid: string): string;
|
|
59
|
+
receive(owner: string, result: QMessages): void;
|
|
60
|
+
removeFromGroup(g: QGroup, m: QMessage): string;
|
|
61
|
+
remove(m: QMessage): string;
|
|
62
|
+
}
|
|
63
|
+
declare type QQueueIndex = {
|
|
64
|
+
[id: string]: QQueue;
|
|
65
|
+
};
|
|
66
|
+
export declare class QQueueManager {
|
|
67
|
+
queues: QQueueIndex;
|
|
68
|
+
nSent: number;
|
|
69
|
+
nReceived: number;
|
|
70
|
+
nRemoved: number;
|
|
71
|
+
nCulled: number;
|
|
72
|
+
constructor();
|
|
73
|
+
_queue(queueid: string): QQueue;
|
|
74
|
+
checkTimeout(): void;
|
|
75
|
+
forEach(cb: (q: QQueue) => void): void;
|
|
76
|
+
dumpLog(): void;
|
|
77
|
+
setOptions(queueid: string, options: QQueueOptions): void;
|
|
78
|
+
isLongpoll(queueid: string): boolean;
|
|
79
|
+
claim(queueid: string, owner: string, groupid: string): string;
|
|
80
|
+
send(queueid: string, m: QMessage): string;
|
|
81
|
+
receive(queueid: string, owner: string, result: QMessages): void;
|
|
82
|
+
remove(queueid: string, m: QMessage): string;
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as JS from '../jsonstream/all';
|
|
2
|
+
import * as Q from './queue';
|
|
3
|
+
export declare class SQSServer {
|
|
4
|
+
private port;
|
|
5
|
+
private server;
|
|
6
|
+
queuemanager: Q.QQueueManager;
|
|
7
|
+
longpoll: LongPoll;
|
|
8
|
+
constructor(port?: number);
|
|
9
|
+
get running(): boolean;
|
|
10
|
+
close(): void;
|
|
11
|
+
}
|
|
12
|
+
interface LongPollRequest {
|
|
13
|
+
deadline: number;
|
|
14
|
+
request: OneRequest;
|
|
15
|
+
}
|
|
16
|
+
declare class LongPoll {
|
|
17
|
+
requests: LongPollRequest[];
|
|
18
|
+
constructor();
|
|
19
|
+
check(): void;
|
|
20
|
+
tick(): void;
|
|
21
|
+
add(one: OneRequest): void;
|
|
22
|
+
}
|
|
23
|
+
declare class OneRequest {
|
|
24
|
+
server: SQSServer;
|
|
25
|
+
req: any;
|
|
26
|
+
res: any;
|
|
27
|
+
jsonstream: JS.JSONStreamReader;
|
|
28
|
+
json: any;
|
|
29
|
+
body: any;
|
|
30
|
+
constructor(server: SQSServer, req: any, res: any);
|
|
31
|
+
isDone(): boolean;
|
|
32
|
+
onRetry(): boolean;
|
|
33
|
+
onDone(): void;
|
|
34
|
+
onError(s: string): void;
|
|
35
|
+
onFinish(): void;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as LogAbstract from '../logabstract/all';
|
|
2
|
+
import * as OT from '../ot-js/all';
|
|
3
|
+
export declare class OTEditUtil {
|
|
4
|
+
ilog: LogAbstract.ILog;
|
|
5
|
+
resourceID: string;
|
|
6
|
+
resourceName: string;
|
|
7
|
+
clientID: string;
|
|
8
|
+
constructor(ilog: LogAbstract.ILog, rid: string, cid: string, name: string);
|
|
9
|
+
insertAtStart(s: any, nCurrentLen: number): OT.OTCompositeResource;
|
|
10
|
+
insertAtEnd(s: any, nCurrentLen: number): OT.OTCompositeResource;
|
|
11
|
+
injectCursor(edit: OT.OTCompositeResource, start: number, end?: number): void;
|
|
12
|
+
extractCursor(edit: OT.OTCompositeResource): any;
|
|
13
|
+
computeEdit(sOld: string, sNew: string): OT.OTCompositeResource;
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as OT from '../ot-js/all';
|
|
2
|
+
export declare const MERGE: number;
|
|
3
|
+
export declare const REPLACE: number;
|
|
4
|
+
export declare class Editor {
|
|
5
|
+
private engine;
|
|
6
|
+
private root;
|
|
7
|
+
private stamps;
|
|
8
|
+
constructor(engine: OT.OTEngine);
|
|
9
|
+
startLocalEdit(): void;
|
|
10
|
+
stamp(rid: string, prop: string): void;
|
|
11
|
+
set(rid: string, p: string, v: any): Editor;
|
|
12
|
+
del(rid: string, p: string): Editor;
|
|
13
|
+
rawObject(rid: string): OT.OTMapResource;
|
|
14
|
+
rawArray(rid: string): OT.OTArrayResource;
|
|
15
|
+
editCounter(rid: string, oNew: any, mode?: number): void;
|
|
16
|
+
editObject(rid: string, oNew: any, mode?: number): void;
|
|
17
|
+
editArray(rid: string, aNew: any[]): void;
|
|
18
|
+
edit(oNew: any): boolean;
|
|
19
|
+
get length(): number;
|
|
20
|
+
commit(): boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./otarray";
|
|
2
|
+
export * from "./otengine";
|
|
3
|
+
export * from "./otclientengine";
|
|
4
|
+
export * from "./otcomposite";
|
|
5
|
+
export * from "./otmap";
|
|
6
|
+
export * from "./otcounter";
|
|
7
|
+
export * from "./otserverengine";
|
|
8
|
+
export * from "./ottypes";
|
|
9
|
+
export * from "./otsession";
|