@anvilkit/plugin-asset-manager 0.1.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 +21 -0
- package/README.md +159 -0
- package/dist/adapters/data-url.cjs +78 -0
- package/dist/adapters/data-url.d.cts +6 -0
- package/dist/adapters/data-url.d.cts.map +1 -0
- package/dist/adapters/data-url.d.ts +6 -0
- package/dist/adapters/data-url.d.ts.map +1 -0
- package/dist/adapters/data-url.js +44 -0
- package/dist/adapters/extract-image-dimensions.cjs +69 -0
- package/dist/adapters/extract-image-dimensions.d.cts +21 -0
- package/dist/adapters/extract-image-dimensions.d.cts.map +1 -0
- package/dist/adapters/extract-image-dimensions.d.ts +21 -0
- package/dist/adapters/extract-image-dimensions.d.ts.map +1 -0
- package/dist/adapters/extract-image-dimensions.js +35 -0
- package/dist/adapters/in-memory.cjs +62 -0
- package/dist/adapters/in-memory.d.cts +3 -0
- package/dist/adapters/in-memory.d.cts.map +1 -0
- package/dist/adapters/in-memory.d.ts +3 -0
- package/dist/adapters/in-memory.d.ts.map +1 -0
- package/dist/adapters/in-memory.js +28 -0
- package/dist/adapters/s3-presigned.cjs +166 -0
- package/dist/adapters/s3-presigned.d.cts +59 -0
- package/dist/adapters/s3-presigned.d.cts.map +1 -0
- package/dist/adapters/s3-presigned.d.ts +59 -0
- package/dist/adapters/s3-presigned.d.ts.map +1 -0
- package/dist/adapters/s3-presigned.js +129 -0
- package/dist/asset-reference.cjs +38 -0
- package/dist/asset-reference.d.cts +10 -0
- package/dist/asset-reference.d.cts.map +1 -0
- package/dist/asset-reference.d.ts +10 -0
- package/dist/asset-reference.d.ts.map +1 -0
- package/dist/asset-reference.js +4 -0
- package/dist/csp.cjs +83 -0
- package/dist/csp.d.cts +45 -0
- package/dist/csp.d.cts.map +1 -0
- package/dist/csp.d.ts +45 -0
- package/dist/csp.d.ts.map +1 -0
- package/dist/csp.js +49 -0
- package/dist/errors.cjs +58 -0
- package/dist/errors.d.cts +15 -0
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.ts +15 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +21 -0
- package/dist/header-action.cjs +44 -0
- package/dist/header-action.d.cts +3 -0
- package/dist/header-action.d.cts.map +1 -0
- package/dist/header-action.d.ts +3 -0
- package/dist/header-action.d.ts.map +1 -0
- package/dist/header-action.js +10 -0
- package/dist/index.cjs +90 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/infer-kind.cjs +45 -0
- package/dist/infer-kind.d.cts +8 -0
- package/dist/infer-kind.d.cts.map +1 -0
- package/dist/infer-kind.d.ts +8 -0
- package/dist/infer-kind.d.ts.map +1 -0
- package/dist/infer-kind.js +11 -0
- package/dist/plugin.cjs +258 -0
- package/dist/plugin.d.cts +9 -0
- package/dist/plugin.d.cts.map +1 -0
- package/dist/plugin.d.ts +9 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +212 -0
- package/dist/registry.cjs +198 -0
- package/dist/registry.d.cts +3 -0
- package/dist/registry.d.cts.map +1 -0
- package/dist/registry.d.ts +3 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +164 -0
- package/dist/resolver.cjs +185 -0
- package/dist/resolver.d.cts +10 -0
- package/dist/resolver.d.cts.map +1 -0
- package/dist/resolver.d.ts +10 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +148 -0
- package/dist/retry.cjs +123 -0
- package/dist/retry.d.cts +71 -0
- package/dist/retry.d.cts.map +1 -0
- package/dist/retry.d.ts +71 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +86 -0
- package/dist/studio-asset-source.cjs +211 -0
- package/dist/studio-asset-source.d.cts +52 -0
- package/dist/studio-asset-source.d.cts.map +1 -0
- package/dist/studio-asset-source.d.ts +52 -0
- package/dist/studio-asset-source.d.ts.map +1 -0
- package/dist/studio-asset-source.js +171 -0
- package/dist/testing/index.cjs +66 -0
- package/dist/testing/index.d.cts +24 -0
- package/dist/testing/index.d.cts.map +1 -0
- package/dist/testing/index.d.ts +24 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +29 -0
- package/dist/types.cjs +18 -0
- package/dist/types.d.cts +132 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.ts +132 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +0 -0
- package/dist/ui/AssetBrowser.cjs +271 -0
- package/dist/ui/AssetBrowser.d.cts +45 -0
- package/dist/ui/AssetBrowser.d.cts.map +1 -0
- package/dist/ui/AssetBrowser.d.ts +45 -0
- package/dist/ui/AssetBrowser.d.ts.map +1 -0
- package/dist/ui/AssetBrowser.js +237 -0
- package/dist/ui/AssetCommandPalette.cjs +135 -0
- package/dist/ui/AssetCommandPalette.d.cts +21 -0
- package/dist/ui/AssetCommandPalette.d.cts.map +1 -0
- package/dist/ui/AssetCommandPalette.d.ts +21 -0
- package/dist/ui/AssetCommandPalette.d.ts.map +1 -0
- package/dist/ui/AssetCommandPalette.js +101 -0
- package/dist/ui/AssetManagerUI.cjs +169 -0
- package/dist/ui/AssetManagerUI.d.cts +15 -0
- package/dist/ui/AssetManagerUI.d.cts.map +1 -0
- package/dist/ui/AssetManagerUI.d.ts +15 -0
- package/dist/ui/AssetManagerUI.d.ts.map +1 -0
- package/dist/ui/AssetManagerUI.js +135 -0
- package/dist/ui/DeleteAssetDialog.cjs +70 -0
- package/dist/ui/DeleteAssetDialog.d.cts +22 -0
- package/dist/ui/DeleteAssetDialog.d.cts.map +1 -0
- package/dist/ui/DeleteAssetDialog.d.ts +22 -0
- package/dist/ui/DeleteAssetDialog.d.ts.map +1 -0
- package/dist/ui/DeleteAssetDialog.js +36 -0
- package/dist/ui/MetadataPanel.cjs +147 -0
- package/dist/ui/MetadataPanel.d.cts +21 -0
- package/dist/ui/MetadataPanel.d.cts.map +1 -0
- package/dist/ui/MetadataPanel.d.ts +21 -0
- package/dist/ui/MetadataPanel.d.ts.map +1 -0
- package/dist/ui/MetadataPanel.js +113 -0
- package/dist/ui/ReplaceAssetDialog.cjs +125 -0
- package/dist/ui/ReplaceAssetDialog.d.cts +14 -0
- package/dist/ui/ReplaceAssetDialog.d.cts.map +1 -0
- package/dist/ui/ReplaceAssetDialog.d.ts +14 -0
- package/dist/ui/ReplaceAssetDialog.d.ts.map +1 -0
- package/dist/ui/ReplaceAssetDialog.js +91 -0
- package/dist/ui/UploadButton.cjs +189 -0
- package/dist/ui/UploadButton.d.cts +17 -0
- package/dist/ui/UploadButton.d.cts.map +1 -0
- package/dist/ui/UploadButton.d.ts +17 -0
- package/dist/ui/UploadButton.d.ts.map +1 -0
- package/dist/ui/UploadButton.js +155 -0
- package/dist/ui/index.cjs +60 -0
- package/dist/ui/index.d.cts +15 -0
- package/dist/ui/index.d.cts.map +1 -0
- package/dist/ui/index.d.ts +15 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +7 -0
- package/dist/validate-upload-result.cjs +149 -0
- package/dist/validate-upload-result.d.cts +9 -0
- package/dist/validate-upload-result.d.cts.map +1 -0
- package/dist/validate-upload-result.d.ts +9 -0
- package/dist/validate-upload-result.d.ts.map +1 -0
- package/dist/validate-upload-result.js +115 -0
- package/package.json +131 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ancyloce
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# `@anvilkit/plugin-asset-manager`
|
|
2
|
+
|
|
3
|
+
Headless asset upload plugin for Anvilkit Studio.
|
|
4
|
+
|
|
5
|
+
## What it ships
|
|
6
|
+
|
|
7
|
+
- `createAssetManagerPlugin(options)` for Studio registration and runtime upload handling.
|
|
8
|
+
- `uploadAsset(ctx, file)` for invoking the configured upload adapter and registering the validated result.
|
|
9
|
+
- `getAssetRegistry(ctx)` for reading the plugin runtime registry after `onInit`.
|
|
10
|
+
- `createAssetReference(id)` for producing stable `asset://<id>` references.
|
|
11
|
+
- `createAssetRegistry()` for storing validated asset metadata, with `search`, `setTags`, and pagination.
|
|
12
|
+
- `getRequiredCsp(opts)` for computing the minimum `connect-src` / `img-src` / `media-src` directives the configured adapters need.
|
|
13
|
+
- `./ui` React components for a host-rendered upload button, asset browser (with search + filter chips), command palette, and metadata editor.
|
|
14
|
+
- Reference upload adapters for tests and demos.
|
|
15
|
+
|
|
16
|
+
## Library management (search, tags, pagination)
|
|
17
|
+
|
|
18
|
+
`AssetRegistry.search(options)` returns a paginated, filtered slice of the registry:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
const page = registry.search({
|
|
22
|
+
query: "hero", // matches id, name, MIME prefix, and tags (case-insensitive)
|
|
23
|
+
kinds: ["image"], // filter by inferred kind (image/video/audio/font/document/other)
|
|
24
|
+
tags: ["brand"], // require all listed tags (AND semantics)
|
|
25
|
+
limit: 20,
|
|
26
|
+
cursor: undefined, // opaque; pass `page.nextCursor` to advance
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Tags are auto-derived on every upload (kind + up to two filename tokens, capped at 3) and can be edited via `registry.setTags(id, tags)` or the `MetadataPanel` UI. Host-supplied `UploadResult.tags` are preserved verbatim.
|
|
31
|
+
|
|
32
|
+
`StudioAssetSource.listPaginated(query)` is the sidebar-facing pagination contract — remote sources can implement it to push search and pagination to the server. Sidebar consumers fall back to `list()` when omitted.
|
|
33
|
+
|
|
34
|
+
`StudioAssetSource.subscribeUploads(listener)` is a streaming channel that fans `progress` / `done` / `error` envelopes out to every subscriber alongside the inline upload listener.
|
|
35
|
+
|
|
36
|
+
## Trust model
|
|
37
|
+
|
|
38
|
+
`UploadAdapter.url` is treated as untrusted input. Every adapter response is validated through `validateUploadResult()` before it reaches the registry or IR-shaped data.
|
|
39
|
+
|
|
40
|
+
The default scheme set is **always** `http`, `https`, and `blob`. `javascript:` and `vbscript:` are hard-blocked under all configurations. `data:` is **off by default** in v1.0 — enable it explicitly per plugin instance:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
createAssetManagerPlugin({
|
|
44
|
+
uploader: dataUrlUploader(),
|
|
45
|
+
dataUrlAllowlistOptIn: true,
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Two further hardening checks run at validation time:
|
|
50
|
+
|
|
51
|
+
- **Path traversal.** `../` and percent-encoded variants (`%2e%2e/`, `%2e%2e%2f`) are rejected on `http`/`https`/`blob` URLs.
|
|
52
|
+
- **IDN homoglyph.** Hostnames mixing Latin with a visually confusable script (Cyrillic or Greek) are rejected. Single-script IDN hosts such as `münchen.de`, `日本.jp`, or `россия.рф` are always allowed. Hosts that legitimately need this combination can pass `allowMixedScriptHostnames: true`.
|
|
53
|
+
|
|
54
|
+
### Migration from `urlAllowlist` (alpha → 1.0)
|
|
55
|
+
|
|
56
|
+
The alpha-era `urlAllowlist?: readonly string[]` field is removed in v1.0. Replace any existing usage with the typed flags:
|
|
57
|
+
|
|
58
|
+
| Alpha | v1.0 |
|
|
59
|
+
| ---------------------------------------------- | ----------------------------------- |
|
|
60
|
+
| `urlAllowlist: ["http", "https", "blob"]` | _(default — drop the field)_ |
|
|
61
|
+
| `urlAllowlist: ["http", "https", "blob", "data"]` | `dataUrlAllowlistOptIn: true` |
|
|
62
|
+
| `urlAllowlist: ["http", "https", "blob", "ftp"]` | _not supported — write a custom resolver wrapper_ |
|
|
63
|
+
|
|
64
|
+
If your host needs an exotic scheme (`s3:`, `ipfs:`, `gs:`), wrap `validateUploadResult` and pass the result to `registry.register` directly. The rationale for dropping arbitrary scheme strings: every scheme allowed at the boundary needs its own CSP / sanitization story — typed flags force that decision to be explicit.
|
|
65
|
+
|
|
66
|
+
## Content Security Policy
|
|
67
|
+
|
|
68
|
+
`getRequiredCsp(options)` computes the minimum CSP directives the configured adapters need. Call it once at boot and merge the result into your existing CSP builder:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { getRequiredCsp } from "@anvilkit/plugin-asset-manager";
|
|
72
|
+
|
|
73
|
+
const csp = getRequiredCsp({
|
|
74
|
+
dataUrl: true,
|
|
75
|
+
s3: { presignEndpoint: "https://uploads.example.com/sign" },
|
|
76
|
+
});
|
|
77
|
+
// csp.connectSrc → ["https://uploads.example.com"]
|
|
78
|
+
// csp.imgSrc → ["data:", "https://uploads.example.com"]
|
|
79
|
+
// csp.mediaSrc → ["data:", "https://uploads.example.com"]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
| Adapter | `connect-src` | `img-src` | `media-src` |
|
|
83
|
+
| ---------------------- | ---------------------------- | ---------------------------- | ---------------------------- |
|
|
84
|
+
| `dataUrlUploader` | _(none)_ | `data:` | `data:` |
|
|
85
|
+
| `inMemoryUploader` | _(none)_ | `blob:` | `blob:` |
|
|
86
|
+
| `s3PresignedAdapter` | presign origin + `publicHost`| `publicHost` ?? presign | `publicHost` ?? presign |
|
|
87
|
+
|
|
88
|
+
If your `publicUrl` returned by the presign service points at a different origin than the presign endpoint itself, pass `s3: { presignEndpoint, publicHost }` so the advisor can split the directives correctly.
|
|
89
|
+
|
|
90
|
+
## Entry points
|
|
91
|
+
|
|
92
|
+
- `@anvilkit/plugin-asset-manager` — headless runtime, validation, adapters, errors, CSP advisor.
|
|
93
|
+
- `@anvilkit/plugin-asset-manager/ui` — React UI components.
|
|
94
|
+
- `@anvilkit/plugin-asset-manager/retry` — generic `RetryableError` + `withRetry()`.
|
|
95
|
+
- `@anvilkit/plugin-asset-manager/adapters/s3` — `s3PresignedAdapter`.
|
|
96
|
+
- `@anvilkit/plugin-asset-manager/testing` — fixtures for downstream plugin tests.
|
|
97
|
+
|
|
98
|
+
## Batch upload behaviour
|
|
99
|
+
|
|
100
|
+
`StudioAssetSource.upload(files)` runs up to `MAX_CONCURRENT_UPLOADS` (default 3) uploads in parallel. Per-file failures surface via the listener as `error` envelopes; the returned promise resolves with the successful subset and **does not throw**. Hosts that need fail-fast semantics can pass `maxConcurrentUploads: 1`.
|
|
101
|
+
|
|
102
|
+
`AbortError`s thrown from the adapter abort the whole batch — pending files are not scheduled.
|
|
103
|
+
|
|
104
|
+
## S3 presigned adapter
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import { s3PresignedAdapter } from "@anvilkit/plugin-asset-manager/adapters/s3";
|
|
108
|
+
import { createAssetManagerPlugin } from "@anvilkit/plugin-asset-manager";
|
|
109
|
+
|
|
110
|
+
createAssetManagerPlugin({
|
|
111
|
+
uploader: s3PresignedAdapter({
|
|
112
|
+
presignEndpoint: "/api/sign",
|
|
113
|
+
retry: { maxRetries: 3 },
|
|
114
|
+
}),
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The adapter POSTs `{ name, type, size }` to `presignEndpoint`, expects `{ url, publicUrl?, headers?, id? }` back, then PUTs the file to `url`. Both phases retry on 5xx and network errors with exponential backoff. 4xx responses fail without retry.
|
|
119
|
+
|
|
120
|
+
If the host endpoint is **not** S3-compatible (e.g. a custom uploader without overwrite semantics), pass `retry: { maxRetries: 0 }` to disable retry and avoid the small chance of a duplicate upload.
|
|
121
|
+
|
|
122
|
+
The adapter never logs file contents — only `name`, `size`, and `mimeType`.
|
|
123
|
+
|
|
124
|
+
## Production checklist
|
|
125
|
+
|
|
126
|
+
Before mounting in a real Studio host:
|
|
127
|
+
|
|
128
|
+
1. **Pick the right adapter.** `dataUrlUploader` is dev-only (size cap, in-memory). `s3PresignedAdapter` is the production default; wire it to your presign endpoint and set `retry: { maxRetries: 3 }`.
|
|
129
|
+
2. **Set the trust flags explicitly.** Decide whether your host needs `dataUrlAllowlistOptIn: true` (only if your editor flow embeds `data:` URLs end-to-end). Leave `allowMixedScriptHostnames` off unless you have a documented business need.
|
|
130
|
+
3. **Wire CSP.** Call `getRequiredCsp(...)` and merge the result into your `connect-src` / `img-src` / `media-src` builder. Re-run when you add or remove an adapter.
|
|
131
|
+
4. **Choose a persistence story.** The plugin keeps state in-memory per Studio mount. If you need cross-session asset reuse, the host stores `publicUrl`s server-side and re-seeds the registry on boot via `registry.register`.
|
|
132
|
+
5. **Decide on monitoring.** Subscribe to the `asset-manager:error` event bus envelopes (`code`, `message`) for upload failures, and log `AssetResolutionError.code` from your export pipeline so `ASSET_NOT_FOUND` / `ASSET_URL_REJECTED` / `ASSET_VALIDATION_FAILED` get separate alerts.
|
|
133
|
+
6. **Lock down the bundle.** Consult `.size-limit.json` — the headless entry stays under 6 KB gzip; the UI subpath stays under 12 KB. CI gates both.
|
|
134
|
+
|
|
135
|
+
## Error codes
|
|
136
|
+
|
|
137
|
+
`AssetValidationError.code` (raised by upload + validation):
|
|
138
|
+
|
|
139
|
+
| Code | Source |
|
|
140
|
+
| ------------------------------ | ------------------------------- |
|
|
141
|
+
| `FILE_TOO_LARGE` | `validateSelectedFile` |
|
|
142
|
+
| `UNSUPPORTED_MIME_TYPE` | `validateSelectedFile` |
|
|
143
|
+
| `INVALID_UPLOAD_ID` | `validateUploadResult` |
|
|
144
|
+
| `EMPTY_UPLOAD_URL` | `validateUploadResult` |
|
|
145
|
+
| `UNSCHEMED_UPLOAD_URL` | `validateUploadResult` |
|
|
146
|
+
| `DISALLOWED_UPLOAD_URL_SCHEME` | `validateUploadResult` |
|
|
147
|
+
| `PATH_TRAVERSAL_URL` | `validateUploadResult` |
|
|
148
|
+
| `MIXED_SCRIPT_HOSTNAME` | `validateUploadResult` |
|
|
149
|
+
| `DATA_URL_FILE_TOO_LARGE` | `dataUrlUploader` |
|
|
150
|
+
| `DATA_URL_READ_FAILED` | `dataUrlUploader` |
|
|
151
|
+
| `UPLOAD_FAILED` | `uploadAsset` fallback wrap |
|
|
152
|
+
|
|
153
|
+
`AssetResolutionError.code` (raised by `IRAssetResolver`):
|
|
154
|
+
|
|
155
|
+
| Code | Meaning |
|
|
156
|
+
| -------------------------- | -------------------------------------------------- |
|
|
157
|
+
| `ASSET_NOT_FOUND` | The registry has no entry for the asset id. |
|
|
158
|
+
| `ASSET_URL_REJECTED` | The stored URL failed the allowlist or trust gate. |
|
|
159
|
+
| `ASSET_VALIDATION_FAILED` | Catch-all for unexpected resolver failures. |
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
dataUrlUploader: ()=>dataUrlUploader
|
|
28
|
+
});
|
|
29
|
+
const external_errors_cjs_namespaceObject = require("../errors.cjs");
|
|
30
|
+
const external_extract_image_dimensions_cjs_namespaceObject = require("./extract-image-dimensions.cjs");
|
|
31
|
+
const DEFAULT_MAX_BYTES = 1048576;
|
|
32
|
+
function dataUrlUploader(options = {}) {
|
|
33
|
+
const maxBytes = options.maxBytes ?? DEFAULT_MAX_BYTES;
|
|
34
|
+
let counter = 0;
|
|
35
|
+
return async (file)=>{
|
|
36
|
+
if (file.size > maxBytes) throw new external_errors_cjs_namespaceObject.AssetValidationError("DATA_URL_FILE_TOO_LARGE", `File size ${file.size} bytes exceeds the data URL adapter limit of ${maxBytes} bytes.`);
|
|
37
|
+
counter += 1;
|
|
38
|
+
const url = await readAsDataUrl(file);
|
|
39
|
+
const dimensions = await (0, external_extract_image_dimensions_cjs_namespaceObject.extractImageDimensions)(url, file.type);
|
|
40
|
+
const result = {
|
|
41
|
+
id: `asset-${counter}`,
|
|
42
|
+
url,
|
|
43
|
+
meta: {
|
|
44
|
+
size: file.size,
|
|
45
|
+
...file.type ? {
|
|
46
|
+
mimeType: file.type
|
|
47
|
+
} : {},
|
|
48
|
+
...dimensions ? {
|
|
49
|
+
width: dimensions.width,
|
|
50
|
+
height: dimensions.height
|
|
51
|
+
} : {}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return result;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function readAsDataUrl(file) {
|
|
58
|
+
return new Promise((resolve, reject)=>{
|
|
59
|
+
const reader = new FileReader();
|
|
60
|
+
reader.onerror = ()=>{
|
|
61
|
+
reject(new external_errors_cjs_namespaceObject.AssetValidationError("DATA_URL_READ_FAILED", "Failed to read file as a data URL.", {
|
|
62
|
+
cause: reader.error
|
|
63
|
+
}));
|
|
64
|
+
};
|
|
65
|
+
reader.onload = ()=>{
|
|
66
|
+
if ("string" != typeof reader.result) return void reject(new external_errors_cjs_namespaceObject.AssetValidationError("DATA_URL_READ_FAILED", "FileReader did not produce a string data URL."));
|
|
67
|
+
resolve(reader.result);
|
|
68
|
+
};
|
|
69
|
+
reader.readAsDataURL(file);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
exports.dataUrlUploader = __webpack_exports__.dataUrlUploader;
|
|
73
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
74
|
+
"dataUrlUploader"
|
|
75
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
76
|
+
Object.defineProperty(exports, '__esModule', {
|
|
77
|
+
value: true
|
|
78
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-url.d.cts","sourceRoot":"","sources":["../../src/adapters/data-url.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,aAAa,CAAC;AAG/D,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID,wBAAgB,eAAe,CAC9B,OAAO,GAAE,sBAA2B,GAClC,aAAa,CA6Bf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-url.d.ts","sourceRoot":"","sources":["../../src/adapters/data-url.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,aAAa,CAAC;AAG/D,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID,wBAAgB,eAAe,CAC9B,OAAO,GAAE,sBAA2B,GAClC,aAAa,CA6Bf"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AssetValidationError } from "../errors.js";
|
|
2
|
+
import { extractImageDimensions } from "./extract-image-dimensions.js";
|
|
3
|
+
const DEFAULT_MAX_BYTES = 1048576;
|
|
4
|
+
function dataUrlUploader(options = {}) {
|
|
5
|
+
const maxBytes = options.maxBytes ?? DEFAULT_MAX_BYTES;
|
|
6
|
+
let counter = 0;
|
|
7
|
+
return async (file)=>{
|
|
8
|
+
if (file.size > maxBytes) throw new AssetValidationError("DATA_URL_FILE_TOO_LARGE", `File size ${file.size} bytes exceeds the data URL adapter limit of ${maxBytes} bytes.`);
|
|
9
|
+
counter += 1;
|
|
10
|
+
const url = await readAsDataUrl(file);
|
|
11
|
+
const dimensions = await extractImageDimensions(url, file.type);
|
|
12
|
+
const result = {
|
|
13
|
+
id: `asset-${counter}`,
|
|
14
|
+
url,
|
|
15
|
+
meta: {
|
|
16
|
+
size: file.size,
|
|
17
|
+
...file.type ? {
|
|
18
|
+
mimeType: file.type
|
|
19
|
+
} : {},
|
|
20
|
+
...dimensions ? {
|
|
21
|
+
width: dimensions.width,
|
|
22
|
+
height: dimensions.height
|
|
23
|
+
} : {}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function readAsDataUrl(file) {
|
|
30
|
+
return new Promise((resolve, reject)=>{
|
|
31
|
+
const reader = new FileReader();
|
|
32
|
+
reader.onerror = ()=>{
|
|
33
|
+
reject(new AssetValidationError("DATA_URL_READ_FAILED", "Failed to read file as a data URL.", {
|
|
34
|
+
cause: reader.error
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
reader.onload = ()=>{
|
|
38
|
+
if ("string" != typeof reader.result) return void reject(new AssetValidationError("DATA_URL_READ_FAILED", "FileReader did not produce a string data URL."));
|
|
39
|
+
resolve(reader.result);
|
|
40
|
+
};
|
|
41
|
+
reader.readAsDataURL(file);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export { dataUrlUploader };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
extractImageDimensions: ()=>extractImageDimensions
|
|
28
|
+
});
|
|
29
|
+
const DEFAULT_TIMEOUT_MS = 3000;
|
|
30
|
+
async function extractImageDimensions(url, mimeType, options = {}) {
|
|
31
|
+
if (!mimeType || !mimeType.startsWith("image/")) return;
|
|
32
|
+
if ("u" < typeof Image) return;
|
|
33
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
34
|
+
return new Promise((resolve)=>{
|
|
35
|
+
let settled = false;
|
|
36
|
+
const image = new Image();
|
|
37
|
+
const settle = (value)=>{
|
|
38
|
+
if (settled) return;
|
|
39
|
+
settled = true;
|
|
40
|
+
image.onload = null;
|
|
41
|
+
image.onerror = null;
|
|
42
|
+
if (void 0 !== timer) clearTimeout(timer);
|
|
43
|
+
resolve(value);
|
|
44
|
+
};
|
|
45
|
+
image.onload = ()=>{
|
|
46
|
+
const width = Math.round(image.naturalWidth);
|
|
47
|
+
const height = Math.round(image.naturalHeight);
|
|
48
|
+
if (!Number.isFinite(width) || !Number.isFinite(height) || width < 1 || height < 1) return void settle(void 0);
|
|
49
|
+
settle({
|
|
50
|
+
width,
|
|
51
|
+
height
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
image.onerror = ()=>{
|
|
55
|
+
settle(void 0);
|
|
56
|
+
};
|
|
57
|
+
const timer = timeoutMs > 0 ? setTimeout(()=>{
|
|
58
|
+
settle(void 0);
|
|
59
|
+
}, timeoutMs) : void 0;
|
|
60
|
+
image.src = url;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.extractImageDimensions = __webpack_exports__.extractImageDimensions;
|
|
64
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
65
|
+
"extractImageDimensions"
|
|
66
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
67
|
+
Object.defineProperty(exports, '__esModule', {
|
|
68
|
+
value: true
|
|
69
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Best-effort image dimension extraction for reference adapters.
|
|
3
|
+
*
|
|
4
|
+
* Decodes an image URL via the `Image` constructor and resolves the
|
|
5
|
+
* `naturalWidth` / `naturalHeight`. Returns `undefined` when the runtime
|
|
6
|
+
* has no `Image` global (SSR), the MIME type is not `image/*`, the decode
|
|
7
|
+
* fails, or the timeout elapses — adapters must succeed regardless.
|
|
8
|
+
*
|
|
9
|
+
* The resolved values are integers ≥ 1; degenerate sizes (0, NaN) are
|
|
10
|
+
* filtered out so consumers can rely on the shape.
|
|
11
|
+
*/
|
|
12
|
+
export interface ExtractImageDimensionsOptions {
|
|
13
|
+
/** Abort decode after this many ms. Default 3000. */
|
|
14
|
+
readonly timeoutMs?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ImageDimensions {
|
|
17
|
+
readonly width: number;
|
|
18
|
+
readonly height: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function extractImageDimensions(url: string, mimeType: string | undefined, options?: ExtractImageDimensionsOptions): Promise<ImageDimensions | undefined>;
|
|
21
|
+
//# sourceMappingURL=extract-image-dimensions.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-image-dimensions.d.cts","sourceRoot":"","sources":["../../src/adapters/extract-image-dimensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,6BAA6B;IAC7C,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAID,wBAAsB,sBAAsB,CAC3C,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,GAAE,6BAAkC,GACzC,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAsDtC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Best-effort image dimension extraction for reference adapters.
|
|
3
|
+
*
|
|
4
|
+
* Decodes an image URL via the `Image` constructor and resolves the
|
|
5
|
+
* `naturalWidth` / `naturalHeight`. Returns `undefined` when the runtime
|
|
6
|
+
* has no `Image` global (SSR), the MIME type is not `image/*`, the decode
|
|
7
|
+
* fails, or the timeout elapses — adapters must succeed regardless.
|
|
8
|
+
*
|
|
9
|
+
* The resolved values are integers ≥ 1; degenerate sizes (0, NaN) are
|
|
10
|
+
* filtered out so consumers can rely on the shape.
|
|
11
|
+
*/
|
|
12
|
+
export interface ExtractImageDimensionsOptions {
|
|
13
|
+
/** Abort decode after this many ms. Default 3000. */
|
|
14
|
+
readonly timeoutMs?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ImageDimensions {
|
|
17
|
+
readonly width: number;
|
|
18
|
+
readonly height: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function extractImageDimensions(url: string, mimeType: string | undefined, options?: ExtractImageDimensionsOptions): Promise<ImageDimensions | undefined>;
|
|
21
|
+
//# sourceMappingURL=extract-image-dimensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-image-dimensions.d.ts","sourceRoot":"","sources":["../../src/adapters/extract-image-dimensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,6BAA6B;IAC7C,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAID,wBAAsB,sBAAsB,CAC3C,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,GAAE,6BAAkC,GACzC,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAsDtC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const DEFAULT_TIMEOUT_MS = 3000;
|
|
2
|
+
async function extractImageDimensions(url, mimeType, options = {}) {
|
|
3
|
+
if (!mimeType || !mimeType.startsWith("image/")) return;
|
|
4
|
+
if ("u" < typeof Image) return;
|
|
5
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
6
|
+
return new Promise((resolve)=>{
|
|
7
|
+
let settled = false;
|
|
8
|
+
const image = new Image();
|
|
9
|
+
const settle = (value)=>{
|
|
10
|
+
if (settled) return;
|
|
11
|
+
settled = true;
|
|
12
|
+
image.onload = null;
|
|
13
|
+
image.onerror = null;
|
|
14
|
+
if (void 0 !== timer) clearTimeout(timer);
|
|
15
|
+
resolve(value);
|
|
16
|
+
};
|
|
17
|
+
image.onload = ()=>{
|
|
18
|
+
const width = Math.round(image.naturalWidth);
|
|
19
|
+
const height = Math.round(image.naturalHeight);
|
|
20
|
+
if (!Number.isFinite(width) || !Number.isFinite(height) || width < 1 || height < 1) return void settle(void 0);
|
|
21
|
+
settle({
|
|
22
|
+
width,
|
|
23
|
+
height
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
image.onerror = ()=>{
|
|
27
|
+
settle(void 0);
|
|
28
|
+
};
|
|
29
|
+
const timer = timeoutMs > 0 ? setTimeout(()=>{
|
|
30
|
+
settle(void 0);
|
|
31
|
+
}, timeoutMs) : void 0;
|
|
32
|
+
image.src = url;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export { extractImageDimensions };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
inMemoryUploader: ()=>inMemoryUploader
|
|
28
|
+
});
|
|
29
|
+
const external_extract_image_dimensions_cjs_namespaceObject = require("./extract-image-dimensions.cjs");
|
|
30
|
+
function inMemoryUploader() {
|
|
31
|
+
const filesById = new Map();
|
|
32
|
+
let counter = 0;
|
|
33
|
+
return async (file)=>{
|
|
34
|
+
counter += 1;
|
|
35
|
+
const id = `asset-${counter}`;
|
|
36
|
+
filesById.set(id, file);
|
|
37
|
+
const url = "function" == typeof URL.createObjectURL ? URL.createObjectURL(file) : `blob:asset-manager/${id}`;
|
|
38
|
+
const dimensions = await (0, external_extract_image_dimensions_cjs_namespaceObject.extractImageDimensions)(url, file.type);
|
|
39
|
+
const result = {
|
|
40
|
+
id,
|
|
41
|
+
url,
|
|
42
|
+
meta: {
|
|
43
|
+
size: file.size,
|
|
44
|
+
...file.type ? {
|
|
45
|
+
mimeType: file.type
|
|
46
|
+
} : {},
|
|
47
|
+
...dimensions ? {
|
|
48
|
+
width: dimensions.width,
|
|
49
|
+
height: dimensions.height
|
|
50
|
+
} : {}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
exports.inMemoryUploader = __webpack_exports__.inMemoryUploader;
|
|
57
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
58
|
+
"inMemoryUploader"
|
|
59
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
60
|
+
Object.defineProperty(exports, '__esModule', {
|
|
61
|
+
value: true
|
|
62
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory.d.cts","sourceRoot":"","sources":["../../src/adapters/in-memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,aAAa,CAAC;AAG/D,wBAAgB,gBAAgB,IAAI,aAAa,CA8BhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory.d.ts","sourceRoot":"","sources":["../../src/adapters/in-memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,aAAa,CAAC;AAG/D,wBAAgB,gBAAgB,IAAI,aAAa,CA8BhD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { extractImageDimensions } from "./extract-image-dimensions.js";
|
|
2
|
+
function inMemoryUploader() {
|
|
3
|
+
const filesById = new Map();
|
|
4
|
+
let counter = 0;
|
|
5
|
+
return async (file)=>{
|
|
6
|
+
counter += 1;
|
|
7
|
+
const id = `asset-${counter}`;
|
|
8
|
+
filesById.set(id, file);
|
|
9
|
+
const url = "function" == typeof URL.createObjectURL ? URL.createObjectURL(file) : `blob:asset-manager/${id}`;
|
|
10
|
+
const dimensions = await extractImageDimensions(url, file.type);
|
|
11
|
+
const result = {
|
|
12
|
+
id,
|
|
13
|
+
url,
|
|
14
|
+
meta: {
|
|
15
|
+
size: file.size,
|
|
16
|
+
...file.type ? {
|
|
17
|
+
mimeType: file.type
|
|
18
|
+
} : {},
|
|
19
|
+
...dimensions ? {
|
|
20
|
+
width: dimensions.width,
|
|
21
|
+
height: dimensions.height
|
|
22
|
+
} : {}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export { inMemoryUploader };
|