@ocfl/ocfl 0.4.0 → 1.0.0-beta.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/LICENSE +674 -0
- package/README.md +24 -9
- package/dist/constants.d.ts +15 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +14 -0
- package/dist/constants.js.map +1 -0
- package/dist/digest.d.ts +58 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +204 -0
- package/dist/digest.js.map +1 -0
- package/dist/error.d.ts +5 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +9 -0
- package/dist/error.js.map +1 -0
- package/dist/extension.d.ts +83 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +170 -0
- package/dist/extension.js.map +1 -0
- package/dist/extensions/0002-flat-direct-storage-layout.d.ts +12 -0
- package/dist/extensions/0002-flat-direct-storage-layout.d.ts.map +1 -0
- package/dist/extensions/0002-flat-direct-storage-layout.js +34 -0
- package/dist/extensions/0002-flat-direct-storage-layout.js.map +1 -0
- package/dist/extensions/0003-hash-and-id-n-tuple-storage-layout.d.ts +15 -0
- package/dist/extensions/0003-hash-and-id-n-tuple-storage-layout.d.ts.map +1 -0
- package/dist/extensions/0003-hash-and-id-n-tuple-storage-layout.js +49 -0
- package/dist/extensions/0003-hash-and-id-n-tuple-storage-layout.js.map +1 -0
- package/dist/extensions/0004-hashed-n-tuple-storage-layout.d.ts +17 -0
- package/dist/extensions/0004-hashed-n-tuple-storage-layout.d.ts.map +1 -0
- package/dist/extensions/0004-hashed-n-tuple-storage-layout.js +54 -0
- package/dist/extensions/0004-hashed-n-tuple-storage-layout.js.map +1 -0
- package/dist/extensions/0006-flat-omit-prefix-storage-layout.d.ts +6 -0
- package/dist/extensions/0006-flat-omit-prefix-storage-layout.d.ts.map +1 -0
- package/dist/extensions/0006-flat-omit-prefix-storage-layout.js +8 -0
- package/dist/extensions/0006-flat-omit-prefix-storage-layout.js.map +1 -0
- package/dist/extensions/0007-n-tuple-omit-prefix-storage-layout.d.ts +6 -0
- package/dist/extensions/0007-n-tuple-omit-prefix-storage-layout.d.ts.map +1 -0
- package/dist/extensions/0007-n-tuple-omit-prefix-storage-layout.js +8 -0
- package/dist/extensions/0007-n-tuple-omit-prefix-storage-layout.js.map +1 -0
- package/dist/extensions/0009-digest-algorithms.d.ts +9 -0
- package/dist/extensions/0009-digest-algorithms.d.ts.map +1 -0
- package/dist/extensions/0009-digest-algorithms.js +11 -0
- package/dist/extensions/0009-digest-algorithms.js.map +1 -0
- package/dist/extensions/000N-path-direct-storage-layout.d.ts +16 -0
- package/dist/extensions/000N-path-direct-storage-layout.d.ts.map +1 -0
- package/dist/extensions/000N-path-direct-storage-layout.js +46 -0
- package/dist/extensions/000N-path-direct-storage-layout.js.map +1 -0
- package/dist/extensions/index.d.ts +23 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +8 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/file.d.ts +87 -0
- package/dist/file.d.ts.map +1 -0
- package/dist/file.js +118 -0
- package/dist/file.js.map +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/inventory.d.ts +155 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/inventory.js +591 -0
- package/dist/inventory.js.map +1 -0
- package/dist/object.d.ts +188 -0
- package/dist/object.d.ts.map +1 -0
- package/dist/object.js +425 -0
- package/dist/object.js.map +1 -0
- package/dist/storage.d.ts +94 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +302 -0
- package/dist/storage.js.map +1 -0
- package/dist/store.d.ts +100 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +157 -0
- package/dist/store.js.map +1 -0
- package/dist/transaction.d.ts +155 -0
- package/dist/transaction.d.ts.map +1 -0
- package/dist/transaction.js +395 -0
- package/dist/transaction.js.map +1 -0
- package/dist/types.d.ts +107 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +24 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +85 -0
- package/dist/utils.js.map +1 -0
- package/dist/validation.d.ts +32 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +31 -0
- package/dist/validation.js.map +1 -0
- package/package.json +31 -51
- package/src/constants.ts +16 -0
- package/src/digest.ts +258 -0
- package/src/error.ts +9 -0
- package/src/extension.ts +206 -0
- package/{lib/extensions/0002-flat-direct-storage-layout.js → src/extensions/0002-flat-direct-storage-layout.ts} +15 -22
- package/src/extensions/0003-hash-and-id-n-tuple-storage-layout.ts +56 -0
- package/src/extensions/0004-hashed-n-tuple-storage-layout.ts +59 -0
- package/src/extensions/0006-flat-omit-prefix-storage-layout.ts +9 -0
- package/src/extensions/0007-n-tuple-omit-prefix-storage-layout.ts +9 -0
- package/src/extensions/0009-digest-algorithms.ts +12 -0
- package/src/extensions/000N-path-direct-storage-layout.ts +51 -0
- package/src/extensions/index.ts +24 -0
- package/src/file.ts +161 -0
- package/src/index.ts +92 -0
- package/src/inventory.ts +634 -0
- package/src/object.ts +473 -0
- package/src/storage.ts +342 -0
- package/src/store.ts +199 -0
- package/src/transaction.ts +456 -0
- package/{lib/types.d.ts → src/types.ts} +28 -74
- package/src/utils.ts +94 -0
- package/src/validation.ts +46 -0
- package/index.js +0 -129
- package/index.mjs +0 -18
- package/lib/constants.js +0 -24
- package/lib/digest.js +0 -307
- package/lib/enum.js +0 -90
- package/lib/error.js +0 -19
- package/lib/extension.js +0 -194
- package/lib/extensions/0003-hash-and-id-n-tuple-storage-layout.js +0 -60
- package/lib/extensions/0004-hashed-n-tuple-storage-layout.js +0 -63
- package/lib/extensions/0005-mutable-head.js +0 -0
- package/lib/extensions/0006-flat-omit-prefix-storage-layout.js +0 -7
- package/lib/extensions/0007-n-tuple-omit-prefix-storage-layout.js +0 -7
- package/lib/extensions/0008-schema-registry.js +0 -0
- package/lib/extensions/0009-digest-algorithms.js +0 -18
- package/lib/extensions/000N-path-direct-storage-layout.js +0 -61
- package/lib/extensions/index.js +0 -13
- package/lib/file.js +0 -147
- package/lib/index.js +0 -13
- package/lib/inventory.js +0 -564
- package/lib/object.js +0 -499
- package/lib/storage.js +0 -338
- package/lib/store.js +0 -191
- package/lib/transaction.js +0 -448
- package/lib/utils.js +0 -122
- package/lib/validation.js +0 -174
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OcflStorageLayout } from '../extension.ts';
|
|
2
|
+
/**
|
|
3
|
+
* OCFL object identifiers are mapped directly to directory names that are direct children of the OCFL storage root directory.
|
|
4
|
+
*/
|
|
5
|
+
declare class FlatDirectStorageLayout extends OcflStorageLayout {
|
|
6
|
+
static get NAME(): string;
|
|
7
|
+
static get DESCRIPTION(): string;
|
|
8
|
+
static create<T>(): T;
|
|
9
|
+
map(id: string): string;
|
|
10
|
+
}
|
|
11
|
+
export { FlatDirectStorageLayout };
|
|
12
|
+
//# sourceMappingURL=0002-flat-direct-storage-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0002-flat-direct-storage-layout.d.ts","sourceRoot":"","sources":["../../src/extensions/0002-flat-direct-storage-layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAMpD;;GAEG;AACH,cAAM,uBAAwB,SAAQ,iBAAiB;IACrD,MAAM,KAAK,IAAI,WAEd;IACD,MAAM,KAAK,WAAW,WAErB;IAED,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAGpB;IAED,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAWtB;CACF;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { OcflConstants } from '../constants.js';
|
|
3
|
+
import { OcflStorageLayout } from '../extension.js';
|
|
4
|
+
const { EXTENSIONS_DIR } = OcflConstants;
|
|
5
|
+
let instance;
|
|
6
|
+
/**
|
|
7
|
+
* OCFL object identifiers are mapped directly to directory names that are direct children of the OCFL storage root directory.
|
|
8
|
+
*/
|
|
9
|
+
class FlatDirectStorageLayout extends OcflStorageLayout {
|
|
10
|
+
static get NAME() {
|
|
11
|
+
return '0002-flat-direct-storage-layout';
|
|
12
|
+
}
|
|
13
|
+
static get DESCRIPTION() {
|
|
14
|
+
return 'OCFL object identifiers are mapped directly to directory names' + ' that are direct children of the OCFL storage root.';
|
|
15
|
+
}
|
|
16
|
+
static create() {
|
|
17
|
+
instance ??= new FlatDirectStorageLayout();
|
|
18
|
+
return instance;
|
|
19
|
+
}
|
|
20
|
+
map(id) {
|
|
21
|
+
if (path.basename(id) !== id) {
|
|
22
|
+
throw new Error(`The object id <${id}> is incompatible with layout extension ${this.name} because it contains the path separator character.`);
|
|
23
|
+
}
|
|
24
|
+
else if (id === EXTENSIONS_DIR) {
|
|
25
|
+
throw new Error(`The object id <${id}> is incompatible with layout extension ${this.name} because it conflicts with the extensions directory.`);
|
|
26
|
+
}
|
|
27
|
+
if (id.length > 255) {
|
|
28
|
+
throw new Error(`The object id <${id}> is incompatible with layout extension ${this.name} because it has more than 255 characters.`);
|
|
29
|
+
}
|
|
30
|
+
return id;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export { FlatDirectStorageLayout };
|
|
34
|
+
//# sourceMappingURL=0002-flat-direct-storage-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0002-flat-direct-storage-layout.js","sourceRoot":"","sources":["../../src/extensions/0002-flat-direct-storage-layout.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC;AAEzC,IAAI,QAAiC,CAAC;AAEtC;;GAEG;AACH,MAAM,uBAAwB,SAAQ,iBAAiB;IACrD,MAAM,KAAK,IAAI;QACb,OAAO,iCAAiC,CAAC;IAC3C,CAAC;IACD,MAAM,KAAK,WAAW;QACpB,OAAO,gEAAgE,GAAG,qDAAqD,CAAC;IAClI,CAAC;IAED,MAAM,CAAC,MAAM;QACX,QAAQ,KAAK,IAAI,uBAAuB,EAAE,CAAC;QAC3C,OAAO,QAAa,CAAC;IACvB,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,kBAAkB,EAAE,2CAA2C,IAAI,CAAC,IAAI,oDAAoD,CAAC,CAAC;QAChJ,CAAC;aAAM,IAAI,EAAE,KAAK,cAAc,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,kBAAkB,EAAE,2CAA2C,IAAI,CAAC,IAAI,sDAAsD,CAAC,CAAC;QAClJ,CAAC;QACD,IAAI,EAAE,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,kBAAkB,EAAE,2CAA2C,IAAI,CAAC,IAAI,2CAA2C,CAAC,CAAC;QACvI,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OcflStorageLayout } from '../extension.ts';
|
|
2
|
+
declare const DefaultConfig: {
|
|
3
|
+
extensionName: string;
|
|
4
|
+
digestAlgorithm: string;
|
|
5
|
+
tupleSize: number;
|
|
6
|
+
numberOfTuples: number;
|
|
7
|
+
};
|
|
8
|
+
declare class HashAndIdNTupleStorageLayout extends OcflStorageLayout<typeof DefaultConfig> {
|
|
9
|
+
static get NAME(): string;
|
|
10
|
+
static get DESCRIPTION(): string;
|
|
11
|
+
constructor(config?: Partial<typeof DefaultConfig>);
|
|
12
|
+
map(id: string): string;
|
|
13
|
+
}
|
|
14
|
+
export { HashAndIdNTupleStorageLayout };
|
|
15
|
+
//# sourceMappingURL=0003-hash-and-id-n-tuple-storage-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0003-hash-and-id-n-tuple-storage-layout.d.ts","sourceRoot":"","sources":["../../src/extensions/0003-hash-and-id-n-tuple-storage-layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAMpD,QAAA,MAAM,aAAa;IACjB,aAAa;IACb,eAAe;IACf,SAAS;IACT,cAAc;CACf,CAAC;AAEF,cAAM,4BAA6B,SAAQ,iBAAiB,CAAC,OAAO,aAAa,CAAC;IAChF,MAAM,KAAK,IAAI,WAEd;IACD,MAAM,KAAK,WAAW,WAOrB;IAED,YAAY,MAAM,CAAC,EAAE,OAAO,CAAC,OAAO,aAAa,CAAC,EAWjD;IAED,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAWtB;CACF;AAED,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { OcflDigest } from '../digest.js';
|
|
3
|
+
import { OcflStorageLayout } from '../extension.js';
|
|
4
|
+
function encodeIdentifier(id) {
|
|
5
|
+
return encodeURIComponent(id).toLowerCase().replace(/\./g, '%2e');
|
|
6
|
+
}
|
|
7
|
+
const DefaultConfig = {
|
|
8
|
+
extensionName: '0003-hash-and-id-n-tuple-storage-layout',
|
|
9
|
+
digestAlgorithm: 'sha256',
|
|
10
|
+
tupleSize: 3,
|
|
11
|
+
numberOfTuples: 3,
|
|
12
|
+
};
|
|
13
|
+
class HashAndIdNTupleStorageLayout extends OcflStorageLayout {
|
|
14
|
+
static get NAME() {
|
|
15
|
+
return DefaultConfig.extensionName;
|
|
16
|
+
}
|
|
17
|
+
static get DESCRIPTION() {
|
|
18
|
+
return ('OCFL object identifiers are hashed and encoded as lowercase hex strings.' +
|
|
19
|
+
' These digests are then divided into N n-tuple segments,' +
|
|
20
|
+
' which are used to create nested paths under the OCFL storage root.' +
|
|
21
|
+
' Finally, the OCFL object identifier is percent-encoded to create a directory name for the OCFL object root.');
|
|
22
|
+
}
|
|
23
|
+
constructor(config) {
|
|
24
|
+
super(config, DefaultConfig);
|
|
25
|
+
const c = this.parameters;
|
|
26
|
+
const digestLength = OcflDigest.getHexDigestLength(c.digestAlgorithm);
|
|
27
|
+
if (!digestLength) {
|
|
28
|
+
throw new Error('Invalid digestAlgorithm');
|
|
29
|
+
}
|
|
30
|
+
const p = c.numberOfTuples * c.tupleSize;
|
|
31
|
+
if (p > digestLength) {
|
|
32
|
+
throw new Error('Product of numberOfTuples and tupleSize is greater than the number of characters in the hex encoded digest.');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
map(id) {
|
|
36
|
+
const digest = OcflDigest.digestSync(this.parameters.digestAlgorithm, id);
|
|
37
|
+
const segments = [];
|
|
38
|
+
const s = this.parameters.tupleSize;
|
|
39
|
+
const n = this.parameters.numberOfTuples;
|
|
40
|
+
let i;
|
|
41
|
+
for (i = 0; i < n; ++i) {
|
|
42
|
+
segments.push(digest.slice(s * i, s * i + s));
|
|
43
|
+
}
|
|
44
|
+
segments.push(encodeIdentifier(id));
|
|
45
|
+
return segments.join(path.sep);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export { HashAndIdNTupleStorageLayout };
|
|
49
|
+
//# sourceMappingURL=0003-hash-and-id-n-tuple-storage-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0003-hash-and-id-n-tuple-storage-layout.js","sourceRoot":"","sources":["../../src/extensions/0003-hash-and-id-n-tuple-storage-layout.ts"],"names":[],"mappings":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AAe,EAAE,EAAE,CAAC,CAAC;QAC1E,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QACpC,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC;QACzC,IAAI,CAAS,CAAC;QACd,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;CACF;AAED,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OcflStorageLayout } from '../extension.ts';
|
|
2
|
+
declare const DefaultConfig: {
|
|
3
|
+
extensionName: string;
|
|
4
|
+
digestAlgorithm: string;
|
|
5
|
+
tupleSize: number;
|
|
6
|
+
numberOfTuples: number;
|
|
7
|
+
shortObjectRoot: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type HashedNTupleStorageLayoutConfig = Partial<typeof DefaultConfig>;
|
|
10
|
+
declare class HashedNTupleStorageLayout extends OcflStorageLayout<typeof DefaultConfig> {
|
|
11
|
+
static get NAME(): string;
|
|
12
|
+
static get DESCRIPTION(): string;
|
|
13
|
+
constructor(config?: HashedNTupleStorageLayoutConfig);
|
|
14
|
+
map(id: string): string;
|
|
15
|
+
}
|
|
16
|
+
export { HashedNTupleStorageLayout };
|
|
17
|
+
//# sourceMappingURL=0004-hashed-n-tuple-storage-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0004-hashed-n-tuple-storage-layout.d.ts","sourceRoot":"","sources":["../../src/extensions/0004-hashed-n-tuple-storage-layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,QAAA,MAAM,aAAa;IACjB,aAAa;IACb,eAAe;IACf,SAAS;IACT,cAAc;IACd,eAAe;CAChB,CAAC;AACF,MAAM,MAAM,+BAA+B,GAAG,OAAO,CAAC,OAAO,aAAa,CAAC,CAAC;AAE5E,cAAM,yBAA0B,SAAQ,iBAAiB,CAAC,OAAO,aAAa,CAAC;IAC7E,MAAM,KAAK,IAAI,WAEd;IACD,MAAM,KAAK,WAAW,WAMrB;IAED,YAAY,MAAM,CAAC,EAAE,+BAA+B,EAanD;IAED,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAetB;CACF;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { OcflDigest } from '../digest.js';
|
|
3
|
+
import { OcflStorageLayout } from '../extension.js';
|
|
4
|
+
const DefaultConfig = {
|
|
5
|
+
extensionName: '0004-hashed-n-tuple-storage-layout',
|
|
6
|
+
digestAlgorithm: 'sha256',
|
|
7
|
+
tupleSize: 3,
|
|
8
|
+
numberOfTuples: 3,
|
|
9
|
+
shortObjectRoot: false,
|
|
10
|
+
};
|
|
11
|
+
class HashedNTupleStorageLayout extends OcflStorageLayout {
|
|
12
|
+
static get NAME() {
|
|
13
|
+
return DefaultConfig.extensionName;
|
|
14
|
+
}
|
|
15
|
+
static get DESCRIPTION() {
|
|
16
|
+
return ('OCFL object identifiers are hashed and encoded as lowercase hex strings.' +
|
|
17
|
+
' These digests are then divided into N n-tuple segments,' +
|
|
18
|
+
' which are used to create nested paths under the OCFL storage root.');
|
|
19
|
+
}
|
|
20
|
+
constructor(config) {
|
|
21
|
+
super(config, DefaultConfig);
|
|
22
|
+
const c = this.parameters;
|
|
23
|
+
const digestLength = OcflDigest.getHexDigestLength(c.digestAlgorithm);
|
|
24
|
+
if (!digestLength) {
|
|
25
|
+
throw new Error('Invalid digestAlgorithm');
|
|
26
|
+
}
|
|
27
|
+
const p = c.numberOfTuples * c.tupleSize;
|
|
28
|
+
if (p > digestLength) {
|
|
29
|
+
throw new Error('Product of numberOfTuples and tupleSize is greater than the number of characters in the hex encoded digest.');
|
|
30
|
+
}
|
|
31
|
+
else if (p === digestLength && c.shortObjectRoot) {
|
|
32
|
+
throw new Error('shortObjectRoot cannot be set to true');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
map(id) {
|
|
36
|
+
const digest = OcflDigest.digestSync(this.parameters.digestAlgorithm, id);
|
|
37
|
+
const segments = [];
|
|
38
|
+
const s = this.parameters.tupleSize;
|
|
39
|
+
const n = this.parameters.numberOfTuples;
|
|
40
|
+
let i;
|
|
41
|
+
for (i = 0; i < n; ++i) {
|
|
42
|
+
segments.push(digest.slice(s * i, s * i + s));
|
|
43
|
+
}
|
|
44
|
+
if (this.parameters.shortObjectRoot) {
|
|
45
|
+
segments.push(digest.slice(s * i));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
segments.push(digest);
|
|
49
|
+
}
|
|
50
|
+
return segments.join(path.sep);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export { HashedNTupleStorageLayout };
|
|
54
|
+
//# sourceMappingURL=0004-hashed-n-tuple-storage-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0004-hashed-n-tuple-storage-layout.js","sourceRoot":"","sources":["../../src/extensions/0004-hashed-n-tuple-storage-layout.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,aAAa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U,CAAC,cAAc,CAAC;QACzC,IAAI,CAAS,CAAC;QACd,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;YACpC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;CACF;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0006-flat-omit-prefix-storage-layout.d.ts","sourceRoot":"","sources":["../../src/extensions/0006-flat-omit-prefix-storage-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,cAAM,2BAA4B,SAAQ,iBAAiB;IACzD,MAAM,KAAK,IAAI,WAEd;CACF;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OcflStorageLayout } from '../extension.js';
|
|
2
|
+
class FlatOmitPrefixStorageLayout extends OcflStorageLayout {
|
|
3
|
+
static get NAME() {
|
|
4
|
+
return '0006-flat-omit-prefix-storage-layout';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export { FlatOmitPrefixStorageLayout };
|
|
8
|
+
//# sourceMappingURL=0006-flat-omit-prefix-storage-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0006-flat-omit-prefix-storage-layout.js","sourceRoot":"","sources":["../../src/extensions/0006-flat-omit-prefix-storage-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,2BAA4B,SAAQ,iBAAiB;IACzD,MAAM,KAAK,IAAI;QACb,OAAO,sCAAsC,CAAC;IAChD,CAAC;CACF;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OcflStorageLayout } from '../extension.ts';
|
|
2
|
+
declare class NTupleOmitPrefixStorageLayout extends OcflStorageLayout {
|
|
3
|
+
static get NAME(): string;
|
|
4
|
+
}
|
|
5
|
+
export { NTupleOmitPrefixStorageLayout };
|
|
6
|
+
//# sourceMappingURL=0007-n-tuple-omit-prefix-storage-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0007-n-tuple-omit-prefix-storage-layout.d.ts","sourceRoot":"","sources":["../../src/extensions/0007-n-tuple-omit-prefix-storage-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,cAAM,6BAA8B,SAAQ,iBAAiB;IAC3D,MAAM,KAAK,IAAI,WAEd;CACF;AAED,OAAO,EAAE,6BAA6B,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OcflStorageLayout } from '../extension.js';
|
|
2
|
+
class NTupleOmitPrefixStorageLayout extends OcflStorageLayout {
|
|
3
|
+
static get NAME() {
|
|
4
|
+
return '0007-n-tuple-omit-prefix-storage-layout';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export { NTupleOmitPrefixStorageLayout };
|
|
8
|
+
//# sourceMappingURL=0007-n-tuple-omit-prefix-storage-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0007-n-tuple-omit-prefix-storage-layout.js","sourceRoot":"","sources":["../../src/extensions/0007-n-tuple-omit-prefix-storage-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,6BAA8B,SAAQ,iBAAiB;IAC3D,MAAM,KAAK,IAAI;QACb,OAAO,yCAAyC,CAAC;IACnD,CAAC;CACF;AAED,OAAO,EAAE,6BAA6B,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OcflExtension } from '../extension.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Notes: this implementation does nothing because the 0009 extension is implemented directly in the OcflDigest class.
|
|
4
|
+
*/
|
|
5
|
+
declare class DigestAlgorithm extends OcflExtension {
|
|
6
|
+
static get NAME(): string;
|
|
7
|
+
}
|
|
8
|
+
export { DigestAlgorithm };
|
|
9
|
+
//# sourceMappingURL=0009-digest-algorithms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0009-digest-algorithms.d.ts","sourceRoot":"","sources":["../../src/extensions/0009-digest-algorithms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,cAAM,eAAgB,SAAQ,aAAa;IACzC,MAAM,KAAK,IAAI,WAEd;CACF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OcflExtension } from '../extension.js';
|
|
2
|
+
/**
|
|
3
|
+
* Notes: this implementation does nothing because the 0009 extension is implemented directly in the OcflDigest class.
|
|
4
|
+
*/
|
|
5
|
+
class DigestAlgorithm extends OcflExtension {
|
|
6
|
+
static get NAME() {
|
|
7
|
+
return '0009-digest-algorithms';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export { DigestAlgorithm };
|
|
11
|
+
//# sourceMappingURL=0009-digest-algorithms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0009-digest-algorithms.js","sourceRoot":"","sources":["../../src/extensions/0009-digest-algorithms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,eAAgB,SAAQ,aAAa;IACzC,MAAM,KAAK,IAAI;QACb,OAAO,wBAAwB,CAAC;IAClC,CAAC;CACF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OcflStorageLayout } from '../extension.ts';
|
|
2
|
+
declare const DefaultConfig: {
|
|
3
|
+
extensionName: string;
|
|
4
|
+
omitScheme: boolean;
|
|
5
|
+
replace: [string | RegExp, string][];
|
|
6
|
+
suffix: string;
|
|
7
|
+
};
|
|
8
|
+
export type PathDirectStorageLayoutConfig = Partial<typeof DefaultConfig>;
|
|
9
|
+
declare class PathDirectStorageLayout extends OcflStorageLayout<typeof DefaultConfig> {
|
|
10
|
+
static get NAME(): string;
|
|
11
|
+
static get DESCRIPTION(): string;
|
|
12
|
+
constructor(config?: PathDirectStorageLayoutConfig);
|
|
13
|
+
map(id: string): string;
|
|
14
|
+
}
|
|
15
|
+
export { PathDirectStorageLayout };
|
|
16
|
+
//# sourceMappingURL=000N-path-direct-storage-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"000N-path-direct-storage-layout.d.ts","sourceRoot":"","sources":["../../src/extensions/000N-path-direct-storage-layout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,QAAA,MAAM,aAAa;IACjB,aAAa;IACb,UAAU;IACV,OAAO,EAAQ,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE;IAC1C,MAAM;CACP,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,OAAO,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1E,cAAM,uBAAwB,SAAQ,iBAAiB,CAAC,OAAO,aAAa,CAAC;IAC3E,MAAM,KAAK,IAAI,WAEd;IACD,MAAM,KAAK,WAAW,WAErB;IAED,YAAY,MAAM,CAAC,EAAE,6BAA6B,EAEjD;IAED,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAuBtB;CACF;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { OcflStorageLayout } from '../extension.js';
|
|
3
|
+
const DefaultConfig = {
|
|
4
|
+
extensionName: '000N-path-direct-storage-layout',
|
|
5
|
+
omitScheme: false,
|
|
6
|
+
replace: [],
|
|
7
|
+
suffix: '/__object__',
|
|
8
|
+
};
|
|
9
|
+
class PathDirectStorageLayout extends OcflStorageLayout {
|
|
10
|
+
static get NAME() {
|
|
11
|
+
return DefaultConfig.extensionName;
|
|
12
|
+
}
|
|
13
|
+
static get DESCRIPTION() {
|
|
14
|
+
return 'OCFL object identifiers are used directly as the path.';
|
|
15
|
+
}
|
|
16
|
+
constructor(config) {
|
|
17
|
+
super(config, DefaultConfig);
|
|
18
|
+
}
|
|
19
|
+
map(id) {
|
|
20
|
+
var suffix = this.parameters.suffix;
|
|
21
|
+
if (suffix && id.endsWith(suffix)) {
|
|
22
|
+
throw new Error(`Identifier cannot end with '${suffix}'`);
|
|
23
|
+
}
|
|
24
|
+
var p = id ?? '';
|
|
25
|
+
for (const r of this.parameters.replace) {
|
|
26
|
+
p = p.replace(r[0], r[1]);
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const u = new URL(p);
|
|
30
|
+
const parts = [];
|
|
31
|
+
if (!this.parameters.omitScheme && u.protocol !== 'file:') {
|
|
32
|
+
parts.push(u.protocol.replace(':', ''));
|
|
33
|
+
}
|
|
34
|
+
if (u.hostname) {
|
|
35
|
+
parts.push(u.hostname.replace(',', '_').replace(';', '/'));
|
|
36
|
+
}
|
|
37
|
+
p = path.join(parts.join('_'), u.pathname + u.search + u.hash);
|
|
38
|
+
}
|
|
39
|
+
catch (_error) { }
|
|
40
|
+
p = p.replace(/^\/+/, '').replace(/\/+$/, '');
|
|
41
|
+
return path.join(p, this.parameters.suffix);
|
|
42
|
+
//if (/^\w+:/.test(id)) {
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export { PathDirectStorageLayout };
|
|
46
|
+
//# sourceMappingURL=000N-path-direct-storage-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"000N-path-direct-storage-layout.js","sourceRoot":"","sources":["../../src/extensions/000N-path-direct-storage-layout.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,aAAa,GAAG;IACpB,aAAa,EAAE,iCAAiC;IAChD,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,EAAiC;IAC1C,MAAM,EAAE,aAAa;CACtB,CAAC;AAIF,MAAM,uBAAwB,SAAQ,iBAAuC;IAC3E,MAAM,KAAK,IAAI;QACb,OAAO,aAAa,CAAC,aAAa,CAAC;IACrC,CAAC;IACD,MAAM,KAAK,WAAW;QACpB,OAAO,wDAAwD,CAAC;IAClE,CAAC;IAED,YAAY,MAAsC;QAChD,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC/B,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,IAAI,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACpC,IAAI,MAAM,IAAI,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,+BAA+B,MAAM,GAAG,CAAC,CAAC;QAC5D,CAAC;QACD,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;QACjB,KAAK,MAAM,CAAC,IA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{ PathDirectStorageLayout } from './000N-path-direct-storage-layout.ts';
|
|
2
|
+
export { FlatDirectStorageLayout } from './0002-flat-direct-storage-layout.ts';
|
|
3
|
+
export { HashAndIdNTupleStorageLayout } from './0003-hash-and-id-n-tuple-storage-layout.ts';
|
|
4
|
+
export { HashedNTupleStorageLayout } from './0004-hashed-n-tuple-storage-layout.ts';
|
|
5
|
+
export { FlatOmitPrefixStorageLayout } from './0006-flat-omit-prefix-storage-layout.ts';
|
|
6
|
+
export { NTupleOmitPrefixStorageLayout } from './0007-n-tuple-omit-prefix-storage-layout.ts';
|
|
7
|
+
export { DigestAlgorithm } from './0009-digest-algorithms.ts';
|
|
8
|
+
import type { PathDirectStorageLayout } from './000N-path-direct-storage-layout.ts';
|
|
9
|
+
import type { FlatDirectStorageLayout } from './0002-flat-direct-storage-layout.ts';
|
|
10
|
+
import type { HashAndIdNTupleStorageLayout } from './0003-hash-and-id-n-tuple-storage-layout.ts';
|
|
11
|
+
import type { HashedNTupleStorageLayout } from './0004-hashed-n-tuple-storage-layout.ts';
|
|
12
|
+
import type { FlatOmitPrefixStorageLayout } from './0006-flat-omit-prefix-storage-layout.ts';
|
|
13
|
+
import type { NTupleOmitPrefixStorageLayout } from './0007-n-tuple-omit-prefix-storage-layout.ts';
|
|
14
|
+
/** Built-in storage layout classes, keyed by class name */
|
|
15
|
+
export type StorageLayout = {
|
|
16
|
+
FlatDirectStorageLayout: typeof FlatDirectStorageLayout;
|
|
17
|
+
FlatOmitPrefixStorageLayout: typeof FlatOmitPrefixStorageLayout;
|
|
18
|
+
HashAndIdNTupleStorageLayout: typeof HashAndIdNTupleStorageLayout;
|
|
19
|
+
HashedNTupleStorageLayout: typeof HashedNTupleStorageLayout;
|
|
20
|
+
NTupleOmitPrefixStorageLayout: typeof NTupleOmitPrefixStorageLayout;
|
|
21
|
+
PathDirectStorageLayout: typeof PathDirectStorageLayout;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AACjG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAElG,2DAA2D;AAC3D,MAAM,MAAM,aAAa,GAAG;IAC1B,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,2BAA2B,EAAE,OAAO,2BAA2B,CAAC;IAChE,4BAA4B,EAAE,OAAO,4BAA4B,CAAC;IAClE,yBAAyB,EAAE,OAAO,yBAAyB,CAAC;IAC5D,6BAA6B,EAAE,OAAO,6BAA6B,CAAC;IACpE,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;CACzD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { PathDirectStorageLayout } from './000N-path-direct-storage-layout.js';
|
|
2
|
+
export { FlatDirectStorageLayout } from './0002-flat-direct-storage-layout.js';
|
|
3
|
+
export { HashAndIdNTupleStorageLayout } from './0003-hash-and-id-n-tuple-storage-layout.js';
|
|
4
|
+
export { HashedNTupleStorageLayout } from './0004-hashed-n-tuple-storage-layout.js';
|
|
5
|
+
export { FlatOmitPrefixStorageLayout } from './0006-flat-omit-prefix-storage-layout.js';
|
|
6
|
+
export { NTupleOmitPrefixStorageLayout } from './0007-n-tuple-omit-prefix-storage-layout.js';
|
|
7
|
+
export { DigestAlgorithm } from './0009-digest-algorithms.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/file.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { OcflObject } from './object.ts';
|
|
2
|
+
export interface FileRef {
|
|
3
|
+
/** Actual path to the file location relative to the ocfl object root. */
|
|
4
|
+
contentPath?: string;
|
|
5
|
+
/** A path that represents a file’s location in the logical state of an object. */
|
|
6
|
+
logicalPath?: string;
|
|
7
|
+
/** An algorithmic characterization of the contents of a file conforming to a standard digest algorithm. */
|
|
8
|
+
digest?: string;
|
|
9
|
+
/** Version of the OCFL object. */
|
|
10
|
+
version?: string | undefined;
|
|
11
|
+
/** Last modified time of the file, in milliseconds since the UNIX epoch. */
|
|
12
|
+
lastModified?: number;
|
|
13
|
+
/** Size of the file in bytes. */
|
|
14
|
+
size?: number;
|
|
15
|
+
/** Fixity information of the file. */
|
|
16
|
+
fixity?: {
|
|
17
|
+
[algorithm: string]: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface FileStat {
|
|
21
|
+
/** Size of the file in bytes. */
|
|
22
|
+
size?: number;
|
|
23
|
+
/** Last access time of the file. */
|
|
24
|
+
atime?: Date;
|
|
25
|
+
/** Last modified time of the file. */
|
|
26
|
+
mtime?: Date;
|
|
27
|
+
/** Creation time of the file. */
|
|
28
|
+
ctime?: Date;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Represent a file in an OCFL object
|
|
32
|
+
*/
|
|
33
|
+
declare class OcflObjectFile {
|
|
34
|
+
#private;
|
|
35
|
+
logicalPath?: string;
|
|
36
|
+
contentPath?: string;
|
|
37
|
+
digest?: string;
|
|
38
|
+
version?: string;
|
|
39
|
+
fixity?: {
|
|
40
|
+
[algorithm: string]: string;
|
|
41
|
+
};
|
|
42
|
+
constructor(ocflObject: OcflObject, fileRef: FileRef);
|
|
43
|
+
/**
|
|
44
|
+
* Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight).
|
|
45
|
+
*/
|
|
46
|
+
get lastModified(): number | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Returns the file size in bytes.
|
|
49
|
+
*/
|
|
50
|
+
get size(): number | undefined;
|
|
51
|
+
toString(): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get the file content as a buffer
|
|
54
|
+
* @param options Options to be passed to underlying data store specific implementation
|
|
55
|
+
*/
|
|
56
|
+
buffer(options?: unknown): Promise<Uint8Array>;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated Use {@link OcflObjectFile.buffer}
|
|
59
|
+
*/
|
|
60
|
+
asBuffer(options?: unknown): Promise<Uint8Array<ArrayBufferLike>>;
|
|
61
|
+
/**
|
|
62
|
+
* Get the file content as a string
|
|
63
|
+
* @param encoding String encoding, default to utf8
|
|
64
|
+
*/
|
|
65
|
+
text(encoding?: BufferEncoding): Promise<string>;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Use {@link OcflObjectFile.text}
|
|
68
|
+
*/
|
|
69
|
+
asString(encoding?: BufferEncoding): Promise<string>;
|
|
70
|
+
/**
|
|
71
|
+
* Get the file content as a ReadableStream
|
|
72
|
+
* @param options Options to be passed to underlying data store specific implementation
|
|
73
|
+
* @deprecated Use {@link OcflObjectFile.stream}
|
|
74
|
+
*/
|
|
75
|
+
asStream(options?: unknown): Promise<ReadableStream>;
|
|
76
|
+
/**
|
|
77
|
+
* Get the file content as a ES Streams standard ReadableStream
|
|
78
|
+
* @param options Options to be passed to underlying data store specific implementation
|
|
79
|
+
*/
|
|
80
|
+
stream(options?: unknown): Promise<ReadableStream>;
|
|
81
|
+
/**
|
|
82
|
+
* Get the file stat info
|
|
83
|
+
*/
|
|
84
|
+
stat(_options?: unknown): Promise<FileStat>;
|
|
85
|
+
}
|
|
86
|
+
export { OcflObjectFile };
|
|
87
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../src/file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,OAAO;IACtB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2GAA2G;IAC3G,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,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IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEhD;CACF;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/file.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
const REF_KEYS = ['logicalPath', 'version', 'digest', 'contentPath'];
|
|
2
|
+
/**
|
|
3
|
+
* Represent a file in an OCFL object
|
|
4
|
+
*/
|
|
5
|
+
class OcflObjectFile {
|
|
6
|
+
#ocflObject;
|
|
7
|
+
#lastModified;
|
|
8
|
+
#size;
|
|
9
|
+
logicalPath;
|
|
10
|
+
contentPath;
|
|
11
|
+
digest;
|
|
12
|
+
version;
|
|
13
|
+
fixity;
|
|
14
|
+
constructor(ocflObject, fileRef) {
|
|
15
|
+
this.#ocflObject = ocflObject;
|
|
16
|
+
if (fileRef.logicalPath) {
|
|
17
|
+
this.logicalPath = fileRef.logicalPath;
|
|
18
|
+
}
|
|
19
|
+
if (fileRef.contentPath) {
|
|
20
|
+
this.contentPath = fileRef.contentPath;
|
|
21
|
+
}
|
|
22
|
+
if (fileRef.digest) {
|
|
23
|
+
this.digest = fileRef.digest;
|
|
24
|
+
}
|
|
25
|
+
if (fileRef.version) {
|
|
26
|
+
this.version = fileRef.version;
|
|
27
|
+
}
|
|
28
|
+
if (fileRef.lastModified != null) {
|
|
29
|
+
this.#lastModified = fileRef.lastModified;
|
|
30
|
+
}
|
|
31
|
+
if (fileRef.size != null) {
|
|
32
|
+
this.#size = fileRef.size;
|
|
33
|
+
}
|
|
34
|
+
if (fileRef.fixity != null) {
|
|
35
|
+
this.fixity = fileRef.fixity;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Resolve contentPath given either the `logicalPath` and `version`, `digest`, or `contentPath`.
|
|
40
|
+
*/
|
|
41
|
+
async #resolveContentPath() {
|
|
42
|
+
let contentPath = this.contentPath;
|
|
43
|
+
if (!contentPath) {
|
|
44
|
+
const inv = await this.#ocflObject._requireInventory();
|
|
45
|
+
const version = !this.version || this.version === 'latest' ? inv.head : this.version;
|
|
46
|
+
contentPath = this.digest ? inv.getContentPath(this.digest) : this.logicalPath && inv.getFile(this.logicalPath, version)?.contentPath;
|
|
47
|
+
if (!contentPath) {
|
|
48
|
+
throw new Error(`Cannot find content "${this.toString()}" in the OCFL Object "${this.#ocflObject.id}" version "${this.version || 'latest'}"`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return contentPath;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight).
|
|
55
|
+
*/
|
|
56
|
+
get lastModified() {
|
|
57
|
+
return this.#lastModified;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Returns the file size in bytes.
|
|
61
|
+
*/
|
|
62
|
+
get size() {
|
|
63
|
+
return this.#size;
|
|
64
|
+
}
|
|
65
|
+
toString() {
|
|
66
|
+
const props = REF_KEYS.filter((key) => this[key]).map((key) => `${key}: '${this[key]}'`);
|
|
67
|
+
return `{ ${props.join(', ')} }`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get the file content as a buffer
|
|
71
|
+
* @param options Options to be passed to underlying data store specific implementation
|
|
72
|
+
*/
|
|
73
|
+
async buffer(options) {
|
|
74
|
+
return this.#ocflObject.readFile(await this.#resolveContentPath(), options);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @deprecated Use {@link OcflObjectFile.buffer}
|
|
78
|
+
*/
|
|
79
|
+
async asBuffer(options) {
|
|
80
|
+
return this.buffer(options);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get the file content as a string
|
|
84
|
+
* @param encoding String encoding, default to utf8
|
|
85
|
+
*/
|
|
86
|
+
async text(encoding = 'utf8') {
|
|
87
|
+
return this.#ocflObject.readFile(await this.#resolveContentPath(), encoding);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated Use {@link OcflObjectFile.text}
|
|
91
|
+
*/
|
|
92
|
+
async asString(encoding = 'utf8') {
|
|
93
|
+
return this.text(encoding);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get the file content as a ReadableStream
|
|
97
|
+
* @param options Options to be passed to underlying data store specific implementation
|
|
98
|
+
* @deprecated Use {@link OcflObjectFile.stream}
|
|
99
|
+
*/
|
|
100
|
+
async asStream(options) {
|
|
101
|
+
return this.stream(options);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get the file content as a ES Streams standard ReadableStream
|
|
105
|
+
* @param options Options to be passed to underlying data store specific implementation
|
|
106
|
+
*/
|
|
107
|
+
async stream(options) {
|
|
108
|
+
return this.#ocflObject.createReadable(await this.#resolveContentPath(), options);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get the file stat info
|
|
112
|
+
*/
|
|
113
|
+
async stat(_options) {
|
|
114
|
+
return this.#ocflObject.stat(await this.#resolveContentPath());
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export { OcflObjectFile };
|
|
118
|
+
//# sourceMappingURL=file.js.map
|
package/dist/file.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../src/file.ts"],"names":[],"mappings":"AA8BA,MAAM,QAAQ,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,CAAU,CAAC;AAE9E;;GAEG;AACH,MAAM,cAAc;IAClB,WAAW,CAAa;IACxB,aAAa,CAAqB;IAClC,KAAK,CAAqB;IAC1B,WAAW,CAAU;IACrB,WAAW,CAAU;IACrB,MAAM,CAAU;IAChB,OAAO,CAAU;IACjB,MAAM,CAAmC;IAEzC,YAAY,UAAsB,EAAE,OAAgB;QAClD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,OAAO,CAAC,WAAW,EAAE,CA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