@transloadit/convex 0.0.5 → 0.1.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/README.md +31 -212
- package/dist/client/index.d.ts +39 -92
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +34 -104
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/component.d.ts +18 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/apiUtils.d.ts +1 -32
- package/dist/component/apiUtils.d.ts.map +1 -1
- package/dist/component/apiUtils.js.map +1 -1
- package/dist/component/lib.d.ts +33 -90
- package/dist/component/lib.d.ts.map +1 -1
- package/dist/component/lib.js +48 -157
- package/dist/component/lib.js.map +1 -1
- package/dist/component/schema.d.ts +4 -4
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +3 -31
- package/dist/component/schema.js.map +1 -1
- package/dist/shared/schemas.d.ts +419 -0
- package/dist/shared/schemas.d.ts.map +1 -0
- package/dist/shared/schemas.js +194 -0
- package/dist/shared/schemas.js.map +1 -0
- package/dist/test/index.d.ts +4 -4
- package/package.json +6 -16
- package/src/client/index.ts +68 -123
- package/src/component/_generated/component.ts +17 -0
- package/src/component/apiUtils.ts +7 -38
- package/src/component/lib.test.ts +19 -0
- package/src/component/lib.ts +80 -180
- package/src/component/schema.ts +3 -31
- package/src/shared/schemas.ts +279 -0
- package/dist/react/index.d.ts +0 -281
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -784
- package/dist/react/index.js.map +0 -1
- package/dist/shared/tusUpload.d.ts +0 -13
- package/dist/shared/tusUpload.d.ts.map +0 -1
- package/dist/shared/tusUpload.js +0 -32
- package/dist/shared/tusUpload.js.map +0 -1
- package/src/react/index.test.tsx +0 -340
- package/src/react/index.tsx +0 -1245
- package/src/react/uploadWithTus.test.tsx +0 -192
- package/src/shared/tusUpload.ts +0 -59
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Transloadit Convex Component
|
|
2
2
|
|
|
3
|
-
A Convex component for creating Transloadit Assemblies,
|
|
3
|
+
A Convex component for creating Transloadit Assemblies, signing Uppy uploads, and persisting status/results in Convex.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- Create Assemblies with Templates or inline Steps.
|
|
8
|
-
-
|
|
8
|
+
- Signed upload options for Uppy + `@uppy/transloadit`.
|
|
9
9
|
- Webhook ingestion with signature verification (direct or queued).
|
|
10
10
|
- Persist Assembly status + results in Convex tables.
|
|
11
|
-
- Typed API wrappers and
|
|
11
|
+
- Typed API wrappers and helpers.
|
|
12
12
|
|
|
13
13
|
## Requirements
|
|
14
14
|
|
|
@@ -45,8 +45,8 @@ npx convex env set TRANSLOADIT_SECRET <your_auth_secret>
|
|
|
45
45
|
|
|
46
46
|
## Golden path (secure by default)
|
|
47
47
|
|
|
48
|
-
1. **Server-only create**: a Convex action creates
|
|
49
|
-
2. **Client upload**: use `
|
|
48
|
+
1. **Server-only create**: a Convex action creates signed `assemblyOptions` (auth secret stays server-side).
|
|
49
|
+
2. **Client upload**: use Uppy + `@uppy/transloadit` with `assemblyOptions()`.
|
|
50
50
|
3. **Webhook ingestion**: verify the signature and `queueWebhook` for durable processing.
|
|
51
51
|
4. **Realtime UI**: query status/results and render the gallery.
|
|
52
52
|
|
|
@@ -59,6 +59,7 @@ import { components } from "./_generated/api";
|
|
|
59
59
|
|
|
60
60
|
export const {
|
|
61
61
|
createAssembly,
|
|
62
|
+
createAssemblyOptions,
|
|
62
63
|
handleWebhook,
|
|
63
64
|
queueWebhook,
|
|
64
65
|
refreshAssembly,
|
|
@@ -80,7 +81,7 @@ assemblies 1 ──── * results
|
|
|
80
81
|
```
|
|
81
82
|
|
|
82
83
|
- `assemblies`: one row per Transloadit Assembly (status/ok, notify URL, uploads, raw payload, etc).
|
|
83
|
-
- `results`: one row per output file,
|
|
84
|
+
- `results`: one row per output file, grouped by `assemblyId` + `stepName` (a step can yield multiple rows). Each row includes normalized fields (name/size/mime/url), optional `resultId`, and the raw Transloadit output object.
|
|
84
85
|
|
|
85
86
|
Lifecycle:
|
|
86
87
|
1. `createAssembly` inserts the initial `assemblies` row.
|
|
@@ -129,222 +130,40 @@ const transloadit = new Transloadit(components.transloadit, {
|
|
|
129
130
|
});
|
|
130
131
|
```
|
|
131
132
|
|
|
132
|
-
##
|
|
133
|
+
## Uppy client (React example)
|
|
133
134
|
|
|
134
135
|
```tsx
|
|
135
|
-
import
|
|
136
|
+
import Uppy from "@uppy/core";
|
|
137
|
+
import Transloadit from "@uppy/transloadit";
|
|
136
138
|
import { api } from "../convex/_generated/api";
|
|
137
139
|
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
const uppy = new Uppy().use(Transloadit, {
|
|
141
|
+
waitForEncoding: true,
|
|
142
|
+
assemblyOptions: async () => {
|
|
143
|
+
const { assemblyOptions } = await runAction(
|
|
144
|
+
api.wedding.createWeddingAssemblyOptions,
|
|
145
|
+
{ fileCount, guestName, uploadCode },
|
|
146
|
+
);
|
|
147
|
+
return assemblyOptions;
|
|
148
|
+
},
|
|
144
149
|
});
|
|
145
150
|
|
|
146
|
-
await
|
|
147
|
-
createAssemblyArgs: { guestName, uploadCode },
|
|
148
|
-
});
|
|
149
|
-
```
|
|
150
|
-
For advanced/legacy helpers (raw parsing, low-level tus uploads, polling utilities), see `docs/advanced.md`.
|
|
151
|
-
|
|
152
|
-
## Example app (Next.js + Uppy wedding gallery)
|
|
153
|
-
|
|
154
|
-
The `example/` app is a wedding gallery where guests upload photos + short videos. It uses Uppy on the client and Convex Auth (anonymous sign-in) to create assemblies securely. If you do not set `NEXT_PUBLIC_CONVEX_URL`, the example falls back to the in-process Convex test harness.
|
|
155
|
-
Uploads are stored via Transloadit directly into Cloudflare R2.
|
|
156
|
-
The client wiring uses the `useTransloaditUppy` hook from `@transloadit/convex/react` to keep Uppy + polling in sync.
|
|
157
|
-
|
|
158
|
-
Live demo:
|
|
159
|
-
|
|
160
|
-
```
|
|
161
|
-
https://convex-demo.transload.it
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Quick start (local):
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
# In repo root
|
|
168
|
-
export TRANSLOADIT_KEY=...
|
|
169
|
-
export TRANSLOADIT_SECRET=...
|
|
170
|
-
export TRANSLOADIT_R2_CREDENTIALS=...
|
|
171
|
-
|
|
172
|
-
# Get a public webhook URL (cloudflared is auto-downloaded if needed)
|
|
173
|
-
yarn tunnel --once
|
|
174
|
-
# Set TRANSLOADIT_NOTIFY_URL to the printed notifyUrl
|
|
175
|
-
export TRANSLOADIT_NOTIFY_URL=...
|
|
176
|
-
|
|
177
|
-
yarn example:dev
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
If you want the API routes to talk to an existing Convex deployment (bypassing Convex Auth), set:
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
export CONVEX_URL=...
|
|
184
|
-
export CONVEX_ADMIN_KEY=...
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
The example exposes `POST /transloadit/webhook` and forwards webhooks into Convex via `queueWebhook`.
|
|
188
|
-
Realtime “new upload” toasts use a Convex subscription on recent assemblies.
|
|
189
|
-
The demo also applies a simple per-user upload limit in the Convex backend (see `example/convex/wedding.ts`).
|
|
190
|
-
|
|
191
|
-
### Storage (required R2 persistence)
|
|
192
|
-
|
|
193
|
-
The example uses the `/cloudflare/store` robot to write processed files into Cloudflare R2. Configure one of these:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
# Option A: Transloadit template credentials (recommended)
|
|
197
|
-
export TRANSLOADIT_R2_CREDENTIALS=...
|
|
198
|
-
|
|
199
|
-
# Option B: supply R2 details directly
|
|
200
|
-
export R2_BUCKET=...
|
|
201
|
-
export R2_ACCESS_KEY_ID=...
|
|
202
|
-
export R2_SECRET_ACCESS_KEY=...
|
|
203
|
-
export R2_ACCOUNT_ID=... # or R2_HOST
|
|
204
|
-
export R2_PUBLIC_URL=... # optional public URL prefix
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
The UI hides older items based on `NEXT_PUBLIC_GALLERY_RETENTION_HOURS` (default: 24) to discourage spam/abuse.
|
|
208
|
-
The demo bucket auto-expires objects after 1 day via an R2 lifecycle rule (reapply with `yarn r2:lifecycle` or override with `R2_RETENTION_DAYS`).
|
|
209
|
-
Preview deployments reset data on each deploy. The demo is built with
|
|
210
|
-
[`@transloadit/convex`](https://github.com/transloadit/convex) and
|
|
211
|
-
[Transloadit](https://transloadit.com/).
|
|
212
|
-
If you set `WEDDING_UPLOAD_CODE` on the Convex deployment, guests must enter the passcode before uploads can start.
|
|
213
|
-
|
|
214
|
-
### Deploy the example (Vercel + stable Convex)
|
|
215
|
-
|
|
216
|
-
For a public demo, deploy the `example/` app and point it at a stable Convex deployment.
|
|
217
|
-
|
|
218
|
-
1. Deploy a Convex app that includes this component (stable/prod deployment).
|
|
219
|
-
2. Set Vercel environment variables for the project:
|
|
220
|
-
- `NEXT_PUBLIC_CONVEX_URL` (point to the stable Convex deployment)
|
|
221
|
-
- `NEXT_PUBLIC_GALLERY_RETENTION_HOURS` (optional)
|
|
222
|
-
3. Set Convex environment variables on the deployment:
|
|
223
|
-
- `TRANSLOADIT_KEY` and `TRANSLOADIT_SECRET`
|
|
224
|
-
- `TRANSLOADIT_NOTIFY_URL` (set to `https://<deployment>.convex.site/transloadit/webhook`)
|
|
225
|
-
- R2 credentials (see above)
|
|
226
|
-
- `WEDDING_UPLOAD_CODE` (optional passcode for uploads)
|
|
227
|
-
4. Trigger the Vercel deploy hook (or deploy manually).
|
|
228
|
-
|
|
229
|
-
To deploy a stable Convex backend for the demo (once per environment), run:
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
export CONVEX_DEPLOY_KEY=...
|
|
233
|
-
export TRANSLOADIT_KEY=...
|
|
234
|
-
export TRANSLOADIT_SECRET=...
|
|
235
|
-
|
|
236
|
-
yarn deploy:cloud
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
Once deployed, use the Vercel URL as `E2E_REMOTE_APP_URL` for `yarn verify:cloud`.
|
|
240
|
-
CI expects a stable Vercel production URL in the `E2E_REMOTE_APP_URL` secret on `main`.
|
|
241
|
-
|
|
242
|
-
### Demo cleanup (Convex + R2)
|
|
243
|
-
|
|
244
|
-
To remove demo uploads from Convex and Cloudflare R2, run:
|
|
245
|
-
|
|
246
|
-
```bash
|
|
247
|
-
yarn demo:cleanup
|
|
151
|
+
await uppy.upload();
|
|
248
152
|
```
|
|
153
|
+
Note: `assemblyOptions()` is called once per batch, so pass per-file metadata via Uppy file meta
|
|
154
|
+
(e.g. `uppy.setFileMeta(fileId, {...})`) and use `fields` for shared values.
|
|
249
155
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
- `CONVEX_URL`
|
|
253
|
-
- `CONVEX_ADMIN_KEY`
|
|
254
|
-
- `R2_BUCKET`
|
|
255
|
-
- `R2_ACCESS_KEY_ID`
|
|
256
|
-
- `R2_SECRET_ACCESS_KEY`
|
|
257
|
-
- `R2_ACCOUNT_ID` or `R2_HOST`
|
|
156
|
+
Migration note: the `@transloadit/convex/react` entrypoint has been removed; use Uppy +
|
|
157
|
+
`@uppy/transloadit` directly.
|
|
258
158
|
|
|
259
|
-
|
|
159
|
+
For status parsing and polling helpers, see `docs/advanced.md`.
|
|
260
160
|
|
|
261
|
-
|
|
262
|
-
- `--dry-run` (prints the counts without deleting)
|
|
263
|
-
|
|
264
|
-
Note: the demo bucket is configured to auto-expire objects after 1 day via `yarn r2:lifecycle`.
|
|
265
|
-
|
|
266
|
-
## Verification and QA
|
|
267
|
-
|
|
268
|
-
Fast checks:
|
|
269
|
-
|
|
270
|
-
```bash
|
|
271
|
-
yarn check
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
This runs format, lint, typecheck, and unit tests. For a full verification run:
|
|
275
|
-
|
|
276
|
-
```bash
|
|
277
|
-
yarn verify
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
Additional commands:
|
|
281
|
-
|
|
282
|
-
- `yarn lint` (Biome)
|
|
283
|
-
- `yarn format` (Biome write)
|
|
284
|
-
- `yarn typecheck` (tsc)
|
|
285
|
-
- `yarn test` (Vitest unit tests)
|
|
286
|
-
- `yarn verify:local` (runs the Next.js wedding example + uploads an image + video)
|
|
287
|
-
- `yarn verify:cloud` (runs the browser flow against a deployed Next.js app)
|
|
288
|
-
- `yarn deploy:cloud` (deploys a stable Convex backend for the demo app)
|
|
289
|
-
- `yarn build` (tsc build + emit package json)
|
|
290
|
-
|
|
291
|
-
Notes:
|
|
292
|
-
- `yarn tunnel` is a support tool, not verification.
|
|
293
|
-
- CI should run non-mutating checks; local `yarn check` may format/fix.
|
|
294
|
-
- `yarn verify:local` needs `TRANSLOADIT_KEY`, `TRANSLOADIT_SECRET`, `TRANSLOADIT_NOTIFY_URL`, and R2 credentials.
|
|
295
|
-
- `yarn verify:cloud` needs `E2E_REMOTE_APP_URL`.
|
|
296
|
-
- Set `TRANSLOADIT_DEBUG=1` to enable verbose verify logs.
|
|
297
|
-
|
|
298
|
-
## Component test helpers
|
|
299
|
-
|
|
300
|
-
For `convex-test`, you can use the built-in helper:
|
|
301
|
-
|
|
302
|
-
```ts
|
|
303
|
-
import { createTransloaditTest } from "@transloadit/convex/test";
|
|
304
|
-
|
|
305
|
-
const t = createTransloaditTest();
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
## Generated files
|
|
309
|
-
|
|
310
|
-
`src/component/_generated` is Convex codegen output. It is checked in so tests and component consumers have stable API references. If you change component functions or schemas, regenerate with Convex codegen (for example via `npx convex dev` or `npx convex codegen`) and commit the updated files.
|
|
311
|
-
|
|
312
|
-
## Release process
|
|
313
|
-
|
|
314
|
-
Releases are automated via Changesets + GitHub Actions and published to npm using OIDC (Trusted Publisher).
|
|
315
|
-
|
|
316
|
-
1. Ensure CI is green on `main`.
|
|
317
|
-
2. Run local checks:
|
|
318
|
-
|
|
319
|
-
```bash
|
|
320
|
-
yarn check
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
3. Add a changeset describing the release:
|
|
324
|
-
|
|
325
|
-
```bash
|
|
326
|
-
yarn changeset
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
4. Apply the version bump + changelog updates:
|
|
330
|
-
|
|
331
|
-
```bash
|
|
332
|
-
yarn changeset:version
|
|
333
|
-
git add package.json CHANGELOG.md
|
|
334
|
-
git commit -m "Release vX.Y.Z"
|
|
335
|
-
git push
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
5. Tag and push the release:
|
|
161
|
+
## Example app (Next.js + Uppy wedding gallery)
|
|
339
162
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
```
|
|
163
|
+
The `example/` app is a wedding gallery where guests upload photos + short videos. It uses Uppy on
|
|
164
|
+
the client and Convex Auth (anonymous sign-in) to create assemblies securely. Uploads are stored via
|
|
165
|
+
Transloadit directly into Cloudflare R2.
|
|
344
166
|
|
|
345
|
-
|
|
346
|
-
- build and pack a `.tgz` artifact,
|
|
347
|
-
- create a draft GitHub release,
|
|
348
|
-
- publish the tarball to npm with provenance.
|
|
167
|
+
Live demo: `https://convex-demo.transload.it`
|
|
349
168
|
|
|
350
|
-
|
|
169
|
+
For setup, deployment, and verification details, see `CONTRIBUTING.md`.
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,111 +1,25 @@
|
|
|
1
1
|
import type { AssemblyStatus } from "@transloadit/zod/v3/assemblyStatus";
|
|
2
2
|
import type { AssemblyInstructionsInput } from "@transloadit/zod/v3/template";
|
|
3
|
-
import { type Infer } from "convex/values";
|
|
4
3
|
import type { ComponentApi } from "../component/_generated/component.ts";
|
|
4
|
+
import { type AssemblyOptions, type AssemblyResponse, type AssemblyResultResponse, type CreateAssemblyArgs, vAssemblyOptions, vAssemblyResponse, vAssemblyResultResponse, vCreateAssemblyArgs } from "../shared/schemas.ts";
|
|
5
5
|
import type { RunActionCtx, RunMutationCtx, RunQueryCtx } from "./types.ts";
|
|
6
|
+
export { vAssemblyResponse, vAssemblyResultResponse, vCreateAssemblyArgs };
|
|
6
7
|
export { assemblyStatusErrCodeSchema, assemblyStatusOkCodeSchema, assemblyStatusResultsSchema, assemblyStatusSchema, isAssemblyBusy, isAssemblyBusyStatus, isAssemblyErrorStatus, isAssemblyOkStatus, isAssemblySysError, isAssemblyTerminal, isAssemblyTerminalError, isAssemblyTerminalOk, isAssemblyTerminalOkStatus, } from "@transloadit/zod/v3/assemblyStatus";
|
|
7
|
-
export type { ParsedWebhookRequest, VerifiedWebhookRequest, WebhookActionArgs, } from "../component/apiUtils.ts";
|
|
8
8
|
export { buildWebhookQueueArgs, handleWebhookRequest, parseAndVerifyTransloaditWebhook, parseTransloaditWebhook, } from "../component/apiUtils.ts";
|
|
9
9
|
export type { NormalizedAssemblyUrls, TransloaditAssembly, } from "../shared/assemblyUrls.ts";
|
|
10
10
|
export { ASSEMBLY_STATUS_COMPLETED, ASSEMBLY_STATUS_UPLOADING, getAssemblyStage, isAssemblyCompletedStatus, isAssemblyUploadingStatus, normalizeAssemblyUploadUrls, parseAssemblyFields, parseAssemblyResults, parseAssemblyStatus, parseAssemblyUrls, } from "../shared/assemblyUrls.ts";
|
|
11
11
|
export { pollAssembly } from "../shared/pollAssembly.ts";
|
|
12
12
|
export type { ImageResizeResult, ResultByRobot, ResultForRobot, StoreResult, TransloaditResult, VideoEncodeResult, VideoThumbsResult, } from "../shared/resultTypes.ts";
|
|
13
13
|
export { getResultOriginalKey, getResultUrl, } from "../shared/resultUtils.ts";
|
|
14
|
-
export type {
|
|
15
|
-
export { buildTusUploadConfig } from "../shared/tusUpload.ts";
|
|
14
|
+
export type { ParsedWebhookRequest, VerifiedWebhookRequest, WebhookActionArgs, } from "../shared/schemas.ts";
|
|
16
15
|
export type { AssemblyStatus, AssemblyInstructionsInput };
|
|
17
16
|
export interface TransloaditConfig {
|
|
18
17
|
authKey: string;
|
|
19
18
|
authSecret: string;
|
|
20
19
|
}
|
|
21
20
|
export type TransloaditComponent = ComponentApi;
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
ok?: string | undefined;
|
|
25
|
-
message?: string | undefined;
|
|
26
|
-
templateId?: string | undefined;
|
|
27
|
-
notifyUrl?: string | undefined;
|
|
28
|
-
numExpectedUploadFiles?: number | undefined;
|
|
29
|
-
fields?: Record<string, any> | undefined;
|
|
30
|
-
uploads?: any[] | undefined;
|
|
31
|
-
results?: Record<string, any[]> | undefined;
|
|
32
|
-
error?: any;
|
|
33
|
-
raw?: any;
|
|
34
|
-
userId?: string | undefined;
|
|
35
|
-
assemblyId: string;
|
|
36
|
-
_id: string;
|
|
37
|
-
_creationTime: number;
|
|
38
|
-
createdAt: number;
|
|
39
|
-
updatedAt: number;
|
|
40
|
-
}, {
|
|
41
|
-
_id: import("convex/values").VString<string, "required">;
|
|
42
|
-
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
43
|
-
assemblyId: import("convex/values").VString<string, "required">;
|
|
44
|
-
status: import("convex/values").VString<string | undefined, "optional">;
|
|
45
|
-
ok: import("convex/values").VString<string | undefined, "optional">;
|
|
46
|
-
message: import("convex/values").VString<string | undefined, "optional">;
|
|
47
|
-
templateId: import("convex/values").VString<string | undefined, "optional">;
|
|
48
|
-
notifyUrl: import("convex/values").VString<string | undefined, "optional">;
|
|
49
|
-
numExpectedUploadFiles: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
50
|
-
fields: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
51
|
-
uploads: import("convex/values").VArray<any[] | undefined, import("convex/values").VAny<any, "required", string>, "optional">;
|
|
52
|
-
results: import("convex/values").VRecord<Record<string, any[]> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VArray<any[], import("convex/values").VAny<any, "required", string>, "required">, "optional", string>;
|
|
53
|
-
error: import("convex/values").VAny<any, "optional", string>;
|
|
54
|
-
raw: import("convex/values").VAny<any, "optional", string>;
|
|
55
|
-
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
56
|
-
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
57
|
-
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
58
|
-
}, "required", "assemblyId" | "status" | "ok" | "message" | "templateId" | "notifyUrl" | "numExpectedUploadFiles" | "fields" | "uploads" | "results" | "error" | "raw" | "userId" | "_id" | "_creationTime" | "createdAt" | "updatedAt" | `fields.${string}` | `results.${string}` | `error.${string}` | `raw.${string}`>;
|
|
59
|
-
export type AssemblyResponse = Infer<typeof vAssemblyResponse>;
|
|
60
|
-
export declare const vAssemblyResultResponse: import("convex/values").VObject<{
|
|
61
|
-
userId?: string | undefined;
|
|
62
|
-
album?: string | undefined;
|
|
63
|
-
mime?: string | undefined;
|
|
64
|
-
name?: string | undefined;
|
|
65
|
-
size?: number | undefined;
|
|
66
|
-
sslUrl?: string | undefined;
|
|
67
|
-
resultId?: string | undefined;
|
|
68
|
-
assemblyId: string;
|
|
69
|
-
raw: any;
|
|
70
|
-
stepName: string;
|
|
71
|
-
_id: string;
|
|
72
|
-
_creationTime: number;
|
|
73
|
-
createdAt: number;
|
|
74
|
-
}, {
|
|
75
|
-
_id: import("convex/values").VString<string, "required">;
|
|
76
|
-
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
77
|
-
assemblyId: import("convex/values").VString<string, "required">;
|
|
78
|
-
album: import("convex/values").VString<string | undefined, "optional">;
|
|
79
|
-
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
80
|
-
stepName: import("convex/values").VString<string, "required">;
|
|
81
|
-
resultId: import("convex/values").VString<string | undefined, "optional">;
|
|
82
|
-
sslUrl: import("convex/values").VString<string | undefined, "optional">;
|
|
83
|
-
name: import("convex/values").VString<string | undefined, "optional">;
|
|
84
|
-
size: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
85
|
-
mime: import("convex/values").VString<string | undefined, "optional">;
|
|
86
|
-
raw: import("convex/values").VAny<any, "required", string>;
|
|
87
|
-
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
88
|
-
}, "required", "assemblyId" | "raw" | "userId" | "stepName" | "album" | "mime" | "name" | "size" | "sslUrl" | "resultId" | "_id" | "_creationTime" | "createdAt" | `raw.${string}`>;
|
|
89
|
-
export type AssemblyResultResponse = Infer<typeof vAssemblyResultResponse>;
|
|
90
|
-
export declare const vCreateAssemblyArgs: import("convex/values").VObject<{
|
|
91
|
-
templateId?: string | undefined;
|
|
92
|
-
notifyUrl?: string | undefined;
|
|
93
|
-
numExpectedUploadFiles?: number | undefined;
|
|
94
|
-
fields?: Record<string, any> | undefined;
|
|
95
|
-
userId?: string | undefined;
|
|
96
|
-
steps?: Record<string, any> | undefined;
|
|
97
|
-
expires?: string | undefined;
|
|
98
|
-
additionalParams?: Record<string, any> | undefined;
|
|
99
|
-
}, {
|
|
100
|
-
templateId: import("convex/values").VString<string | undefined, "optional">;
|
|
101
|
-
steps: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
102
|
-
fields: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
103
|
-
notifyUrl: import("convex/values").VString<string | undefined, "optional">;
|
|
104
|
-
numExpectedUploadFiles: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
105
|
-
expires: import("convex/values").VString<string | undefined, "optional">;
|
|
106
|
-
additionalParams: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
107
|
-
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
108
|
-
}, "required", "templateId" | "notifyUrl" | "numExpectedUploadFiles" | "fields" | "userId" | "steps" | "expires" | "additionalParams" | `fields.${string}` | `steps.${string}` | `additionalParams.${string}`>;
|
|
21
|
+
export { vAssemblyOptions };
|
|
22
|
+
export type { AssemblyOptions, AssemblyResponse, AssemblyResultResponse, CreateAssemblyArgs, };
|
|
109
23
|
/**
|
|
110
24
|
* @deprecated Prefer `makeTransloaditAPI` or `Transloadit` for new code.
|
|
111
25
|
*/
|
|
@@ -114,10 +28,15 @@ export declare class TransloaditClient {
|
|
|
114
28
|
config: TransloaditConfig;
|
|
115
29
|
constructor(component: TransloaditComponent, config?: Partial<TransloaditConfig>);
|
|
116
30
|
static create(component: TransloaditComponent, config: TransloaditConfig): TransloaditClient;
|
|
117
|
-
createAssembly(ctx: RunActionCtx, args:
|
|
31
|
+
createAssembly(ctx: RunActionCtx, args: CreateAssemblyArgs): Promise<{
|
|
118
32
|
assemblyId: string;
|
|
119
33
|
data: any;
|
|
120
34
|
}>;
|
|
35
|
+
createAssemblyOptions(ctx: RunActionCtx, args: CreateAssemblyArgs): Promise<{
|
|
36
|
+
params: string;
|
|
37
|
+
signature: string;
|
|
38
|
+
fields?: any;
|
|
39
|
+
}>;
|
|
121
40
|
handleWebhook(ctx: RunActionCtx, args: {
|
|
122
41
|
payload: unknown;
|
|
123
42
|
rawBody?: string;
|
|
@@ -178,6 +97,20 @@ export declare class TransloaditClient {
|
|
|
178
97
|
assemblyId: string;
|
|
179
98
|
data: any;
|
|
180
99
|
}>>;
|
|
100
|
+
createAssemblyOptions: import("convex/server").RegisteredAction<"public", {
|
|
101
|
+
templateId?: string | undefined;
|
|
102
|
+
notifyUrl?: string | undefined;
|
|
103
|
+
numExpectedUploadFiles?: number | undefined;
|
|
104
|
+
fields?: Record<string, any> | undefined;
|
|
105
|
+
userId?: string | undefined;
|
|
106
|
+
steps?: Record<string, any> | undefined;
|
|
107
|
+
expires?: string | undefined;
|
|
108
|
+
additionalParams?: Record<string, any> | undefined;
|
|
109
|
+
}, Promise<{
|
|
110
|
+
params: string;
|
|
111
|
+
signature: string;
|
|
112
|
+
fields?: any;
|
|
113
|
+
}>>;
|
|
181
114
|
handleWebhook: import("convex/server").RegisteredAction<"public", {
|
|
182
115
|
rawBody?: string | undefined;
|
|
183
116
|
signature?: string | undefined;
|
|
@@ -255,6 +188,20 @@ export declare function makeTransloaditAPI(component: TransloaditComponent, conf
|
|
|
255
188
|
assemblyId: string;
|
|
256
189
|
data: any;
|
|
257
190
|
}>>;
|
|
191
|
+
createAssemblyOptions: import("convex/server").RegisteredAction<"public", {
|
|
192
|
+
templateId?: string | undefined;
|
|
193
|
+
notifyUrl?: string | undefined;
|
|
194
|
+
numExpectedUploadFiles?: number | undefined;
|
|
195
|
+
fields?: Record<string, any> | undefined;
|
|
196
|
+
userId?: string | undefined;
|
|
197
|
+
steps?: Record<string, any> | undefined;
|
|
198
|
+
expires?: string | undefined;
|
|
199
|
+
additionalParams?: Record<string, any> | undefined;
|
|
200
|
+
}, Promise<{
|
|
201
|
+
params: string;
|
|
202
|
+
signature: string;
|
|
203
|
+
fields?: any;
|
|
204
|
+
}>>;
|
|
258
205
|
handleWebhook: import("convex/server").RegisteredAction<"public", {
|
|
259
206
|
rawBody?: string | undefined;
|
|
260
207
|
signature?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAG9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK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