@eloxiv/testing 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/Admin.d.ts +20 -0
- package/dist/Admin.d.ts.map +1 -0
- package/dist/Admin.js +61 -0
- package/dist/Admin.js.map +1 -0
- package/dist/Agent.d.ts +97 -0
- package/dist/Agent.d.ts.map +1 -0
- package/dist/Agent.js +210 -0
- package/dist/Agent.js.map +1 -0
- package/dist/AgentSurface.d.ts +20 -0
- package/dist/AgentSurface.d.ts.map +1 -0
- package/dist/AgentSurface.js +36 -0
- package/dist/AgentSurface.js.map +1 -0
- package/dist/Embedder.d.ts +21 -0
- package/dist/Embedder.d.ts.map +1 -0
- package/dist/Embedder.js +54 -0
- package/dist/Embedder.js.map +1 -0
- package/dist/EvalMain.d.ts +2 -0
- package/dist/EvalMain.d.ts.map +1 -0
- package/dist/EvalMain.js +80 -0
- package/dist/EvalMain.js.map +1 -0
- package/dist/Evals.d.ts +95 -0
- package/dist/Evals.d.ts.map +1 -0
- package/dist/Evals.js +389 -0
- package/dist/Evals.js.map +1 -0
- package/dist/Kernel.d.ts +88 -0
- package/dist/Kernel.d.ts.map +1 -0
- package/dist/Kernel.js +108 -0
- package/dist/Kernel.js.map +1 -0
- package/dist/Launch.d.ts +86 -0
- package/dist/Launch.d.ts.map +1 -0
- package/dist/Launch.js +370 -0
- package/dist/Launch.js.map +1 -0
- package/dist/Locks.d.ts +39 -0
- package/dist/Locks.d.ts.map +1 -0
- package/dist/Locks.js +94 -0
- package/dist/Locks.js.map +1 -0
- package/dist/Routes.d.ts +19 -0
- package/dist/Routes.d.ts.map +1 -0
- package/dist/Routes.js +38 -0
- package/dist/Routes.js.map +1 -0
- package/dist/ScriptedChatModel.d.ts +51 -0
- package/dist/ScriptedChatModel.d.ts.map +1 -0
- package/dist/ScriptedChatModel.js +135 -0
- package/dist/ScriptedChatModel.js.map +1 -0
- package/dist/SmtpSink.d.ts +36 -0
- package/dist/SmtpSink.d.ts.map +1 -0
- package/dist/SmtpSink.js +185 -0
- package/dist/SmtpSink.js.map +1 -0
- package/dist/System.d.ts +271 -0
- package/dist/System.d.ts.map +1 -0
- package/dist/System.js +905 -0
- package/dist/System.js.map +1 -0
- package/dist/TcpProxy.d.ts +17 -0
- package/dist/TcpProxy.d.ts.map +1 -0
- package/dist/TcpProxy.js +100 -0
- package/dist/TcpProxy.js.map +1 -0
- package/dist/auth/TrustedProxyAuth.d.ts +28 -0
- package/dist/auth/TrustedProxyAuth.d.ts.map +1 -0
- package/dist/auth/TrustedProxyAuth.js +128 -0
- package/dist/auth/TrustedProxyAuth.js.map +1 -0
- package/dist/conformance/ActionConsent.d.ts +3 -0
- package/dist/conformance/ActionConsent.d.ts.map +1 -0
- package/dist/conformance/ActionConsent.js +347 -0
- package/dist/conformance/ActionConsent.js.map +1 -0
- package/dist/conformance/ActionRegistry.d.ts +64 -0
- package/dist/conformance/ActionRegistry.d.ts.map +1 -0
- package/dist/conformance/ActionRegistry.js +136 -0
- package/dist/conformance/ActionRegistry.js.map +1 -0
- package/dist/conformance/Actor.d.ts +43 -0
- package/dist/conformance/Actor.d.ts.map +1 -0
- package/dist/conformance/Actor.js +171 -0
- package/dist/conformance/Actor.js.map +1 -0
- package/dist/conformance/AgentReference.d.ts +30 -0
- package/dist/conformance/AgentReference.d.ts.map +1 -0
- package/dist/conformance/AgentReference.js +137 -0
- package/dist/conformance/AgentReference.js.map +1 -0
- package/dist/conformance/AgentResources.d.ts +3 -0
- package/dist/conformance/AgentResources.d.ts.map +1 -0
- package/dist/conformance/AgentResources.js +454 -0
- package/dist/conformance/AgentResources.js.map +1 -0
- package/dist/conformance/AgentRuntime.d.ts +3 -0
- package/dist/conformance/AgentRuntime.d.ts.map +1 -0
- package/dist/conformance/AgentRuntime.js +302 -0
- package/dist/conformance/AgentRuntime.js.map +1 -0
- package/dist/conformance/AgentSubject.d.ts +87 -0
- package/dist/conformance/AgentSubject.d.ts.map +1 -0
- package/dist/conformance/AgentSubject.js +18 -0
- package/dist/conformance/AgentSubject.js.map +1 -0
- package/dist/conformance/Approvals.d.ts +3 -0
- package/dist/conformance/Approvals.d.ts.map +1 -0
- package/dist/conformance/Approvals.js +258 -0
- package/dist/conformance/Approvals.js.map +1 -0
- package/dist/conformance/Audit.d.ts +3 -0
- package/dist/conformance/Audit.d.ts.map +1 -0
- package/dist/conformance/Audit.js +221 -0
- package/dist/conformance/Audit.js.map +1 -0
- package/dist/conformance/CalendarProvider.d.ts +4 -0
- package/dist/conformance/CalendarProvider.d.ts.map +1 -0
- package/dist/conformance/CalendarProvider.js +108 -0
- package/dist/conformance/CalendarProvider.js.map +1 -0
- package/dist/conformance/CapabilityKit.d.ts +191 -0
- package/dist/conformance/CapabilityKit.d.ts.map +1 -0
- package/dist/conformance/CapabilityKit.js +375 -0
- package/dist/conformance/CapabilityKit.js.map +1 -0
- package/dist/conformance/ClientSDK.d.ts +78 -0
- package/dist/conformance/ClientSDK.d.ts.map +1 -0
- package/dist/conformance/ClientSDK.js +163 -0
- package/dist/conformance/ClientSDK.js.map +1 -0
- package/dist/conformance/CollabDocument.d.ts +3 -0
- package/dist/conformance/CollabDocument.d.ts.map +1 -0
- package/dist/conformance/CollabDocument.js +934 -0
- package/dist/conformance/CollabDocument.js.map +1 -0
- package/dist/conformance/CollabReference.d.ts +8 -0
- package/dist/conformance/CollabReference.d.ts.map +1 -0
- package/dist/conformance/CollabReference.js +138 -0
- package/dist/conformance/CollabReference.js.map +1 -0
- package/dist/conformance/CollabSubject.d.ts +68 -0
- package/dist/conformance/CollabSubject.d.ts.map +1 -0
- package/dist/conformance/CollabSubject.js +2 -0
- package/dist/conformance/CollabSubject.js.map +1 -0
- package/dist/conformance/Command.d.ts +3 -0
- package/dist/conformance/Command.d.ts.map +1 -0
- package/dist/conformance/Command.js +73 -0
- package/dist/conformance/Command.js.map +1 -0
- package/dist/conformance/Connections.d.ts +4 -0
- package/dist/conformance/Connections.d.ts.map +1 -0
- package/dist/conformance/Connections.js +308 -0
- package/dist/conformance/Connections.js.map +1 -0
- package/dist/conformance/ConnectionsReference.d.ts +56 -0
- package/dist/conformance/ConnectionsReference.d.ts.map +1 -0
- package/dist/conformance/ConnectionsReference.js +74 -0
- package/dist/conformance/ConnectionsReference.js.map +1 -0
- package/dist/conformance/ConnectorReference.d.ts +86 -0
- package/dist/conformance/ConnectorReference.d.ts.map +1 -0
- package/dist/conformance/ConnectorReference.js +185 -0
- package/dist/conformance/ConnectorReference.js.map +1 -0
- package/dist/conformance/ContextAccounting.d.ts +8 -0
- package/dist/conformance/ContextAccounting.d.ts.map +1 -0
- package/dist/conformance/ContextAccounting.js +125 -0
- package/dist/conformance/ContextAccounting.js.map +1 -0
- package/dist/conformance/Daemon.d.ts +150 -0
- package/dist/conformance/Daemon.d.ts.map +1 -0
- package/dist/conformance/Daemon.js +718 -0
- package/dist/conformance/Daemon.js.map +1 -0
- package/dist/conformance/DaemonReference.d.ts +15 -0
- package/dist/conformance/DaemonReference.d.ts.map +1 -0
- package/dist/conformance/DaemonReference.js +163 -0
- package/dist/conformance/DaemonReference.js.map +1 -0
- package/dist/conformance/DbTx.d.ts +17 -0
- package/dist/conformance/DbTx.d.ts.map +1 -0
- package/dist/conformance/DbTx.js +184 -0
- package/dist/conformance/DbTx.js.map +1 -0
- package/dist/conformance/DecisionTokens.d.ts +3 -0
- package/dist/conformance/DecisionTokens.d.ts.map +1 -0
- package/dist/conformance/DecisionTokens.js +551 -0
- package/dist/conformance/DecisionTokens.js.map +1 -0
- package/dist/conformance/Delegation.d.ts +3 -0
- package/dist/conformance/Delegation.d.ts.map +1 -0
- package/dist/conformance/Delegation.js +149 -0
- package/dist/conformance/Delegation.js.map +1 -0
- package/dist/conformance/DeskReference.d.ts +21 -0
- package/dist/conformance/DeskReference.d.ts.map +1 -0
- package/dist/conformance/DeskReference.js +47 -0
- package/dist/conformance/DeskReference.js.map +1 -0
- package/dist/conformance/DeviceControl.d.ts +3 -0
- package/dist/conformance/DeviceControl.d.ts.map +1 -0
- package/dist/conformance/DeviceControl.js +579 -0
- package/dist/conformance/DeviceControl.js.map +1 -0
- package/dist/conformance/Directory.d.ts +36 -0
- package/dist/conformance/Directory.d.ts.map +1 -0
- package/dist/conformance/Directory.js +253 -0
- package/dist/conformance/Directory.js.map +1 -0
- package/dist/conformance/DirectoryProvider.d.ts +4 -0
- package/dist/conformance/DirectoryProvider.d.ts.map +1 -0
- package/dist/conformance/DirectoryProvider.js +58 -0
- package/dist/conformance/DirectoryProvider.js.map +1 -0
- package/dist/conformance/DocumentSource.d.ts +4 -0
- package/dist/conformance/DocumentSource.d.ts.map +1 -0
- package/dist/conformance/DocumentSource.js +43 -0
- package/dist/conformance/DocumentSource.js.map +1 -0
- package/dist/conformance/EndpointReference.d.ts +40 -0
- package/dist/conformance/EndpointReference.d.ts.map +1 -0
- package/dist/conformance/EndpointReference.js +67 -0
- package/dist/conformance/EndpointReference.js.map +1 -0
- package/dist/conformance/Files.d.ts +40 -0
- package/dist/conformance/Files.d.ts.map +1 -0
- package/dist/conformance/Files.js +592 -0
- package/dist/conformance/Files.js.map +1 -0
- package/dist/conformance/FilesReference.d.ts +31 -0
- package/dist/conformance/FilesReference.d.ts.map +1 -0
- package/dist/conformance/FilesReference.js +116 -0
- package/dist/conformance/FilesReference.js.map +1 -0
- package/dist/conformance/FilesSubject.d.ts +46 -0
- package/dist/conformance/FilesSubject.d.ts.map +1 -0
- package/dist/conformance/FilesSubject.js +3 -0
- package/dist/conformance/FilesSubject.js.map +1 -0
- package/dist/conformance/Flags.d.ts +3 -0
- package/dist/conformance/Flags.d.ts.map +1 -0
- package/dist/conformance/Flags.js +183 -0
- package/dist/conformance/Flags.js.map +1 -0
- package/dist/conformance/Host.d.ts +64 -0
- package/dist/conformance/Host.d.ts.map +1 -0
- package/dist/conformance/Host.js +152 -0
- package/dist/conformance/Host.js.map +1 -0
- package/dist/conformance/HttpApi.d.ts +5 -0
- package/dist/conformance/HttpApi.d.ts.map +1 -0
- package/dist/conformance/HttpApi.js +131 -0
- package/dist/conformance/HttpApi.js.map +1 -0
- package/dist/conformance/InboxReference.d.ts +28 -0
- package/dist/conformance/InboxReference.d.ts.map +1 -0
- package/dist/conformance/InboxReference.js +331 -0
- package/dist/conformance/InboxReference.js.map +1 -0
- package/dist/conformance/InboxSubject.d.ts +92 -0
- package/dist/conformance/InboxSubject.d.ts.map +1 -0
- package/dist/conformance/InboxSubject.js +16 -0
- package/dist/conformance/InboxSubject.js.map +1 -0
- package/dist/conformance/Ingestion.d.ts +10 -0
- package/dist/conformance/Ingestion.d.ts.map +1 -0
- package/dist/conformance/Ingestion.js +335 -0
- package/dist/conformance/Ingestion.js.map +1 -0
- package/dist/conformance/Ingress.d.ts +62 -0
- package/dist/conformance/Ingress.d.ts.map +1 -0
- package/dist/conformance/Ingress.js +346 -0
- package/dist/conformance/Ingress.js.map +1 -0
- package/dist/conformance/Invocation.d.ts +3 -0
- package/dist/conformance/Invocation.d.ts.map +1 -0
- package/dist/conformance/Invocation.js +665 -0
- package/dist/conformance/Invocation.js.map +1 -0
- package/dist/conformance/IsolationMatrix.d.ts +60 -0
- package/dist/conformance/IsolationMatrix.d.ts.map +1 -0
- package/dist/conformance/IsolationMatrix.js +196 -0
- package/dist/conformance/IsolationMatrix.js.map +1 -0
- package/dist/conformance/LiveConnection.d.ts +72 -0
- package/dist/conformance/LiveConnection.d.ts.map +1 -0
- package/dist/conformance/LiveConnection.js +125 -0
- package/dist/conformance/LiveConnection.js.map +1 -0
- package/dist/conformance/LocalClient.d.ts +62 -0
- package/dist/conformance/LocalClient.d.ts.map +1 -0
- package/dist/conformance/LocalClient.js +526 -0
- package/dist/conformance/LocalClient.js.map +1 -0
- package/dist/conformance/Locale.d.ts +28 -0
- package/dist/conformance/Locale.d.ts.map +1 -0
- package/dist/conformance/Locale.js +115 -0
- package/dist/conformance/Locale.js.map +1 -0
- package/dist/conformance/MachineIdentity.d.ts +39 -0
- package/dist/conformance/MachineIdentity.d.ts.map +1 -0
- package/dist/conformance/MachineIdentity.js +595 -0
- package/dist/conformance/MachineIdentity.js.map +1 -0
- package/dist/conformance/MailProvider.d.ts +4 -0
- package/dist/conformance/MailProvider.d.ts.map +1 -0
- package/dist/conformance/MailProvider.js +167 -0
- package/dist/conformance/MailProvider.js.map +1 -0
- package/dist/conformance/Memory.d.ts +10 -0
- package/dist/conformance/Memory.d.ts.map +1 -0
- package/dist/conformance/Memory.js +179 -0
- package/dist/conformance/Memory.js.map +1 -0
- package/dist/conformance/Messaging.d.ts +49 -0
- package/dist/conformance/Messaging.d.ts.map +1 -0
- package/dist/conformance/Messaging.js +117 -0
- package/dist/conformance/Messaging.js.map +1 -0
- package/dist/conformance/Metering.d.ts +26 -0
- package/dist/conformance/Metering.d.ts.map +1 -0
- package/dist/conformance/Metering.js +236 -0
- package/dist/conformance/Metering.js.map +1 -0
- package/dist/conformance/ModelProvider.d.ts +32 -0
- package/dist/conformance/ModelProvider.d.ts.map +1 -0
- package/dist/conformance/ModelProvider.js +100 -0
- package/dist/conformance/ModelProvider.js.map +1 -0
- package/dist/conformance/ModuleManifest.d.ts +9 -0
- package/dist/conformance/ModuleManifest.d.ts.map +1 -0
- package/dist/conformance/ModuleManifest.js +542 -0
- package/dist/conformance/ModuleManifest.js.map +1 -0
- package/dist/conformance/NotebookAgent.d.ts +32 -0
- package/dist/conformance/NotebookAgent.d.ts.map +1 -0
- package/dist/conformance/NotebookAgent.js +31 -0
- package/dist/conformance/NotebookAgent.js.map +1 -0
- package/dist/conformance/NotificationChannel.d.ts +40 -0
- package/dist/conformance/NotificationChannel.d.ts.map +1 -0
- package/dist/conformance/NotificationChannel.js +78 -0
- package/dist/conformance/NotificationChannel.js.map +1 -0
- package/dist/conformance/Notifications.d.ts +3 -0
- package/dist/conformance/Notifications.d.ts.map +1 -0
- package/dist/conformance/Notifications.js +240 -0
- package/dist/conformance/Notifications.js.map +1 -0
- package/dist/conformance/OAuthClient.d.ts +123 -0
- package/dist/conformance/OAuthClient.d.ts.map +1 -0
- package/dist/conformance/OAuthClient.js +204 -0
- package/dist/conformance/OAuthClient.js.map +1 -0
- package/dist/conformance/Outbox.d.ts +3 -0
- package/dist/conformance/Outbox.d.ts.map +1 -0
- package/dist/conformance/Outbox.js +266 -0
- package/dist/conformance/Outbox.js.map +1 -0
- package/dist/conformance/PlatformReference.d.ts +5 -0
- package/dist/conformance/PlatformReference.d.ts.map +1 -0
- package/dist/conformance/PlatformReference.js +66 -0
- package/dist/conformance/PlatformReference.js.map +1 -0
- package/dist/conformance/PlatformSubject.d.ts +45 -0
- package/dist/conformance/PlatformSubject.d.ts.map +1 -0
- package/dist/conformance/PlatformSubject.js +3 -0
- package/dist/conformance/PlatformSubject.js.map +1 -0
- package/dist/conformance/Privacy.d.ts +3 -0
- package/dist/conformance/Privacy.d.ts.map +1 -0
- package/dist/conformance/Privacy.js +437 -0
- package/dist/conformance/Privacy.js.map +1 -0
- package/dist/conformance/Progress.d.ts +3 -0
- package/dist/conformance/Progress.d.ts.map +1 -0
- package/dist/conformance/Progress.js +153 -0
- package/dist/conformance/Progress.js.map +1 -0
- package/dist/conformance/Push.d.ts +38 -0
- package/dist/conformance/Push.d.ts.map +1 -0
- package/dist/conformance/Push.js +649 -0
- package/dist/conformance/Push.js.map +1 -0
- package/dist/conformance/PushReference.d.ts +3 -0
- package/dist/conformance/PushReference.d.ts.map +1 -0
- package/dist/conformance/PushReference.js +97 -0
- package/dist/conformance/PushReference.js.map +1 -0
- package/dist/conformance/QuerySurface.d.ts +9 -0
- package/dist/conformance/QuerySurface.d.ts.map +1 -0
- package/dist/conformance/QuerySurface.js +349 -0
- package/dist/conformance/QuerySurface.js.map +1 -0
- package/dist/conformance/Readiness.d.ts +23 -0
- package/dist/conformance/Readiness.d.ts.map +1 -0
- package/dist/conformance/Readiness.js +110 -0
- package/dist/conformance/Readiness.js.map +1 -0
- package/dist/conformance/Reference.d.ts +17 -0
- package/dist/conformance/Reference.d.ts.map +1 -0
- package/dist/conformance/Reference.js +246 -0
- package/dist/conformance/Reference.js.map +1 -0
- package/dist/conformance/Release.d.ts +73 -0
- package/dist/conformance/Release.d.ts.map +1 -0
- package/dist/conformance/Release.js +556 -0
- package/dist/conformance/Release.js.map +1 -0
- package/dist/conformance/ReleaseReference.d.ts +5 -0
- package/dist/conformance/ReleaseReference.d.ts.map +1 -0
- package/dist/conformance/ReleaseReference.js +124 -0
- package/dist/conformance/ReleaseReference.js.map +1 -0
- package/dist/conformance/ResultRendering.d.ts +3 -0
- package/dist/conformance/ResultRendering.d.ts.map +1 -0
- package/dist/conformance/ResultRendering.js +120 -0
- package/dist/conformance/ResultRendering.js.map +1 -0
- package/dist/conformance/Sandbox.d.ts +58 -0
- package/dist/conformance/Sandbox.d.ts.map +1 -0
- package/dist/conformance/Sandbox.js +213 -0
- package/dist/conformance/Sandbox.js.map +1 -0
- package/dist/conformance/SandboxReference.d.ts +3 -0
- package/dist/conformance/SandboxReference.d.ts.map +1 -0
- package/dist/conformance/SandboxReference.js +44 -0
- package/dist/conformance/SandboxReference.js.map +1 -0
- package/dist/conformance/Scheduler.d.ts +106 -0
- package/dist/conformance/Scheduler.d.ts.map +1 -0
- package/dist/conformance/Scheduler.js +576 -0
- package/dist/conformance/Scheduler.js.map +1 -0
- package/dist/conformance/ScreenContext.d.ts +84 -0
- package/dist/conformance/ScreenContext.d.ts.map +1 -0
- package/dist/conformance/ScreenContext.js +290 -0
- package/dist/conformance/ScreenContext.js.map +1 -0
- package/dist/conformance/Search.d.ts +3 -0
- package/dist/conformance/Search.d.ts.map +1 -0
- package/dist/conformance/Search.js +333 -0
- package/dist/conformance/Search.js.map +1 -0
- package/dist/conformance/Secrets.d.ts +8 -0
- package/dist/conformance/Secrets.d.ts.map +1 -0
- package/dist/conformance/Secrets.js +231 -0
- package/dist/conformance/Secrets.js.map +1 -0
- package/dist/conformance/SecretsReference.d.ts +44 -0
- package/dist/conformance/SecretsReference.d.ts.map +1 -0
- package/dist/conformance/SecretsReference.js +73 -0
- package/dist/conformance/SecretsReference.js.map +1 -0
- package/dist/conformance/ServicesReference.d.ts +8 -0
- package/dist/conformance/ServicesReference.d.ts.map +1 -0
- package/dist/conformance/ServicesReference.js +273 -0
- package/dist/conformance/ServicesReference.js.map +1 -0
- package/dist/conformance/ServicesSubject.d.ts +104 -0
- package/dist/conformance/ServicesSubject.d.ts.map +1 -0
- package/dist/conformance/ServicesSubject.js +2 -0
- package/dist/conformance/ServicesSubject.js.map +1 -0
- package/dist/conformance/Settings.d.ts +3 -0
- package/dist/conformance/Settings.d.ts.map +1 -0
- package/dist/conformance/Settings.js +177 -0
- package/dist/conformance/Settings.js.map +1 -0
- package/dist/conformance/Sharing.d.ts +3 -0
- package/dist/conformance/Sharing.d.ts.map +1 -0
- package/dist/conformance/Sharing.js +368 -0
- package/dist/conformance/Sharing.js.map +1 -0
- package/dist/conformance/ShellSubject.d.ts +29 -0
- package/dist/conformance/ShellSubject.d.ts.map +1 -0
- package/dist/conformance/ShellSubject.js +13 -0
- package/dist/conformance/ShellSubject.js.map +1 -0
- package/dist/conformance/SignOutRace.d.ts +23 -0
- package/dist/conformance/SignOutRace.d.ts.map +1 -0
- package/dist/conformance/SignOutRace.js +49 -0
- package/dist/conformance/SignOutRace.js.map +1 -0
- package/dist/conformance/Slot.d.ts +3 -0
- package/dist/conformance/Slot.d.ts.map +1 -0
- package/dist/conformance/Slot.js +79 -0
- package/dist/conformance/Slot.js.map +1 -0
- package/dist/conformance/Space.d.ts +63 -0
- package/dist/conformance/Space.d.ts.map +1 -0
- package/dist/conformance/Space.js +294 -0
- package/dist/conformance/Space.js.map +1 -0
- package/dist/conformance/StorageAdapter.d.ts +76 -0
- package/dist/conformance/StorageAdapter.d.ts.map +1 -0
- package/dist/conformance/StorageAdapter.js +181 -0
- package/dist/conformance/StorageAdapter.js.map +1 -0
- package/dist/conformance/StorageBackend.d.ts +23 -0
- package/dist/conformance/StorageBackend.d.ts.map +1 -0
- package/dist/conformance/StorageBackend.js +274 -0
- package/dist/conformance/StorageBackend.js.map +1 -0
- package/dist/conformance/Subject.d.ts +198 -0
- package/dist/conformance/Subject.d.ts.map +1 -0
- package/dist/conformance/Subject.js +26 -0
- package/dist/conformance/Subject.js.map +1 -0
- package/dist/conformance/Sync.d.ts +3 -0
- package/dist/conformance/Sync.d.ts.map +1 -0
- package/dist/conformance/Sync.js +190 -0
- package/dist/conformance/Sync.js.map +1 -0
- package/dist/conformance/Telemetry.d.ts +3 -0
- package/dist/conformance/Telemetry.d.ts.map +1 -0
- package/dist/conformance/Telemetry.js +218 -0
- package/dist/conformance/Telemetry.js.map +1 -0
- package/dist/conformance/ThemeTokens.d.ts +22 -0
- package/dist/conformance/ThemeTokens.d.ts.map +1 -0
- package/dist/conformance/ThemeTokens.js +121 -0
- package/dist/conformance/ThemeTokens.js.map +1 -0
- package/dist/conformance/ToolSource.d.ts +5 -0
- package/dist/conformance/ToolSource.d.ts.map +1 -0
- package/dist/conformance/ToolSource.js +520 -0
- package/dist/conformance/ToolSource.js.map +1 -0
- package/dist/conformance/Versioning.d.ts +3 -0
- package/dist/conformance/Versioning.d.ts.map +1 -0
- package/dist/conformance/Versioning.js +160 -0
- package/dist/conformance/Versioning.js.map +1 -0
- package/dist/conformance/View.d.ts +3 -0
- package/dist/conformance/View.d.ts.map +1 -0
- package/dist/conformance/View.js +121 -0
- package/dist/conformance/View.js.map +1 -0
- package/dist/conformance/WorkItems.d.ts +3 -0
- package/dist/conformance/WorkItems.d.ts.map +1 -0
- package/dist/conformance/WorkItems.js +152 -0
- package/dist/conformance/WorkItems.js.map +1 -0
- package/dist/conformance/Workflow.d.ts +63 -0
- package/dist/conformance/Workflow.d.ts.map +1 -0
- package/dist/conformance/Workflow.js +235 -0
- package/dist/conformance/Workflow.js.map +1 -0
- package/dist/conformance/acme/chatlog.d.ts +591 -0
- package/dist/conformance/acme/chatlog.d.ts.map +1 -0
- package/dist/conformance/acme/chatlog.js +101 -0
- package/dist/conformance/acme/chatlog.js.map +1 -0
- package/dist/conformance/acme/connector.d.ts +12 -0
- package/dist/conformance/acme/connector.d.ts.map +1 -0
- package/dist/conformance/acme/connector.js +123 -0
- package/dist/conformance/acme/connector.js.map +1 -0
- package/dist/conformance/acme/migrations/0000_messages.sql +8 -0
- package/dist/conformance/archive/app.d.ts +728 -0
- package/dist/conformance/archive/app.d.ts.map +1 -0
- package/dist/conformance/archive/app.js +30 -0
- package/dist/conformance/archive/app.js.map +1 -0
- package/dist/conformance/archive/contract.d.ts +467 -0
- package/dist/conformance/archive/contract.d.ts.map +1 -0
- package/dist/conformance/archive/contract.js +187 -0
- package/dist/conformance/archive/contract.js.map +1 -0
- package/dist/conformance/archive/memo.sync.gen.d.ts +148 -0
- package/dist/conformance/archive/memo.sync.gen.d.ts.map +1 -0
- package/dist/conformance/archive/memo.sync.gen.js +23 -0
- package/dist/conformance/archive/memo.sync.gen.js.map +1 -0
- package/dist/conformance/archive/migrations/archive/0000_archive.sql +9 -0
- package/dist/conformance/archive/migrations/memo/0000_memo.sql +6 -0
- package/dist/conformance/archive/schema.d.ts +185 -0
- package/dist/conformance/archive/schema.d.ts.map +1 -0
- package/dist/conformance/archive/schema.js +22 -0
- package/dist/conformance/archive/schema.js.map +1 -0
- package/dist/conformance/archive/server.d.ts +273 -0
- package/dist/conformance/archive/server.d.ts.map +1 -0
- package/dist/conformance/archive/server.js +127 -0
- package/dist/conformance/archive/server.js.map +1 -0
- package/dist/conformance/archive/sync.gen.d.ts +319 -0
- package/dist/conformance/archive/sync.gen.d.ts.map +1 -0
- package/dist/conformance/archive/sync.gen.js +29 -0
- package/dist/conformance/archive/sync.gen.js.map +1 -0
- package/dist/conformance/atlas/app.d.ts +3 -0
- package/dist/conformance/atlas/app.d.ts.map +1 -0
- package/dist/conformance/atlas/app.js +15 -0
- package/dist/conformance/atlas/app.js.map +1 -0
- package/dist/conformance/atlas/contract.d.ts +489 -0
- package/dist/conformance/atlas/contract.d.ts.map +1 -0
- package/dist/conformance/atlas/contract.js +114 -0
- package/dist/conformance/atlas/contract.js.map +1 -0
- package/dist/conformance/crm/app.d.ts +304 -0
- package/dist/conformance/crm/app.d.ts.map +1 -0
- package/dist/conformance/crm/app.js +95 -0
- package/dist/conformance/crm/app.js.map +1 -0
- package/dist/conformance/crm/contract.d.ts +586 -0
- package/dist/conformance/crm/contract.d.ts.map +1 -0
- package/dist/conformance/crm/contract.js +153 -0
- package/dist/conformance/crm/contract.js.map +1 -0
- package/dist/conformance/crm/migrations/crm/0000_crm.sql +18 -0
- package/dist/conformance/crm/migrations/team/0000_team.sql +6 -0
- package/dist/conformance/crm/schema.d.ts +261 -0
- package/dist/conformance/crm/schema.d.ts.map +1 -0
- package/dist/conformance/crm/schema.js +25 -0
- package/dist/conformance/crm/schema.js.map +1 -0
- package/dist/conformance/crm/sync.gen.d.ts +188 -0
- package/dist/conformance/crm/sync.gen.d.ts.map +1 -0
- package/dist/conformance/crm/sync.gen.js +25 -0
- package/dist/conformance/crm/sync.gen.js.map +1 -0
- package/dist/conformance/desk/contract.d.ts +306 -0
- package/dist/conformance/desk/contract.d.ts.map +1 -0
- package/dist/conformance/desk/contract.js +56 -0
- package/dist/conformance/desk/contract.js.map +1 -0
- package/dist/conformance/desk/migrations/0000_notes.sql +7 -0
- package/dist/conformance/desk/server.d.ts +231 -0
- package/dist/conformance/desk/server.d.ts.map +1 -0
- package/dist/conformance/desk/server.js +123 -0
- package/dist/conformance/desk/server.js.map +1 -0
- package/dist/conformance/drafts/migrations/0000_drafts.sql +8 -0
- package/dist/conformance/drafts/module.d.ts +571 -0
- package/dist/conformance/drafts/module.d.ts.map +1 -0
- package/dist/conformance/drafts/module.js +190 -0
- package/dist/conformance/drafts/module.js.map +1 -0
- package/dist/conformance/fixture/app.d.ts +24 -0
- package/dist/conformance/fixture/app.d.ts.map +1 -0
- package/dist/conformance/fixture/app.js +26 -0
- package/dist/conformance/fixture/app.js.map +1 -0
- package/dist/conformance/fixture/docs/bad-sync.d.ts +105 -0
- package/dist/conformance/fixture/docs/bad-sync.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/bad-sync.js +22 -0
- package/dist/conformance/fixture/docs/bad-sync.js.map +1 -0
- package/dist/conformance/fixture/docs/contract.d.ts +1091 -0
- package/dist/conformance/fixture/docs/contract.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/contract.js +277 -0
- package/dist/conformance/fixture/docs/contract.js.map +1 -0
- package/dist/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
- package/dist/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
- package/dist/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
- package/dist/conformance/fixture/docs/policy.cedar +110 -0
- package/dist/conformance/fixture/docs/schema.d.ts +308 -0
- package/dist/conformance/fixture/docs/schema.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/schema.js +36 -0
- package/dist/conformance/fixture/docs/schema.js.map +1 -0
- package/dist/conformance/fixture/docs/server.d.ts +552 -0
- package/dist/conformance/fixture/docs/server.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/server.js +192 -0
- package/dist/conformance/fixture/docs/server.js.map +1 -0
- package/dist/conformance/fixture/docs/sync.d.ts +402 -0
- package/dist/conformance/fixture/docs/sync.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/sync.gen.d.ts +574 -0
- package/dist/conformance/fixture/docs/sync.gen.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/sync.gen.js +48 -0
- package/dist/conformance/fixture/docs/sync.gen.js.map +1 -0
- package/dist/conformance/fixture/docs/sync.js +23 -0
- package/dist/conformance/fixture/docs/sync.js.map +1 -0
- package/dist/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
- package/dist/conformance/fixture/peer/module.d.ts +306 -0
- package/dist/conformance/fixture/peer/module.d.ts.map +1 -0
- package/dist/conformance/fixture/peer/module.js +44 -0
- package/dist/conformance/fixture/peer/module.js.map +1 -0
- package/dist/conformance/fixture/release/blocking/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/blocking/0001_wait.sql +2 -0
- package/dist/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
- package/dist/conformance/fixture/release/broken/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/broken/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/broken/0002_label.sql +3 -0
- package/dist/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
- package/dist/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/escape/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/escape/0001_escape.sql +5 -0
- package/dist/conformance/fixture/release/misnamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
- package/dist/conformance/fixture/release/module.d.ts +1878 -0
- package/dist/conformance/fixture/release/module.d.ts.map +1 -0
- package/dist/conformance/fixture/release/module.js +102 -0
- package/dist/conformance/fixture/release/module.js.map +1 -0
- package/dist/conformance/fixture/release/outside/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/outside/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/outside/0002_index.sql +4 -0
- package/dist/conformance/fixture/release/outside/0003_later.sql +1 -0
- package/dist/conformance/fixture/release/renamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/renamed/0001_misname.sql +10 -0
- package/dist/conformance/fixture/release/renamed/0002_restore.sql +1 -0
- package/dist/conformance/fixture/release/rogue/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/rogue/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/rogue/0002_definer.sql +1 -0
- package/dist/conformance/fixture/release/slow/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/undeclared/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/undeclared/0002_index.sql +1 -0
- package/dist/conformance/fixture/release/v1/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/v2/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/v2/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/v2/0002_label.sql +3 -0
- package/dist/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
- package/dist/conformance/kit-hash.d.ts +8 -0
- package/dist/conformance/kit-hash.d.ts.map +1 -0
- package/dist/conformance/kit-hash.js +20 -0
- package/dist/conformance/kit-hash.js.map +1 -0
- package/dist/conformance/ledger/contract.d.ts +380 -0
- package/dist/conformance/ledger/contract.d.ts.map +1 -0
- package/dist/conformance/ledger/contract.js +81 -0
- package/dist/conformance/ledger/contract.js.map +1 -0
- package/dist/conformance/ledger/migrations/0000_entries.sql +8 -0
- package/dist/conformance/ledger/server.d.ts +312 -0
- package/dist/conformance/ledger/server.d.ts.map +1 -0
- package/dist/conformance/ledger/server.js +152 -0
- package/dist/conformance/ledger/server.js.map +1 -0
- package/dist/conformance/library/app.d.ts +616 -0
- package/dist/conformance/library/app.d.ts.map +1 -0
- package/dist/conformance/library/app.js +35 -0
- package/dist/conformance/library/app.js.map +1 -0
- package/dist/conformance/library/contract.d.ts +377 -0
- package/dist/conformance/library/contract.d.ts.map +1 -0
- package/dist/conformance/library/contract.js +63 -0
- package/dist/conformance/library/contract.js.map +1 -0
- package/dist/conformance/library/migrations/0000_library.sql +14 -0
- package/dist/conformance/library/schema.d.ts +174 -0
- package/dist/conformance/library/schema.d.ts.map +1 -0
- package/dist/conformance/library/schema.js +24 -0
- package/dist/conformance/library/schema.js.map +1 -0
- package/dist/conformance/library/server.d.ts +191 -0
- package/dist/conformance/library/server.d.ts.map +1 -0
- package/dist/conformance/library/server.js +52 -0
- package/dist/conformance/library/server.js.map +1 -0
- package/dist/conformance/library/sync.gen.d.ts +519 -0
- package/dist/conformance/library/sync.gen.d.ts.map +1 -0
- package/dist/conformance/library/sync.gen.js +42 -0
- package/dist/conformance/library/sync.gen.js.map +1 -0
- package/dist/conformance/locale/catalog.d.ts +93 -0
- package/dist/conformance/locale/catalog.d.ts.map +1 -0
- package/dist/conformance/locale/catalog.js +104 -0
- package/dist/conformance/locale/catalog.js.map +1 -0
- package/dist/conformance/notebook/app.d.ts +1039 -0
- package/dist/conformance/notebook/app.d.ts.map +1 -0
- package/dist/conformance/notebook/app.js +88 -0
- package/dist/conformance/notebook/app.js.map +1 -0
- package/dist/conformance/notebook/evals/pages.evals.json +94 -0
- package/dist/conformance/notebook/migrations/0000_notebook.sql +10 -0
- package/dist/conformance/notebook/module.d.ts +717 -0
- package/dist/conformance/notebook/module.d.ts.map +1 -0
- package/dist/conformance/notebook/module.js +188 -0
- package/dist/conformance/notebook/module.js.map +1 -0
- package/dist/conformance/pad/app.d.ts +9 -0
- package/dist/conformance/pad/app.d.ts.map +1 -0
- package/dist/conformance/pad/app.js +13 -0
- package/dist/conformance/pad/app.js.map +1 -0
- package/dist/conformance/pad/contract.d.ts +281 -0
- package/dist/conformance/pad/contract.d.ts.map +1 -0
- package/dist/conformance/pad/contract.js +66 -0
- package/dist/conformance/pad/contract.js.map +1 -0
- package/dist/conformance/pad/migrations/pad/0000_pad.sql +8 -0
- package/dist/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
- package/dist/conformance/pad/schema.d.ts +127 -0
- package/dist/conformance/pad/schema.d.ts.map +1 -0
- package/dist/conformance/pad/schema.js +17 -0
- package/dist/conformance/pad/schema.js.map +1 -0
- package/dist/conformance/pad/server.d.ts +149 -0
- package/dist/conformance/pad/server.d.ts.map +1 -0
- package/dist/conformance/pad/server.js +81 -0
- package/dist/conformance/pad/server.js.map +1 -0
- package/dist/conformance/purchases/app.d.ts +480 -0
- package/dist/conformance/purchases/app.d.ts.map +1 -0
- package/dist/conformance/purchases/app.js +32 -0
- package/dist/conformance/purchases/app.js.map +1 -0
- package/dist/conformance/purchases/contract.d.ts +720 -0
- package/dist/conformance/purchases/contract.d.ts.map +1 -0
- package/dist/conformance/purchases/contract.js +148 -0
- package/dist/conformance/purchases/contract.js.map +1 -0
- package/dist/conformance/purchases/migrations/0000_purchases.sql +17 -0
- package/dist/conformance/purchases/server.d.ts +250 -0
- package/dist/conformance/purchases/server.d.ts.map +1 -0
- package/dist/conformance/purchases/server.js +85 -0
- package/dist/conformance/purchases/server.js.map +1 -0
- package/dist/conformance/studio/app.d.ts +996 -0
- package/dist/conformance/studio/app.d.ts.map +1 -0
- package/dist/conformance/studio/app.js +251 -0
- package/dist/conformance/studio/app.js.map +1 -0
- package/dist/conformance/studio/contract.d.ts +1318 -0
- package/dist/conformance/studio/contract.d.ts.map +1 -0
- package/dist/conformance/studio/contract.js +280 -0
- package/dist/conformance/studio/contract.js.map +1 -0
- package/dist/conformance/studio/migrations/billing/0000_billing.sql +6 -0
- package/dist/conformance/studio/migrations/journal/0000_journal.sql +9 -0
- package/dist/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
- package/dist/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
- package/dist/conformance/workshop/app.d.ts +8 -0
- package/dist/conformance/workshop/app.d.ts.map +1 -0
- package/dist/conformance/workshop/app.js +13 -0
- package/dist/conformance/workshop/app.js.map +1 -0
- package/dist/conformance/workshop/migrations/0000_notes.sql +7 -0
- package/dist/conformance/workshop/module.d.ts +407 -0
- package/dist/conformance/workshop/module.d.ts.map +1 -0
- package/dist/conformance/workshop/module.js +71 -0
- package/dist/conformance/workshop/module.js.map +1 -0
- package/dist/fakes/AcmeFake.d.ts +46 -0
- package/dist/fakes/AcmeFake.d.ts.map +1 -0
- package/dist/fakes/AcmeFake.js +131 -0
- package/dist/fakes/AcmeFake.js.map +1 -0
- package/dist/fakes/ApnsFake.d.ts +79 -0
- package/dist/fakes/ApnsFake.d.ts.map +1 -0
- package/dist/fakes/ApnsFake.js +220 -0
- package/dist/fakes/ApnsFake.js.map +1 -0
- package/dist/fakes/FcmFake.d.ts +46 -0
- package/dist/fakes/FcmFake.d.ts.map +1 -0
- package/dist/fakes/FcmFake.js +185 -0
- package/dist/fakes/FcmFake.js.map +1 -0
- package/dist/fakes/GoogleFake.d.ts +221 -0
- package/dist/fakes/GoogleFake.d.ts.map +1 -0
- package/dist/fakes/GoogleFake.js +1035 -0
- package/dist/fakes/GoogleFake.js.map +1 -0
- package/dist/fakes/HttpApiFake.d.ts +22 -0
- package/dist/fakes/HttpApiFake.d.ts.map +1 -0
- package/dist/fakes/HttpApiFake.js +74 -0
- package/dist/fakes/HttpApiFake.js.map +1 -0
- package/dist/fakes/McpFake.d.ts +80 -0
- package/dist/fakes/McpFake.d.ts.map +1 -0
- package/dist/fakes/McpFake.js +312 -0
- package/dist/fakes/McpFake.js.map +1 -0
- package/dist/fakes/MicrosoftGraphFake.d.ts +254 -0
- package/dist/fakes/MicrosoftGraphFake.d.ts.map +1 -0
- package/dist/fakes/MicrosoftGraphFake.js +850 -0
- package/dist/fakes/MicrosoftGraphFake.js.map +1 -0
- package/dist/fakes/S3Fake.d.ts +29 -0
- package/dist/fakes/S3Fake.d.ts.map +1 -0
- package/dist/fakes/S3Fake.js +347 -0
- package/dist/fakes/S3Fake.js.map +1 -0
- package/dist/fakes/Server.d.ts +137 -0
- package/dist/fakes/Server.d.ts.map +1 -0
- package/dist/fakes/Server.js +357 -0
- package/dist/fakes/Server.js.map +1 -0
- package/dist/fakes/SignInProviderFake.d.ts +21 -0
- package/dist/fakes/SignInProviderFake.d.ts.map +1 -0
- package/dist/fakes/SignInProviderFake.js +56 -0
- package/dist/fakes/SignInProviderFake.js.map +1 -0
- package/dist/fakes/SlackFake.d.ts +136 -0
- package/dist/fakes/SlackFake.d.ts.map +1 -0
- package/dist/fakes/SlackFake.js +787 -0
- package/dist/fakes/SlackFake.js.map +1 -0
- package/dist/fakes/Store.d.ts +40 -0
- package/dist/fakes/Store.d.ts.map +1 -0
- package/dist/fakes/Store.js +82 -0
- package/dist/fakes/Store.js.map +1 -0
- package/dist/fakes/TelemetryFakes.d.ts +77 -0
- package/dist/fakes/TelemetryFakes.d.ts.map +1 -0
- package/dist/fakes/TelemetryFakes.js +121 -0
- package/dist/fakes/TelemetryFakes.js.map +1 -0
- package/dist/fakes/TestCa.d.ts +11 -0
- package/dist/fakes/TestCa.d.ts.map +1 -0
- package/dist/fakes/TestCa.js +115 -0
- package/dist/fakes/TestCa.js.map +1 -0
- package/dist/fakes/WorkOsFake.d.ts +40 -0
- package/dist/fakes/WorkOsFake.d.ts.map +1 -0
- package/dist/fakes/WorkOsFake.js +103 -0
- package/dist/fakes/WorkOsFake.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/make/reference.d.ts +520 -0
- package/dist/make/reference.d.ts.map +1 -0
- package/dist/make/reference.js +182 -0
- package/dist/make/reference.js.map +1 -0
- package/dist/make/sources.d.ts +48 -0
- package/dist/make/sources.d.ts.map +1 -0
- package/dist/make/sources.js +806 -0
- package/dist/make/sources.js.map +1 -0
- package/package.json +77 -3
- package/src/Admin.ts +82 -0
- package/src/Agent.ts +289 -0
- package/src/AgentSurface.ts +51 -0
- package/src/Embedder.ts +69 -0
- package/src/EvalMain.ts +81 -0
- package/src/Evals.ts +490 -0
- package/src/Kernel.ts +228 -0
- package/src/Launch.ts +428 -0
- package/src/Locks.ts +123 -0
- package/src/Routes.ts +65 -0
- package/src/ScriptedChatModel.ts +189 -0
- package/src/SmtpSink.ts +205 -0
- package/src/System.ts +1072 -0
- package/src/TcpProxy.ts +102 -0
- package/src/auth/TrustedProxyAuth.ts +173 -0
- package/src/conformance/ActionConsent.ts +437 -0
- package/src/conformance/ActionRegistry.ts +174 -0
- package/src/conformance/Actor.ts +216 -0
- package/src/conformance/AgentReference.ts +171 -0
- package/src/conformance/AgentResources.ts +548 -0
- package/src/conformance/AgentRuntime.ts +388 -0
- package/src/conformance/AgentSubject.ts +103 -0
- package/src/conformance/Approvals.ts +363 -0
- package/src/conformance/Audit.ts +257 -0
- package/src/conformance/CalendarProvider.ts +156 -0
- package/src/conformance/CapabilityKit.ts +564 -0
- package/src/conformance/ClientSDK.ts +233 -0
- package/src/conformance/CollabDocument.ts +1203 -0
- package/src/conformance/CollabReference.ts +152 -0
- package/src/conformance/CollabSubject.ts +64 -0
- package/src/conformance/Command.ts +75 -0
- package/src/conformance/Connections.ts +357 -0
- package/src/conformance/ConnectionsReference.ts +172 -0
- package/src/conformance/ConnectorReference.ts +280 -0
- package/src/conformance/ContextAccounting.ts +169 -0
- package/src/conformance/Daemon.ts +936 -0
- package/src/conformance/DaemonReference.ts +189 -0
- package/src/conformance/DbTx.ts +253 -0
- package/src/conformance/DecisionTokens.ts +652 -0
- package/src/conformance/Delegation.ts +177 -0
- package/src/conformance/DeskReference.ts +73 -0
- package/src/conformance/DeviceControl.ts +700 -0
- package/src/conformance/Directory.ts +315 -0
- package/src/conformance/DirectoryProvider.ts +72 -0
- package/src/conformance/DocumentSource.ts +62 -0
- package/src/conformance/EndpointReference.ts +117 -0
- package/src/conformance/Files.ts +685 -0
- package/src/conformance/FilesReference.ts +154 -0
- package/src/conformance/FilesSubject.ts +50 -0
- package/src/conformance/Flags.ts +215 -0
- package/src/conformance/Host.ts +197 -0
- package/src/conformance/HttpApi.ts +169 -0
- package/src/conformance/InboxReference.ts +401 -0
- package/src/conformance/InboxSubject.ts +101 -0
- package/src/conformance/Ingestion.ts +425 -0
- package/src/conformance/Ingress.ts +498 -0
- package/src/conformance/Invocation.ts +780 -0
- package/src/conformance/IsolationMatrix.ts +215 -0
- package/src/conformance/LiveConnection.ts +197 -0
- package/src/conformance/LocalClient.ts +651 -0
- package/src/conformance/Locale.ts +141 -0
- package/src/conformance/MachineIdentity.ts +828 -0
- package/src/conformance/MailProvider.ts +217 -0
- package/src/conformance/Memory.ts +223 -0
- package/src/conformance/Messaging.ts +185 -0
- package/src/conformance/Metering.ts +293 -0
- package/src/conformance/ModelProvider.ts +139 -0
- package/src/conformance/ModuleManifest.ts +630 -0
- package/src/conformance/NotebookAgent.ts +41 -0
- package/src/conformance/NotificationChannel.ts +122 -0
- package/src/conformance/Notifications.ts +316 -0
- package/src/conformance/OAuthClient.ts +240 -0
- package/src/conformance/Outbox.ts +342 -0
- package/src/conformance/PlatformReference.ts +73 -0
- package/src/conformance/PlatformSubject.ts +50 -0
- package/src/conformance/Privacy.ts +577 -0
- package/src/conformance/Progress.ts +244 -0
- package/src/conformance/Push.ts +820 -0
- package/src/conformance/PushReference.ts +101 -0
- package/src/conformance/QuerySurface.ts +408 -0
- package/src/conformance/Readiness.ts +157 -0
- package/src/conformance/Reference.ts +326 -0
- package/src/conformance/Release.ts +690 -0
- package/src/conformance/ReleaseReference.ts +179 -0
- package/src/conformance/ResultRendering.ts +149 -0
- package/src/conformance/Sandbox.ts +313 -0
- package/src/conformance/SandboxReference.ts +52 -0
- package/src/conformance/Scheduler.ts +764 -0
- package/src/conformance/ScreenContext.ts +402 -0
- package/src/conformance/Search.ts +419 -0
- package/src/conformance/Secrets.ts +277 -0
- package/src/conformance/SecretsReference.ts +131 -0
- package/src/conformance/ServicesReference.ts +330 -0
- package/src/conformance/ServicesSubject.ts +105 -0
- package/src/conformance/Settings.ts +204 -0
- package/src/conformance/Sharing.ts +486 -0
- package/src/conformance/ShellSubject.ts +47 -0
- package/src/conformance/SignOutRace.ts +77 -0
- package/src/conformance/Slot.ts +84 -0
- package/src/conformance/Space.ts +432 -0
- package/src/conformance/StorageAdapter.ts +253 -0
- package/src/conformance/StorageBackend.ts +327 -0
- package/src/conformance/Subject.ts +208 -0
- package/src/conformance/Sync.ts +215 -0
- package/src/conformance/Telemetry.ts +287 -0
- package/src/conformance/ThemeTokens.ts +163 -0
- package/src/conformance/ToolSource.ts +632 -0
- package/src/conformance/Versioning.ts +199 -0
- package/src/conformance/View.ts +143 -0
- package/src/conformance/WorkItems.ts +186 -0
- package/src/conformance/Workflow.ts +304 -0
- package/src/conformance/acme/chatlog.ts +115 -0
- package/src/conformance/acme/connector.ts +151 -0
- package/src/conformance/acme/migrations/0000_messages.sql +8 -0
- package/src/conformance/archive/app.ts +33 -0
- package/src/conformance/archive/contract.ts +191 -0
- package/src/conformance/archive/memo.sync.gen.ts +25 -0
- package/src/conformance/archive/migrations/archive/0000_archive.sql +9 -0
- package/src/conformance/archive/migrations/memo/0000_memo.sql +6 -0
- package/src/conformance/archive/schema.ts +25 -0
- package/src/conformance/archive/server.ts +146 -0
- package/src/conformance/archive/sync.gen.ts +32 -0
- package/src/conformance/atlas/app.ts +16 -0
- package/src/conformance/atlas/contract.ts +118 -0
- package/src/conformance/crm/app.ts +107 -0
- package/src/conformance/crm/contract.ts +163 -0
- package/src/conformance/crm/migrations/crm/0000_crm.sql +18 -0
- package/src/conformance/crm/migrations/team/0000_team.sql +6 -0
- package/src/conformance/crm/schema.ts +28 -0
- package/src/conformance/crm/sync.gen.ts +27 -0
- package/src/conformance/desk/contract.ts +61 -0
- package/src/conformance/desk/migrations/0000_notes.sql +7 -0
- package/src/conformance/desk/server.ts +131 -0
- package/src/conformance/drafts/migrations/0000_drafts.sql +8 -0
- package/src/conformance/drafts/module.ts +211 -0
- package/src/conformance/fixture/app.ts +37 -0
- package/src/conformance/fixture/docs/bad-sync.ts +34 -0
- package/src/conformance/fixture/docs/contract.ts +297 -0
- package/src/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
- package/src/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
- package/src/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
- package/src/conformance/fixture/docs/policy.cedar +110 -0
- package/src/conformance/fixture/docs/schema.ts +41 -0
- package/src/conformance/fixture/docs/server.ts +292 -0
- package/src/conformance/fixture/docs/sync.gen.ts +54 -0
- package/src/conformance/fixture/docs/sync.ts +24 -0
- package/src/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
- package/src/conformance/fixture/peer/module.ts +51 -0
- package/src/conformance/fixture/release/blocking/0000_item.sql +3 -0
- package/src/conformance/fixture/release/blocking/0001_wait.sql +2 -0
- package/src/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
- package/src/conformance/fixture/release/broken/0000_item.sql +3 -0
- package/src/conformance/fixture/release/broken/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/broken/0002_label.sql +3 -0
- package/src/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
- package/src/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
- package/src/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
- package/src/conformance/fixture/release/escape/0000_item.sql +3 -0
- package/src/conformance/fixture/release/escape/0001_escape.sql +5 -0
- package/src/conformance/fixture/release/misnamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
- package/src/conformance/fixture/release/module.ts +119 -0
- package/src/conformance/fixture/release/outside/0000_item.sql +3 -0
- package/src/conformance/fixture/release/outside/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/outside/0002_index.sql +4 -0
- package/src/conformance/fixture/release/outside/0003_later.sql +1 -0
- package/src/conformance/fixture/release/renamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/renamed/0001_misname.sql +10 -0
- package/src/conformance/fixture/release/renamed/0002_restore.sql +1 -0
- package/src/conformance/fixture/release/rogue/0000_item.sql +3 -0
- package/src/conformance/fixture/release/rogue/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/rogue/0002_definer.sql +1 -0
- package/src/conformance/fixture/release/slow/0000_item.sql +5 -0
- package/src/conformance/fixture/release/undeclared/0000_item.sql +3 -0
- package/src/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/undeclared/0002_index.sql +1 -0
- package/src/conformance/fixture/release/v1/0000_item.sql +3 -0
- package/src/conformance/fixture/release/v2/0000_item.sql +3 -0
- package/src/conformance/fixture/release/v2/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/v2/0002_label.sql +3 -0
- package/src/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
- package/src/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
- package/src/conformance/kit-hash.ts +18 -0
- package/src/conformance/ledger/contract.ts +92 -0
- package/src/conformance/ledger/migrations/0000_entries.sql +8 -0
- package/src/conformance/ledger/server.ts +174 -0
- package/src/conformance/library/app.ts +38 -0
- package/src/conformance/library/contract.ts +66 -0
- package/src/conformance/library/migrations/0000_library.sql +14 -0
- package/src/conformance/library/schema.ts +27 -0
- package/src/conformance/library/server.ts +65 -0
- package/src/conformance/library/sync.gen.ts +47 -0
- package/src/conformance/locale/catalog.ts +111 -0
- package/src/conformance/notebook/app.ts +115 -0
- package/src/conformance/notebook/evals/pages.evals.json +94 -0
- package/src/conformance/notebook/migrations/0000_notebook.sql +10 -0
- package/src/conformance/notebook/module.ts +215 -0
- package/src/conformance/notebook/skills/meeting-notes.md +4 -0
- package/src/conformance/pad/app.ts +21 -0
- package/src/conformance/pad/contract.ts +69 -0
- package/src/conformance/pad/migrations/pad/0000_pad.sql +8 -0
- package/src/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
- package/src/conformance/pad/schema.ts +18 -0
- package/src/conformance/pad/server.ts +102 -0
- package/src/conformance/purchases/app.ts +34 -0
- package/src/conformance/purchases/contract.ts +161 -0
- package/src/conformance/purchases/migrations/0000_purchases.sql +17 -0
- package/src/conformance/purchases/server.ts +95 -0
- package/src/conformance/replica-search.mjs +22 -0
- package/src/conformance/studio/app.ts +298 -0
- package/src/conformance/studio/contract.ts +319 -0
- package/src/conformance/studio/migrations/billing/0000_billing.sql +6 -0
- package/src/conformance/studio/migrations/journal/0000_journal.sql +9 -0
- package/src/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
- package/src/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
- package/src/conformance/workshop/app.ts +14 -0
- package/src/conformance/workshop/migrations/0000_notes.sql +7 -0
- package/src/conformance/workshop/module.ts +79 -0
- package/src/fakes/AcmeFake.ts +182 -0
- package/src/fakes/ApnsFake.ts +245 -0
- package/src/fakes/FcmFake.ts +231 -0
- package/src/fakes/GoogleFake.ts +1346 -0
- package/src/fakes/HttpApiFake.ts +116 -0
- package/src/fakes/McpFake.ts +355 -0
- package/src/fakes/MicrosoftGraphFake.ts +1191 -0
- package/src/fakes/S3Fake.ts +376 -0
- package/src/fakes/Server.ts +445 -0
- package/src/fakes/SignInProviderFake.ts +70 -0
- package/src/fakes/SlackFake.ts +893 -0
- package/src/fakes/Store.ts +96 -0
- package/src/fakes/TelemetryFakes.ts +197 -0
- package/src/fakes/TestCa.ts +166 -0
- package/src/fakes/WorkOsFake.ts +136 -0
- package/src/index.ts +9 -0
- package/src/make/reference.ts +259 -0
- package/src/make/sources.ts +836 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the Directory contract (decision 1).
|
|
3
|
+
*
|
|
4
|
+
* Registers Vitest tests against a subject the caller supplies: a way to make
|
|
5
|
+
* users and sign them in, the trusted `createOrganization`, the management
|
|
6
|
+
* operations called as a signed-in user, and the audit trail. Every test works
|
|
7
|
+
* in organisations of its own (random ids), so the kit can share a database.
|
|
8
|
+
*
|
|
9
|
+
* import { directoryConformance } from "@eloxiv/testing/conformance/Directory"
|
|
10
|
+
* directoryConformance(() => subject)
|
|
11
|
+
*/
|
|
12
|
+
import { DIRECTORY_MANAGE } from "@eloxiv/contracts"
|
|
13
|
+
import { describe, expect, it } from "vitest"
|
|
14
|
+
|
|
15
|
+
export interface TestUser {
|
|
16
|
+
readonly userId: string
|
|
17
|
+
/** The address the user's account has (`addMemberByEmail` finds it by this, in any case). */
|
|
18
|
+
readonly email: string
|
|
19
|
+
/** Request headers that authenticate as this user, acting in `orgId` (or their first organisation). */
|
|
20
|
+
readonly headers: (orgId?: string) => Headers
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type CallResult = { readonly ok: true; readonly value: unknown } | { readonly ok: false; readonly tag: string }
|
|
24
|
+
|
|
25
|
+
export interface DirectorySubject {
|
|
26
|
+
/** A new user who belongs to no organisation. */
|
|
27
|
+
readonly newUser: (label: string) => Promise<TestUser>
|
|
28
|
+
/** Trusted bootstrap: an organisation with the built-in roles and, optionally, its first administrator. */
|
|
29
|
+
readonly createOrganization: (input: {
|
|
30
|
+
readonly id: string
|
|
31
|
+
readonly name: string
|
|
32
|
+
readonly admin?: string
|
|
33
|
+
}) => Promise<void>
|
|
34
|
+
/** A management operation, called with these request headers. */
|
|
35
|
+
readonly call: (headers: Headers, operation: string, input: unknown) => Promise<CallResult>
|
|
36
|
+
/** Audit records of directory operations in an organisation, oldest first. */
|
|
37
|
+
readonly audit: (
|
|
38
|
+
orgId: string,
|
|
39
|
+
) => Promise<
|
|
40
|
+
ReadonlyArray<{ readonly action: string; readonly actorUserId: string | null; readonly outcome: string }>
|
|
41
|
+
>
|
|
42
|
+
/** A permission an installed module declares (roles may grant it). */
|
|
43
|
+
readonly modulePermission: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const fresh = (prefix: string) => `${prefix}-${crypto.randomUUID().slice(0, 8)}`
|
|
47
|
+
|
|
48
|
+
export const directoryConformance = (subject: DirectorySubject | (() => DirectorySubject)) => {
|
|
49
|
+
const get = () => (typeof subject === "function" ? subject() : subject)
|
|
50
|
+
|
|
51
|
+
/** An organisation with an administrator and a plain member. */
|
|
52
|
+
const organisation = async () => {
|
|
53
|
+
const s = get()
|
|
54
|
+
const orgId = fresh("org")
|
|
55
|
+
const admin = await s.newUser("admin")
|
|
56
|
+
const member = await s.newUser("member")
|
|
57
|
+
await s.createOrganization({ id: orgId, name: "Conformance", admin: admin.userId })
|
|
58
|
+
const added = await s.call(admin.headers(orgId), "addMember", { userId: member.userId })
|
|
59
|
+
expect(added).toEqual({ ok: true, value: {} })
|
|
60
|
+
const as =
|
|
61
|
+
(user: TestUser) =>
|
|
62
|
+
(operation: string, input: unknown = {}) =>
|
|
63
|
+
s.call(user.headers(orgId), operation, input)
|
|
64
|
+
return { s, orgId, admin, member, asAdmin: as(admin), asMember: as(member), as }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
describe("Directory conformance", () => {
|
|
68
|
+
it("starts an organisation with the built-in roles and its first administrator", async () => {
|
|
69
|
+
const { orgId, admin, member, asAdmin } = await organisation()
|
|
70
|
+
const roles = (await asAdmin("listRoles")) as {
|
|
71
|
+
ok: true
|
|
72
|
+
value: Array<{ id: string; permissions: Array<string> }>
|
|
73
|
+
}
|
|
74
|
+
expect(roles.ok).toBe(true)
|
|
75
|
+
expect(roles.value.map((r) => r.id)).toEqual(["admin", "member"])
|
|
76
|
+
expect(roles.value.find((r) => r.id === "admin")!.permissions).toContain(DIRECTORY_MANAGE)
|
|
77
|
+
expect(roles.value.find((r) => r.id === "member")!.permissions).toEqual([])
|
|
78
|
+
const members = (await asAdmin("listMembers")) as {
|
|
79
|
+
ok: true
|
|
80
|
+
value: Array<{ userId: string; roles: Array<string> }>
|
|
81
|
+
}
|
|
82
|
+
expect(members.value.map((m) => [m.userId, m.roles])).toEqual([
|
|
83
|
+
[admin.userId, ["admin"]],
|
|
84
|
+
[member.userId, ["member"]],
|
|
85
|
+
])
|
|
86
|
+
expect(orgId).toMatch(/^org-/)
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it("lets an administrator manage groups, and lists them to any member", async () => {
|
|
90
|
+
const { member, asAdmin, asMember } = await organisation()
|
|
91
|
+
expect(await asAdmin("createGroup", { id: "reviewers", name: "Reviewers" })).toEqual({ ok: true, value: {} })
|
|
92
|
+
expect(await asAdmin("addToGroup", { groupId: "reviewers", userId: member.userId })).toEqual({
|
|
93
|
+
ok: true,
|
|
94
|
+
value: {},
|
|
95
|
+
})
|
|
96
|
+
expect(await asMember("listGroups")).toEqual({
|
|
97
|
+
ok: true,
|
|
98
|
+
value: [{ id: "reviewers", name: "Reviewers", members: [member.userId], metadata: {} }],
|
|
99
|
+
})
|
|
100
|
+
expect(await asAdmin("removeFromGroup", { groupId: "reviewers", userId: member.userId })).toEqual({
|
|
101
|
+
ok: true,
|
|
102
|
+
value: {},
|
|
103
|
+
})
|
|
104
|
+
expect(await asMember("listGroups")).toEqual({
|
|
105
|
+
ok: true,
|
|
106
|
+
value: [{ id: "reviewers", name: "Reviewers", members: [], metadata: {} }],
|
|
107
|
+
})
|
|
108
|
+
expect(await asAdmin("deleteGroup", { id: "reviewers" })).toEqual({ ok: true, value: {} })
|
|
109
|
+
expect(await asMember("listGroups")).toEqual({ ok: true, value: [] })
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it("refuses every write to a member without the manage permission, changes nothing, and audits the denial", async () => {
|
|
113
|
+
const { s, orgId, member, asAdmin, asMember } = await organisation()
|
|
114
|
+
await asAdmin("createGroup", { id: "staff", name: "Staff" })
|
|
115
|
+
const writes: ReadonlyArray<readonly [string, unknown]> = [
|
|
116
|
+
["createGroup", { id: "rogue", name: "Rogue" }],
|
|
117
|
+
["addToGroup", { groupId: "staff", userId: member.userId }],
|
|
118
|
+
["deleteGroup", { id: "staff" }],
|
|
119
|
+
["createRole", { id: "boss", name: "Boss", permissions: [DIRECTORY_MANAGE] }],
|
|
120
|
+
["assignRole", { userId: member.userId, roleId: "admin" }],
|
|
121
|
+
["setRolePermissions", { id: "member", permissions: [DIRECTORY_MANAGE] }],
|
|
122
|
+
["removeMember", { userId: member.userId }],
|
|
123
|
+
]
|
|
124
|
+
for (const [operation, input] of writes) {
|
|
125
|
+
expect(await asMember(operation, input), operation).toEqual({ ok: false, tag: "Forbidden" })
|
|
126
|
+
}
|
|
127
|
+
expect(await asMember("listGroups")).toEqual({
|
|
128
|
+
ok: true,
|
|
129
|
+
value: [{ id: "staff", name: "Staff", members: [], metadata: {} }],
|
|
130
|
+
})
|
|
131
|
+
const roles = (await asMember("listRoles")) as { value: Array<{ id: string; permissions: Array<string> }> }
|
|
132
|
+
expect(roles.value.map((r) => r.id)).toEqual(["admin", "member"])
|
|
133
|
+
expect(roles.value.find((r) => r.id === "member")!.permissions).toEqual([])
|
|
134
|
+
const denied = (await s.audit(orgId)).filter((a) => a.outcome === "denied")
|
|
135
|
+
expect(denied.map((a) => a.action)).toEqual(writes.map(([operation]) => `eloxiv.directory.${operation}`))
|
|
136
|
+
expect(new Set(denied.map((a) => a.actorUserId))).toEqual(new Set([member.userId]))
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
it("audits every successful write with its actor", async () => {
|
|
140
|
+
const { s, orgId, admin, member, asAdmin } = await organisation()
|
|
141
|
+
await asAdmin("createGroup", { id: "ops", name: "Ops" })
|
|
142
|
+
await asAdmin("addToGroup", { groupId: "ops", userId: member.userId })
|
|
143
|
+
const succeeded = (await s.audit(orgId)).filter((a) => a.outcome === "succeeded")
|
|
144
|
+
expect(succeeded.map((a) => [a.action, a.actorUserId])).toEqual([
|
|
145
|
+
["eloxiv.directory.createOrganization", null],
|
|
146
|
+
["eloxiv.directory.addMember", admin.userId],
|
|
147
|
+
["eloxiv.directory.createGroup", admin.userId],
|
|
148
|
+
["eloxiv.directory.addToGroup", admin.userId],
|
|
149
|
+
])
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
it("refuses callers without a session, and callers acting in an organisation they do not belong to", async () => {
|
|
153
|
+
const { s, orgId } = await organisation()
|
|
154
|
+
expect(await s.call(new Headers(), "createGroup", { id: "x", name: "X" })).toEqual({
|
|
155
|
+
ok: false,
|
|
156
|
+
tag: "Unauthenticated",
|
|
157
|
+
})
|
|
158
|
+
expect(await s.call(new Headers(), "listMembers", {})).toEqual({ ok: false, tag: "Unauthenticated" })
|
|
159
|
+
const outsider = await s.newUser("outsider")
|
|
160
|
+
const other = fresh("org")
|
|
161
|
+
await s.createOrganization({ id: other, name: "Other", admin: outsider.userId })
|
|
162
|
+
// An administrator elsewhere has no say here.
|
|
163
|
+
expect(await s.call(outsider.headers(orgId), "createGroup", { id: "x", name: "X" })).toEqual({
|
|
164
|
+
ok: false,
|
|
165
|
+
tag: "Forbidden",
|
|
166
|
+
})
|
|
167
|
+
expect(await s.call(outsider.headers(orgId), "listMembers", {})).toEqual({ ok: false, tag: "Forbidden" })
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
it("grants only permissions from the vocabulary, the kernel's and the modules'", async () => {
|
|
171
|
+
const { s, member, asAdmin, asMember } = await organisation()
|
|
172
|
+
const vocabulary = (await asMember("listPermissions")) as {
|
|
173
|
+
ok: true
|
|
174
|
+
value: Array<{ id: string; module: string }>
|
|
175
|
+
}
|
|
176
|
+
expect(vocabulary.value.map((p) => p.id)).toEqual(expect.arrayContaining([DIRECTORY_MANAGE, s.modulePermission]))
|
|
177
|
+
expect(vocabulary.value.find((p) => p.id === DIRECTORY_MANAGE)!.module).toBe("eloxiv")
|
|
178
|
+
expect(
|
|
179
|
+
await asAdmin("createRole", { id: "bogus", name: "Bogus", permissions: ["nobody.declares-this"] }),
|
|
180
|
+
).toEqual({
|
|
181
|
+
ok: false,
|
|
182
|
+
tag: "InvalidInput",
|
|
183
|
+
})
|
|
184
|
+
expect(await asAdmin("createRole", { id: "editor", name: "Editor", permissions: [s.modulePermission] })).toEqual({
|
|
185
|
+
ok: true,
|
|
186
|
+
value: {},
|
|
187
|
+
})
|
|
188
|
+
expect(await asAdmin("assignRole", { userId: member.userId, roleId: "editor" })).toEqual({ ok: true, value: {} })
|
|
189
|
+
const members = (await asAdmin("listMembers")) as { value: Array<{ userId: string; roles: Array<string> }> }
|
|
190
|
+
expect(members.value.find((m) => m.userId === member.userId)!.roles).toEqual(["editor", "member"])
|
|
191
|
+
expect(await asAdmin("setRolePermissions", { id: "editor", permissions: ["nobody.declares-this"] })).toEqual({
|
|
192
|
+
ok: false,
|
|
193
|
+
tag: "InvalidInput",
|
|
194
|
+
})
|
|
195
|
+
expect(await asAdmin("unassignRole", { userId: member.userId, roleId: "editor" })).toEqual({
|
|
196
|
+
ok: true,
|
|
197
|
+
value: {},
|
|
198
|
+
})
|
|
199
|
+
expect(await asAdmin("deleteRole", { id: "editor" })).toEqual({ ok: true, value: {} })
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
it("lets a role holding the manage permission administer, and never leaves an organisation without one", async () => {
|
|
203
|
+
const { admin, member, asAdmin, as } = await organisation()
|
|
204
|
+
// The only administrator cannot remove their own ability to manage.
|
|
205
|
+
expect(await asAdmin("unassignRole", { userId: admin.userId, roleId: "admin" })).toEqual({
|
|
206
|
+
ok: false,
|
|
207
|
+
tag: "InvalidInput",
|
|
208
|
+
})
|
|
209
|
+
expect(await asAdmin("setRolePermissions", { id: "admin", permissions: [] })).toEqual({
|
|
210
|
+
ok: false,
|
|
211
|
+
tag: "InvalidInput",
|
|
212
|
+
})
|
|
213
|
+
expect(await asAdmin("removeMember", { userId: admin.userId })).toEqual({ ok: false, tag: "InvalidInput" })
|
|
214
|
+
// A custom role with the permission makes its holder an administrator; then the first can step down.
|
|
215
|
+
await asAdmin("createRole", { id: "steward", name: "Steward", permissions: [DIRECTORY_MANAGE] })
|
|
216
|
+
await asAdmin("assignRole", { userId: member.userId, roleId: "steward" })
|
|
217
|
+
expect(await as(member)("createGroup", { id: "stewards", name: "Stewards" })).toEqual({ ok: true, value: {} })
|
|
218
|
+
expect(await asAdmin("unassignRole", { userId: admin.userId, roleId: "admin" })).toEqual({ ok: true, value: {} })
|
|
219
|
+
expect(await asAdmin("createGroup", { id: "late", name: "Late" })).toEqual({ ok: false, tag: "Forbidden" })
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
it("adds an existing user by email, only for a manager, and tells no one else which addresses have accounts", async () => {
|
|
223
|
+
const { s, orgId, admin, member, asAdmin, asMember } = await organisation()
|
|
224
|
+
const newcomer = await s.newUser("newcomer")
|
|
225
|
+
// A member without the manage permission: refused alike for an address with an account and one without.
|
|
226
|
+
expect(await asMember("addMemberByEmail", { email: newcomer.email })).toEqual({ ok: false, tag: "Forbidden" })
|
|
227
|
+
expect(await asMember("addMemberByEmail", { email: "nobody@example.invalid" })).toEqual({
|
|
228
|
+
ok: false,
|
|
229
|
+
tag: "Forbidden",
|
|
230
|
+
})
|
|
231
|
+
// A manager: found in any case, added with the default role; then refused as a member already.
|
|
232
|
+
expect(await asAdmin("addMemberByEmail", { email: newcomer.email.toUpperCase() })).toEqual({
|
|
233
|
+
ok: true,
|
|
234
|
+
value: {},
|
|
235
|
+
})
|
|
236
|
+
const members = (await asAdmin("listMembers")) as { ok: true; value: Array<{ userId: string; roles: string[] }> }
|
|
237
|
+
expect(members.value.find((m) => m.userId === newcomer.userId)?.roles).toEqual(["member"])
|
|
238
|
+
expect(await asAdmin("addMemberByEmail", { email: newcomer.email })).toEqual({ ok: false, tag: "InvalidInput" })
|
|
239
|
+
expect(await asAdmin("addMemberByEmail", { email: "nobody@example.invalid" })).toEqual({
|
|
240
|
+
ok: false,
|
|
241
|
+
tag: "InvalidInput",
|
|
242
|
+
})
|
|
243
|
+
expect(
|
|
244
|
+
await asAdmin("addMemberByEmail", { email: (await s.newUser("x")).email, roles: ["no-such-role"] }),
|
|
245
|
+
).toEqual({ ok: false, tag: "InvalidInput" })
|
|
246
|
+
const audit = await s.audit(orgId)
|
|
247
|
+
expect(
|
|
248
|
+
audit.filter((a) => a.action === "eloxiv.directory.addMemberByEmail").map((a) => [a.actorUserId, a.outcome]),
|
|
249
|
+
).toEqual([
|
|
250
|
+
[member.userId, "denied"],
|
|
251
|
+
[member.userId, "denied"],
|
|
252
|
+
[admin.userId, "succeeded"],
|
|
253
|
+
[admin.userId, "failed"],
|
|
254
|
+
[admin.userId, "failed"],
|
|
255
|
+
[admin.userId, "failed"],
|
|
256
|
+
])
|
|
257
|
+
})
|
|
258
|
+
|
|
259
|
+
it("removes a member with their roles and group memberships", async () => {
|
|
260
|
+
const { member, asAdmin } = await organisation()
|
|
261
|
+
await asAdmin("createGroup", { id: "crew", name: "Crew" })
|
|
262
|
+
await asAdmin("addToGroup", { groupId: "crew", userId: member.userId })
|
|
263
|
+
expect(await asAdmin("removeMember", { userId: member.userId })).toEqual({ ok: true, value: {} })
|
|
264
|
+
expect(await asAdmin("listGroups")).toEqual({
|
|
265
|
+
ok: true,
|
|
266
|
+
value: [{ id: "crew", name: "Crew", members: [], metadata: {} }],
|
|
267
|
+
})
|
|
268
|
+
const members = (await asAdmin("listMembers")) as { value: Array<{ userId: string }> }
|
|
269
|
+
expect(members.value.map((m) => m.userId)).not.toContain(member.userId)
|
|
270
|
+
// Group membership needs organisation membership.
|
|
271
|
+
expect(await asAdmin("addToGroup", { groupId: "crew", userId: member.userId })).toEqual({
|
|
272
|
+
ok: false,
|
|
273
|
+
tag: "InvalidInput",
|
|
274
|
+
})
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
it("rejects malformed input and requests the directory cannot apply", async () => {
|
|
278
|
+
const { member, asAdmin } = await organisation()
|
|
279
|
+
expect(await asAdmin("createGroup", { id: "Not An Id", name: "x" })).toEqual({ ok: false, tag: "InvalidInput" })
|
|
280
|
+
expect(await asAdmin("createGroup", { name: "x" })).toEqual({ ok: false, tag: "InvalidInput" })
|
|
281
|
+
await asAdmin("createGroup", { id: "dupe", name: "Dupe" })
|
|
282
|
+
expect(await asAdmin("createGroup", { id: "dupe", name: "Dupe" })).toEqual({ ok: false, tag: "InvalidInput" })
|
|
283
|
+
expect(await asAdmin("deleteGroup", { id: "missing" })).toEqual({ ok: false, tag: "InvalidInput" })
|
|
284
|
+
expect(await asAdmin("assignRole", { userId: member.userId, roleId: "missing" })).toEqual({
|
|
285
|
+
ok: false,
|
|
286
|
+
tag: "InvalidInput",
|
|
287
|
+
})
|
|
288
|
+
expect(await asAdmin("addMember", { userId: "no-such-user" })).toEqual({ ok: false, tag: "InvalidInput" })
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
it("lists the caller's own organisations, oldest membership first, with their roles, and only theirs", async () => {
|
|
292
|
+
const first = await organisation()
|
|
293
|
+
const second = await organisation()
|
|
294
|
+
const s = get()
|
|
295
|
+
// The first organisation's member joins the second organisation too, as an administrator there.
|
|
296
|
+
expect(await second.asAdmin("addMember", { userId: first.member.userId, roles: ["admin"] })).toEqual({
|
|
297
|
+
ok: true,
|
|
298
|
+
value: {},
|
|
299
|
+
})
|
|
300
|
+
const mine = await s.call(first.member.headers(), "listMyOrganizations", {})
|
|
301
|
+
expect(mine).toEqual({
|
|
302
|
+
ok: true,
|
|
303
|
+
value: [
|
|
304
|
+
{ orgId: first.orgId, name: "Conformance", roles: ["member"] },
|
|
305
|
+
{ orgId: second.orgId, name: "Conformance", roles: ["admin"] },
|
|
306
|
+
],
|
|
307
|
+
})
|
|
308
|
+
// Acting in either organisation lists the same memberships; nobody else's appear.
|
|
309
|
+
expect(await s.call(first.member.headers(second.orgId), "listMyOrganizations", {})).toEqual(mine)
|
|
310
|
+
const loner = await s.newUser("loner")
|
|
311
|
+
expect(await s.call(loner.headers(), "listMyOrganizations", {})).toEqual({ ok: true, value: [] })
|
|
312
|
+
expect(await s.call(new Headers(), "listMyOrganizations", {})).toEqual({ ok: false, tag: "Unauthenticated" })
|
|
313
|
+
})
|
|
314
|
+
})
|
|
315
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The DirectoryProvider conformance kit (docs/contracts/directory-provider.md). `directoryProviderConformance`
|
|
3
|
+
* registers, for a connector over a Connection: users (list with paging, get), groups when the connector claims
|
|
4
|
+
* them, delta sync of users (exact changes including deletes, resume after a crash, InvalidCursor where the
|
|
5
|
+
* protocol has cursors to expire), the 401 and 403 rules, refresh, rate limiting, and merged scopes with Mail.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, it } from "vitest"
|
|
8
|
+
import {
|
|
9
|
+
callValid,
|
|
10
|
+
connectionChecks,
|
|
11
|
+
deltaChecks,
|
|
12
|
+
failed,
|
|
13
|
+
ok,
|
|
14
|
+
someItem,
|
|
15
|
+
type ProviderHarness,
|
|
16
|
+
} from "./CapabilityKit.ts"
|
|
17
|
+
|
|
18
|
+
export type { ProviderHarness } from "./CapabilityKit.ts"
|
|
19
|
+
|
|
20
|
+
export const directoryProviderConformance = (harness: () => ProviderHarness) =>
|
|
21
|
+
describe(`DirectoryProvider conformance`, () => {
|
|
22
|
+
it("lists users page by page and reads one", async () => {
|
|
23
|
+
const h = harness()
|
|
24
|
+
const connection = await h.connect(["directory"])
|
|
25
|
+
const seeded = await someItem(h, "directory", "listed")
|
|
26
|
+
const seen = new Set<string>()
|
|
27
|
+
let pageToken: string | null = null
|
|
28
|
+
let pages = 0
|
|
29
|
+
do {
|
|
30
|
+
const page: any = ok(await callValid(h, connection, "directory", "listUsers", { pageSize: 2, pageToken }))
|
|
31
|
+
for (const user of page.users as ReadonlyArray<{ id: string }>) seen.add(user.id)
|
|
32
|
+
pageToken = page.nextPageToken
|
|
33
|
+
pages++
|
|
34
|
+
} while (pageToken !== null && pages < 100)
|
|
35
|
+
expect(seen.has(seeded)).toBe(true)
|
|
36
|
+
const user = ok(await callValid(h, connection, "directory", "getUser", { id: seeded }))
|
|
37
|
+
expect(user.id).toBe(seeded)
|
|
38
|
+
expect(user.enabled).toBe(true)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it("lists groups when the connector claims them", async (context) => {
|
|
42
|
+
const h = harness()
|
|
43
|
+
const connection = await h.connect(["directory"])
|
|
44
|
+
if ((await h.flags(connection, "directory"))["groups"] !== true) return
|
|
45
|
+
const result = await callValid(h, connection, "directory", "listGroups", {})
|
|
46
|
+
// A real account whose directory role lacks the privilege: the provider refuses with no scope missing (the
|
|
47
|
+
// grant has them), so nothing about the connector is wrong, but group listing is not proven there.
|
|
48
|
+
if (
|
|
49
|
+
!result.ok &&
|
|
50
|
+
h.consent === false &&
|
|
51
|
+
result.error._tag === "Forbidden" &&
|
|
52
|
+
(result.error["missingScopes"] as ReadonlyArray<string>).length === 0
|
|
53
|
+
) {
|
|
54
|
+
context.skip("the test account's directory role cannot read groups (the provider answers 403)")
|
|
55
|
+
}
|
|
56
|
+
const groups = ok(result)
|
|
57
|
+
expect(Array.isArray(groups.groups)).toBe(true)
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it("reports NotFound for a user that does not exist", async () => {
|
|
61
|
+
const h = harness()
|
|
62
|
+
const connection = await h.connect(["directory"])
|
|
63
|
+
expect(failed(await h.call(connection, "directory", "getUser", { id: "no-such-user" }))._tag).toBe("NotFound")
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
deltaChecks(harness, { capability: "directory" })
|
|
67
|
+
connectionChecks(harness, {
|
|
68
|
+
capability: "directory",
|
|
69
|
+
probe: { operation: "listUsers", input: { pageSize: 1 } },
|
|
70
|
+
other: "mail",
|
|
71
|
+
})
|
|
72
|
+
})
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The DocumentSource conformance kit (docs/contracts/document-source.md). `documentSourceConformance`
|
|
3
|
+
* registers, for a connector over a Connection: listing (the root and a folder), metadata, content when the
|
|
4
|
+
* connector claims it, delta sync of the drive (exact changes including deletes, resume after a crash,
|
|
5
|
+
* InvalidCursor), the 401 and 403 rules, refresh, rate limiting, and merged scopes with Mail.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, it } from "vitest"
|
|
8
|
+
import {
|
|
9
|
+
callValid,
|
|
10
|
+
connectionChecks,
|
|
11
|
+
deltaChecks,
|
|
12
|
+
failed,
|
|
13
|
+
ok,
|
|
14
|
+
seedsOf,
|
|
15
|
+
someItem,
|
|
16
|
+
type ProviderHarness,
|
|
17
|
+
} from "./CapabilityKit.ts"
|
|
18
|
+
|
|
19
|
+
export type { ProviderHarness } from "./CapabilityKit.ts"
|
|
20
|
+
|
|
21
|
+
export const documentSourceConformance = (harness: () => ProviderHarness) =>
|
|
22
|
+
describe(`DocumentSource conformance`, () => {
|
|
23
|
+
it("lists the root, reads an item's metadata and its content", async () => {
|
|
24
|
+
const h = harness()
|
|
25
|
+
const connection = await h.connect(["documents"])
|
|
26
|
+
const id = await someItem(h, "documents", "listed")
|
|
27
|
+
// Seeds that write into a folder of their own (a real account): the root lists the folder, the folder the item.
|
|
28
|
+
const seeds = seedsOf(h, "documents")
|
|
29
|
+
const folderId = seeds.readOnly === true ? undefined : seeds.folderId
|
|
30
|
+
const root = ok(await callValid(h, connection, "documents", "listItems", { pageSize: 100 }))
|
|
31
|
+
const ids = (page: any) => (page.items as ReadonlyArray<{ id: string }>).map((i) => i.id)
|
|
32
|
+
const container =
|
|
33
|
+
folderId === undefined
|
|
34
|
+
? root
|
|
35
|
+
: ok(await callValid(h, connection, "documents", "listItems", { folderId, pageSize: 100 }))
|
|
36
|
+
expect(ids(root)).toContain(folderId ?? id)
|
|
37
|
+
expect(ids(container)).toContain(id)
|
|
38
|
+
const item = ok(await callValid(h, connection, "documents", "getItem", { id }))
|
|
39
|
+
expect(item.kind).toBe("file")
|
|
40
|
+
const content =
|
|
41
|
+
(await h.flags(connection, "documents"))["content"] === true
|
|
42
|
+
? Buffer.from(
|
|
43
|
+
ok(await callValid(h, connection, "documents", "getContent", { id })).contentBase64,
|
|
44
|
+
"base64",
|
|
45
|
+
).toString("utf8")
|
|
46
|
+
: "listed (content not claimed)"
|
|
47
|
+
expect(content).toContain("listed")
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it("reports NotFound for an item that does not exist", async () => {
|
|
51
|
+
const h = harness()
|
|
52
|
+
const connection = await h.connect(["documents"])
|
|
53
|
+
expect(failed(await h.call(connection, "documents", "getItem", { id: "no-such-item" }))._tag).toBe("NotFound")
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
deltaChecks(harness, { capability: "documents" })
|
|
57
|
+
connectionChecks(harness, {
|
|
58
|
+
capability: "documents",
|
|
59
|
+
probe: { operation: "listItems", input: { pageSize: 1 } },
|
|
60
|
+
other: "mail",
|
|
61
|
+
})
|
|
62
|
+
})
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Eloxiv kernel as the ToolSource and HttpApi kits' subject: an in-process kernel on a fresh database with the
|
|
3
|
+
* kernel's inbox and `connections` modules and the endpoint connectors under test (the registry's `mcp` and
|
|
4
|
+
* `http-openapi`), whose outbound allowlist names only the protocol fakes' hosts (everything else that is not public
|
|
5
|
+
* is refused, as in production). Members sign in; secrets are put through the kernel's Secrets routes, as a person
|
|
6
|
+
* would; consent is followed in a "browser" (the person's session) through the kernel's authorize route, the fake's
|
|
7
|
+
* authorization endpoint and the kernel's callback.
|
|
8
|
+
*/
|
|
9
|
+
import type { CapabilityName, ConsentStart } from "@eloxiv/contracts"
|
|
10
|
+
import { Connections, connectionsModule, inboxModules, type ConnectorDefinition, type KernelApp } from "@eloxiv/kernel"
|
|
11
|
+
import { Effect } from "effect"
|
|
12
|
+
import { resolve } from "node:path"
|
|
13
|
+
import { startKernel, type TestKernel } from "../Kernel.ts"
|
|
14
|
+
import { defaultRuntime, dropDatabase } from "../System.ts"
|
|
15
|
+
import type { CallResult } from "./CapabilityKit.ts"
|
|
16
|
+
import { callAction, createMember, type ConnectorUser, type Surface } from "./ConnectorReference.ts"
|
|
17
|
+
|
|
18
|
+
const root = resolve(import.meta.dirname, "../../../..")
|
|
19
|
+
|
|
20
|
+
export interface EndpointSubject {
|
|
21
|
+
readonly kernel: TestKernel
|
|
22
|
+
/** A member (role `member`). */
|
|
23
|
+
readonly owner: ConnectorUser
|
|
24
|
+
/** An administrator (eloxiv.connections.manage and eloxiv.secrets.manage). */
|
|
25
|
+
readonly admin: ConnectorUser
|
|
26
|
+
readonly member: (name: string, roles?: ReadonlyArray<string>) => Promise<ConnectorUser>
|
|
27
|
+
readonly action: (user: ConnectorUser, action: string, input: unknown, surface?: Surface) => Promise<CallResult>
|
|
28
|
+
/** `POST /kernel/secrets/<operation>` as `user`: status and body. */
|
|
29
|
+
readonly secrets: (user: ConnectorUser, operation: string, body: unknown) => Promise<{ status: number; body: any }>
|
|
30
|
+
/** Follow a consent in the person's browser to the kernel's callback; the callback's status. */
|
|
31
|
+
readonly consent: (user: ConnectorUser, start: ConsentStart) => Promise<number>
|
|
32
|
+
/** A capability operation in process, as `user` from `module`'s handler (undefined: the kernel's own actions). */
|
|
33
|
+
readonly call: (
|
|
34
|
+
connectionId: string,
|
|
35
|
+
user: ConnectorUser,
|
|
36
|
+
capability: CapabilityName,
|
|
37
|
+
operation: string,
|
|
38
|
+
input: unknown,
|
|
39
|
+
module?: string,
|
|
40
|
+
) => Promise<CallResult>
|
|
41
|
+
readonly sql: <A = Record<string, unknown>>(
|
|
42
|
+
text: string,
|
|
43
|
+
params?: ReadonlyArray<unknown>,
|
|
44
|
+
) => Promise<ReadonlyArray<A>>
|
|
45
|
+
readonly dispose: () => Promise<void>
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const startEndpointReference = async (options: {
|
|
49
|
+
readonly name: string
|
|
50
|
+
readonly connectors: ReadonlyArray<ConnectorDefinition>
|
|
51
|
+
/** `host:port` of each fake the deployment allows as an outbound destination. */
|
|
52
|
+
readonly allow: ReadonlyArray<string>
|
|
53
|
+
}): Promise<EndpointSubject> => {
|
|
54
|
+
const database = `eloxiv_t_${options.name}_${defaultRuntime()}`
|
|
55
|
+
await dropDatabase(database, root)
|
|
56
|
+
const modules = [...inboxModules, connectionsModule]
|
|
57
|
+
const app: KernelApp = {
|
|
58
|
+
name: options.name,
|
|
59
|
+
modules,
|
|
60
|
+
connectors: [...options.connectors],
|
|
61
|
+
secrets: [{ scope: "org", name: "billing-key", feature: "billing", description: "The billing provider's key" }],
|
|
62
|
+
}
|
|
63
|
+
const kernel = await startKernel({
|
|
64
|
+
app,
|
|
65
|
+
database,
|
|
66
|
+
config: { connections: { outboundAllow: [...options.allow] } },
|
|
67
|
+
})
|
|
68
|
+
const owner = await createMember(kernel, "owner", "acme")
|
|
69
|
+
const admin = await createMember(kernel, "admin", "acme", ["member", "admin"])
|
|
70
|
+
return {
|
|
71
|
+
kernel,
|
|
72
|
+
owner,
|
|
73
|
+
admin,
|
|
74
|
+
member: (name, roles) => createMember(kernel, name, "acme", roles),
|
|
75
|
+
action: (user, action, input, surface) => callAction(kernel, modules, user, action, input, surface),
|
|
76
|
+
secrets: async (user, operation, body) => {
|
|
77
|
+
const response = await fetch(`${kernel.url}/kernel/secrets/${operation}`, {
|
|
78
|
+
method: "POST",
|
|
79
|
+
headers: {
|
|
80
|
+
authorization: `Bearer ${user.session}`,
|
|
81
|
+
"x-eloxiv-org": user.org,
|
|
82
|
+
"content-type": "application/json",
|
|
83
|
+
},
|
|
84
|
+
body: JSON.stringify(body),
|
|
85
|
+
})
|
|
86
|
+
return { status: response.status, body: await response.json() }
|
|
87
|
+
},
|
|
88
|
+
consent: async (user, start) => {
|
|
89
|
+
const browser = { authorization: `Bearer ${user.session}` }
|
|
90
|
+
const authorize = await fetch(start.authorizeUrl, { headers: browser, redirect: "manual" })
|
|
91
|
+
if (authorize.status !== 302) return authorize.status
|
|
92
|
+
const provider = await fetch(authorize.headers.get("location")!, { redirect: "manual" })
|
|
93
|
+
const location = provider.headers.get("location")
|
|
94
|
+
if (location === null) return provider.status
|
|
95
|
+
const callback = await fetch(location, { headers: browser, redirect: "manual" })
|
|
96
|
+
return callback.status
|
|
97
|
+
},
|
|
98
|
+
call: (connectionId, user, capability, operation, input, module) =>
|
|
99
|
+
kernel.run(
|
|
100
|
+
(
|
|
101
|
+
Effect.gen(function* () {
|
|
102
|
+
const bound = yield* (yield* Connections).capability(connectionId, capability, {
|
|
103
|
+
userId: user.id,
|
|
104
|
+
orgId: user.org,
|
|
105
|
+
...(module === undefined ? {} : { module }),
|
|
106
|
+
})
|
|
107
|
+
return yield* bound.operations[operation]!(input)
|
|
108
|
+
}) as Effect.Effect<unknown, any, any>
|
|
109
|
+
).pipe(
|
|
110
|
+
Effect.map((value): CallResult => ({ ok: true, value })),
|
|
111
|
+
Effect.catch((error: any) => Effect.succeed<CallResult>({ ok: false, error })),
|
|
112
|
+
),
|
|
113
|
+
),
|
|
114
|
+
sql: (text, params) => kernel.admin(text, params) as never,
|
|
115
|
+
dispose: () => kernel.dispose(),
|
|
116
|
+
}
|
|
117
|
+
}
|