@comapeo/core 2.0.0 → 2.0.1
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/index.d.ts +18 -41
- package/dist/blob-store/index.d.ts.map +1 -1
- package/dist/core-ownership.d.ts.map +1 -1
- package/dist/lib/omit.d.ts +17 -0
- package/dist/lib/omit.d.ts.map +1 -0
- package/dist/mapeo-manager.d.ts.map +1 -1
- package/dist/mapeo-project.d.ts +6 -22
- package/dist/mapeo-project.d.ts.map +1 -1
- package/dist/schema/project.d.ts +1 -1
- package/dist/translation-api.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/blob-store/index.js +17 -2
- package/src/config-import.js +0 -1
- package/src/core-ownership.js +5 -2
- package/src/fastify-plugins/maps.js +11 -3
- package/src/lib/omit.js +28 -0
- package/src/mapeo-manager.js +5 -10
- package/src/mapeo-project.js +2 -3
- package/src/translation-api.js +2 -2
- package/src/utils.js +11 -14
|
@@ -6,17 +6,21 @@ export class BlobStore {
|
|
|
6
6
|
constructor({ coreManager }: {
|
|
7
7
|
coreManager: import("../core-manager/index.js").CoreManager;
|
|
8
8
|
});
|
|
9
|
+
/**
|
|
10
|
+
* @returns {string}
|
|
11
|
+
*/
|
|
9
12
|
get writerDriveId(): string;
|
|
10
13
|
/**
|
|
11
14
|
* @param {BlobId} blobId
|
|
12
15
|
* @param {object} opts
|
|
13
16
|
* @param {false} [opts.wait=false] Set to `true` to wait for a blob to download, otherwise will throw if blob is not available locally
|
|
14
17
|
* @param {never} [opts.timeout] Optional timeout to wait for a blob to download
|
|
18
|
+
* @returns {Promise<Uint8Array>}
|
|
15
19
|
*/
|
|
16
20
|
get({ type, variant, name, driveId }: BlobId, { wait, timeout }?: {
|
|
17
21
|
wait?: false | undefined;
|
|
18
22
|
timeout?: undefined;
|
|
19
|
-
}): Promise<
|
|
23
|
+
}): Promise<Uint8Array>;
|
|
20
24
|
/**
|
|
21
25
|
* Download blobs from all drives, optionally filtering particular blob types
|
|
22
26
|
* or blob variants. Download will be 'live' and will continue downloading new
|
|
@@ -28,21 +32,22 @@ export class BlobStore {
|
|
|
28
32
|
* @param {import('../types.js').BlobFilter} [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.
|
|
29
33
|
* @param {object} options
|
|
30
34
|
* @param {AbortSignal} [options.signal] Optional AbortSignal to cancel in-progress download
|
|
31
|
-
* @returns
|
|
35
|
+
* @returns {TypedEmitter<BlobDownloadEvents>}
|
|
32
36
|
*/
|
|
33
37
|
download(filter?: import("../types.js").BlobFilter | undefined, { signal }?: {
|
|
34
38
|
signal?: AbortSignal | undefined;
|
|
35
|
-
}):
|
|
39
|
+
}): TypedEmitter<BlobDownloadEvents>;
|
|
36
40
|
/**
|
|
37
41
|
* @param {BlobId} blobId
|
|
38
42
|
* @param {object} [options]
|
|
39
43
|
* @param {boolean} [options.wait=false] Set to `true` to wait for a blob to download, otherwise will throw if blob is not available locally
|
|
40
44
|
* @param {number} [options.timeout] Optional timeout to wait for a blob to download
|
|
45
|
+
* @returns {Readable}
|
|
41
46
|
*/
|
|
42
47
|
createReadStream({ type, variant, name, driveId }: BlobId, options?: {
|
|
43
48
|
wait?: boolean | undefined;
|
|
44
49
|
timeout?: number | undefined;
|
|
45
|
-
} | undefined):
|
|
50
|
+
} | undefined): Readable;
|
|
46
51
|
/**
|
|
47
52
|
* Optimization for creating the blobs read stream when you have
|
|
48
53
|
* previously read the entry from Hyperdrive using `drive.entry`
|
|
@@ -50,49 +55,16 @@ export class BlobStore {
|
|
|
50
55
|
* @param {import('hyperdrive').HyperdriveEntry} entry Hyperdrive entry
|
|
51
56
|
* @param {object} [options]
|
|
52
57
|
* @param {boolean} [options.wait=false] Set to `true` to wait for a blob to download, otherwise will throw if blob is not available locally
|
|
58
|
+
* @returns {Promise<Readable>}
|
|
53
59
|
*/
|
|
54
60
|
createEntryReadStream(driveId: BlobId["driveId"], entry: import("hyperdrive").HyperdriveEntry, options?: {
|
|
55
61
|
wait?: boolean | undefined;
|
|
56
|
-
} | undefined): Promise<
|
|
57
|
-
_read(cb: import("streamx").ResultCallback<any>): void;
|
|
58
|
-
pipe<TTarget extends import("streamx").AnyWritable<any, any, any> = import("streamx").AnyWritable<any, any, any>>(dest: TTarget, cb?: import("streamx").Callback): TTarget;
|
|
59
|
-
read(): any;
|
|
60
|
-
push(data: any): boolean;
|
|
61
|
-
unshift(data: any): void;
|
|
62
|
-
resume(): any;
|
|
63
|
-
pause(): any;
|
|
64
|
-
[Symbol.asyncIterator]: () => AsyncIterator<any, any, any>;
|
|
65
|
-
_open(cb: import("streamx").Callback): void;
|
|
66
|
-
_destroy(cb: import("streamx").Callback): void;
|
|
67
|
-
_predestroy(cb: import("streamx").Callback): void;
|
|
68
|
-
readonly readable: true;
|
|
69
|
-
readonly writable: false;
|
|
70
|
-
readonly destroyed: boolean;
|
|
71
|
-
readonly destroying: boolean;
|
|
72
|
-
destroy(error?: Error | null): void;
|
|
73
|
-
addListener<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping">(event: TEvent, listener: TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" ? import("streamx").ReadableEvents<any>[TEvent] : (...args: any[]) => void): any;
|
|
74
|
-
on<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping">(event: TEvent, listener: TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" ? import("streamx").ReadableEvents<any>[TEvent] : (...args: any[]) => void): any;
|
|
75
|
-
once<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping">(event: TEvent, listener: TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" ? import("streamx").ReadableEvents<any>[TEvent] : (...args: any[]) => void): any;
|
|
76
|
-
removeListener<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping">(event: TEvent, listener: TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" ? import("streamx").ReadableEvents<any>[TEvent] : (...args: any[]) => void): any;
|
|
77
|
-
off<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping">(event: TEvent, listener: TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" ? import("streamx").ReadableEvents<any>[TEvent] : (...args: any[]) => void): any;
|
|
78
|
-
removeAllListeners(event?: "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" | undefined): any;
|
|
79
|
-
setMaxListeners(n: number): any;
|
|
80
|
-
getMaxListeners(): number;
|
|
81
|
-
listeners<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping">(event: TEvent): (TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" ? import("streamx").ReadableEvents<any>[TEvent] : (...args: any[]) => void)[];
|
|
82
|
-
rawListeners<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping">(event: TEvent): (TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" ? import("streamx").ReadableEvents<any>[TEvent] : (...args: any[]) => void)[];
|
|
83
|
-
emit<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping">(event: TEvent, ...rest: Parameters<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" ? import("streamx").ReadableEvents<any>[TEvent] : (...args: any[]) => void>): boolean;
|
|
84
|
-
listenerCount(event: "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping"): number;
|
|
85
|
-
prependListener<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping">(event: TEvent, listener: TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" ? import("streamx").ReadableEvents<any>[TEvent] : (...args: any[]) => void): any;
|
|
86
|
-
prependOnceListener<TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping">(event: TEvent, listener: TEvent extends "end" | "data" | "readable" | keyof import("streamx").StreamEvents | "piping" ? import("streamx").ReadableEvents<any>[TEvent] : (...args: any[]) => void): any;
|
|
87
|
-
eventNames(): Array<string | symbol>;
|
|
88
|
-
[EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
|
|
89
|
-
}>;
|
|
62
|
+
} | undefined): Promise<Readable>;
|
|
90
63
|
/**
|
|
91
64
|
* @param {BlobId['driveId']} driveId Hyperdrive drive id
|
|
92
65
|
* @param {import('hyperdrive').HyperdriveEntry} entry Hyperdrive entry
|
|
93
66
|
* @param {object} [opts]
|
|
94
67
|
* @param {number} [opts.length]
|
|
95
|
-
*
|
|
96
68
|
* @returns {Promise<Buffer | null>}
|
|
97
69
|
*/
|
|
98
70
|
getEntryBlob(driveId: BlobId["driveId"], entry: import("hyperdrive").HyperdriveEntry, { length }?: {
|
|
@@ -115,12 +87,13 @@ export class BlobStore {
|
|
|
115
87
|
* @param {Omit<BlobId, 'driveId'>} blobId
|
|
116
88
|
* @param {object} [options]
|
|
117
89
|
* @param {{mimeType: string}} [options.metadata] Metadata to store with the blob
|
|
90
|
+
* @returns {Writable & { driveId: string }}
|
|
118
91
|
*/
|
|
119
92
|
createWriteStream({ type, variant, name }: Omit<BlobId, "driveId">, options?: {
|
|
120
93
|
metadata?: {
|
|
121
94
|
mimeType: string;
|
|
122
95
|
} | undefined;
|
|
123
|
-
} | undefined):
|
|
96
|
+
} | undefined): Writable & {
|
|
124
97
|
driveId: string;
|
|
125
98
|
};
|
|
126
99
|
/**
|
|
@@ -149,6 +122,7 @@ export class BlobStore {
|
|
|
149
122
|
} | null>;
|
|
150
123
|
#private;
|
|
151
124
|
}
|
|
125
|
+
export type Readable = NodeReadable | StreamxReadable;
|
|
152
126
|
export type InternalDriveEmitter = TypedEmitter<{
|
|
153
127
|
"add-drive": (drive: import("hyperdrive")) => void;
|
|
154
128
|
}>;
|
|
@@ -158,6 +132,9 @@ export namespace SUPPORTED_BLOB_VARIANTS {
|
|
|
158
132
|
let video: readonly ["original"];
|
|
159
133
|
}
|
|
160
134
|
import type { BlobId } from '../types.js';
|
|
161
|
-
import { LiveDownload } from './live-download.js';
|
|
162
135
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
136
|
+
import type { BlobDownloadEvents } from './live-download.js';
|
|
137
|
+
import type { Writable } from 'streamx';
|
|
138
|
+
import type { Readable as NodeReadable } from 'node:stream';
|
|
139
|
+
import type { Readable as StreamxReadable } from 'streamx';
|
|
163
140
|
//# 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":"AAsCA;IAUE;;;OAGG;IACH,6BAFG;QAAgE,WAAW,EAAnE,OAAO,0BAA0B,EAAE,WAAW;KACxD,EA+BA;IAED;;OAEG;IACH,4BAEC;IAYD;;;;;;OAMG;IACH,sCANW,MAAM,sBAEd;QAAqB,IAAI;QACJ,OAAO;KAC5B,GAAU,OAAO,CAAC,UAAU,CAAC,CAQ/B;IAED;;;;;;;;;;;;OAYG;IACH,6EAHG;QAA8B,MAAM;KACpC,GAAU,YAAY,CAAC,kBAAkB,CAAC,CAO5C;IAED;;;;;;OAMG;IACH,mDANW,MAAM;;;oBAIJ,QAAQ,CAYpB;IAED;;;;;;;;OAQG;IACH,+BANW,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;;sBAEK,MAAM;;oBACf,OAAO,CAAC,MAAM,CAAC,CAM3B;IAED;;;;;OAKG;IACH,2CALW,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC;;sBAEZ,MAAM;;oBACf,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;;CACF;uBAnPY,YAAY,GAAG,eAAe;mCAG7B,YAAY,CAAC;IAAE,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,YAAY,CAAC,KAAK,IAAI,CAAA;CAAE,CAAC;;;;;;4BARtD,aAAa;6BAJZ,oBAAoB;wCAKT,oBAAoB;8BAFD,SAAS;8CADtB,aAAa;iDACA,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-ownership.d.ts","sourceRoot":"","sources":["../src/core-ownership.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core-ownership.d.ts","sourceRoot":"","sources":["../src/core-ownership.js"],"names":[],"mappings":"AAqJA;;;;;;;;;;;GAWG;AACH,iDAJW,2BAA2B,wBAC3B,OAAO,iBAAiB,EAAE,eAAe,GACvC,OAAO,iBAAiB,EAAE,aAAa,CAiBnD;;AA9JD;;;;;;;GAOG;AAEH;;;GAGG;AAEH;;GAEG;AACH;IAGE;;;;;;;;;;;;OAYG;IACH,yDAVG;QAMQ,QAAQ,EANR,OAAO,qBAAqB,EAAE,QAAQ,CAChD,OAAW,sBAAsB,EAAE,SAAS,CAAC,MAAM,CAAC,EACpD,cAAkB,qBAAqB,EAAE,kBAAkB,EAC3D,eAAmB,EACnB,OAAW,iBAAiB,EAAE,aAAa,EAC3C,OAAW,iBAAiB,EAAE,kBAAkB,CAC7C;QACwC,YAAY,EAA7C,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC;QACZ,eAAe,EAA7B,OAAO;KACjB,EAyBA;IAED;;;OAGG;IACH,iBAHW,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAiB3B;IAED;;;;;OAKG;IACH,oBAJW,MAAM,aACN,SAAS,GACP,OAAO,CAAC,MAAM,CAAC,CAK3B;IAED;;;;OAIG;IACH,cAFW,MAAM;;;;;;;;;;;;;;;;OAKhB;IAED;;;;;;;;;;;;;;;;UAGC;;CAyBF;;;;;YAtHa,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI;;iDALjC,YAAY;6BARO,oBAAoB;+BAQvC,YAAY;6BAAZ,YAAY"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a new object with the own enumerable keys of `obj` that are not in `keys`.
|
|
3
|
+
*
|
|
4
|
+
* In other words, remove some keys from an object.
|
|
5
|
+
*
|
|
6
|
+
* @template {object} T
|
|
7
|
+
* @template {keyof T} K
|
|
8
|
+
* @param {T} obj
|
|
9
|
+
* @param {ReadonlyArray<K>} keys
|
|
10
|
+
* @returns {Omit<T, K>}
|
|
11
|
+
* @example
|
|
12
|
+
* const obj = { foo: 1, bar: 2, baz: 3 }
|
|
13
|
+
* omit(obj, ['foo', 'bar'])
|
|
14
|
+
* // => { baz: 3 }
|
|
15
|
+
*/
|
|
16
|
+
export function omit<T extends object, K extends keyof T>(obj: T, keys: ReadonlyArray<K>): Omit<T, K>;
|
|
17
|
+
//# sourceMappingURL=omit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omit.d.ts","sourceRoot":"","sources":["../../src/lib/omit.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,qBAVsB,CAAC,SAAV,MAAQ,EACE,CAAC,SAAX,MAAO,CAAE,OACX,CAAC,QACD,aAAa,CAAC,CAAC,CAAC,GACd,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAkBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapeo-manager.d.ts","sourceRoot":"","sources":["../src/mapeo-manager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mapeo-manager.d.ts","sourceRoot":"","sources":["../src/mapeo-manager.js"],"names":[],"mappings":"AA0EA,oDAEC;AAED,mFAC6C;AAE7C,iCAAiC;AACjC,8CAA4D;AAE5D;;GAEG;AAEH;;;GAGG;AAEH;;GAEG;AACH;IAqBE;;;;;;;;;;;;OAYG;IACH,qLAXG;QAAqB,OAAO,EAApB,MAAM;QACO,QAAQ,EAArB,MAAM;QACO,uBAAuB,EAApC,MAAM;QACO,sBAAsB,EAAnC,MAAM;QACqB,WAAW,EAAtC,MAAM,GAAG,WAAW;QACoB,OAAO,EAA/C,OAAO,SAAS,EAAE,eAAe;QACnB,iBAAiB;QACjB,aAAa;QACb,eAAe;QACf,qBAAqB;KAC7C,EA4FA;IASD,uBAEC;IAiJD;;;;;;;;;OASG;IACH;;qBALsB,MAAM;oBAGf,OAAO,CAAC,MAAM,CAAC,CA2E3B;IAED;;;OAGG;IACH,4BAHW,MAAM,GACJ,OAAO,CAAC,YAAY,CAAC,CAuCjC;IAqBD;;OAEG;IACH,gBAFa,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC,CAgDrH;IAED;;;;;;;;OAQG;IACH,0DAJW,IAAI,CAAC,OAAO,oBAAoB,EAAE,kBAAkB,EAAE,YAAY,GAAG,gBAAgB,CAAC,GAAG;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE;sBAChG,OAAO;s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
274
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
275
275
|
};
|
|
276
276
|
metadata?: {
|
|
277
|
-
manualLocation
|
|
278
|
-
/** @import { CoreStorage, KeyPair, Namespace } from './types.js' */
|
|
279
|
-
/** @typedef {Omit<ProjectSettingsValue, 'schemaName'>} EditableProjectSettings */
|
|
280
|
-
/** @typedef {ProjectSettingsValue['configMetadata']} ConfigMetadata */
|
|
281
|
-
? /** @import { CoreStorage, KeyPair, Namespace } from './types.js' */: boolean;
|
|
277
|
+
manualLocation?: boolean;
|
|
282
278
|
position?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
283
279
|
lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
284
280
|
positionProvider?: {
|
|
@@ -313,11 +309,7 @@ export class MapeoProject extends TypedEmitter<{
|
|
|
313
309
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
314
310
|
};
|
|
315
311
|
metadata?: {
|
|
316
|
-
manualLocation
|
|
317
|
-
/** @import { CoreStorage, KeyPair, Namespace } from './types.js' */
|
|
318
|
-
/** @typedef {Omit<ProjectSettingsValue, 'schemaName'>} EditableProjectSettings */
|
|
319
|
-
/** @typedef {ProjectSettingsValue['configMetadata']} ConfigMetadata */
|
|
320
|
-
? /** @import { CoreStorage, KeyPair, Namespace } from './types.js' */: boolean;
|
|
312
|
+
manualLocation?: boolean;
|
|
321
313
|
position?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
322
314
|
lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
323
315
|
positionProvider?: {
|
|
@@ -902,7 +894,7 @@ export class MapeoProject extends TypedEmitter<{
|
|
|
902
894
|
tableName: "field";
|
|
903
895
|
dataType: "string";
|
|
904
896
|
columnType: "SQLiteText";
|
|
905
|
-
data: "number" | "UNRECOGNIZED" | "
|
|
897
|
+
data: "number" | "UNRECOGNIZED" | "text" | "type_unspecified" | "selectOne" | "selectMultiple";
|
|
906
898
|
driverParam: string;
|
|
907
899
|
notNull: true;
|
|
908
900
|
hasDefault: false;
|
|
@@ -1308,11 +1300,7 @@ export class MapeoProject extends TypedEmitter<{
|
|
|
1308
1300
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
1309
1301
|
};
|
|
1310
1302
|
metadata?: {
|
|
1311
|
-
manualLocation
|
|
1312
|
-
/** @import { CoreStorage, KeyPair, Namespace } from './types.js' */
|
|
1313
|
-
/** @typedef {Omit<ProjectSettingsValue, 'schemaName'>} EditableProjectSettings */
|
|
1314
|
-
/** @typedef {ProjectSettingsValue['configMetadata']} ConfigMetadata */
|
|
1315
|
-
? /** @import { CoreStorage, KeyPair, Namespace } from './types.js' */: boolean;
|
|
1303
|
+
manualLocation?: boolean;
|
|
1316
1304
|
position?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
1317
1305
|
lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
1318
1306
|
positionProvider?: {
|
|
@@ -1347,11 +1335,7 @@ export class MapeoProject extends TypedEmitter<{
|
|
|
1347
1335
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
1348
1336
|
};
|
|
1349
1337
|
metadata?: {
|
|
1350
|
-
manualLocation
|
|
1351
|
-
/** @import { CoreStorage, KeyPair, Namespace } from './types.js' */
|
|
1352
|
-
/** @typedef {Omit<ProjectSettingsValue, 'schemaName'>} EditableProjectSettings */
|
|
1353
|
-
/** @typedef {ProjectSettingsValue['configMetadata']} ConfigMetadata */
|
|
1354
|
-
? /** @import { CoreStorage, KeyPair, Namespace } from './types.js' */: boolean;
|
|
1338
|
+
manualLocation?: boolean;
|
|
1355
1339
|
position?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
1356
1340
|
lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
1357
1341
|
positionProvider?: {
|
|
@@ -1936,7 +1920,7 @@ export class MapeoProject extends TypedEmitter<{
|
|
|
1936
1920
|
tableName: "field";
|
|
1937
1921
|
dataType: "string";
|
|
1938
1922
|
columnType: "SQLiteText";
|
|
1939
|
-
data: "number" | "UNRECOGNIZED" | "
|
|
1923
|
+
data: "number" | "UNRECOGNIZED" | "text" | "type_unspecified" | "selectOne" | "selectMultiple";
|
|
1940
1924
|
driverParam: string;
|
|
1941
1925
|
notNull: true;
|
|
1942
1926
|
hasDefault: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapeo-project.d.ts","sourceRoot":"","sources":["../src/mapeo-project.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mapeo-project.d.ts","sourceRoot":"","sources":["../src/mapeo-project.js"],"names":[],"mappings":"AA4DA,yCAAiD;AACjD,2CAAqD;AACrD,8CAA4D;AAC5D,uCAA6C;AAC7C,8CAA4D;AAC5D,uCAA6C;AAC7C,0CAAoD;AACpD,6CAAoE;AAIpE;;GAEG;AACH;WAFmC,MAAM,IAAI;;IAsB3C,4CAAsD;IAEtD;;;;;;;;;;;;;;;OAeG;IACH,2LAdG;QAAqB,MAAM,EAAnB,MAAM;QACO,uBAAuB,EAApC,MAAM;QACmC,UAAU,EAAnD,2CAAkC;QACrB,UAAU,EAAvB,MAAM;QACQ,gBAAgB;QACqB,cAAc,EAAjE,OAAO,qBAAqB,EAAE,cAAc;QACqB,QAAQ,EAAzE,OAAO,4BAA4B,EAAE,qBAAqB;QACxC,iBAAiB,EAAnC,WAAW;QACO,WAAW,EAA7B,WAAW;QAC6C,eAAe,EAAvE,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC;QACL,UAAU,EAAtD,OAAO,kBAAkB,EAAE,UAAU;QACvB,MAAM;KAE9B,EAoRA;IAvEC,gBASE;IAyFJ,uBAEC;IAED;;;;OAIG;IACH,SAFa,OAAO,CAAC,IAAI,CAAC,CAIzB;IAED;OACG;IACH,uBAYC;IA+CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Fa,OAAO,CAAC,IAAI,CAAC,CAoCzB;;CAuKF;sCA5zBa,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC;6BACxC,oBAAoB,CAAC,gBAAgB,CAAC;6BAlDvB,oBAAoB;wBAOzB,eAAe;0BAHb,sBAAsB;yBACL,qBAAqB;0BAmCtC,iBAAiB;wBACE,oBAAoB;2BAItC,sBAAsB;wBAFzB,eAAe;4BAxCX,yBAAyB;8BAsB9C,qBAAqB;0BAnBF,uBAAuB;4BAErB,yBAAyB;iCAuCA,YAAY;uBAL1C,aAAa;0CAIM,iBAAiB"}
|
package/dist/schema/project.d.ts
CHANGED
|
@@ -897,7 +897,7 @@ export const fieldTable: import("drizzle-orm/sqlite-core").SQLiteTableWithColumn
|
|
|
897
897
|
tableName: "field";
|
|
898
898
|
dataType: "string";
|
|
899
899
|
columnType: "SQLiteText";
|
|
900
|
-
data: "number" | "UNRECOGNIZED" | "
|
|
900
|
+
data: "number" | "UNRECOGNIZED" | "text" | "type_unspecified" | "selectOne" | "selectMultiple";
|
|
901
901
|
driverParam: string;
|
|
902
902
|
notNull: true;
|
|
903
903
|
hasDefault: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-api.d.ts","sourceRoot":"","sources":["../src/translation-api.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translation-api.d.ts","sourceRoot":"","sources":["../src/translation-api.js"],"names":[],"mappings":"AAKA,uEAAuE;AACvE,+CAA+C;AAE/C,iEAEC;AACD;IAQE;;;;;;;;;OASG;IACH,0BARG;QAMS,QAAQ,EANT,OAAO,qBAAqB,EAAE,QAAQ,CAChD,OAAW,sBAAsB,EAAE,SAAS,CAAC,QAAQ,CAAC,EACtD,cAAkB,qBAAqB,EAAE,gBAAgB,EACzD,aAAiB,EACjB,WAAe,EACf,gBAAoB,CACjB;KACH,EAWA;IAED,+BAA+B;IAC/B,SADc,OAAO,CAAC,IAAI,CAAC,CAG1B;IAED;;OAEG;IACH,WAFW,gBAAgB;;;;;;;;;;;;;;;;;;;;OAe1B;IAED,kGAAkG;IAElG;;;;;OAKG;IACH,WALW,YACR,IAAI,CAAC,gBAAgB,EAAC,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC,EAC5D,aAAe,GAAG,YAAY,CAAC,GAAG;QAAC,MAAM;;;UAA6B;KAAC,GAC3D,OAAO,CAAC,OAAO,iBAAiB,EAAE,WAAW,EAAE,CAAC,CAqC5D;IAED;;OAEG;IACH,WAFW,gBAAgB,QAkB1B;IAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAEC;IALD,mHAEC;;CAIF;sCApIkD,iBAAiB;iCACnC,WAAW;iCADO,iBAAiB"}
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,6BAHW,MAAM,SAAO,UASvB;AAUD;;GAEG;AACH,wBAFa,IAAI,CAEQ;AAEzB;;;;GAIG;AACH,kCAJW,OAAO,WACP,MAAM,GACJ,QAAQ,SAAS,CAI7B;AAED;;;;;;;;;;;;;GAaG;AACH,uBATa,CAAC,OACH,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAUd,OAAO,KACL,KAAK,IAAI,CAAC,CAGxB;AAED;;;;GAIG;AACH,0BAJa,CAAC,SACH,SAAS,GAAG,CAAC,GACX,KAAK,IAAI,CAAC,CAItB;AAED;;;;;;;GAOG;AAEH,0BALkB,CAAC,SAAN,EAAI,OACN,CAAC,GACC,OAAO,YAAY,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAUtD;AAED;;;;GAIG;AACH,wBAJyE,CAAC,SAA5D,OAAO,iBAAiB,EAAE,QAAQ,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CAAG,OAC7D,CAAC,GACC,IAAI,CAAC,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,mBAAmB,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC,CAa5H;AAED;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,iDAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,wDAHW,QAAQ,CAAC,MAAM,CAAC,GACd,MAAM,CAMlB;AAED;;;GAGG;AACH,4CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;GAGG;AACH,wCAHW,2CAAkC,GAChC,MAAM,CAIlB;AAED;;;;;;;2DAO2D;AAC3D,0BALsB,CAAC,SAAV,MAAQ,EACF,CAAC,wBACT,aAAa,CAAC,CAAC,CAAC,SAChB,CAAC,GACC,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAOtD;AAED;;;;GAIG;AACH,gCAHW,MAAM,UAQhB;AAhKD;IACE,2BAA2B;IAC3B,mBADY,KAAK,EAIhB;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comapeo/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Offline p2p mapping library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"sodium-universal": "^4.0.0",
|
|
192
192
|
"start-stop-state-machine": "^1.2.0",
|
|
193
193
|
"streamx": "^2.19.0",
|
|
194
|
-
"styled-map-package": "^
|
|
194
|
+
"styled-map-package": "^2.0.0",
|
|
195
195
|
"sub-encoder": "^2.1.1",
|
|
196
196
|
"throttle-debounce": "^5.0.0",
|
|
197
197
|
"tiny-typed-emitter": "^2.1.0",
|
package/src/blob-store/index.js
CHANGED
|
@@ -4,7 +4,15 @@ import util from 'node:util'
|
|
|
4
4
|
import { discoveryKey } from 'hypercore-crypto'
|
|
5
5
|
import { TypedEmitter } from 'tiny-typed-emitter'
|
|
6
6
|
import { LiveDownload } from './live-download.js'
|
|
7
|
+
/** @import { Readable as NodeReadable } from 'node:stream' */
|
|
8
|
+
/** @import { Readable as StreamxReadable, Writable } from 'streamx' */
|
|
7
9
|
/** @import { BlobId } from '../types.js' */
|
|
10
|
+
/** @import { BlobDownloadEvents } from './live-download.js' */
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
* @typedef {NodeReadable | StreamxReadable} Readable
|
|
15
|
+
*/
|
|
8
16
|
|
|
9
17
|
/** @typedef {TypedEmitter<{ 'add-drive': (drive: import('hyperdrive')) => void }>} InternalDriveEmitter */
|
|
10
18
|
|
|
@@ -74,12 +82,16 @@ export class BlobStore {
|
|
|
74
82
|
})
|
|
75
83
|
}
|
|
76
84
|
|
|
85
|
+
/**
|
|
86
|
+
* @returns {string}
|
|
87
|
+
*/
|
|
77
88
|
get writerDriveId() {
|
|
78
89
|
return getDiscoveryId(this.#writer.key)
|
|
79
90
|
}
|
|
80
91
|
|
|
81
92
|
/**
|
|
82
93
|
* @param {string} driveId hex-encoded discovery key
|
|
94
|
+
* @returns {Hyperdrive}
|
|
83
95
|
*/
|
|
84
96
|
#getDrive(driveId) {
|
|
85
97
|
const drive = this.#hyperdrives.get(driveId)
|
|
@@ -92,6 +104,7 @@ export class BlobStore {
|
|
|
92
104
|
* @param {object} opts
|
|
93
105
|
* @param {false} [opts.wait=false] Set to `true` to wait for a blob to download, otherwise will throw if blob is not available locally
|
|
94
106
|
* @param {never} [opts.timeout] Optional timeout to wait for a blob to download
|
|
107
|
+
* @returns {Promise<Uint8Array>}
|
|
95
108
|
*/
|
|
96
109
|
async get({ type, variant, name, driveId }, { wait = false, timeout } = {}) {
|
|
97
110
|
const drive = this.#getDrive(driveId)
|
|
@@ -112,7 +125,7 @@ export class BlobStore {
|
|
|
112
125
|
* @param {import('../types.js').BlobFilter} [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.
|
|
113
126
|
* @param {object} options
|
|
114
127
|
* @param {AbortSignal} [options.signal] Optional AbortSignal to cancel in-progress download
|
|
115
|
-
* @returns
|
|
128
|
+
* @returns {TypedEmitter<BlobDownloadEvents>}
|
|
116
129
|
*/
|
|
117
130
|
download(filter, { signal } = {}) {
|
|
118
131
|
return new LiveDownload(this.#hyperdrives.values(), this.#driveEmitter, {
|
|
@@ -126,6 +139,7 @@ export class BlobStore {
|
|
|
126
139
|
* @param {object} [options]
|
|
127
140
|
* @param {boolean} [options.wait=false] Set to `true` to wait for a blob to download, otherwise will throw if blob is not available locally
|
|
128
141
|
* @param {number} [options.timeout] Optional timeout to wait for a blob to download
|
|
142
|
+
* @returns {Readable}
|
|
129
143
|
*/
|
|
130
144
|
createReadStream(
|
|
131
145
|
{ type, variant, name, driveId },
|
|
@@ -146,6 +160,7 @@ export class BlobStore {
|
|
|
146
160
|
* @param {import('hyperdrive').HyperdriveEntry} entry Hyperdrive entry
|
|
147
161
|
* @param {object} [options]
|
|
148
162
|
* @param {boolean} [options.wait=false] Set to `true` to wait for a blob to download, otherwise will throw if blob is not available locally
|
|
163
|
+
* @returns {Promise<Readable>}
|
|
149
164
|
*/
|
|
150
165
|
async createEntryReadStream(driveId, entry, options = { wait: false }) {
|
|
151
166
|
const drive = this.#getDrive(driveId)
|
|
@@ -165,7 +180,6 @@ export class BlobStore {
|
|
|
165
180
|
* @param {import('hyperdrive').HyperdriveEntry} entry Hyperdrive entry
|
|
166
181
|
* @param {object} [opts]
|
|
167
182
|
* @param {number} [opts.length]
|
|
168
|
-
*
|
|
169
183
|
* @returns {Promise<Buffer | null>}
|
|
170
184
|
*/
|
|
171
185
|
async getEntryBlob(driveId, entry, { length } = {}) {
|
|
@@ -199,6 +213,7 @@ export class BlobStore {
|
|
|
199
213
|
* @param {Omit<BlobId, 'driveId'>} blobId
|
|
200
214
|
* @param {object} [options]
|
|
201
215
|
* @param {{mimeType: string}} [options.metadata] Metadata to store with the blob
|
|
216
|
+
* @returns {Writable & { driveId: string }}
|
|
202
217
|
*/
|
|
203
218
|
createWriteStream({ type, variant, name }, options) {
|
|
204
219
|
const path = makePath({ type, variant, name })
|
package/src/config-import.js
CHANGED
|
@@ -516,7 +516,6 @@ function parseIcon(filename, buf) {
|
|
|
516
516
|
if (!matches) {
|
|
517
517
|
throw new Error(`Unexpected icon filename ${filename}`)
|
|
518
518
|
}
|
|
519
|
-
/* eslint-disable no-unused-vars */
|
|
520
519
|
const [_, name, size, pixelDensityStr] = matches
|
|
521
520
|
const pixelDensity = Number(pixelDensityStr)
|
|
522
521
|
if (!(pixelDensity === 1 || pixelDensity === 2 || pixelDensity === 3)) {
|
package/src/core-ownership.js
CHANGED
|
@@ -15,6 +15,7 @@ import { discoveryKey } from 'hypercore-crypto'
|
|
|
15
15
|
import pDefer from 'p-defer'
|
|
16
16
|
import { NAMESPACES } from './constants.js'
|
|
17
17
|
import { TypedEmitter } from 'tiny-typed-emitter'
|
|
18
|
+
import { omit } from './lib/omit.js'
|
|
18
19
|
/**
|
|
19
20
|
* @import {
|
|
20
21
|
* CoreOwnershipWithSignatures,
|
|
@@ -167,8 +168,10 @@ export function mapAndValidateCoreOwnership(doc, { coreDiscoveryKey }) {
|
|
|
167
168
|
if (!verifyCoreOwnership(doc)) {
|
|
168
169
|
throw new Error('Invalid coreOwnership record: signatures are invalid')
|
|
169
170
|
}
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
const docWithoutSignatures = omit(doc, [
|
|
172
|
+
'identitySignature',
|
|
173
|
+
'coreSignatures',
|
|
174
|
+
])
|
|
172
175
|
docWithoutSignatures.links = []
|
|
173
176
|
return docWithoutSignatures
|
|
174
177
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises'
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
import { fetch } from 'undici'
|
|
4
|
-
import { Server as SMPServerPlugin } from 'styled-map-package'
|
|
4
|
+
import { ReaderWatch, Server as SMPServerPlugin } from 'styled-map-package'
|
|
5
5
|
|
|
6
6
|
import { noop } from '../utils.js'
|
|
7
7
|
import { NotFoundError, ENOENTError } from './utils.js'
|
|
@@ -25,6 +25,10 @@ export async function plugin(fastify, opts) {
|
|
|
25
25
|
if (opts.customMapPath) {
|
|
26
26
|
const { customMapPath } = opts
|
|
27
27
|
|
|
28
|
+
const customMapReader = new ReaderWatch(customMapPath)
|
|
29
|
+
|
|
30
|
+
fastify.addHook('onClose', () => customMapReader.close().catch(noop))
|
|
31
|
+
|
|
28
32
|
fastify.get(`/${CUSTOM_MAP_PREFIX}/info`, async () => {
|
|
29
33
|
const baseUrl = new URL(fastify.prefix, fastify.listeningOrigin)
|
|
30
34
|
|
|
@@ -78,13 +82,17 @@ export async function plugin(fastify, opts) {
|
|
|
78
82
|
|
|
79
83
|
fastify.register(SMPServerPlugin, {
|
|
80
84
|
prefix: CUSTOM_MAP_PREFIX,
|
|
81
|
-
|
|
85
|
+
reader: customMapReader,
|
|
82
86
|
})
|
|
83
87
|
}
|
|
84
88
|
|
|
89
|
+
const fallbackMapReader = new ReaderWatch(opts.fallbackMapPath)
|
|
90
|
+
|
|
91
|
+
fastify.addHook('onClose', () => fallbackMapReader.close().catch(noop))
|
|
92
|
+
|
|
85
93
|
fastify.register(SMPServerPlugin, {
|
|
86
94
|
prefix: FALLBACK_MAP_PREFIX,
|
|
87
|
-
|
|
95
|
+
reader: fallbackMapReader,
|
|
88
96
|
})
|
|
89
97
|
|
|
90
98
|
fastify.get('/style.json', async (_request, reply) => {
|
package/src/lib/omit.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a new object with the own enumerable keys of `obj` that are not in `keys`.
|
|
3
|
+
*
|
|
4
|
+
* In other words, remove some keys from an object.
|
|
5
|
+
*
|
|
6
|
+
* @template {object} T
|
|
7
|
+
* @template {keyof T} K
|
|
8
|
+
* @param {T} obj
|
|
9
|
+
* @param {ReadonlyArray<K>} keys
|
|
10
|
+
* @returns {Omit<T, K>}
|
|
11
|
+
* @example
|
|
12
|
+
* const obj = { foo: 1, bar: 2, baz: 3 }
|
|
13
|
+
* omit(obj, ['foo', 'bar'])
|
|
14
|
+
* // => { baz: 3 }
|
|
15
|
+
*/
|
|
16
|
+
export function omit(obj, keys) {
|
|
17
|
+
/** @type {Partial<T>} */ const result = {}
|
|
18
|
+
|
|
19
|
+
/** @type {Set<unknown>} */ const toOmit = new Set(keys)
|
|
20
|
+
|
|
21
|
+
for (const key in obj) {
|
|
22
|
+
if (!Object.hasOwn(obj, key)) continue
|
|
23
|
+
if (toOmit.has(key)) continue
|
|
24
|
+
result[key] = obj[key]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return /** @type {Omit<T, K>} */ (result)
|
|
28
|
+
}
|
package/src/mapeo-manager.js
CHANGED
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
projectKeyToPublicId,
|
|
35
35
|
} from './utils.js'
|
|
36
36
|
import { openedNoiseSecretStream } from './lib/noise-secret-stream-helpers.js'
|
|
37
|
+
import { omit } from './lib/omit.js'
|
|
37
38
|
import { RandomAccessFilePool } from './core-manager/random-access-file-pool.js'
|
|
38
39
|
import BlobServerPlugin from './fastify-plugins/blobs.js'
|
|
39
40
|
import IconServerPlugin from './fastify-plugins/icons.js'
|
|
@@ -442,9 +443,10 @@ export class MapeoManager extends TypedEmitter {
|
|
|
442
443
|
|
|
443
444
|
// 7. Load config, if relevant
|
|
444
445
|
// TODO: see how to expose warnings to frontend
|
|
445
|
-
|
|
446
|
+
// eslint-disable-next-line no-unused-vars
|
|
446
447
|
let warnings
|
|
447
448
|
if (configPath) {
|
|
449
|
+
// eslint-disable-next-line no-unused-vars
|
|
448
450
|
warnings = await project.importConfig({ configPath })
|
|
449
451
|
}
|
|
450
452
|
|
|
@@ -917,15 +919,8 @@ export class MapeoManager extends TypedEmitter {
|
|
|
917
919
|
* @returns {PublicPeerInfo[]}
|
|
918
920
|
*/
|
|
919
921
|
function omitPeerProtomux(peers) {
|
|
920
|
-
return peers.map(
|
|
921
|
-
(
|
|
922
|
-
// @ts-ignore
|
|
923
|
-
// eslint-disable-next-line no-unused-vars
|
|
924
|
-
protomux,
|
|
925
|
-
...publicPeerInfo
|
|
926
|
-
}) => {
|
|
927
|
-
return publicPeerInfo
|
|
928
|
-
}
|
|
922
|
+
return peers.map((peer) =>
|
|
923
|
+
'protomux' in peer ? omit(peer, ['protomux']) : peer
|
|
929
924
|
)
|
|
930
925
|
}
|
|
931
926
|
|
package/src/mapeo-project.js
CHANGED
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
projectKeyToPublicId,
|
|
44
44
|
valueOf,
|
|
45
45
|
} from './utils.js'
|
|
46
|
+
import { omit } from './lib/omit.js'
|
|
46
47
|
import { MemberApi } from './member-api.js'
|
|
47
48
|
import { SyncApi, kHandleDiscoveryKey } from './sync/sync-api.js'
|
|
48
49
|
import { Logger } from './logger.js'
|
|
@@ -887,9 +888,7 @@ export class MapeoProject extends TypedEmitter {
|
|
|
887
888
|
* @returns {EditableProjectSettings}
|
|
888
889
|
*/
|
|
889
890
|
function extractEditableProjectSettings(projectDoc) {
|
|
890
|
-
|
|
891
|
-
const { schemaName, ...result } = valueOf(projectDoc)
|
|
892
|
-
return result
|
|
891
|
+
return omit(valueOf(projectDoc), ['schemaName'])
|
|
893
892
|
}
|
|
894
893
|
|
|
895
894
|
/**
|
package/src/translation-api.js
CHANGED
|
@@ -2,6 +2,7 @@ import { and, sql } from 'drizzle-orm'
|
|
|
2
2
|
import { kCreateWithDocId, kSelect } from './datatype/index.js'
|
|
3
3
|
import { hashObject } from './utils.js'
|
|
4
4
|
import { NotFoundError } from './errors.js'
|
|
5
|
+
import { omit } from './lib/omit.js'
|
|
5
6
|
/** @import { Translation, TranslationValue } from '@comapeo/schema' */
|
|
6
7
|
/** @import { SetOptional } from 'type-fest' */
|
|
7
8
|
|
|
@@ -47,8 +48,7 @@ export default class TranslationApi {
|
|
|
47
48
|
* @param {TranslationValue} value
|
|
48
49
|
*/
|
|
49
50
|
async put(value) {
|
|
50
|
-
|
|
51
|
-
const { message, ...identifiers } = value
|
|
51
|
+
const identifiers = omit(value, ['message'])
|
|
52
52
|
const docId = hashObject(identifiers)
|
|
53
53
|
try {
|
|
54
54
|
const doc = await this.#dataType.getByDocId(docId)
|
package/src/utils.js
CHANGED
|
@@ -2,6 +2,7 @@ import sodium from 'sodium-universal'
|
|
|
2
2
|
import { keyToPublicId } from '@mapeo/crypto'
|
|
3
3
|
import { createHash } from 'node:crypto'
|
|
4
4
|
import stableStringify from 'json-stable-stringify'
|
|
5
|
+
import { omit } from './lib/omit.js'
|
|
5
6
|
|
|
6
7
|
const PROJECT_INVITE_ID_SALT = Buffer.from('mapeo project invite id', 'ascii')
|
|
7
8
|
|
|
@@ -95,20 +96,16 @@ export function deNullify(obj) {
|
|
|
95
96
|
* @returns {Omit<T, 'docId' | 'versionId' | 'originalVersionId' | 'links' | 'forks' | 'createdAt' | 'updatedAt' | 'deleted'>}
|
|
96
97
|
*/
|
|
97
98
|
export function valueOf(doc) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
...rest
|
|
109
|
-
} = doc
|
|
110
|
-
/* eslint-enable no-unused-vars */
|
|
111
|
-
return rest
|
|
99
|
+
return omit(doc, [
|
|
100
|
+
'docId',
|
|
101
|
+
'versionId',
|
|
102
|
+
'originalVersionId',
|
|
103
|
+
'links',
|
|
104
|
+
'forks',
|
|
105
|
+
'createdAt',
|
|
106
|
+
'updatedAt',
|
|
107
|
+
'deleted',
|
|
108
|
+
])
|
|
112
109
|
}
|
|
113
110
|
|
|
114
111
|
/**
|