@voltro/plugin-storage 0.86.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 +5484 -0
- package/README.md +27 -0
- package/THIRD-PARTY-NOTICES.md +2503 -690
- package/dist/access.js +26 -27
- package/dist/assetRef.js +1 -2
- package/dist/avatar.js +1 -2
- package/dist/byteSecurity.d.ts +3 -0
- package/dist/byteSecurity.js +6 -0
- package/dist/connection.js +98 -0
- package/dist/constraints.js +1 -2
- package/dist/custody.js +131 -0
- package/dist/derivatives.js +1 -2
- package/dist/env.js +8 -3
- package/dist/grant.js +90 -71
- package/dist/index.d.ts +453 -215
- package/dist/index.js +709 -537
- package/dist/ingest.js +7 -2
- package/dist/ingestPolicy.js +1 -1
- package/dist/metadataError.js +8 -9
- package/dist/objectAbandon.js +15 -0
- package/dist/objectLifecycle.js +135 -102
- package/dist/objectMetadata.js +253 -96
- package/dist/objectWriter.js +51 -23
- package/dist/pathDurability.js +1 -2
- package/dist/physicalReferences.js +53 -0
- package/dist/providers.js +451 -307
- package/dist/referenceCatalogue.js +1 -2
- package/dist/renditionProof.js +81 -0
- package/dist/retainedCapture.js +390 -0
- package/dist/retainedObjects.js +189 -0
- package/dist/rpc.d.ts +1 -15
- package/dist/rpc.js +1 -2
- package/dist/scanners.js +1 -2
- package/dist/server.d.ts +153 -0
- package/dist/server.js +4 -0
- package/dist/service.js +879 -546
- package/dist/sourceIdentity.js +13 -0
- package/dist/sourcePin.js +34 -0
- package/dist/storageNamespaces.js +52 -29
- package/dist/storageNumbers.js +1 -2
- package/dist/storageObjectNamespaces.js +170 -122
- package/dist/storageReferenceInstances.js +1 -2
- package/dist/storageRequest.js +9 -0
- package/dist/storageRouting.js +45 -0
- package/dist/streamBridge.js +5 -3
- package/dist/table.js +2 -2
- package/dist/transcodeVideo.js +85 -48
- package/dist/transform.js +30 -27
- package/dist/transformCache.js +1 -2
- package/dist/types.d.ts +115 -137
- package/dist/types.js +15 -16
- package/package.json +22 -11
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`
|
|
@@ -13,6 +13,11 @@ var r = 67108864, i = (e) => new t({
|
|
|
13
13
|
provider: "ingest",
|
|
14
14
|
message: "limits.maxBytes must be a non-negative safe integer",
|
|
15
15
|
transient: !1
|
|
16
|
+
})) : typeof c != "object" || !c || Array.isArray(c) || c.requireHttps !== void 0 && typeof c.requireHttps != "boolean" ? n.fail(new e({
|
|
17
|
+
provider: "ingest",
|
|
18
|
+
message: "Ingest policy must be an object with an optional boolean requireHttps",
|
|
19
|
+
transient: !1,
|
|
20
|
+
status: 400
|
|
16
21
|
})) : n.tryPromise({
|
|
17
22
|
try: async (t) => {
|
|
18
23
|
let { ssrfReason: n } = await import("./ingestPolicy.js");
|
|
@@ -21,6 +26,7 @@ var r = 67108864, i = (e) => new t({
|
|
|
21
26
|
for (let e = 0;; e++) {
|
|
22
27
|
let i = n(r, { ...c.allowHosts === void 0 ? {} : { allowHosts: c.allowHosts } });
|
|
23
28
|
if (i !== null) throw a(r, i);
|
|
29
|
+
if (c.requireHttps === !0 && new URL(r).protocol !== "https:") throw a(r, "HTTPS is required for this source and its redirects");
|
|
24
30
|
s = await fetch(r, {
|
|
25
31
|
signal: t,
|
|
26
32
|
redirect: "manual"
|
|
@@ -77,5 +83,4 @@ var r = 67108864, i = (e) => new t({
|
|
|
77
83
|
});
|
|
78
84
|
return n.raceFirst(e, r);
|
|
79
85
|
});
|
|
80
|
-
//#endregion
|
|
81
86
|
export { o as fetchIngestBody, s as withIngestAbort };
|
package/dist/ingestPolicy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ssrfReason } from "@voltro/
|
|
1
|
+
export { ssrfReason } from "@voltro/protocol";
|
package/dist/metadataError.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { StorageError as e, StorageRejected as t } from "./types.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { Schema as n } from "effect";
|
|
3
|
+
import { causeBranches as r, extractDbCause as i, isTransientContention as a, wireSafeCause as o } from "@voltro/database";
|
|
4
|
+
// src/metadataError.ts
|
|
5
5
|
var s = (t, s, c = !1) => {
|
|
6
|
-
let l =
|
|
6
|
+
let l = r(t).find(n.is(e));
|
|
7
7
|
if (l !== void 0) return l;
|
|
8
|
-
let u =
|
|
8
|
+
let u = i(t), d = u.dbCode === "22003" || u.dbSqlState === "22003" || u.dbCode === "ER_WARN_DATA_OUT_OF_RANGE" || u.dbErrno === 1264 || u.dbNumber === 8115 || u.dbNumber === 248, f = new e({
|
|
9
9
|
provider: s,
|
|
10
|
-
message: `${d ? "Storage metadata numeric value out of range: " : ""}${
|
|
11
|
-
transient: d ? !1 :
|
|
10
|
+
message: `${d ? "Storage metadata numeric value out of range: " : ""}${o(t)}`,
|
|
11
|
+
transient: d ? !1 : a(t) || c
|
|
12
12
|
});
|
|
13
13
|
return Object.defineProperty(f, "cause", {
|
|
14
14
|
value: t,
|
|
15
15
|
configurable: !0
|
|
16
16
|
}), f;
|
|
17
|
-
}, c = (e) =>
|
|
18
|
-
//#endregion
|
|
17
|
+
}, c = (e) => r(e).find(n.is(t));
|
|
19
18
|
export { s as storageMetadataError, c as storageRejectedCause };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { storageMetadataError as e } from "./metadataError.js";
|
|
2
|
+
import { beginStorageObjectAbandon as t, makeStorageObjectMetadata as n } from "./objectMetadata.js";
|
|
3
|
+
import { Effect as r } from "effect";
|
|
4
|
+
// src/objectAbandon.ts
|
|
5
|
+
var i = (t) => r.tryPromise({
|
|
6
|
+
try: t,
|
|
7
|
+
catch: (t) => e(t, "metadata")
|
|
8
|
+
}), a = (e, a, o) => r.gen(function* () {
|
|
9
|
+
let r = yield* i(() => t(e, o));
|
|
10
|
+
return r.state === "retired" ? (r.operation.deleteKey !== null && (yield* a.delete(r.operation.deleteKey)), yield* i(() => n(e, o).confirmDelete(r.identity)), {
|
|
11
|
+
state: "abandoned",
|
|
12
|
+
refId: r.operation.refId
|
|
13
|
+
}) : r;
|
|
14
|
+
});
|
|
15
|
+
export { a as abandonStorageObject };
|
package/dist/objectLifecycle.js
CHANGED
|
@@ -1,74 +1,100 @@
|
|
|
1
1
|
import { requireStorageReferenceScope as e } from "./storageNamespaces.js";
|
|
2
2
|
import { StorageRejected as t } from "./types.js";
|
|
3
3
|
import { storageInteger as n, storageIntegerSum as r } from "./storageNumbers.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
4
|
+
import { Schema as i } from "effect";
|
|
5
|
+
import { createHash as a, randomUUID as o } from "node:crypto";
|
|
6
|
+
import { and as s, bigint as c, eq as l, neq as u, table as d, text as f } from "@voltro/database";
|
|
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
|
-
|
|
10
|
-
id:
|
|
11
|
-
nonce:
|
|
9
|
+
d(p, {
|
|
10
|
+
id: f().maxLength(64),
|
|
11
|
+
nonce: f()
|
|
12
12
|
}).primaryKey(["id"]).nonReactive(),
|
|
13
|
-
|
|
14
|
-
id:
|
|
15
|
-
objectNamespace:
|
|
16
|
-
generation:
|
|
17
|
-
key:
|
|
18
|
-
reservations:
|
|
13
|
+
d(m, {
|
|
14
|
+
id: f().maxLength(64),
|
|
15
|
+
objectNamespace: f().maxLength(64).nullable(),
|
|
16
|
+
generation: f(),
|
|
17
|
+
key: f(),
|
|
18
|
+
reservations: c()
|
|
19
19
|
}).primaryKey(["id"]).nonReactive(),
|
|
20
|
-
|
|
21
|
-
id:
|
|
22
|
-
storageInstance:
|
|
23
|
-
objectNamespace:
|
|
24
|
-
objectId:
|
|
25
|
-
fingerprint:
|
|
26
|
-
generation:
|
|
27
|
-
key:
|
|
28
|
-
refId:
|
|
29
|
-
state:
|
|
30
|
-
deleteKey:
|
|
20
|
+
d(h, {
|
|
21
|
+
id: f().maxLength(64),
|
|
22
|
+
storageInstance: f().nullable(),
|
|
23
|
+
objectNamespace: f().maxLength(64).nullable(),
|
|
24
|
+
objectId: f().maxLength(64),
|
|
25
|
+
fingerprint: f().maxLength(64),
|
|
26
|
+
generation: f(),
|
|
27
|
+
key: f(),
|
|
28
|
+
refId: f(),
|
|
29
|
+
state: f(),
|
|
30
|
+
deleteKey: f().nullable()
|
|
31
31
|
}).primaryKey(["id"]).nonReactive(),
|
|
32
|
-
|
|
33
|
-
id:
|
|
34
|
-
operationId:
|
|
35
|
-
claim:
|
|
32
|
+
d(g, {
|
|
33
|
+
id: f().maxLength(64),
|
|
34
|
+
operationId: f().maxLength(64),
|
|
35
|
+
claim: f()
|
|
36
36
|
}).primaryKey(["id"]).nonReactive()
|
|
37
|
-
], v =
|
|
38
|
-
id:
|
|
39
|
-
storageInstance:
|
|
40
|
-
objectNamespace:
|
|
41
|
-
objectId:
|
|
42
|
-
fingerprint:
|
|
43
|
-
generation:
|
|
44
|
-
key:
|
|
45
|
-
refId:
|
|
46
|
-
state:
|
|
37
|
+
], v = i.Struct({
|
|
38
|
+
id: i.String,
|
|
39
|
+
storageInstance: i.String,
|
|
40
|
+
objectNamespace: i.String,
|
|
41
|
+
objectId: i.String,
|
|
42
|
+
fingerprint: i.String,
|
|
43
|
+
generation: i.String,
|
|
44
|
+
key: i.String,
|
|
45
|
+
refId: i.String,
|
|
46
|
+
state: i.Literals([
|
|
47
47
|
"reserved",
|
|
48
48
|
"ready",
|
|
49
49
|
"deleting",
|
|
50
50
|
"deleted"
|
|
51
51
|
]),
|
|
52
|
-
deleteKey:
|
|
53
|
-
}), y =
|
|
54
|
-
id:
|
|
55
|
-
objectNamespace:
|
|
56
|
-
generation:
|
|
57
|
-
key:
|
|
58
|
-
reservations:
|
|
59
|
-
}), b = (e) =>
|
|
52
|
+
deleteKey: i.NullOr(i.String)
|
|
53
|
+
}), y = i.Struct({
|
|
54
|
+
id: i.String,
|
|
55
|
+
objectNamespace: i.String,
|
|
56
|
+
generation: i.String,
|
|
57
|
+
key: i.String,
|
|
58
|
+
reservations: i.Int.pipe(i.check(i.isGreaterThanOrEqualTo(0)))
|
|
59
|
+
}), b = (e) => i.decodeUnknownSync(y)({
|
|
60
60
|
...e,
|
|
61
61
|
reservations: n(e.reservations, "shared-object reservation count")
|
|
62
|
-
}), x = (e) =>
|
|
63
|
-
if (
|
|
62
|
+
}), x = (e) => a("sha256").update(JSON.stringify(e)).digest("hex"), S = (e, t) => x([e, t]), C = (n) => {
|
|
63
|
+
if (n.tenantId !== null && (typeof n.tenantId != "string" || !n.tenantId.trim() || n.tenantId.length > 191) || typeof n.bucket != "string" || !n.bucket.trim() || n.bucket.length > 200 || typeof n.operationId != "string" || !n.operationId.trim() || n.operationId.length > 200) throw new t({
|
|
64
|
+
reason: "operation-identity-reused",
|
|
65
|
+
detail: "Storage operation lookup requires explicit valid tenant, destination and operation identity"
|
|
66
|
+
});
|
|
67
|
+
return e(n), x([
|
|
68
|
+
n.storageInstance,
|
|
69
|
+
n.objectNamespace,
|
|
70
|
+
n.bucket,
|
|
71
|
+
n.tenantId,
|
|
72
|
+
n.operationId
|
|
73
|
+
]);
|
|
74
|
+
}, w = (e) => C(e), T = async (e, t) => {
|
|
75
|
+
let n = await e.query({
|
|
76
|
+
table: h,
|
|
77
|
+
predicate: l("id", C(t)),
|
|
78
|
+
order: [],
|
|
79
|
+
take: 1,
|
|
80
|
+
skip: void 0,
|
|
81
|
+
projection: void 0
|
|
82
|
+
});
|
|
83
|
+
return n[0] ? i.decodeUnknownSync(v)(n[0]) : void 0;
|
|
84
|
+
}, E = async (e, t, n) => {
|
|
85
|
+
if (typeof n != "string" || !n.trim() || n.length > 200) throw Error("Storage operation lookup requires a bounded claim");
|
|
86
|
+
return (await e.query({
|
|
87
|
+
table: g,
|
|
88
|
+
predicate: s(l("id", S(t, n)), l("operationId", t), l("claim", n)),
|
|
89
|
+
order: [],
|
|
90
|
+
take: 1,
|
|
91
|
+
skip: void 0,
|
|
92
|
+
projection: ["id"]
|
|
93
|
+
})).length === 1;
|
|
94
|
+
}, D = (t) => {
|
|
95
|
+
if (e(t), !t.bucket || !t.operationId || !t.logicalKey || !/^[a-f0-9]{64}$/.test(t.fingerprint) || !/^[a-f0-9]{64}$/.test(t.checksum) || t.retainedSource !== void 0 && (!t.retainedSource.refId || !/^[a-f0-9]{64}$/.test(t.retainedSource.digest))) throw Error("Storage operation requires a bucket, operation identity, key and SHA-256 fingerprint");
|
|
64
96
|
return {
|
|
65
|
-
id:
|
|
66
|
-
t.storageInstance,
|
|
67
|
-
t.objectNamespace,
|
|
68
|
-
t.bucket,
|
|
69
|
-
t.tenantId,
|
|
70
|
-
t.operationId
|
|
71
|
-
]),
|
|
97
|
+
id: C(t),
|
|
72
98
|
objectId: x([
|
|
73
99
|
t.objectNamespace,
|
|
74
100
|
t.bucket,
|
|
@@ -78,52 +104,52 @@ var p = "_voltro_storage_operation_locks", m = "_voltro_storage_object_heads", h
|
|
|
78
104
|
]),
|
|
79
105
|
lockId: x([t.tenantId])
|
|
80
106
|
};
|
|
81
|
-
},
|
|
82
|
-
let { lockId: r } =
|
|
107
|
+
}, O = async (e, t, n) => {
|
|
108
|
+
let { lockId: r } = D(t);
|
|
83
109
|
return await e.insertIgnoreWithOutcome(p, {
|
|
84
110
|
id: r,
|
|
85
|
-
nonce:
|
|
111
|
+
nonce: o()
|
|
86
112
|
}, { conflictColumns: ["id"] }), e.transactional(async (e) => {
|
|
87
113
|
if ((await e.query({
|
|
88
114
|
table: p,
|
|
89
|
-
predicate:
|
|
115
|
+
predicate: l("id", r),
|
|
90
116
|
lock: "update",
|
|
91
117
|
order: [],
|
|
92
118
|
take: 1,
|
|
93
119
|
skip: void 0,
|
|
94
120
|
projection: void 0
|
|
95
|
-
})).length !== 1 || await e.update(p, r, { nonce:
|
|
121
|
+
})).length !== 1 || await e.update(p, r, { nonce: o() }) === null) throw Error("Storage operation lock is unavailable");
|
|
96
122
|
return n(e);
|
|
97
123
|
});
|
|
98
|
-
},
|
|
99
|
-
let r =
|
|
124
|
+
}, k = async (e, n) => {
|
|
125
|
+
let r = D(n), a = await e.query({
|
|
100
126
|
table: h,
|
|
101
|
-
predicate:
|
|
127
|
+
predicate: l("id", r.id),
|
|
102
128
|
order: [],
|
|
103
129
|
take: 1,
|
|
104
130
|
skip: void 0,
|
|
105
131
|
projection: void 0
|
|
106
132
|
});
|
|
107
|
-
if (!
|
|
108
|
-
let
|
|
109
|
-
if (
|
|
133
|
+
if (!a[0]) return;
|
|
134
|
+
let o = i.decodeUnknownSync(v)(a[0]);
|
|
135
|
+
if (o.storageInstance !== n.storageInstance || o.objectNamespace !== n.objectNamespace || o.fingerprint !== n.fingerprint || o.objectId !== r.objectId) throw new t({
|
|
110
136
|
reason: "operation-identity-reused",
|
|
111
137
|
detail: `storage operation '${n.operationId}' was already used with different inputs`
|
|
112
138
|
});
|
|
113
|
-
return
|
|
114
|
-
},
|
|
115
|
-
let n = await
|
|
139
|
+
return o;
|
|
140
|
+
}, A = async (e, t) => {
|
|
141
|
+
let n = await k(e, t);
|
|
116
142
|
if (n) return n;
|
|
117
|
-
let { id: i, objectId:
|
|
143
|
+
let { id: i, objectId: a } = D(t), s = await e.query({
|
|
118
144
|
table: m,
|
|
119
|
-
predicate:
|
|
145
|
+
predicate: l("id", a),
|
|
120
146
|
order: [],
|
|
121
147
|
take: 1,
|
|
122
148
|
skip: void 0,
|
|
123
149
|
projection: void 0
|
|
124
|
-
}),
|
|
125
|
-
|
|
126
|
-
id:
|
|
150
|
+
}), c = s[0] ? b(s[0]) : void 0, u = c?.generation ?? o(), d = c?.key ?? `${t.logicalKey}/g-${u}`;
|
|
151
|
+
c ? await e.update(m, a, { reservations: String(r(c.reservations, 1, "shared-object reservation count")) }) : await e.insert(m, {
|
|
152
|
+
id: a,
|
|
127
153
|
objectNamespace: t.objectNamespace,
|
|
128
154
|
generation: u,
|
|
129
155
|
key: d,
|
|
@@ -133,77 +159,84 @@ var p = "_voltro_storage_operation_locks", m = "_voltro_storage_object_heads", h
|
|
|
133
159
|
id: i,
|
|
134
160
|
storageInstance: t.storageInstance,
|
|
135
161
|
objectNamespace: t.objectNamespace,
|
|
136
|
-
objectId:
|
|
162
|
+
objectId: a,
|
|
137
163
|
fingerprint: t.fingerprint,
|
|
138
164
|
generation: u,
|
|
139
165
|
key: d,
|
|
140
|
-
refId: `file_${
|
|
166
|
+
refId: `file_${o()}`,
|
|
141
167
|
state: "reserved",
|
|
142
168
|
deleteKey: null
|
|
143
169
|
};
|
|
144
170
|
return await e.insert(h, f), f;
|
|
145
|
-
},
|
|
146
|
-
let n = await
|
|
171
|
+
}, j = async (e, t) => {
|
|
172
|
+
let n = await k(e, t);
|
|
147
173
|
if (!n) throw Error("Storage operation is missing");
|
|
148
174
|
if (n.state === "deleting" || n.state === "deleted") throw Error("Deleted storage operation cannot be confirmed by a late put");
|
|
149
175
|
return await e.update(h, n.id, { state: "ready" }), {
|
|
150
176
|
...n,
|
|
151
177
|
state: "ready"
|
|
152
178
|
};
|
|
153
|
-
},
|
|
154
|
-
let
|
|
155
|
-
if (!
|
|
156
|
-
if (
|
|
157
|
-
if (
|
|
158
|
-
|
|
179
|
+
}, M = async (e, t, n) => {
|
|
180
|
+
let r = await k(e, t);
|
|
181
|
+
if (!r) throw Error("Storage operation is missing");
|
|
182
|
+
if (r.state === "deleting" || r.state === "deleted") return r;
|
|
183
|
+
if (r.state !== n) throw Error(n === "ready" ? "An unconfirmed put cannot be deleted" : "A confirmed put cannot be abandoned");
|
|
184
|
+
if (n === "reserved" && (await e.query({
|
|
185
|
+
table: g,
|
|
186
|
+
predicate: l("operationId", r.id),
|
|
187
|
+
order: [],
|
|
188
|
+
take: 1,
|
|
189
|
+
skip: void 0,
|
|
190
|
+
projection: ["id"]
|
|
191
|
+
})).length !== 0) throw Error("An unconfirmed operation unexpectedly holds claims");
|
|
192
|
+
let i = await e.query({
|
|
159
193
|
table: m,
|
|
160
|
-
predicate:
|
|
194
|
+
predicate: l("id", r.objectId),
|
|
161
195
|
order: [],
|
|
162
196
|
take: 1,
|
|
163
197
|
skip: void 0,
|
|
164
198
|
projection: void 0
|
|
165
|
-
}),
|
|
166
|
-
if (!
|
|
167
|
-
let
|
|
168
|
-
return
|
|
199
|
+
}), a = i[0] ? b(i[0]) : void 0;
|
|
200
|
+
if (!a || a.generation !== r.generation || a.reservations < 1) throw Error("Storage object generation does not own its reservation");
|
|
201
|
+
let o = a.reservations === 1 ? a.key : null;
|
|
202
|
+
return o === null ? await e.update(m, a.id, { reservations: String(a.reservations - 1) }) : await e.delete(m, a.id), o !== null && (await e.query({
|
|
169
203
|
table: m,
|
|
170
|
-
predicate:
|
|
204
|
+
predicate: s(l("objectNamespace", t.objectNamespace), l("key", o)),
|
|
171
205
|
order: [],
|
|
172
206
|
take: 1,
|
|
173
207
|
skip: void 0,
|
|
174
208
|
projection: ["id"]
|
|
175
|
-
})).length && (
|
|
209
|
+
})).length && (o = null), await e.update(h, r.id, {
|
|
176
210
|
state: "deleting",
|
|
177
|
-
deleteKey:
|
|
211
|
+
deleteKey: o
|
|
178
212
|
}), {
|
|
179
|
-
...
|
|
213
|
+
...r,
|
|
180
214
|
state: "deleting",
|
|
181
|
-
deleteKey:
|
|
215
|
+
deleteKey: o
|
|
182
216
|
};
|
|
183
|
-
},
|
|
184
|
-
let n = await
|
|
217
|
+
}, N = (e, t) => M(e, t, "ready"), P = (e, t) => M(e, t, "reserved"), F = async (e, t) => {
|
|
218
|
+
let n = await k(e, t);
|
|
185
219
|
if (!n || n.state !== "deleting" && n.state !== "deleted") throw Error("Storage deletion has not been accepted");
|
|
186
220
|
return n.state !== "deleted" && (await e.update(h, n.id, { state: "deleted" }), !0);
|
|
187
|
-
},
|
|
221
|
+
}, I = async (e, t, n) => {
|
|
188
222
|
if (!n) throw Error("Storage object claim must be a non-empty string");
|
|
189
223
|
await e.insertIgnoreWithOutcome(g, {
|
|
190
224
|
id: S(t, n),
|
|
191
225
|
operationId: t,
|
|
192
226
|
claim: n
|
|
193
227
|
}, { conflictColumns: ["id"] });
|
|
194
|
-
},
|
|
228
|
+
}, L = async (e, t, n) => {
|
|
195
229
|
let r = S(t, n);
|
|
196
230
|
return {
|
|
197
231
|
held: await e.delete(g, r),
|
|
198
232
|
others: (await e.query({
|
|
199
233
|
table: g,
|
|
200
|
-
predicate:
|
|
234
|
+
predicate: s(l("operationId", t), u("claim", n)),
|
|
201
235
|
order: [],
|
|
202
236
|
take: 1,
|
|
203
237
|
skip: void 0,
|
|
204
238
|
projection: void 0
|
|
205
239
|
})).length > 0
|
|
206
240
|
};
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
export { O as beginStorageObjectDeleteInTransaction, A as claimStorageObjectInTransaction, M as clearStorageObjectClaimsInTransaction, k as confirmStorageObjectDeleteInTransaction, D as confirmStorageObjectInTransaction, T as readStorageObjectOperationInTransaction, j as releaseStorageObjectClaimInTransaction, E as reserveStorageObjectInTransaction, S as storageObjectClaimId, C as storageObjectIdentifiers, _ as storageObjectLifecycleTables, w as withStorageOperationTransaction };
|
|
241
|
+
}, R = (e, t) => e.deleteMany(g, { where: l("operationId", t) });
|
|
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 };
|