@cosmicdrift/kumiko-framework 0.285.1 → 0.285.2
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/package.json +4 -4
- package/src/files/index.ts +8 -1
- package/src/files/types.ts +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-framework",
|
|
3
|
-
"version": "0.285.
|
|
3
|
+
"version": "0.285.2",
|
|
4
4
|
"description": "Framework core — engine, pipeline, API, DB, and every other bit that makes Kumiko go.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -198,8 +198,8 @@
|
|
|
198
198
|
"./package.json": "./package.json"
|
|
199
199
|
},
|
|
200
200
|
"dependencies": {
|
|
201
|
-
"@cosmicdrift/kumiko-http": "0.285.
|
|
202
|
-
"@cosmicdrift/kumiko-types": "0.285.
|
|
201
|
+
"@cosmicdrift/kumiko-http": "0.285.2",
|
|
202
|
+
"@cosmicdrift/kumiko-types": "0.285.2",
|
|
203
203
|
"bullmq": "^5.76.7",
|
|
204
204
|
"bun-types": "^1.3.13",
|
|
205
205
|
"hono": "^4.13.1",
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"zod": "^4.4.3"
|
|
216
216
|
},
|
|
217
217
|
"devDependencies": {
|
|
218
|
-
"@cosmicdrift/kumiko-dispatcher-live": "0.285.
|
|
218
|
+
"@cosmicdrift/kumiko-dispatcher-live": "0.285.2",
|
|
219
219
|
"bun-types": "^1.3.13",
|
|
220
220
|
"pino-pretty": "^13.1.3"
|
|
221
221
|
},
|
package/src/files/index.ts
CHANGED
|
@@ -34,6 +34,13 @@ export type {
|
|
|
34
34
|
SignedUrlOptions,
|
|
35
35
|
WriteStreamOptions,
|
|
36
36
|
} from "./types";
|
|
37
|
-
export {
|
|
37
|
+
export {
|
|
38
|
+
assertSafeStorageKey,
|
|
39
|
+
buildStorageKey,
|
|
40
|
+
parseMaxSize,
|
|
41
|
+
tenantExportPrefix,
|
|
42
|
+
tenantStoragePrefixes,
|
|
43
|
+
validateFile,
|
|
44
|
+
} from "./types";
|
|
38
45
|
export type { ZipEntry } from "./zip-stream";
|
|
39
46
|
export { createZipStream } from "./zip-stream";
|
package/src/files/types.ts
CHANGED
|
@@ -174,3 +174,18 @@ export function buildStorageKey(
|
|
|
174
174
|
const ext = /^[A-Za-z0-9]+$/.test(rawExt) ? rawExt.toLowerCase() : "bin";
|
|
175
175
|
return `${tenantId}/${entityType}/${entityId}/${fieldName}/${uniqueId}.${ext}`;
|
|
176
176
|
}
|
|
177
|
+
|
|
178
|
+
/** Fixed leading segment so one S3 lifecycle rule (Prefix: "exports/") can expire export bundles for every tenant without matching a buildStorageKey() upload. */
|
|
179
|
+
export function tenantExportPrefix(tenantId: TenantId): string {
|
|
180
|
+
return `exports/${tenantId}/`;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Every storage-key prefix a tenant's binaries can live under. A tenant-destroy
|
|
185
|
+
* prefix sweep must list ALL of these, not just buildStorageKey()'s
|
|
186
|
+
* `${tenantId}/` — new key layouts (like tenantExportPrefix) that don't put
|
|
187
|
+
* the tenant first need adding here too, or a sweep silently stops covering them.
|
|
188
|
+
*/
|
|
189
|
+
export function tenantStoragePrefixes(tenantId: TenantId): readonly string[] {
|
|
190
|
+
return [`${tenantId}/`, tenantExportPrefix(tenantId)];
|
|
191
|
+
}
|