@eloxiv/testing 0.0.0-stage → 0.1.1
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 +908 -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 +70 -0
- package/dist/conformance/LocalClient.d.ts.map +1 -0
- package/dist/conformance/LocalClient.js +576 -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 +1075 -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 +707 -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,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the Settings contract (docs/contracts/settings.md) on the platform conformance app.
|
|
3
|
+
*
|
|
4
|
+
* `crm` declares a setting at every scope: `crm.pageSize` (user, default 25), `crm.currency` (org, default
|
|
5
|
+
* USD), `crm.region` (app, configured `me-central`) and `crm.limit` (module, configured 250). Reads are keyed
|
|
6
|
+
* and resolve through the scope order to the default; writes are authorised by level (a person their own
|
|
7
|
+
* values, organisation administrators the organisation's, deployment levels only by configuration or the
|
|
8
|
+
* operator call), validated against the schema and audited; a person's replica holds exactly their own values
|
|
9
|
+
* and their organisation's; handlers read the same values through `ctx.settings.get`; and a setting whose
|
|
10
|
+
* schema is marked sensitive is refused.
|
|
11
|
+
*
|
|
12
|
+
* Usage, in a Vitest file: `settingsConformance(() => startMyKernel())`.
|
|
13
|
+
*/
|
|
14
|
+
import { Schema } from "effect";
|
|
15
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
16
|
+
const ORG = "acme";
|
|
17
|
+
const OTHER = "globex";
|
|
18
|
+
const TABLE = "eloxiv_settings.value";
|
|
19
|
+
export const settingsConformance = (start) => describe("Settings contract", () => {
|
|
20
|
+
let s;
|
|
21
|
+
let admin; // administrator of acme
|
|
22
|
+
let alice;
|
|
23
|
+
let bob;
|
|
24
|
+
let carol; // administrator of globex
|
|
25
|
+
const call = (who, action, input, surface = "internal") => s.invoke({ action, input, token: who.token, surface });
|
|
26
|
+
const ok = (outcome) => {
|
|
27
|
+
if (!outcome.ok)
|
|
28
|
+
throw new Error(`call failed: ${JSON.stringify(outcome)}`);
|
|
29
|
+
return outcome.result.output;
|
|
30
|
+
};
|
|
31
|
+
const tagOf = (outcome) => (outcome.ok ? "ok" : outcome.error._tag);
|
|
32
|
+
const get = async (who, key) => ok(await call(who, "settings.get", { key }));
|
|
33
|
+
const set = (who, key, value, level) => call(who, "settings.set", level === undefined ? { key, value } : { key, value, level });
|
|
34
|
+
const clear = (who, key, level) => call(who, "settings.clear", level === undefined ? { key } : { key, level });
|
|
35
|
+
const peek = async (who) => ok(await call(who, "crm.peek", {}));
|
|
36
|
+
/** The setting values a person's replica holds for `key` (the sync endpoint's keyed, scoped query). */
|
|
37
|
+
const synced = async (who, key, org) => s.selected(await s.query(who.token, "settings.value", [key], org), TABLE);
|
|
38
|
+
const idOf = async (level, org, user, key) => {
|
|
39
|
+
const [row] = await s.sql(`SELECT id FROM ${TABLE} WHERE level = $1 AND org_id = $2 AND user_id IS NOT DISTINCT FROM $3 AND key = $4`, [level, org, user, key]);
|
|
40
|
+
return row?.id;
|
|
41
|
+
};
|
|
42
|
+
beforeAll(async () => {
|
|
43
|
+
s = await start();
|
|
44
|
+
admin = await s.user("ada", ORG, { roles: ["admin"] });
|
|
45
|
+
alice = await s.user("alice", ORG);
|
|
46
|
+
bob = await s.user("bob", ORG);
|
|
47
|
+
carol = await s.user("carol", OTHER, { roles: ["admin"] });
|
|
48
|
+
}, 120_000);
|
|
49
|
+
afterAll(() => s?.dispose());
|
|
50
|
+
it("reads one declared key at a time, with its default and where it came from", async () => {
|
|
51
|
+
expect(await get(alice, "crm.pageSize")).toEqual({ key: "crm.pageSize", value: 25, source: "default" });
|
|
52
|
+
expect(await get(alice, "crm.currency")).toEqual({ key: "crm.currency", value: "USD", source: "default" });
|
|
53
|
+
expect(tagOf(await call(alice, "settings.get", { key: "crm.nope" }))).toBe("InvalidInput");
|
|
54
|
+
// There is no way to list settings: only keyed reads.
|
|
55
|
+
expect(tagOf(await call(alice, "settings.list", {}))).toBe("UnknownAction");
|
|
56
|
+
for (const surface of ["http", "mcp", "agent"]) {
|
|
57
|
+
expect(ok(await call(alice, "settings.get", { key: "crm.region" }, surface))).toEqual({
|
|
58
|
+
key: "crm.region",
|
|
59
|
+
value: "me-central",
|
|
60
|
+
source: "app",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
it("resolves through the declared scope order: user, organisation, deployment, module installation, default", async () => {
|
|
65
|
+
ok(await set(admin, "crm.pageSize", 50, "org"));
|
|
66
|
+
expect(await get(alice, "crm.pageSize")).toEqual({ key: "crm.pageSize", value: 50, source: "org" });
|
|
67
|
+
ok(await set(alice, "crm.pageSize", 10));
|
|
68
|
+
expect(await get(alice, "crm.pageSize")).toMatchObject({ value: 10, source: "user" });
|
|
69
|
+
expect(await get(bob, "crm.pageSize")).toMatchObject({ value: 50, source: "org" });
|
|
70
|
+
expect(await get(carol, "crm.pageSize")).toMatchObject({ value: 25, source: "default" });
|
|
71
|
+
ok(await clear(alice, "crm.pageSize"));
|
|
72
|
+
expect(await get(alice, "crm.pageSize")).toMatchObject({ value: 50, source: "org" });
|
|
73
|
+
ok(await clear(admin, "crm.pageSize", "org"));
|
|
74
|
+
expect(await get(alice, "crm.pageSize")).toMatchObject({ value: 25, source: "default" });
|
|
75
|
+
// Deployment levels: configuration, overridden by a deployment administrator, removed again.
|
|
76
|
+
expect(await get(alice, "crm.region")).toMatchObject({ value: "me-central", source: "app" });
|
|
77
|
+
expect(await s.configure("crm.region", "app", "us-east")).toEqual({ ok: true });
|
|
78
|
+
expect(await get(alice, "crm.region")).toMatchObject({ value: "us-east", source: "app" });
|
|
79
|
+
expect(await s.configure("crm.region", "app", null)).toEqual({ ok: true });
|
|
80
|
+
expect(await get(alice, "crm.region")).toMatchObject({ value: "me-central", source: "app" });
|
|
81
|
+
expect(await get(alice, "crm.limit")).toMatchObject({ value: 250, source: "module" });
|
|
82
|
+
expect(await s.configure("crm.limit", "app", 5)).toMatchObject({ ok: false });
|
|
83
|
+
// An app-level value of a user-scope setting sits between the organisation's and the default.
|
|
84
|
+
expect(await s.configure("crm.pageSize", "app", 40)).toEqual({ ok: true });
|
|
85
|
+
expect(await get(bob, "crm.pageSize")).toMatchObject({ value: 40, source: "app" });
|
|
86
|
+
ok(await set(admin, "crm.pageSize", 60, "org"));
|
|
87
|
+
expect(await get(bob, "crm.pageSize")).toMatchObject({ value: 60, source: "org" });
|
|
88
|
+
ok(await clear(admin, "crm.pageSize", "org"));
|
|
89
|
+
expect(await s.configure("crm.pageSize", "app", null)).toEqual({ ok: true });
|
|
90
|
+
});
|
|
91
|
+
it("authorises writes by level: your own values, the organisation's for administrators, deployment values never", async () => {
|
|
92
|
+
expect(tagOf(await set(bob, "crm.pageSize", 30, "org"))).toBe("Forbidden");
|
|
93
|
+
expect(tagOf(await set(bob, "crm.currency", "EUR"))).toBe("Forbidden");
|
|
94
|
+
expect(tagOf(await set(bob, "crm.currency", "EUR", "user"))).toBe("InvalidInput");
|
|
95
|
+
expect(tagOf(await set(admin, "crm.region", "x"))).toBe("Forbidden");
|
|
96
|
+
expect(tagOf(await set(admin, "crm.limit", 1))).toBe("Forbidden");
|
|
97
|
+
expect(tagOf(await clear(bob, "crm.currency", "org"))).toBe("Forbidden");
|
|
98
|
+
ok(await set(admin, "crm.currency", "EUR"));
|
|
99
|
+
expect(await get(bob, "crm.currency")).toMatchObject({ value: "EUR", source: "org" });
|
|
100
|
+
// Another organisation's administrator changes only their own organisation.
|
|
101
|
+
ok(await set(carol, "crm.currency", "SAR"));
|
|
102
|
+
expect(await get(bob, "crm.currency")).toMatchObject({ value: "EUR" });
|
|
103
|
+
expect(await get(carol, "crm.currency")).toMatchObject({ value: "SAR" });
|
|
104
|
+
// A person's own value is theirs alone.
|
|
105
|
+
ok(await set(bob, "crm.pageSize", 75));
|
|
106
|
+
ok(await set(alice, "crm.pageSize", 15));
|
|
107
|
+
expect(await get(bob, "crm.pageSize")).toMatchObject({ value: 75, source: "user" });
|
|
108
|
+
// An agent acting for the person writes the person's own value, not the organisation's.
|
|
109
|
+
expect(tagOf(await call(bob, "settings.set", { key: "crm.pageSize", value: 80 }, "agent"))).toBe("ok");
|
|
110
|
+
expect(tagOf(await call(bob, "settings.set", { key: "crm.currency", value: "USD" }, "mcp"))).toBe("Forbidden");
|
|
111
|
+
});
|
|
112
|
+
it("validates every write against the setting's schema", async () => {
|
|
113
|
+
expect(tagOf(await set(alice, "crm.pageSize", "ten"))).toBe("InvalidInput");
|
|
114
|
+
expect(tagOf(await set(alice, "crm.pageSize", 500))).toBe("InvalidInput");
|
|
115
|
+
expect(tagOf(await set(alice, "crm.pageSize", 2.5))).toBe("InvalidInput");
|
|
116
|
+
expect(tagOf(await set(admin, "crm.currency", "GBP"))).toBe("InvalidInput");
|
|
117
|
+
expect(tagOf(await set(alice, "crm.nope", 1))).toBe("InvalidInput");
|
|
118
|
+
expect(await s.configure("crm.region", "app", 42)).toMatchObject({ ok: false });
|
|
119
|
+
expect(await get(alice, "crm.pageSize")).toMatchObject({ value: 15, source: "user" });
|
|
120
|
+
});
|
|
121
|
+
it("syncs a person their own values and their organisation's, one key at a time, nobody else's", async () => {
|
|
122
|
+
const aliceOwn = await idOf("user", ORG, alice.id, "crm.pageSize");
|
|
123
|
+
const bobOwn = await idOf("user", ORG, bob.id, "crm.pageSize");
|
|
124
|
+
ok(await set(admin, "crm.pageSize", 35, "org"));
|
|
125
|
+
const orgValue = await idOf("org", ORG, null, "crm.pageSize");
|
|
126
|
+
expect([aliceOwn, bobOwn, orgValue].every((id) => id !== undefined)).toBe(true);
|
|
127
|
+
expect([...(await synced(alice, "crm.pageSize"))].map((x) => x ?? "").sort((a, b) => a.localeCompare(b))).toEqual([aliceOwn, orgValue].map((x) => x ?? "").sort((a, b) => a.localeCompare(b)));
|
|
128
|
+
expect([...(await synced(bob, "crm.pageSize"))].map((x) => x ?? "").sort((a, b) => a.localeCompare(b))).toEqual([bobOwn, orgValue].map((x) => x ?? "").sort((a, b) => a.localeCompare(b)));
|
|
129
|
+
expect(await synced(carol, "crm.pageSize")).toEqual([]);
|
|
130
|
+
// Keyed: another key's query holds that key's values only.
|
|
131
|
+
const currency = await idOf("org", ORG, null, "crm.currency");
|
|
132
|
+
expect(await synced(alice, "crm.currency")).toEqual([currency]);
|
|
133
|
+
expect(await synced(carol, "crm.currency")).toEqual([await idOf("org", OTHER, null, "crm.currency")]);
|
|
134
|
+
// A non-member naming the organisation gets nothing at all.
|
|
135
|
+
expect((await s.query(carol.token, "settings.value", ["crm.currency"], ORG)).status).toBe(401);
|
|
136
|
+
});
|
|
137
|
+
it("audits every write with the value before and after, and refusals", async () => {
|
|
138
|
+
const outcome = await set(alice, "crm.pageSize", 99);
|
|
139
|
+
const invocation = ok(outcome);
|
|
140
|
+
expect(invocation["level"]).toBe("user");
|
|
141
|
+
const records = (await s.audit({ action: "settings.set", outcome: "succeeded" })).filter((r) => r.actorUserId === alice.id && r.detail?.after === 99);
|
|
142
|
+
expect(records).toHaveLength(1);
|
|
143
|
+
expect(records[0].detail).toEqual({
|
|
144
|
+
key: "crm.pageSize",
|
|
145
|
+
level: "user",
|
|
146
|
+
subject: alice.id,
|
|
147
|
+
before: 15,
|
|
148
|
+
after: 99,
|
|
149
|
+
});
|
|
150
|
+
const denied = await s.audit({ action: "settings.set", outcome: "denied" });
|
|
151
|
+
expect(denied.some((r) => r.actorUserId === bob.id && r.errorTag === "Forbidden")).toBe(true);
|
|
152
|
+
const configured = await s.audit({ action: "eloxiv.settings.configure", outcome: "succeeded" });
|
|
153
|
+
expect(configured.some((r) => r.detail?.key === "crm.region")).toBe(true);
|
|
154
|
+
});
|
|
155
|
+
it("gives handlers the same values through ctx.settings.get", async () => {
|
|
156
|
+
expect(await peek(alice)).toMatchObject({ pageSize: 99, currency: "EUR", region: "me-central", limit: 250 });
|
|
157
|
+
expect(await peek(bob)).toMatchObject({ pageSize: 80, currency: "EUR" });
|
|
158
|
+
expect(await peek(carol)).toMatchObject({ pageSize: 25, currency: "SAR" });
|
|
159
|
+
});
|
|
160
|
+
it("refuses a setting whose schema is marked sensitive (secrets never go in settings)", async () => {
|
|
161
|
+
const plain = await s.settingProblems({
|
|
162
|
+
"crm.token": { description: "A token", scope: "org", schema: Schema.String, default: "" },
|
|
163
|
+
});
|
|
164
|
+
expect(plain).toEqual([]);
|
|
165
|
+
for (const [schema, fallback] of [
|
|
166
|
+
[Schema.String.annotate({ sensitive: true }), ""],
|
|
167
|
+
[Schema.Struct({ key: Schema.String.annotate({ writeOnly: true }) }), { key: "" }],
|
|
168
|
+
[Schema.String.annotate({ format: "password" }), ""],
|
|
169
|
+
]) {
|
|
170
|
+
const problems = await s.settingProblems({
|
|
171
|
+
"crm.token": { description: "A token", scope: "org", schema, default: fallback },
|
|
172
|
+
});
|
|
173
|
+
expect(problems.some((p) => /crm\.token is marked sensitive/.test(p))).toBe(true);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
//# sourceMappingURL=Settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../src/conformance/Settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAIlE,MAAM,GAAG,GAAG,MAAM,CAAA;AAClB,MAAM,KAAK,GAAG,QAAQ,CAAA;AACtB,MAAM,KAAK,GAAG,uBAAuB,CAAA;AAErC,MAAM,CAA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@
|
|
|
1
|
+
{"version":3,"file":"Sharing.d.ts","sourceRoot":"","sources":["../../src/conformance/Sharing.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAuD,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAS/G,eAAO,MAAM,kBAAkB,UAAW,iBAAiB,4CAgdvD,CAAA"}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the Sharing contract (docs/contracts/sharing.md): per-record grants to a user, a group,
|
|
3
|
+
* the whole organisation and links, authorised by the record's own `share` policy, validated in the caller's
|
|
4
|
+
* organisation, expiring and revocable, on every surface, audited, with access requests that reach a record's
|
|
5
|
+
* managers as work items and notifications; and the same grants in the sync filters, evaluated for the caller
|
|
6
|
+
* only, including for the children a query reaches.
|
|
7
|
+
*
|
|
8
|
+
* Usage: `sharingConformance(() => startMySubject())`, an `InboxSubject` serving the sharing conformance app
|
|
9
|
+
* (`./library/app.ts`). Live through zero-cache (grants and revocations reaching connected replicas, children
|
|
10
|
+
* never reaching them) is proven by `packages/testing/test/sharing-live.test.ts`.
|
|
11
|
+
*/
|
|
12
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
13
|
+
import { unique, until } from "./InboxSubject.js";
|
|
14
|
+
const outputOf = (outcome) => {
|
|
15
|
+
if (!outcome.ok)
|
|
16
|
+
throw new Error(`Expected success, got ${JSON.stringify(outcome.error)}`);
|
|
17
|
+
return outcome.result.output;
|
|
18
|
+
};
|
|
19
|
+
const tagOf = (outcome) => (outcome.ok ? "ok" : outcome.error._tag);
|
|
20
|
+
export const sharingConformance = (start) => describe("Sharing contract", () => {
|
|
21
|
+
let subject;
|
|
22
|
+
const org = unique("lib");
|
|
23
|
+
const other = unique("lib-other");
|
|
24
|
+
const users = {};
|
|
25
|
+
let n = 0;
|
|
26
|
+
const call = (who, action, input, surface = "internal", inOrg = org) => subject.invoke({ action, input, token: users[who].token, org: inOrg, surface });
|
|
27
|
+
const share = (who, input) => call(who, "sharing.grant", input);
|
|
28
|
+
const book = async (owner) => {
|
|
29
|
+
const id = `${org}-book-${++n}`;
|
|
30
|
+
outputOf(await call(owner, "library.create", { id, title: `Book ${n}` }));
|
|
31
|
+
return id;
|
|
32
|
+
};
|
|
33
|
+
/** The books `who`'s replica would hold, by the sync filter (acting in `inOrg`). */
|
|
34
|
+
const readable = async (who, inOrg = org) => subject.selected(await subject.query(users[who].token, "library.books", inOrg), "library.book");
|
|
35
|
+
const canRename = async (who, id, inOrg = org) => tagOf(await call(who, "library.rename", { id, title: `Renamed ${++n}` }, "internal", inOrg));
|
|
36
|
+
beforeAll(async () => {
|
|
37
|
+
subject = await start();
|
|
38
|
+
for (const name of ["ann", "ed", "rita", "gus", "lin", "nora"])
|
|
39
|
+
users[name] = await subject.user(`${name}-${org}`, org);
|
|
40
|
+
users["olga"] = await subject.user(`olga-${org}`, other);
|
|
41
|
+
});
|
|
42
|
+
afterAll(() => subject?.dispose());
|
|
43
|
+
describe("grants", () => {
|
|
44
|
+
it("a user grant lets the grantee read, with edit also write; revoking takes it away", async () => {
|
|
45
|
+
const id = await book("ann");
|
|
46
|
+
expect(await readable("rita")).not.toContain(id);
|
|
47
|
+
expect(await canRename("rita", id)).toBe("Forbidden");
|
|
48
|
+
const read = outputOf(await share("ann", { entity: "Library::Book", id, grantee: { user: users["rita"].id }, permission: "read" }));
|
|
49
|
+
expect(read).toMatchObject({ grantId: expect.any(String), token: null, expiresAt: null });
|
|
50
|
+
expect(await readable("rita")).toContain(id);
|
|
51
|
+
expect(await canRename("rita", id)).toBe("Forbidden");
|
|
52
|
+
const edit = outputOf(await share("ann", { entity: "Library::Book", id, grantee: { user: users["rita"].id }, permission: "edit" }));
|
|
53
|
+
expect(await canRename("rita", id)).toBe("ok");
|
|
54
|
+
// Sharing the same thing again is the same grant.
|
|
55
|
+
const again = outputOf(await share("ann", { entity: "Library::Book", id, grantee: { user: users["rita"].id }, permission: "edit" }));
|
|
56
|
+
expect(again.grantId).toBe(edit.grantId);
|
|
57
|
+
expect(outputOf(await call("ann", "sharing.revoke", { grantId: edit.grantId }))).toEqual({ revoked: true });
|
|
58
|
+
expect(await canRename("rita", id)).toBe("Forbidden");
|
|
59
|
+
outputOf(await call("ann", "sharing.revoke", { grantId: read.grantId }));
|
|
60
|
+
expect(await readable("rita")).not.toContain(id);
|
|
61
|
+
});
|
|
62
|
+
it("who may share is the entity's own share policy: an editor may, a reader may not, a stranger learns nothing", async () => {
|
|
63
|
+
const id = await book("ann");
|
|
64
|
+
await share("ann", { entity: "Library::Book", id, grantee: { user: users["rita"].id }, permission: "read" });
|
|
65
|
+
await share("ann", { entity: "Library::Book", id, grantee: { user: users["ed"].id }, permission: "edit" });
|
|
66
|
+
const toNora = { entity: "Library::Book", id, grantee: { user: users["nora"].id }, permission: "read" };
|
|
67
|
+
const refused = await share("rita", toNora);
|
|
68
|
+
expect(tagOf(refused)).toBe("Forbidden");
|
|
69
|
+
expect(tagOf(await share("ed", toNora))).toBe("ok");
|
|
70
|
+
// A record that does not exist gets the same answer as one the caller may not share.
|
|
71
|
+
const missing = await share("rita", { ...toNora, id: `${org}-no-such-book` });
|
|
72
|
+
expect(missing).toEqual(refused);
|
|
73
|
+
expect(tagOf(await call("rita", "sharing.list", { entity: "Library::Book", id }))).toBe("Forbidden");
|
|
74
|
+
const listed = outputOf(await call("ed", "sharing.list", { entity: "Library::Book", id })).grants;
|
|
75
|
+
const triples = (list) => list.map((t) => t.join(" ")).sort((a, b) => a.localeCompare(b));
|
|
76
|
+
expect(triples(listed.map((g) => [g.kind, g.grantee, g.permission]))).toEqual(triples([
|
|
77
|
+
["user", users["ed"].id, "edit"],
|
|
78
|
+
["user", users["nora"].id, "read"],
|
|
79
|
+
["user", users["rita"].id, "read"],
|
|
80
|
+
]));
|
|
81
|
+
// A grant of a record the caller may not share cannot be revoked by them.
|
|
82
|
+
expect(tagOf(await call("rita", "sharing.revoke", { grantId: listed[0].id }))).toBe("Forbidden");
|
|
83
|
+
});
|
|
84
|
+
it("permissions come from the entity's sharing attributes; grantees from the caller's organisation", async () => {
|
|
85
|
+
const id = await book("ann");
|
|
86
|
+
const grant = (grantee, permission = "read", entity = "Library::Book") => share("ann", { entity, id, grantee, permission });
|
|
87
|
+
expect(tagOf(await grant({ user: users["rita"].id }, "delete"))).toBe("InvalidInput");
|
|
88
|
+
expect(tagOf(await grant({ user: users["rita"].id }, "read", "Library::Nothing"))).toBe("InvalidInput");
|
|
89
|
+
expect(tagOf(await grant({ user: users["olga"].id }))).toBe("InvalidInput");
|
|
90
|
+
expect(tagOf(await grant({ group: "no-such-group" }))).toBe("InvalidInput");
|
|
91
|
+
expect(tagOf(await grant({ org: other }))).toBe("InvalidInput");
|
|
92
|
+
expect(tagOf(await grant({ user: users["rita"].id }, "read", "Library::Page"))).toBe("InvalidInput");
|
|
93
|
+
});
|
|
94
|
+
it("a group grant reaches members of the group, in the organisation, while they are in it", async () => {
|
|
95
|
+
const id = await book("ann");
|
|
96
|
+
await subject.joinGroup(users["gus"].id, org, "readers");
|
|
97
|
+
outputOf(await share("ann", { entity: "Library::Book", id, grantee: { group: "readers" }, permission: "read" }));
|
|
98
|
+
expect(await readable("gus")).toContain(id);
|
|
99
|
+
expect(await readable("nora")).not.toContain(id);
|
|
100
|
+
await subject.sql(`DELETE FROM eloxiv.group_member WHERE org_id = $1 AND group_id = 'readers' AND user_id = $2`, [org, users["gus"].id]);
|
|
101
|
+
expect(await readable("gus")).not.toContain(id);
|
|
102
|
+
});
|
|
103
|
+
it("an organisation grant reaches every member acting in it, and no one else", async () => {
|
|
104
|
+
const id = await book("ann");
|
|
105
|
+
outputOf(await share("ann", { entity: "Library::Book", id, grantee: { org }, permission: "edit" }));
|
|
106
|
+
expect(await readable("nora")).toContain(id);
|
|
107
|
+
expect(await canRename("nora", id)).toBe("ok");
|
|
108
|
+
expect(await readable("olga", other)).not.toContain(id);
|
|
109
|
+
});
|
|
110
|
+
it("a link: its token returned once and never listed, held by members who redeem it, until revoked", async () => {
|
|
111
|
+
const id = await book("ann");
|
|
112
|
+
const made = outputOf(await share("ann", { entity: "Library::Book", id, grantee: { link: {} }, permission: "read" }));
|
|
113
|
+
expect(made.token).toMatch(/^eloxiv_link_/);
|
|
114
|
+
// Links always expire: 30 days by default.
|
|
115
|
+
const ttl = Date.parse(made.expiresAt) - Date.now();
|
|
116
|
+
expect(ttl).toBeGreaterThan(29 * 86_400_000);
|
|
117
|
+
expect(ttl).toBeLessThanOrEqual(30 * 86_400_000);
|
|
118
|
+
const listed = outputOf(await call("ann", "sharing.list", { entity: "Library::Book", id }));
|
|
119
|
+
expect(JSON.stringify(listed)).not.toContain(made.token);
|
|
120
|
+
expect(listed.grants).toEqual([expect.objectContaining({ id: made.grantId, kind: "link", redemptions: 0 })]);
|
|
121
|
+
expect(await readable("lin")).not.toContain(id);
|
|
122
|
+
expect(outputOf(await call("lin", "sharing.redeemLink", { token: made.token }))).toEqual({
|
|
123
|
+
entity: "Library::Book",
|
|
124
|
+
id,
|
|
125
|
+
permission: "read",
|
|
126
|
+
});
|
|
127
|
+
expect(await readable("lin")).toContain(id);
|
|
128
|
+
// Only while acting in the link's organisation; a made-up token is refused.
|
|
129
|
+
expect(tagOf(await call("olga", "sharing.redeemLink", { token: made.token }, "internal", other))).toBe("Forbidden");
|
|
130
|
+
expect(tagOf(await call("lin", "sharing.redeemLink", { token: `${made.token}x` }))).toBe("Forbidden");
|
|
131
|
+
outputOf(await call("ann", "sharing.revoke", { grantId: made.grantId }));
|
|
132
|
+
expect(await readable("lin")).not.toContain(id);
|
|
133
|
+
expect(tagOf(await call("lin", "sharing.redeemLink", { token: made.token }))).toBe("Forbidden");
|
|
134
|
+
});
|
|
135
|
+
it("an expired grant authorises nothing from the instant it expires, and the kernel deletes it", async () => {
|
|
136
|
+
const id = await book("ann");
|
|
137
|
+
const soon = new Date(Date.now() + 2_000).toISOString();
|
|
138
|
+
const made = outputOf(await share("ann", {
|
|
139
|
+
entity: "Library::Book",
|
|
140
|
+
id,
|
|
141
|
+
grantee: { link: {} },
|
|
142
|
+
permission: "edit",
|
|
143
|
+
expiresAt: soon,
|
|
144
|
+
}));
|
|
145
|
+
outputOf(await call("lin", "sharing.redeemLink", { token: made.token }));
|
|
146
|
+
expect(await canRename("lin", id)).toBe("ok");
|
|
147
|
+
await new Promise((resolve) => setTimeout(resolve, Date.parse(soon) - Date.now() + 100));
|
|
148
|
+
expect(await canRename("lin", id)).toBe("Forbidden");
|
|
149
|
+
await until("the expired grant to be deleted", () => subject.sql(`SELECT id FROM eloxiv.share_grant WHERE id = $1`, [made.grantId]), (rows) => rows.length === 0);
|
|
150
|
+
expect(await readable("lin")).not.toContain(id);
|
|
151
|
+
const past = new Date(Date.now() - 1_000).toISOString();
|
|
152
|
+
const far = new Date(Date.now() + 400 * 86_400_000).toISOString();
|
|
153
|
+
expect(tagOf(await share("ann", { entity: "Library::Book", id, grantee: { org }, permission: "read", expiresAt: past }))).toBe("InvalidInput");
|
|
154
|
+
expect(tagOf(await share("ann", {
|
|
155
|
+
entity: "Library::Book",
|
|
156
|
+
id,
|
|
157
|
+
grantee: { link: {} },
|
|
158
|
+
permission: "read",
|
|
159
|
+
expiresAt: far,
|
|
160
|
+
}))).toBe("InvalidInput");
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
describe("a grant stays in its record's organisation", () => {
|
|
164
|
+
// Max belongs to both organisations; Olga only to the other one. The review's case: an editor of a record
|
|
165
|
+
// switches to another organisation he belongs to and shares the record with someone there.
|
|
166
|
+
beforeAll(async () => {
|
|
167
|
+
users["max"] = await subject.user(`max-${org}`, org);
|
|
168
|
+
await subject.user(`max-${org}`, other);
|
|
169
|
+
});
|
|
170
|
+
const asMax = (action, input) => call("max", action, input, "internal", other);
|
|
171
|
+
it("refuses every sharing operation on the record while acting in another organisation", async () => {
|
|
172
|
+
const id = await book("ann");
|
|
173
|
+
const edit = outputOf(await share("ann", { entity: "Library::Book", id, grantee: { user: users["max"].id }, permission: "edit" }));
|
|
174
|
+
// In the record's organisation, Max may share it.
|
|
175
|
+
expect(await canRename("max", id)).toBe("ok");
|
|
176
|
+
const refused = await share("rita", { entity: "Library::Book", id, grantee: { org }, permission: "read" });
|
|
177
|
+
for (const grantee of [{ user: users["olga"].id }, { org: other }, { link: {} }]) {
|
|
178
|
+
// The same answer as for a record he may not share: nothing about it is revealed.
|
|
179
|
+
expect(await asMax("sharing.grant", { entity: "Library::Book", id, grantee, permission: "edit" })).toEqual(refused);
|
|
180
|
+
}
|
|
181
|
+
expect(tagOf(await asMax("sharing.list", { entity: "Library::Book", id }))).toBe("Forbidden");
|
|
182
|
+
expect(tagOf(await asMax("sharing.revoke", { grantId: edit.grantId }))).toBe("Forbidden");
|
|
183
|
+
// Olga asks for it from her organisation: no one is asked to decide.
|
|
184
|
+
const asked = outputOf(await call("olga", "sharing.requestAccess", { entity: "Library::Book", id, permission: "edit" }, "internal", other));
|
|
185
|
+
expect(await subject.sql(`SELECT 1 FROM eloxiv_inbox.work_item WHERE source = 'sharing.accessRequests' AND source_id = $1`, [asked.id])).toEqual([]);
|
|
186
|
+
expect(await readable("olga", other)).not.toContain(id);
|
|
187
|
+
expect(await canRename("olga", id, other)).toBe("Forbidden");
|
|
188
|
+
});
|
|
189
|
+
it("a grant counts only while acting in the record's organisation, whoever made it and wherever", async () => {
|
|
190
|
+
const id = await book("ann");
|
|
191
|
+
outputOf(await share("ann", { entity: "Library::Book", id, grantee: { user: users["max"].id }, permission: "edit" }));
|
|
192
|
+
expect(await readable("max")).toContain(id);
|
|
193
|
+
// Acting in the other organisation, Max's grant on this organisation's record counts for nothing.
|
|
194
|
+
expect(await readable("max", other)).not.toContain(id);
|
|
195
|
+
expect(await canRename("max", id, other)).toBe("Forbidden");
|
|
196
|
+
// A grant recorded in another organisation than its record's (only trusted code could make one)
|
|
197
|
+
// authorises no one, in either organisation.
|
|
198
|
+
await subject.sql(`INSERT INTO eloxiv.share_grant (id, resource_type, resource_id, grantee_kind, grantee_id, org_id, permission, granted_by)
|
|
199
|
+
VALUES ($1, 'Library::Book', $2, 'user', $3, $4, 'edit', 'test'), ($5, 'Library::Book', $2, 'org', $4, $4, 'edit', 'test')`, [`${id}-foreign`, id, users["olga"].id, other, `${id}-foreign-org`]);
|
|
200
|
+
expect(await readable("olga", other)).not.toContain(id);
|
|
201
|
+
expect(await canRename("olga", id, other)).toBe("Forbidden");
|
|
202
|
+
expect(await canRename("max", id, other)).toBe("Forbidden");
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
describe("on every surface, audited", () => {
|
|
206
|
+
it("shares over RPC and HTTP, and holds an agent's share (agent tools, MCP) for the person's consent", async () => {
|
|
207
|
+
const id = await book("ann");
|
|
208
|
+
for (const surface of ["rpc", "http"]) {
|
|
209
|
+
const outcome = await call("ann", "sharing.grant", { entity: "Library::Book", id, grantee: { user: users["rita"].id }, permission: "read" }, surface);
|
|
210
|
+
expect(tagOf(outcome), surface).toBe("ok");
|
|
211
|
+
}
|
|
212
|
+
for (const surface of ["agent", "mcp"]) {
|
|
213
|
+
const agent = await call("ann", "sharing.grant", { entity: "Library::Book", id, grantee: { user: users["nora"].id }, permission: "read" }, surface);
|
|
214
|
+
expect(tagOf(agent), surface).toBe("ConsentRequired");
|
|
215
|
+
}
|
|
216
|
+
expect(await readable("nora")).not.toContain(id);
|
|
217
|
+
// Listing is not held: it changes nothing.
|
|
218
|
+
expect(tagOf(await call("ann", "sharing.list", { entity: "Library::Book", id }, "mcp"))).toBe("ok");
|
|
219
|
+
const all = await subject.audit({ action: "sharing.grant" });
|
|
220
|
+
const audited = all.filter((a) => a.actorUserId === users["ann"].id);
|
|
221
|
+
const surfaces = new Set(audited.filter((a) => a.outcome === "succeeded").map((a) => a.surface));
|
|
222
|
+
for (const surface of ["rpc", "http", "internal"])
|
|
223
|
+
expect(surfaces).toContain(surface);
|
|
224
|
+
for (const surface of ["agent", "mcp"]) {
|
|
225
|
+
expect(audited.some((a) => a.outcome === "approval-required" && a.surface === surface), surface).toBe(true);
|
|
226
|
+
}
|
|
227
|
+
const denied = all.filter((a) => a.actorUserId === users["rita"].id);
|
|
228
|
+
expect(denied.some((a) => a.outcome === "denied")).toBe(true);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
describe("access requests", () => {
|
|
232
|
+
const itemsOf = (requestId) => subject.sql(`SELECT assignee_user_id AS assignee, state FROM eloxiv_inbox.work_item
|
|
233
|
+
WHERE source = 'sharing.accessRequests' AND source_id = $1 ORDER BY assignee_user_id`, [requestId]);
|
|
234
|
+
const notified = (userId, title) => subject.sql(`SELECT id FROM eloxiv_notifications.notification WHERE recipient_id = $1 AND title = $2`, [
|
|
235
|
+
userId,
|
|
236
|
+
title,
|
|
237
|
+
]);
|
|
238
|
+
it("reaches every manager of the record (by its share policy) as a work item and a notification", async () => {
|
|
239
|
+
const id = await book("ann");
|
|
240
|
+
await share("ann", { entity: "Library::Book", id, grantee: { user: users["ed"].id }, permission: "edit" });
|
|
241
|
+
const asked = outputOf(await call("nora", "sharing.requestAccess", { entity: "Library::Book", id, permission: "edit" }));
|
|
242
|
+
expect(asked).toEqual({ id: expect.any(String), status: "pending" });
|
|
243
|
+
const items = await itemsOf(asked.id);
|
|
244
|
+
expect(items.map((i) => i.assignee).sort()).toEqual([users["ann"].id, users["ed"].id].sort());
|
|
245
|
+
expect(items.every((i) => i.state === "open")).toBe(true);
|
|
246
|
+
expect(await notified(users["ann"].id, "Access request: edit")).toHaveLength(1);
|
|
247
|
+
expect(await notified(users["rita"].id, "Access request: edit")).toHaveLength(0);
|
|
248
|
+
// Not a manager: cannot decide.
|
|
249
|
+
expect(tagOf(await call("rita", "sharing.approveRequest", { id: asked.id }))).toBe("Forbidden");
|
|
250
|
+
expect(await canRename("nora", id)).toBe("Forbidden");
|
|
251
|
+
const approved = outputOf(await call("ann", "sharing.approveRequest", { id: asked.id }));
|
|
252
|
+
expect(approved).toEqual({ id: asked.id, status: "approved", grantId: expect.any(String) });
|
|
253
|
+
expect(await canRename("nora", id)).toBe("ok");
|
|
254
|
+
expect((await itemsOf(asked.id)).every((i) => i.state === "done")).toBe(true);
|
|
255
|
+
expect(await notified(users["nora"].id, "Access granted: edit")).toHaveLength(1);
|
|
256
|
+
expect(tagOf(await call("ed", "sharing.denyRequest", { id: asked.id }))).toBe("InvalidInput");
|
|
257
|
+
});
|
|
258
|
+
it("gives the same answer for a record that does not exist, and asks no one", async () => {
|
|
259
|
+
const asked = outputOf(await call("nora", "sharing.requestAccess", {
|
|
260
|
+
entity: "Library::Book",
|
|
261
|
+
id: `${org}-nothing`,
|
|
262
|
+
permission: "read",
|
|
263
|
+
}));
|
|
264
|
+
expect(asked).toEqual({ id: expect.any(String), status: "pending" });
|
|
265
|
+
expect(await itemsOf(asked.id)).toEqual([]);
|
|
266
|
+
expect(tagOf(await call("nora", "sharing.requestAccess", { entity: "Library::Book", id: "x", permission: "own" }))).toBe("InvalidInput");
|
|
267
|
+
});
|
|
268
|
+
it("tells a person whether they may open a record, the same for one that does not exist, with their own requests", async () => {
|
|
269
|
+
const id = await book("ann");
|
|
270
|
+
const status = async (who, record = id, inOrg = org) => outputOf(await call(who, "sharing.access", { entity: "Library::Book", id: record }, "internal", inOrg));
|
|
271
|
+
expect(await status("ann")).toEqual({ access: "allowed", canShare: true, requests: [] });
|
|
272
|
+
const refused = await status("nora");
|
|
273
|
+
expect(refused).toEqual({ access: "unavailable", canShare: false, requests: [] });
|
|
274
|
+
// A record that does not exist, and one of another organisation, answer exactly the same.
|
|
275
|
+
expect(await status("nora", `${org}-no-such-book`)).toEqual(refused);
|
|
276
|
+
expect(await status("olga", id, other)).toEqual(refused);
|
|
277
|
+
const asked = outputOf(await call("nora", "sharing.requestAccess", { entity: "Library::Book", id, permission: "read" }));
|
|
278
|
+
expect((await status("nora")).requests).toEqual([
|
|
279
|
+
{ id: asked.id, permission: "read", status: "pending", updatedAt: expect.any(String) },
|
|
280
|
+
]);
|
|
281
|
+
// Another person's request is never theirs to see.
|
|
282
|
+
expect((await status("rita")).requests).toEqual([]);
|
|
283
|
+
outputOf(await call("ann", "sharing.approveRequest", { id: asked.id }));
|
|
284
|
+
expect(await status("nora")).toMatchObject({
|
|
285
|
+
access: "allowed",
|
|
286
|
+
canShare: false,
|
|
287
|
+
requests: [{ status: "approved" }],
|
|
288
|
+
});
|
|
289
|
+
// A reader may read but not share; access follows the grant away again.
|
|
290
|
+
const [grant] = outputOf(await call("ann", "sharing.list", { entity: "Library::Book", id }))
|
|
291
|
+
.grants;
|
|
292
|
+
outputOf(await call("ann", "sharing.revoke", { grantId: grant.id }));
|
|
293
|
+
expect((await status("nora")).access).toBe("unavailable");
|
|
294
|
+
});
|
|
295
|
+
it("a denial grants nothing; a manager who may no longer share cannot approve", async () => {
|
|
296
|
+
const id = await book("ann");
|
|
297
|
+
const editGrant = outputOf(await share("ann", { entity: "Library::Book", id, grantee: { user: users["ed"].id }, permission: "edit" }));
|
|
298
|
+
const first = outputOf(await call("rita", "sharing.requestAccess", { entity: "Library::Book", id, permission: "read" }));
|
|
299
|
+
expect(outputOf(await call("ed", "sharing.denyRequest", { id: first.id }))).toMatchObject({
|
|
300
|
+
status: "denied",
|
|
301
|
+
grantId: null,
|
|
302
|
+
});
|
|
303
|
+
expect(await readable("rita")).not.toContain(id);
|
|
304
|
+
expect(await notified(users["rita"].id, "Access denied: read")).toHaveLength(1);
|
|
305
|
+
// Asking again reopens the request; Ed loses his edit grant before he decides.
|
|
306
|
+
const again = outputOf(await call("rita", "sharing.requestAccess", { entity: "Library::Book", id, permission: "read" }));
|
|
307
|
+
expect(again.id).toBe(first.id);
|
|
308
|
+
outputOf(await call("ann", "sharing.revoke", { grantId: editGrant.grantId }));
|
|
309
|
+
expect(tagOf(await call("ed", "sharing.approveRequest", { id: again.id }))).toBe("Forbidden");
|
|
310
|
+
expect(await readable("rita")).not.toContain(id);
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
describe("sync", () => {
|
|
314
|
+
it("evaluates grants for the caller only, live (no grantee but the caller is bound into the filter)", async () => {
|
|
315
|
+
const answer = await subject.query(users["rita"].token, "library.books", org);
|
|
316
|
+
if (answer.status !== 200)
|
|
317
|
+
throw new Error("refused");
|
|
318
|
+
const ast = JSON.stringify(answer.answer["ast"]);
|
|
319
|
+
expect(ast).toContain("eloxiv.share_grant");
|
|
320
|
+
expect(ast).toContain('"system":"permissions"');
|
|
321
|
+
expect(ast).toContain(JSON.stringify(users["rita"].id));
|
|
322
|
+
for (const name of ["ann", "nora", "gus", "lin"])
|
|
323
|
+
expect(ast).not.toContain(JSON.stringify(users[name].id));
|
|
324
|
+
});
|
|
325
|
+
it("authorises the pages a query reaches from their book by the page's own policy", async () => {
|
|
326
|
+
const id = await book("ann");
|
|
327
|
+
await share("ann", { entity: "Library::Book", id, grantee: { user: users["rita"].id }, permission: "read" });
|
|
328
|
+
const p1 = `${id}-p1`;
|
|
329
|
+
const p2 = `${id}-p2`;
|
|
330
|
+
outputOf(await call("ann", "library.addPage", { id: p1, bookId: id, body: "shared" }));
|
|
331
|
+
outputOf(await call("ann", "library.addPage", { id: p2, bookId: id, body: "private" }));
|
|
332
|
+
// A page goes only into a book of your own (one hop, in row-level security).
|
|
333
|
+
expect(tagOf(await call("rita", "library.addPage", { id: `${id}-p3`, bookId: id, body: "x" }))).toBe("Forbidden");
|
|
334
|
+
// A page is shared by its book's owner.
|
|
335
|
+
expect(tagOf(await share("rita", {
|
|
336
|
+
entity: "Library::Page",
|
|
337
|
+
id: p1,
|
|
338
|
+
grantee: { user: users["rita"].id },
|
|
339
|
+
permission: "view",
|
|
340
|
+
}))).toBe("Forbidden");
|
|
341
|
+
const viewGrant = outputOf(await share("ann", {
|
|
342
|
+
entity: "Library::Page",
|
|
343
|
+
id: p1,
|
|
344
|
+
grantee: { user: users["rita"].id },
|
|
345
|
+
permission: "view",
|
|
346
|
+
}));
|
|
347
|
+
const answer = await subject.query(users["rita"].token, "library.booksWithPages", org);
|
|
348
|
+
if (answer.status !== 200)
|
|
349
|
+
throw new Error("refused");
|
|
350
|
+
const ast = answer.answer["ast"];
|
|
351
|
+
expect(answer.answer["error"]).toBeUndefined();
|
|
352
|
+
const child = { status: 200, answer: { ast: ast["related"][0]["subquery"] } };
|
|
353
|
+
expect(await subject.selected(answer, "library.book")).toContain(id);
|
|
354
|
+
const pages = await subject.selected(child, "library.page");
|
|
355
|
+
expect(pages).toContain(p1);
|
|
356
|
+
expect(pages).not.toContain(p2);
|
|
357
|
+
// The owner of the book reads both, through the page's one hop to its book.
|
|
358
|
+
const own = await subject.query(users["ann"].token, "library.booksWithPages", org);
|
|
359
|
+
if (own.status !== 200)
|
|
360
|
+
throw new Error("refused");
|
|
361
|
+
const ownPages = await subject.selected({ status: 200, answer: { ast: own.answer["ast"]["related"][0]["subquery"] } }, "library.page");
|
|
362
|
+
expect(ownPages).toEqual(expect.arrayContaining([p1, p2]));
|
|
363
|
+
outputOf(await call("ann", "sharing.revoke", { grantId: viewGrant.grantId }));
|
|
364
|
+
expect(await subject.selected(child, "library.page")).not.toContain(p1);
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
//# sourceMappingURL=Sharing.js.map
|