@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,820 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for push (Notifications 1.2.0's installations, NotificationChannel 1.1.0's push channel) against
|
|
3
|
+
* protocol fakes of APNs (HTTP/2 over TLS, provider tokens verified) and FCM HTTP v1 (service-account OAuth):
|
|
4
|
+
*
|
|
5
|
+
* - **Installations**: registered by the person from their own session only (agents refused); registering again
|
|
6
|
+
* rotates the token; a token moves to whoever registers it last; signing out removes what that session registered;
|
|
7
|
+
* erasure removes all.
|
|
8
|
+
* - **Delivery**: to every live installation, APNs and FCM, with the provider payload the contract fixes (title and
|
|
9
|
+
* body, the notification's id, organisation and category, the record's link chosen from the installed views,
|
|
10
|
+
* minimal text for a consent request); the provider token signed once and reused; one access token reused.
|
|
11
|
+
* - **Errors**: a dead token invalidates its installation only while it still holds that token; the deployment's
|
|
12
|
+
* credentials refused, throttling and outages are retried (after the provider's Retry-After) and never blamed on the
|
|
13
|
+
* device; a refused payload fails that installation only; a GOAWAY moves to a new connection; a retry never sends
|
|
14
|
+
* again to an installation that accepted.
|
|
15
|
+
*
|
|
16
|
+
* Usage: `pushConformance(() => startMyKernel())` with a subject that has APNs and FCM fakes (`PushSubject`).
|
|
17
|
+
*/
|
|
18
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest"
|
|
19
|
+
import type { ApnsFake } from "../fakes/ApnsFake.ts"
|
|
20
|
+
import type { FcmFake } from "../fakes/FcmFake.ts"
|
|
21
|
+
import {
|
|
22
|
+
unique,
|
|
23
|
+
until,
|
|
24
|
+
type InboxOutcome,
|
|
25
|
+
type InboxSubject,
|
|
26
|
+
type InboxSurface,
|
|
27
|
+
type InboxUser,
|
|
28
|
+
} from "./InboxSubject.ts"
|
|
29
|
+
|
|
30
|
+
const ORG = "acme"
|
|
31
|
+
/** The app's APNs topic and Android package. */
|
|
32
|
+
export const PUSH_APP = "dev.eloxiv.hello"
|
|
33
|
+
|
|
34
|
+
export interface DecideAnswer {
|
|
35
|
+
readonly status: number
|
|
36
|
+
readonly cacheControl: string | null
|
|
37
|
+
readonly body: Record<string, unknown>
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface PushSubject extends InboxSubject {
|
|
41
|
+
readonly url: string
|
|
42
|
+
readonly apns: ApnsFake
|
|
43
|
+
readonly fcm: FcmFake
|
|
44
|
+
/** A new session for the person (the old one stays). */
|
|
45
|
+
readonly signIn: (user: InboxUser) => Promise<InboxUser>
|
|
46
|
+
/** End the session `user.token` is. */
|
|
47
|
+
readonly signOut: (user: InboxUser) => Promise<void>
|
|
48
|
+
/** Erase the person's personal data in `org` (Privacy), and wait for it to finish. */
|
|
49
|
+
readonly erase: (user: InboxUser, org: string) => Promise<void>
|
|
50
|
+
/** `POST /api/notifications/decide`. */
|
|
51
|
+
readonly decide: (token: string, verdict: string) => Promise<DecideAnswer>
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type StartPushSubject = () => Promise<PushSubject>
|
|
55
|
+
|
|
56
|
+
/** Register an installation; its id. */
|
|
57
|
+
export const registerInstallation = async (
|
|
58
|
+
s: InboxSubject,
|
|
59
|
+
who: InboxUser,
|
|
60
|
+
device: {
|
|
61
|
+
readonly provider: "apns" | "fcm"
|
|
62
|
+
readonly token: string
|
|
63
|
+
readonly installationId?: string
|
|
64
|
+
readonly environment?: "production" | "sandbox"
|
|
65
|
+
},
|
|
66
|
+
surface?: InboxSurface,
|
|
67
|
+
): Promise<{ readonly installationId: string; readonly outcome: InboxOutcome }> => {
|
|
68
|
+
const installationId = device.installationId ?? crypto.randomUUID()
|
|
69
|
+
const outcome = await s.invoke({
|
|
70
|
+
action: "notifications.registerInstallation",
|
|
71
|
+
input: {
|
|
72
|
+
installationId,
|
|
73
|
+
provider: device.provider,
|
|
74
|
+
token: device.token,
|
|
75
|
+
appId: PUSH_APP,
|
|
76
|
+
...(device.environment === undefined ? {} : { environment: device.environment }),
|
|
77
|
+
},
|
|
78
|
+
token: who.token,
|
|
79
|
+
surface,
|
|
80
|
+
})
|
|
81
|
+
return { installationId, outcome }
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Ask for `category` by push only. */
|
|
85
|
+
export const wantPush = (s: InboxSubject, who: InboxUser, category: string) =>
|
|
86
|
+
s.invoke({ action: "notifications.setPreference", input: { category, channels: ["push"] }, token: who.token })
|
|
87
|
+
|
|
88
|
+
export const pushConformance = (start: StartPushSubject) =>
|
|
89
|
+
describe("Push (Notifications 1.2.0, NotificationChannel 1.1.0)", () => {
|
|
90
|
+
let s: PushSubject
|
|
91
|
+
beforeAll(async () => {
|
|
92
|
+
s = await start()
|
|
93
|
+
}, 120_000)
|
|
94
|
+
afterAll(() => s?.dispose())
|
|
95
|
+
|
|
96
|
+
/** A member who wants `message` notifications by push. */
|
|
97
|
+
const member = async (name: string) => {
|
|
98
|
+
const who = await s.user(unique(name), ORG)
|
|
99
|
+
await wantPush(s, who, "message")
|
|
100
|
+
return who
|
|
101
|
+
}
|
|
102
|
+
const notify = async (who: InboxUser, title: string, link?: Record<string, string>) => {
|
|
103
|
+
const outcome = await s.invoke({
|
|
104
|
+
action: "notifications.notify",
|
|
105
|
+
input: { title, body: `${title} body`, ...(link === undefined ? {} : { link }) },
|
|
106
|
+
token: who.token,
|
|
107
|
+
})
|
|
108
|
+
if (!outcome.ok) throw new Error(JSON.stringify(outcome))
|
|
109
|
+
}
|
|
110
|
+
const apnsGot = (token: string, title: string) =>
|
|
111
|
+
until(
|
|
112
|
+
`APNs delivery of ${title}`,
|
|
113
|
+
async () => s.apns.deliveredTo(token).filter((d) => d.payload["aps"]?.alert?.title === title),
|
|
114
|
+
(found) => found.length > 0,
|
|
115
|
+
)
|
|
116
|
+
const fcmGot = (token: string, title: string) =>
|
|
117
|
+
until(
|
|
118
|
+
`FCM delivery of ${title}`,
|
|
119
|
+
async () => s.fcm.deliveredTo(token).filter((d) => d.message["data"]?.title === title),
|
|
120
|
+
(found) => found.length > 0,
|
|
121
|
+
)
|
|
122
|
+
const installations = (who: InboxUser) =>
|
|
123
|
+
s.sql<{ installation_id: string; token: string; invalidated_at: unknown; session_id: string }>(
|
|
124
|
+
`SELECT installation_id, token, invalidated_at, session_id FROM eloxiv.push_installation WHERE user_id = $1
|
|
125
|
+
ORDER BY created_at`,
|
|
126
|
+
[who.id],
|
|
127
|
+
)
|
|
128
|
+
const deliveryOf = async (who: InboxUser, title: string) => {
|
|
129
|
+
const rows = await until(
|
|
130
|
+
`the push delivery of ${title}`,
|
|
131
|
+
() =>
|
|
132
|
+
s.sql<{ status: string; attempts: number; last_error: string | null }>(
|
|
133
|
+
`SELECT d.status, d.attempts, d.last_error FROM eloxiv_notifications.delivery d
|
|
134
|
+
JOIN eloxiv_notifications.notification n ON n.id = d.notification_id
|
|
135
|
+
WHERE n.recipient_id = $1 AND n.title = $2 AND d.channel = 'push'`,
|
|
136
|
+
[who.id, title],
|
|
137
|
+
),
|
|
138
|
+
(found) => found.length > 0 && found[0]!.status !== "pending",
|
|
139
|
+
)
|
|
140
|
+
return rows[0]!
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
describe("installations", () => {
|
|
144
|
+
it("registers an installation from the person's own session, and rotates its token on registering again", async () => {
|
|
145
|
+
const nina = await member("nina")
|
|
146
|
+
const first = s.apns.deviceToken(PUSH_APP)
|
|
147
|
+
const { installationId, outcome } = await registerInstallation(s, nina, { provider: "apns", token: first })
|
|
148
|
+
expect(outcome).toMatchObject({ ok: true })
|
|
149
|
+
const second = s.apns.deviceToken(PUSH_APP)
|
|
150
|
+
expect(
|
|
151
|
+
(await registerInstallation(s, nina, { provider: "apns", token: second, installationId })).outcome,
|
|
152
|
+
).toMatchObject({
|
|
153
|
+
ok: true,
|
|
154
|
+
})
|
|
155
|
+
expect(await installations(nina)).toMatchObject([{ installation_id: installationId, token: second }])
|
|
156
|
+
await notify(nina, "after rotation")
|
|
157
|
+
await apnsGot(second, "after rotation")
|
|
158
|
+
expect(s.apns.deliveredTo(first)).toEqual([])
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
it("refuses an agent registering for the person, on the agent surfaces and with an agent session", async () => {
|
|
162
|
+
const omar = await member("omar")
|
|
163
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
164
|
+
for (const surface of ["agent", "mcp"] as const) {
|
|
165
|
+
expect((await registerInstallation(s, omar, { provider: "apns", token }, surface)).outcome).toMatchObject({
|
|
166
|
+
ok: false,
|
|
167
|
+
error: { _tag: "Forbidden" },
|
|
168
|
+
})
|
|
169
|
+
}
|
|
170
|
+
const agent = await s.agentSession(omar, ORG)
|
|
171
|
+
expect(
|
|
172
|
+
(await registerInstallation(s, { ...omar, token: agent.token }, { provider: "apns", token })).outcome,
|
|
173
|
+
).toMatchObject({ ok: false, error: { _tag: "Forbidden" } })
|
|
174
|
+
expect(await installations(omar)).toEqual([])
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
it("moves a token to whoever registers it last: it is in one installation at a time", async () => {
|
|
178
|
+
const [pia, raj] = [await member("pia"), await member("raj")]
|
|
179
|
+
const token = s.fcm.deviceToken()
|
|
180
|
+
await registerInstallation(s, pia, { provider: "fcm", token })
|
|
181
|
+
await registerInstallation(s, raj, { provider: "fcm", token })
|
|
182
|
+
expect(await installations(pia)).toEqual([])
|
|
183
|
+
expect(await installations(raj)).toHaveLength(1)
|
|
184
|
+
await notify(pia, "pia after the move")
|
|
185
|
+
await notify(raj, "raj after the move")
|
|
186
|
+
await fcmGot(token, "raj after the move")
|
|
187
|
+
expect((await deliveryOf(pia, "pia after the move")).status).toBe("failed")
|
|
188
|
+
expect(s.fcm.deliveredTo(token).some((d) => d.message["data"]?.title === "pia after the move")).toBe(false)
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
it("removes what a session registered when it signs out, and only that", async () => {
|
|
192
|
+
const sam = await member("sam")
|
|
193
|
+
const other = await s.signIn(sam)
|
|
194
|
+
await registerInstallation(s, sam, { provider: "apns", token: s.apns.deviceToken(PUSH_APP) })
|
|
195
|
+
const kept = s.fcm.deviceToken()
|
|
196
|
+
await registerInstallation(s, other, { provider: "fcm", token: kept })
|
|
197
|
+
expect(await installations(sam)).toHaveLength(2)
|
|
198
|
+
await s.signOut(sam)
|
|
199
|
+
await until(
|
|
200
|
+
"the signed-out installation gone",
|
|
201
|
+
() => installations(sam),
|
|
202
|
+
(rows) => rows.length === 1,
|
|
203
|
+
)
|
|
204
|
+
expect((await installations(sam))[0]).toMatchObject({ token: kept })
|
|
205
|
+
await notify(other, "after sign-out")
|
|
206
|
+
await fcmGot(kept, "after sign-out")
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
it("gives a token many people register at once to exactly one installation, every registration succeeding", async () => {
|
|
210
|
+
const people = await Promise.all(["ola", "pat", "quin", "rui", "sol", "tam"].map((name) => member(name)))
|
|
211
|
+
const token = s.fcm.deviceToken()
|
|
212
|
+
const outcomes = await Promise.all(
|
|
213
|
+
people.map((who) => registerInstallation(s, who, { provider: "fcm", token })),
|
|
214
|
+
)
|
|
215
|
+
expect(outcomes.map((o) => o.outcome.ok)).toEqual(people.map(() => true))
|
|
216
|
+
expect(
|
|
217
|
+
await s.sql(`SELECT user_id FROM eloxiv.push_installation WHERE provider = 'fcm' AND token = $1`, [token]),
|
|
218
|
+
).toHaveLength(1)
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
it("registers the longest token the contract allows", async () => {
|
|
222
|
+
const uri = await member("uri")
|
|
223
|
+
const bytes = crypto.getRandomValues(new Uint8Array(3_072))
|
|
224
|
+
let binary = ""
|
|
225
|
+
for (const byte of bytes) binary += String.fromCharCode(byte)
|
|
226
|
+
const token = btoa(binary).replaceAll("+", "-").replaceAll("/", "_")
|
|
227
|
+
expect(token).toHaveLength(4_096)
|
|
228
|
+
expect((await registerInstallation(s, uri, { provider: "fcm", token })).outcome).toMatchObject({ ok: true })
|
|
229
|
+
expect(await installations(uri)).toMatchObject([{ token }])
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
it("erases every installation of the person", async () => {
|
|
233
|
+
const tia = await member("tia")
|
|
234
|
+
await registerInstallation(s, tia, { provider: "apns", token: s.apns.deviceToken(PUSH_APP) })
|
|
235
|
+
await registerInstallation(s, tia, { provider: "fcm", token: s.fcm.deviceToken() })
|
|
236
|
+
await s.erase(tia, ORG)
|
|
237
|
+
expect(await installations(tia)).toEqual([])
|
|
238
|
+
})
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
describe("delivery", () => {
|
|
242
|
+
it("delivers through APNs with a verified provider token, the contract's payload and the record's link", async () => {
|
|
243
|
+
const uma = await member("uma")
|
|
244
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
245
|
+
const { installationId } = await registerInstallation(s, uma, { provider: "apns", token })
|
|
246
|
+
const tokensBefore = s.apns.providerTokens()
|
|
247
|
+
await notify(uma, "apns one", { module: "purchases", entity: "order", id: "ord-1" })
|
|
248
|
+
await notify(uma, "apns two", { module: "purchases", entity: "transfer", id: "trf-1" })
|
|
249
|
+
const [one] = await apnsGot(token, "apns one")
|
|
250
|
+
const [two] = await apnsGot(token, "apns two")
|
|
251
|
+
expect(one!.topic).toBe(PUSH_APP)
|
|
252
|
+
expect(one!.pushType).toBe("alert")
|
|
253
|
+
expect(one!.apnsId).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u)
|
|
254
|
+
expect(one!.payload).toEqual({
|
|
255
|
+
aps: { alert: { title: "apns one", body: "apns one body" } },
|
|
256
|
+
eloxiv: {
|
|
257
|
+
notificationId: expect.any(String),
|
|
258
|
+
orgId: ORG,
|
|
259
|
+
// The recipient and the installation it went to: the app opens it only for that sign-in on that install.
|
|
260
|
+
userId: uma.id,
|
|
261
|
+
installationId,
|
|
262
|
+
category: "message",
|
|
263
|
+
link: { view: "purchases.order", record: "ord-1", org: ORG },
|
|
264
|
+
},
|
|
265
|
+
})
|
|
266
|
+
expect(one!.collapseId).toBe(one!.payload["eloxiv"].notificationId)
|
|
267
|
+
// No installed view shows transfers: no link.
|
|
268
|
+
expect(two!.payload["eloxiv"].link).toBeNull()
|
|
269
|
+
// One provider token for both (reused, not signed per request).
|
|
270
|
+
expect(s.apns.providerTokens() - tokensBefore).toBeLessThanOrEqual(1)
|
|
271
|
+
expect((await deliveryOf(uma, "apns one")).status).toBe("sent")
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
it("delivers through FCM with one access token from the service account's assertion", async () => {
|
|
275
|
+
const vic = await member("vic")
|
|
276
|
+
const token = s.fcm.deviceToken()
|
|
277
|
+
const { installationId } = await registerInstallation(s, vic, { provider: "fcm", token })
|
|
278
|
+
await notify(vic, "fcm one", { module: "purchases", entity: "order", id: "ord-2" })
|
|
279
|
+
await notify(vic, "fcm two")
|
|
280
|
+
const [one] = await fcmGot(token, "fcm one")
|
|
281
|
+
await fcmGot(token, "fcm two")
|
|
282
|
+
// Data-only, high priority, in expo-notifications' fields (the app draws it, buttons included).
|
|
283
|
+
expect(one!.message["notification"]).toBeUndefined()
|
|
284
|
+
// No collapse key (FCM keeps four per offline device: distinct notifications would be dropped); a copy sent
|
|
285
|
+
// again replaces the visible one by its tag, the notification's id.
|
|
286
|
+
const id = JSON.parse(one!.message["data"].eloxiv).notificationId as string
|
|
287
|
+
expect(one!.message["android"]).toEqual({ priority: "high" })
|
|
288
|
+
const eloxiv = {
|
|
289
|
+
notificationId: expect.any(String),
|
|
290
|
+
orgId: ORG,
|
|
291
|
+
userId: vic.id,
|
|
292
|
+
installationId,
|
|
293
|
+
category: "message",
|
|
294
|
+
link: { view: "purchases.order", record: "ord-2", org: ORG },
|
|
295
|
+
}
|
|
296
|
+
expect(Object.keys(one!.message["data"]).sort()).toEqual([
|
|
297
|
+
"body",
|
|
298
|
+
"channelId",
|
|
299
|
+
"eloxiv",
|
|
300
|
+
"message",
|
|
301
|
+
"tag",
|
|
302
|
+
"title",
|
|
303
|
+
])
|
|
304
|
+
expect(one!.message["data"]).toMatchObject({
|
|
305
|
+
tag: id,
|
|
306
|
+
title: "fcm one",
|
|
307
|
+
message: "fcm one body",
|
|
308
|
+
channelId: "default",
|
|
309
|
+
})
|
|
310
|
+
expect(JSON.parse(one!.message["data"].eloxiv)).toEqual(eloxiv)
|
|
311
|
+
expect(JSON.parse(one!.message["data"].body)).toEqual({ eloxiv })
|
|
312
|
+
expect(s.fcm.assertionsRefused()).toBe(0)
|
|
313
|
+
expect(s.fcm.tokenRequests()).toBeLessThanOrEqual(2)
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
it("fits a payload to the providers' 4 KiB limit, and links only a record the DeepLink contract allows", async () => {
|
|
317
|
+
const ivy = await member("ivy")
|
|
318
|
+
const apnsToken = s.apns.deviceToken(PUSH_APP)
|
|
319
|
+
const fcmToken = s.fcm.deviceToken()
|
|
320
|
+
await registerInstallation(s, ivy, { provider: "apns", token: apnsToken })
|
|
321
|
+
await registerInstallation(s, ivy, { provider: "fcm", token: fcmToken })
|
|
322
|
+
// Three bytes a character: a 1,000-character body is 3,000 bytes, a 200-character title 600.
|
|
323
|
+
const title = `€${unique("t")}`.padEnd(200, "€")
|
|
324
|
+
const outcome = await s.invoke({
|
|
325
|
+
action: "notifications.notify",
|
|
326
|
+
input: {
|
|
327
|
+
title,
|
|
328
|
+
body: "€".repeat(4_000),
|
|
329
|
+
link: { module: "purchases", entity: "order", id: "o".repeat(600) },
|
|
330
|
+
},
|
|
331
|
+
token: ivy.token,
|
|
332
|
+
})
|
|
333
|
+
expect(outcome).toMatchObject({ ok: true })
|
|
334
|
+
const [apns] = await apnsGot(apnsToken, title)
|
|
335
|
+
const [fcm] = await fcmGot(fcmToken, title)
|
|
336
|
+
expect(new TextEncoder().encode(JSON.stringify(apns!.payload)).length).toBeLessThanOrEqual(4_096)
|
|
337
|
+
// A record id longer than a DeepLink's: no link.
|
|
338
|
+
expect(apns!.payload["eloxiv"].link).toBeNull()
|
|
339
|
+
expect(JSON.parse(fcm!.message["data"].eloxiv).link).toBeNull()
|
|
340
|
+
expect((await deliveryOf(ivy, title)).status).toBe("sent")
|
|
341
|
+
})
|
|
342
|
+
|
|
343
|
+
it("sends nothing to an installation signed out while the delivery's earlier sends waited", async () => {
|
|
344
|
+
const jay = await member("jay")
|
|
345
|
+
const other = await s.signIn(jay)
|
|
346
|
+
for (let i = 0; i < 4; i++) {
|
|
347
|
+
await registerInstallation(s, jay, { provider: "apns", token: s.apns.deviceToken(PUSH_APP) })
|
|
348
|
+
}
|
|
349
|
+
const late = s.apns.deviceToken(PUSH_APP)
|
|
350
|
+
await registerInstallation(s, other, { provider: "apns", token: late })
|
|
351
|
+
const received = s.apns.requests()
|
|
352
|
+
// The first four sends wait for their answers; the fifth installation's session ends meanwhile.
|
|
353
|
+
s.apns.delayNext(4, 1_500)
|
|
354
|
+
await notify(jay, "fan-out")
|
|
355
|
+
await until(
|
|
356
|
+
"the first four sends",
|
|
357
|
+
async () => s.apns.requests(),
|
|
358
|
+
(n) => n >= received + 4,
|
|
359
|
+
)
|
|
360
|
+
await s.signOut(other)
|
|
361
|
+
await deliveryOf(jay, "fan-out")
|
|
362
|
+
await new Promise((resolve) => setTimeout(resolve, 500))
|
|
363
|
+
expect(s.apns.deliveredTo(late)).toEqual([])
|
|
364
|
+
})
|
|
365
|
+
|
|
366
|
+
it("sends nothing once the recipient left the organisation, also on a retry", async () => {
|
|
367
|
+
const kim = await member("kim")
|
|
368
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
369
|
+
await registerInstallation(s, kim, { provider: "apns", token })
|
|
370
|
+
const before = s.apns.refusals()
|
|
371
|
+
s.apns.failNext({ status: 503, reason: "ServiceUnavailable", retryAfter: "2" })
|
|
372
|
+
await notify(kim, "after leaving")
|
|
373
|
+
await until(
|
|
374
|
+
"the refused first send",
|
|
375
|
+
async () => s.apns.refusals(),
|
|
376
|
+
(n) => n > before,
|
|
377
|
+
)
|
|
378
|
+
await s.leave(kim.id, ORG)
|
|
379
|
+
expect((await deliveryOf(kim, "after leaving")).status).toBe("failed")
|
|
380
|
+
expect(s.apns.deliveredTo(token)).toEqual([])
|
|
381
|
+
})
|
|
382
|
+
|
|
383
|
+
it("records each send before the provider answers it", async () => {
|
|
384
|
+
const lou = await member("lou")
|
|
385
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
386
|
+
await registerInstallation(s, lou, { provider: "apns", token })
|
|
387
|
+
let during: ReadonlyArray<{ status: string; attempts: number }> = []
|
|
388
|
+
s.apns.beforeNextAnswer(async () => {
|
|
389
|
+
during = await s.sql<{ status: string; attempts: number }>(
|
|
390
|
+
`SELECT p.status, p.attempts FROM eloxiv.push_delivery p
|
|
391
|
+
JOIN eloxiv.push_installation i ON i.id = p.installation_id WHERE i.user_id = $1`,
|
|
392
|
+
[lou.id],
|
|
393
|
+
)
|
|
394
|
+
})
|
|
395
|
+
await notify(lou, "recorded first")
|
|
396
|
+
await apnsGot(token, "recorded first")
|
|
397
|
+
expect(during).toEqual([{ status: "sending", attempts: 1 }])
|
|
398
|
+
})
|
|
399
|
+
|
|
400
|
+
it("keeps a consent request's input off the lock screen", async () => {
|
|
401
|
+
const wes = await s.user(unique("wes"), ORG)
|
|
402
|
+
await wantPush(s, wes, "consent.requested")
|
|
403
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
404
|
+
await registerInstallation(s, wes, { provider: "apns", token })
|
|
405
|
+
const payee = unique("secret-payee")
|
|
406
|
+
await s.invoke({ action: "purchases.wire", input: { amount: 7, payee }, token: wes.token, surface: "agent" })
|
|
407
|
+
const [push] = await until(
|
|
408
|
+
"the consent push",
|
|
409
|
+
async () => s.apns.deliveredTo(token),
|
|
410
|
+
(found) => found.length > 0,
|
|
411
|
+
)
|
|
412
|
+
expect(push!.payload["aps"].alert.body).toBe("Open the app to review the details.")
|
|
413
|
+
// The action as people see it called (its title, recorded with the request), never its id.
|
|
414
|
+
expect(push!.payload["aps"].alert.title).toBe("Your agent wants to: Wire money")
|
|
415
|
+
expect(JSON.stringify(push!.payload)).not.toContain(payee)
|
|
416
|
+
expect(push!.payload["aps"].category).toBe("eloxiv.decision")
|
|
417
|
+
expect(push!.payload["eloxiv"].link).toMatchObject({ view: "consent.request", org: ORG })
|
|
418
|
+
expect(push!.payload["eloxiv"].decision).toEqual({
|
|
419
|
+
token: expect.stringMatching(/^[A-Za-z0-9_-]{43}$/u),
|
|
420
|
+
verdicts: ["approve", "reject"],
|
|
421
|
+
kind: "consent",
|
|
422
|
+
requestId: expect.any(String),
|
|
423
|
+
})
|
|
424
|
+
})
|
|
425
|
+
|
|
426
|
+
it("adds push to a person's channels in one write, keeping the ones they chose", async () => {
|
|
427
|
+
const noa = await s.user(unique("noa"), ORG)
|
|
428
|
+
const channelsOf = async (category: string) =>
|
|
429
|
+
(
|
|
430
|
+
await s.sql<{ channels: ReadonlyArray<string> }>(
|
|
431
|
+
`SELECT channels FROM eloxiv_notifications.preference WHERE user_id = $1 AND category = $2`,
|
|
432
|
+
[noa.id, category],
|
|
433
|
+
)
|
|
434
|
+
)[0]?.channels
|
|
435
|
+
const add = (category: string) =>
|
|
436
|
+
s.invoke({
|
|
437
|
+
action: "notifications.setPreference",
|
|
438
|
+
input: { category, channels: ["push"], add: true },
|
|
439
|
+
token: noa.token,
|
|
440
|
+
})
|
|
441
|
+
// Never chose: email (the default) and push.
|
|
442
|
+
expect(await add("approvals.requested")).toMatchObject({ ok: true })
|
|
443
|
+
expect([...(await channelsOf("approvals.requested"))!].sort()).toEqual(["email", "push"])
|
|
444
|
+
// Turned email off: push is added, email stays off.
|
|
445
|
+
await s.invoke({
|
|
446
|
+
action: "notifications.setPreference",
|
|
447
|
+
input: { category: "consent.requested", channels: [] },
|
|
448
|
+
token: noa.token,
|
|
449
|
+
})
|
|
450
|
+
expect(await add("consent.requested")).toMatchObject({ ok: true })
|
|
451
|
+
expect(await channelsOf("consent.requested")).toEqual(["push"])
|
|
452
|
+
// Added again: unchanged.
|
|
453
|
+
await add("consent.requested")
|
|
454
|
+
expect(await channelsOf("consent.requested")).toEqual(["push"])
|
|
455
|
+
})
|
|
456
|
+
})
|
|
457
|
+
|
|
458
|
+
describe("provider answers", () => {
|
|
459
|
+
it("retries an installation that failed without sending again to one that accepted", async () => {
|
|
460
|
+
const xia = await member("xia")
|
|
461
|
+
const ok = s.apns.deviceToken(PUSH_APP)
|
|
462
|
+
const flaky = s.fcm.deviceToken()
|
|
463
|
+
await registerInstallation(s, xia, { provider: "apns", token: ok })
|
|
464
|
+
await registerInstallation(s, xia, { provider: "fcm", token: flaky })
|
|
465
|
+
s.fcm.failNext({ status: 503, errorCode: "UNAVAILABLE" }, { status: 500, errorCode: "INTERNAL" })
|
|
466
|
+
await notify(xia, "partial")
|
|
467
|
+
await fcmGot(flaky, "partial")
|
|
468
|
+
expect(s.apns.deliveredTo(ok).filter((d) => d.payload["aps"].alert.title === "partial")).toHaveLength(1)
|
|
469
|
+
expect(await deliveryOf(xia, "partial")).toMatchObject({ status: "sent", attempts: 3 })
|
|
470
|
+
const states = await s.sql<{ status: string; attempts: number }>(
|
|
471
|
+
`SELECT p.status, p.attempts FROM eloxiv.push_delivery p JOIN eloxiv.push_installation i ON i.id = p.installation_id
|
|
472
|
+
WHERE i.user_id = $1 ORDER BY i.provider`,
|
|
473
|
+
[xia.id],
|
|
474
|
+
)
|
|
475
|
+
expect(states).toEqual([
|
|
476
|
+
{ status: "sent", attempts: 1 },
|
|
477
|
+
{ status: "sent", attempts: 3 },
|
|
478
|
+
])
|
|
479
|
+
})
|
|
480
|
+
|
|
481
|
+
it("never sends again to an installation whose payload was refused while another one retries", async () => {
|
|
482
|
+
const mae = await member("mae")
|
|
483
|
+
const refused = s.apns.deviceToken(PUSH_APP)
|
|
484
|
+
const flaky = s.fcm.deviceToken()
|
|
485
|
+
await registerInstallation(s, mae, { provider: "apns", token: refused })
|
|
486
|
+
await registerInstallation(s, mae, { provider: "fcm", token: flaky })
|
|
487
|
+
const before = s.apns.refusals()
|
|
488
|
+
s.apns.failNext({ status: 400, reason: "BadExpirationDate" })
|
|
489
|
+
s.fcm.failNext({ status: 503, errorCode: "UNAVAILABLE" })
|
|
490
|
+
await notify(mae, "refused once")
|
|
491
|
+
await fcmGot(flaky, "refused once")
|
|
492
|
+
expect(await deliveryOf(mae, "refused once")).toMatchObject({ status: "sent" })
|
|
493
|
+
expect(s.apns.refusals() - before).toBe(1)
|
|
494
|
+
expect(s.apns.deliveredTo(refused)).toEqual([])
|
|
495
|
+
})
|
|
496
|
+
|
|
497
|
+
it("keeps an earlier acceptance when the other installations are gone by the retry", async () => {
|
|
498
|
+
const ned = await member("ned")
|
|
499
|
+
const ok = s.apns.deviceToken(PUSH_APP)
|
|
500
|
+
const flaky = s.fcm.deviceToken()
|
|
501
|
+
await registerInstallation(s, ned, { provider: "apns", token: ok })
|
|
502
|
+
await registerInstallation(s, ned, { provider: "fcm", token: flaky })
|
|
503
|
+
s.fcm.failNext({ status: 503, errorCode: "UNAVAILABLE", retryAfter: "2" })
|
|
504
|
+
await notify(ned, "accepted then gone")
|
|
505
|
+
await apnsGot(ok, "accepted then gone")
|
|
506
|
+
await until(
|
|
507
|
+
"the FCM send to retry",
|
|
508
|
+
() =>
|
|
509
|
+
s.sql(
|
|
510
|
+
`SELECT 1 FROM eloxiv.push_delivery p JOIN eloxiv.push_installation i ON i.id = p.installation_id
|
|
511
|
+
WHERE i.user_id = $1 AND i.provider = 'fcm' AND p.status = 'retrying'`,
|
|
512
|
+
[ned.id],
|
|
513
|
+
),
|
|
514
|
+
(rows) => rows.length > 0,
|
|
515
|
+
)
|
|
516
|
+
await s.signOut(ned)
|
|
517
|
+
expect(await deliveryOf(ned, "accepted then gone")).toMatchObject({ status: "sent" })
|
|
518
|
+
})
|
|
519
|
+
|
|
520
|
+
it("waits the Retry-After from when a slow answer arrived, not from when the send began", async () => {
|
|
521
|
+
const ora = await member("ora")
|
|
522
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
523
|
+
await registerInstallation(s, ora, { provider: "apns", token })
|
|
524
|
+
const before = s.apns.refusals()
|
|
525
|
+
s.apns.failNext({ status: 429, reason: "TooManyRequests", retryAfter: "2", delayMs: 1_500 })
|
|
526
|
+
await notify(ora, "slow throttle")
|
|
527
|
+
await until(
|
|
528
|
+
"the slow throttled answer",
|
|
529
|
+
async () => s.apns.refusals(),
|
|
530
|
+
(n) => n > before,
|
|
531
|
+
)
|
|
532
|
+
const refusedAt = Date.now()
|
|
533
|
+
await apnsGot(token, "slow throttle")
|
|
534
|
+
expect(Date.now() - refusedAt).toBeGreaterThanOrEqual(1_700)
|
|
535
|
+
})
|
|
536
|
+
|
|
537
|
+
it("waits the token endpoint's Retry-After before trying FCM again", async () => {
|
|
538
|
+
const pam = await member("pam")
|
|
539
|
+
const token = s.fcm.deviceToken()
|
|
540
|
+
await registerInstallation(s, pam, { provider: "fcm", token })
|
|
541
|
+
s.fcm.revokeAccessTokens()
|
|
542
|
+
const fetched = s.fcm.tokenRequests()
|
|
543
|
+
s.fcm.failNextToken({ status: 503, retryAfter: "2" })
|
|
544
|
+
await notify(pam, "token throttled")
|
|
545
|
+
await until(
|
|
546
|
+
"the refused token request",
|
|
547
|
+
async () => s.fcm.tokenRequests(),
|
|
548
|
+
(n) => n > fetched,
|
|
549
|
+
)
|
|
550
|
+
const refusedAt = Date.now()
|
|
551
|
+
await fcmGot(token, "token throttled")
|
|
552
|
+
expect(Date.now() - refusedAt).toBeGreaterThanOrEqual(1_700)
|
|
553
|
+
})
|
|
554
|
+
|
|
555
|
+
it("ends the delivery, sending nothing more, when a provider asks to wait longer than a day", async () => {
|
|
556
|
+
const gil = await member("gil")
|
|
557
|
+
const token = s.fcm.deviceToken()
|
|
558
|
+
await registerInstallation(s, gil, { provider: "fcm", token })
|
|
559
|
+
s.fcm.failNext({ status: 503, errorCode: "UNAVAILABLE", retryAfter: "172800" })
|
|
560
|
+
await notify(gil, "two days away")
|
|
561
|
+
expect(await deliveryOf(gil, "two days away")).toMatchObject({
|
|
562
|
+
status: "failed",
|
|
563
|
+
last_error: expect.stringMatching(/longer than a day/u),
|
|
564
|
+
})
|
|
565
|
+
expect(s.fcm.deliveredTo(token)).toEqual([])
|
|
566
|
+
})
|
|
567
|
+
|
|
568
|
+
it("ends only the installation a provider asks to wait longer than a day, keeping another's acceptance", async () => {
|
|
569
|
+
const hal = await member("hal")
|
|
570
|
+
const ok = s.apns.deviceToken(PUSH_APP)
|
|
571
|
+
const later = s.fcm.deviceToken()
|
|
572
|
+
await registerInstallation(s, hal, { provider: "apns", token: ok })
|
|
573
|
+
await registerInstallation(s, hal, { provider: "fcm", token: later })
|
|
574
|
+
s.fcm.failNext({ status: 503, errorCode: "UNAVAILABLE", retryAfter: "172800" })
|
|
575
|
+
await notify(hal, "one of two in two days")
|
|
576
|
+
await apnsGot(ok, "one of two in two days")
|
|
577
|
+
expect(await deliveryOf(hal, "one of two in two days")).toMatchObject({ status: "sent" })
|
|
578
|
+
const states = await s.sql<{ provider: string; status: string; last_error: string | null }>(
|
|
579
|
+
`SELECT i.provider, p.status, p.last_error FROM eloxiv.push_delivery p
|
|
580
|
+
JOIN eloxiv.push_installation i ON i.id = p.installation_id WHERE i.user_id = $1 ORDER BY i.provider`,
|
|
581
|
+
[hal.id],
|
|
582
|
+
)
|
|
583
|
+
expect(states).toEqual([
|
|
584
|
+
{ provider: "apns", status: "sent", last_error: null },
|
|
585
|
+
{ provider: "fcm", status: "failed", last_error: expect.stringMatching(/longer than a day/u) },
|
|
586
|
+
])
|
|
587
|
+
expect(s.fcm.deliveredTo(later)).toEqual([])
|
|
588
|
+
})
|
|
589
|
+
|
|
590
|
+
it("keeps provider-supplied text out of the delivery records", async () => {
|
|
591
|
+
const quy = await member("quy")
|
|
592
|
+
const apnsToken = s.apns.deviceToken(PUSH_APP)
|
|
593
|
+
const fcmToken = s.fcm.deviceToken()
|
|
594
|
+
await registerInstallation(s, quy, { provider: "apns", token: apnsToken })
|
|
595
|
+
await registerInstallation(s, quy, { provider: "fcm", token: fcmToken })
|
|
596
|
+
// A gateway echoing the device token in the provider's error fields.
|
|
597
|
+
s.apns.failNext({ status: 400, reason: `Bad ${apnsToken}` })
|
|
598
|
+
s.fcm.failNext({ status: 400, errorCode: `X_${fcmToken}`, status_: `S_${fcmToken}` })
|
|
599
|
+
await notify(quy, "echoed tokens")
|
|
600
|
+
expect((await deliveryOf(quy, "echoed tokens")).status).toBe("failed")
|
|
601
|
+
for (const table of [
|
|
602
|
+
"eloxiv.push_delivery",
|
|
603
|
+
"eloxiv_notifications.delivery",
|
|
604
|
+
"eloxiv.outbox",
|
|
605
|
+
"eloxiv.outbox_failure",
|
|
606
|
+
]) {
|
|
607
|
+
const [found] = await s.sql<{ n: number }>(
|
|
608
|
+
`SELECT count(*)::int AS n FROM ${table} t WHERE t::text LIKE $1 OR t::text LIKE $2`,
|
|
609
|
+
[`%${apnsToken}%`, `%${fcmToken}%`],
|
|
610
|
+
)
|
|
611
|
+
expect({ table, n: found!.n }).toEqual({ table, n: 0 })
|
|
612
|
+
}
|
|
613
|
+
})
|
|
614
|
+
|
|
615
|
+
it("waits at least the provider's Retry-After before trying again", async () => {
|
|
616
|
+
const yan = await member("yan")
|
|
617
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
618
|
+
await registerInstallation(s, yan, { provider: "apns", token })
|
|
619
|
+
const before = s.apns.refusals()
|
|
620
|
+
s.apns.failNext({ status: 429, reason: "TooManyRequests", retryAfter: "2" })
|
|
621
|
+
await notify(yan, "throttled")
|
|
622
|
+
await until(
|
|
623
|
+
"the throttled answer",
|
|
624
|
+
async () => s.apns.refusals(),
|
|
625
|
+
(n) => n > before,
|
|
626
|
+
)
|
|
627
|
+
const refusedAt = Date.now()
|
|
628
|
+
await apnsGot(token, "throttled")
|
|
629
|
+
expect(Date.now() - refusedAt).toBeGreaterThanOrEqual(1_700)
|
|
630
|
+
expect((await installations(yan))[0]!.invalidated_at).toBeNull()
|
|
631
|
+
})
|
|
632
|
+
|
|
633
|
+
it("retries throttling and outages from both providers, and never blames the device", async () => {
|
|
634
|
+
const zed = await member("zed")
|
|
635
|
+
const apnsToken = s.apns.deviceToken(PUSH_APP)
|
|
636
|
+
const fcmToken = s.fcm.deviceToken()
|
|
637
|
+
await registerInstallation(s, zed, { provider: "apns", token: apnsToken })
|
|
638
|
+
await registerInstallation(s, zed, { provider: "fcm", token: fcmToken })
|
|
639
|
+
s.apns.failNext({ status: 500, reason: "InternalServerError" }, { status: 503, reason: "ServiceUnavailable" })
|
|
640
|
+
// With its Retry-After (without one, FCM's minimum back-off is a minute).
|
|
641
|
+
s.fcm.failNext({ status: 429, errorCode: "QUOTA_EXCEEDED", retryAfter: "1" })
|
|
642
|
+
await notify(zed, "outages")
|
|
643
|
+
await apnsGot(apnsToken, "outages")
|
|
644
|
+
await fcmGot(fcmToken, "outages")
|
|
645
|
+
expect((await installations(zed)).every((i) => i.invalidated_at === null)).toBe(true)
|
|
646
|
+
})
|
|
647
|
+
|
|
648
|
+
it("treats the deployment's refused credentials as retryable, not as a dead device", async () => {
|
|
649
|
+
const amy = await member("amy")
|
|
650
|
+
const apnsToken = s.apns.deviceToken(PUSH_APP)
|
|
651
|
+
const fcmToken = s.fcm.deviceToken()
|
|
652
|
+
await registerInstallation(s, amy, { provider: "apns", token: apnsToken })
|
|
653
|
+
await registerInstallation(s, amy, { provider: "fcm", token: fcmToken })
|
|
654
|
+
s.apns.failNext({ status: 403, reason: "ExpiredProviderToken" })
|
|
655
|
+
s.fcm.revokeAccessTokens()
|
|
656
|
+
const fetched = s.fcm.tokenRequests()
|
|
657
|
+
await notify(amy, "credentials")
|
|
658
|
+
await apnsGot(apnsToken, "credentials")
|
|
659
|
+
await fcmGot(fcmToken, "credentials")
|
|
660
|
+
expect(s.fcm.tokenRequests()).toBeGreaterThan(fetched)
|
|
661
|
+
expect((await installations(amy)).every((i) => i.invalidated_at === null)).toBe(true)
|
|
662
|
+
})
|
|
663
|
+
|
|
664
|
+
it("invalidates an installation whose token the provider says is dead, then sends it nothing", async () => {
|
|
665
|
+
const ben = await member("ben")
|
|
666
|
+
const dead = s.fcm.deviceToken()
|
|
667
|
+
const deadApns = s.apns.deviceToken(PUSH_APP)
|
|
668
|
+
await registerInstallation(s, ben, { provider: "fcm", token: dead })
|
|
669
|
+
await registerInstallation(s, ben, { provider: "apns", token: deadApns })
|
|
670
|
+
s.fcm.kill(dead)
|
|
671
|
+
s.apns.kill(deadApns)
|
|
672
|
+
await notify(ben, "to dead tokens")
|
|
673
|
+
expect((await deliveryOf(ben, "to dead tokens")).status).toBe("failed")
|
|
674
|
+
expect((await installations(ben)).every((i) => i.invalidated_at !== null)).toBe(true)
|
|
675
|
+
const refusals = s.apns.refusals()
|
|
676
|
+
await notify(ben, "after invalidation")
|
|
677
|
+
expect((await deliveryOf(ben, "after invalidation")).last_error).toMatch(/no push installation/iu)
|
|
678
|
+
expect(s.apns.refusals()).toBe(refusals)
|
|
679
|
+
})
|
|
680
|
+
|
|
681
|
+
it("leaves an installation alone when its token changed while the provider called the old one dead", async () => {
|
|
682
|
+
const cai = await member("cai")
|
|
683
|
+
const old = s.apns.deviceToken(PUSH_APP)
|
|
684
|
+
const { installationId } = await registerInstallation(s, cai, { provider: "apns", token: old })
|
|
685
|
+
s.apns.kill(old)
|
|
686
|
+
const fresh = s.apns.deviceToken(PUSH_APP)
|
|
687
|
+
// The app registers its new token while APNs is still answering for the old one.
|
|
688
|
+
s.apns.beforeNextAnswer(async () => {
|
|
689
|
+
await registerInstallation(s, cai, { provider: "apns", token: fresh, installationId })
|
|
690
|
+
})
|
|
691
|
+
await notify(cai, "during rotation")
|
|
692
|
+
await deliveryOf(cai, "during rotation")
|
|
693
|
+
expect(await installations(cai)).toMatchObject([{ token: fresh, invalidated_at: null }])
|
|
694
|
+
await notify(cai, "after rotation race")
|
|
695
|
+
await apnsGot(fresh, "after rotation race")
|
|
696
|
+
})
|
|
697
|
+
|
|
698
|
+
it("ignores a dead-token answer about an older registration of the token", async () => {
|
|
699
|
+
const rex = await member("rex")
|
|
700
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
701
|
+
const { installationId } = await registerInstallation(s, rex, { provider: "apns", token })
|
|
702
|
+
// APNs confirmed the token invalid a minute before this registration: the registration is newer.
|
|
703
|
+
s.apns.failNext({ status: 410, reason: "Unregistered", timestamp: Date.now() - 60_000 })
|
|
704
|
+
await notify(rex, "stale verdict")
|
|
705
|
+
await deliveryOf(rex, "stale verdict")
|
|
706
|
+
expect((await installations(rex))[0]!.invalidated_at).toBeNull()
|
|
707
|
+
// The app corrects the same token's registration (its environment) while APNs answers for the old one.
|
|
708
|
+
const sentAt = Date.now() - 1_000
|
|
709
|
+
s.apns.beforeNextAnswer(async () => {
|
|
710
|
+
await registerInstallation(s, rex, { provider: "apns", token, installationId, environment: "sandbox" })
|
|
711
|
+
})
|
|
712
|
+
s.apns.failNext({ status: 410, reason: "Unregistered", timestamp: sentAt })
|
|
713
|
+
await notify(rex, "corrected meanwhile")
|
|
714
|
+
await deliveryOf(rex, "corrected meanwhile")
|
|
715
|
+
expect((await installations(rex))[0]!.invalidated_at).toBeNull()
|
|
716
|
+
await notify(rex, "after the correction")
|
|
717
|
+
await apnsGot(token, "after the correction")
|
|
718
|
+
})
|
|
719
|
+
|
|
720
|
+
it("dates a first registration that waited for a lock by its write, not by when it began", async () => {
|
|
721
|
+
const kit = await member("kit")
|
|
722
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
723
|
+
const digest = [...new Uint8Array(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(token)))]
|
|
724
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
|
725
|
+
.join("")
|
|
726
|
+
// Another registration of the same token holds its lock until the gate opens.
|
|
727
|
+
await s.sql(`CREATE TABLE public.install_gate (open boolean NOT NULL)`)
|
|
728
|
+
let holder: Promise<unknown> | undefined
|
|
729
|
+
try {
|
|
730
|
+
await s.sql(`INSERT INTO public.install_gate VALUES (false)`)
|
|
731
|
+
holder = s.sql(`DO $$ BEGIN
|
|
732
|
+
PERFORM pg_advisory_xact_lock(hashtextextended('eloxiv.push-token:apns:${digest}', 0));
|
|
733
|
+
FOR i IN 1..600 LOOP
|
|
734
|
+
EXIT WHEN (SELECT open FROM public.install_gate);
|
|
735
|
+
PERFORM pg_sleep(0.05);
|
|
736
|
+
END LOOP;
|
|
737
|
+
END $$`)
|
|
738
|
+
await until(
|
|
739
|
+
"the token's lock held",
|
|
740
|
+
() => s.sql(`SELECT 1 FROM pg_stat_activity WHERE datname = current_database() AND wait_event = 'PgSleep'`),
|
|
741
|
+
(rows) => rows.length > 0,
|
|
742
|
+
)
|
|
743
|
+
const registered = registerInstallation(s, kit, { provider: "apns", token })
|
|
744
|
+
const [waiting] = await until(
|
|
745
|
+
"the registration waiting for the token's lock",
|
|
746
|
+
() =>
|
|
747
|
+
s.sql<{ began: string }>(`SELECT (extract(epoch FROM xact_start) * 1000)::text AS began
|
|
748
|
+
FROM pg_stat_activity WHERE datname = current_database() AND wait_event_type = 'Lock'
|
|
749
|
+
AND wait_event = 'advisory'`),
|
|
750
|
+
(rows) => rows.length > 0,
|
|
751
|
+
)
|
|
752
|
+
// APNs confirmed the token invalid after the registration began and before it was written.
|
|
753
|
+
const verdict = Number(waiting!.began) + 100
|
|
754
|
+
await new Promise((resolve) => setTimeout(resolve, 300))
|
|
755
|
+
await s.sql(`UPDATE public.install_gate SET open = true`)
|
|
756
|
+
expect((await registered).outcome).toMatchObject({ ok: true })
|
|
757
|
+
s.apns.failNext({ status: 410, reason: "Unregistered", timestamp: verdict })
|
|
758
|
+
await notify(kit, "verdict before the write")
|
|
759
|
+
await deliveryOf(kit, "verdict before the write")
|
|
760
|
+
expect((await installations(kit))[0]!.invalidated_at).toBeNull()
|
|
761
|
+
} finally {
|
|
762
|
+
await s.sql(`UPDATE public.install_gate SET open = true`).catch(() => undefined)
|
|
763
|
+
await holder?.catch(() => undefined)
|
|
764
|
+
await s.sql(`DROP TABLE IF EXISTS public.install_gate`)
|
|
765
|
+
}
|
|
766
|
+
})
|
|
767
|
+
|
|
768
|
+
it("lets a 410 without a usable timestamp invalidate only the registration it was sent to", async () => {
|
|
769
|
+
for (const timestamp of [null, "yesterday"] as const) {
|
|
770
|
+
const ash = await member("ash")
|
|
771
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
772
|
+
const { installationId } = await registerInstallation(s, ash, { provider: "apns", token })
|
|
773
|
+
// The app registers the same token again, unchanged, while APNs answers for the send.
|
|
774
|
+
s.apns.beforeNextAnswer(async () => {
|
|
775
|
+
await registerInstallation(s, ash, { provider: "apns", token, installationId })
|
|
776
|
+
})
|
|
777
|
+
s.apns.failNext({ status: 410, reason: "Unregistered", timestamp })
|
|
778
|
+
await notify(ash, `undated ${timestamp}`)
|
|
779
|
+
await deliveryOf(ash, `undated ${timestamp}`)
|
|
780
|
+
expect({ timestamp, invalidated: (await installations(ash))[0]!.invalidated_at }).toEqual({
|
|
781
|
+
timestamp,
|
|
782
|
+
invalidated: null,
|
|
783
|
+
})
|
|
784
|
+
// Without a registration since, the registration that was sent is invalidated.
|
|
785
|
+
s.apns.failNext({ status: 410, reason: "Unregistered", timestamp })
|
|
786
|
+
await notify(ash, `undated again ${timestamp}`)
|
|
787
|
+
await deliveryOf(ash, `undated again ${timestamp}`)
|
|
788
|
+
expect((await installations(ash))[0]!.invalidated_at).not.toBeNull()
|
|
789
|
+
}
|
|
790
|
+
})
|
|
791
|
+
|
|
792
|
+
it("fails only the installation whose payload the provider refuses, without invalidating it", async () => {
|
|
793
|
+
const dee = await member("dee")
|
|
794
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
795
|
+
const fcmToken = s.fcm.deviceToken()
|
|
796
|
+
await registerInstallation(s, dee, { provider: "apns", token })
|
|
797
|
+
await registerInstallation(s, dee, { provider: "fcm", token: fcmToken })
|
|
798
|
+
s.apns.failNext({ status: 400, reason: "BadExpirationDate" })
|
|
799
|
+
s.fcm.failNext({ status: 403, errorCode: "SENDER_ID_MISMATCH" })
|
|
800
|
+
await notify(dee, "refused payload")
|
|
801
|
+
expect(await deliveryOf(dee, "refused payload")).toMatchObject({ status: "failed", attempts: 1 })
|
|
802
|
+
expect((await installations(dee)).every((i) => i.invalidated_at === null)).toBe(true)
|
|
803
|
+
})
|
|
804
|
+
|
|
805
|
+
it("moves to a new connection after APNs sends GOAWAY", async () => {
|
|
806
|
+
const eve = await member("eve")
|
|
807
|
+
const token = s.apns.deviceToken(PUSH_APP)
|
|
808
|
+
await registerInstallation(s, eve, { provider: "apns", token })
|
|
809
|
+
await notify(eve, "before goaway")
|
|
810
|
+
await apnsGot(token, "before goaway")
|
|
811
|
+
const connections = s.apns.connections()
|
|
812
|
+
s.apns.goawayNext(1)
|
|
813
|
+
await notify(eve, "goaway answer")
|
|
814
|
+
await apnsGot(token, "goaway answer")
|
|
815
|
+
await notify(eve, "after goaway")
|
|
816
|
+
await apnsGot(token, "after goaway")
|
|
817
|
+
expect(s.apns.connections()).toBeGreaterThan(connections)
|
|
818
|
+
})
|
|
819
|
+
})
|
|
820
|
+
})
|