primcli 3.0.0-preview.7 → 3.0.0-preview.8
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/dist/{api-command-BXYpylbG.js → api-command-TUwewvqZ.js} +2030 -108
- package/dist/{machine-session-YQWxPePp.js → machine-session-DNnNhhFr.js} +4 -4
- package/dist/{notify-session-Bm59oy4j.js → notify-session-CeIflLIX.js} +2 -2
- package/dist/oclif/auto-signal-worker.js +3 -3
- package/dist/oclif/auto-signals.js +1 -1
- package/dist/oclif/index.js +780 -35
- package/dist/oclif/receiver-heal.js +2 -2
- package/dist/{repeats-Dj_o6c-X-C6tOKAqk.js → repeats-Dj_o6c-X-DNbrLjEF.js} +26 -8
- package/dist/{scoped-chat-GItY2PvL.js → scoped-chat-Dd3P8Q-m.js} +1 -1
- package/dist/{signal-command-CvEDx8qQ.js → signal-command-DZQemE9I.js} +4 -4
- package/package.json +1 -1
package/dist/oclif/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { $ as readEmailInteraction, A as explainPendingMailNotFound, At as cliInvocation, Bt as formatAlreadySentNotice, C as promptLine$2, Ct as sendOutcomeExitCode, D as formatBrowserLoginInstructions, Dt as successfulSendOutcome, E as canOfferCopyHotkey, Et as serializeErrorPayload, F as latestOwnOutbound, Ft as loadSkillLine, G as clearConsumedPendingMail, Gt as classificationFactLines, H as wakeRecipientField, Ht as emptyEmailListHint, I as readThreadContext, It as currentMailSessionKey, J as readPendingMail, Jt as noFactsMessage, K as clearReadPendingMail, Kt as classificationOf, L as sentInThread, Lt as detectAgentRuntime, M as describeWake, N as displayAddress, Nt as generatedAgentName, O as listenForCopyHotkey, Ot as thrownErrorExitCode, P as formatMailWakeLine, Pt as identitySuggestions, Q as interactionNextActions, Qt as ConnectedAgentKeyRequiredError, R as serverMuted, Rt as detectRuntimeSession, S as approveThenRerunHint, St as sendIdentityFields, T as withApproval, Tt as sentHistoryWindowStart, U as wakeRelationship, Ut as mailReach, V as wakeReadCommand, Vt as withFlagSuggestion, W as claimPendingMail, Wt as readCallerMailFor, X as removePendingMail, Xt as ATTACHMENT_WAIT_MAX_MS, Y as recordPendingMail, Yt as ATTACHMENT_WAIT_FLAG_DESCRIPTION, Z as interactionHumanLine, Zt as withAttachmentWait, _ as takesStepUp, _n as setKnownCommands, _t as formatPriorRepliesWarning, a as createOperationCommand, an as selectedOrgFromEnv, at as SEND_OUTCOME_HELP, b as STEP_UP_HEADER$1, bt as priorRepliesThatWentOut, c as formatErrorPayload, cn as credentialsFromUserLogin, ct as buildFollowUpCommand, d as isGrantRefusal, dn as revokeUserLogin, dt as classifySendError, en as createAuthenticatedCliApiClient, et as replyExpectation, f as parameterFlagName, fn as roleKeyLabel, ft as deriveSendIdempotencyKey, g as surfaceUnauthorizedHint, gn as sanitizeForTerminal, gt as formatPriorRepliesCheckSkipped, h as runWithTiming, hn as routeWarningLines, ht as formatDeletedEarlierSendNotice, i as TIME_FLAG_DESCRIPTION, in as resolveCliApiRequestConfig, it as MAX_SEND_WAIT_TIMEOUT_MS, j as bareAddress, jt as connectNextSteps, k as openBrowser, l as hasControlCharacter$1, ln as fetchCliOrgs, lt as buildThrownSendFailureEnvelope, m as refusalDetails, mn as switchCurrentOrg, mt as followUpCommandPrefix, n as API_ERROR_CODES, nn as refreshStoredCliCredentials, o as extractErrorCode, on as CliOrgRefusedError, ot as apiResultHttpStatus, p as readTextFileFlag, pn as roleKeyText, pt as excludeSignalReplies, q as pendingMailPath, qt as isEmailId, r as OPERATION_PATH_FLAGS, rn as refuseOrgSelectionForProfile, rt as IDEMPOTENCY_KEY_FLAG_DESCRIPTION, s as extractErrorPayload, sn as RESTRICTED_ROLE_NOTE, st as assertValidIdempotencyKey, t as API_BASE_URL_FLAG_DESCRIPTION, tn as createCliApiClient, tt as replyInteractionWarning, u as headerFlagName, un as isBuiltInRoleKey, ut as checkPriorReplies, v as writeErrorWithHints, vn as operationManifest, vt as formatSendFailureSummary, w as terminalApprovalIo, wt as sendWaitClampNotice, x as STEP_UP_TOKEN_FLAG_DESCRIPTION, xt as reportSendCommandResult, y as BROWSER_FLAG_DESCRIPTION, yt as formatSendRecordFailureSummary, z as serverRelationship, zt as runtimeSessionVariableList } from "../api-command-
|
|
2
|
-
import { $ as parseFromHeader, $n as startAgentClaim, $t as getSendFrom, A as lateMailReread, An as listWakeSchedules, At as downloadEmailAttachmentArchiveMember, B as ensureSearchReportsReplyState, Bn as resendAgentSignupVerification, Bt as getCreditBalance, C as waitOutRetryAfter, Cn as listRepeatingSends, Ct as createWakeSchedule, D as encodeReceivedAtSearchCursor, Dn as listSentEmails, Dt as deleteRoute, E as cursorFromAcceptedRows, En as listSentAttachmentArchiveMembers, Et as deleteMemory, F as AWAITING_VALUES, Ft as getAccessMode, G as queryUsesAwaiting, Gn as searchEmails, Gt as getFunctionTestRunTrace, H as formatRepliesCell, Hn as rotateKey, Ht as getEmail, I as REPLY_STATE_UNSUPPORTED_CODE, In as redeemCreditCode, It as getAccount, Jn as sendEmail, Jt as getMemory, Kn as searchMemories, Kt as getInboxStatus, L as ReplyStateUnsupportedError, Ln as removeDefaultNetworkMember, Lt as getAgentContactPolicy, M as sinceFromFlags, Mn as pullWebhookEvent, N as sleep$3, Nt as downloadSentAttachmentArchiveMember, O as fetchEmailSearchPage, On as listWakeAuthorizations, Ot as deleteWakeAuthorization, P as AWAITING_FLAG_DESCRIPTION, Pt as downloadSentAttachmentByFilename, Q as parseWebhookEvent, Qn as simulateRoute, Qt as getRepeatingSend, R as assertAwaitingFilterRows, Rn as reorderRoutes, S as transientFailure, Sn as listOrganizationPeople, St as createWakeAuthorization, T as collectNewAcceptedEmails, Tn as listRoutes, U as hasReplyState, Un as runWakeSchedule, Ut as getFunction, V as formatAwaitingCell, Vn as revokeCredential, Vt as getDefaultNetworkAgent, W as isAwaitingRejectedError, Wt as getFunctionRouting, X as isEmailReceivedEvent, Xn as setFunctionSecret, Xt as getOutboundStatus, Yn as setFunctionRoute, Yt as getOrgRoutingTopology, Zn as setMemory, Zt as getOwnGrant, _ as describeApiFailure, _n as listFunctionLogs, _t as completeWebhookEvent, a as REPEAT_IDLE_MAX_MINUTES, an as listActivityObjects, ar as updateDefaultNetworkMember, at as automatedRejectedError, b as retryTransient, bn as listKeys, bt as createKey, cn as listAgentNetworks, cr as updateRepeatingSend, d as parseRepeatTick, dn as listDefaultNetworkMembers, dr as updateWakeSchedule, dt as addDefaultNetworkMember, en as getSentEmail, er as startAgentSignup, et as AUTOMATED_FILTER_UNSUPPORTED_CODE, f as preparePresenceAliveEmail, fn as listDomains, fr as verifyAgentClaim, ft as cancelSentEmail, g as WaitDeadlineReached, gn as listEndpoints, gt as cliLogout, hn as listEmails, ht as checkSendability, i as REPEAT_EVERY_MAX_MINUTES, in as leaveOrganization, ir as unsetFunctionRoute, it as assertAutomatedVerdict, j as quoteDslValue, jn as pollCliLogin, jt as downloadEmailAttachmentByFilename, k as filtersFromFlags, kn as listWakeDispatches, kt as deleteWakeSchedule, l as parseInteractionEnvelope, lr as updateRoute, lt as hasAutomatedVerdict, m as repeatStopCommand, mn as listEmailRuleResults, mr as whoami, mt as checkDefaultNetworkContactAdmission, nn as getWakeSchedule, nr as stopRepeatFromEmail, nt as AUTOMATED_VALUES, o as REPEAT_MAX_SENDS_MAX, or as updateFunction, p as prepareSignalEmail, pn as listEmailAttachmentArchiveMembers, pr as verifyAgentSignup, pt as cancelSentEmailByIdempotencyKey, qn as semanticSearch, qt as getKey, rr as testFunction, rt as AutomatedFilterUnsupportedError, s as buildRepeatStopBody, sn as listAgentContacts, sr as updateKey, tn as getThread, tr as startCliLogin, tt as AUTOMATED_FLAG_DESCRIPTION, u as parsePresenceEnvelope, un as listDefaultNetworkAgents, ur as updateWakeAuthorization, ut as isAutomatedRejectedError, vn as listFunctions, vt as createEndpoint, w as SINCE_VALUE_HELP, wn as listRoles, x as retryingOperation, xn as listMailboxAccess, xt as createRoute, y as pauseForTransientFailure, yn as listGroups, yt as createFunction, z as awaitingRejectedError, zn as replyToEmail, zt as getConversation } from "../repeats-Dj_o6c-X-
|
|
3
|
-
import { S as readBundledConnectSkill, _ as NotificationOutcomeUnknownError, a as NotificationRetryError, b as installedConnectSkillFile, c as readConversationStatusContent, d as SESSION_UUID$1, g as NativeSessionNotLoadedError, h as NativeSessionError, i as notificationReceiptPage, l as createListenHandler, m as NativeSessionDisconnectedError, n as notificationSenders, o as isRoutineNotificationContent, p as defaultSessionSocket, r as openSessionNotifications, s as notificationPartReader, t as notificationScope, u as readableDelivery, v as connectSkillTarget, x as installedVersion, y as installConnectSkill } from "../notify-session-
|
|
1
|
+
import { $ as readEmailInteraction, A as explainPendingMailNotFound, At as cliInvocation, Bt as formatAlreadySentNotice, C as promptLine$2, Ct as sendOutcomeExitCode, D as formatBrowserLoginInstructions, Dt as successfulSendOutcome, E as canOfferCopyHotkey, Et as serializeErrorPayload, F as latestOwnOutbound, Ft as loadSkillLine, G as clearConsumedPendingMail, Gt as classificationFactLines, H as wakeRecipientField, Ht as emptyEmailListHint, I as readThreadContext, It as currentMailSessionKey, J as readPendingMail, Jt as noFactsMessage, K as clearReadPendingMail, Kt as classificationOf, L as sentInThread, Lt as detectAgentRuntime, M as describeWake, N as displayAddress, Nt as generatedAgentName, O as listenForCopyHotkey, Ot as thrownErrorExitCode, P as formatMailWakeLine, Pt as identitySuggestions, Q as interactionNextActions, Qt as ConnectedAgentKeyRequiredError, R as serverMuted, Rt as detectRuntimeSession, S as approveThenRerunHint, St as sendIdentityFields, T as withApproval, Tt as sentHistoryWindowStart, U as wakeRelationship, Ut as mailReach, V as wakeReadCommand, Vt as withFlagSuggestion, W as claimPendingMail, Wt as readCallerMailFor, X as removePendingMail, Xt as ATTACHMENT_WAIT_MAX_MS, Y as recordPendingMail, Yt as ATTACHMENT_WAIT_FLAG_DESCRIPTION, Z as interactionHumanLine, Zt as withAttachmentWait, _ as takesStepUp, _n as setKnownCommands, _t as formatPriorRepliesWarning, a as createOperationCommand, an as selectedOrgFromEnv, at as SEND_OUTCOME_HELP, b as STEP_UP_HEADER$1, bt as priorRepliesThatWentOut, c as formatErrorPayload, cn as credentialsFromUserLogin, ct as buildFollowUpCommand, d as isGrantRefusal, dn as revokeUserLogin, dt as classifySendError, en as createAuthenticatedCliApiClient, et as replyExpectation, f as parameterFlagName, fn as roleKeyLabel, ft as deriveSendIdempotencyKey, g as surfaceUnauthorizedHint, gn as sanitizeForTerminal, gt as formatPriorRepliesCheckSkipped, h as runWithTiming, hn as routeWarningLines, ht as formatDeletedEarlierSendNotice, i as TIME_FLAG_DESCRIPTION, in as resolveCliApiRequestConfig, it as MAX_SEND_WAIT_TIMEOUT_MS, j as bareAddress, jt as connectNextSteps, k as openBrowser, l as hasControlCharacter$1, ln as fetchCliOrgs, lt as buildThrownSendFailureEnvelope, m as refusalDetails, mn as switchCurrentOrg, mt as followUpCommandPrefix, n as API_ERROR_CODES, nn as refreshStoredCliCredentials, o as extractErrorCode, on as CliOrgRefusedError, ot as apiResultHttpStatus, p as readTextFileFlag, pn as roleKeyText, pt as excludeSignalReplies, q as pendingMailPath, qt as isEmailId, r as OPERATION_PATH_FLAGS, rn as refuseOrgSelectionForProfile, rt as IDEMPOTENCY_KEY_FLAG_DESCRIPTION, s as extractErrorPayload, sn as RESTRICTED_ROLE_NOTE, st as assertValidIdempotencyKey, t as API_BASE_URL_FLAG_DESCRIPTION, tn as createCliApiClient, tt as replyInteractionWarning, u as headerFlagName, un as isBuiltInRoleKey, ut as checkPriorReplies, v as writeErrorWithHints, vn as operationManifest, vt as formatSendFailureSummary, w as terminalApprovalIo, wt as sendWaitClampNotice, x as STEP_UP_TOKEN_FLAG_DESCRIPTION, xt as reportSendCommandResult, y as BROWSER_FLAG_DESCRIPTION, yt as formatSendRecordFailureSummary, z as serverRelationship, zt as runtimeSessionVariableList } from "../api-command-TUwewvqZ.js";
|
|
2
|
+
import { $ as parseFromHeader, $n as startAgentClaim, $t as getSendFrom, A as lateMailReread, An as listWakeSchedules, At as downloadEmailAttachmentArchiveMember, B as ensureSearchReportsReplyState, Bn as resendAgentSignupVerification, Bt as getCreditBalance, C as waitOutRetryAfter, Cn as listRepeatingSends, Ct as createWakeSchedule, D as encodeReceivedAtSearchCursor, Dn as listSentEmails, Dt as deleteRoute, E as cursorFromAcceptedRows, En as listSentAttachmentArchiveMembers, Et as deleteMemory, F as AWAITING_VALUES, Ft as getAccessMode, G as queryUsesAwaiting, Gn as searchEmails, Gt as getFunctionTestRunTrace, H as formatRepliesCell, Hn as rotateKey, Ht as getEmail, I as REPLY_STATE_UNSUPPORTED_CODE, In as redeemCreditCode, It as getAccount, Jn as sendEmail, Jt as getMemory, Kn as searchMemories, Kt as getInboxStatus, L as ReplyStateUnsupportedError, Ln as removeDefaultNetworkMember, Lt as getAgentContactPolicy, M as sinceFromFlags, Mn as pullWebhookEvent, N as sleep$3, Nt as downloadSentAttachmentArchiveMember, O as fetchEmailSearchPage, On as listWakeAuthorizations, Ot as deleteWakeAuthorization, P as AWAITING_FLAG_DESCRIPTION, Pt as downloadSentAttachmentByFilename, Q as parseWebhookEvent, Qn as simulateRoute, Qt as getRepeatingSend, R as assertAwaitingFilterRows, Rn as reorderRoutes, S as transientFailure, Sn as listOrganizationPeople, St as createWakeAuthorization, T as collectNewAcceptedEmails, Tn as listRoutes, U as hasReplyState, Un as runWakeSchedule, Ut as getFunction, V as formatAwaitingCell, Vn as revokeCredential, Vt as getDefaultNetworkAgent, W as isAwaitingRejectedError, Wt as getFunctionRouting, X as isEmailReceivedEvent, Xn as setFunctionSecret, Xt as getOutboundStatus, Yn as setFunctionRoute, Yt as getOrgRoutingTopology, Zn as setMemory, Zt as getOwnGrant, _ as describeApiFailure, _n as listFunctionLogs, _t as completeWebhookEvent, a as REPEAT_IDLE_MAX_MINUTES, an as listActivityObjects, ar as updateDefaultNetworkMember, at as automatedRejectedError, b as retryTransient, bn as listKeys, bt as createKey, cn as listAgentNetworks, cr as updateRepeatingSend, d as parseRepeatTick, dn as listDefaultNetworkMembers, dr as updateWakeSchedule, dt as addDefaultNetworkMember, en as getSentEmail, er as startAgentSignup, et as AUTOMATED_FILTER_UNSUPPORTED_CODE, f as preparePresenceAliveEmail, fn as listDomains, fr as verifyAgentClaim, ft as cancelSentEmail, g as WaitDeadlineReached, gn as listEndpoints, gt as cliLogout, hn as listEmails, ht as checkSendability, i as REPEAT_EVERY_MAX_MINUTES, in as leaveOrganization, ir as unsetFunctionRoute, it as assertAutomatedVerdict, j as quoteDslValue, jn as pollCliLogin, jt as downloadEmailAttachmentByFilename, k as filtersFromFlags, kn as listWakeDispatches, kt as deleteWakeSchedule, l as parseInteractionEnvelope, lr as updateRoute, lt as hasAutomatedVerdict, m as repeatStopCommand, mn as listEmailRuleResults, mr as whoami, mt as checkDefaultNetworkContactAdmission, nn as getWakeSchedule, nr as stopRepeatFromEmail, nt as AUTOMATED_VALUES, o as REPEAT_MAX_SENDS_MAX, or as updateFunction, p as prepareSignalEmail, pn as listEmailAttachmentArchiveMembers, pr as verifyAgentSignup, pt as cancelSentEmailByIdempotencyKey, qn as semanticSearch, qt as getKey, rr as testFunction, rt as AutomatedFilterUnsupportedError, s as buildRepeatStopBody, sn as listAgentContacts, sr as updateKey, tn as getThread, tr as startCliLogin, tt as AUTOMATED_FLAG_DESCRIPTION, u as parsePresenceEnvelope, un as listDefaultNetworkAgents, ur as updateWakeAuthorization, ut as isAutomatedRejectedError, vn as listFunctions, vt as createEndpoint, w as SINCE_VALUE_HELP, wn as listRoles, x as retryingOperation, xn as listMailboxAccess, xt as createRoute, y as pauseForTransientFailure, yn as listGroups, yt as createFunction, z as awaitingRejectedError, zn as replyToEmail, zt as getConversation } from "../repeats-Dj_o6c-X-DNbrLjEF.js";
|
|
3
|
+
import { S as readBundledConnectSkill, _ as NotificationOutcomeUnknownError, a as NotificationRetryError, b as installedConnectSkillFile, c as readConversationStatusContent, d as SESSION_UUID$1, g as NativeSessionNotLoadedError, h as NativeSessionError, i as notificationReceiptPage, l as createListenHandler, m as NativeSessionDisconnectedError, n as notificationSenders, o as isRoutineNotificationContent, p as defaultSessionSocket, r as openSessionNotifications, s as notificationPartReader, t as notificationScope, u as readableDelivery, v as connectSkillTarget, x as installedVersion, y as installConnectSkill } from "../notify-session-CeIflLIX.js";
|
|
4
4
|
import { A as AGENT_ADDRESS_ENV, C as saveCliCredentials, D as loadActiveChatState, E as deleteChatState, F as agentProfilesDirectory, H as requireDefaultLoginProfile, M as AgentConnectionSetupError, N as agentProfileDirectory, O as loadChatConversationByLocalId, P as agentProfileName, R as loadConnectedAgentProfile, S as resolveCliAuth, T as chatStatePath, W as PrimitiveApiClient, _ as deleteCliCredentials, a as normalizeCliEnvironmentName, b as loadCliCredentials, c as resolveConfigEnvironment, g as credentialsPath, h as credentialsLockPath, i as loadCliConfig, j as AGENT_PROFILE_ENV, k as saveActiveChatState, l as saveCliConfig, m as cliAccessTokenExpiresAt, n as deleteCliConfig, o as redactCliEnvironment, p as acquireCliCredentialsLock, r as emptyCliConfig, s as removeCliEnvironment, u as upsertCliEnvironment, v as deleteCliCredentialsLock, w as saveSignupCredentials, y as detectPrimitiveKeyEnvMisname } from "../cli-config-Ms_0vNjq.js";
|
|
5
5
|
import { C as resolveListenSubscription, S as normalizeListenOrigin, _ as acquireListenLock, a as mailLockBusy, c as mailTime, d as readMailJson, f as removeMailFile, g as ListenStateError, h as writeMailJson, i as mailId, l as privateMailDirectory, m as withMailLock, o as mailObject, u as privateMailPermissions, y as listenIdentity } from "../shared-mail-files-BAQSGxxz.js";
|
|
6
|
-
import { $ as saveConnectionName, A as ContactPolicyReadRetryError, B as AddressNotesApiError, C as RECEIVER_MODES, Ct as upsertManagedBlock, D as registrationSummary, Dt as refreshOwnerMemberAddressPeriodically, E as failedSessionRegistration, Et as addSessionReceiver, F as canonicalContactSelector, G as contactAgentAddress, H as runAddressNotesRequest, I as AgentDisconnectError, J as agentInvitationHash, K as runContactRequest, L as claimOverRevokedSetup, M as NetworkAdmissionPendingError, N as createNotificationContactPolicy, O as registrationSummaryLine, Ot as withOwnerMemberAddress, P as evaluateContactPolicy, Q as refusalAfterReplacement, R as clearRevokedAddresses, S as runAgentConnect, St as readManagedFile, T as verificationReplySubmitted, Tt as readHookLauncherWarning, U as ContactsApiError, V as addressNoteTarget, W as contactAddress, X as readAgentInvitation, Y as connectAgent, Z as receiverStatusCommand, _ as enrollmentResumes, _t as samePath, a as endSession, at as boundSessionProfiles, b as invitationProfileName, bt as inspectManagedBlock, c as pendingSessionDisconnects, ct as describeSessionHookChange, d as registerSession, dt as ephemeralCliReason, et as savedReceiver, f as retryPendingDisconnects, ft as findOnPath, g as enrollAgent, gt as repairClaudeHooks, h as staleSessionAgents, ht as readClaudeSettings, i as connectedProfilesForSession, it as recordHookMailCheck, j as NETWORK_ADMISSION_PENDING_RETRY_MS, k as waitForRegistrations, l as psProcessInfo, lt as describeSessionHookItem, m as runDetached, mt as inspectClaudeHooks, n as OMP_MAIN, nt as releaseRegistrationsForProfile, o as headlessClaudeRun, ot as claudeConfigDir, p as revokeStaleSessionAgents, pt as hasMachineSessionHooks, q as agentConnectionStatus, r as agentConnectionState, rt as installClaudeWakeHook, st as currentCliLocation, t as HOOK_END_GRACE_MS, tt as MACHINE_RUNTIMES, u as readClaudeHookInput, ut as ensureHookLauncher, v as connectWarnings, vt as writeClaudeSettings, w as externalReceivingState, wt as writeManagedFile, x as pollCheckCommand, xt as jsonIndentation, y as defaultAgentProfileName, yt as MachineFileError, z as disconnectAgent } from "../machine-session-
|
|
7
|
-
import { a as readBeforeDeadline, c as readPresenceProjection, i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust, r as isScopedChatReply, s as presenceDisposition, t as isConnectedChatCredential } from "../scoped-chat-
|
|
6
|
+
import { $ as saveConnectionName, A as ContactPolicyReadRetryError, B as AddressNotesApiError, C as RECEIVER_MODES, Ct as upsertManagedBlock, D as registrationSummary, Dt as refreshOwnerMemberAddressPeriodically, E as failedSessionRegistration, Et as addSessionReceiver, F as canonicalContactSelector, G as contactAgentAddress, H as runAddressNotesRequest, I as AgentDisconnectError, J as agentInvitationHash, K as runContactRequest, L as claimOverRevokedSetup, M as NetworkAdmissionPendingError, N as createNotificationContactPolicy, O as registrationSummaryLine, Ot as withOwnerMemberAddress, P as evaluateContactPolicy, Q as refusalAfterReplacement, R as clearRevokedAddresses, S as runAgentConnect, St as readManagedFile, T as verificationReplySubmitted, Tt as readHookLauncherWarning, U as ContactsApiError, V as addressNoteTarget, W as contactAddress, X as readAgentInvitation, Y as connectAgent, Z as receiverStatusCommand, _ as enrollmentResumes, _t as samePath, a as endSession, at as boundSessionProfiles, b as invitationProfileName, bt as inspectManagedBlock, c as pendingSessionDisconnects, ct as describeSessionHookChange, d as registerSession, dt as ephemeralCliReason, et as savedReceiver, f as retryPendingDisconnects, ft as findOnPath, g as enrollAgent, gt as repairClaudeHooks, h as staleSessionAgents, ht as readClaudeSettings, i as connectedProfilesForSession, it as recordHookMailCheck, j as NETWORK_ADMISSION_PENDING_RETRY_MS, k as waitForRegistrations, l as psProcessInfo, lt as describeSessionHookItem, m as runDetached, mt as inspectClaudeHooks, n as OMP_MAIN, nt as releaseRegistrationsForProfile, o as headlessClaudeRun, ot as claudeConfigDir, p as revokeStaleSessionAgents, pt as hasMachineSessionHooks, q as agentConnectionStatus, r as agentConnectionState, rt as installClaudeWakeHook, st as currentCliLocation, t as HOOK_END_GRACE_MS, tt as MACHINE_RUNTIMES, u as readClaudeHookInput, ut as ensureHookLauncher, v as connectWarnings, vt as writeClaudeSettings, w as externalReceivingState, wt as writeManagedFile, x as pollCheckCommand, xt as jsonIndentation, y as defaultAgentProfileName, yt as MachineFileError, z as disconnectAgent } from "../machine-session-DNnNhhFr.js";
|
|
7
|
+
import { a as readBeforeDeadline, c as readPresenceProjection, i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust, r as isScopedChatReply, s as presenceDisposition, t as isConnectedChatCredential } from "../scoped-chat-Dd3P8Q-m.js";
|
|
8
8
|
import { autoSignalEligible, dispatchAutoRead, dispatchAutoWorking, haltAutoWorking, isSentSignal, readWorkingLease, restoreAutoWorking } from "./auto-signals.js";
|
|
9
|
-
import { a as ensureSharedMailSubscription, c as isConnectedAgentKey, d as reserveSharedMailSubscription, f as followEmailConversation, g as EventReceiverError, h as EventConnection, i as sharedMailScope, l as createSharedMailWaiter, m as otherParticipants, n as reconcileChatSend, p as readConversationFollow, r as openSharedMailReceiver, s as AGENT_CONNECTION_REQUIRED_MESSAGE, t as sendSignal, u as openSharedMailStore } from "../signal-command-
|
|
9
|
+
import { a as ensureSharedMailSubscription, c as isConnectedAgentKey, d as reserveSharedMailSubscription, f as followEmailConversation, g as EventReceiverError, h as EventConnection, i as sharedMailScope, l as createSharedMailWaiter, m as otherParticipants, n as reconcileChatSend, p as readConversationFollow, r as openSharedMailReceiver, s as AGENT_CONNECTION_REQUIRED_MESSAGE, t as sendSignal, u as openSharedMailStore } from "../signal-command-DZQemE9I.js";
|
|
10
10
|
import { a as thrownErrorBody, i as runStreamingJson, n as guardJsonOutputCommands, r as jsonOutputRequested, t as JSON_OUTPUT_FLAG } from "../json-output-ch756TXV.js";
|
|
11
11
|
import { a as backgroundListenStatus, c as runBackgroundListen, d as stopBackgroundListen, f as verifyBackgroundListenTarget, o as backgroundListenToken, r as backgroundListenConfiguration, u as startBackgroundListen } from "../listen-background-DyBYca28.js";
|
|
12
12
|
import { ORG_SELECTION_ENV } from "./global-org-flag.js";
|
|
@@ -5317,7 +5317,7 @@ const openapiDocument = {
|
|
|
5317
5317
|
} }
|
|
5318
5318
|
},
|
|
5319
5319
|
"503": {
|
|
5320
|
-
"description": "Local receiving is unavailable",
|
|
5320
|
+
"description": "Local receiving is unavailable (pull_unavailable), or the subscription was too busy to claim from in time (service_unavailable): nothing was claimed, so retry the pull after Retry-After",
|
|
5321
5321
|
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
5322
5322
|
}
|
|
5323
5323
|
},
|
|
@@ -21978,7 +21978,7 @@ const openapiDocument = {
|
|
|
21978
21978
|
"/email-rules/compile": { "post": {
|
|
21979
21979
|
"operationId": "compileEmailRule",
|
|
21980
21980
|
"summary": "Compile a rule description",
|
|
21981
|
-
"description": "Turns a plain-English description of which received emails to match into a rule tree over the published column contract, with a plain-English explanation of what it matches, the assumptions made, and warnings for anything the columns cannot express. Where the columns fall short the rule may carry up to
|
|
21981
|
+
"description": "Turns a plain-English description of which received emails to match into a rule tree over the published column contract, with a plain-English explanation of what it matches, the assumptions made, and warnings for anything the columns cannot express. Where the columns fall short the rule may carry up to five yes/no questions, asked about an email only after its conditions match. Nothing is saved. A rule with no questions has its conditions counted, read only, over the caller's recent classified mail (what a test of it covers by default): breadth is that count, and a warning says when it matches nearly all of it. The SQL the rule renders to is returned only when include_sql is true. kind do_not_share compiles a do-not-share rule for recall: conditions only as narrow as the description says, the judgement of what it describes put into questions, and with nothing a column decides for certain, conditions that hold for every email. Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature.",
|
|
21982
21982
|
"tags": ["Email Rules"],
|
|
21983
21983
|
"security": [{ "BearerAuth": [] }],
|
|
21984
21984
|
"requestBody": {
|
|
@@ -22107,7 +22107,7 @@ const openapiDocument = {
|
|
|
22107
22107
|
}
|
|
22108
22108
|
},
|
|
22109
22109
|
"400": {
|
|
22110
|
-
"description": "validation_error: give exactly one of tree and rule_id, at most 200 email_ids (with the expected emails), 1 to 100 expected emails none in both lists, and a tree that is valid for the column contract. evaluation_scope, scope_selection and kind go only with tree. A saved rule whose current version no longer renders answers details.reason version_not_renderable; email_ids that with its saved expectations name over 200 emails, too_many_emails.",
|
|
22110
|
+
"description": "validation_error: give exactly one of tree and rule_id, at most 200 email_ids (with the expected emails), 1 to 100 expected emails none in both lists (or only expect.samples, up to 20), and a tree that is valid for the column contract. evaluation_scope, scope_selection and kind go only with tree. A saved rule whose current version no longer renders answers details.reason version_not_renderable; email_ids that with its saved expectations name over 200 emails, too_many_emails.",
|
|
22111
22111
|
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22112
22112
|
},
|
|
22113
22113
|
"401": {
|
|
@@ -22178,6 +22178,111 @@ const openapiDocument = {
|
|
|
22178
22178
|
}
|
|
22179
22179
|
}]
|
|
22180
22180
|
} },
|
|
22181
|
+
"/email-rules/look-alikes": { "post": {
|
|
22182
|
+
"operationId": "generateLookAlikes",
|
|
22183
|
+
"summary": "Write look-alike emails a rule should not match",
|
|
22184
|
+
"description": "Writes made-up emails that come close to what a grant rule describes but are private (a personal medical bill, pay for named people, a personal purchase, personal banking or tax, or another near case), and reports what the rule decides for each, as test-sample would. failed means the rule matched it, so it would be shared. Nothing is stored and no mail is read. Keep the ones it must never match with add_expectation_samples, or for a request with the accept's expectation_samples. Limited to 20 an hour per member. Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature.",
|
|
22185
|
+
"tags": ["Email Rules"],
|
|
22186
|
+
"security": [{ "BearerAuth": [] }],
|
|
22187
|
+
"requestBody": {
|
|
22188
|
+
"required": true,
|
|
22189
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateLookAlikesRequest" } } }
|
|
22190
|
+
},
|
|
22191
|
+
"responses": {
|
|
22192
|
+
"200": {
|
|
22193
|
+
"description": "Write look-alike emails a rule should not match",
|
|
22194
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
22195
|
+
"type": "object",
|
|
22196
|
+
"required": ["data"],
|
|
22197
|
+
"properties": { "data": { "$ref": "#/components/schemas/GenerateLookAlikesResult" } }
|
|
22198
|
+
}] } } },
|
|
22199
|
+
"headers": {
|
|
22200
|
+
"ratelimit-limit": { "$ref": "#/components/headers/ratelimit-limit" },
|
|
22201
|
+
"ratelimit-remaining": { "$ref": "#/components/headers/ratelimit-remaining" },
|
|
22202
|
+
"ratelimit-reset": { "$ref": "#/components/headers/ratelimit-reset" },
|
|
22203
|
+
"ratelimit-policy": { "$ref": "#/components/headers/ratelimit-policy" }
|
|
22204
|
+
}
|
|
22205
|
+
},
|
|
22206
|
+
"400": {
|
|
22207
|
+
"description": "validation_error: give exactly one of tree, rule_id and request_id, and a tree valid for the column contract; details.reason do_not_share for a do-not-share rule, no_address when no sign-in address was found and no to given, version_not_renderable for a saved version or a request's rule that no longer fits.",
|
|
22208
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22209
|
+
},
|
|
22210
|
+
"401": {
|
|
22211
|
+
"description": "Invalid or missing API key",
|
|
22212
|
+
"content": { "application/json": {
|
|
22213
|
+
"schema": { "$ref": "#/components/schemas/ErrorResponse" },
|
|
22214
|
+
"example": {
|
|
22215
|
+
"success": false,
|
|
22216
|
+
"error": {
|
|
22217
|
+
"code": "unauthorized",
|
|
22218
|
+
"message": "Invalid or missing API key"
|
|
22219
|
+
}
|
|
22220
|
+
}
|
|
22221
|
+
} },
|
|
22222
|
+
"headers": {
|
|
22223
|
+
"ratelimit-limit": { "$ref": "#/components/headers/ratelimit-limit-unauthenticated" },
|
|
22224
|
+
"ratelimit-remaining": { "$ref": "#/components/headers/ratelimit-remaining-unauthenticated" },
|
|
22225
|
+
"ratelimit-reset": { "$ref": "#/components/headers/ratelimit-reset-unauthenticated" },
|
|
22226
|
+
"ratelimit-policy": { "$ref": "#/components/headers/ratelimit-policy-unauthenticated" }
|
|
22227
|
+
}
|
|
22228
|
+
},
|
|
22229
|
+
"403": {
|
|
22230
|
+
"description": "feature_not_enabled: the email rules feature is not enabled for this organization yet. Permission refusals answer forbidden or grant_forbidden instead. email_rule_scope_not_readable: scope_selection names something you cannot read.",
|
|
22231
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22232
|
+
},
|
|
22233
|
+
"404": {
|
|
22234
|
+
"description": "not_found: rule_id names no rule you can see (details.reason rule_not_found), or request_id no rule request you can see (request_not_found).",
|
|
22235
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22236
|
+
},
|
|
22237
|
+
"409": {
|
|
22238
|
+
"description": "email_rule_author_unresolvable: the rule cannot run as its author (for an unsaved tree or a request, you). email_rule_request_not_pending: request_id names a request already decided.",
|
|
22239
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22240
|
+
},
|
|
22241
|
+
"422": {
|
|
22242
|
+
"description": "email_rule_look_alikes_not_written: the model declined, ran out of room or time, or wrote none that fit (details.reason refused, truncated, deadline or invalid).",
|
|
22243
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22244
|
+
},
|
|
22245
|
+
"429": {
|
|
22246
|
+
"description": "Rate limit exceeded. The `ratelimit-*` headers describe the limiter that rejected this request, with its own limit and window, not the API budget that successful responses report. A limiter that reports only a wait sends `Retry-After` alone.",
|
|
22247
|
+
"headers": {
|
|
22248
|
+
"Retry-After": {
|
|
22249
|
+
"schema": { "type": "integer" },
|
|
22250
|
+
"description": "Seconds to wait before retrying"
|
|
22251
|
+
},
|
|
22252
|
+
"ratelimit-limit": { "$ref": "#/components/headers/ratelimit-limit-429" },
|
|
22253
|
+
"ratelimit-remaining": { "$ref": "#/components/headers/ratelimit-remaining-429" },
|
|
22254
|
+
"ratelimit-reset": { "$ref": "#/components/headers/ratelimit-reset" },
|
|
22255
|
+
"ratelimit-policy": { "$ref": "#/components/headers/ratelimit-policy-429" }
|
|
22256
|
+
},
|
|
22257
|
+
"content": { "application/json": {
|
|
22258
|
+
"schema": { "$ref": "#/components/schemas/ErrorResponse" },
|
|
22259
|
+
"example": {
|
|
22260
|
+
"success": false,
|
|
22261
|
+
"error": {
|
|
22262
|
+
"code": "rate_limit_exceeded",
|
|
22263
|
+
"message": "Rate limit exceeded"
|
|
22264
|
+
}
|
|
22265
|
+
}
|
|
22266
|
+
} }
|
|
22267
|
+
},
|
|
22268
|
+
"503": {
|
|
22269
|
+
"description": "email_rule_compiler_unavailable: the model, or the classifier that decides each, is not available or could not be reached.",
|
|
22270
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22271
|
+
}
|
|
22272
|
+
},
|
|
22273
|
+
"x-primitive-permission": ["mail:read"],
|
|
22274
|
+
"parameters": [{
|
|
22275
|
+
"name": "Idempotency-Key",
|
|
22276
|
+
"in": "header",
|
|
22277
|
+
"required": false,
|
|
22278
|
+
"description": "Optional, and not used to deduplicate: this operation stores no result by the key, so a retry with the same key runs the request again. Operations that need a credential refuse a key that is empty, longer than 255 characters or not printable ASCII with 400 `validation_error` and echo a valid one in the Idempotency-Key response header; operations that need none ignore it.",
|
|
22279
|
+
"schema": {
|
|
22280
|
+
"type": "string",
|
|
22281
|
+
"minLength": 1,
|
|
22282
|
+
"maxLength": 255
|
|
22283
|
+
}
|
|
22284
|
+
}]
|
|
22285
|
+
} },
|
|
22181
22286
|
"/email-rules/test-sample": { "post": {
|
|
22182
22287
|
"operationId": "testEmailRuleOnSample",
|
|
22183
22288
|
"summary": "Test a rule against a made-up email",
|
|
@@ -22279,7 +22384,7 @@ const openapiDocument = {
|
|
|
22279
22384
|
"post": {
|
|
22280
22385
|
"operationId": "createEmailRule",
|
|
22281
22386
|
"summary": "Create a rule",
|
|
22282
|
-
"description": "Saves a rule as version 1 from a compile response or a tree you wrote, checked against the column contract; without an explanation the server writes one. It starts in observe (what it matches is recorded, nothing granted or blocked) unless state is draft (not evaluated). You are its author, and it never reaches mail you cannot read. evaluation_scope is own_mailboxes (your own mail) unless you name author (all you can read) or selected; scope_selection may name only what you can read. The answer carries the scope as stored. expectations saves emails it must match and must not; the answer judges them (expectations_check). kind do_not_share blocks sharing: it runs before every other rule, and while active no rule shares an email it matches or cannot decide; a key cannot list it (details.reason rule_blocks_sharing). Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature.",
|
|
22387
|
+
"description": "Saves a rule as version 1 from a compile response or a tree you wrote, checked against the column contract; without an explanation the server writes one. It starts in observe (what it matches is recorded, nothing granted or blocked) unless state is draft (not evaluated), or active for a do_not_share rule. You are its author, and it never reaches mail you cannot read. evaluation_scope is own_mailboxes (your own mail) unless you name author (all you can read) or selected; scope_selection may name only what you can read. The answer carries the scope as stored. expectations saves emails it must match and must not; the answer judges them (expectations_check). kind do_not_share blocks sharing: it runs before every other rule, and while active no rule shares an email it matches or cannot decide; a key cannot list it (details.reason rule_blocks_sharing). Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature.",
|
|
22283
22388
|
"tags": ["Email Rules"],
|
|
22284
22389
|
"security": [{ "BearerAuth": [] }],
|
|
22285
22390
|
"requestBody": {
|
|
@@ -22646,7 +22751,7 @@ const openapiDocument = {
|
|
|
22646
22751
|
}
|
|
22647
22752
|
},
|
|
22648
22753
|
"400": {
|
|
22649
|
-
"description": "validation_error: invalid body or tree (details.errors), too large (too_large), a version that no longer renders (version_not_renderable),
|
|
22754
|
+
"description": "validation_error: invalid body or tree (details.errors), too large (too_large), a version that no longer renders (version_not_renderable), restore_version names the current version (already_current), or over 20 made-up emails (too_many_expectation_samples). no_expectations: if_expectations_pass with no expectations to judge; nothing was saved.",
|
|
22650
22755
|
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22651
22756
|
},
|
|
22652
22757
|
"401": {
|
|
@@ -22669,7 +22774,7 @@ const openapiDocument = {
|
|
|
22669
22774
|
}
|
|
22670
22775
|
},
|
|
22671
22776
|
"403": {
|
|
22672
|
-
"description": "feature_not_enabled: the email rules feature is not enabled for this organization yet. Permission refusals answer forbidden or grant_forbidden instead. email_rule_author_only: only the rule's author may make this change. forbidden (rule_shared): the rule is shared, so only its author or a member manager can turn it off. email_rule_scope_not_readable: scope_selection names something you cannot read. grant_forbidden (mail_depth): if_expectations_pass needs content access to mail.",
|
|
22777
|
+
"description": "feature_not_enabled: the email rules feature is not enabled for this organization yet. Permission refusals answer forbidden or grant_forbidden instead. email_rule_author_only: only the rule's author may make this change. forbidden (rule_shared): the rule is shared, so only its author or a member manager can turn it off. email_rule_scope_not_readable: scope_selection names something you cannot read. grant_forbidden (mail_depth): if_expectations_pass needs content access to mail when it judges emails by id.",
|
|
22673
22778
|
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
22674
22779
|
},
|
|
22675
22780
|
"404": {
|
|
@@ -23695,7 +23800,7 @@ const openapiDocument = {
|
|
|
23695
23800
|
"get": {
|
|
23696
23801
|
"operationId": "getEmailRuleRequest",
|
|
23697
23802
|
"summary": "Read a rule request",
|
|
23698
|
-
"description": "A rule request: the rule as proposed, who made it and to whom, and whether each of them is still a member. A request is visible to the member who made it, the member it was made to, and the organization's owners and admins. If you are the member asked, you can try the rule as proposed before answering: pass the request's tree to POST /v1/email-rules/test to test it on mail you have received. A test on mail already received shows only what has arrived. To see what the rule would do with an email that has not, such as one you would never want shared, pass the request's tree to POST /v1/email-rules/test-sample (testEmailRuleOnSample; in the Primitive CLI, primitive email-rules test-email-rule-on-sample --body-file sample.json) with an email you make up.
|
|
23803
|
+
"description": "A rule request: the rule as proposed, who made it and to whom, and whether each of them is still a member. A request is visible to the member who made it, the member it was made to, and the organization's owners and admins. If you are the member asked, you can try the rule as proposed before answering: pass the request's tree to POST /v1/email-rules/test to test it on mail you have received. A test on mail already received shows only what has arrived. To see what the rule would do with an email that has not, such as one you would never want shared, pass the request's tree to POST /v1/email-rules/test-sample (testEmailRuleOnSample; in the Primitive CLI, primitive email-rules test-email-rule-on-sample --body-file sample.json) with an email you make up, or have look-alikes written for it (POST /v1/email-rules/look-alikes with request_id; primitive email-rules generate-look-alikes). Neither stores anything, and neither needs access beyond testing a rule of your own; the accept keeps any you send as expectation_samples on the rule it writes. Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature.",
|
|
23699
23804
|
"tags": ["Email Rules"],
|
|
23700
23805
|
"security": [{ "BearerAuth": [] }],
|
|
23701
23806
|
"parameters": [{
|
|
@@ -24072,7 +24177,7 @@ const openapiDocument = {
|
|
|
24072
24177
|
"/email-rule-requests/{id}/accept": { "post": {
|
|
24073
24178
|
"operationId": "acceptEmailRuleRequest",
|
|
24074
24179
|
"summary": "Accept a rule request",
|
|
24075
|
-
"description": "Writes the rule as yours, over your own mailboxes only, turns it on, and shares what it matches from now on with the member who asked. Send no body to accept it as asked, or change it first with english and tree together (and an explanation, or the server writes one). Because this gives your mail to someone else, it is limited to the dashboard and the Primitive CLI: other OAuth apps and agent tokens are refused. Before accepting, test it on your mail: pass the request's tree to POST /v1/email-rules/test. A test on mail already received shows only what has arrived. To see what the rule would do with an email that has not, such as one you would never want shared, pass the request's tree to POST /v1/email-rules/test-sample (testEmailRuleOnSample; in the Primitive CLI, primitive email-rules test-email-rule-on-sample --body-file sample.json) with an email you make up.
|
|
24180
|
+
"description": "Writes the rule as yours, over your own mailboxes only, turns it on, and shares what it matches from now on with the member who asked: each email in full with its attachments, but never raw. It does not go back through mail already received. Send no body to accept it as asked, or change it first with english and tree together (and an explanation, or the server writes one). Because this gives your mail to someone else, it is limited to the dashboard and the Primitive CLI: other OAuth apps and agent tokens are refused. Before accepting, test it on your mail: pass the request's tree to POST /v1/email-rules/test. A test on mail already received shows only what has arrived. To see what the rule would do with an email that has not, such as one you would never want shared, pass the request's tree to POST /v1/email-rules/test-sample (testEmailRuleOnSample; in the Primitive CLI, primitive email-rules test-email-rule-on-sample --body-file sample.json) with an email you make up, or have look-alikes written for it (POST /v1/email-rules/look-alikes with request_id; primitive email-rules generate-look-alikes). Neither stores anything, and neither needs access beyond testing a rule of your own; the accept keeps any you send as expectation_samples on the rule it writes. Made-up emails sent in expectation_samples are kept on the rule this writes, where GET /v1/email-rules/{id} lists them. Accepting also needs mail:share_own (sharing your own mail through email rules, which only shows it and never sends): a role without it is refused, whether or not it can send. Needs mail:read, a member's own credential with their full access (not an API key, agent key or narrowed token), and the email rules feature.",
|
|
24076
24181
|
"tags": ["Email Rules"],
|
|
24077
24182
|
"security": [{ "BearerAuth": [] }],
|
|
24078
24183
|
"parameters": [{
|
|
@@ -24109,7 +24214,7 @@ const openapiDocument = {
|
|
|
24109
24214
|
}] } } }
|
|
24110
24215
|
},
|
|
24111
24216
|
"400": {
|
|
24112
|
-
"description": "validation_error: a changed rule needs english and tree together, and a tree that is valid for the column contract. The rule as asked is checked the same way, and must be changed first if it no longer passes.",
|
|
24217
|
+
"description": "validation_error: a changed rule needs english and tree together, and a tree that is valid for the column contract. The rule as asked is checked the same way, and must be changed first if it no longer passes. Made-up emails in expectation_samples are checked as on a rule write (at most 20, each within the sample bounds). Nothing is accepted.",
|
|
24113
24218
|
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
24114
24219
|
},
|
|
24115
24220
|
"401": {
|
|
@@ -32268,7 +32373,7 @@ const openapiDocument = {
|
|
|
32268
32373
|
"summary": "Revoke a credential",
|
|
32269
32374
|
"tags": ["Credentials"],
|
|
32270
32375
|
"security": [{ "BearerAuth": [] }],
|
|
32271
|
-
"description": "Revoke one credential by kind and id. A Function key is rotated, never revoked (409 rotate_instead). An API key is revoked
|
|
32376
|
+
"description": "Revoke one credential by kind and id. A Function key is rotated, never revoked (409 rotate_instead). An API key is revoked by the person who holds it, whatever it reaches, or by a person whose own access covers the key's access (an owner covers every key); otherwise 403 grant_forbidden, details.reason target_not_covered. Revoking an API key also revokes the keys it replaced in its rotation that are still in their overlap and that you may revoke (predecessors_revoked_count; predecessors_left counts the rest), so its webhooks stop at once; the keys that replaced it carry its work on. Revoking a key already revoked does the same for those keys. What the credential set up or owns is listed in standing_objects for review, and for an API key also what it carries on for the keys it was rotated from, each saying whether anything still acts for it (still_acting, with the key in acting_key_id) and, for a webhook, whether it is still delivering. An organization-owned object (org_owned true) keeps working; any other keeps working only while someone can still act for it, such as a key of the same rotation that still works, or whoever it was given to, except that a block filter an app made keeps blocking, within the reach the app had, unless the person revoking chose to stop it. An API key (kind org_key or connected_key) that is already revoked, and whose record is kept, answers 200 with already_revoked true, to a caller who could have revoked it, and revoked counts only the keys it replaced that were revoked now; anyone else gets the answer they would get for a key that does not exist. The person's own Primitive CLI login revokes an API key (kind org_key) as the person, with no step-up unless the organization's credential policy sets cli_writes_require_approval (then it takes a keys.create step-up); every other kind (a connected key named as org_key included, 403 grant_forbidden target_not_covered), and every other app even with a step-up, is refused outside the dashboard (403). Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Contact Primitive to turn them on.\n\nPerson only: a dashboard session or the person's own Primitive CLI token; no other OAuth app. The person's role must hold keys:manage. API keys, agent connection keys and agents are refused.",
|
|
32272
32377
|
"x-primitive-person-only": { "access": "session_or_cli" },
|
|
32273
32378
|
"parameters": [{
|
|
32274
32379
|
"name": "Primitive-Step-Up",
|
|
@@ -33382,7 +33487,7 @@ const openapiDocument = {
|
|
|
33382
33487
|
"summary": "Rotate an API key",
|
|
33383
33488
|
"tags": ["Credentials"],
|
|
33384
33489
|
"security": [{ "BearerAuth": [] }],
|
|
33385
|
-
"description": "Mint a successor with a new id and the same name, grant, expiry and conditions, and return its secret once. The old key keeps working for overlap_seconds, then stops: 24 hours when overlap_seconds is omitted, at most 7 days, never past its own expires_at, and at once with 0 (which is how to rotate a key whose secret leaked). previous_key_expires_at says when the old key stops. Rotating does not extend a key: the successor keeps the old expiry unless expires_at gives it a new one. That needs keys:manage (403 forbidden otherwise), is held to the credential policy (400 when past its maximum lifetime, with the latest expiry it allows now in the message), and someone limited to their own keys can only keep or bring it forward (403 grant_forbidden, details.reason own_key_tighten_only); the old key then never outlives the new one. The person rotating must cover the key's access (403 grant_forbidden, details.reason target_not_covered), and a key an owner holds is rotated by an owner only (403 forbidden, details.reason owner_key_rotation), since rotating hands over the new secret. The person's own Primitive CLI login needs no step-up (it acts as the person, held to the same rules) unless the organization's credential policy sets cli_writes_require_approval; the Primitive app's token is refused, even with one. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Contact Primitive to turn them on.\n\nPerson only: a dashboard session, the person's own Primitive CLI login with no step-up (unless the organization's credential policy sets cli_writes_require_approval), or the person's own OAuth token with a step-up token for purpose `keys.create` in the Primitive-Step-Up header. Without one any other OAuth token is answered 403 step_up_required, whose details carry the dashboard URL that issues it (or 403 grant_forbidden when the person's role, or the client, could not do it anyway). The person's role must hold keys:manage. API keys and agent connection keys are refused. An agent acting for the person is refused unless it carries a step-up token the person issued in the dashboard.",
|
|
33490
|
+
"description": "Mint a successor with a new id and the same name, grant, expiry and conditions, and return its secret once. The old key keeps working for overlap_seconds, then stops: 24 hours when overlap_seconds is omitted, at most 7 days, never past its own expires_at, and at once with 0 (which is how to rotate a key whose secret leaked). previous_key_expires_at says when the old key stops. Revoking the successor during the overlap also revokes the old key when you may revoke that one too; the revoke's predecessors_left counts any left working. Rotating does not extend a key: the successor keeps the old expiry unless expires_at gives it a new one. That needs keys:manage (403 forbidden otherwise), is held to the credential policy (400 when past its maximum lifetime, with the latest expiry it allows now in the message), and someone limited to their own keys can only keep or bring it forward (403 grant_forbidden, details.reason own_key_tighten_only); the old key then never outlives the new one. The person rotating must cover the key's access (403 grant_forbidden, details.reason target_not_covered), and a key an owner holds is rotated by an owner only (403 forbidden, details.reason owner_key_rotation), since rotating hands over the new secret. The person's own Primitive CLI login needs no step-up (it acts as the person, held to the same rules) unless the organization's credential policy sets cli_writes_require_approval; the Primitive app's token is refused, even with one. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Contact Primitive to turn them on.\n\nPerson only: a dashboard session, the person's own Primitive CLI login with no step-up (unless the organization's credential policy sets cli_writes_require_approval), or the person's own OAuth token with a step-up token for purpose `keys.create` in the Primitive-Step-Up header. Without one any other OAuth token is answered 403 step_up_required, whose details carry the dashboard URL that issues it (or 403 grant_forbidden when the person's role, or the client, could not do it anyway). The person's role must hold keys:manage. API keys and agent connection keys are refused. An agent acting for the person is refused unless it carries a step-up token the person issued in the dashboard.",
|
|
33386
33491
|
"x-primitive-person-only": {
|
|
33387
33492
|
"access": "step_up",
|
|
33388
33493
|
"step_up_purpose": "keys.create",
|
|
@@ -33549,7 +33654,7 @@ const openapiDocument = {
|
|
|
33549
33654
|
"summary": "Change an API key",
|
|
33550
33655
|
"tags": ["Credentials"],
|
|
33551
33656
|
"security": [{ "BearerAuth": [] }],
|
|
33552
|
-
"description": "Rename a key, change its expiry, its grant or its conditions, or suspend it. A later expires_at extends the key, which is how to keep a key working past its expiry (rotating keeps it, unless the rotation gives the new key an expires_at): it is held to the credential policy (400 when past its maximum lifetime, with the latest expiry it allows now in the message), and like any loosening needs the person to be allowed to create a key with the key's access. An expired key's expiry cannot be changed (409 conflict, details.reason key_expired); make a new key instead. Any change needs the person's own access to cover the key's access now (an owner covers every key); otherwise 403 grant_forbidden, details.reason target_not_covered. A grant change is a new version of the key and is held to the same rules as creating one (a custom grant that does not say which mail it reaches is refused with details.reason mail_scope_required), so it takes the same step-up. It replaces the whole grant: send expected_grant_ref (grant.ref from GET /v1/keys/{id}) to have it refused (409 conflict, details.reason grant_changed) if the grant changed since that read; a grant change sent without it answers grant_unguarded: true. On a key limited to selected resources (grant.resources), a grant change must drop the limits on purpose with a custom grant and grant.resources {}; one that leaves them out is refused (409 conflict, details.reason key_has_resource_limits) and nothing changes. The person's own Primitive CLI login needs no step-up (it acts as the person, held to the same rules) unless the organization's credential policy sets cli_writes_require_approval; the Primitive app's token is refused, even with one. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Contact Primitive to turn them on.\n\nPerson only: a dashboard session, the person's own Primitive CLI login with no step-up (unless the organization's credential policy sets cli_writes_require_approval), or the person's own OAuth token with a step-up token for purpose `keys.create` in the Primitive-Step-Up header. Without one any other OAuth token is answered 403 step_up_required, whose details carry the dashboard URL that issues it (or 403 grant_forbidden when the person's role, or the client, could not do it anyway). The person's role must hold keys:manage. API keys and agent connection keys are refused. An agent acting for the person is refused unless it carries a step-up token the person issued in the dashboard.",
|
|
33657
|
+
"description": "Rename a key, change its expiry, its grant or its conditions, or suspend it. A later expires_at extends the key, which is how to keep a key working past its expiry (rotating keeps it, unless the rotation gives the new key an expires_at): it is held to the credential policy (400 when past its maximum lifetime, with the latest expiry it allows now in the message), and like any loosening needs the person to be allowed to create a key with the key's access. An expired key's expiry cannot be changed (409 conflict, details.reason key_expired); make a new key instead. Any change needs the person's own access to cover the key's access now (an owner covers every key); otherwise 403 grant_forbidden, details.reason target_not_covered. The one exception is suspending a key (suspended true with no other change; expected_grant_ref may accompany it), which the person who holds it may do whatever the key reaches, calling as themself rather than through another app; lifting a suspension is a change like any other. A grant change is a new version of the key and is held to the same rules as creating one (a custom grant that does not say which mail it reaches is refused with details.reason mail_scope_required), so it takes the same step-up. It replaces the whole grant: send expected_grant_ref (grant.ref from GET /v1/keys/{id}) to have it refused (409 conflict, details.reason grant_changed) if the grant changed since that read; a grant change sent without it answers grant_unguarded: true. On a key limited to selected resources (grant.resources), a grant change must drop the limits on purpose with a custom grant and grant.resources {}; one that leaves them out is refused (409 conflict, details.reason key_has_resource_limits) and nothing changes. The person's own Primitive CLI login needs no step-up (it acts as the person, held to the same rules) unless the organization's credential policy sets cli_writes_require_approval; the Primitive app's token is refused, even with one. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Contact Primitive to turn them on.\n\nPerson only: a dashboard session, the person's own Primitive CLI login with no step-up (unless the organization's credential policy sets cli_writes_require_approval), or the person's own OAuth token with a step-up token for purpose `keys.create` in the Primitive-Step-Up header. Without one any other OAuth token is answered 403 step_up_required, whose details carry the dashboard URL that issues it (or 403 grant_forbidden when the person's role, or the client, could not do it anyway). The person's role must hold keys:manage. API keys and agent connection keys are refused. An agent acting for the person is refused unless it carries a step-up token the person issued in the dashboard.",
|
|
33553
33658
|
"x-primitive-person-only": {
|
|
33554
33659
|
"access": "step_up",
|
|
33555
33660
|
"step_up_purpose": "keys.create",
|
|
@@ -37365,7 +37470,7 @@ const openapiDocument = {
|
|
|
37365
37470
|
"/access-suspensions/{id}/decision": { "post": {
|
|
37366
37471
|
"operationId": "decideSuspension",
|
|
37367
37472
|
"summary": "Decide a suspension",
|
|
37368
|
-
"description": "Keep, narrow or revoke one suspended or flagged item. Keeping it, and revoking an API key
|
|
37473
|
+
"description": "Keep, narrow or revoke one suspended or flagged item. Keeping it needs the decider to cover it, and so does revoking an API key unless the decider holds it and decides as themself rather than through another app (revoking an uncovered key someone else holds is refused with `grant_forbidden`, `target_not_covered`). Keeping an API key rotated (`rotate: true`, other than the shared Function key) also revokes its older secrets still in a rotation overlap, and needs keys:manage on both the credential and the person: without it, or if the decider lost members:manage meanwhile, it is refused with `grant_forbidden` (`keys_manage_required` or `actor_access_changed`) and nothing is rotated. A rule share paused by a role change (`email_rule_share`) takes keep, which leaves it paused, or revoke, which ends the share and needs confirm: true (the person it was shared with loses the emails already shared; without it, 409 `confirmation_required`, as for revoking a filter). Neither of the share's two people may keep it (`grant_forbidden`, `share_decision_forbidden`). Access a person gave on their own mailbox (`mailbox_access`) takes keep or revoke, and both need delegations:manage; revoke removes only what that person gave on that mailbox. Nobody the access reaches, nor the person who gave it, may keep it (`grant_forbidden`, `mailbox_access_decision_forbidden`). Person only: a dashboard session, or the person's own OAuth or CLI token with a session step-up of purpose `suspensions.decide` (the person confirms at the step_up_url a 403 step_up_required answer carries, which names this client, then send the token in the Primitive-Step-Up header; the token works only with the client it was confirmed for). Needs members:manage. API keys are refused.",
|
|
37369
37474
|
"tags": ["Roles and members"],
|
|
37370
37475
|
"security": [{ "BearerAuth": [] }],
|
|
37371
37476
|
"parameters": [
|
|
@@ -39289,6 +39394,7 @@ const openapiDocument = {
|
|
|
39289
39394
|
"email_rule_author_unresolvable",
|
|
39290
39395
|
"email_rule_compiler_unavailable",
|
|
39291
39396
|
"email_rule_conflict",
|
|
39397
|
+
"email_rule_look_alikes_not_written",
|
|
39292
39398
|
"email_rule_not_compiled",
|
|
39293
39399
|
"email_rule_request_limit",
|
|
39294
39400
|
"email_rule_request_not_pending",
|
|
@@ -39430,6 +39536,7 @@ const openapiDocument = {
|
|
|
39430
39536
|
"semantic_search_not_enabled",
|
|
39431
39537
|
"send_failed",
|
|
39432
39538
|
"sender_not_authorized",
|
|
39539
|
+
"sending_ip_warmup_cap",
|
|
39433
39540
|
"sent_email_tail_unavailable",
|
|
39434
39541
|
"sent_mail_search_unavailable",
|
|
39435
39542
|
"shopping_binding_conflict",
|
|
@@ -49491,7 +49598,7 @@ const openapiDocument = {
|
|
|
49491
49598
|
"warnings": {
|
|
49492
49599
|
"type": "array",
|
|
49493
49600
|
"items": { "type": "string" },
|
|
49494
|
-
"description": "Parts of the description the column contract cannot express, and how the rule handles them.
|
|
49601
|
+
"description": "Parts of the description the column contract cannot express, and how the rule handles them. It also has notes on reading automated, from_mailing_list or sender_relationship, a sender address the description does not give, and a grant worded as a prohibition. When the rule has no questions and its conditions hold for all of the caller's recent classified mail (what a test of it covers by default), or for at least 90% of at least 20 emails, the first warning says so. That count is not made for a caller whose access shows headers only, or who could not run a test of the rule, and may also be skipped when the compile ran long or the count fails."
|
|
49495
49602
|
},
|
|
49496
49603
|
"compiled_by": {
|
|
49497
49604
|
"type": "string",
|
|
@@ -49552,6 +49659,67 @@ const openapiDocument = {
|
|
|
49552
49659
|
"message"
|
|
49553
49660
|
]
|
|
49554
49661
|
},
|
|
49662
|
+
"EmailRuleSampleJudgment": {
|
|
49663
|
+
"type": "object",
|
|
49664
|
+
"properties": {
|
|
49665
|
+
"index": {
|
|
49666
|
+
"type": "integer",
|
|
49667
|
+
"minimum": 0
|
|
49668
|
+
},
|
|
49669
|
+
"sample_id": {
|
|
49670
|
+
"type": ["string", "null"],
|
|
49671
|
+
"format": "uuid"
|
|
49672
|
+
},
|
|
49673
|
+
"label": { "type": ["string", "null"] },
|
|
49674
|
+
"expected": {
|
|
49675
|
+
"type": "string",
|
|
49676
|
+
"enum": ["match", "no_match"]
|
|
49677
|
+
},
|
|
49678
|
+
"outcome": {
|
|
49679
|
+
"type": "string",
|
|
49680
|
+
"enum": [
|
|
49681
|
+
"matched",
|
|
49682
|
+
"near_miss",
|
|
49683
|
+
"no_match",
|
|
49684
|
+
"not_decided"
|
|
49685
|
+
]
|
|
49686
|
+
},
|
|
49687
|
+
"status": {
|
|
49688
|
+
"type": "string",
|
|
49689
|
+
"enum": [
|
|
49690
|
+
"passed",
|
|
49691
|
+
"failed",
|
|
49692
|
+
"undecided"
|
|
49693
|
+
]
|
|
49694
|
+
},
|
|
49695
|
+
"question_answers": {
|
|
49696
|
+
"type": "array",
|
|
49697
|
+
"items": {
|
|
49698
|
+
"type": "object",
|
|
49699
|
+
"properties": {
|
|
49700
|
+
"question": { "type": "string" },
|
|
49701
|
+
"answer": { "type": ["boolean", "null"] },
|
|
49702
|
+
"probability": { "type": ["number", "null"] },
|
|
49703
|
+
"error_class": { "type": "string" }
|
|
49704
|
+
},
|
|
49705
|
+
"required": [
|
|
49706
|
+
"question",
|
|
49707
|
+
"answer",
|
|
49708
|
+
"probability"
|
|
49709
|
+
]
|
|
49710
|
+
}
|
|
49711
|
+
}
|
|
49712
|
+
},
|
|
49713
|
+
"required": [
|
|
49714
|
+
"index",
|
|
49715
|
+
"sample_id",
|
|
49716
|
+
"label",
|
|
49717
|
+
"expected",
|
|
49718
|
+
"outcome",
|
|
49719
|
+
"status",
|
|
49720
|
+
"question_answers"
|
|
49721
|
+
]
|
|
49722
|
+
},
|
|
49555
49723
|
"EmailRuleTreeInput": {
|
|
49556
49724
|
"type": "object",
|
|
49557
49725
|
"properties": {
|
|
@@ -49609,6 +49777,107 @@ const openapiDocument = {
|
|
|
49609
49777
|
"additionalProperties": false,
|
|
49610
49778
|
"description": "For a selected rule: inboxes, and domains (each address at them the author reads); each one you can read."
|
|
49611
49779
|
},
|
|
49780
|
+
"EmailRuleExpectationSampleInput": {
|
|
49781
|
+
"type": "object",
|
|
49782
|
+
"properties": {
|
|
49783
|
+
"expected": {
|
|
49784
|
+
"type": "string",
|
|
49785
|
+
"enum": ["match", "no_match"]
|
|
49786
|
+
},
|
|
49787
|
+
"label": {
|
|
49788
|
+
"type": ["string", "null"],
|
|
49789
|
+
"minLength": 1,
|
|
49790
|
+
"maxLength": 200,
|
|
49791
|
+
"pattern": "^[^\\u0000]*$",
|
|
49792
|
+
"description": "What the email stands for, such as a personal medical bill."
|
|
49793
|
+
},
|
|
49794
|
+
"email": { "$ref": "#/components/schemas/EmailRuleSavedSampleEmail" },
|
|
49795
|
+
"id": {
|
|
49796
|
+
"type": "string",
|
|
49797
|
+
"format": "uuid"
|
|
49798
|
+
},
|
|
49799
|
+
"created_at": { "type": "string" }
|
|
49800
|
+
},
|
|
49801
|
+
"required": ["expected", "email"],
|
|
49802
|
+
"additionalProperties": false
|
|
49803
|
+
},
|
|
49804
|
+
"EmailRuleSavedSampleEmail": {
|
|
49805
|
+
"type": "object",
|
|
49806
|
+
"properties": {
|
|
49807
|
+
"from": {
|
|
49808
|
+
"type": "object",
|
|
49809
|
+
"properties": {
|
|
49810
|
+
"address": {
|
|
49811
|
+
"type": "string",
|
|
49812
|
+
"maxLength": 254,
|
|
49813
|
+
"format": "email",
|
|
49814
|
+
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
|
|
49815
|
+
},
|
|
49816
|
+
"name": {
|
|
49817
|
+
"type": "string",
|
|
49818
|
+
"maxLength": 200,
|
|
49819
|
+
"pattern": "^[^\\u0000]*$"
|
|
49820
|
+
}
|
|
49821
|
+
},
|
|
49822
|
+
"required": ["address"]
|
|
49823
|
+
},
|
|
49824
|
+
"to": {
|
|
49825
|
+
"minItems": 1,
|
|
49826
|
+
"maxItems": 10,
|
|
49827
|
+
"type": "array",
|
|
49828
|
+
"items": {
|
|
49829
|
+
"type": "string",
|
|
49830
|
+
"maxLength": 254,
|
|
49831
|
+
"format": "email",
|
|
49832
|
+
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
|
|
49833
|
+
}
|
|
49834
|
+
},
|
|
49835
|
+
"cc": {
|
|
49836
|
+
"maxItems": 10,
|
|
49837
|
+
"type": "array",
|
|
49838
|
+
"items": {
|
|
49839
|
+
"type": "string",
|
|
49840
|
+
"maxLength": 254,
|
|
49841
|
+
"format": "email",
|
|
49842
|
+
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
|
|
49843
|
+
}
|
|
49844
|
+
},
|
|
49845
|
+
"subject": {
|
|
49846
|
+
"type": "string",
|
|
49847
|
+
"maxLength": 998,
|
|
49848
|
+
"pattern": "^[^\\u0000]*$"
|
|
49849
|
+
},
|
|
49850
|
+
"text": {
|
|
49851
|
+
"type": "string",
|
|
49852
|
+
"minLength": 1,
|
|
49853
|
+
"maxLength": 4e3,
|
|
49854
|
+
"pattern": "^[^\\u0000]*$"
|
|
49855
|
+
},
|
|
49856
|
+
"attachment_types": {
|
|
49857
|
+
"maxItems": 10,
|
|
49858
|
+
"type": "array",
|
|
49859
|
+
"items": {
|
|
49860
|
+
"type": "string",
|
|
49861
|
+
"minLength": 1,
|
|
49862
|
+
"maxLength": 255,
|
|
49863
|
+
"pattern": "^[^\\u0000]*$"
|
|
49864
|
+
}
|
|
49865
|
+
},
|
|
49866
|
+
"automated": { "type": "boolean" },
|
|
49867
|
+
"from_mailing_list": { "type": "boolean" },
|
|
49868
|
+
"spam_score": {
|
|
49869
|
+
"type": "number",
|
|
49870
|
+
"minimum": -1e3,
|
|
49871
|
+
"maximum": 1e3
|
|
49872
|
+
}
|
|
49873
|
+
},
|
|
49874
|
+
"required": [
|
|
49875
|
+
"from",
|
|
49876
|
+
"to",
|
|
49877
|
+
"text"
|
|
49878
|
+
],
|
|
49879
|
+
"description": "A made-up email, as POST /email-rules/test-sample takes it."
|
|
49880
|
+
},
|
|
49612
49881
|
"TestEmailRuleRequest": {
|
|
49613
49882
|
"type": "object",
|
|
49614
49883
|
"properties": {
|
|
@@ -49668,10 +49937,15 @@ const openapiDocument = {
|
|
|
49668
49937
|
"type": "string",
|
|
49669
49938
|
"format": "uuid"
|
|
49670
49939
|
}
|
|
49940
|
+
},
|
|
49941
|
+
"samples": {
|
|
49942
|
+
"maxItems": 20,
|
|
49943
|
+
"type": "array",
|
|
49944
|
+
"items": { "$ref": "#/components/schemas/EmailRuleExpectationSampleInput" }
|
|
49671
49945
|
}
|
|
49672
49946
|
},
|
|
49673
49947
|
"additionalProperties": false,
|
|
49674
|
-
"description": "Emails the rule must match and must not
|
|
49948
|
+
"description": "Emails the rule must match and must not (at most 100), always tested whatever their age, and made-up emails (samples, at most 20). Given, it replaces a saved rule's own."
|
|
49675
49949
|
}
|
|
49676
49950
|
},
|
|
49677
49951
|
"additionalProperties": false
|
|
@@ -50028,7 +50302,7 @@ const openapiDocument = {
|
|
|
50028
50302
|
"items": { "$ref": "#/components/schemas/EmailRuleScopeWarning" }
|
|
50029
50303
|
},
|
|
50030
50304
|
"expectations": {
|
|
50031
|
-
"description": "Present when expect was given, or for a saved rule with saved expectations.",
|
|
50305
|
+
"description": "Present when expect was given, or for a saved rule with saved expectations or made-up emails.",
|
|
50032
50306
|
"type": "object",
|
|
50033
50307
|
"properties": {
|
|
50034
50308
|
"passed": {
|
|
@@ -50098,6 +50372,11 @@ const openapiDocument = {
|
|
|
50098
50372
|
]
|
|
50099
50373
|
},
|
|
50100
50374
|
"description": "match first, then no_match, each in the order given (saved expectations by email id)."
|
|
50375
|
+
},
|
|
50376
|
+
"samples": {
|
|
50377
|
+
"description": "Made-up emails judged (expect.samples, or a saved rule's), in order; counts include them.",
|
|
50378
|
+
"type": "array",
|
|
50379
|
+
"items": { "$ref": "#/components/schemas/EmailRuleSampleJudgment" }
|
|
50101
50380
|
}
|
|
50102
50381
|
},
|
|
50103
50382
|
"required": [
|
|
@@ -50116,6 +50395,244 @@ const openapiDocument = {
|
|
|
50116
50395
|
"results"
|
|
50117
50396
|
]
|
|
50118
50397
|
},
|
|
50398
|
+
"EmailRuleLookAlike": {
|
|
50399
|
+
"type": "object",
|
|
50400
|
+
"properties": {
|
|
50401
|
+
"kind": {
|
|
50402
|
+
"type": "string",
|
|
50403
|
+
"enum": [
|
|
50404
|
+
"medical",
|
|
50405
|
+
"payroll",
|
|
50406
|
+
"personal_purchase",
|
|
50407
|
+
"bank_tax",
|
|
50408
|
+
"other"
|
|
50409
|
+
]
|
|
50410
|
+
},
|
|
50411
|
+
"why": {
|
|
50412
|
+
"type": "string",
|
|
50413
|
+
"description": "Why the rule should not match it."
|
|
50414
|
+
},
|
|
50415
|
+
"email": {
|
|
50416
|
+
"type": "object",
|
|
50417
|
+
"properties": {
|
|
50418
|
+
"from": {
|
|
50419
|
+
"type": "object",
|
|
50420
|
+
"properties": {
|
|
50421
|
+
"address": { "type": "string" },
|
|
50422
|
+
"name": { "type": "string" }
|
|
50423
|
+
},
|
|
50424
|
+
"required": ["address"]
|
|
50425
|
+
},
|
|
50426
|
+
"to": {
|
|
50427
|
+
"type": "array",
|
|
50428
|
+
"items": { "type": "string" }
|
|
50429
|
+
},
|
|
50430
|
+
"cc": {
|
|
50431
|
+
"type": "array",
|
|
50432
|
+
"items": { "type": "string" }
|
|
50433
|
+
},
|
|
50434
|
+
"subject": { "type": "string" },
|
|
50435
|
+
"text": { "type": "string" },
|
|
50436
|
+
"attachment_types": {
|
|
50437
|
+
"type": "array",
|
|
50438
|
+
"items": { "type": "string" }
|
|
50439
|
+
},
|
|
50440
|
+
"automated": { "type": "boolean" },
|
|
50441
|
+
"from_mailing_list": { "type": "boolean" }
|
|
50442
|
+
},
|
|
50443
|
+
"required": [
|
|
50444
|
+
"from",
|
|
50445
|
+
"to",
|
|
50446
|
+
"cc",
|
|
50447
|
+
"subject",
|
|
50448
|
+
"text",
|
|
50449
|
+
"attachment_types",
|
|
50450
|
+
"automated",
|
|
50451
|
+
"from_mailing_list"
|
|
50452
|
+
],
|
|
50453
|
+
"description": "A made-up email, as test-sample takes it."
|
|
50454
|
+
},
|
|
50455
|
+
"outcome": {
|
|
50456
|
+
"type": "string",
|
|
50457
|
+
"enum": [
|
|
50458
|
+
"matched",
|
|
50459
|
+
"near_miss",
|
|
50460
|
+
"no_match",
|
|
50461
|
+
"not_decided"
|
|
50462
|
+
]
|
|
50463
|
+
},
|
|
50464
|
+
"status": {
|
|
50465
|
+
"type": "string",
|
|
50466
|
+
"enum": [
|
|
50467
|
+
"passed",
|
|
50468
|
+
"failed",
|
|
50469
|
+
"undecided"
|
|
50470
|
+
],
|
|
50471
|
+
"description": "failed: the rule matched it, so it would be shared. undecided: the rule reads a spam score, which it cannot carry, whatever it decided; or not matched on something it could not decide (not classified, a fact or answer missing, or not reached in time)."
|
|
50472
|
+
},
|
|
50473
|
+
"question_answers": {
|
|
50474
|
+
"type": "array",
|
|
50475
|
+
"items": {
|
|
50476
|
+
"type": "object",
|
|
50477
|
+
"properties": {
|
|
50478
|
+
"question": { "type": "string" },
|
|
50479
|
+
"answer": { "type": ["boolean", "null"] },
|
|
50480
|
+
"probability": { "type": ["number", "null"] },
|
|
50481
|
+
"error_class": { "type": "string" }
|
|
50482
|
+
},
|
|
50483
|
+
"required": [
|
|
50484
|
+
"question",
|
|
50485
|
+
"answer",
|
|
50486
|
+
"probability"
|
|
50487
|
+
]
|
|
50488
|
+
}
|
|
50489
|
+
}
|
|
50490
|
+
},
|
|
50491
|
+
"required": [
|
|
50492
|
+
"kind",
|
|
50493
|
+
"why",
|
|
50494
|
+
"email",
|
|
50495
|
+
"outcome",
|
|
50496
|
+
"status",
|
|
50497
|
+
"question_answers"
|
|
50498
|
+
]
|
|
50499
|
+
},
|
|
50500
|
+
"GenerateLookAlikesRequest": {
|
|
50501
|
+
"type": "object",
|
|
50502
|
+
"properties": {
|
|
50503
|
+
"tree": {
|
|
50504
|
+
"description": "An unsaved rule tree, as POST /email-rules/compile returned it or written by hand. Give tree or rule_id, not both.",
|
|
50505
|
+
"$ref": "#/components/schemas/EmailRuleTreeInput"
|
|
50506
|
+
},
|
|
50507
|
+
"english": {
|
|
50508
|
+
"description": "What the tree is meant to match; without it, the tree is described in words.",
|
|
50509
|
+
"type": "string",
|
|
50510
|
+
"minLength": 1,
|
|
50511
|
+
"maxLength": 2e3
|
|
50512
|
+
},
|
|
50513
|
+
"evaluation_scope": {
|
|
50514
|
+
"type": "string",
|
|
50515
|
+
"enum": [
|
|
50516
|
+
"author",
|
|
50517
|
+
"own_mailboxes",
|
|
50518
|
+
"selected"
|
|
50519
|
+
],
|
|
50520
|
+
"description": "own_mailboxes (the default): mail to your own addresses and agents (for a rule that shares, those mail:share_own lets you share). author: all you can read, inboxes added later included. selected: what scope_selection names."
|
|
50521
|
+
},
|
|
50522
|
+
"scope_selection": { "$ref": "#/components/schemas/EmailRuleScopeSelection" },
|
|
50523
|
+
"rule_id": {
|
|
50524
|
+
"description": "A saved rule you can see: its current version and words.",
|
|
50525
|
+
"type": "string",
|
|
50526
|
+
"format": "uuid"
|
|
50527
|
+
},
|
|
50528
|
+
"request_id": {
|
|
50529
|
+
"description": "A rule request you can see: its rule as asked.",
|
|
50530
|
+
"type": "string",
|
|
50531
|
+
"format": "uuid"
|
|
50532
|
+
},
|
|
50533
|
+
"kind": {
|
|
50534
|
+
"description": "For an unsaved tree: do_not_share tests it as a rule that blocks sharing, so an email it cannot decide counts as matched. A saved rule uses its own.",
|
|
50535
|
+
"type": "string",
|
|
50536
|
+
"enum": ["grant", "do_not_share"]
|
|
50537
|
+
},
|
|
50538
|
+
"count": {
|
|
50539
|
+
"description": "How many, 1 to 8; 6 by default.",
|
|
50540
|
+
"type": "integer",
|
|
50541
|
+
"minimum": 1,
|
|
50542
|
+
"maximum": 8
|
|
50543
|
+
},
|
|
50544
|
+
"kinds": {
|
|
50545
|
+
"description": "Which kinds, taken in turn; all by default, the private ones first.",
|
|
50546
|
+
"minItems": 1,
|
|
50547
|
+
"maxItems": 5,
|
|
50548
|
+
"type": "array",
|
|
50549
|
+
"items": {
|
|
50550
|
+
"type": "string",
|
|
50551
|
+
"enum": [
|
|
50552
|
+
"medical",
|
|
50553
|
+
"payroll",
|
|
50554
|
+
"personal_purchase",
|
|
50555
|
+
"bank_tax",
|
|
50556
|
+
"other"
|
|
50557
|
+
]
|
|
50558
|
+
}
|
|
50559
|
+
},
|
|
50560
|
+
"to": {
|
|
50561
|
+
"description": "The mailbox they arrive in; by default the rule author's (a request's target's) sign-in address when you may see it, else yours.",
|
|
50562
|
+
"type": "string",
|
|
50563
|
+
"maxLength": 254,
|
|
50564
|
+
"format": "email",
|
|
50565
|
+
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
|
|
50566
|
+
}
|
|
50567
|
+
},
|
|
50568
|
+
"additionalProperties": false
|
|
50569
|
+
},
|
|
50570
|
+
"GenerateLookAlikesResult": {
|
|
50571
|
+
"type": "object",
|
|
50572
|
+
"properties": {
|
|
50573
|
+
"rule": {
|
|
50574
|
+
"type": "object",
|
|
50575
|
+
"properties": {
|
|
50576
|
+
"id": {
|
|
50577
|
+
"type": ["string", "null"],
|
|
50578
|
+
"format": "uuid"
|
|
50579
|
+
},
|
|
50580
|
+
"version": {
|
|
50581
|
+
"type": ["integer", "null"],
|
|
50582
|
+
"exclusiveMinimum": 0
|
|
50583
|
+
},
|
|
50584
|
+
"vocabulary": { "type": "string" }
|
|
50585
|
+
},
|
|
50586
|
+
"required": [
|
|
50587
|
+
"id",
|
|
50588
|
+
"version",
|
|
50589
|
+
"vocabulary"
|
|
50590
|
+
]
|
|
50591
|
+
},
|
|
50592
|
+
"look_alikes": {
|
|
50593
|
+
"type": "array",
|
|
50594
|
+
"items": { "$ref": "#/components/schemas/EmailRuleLookAlike" }
|
|
50595
|
+
},
|
|
50596
|
+
"counts": {
|
|
50597
|
+
"type": "object",
|
|
50598
|
+
"properties": {
|
|
50599
|
+
"passed": {
|
|
50600
|
+
"type": "integer",
|
|
50601
|
+
"minimum": 0
|
|
50602
|
+
},
|
|
50603
|
+
"failed": {
|
|
50604
|
+
"type": "integer",
|
|
50605
|
+
"minimum": 0
|
|
50606
|
+
},
|
|
50607
|
+
"undecided": {
|
|
50608
|
+
"type": "integer",
|
|
50609
|
+
"minimum": 0
|
|
50610
|
+
},
|
|
50611
|
+
"dropped": {
|
|
50612
|
+
"type": "integer",
|
|
50613
|
+
"minimum": 0,
|
|
50614
|
+
"description": "Asked for but not returned: not written, outside the sample bounds, or of a kind not asked for."
|
|
50615
|
+
}
|
|
50616
|
+
},
|
|
50617
|
+
"required": [
|
|
50618
|
+
"passed",
|
|
50619
|
+
"failed",
|
|
50620
|
+
"undecided",
|
|
50621
|
+
"dropped"
|
|
50622
|
+
]
|
|
50623
|
+
},
|
|
50624
|
+
"note": {
|
|
50625
|
+
"type": "string",
|
|
50626
|
+
"description": "That the emails are made up and were never sent or stored."
|
|
50627
|
+
}
|
|
50628
|
+
},
|
|
50629
|
+
"required": [
|
|
50630
|
+
"rule",
|
|
50631
|
+
"look_alikes",
|
|
50632
|
+
"counts",
|
|
50633
|
+
"note"
|
|
50634
|
+
]
|
|
50635
|
+
},
|
|
50119
50636
|
"TestEmailRuleOnSampleRequest": {
|
|
50120
50637
|
"type": "object",
|
|
50121
50638
|
"properties": {
|
|
@@ -50407,6 +50924,10 @@ const openapiDocument = {
|
|
|
50407
50924
|
"type": "string",
|
|
50408
50925
|
"enum": ["grant", "do_not_share"]
|
|
50409
50926
|
},
|
|
50927
|
+
"protection_note": {
|
|
50928
|
+
"description": "On a do_not_share rule only: it protects nothing yet (not active), or a classifier fact narrows it.",
|
|
50929
|
+
"type": "string"
|
|
50930
|
+
},
|
|
50410
50931
|
"evaluation_scope": {
|
|
50411
50932
|
"description": "Whose mail it runs over, as stored (GET /email-rules/{id}/scope: what that is now).",
|
|
50412
50933
|
"type": "string",
|
|
@@ -50458,8 +50979,13 @@ const openapiDocument = {
|
|
|
50458
50979
|
"type": "array",
|
|
50459
50980
|
"items": { "$ref": "#/components/schemas/EmailRuleScopeWarning" }
|
|
50460
50981
|
},
|
|
50982
|
+
"expectation_samples": {
|
|
50983
|
+
"description": "Its saved made-up emails, when this write set or added some.",
|
|
50984
|
+
"type": "array",
|
|
50985
|
+
"items": { "$ref": "#/components/schemas/EmailRuleExpectationSample" }
|
|
50986
|
+
},
|
|
50461
50987
|
"expectations_check": {
|
|
50462
|
-
"description": "After a write that saved a version or changed its expectations, if it has some:
|
|
50988
|
+
"description": "After a write that saved a version or changed its expectations or made-up emails, if it has some: the emails by id judged on that version from stored classifications without asking its questions, and any made-up emails listed as undecided. Undecided: one that needs answers not yet kept for that version, is unclassified, skipped or not reached, or that its author does not read. Absent when it could not be judged (the rule changed again, its author cannot be resolved, your access shows headers only, it could not finish in time, or the check failed), and after a write that changed only made-up emails on a rule with emails by id. Test by rule_id for the rest. With if_expectations_pass, the judgment made before the save, which passed.",
|
|
50463
50989
|
"type": "object",
|
|
50464
50990
|
"properties": {
|
|
50465
50991
|
"version": {
|
|
@@ -50471,7 +50997,7 @@ const openapiDocument = {
|
|
|
50471
50997
|
"type": ["boolean", "null"]
|
|
50472
50998
|
},
|
|
50473
50999
|
"decided": {
|
|
50474
|
-
"description": "Whether every expectation was judged (undecided
|
|
51000
|
+
"description": "Whether every expectation was judged (undecided and undecided_samples are empty). Absent from a server that predates it.",
|
|
50475
51001
|
"type": "boolean"
|
|
50476
51002
|
},
|
|
50477
51003
|
"failed": {
|
|
@@ -50488,8 +51014,24 @@ const openapiDocument = {
|
|
|
50488
51014
|
"format": "uuid"
|
|
50489
51015
|
}
|
|
50490
51016
|
},
|
|
51017
|
+
"failed_samples": {
|
|
51018
|
+
"description": "Made-up emails that failed, by index in the set judged (saved oldest first, then added; or as sent).",
|
|
51019
|
+
"type": "array",
|
|
51020
|
+
"items": {
|
|
51021
|
+
"type": "integer",
|
|
51022
|
+
"minimum": 0
|
|
51023
|
+
}
|
|
51024
|
+
},
|
|
51025
|
+
"undecided_samples": {
|
|
51026
|
+
"description": "Made-up emails not decided, by index. Only a write sent with if_expectations_pass that saves a version or activates the rule judges them.",
|
|
51027
|
+
"type": "array",
|
|
51028
|
+
"items": {
|
|
51029
|
+
"type": "integer",
|
|
51030
|
+
"minimum": 0
|
|
51031
|
+
}
|
|
51032
|
+
},
|
|
50491
51033
|
"note": {
|
|
50492
|
-
"description": "On an update that saved a version that did not pass: that it was saved anyway, is current, and whether it is live.",
|
|
51034
|
+
"description": "On an update that saved a version that did not pass, or a do_not_share rule created active: that it was saved anyway, is current, and whether it is live.",
|
|
50493
51035
|
"type": "string"
|
|
50494
51036
|
}
|
|
50495
51037
|
},
|
|
@@ -50640,6 +51182,32 @@ const openapiDocument = {
|
|
|
50640
51182
|
"created_at"
|
|
50641
51183
|
]
|
|
50642
51184
|
},
|
|
51185
|
+
"EmailRuleExpectationSample": {
|
|
51186
|
+
"type": "object",
|
|
51187
|
+
"properties": {
|
|
51188
|
+
"id": {
|
|
51189
|
+
"type": "string",
|
|
51190
|
+
"format": "uuid"
|
|
51191
|
+
},
|
|
51192
|
+
"expected": {
|
|
51193
|
+
"type": "string",
|
|
51194
|
+
"enum": ["match", "no_match"]
|
|
51195
|
+
},
|
|
51196
|
+
"label": { "type": ["string", "null"] },
|
|
51197
|
+
"email": { "$ref": "#/components/schemas/EmailRuleSavedSampleEmail" },
|
|
51198
|
+
"created_at": {
|
|
51199
|
+
"type": "string",
|
|
51200
|
+
"format": "date-time"
|
|
51201
|
+
}
|
|
51202
|
+
},
|
|
51203
|
+
"required": [
|
|
51204
|
+
"id",
|
|
51205
|
+
"expected",
|
|
51206
|
+
"label",
|
|
51207
|
+
"email",
|
|
51208
|
+
"created_at"
|
|
51209
|
+
]
|
|
51210
|
+
},
|
|
50643
51211
|
"CreateEmailRuleRequest": {
|
|
50644
51212
|
"type": "object",
|
|
50645
51213
|
"properties": {
|
|
@@ -50655,9 +51223,13 @@ const openapiDocument = {
|
|
|
50655
51223
|
"enum": ["grant", "do_not_share"]
|
|
50656
51224
|
},
|
|
50657
51225
|
"state": {
|
|
50658
|
-
"description": "observe (the default) records what the rule would match and grants or blocks nothing; draft is not evaluated.",
|
|
51226
|
+
"description": "observe (the default) records what the rule would match and grants or blocks nothing; draft is not evaluated; active only for a do_not_share rule.",
|
|
50659
51227
|
"type": "string",
|
|
50660
|
-
"enum": [
|
|
51228
|
+
"enum": [
|
|
51229
|
+
"draft",
|
|
51230
|
+
"observe",
|
|
51231
|
+
"active"
|
|
51232
|
+
]
|
|
50661
51233
|
},
|
|
50662
51234
|
"evaluation_scope": {
|
|
50663
51235
|
"type": "string",
|
|
@@ -50692,6 +51264,13 @@ const openapiDocument = {
|
|
|
50692
51264
|
"additionalProperties": false,
|
|
50693
51265
|
"description": "Emails it must match and must not (at most 100): a test by rule_id judges them unless expect is given, and each version it saves is checked against them."
|
|
50694
51266
|
},
|
|
51267
|
+
"expectation_samples": {
|
|
51268
|
+
"description": "Made-up emails it must match or not (at most 20).",
|
|
51269
|
+
"minItems": 1,
|
|
51270
|
+
"maxItems": 20,
|
|
51271
|
+
"type": "array",
|
|
51272
|
+
"items": { "$ref": "#/components/schemas/EmailRuleExpectationSampleInput" }
|
|
51273
|
+
},
|
|
50695
51274
|
"english": {
|
|
50696
51275
|
"type": "string",
|
|
50697
51276
|
"minLength": 1,
|
|
@@ -50768,6 +51347,10 @@ const openapiDocument = {
|
|
|
50768
51347
|
"type": "string",
|
|
50769
51348
|
"enum": ["grant", "do_not_share"]
|
|
50770
51349
|
},
|
|
51350
|
+
"protection_note": {
|
|
51351
|
+
"description": "On a do_not_share rule only: it protects nothing yet (not active), or a classifier fact narrows it.",
|
|
51352
|
+
"type": "string"
|
|
51353
|
+
},
|
|
50771
51354
|
"evaluation_scope": {
|
|
50772
51355
|
"description": "Whose mail it runs over, as stored (GET /email-rules/{id}/scope: what that is now).",
|
|
50773
51356
|
"type": "string",
|
|
@@ -50862,6 +51445,10 @@ const openapiDocument = {
|
|
|
50862
51445
|
"type": "string",
|
|
50863
51446
|
"enum": ["grant", "do_not_share"]
|
|
50864
51447
|
},
|
|
51448
|
+
"protection_note": {
|
|
51449
|
+
"description": "On a do_not_share rule only: it protects nothing yet (not active), or a classifier fact narrows it.",
|
|
51450
|
+
"type": "string"
|
|
51451
|
+
},
|
|
50865
51452
|
"evaluation_scope": {
|
|
50866
51453
|
"description": "Whose mail it runs over, as stored (GET /email-rules/{id}/scope: what that is now).",
|
|
50867
51454
|
"type": "string",
|
|
@@ -50928,6 +51515,11 @@ const openapiDocument = {
|
|
|
50928
51515
|
}
|
|
50929
51516
|
},
|
|
50930
51517
|
"required": ["match", "no_match"]
|
|
51518
|
+
},
|
|
51519
|
+
"expectation_samples": {
|
|
51520
|
+
"description": "Its saved made-up emails, oldest first.",
|
|
51521
|
+
"type": "array",
|
|
51522
|
+
"items": { "$ref": "#/components/schemas/EmailRuleExpectationSample" }
|
|
50931
51523
|
}
|
|
50932
51524
|
},
|
|
50933
51525
|
"required": [
|
|
@@ -51045,6 +51637,19 @@ const openapiDocument = {
|
|
|
51045
51637
|
"additionalProperties": false,
|
|
51046
51638
|
"description": "Replaces its saved expectations (author only); null removes them."
|
|
51047
51639
|
},
|
|
51640
|
+
"expectation_samples": {
|
|
51641
|
+
"maxItems": 20,
|
|
51642
|
+
"type": ["array", "null"],
|
|
51643
|
+
"items": { "$ref": "#/components/schemas/EmailRuleExpectationSampleInput" },
|
|
51644
|
+
"description": "Replaces its saved made-up emails (author only); null or [] removes them."
|
|
51645
|
+
},
|
|
51646
|
+
"add_expectation_samples": {
|
|
51647
|
+
"description": "Adds made-up emails to those saved (author only), up to 20 in all.",
|
|
51648
|
+
"minItems": 1,
|
|
51649
|
+
"maxItems": 20,
|
|
51650
|
+
"type": "array",
|
|
51651
|
+
"items": { "$ref": "#/components/schemas/EmailRuleExpectationSampleInput" }
|
|
51652
|
+
},
|
|
51048
51653
|
"if_revision": {
|
|
51049
51654
|
"description": "The revision you read: if the rule was updated since, nothing is saved (409 email_rule_conflict, revision_moved).",
|
|
51050
51655
|
"type": "integer",
|
|
@@ -51748,6 +52353,14 @@ const openapiDocument = {
|
|
|
51748
52353
|
"description": "Why the member asked declined it; null unless they gave a reason when declining.",
|
|
51749
52354
|
"type": ["string", "null"]
|
|
51750
52355
|
},
|
|
52356
|
+
"edited_on_accept": {
|
|
52357
|
+
"description": "Once accepted: whether the rule was changed first, as on the share. Null until then, or when unreadable.",
|
|
52358
|
+
"type": ["boolean", "null"]
|
|
52359
|
+
},
|
|
52360
|
+
"notice": {
|
|
52361
|
+
"description": "For the member asked, while pending: what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
|
|
52362
|
+
"type": ["string", "null"]
|
|
52363
|
+
},
|
|
51751
52364
|
"target_can_accept": {
|
|
51752
52365
|
"description": "Whether the member asked can accept it now under their role. Null unless you can list members and their roles (members:read), or when it could not be read.",
|
|
51753
52366
|
"type": ["boolean", "null"]
|
|
@@ -51905,6 +52518,14 @@ const openapiDocument = {
|
|
|
51905
52518
|
"decline_reason": {
|
|
51906
52519
|
"description": "Why the member asked declined it; null unless they gave a reason when declining.",
|
|
51907
52520
|
"type": ["string", "null"]
|
|
52521
|
+
},
|
|
52522
|
+
"edited_on_accept": {
|
|
52523
|
+
"description": "Once accepted: whether the rule was changed first, as on the share. Null until then, or when unreadable.",
|
|
52524
|
+
"type": ["boolean", "null"]
|
|
52525
|
+
},
|
|
52526
|
+
"notice": {
|
|
52527
|
+
"description": "For the member asked, while pending: what accepting would share. For the member who asked, once accepted with changes: that the request is not what is shared. Else null.",
|
|
52528
|
+
"type": ["string", "null"]
|
|
51908
52529
|
}
|
|
51909
52530
|
},
|
|
51910
52531
|
"required": [
|
|
@@ -51973,6 +52594,10 @@ const openapiDocument = {
|
|
|
51973
52594
|
"type": "string",
|
|
51974
52595
|
"enum": ["grant", "do_not_share"]
|
|
51975
52596
|
},
|
|
52597
|
+
"protection_note": {
|
|
52598
|
+
"description": "On a do_not_share rule only: it protects nothing yet (not active), or a classifier fact narrows it.",
|
|
52599
|
+
"type": "string"
|
|
52600
|
+
},
|
|
51976
52601
|
"evaluation_scope": {
|
|
51977
52602
|
"description": "Whose mail it runs over, as stored (GET /email-rules/{id}/scope: what that is now).",
|
|
51978
52603
|
"type": "string",
|
|
@@ -52245,6 +52870,13 @@ const openapiDocument = {
|
|
|
52245
52870
|
"breadth": {
|
|
52246
52871
|
"description": "Ignored (the compile answer's breadth).",
|
|
52247
52872
|
"anyOf": [{ "$ref": "#/components/schemas/EmailRuleBreadth" }, { "type": "null" }]
|
|
52873
|
+
},
|
|
52874
|
+
"expectation_samples": {
|
|
52875
|
+
"description": "Made-up emails the rule must match or not, such as look-alikes it must never match, kept on the rule this accept writes.",
|
|
52876
|
+
"minItems": 1,
|
|
52877
|
+
"maxItems": 20,
|
|
52878
|
+
"type": "array",
|
|
52879
|
+
"items": { "$ref": "#/components/schemas/EmailRuleExpectationSampleInput" }
|
|
52248
52880
|
}
|
|
52249
52881
|
},
|
|
52250
52882
|
"additionalProperties": false
|
|
@@ -52254,7 +52886,11 @@ const openapiDocument = {
|
|
|
52254
52886
|
"properties": {
|
|
52255
52887
|
"request": { "$ref": "#/components/schemas/EmailRuleRequest" },
|
|
52256
52888
|
"rule": { "$ref": "#/components/schemas/EmailRuleWithVersion" },
|
|
52257
|
-
"share": { "$ref": "#/components/schemas/EmailRuleShare" }
|
|
52889
|
+
"share": { "$ref": "#/components/schemas/EmailRuleShare" },
|
|
52890
|
+
"notice": {
|
|
52891
|
+
"description": "What is now shared, in words.",
|
|
52892
|
+
"type": "string"
|
|
52893
|
+
}
|
|
52258
52894
|
},
|
|
52259
52895
|
"required": [
|
|
52260
52896
|
"request",
|
|
@@ -56427,7 +57063,7 @@ const openapiDocument = {
|
|
|
56427
57063
|
}
|
|
56428
57064
|
},
|
|
56429
57065
|
"already_revoked": {
|
|
56430
|
-
"description": "true when the API key was already revoked
|
|
57066
|
+
"description": "true when the API key was already revoked. revoked then counts only the keys it replaced that were revoked now. Absent otherwise. GET /v1/keys/{id} says when and by whom, to a caller who may read the key.",
|
|
56431
57067
|
"type": "boolean"
|
|
56432
57068
|
},
|
|
56433
57069
|
"keep_failed": {
|
|
@@ -56460,6 +57096,18 @@ const openapiDocument = {
|
|
|
56460
57096
|
"org_owned": {
|
|
56461
57097
|
"type": "boolean",
|
|
56462
57098
|
"description": "true: the organization owns it, and it keeps working. false: the credential owns it itself, as with everything a third-party app or agent delegate made, a webhook made with a narrowed API key, or a wake schedule made with a key that does not cover super_admin. It keeps working only while someone can still act for it, such as a key of the same rotation that still works, or whoever it was given to or kept it. Revoking a third-party app or agent delegate turns these off, except that a block filter it made keeps blocking, within the reach the app had, unless the person revoking chose to stop it."
|
|
57099
|
+
},
|
|
57100
|
+
"still_acting": {
|
|
57101
|
+
"description": "For an API key: whether anything still acts for it after this revoke (the organization, a key of the same rotation that still works, or whoever took it over). Null when that could not be read.",
|
|
57102
|
+
"type": ["boolean", "null"]
|
|
57103
|
+
},
|
|
57104
|
+
"acting_key_id": {
|
|
57105
|
+
"description": "For an API key: the key that still acts for it, shown to a caller who may read the organization's API keys. Null otherwise, and when no key does.",
|
|
57106
|
+
"type": ["string", "null"]
|
|
57107
|
+
},
|
|
57108
|
+
"delivering": {
|
|
57109
|
+
"description": "For an API key's webhook: whether it is still sent received mail, as GET /v1/endpoints/{id} delivery.delivering says. Null when that could not be read.",
|
|
57110
|
+
"type": ["boolean", "null"]
|
|
56463
57111
|
}
|
|
56464
57112
|
},
|
|
56465
57113
|
"required": [
|
|
@@ -56470,6 +57118,28 @@ const openapiDocument = {
|
|
|
56470
57118
|
],
|
|
56471
57119
|
"additionalProperties": {}
|
|
56472
57120
|
}
|
|
57121
|
+
},
|
|
57122
|
+
"predecessors_revoked_count": {
|
|
57123
|
+
"description": "For an API key: how many keys it replaced in its rotation, still in their overlap, were revoked with it. Keys that replaced it never are.",
|
|
57124
|
+
"type": "integer",
|
|
57125
|
+
"minimum": -9007199254740991,
|
|
57126
|
+
"maximum": 9007199254740991
|
|
57127
|
+
},
|
|
57128
|
+
"predecessors_left": {
|
|
57129
|
+
"description": "For an API key: how many such keys were left working because you may not revoke them. They work until their overlap ends.",
|
|
57130
|
+
"type": "integer",
|
|
57131
|
+
"minimum": -9007199254740991,
|
|
57132
|
+
"maximum": 9007199254740991
|
|
57133
|
+
},
|
|
57134
|
+
"predecessors_revoked": {
|
|
57135
|
+
"description": "The ids of the keys counted in predecessors_revoked_count, to a caller who may read the organization's API keys.",
|
|
57136
|
+
"type": "array",
|
|
57137
|
+
"items": { "type": "string" }
|
|
57138
|
+
},
|
|
57139
|
+
"predecessors_not_revoked": {
|
|
57140
|
+
"description": "The ids of the keys counted in predecessors_left, to a caller who may read the organization's API keys.",
|
|
57141
|
+
"type": "array",
|
|
57142
|
+
"items": { "type": "string" }
|
|
56473
57143
|
}
|
|
56474
57144
|
},
|
|
56475
57145
|
"required": [
|
|
@@ -71295,8 +71965,8 @@ const PRIMITIVE_TEAM_AUTHOR = {
|
|
|
71295
71965
|
name: "Primitive Team",
|
|
71296
71966
|
url: "https://primitive.dev"
|
|
71297
71967
|
};
|
|
71298
|
-
const SDK_VERSION_RANGE = "^3.0.0-preview.
|
|
71299
|
-
const CLI_VERSION_RANGE = "^3.0.0-preview.
|
|
71968
|
+
const SDK_VERSION_RANGE = "^3.0.0-preview.8";
|
|
71969
|
+
const CLI_VERSION_RANGE = "^3.0.0-preview.8";
|
|
71300
71970
|
const ESBUILD_VERSION_RANGE = "^0.27.0";
|
|
71301
71971
|
function renderHandler() {
|
|
71302
71972
|
return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
|
|
@@ -75368,8 +76038,82 @@ function standingSummary(standing) {
|
|
|
75368
76038
|
const kept = standing.length - keyOwned;
|
|
75369
76039
|
return `${[...kept > 0 ? [`${kept} item(s) the organization owns keep working.`] : [], ...keyOwned > 0 ? [`${keyOwned} item(s) the key owned itself or carried on for the keys it was rotated from, such as its own webhooks, which keep working only while someone can still act for them, such as a key of the same rotation that still works.`] : []].join(" ")} Review them with --json.`;
|
|
75370
76040
|
}
|
|
76041
|
+
/** How many standing objects the summary lists one by one. */
|
|
76042
|
+
const STANDING_LIST_LIMIT = 10;
|
|
76043
|
+
const STANDING_KIND_LABELS = {
|
|
76044
|
+
endpoint: "webhook",
|
|
76045
|
+
function_trigger: "Function trigger",
|
|
76046
|
+
pull_subscription: "pull subscription",
|
|
76047
|
+
recipient_route: "route",
|
|
76048
|
+
filter_rule: "filter",
|
|
76049
|
+
wake_schedule: "wake schedule"
|
|
76050
|
+
};
|
|
76051
|
+
/** Whether a revoke answer says, per item, what still acts for it or delivers. */
|
|
76052
|
+
function reportsCascade(standing) {
|
|
76053
|
+
return standing.some((item) => "still_acting" in item || "delivering" in item);
|
|
76054
|
+
}
|
|
76055
|
+
/**
|
|
76056
|
+
* A standing object's label. A Function trigger's label is only "function" and
|
|
76057
|
+
* an unnamed pull subscription's only "pull", so those carry their id; a
|
|
76058
|
+
* webhook's URL loses its query and fragment, which can hold a token.
|
|
76059
|
+
*/
|
|
76060
|
+
function standingLabel(item) {
|
|
76061
|
+
const id = typeof item.id === "string" ? item.id : String(item.id);
|
|
76062
|
+
const label = typeof item.label === "string" && item.label ? item.label : id;
|
|
76063
|
+
if (item.kind === "function_trigger") return id;
|
|
76064
|
+
if (item.kind === "pull_subscription") return label === id || label === "pull" ? id : `${label} (${id})`;
|
|
76065
|
+
if (item.kind === "endpoint") {
|
|
76066
|
+
const cut = label.search(/[?#]/);
|
|
76067
|
+
return cut >= 0 ? `${label.slice(0, cut)}?...` : label;
|
|
76068
|
+
}
|
|
76069
|
+
return label;
|
|
76070
|
+
}
|
|
76071
|
+
/** One standing object, with who still acts for it and whether it delivers. */
|
|
76072
|
+
function standingLine(item, leftWorking) {
|
|
76073
|
+
const kind = typeof item.kind === "string" ? STANDING_KIND_LABELS[item.kind] ?? item.kind : "item";
|
|
76074
|
+
let acting;
|
|
76075
|
+
if (item.org_owned !== false) acting = "the organization owns it, so revoking does not stop it";
|
|
76076
|
+
else if (item.still_acting === true) {
|
|
76077
|
+
const by = typeof item.acting_key_id === "string" && item.acting_key_id ? item.acting_key_id : null;
|
|
76078
|
+
acting = !by ? "owned by the revoked key; someone still acts for it, so it keeps working while they do" : leftWorking.has(by) ? `owned by the revoked key; key ${by} still acts for it until that key's overlap ends` : `owned by the revoked key; key ${by} still acts for it, so it keeps working while that key does`;
|
|
76079
|
+
} else if (item.still_acting === false) acting = "owned by the revoked key; nothing acts for it, so it does not work";
|
|
76080
|
+
else if (item.still_acting === null) acting = "owned by the revoked key; whether anything still acts for it could not be read, and it works only while something does";
|
|
76081
|
+
else acting = "owned by the revoked key; it keeps working only while someone can still act for it";
|
|
76082
|
+
const delivering = item.delivering === true ? "; still delivering received mail" : item.delivering === false ? "; not delivering received mail" : item.delivering === null ? "; whether it still delivers could not be read" : "";
|
|
76083
|
+
return ` ${kind} ${standingLabel(item)}: ${acting}${delivering}.`;
|
|
76084
|
+
}
|
|
76085
|
+
/**
|
|
76086
|
+
* What a revoke did beyond the key itself, from the answer: the keys it
|
|
76087
|
+
* replaced that were revoked with it or left working, and, for each item the
|
|
76088
|
+
* key set up or owns, whether anything still acts for it and whether it still
|
|
76089
|
+
* delivers. Lines, empty when the answer has none of these. An answer from a
|
|
76090
|
+
* server that does not report them per item falls back to standingSummary.
|
|
76091
|
+
*/
|
|
76092
|
+
function revokeCascadeLines(data) {
|
|
76093
|
+
if (!data || typeof data !== "object") return [];
|
|
76094
|
+
const answer = data;
|
|
76095
|
+
const lines = [];
|
|
76096
|
+
const ids = (value) => Array.isArray(value) ? value.filter((id) => typeof id === "string") : [];
|
|
76097
|
+
const named = (list) => list.length > 0 ? `: ${list.join(", ")}` : "";
|
|
76098
|
+
const revoked = answer.predecessors_revoked_count;
|
|
76099
|
+
if (typeof revoked === "number" && revoked > 0) lines.push(`Also revoked ${revoked === 1 ? "1 key" : `${revoked} keys`} it replaced, still in ${revoked === 1 ? "its" : "their"} rotation overlap${named(ids(answer.predecessors_revoked))}.`);
|
|
76100
|
+
const left = answer.predecessors_left;
|
|
76101
|
+
if (typeof left === "number" && left > 0) lines.push(`${left === 1 ? "1 key" : `${left} keys`} it replaced ${left === 1 ? "is" : "are"} left working until ${left === 1 ? "its" : "their"} overlap ends, because you may not revoke ${left === 1 ? "it" : "them"}${named(ids(answer.predecessors_not_revoked))}; what ${left === 1 ? "it acts" : "they act"} for keeps working until then.`);
|
|
76102
|
+
const leftWorking = new Set(ids(answer.predecessors_not_revoked));
|
|
76103
|
+
const standing = Array.isArray(answer.standing_objects) ? answer.standing_objects.filter((item) => item !== null && typeof item === "object") : [];
|
|
76104
|
+
if (standing.length > 0 && reportsCascade(standing)) {
|
|
76105
|
+
lines.push("What it set up, owns or carried on for the keys it replaced (revoking deletes none of it):");
|
|
76106
|
+
for (const item of standing.slice(0, STANDING_LIST_LIMIT)) lines.push(standingLine(item, leftWorking));
|
|
76107
|
+
const more = standing.length - STANDING_LIST_LIMIT;
|
|
76108
|
+
if (more > 0) lines.push(` ${more} more; --json lists them all.`);
|
|
76109
|
+
} else {
|
|
76110
|
+
const summary = standingSummary(answer.standing_objects);
|
|
76111
|
+
if (summary) lines.push(summary);
|
|
76112
|
+
}
|
|
76113
|
+
return lines;
|
|
76114
|
+
}
|
|
75371
76115
|
var KeysRevokeCommand = class KeysRevokeCommand extends Command {
|
|
75372
|
-
static description = `Revoke an API key. It stops working at once. What the organization owns keeps working; what the key itself owns, such as its own webhooks, keeps working only while someone can still act for it, such as a key of the same rotation that still works. What it set up or owns is listed for review.
|
|
76116
|
+
static description = `Revoke an API key. It stops working at once. What the organization owns keeps working; what the key itself owns, such as its own webhooks, keeps working only while someone can still act for it, such as a key of the same rotation that still works. What it set up or owns is listed for review, each with whether anything still acts for it and, for a webhook, whether it still delivers received mail. Keys it replaced that are still in their rotation overlap are revoked with it, except any you may not revoke; the output counts both, and names them and the key acting for each item when you may read the organization's keys.
|
|
75373
76117
|
|
|
75374
76118
|
Asks for confirmation first; pass --yes to skip the prompt in scripts. Revoking runs directly. If your organization requires approval, the command prints the approval link, opens it where it can and waits for the one-time token; in a script, approve and run it again with --step-up-token.`;
|
|
75375
76119
|
static summary = "Revoke an API key";
|
|
@@ -75418,9 +76162,10 @@ var KeysRevokeCommand = class KeysRevokeCommand extends Command {
|
|
|
75418
76162
|
this.log(JSON.stringify(result.data, null, 2));
|
|
75419
76163
|
return;
|
|
75420
76164
|
}
|
|
75421
|
-
|
|
75422
|
-
const
|
|
75423
|
-
|
|
76165
|
+
const replaced = result.data.predecessors_revoked_count;
|
|
76166
|
+
const alsoRevoked = typeof replaced === "number" && replaced > 0;
|
|
76167
|
+
this.log(result.data.already_revoked === true ? alsoRevoked ? `Key ${args.id} was already revoked.` : `Key ${args.id} was already revoked; nothing changed.` : `Revoked key ${args.id}.`);
|
|
76168
|
+
for (const line of revokeCascadeLines(result.data)) this.log(line);
|
|
75424
76169
|
}
|
|
75425
76170
|
};
|
|
75426
76171
|
const hash = (value) => createHash("sha256").update(value).digest("hex");
|