@voltro/plugin-storage 0.87.0 → 0.88.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/CHANGELOG.md +169 -6
- package/THIRD-PARTY-NOTICES.md +1542 -368
- package/dist/access.js +1 -2
- package/dist/assetRef.js +1 -2
- package/dist/avatar.js +1 -2
- package/dist/byteSecurity.js +1 -2
- package/dist/connection.js +1 -2
- package/dist/constraints.js +1 -2
- package/dist/custody.js +1 -2
- package/dist/derivatives.js +1 -2
- package/dist/env.js +1 -2
- package/dist/grant.js +1 -2
- package/dist/index.js +1 -2
- package/dist/ingest.js +1 -2
- package/dist/metadataError.js +1 -2
- package/dist/objectAbandon.js +1 -2
- package/dist/objectLifecycle.js +1 -2
- package/dist/objectMetadata.js +1 -2
- package/dist/objectWriter.js +1 -2
- package/dist/pathDurability.js +1 -2
- package/dist/physicalReferences.js +1 -2
- package/dist/providers.js +1 -2
- package/dist/referenceCatalogue.js +1 -2
- package/dist/renditionProof.js +1 -2
- package/dist/retainedCapture.js +1 -2
- package/dist/retainedObjects.js +1 -2
- package/dist/rpc.js +1 -2
- package/dist/scanners.js +1 -2
- package/dist/service.js +1 -2
- package/dist/sourceIdentity.js +1 -2
- package/dist/sourcePin.js +1 -2
- package/dist/storageNamespaces.js +1 -2
- package/dist/storageNumbers.js +1 -2
- package/dist/storageObjectNamespaces.js +1 -2
- package/dist/storageReferenceInstances.js +1 -2
- package/dist/storageRequest.js +1 -2
- package/dist/storageRouting.js +1 -2
- package/dist/streamBridge.js +1 -2
- package/dist/table.js +1 -2
- package/dist/transcodeVideo.js +1 -2
- package/dist/transform.js +1 -2
- package/dist/transformCache.js +1 -2
- package/dist/types.js +1 -2
- package/package.json +11 -11
package/dist/access.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect as e } from "effect";
|
|
2
2
|
import { randomBytes as t, scryptSync as n, timingSafeEqual as r } from "node:crypto";
|
|
3
|
-
|
|
3
|
+
// src/access.ts
|
|
4
4
|
var i = (e) => {
|
|
5
5
|
let r = t(16).toString("hex");
|
|
6
6
|
return `${r}:${n(e, r, 32).toString("hex")}`;
|
|
@@ -43,5 +43,4 @@ var i = (e) => {
|
|
|
43
43
|
let a = m(t, n);
|
|
44
44
|
return e.some((e) => e.expiresAt && e.expiresAt.getTime() < i || r === "write" && e.permission !== "write" ? !1 : a.some((t) => t.type === e.principalType && t.id === e.principalId));
|
|
45
45
|
}, g = (t, n) => n.resolveGroups ? e.promise(async () => await n.resolveGroups(t)) : e.succeed(u(t));
|
|
46
|
-
//#endregion
|
|
47
46
|
export { f as evaluatePolicy, h as grantsAllow, i as hashPassword, g as resolveSubjectGroups, m as subjectPrincipals, a as verifyPassword };
|
package/dist/assetRef.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _voltroStorageRefsTable as e } from "./table.js";
|
|
2
2
|
import { mixin as t, reference as n, text as r } from "@voltro/database";
|
|
3
|
-
|
|
3
|
+
// src/assetRef.ts
|
|
4
4
|
function i(t = {}) {
|
|
5
5
|
let i = t.nullable ?? !0, a = t.fk === !1 ? r().externalId() : n(() => e, { onDelete: t.onDelete ?? "setNull" });
|
|
6
6
|
return i ? a.nullable() : a;
|
|
@@ -9,5 +9,4 @@ var a = () => t({
|
|
|
9
9
|
id: "@voltro/plugin-storage/withStorage",
|
|
10
10
|
fields: { asset: i() }
|
|
11
11
|
});
|
|
12
|
-
//#endregion
|
|
13
12
|
export { i as assetRef, a as withStorage };
|
package/dist/avatar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StorageError as e } from "./types.js";
|
|
2
2
|
import { Effect as t } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/avatar.ts
|
|
4
4
|
var n = {
|
|
5
5
|
"image/png": "png",
|
|
6
6
|
"image/jpeg": "jpg",
|
|
@@ -35,5 +35,4 @@ var n = {
|
|
|
35
35
|
key: `avatars/${a.userId}/avatar.${s}`
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
|
-
//#endregion
|
|
39
38
|
export { r as decodeDataUri, i as putAvatar };
|
package/dist/byteSecurity.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// src/byteSecurity.ts
|
|
2
2
|
var e = /^(?:image\/(?!svg)|video\/|audio\/|application\/pdf(?:;|$)|text\/plain(?:;|$))/i, t = (t) => ({
|
|
3
3
|
"x-content-type-options": "nosniff",
|
|
4
4
|
"content-disposition": e.test(t) ? "inline" : "attachment"
|
|
5
5
|
});
|
|
6
|
-
//#endregion
|
|
7
6
|
export { t as storageByteSecurityHeaders };
|
package/dist/connection.js
CHANGED
|
@@ -2,7 +2,7 @@ import { storageObjectNamespace as e } from "./storageNamespaces.js";
|
|
|
2
2
|
import { azureConnectionTransport as t, databaseProvider as n, filesystemProvider as r, memoryProviderWithState as i, s3ConnectionTransport as a } from "./providers.js";
|
|
3
3
|
import { StorageError as o } from "@voltro/kv/storage";
|
|
4
4
|
import { Effect as s } from "effect";
|
|
5
|
-
|
|
5
|
+
// src/connection.ts
|
|
6
6
|
var c = (t, n = "") => {
|
|
7
7
|
if (!n) return t;
|
|
8
8
|
let r = (e) => `${n}${e}`;
|
|
@@ -95,5 +95,4 @@ var c = (t, n = "") => {
|
|
|
95
95
|
provider: c(u.provider, e.keyPrefix)
|
|
96
96
|
});
|
|
97
97
|
});
|
|
98
|
-
//#endregion
|
|
99
98
|
export { l as connectStorage, c as withStorageKeyPrefix };
|
package/dist/constraints.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/constraints.ts
|
|
2
2
|
var e = (e, t) => {
|
|
3
3
|
if (!t || t.length === 0) return !0;
|
|
4
4
|
let n = e.toLowerCase();
|
|
@@ -89,5 +89,4 @@ var e = (e, t) => {
|
|
|
89
89
|
reason: "content-type-not-allowed",
|
|
90
90
|
detail: `content type '${r}' is not in the allow-list`
|
|
91
91
|
} : null;
|
|
92
|
-
//#endregion
|
|
93
92
|
export { r as checkLimits, e as contentTypeAllowed, n as sniffMatches };
|
package/dist/custody.js
CHANGED
|
@@ -4,7 +4,7 @@ import { readRetainedStorageObject as n } from "./retainedObjects.js";
|
|
|
4
4
|
import { abandonRetainedCapture as r, admitRetainedCaptureObject as i, inspectRetainedSource as a, registerRetainedCapture as o, retainedCaptureItems as s, runRetainedCapture as c, sealRetainedCapture as l } from "./retainedCapture.js";
|
|
5
5
|
import { Context as u, Effect as d, Layer as f, Schema as p, Stream as m } from "effect";
|
|
6
6
|
import { canonicalJson as h, pluginInstanceName as g } from "@voltro/protocol";
|
|
7
|
-
|
|
7
|
+
// src/custody.ts
|
|
8
8
|
var _ = "@voltro/plugin-storage", v = (e) => g({
|
|
9
9
|
base: _,
|
|
10
10
|
alias: e.alias,
|
|
@@ -128,5 +128,4 @@ var _ = "@voltro/plugin-storage", v = (e) => g({
|
|
|
128
128
|
};
|
|
129
129
|
return E.set(D, e), D;
|
|
130
130
|
}, O = (e) => f.succeed(b.forInstance(e.selection), D(e));
|
|
131
|
-
//#endregion
|
|
132
131
|
export { b as StorageCustody, O as storageCustodyLayer };
|
package/dist/derivatives.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isTransformable as e, loadSharp as t } from "./transform.js";
|
|
2
|
-
|
|
2
|
+
// src/derivatives.ts
|
|
3
3
|
var n = async (n, r, i) => {
|
|
4
4
|
if (!e(r)) return { bytes: n };
|
|
5
5
|
let a = await t();
|
|
@@ -26,5 +26,4 @@ var n = async (n, r, i) => {
|
|
|
26
26
|
return { bytes: n };
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
//#endregion
|
|
30
29
|
export { n as extractImageMetadata };
|
package/dist/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pluginEnv as e } from "@voltro/env";
|
|
2
|
-
|
|
2
|
+
// src/env.ts
|
|
3
3
|
var t = e([
|
|
4
4
|
{
|
|
5
5
|
name: "STORAGE_PROVIDER",
|
|
@@ -158,5 +158,4 @@ var t = e([
|
|
|
158
158
|
description: "clamd port for the optional clamav virus scanner. Default 3310."
|
|
159
159
|
}
|
|
160
160
|
]);
|
|
161
|
-
//#endregion
|
|
162
161
|
export { t as storageEnv };
|
package/dist/grant.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Exit as t, Schema as n } from "effect";
|
|
|
3
3
|
import { createHmac as r, timingSafeEqual as i } from "node:crypto";
|
|
4
4
|
import { StorageAccessPolicySchema as a } from "@voltro/protocol";
|
|
5
5
|
import { noteConfigured as o, noteSigned as s, noteSigningLifetime as c, previousAccepted as l, resolveSessionSecrets as u } from "@voltro/protocol/session";
|
|
6
|
-
|
|
6
|
+
// src/grant.ts
|
|
7
7
|
var d = () => {
|
|
8
8
|
let t = e.read("VOLTRO_STORAGE_SECRET");
|
|
9
9
|
if (t !== void 0 && t !== "") {
|
|
@@ -128,5 +128,4 @@ var d = () => {
|
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
//#endregion
|
|
132
131
|
export { p as declareStorageSigningLifetime, m as resolveStorageSecret, d as resolveStorageSecrets, w as signFinalizeTicket, y as signGrant, O as signMultipartTicket, E as signResumableTicket, S as signUploadTicket, T as verifyFinalizeTicket, b as verifyGrant, k as verifyMultipartTicket, D as verifyResumableTicket, C as verifyUploadTicket };
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ import { processIdentity as _t } from "@voltro/protocol/identity";
|
|
|
35
35
|
import { StorageAccessPolicySchema as vt, definePlugin as yt, effectiveScopes as bt, pluginInstanceName as xt } from "@voltro/protocol";
|
|
36
36
|
import { readCookie as St, resolveSessionSecrets as Ct, verifySessionKeyed as wt } from "@voltro/protocol/session";
|
|
37
37
|
import { ifRangeAllowsRange as Tt, parseByteRange as Et } from "@voltro/runtime/http-range";
|
|
38
|
-
|
|
38
|
+
// src/index.ts
|
|
39
39
|
var Dt = E.read("VOLTRO_SESSION_COOKIE") ?? "voltro:session", Ot = (e) => {
|
|
40
40
|
let t = e.filter((e) => e.capabilities?.storageProvider !== void 0);
|
|
41
41
|
if (t.length > 1) throw new g({
|
|
@@ -1492,5 +1492,4 @@ var Dt = E.read("VOLTRO_SESSION_COOKIE") ?? "voltro:session", Ot = (e) => {
|
|
|
1492
1492
|
});
|
|
1493
1493
|
return n;
|
|
1494
1494
|
};
|
|
1495
|
-
//#endregion
|
|
1496
1495
|
export { c as STORAGE_BLOBS_TABLE, l as STORAGE_GRANTS_TABLE, a as STORAGE_REFERENCE_CATALOGUE_TABLE, u as STORAGE_REFS_TABLE, d as STORAGE_USAGE_TABLE, ne as StorageAccessDenied, ct as StorageAddress, Fe as StorageCustody, g as StorageError, re as StorageRejected, ie as StorageScanRejected, _ as StorageService, ee as _voltroStorageBlobsTable, f as _voltroStorageGrantsTable, p as _voltroStorageRefsTable, m as _voltroStorageUsageTable, Wt as appStorageObjects, jt as appStorageProvider, e as appStorageRouter, et as assetRef, y as assignStorageObjectNamespacesInTransaction, h as assignStorageReferenceInstancesInTransaction, D as azureProvider, Te as buildStorageService, b as bytesToStream, V as checkLimits, U as clamavScanner, O as clearStorageBuffer, x as collectStream, S as concatBytes, kt as configuredStorageProvider, ot as connectStorage, Ce as contentTypeAllowed, Ee as dataStoreGrantStore, De as dataStoreRefStore, k as databaseProvider, nt as decodeDataUri, it as durabilityNotice, ue as editImage, W as encodeInstream, o as ensureStorageReferenceCatalogue, r as existingFilesystemObjectNamespace, H as fetchIngestBody, K as ffmpegTranscoder, A as filesystemProvider, C as fromNodeReadable, ce as getObjectStream, F as hashPassword, ut as isStorageKey, t as makeStorageDestinationRouter, Me as makeStorageObjectMetadata, Oe as memoryGrantStore, j as memoryProvider, ke as memoryRefStore, G as parseClamavResponse, de as parseTransformParams, at as pathDurability, rt as putAvatar, w as putObjectStream, N as readStorageBuffer, Ae as refMatchesListQuery, se as requireStorageObjectNamespaces, X as resolveStorageProvider, L as resolveStorageSecret, Pe as retainedCaptureTables, P as s3Provider, ge as signFinalizeTicket, R as signGrant, _e as signMultipartTicket, ve as signResumableTicket, z as signUploadTicket, we as sniffMatches, dt as storageAddressIdentity, n as storageByteSecurityHeaders, Mt as storageEgressOf, Vt as storageInstanceName, oe as storageObjectLifecycleTables, i as storageObjectNamespace, Ut as storagePlugin, Ne as storagePutIntentsTable, v as storageRefAddress, s as storageReferenceCatalogueTable, je as storageServiceLayer, T as toNodeReadable, fe as transformCached, pe as transformFallbackReason, me as transformImage, ye as verifyFinalizeTicket, be as verifyGrant, B as verifyMultipartTicket, I as verifyPassword, xe as verifyResumableTicket, Se as verifyUploadTicket, tt as withStorage, st as withStorageKeyPrefix };
|
package/dist/ingest.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StorageError as e, StorageRejected as t } from "./types.js";
|
|
2
2
|
import { Effect as n } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/ingest.ts
|
|
4
4
|
var r = 67108864, i = (e) => new t({
|
|
5
5
|
reason: "too-large",
|
|
6
6
|
detail: `remote body exceeds the ${e}-byte ingest limit`
|
|
@@ -83,5 +83,4 @@ var r = 67108864, i = (e) => new t({
|
|
|
83
83
|
});
|
|
84
84
|
return n.raceFirst(e, r);
|
|
85
85
|
});
|
|
86
|
-
//#endregion
|
|
87
86
|
export { o as fetchIngestBody, s as withIngestAbort };
|
package/dist/metadataError.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StorageError as e, StorageRejected as t } from "./types.js";
|
|
2
2
|
import { Schema as n } from "effect";
|
|
3
3
|
import { causeBranches as r, extractDbCause as i, isTransientContention as a, wireSafeCause as o } from "@voltro/database";
|
|
4
|
-
|
|
4
|
+
// src/metadataError.ts
|
|
5
5
|
var s = (t, s, c = !1) => {
|
|
6
6
|
let l = r(t).find(n.is(e));
|
|
7
7
|
if (l !== void 0) return l;
|
|
@@ -15,5 +15,4 @@ var s = (t, s, c = !1) => {
|
|
|
15
15
|
configurable: !0
|
|
16
16
|
}), f;
|
|
17
17
|
}, c = (e) => r(e).find(n.is(t));
|
|
18
|
-
//#endregion
|
|
19
18
|
export { s as storageMetadataError, c as storageRejectedCause };
|
package/dist/objectAbandon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { storageMetadataError as e } from "./metadataError.js";
|
|
2
2
|
import { beginStorageObjectAbandon as t, makeStorageObjectMetadata as n } from "./objectMetadata.js";
|
|
3
3
|
import { Effect as r } from "effect";
|
|
4
|
-
|
|
4
|
+
// src/objectAbandon.ts
|
|
5
5
|
var i = (t) => r.tryPromise({
|
|
6
6
|
try: t,
|
|
7
7
|
catch: (t) => e(t, "metadata")
|
|
@@ -12,5 +12,4 @@ var i = (t) => r.tryPromise({
|
|
|
12
12
|
refId: r.operation.refId
|
|
13
13
|
}) : r;
|
|
14
14
|
});
|
|
15
|
-
//#endregion
|
|
16
15
|
export { a as abandonStorageObject };
|
package/dist/objectLifecycle.js
CHANGED
|
@@ -4,7 +4,7 @@ import { storageInteger as n, storageIntegerSum as r } from "./storageNumbers.js
|
|
|
4
4
|
import { Schema as i } from "effect";
|
|
5
5
|
import { createHash as a, randomUUID as o } from "node:crypto";
|
|
6
6
|
import { and as s, bigint as c, eq as l, neq as u, table as d, text as f } from "@voltro/database";
|
|
7
|
-
|
|
7
|
+
// src/objectLifecycle.ts
|
|
8
8
|
var p = "_voltro_storage_operation_locks", m = "_voltro_storage_object_heads", h = "_voltro_storage_operations", g = "_voltro_storage_object_claims", _ = [
|
|
9
9
|
d(p, {
|
|
10
10
|
id: f().maxLength(64),
|
|
@@ -239,5 +239,4 @@ var p = "_voltro_storage_operation_locks", m = "_voltro_storage_object_heads", h
|
|
|
239
239
|
})).length > 0
|
|
240
240
|
};
|
|
241
241
|
}, R = (e, t) => e.deleteMany(g, { where: l("operationId", t) });
|
|
242
|
-
//#endregion
|
|
243
242
|
export { P as beginStorageObjectAbandonInTransaction, N as beginStorageObjectDeleteInTransaction, I as claimStorageObjectInTransaction, R as clearStorageObjectClaimsInTransaction, F as confirmStorageObjectDeleteInTransaction, j as confirmStorageObjectInTransaction, E as hasStorageObjectClaimInTransaction, T as lookupStorageObjectOperationInTransaction, k as readStorageObjectOperationInTransaction, L as releaseStorageObjectClaimInTransaction, A as reserveStorageObjectInTransaction, S as storageObjectClaimId, D as storageObjectIdentifiers, _ as storageObjectLifecycleTables, w as storageObjectOperationId, O as withStorageOperationTransaction };
|
package/dist/objectMetadata.js
CHANGED
|
@@ -5,7 +5,7 @@ import { dataStoreGrantStore as _, dataStoreRefStore as v, toRef as y } from "./
|
|
|
5
5
|
import { StorageAddress as b } from "@voltro/kv/storage";
|
|
6
6
|
import { Effect as x, Schema as S } from "effect";
|
|
7
7
|
import { and as C, eq as w, json as T, table as E, text as D } from "@voltro/database";
|
|
8
|
-
|
|
8
|
+
// src/objectMetadata.ts
|
|
9
9
|
var O = "_voltro_storage_put_intents", k = E(O, {
|
|
10
10
|
id: D().maxLength(64),
|
|
11
11
|
refId: D().maxLength(64),
|
|
@@ -304,5 +304,4 @@ var O = "_voltro_storage_put_intents", k = E(O, {
|
|
|
304
304
|
confirmDelete: async (e) => (await c(e)).confirmDelete(e)
|
|
305
305
|
};
|
|
306
306
|
}, I = (e, t, n) => F(e, t, n);
|
|
307
|
-
//#endregion
|
|
308
307
|
export { N as beginStorageObjectAbandon, I as makeAdmittedStorageObjectMetadata, F as makeStorageObjectMetadata, k as storagePutIntentsTable };
|
package/dist/objectWriter.js
CHANGED
|
@@ -3,7 +3,7 @@ import { putObjectStream as n } from "./streamBridge.js";
|
|
|
3
3
|
import { storageMetadataError as r, storageRejectedCause as i } from "./metadataError.js";
|
|
4
4
|
import { Effect as a, Stream as o } from "effect";
|
|
5
5
|
import { createHash as s } from "node:crypto";
|
|
6
|
-
|
|
6
|
+
// src/objectWriter.ts
|
|
7
7
|
var c = (c) => {
|
|
8
8
|
let l = (t) => a.gen(function* () {
|
|
9
9
|
(yield* c.provider.objectNamespace) !== (yield* a.tryPromise({
|
|
@@ -83,5 +83,4 @@ var c = (c) => {
|
|
|
83
83
|
})
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
-
//#endregion
|
|
87
86
|
export { c as makeStorageObjectWriter };
|
package/dist/pathDurability.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { statSync as e } from "node:fs";
|
|
2
|
-
|
|
2
|
+
// src/pathDurability.ts
|
|
3
3
|
var t = (t) => {
|
|
4
4
|
try {
|
|
5
5
|
let n = e(t), r = e("/");
|
|
@@ -12,5 +12,4 @@ var t = (t) => {
|
|
|
12
12
|
dies with it — which is the exact failure it exists for. On a development machine this is normal
|
|
13
13
|
and can be ignored.`;
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { n as durabilityNotice, t as pathDurability };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StorageError as e } from "@voltro/kv/storage";
|
|
2
2
|
import { Effect as t } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/physicalReferences.ts
|
|
4
4
|
var n = (n, r, i, a) => {
|
|
5
5
|
let o = (o, s) => t.gen(function* () {
|
|
6
6
|
let c = (yield* r.listObjectReferences()).filter((e) => !s || e.visibility === "public"), l = yield* n.objectNamespace;
|
|
@@ -50,5 +50,4 @@ var n = (n, r, i, a) => {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
//#endregion
|
|
54
53
|
export { n as protectStorageReferences };
|
package/dist/providers.js
CHANGED
|
@@ -10,7 +10,7 @@ import { storageRequest as p } from "./storageRequest.js";
|
|
|
10
10
|
import { Effect as m } from "effect";
|
|
11
11
|
import { randomUUID as h } from "node:crypto";
|
|
12
12
|
import { authoredError as g, generateId as _ } from "@voltro/database";
|
|
13
|
-
|
|
13
|
+
// src/providers.ts
|
|
14
14
|
var v = (e, t, n, r) => new o({
|
|
15
15
|
provider: e,
|
|
16
16
|
message: t,
|
|
@@ -634,5 +634,4 @@ var v = (e, t, n, r) => new o({
|
|
|
634
634
|
})
|
|
635
635
|
};
|
|
636
636
|
};
|
|
637
|
-
//#endregion
|
|
638
637
|
export { N as azureConnectionTransport, M as azureProvider, w as clearStorageBuffer, j as databaseProvider, D as filesystemProvider, T as memoryProvider, E as memoryProviderWithState, C as readStorageBuffer, k as s3ConnectionTransport, O as s3Provider };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { storageObjectNamespace as e } from "./storageNamespaces.js";
|
|
2
2
|
import { randomUUID as t } from "node:crypto";
|
|
3
3
|
import { authoredError as n, eq as r, table as i, text as a } from "@voltro/database";
|
|
4
|
-
|
|
4
|
+
// src/referenceCatalogue.ts
|
|
5
5
|
var o = "_voltro_storage_reference_catalogue", s = i(o, {
|
|
6
6
|
id: a().maxLength(64),
|
|
7
7
|
namespace: a().maxLength(64)
|
|
@@ -27,5 +27,4 @@ var o = "_voltro_storage_reference_catalogue", s = i(o, {
|
|
|
27
27
|
i.objectNamespace
|
|
28
28
|
]) : s;
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { o as STORAGE_REFERENCE_CATALOGUE_TABLE, c as ensureStorageReferenceCatalogue, l as storageReferenceCatalogueId, s as storageReferenceCatalogueTable };
|
package/dist/renditionProof.js
CHANGED
|
@@ -2,7 +2,7 @@ import { StorageError as e } from "./types.js";
|
|
|
2
2
|
import { retainedSourceDigest as t } from "./sourceIdentity.js";
|
|
3
3
|
import { createHash as n } from "node:crypto";
|
|
4
4
|
import { canonicalJson as r } from "@voltro/protocol";
|
|
5
|
-
|
|
5
|
+
// src/renditionProof.ts
|
|
6
6
|
var i = (e) => n("sha256").update(r(e)).digest("hex"), a = (e) => n("sha256").update(e).digest("hex"), o = (e) => typeof e == "string" && /^[a-f0-9]{64}$/.test(e), s = (e, t) => typeof e == "string" && e.length > 0 && e.length <= t, c = () => {
|
|
7
7
|
throw new e({
|
|
8
8
|
provider: "transcode",
|
|
@@ -78,5 +78,4 @@ var i = (e) => n("sha256").update(r(e)).digest("hex"), a = (e) => n("sha256").up
|
|
|
78
78
|
...e,
|
|
79
79
|
renditionProof: f(e.renditionProof, e)
|
|
80
80
|
};
|
|
81
|
-
//#endregion
|
|
82
81
|
export { f as assertRenditionOutput, l as copyRenditionDerivation, u as makeRenditionProof, p as ownRenditionRef, d as readRenditionProof };
|
package/dist/retainedCapture.js
CHANGED
|
@@ -11,7 +11,7 @@ import { Effect as f, Schema as p, Stream as m } from "effect";
|
|
|
11
11
|
import { createHash as h, randomUUID as g } from "node:crypto";
|
|
12
12
|
import { and as _, eq as v, gt as y, integer as b, json as x, table as S, text as C } from "@voltro/database";
|
|
13
13
|
import { canonicalJson as w } from "@voltro/protocol";
|
|
14
|
-
|
|
14
|
+
// src/retainedCapture.ts
|
|
15
15
|
var T = "_voltro_storage_retained_captures", E = "_voltro_storage_retained_capture_items", D = [S(T, {
|
|
16
16
|
id: C().maxLength(64),
|
|
17
17
|
captureId: C().maxLength(64),
|
|
@@ -387,5 +387,4 @@ var T = "_voltro_storage_retained_captures", E = "_voltro_storage_retained_captu
|
|
|
387
387
|
let a = V(t, i);
|
|
388
388
|
if (a.pin === null || w(a.pin) !== w(n)) return k("integrity");
|
|
389
389
|
};
|
|
390
|
-
//#endregion
|
|
391
390
|
export { T as RETAINED_CAPTURES, E as RETAINED_CAPTURE_ITEMS, O as RetainedCaptureUnavailable, J as abandonRetainedCapture, X as admitRetainedCaptureObject, U as inspectRetainedSource, W as registerRetainedCapture, Y as retainedCaptureItems, D as retainedCaptureTables, K as runRetainedCapture, q as sealRetainedCapture };
|
package/dist/retainedObjects.js
CHANGED
|
@@ -12,7 +12,7 @@ import { join as m } from "node:path";
|
|
|
12
12
|
import { canonicalJson as h } from "@voltro/protocol";
|
|
13
13
|
import { mkdtemp as g, rm as _ } from "node:fs/promises";
|
|
14
14
|
import { tmpdir as v } from "node:os";
|
|
15
|
-
|
|
15
|
+
// src/retainedObjects.ts
|
|
16
16
|
var y = class extends d.TaggedError()("RetainedObjectUnavailable", { reason: d.Literals([
|
|
17
17
|
"scope",
|
|
18
18
|
"source",
|
|
@@ -186,5 +186,4 @@ var y = class extends d.TaggedError()("RetainedObjectUnavailable", { reason: d.L
|
|
|
186
186
|
force: !0
|
|
187
187
|
}))));
|
|
188
188
|
});
|
|
189
|
-
//#endregion
|
|
190
189
|
export { y as RetainedObjectUnavailable, k as readRetainedStorageObject, A as retainStorageObject, D as retainedPinMatches };
|
package/dist/rpc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StorageAccessDenied as e, StorageError as t, StorageRejected as n, StorageScanRejected as r } from "./types.js";
|
|
2
2
|
import { Schema as i } from "effect";
|
|
3
3
|
import { StorageAccessPolicySchema as a, defineAction as o, defineMutation as s, defineQuery as c } from "@voltro/protocol";
|
|
4
|
-
|
|
4
|
+
// src/rpc.ts
|
|
5
5
|
var l = i.Literals([
|
|
6
6
|
"user",
|
|
7
7
|
"group",
|
|
@@ -400,5 +400,4 @@ var l = i.Literals([
|
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
];
|
|
403
|
-
//#endregion
|
|
404
403
|
export { C as abortMultipartUploadDescriptor, b as beginMultipartUploadDescriptor, y as beginResumableUploadDescriptor, S as completeMultipartUploadDescriptor, v as finalizeUploadDescriptor, T as ingestUrlDescriptor, O as listGrantsDescriptor, p as listRefsDescriptor, _ as mintPresignedUploadDescriptor, g as mintUploadTicketDescriptor, h as mintUploadUrlDescriptor, m as mintUrlDescriptor, D as revokeDescriptor, E as shareDescriptor, x as signMultipartPartDescriptor, k as storageRpcClientImports, w as uploadDescriptor };
|
package/dist/scanners.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { storageEnv as e } from "./env.js";
|
|
2
|
-
|
|
2
|
+
// src/scanners.ts
|
|
3
3
|
var t = (e, t = 65536) => {
|
|
4
4
|
let n = [Buffer.from("zINSTREAM\0", "utf8")];
|
|
5
5
|
for (let r = 0; r < e.length; r += t) {
|
|
@@ -42,5 +42,4 @@ var t = (e, t = 65536) => {
|
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
44
|
}, i = (e = {}) => (t) => r(t.bytes, e);
|
|
45
|
-
//#endregion
|
|
46
45
|
export { i as clamavScanner, t as encodeInstream, n as parseClamavResponse };
|
package/dist/service.js
CHANGED
|
@@ -18,7 +18,7 @@ import { StorageAddress as O, storageKeyProblem as k } from "@voltro/kv/storage"
|
|
|
18
18
|
import { Effect as A, Exit as oe, Layer as j, Schedule as M, Schema as N, Stream as se } from "effect";
|
|
19
19
|
import { randomUUID as P } from "node:crypto";
|
|
20
20
|
import { and as F, authoredError as I, column as L, contains as R, eq as z, generateId as B, isNull as V, or as H } from "@voltro/database";
|
|
21
|
-
|
|
21
|
+
// src/service.ts
|
|
22
22
|
var U = async (e) => {
|
|
23
23
|
let { createHash: t } = await import("node:crypto");
|
|
24
24
|
return t("sha256").update(e).digest("hex");
|
|
@@ -1414,5 +1414,4 @@ var U = async (e) => {
|
|
|
1414
1414
|
}).pipe(A.flatMap((t) => A.suspend(() => t.abortMultipartUpload ? t.abortMultipartUpload(e.key, e.uploadId).pipe(A.retry(L)) : A.void)))
|
|
1415
1415
|
};
|
|
1416
1416
|
}, he = (e) => j.succeed(f, me(e));
|
|
1417
|
-
//#endregion
|
|
1418
1417
|
export { me as buildStorageService, de as dataStoreGrantStore, Z as dataStoreRefStore, Q as memoryGrantStore, q as memoryRefStore, G as refMatchesListQuery, he as storageServiceLayer, J as toRef };
|
package/dist/sourceIdentity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash as e } from "node:crypto";
|
|
2
2
|
import { canonicalJson as t } from "@voltro/protocol";
|
|
3
|
-
|
|
3
|
+
// src/sourceIdentity.ts
|
|
4
4
|
var n = (n) => e("sha256").update(t({
|
|
5
5
|
id: n.id,
|
|
6
6
|
tenantId: n.tenantId,
|
|
@@ -10,5 +10,4 @@ var n = (n) => e("sha256").update(t({
|
|
|
10
10
|
size: n.size,
|
|
11
11
|
checksum: n.checksum
|
|
12
12
|
})).digest("hex");
|
|
13
|
-
//#endregion
|
|
14
13
|
export { n as retainedSourceDigest };
|
package/dist/sourcePin.js
CHANGED
|
@@ -3,7 +3,7 @@ import { retainedSourceDigest as t } from "./sourceIdentity.js";
|
|
|
3
3
|
import { ownRenditionRef as n } from "./renditionProof.js";
|
|
4
4
|
import { createHash as r } from "node:crypto";
|
|
5
5
|
import { canonicalJson as i } from "@voltro/protocol";
|
|
6
|
-
|
|
6
|
+
// src/sourcePin.ts
|
|
7
7
|
var a = (e) => r("sha256").update(i(e)).digest("hex"), o = (e, t) => typeof e == "string" && e.length > 0 && e.length <= t, s = (e, t) => e == null || typeof e == "string" && e.length <= t, c = (r, i) => {
|
|
8
8
|
let c = n(r);
|
|
9
9
|
if (!o(i, 256) || !o(c.id, 64) || !o(c.bucket, 128) || c.tenantId !== null && !o(c.tenantId, 64) || !o(c.checksum, 512) || !o(c.contentType, 512) || !Number.isSafeInteger(c.size) || c.size < 0 || !s(c.derivedFrom, 64) || !s(c.kind, 512)) throw new e({
|
|
@@ -31,5 +31,4 @@ var a = (e) => r("sha256").update(i(e)).digest("hex"), o = (e, t) => typeof e ==
|
|
|
31
31
|
digest: a(l)
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
//#endregion
|
|
35
34
|
export { c as pinStorageSource };
|
|
@@ -4,7 +4,7 @@ import { createHash as n, randomUUID as r } from "node:crypto";
|
|
|
4
4
|
import { authoredError as i } from "@voltro/database";
|
|
5
5
|
import { linkSync as a, mkdirSync as o, readFileSync as s, realpathSync as c, rmSync as l, writeFileSync as u } from "node:fs";
|
|
6
6
|
import { basename as d, dirname as f, join as p, resolve as m } from "node:path";
|
|
7
|
-
|
|
7
|
+
// src/storageNamespaces.ts
|
|
8
8
|
var h = (e) => n("sha256").update(JSON.stringify(e)).digest("hex"), g = (n, r) => ("resolveNamespace" in n ? n.resolveNamespace(r) : t.succeed(n.objectNamespace)).pipe(t.flatMap((r) => t.try({
|
|
9
9
|
try: () => {
|
|
10
10
|
let e = {
|
|
@@ -76,5 +76,4 @@ var h = (e) => n("sha256").update(JSON.stringify(e)).digest("hex"), g = (n, r) =
|
|
|
76
76
|
e.objectNamespace
|
|
77
77
|
]);
|
|
78
78
|
};
|
|
79
|
-
//#endregion
|
|
80
79
|
export { b as FILESYSTEM_NAMESPACE_FILE, v as canonicalStorageRoot, S as existingFilesystemObjectNamespace, x as filesystemObjectNamespace, _ as requireStorageReferenceScope, y as storageEndpointIdentity, h as storageObjectNamespace, g as storageReferenceScopeFor, C as storageUploadTicketScope };
|
package/dist/storageNumbers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StorageError as e } from "./types.js";
|
|
2
|
-
|
|
2
|
+
// src/storageNumbers.ts
|
|
3
3
|
var t = (t, n) => {
|
|
4
4
|
let r = typeof t == "number" ? t : typeof t == "bigint" || typeof t == "string" && /^\d+$/.test(t) ? Number(t) : NaN;
|
|
5
5
|
if (!Number.isSafeInteger(r) || r < 0) throw new e({
|
|
@@ -9,5 +9,4 @@ var t = (t, n) => {
|
|
|
9
9
|
});
|
|
10
10
|
return r;
|
|
11
11
|
}, n = (e, n, r) => t(e + n, r);
|
|
12
|
-
//#endregion
|
|
13
12
|
export { t as storageInteger, n as storageIntegerSum };
|
|
@@ -5,7 +5,7 @@ import { storageObjectClaimId as a, storageObjectIdentifiers as o } from "./obje
|
|
|
5
5
|
import { Schema as s } from "effect";
|
|
6
6
|
import { createHash as c } from "node:crypto";
|
|
7
7
|
import { authoredError as l, inSet as u, isNull as d, or as f } from "@voltro/database";
|
|
8
|
-
|
|
8
|
+
// src/storageObjectNamespaces.ts
|
|
9
9
|
var p = "_voltro_storage_put_intents", m = "_voltro_storage_operations", h = "_voltro_storage_object_heads", g = "_voltro_storage_object_claims", _ = [
|
|
10
10
|
n,
|
|
11
11
|
t,
|
|
@@ -239,5 +239,4 @@ var p = "_voltro_storage_put_intents", m = "_voltro_storage_operations", h = "_v
|
|
|
239
239
|
pendingDeletes: K
|
|
240
240
|
};
|
|
241
241
|
};
|
|
242
|
-
//#endregion
|
|
243
242
|
export { D as assignStorageObjectNamespacesInTransaction, O as relocateRestoredStorageObjectNamespacesInTransaction, E as requireStorageObjectNamespaces };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { STORAGE_GRANTS_TABLE as e, STORAGE_REFS_TABLE as t } from "./table.js";
|
|
2
2
|
import { authoredError as n, eq as r, isNull as i } from "@voltro/database";
|
|
3
|
-
|
|
3
|
+
// src/storageReferenceInstances.ts
|
|
4
4
|
var a = "@voltro/plugin-storage", o = [
|
|
5
5
|
t,
|
|
6
6
|
e,
|
|
@@ -48,5 +48,4 @@ var a = "@voltro/plugin-storage", o = [
|
|
|
48
48
|
}
|
|
49
49
|
return { assigned: l };
|
|
50
50
|
};
|
|
51
|
-
//#endregion
|
|
52
51
|
export { a as DEFAULT_STORAGE_INSTANCE, c as assignStorageReferenceInstancesInTransaction, s as requireStorageReferenceOwnership };
|
package/dist/storageRequest.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Effect as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/storageRequest.ts
|
|
3
3
|
var t = (t, n, r) => e.callback((i) => {
|
|
4
4
|
let a = new AbortController(), o = Promise.resolve().then(() => t(a.signal));
|
|
5
5
|
return o.then((t) => i(e.succeed(t)), (t) => i(e.fail(n(t)))), e.sync(() => {
|
|
6
6
|
a.abort();
|
|
7
7
|
}).pipe(e.andThen(e.promise(() => o.then((e) => ({ value: e }), () => void 0))), e.flatMap((t) => t !== void 0 && r !== void 0 ? r(t.value) : e.void));
|
|
8
8
|
});
|
|
9
|
-
//#endregion
|
|
10
9
|
export { t as storageRequest };
|
package/dist/storageRouting.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StorageAddress as e, StorageError as t } from "@voltro/kv/storage";
|
|
2
2
|
import { Effect as n, Schema as r } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/storageRouting.ts
|
|
4
4
|
var i = () => new t({
|
|
5
5
|
provider: "storage",
|
|
6
6
|
message: "Storage destination is unknown, ambiguous or unavailable for this tenant",
|
|
@@ -42,5 +42,4 @@ var i = () => new t({
|
|
|
42
42
|
}))
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
|
-
//#endregion
|
|
46
45
|
export { s as appStorageRouter, o as makeStorageDestinationRouter };
|
package/dist/streamBridge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StorageError as e } from "./types.js";
|
|
2
2
|
import { Effect as t, Stream as n } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/streamBridge.ts
|
|
4
4
|
var r = 1 << 20, i = (t, n, r = !1) => new e({
|
|
5
5
|
provider: t,
|
|
6
6
|
message: n,
|
|
@@ -29,5 +29,4 @@ var r = 1 << 20, i = (t, n, r = !1) => new e({
|
|
|
29
29
|
contentType: i.contentType,
|
|
30
30
|
...i.public === void 0 ? {} : { public: i.public }
|
|
31
31
|
})));
|
|
32
|
-
//#endregion
|
|
33
32
|
export { o as bytesToStream, s as collectStream, a as concatBytes, c as fromNodeReadable, u as getObjectStream, d as putObjectStream, l as toNodeReadable };
|
package/dist/table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bigint as e, bytes as t, id as n, integer as r, json as i, table as a, text as o, timestamp as s } from "@voltro/database";
|
|
2
|
-
|
|
2
|
+
// src/table.ts
|
|
3
3
|
var c = "_voltro_storage_refs", l = "_voltro_storage_grants", u = "_voltro_storage_blobs", d = "_voltro_storage_usage", f = a(c, {
|
|
4
4
|
id: n({ prefix: "file" }),
|
|
5
5
|
storageInstance: o().nullable(),
|
|
@@ -50,5 +50,4 @@ var c = "_voltro_storage_refs", l = "_voltro_storage_grants", u = "_voltro_stora
|
|
|
50
50
|
contentType: o(),
|
|
51
51
|
size: e()
|
|
52
52
|
}).index(["key"]);
|
|
53
|
-
//#endregion
|
|
54
53
|
export { u as STORAGE_BLOBS_TABLE, l as STORAGE_GRANTS_TABLE, c as STORAGE_REFS_TABLE, d as STORAGE_USAGE_TABLE, h as _voltroStorageBlobsTable, p as _voltroStorageGrantsTable, f as _voltroStorageRefsTable, m as _voltroStorageUsageTable };
|
package/dist/transcodeVideo.js
CHANGED
|
@@ -4,7 +4,7 @@ import { canonicalJson as n } from "@voltro/protocol";
|
|
|
4
4
|
import { mkdtemp as r, readFile as i, rm as a, writeFile as o } from "node:fs/promises";
|
|
5
5
|
import { tmpdir as s } from "node:os";
|
|
6
6
|
import { spawn as c } from "node:child_process";
|
|
7
|
-
|
|
7
|
+
// src/transcodeVideo.ts
|
|
8
8
|
var l = (e, t, n) => new Promise((r, i) => {
|
|
9
9
|
let a = c(e, [...t], { stdio: [
|
|
10
10
|
"ignore",
|
|
@@ -87,5 +87,4 @@ var l = (e, t, n) => new Promise((r, i) => {
|
|
|
87
87
|
return g;
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
//#endregion
|
|
91
90
|
export { f as ffmpegTranscoder };
|
package/dist/transform.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTransformCache as e } from "./transformCache.js";
|
|
2
2
|
import { createHash as t } from "node:crypto";
|
|
3
|
-
|
|
3
|
+
// src/transform.ts
|
|
4
4
|
var n = (e, t, n, r, i, a) => {
|
|
5
5
|
let o = n / r, s = Math.min(e, Math.round(t * o)), c = Math.min(t, Math.round(s / o)), l = (e, t) => Math.max(0, Math.min(t, e));
|
|
6
6
|
return {
|
|
@@ -90,5 +90,4 @@ var n = (e, t, n, r, i, a) => {
|
|
|
90
90
|
let n = e();
|
|
91
91
|
return async (e, r, i, a) => n.getOrCreate(d(JSON.stringify([e, t("sha256").update(r).digest("hex")]), i, a), () => l(r, i, a));
|
|
92
92
|
}, p = f();
|
|
93
|
-
//#endregion
|
|
94
93
|
export { f as createTransformCache, u as editImage, n as focalRegion, a as isTransformable, s as loadSharp, i as parseTransformParams, p as transformCached, c as transformFallbackReason, l as transformImage, d as transformKey };
|
package/dist/transformCache.js
CHANGED
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StorageAddress as e, StorageError as t, isStorageKey as n, storageAddressIdentity as r } from "@voltro/kv/storage";
|
|
2
2
|
import { Context as i, Schema as a } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/types.ts
|
|
4
4
|
var o = class extends a.TaggedError()("StorageAccessDenied", {
|
|
5
5
|
refId: a.String,
|
|
6
6
|
reason: a.String
|
|
@@ -16,5 +16,4 @@ var o = class extends a.TaggedError()("StorageAccessDenied", {
|
|
|
16
16
|
tenantId: e.tenantId,
|
|
17
17
|
key: e.key
|
|
18
18
|
});
|
|
19
|
-
//#endregion
|
|
20
19
|
export { o as StorageAccessDenied, e as StorageAddress, t as StorageError, s as StorageRejected, c as StorageScanRejected, l as StorageService, n as isStorageKey, r as storageAddressIdentity, u as storageRefAddress };
|