@fragno-dev/upload 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.md +16 -0
- package/README.md +43 -0
- package/bin/run.js +5 -0
- package/dist/browser/client/clients.js +49 -0
- package/dist/browser/client/clients.js.map +1 -0
- package/dist/browser/client/helpers.d.ts +51 -0
- package/dist/browser/client/helpers.d.ts.map +1 -0
- package/dist/browser/client/helpers.js +242 -0
- package/dist/browser/client/helpers.js.map +1 -0
- package/dist/browser/client/node_modules/.pnpm/@nanostores_query@0.3.4_nanostores@1.1.0/node_modules/@nanostores/query/dist/nanoquery.js +354 -0
- package/dist/browser/client/node_modules/.pnpm/@nanostores_query@0.3.4_nanostores@1.1.0/node_modules/@nanostores/query/dist/nanoquery.js.map +1 -0
- package/dist/browser/client/node_modules/.pnpm/@nanostores_solid@1.1.1_nanostores@1.1.0_solid-js@1.9.10/node_modules/@nanostores/solid/dist/index.js +14 -0
- package/dist/browser/client/node_modules/.pnpm/@nanostores_solid@1.1.1_nanostores@1.1.0_solid-js@1.9.10/node_modules/@nanostores/solid/dist/index.js.map +1 -0
- package/dist/browser/client/node_modules/.pnpm/nanoevents@9.1.0/node_modules/nanoevents/index.js +17 -0
- package/dist/browser/client/node_modules/.pnpm/nanoevents@9.1.0/node_modules/nanoevents/index.js.map +1 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/atom/index.js +62 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/atom/index.js.map +1 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/clean-stores/index.js +6 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/clean-stores/index.js.map +1 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/computed/index.js +50 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/computed/index.js.map +1 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/lifecycle/index.js +99 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/lifecycle/index.js.map +1 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/listen-keys/index.js +11 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/listen-keys/index.js.map +1 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/map/index.js +25 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/map/index.js.map +1 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/task/index.js +24 -0
- package/dist/browser/client/node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/task/index.js.map +1 -0
- package/dist/browser/client/packages/fragment-upload/src/definition.js +49 -0
- package/dist/browser/client/packages/fragment-upload/src/definition.js.map +1 -0
- package/dist/browser/client/packages/fragment-upload/src/keys.d.ts +7 -0
- package/dist/browser/client/packages/fragment-upload/src/keys.d.ts.map +1 -0
- package/dist/browser/client/packages/fragment-upload/src/keys.js +28 -0
- package/dist/browser/client/packages/fragment-upload/src/keys.js.map +1 -0
- package/dist/browser/client/packages/fragment-upload/src/routes/files.js +98 -0
- package/dist/browser/client/packages/fragment-upload/src/routes/files.js.map +1 -0
- package/dist/browser/client/packages/fragment-upload/src/routes/index.js +9 -0
- package/dist/browser/client/packages/fragment-upload/src/routes/index.js.map +1 -0
- package/dist/browser/client/packages/fragment-upload/src/routes/shared.js +41 -0
- package/dist/browser/client/packages/fragment-upload/src/routes/shared.js.map +1 -0
- package/dist/browser/client/packages/fragment-upload/src/routes/uploads.js +186 -0
- package/dist/browser/client/packages/fragment-upload/src/routes/uploads.js.map +1 -0
- package/dist/browser/client/packages/fragment-upload/src/schema.js +8 -0
- package/dist/browser/client/packages/fragment-upload/src/schema.js.map +1 -0
- package/dist/browser/client/packages/fragment-upload/src/storage/types.d.ts +9 -0
- package/dist/browser/client/packages/fragment-upload/src/storage/types.d.ts.map +1 -0
- package/dist/browser/client/packages/fragment-upload/src/types.d.ts +31 -0
- package/dist/browser/client/packages/fragment-upload/src/types.d.ts.map +1 -0
- package/dist/browser/client/packages/fragno/dist/api/error.js +48 -0
- package/dist/browser/client/packages/fragno/dist/api/error.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/api/internal/path.js +76 -0
- package/dist/browser/client/packages/fragno/dist/api/internal/path.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/api/internal/response-stream.js +81 -0
- package/dist/browser/client/packages/fragno/dist/api/internal/response-stream.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/api/internal/route.js +10 -0
- package/dist/browser/client/packages/fragno/dist/api/internal/route.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/api/request-input-context.js +185 -0
- package/dist/browser/client/packages/fragno/dist/api/request-input-context.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/api/request-output-context.js +119 -0
- package/dist/browser/client/packages/fragno/dist/api/request-output-context.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/api/route.js +17 -0
- package/dist/browser/client/packages/fragno/dist/api/route.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/client/client-error.js +92 -0
- package/dist/browser/client/packages/fragno/dist/client/client-error.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/client/client.js +495 -0
- package/dist/browser/client/packages/fragno/dist/client/client.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/client/client.svelte.js +120 -0
- package/dist/browser/client/packages/fragno/dist/client/client.svelte.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/client/internal/fetcher-merge.js +36 -0
- package/dist/browser/client/packages/fragno/dist/client/internal/fetcher-merge.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/client/internal/ndjson-streaming.js +139 -0
- package/dist/browser/client/packages/fragno/dist/client/internal/ndjson-streaming.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/client/react.js +70 -0
- package/dist/browser/client/packages/fragno/dist/client/react.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/client/solid.js +108 -0
- package/dist/browser/client/packages/fragno/dist/client/solid.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/client/vanilla.js +96 -0
- package/dist/browser/client/packages/fragno/dist/client/vanilla.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/client/vue.js +120 -0
- package/dist/browser/client/packages/fragno/dist/client/vue.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/util/async.js +40 -0
- package/dist/browser/client/packages/fragno/dist/util/async.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/util/content-type.js +49 -0
- package/dist/browser/client/packages/fragno/dist/util/content-type.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/util/nanostores.js +31 -0
- package/dist/browser/client/packages/fragno/dist/util/nanostores.js.map +1 -0
- package/dist/browser/client/packages/fragno/dist/util/ssr.js +18 -0
- package/dist/browser/client/packages/fragno/dist/util/ssr.js.map +1 -0
- package/dist/browser/client/react.d.ts +295 -0
- package/dist/browser/client/react.d.ts.map +1 -0
- package/dist/browser/client/react.js +11 -0
- package/dist/browser/client/react.js.map +1 -0
- package/dist/browser/client/solid.d.ts +303 -0
- package/dist/browser/client/solid.d.ts.map +1 -0
- package/dist/browser/client/solid.js +11 -0
- package/dist/browser/client/solid.js.map +1 -0
- package/dist/browser/client/svelte.d.ts +295 -0
- package/dist/browser/client/svelte.d.ts.map +1 -0
- package/dist/browser/client/svelte.js +11 -0
- package/dist/browser/client/svelte.js.map +1 -0
- package/dist/browser/client/vanilla.d.ts +296 -0
- package/dist/browser/client/vanilla.d.ts.map +1 -0
- package/dist/browser/client/vanilla.js +11 -0
- package/dist/browser/client/vanilla.js.map +1 -0
- package/dist/browser/client/vue.d.ts +295 -0
- package/dist/browser/client/vue.d.ts.map +1 -0
- package/dist/browser/client/vue.js +11 -0
- package/dist/browser/client/vue.js.map +1 -0
- package/dist/browser/index-BdjKPO4J.d.ts +177 -0
- package/dist/browser/index-BdjKPO4J.d.ts.map +1 -0
- package/dist/browser/index.js +3 -0
- package/dist/browser/src-vdNJUbjT.js +1982 -0
- package/dist/browser/src-vdNJUbjT.js.map +1 -0
- package/dist/cli/commands/files/delete.d.ts +40 -0
- package/dist/cli/commands/files/delete.d.ts.map +1 -0
- package/dist/cli/commands/files/delete.js +31 -0
- package/dist/cli/commands/files/delete.js.map +1 -0
- package/dist/cli/commands/files/download-url.d.ts +40 -0
- package/dist/cli/commands/files/download-url.d.ts.map +1 -0
- package/dist/cli/commands/files/download-url.js +31 -0
- package/dist/cli/commands/files/download-url.js.map +1 -0
- package/dist/cli/commands/files/download.d.ts +49 -0
- package/dist/cli/commands/files/download.d.ts.map +1 -0
- package/dist/cli/commands/files/download.js +65 -0
- package/dist/cli/commands/files/download.js.map +1 -0
- package/dist/cli/commands/files/get.d.ts +40 -0
- package/dist/cli/commands/files/get.d.ts.map +1 -0
- package/dist/cli/commands/files/get.js +31 -0
- package/dist/cli/commands/files/get.js.map +1 -0
- package/dist/cli/commands/files/list.d.ts +56 -0
- package/dist/cli/commands/files/list.d.ts.map +1 -0
- package/dist/cli/commands/files/list.js +53 -0
- package/dist/cli/commands/files/list.js.map +1 -0
- package/dist/cli/commands/files/update.d.ts +56 -0
- package/dist/cli/commands/files/update.d.ts.map +1 -0
- package/dist/cli/commands/files/update.js +53 -0
- package/dist/cli/commands/files/update.js.map +1 -0
- package/dist/cli/commands/files/upload.d.ts +73 -0
- package/dist/cli/commands/files/upload.d.ts.map +1 -0
- package/dist/cli/commands/files/upload.js +87 -0
- package/dist/cli/commands/files/upload.js.map +1 -0
- package/dist/cli/commands/uploads/abort.d.ts +37 -0
- package/dist/cli/commands/uploads/abort.d.ts.map +1 -0
- package/dist/cli/commands/uploads/abort.js +26 -0
- package/dist/cli/commands/uploads/abort.js.map +1 -0
- package/dist/cli/commands/uploads/complete.d.ts +41 -0
- package/dist/cli/commands/uploads/complete.d.ts.map +1 -0
- package/dist/cli/commands/uploads/complete.js +45 -0
- package/dist/cli/commands/uploads/complete.js.map +1 -0
- package/dist/cli/commands/uploads/content.d.ts +46 -0
- package/dist/cli/commands/uploads/content.d.ts.map +1 -0
- package/dist/cli/commands/uploads/content.js +43 -0
- package/dist/cli/commands/uploads/content.js.map +1 -0
- package/dist/cli/commands/uploads/create.d.ts +72 -0
- package/dist/cli/commands/uploads/create.d.ts.map +1 -0
- package/dist/cli/commands/uploads/create.js +84 -0
- package/dist/cli/commands/uploads/create.js.map +1 -0
- package/dist/cli/commands/uploads/get.d.ts +37 -0
- package/dist/cli/commands/uploads/get.d.ts.map +1 -0
- package/dist/cli/commands/uploads/get.js +26 -0
- package/dist/cli/commands/uploads/get.js.map +1 -0
- package/dist/cli/commands/uploads/parts-complete.d.ts +41 -0
- package/dist/cli/commands/uploads/parts-complete.d.ts.map +1 -0
- package/dist/cli/commands/uploads/parts-complete.js +44 -0
- package/dist/cli/commands/uploads/parts-complete.js.map +1 -0
- package/dist/cli/commands/uploads/parts-list.d.ts +37 -0
- package/dist/cli/commands/uploads/parts-list.d.ts.map +1 -0
- package/dist/cli/commands/uploads/parts-list.js +26 -0
- package/dist/cli/commands/uploads/parts-list.js.map +1 -0
- package/dist/cli/commands/uploads/parts-urls.d.ts +46 -0
- package/dist/cli/commands/uploads/parts-urls.d.ts.map +1 -0
- package/dist/cli/commands/uploads/parts-urls.js +57 -0
- package/dist/cli/commands/uploads/parts-urls.js.map +1 -0
- package/dist/cli/commands/uploads/progress.d.ts +45 -0
- package/dist/cli/commands/uploads/progress.d.ts.map +1 -0
- package/dist/cli/commands/uploads/progress.js +40 -0
- package/dist/cli/commands/uploads/progress.js.map +1 -0
- package/dist/cli/commands/uploads/transfer.d.ts +73 -0
- package/dist/cli/commands/uploads/transfer.d.ts.map +1 -0
- package/dist/cli/commands/uploads/transfer.js +170 -0
- package/dist/cli/commands/uploads/transfer.js.map +1 -0
- package/dist/cli/index.d.ts +27 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +198 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/keys.js +32 -0
- package/dist/cli/keys.js.map +1 -0
- package/dist/cli/utils/client.js +174 -0
- package/dist/cli/utils/client.js.map +1 -0
- package/dist/cli/utils/options.js +135 -0
- package/dist/cli/utils/options.js.map +1 -0
- package/dist/node/cli/commands/files/delete.d.ts +40 -0
- package/dist/node/cli/commands/files/delete.d.ts.map +1 -0
- package/dist/node/cli/commands/files/delete.js +31 -0
- package/dist/node/cli/commands/files/delete.js.map +1 -0
- package/dist/node/cli/commands/files/download-url.d.ts +40 -0
- package/dist/node/cli/commands/files/download-url.d.ts.map +1 -0
- package/dist/node/cli/commands/files/download-url.js +31 -0
- package/dist/node/cli/commands/files/download-url.js.map +1 -0
- package/dist/node/cli/commands/files/download.d.ts +49 -0
- package/dist/node/cli/commands/files/download.d.ts.map +1 -0
- package/dist/node/cli/commands/files/download.js +65 -0
- package/dist/node/cli/commands/files/download.js.map +1 -0
- package/dist/node/cli/commands/files/get.d.ts +40 -0
- package/dist/node/cli/commands/files/get.d.ts.map +1 -0
- package/dist/node/cli/commands/files/get.js +31 -0
- package/dist/node/cli/commands/files/get.js.map +1 -0
- package/dist/node/cli/commands/files/list.d.ts +56 -0
- package/dist/node/cli/commands/files/list.d.ts.map +1 -0
- package/dist/node/cli/commands/files/list.js +53 -0
- package/dist/node/cli/commands/files/list.js.map +1 -0
- package/dist/node/cli/commands/files/update.d.ts +56 -0
- package/dist/node/cli/commands/files/update.d.ts.map +1 -0
- package/dist/node/cli/commands/files/update.js +53 -0
- package/dist/node/cli/commands/files/update.js.map +1 -0
- package/dist/node/cli/commands/files/upload.d.ts +73 -0
- package/dist/node/cli/commands/files/upload.d.ts.map +1 -0
- package/dist/node/cli/commands/files/upload.js +87 -0
- package/dist/node/cli/commands/files/upload.js.map +1 -0
- package/dist/node/cli/commands/uploads/abort.d.ts +37 -0
- package/dist/node/cli/commands/uploads/abort.d.ts.map +1 -0
- package/dist/node/cli/commands/uploads/abort.js +26 -0
- package/dist/node/cli/commands/uploads/abort.js.map +1 -0
- package/dist/node/cli/commands/uploads/complete.d.ts +41 -0
- package/dist/node/cli/commands/uploads/complete.d.ts.map +1 -0
- package/dist/node/cli/commands/uploads/complete.js +45 -0
- package/dist/node/cli/commands/uploads/complete.js.map +1 -0
- package/dist/node/cli/commands/uploads/content.d.ts +46 -0
- package/dist/node/cli/commands/uploads/content.d.ts.map +1 -0
- package/dist/node/cli/commands/uploads/content.js +43 -0
- package/dist/node/cli/commands/uploads/content.js.map +1 -0
- package/dist/node/cli/commands/uploads/create.d.ts +72 -0
- package/dist/node/cli/commands/uploads/create.d.ts.map +1 -0
- package/dist/node/cli/commands/uploads/create.js +84 -0
- package/dist/node/cli/commands/uploads/create.js.map +1 -0
- package/dist/node/cli/commands/uploads/get.d.ts +37 -0
- package/dist/node/cli/commands/uploads/get.d.ts.map +1 -0
- package/dist/node/cli/commands/uploads/get.js +26 -0
- package/dist/node/cli/commands/uploads/get.js.map +1 -0
- package/dist/node/cli/commands/uploads/parts-complete.d.ts +41 -0
- package/dist/node/cli/commands/uploads/parts-complete.d.ts.map +1 -0
- package/dist/node/cli/commands/uploads/parts-complete.js +44 -0
- package/dist/node/cli/commands/uploads/parts-complete.js.map +1 -0
- package/dist/node/cli/commands/uploads/parts-list.d.ts +37 -0
- package/dist/node/cli/commands/uploads/parts-list.d.ts.map +1 -0
- package/dist/node/cli/commands/uploads/parts-list.js +26 -0
- package/dist/node/cli/commands/uploads/parts-list.js.map +1 -0
- package/dist/node/cli/commands/uploads/parts-urls.d.ts +46 -0
- package/dist/node/cli/commands/uploads/parts-urls.d.ts.map +1 -0
- package/dist/node/cli/commands/uploads/parts-urls.js +57 -0
- package/dist/node/cli/commands/uploads/parts-urls.js.map +1 -0
- package/dist/node/cli/commands/uploads/progress.d.ts +45 -0
- package/dist/node/cli/commands/uploads/progress.d.ts.map +1 -0
- package/dist/node/cli/commands/uploads/progress.js +40 -0
- package/dist/node/cli/commands/uploads/progress.js.map +1 -0
- package/dist/node/cli/commands/uploads/transfer.d.ts +73 -0
- package/dist/node/cli/commands/uploads/transfer.d.ts.map +1 -0
- package/dist/node/cli/commands/uploads/transfer.js +170 -0
- package/dist/node/cli/commands/uploads/transfer.js.map +1 -0
- package/dist/node/cli/index.d.ts +27 -0
- package/dist/node/cli/index.d.ts.map +1 -0
- package/dist/node/cli/index.js +198 -0
- package/dist/node/cli/index.js.map +1 -0
- package/dist/node/cli/utils/client.js +174 -0
- package/dist/node/cli/utils/client.js.map +1 -0
- package/dist/node/cli/utils/options.js +135 -0
- package/dist/node/cli/utils/options.js.map +1 -0
- package/dist/node/client/clients.d.ts +295 -0
- package/dist/node/client/clients.d.ts.map +1 -0
- package/dist/node/client/clients.js +49 -0
- package/dist/node/client/clients.js.map +1 -0
- package/dist/node/client/helpers.d.ts +51 -0
- package/dist/node/client/helpers.d.ts.map +1 -0
- package/dist/node/client/helpers.js +242 -0
- package/dist/node/client/helpers.js.map +1 -0
- package/dist/node/client/react.d.ts +295 -0
- package/dist/node/client/react.d.ts.map +1 -0
- package/dist/node/client/react.js +11 -0
- package/dist/node/client/react.js.map +1 -0
- package/dist/node/client/solid.d.ts +303 -0
- package/dist/node/client/solid.d.ts.map +1 -0
- package/dist/node/client/solid.js +11 -0
- package/dist/node/client/solid.js.map +1 -0
- package/dist/node/client/svelte.d.ts +295 -0
- package/dist/node/client/svelte.d.ts.map +1 -0
- package/dist/node/client/svelte.js +11 -0
- package/dist/node/client/svelte.js.map +1 -0
- package/dist/node/client/vanilla.d.ts +296 -0
- package/dist/node/client/vanilla.d.ts.map +1 -0
- package/dist/node/client/vanilla.js +11 -0
- package/dist/node/client/vanilla.js.map +1 -0
- package/dist/node/client/vue.d.ts +295 -0
- package/dist/node/client/vue.d.ts.map +1 -0
- package/dist/node/client/vue.js +11 -0
- package/dist/node/client/vue.js.map +1 -0
- package/dist/node/config.d.ts +41 -0
- package/dist/node/config.d.ts.map +1 -0
- package/dist/node/config.js +26 -0
- package/dist/node/config.js.map +1 -0
- package/dist/node/definition.d.ts +829 -0
- package/dist/node/definition.d.ts.map +1 -0
- package/dist/node/definition.js +59 -0
- package/dist/node/definition.js.map +1 -0
- package/dist/node/index.d.ts +1246 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +19 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/keys.d.ts +12 -0
- package/dist/node/keys.d.ts.map +1 -0
- package/dist/node/keys.js +63 -0
- package/dist/node/keys.js.map +1 -0
- package/dist/node/routes/files.js +450 -0
- package/dist/node/routes/files.js.map +1 -0
- package/dist/node/routes/index.d.ts +2023 -0
- package/dist/node/routes/index.d.ts.map +1 -0
- package/dist/node/routes/index.js +9 -0
- package/dist/node/routes/index.js.map +1 -0
- package/dist/node/routes/shared.js +66 -0
- package/dist/node/routes/shared.js.map +1 -0
- package/dist/node/routes/uploads.js +454 -0
- package/dist/node/routes/uploads.js.map +1 -0
- package/dist/node/schema.d.ts +14 -0
- package/dist/node/schema.d.ts.map +1 -0
- package/dist/node/schema.js +30 -0
- package/dist/node/schema.js.map +1 -0
- package/dist/node/services/files.d.ts +20 -0
- package/dist/node/services/files.d.ts.map +1 -0
- package/dist/node/services/files.js +93 -0
- package/dist/node/services/files.js.map +1 -0
- package/dist/node/services/helpers.js +36 -0
- package/dist/node/services/helpers.js.map +1 -0
- package/dist/node/services/index.js +4 -0
- package/dist/node/services/uploads.d.ts +50 -0
- package/dist/node/services/uploads.d.ts.map +1 -0
- package/dist/node/services/uploads.js +358 -0
- package/dist/node/services/uploads.js.map +1 -0
- package/dist/node/storage/fs.d.ts +16 -0
- package/dist/node/storage/fs.d.ts.map +1 -0
- package/dist/node/storage/fs.js +94 -0
- package/dist/node/storage/fs.js.map +1 -0
- package/dist/node/storage/r2.d.ts +103 -0
- package/dist/node/storage/r2.d.ts.map +1 -0
- package/dist/node/storage/r2.js +23 -0
- package/dist/node/storage/r2.js.map +1 -0
- package/dist/node/storage/s3.d.ts +44 -0
- package/dist/node/storage/s3.d.ts.map +1 -0
- package/dist/node/storage/s3.js +398 -0
- package/dist/node/storage/s3.js.map +1 -0
- package/dist/node/storage/types.d.ts +118 -0
- package/dist/node/storage/types.d.ts.map +1 -0
- package/dist/node/types.d.ts +32 -0
- package/dist/node/types.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +105 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as gunshi0 from "gunshi";
|
|
2
|
+
|
|
3
|
+
//#region src/cli/commands/files/download.d.ts
|
|
4
|
+
declare const filesDownloadCommand: gunshi0.Command<{
|
|
5
|
+
"file-key": {
|
|
6
|
+
type: "string";
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
"key-parts": {
|
|
10
|
+
type: "string";
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
output: {
|
|
14
|
+
type: "string";
|
|
15
|
+
short: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
stdout: {
|
|
19
|
+
type: "boolean";
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
"base-url": {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly short: "b";
|
|
25
|
+
readonly description: "Upload fragment base URL (env: FRAGNO_UPLOAD_BASE_URL)";
|
|
26
|
+
};
|
|
27
|
+
header: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly short: "H";
|
|
30
|
+
readonly description: "Extra HTTP header (repeatable), format: 'Name: value' (env: FRAGNO_UPLOAD_HEADERS)";
|
|
31
|
+
readonly multiple: true;
|
|
32
|
+
};
|
|
33
|
+
timeout: {
|
|
34
|
+
readonly type: "number";
|
|
35
|
+
readonly description: "Request timeout in ms (env: FRAGNO_UPLOAD_TIMEOUT_MS, default: 15000)";
|
|
36
|
+
};
|
|
37
|
+
retries: {
|
|
38
|
+
readonly type: "number";
|
|
39
|
+
readonly description: "Retry count for network/5xx/429 (env: FRAGNO_UPLOAD_RETRIES, default: 2)";
|
|
40
|
+
};
|
|
41
|
+
"retry-delay": {
|
|
42
|
+
readonly type: "number";
|
|
43
|
+
readonly description: "Delay between retries in ms (env: FRAGNO_UPLOAD_RETRY_DELAY_MS, default: 500)";
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
//# sourceMappingURL=download.d.ts.map
|
|
47
|
+
//#endregion
|
|
48
|
+
export { filesDownloadCommand };
|
|
49
|
+
//# sourceMappingURL=download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.d.ts","names":[],"sources":["../../../../../src/cli/commands/files/download.ts"],"sourcesContent":[],"mappings":";;;cAOa,sBAyEX,OAAA,CAzE+B;;;IAApB,WAAA,EAAA,MAyEX"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { baseArgs, createClientFromContext, resolveFileKeyValue } from "../../utils/options.js";
|
|
2
|
+
import { createWriteStream } from "node:fs";
|
|
3
|
+
import { Readable } from "node:stream";
|
|
4
|
+
import { pipeline } from "node:stream/promises";
|
|
5
|
+
import { define } from "gunshi";
|
|
6
|
+
|
|
7
|
+
//#region src/cli/commands/files/download.ts
|
|
8
|
+
const filesDownloadCommand = define({
|
|
9
|
+
name: "download",
|
|
10
|
+
description: "Download file contents",
|
|
11
|
+
args: {
|
|
12
|
+
...baseArgs,
|
|
13
|
+
"file-key": {
|
|
14
|
+
type: "string",
|
|
15
|
+
description: "File key (encoded)"
|
|
16
|
+
},
|
|
17
|
+
"key-parts": {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "File key parts as JSON array"
|
|
20
|
+
},
|
|
21
|
+
output: {
|
|
22
|
+
type: "string",
|
|
23
|
+
short: "o",
|
|
24
|
+
description: "Output file path"
|
|
25
|
+
},
|
|
26
|
+
stdout: {
|
|
27
|
+
type: "boolean",
|
|
28
|
+
description: "Write content to stdout"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
run: async (ctx) => {
|
|
32
|
+
const resolvedKey = resolveFileKeyValue({
|
|
33
|
+
fileKey: ctx.values["file-key"],
|
|
34
|
+
keyParts: ctx.values["key-parts"]
|
|
35
|
+
});
|
|
36
|
+
const outputPath = ctx.values["output"];
|
|
37
|
+
const toStdout = Boolean(ctx.values["stdout"]);
|
|
38
|
+
if (!outputPath && !toStdout) throw new Error("Provide --output or --stdout.");
|
|
39
|
+
const client = createClientFromContext(ctx);
|
|
40
|
+
let response;
|
|
41
|
+
try {
|
|
42
|
+
const download = await client.getDownloadUrl(resolvedKey.fileKey);
|
|
43
|
+
response = await fetch(download.url, {
|
|
44
|
+
method: "GET",
|
|
45
|
+
headers: download.headers
|
|
46
|
+
});
|
|
47
|
+
if (!response.ok) throw new Error(`Download failed (${response.status})`);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if ((error instanceof Error ? error.code : void 0) !== "SIGNED_URL_UNSUPPORTED") throw error;
|
|
50
|
+
response = await client.downloadContent(resolvedKey.fileKey);
|
|
51
|
+
}
|
|
52
|
+
if (!response.body) throw new Error("Response has no body");
|
|
53
|
+
const bodyStream = Readable.fromWeb(response.body);
|
|
54
|
+
if (toStdout) {
|
|
55
|
+
await pipeline(bodyStream, process.stdout);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
await pipeline(bodyStream, createWriteStream(outputPath));
|
|
59
|
+
console.log(`Downloaded to ${outputPath}`);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { filesDownloadCommand };
|
|
65
|
+
//# sourceMappingURL=download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.js","names":["response: Response"],"sources":["../../../../../src/cli/commands/files/download.ts"],"sourcesContent":["import { define } from \"gunshi\";\nimport { createWriteStream } from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport type { ReadableStream as NodeReadableStream } from \"node:stream/web\";\nimport { pipeline } from \"node:stream/promises\";\nimport { baseArgs, createClientFromContext, resolveFileKeyValue } from \"../../utils/options.js\";\n\nexport const filesDownloadCommand = define({\n name: \"download\",\n description: \"Download file contents\",\n args: {\n ...baseArgs,\n \"file-key\": {\n type: \"string\",\n description: \"File key (encoded)\",\n },\n \"key-parts\": {\n type: \"string\",\n description: \"File key parts as JSON array\",\n },\n output: {\n type: \"string\",\n short: \"o\",\n description: \"Output file path\",\n },\n stdout: {\n type: \"boolean\",\n description: \"Write content to stdout\",\n },\n },\n run: async (ctx) => {\n const resolvedKey = resolveFileKeyValue({\n fileKey: ctx.values[\"file-key\"] as string | undefined,\n keyParts: ctx.values[\"key-parts\"] as string | undefined,\n });\n\n const outputPath = ctx.values[\"output\"] as string | undefined;\n const toStdout = Boolean(ctx.values[\"stdout\"]);\n\n if (!outputPath && !toStdout) {\n throw new Error(\"Provide --output or --stdout.\");\n }\n\n const client = createClientFromContext(ctx);\n\n let response: Response;\n try {\n const download = (await client.getDownloadUrl(resolvedKey.fileKey)) as {\n url: string;\n headers?: Record<string, string>;\n };\n response = await fetch(download.url, {\n method: \"GET\",\n headers: download.headers,\n });\n if (!response.ok) {\n throw new Error(`Download failed (${response.status})`);\n }\n } catch (error) {\n const code = error instanceof Error ? (error as Error & { code?: string }).code : undefined;\n if (code !== \"SIGNED_URL_UNSUPPORTED\") {\n throw error;\n }\n response = await client.downloadContent(resolvedKey.fileKey);\n }\n\n if (!response.body) {\n throw new Error(\"Response has no body\");\n }\n\n const bodyStream = Readable.fromWeb(response.body as unknown as NodeReadableStream);\n\n if (toStdout) {\n await pipeline(bodyStream, process.stdout);\n return;\n }\n\n await pipeline(bodyStream, createWriteStream(outputPath as string));\n console.log(`Downloaded to ${outputPath}`);\n },\n});\n"],"mappings":";;;;;;;AAOA,MAAa,uBAAuB,OAAO;CACzC,MAAM;CACN,aAAa;CACb,MAAM;EACJ,GAAG;EACH,YAAY;GACV,MAAM;GACN,aAAa;GACd;EACD,aAAa;GACX,MAAM;GACN,aAAa;GACd;EACD,QAAQ;GACN,MAAM;GACN,OAAO;GACP,aAAa;GACd;EACD,QAAQ;GACN,MAAM;GACN,aAAa;GACd;EACF;CACD,KAAK,OAAO,QAAQ;EAClB,MAAM,cAAc,oBAAoB;GACtC,SAAS,IAAI,OAAO;GACpB,UAAU,IAAI,OAAO;GACtB,CAAC;EAEF,MAAM,aAAa,IAAI,OAAO;EAC9B,MAAM,WAAW,QAAQ,IAAI,OAAO,UAAU;AAE9C,MAAI,CAAC,cAAc,CAAC,SAClB,OAAM,IAAI,MAAM,gCAAgC;EAGlD,MAAM,SAAS,wBAAwB,IAAI;EAE3C,IAAIA;AACJ,MAAI;GACF,MAAM,WAAY,MAAM,OAAO,eAAe,YAAY,QAAQ;AAIlE,cAAW,MAAM,MAAM,SAAS,KAAK;IACnC,QAAQ;IACR,SAAS,SAAS;IACnB,CAAC;AACF,OAAI,CAAC,SAAS,GACZ,OAAM,IAAI,MAAM,oBAAoB,SAAS,OAAO,GAAG;WAElD,OAAO;AAEd,QADa,iBAAiB,QAAS,MAAoC,OAAO,YACrE,yBACX,OAAM;AAER,cAAW,MAAM,OAAO,gBAAgB,YAAY,QAAQ;;AAG9D,MAAI,CAAC,SAAS,KACZ,OAAM,IAAI,MAAM,uBAAuB;EAGzC,MAAM,aAAa,SAAS,QAAQ,SAAS,KAAsC;AAEnF,MAAI,UAAU;AACZ,SAAM,SAAS,YAAY,QAAQ,OAAO;AAC1C;;AAGF,QAAM,SAAS,YAAY,kBAAkB,WAAqB,CAAC;AACnE,UAAQ,IAAI,iBAAiB,aAAa;;CAE7C,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as gunshi9 from "gunshi";
|
|
2
|
+
|
|
3
|
+
//#region src/cli/commands/files/get.d.ts
|
|
4
|
+
declare const filesGetCommand: gunshi9.Command<{
|
|
5
|
+
"file-key": {
|
|
6
|
+
type: "string";
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
"key-parts": {
|
|
10
|
+
type: "string";
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
"base-url": {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly short: "b";
|
|
16
|
+
readonly description: "Upload fragment base URL (env: FRAGNO_UPLOAD_BASE_URL)";
|
|
17
|
+
};
|
|
18
|
+
header: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly short: "H";
|
|
21
|
+
readonly description: "Extra HTTP header (repeatable), format: 'Name: value' (env: FRAGNO_UPLOAD_HEADERS)";
|
|
22
|
+
readonly multiple: true;
|
|
23
|
+
};
|
|
24
|
+
timeout: {
|
|
25
|
+
readonly type: "number";
|
|
26
|
+
readonly description: "Request timeout in ms (env: FRAGNO_UPLOAD_TIMEOUT_MS, default: 15000)";
|
|
27
|
+
};
|
|
28
|
+
retries: {
|
|
29
|
+
readonly type: "number";
|
|
30
|
+
readonly description: "Retry count for network/5xx/429 (env: FRAGNO_UPLOAD_RETRIES, default: 2)";
|
|
31
|
+
};
|
|
32
|
+
"retry-delay": {
|
|
33
|
+
readonly type: "number";
|
|
34
|
+
readonly description: "Delay between retries in ms (env: FRAGNO_UPLOAD_RETRY_DELAY_MS, default: 500)";
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
//# sourceMappingURL=get.d.ts.map
|
|
38
|
+
//#endregion
|
|
39
|
+
export { filesGetCommand };
|
|
40
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","names":[],"sources":["../../../../../src/cli/commands/files/get.ts"],"sourcesContent":[],"mappings":";;;cAGa,iBAwBX,OAAA,CAxB0B;;;IAAf,WAAA,EAAA,MAwBX"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { baseArgs, createClientFromContext, resolveFileKeyValue } from "../../utils/options.js";
|
|
2
|
+
import { define } from "gunshi";
|
|
3
|
+
|
|
4
|
+
//#region src/cli/commands/files/get.ts
|
|
5
|
+
const filesGetCommand = define({
|
|
6
|
+
name: "get",
|
|
7
|
+
description: "Get file metadata",
|
|
8
|
+
args: {
|
|
9
|
+
...baseArgs,
|
|
10
|
+
"file-key": {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "File key (encoded)"
|
|
13
|
+
},
|
|
14
|
+
"key-parts": {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "File key parts as JSON array"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
run: async (ctx) => {
|
|
20
|
+
const resolvedKey = resolveFileKeyValue({
|
|
21
|
+
fileKey: ctx.values["file-key"],
|
|
22
|
+
keyParts: ctx.values["key-parts"]
|
|
23
|
+
});
|
|
24
|
+
const response = await createClientFromContext(ctx).getFile(resolvedKey.fileKey);
|
|
25
|
+
console.log(JSON.stringify(response, null, 2));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { filesGetCommand };
|
|
31
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","names":[],"sources":["../../../../../src/cli/commands/files/get.ts"],"sourcesContent":["import { define } from \"gunshi\";\nimport { baseArgs, createClientFromContext, resolveFileKeyValue } from \"../../utils/options.js\";\n\nexport const filesGetCommand = define({\n name: \"get\",\n description: \"Get file metadata\",\n args: {\n ...baseArgs,\n \"file-key\": {\n type: \"string\",\n description: \"File key (encoded)\",\n },\n \"key-parts\": {\n type: \"string\",\n description: \"File key parts as JSON array\",\n },\n },\n run: async (ctx) => {\n const resolvedKey = resolveFileKeyValue({\n fileKey: ctx.values[\"file-key\"] as string | undefined,\n keyParts: ctx.values[\"key-parts\"] as string | undefined,\n });\n\n const client = createClientFromContext(ctx);\n const response = await client.getFile(resolvedKey.fileKey);\n console.log(JSON.stringify(response, null, 2));\n },\n});\n"],"mappings":";;;;AAGA,MAAa,kBAAkB,OAAO;CACpC,MAAM;CACN,aAAa;CACb,MAAM;EACJ,GAAG;EACH,YAAY;GACV,MAAM;GACN,aAAa;GACd;EACD,aAAa;GACX,MAAM;GACN,aAAa;GACd;EACF;CACD,KAAK,OAAO,QAAQ;EAClB,MAAM,cAAc,oBAAoB;GACtC,SAAS,IAAI,OAAO;GACpB,UAAU,IAAI,OAAO;GACtB,CAAC;EAGF,MAAM,WAAW,MADF,wBAAwB,IAAI,CACb,QAAQ,YAAY,QAAQ;AAC1D,UAAQ,IAAI,KAAK,UAAU,UAAU,MAAM,EAAE,CAAC;;CAEjD,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as gunshi12 from "gunshi";
|
|
2
|
+
|
|
3
|
+
//#region src/cli/commands/files/list.d.ts
|
|
4
|
+
declare const filesListCommand: gunshi12.Command<{
|
|
5
|
+
prefix: {
|
|
6
|
+
type: "string";
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
"prefix-parts": {
|
|
10
|
+
type: "string";
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
cursor: {
|
|
14
|
+
type: "string";
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
"page-size": {
|
|
18
|
+
type: "number";
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
status: {
|
|
22
|
+
type: "string";
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
"uploader-id": {
|
|
26
|
+
type: "string";
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
"base-url": {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly short: "b";
|
|
32
|
+
readonly description: "Upload fragment base URL (env: FRAGNO_UPLOAD_BASE_URL)";
|
|
33
|
+
};
|
|
34
|
+
header: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly short: "H";
|
|
37
|
+
readonly description: "Extra HTTP header (repeatable), format: 'Name: value' (env: FRAGNO_UPLOAD_HEADERS)";
|
|
38
|
+
readonly multiple: true;
|
|
39
|
+
};
|
|
40
|
+
timeout: {
|
|
41
|
+
readonly type: "number";
|
|
42
|
+
readonly description: "Request timeout in ms (env: FRAGNO_UPLOAD_TIMEOUT_MS, default: 15000)";
|
|
43
|
+
};
|
|
44
|
+
retries: {
|
|
45
|
+
readonly type: "number";
|
|
46
|
+
readonly description: "Retry count for network/5xx/429 (env: FRAGNO_UPLOAD_RETRIES, default: 2)";
|
|
47
|
+
};
|
|
48
|
+
"retry-delay": {
|
|
49
|
+
readonly type: "number";
|
|
50
|
+
readonly description: "Delay between retries in ms (env: FRAGNO_UPLOAD_RETRY_DELAY_MS, default: 500)";
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
//# sourceMappingURL=list.d.ts.map
|
|
54
|
+
//#endregion
|
|
55
|
+
export { filesListCommand };
|
|
56
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","names":[],"sources":["../../../../../src/cli/commands/files/list.ts"],"sourcesContent":[],"mappings":";;;cAGa,kBA+CX,QAAA,CA/C2B;;;IAAhB,WAAA,EAAA,MA+CX"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { baseArgs, createClientFromContext, resolvePrefixValue } from "../../utils/options.js";
|
|
2
|
+
import { define } from "gunshi";
|
|
3
|
+
|
|
4
|
+
//#region src/cli/commands/files/list.ts
|
|
5
|
+
const filesListCommand = define({
|
|
6
|
+
name: "list",
|
|
7
|
+
description: "List files",
|
|
8
|
+
args: {
|
|
9
|
+
...baseArgs,
|
|
10
|
+
prefix: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "File key prefix (must end with '.')"
|
|
13
|
+
},
|
|
14
|
+
"prefix-parts": {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "File key prefix parts as JSON array"
|
|
17
|
+
},
|
|
18
|
+
cursor: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Cursor for pagination"
|
|
21
|
+
},
|
|
22
|
+
"page-size": {
|
|
23
|
+
type: "number",
|
|
24
|
+
description: "Page size for pagination"
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Filter by status (ready, deleted)"
|
|
29
|
+
},
|
|
30
|
+
"uploader-id": {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Filter by uploader id"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
run: async (ctx) => {
|
|
36
|
+
const prefix = resolvePrefixValue({
|
|
37
|
+
prefix: ctx.values["prefix"],
|
|
38
|
+
prefixParts: ctx.values["prefix-parts"]
|
|
39
|
+
});
|
|
40
|
+
const response = await createClientFromContext(ctx).listFiles({
|
|
41
|
+
prefix,
|
|
42
|
+
cursor: ctx.values["cursor"],
|
|
43
|
+
pageSize: ctx.values["page-size"],
|
|
44
|
+
status: ctx.values["status"],
|
|
45
|
+
uploaderId: ctx.values["uploader-id"]
|
|
46
|
+
});
|
|
47
|
+
console.log(JSON.stringify(response, null, 2));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { filesListCommand };
|
|
53
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","names":[],"sources":["../../../../../src/cli/commands/files/list.ts"],"sourcesContent":["import { define } from \"gunshi\";\nimport { baseArgs, createClientFromContext, resolvePrefixValue } from \"../../utils/options.js\";\n\nexport const filesListCommand = define({\n name: \"list\",\n description: \"List files\",\n args: {\n ...baseArgs,\n prefix: {\n type: \"string\",\n description: \"File key prefix (must end with '.')\",\n },\n \"prefix-parts\": {\n type: \"string\",\n description: \"File key prefix parts as JSON array\",\n },\n cursor: {\n type: \"string\",\n description: \"Cursor for pagination\",\n },\n \"page-size\": {\n type: \"number\",\n description: \"Page size for pagination\",\n },\n status: {\n type: \"string\",\n description: \"Filter by status (ready, deleted)\",\n },\n \"uploader-id\": {\n type: \"string\",\n description: \"Filter by uploader id\",\n },\n },\n run: async (ctx) => {\n const prefix = resolvePrefixValue({\n prefix: ctx.values[\"prefix\"] as string | undefined,\n prefixParts: ctx.values[\"prefix-parts\"] as string | undefined,\n });\n\n const client = createClientFromContext(ctx);\n const response = await client.listFiles({\n prefix,\n cursor: ctx.values[\"cursor\"] as string | undefined,\n pageSize: ctx.values[\"page-size\"] as number | undefined,\n status: ctx.values[\"status\"] as string | undefined,\n uploaderId: ctx.values[\"uploader-id\"] as string | undefined,\n });\n\n console.log(JSON.stringify(response, null, 2));\n },\n});\n"],"mappings":";;;;AAGA,MAAa,mBAAmB,OAAO;CACrC,MAAM;CACN,aAAa;CACb,MAAM;EACJ,GAAG;EACH,QAAQ;GACN,MAAM;GACN,aAAa;GACd;EACD,gBAAgB;GACd,MAAM;GACN,aAAa;GACd;EACD,QAAQ;GACN,MAAM;GACN,aAAa;GACd;EACD,aAAa;GACX,MAAM;GACN,aAAa;GACd;EACD,QAAQ;GACN,MAAM;GACN,aAAa;GACd;EACD,eAAe;GACb,MAAM;GACN,aAAa;GACd;EACF;CACD,KAAK,OAAO,QAAQ;EAClB,MAAM,SAAS,mBAAmB;GAChC,QAAQ,IAAI,OAAO;GACnB,aAAa,IAAI,OAAO;GACzB,CAAC;EAGF,MAAM,WAAW,MADF,wBAAwB,IAAI,CACb,UAAU;GACtC;GACA,QAAQ,IAAI,OAAO;GACnB,UAAU,IAAI,OAAO;GACrB,QAAQ,IAAI,OAAO;GACnB,YAAY,IAAI,OAAO;GACxB,CAAC;AAEF,UAAQ,IAAI,KAAK,UAAU,UAAU,MAAM,EAAE,CAAC;;CAEjD,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as gunshi14 from "gunshi";
|
|
2
|
+
|
|
3
|
+
//#region src/cli/commands/files/update.d.ts
|
|
4
|
+
declare const filesUpdateCommand: gunshi14.Command<{
|
|
5
|
+
"file-key": {
|
|
6
|
+
type: "string";
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
"key-parts": {
|
|
10
|
+
type: "string";
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
filename: {
|
|
14
|
+
type: "string";
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
visibility: {
|
|
18
|
+
type: "string";
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
tags: {
|
|
22
|
+
type: "string";
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
metadata: {
|
|
26
|
+
type: "string";
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
"base-url": {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly short: "b";
|
|
32
|
+
readonly description: "Upload fragment base URL (env: FRAGNO_UPLOAD_BASE_URL)";
|
|
33
|
+
};
|
|
34
|
+
header: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly short: "H";
|
|
37
|
+
readonly description: "Extra HTTP header (repeatable), format: 'Name: value' (env: FRAGNO_UPLOAD_HEADERS)";
|
|
38
|
+
readonly multiple: true;
|
|
39
|
+
};
|
|
40
|
+
timeout: {
|
|
41
|
+
readonly type: "number";
|
|
42
|
+
readonly description: "Request timeout in ms (env: FRAGNO_UPLOAD_TIMEOUT_MS, default: 15000)";
|
|
43
|
+
};
|
|
44
|
+
retries: {
|
|
45
|
+
readonly type: "number";
|
|
46
|
+
readonly description: "Retry count for network/5xx/429 (env: FRAGNO_UPLOAD_RETRIES, default: 2)";
|
|
47
|
+
};
|
|
48
|
+
"retry-delay": {
|
|
49
|
+
readonly type: "number";
|
|
50
|
+
readonly description: "Delay between retries in ms (env: FRAGNO_UPLOAD_RETRY_DELAY_MS, default: 500)";
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
//# sourceMappingURL=update.d.ts.map
|
|
54
|
+
//#endregion
|
|
55
|
+
export { filesUpdateCommand };
|
|
56
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","names":[],"sources":["../../../../../src/cli/commands/files/update.ts"],"sourcesContent":[],"mappings":";;;cAQa,oBA6DX,QAAA,CA7D6B;;;IAAlB,WAAA,EAAA,MA6DX"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { baseArgs, createClientFromContext, parseJsonValue, resolveFileKeyValue } from "../../utils/options.js";
|
|
2
|
+
import { define } from "gunshi";
|
|
3
|
+
|
|
4
|
+
//#region src/cli/commands/files/update.ts
|
|
5
|
+
const filesUpdateCommand = define({
|
|
6
|
+
name: "update",
|
|
7
|
+
description: "Update file metadata",
|
|
8
|
+
args: {
|
|
9
|
+
...baseArgs,
|
|
10
|
+
"file-key": {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "File key (encoded)"
|
|
13
|
+
},
|
|
14
|
+
"key-parts": {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "File key parts as JSON array"
|
|
17
|
+
},
|
|
18
|
+
filename: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "New filename"
|
|
21
|
+
},
|
|
22
|
+
visibility: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Visibility (private, public, unlisted)"
|
|
25
|
+
},
|
|
26
|
+
tags: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Tags JSON array or null"
|
|
29
|
+
},
|
|
30
|
+
metadata: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Metadata JSON object or null"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
run: async (ctx) => {
|
|
36
|
+
const resolvedKey = resolveFileKeyValue({
|
|
37
|
+
fileKey: ctx.values["file-key"],
|
|
38
|
+
keyParts: ctx.values["key-parts"]
|
|
39
|
+
});
|
|
40
|
+
const payload = {};
|
|
41
|
+
if (ctx.values["filename"]) payload["filename"] = ctx.values["filename"];
|
|
42
|
+
if (ctx.values["visibility"]) payload["visibility"] = ctx.values["visibility"];
|
|
43
|
+
if (ctx.values["tags"] !== void 0) payload["tags"] = parseJsonValue("tags", ctx.values["tags"]);
|
|
44
|
+
if (ctx.values["metadata"] !== void 0) payload["metadata"] = parseJsonValue("metadata", ctx.values["metadata"]);
|
|
45
|
+
if (Object.keys(payload).length === 0) throw new Error("Provide at least one field to update.");
|
|
46
|
+
const response = await createClientFromContext(ctx).updateFile(resolvedKey.fileKey, payload);
|
|
47
|
+
console.log(JSON.stringify(response, null, 2));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { filesUpdateCommand };
|
|
53
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","names":["payload: Record<string, unknown>"],"sources":["../../../../../src/cli/commands/files/update.ts"],"sourcesContent":["import { define } from \"gunshi\";\nimport {\n baseArgs,\n createClientFromContext,\n parseJsonValue,\n resolveFileKeyValue,\n} from \"../../utils/options.js\";\n\nexport const filesUpdateCommand = define({\n name: \"update\",\n description: \"Update file metadata\",\n args: {\n ...baseArgs,\n \"file-key\": {\n type: \"string\",\n description: \"File key (encoded)\",\n },\n \"key-parts\": {\n type: \"string\",\n description: \"File key parts as JSON array\",\n },\n filename: {\n type: \"string\",\n description: \"New filename\",\n },\n visibility: {\n type: \"string\",\n description: \"Visibility (private, public, unlisted)\",\n },\n tags: {\n type: \"string\",\n description: \"Tags JSON array or null\",\n },\n metadata: {\n type: \"string\",\n description: \"Metadata JSON object or null\",\n },\n },\n run: async (ctx) => {\n const resolvedKey = resolveFileKeyValue({\n fileKey: ctx.values[\"file-key\"] as string | undefined,\n keyParts: ctx.values[\"key-parts\"] as string | undefined,\n });\n\n const payload: Record<string, unknown> = {};\n if (ctx.values[\"filename\"]) {\n payload[\"filename\"] = ctx.values[\"filename\"] as string;\n }\n if (ctx.values[\"visibility\"]) {\n payload[\"visibility\"] = ctx.values[\"visibility\"] as string;\n }\n if (ctx.values[\"tags\"] !== undefined) {\n payload[\"tags\"] = parseJsonValue(\"tags\", ctx.values[\"tags\"] as string | undefined);\n }\n if (ctx.values[\"metadata\"] !== undefined) {\n payload[\"metadata\"] = parseJsonValue(\n \"metadata\",\n ctx.values[\"metadata\"] as string | undefined,\n );\n }\n\n if (Object.keys(payload).length === 0) {\n throw new Error(\"Provide at least one field to update.\");\n }\n\n const client = createClientFromContext(ctx);\n const response = await client.updateFile(resolvedKey.fileKey, payload);\n console.log(JSON.stringify(response, null, 2));\n },\n});\n"],"mappings":";;;;AAQA,MAAa,qBAAqB,OAAO;CACvC,MAAM;CACN,aAAa;CACb,MAAM;EACJ,GAAG;EACH,YAAY;GACV,MAAM;GACN,aAAa;GACd;EACD,aAAa;GACX,MAAM;GACN,aAAa;GACd;EACD,UAAU;GACR,MAAM;GACN,aAAa;GACd;EACD,YAAY;GACV,MAAM;GACN,aAAa;GACd;EACD,MAAM;GACJ,MAAM;GACN,aAAa;GACd;EACD,UAAU;GACR,MAAM;GACN,aAAa;GACd;EACF;CACD,KAAK,OAAO,QAAQ;EAClB,MAAM,cAAc,oBAAoB;GACtC,SAAS,IAAI,OAAO;GACpB,UAAU,IAAI,OAAO;GACtB,CAAC;EAEF,MAAMA,UAAmC,EAAE;AAC3C,MAAI,IAAI,OAAO,YACb,SAAQ,cAAc,IAAI,OAAO;AAEnC,MAAI,IAAI,OAAO,cACb,SAAQ,gBAAgB,IAAI,OAAO;AAErC,MAAI,IAAI,OAAO,YAAY,OACzB,SAAQ,UAAU,eAAe,QAAQ,IAAI,OAAO,QAA8B;AAEpF,MAAI,IAAI,OAAO,gBAAgB,OAC7B,SAAQ,cAAc,eACpB,YACA,IAAI,OAAO,YACZ;AAGH,MAAI,OAAO,KAAK,QAAQ,CAAC,WAAW,EAClC,OAAM,IAAI,MAAM,wCAAwC;EAI1D,MAAM,WAAW,MADF,wBAAwB,IAAI,CACb,WAAW,YAAY,SAAS,QAAQ;AACtE,UAAQ,IAAI,KAAK,UAAU,UAAU,MAAM,EAAE,CAAC;;CAEjD,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as gunshi11 from "gunshi";
|
|
2
|
+
|
|
3
|
+
//#region src/cli/commands/files/upload.d.ts
|
|
4
|
+
declare const filesUploadCommand: gunshi11.Command<{
|
|
5
|
+
file: {
|
|
6
|
+
type: "string";
|
|
7
|
+
short: string;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
"file-key": {
|
|
11
|
+
type: "string";
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
"key-parts": {
|
|
15
|
+
type: "string";
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
filename: {
|
|
19
|
+
type: "string";
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
"content-type": {
|
|
23
|
+
type: "string";
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
checksum: {
|
|
27
|
+
type: "string";
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
tags: {
|
|
31
|
+
type: "string";
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
visibility: {
|
|
35
|
+
type: "string";
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
"uploader-id": {
|
|
39
|
+
type: "string";
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
metadata: {
|
|
43
|
+
type: "string";
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
"base-url": {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
readonly short: "b";
|
|
49
|
+
readonly description: "Upload fragment base URL (env: FRAGNO_UPLOAD_BASE_URL)";
|
|
50
|
+
};
|
|
51
|
+
header: {
|
|
52
|
+
readonly type: "string";
|
|
53
|
+
readonly short: "H";
|
|
54
|
+
readonly description: "Extra HTTP header (repeatable), format: 'Name: value' (env: FRAGNO_UPLOAD_HEADERS)";
|
|
55
|
+
readonly multiple: true;
|
|
56
|
+
};
|
|
57
|
+
timeout: {
|
|
58
|
+
readonly type: "number";
|
|
59
|
+
readonly description: "Request timeout in ms (env: FRAGNO_UPLOAD_TIMEOUT_MS, default: 15000)";
|
|
60
|
+
};
|
|
61
|
+
retries: {
|
|
62
|
+
readonly type: "number";
|
|
63
|
+
readonly description: "Retry count for network/5xx/429 (env: FRAGNO_UPLOAD_RETRIES, default: 2)";
|
|
64
|
+
};
|
|
65
|
+
"retry-delay": {
|
|
66
|
+
readonly type: "number";
|
|
67
|
+
readonly description: "Delay between retries in ms (env: FRAGNO_UPLOAD_RETRY_DELAY_MS, default: 500)";
|
|
68
|
+
};
|
|
69
|
+
}>;
|
|
70
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
71
|
+
//#endregion
|
|
72
|
+
export { filesUploadCommand };
|
|
73
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","names":[],"sources":["../../../../../src/cli/commands/files/upload.ts"],"sourcesContent":[],"mappings":";;;cAYa,oBAuGX,QAAA,CAvG6B;;;IAAlB,KAAA,EAAA,MAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { baseArgs, createClientFromContext, parseJsonValue, resolveFileKeyValue } from "../../utils/options.js";
|
|
2
|
+
import { promises } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { define } from "gunshi";
|
|
5
|
+
|
|
6
|
+
//#region src/cli/commands/files/upload.ts
|
|
7
|
+
const DEFAULT_CONTENT_TYPE = "application/octet-stream";
|
|
8
|
+
const filesUploadCommand = define({
|
|
9
|
+
name: "upload",
|
|
10
|
+
description: "Upload a file via the /files endpoint",
|
|
11
|
+
args: {
|
|
12
|
+
...baseArgs,
|
|
13
|
+
file: {
|
|
14
|
+
type: "string",
|
|
15
|
+
short: "f",
|
|
16
|
+
description: "Path to file"
|
|
17
|
+
},
|
|
18
|
+
"file-key": {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "File key (encoded)"
|
|
21
|
+
},
|
|
22
|
+
"key-parts": {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "File key parts as JSON array"
|
|
25
|
+
},
|
|
26
|
+
filename: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Override filename"
|
|
29
|
+
},
|
|
30
|
+
"content-type": {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Content type (default: application/octet-stream)"
|
|
33
|
+
},
|
|
34
|
+
checksum: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Checksum JSON"
|
|
37
|
+
},
|
|
38
|
+
tags: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Tags as JSON array"
|
|
41
|
+
},
|
|
42
|
+
visibility: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Visibility (private, public, unlisted)"
|
|
45
|
+
},
|
|
46
|
+
"uploader-id": {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Uploader id"
|
|
49
|
+
},
|
|
50
|
+
metadata: {
|
|
51
|
+
type: "string",
|
|
52
|
+
description: "Metadata JSON object"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
run: async (ctx) => {
|
|
56
|
+
const filePath = ctx.values["file"];
|
|
57
|
+
if (!filePath) throw new Error("Missing --file");
|
|
58
|
+
const fileBuffer = await promises.readFile(filePath);
|
|
59
|
+
const filename = ctx.values["filename"] ?? path.basename(filePath);
|
|
60
|
+
const contentType = ctx.values["content-type"] ?? DEFAULT_CONTENT_TYPE;
|
|
61
|
+
const resolvedKey = resolveFileKeyValue({
|
|
62
|
+
fileKey: ctx.values["file-key"],
|
|
63
|
+
keyParts: ctx.values["key-parts"]
|
|
64
|
+
});
|
|
65
|
+
const checksum = parseJsonValue("checksum", ctx.values["checksum"]);
|
|
66
|
+
const tags = parseJsonValue("tags", ctx.values["tags"]);
|
|
67
|
+
const metadata = parseJsonValue("metadata", ctx.values["metadata"]);
|
|
68
|
+
const form = new FormData();
|
|
69
|
+
form.append("file", new File([fileBuffer], filename, { type: contentType }));
|
|
70
|
+
if (resolvedKey.fileKey) form.append("fileKey", resolvedKey.fileKey);
|
|
71
|
+
if (resolvedKey.keyParts) form.append("keyParts", JSON.stringify(resolvedKey.keyParts));
|
|
72
|
+
if (checksum !== void 0) form.append("checksum", JSON.stringify(checksum));
|
|
73
|
+
if (tags !== void 0) form.append("tags", JSON.stringify(tags));
|
|
74
|
+
if (metadata !== void 0) form.append("metadata", JSON.stringify(metadata));
|
|
75
|
+
const uploaderId = ctx.values["uploader-id"];
|
|
76
|
+
if (uploaderId) form.append("uploaderId", uploaderId);
|
|
77
|
+
const visibility = ctx.values["visibility"];
|
|
78
|
+
if (visibility) form.append("visibility", visibility);
|
|
79
|
+
if (ctx.values["filename"]) form.append("filename", filename);
|
|
80
|
+
const response = await createClientFromContext(ctx).createFile(form);
|
|
81
|
+
console.log(JSON.stringify(response, null, 2));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { filesUploadCommand };
|
|
87
|
+
//# sourceMappingURL=upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.js","names":["fs"],"sources":["../../../../../src/cli/commands/files/upload.ts"],"sourcesContent":["import { define } from \"gunshi\";\nimport { promises as fs } from \"node:fs\";\nimport path from \"node:path\";\nimport {\n baseArgs,\n createClientFromContext,\n parseJsonValue,\n resolveFileKeyValue,\n} from \"../../utils/options.js\";\n\nconst DEFAULT_CONTENT_TYPE = \"application/octet-stream\";\n\nexport const filesUploadCommand = define({\n name: \"upload\",\n description: \"Upload a file via the /files endpoint\",\n args: {\n ...baseArgs,\n file: {\n type: \"string\",\n short: \"f\",\n description: \"Path to file\",\n },\n \"file-key\": {\n type: \"string\",\n description: \"File key (encoded)\",\n },\n \"key-parts\": {\n type: \"string\",\n description: \"File key parts as JSON array\",\n },\n filename: {\n type: \"string\",\n description: \"Override filename\",\n },\n \"content-type\": {\n type: \"string\",\n description: \"Content type (default: application/octet-stream)\",\n },\n checksum: {\n type: \"string\",\n description: \"Checksum JSON\",\n },\n tags: {\n type: \"string\",\n description: \"Tags as JSON array\",\n },\n visibility: {\n type: \"string\",\n description: \"Visibility (private, public, unlisted)\",\n },\n \"uploader-id\": {\n type: \"string\",\n description: \"Uploader id\",\n },\n metadata: {\n type: \"string\",\n description: \"Metadata JSON object\",\n },\n },\n run: async (ctx) => {\n const filePath = ctx.values[\"file\"] as string | undefined;\n if (!filePath) {\n throw new Error(\"Missing --file\");\n }\n\n const fileBuffer = await fs.readFile(filePath);\n const filename = (ctx.values[\"filename\"] as string | undefined) ?? path.basename(filePath);\n const contentType = (ctx.values[\"content-type\"] as string | undefined) ?? DEFAULT_CONTENT_TYPE;\n\n const resolvedKey = resolveFileKeyValue({\n fileKey: ctx.values[\"file-key\"] as string | undefined,\n keyParts: ctx.values[\"key-parts\"] as string | undefined,\n });\n\n const checksum = parseJsonValue(\"checksum\", ctx.values[\"checksum\"] as string | undefined);\n const tags = parseJsonValue(\"tags\", ctx.values[\"tags\"] as string | undefined);\n const metadata = parseJsonValue(\"metadata\", ctx.values[\"metadata\"] as string | undefined);\n\n const form = new FormData();\n form.append(\"file\", new File([fileBuffer], filename, { type: contentType }));\n\n if (resolvedKey.fileKey) {\n form.append(\"fileKey\", resolvedKey.fileKey);\n }\n if (resolvedKey.keyParts) {\n form.append(\"keyParts\", JSON.stringify(resolvedKey.keyParts));\n }\n if (checksum !== undefined) {\n form.append(\"checksum\", JSON.stringify(checksum));\n }\n if (tags !== undefined) {\n form.append(\"tags\", JSON.stringify(tags));\n }\n if (metadata !== undefined) {\n form.append(\"metadata\", JSON.stringify(metadata));\n }\n\n const uploaderId = ctx.values[\"uploader-id\"] as string | undefined;\n if (uploaderId) {\n form.append(\"uploaderId\", uploaderId);\n }\n\n const visibility = ctx.values[\"visibility\"] as string | undefined;\n if (visibility) {\n form.append(\"visibility\", visibility);\n }\n\n if (ctx.values[\"filename\"]) {\n form.append(\"filename\", filename);\n }\n\n const client = createClientFromContext(ctx);\n const response = await client.createFile(form);\n console.log(JSON.stringify(response, null, 2));\n },\n});\n"],"mappings":";;;;;;AAUA,MAAM,uBAAuB;AAE7B,MAAa,qBAAqB,OAAO;CACvC,MAAM;CACN,aAAa;CACb,MAAM;EACJ,GAAG;EACH,MAAM;GACJ,MAAM;GACN,OAAO;GACP,aAAa;GACd;EACD,YAAY;GACV,MAAM;GACN,aAAa;GACd;EACD,aAAa;GACX,MAAM;GACN,aAAa;GACd;EACD,UAAU;GACR,MAAM;GACN,aAAa;GACd;EACD,gBAAgB;GACd,MAAM;GACN,aAAa;GACd;EACD,UAAU;GACR,MAAM;GACN,aAAa;GACd;EACD,MAAM;GACJ,MAAM;GACN,aAAa;GACd;EACD,YAAY;GACV,MAAM;GACN,aAAa;GACd;EACD,eAAe;GACb,MAAM;GACN,aAAa;GACd;EACD,UAAU;GACR,MAAM;GACN,aAAa;GACd;EACF;CACD,KAAK,OAAO,QAAQ;EAClB,MAAM,WAAW,IAAI,OAAO;AAC5B,MAAI,CAAC,SACH,OAAM,IAAI,MAAM,iBAAiB;EAGnC,MAAM,aAAa,MAAMA,SAAG,SAAS,SAAS;EAC9C,MAAM,WAAY,IAAI,OAAO,eAAsC,KAAK,SAAS,SAAS;EAC1F,MAAM,cAAe,IAAI,OAAO,mBAA0C;EAE1E,MAAM,cAAc,oBAAoB;GACtC,SAAS,IAAI,OAAO;GACpB,UAAU,IAAI,OAAO;GACtB,CAAC;EAEF,MAAM,WAAW,eAAe,YAAY,IAAI,OAAO,YAAkC;EACzF,MAAM,OAAO,eAAe,QAAQ,IAAI,OAAO,QAA8B;EAC7E,MAAM,WAAW,eAAe,YAAY,IAAI,OAAO,YAAkC;EAEzF,MAAM,OAAO,IAAI,UAAU;AAC3B,OAAK,OAAO,QAAQ,IAAI,KAAK,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC,CAAC;AAE5E,MAAI,YAAY,QACd,MAAK,OAAO,WAAW,YAAY,QAAQ;AAE7C,MAAI,YAAY,SACd,MAAK,OAAO,YAAY,KAAK,UAAU,YAAY,SAAS,CAAC;AAE/D,MAAI,aAAa,OACf,MAAK,OAAO,YAAY,KAAK,UAAU,SAAS,CAAC;AAEnD,MAAI,SAAS,OACX,MAAK,OAAO,QAAQ,KAAK,UAAU,KAAK,CAAC;AAE3C,MAAI,aAAa,OACf,MAAK,OAAO,YAAY,KAAK,UAAU,SAAS,CAAC;EAGnD,MAAM,aAAa,IAAI,OAAO;AAC9B,MAAI,WACF,MAAK,OAAO,cAAc,WAAW;EAGvC,MAAM,aAAa,IAAI,OAAO;AAC9B,MAAI,WACF,MAAK,OAAO,cAAc,WAAW;AAGvC,MAAI,IAAI,OAAO,YACb,MAAK,OAAO,YAAY,SAAS;EAInC,MAAM,WAAW,MADF,wBAAwB,IAAI,CACb,WAAW,KAAK;AAC9C,UAAQ,IAAI,KAAK,UAAU,UAAU,MAAM,EAAE,CAAC;;CAEjD,CAAC"}
|