@comapeo/core 2.3.1 → 3.0.0-0
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/blob-store/entries-stream.d.ts.map +1 -1
- package/dist/blob-store/index.d.ts +27 -15
- package/dist/blob-store/index.d.ts.map +1 -1
- package/dist/blob-store/live-download.d.ts +107 -0
- package/dist/blob-store/live-download.d.ts.map +1 -0
- package/dist/capabilities.d.ts +121 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/core-manager/compat.d.ts +4 -0
- package/dist/core-manager/compat.d.ts.map +1 -0
- package/dist/core-manager/index.d.ts +4 -4
- package/dist/core-manager/index.d.ts.map +1 -1
- package/dist/discovery/dns-sd.d.ts +54 -0
- package/dist/discovery/dns-sd.d.ts.map +1 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/fastify-plugins/maps/index.d.ts +11 -0
- package/dist/fastify-plugins/maps/index.d.ts.map +1 -0
- package/dist/fastify-plugins/maps/offline-fallback-map.d.ts +12 -0
- package/dist/fastify-plugins/maps/offline-fallback-map.d.ts.map +1 -0
- package/dist/fastify-plugins/maps/static-maps.d.ts +11 -0
- package/dist/fastify-plugins/maps/static-maps.d.ts.map +1 -0
- package/dist/generated/extensions.d.ts +7 -0
- package/dist/generated/extensions.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/invite/invite-api.d.ts +112 -0
- package/dist/invite/invite-api.d.ts.map +1 -0
- package/dist/invite/invite-state-machine.d.ts +510 -0
- package/dist/invite/invite-state-machine.d.ts.map +1 -0
- package/dist/lib/timing-safe-equal.d.ts +15 -0
- package/dist/lib/timing-safe-equal.d.ts.map +1 -0
- package/dist/local-peers.d.ts.map +1 -1
- package/dist/mapeo-manager.d.ts +1 -1
- package/dist/mapeo-manager.d.ts.map +1 -1
- package/dist/mapeo-project.d.ts.map +1 -1
- package/dist/media-server.d.ts +36 -0
- package/dist/media-server.d.ts.map +1 -0
- package/dist/member-api.d.ts.map +1 -1
- package/dist/server/ws-core-replicator.d.ts +6 -0
- package/dist/server/ws-core-replicator.d.ts.map +1 -0
- package/dist/sync/core-sync-state.d.ts +14 -6
- package/dist/sync/core-sync-state.d.ts.map +1 -1
- package/dist/sync/namespace-sync-state.d.ts +3 -13
- package/dist/sync/namespace-sync-state.d.ts.map +1 -1
- package/dist/sync/sync-api.d.ts +17 -25
- package/dist/sync/sync-api.d.ts.map +1 -1
- package/dist/sync/sync-state.d.ts +3 -13
- package/dist/sync/sync-state.d.ts.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/package.json +5 -3
- package/src/blob-store/entries-stream.js +43 -18
- package/src/blob-store/index.js +161 -19
- package/src/core-manager/index.js +14 -7
- package/src/errors.js +33 -0
- package/src/generated/extensions.d.ts +7 -0
- package/src/generated/extensions.js +12 -2
- package/src/generated/extensions.ts +19 -1
- package/src/invite/StateDiagram.md +47 -0
- package/src/invite/invite-api.js +387 -0
- package/src/invite/invite-state-machine.js +208 -0
- package/src/local-peers.js +12 -9
- package/src/mapeo-manager.js +1 -1
- package/src/mapeo-project.js +7 -76
- package/src/member-api.js +5 -4
- package/src/sync/core-sync-state.js +41 -14
- package/src/sync/namespace-sync-state.js +25 -22
- package/src/sync/sync-api.js +12 -43
- package/src/sync/sync-state.js +9 -19
- package/src/types.ts +7 -1
- package/src/utils.js +8 -3
- package/src/invite-api.js +0 -450
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entries-stream.d.ts","sourceRoot":"","sources":["../../src/blob-store/entries-stream.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entries-stream.d.ts","sourceRoot":"","sources":["../../src/blob-store/entries-stream.js"],"names":[],"mappings":"AAYA;;;;;;GAMG;AACH,gDALW,gBAAgB,aAExB;IAAuB,IAAI;CAC3B,GAAU,sBAAsB,CAiBlC;sCA1BqC,uBAAuB;4CADjB,aAAa"}
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
/** @extends {TypedEmitter<
|
|
2
|
-
export class BlobStore extends TypedEmitter<{
|
|
3
|
-
error: (error: Error) => void;
|
|
4
|
-
}> {
|
|
1
|
+
/** @extends {TypedEmitter<BlobStoreEvents>} */
|
|
2
|
+
export class BlobStore extends TypedEmitter<BlobStoreEvents> {
|
|
5
3
|
/**
|
|
6
4
|
* @param {object} options
|
|
7
5
|
* @param {import('../core-manager/index.js').CoreManager} options.coreManager
|
|
8
|
-
* @param {
|
|
6
|
+
* @param {boolean} [options.isArchiveDevice] Set to `true` if this is an archive device which should download all blobs, or just a selection of blobs
|
|
7
|
+
* @param {import('../logger.js').Logger} [options.logger]
|
|
9
8
|
*/
|
|
10
|
-
constructor({ coreManager,
|
|
9
|
+
constructor({ coreManager, isArchiveDevice, logger }: {
|
|
11
10
|
coreManager: import("../core-manager/index.js").CoreManager;
|
|
12
|
-
|
|
11
|
+
isArchiveDevice?: boolean | undefined;
|
|
12
|
+
logger?: Logger | undefined;
|
|
13
13
|
});
|
|
14
14
|
/**
|
|
15
15
|
* @returns {string}
|
|
16
16
|
*/
|
|
17
17
|
get writerDriveId(): string;
|
|
18
|
+
get isArchiveDevice(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @param {string} peerId
|
|
21
|
+
* @returns {GenericBlobFilter | null}
|
|
22
|
+
*/
|
|
23
|
+
getBlobFilter(peerId: string): GenericBlobFilter | null;
|
|
24
|
+
/** @param {boolean} isArchiveDevice */
|
|
25
|
+
setIsArchiveDevice(isArchiveDevice: boolean): Promise<void>;
|
|
18
26
|
/**
|
|
19
27
|
* @param {BlobId} blobId
|
|
20
28
|
* @param {object} opts
|
|
@@ -26,13 +34,6 @@ export class BlobStore extends TypedEmitter<{
|
|
|
26
34
|
wait?: false | undefined;
|
|
27
35
|
timeout?: undefined;
|
|
28
36
|
}): Promise<Uint8Array>;
|
|
29
|
-
/**
|
|
30
|
-
* Set the filter for downloading blobs.
|
|
31
|
-
*
|
|
32
|
-
* @param {import('../types.js').BlobFilter | null} filter Filter blob types and/or variants to download. Filter is { [BlobType]: BlobVariants[] }. At least one blob variant must be specified for each blob type.
|
|
33
|
-
* @returns {void}
|
|
34
|
-
*/
|
|
35
|
-
setDownloadFilter(filter: import("../types.js").BlobFilter | null): void;
|
|
36
37
|
/**
|
|
37
38
|
* @param {BlobId} blobId
|
|
38
39
|
* @param {object} [options]
|
|
@@ -128,6 +129,16 @@ export class BlobStore extends TypedEmitter<{
|
|
|
128
129
|
close(): void;
|
|
129
130
|
#private;
|
|
130
131
|
}
|
|
132
|
+
export type BlobStoreEvents = {
|
|
133
|
+
"blob-filter": (peerId: string, blobFilter: GenericBlobFilter | null) => void;
|
|
134
|
+
"want-blob-range": (opts: {
|
|
135
|
+
peerId: string;
|
|
136
|
+
start: number;
|
|
137
|
+
length: number;
|
|
138
|
+
blobCoreId: string;
|
|
139
|
+
}) => void;
|
|
140
|
+
error: (error: Error) => void;
|
|
141
|
+
};
|
|
131
142
|
export type Readable = NodeReadable | StreamxReadable;
|
|
132
143
|
export namespace SUPPORTED_BLOB_VARIANTS {
|
|
133
144
|
let photo: readonly ["original", "preview", "thumbnail"];
|
|
@@ -135,11 +146,12 @@ export namespace SUPPORTED_BLOB_VARIANTS {
|
|
|
135
146
|
let video: readonly ["original"];
|
|
136
147
|
}
|
|
137
148
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
149
|
+
import type { GenericBlobFilter } from '../types.js';
|
|
138
150
|
import type { BlobId } from '../types.js';
|
|
139
151
|
import type { BlobStoreEntriesStream } from '../types.js';
|
|
140
152
|
import type { JsonObject } from 'type-fest';
|
|
141
153
|
import type { Writable } from 'streamx';
|
|
142
|
-
import
|
|
154
|
+
import { Logger } from '../logger.js';
|
|
143
155
|
import type { Readable as NodeReadable } from 'node:stream';
|
|
144
156
|
import type { Readable as StreamxReadable } from 'streamx';
|
|
145
157
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blob-store/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blob-store/index.js"],"names":[],"mappings":"AA6DA,+CAA+C;AAC/C;IAoFE;;;;;OAKG;IACH,sDAJG;QAAgE,WAAW,EAAnE,OAAO,0BAA0B,EAAE,WAAW;QAC5B,eAAe;QACO,MAAM;KAAC,EAsBzD;IAED;;OAEG;IACH,4BAEC;IAED,+BAEC;IAED;;;OAGG;IACH,sBAHW,MAAM,GACJ,iBAAiB,GAAG,IAAI,CAIpC;IAED,uCAAuC;IACvC,oCADY,OAAO,iBAkBlB;IAYD;;;;;;OAMG;IACH,sCANW,MAAM,sBAEd;QAAqB,IAAI;QACJ,OAAO;KAC5B,GAAU,OAAO,CAAC,UAAU,CAAC,CAQ/B;IAED;;;;;;OAMG;IACH,mDANW,MAAM;;;oBAIJ,QAAQ,CAYpB;IAED;;;;;;;;OAQG;IACH,2CAJG;QAAuB,IAAI;QACkC,MAAM;KACnE,GAAU,sBAAsB,CAOlC;IAED;;;;;;;;OAQG;IACH,mCANW,MAAM,CAAC,SAAS,CAAC,SACjB,OAAO,YAAY,EAAE,eAAe;;oBAGlC,OAAO,CAAC,QAAQ,CAAC,CAa7B;IAED;;;;;;OAMG;IACH,sBANW,MAAM,CAAC,SAAS,CAAC,SACjB,OAAO,YAAY,EAAE,eAAe;;oBAGlC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAalC;IAED;;;;;;;OAOG;IACH,6BANW,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,QACvB,MAAM;;oBAGJ,OAAO,CAAC,MAAM,CAAC,CAM3B;IAED;;;;;OAKG;IACH,2CALW,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC;;oBAGrB,QAAQ,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAQ1C;IAED;;;;;;;OAOG;IACH,wCAPW,MAAM;;;;oBAKJ,OAAO,CAAC,OAAO,YAAY,EAAE,eAAe,GAAG,IAAI,CAAC,CAWhE;IAED;;;;;OAKG;IACH,wCALW,MAAM;;oBAGL,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAO7C;IAED,cAMC;;CACF;;mBA3WS,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI;uBAC9D,CAAC,IAAI,EAAE;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;QACd,UAAU,EAAE,MAAM,CAAA;KACnB,KAAK,IAAI;WACH,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;;uBAKnB,YAAY,GAAG,eAAe;;;;;;6BAzBd,oBAAoB;uCASkC,aAAa;4BAAb,aAAa;4CAAb,aAAa;gCAHhE,WAAW;8BAEgB,SAAS;uBAN7C,cAAc;8CAKS,aAAa;iDACA,SAAS"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reduce multiple states into one. Factored out for unit testing because I
|
|
3
|
+
* don't trust my coding. Probably a smarter way to do this, but this works.
|
|
4
|
+
*
|
|
5
|
+
* @param {Iterable<{ state: BlobDownloadState | BlobDownloadStateError }>} liveDownloads
|
|
6
|
+
* @param {{ signal?: AbortSignal }} options
|
|
7
|
+
* @returns {BlobDownloadState | BlobDownloadStateError}
|
|
8
|
+
*/
|
|
9
|
+
export function combineStates(liveDownloads: Iterable<{
|
|
10
|
+
state: BlobDownloadState | BlobDownloadStateError;
|
|
11
|
+
}>, { signal }?: {
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
}): BlobDownloadState | BlobDownloadStateError;
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {object} BlobDownloadState
|
|
16
|
+
* @property {number} haveCount The number of files already downloaded
|
|
17
|
+
* @property {number} haveBytes The bytes already downloaded
|
|
18
|
+
* @property {number} wantCount The number of files pending download
|
|
19
|
+
* @property {number} wantBytes The bytes pending download
|
|
20
|
+
* @property {null} error If status = 'error' then this will be an Error object
|
|
21
|
+
* @property {'checking' | 'downloading' | 'downloaded' | 'aborted'} status
|
|
22
|
+
*/
|
|
23
|
+
/** @typedef {Omit<BlobDownloadState, 'error' | 'status'> & { status: 'error', error: Error }} BlobDownloadStateError */
|
|
24
|
+
/**
|
|
25
|
+
* @typedef {object} BlobDownloadEvents
|
|
26
|
+
* @property {(state: BlobDownloadState | BlobDownloadStateError ) => void} state Emitted with the current download state whenever it changes (not emitted during initial 'checking' status)
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* LiveDownload class
|
|
30
|
+
* @extends {TypedEmitter<BlobDownloadEvents>}
|
|
31
|
+
*/
|
|
32
|
+
export class LiveDownload extends TypedEmitter<BlobDownloadEvents> {
|
|
33
|
+
/**
|
|
34
|
+
* Like drive.download() but 'live', and for multiple drives
|
|
35
|
+
* @param {Iterable<import('hyperdrive')>} drives
|
|
36
|
+
* @param {import('./index.js').InternalDriveEmitter} emitter
|
|
37
|
+
* @param {object} options
|
|
38
|
+
* @param {import('../types.js').BlobFilter} [options.filter] Filter blobs of specific types and/or sizes to download
|
|
39
|
+
* @param {AbortSignal} [options.signal]
|
|
40
|
+
*/
|
|
41
|
+
constructor(drives: Iterable<import("hyperdrive")>, emitter: import("./index.js").InternalDriveEmitter, { filter, signal }: {
|
|
42
|
+
filter?: import("../types.js").BlobFilter | undefined;
|
|
43
|
+
signal?: AbortSignal | undefined;
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* @returns {BlobDownloadState | BlobDownloadStateError}
|
|
47
|
+
*/
|
|
48
|
+
get state(): BlobDownloadState | BlobDownloadStateError;
|
|
49
|
+
#private;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* LiveDownload class
|
|
53
|
+
* @extends {TypedEmitter<BlobDownloadEvents>}
|
|
54
|
+
*/
|
|
55
|
+
export class DriveLiveDownload extends TypedEmitter<BlobDownloadEvents> {
|
|
56
|
+
/**
|
|
57
|
+
* Like drive.download() but 'live',
|
|
58
|
+
* @param {import('hyperdrive')} drive
|
|
59
|
+
* @param {object} options
|
|
60
|
+
* @param {import('../types.js').BlobFilter} [options.filter] Filter blobs of specific types and/or sizes to download
|
|
61
|
+
* @param {AbortSignal} [options.signal]
|
|
62
|
+
*/
|
|
63
|
+
constructor(drive: import("hyperdrive"), { filter, signal }?: {
|
|
64
|
+
filter?: import("../types.js").BlobFilter | undefined;
|
|
65
|
+
signal?: AbortSignal | undefined;
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* @returns {BlobDownloadState | BlobDownloadStateError}
|
|
69
|
+
*/
|
|
70
|
+
get state(): BlobDownloadState | BlobDownloadStateError;
|
|
71
|
+
#private;
|
|
72
|
+
}
|
|
73
|
+
export type BlobDownloadState = {
|
|
74
|
+
/**
|
|
75
|
+
* The number of files already downloaded
|
|
76
|
+
*/
|
|
77
|
+
haveCount: number;
|
|
78
|
+
/**
|
|
79
|
+
* The bytes already downloaded
|
|
80
|
+
*/
|
|
81
|
+
haveBytes: number;
|
|
82
|
+
/**
|
|
83
|
+
* The number of files pending download
|
|
84
|
+
*/
|
|
85
|
+
wantCount: number;
|
|
86
|
+
/**
|
|
87
|
+
* The bytes pending download
|
|
88
|
+
*/
|
|
89
|
+
wantBytes: number;
|
|
90
|
+
/**
|
|
91
|
+
* If status = 'error' then this will be an Error object
|
|
92
|
+
*/
|
|
93
|
+
error: null;
|
|
94
|
+
status: "checking" | "downloading" | "downloaded" | "aborted";
|
|
95
|
+
};
|
|
96
|
+
export type BlobDownloadStateError = Omit<BlobDownloadState, "error" | "status"> & {
|
|
97
|
+
status: "error";
|
|
98
|
+
error: Error;
|
|
99
|
+
};
|
|
100
|
+
export type BlobDownloadEvents = {
|
|
101
|
+
/**
|
|
102
|
+
* Emitted with the current download state whenever it changes (not emitted during initial 'checking' status)
|
|
103
|
+
*/
|
|
104
|
+
state: (state: BlobDownloadState | BlobDownloadStateError) => void;
|
|
105
|
+
};
|
|
106
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
107
|
+
//# sourceMappingURL=live-download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-download.d.ts","sourceRoot":"","sources":["../../src/blob-store/live-download.js"],"names":[],"mappings":"AA+RA;;;;;;;GAOG;AACH,6CAJW,QAAQ,CAAC;IAAE,KAAK,EAAE,iBAAiB,GAAG,sBAAsB,CAAA;CAAE,CAAC,eAC/D;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GACtB,iBAAiB,GAAG,sBAAsB,CAqCtD;AApUD;;;;;;;;GAQG;AAEH,wHAAwH;AAExH;;;GAGG;AAEH;;;GAGG;AACH;IAKE;;;;;;;OAOG;IACH,oBANW,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC,WAC9B,OAAO,YAAY,EAAE,oBAAoB,sBAEjD;QAAmD,MAAM;QAC3B,MAAM;KAAC,EAiCvC;IAED;;OAEG;IACH,wDAEC;;CACF;AAED;;;GAGG;AACH;IAaE;;;;;;OAMG;IACH,mBALW,OAAO,YAAY,CAAC,uBAE5B;QAAmD,MAAM;QAC3B,MAAM;KAAC,EAmBvC;IAED;;OAEG;IACH,wDAyBC;;CAqIF;;;;;eArRa,MAAM;;;;eACN,MAAM;;;;eACN,MAAM;;;;eACN,MAAM;;;;WACN,IAAI;YACJ,UAAU,GAAG,aAAa,GAAG,YAAY,GAAG,SAAS;;qCAGrD,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,QAAQ,CAAC,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE;;;;;WAI/E,CAAC,KAAK,EAAE,iBAAiB,GAAG,sBAAsB,KAAM,IAAI;;6BApB7C,oBAAoB"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export const COORDINATOR_ROLE_ID: "f7c150f5a3a9a855";
|
|
2
|
+
export const MEMBER_ROLE_ID: "012fd2d431c0bf60";
|
|
3
|
+
export const BLOCKED_ROLE_ID: "9e6d29263cba36c9";
|
|
4
|
+
export const LEFT_ROLE_ID: "8ced989b1904606b";
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {object} DocCapability
|
|
7
|
+
* @property {boolean} readOwn - can read own data
|
|
8
|
+
* @property {boolean} writeOwn - can write own data
|
|
9
|
+
* @property {boolean} readOthers - can read other's data
|
|
10
|
+
* @property {boolean} writeOthers - can edit or delete other's data
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {object} Capability
|
|
14
|
+
* @property {string} name
|
|
15
|
+
* @property {Record<import('@mapeo/schema').MapeoDoc['schemaName'], DocCapability>} docs
|
|
16
|
+
* @property {RoleId[]} roleAssignment
|
|
17
|
+
* @property {Record<import('./core-manager/core-index.js').Namespace, 'allowed' | 'blocked'>} sync
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {typeof COORDINATOR_ROLE_ID | typeof MEMBER_ROLE_ID | typeof BLOCKED_ROLE_ID | typeof LEFT_ROLE_ID} RoleId
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* This is currently the same as 'Coordinator' capabilities, but defined
|
|
24
|
+
* separately because the creator should always have ALL capabilities, but we
|
|
25
|
+
* could edit 'Coordinator' capabilities in the future
|
|
26
|
+
*
|
|
27
|
+
* @type {Capability}
|
|
28
|
+
*/
|
|
29
|
+
export const CREATOR_CAPABILITIES: Capability;
|
|
30
|
+
/**
|
|
31
|
+
* These are the capabilities assumed for a device when no capability record can
|
|
32
|
+
* be found. This can happen when an invited device did not manage to sync with
|
|
33
|
+
* the device that invited them, and they then try to sync with someone else. We
|
|
34
|
+
* want them to be able to sync the auth and config store, because that way they
|
|
35
|
+
* may be able to receive their role record, and they can get the project config
|
|
36
|
+
* so that they can start collecting data.
|
|
37
|
+
*
|
|
38
|
+
* @type {Capability}
|
|
39
|
+
*/
|
|
40
|
+
export const NO_ROLE_CAPABILITIES: Capability;
|
|
41
|
+
/** @type {Record<RoleId, Capability>} */
|
|
42
|
+
export const DEFAULT_CAPABILITIES: Record<RoleId, Capability>;
|
|
43
|
+
export class Capabilities {
|
|
44
|
+
static NO_ROLE_CAPABILITIES: Capability;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @param {object} opts
|
|
48
|
+
* @param {import('./datatype/index.js').DataType<
|
|
49
|
+
* import('./datastore/index.js').DataStore<'auth'>,
|
|
50
|
+
* typeof import('./schema/project.js').roleTable,
|
|
51
|
+
* 'role',
|
|
52
|
+
* import('@mapeo/schema').Role,
|
|
53
|
+
* import('@mapeo/schema').RoleValue
|
|
54
|
+
* >} opts.dataType
|
|
55
|
+
* @param {import('./core-ownership.js').CoreOwnership} opts.coreOwnership
|
|
56
|
+
* @param {import('./core-manager/index.js').CoreManager} opts.coreManager
|
|
57
|
+
* @param {Buffer} opts.projectKey
|
|
58
|
+
* @param {Buffer} opts.deviceKey public key of this device
|
|
59
|
+
*/
|
|
60
|
+
constructor({ dataType, coreOwnership, coreManager, projectKey, deviceKey }: {
|
|
61
|
+
dataType: import('./datatype/index.js').DataType<import('./datastore/index.js').DataStore<'auth'>, typeof import('./schema/project.js').roleTable, 'role', import('@mapeo/schema').Role, import('@mapeo/schema').RoleValue>;
|
|
62
|
+
coreOwnership: import('./core-ownership.js').CoreOwnership;
|
|
63
|
+
coreManager: import('./core-manager/index.js').CoreManager;
|
|
64
|
+
projectKey: Buffer;
|
|
65
|
+
deviceKey: Buffer;
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Get the capabilities for device `deviceId`.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} deviceId
|
|
71
|
+
* @returns {Promise<Capability>}
|
|
72
|
+
*/
|
|
73
|
+
getCapabilities(deviceId: string): Promise<Capability>;
|
|
74
|
+
/**
|
|
75
|
+
* Get capabilities of all devices in the project. For your own device, if you
|
|
76
|
+
* have not yet synced your own role record, the "no role" capabilties is
|
|
77
|
+
* returned. The project creator will have `CREATOR_CAPABILITIES` unless a
|
|
78
|
+
* different role has been assigned.
|
|
79
|
+
*
|
|
80
|
+
* @returns {Promise<Record<string, Capability>>} Map of deviceId to Capability
|
|
81
|
+
*/
|
|
82
|
+
getAll(): Promise<Record<string, Capability>>;
|
|
83
|
+
/**
|
|
84
|
+
* Assign a role to the specified `deviceId`. Devices without an assigned role
|
|
85
|
+
* are unable to sync, except the project creator that defaults to having all
|
|
86
|
+
* capabilities. Only the project creator can assign their own role. Will
|
|
87
|
+
* throw if the device trying to assign the role lacks the `roleAssignment`
|
|
88
|
+
* capability for the given roleId
|
|
89
|
+
*
|
|
90
|
+
* @param {string} deviceId
|
|
91
|
+
* @param {keyof typeof DEFAULT_CAPABILITIES} roleId
|
|
92
|
+
*/
|
|
93
|
+
assignRole(deviceId: string, roleId: keyof typeof DEFAULT_CAPABILITIES): Promise<void>;
|
|
94
|
+
#private;
|
|
95
|
+
}
|
|
96
|
+
export type DocCapability = {
|
|
97
|
+
/**
|
|
98
|
+
* - can read own data
|
|
99
|
+
*/
|
|
100
|
+
readOwn: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* - can write own data
|
|
103
|
+
*/
|
|
104
|
+
writeOwn: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* - can read other's data
|
|
107
|
+
*/
|
|
108
|
+
readOthers: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* - can edit or delete other's data
|
|
111
|
+
*/
|
|
112
|
+
writeOthers: boolean;
|
|
113
|
+
};
|
|
114
|
+
export type Capability = {
|
|
115
|
+
name: string;
|
|
116
|
+
docs: Record<import('@mapeo/schema').MapeoDoc['schemaName'], DocCapability>;
|
|
117
|
+
roleAssignment: RoleId[];
|
|
118
|
+
sync: Record<import('./core-manager/core-index.js').Namespace, 'allowed' | 'blocked'>;
|
|
119
|
+
};
|
|
120
|
+
export type RoleId = typeof COORDINATOR_ROLE_ID | typeof MEMBER_ROLE_ID | typeof BLOCKED_ROLE_ID | typeof LEFT_ROLE_ID;
|
|
121
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.js"],"names":[],"mappings":"AAKA,qDAAqD;AACrD,gDAAgD;AAChD,iDAAiD;AACjD,8CAA8C;AAE9C;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;GAEG;AAEH;;;;;;GAMG;AACH,mCAFU,UAAU,CAkBnB;AAED;;;;;;;;;GASG;AACH,mCAFU,UAAU,CAkBnB;AAED,yCAAyC;AACzC,mCADW,OAAO,MAAM,EAAE,UAAU,CAAC,CAgFpC;AAED;IAOE,wCAAkD;IAElD;;;;;;;;;;;;;;OAcG;IACH;QANW,QAAQ,EANR,OAAO,qBAAqB,EAAE,QAAQ,CAChD,OAAW,sBAAsB,EAAE,SAAS,CAAC,MAAM,CAAC,EACpD,cAAkB,qBAAqB,EAAE,SAAS,EAClD,MAAU,EACV,OAAW,eAAe,EAAE,IAAI,EAChC,OAAW,eAAe,EAAE,SAAS,CAClC;QACyD,aAAa,EAA/D,OAAO,qBAAqB,EAAE,aAAa;QACS,WAAW,EAA/D,OAAO,yBAAyB,EAAE,WAAW;QAChC,UAAU,EAAvB,MAAM;QACO,SAAS,EAAtB,MAAM;OAQhB;IAED;;;;;OAKG;IACH,0BAHW,MAAM,GACJ,QAAQ,UAAU,CAAC,CAuB/B;IAED;;;;;;;OAOG;IACH,UAFa,QAAQ,OAAO,MAAM,EAAE,UAAU,CAAC,CAAC,CAkC/C;IAED;;;;;;;;;OASG;IACH,qBAHW,MAAM,UACN,MAAM,2BAA2B,iBAyD3C;;CAQF;;;;;aAzUa,OAAO;;;;cACP,OAAO;;;;gBACP,OAAO;;;;iBACP,OAAO;;;UAKP,MAAM;UACN,OAAO,OAAO,eAAe,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC;oBACrE,MAAM,EAAE;UACR,OAAO,OAAO,8BAA8B,EAAE,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;;qBAIhF,0BAA0B,GAAG,qBAAqB,GAAG,sBAAsB,GAAG,mBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../../src/core-manager/compat.js"],"names":[],"mappings":";AAOA,sCAAwB"}
|
|
@@ -5,7 +5,7 @@ export const kCoreManagerReplicate: unique symbol;
|
|
|
5
5
|
* @typedef {Object} Events
|
|
6
6
|
* @property {(coreRecord: CoreRecord) => void} add-core
|
|
7
7
|
* @property {(namespace: Namespace, msg: { coreDiscoveryId: string, peerId: string, start: number, bitfield: Uint32Array }) => void} peer-have
|
|
8
|
-
* @property {(blobFilter: GenericBlobFilter, peerId: string) => void} peer-download-intent
|
|
8
|
+
* @property {(blobFilter: GenericBlobFilter | null, peerId: string) => void} peer-download-intent
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
11
|
* @extends {TypedEmitter<Events>}
|
|
@@ -82,10 +82,10 @@ export class CoreManager extends TypedEmitter<Events> {
|
|
|
82
82
|
*/
|
|
83
83
|
addCore(key: Buffer, namespace: Namespace): CoreRecord;
|
|
84
84
|
/**
|
|
85
|
-
* @param {BlobFilter} blobFilter
|
|
85
|
+
* @param {BlobFilter | null} blobFilter
|
|
86
86
|
* @param {HypercorePeer} peer
|
|
87
87
|
*/
|
|
88
|
-
sendDownloadIntents(blobFilter: BlobFilter, peer: HypercorePeer): void;
|
|
88
|
+
sendDownloadIntents(blobFilter: BlobFilter | null, peer: HypercorePeer): void;
|
|
89
89
|
/**
|
|
90
90
|
* @param {Exclude<Namespace, 'auth'>} namespace
|
|
91
91
|
* @returns {Promise<void>}
|
|
@@ -117,7 +117,7 @@ export type Events = {
|
|
|
117
117
|
start: number;
|
|
118
118
|
bitfield: Uint32Array;
|
|
119
119
|
}) => void;
|
|
120
|
-
"peer-download-intent": (blobFilter: GenericBlobFilter, peerId: string) => void;
|
|
120
|
+
"peer-download-intent": (blobFilter: GenericBlobFilter | null, peerId: string) => void;
|
|
121
121
|
};
|
|
122
122
|
export type HaveMsg = {
|
|
123
123
|
discoveryKey: Buffer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core-manager/index.js"],"names":[],"mappings":"AAwBA,kDAAqE;AAErE,kDAAkD;AAClD,8EAA8E;AAC9E;;;;;GAKG;AAEH;;GAEG;AACH;IAiBE,kFAEC;IAED;;;;;;;;;;OAUG;IACH,8GATG;QAA4E,EAAE,EAAtE,OAAO,4BAA4B,EAAE,qBAAqB;QACd,UAAU,EAAtD,2CAAkC;QAClB,UAAU,EAA1B,MAAM;QACW,gBAAgB;QACY,cAAc;QACb,OAAO,EAArD,OAAO,WAAW,EAAE,gBAAgB;QAClB,YAAY;QACb,MAAM;KAAC,EAyHlC;IAED,uBAEC;IAED,wBAEC;IAED,oCAEC;IAED;;;;OAIG;IACH,SAFa,OAAO,CAAC,IAAI,CAAC,CAIzB;IAED;;;;OAIG;IACH,yBAFW,SAAS,cAInB;IAED;;;;OAIG;IACH,oBAFW,SAAS,gBAInB;IAED;;;;;OAKG;IACH,kBAHW,MAAM,GACJ,IAAI,GAAG,SAAS,CAK5B;IAED;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,UAAU,GAAG,SAAS,CAOlC;IAED;;;OAGG;IACH,uBAQC;IAED;;;;;;OAMG;IACH,aAJW,MAAM,aACN,SAAS,GACP,UAAU,CAItB;IAiJD;;;OAGG;IACH,gCAHW,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core-manager/index.js"],"names":[],"mappings":"AAwBA,kDAAqE;AAErE,kDAAkD;AAClD,8EAA8E;AAC9E;;;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AM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI;4BACtH,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI;;;kBAmd9D,MAAM;WACN,MAAM;cACN,WAAW;eACX,SAAS;;6BAtfM,oBAAoB;+BAoB4B,aAAa;gCAAb,aAAa;mCAAb,aAAa;sBAnBpE,WAAW;uBAUV,cAAc;2BAQV,WAAW;uCACuC,aAAa"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {object} MapeoService
|
|
3
|
+
* @property {string} address IPv4 address of service
|
|
4
|
+
* @property {number} port
|
|
5
|
+
* @property {string} name Instance name
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {object} DnsSdEvents
|
|
9
|
+
* @property {(service: MapeoService) => void} up
|
|
10
|
+
* @property {(service: MapeoService) => void} down
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @extends {TypedEmitter<DnsSdEvents>}
|
|
14
|
+
*/
|
|
15
|
+
export class DnsSd extends TypedEmitter<DnsSdEvents> {
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param {object} [opts]
|
|
19
|
+
* @param {string} [opts.name]
|
|
20
|
+
* @param {boolean} [opts.disableIpv6]
|
|
21
|
+
* @param {Logger} [opts.logger]
|
|
22
|
+
*/
|
|
23
|
+
constructor({ name, disableIpv6, logger }?: {
|
|
24
|
+
name?: string | undefined;
|
|
25
|
+
disableIpv6?: boolean | undefined;
|
|
26
|
+
logger?: Logger | undefined;
|
|
27
|
+
} | undefined);
|
|
28
|
+
get name(): string;
|
|
29
|
+
/** @param {number} port */
|
|
30
|
+
advertise(port: number): Promise<void>;
|
|
31
|
+
browse(): void;
|
|
32
|
+
stopAdvertising(): Promise<void>;
|
|
33
|
+
stopBrowsing(): void;
|
|
34
|
+
destroy(): Promise<void>;
|
|
35
|
+
#private;
|
|
36
|
+
}
|
|
37
|
+
export type MapeoService = {
|
|
38
|
+
/**
|
|
39
|
+
* IPv4 address of service
|
|
40
|
+
*/
|
|
41
|
+
address: string;
|
|
42
|
+
port: number;
|
|
43
|
+
/**
|
|
44
|
+
* Instance name
|
|
45
|
+
*/
|
|
46
|
+
name: string;
|
|
47
|
+
};
|
|
48
|
+
export type DnsSdEvents = {
|
|
49
|
+
up: (service: MapeoService) => void;
|
|
50
|
+
down: (service: MapeoService) => void;
|
|
51
|
+
};
|
|
52
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
53
|
+
import { Logger } from '../logger.js';
|
|
54
|
+
//# sourceMappingURL=dns-sd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dns-sd.d.ts","sourceRoot":"","sources":["../../src/discovery/dns-sd.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AAEH;;;;GAIG;AAEH;;GAEG;AACH;IAoDE;;;;;;OAMG;IACH;;;;mBAMC;IAED,mBAEC;IAED,2BAA2B;IAC3B,gBADY,MAAM,iBA+BjB;IAED,eAiBC;IAED,iCAeC;IAED,qBAKC;IAED,yBA0BC;;CA+BF;;;;;aA1Na,MAAM;UACN,MAAM;;;;UACN,MAAM;;;kBAKI,YAAY,KAAK,IAAI;oBACrB,YAAY,KAAK,IAAI;;6BApBhB,oBAAoB;uBAM1B,cAAc"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -6,4 +6,20 @@ export function nullIfNotFound(err: unknown): null;
|
|
|
6
6
|
export class NotFoundError extends Error {
|
|
7
7
|
constructor(message?: string);
|
|
8
8
|
}
|
|
9
|
+
export class AlreadyJoinedError extends Error {
|
|
10
|
+
/** @param {string} [message] */
|
|
11
|
+
constructor(message?: string | undefined);
|
|
12
|
+
}
|
|
13
|
+
export class InviteSendError extends Error {
|
|
14
|
+
/** @param {string} [message] */
|
|
15
|
+
constructor(message?: string | undefined);
|
|
16
|
+
}
|
|
17
|
+
export class InviteAbortedError extends Error {
|
|
18
|
+
/** @param {string} [message] */
|
|
19
|
+
constructor(message?: string | undefined);
|
|
20
|
+
}
|
|
21
|
+
export class TimeoutError extends Error {
|
|
22
|
+
/** @param {string} [message] */
|
|
23
|
+
constructor(message?: string | undefined);
|
|
24
|
+
}
|
|
9
25
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.js"],"names":[],"mappings":"AAuCA;;;GAGG;AACH,oCAHW,OAAO,GACL,IAAI,CAKhB;AA9CD;IACE,8BAGC;CACF;AAED;IACE,gCAAgC;IAChC,0CAGC;CACF;AAED;IACE,gCAAgC;IAChC,0CAGC;CACF;AAED;IACE,gCAAgC;IAChC,0CAGC;CACF;AAED;IACE,gCAAgC;IAChC,0CAGC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const PLUGIN_NAME: "mapeo-maps";
|
|
2
|
+
export const DEFAULT_MAPBOX_STYLE_URL: "https://api.mapbox.com/styles/v1/mapbox/outdoors-v12";
|
|
3
|
+
export function plugin(instance: import("fastify").FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>, opts: MapsPluginOpts): Promise<void>;
|
|
4
|
+
export type MapsPluginOpts = {
|
|
5
|
+
prefix?: string | undefined;
|
|
6
|
+
defaultOnlineStyleUrl?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export type MapsPluginContext = {
|
|
9
|
+
getStyleJsonUrl: () => Promise<string>;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fastify-plugins/maps/index.js"],"names":[],"mappings":"AAYA,uCAAuC;AACvC,8FACwD;;;;;;;qBA8B1C,MAAM,OAAO,CAAC,MAAM,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const PLUGIN_NAME: "mapeo-static-maps";
|
|
2
|
+
export function plugin(instance: import("fastify").FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>, opts: OfflineFallbackMapPluginOpts): Promise<void>;
|
|
3
|
+
export type OfflineFallbackMapPluginOpts = {
|
|
4
|
+
prefix?: string | undefined;
|
|
5
|
+
styleJsonPath: string;
|
|
6
|
+
sourcesDir: string;
|
|
7
|
+
};
|
|
8
|
+
export type FallbackMapPluginDecorator = {
|
|
9
|
+
getResolvedStyleJson: (serverAddress: string) => Promise<any>;
|
|
10
|
+
getStyleJsonStats: () => Promise<import("node:fs").Stats>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=offline-fallback-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-fallback-map.d.ts","sourceRoot":"","sources":["../../../src/fastify-plugins/maps/offline-fallback-map.js"],"names":[],"mappings":"AAWA,8CAA8C;;;;mBAUhC,MAAM;gBACN,MAAM;;;0BAKN,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC;uBACvC,MAAM,OAAO,CAAC,OAAO,SAAS,EAAE,KAAK,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const PLUGIN_NAME: "mapeo-static-maps";
|
|
2
|
+
export function plugin(instance: import("fastify").FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>, opts: StaticMapsPluginOpts): Promise<void>;
|
|
3
|
+
export type StaticMapsPluginOpts = {
|
|
4
|
+
prefix?: string | undefined;
|
|
5
|
+
staticRootDir: string;
|
|
6
|
+
};
|
|
7
|
+
export type StaticMapsPluginDecorator = {
|
|
8
|
+
getResolvedStyleJson: (styleId: string, serverAddress: string) => Promise<string>;
|
|
9
|
+
getStyleJsonStats: (styleId: string) => Promise<import("node:fs").Stats>;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=static-maps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-maps.d.ts","sourceRoot":"","sources":["../../../src/fastify-plugins/maps/static-maps.js"],"names":[],"mappings":"AAeA,8CAA8C;;;;mBAUhC,MAAM;;;0BAKN,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC;uBAC3D,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,SAAS,EAAE,KAAK,CAAC"}
|
|
@@ -24,6 +24,13 @@ export interface DownloadIntentExtension {
|
|
|
24
24
|
downloadIntents: {
|
|
25
25
|
[key: string]: DownloadIntentExtension_DownloadIntent;
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* If true, the peer intends to download all blobs - this is the default
|
|
29
|
+
* assumption when a peer has not sent a download intent, but if a peer
|
|
30
|
+
* changes their intent while connected, we need to send the new intent to
|
|
31
|
+
* download everything.
|
|
32
|
+
*/
|
|
33
|
+
everything: boolean;
|
|
27
34
|
}
|
|
28
35
|
export interface DownloadIntentExtension_DownloadIntent {
|
|
29
36
|
variants: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/generated/extensions.ts"],"names":[],"mappings":"AAEA,OAAO,GAAG,MAAM,uBAAuB,CAAC;AAExC,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAC;C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GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GACnH,CAAC,SAAS,EAAE,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACrD,OAAO,CAAC,CAAC,CAAC,CAAC;AAEf,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC;AACpD,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,CAAC,GAC9C,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK;CAAE,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;;AAgBO,0CAJI,YAAY,gKAEV,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;;AAgBO,0CAJI,YAAY,gKAEV,UAAU,yCAUgkkB,QAAQ,kBAAyB,SAAS,qDAV/jkB,CAG7B;;;;;;kCARH,oBAAoB;gCAL/C,YAAY;oCAAZ,YAAY;+BAAZ,YAAY"}
|