@effect-kit/storage 0.0.0-stage → 0.0.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/LICENSE +204 -0
- package/README.md +369 -2
- package/dist/_virtual/_rolldown/runtime.js +17 -0
- package/dist/azure/account-admin.d.ts +116 -0
- package/dist/azure/account-admin.js +90 -0
- package/dist/azure/account-admin.js.map +1 -0
- package/dist/azure/admin.d.ts +68 -0
- package/dist/azure/admin.js +85 -0
- package/dist/azure/admin.js.map +1 -0
- package/dist/azure/archive.d.ts +95 -0
- package/dist/azure/archive.js +52 -0
- package/dist/azure/archive.js.map +1 -0
- package/dist/azure/events.d.ts +40 -0
- package/dist/azure/events.js +62 -0
- package/dist/azure/events.js.map +1 -0
- package/dist/azure/governance.d.ts +139 -0
- package/dist/azure/governance.js +59 -0
- package/dist/azure/governance.js.map +1 -0
- package/dist/azure/identity.d.ts +4 -0
- package/dist/azure/identity.js +8 -0
- package/dist/azure/identity.js.map +1 -0
- package/dist/azure/lifecycle.d.ts +21 -0
- package/dist/azure/lifecycle.js +193 -0
- package/dist/azure/lifecycle.js.map +1 -0
- package/dist/azure/signing.d.ts +17 -0
- package/dist/azure/signing.js +71 -0
- package/dist/azure/signing.js.map +1 -0
- package/dist/azure/uploads.d.ts +11 -0
- package/dist/azure/uploads.js +83 -0
- package/dist/azure/uploads.js.map +1 -0
- package/dist/azure.d.ts +427 -0
- package/dist/azure.js +77 -0
- package/dist/azure.js.map +1 -0
- package/dist/b2/admin.d.ts +149 -0
- package/dist/b2/admin.js +157 -0
- package/dist/b2/admin.js.map +1 -0
- package/dist/b2.d.ts +15 -0
- package/dist/b2.js +15 -0
- package/dist/b2.js.map +1 -0
- package/dist/browser.d.ts +7 -0
- package/dist/browser.js +11 -0
- package/dist/browser.js.map +1 -0
- package/dist/bun.d.ts +14 -0
- package/dist/bun.js +17 -0
- package/dist/bun.js.map +1 -0
- package/dist/cache.d.ts +18 -0
- package/dist/cache.js +116 -0
- package/dist/cache.js.map +1 -0
- package/dist/client/atoms/controller.d.ts +10 -0
- package/dist/client/atoms/controller.js +267 -0
- package/dist/client/atoms/controller.js.map +1 -0
- package/dist/client/atoms/state.d.ts +17 -0
- package/dist/client/atoms/state.js +11 -0
- package/dist/client/atoms/state.js.map +1 -0
- package/dist/client/atoms.d.ts +59 -0
- package/dist/client/atoms.js +39 -0
- package/dist/client/atoms.js.map +1 -0
- package/dist/client/fingerprint.js +28 -0
- package/dist/client/fingerprint.js.map +1 -0
- package/dist/client/store.d.ts +31 -0
- package/dist/client/store.js +56 -0
- package/dist/client/store.js.map +1 -0
- package/dist/client/transport.d.ts +11 -0
- package/dist/client/transport.js +78 -0
- package/dist/client/transport.js.map +1 -0
- package/dist/client.d.ts +259 -0
- package/dist/client.js +350 -0
- package/dist/client.js.map +1 -0
- package/dist/composition/layer.js +22 -0
- package/dist/composition/layer.js.map +1 -0
- package/dist/composition/representation/staging.js +46 -0
- package/dist/composition/representation/staging.js.map +1 -0
- package/dist/composition/representation/storage.js +188 -0
- package/dist/composition/representation/storage.js.map +1 -0
- package/dist/composition.d.ts +20 -0
- package/dist/composition.js +124 -0
- package/dist/composition.js.map +1 -0
- package/dist/compression.d.ts +16 -0
- package/dist/compression.js +38 -0
- package/dist/compression.js.map +1 -0
- package/dist/content.d.ts +590 -0
- package/dist/content.js +168 -0
- package/dist/content.js.map +1 -0
- package/dist/core/capabilities.d.ts +53 -0
- package/dist/core/capabilities.js +9 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/core/contracts/multipart.d.ts +56 -0
- package/dist/core/contracts/resumable.d.ts +70 -0
- package/dist/core/errors.d.ts +55 -0
- package/dist/core/errors.js +55 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/object.d.ts +97 -0
- package/dist/core/object.js +55 -0
- package/dist/core/object.js.map +1 -0
- package/dist/core/ranges.d.ts +17 -0
- package/dist/core/ranges.js +27 -0
- package/dist/core/ranges.js.map +1 -0
- package/dist/core/requests.d.ts +185 -0
- package/dist/core/requests.js +42 -0
- package/dist/core/requests.js.map +1 -0
- package/dist/core/storage.d.ts +249 -0
- package/dist/core/storage.js +173 -0
- package/dist/core/storage.js.map +1 -0
- package/dist/deno.d.ts +14 -0
- package/dist/deno.js +17 -0
- package/dist/deno.js.map +1 -0
- package/dist/encryption/age.d.ts +14 -0
- package/dist/encryption/age.js +46 -0
- package/dist/encryption/age.js.map +1 -0
- package/dist/encryption.d.ts +16 -0
- package/dist/encryption.js +16 -0
- package/dist/encryption.js.map +1 -0
- package/dist/events.d.ts +57 -0
- package/dist/events.js +106 -0
- package/dist/events.js.map +1 -0
- package/dist/filesystem.d.ts +23 -0
- package/dist/filesystem.js +75 -0
- package/dist/filesystem.js.map +1 -0
- package/dist/gcs/admin.d.ts +470 -0
- package/dist/gcs/admin.js +206 -0
- package/dist/gcs/admin.js.map +1 -0
- package/dist/gcs/events.d.ts +41 -0
- package/dist/gcs/events.js +45 -0
- package/dist/gcs/events.js.map +1 -0
- package/dist/gcs/governance.d.ts +158 -0
- package/dist/gcs/governance.js +100 -0
- package/dist/gcs/governance.js.map +1 -0
- package/dist/gcs/lifecycle.d.ts +161 -0
- package/dist/gcs/lifecycle.js +174 -0
- package/dist/gcs/lifecycle.js.map +1 -0
- package/dist/gcs/post.d.ts +31 -0
- package/dist/gcs/post.js +70 -0
- package/dist/gcs/post.js.map +1 -0
- package/dist/gcs/signing.d.ts +10 -0
- package/dist/gcs/signing.js +61 -0
- package/dist/gcs/signing.js.map +1 -0
- package/dist/gcs/uploads.d.ts +10 -0
- package/dist/gcs/uploads.js +76 -0
- package/dist/gcs/uploads.js.map +1 -0
- package/dist/gcs.d.ts +888 -0
- package/dist/gcs.js +91 -0
- package/dist/gcs.js.map +1 -0
- package/dist/hetzner/admin.d.ts +112 -0
- package/dist/hetzner/admin.js +19 -0
- package/dist/hetzner/admin.js.map +1 -0
- package/dist/hetzner.d.ts +15 -0
- package/dist/hetzner.js +15 -0
- package/dist/hetzner.js.map +1 -0
- package/dist/http/api.d.ts +236 -0
- package/dist/http/api.js +54 -0
- package/dist/http/api.js.map +1 -0
- package/dist/http/download.js +99 -0
- package/dist/http/download.js.map +1 -0
- package/dist/http/schema.d.ts +3 -0
- package/dist/http/schema.js +4 -0
- package/dist/http.d.ts +35 -0
- package/dist/http.js +178 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +9 -0
- package/dist/internal/http/control-plane.js +71 -0
- package/dist/internal/http/control-plane.js.map +1 -0
- package/dist/internal/listing-cursor.js +44 -0
- package/dist/internal/listing-cursor.js.map +1 -0
- package/dist/internal/node/provider-errors.js +16 -0
- package/dist/internal/node/provider-errors.js.map +1 -0
- package/dist/internal/node/upload-body.js +111 -0
- package/dist/internal/node/upload-body.js.map +1 -0
- package/dist/internal/provider-response.js +14 -0
- package/dist/internal/provider-response.js.map +1 -0
- package/dist/internal/public-urls.js +30 -0
- package/dist/internal/public-urls.js.map +1 -0
- package/dist/internal/read-condition.js +11 -0
- package/dist/internal/read-condition.js.map +1 -0
- package/dist/internal/request-validation.js +24 -0
- package/dist/internal/request-validation.js.map +1 -0
- package/dist/internal/signing-request.js +22 -0
- package/dist/internal/signing-request.js.map +1 -0
- package/dist/internal/web-upload-body.js +71 -0
- package/dist/internal/web-upload-body.js.map +1 -0
- package/dist/lifecycle/configuration-state.js +26 -0
- package/dist/lifecycle/configuration-state.js.map +1 -0
- package/dist/lifecycle/metadata.js +28 -0
- package/dist/lifecycle/metadata.js.map +1 -0
- package/dist/lifecycle.d.ts +269 -0
- package/dist/lifecycle.js +72 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/migrations.d.ts +537 -0
- package/dist/migrations.js +296 -0
- package/dist/migrations.js.map +1 -0
- package/dist/minio/admin.d.ts +112 -0
- package/dist/minio/admin.js +19 -0
- package/dist/minio/admin.js.map +1 -0
- package/dist/minio.d.ts +15 -0
- package/dist/minio.js +15 -0
- package/dist/minio.js.map +1 -0
- package/dist/mirror.d.ts +830 -0
- package/dist/mirror.js +290 -0
- package/dist/mirror.js.map +1 -0
- package/dist/node.d.ts +14 -0
- package/dist/node.js +17 -0
- package/dist/node.js.map +1 -0
- package/dist/providers/azure/blocks.js +94 -0
- package/dist/providers/azure/blocks.js.map +1 -0
- package/dist/providers/azure/config.d.ts +41 -0
- package/dist/providers/azure/config.js +62 -0
- package/dist/providers/azure/config.js.map +1 -0
- package/dist/providers/azure/mapping.js +83 -0
- package/dist/providers/azure/mapping.js.map +1 -0
- package/dist/providers/azure/native.js +88 -0
- package/dist/providers/azure/native.js.map +1 -0
- package/dist/providers/azure/primitives.js +203 -0
- package/dist/providers/azure/primitives.js.map +1 -0
- package/dist/providers/azure/properties.d.ts +180 -0
- package/dist/providers/azure/properties.js +55 -0
- package/dist/providers/azure/properties.js.map +1 -0
- package/dist/providers/azure/transport.js +14 -0
- package/dist/providers/azure/transport.js.map +1 -0
- package/dist/providers/azure/validation.js +11 -0
- package/dist/providers/azure/validation.js.map +1 -0
- package/dist/providers/filesystem/envelope.js +56 -0
- package/dist/providers/filesystem/envelope.js.map +1 -0
- package/dist/providers/filesystem/identity.js +68 -0
- package/dist/providers/filesystem/identity.js.map +1 -0
- package/dist/providers/filesystem/layout.d.ts +15 -0
- package/dist/providers/filesystem/layout.js +112 -0
- package/dist/providers/filesystem/layout.js.map +1 -0
- package/dist/providers/filesystem/list.js +82 -0
- package/dist/providers/filesystem/list.js.map +1 -0
- package/dist/providers/filesystem/operations.js +134 -0
- package/dist/providers/filesystem/operations.js.map +1 -0
- package/dist/providers/gcs/config.d.ts +34 -0
- package/dist/providers/gcs/config.js +60 -0
- package/dist/providers/gcs/config.js.map +1 -0
- package/dist/providers/gcs/iam.js +45 -0
- package/dist/providers/gcs/iam.js.map +1 -0
- package/dist/providers/gcs/mapping.js +118 -0
- package/dist/providers/gcs/mapping.js.map +1 -0
- package/dist/providers/gcs/native.d.ts +11 -0
- package/dist/providers/gcs/native.js +122 -0
- package/dist/providers/gcs/native.js.map +1 -0
- package/dist/providers/gcs/primitives.js +194 -0
- package/dist/providers/gcs/primitives.js.map +1 -0
- package/dist/providers/gcs/resumable.js +145 -0
- package/dist/providers/gcs/resumable.js.map +1 -0
- package/dist/providers/gcs/tier.d.ts +176 -0
- package/dist/providers/gcs/tier.js +34 -0
- package/dist/providers/gcs/tier.js.map +1 -0
- package/dist/providers/gcs/transport.js +123 -0
- package/dist/providers/gcs/transport.js.map +1 -0
- package/dist/providers/gcs/upload.js +28 -0
- package/dist/providers/gcs/upload.js.map +1 -0
- package/dist/providers/gcs/validation.js +10 -0
- package/dist/providers/gcs/validation.js.map +1 -0
- package/dist/providers/r2-workers/binding.d.ts +102 -0
- package/dist/providers/r2-workers/body.js +82 -0
- package/dist/providers/r2-workers/body.js.map +1 -0
- package/dist/providers/r2-workers/list.js +62 -0
- package/dist/providers/r2-workers/list.js.map +1 -0
- package/dist/providers/r2-workers/mapping.js +140 -0
- package/dist/providers/r2-workers/mapping.js.map +1 -0
- package/dist/providers/r2-workers/multipart.js +121 -0
- package/dist/providers/r2-workers/multipart.js.map +1 -0
- package/dist/providers/r2-workers/primitives.js +80 -0
- package/dist/providers/r2-workers/primitives.js.map +1 -0
- package/dist/providers/s3/admin-configuration.d.ts +19 -0
- package/dist/providers/s3/admin-configuration.js +171 -0
- package/dist/providers/s3/admin-configuration.js.map +1 -0
- package/dist/providers/s3/bulk-delete.d.ts +43 -0
- package/dist/providers/s3/bulk-delete.js +58 -0
- package/dist/providers/s3/bulk-delete.js.map +1 -0
- package/dist/providers/s3/config.d.ts +43 -0
- package/dist/providers/s3/config.js +89 -0
- package/dist/providers/s3/config.js.map +1 -0
- package/dist/providers/s3/copy.d.ts +115 -0
- package/dist/providers/s3/copy.js +122 -0
- package/dist/providers/s3/copy.js.map +1 -0
- package/dist/providers/s3/lifecycle-validation.js +33 -0
- package/dist/providers/s3/lifecycle-validation.js.map +1 -0
- package/dist/providers/s3/listing.js +56 -0
- package/dist/providers/s3/listing.js.map +1 -0
- package/dist/providers/s3/metadata.d.ts +10 -0
- package/dist/providers/s3/metadata.js +90 -0
- package/dist/providers/s3/metadata.js.map +1 -0
- package/dist/providers/s3/multipart.d.ts +41 -0
- package/dist/providers/s3/multipart.js +299 -0
- package/dist/providers/s3/multipart.js.map +1 -0
- package/dist/providers/s3/native-models.d.ts +82 -0
- package/dist/providers/s3/native-models.js +91 -0
- package/dist/providers/s3/native-models.js.map +1 -0
- package/dist/providers/s3/object-mapping.js +114 -0
- package/dist/providers/s3/object-mapping.js.map +1 -0
- package/dist/providers/s3/primitives.d.ts +8 -0
- package/dist/providers/s3/primitives.js +235 -0
- package/dist/providers/s3/primitives.js.map +1 -0
- package/dist/providers/s3/profile.d.ts +25 -0
- package/dist/providers/s3/profile.js +46 -0
- package/dist/providers/s3/profile.js.map +1 -0
- package/dist/providers/s3/request-extension.js +29 -0
- package/dist/providers/s3/request-extension.js.map +1 -0
- package/dist/providers/s3/service.js +55 -0
- package/dist/providers/s3/service.js.map +1 -0
- package/dist/providers/s3/signing-credentials.js +32 -0
- package/dist/providers/s3/signing-credentials.js.map +1 -0
- package/dist/providers/s3/tags.d.ts +10 -0
- package/dist/providers/s3/tags.js +65 -0
- package/dist/providers/s3/tags.js.map +1 -0
- package/dist/providers/s3/tier.d.ts +171 -0
- package/dist/providers/s3/tier.js +100 -0
- package/dist/providers/s3/tier.js.map +1 -0
- package/dist/providers/s3/transfer-driver.js +72 -0
- package/dist/providers/s3/transfer-driver.js.map +1 -0
- package/dist/providers/s3/transport.js +94 -0
- package/dist/providers/s3/transport.js.map +1 -0
- package/dist/providers/s3/upload-body.js +10 -0
- package/dist/providers/s3/upload-body.js.map +1 -0
- package/dist/providers/s3/validation.js +31 -0
- package/dist/providers/s3/validation.js.map +1 -0
- package/dist/providers/s3/versions.d.ts +10 -0
- package/dist/providers/s3/versions.js +143 -0
- package/dist/providers/s3/versions.js.map +1 -0
- package/dist/providers/s3-compatible/config.d.ts +36 -0
- package/dist/providers/s3-compatible/config.js +174 -0
- package/dist/providers/s3-compatible/config.js.map +1 -0
- package/dist/providers/s3-compatible/service.js +48 -0
- package/dist/providers/s3-compatible/service.js.map +1 -0
- package/dist/providers/supabase/config.d.ts +20 -0
- package/dist/providers/supabase/config.js +41 -0
- package/dist/providers/supabase/config.js.map +1 -0
- package/dist/providers/supabase/mapping.js +60 -0
- package/dist/providers/supabase/mapping.js.map +1 -0
- package/dist/providers/supabase/primitives.js +205 -0
- package/dist/providers/supabase/primitives.js.map +1 -0
- package/dist/providers/supabase/transport.js +64 -0
- package/dist/providers/supabase/transport.js.map +1 -0
- package/dist/providers/supabase/tus.js +163 -0
- package/dist/providers/supabase/tus.js.map +1 -0
- package/dist/providers/tigris/configuration.js +118 -0
- package/dist/providers/tigris/configuration.js.map +1 -0
- package/dist/providers/tigris/snapshots.js +87 -0
- package/dist/providers/tigris/snapshots.js.map +1 -0
- package/dist/providers/tigris/transport.js +18 -0
- package/dist/providers/tigris/transport.js.map +1 -0
- package/dist/providers/vercel/config.d.ts +16 -0
- package/dist/providers/vercel/config.js +48 -0
- package/dist/providers/vercel/config.js.map +1 -0
- package/dist/providers/vercel/mapping.js +79 -0
- package/dist/providers/vercel/mapping.js.map +1 -0
- package/dist/providers/vercel/multipart.js +113 -0
- package/dist/providers/vercel/multipart.js.map +1 -0
- package/dist/providers/vercel/primitives.js +168 -0
- package/dist/providers/vercel/primitives.js.map +1 -0
- package/dist/providers/vercel/transport.js +32 -0
- package/dist/providers/vercel/transport.js.map +1 -0
- package/dist/providers/wasabi/compliance.d.ts +52 -0
- package/dist/providers/wasabi/compliance.js +89 -0
- package/dist/providers/wasabi/compliance.js.map +1 -0
- package/dist/providers/wasabi/xml.js +55 -0
- package/dist/providers/wasabi/xml.js.map +1 -0
- package/dist/r2/admin.d.ts +126 -0
- package/dist/r2/admin.js +138 -0
- package/dist/r2/admin.js.map +1 -0
- package/dist/r2/events.d.ts +41 -0
- package/dist/r2/events.js +37 -0
- package/dist/r2/events.js.map +1 -0
- package/dist/r2-workers.d.ts +24 -0
- package/dist/r2-workers.js +115 -0
- package/dist/r2-workers.js.map +1 -0
- package/dist/r2.d.ts +15 -0
- package/dist/r2.js +15 -0
- package/dist/r2.js.map +1 -0
- package/dist/react.d.ts +73 -0
- package/dist/react.js +49 -0
- package/dist/react.js.map +1 -0
- package/dist/representation.d.ts +24 -0
- package/dist/representation.js +7 -0
- package/dist/representation.js.map +1 -0
- package/dist/runtime/bun-filesystem.js +136 -0
- package/dist/runtime/bun-filesystem.js.map +1 -0
- package/dist/runtime/file-target.d.ts +10 -0
- package/dist/runtime/file-target.js +66 -0
- package/dist/runtime/file-target.js.map +1 -0
- package/dist/runtime/filesystem.d.ts +6 -0
- package/dist/runtime/filesystem.js +68 -0
- package/dist/runtime/filesystem.js.map +1 -0
- package/dist/runtime/node-hash.d.ts +4 -0
- package/dist/runtime/node-hash.js +31 -0
- package/dist/runtime/node-hash.js.map +1 -0
- package/dist/runtime/node-protection.d.ts +4 -0
- package/dist/runtime/node-protection.js +46 -0
- package/dist/runtime/node-protection.js.map +1 -0
- package/dist/runtime/portable-hash.d.ts +3 -0
- package/dist/runtime/portable-hash.js +31 -0
- package/dist/runtime/portable-hash.js.map +1 -0
- package/dist/runtime/session-store.d.ts +12 -0
- package/dist/runtime/session-store.js +19 -0
- package/dist/runtime/session-store.js.map +1 -0
- package/dist/runtime/web-protection.d.ts +7 -0
- package/dist/runtime/web-protection.js +54 -0
- package/dist/runtime/web-protection.js.map +1 -0
- package/dist/s3/admin.d.ts +183 -0
- package/dist/s3/admin.js +197 -0
- package/dist/s3/admin.js.map +1 -0
- package/dist/s3/archive.d.ts +25 -0
- package/dist/s3/archive.js +113 -0
- package/dist/s3/archive.js.map +1 -0
- package/dist/s3/events.d.ts +42 -0
- package/dist/s3/events.js +69 -0
- package/dist/s3/events.js.map +1 -0
- package/dist/s3/governance.d.ts +319 -0
- package/dist/s3/governance.js +108 -0
- package/dist/s3/governance.js.map +1 -0
- package/dist/s3/lifecycle.d.ts +4 -0
- package/dist/s3/lifecycle.js +5 -0
- package/dist/s3/post.d.ts +31 -0
- package/dist/s3/post.js +93 -0
- package/dist/s3/post.js.map +1 -0
- package/dist/s3/signing.d.ts +105 -0
- package/dist/s3/signing.js +198 -0
- package/dist/s3/signing.js.map +1 -0
- package/dist/s3/uploads.d.ts +11 -0
- package/dist/s3/uploads.js +173 -0
- package/dist/s3/uploads.js.map +1 -0
- package/dist/s3.d.ts +37 -0
- package/dist/s3.js +114 -0
- package/dist/s3.js.map +1 -0
- package/dist/scaleway/admin.d.ts +112 -0
- package/dist/scaleway/admin.js +19 -0
- package/dist/scaleway/admin.js.map +1 -0
- package/dist/scaleway.d.ts +15 -0
- package/dist/scaleway.js +15 -0
- package/dist/scaleway.js.map +1 -0
- package/dist/session-events.d.ts +22 -0
- package/dist/session-events.js +22 -0
- package/dist/session-events.js.map +1 -0
- package/dist/sessions/checkpoint.d.ts +423 -0
- package/dist/sessions/checkpoint.js +102 -0
- package/dist/sessions/checkpoint.js.map +1 -0
- package/dist/sessions/download.d.ts +17 -0
- package/dist/sessions/download.js +111 -0
- package/dist/sessions/download.js.map +1 -0
- package/dist/sessions/native-upload.js +168 -0
- package/dist/sessions/native-upload.js.map +1 -0
- package/dist/sessions/store.d.ts +40 -0
- package/dist/sessions/store.js +77 -0
- package/dist/sessions/store.js.map +1 -0
- package/dist/sessions/upload.d.ts +10 -0
- package/dist/sessions/upload.js +329 -0
- package/dist/sessions/upload.js.map +1 -0
- package/dist/sessions.d.ts +98 -0
- package/dist/sessions.js +268 -0
- package/dist/sessions.js.map +1 -0
- package/dist/spaces/admin.d.ts +112 -0
- package/dist/spaces/admin.js +19 -0
- package/dist/spaces/admin.js.map +1 -0
- package/dist/spaces.d.ts +15 -0
- package/dist/spaces.js +15 -0
- package/dist/spaces.js.map +1 -0
- package/dist/supabase/admin.d.ts +77 -0
- package/dist/supabase/admin.js +74 -0
- package/dist/supabase/admin.js.map +1 -0
- package/dist/supabase/s3.d.ts +311 -0
- package/dist/supabase/s3.js +153 -0
- package/dist/supabase/s3.js.map +1 -0
- package/dist/supabase/signing.d.ts +23 -0
- package/dist/supabase/signing.js +93 -0
- package/dist/supabase/signing.js.map +1 -0
- package/dist/supabase/tus-uploads.d.ts +13 -0
- package/dist/supabase/tus-uploads.js +109 -0
- package/dist/supabase/tus-uploads.js.map +1 -0
- package/dist/supabase/uploads.d.ts +5 -0
- package/dist/supabase/uploads.js +32 -0
- package/dist/supabase/uploads.js.map +1 -0
- package/dist/supabase.d.ts +100 -0
- package/dist/supabase.js +50 -0
- package/dist/supabase.js.map +1 -0
- package/dist/testing/body-failure.js +18 -0
- package/dist/testing/body-failure.js.map +1 -0
- package/dist/testing/conformance/assertions.d.ts +10 -0
- package/dist/testing/conformance/assertions.js +21 -0
- package/dist/testing/conformance/assertions.js.map +1 -0
- package/dist/testing/conformance/core-cases.js +107 -0
- package/dist/testing/conformance/core-cases.js.map +1 -0
- package/dist/testing/conformance/list-cases.js +72 -0
- package/dist/testing/conformance/list-cases.js.map +1 -0
- package/dist/testing/conformance/read-cases.js +105 -0
- package/dist/testing/conformance/read-cases.js.map +1 -0
- package/dist/testing/conformance.d.ts +23 -0
- package/dist/testing/conformance.js +37 -0
- package/dist/testing/conformance.js.map +1 -0
- package/dist/testing/faults.d.ts +258 -0
- package/dist/testing/faults.js +111 -0
- package/dist/testing/faults.js.map +1 -0
- package/dist/testing/memory-list.js +79 -0
- package/dist/testing/memory-list.js.map +1 -0
- package/dist/testing/memory-state.d.ts +18 -0
- package/dist/testing/memory-state.js +57 -0
- package/dist/testing/memory-state.js.map +1 -0
- package/dist/testing/memory-upload.js +123 -0
- package/dist/testing/memory-upload.js.map +1 -0
- package/dist/testing/memory.d.ts +23 -0
- package/dist/testing/memory.js +121 -0
- package/dist/testing/memory.js.map +1 -0
- package/dist/testing.d.ts +6 -0
- package/dist/testing.js +6 -0
- package/dist/tigris/events.d.ts +42 -0
- package/dist/tigris/events.js +42 -0
- package/dist/tigris/events.js.map +1 -0
- package/dist/tigris/native.d.ts +438 -0
- package/dist/tigris/native.js +166 -0
- package/dist/tigris/native.js.map +1 -0
- package/dist/tigris.d.ts +15 -0
- package/dist/tigris.js +15 -0
- package/dist/tigris.js.map +1 -0
- package/dist/transfers/budget.js +50 -0
- package/dist/transfers/budget.js.map +1 -0
- package/dist/transfers/copy.js +250 -0
- package/dist/transfers/copy.js.map +1 -0
- package/dist/transfers/dependencies.d.ts +10 -0
- package/dist/transfers/dependencies.js +11 -0
- package/dist/transfers/dependencies.js.map +1 -0
- package/dist/transfers/download.js +132 -0
- package/dist/transfers/download.js.map +1 -0
- package/dist/transfers/managed-runtime.d.ts +34 -0
- package/dist/transfers/managed-runtime.js +30 -0
- package/dist/transfers/managed-runtime.js.map +1 -0
- package/dist/transfers/models.d.ts +160 -0
- package/dist/transfers/native-upload.js +195 -0
- package/dist/transfers/native-upload.js.map +1 -0
- package/dist/transfers/part-receipts.js +32 -0
- package/dist/transfers/part-receipts.js.map +1 -0
- package/dist/transfers/planner.d.ts +19 -0
- package/dist/transfers/planner.js +153 -0
- package/dist/transfers/planner.js.map +1 -0
- package/dist/transfers/reader.js +81 -0
- package/dist/transfers/reader.js.map +1 -0
- package/dist/transfers/runtime.d.ts +19 -0
- package/dist/transfers/runtime.js +132 -0
- package/dist/transfers/runtime.js.map +1 -0
- package/dist/transfers/sources.d.ts +22 -0
- package/dist/transfers/sources.js +83 -0
- package/dist/transfers/sources.js.map +1 -0
- package/dist/transfers/upload.js +235 -0
- package/dist/transfers/upload.js.map +1 -0
- package/dist/transfers.d.ts +31 -0
- package/dist/transfers.js +82 -0
- package/dist/transfers.js.map +1 -0
- package/dist/uploads/driver.d.ts +22 -0
- package/dist/uploads/driver.js +18 -0
- package/dist/uploads/driver.js.map +1 -0
- package/dist/uploads/policy.d.ts +39 -0
- package/dist/uploads/schema.d.ts +278 -0
- package/dist/uploads/schema.js +167 -0
- package/dist/uploads/schema.js.map +1 -0
- package/dist/uploads/signed-driver.d.ts +8 -0
- package/dist/uploads/signed-driver.js +36 -0
- package/dist/uploads/signed-driver.js.map +1 -0
- package/dist/uploads/store.d.ts +26 -0
- package/dist/uploads/store.js +51 -0
- package/dist/uploads/store.js.map +1 -0
- package/dist/uploads/verification.js +86 -0
- package/dist/uploads/verification.js.map +1 -0
- package/dist/uploads.d.ts +518 -0
- package/dist/uploads.js +330 -0
- package/dist/uploads.js.map +1 -0
- package/dist/vercel/authorized-uploads.d.ts +7 -0
- package/dist/vercel/authorized-uploads.js +15 -0
- package/dist/vercel/authorized-uploads.js.map +1 -0
- package/dist/vercel/client.d.ts +16 -0
- package/dist/vercel/client.js +28 -0
- package/dist/vercel/client.js.map +1 -0
- package/dist/vercel/signing.d.ts +19 -0
- package/dist/vercel/signing.js +120 -0
- package/dist/vercel/signing.js.map +1 -0
- package/dist/vercel/uploads.d.ts +36 -0
- package/dist/vercel/uploads.js +161 -0
- package/dist/vercel/uploads.js.map +1 -0
- package/dist/vercel.d.ts +86 -0
- package/dist/vercel.js +46 -0
- package/dist/vercel.js.map +1 -0
- package/dist/wasabi/admin.d.ts +112 -0
- package/dist/wasabi/admin.js +19 -0
- package/dist/wasabi/admin.js.map +1 -0
- package/dist/wasabi/native.d.ts +200 -0
- package/dist/wasabi/native.js +132 -0
- package/dist/wasabi/native.js.map +1 -0
- package/dist/wasabi.d.ts +15 -0
- package/dist/wasabi.js +15 -0
- package/dist/wasabi.js.map +1 -0
- package/dist/workflows/content/collection.js +122 -0
- package/dist/workflows/content/collection.js.map +1 -0
- package/dist/workflows/content/references.js +113 -0
- package/dist/workflows/content/references.js.map +1 -0
- package/dist/workflows/content/schema.d.ts +58 -0
- package/dist/workflows/content/schema.js +64 -0
- package/dist/workflows/content/schema.js.map +1 -0
- package/dist/workflows/endpoint.js +16 -0
- package/dist/workflows/endpoint.js.map +1 -0
- package/dist/workflows/migrations/schema.d.ts +149 -0
- package/dist/workflows/migrations/schema.js +58 -0
- package/dist/workflows/migrations/schema.js.map +1 -0
- package/dist/workflows/mirror/operations.js +175 -0
- package/dist/workflows/mirror/operations.js.map +1 -0
- package/dist/workflows/mirror/schema.d.ts +68 -0
- package/dist/workflows/mirror/schema.js +57 -0
- package/dist/workflows/mirror/schema.js.map +1 -0
- package/dist/workflows/mirror/view.js +103 -0
- package/dist/workflows/mirror/view.js.map +1 -0
- package/dist/workflows/objects.js +54 -0
- package/dist/workflows/objects.js.map +1 -0
- package/dist/workflows/store.d.ts +13 -0
- package/dist/workflows/store.js +58 -0
- package/dist/workflows/store.js.map +1 -0
- package/package.json +513 -3
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { ObjectMetadata } from "../core/object.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const SessionId: Schema.String;
|
|
4
|
+
export declare const UploadCheckpoint: Schema.Struct<{
|
|
5
|
+
readonly version: Schema.Literal<1>;
|
|
6
|
+
readonly id: Schema.String;
|
|
7
|
+
readonly namespace: Schema.String;
|
|
8
|
+
readonly revision: Schema.Natural;
|
|
9
|
+
readonly configurationId: Schema.String;
|
|
10
|
+
readonly provider: Schema.String;
|
|
11
|
+
readonly storeId: Schema.String;
|
|
12
|
+
readonly createdAt: Schema.Number;
|
|
13
|
+
readonly updatedAt: Schema.Number;
|
|
14
|
+
readonly expiresAt: Schema.Number;
|
|
15
|
+
readonly kind: Schema.Literal<"upload">;
|
|
16
|
+
readonly operationId: Schema.String;
|
|
17
|
+
readonly state: Schema.Literals<readonly ["created", "initiating", "uploading", "completing", "completion-unknown", "verifying", "completed", "aborting", "cleanup-pending", "aborted"]>;
|
|
18
|
+
readonly key: Schema.NonEmptyString;
|
|
19
|
+
readonly headers: Schema.Struct<{
|
|
20
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
21
|
+
readonly contentEncoding: Schema.optional<Schema.String>;
|
|
22
|
+
readonly contentLanguage: Schema.optional<Schema.String>;
|
|
23
|
+
readonly contentDisposition: Schema.optional<Schema.String>;
|
|
24
|
+
readonly cacheControl: Schema.optional<Schema.String>;
|
|
25
|
+
readonly customMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
26
|
+
}>;
|
|
27
|
+
readonly condition: Schema.optional<Schema.Union<readonly [Schema.TaggedStruct<"CreateOnly", {}>, Schema.TaggedStruct<"IfMatch", {
|
|
28
|
+
readonly etag: Schema.String;
|
|
29
|
+
}>]>>;
|
|
30
|
+
readonly length: Schema.Natural;
|
|
31
|
+
readonly checksum: Schema.Struct<{
|
|
32
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
33
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
34
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
35
|
+
readonly value: Schema.NonEmptyString;
|
|
36
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
37
|
+
}>;
|
|
38
|
+
readonly partBytes: Schema.Natural;
|
|
39
|
+
readonly protocol: Schema.optional<Schema.Literals<readonly ["offset", "blocks"]>>;
|
|
40
|
+
readonly offset: Schema.optional<Schema.Natural>;
|
|
41
|
+
readonly blocks: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
42
|
+
readonly blockId: Schema.String;
|
|
43
|
+
readonly size: Schema.Natural;
|
|
44
|
+
readonly sourceChecksum: Schema.Struct<{
|
|
45
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
46
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
47
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
48
|
+
readonly value: Schema.NonEmptyString;
|
|
49
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
50
|
+
}>;
|
|
51
|
+
}>>>;
|
|
52
|
+
readonly handle: Schema.optional<Schema.Redacted<Schema.String>>;
|
|
53
|
+
readonly parts: Schema.$Array<Schema.Struct<{
|
|
54
|
+
readonly sourceChecksum: Schema.Struct<{
|
|
55
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
56
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
57
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
58
|
+
readonly value: Schema.NonEmptyString;
|
|
59
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
60
|
+
}>;
|
|
61
|
+
readonly partNumber: Schema.Natural;
|
|
62
|
+
readonly etag: Schema.String;
|
|
63
|
+
readonly size: Schema.Natural;
|
|
64
|
+
readonly checksums: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
65
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
66
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
67
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
68
|
+
readonly value: Schema.NonEmptyString;
|
|
69
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
70
|
+
}>>>;
|
|
71
|
+
}>>;
|
|
72
|
+
readonly metadata: Schema.optional<Schema.Struct<{
|
|
73
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
74
|
+
readonly contentEncoding: Schema.optional<Schema.String>;
|
|
75
|
+
readonly contentLanguage: Schema.optional<Schema.String>;
|
|
76
|
+
readonly contentDisposition: Schema.optional<Schema.String>;
|
|
77
|
+
readonly cacheControl: Schema.optional<Schema.String>;
|
|
78
|
+
readonly customMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
79
|
+
readonly ref: Schema.Struct<{
|
|
80
|
+
readonly storeId: Schema.NonEmptyString;
|
|
81
|
+
readonly key: Schema.NonEmptyString;
|
|
82
|
+
readonly version: Schema.optional<Schema.Union<readonly [Schema.TaggedStruct<"S3Version", {
|
|
83
|
+
readonly id: Schema.NonEmptyString;
|
|
84
|
+
}>, Schema.TaggedStruct<"GcsGeneration", {
|
|
85
|
+
readonly id: Schema.NonEmptyString;
|
|
86
|
+
readonly metageneration: Schema.optional<Schema.NonEmptyString>;
|
|
87
|
+
}>, Schema.TaggedStruct<"AzureVersion", {
|
|
88
|
+
readonly id: Schema.NonEmptyString;
|
|
89
|
+
}>, Schema.TaggedStruct<"AzureSnapshot", {
|
|
90
|
+
readonly id: Schema.NonEmptyString;
|
|
91
|
+
}>, Schema.TaggedStruct<"OpaqueVersion", {
|
|
92
|
+
readonly provider: Schema.NonEmptyString;
|
|
93
|
+
readonly id: Schema.NonEmptyString;
|
|
94
|
+
}>]>>;
|
|
95
|
+
}>;
|
|
96
|
+
readonly size: Schema.optional<Schema.Natural>;
|
|
97
|
+
readonly etag: Schema.optional<Schema.String>;
|
|
98
|
+
readonly lastModified: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
99
|
+
readonly checksums: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
100
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
101
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
102
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
103
|
+
readonly value: Schema.NonEmptyString;
|
|
104
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
105
|
+
}>>>;
|
|
106
|
+
readonly storageClass: Schema.optional<Schema.NonEmptyString>;
|
|
107
|
+
}>>;
|
|
108
|
+
readonly attempts: Schema.Natural;
|
|
109
|
+
readonly events: Schema.$Array<Schema.Struct<{
|
|
110
|
+
readonly id: Schema.String;
|
|
111
|
+
readonly kind: Schema.Literals<readonly ["completed", "aborted"]>;
|
|
112
|
+
readonly delivered: Schema.Boolean;
|
|
113
|
+
}>>;
|
|
114
|
+
}>;
|
|
115
|
+
export type UploadCheckpoint = typeof UploadCheckpoint.Type;
|
|
116
|
+
export declare const DownloadCheckpoint: Schema.Struct<{
|
|
117
|
+
readonly version: Schema.Literal<1>;
|
|
118
|
+
readonly id: Schema.String;
|
|
119
|
+
readonly namespace: Schema.String;
|
|
120
|
+
readonly revision: Schema.Natural;
|
|
121
|
+
readonly configurationId: Schema.String;
|
|
122
|
+
readonly provider: Schema.String;
|
|
123
|
+
readonly storeId: Schema.String;
|
|
124
|
+
readonly createdAt: Schema.Number;
|
|
125
|
+
readonly updatedAt: Schema.Number;
|
|
126
|
+
readonly expiresAt: Schema.Number;
|
|
127
|
+
readonly kind: Schema.Literal<"download">;
|
|
128
|
+
readonly state: Schema.Literals<readonly ["downloading", "verified", "completed", "aborting", "aborted"]>;
|
|
129
|
+
readonly metadata: Schema.Struct<{
|
|
130
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
131
|
+
readonly contentEncoding: Schema.optional<Schema.String>;
|
|
132
|
+
readonly contentLanguage: Schema.optional<Schema.String>;
|
|
133
|
+
readonly contentDisposition: Schema.optional<Schema.String>;
|
|
134
|
+
readonly cacheControl: Schema.optional<Schema.String>;
|
|
135
|
+
readonly customMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
136
|
+
readonly ref: Schema.Struct<{
|
|
137
|
+
readonly storeId: Schema.NonEmptyString;
|
|
138
|
+
readonly key: Schema.NonEmptyString;
|
|
139
|
+
readonly version: Schema.optional<Schema.Union<readonly [Schema.TaggedStruct<"S3Version", {
|
|
140
|
+
readonly id: Schema.NonEmptyString;
|
|
141
|
+
}>, Schema.TaggedStruct<"GcsGeneration", {
|
|
142
|
+
readonly id: Schema.NonEmptyString;
|
|
143
|
+
readonly metageneration: Schema.optional<Schema.NonEmptyString>;
|
|
144
|
+
}>, Schema.TaggedStruct<"AzureVersion", {
|
|
145
|
+
readonly id: Schema.NonEmptyString;
|
|
146
|
+
}>, Schema.TaggedStruct<"AzureSnapshot", {
|
|
147
|
+
readonly id: Schema.NonEmptyString;
|
|
148
|
+
}>, Schema.TaggedStruct<"OpaqueVersion", {
|
|
149
|
+
readonly provider: Schema.NonEmptyString;
|
|
150
|
+
readonly id: Schema.NonEmptyString;
|
|
151
|
+
}>]>>;
|
|
152
|
+
}>;
|
|
153
|
+
readonly size: Schema.optional<Schema.Natural>;
|
|
154
|
+
readonly etag: Schema.optional<Schema.String>;
|
|
155
|
+
readonly lastModified: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
156
|
+
readonly checksums: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
157
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
158
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
159
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
160
|
+
readonly value: Schema.NonEmptyString;
|
|
161
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
162
|
+
}>>>;
|
|
163
|
+
readonly storageClass: Schema.optional<Schema.NonEmptyString>;
|
|
164
|
+
}>;
|
|
165
|
+
readonly length: Schema.Natural;
|
|
166
|
+
readonly expectedChecksum: Schema.optional<Schema.Struct<{
|
|
167
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
168
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
169
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
170
|
+
readonly value: Schema.NonEmptyString;
|
|
171
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
172
|
+
}>>;
|
|
173
|
+
readonly targetId: Schema.String;
|
|
174
|
+
readonly targetIdentity: Schema.optional<Schema.String>;
|
|
175
|
+
readonly offset: Schema.Natural;
|
|
176
|
+
readonly prefixChecksum: Schema.optional<Schema.Struct<{
|
|
177
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
178
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
179
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
180
|
+
readonly value: Schema.NonEmptyString;
|
|
181
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
182
|
+
}>>;
|
|
183
|
+
readonly checksum: Schema.optional<Schema.Struct<{
|
|
184
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
185
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
186
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
187
|
+
readonly value: Schema.NonEmptyString;
|
|
188
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
189
|
+
}>>;
|
|
190
|
+
}>;
|
|
191
|
+
export type DownloadCheckpoint = typeof DownloadCheckpoint.Type;
|
|
192
|
+
export declare const BatchCheckpoint: Schema.Struct<{
|
|
193
|
+
readonly version: Schema.Literal<1>;
|
|
194
|
+
readonly id: Schema.String;
|
|
195
|
+
readonly namespace: Schema.String;
|
|
196
|
+
readonly revision: Schema.Natural;
|
|
197
|
+
readonly configurationId: Schema.String;
|
|
198
|
+
readonly provider: Schema.String;
|
|
199
|
+
readonly storeId: Schema.String;
|
|
200
|
+
readonly createdAt: Schema.Number;
|
|
201
|
+
readonly updatedAt: Schema.Number;
|
|
202
|
+
readonly expiresAt: Schema.Number;
|
|
203
|
+
readonly kind: Schema.Literal<"batch">;
|
|
204
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
205
|
+
readonly sessionId: Schema.String;
|
|
206
|
+
readonly state: Schema.Literals<readonly ["pending", "completed", "failed", "unknown"]>;
|
|
207
|
+
}>>;
|
|
208
|
+
}>;
|
|
209
|
+
export type BatchCheckpoint = typeof BatchCheckpoint.Type;
|
|
210
|
+
export declare const SessionCheckpoint: Schema.Union<readonly [Schema.Struct<{
|
|
211
|
+
readonly version: Schema.Literal<1>;
|
|
212
|
+
readonly id: Schema.String;
|
|
213
|
+
readonly namespace: Schema.String;
|
|
214
|
+
readonly revision: Schema.Natural;
|
|
215
|
+
readonly configurationId: Schema.String;
|
|
216
|
+
readonly provider: Schema.String;
|
|
217
|
+
readonly storeId: Schema.String;
|
|
218
|
+
readonly createdAt: Schema.Number;
|
|
219
|
+
readonly updatedAt: Schema.Number;
|
|
220
|
+
readonly expiresAt: Schema.Number;
|
|
221
|
+
readonly kind: Schema.Literal<"upload">;
|
|
222
|
+
readonly operationId: Schema.String;
|
|
223
|
+
readonly state: Schema.Literals<readonly ["created", "initiating", "uploading", "completing", "completion-unknown", "verifying", "completed", "aborting", "cleanup-pending", "aborted"]>;
|
|
224
|
+
readonly key: Schema.NonEmptyString;
|
|
225
|
+
readonly headers: Schema.Struct<{
|
|
226
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
227
|
+
readonly contentEncoding: Schema.optional<Schema.String>;
|
|
228
|
+
readonly contentLanguage: Schema.optional<Schema.String>;
|
|
229
|
+
readonly contentDisposition: Schema.optional<Schema.String>;
|
|
230
|
+
readonly cacheControl: Schema.optional<Schema.String>;
|
|
231
|
+
readonly customMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
232
|
+
}>;
|
|
233
|
+
readonly condition: Schema.optional<Schema.Union<readonly [Schema.TaggedStruct<"CreateOnly", {}>, Schema.TaggedStruct<"IfMatch", {
|
|
234
|
+
readonly etag: Schema.String;
|
|
235
|
+
}>]>>;
|
|
236
|
+
readonly length: Schema.Natural;
|
|
237
|
+
readonly checksum: Schema.Struct<{
|
|
238
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
239
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
240
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
241
|
+
readonly value: Schema.NonEmptyString;
|
|
242
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
243
|
+
}>;
|
|
244
|
+
readonly partBytes: Schema.Natural;
|
|
245
|
+
readonly protocol: Schema.optional<Schema.Literals<readonly ["offset", "blocks"]>>;
|
|
246
|
+
readonly offset: Schema.optional<Schema.Natural>;
|
|
247
|
+
readonly blocks: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
248
|
+
readonly blockId: Schema.String;
|
|
249
|
+
readonly size: Schema.Natural;
|
|
250
|
+
readonly sourceChecksum: Schema.Struct<{
|
|
251
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
252
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
253
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
254
|
+
readonly value: Schema.NonEmptyString;
|
|
255
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
256
|
+
}>;
|
|
257
|
+
}>>>;
|
|
258
|
+
readonly handle: Schema.optional<Schema.Redacted<Schema.String>>;
|
|
259
|
+
readonly parts: Schema.$Array<Schema.Struct<{
|
|
260
|
+
readonly sourceChecksum: Schema.Struct<{
|
|
261
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
262
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
263
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
264
|
+
readonly value: Schema.NonEmptyString;
|
|
265
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
266
|
+
}>;
|
|
267
|
+
readonly partNumber: Schema.Natural;
|
|
268
|
+
readonly etag: Schema.String;
|
|
269
|
+
readonly size: Schema.Natural;
|
|
270
|
+
readonly checksums: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
271
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
272
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
273
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
274
|
+
readonly value: Schema.NonEmptyString;
|
|
275
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
276
|
+
}>>>;
|
|
277
|
+
}>>;
|
|
278
|
+
readonly metadata: Schema.optional<Schema.Struct<{
|
|
279
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
280
|
+
readonly contentEncoding: Schema.optional<Schema.String>;
|
|
281
|
+
readonly contentLanguage: Schema.optional<Schema.String>;
|
|
282
|
+
readonly contentDisposition: Schema.optional<Schema.String>;
|
|
283
|
+
readonly cacheControl: Schema.optional<Schema.String>;
|
|
284
|
+
readonly customMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
285
|
+
readonly ref: Schema.Struct<{
|
|
286
|
+
readonly storeId: Schema.NonEmptyString;
|
|
287
|
+
readonly key: Schema.NonEmptyString;
|
|
288
|
+
readonly version: Schema.optional<Schema.Union<readonly [Schema.TaggedStruct<"S3Version", {
|
|
289
|
+
readonly id: Schema.NonEmptyString;
|
|
290
|
+
}>, Schema.TaggedStruct<"GcsGeneration", {
|
|
291
|
+
readonly id: Schema.NonEmptyString;
|
|
292
|
+
readonly metageneration: Schema.optional<Schema.NonEmptyString>;
|
|
293
|
+
}>, Schema.TaggedStruct<"AzureVersion", {
|
|
294
|
+
readonly id: Schema.NonEmptyString;
|
|
295
|
+
}>, Schema.TaggedStruct<"AzureSnapshot", {
|
|
296
|
+
readonly id: Schema.NonEmptyString;
|
|
297
|
+
}>, Schema.TaggedStruct<"OpaqueVersion", {
|
|
298
|
+
readonly provider: Schema.NonEmptyString;
|
|
299
|
+
readonly id: Schema.NonEmptyString;
|
|
300
|
+
}>]>>;
|
|
301
|
+
}>;
|
|
302
|
+
readonly size: Schema.optional<Schema.Natural>;
|
|
303
|
+
readonly etag: Schema.optional<Schema.String>;
|
|
304
|
+
readonly lastModified: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
305
|
+
readonly checksums: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
306
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
307
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
308
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
309
|
+
readonly value: Schema.NonEmptyString;
|
|
310
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
311
|
+
}>>>;
|
|
312
|
+
readonly storageClass: Schema.optional<Schema.NonEmptyString>;
|
|
313
|
+
}>>;
|
|
314
|
+
readonly attempts: Schema.Natural;
|
|
315
|
+
readonly events: Schema.$Array<Schema.Struct<{
|
|
316
|
+
readonly id: Schema.String;
|
|
317
|
+
readonly kind: Schema.Literals<readonly ["completed", "aborted"]>;
|
|
318
|
+
readonly delivered: Schema.Boolean;
|
|
319
|
+
}>>;
|
|
320
|
+
}>, Schema.Struct<{
|
|
321
|
+
readonly version: Schema.Literal<1>;
|
|
322
|
+
readonly id: Schema.String;
|
|
323
|
+
readonly namespace: Schema.String;
|
|
324
|
+
readonly revision: Schema.Natural;
|
|
325
|
+
readonly configurationId: Schema.String;
|
|
326
|
+
readonly provider: Schema.String;
|
|
327
|
+
readonly storeId: Schema.String;
|
|
328
|
+
readonly createdAt: Schema.Number;
|
|
329
|
+
readonly updatedAt: Schema.Number;
|
|
330
|
+
readonly expiresAt: Schema.Number;
|
|
331
|
+
readonly kind: Schema.Literal<"download">;
|
|
332
|
+
readonly state: Schema.Literals<readonly ["downloading", "verified", "completed", "aborting", "aborted"]>;
|
|
333
|
+
readonly metadata: Schema.Struct<{
|
|
334
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
335
|
+
readonly contentEncoding: Schema.optional<Schema.String>;
|
|
336
|
+
readonly contentLanguage: Schema.optional<Schema.String>;
|
|
337
|
+
readonly contentDisposition: Schema.optional<Schema.String>;
|
|
338
|
+
readonly cacheControl: Schema.optional<Schema.String>;
|
|
339
|
+
readonly customMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
340
|
+
readonly ref: Schema.Struct<{
|
|
341
|
+
readonly storeId: Schema.NonEmptyString;
|
|
342
|
+
readonly key: Schema.NonEmptyString;
|
|
343
|
+
readonly version: Schema.optional<Schema.Union<readonly [Schema.TaggedStruct<"S3Version", {
|
|
344
|
+
readonly id: Schema.NonEmptyString;
|
|
345
|
+
}>, Schema.TaggedStruct<"GcsGeneration", {
|
|
346
|
+
readonly id: Schema.NonEmptyString;
|
|
347
|
+
readonly metageneration: Schema.optional<Schema.NonEmptyString>;
|
|
348
|
+
}>, Schema.TaggedStruct<"AzureVersion", {
|
|
349
|
+
readonly id: Schema.NonEmptyString;
|
|
350
|
+
}>, Schema.TaggedStruct<"AzureSnapshot", {
|
|
351
|
+
readonly id: Schema.NonEmptyString;
|
|
352
|
+
}>, Schema.TaggedStruct<"OpaqueVersion", {
|
|
353
|
+
readonly provider: Schema.NonEmptyString;
|
|
354
|
+
readonly id: Schema.NonEmptyString;
|
|
355
|
+
}>]>>;
|
|
356
|
+
}>;
|
|
357
|
+
readonly size: Schema.optional<Schema.Natural>;
|
|
358
|
+
readonly etag: Schema.optional<Schema.String>;
|
|
359
|
+
readonly lastModified: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
360
|
+
readonly checksums: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
361
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
362
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
363
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
364
|
+
readonly value: Schema.NonEmptyString;
|
|
365
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
366
|
+
}>>>;
|
|
367
|
+
readonly storageClass: Schema.optional<Schema.NonEmptyString>;
|
|
368
|
+
}>;
|
|
369
|
+
readonly length: Schema.Natural;
|
|
370
|
+
readonly expectedChecksum: Schema.optional<Schema.Struct<{
|
|
371
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
372
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
373
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
374
|
+
readonly value: Schema.NonEmptyString;
|
|
375
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
376
|
+
}>>;
|
|
377
|
+
readonly targetId: Schema.String;
|
|
378
|
+
readonly targetIdentity: Schema.optional<Schema.String>;
|
|
379
|
+
readonly offset: Schema.Natural;
|
|
380
|
+
readonly prefixChecksum: Schema.optional<Schema.Struct<{
|
|
381
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
382
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
383
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
384
|
+
readonly value: Schema.NonEmptyString;
|
|
385
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
386
|
+
}>>;
|
|
387
|
+
readonly checksum: Schema.optional<Schema.Struct<{
|
|
388
|
+
readonly algorithm: Schema.NonEmptyString;
|
|
389
|
+
readonly encoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
390
|
+
readonly scope: Schema.Literals<readonly ["full-object", "composite"]>;
|
|
391
|
+
readonly value: Schema.NonEmptyString;
|
|
392
|
+
readonly partCount: Schema.optional<Schema.Int>;
|
|
393
|
+
}>>;
|
|
394
|
+
}>, Schema.Struct<{
|
|
395
|
+
readonly version: Schema.Literal<1>;
|
|
396
|
+
readonly id: Schema.String;
|
|
397
|
+
readonly namespace: Schema.String;
|
|
398
|
+
readonly revision: Schema.Natural;
|
|
399
|
+
readonly configurationId: Schema.String;
|
|
400
|
+
readonly provider: Schema.String;
|
|
401
|
+
readonly storeId: Schema.String;
|
|
402
|
+
readonly createdAt: Schema.Number;
|
|
403
|
+
readonly updatedAt: Schema.Number;
|
|
404
|
+
readonly expiresAt: Schema.Number;
|
|
405
|
+
readonly kind: Schema.Literal<"batch">;
|
|
406
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
407
|
+
readonly sessionId: Schema.String;
|
|
408
|
+
readonly state: Schema.Literals<readonly ["pending", "completed", "failed", "unknown"]>;
|
|
409
|
+
}>>;
|
|
410
|
+
}>]>;
|
|
411
|
+
export type SessionCheckpoint = typeof SessionCheckpoint.Type;
|
|
412
|
+
/** Intentionally excludes provider handles, headers and source material. */
|
|
413
|
+
export interface SessionStatus {
|
|
414
|
+
readonly id: string;
|
|
415
|
+
readonly kind: SessionCheckpoint["kind"];
|
|
416
|
+
readonly state: string;
|
|
417
|
+
readonly revision: number;
|
|
418
|
+
readonly expired: boolean;
|
|
419
|
+
readonly completedParts?: number;
|
|
420
|
+
readonly offset?: number;
|
|
421
|
+
readonly metadata?: ObjectMetadata | undefined;
|
|
422
|
+
}
|
|
423
|
+
//# sourceMappingURL=checkpoint.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Checksum, ObjectHeaders, ObjectKey, ObjectMetadata, ObjectSize } from "../core/object.js";
|
|
2
|
+
import { WriteCondition } from "../core/requests.js";
|
|
3
|
+
import { SavedBlock } from "../transfers/native-upload.js";
|
|
4
|
+
import { Schema } from "effect";
|
|
5
|
+
|
|
6
|
+
// src/sessions/checkpoint.ts
|
|
7
|
+
const SessionId = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_-]{1,100}$/u));
|
|
8
|
+
const Event = Schema.Struct({
|
|
9
|
+
id: Schema.String,
|
|
10
|
+
kind: Schema.Literals(["completed", "aborted"]),
|
|
11
|
+
delivered: Schema.Boolean
|
|
12
|
+
});
|
|
13
|
+
const Base = {
|
|
14
|
+
version: Schema.Literal(1),
|
|
15
|
+
id: SessionId,
|
|
16
|
+
namespace: Schema.String,
|
|
17
|
+
revision: Schema.Natural,
|
|
18
|
+
configurationId: Schema.String,
|
|
19
|
+
provider: Schema.String,
|
|
20
|
+
storeId: Schema.String,
|
|
21
|
+
createdAt: Schema.Number,
|
|
22
|
+
updatedAt: Schema.Number,
|
|
23
|
+
expiresAt: Schema.Number
|
|
24
|
+
};
|
|
25
|
+
const SavedPart = Schema.Struct({
|
|
26
|
+
sourceChecksum: Checksum,
|
|
27
|
+
partNumber: Schema.Natural,
|
|
28
|
+
etag: Schema.String,
|
|
29
|
+
size: ObjectSize,
|
|
30
|
+
checksums: Schema.optional(Schema.Array(Checksum))
|
|
31
|
+
});
|
|
32
|
+
const UploadCheckpoint = Schema.Struct({
|
|
33
|
+
...Base,
|
|
34
|
+
kind: Schema.Literal("upload"),
|
|
35
|
+
operationId: Schema.String,
|
|
36
|
+
state: Schema.Literals([
|
|
37
|
+
"created",
|
|
38
|
+
"initiating",
|
|
39
|
+
"uploading",
|
|
40
|
+
"completing",
|
|
41
|
+
"completion-unknown",
|
|
42
|
+
"verifying",
|
|
43
|
+
"completed",
|
|
44
|
+
"aborting",
|
|
45
|
+
"cleanup-pending",
|
|
46
|
+
"aborted"
|
|
47
|
+
]),
|
|
48
|
+
key: ObjectKey,
|
|
49
|
+
headers: ObjectHeaders,
|
|
50
|
+
condition: Schema.optional(WriteCondition),
|
|
51
|
+
length: ObjectSize,
|
|
52
|
+
checksum: Checksum,
|
|
53
|
+
partBytes: ObjectSize,
|
|
54
|
+
protocol: Schema.optional(Schema.Literals(["offset", "blocks"])),
|
|
55
|
+
offset: Schema.optional(ObjectSize),
|
|
56
|
+
blocks: Schema.optional(Schema.Array(SavedBlock)),
|
|
57
|
+
handle: Schema.optional(Schema.Redacted(Schema.String)),
|
|
58
|
+
parts: Schema.Array(SavedPart),
|
|
59
|
+
metadata: Schema.optional(ObjectMetadata),
|
|
60
|
+
attempts: Schema.Natural,
|
|
61
|
+
events: Schema.Array(Event)
|
|
62
|
+
});
|
|
63
|
+
const DownloadCheckpoint = Schema.Struct({
|
|
64
|
+
...Base,
|
|
65
|
+
kind: Schema.Literal("download"),
|
|
66
|
+
state: Schema.Literals([
|
|
67
|
+
"downloading",
|
|
68
|
+
"verified",
|
|
69
|
+
"completed",
|
|
70
|
+
"aborting",
|
|
71
|
+
"aborted"
|
|
72
|
+
]),
|
|
73
|
+
metadata: ObjectMetadata,
|
|
74
|
+
length: ObjectSize,
|
|
75
|
+
expectedChecksum: Schema.optional(Checksum),
|
|
76
|
+
targetId: Schema.String,
|
|
77
|
+
targetIdentity: Schema.optional(Schema.String),
|
|
78
|
+
offset: ObjectSize,
|
|
79
|
+
prefixChecksum: Schema.optional(Checksum),
|
|
80
|
+
checksum: Schema.optional(Checksum)
|
|
81
|
+
});
|
|
82
|
+
const BatchCheckpoint = Schema.Struct({
|
|
83
|
+
...Base,
|
|
84
|
+
kind: Schema.Literal("batch"),
|
|
85
|
+
entries: Schema.Array(Schema.Struct({
|
|
86
|
+
sessionId: SessionId,
|
|
87
|
+
state: Schema.Literals([
|
|
88
|
+
"pending",
|
|
89
|
+
"completed",
|
|
90
|
+
"failed",
|
|
91
|
+
"unknown"
|
|
92
|
+
])
|
|
93
|
+
}))
|
|
94
|
+
});
|
|
95
|
+
const SessionCheckpoint = Schema.Union([
|
|
96
|
+
UploadCheckpoint,
|
|
97
|
+
DownloadCheckpoint,
|
|
98
|
+
BatchCheckpoint
|
|
99
|
+
]);
|
|
100
|
+
|
|
101
|
+
export { BatchCheckpoint, DownloadCheckpoint, SavedPart, SessionCheckpoint, SessionId, UploadCheckpoint };
|
|
102
|
+
//# sourceMappingURL=checkpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint.js","names":[],"sources":["../../src/sessions/checkpoint.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport { Checksum, ObjectHeaders, ObjectKey, ObjectMetadata, ObjectSize } from \"../core/object.js\";\nimport { WriteCondition } from \"../core/requests.js\";\nimport { SavedBlock } from \"../transfers/native-upload.js\";\n\nexport const SessionId = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_-]{1,100}$/u));\nconst Event = Schema.Struct({\n id: Schema.String,\n kind: Schema.Literals([\"completed\", \"aborted\"]),\n delivered: Schema.Boolean,\n});\nconst Base = {\n version: Schema.Literal(1),\n id: SessionId,\n namespace: Schema.String,\n revision: Schema.Natural,\n configurationId: Schema.String,\n provider: Schema.String,\n storeId: Schema.String,\n createdAt: Schema.Number,\n updatedAt: Schema.Number,\n expiresAt: Schema.Number,\n};\nexport const SavedPart = Schema.Struct({\n sourceChecksum: Checksum,\n partNumber: Schema.Natural,\n etag: Schema.String,\n size: ObjectSize,\n checksums: Schema.optional(Schema.Array(Checksum)),\n});\nexport const UploadCheckpoint = Schema.Struct({\n ...Base,\n kind: Schema.Literal(\"upload\"),\n operationId: Schema.String,\n state: Schema.Literals([\n \"created\",\n \"initiating\",\n \"uploading\",\n \"completing\",\n \"completion-unknown\",\n \"verifying\",\n \"completed\",\n \"aborting\",\n \"cleanup-pending\",\n \"aborted\",\n ]),\n key: ObjectKey,\n headers: ObjectHeaders,\n condition: Schema.optional(WriteCondition),\n length: ObjectSize,\n checksum: Checksum,\n partBytes: ObjectSize,\n protocol: Schema.optional(Schema.Literals([\"offset\", \"blocks\"])),\n offset: Schema.optional(ObjectSize),\n blocks: Schema.optional(Schema.Array(SavedBlock)),\n handle: Schema.optional(Schema.Redacted(Schema.String)),\n parts: Schema.Array(SavedPart),\n metadata: Schema.optional(ObjectMetadata),\n attempts: Schema.Natural,\n events: Schema.Array(Event),\n});\nexport type UploadCheckpoint = typeof UploadCheckpoint.Type;\nexport const DownloadCheckpoint = Schema.Struct({\n ...Base,\n kind: Schema.Literal(\"download\"),\n state: Schema.Literals([\"downloading\", \"verified\", \"completed\", \"aborting\", \"aborted\"]),\n metadata: ObjectMetadata,\n length: ObjectSize,\n expectedChecksum: Schema.optional(Checksum),\n targetId: Schema.String,\n targetIdentity: Schema.optional(Schema.String),\n offset: ObjectSize,\n prefixChecksum: Schema.optional(Checksum),\n checksum: Schema.optional(Checksum),\n});\nexport type DownloadCheckpoint = typeof DownloadCheckpoint.Type;\nexport const BatchCheckpoint = Schema.Struct({\n ...Base,\n kind: Schema.Literal(\"batch\"),\n entries: Schema.Array(\n Schema.Struct({\n sessionId: SessionId,\n state: Schema.Literals([\"pending\", \"completed\", \"failed\", \"unknown\"]),\n }),\n ),\n});\nexport type BatchCheckpoint = typeof BatchCheckpoint.Type;\nexport const SessionCheckpoint = Schema.Union([\n UploadCheckpoint,\n DownloadCheckpoint,\n BatchCheckpoint,\n]);\nexport type SessionCheckpoint = typeof SessionCheckpoint.Type;\n\n/** Intentionally excludes provider handles, headers and source material. */\nexport interface SessionStatus {\n readonly id: string;\n readonly kind: SessionCheckpoint[\"kind\"];\n readonly state: string;\n readonly revision: number;\n readonly expired: boolean;\n readonly completedParts?: number;\n readonly offset?: number;\n readonly metadata?: ObjectMetadata | undefined;\n}\n"],"mappings":";;;;;;AAMA,MAAa,YAAY,OAAO,OAAO,MAAM,OAAO,UAAU,yBAAyB,CAAC;AACxF,MAAM,QAAQ,OAAO,OAAO;CAC1B,IAAI,OAAO;CACX,MAAM,OAAO,SAAS,CAAC,aAAa,SAAS,CAAC;CAC9C,WAAW,OAAO;AACpB,CAAC;AACD,MAAM,OAAO;CACX,SAAS,OAAO,QAAQ,CAAC;CACzB,IAAI;CACJ,WAAW,OAAO;CAClB,UAAU,OAAO;CACjB,iBAAiB,OAAO;CACxB,UAAU,OAAO;CACjB,SAAS,OAAO;CAChB,WAAW,OAAO;CAClB,WAAW,OAAO;CAClB,WAAW,OAAO;AACpB;AACA,MAAa,YAAY,OAAO,OAAO;CACrC,gBAAgB;CAChB,YAAY,OAAO;CACnB,MAAM,OAAO;CACb,MAAM;CACN,WAAW,OAAO,SAAS,OAAO,MAAM,QAAQ,CAAC;AACnD,CAAC;AACD,MAAa,mBAAmB,OAAO,OAAO;CAC5C,GAAG;CACH,MAAM,OAAO,QAAQ,QAAQ;CAC7B,aAAa,OAAO;CACpB,OAAO,OAAO,SAAS;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,KAAK;CACL,SAAS;CACT,WAAW,OAAO,SAAS,cAAc;CACzC,QAAQ;CACR,UAAU;CACV,WAAW;CACX,UAAU,OAAO,SAAS,OAAO,SAAS,CAAC,UAAU,QAAQ,CAAC,CAAC;CAC/D,QAAQ,OAAO,SAAS,UAAU;CAClC,QAAQ,OAAO,SAAS,OAAO,MAAM,UAAU,CAAC;CAChD,QAAQ,OAAO,SAAS,OAAO,SAAS,OAAO,MAAM,CAAC;CACtD,OAAO,OAAO,MAAM,SAAS;CAC7B,UAAU,OAAO,SAAS,cAAc;CACxC,UAAU,OAAO;CACjB,QAAQ,OAAO,MAAM,KAAK;AAC5B,CAAC;AAED,MAAa,qBAAqB,OAAO,OAAO;CAC9C,GAAG;CACH,MAAM,OAAO,QAAQ,UAAU;CAC/B,OAAO,OAAO,SAAS;EAAC;EAAe;EAAY;EAAa;EAAY;CAAS,CAAC;CACtF,UAAU;CACV,QAAQ;CACR,kBAAkB,OAAO,SAAS,QAAQ;CAC1C,UAAU,OAAO;CACjB,gBAAgB,OAAO,SAAS,OAAO,MAAM;CAC7C,QAAQ;CACR,gBAAgB,OAAO,SAAS,QAAQ;CACxC,UAAU,OAAO,SAAS,QAAQ;AACpC,CAAC;AAED,MAAa,kBAAkB,OAAO,OAAO;CAC3C,GAAG;CACH,MAAM,OAAO,QAAQ,OAAO;CAC5B,SAAS,OAAO,MACd,OAAO,OAAO;EACZ,WAAW;EACX,OAAO,OAAO,SAAS;GAAC;GAAW;GAAa;GAAU;EAAS,CAAC;CACtE,CAAC,CACH;AACF,CAAC;AAED,MAAa,oBAAoB,OAAO,MAAM;CAC5C;CACA;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Checksum } from "../core/object.js";
|
|
2
|
+
import "../core/errors.js";
|
|
3
|
+
import "./upload.js";
|
|
4
|
+
import { Effect, Stream } from "effect";
|
|
5
|
+
export interface RestartableDownloadTarget<E = never, R = never> {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly identity?: string;
|
|
8
|
+
readonly discard?: () => Effect.Effect<void, E, R>;
|
|
9
|
+
readonly prefix: (length: number) => Stream.Stream<Uint8Array, E, R>;
|
|
10
|
+
/** Discard uncheckpointed tail bytes; never extend a short existing prefix. */
|
|
11
|
+
readonly truncate: (length: number) => Effect.Effect<void, E, R>;
|
|
12
|
+
readonly write: (offset: number, bytes: Uint8Array) => Effect.Effect<void, E, R>;
|
|
13
|
+
readonly sync: Effect.Effect<void, E, R>;
|
|
14
|
+
/** Must verify or idempotently recognize a prior publication of these exact bytes. */
|
|
15
|
+
readonly publish: (checksum: Checksum, length: number) => Effect.Effect<void, E, R>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=download.d.ts.map
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { StorageError } from "../core/errors.js";
|
|
2
|
+
import { sameChecksum } from "../transfers/reader.js";
|
|
3
|
+
import { pinnedRequest } from "../transfers/download.js";
|
|
4
|
+
import { sessionError } from "./store.js";
|
|
5
|
+
import { Effect, Stream } from "effect";
|
|
6
|
+
|
|
7
|
+
// src/sessions/download.ts
|
|
8
|
+
const runDownload = Effect.fnUntraced(function* (environment, original, target) {
|
|
9
|
+
const { runtime, store } = environment;
|
|
10
|
+
if (target.id !== original.targetId || target.id !== original.id) return yield* sessionError("ForeignDownloadTarget");
|
|
11
|
+
let checkpoint = original;
|
|
12
|
+
const operation = yield* runtime.begin("download", checkpoint.length);
|
|
13
|
+
const workspace = runtime.policy.maxSourceChunkBytes * 2 + runtime.input.digest.workspaceBytes * 2 + runtime.endpoint.transportOverheadBytes;
|
|
14
|
+
if (workspace > runtime.policy.memoryBudgetBytes) return yield* sessionError("DownloadWorkspaceLimit");
|
|
15
|
+
const save = Effect.fnUntraced(function* (next) {
|
|
16
|
+
const saved = yield* store.write(next, checkpoint.revision);
|
|
17
|
+
if (saved.kind !== "download") return yield* sessionError("InvalidCheckpoint");
|
|
18
|
+
checkpoint = saved;
|
|
19
|
+
});
|
|
20
|
+
const work = runtime.lease(workspace, Effect.scoped(Effect.gen(function* () {
|
|
21
|
+
const identity = target.identity ?? target.id;
|
|
22
|
+
if (checkpoint.targetIdentity && checkpoint.targetIdentity !== identity) return yield* sessionError("ChangedDownloadTarget");
|
|
23
|
+
if (!checkpoint.targetIdentity) yield* save({
|
|
24
|
+
...checkpoint,
|
|
25
|
+
targetIdentity: identity
|
|
26
|
+
});
|
|
27
|
+
if (["aborting", "aborted"].includes(checkpoint.state)) return yield* sessionError("SessionAborting");
|
|
28
|
+
if (checkpoint.state === "completed") return checkpoint.metadata;
|
|
29
|
+
if (checkpoint.state === "verified") {
|
|
30
|
+
if (!checkpoint.checksum) return yield* sessionError("MissingVerifiedDigest");
|
|
31
|
+
operation.mutationStarted = true;
|
|
32
|
+
yield* target.publish(checkpoint.checksum, checkpoint.length);
|
|
33
|
+
operation.committed = true;
|
|
34
|
+
yield* save({
|
|
35
|
+
...checkpoint,
|
|
36
|
+
state: "completed"
|
|
37
|
+
});
|
|
38
|
+
return checkpoint.metadata;
|
|
39
|
+
}
|
|
40
|
+
const pin = pinnedRequest(runtime.endpoint, checkpoint.metadata);
|
|
41
|
+
if (!pin) return yield* sessionError("PinnedDownloadRequired");
|
|
42
|
+
if (checkpoint.offset === checkpoint.length && checkpoint.offset > 0) yield* save({
|
|
43
|
+
...checkpoint,
|
|
44
|
+
offset: 0,
|
|
45
|
+
prefixChecksum: void 0
|
|
46
|
+
});
|
|
47
|
+
yield* target.truncate(checkpoint.offset);
|
|
48
|
+
const hash = runtime.input.digest.create();
|
|
49
|
+
const prefixHash = runtime.input.digest.create();
|
|
50
|
+
const snapshot = hash.snapshot?.bind(hash);
|
|
51
|
+
if (!snapshot) return yield* sessionError("DigestSnapshotRequired");
|
|
52
|
+
let prefixBytes = 0;
|
|
53
|
+
yield* Stream.runForEach(target.prefix(checkpoint.offset), (chunk) => Effect.gen(function* () {
|
|
54
|
+
if (chunk.buffer.byteLength > runtime.policy.maxSourceChunkBytes || prefixBytes + chunk.length > checkpoint.offset) return yield* sessionError("InvalidDownloadPrefix");
|
|
55
|
+
hash.update(chunk);
|
|
56
|
+
prefixHash.update(chunk);
|
|
57
|
+
prefixBytes += chunk.length;
|
|
58
|
+
}));
|
|
59
|
+
if (prefixBytes !== checkpoint.offset || checkpoint.offset > 0 && (!checkpoint.prefixChecksum || !sameChecksum(prefixHash.finish(), checkpoint.prefixChecksum))) return yield* sessionError("ChangedDownloadPrefix");
|
|
60
|
+
const start = checkpoint.offset;
|
|
61
|
+
yield* operation.request(Effect.scoped(Effect.gen(function* () {
|
|
62
|
+
const response = yield* runtime.endpoint.storage.get({
|
|
63
|
+
...pin,
|
|
64
|
+
...start > 0 ? { range: {
|
|
65
|
+
_tag: "From",
|
|
66
|
+
start
|
|
67
|
+
} } : {}
|
|
68
|
+
});
|
|
69
|
+
if (response._tag !== "Object" || checkpoint.metadata.etag && checkpoint.metadata.etag !== response.metadata.etag) return yield* sessionError("ChangedDownloadSource");
|
|
70
|
+
if (start > 0 && (response.range?.start !== start || response.range.totalSize !== checkpoint.length)) return yield* sessionError("InvalidDownloadRange");
|
|
71
|
+
yield* Stream.runForEach(response.body, (chunk) => Effect.gen(function* () {
|
|
72
|
+
if (chunk.buffer.byteLength > runtime.policy.maxSourceChunkBytes || checkpoint.offset + chunk.length > checkpoint.length) return yield* sessionError("DownloadLengthMismatch");
|
|
73
|
+
hash.update(chunk);
|
|
74
|
+
yield* target.write(checkpoint.offset, chunk);
|
|
75
|
+
yield* target.sync;
|
|
76
|
+
yield* save({
|
|
77
|
+
...checkpoint,
|
|
78
|
+
offset: checkpoint.offset + chunk.length,
|
|
79
|
+
prefixChecksum: snapshot()
|
|
80
|
+
});
|
|
81
|
+
}));
|
|
82
|
+
if (checkpoint.offset !== checkpoint.length || response.contentLength !== void 0 && response.contentLength !== checkpoint.offset - start) return yield* sessionError("DownloadLengthMismatch");
|
|
83
|
+
})));
|
|
84
|
+
const checksum = hash.finish();
|
|
85
|
+
const expected = checkpoint.expectedChecksum ?? checkpoint.metadata.checksums?.find((candidate) => candidate.scope === "full-object" && candidate.algorithm === checksum.algorithm);
|
|
86
|
+
if (expected && !sameChecksum(checksum, expected)) return yield* sessionError("DownloadChecksumMismatch");
|
|
87
|
+
yield* save({
|
|
88
|
+
...checkpoint,
|
|
89
|
+
state: "verified",
|
|
90
|
+
checksum
|
|
91
|
+
});
|
|
92
|
+
operation.mutationStarted = true;
|
|
93
|
+
yield* target.publish(checksum, checkpoint.length);
|
|
94
|
+
operation.committed = true;
|
|
95
|
+
yield* save({
|
|
96
|
+
...checkpoint,
|
|
97
|
+
state: "completed"
|
|
98
|
+
});
|
|
99
|
+
return checkpoint.metadata;
|
|
100
|
+
})));
|
|
101
|
+
return yield* runtime.deadline(operation, work).pipe(Effect.mapError((error) => error instanceof StorageError && operation.mutationStarted && error.mutationOutcome !== "rejected" ? new StorageError({
|
|
102
|
+
operation: error.operation,
|
|
103
|
+
provider: error.provider,
|
|
104
|
+
reason: error.reason,
|
|
105
|
+
requestId: error.requestId,
|
|
106
|
+
mutationOutcome: operation.committed ? "succeeded" : "unknown"
|
|
107
|
+
}) : error));
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export { runDownload };
|
|
111
|
+
//# sourceMappingURL=download.js.map
|