@wovin/core 0.0.6 → 0.0.7

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/index.min.js CHANGED
@@ -1,2 +1,2 @@
1
- import"./chunk-7IDQIMQO.min.js";import"./chunk-RPPZKO5L.min.js";import{a as Go,b as Ho,c as Io,d as Jo,e as Ko,f as Lo}from"./chunk-D6REGRIL.min.js";import{a as Bo,b as Do,c as Eo,d as Fo}from"./chunk-J5PGGKKW.min.js";import{a as Mo,b as No,c as Oo}from"./chunk-5Q6PAAMY.min.js";import{a as Po,b as Qo,c as Ro,d as So,e as Uo,f as Vo,g as Wo,h as Xo,i as Yo,j as Zo,k as _o,l as $o}from"./chunk-BR5DELY4.min.js";import{$ as W,A as l,Aa as Ao,B as q,C as u,D as y,E as z,F as A,G as B,H as D,I as E,J as F,K as G,L as H,M as I,N as J,O as K,P as L,Q as M,R as N,S as O,V as P,W as Q,X as R,Y as S,Z as U,_ as V,aa as X,ba as Y,ca as to,d as o,da as po,e as r,ea as xo,f as e,fa as fo,g as t,ga as mo,h as p,ha as no,i as x,ia as so,j as f,ja as co,k as m,ka as io,l as n,la as vo,m as s,ma as wo,n as c,na as Co,o as i,oa as To,p as v,pa as ao,q as w,qa as bo,r as C,ra as go,s as T,sa as ho,t as a,ta as jo,u as b,ua as ko,v as d,va as lo,w as g,wa as qo,x as h,xa as uo,y as j,ya as yo,z as k,za as zo}from"./chunk-IVEP7DZW.min.js";import{l as Z,m as _,n as $,o as oo,p as ro,q as eo}from"./chunk-G3GOAFHU.min.js";var or=12345.78;export{V as AppLogTB,W as AppLogTBC,Yo as BOOL,Vo as Bool,S as CIDTB,_o as DefaultFalse,Zo as DefaultTrue,R as EntityID,Q as EntityID_LENGTH,F as MappedThread,Xo as NUM,P as Nullable,Ro as Num,So as Obj,Uo as Opt,xo as QueryNode,fo as QueryNodes,Wo as STR,Qo as Str,D as Thread,po as ThreadInMemory,Po as ThreadTB,U as URL,to as WriteableThread,T as actualize,Lo as agentToShortHash,To as agentsOfThread,q as applogThreadComparer,x as areApplogsEqual,a as arrStats,g as arraysContainSameElements,O as assertOnlyCurrent,N as assertRaw,$o as checkParityTB,r as compareApplogsByTs,z as computedFnDeepCompare,l as computedStructuralComparer,j as createDebugName,k as createDebugNameObj,d as cyrb53hash,h as dateNowIso,Do as decodeCar,Bo as decodeCarToApplogs,$ as encodeApplog,_ as encodeApplogAndGetCid,Io as encodeApplogsAsCar,ro as encodeBlock,eo as encodeBlockOriginal,Ho as encodePubAsCar,ao as entityOverlap,bo as entityOverlapCount,vo as filterAndMap,X as getApplogTypeErrors,oo as getCidSync,m as getHashID,E as getLogsFromThread,L as getUntrackedFilterResults,J as getUntrackedPattern,lo as hasAg,M as hasFilter,uo as hasPv,qo as hasTs,Oo as includedIn,No as includes,B as isInitEvent,Jo as isPublication,c as isStaticPattern,Ko as isSubscription,t as isTsBefore,Y as isValidApplog,n as isVariable,o as isoDateStrCompare,Ao as joinThreads,mo as lastWriteWins,Fo as makeCarBlob,Eo as makeCarOut,K as makeFilter,go as mapTo,w as matchPart,v as matchPartStatic,C as matchPattern,y as observableArrayMap,ko as prefixAt,jo as prefixAttrs,Z as prepareForPub,Go as preparePubForPush,A as prettifyThreadName,so as query,wo as queryAndMap,Mo as queryDivergencesByPrev,Co as queryEntity,u as queryNodesComparer,io as queryNot,co as queryStep,f as removeDuplicateAppLogs,i as resolveOrRemoveVariables,I as rollingAcc,G as rollingFilter,H as rollingMapper,e as sortApplogsByTs,ho as startsWith,b as tsNearlySame,p as uniqueEnFromAppLogs,s as variableNameWithoutQuestionmark,zo as withPv,yo as withTs,no as withoutDeleted,or as wovinCoreTest};
1
+ import"./chunk-7IDQIMQO.min.js";import"./chunk-RPPZKO5L.min.js";import{a as Io,b as Jo,c as Ko,d as Lo,e as Mo,f as No}from"./chunk-O7KDPKK2.min.js";import{a as Eo,b as Fo,c as Go,d as Ho}from"./chunk-J5PGGKKW.min.js";import{a as Oo,b as Po,c as Qo}from"./chunk-6WLDICQ6.min.js";import{a as Ro,b as So,c as Uo,d as Vo,e as Wo,f as Xo,g as Yo,h as Zo,i as _o,j as $o,k as or,l as rr}from"./chunk-5O6HLH5H.min.js";import{$ as W,A as l,Aa as Ao,B as q,Ba as Bo,C as u,Ca as Do,D as y,E as z,F as A,G as B,H as D,I as E,J as F,K as G,L as H,M as I,N as J,O as K,P as L,Q as M,R as N,S as O,T as P,U as Q,X as R,Y as S,Z as U,_ as V,aa as X,ba as Y,ca as Z,d as o,da as _,e as r,ea as xo,f as e,fa as fo,g as t,ga as mo,h as p,ha as no,i as x,ia as so,j as f,ja as co,k as m,ka as io,l as n,la as vo,m as s,ma as wo,n as c,na as Co,o as i,oa as To,p as v,pa as ao,q as w,qa as bo,r as C,ra as go,s as T,sa as ho,t as a,ta as jo,u as b,ua as ko,v as d,va as lo,w as g,wa as qo,x as h,xa as uo,y as j,ya as yo,z as k,za as zo}from"./chunk-XQUJRFOK.min.js";import{l as $,m as oo,n as ro,o as eo,p as to,q as po}from"./chunk-G3GOAFHU.min.js";var er=12345.78;export{X as AppLogTB,Y as AppLogTBC,_o as BOOL,Xo as Bool,V as CIDTB,or as DefaultFalse,$o as DefaultTrue,U as EntityID,S as EntityID_LENGTH,H as MappedThread,Zo as NUM,R as Nullable,Uo as Num,Vo as Obj,Wo as Opt,mo as QueryNode,no as QueryResult,Yo as STR,So as Str,F as Thread,fo as ThreadInMemory,Ro as ThreadTB,W as URL,xo as WriteableThread,T as actualize,No as agentToShortHash,bo as agentsOfThread,q as applogThreadComparer,x as areApplogsEqual,a as arrStats,g as arraysContainSameElements,Q as assertOnlyCurrent,P as assertRaw,A as autorunButAlsoImmediately,rr as checkParityTB,r as compareApplogsByTs,B as computedFnDeepCompare,l as computedStructuralComparer,j as createDebugName,k as createDebugNameObj,d as cyrb53hash,h as dateNowIso,Fo as decodeCar,Eo as decodeCarToApplogs,ro as encodeApplog,oo as encodeApplogAndGetCid,Ko as encodeApplogsAsCar,to as encodeBlock,po as encodeBlockOriginal,Jo as encodePubAsCar,go as entityOverlap,ho as entityOverlapCount,Co as filterAndMap,Z as getApplogTypeErrors,eo as getCidSync,m as getHashID,G as getLogsFromThread,N as getUntrackedFilterResults,L as getUntrackedPattern,uo as hasAg,O as hasFilter,zo as hasPv,yo as hasTs,Qo as includedIn,Po as includes,E as isInitEvent,Lo as isPublication,c as isStaticPattern,Mo as isSubscription,t as isTsBefore,_ as isValidApplog,n as isVariable,o as isoDateStrCompare,Do as joinThreads,so as lastWriteWins,Ho as makeCarBlob,Go as makeCarOut,M as makeFilter,jo as mapTo,w as matchPart,v as matchPartStatic,C as matchPattern,y as observableArrayMap,z as observableMapMap,qo as prefixAt,lo as prefixAttrs,$ as prepareForPub,Io as preparePubForPush,D as prettifyThreadName,io as query,To as queryAndMap,Oo as queryDivergencesByPrev,ao as queryEntity,u as queryNodesComparer,wo as queryNot,vo as queryStep,f as removeDuplicateAppLogs,i as resolveOrRemoveVariables,K as rollingAcc,I as rollingFilter,J as rollingMapper,e as sortApplogsByTs,ko as startsWith,b as tsNearlySame,p as uniqueEnFromAppLogs,s as variableNameWithoutQuestionmark,Bo as withPv,Ao as withTs,co as withoutDeleted,er as wovinCoreTest};
2
2
  //# sourceMappingURL=index.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const wovinCoreTest = 12345.78\n\nexport * from './applog'\nexport * from './ipfs'\nexport * from './pubsub'\nexport * from './query'\nexport * from './thread'\nexport * from './types'\n// export * from './utils'\n"],"mappings":"2lCAAO,IAAMA,GAAgB","names":["wovinCoreTest"]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const wovinCoreTest = 12345.78\n\nexport * from './applog'\nexport * from './ipfs'\nexport * from './pubsub'\nexport * from './query'\nexport * from './thread'\nexport * from './types'\n// export * from './utils'\n"],"mappings":"6mCAAO,IAAMA,GAAgB","names":["wovinCoreTest"]}
@@ -1,23 +1,31 @@
1
- import { comparer, IComputedValue, IObservableArray } from 'mobx';
1
+ import { comparer, IComputedValue, IObservableArray, ObservableMap } from 'mobx';
2
2
  import { IComputedFnOptions } from 'mobx-utils/lib/computedFn';
3
3
  import { DatalogQueryPattern } from '../applog/datom-types';
4
- import { QueryNodes } from '../query/basic';
4
+ import { QueryResult } from '../query/basic';
5
5
  import { Thread } from '../thread';
6
- export declare const createDebugName: ({ caller, thread, pattern: args }: {
6
+ export declare const createDebugName: ({ caller, thread, pattern, args }: {
7
7
  caller?: string;
8
8
  thread?: Thread;
9
- pattern?: DatalogQueryPattern | string;
9
+ pattern?: DatalogQueryPattern | DatalogQueryPattern[] | string;
10
+ args?: any;
10
11
  }) => string;
11
12
  export declare const createDebugNameObj: (args: Parameters<typeof createDebugName>[0]) => {
12
13
  readonly name: string;
13
14
  };
14
15
  export declare function computedStructuralComparer<T>(a: IComputedValue<T>, b: IComputedValue<T>): boolean;
15
16
  export declare function applogThreadComparer(a: Thread, b: Thread): boolean;
16
- export declare function queryNodesComparer(a: QueryNodes, b: QueryNodes): boolean;
17
+ export declare function queryNodesComparer(a: QueryResult, b: QueryResult): boolean;
17
18
  export declare function observableArrayMap<T>(fn: () => T[], { name, equals }?: {
18
19
  name?: string;
19
20
  equals?: typeof comparer.structural;
20
21
  }): IObservableArray<T>;
22
+ export declare function observableMapMap<K, V>(fn: () => Array<readonly [K, V]>, { name, equals }?: {
23
+ name?: string;
24
+ equals?: typeof comparer.structural;
25
+ }): ObservableMap<K, V>;
26
+ export declare function autorunButAlsoImmediately<T>(fn: () => T, init: (T: any) => any, update: (T: any) => any, { name }?: {
27
+ name?: string;
28
+ }): () => void;
21
29
  /**
22
30
  * ADAPTED from https://github.com/mobxjs/mobx-utils/blob/362cbbfb384820d416f253eddc532ebecba89bcb/src/computedFn.ts#L50 to
23
31
  * - deep-compare arguments
@@ -59,8 +67,7 @@ export declare function observableArrayMap<T>(fn: () => T[], { name, equals }?:
59
67
  * @param fn
60
68
  * @param keepAliveOrOptions
61
69
  */
62
- export declare function computedFnDeepCompare<T extends (...args: any[]) => any>(fn: T, keepAliveOrOptions?: (IComputedFnOptions<T> & {
63
- name?: string;
70
+ export declare function computedFnDeepCompare<T extends (...args: any[]) => any>(name: string, fn: T, keepAliveOrOptions?: (IComputedFnOptions<T> & {
64
71
  argsDebugName?: (...args: Parameters<T>) => string;
65
72
  }) | boolean): T;
66
73
  export declare function prettifyThreadName(input: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"mobx-utils.d.ts","sourceRoot":"","sources":["../../src/mobx/mobx-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,QAAQ,EAKR,cAAc,EACd,gBAAgB,EAShB,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AA+BlC,eAAO,MAAM,eAAe;aAClB,MAAM;aACN,MAAM;cACL,mBAAmB,GAAG,MAAM;YAMtC,CAAA;AACD,eAAO,MAAM,kBAAkB,SAAU,WAAW,sBAAsB,CAAC,CAAC,CAAC,CAAC;;CAE7E,CAAA;AAED,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,WAEvF;AACD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,WAExD;AACD,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,WAc9D;AAGD,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAE;IACtE,IAAI,CAAC,EAAE,M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AK,MAAM,CAAA;CAAE,CAAC,GAAG,OAAe,GACpH,CAAC,CAqEH;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgCxD"}
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f}from"./chunk-D6REGRIL.min.js";import"./chunk-J5PGGKKW.min.js";import"./chunk-IVEP7DZW.min.js";import"./chunk-G3GOAFHU.min.js";export{f as agentToShortHash,c as encodeApplogsAsCar,b as encodePubAsCar,d as isPublication,e as isSubscription,a as preparePubForPush};
1
+ import{a,b,c,d,e,f}from"./chunk-O7KDPKK2.min.js";import"./chunk-J5PGGKKW.min.js";import"./chunk-XQUJRFOK.min.js";import"./chunk-G3GOAFHU.min.js";export{f as agentToShortHash,c as encodeApplogsAsCar,b as encodePubAsCar,d as isPublication,e as isSubscription,a as preparePubForPush};
2
2
  //# sourceMappingURL=pubsub.min.js.map
@@ -1,23 +1,25 @@
1
1
  import { Applog, ApplogValue, DatalogQueryPattern, EntityID, SearchContext } from '../applog/datom-types';
2
2
  import { Thread } from '../thread';
3
3
  export declare class QueryNode {
4
- logsOfThisNode: Thread;
5
- variables: SearchContext;
6
- prev: QueryNode | null;
7
- constructor(logsOfThisNode: Thread, variables: SearchContext, prev?: QueryNode | null);
4
+ readonly logsOfThisNode: Thread;
5
+ readonly variables: SearchContext;
6
+ readonly prevNode: QueryNode | null;
7
+ constructor(logsOfThisNode: Thread, variables: SearchContext, prevNode?: QueryNode | null);
8
8
  get record(): SearchContext;
9
- get allApplogs(): Thread;
9
+ get threadOfTrail(): Thread;
10
+ get trailLogs(): any;
10
11
  }
11
- export declare class QueryNodes {
12
+ export declare class QueryResult {
12
13
  nodes: Array<QueryNode>;
13
14
  constructor(nodes: Array<QueryNode>);
14
15
  get size(): number;
15
16
  get isEmpty(): boolean;
16
17
  get untrackedSize(): number;
17
18
  get records(): SearchContext[];
18
- get applogSets(): (readonly Applog[])[];
19
- get applogThreads(): Thread[];
20
- get allApplogs(): Thread;
19
+ get leafNodeLogs(): (readonly Applog[])[];
20
+ get threadOfAllTrails(): Thread;
21
+ get thread(): Thread;
22
+ get allApplogs(): readonly Applog[];
21
23
  }
22
24
  /**
23
25
  * Keep only the latest logs for each en&at (= last write wins)
@@ -33,13 +35,13 @@ export declare const lastWriteWins: (thread: Thread, { inverseToOnlyReturnFirstL
33
35
  export declare const withoutDeleted: (thread: Thread) => import("../thread").MappedThread;
34
36
  export declare const query: (thread: Thread, patternOrPatterns: DatalogQueryPattern | DatalogQueryPattern[], startVariables?: SearchContext, opts?: {
35
37
  debug?: boolean;
36
- }) => QueryNodes;
37
- export declare const queryStep: (thread: Thread, nodeSet: QueryNodes | null, pattern: DatalogQueryPattern, opts?: {
38
+ }) => QueryResult;
39
+ export declare const queryStep: (thread: Thread, nodeSet: QueryResult | null, pattern: DatalogQueryPattern, opts?: {
38
40
  debug?: boolean;
39
- }) => QueryNodes;
40
- export declare const queryNot: (thread: Thread, startNodes: QueryNodes, patternOrPatterns: DatalogQueryPattern | DatalogQueryPattern[], opts?: {
41
+ }) => QueryResult;
42
+ export declare const queryNot: (thread: Thread, startNodes: QueryResult, patternOrPatterns: DatalogQueryPattern | DatalogQueryPattern[], opts?: {
41
43
  debug?: boolean;
42
- }) => QueryNodes;
44
+ }) => QueryResult;
43
45
  export declare const filterAndMap: <R>(thread: Thread, pattern: DatalogQueryPattern, mapper: keyof Applog | Partial<{
44
46
  cid: string;
45
47
  pv?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../src/query/basic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAgBzG,OAAO,EAAe,MAAM,EAAe,MAAM,WAAW,CAAA;AAmB5D,qBAAa,SAAS;IAEb,cAAc,EAAE,MAAM;IACtB,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE,SAA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D,CAAA;AAMD,wBAAgB,KAAK,CAAC,cAAc,EAAE,OAAO,CAAC;KAAG,GAAG,IAAI,MAAM,MAAM,GAAG,MAAM;CAAE,CAAC,kCAO/E;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,uBAErC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAE1D;AACD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAEpD"}
package/dist/query.min.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as z,b as A,c as B}from"./chunk-5Q6PAAMY.min.js";import{A as c,B as d,C as e,D as f,E as g,F as h,ea as i,fa as j,ga as k,ha as l,ia as m,ja as n,ka as o,la as p,ma as q,na as r,oa as s,pa as t,qa as u,ra as v,sa as w,ta as x,ua as y,y as a,z as b}from"./chunk-IVEP7DZW.min.js";import"./chunk-G3GOAFHU.min.js";export{i as QueryNode,j as QueryNodes,s as agentsOfThread,d as applogThreadComparer,g as computedFnDeepCompare,c as computedStructuralComparer,a as createDebugName,b as createDebugNameObj,t as entityOverlap,u as entityOverlapCount,p as filterAndMap,B as includedIn,A as includes,k as lastWriteWins,v as mapTo,f as observableArrayMap,y as prefixAt,x as prefixAttrs,h as prettifyThreadName,m as query,q as queryAndMap,z as queryDivergencesByPrev,r as queryEntity,e as queryNodesComparer,o as queryNot,n as queryStep,w as startsWith,l as withoutDeleted};
1
+ import{a as B,b as C,c as D}from"./chunk-6WLDICQ6.min.js";import{A as c,B as d,C as e,D as f,E as g,F as h,G as i,H as j,ga as k,ha as l,ia as m,ja as n,ka as o,la as p,ma as q,na as r,oa as s,pa as t,qa as u,ra as v,sa as w,ta as x,ua as y,va as z,wa as A,y as a,z as b}from"./chunk-XQUJRFOK.min.js";import"./chunk-G3GOAFHU.min.js";export{k as QueryNode,l as QueryResult,u as agentsOfThread,d as applogThreadComparer,h as autorunButAlsoImmediately,i as computedFnDeepCompare,c as computedStructuralComparer,a as createDebugName,b as createDebugNameObj,v as entityOverlap,w as entityOverlapCount,r as filterAndMap,D as includedIn,C as includes,m as lastWriteWins,x as mapTo,f as observableArrayMap,g as observableMapMap,A as prefixAt,z as prefixAttrs,j as prettifyThreadName,o as query,s as queryAndMap,B as queryDivergencesByPrev,t as queryEntity,e as queryNodesComparer,q as queryNot,p as queryStep,y as startsWith,n as withoutDeleted};
2
2
  //# sourceMappingURL=query.min.js.map
@@ -10,7 +10,9 @@ export declare const rollingMapper: (thread: Thread, eventMapper: ApplogEventMap
10
10
  name?: string;
11
11
  extraFilterName?: string;
12
12
  }) => MappedThread;
13
- export declare const rollingAcc: <ACC extends IObservableArray<any> | ObservableMap<any, any> | ObservableSet<any>>(thread: Thread, acc: ACC, eventMapper: (event: ThreadEvent, acc: ACC) => void) => ACC;
13
+ export declare const rollingAcc: <ACC extends IObservableArray<any> | ObservableMap<any, any> | ObservableSet<any>>(thread: Thread, acc: ACC, eventMapper: (event: ThreadEvent, acc: ACC) => void, opts?: {
14
+ name?: string;
15
+ }) => ACC;
14
16
  export declare const getUntrackedPattern: (pattern: DatalogQueryPattern) => {
15
17
  [k: string]: string | boolean | Number | import("../applog/datom-types").CidString | readonly import("../applog/datom-types").CidString[] | ((value: import("../applog/datom-types").CidString) => boolean) | readonly string[] | ((value: string) => boolean) | import("../applog/datom-types").AgentHash | readonly import("../applog/datom-types").AgentHash[] | ((value: import("../applog/datom-types").AgentHash) => boolean) | readonly ApplogValue[] | ((value: ApplogValue) => boolean);
16
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/thread/filters.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,gBAAgB,EAAc,aAAa,EAAE,aAAa,EAAiD,MAAM,MAAM,CAAA;AAGxI,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAkB,MAAM,uBAAuB,CAAA;AAEhG,OAAO,EAAe,MAAM,EAAE,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,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAEpG;AACD,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,wBAKvC;AACD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM;;;;EAM/C;AACD,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,eAAe,GAAG,gBAAgB,CAAC,CAAA;AACpF,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,EAAE,CAAA;CAAE,CAAA"}
@@ -1,2 +1,2 @@
1
- import{G as a,H as b,I as c,J as d,K as e,L as f,M as g,N as h,O as i,P as j,Q as k,R as l,S as m,ca as n,da as o}from"./chunk-IVEP7DZW.min.js";import"./chunk-G3GOAFHU.min.js";export{d as MappedThread,b as Thread,o as ThreadInMemory,n as WriteableThread,m as assertOnlyCurrent,l as assertRaw,c as getLogsFromThread,j as getUntrackedFilterResults,h as getUntrackedPattern,k as hasFilter,a as isInitEvent,i as makeFilter,g as rollingAcc,e as rollingFilter,f as rollingMapper};
1
+ import{I as a,J as b,K as c,L as d,M as e,N as f,O as g,P as h,Q as i,R as j,S as k,T as l,U as m,ea as n,fa as o}from"./chunk-XQUJRFOK.min.js";import"./chunk-G3GOAFHU.min.js";export{d as MappedThread,b as Thread,o as ThreadInMemory,n as WriteableThread,m as assertOnlyCurrent,l as assertRaw,c as getLogsFromThread,j as getUntrackedFilterResults,h as getUntrackedPattern,k as hasFilter,a as isInitEvent,i as makeFilter,g as rollingAcc,e as rollingFilter,f as rollingMapper};
2
2
  //# sourceMappingURL=thread.min.js.map
package/dist/types.min.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-BR5DELY4.min.js";import"./chunk-IVEP7DZW.min.js";import"./chunk-G3GOAFHU.min.js";export{i as BOOL,f as Bool,k as DefaultFalse,j as DefaultTrue,h as NUM,c as Num,d as Obj,e as Opt,g as STR,b as Str,a as ThreadTB,l as checkParityTB};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-5O6HLH5H.min.js";import"./chunk-XQUJRFOK.min.js";import"./chunk-G3GOAFHU.min.js";export{i as BOOL,f as Bool,k as DefaultFalse,j as DefaultTrue,h as NUM,c as Num,d as Obj,e as Opt,g as STR,b as Str,a as ThreadTB,l as checkParityTB};
2
2
  //# sourceMappingURL=types.min.js.map
package/package.json CHANGED
@@ -1,84 +1,84 @@
1
1
  {
2
- "name": "@wovin/core",
3
- "version": "0.0.6",
4
- "type": "module",
5
- "scripts": {
6
- "build": "rm -rf dist/ && concurrently \"pnpm build:code\" \"pnpm build:types\"",
7
- "build:code": "tsup --minify",
8
- "build:types": "tsc --emitDeclarationOnly --declaration",
9
- "dev": "concurrently \"pnpm dev:code\" \"pnpm dev:types\"",
10
- "dev:code": "tsup --watch",
11
- "dev:types": "tsc --emitDeclarationOnly --declaration --watch",
12
- "lint": "eslint .",
13
- "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
14
- "pub": "npm publish --tag latest --access=public"
15
- },
16
- "main": "./dist/index.min.js",
17
- "module": "./dist/index.min.js",
18
- "browser": "./dist/index.min.js",
19
- "types": "./dist/index.d.ts",
20
- "exports": {
21
- ".": {
22
- "import": "./dist/index.min.js",
23
- "types": "./dist/index.d.ts"
24
- },
25
- "./applog": {
26
- "import": "./dist/applog.min.js",
27
- "types": "./dist/applog.d.ts"
28
- },
29
- "./ipfs": {
30
- "import": "./dist/ipfs.min.js",
31
- "types": "./dist/ipfs.d.ts"
32
- },
33
- "./pubsub": {
34
- "import": "./dist/pubsub.min.js",
35
- "types": "./dist/pubsub.d.ts"
36
- },
37
- "./query": {
38
- "import": "./dist/query.min.js",
39
- "types": "./dist/query.d.ts"
40
- },
41
- "./thread": {
42
- "import": "./dist/thread.min.js",
43
- "types": "./dist/thread.d.ts"
44
- },
45
- "./types": {
46
- "import": "./dist/types.min.js",
47
- "types": "./dist/types.d.ts"
48
- },
49
- "./utils": {
50
- "import": "./dist/utils.min.js",
51
- "types": "./dist/utils.d.ts"
52
- }
53
- },
54
- "files": [
55
- "./dist/"
56
- ],
57
- "esm.sh": {
58
- "bundle": false
59
- },
60
- "peerDependencies": {
61
- "mobx": "^6.12.0"
62
- },
63
- "dependencies": {
64
- "@ipld/car": "^5.2.4",
65
- "@ipld/dag-json": "^10.1.5",
66
- "@noble/hashes": "^1.3.2",
67
- "@sinclair/typebox": "^0.31.28",
68
- "besonders-logger": "1.0.0-RC11",
69
- "date-fns": "^2.30.0",
70
- "lodash-es": "^4.17.21",
71
- "mobx-utils": "^6.0.8",
72
- "multiformats": "^12.1.3",
73
- "safe-stable-stringify": "^2.4.3"
74
- },
75
- "devDependencies": {
76
- "@types/lodash-es": "^4.17.12",
77
- "concurrently": "^8.2.2",
78
- "esbuild-plugin-polyfill-node": "^0.3.0",
79
- "tsup": "^8.0.1",
80
- "tsupconfig": "workspace:^",
81
- "typescript": "^5.0.2",
82
- "vite": "^4.4.5"
83
- }
84
- }
2
+ "name": "@wovin/core",
3
+ "version": "0.0.7",
4
+ "type": "module",
5
+ "main": "./dist/index.min.js",
6
+ "module": "./dist/index.min.js",
7
+ "browser": "./dist/index.min.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.min.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./applog": {
15
+ "import": "./dist/applog.min.js",
16
+ "types": "./dist/applog.d.ts"
17
+ },
18
+ "./ipfs": {
19
+ "import": "./dist/ipfs.min.js",
20
+ "types": "./dist/ipfs.d.ts"
21
+ },
22
+ "./pubsub": {
23
+ "import": "./dist/pubsub.min.js",
24
+ "types": "./dist/pubsub.d.ts"
25
+ },
26
+ "./query": {
27
+ "import": "./dist/query.min.js",
28
+ "types": "./dist/query.d.ts"
29
+ },
30
+ "./thread": {
31
+ "import": "./dist/thread.min.js",
32
+ "types": "./dist/thread.d.ts"
33
+ },
34
+ "./types": {
35
+ "import": "./dist/types.min.js",
36
+ "types": "./dist/types.d.ts"
37
+ },
38
+ "./utils": {
39
+ "import": "./dist/utils.min.js",
40
+ "types": "./dist/utils.d.ts"
41
+ }
42
+ },
43
+ "files": [
44
+ "./dist/"
45
+ ],
46
+ "esm.sh": {
47
+ "bundle": false
48
+ },
49
+ "peerDependencies": {
50
+ "mobx": "^6.12.0",
51
+ "@sinclair/typebox": "^0.31.28"
52
+ },
53
+ "dependencies": {
54
+ "@ipld/car": "^5.2.4",
55
+ "@ipld/dag-json": "^10.1.5",
56
+ "@noble/hashes": "^1.3.2",
57
+ "besonders-logger": "1.0.0-RC11",
58
+ "date-fns": "^2.30.0",
59
+ "lodash-es": "^4.17.21",
60
+ "mobx-utils": "^6.0.8",
61
+ "multiformats": "^12.1.3",
62
+ "safe-stable-stringify": "^2.4.3"
63
+ },
64
+ "devDependencies": {
65
+ "@types/lodash-es": "^4.17.12",
66
+ "concurrently": "^8.2.2",
67
+ "esbuild-plugin-polyfill-node": "^0.3.0",
68
+ "tsup": "^8.0.1",
69
+ "typescript": "^5.0.2",
70
+ "vite": "^4.4.5",
71
+ "tsupconfig": "^0.0.0"
72
+ },
73
+ "scripts": {
74
+ "build": "rm -rf dist/ && concurrently \"pnpm build:code\" \"pnpm build:types\"",
75
+ "build:code": "tsup --minify",
76
+ "build:types": "tsc --emitDeclarationOnly --declaration",
77
+ "dev": "concurrently \"pnpm dev:code\" \"pnpm dev:types\"",
78
+ "dev:code": "tsup --watch",
79
+ "dev:types": "tsc --emitDeclarationOnly --declaration --watch",
80
+ "lint": "eslint .",
81
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
82
+ "pub": "npm publish --tag latest --access=public"
83
+ }
84
+ }
@@ -1,2 +0,0 @@
1
- import{D as c,E as u,a as g,b as m,c as f,da as v,y as l}from"./chunk-IVEP7DZW.min.js";import{c as p}from"./chunk-G3GOAFHU.min.js";var{WARN:d,LOG:B,DEBUG:y,VERBOSE:i,ERROR:q}=p.setup(p.INFO),L=u(function(e){y(`queryDivergencesByPrev<${e.nameAndSizeUntracked}>`),e.filters.includes("lastWriteWins")&&d("queryDivergencesByPrev on thread lastWriteWins",e);let s=c(()=>{let a=new Map,n=new Set;i("all applogs:",e.applogs);for(let r of e.applogs){let t;r.pv&&(t=r.pv&&a.get(r.pv.toString()),n.delete(r.pv.toString())),i("traversing log",{log:r,prevLogs:t,leafs:Array.from(n)}),a.set(r.cid,t?[...t,r]:[r]),n.add(r.cid)}return Array.from(n).map(r=>{let t=new v(a.get(r),e.filters,l({caller:"DivergenceLeaf",thread:e,pattern:`leaf: ${r}`}),!0,e);return{log:t.latestLog,thread:t}})},{name:l({caller:"queryDivergencesByPrev",thread:e})});return i.isDisabled||m(()=>i("[queryDivergencesByPrev] result:",f(s))),s},{equals:g.structural});function R(o){return e=>e?.includes?.(o)}function W(o){return e=>o?.includes?.(e)}export{L as a,R as b,W as c};
2
- //# sourceMappingURL=chunk-5Q6PAAMY.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/query/divergences.ts","../src/query/matchers.ts"],"sourcesContent":["import { Logger } from 'besonders-logger'\nimport { autorun, comparer, toJS } from 'mobx'\nimport { Applog } from '../applog/datom-types'\nimport { computedFnDeepCompare, createDebugName, observableArrayMap } from '../mobx/mobx-utils'\nimport { Thread } from '../thread'\nimport { ThreadInMemory } from '../thread/writeable'\n\nconst { WARN, LOG, DEBUG, VERBOSE, ERROR } = Logger.setup(Logger.INFO) // eslint-disable-line no-unused-vars\n\nexport interface DivergenceLeaf {\n\tlog: Applog\n\tthread: Thread\n}\n\nexport const queryDivergencesByPrev = computedFnDeepCompare(function queryConflictingByPrev(\n\tsourceThread: Thread,\n) {\n\tDEBUG(`queryDivergencesByPrev<${sourceThread.nameAndSizeUntracked}>`)\n\tif (sourceThread.filters.includes('lastWriteWins')) WARN(`queryDivergencesByPrev on thread lastWriteWins`, sourceThread)\n\n\tconst divergences = observableArrayMap(() => {\n\t\tconst logsForNode = new Map<string, Applog[]>()\n\t\tconst leafs = new Set<string>()\n\t\tVERBOSE('all applogs:', sourceThread.applogs)\n\t\tfor (const log of sourceThread.applogs) {\n\t\t\tlet prevLogs\n\t\t\tif (log.pv) {\n\t\t\t\tprevLogs = log.pv && logsForNode.get(log.pv.toString())\n\t\t\t\tleafs.delete(log.pv.toString())\n\t\t\t}\n\t\t\tVERBOSE('traversing log', { log, prevLogs, leafs: Array.from(leafs) })\n\t\t\tlogsForNode.set(log.cid, prevLogs ? [...prevLogs, log] : [log])\n\t\t\tleafs.add(log.cid)\n\t\t}\n\t\treturn Array.from(leafs).map(leafID => {\n\t\t\t// TODO use MappedThread?\n\t\t\tconst thread = new ThreadInMemory(\n\t\t\t\tlogsForNode.get(leafID),\n\t\t\t\tsourceThread.filters,\n\t\t\t\tcreateDebugName({\n\t\t\t\t\tcaller: 'DivergenceLeaf',\n\t\t\t\t\tthread: sourceThread,\n\t\t\t\t\tpattern: `leaf: ${leafID}`,\n\t\t\t\t}),\n\t\t\t\ttrue,\n\t\t\t\tsourceThread,\n\t\t\t)\n\t\t\treturn ({ log: thread.latestLog, thread })\n\t\t})\n\t}, { name: createDebugName({ caller: 'queryDivergencesByPrev', thread: sourceThread }) })\n\tVERBOSE.isDisabled || autorun(() => VERBOSE(`[queryDivergencesByPrev] result:`, toJS(divergences)))\n\treturn divergences\n}, { equals: comparer.structural })\n","import { DatomPart } from '../applog/datom-types'\n\nexport function includes(str: string) {\n\treturn (vl: DatomPart) => vl?.includes?.(str)\n}\nexport function includedIn(arr: string[]) {\n\treturn (vl: DatomPart) => arr?.includes?.(vl)\n}\n"],"mappings":"mIAOA,GAAM,CAAE,KAAAA,EAAM,IAAAC,EAAK,MAAAC,EAAO,QAAAC,EAAS,MAAAC,CAAM,EAAIC,EAAO,MAAMA,EAAO,IAAI,EAOxDC,EAAyBC,EAAsB,SAC3DC,EACC,CACDN,EAAM,0BAA0BM,EAAa,oBAAoB,GAAG,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","ERROR","Logger","queryDivergencesByPrev","computedFnDeepCompare","sourceThread","divergences","observableArrayMap","logsForNode","leafs","log","prevLogs","leafID","thread","ThreadInMemory","createDebugName","autorun","toJS","comparer","includes","str","vl","includedIn","arr"]}