@wovin/core 0.0.9-RC4 → 0.0.11
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 +661 -0
- package/dist/applog/applog-helpers.d.ts +26 -7
- package/dist/applog/applog-helpers.d.ts.map +1 -1
- package/dist/applog/applog-utils.d.ts +11 -2
- package/dist/applog/applog-utils.d.ts.map +1 -1
- package/dist/applog/datom-types.d.ts +24 -13
- package/dist/applog/datom-types.d.ts.map +1 -1
- package/dist/applog.min.js +11 -3
- package/dist/{chunk-PTGUFZ3Q.min.js → chunk-6EBQRFQC.min.js} +1 -5
- package/dist/{chunk-PTGUFZ3Q.min.js.map → chunk-6EBQRFQC.min.js.map} +1 -1
- package/dist/chunk-C75X52ZX.min.js +2314 -0
- package/dist/chunk-C75X52ZX.min.js.map +1 -0
- package/dist/chunk-DF3UOPRV.min.js +5085 -0
- package/dist/chunk-DF3UOPRV.min.js.map +1 -0
- package/dist/{chunk-XXTV6KVM.min.js → chunk-L4AYAZCN.min.js} +9 -9
- package/dist/chunk-L4AYAZCN.min.js.map +1 -0
- package/dist/chunk-QPGEBDMJ.min.js +9 -0
- package/dist/chunk-QPGEBDMJ.min.js.map +1 -0
- package/dist/chunk-TPRWMCU7.min.js +494 -0
- package/dist/chunk-TPRWMCU7.min.js.map +1 -0
- package/dist/{chunk-V5T5PE7K.min.js → chunk-UQJEOS7T.min.js} +5913 -5688
- package/dist/chunk-UQJEOS7T.min.js.map +1 -0
- package/dist/chunk-UREBOWFC.min.js +40 -0
- package/dist/chunk-UREBOWFC.min.js.map +1 -0
- package/dist/index.min.js +103 -53
- package/dist/ipfs/car.d.ts +47 -7
- package/dist/ipfs/car.d.ts.map +1 -1
- package/dist/ipfs/ipfs-utils.d.ts +18 -7
- package/dist/ipfs/ipfs-utils.d.ts.map +1 -1
- package/dist/ipfs.min.js +24 -6
- package/dist/mobx/mobx-utils.d.ts +23 -17
- package/dist/mobx/mobx-utils.d.ts.map +1 -1
- package/dist/mobx.d.ts +2 -0
- package/dist/mobx.d.ts.map +1 -0
- package/dist/mobx.min.js +141 -0
- package/dist/mobx.min.js.map +1 -0
- package/dist/pubsub/connector.d.ts +3 -1
- package/dist/pubsub/connector.d.ts.map +1 -1
- package/dist/pubsub/pub-pull.d.ts +14 -0
- package/dist/pubsub/pub-pull.d.ts.map +1 -0
- package/dist/pubsub/pub-push.d.ts +41 -0
- package/dist/pubsub/pub-push.d.ts.map +1 -0
- package/dist/pubsub/pubsub-types.d.ts +25 -1
- package/dist/pubsub/pubsub-types.d.ts.map +1 -1
- package/dist/pubsub.d.ts +2 -1
- package/dist/pubsub.d.ts.map +1 -1
- package/dist/pubsub.min.js +20 -13
- package/dist/query/basic.d.ts +40 -8
- package/dist/query/basic.d.ts.map +1 -1
- package/dist/query/divergences.d.ts.map +1 -1
- package/dist/query/types.d.ts +3 -3
- package/dist/query/types.d.ts.map +1 -1
- package/dist/query.min.js +34 -16
- package/dist/thread/basic.d.ts +24 -4
- package/dist/thread/basic.d.ts.map +1 -1
- package/dist/thread/filters.d.ts +2 -2
- package/dist/thread/filters.d.ts.map +1 -1
- package/dist/thread/mapped.d.ts +10 -3
- package/dist/thread/mapped.d.ts.map +1 -1
- package/dist/thread/utils.d.ts +16 -0
- package/dist/thread/utils.d.ts.map +1 -0
- package/dist/thread/writeable.d.ts +4 -3
- package/dist/thread/writeable.d.ts.map +1 -1
- package/dist/thread.d.ts +1 -0
- package/dist/thread.d.ts.map +1 -1
- package/dist/thread.min.js +13 -3
- package/dist/types/typescript-utils.d.ts +5 -4
- package/dist/types/typescript-utils.d.ts.map +1 -1
- package/dist/types.min.js +1 -5
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.min.js +9 -0
- package/package.json +17 -11
- package/dist/chunk-CIOF7QHW.min.js +0 -135
- package/dist/chunk-CIOF7QHW.min.js.map +0 -1
- package/dist/chunk-V5T5PE7K.min.js.map +0 -1
- package/dist/chunk-VM46JSEH.min.js +0 -1426
- package/dist/chunk-VM46JSEH.min.js.map +0 -1
- package/dist/chunk-XXTV6KVM.min.js.map +0 -1
- package/dist/chunk-YBXZNIU2.min.js +0 -4417
- package/dist/chunk-YBXZNIU2.min.js.map +0 -1
- package/dist/pubsub/publication.d.ts +0 -17
- package/dist/pubsub/publication.d.ts.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
E,
|
|
3
|
+
cyrb53hash,
|
|
4
|
+
ensureTsPvAndFinalizeApplog
|
|
5
|
+
} from "./chunk-UQJEOS7T.min.js";
|
|
6
|
+
|
|
7
|
+
// src/pubsub/pub-pull.ts
|
|
8
|
+
var { WARN, LOG, DEBUG, VERBOSE, ERROR } = E.setup(E.INFO);
|
|
9
|
+
function integratePub({ targetThread, agentHash, subID, pubData }) {
|
|
10
|
+
const newLogs = pubData.thread.applogs.filter((log) => !targetThread.hasApplog(log, false));
|
|
11
|
+
DEBUG(`[integratePub] integrating ${newLogs.length} logs`, { targetThread, subID, pubData });
|
|
12
|
+
let toInsert = newLogs;
|
|
13
|
+
if (subID) {
|
|
14
|
+
toInsert = toInsert.concat(ensureTsPvAndFinalizeApplog(
|
|
15
|
+
{ en: subID, at: "subscription/cid", vl: pubData.cid.toString(), ag: agentHash },
|
|
16
|
+
targetThread
|
|
17
|
+
));
|
|
18
|
+
}
|
|
19
|
+
targetThread.insertRaw(toInsert);
|
|
20
|
+
return newLogs;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// src/pubsub/pubsub-types.ts
|
|
24
|
+
function isPublication(obj) {
|
|
25
|
+
return obj?.pk !== void 0 && obj?.lastPush !== void 0;
|
|
26
|
+
}
|
|
27
|
+
function isSubscription(obj) {
|
|
28
|
+
return obj?.lastPull !== void 0;
|
|
29
|
+
}
|
|
30
|
+
function agentToShortHash(agentString) {
|
|
31
|
+
return cyrb53hash(agentString, 31, 7);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
integratePub,
|
|
36
|
+
isPublication,
|
|
37
|
+
isSubscription,
|
|
38
|
+
agentToShortHash
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=chunk-UREBOWFC.min.js.map
|
|
@@ -0,0 +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 PubBlockRoot {\n\tapplogs: CID\n\tapplogsSignature: Uint8Array\n\tinfo: CID\n\tinfoSignature: Uint8Array\n\tprev?: CID\n}\nexport interface PubBlockLogs {\n\tlogs: CID[]\n}\nexport interface PubBlockChunks {\n\tchunks: CID[]\n}\nexport type PubBlockLogsOrChunks = PubBlockLogs | PubBlockChunks\n\n// HACK: this is actually note3 types, not wovin\nexport interface IPublication {\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 isPublication(obj: any): obj is IPublication {\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 TSubPub = IPublication | 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,cAAc,KAA+B;AAC5D,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":[]}
|
package/dist/index.min.js
CHANGED
|
@@ -2,27 +2,57 @@ import "./chunk-7IDQIMQO.min.js";
|
|
|
2
2
|
import "./chunk-RPPZKO5L.min.js";
|
|
3
3
|
import {
|
|
4
4
|
agentToShortHash,
|
|
5
|
-
|
|
6
|
-
encodeApplogsAsCar,
|
|
7
|
-
encodePubAsCar,
|
|
8
|
-
getLogsFromPub,
|
|
5
|
+
integratePub,
|
|
9
6
|
isPublication,
|
|
10
|
-
isSubscription
|
|
11
|
-
|
|
12
|
-
} from "./chunk-CIOF7QHW.min.js";
|
|
7
|
+
isSubscription
|
|
8
|
+
} from "./chunk-UREBOWFC.min.js";
|
|
13
9
|
import {
|
|
14
10
|
carFromBlob,
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
chunkApplogs,
|
|
12
|
+
decodePubFromBlocks,
|
|
13
|
+
decodePubFromCar,
|
|
14
|
+
encodeApplogsAsCar,
|
|
15
|
+
encodePubAsCar,
|
|
16
|
+
getBlocksOfCar,
|
|
17
|
+
getDecodedBlock,
|
|
18
|
+
isPubBlockChunks,
|
|
17
19
|
makeCarBlob,
|
|
18
20
|
makeCarOut,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
preparePubForPush,
|
|
22
|
+
streamReaderToIterable,
|
|
23
|
+
unchunkApplogsBlock
|
|
24
|
+
} from "./chunk-C75X52ZX.min.js";
|
|
25
|
+
import "./chunk-QPGEBDMJ.min.js";
|
|
21
26
|
import {
|
|
22
27
|
includedIn,
|
|
23
28
|
includes,
|
|
24
29
|
queryDivergencesByPrev
|
|
25
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-L4AYAZCN.min.js";
|
|
31
|
+
import {
|
|
32
|
+
QueryNode,
|
|
33
|
+
QueryResult,
|
|
34
|
+
agentsOfThread,
|
|
35
|
+
createObjMapper,
|
|
36
|
+
entityOverlap,
|
|
37
|
+
entityOverlapCount,
|
|
38
|
+
entityOverlapMap,
|
|
39
|
+
filterAndMap,
|
|
40
|
+
lastWriteWins,
|
|
41
|
+
mapQueryResultWith,
|
|
42
|
+
mapThreadWith,
|
|
43
|
+
prefixAt,
|
|
44
|
+
prefixAttrs,
|
|
45
|
+
query,
|
|
46
|
+
queryAndMap,
|
|
47
|
+
queryEntity,
|
|
48
|
+
queryNot,
|
|
49
|
+
querySingle,
|
|
50
|
+
querySingleAndMap,
|
|
51
|
+
queryStep,
|
|
52
|
+
startsWith,
|
|
53
|
+
threadFromMaybeArray,
|
|
54
|
+
withoutDeleted
|
|
55
|
+
} from "./chunk-TPRWMCU7.min.js";
|
|
26
56
|
import {
|
|
27
57
|
AppLogNoCidTB,
|
|
28
58
|
AppLogNoCidTBC,
|
|
@@ -31,37 +61,47 @@ import {
|
|
|
31
61
|
CIDTB,
|
|
32
62
|
EntityID,
|
|
33
63
|
EntityID_LENGTH,
|
|
64
|
+
MULTICODEC_IPNS_KEY,
|
|
34
65
|
MappedThread,
|
|
35
66
|
Nullable,
|
|
36
|
-
|
|
37
|
-
QueryResult,
|
|
67
|
+
StaticThread,
|
|
38
68
|
Thread,
|
|
39
69
|
ThreadInMemory,
|
|
40
70
|
URL,
|
|
41
71
|
WriteableThread,
|
|
42
72
|
actualize,
|
|
43
|
-
|
|
73
|
+
allEntityIDs,
|
|
44
74
|
applogThreadComparer,
|
|
45
75
|
areApplogsEqual,
|
|
76
|
+
areCidsEqual,
|
|
46
77
|
arrStats,
|
|
47
78
|
arraysContainSameElements,
|
|
48
79
|
assertOnlyCurrent,
|
|
49
80
|
assertRaw,
|
|
50
81
|
autorunButAlsoImmediately,
|
|
82
|
+
cidToString,
|
|
83
|
+
compareApplogsByEnAt,
|
|
51
84
|
compareApplogsByTs,
|
|
52
85
|
computedFnDeepCompare,
|
|
53
86
|
computedStructuralComparer,
|
|
87
|
+
containsCid,
|
|
54
88
|
createDebugName,
|
|
55
89
|
createDebugNameObj,
|
|
56
90
|
cyrb53hash,
|
|
57
91
|
dateNowIso,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
92
|
+
debounceWrites,
|
|
93
|
+
encodeApplog,
|
|
94
|
+
encodeApplogAndGetCid,
|
|
95
|
+
encodeBlock,
|
|
96
|
+
encodeBlockOriginal,
|
|
97
|
+
ensureTsPvAndFinalizeApplog,
|
|
98
|
+
ensureTsPvAndFinalizeApplogs,
|
|
99
|
+
ensureValidCIDinstance,
|
|
100
|
+
entityCount,
|
|
62
101
|
finalizeApplogForInsert,
|
|
63
102
|
getApplogNoCidTypeErrors,
|
|
64
103
|
getApplogTypeErrors,
|
|
104
|
+
getCidSync,
|
|
65
105
|
getHashID,
|
|
66
106
|
getLogsFromThread,
|
|
67
107
|
getUntrackedFilterResults,
|
|
@@ -70,7 +110,10 @@ import {
|
|
|
70
110
|
hasFilter,
|
|
71
111
|
hasPv,
|
|
72
112
|
hasTs,
|
|
113
|
+
holdTillFirstWrite,
|
|
114
|
+
isEncryptedApplog,
|
|
73
115
|
isInitEvent,
|
|
116
|
+
isIpnsKeyCid,
|
|
74
117
|
isStaticPattern,
|
|
75
118
|
isTsBefore,
|
|
76
119
|
isValidApplog,
|
|
@@ -78,56 +121,39 @@ import {
|
|
|
78
121
|
isVariable,
|
|
79
122
|
isoDateStrCompare,
|
|
80
123
|
joinThreads,
|
|
81
|
-
lastWriteWins,
|
|
82
124
|
makeFilter,
|
|
83
|
-
mapTo,
|
|
84
125
|
matchPart,
|
|
85
126
|
matchPartStatic,
|
|
86
127
|
matchPattern,
|
|
87
128
|
objEqualByKeys,
|
|
88
129
|
observableArrayMap,
|
|
89
130
|
observableMapMap,
|
|
90
|
-
|
|
91
|
-
|
|
131
|
+
observableMapToObject,
|
|
132
|
+
observableSetMap,
|
|
133
|
+
prepareForPub,
|
|
92
134
|
prettifyThreadName,
|
|
93
|
-
query,
|
|
94
|
-
queryAndMap,
|
|
95
|
-
queryEntity,
|
|
96
135
|
queryNodesComparer,
|
|
97
|
-
queryNot,
|
|
98
|
-
queryStep,
|
|
99
136
|
removeDuplicateAppLogs,
|
|
100
137
|
resolveOrRemoveVariables,
|
|
101
138
|
rollingAcc,
|
|
102
139
|
rollingFilter,
|
|
103
140
|
rollingMapper,
|
|
141
|
+
rootsQueries,
|
|
104
142
|
simpleApplogMapper,
|
|
105
143
|
sortApplogsByTs,
|
|
106
|
-
|
|
144
|
+
toIpnsString,
|
|
145
|
+
tryParseCID,
|
|
107
146
|
tsNearlySame,
|
|
108
147
|
uniqueEnFromAppLogs,
|
|
109
148
|
variableNameWithoutQuestionmark,
|
|
110
149
|
withPvFrom,
|
|
111
|
-
withTs
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
import {
|
|
115
|
-
MULTICODEC_IPNS_KEY,
|
|
116
|
-
encodeApplog,
|
|
117
|
-
encodeApplogAndGetCid,
|
|
118
|
-
encodeBlock,
|
|
119
|
-
encodeBlockOriginal,
|
|
120
|
-
getCidSync,
|
|
121
|
-
prepareForPub,
|
|
122
|
-
toIpnsString,
|
|
123
|
-
tryParseCID
|
|
124
|
-
} from "./chunk-YBXZNIU2.min.js";
|
|
150
|
+
withTs
|
|
151
|
+
} from "./chunk-UQJEOS7T.min.js";
|
|
152
|
+
import "./chunk-DF3UOPRV.min.js";
|
|
125
153
|
import "./chunk-5MMGBK2U.min.js";
|
|
126
154
|
import {
|
|
127
155
|
BOOL,
|
|
128
156
|
Bool,
|
|
129
|
-
DefaultFalse,
|
|
130
|
-
DefaultTrue,
|
|
131
157
|
NUM,
|
|
132
158
|
Num,
|
|
133
159
|
Obj,
|
|
@@ -136,7 +162,7 @@ import {
|
|
|
136
162
|
Str,
|
|
137
163
|
arrayIfSingle,
|
|
138
164
|
checkParityTB
|
|
139
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-6EBQRFQC.min.js";
|
|
140
166
|
import "./chunk-KRQZ6V4Y.min.js";
|
|
141
167
|
export {
|
|
142
168
|
AppLogNoCidTB,
|
|
@@ -146,8 +172,6 @@ export {
|
|
|
146
172
|
BOOL,
|
|
147
173
|
Bool,
|
|
148
174
|
CIDTB,
|
|
149
|
-
DefaultFalse,
|
|
150
|
-
DefaultTrue,
|
|
151
175
|
EntityID,
|
|
152
176
|
EntityID_LENGTH,
|
|
153
177
|
MULTICODEC_IPNS_KEY,
|
|
@@ -160,6 +184,7 @@ export {
|
|
|
160
184
|
QueryNode,
|
|
161
185
|
QueryResult,
|
|
162
186
|
STR,
|
|
187
|
+
StaticThread,
|
|
163
188
|
Str,
|
|
164
189
|
Thread,
|
|
165
190
|
ThreadInMemory,
|
|
@@ -168,8 +193,10 @@ export {
|
|
|
168
193
|
actualize,
|
|
169
194
|
agentToShortHash,
|
|
170
195
|
agentsOfThread,
|
|
196
|
+
allEntityIDs,
|
|
171
197
|
applogThreadComparer,
|
|
172
198
|
areApplogsEqual,
|
|
199
|
+
areCidsEqual,
|
|
173
200
|
arrStats,
|
|
174
201
|
arrayIfSingle,
|
|
175
202
|
arraysContainSameElements,
|
|
@@ -178,22 +205,31 @@ export {
|
|
|
178
205
|
autorunButAlsoImmediately,
|
|
179
206
|
carFromBlob,
|
|
180
207
|
checkParityTB,
|
|
208
|
+
chunkApplogs,
|
|
209
|
+
cidToString,
|
|
210
|
+
compareApplogsByEnAt,
|
|
181
211
|
compareApplogsByTs,
|
|
182
212
|
computedFnDeepCompare,
|
|
183
213
|
computedStructuralComparer,
|
|
184
|
-
|
|
214
|
+
containsCid,
|
|
185
215
|
createDebugName,
|
|
186
216
|
createDebugNameObj,
|
|
217
|
+
createObjMapper,
|
|
187
218
|
cyrb53hash,
|
|
188
219
|
dateNowIso,
|
|
189
|
-
|
|
190
|
-
|
|
220
|
+
debounceWrites,
|
|
221
|
+
decodePubFromBlocks,
|
|
222
|
+
decodePubFromCar,
|
|
191
223
|
encodeApplog,
|
|
192
224
|
encodeApplogAndGetCid,
|
|
193
225
|
encodeApplogsAsCar,
|
|
194
226
|
encodeBlock,
|
|
195
227
|
encodeBlockOriginal,
|
|
196
228
|
encodePubAsCar,
|
|
229
|
+
ensureTsPvAndFinalizeApplog,
|
|
230
|
+
ensureTsPvAndFinalizeApplogs,
|
|
231
|
+
ensureValidCIDinstance,
|
|
232
|
+
entityCount,
|
|
197
233
|
entityOverlap,
|
|
198
234
|
entityOverlapCount,
|
|
199
235
|
entityOverlapMap,
|
|
@@ -201,9 +237,10 @@ export {
|
|
|
201
237
|
finalizeApplogForInsert,
|
|
202
238
|
getApplogNoCidTypeErrors,
|
|
203
239
|
getApplogTypeErrors,
|
|
240
|
+
getBlocksOfCar,
|
|
204
241
|
getCidSync,
|
|
242
|
+
getDecodedBlock,
|
|
205
243
|
getHashID,
|
|
206
|
-
getLogsFromPub,
|
|
207
244
|
getLogsFromThread,
|
|
208
245
|
getUntrackedFilterResults,
|
|
209
246
|
getUntrackedPattern,
|
|
@@ -211,9 +248,14 @@ export {
|
|
|
211
248
|
hasFilter,
|
|
212
249
|
hasPv,
|
|
213
250
|
hasTs,
|
|
251
|
+
holdTillFirstWrite,
|
|
214
252
|
includedIn,
|
|
215
253
|
includes,
|
|
254
|
+
integratePub,
|
|
255
|
+
isEncryptedApplog,
|
|
216
256
|
isInitEvent,
|
|
257
|
+
isIpnsKeyCid,
|
|
258
|
+
isPubBlockChunks,
|
|
217
259
|
isPublication,
|
|
218
260
|
isStaticPattern,
|
|
219
261
|
isSubscription,
|
|
@@ -227,13 +269,16 @@ export {
|
|
|
227
269
|
makeCarBlob,
|
|
228
270
|
makeCarOut,
|
|
229
271
|
makeFilter,
|
|
230
|
-
|
|
272
|
+
mapQueryResultWith,
|
|
273
|
+
mapThreadWith,
|
|
231
274
|
matchPart,
|
|
232
275
|
matchPartStatic,
|
|
233
276
|
matchPattern,
|
|
234
277
|
objEqualByKeys,
|
|
235
278
|
observableArrayMap,
|
|
236
279
|
observableMapMap,
|
|
280
|
+
observableMapToObject,
|
|
281
|
+
observableSetMap,
|
|
237
282
|
prefixAt,
|
|
238
283
|
prefixAttrs,
|
|
239
284
|
prepareForPub,
|
|
@@ -245,19 +290,24 @@ export {
|
|
|
245
290
|
queryEntity,
|
|
246
291
|
queryNodesComparer,
|
|
247
292
|
queryNot,
|
|
293
|
+
querySingle,
|
|
294
|
+
querySingleAndMap,
|
|
248
295
|
queryStep,
|
|
249
296
|
removeDuplicateAppLogs,
|
|
250
297
|
resolveOrRemoveVariables,
|
|
251
298
|
rollingAcc,
|
|
252
299
|
rollingFilter,
|
|
253
300
|
rollingMapper,
|
|
301
|
+
rootsQueries,
|
|
254
302
|
simpleApplogMapper,
|
|
255
303
|
sortApplogsByTs,
|
|
256
304
|
startsWith,
|
|
257
305
|
streamReaderToIterable,
|
|
306
|
+
threadFromMaybeArray,
|
|
258
307
|
toIpnsString,
|
|
259
308
|
tryParseCID,
|
|
260
309
|
tsNearlySame,
|
|
310
|
+
unchunkApplogsBlock,
|
|
261
311
|
uniqueEnFromAppLogs,
|
|
262
312
|
variableNameWithoutQuestionmark,
|
|
263
313
|
withPvFrom,
|
package/dist/ipfs/car.d.ts
CHANGED
|
@@ -1,15 +1,55 @@
|
|
|
1
1
|
import { CarReader, CarWriter } from '@ipld/car';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { CID } from 'multiformats';
|
|
3
|
+
import { ApplogArrayMaybeEncrypted, CidString } from '../applog/datom-types';
|
|
4
|
+
export type CIDForCar = CID;
|
|
4
5
|
export type BlockForCar = Parameters<CarWriter['put']>[0];
|
|
6
|
+
export interface BlockStoreish {
|
|
7
|
+
get(cid: CID): PromiseLike<Uint8Array>;
|
|
8
|
+
}
|
|
9
|
+
export interface DecodedCar {
|
|
10
|
+
rootCID: CID;
|
|
11
|
+
blockStore: BlockStoreish;
|
|
12
|
+
}
|
|
5
13
|
/** Warning: unsorted & maybe encrypted */
|
|
6
|
-
export declare function
|
|
7
|
-
|
|
14
|
+
export declare function decodePubFromCar(car: CarReader): Promise<{
|
|
15
|
+
cid: CID<unknown, number, number, import("multiformats").Version>;
|
|
16
|
+
info: {
|
|
17
|
+
logs: {
|
|
18
|
+
cid: string;
|
|
19
|
+
pv: CidString;
|
|
20
|
+
ts: string;
|
|
21
|
+
ag: import("../applog/datom-types").AgentHash;
|
|
22
|
+
en: string;
|
|
23
|
+
at: string;
|
|
24
|
+
vl: import("../applog/datom-types").ApplogValue;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
applogsCID: CID<unknown, number, number, import("multiformats").Version>;
|
|
28
|
+
applogs: ApplogArrayMaybeEncrypted;
|
|
8
29
|
}>;
|
|
9
|
-
export declare function
|
|
10
|
-
|
|
11
|
-
|
|
30
|
+
export declare function decodePubFromBlocks({ rootCID, blockStore }: DecodedCar, recursionTrace?: CID[]): Promise<{
|
|
31
|
+
cid: CID<unknown, number, number, import("multiformats").Version>;
|
|
32
|
+
info: {
|
|
33
|
+
logs: {
|
|
34
|
+
cid: string;
|
|
35
|
+
pv: CidString;
|
|
36
|
+
ts: string;
|
|
37
|
+
ag: import("../applog/datom-types").AgentHash;
|
|
38
|
+
en: string;
|
|
39
|
+
at: string;
|
|
40
|
+
vl: import("../applog/datom-types").ApplogValue;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
applogsCID: CID<unknown, number, number, import("multiformats").Version>;
|
|
44
|
+
applogs: ApplogArrayMaybeEncrypted;
|
|
12
45
|
}>;
|
|
46
|
+
export declare function getBlocksOfCar(car: CarReader): Promise<{
|
|
47
|
+
rootCID: CID<unknown, number, number, import("multiformats").Version>;
|
|
48
|
+
blockStore: {
|
|
49
|
+
get: (cid: CID<unknown, number, number, import("multiformats").Version>) => any;
|
|
50
|
+
};
|
|
51
|
+
}>;
|
|
52
|
+
export declare function getDecodedBlock(blockStore: BlockStoreish, cid: CID): Promise<unknown>;
|
|
13
53
|
export declare function makeCarOut(roots: CIDForCar, blocks: BlockForCar[]): Promise<AsyncIterable<Uint8Array>>; /** create a new CarWriter, with the encoded block as the root */
|
|
14
54
|
export declare function makeCarBlob(roots: CIDForCar, blocks: BlockForCar[]): Promise<Blob>;
|
|
15
55
|
export declare function carFromBlob(blob: Blob | File): Promise<CarReader>;
|
package/dist/ipfs/car.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"car.d.ts","sourceRoot":"","sources":["../../src/ipfs/car.ts"],"names":[],"m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AAI,GAAG,OAAO,CAAC,SAAS,CAAC,CAEvE;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,2BAA2B,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,CAWrH"}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import * as dagJson from '@ipld/dag-json';
|
|
2
2
|
import { CID } from 'multiformats';
|
|
3
|
-
import { Applog,
|
|
3
|
+
import { Applog, ApplogEncNoCid, ApplogNoCid, ApplogOfSomeSort, CidString, IpnsString } from '../applog/datom-types';
|
|
4
4
|
export declare const MULTICODEC_IPNS_KEY = 114;
|
|
5
|
-
export declare function prepareForPub(log:
|
|
5
|
+
export declare function prepareForPub(log: ApplogOfSomeSort, without?: string[]): {
|
|
6
|
+
log: import("../applog/datom-types").ApplogEnc;
|
|
7
|
+
cid: CidString;
|
|
8
|
+
} | {
|
|
9
|
+
log: Applog;
|
|
10
|
+
cid: CidString;
|
|
11
|
+
};
|
|
6
12
|
export declare function encodeApplogAndGetCid(log: ApplogNoCid): CID<unknown, 297, 18, 1>;
|
|
7
|
-
export declare function encodeApplog(log: ApplogNoCid): {
|
|
8
|
-
bytes:
|
|
9
|
-
cid: CID
|
|
13
|
+
export declare function encodeApplog(log: ApplogNoCid | ApplogEncNoCid): {
|
|
14
|
+
bytes: dagJson.ByteView<any>;
|
|
15
|
+
cid: CID;
|
|
10
16
|
};
|
|
11
17
|
export declare function getCidSync(bytes: dagJson.ByteView<any>): CID<unknown, 297, 18, 1>;
|
|
12
18
|
/** encode the json object into an IPLD block */
|
|
13
19
|
export declare function encodeBlock(jsonObject: any): {
|
|
14
|
-
bytes:
|
|
15
|
-
cid: CID
|
|
20
|
+
bytes: dagJson.ByteView<any>;
|
|
21
|
+
cid: CID;
|
|
16
22
|
};
|
|
17
23
|
export declare function encodeBlockOriginal(jsonObject: any): Promise<import("multiformats").BlockView<unknown, 297, 18, 1>>;
|
|
18
24
|
export declare function tryParseCID(cidString: CidString): {
|
|
@@ -20,5 +26,10 @@ export declare function tryParseCID(cidString: CidString): {
|
|
|
20
26
|
errors: any[];
|
|
21
27
|
isIpns: boolean;
|
|
22
28
|
};
|
|
29
|
+
export declare function isIpnsKeyCid(cid: CID): boolean;
|
|
30
|
+
export declare function cidToString(cid: CID): string;
|
|
23
31
|
export declare function toIpnsString(cid: CID): IpnsString;
|
|
32
|
+
export declare function ensureValidCIDinstance(cidOrStringA: CID | CidString): CID<unknown, number, number, import("multiformats").Version>;
|
|
33
|
+
export declare function areCidsEqual(cidOrStringA: CID | CidString, cidOrStringB: CID | CidString): boolean;
|
|
34
|
+
export declare function containsCid(list: (CID | CidString)[] | Set<CidString>, needle: CID | CidString): boolean;
|
|
24
35
|
//# sourceMappingURL=ipfs-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ipfs-utils.d.ts","sourceRoot":"","sources":["../../src/ipfs/ipfs-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAGzC,OAAO,EAAE,GAAG,EAAoB,MAAM,cAAc,CAAA;AAGpD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"ipfs-utils.d.ts","sourceRoot":"","sources":["../../src/ipfs/ipfs-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAGzC,OAAO,EAAE,GAAG,EAAoB,MAAM,cAAc,CAAA;AAGpD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,EAAqB,MAAM,uBAAuB,CAAA;AASvI,eAAO,MAAM,mBAAmB,MAAO,CAAA;AAEvC,wBAAgB,aAAa,CAAC,GAAG,EAAE,gBAAgB,EAAE,OAAO,GAAE,MAAM,EAAY;;;;;;EAqB/E;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,WAAW,4BAErD;AACD,wBAAgB,YAAY,CAA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eCarBlob,
|
|
7
9
|
makeCarOut,
|
|
8
10
|
streamReaderToIterable
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-C75X52ZX.min.js";
|
|
12
|
+
import "./chunk-QPGEBDMJ.min.js";
|
|
13
|
+
import "./chunk-TPRWMCU7.min.js";
|
|
10
14
|
import {
|
|
11
15
|
MULTICODEC_IPNS_KEY,
|
|
16
|
+
areCidsEqual,
|
|
17
|
+
cidToString,
|
|
18
|
+
containsCid,
|
|
12
19
|
encodeApplog,
|
|
13
20
|
encodeApplogAndGetCid,
|
|
14
21
|
encodeBlock,
|
|
15
22
|
encodeBlockOriginal,
|
|
23
|
+
ensureValidCIDinstance,
|
|
16
24
|
getCidSync,
|
|
25
|
+
isIpnsKeyCid,
|
|
17
26
|
prepareForPub,
|
|
18
27
|
toIpnsString,
|
|
19
28
|
tryParseCID
|
|
20
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-UQJEOS7T.min.js";
|
|
30
|
+
import "./chunk-DF3UOPRV.min.js";
|
|
31
|
+
import "./chunk-6EBQRFQC.min.js";
|
|
21
32
|
import "./chunk-KRQZ6V4Y.min.js";
|
|
22
33
|
export {
|
|
23
34
|
MULTICODEC_IPNS_KEY,
|
|
35
|
+
areCidsEqual,
|
|
24
36
|
carFromBlob,
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
cidToString,
|
|
38
|
+
containsCid,
|
|
39
|
+
decodePubFromBlocks,
|
|
40
|
+
decodePubFromCar,
|
|
27
41
|
encodeApplog,
|
|
28
42
|
encodeApplogAndGetCid,
|
|
29
43
|
encodeBlock,
|
|
30
44
|
encodeBlockOriginal,
|
|
45
|
+
ensureValidCIDinstance,
|
|
46
|
+
getBlocksOfCar,
|
|
31
47
|
getCidSync,
|
|
48
|
+
getDecodedBlock,
|
|
49
|
+
isIpnsKeyCid,
|
|
32
50
|
makeCarBlob,
|
|
33
51
|
makeCarOut,
|
|
34
52
|
prepareForPub,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { comparer, IComputedValue, ObservableMap } from 'mobx';
|
|
1
|
+
import { comparer, IComputedValue, ObservableMap, ObservableSet } from 'mobx';
|
|
2
2
|
import { IComputedFnOptions } from 'mobx-utils/lib/computedFn';
|
|
3
|
-
import type { DatalogQueryPattern } from '../applog/datom-types';
|
|
3
|
+
import type { Applog, DatalogQueryPattern } from '../applog/datom-types';
|
|
4
4
|
import type { QueryResult } from '../query/types';
|
|
5
5
|
import type { Thread } from '../thread/basic';
|
|
6
|
-
import { ReadonlyObservableArray } from '../types/typescript-utils';
|
|
6
|
+
import { ReadonlyObservableArray, ReadonlyObservableSet } from '../types/typescript-utils';
|
|
7
|
+
export declare const rootsQueries: ObservableSet<any>;
|
|
7
8
|
export declare const createDebugName: ({ caller, thread, pattern, args }: {
|
|
8
9
|
caller?: string;
|
|
9
|
-
thread?: Thread;
|
|
10
|
+
thread?: Thread | Applog[];
|
|
10
11
|
pattern?: DatalogQueryPattern | DatalogQueryPattern[] | string;
|
|
11
12
|
args?: any;
|
|
12
13
|
}) => string;
|
|
@@ -20,11 +21,16 @@ export declare function observableArrayMap<T>(fn: () => readonly T[], { name, eq
|
|
|
20
21
|
name?: string;
|
|
21
22
|
equals?: typeof comparer.structural;
|
|
22
23
|
}): ReadonlyObservableArray<T>;
|
|
24
|
+
/** ! WARN ObservableSet doesn't have fine-grained reactivity - https://github.com/mobxjs/mobx/issues/3761 **/
|
|
25
|
+
export declare function observableSetMap<T>(fn: () => readonly T[], { name }?: {
|
|
26
|
+
name?: string;
|
|
27
|
+
}): ReadonlyObservableSet<T>;
|
|
23
28
|
export declare function observableMapMap<K, V>(fn: () => Array<readonly [K, V]>, { name, equals }?: {
|
|
24
29
|
name?: string;
|
|
25
30
|
equals?: typeof comparer.structural;
|
|
26
31
|
}): ObservableMap<K, V>;
|
|
27
|
-
export declare function autorunButAlsoImmediately<T>(fn: () => T, update
|
|
32
|
+
export declare function autorunButAlsoImmediately<T>(fn: () => T, update?: (T: any) => any, // TODO: refactor to actually remove this function too
|
|
33
|
+
{ name }?: {
|
|
28
34
|
name?: string;
|
|
29
35
|
}): () => void;
|
|
30
36
|
/**
|
|
@@ -52,18 +58,17 @@ export declare function autorunButAlsoImmediately<T>(fn: () => T, update: (T: an
|
|
|
52
58
|
*
|
|
53
59
|
* @example
|
|
54
60
|
* const store = observable({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
})
|
|
61
|
+
* a: 1,
|
|
62
|
+
* b: 2,
|
|
63
|
+
* c: 3,
|
|
64
|
+
* m: computedFnDeepCompare(function(x) {
|
|
65
|
+
* return this.a * this.b * x
|
|
66
|
+
* })
|
|
67
|
+
* })
|
|
68
|
+
* const d = autorun(() => {
|
|
69
|
+
* // store.m(3) will be cached as long as this autorun is running
|
|
70
|
+
* console.log(store.m(3) * store.c)
|
|
71
|
+
* })
|
|
67
72
|
*
|
|
68
73
|
* @param fn
|
|
69
74
|
* @param keepAliveOrOptions
|
|
@@ -72,4 +77,5 @@ export declare function computedFnDeepCompare<T extends (...args: any[]) => any>
|
|
|
72
77
|
argsDebugName?: (...args: Parameters<T>) => string;
|
|
73
78
|
}) | boolean): T;
|
|
74
79
|
export declare function prettifyThreadName(input: string): string;
|
|
80
|
+
export declare function observableMapToObject<K extends string | number | symbol, V>(mapped: ObservableMap<K, V>): Record<K, V>;
|
|
75
81
|
//# sourceMappingURL=mobx-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobx-utils.d.ts","sourceRoot":"","sources":["../../src/mobx/mobx-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,QAAQ,EAOR,cAAc,EAId,aAAa,
|
|
1
|
+
{"version":3,"file":"mobx-utils.d.ts","sourceRoot":"","sources":["../../src/mobx/mobx-utils.ts"],"names":[],"mappings":"AACA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