@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,107 @@
|
|
|
1
|
+
import { bytesEqual, check, expectReason, read } from "./assertions.js";
|
|
2
|
+
import { Effect, Result, Stream } from "effect";
|
|
3
|
+
|
|
4
|
+
// src/testing/conformance/core-cases.ts
|
|
5
|
+
const coreCases = [
|
|
6
|
+
{
|
|
7
|
+
name: "binary-empty-and-metadata",
|
|
8
|
+
run: (storage) => Effect.gen(function* () {
|
|
9
|
+
const expected = new Uint8Array([
|
|
10
|
+
0,
|
|
11
|
+
255,
|
|
12
|
+
13,
|
|
13
|
+
10
|
|
14
|
+
]);
|
|
15
|
+
const saved = yield* storage.put({
|
|
16
|
+
key: "binary",
|
|
17
|
+
body: expected,
|
|
18
|
+
contentType: "application/octet-stream",
|
|
19
|
+
customMetadata: { suite: "portable" }
|
|
20
|
+
});
|
|
21
|
+
const head = yield* storage.head({ key: "binary" });
|
|
22
|
+
yield* check(head.ref.storeId === storage.storeId && head.ref.key === "binary", "Incorrect namespace identity");
|
|
23
|
+
yield* check(head.contentType === "application/octet-stream" && head.customMetadata?.suite === "portable", "Metadata did not round-trip");
|
|
24
|
+
yield* check(saved.etag === void 0 || saved.etag === head.etag, "Write/head identity differs without a mutation");
|
|
25
|
+
yield* check(bytesEqual(yield* read(storage, "binary"), expected), "Binary bytes changed");
|
|
26
|
+
yield* storage.put({
|
|
27
|
+
key: "empty",
|
|
28
|
+
body: /* @__PURE__ */ new Uint8Array()
|
|
29
|
+
});
|
|
30
|
+
yield* check((yield* read(storage, "empty")).length === 0, "Empty object did not round-trip");
|
|
31
|
+
})
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "stream-and-overwrite",
|
|
35
|
+
run: (storage) => Effect.gen(function* () {
|
|
36
|
+
yield* storage.put({
|
|
37
|
+
key: "stream",
|
|
38
|
+
body: Stream.make(new Uint8Array([1]), new Uint8Array([2]))
|
|
39
|
+
});
|
|
40
|
+
yield* check(bytesEqual(yield* read(storage, "stream"), new Uint8Array([1, 2])), "Stream bytes changed");
|
|
41
|
+
yield* storage.put({
|
|
42
|
+
key: "stream",
|
|
43
|
+
body: new Uint8Array([3])
|
|
44
|
+
});
|
|
45
|
+
yield* check(bytesEqual(yield* read(storage, "stream"), new Uint8Array([3])), "Overwrite did not replace");
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "missing-and-idempotent-delete",
|
|
50
|
+
run: (storage) => Effect.gen(function* () {
|
|
51
|
+
yield* expectReason(storage.head({ key: "missing" }), "NotFound");
|
|
52
|
+
yield* expectReason(storage.get({ key: "missing" }), "NotFound");
|
|
53
|
+
yield* storage.delete({ key: "missing" });
|
|
54
|
+
yield* storage.put({
|
|
55
|
+
key: "remove",
|
|
56
|
+
body: new Uint8Array([1])
|
|
57
|
+
});
|
|
58
|
+
yield* storage.delete({ key: "remove" });
|
|
59
|
+
yield* storage.delete({ key: "remove" });
|
|
60
|
+
yield* expectReason(storage.head({ key: "remove" }), "NotFound");
|
|
61
|
+
})
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "atomic-create-only",
|
|
65
|
+
requires: (profile) => profile.putConditions.includes("create-only"),
|
|
66
|
+
run: (storage) => Effect.gen(function* () {
|
|
67
|
+
const results = yield* Effect.all([1, 2].map((byte) => Effect.result(storage.put({
|
|
68
|
+
key: "race",
|
|
69
|
+
body: new Uint8Array([byte]),
|
|
70
|
+
condition: { _tag: "CreateOnly" }
|
|
71
|
+
}))), { concurrency: 2 });
|
|
72
|
+
yield* check(results.filter(Result.isSuccess).length === 1, "Create-only did not have one winner");
|
|
73
|
+
const failed = results.find(Result.isFailure);
|
|
74
|
+
yield* check(failed?.failure.reason._tag === "PreconditionFailed", "Losing writer was not conditionally rejected");
|
|
75
|
+
})
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "stale-write-condition",
|
|
79
|
+
requires: (profile) => profile.putConditions.includes("if-match"),
|
|
80
|
+
run: (storage) => Effect.gen(function* () {
|
|
81
|
+
const first = yield* storage.put({
|
|
82
|
+
key: "match",
|
|
83
|
+
body: new Uint8Array([1])
|
|
84
|
+
});
|
|
85
|
+
yield* check(first.etag !== void 0, "Conditional adapter omitted its validator");
|
|
86
|
+
yield* expectReason(storage.put({
|
|
87
|
+
key: "match",
|
|
88
|
+
body: new Uint8Array([2]),
|
|
89
|
+
condition: {
|
|
90
|
+
_tag: "IfMatch",
|
|
91
|
+
etag: "\"deliberately-stale\""
|
|
92
|
+
}
|
|
93
|
+
}), "PreconditionFailed");
|
|
94
|
+
yield* check(bytesEqual(yield* read(storage, "match"), new Uint8Array([1])), "Rejected write changed bytes");
|
|
95
|
+
})
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "foreign-reference",
|
|
99
|
+
run: (storage) => expectReason(storage.head({ ref: {
|
|
100
|
+
storeId: `foreign:${storage.storeId}`,
|
|
101
|
+
key: "anything"
|
|
102
|
+
} }), "InvalidInput")
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
export { coreCases };
|
|
107
|
+
//# sourceMappingURL=core-cases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-cases.js","names":[],"sources":["../../../src/testing/conformance/core-cases.ts"],"sourcesContent":["import { Effect, Result, Stream } from \"effect\";\n\nimport type { StorageConformanceCase } from \"../conformance.js\";\nimport { bytesEqual, check, expectReason, read } from \"./assertions.js\";\n\nexport const coreCases: ReadonlyArray<StorageConformanceCase> = [\n {\n name: \"binary-empty-and-metadata\",\n run: (storage) =>\n Effect.gen(function* () {\n const expected = new Uint8Array([0, 255, 13, 10]);\n const saved = yield* storage.put({\n key: \"binary\",\n body: expected,\n contentType: \"application/octet-stream\",\n customMetadata: { suite: \"portable\" },\n });\n const head = yield* storage.head({ key: \"binary\" });\n yield* check(\n head.ref.storeId === storage.storeId && head.ref.key === \"binary\",\n \"Incorrect namespace identity\",\n );\n yield* check(\n head.contentType === \"application/octet-stream\" &&\n head.customMetadata?.suite === \"portable\",\n \"Metadata did not round-trip\",\n );\n yield* check(\n saved.etag === undefined || saved.etag === head.etag,\n \"Write/head identity differs without a mutation\",\n );\n yield* check(bytesEqual(yield* read(storage, \"binary\"), expected), \"Binary bytes changed\");\n yield* storage.put({ key: \"empty\", body: new Uint8Array() });\n yield* check(\n (yield* read(storage, \"empty\")).length === 0,\n \"Empty object did not round-trip\",\n );\n }),\n },\n {\n name: \"stream-and-overwrite\",\n run: (storage) =>\n Effect.gen(function* () {\n yield* storage.put({\n key: \"stream\",\n body: Stream.make(new Uint8Array([1]), new Uint8Array([2])),\n });\n yield* check(\n bytesEqual(yield* read(storage, \"stream\"), new Uint8Array([1, 2])),\n \"Stream bytes changed\",\n );\n yield* storage.put({ key: \"stream\", body: new Uint8Array([3]) });\n yield* check(\n bytesEqual(yield* read(storage, \"stream\"), new Uint8Array([3])),\n \"Overwrite did not replace\",\n );\n }),\n },\n {\n name: \"missing-and-idempotent-delete\",\n run: (storage) =>\n Effect.gen(function* () {\n yield* expectReason(storage.head({ key: \"missing\" }), \"NotFound\");\n yield* expectReason(storage.get({ key: \"missing\" }), \"NotFound\");\n yield* storage.delete({ key: \"missing\" });\n yield* storage.put({ key: \"remove\", body: new Uint8Array([1]) });\n yield* storage.delete({ key: \"remove\" });\n yield* storage.delete({ key: \"remove\" });\n yield* expectReason(storage.head({ key: \"remove\" }), \"NotFound\");\n }),\n },\n {\n name: \"atomic-create-only\",\n requires: (profile) => profile.putConditions.includes(\"create-only\"),\n run: (storage) =>\n Effect.gen(function* () {\n const results = yield* Effect.all(\n [1, 2].map((byte) =>\n Effect.result(\n storage.put({\n key: \"race\",\n body: new Uint8Array([byte]),\n condition: { _tag: \"CreateOnly\" },\n }),\n ),\n ),\n { concurrency: 2 },\n );\n yield* check(\n results.filter(Result.isSuccess).length === 1,\n \"Create-only did not have one winner\",\n );\n const failed = results.find(Result.isFailure);\n yield* check(\n failed?.failure.reason._tag === \"PreconditionFailed\",\n \"Losing writer was not conditionally rejected\",\n );\n }),\n },\n {\n name: \"stale-write-condition\",\n requires: (profile) => profile.putConditions.includes(\"if-match\"),\n run: (storage) =>\n Effect.gen(function* () {\n const first = yield* storage.put({ key: \"match\", body: new Uint8Array([1]) });\n yield* check(first.etag !== undefined, \"Conditional adapter omitted its validator\");\n yield* expectReason(\n storage.put({\n key: \"match\",\n body: new Uint8Array([2]),\n condition: { _tag: \"IfMatch\", etag: '\"deliberately-stale\"' },\n }),\n \"PreconditionFailed\",\n );\n yield* check(\n bytesEqual(yield* read(storage, \"match\"), new Uint8Array([1])),\n \"Rejected write changed bytes\",\n );\n }),\n },\n {\n name: \"foreign-reference\",\n run: (storage) =>\n expectReason(\n storage.head({\n ref: { storeId: `foreign:${storage.storeId}`, key: \"anything\" },\n }),\n \"InvalidInput\",\n ),\n },\n];\n"],"mappings":";;;;AAKA,MAAa,YAAmD;CAC9D;EACE,MAAM;EACN,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,MAAM,WAAW,IAAI,WAAW;IAAC;IAAG;IAAK;IAAI;GAAE,CAAC;GAChD,MAAM,QAAQ,OAAO,QAAQ,IAAI;IAC/B,KAAK;IACL,MAAM;IACN,aAAa;IACb,gBAAgB,EAAE,OAAO,WAAW;GACtC,CAAC;GACD,MAAM,OAAO,OAAO,QAAQ,KAAK,EAAE,KAAK,SAAS,CAAC;GAClD,OAAO,MACL,KAAK,IAAI,YAAY,QAAQ,WAAW,KAAK,IAAI,QAAQ,UACzD,8BACF;GACA,OAAO,MACL,KAAK,gBAAgB,8BACnB,KAAK,gBAAgB,UAAU,YACjC,6BACF;GACA,OAAO,MACL,MAAM,SAAS,UAAa,MAAM,SAAS,KAAK,MAChD,gDACF;GACA,OAAO,MAAM,WAAW,OAAO,KAAK,SAAS,QAAQ,GAAG,QAAQ,GAAG,sBAAsB;GACzF,OAAO,QAAQ,IAAI;IAAE,KAAK;IAAS,sBAAM,IAAI,WAAW;GAAE,CAAC;GAC3D,OAAO,OACJ,OAAO,KAAK,SAAS,OAAO,EAAC,CAAE,WAAW,GAC3C,iCACF;EACF,CAAC;CACL;CACA;EACE,MAAM;EACN,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,OAAO,QAAQ,IAAI;IACjB,KAAK;IACL,MAAM,OAAO,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;GAC5D,CAAC;GACD,OAAO,MACL,WAAW,OAAO,KAAK,SAAS,QAAQ,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,GACjE,sBACF;GACA,OAAO,QAAQ,IAAI;IAAE,KAAK;IAAU,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;GAAE,CAAC;GAC/D,OAAO,MACL,WAAW,OAAO,KAAK,SAAS,QAAQ,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,GAC9D,2BACF;EACF,CAAC;CACL;CACA;EACE,MAAM;EACN,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,OAAO,aAAa,QAAQ,KAAK,EAAE,KAAK,UAAU,CAAC,GAAG,UAAU;GAChE,OAAO,aAAa,QAAQ,IAAI,EAAE,KAAK,UAAU,CAAC,GAAG,UAAU;GAC/D,OAAO,QAAQ,OAAO,EAAE,KAAK,UAAU,CAAC;GACxC,OAAO,QAAQ,IAAI;IAAE,KAAK;IAAU,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;GAAE,CAAC;GAC/D,OAAO,QAAQ,OAAO,EAAE,KAAK,SAAS,CAAC;GACvC,OAAO,QAAQ,OAAO,EAAE,KAAK,SAAS,CAAC;GACvC,OAAO,aAAa,QAAQ,KAAK,EAAE,KAAK,SAAS,CAAC,GAAG,UAAU;EACjE,CAAC;CACL;CACA;EACE,MAAM;EACN,WAAW,YAAY,QAAQ,cAAc,SAAS,aAAa;EACnE,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,MAAM,UAAU,OAAO,OAAO,IAC5B,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,SACV,OAAO,OACL,QAAQ,IAAI;IACV,KAAK;IACL,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,aAAa;GAClC,CAAC,CACH,CACF,GACA,EAAE,aAAa,EAAE,CACnB;GACA,OAAO,MACL,QAAQ,OAAO,OAAO,SAAS,CAAC,CAAC,WAAW,GAC5C,qCACF;GACA,MAAM,SAAS,QAAQ,KAAK,OAAO,SAAS;GAC5C,OAAO,MACL,QAAQ,QAAQ,OAAO,SAAS,sBAChC,8CACF;EACF,CAAC;CACL;CACA;EACE,MAAM;EACN,WAAW,YAAY,QAAQ,cAAc,SAAS,UAAU;EAChE,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,MAAM,QAAQ,OAAO,QAAQ,IAAI;IAAE,KAAK;IAAS,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;GAAE,CAAC;GAC5E,OAAO,MAAM,MAAM,SAAS,QAAW,2CAA2C;GAClF,OAAO,aACL,QAAQ,IAAI;IACV,KAAK;IACL,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;IACxB,WAAW;KAAE,MAAM;KAAW,MAAM;IAAuB;GAC7D,CAAC,GACD,oBACF;GACA,OAAO,MACL,WAAW,OAAO,KAAK,SAAS,OAAO,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,GAC7D,8BACF;EACF,CAAC;CACL;CACA;EACE,MAAM;EACN,MAAM,YACJ,aACE,QAAQ,KAAK,EACX,KAAK;GAAE,SAAS,WAAW,QAAQ;GAAW,KAAK;EAAW,EAChE,CAAC,GACD,cACF;CACJ;AACF"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Storage } from "../../core/storage.js";
|
|
2
|
+
import { check, expectReason } from "./assertions.js";
|
|
3
|
+
import { Effect, Stream } from "effect";
|
|
4
|
+
|
|
5
|
+
// src/testing/conformance/list-cases.ts
|
|
6
|
+
const listCases = [
|
|
7
|
+
{
|
|
8
|
+
name: "paged-prefix-traversal",
|
|
9
|
+
run: (storage) => Effect.gen(function* () {
|
|
10
|
+
for (const key of [
|
|
11
|
+
"p/a",
|
|
12
|
+
"p/b",
|
|
13
|
+
"p/c",
|
|
14
|
+
"unrelated"
|
|
15
|
+
]) yield* storage.put({
|
|
16
|
+
key,
|
|
17
|
+
body: /* @__PURE__ */ new Uint8Array()
|
|
18
|
+
});
|
|
19
|
+
const keys = (yield* Stream.runCollect(Storage.list({
|
|
20
|
+
prefix: "p/",
|
|
21
|
+
limit: 1
|
|
22
|
+
}).pipe(Stream.provideService(Storage, storage)))).filter((entry) => entry._tag === "Object").map((entry) => entry.metadata.ref.key).toSorted();
|
|
23
|
+
yield* check(JSON.stringify(keys) === JSON.stringify([
|
|
24
|
+
"p/a",
|
|
25
|
+
"p/b",
|
|
26
|
+
"p/c"
|
|
27
|
+
]), "Listing lost/duplicated keys");
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "common-prefixes",
|
|
32
|
+
requires: (profile) => profile.list.delimiter,
|
|
33
|
+
run: (storage) => Effect.gen(function* () {
|
|
34
|
+
for (const key of [
|
|
35
|
+
"p/a/x",
|
|
36
|
+
"p/a/y",
|
|
37
|
+
"p/b"
|
|
38
|
+
]) yield* storage.put({
|
|
39
|
+
key,
|
|
40
|
+
body: /* @__PURE__ */ new Uint8Array()
|
|
41
|
+
});
|
|
42
|
+
const page = yield* storage.listPage({
|
|
43
|
+
prefix: "p/",
|
|
44
|
+
delimiter: "/"
|
|
45
|
+
});
|
|
46
|
+
yield* check(page.entries.some((entry) => entry._tag === "CommonPrefix" && entry.prefix === "p/a/"), "Missing aggregated common prefix");
|
|
47
|
+
yield* check(page.entries.filter((entry) => entry._tag === "CommonPrefix").length === 1, "Repeated common prefix");
|
|
48
|
+
})
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "cursor-query-binding",
|
|
52
|
+
run: (storage) => Effect.gen(function* () {
|
|
53
|
+
for (const key of ["q/a", "q/b"]) yield* storage.put({
|
|
54
|
+
key,
|
|
55
|
+
body: /* @__PURE__ */ new Uint8Array()
|
|
56
|
+
});
|
|
57
|
+
const page = yield* storage.listPage({
|
|
58
|
+
prefix: "q/",
|
|
59
|
+
limit: 1
|
|
60
|
+
});
|
|
61
|
+
if (!page.cursor) return yield* check(false, "Page omitted required continuation");
|
|
62
|
+
yield* expectReason(storage.listPage({
|
|
63
|
+
prefix: "other/",
|
|
64
|
+
limit: 1,
|
|
65
|
+
cursor: page.cursor
|
|
66
|
+
}), "InvalidInput");
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
export { listCases };
|
|
72
|
+
//# sourceMappingURL=list-cases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-cases.js","names":[],"sources":["../../../src/testing/conformance/list-cases.ts"],"sourcesContent":["import { Effect, Stream } from \"effect\";\n\nimport { Storage } from \"../../core/storage.js\";\nimport type { StorageConformanceCase } from \"../conformance.js\";\nimport { check, expectReason } from \"./assertions.js\";\n\nexport const listCases: ReadonlyArray<StorageConformanceCase> = [\n {\n name: \"paged-prefix-traversal\",\n run: (storage) =>\n Effect.gen(function* () {\n for (const key of [\"p/a\", \"p/b\", \"p/c\", \"unrelated\"]) {\n yield* storage.put({ key, body: new Uint8Array() });\n }\n const entries = yield* Stream.runCollect(\n Storage.list({ prefix: \"p/\", limit: 1 }).pipe(Stream.provideService(Storage, storage)),\n );\n const keys = entries\n .filter((entry) => entry._tag === \"Object\")\n .map((entry) => entry.metadata.ref.key)\n .toSorted();\n yield* check(\n JSON.stringify(keys) === JSON.stringify([\"p/a\", \"p/b\", \"p/c\"]),\n \"Listing lost/duplicated keys\",\n );\n }),\n },\n {\n name: \"common-prefixes\",\n requires: (profile) => profile.list.delimiter,\n run: (storage) =>\n Effect.gen(function* () {\n for (const key of [\"p/a/x\", \"p/a/y\", \"p/b\"])\n yield* storage.put({ key, body: new Uint8Array() });\n const page = yield* storage.listPage({ prefix: \"p/\", delimiter: \"/\" });\n yield* check(\n page.entries.some((entry) => entry._tag === \"CommonPrefix\" && entry.prefix === \"p/a/\"),\n \"Missing aggregated common prefix\",\n );\n yield* check(\n page.entries.filter((entry) => entry._tag === \"CommonPrefix\").length === 1,\n \"Repeated common prefix\",\n );\n }),\n },\n {\n name: \"cursor-query-binding\",\n run: (storage) =>\n Effect.gen(function* () {\n for (const key of [\"q/a\", \"q/b\"]) yield* storage.put({ key, body: new Uint8Array() });\n const page = yield* storage.listPage({ prefix: \"q/\", limit: 1 });\n if (!page.cursor) return yield* check(false, \"Page omitted required continuation\");\n yield* expectReason(\n storage.listPage({ prefix: \"other/\", limit: 1, cursor: page.cursor }),\n \"InvalidInput\",\n );\n }),\n },\n];\n"],"mappings":";;;;;AAMA,MAAa,YAAmD;CAC9D;EACE,MAAM;EACN,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,KAAK,MAAM,OAAO;IAAC;IAAO;IAAO;IAAO;GAAW,GACjD,OAAO,QAAQ,IAAI;IAAE;IAAK,sBAAM,IAAI,WAAW;GAAE,CAAC;GAKpD,MAAM,QAAO,OAHU,OAAO,WAC5B,QAAQ,KAAK;IAAE,QAAQ;IAAM,OAAO;GAAE,CAAC,CAAC,CAAC,KAAK,OAAO,eAAe,SAAS,OAAO,CAAC,CACvF,EACoB,CACjB,QAAQ,UAAU,MAAM,SAAS,QAAQ,CAAC,CAC1C,KAAK,UAAU,MAAM,SAAS,IAAI,GAAG,CAAC,CACtC,SAAS;GACZ,OAAO,MACL,KAAK,UAAU,IAAI,MAAM,KAAK,UAAU;IAAC;IAAO;IAAO;GAAK,CAAC,GAC7D,8BACF;EACF,CAAC;CACL;CACA;EACE,MAAM;EACN,WAAW,YAAY,QAAQ,KAAK;EACpC,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,KAAK,MAAM,OAAO;IAAC;IAAS;IAAS;GAAK,GACxC,OAAO,QAAQ,IAAI;IAAE;IAAK,sBAAM,IAAI,WAAW;GAAE,CAAC;GACpD,MAAM,OAAO,OAAO,QAAQ,SAAS;IAAE,QAAQ;IAAM,WAAW;GAAI,CAAC;GACrE,OAAO,MACL,KAAK,QAAQ,MAAM,UAAU,MAAM,SAAS,kBAAkB,MAAM,WAAW,MAAM,GACrF,kCACF;GACA,OAAO,MACL,KAAK,QAAQ,QAAQ,UAAU,MAAM,SAAS,cAAc,CAAC,CAAC,WAAW,GACzE,wBACF;EACF,CAAC;CACL;CACA;EACE,MAAM;EACN,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,KAAK,MAAM,OAAO,CAAC,OAAO,KAAK,GAAG,OAAO,QAAQ,IAAI;IAAE;IAAK,sBAAM,IAAI,WAAW;GAAE,CAAC;GACpF,MAAM,OAAO,OAAO,QAAQ,SAAS;IAAE,QAAQ;IAAM,OAAO;GAAE,CAAC;GAC/D,IAAI,CAAC,KAAK,QAAQ,OAAO,OAAO,MAAM,OAAO,oCAAoC;GACjF,OAAO,aACL,QAAQ,SAAS;IAAE,QAAQ;IAAU,OAAO;IAAG,QAAQ,KAAK;GAAO,CAAC,GACpE,cACF;EACF,CAAC;CACL;AACF"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Storage } from "../../core/storage.js";
|
|
2
|
+
import { bytesEqual, check, expectReason } from "./assertions.js";
|
|
3
|
+
import { Effect, Stream } from "effect";
|
|
4
|
+
|
|
5
|
+
// src/testing/conformance/read-cases.ts
|
|
6
|
+
const readCases = [
|
|
7
|
+
{
|
|
8
|
+
name: "single-open-and-suffix-ranges",
|
|
9
|
+
requires: (profile) => [
|
|
10
|
+
"bounded",
|
|
11
|
+
"from",
|
|
12
|
+
"suffix"
|
|
13
|
+
].every((kind) => profile.ranges.some((range) => range === kind)),
|
|
14
|
+
run: (storage) => Effect.gen(function* () {
|
|
15
|
+
yield* storage.put({
|
|
16
|
+
key: "range",
|
|
17
|
+
body: new Uint8Array([
|
|
18
|
+
0,
|
|
19
|
+
1,
|
|
20
|
+
2,
|
|
21
|
+
3
|
|
22
|
+
])
|
|
23
|
+
});
|
|
24
|
+
for (const [range, expected] of [
|
|
25
|
+
[{
|
|
26
|
+
_tag: "Bounded",
|
|
27
|
+
start: 1,
|
|
28
|
+
end: 2
|
|
29
|
+
}, [1, 2]],
|
|
30
|
+
[{
|
|
31
|
+
_tag: "From",
|
|
32
|
+
start: 2
|
|
33
|
+
}, [2, 3]],
|
|
34
|
+
[{
|
|
35
|
+
_tag: "Suffix",
|
|
36
|
+
length: 2
|
|
37
|
+
}, [2, 3]]
|
|
38
|
+
]) {
|
|
39
|
+
const actual = yield* Storage.getBytes({
|
|
40
|
+
key: "range",
|
|
41
|
+
range,
|
|
42
|
+
maxBytes: 4
|
|
43
|
+
}).pipe(Effect.provideService(Storage, storage));
|
|
44
|
+
yield* check(bytesEqual(actual, new Uint8Array(expected)), "Wrong range bytes");
|
|
45
|
+
}
|
|
46
|
+
yield* expectReason(storage.get({
|
|
47
|
+
key: "range",
|
|
48
|
+
range: {
|
|
49
|
+
_tag: "From",
|
|
50
|
+
start: 4
|
|
51
|
+
}
|
|
52
|
+
}), "RangeNotSatisfiable");
|
|
53
|
+
})
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "not-modified-is-not-an-empty-body",
|
|
57
|
+
requires: (profile) => profile.getConditions.includes("if-none-match"),
|
|
58
|
+
run: (storage) => Effect.gen(function* () {
|
|
59
|
+
yield* storage.put({
|
|
60
|
+
key: "cached",
|
|
61
|
+
body: new Uint8Array([1])
|
|
62
|
+
});
|
|
63
|
+
const response = yield* storage.get({
|
|
64
|
+
key: "cached",
|
|
65
|
+
condition: {
|
|
66
|
+
_tag: "IfNoneMatch",
|
|
67
|
+
etag: "*"
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
yield* check(response._tag === "NotModified" && !("body" in response), "Conditional read fabricated a body");
|
|
71
|
+
})
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "body-cannot-outlive-acquisition",
|
|
75
|
+
run: (storage) => Effect.gen(function* () {
|
|
76
|
+
yield* storage.put({
|
|
77
|
+
key: "scoped",
|
|
78
|
+
body: new Uint8Array([1])
|
|
79
|
+
});
|
|
80
|
+
const response = yield* Effect.scoped(storage.get({ key: "scoped" }));
|
|
81
|
+
if (response._tag !== "Object") return yield* check(false, "Unconditional get did not return an object");
|
|
82
|
+
yield* expectReason(Stream.runDrain(response.body), "ScopeClosed");
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "explicit-collection-limit",
|
|
87
|
+
run: (storage) => Effect.gen(function* () {
|
|
88
|
+
yield* storage.put({
|
|
89
|
+
key: "large",
|
|
90
|
+
body: new Uint8Array([
|
|
91
|
+
1,
|
|
92
|
+
2,
|
|
93
|
+
3
|
|
94
|
+
])
|
|
95
|
+
});
|
|
96
|
+
yield* expectReason(Storage.getBytes({
|
|
97
|
+
key: "large",
|
|
98
|
+
maxBytes: 2
|
|
99
|
+
}).pipe(Effect.provideService(Storage, storage)), "LimitExceeded");
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
export { readCases };
|
|
105
|
+
//# sourceMappingURL=read-cases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-cases.js","names":[],"sources":["../../../src/testing/conformance/read-cases.ts"],"sourcesContent":["import { Effect, Stream } from \"effect\";\n\nimport { Storage } from \"../../core/storage.js\";\nimport type { StorageConformanceCase } from \"../conformance.js\";\nimport { bytesEqual, check, expectReason } from \"./assertions.js\";\n\nexport const readCases: ReadonlyArray<StorageConformanceCase> = [\n {\n name: \"single-open-and-suffix-ranges\",\n requires: (profile) =>\n [\"bounded\", \"from\", \"suffix\"].every((kind) => profile.ranges.some((range) => range === kind)),\n run: (storage) =>\n Effect.gen(function* () {\n yield* storage.put({ key: \"range\", body: new Uint8Array([0, 1, 2, 3]) });\n for (const [range, expected] of [\n [{ _tag: \"Bounded\", start: 1, end: 2 }, [1, 2]],\n [{ _tag: \"From\", start: 2 }, [2, 3]],\n [{ _tag: \"Suffix\", length: 2 }, [2, 3]],\n ] as const) {\n const actual = yield* Storage.getBytes({ key: \"range\", range, maxBytes: 4 }).pipe(\n Effect.provideService(Storage, storage),\n );\n yield* check(bytesEqual(actual, new Uint8Array(expected)), \"Wrong range bytes\");\n }\n yield* expectReason(\n storage.get({ key: \"range\", range: { _tag: \"From\", start: 4 } }),\n \"RangeNotSatisfiable\",\n );\n }),\n },\n {\n name: \"not-modified-is-not-an-empty-body\",\n requires: (profile) => profile.getConditions.includes(\"if-none-match\"),\n run: (storage) =>\n Effect.gen(function* () {\n yield* storage.put({ key: \"cached\", body: new Uint8Array([1]) });\n const response = yield* storage.get({\n key: \"cached\",\n condition: { _tag: \"IfNoneMatch\", etag: \"*\" },\n });\n yield* check(\n response._tag === \"NotModified\" && !(\"body\" in response),\n \"Conditional read fabricated a body\",\n );\n }),\n },\n {\n name: \"body-cannot-outlive-acquisition\",\n run: (storage) =>\n Effect.gen(function* () {\n yield* storage.put({ key: \"scoped\", body: new Uint8Array([1]) });\n const response = yield* Effect.scoped(storage.get({ key: \"scoped\" }));\n if (response._tag !== \"Object\")\n return yield* check(false, \"Unconditional get did not return an object\");\n yield* expectReason(Stream.runDrain(response.body), \"ScopeClosed\");\n }),\n },\n {\n name: \"explicit-collection-limit\",\n run: (storage) =>\n Effect.gen(function* () {\n yield* storage.put({ key: \"large\", body: new Uint8Array([1, 2, 3]) });\n yield* expectReason(\n Storage.getBytes({ key: \"large\", maxBytes: 2 }).pipe(\n Effect.provideService(Storage, storage),\n ),\n \"LimitExceeded\",\n );\n }),\n },\n];\n"],"mappings":";;;;;AAMA,MAAa,YAAmD;CAC9D;EACE,MAAM;EACN,WAAW,YACT;GAAC;GAAW;GAAQ;EAAQ,CAAC,CAAC,OAAO,SAAS,QAAQ,OAAO,MAAM,UAAU,UAAU,IAAI,CAAC;EAC9F,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,OAAO,QAAQ,IAAI;IAAE,KAAK;IAAS,MAAM,IAAI,WAAW;KAAC;KAAG;KAAG;KAAG;IAAC,CAAC;GAAE,CAAC;GACvE,KAAK,MAAM,CAAC,OAAO,aAAa;IAC9B,CAAC;KAAE,MAAM;KAAW,OAAO;KAAG,KAAK;IAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;KAAE,MAAM;KAAQ,OAAO;IAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;KAAE,MAAM;KAAU,QAAQ;IAAE,GAAG,CAAC,GAAG,CAAC,CAAC;GACxC,GAAY;IACV,MAAM,SAAS,OAAO,QAAQ,SAAS;KAAE,KAAK;KAAS;KAAO,UAAU;IAAE,CAAC,CAAC,CAAC,KAC3E,OAAO,eAAe,SAAS,OAAO,CACxC;IACA,OAAO,MAAM,WAAW,QAAQ,IAAI,WAAW,QAAQ,CAAC,GAAG,mBAAmB;GAChF;GACA,OAAO,aACL,QAAQ,IAAI;IAAE,KAAK;IAAS,OAAO;KAAE,MAAM;KAAQ,OAAO;IAAE;GAAE,CAAC,GAC/D,qBACF;EACF,CAAC;CACL;CACA;EACE,MAAM;EACN,WAAW,YAAY,QAAQ,cAAc,SAAS,eAAe;EACrE,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,OAAO,QAAQ,IAAI;IAAE,KAAK;IAAU,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;GAAE,CAAC;GAC/D,MAAM,WAAW,OAAO,QAAQ,IAAI;IAClC,KAAK;IACL,WAAW;KAAE,MAAM;KAAe,MAAM;IAAI;GAC9C,CAAC;GACD,OAAO,MACL,SAAS,SAAS,iBAAiB,EAAE,UAAU,WAC/C,oCACF;EACF,CAAC;CACL;CACA;EACE,MAAM;EACN,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,OAAO,QAAQ,IAAI;IAAE,KAAK;IAAU,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;GAAE,CAAC;GAC/D,MAAM,WAAW,OAAO,OAAO,OAAO,QAAQ,IAAI,EAAE,KAAK,SAAS,CAAC,CAAC;GACpE,IAAI,SAAS,SAAS,UACpB,OAAO,OAAO,MAAM,OAAO,4CAA4C;GACzE,OAAO,aAAa,OAAO,SAAS,SAAS,IAAI,GAAG,aAAa;EACnE,CAAC;CACL;CACA;EACE,MAAM;EACN,MAAM,YACJ,OAAO,IAAI,aAAa;GACtB,OAAO,QAAQ,IAAI;IAAE,KAAK;IAAS,MAAM,IAAI,WAAW;KAAC;KAAG;KAAG;IAAC,CAAC;GAAE,CAAC;GACpE,OAAO,aACL,QAAQ,SAAS;IAAE,KAAK;IAAS,UAAU;GAAE,CAAC,CAAC,CAAC,KAC9C,OAAO,eAAe,SAAS,OAAO,CACxC,GACA,eACF;EACF,CAAC;CACL;AACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StorageError } from "../core/errors.js";
|
|
2
|
+
import { StorageCapabilities } from "../core/capabilities.js";
|
|
3
|
+
import { StorageService } from "../core/storage.js";
|
|
4
|
+
import { ConformanceFailure } from "./conformance/assertions.js";
|
|
5
|
+
import { Effect, Scope } from "effect";
|
|
6
|
+
export interface StorageConformanceCase {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly requires?: ((profile: StorageCapabilities) => boolean) | undefined;
|
|
9
|
+
readonly run: (storage: StorageService) => Effect.Effect<void, StorageError | ConformanceFailure, Scope.Scope>;
|
|
10
|
+
}
|
|
11
|
+
export declare const storageConformanceCases: ReadonlyArray<StorageConformanceCase>;
|
|
12
|
+
export type ConformanceResult = {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly status: "passed";
|
|
15
|
+
} | {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly status: "skipped";
|
|
18
|
+
readonly reason: string;
|
|
19
|
+
};
|
|
20
|
+
/** Each case owns a fresh scoped fixture; callers own provider resource cleanup. */
|
|
21
|
+
export declare function runStorageConformance<E, R>(makeFixture: () => Effect.Effect<StorageService, E, R>): Effect.Effect<ReadonlyArray<ConformanceResult>, E | ConformanceFailure, Exclude<R, Scope.Scope>>;
|
|
22
|
+
export { ConformanceFailure };
|
|
23
|
+
//# sourceMappingURL=conformance.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ConformanceFailure } from "./conformance/assertions.js";
|
|
2
|
+
import { coreCases } from "./conformance/core-cases.js";
|
|
3
|
+
import { listCases } from "./conformance/list-cases.js";
|
|
4
|
+
import { readCases } from "./conformance/read-cases.js";
|
|
5
|
+
import { Effect } from "effect";
|
|
6
|
+
|
|
7
|
+
// src/testing/conformance.ts
|
|
8
|
+
const storageConformanceCases = [
|
|
9
|
+
...coreCases,
|
|
10
|
+
...readCases,
|
|
11
|
+
...listCases
|
|
12
|
+
];
|
|
13
|
+
/** Each case owns a fresh scoped fixture; callers own provider resource cleanup. */
|
|
14
|
+
function runStorageConformance(makeFixture) {
|
|
15
|
+
return Effect.forEach(storageConformanceCases, (test) => Effect.scoped(Effect.gen(function* () {
|
|
16
|
+
const storage = yield* makeFixture();
|
|
17
|
+
if (test.requires && !test.requires(storage.capabilities)) return {
|
|
18
|
+
name: test.name,
|
|
19
|
+
status: "skipped",
|
|
20
|
+
reason: "Capability is not advertised by this profile"
|
|
21
|
+
};
|
|
22
|
+
yield* test.run(storage).pipe(Effect.catchTag("StorageError", (error) => Effect.fail(new ConformanceFailure({
|
|
23
|
+
testName: test.name,
|
|
24
|
+
detail: error.reason._tag
|
|
25
|
+
}))), Effect.catchTag("ConformanceFailure", (error) => Effect.fail(new ConformanceFailure({
|
|
26
|
+
testName: test.name,
|
|
27
|
+
detail: error.detail
|
|
28
|
+
}))));
|
|
29
|
+
return {
|
|
30
|
+
name: test.name,
|
|
31
|
+
status: "passed"
|
|
32
|
+
};
|
|
33
|
+
})));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { ConformanceFailure, runStorageConformance, storageConformanceCases };
|
|
37
|
+
//# sourceMappingURL=conformance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.js","names":[],"sources":["../../src/testing/conformance.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport type { Scope } from \"effect\";\n\nimport type { StorageCapabilities } from \"../core/capabilities.js\";\nimport type { StorageError } from \"../core/errors.js\";\nimport type { StorageService } from \"../core/storage.js\";\nimport { ConformanceFailure } from \"./conformance/assertions.js\";\nimport { coreCases } from \"./conformance/core-cases.js\";\nimport { listCases } from \"./conformance/list-cases.js\";\nimport { readCases } from \"./conformance/read-cases.js\";\n\nexport { ConformanceFailure } from \"./conformance/assertions.js\";\n\nexport interface StorageConformanceCase {\n readonly name: string;\n readonly requires?: ((profile: StorageCapabilities) => boolean) | undefined;\n readonly run: (\n storage: StorageService,\n ) => Effect.Effect<void, StorageError | ConformanceFailure, Scope.Scope>;\n}\n\nexport const storageConformanceCases: ReadonlyArray<StorageConformanceCase> = [\n ...coreCases,\n ...readCases,\n ...listCases,\n];\n\nexport type ConformanceResult =\n | { readonly name: string; readonly status: \"passed\" }\n | { readonly name: string; readonly status: \"skipped\"; readonly reason: string };\n\n/** Each case owns a fresh scoped fixture; callers own provider resource cleanup. */\nexport function runStorageConformance<E, R>(\n makeFixture: () => Effect.Effect<StorageService, E, R>,\n): Effect.Effect<\n ReadonlyArray<ConformanceResult>,\n E | ConformanceFailure,\n Exclude<R, Scope.Scope>\n> {\n return Effect.forEach(storageConformanceCases, (test) =>\n Effect.scoped(\n Effect.gen(function* () {\n const storage = yield* makeFixture();\n if (test.requires && !test.requires(storage.capabilities)) {\n return {\n name: test.name,\n status: \"skipped\",\n reason: \"Capability is not advertised by this profile\",\n } as const;\n }\n yield* test.run(storage).pipe(\n Effect.catchTag(\"StorageError\", (error) =>\n Effect.fail(new ConformanceFailure({ testName: test.name, detail: error.reason._tag })),\n ),\n Effect.catchTag(\"ConformanceFailure\", (error) =>\n Effect.fail(new ConformanceFailure({ testName: test.name, detail: error.detail })),\n ),\n );\n return { name: test.name, status: \"passed\" } as const;\n }),\n ),\n );\n}\n"],"mappings":";;;;;;;AAqBA,MAAa,0BAAiE;CAC5E,GAAG;CACH,GAAG;CACH,GAAG;AACL;;AAOA,SAAgB,sBACd,aAKA;CACA,OAAO,OAAO,QAAQ,0BAA0B,SAC9C,OAAO,OACL,OAAO,IAAI,aAAa;EACtB,MAAM,UAAU,OAAO,YAAY;EACnC,IAAI,KAAK,YAAY,CAAC,KAAK,SAAS,QAAQ,YAAY,GACtD,OAAO;GACL,MAAM,KAAK;GACX,QAAQ;GACR,QAAQ;EACV;EAEF,OAAO,KAAK,IAAI,OAAO,CAAC,CAAC,KACvB,OAAO,SAAS,iBAAiB,UAC/B,OAAO,KAAK,IAAI,mBAAmB;GAAE,UAAU,KAAK;GAAM,QAAQ,MAAM,OAAO;EAAK,CAAC,CAAC,CACxF,GACA,OAAO,SAAS,uBAAuB,UACrC,OAAO,KAAK,IAAI,mBAAmB;GAAE,UAAU,KAAK;GAAM,QAAQ,MAAM;EAAO,CAAC,CAAC,CACnF,CACF;EACA,OAAO;GAAE,MAAM,KAAK;GAAM,QAAQ;EAAS;CAC7C,CAAC,CACH,CACF;AACF"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { StorageError } from "../core/errors.js";
|
|
2
|
+
import { StorageService } from "../core/storage.js";
|
|
3
|
+
import { Effect, Schema } from "effect";
|
|
4
|
+
declare namespace faults_d_exports {
|
|
5
|
+
export { FaultAttempt, FaultController, FaultDiagnostic, FaultStep, make };
|
|
6
|
+
}
|
|
7
|
+
declare const Operation: Schema.Literals<readonly ["put", "get", "head", "delete", "listPage"]>;
|
|
8
|
+
declare const FaultStep: Schema.Struct<{
|
|
9
|
+
readonly operation: Schema.Literals<readonly ["put", "get", "head", "delete", "listPage"]>;
|
|
10
|
+
readonly delayMillis: Schema.optional<Schema.Natural>;
|
|
11
|
+
readonly beforeFailure: Schema.optional<Schema.Union<readonly [Schema.TaggedStruct<"InvalidInput", {
|
|
12
|
+
readonly field: Schema.String;
|
|
13
|
+
}>, Schema.TaggedStruct<"InvalidConfiguration", {
|
|
14
|
+
readonly field: Schema.String;
|
|
15
|
+
}>, Schema.TaggedStruct<"Unsupported", {
|
|
16
|
+
readonly capability: Schema.String;
|
|
17
|
+
}>, Schema.TaggedStruct<"NotFound", {}>, Schema.TaggedStruct<"AccessDenied", {}>, Schema.TaggedStruct<"PreconditionFailed", {}>, Schema.TaggedStruct<"NotModified", {}>, Schema.TaggedStruct<"RangeNotSatisfiable", {}>, Schema.TaggedStruct<"Expired", {}>, Schema.TaggedStruct<"Throttled", {
|
|
18
|
+
readonly retryAfterMillis: Schema.optional<Schema.Natural>;
|
|
19
|
+
}>, Schema.TaggedStruct<"TransportFailure", {
|
|
20
|
+
readonly code: Schema.optional<Schema.String>;
|
|
21
|
+
}>, Schema.TaggedStruct<"ProviderFailure", {
|
|
22
|
+
readonly code: Schema.optional<Schema.String>;
|
|
23
|
+
}>, Schema.TaggedStruct<"IntegrityMismatch", {}>, Schema.TaggedStruct<"LengthMismatch", {
|
|
24
|
+
readonly expected: Schema.Natural;
|
|
25
|
+
readonly actual: Schema.Natural;
|
|
26
|
+
}>, Schema.TaggedStruct<"LimitExceeded", {
|
|
27
|
+
readonly limit: Schema.Natural;
|
|
28
|
+
}>, Schema.TaggedStruct<"InvalidSession", {}>, Schema.TaggedStruct<"QuotaExceeded", {
|
|
29
|
+
readonly limit: Schema.Natural;
|
|
30
|
+
}>, Schema.TaggedStruct<"ScopeClosed", {}>, Schema.TaggedStruct<"BodyConsumed", {}>, Schema.TaggedStruct<"PartialFailure", {}>]>>;
|
|
31
|
+
readonly afterFailure: Schema.optional<Schema.Union<readonly [Schema.TaggedStruct<"InvalidInput", {
|
|
32
|
+
readonly field: Schema.String;
|
|
33
|
+
}>, Schema.TaggedStruct<"InvalidConfiguration", {
|
|
34
|
+
readonly field: Schema.String;
|
|
35
|
+
}>, Schema.TaggedStruct<"Unsupported", {
|
|
36
|
+
readonly capability: Schema.String;
|
|
37
|
+
}>, Schema.TaggedStruct<"NotFound", {}>, Schema.TaggedStruct<"AccessDenied", {}>, Schema.TaggedStruct<"PreconditionFailed", {}>, Schema.TaggedStruct<"NotModified", {}>, Schema.TaggedStruct<"RangeNotSatisfiable", {}>, Schema.TaggedStruct<"Expired", {}>, Schema.TaggedStruct<"Throttled", {
|
|
38
|
+
readonly retryAfterMillis: Schema.optional<Schema.Natural>;
|
|
39
|
+
}>, Schema.TaggedStruct<"TransportFailure", {
|
|
40
|
+
readonly code: Schema.optional<Schema.String>;
|
|
41
|
+
}>, Schema.TaggedStruct<"ProviderFailure", {
|
|
42
|
+
readonly code: Schema.optional<Schema.String>;
|
|
43
|
+
}>, Schema.TaggedStruct<"IntegrityMismatch", {}>, Schema.TaggedStruct<"LengthMismatch", {
|
|
44
|
+
readonly expected: Schema.Natural;
|
|
45
|
+
readonly actual: Schema.Natural;
|
|
46
|
+
}>, Schema.TaggedStruct<"LimitExceeded", {
|
|
47
|
+
readonly limit: Schema.Natural;
|
|
48
|
+
}>, Schema.TaggedStruct<"InvalidSession", {}>, Schema.TaggedStruct<"QuotaExceeded", {
|
|
49
|
+
readonly limit: Schema.Natural;
|
|
50
|
+
}>, Schema.TaggedStruct<"ScopeClosed", {}>, Schema.TaggedStruct<"BodyConsumed", {}>, Schema.TaggedStruct<"PartialFailure", {}>]>>;
|
|
51
|
+
readonly bodyFailure: Schema.optional<Schema.Struct<{
|
|
52
|
+
readonly afterBytes: Schema.Natural;
|
|
53
|
+
readonly reason: Schema.Union<readonly [Schema.TaggedStruct<"InvalidInput", {
|
|
54
|
+
readonly field: Schema.String;
|
|
55
|
+
}>, Schema.TaggedStruct<"InvalidConfiguration", {
|
|
56
|
+
readonly field: Schema.String;
|
|
57
|
+
}>, Schema.TaggedStruct<"Unsupported", {
|
|
58
|
+
readonly capability: Schema.String;
|
|
59
|
+
}>, Schema.TaggedStruct<"NotFound", {}>, Schema.TaggedStruct<"AccessDenied", {}>, Schema.TaggedStruct<"PreconditionFailed", {}>, Schema.TaggedStruct<"NotModified", {}>, Schema.TaggedStruct<"RangeNotSatisfiable", {}>, Schema.TaggedStruct<"Expired", {}>, Schema.TaggedStruct<"Throttled", {
|
|
60
|
+
readonly retryAfterMillis: Schema.optional<Schema.Natural>;
|
|
61
|
+
}>, Schema.TaggedStruct<"TransportFailure", {
|
|
62
|
+
readonly code: Schema.optional<Schema.String>;
|
|
63
|
+
}>, Schema.TaggedStruct<"ProviderFailure", {
|
|
64
|
+
readonly code: Schema.optional<Schema.String>;
|
|
65
|
+
}>, Schema.TaggedStruct<"IntegrityMismatch", {}>, Schema.TaggedStruct<"LengthMismatch", {
|
|
66
|
+
readonly expected: Schema.Natural;
|
|
67
|
+
readonly actual: Schema.Natural;
|
|
68
|
+
}>, Schema.TaggedStruct<"LimitExceeded", {
|
|
69
|
+
readonly limit: Schema.Natural;
|
|
70
|
+
}>, Schema.TaggedStruct<"InvalidSession", {}>, Schema.TaggedStruct<"QuotaExceeded", {
|
|
71
|
+
readonly limit: Schema.Natural;
|
|
72
|
+
}>, Schema.TaggedStruct<"ScopeClosed", {}>, Schema.TaggedStruct<"BodyConsumed", {}>, Schema.TaggedStruct<"PartialFailure", {}>]>;
|
|
73
|
+
}>>;
|
|
74
|
+
readonly cleanupFailure: Schema.optional<Schema.NonEmptyString>;
|
|
75
|
+
readonly observerFailure: Schema.optional<Schema.NonEmptyString>;
|
|
76
|
+
}>;
|
|
77
|
+
type FaultStep = typeof FaultStep.Type;
|
|
78
|
+
export interface FaultAttempt {
|
|
79
|
+
readonly index: number;
|
|
80
|
+
readonly operation: typeof Operation.Type;
|
|
81
|
+
readonly status: "started" | "acquired" | "closed" | "succeeded" | "failed" | "interrupted" | "defect";
|
|
82
|
+
}
|
|
83
|
+
export interface FaultDiagnostic {
|
|
84
|
+
readonly index: number;
|
|
85
|
+
readonly operation: typeof Operation.Type;
|
|
86
|
+
readonly kind: "cleanup" | "observer";
|
|
87
|
+
readonly code: string;
|
|
88
|
+
}
|
|
89
|
+
export interface FaultController {
|
|
90
|
+
readonly storage: StorageService;
|
|
91
|
+
readonly attempts: Effect.Effect<ReadonlyArray<FaultAttempt>>;
|
|
92
|
+
readonly diagnostics: Effect.Effect<ReadonlyArray<FaultDiagnostic>>;
|
|
93
|
+
readonly assertDone: Effect.Effect<void>;
|
|
94
|
+
}
|
|
95
|
+
export declare const make: (base: StorageService, script: readonly {
|
|
96
|
+
readonly operation: "delete" | "get" | "head" | "listPage" | "put";
|
|
97
|
+
readonly delayMillis?: number | undefined;
|
|
98
|
+
readonly beforeFailure?: {
|
|
99
|
+
readonly _tag: "InvalidInput";
|
|
100
|
+
readonly field: string;
|
|
101
|
+
} | {
|
|
102
|
+
readonly _tag: "InvalidConfiguration";
|
|
103
|
+
readonly field: string;
|
|
104
|
+
} | {
|
|
105
|
+
readonly _tag: "Unsupported";
|
|
106
|
+
readonly capability: string;
|
|
107
|
+
} | {
|
|
108
|
+
readonly _tag: "NotFound";
|
|
109
|
+
} | {
|
|
110
|
+
readonly _tag: "AccessDenied";
|
|
111
|
+
} | {
|
|
112
|
+
readonly _tag: "PreconditionFailed";
|
|
113
|
+
} | {
|
|
114
|
+
readonly _tag: "NotModified";
|
|
115
|
+
} | {
|
|
116
|
+
readonly _tag: "RangeNotSatisfiable";
|
|
117
|
+
} | {
|
|
118
|
+
readonly _tag: "Expired";
|
|
119
|
+
} | {
|
|
120
|
+
readonly _tag: "Throttled";
|
|
121
|
+
readonly retryAfterMillis?: number | undefined;
|
|
122
|
+
} | {
|
|
123
|
+
readonly _tag: "TransportFailure";
|
|
124
|
+
readonly code?: string | undefined;
|
|
125
|
+
} | {
|
|
126
|
+
readonly _tag: "ProviderFailure";
|
|
127
|
+
readonly code?: string | undefined;
|
|
128
|
+
} | {
|
|
129
|
+
readonly _tag: "IntegrityMismatch";
|
|
130
|
+
} | {
|
|
131
|
+
readonly _tag: "LengthMismatch";
|
|
132
|
+
readonly expected: number;
|
|
133
|
+
readonly actual: number;
|
|
134
|
+
} | {
|
|
135
|
+
readonly _tag: "LimitExceeded";
|
|
136
|
+
readonly limit: number;
|
|
137
|
+
} | {
|
|
138
|
+
readonly _tag: "InvalidSession";
|
|
139
|
+
} | {
|
|
140
|
+
readonly _tag: "QuotaExceeded";
|
|
141
|
+
readonly limit: number;
|
|
142
|
+
} | {
|
|
143
|
+
readonly _tag: "ScopeClosed";
|
|
144
|
+
} | {
|
|
145
|
+
readonly _tag: "BodyConsumed";
|
|
146
|
+
} | {
|
|
147
|
+
readonly _tag: "PartialFailure";
|
|
148
|
+
} | undefined;
|
|
149
|
+
readonly afterFailure?: {
|
|
150
|
+
readonly _tag: "InvalidInput";
|
|
151
|
+
readonly field: string;
|
|
152
|
+
} | {
|
|
153
|
+
readonly _tag: "InvalidConfiguration";
|
|
154
|
+
readonly field: string;
|
|
155
|
+
} | {
|
|
156
|
+
readonly _tag: "Unsupported";
|
|
157
|
+
readonly capability: string;
|
|
158
|
+
} | {
|
|
159
|
+
readonly _tag: "NotFound";
|
|
160
|
+
} | {
|
|
161
|
+
readonly _tag: "AccessDenied";
|
|
162
|
+
} | {
|
|
163
|
+
readonly _tag: "PreconditionFailed";
|
|
164
|
+
} | {
|
|
165
|
+
readonly _tag: "NotModified";
|
|
166
|
+
} | {
|
|
167
|
+
readonly _tag: "RangeNotSatisfiable";
|
|
168
|
+
} | {
|
|
169
|
+
readonly _tag: "Expired";
|
|
170
|
+
} | {
|
|
171
|
+
readonly _tag: "Throttled";
|
|
172
|
+
readonly retryAfterMillis?: number | undefined;
|
|
173
|
+
} | {
|
|
174
|
+
readonly _tag: "TransportFailure";
|
|
175
|
+
readonly code?: string | undefined;
|
|
176
|
+
} | {
|
|
177
|
+
readonly _tag: "ProviderFailure";
|
|
178
|
+
readonly code?: string | undefined;
|
|
179
|
+
} | {
|
|
180
|
+
readonly _tag: "IntegrityMismatch";
|
|
181
|
+
} | {
|
|
182
|
+
readonly _tag: "LengthMismatch";
|
|
183
|
+
readonly expected: number;
|
|
184
|
+
readonly actual: number;
|
|
185
|
+
} | {
|
|
186
|
+
readonly _tag: "LimitExceeded";
|
|
187
|
+
readonly limit: number;
|
|
188
|
+
} | {
|
|
189
|
+
readonly _tag: "InvalidSession";
|
|
190
|
+
} | {
|
|
191
|
+
readonly _tag: "QuotaExceeded";
|
|
192
|
+
readonly limit: number;
|
|
193
|
+
} | {
|
|
194
|
+
readonly _tag: "ScopeClosed";
|
|
195
|
+
} | {
|
|
196
|
+
readonly _tag: "BodyConsumed";
|
|
197
|
+
} | {
|
|
198
|
+
readonly _tag: "PartialFailure";
|
|
199
|
+
} | undefined;
|
|
200
|
+
readonly bodyFailure?: {
|
|
201
|
+
readonly afterBytes: number;
|
|
202
|
+
readonly reason: {
|
|
203
|
+
readonly _tag: "InvalidInput";
|
|
204
|
+
readonly field: string;
|
|
205
|
+
} | {
|
|
206
|
+
readonly _tag: "InvalidConfiguration";
|
|
207
|
+
readonly field: string;
|
|
208
|
+
} | {
|
|
209
|
+
readonly _tag: "Unsupported";
|
|
210
|
+
readonly capability: string;
|
|
211
|
+
} | {
|
|
212
|
+
readonly _tag: "NotFound";
|
|
213
|
+
} | {
|
|
214
|
+
readonly _tag: "AccessDenied";
|
|
215
|
+
} | {
|
|
216
|
+
readonly _tag: "PreconditionFailed";
|
|
217
|
+
} | {
|
|
218
|
+
readonly _tag: "NotModified";
|
|
219
|
+
} | {
|
|
220
|
+
readonly _tag: "RangeNotSatisfiable";
|
|
221
|
+
} | {
|
|
222
|
+
readonly _tag: "Expired";
|
|
223
|
+
} | {
|
|
224
|
+
readonly _tag: "Throttled";
|
|
225
|
+
readonly retryAfterMillis?: number | undefined;
|
|
226
|
+
} | {
|
|
227
|
+
readonly _tag: "TransportFailure";
|
|
228
|
+
readonly code?: string | undefined;
|
|
229
|
+
} | {
|
|
230
|
+
readonly _tag: "ProviderFailure";
|
|
231
|
+
readonly code?: string | undefined;
|
|
232
|
+
} | {
|
|
233
|
+
readonly _tag: "IntegrityMismatch";
|
|
234
|
+
} | {
|
|
235
|
+
readonly _tag: "LengthMismatch";
|
|
236
|
+
readonly expected: number;
|
|
237
|
+
readonly actual: number;
|
|
238
|
+
} | {
|
|
239
|
+
readonly _tag: "LimitExceeded";
|
|
240
|
+
readonly limit: number;
|
|
241
|
+
} | {
|
|
242
|
+
readonly _tag: "InvalidSession";
|
|
243
|
+
} | {
|
|
244
|
+
readonly _tag: "QuotaExceeded";
|
|
245
|
+
readonly limit: number;
|
|
246
|
+
} | {
|
|
247
|
+
readonly _tag: "ScopeClosed";
|
|
248
|
+
} | {
|
|
249
|
+
readonly _tag: "BodyConsumed";
|
|
250
|
+
} | {
|
|
251
|
+
readonly _tag: "PartialFailure";
|
|
252
|
+
};
|
|
253
|
+
} | undefined;
|
|
254
|
+
readonly cleanupFailure?: string | undefined;
|
|
255
|
+
readonly observerFailure?: string | undefined;
|
|
256
|
+
}[]) => Effect.Effect<FaultController, StorageError, never>;
|
|
257
|
+
export { FaultStep, faults_d_exports };
|
|
258
|
+
//# sourceMappingURL=faults.d.ts.map
|