primcli 3.0.0-preview.3 → 3.0.0-preview.5

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.
@@ -52,6 +52,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
52
52
  cancelSentEmailByIdempotencyKey: () => cancelSentEmailByIdempotencyKey,
53
53
  checkDefaultNetworkContactAdmission: () => checkDefaultNetworkContactAdmission,
54
54
  checkDomainDns: () => checkDomainDns,
55
+ checkEmailRuleRequestTarget: () => checkEmailRuleRequestTarget,
55
56
  checkSendability: () => checkSendability,
56
57
  checkVanityInboxName: () => checkVanityInboxName,
57
58
  claimAgentConnection: () => claimAgentConnection,
@@ -85,6 +86,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
85
86
  deleteDomain: () => deleteDomain,
86
87
  deleteEmail: () => deleteEmail,
87
88
  deleteEmailRule: () => deleteEmailRule,
89
+ deleteEmailRuleRequest: () => deleteEmailRuleRequest,
88
90
  deleteEndpoint: () => deleteEndpoint,
89
91
  deleteFilter: () => deleteFilter,
90
92
  deleteFunction: () => deleteFunction,
@@ -131,6 +133,9 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
131
133
  getEmailRuleRequest: () => getEmailRuleRequest,
132
134
  getEmailRuleScope: () => getEmailRuleScope,
133
135
  getEmailRuleShare: () => getEmailRuleShare,
136
+ getEmailRuleVocabulary: () => getEmailRuleVocabulary,
137
+ getEndpoint: () => getEndpoint,
138
+ getEndpointSigningSecret: () => getEndpointSigningSecret,
134
139
  getFunction: () => getFunction,
135
140
  getFunctionDeployment: () => getFunctionDeployment,
136
141
  getFunctionInvocation: () => getFunctionInvocation,
@@ -160,6 +165,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
160
165
  getRelayAutoJoin: () => getRelayAutoJoin,
161
166
  getRepeatingSend: () => getRepeatingSend,
162
167
  getSearchSettings: () => getSearchSettings,
168
+ getSendFrom: () => getSendFrom,
163
169
  getSendPermissions: () => getSendPermissions,
164
170
  getSentEmail: () => getSentEmail,
165
171
  getSentHourlyStats: () => getSentHourlyStats,
@@ -175,6 +181,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
175
181
  inviteOrganizationMember: () => inviteOrganizationMember,
176
182
  inviteProjectMember: () => inviteProjectMember,
177
183
  leaveOrganization: () => leaveOrganization,
184
+ listActivityObjects: () => listActivityObjects,
178
185
  listAddressNotes: () => listAddressNotes,
179
186
  listAddressNotesBatch: () => listAddressNotesBatch,
180
187
  listAgentConnections: () => listAgentConnections,
@@ -276,6 +283,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
276
283
  revokeOAuthGrant: () => revokeOAuthGrant,
277
284
  revokeOrganizationInvitation: () => revokeOrganizationInvitation,
278
285
  revokeProjectInvitation: () => revokeProjectInvitation,
286
+ rotateEndpointSigningSecret: () => rotateEndpointSigningSecret,
279
287
  rotateKey: () => rotateKey,
280
288
  rotateWebhookSecret: () => rotateWebhookSecret,
281
289
  runWakeSchedule: () => runWakeSchedule,
@@ -664,10 +672,7 @@ const getStorageStats = (options) => (options?.client ?? client).get({
664
672
  * secret exists yet, one is generated automatically on first
665
673
  * access.
666
674
  *
667
- * Signing is account-scoped, not per-endpoint. Every webhook
668
- * delivery from any of your registered endpoints is signed
669
- * with this single secret. Rotate via
670
- * `POST /account/webhook-secret/rotate`.
675
+ * Every webhook is signed with this secret unless it has its own. Rotate this secret via `POST /account/webhook-secret/rotate`. A webhook whose signed_with is own_secret is signed with its own secret instead; read it from GET /endpoints/{id}/signing-secret. A webhook's own secret rotates via `POST /endpoints/{id}/signing-secret/rotate`.
671
676
  *
672
677
  * **Secret format**: the returned string looks base64-shaped
673
678
  * (e.g. `XNHBBW8VqoBjRfNs1tkZj11jTk...`) but is NOT base64.
@@ -1217,10 +1222,7 @@ const listEndpoints = (options) => (options?.client ?? client).get({
1217
1222
  * instead. Subject to plan limits on the number of active
1218
1223
  * endpoints.
1219
1224
  *
1220
- * **Signing is account-scoped, not per-endpoint.** This call
1221
- * does not return any signing material; every endpoint on the
1222
- * account uses the same webhook secret, fetched via
1223
- * `GET /account/webhook-secret`. See the API-level "Webhook
1225
+ * **Signing.** A webhook is signed with the organization's webhook secret (`GET /account/webhook-secret`) unless it has its own. A webhook made as a person's own, or by an API key limited to some mailboxes, a third-party app or an agent delegate for itself, is made with its own secret: the response carries it once as `signing_secret`, and `GET /endpoints/{id}/signing-secret` returns it afterwards. Other webhooks, those a person who can read every mailbox makes among them, sign with the organization's secret until given their own. `signed_with` on the endpoint says which secret signs it. See the API-level "Webhook
1224
1226
  * signing" section for the full wire format (header name,
1225
1227
  * signed string, hash algo, secret format, tolerance) and a
1226
1228
  * language-agnostic verification recipe.
@@ -1264,11 +1266,22 @@ const deleteEndpoint = (options) => (options.client ?? client).delete({
1264
1266
  ...options
1265
1267
  });
1266
1268
  /**
1269
+ * Get an endpoint
1270
+ *
1271
+ * One endpoint, as GET /endpoints shows it, to a caller who would see it there. Any other id, a deleted endpoint's included, answers 404.
1272
+ */
1273
+ const getEndpoint = (options) => (options.client ?? client).get({
1274
+ security: [{
1275
+ scheme: "bearer",
1276
+ type: "http"
1277
+ }],
1278
+ url: "/endpoints/{id}",
1279
+ ...options
1280
+ });
1281
+ /**
1267
1282
  * Update a webhook endpoint
1268
1283
  *
1269
- * Updates an active webhook endpoint. If the URL is changed, the old
1270
- * endpoint is deactivated and a new one is created (or an existing
1271
- * deactivated endpoint with the new URL is reactivated).
1284
+ * Updates an active webhook endpoint. Changing the URL keeps the endpoint: its id, recipient routes, signing secret, delivery history and any deliveries still owed to it stay with it, and owed deliveries go to the new URL. Another active endpoint at the new URL is refused.
1272
1285
  *
1273
1286
  *
1274
1287
  * Pull destinations cannot be assigned a URL, function or recipient-routing domain. Existing endpoint deletion disconnects the destination; creating a new destination does not backfill historical events.
@@ -1633,6 +1646,7 @@ const listRoutes = (options) => (options?.client ?? client).get({
1633
1646
  * transaction, enabling per-address function routing (e.g.
1634
1647
  * `alice@acme.com -> functionA`).
1635
1648
  *
1649
+ * A route that could never deliver is refused: an exact pattern that the endpoint's owner may not receive, or that the route's own owner may not act on, answers 400 validation_error with details.reason endpoint_owner_access or route_owner_access and details.recipient. A wildcard or regex route to an owned endpoint is written, with warnings saying it delivers only what the owner may receive. A route written disabled is judged when it is turned on.
1636
1650
  */
1637
1651
  const createRoute = (options) => (options.client ?? client).post({
1638
1652
  security: [{
@@ -1698,7 +1712,7 @@ const deleteRoute = (options) => (options.client ?? client).delete({
1698
1712
  /**
1699
1713
  * Update a recipient route
1700
1714
  *
1701
- * Update a recipient route
1715
+ * A route that could never deliver is refused: an exact pattern that the endpoint's owner may not receive, or that the route's own owner may not act on, answers 400 validation_error with details.reason endpoint_owner_access or route_owner_access and details.recipient. A wildcard or regex route to an owned endpoint is written, with warnings saying it delivers only what the owner may receive. A route written disabled is judged when it is turned on.
1702
1716
  */
1703
1717
  const updateRoute = (options) => (options.client ?? client).patch({
1704
1718
  security: [{
@@ -3579,9 +3593,35 @@ const getWebhookDeliveryStats = (options) => (options?.client ?? client).get({
3579
3593
  ...options
3580
3594
  });
3581
3595
  /**
3596
+ * List what you created
3597
+ *
3598
+ * The objects the caller created, newest first, each with where it stands now, including ones since disabled, deleted or revoked where the object keeps a row: Functions, endpoints, Function triggers, pull subscriptions, recipient routes, filters, wake schedules, repeating sends and scheduled sends. An API key, an app or an agent sees what it created itself; a webhook given to an API key lists under that key. A person (a dashboard session, or their own Primitive CLI or app login) sees what they created through any credential of theirs, each item naming it, and also their API keys, personal agents, email rules and rule requests. Each kind is listed only if the caller could list it through that kind's own route; a kind it could not is named in withheld, with no count. Ids, names and states only: never a webhook URL or mail content. Needs activity:read_self.
3599
+ */
3600
+ const listActivityObjects = (options) => (options?.client ?? client).get({
3601
+ security: [{
3602
+ scheme: "bearer",
3603
+ type: "http"
3604
+ }],
3605
+ url: "/activity/objects",
3606
+ ...options
3607
+ });
3608
+ /**
3609
+ * Read the column catalog
3610
+ *
3611
+ * What a rule tree you write yourself can say: each column of the current vocabulary with its type, source, meaning, operators and the value each takes, options, and whether it takes min_confidence; and the tree's limits, its stored size included. Built from the checks a saved or tested tree must pass. A tree is {version: tree_version, vocabulary: version, when, questions}. 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.
3612
+ */
3613
+ const getEmailRuleVocabulary = (options) => (options?.client ?? client).get({
3614
+ security: [{
3615
+ scheme: "bearer",
3616
+ type: "http"
3617
+ }],
3618
+ url: "/email-rules/vocabulary",
3619
+ ...options
3620
+ });
3621
+ /**
3582
3622
  * Compile a rule description
3583
3623
  *
3584
- * 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 three yes/no questions, asked about an email only after its conditions match. Nothing is saved. The SQL the rule renders to is returned only when include_sql is true. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3624
+ * 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 three 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), so a warning can say 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.
3585
3625
  */
3586
3626
  const compileEmailRule = (options) => (options.client ?? client).post({
3587
3627
  security: [{
@@ -3598,7 +3638,7 @@ const compileEmailRule = (options) => (options.client ?? client).post({
3598
3638
  /**
3599
3639
  * Test a rule against received mail
3600
3640
  *
3601
- * Runs a rule over received mail and reports what it would decide for each email: matched, near_miss, no_match, unclassified or not_found. Test an unsaved tree from a compile response, or a saved rule by rule_id (its current version, run with its author's access). Either way the rule reads only mail its author can read, and only what its scope covers; an unsaved tree covers only your own mail unless evaluation_scope names more. Without email_ids, the newest emails it can read are tested, at most 200 and none older than 30 days. Emails not classified yet that arrived more than 2 hours ago are classified first and their classification is saved, unless classify_missing is false; newer ones are left to normal classification and reported unclassified with reason pending. The rule itself records nothing and grants nothing. Classification and the rule's own questions stop at about 90 seconds; run the test again to continue where it stopped. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3641
+ * Runs a rule over received mail and reports what it would decide for each email (matched, near_miss, no_match, unclassified, skipped or not_found), with a summary: how each top-level condition and question decided and, when nothing matched, what stopped it. Test an unsaved tree from a compile response, or a saved rule by rule_id (its current version, run with its author's access). The rule reads only mail its author can read and its scope covers; an unsaved tree covers only your own mail unless evaluation_scope names more. Without email_ids, the newest emails it can read are tested, at most 200 and none older than 30 days; expected emails (expect, or a saved rule's saved expectations) are tested whatever their age. Unclassified emails more than 2 hours old are classified first and their classification saved, unless classify_missing is false; newer ones are reported unclassified, pending. The rule itself records and grants nothing. Classification and the rule's questions stop at about 90 seconds; a rerun continues the classification where it stopped. 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.
3602
3642
  */
3603
3643
  const testEmailRule = (options) => (options.client ?? client).post({
3604
3644
  security: [{
@@ -3615,7 +3655,7 @@ const testEmailRule = (options) => (options.client ?? client).post({
3615
3655
  /**
3616
3656
  * Test a rule against a made-up email
3617
3657
  *
3618
- * Reports what a rule would decide for an email you describe: its sender, recipients, subject, plain text and attachment types, and optionally whether it is automated or from a mailing list and its spam score. The email is classified the way received mail is, and the rule's conditions and its own questions are decided as they would be for received mail with that content and those signals, received now. Without them it is not automated and not from a mailing list; a rule that reads a spam score you gave none for is decided on no score, and spam_score is listed in unset_columns. Nothing is stored: no email, classification or decision. Test an unsaved tree from a compile response, or a saved rule by rule_id (its current version); an unsaved tree is run as covering only your own mail unless evaluation_scope names more, as on POST /email-rules/test. The answer includes what the classifier read from the email. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3658
+ * Reports what a rule would decide for an email you describe (sender, recipients, subject, plain text, attachment types; optionally whether it is automated or from a mailing list, and its spam score), received now: it is classified, and the conditions and questions decided, as received mail would be. By default it is not automated or from a list; a rule reading a spam score you gave none for decides on none (spam_score is then in unset_columns). Nothing is stored. Test an unsaved tree (covering only your own mail unless evaluation_scope names more) or a saved rule by rule_id. The answer includes what the classifier read. 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.
3619
3659
  */
3620
3660
  const testEmailRuleOnSample = (options) => (options.client ?? client).post({
3621
3661
  security: [{
@@ -3632,7 +3672,7 @@ const testEmailRuleOnSample = (options) => (options.client ?? client).post({
3632
3672
  /**
3633
3673
  * List rules
3634
3674
  *
3635
- * The rules the caller can see, newest first: their own, or every member's rules for a caller who reads the whole organization's mail. Each carries its scope (evaluation_scope, and scope_selection for a selected rule). With matched_email_id, only the rules that matched that email. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3675
+ * The rules the caller can see, newest first: their own, or every member's rules for a caller who reads the whole organization's mail. Each carries its scope (evaluation_scope, and scope_selection for a selected rule). With matched_email_id, only the rules that matched that 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.
3636
3676
  */
3637
3677
  const listEmailRules = (options) => (options?.client ?? client).get({
3638
3678
  security: [{
@@ -3645,7 +3685,7 @@ const listEmailRules = (options) => (options?.client ?? client).get({
3645
3685
  /**
3646
3686
  * Create a rule
3647
3687
  *
3648
- * Saves a rule as version 1, from a compile response or a tree you wrote. The tree is checked against the column contract. New rules start in observe, where what the rule matches is recorded and nothing is granted or blocked; draft is not evaluated. The caller is the rule's author, and the rule never reaches mail the author cannot read. evaluation_scope chooses whose mail it runs over: own_mailboxes (only your own mail) when omitted, so any other scope (author for all you can read, or selected) is named; scope_selection may name only what you can read. The answer carries the scope as stored. kind do_not_share makes a rule that blocks sharing: it runs before every other rule, and while it is active no rule shares an email it matches or cannot decide. A key cannot list one (details.reason rule_blocks_sharing on the key). Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3688
+ * 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.
3649
3689
  */
3650
3690
  const createEmailRule = (options) => (options.client ?? client).post({
3651
3691
  security: [{
@@ -3662,7 +3702,7 @@ const createEmailRule = (options) => (options.client ?? client).post({
3662
3702
  /**
3663
3703
  * Delete a rule
3664
3704
  *
3665
- * Deletes a rule with its versions, its decisions and the access it granted. The author, or a caller who reads the whole organization's mail, may delete it; while it is shared with another member, only the author or someone who manages members from the dashboard. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3705
+ * Deletes a rule with its versions, its decisions and the access it granted. The author, or a caller who reads the whole organization's mail, may delete it; while it is shared with another member, only the author or someone who manages members from the dashboard. 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.
3666
3706
  */
3667
3707
  const deleteEmailRule = (options) => (options.client ?? client).delete({
3668
3708
  security: [{
@@ -3675,7 +3715,7 @@ const deleteEmailRule = (options) => (options.client ?? client).delete({
3675
3715
  /**
3676
3716
  * Read a rule
3677
3717
  *
3678
- * A rule, its scope (evaluation_scope, and scope_selection for a selected rule) and its current version. What the scope comes to for its author now is GET /email-rules/{id}/scope. The SQL the version renders to is included only when include_sql is true. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3718
+ * A rule, its scope (evaluation_scope, and scope_selection for a selected rule), its current version and its saved expectations. What the scope comes to for its author now is GET /email-rules/{id}/scope. The SQL the version renders to is included only when include_sql is true. 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.
3679
3719
  */
3680
3720
  const getEmailRule = (options) => (options.client ?? client).get({
3681
3721
  security: [{
@@ -3688,7 +3728,7 @@ const getEmailRule = (options) => (options.client ?? client).get({
3688
3728
  /**
3689
3729
  * Change a rule
3690
3730
  *
3691
- * Renames the rule, saves a new version (english, tree and explanation together; earlier versions are kept unchanged), changes its state (draft, disabled; observe; or active) or changes whose mail it runs over (evaluation_scope, with scope_selection when selected). Only the rule's author may rename it, add a version, change its scope or move it to observe or active; anyone else who can see it may only disable it (state draft), and while it is shared with another member only if they manage members from the dashboard. Omit evaluation_scope to keep the current scope. A scope change saves a new version with the same conditions; what was granted stays. A shared rule keeps its scope. A rule's kind never changes. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3731
+ * Renames the rule, saves a new version (english and tree together, with an explanation or one the server writes; earlier versions stay), changes its state (draft is off; observe; active), whose mail it runs over (evaluation_scope, with scope_selection when selected) or its saved expectations (each saved version and new set is judged in expectations_check). Anyone but its author who sees it may only disable it (state draft), and while it is shared only if they manage members from the dashboard. Without evaluation_scope the scope stays; a scope change saves a new version with the same conditions, and what was granted stays. A shared rule keeps its scope; a kind never changes. Send if_version, the current_version you read, so a write never replaces a version saved since. 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.
3692
3732
  */
3693
3733
  const updateEmailRule = (options) => (options.client ?? client).patch({
3694
3734
  security: [{
@@ -3705,7 +3745,7 @@ const updateEmailRule = (options) => (options.client ?? client).patch({
3705
3745
  /**
3706
3746
  * List a rule's decisions
3707
3747
  *
3708
- * What the rule decided for each email it was evaluated against, newest first: whether it matched, whether it nearly did, how each part decided and the answers to its questions. Only decisions on emails the caller can read are listed. With matched, only matches (true) or only the rest (false). Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3748
+ * What the rule decided for each email it was evaluated against, newest first: whether it matched, whether it nearly did, how each part decided and the answers to its questions, with which email it was (from_address, subject, received_at). Only decisions on emails the caller can read are listed. With matched, only matches (true) or only the rest (false). 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.
3709
3749
  */
3710
3750
  const listEmailRuleDecisions = (options) => (options.client ?? client).get({
3711
3751
  security: [{
@@ -3718,7 +3758,7 @@ const listEmailRuleDecisions = (options) => (options.client ?? client).get({
3718
3758
  /**
3719
3759
  * List every rule's result on an email
3720
3760
  *
3721
- * Every rule the caller can see and what it decided about this email: those that matched, those that did not, and those that have not run on it, with what is known about them. A result names the version of the rule that decided and carries that version's conditions and questions. A matched rule with kind do_not_share keeps rules from sharing the email while it is active; anything shared before then stays shared. Only a caller who can read the email gets an answer, and a rule the caller cannot see is left out. At most 50 rules are listed, those with a result first; hidden counts the rest. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3761
+ * Every rule you can see and what it decided about this email (matched, not matched, or not run, with what is known), in the words of the version that decided. A matched do_not_share rule keeps rules from sharing the email while it is active; what was shared before then stays shared. Only a caller who can read the email gets an answer. classification is what the classifier read from the email, every fact as rule conditions read it, so you can see why a rule did or did not match. At most 50 rules are listed, those with a result first; hidden counts the rest. 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.
3722
3762
  */
3723
3763
  const listEmailRuleResults = (options) => (options.client ?? client).get({
3724
3764
  security: [{
@@ -3731,7 +3771,7 @@ const listEmailRuleResults = (options) => (options.client ?? client).get({
3731
3771
  /**
3732
3772
  * Read versions of a rule
3733
3773
  *
3734
- * The named versions of a rule, as they were written: what each one's conditions and questions were, so a decision can be read against the version that made it. Numbers that are not versions of the rule are left out. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3774
+ * A rule's versions as they were written: what each one's conditions and questions were, so a decision can be read against the version that made it. Without versions, every version newest first, a page at a time (meta.cursor). With versions, only those named, oldest first; numbers that are not versions of the rule are left out. 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.
3735
3775
  */
3736
3776
  const listEmailRuleVersions = (options) => (options.client ?? client).get({
3737
3777
  security: [{
@@ -3744,7 +3784,7 @@ const listEmailRuleVersions = (options) => (options.client ?? client).get({
3744
3784
  /**
3745
3785
  * Read what a rule covers
3746
3786
  *
3747
- * Whose mail the rule runs over, and what that comes to now: a rule never reaches further than what its author can read when it runs, so what a selected rule names and its author can no longer read stops matching. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3787
+ * Whose mail the rule runs over, and what that comes to now: a rule never reaches further than what its author can read when it runs, so what a selected rule names and its author can no longer read stops matching. 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.
3748
3788
  */
3749
3789
  const getEmailRuleScope = (options) => (options.client ?? client).get({
3750
3790
  security: [{
@@ -3757,7 +3797,7 @@ const getEmailRuleScope = (options) => (options.client ?? client).get({
3757
3797
  /**
3758
3798
  * List what a rule can cover
3759
3799
  *
3760
- * How much the caller can read, and the inboxes and domains the caller can read, which is what they may name when a rule runs over selected inboxes and domains. For a caller who reads the whole organization, addresses lists the inboxes known as someone's (member addresses, members' verified work emails at the organization's domains, agents' addresses and inboxes with shared access), not every address that receives mail: may_name_unlisted says when an address that is not listed, such as an inbox nobody has claimed, may be named too. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3800
+ * How much the caller can read, and the inboxes and domains the caller can read, which is what they may name when a rule runs over selected inboxes and domains. For a caller who reads the whole organization, addresses lists the inboxes known as someone's (member addresses, members' verified work emails at the organization's domains, agents' addresses and inboxes with shared access), not every address that receives mail: may_name_unlisted says when an address that is not listed, such as an inbox nobody has claimed, may be named too. 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.
3761
3801
  */
3762
3802
  const listEmailRuleScopeOptions = (options) => (options?.client ?? client).get({
3763
3803
  security: [{
@@ -3770,7 +3810,7 @@ const listEmailRuleScopeOptions = (options) => (options?.client ?? client).get({
3770
3810
  /**
3771
3811
  * List rule requests
3772
3812
  *
3773
- * Rule requests, newest first: those made to you (box incoming, the default), those you made (outgoing), or every one you can see (all). Pending ones by default; status decided lists accepted, declined and withdrawn ones, and any lists both. A request is visible to the member who made it, the member it was made to, and the organization's owners and admins. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3813
+ * Rule requests, newest first: those made to you (box incoming, the default), those you made (outgoing), or every one you can see (all). Pending ones by default; status decided lists accepted, declined and withdrawn ones, and any lists both. A request is visible to the member who made it, the member it was made to, and the organization's owners and admins. 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.
3774
3814
  */
3775
3815
  const listEmailRuleRequests = (options) => (options?.client ?? client).get({
3776
3816
  security: [{
@@ -3783,7 +3823,7 @@ const listEmailRuleRequests = (options) => (options?.client ?? client).get({
3783
3823
  /**
3784
3824
  * Ask a member for a rule
3785
3825
  *
3786
- * Asks another member of the organization for a rule over their own mail, from a compile response or a tree you wrote. Name them by user id, or by their member mailbox address (at most 30 lookups by address an hour). Nothing is evaluated and nothing is shared until they accept, and they may change the rule first; they see the request and can preview what it matches in their own mail. You may have at most 5 pending requests to one member and 50 in all. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3826
+ * Asks another member of the organization for a rule over their own mail, from a compile response or a tree you wrote. Name them by user id, or by their member mailbox address, or by their verified work email if you can list members (at most 30 lookups by address an hour). Nothing is evaluated and nothing is shared until they accept, and they may change the rule first; they see the request and can preview what it matches in their own mail. You may have at most 5 pending requests to one member and 50 in all. If you can list members (members:read), the answer also says whether they can accept it under their role (target_can_accept), and if not, why (target_warning); the request is sent either way. To find out before asking, use POST /v1/email-rule-requests/target-check. 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.
3787
3827
  */
3788
3828
  const createEmailRuleRequest = (options) => (options.client ?? client).post({
3789
3829
  security: [{
@@ -3798,9 +3838,39 @@ const createEmailRuleRequest = (options) => (options.client ?? client).post({
3798
3838
  }
3799
3839
  });
3800
3840
  /**
3841
+ * Check whether a member can accept a rule request
3842
+ *
3843
+ * Says, before you ask, whether a member could accept a rule request now under their role, and if not, which permission their role lacks. Nothing is sent and nothing is recorded. Needs members:read, as listing members and their roles does. At most 60 checks an hour. Name them by user id, or by their member mailbox address or verified work email (counted with asking: at most 30 lookups by address an hour). 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.
3844
+ */
3845
+ const checkEmailRuleRequestTarget = (options) => (options.client ?? client).post({
3846
+ security: [{
3847
+ scheme: "bearer",
3848
+ type: "http"
3849
+ }],
3850
+ url: "/email-rule-requests/target-check",
3851
+ ...options,
3852
+ headers: {
3853
+ ...options.body !== void 0 && { "Content-Type": "application/json" },
3854
+ ...options.headers
3855
+ }
3856
+ });
3857
+ /**
3858
+ * Delete a withdrawn rule request
3859
+ *
3860
+ * Deletes a request you withdrew, for everyone who could see it. 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.
3861
+ */
3862
+ const deleteEmailRuleRequest = (options) => (options.client ?? client).delete({
3863
+ security: [{
3864
+ scheme: "bearer",
3865
+ type: "http"
3866
+ }],
3867
+ url: "/email-rule-requests/{id}",
3868
+ ...options
3869
+ });
3870
+ /**
3801
3871
  * Read a rule request
3802
3872
  *
3803
- * 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. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3873
+ * 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. 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.
3804
3874
  */
3805
3875
  const getEmailRuleRequest = (options) => (options.client ?? client).get({
3806
3876
  security: [{
@@ -3813,7 +3883,7 @@ const getEmailRuleRequest = (options) => (options.client ?? client).get({
3813
3883
  /**
3814
3884
  * Decline a rule request
3815
3885
  *
3816
- * Declines a pending request made to you. Nothing is written but the decision. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3886
+ * Declines a pending request made to you. Nothing is written but the decision. 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.
3817
3887
  */
3818
3888
  const declineEmailRuleRequest = (options) => (options.client ?? client).post({
3819
3889
  security: [{
@@ -3826,7 +3896,7 @@ const declineEmailRuleRequest = (options) => (options.client ?? client).post({
3826
3896
  /**
3827
3897
  * Withdraw a rule request
3828
3898
  *
3829
- * Withdraws a pending request you made. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3899
+ * Withdraws a pending request you made. 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.
3830
3900
  */
3831
3901
  const withdrawEmailRuleRequest = (options) => (options.client ?? client).post({
3832
3902
  security: [{
@@ -3839,7 +3909,7 @@ const withdrawEmailRuleRequest = (options) => (options.client ?? client).post({
3839
3909
  /**
3840
3910
  * Accept a rule request
3841
3911
  *
3842
- * 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, tree and explanation together. 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. Also needs mail:send_as_member: a role that can only read this mailbox is refused. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3912
+ * 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. 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.
3843
3913
  */
3844
3914
  const acceptEmailRuleRequest = (options) => (options.client ?? client).post({
3845
3915
  security: [{
@@ -3856,7 +3926,7 @@ const acceptEmailRuleRequest = (options) => (options.client ?? client).post({
3856
3926
  /**
3857
3927
  * List rule shares
3858
3928
  *
3859
- * Lists rules shared with you, rules you share, or every share you can see. A share is visible to its two people and the organization's owners and admins. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3929
+ * Lists rules shared with you, rules you share, or every share you can see. A share is visible to its two people and the organization's owners and admins. 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.
3860
3930
  */
3861
3931
  const listEmailRuleShares = (options) => (options?.client ?? client).get({
3862
3932
  security: [{
@@ -3895,7 +3965,7 @@ const endEmailRuleShare = (options) => (options.client ?? client).delete({
3895
3965
  /**
3896
3966
  * Get a rule share
3897
3967
  *
3898
- * One share. Needs mail:read, a credential acting as a member with their full access (API keys, agent keys and narrowed tokens are refused), and the email rules feature on the organization.
3968
+ * One share. 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.
3899
3969
  */
3900
3970
  const getEmailRuleShare = (options) => (options.client ?? client).get({
3901
3971
  security: [{
@@ -3906,9 +3976,9 @@ const getEmailRuleShare = (options) => (options.client ?? client).get({
3906
3976
  ...options
3907
3977
  });
3908
3978
  /**
3909
- * List the emails a rule share has given you
3979
+ * List the emails a rule share has given
3910
3980
  *
3911
- * The emails a rule shared with you has matched, newest first, as the email list shows them. Only the person it was shared with can list them, from the dashboard or the Primitive CLI. An ended share lists nothing. A page can be short or empty and still carry a cursor: keep reading until meta.cursor is null.
3981
+ * The emails a rule share has given, newest first, as the email list shows them, each with shared_at. For the person it was shared with: what they can read through it now, so an ended share lists nothing, and shared_at is when the share's rule first matched the email. For the person sharing their mail: everything it has handed over while it ran, including after it ended and whatever the rule's state now, so they can see what left their mailbox, and shared_at is when it was handed over. Only those two people can list them, from the dashboard or the Primitive CLI. A page can be short or empty and still carry a cursor: keep reading until meta.cursor is null.
3912
3982
  */
3913
3983
  const listEmailRuleShareEmails = (options) => (options.client ?? client).get({
3914
3984
  security: [{
@@ -4133,6 +4203,19 @@ const getOwnGrant = (options) => (options?.client ?? client).get({
4133
4203
  ...options
4134
4204
  });
4135
4205
  /**
4206
+ * List the addresses this credential can send from
4207
+ *
4208
+ * The From addresses the calling credential may send from with POST /send-mail, and the one a send that names no From should use. Every address listed is one that send would accept as From for this credential, recipients aside. A connected agent's default is its own address. A person's default is their own member address, for a session and for every OAuth login of theirs, an agent's included. Any other credential has a default only when exactly one address and no domain is listed, and never a person's own member address. When there is no default, `reason` says why. `domains` lists the domains at which the credential may send from any address that is not reserved to someone else or left out of its grant; each is one GET /outbound/status lists as sendable for it. A credential that cannot send new mail, or one in an account where outbound mail is not enabled, gets no addresses and no domains. Every credential may ask about itself, a connected agent's key included, except a Function-bound key limited to its Function's own operations (403 function_scope_forbidden). It answers nothing about any other credential.
4209
+ */
4210
+ const getSendFrom = (options) => (options?.client ?? client).get({
4211
+ security: [{
4212
+ scheme: "bearer",
4213
+ type: "http"
4214
+ }],
4215
+ url: "/whoami/send-from",
4216
+ ...options
4217
+ });
4218
+ /**
4136
4219
  * List consumer Inbox routing rules
4137
4220
  *
4138
4221
  * Mailbox-scoped exact visible audiences, excluding the owner and Bcc. Direct and group audiences are independent. Restores persist an explicit Conversations rule. New writes require the observed version (zero creates); only an identical latest mutation with its original expected version can be retried. Stale writes return mail_routing_conflict. Source messages and read state are unchanged. Merge paged rules by version; responses are never cached.
@@ -4475,7 +4558,7 @@ const checkSendability = (options) => (options.client ?? client).post({
4475
4558
  /**
4476
4559
  * Get a webhook delivery
4477
4560
  *
4478
- * One webhook delivery attempt record, by the id listDeliveries returns.
4561
+ * One webhook delivery attempt record, by the id listDeliveries returns, with every attempt of the same delivery (a retry is recorded as a new attempt with its own id).
4479
4562
  */
4480
4563
  const getDelivery = (options) => (options.client ?? client).get({
4481
4564
  security: [{
@@ -4523,7 +4606,7 @@ const revokeOrganizationInvitation = (options) => (options.client ?? client).del
4523
4606
  ...options
4524
4607
  });
4525
4608
  /**
4526
- * Requires a current human organization membership, or an org-wide API key: a super admin key, or a custom key with no addresses or domains whose grant holds members:read. A key lists members as the person it belongs to, at that person's live grant, and only while that person still holds members:read. Narrowed, Function and connected keys are refused. No local paths or existing conversation history are shared.
4609
+ * Requires a current human organization membership, or an org-wide API key: a super admin key, or a custom key with no addresses or domains whose grant holds members:read. A key lists members as the person it belongs to, at that person's live grant, and only while that person still holds members:read. Narrowed, Function and connected keys are refused. A caller holding members:read also gets each person's mail_access. No local paths or existing conversation history are shared.
4527
4610
  */
4528
4611
  const listOrganizationPeople = (options) => (options?.client ?? client).get({
4529
4612
  security: [{
@@ -4636,7 +4719,7 @@ const revokeProjectInvitation = (options) => (options.client ?? client).delete({
4636
4719
  /**
4637
4720
  * List mailbox access
4638
4721
  *
4639
- * Every access entry in the organization: who (a member, group, agent or address) may read, draft or send for each mailbox or domain. An entry that reads a mailbox reads the full email; raw MIME follows the person's mail.raw:read. `depth` is deprecated: it is accepted and ignored, and new entries record content. Needs members:read: a person, or an org-wide API key whose person holds it.
4722
+ * Every access entry in the organization: who (a member, group, agent or address) may read, draft or send for each mailbox or domain. An entry that reads a mailbox reads the full email; raw MIME follows the person's mail.raw:read. `depth` is deprecated: it is accepted and ignored, and new entries record content. With no entries, `note` says where each member's mail access comes from instead. Needs members:read: a person, or an org-wide API key whose person holds it.
4640
4723
  */
4641
4724
  const listMailboxAccess = (options) => (options?.client ?? client).get({
4642
4725
  security: [{
@@ -4726,7 +4809,7 @@ const updateGroup = (options) => (options.client ?? client).patch({
4726
4809
  /**
4727
4810
  * List every credential
4728
4811
  *
4729
- * Every credential that can act in the organization: API keys, Function keys, agent connection keys, connected apps (OAuth), agent delegates and, where enabled, CLI logins. Secrets are never returned. Filter with kind. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Only Primitive turns these on.
4812
+ * Every credential that can act in the organization: API keys, Function keys, agent connection keys, connected apps (OAuth), agent delegates and, where enabled, CLI logins. Secrets are never returned. A key's grant.mail_scope.depth is raw only when it holds mail.raw:read and its scope lists an address or a domain, otherwise content. Filter with kind. 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.
4730
4813
  *
4731
4814
  * Person only: a dashboard session. The person's role must hold credentials:read. API keys, agent connection keys and agents are refused.
4732
4815
  */
@@ -4741,9 +4824,9 @@ const listCredentials = (options) => (options?.client ?? client).get({
4741
4824
  /**
4742
4825
  * Revoke a credential
4743
4826
  *
4744
- * Revoke one credential by kind and id. A Function key is rotated, never revoked (409 rotate_instead). An API key is revoked only 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. What the credential set up keeps working and is listed in standing_objects for review. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Only Primitive turns these on.
4827
+ * Revoke one credential by kind and id. A Function key is rotated, never revoked (409 rotate_instead). An API key is revoked only 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. What the credential set up keeps working and is listed in standing_objects for review. 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.
4745
4828
  *
4746
- * Person only: a dashboard session. The person's role must hold keys:manage. API keys, agent connection keys and agents are refused.
4829
+ * Person 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.
4747
4830
  */
4748
4831
  const revokeCredential = (options) => (options.client ?? client).post({
4749
4832
  security: [{
@@ -4760,7 +4843,7 @@ const revokeCredential = (options) => (options.client ?? client).post({
4760
4843
  /**
4761
4844
  * Revoke every credential (emergency)
4762
4845
  *
4763
- * The emergency response to a leak: revokes every API key, agent connection key and connected app created since a time, rotates the organization Function key and every running Function's own key, and optionally suspends Functions. Owners only, from a dashboard session, and the body must confirm with "revoke all". Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Only Primitive turns these on.
4846
+ * The emergency response to a leak: revokes every API key, agent connection key and connected app created since a time, rotates the organization Function key and every running Function's own key, and optionally suspends Functions. Owners only, from a dashboard session, and the body must confirm with "revoke all". 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.
4764
4847
  *
4765
4848
  * Person only: a dashboard session. The person's role must hold credentials:revoke_all. API keys, agent connection keys and agents are refused.
4766
4849
  */
@@ -4779,7 +4862,7 @@ const revokeAllCredentials = (options) => (options.client ?? client).post({
4779
4862
  /**
4780
4863
  * Read the credential audit trail
4781
4864
  *
4782
- * Credential events (created, rotated, edited, revoked, used with a step-up, policy changes), newest first, with a cursor. format=csv returns the same page as CSV. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Only Primitive turns these on.
4865
+ * Credential events (created, rotated, edited, revoked, used with a step-up, policy changes), newest first, with a cursor. format=csv returns the same page as CSV. 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.
4783
4866
  *
4784
4867
  * Person only: a dashboard session. The person's role must hold credential_events:read. API keys, agent connection keys and agents are refused.
4785
4868
  */
@@ -4794,7 +4877,7 @@ const listCredentialEvents = (options) => (options?.client ?? client).get({
4794
4877
  /**
4795
4878
  * Read the credential policy
4796
4879
  *
4797
- * The organization credential policy: key lifetime and expiry rules, who may create super admin keys, whether members may create keys and the other rules every new key is held to. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Only Primitive turns these on.
4880
+ * The organization credential policy: key lifetime and expiry rules, who may create super admin keys, whether members may create keys and the other rules every new key is held to. 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.
4798
4881
  *
4799
4882
  * Person only: a dashboard session. The person's role must hold credentials:read. API keys, agent connection keys and agents are refused.
4800
4883
  */
@@ -4809,7 +4892,7 @@ const getCredentialPolicy = (options) => (options?.client ?? client).get({
4809
4892
  /**
4810
4893
  * Change the credential policy
4811
4894
  *
4812
- * Change one or more policy rules. Admins may only tighten the policy; loosening any rule needs an owner. Owners and admins are emailed about every change. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Only Primitive turns these on.
4895
+ * Change one or more policy rules. Admins may only tighten the policy; loosening any rule needs an owner. Owners and admins are emailed about every change. 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.
4813
4896
  *
4814
4897
  * Person only: a dashboard session. The person's role must hold credential_policy:manage. API keys, agent connection keys and agents are refused.
4815
4898
  */
@@ -4828,7 +4911,7 @@ const updateCredentialPolicy = (options) => (options.client ?? client).patch({
4828
4911
  /**
4829
4912
  * Read the key builder
4830
4913
  *
4831
- * The key presets the caller may use (each with whether it is available and why not), the permission matrix for custom keys and the policy in force. An area marked org_wide_only (Members) is listed only to a person who holds its permission, and only a custom key with no addresses or domains may hold it. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Only Primitive turns these on.
4914
+ * The key presets the caller may use (each with whether it is available and why not), the permission matrix for custom keys and the policy in force. An area marked org_wide_only (Members) is listed only to a person who holds its permission, and only a custom key with no addresses or domains may hold it. 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.
4832
4915
  *
4833
4916
  * Person only: a dashboard session. The person's role must hold keys:read. API keys, agent connection keys and agents are refused.
4834
4917
  */
@@ -4843,7 +4926,7 @@ const getKeyBuilder = (options) => (options?.client ?? client).get({
4843
4926
  /**
4844
4927
  * List API keys
4845
4928
  *
4846
- * Key metadata, never a secret: name, prefix, grant, creator, last use, expiry and suspension. The person needs access to the whole organization's mail. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Only Primitive turns these on.
4929
+ * Key metadata, never a secret: name, prefix, grant, creator, last use, expiry, suspension and whether each key works now (status). A grant's mail_scope.depth is raw only when the key holds mail.raw:read and its scope lists an address or a domain, otherwise content. The person needs access to the whole organization's mail. 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.
4847
4930
  *
4848
4931
  * Person only: a dashboard session or the person's own Primitive CLI token; no other OAuth app. The person's role must hold keys:read. API keys, agent connection keys and agents are refused.
4849
4932
  */
@@ -4858,9 +4941,9 @@ const listKeys = (options) => (options?.client ?? client).get({
4858
4941
  /**
4859
4942
  * Create an API key
4860
4943
  *
4861
- * Create an API key, super admin or narrowed to a preset or a custom permission set, optionally with an expiry and conditions. The secret is returned once. A key never holds more than the person creating it; the credential policy decides who may create which keys. grant is required: a request without it is refused (400 validation_error, details.reason grant_required), never treated as super admin. A custom key must say which mail it reaches: the addresses and domains it lists (grant.addresses, grant.domains), or every mailbox in the organization with grant.mail_scope "org", which cannot be combined with them; one that says neither is refused (400 validation_error, details.reason mail_scope_required). Super admin, Send only and Read only reach every mailbox by definition. members:read is only for an org-wide custom key: naming it with grant.addresses or grant.domains is refused (400). Owners and admins are emailed about every super admin key. Send an Idempotency-Key to retry safely: a second create by the same person under the same key makes no second key and is refused (409 idempotency_key_reused) with the first key's id in error.details.key_id, so a caller whose first answer was lost can revoke that key. The onboarding field is for the dashboard only. The person's own Primitive CLI login needs no step-up (it acts as the person, held to the same rules); the Primitive app's token is refused, even with one. While the organization's keys API is not enabled, this answers 404 feature_disabled (details.feature keys_api; only Primitive turns it on), except that a dashboard session may still create a super admin key (the dashboard's own create).
4944
+ * Create an API key, super admin or narrowed to a preset or a custom permission set, optionally with an expiry and conditions. The secret is returned once. A key never holds more than the person creating it; the credential policy decides who may create which keys. grant is required: a request without it is refused (400 validation_error, details.reason grant_required), never treated as super admin. A custom key must say which mail it reaches: the addresses and domains it lists (grant.addresses, grant.domains), or every mailbox in the organization with grant.mail_scope "org", which cannot be combined with them; one that says neither is refused (400 validation_error, details.reason mail_scope_required). Super admin, Send only and Read only reach every mailbox by definition. members:read is only for an org-wide custom key: naming it with grant.addresses or grant.domains is refused (400). Owners and admins are emailed about every super admin key. Send an Idempotency-Key to retry safely: a second create by the same person under the same key makes no second key and is refused (409 idempotency_key_reused) with the first key's id in error.details.key_id, so a caller whose first answer was lost can revoke that key. The onboarding field is for the dashboard only. 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. While the organization's keys API is not enabled, this answers 404 feature_disabled (details.feature keys_api; contact Primitive to turn it on), except that a dashboard session may still create a super admin key (the dashboard's own create).
4862
4945
  *
4863
- * Person only: a dashboard session, the person's own Primitive CLI login with no step-up, 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.
4946
+ * Person 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.
4864
4947
  */
4865
4948
  const createKey = (options) => (options.client ?? client).post({
4866
4949
  security: [{
@@ -4877,9 +4960,9 @@ const createKey = (options) => (options.client ?? client).post({
4877
4960
  /**
4878
4961
  * Rotate an API key
4879
4962
  *
4880
- * Mint a successor with the same grant and return its secret once. The old key keeps working for overlap_seconds, then stops. The person rotating must cover the key's access (403 grant_forbidden, details.reason target_not_covered), and a key an owner created 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); 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. Only Primitive turns these on.
4963
+ * 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. 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.
4881
4964
  *
4882
- * Person only: a dashboard session, the person's own Primitive CLI login with no step-up, 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.
4965
+ * Person 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.
4883
4966
  */
4884
4967
  const rotateKey = (options) => (options.client ?? client).post({
4885
4968
  security: [{
@@ -4896,7 +4979,7 @@ const rotateKey = (options) => (options.client ?? client).post({
4896
4979
  /**
4897
4980
  * Get an API key
4898
4981
  *
4899
- * One key's metadata, never its secret. The person needs access to the whole organization's mail. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Only Primitive turns these on.
4982
+ * One key's metadata, never its secret, with whether it works now (status). Its grant's mail_scope.depth is raw only when the key holds mail.raw:read and its scope lists an address or a domain, otherwise content. The person needs access to the whole organization's mail. 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.
4900
4983
  *
4901
4984
  * Person only: a dashboard session or the person's own Primitive CLI token; no other OAuth app. The person's role must hold keys:read. API keys, agent connection keys and agents are refused.
4902
4985
  */
@@ -4911,9 +4994,9 @@ const getKey = (options) => (options.client ?? client).get({
4911
4994
  /**
4912
4995
  * Change an API key
4913
4996
  *
4914
- * Rename a key, change its expiry, its grant or its conditions, or suspend it. 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. The person's own Primitive CLI login needs no step-up (it acts as the person, held to the same rules); 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. Only Primitive turns these on.
4997
+ * Rename a key, change its expiry, its grant or its conditions, or suspend it. 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. 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.
4915
4998
  *
4916
- * Person only: a dashboard session, the person's own Primitive CLI login with no step-up, 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.
4999
+ * Person 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.
4917
5000
  */
4918
5001
  const updateKey = (options) => (options.client ?? client).patch({
4919
5002
  security: [{
@@ -4930,7 +5013,7 @@ const updateKey = (options) => (options.client ?? client).patch({
4930
5013
  /**
4931
5014
  * Suggest a least-privilege grant for a key
4932
5015
  *
4933
- * The permissions a key used over the last 30 days, as a custom grant that would have served every successful call (also as builder areas), the narrowest mail scope its calls support (depth is deprecated: raw when it downloaded raw MIME, otherwise content) (the mailboxes of the messages it named and sent, with notes on what the request log cannot account for), and whether it is unused. Calls to routes only the super admin key can use (groups and mailbox access) derive no permission, since a custom key is refused there; super_admin_only_calls counts them. usage gives the same window anonymized: successful and failed requests per UTC day, the routes called by their declared template (never the called path) with the permission each needed, and how many mailboxes the key read and sent from (counts only, and only for a person with access to the whole organization's mail). Nothing is applied: narrowing is a change to the key (PATCH /v1/keys/:id). Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled, with details.feature naming the feature. Only Primitive turns these on.
5016
+ * The permissions a key used over the last 30 days, as a custom grant that would have served every successful call (also as builder areas), the narrowest mail scope its calls support (depth is deprecated: raw when it downloaded raw MIME, otherwise content) (the mailboxes of the messages it named and sent, with notes on what the request log cannot account for), and whether it is unused. Calls to routes only the super admin key can use (groups and mailbox access) derive no permission, since a custom key is refused there; super_admin_only_calls counts them. usage gives the same window anonymized: successful and failed requests per UTC day, the routes called by their declared template (never the called path) with the permission each needed, and how many mailboxes the key read and sent from (counts only, and only for a person with access to the whole organization's mail). Nothing is applied: narrowing is a change to the key (PATCH /v1/keys/:id). 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.
4934
5017
  *
4935
5018
  * Person only: a dashboard session. The person's role must hold credentials:read. API keys, agent connection keys and agents are refused.
4936
5019
  */
@@ -5111,7 +5194,7 @@ const updateSearchSettings = (options) => (options.client ?? client).put({
5111
5194
  /**
5112
5195
  * List roles
5113
5196
  *
5114
- * Every role in the organization (built-in, template copies and custom roles), with how many members and groups hold each, the templates not yet copied, and whether roles can be assigned now. Any person (a session or OAuth token); API keys are refused.
5197
+ * Every role in the organization (built-in, template copies and custom roles), with how many members and groups hold each, the templates not yet copied, and whether roles can be assigned now. `unassigned` describes role restricted on a member with no role_id, which is not a role and is never in `roles`. Any person (a session or OAuth token); API keys are refused.
5115
5198
  */
5116
5199
  const listRoles = (options) => (options?.client ?? client).get({
5117
5200
  security: [{
@@ -5124,7 +5207,7 @@ const listRoles = (options) => (options?.client ?? client).get({
5124
5207
  /**
5125
5208
  * Create a custom role
5126
5209
  *
5127
- * A role nobody can use to gain access they do not hold: its permissions and mail scope must be within the author's own. mail_scope is "org" (the default) or { addresses, domains }; any other value is refused with 400 `validation_error`. Every role that reaches mail reads it in full, and raw MIME follows the role's mail.raw:read; `depth` is deprecated and ignored. Its mail scope names no other member's personal mailbox: otherwise 403 `grant_forbidden` with `details.reason` `personal_mailbox_member_only`. Person only: a dashboard session, or the person's own OAuth or CLI token with a session step-up of purpose `roles.write` (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 roles:assign. API keys are refused.
5210
+ * A role nobody can use to gain access they do not hold: its permissions and mail scope must be within the author's own. mail_scope is "org" (the default) or { addresses, domains }; any other value is refused with 400 `validation_error`. Every role that reaches mail reads it in full, and raw MIME follows the role's mail.raw:read; `depth` is deprecated and ignored. Its mail scope names no other member's personal mailbox: otherwise 403 `grant_forbidden` with `details.reason` `personal_mailbox_member_only`. Each permission must have what it requires in the same role: mail:read for mail.raw:read, mail.search:semantic, mail:share_own, changes:read and webhooks:read; mail:send for mail:send_batch and mail:send_as_member; functions:deploy for templates:install; agent_connections:manage for agent_connections:custom_domains. Otherwise 400 `validation_error` with `details.reason` `unmet_requirement`, `details.permission` and `details.requires`. Person only: a dashboard session, or the person's own OAuth or CLI token with a session step-up of purpose `roles.write` (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 roles:assign. API keys are refused.
5128
5211
  */
5129
5212
  const createRole = (options) => (options.client ?? client).post({
5130
5213
  security: [{
@@ -5154,7 +5237,7 @@ const deleteRole = (options) => (options.client ?? client).delete({
5154
5237
  /**
5155
5238
  * Change a custom role
5156
5239
  *
5157
- * A new version of the role, with a new `id`: the version you edited is retired, the response is the new one (same `key`, `version` one higher), and every member and group holding the role moves to it. The old id answers 404 `not_found` from then on, so store the returned `id` (or look the role up by `key` in GET /roles) before editing or assigning it again. Every holder whose access shrinks goes through the reduction path. mail_scope follows the same rules as creating a role; a role whose stored scope cannot be read must be sent a new mail_scope, otherwise 400 `validation_error` with `details.reason` `invalid_mail_scope`. A personal mailbox the new version adds must be the author's own, and every holder must be the member of each personal mailbox it names: otherwise 403 `grant_forbidden` with `details.reason` `personal_mailbox_member_only`. Person only: a dashboard session, or the person's own OAuth or CLI token with a session step-up of purpose `roles.write` (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 roles:assign. API keys are refused.
5240
+ * A new version of the role, with a new `id`: the version you edited is retired, the response is the new one (same `key`, `version` one higher), and every member and group holding the role moves to it. The old id answers 404 `not_found` from then on, so store the returned `id` (or look the role up by `key` in GET /roles) before editing or assigning it again. Every holder whose access shrinks goes through the reduction path. mail_scope follows the same rules as creating a role; a role whose stored scope cannot be read must be sent a new mail_scope, otherwise 400 `validation_error` with `details.reason` `invalid_mail_scope`. A personal mailbox the new version adds must be the author's own, and every holder must be the member of each personal mailbox it names: otherwise 403 `grant_forbidden` with `details.reason` `personal_mailbox_member_only`. Each permission in the new version must have what it requires in the same role, as when creating one, including permissions carried over unchanged. Person only: a dashboard session, or the person's own OAuth or CLI token with a session step-up of purpose `roles.write` (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 roles:assign. API keys are refused.
5158
5241
  */
5159
5242
  const updateRole = (options) => (options.client ?? client).patch({
5160
5243
  security: [{
@@ -5377,7 +5460,7 @@ const listSuspensions = (options) => (options?.client ?? client).get({
5377
5460
  /**
5378
5461
  * Decide a suspension
5379
5462
  *
5380
- * Keep, narrow or revoke one suspended or flagged item. Keeping it, and revoking an API key, needs the decider to cover it (revoking an uncovered key 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`). 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.
5463
+ * Keep, narrow or revoke one suspended or flagged item. Keeping it, and revoking an API key, needs the decider to cover it (revoking an uncovered key 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.
5381
5464
  */
5382
5465
  const decideSuspension = (options) => (options.client ?? client).post({
5383
5466
  security: [{
@@ -5499,6 +5582,32 @@ const releaseSentEmail = (options) => (options.client ?? client).post({
5499
5582
  }
5500
5583
  });
5501
5584
  /**
5585
+ * Get a webhook's own signing secret
5586
+ *
5587
+ * The secret deliveries to this webhook are signed with, when it signs with its own (signed_with is own_secret). Verify the Primitive-Signature header with it. A webhook a person owns is given its secret the first time it is asked for. A webhook that signs with the organization's secret answers 409 conflict: rotate its signing secret to give it its own. Answered to the person who owns the webhook; for a webhook an API key owns, to the key that acts for it and the person who holds that key; for one a third-party app or an agent delegate owns, to that app or delegate; and for a webhook the organization owns, to a caller who may change it and holds webhook_secret:read.
5588
+ */
5589
+ const getEndpointSigningSecret = (options) => (options.client ?? client).get({
5590
+ security: [{
5591
+ scheme: "bearer",
5592
+ type: "http"
5593
+ }],
5594
+ url: "/endpoints/{id}/signing-secret",
5595
+ ...options
5596
+ });
5597
+ /**
5598
+ * Rotate a webhook's signing secret, or give it its own
5599
+ *
5600
+ * Replaces the webhook's own signing secret, or gives a webhook that signs with the organization's secret one of its own, and returns it. Deliveries are signed with the new secret at once, so update the handler at the same time. Answered to the person who owns the webhook; for a webhook an API key owns, to the key that acts for it and the person who holds that key; for one a third-party app or an agent delegate owns, to that app or delegate; and for a webhook the organization owns, to a caller who may change it and holds webhook_secret:read.
5601
+ */
5602
+ const rotateEndpointSigningSecret = (options) => (options.client ?? client).post({
5603
+ security: [{
5604
+ scheme: "bearer",
5605
+ type: "http"
5606
+ }],
5607
+ url: "/endpoints/{id}/signing-secret/rotate",
5608
+ ...options
5609
+ });
5610
+ /**
5502
5611
  * Send a batch of emails in one request
5503
5612
  *
5504
5613
  * Send up to 100 independent messages in a single call. Each message uses the same body schema and the same send path as `POST /send-mail`, so auth, validation, rate limiting, and idempotency apply per message. Messages are processed independently: one failing does not fail the others. Every message gets an entry in `results` carrying either `data` (on success) or `error` (on failure), with the original `index`.
@@ -6935,7 +7044,7 @@ function parseFromHeader(header) {
6935
7044
  value: { address: address.toLowerCase() }
6936
7045
  };
6937
7046
  }
6938
- // ../sdk-node/dist/trust-BNsucxtE.js
7047
+ // ../sdk-node/dist/understanding-CNZLYYam.js
6939
7048
  /**
6940
7049
  * AUTO-GENERATED - DO NOT EDIT
6941
7050
  * Run `pnpm generate:validator` to regenerate.
@@ -7073,9 +7182,12 @@ const schema12 = {
7073
7182
  },
7074
7183
  "content": {
7075
7184
  "type": "object",
7076
- "if": { "properties": { "raw": { "type": "null" } } },
7077
- "then": { "properties": { "download": { "type": "null" } } },
7078
- "else": { "properties": { "download": { "type": "object" } } },
7185
+ "if": { "required": ["raw"] },
7186
+ "then": {
7187
+ "if": { "properties": { "raw": { "type": "null" } } },
7188
+ "then": { "properties": { "download": { "type": "null" } } },
7189
+ "else": { "properties": { "download": { "type": "object" } } }
7190
+ },
7079
7191
  "properties": {
7080
7192
  "raw": {
7081
7193
  "anyOf": [{ "$ref": "#/definitions/RawContent" }, { "type": "null" }],
@@ -15400,13 +15512,11 @@ function validate11$1(data, { instancePath = "", parentData, parentDataProperty,
15400
15512
  let valid10 = true;
15401
15513
  const _errs64 = errors;
15402
15514
  if (data29 && typeof data29 == "object" && !Array.isArray(data29)) {
15403
- if (data29.raw !== void 0) {
15404
- if (data29.raw !== null) {
15405
- const err65 = {};
15406
- if (vErrors === null) vErrors = [err65];
15407
- else vErrors.push(err65);
15408
- errors++;
15409
- }
15515
+ if (data29.raw === void 0 && "raw") {
15516
+ const err65 = {};
15517
+ if (vErrors === null) vErrors = [err65];
15518
+ else vErrors.push(err65);
15519
+ errors++;
15410
15520
  }
15411
15521
  }
15412
15522
  var _valid0 = _errs64 === errors;
@@ -15415,93 +15525,129 @@ function validate11$1(data, { instancePath = "", parentData, parentDataProperty,
15415
15525
  if (_errs63) vErrors.length = _errs63;
15416
15526
  else vErrors = null;
15417
15527
  }
15418
- let ifClause0;
15419
15528
  if (_valid0) {
15529
+ const _errs65 = errors;
15530
+ const _errs66 = errors;
15531
+ let valid11 = true;
15420
15532
  const _errs67 = errors;
15421
15533
  if (data29 && typeof data29 == "object" && !Array.isArray(data29)) {
15422
- if (data29.download !== void 0) {
15423
- if (data29.download !== null) {
15424
- const err66 = {
15425
- instancePath: instancePath + "/email/content/download",
15426
- schemaPath: "#/properties/email/properties/content/then/properties/download/type",
15427
- keyword: "type",
15428
- params: { type: "null" },
15429
- message: "must be null"
15430
- };
15534
+ if (data29.raw !== void 0) {
15535
+ if (data29.raw !== null) {
15536
+ const err66 = {};
15431
15537
  if (vErrors === null) vErrors = [err66];
15432
15538
  else vErrors.push(err66);
15433
15539
  errors++;
15434
15540
  }
15435
15541
  }
15436
15542
  }
15437
- var _valid0 = _errs67 === errors;
15438
- valid10 = _valid0;
15439
- ifClause0 = "then";
15440
- } else {
15441
- const _errs70 = errors;
15442
- if (data29 && typeof data29 == "object" && !Array.isArray(data29)) {
15443
- if (data29.download !== void 0) {
15444
- let data32 = data29.download;
15445
- if (!(data32 && typeof data32 == "object" && !Array.isArray(data32))) {
15446
- const err67 = {
15447
- instancePath: instancePath + "/email/content/download",
15448
- schemaPath: "#/properties/email/properties/content/else/properties/download/type",
15449
- keyword: "type",
15450
- params: { type: "object" },
15451
- message: "must be object"
15452
- };
15453
- if (vErrors === null) vErrors = [err67];
15454
- else vErrors.push(err67);
15455
- errors++;
15543
+ var _valid1 = _errs67 === errors;
15544
+ errors = _errs66;
15545
+ if (vErrors !== null) {
15546
+ if (_errs66) vErrors.length = _errs66;
15547
+ else vErrors = null;
15548
+ }
15549
+ let ifClause0;
15550
+ if (_valid1) {
15551
+ const _errs70 = errors;
15552
+ if (data29 && typeof data29 == "object" && !Array.isArray(data29)) {
15553
+ if (data29.download !== void 0) {
15554
+ if (data29.download !== null) {
15555
+ const err67 = {
15556
+ instancePath: instancePath + "/email/content/download",
15557
+ schemaPath: "#/properties/email/properties/content/then/then/properties/download/type",
15558
+ keyword: "type",
15559
+ params: { type: "null" },
15560
+ message: "must be null"
15561
+ };
15562
+ if (vErrors === null) vErrors = [err67];
15563
+ else vErrors.push(err67);
15564
+ errors++;
15565
+ }
15456
15566
  }
15457
15567
  }
15568
+ var _valid1 = _errs70 === errors;
15569
+ valid11 = _valid1;
15570
+ ifClause0 = "then";
15571
+ } else {
15572
+ const _errs73 = errors;
15573
+ if (data29 && typeof data29 == "object" && !Array.isArray(data29)) {
15574
+ if (data29.download !== void 0) {
15575
+ let data32 = data29.download;
15576
+ if (!(data32 && typeof data32 == "object" && !Array.isArray(data32))) {
15577
+ const err68 = {
15578
+ instancePath: instancePath + "/email/content/download",
15579
+ schemaPath: "#/properties/email/properties/content/then/else/properties/download/type",
15580
+ keyword: "type",
15581
+ params: { type: "object" },
15582
+ message: "must be object"
15583
+ };
15584
+ if (vErrors === null) vErrors = [err68];
15585
+ else vErrors.push(err68);
15586
+ errors++;
15587
+ }
15588
+ }
15589
+ }
15590
+ var _valid1 = _errs73 === errors;
15591
+ valid11 = _valid1;
15592
+ ifClause0 = "else";
15458
15593
  }
15459
- var _valid0 = _errs70 === errors;
15594
+ if (!valid11) {
15595
+ const err69 = {
15596
+ instancePath: instancePath + "/email/content",
15597
+ schemaPath: "#/properties/email/properties/content/then/if",
15598
+ keyword: "if",
15599
+ params: { failingKeyword: ifClause0 },
15600
+ message: "must match \"" + ifClause0 + "\" schema"
15601
+ };
15602
+ if (vErrors === null) vErrors = [err69];
15603
+ else vErrors.push(err69);
15604
+ errors++;
15605
+ }
15606
+ var _valid0 = _errs65 === errors;
15460
15607
  valid10 = _valid0;
15461
- ifClause0 = "else";
15462
15608
  }
15463
15609
  if (!valid10) {
15464
- const err68 = {
15610
+ const err70 = {
15465
15611
  instancePath: instancePath + "/email/content",
15466
15612
  schemaPath: "#/properties/email/properties/content/if",
15467
15613
  keyword: "if",
15468
- params: { failingKeyword: ifClause0 },
15469
- message: "must match \"" + ifClause0 + "\" schema"
15614
+ params: { failingKeyword: "then" },
15615
+ message: "must match \"then\" schema"
15470
15616
  };
15471
- if (vErrors === null) vErrors = [err68];
15472
- else vErrors.push(err68);
15617
+ if (vErrors === null) vErrors = [err70];
15618
+ else vErrors.push(err70);
15473
15619
  errors++;
15474
15620
  }
15475
15621
  if (data29 && typeof data29 == "object" && !Array.isArray(data29)) {
15476
15622
  if (data29.raw === void 0) {
15477
- const err69 = {
15623
+ const err71 = {
15478
15624
  instancePath: instancePath + "/email/content",
15479
15625
  schemaPath: "#/properties/email/properties/content/required",
15480
15626
  keyword: "required",
15481
15627
  params: { missingProperty: "raw" },
15482
15628
  message: "must have required property 'raw'"
15483
15629
  };
15484
- if (vErrors === null) vErrors = [err69];
15485
- else vErrors.push(err69);
15630
+ if (vErrors === null) vErrors = [err71];
15631
+ else vErrors.push(err71);
15486
15632
  errors++;
15487
15633
  }
15488
15634
  if (data29.download === void 0) {
15489
- const err70 = {
15635
+ const err72 = {
15490
15636
  instancePath: instancePath + "/email/content",
15491
15637
  schemaPath: "#/properties/email/properties/content/required",
15492
15638
  keyword: "required",
15493
15639
  params: { missingProperty: "download" },
15494
15640
  message: "must have required property 'download'"
15495
15641
  };
15496
- if (vErrors === null) vErrors = [err70];
15497
- else vErrors.push(err70);
15642
+ if (vErrors === null) vErrors = [err72];
15643
+ else vErrors.push(err72);
15498
15644
  errors++;
15499
15645
  }
15500
15646
  if (data29.raw !== void 0) {
15501
15647
  let data33 = data29.raw;
15502
- const _errs74 = errors;
15503
- let valid15 = false;
15504
- const _errs75 = errors;
15648
+ const _errs77 = errors;
15649
+ let valid16 = false;
15650
+ const _errs78 = errors;
15505
15651
  if (!validate12$1(data33, {
15506
15652
  instancePath: instancePath + "/email/content/raw",
15507
15653
  parentData: data29,
@@ -15511,40 +15657,40 @@ function validate11$1(data, { instancePath = "", parentData, parentDataProperty,
15511
15657
  vErrors = vErrors === null ? validate12$1.errors : vErrors.concat(validate12$1.errors);
15512
15658
  errors = vErrors.length;
15513
15659
  }
15514
- var _valid1 = _errs75 === errors;
15515
- valid15 = valid15 || _valid1;
15516
- if (!valid15) {
15517
- const _errs76 = errors;
15660
+ var _valid2 = _errs78 === errors;
15661
+ valid16 = valid16 || _valid2;
15662
+ if (!valid16) {
15663
+ const _errs79 = errors;
15518
15664
  if (data33 !== null) {
15519
- const err71 = {
15665
+ const err73 = {
15520
15666
  instancePath: instancePath + "/email/content/raw",
15521
15667
  schemaPath: "#/properties/email/properties/content/properties/raw/anyOf/1/type",
15522
15668
  keyword: "type",
15523
15669
  params: { type: "null" },
15524
15670
  message: "must be null"
15525
15671
  };
15526
- if (vErrors === null) vErrors = [err71];
15527
- else vErrors.push(err71);
15672
+ if (vErrors === null) vErrors = [err73];
15673
+ else vErrors.push(err73);
15528
15674
  errors++;
15529
15675
  }
15530
- var _valid1 = _errs76 === errors;
15531
- valid15 = valid15 || _valid1;
15676
+ var _valid2 = _errs79 === errors;
15677
+ valid16 = valid16 || _valid2;
15532
15678
  }
15533
- if (!valid15) {
15534
- const err72 = {
15679
+ if (!valid16) {
15680
+ const err74 = {
15535
15681
  instancePath: instancePath + "/email/content/raw",
15536
15682
  schemaPath: "#/properties/email/properties/content/properties/raw/anyOf",
15537
15683
  keyword: "anyOf",
15538
15684
  params: {},
15539
15685
  message: "must match a schema in anyOf"
15540
15686
  };
15541
- if (vErrors === null) vErrors = [err72];
15542
- else vErrors.push(err72);
15687
+ if (vErrors === null) vErrors = [err74];
15688
+ else vErrors.push(err74);
15543
15689
  errors++;
15544
15690
  } else {
15545
- errors = _errs74;
15691
+ errors = _errs77;
15546
15692
  if (vErrors !== null) {
15547
- if (_errs74) vErrors.length = _errs74;
15693
+ if (_errs77) vErrors.length = _errs77;
15548
15694
  else vErrors = null;
15549
15695
  }
15550
15696
  }
@@ -15552,79 +15698,79 @@ function validate11$1(data, { instancePath = "", parentData, parentDataProperty,
15552
15698
  if (data29.download !== void 0) {
15553
15699
  let data34 = data29.download;
15554
15700
  if (!(data34 && typeof data34 == "object" && !Array.isArray(data34)) && data34 !== null) {
15555
- const err73 = {
15701
+ const err75 = {
15556
15702
  instancePath: instancePath + "/email/content/download",
15557
15703
  schemaPath: "#/properties/email/properties/content/properties/download/type",
15558
15704
  keyword: "type",
15559
15705
  params: { type: schema12.properties.email.properties.content.properties.download.type },
15560
15706
  message: "must be object,null"
15561
15707
  };
15562
- if (vErrors === null) vErrors = [err73];
15563
- else vErrors.push(err73);
15708
+ if (vErrors === null) vErrors = [err75];
15709
+ else vErrors.push(err75);
15564
15710
  errors++;
15565
15711
  }
15566
15712
  if (data34 && typeof data34 == "object" && !Array.isArray(data34)) {
15567
15713
  if (data34.url === void 0) {
15568
- const err74 = {
15714
+ const err76 = {
15569
15715
  instancePath: instancePath + "/email/content/download",
15570
15716
  schemaPath: "#/properties/email/properties/content/properties/download/required",
15571
15717
  keyword: "required",
15572
15718
  params: { missingProperty: "url" },
15573
15719
  message: "must have required property 'url'"
15574
15720
  };
15575
- if (vErrors === null) vErrors = [err74];
15576
- else vErrors.push(err74);
15721
+ if (vErrors === null) vErrors = [err76];
15722
+ else vErrors.push(err76);
15577
15723
  errors++;
15578
15724
  }
15579
15725
  if (data34.expires_at === void 0) {
15580
- const err75 = {
15726
+ const err77 = {
15581
15727
  instancePath: instancePath + "/email/content/download",
15582
15728
  schemaPath: "#/properties/email/properties/content/properties/download/required",
15583
15729
  keyword: "required",
15584
15730
  params: { missingProperty: "expires_at" },
15585
15731
  message: "must have required property 'expires_at'"
15586
15732
  };
15587
- if (vErrors === null) vErrors = [err75];
15588
- else vErrors.push(err75);
15733
+ if (vErrors === null) vErrors = [err77];
15734
+ else vErrors.push(err77);
15589
15735
  errors++;
15590
15736
  }
15591
15737
  if (data34.url !== void 0) {
15592
15738
  let data35 = data34.url;
15593
15739
  if (typeof data35 === "string") {
15594
15740
  if (!pattern4.test(data35)) {
15595
- const err76 = {
15741
+ const err78 = {
15596
15742
  instancePath: instancePath + "/email/content/download/url",
15597
15743
  schemaPath: "#/properties/email/properties/content/properties/download/properties/url/pattern",
15598
15744
  keyword: "pattern",
15599
15745
  params: { pattern: "^https?://" },
15600
15746
  message: "must match pattern \"^https?://\""
15601
15747
  };
15602
- if (vErrors === null) vErrors = [err76];
15603
- else vErrors.push(err76);
15748
+ if (vErrors === null) vErrors = [err78];
15749
+ else vErrors.push(err78);
15604
15750
  errors++;
15605
15751
  }
15606
15752
  if (!formats4.test(data35)) {
15607
- const err77 = {
15753
+ const err79 = {
15608
15754
  instancePath: instancePath + "/email/content/download/url",
15609
15755
  schemaPath: "#/properties/email/properties/content/properties/download/properties/url/format",
15610
15756
  keyword: "format",
15611
15757
  params: { format: "uri" },
15612
15758
  message: "must match format \"uri\""
15613
15759
  };
15614
- if (vErrors === null) vErrors = [err77];
15615
- else vErrors.push(err77);
15760
+ if (vErrors === null) vErrors = [err79];
15761
+ else vErrors.push(err79);
15616
15762
  errors++;
15617
15763
  }
15618
15764
  } else {
15619
- const err78 = {
15765
+ const err80 = {
15620
15766
  instancePath: instancePath + "/email/content/download/url",
15621
15767
  schemaPath: "#/properties/email/properties/content/properties/download/properties/url/type",
15622
15768
  keyword: "type",
15623
15769
  params: { type: "string" },
15624
15770
  message: "must be string"
15625
15771
  };
15626
- if (vErrors === null) vErrors = [err78];
15627
- else vErrors.push(err78);
15772
+ if (vErrors === null) vErrors = [err80];
15773
+ else vErrors.push(err80);
15628
15774
  errors++;
15629
15775
  }
15630
15776
  }
@@ -15632,42 +15778,42 @@ function validate11$1(data, { instancePath = "", parentData, parentDataProperty,
15632
15778
  let data36 = data34.expires_at;
15633
15779
  if (typeof data36 === "string") {
15634
15780
  if (!formats0$1.test(data36)) {
15635
- const err79 = {
15781
+ const err81 = {
15636
15782
  instancePath: instancePath + "/email/content/download/expires_at",
15637
15783
  schemaPath: "#/properties/email/properties/content/properties/download/properties/expires_at/format",
15638
15784
  keyword: "format",
15639
15785
  params: { format: "date-time" },
15640
15786
  message: "must match format \"date-time\""
15641
15787
  };
15642
- if (vErrors === null) vErrors = [err79];
15643
- else vErrors.push(err79);
15788
+ if (vErrors === null) vErrors = [err81];
15789
+ else vErrors.push(err81);
15644
15790
  errors++;
15645
15791
  }
15646
15792
  } else {
15647
- const err80 = {
15793
+ const err82 = {
15648
15794
  instancePath: instancePath + "/email/content/download/expires_at",
15649
15795
  schemaPath: "#/properties/email/properties/content/properties/download/properties/expires_at/type",
15650
15796
  keyword: "type",
15651
15797
  params: { type: "string" },
15652
15798
  message: "must be string"
15653
15799
  };
15654
- if (vErrors === null) vErrors = [err80];
15655
- else vErrors.push(err80);
15800
+ if (vErrors === null) vErrors = [err82];
15801
+ else vErrors.push(err82);
15656
15802
  errors++;
15657
15803
  }
15658
15804
  }
15659
15805
  }
15660
15806
  }
15661
15807
  } else {
15662
- const err81 = {
15808
+ const err83 = {
15663
15809
  instancePath: instancePath + "/email/content",
15664
15810
  schemaPath: "#/properties/email/properties/content/type",
15665
15811
  keyword: "type",
15666
15812
  params: { type: "object" },
15667
15813
  message: "must be object"
15668
15814
  };
15669
- if (vErrors === null) vErrors = [err81];
15670
- else vErrors.push(err81);
15815
+ if (vErrors === null) vErrors = [err83];
15816
+ else vErrors.push(err83);
15671
15817
  errors++;
15672
15818
  }
15673
15819
  }
@@ -15706,123 +15852,123 @@ function validate11$1(data, { instancePath = "", parentData, parentDataProperty,
15706
15852
  }
15707
15853
  if (data14.relay !== void 0) {
15708
15854
  let data40 = data14.relay;
15709
- const _errs88 = errors;
15710
- let valid17 = false;
15711
- const _errs89 = errors;
15855
+ const _errs91 = errors;
15856
+ let valid18 = false;
15857
+ const _errs92 = errors;
15712
15858
  if (data40 && typeof data40 == "object" && !Array.isArray(data40)) {
15713
15859
  if (data40.hostname === void 0) {
15714
- const err82 = {
15860
+ const err84 = {
15715
15861
  instancePath: instancePath + "/email/relay",
15716
15862
  schemaPath: "#/definitions/EmailRelay/required",
15717
15863
  keyword: "required",
15718
15864
  params: { missingProperty: "hostname" },
15719
15865
  message: "must have required property 'hostname'"
15720
15866
  };
15721
- if (vErrors === null) vErrors = [err82];
15722
- else vErrors.push(err82);
15867
+ if (vErrors === null) vErrors = [err84];
15868
+ else vErrors.push(err84);
15723
15869
  errors++;
15724
15870
  }
15725
15871
  if (data40.via === void 0) {
15726
- const err83 = {
15872
+ const err85 = {
15727
15873
  instancePath: instancePath + "/email/relay",
15728
15874
  schemaPath: "#/definitions/EmailRelay/required",
15729
15875
  keyword: "required",
15730
15876
  params: { missingProperty: "via" },
15731
15877
  message: "must have required property 'via'"
15732
15878
  };
15733
- if (vErrors === null) vErrors = [err83];
15734
- else vErrors.push(err83);
15879
+ if (vErrors === null) vErrors = [err85];
15880
+ else vErrors.push(err85);
15735
15881
  errors++;
15736
15882
  }
15737
15883
  if (data40.hostname !== void 0) {
15738
15884
  if (typeof data40.hostname !== "string") {
15739
- const err84 = {
15885
+ const err86 = {
15740
15886
  instancePath: instancePath + "/email/relay/hostname",
15741
15887
  schemaPath: "#/definitions/EmailRelay/properties/hostname/type",
15742
15888
  keyword: "type",
15743
15889
  params: { type: "string" },
15744
15890
  message: "must be string"
15745
15891
  };
15746
- if (vErrors === null) vErrors = [err84];
15747
- else vErrors.push(err84);
15892
+ if (vErrors === null) vErrors = [err86];
15893
+ else vErrors.push(err86);
15748
15894
  errors++;
15749
15895
  }
15750
15896
  }
15751
15897
  if (data40.via !== void 0) {
15752
15898
  if (typeof data40.via !== "string") {
15753
- const err85 = {
15899
+ const err87 = {
15754
15900
  instancePath: instancePath + "/email/relay/via",
15755
15901
  schemaPath: "#/definitions/EmailRelay/properties/via/type",
15756
15902
  keyword: "type",
15757
15903
  params: { type: "string" },
15758
15904
  message: "must be string"
15759
15905
  };
15760
- if (vErrors === null) vErrors = [err85];
15761
- else vErrors.push(err85);
15906
+ if (vErrors === null) vErrors = [err87];
15907
+ else vErrors.push(err87);
15762
15908
  errors++;
15763
15909
  }
15764
15910
  }
15765
15911
  } else {
15766
- const err86 = {
15912
+ const err88 = {
15767
15913
  instancePath: instancePath + "/email/relay",
15768
15914
  schemaPath: "#/definitions/EmailRelay/type",
15769
15915
  keyword: "type",
15770
15916
  params: { type: "object" },
15771
15917
  message: "must be object"
15772
15918
  };
15773
- if (vErrors === null) vErrors = [err86];
15774
- else vErrors.push(err86);
15919
+ if (vErrors === null) vErrors = [err88];
15920
+ else vErrors.push(err88);
15775
15921
  errors++;
15776
15922
  }
15777
- var _valid2 = _errs89 === errors;
15778
- valid17 = valid17 || _valid2;
15779
- if (!valid17) {
15780
- const _errs96 = errors;
15923
+ var _valid3 = _errs92 === errors;
15924
+ valid18 = valid18 || _valid3;
15925
+ if (!valid18) {
15926
+ const _errs99 = errors;
15781
15927
  if (data40 !== null) {
15782
- const err87 = {
15928
+ const err89 = {
15783
15929
  instancePath: instancePath + "/email/relay",
15784
15930
  schemaPath: "#/properties/email/properties/relay/anyOf/1/type",
15785
15931
  keyword: "type",
15786
15932
  params: { type: "null" },
15787
15933
  message: "must be null"
15788
15934
  };
15789
- if (vErrors === null) vErrors = [err87];
15790
- else vErrors.push(err87);
15935
+ if (vErrors === null) vErrors = [err89];
15936
+ else vErrors.push(err89);
15791
15937
  errors++;
15792
15938
  }
15793
- var _valid2 = _errs96 === errors;
15794
- valid17 = valid17 || _valid2;
15939
+ var _valid3 = _errs99 === errors;
15940
+ valid18 = valid18 || _valid3;
15795
15941
  }
15796
- if (!valid17) {
15797
- const err88 = {
15942
+ if (!valid18) {
15943
+ const err90 = {
15798
15944
  instancePath: instancePath + "/email/relay",
15799
15945
  schemaPath: "#/properties/email/properties/relay/anyOf",
15800
15946
  keyword: "anyOf",
15801
15947
  params: {},
15802
15948
  message: "must match a schema in anyOf"
15803
15949
  };
15804
- if (vErrors === null) vErrors = [err88];
15805
- else vErrors.push(err88);
15950
+ if (vErrors === null) vErrors = [err90];
15951
+ else vErrors.push(err90);
15806
15952
  errors++;
15807
15953
  } else {
15808
- errors = _errs88;
15954
+ errors = _errs91;
15809
15955
  if (vErrors !== null) {
15810
- if (_errs88) vErrors.length = _errs88;
15956
+ if (_errs91) vErrors.length = _errs91;
15811
15957
  else vErrors = null;
15812
15958
  }
15813
15959
  }
15814
15960
  }
15815
15961
  if (data14.automated !== void 0) {
15816
15962
  if (typeof data14.automated !== "boolean") {
15817
- const err89 = {
15963
+ const err91 = {
15818
15964
  instancePath: instancePath + "/email/automated",
15819
15965
  schemaPath: "#/properties/email/properties/automated/type",
15820
15966
  keyword: "type",
15821
15967
  params: { type: "boolean" },
15822
15968
  message: "must be boolean"
15823
15969
  };
15824
- if (vErrors === null) vErrors = [err89];
15825
- else vErrors.push(err89);
15970
+ if (vErrors === null) vErrors = [err91];
15971
+ else vErrors.push(err91);
15826
15972
  errors++;
15827
15973
  }
15828
15974
  }
@@ -15831,53 +15977,53 @@ function validate11$1(data, { instancePath = "", parentData, parentDataProperty,
15831
15977
  if (Array.isArray(data44)) {
15832
15978
  const len1 = data44.length;
15833
15979
  for (let i1 = 0; i1 < len1; i1++) if (typeof data44[i1] !== "string") {
15834
- const err90 = {
15980
+ const err92 = {
15835
15981
  instancePath: instancePath + "/email/automated_reasons/" + i1,
15836
15982
  schemaPath: "#/properties/email/properties/automated_reasons/items/type",
15837
15983
  keyword: "type",
15838
15984
  params: { type: "string" },
15839
15985
  message: "must be string"
15840
15986
  };
15841
- if (vErrors === null) vErrors = [err90];
15842
- else vErrors.push(err90);
15987
+ if (vErrors === null) vErrors = [err92];
15988
+ else vErrors.push(err92);
15843
15989
  errors++;
15844
15990
  }
15845
15991
  } else {
15846
- const err91 = {
15992
+ const err93 = {
15847
15993
  instancePath: instancePath + "/email/automated_reasons",
15848
15994
  schemaPath: "#/properties/email/properties/automated_reasons/type",
15849
15995
  keyword: "type",
15850
15996
  params: { type: "array" },
15851
15997
  message: "must be array"
15852
15998
  };
15853
- if (vErrors === null) vErrors = [err91];
15854
- else vErrors.push(err91);
15999
+ if (vErrors === null) vErrors = [err93];
16000
+ else vErrors.push(err93);
15855
16001
  errors++;
15856
16002
  }
15857
16003
  }
15858
16004
  } else {
15859
- const err92 = {
16005
+ const err94 = {
15860
16006
  instancePath: instancePath + "/email",
15861
16007
  schemaPath: "#/properties/email/type",
15862
16008
  keyword: "type",
15863
16009
  params: { type: "object" },
15864
16010
  message: "must be object"
15865
16011
  };
15866
- if (vErrors === null) vErrors = [err92];
15867
- else vErrors.push(err92);
16012
+ if (vErrors === null) vErrors = [err94];
16013
+ else vErrors.push(err94);
15868
16014
  errors++;
15869
16015
  }
15870
16016
  }
15871
16017
  } else {
15872
- const err93 = {
16018
+ const err95 = {
15873
16019
  instancePath,
15874
16020
  schemaPath: "#/type",
15875
16021
  keyword: "type",
15876
16022
  params: { type: "object" },
15877
16023
  message: "must be object"
15878
16024
  };
15879
- if (vErrors === null) vErrors = [err93];
15880
- else vErrors.push(err93);
16025
+ if (vErrors === null) vErrors = [err95];
16026
+ else vErrors.push(err95);
15881
16027
  errors++;
15882
16028
  }
15883
16029
  validate11$1.errors = vErrors;
@@ -16084,10 +16230,10 @@ function formatValidationIssue(error, input) {
16084
16230
  switch (error.keyword) {
16085
16231
  case "required": {
16086
16232
  const missing = String(error.params.missingProperty ?? "unknown");
16087
- const prefix = field === "payload" ? "payload" : field;
16233
+ const missingField = field === "payload" ? missing : `${field}.${missing}`;
16088
16234
  return {
16089
- field: prefix === "payload" ? missing : `${prefix}.${missing}`,
16090
- message: `Missing required field: ${missing}`,
16235
+ field: missingField,
16236
+ message: `Missing required field: ${missingField}`,
16091
16237
  suggestion: `Add the required field "${missing}" to the webhook payload.`
16092
16238
  };
16093
16239
  }
@@ -24289,11 +24435,6 @@ function combineQ(q, domain) {
24289
24435
  const parts = [q?.trim(), domain ? `domain:${quoteDslValue(domain.trim())}` : void 0].filter((part) => Boolean(part));
24290
24436
  return parts.length > 0 ? parts.join(" ") : void 0;
24291
24437
  }
24292
- function normalizeIsoDate(value, label) {
24293
- const parsed = new Date(value);
24294
- if (Number.isNaN(parsed.getTime())) throw new Error(`${label} must be a valid date or ISO-8601 timestamp.`);
24295
- return parsed.toISOString();
24296
- }
24297
24438
  function filtersFromFlags(flags) {
24298
24439
  if (flags.automated !== void 0 && !AUTOMATED_VALUES.includes(flags.automated)) throw new Error("--automated must be true or false.");
24299
24440
  return {
@@ -24312,9 +24453,30 @@ function filtersFromFlags(flags) {
24312
24453
  to: flags.to
24313
24454
  };
24314
24455
  }
24315
- function sinceFromFlags(flags) {
24316
- if (flags.since) return normalizeIsoDate(flags.since, "--since");
24317
- return flags["include-existing"] ? void 0 : (/* @__PURE__ */ new Date()).toISOString();
24456
+ const SINCE_DURATION = /^(\d+)\s*(s|m|h|d)$/i;
24457
+ const SINCE_UNIT_MS = {
24458
+ s: 1e3,
24459
+ m: 6e4,
24460
+ h: 36e5,
24461
+ d: 864e5
24462
+ };
24463
+ /** How --since reads: a date or timestamp, or a duration ago (`15m`). */
24464
+ const SINCE_VALUE_HELP = "an ISO-8601 timestamp or date, or a duration ago such as 30s, 15m, 2h or 1d";
24465
+ /**
24466
+ * Read --since: an ISO-8601 timestamp or date, or a duration before `now`
24467
+ * (`30s`, `15m`, `2h`, `1d`).
24468
+ */
24469
+ function parseSince(value, now = Date.now()) {
24470
+ if (/^\s*\d+\s*$/.test(value)) throw new Error(`--since needs a unit on a duration, for example ${value.trim()}m; it takes ${SINCE_VALUE_HELP}.`);
24471
+ const duration = SINCE_DURATION.exec(value.trim());
24472
+ const unit = duration ? SINCE_UNIT_MS[duration[2].toLowerCase()] : void 0;
24473
+ const parsed = duration && unit !== void 0 ? new Date(now - Number(duration[1]) * unit) : new Date(value);
24474
+ if (Number.isNaN(parsed.getTime()) || parsed.getTime() < 0) throw new Error(`--since must be ${SINCE_VALUE_HELP}.`);
24475
+ return parsed.toISOString();
24476
+ }
24477
+ function sinceFromFlags(flags, now = Date.now()) {
24478
+ if (flags.since) return parseSince(flags.since, now);
24479
+ return flags["include-existing"] ? void 0 : new Date(now).toISOString();
24318
24480
  }
24319
24481
  function buildEmailSearchQuery(params) {
24320
24482
  const query = {
@@ -25336,4 +25498,4 @@ function repeatStopCommand(emailId) {
25336
25498
  if (!UUID.test(emailId)) throw new TypeError("emailId must be an email UUID");
25337
25499
  return `primitive repeat stop --id ${emailId.toLowerCase()}`;
25338
25500
  }
25339
- export { AutomatedFilterUnsupportedError as $, updateRoute as $n, listAgentContacts as $t, sleep as A, resendAgentSignupVerification as An, getAccessMode as At, hasReplyState as B, setFunctionSecret as Bn, getFunctionTestRunTrace as Bt, collectNewAcceptedEmails as C, putAgentContact as Cn, deleteWakeAuthorization as Ct, filtersFromFlags as D, removeDefaultNetworkMember as Dn, downloadEmailAttachmentPart as Dt, fetchEmailSearchPage as E, redeemCreditCode as En, downloadEmailAttachmentByFilename as Et, assertAwaitingFilterRows as F, searchEmails as Fn, getCreditBalance as Ft, WEBHOOK_EVENT_TYPES as G, startCliLogin as Gn, getOwnGrant as Gt, queryUsesAwaiting as H, simulateRoute as Hn, getKey as Ht, awaitingRejectedError as I, searchMemories as In, getDefaultNetworkAgent as It, parseWebhookEvent as J, unsetFunctionRoute as Jn, getThread as Jt, isEmailReceivedEvent as K, stopRepeatFromEmail as Kn, getRepeatingSend as Kt, ensureSearchReportsReplyState as L, semanticSearch as Ln, getEmail as Lt, AWAITING_VALUES as M, rotateKey as Mn, getAgentContactPolicy as Mt, REPLY_STATE_UNSUPPORTED_CODE as N, runWakeSchedule as Nn, getContact as Nt, quoteDslValue as O, reorderRoutes as On, downloadSentAttachmentArchiveMember as Ot, ReplyStateUnsupportedError as P, sdk_gen_exports as Pn, getConversation as Pt, AUTOMATED_VALUES as Q, updateRepeatingSend as Qn, listAgentConnections as Qt, formatAwaitingCell as R, sendEmail as Rn, getFunction as Rt, transientFailure as S, pullWebhookEvent as Sn, deleteRoute as St, encodeReceivedAtSearchCursor as T, putContact as Tn, downloadEmailAttachmentArchiveMember as Tt, replyStateSurfaceForOperation as U, startAgentClaim as Un, getMemory as Ut, isAwaitingRejectedError as V, setMemory as Vn, getInboxStatus as Vt, SENT_EMAIL_EVENT_TYPES as W, startAgentSignup as Wn, getOrgRoutingTopology as Wt, AUTOMATED_FILTER_UNSUPPORTED_CODE as X, updateFunction as Xn, inviteAgentConnection as Xt, parseFromHeader as Y, updateDefaultNetworkMember as Yn, getWakeSchedule as Yt, AUTOMATED_FLAG_DESCRIPTION as Z, updateKey as Zn, leaveOrganization as Zt, describeApiFailure as _, listSentEmails as _n, createWakeAuthorization as _t, REPEAT_IDLE_MAX_MINUTES as a, listEmailAttachmentArchiveMembers as an, hasAutomatedVerdict as at, retryTransient as b, listWakeSchedules as bn, deleteContact as bt, classifySignalContent as c, listFunctionLogs as cn, cancelSentEmail as ct, parseRepeatTick as d, listKeys as dn, cliLogout as dt, listAgentNetworks as en, updateWakeAuthorization as er, assertAutomatedVerdict as et, preparePresenceAliveEmail as f, listMailboxAccess as fn, completeWebhookEvent as ft, WaitDeadlineReached as g, listSentAttachmentArchiveMembers as gn, createRoute as gt, sendPreparedSignal as h, listRoutes as hn, createKey as ht, REPEAT_EVERY_MAX_MINUTES as i, listDomains as in, __exportAll as ir, expectedAutomatedVerdicts as it, AWAITING_FLAG_DESCRIPTION as j, revokeCredential as jn, getAccount as jt, sinceFromFlags as k, replyToEmail as kn, downloadSentAttachmentByFilename as kt, parseInteractionEnvelope as l, listFunctions as ln, cancelSentEmailByIdempotencyKey as lt, repeatStopCommand as m, listRoles as mn, createFunction as mt, MAX_PRESENCE_ENVELOPE_BYTES as n, listDefaultNetworkAgents as nn, verifyAgentClaim as nr, automatedSurfaceForOperation as nt, REPEAT_MAX_SENDS_MAX as o, listEmails as on, isAutomatedRejectedError as ot, prepareSignalEmail as p, listRepeatingSends as pn, createEndpoint as pt, isTrustedSender as q, testFunction as qn, getSentEmail as qt, PRESENCE_PROBE_TEXT as r, listDefaultNetworkMembers as rn, verifyAgentSignup as rr, ensureSearchReportsAutomated as rt, buildRepeatStopBody as s, listEndpoints as sn, addDefaultNetworkMember as st, MAX_INTERACTION_BYTES as t, listContacts as tn, updateWakeSchedule as tr, automatedRejectedError as tt, parsePresenceEnvelope as u, listGroups as un, checkDefaultNetworkContactAdmission as ut, parseRetryAfter as v, listWakeAuthorizations as vn, createWakeSchedule as vt, cursorFromAcceptedRows as w, putAgentContactPolicy as wn, deleteWakeSchedule as wt, retryingOperation as x, pollCliLogin as xn, deleteMemory as xt, pauseForTransientFailure as y, listWakeDispatches as yn, deleteAgentContact as yt, formatRepliesCell as z, setFunctionRoute as zn, getFunctionRouting as zt };
25501
+ export { AUTOMATED_VALUES as $, stopRepeatFromEmail as $n, getWakeSchedule as $t, sinceFromFlags as A, putAgentContact as An, downloadSentAttachmentArchiveMember as At, formatRepliesCell as B, runWakeSchedule as Bn, getFunction as Bt, SINCE_VALUE_HELP as C, listSentAttachmentArchiveMembers as Cn, deleteMemory as Ct, fetchEmailSearchPage as D, listWakeSchedules as Dn, downloadEmailAttachmentArchiveMember as Dt, encodeReceivedAtSearchCursor as E, listWakeDispatches as En, deleteWakeSchedule as Et, ReplyStateUnsupportedError as F, reorderRoutes as Fn, getContact as Ft, SENT_EMAIL_EVENT_TYPES as G, sendEmail as Gn, getMemory as Gt, isAwaitingRejectedError as H, searchEmails as Hn, getFunctionTestRunTrace as Ht, assertAwaitingFilterRows as I, replyToEmail as In, getConversation as It, isTrustedSender as J, setMemory as Jn, getOwnGrant as Jt, WEBHOOK_EVENT_TYPES as K, setFunctionRoute as Kn, getOrgRoutingTopology as Kt, awaitingRejectedError as L, resendAgentSignupVerification as Ln, getCreditBalance as Lt, AWAITING_FLAG_DESCRIPTION as M, putContact as Mn, getAccessMode as Mt, AWAITING_VALUES as N, redeemCreditCode as Nn, getAccount as Nt, filtersFromFlags as O, pollCliLogin as On, downloadEmailAttachmentByFilename as Ot, REPLY_STATE_UNSUPPORTED_CODE as P, removeDefaultNetworkMember as Pn, getAgentContactPolicy as Pt, AUTOMATED_FLAG_DESCRIPTION as Q, startCliLogin as Qn, getThread as Qt, ensureSearchReportsReplyState as R, revokeCredential as Rn, getDefaultNetworkAgent as Rt, transientFailure as S, listRoutes as Sn, deleteContact as St, cursorFromAcceptedRows as T, listWakeAuthorizations as Tn, deleteWakeAuthorization as Tt, queryUsesAwaiting as U, searchMemories as Un, getInboxStatus as Ut, hasReplyState as V, sdk_gen_exports as Vn, getFunctionRouting as Vt, replyStateSurfaceForOperation as W, semanticSearch as Wn, getKey as Wt, parseFromHeader as X, startAgentClaim as Xn, getSendFrom as Xt, parseWebhookEvent as Y, simulateRoute as Yn, getRepeatingSend as Yt, AUTOMATED_FILTER_UNSUPPORTED_CODE as Z, startAgentSignup as Zn, getSentEmail as Zt, describeApiFailure as _, listKeys as _n, createKey as _t, REPEAT_IDLE_MAX_MINUTES as a, listAgentNetworks as an, updateRepeatingSend as ar, expectedAutomatedVerdicts as at, retryTransient as b, listRepeatingSends as bn, createWakeSchedule as bt, classifySignalContent as c, listDefaultNetworkMembers as cn, updateWakeSchedule as cr, addDefaultNetworkMember as ct, parseRepeatTick as d, listEmailRuleResults as dn, whoami as dr, checkDefaultNetworkContactAdmission as dt, inviteAgentConnection as en, testFunction as er, AutomatedFilterUnsupportedError as et, preparePresenceAliveEmail as f, listEmails as fn, __exportAll as fr, checkSendability as ft, WaitDeadlineReached as g, listGroups as gn, createFunction as gt, sendPreparedSignal as h, listFunctions as hn, createEndpoint as ht, REPEAT_EVERY_MAX_MINUTES as i, listAgentContacts as in, updateKey as ir, ensureSearchReportsAutomated as it, sleep as j, putAgentContactPolicy as jn, downloadSentAttachmentByFilename as jt, quoteDslValue as k, pullWebhookEvent as kn, downloadEmailAttachmentPart as kt, parseInteractionEnvelope as l, listDomains as ln, verifyAgentClaim as lr, cancelSentEmail as lt, repeatStopCommand as m, listFunctionLogs as mn, completeWebhookEvent as mt, MAX_PRESENCE_ENVELOPE_BYTES as n, listActivityObjects as nn, updateDefaultNetworkMember as nr, automatedRejectedError as nt, REPEAT_MAX_SENDS_MAX as o, listContacts as on, updateRoute as or, hasAutomatedVerdict as ot, prepareSignalEmail as p, listEndpoints as pn, cliLogout as pt, isEmailReceivedEvent as q, setFunctionSecret as qn, getOutboundStatus as qt, PRESENCE_PROBE_TEXT as r, listAgentConnections as rn, updateFunction as rr, automatedSurfaceForOperation as rt, buildRepeatStopBody as s, listDefaultNetworkAgents as sn, updateWakeAuthorization as sr, isAutomatedRejectedError as st, MAX_INTERACTION_BYTES as t, leaveOrganization as tn, unsetFunctionRoute as tr, assertAutomatedVerdict as tt, parsePresenceEnvelope as u, listEmailAttachmentArchiveMembers as un, verifyAgentSignup as ur, cancelSentEmailByIdempotencyKey as ut, parseRetryAfter as v, listMailboxAccess as vn, createRoute as vt, collectNewAcceptedEmails as w, listSentEmails as wn, deleteRoute as wt, retryingOperation as x, listRoles as xn, deleteAgentContact as xt, pauseForTransientFailure as y, listOrganizationPeople as yn, createWakeAuthorization as yt, formatAwaitingCell as z, rotateKey as zn, getEmail as zt };