@wovin/core 0.0.1-RC2 → 0.0.1-RC3
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/dist/apps/note3/src/data/Utils.d.ts +42 -0
- package/dist/apps/note3/src/data/Utils.d.ts.map +1 -0
- package/dist/apps/note3/src/types/util-types.d.ts +27 -0
- package/dist/apps/note3/src/types/util-types.d.ts.map +1 -0
- package/dist/data/applog-helpers.d.ts +24 -0
- package/dist/data/applog-helpers.d.ts.map +1 -0
- package/dist/data/applog-utils.d.ts +42 -0
- package/dist/data/applog-utils.d.ts.map +1 -0
- package/dist/data/datom-types.d.ts +84 -0
- package/dist/data/datom-types.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7042 -0
- package/dist/ipfs/ipfs-utils.d.ts +17 -0
- package/dist/ipfs/ipfs-utils.d.ts.map +1 -0
- package/dist/mobx/mobx-utils.d.ts +67 -0
- package/dist/mobx/mobx-utils.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/data/applog-helpers.d.ts +24 -0
- package/dist/packages/@wovin/core/src/data/applog-helpers.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/data/applog-utils.d.ts +40 -0
- package/dist/packages/@wovin/core/src/data/applog-utils.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/data/datom-types.d.ts +84 -0
- package/dist/packages/@wovin/core/src/data/datom-types.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/index.d.ts +2 -0
- package/dist/packages/@wovin/core/src/index.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/ipfs/ipfs-utils.d.ts +17 -0
- package/dist/packages/@wovin/core/src/ipfs/ipfs-utils.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/mobx/mobx-utils.d.ts +67 -0
- package/dist/packages/@wovin/core/src/mobx/mobx-utils.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/queries/divergences.d.ts +12 -0
- package/dist/packages/@wovin/core/src/queries/divergences.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/queries/matchers.d.ts +4 -0
- package/dist/packages/@wovin/core/src/queries/matchers.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/queries/queries.d.ts +58 -0
- package/dist/packages/@wovin/core/src/queries/queries.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/stream/filters.d.ts +38 -0
- package/dist/packages/@wovin/core/src/stream/filters.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/stream/mapped.d.ts +18 -0
- package/dist/packages/@wovin/core/src/stream/mapped.d.ts.map +1 -0
- package/dist/packages/@wovin/core/src/stream/writeable.d.ts +14 -0
- package/dist/packages/@wovin/core/src/stream/writeable.d.ts.map +1 -0
- package/dist/queries/divergences.d.ts +12 -0
- package/dist/queries/divergences.d.ts.map +1 -0
- package/dist/queries/matchers.d.ts +4 -0
- package/dist/queries/matchers.d.ts.map +1 -0
- package/dist/queries/queries.d.ts +58 -0
- package/dist/queries/queries.d.ts.map +1 -0
- package/dist/stream/filters.d.ts +38 -0
- package/dist/stream/filters.d.ts.map +1 -0
- package/dist/stream/mapped.d.ts +18 -0
- package/dist/stream/mapped.d.ts.map +1 -0
- package/dist/stream/writeable.d.ts +14 -0
- package/dist/stream/writeable.d.ts.map +1 -0
- package/dist/types/typescript-utils.d.ts +27 -0
- package/dist/types/typescript-utils.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const overlayHack: () => void;
|
|
2
|
+
export declare const checkWorker: (...msg: any[]) => any[];
|
|
3
|
+
export declare const frozen: (obj: any) => Promise<any>;
|
|
4
|
+
export declare function utcMsTs(): number;
|
|
5
|
+
export declare function dateNowIso(): string;
|
|
6
|
+
export declare const BYGONZ_MUTATION_EVENT_NAME = "bygonzmutation";
|
|
7
|
+
export declare const allPromises: {
|
|
8
|
+
<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
|
|
9
|
+
<T_1 extends [] | readonly unknown[]>(values: T_1): Promise<{ -readonly [P in keyof T_1]: Awaited<T_1[P]>; }>;
|
|
10
|
+
};
|
|
11
|
+
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
12
|
+
/**
|
|
13
|
+
* JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)
|
|
14
|
+
*
|
|
15
|
+
* https://github.com/garycourt/murmurhash-js/blob/master/murmurhash3_gc.js
|
|
16
|
+
*
|
|
17
|
+
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
|
|
18
|
+
* @see http://github.com/garycourt/murmurhash-js
|
|
19
|
+
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
|
|
20
|
+
* @see http://sites.google.com/site/murmurhash/
|
|
21
|
+
*
|
|
22
|
+
* @param {string} key ASCII only
|
|
23
|
+
* @param {number} seed Positive integer only
|
|
24
|
+
* @return {number} 32-bit positive integer hash
|
|
25
|
+
*/
|
|
26
|
+
export declare function murmurHash(key: string, seed: number, _rippedFrom?: string): number;
|
|
27
|
+
export declare function notNull<TValue>(value: TValue | null): value is TValue;
|
|
28
|
+
export declare function notUndefined<TValue>(value: TValue | undefined): value is TValue;
|
|
29
|
+
export declare function fnBrowserDetect(): any;
|
|
30
|
+
export declare function ab2str(buf: any): string;
|
|
31
|
+
export declare function str2ab(str: any): Uint16Array;
|
|
32
|
+
export declare function buf2hex(arrayBuffer: ArrayBuffer): string;
|
|
33
|
+
export declare function arrayBufferToBase64(buffer: any): string;
|
|
34
|
+
export declare function base64ToArray(base64: any): Uint8Array;
|
|
35
|
+
export declare function base64ToArrayBuffer(base64: any): ArrayBufferLike;
|
|
36
|
+
export declare function bufToBase64(arrayBuffer: ArrayBuffer): string;
|
|
37
|
+
export declare function base64ToUrlBase64(str: any): any;
|
|
38
|
+
export declare function bnToB64(bn: any, url?: boolean): any;
|
|
39
|
+
export declare function formatIfJson(str: string): string;
|
|
40
|
+
export declare const unwrapIfSingle: (arr: any[]) => any;
|
|
41
|
+
export declare function arraysContainSameElements(arr1: any, arr2: any): boolean;
|
|
42
|
+
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../../../../../../apps/note3/src/data/Utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,YAavB,CAAA;AACD,eAAO,MAAM,WAAW,0BAMvB,CAAA;AAaD,eAAO,MAAM,MAAM,QAAe,GAAG,iBAAoC,CAAA;AAKzE,wBAAgB,OAAO,IAAI,MAAM,CAKhC;AACD,wBAAgB,UAAU,IAAI,MAAM,CAGnC;AAED,eAAO,MAAM,0BAA0B,mBAAmB,CAAA;AAE1D,eAAO,MAAM,WAAW;;;CAA4B,CAAA;AAEpD,eAAO,MAAM,KAAK,OAAQ,MAAM,qBAAoD,CAAA;AACpF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACzB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,WAAW,SAA6E,UAoDxF;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,IAAI,MAAM,CAErE;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,IAAI,MAAM,CAE/E;AAED,wBAAgB,eAAe,QAkB9B;AAMD,wBAAgB,MAAM,CAAC,GAAG,KAAA,UAEzB;AACD,wBAAgB,MAAM,CAAC,GAAG,KAAA,eAOzB;AAiBD,wBAAgB,OAAO,CAAC,WAAW,EAAE,WAAW,UAU/C;AACD,wBAAgB,mBAAmB,CAAC,MAAM,KAAA,UAQzC;AACD,wBAAgB,aAAa,CAAC,MAAM,KAAA,cAOnC;AACD,wBAAgB,mBAAmB,CAAC,MAAM,KAAA,mBAEzC;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,UAEnD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,KAAA,OAEpC;AACD,wBAAgB,OAAO,CAAC,EAAE,KAAA,EAAE,GAAG,UAAQ,OAgBtC;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,UAMvC;AAED,eAAO,MAAM,cAAc,QAAS,GAAG,EAAE,QAAoC,CAAA;AAE7E,wBAAgB,yBAAyB,CAAC,IAAI,KAAA,EAAE,IAAI,KAAA,WAenD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Type as T } from '@sinclair/typebox';
|
|
2
|
+
import { ApplogStream } from '@wovin/core/src/stream/stream';
|
|
3
|
+
export declare const ApplogStreamTB: import("@sinclair/typebox").TUnsafe<ApplogStream>;
|
|
4
|
+
declare const StringTB: (options?: import("@sinclair/typebox").StringOptions | undefined) => import("@sinclair/typebox").TString, OptionalTB: <T extends import("@sinclair/typebox").TSchema>(schema: T) => import("@sinclair/typebox").TOptional<T>, BooleanTB: (options?: import("@sinclair/typebox").SchemaOptions | undefined) => import("@sinclair/typebox").TBoolean, ObjectTB: <T extends import("@sinclair/typebox").TProperties>(properties: T, options?: import("@sinclair/typebox").ObjectOptions | undefined) => import("@sinclair/typebox").TObject<T>, NumberTB: (options?: import("@sinclair/typebox").NumericOptions<number> | undefined) => import("@sinclair/typebox").TNumber;
|
|
5
|
+
export declare const Str: typeof StringTB;
|
|
6
|
+
export declare const Num: typeof NumberTB;
|
|
7
|
+
export declare const Obj: typeof ObjectTB;
|
|
8
|
+
export declare const Opt: typeof OptionalTB;
|
|
9
|
+
export declare const Bool: typeof BooleanTB;
|
|
10
|
+
export declare const STR: ReturnType<typeof T.String>;
|
|
11
|
+
export declare const NUM: ReturnType<typeof T.Number>;
|
|
12
|
+
export declare const BOOL: ReturnType<typeof T.Boolean>;
|
|
13
|
+
export type DefaultTrue = true | boolean;
|
|
14
|
+
export declare const DefaultTrue: DefaultTrue;
|
|
15
|
+
export type DefaultFalse = false | boolean;
|
|
16
|
+
export declare const DefaultFalse: DefaultFalse;
|
|
17
|
+
export type GenericObject = Record<string, any>;
|
|
18
|
+
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
19
|
+
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
20
|
+
export type PromiseType<T extends Promise<any>> = T extends Promise<infer U> ? U : never;
|
|
21
|
+
export type CoerceToString<T> = T extends string ? T : never;
|
|
22
|
+
export type LastElementOf<T extends readonly unknown[]> = T extends readonly [...unknown[], infer Last] ? Last : never;
|
|
23
|
+
export declare function checkParityTB(): void;
|
|
24
|
+
/** solidjs Setter requires returning something, which I often don't */
|
|
25
|
+
export type GenericSetter<T> = (newValue: T) => void;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=util-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util-types.d.ts","sourceRoot":"","sources":["../../../../../../../../apps/note3/src/types/util-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,CAAC,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAE5D,eAAO,MAAM,cAAc,mDAEvB,CAAA;AACJ,QAAA,MAAgB,QAAQ,4GAAY,UAAU,0GAAW,SAAS,6GAAU,QAAQ,iLAAU,QAAQ,mHAAM,CAAA;AAC5G,eAAO,MAAM,GAAG,EAAE,OAAO,QAA2B,CAAA;AACpD,eAAO,MAAM,GAAG,EAAE,OAAO,QAA2B,CAAA;AACpD,eAAO,MAAM,GAAG,EAAE,OAAO,QAA2B,CAAA;AACpD,eAAO,MAAM,GAAG,EAAE,OAAO,UAA+B,CAAA;AACxD,eAAO,MAAM,IAAI,EAAE,OAAO,SAA6B,CAAA;AAEvD,eAAO,MAAM,GAAG,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,MAAM,CAAS,CAAA;AACrD,eAAO,MAAM,GAAG,E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AAC,KAAK,IAAI,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { WriteableApplogStream } from '../stream/writeable';
|
|
2
|
+
import { Applog, ApplogForInsert, ApplogForInsertOptionalAgent, ApplogNoCid, Timestamp } from './datom-types';
|
|
3
|
+
export declare const sortApplogByTs: (p: Applog, n: Applog) => 0 | 1 | -1;
|
|
4
|
+
export declare const sortApplogByTsDec: (p: Applog, n: Applog) => 0 | 1 | -1;
|
|
5
|
+
export declare function filterOnlyLatest(logs: Applog[], onlyLatest: boolean): Applog[];
|
|
6
|
+
export declare function hasAg(log: ApplogForInsertOptionalAgent): log is ApplogForInsert;
|
|
7
|
+
export declare function hasTs(log: ApplogForInsert): log is Omit<ApplogForInsert, 'ts'> & {
|
|
8
|
+
ts: Timestamp;
|
|
9
|
+
};
|
|
10
|
+
export declare function hasPv(log: ApplogForInsert): log is ApplogForInsert & {
|
|
11
|
+
pv: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function withTs(log: ApplogForInsert, ts: Timestamp): Omit<ApplogForInsert, "ts"> & {
|
|
14
|
+
ts: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function withPv(log: ApplogNoCid, ds: WriteableApplogStream): {
|
|
17
|
+
pv: any;
|
|
18
|
+
at: string;
|
|
19
|
+
ts: string;
|
|
20
|
+
ag: string;
|
|
21
|
+
en: string;
|
|
22
|
+
vl: import("./datom-types").ApplogValue;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=applog-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applog-helpers.d.ts","sourceRoot":"","sources":["../../src/data/applog-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,4BAA4B,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI7G,eAAO,MAAM,cAAc,MAAO,MAAM,KAAK,MAAM,eAAiD,CAAA;AACpG,eAAO,MAAM,iBAAiB,MAAO,MAAM,KAAK,MAAM,eAAiD,CAAA;AAGvG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,GAAG,MAAM,EAAE,CAc9E;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,4BAA4B,GAAG,GAAG,IAAI,eAAe,CAE/E;AACD,wBAAgB,KAAK,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,SAAS,CAAA;CAAE,CAElG;AACD,wBAAgB,KAAK,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,eAAe,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAEnF;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,EAAE,EAAE,SAAS;;EAEzD;AACD,wBAAgB,MAAM,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,qBAAqB;;;;;;;EASjE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ApplogStream } from '../stream/stream';
|
|
2
|
+
import type { Applog, ApplogValue, DatalogQueryPattern, DatalogQueryResultEntry, ResultContext, SearchContext, ValueOrMatcher } from './datom-types';
|
|
3
|
+
export declare const isoDateStrCompare: (strA: string, strB: string, dir?: 'asc' | 'desc') => number;
|
|
4
|
+
/** Sort by TS (modifies the array, but also returns for ease of use) */
|
|
5
|
+
export declare function sortApplogsByTs(appLogArray: Applog[], dir?: 'asc' | 'desc'): Applog[];
|
|
6
|
+
export declare const isTsBefore: (log: Applog, logToCompare: Applog) => boolean;
|
|
7
|
+
export declare const uniqueEnFromAppLogs: (appLogArray: Applog[]) => string[];
|
|
8
|
+
export declare const areApplogsEqual: (logA: Applog, logB: Applog) => boolean;
|
|
9
|
+
export declare function joinStreams(streams: ApplogStream[]): ApplogStream;
|
|
10
|
+
export declare const removeDuplicateAppLogs: (appLogArray: Applog[]) => any[];
|
|
11
|
+
export declare const getHashID: (stringifiable: any, lngth?: number) => string;
|
|
12
|
+
export declare function isVariable(x: any): x is string;
|
|
13
|
+
export declare function variableNameWithoutQuestionmark(str: string): string;
|
|
14
|
+
export declare function isStaticPattern(x: any): x is ApplogValue;
|
|
15
|
+
export declare function resolveOrRemoveVariables(pattern: DatalogQueryPattern, candidate: SearchContext): {}[];
|
|
16
|
+
export declare function matchPartStatic(field: keyof Applog, patternPart: ValueOrMatcher<ApplogValue>, atomPart: ApplogValue): boolean;
|
|
17
|
+
export declare function matchPart(patternPart: ValueOrMatcher<ApplogValue>, atomPart: ApplogValue, context: SearchContext): ResultContext;
|
|
18
|
+
/**
|
|
19
|
+
* Check if pattern matches triple with context substitutions
|
|
20
|
+
*/
|
|
21
|
+
export declare function matchPattern(pattern: DatalogQueryPattern, applog: Applog, context: SearchContext): ResultContext;
|
|
22
|
+
export declare function actualize<SELECT extends string>(context: ResultContext, find: readonly SELECT[]): DatalogQueryResultEntry<SELECT>;
|
|
23
|
+
export declare const arrStats: {
|
|
24
|
+
max: (array: number[]) => number;
|
|
25
|
+
min: (array: number[]) => number;
|
|
26
|
+
range: (array: number[]) => number;
|
|
27
|
+
midrange: (array: number[]) => number;
|
|
28
|
+
sum: (array: number[]) => number;
|
|
29
|
+
mean: (array: number[]) => number;
|
|
30
|
+
average: (array: number[]) => number;
|
|
31
|
+
median: (array: number[]) => number;
|
|
32
|
+
modes: (array: number[]) => any[];
|
|
33
|
+
variance: (array: number[]) => number;
|
|
34
|
+
standardDeviation: (array: number[]) => number;
|
|
35
|
+
meanAbsoluteDeviation: (array: number[]) => number;
|
|
36
|
+
zScores: (array: number[]) => number[];
|
|
37
|
+
};
|
|
38
|
+
export declare const tsNearlySame: (timeA: string, timeB: string) => boolean;
|
|
39
|
+
export declare const cyrb53hash: (str: string, seed: number, strLength: number) => string;
|
|
40
|
+
export declare function arraysContainSameElements(arr1: any, arr2: any): boolean;
|
|
41
|
+
export declare function dateNowIso(): string;
|
|
42
|
+
//# sourceMappingURL=applog-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applog-utils.d.ts","sourceRoot":"","sources":["../../src/data/applog-utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAA0B,KAAK,YAAY,EAAe,MAAM,kBAAkB,CAAA;AACzF,OAAO,KAAK,EACX,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,cAAc,EACd,MAAM,eAAe,CAAA;AAItB,eAAO,MAAM,iBAAiB,SAAU,MAAM,QAAQ,MAAM,QAAO,KAAK,GAAG,MAAM,WAG5C,CAAA;AACrC,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,KAAK,GAAG,MAAc,YAEjF;AACD,eAAO,MAAM,UAAU,QAAS,MAAM,gBAAgB,MAAM,YAA0D,CAAA;AACtH,eAAO,MAAM,mBAAmB,gBAAiB,MAAM,EAAE,aAAyD,CAAA;AAClH,eAAO,MAAM,eAAe,SAAU,MAAM,QAAQ,MAAM,YAAoC,CAAA;AAE9F,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,gBAiClD;AAED,eAAO,MAAM,sBAAsB,gBAAiB,MAAM,EAAE,UAU3D,CAAA;AAWD,eAAO,MAAM,SAAS,kBAAmB,GAAG,2BAAyE,CAAA;AAErH,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,MAAM,CAE9C;AACD,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,MAAM,UAE1D;AAID,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,WAAW,CAGxD;AAaD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,QAmB9F;AAcD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAsB7H;AACD,wBAAgB,SAAS,CAAC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,aAAa,CAiBhI;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,aAAa,CAKhH;AAED,wBAAgB,SAAS,CAAC,MAAM,SAAS,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAUjI;AASD,eAAO,MAAM,QAAQ;iBACC,MAAM,EAAE;iBAIR,MAAM,EAAE;mBAIN,MAAM,EAAE;sBAIL,MAAM,EAAE;iBArBH,MAAM,EAAE;kBAKN,MAAM,EAAE;qBAAR,MAAM,EAAE;oBA0BjB,MAAM,EAAE;mBAQT,MAAM,EAAE;sBAqBL,MAAM,EAAE;+BAOC,MAAM,EAAE;mCAIJ,MAAM,EAAE;qBAOtB,MAAM,EAAE;CAOjC,CAAA;AAKD,eAAO,MAAM,YAAY,UAAW,MAAM,SAAS,MAAM,YAAuD,CAAA;AAUhH,eAAO,MAAM,UAAU,QACjB,MAAM,2BAEA,MAAM,WAqBjB,CAAA;AACD,wBAAgB,yBAAyB,CAAC,IAAI,KAAA,EAAE,IAAI,KAAA,WAenD;AACD,wBAAgB,UAAU,IAAI,MAAM,CAGnC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Static, TSchema } from '@sinclair/typebox';
|
|
2
|
+
import { CID } from 'multiformats/cid';
|
|
3
|
+
import { PartialBy } from '../types/typescript-utils';
|
|
4
|
+
export declare const Nullable: <T extends TSchema>(schema: T) => import("@sinclair/typebox").TUnion<[T, import("@sinclair/typebox").TNull]>;
|
|
5
|
+
export declare const EntityID_LENGTH = 7;
|
|
6
|
+
export declare const EntityID: import("@sinclair/typebox").TString;
|
|
7
|
+
export type EntityID = Static<typeof EntityID>;
|
|
8
|
+
export type DatomPart = string;
|
|
9
|
+
export type CidString = string;
|
|
10
|
+
export type AgentID = EntityID;
|
|
11
|
+
export type Attribute = string;
|
|
12
|
+
export type ApplogValue = string | boolean | Number | null;
|
|
13
|
+
export interface Atom {
|
|
14
|
+
en: EntityID;
|
|
15
|
+
at: Attribute;
|
|
16
|
+
vl: ApplogValue;
|
|
17
|
+
}
|
|
18
|
+
export type AgentHash = string;
|
|
19
|
+
export type Timestamp = string;
|
|
20
|
+
export interface Applog extends Atom {
|
|
21
|
+
cid: CidString;
|
|
22
|
+
pv?: CidString | CID;
|
|
23
|
+
ts: Timestamp;
|
|
24
|
+
ag: AgentHash;
|
|
25
|
+
}
|
|
26
|
+
export type ApplogNoCid = Omit<Applog, 'cid'>;
|
|
27
|
+
export type ApplogOptionalCid = PartialBy<Applog, 'cid'>;
|
|
28
|
+
export type ApplogForInsert = PartialBy<ApplogNoCid, 'ts'>;
|
|
29
|
+
export type ApplogForInsertOptionalAgent = PartialBy<ApplogForInsert, 'ag'>;
|
|
30
|
+
export type AtomPattern = Atom | Applog;
|
|
31
|
+
export interface DatalogStateIdentifier {
|
|
32
|
+
lastTS: Timestamp;
|
|
33
|
+
}
|
|
34
|
+
export type ValueOrMatcher<T> = T | readonly T[] | ((value: T) => boolean);
|
|
35
|
+
export type WithMatchers<T extends Record<string, any>> = {
|
|
36
|
+
[K in keyof T & string as `${K}` | `!${K}`]?: ValueOrMatcher<T[K]>;
|
|
37
|
+
};
|
|
38
|
+
export type DatalogQueryPattern = Partial<WithMatchers<AtomPattern>>;
|
|
39
|
+
export type DatalogQueryPatternArray = DatalogQueryPattern[];
|
|
40
|
+
export interface DatalogQuery<SELECT extends string> {
|
|
41
|
+
find: readonly SELECT[];
|
|
42
|
+
where: DatalogQueryPatternArray;
|
|
43
|
+
onlyLatest?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export type DatalogQueryResultEntry<SELECT extends string> = Record<StripPrefix<'?', SELECT>, DatomPart>;
|
|
46
|
+
export type DatalogQueryResultRows<SELECT extends string> = DatalogQueryResultEntry<SELECT>[];
|
|
47
|
+
export interface SearchContext {
|
|
48
|
+
[key: string]: ApplogValue;
|
|
49
|
+
}
|
|
50
|
+
export interface SearchContextWithLog {
|
|
51
|
+
context: SearchContext;
|
|
52
|
+
applog?: Applog;
|
|
53
|
+
}
|
|
54
|
+
export type ResultContext = SearchContext | null;
|
|
55
|
+
type StripPrefix<TPrefix extends string, T extends string> = T extends `${TPrefix}${infer R}` ? R : never;
|
|
56
|
+
export declare const CIDTB: import("@sinclair/typebox").TString;
|
|
57
|
+
export type CIDTB = Static<typeof EntityID>;
|
|
58
|
+
export declare const URL: import("@sinclair/typebox").TString;
|
|
59
|
+
export type URL = Static<typeof URL>;
|
|
60
|
+
export declare const AppLogTB: import("@sinclair/typebox").TObject<{
|
|
61
|
+
en: import("@sinclair/typebox").TString;
|
|
62
|
+
at: import("@sinclair/typebox").TString;
|
|
63
|
+
vl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNumber]>, import("@sinclair/typebox").TNull]>;
|
|
64
|
+
ts: import("@sinclair/typebox").TString;
|
|
65
|
+
ag: import("@sinclair/typebox").TString;
|
|
66
|
+
}>;
|
|
67
|
+
export type AppLogTB = Static<typeof AppLogTB>;
|
|
68
|
+
export declare const AppLogTBC: import("@sinclair/typebox/compiler").TypeCheck<import("@sinclair/typebox").TObject<{
|
|
69
|
+
en: import("@sinclair/typebox").TString;
|
|
70
|
+
at: import("@sinclair/typebox").TString;
|
|
71
|
+
vl: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNumber]>, import("@sinclair/typebox").TNull]>;
|
|
72
|
+
ts: import("@sinclair/typebox").TString;
|
|
73
|
+
ag: import("@sinclair/typebox").TString;
|
|
74
|
+
}>>;
|
|
75
|
+
export declare const getApplogTypeErrors: (obj: any) => import("@sinclair/typebox/compiler").ValueError[];
|
|
76
|
+
export declare const isValidApplog: (value: unknown) => value is {
|
|
77
|
+
at: string;
|
|
78
|
+
ts: string;
|
|
79
|
+
ag: string;
|
|
80
|
+
en: string;
|
|
81
|
+
vl: string | number | boolean;
|
|
82
|
+
};
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=datom-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datom-types.d.ts","sourceRoot":"","sources":["../../src/data/datom-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,MAAM,EAAE,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,eAAO,MAAM,QAAQ,8GAAsE,CAAA;AAC3F,eAAO,MAAM,eAAe,IAAI,CAAA;AAShC,eAAO,MAAM,QAAQ,qCAAsC,CAAA;AAC3D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAA;AAE9C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAC9B,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAC9B,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAA;AAC9B,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAC9B,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAA;AAG1D,MAAM,WAAW,IAAI;IACpB,EAAE,EAAE,QAAQ,CAAA;IACZ,EAAE,EAA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