@fireproof/core 0.15.1 → 0.16.3
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE.md +232 -0
- package/README.md +16 -7
- package/dist/browser/fireproof.cjs +626 -21124
- package/dist/browser/fireproof.cjs.map +1 -7
- package/dist/browser/fireproof.d.cts +286 -0
- package/dist/browser/fireproof.d.ts +286 -0
- package/dist/browser/{fireproof.iife.js → fireproof.global.js} +12710 -13071
- package/dist/browser/fireproof.global.js.map +1 -0
- package/dist/browser/fireproof.js +1114 -0
- package/dist/browser/fireproof.js.map +1 -0
- package/dist/browser/metafile-cjs.json +1 -0
- package/dist/browser/metafile-esm.json +1 -0
- package/dist/browser/metafile-iife.json +1 -0
- package/dist/memory/fireproof.cjs +1143 -0
- package/dist/memory/fireproof.cjs.map +1 -0
- package/dist/memory/fireproof.d.cts +286 -0
- package/dist/memory/fireproof.d.ts +286 -0
- package/dist/memory/fireproof.global.js +21282 -0
- package/dist/memory/fireproof.global.js.map +1 -0
- package/dist/memory/fireproof.js +1114 -0
- package/dist/memory/fireproof.js.map +1 -0
- package/dist/memory/metafile-cjs.json +1 -0
- package/dist/memory/metafile-esm.json +1 -0
- package/dist/memory/metafile-iife.json +1 -0
- package/dist/node/fireproof.cjs +614 -30532
- package/dist/node/fireproof.cjs.map +1 -7
- package/dist/node/fireproof.d.cts +286 -0
- package/dist/node/fireproof.d.ts +286 -0
- package/dist/node/fireproof.global.js +21338 -0
- package/dist/node/fireproof.global.js.map +1 -0
- package/dist/node/fireproof.js +1114 -0
- package/dist/node/fireproof.js.map +1 -0
- package/dist/node/metafile-cjs.json +1 -0
- package/dist/node/metafile-esm.json +1 -0
- package/dist/node/metafile-iife.json +1 -0
- package/package.json +56 -50
- package/dist/browser/fireproof.esm.js +0 -21635
- package/dist/browser/fireproof.esm.js.map +0 -7
- package/dist/browser/fireproof.iife.js.map +0 -7
- package/dist/memory/fireproof.esm.js +0 -21349
- package/dist/memory/fireproof.esm.js.map +0 -7
- package/dist/node/fireproof.esm.js +0 -31055
- package/dist/node/fireproof.esm.js.map +0 -7
- package/dist/types/apply-head-queue.d.ts +0 -15
- package/dist/types/commit-queue.d.ts +0 -6
- package/dist/types/crdt-clock.d.ts +0 -20
- package/dist/types/crdt-helpers.d.ts +0 -19
- package/dist/types/crdt.d.ts +0 -28
- package/dist/types/crypto-ipld.d.ts +0 -20
- package/dist/types/crypto-node.d.ts +0 -4
- package/dist/types/crypto-web.d.ts +0 -4
- package/dist/types/database.d.ts +0 -48
- package/dist/types/encrypt-helpers.d.ts +0 -8
- package/dist/types/encrypted-block.d.ts +0 -44
- package/dist/types/files.d.ts +0 -12
- package/dist/types/fireproof.d.ts +0 -7
- package/dist/types/index.d.ts +0 -31
- package/dist/types/indexer-helpers.d.ts +0 -57
- package/dist/types/loader-helpers.d.ts +0 -5
- package/dist/types/loader.d.ts +0 -62
- package/dist/types/loaders.d.ts +0 -51
- package/dist/types/remote-wal.d.ts +0 -26
- package/dist/types/store-browser.d.ts +0 -24
- package/dist/types/store-fs.d.ts +0 -26
- package/dist/types/store-memory.d.ts +0 -24
- package/dist/types/store.d.ts +0 -28
- package/dist/types/transaction.d.ts +0 -50
- package/dist/types/types.d.ts +0 -170
- package/dist/types/version.d.ts +0 -1
- package/dist/types/write-queue.d.ts +0 -7
package/dist/types/types.d.ts
DELETED
@@ -1,170 +0,0 @@
|
|
1
|
-
import type { Link } from 'multiformats'
|
2
|
-
import type { EventLink } from '@alanshaw/pail/clock'
|
3
|
-
import type { EventData } from '@alanshaw/pail/crdt'
|
4
|
-
import { ClockHead, Doc } from './types'
|
5
|
-
|
6
|
-
export type FireproofOptions = {
|
7
|
-
public?: boolean
|
8
|
-
meta?: DbMeta
|
9
|
-
persistIndexes?: boolean
|
10
|
-
}
|
11
|
-
|
12
|
-
// ts-unused-exports:disable-next-line
|
13
|
-
export type ClockLink = EventLink<EventData>
|
14
|
-
|
15
|
-
export type ClockHead = ClockLink[]
|
16
|
-
|
17
|
-
export type DocFragment = Uint8Array | string | number | boolean | null | DocFragment[] | { [key: string]: DocFragment }
|
18
|
-
|
19
|
-
export type Doc = DocBody & DocBase
|
20
|
-
|
21
|
-
export type DocBase = {
|
22
|
-
_id?: string
|
23
|
-
_files?: DocFiles
|
24
|
-
_publicFiles?: DocFiles
|
25
|
-
}
|
26
|
-
|
27
|
-
export type DocFileMeta = {
|
28
|
-
type: string;
|
29
|
-
size: number;
|
30
|
-
cid: AnyLink;
|
31
|
-
car?: AnyLink;
|
32
|
-
url?: string;
|
33
|
-
file?: () => Promise<File>;
|
34
|
-
}
|
35
|
-
|
36
|
-
type DocFiles = {
|
37
|
-
[key: string]: File | DocFileMeta
|
38
|
-
}
|
39
|
-
|
40
|
-
export type FileCarHeader = {
|
41
|
-
files: AnyLink[]
|
42
|
-
}
|
43
|
-
type DocBody = {
|
44
|
-
_files?: DocFiles
|
45
|
-
_publicFiles?: DocFiles
|
46
|
-
[key: string]: DocFragment
|
47
|
-
}
|
48
|
-
|
49
|
-
type DocMeta = {
|
50
|
-
proof?: DocFragment
|
51
|
-
clock?: ClockHead
|
52
|
-
}
|
53
|
-
|
54
|
-
export type DocUpdate = {
|
55
|
-
key: string
|
56
|
-
value?: { [key: string]: any }
|
57
|
-
del?: boolean
|
58
|
-
clock?: AnyLink
|
59
|
-
}
|
60
|
-
|
61
|
-
export type DocValue = {
|
62
|
-
doc?: DocBody
|
63
|
-
del?: boolean
|
64
|
-
}
|
65
|
-
|
66
|
-
type IndexCars = {
|
67
|
-
[key: string]: AnyLink
|
68
|
-
}
|
69
|
-
|
70
|
-
export type IndexKey = [string, string] | string
|
71
|
-
|
72
|
-
export type IndexUpdate = {
|
73
|
-
key: IndexKey
|
74
|
-
value?: DocFragment
|
75
|
-
del?: boolean
|
76
|
-
}
|
77
|
-
|
78
|
-
export type IndexRow = {
|
79
|
-
id: string
|
80
|
-
key: IndexKey
|
81
|
-
row?: DocFragment
|
82
|
-
doc?: Doc | null
|
83
|
-
value?: DocFragment
|
84
|
-
del?: boolean
|
85
|
-
}
|
86
|
-
|
87
|
-
type CarCommit = {
|
88
|
-
car?: AnyLink
|
89
|
-
}
|
90
|
-
|
91
|
-
export type BulkResult = {
|
92
|
-
head: ClockHead
|
93
|
-
}
|
94
|
-
|
95
|
-
export type FileResult = {
|
96
|
-
files: { [key: string]: DocFileMeta }
|
97
|
-
}
|
98
|
-
|
99
|
-
export type IdxMeta = {
|
100
|
-
byId: AnyLink
|
101
|
-
byKey: AnyLink
|
102
|
-
map: string
|
103
|
-
name: string
|
104
|
-
head: ClockHead
|
105
|
-
}
|
106
|
-
|
107
|
-
export type IdxMetaMap = {
|
108
|
-
indexes: Map<string, IdxMeta>
|
109
|
-
}
|
110
|
-
|
111
|
-
type CarHeader = {
|
112
|
-
cars: AnyLink[]
|
113
|
-
compact: AnyLink[]
|
114
|
-
}
|
115
|
-
|
116
|
-
export type IdxCarHeader = CarHeader & IdxMetaMap
|
117
|
-
|
118
|
-
export type DbCarHeader = CarHeader & {
|
119
|
-
head: ClockHead
|
120
|
-
}
|
121
|
-
|
122
|
-
export type AnyCarHeader = DbCarHeader | IdxCarHeader | FileCarHeader
|
123
|
-
|
124
|
-
export type CarLoaderHeader = DbCarHeader | IdxCarHeader
|
125
|
-
|
126
|
-
export type QueryOpts = {
|
127
|
-
descending?: boolean
|
128
|
-
limit?: number
|
129
|
-
includeDocs?: boolean
|
130
|
-
range?: [IndexKey, IndexKey]
|
131
|
-
key?: DocFragment,
|
132
|
-
keys?: DocFragment[]
|
133
|
-
prefix?: DocFragment | [DocFragment]
|
134
|
-
}
|
135
|
-
|
136
|
-
export type AnyLink = Link<unknown, number, number, 1 | 0>
|
137
|
-
export type AnyBlock = { cid: AnyLink; bytes: Uint8Array }
|
138
|
-
export type AnyDecodedBlock = { cid: AnyLink; bytes: Uint8Array, value: any }
|
139
|
-
|
140
|
-
export type BlockFetcher = { get: (link: AnyLink) => Promise<AnyBlock | undefined> }
|
141
|
-
|
142
|
-
type CallbackFn = (k: DocFragment, v?: DocFragment) => void
|
143
|
-
|
144
|
-
export type MapFn = (doc: Doc, map: CallbackFn) => DocFragment | void
|
145
|
-
|
146
|
-
export type DbMeta = { car: AnyLink, key: string | null }
|
147
|
-
|
148
|
-
export type CommitOpts = { noLoader?: boolean, compact?: boolean, public?: boolean }
|
149
|
-
|
150
|
-
export interface CarMakeable {
|
151
|
-
entries(): Iterable<AnyBlock>
|
152
|
-
get(cid: AnyLink): Promise<AnyBlock | undefined>
|
153
|
-
}
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
export type ChangesOptions = {
|
158
|
-
dirty?: boolean
|
159
|
-
limit?: number
|
160
|
-
}
|
161
|
-
|
162
|
-
export type ChangesResponse = {
|
163
|
-
clock: ClockHead
|
164
|
-
rows: { key: string; value: Doc }[]
|
165
|
-
}
|
166
|
-
|
167
|
-
export type DbResponse = {
|
168
|
-
id: string
|
169
|
-
clock: ClockHead
|
170
|
-
}
|
package/dist/types/version.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const PACKAGE_VERSION = "0.15.1";
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { BulkResult, DocUpdate } from './types';
|
2
|
-
type WorkerFunction = (tasks: DocUpdate[]) => Promise<BulkResult>;
|
3
|
-
export type WriteQueue = {
|
4
|
-
push(task: DocUpdate): Promise<BulkResult>;
|
5
|
-
};
|
6
|
-
export declare function writeQueue(worker: WorkerFunction, payload?: number, unbounded?: boolean): WriteQueue;
|
7
|
-
export {};
|