primcli 3.0.0-preview.13 → 3.0.0-preview.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{api-command-D5Tj9C-K.js → api-command-BTOIanV1.js} +781 -27
- package/dist/{machine-session-BMr-zPLx.js → machine-session-BTkDAKda.js} +4 -4
- package/dist/{notify-session-cIUz_kxR.js → notify-session-b_0jyPIk.js} +2 -2
- package/dist/oclif/auto-signal-worker.js +3 -3
- package/dist/oclif/auto-signals.js +1 -1
- package/dist/oclif/index.js +1427 -285
- package/dist/oclif/receiver-heal.js +2 -2
- package/dist/{repeats-Dj_o6c-X-ykfsraq6.js → repeats-Dj_o6c-X-B7sSj0oc.js} +74 -2
- package/dist/{scoped-chat-DVSsLSRw.js → scoped-chat-Cqmn-k7q.js} +1 -1
- package/dist/{signal-command-gpH2AhIi.js → signal-command-ewPBzvjU.js} +4 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as getOwnGrant, B as awaitingRejectedError, G as isAwaitingRejectedError, J as EMAIL_RULE_OBJECTION_EVENT_TYPES, Kn as sdk_gen_exports, R as ReplyStateUnsupportedError, V as ensureSearchReportsReplyState, Wt as getEmail, X as SENT_EMAIL_EVENT_TYPES, Y as EMAIL_RULE_REQUEST_EVENT_TYPES, Z as WEBHOOK_EVENT_TYPES, at as AutomatedFilterUnsupportedError, ct as automatedSurfaceForOperation, ft as isAutomatedRejectedError, lt as ensureSearchReportsAutomated, ot as assertAutomatedVerdict, q as replyStateSurfaceForOperation, rn as getThread, st as automatedRejectedError, ut as expectedAutomatedVerdicts, vn as listEndpoints, y as parseRetryAfter, z as assertAwaitingFilterRows } from "./repeats-Dj_o6c-X-B7sSj0oc.js";
|
|
2
2
|
import { C as saveCliCredentials, F as agentProfilesDirectory, H as requireDefaultLoginProfile, N as agentProfileDirectory, R as loadConnectedAgentProfile, S as resolveCliAuth, W as PrimitiveApiClient, _ as deleteCliCredentials, b as loadCliCredentials, c as resolveConfigEnvironment, d as validateCliHeaderName, f as validateCliHeaderValue, i as loadCliConfig, j as AGENT_PROFILE_ENV, m as cliAccessTokenExpiresAt, p as acquireCliCredentialsLock, w as saveSignupCredentials, x as normalizeApiBaseUrl, y as detectPrimitiveKeyEnvMisname } from "./cli-config-Ms_0vNjq.js";
|
|
3
3
|
import "./oclif/global-org-flag.js";
|
|
4
4
|
import { a as thrownErrorBody } from "./json-output-ch756TXV.js";
|
|
@@ -780,7 +780,7 @@ const operationManifest = [
|
|
|
780
780
|
"binaryResponse": false,
|
|
781
781
|
"bodyRequired": false,
|
|
782
782
|
"command": "list-activity-objects",
|
|
783
|
-
"description": "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, rule requests and objections to rules over their mail (objections only on the dashboard or the Primitive CLI). 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. With relation=asked it lists instead what other members asked of the person, open or answered: the rule requests made to them, and the objections to rules they wrote, under their current membership, each naming the member who asked or objected in created_through. A key, an app or an agent has none, and gets both kinds in withheld. With relation=concerning it lists instead what other members did that concerns the person's own mail: each time a rule started covering one of their mailboxes
|
|
783
|
+
"description": "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, rule requests and objections to rules over their mail (objections only on the dashboard or the Primitive CLI). 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. With relation=asked it lists instead what other members asked of the person, open or answered: the rule requests made to them, and the objections to rules they wrote, under their current membership, each naming the member who asked or objected in created_through. A key, an app or an agent has none, and gets both kinds in withheld. With relation=concerning it lists instead what other members did that concerns the person's own mail: each time a rule started covering one of their mailboxes, saved a new version, or changed who receives its matches while covering it, named as the rule was then, naming its author in created_through, under their current membership; only on the dashboard or the Primitive CLI. A key, an app or an agent has none, and gets email_rule_coverage in withheld. A notice never reads as ended. Notices are written by a periodic job and can lag: until the notices record a rule starting to cover you, the first page lists that rule as pending (pending_complete says whether that check finished), and as_of says about when the notices last looked. For what covers you now, read GET /email-rules/covering-me.",
|
|
784
784
|
"hasJsonBody": false,
|
|
785
785
|
"method": "GET",
|
|
786
786
|
"operationId": "listActivityObjects",
|
|
@@ -863,7 +863,7 @@ const operationManifest = [
|
|
|
863
863
|
},
|
|
864
864
|
"state": {
|
|
865
865
|
"type": "string",
|
|
866
|
-
"description": "Where it stands now: enabled, disabled, deleted or replaced (endpoints and routes), enabled or disabled (filters, wake schedules), live, suspended or deleted (Functions), active, paused or ended (repeating sends), scheduled (scheduled sends), active, suspended, expired or revoked (API keys), pending, claimed, connected or revoked (agents), draft, observe or active (email rules), pending, accepted, declined or withdrawn (rule requests and objections), and for a coverage notice what it told: started (a rule was made or turned active over your mailboxes, or an active rule came to reach you; once per rule, not per mailbox), new_version, or baseline (it already covered you when notices began). pending: a rule started covering your mailbox and the notices have not recorded that start yet (a restart within an hour of the last start notice is recorded without a new one); its id is then the rule's, and created_at when the rule last changed."
|
|
866
|
+
"description": "Where it stands now: enabled, disabled, deleted or replaced (endpoints and routes), enabled or disabled (filters, wake schedules), live, suspended or deleted (Functions), active, paused or ended (repeating sends), scheduled (scheduled sends), active, suspended, expired or revoked (API keys), pending, claimed, connected or revoked (agents), draft, observe or active (email rules), pending, accepted, declined or withdrawn (rule requests and objections), and for a coverage notice what it told: started (a rule was made or turned active over your mailboxes, or an active rule came to reach you; once per rule, not per mailbox), new_version, receivers_changed (who receives an active rule's matches changed: its keys, webhooks or share), or baseline (it already covered you when notices began). pending: a rule started covering your mailbox and the notices have not recorded that start yet (a restart within an hour of the last start notice is recorded without a new one); its id is then the rule's, and created_at when the rule last changed."
|
|
867
867
|
},
|
|
868
868
|
"created_at": {
|
|
869
869
|
"type": "string",
|
|
@@ -905,6 +905,69 @@ const operationManifest = [
|
|
|
905
905
|
"description": "For email_rule_coverage, always: the rule it is about, since names need not be unique (for pending, the same as id). GET /v1/email-rules/covering-me/{rule_id} shows the rule while it covers you, or as it last decided on your mail; otherwise it answers not_found.",
|
|
906
906
|
"type": "string",
|
|
907
907
|
"format": "uuid"
|
|
908
|
+
},
|
|
909
|
+
"receivers_change": {
|
|
910
|
+
"description": "For a receivers_changed notice: who received the rule's matches before and after, in totals. They can be equal when only an owner or a webhook site changed; covering-me shows them by owner. A rotated key counts once here while the old one still works; covering-me counts both.",
|
|
911
|
+
"type": "object",
|
|
912
|
+
"properties": {
|
|
913
|
+
"before": {
|
|
914
|
+
"type": "object",
|
|
915
|
+
"properties": {
|
|
916
|
+
"keys": {
|
|
917
|
+
"type": "integer",
|
|
918
|
+
"minimum": 0
|
|
919
|
+
},
|
|
920
|
+
"reads_in_full": {
|
|
921
|
+
"type": "integer",
|
|
922
|
+
"minimum": 0,
|
|
923
|
+
"description": "Of the keys, how many also read your own mail beyond the rule."
|
|
924
|
+
},
|
|
925
|
+
"webhooks": {
|
|
926
|
+
"type": "integer",
|
|
927
|
+
"minimum": 0
|
|
928
|
+
},
|
|
929
|
+
"shares": {
|
|
930
|
+
"type": "integer",
|
|
931
|
+
"minimum": 0
|
|
932
|
+
}
|
|
933
|
+
},
|
|
934
|
+
"required": [
|
|
935
|
+
"keys",
|
|
936
|
+
"reads_in_full",
|
|
937
|
+
"webhooks",
|
|
938
|
+
"shares"
|
|
939
|
+
]
|
|
940
|
+
},
|
|
941
|
+
"after": {
|
|
942
|
+
"type": "object",
|
|
943
|
+
"properties": {
|
|
944
|
+
"keys": {
|
|
945
|
+
"type": "integer",
|
|
946
|
+
"minimum": 0
|
|
947
|
+
},
|
|
948
|
+
"reads_in_full": {
|
|
949
|
+
"type": "integer",
|
|
950
|
+
"minimum": 0,
|
|
951
|
+
"description": "Of the keys, how many also read your own mail beyond the rule."
|
|
952
|
+
},
|
|
953
|
+
"webhooks": {
|
|
954
|
+
"type": "integer",
|
|
955
|
+
"minimum": 0
|
|
956
|
+
},
|
|
957
|
+
"shares": {
|
|
958
|
+
"type": "integer",
|
|
959
|
+
"minimum": 0
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
"required": [
|
|
963
|
+
"keys",
|
|
964
|
+
"reads_in_full",
|
|
965
|
+
"webhooks",
|
|
966
|
+
"shares"
|
|
967
|
+
]
|
|
968
|
+
}
|
|
969
|
+
},
|
|
970
|
+
"required": ["before", "after"]
|
|
908
971
|
}
|
|
909
972
|
},
|
|
910
973
|
"required": [
|
|
@@ -9700,6 +9763,14 @@ const operationManifest = [
|
|
|
9700
9763
|
"additionalProperties": {}
|
|
9701
9764
|
}
|
|
9702
9765
|
},
|
|
9766
|
+
"mail_limits_available": {
|
|
9767
|
+
"description": "Whether a key limited to some mail (addresses, domains or email rules) would be created now. While false, creating one is refused, so a client offers neither the listed-address presets nor a listed mail reach for a custom key.",
|
|
9768
|
+
"type": "boolean"
|
|
9769
|
+
},
|
|
9770
|
+
"org_reach_available": {
|
|
9771
|
+
"description": "Whether the credential policy lets a new key reach every mailbox. While false, creating one is refused, so a client offers no preset that reaches every mailbox, and a custom key lists its addresses or domains. With mail_limits_available false as well, no key can be created and every preset is unavailable.",
|
|
9772
|
+
"type": "boolean"
|
|
9773
|
+
},
|
|
9703
9774
|
"matrix": {
|
|
9704
9775
|
"type": "array",
|
|
9705
9776
|
"items": {
|
|
@@ -13076,6 +13147,388 @@ const operationManifest = [
|
|
|
13076
13147
|
"tag": "Domains",
|
|
13077
13148
|
"tagCommand": "domains"
|
|
13078
13149
|
},
|
|
13150
|
+
{
|
|
13151
|
+
"binaryResponse": false,
|
|
13152
|
+
"bodyRequired": false,
|
|
13153
|
+
"command": "get-email-notification-preferences",
|
|
13154
|
+
"description": "The notification emails the calling member gets, and which of them they may turn on or off. Each kind lists its label and description, its class, whether it needs an entitlement and whether the organization has it, the organization's mode (null for platform_required) and the modes it may choose, and whether the calling member gets it and may change that.\n\nPerson only: a dashboard session or the person's own OAuth token (the CLI or an app they connected). The person's role must hold notifications:manage. API keys, agent connection keys and agents are refused.",
|
|
13155
|
+
"hasJsonBody": false,
|
|
13156
|
+
"method": "GET",
|
|
13157
|
+
"operationId": "getEmailNotificationPreferences",
|
|
13158
|
+
"path": "/email-notification-preferences",
|
|
13159
|
+
"pathParams": [],
|
|
13160
|
+
"queryParams": [],
|
|
13161
|
+
"headerParams": [],
|
|
13162
|
+
"permissions": ["notifications:manage"],
|
|
13163
|
+
"access": "person",
|
|
13164
|
+
"requestSchema": null,
|
|
13165
|
+
"responseSchema": {
|
|
13166
|
+
"type": "object",
|
|
13167
|
+
"properties": {
|
|
13168
|
+
"entitled": { "type": "boolean" },
|
|
13169
|
+
"kinds": {
|
|
13170
|
+
"type": "array",
|
|
13171
|
+
"items": {
|
|
13172
|
+
"type": "object",
|
|
13173
|
+
"properties": {
|
|
13174
|
+
"kind": { "type": "string" },
|
|
13175
|
+
"label": { "type": "string" },
|
|
13176
|
+
"description": { "type": "string" },
|
|
13177
|
+
"class": {
|
|
13178
|
+
"type": "string",
|
|
13179
|
+
"enum": [
|
|
13180
|
+
"platform_required",
|
|
13181
|
+
"org_requirable",
|
|
13182
|
+
"optional"
|
|
13183
|
+
]
|
|
13184
|
+
},
|
|
13185
|
+
"entitlement_required": { "type": "boolean" },
|
|
13186
|
+
"entitled": { "type": "boolean" },
|
|
13187
|
+
"org_mode": {
|
|
13188
|
+
"type": ["string", "null"],
|
|
13189
|
+
"enum": [
|
|
13190
|
+
"off",
|
|
13191
|
+
"optional_on",
|
|
13192
|
+
"optional_off",
|
|
13193
|
+
"required",
|
|
13194
|
+
null
|
|
13195
|
+
]
|
|
13196
|
+
},
|
|
13197
|
+
"org_mode_is_default": { "type": "boolean" },
|
|
13198
|
+
"org_modes": {
|
|
13199
|
+
"type": "array",
|
|
13200
|
+
"items": {
|
|
13201
|
+
"type": "string",
|
|
13202
|
+
"enum": [
|
|
13203
|
+
"off",
|
|
13204
|
+
"optional_on",
|
|
13205
|
+
"optional_off",
|
|
13206
|
+
"required"
|
|
13207
|
+
]
|
|
13208
|
+
}
|
|
13209
|
+
},
|
|
13210
|
+
"member_enabled": { "type": "boolean" },
|
|
13211
|
+
"member_can_change": { "type": "boolean" }
|
|
13212
|
+
},
|
|
13213
|
+
"required": [
|
|
13214
|
+
"kind",
|
|
13215
|
+
"label",
|
|
13216
|
+
"description",
|
|
13217
|
+
"class",
|
|
13218
|
+
"entitlement_required",
|
|
13219
|
+
"entitled",
|
|
13220
|
+
"org_mode",
|
|
13221
|
+
"org_mode_is_default",
|
|
13222
|
+
"org_modes",
|
|
13223
|
+
"member_enabled",
|
|
13224
|
+
"member_can_change"
|
|
13225
|
+
]
|
|
13226
|
+
}
|
|
13227
|
+
}
|
|
13228
|
+
},
|
|
13229
|
+
"required": ["entitled", "kinds"]
|
|
13230
|
+
},
|
|
13231
|
+
"sdkName": "getEmailNotificationPreferences",
|
|
13232
|
+
"summary": "Get my email notification preferences",
|
|
13233
|
+
"tag": "Email notifications",
|
|
13234
|
+
"tagCommand": "email-notifications"
|
|
13235
|
+
},
|
|
13236
|
+
{
|
|
13237
|
+
"binaryResponse": false,
|
|
13238
|
+
"bodyRequired": false,
|
|
13239
|
+
"command": "get-email-notification-settings",
|
|
13240
|
+
"description": "Every kind of notification email Primitive sends the organization's members, and who may turn it off. Each kind lists its label and description, its class, whether it needs an entitlement and whether the organization has it, the organization's mode (null for platform_required) and the modes it may choose, and whether the calling member gets it and may change that.\n\nPerson only: a dashboard session or the person's own OAuth token (the CLI or an app they connected). API keys, agent connection keys and agents are refused.",
|
|
13241
|
+
"hasJsonBody": false,
|
|
13242
|
+
"method": "GET",
|
|
13243
|
+
"operationId": "getEmailNotificationSettings",
|
|
13244
|
+
"path": "/email-notification-settings",
|
|
13245
|
+
"pathParams": [],
|
|
13246
|
+
"queryParams": [],
|
|
13247
|
+
"headerParams": [],
|
|
13248
|
+
"permissions": ["org:read"],
|
|
13249
|
+
"access": "person",
|
|
13250
|
+
"requestSchema": null,
|
|
13251
|
+
"responseSchema": {
|
|
13252
|
+
"type": "object",
|
|
13253
|
+
"properties": {
|
|
13254
|
+
"entitled": { "type": "boolean" },
|
|
13255
|
+
"kinds": {
|
|
13256
|
+
"type": "array",
|
|
13257
|
+
"items": {
|
|
13258
|
+
"type": "object",
|
|
13259
|
+
"properties": {
|
|
13260
|
+
"kind": { "type": "string" },
|
|
13261
|
+
"label": { "type": "string" },
|
|
13262
|
+
"description": { "type": "string" },
|
|
13263
|
+
"class": {
|
|
13264
|
+
"type": "string",
|
|
13265
|
+
"enum": [
|
|
13266
|
+
"platform_required",
|
|
13267
|
+
"org_requirable",
|
|
13268
|
+
"optional"
|
|
13269
|
+
]
|
|
13270
|
+
},
|
|
13271
|
+
"entitlement_required": { "type": "boolean" },
|
|
13272
|
+
"entitled": { "type": "boolean" },
|
|
13273
|
+
"org_mode": {
|
|
13274
|
+
"type": ["string", "null"],
|
|
13275
|
+
"enum": [
|
|
13276
|
+
"off",
|
|
13277
|
+
"optional_on",
|
|
13278
|
+
"optional_off",
|
|
13279
|
+
"required",
|
|
13280
|
+
null
|
|
13281
|
+
]
|
|
13282
|
+
},
|
|
13283
|
+
"org_mode_is_default": { "type": "boolean" },
|
|
13284
|
+
"org_modes": {
|
|
13285
|
+
"type": "array",
|
|
13286
|
+
"items": {
|
|
13287
|
+
"type": "string",
|
|
13288
|
+
"enum": [
|
|
13289
|
+
"off",
|
|
13290
|
+
"optional_on",
|
|
13291
|
+
"optional_off",
|
|
13292
|
+
"required"
|
|
13293
|
+
]
|
|
13294
|
+
}
|
|
13295
|
+
},
|
|
13296
|
+
"member_enabled": { "type": "boolean" },
|
|
13297
|
+
"member_can_change": { "type": "boolean" }
|
|
13298
|
+
},
|
|
13299
|
+
"required": [
|
|
13300
|
+
"kind",
|
|
13301
|
+
"label",
|
|
13302
|
+
"description",
|
|
13303
|
+
"class",
|
|
13304
|
+
"entitlement_required",
|
|
13305
|
+
"entitled",
|
|
13306
|
+
"org_mode",
|
|
13307
|
+
"org_mode_is_default",
|
|
13308
|
+
"org_modes",
|
|
13309
|
+
"member_enabled",
|
|
13310
|
+
"member_can_change"
|
|
13311
|
+
]
|
|
13312
|
+
}
|
|
13313
|
+
}
|
|
13314
|
+
},
|
|
13315
|
+
"required": ["entitled", "kinds"]
|
|
13316
|
+
},
|
|
13317
|
+
"sdkName": "getEmailNotificationSettings",
|
|
13318
|
+
"summary": "Get the organization's email notification settings",
|
|
13319
|
+
"tag": "Email notifications",
|
|
13320
|
+
"tagCommand": "email-notifications"
|
|
13321
|
+
},
|
|
13322
|
+
{
|
|
13323
|
+
"binaryResponse": false,
|
|
13324
|
+
"bodyRequired": true,
|
|
13325
|
+
"command": "update-email-notification-preferences",
|
|
13326
|
+
"description": "Turn one or more kinds on or off for the calling member. Only a kind whose organization mode is optional_on or optional_off can be changed: a platform_required kind, one the organization requires, and one it turned off are refused with 409 (conflict, details.reason not_member_choice, details.org_mode saying which), and nothing is changed. An unknown kind is refused with 400. Answers the preferences as they now stand. Each kind lists its label and description, its class, whether it needs an entitlement and whether the organization has it, the organization's mode (null for platform_required) and the modes it may choose, and whether the calling member gets it and may change that.\n\nPerson only: a dashboard session or the person's own OAuth token (the CLI or an app they connected). The person's role must hold notifications:manage. API keys, agent connection keys and agents are refused.",
|
|
13327
|
+
"hasJsonBody": true,
|
|
13328
|
+
"method": "PUT",
|
|
13329
|
+
"operationId": "updateEmailNotificationPreferences",
|
|
13330
|
+
"path": "/email-notification-preferences",
|
|
13331
|
+
"pathParams": [],
|
|
13332
|
+
"queryParams": [],
|
|
13333
|
+
"headerParams": [],
|
|
13334
|
+
"permissions": ["notifications:manage"],
|
|
13335
|
+
"access": "person",
|
|
13336
|
+
"requestSchema": {
|
|
13337
|
+
"type": "object",
|
|
13338
|
+
"properties": { "preferences": {
|
|
13339
|
+
"type": "object",
|
|
13340
|
+
"propertyNames": {
|
|
13341
|
+
"type": "string",
|
|
13342
|
+
"pattern": "^[a-z][a-z0-9_]{0,63}$"
|
|
13343
|
+
},
|
|
13344
|
+
"additionalProperties": { "type": "boolean" }
|
|
13345
|
+
} },
|
|
13346
|
+
"required": ["preferences"],
|
|
13347
|
+
"additionalProperties": false
|
|
13348
|
+
},
|
|
13349
|
+
"responseSchema": {
|
|
13350
|
+
"type": "object",
|
|
13351
|
+
"properties": {
|
|
13352
|
+
"entitled": { "type": "boolean" },
|
|
13353
|
+
"kinds": {
|
|
13354
|
+
"type": "array",
|
|
13355
|
+
"items": {
|
|
13356
|
+
"type": "object",
|
|
13357
|
+
"properties": {
|
|
13358
|
+
"kind": { "type": "string" },
|
|
13359
|
+
"label": { "type": "string" },
|
|
13360
|
+
"description": { "type": "string" },
|
|
13361
|
+
"class": {
|
|
13362
|
+
"type": "string",
|
|
13363
|
+
"enum": [
|
|
13364
|
+
"platform_required",
|
|
13365
|
+
"org_requirable",
|
|
13366
|
+
"optional"
|
|
13367
|
+
]
|
|
13368
|
+
},
|
|
13369
|
+
"entitlement_required": { "type": "boolean" },
|
|
13370
|
+
"entitled": { "type": "boolean" },
|
|
13371
|
+
"org_mode": {
|
|
13372
|
+
"type": ["string", "null"],
|
|
13373
|
+
"enum": [
|
|
13374
|
+
"off",
|
|
13375
|
+
"optional_on",
|
|
13376
|
+
"optional_off",
|
|
13377
|
+
"required",
|
|
13378
|
+
null
|
|
13379
|
+
]
|
|
13380
|
+
},
|
|
13381
|
+
"org_mode_is_default": { "type": "boolean" },
|
|
13382
|
+
"org_modes": {
|
|
13383
|
+
"type": "array",
|
|
13384
|
+
"items": {
|
|
13385
|
+
"type": "string",
|
|
13386
|
+
"enum": [
|
|
13387
|
+
"off",
|
|
13388
|
+
"optional_on",
|
|
13389
|
+
"optional_off",
|
|
13390
|
+
"required"
|
|
13391
|
+
]
|
|
13392
|
+
}
|
|
13393
|
+
},
|
|
13394
|
+
"member_enabled": { "type": "boolean" },
|
|
13395
|
+
"member_can_change": { "type": "boolean" }
|
|
13396
|
+
},
|
|
13397
|
+
"required": [
|
|
13398
|
+
"kind",
|
|
13399
|
+
"label",
|
|
13400
|
+
"description",
|
|
13401
|
+
"class",
|
|
13402
|
+
"entitlement_required",
|
|
13403
|
+
"entitled",
|
|
13404
|
+
"org_mode",
|
|
13405
|
+
"org_mode_is_default",
|
|
13406
|
+
"org_modes",
|
|
13407
|
+
"member_enabled",
|
|
13408
|
+
"member_can_change"
|
|
13409
|
+
]
|
|
13410
|
+
}
|
|
13411
|
+
}
|
|
13412
|
+
},
|
|
13413
|
+
"required": ["entitled", "kinds"]
|
|
13414
|
+
},
|
|
13415
|
+
"sdkName": "updateEmailNotificationPreferences",
|
|
13416
|
+
"summary": "Change my email notification preferences",
|
|
13417
|
+
"tag": "Email notifications",
|
|
13418
|
+
"tagCommand": "email-notifications"
|
|
13419
|
+
},
|
|
13420
|
+
{
|
|
13421
|
+
"binaryResponse": false,
|
|
13422
|
+
"bodyRequired": true,
|
|
13423
|
+
"command": "update-email-notification-settings",
|
|
13424
|
+
"description": "Set the organization's mode for one or more kinds: off (nobody gets it), optional_on (each member gets it unless they turn it off), optional_off (only members who turn it on get it) or required (every member gets it). Kinds left out keep their mode. An unknown kind is refused with 400 (validation_error, details.reason unknown_kind). A platform_required kind is refused with 409 (conflict, details.reason platform_required), and required for an optional kind with 409 (conflict, details.reason mode_not_allowed); nothing is changed. Answers the settings as they now stand. Each kind lists its label and description, its class, whether it needs an entitlement and whether the organization has it, the organization's mode (null for platform_required) and the modes it may choose, and whether the calling member gets it and may change that.\n\nPerson only: a dashboard session, or the person's own OAuth token with a step-up token for purpose `org_settings.write` in the Primitive-Step-Up header. Without one an 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 could not do it anyway). The person's role must hold notification_policy: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.",
|
|
13425
|
+
"hasJsonBody": true,
|
|
13426
|
+
"method": "PUT",
|
|
13427
|
+
"operationId": "updateEmailNotificationSettings",
|
|
13428
|
+
"path": "/email-notification-settings",
|
|
13429
|
+
"pathParams": [],
|
|
13430
|
+
"queryParams": [],
|
|
13431
|
+
"headerParams": [{
|
|
13432
|
+
"description": "A single-use step-up token of purpose `org_settings.write` (Change the organization name, logo, semantic search setting or email notification settings), valid 5 minutes. When this operation answers 403 `step_up_required`, the person confirms at the link in `details.step_up_url` and the request is retried with the token that page shows, in this header. Accepted only with the person's own OAuth token of the client it was confirmed for; refused with a token issued for MCP, with any API key or agent connection key, and with a dashboard session.",
|
|
13433
|
+
"enum": null,
|
|
13434
|
+
"name": "Primitive-Step-Up",
|
|
13435
|
+
"required": false,
|
|
13436
|
+
"type": "string"
|
|
13437
|
+
}],
|
|
13438
|
+
"permissions": ["notification_policy:manage"],
|
|
13439
|
+
"access": "step_up",
|
|
13440
|
+
"requestSchema": {
|
|
13441
|
+
"type": "object",
|
|
13442
|
+
"properties": { "modes": {
|
|
13443
|
+
"type": "object",
|
|
13444
|
+
"propertyNames": {
|
|
13445
|
+
"type": "string",
|
|
13446
|
+
"pattern": "^[a-z][a-z0-9_]{0,63}$"
|
|
13447
|
+
},
|
|
13448
|
+
"additionalProperties": {
|
|
13449
|
+
"type": "string",
|
|
13450
|
+
"enum": [
|
|
13451
|
+
"off",
|
|
13452
|
+
"optional_on",
|
|
13453
|
+
"optional_off",
|
|
13454
|
+
"required"
|
|
13455
|
+
]
|
|
13456
|
+
}
|
|
13457
|
+
} },
|
|
13458
|
+
"required": ["modes"],
|
|
13459
|
+
"additionalProperties": false
|
|
13460
|
+
},
|
|
13461
|
+
"responseSchema": {
|
|
13462
|
+
"type": "object",
|
|
13463
|
+
"properties": {
|
|
13464
|
+
"entitled": { "type": "boolean" },
|
|
13465
|
+
"kinds": {
|
|
13466
|
+
"type": "array",
|
|
13467
|
+
"items": {
|
|
13468
|
+
"type": "object",
|
|
13469
|
+
"properties": {
|
|
13470
|
+
"kind": { "type": "string" },
|
|
13471
|
+
"label": { "type": "string" },
|
|
13472
|
+
"description": { "type": "string" },
|
|
13473
|
+
"class": {
|
|
13474
|
+
"type": "string",
|
|
13475
|
+
"enum": [
|
|
13476
|
+
"platform_required",
|
|
13477
|
+
"org_requirable",
|
|
13478
|
+
"optional"
|
|
13479
|
+
]
|
|
13480
|
+
},
|
|
13481
|
+
"entitlement_required": { "type": "boolean" },
|
|
13482
|
+
"entitled": { "type": "boolean" },
|
|
13483
|
+
"org_mode": {
|
|
13484
|
+
"type": ["string", "null"],
|
|
13485
|
+
"enum": [
|
|
13486
|
+
"off",
|
|
13487
|
+
"optional_on",
|
|
13488
|
+
"optional_off",
|
|
13489
|
+
"required",
|
|
13490
|
+
null
|
|
13491
|
+
]
|
|
13492
|
+
},
|
|
13493
|
+
"org_mode_is_default": { "type": "boolean" },
|
|
13494
|
+
"org_modes": {
|
|
13495
|
+
"type": "array",
|
|
13496
|
+
"items": {
|
|
13497
|
+
"type": "string",
|
|
13498
|
+
"enum": [
|
|
13499
|
+
"off",
|
|
13500
|
+
"optional_on",
|
|
13501
|
+
"optional_off",
|
|
13502
|
+
"required"
|
|
13503
|
+
]
|
|
13504
|
+
}
|
|
13505
|
+
},
|
|
13506
|
+
"member_enabled": { "type": "boolean" },
|
|
13507
|
+
"member_can_change": { "type": "boolean" }
|
|
13508
|
+
},
|
|
13509
|
+
"required": [
|
|
13510
|
+
"kind",
|
|
13511
|
+
"label",
|
|
13512
|
+
"description",
|
|
13513
|
+
"class",
|
|
13514
|
+
"entitlement_required",
|
|
13515
|
+
"entitled",
|
|
13516
|
+
"org_mode",
|
|
13517
|
+
"org_mode_is_default",
|
|
13518
|
+
"org_modes",
|
|
13519
|
+
"member_enabled",
|
|
13520
|
+
"member_can_change"
|
|
13521
|
+
]
|
|
13522
|
+
}
|
|
13523
|
+
}
|
|
13524
|
+
},
|
|
13525
|
+
"required": ["entitled", "kinds"]
|
|
13526
|
+
},
|
|
13527
|
+
"sdkName": "updateEmailNotificationSettings",
|
|
13528
|
+
"summary": "Change the organization's email notification settings",
|
|
13529
|
+
"tag": "Email notifications",
|
|
13530
|
+
"tagCommand": "email-notifications"
|
|
13531
|
+
},
|
|
13079
13532
|
{
|
|
13080
13533
|
"binaryResponse": false,
|
|
13081
13534
|
"bodyRequired": false,
|
|
@@ -13674,6 +14127,11 @@ const operationManifest = [
|
|
|
13674
14127
|
"description": "On a rule over your mail: how many of these keys also list one of your own mailboxes, or its domain, so they read your mail there beyond what this rule matches.",
|
|
13675
14128
|
"type": "integer",
|
|
13676
14129
|
"minimum": 0
|
|
14130
|
+
},
|
|
14131
|
+
"newest_at": {
|
|
14132
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
14133
|
+
"type": "string",
|
|
14134
|
+
"format": "date-time"
|
|
13677
14135
|
}
|
|
13678
14136
|
},
|
|
13679
14137
|
"required": ["owner", "count"]
|
|
@@ -13729,6 +14187,11 @@ const operationManifest = [
|
|
|
13729
14187
|
"description": "Hosts past those listed.",
|
|
13730
14188
|
"type": "integer",
|
|
13731
14189
|
"minimum": 0
|
|
14190
|
+
},
|
|
14191
|
+
"newest_at": {
|
|
14192
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
14193
|
+
"type": "string",
|
|
14194
|
+
"format": "date-time"
|
|
13732
14195
|
}
|
|
13733
14196
|
},
|
|
13734
14197
|
"required": ["owner", "count"]
|
|
@@ -13766,6 +14229,11 @@ const operationManifest = [
|
|
|
13766
14229
|
"count": {
|
|
13767
14230
|
"type": "integer",
|
|
13768
14231
|
"exclusiveMinimum": 0
|
|
14232
|
+
},
|
|
14233
|
+
"newest_at": {
|
|
14234
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
14235
|
+
"type": "string",
|
|
14236
|
+
"format": "date-time"
|
|
13769
14237
|
}
|
|
13770
14238
|
},
|
|
13771
14239
|
"required": ["beneficiary", "count"]
|
|
@@ -13830,6 +14298,11 @@ const operationManifest = [
|
|
|
13830
14298
|
"description": "On a rule over your mail: how many of these keys also list one of your own mailboxes, or its domain, so they read your mail there beyond what this rule matches.",
|
|
13831
14299
|
"type": "integer",
|
|
13832
14300
|
"minimum": 0
|
|
14301
|
+
},
|
|
14302
|
+
"newest_at": {
|
|
14303
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
14304
|
+
"type": "string",
|
|
14305
|
+
"format": "date-time"
|
|
13833
14306
|
}
|
|
13834
14307
|
},
|
|
13835
14308
|
"required": ["owner", "count"]
|
|
@@ -13885,6 +14358,11 @@ const operationManifest = [
|
|
|
13885
14358
|
"description": "Hosts past those listed.",
|
|
13886
14359
|
"type": "integer",
|
|
13887
14360
|
"minimum": 0
|
|
14361
|
+
},
|
|
14362
|
+
"newest_at": {
|
|
14363
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
14364
|
+
"type": "string",
|
|
14365
|
+
"format": "date-time"
|
|
13888
14366
|
}
|
|
13889
14367
|
},
|
|
13890
14368
|
"required": ["owner", "count"]
|
|
@@ -13922,6 +14400,11 @@ const operationManifest = [
|
|
|
13922
14400
|
"count": {
|
|
13923
14401
|
"type": "integer",
|
|
13924
14402
|
"exclusiveMinimum": 0
|
|
14403
|
+
},
|
|
14404
|
+
"newest_at": {
|
|
14405
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
14406
|
+
"type": "string",
|
|
14407
|
+
"format": "date-time"
|
|
13925
14408
|
}
|
|
13926
14409
|
},
|
|
13927
14410
|
"required": ["beneficiary", "count"]
|
|
@@ -14751,6 +15234,11 @@ const operationManifest = [
|
|
|
14751
15234
|
"description": "On a rule over your mail: how many of these keys also list one of your own mailboxes, or its domain, so they read your mail there beyond what this rule matches.",
|
|
14752
15235
|
"type": "integer",
|
|
14753
15236
|
"minimum": 0
|
|
15237
|
+
},
|
|
15238
|
+
"newest_at": {
|
|
15239
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
15240
|
+
"type": "string",
|
|
15241
|
+
"format": "date-time"
|
|
14754
15242
|
}
|
|
14755
15243
|
},
|
|
14756
15244
|
"required": ["owner", "count"]
|
|
@@ -14806,6 +15294,11 @@ const operationManifest = [
|
|
|
14806
15294
|
"description": "Hosts past those listed.",
|
|
14807
15295
|
"type": "integer",
|
|
14808
15296
|
"minimum": 0
|
|
15297
|
+
},
|
|
15298
|
+
"newest_at": {
|
|
15299
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
15300
|
+
"type": "string",
|
|
15301
|
+
"format": "date-time"
|
|
14809
15302
|
}
|
|
14810
15303
|
},
|
|
14811
15304
|
"required": ["owner", "count"]
|
|
@@ -14843,6 +15336,11 @@ const operationManifest = [
|
|
|
14843
15336
|
"count": {
|
|
14844
15337
|
"type": "integer",
|
|
14845
15338
|
"exclusiveMinimum": 0
|
|
15339
|
+
},
|
|
15340
|
+
"newest_at": {
|
|
15341
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
15342
|
+
"type": "string",
|
|
15343
|
+
"format": "date-time"
|
|
14846
15344
|
}
|
|
14847
15345
|
},
|
|
14848
15346
|
"required": ["beneficiary", "count"]
|
|
@@ -14907,6 +15405,11 @@ const operationManifest = [
|
|
|
14907
15405
|
"description": "On a rule over your mail: how many of these keys also list one of your own mailboxes, or its domain, so they read your mail there beyond what this rule matches.",
|
|
14908
15406
|
"type": "integer",
|
|
14909
15407
|
"minimum": 0
|
|
15408
|
+
},
|
|
15409
|
+
"newest_at": {
|
|
15410
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
15411
|
+
"type": "string",
|
|
15412
|
+
"format": "date-time"
|
|
14910
15413
|
}
|
|
14911
15414
|
},
|
|
14912
15415
|
"required": ["owner", "count"]
|
|
@@ -14962,6 +15465,11 @@ const operationManifest = [
|
|
|
14962
15465
|
"description": "Hosts past those listed.",
|
|
14963
15466
|
"type": "integer",
|
|
14964
15467
|
"minimum": 0
|
|
15468
|
+
},
|
|
15469
|
+
"newest_at": {
|
|
15470
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
15471
|
+
"type": "string",
|
|
15472
|
+
"format": "date-time"
|
|
14965
15473
|
}
|
|
14966
15474
|
},
|
|
14967
15475
|
"required": ["owner", "count"]
|
|
@@ -14999,6 +15507,11 @@ const operationManifest = [
|
|
|
14999
15507
|
"count": {
|
|
15000
15508
|
"type": "integer",
|
|
15001
15509
|
"exclusiveMinimum": 0
|
|
15510
|
+
},
|
|
15511
|
+
"newest_at": {
|
|
15512
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
15513
|
+
"type": "string",
|
|
15514
|
+
"format": "date-time"
|
|
15002
15515
|
}
|
|
15003
15516
|
},
|
|
15004
15517
|
"required": ["beneficiary", "count"]
|
|
@@ -19984,6 +20497,11 @@ const operationManifest = [
|
|
|
19984
20497
|
"description": "On a rule over your mail: how many of these keys also list one of your own mailboxes, or its domain, so they read your mail there beyond what this rule matches.",
|
|
19985
20498
|
"type": "integer",
|
|
19986
20499
|
"minimum": 0
|
|
20500
|
+
},
|
|
20501
|
+
"newest_at": {
|
|
20502
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
20503
|
+
"type": "string",
|
|
20504
|
+
"format": "date-time"
|
|
19987
20505
|
}
|
|
19988
20506
|
},
|
|
19989
20507
|
"required": ["owner", "count"]
|
|
@@ -20039,6 +20557,11 @@ const operationManifest = [
|
|
|
20039
20557
|
"description": "Hosts past those listed.",
|
|
20040
20558
|
"type": "integer",
|
|
20041
20559
|
"minimum": 0
|
|
20560
|
+
},
|
|
20561
|
+
"newest_at": {
|
|
20562
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
20563
|
+
"type": "string",
|
|
20564
|
+
"format": "date-time"
|
|
20042
20565
|
}
|
|
20043
20566
|
},
|
|
20044
20567
|
"required": ["owner", "count"]
|
|
@@ -20076,6 +20599,11 @@ const operationManifest = [
|
|
|
20076
20599
|
"count": {
|
|
20077
20600
|
"type": "integer",
|
|
20078
20601
|
"exclusiveMinimum": 0
|
|
20602
|
+
},
|
|
20603
|
+
"newest_at": {
|
|
20604
|
+
"description": "When the newest of these was made, to the minute: a key, a webhook or the share, or the rule (the share, for what reaches it only through the share) if that was later. Not when a key was given access to this rule, or anything turned back on; a rotated key shows as newly made, and one key on two rules can show the same minute under both.",
|
|
20605
|
+
"type": "string",
|
|
20606
|
+
"format": "date-time"
|
|
20079
20607
|
}
|
|
20080
20608
|
},
|
|
20081
20609
|
"required": ["beneficiary", "count"]
|
|
@@ -36707,7 +37235,7 @@ const operationManifest = [
|
|
|
36707
37235
|
"pathParams": [],
|
|
36708
37236
|
"queryParams": [],
|
|
36709
37237
|
"headerParams": [{
|
|
36710
|
-
"description": "A single-use step-up token of purpose `org_settings.write` (Change the organization name, logo
|
|
37238
|
+
"description": "A single-use step-up token of purpose `org_settings.write` (Change the organization name, logo, semantic search setting or email notification settings), valid 5 minutes. When this operation answers 403 `step_up_required`, the person confirms at the link in `details.step_up_url` and the request is retried with the token that page shows, in this header. Accepted only with the person's own OAuth token of the client it was confirmed for; refused with a token issued for MCP, with any API key or agent connection key, and with a dashboard session.",
|
|
36711
37239
|
"enum": null,
|
|
36712
37240
|
"name": "Primitive-Step-Up",
|
|
36713
37241
|
"required": false,
|
|
@@ -36853,7 +37381,7 @@ const operationManifest = [
|
|
|
36853
37381
|
"pathParams": [],
|
|
36854
37382
|
"queryParams": [],
|
|
36855
37383
|
"headerParams": [{
|
|
36856
|
-
"description": "A single-use step-up token of purpose `org_settings.write` (Change the organization name, logo
|
|
37384
|
+
"description": "A single-use step-up token of purpose `org_settings.write` (Change the organization name, logo, semantic search setting or email notification settings), valid 5 minutes. When this operation answers 403 `step_up_required`, the person confirms at the link in `details.step_up_url` and the request is retried with the token that page shows, in this header. Accepted only with the person's own OAuth token of the client it was confirmed for; refused with a token issued for MCP, with any API key or agent connection key, and with a dashboard session.",
|
|
36857
37385
|
"enum": null,
|
|
36858
37386
|
"name": "Primitive-Step-Up",
|
|
36859
37387
|
"required": false,
|
|
@@ -36902,7 +37430,7 @@ const operationManifest = [
|
|
|
36902
37430
|
"pathParams": [],
|
|
36903
37431
|
"queryParams": [],
|
|
36904
37432
|
"headerParams": [{
|
|
36905
|
-
"description": "A single-use step-up token of purpose `org_settings.write` (Change the organization name, logo
|
|
37433
|
+
"description": "A single-use step-up token of purpose `org_settings.write` (Change the organization name, logo, semantic search setting or email notification settings), valid 5 minutes. When this operation answers 403 `step_up_required`, the person confirms at the link in `details.step_up_url` and the request is retried with the token that page shows, in this header. Accepted only with the person's own OAuth token of the client it was confirmed for; refused with a token issued for MCP, with any API key or agent connection key, and with a dashboard session.",
|
|
36906
37434
|
"enum": null,
|
|
36907
37435
|
"name": "Primitive-Step-Up",
|
|
36908
37436
|
"required": false,
|
|
@@ -36962,7 +37490,7 @@ const operationManifest = [
|
|
|
36962
37490
|
"pathParams": [],
|
|
36963
37491
|
"queryParams": [],
|
|
36964
37492
|
"headerParams": [{
|
|
36965
|
-
"description": "A single-use step-up token of purpose `org_settings.write` (Change the organization name, logo
|
|
37493
|
+
"description": "A single-use step-up token of purpose `org_settings.write` (Change the organization name, logo, semantic search setting or email notification settings), valid 5 minutes. When this operation answers 403 `step_up_required`, the person confirms at the link in `details.step_up_url` and the request is retried with the token that page shows, in this header. Accepted only with the person's own OAuth token of the client it was confirmed for; refused with a token issued for MCP, with any API key or agent connection key, and with a dashboard session.",
|
|
36966
37494
|
"enum": null,
|
|
36967
37495
|
"name": "Primitive-Step-Up",
|
|
36968
37496
|
"required": false,
|
|
@@ -51932,6 +52460,48 @@ function deliveryAttemptLines(data) {
|
|
|
51932
52460
|
}
|
|
51933
52461
|
return lines.length > 0 ? [`Attempts (${lines.length}):`, ...lines] : [];
|
|
51934
52462
|
}
|
|
52463
|
+
/**
|
|
52464
|
+
* What an endpoint's DELIVERING column says, from `delivery` and never from
|
|
52465
|
+
* `enabled`: an endpoint can be on and still be sent nothing (its owner's key
|
|
52466
|
+
* revoked, say). A delivery the answer gives is read for any kind. Without
|
|
52467
|
+
* one, a webhook (or an endpoint of no stated kind) shows `unknown`, since it
|
|
52468
|
+
* could not be checked just now or the server does not say, and any other
|
|
52469
|
+
* kind (a Function or pull endpoint, which has no delivery) shows `-`.
|
|
52470
|
+
*/
|
|
52471
|
+
function deliveringCell(endpoint) {
|
|
52472
|
+
const delivery = endpoint.delivery;
|
|
52473
|
+
if (isRecord$3(delivery) && typeof delivery.delivering === "boolean") {
|
|
52474
|
+
if (delivery.delivering) return "yes";
|
|
52475
|
+
const codes = Array.isArray(delivery.reasons) ? delivery.reasons.flatMap((reason) => isRecord$3(reason) && typeof reason.code === "string" && reason.code ? [oneLine(reason.code)] : []) : [];
|
|
52476
|
+
return codes.length > 0 ? `no (${codes.join(", ")})` : "no";
|
|
52477
|
+
}
|
|
52478
|
+
return endpoint.kind === void 0 || endpoint.kind === "http" ? "unknown" : "-";
|
|
52479
|
+
}
|
|
52480
|
+
/**
|
|
52481
|
+
* A table of an endpoints list (listEndpoints): each endpoint's id, kind,
|
|
52482
|
+
* whether it is on (ENABLED) and whether it is being sent mail at all
|
|
52483
|
+
* (DELIVERING, from `delivery`), and its name. Nothing for an empty list.
|
|
52484
|
+
*/
|
|
52485
|
+
function endpointDeliveryLines(data) {
|
|
52486
|
+
const rows = Array.isArray(data) ? data.filter(isRecord$3) : [];
|
|
52487
|
+
if (rows.length === 0) return [];
|
|
52488
|
+
const text = (value) => typeof value === "string" && value ? oneLine(value) : "";
|
|
52489
|
+
const table = [[
|
|
52490
|
+
"ID",
|
|
52491
|
+
"KIND",
|
|
52492
|
+
"ENABLED",
|
|
52493
|
+
"DELIVERING",
|
|
52494
|
+
"NAME"
|
|
52495
|
+
], ...rows.map((row) => [
|
|
52496
|
+
text(row.id),
|
|
52497
|
+
text(row.kind),
|
|
52498
|
+
typeof row.enabled === "boolean" ? row.enabled ? "yes" : "no" : "",
|
|
52499
|
+
deliveringCell(row),
|
|
52500
|
+
text(row.name)
|
|
52501
|
+
])];
|
|
52502
|
+
const widths = table[0].map((_, column) => Math.max(...table.map((cells) => (cells[column] ?? "").length)));
|
|
52503
|
+
return table.map((cells) => cells.map((cell, column) => column === cells.length - 1 ? cell : cell.padEnd(widths[column] ?? 0)).join(" ").trimEnd());
|
|
52504
|
+
}
|
|
51935
52505
|
const routeReport = {
|
|
51936
52506
|
flags: {},
|
|
51937
52507
|
report: (data) => ({ lines: routeWarningLines(data) })
|
|
@@ -51942,6 +52512,10 @@ const ANSWER_REPORT_EXTENSIONS = {
|
|
|
51942
52512
|
getDelivery: {
|
|
51943
52513
|
flags: {},
|
|
51944
52514
|
report: (data) => ({ lines: deliveryAttemptLines(data) })
|
|
52515
|
+
},
|
|
52516
|
+
listEndpoints: {
|
|
52517
|
+
flags: {},
|
|
52518
|
+
report: (data) => ({ lines: endpointDeliveryLines(data) })
|
|
51945
52519
|
}
|
|
51946
52520
|
};
|
|
51947
52521
|
// src/oclif/user-grant.ts
|
|
@@ -53064,16 +53638,44 @@ const SAMPLE_TEXT_MAX = 4e3;
|
|
|
53064
53638
|
const SAMPLE_SUBJECT_MAX = 998;
|
|
53065
53639
|
const SAMPLE_LIST_MAX = 10;
|
|
53066
53640
|
/**
|
|
53641
|
+
* The fields of each sample read from a file that this CLI does not know
|
|
53642
|
+
* (`email field "x"`, `sample field "y"`). They are sent as they are: the API
|
|
53643
|
+
* validates samples itself, so a field it added after this CLI was built is
|
|
53644
|
+
* not refused here. Said once per file, for the samples actually sent
|
|
53645
|
+
* (unknownFieldsNote).
|
|
53646
|
+
*/
|
|
53647
|
+
const UNKNOWN_FIELDS = /* @__PURE__ */ new WeakMap();
|
|
53648
|
+
/**
|
|
53649
|
+
* A field name from a file or an answer, quoted and safe to print: JSON
|
|
53650
|
+
* escapes control characters, and a long name is cut.
|
|
53651
|
+
*/
|
|
53652
|
+
function shownKey(key) {
|
|
53653
|
+
return JSON.stringify(key.length > 60 ? `${key.slice(0, 57)}...` : key).replace(/[\u007f-\u009f]/g, "?");
|
|
53654
|
+
}
|
|
53655
|
+
/**
|
|
53656
|
+
* One line naming the fields this CLI does not know in the samples sent, with
|
|
53657
|
+
* the numbers of the samples in the file that carry each; null when none do.
|
|
53658
|
+
*/
|
|
53659
|
+
function unknownFieldsNote(source, sent, all) {
|
|
53660
|
+
const carriers = /* @__PURE__ */ new Map();
|
|
53661
|
+
for (const sample of sent) {
|
|
53662
|
+
const number = all.indexOf(sample) + 1;
|
|
53663
|
+
for (const field of UNKNOWN_FIELDS.get(sample) ?? []) carriers.set(field, [...carriers.get(field) ?? [], number]);
|
|
53664
|
+
}
|
|
53665
|
+
if (carriers.size === 0) return null;
|
|
53666
|
+
return `${source} has fields this CLI does not know, which it does not refuse but leaves for the API to judge (if the API refuses one, take it out): ${[...carriers].map(([field, numbers]) => `${field} (sample${numbers.length === 1 ? "" : "s"} ${numbers.join(", ")})`).join(", ")}.`;
|
|
53667
|
+
}
|
|
53668
|
+
/**
|
|
53067
53669
|
* Refuse, naming the sample and the field, a made-up email the API would
|
|
53068
|
-
* refuse to keep: the fields it takes
|
|
53069
|
-
*
|
|
53670
|
+
* refuse to keep: the bounds of the fields it takes. Returns the fields this
|
|
53671
|
+
* CLI does not know, which are passed on. The API checks the rest (address
|
|
53672
|
+
* forms, a NUL).
|
|
53070
53673
|
*/
|
|
53071
53674
|
function checkSampleEmail(email, at) {
|
|
53072
53675
|
const fail = (what) => {
|
|
53073
53676
|
throw usageError$2(`${at}: email ${what}.`);
|
|
53074
53677
|
};
|
|
53075
|
-
const unknown = Object.keys(email).
|
|
53076
|
-
if (unknown !== void 0) fail(`takes no "${unknown}" (it takes ${[...SAMPLE_EMAIL_KEYS].join(", ")})`);
|
|
53678
|
+
const unknown = Object.keys(email).filter((key) => !SAMPLE_EMAIL_KEYS.has(key)).map((key) => `email field ${shownKey(key)}`);
|
|
53077
53679
|
if (!isRecord$1(email.from) || typeof email.from.address !== "string") fail("needs from.address");
|
|
53078
53680
|
const list = (key, min) => {
|
|
53079
53681
|
const value = email[key];
|
|
@@ -53091,6 +53693,7 @@ function checkSampleEmail(email, at) {
|
|
|
53091
53693
|
if (typeof email.text !== "string" || email.text.length === 0 || email.text.length > SAMPLE_TEXT_MAX) fail(`text must be 1 to ${SAMPLE_TEXT_MAX} characters`);
|
|
53092
53694
|
for (const key of ["automated", "from_mailing_list"]) if (email[key] !== void 0 && typeof email[key] !== "boolean") fail(`${key} must be true or false`);
|
|
53093
53695
|
if (email.spam_score !== void 0 && (typeof email.spam_score !== "number" || !Number.isFinite(email.spam_score))) fail("spam_score must be a number");
|
|
53696
|
+
return unknown;
|
|
53094
53697
|
}
|
|
53095
53698
|
/** The keys a sample may carry: a saved one's id and time are taken and ignored. */
|
|
53096
53699
|
const SAMPLE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -53113,7 +53716,8 @@ function samplesFromJson(value, source) {
|
|
|
53113
53716
|
const samples = lookAlikeSamples(data);
|
|
53114
53717
|
if (samples.length === 0) throw usageError$2(`${source} is a generate-look-alikes answer with no look-alikes in it.`);
|
|
53115
53718
|
samples.forEach((sample, index) => {
|
|
53116
|
-
checkSampleEmail(sample.email, `${source}, look-alike ${index + 1}`);
|
|
53719
|
+
const unknown = checkSampleEmail(sample.email, `${source}, look-alike ${index + 1}`);
|
|
53720
|
+
if (unknown.length > 0) UNKNOWN_FIELDS.set(sample, unknown);
|
|
53117
53721
|
});
|
|
53118
53722
|
return samples;
|
|
53119
53723
|
}
|
|
@@ -53121,22 +53725,25 @@ function samplesFromJson(value, source) {
|
|
|
53121
53725
|
return data.map((item, index) => {
|
|
53122
53726
|
const at = `${source}, sample ${index + 1}`;
|
|
53123
53727
|
if (!isRecord$1(item)) throw usageError$2(`${at} is not an object.`);
|
|
53124
|
-
const unknown = Object.keys(item).
|
|
53125
|
-
if (unknown !== void 0) throw usageError$2(`${at}: "${unknown}" is not a sample field; a sample takes expected, label and email.`);
|
|
53728
|
+
const unknown = Object.keys(item).filter((key) => !SAMPLE_KEYS.has(key));
|
|
53126
53729
|
if (item.expected !== "match" && item.expected !== "no_match") throw usageError$2(`${at}: expected must be "match" or "no_match".`);
|
|
53127
53730
|
if (!isRecord$1(item.email)) throw usageError$2(`${at}: email must be an object, as test-email-rule-on-sample takes it.`);
|
|
53128
|
-
checkSampleEmail(item.email, at);
|
|
53731
|
+
const unknownEmail = checkSampleEmail(item.email, at);
|
|
53129
53732
|
const label = item.label;
|
|
53130
53733
|
if (label !== void 0 && label !== null) {
|
|
53131
53734
|
if (typeof label !== "string") throw usageError$2(`${at}: label must be a string.`);
|
|
53132
53735
|
if (label.trim() === "") throw usageError$2(`${at}: label is blank; leave it out or say what the email stands for.`);
|
|
53133
53736
|
if (label.trim().length > SAMPLE_LABEL_MAX) throw usageError$2(`${at}: label is longer than ${SAMPLE_LABEL_MAX} characters.`);
|
|
53134
53737
|
}
|
|
53135
|
-
|
|
53738
|
+
const sample = {
|
|
53739
|
+
...Object.fromEntries(unknown.map((key) => [key, item[key]])),
|
|
53136
53740
|
expected: item.expected,
|
|
53137
53741
|
...label !== void 0 ? { label } : {},
|
|
53138
53742
|
email: item.email
|
|
53139
53743
|
};
|
|
53744
|
+
const fields = [...unknown.map((key) => `sample field ${shownKey(key)}`), ...unknownEmail];
|
|
53745
|
+
if (fields.length > 0) UNKNOWN_FIELDS.set(sample, fields);
|
|
53746
|
+
return sample;
|
|
53140
53747
|
});
|
|
53141
53748
|
}
|
|
53142
53749
|
/**
|
|
@@ -53187,6 +53794,8 @@ function readSamplesFile(path, flag, pick) {
|
|
|
53187
53794
|
const all = samplesFromJson(readJsonFileFlag(path, `--${flag}`), source);
|
|
53188
53795
|
const samples = typeof pick === "string" ? pickSamples(all, pick, source) : all;
|
|
53189
53796
|
if (samples.length > 20) throw usageError$2(`${source} holds ${samples.length} samples, and a rule or a test takes at most 20; take some with --pick.`);
|
|
53797
|
+
const note = unknownFieldsNote(source, samples, all);
|
|
53798
|
+
if (note) process.stderr.write(`${note}\n`);
|
|
53190
53799
|
return samples;
|
|
53191
53800
|
}
|
|
53192
53801
|
/** The one of `names` given as a file path, or null; --pick without one is refused. */
|
|
@@ -54684,7 +55293,7 @@ function unknownEventTypes(eventTypes) {
|
|
|
54684
55293
|
function unknownEventTypesWarning(unknown) {
|
|
54685
55294
|
return `Warning: ${unknown.join(", ")} ${unknown.length === 1 ? "is" : "are"} not an event type this CLI knows. Subscriptions match exact names, so a misspelled name receives nothing. Continuing; newer event types may not be known to this CLI yet.\n`;
|
|
54686
55295
|
}
|
|
54687
|
-
function isPlainObject(value) {
|
|
55296
|
+
function isPlainObject$1(value) {
|
|
54688
55297
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
54689
55298
|
}
|
|
54690
55299
|
/**
|
|
@@ -54697,16 +55306,16 @@ async function currentEndpointRules(endpointId, listEndpoints) {
|
|
|
54697
55306
|
if (response.error) throw new EventTypesFlagError("Could not read the endpoint's current rules to keep them. Retry, or pass the full rules with --raw-body.");
|
|
54698
55307
|
const row = (response.data?.data ?? []).find((endpoint) => endpoint.id === endpointId);
|
|
54699
55308
|
if (!row) throw new EventTypesFlagError(`No endpoint ${endpointId} is visible to this credential, so its rules cannot be updated.`);
|
|
54700
|
-
return isPlainObject(row.rules) ? row.rules : {};
|
|
55309
|
+
return isPlainObject$1(row.rules) ? row.rules : {};
|
|
54701
55310
|
}
|
|
54702
55311
|
/**
|
|
54703
55312
|
* Put `eventTypes` in the request body's `rules.event_types`, on top of
|
|
54704
55313
|
* `baseRules` (rules the caller passed in the body win over `baseRules`).
|
|
54705
55314
|
*/
|
|
54706
55315
|
function withEventTypes(body, eventTypes, baseRules = {}) {
|
|
54707
|
-
if (body !== void 0 && !isPlainObject(body)) throw new EventTypesFlagError("--raw-body must be a JSON object when also passing --event-types.");
|
|
55316
|
+
if (body !== void 0 && !isPlainObject$1(body)) throw new EventTypesFlagError("--raw-body must be a JSON object when also passing --event-types.");
|
|
54708
55317
|
const current = body ?? {};
|
|
54709
|
-
if (current.rules !== void 0 && !isPlainObject(current.rules)) throw new EventTypesFlagError("rules in --raw-body must be a JSON object when also passing --event-types.");
|
|
55318
|
+
if (current.rules !== void 0 && !isPlainObject$1(current.rules)) throw new EventTypesFlagError("rules in --raw-body must be a JSON object when also passing --event-types.");
|
|
54710
55319
|
const explicitRules = current.rules ?? {};
|
|
54711
55320
|
return {
|
|
54712
55321
|
...current,
|
|
@@ -54719,7 +55328,115 @@ function withEventTypes(body, eventTypes, baseRules = {}) {
|
|
|
54719
55328
|
}
|
|
54720
55329
|
/** True when the caller already passed `rules` in the request body. */
|
|
54721
55330
|
function bodyHasRules(body) {
|
|
54722
|
-
return isPlainObject(body) && body.rules !== void 0;
|
|
55331
|
+
return isPlainObject$1(body) && body.rules !== void 0;
|
|
55332
|
+
}
|
|
55333
|
+
// src/oclif/endpoint-url-shown.ts
|
|
55334
|
+
/** The commands whose answers carry endpoints, by operation sdkName. */
|
|
55335
|
+
const ENDPOINT_URL_OPERATIONS = /* @__PURE__ */ new Set([
|
|
55336
|
+
"getEndpoint",
|
|
55337
|
+
"listEndpoints",
|
|
55338
|
+
"createEndpoint",
|
|
55339
|
+
"updateEndpoint"
|
|
55340
|
+
]);
|
|
55341
|
+
/** The commands that send a URL, whose value is checked for the placeholder. */
|
|
55342
|
+
const ENDPOINT_URL_WRITE_OPERATIONS = /* @__PURE__ */ new Set(["createEndpoint", "updateEndpoint"]);
|
|
55343
|
+
/** What a hidden query string is replaced with. */
|
|
55344
|
+
const HIDDEN_QUERY = "?... (query hidden)";
|
|
55345
|
+
const SHOW_URL_FLAG_DESCRIPTION = "Print each webhook URL in full, its query string included. Without it the query string is shown as ?... (query hidden), with url_query_hidden: true on the endpoint, because it can carry a secret such as a deployment protection bypass token.";
|
|
55346
|
+
/**
|
|
55347
|
+
* Said when an answer had a URL shortened: on stderr without --json, and in
|
|
55348
|
+
* the document's summary with --json --envelope.
|
|
55349
|
+
*/
|
|
55350
|
+
const HIDDEN_QUERY_NOTE = "A webhook URL's query string is hidden, as it can carry a secret. Pass --show-url to print it in full.";
|
|
55351
|
+
/**
|
|
55352
|
+
* The URL with its query string, and anything after it, replaced by
|
|
55353
|
+
* HIDDEN_QUERY; null when it has no query string. A `?` after a `#` is part
|
|
55354
|
+
* of the fragment, not a query.
|
|
55355
|
+
*/
|
|
55356
|
+
function urlWithQueryHidden(url) {
|
|
55357
|
+
const query = url.indexOf("?");
|
|
55358
|
+
if (query < 0) return null;
|
|
55359
|
+
const fragment = url.indexOf("#");
|
|
55360
|
+
if (fragment >= 0 && fragment < query) return null;
|
|
55361
|
+
return `${url.slice(0, query)}${HIDDEN_QUERY}`;
|
|
55362
|
+
}
|
|
55363
|
+
function hideOne(endpoint) {
|
|
55364
|
+
if (endpoint === null || typeof endpoint !== "object" || Array.isArray(endpoint)) return {
|
|
55365
|
+
value: endpoint,
|
|
55366
|
+
hidden: false
|
|
55367
|
+
};
|
|
55368
|
+
const url = endpoint.url;
|
|
55369
|
+
const shown = typeof url === "string" ? urlWithQueryHidden(url) : null;
|
|
55370
|
+
if (shown === null) return {
|
|
55371
|
+
value: endpoint,
|
|
55372
|
+
hidden: false
|
|
55373
|
+
};
|
|
55374
|
+
return {
|
|
55375
|
+
value: {
|
|
55376
|
+
...endpoint,
|
|
55377
|
+
url: shown,
|
|
55378
|
+
url_query_hidden: true
|
|
55379
|
+
},
|
|
55380
|
+
hidden: true
|
|
55381
|
+
};
|
|
55382
|
+
}
|
|
55383
|
+
/**
|
|
55384
|
+
* An answer's data (one endpoint, or a list of them) with each URL's query
|
|
55385
|
+
* string hidden, and whether any was.
|
|
55386
|
+
*/
|
|
55387
|
+
function endpointsWithQueryHidden(data) {
|
|
55388
|
+
if (!Array.isArray(data)) {
|
|
55389
|
+
const one = hideOne(data);
|
|
55390
|
+
return {
|
|
55391
|
+
data: one.value,
|
|
55392
|
+
hidden: one.hidden
|
|
55393
|
+
};
|
|
55394
|
+
}
|
|
55395
|
+
let hidden = false;
|
|
55396
|
+
return {
|
|
55397
|
+
data: data.map((row) => {
|
|
55398
|
+
const one = hideOne(row);
|
|
55399
|
+
hidden ||= one.hidden;
|
|
55400
|
+
return one.value;
|
|
55401
|
+
}),
|
|
55402
|
+
hidden
|
|
55403
|
+
};
|
|
55404
|
+
}
|
|
55405
|
+
function isPlainObject(value) {
|
|
55406
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
55407
|
+
const prototype = Object.getPrototypeOf(value);
|
|
55408
|
+
return prototype === Object.prototype || prototype === null;
|
|
55409
|
+
}
|
|
55410
|
+
/** How deep errorWithQueryHidden looks into an error payload. */
|
|
55411
|
+
const ERROR_DEPTH = 8;
|
|
55412
|
+
/**
|
|
55413
|
+
* An error answer with the query string hidden in every `url` it names, such
|
|
55414
|
+
* as `details.holder.url` on a 409 for a slot another endpoint holds.
|
|
55415
|
+
* Anything that is not a plain object or a list is left as it is.
|
|
55416
|
+
*/
|
|
55417
|
+
function errorWithQueryHidden(payload, depth = 0) {
|
|
55418
|
+
if (depth > ERROR_DEPTH) return payload;
|
|
55419
|
+
if (Array.isArray(payload)) return payload.map((entry) => errorWithQueryHidden(entry, depth + 1));
|
|
55420
|
+
if (!isPlainObject(payload)) return payload;
|
|
55421
|
+
const out = {};
|
|
55422
|
+
for (const [key, value] of Object.entries(payload)) out[key] = errorWithQueryHidden(value, depth + 1);
|
|
55423
|
+
return hideOne(out).value;
|
|
55424
|
+
}
|
|
55425
|
+
/**
|
|
55426
|
+
* A query string as a partial copy of HIDDEN_QUERY leaves it: a terminal's
|
|
55427
|
+
* word selection stops at its first space, after `?...`.
|
|
55428
|
+
*/
|
|
55429
|
+
const HIDDEN_QUERY_START = "?...";
|
|
55430
|
+
/**
|
|
55431
|
+
* The refusal for a request body whose url is a URL as these commands print
|
|
55432
|
+
* it with the query hidden, whole or cut at its first space, so a printed URL
|
|
55433
|
+
* is never written back in place of the real one; null for any other body.
|
|
55434
|
+
*/
|
|
55435
|
+
function hiddenQueryUrlRefusal(body) {
|
|
55436
|
+
if (body === null || typeof body !== "object" || Array.isArray(body)) return null;
|
|
55437
|
+
const url = body.url;
|
|
55438
|
+
if (typeof url !== "string" || !url.includes(HIDDEN_QUERY_START)) return null;
|
|
55439
|
+
return `The url carries ${HIDDEN_QUERY_START}, the start of ${HIDDEN_QUERY}, which is how the endpoint commands print a URL with its query string hidden, not the URL itself. Pass the full URL; \`primitive endpoints get <id> --show-url\` prints a webhook's URL in full.`;
|
|
54723
55440
|
}
|
|
54724
55441
|
// src/oclif/endpoints-test-redirect.ts
|
|
54725
55442
|
async function detectFunctionEndpoint(endpointId, listEndpoints) {
|
|
@@ -56576,7 +57293,7 @@ function savedConnectedProfiles(configDir, exclude) {
|
|
|
56576
57293
|
*/
|
|
56577
57294
|
async function otherProfiles(configDir, session, current) {
|
|
56578
57295
|
if (session) try {
|
|
56579
|
-
const { connectedProfilesForSession } = await import("./machine-session-
|
|
57296
|
+
const { connectedProfilesForSession } = await import("./machine-session-BTkDAKda.js").then((n) => n.s);
|
|
56580
57297
|
return {
|
|
56581
57298
|
inSession: true,
|
|
56582
57299
|
profiles: connectedProfilesForSession(configDir, session, current)
|
|
@@ -57438,8 +58155,13 @@ const NETWORK_ERROR_HINTS = {
|
|
|
57438
58155
|
ENETUNREACH: "Hint: the network is unreachable. If you're behind a proxy and set HTTP(S)_PROXY, re-run with NODE_USE_ENV_PROXY=1 (Node 22+ ignores those env vars by default). `primitive doctor` reports the local environment in one shot.",
|
|
57439
58156
|
ECONNREFUSED: "Hint: the server refused the connection. Check that your firewall allows egress to *.primitive.dev, that your PRIMITIVE_API_BASE_URL_* overrides (if any) point at a reachable host, and re-run with NODE_USE_ENV_PROXY=1 if you're behind a proxy. `primitive doctor` reports the local environment in one shot.",
|
|
57440
58157
|
ETIMEDOUT: "Hint: the connection timed out. Check egress rules and proxy configuration; if you're behind a proxy, re-run with NODE_USE_ENV_PROXY=1 and HTTPS_PROXY set. `primitive doctor` reports the local environment in one shot.",
|
|
57441
|
-
EAI_AGAIN: "Hint: DNS lookup failed. Check /etc/resolv.conf inside containers, and try `curl -v https://api.primitive.dev/v1/account` to confirm the host resolves. `primitive doctor` reports the local environment in one shot."
|
|
58158
|
+
EAI_AGAIN: "Hint: DNS lookup failed. Check /etc/resolv.conf inside containers, and try `curl -v https://api.primitive.dev/v1/account` to confirm the host resolves. `primitive doctor` reports the local environment in one shot.",
|
|
58159
|
+
ENOTFOUND: "Hint: the API host name did not resolve. Check PRIMITIVE_API_BASE_URL and any --api-base-url for a typo, and your DNS. `primitive doctor` reports the local environment in one shot."
|
|
57442
58160
|
};
|
|
58161
|
+
/** The hint for a network failure's code (`cause.code` on a failed fetch), if there is one. */
|
|
58162
|
+
function networkErrorHint(code) {
|
|
58163
|
+
return Object.hasOwn(NETWORK_ERROR_HINTS, code) ? NETWORK_ERROR_HINTS[code] : void 0;
|
|
58164
|
+
}
|
|
57443
58165
|
const RATE_LIMIT_CODES = /* @__PURE__ */ new Set(["rate_limited", "rate_limit_exceeded"]);
|
|
57444
58166
|
/** When to retry a rate-limited request, from Retry-After when it was sent. */
|
|
57445
58167
|
function rateLimitHint(response) {
|
|
@@ -57662,6 +58384,10 @@ function buildFlags(operation) {
|
|
|
57662
58384
|
multiple: true
|
|
57663
58385
|
});
|
|
57664
58386
|
if (operation.binaryResponse) flags.output = Flags.string({ description: "Write binary response bytes to a file" });
|
|
58387
|
+
if (ENDPOINT_URL_OPERATIONS.has(operation.sdkName)) {
|
|
58388
|
+
if (flags["show-url"] !== void 0) throw new Error(`${operation.sdkName}: --show-url is both a generated flag and the CLI's own`);
|
|
58389
|
+
flags["show-url"] = Flags.boolean({ description: SHOW_URL_FLAG_DESCRIPTION });
|
|
58390
|
+
}
|
|
57665
58391
|
if (ATTACHMENT_WAIT_OPERATIONS.has(operation.sdkName)) flags.wait = Flags.boolean({
|
|
57666
58392
|
allowNo: true,
|
|
57667
58393
|
default: true,
|
|
@@ -57757,6 +58483,9 @@ const OPERATION_HINTS = {
|
|
|
57757
58483
|
getMemory: "Tip: prefer `primitive memories get <key> [--function <function-id>]` for the common read path.",
|
|
57758
58484
|
deleteMemory: "Tip: prefer `primitive memories delete <key> [--function <function-id>]` for the common delete path.",
|
|
57759
58485
|
searchMemories: "Tip: prefer `primitive memories search [prefix] [--metadata-only] [--function <function-id>]` for the common search path.",
|
|
58486
|
+
createEmailRuleObjection: "Tip: say in --message (up to 500 characters) what you want. It can ask for less than turning the rule off: ask the author to narrow the rule, or to explain where its matches go (its receivers). The author accepts, which turns the rule off, or declines, optionally giving a reason, which you see in `primitive email-rule-oversight get-email-rule-objection <objection-id>`. You can withdraw it with `primitive email-rule-oversight withdraw-email-rule-objection <objection-id>`. Objecting does not change the rule.",
|
|
58487
|
+
declineEmailRuleObjection: "Tip: the member who objected sees --reason (up to 500 characters). When the objection asked you to narrow the rule or explain a receiver, the reason can answer that: say what you changed, or what the receiver is for.",
|
|
58488
|
+
listEndpoints: "Tip: without --json, a table on stderr after the JSON shows each endpoint's ENABLED and DELIVERING. DELIVERING is read from delivery.delivering, whether a webhook is being sent mail at all, not from enabled: an endpoint can be enabled and still not be delivering (its owner's key revoked, say), shown as no with the reason codes in parentheses. A webhook whose delivery could not be checked shows unknown, and a Function or pull endpoint shows -.",
|
|
57760
58489
|
startAgentSignup: "Tip: pass --terms-accepted. Capture the signup_token from the response and feed it to `primitive agent verify-agent-signup --signup-token <token> --verification-code <6-digit-code>` (the verify flag accepts --code as an alias). The high-level `primitive signup <email>` command walks an interactive user through both steps with friendlier prompts.",
|
|
57761
58490
|
testEmailRule: "Tip: --expect-match and --expect-no-match (or --expect-file) set expect, the emails the rule must match and must not. When no expect is sent, by these flags or in the body, a saved rule's saved expectations are judged instead. Either way, the answer reports the expectations it judged in expectations: passed, counts and per-email results. (create-email-rule and update-email-rule instead judge the rule's saved expectations on the version they save, in expectations_check: passed, decided, failed and undecided.) The exit code follows that report: 1 when one failed; 1 when one is undecided and testing again will not decide it (its email cannot be found or read, cannot be classified, or cannot be tested: skipped); 3 when the only undecided ones can be decided later (not classified yet, or a question unanswered), so test again later. Exit 1 also means the request failed. With --json, error.code tells these apart: expectations_failed, expectations_unresolvable, expectations_undecided (exit 3), or the API's own code. Without --json a readable report follows the JSON on stderr: warnings, how each condition held, the expectations, and the values each email that did not match was compared on.",
|
|
57762
58491
|
verifyAgentSignup: "Tip: pass --verification-code <code> (or --code; both work). The response carries OAuth tokens but not your assigned inbox domain; run `primitive domains list` (or `primitive whoami`) after success to see the managed *.primitive.email address that routes to this account."
|
|
@@ -57846,6 +58575,13 @@ function createOperationCommand(operation) {
|
|
|
57846
58575
|
"verifyAgentSignup",
|
|
57847
58576
|
"resendAgentSignupVerification"
|
|
57848
58577
|
].includes(operation.operationId)) requireDefaultLoginProfile();
|
|
58578
|
+
const prereadBody = ENDPOINT_URL_WRITE_OPERATIONS.has(operation.sdkName) && operation.hasJsonBody ? { value: readJsonBody(parsedFlags) } : void 0;
|
|
58579
|
+
if (prereadBody) {
|
|
58580
|
+
const urlFlag = [...bodyFieldFlagToProperty].find(([, property]) => property === "url")?.[0];
|
|
58581
|
+
const flagUrl = urlFlag ? parsedFlags[urlFlag] : void 0;
|
|
58582
|
+
const refusal = hiddenQueryUrlRefusal(typeof flagUrl === "string" ? { url: flagUrl } : prereadBody.value);
|
|
58583
|
+
if (refusal) throw new Errors.CLIError(refusal, { exit: 2 });
|
|
58584
|
+
}
|
|
57849
58585
|
await runWithTiming(parsedFlags.time === true, async () => {
|
|
57850
58586
|
const { apiClient, auth, baseUrlOverridden } = await createAuthenticatedCliApiClient({
|
|
57851
58587
|
apiKey: typeof parsedFlags["api-key"] === "string" ? parsedFlags["api-key"] : void 0,
|
|
@@ -57854,7 +58590,7 @@ function createOperationCommand(operation) {
|
|
|
57854
58590
|
});
|
|
57855
58591
|
let body;
|
|
57856
58592
|
if (operation.hasJsonBody) {
|
|
57857
|
-
const explicit = readJsonBody(parsedFlags);
|
|
58593
|
+
const explicit = prereadBody ? prereadBody.value : readJsonBody(parsedFlags);
|
|
57858
58594
|
const overrides = collectBodyFieldFlags(parsedFlags, bodyFieldFlagToProperty);
|
|
57859
58595
|
const extensionFlagFor = /* @__PURE__ */ new Map();
|
|
57860
58596
|
for (const field of extension?.bodyFields?.(parsedFlags, explicit) ?? []) {
|
|
@@ -57874,6 +58610,10 @@ function createOperationCommand(operation) {
|
|
|
57874
58610
|
}
|
|
57875
58611
|
} else body = explicit;
|
|
57876
58612
|
}
|
|
58613
|
+
if (ENDPOINT_URL_WRITE_OPERATIONS.has(operation.sdkName)) {
|
|
58614
|
+
const refusal = hiddenQueryUrlRefusal(body);
|
|
58615
|
+
if (refusal) throw new Errors.CLIError(refusal, { exit: 2 });
|
|
58616
|
+
}
|
|
57877
58617
|
if (EVENT_TYPES_FLAG_OPERATIONS.has(operation.sdkName) && Array.isArray(parsedFlags["event-types"])) body = await applyEventTypesFlag({
|
|
57878
58618
|
body,
|
|
57879
58619
|
values: parsedFlags["event-types"],
|
|
@@ -57993,7 +58733,7 @@ function createOperationCommand(operation) {
|
|
|
57993
58733
|
if (result.error) {
|
|
57994
58734
|
const errorPayload = extractErrorPayload(result.error);
|
|
57995
58735
|
const operationErrorHint = OPERATION_ERROR_HINTS[operation.sdkName]?.(extractErrorCode(errorPayload), body, errorPayload, collectValues(operation.pathParams, parsedFlags, operation.sdkName), parsedFlags);
|
|
57996
|
-
writeErrorWithHints(errorPayload, result.response, { codeHint: !(operationErrorHint && OPERATION_ERROR_HINTS_REPLACING_CODE_HINT.has(operation.sdkName)) });
|
|
58736
|
+
writeErrorWithHints(ENDPOINT_URL_OPERATIONS.has(operation.sdkName) && parsedFlags["show-url"] !== true ? errorWithQueryHidden(errorPayload) : errorPayload, result.response, { codeHint: !(operationErrorHint && OPERATION_ERROR_HINTS_REPLACING_CODE_HINT.has(operation.sdkName)) });
|
|
57997
58737
|
if (operationErrorHint) process.stderr.write(`${operationErrorHint}\n`);
|
|
57998
58738
|
if (stepUpUrl) process.stderr.write(approveThenRerunHint(stepUpUrl));
|
|
57999
58739
|
if (replyStateSurface && isAwaitingRejectedError(errorPayload)) process.stderr.write(`${awaitingRejectedError(replyStateSurface).message}\n`);
|
|
@@ -58141,12 +58881,26 @@ function createOperationCommand(operation) {
|
|
|
58141
58881
|
}
|
|
58142
58882
|
};
|
|
58143
58883
|
}
|
|
58144
|
-
let
|
|
58884
|
+
let shownEnvelope = envelope;
|
|
58885
|
+
let queryHidden = false;
|
|
58886
|
+
if (ENDPOINT_URL_OPERATIONS.has(operation.sdkName) && parsedFlags["show-url"] !== true && envelope) {
|
|
58887
|
+
const shown = endpointsWithQueryHidden(envelope.data);
|
|
58888
|
+
if (shown.hidden) {
|
|
58889
|
+
shownEnvelope = {
|
|
58890
|
+
...envelope,
|
|
58891
|
+
data: shown.data
|
|
58892
|
+
};
|
|
58893
|
+
queryHidden = true;
|
|
58894
|
+
if (jsonOutput && withEnvelope) summary.push(HIDDEN_QUERY_NOTE);
|
|
58895
|
+
}
|
|
58896
|
+
}
|
|
58897
|
+
let printed = jsonOutput && withEnvelope ? operationJsonDocument(shownEnvelope, summary) : operationOutputPayload(shownEnvelope, withEnvelope);
|
|
58145
58898
|
if (jsonOutput && report?.exitCode && report.error && printed !== null && typeof printed === "object" && !Array.isArray(printed)) printed = {
|
|
58146
58899
|
...printed,
|
|
58147
58900
|
error: report.error
|
|
58148
58901
|
};
|
|
58149
58902
|
this.log(JSON.stringify(printed, null, 2));
|
|
58903
|
+
if (queryHidden && !jsonOutput) process.stderr.write(`${HIDDEN_QUERY_NOTE}\n`);
|
|
58150
58904
|
if (reportError !== void 0) process.stderr.write(`Warning: ${operation.sdkName} succeeded but its report could not be built (${reportError}). The JSON above is the full answer; read it rather than the exit code.\n`);
|
|
58151
58905
|
if (report && !jsonOutput) for (const line of report.lines) process.stderr.write(`${line}\n`);
|
|
58152
58906
|
if (reportError !== void 0 && report?.exitCode && !jsonOutput) process.stderr.write(`The answer's expectations were not all shown to pass, so the command exits ${report.exitCode}.\n`);
|
|
@@ -58180,4 +58934,4 @@ function emptyDeliveriesHint(sdkName, query) {
|
|
|
58180
58934
|
function canonicalizeCliReferences(description) {
|
|
58181
58935
|
return description.replaceAll("`primitive emails:latest`", "`primitive emails latest`").replaceAll("`primitive describe emails:get-email | jq '.responseSchema.properties'`", "`primitive describe emails:get | jq '.responseSchema.properties'`");
|
|
58182
58936
|
}
|
|
58183
|
-
export {
|
|
58937
|
+
export { interactionNextActions as $, ConnectedAgentKeyRequiredError as $t, openBrowser as A, DEFAULT_ENROLL_NAME as At, serverRelationship as B, runtimeSessionVariableList as Bt, approveThenRerunHint as C, sendIdentityFields as Ct, canOfferCopyHotkey as D, serializeErrorPayload as Dt, withApproval as E, sentHistoryWindowStart as Et, formatMailWakeLine as F, identitySuggestions as Ft, claimPendingMail as G, readCallerMailFor as Gt, wakeReadCommand as H, withFlagSuggestion as Ht, latestOwnOutbound as I, loadSkillLine as It, pendingMailPath as J, isEmailId as Jt, clearConsumedPendingMail as K, classificationFactLines as Kt, readThreadContext as L, currentMailSessionKey as Lt, bareAddress$1 as M, connectNextSteps as Mt, describeWake as N, defaultConnectionName as Nt, formatBrowserLoginInstructions as O, successfulSendOutcome as Ot, displayAddress as P, generatedAgentName as Pt, interactionHumanLine as Q, withAttachmentWait as Qt, sentInThread as R, detectAgentRuntime as Rt, STEP_UP_TOKEN_FLAG_DESCRIPTION as S, reportSendCommandResult as St, terminalApprovalIo as T, sendWaitClampNotice as Tt, wakeRecipientField as U, emptyEmailListHint as Ut, skillFirstLine as V, formatAlreadySentNotice as Vt, wakeRelationship as W, mailReach as Wt, recordPendingMail as X, ATTACHMENT_WAIT_FLAG_DESCRIPTION as Xt, readPendingMail as Y, noFactsMessage as Yt, removePendingMail as Z, ATTACHMENT_WAIT_MAX_MS as Zt, surfaceUnauthorizedHint as _, sanitizeForTerminal as _n, formatPriorRepliesCheckSkipped as _t, createOperationCommand as a, resolveCliApiRequestConfig as an, MAX_SEND_WAIT_TIMEOUT_MS as at, BROWSER_FLAG_DESCRIPTION as b, formatSendRecordFailureSummary as bt, formatErrorPayload as c, RESTRICTED_ROLE_NOTE as cn, assertValidIdempotencyKey as ct, isGrantRefusal as d, isBuiltInRoleKey as dn, checkPriorReplies as dt, SAVED_CLI_OAUTH_SESSION_EXPIRED_MESSAGE as en, readEmailInteraction as et, networkErrorHint as f, revokeUserLogin as fn, classifySendError as ft, runWithTiming as g, routeWarningLines as gn, formatDeletedEarlierSendNotice as gt, refusalDetails as h, switchCurrentOrg as hn, followUpCommandPrefix as ht, TIME_FLAG_DESCRIPTION as i, refuseOrgSelectionForProfile as in, IDEMPOTENCY_KEY_FLAG_DESCRIPTION as it, explainPendingMailNotFound as j, cliInvocation as jt, listenForCopyHotkey as k, thrownErrorExitCode as kt, hasControlCharacter as l, credentialsFromUserLogin as ln, buildFollowUpCommand as lt, readTextFileFlag as m, roleKeyText as mn, excludeSignalReplies as mt, API_ERROR_CODES as n, createCliApiClient as nn, replyInteractionWarning as nt, extractErrorCode as o, selectedOrgFromEnv as on, SEND_OUTCOME_HELP as ot, parameterFlagName as p, roleKeyLabel as pn, deriveSendIdempotencyKey as pt, clearReadPendingMail as q, classificationOf as qt, OPERATION_PATH_FLAGS as r, refreshStoredCliCredentials as rn, wakeInteractionSentence as rt, extractErrorPayload as s, CliOrgRefusedError as sn, apiResultHttpStatus as st, API_BASE_URL_FLAG_DESCRIPTION as t, createAuthenticatedCliApiClient as tn, replyExpectation as tt, headerFlagName as u, fetchCliOrgs as un, buildThrownSendFailureEnvelope as ut, takesStepUp as v, setKnownCommands as vn, formatPriorRepliesWarning as vt, promptLine as w, sendOutcomeExitCode as wt, STEP_UP_HEADER as x, priorRepliesThatWentOut as xt, writeErrorWithHints as y, operationManifest as yn, formatSendFailureSummary as yt, serverMuted as z, detectRuntimeSession as zt };
|