@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 declare function selfIntersectFast(poly: any): boolean;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as FSM from '../fsm/all';
|
|
2
|
+
import * as P from './poly';
|
|
3
|
+
import * as Q from './quad';
|
|
4
|
+
export declare type Topo = any;
|
|
5
|
+
export declare function topoFromCollection(col: any): Topo;
|
|
6
|
+
export declare function topoContiguity(topo: Topo): any;
|
|
7
|
+
export declare function topoToFeature(topo: Topo, geoid: string): any;
|
|
8
|
+
export declare function topoToCollection(topo: Topo): any;
|
|
9
|
+
export interface SimplifyOptions {
|
|
10
|
+
minArea?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function topoSimplifyCollection(col: any, options?: SimplifyOptions): any;
|
|
13
|
+
export declare function topoMerge(topo: Topo, geoids: string[]): any;
|
|
14
|
+
export declare function topoMergeFeatures(topo: Topo, features: any[]): any;
|
|
15
|
+
declare class FsmIncrementalUnion extends FSM.Fsm {
|
|
16
|
+
options: P.TickOptions;
|
|
17
|
+
key: any;
|
|
18
|
+
map: any;
|
|
19
|
+
result: any;
|
|
20
|
+
work: Q.WorkDone;
|
|
21
|
+
constructor(env: FSM.FsmEnvironment, options: P.TickOptions, key: any, map?: any);
|
|
22
|
+
matches(key: any): boolean;
|
|
23
|
+
recompute(map: any): void;
|
|
24
|
+
cancel(): void;
|
|
25
|
+
tick(): void;
|
|
26
|
+
}
|
|
27
|
+
export interface TopoUnionResult {
|
|
28
|
+
key: any;
|
|
29
|
+
poly: any;
|
|
30
|
+
work: Q.WorkDone;
|
|
31
|
+
}
|
|
32
|
+
export declare class FsmTopoUnion extends FSM.Fsm {
|
|
33
|
+
options: P.TickOptions;
|
|
34
|
+
unions: FsmIncrementalUnion[];
|
|
35
|
+
work: Q.WorkDone;
|
|
36
|
+
constructor(env: FSM.FsmEnvironment, options?: P.TickOptions);
|
|
37
|
+
get result(): TopoUnionResult[];
|
|
38
|
+
cancel(): void;
|
|
39
|
+
cancelOne(key: any): void;
|
|
40
|
+
recompute(key: any, map: any): void;
|
|
41
|
+
tick(): void;
|
|
42
|
+
}
|
|
43
|
+
export declare function topoPacked(topo: any): boolean;
|
|
44
|
+
export declare function topoPack(topo: any): any;
|
|
45
|
+
export declare function topoUnpack(topo: any): any;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as FSM from '../fsm/all';
|
|
2
|
+
import * as Poly from './poly';
|
|
3
|
+
import * as Q from './quad';
|
|
4
|
+
export declare function polyIntersects(p1: any, p2: any): boolean;
|
|
5
|
+
declare class FsmDifference extends FSM.Fsm {
|
|
6
|
+
accum: any;
|
|
7
|
+
polys: any[];
|
|
8
|
+
work: Q.WorkDone;
|
|
9
|
+
constructor(env: FSM.FsmEnvironment, accum?: any, polys?: any[]);
|
|
10
|
+
initialize(accum: any, polys: any[]): void;
|
|
11
|
+
cancel(): void;
|
|
12
|
+
get result(): any;
|
|
13
|
+
tick(): void;
|
|
14
|
+
}
|
|
15
|
+
declare class FsmIncrementalUnion extends FSM.Fsm {
|
|
16
|
+
options: Poly.TickOptions;
|
|
17
|
+
key: any;
|
|
18
|
+
map: any;
|
|
19
|
+
result: any;
|
|
20
|
+
lastCompleteMap: any;
|
|
21
|
+
lastCompleteResult: any;
|
|
22
|
+
toSub: any[];
|
|
23
|
+
fsmUnion: Q.FsmQuadTree;
|
|
24
|
+
fsmDifference: FsmDifference;
|
|
25
|
+
work: Q.WorkDone;
|
|
26
|
+
constructor(env: FSM.FsmEnvironment, options: Poly.TickOptions, key: any, map?: any);
|
|
27
|
+
matches(key: any): boolean;
|
|
28
|
+
recompute(map: any): void;
|
|
29
|
+
cancel(): void;
|
|
30
|
+
tick(): void;
|
|
31
|
+
}
|
|
32
|
+
export interface UnionResult {
|
|
33
|
+
key: any;
|
|
34
|
+
poly: any;
|
|
35
|
+
work: Q.WorkDone;
|
|
36
|
+
}
|
|
37
|
+
export declare class FsmUnion extends FSM.Fsm {
|
|
38
|
+
options: Poly.TickOptions;
|
|
39
|
+
unions: FsmIncrementalUnion[];
|
|
40
|
+
work: Q.WorkDone;
|
|
41
|
+
constructor(env: FSM.FsmEnvironment, options?: Poly.TickOptions);
|
|
42
|
+
get result(): UnionResult[];
|
|
43
|
+
cancel(): void;
|
|
44
|
+
cancelOne(key: any): void;
|
|
45
|
+
recompute(key: any, map: any): void;
|
|
46
|
+
tick(): void;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Environment } from './env';
|
|
2
|
+
import * as Storage from './storage';
|
|
3
|
+
export declare class DataBlob extends Storage.StorageBlob {
|
|
4
|
+
constructor(env: Environment, params: Storage.BlobParams);
|
|
5
|
+
get env(): Environment;
|
|
6
|
+
get json(): any;
|
|
7
|
+
static createForJSON(env: Environment, id: string): DataBlob;
|
|
8
|
+
static createForStream(env: Environment, id: string, bucket?: string): DataBlob;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Context from '../context/all';
|
|
2
|
+
import * as FSM from '../fsm/all';
|
|
3
|
+
import * as LogAbstract from '../logabstract/all';
|
|
4
|
+
import * as Storage from './storage';
|
|
5
|
+
export interface Environment {
|
|
6
|
+
context: Context.IContext;
|
|
7
|
+
log: LogAbstract.ILog;
|
|
8
|
+
fsmManager: FSM.FsmManager;
|
|
9
|
+
storageManager: Storage.StorageManager;
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Environment } from './env';
|
|
2
|
+
import * as Storage from './storage';
|
|
3
|
+
export declare class SplitsBlob extends Storage.StorageBlob {
|
|
4
|
+
ls: {
|
|
5
|
+
[key: string]: Storage.BlobProperties;
|
|
6
|
+
};
|
|
7
|
+
constructor(env: Environment, params: Storage.BlobParams);
|
|
8
|
+
get env(): Environment;
|
|
9
|
+
get collection(): any;
|
|
10
|
+
static createForLs(env: Environment): SplitsBlob;
|
|
11
|
+
static createForUpload(env: Environment, id: string, collection: any): SplitsBlob;
|
|
12
|
+
static createForDownload(env: Environment, id: string): SplitsBlob;
|
|
13
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as stream from 'stream';
|
|
3
|
+
import * as FSM from '../fsm/all';
|
|
4
|
+
import { Environment } from './env';
|
|
5
|
+
export declare const ESuccess: number;
|
|
6
|
+
export declare const EFail: number;
|
|
7
|
+
export declare const ENotFound: number;
|
|
8
|
+
export declare const EPending: number;
|
|
9
|
+
export declare const EBadFormat: number;
|
|
10
|
+
export declare type StorageState = number;
|
|
11
|
+
export declare const StorageStateClean = 0;
|
|
12
|
+
export declare const StorageStateDirty = 1;
|
|
13
|
+
export declare const StorageStateSaving = 2;
|
|
14
|
+
export declare const StorageStateLoading = 4;
|
|
15
|
+
export declare const StorageStateLoadCanceled = 8;
|
|
16
|
+
export declare const StorageStateLoadFailed = 16;
|
|
17
|
+
export declare const StorageStateDeleting = 32;
|
|
18
|
+
export declare const StorageStateDeleted = 64;
|
|
19
|
+
export declare const StorageStateListing = 128;
|
|
20
|
+
export declare type BucketMap = {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const BucketDefault = "default";
|
|
24
|
+
export declare const BucketDev = "development";
|
|
25
|
+
export declare const BucketProd = "production";
|
|
26
|
+
export declare const BucketLogs = "logs";
|
|
27
|
+
export declare type TransferUrlOp = 'putObject' | 'getObject';
|
|
28
|
+
export interface TransferParams {
|
|
29
|
+
op: TransferUrlOp;
|
|
30
|
+
contentType?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare type DispositionType = 'object' | 'string' | 'buffer' | 'stream' | 'filepath';
|
|
33
|
+
export declare type LoadToFilter = (blob: StorageBlob, a: any) => any;
|
|
34
|
+
export interface BlobParams {
|
|
35
|
+
id: string;
|
|
36
|
+
bucket?: string;
|
|
37
|
+
saveFromType?: DispositionType;
|
|
38
|
+
saveFrom?: any;
|
|
39
|
+
loadToType?: DispositionType;
|
|
40
|
+
loadTo?: any;
|
|
41
|
+
loadToFilter?: LoadToFilter;
|
|
42
|
+
deleteAfterLoad?: boolean;
|
|
43
|
+
suppressDeleteError?: boolean;
|
|
44
|
+
ContentEncoding?: string;
|
|
45
|
+
ContentType?: string;
|
|
46
|
+
CacheControl?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare class FsmTransferUrl extends FSM.Fsm {
|
|
49
|
+
bucket: string;
|
|
50
|
+
key: string;
|
|
51
|
+
params: TransferParams;
|
|
52
|
+
url: string;
|
|
53
|
+
constructor(env: Environment, bucket: string, params: TransferParams);
|
|
54
|
+
}
|
|
55
|
+
export interface BlobProperties {
|
|
56
|
+
Key?: string;
|
|
57
|
+
ContentLength?: number;
|
|
58
|
+
ContentDisposition?: string;
|
|
59
|
+
ContentEncoding?: string;
|
|
60
|
+
ContentType?: string;
|
|
61
|
+
ContentLanguage?: string;
|
|
62
|
+
LastModified?: string;
|
|
63
|
+
ETag?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface MultiBufferList {
|
|
66
|
+
buf: Buffer;
|
|
67
|
+
next: MultiBufferList;
|
|
68
|
+
}
|
|
69
|
+
export declare class MultiBufferPassThrough extends stream.Duplex {
|
|
70
|
+
_dopush: boolean;
|
|
71
|
+
_head: MultiBufferList;
|
|
72
|
+
_tail: MultiBufferList;
|
|
73
|
+
constructor();
|
|
74
|
+
_read(): void;
|
|
75
|
+
_dopushing(): void;
|
|
76
|
+
_pushChunk(chunk: any): void;
|
|
77
|
+
_write(chunk: any, encoding: string, cb: any): void;
|
|
78
|
+
_done(): void;
|
|
79
|
+
_flush(cb: any): void;
|
|
80
|
+
_transform(chunk: any, encoding: string, cb: any): void;
|
|
81
|
+
}
|
|
82
|
+
export declare class StorageBlob {
|
|
83
|
+
_env: Environment;
|
|
84
|
+
params: BlobParams;
|
|
85
|
+
state: StorageState;
|
|
86
|
+
tStarted: Date;
|
|
87
|
+
fsmSave: FSM.Fsm;
|
|
88
|
+
fsmLoad: FSM.Fsm;
|
|
89
|
+
fsmDel: FSM.Fsm;
|
|
90
|
+
fsmList: FSM.Fsm;
|
|
91
|
+
_props: FSM.FsmArray;
|
|
92
|
+
_keys: FSM.FsmArray;
|
|
93
|
+
constructor(env: Environment, params: BlobParams);
|
|
94
|
+
get env(): Environment;
|
|
95
|
+
get keys(): string[];
|
|
96
|
+
get props(): BlobProperties[];
|
|
97
|
+
resetList(): void;
|
|
98
|
+
get fsmArray(): FSM.Fsm;
|
|
99
|
+
setSaveFrom(t: DispositionType, data: any): void;
|
|
100
|
+
setLoadTo(t: DispositionType): void;
|
|
101
|
+
needSave(): boolean;
|
|
102
|
+
isSaving(): boolean;
|
|
103
|
+
isLoading(): boolean;
|
|
104
|
+
isListing(): boolean;
|
|
105
|
+
setListing(): void;
|
|
106
|
+
setListed(): void;
|
|
107
|
+
isDeleting(): boolean;
|
|
108
|
+
isDeleted(): boolean;
|
|
109
|
+
isLoadFailed(): boolean;
|
|
110
|
+
isValid(): boolean;
|
|
111
|
+
isReadable(): boolean;
|
|
112
|
+
isDirty(): boolean;
|
|
113
|
+
isSafeToUnload(): boolean;
|
|
114
|
+
setDirty(): void;
|
|
115
|
+
setInit(): void;
|
|
116
|
+
setLoading(): void;
|
|
117
|
+
setLoaded(result: number): void;
|
|
118
|
+
setSaving(): void;
|
|
119
|
+
setSaved(result: number): void;
|
|
120
|
+
setDeleting(): void;
|
|
121
|
+
setDeleted(result: number): void;
|
|
122
|
+
startLoad(sm: StorageManager): void;
|
|
123
|
+
startHead(sm: StorageManager): void;
|
|
124
|
+
checkSave(sm: StorageManager): void;
|
|
125
|
+
startDelete(sm: StorageManager): void;
|
|
126
|
+
endSave(br: BlobRequest): void;
|
|
127
|
+
endLoad(br: BlobRequest): void;
|
|
128
|
+
endHead(br: BlobRequest): void;
|
|
129
|
+
endDelete(br: BlobRequest): void;
|
|
130
|
+
startList(sm: StorageManager, continuationToken?: string): void;
|
|
131
|
+
endList(br: BlobRequest): void;
|
|
132
|
+
toLoadStream(): stream.Readable;
|
|
133
|
+
setLoadStream(rs: stream.Readable): void;
|
|
134
|
+
}
|
|
135
|
+
export interface BlobRequest {
|
|
136
|
+
blob: StorageBlob;
|
|
137
|
+
result(): number;
|
|
138
|
+
asBuffer(): Buffer;
|
|
139
|
+
asString(): string;
|
|
140
|
+
asError(): string;
|
|
141
|
+
asProps(): BlobProperties[];
|
|
142
|
+
continuationToken(): string;
|
|
143
|
+
}
|
|
144
|
+
export interface BlobRequestIndex {
|
|
145
|
+
[key: string]: BlobRequest;
|
|
146
|
+
}
|
|
147
|
+
export declare class StorageManager {
|
|
148
|
+
_env: Environment;
|
|
149
|
+
saveBlobIndex: BlobRequestIndex;
|
|
150
|
+
loadBlobIndex: BlobRequestIndex;
|
|
151
|
+
headBlobIndex: BlobRequestIndex;
|
|
152
|
+
delBlobIndex: BlobRequestIndex;
|
|
153
|
+
lsBlobIndex: BlobRequestIndex;
|
|
154
|
+
onList: any;
|
|
155
|
+
bucketMap: BucketMap;
|
|
156
|
+
constructor(env: Environment, bucketMap?: BucketMap);
|
|
157
|
+
save(blob: StorageBlob): void;
|
|
158
|
+
load(blob: StorageBlob): void;
|
|
159
|
+
del(blob: StorageBlob): void;
|
|
160
|
+
head(blob: StorageBlob): void;
|
|
161
|
+
ls(blob: StorageBlob, continuationToken?: string): void;
|
|
162
|
+
createTransferUrl(params: TransferParams): FsmTransferUrl;
|
|
163
|
+
on(eventName: string, cb: any): void;
|
|
164
|
+
off(eventName: string, cb: any): void;
|
|
165
|
+
emit(eventName: string, blob: StorageBlob): void;
|
|
166
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './s3';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as Context from '../context/all';
|
|
3
|
+
import * as Storage from '../storage/all';
|
|
4
|
+
import * as LogAbstract from '../logabstract/all';
|
|
5
|
+
import * as FSM from '../fsm/all';
|
|
6
|
+
export interface Environment {
|
|
7
|
+
context: Context.IContext;
|
|
8
|
+
log: LogAbstract.ILog;
|
|
9
|
+
fsmManager: FSM.FsmManager;
|
|
10
|
+
storageManager: Storage.StorageManager;
|
|
11
|
+
}
|
|
12
|
+
declare class S3Request implements Storage.BlobRequest {
|
|
13
|
+
blob: Storage.StorageBlob;
|
|
14
|
+
req: any;
|
|
15
|
+
res: any;
|
|
16
|
+
data: any;
|
|
17
|
+
err: any;
|
|
18
|
+
constructor(blob: Storage.StorageBlob);
|
|
19
|
+
continuationToken(): string;
|
|
20
|
+
result(): number;
|
|
21
|
+
decode(): void;
|
|
22
|
+
asString(): string;
|
|
23
|
+
asBuffer(): Buffer;
|
|
24
|
+
_dataToProps(data: any): Storage.BlobProperties;
|
|
25
|
+
asProps(): Storage.BlobProperties[];
|
|
26
|
+
asError(): string;
|
|
27
|
+
}
|
|
28
|
+
export declare class FsmStreamLoader extends FSM.Fsm {
|
|
29
|
+
sm: StorageManager;
|
|
30
|
+
blob: Storage.StorageBlob;
|
|
31
|
+
param: any;
|
|
32
|
+
err: any;
|
|
33
|
+
contentLength: number;
|
|
34
|
+
contentPos: number;
|
|
35
|
+
readStream: Storage.MultiBufferPassThrough;
|
|
36
|
+
passThrough: Storage.MultiBufferPassThrough;
|
|
37
|
+
constructor(env: Environment, sm: StorageManager, blob: Storage.StorageBlob);
|
|
38
|
+
get env(): Environment;
|
|
39
|
+
setStreamError(): void;
|
|
40
|
+
tick(): void;
|
|
41
|
+
}
|
|
42
|
+
export declare class FsmTransferUrl extends Storage.FsmTransferUrl {
|
|
43
|
+
storageManager: StorageManager;
|
|
44
|
+
constructor(env: Environment, bucket: string, params: Storage.TransferParams);
|
|
45
|
+
}
|
|
46
|
+
export declare class StorageManager extends Storage.StorageManager {
|
|
47
|
+
s3: any;
|
|
48
|
+
count: number;
|
|
49
|
+
constructor(env: Environment, bucketMap?: Storage.BucketMap);
|
|
50
|
+
get env(): Environment;
|
|
51
|
+
lookupBucket(s: string): string;
|
|
52
|
+
blobBucket(blob: Storage.StorageBlob): string;
|
|
53
|
+
load(blob: Storage.StorageBlob): void;
|
|
54
|
+
_finishLoad(blob: Storage.StorageBlob, id: string, rq: S3Request, err: any, data: any): void;
|
|
55
|
+
head(blob: Storage.StorageBlob): void;
|
|
56
|
+
safeSaveFromPath(blob: Storage.StorageBlob, rq: S3Request, id: string, trace: LogAbstract.AsyncTimer): any;
|
|
57
|
+
save(blob: Storage.StorageBlob): void;
|
|
58
|
+
del(blob: Storage.StorageBlob): void;
|
|
59
|
+
ls(blob: Storage.StorageBlob, continuationToken?: string): void;
|
|
60
|
+
createTransferUrl(params: Storage.TransferParams): Storage.FsmTransferUrl;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export interface Coder {
|
|
2
|
+
encoder: {
|
|
3
|
+
encode: (s: string) => Uint8Array;
|
|
4
|
+
};
|
|
5
|
+
decoder: {
|
|
6
|
+
decode: (u8: Uint8Array) => string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare function s2u8(coder: Coder, s: string): Uint8Array;
|
|
10
|
+
export declare function u82s(coder: Coder, u8: Uint8Array, offset: number, n: number): string;
|
|
11
|
+
interface Fragment {
|
|
12
|
+
count: number;
|
|
13
|
+
used: number;
|
|
14
|
+
offset: number;
|
|
15
|
+
s: string;
|
|
16
|
+
u8?: Uint8Array;
|
|
17
|
+
}
|
|
18
|
+
declare type FragmentTable = {
|
|
19
|
+
[frag: string]: Fragment;
|
|
20
|
+
};
|
|
21
|
+
declare type FragmentPair = {
|
|
22
|
+
f1: Fragment;
|
|
23
|
+
f2: Fragment;
|
|
24
|
+
offset?: number;
|
|
25
|
+
};
|
|
26
|
+
declare class ValueTable {
|
|
27
|
+
coder: Coder;
|
|
28
|
+
ab: ArrayBuffer;
|
|
29
|
+
u8: Uint8Array;
|
|
30
|
+
u32: Uint32Array;
|
|
31
|
+
constructor(coder: Coder);
|
|
32
|
+
static fromBuffer(coder: Coder, ab: ArrayBuffer, offset: number, length: number): ValueTable;
|
|
33
|
+
fromOffset(offset: number): string;
|
|
34
|
+
}
|
|
35
|
+
declare class ValueTableBuilder {
|
|
36
|
+
coder: Coder;
|
|
37
|
+
values: string[];
|
|
38
|
+
fragments: FragmentTable;
|
|
39
|
+
pairs: {
|
|
40
|
+
[value: string]: FragmentPair;
|
|
41
|
+
};
|
|
42
|
+
ab: ArrayBuffer;
|
|
43
|
+
u8: Uint8Array;
|
|
44
|
+
u32: Uint32Array;
|
|
45
|
+
constructor(coder: Coder);
|
|
46
|
+
static fromStrings(coder: Coder, values: string[]): ValueTableBuilder;
|
|
47
|
+
validateStrings(values: string[]): void;
|
|
48
|
+
addFragment(s: string): void;
|
|
49
|
+
extractFragments(s: string): void;
|
|
50
|
+
pickFragments(s: string): void;
|
|
51
|
+
toOffset(s: string): number;
|
|
52
|
+
toBinary(): void;
|
|
53
|
+
}
|
|
54
|
+
export declare type StringMap = {
|
|
55
|
+
[key: string]: string;
|
|
56
|
+
};
|
|
57
|
+
interface UnpackedNode {
|
|
58
|
+
suffix: Uint8Array;
|
|
59
|
+
value: number;
|
|
60
|
+
bytes: number[] | null;
|
|
61
|
+
nodes: UnpackedNode[] | null;
|
|
62
|
+
}
|
|
63
|
+
export declare class BinTrie {
|
|
64
|
+
coder: Coder;
|
|
65
|
+
ab: ArrayBuffer;
|
|
66
|
+
vt: ValueTable;
|
|
67
|
+
u8: Uint8Array;
|
|
68
|
+
i32: Int32Array;
|
|
69
|
+
constructor(coder: Coder);
|
|
70
|
+
static fromBuffer(coder: Coder, ab: ArrayBuffer): BinTrie;
|
|
71
|
+
get(key: string): string;
|
|
72
|
+
}
|
|
73
|
+
export declare class BinTrieBuilder {
|
|
74
|
+
coder: Coder;
|
|
75
|
+
root: UnpackedNode;
|
|
76
|
+
vtb: ValueTableBuilder;
|
|
77
|
+
vt: ValueTable;
|
|
78
|
+
ab: ArrayBuffer;
|
|
79
|
+
u8: Uint8Array;
|
|
80
|
+
i32: Int32Array;
|
|
81
|
+
constructor(coder: Coder);
|
|
82
|
+
nodeCount(node: UnpackedNode): number;
|
|
83
|
+
nodeBranching(node: UnpackedNode, counts: number[]): number;
|
|
84
|
+
nodeValueCount(node: UnpackedNode): number;
|
|
85
|
+
nodeByteLength(node: UnpackedNode): number;
|
|
86
|
+
addString(s: string, value: number): void;
|
|
87
|
+
dedup(node: UnpackedNode): void;
|
|
88
|
+
getUnpacked(key: string): string;
|
|
89
|
+
packNode(node: UnpackedNode, byteOffset: number): number;
|
|
90
|
+
toBinary(): void;
|
|
91
|
+
static fromMap(coder: Coder, o: StringMap): BinTrie;
|
|
92
|
+
}
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class CountedHash {
|
|
2
|
+
n: number;
|
|
3
|
+
val: {
|
|
4
|
+
[id: string]: true | null;
|
|
5
|
+
};
|
|
6
|
+
constructor();
|
|
7
|
+
get length(): number;
|
|
8
|
+
indeterminate(id: string): boolean;
|
|
9
|
+
test(id: string): boolean;
|
|
10
|
+
set(id: string, val?: true | null): void;
|
|
11
|
+
clear(id: string): void;
|
|
12
|
+
apply(vals: {
|
|
13
|
+
[id: string]: boolean | null;
|
|
14
|
+
}): void;
|
|
15
|
+
empty(): void;
|
|
16
|
+
asArray(): string[];
|
|
17
|
+
asString(): string;
|
|
18
|
+
forEach(f: (id: string) => void): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface RGB {
|
|
2
|
+
r: number;
|
|
3
|
+
g: number;
|
|
4
|
+
b: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Stop {
|
|
7
|
+
color: string;
|
|
8
|
+
stop: number;
|
|
9
|
+
rgb?: RGB;
|
|
10
|
+
}
|
|
11
|
+
export declare type GradientStops = Stop[];
|
|
12
|
+
export declare function execGradient(stops: GradientStops, value: number): string;
|
|
13
|
+
export declare function parseGradient(sStops: string): GradientStops;
|
|
14
|
+
export declare function asCSSGradient(stops: GradientStops): string;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class IndexedArray {
|
|
2
|
+
o: any;
|
|
3
|
+
a: any[];
|
|
4
|
+
constructor();
|
|
5
|
+
ensure(): void;
|
|
6
|
+
asArray(): any[];
|
|
7
|
+
get length(): number;
|
|
8
|
+
test(s: string): boolean;
|
|
9
|
+
set(s: string): void;
|
|
10
|
+
setAll(a: string[]): void;
|
|
11
|
+
clear(s: string): void;
|
|
12
|
+
at(i: number): string;
|
|
13
|
+
empty(): void;
|
|
14
|
+
forEach(f: (s: string) => void): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare type DateString = string;
|
|
2
|
+
export declare function Now(): DateString;
|
|
3
|
+
export declare class Elapsed {
|
|
4
|
+
tStart: any;
|
|
5
|
+
tDur: any;
|
|
6
|
+
constructor(bStart?: boolean);
|
|
7
|
+
start(): void;
|
|
8
|
+
end(): void;
|
|
9
|
+
ms(): number;
|
|
10
|
+
nano(): number;
|
|
11
|
+
}
|
|
12
|
+
export declare class MultiTimer {
|
|
13
|
+
_overall: Elapsed;
|
|
14
|
+
_segment: Elapsed;
|
|
15
|
+
_msAggregate: number;
|
|
16
|
+
constructor(bStart?: boolean);
|
|
17
|
+
start(): void;
|
|
18
|
+
end(): number;
|
|
19
|
+
segstart(): void;
|
|
20
|
+
segend(): number;
|
|
21
|
+
get overall(): number;
|
|
22
|
+
get aggregate(): number;
|
|
23
|
+
}
|
|
24
|
+
export declare class Deadline {
|
|
25
|
+
msDelta: number;
|
|
26
|
+
elapsed: Elapsed;
|
|
27
|
+
constructor(msDelta: number);
|
|
28
|
+
start(): void;
|
|
29
|
+
done(): boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function createGuid(): string;
|
|
32
|
+
export declare function sizeof(a: any): number;
|
|
33
|
+
export declare function depthof(a: any): number;
|
|
34
|
+
export declare function isEmpty(o: any): boolean;
|
|
35
|
+
export declare function countKeys(o: any): number;
|
|
36
|
+
export declare function nthProperty(o: any, n?: number): any;
|
|
37
|
+
export declare function nthKey(o: any, n?: number): any;
|
|
38
|
+
export declare function partialEqual(o: any, subset: any): boolean;
|
|
39
|
+
export interface EqOptions {
|
|
40
|
+
omitKey?: {
|
|
41
|
+
[key: string]: boolean;
|
|
42
|
+
};
|
|
43
|
+
unorderedArrays?: boolean;
|
|
44
|
+
emptyStringIsNull: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare function deepEqual(o1: any, o2: any, options?: EqOptions): boolean;
|
|
47
|
+
export declare function prettyDate(d: Date): string;
|
|
48
|
+
export declare function relativeDate(d: Date): string;
|
|
49
|
+
export declare function recentDate(d: Date): string;
|
|
50
|
+
export declare function textToHtml(sText: string): string;
|
|
51
|
+
export declare function shallowCopy(src: any): any;
|
|
52
|
+
export declare function shallowAssign(o1: any, o2: any): any;
|
|
53
|
+
export declare function shallowDelete(o1: any, o2: any): any;
|
|
54
|
+
export declare function shallowAssignImmutable(o1: any, o2: any): any;
|
|
55
|
+
export declare function shallowEqual(o1: any, o2: any): boolean;
|
|
56
|
+
export declare function deepCopy(src: any): any;
|
|
57
|
+
export declare function deepAccum(accum: any, o: any): any;
|
|
58
|
+
export declare function precisionRound(n: number, p: number): number;
|
|
59
|
+
export declare function percentString(num: number, den: number, precision?: number): string;
|
|
60
|
+
export declare function hash(s: string): number;
|
|
61
|
+
export declare function hashObject(o: any): number;
|
|
62
|
+
export declare function toHex(n: number): string;
|
|
63
|
+
export declare function toRGBA(color: string, alpha: number): string;
|
|
64
|
+
export declare function toRGBAIntensity(color: string, intensity: number, alpha: number): string;
|
|
65
|
+
export declare function distance(x0: number, y0: number, x1: number, y1: number): number;
|
|
66
|
+
export declare function deg2rad(num: number): number;
|
|
67
|
+
export declare function rad2deg(num: number): number;
|
|
68
|
+
export declare function wrapLon(lon: number): number;
|
package/docs/context.md
ADDED
package/docs/dbdynamo.md
ADDED