@eloxiv/testing 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/Admin.d.ts +20 -0
- package/dist/Admin.d.ts.map +1 -0
- package/dist/Admin.js +61 -0
- package/dist/Admin.js.map +1 -0
- package/dist/Agent.d.ts +97 -0
- package/dist/Agent.d.ts.map +1 -0
- package/dist/Agent.js +210 -0
- package/dist/Agent.js.map +1 -0
- package/dist/AgentSurface.d.ts +20 -0
- package/dist/AgentSurface.d.ts.map +1 -0
- package/dist/AgentSurface.js +36 -0
- package/dist/AgentSurface.js.map +1 -0
- package/dist/Embedder.d.ts +21 -0
- package/dist/Embedder.d.ts.map +1 -0
- package/dist/Embedder.js +54 -0
- package/dist/Embedder.js.map +1 -0
- package/dist/EvalMain.d.ts +2 -0
- package/dist/EvalMain.d.ts.map +1 -0
- package/dist/EvalMain.js +80 -0
- package/dist/EvalMain.js.map +1 -0
- package/dist/Evals.d.ts +95 -0
- package/dist/Evals.d.ts.map +1 -0
- package/dist/Evals.js +389 -0
- package/dist/Evals.js.map +1 -0
- package/dist/Kernel.d.ts +88 -0
- package/dist/Kernel.d.ts.map +1 -0
- package/dist/Kernel.js +108 -0
- package/dist/Kernel.js.map +1 -0
- package/dist/Launch.d.ts +86 -0
- package/dist/Launch.d.ts.map +1 -0
- package/dist/Launch.js +370 -0
- package/dist/Launch.js.map +1 -0
- package/dist/Locks.d.ts +39 -0
- package/dist/Locks.d.ts.map +1 -0
- package/dist/Locks.js +94 -0
- package/dist/Locks.js.map +1 -0
- package/dist/Routes.d.ts +19 -0
- package/dist/Routes.d.ts.map +1 -0
- package/dist/Routes.js +38 -0
- package/dist/Routes.js.map +1 -0
- package/dist/ScriptedChatModel.d.ts +51 -0
- package/dist/ScriptedChatModel.d.ts.map +1 -0
- package/dist/ScriptedChatModel.js +135 -0
- package/dist/ScriptedChatModel.js.map +1 -0
- package/dist/SmtpSink.d.ts +36 -0
- package/dist/SmtpSink.d.ts.map +1 -0
- package/dist/SmtpSink.js +185 -0
- package/dist/SmtpSink.js.map +1 -0
- package/dist/System.d.ts +271 -0
- package/dist/System.d.ts.map +1 -0
- package/dist/System.js +905 -0
- package/dist/System.js.map +1 -0
- package/dist/TcpProxy.d.ts +17 -0
- package/dist/TcpProxy.d.ts.map +1 -0
- package/dist/TcpProxy.js +100 -0
- package/dist/TcpProxy.js.map +1 -0
- package/dist/auth/TrustedProxyAuth.d.ts +28 -0
- package/dist/auth/TrustedProxyAuth.d.ts.map +1 -0
- package/dist/auth/TrustedProxyAuth.js +128 -0
- package/dist/auth/TrustedProxyAuth.js.map +1 -0
- package/dist/conformance/ActionConsent.d.ts +3 -0
- package/dist/conformance/ActionConsent.d.ts.map +1 -0
- package/dist/conformance/ActionConsent.js +347 -0
- package/dist/conformance/ActionConsent.js.map +1 -0
- package/dist/conformance/ActionRegistry.d.ts +64 -0
- package/dist/conformance/ActionRegistry.d.ts.map +1 -0
- package/dist/conformance/ActionRegistry.js +136 -0
- package/dist/conformance/ActionRegistry.js.map +1 -0
- package/dist/conformance/Actor.d.ts +43 -0
- package/dist/conformance/Actor.d.ts.map +1 -0
- package/dist/conformance/Actor.js +171 -0
- package/dist/conformance/Actor.js.map +1 -0
- package/dist/conformance/AgentReference.d.ts +30 -0
- package/dist/conformance/AgentReference.d.ts.map +1 -0
- package/dist/conformance/AgentReference.js +137 -0
- package/dist/conformance/AgentReference.js.map +1 -0
- package/dist/conformance/AgentResources.d.ts +3 -0
- package/dist/conformance/AgentResources.d.ts.map +1 -0
- package/dist/conformance/AgentResources.js +454 -0
- package/dist/conformance/AgentResources.js.map +1 -0
- package/dist/conformance/AgentRuntime.d.ts +3 -0
- package/dist/conformance/AgentRuntime.d.ts.map +1 -0
- package/dist/conformance/AgentRuntime.js +302 -0
- package/dist/conformance/AgentRuntime.js.map +1 -0
- package/dist/conformance/AgentSubject.d.ts +87 -0
- package/dist/conformance/AgentSubject.d.ts.map +1 -0
- package/dist/conformance/AgentSubject.js +18 -0
- package/dist/conformance/AgentSubject.js.map +1 -0
- package/dist/conformance/Approvals.d.ts +3 -0
- package/dist/conformance/Approvals.d.ts.map +1 -0
- package/dist/conformance/Approvals.js +258 -0
- package/dist/conformance/Approvals.js.map +1 -0
- package/dist/conformance/Audit.d.ts +3 -0
- package/dist/conformance/Audit.d.ts.map +1 -0
- package/dist/conformance/Audit.js +221 -0
- package/dist/conformance/Audit.js.map +1 -0
- package/dist/conformance/CalendarProvider.d.ts +4 -0
- package/dist/conformance/CalendarProvider.d.ts.map +1 -0
- package/dist/conformance/CalendarProvider.js +108 -0
- package/dist/conformance/CalendarProvider.js.map +1 -0
- package/dist/conformance/CapabilityKit.d.ts +191 -0
- package/dist/conformance/CapabilityKit.d.ts.map +1 -0
- package/dist/conformance/CapabilityKit.js +375 -0
- package/dist/conformance/CapabilityKit.js.map +1 -0
- package/dist/conformance/ClientSDK.d.ts +78 -0
- package/dist/conformance/ClientSDK.d.ts.map +1 -0
- package/dist/conformance/ClientSDK.js +163 -0
- package/dist/conformance/ClientSDK.js.map +1 -0
- package/dist/conformance/CollabDocument.d.ts +3 -0
- package/dist/conformance/CollabDocument.d.ts.map +1 -0
- package/dist/conformance/CollabDocument.js +934 -0
- package/dist/conformance/CollabDocument.js.map +1 -0
- package/dist/conformance/CollabReference.d.ts +8 -0
- package/dist/conformance/CollabReference.d.ts.map +1 -0
- package/dist/conformance/CollabReference.js +138 -0
- package/dist/conformance/CollabReference.js.map +1 -0
- package/dist/conformance/CollabSubject.d.ts +68 -0
- package/dist/conformance/CollabSubject.d.ts.map +1 -0
- package/dist/conformance/CollabSubject.js +2 -0
- package/dist/conformance/CollabSubject.js.map +1 -0
- package/dist/conformance/Command.d.ts +3 -0
- package/dist/conformance/Command.d.ts.map +1 -0
- package/dist/conformance/Command.js +73 -0
- package/dist/conformance/Command.js.map +1 -0
- package/dist/conformance/Connections.d.ts +4 -0
- package/dist/conformance/Connections.d.ts.map +1 -0
- package/dist/conformance/Connections.js +308 -0
- package/dist/conformance/Connections.js.map +1 -0
- package/dist/conformance/ConnectionsReference.d.ts +56 -0
- package/dist/conformance/ConnectionsReference.d.ts.map +1 -0
- package/dist/conformance/ConnectionsReference.js +74 -0
- package/dist/conformance/ConnectionsReference.js.map +1 -0
- package/dist/conformance/ConnectorReference.d.ts +86 -0
- package/dist/conformance/ConnectorReference.d.ts.map +1 -0
- package/dist/conformance/ConnectorReference.js +185 -0
- package/dist/conformance/ConnectorReference.js.map +1 -0
- package/dist/conformance/ContextAccounting.d.ts +8 -0
- package/dist/conformance/ContextAccounting.d.ts.map +1 -0
- package/dist/conformance/ContextAccounting.js +125 -0
- package/dist/conformance/ContextAccounting.js.map +1 -0
- package/dist/conformance/Daemon.d.ts +150 -0
- package/dist/conformance/Daemon.d.ts.map +1 -0
- package/dist/conformance/Daemon.js +718 -0
- package/dist/conformance/Daemon.js.map +1 -0
- package/dist/conformance/DaemonReference.d.ts +15 -0
- package/dist/conformance/DaemonReference.d.ts.map +1 -0
- package/dist/conformance/DaemonReference.js +163 -0
- package/dist/conformance/DaemonReference.js.map +1 -0
- package/dist/conformance/DbTx.d.ts +17 -0
- package/dist/conformance/DbTx.d.ts.map +1 -0
- package/dist/conformance/DbTx.js +184 -0
- package/dist/conformance/DbTx.js.map +1 -0
- package/dist/conformance/DecisionTokens.d.ts +3 -0
- package/dist/conformance/DecisionTokens.d.ts.map +1 -0
- package/dist/conformance/DecisionTokens.js +551 -0
- package/dist/conformance/DecisionTokens.js.map +1 -0
- package/dist/conformance/Delegation.d.ts +3 -0
- package/dist/conformance/Delegation.d.ts.map +1 -0
- package/dist/conformance/Delegation.js +149 -0
- package/dist/conformance/Delegation.js.map +1 -0
- package/dist/conformance/DeskReference.d.ts +21 -0
- package/dist/conformance/DeskReference.d.ts.map +1 -0
- package/dist/conformance/DeskReference.js +47 -0
- package/dist/conformance/DeskReference.js.map +1 -0
- package/dist/conformance/DeviceControl.d.ts +3 -0
- package/dist/conformance/DeviceControl.d.ts.map +1 -0
- package/dist/conformance/DeviceControl.js +579 -0
- package/dist/conformance/DeviceControl.js.map +1 -0
- package/dist/conformance/Directory.d.ts +36 -0
- package/dist/conformance/Directory.d.ts.map +1 -0
- package/dist/conformance/Directory.js +253 -0
- package/dist/conformance/Directory.js.map +1 -0
- package/dist/conformance/DirectoryProvider.d.ts +4 -0
- package/dist/conformance/DirectoryProvider.d.ts.map +1 -0
- package/dist/conformance/DirectoryProvider.js +58 -0
- package/dist/conformance/DirectoryProvider.js.map +1 -0
- package/dist/conformance/DocumentSource.d.ts +4 -0
- package/dist/conformance/DocumentSource.d.ts.map +1 -0
- package/dist/conformance/DocumentSource.js +43 -0
- package/dist/conformance/DocumentSource.js.map +1 -0
- package/dist/conformance/EndpointReference.d.ts +40 -0
- package/dist/conformance/EndpointReference.d.ts.map +1 -0
- package/dist/conformance/EndpointReference.js +67 -0
- package/dist/conformance/EndpointReference.js.map +1 -0
- package/dist/conformance/Files.d.ts +40 -0
- package/dist/conformance/Files.d.ts.map +1 -0
- package/dist/conformance/Files.js +592 -0
- package/dist/conformance/Files.js.map +1 -0
- package/dist/conformance/FilesReference.d.ts +31 -0
- package/dist/conformance/FilesReference.d.ts.map +1 -0
- package/dist/conformance/FilesReference.js +116 -0
- package/dist/conformance/FilesReference.js.map +1 -0
- package/dist/conformance/FilesSubject.d.ts +46 -0
- package/dist/conformance/FilesSubject.d.ts.map +1 -0
- package/dist/conformance/FilesSubject.js +3 -0
- package/dist/conformance/FilesSubject.js.map +1 -0
- package/dist/conformance/Flags.d.ts +3 -0
- package/dist/conformance/Flags.d.ts.map +1 -0
- package/dist/conformance/Flags.js +183 -0
- package/dist/conformance/Flags.js.map +1 -0
- package/dist/conformance/Host.d.ts +64 -0
- package/dist/conformance/Host.d.ts.map +1 -0
- package/dist/conformance/Host.js +152 -0
- package/dist/conformance/Host.js.map +1 -0
- package/dist/conformance/HttpApi.d.ts +5 -0
- package/dist/conformance/HttpApi.d.ts.map +1 -0
- package/dist/conformance/HttpApi.js +131 -0
- package/dist/conformance/HttpApi.js.map +1 -0
- package/dist/conformance/InboxReference.d.ts +28 -0
- package/dist/conformance/InboxReference.d.ts.map +1 -0
- package/dist/conformance/InboxReference.js +331 -0
- package/dist/conformance/InboxReference.js.map +1 -0
- package/dist/conformance/InboxSubject.d.ts +92 -0
- package/dist/conformance/InboxSubject.d.ts.map +1 -0
- package/dist/conformance/InboxSubject.js +16 -0
- package/dist/conformance/InboxSubject.js.map +1 -0
- package/dist/conformance/Ingestion.d.ts +10 -0
- package/dist/conformance/Ingestion.d.ts.map +1 -0
- package/dist/conformance/Ingestion.js +335 -0
- package/dist/conformance/Ingestion.js.map +1 -0
- package/dist/conformance/Ingress.d.ts +62 -0
- package/dist/conformance/Ingress.d.ts.map +1 -0
- package/dist/conformance/Ingress.js +346 -0
- package/dist/conformance/Ingress.js.map +1 -0
- package/dist/conformance/Invocation.d.ts +3 -0
- package/dist/conformance/Invocation.d.ts.map +1 -0
- package/dist/conformance/Invocation.js +665 -0
- package/dist/conformance/Invocation.js.map +1 -0
- package/dist/conformance/IsolationMatrix.d.ts +60 -0
- package/dist/conformance/IsolationMatrix.d.ts.map +1 -0
- package/dist/conformance/IsolationMatrix.js +196 -0
- package/dist/conformance/IsolationMatrix.js.map +1 -0
- package/dist/conformance/LiveConnection.d.ts +72 -0
- package/dist/conformance/LiveConnection.d.ts.map +1 -0
- package/dist/conformance/LiveConnection.js +125 -0
- package/dist/conformance/LiveConnection.js.map +1 -0
- package/dist/conformance/LocalClient.d.ts +62 -0
- package/dist/conformance/LocalClient.d.ts.map +1 -0
- package/dist/conformance/LocalClient.js +526 -0
- package/dist/conformance/LocalClient.js.map +1 -0
- package/dist/conformance/Locale.d.ts +28 -0
- package/dist/conformance/Locale.d.ts.map +1 -0
- package/dist/conformance/Locale.js +115 -0
- package/dist/conformance/Locale.js.map +1 -0
- package/dist/conformance/MachineIdentity.d.ts +39 -0
- package/dist/conformance/MachineIdentity.d.ts.map +1 -0
- package/dist/conformance/MachineIdentity.js +595 -0
- package/dist/conformance/MachineIdentity.js.map +1 -0
- package/dist/conformance/MailProvider.d.ts +4 -0
- package/dist/conformance/MailProvider.d.ts.map +1 -0
- package/dist/conformance/MailProvider.js +167 -0
- package/dist/conformance/MailProvider.js.map +1 -0
- package/dist/conformance/Memory.d.ts +10 -0
- package/dist/conformance/Memory.d.ts.map +1 -0
- package/dist/conformance/Memory.js +179 -0
- package/dist/conformance/Memory.js.map +1 -0
- package/dist/conformance/Messaging.d.ts +49 -0
- package/dist/conformance/Messaging.d.ts.map +1 -0
- package/dist/conformance/Messaging.js +117 -0
- package/dist/conformance/Messaging.js.map +1 -0
- package/dist/conformance/Metering.d.ts +26 -0
- package/dist/conformance/Metering.d.ts.map +1 -0
- package/dist/conformance/Metering.js +236 -0
- package/dist/conformance/Metering.js.map +1 -0
- package/dist/conformance/ModelProvider.d.ts +32 -0
- package/dist/conformance/ModelProvider.d.ts.map +1 -0
- package/dist/conformance/ModelProvider.js +100 -0
- package/dist/conformance/ModelProvider.js.map +1 -0
- package/dist/conformance/ModuleManifest.d.ts +9 -0
- package/dist/conformance/ModuleManifest.d.ts.map +1 -0
- package/dist/conformance/ModuleManifest.js +542 -0
- package/dist/conformance/ModuleManifest.js.map +1 -0
- package/dist/conformance/NotebookAgent.d.ts +32 -0
- package/dist/conformance/NotebookAgent.d.ts.map +1 -0
- package/dist/conformance/NotebookAgent.js +31 -0
- package/dist/conformance/NotebookAgent.js.map +1 -0
- package/dist/conformance/NotificationChannel.d.ts +40 -0
- package/dist/conformance/NotificationChannel.d.ts.map +1 -0
- package/dist/conformance/NotificationChannel.js +78 -0
- package/dist/conformance/NotificationChannel.js.map +1 -0
- package/dist/conformance/Notifications.d.ts +3 -0
- package/dist/conformance/Notifications.d.ts.map +1 -0
- package/dist/conformance/Notifications.js +240 -0
- package/dist/conformance/Notifications.js.map +1 -0
- package/dist/conformance/OAuthClient.d.ts +123 -0
- package/dist/conformance/OAuthClient.d.ts.map +1 -0
- package/dist/conformance/OAuthClient.js +204 -0
- package/dist/conformance/OAuthClient.js.map +1 -0
- package/dist/conformance/Outbox.d.ts +3 -0
- package/dist/conformance/Outbox.d.ts.map +1 -0
- package/dist/conformance/Outbox.js +266 -0
- package/dist/conformance/Outbox.js.map +1 -0
- package/dist/conformance/PlatformReference.d.ts +5 -0
- package/dist/conformance/PlatformReference.d.ts.map +1 -0
- package/dist/conformance/PlatformReference.js +66 -0
- package/dist/conformance/PlatformReference.js.map +1 -0
- package/dist/conformance/PlatformSubject.d.ts +45 -0
- package/dist/conformance/PlatformSubject.d.ts.map +1 -0
- package/dist/conformance/PlatformSubject.js +3 -0
- package/dist/conformance/PlatformSubject.js.map +1 -0
- package/dist/conformance/Privacy.d.ts +3 -0
- package/dist/conformance/Privacy.d.ts.map +1 -0
- package/dist/conformance/Privacy.js +437 -0
- package/dist/conformance/Privacy.js.map +1 -0
- package/dist/conformance/Progress.d.ts +3 -0
- package/dist/conformance/Progress.d.ts.map +1 -0
- package/dist/conformance/Progress.js +153 -0
- package/dist/conformance/Progress.js.map +1 -0
- package/dist/conformance/Push.d.ts +38 -0
- package/dist/conformance/Push.d.ts.map +1 -0
- package/dist/conformance/Push.js +649 -0
- package/dist/conformance/Push.js.map +1 -0
- package/dist/conformance/PushReference.d.ts +3 -0
- package/dist/conformance/PushReference.d.ts.map +1 -0
- package/dist/conformance/PushReference.js +97 -0
- package/dist/conformance/PushReference.js.map +1 -0
- package/dist/conformance/QuerySurface.d.ts +9 -0
- package/dist/conformance/QuerySurface.d.ts.map +1 -0
- package/dist/conformance/QuerySurface.js +349 -0
- package/dist/conformance/QuerySurface.js.map +1 -0
- package/dist/conformance/Readiness.d.ts +23 -0
- package/dist/conformance/Readiness.d.ts.map +1 -0
- package/dist/conformance/Readiness.js +110 -0
- package/dist/conformance/Readiness.js.map +1 -0
- package/dist/conformance/Reference.d.ts +17 -0
- package/dist/conformance/Reference.d.ts.map +1 -0
- package/dist/conformance/Reference.js +246 -0
- package/dist/conformance/Reference.js.map +1 -0
- package/dist/conformance/Release.d.ts +73 -0
- package/dist/conformance/Release.d.ts.map +1 -0
- package/dist/conformance/Release.js +556 -0
- package/dist/conformance/Release.js.map +1 -0
- package/dist/conformance/ReleaseReference.d.ts +5 -0
- package/dist/conformance/ReleaseReference.d.ts.map +1 -0
- package/dist/conformance/ReleaseReference.js +124 -0
- package/dist/conformance/ReleaseReference.js.map +1 -0
- package/dist/conformance/ResultRendering.d.ts +3 -0
- package/dist/conformance/ResultRendering.d.ts.map +1 -0
- package/dist/conformance/ResultRendering.js +120 -0
- package/dist/conformance/ResultRendering.js.map +1 -0
- package/dist/conformance/Sandbox.d.ts +58 -0
- package/dist/conformance/Sandbox.d.ts.map +1 -0
- package/dist/conformance/Sandbox.js +213 -0
- package/dist/conformance/Sandbox.js.map +1 -0
- package/dist/conformance/SandboxReference.d.ts +3 -0
- package/dist/conformance/SandboxReference.d.ts.map +1 -0
- package/dist/conformance/SandboxReference.js +44 -0
- package/dist/conformance/SandboxReference.js.map +1 -0
- package/dist/conformance/Scheduler.d.ts +106 -0
- package/dist/conformance/Scheduler.d.ts.map +1 -0
- package/dist/conformance/Scheduler.js +576 -0
- package/dist/conformance/Scheduler.js.map +1 -0
- package/dist/conformance/ScreenContext.d.ts +84 -0
- package/dist/conformance/ScreenContext.d.ts.map +1 -0
- package/dist/conformance/ScreenContext.js +290 -0
- package/dist/conformance/ScreenContext.js.map +1 -0
- package/dist/conformance/Search.d.ts +3 -0
- package/dist/conformance/Search.d.ts.map +1 -0
- package/dist/conformance/Search.js +333 -0
- package/dist/conformance/Search.js.map +1 -0
- package/dist/conformance/Secrets.d.ts +8 -0
- package/dist/conformance/Secrets.d.ts.map +1 -0
- package/dist/conformance/Secrets.js +231 -0
- package/dist/conformance/Secrets.js.map +1 -0
- package/dist/conformance/SecretsReference.d.ts +44 -0
- package/dist/conformance/SecretsReference.d.ts.map +1 -0
- package/dist/conformance/SecretsReference.js +73 -0
- package/dist/conformance/SecretsReference.js.map +1 -0
- package/dist/conformance/ServicesReference.d.ts +8 -0
- package/dist/conformance/ServicesReference.d.ts.map +1 -0
- package/dist/conformance/ServicesReference.js +273 -0
- package/dist/conformance/ServicesReference.js.map +1 -0
- package/dist/conformance/ServicesSubject.d.ts +104 -0
- package/dist/conformance/ServicesSubject.d.ts.map +1 -0
- package/dist/conformance/ServicesSubject.js +2 -0
- package/dist/conformance/ServicesSubject.js.map +1 -0
- package/dist/conformance/Settings.d.ts +3 -0
- package/dist/conformance/Settings.d.ts.map +1 -0
- package/dist/conformance/Settings.js +177 -0
- package/dist/conformance/Settings.js.map +1 -0
- package/dist/conformance/Sharing.d.ts +3 -0
- package/dist/conformance/Sharing.d.ts.map +1 -0
- package/dist/conformance/Sharing.js +368 -0
- package/dist/conformance/Sharing.js.map +1 -0
- package/dist/conformance/ShellSubject.d.ts +29 -0
- package/dist/conformance/ShellSubject.d.ts.map +1 -0
- package/dist/conformance/ShellSubject.js +13 -0
- package/dist/conformance/ShellSubject.js.map +1 -0
- package/dist/conformance/SignOutRace.d.ts +23 -0
- package/dist/conformance/SignOutRace.d.ts.map +1 -0
- package/dist/conformance/SignOutRace.js +49 -0
- package/dist/conformance/SignOutRace.js.map +1 -0
- package/dist/conformance/Slot.d.ts +3 -0
- package/dist/conformance/Slot.d.ts.map +1 -0
- package/dist/conformance/Slot.js +79 -0
- package/dist/conformance/Slot.js.map +1 -0
- package/dist/conformance/Space.d.ts +63 -0
- package/dist/conformance/Space.d.ts.map +1 -0
- package/dist/conformance/Space.js +294 -0
- package/dist/conformance/Space.js.map +1 -0
- package/dist/conformance/StorageAdapter.d.ts +76 -0
- package/dist/conformance/StorageAdapter.d.ts.map +1 -0
- package/dist/conformance/StorageAdapter.js +181 -0
- package/dist/conformance/StorageAdapter.js.map +1 -0
- package/dist/conformance/StorageBackend.d.ts +23 -0
- package/dist/conformance/StorageBackend.d.ts.map +1 -0
- package/dist/conformance/StorageBackend.js +274 -0
- package/dist/conformance/StorageBackend.js.map +1 -0
- package/dist/conformance/Subject.d.ts +198 -0
- package/dist/conformance/Subject.d.ts.map +1 -0
- package/dist/conformance/Subject.js +26 -0
- package/dist/conformance/Subject.js.map +1 -0
- package/dist/conformance/Sync.d.ts +3 -0
- package/dist/conformance/Sync.d.ts.map +1 -0
- package/dist/conformance/Sync.js +190 -0
- package/dist/conformance/Sync.js.map +1 -0
- package/dist/conformance/Telemetry.d.ts +3 -0
- package/dist/conformance/Telemetry.d.ts.map +1 -0
- package/dist/conformance/Telemetry.js +218 -0
- package/dist/conformance/Telemetry.js.map +1 -0
- package/dist/conformance/ThemeTokens.d.ts +22 -0
- package/dist/conformance/ThemeTokens.d.ts.map +1 -0
- package/dist/conformance/ThemeTokens.js +121 -0
- package/dist/conformance/ThemeTokens.js.map +1 -0
- package/dist/conformance/ToolSource.d.ts +5 -0
- package/dist/conformance/ToolSource.d.ts.map +1 -0
- package/dist/conformance/ToolSource.js +520 -0
- package/dist/conformance/ToolSource.js.map +1 -0
- package/dist/conformance/Versioning.d.ts +3 -0
- package/dist/conformance/Versioning.d.ts.map +1 -0
- package/dist/conformance/Versioning.js +160 -0
- package/dist/conformance/Versioning.js.map +1 -0
- package/dist/conformance/View.d.ts +3 -0
- package/dist/conformance/View.d.ts.map +1 -0
- package/dist/conformance/View.js +121 -0
- package/dist/conformance/View.js.map +1 -0
- package/dist/conformance/WorkItems.d.ts +3 -0
- package/dist/conformance/WorkItems.d.ts.map +1 -0
- package/dist/conformance/WorkItems.js +152 -0
- package/dist/conformance/WorkItems.js.map +1 -0
- package/dist/conformance/Workflow.d.ts +63 -0
- package/dist/conformance/Workflow.d.ts.map +1 -0
- package/dist/conformance/Workflow.js +235 -0
- package/dist/conformance/Workflow.js.map +1 -0
- package/dist/conformance/acme/chatlog.d.ts +591 -0
- package/dist/conformance/acme/chatlog.d.ts.map +1 -0
- package/dist/conformance/acme/chatlog.js +101 -0
- package/dist/conformance/acme/chatlog.js.map +1 -0
- package/dist/conformance/acme/connector.d.ts +12 -0
- package/dist/conformance/acme/connector.d.ts.map +1 -0
- package/dist/conformance/acme/connector.js +123 -0
- package/dist/conformance/acme/connector.js.map +1 -0
- package/dist/conformance/acme/migrations/0000_messages.sql +8 -0
- package/dist/conformance/archive/app.d.ts +728 -0
- package/dist/conformance/archive/app.d.ts.map +1 -0
- package/dist/conformance/archive/app.js +30 -0
- package/dist/conformance/archive/app.js.map +1 -0
- package/dist/conformance/archive/contract.d.ts +467 -0
- package/dist/conformance/archive/contract.d.ts.map +1 -0
- package/dist/conformance/archive/contract.js +187 -0
- package/dist/conformance/archive/contract.js.map +1 -0
- package/dist/conformance/archive/memo.sync.gen.d.ts +148 -0
- package/dist/conformance/archive/memo.sync.gen.d.ts.map +1 -0
- package/dist/conformance/archive/memo.sync.gen.js +23 -0
- package/dist/conformance/archive/memo.sync.gen.js.map +1 -0
- package/dist/conformance/archive/migrations/archive/0000_archive.sql +9 -0
- package/dist/conformance/archive/migrations/memo/0000_memo.sql +6 -0
- package/dist/conformance/archive/schema.d.ts +185 -0
- package/dist/conformance/archive/schema.d.ts.map +1 -0
- package/dist/conformance/archive/schema.js +22 -0
- package/dist/conformance/archive/schema.js.map +1 -0
- package/dist/conformance/archive/server.d.ts +273 -0
- package/dist/conformance/archive/server.d.ts.map +1 -0
- package/dist/conformance/archive/server.js +127 -0
- package/dist/conformance/archive/server.js.map +1 -0
- package/dist/conformance/archive/sync.gen.d.ts +319 -0
- package/dist/conformance/archive/sync.gen.d.ts.map +1 -0
- package/dist/conformance/archive/sync.gen.js +29 -0
- package/dist/conformance/archive/sync.gen.js.map +1 -0
- package/dist/conformance/atlas/app.d.ts +3 -0
- package/dist/conformance/atlas/app.d.ts.map +1 -0
- package/dist/conformance/atlas/app.js +15 -0
- package/dist/conformance/atlas/app.js.map +1 -0
- package/dist/conformance/atlas/contract.d.ts +489 -0
- package/dist/conformance/atlas/contract.d.ts.map +1 -0
- package/dist/conformance/atlas/contract.js +114 -0
- package/dist/conformance/atlas/contract.js.map +1 -0
- package/dist/conformance/crm/app.d.ts +304 -0
- package/dist/conformance/crm/app.d.ts.map +1 -0
- package/dist/conformance/crm/app.js +95 -0
- package/dist/conformance/crm/app.js.map +1 -0
- package/dist/conformance/crm/contract.d.ts +586 -0
- package/dist/conformance/crm/contract.d.ts.map +1 -0
- package/dist/conformance/crm/contract.js +153 -0
- package/dist/conformance/crm/contract.js.map +1 -0
- package/dist/conformance/crm/migrations/crm/0000_crm.sql +18 -0
- package/dist/conformance/crm/migrations/team/0000_team.sql +6 -0
- package/dist/conformance/crm/schema.d.ts +261 -0
- package/dist/conformance/crm/schema.d.ts.map +1 -0
- package/dist/conformance/crm/schema.js +25 -0
- package/dist/conformance/crm/schema.js.map +1 -0
- package/dist/conformance/crm/sync.gen.d.ts +188 -0
- package/dist/conformance/crm/sync.gen.d.ts.map +1 -0
- package/dist/conformance/crm/sync.gen.js +25 -0
- package/dist/conformance/crm/sync.gen.js.map +1 -0
- package/dist/conformance/desk/contract.d.ts +306 -0
- package/dist/conformance/desk/contract.d.ts.map +1 -0
- package/dist/conformance/desk/contract.js +56 -0
- package/dist/conformance/desk/contract.js.map +1 -0
- package/dist/conformance/desk/migrations/0000_notes.sql +7 -0
- package/dist/conformance/desk/server.d.ts +231 -0
- package/dist/conformance/desk/server.d.ts.map +1 -0
- package/dist/conformance/desk/server.js +123 -0
- package/dist/conformance/desk/server.js.map +1 -0
- package/dist/conformance/drafts/migrations/0000_drafts.sql +8 -0
- package/dist/conformance/drafts/module.d.ts +571 -0
- package/dist/conformance/drafts/module.d.ts.map +1 -0
- package/dist/conformance/drafts/module.js +190 -0
- package/dist/conformance/drafts/module.js.map +1 -0
- package/dist/conformance/fixture/app.d.ts +24 -0
- package/dist/conformance/fixture/app.d.ts.map +1 -0
- package/dist/conformance/fixture/app.js +26 -0
- package/dist/conformance/fixture/app.js.map +1 -0
- package/dist/conformance/fixture/docs/bad-sync.d.ts +105 -0
- package/dist/conformance/fixture/docs/bad-sync.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/bad-sync.js +22 -0
- package/dist/conformance/fixture/docs/bad-sync.js.map +1 -0
- package/dist/conformance/fixture/docs/contract.d.ts +1091 -0
- package/dist/conformance/fixture/docs/contract.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/contract.js +277 -0
- package/dist/conformance/fixture/docs/contract.js.map +1 -0
- package/dist/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
- package/dist/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
- package/dist/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
- package/dist/conformance/fixture/docs/policy.cedar +110 -0
- package/dist/conformance/fixture/docs/schema.d.ts +308 -0
- package/dist/conformance/fixture/docs/schema.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/schema.js +36 -0
- package/dist/conformance/fixture/docs/schema.js.map +1 -0
- package/dist/conformance/fixture/docs/server.d.ts +552 -0
- package/dist/conformance/fixture/docs/server.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/server.js +192 -0
- package/dist/conformance/fixture/docs/server.js.map +1 -0
- package/dist/conformance/fixture/docs/sync.d.ts +402 -0
- package/dist/conformance/fixture/docs/sync.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/sync.gen.d.ts +574 -0
- package/dist/conformance/fixture/docs/sync.gen.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/sync.gen.js +48 -0
- package/dist/conformance/fixture/docs/sync.gen.js.map +1 -0
- package/dist/conformance/fixture/docs/sync.js +23 -0
- package/dist/conformance/fixture/docs/sync.js.map +1 -0
- package/dist/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
- package/dist/conformance/fixture/peer/module.d.ts +306 -0
- package/dist/conformance/fixture/peer/module.d.ts.map +1 -0
- package/dist/conformance/fixture/peer/module.js +44 -0
- package/dist/conformance/fixture/peer/module.js.map +1 -0
- package/dist/conformance/fixture/release/blocking/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/blocking/0001_wait.sql +2 -0
- package/dist/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
- package/dist/conformance/fixture/release/broken/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/broken/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/broken/0002_label.sql +3 -0
- package/dist/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
- package/dist/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/escape/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/escape/0001_escape.sql +5 -0
- package/dist/conformance/fixture/release/misnamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
- package/dist/conformance/fixture/release/module.d.ts +1878 -0
- package/dist/conformance/fixture/release/module.d.ts.map +1 -0
- package/dist/conformance/fixture/release/module.js +102 -0
- package/dist/conformance/fixture/release/module.js.map +1 -0
- package/dist/conformance/fixture/release/outside/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/outside/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/outside/0002_index.sql +4 -0
- package/dist/conformance/fixture/release/outside/0003_later.sql +1 -0
- package/dist/conformance/fixture/release/renamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/renamed/0001_misname.sql +10 -0
- package/dist/conformance/fixture/release/renamed/0002_restore.sql +1 -0
- package/dist/conformance/fixture/release/rogue/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/rogue/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/rogue/0002_definer.sql +1 -0
- package/dist/conformance/fixture/release/slow/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/undeclared/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/undeclared/0002_index.sql +1 -0
- package/dist/conformance/fixture/release/v1/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/v2/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/v2/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/v2/0002_label.sql +3 -0
- package/dist/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
- package/dist/conformance/kit-hash.d.ts +8 -0
- package/dist/conformance/kit-hash.d.ts.map +1 -0
- package/dist/conformance/kit-hash.js +20 -0
- package/dist/conformance/kit-hash.js.map +1 -0
- package/dist/conformance/ledger/contract.d.ts +380 -0
- package/dist/conformance/ledger/contract.d.ts.map +1 -0
- package/dist/conformance/ledger/contract.js +81 -0
- package/dist/conformance/ledger/contract.js.map +1 -0
- package/dist/conformance/ledger/migrations/0000_entries.sql +8 -0
- package/dist/conformance/ledger/server.d.ts +312 -0
- package/dist/conformance/ledger/server.d.ts.map +1 -0
- package/dist/conformance/ledger/server.js +152 -0
- package/dist/conformance/ledger/server.js.map +1 -0
- package/dist/conformance/library/app.d.ts +616 -0
- package/dist/conformance/library/app.d.ts.map +1 -0
- package/dist/conformance/library/app.js +35 -0
- package/dist/conformance/library/app.js.map +1 -0
- package/dist/conformance/library/contract.d.ts +377 -0
- package/dist/conformance/library/contract.d.ts.map +1 -0
- package/dist/conformance/library/contract.js +63 -0
- package/dist/conformance/library/contract.js.map +1 -0
- package/dist/conformance/library/migrations/0000_library.sql +14 -0
- package/dist/conformance/library/schema.d.ts +174 -0
- package/dist/conformance/library/schema.d.ts.map +1 -0
- package/dist/conformance/library/schema.js +24 -0
- package/dist/conformance/library/schema.js.map +1 -0
- package/dist/conformance/library/server.d.ts +191 -0
- package/dist/conformance/library/server.d.ts.map +1 -0
- package/dist/conformance/library/server.js +52 -0
- package/dist/conformance/library/server.js.map +1 -0
- package/dist/conformance/library/sync.gen.d.ts +519 -0
- package/dist/conformance/library/sync.gen.d.ts.map +1 -0
- package/dist/conformance/library/sync.gen.js +42 -0
- package/dist/conformance/library/sync.gen.js.map +1 -0
- package/dist/conformance/locale/catalog.d.ts +93 -0
- package/dist/conformance/locale/catalog.d.ts.map +1 -0
- package/dist/conformance/locale/catalog.js +104 -0
- package/dist/conformance/locale/catalog.js.map +1 -0
- package/dist/conformance/notebook/app.d.ts +1039 -0
- package/dist/conformance/notebook/app.d.ts.map +1 -0
- package/dist/conformance/notebook/app.js +88 -0
- package/dist/conformance/notebook/app.js.map +1 -0
- package/dist/conformance/notebook/evals/pages.evals.json +94 -0
- package/dist/conformance/notebook/migrations/0000_notebook.sql +10 -0
- package/dist/conformance/notebook/module.d.ts +717 -0
- package/dist/conformance/notebook/module.d.ts.map +1 -0
- package/dist/conformance/notebook/module.js +188 -0
- package/dist/conformance/notebook/module.js.map +1 -0
- package/dist/conformance/pad/app.d.ts +9 -0
- package/dist/conformance/pad/app.d.ts.map +1 -0
- package/dist/conformance/pad/app.js +13 -0
- package/dist/conformance/pad/app.js.map +1 -0
- package/dist/conformance/pad/contract.d.ts +281 -0
- package/dist/conformance/pad/contract.d.ts.map +1 -0
- package/dist/conformance/pad/contract.js +66 -0
- package/dist/conformance/pad/contract.js.map +1 -0
- package/dist/conformance/pad/migrations/pad/0000_pad.sql +8 -0
- package/dist/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
- package/dist/conformance/pad/schema.d.ts +127 -0
- package/dist/conformance/pad/schema.d.ts.map +1 -0
- package/dist/conformance/pad/schema.js +17 -0
- package/dist/conformance/pad/schema.js.map +1 -0
- package/dist/conformance/pad/server.d.ts +149 -0
- package/dist/conformance/pad/server.d.ts.map +1 -0
- package/dist/conformance/pad/server.js +81 -0
- package/dist/conformance/pad/server.js.map +1 -0
- package/dist/conformance/purchases/app.d.ts +480 -0
- package/dist/conformance/purchases/app.d.ts.map +1 -0
- package/dist/conformance/purchases/app.js +32 -0
- package/dist/conformance/purchases/app.js.map +1 -0
- package/dist/conformance/purchases/contract.d.ts +720 -0
- package/dist/conformance/purchases/contract.d.ts.map +1 -0
- package/dist/conformance/purchases/contract.js +148 -0
- package/dist/conformance/purchases/contract.js.map +1 -0
- package/dist/conformance/purchases/migrations/0000_purchases.sql +17 -0
- package/dist/conformance/purchases/server.d.ts +250 -0
- package/dist/conformance/purchases/server.d.ts.map +1 -0
- package/dist/conformance/purchases/server.js +85 -0
- package/dist/conformance/purchases/server.js.map +1 -0
- package/dist/conformance/studio/app.d.ts +996 -0
- package/dist/conformance/studio/app.d.ts.map +1 -0
- package/dist/conformance/studio/app.js +251 -0
- package/dist/conformance/studio/app.js.map +1 -0
- package/dist/conformance/studio/contract.d.ts +1318 -0
- package/dist/conformance/studio/contract.d.ts.map +1 -0
- package/dist/conformance/studio/contract.js +280 -0
- package/dist/conformance/studio/contract.js.map +1 -0
- package/dist/conformance/studio/migrations/billing/0000_billing.sql +6 -0
- package/dist/conformance/studio/migrations/journal/0000_journal.sql +9 -0
- package/dist/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
- package/dist/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
- package/dist/conformance/workshop/app.d.ts +8 -0
- package/dist/conformance/workshop/app.d.ts.map +1 -0
- package/dist/conformance/workshop/app.js +13 -0
- package/dist/conformance/workshop/app.js.map +1 -0
- package/dist/conformance/workshop/migrations/0000_notes.sql +7 -0
- package/dist/conformance/workshop/module.d.ts +407 -0
- package/dist/conformance/workshop/module.d.ts.map +1 -0
- package/dist/conformance/workshop/module.js +71 -0
- package/dist/conformance/workshop/module.js.map +1 -0
- package/dist/fakes/AcmeFake.d.ts +46 -0
- package/dist/fakes/AcmeFake.d.ts.map +1 -0
- package/dist/fakes/AcmeFake.js +131 -0
- package/dist/fakes/AcmeFake.js.map +1 -0
- package/dist/fakes/ApnsFake.d.ts +79 -0
- package/dist/fakes/ApnsFake.d.ts.map +1 -0
- package/dist/fakes/ApnsFake.js +220 -0
- package/dist/fakes/ApnsFake.js.map +1 -0
- package/dist/fakes/FcmFake.d.ts +46 -0
- package/dist/fakes/FcmFake.d.ts.map +1 -0
- package/dist/fakes/FcmFake.js +185 -0
- package/dist/fakes/FcmFake.js.map +1 -0
- package/dist/fakes/GoogleFake.d.ts +221 -0
- package/dist/fakes/GoogleFake.d.ts.map +1 -0
- package/dist/fakes/GoogleFake.js +1035 -0
- package/dist/fakes/GoogleFake.js.map +1 -0
- package/dist/fakes/HttpApiFake.d.ts +22 -0
- package/dist/fakes/HttpApiFake.d.ts.map +1 -0
- package/dist/fakes/HttpApiFake.js +74 -0
- package/dist/fakes/HttpApiFake.js.map +1 -0
- package/dist/fakes/McpFake.d.ts +80 -0
- package/dist/fakes/McpFake.d.ts.map +1 -0
- package/dist/fakes/McpFake.js +312 -0
- package/dist/fakes/McpFake.js.map +1 -0
- package/dist/fakes/MicrosoftGraphFake.d.ts +254 -0
- package/dist/fakes/MicrosoftGraphFake.d.ts.map +1 -0
- package/dist/fakes/MicrosoftGraphFake.js +850 -0
- package/dist/fakes/MicrosoftGraphFake.js.map +1 -0
- package/dist/fakes/S3Fake.d.ts +29 -0
- package/dist/fakes/S3Fake.d.ts.map +1 -0
- package/dist/fakes/S3Fake.js +347 -0
- package/dist/fakes/S3Fake.js.map +1 -0
- package/dist/fakes/Server.d.ts +137 -0
- package/dist/fakes/Server.d.ts.map +1 -0
- package/dist/fakes/Server.js +357 -0
- package/dist/fakes/Server.js.map +1 -0
- package/dist/fakes/SignInProviderFake.d.ts +21 -0
- package/dist/fakes/SignInProviderFake.d.ts.map +1 -0
- package/dist/fakes/SignInProviderFake.js +56 -0
- package/dist/fakes/SignInProviderFake.js.map +1 -0
- package/dist/fakes/SlackFake.d.ts +136 -0
- package/dist/fakes/SlackFake.d.ts.map +1 -0
- package/dist/fakes/SlackFake.js +787 -0
- package/dist/fakes/SlackFake.js.map +1 -0
- package/dist/fakes/Store.d.ts +40 -0
- package/dist/fakes/Store.d.ts.map +1 -0
- package/dist/fakes/Store.js +82 -0
- package/dist/fakes/Store.js.map +1 -0
- package/dist/fakes/TelemetryFakes.d.ts +77 -0
- package/dist/fakes/TelemetryFakes.d.ts.map +1 -0
- package/dist/fakes/TelemetryFakes.js +121 -0
- package/dist/fakes/TelemetryFakes.js.map +1 -0
- package/dist/fakes/TestCa.d.ts +11 -0
- package/dist/fakes/TestCa.d.ts.map +1 -0
- package/dist/fakes/TestCa.js +115 -0
- package/dist/fakes/TestCa.js.map +1 -0
- package/dist/fakes/WorkOsFake.d.ts +40 -0
- package/dist/fakes/WorkOsFake.d.ts.map +1 -0
- package/dist/fakes/WorkOsFake.js +103 -0
- package/dist/fakes/WorkOsFake.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/make/reference.d.ts +520 -0
- package/dist/make/reference.d.ts.map +1 -0
- package/dist/make/reference.js +182 -0
- package/dist/make/reference.js.map +1 -0
- package/dist/make/sources.d.ts +48 -0
- package/dist/make/sources.d.ts.map +1 -0
- package/dist/make/sources.js +806 -0
- package/dist/make/sources.js.map +1 -0
- package/package.json +77 -3
- package/src/Admin.ts +82 -0
- package/src/Agent.ts +289 -0
- package/src/AgentSurface.ts +51 -0
- package/src/Embedder.ts +69 -0
- package/src/EvalMain.ts +81 -0
- package/src/Evals.ts +490 -0
- package/src/Kernel.ts +228 -0
- package/src/Launch.ts +428 -0
- package/src/Locks.ts +123 -0
- package/src/Routes.ts +65 -0
- package/src/ScriptedChatModel.ts +189 -0
- package/src/SmtpSink.ts +205 -0
- package/src/System.ts +1072 -0
- package/src/TcpProxy.ts +102 -0
- package/src/auth/TrustedProxyAuth.ts +173 -0
- package/src/conformance/ActionConsent.ts +437 -0
- package/src/conformance/ActionRegistry.ts +174 -0
- package/src/conformance/Actor.ts +216 -0
- package/src/conformance/AgentReference.ts +171 -0
- package/src/conformance/AgentResources.ts +548 -0
- package/src/conformance/AgentRuntime.ts +388 -0
- package/src/conformance/AgentSubject.ts +103 -0
- package/src/conformance/Approvals.ts +363 -0
- package/src/conformance/Audit.ts +257 -0
- package/src/conformance/CalendarProvider.ts +156 -0
- package/src/conformance/CapabilityKit.ts +564 -0
- package/src/conformance/ClientSDK.ts +233 -0
- package/src/conformance/CollabDocument.ts +1203 -0
- package/src/conformance/CollabReference.ts +152 -0
- package/src/conformance/CollabSubject.ts +64 -0
- package/src/conformance/Command.ts +75 -0
- package/src/conformance/Connections.ts +357 -0
- package/src/conformance/ConnectionsReference.ts +172 -0
- package/src/conformance/ConnectorReference.ts +280 -0
- package/src/conformance/ContextAccounting.ts +169 -0
- package/src/conformance/Daemon.ts +936 -0
- package/src/conformance/DaemonReference.ts +189 -0
- package/src/conformance/DbTx.ts +253 -0
- package/src/conformance/DecisionTokens.ts +652 -0
- package/src/conformance/Delegation.ts +177 -0
- package/src/conformance/DeskReference.ts +73 -0
- package/src/conformance/DeviceControl.ts +700 -0
- package/src/conformance/Directory.ts +315 -0
- package/src/conformance/DirectoryProvider.ts +72 -0
- package/src/conformance/DocumentSource.ts +62 -0
- package/src/conformance/EndpointReference.ts +117 -0
- package/src/conformance/Files.ts +685 -0
- package/src/conformance/FilesReference.ts +154 -0
- package/src/conformance/FilesSubject.ts +50 -0
- package/src/conformance/Flags.ts +215 -0
- package/src/conformance/Host.ts +197 -0
- package/src/conformance/HttpApi.ts +169 -0
- package/src/conformance/InboxReference.ts +401 -0
- package/src/conformance/InboxSubject.ts +101 -0
- package/src/conformance/Ingestion.ts +425 -0
- package/src/conformance/Ingress.ts +498 -0
- package/src/conformance/Invocation.ts +780 -0
- package/src/conformance/IsolationMatrix.ts +215 -0
- package/src/conformance/LiveConnection.ts +197 -0
- package/src/conformance/LocalClient.ts +651 -0
- package/src/conformance/Locale.ts +141 -0
- package/src/conformance/MachineIdentity.ts +828 -0
- package/src/conformance/MailProvider.ts +217 -0
- package/src/conformance/Memory.ts +223 -0
- package/src/conformance/Messaging.ts +185 -0
- package/src/conformance/Metering.ts +293 -0
- package/src/conformance/ModelProvider.ts +139 -0
- package/src/conformance/ModuleManifest.ts +630 -0
- package/src/conformance/NotebookAgent.ts +41 -0
- package/src/conformance/NotificationChannel.ts +122 -0
- package/src/conformance/Notifications.ts +316 -0
- package/src/conformance/OAuthClient.ts +240 -0
- package/src/conformance/Outbox.ts +342 -0
- package/src/conformance/PlatformReference.ts +73 -0
- package/src/conformance/PlatformSubject.ts +50 -0
- package/src/conformance/Privacy.ts +577 -0
- package/src/conformance/Progress.ts +244 -0
- package/src/conformance/Push.ts +820 -0
- package/src/conformance/PushReference.ts +101 -0
- package/src/conformance/QuerySurface.ts +408 -0
- package/src/conformance/Readiness.ts +157 -0
- package/src/conformance/Reference.ts +326 -0
- package/src/conformance/Release.ts +690 -0
- package/src/conformance/ReleaseReference.ts +179 -0
- package/src/conformance/ResultRendering.ts +149 -0
- package/src/conformance/Sandbox.ts +313 -0
- package/src/conformance/SandboxReference.ts +52 -0
- package/src/conformance/Scheduler.ts +764 -0
- package/src/conformance/ScreenContext.ts +402 -0
- package/src/conformance/Search.ts +419 -0
- package/src/conformance/Secrets.ts +277 -0
- package/src/conformance/SecretsReference.ts +131 -0
- package/src/conformance/ServicesReference.ts +330 -0
- package/src/conformance/ServicesSubject.ts +105 -0
- package/src/conformance/Settings.ts +204 -0
- package/src/conformance/Sharing.ts +486 -0
- package/src/conformance/ShellSubject.ts +47 -0
- package/src/conformance/SignOutRace.ts +77 -0
- package/src/conformance/Slot.ts +84 -0
- package/src/conformance/Space.ts +432 -0
- package/src/conformance/StorageAdapter.ts +253 -0
- package/src/conformance/StorageBackend.ts +327 -0
- package/src/conformance/Subject.ts +208 -0
- package/src/conformance/Sync.ts +215 -0
- package/src/conformance/Telemetry.ts +287 -0
- package/src/conformance/ThemeTokens.ts +163 -0
- package/src/conformance/ToolSource.ts +632 -0
- package/src/conformance/Versioning.ts +199 -0
- package/src/conformance/View.ts +143 -0
- package/src/conformance/WorkItems.ts +186 -0
- package/src/conformance/Workflow.ts +304 -0
- package/src/conformance/acme/chatlog.ts +115 -0
- package/src/conformance/acme/connector.ts +151 -0
- package/src/conformance/acme/migrations/0000_messages.sql +8 -0
- package/src/conformance/archive/app.ts +33 -0
- package/src/conformance/archive/contract.ts +191 -0
- package/src/conformance/archive/memo.sync.gen.ts +25 -0
- package/src/conformance/archive/migrations/archive/0000_archive.sql +9 -0
- package/src/conformance/archive/migrations/memo/0000_memo.sql +6 -0
- package/src/conformance/archive/schema.ts +25 -0
- package/src/conformance/archive/server.ts +146 -0
- package/src/conformance/archive/sync.gen.ts +32 -0
- package/src/conformance/atlas/app.ts +16 -0
- package/src/conformance/atlas/contract.ts +118 -0
- package/src/conformance/crm/app.ts +107 -0
- package/src/conformance/crm/contract.ts +163 -0
- package/src/conformance/crm/migrations/crm/0000_crm.sql +18 -0
- package/src/conformance/crm/migrations/team/0000_team.sql +6 -0
- package/src/conformance/crm/schema.ts +28 -0
- package/src/conformance/crm/sync.gen.ts +27 -0
- package/src/conformance/desk/contract.ts +61 -0
- package/src/conformance/desk/migrations/0000_notes.sql +7 -0
- package/src/conformance/desk/server.ts +131 -0
- package/src/conformance/drafts/migrations/0000_drafts.sql +8 -0
- package/src/conformance/drafts/module.ts +211 -0
- package/src/conformance/fixture/app.ts +37 -0
- package/src/conformance/fixture/docs/bad-sync.ts +34 -0
- package/src/conformance/fixture/docs/contract.ts +297 -0
- package/src/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
- package/src/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
- package/src/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
- package/src/conformance/fixture/docs/policy.cedar +110 -0
- package/src/conformance/fixture/docs/schema.ts +41 -0
- package/src/conformance/fixture/docs/server.ts +292 -0
- package/src/conformance/fixture/docs/sync.gen.ts +54 -0
- package/src/conformance/fixture/docs/sync.ts +24 -0
- package/src/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
- package/src/conformance/fixture/peer/module.ts +51 -0
- package/src/conformance/fixture/release/blocking/0000_item.sql +3 -0
- package/src/conformance/fixture/release/blocking/0001_wait.sql +2 -0
- package/src/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
- package/src/conformance/fixture/release/broken/0000_item.sql +3 -0
- package/src/conformance/fixture/release/broken/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/broken/0002_label.sql +3 -0
- package/src/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
- package/src/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
- package/src/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
- package/src/conformance/fixture/release/escape/0000_item.sql +3 -0
- package/src/conformance/fixture/release/escape/0001_escape.sql +5 -0
- package/src/conformance/fixture/release/misnamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
- package/src/conformance/fixture/release/module.ts +119 -0
- package/src/conformance/fixture/release/outside/0000_item.sql +3 -0
- package/src/conformance/fixture/release/outside/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/outside/0002_index.sql +4 -0
- package/src/conformance/fixture/release/outside/0003_later.sql +1 -0
- package/src/conformance/fixture/release/renamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/renamed/0001_misname.sql +10 -0
- package/src/conformance/fixture/release/renamed/0002_restore.sql +1 -0
- package/src/conformance/fixture/release/rogue/0000_item.sql +3 -0
- package/src/conformance/fixture/release/rogue/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/rogue/0002_definer.sql +1 -0
- package/src/conformance/fixture/release/slow/0000_item.sql +5 -0
- package/src/conformance/fixture/release/undeclared/0000_item.sql +3 -0
- package/src/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/undeclared/0002_index.sql +1 -0
- package/src/conformance/fixture/release/v1/0000_item.sql +3 -0
- package/src/conformance/fixture/release/v2/0000_item.sql +3 -0
- package/src/conformance/fixture/release/v2/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/v2/0002_label.sql +3 -0
- package/src/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
- package/src/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
- package/src/conformance/kit-hash.ts +18 -0
- package/src/conformance/ledger/contract.ts +92 -0
- package/src/conformance/ledger/migrations/0000_entries.sql +8 -0
- package/src/conformance/ledger/server.ts +174 -0
- package/src/conformance/library/app.ts +38 -0
- package/src/conformance/library/contract.ts +66 -0
- package/src/conformance/library/migrations/0000_library.sql +14 -0
- package/src/conformance/library/schema.ts +27 -0
- package/src/conformance/library/server.ts +65 -0
- package/src/conformance/library/sync.gen.ts +47 -0
- package/src/conformance/locale/catalog.ts +111 -0
- package/src/conformance/notebook/app.ts +115 -0
- package/src/conformance/notebook/evals/pages.evals.json +94 -0
- package/src/conformance/notebook/migrations/0000_notebook.sql +10 -0
- package/src/conformance/notebook/module.ts +215 -0
- package/src/conformance/notebook/skills/meeting-notes.md +4 -0
- package/src/conformance/pad/app.ts +21 -0
- package/src/conformance/pad/contract.ts +69 -0
- package/src/conformance/pad/migrations/pad/0000_pad.sql +8 -0
- package/src/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
- package/src/conformance/pad/schema.ts +18 -0
- package/src/conformance/pad/server.ts +102 -0
- package/src/conformance/purchases/app.ts +34 -0
- package/src/conformance/purchases/contract.ts +161 -0
- package/src/conformance/purchases/migrations/0000_purchases.sql +17 -0
- package/src/conformance/purchases/server.ts +95 -0
- package/src/conformance/replica-search.mjs +22 -0
- package/src/conformance/studio/app.ts +298 -0
- package/src/conformance/studio/contract.ts +319 -0
- package/src/conformance/studio/migrations/billing/0000_billing.sql +6 -0
- package/src/conformance/studio/migrations/journal/0000_journal.sql +9 -0
- package/src/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
- package/src/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
- package/src/conformance/workshop/app.ts +14 -0
- package/src/conformance/workshop/migrations/0000_notes.sql +7 -0
- package/src/conformance/workshop/module.ts +79 -0
- package/src/fakes/AcmeFake.ts +182 -0
- package/src/fakes/ApnsFake.ts +245 -0
- package/src/fakes/FcmFake.ts +231 -0
- package/src/fakes/GoogleFake.ts +1346 -0
- package/src/fakes/HttpApiFake.ts +116 -0
- package/src/fakes/McpFake.ts +355 -0
- package/src/fakes/MicrosoftGraphFake.ts +1191 -0
- package/src/fakes/S3Fake.ts +376 -0
- package/src/fakes/Server.ts +445 -0
- package/src/fakes/SignInProviderFake.ts +70 -0
- package/src/fakes/SlackFake.ts +893 -0
- package/src/fakes/Store.ts +96 -0
- package/src/fakes/TelemetryFakes.ts +197 -0
- package/src/fakes/TestCa.ts +166 -0
- package/src/fakes/WorkOsFake.ts +136 -0
- package/src/index.ts +9 -0
- package/src/make/reference.ts +259 -0
- package/src/make/sources.ts +836 -0
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the Files contract (docs/contracts/files.md) on the archive conformance app.
|
|
3
|
+
*
|
|
4
|
+
* `Archive::Doc` accepts files (2 MiB at most; text, PDF, images, JSON, Office), attached, replaced and deleted by
|
|
5
|
+
* the document's owner and editors and readable by whoever may read the document; `Memo::Note` accepts none. The
|
|
6
|
+
* kit uploads over the signed part URLs exactly as a client would, and proves: resumable multipart uploads; every
|
|
7
|
+
* limit checked before anything is stored (size, declared type, the record's `attach` policy, the organisation's
|
|
8
|
+
* quota, also under concurrency); exact part lengths and signed URLs at the byte route; the type served sniffed
|
|
9
|
+
* from the bytes; a file readable exactly when its record is, live (grants, revocation, other organisations);
|
|
10
|
+
* downloads through short-lived URLs with safe headers; the scan hook quarantining; deletion by attachers only,
|
|
11
|
+
* held by retention, purging the bytes, and following the record's deletion; file metadata syncing by the same
|
|
12
|
+
* rule; `ctx.files` confined to the module's own records; audit and every surface.
|
|
13
|
+
*
|
|
14
|
+
* Usage, in a Vitest file: `filesConformance(() => startMyKernel())`.
|
|
15
|
+
*/
|
|
16
|
+
import { FILES_MANAGE } from "@eloxiv/contracts";
|
|
17
|
+
import { createHash } from "node:crypto";
|
|
18
|
+
import { request } from "node:http";
|
|
19
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
20
|
+
import { EICAR } from "./FilesSubject.js";
|
|
21
|
+
const ORG = "acme";
|
|
22
|
+
const OTHER = "globex";
|
|
23
|
+
const DOC = "Archive::Doc";
|
|
24
|
+
const FILE_TABLE = "eloxiv.file";
|
|
25
|
+
export const filled = (size, seed = 1) => {
|
|
26
|
+
const bytes = new Uint8Array(size);
|
|
27
|
+
for (let i = 0; i < size; i++)
|
|
28
|
+
bytes[i] = 32 + ((i * 7 + seed) % 90);
|
|
29
|
+
return bytes;
|
|
30
|
+
};
|
|
31
|
+
/** A tiny PNG (1x1), whose signature the kernel recognises. */
|
|
32
|
+
export const PNG = Uint8Array.from([
|
|
33
|
+
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0, 0, 0, 13, 0x49, 0x48, 0x44, 0x52, 0, 0, 0, 1, 0, 0, 0, 1, 8, 6, 0,
|
|
34
|
+
0, 0, 0x1f, 0x15, 0xc4, 0x89, 0, 0, 0, 10, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0, 1, 0, 0, 5, 0, 1, 0x0d, 0x0a,
|
|
35
|
+
0x2d, 0xb4, 0, 0, 0, 0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
|
36
|
+
]);
|
|
37
|
+
/** Shared helpers for the Files, Search and Ingestion kits. */
|
|
38
|
+
export const filesHelpers = (subject) => {
|
|
39
|
+
const call = (who, action, input, surface = "internal", org) => subject().invoke({ action, input, token: who.token, surface, ...(org === undefined ? {} : { org }) });
|
|
40
|
+
const ok = (outcome) => {
|
|
41
|
+
if (!outcome.ok)
|
|
42
|
+
throw new Error(`call failed: ${JSON.stringify(outcome)}`);
|
|
43
|
+
return outcome.result.output;
|
|
44
|
+
};
|
|
45
|
+
const tagOf = (outcome) => (outcome.ok ? "ok" : outcome.error._tag);
|
|
46
|
+
const putPart = async (part, bytes, headers) => {
|
|
47
|
+
const response = await fetch(part.url, {
|
|
48
|
+
method: "PUT",
|
|
49
|
+
headers: headers ?? part.headers,
|
|
50
|
+
body: bytes,
|
|
51
|
+
}).catch(() => undefined);
|
|
52
|
+
if (response === undefined)
|
|
53
|
+
return 0;
|
|
54
|
+
await response.body?.cancel();
|
|
55
|
+
return response.status;
|
|
56
|
+
};
|
|
57
|
+
/** Begin, send every part, complete. */
|
|
58
|
+
const upload = async (who, bytes, options = {}) => {
|
|
59
|
+
const plan = ok(await call(who, "files.beginUpload", {
|
|
60
|
+
name: options.name ?? "file.txt",
|
|
61
|
+
contentType: options.contentType ?? "text/plain",
|
|
62
|
+
size: bytes.byteLength,
|
|
63
|
+
...(options.attachTo === undefined ? {} : { attachTo: options.attachTo }),
|
|
64
|
+
}));
|
|
65
|
+
for (const part of plan.parts) {
|
|
66
|
+
const start = (part.partNumber - 1) * plan.partSize;
|
|
67
|
+
expect(await putPart(part, bytes.subarray(start, start + part.size))).toBe(200);
|
|
68
|
+
}
|
|
69
|
+
ok(await call(who, "files.completeUpload", { fileId: plan.fileId }));
|
|
70
|
+
return plan.fileId;
|
|
71
|
+
};
|
|
72
|
+
/** Poll until `check` holds (the finalize and ingest workflows run in the background). */
|
|
73
|
+
const eventually = async (read, check, timeoutMs = 30_000) => {
|
|
74
|
+
const until = Date.now() + timeoutMs;
|
|
75
|
+
for (;;) {
|
|
76
|
+
const value = await read();
|
|
77
|
+
if (check(value))
|
|
78
|
+
return value;
|
|
79
|
+
if (Date.now() > until)
|
|
80
|
+
throw new Error(`Timed out; last value ${JSON.stringify(value).slice(0, 500)}`);
|
|
81
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const stateOf = async (who, fileId) => ok(await call(who, "files.get", { fileId })).state;
|
|
85
|
+
const settled = (who, fileId) => eventually(() => stateOf(who, fileId), (state) => state !== "processing" && state !== "uploading");
|
|
86
|
+
/** How many claims the kernel holds for `fileId`'s part `partNumber` (a part URL is claimed before its bytes). */
|
|
87
|
+
const claims = async (fileId, partNumber) => (await subject().sql(`SELECT count(*)::int AS n FROM eloxiv.file_part_claim WHERE file_id = $1 AND part_number = $2`, [fileId, partNumber]))[0].n;
|
|
88
|
+
/**
|
|
89
|
+
* A part PUT that sends all but its last byte now and the rest on `finish` (a slow or replayed client): `started`
|
|
90
|
+
* resolves once the kernel has claimed the part URL for it, or answered it (a refusal); a fixed wait (300 ms) let
|
|
91
|
+
* the next request win the claim on a loaded runner (2026-11-10). `finish` resolves with the status.
|
|
92
|
+
*/
|
|
93
|
+
const slowPut = (part, bytes, fileId) => {
|
|
94
|
+
const answer = { status: 0 };
|
|
95
|
+
const before = claims(fileId, part.partNumber);
|
|
96
|
+
const req = request(new URL(part.url), { method: "PUT", headers: { "content-length": String(bytes.byteLength) } });
|
|
97
|
+
const done = new Promise((resolve) => {
|
|
98
|
+
req.on("response", (res) => {
|
|
99
|
+
answer.status = res.statusCode ?? 0;
|
|
100
|
+
res.resume();
|
|
101
|
+
res.on("end", () => resolve(answer.status));
|
|
102
|
+
});
|
|
103
|
+
req.on("error", () => resolve(answer.status));
|
|
104
|
+
});
|
|
105
|
+
const started = (async () => {
|
|
106
|
+
const was = await before;
|
|
107
|
+
req.write(bytes.subarray(0, bytes.byteLength - 1));
|
|
108
|
+
const until = Date.now() + 30_000;
|
|
109
|
+
while (answer.status === 0 && (await claims(fileId, part.partNumber)) <= was) {
|
|
110
|
+
if (Date.now() > until)
|
|
111
|
+
throw new Error(`The kernel neither claimed part ${part.partNumber} nor answered`);
|
|
112
|
+
await new Promise((r) => setTimeout(r, 20));
|
|
113
|
+
}
|
|
114
|
+
})();
|
|
115
|
+
return {
|
|
116
|
+
started,
|
|
117
|
+
finish: async () => {
|
|
118
|
+
await started;
|
|
119
|
+
if (answer.status === 0)
|
|
120
|
+
req.end(bytes.subarray(bytes.byteLength - 1));
|
|
121
|
+
else
|
|
122
|
+
req.destroy();
|
|
123
|
+
return done;
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
return { call, ok, tagOf, putPart, slowPut, upload, eventually, stateOf, settled };
|
|
128
|
+
};
|
|
129
|
+
export const filesConformance = (start) => describe("Files contract", () => {
|
|
130
|
+
let s;
|
|
131
|
+
let owner;
|
|
132
|
+
let editor;
|
|
133
|
+
let reader;
|
|
134
|
+
let stranger;
|
|
135
|
+
let admin;
|
|
136
|
+
let outsider;
|
|
137
|
+
const h = filesHelpers(() => s);
|
|
138
|
+
const { call, ok, tagOf, upload, settled, putPart, slowPut } = h;
|
|
139
|
+
let n = 0;
|
|
140
|
+
const newDoc = async (who, visibility = "private") => {
|
|
141
|
+
const id = `doc-${++n}-${Date.now().toString(36)}`;
|
|
142
|
+
ok(await call(who, "archive.create", { id, title: `Document ${id}`, body: "body", visibility }));
|
|
143
|
+
return id;
|
|
144
|
+
};
|
|
145
|
+
const share = async (who, docId, grantee, permission) => ok(await call(who, "sharing.grant", { entity: DOC, id: docId, permission, grantee: { user: grantee.id } }))
|
|
146
|
+
.grantId;
|
|
147
|
+
const synced = async (who, entity, id) => s.selected(await s.query(who.token, "files.ofRecord", [{ entity, id }]), FILE_TABLE);
|
|
148
|
+
beforeAll(async () => {
|
|
149
|
+
s = await start();
|
|
150
|
+
owner = await s.user("owner", ORG);
|
|
151
|
+
editor = await s.user("editor", ORG);
|
|
152
|
+
reader = await s.user("reader", ORG);
|
|
153
|
+
stranger = await s.user("stranger", ORG);
|
|
154
|
+
await s.role(ORG, "storage-admin", [FILES_MANAGE]);
|
|
155
|
+
admin = await s.user("admin", ORG, { roles: ["storage-admin"] });
|
|
156
|
+
outsider = await s.user("outsider", OTHER);
|
|
157
|
+
}, 120_000);
|
|
158
|
+
afterAll(() => s?.dispose());
|
|
159
|
+
it("uploads in parts, resumably, then inspects the file: exact size, SHA-256, type sniffed from its bytes", async () => {
|
|
160
|
+
// Staged (not attached): the deployment's limit applies, so parts of any size the store needs fit.
|
|
161
|
+
const bytes = filled(s.partBytes * 2 + 123);
|
|
162
|
+
const plan = ok(await call(owner, "files.beginUpload", {
|
|
163
|
+
name: "../../etc/report.txt",
|
|
164
|
+
contentType: "text/plain",
|
|
165
|
+
size: bytes.byteLength,
|
|
166
|
+
}));
|
|
167
|
+
expect(plan.parts.map((p) => p.size)).toEqual([s.partBytes, s.partBytes, 123]);
|
|
168
|
+
// The last part first, then the client is interrupted.
|
|
169
|
+
expect(await putPart(plan.parts[2], bytes.subarray(2 * s.partBytes))).toBe(200);
|
|
170
|
+
// Completing too early is refused, naming what is missing.
|
|
171
|
+
const early = await call(owner, "files.completeUpload", { fileId: plan.fileId });
|
|
172
|
+
expect(tagOf(early)).toBe("InvalidInput");
|
|
173
|
+
// Resuming: fresh URLs for the missing parts only.
|
|
174
|
+
const resumed = ok(await call(owner, "files.resumeUpload", { fileId: plan.fileId }));
|
|
175
|
+
expect(resumed.received).toEqual([3]);
|
|
176
|
+
expect(resumed.parts.map((p) => p.partNumber)).toEqual([1, 2]);
|
|
177
|
+
expect(tagOf(await call(stranger, "files.resumeUpload", { fileId: plan.fileId }))).toBe("Forbidden");
|
|
178
|
+
for (const part of resumed.parts) {
|
|
179
|
+
const at = (part.partNumber - 1) * s.partBytes;
|
|
180
|
+
expect(await putPart(part, bytes.subarray(at, at + part.size))).toBe(200);
|
|
181
|
+
}
|
|
182
|
+
// A part URL works once: sent again, it is refused, and the part stays as received.
|
|
183
|
+
expect(await putPart(resumed.parts[0], filled(s.partBytes, 9))).toBe(409);
|
|
184
|
+
const completed = ok(await call(owner, "files.completeUpload", { fileId: plan.fileId }));
|
|
185
|
+
expect(completed.state).toBe("processing");
|
|
186
|
+
expect(await settled(owner, plan.fileId)).toBe("available");
|
|
187
|
+
const file = ok(await call(owner, "files.get", { fileId: plan.fileId }));
|
|
188
|
+
expect(file).toMatchObject({
|
|
189
|
+
name: "report.txt",
|
|
190
|
+
size: bytes.byteLength,
|
|
191
|
+
contentType: "text/plain",
|
|
192
|
+
sha256: createHash("sha256").update(bytes).digest("hex"),
|
|
193
|
+
scan: "clean",
|
|
194
|
+
attachedTo: null,
|
|
195
|
+
uploadedBy: owner.id,
|
|
196
|
+
});
|
|
197
|
+
// The bytes are exactly what was sent.
|
|
198
|
+
const url = ok(await call(owner, "files.download", { fileId: plan.fileId })).url;
|
|
199
|
+
const got = new Uint8Array(await (await fetch(url)).arrayBuffer());
|
|
200
|
+
expect(createHash("sha256").update(got).digest("hex")).toBe(file.sha256);
|
|
201
|
+
});
|
|
202
|
+
it("checks every limit before anything is stored: size, type, the record's attach policy", async () => {
|
|
203
|
+
const doc = await newDoc(owner);
|
|
204
|
+
const begin = (who, input) => call(who, "files.beginUpload", { name: "x.txt", contentType: "text/plain", size: 10, ...input });
|
|
205
|
+
expect(tagOf(await begin(owner, { size: 2 * 1024 * 1024 + 1, attachTo: { entity: DOC, id: doc } }))).toBe("InvalidInput");
|
|
206
|
+
expect(tagOf(await begin(owner, { contentType: "application/x-msdownload", attachTo: { entity: DOC, id: doc } }))).toBe("InvalidInput");
|
|
207
|
+
expect(tagOf(await begin(owner, { contentType: "text/html", attachTo: { entity: DOC, id: doc } }))).toBe("InvalidInput");
|
|
208
|
+
expect(tagOf(await begin(owner, { contentType: "application/zip", attachTo: { entity: DOC, id: doc } }))).toBe("InvalidInput");
|
|
209
|
+
// Someone who may read but not attach, a missing record and another organisation's: the same refusal.
|
|
210
|
+
const shared = await newDoc(owner, "org");
|
|
211
|
+
const refused = [
|
|
212
|
+
await begin(reader, { attachTo: { entity: DOC, id: shared } }),
|
|
213
|
+
await begin(owner, { attachTo: { entity: DOC, id: "no-such-doc" } }),
|
|
214
|
+
await begin(outsider, { attachTo: { entity: DOC, id: shared } }),
|
|
215
|
+
];
|
|
216
|
+
expect(refused.map(tagOf)).toEqual(["Forbidden", "Forbidden", "Forbidden"]);
|
|
217
|
+
expect(new Set(refused.map((r) => (r.ok ? "" : String(r.error["message"]))))).toHaveProperty("size", 1);
|
|
218
|
+
// An entity that does not accept files.
|
|
219
|
+
expect(tagOf(await begin(owner, { attachTo: { entity: "Inbox::WorkItem", id: "w" } }))).toBe("InvalidInput");
|
|
220
|
+
// An entity that accepts files, but not this type (notes take markup only, by exact type).
|
|
221
|
+
ok(await call(owner, "memo.write", { id: `memo-type-${n}`, text: "x" }));
|
|
222
|
+
expect(tagOf(await begin(owner, { attachTo: { entity: "Memo::Note", id: `memo-type-${n}` } }))).toBe("InvalidInput");
|
|
223
|
+
// An editor (granted `edit`) may attach.
|
|
224
|
+
await share(owner, doc, editor, "edit");
|
|
225
|
+
expect(tagOf(await begin(editor, { attachTo: { entity: DOC, id: doc } }))).toBe("ok");
|
|
226
|
+
});
|
|
227
|
+
it("accepts at the byte route only the signed part, of exactly its length, while the upload is open", async () => {
|
|
228
|
+
const plan = ok(await call(owner, "files.beginUpload", { name: "p.txt", contentType: "text/plain", size: 100 }));
|
|
229
|
+
const part = plan.parts[0];
|
|
230
|
+
expect(await putPart(part, filled(99), { "content-length": "99" })).toBe(400);
|
|
231
|
+
// A changed signature: one fully significant character of it (its first), and its last character spelled
|
|
232
|
+
// non-canonically (a padding bit set, which a lenient decoder would ignore): both are refused.
|
|
233
|
+
const ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
234
|
+
const at = (url, index, change) => {
|
|
235
|
+
const position = index < 0 ? url.length + index : index;
|
|
236
|
+
return `${url.slice(0, position)}${ALPHABET[change(ALPHABET.indexOf(url[position]))]}${url.slice(position + 1)}`;
|
|
237
|
+
};
|
|
238
|
+
const macStart = part.url.lastIndexOf(".") + 1;
|
|
239
|
+
expect(await putPart({ ...part, url: at(part.url, macStart, (i) => (i + 32) % 64) }, filled(100))).toBe(403);
|
|
240
|
+
expect(await putPart({ ...part, url: at(part.url, -1, (i) => i ^ 1) }, filled(100))).toBe(403);
|
|
241
|
+
expect(await putPart({ ...part, url: part.url.replace(/token=[^.]+/u, "token=eyJrIjoidXAifQ") }, filled(100))).toBe(403);
|
|
242
|
+
expect(await putPart(part, filled(100))).toBe(200);
|
|
243
|
+
ok(await call(owner, "files.completeUpload", { fileId: plan.fileId }));
|
|
244
|
+
expect(await putPart(part, filled(100))).toBe(409);
|
|
245
|
+
// Abandoning an upload deletes it; its URLs stop working.
|
|
246
|
+
const other = ok(await call(owner, "files.beginUpload", { name: "q.txt", contentType: "text/plain", size: 5 }));
|
|
247
|
+
ok(await call(owner, "files.abortUpload", { fileId: other.fileId }));
|
|
248
|
+
expect(await putPart(other.parts[0], filled(5))).toBe(409);
|
|
249
|
+
expect(tagOf(await call(owner, "files.completeUpload", { fileId: other.fileId }))).toBe("InvalidInput");
|
|
250
|
+
});
|
|
251
|
+
it("serves what the bytes are, not what was declared, and rejects what the entity does not accept", async () => {
|
|
252
|
+
const doc = await newDoc(owner);
|
|
253
|
+
const to = { entity: DOC, id: doc };
|
|
254
|
+
// A PNG declared as text is served as a PNG.
|
|
255
|
+
const png = await upload(owner, PNG, { name: "pixel.txt", contentType: "text/plain", attachTo: to });
|
|
256
|
+
expect(await settled(owner, png)).toBe("available");
|
|
257
|
+
expect(ok(await call(owner, "files.get", { fileId: png })).contentType).toBe("image/png");
|
|
258
|
+
// A declared PNG that is not one is rejected.
|
|
259
|
+
const fake = await upload(owner, new TextEncoder().encode("not an image"), {
|
|
260
|
+
name: "a.png",
|
|
261
|
+
contentType: "image/png",
|
|
262
|
+
attachTo: to,
|
|
263
|
+
});
|
|
264
|
+
expect(await settled(owner, fake)).toBe("rejected");
|
|
265
|
+
// Ordinary text that holds markup, declared as a text type no browser runs, keeps that type and is served as
|
|
266
|
+
// it: never run, whatever it holds (nosniff, a sandbox and no sources).
|
|
267
|
+
const texts = [
|
|
268
|
+
["README.md", "text/markdown", '<p align="center"><img src="logo.png"></p>\n\n# Project\n'],
|
|
269
|
+
["app.log", "text/plain", "<134>Oct 11 22:14:15 host app: started\n"],
|
|
270
|
+
["page.json", "application/json", '{"html":"<html><body>hi</body></html>"}'],
|
|
271
|
+
["note.txt", "text/plain", "<!doctype html><script>alert(document.cookie)</script>"],
|
|
272
|
+
];
|
|
273
|
+
for (const [name, contentType, content] of texts) {
|
|
274
|
+
const fileId = await upload(owner, new TextEncoder().encode(content), { name, contentType, attachTo: to });
|
|
275
|
+
expect(await settled(owner, fileId), name).toBe("available");
|
|
276
|
+
expect(ok(await call(owner, "files.get", { fileId })).contentType, name).toBe(contentType);
|
|
277
|
+
const got = await fetch(ok(await call(owner, "files.download", { fileId, disposition: "inline" })).url);
|
|
278
|
+
expect(await got.text(), name).toBe(content);
|
|
279
|
+
expect(got.headers.get("content-type"), name).toMatch(new RegExp(`^${contentType.replace("/", "\\/")}`, "u"));
|
|
280
|
+
expect(got.headers.get("x-content-type-options"), name).toBe("nosniff");
|
|
281
|
+
expect(got.headers.get("content-security-policy"), name).toBe("default-src 'none'; sandbox");
|
|
282
|
+
}
|
|
283
|
+
// Markup declared as no text type is what it is (HTML), which this entity does not accept: rejected, deleted.
|
|
284
|
+
const html = await upload(owner, new TextEncoder().encode("<!doctype html><script>alert(1)</script>"), {
|
|
285
|
+
name: "page.bmp",
|
|
286
|
+
contentType: "image/bmp",
|
|
287
|
+
attachTo: to,
|
|
288
|
+
});
|
|
289
|
+
expect(await settled(owner, html)).toBe("rejected");
|
|
290
|
+
const rejected = ok(await call(owner, "files.get", { fileId: html }));
|
|
291
|
+
expect(rejected.stateReason).toMatch(/text\/html/u);
|
|
292
|
+
expect(tagOf(await call(owner, "files.download", { fileId: html }))).toBe("InvalidInput");
|
|
293
|
+
const keys = await s.storedKeys();
|
|
294
|
+
expect(keys.some((k) => k.includes(html))).toBe(false);
|
|
295
|
+
expect(keys.some((k) => k.includes(fake))).toBe(false);
|
|
296
|
+
});
|
|
297
|
+
it("lets a file be read exactly when its record can be, now", async () => {
|
|
298
|
+
const doc = await newDoc(owner);
|
|
299
|
+
const fileId = await upload(owner, filled(10), { attachTo: { entity: DOC, id: doc } });
|
|
300
|
+
await settled(owner, fileId);
|
|
301
|
+
const reads = async () => Promise.all([owner, reader, stranger, outsider].map(async (who) => tagOf(await call(who, "files.get", { fileId }))));
|
|
302
|
+
expect(await reads()).toEqual(["ok", "Forbidden", "Forbidden", "Forbidden"]);
|
|
303
|
+
const grant = await share(owner, doc, reader, "read");
|
|
304
|
+
expect(await reads()).toEqual(["ok", "ok", "Forbidden", "Forbidden"]);
|
|
305
|
+
expect(ok(await call(reader, "files.list", { entity: DOC, id: doc })).files.map((f) => f.id)).toEqual([fileId]);
|
|
306
|
+
ok(await call(owner, "sharing.revoke", { grantId: grant }));
|
|
307
|
+
expect(await reads()).toEqual(["ok", "Forbidden", "Forbidden", "Forbidden"]);
|
|
308
|
+
expect(tagOf(await call(reader, "files.list", { entity: DOC, id: doc }))).toBe("Forbidden");
|
|
309
|
+
ok(await call(owner, "archive.update", { id: doc, title: "t", body: "b", visibility: "org" }));
|
|
310
|
+
expect(await reads()).toEqual(["ok", "ok", "ok", "Forbidden"]);
|
|
311
|
+
// Never across organisations, whatever is asked.
|
|
312
|
+
expect(tagOf(await call(outsider, "files.download", { fileId }))).toBe("Forbidden");
|
|
313
|
+
expect(tagOf(await call(owner, "files.get", { fileId }, "internal", ORG))).toBe("ok");
|
|
314
|
+
// A staged file (not attached) is its uploader's alone.
|
|
315
|
+
const staged = await upload(reader, filled(5));
|
|
316
|
+
await settled(reader, staged);
|
|
317
|
+
expect(tagOf(await call(reader, "files.get", { fileId: staged }))).toBe("ok");
|
|
318
|
+
expect(tagOf(await call(owner, "files.get", { fileId: staged }))).toBe("Forbidden");
|
|
319
|
+
});
|
|
320
|
+
it("downloads through short-lived URLs, with the sniffed type, nosniff and attachment; a deleted file's bytes go", async () => {
|
|
321
|
+
const doc = await newDoc(owner);
|
|
322
|
+
const text = await upload(owner, new TextEncoder().encode("hello"), {
|
|
323
|
+
name: 'Ünïcode "name".txt',
|
|
324
|
+
attachTo: { entity: DOC, id: doc },
|
|
325
|
+
});
|
|
326
|
+
const png = await upload(owner, PNG, {
|
|
327
|
+
name: "p.png",
|
|
328
|
+
contentType: "image/png",
|
|
329
|
+
attachTo: { entity: DOC, id: doc },
|
|
330
|
+
});
|
|
331
|
+
await settled(owner, text);
|
|
332
|
+
await settled(owner, png);
|
|
333
|
+
const link = ok(await call(owner, "files.download", { fileId: text }));
|
|
334
|
+
expect(Date.parse(link.expiresAt) - Date.now()).toBeLessThanOrEqual(5 * 60 * 1000 + 1000);
|
|
335
|
+
const got = await fetch(link.url);
|
|
336
|
+
expect(got.status).toBe(200);
|
|
337
|
+
expect(await got.text()).toBe("hello");
|
|
338
|
+
expect(got.headers.get("content-type")).toMatch(/^text\/plain/u);
|
|
339
|
+
expect(got.headers.get("content-disposition")).toMatch(/^attachment;/u);
|
|
340
|
+
expect(got.headers.get("content-disposition")).toContain("filename*=UTF-8''%C3%9Cn%C3%AFcode");
|
|
341
|
+
expect(got.headers.get("x-content-type-options")).toBe("nosniff");
|
|
342
|
+
expect(got.headers.get("content-security-policy")).toBe("default-src 'none'; sandbox");
|
|
343
|
+
expect(got.headers.get("cache-control")).toBe("private, no-store");
|
|
344
|
+
const inline = ok(await call(owner, "files.download", { fileId: png, disposition: "inline" }));
|
|
345
|
+
const image = await fetch(inline.url);
|
|
346
|
+
await image.body?.cancel();
|
|
347
|
+
expect(image.headers.get("content-disposition")).toMatch(/^inline;/u);
|
|
348
|
+
// Text could carry markup: never inline unless it is a type safe to render.
|
|
349
|
+
ok(await call(owner, "files.delete", { fileId: text }));
|
|
350
|
+
await s.sweep();
|
|
351
|
+
const after = await fetch(link.url);
|
|
352
|
+
await after.body?.cancel();
|
|
353
|
+
expect(after.status).toBeGreaterThanOrEqual(400);
|
|
354
|
+
expect((await s.storedKeys()).some((k) => k.includes(text))).toBe(false);
|
|
355
|
+
});
|
|
356
|
+
it("never lets a part arrive after its upload completed, nor a part URL be used twice", async () => {
|
|
357
|
+
const doc = await newDoc(owner);
|
|
358
|
+
const size = 200;
|
|
359
|
+
const clean = new Uint8Array(size).fill(0x61);
|
|
360
|
+
const evil = new TextEncoder().encode(EICAR.padEnd(size, " "));
|
|
361
|
+
const plan = ok(await call(owner, "files.beginUpload", {
|
|
362
|
+
name: "notes.txt",
|
|
363
|
+
contentType: "text/plain",
|
|
364
|
+
size,
|
|
365
|
+
attachTo: { entity: DOC, id: doc },
|
|
366
|
+
}));
|
|
367
|
+
const part = plan.parts[0];
|
|
368
|
+
// The same signed URL, twice at once, one of them slow: one is accepted, the other refused before it stores.
|
|
369
|
+
const late = slowPut(part, evil, plan.fileId);
|
|
370
|
+
await late.started;
|
|
371
|
+
expect(await putPart(part, clean)).toBe(409);
|
|
372
|
+
expect(await late.finish()).toBe(200);
|
|
373
|
+
// And a third time, after the upload completed and the file was checked.
|
|
374
|
+
const third = slowPut(part, clean, plan.fileId);
|
|
375
|
+
ok(await call(owner, "files.completeUpload", { fileId: plan.fileId }));
|
|
376
|
+
expect(await settled(owner, plan.fileId)).toBe("quarantined");
|
|
377
|
+
expect(await third.finish()).toBe(409);
|
|
378
|
+
expect((await s.storedKeys()).some((k) => k.includes(plan.fileId))).toBe(false);
|
|
379
|
+
// A clean file stays exactly what was checked, whatever arrives later on its URLs.
|
|
380
|
+
const second = ok(await call(owner, "files.beginUpload", {
|
|
381
|
+
name: "clean.txt",
|
|
382
|
+
contentType: "text/plain",
|
|
383
|
+
size,
|
|
384
|
+
attachTo: { entity: DOC, id: doc },
|
|
385
|
+
}));
|
|
386
|
+
const pending = slowPut(second.parts[0], evil, second.fileId);
|
|
387
|
+
await pending.started;
|
|
388
|
+
const resumed = ok(await call(owner, "files.resumeUpload", { fileId: second.fileId }));
|
|
389
|
+
// The held request claimed its URL; a fresh URL for the same part completes the upload.
|
|
390
|
+
expect(await putPart(resumed.parts[0], clean)).toBe(200);
|
|
391
|
+
ok(await call(owner, "files.completeUpload", { fileId: second.fileId }));
|
|
392
|
+
expect(await settled(owner, second.fileId)).toBe("available");
|
|
393
|
+
expect(await pending.finish()).toBe(409);
|
|
394
|
+
const url = ok(await call(owner, "files.download", { fileId: second.fileId })).url;
|
|
395
|
+
expect(new TextDecoder().decode(await (await fetch(url)).arrayBuffer())).toBe("a".repeat(size));
|
|
396
|
+
expect(ok(await call(owner, "files.get", { fileId: second.fileId })).scan).toBe("clean");
|
|
397
|
+
});
|
|
398
|
+
it("refuses a part that lands after its upload was abandoned and purged, leaving nothing stored", async () => {
|
|
399
|
+
const plan = ok(await call(owner, "files.beginUpload", { name: "gone.txt", contentType: "text/plain", size: 64 }));
|
|
400
|
+
const pending = slowPut(plan.parts[0], filled(64), plan.fileId);
|
|
401
|
+
await pending.started;
|
|
402
|
+
ok(await call(owner, "files.abortUpload", { fileId: plan.fileId }));
|
|
403
|
+
await s.sweep();
|
|
404
|
+
expect(await pending.finish()).toBe(409);
|
|
405
|
+
await s.sweep();
|
|
406
|
+
expect((await s.storedKeys()).some((k) => k.includes(plan.fileId))).toBe(false);
|
|
407
|
+
});
|
|
408
|
+
it("serves markup and XML only as an attachment of application/octet-stream, never as itself", async () => {
|
|
409
|
+
const memo = `memo-active-${++n}`;
|
|
410
|
+
ok(await call(owner, "memo.write", { id: memo, text: "x" }));
|
|
411
|
+
const to = { entity: "Memo::Note", id: memo };
|
|
412
|
+
const kinds = [
|
|
413
|
+
["page.html", "text/html", "<!doctype html><script>alert(document.cookie)</script>"],
|
|
414
|
+
["image.svg", "image/svg+xml", '<svg xmlns="http://www.w3.org/2000/svg" onload="alert(1)"/>'],
|
|
415
|
+
["data.xml", "application/xml", '<?xml version="1.0"?><x:svg xmlns:x="http://www.w3.org/2000/svg"/>'],
|
|
416
|
+
];
|
|
417
|
+
for (const [name, contentType, content] of kinds) {
|
|
418
|
+
const fileId = await upload(owner, new TextEncoder().encode(content), { name, contentType, attachTo: to });
|
|
419
|
+
expect(await settled(owner, fileId), name).toBe("available");
|
|
420
|
+
const link = ok(await call(owner, "files.download", { fileId, disposition: "inline" }));
|
|
421
|
+
const got = await fetch(link.url);
|
|
422
|
+
expect(await got.text()).toBe(content);
|
|
423
|
+
expect(got.headers.get("content-type"), name).toBe("application/octet-stream");
|
|
424
|
+
expect(got.headers.get("content-disposition"), name).toMatch(/^attachment;/u);
|
|
425
|
+
expect(got.headers.get("x-content-type-options")).toBe("nosniff");
|
|
426
|
+
expect(got.headers.get("content-security-policy")).toBe("default-src 'none'; sandbox");
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
it("checks a download URL's holder can still read the file when it is used", async () => {
|
|
430
|
+
const doc = await newDoc(owner);
|
|
431
|
+
const fileId = await upload(owner, filled(10), { attachTo: { entity: DOC, id: doc } });
|
|
432
|
+
await settled(owner, fileId);
|
|
433
|
+
const grant = await share(owner, doc, reader, "read");
|
|
434
|
+
const link = ok(await call(reader, "files.download", { fileId })).url;
|
|
435
|
+
const before = await fetch(link);
|
|
436
|
+
await before.body?.cancel();
|
|
437
|
+
expect(before.status).toBe(200);
|
|
438
|
+
ok(await call(owner, "sharing.revoke", { grantId: grant }));
|
|
439
|
+
const after = await fetch(link);
|
|
440
|
+
await after.body?.cancel();
|
|
441
|
+
expect(after.status).toBe(404);
|
|
442
|
+
// The owner's own URL still works.
|
|
443
|
+
const own = await fetch(ok(await call(owner, "files.download", { fileId })).url);
|
|
444
|
+
await own.body?.cancel();
|
|
445
|
+
expect(own.status).toBe(200);
|
|
446
|
+
});
|
|
447
|
+
it("holds files only for administrators who may read them, and modules list only their own records' files", async () => {
|
|
448
|
+
const doc = await newDoc(owner);
|
|
449
|
+
const fileId = await upload(owner, filled(10), { attachTo: { entity: DOC, id: doc } });
|
|
450
|
+
await settled(owner, fileId);
|
|
451
|
+
const until = new Date(Date.now() + 60_000).toISOString();
|
|
452
|
+
const refused = await call(admin, "files.retain", { fileId, until });
|
|
453
|
+
expect(tagOf(refused)).toBe("Forbidden");
|
|
454
|
+
expect(refused.ok ? "" : JSON.stringify(refused.error)).not.toContain("10");
|
|
455
|
+
await share(owner, doc, admin, "read");
|
|
456
|
+
expect(ok(await call(admin, "files.retain", { fileId, until })).retainUntil).toBe(until);
|
|
457
|
+
ok(await call(admin, "files.retain", { fileId, until: null }));
|
|
458
|
+
// A module asks for another module's record's files: refused.
|
|
459
|
+
ok(await call(owner, "memo.write", { id: `memo-list-${++n}`, text: "x" }));
|
|
460
|
+
expect(tagOf(await call(owner, "archive.listElsewhere", { memoId: `memo-list-${n}` }))).toBe("Forbidden");
|
|
461
|
+
});
|
|
462
|
+
it("holds each organisation to its storage quota, also when uploads race", async () => {
|
|
463
|
+
expect(tagOf(await call(owner, "files.setQuota", { limitBytes: 1 }))).toBe("Forbidden");
|
|
464
|
+
const before = ok(await call(admin, "files.usage", {}));
|
|
465
|
+
ok(await call(admin, "files.setQuota", { limitBytes: before.usedBytes + 3_000 }));
|
|
466
|
+
const begins = await Promise.all(Array.from({ length: 8 }, (_, i) => call(admin, "files.beginUpload", { name: `q${i}.txt`, contentType: "text/plain", size: 1_000 })));
|
|
467
|
+
expect(begins.filter((b) => b.ok)).toHaveLength(3);
|
|
468
|
+
const refused = begins.find((b) => !b.ok);
|
|
469
|
+
expect(refused === undefined ? "" : tagOf(refused)).toBe("Forbidden");
|
|
470
|
+
expect(ok(await call(admin, "files.usage", {}))).toMatchObject({
|
|
471
|
+
usedBytes: before.usedBytes + 3_000,
|
|
472
|
+
limitBytes: before.usedBytes + 3_000,
|
|
473
|
+
});
|
|
474
|
+
// Abandoning one frees its bytes at once.
|
|
475
|
+
const first = ok(begins.find((b) => b.ok));
|
|
476
|
+
ok(await call(admin, "files.abortUpload", { fileId: first.fileId }));
|
|
477
|
+
expect(tagOf(await call(admin, "files.beginUpload", { name: "r.txt", contentType: "text/plain", size: 1_000 }))).toBe("ok");
|
|
478
|
+
// Another organisation's quota is its own.
|
|
479
|
+
expect(tagOf(await call(outsider, "files.beginUpload", { name: "o.txt", contentType: "text/plain", size: 5_000 }))).toBe("ok");
|
|
480
|
+
ok(await call(admin, "files.setQuota", { limitBytes: null }));
|
|
481
|
+
});
|
|
482
|
+
it("quarantines what the scanner flags, and deletes its bytes", async () => {
|
|
483
|
+
const doc = await newDoc(owner);
|
|
484
|
+
const fileId = await upload(owner, new TextEncoder().encode(`attachment ${EICAR}`), {
|
|
485
|
+
attachTo: { entity: DOC, id: doc },
|
|
486
|
+
});
|
|
487
|
+
expect(await settled(owner, fileId)).toBe("quarantined");
|
|
488
|
+
expect(ok(await call(owner, "files.get", { fileId }))).toMatchObject({ scan: "infected" });
|
|
489
|
+
expect(tagOf(await call(owner, "files.download", { fileId }))).toBe("InvalidInput");
|
|
490
|
+
expect((await s.storedKeys()).some((k) => k.includes(fileId))).toBe(false);
|
|
491
|
+
});
|
|
492
|
+
it("deletes by attachers only, not under a retention hold, and with its record", async () => {
|
|
493
|
+
const doc = await newDoc(owner, "org");
|
|
494
|
+
const fileId = await upload(owner, filled(20), { attachTo: { entity: DOC, id: doc } });
|
|
495
|
+
await settled(owner, fileId);
|
|
496
|
+
expect(tagOf(await call(reader, "files.delete", { fileId }))).toBe("Forbidden");
|
|
497
|
+
expect(tagOf(await call(owner, "files.retain", { fileId, until: new Date(Date.now() + 60_000).toISOString() }))).toBe("Forbidden");
|
|
498
|
+
ok(await call(admin, "files.retain", { fileId, until: new Date(Date.now() + 60_000).toISOString() }));
|
|
499
|
+
expect(tagOf(await call(owner, "files.delete", { fileId }))).toBe("InvalidInput");
|
|
500
|
+
ok(await call(admin, "files.retain", { fileId, until: null }));
|
|
501
|
+
await share(owner, doc, editor, "edit");
|
|
502
|
+
expect(ok(await call(editor, "files.delete", { fileId })).state).toBe("deleted");
|
|
503
|
+
await s.sweep();
|
|
504
|
+
expect((await s.storedKeys()).some((k) => k.includes(fileId))).toBe(false);
|
|
505
|
+
// Deleting the record deletes its files (held ones are kept until their hold ends).
|
|
506
|
+
const second = await upload(owner, filled(30), { attachTo: { entity: DOC, id: doc } });
|
|
507
|
+
const held = await upload(owner, filled(31), { attachTo: { entity: DOC, id: doc } });
|
|
508
|
+
await settled(owner, second);
|
|
509
|
+
await settled(owner, held);
|
|
510
|
+
ok(await call(admin, "files.retain", { fileId: held, until: new Date(Date.now() + 60_000).toISOString() }));
|
|
511
|
+
ok(await call(owner, "archive.remove", { id: doc }));
|
|
512
|
+
const [row] = await s.sql(`SELECT state FROM eloxiv.file WHERE id = $1`, [second]);
|
|
513
|
+
expect(row?.state).toBe("deleted");
|
|
514
|
+
// Each file deleted with its record is announced, as a deletion by an action is.
|
|
515
|
+
const announced = await s.sql(`SELECT payload ->> 'fileId' AS "fileId" FROM eloxiv.outbox WHERE type = 'files.deleted' AND payload ->> 'fileId' = ANY($1)`, [[fileId, second, held]]);
|
|
516
|
+
expect(announced.map((a) => a.fileId).sort()).toEqual([fileId, second, held].sort());
|
|
517
|
+
await s.sweep();
|
|
518
|
+
const keys = await s.storedKeys();
|
|
519
|
+
expect(keys.some((k) => k.includes(second))).toBe(false);
|
|
520
|
+
expect(keys.some((k) => k.includes(held))).toBe(true);
|
|
521
|
+
expect(tagOf(await call(owner, "files.get", { fileId: second }))).toBe("Forbidden");
|
|
522
|
+
});
|
|
523
|
+
it("syncs file metadata to each replica by the same rule as reads, and drops what becomes unreadable", async () => {
|
|
524
|
+
const doc = await newDoc(owner);
|
|
525
|
+
const fileId = await upload(owner, filled(12), { attachTo: { entity: DOC, id: doc } });
|
|
526
|
+
await settled(owner, fileId);
|
|
527
|
+
expect(await synced(owner, DOC, doc)).toEqual([fileId]);
|
|
528
|
+
expect(await synced(reader, DOC, doc)).toEqual([]);
|
|
529
|
+
expect(await synced(outsider, DOC, doc)).toEqual([]);
|
|
530
|
+
const grant = await share(owner, doc, reader, "read");
|
|
531
|
+
expect(await synced(reader, DOC, doc)).toEqual([fileId]);
|
|
532
|
+
ok(await call(owner, "sharing.revoke", { grantId: grant }));
|
|
533
|
+
expect(await synced(reader, DOC, doc)).toEqual([]);
|
|
534
|
+
ok(await call(owner, "files.delete", { fileId }));
|
|
535
|
+
expect(await synced(owner, DOC, doc)).toEqual([]);
|
|
536
|
+
// Staged files sync to their uploader only.
|
|
537
|
+
const staged = await upload(reader, filled(3));
|
|
538
|
+
const answer = await s.query(reader.token, "files.staged", []);
|
|
539
|
+
expect(await s.selected(answer, FILE_TABLE)).toContain(staged);
|
|
540
|
+
expect(await s.selected(await s.query(owner.token, "files.staged", []), FILE_TABLE)).not.toContain(staged);
|
|
541
|
+
});
|
|
542
|
+
it("selects nothing more for a replica whose session signed out, staged files included (the review's staged path)", async () => {
|
|
543
|
+
// A session of its own, so the kit's people stay signed in.
|
|
544
|
+
const stager = await s.user(`stager-${crypto.randomUUID().slice(0, 8)}`, ORG);
|
|
545
|
+
const doc = await newDoc(stager);
|
|
546
|
+
const attached = await upload(stager, filled(4), { attachTo: { entity: DOC, id: doc } });
|
|
547
|
+
await settled(stager, attached);
|
|
548
|
+
const staged = await upload(stager, filled(5));
|
|
549
|
+
// The filters a replica of this session was given, as zero-cache keeps evaluating them, live.
|
|
550
|
+
const stagedAnswer = await s.query(stager.token, "files.staged", []);
|
|
551
|
+
const attachedAnswer = await s.query(stager.token, "files.ofRecord", [{ entity: DOC, id: doc }]);
|
|
552
|
+
expect(await s.selected(stagedAnswer, FILE_TABLE)).toContain(staged);
|
|
553
|
+
expect(await s.selected(attachedAnswer, FILE_TABLE)).toContain(attached);
|
|
554
|
+
await s.signOut(stager.token);
|
|
555
|
+
expect(await s.selected(stagedAnswer, FILE_TABLE)).toEqual([]);
|
|
556
|
+
expect(await s.selected(attachedAnswer, FILE_TABLE)).toEqual([]);
|
|
557
|
+
});
|
|
558
|
+
it("lets a module attach files only to its own records, as its caller may", async () => {
|
|
559
|
+
const doc = await newDoc(owner);
|
|
560
|
+
const staged = await upload(owner, filled(8));
|
|
561
|
+
await settled(owner, staged);
|
|
562
|
+
ok(await call(owner, "archive.attachFile", { docId: doc, fileId: staged }));
|
|
563
|
+
expect(ok(await call(owner, "files.get", { fileId: staged })).attachedTo).toEqual({ entity: DOC, id: doc });
|
|
564
|
+
// Attached once: never moved.
|
|
565
|
+
expect(tagOf(await call(owner, "archive.attachFile", { docId: doc, fileId: staged }))).toBe("Forbidden");
|
|
566
|
+
ok(await call(owner, "memo.write", { id: `memo-${n}`, text: "x" }));
|
|
567
|
+
const other = await upload(owner, filled(9));
|
|
568
|
+
await settled(owner, other);
|
|
569
|
+
expect(tagOf(await call(owner, "archive.attachElsewhere", { memoId: `memo-${n}`, fileId: other }))).toBe("Forbidden");
|
|
570
|
+
// The caller's own permission still applies: a reader cannot attach through the module.
|
|
571
|
+
const theirs = await newDoc(owner, "org");
|
|
572
|
+
const readers = await upload(reader, filled(4));
|
|
573
|
+
await settled(reader, readers);
|
|
574
|
+
expect(tagOf(await call(reader, "archive.attachFile", { docId: theirs, fileId: readers }))).toBe("Forbidden");
|
|
575
|
+
expect(tagOf(await call(reader, "files.attachTo", { fileId: readers, to: { entity: DOC, id: theirs } }))).toBe("Forbidden");
|
|
576
|
+
});
|
|
577
|
+
it("is on every surface and audits every call", async () => {
|
|
578
|
+
const doc = await newDoc(owner);
|
|
579
|
+
const fileId = await upload(owner, filled(6), { attachTo: { entity: DOC, id: doc } });
|
|
580
|
+
await settled(owner, fileId);
|
|
581
|
+
for (const surface of ["http", "mcp", "agent", "rpc"]) {
|
|
582
|
+
expect(ok(await call(owner, "files.get", { fileId }, surface)).id).toBe(fileId);
|
|
583
|
+
expect(tagOf(await call(stranger, "files.get", { fileId }, surface))).toBe("Forbidden");
|
|
584
|
+
}
|
|
585
|
+
const gets = await s.audit({ action: "files.get" });
|
|
586
|
+
expect(gets.some((r) => r.actorUserId === stranger.id && (r.outcome === "failed" || r.outcome === "denied"))).toBe(true);
|
|
587
|
+
expect(gets.some((r) => r.actorUserId === owner.id && r.outcome === "succeeded")).toBe(true);
|
|
588
|
+
const completions = await s.audit({ action: "files.completeUpload", outcome: "succeeded" });
|
|
589
|
+
expect(completions.some((r) => r.actorUserId === owner.id)).toBe(true);
|
|
590
|
+
});
|
|
591
|
+
});
|
|
592
|
+
//# sourceMappingURL=Files.js.map
|