alchemy 0.67.0 → 0.69.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/bin/alchemy.js +25580 -26264
- package/bin/alchemy.ts +6 -2
- package/bin/commands/configure.ts +194 -0
- package/bin/commands/login.ts +99 -55
- package/bin/commands/logout.ts +66 -0
- package/bin/trpc.ts +27 -2
- package/lib/apply.d.ts +2 -2
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +18 -15
- package/lib/apply.js.map +1 -1
- package/lib/auth.d.ts +72 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +163 -0
- package/lib/auth.js.map +1 -0
- package/lib/aws/bucket.d.ts +12 -3
- package/lib/aws/bucket.d.ts.map +1 -1
- package/lib/aws/bucket.js +2 -2
- package/lib/aws/bucket.js.map +1 -1
- package/lib/aws/control/properties.d.ts +64 -0
- package/lib/aws/control/properties.d.ts.map +1 -1
- package/lib/aws/control/properties.js +554 -39
- package/lib/aws/control/properties.js.map +1 -1
- package/lib/aws/control/resource.d.ts +34 -3
- package/lib/aws/control/resource.d.ts.map +1 -1
- package/lib/aws/control/resource.js +36 -3
- package/lib/aws/control/resource.js.map +1 -1
- package/lib/aws/control/types.d.ts +5451 -1587
- package/lib/aws/control/types.d.ts.map +1 -1
- package/lib/aws/control/types.js.map +1 -1
- package/lib/aws/control/update-types.d.ts +12913 -0
- package/lib/aws/control/update-types.d.ts.map +1 -0
- package/lib/aws/control/update-types.js +12916 -0
- package/lib/aws/control/update-types.js.map +1 -0
- package/lib/aws/ec2/internet-gateway-attachment.d.ts +1 -2
- package/lib/aws/ec2/internet-gateway-attachment.d.ts.map +1 -1
- package/lib/aws/ec2/internet-gateway-attachment.js +4 -4
- package/lib/aws/ec2/internet-gateway-attachment.js.map +1 -1
- package/lib/aws/ec2/internet-gateway.d.ts +1 -2
- package/lib/aws/ec2/internet-gateway.d.ts.map +1 -1
- package/lib/aws/ec2/internet-gateway.js +2 -2
- package/lib/aws/ec2/internet-gateway.js.map +1 -1
- package/lib/aws/ec2/nat-gateway.d.ts +1 -2
- package/lib/aws/ec2/nat-gateway.d.ts.map +1 -1
- package/lib/aws/ec2/nat-gateway.js +2 -2
- package/lib/aws/ec2/nat-gateway.js.map +1 -1
- package/lib/aws/ec2/route-table-association.d.ts +1 -2
- package/lib/aws/ec2/route-table-association.d.ts.map +1 -1
- package/lib/aws/ec2/route-table-association.js +2 -2
- package/lib/aws/ec2/route-table-association.js.map +1 -1
- package/lib/aws/ec2/route-table.d.ts +1 -2
- package/lib/aws/ec2/route-table.d.ts.map +1 -1
- package/lib/aws/ec2/route-table.js +2 -2
- package/lib/aws/ec2/route-table.js.map +1 -1
- package/lib/aws/ec2/route.d.ts +1 -2
- package/lib/aws/ec2/route.d.ts.map +1 -1
- package/lib/aws/ec2/route.js +2 -2
- package/lib/aws/ec2/route.js.map +1 -1
- package/lib/aws/ec2/security-group-rule.d.ts +1 -2
- package/lib/aws/ec2/security-group-rule.d.ts.map +1 -1
- package/lib/aws/ec2/security-group-rule.js +2 -2
- package/lib/aws/ec2/security-group-rule.js.map +1 -1
- package/lib/aws/ec2/security-group.d.ts +1 -2
- package/lib/aws/ec2/security-group.d.ts.map +1 -1
- package/lib/aws/ec2/security-group.js +2 -2
- package/lib/aws/ec2/security-group.js.map +1 -1
- package/lib/aws/ec2/subnet.d.ts +1 -2
- package/lib/aws/ec2/subnet.d.ts.map +1 -1
- package/lib/aws/ec2/subnet.js +2 -2
- package/lib/aws/ec2/subnet.js.map +1 -1
- package/lib/aws/ec2/vpc.d.ts +1 -2
- package/lib/aws/ec2/vpc.d.ts.map +1 -1
- package/lib/aws/ec2/vpc.js +2 -2
- package/lib/aws/ec2/vpc.js.map +1 -1
- package/lib/aws/function.d.ts +116 -3
- package/lib/aws/function.d.ts.map +1 -1
- package/lib/aws/function.js +2 -2
- package/lib/aws/function.js.map +1 -1
- package/lib/aws/oidc/github-oidc-provider.d.ts +13 -2
- package/lib/aws/oidc/github-oidc-provider.d.ts.map +1 -1
- package/lib/aws/oidc/oidc-provider.d.ts +48 -3
- package/lib/aws/oidc/oidc-provider.d.ts.map +1 -1
- package/lib/aws/oidc/oidc-provider.js +2 -2
- package/lib/aws/oidc/oidc-provider.js.map +1 -1
- package/lib/aws/policy-attachment.d.ts +2 -3
- package/lib/aws/policy-attachment.d.ts.map +1 -1
- package/lib/aws/policy-attachment.js +1 -1
- package/lib/aws/policy-attachment.js.map +1 -1
- package/lib/aws/policy.d.ts +1 -2
- package/lib/aws/policy.d.ts.map +1 -1
- package/lib/aws/policy.js +4 -4
- package/lib/aws/policy.js.map +1 -1
- package/lib/aws/queue.d.ts +1 -2
- package/lib/aws/queue.d.ts.map +1 -1
- package/lib/aws/queue.js +4 -4
- package/lib/aws/queue.js.map +1 -1
- package/lib/aws/role.d.ts +1 -2
- package/lib/aws/role.d.ts.map +1 -1
- package/lib/aws/role.js +2 -2
- package/lib/aws/role.js.map +1 -1
- package/lib/aws/ses.d.ts +1 -2
- package/lib/aws/ses.d.ts.map +1 -1
- package/lib/aws/ses.js +2 -2
- package/lib/aws/ses.js.map +1 -1
- package/lib/aws/ssm-parameter.d.ts +1 -2
- package/lib/aws/ssm-parameter.d.ts.map +1 -1
- package/lib/aws/ssm-parameter.js +2 -2
- package/lib/aws/ssm-parameter.js.map +1 -1
- package/lib/aws/table.d.ts +1 -2
- package/lib/aws/table.d.ts.map +1 -1
- package/lib/aws/table.js +2 -2
- package/lib/aws/table.js.map +1 -1
- package/lib/cloudflare/account-api-token.d.ts +1 -2
- package/lib/cloudflare/account-api-token.d.ts.map +1 -1
- package/lib/cloudflare/account-api-token.js +2 -2
- package/lib/cloudflare/account-api-token.js.map +1 -1
- package/lib/cloudflare/ai-gateway.d.ts +1 -2
- package/lib/cloudflare/ai-gateway.d.ts.map +1 -1
- package/lib/cloudflare/ai-gateway.js +2 -2
- package/lib/cloudflare/ai-gateway.js.map +1 -1
- package/lib/cloudflare/api-gateway-operation.d.ts +1 -2
- package/lib/cloudflare/api-gateway-operation.d.ts.map +1 -1
- package/lib/cloudflare/api-gateway-operation.js +2 -2
- package/lib/cloudflare/api-gateway-operation.js.map +1 -1
- package/lib/cloudflare/api-schema.d.ts +1 -2
- package/lib/cloudflare/api-schema.d.ts.map +1 -1
- package/lib/cloudflare/api-schema.js +2 -2
- package/lib/cloudflare/api-schema.js.map +1 -1
- package/lib/cloudflare/api-shield.d.ts +1 -2
- package/lib/cloudflare/api-shield.d.ts.map +1 -1
- package/lib/cloudflare/api-shield.js +2 -2
- package/lib/cloudflare/api-shield.js.map +1 -1
- package/lib/cloudflare/api.d.ts +18 -10
- package/lib/cloudflare/api.d.ts.map +1 -1
- package/lib/cloudflare/api.js +92 -38
- package/lib/cloudflare/api.js.map +1 -1
- package/lib/cloudflare/assets.d.ts +21 -43
- package/lib/cloudflare/assets.d.ts.map +1 -1
- package/lib/cloudflare/assets.js +78 -70
- package/lib/cloudflare/assets.js.map +1 -1
- package/lib/cloudflare/astro/astro.d.ts.map +1 -1
- package/lib/cloudflare/astro/astro.js +3 -3
- package/lib/cloudflare/astro/astro.js.map +1 -1
- package/lib/cloudflare/auth.d.ts +91 -17
- package/lib/cloudflare/auth.d.ts.map +1 -1
- package/lib/cloudflare/auth.js +141 -62
- package/lib/cloudflare/auth.js.map +1 -1
- package/lib/cloudflare/bound.d.ts +1 -1
- package/lib/cloudflare/bound.d.ts.map +1 -1
- package/lib/cloudflare/bucket-object.d.ts +81 -0
- package/lib/cloudflare/bucket-object.d.ts.map +1 -0
- package/lib/cloudflare/bucket-object.js +67 -0
- package/lib/cloudflare/bucket-object.js.map +1 -0
- package/lib/cloudflare/bucket.d.ts +87 -8
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +246 -19
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/bundle/plugin-wasm.js +4 -2
- package/lib/cloudflare/bundle/plugin-wasm.js.map +1 -1
- package/lib/cloudflare/certificate-pack.d.ts +1 -2
- package/lib/cloudflare/certificate-pack.d.ts.map +1 -1
- package/lib/cloudflare/certificate-pack.js +4 -4
- package/lib/cloudflare/certificate-pack.js.map +1 -1
- package/lib/cloudflare/compatibility-date.gen.d.ts +1 -1
- package/lib/cloudflare/compatibility-date.gen.js +1 -1
- package/lib/cloudflare/container.d.ts +1 -2
- package/lib/cloudflare/container.d.ts.map +1 -1
- package/lib/cloudflare/container.js +7 -7
- package/lib/cloudflare/container.js.map +1 -1
- package/lib/cloudflare/custom-domain.d.ts +1 -2
- package/lib/cloudflare/custom-domain.d.ts.map +1 -1
- package/lib/cloudflare/custom-domain.js +2 -2
- package/lib/cloudflare/custom-domain.js.map +1 -1
- package/lib/cloudflare/d1-database.d.ts +2 -3
- package/lib/cloudflare/d1-database.d.ts.map +1 -1
- package/lib/cloudflare/d1-database.js +5 -5
- package/lib/cloudflare/d1-database.js.map +1 -1
- package/lib/cloudflare/dispatch-namespace.d.ts +2 -3
- package/lib/cloudflare/dispatch-namespace.d.ts.map +1 -1
- package/lib/cloudflare/dispatch-namespace.js +3 -3
- package/lib/cloudflare/dispatch-namespace.js.map +1 -1
- package/lib/cloudflare/dns-records.d.ts +1 -2
- package/lib/cloudflare/dns-records.d.ts.map +1 -1
- package/lib/cloudflare/dns-records.js +4 -4
- package/lib/cloudflare/dns-records.js.map +1 -1
- package/lib/cloudflare/email-address.d.ts +1 -2
- package/lib/cloudflare/email-address.d.ts.map +1 -1
- package/lib/cloudflare/email-address.js +6 -6
- package/lib/cloudflare/email-address.js.map +1 -1
- package/lib/cloudflare/email-catch-all.d.ts +1 -2
- package/lib/cloudflare/email-catch-all.d.ts.map +1 -1
- package/lib/cloudflare/email-catch-all.js +4 -4
- package/lib/cloudflare/email-catch-all.js.map +1 -1
- package/lib/cloudflare/email-routing.d.ts +1 -2
- package/lib/cloudflare/email-routing.d.ts.map +1 -1
- package/lib/cloudflare/email-routing.js +4 -4
- package/lib/cloudflare/email-routing.js.map +1 -1
- package/lib/cloudflare/email-rule.d.ts +1 -2
- package/lib/cloudflare/email-rule.d.ts.map +1 -1
- package/lib/cloudflare/email-rule.js +4 -4
- package/lib/cloudflare/email-rule.js.map +1 -1
- package/lib/cloudflare/hyperdrive.d.ts +1 -2
- package/lib/cloudflare/hyperdrive.d.ts.map +1 -1
- package/lib/cloudflare/hyperdrive.js +4 -4
- package/lib/cloudflare/hyperdrive.js.map +1 -1
- package/lib/cloudflare/index.d.ts +1 -0
- package/lib/cloudflare/index.d.ts.map +1 -1
- package/lib/cloudflare/index.js +1 -0
- package/lib/cloudflare/index.js.map +1 -1
- package/lib/cloudflare/kv-namespace.d.ts +2 -3
- package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
- package/lib/cloudflare/kv-namespace.js +5 -5
- package/lib/cloudflare/kv-namespace.js.map +1 -1
- package/lib/cloudflare/miniflare/delete.js +1 -1
- package/lib/cloudflare/miniflare/delete.js.map +1 -1
- package/lib/cloudflare/miniflare/miniflare-worker-proxy.d.ts.map +1 -1
- package/lib/cloudflare/miniflare/miniflare-worker-proxy.js +2 -7
- package/lib/cloudflare/miniflare/miniflare-worker-proxy.js.map +1 -1
- package/lib/cloudflare/miniflare/remote-binding-proxy.d.ts.map +1 -1
- package/lib/cloudflare/miniflare/remote-binding-proxy.js +15 -4
- package/lib/cloudflare/miniflare/remote-binding-proxy.js.map +1 -1
- package/lib/cloudflare/next.js.map +1 -1
- package/lib/cloudflare/nuxt/nuxt.d.ts.map +1 -1
- package/lib/cloudflare/nuxt/nuxt.js +3 -3
- package/lib/cloudflare/nuxt/nuxt.js.map +1 -1
- package/lib/cloudflare/permission-groups.d.ts +1 -2
- package/lib/cloudflare/permission-groups.d.ts.map +1 -1
- package/lib/cloudflare/permission-groups.js +1 -1
- package/lib/cloudflare/permission-groups.js.map +1 -1
- package/lib/cloudflare/pipeline.d.ts +2 -3
- package/lib/cloudflare/pipeline.d.ts.map +1 -1
- package/lib/cloudflare/pipeline.js +5 -5
- package/lib/cloudflare/pipeline.js.map +1 -1
- package/lib/cloudflare/queue-consumer.d.ts +1 -2
- package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
- package/lib/cloudflare/queue-consumer.js +4 -4
- package/lib/cloudflare/queue-consumer.js.map +1 -1
- package/lib/cloudflare/queue.d.ts +1 -2
- package/lib/cloudflare/queue.d.ts.map +1 -1
- package/lib/cloudflare/queue.js +4 -4
- package/lib/cloudflare/queue.js.map +1 -1
- package/lib/cloudflare/react-router/plugin.d.ts.map +1 -1
- package/lib/cloudflare/react-router/plugin.js +13 -0
- package/lib/cloudflare/react-router/plugin.js.map +1 -1
- package/lib/cloudflare/redirect-rule.d.ts +1 -2
- package/lib/cloudflare/redirect-rule.d.ts.map +1 -1
- package/lib/cloudflare/redirect-rule.js +4 -4
- package/lib/cloudflare/redirect-rule.js.map +1 -1
- package/lib/cloudflare/route.d.ts +1 -2
- package/lib/cloudflare/route.d.ts.map +1 -1
- package/lib/cloudflare/route.js +4 -4
- package/lib/cloudflare/route.js.map +1 -1
- package/lib/cloudflare/ruleset.d.ts +1 -2
- package/lib/cloudflare/ruleset.d.ts.map +1 -1
- package/lib/cloudflare/ruleset.js +2 -2
- package/lib/cloudflare/ruleset.js.map +1 -1
- package/lib/cloudflare/secret.d.ts +2 -3
- package/lib/cloudflare/secret.d.ts.map +1 -1
- package/lib/cloudflare/secret.js +3 -3
- package/lib/cloudflare/secret.js.map +1 -1
- package/lib/cloudflare/secrets-store.d.ts +2 -3
- package/lib/cloudflare/secrets-store.d.ts.map +1 -1
- package/lib/cloudflare/secrets-store.js +3 -3
- package/lib/cloudflare/secrets-store.js.map +1 -1
- package/lib/cloudflare/tunnel.d.ts +2 -3
- package/lib/cloudflare/tunnel.d.ts.map +1 -1
- package/lib/cloudflare/tunnel.js +3 -3
- package/lib/cloudflare/tunnel.js.map +1 -1
- package/lib/cloudflare/user.d.ts +3 -2
- package/lib/cloudflare/user.d.ts.map +1 -1
- package/lib/cloudflare/user.js +7 -5
- package/lib/cloudflare/user.js.map +1 -1
- package/lib/cloudflare/vectorize-index.d.ts +2 -3
- package/lib/cloudflare/vectorize-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-index.js +6 -6
- package/lib/cloudflare/vectorize-index.js.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.d.ts +2 -3
- package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.js +4 -4
- package/lib/cloudflare/vectorize-metadata-index.js.map +1 -1
- package/lib/cloudflare/vite/vite.d.ts.map +1 -1
- package/lib/cloudflare/vite/vite.js +3 -3
- package/lib/cloudflare/vite/vite.js.map +1 -1
- package/lib/cloudflare/website.d.ts +7 -1
- package/lib/cloudflare/website.d.ts.map +1 -1
- package/lib/cloudflare/website.js +20 -2
- package/lib/cloudflare/website.js.map +1 -1
- package/lib/cloudflare/worker-assets.d.ts +1 -29
- package/lib/cloudflare/worker-assets.d.ts.map +1 -1
- package/lib/cloudflare/worker-assets.js +9 -42
- package/lib/cloudflare/worker-assets.js.map +1 -1
- package/lib/cloudflare/worker-stub.d.ts +2 -3
- package/lib/cloudflare/worker-stub.d.ts.map +1 -1
- package/lib/cloudflare/worker-stub.js +3 -3
- package/lib/cloudflare/worker-stub.js.map +1 -1
- package/lib/cloudflare/worker-subdomain.d.ts +4 -3
- package/lib/cloudflare/worker-subdomain.d.ts.map +1 -1
- package/lib/cloudflare/worker-subdomain.js +5 -5
- package/lib/cloudflare/worker-subdomain.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +3 -4
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +6 -5
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/wrangler.json.d.ts +27 -8
- package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
- package/lib/cloudflare/wrangler.json.js +3 -1
- package/lib/cloudflare/wrangler.json.js.map +1 -1
- package/lib/cloudflare/zone.d.ts +1 -2
- package/lib/cloudflare/zone.d.ts.map +1 -1
- package/lib/cloudflare/zone.js +2 -2
- package/lib/cloudflare/zone.js.map +1 -1
- package/lib/context.d.ts +8 -8
- package/lib/context.d.ts.map +1 -1
- package/lib/context.js.map +1 -1
- package/lib/destroy.d.ts +1 -1
- package/lib/destroy.d.ts.map +1 -1
- package/lib/destroy.js.map +1 -1
- package/lib/dns/import-dns.d.ts +1 -2
- package/lib/dns/import-dns.d.ts.map +1 -1
- package/lib/dns/import-dns.js +2 -2
- package/lib/dns/import-dns.js.map +1 -1
- package/lib/docker/container.d.ts +1 -2
- package/lib/docker/container.d.ts.map +1 -1
- package/lib/docker/container.js +2 -3
- package/lib/docker/container.js.map +1 -1
- package/lib/docker/image.d.ts +1 -2
- package/lib/docker/image.d.ts.map +1 -1
- package/lib/docker/image.js +9 -9
- package/lib/docker/image.js.map +1 -1
- package/lib/docker/network.d.ts +1 -2
- package/lib/docker/network.d.ts.map +1 -1
- package/lib/docker/network.js +2 -3
- package/lib/docker/network.js.map +1 -1
- package/lib/docker/remote-image.d.ts +1 -2
- package/lib/docker/remote-image.d.ts.map +1 -1
- package/lib/docker/remote-image.js +2 -3
- package/lib/docker/remote-image.js.map +1 -1
- package/lib/docker/volume.d.ts +1 -2
- package/lib/docker/volume.d.ts.map +1 -1
- package/lib/docker/volume.js +2 -3
- package/lib/docker/volume.js.map +1 -1
- package/lib/esbuild/bundle.d.ts +1 -2
- package/lib/esbuild/bundle.d.ts.map +1 -1
- package/lib/esbuild/bundle.js +4 -4
- package/lib/esbuild/bundle.js.map +1 -1
- package/lib/fs/copy-file.d.ts +1 -2
- package/lib/fs/copy-file.d.ts.map +1 -1
- package/lib/fs/copy-file.js +2 -2
- package/lib/fs/copy-file.js.map +1 -1
- package/lib/fs/file.d.ts +1 -2
- package/lib/fs/file.d.ts.map +1 -1
- package/lib/fs/file.js +2 -2
- package/lib/fs/file.js.map +1 -1
- package/lib/fs/folder.d.ts +1 -2
- package/lib/fs/folder.d.ts.map +1 -1
- package/lib/fs/folder.js +2 -2
- package/lib/fs/folder.js.map +1 -1
- package/lib/github/comment.d.ts +1 -2
- package/lib/github/comment.d.ts.map +1 -1
- package/lib/github/comment.js +4 -4
- package/lib/github/comment.js.map +1 -1
- package/lib/github/repository-environment.d.ts +1 -2
- package/lib/github/repository-environment.d.ts.map +1 -1
- package/lib/github/repository-environment.js +2 -2
- package/lib/github/repository-environment.js.map +1 -1
- package/lib/github/repository-webhook.d.ts +1 -2
- package/lib/github/repository-webhook.d.ts.map +1 -1
- package/lib/github/repository-webhook.js +2 -2
- package/lib/github/repository-webhook.js.map +1 -1
- package/lib/github/secret.d.ts +1 -2
- package/lib/github/secret.d.ts.map +1 -1
- package/lib/github/secret.js +2 -2
- package/lib/github/secret.js.map +1 -1
- package/lib/llms.cloudflare.txt +2 -2
- package/lib/neon/api/client.gen.d.ts +13 -0
- package/lib/neon/api/client.gen.d.ts.map +1 -0
- package/lib/neon/api/client.gen.js +7 -0
- package/lib/neon/api/client.gen.js.map +1 -0
- package/lib/neon/api/sdk.gen.d.ts +880 -0
- package/lib/neon/api/sdk.gen.d.ts.map +1 -0
- package/lib/neon/api/sdk.gen.js +1527 -0
- package/lib/neon/api/sdk.gen.js.map +1 -0
- package/lib/neon/api/types.gen.d.ts +7250 -0
- package/lib/neon/api/types.gen.d.ts.map +1 -0
- package/lib/neon/api/types.gen.js +2 -0
- package/lib/neon/api/types.gen.js.map +1 -0
- package/lib/neon/api.d.ts +14 -49
- package/lib/neon/api.d.ts.map +1 -1
- package/lib/neon/api.js +36 -114
- package/lib/neon/api.js.map +1 -1
- package/lib/neon/branch.d.ts +157 -0
- package/lib/neon/branch.d.ts.map +1 -0
- package/lib/neon/branch.js +112 -0
- package/lib/neon/branch.js.map +1 -0
- package/lib/neon/index.d.ts +1 -1
- package/lib/neon/index.d.ts.map +1 -1
- package/lib/neon/index.js +1 -1
- package/lib/neon/index.js.map +1 -1
- package/lib/neon/project.d.ts +49 -243
- package/lib/neon/project.d.ts.map +1 -1
- package/lib/neon/project.js +90 -269
- package/lib/neon/project.js.map +1 -1
- package/lib/neon/utils.d.ts +49 -0
- package/lib/neon/utils.d.ts.map +1 -0
- package/lib/neon/utils.js +44 -0
- package/lib/neon/utils.js.map +1 -0
- package/lib/os/exec.d.ts +1 -2
- package/lib/os/exec.d.ts.map +1 -1
- package/lib/os/exec.js +2 -2
- package/lib/os/exec.js.map +1 -1
- package/lib/planetscale/api/client.gen.d.ts +12 -1749
- package/lib/planetscale/api/client.gen.d.ts.map +1 -1
- package/lib/planetscale/api/client.gen.js +6 -2400
- package/lib/planetscale/api/client.gen.js.map +1 -1
- package/lib/planetscale/api/sdk.gen.d.ts +1582 -0
- package/lib/planetscale/api/sdk.gen.d.ts.map +1 -0
- package/lib/planetscale/api/sdk.gen.js +2219 -0
- package/lib/planetscale/api/sdk.gen.js.map +1 -0
- package/lib/planetscale/api/types.gen.d.ts +594 -449
- package/lib/planetscale/api/types.gen.d.ts.map +1 -1
- package/lib/planetscale/api.d.ts +43 -0
- package/lib/planetscale/api.d.ts.map +1 -0
- package/lib/planetscale/api.js +53 -0
- package/lib/planetscale/api.js.map +1 -0
- package/lib/planetscale/branch.d.ts +2 -3
- package/lib/planetscale/branch.d.ts.map +1 -1
- package/lib/planetscale/branch.js +17 -15
- package/lib/planetscale/branch.js.map +1 -1
- package/lib/planetscale/database.d.ts +2 -3
- package/lib/planetscale/database.d.ts.map +1 -1
- package/lib/planetscale/database.js +34 -34
- package/lib/planetscale/database.js.map +1 -1
- package/lib/planetscale/index.d.ts +1 -1
- package/lib/planetscale/index.d.ts.map +1 -1
- package/lib/planetscale/index.js +1 -1
- package/lib/planetscale/index.js.map +1 -1
- package/lib/planetscale/password.d.ts +2 -3
- package/lib/planetscale/password.d.ts.map +1 -1
- package/lib/planetscale/password.js +11 -11
- package/lib/planetscale/password.js.map +1 -1
- package/lib/planetscale/role.d.ts +2 -3
- package/lib/planetscale/role.d.ts.map +1 -1
- package/lib/planetscale/role.js +18 -18
- package/lib/planetscale/role.js.map +1 -1
- package/lib/planetscale/utils.d.ts +1 -1
- package/lib/planetscale/utils.d.ts.map +1 -1
- package/lib/planetscale/utils.js +17 -33
- package/lib/planetscale/utils.js.map +1 -1
- package/lib/random/random-string.d.ts +1 -2
- package/lib/random/random-string.d.ts.map +1 -1
- package/lib/random/random-string.js +3 -3
- package/lib/random/random-string.js.map +1 -1
- package/lib/resource.d.ts +4 -1
- package/lib/resource.d.ts.map +1 -1
- package/lib/resource.js.map +1 -1
- package/lib/sentry/client-key.d.ts +1 -2
- package/lib/sentry/client-key.d.ts.map +1 -1
- package/lib/sentry/client-key.js +2 -2
- package/lib/sentry/client-key.js.map +1 -1
- package/lib/sentry/project.d.ts +1 -2
- package/lib/sentry/project.d.ts.map +1 -1
- package/lib/sentry/project.js +2 -2
- package/lib/sentry/project.js.map +1 -1
- package/lib/sentry/team.d.ts +1 -2
- package/lib/sentry/team.d.ts.map +1 -1
- package/lib/sentry/team.js +2 -2
- package/lib/sentry/team.js.map +1 -1
- package/lib/serde.d.ts +3 -0
- package/lib/serde.d.ts.map +1 -1
- package/lib/serde.js +40 -0
- package/lib/serde.js.map +1 -1
- package/lib/state/r2-rest-state-store.d.ts +1 -0
- package/lib/state/r2-rest-state-store.d.ts.map +1 -1
- package/lib/state/r2-rest-state-store.js +15 -34
- package/lib/state/r2-rest-state-store.js.map +1 -1
- package/lib/stripe/card.d.ts +1 -2
- package/lib/stripe/card.d.ts.map +1 -1
- package/lib/stripe/card.js +2 -2
- package/lib/stripe/card.js.map +1 -1
- package/lib/stripe/coupon.d.ts +1 -2
- package/lib/stripe/coupon.d.ts.map +1 -1
- package/lib/stripe/coupon.js +2 -2
- package/lib/stripe/coupon.js.map +1 -1
- package/lib/stripe/customer.d.ts +1 -2
- package/lib/stripe/customer.d.ts.map +1 -1
- package/lib/stripe/customer.js +2 -2
- package/lib/stripe/customer.js.map +1 -1
- package/lib/stripe/entitlements-feature.d.ts +1 -2
- package/lib/stripe/entitlements-feature.d.ts.map +1 -1
- package/lib/stripe/entitlements-feature.js +2 -2
- package/lib/stripe/entitlements-feature.js.map +1 -1
- package/lib/stripe/file.d.ts +1 -2
- package/lib/stripe/file.d.ts.map +1 -1
- package/lib/stripe/file.js +2 -2
- package/lib/stripe/file.js.map +1 -1
- package/lib/stripe/meter.d.ts +1 -2
- package/lib/stripe/meter.d.ts.map +1 -1
- package/lib/stripe/meter.js +1 -1
- package/lib/stripe/meter.js.map +1 -1
- package/lib/stripe/portal-configuration.d.ts +1 -2
- package/lib/stripe/portal-configuration.d.ts.map +1 -1
- package/lib/stripe/portal-configuration.js +2 -2
- package/lib/stripe/portal-configuration.js.map +1 -1
- package/lib/stripe/price.d.ts +1 -2
- package/lib/stripe/price.d.ts.map +1 -1
- package/lib/stripe/price.js +2 -2
- package/lib/stripe/price.js.map +1 -1
- package/lib/stripe/product-feature.d.ts +1 -2
- package/lib/stripe/product-feature.d.ts.map +1 -1
- package/lib/stripe/product-feature.js +2 -2
- package/lib/stripe/product-feature.js.map +1 -1
- package/lib/stripe/product.d.ts +1 -2
- package/lib/stripe/product.d.ts.map +1 -1
- package/lib/stripe/product.js +2 -2
- package/lib/stripe/product.js.map +1 -1
- package/lib/stripe/promotion-code.d.ts +1 -2
- package/lib/stripe/promotion-code.d.ts.map +1 -1
- package/lib/stripe/promotion-code.js +2 -2
- package/lib/stripe/promotion-code.js.map +1 -1
- package/lib/stripe/shipping-rate.d.ts +1 -2
- package/lib/stripe/shipping-rate.d.ts.map +1 -1
- package/lib/stripe/shipping-rate.js +2 -2
- package/lib/stripe/shipping-rate.js.map +1 -1
- package/lib/stripe/tax-rate.d.ts +1 -2
- package/lib/stripe/tax-rate.d.ts.map +1 -1
- package/lib/stripe/tax-rate.js +2 -2
- package/lib/stripe/tax-rate.js.map +1 -1
- package/lib/stripe/webhook.d.ts +16 -3
- package/lib/stripe/webhook.d.ts.map +1 -1
- package/lib/stripe/webhook.js +2 -2
- package/lib/stripe/webhook.js.map +1 -1
- package/lib/test/bun.d.ts.map +1 -1
- package/lib/test/bun.js +1 -0
- package/lib/test/bun.js.map +1 -1
- package/lib/test/options.d.ts +5 -0
- package/lib/test/options.d.ts.map +1 -1
- package/lib/test/vitest.d.ts.map +1 -1
- package/lib/test/vitest.js +1 -0
- package/lib/test/vitest.js.map +1 -1
- package/lib/upstash/redis.d.ts +1 -2
- package/lib/upstash/redis.d.ts.map +1 -1
- package/lib/upstash/redis.js.map +1 -1
- package/lib/util/api/client/client.gen.d.ts +3 -0
- package/lib/util/api/client/client.gen.d.ts.map +1 -0
- package/lib/util/api/client/client.gen.js +205 -0
- package/lib/util/api/client/client.gen.js.map +1 -0
- package/lib/util/api/client/index.d.ts +8 -0
- package/lib/util/api/client/index.d.ts.map +1 -0
- package/lib/util/api/client/index.js +6 -0
- package/lib/util/api/client/index.js.map +1 -0
- package/lib/util/api/client/types.gen.d.ts +125 -0
- package/lib/util/api/client/types.gen.d.ts.map +1 -0
- package/lib/util/api/client/types.gen.js +2 -0
- package/lib/util/api/client/types.gen.js.map +1 -0
- package/lib/util/api/client/utils.gen.d.ts +34 -0
- package/lib/util/api/client/utils.gen.d.ts.map +1 -0
- package/lib/util/api/client/utils.gen.js +231 -0
- package/lib/util/api/client/utils.gen.js.map +1 -0
- package/lib/util/api/core/auth.gen.d.ts +19 -0
- package/lib/util/api/core/auth.gen.d.ts.map +1 -0
- package/lib/util/api/core/auth.gen.js +15 -0
- package/lib/util/api/core/auth.gen.js.map +1 -0
- package/lib/util/api/core/bodySerializer.gen.d.ts +18 -0
- package/lib/util/api/core/bodySerializer.gen.d.ts.map +1 -0
- package/lib/util/api/core/bodySerializer.gen.js +58 -0
- package/lib/util/api/core/bodySerializer.gen.js.map +1 -0
- package/lib/util/api/core/params.gen.d.ts +34 -0
- package/lib/util/api/core/params.gen.d.ts.map +1 -0
- package/lib/util/api/core/params.gen.js +89 -0
- package/lib/util/api/core/params.gen.js.map +1 -0
- package/lib/util/api/core/pathSerializer.gen.d.ts +34 -0
- package/lib/util/api/core/pathSerializer.gen.d.ts.map +1 -0
- package/lib/util/api/core/pathSerializer.gen.js +115 -0
- package/lib/util/api/core/pathSerializer.gen.js.map +1 -0
- package/lib/util/api/core/serverSentEvents.gen.d.ts +72 -0
- package/lib/util/api/core/serverSentEvents.gen.d.ts.map +1 -0
- package/lib/util/api/core/serverSentEvents.gen.js +136 -0
- package/lib/util/api/core/serverSentEvents.gen.js.map +1 -0
- package/lib/util/api/core/types.gen.d.ts +79 -0
- package/lib/util/api/core/types.gen.d.ts.map +1 -0
- package/lib/util/api/core/types.gen.js +2 -0
- package/lib/util/api/core/types.gen.js.map +1 -0
- package/lib/util/api/core/utils.gen.d.ts +20 -0
- package/lib/util/api/core/utils.gen.d.ts.map +1 -0
- package/lib/util/api/core/utils.gen.js +88 -0
- package/lib/util/api/core/utils.gen.js.map +1 -0
- package/lib/util/http.d.ts +7 -2
- package/lib/util/http.d.ts.map +1 -1
- package/lib/util/http.js +29 -11
- package/lib/util/http.js.map +1 -1
- package/lib/util/lock.d.ts +20 -0
- package/lib/util/lock.d.ts.map +1 -0
- package/lib/util/lock.js +45 -0
- package/lib/util/lock.js.map +1 -0
- package/lib/util/memoize.d.ts +6 -0
- package/lib/util/memoize.d.ts.map +1 -1
- package/lib/util/memoize.js +23 -0
- package/lib/util/memoize.js.map +1 -1
- package/lib/util/oauth-client.d.ts +71 -0
- package/lib/util/oauth-client.d.ts.map +1 -0
- package/lib/util/oauth-client.js +188 -0
- package/lib/util/oauth-client.js.map +1 -0
- package/lib/util/poll.d.ts +33 -0
- package/lib/util/poll.d.ts.map +1 -0
- package/lib/util/poll.js +19 -0
- package/lib/util/poll.js.map +1 -0
- package/lib/vercel/project-domain.d.ts +1 -2
- package/lib/vercel/project-domain.d.ts.map +1 -1
- package/lib/vercel/project-domain.js.map +1 -1
- package/lib/vercel/project.d.ts +1 -2
- package/lib/vercel/project.d.ts.map +1 -1
- package/lib/vercel/project.js +2 -2
- package/lib/vercel/project.js.map +1 -1
- package/package.json +5 -1
- package/src/apply.ts +32 -29
- package/src/auth.ts +253 -0
- package/src/aws/bucket.ts +3 -3
- package/src/aws/control/properties.ts +554 -39
- package/src/aws/control/resource.ts +62 -6
- package/src/aws/control/types.ts +85281 -84914
- package/src/aws/control/update-types.ts +12917 -0
- package/src/aws/ec2/internet-gateway-attachment.ts +5 -6
- package/src/aws/ec2/internet-gateway.ts +3 -5
- package/src/aws/ec2/nat-gateway.ts +3 -5
- package/src/aws/ec2/route-table-association.ts +3 -5
- package/src/aws/ec2/route-table.ts +3 -5
- package/src/aws/ec2/route.ts +3 -3
- package/src/aws/ec2/security-group-rule.ts +3 -5
- package/src/aws/ec2/security-group.ts +3 -5
- package/src/aws/ec2/subnet.ts +3 -3
- package/src/aws/ec2/vpc.ts +3 -3
- package/src/aws/function.ts +3 -3
- package/src/aws/oidc/oidc-provider.ts +3 -5
- package/src/aws/policy-attachment.ts +2 -4
- package/src/aws/policy.ts +5 -5
- package/src/aws/queue.ts +5 -5
- package/src/aws/role.ts +3 -3
- package/src/aws/ses.ts +3 -3
- package/src/aws/ssm-parameter.ts +3 -3
- package/src/aws/table.ts +3 -3
- package/src/cloudflare/account-api-token.ts +3 -4
- package/src/cloudflare/ai-gateway.ts +3 -5
- package/src/cloudflare/api-gateway-operation.ts +3 -4
- package/src/cloudflare/api-schema.ts +25 -26
- package/src/cloudflare/api-shield.ts +3 -4
- package/src/cloudflare/api.ts +121 -57
- package/src/cloudflare/assets.ts +95 -136
- package/src/cloudflare/astro/astro.ts +8 -3
- package/src/cloudflare/auth.ts +160 -95
- package/src/cloudflare/bound.ts +1 -1
- package/src/cloudflare/bucket-object.ts +117 -0
- package/src/cloudflare/bucket.ts +452 -55
- package/src/cloudflare/bundle/plugin-wasm.ts +5 -5
- package/src/cloudflare/certificate-pack.ts +5 -6
- package/src/cloudflare/compatibility-date.gen.ts +1 -1
- package/src/cloudflare/container.ts +9 -11
- package/src/cloudflare/custom-domain.ts +3 -5
- package/src/cloudflare/d1-database.ts +33 -34
- package/src/cloudflare/dispatch-namespace.ts +5 -6
- package/src/cloudflare/dns-records.ts +5 -5
- package/src/cloudflare/email-address.ts +7 -7
- package/src/cloudflare/email-catch-all.ts +6 -6
- package/src/cloudflare/email-routing.ts +5 -5
- package/src/cloudflare/email-rule.ts +5 -5
- package/src/cloudflare/hyperdrive.ts +35 -36
- package/src/cloudflare/index.ts +1 -0
- package/src/cloudflare/kv-namespace.ts +31 -32
- package/src/cloudflare/miniflare/delete.ts +1 -1
- package/src/cloudflare/miniflare/miniflare-worker-proxy.ts +2 -7
- package/src/cloudflare/miniflare/remote-binding-proxy.ts +16 -4
- package/src/cloudflare/next.ts +2 -2
- package/src/cloudflare/nuxt/nuxt.ts +8 -3
- package/src/cloudflare/permission-groups.ts +4 -6
- package/src/cloudflare/pipeline.ts +29 -30
- package/src/cloudflare/queue-consumer.ts +5 -7
- package/src/cloudflare/queue.ts +42 -43
- package/src/cloudflare/react-router/plugin.ts +20 -0
- package/src/cloudflare/redirect-rule.ts +5 -5
- package/src/cloudflare/route.ts +5 -5
- package/src/cloudflare/ruleset.ts +3 -4
- package/src/cloudflare/secret.ts +35 -36
- package/src/cloudflare/secrets-store.ts +5 -8
- package/src/cloudflare/tunnel.ts +5 -7
- package/src/cloudflare/user.ts +12 -9
- package/src/cloudflare/vectorize-index.ts +8 -12
- package/src/cloudflare/vectorize-metadata-index.ts +6 -8
- package/src/cloudflare/vite/vite.ts +8 -3
- package/src/cloudflare/website.ts +29 -3
- package/src/cloudflare/worker-assets.ts +10 -56
- package/src/cloudflare/worker-stub.ts +5 -5
- package/src/cloudflare/worker-subdomain.ts +6 -7
- package/src/cloudflare/worker.ts +91 -91
- package/src/cloudflare/wrangler.json.ts +32 -17
- package/src/cloudflare/zone.ts +3 -3
- package/src/context.ts +9 -7
- package/src/destroy.ts +2 -2
- package/src/dns/import-dns.ts +3 -5
- package/src/docker/container.ts +3 -6
- package/src/docker/image.ts +13 -13
- package/src/docker/network.ts +3 -4
- package/src/docker/remote-image.ts +3 -6
- package/src/docker/volume.ts +3 -4
- package/src/esbuild/bundle.ts +10 -8
- package/src/fs/copy-file.ts +3 -3
- package/src/fs/file.ts +3 -3
- package/src/fs/folder.ts +3 -3
- package/src/github/comment.ts +5 -7
- package/src/github/repository-environment.ts +3 -5
- package/src/github/repository-webhook.ts +3 -5
- package/src/github/secret.ts +3 -5
- package/src/llms.cloudflare.txt +2 -2
- package/src/neon/api/client.gen.ts +28 -0
- package/src/neon/api/sdk.gen.ts +2596 -0
- package/src/neon/api/types.gen.ts +8287 -0
- package/src/neon/api.ts +51 -147
- package/src/neon/branch.ts +279 -0
- package/src/neon/index.ts +1 -1
- package/src/neon/project.ts +136 -721
- package/src/neon/utils.ts +105 -0
- package/src/os/exec.ts +3 -3
- package/src/planetscale/api/client.gen.ts +28 -2882
- package/src/planetscale/api/sdk.gen.ts +3336 -0
- package/src/planetscale/api/types.gen.ts +778 -450
- package/src/planetscale/api.ts +101 -0
- package/src/planetscale/branch.ts +20 -19
- package/src/planetscale/database.ts +69 -70
- package/src/planetscale/index.ts +1 -1
- package/src/planetscale/password.ts +18 -22
- package/src/planetscale/role.ts +21 -21
- package/src/planetscale/utils.ts +20 -74
- package/src/random/random-string.ts +4 -4
- package/src/resource.ts +6 -2
- package/src/sentry/client-key.ts +3 -5
- package/src/sentry/project.ts +3 -5
- package/src/sentry/team.ts +3 -3
- package/src/serde.ts +50 -0
- package/src/state/r2-rest-state-store.ts +15 -57
- package/src/stripe/card.ts +3 -3
- package/src/stripe/coupon.ts +3 -3
- package/src/stripe/customer.ts +3 -3
- package/src/stripe/entitlements-feature.ts +3 -5
- package/src/stripe/file.ts +3 -3
- package/src/stripe/meter.ts +3 -3
- package/src/stripe/portal-configuration.ts +3 -5
- package/src/stripe/price.ts +3 -3
- package/src/stripe/product-feature.ts +3 -5
- package/src/stripe/product.ts +3 -3
- package/src/stripe/promotion-code.ts +3 -5
- package/src/stripe/shipping-rate.ts +3 -5
- package/src/stripe/tax-rate.ts +3 -3
- package/src/stripe/webhook.ts +3 -5
- package/src/test/bun.ts +2 -1
- package/src/test/options.ts +6 -0
- package/src/test/vitest.ts +1 -0
- package/src/upstash/redis.ts +1 -3
- package/src/util/api/client/client.gen.ts +268 -0
- package/src/util/api/client/index.ts +25 -0
- package/src/util/api/client/types.gen.ts +268 -0
- package/src/util/api/client/utils.gen.ts +331 -0
- package/src/util/api/core/auth.gen.ts +42 -0
- package/src/util/api/core/bodySerializer.gen.ts +92 -0
- package/src/util/api/core/params.gen.ts +153 -0
- package/src/util/api/core/pathSerializer.gen.ts +181 -0
- package/src/util/api/core/serverSentEvents.gen.ts +264 -0
- package/src/util/api/core/types.gen.ts +118 -0
- package/src/util/api/core/utils.gen.ts +143 -0
- package/src/util/http.ts +38 -11
- package/src/util/lock.ts +48 -0
- package/src/util/memoize.ts +26 -0
- package/src/util/oauth-client.ts +238 -0
- package/src/util/poll.ts +55 -0
- package/src/vercel/project-domain.ts +1 -3
- package/src/vercel/project.ts +3 -3
- package/templates/rwsdk/.cursor/rules/alchemy_cloudflare.mdc +2 -2
- package/workers/cloudflare-state-store.js +8 -5619
- package/workers/dofs-state-store.js +2 -802
- package/workers/remote-binding-proxy.js +3 -39
- package/workers/remote-binding-proxy.ts +126 -35
- package/workers/tunnel-proxy.js +6 -73
- package/lib/cloudflare/asset-manifest.d.ts +0 -15
- package/lib/cloudflare/asset-manifest.d.ts.map +0 -1
- package/lib/cloudflare/asset-manifest.js +0 -1
- package/lib/cloudflare/asset-manifest.js.map +0 -1
- package/lib/cloudflare/oauth.d.ts +0 -22
- package/lib/cloudflare/oauth.d.ts.map +0 -1
- package/lib/cloudflare/oauth.js +0 -214
- package/lib/cloudflare/oauth.js.map +0 -1
- package/lib/neon/api-error.d.ts +0 -31
- package/lib/neon/api-error.d.ts.map +0 -1
- package/lib/neon/api-error.js +0 -73
- package/lib/neon/api-error.js.map +0 -1
- package/lib/planetscale/api/index.d.ts +0 -3
- package/lib/planetscale/api/index.d.ts.map +0 -1
- package/lib/planetscale/api/index.js +0 -4
- package/lib/planetscale/api/index.js.map +0 -1
- package/lib/util/neverthrow.d.ts +0 -16
- package/lib/util/neverthrow.d.ts.map +0 -1
- package/lib/util/neverthrow.js +0 -46
- package/lib/util/neverthrow.js.map +0 -1
- package/src/cloudflare/asset-manifest.ts +0 -16
- package/src/cloudflare/oauth.ts +0 -301
- package/src/neon/api-error.ts +0 -81
- package/src/planetscale/api/index.ts +0 -4
- package/src/util/neverthrow.ts +0 -64
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Secret } from "../secret.ts";
|
|
2
|
+
import {
|
|
3
|
+
createClient,
|
|
4
|
+
createConfig,
|
|
5
|
+
type ClientOptions,
|
|
6
|
+
} from "../util/api/client/index.ts";
|
|
7
|
+
import { PlanetScaleClient } from "./api/sdk.gen.ts";
|
|
8
|
+
import type { GeneralError } from "./api/types.gen.ts";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Properties for configuring the PlanetScale API.
|
|
12
|
+
*/
|
|
13
|
+
export interface PlanetScaleProps {
|
|
14
|
+
/**
|
|
15
|
+
* The base URL of the PlanetScale API. Defaults to https://api.planetscale.com/v1.
|
|
16
|
+
*/
|
|
17
|
+
baseUrl?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The ID of the service token to use for authentication. Defaults to the value of the PLANETSCALE_SERVICE_TOKEN_ID environment variable.
|
|
20
|
+
*/
|
|
21
|
+
serviceTokenId?: Secret;
|
|
22
|
+
/**
|
|
23
|
+
* The secret of the service token to use for authentication. Defaults to the value of the PLANETSCALE_SERVICE_TOKEN environment variable.
|
|
24
|
+
*/
|
|
25
|
+
serviceToken?: Secret;
|
|
26
|
+
/**
|
|
27
|
+
* The API key to use for authentication. Defaults to the value of the PLANETSCALE_API_TOKEN environment variable.
|
|
28
|
+
* @deprecated Use serviceTokenId and serviceToken instead.
|
|
29
|
+
*/
|
|
30
|
+
apiKey?: Secret;
|
|
31
|
+
/**
|
|
32
|
+
* The organization to use for authentication. Defaults to the value of the PLANETSCALE_ORGANIZATION or PLANETSCALE_ORG_ID environment variable.
|
|
33
|
+
*/
|
|
34
|
+
organizationId?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class PlanetScaleError extends Error {
|
|
38
|
+
status: number;
|
|
39
|
+
method: string;
|
|
40
|
+
url: string;
|
|
41
|
+
code: string | undefined;
|
|
42
|
+
|
|
43
|
+
constructor(props: {
|
|
44
|
+
error: GeneralError;
|
|
45
|
+
request: Request;
|
|
46
|
+
response: Response;
|
|
47
|
+
}) {
|
|
48
|
+
super(
|
|
49
|
+
`A request to the PlanetScale API failed (${props.response.status}: ${props.error.message}`,
|
|
50
|
+
);
|
|
51
|
+
this.status = props.response.status;
|
|
52
|
+
this.method = props.request.method;
|
|
53
|
+
this.url = props.request.url;
|
|
54
|
+
this.code = props.error.code;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type { PlanetScaleClient };
|
|
59
|
+
|
|
60
|
+
export function createPlanetScaleClient(
|
|
61
|
+
options: PlanetScaleProps = {},
|
|
62
|
+
): PlanetScaleClient {
|
|
63
|
+
const token = extractToken(options);
|
|
64
|
+
const client = createClient(
|
|
65
|
+
createConfig<ClientOptions>({
|
|
66
|
+
baseUrl: options.baseUrl ?? "https://api.planetscale.com/v1",
|
|
67
|
+
headers: {
|
|
68
|
+
Authorization: token, // PlanetScale does not use the Bearer prefix
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
72
|
+
client.interceptors.error.use((error, response, request) => {
|
|
73
|
+
return new PlanetScaleError({
|
|
74
|
+
error: error as GeneralError,
|
|
75
|
+
request,
|
|
76
|
+
response,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
return new PlanetScaleClient({
|
|
80
|
+
client,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const extractToken = (props: PlanetScaleProps) => {
|
|
85
|
+
if (props.apiKey) {
|
|
86
|
+
return props.apiKey.unencrypted;
|
|
87
|
+
} else if (props.serviceTokenId && props.serviceToken) {
|
|
88
|
+
return `${props.serviceTokenId.unencrypted}:${props.serviceToken.unencrypted}`;
|
|
89
|
+
} else if (process.env.PLANETSCALE_API_TOKEN) {
|
|
90
|
+
return process.env.PLANETSCALE_API_TOKEN;
|
|
91
|
+
} else if (
|
|
92
|
+
process.env.PLANETSCALE_SERVICE_TOKEN_ID &&
|
|
93
|
+
process.env.PLANETSCALE_SERVICE_TOKEN
|
|
94
|
+
) {
|
|
95
|
+
return `${process.env.PLANETSCALE_SERVICE_TOKEN_ID}:${process.env.PLANETSCALE_SERVICE_TOKEN}`;
|
|
96
|
+
} else {
|
|
97
|
+
throw new Error(
|
|
98
|
+
"No authentication token provided for PlanetScale. Please provide an API key, service token ID and secret, or set the PLANETSCALE_SERVICE_TOKEN_ID and PLANETSCALE_SERVICE_TOKEN environment variables.",
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Context } from "../context.ts";
|
|
2
2
|
import { Resource } from "../resource.ts";
|
|
3
|
-
import type
|
|
4
|
-
import { PlanetScaleClient } from "./api/client.gen.ts";
|
|
3
|
+
import { createPlanetScaleClient, type PlanetScaleProps } from "./api.ts";
|
|
5
4
|
import {
|
|
6
5
|
ensureProductionBranchClusterSize,
|
|
7
6
|
sanitizeClusterSize,
|
|
@@ -81,7 +80,7 @@ export interface BranchProps extends PlanetScaleProps {
|
|
|
81
80
|
/**
|
|
82
81
|
* Represents a PlanetScale Branch
|
|
83
82
|
*/
|
|
84
|
-
export interface Branch extends
|
|
83
|
+
export interface Branch extends BranchProps {
|
|
85
84
|
/**
|
|
86
85
|
* The name of the branch
|
|
87
86
|
*/
|
|
@@ -156,7 +155,7 @@ export const Branch = Resource(
|
|
|
156
155
|
): Promise<Branch> {
|
|
157
156
|
const adopt = props.adopt ?? this.scope.adopt;
|
|
158
157
|
|
|
159
|
-
const api =
|
|
158
|
+
const api = createPlanetScaleClient(props);
|
|
160
159
|
|
|
161
160
|
const branchName =
|
|
162
161
|
props.name ?? this.output?.name ?? this.scope.createPhysicalName(id);
|
|
@@ -173,16 +172,16 @@ export const Branch = Resource(
|
|
|
173
172
|
|
|
174
173
|
if (this.phase === "delete") {
|
|
175
174
|
if (this.output?.name) {
|
|
176
|
-
const response = await api.
|
|
175
|
+
const response = await api.deleteBranch({
|
|
177
176
|
path: {
|
|
178
177
|
organization: props.organizationId,
|
|
179
178
|
database: props.databaseName,
|
|
180
179
|
name: this.output.name,
|
|
181
180
|
},
|
|
182
|
-
|
|
181
|
+
throwOnError: false,
|
|
183
182
|
});
|
|
184
183
|
|
|
185
|
-
if (response.error && response.
|
|
184
|
+
if (response.error && response.response.status !== 404) {
|
|
186
185
|
throw new Error(
|
|
187
186
|
`Failed to delete branch: ${response.error.message}`,
|
|
188
187
|
{
|
|
@@ -204,16 +203,16 @@ export const Branch = Resource(
|
|
|
204
203
|
}
|
|
205
204
|
|
|
206
205
|
// Check if branch exists
|
|
207
|
-
const getResponse = await api.
|
|
206
|
+
const getResponse = await api.getBranch({
|
|
208
207
|
path: {
|
|
209
208
|
organization: props.organizationId,
|
|
210
209
|
database: props.databaseName,
|
|
211
210
|
name: branchName,
|
|
212
211
|
},
|
|
213
|
-
|
|
212
|
+
throwOnError: false,
|
|
214
213
|
});
|
|
215
214
|
|
|
216
|
-
if (getResponse.error && getResponse.
|
|
215
|
+
if (getResponse.error && getResponse.response.status !== 404) {
|
|
217
216
|
// Error getting branch
|
|
218
217
|
throw new Error(`Failed to get branch: ${getResponse.error.message}`, {
|
|
219
218
|
cause: getResponse.error,
|
|
@@ -251,8 +250,10 @@ export const Branch = Resource(
|
|
|
251
250
|
|
|
252
251
|
// Update mutable properties if they've changed
|
|
253
252
|
if (props.safeMigrations !== undefined) {
|
|
254
|
-
await api
|
|
255
|
-
props.safeMigrations
|
|
253
|
+
await api[
|
|
254
|
+
props.safeMigrations
|
|
255
|
+
? "enableSafeMigrations"
|
|
256
|
+
: "disableSafeMigrations"
|
|
256
257
|
]({
|
|
257
258
|
path: {
|
|
258
259
|
organization: props.organizationId,
|
|
@@ -286,14 +287,14 @@ export const Branch = Resource(
|
|
|
286
287
|
);
|
|
287
288
|
}
|
|
288
289
|
|
|
289
|
-
return
|
|
290
|
+
return {
|
|
290
291
|
...props,
|
|
291
292
|
name: branchName,
|
|
292
293
|
parentBranch: currentParentBranch,
|
|
293
294
|
createdAt: data.created_at,
|
|
294
295
|
updatedAt: data.updated_at,
|
|
295
296
|
htmlUrl: data.html_url,
|
|
296
|
-
}
|
|
297
|
+
};
|
|
297
298
|
}
|
|
298
299
|
let clusterSize: string | undefined;
|
|
299
300
|
const parent = await waitForBranchReady(
|
|
@@ -312,7 +313,7 @@ export const Branch = Resource(
|
|
|
312
313
|
}
|
|
313
314
|
|
|
314
315
|
// Branch doesn't exist, create it
|
|
315
|
-
const data = await api.
|
|
316
|
+
const { data } = await api.createBranch({
|
|
316
317
|
path: {
|
|
317
318
|
organization: props.organizationId,
|
|
318
319
|
database: props.databaseName,
|
|
@@ -336,8 +337,8 @@ export const Branch = Resource(
|
|
|
336
337
|
props.databaseName,
|
|
337
338
|
branchName,
|
|
338
339
|
);
|
|
339
|
-
await api
|
|
340
|
-
props.safeMigrations ? "
|
|
340
|
+
await api[
|
|
341
|
+
props.safeMigrations ? "enableSafeMigrations" : "disableSafeMigrations"
|
|
341
342
|
]({
|
|
342
343
|
path: {
|
|
343
344
|
organization: props.organizationId,
|
|
@@ -359,13 +360,13 @@ export const Branch = Resource(
|
|
|
359
360
|
);
|
|
360
361
|
}
|
|
361
362
|
|
|
362
|
-
return
|
|
363
|
+
return {
|
|
363
364
|
...props,
|
|
364
365
|
name: branchName,
|
|
365
366
|
parentBranch: data.parent_branch,
|
|
366
367
|
createdAt: data.created_at,
|
|
367
368
|
updatedAt: data.updated_at,
|
|
368
369
|
htmlUrl: data.html_url,
|
|
369
|
-
}
|
|
370
|
+
};
|
|
370
371
|
},
|
|
371
372
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Context } from "../context.ts";
|
|
2
2
|
import { Resource } from "../resource.ts";
|
|
3
|
-
import type { PlanetScaleProps } from "./api
|
|
4
|
-
import {
|
|
3
|
+
import type { PlanetScaleProps } from "./api.ts";
|
|
4
|
+
import { createPlanetScaleClient } from "./api.ts";
|
|
5
5
|
import {
|
|
6
6
|
ensureProductionBranchClusterSize,
|
|
7
7
|
type PlanetScaleClusterSize,
|
|
@@ -117,48 +117,47 @@ export type DatabaseProps = BaseDatabaseProps &
|
|
|
117
117
|
/**
|
|
118
118
|
* Represents a PlanetScale Database
|
|
119
119
|
*/
|
|
120
|
-
export type Database =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
id: string;
|
|
120
|
+
export type Database = DatabaseProps & {
|
|
121
|
+
/**
|
|
122
|
+
* The unique identifier of the database
|
|
123
|
+
*/
|
|
124
|
+
id: string;
|
|
126
125
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
/**
|
|
127
|
+
* The name of the database
|
|
128
|
+
*/
|
|
129
|
+
name: string;
|
|
131
130
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
/**
|
|
132
|
+
* The current state of the database
|
|
133
|
+
*/
|
|
134
|
+
state: string;
|
|
136
135
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
/**
|
|
137
|
+
* The default branch name
|
|
138
|
+
*/
|
|
139
|
+
defaultBranch: string;
|
|
141
140
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
/**
|
|
142
|
+
* The plan type
|
|
143
|
+
*/
|
|
144
|
+
plan: string;
|
|
146
145
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Time at which the database was created
|
|
148
|
+
*/
|
|
149
|
+
createdAt: string;
|
|
151
150
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Time at which the database was last updated
|
|
153
|
+
*/
|
|
154
|
+
updatedAt: string;
|
|
156
155
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
/**
|
|
157
|
+
* HTML URL to access the database
|
|
158
|
+
*/
|
|
159
|
+
htmlUrl: string;
|
|
160
|
+
};
|
|
162
161
|
|
|
163
162
|
/**
|
|
164
163
|
* Create, manage and delete PlanetScale databases
|
|
@@ -201,7 +200,7 @@ export const Database = Resource(
|
|
|
201
200
|
id: string,
|
|
202
201
|
props: DatabaseProps,
|
|
203
202
|
): Promise<Database> {
|
|
204
|
-
const api =
|
|
203
|
+
const api = createPlanetScaleClient(props);
|
|
205
204
|
|
|
206
205
|
const databaseName =
|
|
207
206
|
props.name ?? this.output?.name ?? this.scope.createPhysicalName(id);
|
|
@@ -213,7 +212,7 @@ export const Database = Resource(
|
|
|
213
212
|
});
|
|
214
213
|
|
|
215
214
|
if (this.phase === "update" && this.output.name !== databaseName) {
|
|
216
|
-
await api.
|
|
215
|
+
await api.updateDatabaseSettings({
|
|
217
216
|
path: {
|
|
218
217
|
organization: props.organizationId,
|
|
219
218
|
name: this.output.name,
|
|
@@ -224,15 +223,15 @@ export const Database = Resource(
|
|
|
224
223
|
|
|
225
224
|
if (this.phase === "delete") {
|
|
226
225
|
if (this.output?.name) {
|
|
227
|
-
const response = await api.
|
|
226
|
+
const response = await api.deleteDatabase({
|
|
228
227
|
path: {
|
|
229
228
|
organization: props.organizationId,
|
|
230
229
|
name: this.output.name,
|
|
231
230
|
},
|
|
232
|
-
|
|
231
|
+
throwOnError: false,
|
|
233
232
|
});
|
|
234
233
|
|
|
235
|
-
if (response.error && response.
|
|
234
|
+
if (response.error && response.response.status !== 404) {
|
|
236
235
|
throw new Error(`Failed to delete database "${this.output.name}"`, {
|
|
237
236
|
cause: response.error,
|
|
238
237
|
});
|
|
@@ -242,12 +241,12 @@ export const Database = Resource(
|
|
|
242
241
|
}
|
|
243
242
|
|
|
244
243
|
// Check if database exists
|
|
245
|
-
const getResponse = await api.
|
|
244
|
+
const getResponse = await api.getDatabase({
|
|
246
245
|
path: {
|
|
247
246
|
organization: props.organizationId,
|
|
248
247
|
name: databaseName,
|
|
249
248
|
},
|
|
250
|
-
|
|
249
|
+
throwOnError: false,
|
|
251
250
|
});
|
|
252
251
|
if (this.phase === "update" || (props.adopt && getResponse.data)) {
|
|
253
252
|
if (!getResponse.data) {
|
|
@@ -258,20 +257,20 @@ export const Database = Resource(
|
|
|
258
257
|
// Update database settings
|
|
259
258
|
// If updating to a non-'main' default branch, create it first
|
|
260
259
|
if (props.defaultBranch && props.defaultBranch !== "main") {
|
|
261
|
-
const branchResponse = await api.
|
|
260
|
+
const branchResponse = await api.getBranch({
|
|
262
261
|
path: {
|
|
263
262
|
organization: props.organizationId,
|
|
264
263
|
database: databaseName,
|
|
265
264
|
name: props.defaultBranch,
|
|
266
265
|
},
|
|
267
|
-
|
|
266
|
+
throwOnError: false,
|
|
268
267
|
});
|
|
269
268
|
if (!branchResponse.data) {
|
|
270
269
|
await waitForDatabaseReady(api, props.organizationId, databaseName);
|
|
271
270
|
}
|
|
272
|
-
if (branchResponse.error && branchResponse.
|
|
271
|
+
if (branchResponse.error && branchResponse.response.status === 404) {
|
|
273
272
|
// Create the branch
|
|
274
|
-
await api.
|
|
273
|
+
await api.createBranch({
|
|
275
274
|
path: {
|
|
276
275
|
organization: props.organizationId,
|
|
277
276
|
database: databaseName,
|
|
@@ -284,7 +283,7 @@ export const Database = Resource(
|
|
|
284
283
|
}
|
|
285
284
|
}
|
|
286
285
|
|
|
287
|
-
const
|
|
286
|
+
const { data } = await api.updateDatabaseSettings({
|
|
288
287
|
path: {
|
|
289
288
|
organization: props.organizationId,
|
|
290
289
|
name: databaseName,
|
|
@@ -307,21 +306,21 @@ export const Database = Resource(
|
|
|
307
306
|
props.organizationId,
|
|
308
307
|
databaseName,
|
|
309
308
|
props.defaultBranch || "main",
|
|
310
|
-
|
|
309
|
+
data.kind,
|
|
311
310
|
clusterSize,
|
|
312
311
|
);
|
|
313
312
|
|
|
314
|
-
return
|
|
313
|
+
return {
|
|
315
314
|
...props,
|
|
316
|
-
id:
|
|
315
|
+
id: data.id,
|
|
317
316
|
name: databaseName,
|
|
318
|
-
state:
|
|
319
|
-
defaultBranch:
|
|
320
|
-
plan:
|
|
321
|
-
createdAt:
|
|
322
|
-
updatedAt:
|
|
323
|
-
htmlUrl:
|
|
324
|
-
}
|
|
317
|
+
state: data.state,
|
|
318
|
+
defaultBranch: data.default_branch,
|
|
319
|
+
plan: data.plan,
|
|
320
|
+
createdAt: data.created_at,
|
|
321
|
+
updatedAt: data.updated_at,
|
|
322
|
+
htmlUrl: data.html_url,
|
|
323
|
+
};
|
|
325
324
|
}
|
|
326
325
|
|
|
327
326
|
if (getResponse.data) {
|
|
@@ -329,7 +328,7 @@ export const Database = Resource(
|
|
|
329
328
|
}
|
|
330
329
|
|
|
331
330
|
// Create new database
|
|
332
|
-
|
|
331
|
+
await api.createDatabase({
|
|
333
332
|
path: {
|
|
334
333
|
organization: props.organizationId,
|
|
335
334
|
},
|
|
@@ -342,7 +341,7 @@ export const Database = Resource(
|
|
|
342
341
|
});
|
|
343
342
|
|
|
344
343
|
// These settings can't be set on creation, so we need to patch them after creation.
|
|
345
|
-
data = await api.
|
|
344
|
+
const { data } = await api.updateDatabaseSettings({
|
|
346
345
|
path: {
|
|
347
346
|
organization: props.organizationId,
|
|
348
347
|
name: databaseName,
|
|
@@ -364,18 +363,18 @@ export const Database = Resource(
|
|
|
364
363
|
await waitForDatabaseReady(api, props.organizationId, databaseName);
|
|
365
364
|
|
|
366
365
|
// Check if branch exists
|
|
367
|
-
const branchResponse = await api.
|
|
366
|
+
const branchResponse = await api.getBranch({
|
|
368
367
|
path: {
|
|
369
368
|
organization: props.organizationId,
|
|
370
369
|
database: databaseName,
|
|
371
370
|
name: props.defaultBranch,
|
|
372
371
|
},
|
|
373
|
-
|
|
372
|
+
throwOnError: false,
|
|
374
373
|
});
|
|
375
374
|
|
|
376
|
-
if (branchResponse.error && branchResponse.
|
|
375
|
+
if (branchResponse.error && branchResponse.response.status === 404) {
|
|
377
376
|
// Create the branch
|
|
378
|
-
await api.
|
|
377
|
+
await api.createBranch({
|
|
379
378
|
path: {
|
|
380
379
|
organization: props.organizationId,
|
|
381
380
|
database: databaseName,
|
|
@@ -396,7 +395,7 @@ export const Database = Resource(
|
|
|
396
395
|
);
|
|
397
396
|
|
|
398
397
|
// Update database to use new branch as default
|
|
399
|
-
const updatedData = await api.
|
|
398
|
+
const { data: updatedData } = await api.updateDatabaseSettings({
|
|
400
399
|
path: {
|
|
401
400
|
organization: props.organizationId,
|
|
402
401
|
name: databaseName,
|
|
@@ -406,7 +405,7 @@ export const Database = Resource(
|
|
|
406
405
|
},
|
|
407
406
|
});
|
|
408
407
|
|
|
409
|
-
return
|
|
408
|
+
return {
|
|
410
409
|
...props,
|
|
411
410
|
id: data.id,
|
|
412
411
|
name: databaseName,
|
|
@@ -416,11 +415,11 @@ export const Database = Resource(
|
|
|
416
415
|
createdAt: updatedData.created_at,
|
|
417
416
|
updatedAt: updatedData.updated_at,
|
|
418
417
|
htmlUrl: updatedData.html_url,
|
|
419
|
-
}
|
|
418
|
+
};
|
|
420
419
|
}
|
|
421
420
|
}
|
|
422
421
|
|
|
423
|
-
return
|
|
422
|
+
return {
|
|
424
423
|
...props,
|
|
425
424
|
id: data.id,
|
|
426
425
|
name: databaseName,
|
|
@@ -430,6 +429,6 @@ export const Database = Resource(
|
|
|
430
429
|
createdAt: data.created_at,
|
|
431
430
|
updatedAt: data.updated_at,
|
|
432
431
|
htmlUrl: data.html_url,
|
|
433
|
-
}
|
|
432
|
+
};
|
|
434
433
|
},
|
|
435
434
|
);
|
package/src/planetscale/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Context } from "../context.ts";
|
|
|
4
4
|
import { Resource } from "../resource.ts";
|
|
5
5
|
import type { Secret } from "../secret.ts";
|
|
6
6
|
import { lowercaseId } from "../util/nanoid.ts";
|
|
7
|
-
import {
|
|
7
|
+
import { createPlanetScaleClient, type PlanetScaleProps } from "./api.ts";
|
|
8
8
|
import type { Branch } from "./branch.ts";
|
|
9
9
|
import type { Database } from "./database.ts";
|
|
10
10
|
|
|
@@ -62,9 +62,7 @@ export interface PasswordProps extends PlanetScaleProps {
|
|
|
62
62
|
/**
|
|
63
63
|
* Represents a PlanetScale Branch
|
|
64
64
|
*/
|
|
65
|
-
export interface Password
|
|
66
|
-
extends Resource<"planetscale::Password">,
|
|
67
|
-
PasswordProps {
|
|
65
|
+
export interface Password extends PasswordProps {
|
|
68
66
|
/**
|
|
69
67
|
* The unique identifier for the password
|
|
70
68
|
*/
|
|
@@ -267,7 +265,7 @@ export const Password = Resource(
|
|
|
267
265
|
: (this.output?.nameSlug ?? lowercaseId());
|
|
268
266
|
const name = `${(props.name ?? this.output?.name ?? this.scope.createPhysicalName(id)).toLowerCase()}-${nameSlug}`;
|
|
269
267
|
|
|
270
|
-
const api =
|
|
268
|
+
const api = createPlanetScaleClient(props);
|
|
271
269
|
const database =
|
|
272
270
|
typeof props.database === "string" ? props.database : props.database.name;
|
|
273
271
|
const branch =
|
|
@@ -285,19 +283,17 @@ export const Password = Resource(
|
|
|
285
283
|
|
|
286
284
|
if (this.phase === "delete") {
|
|
287
285
|
if (this.output?.id) {
|
|
288
|
-
const res = await api.
|
|
289
|
-
{
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
id: this.output.id,
|
|
295
|
-
},
|
|
296
|
-
result: "full",
|
|
286
|
+
const res = await api.deletePassword({
|
|
287
|
+
path: {
|
|
288
|
+
organization,
|
|
289
|
+
database,
|
|
290
|
+
branch,
|
|
291
|
+
id: this.output.id,
|
|
297
292
|
},
|
|
298
|
-
|
|
293
|
+
throwOnError: false,
|
|
294
|
+
});
|
|
299
295
|
|
|
300
|
-
if (res.error && res.
|
|
296
|
+
if (res.error && res.response.status !== 404) {
|
|
301
297
|
throw new Error(`Failed to delete branch "${branch}"`, {
|
|
302
298
|
cause: res.error,
|
|
303
299
|
});
|
|
@@ -314,7 +310,7 @@ export const Password = Resource(
|
|
|
314
310
|
) {
|
|
315
311
|
return this.replace();
|
|
316
312
|
}
|
|
317
|
-
await api.
|
|
313
|
+
await api.updatePassword({
|
|
318
314
|
path: {
|
|
319
315
|
organization,
|
|
320
316
|
database,
|
|
@@ -327,14 +323,14 @@ export const Password = Resource(
|
|
|
327
323
|
},
|
|
328
324
|
});
|
|
329
325
|
|
|
330
|
-
return
|
|
326
|
+
return {
|
|
331
327
|
...this.output,
|
|
332
328
|
...props,
|
|
333
329
|
name,
|
|
334
|
-
}
|
|
330
|
+
};
|
|
335
331
|
}
|
|
336
332
|
|
|
337
|
-
const data = await api.
|
|
333
|
+
const { data } = await api.createPassword({
|
|
338
334
|
path: {
|
|
339
335
|
organization,
|
|
340
336
|
database,
|
|
@@ -349,7 +345,7 @@ export const Password = Resource(
|
|
|
349
345
|
},
|
|
350
346
|
});
|
|
351
347
|
|
|
352
|
-
return
|
|
348
|
+
return {
|
|
353
349
|
id: data.id,
|
|
354
350
|
expiresAt: data.expires_at,
|
|
355
351
|
host: data.access_host_url,
|
|
@@ -358,7 +354,7 @@ export const Password = Resource(
|
|
|
358
354
|
nameSlug,
|
|
359
355
|
...props,
|
|
360
356
|
name: `${props.name}-${nameSlug}`,
|
|
361
|
-
}
|
|
357
|
+
};
|
|
362
358
|
},
|
|
363
359
|
);
|
|
364
360
|
|