@edgestore/server 1.0.0-next.5 → 1.0.0-rc.6
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/agent-docs/README.md +1 -1
- package/agent-docs/astro.md +1 -1
- package/agent-docs/backend-client.md +5 -8
- package/agent-docs/express.md +1 -1
- package/agent-docs/fastify.md +1 -1
- package/agent-docs/hono.md +1 -1
- package/agent-docs/next.md +1 -1
- package/agent-docs/provider-azure-blob.md +150 -57
- package/agent-docs/provider-custom.md +17 -3
- package/agent-docs/provider-s3.md +4 -3
- package/agent-docs/remix.md +1 -1
- package/agent-docs/tanstack-start.md +1 -1
- package/dist/adapters/shared.d.ts +12 -102
- package/dist/adapters/shared.d.ts.map +1 -1
- package/dist/adapters/shared.js +63 -108
- package/dist/core/client/index.d.ts +0 -4
- package/dist/core/client/index.d.ts.map +1 -1
- package/dist/core/provider.d.ts +0 -1
- package/dist/core/provider.d.ts.map +1 -1
- package/dist/core/provider.js +1 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/providers/azure-blob/blocks.d.ts +48 -0
- package/dist/providers/azure-blob/blocks.d.ts.map +1 -0
- package/dist/providers/azure-blob/blocks.js +126 -0
- package/dist/providers/azure-blob/index.d.ts +76 -51
- package/dist/providers/azure-blob/index.d.ts.map +1 -1
- package/dist/providers/azure-blob/index.js +189 -107
- package/dist/providers/edgestore/index.d.ts +6 -22
- package/dist/providers/edgestore/index.d.ts.map +1 -1
- package/dist/providers/edgestore/index.js +19 -18
- package/dist/providers/s3/backendUpload.d.ts +2 -5
- package/dist/providers/s3/backendUpload.d.ts.map +1 -1
- package/dist/providers/s3/backendUpload.js +19 -57
- package/dist/providers/s3/index.d.ts +3 -12
- package/dist/providers/s3/index.d.ts.map +1 -1
- package/dist/providers/s3/index.js +23 -44
- package/dist/providers/s3/multipart.d.ts +3 -5
- package/dist/providers/s3/multipart.d.ts.map +1 -1
- package/dist/providers/s3/multipart.js +26 -62
- package/dist/providers/s3/options.d.ts +10 -32
- package/dist/providers/s3/options.d.ts.map +1 -1
- package/dist/providers/storage/multipartSession.d.ts +51 -0
- package/dist/providers/storage/multipartSession.d.ts.map +1 -0
- package/dist/providers/storage/multipartSession.js +83 -0
- package/dist/providers/storage/objectKeys.d.ts +41 -0
- package/dist/providers/storage/objectKeys.d.ts.map +1 -0
- package/dist/providers/{s3/keys.js → storage/objectKeys.js} +31 -4
- package/dist/providers/storage/transfer.d.ts +18 -0
- package/dist/providers/storage/transfer.d.ts.map +1 -0
- package/dist/providers/storage/transfer.js +69 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +4 -11
- package/src/adapters/shared.ts +81 -127
- package/src/core/client/index.ts +0 -4
- package/src/core/provider.ts +0 -8
- package/src/index.ts +3 -8
- package/src/providers/azure-blob/blocks.ts +201 -0
- package/src/providers/azure-blob/index.ts +289 -171
- package/src/providers/edgestore/index.ts +19 -22
- package/src/providers/s3/backendUpload.ts +20 -55
- package/src/providers/s3/index.ts +31 -58
- package/src/providers/s3/multipart.ts +36 -94
- package/src/providers/s3/options.ts +10 -33
- package/src/providers/storage/multipartSession.ts +145 -0
- package/src/providers/storage/objectKeys.ts +106 -0
- package/src/providers/storage/transfer.ts +105 -0
- package/src/version.ts +1 -1
- package/core/index.d.ts +0 -1
- package/core/index.js +0 -1
- package/dist/core/index.d.ts +0 -4
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -3
- package/dist/providers/s3/keys.d.ts +0 -10
- package/dist/providers/s3/keys.d.ts.map +0 -1
- package/src/core/index.ts +0 -9
- package/src/providers/s3/keys.ts +0 -59
package/agent-docs/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @edgestore/server 1.0.0-
|
|
1
|
+
# @edgestore/server 1.0.0-rc.6: agent references
|
|
2
2
|
|
|
3
3
|
These references ship with this exact package version. Prefer them over newer online examples.
|
|
4
4
|
Generated from the authored documentation; do not edit these files directly.
|
package/agent-docs/astro.md
CHANGED
|
@@ -54,12 +54,11 @@ export { handler as GET, handler as POST };
|
|
|
54
54
|
> `accessControl`, `beforeUpload`, or `beforeDelete`. Perform authorization in
|
|
55
55
|
> the server code that calls it.
|
|
56
56
|
|
|
57
|
-
The hosted `edgestore()` provider supports the complete backend client. S3
|
|
58
|
-
|
|
59
|
-
`createSignedUrl` / `createSignedUrls`, accepting key or URL
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
upload, remain absent from each provider's client type.
|
|
57
|
+
The hosted `edgestore()` provider supports the complete backend client. S3 and
|
|
58
|
+
Azure Blob Storage support `upload`, `get`, `delete`, `deleteMany`, and
|
|
59
|
+
private-read `createSignedUrl` / `createSignedUrls`, accepting key or URL
|
|
60
|
+
references. Unsupported operations, such as listing and confirmation, remain
|
|
61
|
+
absent from each provider's client type.
|
|
63
62
|
|
|
64
63
|
## Backend Upload
|
|
65
64
|
|
|
@@ -280,5 +279,3 @@ type UploadOutput = BackendOutputs['publicFiles']['upload'];
|
|
|
280
279
|
The helpers infer capabilities and provider-specific types directly from the
|
|
281
280
|
router, including custom providers. Use `EdgeStoreClient<typeof router>` for
|
|
282
281
|
the complete backend client type.
|
|
283
|
-
|
|
284
|
-
`InferClientResponse` remains as a deprecated alias of `InferClientOutputs`.
|
package/agent-docs/express.md
CHANGED
package/agent-docs/fastify.md
CHANGED
package/agent-docs/hono.md
CHANGED
|
@@ -11,7 +11,7 @@ Install `@edgestore/server` in the backend and `@edgestore/react` in the fronten
|
|
|
11
11
|
Packages to install (use the application’s package manager):
|
|
12
12
|
|
|
13
13
|
```text
|
|
14
|
-
@edgestore/server @edgestore/react
|
|
14
|
+
@edgestore/server@rc @edgestore/react@rc
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
### Environment variables
|
package/agent-docs/next.md
CHANGED
|
@@ -2,84 +2,177 @@
|
|
|
2
2
|
|
|
3
3
|
Source: https://next.edgestore.dev/docs/providers/azure-blob
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Use the Azure Blob provider when your files must live in your own Azure
|
|
6
|
+
storage account. It supports direct browser uploads, automatic block uploads
|
|
7
|
+
for large files, backend uploads, private signed reads, and stable key
|
|
8
|
+
references. Your application owns the container's CORS, access, and lifecycle
|
|
9
|
+
configuration.
|
|
6
10
|
|
|
7
11
|
The provider creates short-lived, blob-scoped SAS URLs for browser uploads and
|
|
8
|
-
private reads.
|
|
9
|
-
features such as image processing
|
|
12
|
+
private reads. The account key stays on the server, and permanent file URLs
|
|
13
|
+
never contain credentials. Hosted features such as image processing are not
|
|
14
|
+
available.
|
|
10
15
|
|
|
11
16
|
## Installation
|
|
12
17
|
|
|
13
|
-
You need to install some peer dependencies to use this provider.
|
|
14
|
-
|
|
15
18
|
Packages to install (use the application’s package manager):
|
|
16
19
|
|
|
17
20
|
```text
|
|
18
21
|
@azure/storage-blob
|
|
19
22
|
```
|
|
20
23
|
|
|
21
|
-
Chain `.provider()` when defining your router, then pass the router to the adapter.
|
|
22
|
-
|
|
23
24
|
```ts
|
|
24
25
|
import { initEdgeStore } from '@edgestore/server';
|
|
25
|
-
import {
|
|
26
|
-
createEdgeStoreNextHandler,
|
|
27
|
-
type CreateContextOptions,
|
|
28
|
-
} from '@edgestore/server/adapters/next/pages';
|
|
29
|
-
// [!code ++]
|
|
30
26
|
import { azureBlob } from '@edgestore/server/providers/azure-blob';
|
|
31
|
-
import { z } from 'zod';
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
const es = initEdgeStore.create();
|
|
29
|
+
export const router = es.router({
|
|
30
|
+
documents: es.fileBucket().accessControl('private'),
|
|
31
|
+
}).provider(
|
|
32
|
+
azureBlob({
|
|
33
|
+
storageAccountName: 'myaccount',
|
|
34
|
+
containerName: 'edgestore',
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export type EdgeStoreRouter = typeof router;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Pass `router` to your framework adapter as its `router` option. Set
|
|
42
|
+
`ES_AZURE_ACCOUNT_KEY` on the server, and set `EDGE_STORE_JWT_SECRET` to a
|
|
43
|
+
stable random secret, for example one generated with `openssl rand -base64 32`.
|
|
44
|
+
All application instances must share it. Credentials are only checked when the
|
|
45
|
+
provider is first used, so defining a router does not require them.
|
|
46
|
+
|
|
47
|
+
| Option | Default / environment variable |
|
|
48
|
+
| ---------------------------- | ---------------------------------------------------------------------------------------- |
|
|
49
|
+
| `storageAccountName` | `ES_AZURE_ACCOUNT_NAME` |
|
|
50
|
+
| `storageAccountKey` | `ES_AZURE_ACCOUNT_KEY` |
|
|
51
|
+
| `containerName` | `ES_AZURE_CONTAINER_NAME` |
|
|
52
|
+
| `endpoint` | `ES_AZURE_ENDPOINT`, otherwise `https://<account>.blob.core.windows.net` |
|
|
53
|
+
| `baseUrl` | `EDGE_STORE_BASE_URL`, otherwise `<endpoint>/<container>` |
|
|
54
|
+
| `uploadUrlExpiresIn` | 3600 seconds |
|
|
55
|
+
| `signedUrlExpiresIn` | 3600 seconds |
|
|
56
|
+
| `multipart.thresholdBytes` | 100 MiB |
|
|
57
|
+
| `multipart.partSizeBytes` | 16 MiB; minimum 5 MiB, maximum 4000 MiB |
|
|
58
|
+
| `multipart.sessionExpiresIn` | 86400 seconds |
|
|
59
|
+
| `jwtSecret` | Multipart signing override; otherwise `EDGE_STORE_JWT_SECRET` or `EDGE_STORE_SECRET_KEY` |
|
|
60
|
+
|
|
61
|
+
Signed URL lifetimes must be between 1 and 604800 seconds. Upload URLs grant
|
|
62
|
+
only create/write permission on one blob, and read URLs grant only read
|
|
63
|
+
permission.
|
|
64
|
+
|
|
65
|
+
## Paths and object settings
|
|
66
|
+
|
|
67
|
+
Blobs are stored as `<router bucket>/<path>`. The default path adds `_public/`
|
|
68
|
+
for public buckets, then the router path values and the file name. Use `path`
|
|
69
|
+
to change everything after the router bucket, which is always kept:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
azureBlob({
|
|
73
|
+
path: ({ defaultPath }) => `tenants/${defaultPath}`,
|
|
74
|
+
objectOptions: {
|
|
75
|
+
cacheControl: 'private, max-age=3600',
|
|
76
|
+
contentDisposition: 'attachment',
|
|
77
|
+
metadata: { source: 'edgestore' },
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`objectOptions` can also be a function that receives the same arguments as
|
|
83
|
+
`path`. The content type comes from the uploaded file. Browser and backend
|
|
84
|
+
uploads apply the same settings.
|
|
85
|
+
|
|
86
|
+
## Large files and cancellation
|
|
87
|
+
|
|
88
|
+
Files above the threshold are uploaded as blocks, in parallel, with retries.
|
|
89
|
+
The browser requests block upload URLs as it reaches each block, so
|
|
90
|
+
`uploadUrlExpiresIn` only needs to cover one block transfer. A session can
|
|
91
|
+
request URLs and complete until `multipart.sessionExpiresIn` passes. Before
|
|
92
|
+
committing, the provider checks that every block exists with the expected size,
|
|
93
|
+
which catches incomplete uploads.
|
|
34
94
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}).provider(azureBlob());
|
|
95
|
+
Azure has no multipart session to cancel. Blocks that are never committed are
|
|
96
|
+
discarded automatically after seven days, so canceled and failed uploads need
|
|
97
|
+
no lifecycle rule.
|
|
39
98
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
99
|
+
Backend uploads use the same paths, object settings, and block configuration,
|
|
100
|
+
and send up to four blocks at a time.
|
|
101
|
+
|
|
102
|
+
## Private files
|
|
103
|
+
|
|
104
|
+
Use `accessControl('private')` for private buckets. Cookie-based access-control
|
|
105
|
+
rules are not supported and fail at initialization. Create read URLs from the
|
|
106
|
+
backend client:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
const { signedUrl } = await router.client.documents.createSignedUrl({
|
|
110
|
+
url: { key: 'documents/report.pdf' },
|
|
111
|
+
expiresIn: 300,
|
|
43
112
|
});
|
|
44
113
|
```
|
|
45
114
|
|
|
46
|
-
|
|
115
|
+
Add `.autoSignedUrls({ expiresIn: 300 })` to a private router bucket to receive
|
|
116
|
+
a read URL with each upload response.
|
|
117
|
+
|
|
118
|
+
## Container configuration
|
|
119
|
+
|
|
120
|
+
Keep the container private. Azure grants anonymous read access to a whole
|
|
121
|
+
container, not to a prefix, so public buckets need their own read path.
|
|
122
|
+
Public uploads return an unsigned URL under `_public/`, which a private
|
|
123
|
+
container answers with 403. Either:
|
|
124
|
+
|
|
125
|
+
* serve `_public/` through a CDN or proxy that can read the private container,
|
|
126
|
+
such as Azure Front Door with a private origin, and set `baseUrl` to it; or
|
|
127
|
+
* if the container holds only public buckets, set its public access level to
|
|
128
|
+
**Blob** (anonymous reads of individual blobs, no listing). Every file in
|
|
129
|
+
that container is then readable by URL, so never combine this with private
|
|
130
|
+
buckets.
|
|
131
|
+
|
|
132
|
+
Configure blob service CORS for your application origins so browsers can
|
|
133
|
+
upload:
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
[{
|
|
137
|
+
"AllowedOrigins": ["http://localhost:3000", "https://app.example.com"],
|
|
138
|
+
"AllowedMethods": ["PUT", "GET", "HEAD"],
|
|
139
|
+
"AllowedHeaders": ["*"],
|
|
140
|
+
"ExposedHeaders": ["*"],
|
|
141
|
+
"MaxAgeInSeconds": 3600
|
|
142
|
+
}]
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Local development with Azurite
|
|
146
|
+
|
|
147
|
+
[Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite)
|
|
148
|
+
emulates Blob Storage locally:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
docker run -p 10000:10000 mcr.microsoft.com/azure-storage/azurite azurite-blob --blobHost 0.0.0.0
|
|
152
|
+
```
|
|
47
153
|
|
|
48
154
|
```ts
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
* Can also be set via the `ES_AZURE_ACCOUNT_KEY` environment variable.
|
|
58
|
-
*/
|
|
59
|
-
storageAccountKey?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Azure Blob Storage container name
|
|
62
|
-
* Can also be set via the `ES_AZURE_CONTAINER_NAME` environment variable.
|
|
63
|
-
*/
|
|
64
|
-
containerName?: string;
|
|
65
|
-
/**
|
|
66
|
-
* Optional base URL for Azurite or another compatible endpoint.
|
|
67
|
-
* Can also be set via the `ES_AZURE_BASE_URL` environment variable.
|
|
68
|
-
*/
|
|
69
|
-
customBaseUrl?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Lifetime of browser upload URLs in seconds.
|
|
72
|
-
* @default 3600
|
|
73
|
-
*/
|
|
74
|
-
uploadUrlExpiresIn?: number;
|
|
75
|
-
/**
|
|
76
|
-
* Default lifetime of private read URLs in seconds.
|
|
77
|
-
* @default 3600
|
|
78
|
-
*/
|
|
79
|
-
signedUrlExpiresIn?: number;
|
|
80
|
-
};
|
|
155
|
+
azureBlob({
|
|
156
|
+
storageAccountName: 'devstoreaccount1',
|
|
157
|
+
// Azurite's documented development account key.
|
|
158
|
+
storageAccountKey:
|
|
159
|
+
'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
|
|
160
|
+
containerName: 'edgestore',
|
|
161
|
+
endpoint: 'http://127.0.0.1:10000/devstoreaccount1',
|
|
162
|
+
});
|
|
81
163
|
```
|
|
82
164
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
165
|
+
## Limitations
|
|
166
|
+
|
|
167
|
+
* `temporary` and `replaceTargetUrl` are rejected. Track application-owned files
|
|
168
|
+
in your database and delete old files after a successful replacement.
|
|
169
|
+
* Azure SAS URLs grant write access to one blob and cannot limit its size or
|
|
170
|
+
the write operation. A browser holding an upload URL can therefore write
|
|
171
|
+
that blob directly, with any size and blob headers. The router's `maxSize`,
|
|
172
|
+
mime-type checks, and `objectOptions` apply to the declared upload and to
|
|
173
|
+
backend uploads, but are not enforced on bytes a browser sends. If you need
|
|
174
|
+
those guarantees, validate each stored blob after upload from a storage
|
|
175
|
+
event, for example an Event Grid `BlobCreated` subscription that triggers an
|
|
176
|
+
Azure Function, and delete blobs that fail your checks.
|
|
177
|
+
* Confirmation, listing, restore, and generated thumbnails are unsupported.
|
|
178
|
+
* Only account-key authentication is supported.
|
|
@@ -40,7 +40,6 @@ const baseUrl = 'https://files.example.com';
|
|
|
40
40
|
|
|
41
41
|
export const myProvider = defineProvider({
|
|
42
42
|
name: 'my-storage',
|
|
43
|
-
baseUrl,
|
|
44
43
|
async init() {
|
|
45
44
|
return {};
|
|
46
45
|
},
|
|
@@ -55,7 +54,7 @@ export const myProvider = defineProvider({
|
|
|
55
54
|
const key = storage.createKey({ bucketName, fileInfo });
|
|
56
55
|
return {
|
|
57
56
|
uploadUrl: await storage.signUpload(key),
|
|
58
|
-
|
|
57
|
+
url: `${baseUrl}/${key}`,
|
|
59
58
|
};
|
|
60
59
|
},
|
|
61
60
|
},
|
|
@@ -81,6 +80,22 @@ export const myProvider = defineProvider({
|
|
|
81
80
|
The resulting backend client exposes `get`, but not `upload`, `list`, or
|
|
82
81
|
mutations, because those optional capabilities were not defined.
|
|
83
82
|
|
|
83
|
+
`init` runs when the browser initializes EdgeStore. Return `{}` unless the
|
|
84
|
+
browser must prepare access to your file origin before loading protected
|
|
85
|
+
files. In that case, return `clientInit` with the absolute URLs to request and
|
|
86
|
+
any headers to send; the browser calls each URL with credentials:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
async init({ ctx }) {
|
|
90
|
+
return {
|
|
91
|
+
clientInit: {
|
|
92
|
+
urls: ['https://files.example.com/_init'],
|
|
93
|
+
headers: { 'x-file-token': await createFileToken(ctx) },
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
```
|
|
98
|
+
|
|
84
99
|
## Complete provider
|
|
85
100
|
|
|
86
101
|
A complete provider can add direct backend uploads, pagination, mutations, and
|
|
@@ -115,7 +130,6 @@ const toFile = (object: Awaited<ReturnType<typeof storage.head>>) => ({
|
|
|
115
130
|
|
|
116
131
|
export const myProvider = defineProvider({
|
|
117
132
|
name: 'my-storage',
|
|
118
|
-
baseUrl,
|
|
119
133
|
async init() {
|
|
120
134
|
return {};
|
|
121
135
|
},
|
|
@@ -39,9 +39,10 @@ Pass `router` to your framework adapter as its `router` option.
|
|
|
39
39
|
Set `EDGE_STORE_JWT_SECRET` to a stable random secret, for example one generated
|
|
40
40
|
with `openssl rand -base64 32`. All application instances must share it.
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
Pass `credentials` with an AWS credentials object or provider function. If it
|
|
43
|
+
is unset, `ES_AWS_ACCESS_KEY_ID` and `ES_AWS_SECRET_ACCESS_KEY` are used when
|
|
44
|
+
both are set; otherwise the AWS SDK's default provider chain applies, including
|
|
45
|
+
environment variables, shared config, and instance/task roles.
|
|
45
46
|
|
|
46
47
|
| Option | Default / environment variable |
|
|
47
48
|
| ---------------------------- | ---------------------------------------------------------------------------------------- |
|
package/agent-docs/remix.md
CHANGED
|
@@ -12,7 +12,7 @@ React Router application needs a separate backend; this route runs on the server
|
|
|
12
12
|
Packages to install (use the application’s package manager):
|
|
13
13
|
|
|
14
14
|
```text
|
|
15
|
-
@edgestore/server @edgestore/react
|
|
15
|
+
@edgestore/server@rc @edgestore/react@rc
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
### Environment variables
|
|
@@ -77,44 +77,8 @@ export declare const requestUploadBodySchema: z.ZodObject<{
|
|
|
77
77
|
fileName: z.ZodOptional<z.ZodString>;
|
|
78
78
|
replaceTargetUrl: z.ZodOptional<z.ZodString>;
|
|
79
79
|
temporary: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
type: string;
|
|
83
|
-
extension: string;
|
|
84
|
-
size: number;
|
|
85
|
-
replaceTargetUrl?: string | undefined;
|
|
86
|
-
fileName?: string | undefined;
|
|
87
|
-
}, {
|
|
88
|
-
type: string;
|
|
89
|
-
extension: string;
|
|
90
|
-
size: number;
|
|
91
|
-
temporary?: boolean | undefined;
|
|
92
|
-
replaceTargetUrl?: string | undefined;
|
|
93
|
-
fileName?: string | undefined;
|
|
94
|
-
}>;
|
|
95
|
-
}, "strip", z.ZodTypeAny, {
|
|
96
|
-
bucketName: string;
|
|
97
|
-
fileInfo: {
|
|
98
|
-
temporary: boolean;
|
|
99
|
-
type: string;
|
|
100
|
-
extension: string;
|
|
101
|
-
size: number;
|
|
102
|
-
replaceTargetUrl?: string | undefined;
|
|
103
|
-
fileName?: string | undefined;
|
|
104
|
-
};
|
|
105
|
-
input?: unknown;
|
|
106
|
-
}, {
|
|
107
|
-
bucketName: string;
|
|
108
|
-
fileInfo: {
|
|
109
|
-
type: string;
|
|
110
|
-
extension: string;
|
|
111
|
-
size: number;
|
|
112
|
-
temporary?: boolean | undefined;
|
|
113
|
-
replaceTargetUrl?: string | undefined;
|
|
114
|
-
fileName?: string | undefined;
|
|
115
|
-
};
|
|
116
|
-
input?: unknown;
|
|
117
|
-
}>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
}, z.core.$strip>;
|
|
118
82
|
export type RequestUploadBody = z.infer<typeof requestUploadBodySchema>;
|
|
119
83
|
export declare function requestUpload<TCtx extends AnyContext>(params: {
|
|
120
84
|
provider: AnyEdgeStoreProvider;
|
|
@@ -127,64 +91,22 @@ export declare const requestUploadPartsBodySchema: z.ZodObject<{
|
|
|
127
91
|
bucketName: z.ZodString;
|
|
128
92
|
uploadId: z.ZodString;
|
|
129
93
|
key: z.ZodString;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}, "strip", z.ZodTypeAny, {
|
|
133
|
-
key: string;
|
|
134
|
-
bucketName: string;
|
|
135
|
-
uploadId: string;
|
|
136
|
-
parts: number[];
|
|
137
|
-
}, {
|
|
138
|
-
key: string;
|
|
139
|
-
bucketName: string;
|
|
140
|
-
uploadId: string;
|
|
141
|
-
parts: number[];
|
|
142
|
-
}>;
|
|
94
|
+
parts: z.ZodArray<z.ZodNumber>;
|
|
95
|
+
}, z.core.$strip>;
|
|
143
96
|
export declare const completeMultipartUploadBodySchema: z.ZodObject<{
|
|
144
97
|
bucketName: z.ZodString;
|
|
145
98
|
uploadId: z.ZodString;
|
|
146
99
|
key: z.ZodString;
|
|
147
|
-
} & {
|
|
148
100
|
parts: z.ZodArray<z.ZodObject<{
|
|
149
101
|
partNumber: z.ZodNumber;
|
|
150
|
-
eTag: z.ZodString
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
eTag: string;
|
|
154
|
-
}, {
|
|
155
|
-
partNumber: number;
|
|
156
|
-
eTag: string;
|
|
157
|
-
}>, "many">;
|
|
158
|
-
}, "strip", z.ZodTypeAny, {
|
|
159
|
-
key: string;
|
|
160
|
-
bucketName: string;
|
|
161
|
-
uploadId: string;
|
|
162
|
-
parts: {
|
|
163
|
-
partNumber: number;
|
|
164
|
-
eTag: string;
|
|
165
|
-
}[];
|
|
166
|
-
}, {
|
|
167
|
-
key: string;
|
|
168
|
-
bucketName: string;
|
|
169
|
-
uploadId: string;
|
|
170
|
-
parts: {
|
|
171
|
-
partNumber: number;
|
|
172
|
-
eTag: string;
|
|
173
|
-
}[];
|
|
174
|
-
}>;
|
|
102
|
+
eTag: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
175
105
|
export declare const abortMultipartUploadBodySchema: z.ZodObject<{
|
|
176
106
|
bucketName: z.ZodString;
|
|
177
107
|
uploadId: z.ZodString;
|
|
178
108
|
key: z.ZodString;
|
|
179
|
-
},
|
|
180
|
-
key: string;
|
|
181
|
-
bucketName: string;
|
|
182
|
-
uploadId: string;
|
|
183
|
-
}, {
|
|
184
|
-
key: string;
|
|
185
|
-
bucketName: string;
|
|
186
|
-
uploadId: string;
|
|
187
|
-
}>;
|
|
109
|
+
}, z.core.$strip>;
|
|
188
110
|
export type RequestUploadPartsBody = z.infer<typeof requestUploadPartsBodySchema>;
|
|
189
111
|
export type CompleteMultipartUploadBody = z.infer<typeof completeMultipartUploadBodySchema>;
|
|
190
112
|
export type AbortMultipartUploadBody = z.infer<typeof abortMultipartUploadBodySchema>;
|
|
@@ -200,14 +122,8 @@ export declare function completeMultipartUpload<TCtx extends AnyContext>(params:
|
|
|
200
122
|
export declare function abortMultipartUpload<TCtx extends AnyContext>(params: MultipartRequest<TCtx, AbortMultipartUploadBody>): Promise<void>;
|
|
201
123
|
export declare const confirmUploadsBodySchema: z.ZodObject<{
|
|
202
124
|
bucketName: z.ZodString;
|
|
203
|
-
urls: z.ZodArray<z.ZodString
|
|
204
|
-
},
|
|
205
|
-
urls: string[];
|
|
206
|
-
bucketName: string;
|
|
207
|
-
}, {
|
|
208
|
-
urls: string[];
|
|
209
|
-
bucketName: string;
|
|
210
|
-
}>;
|
|
125
|
+
urls: z.ZodArray<z.ZodString>;
|
|
126
|
+
}, z.core.$strip>;
|
|
211
127
|
export type ConfirmUploadsBody = z.infer<typeof confirmUploadsBodySchema>;
|
|
212
128
|
export declare function confirmUploads<TCtx extends AnyContext>(params: {
|
|
213
129
|
provider: AnyEdgeStoreProvider;
|
|
@@ -218,14 +134,8 @@ export declare function confirmUploads<TCtx extends AnyContext>(params: {
|
|
|
218
134
|
}): Promise<SharedConfirmUploadsRes>;
|
|
219
135
|
export declare const deleteFilesBodySchema: z.ZodObject<{
|
|
220
136
|
bucketName: z.ZodString;
|
|
221
|
-
urls: z.ZodArray<z.ZodString
|
|
222
|
-
},
|
|
223
|
-
urls: string[];
|
|
224
|
-
bucketName: string;
|
|
225
|
-
}, {
|
|
226
|
-
urls: string[];
|
|
227
|
-
bucketName: string;
|
|
228
|
-
}>;
|
|
137
|
+
urls: z.ZodArray<z.ZodString>;
|
|
138
|
+
}, z.core.$strip>;
|
|
229
139
|
export type DeleteFilesBody = z.infer<typeof deleteFilesBodySchema>;
|
|
230
140
|
export declare function deleteFiles<TCtx extends AnyContext>(params: {
|
|
231
141
|
provider: AnyEdgeStoreProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/adapters/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,eAAe,EAEpB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/adapters/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,eAAe,EAEpB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKjD,MAAM,MAAM,aAAa,CAAC,IAAI,SAAS,UAAU,IAAI,eAAe,CAAC,IAAI,CAAC,GAAG;IAC3E,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAA;KAAE,CAAC;CAC5D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,GA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