@wovin/core 0.1.4 → 0.1.6

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.
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-QPGEBDMJ.min.js";
4
4
  import {
5
5
  lastWriteWins
6
- } from "./chunk-VL3EEL3J.min.js";
6
+ } from "./chunk-BEFJYVDW.min.js";
7
7
  import {
8
8
  CID,
9
9
  areCidsEqual,
@@ -16,7 +16,7 @@ import {
16
16
  rollingFilter,
17
17
  src_exports,
18
18
  wrapper_default
19
- } from "./chunk-S4ODHUJZ.min.js";
19
+ } from "./chunk-AOM4CWTC.min.js";
20
20
  import {
21
21
  __commonJS,
22
22
  __toESM
@@ -4119,4 +4119,4 @@ export {
4119
4119
  carFromBlob,
4120
4120
  streamReaderToIterable
4121
4121
  };
4122
- //# sourceMappingURL=chunk-YOTOHQPL.min.js.map
4122
+ //# sourceMappingURL=chunk-B6GB52LJ.min.js.map
@@ -16,7 +16,7 @@ import {
16
16
  rollingMapper,
17
17
  sortApplogsByTs,
18
18
  wrapper_default
19
- } from "./chunk-S4ODHUJZ.min.js";
19
+ } from "./chunk-AOM4CWTC.min.js";
20
20
  import {
21
21
  action,
22
22
  autorun,
@@ -507,4 +507,4 @@ export {
507
507
  withTimeout,
508
508
  throwOnTimeout
509
509
  };
510
- //# sourceMappingURL=chunk-VL3EEL3J.min.js.map
510
+ //# sourceMappingURL=chunk-BEFJYVDW.min.js.map
@@ -2,7 +2,7 @@ import {
2
2
  cyrb53hash,
3
3
  ensureTsPvAndFinalizeApplog,
4
4
  g
5
- } from "./chunk-S4ODHUJZ.min.js";
5
+ } from "./chunk-AOM4CWTC.min.js";
6
6
 
7
7
  // src/pubsub/pub-pull.ts
8
8
  var { WARN, LOG, DEBUG, VERBOSE, ERROR } = g.setup(g.INFO);
@@ -37,4 +37,4 @@ export {
37
37
  isSubscription,
38
38
  agentToShortHash
39
39
  };
40
- //# sourceMappingURL=chunk-3KCQUPCP.min.js.map
40
+ //# sourceMappingURL=chunk-MDWDKXLU.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/pubsub/pub-pull.ts","../src/pubsub/pubsub-types.ts"],"sourcesContent":["import { Logger } from 'besonders-logger'\nimport { CID } from 'multiformats'\nimport { ensureTsPvAndFinalizeApplog } from '../applog/applog-helpers'\nimport { EntityID } from '../applog/datom-types'\nimport { Thread } from '../thread'\n\nconst { WARN, LOG, DEBUG, VERBOSE, ERROR } = Logger.setup(Logger.INFO) // eslint-disable-line no-unused-vars\n\nexport type PubPullData = {\n\tcid: CID\n\tthread: Thread\n}\n\nexport function integratePub({ targetThread, agentHash, subID, pubData }: {\n\ttargetThread: Thread\n\tagentHash: EntityID\n\tpubData: PubPullData\n\tsubID?: EntityID\n}) {\n\tconst newLogs = pubData.thread.applogs.filter(log => !targetThread.hasApplog(log, false))\n\tDEBUG(`[integratePub] integrating ${newLogs.length} logs`, { targetThread, subID, pubData })\n\tlet toInsert = newLogs\n\tif (subID) {\n\t\ttoInsert = toInsert.concat(ensureTsPvAndFinalizeApplog(\n\t\t\t{ en: subID, at: 'subscription/cid', vl: pubData.cid.toString(), ag: agentHash },\n\t\t\ttargetThread,\n\t\t))\n\t}\n\ttargetThread.insertRaw(toInsert)\n\treturn newLogs\n}\n","import { CID } from 'multiformats/cid'\nimport { cyrb53hash } from './../applog/applog-utils'\nimport { AgentHash, AgentID, CidString } from '../applog/datom-types'\nimport { Tagged } from '../types'\n\ntype AgentString = Tagged<string, 'AgentString'>\ntype DIDString = Tagged<string, 'DID'>\nexport type { AgentHash, AgentString, DIDString }\n\nexport interface AppAgent {\n\tag: AgentHash\n\tagentString: AgentString\n\tdid: DIDString\n\tsign(data: Uint8Array): Promise<Uint8Array>\n}\nexport interface AppAgentForWorker {\n\tag: AgentHash\n\tagentString: AgentString\n\tdid: DIDString\n\tsignerSecret?: Uint8Array\n\tsign?: (data: Uint8Array)=> Promise<Uint8Array>\n}\nexport interface SnapRootBlock {\n\tapplogs: CID\n\tapplogsSignature: Uint8Array\n\tinfo: CID\n\tinfoSignature: Uint8Array\n\tprev?: CID\n}\nexport interface SnapBlockLogs {\n\tlogs: CID[]\n}\nexport interface SnapBlockChunks {\n\tchunks: CID[]\n}\nexport type SnapBlockLogsOrChunks = SnapBlockLogs | SnapBlockChunks\n\n// HACK: this is actually note3 types, not wovin\nexport interface IShare {\n\tid?: string // string hash of pub (used as unique id in IDB) `W3Name.create().toString()` starts with k51qzi5uqu5d\n\tcreatedAt: string // ISO timestamp of creation\n\tname: string // nick name for the pub\n\tisDeleted?: boolean\n\tpurgeBeforePush?: boolean\n\n\tpk: Uint8Array // exported privatekey - needed to create WritableName for publishing //TODO: store as non-extractable / encrypted?\n\n\tautopush: boolean\n\tlastPush: string | null\n\tlastCID?: string\n\tlatestLogTs?: string\n\tpubCounter?: number\n\n\tpublishedBy: string // local user appAgent\n\tselectors?: string[] // to be used as a filter for which applogs to pub\n\tencryptedFor?: string | null // short agentHash\n\tencryptedWith?: CryptoKey | null // AES-GCM derived key from ECDH keys (local private and remote public)\n\n\t// HACK WIP #39 - shared encryption\n\tsharedKey?: CryptoKey | null // AES-GCM derived key from ECDH keys (local private and ipns public)\n\tsharedAgents?: AgentID[] | null // array of string EntityIDs for the chosen agents (we need public jwkd atoms for each of them)\n\tsharedKeyMap?: Map<AgentID, string> | null // uses public key from each agent to derive an aes key that is used to encrypt and btoa the sharedKey that is actually used to encrypt and decrypt the applogs\n}\nexport interface ISubscription {\n\tid: string // string hash of pub (used as unique id in IDB) `W3Name.create().toString()` starts with k51qzi5uqu5d\n\tcreatedAt: string // ISO timestamp of creation\n\tname: string // nick name for the pub\n\tisDeleted: boolean\n\n\tlastPull?: string | null\n\tlastPullAttempt?: string | null\n\tautopull: boolean\n\tlastCID?: string // ? why not CidString\n\tlastApplogCID?: string\n\tpublishedBy?: string // remote publisher short agentHash\n\tencryptedFor?: string | undefined // short agentHash\n\tencryptedWith?: CryptoKey | undefined // AES-GCM derived key from ECDH keys (local private and remote public)\n}\nexport function isShare(obj: any): obj is IShare {\n\treturn obj?.pk !== undefined && obj?.lastPush !== undefined\n}\nexport function isSubscription(obj: any): obj is ISubscription {\n\treturn obj?.lastPull !== undefined\n}\n\nexport type TShareSub = IShare | ISubscription\n\nexport function agentToShortHash(agentString: string) {\n\treturn cyrb53hash(agentString, 31, 7) as string\n}\n"],"mappings":";;;;;;;AAMA,IAAM,EAAE,MAAM,KAAK,OAAO,SAAS,MAAM,IAAI,EAAO,MAAM,EAAO,IAAI;AAO9D,SAAS,aAAa,EAAE,cAAc,WAAW,OAAO,QAAQ,GAKpE;AACF,QAAM,UAAU,QAAQ,OAAO,QAAQ,OAAO,SAAO,CAAC,aAAa,UAAU,KAAK,KAAK,CAAC;AACxF,QAAM,8BAA8B,QAAQ,MAAM,SAAS,EAAE,cAAc,OAAO,QAAQ,CAAC;AAC3F,MAAI,WAAW;AACf,MAAI,OAAO;AACV,eAAW,SAAS,OAAO;AAAA,MAC1B,EAAE,IAAI,OAAO,IAAI,oBAAoB,IAAI,QAAQ,IAAI,SAAS,GAAG,IAAI,UAAU;AAAA,MAC/E;AAAA,IACD,CAAC;AAAA,EACF;AACA,eAAa,UAAU,QAAQ;AAC/B,SAAO;AACR;;;ACgDO,SAAS,QAAQ,KAAyB;AAChD,SAAO,KAAK,OAAO,UAAa,KAAK,aAAa;AACnD;AACO,SAAS,eAAe,KAAgC;AAC9D,SAAO,KAAK,aAAa;AAC1B;AAIO,SAAS,iBAAiB,aAAqB;AACrD,SAAO,WAAW,aAAa,IAAI,CAAC;AACrC;","names":[]}
1
+ {"version":3,"sources":["../src/pubsub/pub-pull.ts","../src/pubsub/pubsub-types.ts"],"sourcesContent":["import { Logger } from 'besonders-logger'\nimport { CID } from 'multiformats'\nimport { ensureTsPvAndFinalizeApplog } from '../applog/applog-helpers'\nimport { EntityID } from '../applog/datom-types'\nimport { Thread } from '../thread'\n\nconst { WARN, LOG, DEBUG, VERBOSE, ERROR } = Logger.setup(Logger.INFO) // eslint-disable-line no-unused-vars\n\nexport type PubPullData = {\n\tcid: CID\n\tthread: Thread\n}\n\nexport function integratePub({ targetThread, agentHash, subID, pubData }: {\n\ttargetThread: Thread\n\tagentHash: EntityID\n\tpubData: PubPullData\n\tsubID?: EntityID\n}) {\n\tconst newLogs = pubData.thread.applogs.filter(log => !targetThread.hasApplog(log, false))\n\tDEBUG(`[integratePub] integrating ${newLogs.length} logs`, { targetThread, subID, pubData })\n\tlet toInsert = newLogs\n\tif (subID) {\n\t\ttoInsert = toInsert.concat(ensureTsPvAndFinalizeApplog(\n\t\t\t{ en: subID, at: 'subscription/cid', vl: pubData.cid.toString(), ag: agentHash },\n\t\t\ttargetThread,\n\t\t))\n\t}\n\ttargetThread.insertRaw(toInsert)\n\treturn newLogs\n}\n","import { CID } from 'multiformats/cid'\nimport { cyrb53hash } from './../applog/applog-utils'\nimport { AgentHash, AgentID, CidString } from '../applog/datom-types'\nimport { Tagged } from '../types'\n\ntype AgentString = Tagged<string, 'AgentString'>\ntype DIDString = Tagged<string, 'DID'>\nexport type { AgentHash, AgentString, DIDString }\n\nexport interface AppAgent {\n\tag: AgentHash\n\tagentString: AgentString\n\tdid: DIDString\n\tsign(data: Uint8Array): Promise<Uint8Array>\n}\nexport interface AppAgentForWorker {\n\tag: AgentHash\n\tagentString: AgentString\n\tdid: DIDString\n\tsignerSecret?: Uint8Array\n\tsign?: (data: Uint8Array)=> Promise<Uint8Array>\n}\nexport interface SnapRootBlock {\n\tapplogs: CID\n\tapplogsSignature: Uint8Array\n\tinfo: CID\n\tinfoSignature: Uint8Array\n\tprev?: CID\n}\nexport interface SnapBlockLogs {\n\tlogs: CID[]\n}\nexport interface SnapBlockChunks {\n\tchunks: CID[]\n}\nexport type SnapBlockLogsOrChunks = SnapBlockLogs | SnapBlockChunks\n\n// HACK: this is actually note3 types, not wovin\nexport interface IShare {\n\tid?: string // string hash of pub (used as unique id in IDB) `W3Name.create().toString()` starts with k51qzi5uqu5d\n\tcreatedAt: string // ISO timestamp of creation\n\tname: string // nick name for the pub\n\tisDeleted?: boolean\n\tpurgeBeforePush?: boolean\n\n\tpk: Uint8Array // exported privatekey - needed to create WritableName for publishing //TODO: store as non-extractable / encrypted?\n\n\tautopush: boolean\n\tlastPush: string | null\n\tlastCID?: string\n\tlatestLogTs?: string\n\tpubCounter?: number\n\n\tpublishedBy: string // local user appAgent\n\tselectors?: string[] // to be used as a filter for which applogs to pub\n\tencryptedFor?: string | null // short agentHash\n\tencryptedWith?: CryptoKey | null // AES-GCM derived key from ECDH keys (local private and remote public)\n\n\t// HACK WIP #39 - shared encryption\n\tsharedKey?: CryptoKey | null // AES-GCM derived key from ECDH keys (local private and ipns public)\n\tsharedAgents?: AgentID[] | null // array of string EntityIDs for the chosen agents (we need public jwkd atoms for each of them)\n\tsharedKeyMap?: Map<AgentID, string> | null // uses public key from each agent to derive an aes key that is used to encrypt and btoa the sharedKey that is actually used to encrypt and decrypt the applogs\n}\nexport interface ISubscription {\n\tid: string // string hash of pub (used as unique id in IDB) `W3Name.create().toString()` starts with k51qzi5uqu5d\n\tcreatedAt: string // ISO timestamp of creation\n\tname: string // nick name for the pub\n\tisDeleted: boolean\n\n\tlastPull?: string | null\n\tlastPullAttempt?: string | null\n\tautopull: boolean\n\trealtime?: boolean // enable real-time WebSocket updates via IPNS watcher\n\tlastCID?: string // ? why not CidString\n\tlastApplogCID?: string\n\tpublishedBy?: string // remote publisher short agentHash\n\tencryptedFor?: string | undefined // short agentHash\n\tencryptedWith?: CryptoKey | undefined // AES-GCM derived key from ECDH keys (local private and remote public)\n}\nexport function isShare(obj: any): obj is IShare {\n\treturn obj?.pk !== undefined && obj?.lastPush !== undefined\n}\nexport function isSubscription(obj: any): obj is ISubscription {\n\treturn obj?.lastPull !== undefined\n}\n\nexport type TShareSub = IShare | ISubscription\n\nexport function agentToShortHash(agentString: string) {\n\treturn cyrb53hash(agentString, 31, 7) as string\n}\n"],"mappings":";;;;;;;AAMA,IAAM,EAAE,MAAM,KAAK,OAAO,SAAS,MAAM,IAAI,EAAO,MAAM,EAAO,IAAI;AAO9D,SAAS,aAAa,EAAE,cAAc,WAAW,OAAO,QAAQ,GAKpE;AACF,QAAM,UAAU,QAAQ,OAAO,QAAQ,OAAO,SAAO,CAAC,aAAa,UAAU,KAAK,KAAK,CAAC;AACxF,QAAM,8BAA8B,QAAQ,MAAM,SAAS,EAAE,cAAc,OAAO,QAAQ,CAAC;AAC3F,MAAI,WAAW;AACf,MAAI,OAAO;AACV,eAAW,SAAS,OAAO;AAAA,MAC1B,EAAE,IAAI,OAAO,IAAI,oBAAoB,IAAI,QAAQ,IAAI,SAAS,GAAG,IAAI,UAAU;AAAA,MAC/E;AAAA,IACD,CAAC;AAAA,EACF;AACA,eAAa,UAAU,QAAQ;AAC/B,SAAO;AACR;;;ACiDO,SAAS,QAAQ,KAAyB;AAChD,SAAO,KAAK,OAAO,UAAa,KAAK,aAAa;AACnD;AACO,SAAS,eAAe,KAAgC;AAC9D,SAAO,KAAK,aAAa;AAC1B;AAIO,SAAS,iBAAiB,aAAqB;AACrD,SAAO,WAAW,aAAa,IAAI,CAAC;AACrC;","names":[]}
@@ -4,7 +4,7 @@ import {
4
4
  createDebugName,
5
5
  g,
6
6
  observableArrayMap
7
- } from "./chunk-S4ODHUJZ.min.js";
7
+ } from "./chunk-AOM4CWTC.min.js";
8
8
  import {
9
9
  autorun,
10
10
  comparer,
@@ -62,4 +62,4 @@ export {
62
62
  includes,
63
63
  includedIn
64
64
  };
65
- //# sourceMappingURL=chunk-ZE3FVUCH.min.js.map
65
+ //# sourceMappingURL=chunk-PANN7XTE.min.js.map
package/dist/index.min.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import "./chunk-7IDQIMQO.min.js";
2
2
  import {
3
3
  fetchSnapshotChainUntil
4
- } from "./chunk-MGJYJPOD.min.js";
4
+ } from "./chunk-4APURYN7.min.js";
5
5
  import {
6
6
  agentToShortHash,
7
7
  integratePub,
8
8
  isShare,
9
9
  isSubscription
10
- } from "./chunk-3KCQUPCP.min.js";
10
+ } from "./chunk-MDWDKXLU.min.js";
11
11
  import {
12
12
  carFromBlob,
13
13
  chunkApplogs,
@@ -23,13 +23,13 @@ import {
23
23
  prepareSnapshotForPush,
24
24
  streamReaderToIterable,
25
25
  unchunkApplogsBlock
26
- } from "./chunk-YOTOHQPL.min.js";
26
+ } from "./chunk-B6GB52LJ.min.js";
27
27
  import "./chunk-QPGEBDMJ.min.js";
28
28
  import {
29
29
  includedIn,
30
30
  includes,
31
31
  queryDivergencesByPrev
32
- } from "./chunk-ZE3FVUCH.min.js";
32
+ } from "./chunk-PANN7XTE.min.js";
33
33
  import {
34
34
  QueryNode,
35
35
  QueryResult,
@@ -56,7 +56,7 @@ import {
56
56
  throwOnTimeout,
57
57
  withTimeout,
58
58
  withoutDeleted
59
- } from "./chunk-VL3EEL3J.min.js";
59
+ } from "./chunk-BEFJYVDW.min.js";
60
60
  import {
61
61
  AppLogNoCidTB,
62
62
  AppLogNoCidTBC,
@@ -103,6 +103,7 @@ import {
103
103
  ensureTsPvAndFinalizeApplogs,
104
104
  ensureValidCIDinstance,
105
105
  entityCount,
106
+ excludeApplogsContainedIn,
106
107
  finalizeApplogForInsert,
107
108
  getAgents,
108
109
  getApplogNoCidTypeErrors,
@@ -154,7 +155,7 @@ import {
154
155
  variableNameWithoutQuestionmark,
155
156
  withPvFrom,
156
157
  withTs
157
- } from "./chunk-S4ODHUJZ.min.js";
158
+ } from "./chunk-AOM4CWTC.min.js";
158
159
  import "./chunk-KEHU7HGZ.min.js";
159
160
  import "./chunk-5MMGBK2U.min.js";
160
161
  import {
@@ -240,6 +241,7 @@ export {
240
241
  entityOverlap,
241
242
  entityOverlapCount,
242
243
  entityOverlapMap,
244
+ excludeApplogsContainedIn,
243
245
  fetchSnapshotChainUntil,
244
246
  filterAndMap,
245
247
  finalizeApplogForInsert,
package/dist/ipfs.min.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  fetchSnapshotChainUntil
3
- } from "./chunk-MGJYJPOD.min.js";
3
+ } from "./chunk-4APURYN7.min.js";
4
4
  import {
5
5
  carFromBlob,
6
6
  decodePubFromBlocks,
@@ -10,9 +10,9 @@ import {
10
10
  makeCarBlob,
11
11
  makeCarOut,
12
12
  streamReaderToIterable
13
- } from "./chunk-YOTOHQPL.min.js";
13
+ } from "./chunk-B6GB52LJ.min.js";
14
14
  import "./chunk-QPGEBDMJ.min.js";
15
- import "./chunk-VL3EEL3J.min.js";
15
+ import "./chunk-BEFJYVDW.min.js";
16
16
  import {
17
17
  MULTICODEC_IPNS_KEY,
18
18
  areCidsEqual,
@@ -28,7 +28,7 @@ import {
28
28
  prepareForPub,
29
29
  toIpnsString,
30
30
  tryParseCID
31
- } from "./chunk-S4ODHUJZ.min.js";
31
+ } from "./chunk-AOM4CWTC.min.js";
32
32
  import "./chunk-KEHU7HGZ.min.js";
33
33
  import "./chunk-HYMC7W6S.min.js";
34
34
  import "./chunk-PHITDXZT.min.js";
@@ -59,6 +59,7 @@ export interface ISubscription {
59
59
  lastPull?: string | null;
60
60
  lastPullAttempt?: string | null;
61
61
  autopull: boolean;
62
+ realtime?: boolean;
62
63
  lastCID?: string;
63
64
  lastApplogCID?: string;
64
65
  publishedBy?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"pubsub-types.d.ts","sourceRoot":"","sources":["../../src/pubsub/pubsub-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAEtC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAa,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;AAChD,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AACtC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAA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AG,IAAI,MAAM,CAE/C;AACD,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,aAAa,CAE7D;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,aAAa,CAAA;AAE9C,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GACV,MAAM,CAC/C"}
@@ -3,7 +3,7 @@ import {
3
3
  integratePub,
4
4
  isShare,
5
5
  isSubscription
6
- } from "./chunk-3KCQUPCP.min.js";
6
+ } from "./chunk-MDWDKXLU.min.js";
7
7
  import {
8
8
  chunkApplogs,
9
9
  encodeSnapshotApplogsAsCar,
@@ -11,10 +11,10 @@ import {
11
11
  isSnapBlockChunks,
12
12
  prepareSnapshotForPush,
13
13
  unchunkApplogsBlock
14
- } from "./chunk-YOTOHQPL.min.js";
14
+ } from "./chunk-B6GB52LJ.min.js";
15
15
  import "./chunk-QPGEBDMJ.min.js";
16
- import "./chunk-VL3EEL3J.min.js";
17
- import "./chunk-S4ODHUJZ.min.js";
16
+ import "./chunk-BEFJYVDW.min.js";
17
+ import "./chunk-AOM4CWTC.min.js";
18
18
  import "./chunk-KEHU7HGZ.min.js";
19
19
  import "./chunk-HYMC7W6S.min.js";
20
20
  import "./chunk-PHITDXZT.min.js";
package/dist/query.min.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  includedIn,
3
3
  includes,
4
4
  queryDivergencesByPrev
5
- } from "./chunk-ZE3FVUCH.min.js";
5
+ } from "./chunk-PANN7XTE.min.js";
6
6
  import {
7
7
  QueryNode,
8
8
  QueryResult,
@@ -29,7 +29,7 @@ import {
29
29
  throwOnTimeout,
30
30
  withTimeout,
31
31
  withoutDeleted
32
- } from "./chunk-VL3EEL3J.min.js";
32
+ } from "./chunk-BEFJYVDW.min.js";
33
33
  import {
34
34
  applogThreadComparer,
35
35
  autorunButAlsoImmediately,
@@ -45,7 +45,7 @@ import {
45
45
  prettifyThreadName,
46
46
  queryNodesComparer,
47
47
  rootsQueries
48
- } from "./chunk-S4ODHUJZ.min.js";
48
+ } from "./chunk-AOM4CWTC.min.js";
49
49
  import "./chunk-KEHU7HGZ.min.js";
50
50
  import "./chunk-HYMC7W6S.min.js";
51
51
  import "./chunk-PHITDXZT.min.js";
@@ -1,5 +1,6 @@
1
+ import { CID } from 'multiformats';
1
2
  import { compareApplogsByEnAt } from '../applog/applog-utils';
2
- import { Applog, ApplogForInsert } from '../applog/datom-types';
3
+ import { Applog, ApplogForInsert, CidString } from '../applog/datom-types';
3
4
  import { Thread } from './basic';
4
5
  import { MappedThread } from './mapped';
5
6
  export declare function entityCount(thread: Thread): number;
@@ -14,4 +15,9 @@ export declare function holdTillFirstWrite(thread: Thread, applogsToHold: Applog
14
15
  onFirstWrite: (heldLogsToInsert: Applog[]) => Applog[] | undefined;
15
16
  }): MappedThread;
16
17
  export declare function getAgents(thread: Thread): import("..").AgentHash[];
18
+ /**
19
+ * Returns applogs NOT contained in the exclusion set.
20
+ * Uses CID-based comparison (consistent with removeDuplicateAppLogs).
21
+ */
22
+ export declare const excludeApplogsContainedIn: (applogs: readonly Applog[], exclude: Thread | readonly Applog[] | Set<CID | CidString>) => Applog[];
17
23
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/thread/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAsC,MAAM,wBAAwB,CAAA;AACjG,OAAO,EAAE,MAAM,EAAE,eAAe,EAAY,MAAM,uBAAuB,CAAA;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAKvC,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,UAEzC;AACD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,eAE1C;AAcD,wBAAgB,cAAc,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,SAAM,EACV,oBAAoB,0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,EAAE,EAC1B,SAAS,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,SAAS,CAAC,KACxD,MAAM,EAcR,CAAA"}
@@ -4,6 +4,12 @@ export declare abstract class WriteableThread extends Thread {
4
4
  constructor(name: string, applogs: Applog[], filters: readonly string[]);
5
5
  purge(cidsToPurge: CidString[]): number;
6
6
  insert(appLogsToInsert: ApplogForInsert[]): Applog[];
7
+ /**
8
+ * Insert only applogs not already in this thread.
9
+ * @param byRef If true, compares by reference; if false, compares by CID (default)
10
+ * @returns The applogs that were actually inserted
11
+ */
12
+ insertMissing(appLogsToInsert: readonly Applog[], byRef?: boolean): Applog[];
7
13
  /**
8
14
  * @param appLogsToInsert It needs to be mutable because it will be sorted
9
15
  * (and if you need to clone it, so do it when you need to) - this is weird as TS is slathering type safety onto ducks
@@ -1 +1 @@
1
- {"version":3,"file":"writeable.d.ts","sourceRoot":"","sources":["../../src/thread/writeable.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,eAAe,EAAE,SAAS,EAAiB,MAAM,uBAAuB,CAAA;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIhC,8BAAsB,eAAgB,SAAQ,MAAM;gBAElD,IAAI,EAAE,MAAM,EAEZ,OAAO,EAAE,MAAM,EAAO,EACtB,OAAO,EAAE,SAAS,MAAM,EAAE;IASpB,KAAK,CAAC,WAAW,EAAE,SAAS,EAAE;IAM9B,MAAM,CAAC,eAAe,EAAE,eAAe,EAAE;IAWhD;;;OAGG;IACI,SAAS,CAAC,eAAe,EAAE,MAAM,EAAE;IAwD1C,IAAI,QAAQ,YAEX;IAED,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CACzD;AACD,qBAAa,cAAe,SAAQ,eAAe;IAgBjD,QAAQ,CAAC,SAAS,EAAE,OAAO;IAf5B,MAAM,C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KAAK,CAAC,IAAI,CAAC,EAAE,MAAM;IAG1B,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,UAAQ;IAGnE,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM;gBAMjE,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,SAAS,MAAM,EAAE,EACjB,SAAS,EAAE,OAAO;IAU5B,IAAI,QAAQ,YAEX;cAEe,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE;CAMtC"}
@@ -9,6 +9,7 @@ import {
9
9
  assertRaw,
10
10
  debounceWrites,
11
11
  entityCount,
12
+ excludeApplogsContainedIn,
12
13
  getAgents,
13
14
  getLogsFromThread,
14
15
  getUntrackedFilterResults,
@@ -21,7 +22,7 @@ import {
21
22
  rollingFilter,
22
23
  rollingMapper,
23
24
  simpleApplogMapper
24
- } from "./chunk-S4ODHUJZ.min.js";
25
+ } from "./chunk-AOM4CWTC.min.js";
25
26
  import "./chunk-KEHU7HGZ.min.js";
26
27
  import "./chunk-HYMC7W6S.min.js";
27
28
  import "./chunk-PHITDXZT.min.js";
@@ -36,6 +37,7 @@ export {
36
37
  assertRaw,
37
38
  debounceWrites,
38
39
  entityCount,
40
+ excludeApplogsContainedIn,
39
41
  getAgents,
40
42
  getLogsFromThread,
41
43
  getUntrackedFilterResults,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wovin/core",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.min.js",
6
6
  "module": "./dist/index.min.js",