@alchemy.run/modal 0.0.0 → 2.0.0-beta.87
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 +201 -0
- package/README.md +96 -4
- package/lib/App.d.ts +143 -0
- package/lib/App.d.ts.map +1 -0
- package/lib/App.js +198 -0
- package/lib/App.js.map +1 -0
- package/lib/AuthProvider.d.ts +53 -0
- package/lib/AuthProvider.d.ts.map +1 -0
- package/lib/AuthProvider.js +209 -0
- package/lib/AuthProvider.js.map +1 -0
- package/lib/BindingHttp.d.ts +56 -0
- package/lib/BindingHttp.d.ts.map +1 -0
- package/lib/BindingHttp.js +50 -0
- package/lib/BindingHttp.js.map +1 -0
- package/lib/Blob.d.ts +34 -0
- package/lib/Blob.d.ts.map +1 -0
- package/lib/Blob.js +59 -0
- package/lib/Blob.js.map +1 -0
- package/lib/Bootstrap.d.ts +8 -0
- package/lib/Bootstrap.d.ts.map +1 -0
- package/lib/Bootstrap.js +26 -0
- package/lib/Bootstrap.js.map +1 -0
- package/lib/Cbor.d.ts +10 -0
- package/lib/Cbor.d.ts.map +1 -0
- package/lib/Cbor.js +177 -0
- package/lib/Cbor.js.map +1 -0
- package/lib/ConnectSandbox.d.ts +64 -0
- package/lib/ConnectSandbox.d.ts.map +1 -0
- package/lib/ConnectSandbox.js +33 -0
- package/lib/ConnectSandbox.js.map +1 -0
- package/lib/Container.d.ts +124 -0
- package/lib/Container.d.ts.map +1 -0
- package/lib/Container.js +1 -0
- package/lib/Container.js.map +1 -0
- package/lib/Contributions.d.ts +7 -0
- package/lib/Contributions.d.ts.map +1 -0
- package/lib/Contributions.js +6 -0
- package/lib/Contributions.js.map +1 -0
- package/lib/CreateDict.d.ts +83 -0
- package/lib/CreateDict.d.ts.map +1 -0
- package/lib/CreateDict.js +3 -0
- package/lib/CreateDict.js.map +1 -0
- package/lib/CreateDictHttp.d.ts +33 -0
- package/lib/CreateDictHttp.d.ts.map +1 -0
- package/lib/CreateDictHttp.js +67 -0
- package/lib/CreateDictHttp.js.map +1 -0
- package/lib/CreateImage.d.ts +98 -0
- package/lib/CreateImage.d.ts.map +1 -0
- package/lib/CreateImage.js +3 -0
- package/lib/CreateImage.js.map +1 -0
- package/lib/CreateImageHttp.d.ts +51 -0
- package/lib/CreateImageHttp.d.ts.map +1 -0
- package/lib/CreateImageHttp.js +87 -0
- package/lib/CreateImageHttp.js.map +1 -0
- package/lib/CreateQueue.d.ts +83 -0
- package/lib/CreateQueue.d.ts.map +1 -0
- package/lib/CreateQueue.js +3 -0
- package/lib/CreateQueue.js.map +1 -0
- package/lib/CreateQueueHttp.d.ts +31 -0
- package/lib/CreateQueueHttp.d.ts.map +1 -0
- package/lib/CreateQueueHttp.js +67 -0
- package/lib/CreateQueueHttp.js.map +1 -0
- package/lib/CreateSandbox.d.ts +186 -0
- package/lib/CreateSandbox.d.ts.map +1 -0
- package/lib/CreateSandbox.js +3 -0
- package/lib/CreateSandbox.js.map +1 -0
- package/lib/CreateSandboxHttp.d.ts +17 -0
- package/lib/CreateSandboxHttp.d.ts.map +1 -0
- package/lib/CreateSandboxHttp.js +117 -0
- package/lib/CreateSandboxHttp.js.map +1 -0
- package/lib/CreateSecret.d.ts +95 -0
- package/lib/CreateSecret.d.ts.map +1 -0
- package/lib/CreateSecret.js +3 -0
- package/lib/CreateSecret.js.map +1 -0
- package/lib/CreateSecretHttp.d.ts +24 -0
- package/lib/CreateSecretHttp.d.ts.map +1 -0
- package/lib/CreateSecretHttp.js +60 -0
- package/lib/CreateSecretHttp.js.map +1 -0
- package/lib/CreateVolume.d.ts +84 -0
- package/lib/CreateVolume.d.ts.map +1 -0
- package/lib/CreateVolume.js +3 -0
- package/lib/CreateVolume.js.map +1 -0
- package/lib/CreateVolumeHttp.d.ts +32 -0
- package/lib/CreateVolumeHttp.d.ts.map +1 -0
- package/lib/CreateVolumeHttp.js +69 -0
- package/lib/CreateVolumeHttp.js.map +1 -0
- package/lib/Credentials.d.ts +32 -0
- package/lib/Credentials.d.ts.map +1 -0
- package/lib/Credentials.js +44 -0
- package/lib/Credentials.js.map +1 -0
- package/lib/Dict.d.ts +147 -0
- package/lib/Dict.d.ts.map +1 -0
- package/lib/Dict.js +175 -0
- package/lib/Dict.js.map +1 -0
- package/lib/DictClient.d.ts +55 -0
- package/lib/DictClient.d.ts.map +1 -0
- package/lib/DictClient.js +89 -0
- package/lib/DictClient.js.map +1 -0
- package/lib/Domain.d.ts +86 -0
- package/lib/Domain.d.ts.map +1 -0
- package/lib/Domain.js +113 -0
- package/lib/Domain.js.map +1 -0
- package/lib/Endpoint.d.ts +181 -0
- package/lib/Endpoint.d.ts.map +1 -0
- package/lib/Endpoint.js +283 -0
- package/lib/Endpoint.js.map +1 -0
- package/lib/Environment.d.ts +174 -0
- package/lib/Environment.d.ts.map +1 -0
- package/lib/Environment.js +244 -0
- package/lib/Environment.js.map +1 -0
- package/lib/FetchServer.d.ts +105 -0
- package/lib/FetchServer.d.ts.map +1 -0
- package/lib/FetchServer.js +3 -0
- package/lib/FetchServer.js.map +1 -0
- package/lib/FetchServerHttp.d.ts +21 -0
- package/lib/FetchServerHttp.d.ts.map +1 -0
- package/lib/FetchServerHttp.js +84 -0
- package/lib/FetchServerHttp.js.map +1 -0
- package/lib/Function.d.ts +236 -0
- package/lib/Function.d.ts.map +1 -0
- package/lib/Function.js +273 -0
- package/lib/Function.js.map +1 -0
- package/lib/FunctionAutoscaler.d.ts +99 -0
- package/lib/FunctionAutoscaler.d.ts.map +1 -0
- package/lib/FunctionAutoscaler.js +136 -0
- package/lib/FunctionAutoscaler.js.map +1 -0
- package/lib/FunctionTarget.d.ts +61 -0
- package/lib/FunctionTarget.d.ts.map +1 -0
- package/lib/FunctionTarget.js +136 -0
- package/lib/FunctionTarget.js.map +1 -0
- package/lib/Image.d.ts +159 -0
- package/lib/Image.d.ts.map +1 -0
- package/lib/Image.js +203 -0
- package/lib/Image.js.map +1 -0
- package/lib/ImageBuild.d.ts +108 -0
- package/lib/ImageBuild.d.ts.map +1 -0
- package/lib/ImageBuild.js +157 -0
- package/lib/ImageBuild.js.map +1 -0
- package/lib/ImagePlan.d.ts +31 -0
- package/lib/ImagePlan.d.ts.map +1 -0
- package/lib/ImagePlan.js +70 -0
- package/lib/ImagePlan.js.map +1 -0
- package/lib/InferEnv.d.ts +26 -0
- package/lib/InferEnv.d.ts.map +1 -0
- package/lib/InferEnv.js +1 -0
- package/lib/InferEnv.js.map +1 -0
- package/lib/InvokeFunction.d.ts +186 -0
- package/lib/InvokeFunction.d.ts.map +1 -0
- package/lib/InvokeFunction.js +10 -0
- package/lib/InvokeFunction.js.map +1 -0
- package/lib/InvokeFunctionHttp.d.ts +39 -0
- package/lib/InvokeFunctionHttp.d.ts.map +1 -0
- package/lib/InvokeFunctionHttp.js +210 -0
- package/lib/InvokeFunctionHttp.js.map +1 -0
- package/lib/ModalBindings.d.ts +138 -0
- package/lib/ModalBindings.d.ts.map +1 -0
- package/lib/ModalBindings.js +223 -0
- package/lib/ModalBindings.js.map +1 -0
- package/lib/MountBucket.d.ts +80 -0
- package/lib/MountBucket.d.ts.map +1 -0
- package/lib/MountBucket.js +44 -0
- package/lib/MountBucket.js.map +1 -0
- package/lib/MountVolume.d.ts +77 -0
- package/lib/MountVolume.d.ts.map +1 -0
- package/lib/MountVolume.js +41 -0
- package/lib/MountVolume.js.map +1 -0
- package/lib/Mounts.d.ts +134 -0
- package/lib/Mounts.d.ts.map +1 -0
- package/lib/Mounts.js +87 -0
- package/lib/Mounts.js.map +1 -0
- package/lib/PersistentSandbox.d.ts +75 -0
- package/lib/PersistentSandbox.d.ts.map +1 -0
- package/lib/PersistentSandbox.js +93 -0
- package/lib/PersistentSandbox.js.map +1 -0
- package/lib/Providers.d.ts +23 -0
- package/lib/Providers.d.ts.map +1 -0
- package/lib/Providers.js +64 -0
- package/lib/Providers.js.map +1 -0
- package/lib/Proxy.d.ts +94 -0
- package/lib/Proxy.d.ts.map +1 -0
- package/lib/Proxy.js +132 -0
- package/lib/Proxy.js.map +1 -0
- package/lib/Queue.d.ts +147 -0
- package/lib/Queue.d.ts.map +1 -0
- package/lib/Queue.js +177 -0
- package/lib/Queue.js.map +1 -0
- package/lib/QueueClient.d.ts +64 -0
- package/lib/QueueClient.d.ts.map +1 -0
- package/lib/QueueClient.js +73 -0
- package/lib/QueueClient.js.map +1 -0
- package/lib/ReadApp.d.ts +85 -0
- package/lib/ReadApp.d.ts.map +1 -0
- package/lib/ReadApp.js +3 -0
- package/lib/ReadApp.js.map +1 -0
- package/lib/ReadAppHttp.d.ts +26 -0
- package/lib/ReadAppHttp.d.ts.map +1 -0
- package/lib/ReadAppHttp.js +106 -0
- package/lib/ReadAppHttp.js.map +1 -0
- package/lib/ReadDict.d.ts +39 -0
- package/lib/ReadDict.d.ts.map +1 -0
- package/lib/ReadDict.js +3 -0
- package/lib/ReadDict.js.map +1 -0
- package/lib/ReadDictHttp.d.ts +12 -0
- package/lib/ReadDictHttp.d.ts.map +1 -0
- package/lib/ReadDictHttp.js +23 -0
- package/lib/ReadDictHttp.js.map +1 -0
- package/lib/ReadFunction.d.ts +73 -0
- package/lib/ReadFunction.d.ts.map +1 -0
- package/lib/ReadFunction.js +3 -0
- package/lib/ReadFunction.js.map +1 -0
- package/lib/ReadFunctionHttp.d.ts +25 -0
- package/lib/ReadFunctionHttp.d.ts.map +1 -0
- package/lib/ReadFunctionHttp.js +63 -0
- package/lib/ReadFunctionHttp.js.map +1 -0
- package/lib/ReadQueue.d.ts +39 -0
- package/lib/ReadQueue.d.ts.map +1 -0
- package/lib/ReadQueue.js +3 -0
- package/lib/ReadQueue.js.map +1 -0
- package/lib/ReadQueueHttp.d.ts +12 -0
- package/lib/ReadQueueHttp.d.ts.map +1 -0
- package/lib/ReadQueueHttp.js +23 -0
- package/lib/ReadQueueHttp.js.map +1 -0
- package/lib/ReadServer.d.ts +72 -0
- package/lib/ReadServer.d.ts.map +1 -0
- package/lib/ReadServer.js +3 -0
- package/lib/ReadServer.js.map +1 -0
- package/lib/ReadServerHttp.d.ts +25 -0
- package/lib/ReadServerHttp.d.ts.map +1 -0
- package/lib/ReadServerHttp.js +70 -0
- package/lib/ReadServerHttp.js.map +1 -0
- package/lib/ReadVolume.d.ts +40 -0
- package/lib/ReadVolume.d.ts.map +1 -0
- package/lib/ReadVolume.js +3 -0
- package/lib/ReadVolume.js.map +1 -0
- package/lib/ReadVolumeHttp.d.ts +12 -0
- package/lib/ReadVolumeHttp.d.ts.map +1 -0
- package/lib/ReadVolumeHttp.js +24 -0
- package/lib/ReadVolumeHttp.js.map +1 -0
- package/lib/ReadWriteDict.d.ts +39 -0
- package/lib/ReadWriteDict.d.ts.map +1 -0
- package/lib/ReadWriteDict.js +3 -0
- package/lib/ReadWriteDict.js.map +1 -0
- package/lib/ReadWriteDictHttp.d.ts +12 -0
- package/lib/ReadWriteDictHttp.d.ts.map +1 -0
- package/lib/ReadWriteDictHttp.js +23 -0
- package/lib/ReadWriteDictHttp.js.map +1 -0
- package/lib/ReadWriteQueue.d.ts +40 -0
- package/lib/ReadWriteQueue.d.ts.map +1 -0
- package/lib/ReadWriteQueue.js +3 -0
- package/lib/ReadWriteQueue.js.map +1 -0
- package/lib/ReadWriteQueueHttp.d.ts +12 -0
- package/lib/ReadWriteQueueHttp.d.ts.map +1 -0
- package/lib/ReadWriteQueueHttp.js +23 -0
- package/lib/ReadWriteQueueHttp.js.map +1 -0
- package/lib/ReadWriteVolume.d.ts +40 -0
- package/lib/ReadWriteVolume.d.ts.map +1 -0
- package/lib/ReadWriteVolume.js +3 -0
- package/lib/ReadWriteVolume.js.map +1 -0
- package/lib/ReadWriteVolumeHttp.d.ts +12 -0
- package/lib/ReadWriteVolumeHttp.d.ts.map +1 -0
- package/lib/ReadWriteVolumeHttp.js +24 -0
- package/lib/ReadWriteVolumeHttp.js.map +1 -0
- package/lib/RuntimeOwner.d.ts +39 -0
- package/lib/RuntimeOwner.d.ts.map +1 -0
- package/lib/RuntimeOwner.js +85 -0
- package/lib/RuntimeOwner.js.map +1 -0
- package/lib/Sandbox.d.ts +215 -0
- package/lib/Sandbox.d.ts.map +1 -0
- package/lib/Sandbox.js +278 -0
- package/lib/Sandbox.js.map +1 -0
- package/lib/SandboxClient.d.ts +748 -0
- package/lib/SandboxClient.d.ts.map +1 -0
- package/lib/SandboxClient.js +710 -0
- package/lib/SandboxClient.js.map +1 -0
- package/lib/ScaleFunction.d.ts +54 -0
- package/lib/ScaleFunction.d.ts.map +1 -0
- package/lib/ScaleFunction.js +3 -0
- package/lib/ScaleFunction.js.map +1 -0
- package/lib/ScaleFunctionHttp.d.ts +21 -0
- package/lib/ScaleFunctionHttp.d.ts.map +1 -0
- package/lib/ScaleFunctionHttp.js +39 -0
- package/lib/ScaleFunctionHttp.js.map +1 -0
- package/lib/Secret.d.ts +170 -0
- package/lib/Secret.d.ts.map +1 -0
- package/lib/Secret.js +196 -0
- package/lib/Secret.js.map +1 -0
- package/lib/Server.d.ts +155 -0
- package/lib/Server.d.ts.map +1 -0
- package/lib/Server.js +184 -0
- package/lib/Server.js.map +1 -0
- package/lib/ServiceUser.d.ts +139 -0
- package/lib/ServiceUser.d.ts.map +1 -0
- package/lib/ServiceUser.js +210 -0
- package/lib/ServiceUser.js.map +1 -0
- package/lib/Volume.d.ts +170 -0
- package/lib/Volume.d.ts.map +1 -0
- package/lib/Volume.js +220 -0
- package/lib/Volume.js.map +1 -0
- package/lib/VolumeClient.d.ts +53 -0
- package/lib/VolumeClient.d.ts.map +1 -0
- package/lib/VolumeClient.js +22 -0
- package/lib/VolumeClient.js.map +1 -0
- package/lib/VolumeFiles.d.ts +94 -0
- package/lib/VolumeFiles.d.ts.map +1 -0
- package/lib/VolumeFiles.js +139 -0
- package/lib/VolumeFiles.js.map +1 -0
- package/lib/WebhookToken.d.ts +102 -0
- package/lib/WebhookToken.d.ts.map +1 -0
- package/lib/WebhookToken.js +176 -0
- package/lib/WebhookToken.js.map +1 -0
- package/lib/WorkspaceSettings.d.ts +70 -0
- package/lib/WorkspaceSettings.d.ts.map +1 -0
- package/lib/WorkspaceSettings.js +105 -0
- package/lib/WorkspaceSettings.js.map +1 -0
- package/lib/WriteApp.d.ts +38 -0
- package/lib/WriteApp.d.ts.map +1 -0
- package/lib/WriteApp.js +3 -0
- package/lib/WriteApp.js.map +1 -0
- package/lib/WriteAppHttp.d.ts +23 -0
- package/lib/WriteAppHttp.d.ts.map +1 -0
- package/lib/WriteAppHttp.js +36 -0
- package/lib/WriteAppHttp.js.map +1 -0
- package/lib/WriteDict.d.ts +39 -0
- package/lib/WriteDict.d.ts.map +1 -0
- package/lib/WriteDict.js +3 -0
- package/lib/WriteDict.js.map +1 -0
- package/lib/WriteDictHttp.d.ts +12 -0
- package/lib/WriteDictHttp.d.ts.map +1 -0
- package/lib/WriteDictHttp.js +23 -0
- package/lib/WriteDictHttp.js.map +1 -0
- package/lib/WriteQueue.d.ts +39 -0
- package/lib/WriteQueue.d.ts.map +1 -0
- package/lib/WriteQueue.js +3 -0
- package/lib/WriteQueue.js.map +1 -0
- package/lib/WriteQueueHttp.d.ts +12 -0
- package/lib/WriteQueueHttp.d.ts.map +1 -0
- package/lib/WriteQueueHttp.js +23 -0
- package/lib/WriteQueueHttp.js.map +1 -0
- package/lib/WriteSecret.d.ts +53 -0
- package/lib/WriteSecret.d.ts.map +1 -0
- package/lib/WriteSecret.js +3 -0
- package/lib/WriteSecret.js.map +1 -0
- package/lib/WriteSecretHttp.d.ts +23 -0
- package/lib/WriteSecretHttp.d.ts.map +1 -0
- package/lib/WriteSecretHttp.js +44 -0
- package/lib/WriteSecretHttp.js.map +1 -0
- package/lib/WriteVolume.d.ts +39 -0
- package/lib/WriteVolume.d.ts.map +1 -0
- package/lib/WriteVolume.js +3 -0
- package/lib/WriteVolume.js.map +1 -0
- package/lib/WriteVolumeHttp.d.ts +12 -0
- package/lib/WriteVolumeHttp.d.ts.map +1 -0
- package/lib/WriteVolumeHttp.js +24 -0
- package/lib/WriteVolumeHttp.js.map +1 -0
- package/lib/index.d.ts +80 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +78 -0
- package/lib/index.js.map +1 -0
- package/lib/internal/Declared.d.ts +29 -0
- package/lib/internal/Declared.d.ts.map +1 -0
- package/lib/internal/Declared.js +31 -0
- package/lib/internal/Declared.js.map +1 -0
- package/lib/internal/Deploy.d.ts +110 -0
- package/lib/internal/Deploy.d.ts.map +1 -0
- package/lib/internal/Deploy.js +230 -0
- package/lib/internal/Deploy.js.map +1 -0
- package/lib/internal/Entrypoint.d.ts +52 -0
- package/lib/internal/Entrypoint.d.ts.map +1 -0
- package/lib/internal/Entrypoint.js +193 -0
- package/lib/internal/Entrypoint.js.map +1 -0
- package/lib/internal/Rpc.d.ts +17 -0
- package/lib/internal/Rpc.d.ts.map +1 -0
- package/lib/internal/Rpc.js +49 -0
- package/lib/internal/Rpc.js.map +1 -0
- package/lib/internal/RpcAuth.d.ts +41 -0
- package/lib/internal/RpcAuth.d.ts.map +1 -0
- package/lib/internal/RpcAuth.js +100 -0
- package/lib/internal/RpcAuth.js.map +1 -0
- package/lib/internal/Runtime.d.ts +127 -0
- package/lib/internal/Runtime.d.ts.map +1 -0
- package/lib/internal/Runtime.js +246 -0
- package/lib/internal/Runtime.js.map +1 -0
- package/lib/internal/Tags.d.ts +19 -0
- package/lib/internal/Tags.d.ts.map +1 -0
- package/lib/internal/Tags.js +33 -0
- package/lib/internal/Tags.js.map +1 -0
- package/lib/internal/TcpConnect.d.ts +12 -0
- package/lib/internal/TcpConnect.d.ts.map +1 -0
- package/lib/internal/TcpConnect.js +46 -0
- package/lib/internal/TcpConnect.js.map +1 -0
- package/lib/internal/Transport.d.ts +13 -0
- package/lib/internal/Transport.d.ts.map +1 -0
- package/lib/internal/Transport.js +16 -0
- package/lib/internal/Transport.js.map +1 -0
- package/lib/internal.d.ts +71 -0
- package/lib/internal.d.ts.map +1 -0
- package/lib/internal.js +102 -0
- package/lib/internal.js.map +1 -0
- package/package.json +59 -3
- package/src/App.ts +262 -0
- package/src/AuthProvider.ts +295 -0
- package/src/BindingHttp.ts +112 -0
- package/src/Blob.ts +71 -0
- package/src/Bootstrap.ts +52 -0
- package/src/Cbor.ts +158 -0
- package/src/ConnectSandbox.ts +99 -0
- package/src/Container.ts +121 -0
- package/src/Contributions.ts +9 -0
- package/src/CreateDict.ts +95 -0
- package/src/CreateDictHttp.ts +91 -0
- package/src/CreateImage.ts +105 -0
- package/src/CreateImageHttp.ts +117 -0
- package/src/CreateQueue.ts +95 -0
- package/src/CreateQueueHttp.ts +91 -0
- package/src/CreateSandbox.ts +228 -0
- package/src/CreateSandboxHttp.ts +160 -0
- package/src/CreateSecret.ts +109 -0
- package/src/CreateSecretHttp.ts +83 -0
- package/src/CreateVolume.ts +96 -0
- package/src/CreateVolumeHttp.ts +93 -0
- package/src/Credentials.ts +74 -0
- package/src/Dict.ts +245 -0
- package/src/DictClient.ts +166 -0
- package/src/Domain.ts +147 -0
- package/src/Endpoint.ts +406 -0
- package/src/Environment.ts +373 -0
- package/src/FetchServer.ts +126 -0
- package/src/FetchServerHttp.ts +110 -0
- package/src/Function.ts +397 -0
- package/src/FunctionAutoscaler.ts +210 -0
- package/src/FunctionTarget.ts +181 -0
- package/src/Image.ts +281 -0
- package/src/ImageBuild.ts +228 -0
- package/src/ImagePlan.ts +78 -0
- package/src/InferEnv.ts +27 -0
- package/src/InvokeFunction.ts +211 -0
- package/src/InvokeFunctionHttp.ts +316 -0
- package/src/ModalBindings.ts +310 -0
- package/src/MountBucket.ts +137 -0
- package/src/MountVolume.ts +113 -0
- package/src/Mounts.ts +230 -0
- package/src/PersistentSandbox.ts +142 -0
- package/src/Providers.ts +100 -0
- package/src/Proxy.ts +191 -0
- package/src/Queue.ts +258 -0
- package/src/QueueClient.ts +149 -0
- package/src/ReadApp.ts +101 -0
- package/src/ReadAppHttp.ts +142 -0
- package/src/ReadDict.ts +44 -0
- package/src/ReadDictHttp.ts +27 -0
- package/src/ReadFunction.ts +107 -0
- package/src/ReadFunctionHttp.ts +91 -0
- package/src/ReadQueue.ts +44 -0
- package/src/ReadQueueHttp.ts +27 -0
- package/src/ReadServer.ts +98 -0
- package/src/ReadServerHttp.ts +101 -0
- package/src/ReadVolume.ts +45 -0
- package/src/ReadVolumeHttp.ts +28 -0
- package/src/ReadWriteDict.ts +44 -0
- package/src/ReadWriteDictHttp.ts +27 -0
- package/src/ReadWriteQueue.ts +45 -0
- package/src/ReadWriteQueueHttp.ts +27 -0
- package/src/ReadWriteVolume.ts +45 -0
- package/src/ReadWriteVolumeHttp.ts +28 -0
- package/src/RuntimeOwner.ts +111 -0
- package/src/Sandbox.ts +402 -0
- package/src/SandboxClient.ts +1404 -0
- package/src/ScaleFunction.ts +70 -0
- package/src/ScaleFunctionHttp.ts +54 -0
- package/src/Secret.ts +296 -0
- package/src/Server.ts +285 -0
- package/src/ServiceUser.ts +295 -0
- package/src/Volume.ts +320 -0
- package/src/VolumeClient.ts +108 -0
- package/src/VolumeFiles.ts +194 -0
- package/src/WebhookToken.ts +230 -0
- package/src/WorkspaceSettings.ts +160 -0
- package/src/WriteApp.ts +43 -0
- package/src/WriteAppHttp.ts +51 -0
- package/src/WriteDict.ts +44 -0
- package/src/WriteDictHttp.ts +27 -0
- package/src/WriteQueue.ts +44 -0
- package/src/WriteQueueHttp.ts +27 -0
- package/src/WriteSecret.ts +60 -0
- package/src/WriteSecretHttp.ts +56 -0
- package/src/WriteVolume.ts +44 -0
- package/src/WriteVolumeHttp.ts +28 -0
- package/src/globals.d.ts +2 -0
- package/src/index.ts +85 -0
- package/src/internal/Declared.ts +80 -0
- package/src/internal/Deploy.ts +309 -0
- package/src/internal/Entrypoint.ts +198 -0
- package/src/internal/Rpc.ts +59 -0
- package/src/internal/RpcAuth.ts +132 -0
- package/src/internal/Runtime.ts +386 -0
- package/src/internal/Tags.ts +44 -0
- package/src/internal/TcpConnect.ts +78 -0
- package/src/internal/Transport.ts +25 -0
- package/src/internal.ts +147 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as workspace from "@distilled.cloud/modal/workspace";
|
|
2
|
+
import * as Provider from "alchemy/Provider";
|
|
3
|
+
import { Resource } from "alchemy/Resource";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { type EnvironmentInput } from "./internal.ts";
|
|
6
|
+
import type { Providers } from "./Providers.ts";
|
|
7
|
+
export interface WorkspaceSettingsProps {
|
|
8
|
+
/**
|
|
9
|
+
* Environment that Modal clients use when none is named (the `modal` CLI,
|
|
10
|
+
* `environmentName: ""` on the API).
|
|
11
|
+
*/
|
|
12
|
+
defaultEnvironment?: EnvironmentInput;
|
|
13
|
+
/**
|
|
14
|
+
* Image builder version for new image builds in the workspace (e.g.
|
|
15
|
+
* `"2025.06"`). Changing it rebuilds images on their next use.
|
|
16
|
+
*/
|
|
17
|
+
imageBuilderVersion?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Require authentication on web endpoints and tunnels in environments
|
|
20
|
+
* that inherit the workspace default.
|
|
21
|
+
*/
|
|
22
|
+
blockUnauthenticatedResources?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface WorkspaceSettingsAttributes {
|
|
25
|
+
/** The workspace's default environment. */
|
|
26
|
+
defaultEnvironment: string | undefined;
|
|
27
|
+
/** The workspace's image builder version. */
|
|
28
|
+
imageBuilderVersion: string | undefined;
|
|
29
|
+
/** Settings found before the first deploy, restored on destroy. */
|
|
30
|
+
original: {
|
|
31
|
+
defaultEnvironment: string | undefined;
|
|
32
|
+
imageBuilderVersion: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Workspace-wide Modal settings: the default environment, the image builder
|
|
37
|
+
* version, and whether endpoints in inheriting environments require
|
|
38
|
+
* authentication.
|
|
39
|
+
*
|
|
40
|
+
* A workspace has one set of settings, so declare this resource once. It
|
|
41
|
+
* captures the settings it finds on first deploy and restores them when
|
|
42
|
+
* destroyed.
|
|
43
|
+
*
|
|
44
|
+
* ### Configuring the workspace
|
|
45
|
+
* **Example:** Pin the image builder and default environment
|
|
46
|
+
* ```typescript
|
|
47
|
+
* import * as Modal from "@alchemy.run/modal";
|
|
48
|
+
*
|
|
49
|
+
* export const Agents = Modal.Environment("Agents", {});
|
|
50
|
+
* export const Settings = Modal.WorkspaceSettings("Settings", {
|
|
51
|
+
* defaultEnvironment: Agents,
|
|
52
|
+
* imageBuilderVersion: "2025.06",
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @resource
|
|
57
|
+
* @product Workspace
|
|
58
|
+
*/
|
|
59
|
+
export declare const WorkspaceSettings: import("alchemy/Resource").ResourceConstructor<WorkspaceSettings, Providers> & Effect.Effect<import("alchemy/Resource").ResourceConstructor<WorkspaceSettings, never>, never, never> & {
|
|
60
|
+
Self: import("alchemy/Self").Self<WorkspaceSettings>;
|
|
61
|
+
Provider: Provider.Provider<WorkspaceSettings>;
|
|
62
|
+
Aliases: readonly string[] | undefined;
|
|
63
|
+
ref(id: string, options?: {
|
|
64
|
+
stage?: string;
|
|
65
|
+
stack?: string;
|
|
66
|
+
}): Effect.Effect<WorkspaceSettings, never, never>;
|
|
67
|
+
} & ((id: string, props: import("./internal/Declared.ts").DeclaredProps<WorkspaceSettingsProps>) => Effect.Effect<WorkspaceSettings, never, Providers>);
|
|
68
|
+
export type WorkspaceSettings = Resource<"Modal.WorkspaceSettings", WorkspaceSettingsProps, WorkspaceSettingsAttributes, never, Providers>;
|
|
69
|
+
export declare const WorkspaceSettingsProvider: () => import("effect/Layer").Layer<Provider.Provider<WorkspaceSettings>, never, workspace.ModalOpContext>;
|
|
70
|
+
//# sourceMappingURL=WorkspaceSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceSettings.d.ts","sources":["../src/WorkspaceSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;IACtC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAED,MAAM,WAAW,2BAA2B;IAC1C,2CAA2C;IAC3C,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,6CAA6C;IAC7C,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,mEAAmE;IACnE,QAAQ,EAAE;QACR,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;QACvC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;KACzC,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;uJAE7B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CACtC,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,EACL,SAAS,CACV,CAAC;AAEF,eAAO,MAAM,yBAAyB,2GAqFnC,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as workspace from "@distilled.cloud/modal/workspace";
|
|
2
|
+
import * as Provider from "alchemy/Provider";
|
|
3
|
+
import { Resource } from "alchemy/Resource";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { envNameOf } from "./internal.js";
|
|
6
|
+
import { declarable } from "./internal/Declared.js";
|
|
7
|
+
/**
|
|
8
|
+
* Workspace-wide Modal settings: the default environment, the image builder
|
|
9
|
+
* version, and whether endpoints in inheriting environments require
|
|
10
|
+
* authentication.
|
|
11
|
+
*
|
|
12
|
+
* A workspace has one set of settings, so declare this resource once. It
|
|
13
|
+
* captures the settings it finds on first deploy and restores them when
|
|
14
|
+
* destroyed.
|
|
15
|
+
*
|
|
16
|
+
* ### Configuring the workspace
|
|
17
|
+
* **Example:** Pin the image builder and default environment
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import * as Modal from "@alchemy.run/modal";
|
|
20
|
+
*
|
|
21
|
+
* export const Agents = Modal.Environment("Agents", {});
|
|
22
|
+
* export const Settings = Modal.WorkspaceSettings("Settings", {
|
|
23
|
+
* defaultEnvironment: Agents,
|
|
24
|
+
* imageBuilderVersion: "2025.06",
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @resource
|
|
29
|
+
* @product Workspace
|
|
30
|
+
*/
|
|
31
|
+
export const WorkspaceSettings = declarable()(Resource("Modal.WorkspaceSettings"));
|
|
32
|
+
export const WorkspaceSettingsProvider = () => Provider.effect(WorkspaceSettings, Effect.gen(function* () {
|
|
33
|
+
const observe = workspace.workspaceSettings({});
|
|
34
|
+
return {
|
|
35
|
+
read: Effect.fn(function* ({ output }) {
|
|
36
|
+
if (output === undefined)
|
|
37
|
+
return undefined;
|
|
38
|
+
const current = yield* observe;
|
|
39
|
+
return {
|
|
40
|
+
...output,
|
|
41
|
+
defaultEnvironment: current.defaultEnvironmentName || undefined,
|
|
42
|
+
imageBuilderVersion: current.imageBuilderVersion || undefined,
|
|
43
|
+
};
|
|
44
|
+
}),
|
|
45
|
+
reconcile: Effect.fn(function* ({ news, output }) {
|
|
46
|
+
// Observe
|
|
47
|
+
const current = yield* observe;
|
|
48
|
+
const original = output?.original ?? {
|
|
49
|
+
defaultEnvironment: current.defaultEnvironmentName || undefined,
|
|
50
|
+
imageBuilderVersion: current.imageBuilderVersion || undefined,
|
|
51
|
+
};
|
|
52
|
+
// Sync each setting against the observed value.
|
|
53
|
+
const defaultEnvironment = envNameOf(news.defaultEnvironment);
|
|
54
|
+
if (defaultEnvironment !== undefined &&
|
|
55
|
+
defaultEnvironment !== current.defaultEnvironmentName) {
|
|
56
|
+
yield* workspace.workspaceSetDefaultEnvironment({
|
|
57
|
+
environmentName: defaultEnvironment,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (news.imageBuilderVersion !== undefined &&
|
|
61
|
+
news.imageBuilderVersion !== current.imageBuilderVersion) {
|
|
62
|
+
yield* workspace.workspaceSetImageBuilderVersion({
|
|
63
|
+
newImageBuilderVersion: news.imageBuilderVersion,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (news.blockUnauthenticatedResources !== undefined) {
|
|
67
|
+
yield* workspace.workspaceSetDefaultEnvironmentSettings({
|
|
68
|
+
blockUnauthenticatedResources: news.blockUnauthenticatedResources
|
|
69
|
+
? "ENVIRONMENT_BLOCK_UNAUTHENTICATED_RESOURCES_BLOCK"
|
|
70
|
+
: "ENVIRONMENT_BLOCK_UNAUTHENTICATED_RESOURCES_ALLOW",
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const final = yield* observe;
|
|
74
|
+
return {
|
|
75
|
+
defaultEnvironment: final.defaultEnvironmentName || undefined,
|
|
76
|
+
imageBuilderVersion: final.imageBuilderVersion || undefined,
|
|
77
|
+
original,
|
|
78
|
+
};
|
|
79
|
+
}),
|
|
80
|
+
delete: Effect.fn(function* ({ output, olds }) {
|
|
81
|
+
// Restore what was there before Alchemy managed the settings.
|
|
82
|
+
const current = yield* observe;
|
|
83
|
+
if (olds.defaultEnvironment !== undefined &&
|
|
84
|
+
output.original.defaultEnvironment !== undefined &&
|
|
85
|
+
current.defaultEnvironmentName !== output.original.defaultEnvironment) {
|
|
86
|
+
yield* workspace.workspaceSetDefaultEnvironment({
|
|
87
|
+
environmentName: output.original.defaultEnvironment,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (olds.imageBuilderVersion !== undefined &&
|
|
91
|
+
output.original.imageBuilderVersion !== undefined &&
|
|
92
|
+
current.imageBuilderVersion !== output.original.imageBuilderVersion) {
|
|
93
|
+
yield* workspace.workspaceSetImageBuilderVersion({
|
|
94
|
+
newImageBuilderVersion: output.original.imageBuilderVersion,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (olds.blockUnauthenticatedResources !== undefined) {
|
|
98
|
+
yield* workspace.workspaceSetDefaultEnvironmentSettings({
|
|
99
|
+
blockUnauthenticatedResources: "ENVIRONMENT_BLOCK_UNAUTHENTICATED_RESOURCES_UNSPECIFIED",
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}),
|
|
103
|
+
};
|
|
104
|
+
}));
|
|
105
|
+
//# sourceMappingURL=WorkspaceSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceSettings.js","sources":["../src/WorkspaceSettings.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as Binding from "alchemy/Binding";
|
|
2
|
+
import type { RuntimeContext } from "alchemy/RuntimeContext";
|
|
3
|
+
import type * as Effect from "effect/Effect";
|
|
4
|
+
import type { App } from "./App.ts";
|
|
5
|
+
import type { OpError } from "./internal.ts";
|
|
6
|
+
import type { WriteAppOps } from "./WriteAppHttp.ts";
|
|
7
|
+
/** Change an App's deployment. */
|
|
8
|
+
export interface AppWriter {
|
|
9
|
+
/** Redeploy an earlier version (the previous one by default). */
|
|
10
|
+
rollback(options?: {
|
|
11
|
+
readonly version?: number;
|
|
12
|
+
}): Effect.Effect<void, OpError<WriteAppOps, "rollback">, RuntimeContext>;
|
|
13
|
+
/** Restart every container on the current version, draining the old ones. */
|
|
14
|
+
rollover(): Effect.Effect<void, OpError<WriteAppOps, "rollover">, RuntimeContext>;
|
|
15
|
+
/** Put a staged version into production. */
|
|
16
|
+
promote(version: number): Effect.Effect<void, OpError<WriteAppOps, "promote">, RuntimeContext>;
|
|
17
|
+
/** Stop the App: its functions stop serving and its sandboxes terminate. */
|
|
18
|
+
stop(): Effect.Effect<void, OpError<WriteAppOps, "stop">, RuntimeContext>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Operate a Modal App from any runtime: roll back a bad version, roll the
|
|
22
|
+
* containers over, promote a staged version, or stop it. The next deploy of
|
|
23
|
+
* the Stack publishes its declared version again.
|
|
24
|
+
*
|
|
25
|
+
* ### Roll back
|
|
26
|
+
* **Example:** From an incident webhook
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const backend = yield* Modal.WriteApp(Backend);
|
|
29
|
+
* yield* backend.rollback();
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @binding
|
|
33
|
+
* @product App
|
|
34
|
+
*/
|
|
35
|
+
export interface WriteApp extends Binding.Service<WriteApp, "Modal.WriteApp", (app: App) => Effect.Effect<AppWriter>> {
|
|
36
|
+
}
|
|
37
|
+
export declare const WriteApp: WriteApp;
|
|
38
|
+
//# sourceMappingURL=WriteApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteApp.d.ts","sources":["../src/WriteApp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,kCAAkC;AAClC,MAAM,WAAW,SAAS;IACxB,iEAAiE;IACjE,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;KAC3B,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,cAAc,CAAC,CAAC;IAC1E,6EAA6E;IAC7E,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,cAAc,CAAC,CAAC;IAClF,4CAA4C;IAC5C,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,cAAc,CAAC,CAAC;IAC/F,4EAA4E;IAC5E,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC;CAC3E;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,QAAS,SAAQ,OAAO,CAAC,OAAO,CAC/C,QAAQ,EACR,gBAAgB,EAChB,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CACvC;CAAG;AAEJ,eAAO,MAAM,QAAQ,UAA8C,CAAC"}
|
package/lib/WriteApp.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteApp.js","sources":["../src/WriteApp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AA0C3C,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAW,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as app from "@distilled.cloud/modal/app";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import { WriteApp } from "./WriteApp.ts";
|
|
5
|
+
/** The operations the client calls, resolved by `ModalBindings.withCredentials`. */
|
|
6
|
+
declare const WriteAppOps: Effect.Effect<{
|
|
7
|
+
readonly rollback: (input: app.AppRollbackRequest) => Effect.Effect<app.AppRollbackResponse, app.AppRollbackError, never>;
|
|
8
|
+
readonly rollover: (input: app.AppRolloverRequest) => Effect.Effect<app.AppRolloverResponse, app.AppRolloverError, never>;
|
|
9
|
+
readonly promote: (input: app.PromoteAppRequest) => Effect.Effect<app.PromoteAppResponse, app.PromoteAppError, never>;
|
|
10
|
+
readonly stop: (input: app.StopAppRequest) => Effect.Effect<app.StopAppResponse, app.StopAppError, never>;
|
|
11
|
+
}, never, import("./internal.ts").OperationServices>;
|
|
12
|
+
export type WriteAppOps = Effect.Success<typeof WriteAppOps>;
|
|
13
|
+
/**
|
|
14
|
+
* {@link WriteApp} over Modal's API. Grants the host's identity (a scoped
|
|
15
|
+
* `Modal.ServiceUser`) the `contributor` role on the App's environment.
|
|
16
|
+
*
|
|
17
|
+
* @layer
|
|
18
|
+
* @product App
|
|
19
|
+
* @provides Modal.WriteApp
|
|
20
|
+
*/
|
|
21
|
+
export declare const WriteAppHttp: Layer.Layer<WriteApp, never, never>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=WriteAppHttp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteAppHttp.d.ts","sources":["../src/WriteAppHttp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAC;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,QAAQ,EAAkB,MAAM,eAAe,CAAC;AAEzD,oFAAoF;AACpF,QAAA,MAAM,WAAW;;;;;oDAKf,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC;AAE7D;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,qCAwBxB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as app from "@distilled.cloud/modal/app";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import { makeModalBinding } from "./BindingHttp.js";
|
|
5
|
+
import { operations } from "./internal.js";
|
|
6
|
+
import { WriteApp } from "./WriteApp.js";
|
|
7
|
+
/** The operations the client calls, resolved by `ModalBindings.withCredentials`. */
|
|
8
|
+
const WriteAppOps = operations({
|
|
9
|
+
rollback: app.appRollback,
|
|
10
|
+
rollover: app.appRollover,
|
|
11
|
+
promote: app.promoteApp,
|
|
12
|
+
stop: app.stopApp,
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* {@link WriteApp} over Modal's API. Grants the host's identity (a scoped
|
|
16
|
+
* `Modal.ServiceUser`) the `contributor` role on the App's environment.
|
|
17
|
+
*
|
|
18
|
+
* @layer
|
|
19
|
+
* @product App
|
|
20
|
+
* @provides Modal.WriteApp
|
|
21
|
+
*/
|
|
22
|
+
export const WriteAppHttp = Layer.effect(WriteApp, makeModalBinding({
|
|
23
|
+
tag: "Modal.WriteApp",
|
|
24
|
+
operations: WriteAppOps,
|
|
25
|
+
role: "contributor",
|
|
26
|
+
make: Effect.fn(function* (target, ops) {
|
|
27
|
+
const appId = yield* target.appId;
|
|
28
|
+
return {
|
|
29
|
+
rollback: (options = {}) => Effect.flatMap(appId, (id) => ops.rollback({ appId: id, version: options.version })).pipe(Effect.asVoid),
|
|
30
|
+
rollover: () => Effect.flatMap(appId, (id) => ops.rollover({ appId: id })).pipe(Effect.asVoid),
|
|
31
|
+
promote: (version) => Effect.flatMap(appId, (id) => ops.promote({ appId: id, version })).pipe(Effect.asVoid),
|
|
32
|
+
stop: () => Effect.flatMap(appId, (id) => ops.stop({ appId: id, source: "APP_STOP_SOURCE_CLI" })).pipe(Effect.asVoid),
|
|
33
|
+
};
|
|
34
|
+
}),
|
|
35
|
+
}));
|
|
36
|
+
//# sourceMappingURL=WriteAppHttp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteAppHttp.js","sources":["../src/WriteAppHttp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAC;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAkB,MAAM,eAAe,CAAC;AAEzD,oFAAoF;AACpF,MAAM,WAAW,GAAG,UAAU,CAAC;IAC7B,QAAQ,EAAE,GAAG,CAAC,WAAW;IACzB,QAAQ,EAAE,GAAG,CAAC,WAAW;IACzB,OAAO,EAAE,GAAG,CAAC,UAAU;IACvB,IAAI,EAAE,GAAG,CAAC,OAAO;CAClB,CAAC,CAAC;AAIH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CACtC,QAAQ,EACR,gBAAgB,CAAC;IACf,GAAG,EAAE,gBAAgB;IACrB,UAAU,EAAE,WAAW;IACvB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAW,EAAE,GAAG;QACzC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QAClC,OAAO;YACL,QAAQ,EAAE,CAAC,OAAO,GAAG,EAAE,EAAE,EAAE,CACzB,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CACvF,MAAM,CAAC,MAAM,CACd;YACH,QAAQ,EAAE,GAAG,EAAE,CACb,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YAChF,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CACnB,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YACxF,IAAI,EAAE,GAAG,EAAE,CACT,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAC3B,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC,CACvD,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;SACJ,CAAC;IACxB,CAAC,CAAC;CACH,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as Binding from "alchemy/Binding";
|
|
2
|
+
import type * as Effect from "effect/Effect";
|
|
3
|
+
import type { Dict } from "./Dict.ts";
|
|
4
|
+
import type { WriteDictClient } from "./DictClient.ts";
|
|
5
|
+
export type { WriteDictClient } from "./DictClient.ts";
|
|
6
|
+
/**
|
|
7
|
+
* Write a Modal Dict from any runtime: put, update, pop and clear. Keys and values are JSON.
|
|
8
|
+
*
|
|
9
|
+
* ### Bind a dict
|
|
10
|
+
* **Example:** From a Cloudflare Worker
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import * as Cloudflare from "@alchemy.run/cloudflare";
|
|
13
|
+
* import * as Modal from "@alchemy.run/modal";
|
|
14
|
+
* import * as Effect from "effect/Effect";
|
|
15
|
+
* import * as HttpServerResponse from "effect/http/HttpServerResponse";
|
|
16
|
+
* import { Results } from "./Storage.ts";
|
|
17
|
+
*
|
|
18
|
+
* export default class Api extends Cloudflare.Worker<Api>()(
|
|
19
|
+
* "Api",
|
|
20
|
+
* { main: import.meta.url },
|
|
21
|
+
* Effect.gen(function* () {
|
|
22
|
+
* const dict = yield* Modal.WriteDict(Results);
|
|
23
|
+
* return {
|
|
24
|
+
* fetch: Effect.gen(function* () {
|
|
25
|
+
* yield* dict.put("last-run", { ok: true });
|
|
26
|
+
* return HttpServerResponse.text("saved");
|
|
27
|
+
* }).pipe(Effect.orDie),
|
|
28
|
+
* };
|
|
29
|
+
* }).pipe(Effect.provide(Modal.WriteDictHttp)),
|
|
30
|
+
* ) {}
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @binding
|
|
34
|
+
* @product Dict
|
|
35
|
+
*/
|
|
36
|
+
export interface WriteDict extends Binding.Service<WriteDict, "Modal.WriteDict", (dict: Dict) => Effect.Effect<WriteDictClient>> {
|
|
37
|
+
}
|
|
38
|
+
export declare const WriteDict: WriteDict;
|
|
39
|
+
//# sourceMappingURL=WriteDict.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteDict.d.ts","sources":["../src/WriteDict.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,SAAU,SAAQ,OAAO,CAAC,OAAO,CAChD,SAAS,EACT,iBAAiB,EACjB,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAC/C;CAAG;AAEJ,eAAO,MAAM,SAAS,WAAgD,CAAC"}
|
package/lib/WriteDict.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteDict.js","sources":["../src/WriteDict.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AA2C3C,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAY,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as Layer from "effect/Layer";
|
|
2
|
+
import { WriteDict } from "./WriteDict.ts";
|
|
3
|
+
/**
|
|
4
|
+
* {@link WriteDict} over Modal's API. Grants the host's identity (a scoped
|
|
5
|
+
* `Modal.ServiceUser`) the `contributor` role on the dict's environment.
|
|
6
|
+
*
|
|
7
|
+
* @layer
|
|
8
|
+
* @product Dict
|
|
9
|
+
* @provides Modal.WriteDict
|
|
10
|
+
*/
|
|
11
|
+
export declare const WriteDictHttp: Layer.Layer<WriteDict, never, never>;
|
|
12
|
+
//# sourceMappingURL=WriteDictHttp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteDictHttp.d.ts","sources":["../src/WriteDictHttp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,sCAWzB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
import { makeModalBinding } from "./BindingHttp.js";
|
|
4
|
+
import { DictOps, makeWriteDictClient } from "./DictClient.js";
|
|
5
|
+
import { WriteDict } from "./WriteDict.js";
|
|
6
|
+
/**
|
|
7
|
+
* {@link WriteDict} over Modal's API. Grants the host's identity (a scoped
|
|
8
|
+
* `Modal.ServiceUser`) the `contributor` role on the dict's environment.
|
|
9
|
+
*
|
|
10
|
+
* @layer
|
|
11
|
+
* @product Dict
|
|
12
|
+
* @provides Modal.WriteDict
|
|
13
|
+
*/
|
|
14
|
+
export const WriteDictHttp = Layer.effect(WriteDict, makeModalBinding({
|
|
15
|
+
tag: "Modal.WriteDict",
|
|
16
|
+
operations: DictOps,
|
|
17
|
+
role: "contributor",
|
|
18
|
+
make: Effect.fn(function* (dict, ops) {
|
|
19
|
+
const dictId = yield* dict.dictId;
|
|
20
|
+
return makeWriteDictClient(dictId, ops);
|
|
21
|
+
}),
|
|
22
|
+
}));
|
|
23
|
+
//# sourceMappingURL=WriteDictHttp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteDictHttp.js","sources":["../src/WriteDictHttp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CACvC,SAAS,EACT,gBAAgB,CAAC;IACf,GAAG,EAAE,iBAAiB;IACtB,UAAU,EAAE,OAAO;IACnB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAU,EAAE,GAAG;QACxC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QAClC,OAAO,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC,CAAC;CACH,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as Binding from "alchemy/Binding";
|
|
2
|
+
import type * as Effect from "effect/Effect";
|
|
3
|
+
import type { Queue } from "./Queue.ts";
|
|
4
|
+
import type { WriteQueueClient } from "./QueueClient.ts";
|
|
5
|
+
export type { WriteQueueClient } from "./QueueClient.ts";
|
|
6
|
+
/**
|
|
7
|
+
* Put items into a Modal Queue from any runtime. Items are JSON, so a Python consumer reads them with `json.loads`.
|
|
8
|
+
*
|
|
9
|
+
* ### Bind a queue
|
|
10
|
+
* **Example:** From a Cloudflare Worker
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import * as Cloudflare from "@alchemy.run/cloudflare";
|
|
13
|
+
* import * as Modal from "@alchemy.run/modal";
|
|
14
|
+
* import * as Effect from "effect/Effect";
|
|
15
|
+
* import * as HttpServerResponse from "effect/http/HttpServerResponse";
|
|
16
|
+
* import { Jobs } from "./Storage.ts";
|
|
17
|
+
*
|
|
18
|
+
* export default class Api extends Cloudflare.Worker<Api>()(
|
|
19
|
+
* "Api",
|
|
20
|
+
* { main: import.meta.url },
|
|
21
|
+
* Effect.gen(function* () {
|
|
22
|
+
* const queue = yield* Modal.WriteQueue(Jobs);
|
|
23
|
+
* return {
|
|
24
|
+
* fetch: Effect.gen(function* () {
|
|
25
|
+
* yield* queue.put({ repo: "alchemy-run/alchemy", command: "pnpm test" });
|
|
26
|
+
* return HttpServerResponse.text("queued");
|
|
27
|
+
* }).pipe(Effect.orDie),
|
|
28
|
+
* };
|
|
29
|
+
* }).pipe(Effect.provide(Modal.WriteQueueHttp)),
|
|
30
|
+
* ) {}
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @binding
|
|
34
|
+
* @product Queue
|
|
35
|
+
*/
|
|
36
|
+
export interface WriteQueue extends Binding.Service<WriteQueue, "Modal.WriteQueue", (queue: Queue) => Effect.Effect<WriteQueueClient>> {
|
|
37
|
+
}
|
|
38
|
+
export declare const WriteQueue: WriteQueue;
|
|
39
|
+
//# sourceMappingURL=WriteQueue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteQueue.d.ts","sources":["../src/WriteQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO,CAAC,OAAO,CACjD,UAAU,EACV,kBAAkB,EAClB,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAClD;CAAG;AAEJ,eAAO,MAAM,UAAU,YAAkD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteQueue.js","sources":["../src/WriteQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AA2C3C,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAa,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as Layer from "effect/Layer";
|
|
2
|
+
import { WriteQueue } from "./WriteQueue.ts";
|
|
3
|
+
/**
|
|
4
|
+
* {@link WriteQueue} over Modal's API. Grants the host's identity (a scoped
|
|
5
|
+
* `Modal.ServiceUser`) the `contributor` role on the queue's environment.
|
|
6
|
+
*
|
|
7
|
+
* @layer
|
|
8
|
+
* @product Queue
|
|
9
|
+
* @provides Modal.WriteQueue
|
|
10
|
+
*/
|
|
11
|
+
export declare const WriteQueueHttp: Layer.Layer<WriteQueue, never, never>;
|
|
12
|
+
//# sourceMappingURL=WriteQueueHttp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteQueueHttp.d.ts","sources":["../src/WriteQueueHttp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,uCAW1B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
import { makeModalBinding } from "./BindingHttp.js";
|
|
4
|
+
import { QueueOps, makeWriteQueueClient } from "./QueueClient.js";
|
|
5
|
+
import { WriteQueue } from "./WriteQueue.js";
|
|
6
|
+
/**
|
|
7
|
+
* {@link WriteQueue} over Modal's API. Grants the host's identity (a scoped
|
|
8
|
+
* `Modal.ServiceUser`) the `contributor` role on the queue's environment.
|
|
9
|
+
*
|
|
10
|
+
* @layer
|
|
11
|
+
* @product Queue
|
|
12
|
+
* @provides Modal.WriteQueue
|
|
13
|
+
*/
|
|
14
|
+
export const WriteQueueHttp = Layer.effect(WriteQueue, makeModalBinding({
|
|
15
|
+
tag: "Modal.WriteQueue",
|
|
16
|
+
operations: QueueOps,
|
|
17
|
+
role: "contributor",
|
|
18
|
+
make: Effect.fn(function* (queue, ops) {
|
|
19
|
+
const queueId = yield* queue.queueId;
|
|
20
|
+
return makeWriteQueueClient(queueId, ops);
|
|
21
|
+
}),
|
|
22
|
+
}));
|
|
23
|
+
//# sourceMappingURL=WriteQueueHttp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteQueueHttp.js","sources":["../src/WriteQueueHttp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CACxC,UAAU,EACV,gBAAgB,CAAC;IACf,GAAG,EAAE,kBAAkB;IACvB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAY,EAAE,GAAG;QAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;QACrC,OAAO,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC5C,CAAC,CAAC;CACH,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as Binding from "alchemy/Binding";
|
|
2
|
+
import type { RuntimeContext } from "alchemy/RuntimeContext";
|
|
3
|
+
import type * as Effect from "effect/Effect";
|
|
4
|
+
import type * as Redacted from "effect/Redacted";
|
|
5
|
+
import type { OpError } from "./internal.ts";
|
|
6
|
+
import type { Secret } from "./Secret.ts";
|
|
7
|
+
import type { WriteSecretOps } from "./WriteSecretHttp.ts";
|
|
8
|
+
/** Replace one secret's variables. */
|
|
9
|
+
export interface WriteSecretClient {
|
|
10
|
+
readonly secretId: Effect.Effect<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Replace the secret's whole variable set. Sandboxes and functions started
|
|
13
|
+
* afterwards see the new values; running ones keep theirs.
|
|
14
|
+
*/
|
|
15
|
+
put(env: Record<string, string | Redacted.Redacted<string>>): Effect.Effect<void, OpError<WriteSecretOps, "getInfo" | "update">, RuntimeContext>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Rotate a Modal Secret from any runtime. Modal never returns secret
|
|
19
|
+
* values, so there is no read binding: attach the secret to a sandbox
|
|
20
|
+
* instead, or inject it with an outbound header replacement.
|
|
21
|
+
*
|
|
22
|
+
* ### Rotate a secret
|
|
23
|
+
* **Example:** From a Cloudflare Worker
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import * as Cloudflare from "@alchemy.run/cloudflare";
|
|
26
|
+
* import * as Modal from "@alchemy.run/modal";
|
|
27
|
+
* import * as Effect from "effect/Effect";
|
|
28
|
+
* import * as Redacted from "effect/Redacted";
|
|
29
|
+
* import * as HttpServerResponse from "effect/http/HttpServerResponse";
|
|
30
|
+
* import { OpenAI } from "./Storage.ts";
|
|
31
|
+
*
|
|
32
|
+
* export default class Rotate extends Cloudflare.Worker<Rotate>()(
|
|
33
|
+
* "Rotate",
|
|
34
|
+
* { main: import.meta.url },
|
|
35
|
+
* Effect.gen(function* () {
|
|
36
|
+
* const openai = yield* Modal.WriteSecret(OpenAI);
|
|
37
|
+
* return {
|
|
38
|
+
* fetch: Effect.gen(function* () {
|
|
39
|
+
* yield* openai.put({ OPENAI_API_KEY: Redacted.make("sk-new") });
|
|
40
|
+
* return HttpServerResponse.text("rotated");
|
|
41
|
+
* }).pipe(Effect.orDie),
|
|
42
|
+
* };
|
|
43
|
+
* }).pipe(Effect.provide(Modal.WriteSecretHttp)),
|
|
44
|
+
* ) {}
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @binding
|
|
48
|
+
* @product Secret
|
|
49
|
+
*/
|
|
50
|
+
export interface WriteSecret extends Binding.Service<WriteSecret, "Modal.WriteSecret", (secret: Secret) => Effect.Effect<WriteSecretClient>> {
|
|
51
|
+
}
|
|
52
|
+
export declare const WriteSecret: WriteSecret;
|
|
53
|
+
//# sourceMappingURL=WriteSecret.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteSecret.d.ts","sources":["../src/WriteSecret.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC;;;OAGG;IACH,GAAG,CACD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GACtD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,cAAc,EAAE,SAAS,GAAG,QAAQ,CAAC,EAAE,cAAc,CAAC,CAAC;CACvF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,OAAO,CAClD,WAAW,EACX,mBAAmB,EACnB,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CACrD;CAAG;AAEJ,eAAO,MAAM,WAAW,aAAoD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteSecret.js","sources":["../src/WriteSecret.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AA2D3C,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAc,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as secret from "@distilled.cloud/modal/secret";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import { WriteSecret, type WriteSecretClient } from "./WriteSecret.ts";
|
|
5
|
+
/** The operations the client calls, resolved by `ModalBindings.withCredentials`. */
|
|
6
|
+
declare const WriteSecretOps: Effect.Effect<{
|
|
7
|
+
readonly getInfo: (input: secret.SecretGetInfoRequest) => Effect.Effect<secret.SecretGetInfoResponse, secret.SecretGetInfoError, never>;
|
|
8
|
+
readonly update: (input: secret.UpdateSecretRequest) => Effect.Effect<secret.UpdateSecretResponse, secret.UpdateSecretError, never>;
|
|
9
|
+
}, never, import("./internal.ts").OperationServices>;
|
|
10
|
+
export type WriteSecretOps = Effect.Success<typeof WriteSecretOps>;
|
|
11
|
+
/** A write client over a secret id. */
|
|
12
|
+
export declare const makeWriteSecretClient: (secretId: Effect.Effect<string>, ops: WriteSecretOps) => WriteSecretClient;
|
|
13
|
+
/**
|
|
14
|
+
* {@link WriteSecret} over Modal's API. Grants the host's identity (a scoped
|
|
15
|
+
* `Modal.ServiceUser`) the `contributor` role on the secret's environment.
|
|
16
|
+
*
|
|
17
|
+
* @layer
|
|
18
|
+
* @product Secret
|
|
19
|
+
* @provides Modal.WriteSecret
|
|
20
|
+
*/
|
|
21
|
+
export declare const WriteSecretHttp: Layer.Layer<WriteSecret, never, never>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=WriteSecretHttp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteSecretHttp.d.ts","sources":["../src/WriteSecretHttp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAKtC,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,oFAAoF;AACpF,QAAA,MAAM,cAAc;;;oDAA6E,CAAC;AAElG,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,cAAc,CAAC,CAAC;AAEnE,uCAAuC;AACvC,eAAO,MAAM,qBAAqB,aACtB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAC1B,cAAc,KAClB,iBAgBD,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,wCAW3B,CAAC"}
|