primcli 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/dist/oclif/index.js +1325 -138
- package/package.json +4 -1
package/dist/oclif/index.js
CHANGED
|
@@ -38,6 +38,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
38
38
|
createFunctionSecret: () => createFunctionSecret,
|
|
39
39
|
createOrgSecret: () => createOrgSecret,
|
|
40
40
|
createRegistry: () => createRegistry,
|
|
41
|
+
createRoute: () => createRoute,
|
|
41
42
|
decideRegistryRequest: () => decideRegistryRequest,
|
|
42
43
|
defineAgent: () => defineAgent,
|
|
43
44
|
deleteDomain: () => deleteDomain,
|
|
@@ -47,6 +48,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
47
48
|
deleteFunction: () => deleteFunction,
|
|
48
49
|
deleteFunctionSecret: () => deleteFunctionSecret,
|
|
49
50
|
deleteOrgSecret: () => deleteOrgSecret,
|
|
51
|
+
deleteRoute: () => deleteRoute,
|
|
50
52
|
discardEmailContent: () => discardEmailContent,
|
|
51
53
|
downloadAttachments: () => downloadAttachments,
|
|
52
54
|
downloadDomainZoneFile: () => downloadDomainZoneFile,
|
|
@@ -82,11 +84,13 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
82
84
|
listRegistries: () => listRegistries,
|
|
83
85
|
listRegistryAgents: () => listRegistryAgents,
|
|
84
86
|
listRegistryRequests: () => listRegistryRequests,
|
|
87
|
+
listRoutes: () => listRoutes,
|
|
85
88
|
listSentEmails: () => listSentEmails,
|
|
86
89
|
payChallenge: () => payChallenge,
|
|
87
90
|
pollCliLogin: () => pollCliLogin,
|
|
88
91
|
publishAgent: () => publishAgent,
|
|
89
92
|
registerPayoutAddress: () => registerPayoutAddress,
|
|
93
|
+
reorderRoutes: () => reorderRoutes,
|
|
90
94
|
replayDelivery: () => replayDelivery,
|
|
91
95
|
replayEmailWebhooks: () => replayEmailWebhooks,
|
|
92
96
|
replyToEmail: () => replyToEmail,
|
|
@@ -100,6 +104,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
100
104
|
setFunctionRoute: () => setFunctionRoute,
|
|
101
105
|
setFunctionSecret: () => setFunctionSecret,
|
|
102
106
|
setOrgSecret: () => setOrgSecret,
|
|
107
|
+
simulateRoute: () => simulateRoute,
|
|
103
108
|
startAgentClaim: () => startAgentClaim,
|
|
104
109
|
startAgentSignup: () => startAgentSignup,
|
|
105
110
|
startCliLogin: () => startCliLogin,
|
|
@@ -114,6 +119,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
114
119
|
updateFilter: () => updateFilter,
|
|
115
120
|
updateFunction: () => updateFunction,
|
|
116
121
|
updateRegistry: () => updateRegistry,
|
|
122
|
+
updateRoute: () => updateRoute,
|
|
117
123
|
updateSpendPolicy: () => updateSpendPolicy,
|
|
118
124
|
verifyAgentClaim: () => verifyAgentClaim,
|
|
119
125
|
verifyAgentSignup: () => verifyAgentSignup,
|
|
@@ -981,6 +987,106 @@ const updateFilter = (options) => (options.client ?? client).patch({
|
|
|
981
987
|
}
|
|
982
988
|
});
|
|
983
989
|
/**
|
|
990
|
+
* List recipient routes
|
|
991
|
+
*
|
|
992
|
+
* Returns the org's recipient routing rules in evaluation order. Each rule
|
|
993
|
+
* binds a recipient address pattern to one endpoint; inbound mail resolves
|
|
994
|
+
* to a single destination at delivery time.
|
|
995
|
+
*
|
|
996
|
+
*/
|
|
997
|
+
const listRoutes = (options) => (options?.client ?? client).get({
|
|
998
|
+
security: [{
|
|
999
|
+
scheme: "bearer",
|
|
1000
|
+
type: "http"
|
|
1001
|
+
}],
|
|
1002
|
+
url: "/routes",
|
|
1003
|
+
...options
|
|
1004
|
+
});
|
|
1005
|
+
/**
|
|
1006
|
+
* Create a recipient route
|
|
1007
|
+
*
|
|
1008
|
+
* Binds a recipient pattern to a destination. Provide exactly one of
|
|
1009
|
+
* `endpoint_id` (an existing endpoint) or `function_id`. With `function_id`,
|
|
1010
|
+
* a dedicated route-target endpoint is minted for that function in the same
|
|
1011
|
+
* transaction, enabling per-address function routing (e.g.
|
|
1012
|
+
* `alice@acme.com -> functionA`).
|
|
1013
|
+
*
|
|
1014
|
+
*/
|
|
1015
|
+
const createRoute = (options) => (options.client ?? client).post({
|
|
1016
|
+
security: [{
|
|
1017
|
+
scheme: "bearer",
|
|
1018
|
+
type: "http"
|
|
1019
|
+
}],
|
|
1020
|
+
url: "/routes",
|
|
1021
|
+
...options,
|
|
1022
|
+
headers: {
|
|
1023
|
+
...options.body !== void 0 && { "Content-Type": "application/json" },
|
|
1024
|
+
...options.headers
|
|
1025
|
+
}
|
|
1026
|
+
});
|
|
1027
|
+
/**
|
|
1028
|
+
* Reorder recipient routes
|
|
1029
|
+
*
|
|
1030
|
+
* Update the priority of one or more routes in a single call.
|
|
1031
|
+
*/
|
|
1032
|
+
const reorderRoutes = (options) => (options.client ?? client).post({
|
|
1033
|
+
security: [{
|
|
1034
|
+
scheme: "bearer",
|
|
1035
|
+
type: "http"
|
|
1036
|
+
}],
|
|
1037
|
+
url: "/routes/reorder",
|
|
1038
|
+
...options,
|
|
1039
|
+
headers: {
|
|
1040
|
+
...options.body !== void 0 && { "Content-Type": "application/json" },
|
|
1041
|
+
...options.headers
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
/**
|
|
1045
|
+
* Simulate routing for a recipient
|
|
1046
|
+
*
|
|
1047
|
+
* Resolves where an inbound email to `recipient` would be delivered, with a
|
|
1048
|
+
* trace of every rule evaluated and why. Read-only; creates nothing.
|
|
1049
|
+
*
|
|
1050
|
+
*/
|
|
1051
|
+
const simulateRoute = (options) => (options.client ?? client).post({
|
|
1052
|
+
security: [{
|
|
1053
|
+
scheme: "bearer",
|
|
1054
|
+
type: "http"
|
|
1055
|
+
}],
|
|
1056
|
+
url: "/routes/simulate",
|
|
1057
|
+
...options,
|
|
1058
|
+
headers: {
|
|
1059
|
+
...options.body !== void 0 && { "Content-Type": "application/json" },
|
|
1060
|
+
...options.headers
|
|
1061
|
+
}
|
|
1062
|
+
});
|
|
1063
|
+
/**
|
|
1064
|
+
* Delete a recipient route
|
|
1065
|
+
*/
|
|
1066
|
+
const deleteRoute = (options) => (options.client ?? client).delete({
|
|
1067
|
+
security: [{
|
|
1068
|
+
scheme: "bearer",
|
|
1069
|
+
type: "http"
|
|
1070
|
+
}],
|
|
1071
|
+
url: "/routes/{id}",
|
|
1072
|
+
...options
|
|
1073
|
+
});
|
|
1074
|
+
/**
|
|
1075
|
+
* Update a recipient route
|
|
1076
|
+
*/
|
|
1077
|
+
const updateRoute = (options) => (options.client ?? client).patch({
|
|
1078
|
+
security: [{
|
|
1079
|
+
scheme: "bearer",
|
|
1080
|
+
type: "http"
|
|
1081
|
+
}],
|
|
1082
|
+
url: "/routes/{id}",
|
|
1083
|
+
...options,
|
|
1084
|
+
headers: {
|
|
1085
|
+
...options.body !== void 0 && { "Content-Type": "application/json" },
|
|
1086
|
+
...options.headers
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
/**
|
|
984
1090
|
* List webhook deliveries
|
|
985
1091
|
*
|
|
986
1092
|
* Returns a paginated list of webhook delivery attempts. Each delivery
|
|
@@ -2043,6 +2149,10 @@ const openapiDocument = {
|
|
|
2043
2149
|
"name": "Filters",
|
|
2044
2150
|
"description": "Manage whitelist and blocklist filter rules"
|
|
2045
2151
|
},
|
|
2152
|
+
{
|
|
2153
|
+
"name": "Routes",
|
|
2154
|
+
"description": "Recipient routing: route inbound mail to a single destination per recipient\naddress. Rules bind an address pattern (exact or wildcard) to an endpoint;\n`function_id` routes an address to a function, minting its route-target\nendpoint.\n"
|
|
2155
|
+
},
|
|
2046
2156
|
{
|
|
2047
2157
|
"name": "Payments",
|
|
2048
2158
|
"description": "Collect and pay stablecoin (USDC) payments with x402. Settlement is\nnon-custodial: funds move directly from payer to payee on-chain via an\nEIP-3009 authorization the payer signs with their own key, and Primitive\nnever holds funds. The payee registers a payout address and creates a\nchallenge; the payer signs and settles it under a configurable spend\npolicy (kill-switch, per-payment and per-day caps, payee allowlist).\n"
|
|
@@ -3457,6 +3567,129 @@ const openapiDocument = {
|
|
|
3457
3567
|
}
|
|
3458
3568
|
}
|
|
3459
3569
|
},
|
|
3570
|
+
"/routes": {
|
|
3571
|
+
"get": {
|
|
3572
|
+
"operationId": "listRoutes",
|
|
3573
|
+
"summary": "List recipient routes",
|
|
3574
|
+
"description": "Returns the org's recipient routing rules in evaluation order. Each rule\nbinds a recipient address pattern to one endpoint; inbound mail resolves\nto a single destination at delivery time.\n",
|
|
3575
|
+
"tags": ["Routes"],
|
|
3576
|
+
"responses": {
|
|
3577
|
+
"200": {
|
|
3578
|
+
"description": "List of routes",
|
|
3579
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
3580
|
+
"type": "object",
|
|
3581
|
+
"properties": { "data": {
|
|
3582
|
+
"type": "array",
|
|
3583
|
+
"items": { "$ref": "#/components/schemas/RecipientRoute" }
|
|
3584
|
+
} }
|
|
3585
|
+
}] } } }
|
|
3586
|
+
},
|
|
3587
|
+
"401": { "$ref": "#/components/responses/Unauthorized" }
|
|
3588
|
+
}
|
|
3589
|
+
},
|
|
3590
|
+
"post": {
|
|
3591
|
+
"operationId": "createRoute",
|
|
3592
|
+
"summary": "Create a recipient route",
|
|
3593
|
+
"description": "Binds a recipient pattern to a destination. Provide exactly one of\n`endpoint_id` (an existing endpoint) or `function_id`. With `function_id`,\na dedicated route-target endpoint is minted for that function in the same\ntransaction, enabling per-address function routing (e.g.\n`alice@acme.com -> functionA`).\n",
|
|
3594
|
+
"tags": ["Routes"],
|
|
3595
|
+
"requestBody": {
|
|
3596
|
+
"required": true,
|
|
3597
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRouteInput" } } }
|
|
3598
|
+
},
|
|
3599
|
+
"responses": {
|
|
3600
|
+
"201": {
|
|
3601
|
+
"description": "Route created",
|
|
3602
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
3603
|
+
"type": "object",
|
|
3604
|
+
"properties": { "data": { "$ref": "#/components/schemas/RecipientRoute" } }
|
|
3605
|
+
}] } } }
|
|
3606
|
+
},
|
|
3607
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
3608
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
3609
|
+
"409": { "$ref": "#/components/responses/Conflict" }
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
},
|
|
3613
|
+
"/routes/reorder": { "post": {
|
|
3614
|
+
"operationId": "reorderRoutes",
|
|
3615
|
+
"summary": "Reorder recipient routes",
|
|
3616
|
+
"description": "Update the priority of one or more routes in a single call.",
|
|
3617
|
+
"tags": ["Routes"],
|
|
3618
|
+
"requestBody": {
|
|
3619
|
+
"required": true,
|
|
3620
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReorderRoutesInput" } } }
|
|
3621
|
+
},
|
|
3622
|
+
"responses": {
|
|
3623
|
+
"200": {
|
|
3624
|
+
"description": "Updated route list",
|
|
3625
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
3626
|
+
"type": "object",
|
|
3627
|
+
"properties": { "data": {
|
|
3628
|
+
"type": "array",
|
|
3629
|
+
"items": { "$ref": "#/components/schemas/RecipientRoute" }
|
|
3630
|
+
} }
|
|
3631
|
+
}] } } }
|
|
3632
|
+
},
|
|
3633
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
3634
|
+
"401": { "$ref": "#/components/responses/Unauthorized" }
|
|
3635
|
+
}
|
|
3636
|
+
} },
|
|
3637
|
+
"/routes/simulate": { "post": {
|
|
3638
|
+
"operationId": "simulateRoute",
|
|
3639
|
+
"summary": "Simulate routing for a recipient",
|
|
3640
|
+
"description": "Resolves where an inbound email to `recipient` would be delivered, with a\ntrace of every rule evaluated and why. Read-only; creates nothing.\n",
|
|
3641
|
+
"tags": ["Routes"],
|
|
3642
|
+
"requestBody": {
|
|
3643
|
+
"required": true,
|
|
3644
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulateRouteInput" } } }
|
|
3645
|
+
},
|
|
3646
|
+
"responses": {
|
|
3647
|
+
"200": {
|
|
3648
|
+
"description": "Routing decision",
|
|
3649
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
3650
|
+
"type": "object",
|
|
3651
|
+
"properties": { "data": { "$ref": "#/components/schemas/SimulateRouteResult" } }
|
|
3652
|
+
}] } } }
|
|
3653
|
+
},
|
|
3654
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
3655
|
+
"401": { "$ref": "#/components/responses/Unauthorized" }
|
|
3656
|
+
}
|
|
3657
|
+
} },
|
|
3658
|
+
"/routes/{id}": {
|
|
3659
|
+
"parameters": [{ "$ref": "#/components/parameters/ResourceId" }],
|
|
3660
|
+
"patch": {
|
|
3661
|
+
"operationId": "updateRoute",
|
|
3662
|
+
"summary": "Update a recipient route",
|
|
3663
|
+
"tags": ["Routes"],
|
|
3664
|
+
"requestBody": {
|
|
3665
|
+
"required": true,
|
|
3666
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateRouteInput" } } }
|
|
3667
|
+
},
|
|
3668
|
+
"responses": {
|
|
3669
|
+
"200": {
|
|
3670
|
+
"description": "Updated route",
|
|
3671
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
3672
|
+
"type": "object",
|
|
3673
|
+
"properties": { "data": { "$ref": "#/components/schemas/RecipientRoute" } }
|
|
3674
|
+
}] } } }
|
|
3675
|
+
},
|
|
3676
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
3677
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
3678
|
+
"404": { "$ref": "#/components/responses/NotFound" },
|
|
3679
|
+
"409": { "$ref": "#/components/responses/Conflict" }
|
|
3680
|
+
}
|
|
3681
|
+
},
|
|
3682
|
+
"delete": {
|
|
3683
|
+
"operationId": "deleteRoute",
|
|
3684
|
+
"summary": "Delete a recipient route",
|
|
3685
|
+
"tags": ["Routes"],
|
|
3686
|
+
"responses": {
|
|
3687
|
+
"200": { "$ref": "#/components/responses/Deleted" },
|
|
3688
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
3689
|
+
"404": { "$ref": "#/components/responses/NotFound" }
|
|
3690
|
+
}
|
|
3691
|
+
}
|
|
3692
|
+
},
|
|
3460
3693
|
"/webhooks/deliveries": { "get": {
|
|
3461
3694
|
"operationId": "listDeliveries",
|
|
3462
3695
|
"summary": "List webhook deliveries",
|
|
@@ -8856,14 +9089,11 @@ const openapiDocument = {
|
|
|
8856
9089
|
"properties": { "enabled": { "type": "boolean" } },
|
|
8857
9090
|
"required": ["enabled"]
|
|
8858
9091
|
},
|
|
8859
|
-
"
|
|
9092
|
+
"RecipientRoute": {
|
|
8860
9093
|
"type": "object",
|
|
9094
|
+
"description": "A recipient routing rule binding an address pattern to one endpoint.",
|
|
8861
9095
|
"properties": {
|
|
8862
9096
|
"id": {
|
|
8863
|
-
"type": "string",
|
|
8864
|
-
"description": "Delivery ID (numeric string)"
|
|
8865
|
-
},
|
|
8866
|
-
"email_id": {
|
|
8867
9097
|
"type": "string",
|
|
8868
9098
|
"format": "uuid"
|
|
8869
9099
|
},
|
|
@@ -8871,79 +9101,341 @@ const openapiDocument = {
|
|
|
8871
9101
|
"type": "string",
|
|
8872
9102
|
"format": "uuid"
|
|
8873
9103
|
},
|
|
8874
|
-
"
|
|
8875
|
-
"type": "string",
|
|
8876
|
-
"format": "uuid"
|
|
9104
|
+
"domain_id": {
|
|
9105
|
+
"type": ["string", "null"],
|
|
9106
|
+
"format": "uuid",
|
|
9107
|
+
"description": "Domain the route is scoped to; null = org-wide."
|
|
8877
9108
|
},
|
|
8878
|
-
"
|
|
8879
|
-
"status": {
|
|
9109
|
+
"match_type": {
|
|
8880
9110
|
"type": "string",
|
|
8881
9111
|
"enum": [
|
|
8882
|
-
"
|
|
8883
|
-
"
|
|
8884
|
-
"
|
|
8885
|
-
"failed"
|
|
9112
|
+
"exact",
|
|
9113
|
+
"wildcard",
|
|
9114
|
+
"regex"
|
|
8886
9115
|
]
|
|
8887
9116
|
},
|
|
8888
|
-
"
|
|
8889
|
-
"duration_ms": { "type": ["integer", "null"] },
|
|
8890
|
-
"last_error": { "type": ["string", "null"] },
|
|
8891
|
-
"created_at": {
|
|
9117
|
+
"pattern": {
|
|
8892
9118
|
"type": "string",
|
|
8893
|
-
"
|
|
9119
|
+
"description": "The recipient address pattern (an exact address or a wildcard)."
|
|
8894
9120
|
},
|
|
8895
|
-
"
|
|
9121
|
+
"pattern_norm": {
|
|
9122
|
+
"type": ["string", "null"],
|
|
9123
|
+
"description": "Normalized pattern used for matching."
|
|
9124
|
+
},
|
|
9125
|
+
"endpoint_id": {
|
|
9126
|
+
"type": "string",
|
|
9127
|
+
"format": "uuid",
|
|
9128
|
+
"description": "The endpoint inbound mail matching this rule is delivered to."
|
|
9129
|
+
},
|
|
9130
|
+
"priority": {
|
|
9131
|
+
"type": "integer",
|
|
9132
|
+
"description": "Evaluation order within a scope; lower is checked first."
|
|
9133
|
+
},
|
|
9134
|
+
"enabled": { "type": "boolean" },
|
|
9135
|
+
"match_count": {
|
|
8896
9136
|
"type": "string",
|
|
9137
|
+
"description": "How many emails have matched this rule (a bigint, returned as a string)."
|
|
9138
|
+
},
|
|
9139
|
+
"last_matched_at": {
|
|
9140
|
+
"type": ["string", "null"],
|
|
8897
9141
|
"format": "date-time"
|
|
8898
9142
|
},
|
|
8899
|
-
"
|
|
8900
|
-
"type":
|
|
8901
|
-
"
|
|
8902
|
-
"sender": { "type": "string" },
|
|
8903
|
-
"recipient": { "type": "string" },
|
|
8904
|
-
"subject": { "type": ["string", "null"] }
|
|
8905
|
-
},
|
|
8906
|
-
"required": ["sender", "recipient"]
|
|
9143
|
+
"created_at": {
|
|
9144
|
+
"type": "string",
|
|
9145
|
+
"format": "date-time"
|
|
8907
9146
|
}
|
|
8908
9147
|
},
|
|
8909
|
-
"required": [
|
|
8910
|
-
"id",
|
|
8911
|
-
"email_id",
|
|
8912
|
-
"org_id",
|
|
8913
|
-
"endpoint_id",
|
|
8914
|
-
"endpoint_url",
|
|
8915
|
-
"status",
|
|
8916
|
-
"attempt_count",
|
|
8917
|
-
"created_at",
|
|
8918
|
-
"updated_at"
|
|
8919
|
-
]
|
|
9148
|
+
"required": ["id"]
|
|
8920
9149
|
},
|
|
8921
|
-
"
|
|
9150
|
+
"CreateRouteInput": {
|
|
8922
9151
|
"type": "object",
|
|
9152
|
+
"additionalProperties": false,
|
|
9153
|
+
"description": "Provide exactly one of `endpoint_id` or `function_id`. With `function_id`,\na route-target endpoint is minted for that function and the route is bound\nto it in one transaction.\n",
|
|
8923
9154
|
"properties": {
|
|
8924
|
-
"
|
|
8925
|
-
"type": "
|
|
8926
|
-
"
|
|
9155
|
+
"match_type": {
|
|
9156
|
+
"type": "string",
|
|
9157
|
+
"enum": [
|
|
9158
|
+
"exact",
|
|
9159
|
+
"wildcard",
|
|
9160
|
+
"regex"
|
|
9161
|
+
]
|
|
8927
9162
|
},
|
|
8928
|
-
"
|
|
9163
|
+
"pattern": {
|
|
9164
|
+
"type": "string",
|
|
9165
|
+
"minLength": 1,
|
|
9166
|
+
"maxLength": 512
|
|
9167
|
+
},
|
|
9168
|
+
"endpoint_id": {
|
|
9169
|
+
"type": "string",
|
|
9170
|
+
"format": "uuid",
|
|
9171
|
+
"description": "An existing endpoint to route to. Mutually exclusive with function_id."
|
|
9172
|
+
},
|
|
9173
|
+
"function_id": {
|
|
9174
|
+
"type": "string",
|
|
9175
|
+
"format": "uuid",
|
|
9176
|
+
"description": "Route to this function, minting its route-target endpoint if needed. Mutually exclusive with endpoint_id."
|
|
9177
|
+
},
|
|
9178
|
+
"domain_id": {
|
|
9179
|
+
"type": ["string", "null"],
|
|
9180
|
+
"format": "uuid",
|
|
9181
|
+
"description": "Scope the route to a domain; defaults to the pattern's domain."
|
|
9182
|
+
},
|
|
9183
|
+
"priority": {
|
|
8929
9184
|
"type": "integer",
|
|
8930
|
-
"
|
|
8931
|
-
|
|
9185
|
+
"minimum": 0,
|
|
9186
|
+
"maximum": 1e6
|
|
9187
|
+
},
|
|
9188
|
+
"enabled": { "type": "boolean" }
|
|
8932
9189
|
},
|
|
8933
|
-
"required": ["
|
|
9190
|
+
"required": ["match_type", "pattern"]
|
|
8934
9191
|
},
|
|
8935
|
-
"
|
|
9192
|
+
"UpdateRouteInput": {
|
|
8936
9193
|
"type": "object",
|
|
9194
|
+
"additionalProperties": false,
|
|
8937
9195
|
"properties": {
|
|
8938
|
-
"
|
|
8939
|
-
"type": "
|
|
8940
|
-
"
|
|
9196
|
+
"match_type": {
|
|
9197
|
+
"type": "string",
|
|
9198
|
+
"enum": [
|
|
9199
|
+
"exact",
|
|
9200
|
+
"wildcard",
|
|
9201
|
+
"regex"
|
|
9202
|
+
]
|
|
8941
9203
|
},
|
|
8942
|
-
"
|
|
8943
|
-
"type": "
|
|
8944
|
-
"
|
|
8945
|
-
|
|
8946
|
-
|
|
9204
|
+
"pattern": {
|
|
9205
|
+
"type": "string",
|
|
9206
|
+
"minLength": 1,
|
|
9207
|
+
"maxLength": 512
|
|
9208
|
+
},
|
|
9209
|
+
"endpoint_id": {
|
|
9210
|
+
"type": "string",
|
|
9211
|
+
"format": "uuid"
|
|
9212
|
+
},
|
|
9213
|
+
"domain_id": {
|
|
9214
|
+
"type": ["string", "null"],
|
|
9215
|
+
"format": "uuid"
|
|
9216
|
+
},
|
|
9217
|
+
"priority": {
|
|
9218
|
+
"type": "integer",
|
|
9219
|
+
"minimum": 0,
|
|
9220
|
+
"maximum": 1e6
|
|
9221
|
+
},
|
|
9222
|
+
"enabled": { "type": "boolean" }
|
|
9223
|
+
}
|
|
9224
|
+
},
|
|
9225
|
+
"ReorderRoutesInput": {
|
|
9226
|
+
"type": "object",
|
|
9227
|
+
"additionalProperties": false,
|
|
9228
|
+
"properties": { "updates": {
|
|
9229
|
+
"type": "array",
|
|
9230
|
+
"minItems": 1,
|
|
9231
|
+
"maxItems": 1e3,
|
|
9232
|
+
"items": {
|
|
9233
|
+
"type": "object",
|
|
9234
|
+
"additionalProperties": false,
|
|
9235
|
+
"properties": {
|
|
9236
|
+
"id": {
|
|
9237
|
+
"type": "string",
|
|
9238
|
+
"format": "uuid"
|
|
9239
|
+
},
|
|
9240
|
+
"priority": {
|
|
9241
|
+
"type": "integer",
|
|
9242
|
+
"minimum": 0,
|
|
9243
|
+
"maximum": 1e6
|
|
9244
|
+
}
|
|
9245
|
+
},
|
|
9246
|
+
"required": ["id", "priority"]
|
|
9247
|
+
}
|
|
9248
|
+
} },
|
|
9249
|
+
"required": ["updates"]
|
|
9250
|
+
},
|
|
9251
|
+
"SimulateRouteInput": {
|
|
9252
|
+
"type": "object",
|
|
9253
|
+
"additionalProperties": false,
|
|
9254
|
+
"properties": {
|
|
9255
|
+
"recipient": {
|
|
9256
|
+
"type": "string",
|
|
9257
|
+
"minLength": 1,
|
|
9258
|
+
"maxLength": 320
|
|
9259
|
+
},
|
|
9260
|
+
"event_type": {
|
|
9261
|
+
"type": "string",
|
|
9262
|
+
"minLength": 1,
|
|
9263
|
+
"maxLength": 100,
|
|
9264
|
+
"description": "Event type to model; defaults to email.received."
|
|
9265
|
+
}
|
|
9266
|
+
},
|
|
9267
|
+
"required": ["recipient"]
|
|
9268
|
+
},
|
|
9269
|
+
"RouteEvaluatedEntry": {
|
|
9270
|
+
"type": "object",
|
|
9271
|
+
"properties": {
|
|
9272
|
+
"route_id": { "type": "string" },
|
|
9273
|
+
"tier": {
|
|
9274
|
+
"type": "string",
|
|
9275
|
+
"enum": [
|
|
9276
|
+
"exact",
|
|
9277
|
+
"wildcard",
|
|
9278
|
+
"regex"
|
|
9279
|
+
]
|
|
9280
|
+
},
|
|
9281
|
+
"pattern": { "type": "string" },
|
|
9282
|
+
"result": {
|
|
9283
|
+
"type": "string",
|
|
9284
|
+
"enum": [
|
|
9285
|
+
"hit",
|
|
9286
|
+
"miss",
|
|
9287
|
+
"skipped",
|
|
9288
|
+
"error"
|
|
9289
|
+
]
|
|
9290
|
+
},
|
|
9291
|
+
"reason": { "type": "string" }
|
|
9292
|
+
},
|
|
9293
|
+
"required": [
|
|
9294
|
+
"route_id",
|
|
9295
|
+
"tier",
|
|
9296
|
+
"pattern",
|
|
9297
|
+
"result"
|
|
9298
|
+
]
|
|
9299
|
+
},
|
|
9300
|
+
"SimulateRouteResult": {
|
|
9301
|
+
"type": "object",
|
|
9302
|
+
"description": "Where an inbound email to the recipient would be delivered, and why.",
|
|
9303
|
+
"properties": {
|
|
9304
|
+
"outcome": {
|
|
9305
|
+
"type": "string",
|
|
9306
|
+
"enum": [
|
|
9307
|
+
"matched",
|
|
9308
|
+
"defaulted",
|
|
9309
|
+
"none"
|
|
9310
|
+
]
|
|
9311
|
+
},
|
|
9312
|
+
"recipient": { "type": "string" },
|
|
9313
|
+
"endpoint_id": { "type": ["string", "null"] },
|
|
9314
|
+
"matched_route_id": { "type": ["string", "null"] },
|
|
9315
|
+
"matched_tier": {
|
|
9316
|
+
"type": ["string", "null"],
|
|
9317
|
+
"enum": [
|
|
9318
|
+
"exact",
|
|
9319
|
+
"wildcard",
|
|
9320
|
+
"regex",
|
|
9321
|
+
null
|
|
9322
|
+
]
|
|
9323
|
+
},
|
|
9324
|
+
"matched_pattern": { "type": ["string", "null"] },
|
|
9325
|
+
"default_scope": {
|
|
9326
|
+
"type": ["string", "null"],
|
|
9327
|
+
"enum": [
|
|
9328
|
+
"domain",
|
|
9329
|
+
"org",
|
|
9330
|
+
null
|
|
9331
|
+
]
|
|
9332
|
+
},
|
|
9333
|
+
"evaluated": {
|
|
9334
|
+
"type": "array",
|
|
9335
|
+
"items": { "$ref": "#/components/schemas/RouteEvaluatedEntry" }
|
|
9336
|
+
},
|
|
9337
|
+
"truncated": { "type": "boolean" }
|
|
9338
|
+
},
|
|
9339
|
+
"required": [
|
|
9340
|
+
"outcome",
|
|
9341
|
+
"recipient",
|
|
9342
|
+
"endpoint_id",
|
|
9343
|
+
"matched_route_id",
|
|
9344
|
+
"matched_tier",
|
|
9345
|
+
"matched_pattern",
|
|
9346
|
+
"default_scope",
|
|
9347
|
+
"evaluated",
|
|
9348
|
+
"truncated"
|
|
9349
|
+
]
|
|
9350
|
+
},
|
|
9351
|
+
"DeliverySummary": {
|
|
9352
|
+
"type": "object",
|
|
9353
|
+
"properties": {
|
|
9354
|
+
"id": {
|
|
9355
|
+
"type": "string",
|
|
9356
|
+
"description": "Delivery ID (numeric string)"
|
|
9357
|
+
},
|
|
9358
|
+
"email_id": {
|
|
9359
|
+
"type": "string",
|
|
9360
|
+
"format": "uuid"
|
|
9361
|
+
},
|
|
9362
|
+
"org_id": {
|
|
9363
|
+
"type": "string",
|
|
9364
|
+
"format": "uuid"
|
|
9365
|
+
},
|
|
9366
|
+
"endpoint_id": {
|
|
9367
|
+
"type": "string",
|
|
9368
|
+
"format": "uuid"
|
|
9369
|
+
},
|
|
9370
|
+
"endpoint_url": { "type": "string" },
|
|
9371
|
+
"status": {
|
|
9372
|
+
"type": "string",
|
|
9373
|
+
"enum": [
|
|
9374
|
+
"pending",
|
|
9375
|
+
"delivered",
|
|
9376
|
+
"header_confirmed",
|
|
9377
|
+
"failed"
|
|
9378
|
+
]
|
|
9379
|
+
},
|
|
9380
|
+
"attempt_count": { "type": "integer" },
|
|
9381
|
+
"duration_ms": { "type": ["integer", "null"] },
|
|
9382
|
+
"last_error": { "type": ["string", "null"] },
|
|
9383
|
+
"created_at": {
|
|
9384
|
+
"type": "string",
|
|
9385
|
+
"format": "date-time"
|
|
9386
|
+
},
|
|
9387
|
+
"updated_at": {
|
|
9388
|
+
"type": "string",
|
|
9389
|
+
"format": "date-time"
|
|
9390
|
+
},
|
|
9391
|
+
"email": {
|
|
9392
|
+
"type": ["object", "null"],
|
|
9393
|
+
"properties": {
|
|
9394
|
+
"sender": { "type": "string" },
|
|
9395
|
+
"recipient": { "type": "string" },
|
|
9396
|
+
"subject": { "type": ["string", "null"] }
|
|
9397
|
+
},
|
|
9398
|
+
"required": ["sender", "recipient"]
|
|
9399
|
+
}
|
|
9400
|
+
},
|
|
9401
|
+
"required": [
|
|
9402
|
+
"id",
|
|
9403
|
+
"email_id",
|
|
9404
|
+
"org_id",
|
|
9405
|
+
"endpoint_id",
|
|
9406
|
+
"endpoint_url",
|
|
9407
|
+
"status",
|
|
9408
|
+
"attempt_count",
|
|
9409
|
+
"created_at",
|
|
9410
|
+
"updated_at"
|
|
9411
|
+
]
|
|
9412
|
+
},
|
|
9413
|
+
"ReplayResult": {
|
|
9414
|
+
"type": "object",
|
|
9415
|
+
"properties": {
|
|
9416
|
+
"delivered": {
|
|
9417
|
+
"type": "integer",
|
|
9418
|
+
"description": "Number of successful deliveries"
|
|
9419
|
+
},
|
|
9420
|
+
"failed": {
|
|
9421
|
+
"type": "integer",
|
|
9422
|
+
"description": "Number of failed deliveries"
|
|
9423
|
+
}
|
|
9424
|
+
},
|
|
9425
|
+
"required": ["delivered", "failed"]
|
|
9426
|
+
},
|
|
9427
|
+
"DiscardContentResult": {
|
|
9428
|
+
"type": "object",
|
|
9429
|
+
"properties": {
|
|
9430
|
+
"discarded": {
|
|
9431
|
+
"type": "boolean",
|
|
9432
|
+
"description": "Always `true` on a 2xx response. The content is either now\ndiscarded as a result of this call, or was already discarded\nbefore this call ran.\n"
|
|
9433
|
+
},
|
|
9434
|
+
"already_discarded": {
|
|
9435
|
+
"type": "boolean",
|
|
9436
|
+
"description": "`true` if the email's content was already discarded before\nthis call ran (no work was done). `false` if this call was\nthe one that performed the discard.\n"
|
|
9437
|
+
}
|
|
9438
|
+
},
|
|
8947
9439
|
"required": ["discarded", "already_discarded"]
|
|
8948
9440
|
},
|
|
8949
9441
|
"FunctionDeployStatus": {
|
|
@@ -16764,109 +17256,658 @@ const operationManifest = [
|
|
|
16764
17256
|
"type": "array",
|
|
16765
17257
|
"items": { "type": "string" }
|
|
16766
17258
|
},
|
|
16767
|
-
"handle": {
|
|
17259
|
+
"handle": {
|
|
17260
|
+
"type": ["string", "null"],
|
|
17261
|
+
"description": "The registry-scoped name. Null on the global by-address read."
|
|
17262
|
+
}
|
|
17263
|
+
},
|
|
17264
|
+
"required": [
|
|
17265
|
+
"address",
|
|
17266
|
+
"display_name",
|
|
17267
|
+
"title",
|
|
17268
|
+
"description",
|
|
17269
|
+
"tags",
|
|
17270
|
+
"handle"
|
|
17271
|
+
]
|
|
17272
|
+
},
|
|
17273
|
+
"sdkName": "resolveRegistryHandle",
|
|
17274
|
+
"summary": "Resolve a registry handle to its agent",
|
|
17275
|
+
"tag": "Registries",
|
|
17276
|
+
"tagCommand": "registries"
|
|
17277
|
+
},
|
|
17278
|
+
{
|
|
17279
|
+
"binaryResponse": false,
|
|
17280
|
+
"bodyRequired": false,
|
|
17281
|
+
"command": "unpublish-agent",
|
|
17282
|
+
"description": null,
|
|
17283
|
+
"hasJsonBody": false,
|
|
17284
|
+
"method": "DELETE",
|
|
17285
|
+
"operationId": "unpublishAgent",
|
|
17286
|
+
"path": "/registries/{slug}/agents/{handle}",
|
|
17287
|
+
"pathParams": [{
|
|
17288
|
+
"description": "The registry slug.",
|
|
17289
|
+
"enum": null,
|
|
17290
|
+
"name": "slug",
|
|
17291
|
+
"required": true,
|
|
17292
|
+
"type": "string"
|
|
17293
|
+
}, {
|
|
17294
|
+
"description": "The registry-scoped handle the agent is published under.",
|
|
17295
|
+
"enum": null,
|
|
17296
|
+
"name": "handle",
|
|
17297
|
+
"required": true,
|
|
17298
|
+
"type": "string"
|
|
17299
|
+
}],
|
|
17300
|
+
"queryParams": [],
|
|
17301
|
+
"requestSchema": null,
|
|
17302
|
+
"responseSchema": null,
|
|
17303
|
+
"sdkName": "unpublishAgent",
|
|
17304
|
+
"summary": "Unpublish an agent from a registry",
|
|
17305
|
+
"tag": "Registries",
|
|
17306
|
+
"tagCommand": "registries"
|
|
17307
|
+
},
|
|
17308
|
+
{
|
|
17309
|
+
"binaryResponse": false,
|
|
17310
|
+
"bodyRequired": true,
|
|
17311
|
+
"command": "update-registry",
|
|
17312
|
+
"description": null,
|
|
17313
|
+
"hasJsonBody": true,
|
|
17314
|
+
"method": "PATCH",
|
|
17315
|
+
"operationId": "updateRegistry",
|
|
17316
|
+
"path": "/registries/{slug}",
|
|
17317
|
+
"pathParams": [{
|
|
17318
|
+
"description": "The registry slug",
|
|
17319
|
+
"enum": null,
|
|
17320
|
+
"name": "slug",
|
|
17321
|
+
"required": true,
|
|
17322
|
+
"type": "string"
|
|
17323
|
+
}],
|
|
17324
|
+
"queryParams": [],
|
|
17325
|
+
"requestSchema": {
|
|
17326
|
+
"type": "object",
|
|
17327
|
+
"minProperties": 1,
|
|
17328
|
+
"properties": {
|
|
17329
|
+
"name": {
|
|
17330
|
+
"type": "string",
|
|
17331
|
+
"minLength": 1,
|
|
17332
|
+
"maxLength": 120
|
|
17333
|
+
},
|
|
17334
|
+
"description": {
|
|
17335
|
+
"type": ["string", "null"],
|
|
17336
|
+
"maxLength": 2e3
|
|
17337
|
+
},
|
|
17338
|
+
"is_public": { "type": "boolean" },
|
|
17339
|
+
"publish_policy": {
|
|
17340
|
+
"type": "string",
|
|
17341
|
+
"enum": [
|
|
17342
|
+
"owner_only",
|
|
17343
|
+
"request",
|
|
17344
|
+
"open"
|
|
17345
|
+
],
|
|
17346
|
+
"description": "Who may publish into a registry. owner_only: only the registry owner.\nrequest: anyone may request and the owner approves. open: anyone may\npublish and it lists immediately (no approval step).\n"
|
|
17347
|
+
}
|
|
17348
|
+
}
|
|
17349
|
+
},
|
|
17350
|
+
"responseSchema": {
|
|
17351
|
+
"type": "object",
|
|
17352
|
+
"properties": { "id": {
|
|
17353
|
+
"type": "string",
|
|
17354
|
+
"format": "uuid"
|
|
17355
|
+
} },
|
|
17356
|
+
"required": ["id"]
|
|
17357
|
+
},
|
|
17358
|
+
"sdkName": "updateRegistry",
|
|
17359
|
+
"summary": "Update a registry you own",
|
|
17360
|
+
"tag": "Registries",
|
|
17361
|
+
"tagCommand": "registries"
|
|
17362
|
+
},
|
|
17363
|
+
{
|
|
17364
|
+
"binaryResponse": false,
|
|
17365
|
+
"bodyRequired": true,
|
|
17366
|
+
"command": "create-route",
|
|
17367
|
+
"description": "Binds a recipient pattern to a destination. Provide exactly one of\n`endpoint_id` (an existing endpoint) or `function_id`. With `function_id`,\na dedicated route-target endpoint is minted for that function in the same\ntransaction, enabling per-address function routing (e.g.\n`alice@acme.com -> functionA`).\n",
|
|
17368
|
+
"hasJsonBody": true,
|
|
17369
|
+
"method": "POST",
|
|
17370
|
+
"operationId": "createRoute",
|
|
17371
|
+
"path": "/routes",
|
|
17372
|
+
"pathParams": [],
|
|
17373
|
+
"queryParams": [],
|
|
17374
|
+
"requestSchema": {
|
|
17375
|
+
"type": "object",
|
|
17376
|
+
"additionalProperties": false,
|
|
17377
|
+
"description": "Provide exactly one of `endpoint_id` or `function_id`. With `function_id`,\na route-target endpoint is minted for that function and the route is bound\nto it in one transaction.\n",
|
|
17378
|
+
"properties": {
|
|
17379
|
+
"match_type": {
|
|
17380
|
+
"type": "string",
|
|
17381
|
+
"enum": [
|
|
17382
|
+
"exact",
|
|
17383
|
+
"wildcard",
|
|
17384
|
+
"regex"
|
|
17385
|
+
]
|
|
17386
|
+
},
|
|
17387
|
+
"pattern": {
|
|
17388
|
+
"type": "string",
|
|
17389
|
+
"minLength": 1,
|
|
17390
|
+
"maxLength": 512
|
|
17391
|
+
},
|
|
17392
|
+
"endpoint_id": {
|
|
17393
|
+
"type": "string",
|
|
17394
|
+
"format": "uuid",
|
|
17395
|
+
"description": "An existing endpoint to route to. Mutually exclusive with function_id."
|
|
17396
|
+
},
|
|
17397
|
+
"function_id": {
|
|
17398
|
+
"type": "string",
|
|
17399
|
+
"format": "uuid",
|
|
17400
|
+
"description": "Route to this function, minting its route-target endpoint if needed. Mutually exclusive with endpoint_id."
|
|
17401
|
+
},
|
|
17402
|
+
"domain_id": {
|
|
17403
|
+
"type": ["string", "null"],
|
|
17404
|
+
"format": "uuid",
|
|
17405
|
+
"description": "Scope the route to a domain; defaults to the pattern's domain."
|
|
17406
|
+
},
|
|
17407
|
+
"priority": {
|
|
17408
|
+
"type": "integer",
|
|
17409
|
+
"minimum": 0,
|
|
17410
|
+
"maximum": 1e6
|
|
17411
|
+
},
|
|
17412
|
+
"enabled": { "type": "boolean" }
|
|
17413
|
+
},
|
|
17414
|
+
"required": ["match_type", "pattern"]
|
|
17415
|
+
},
|
|
17416
|
+
"responseSchema": {
|
|
17417
|
+
"type": "object",
|
|
17418
|
+
"description": "A recipient routing rule binding an address pattern to one endpoint.",
|
|
17419
|
+
"properties": {
|
|
17420
|
+
"id": {
|
|
17421
|
+
"type": "string",
|
|
17422
|
+
"format": "uuid"
|
|
17423
|
+
},
|
|
17424
|
+
"org_id": {
|
|
17425
|
+
"type": "string",
|
|
17426
|
+
"format": "uuid"
|
|
17427
|
+
},
|
|
17428
|
+
"domain_id": {
|
|
17429
|
+
"type": ["string", "null"],
|
|
17430
|
+
"format": "uuid",
|
|
17431
|
+
"description": "Domain the route is scoped to; null = org-wide."
|
|
17432
|
+
},
|
|
17433
|
+
"match_type": {
|
|
17434
|
+
"type": "string",
|
|
17435
|
+
"enum": [
|
|
17436
|
+
"exact",
|
|
17437
|
+
"wildcard",
|
|
17438
|
+
"regex"
|
|
17439
|
+
]
|
|
17440
|
+
},
|
|
17441
|
+
"pattern": {
|
|
17442
|
+
"type": "string",
|
|
17443
|
+
"description": "The recipient address pattern (an exact address or a wildcard)."
|
|
17444
|
+
},
|
|
17445
|
+
"pattern_norm": {
|
|
17446
|
+
"type": ["string", "null"],
|
|
17447
|
+
"description": "Normalized pattern used for matching."
|
|
17448
|
+
},
|
|
17449
|
+
"endpoint_id": {
|
|
17450
|
+
"type": "string",
|
|
17451
|
+
"format": "uuid",
|
|
17452
|
+
"description": "The endpoint inbound mail matching this rule is delivered to."
|
|
17453
|
+
},
|
|
17454
|
+
"priority": {
|
|
17455
|
+
"type": "integer",
|
|
17456
|
+
"description": "Evaluation order within a scope; lower is checked first."
|
|
17457
|
+
},
|
|
17458
|
+
"enabled": { "type": "boolean" },
|
|
17459
|
+
"match_count": {
|
|
17460
|
+
"type": "string",
|
|
17461
|
+
"description": "How many emails have matched this rule (a bigint, returned as a string)."
|
|
17462
|
+
},
|
|
17463
|
+
"last_matched_at": {
|
|
17464
|
+
"type": ["string", "null"],
|
|
17465
|
+
"format": "date-time"
|
|
17466
|
+
},
|
|
17467
|
+
"created_at": {
|
|
17468
|
+
"type": "string",
|
|
17469
|
+
"format": "date-time"
|
|
17470
|
+
}
|
|
17471
|
+
},
|
|
17472
|
+
"required": ["id"]
|
|
17473
|
+
},
|
|
17474
|
+
"sdkName": "createRoute",
|
|
17475
|
+
"summary": "Create a recipient route",
|
|
17476
|
+
"tag": "Routes",
|
|
17477
|
+
"tagCommand": "routes"
|
|
17478
|
+
},
|
|
17479
|
+
{
|
|
17480
|
+
"binaryResponse": false,
|
|
17481
|
+
"bodyRequired": false,
|
|
17482
|
+
"command": "delete-route",
|
|
17483
|
+
"description": null,
|
|
17484
|
+
"hasJsonBody": false,
|
|
17485
|
+
"method": "DELETE",
|
|
17486
|
+
"operationId": "deleteRoute",
|
|
17487
|
+
"path": "/routes/{id}",
|
|
17488
|
+
"pathParams": [{
|
|
17489
|
+
"description": "Resource UUID",
|
|
17490
|
+
"enum": null,
|
|
17491
|
+
"name": "id",
|
|
17492
|
+
"required": true,
|
|
17493
|
+
"type": "string"
|
|
17494
|
+
}],
|
|
17495
|
+
"queryParams": [],
|
|
17496
|
+
"requestSchema": null,
|
|
17497
|
+
"responseSchema": null,
|
|
17498
|
+
"sdkName": "deleteRoute",
|
|
17499
|
+
"summary": "Delete a recipient route",
|
|
17500
|
+
"tag": "Routes",
|
|
17501
|
+
"tagCommand": "routes"
|
|
17502
|
+
},
|
|
17503
|
+
{
|
|
17504
|
+
"binaryResponse": false,
|
|
17505
|
+
"bodyRequired": false,
|
|
17506
|
+
"command": "list-routes",
|
|
17507
|
+
"description": "Returns the org's recipient routing rules in evaluation order. Each rule\nbinds a recipient address pattern to one endpoint; inbound mail resolves\nto a single destination at delivery time.\n",
|
|
17508
|
+
"hasJsonBody": false,
|
|
17509
|
+
"method": "GET",
|
|
17510
|
+
"operationId": "listRoutes",
|
|
17511
|
+
"path": "/routes",
|
|
17512
|
+
"pathParams": [],
|
|
17513
|
+
"queryParams": [],
|
|
17514
|
+
"requestSchema": null,
|
|
17515
|
+
"responseSchema": {
|
|
17516
|
+
"type": "array",
|
|
17517
|
+
"items": {
|
|
17518
|
+
"type": "object",
|
|
17519
|
+
"description": "A recipient routing rule binding an address pattern to one endpoint.",
|
|
17520
|
+
"properties": {
|
|
17521
|
+
"id": {
|
|
17522
|
+
"type": "string",
|
|
17523
|
+
"format": "uuid"
|
|
17524
|
+
},
|
|
17525
|
+
"org_id": {
|
|
17526
|
+
"type": "string",
|
|
17527
|
+
"format": "uuid"
|
|
17528
|
+
},
|
|
17529
|
+
"domain_id": {
|
|
17530
|
+
"type": ["string", "null"],
|
|
17531
|
+
"format": "uuid",
|
|
17532
|
+
"description": "Domain the route is scoped to; null = org-wide."
|
|
17533
|
+
},
|
|
17534
|
+
"match_type": {
|
|
17535
|
+
"type": "string",
|
|
17536
|
+
"enum": [
|
|
17537
|
+
"exact",
|
|
17538
|
+
"wildcard",
|
|
17539
|
+
"regex"
|
|
17540
|
+
]
|
|
17541
|
+
},
|
|
17542
|
+
"pattern": {
|
|
17543
|
+
"type": "string",
|
|
17544
|
+
"description": "The recipient address pattern (an exact address or a wildcard)."
|
|
17545
|
+
},
|
|
17546
|
+
"pattern_norm": {
|
|
17547
|
+
"type": ["string", "null"],
|
|
17548
|
+
"description": "Normalized pattern used for matching."
|
|
17549
|
+
},
|
|
17550
|
+
"endpoint_id": {
|
|
17551
|
+
"type": "string",
|
|
17552
|
+
"format": "uuid",
|
|
17553
|
+
"description": "The endpoint inbound mail matching this rule is delivered to."
|
|
17554
|
+
},
|
|
17555
|
+
"priority": {
|
|
17556
|
+
"type": "integer",
|
|
17557
|
+
"description": "Evaluation order within a scope; lower is checked first."
|
|
17558
|
+
},
|
|
17559
|
+
"enabled": { "type": "boolean" },
|
|
17560
|
+
"match_count": {
|
|
17561
|
+
"type": "string",
|
|
17562
|
+
"description": "How many emails have matched this rule (a bigint, returned as a string)."
|
|
17563
|
+
},
|
|
17564
|
+
"last_matched_at": {
|
|
17565
|
+
"type": ["string", "null"],
|
|
17566
|
+
"format": "date-time"
|
|
17567
|
+
},
|
|
17568
|
+
"created_at": {
|
|
17569
|
+
"type": "string",
|
|
17570
|
+
"format": "date-time"
|
|
17571
|
+
}
|
|
17572
|
+
},
|
|
17573
|
+
"required": ["id"]
|
|
17574
|
+
}
|
|
17575
|
+
},
|
|
17576
|
+
"sdkName": "listRoutes",
|
|
17577
|
+
"summary": "List recipient routes",
|
|
17578
|
+
"tag": "Routes",
|
|
17579
|
+
"tagCommand": "routes"
|
|
17580
|
+
},
|
|
17581
|
+
{
|
|
17582
|
+
"binaryResponse": false,
|
|
17583
|
+
"bodyRequired": true,
|
|
17584
|
+
"command": "reorder-routes",
|
|
17585
|
+
"description": "Update the priority of one or more routes in a single call.",
|
|
17586
|
+
"hasJsonBody": true,
|
|
17587
|
+
"method": "POST",
|
|
17588
|
+
"operationId": "reorderRoutes",
|
|
17589
|
+
"path": "/routes/reorder",
|
|
17590
|
+
"pathParams": [],
|
|
17591
|
+
"queryParams": [],
|
|
17592
|
+
"requestSchema": {
|
|
17593
|
+
"type": "object",
|
|
17594
|
+
"additionalProperties": false,
|
|
17595
|
+
"properties": { "updates": {
|
|
17596
|
+
"type": "array",
|
|
17597
|
+
"minItems": 1,
|
|
17598
|
+
"maxItems": 1e3,
|
|
17599
|
+
"items": {
|
|
17600
|
+
"type": "object",
|
|
17601
|
+
"additionalProperties": false,
|
|
17602
|
+
"properties": {
|
|
17603
|
+
"id": {
|
|
17604
|
+
"type": "string",
|
|
17605
|
+
"format": "uuid"
|
|
17606
|
+
},
|
|
17607
|
+
"priority": {
|
|
17608
|
+
"type": "integer",
|
|
17609
|
+
"minimum": 0,
|
|
17610
|
+
"maximum": 1e6
|
|
17611
|
+
}
|
|
17612
|
+
},
|
|
17613
|
+
"required": ["id", "priority"]
|
|
17614
|
+
}
|
|
17615
|
+
} },
|
|
17616
|
+
"required": ["updates"]
|
|
17617
|
+
},
|
|
17618
|
+
"responseSchema": {
|
|
17619
|
+
"type": "array",
|
|
17620
|
+
"items": {
|
|
17621
|
+
"type": "object",
|
|
17622
|
+
"description": "A recipient routing rule binding an address pattern to one endpoint.",
|
|
17623
|
+
"properties": {
|
|
17624
|
+
"id": {
|
|
17625
|
+
"type": "string",
|
|
17626
|
+
"format": "uuid"
|
|
17627
|
+
},
|
|
17628
|
+
"org_id": {
|
|
17629
|
+
"type": "string",
|
|
17630
|
+
"format": "uuid"
|
|
17631
|
+
},
|
|
17632
|
+
"domain_id": {
|
|
17633
|
+
"type": ["string", "null"],
|
|
17634
|
+
"format": "uuid",
|
|
17635
|
+
"description": "Domain the route is scoped to; null = org-wide."
|
|
17636
|
+
},
|
|
17637
|
+
"match_type": {
|
|
17638
|
+
"type": "string",
|
|
17639
|
+
"enum": [
|
|
17640
|
+
"exact",
|
|
17641
|
+
"wildcard",
|
|
17642
|
+
"regex"
|
|
17643
|
+
]
|
|
17644
|
+
},
|
|
17645
|
+
"pattern": {
|
|
17646
|
+
"type": "string",
|
|
17647
|
+
"description": "The recipient address pattern (an exact address or a wildcard)."
|
|
17648
|
+
},
|
|
17649
|
+
"pattern_norm": {
|
|
17650
|
+
"type": ["string", "null"],
|
|
17651
|
+
"description": "Normalized pattern used for matching."
|
|
17652
|
+
},
|
|
17653
|
+
"endpoint_id": {
|
|
17654
|
+
"type": "string",
|
|
17655
|
+
"format": "uuid",
|
|
17656
|
+
"description": "The endpoint inbound mail matching this rule is delivered to."
|
|
17657
|
+
},
|
|
17658
|
+
"priority": {
|
|
17659
|
+
"type": "integer",
|
|
17660
|
+
"description": "Evaluation order within a scope; lower is checked first."
|
|
17661
|
+
},
|
|
17662
|
+
"enabled": { "type": "boolean" },
|
|
17663
|
+
"match_count": {
|
|
17664
|
+
"type": "string",
|
|
17665
|
+
"description": "How many emails have matched this rule (a bigint, returned as a string)."
|
|
17666
|
+
},
|
|
17667
|
+
"last_matched_at": {
|
|
17668
|
+
"type": ["string", "null"],
|
|
17669
|
+
"format": "date-time"
|
|
17670
|
+
},
|
|
17671
|
+
"created_at": {
|
|
17672
|
+
"type": "string",
|
|
17673
|
+
"format": "date-time"
|
|
17674
|
+
}
|
|
17675
|
+
},
|
|
17676
|
+
"required": ["id"]
|
|
17677
|
+
}
|
|
17678
|
+
},
|
|
17679
|
+
"sdkName": "reorderRoutes",
|
|
17680
|
+
"summary": "Reorder recipient routes",
|
|
17681
|
+
"tag": "Routes",
|
|
17682
|
+
"tagCommand": "routes"
|
|
17683
|
+
},
|
|
17684
|
+
{
|
|
17685
|
+
"binaryResponse": false,
|
|
17686
|
+
"bodyRequired": true,
|
|
17687
|
+
"command": "simulate-route",
|
|
17688
|
+
"description": "Resolves where an inbound email to `recipient` would be delivered, with a\ntrace of every rule evaluated and why. Read-only; creates nothing.\n",
|
|
17689
|
+
"hasJsonBody": true,
|
|
17690
|
+
"method": "POST",
|
|
17691
|
+
"operationId": "simulateRoute",
|
|
17692
|
+
"path": "/routes/simulate",
|
|
17693
|
+
"pathParams": [],
|
|
17694
|
+
"queryParams": [],
|
|
17695
|
+
"requestSchema": {
|
|
17696
|
+
"type": "object",
|
|
17697
|
+
"additionalProperties": false,
|
|
17698
|
+
"properties": {
|
|
17699
|
+
"recipient": {
|
|
17700
|
+
"type": "string",
|
|
17701
|
+
"minLength": 1,
|
|
17702
|
+
"maxLength": 320
|
|
17703
|
+
},
|
|
17704
|
+
"event_type": {
|
|
17705
|
+
"type": "string",
|
|
17706
|
+
"minLength": 1,
|
|
17707
|
+
"maxLength": 100,
|
|
17708
|
+
"description": "Event type to model; defaults to email.received."
|
|
17709
|
+
}
|
|
17710
|
+
},
|
|
17711
|
+
"required": ["recipient"]
|
|
17712
|
+
},
|
|
17713
|
+
"responseSchema": {
|
|
17714
|
+
"type": "object",
|
|
17715
|
+
"description": "Where an inbound email to the recipient would be delivered, and why.",
|
|
17716
|
+
"properties": {
|
|
17717
|
+
"outcome": {
|
|
17718
|
+
"type": "string",
|
|
17719
|
+
"enum": [
|
|
17720
|
+
"matched",
|
|
17721
|
+
"defaulted",
|
|
17722
|
+
"none"
|
|
17723
|
+
]
|
|
17724
|
+
},
|
|
17725
|
+
"recipient": { "type": "string" },
|
|
17726
|
+
"endpoint_id": { "type": ["string", "null"] },
|
|
17727
|
+
"matched_route_id": { "type": ["string", "null"] },
|
|
17728
|
+
"matched_tier": {
|
|
16768
17729
|
"type": ["string", "null"],
|
|
16769
|
-
"
|
|
16770
|
-
|
|
17730
|
+
"enum": [
|
|
17731
|
+
"exact",
|
|
17732
|
+
"wildcard",
|
|
17733
|
+
"regex",
|
|
17734
|
+
null
|
|
17735
|
+
]
|
|
17736
|
+
},
|
|
17737
|
+
"matched_pattern": { "type": ["string", "null"] },
|
|
17738
|
+
"default_scope": {
|
|
17739
|
+
"type": ["string", "null"],
|
|
17740
|
+
"enum": [
|
|
17741
|
+
"domain",
|
|
17742
|
+
"org",
|
|
17743
|
+
null
|
|
17744
|
+
]
|
|
17745
|
+
},
|
|
17746
|
+
"evaluated": {
|
|
17747
|
+
"type": "array",
|
|
17748
|
+
"items": {
|
|
17749
|
+
"type": "object",
|
|
17750
|
+
"properties": {
|
|
17751
|
+
"route_id": { "type": "string" },
|
|
17752
|
+
"tier": {
|
|
17753
|
+
"type": "string",
|
|
17754
|
+
"enum": [
|
|
17755
|
+
"exact",
|
|
17756
|
+
"wildcard",
|
|
17757
|
+
"regex"
|
|
17758
|
+
]
|
|
17759
|
+
},
|
|
17760
|
+
"pattern": { "type": "string" },
|
|
17761
|
+
"result": {
|
|
17762
|
+
"type": "string",
|
|
17763
|
+
"enum": [
|
|
17764
|
+
"hit",
|
|
17765
|
+
"miss",
|
|
17766
|
+
"skipped",
|
|
17767
|
+
"error"
|
|
17768
|
+
]
|
|
17769
|
+
},
|
|
17770
|
+
"reason": { "type": "string" }
|
|
17771
|
+
},
|
|
17772
|
+
"required": [
|
|
17773
|
+
"route_id",
|
|
17774
|
+
"tier",
|
|
17775
|
+
"pattern",
|
|
17776
|
+
"result"
|
|
17777
|
+
]
|
|
17778
|
+
}
|
|
17779
|
+
},
|
|
17780
|
+
"truncated": { "type": "boolean" }
|
|
16771
17781
|
},
|
|
16772
17782
|
"required": [
|
|
16773
|
-
"
|
|
16774
|
-
"
|
|
16775
|
-
"
|
|
16776
|
-
"
|
|
16777
|
-
"
|
|
16778
|
-
"
|
|
17783
|
+
"outcome",
|
|
17784
|
+
"recipient",
|
|
17785
|
+
"endpoint_id",
|
|
17786
|
+
"matched_route_id",
|
|
17787
|
+
"matched_tier",
|
|
17788
|
+
"matched_pattern",
|
|
17789
|
+
"default_scope",
|
|
17790
|
+
"evaluated",
|
|
17791
|
+
"truncated"
|
|
16779
17792
|
]
|
|
16780
17793
|
},
|
|
16781
|
-
"sdkName": "
|
|
16782
|
-
"summary": "
|
|
16783
|
-
"tag": "
|
|
16784
|
-
"tagCommand": "
|
|
16785
|
-
},
|
|
16786
|
-
{
|
|
16787
|
-
"binaryResponse": false,
|
|
16788
|
-
"bodyRequired": false,
|
|
16789
|
-
"command": "unpublish-agent",
|
|
16790
|
-
"description": null,
|
|
16791
|
-
"hasJsonBody": false,
|
|
16792
|
-
"method": "DELETE",
|
|
16793
|
-
"operationId": "unpublishAgent",
|
|
16794
|
-
"path": "/registries/{slug}/agents/{handle}",
|
|
16795
|
-
"pathParams": [{
|
|
16796
|
-
"description": "The registry slug.",
|
|
16797
|
-
"enum": null,
|
|
16798
|
-
"name": "slug",
|
|
16799
|
-
"required": true,
|
|
16800
|
-
"type": "string"
|
|
16801
|
-
}, {
|
|
16802
|
-
"description": "The registry-scoped handle the agent is published under.",
|
|
16803
|
-
"enum": null,
|
|
16804
|
-
"name": "handle",
|
|
16805
|
-
"required": true,
|
|
16806
|
-
"type": "string"
|
|
16807
|
-
}],
|
|
16808
|
-
"queryParams": [],
|
|
16809
|
-
"requestSchema": null,
|
|
16810
|
-
"responseSchema": null,
|
|
16811
|
-
"sdkName": "unpublishAgent",
|
|
16812
|
-
"summary": "Unpublish an agent from a registry",
|
|
16813
|
-
"tag": "Registries",
|
|
16814
|
-
"tagCommand": "registries"
|
|
17794
|
+
"sdkName": "simulateRoute",
|
|
17795
|
+
"summary": "Simulate routing for a recipient",
|
|
17796
|
+
"tag": "Routes",
|
|
17797
|
+
"tagCommand": "routes"
|
|
16815
17798
|
},
|
|
16816
17799
|
{
|
|
16817
17800
|
"binaryResponse": false,
|
|
16818
17801
|
"bodyRequired": true,
|
|
16819
|
-
"command": "update-
|
|
17802
|
+
"command": "update-route",
|
|
16820
17803
|
"description": null,
|
|
16821
17804
|
"hasJsonBody": true,
|
|
16822
17805
|
"method": "PATCH",
|
|
16823
|
-
"operationId": "
|
|
16824
|
-
"path": "/
|
|
17806
|
+
"operationId": "updateRoute",
|
|
17807
|
+
"path": "/routes/{id}",
|
|
16825
17808
|
"pathParams": [{
|
|
16826
|
-
"description": "
|
|
17809
|
+
"description": "Resource UUID",
|
|
16827
17810
|
"enum": null,
|
|
16828
|
-
"name": "
|
|
17811
|
+
"name": "id",
|
|
16829
17812
|
"required": true,
|
|
16830
17813
|
"type": "string"
|
|
16831
17814
|
}],
|
|
16832
17815
|
"queryParams": [],
|
|
16833
17816
|
"requestSchema": {
|
|
16834
17817
|
"type": "object",
|
|
16835
|
-
"
|
|
17818
|
+
"additionalProperties": false,
|
|
16836
17819
|
"properties": {
|
|
16837
|
-
"
|
|
17820
|
+
"match_type": {
|
|
17821
|
+
"type": "string",
|
|
17822
|
+
"enum": [
|
|
17823
|
+
"exact",
|
|
17824
|
+
"wildcard",
|
|
17825
|
+
"regex"
|
|
17826
|
+
]
|
|
17827
|
+
},
|
|
17828
|
+
"pattern": {
|
|
16838
17829
|
"type": "string",
|
|
16839
17830
|
"minLength": 1,
|
|
16840
|
-
"maxLength":
|
|
17831
|
+
"maxLength": 512
|
|
16841
17832
|
},
|
|
16842
|
-
"
|
|
17833
|
+
"endpoint_id": {
|
|
17834
|
+
"type": "string",
|
|
17835
|
+
"format": "uuid"
|
|
17836
|
+
},
|
|
17837
|
+
"domain_id": {
|
|
16843
17838
|
"type": ["string", "null"],
|
|
16844
|
-
"
|
|
17839
|
+
"format": "uuid"
|
|
16845
17840
|
},
|
|
16846
|
-
"
|
|
16847
|
-
|
|
16848
|
-
"
|
|
16849
|
-
"
|
|
16850
|
-
|
|
16851
|
-
|
|
16852
|
-
"open"
|
|
16853
|
-
],
|
|
16854
|
-
"description": "Who may publish into a registry. owner_only: only the registry owner.\nrequest: anyone may request and the owner approves. open: anyone may\npublish and it lists immediately (no approval step).\n"
|
|
16855
|
-
}
|
|
17841
|
+
"priority": {
|
|
17842
|
+
"type": "integer",
|
|
17843
|
+
"minimum": 0,
|
|
17844
|
+
"maximum": 1e6
|
|
17845
|
+
},
|
|
17846
|
+
"enabled": { "type": "boolean" }
|
|
16856
17847
|
}
|
|
16857
17848
|
},
|
|
16858
17849
|
"responseSchema": {
|
|
16859
17850
|
"type": "object",
|
|
16860
|
-
"
|
|
16861
|
-
|
|
16862
|
-
"
|
|
16863
|
-
|
|
17851
|
+
"description": "A recipient routing rule binding an address pattern to one endpoint.",
|
|
17852
|
+
"properties": {
|
|
17853
|
+
"id": {
|
|
17854
|
+
"type": "string",
|
|
17855
|
+
"format": "uuid"
|
|
17856
|
+
},
|
|
17857
|
+
"org_id": {
|
|
17858
|
+
"type": "string",
|
|
17859
|
+
"format": "uuid"
|
|
17860
|
+
},
|
|
17861
|
+
"domain_id": {
|
|
17862
|
+
"type": ["string", "null"],
|
|
17863
|
+
"format": "uuid",
|
|
17864
|
+
"description": "Domain the route is scoped to; null = org-wide."
|
|
17865
|
+
},
|
|
17866
|
+
"match_type": {
|
|
17867
|
+
"type": "string",
|
|
17868
|
+
"enum": [
|
|
17869
|
+
"exact",
|
|
17870
|
+
"wildcard",
|
|
17871
|
+
"regex"
|
|
17872
|
+
]
|
|
17873
|
+
},
|
|
17874
|
+
"pattern": {
|
|
17875
|
+
"type": "string",
|
|
17876
|
+
"description": "The recipient address pattern (an exact address or a wildcard)."
|
|
17877
|
+
},
|
|
17878
|
+
"pattern_norm": {
|
|
17879
|
+
"type": ["string", "null"],
|
|
17880
|
+
"description": "Normalized pattern used for matching."
|
|
17881
|
+
},
|
|
17882
|
+
"endpoint_id": {
|
|
17883
|
+
"type": "string",
|
|
17884
|
+
"format": "uuid",
|
|
17885
|
+
"description": "The endpoint inbound mail matching this rule is delivered to."
|
|
17886
|
+
},
|
|
17887
|
+
"priority": {
|
|
17888
|
+
"type": "integer",
|
|
17889
|
+
"description": "Evaluation order within a scope; lower is checked first."
|
|
17890
|
+
},
|
|
17891
|
+
"enabled": { "type": "boolean" },
|
|
17892
|
+
"match_count": {
|
|
17893
|
+
"type": "string",
|
|
17894
|
+
"description": "How many emails have matched this rule (a bigint, returned as a string)."
|
|
17895
|
+
},
|
|
17896
|
+
"last_matched_at": {
|
|
17897
|
+
"type": ["string", "null"],
|
|
17898
|
+
"format": "date-time"
|
|
17899
|
+
},
|
|
17900
|
+
"created_at": {
|
|
17901
|
+
"type": "string",
|
|
17902
|
+
"format": "date-time"
|
|
17903
|
+
}
|
|
17904
|
+
},
|
|
16864
17905
|
"required": ["id"]
|
|
16865
17906
|
},
|
|
16866
|
-
"sdkName": "
|
|
16867
|
-
"summary": "Update a
|
|
16868
|
-
"tag": "
|
|
16869
|
-
"tagCommand": "
|
|
17907
|
+
"sdkName": "updateRoute",
|
|
17908
|
+
"summary": "Update a recipient route",
|
|
17909
|
+
"tag": "Routes",
|
|
17910
|
+
"tagCommand": "routes"
|
|
16870
17911
|
},
|
|
16871
17912
|
{
|
|
16872
17913
|
"binaryResponse": false,
|
|
@@ -22655,8 +23696,8 @@ const PRIMITIVE_TEAM_AUTHOR = {
|
|
|
22655
23696
|
name: "Primitive Team",
|
|
22656
23697
|
url: "https://primitive.dev"
|
|
22657
23698
|
};
|
|
22658
|
-
const SDK_VERSION_RANGE = "^1.
|
|
22659
|
-
const CLI_VERSION_RANGE = "^1.
|
|
23699
|
+
const SDK_VERSION_RANGE = "^1.12.0";
|
|
23700
|
+
const CLI_VERSION_RANGE = "^1.12.0";
|
|
22660
23701
|
const ESBUILD_VERSION_RANGE = "^0.27.0";
|
|
22661
23702
|
function renderHandler() {
|
|
22662
23703
|
return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
|
|
@@ -26720,6 +27761,22 @@ const X402_ERROR_HINTS = {
|
|
|
26720
27761
|
payment_verification_failed: "The signed payment did not match the challenge. Make sure you are paying with the wallet and network the challenge was issued for.",
|
|
26721
27762
|
ownership_proof_failed: "The signature did not prove control of the address. Make sure the wallet key matches the address you are registering."
|
|
26722
27763
|
};
|
|
27764
|
+
/**
|
|
27765
|
+
* Sign an email-native x402 challenge into a payment-step `interaction.json`
|
|
27766
|
+
* envelope, locally and with no network call. This is the exact signing path
|
|
27767
|
+
* shared by `payments pay-email-step` (sign only) and `payments pay-email`
|
|
27768
|
+
* (sign and send), so both produce byte-identical `interaction.json` bytes for
|
|
27769
|
+
* the same challenge + key. The EIP-3009 / nonce derivation lives in the SDK's
|
|
27770
|
+
* `payEmailChallenge`; this helper just wires the CLI's key handling to it.
|
|
27771
|
+
*/
|
|
27772
|
+
async function signEmailChallenge(params) {
|
|
27773
|
+
const client = createX402Client({
|
|
27774
|
+
apiKey: params.apiKey || void 0,
|
|
27775
|
+
baseUrl: x402BaseUrl(params.resolvedApiBaseUrl)
|
|
27776
|
+
});
|
|
27777
|
+
const signer = signerFromPrivateKey(params.privateKey);
|
|
27778
|
+
return client.payEmailChallenge(params.challenge, { signer });
|
|
27779
|
+
}
|
|
26723
27780
|
/** Turn a hex private key into a viem account (a valid X402Signer). */
|
|
26724
27781
|
function signerFromPrivateKey(rawKey) {
|
|
26725
27782
|
const trimmed = rawKey.trim();
|
|
@@ -27040,17 +28097,16 @@ var PaymentsPayEmailStepCommand = class PaymentsPayEmailStepCommand extends Comm
|
|
|
27040
28097
|
credentials: null
|
|
27041
28098
|
};
|
|
27042
28099
|
await runWithTiming(flags.time, async () => {
|
|
27043
|
-
const client = createX402Client({
|
|
27044
|
-
apiKey: flags["api-key"] || void 0,
|
|
27045
|
-
baseUrl: x402BaseUrl(requestConfig.resolvedApiBaseUrl)
|
|
27046
|
-
});
|
|
27047
28100
|
try {
|
|
27048
|
-
const
|
|
27049
|
-
|
|
27050
|
-
|
|
28101
|
+
const built = await signEmailChallenge({
|
|
28102
|
+
challenge: readEmailChallenge({
|
|
28103
|
+
inline: flags.challenge,
|
|
28104
|
+
file: flags["challenge-file"]
|
|
28105
|
+
}),
|
|
28106
|
+
privateKey: flags["private-key"] ?? "",
|
|
28107
|
+
resolvedApiBaseUrl: requestConfig.resolvedApiBaseUrl,
|
|
28108
|
+
apiKey: flags["api-key"]
|
|
27051
28109
|
});
|
|
27052
|
-
const signer = signerFromPrivateKey(flags["private-key"] ?? "");
|
|
27053
|
-
const built = await client.payEmailChallenge(challenge, { signer });
|
|
27054
28110
|
if (flags.json) this.log(JSON.stringify(built.envelope, null, 2));
|
|
27055
28111
|
else this.log(built.json);
|
|
27056
28112
|
} catch (error) {
|
|
@@ -27065,6 +28121,136 @@ var PaymentsPayEmailStepCommand = class PaymentsPayEmailStepCommand extends Comm
|
|
|
27065
28121
|
}
|
|
27066
28122
|
};
|
|
27067
28123
|
//#endregion
|
|
28124
|
+
//#region src/oclif/commands/payments-pay-email.ts
|
|
28125
|
+
/** The exact part name + content type the inbound matcher requires. */
|
|
28126
|
+
const INTERACTION_PART_FILENAME = "interaction.json";
|
|
28127
|
+
const INTERACTION_PART_CONTENT_TYPE = "application/json";
|
|
28128
|
+
/** Build the `interaction.json` attachment from a signed payment step. */
|
|
28129
|
+
function interactionAttachment(built) {
|
|
28130
|
+
return {
|
|
28131
|
+
filename: INTERACTION_PART_FILENAME,
|
|
28132
|
+
content_type: INTERACTION_PART_CONTENT_TYPE,
|
|
28133
|
+
content_base64: Buffer.from(built.json, "utf8").toString("base64")
|
|
28134
|
+
};
|
|
28135
|
+
}
|
|
28136
|
+
var PaymentsPayEmailCommand = class PaymentsPayEmailCommand extends Command {
|
|
28137
|
+
static description = `Pay an email-native x402 challenge in one step: sign it and send the signed interaction.json as an in-thread reply.
|
|
28138
|
+
|
|
28139
|
+
Reads the email challenge the payee issued (the JSON from
|
|
28140
|
+
\`payments create-email-challenge\`), derives and signs the interaction-bound
|
|
28141
|
+
EIP-3009 authorization locally with your wallet key (read from
|
|
28142
|
+
${PRIVATE_KEY_ENV} by default), and replies in-thread to the challenge email
|
|
28143
|
+
with the signed \`interaction.json\` attached as an \`application/json\` part.
|
|
28144
|
+
The key never leaves your machine.
|
|
28145
|
+
|
|
28146
|
+
This is the recommended payer path. It replaces the two-step
|
|
28147
|
+
\`pay-email-step\` + \`reply --attachment interaction.json\` dance: no manual
|
|
28148
|
+
address or threading wrangling. Use \`pay-email-step\` only when you need the
|
|
28149
|
+
signed bytes as a portable artifact without sending.
|
|
28150
|
+
|
|
28151
|
+
--in-reply-to is the id of the inbound challenge email you received; the reply
|
|
28152
|
+
endpoint derives the recipient (the payee) and threading headers from it, and
|
|
28153
|
+
defaults the From to the inbound's recipient (you, the payer). Pass --from
|
|
28154
|
+
only to override that default.
|
|
28155
|
+
|
|
28156
|
+
Provide the challenge inline with --challenge, from a file with
|
|
28157
|
+
--challenge-file, or piped on stdin.`;
|
|
28158
|
+
static summary = "Sign an email x402 challenge and send it as an in-thread reply (one step)";
|
|
28159
|
+
static examples = [
|
|
28160
|
+
"<%= config.bin %> payments pay-email --challenge-file challenge.json --in-reply-to <inbound-email-id>",
|
|
28161
|
+
"cat challenge.json | <%= config.bin %> payments pay-email --in-reply-to <inbound-email-id> --wait",
|
|
28162
|
+
"<%= config.bin %> payments pay-email --challenge-file challenge.json --in-reply-to <inbound-email-id> --from 'Payer <payer@your-domain.example>'"
|
|
28163
|
+
];
|
|
28164
|
+
static flags = {
|
|
28165
|
+
"api-key": Flags.string({
|
|
28166
|
+
description: "Primitive API key override (defaults to PRIMITIVE_API_KEY or saved OAuth login credentials)",
|
|
28167
|
+
env: "PRIMITIVE_API_KEY"
|
|
28168
|
+
}),
|
|
28169
|
+
"api-base-url": Flags.string({
|
|
28170
|
+
description: API_BASE_URL_FLAG_DESCRIPTION,
|
|
28171
|
+
env: "PRIMITIVE_API_BASE_URL",
|
|
28172
|
+
hidden: true
|
|
28173
|
+
}),
|
|
28174
|
+
"private-key": Flags.string({
|
|
28175
|
+
description: PRIVATE_KEY_FLAG_DESCRIPTION,
|
|
28176
|
+
env: PRIVATE_KEY_ENV
|
|
28177
|
+
}),
|
|
28178
|
+
challenge: Flags.string({
|
|
28179
|
+
description: "The email challenge object as a JSON string.",
|
|
28180
|
+
exclusive: ["challenge-file"]
|
|
28181
|
+
}),
|
|
28182
|
+
"challenge-file": Flags.string({
|
|
28183
|
+
description: "Path to a file containing the email challenge JSON.",
|
|
28184
|
+
exclusive: ["challenge"]
|
|
28185
|
+
}),
|
|
28186
|
+
"in-reply-to": Flags.string({
|
|
28187
|
+
description: "Id of the inbound challenge email you received. The reply is threaded to it and addressed to the payee derived from it.",
|
|
28188
|
+
required: true
|
|
28189
|
+
}),
|
|
28190
|
+
from: Flags.string({ description: "Optional From header override. Defaults to the inbound's recipient (the payer the challenge was addressed to)." }),
|
|
28191
|
+
wait: Flags.boolean({ description: "Block until the receiving MTA returns an outcome. Without --wait, the call returns once Primitive has accepted the reply for delivery." }),
|
|
28192
|
+
json: Flags.boolean({ description: "Print a JSON object with the signed interaction step and the send result." }),
|
|
28193
|
+
time: Flags.boolean({ description: TIME_FLAG_DESCRIPTION })
|
|
28194
|
+
};
|
|
28195
|
+
async run() {
|
|
28196
|
+
const { flags } = await this.parse(PaymentsPayEmailCommand);
|
|
28197
|
+
const { apiClient, auth, baseUrlOverridden } = await createAuthenticatedCliApiClient({
|
|
28198
|
+
apiKey: flags["api-key"],
|
|
28199
|
+
apiBaseUrl: flags["api-base-url"],
|
|
28200
|
+
configDir: this.config.configDir
|
|
28201
|
+
});
|
|
28202
|
+
const authFailureContext = {
|
|
28203
|
+
auth,
|
|
28204
|
+
baseUrlOverridden,
|
|
28205
|
+
configDir: this.config.configDir
|
|
28206
|
+
};
|
|
28207
|
+
await runWithTiming(flags.time, async () => {
|
|
28208
|
+
let built;
|
|
28209
|
+
try {
|
|
28210
|
+
built = await signEmailChallenge({
|
|
28211
|
+
challenge: readEmailChallenge({
|
|
28212
|
+
inline: flags.challenge,
|
|
28213
|
+
file: flags["challenge-file"]
|
|
28214
|
+
}),
|
|
28215
|
+
privateKey: flags["private-key"] ?? "",
|
|
28216
|
+
resolvedApiBaseUrl: auth.apiBaseUrl,
|
|
28217
|
+
apiKey: flags["api-key"]
|
|
28218
|
+
});
|
|
28219
|
+
} catch (error) {
|
|
28220
|
+
reportX402Error(error, authFailureContext);
|
|
28221
|
+
process.exitCode = 1;
|
|
28222
|
+
return;
|
|
28223
|
+
}
|
|
28224
|
+
const result = await replyToEmail({
|
|
28225
|
+
body: {
|
|
28226
|
+
attachments: [interactionAttachment(built)],
|
|
28227
|
+
...flags.from !== void 0 ? { from: flags.from } : {},
|
|
28228
|
+
...flags.wait !== void 0 ? { wait: flags.wait } : {}
|
|
28229
|
+
},
|
|
28230
|
+
client: apiClient.client,
|
|
28231
|
+
path: { id: flags["in-reply-to"] },
|
|
28232
|
+
responseStyle: "fields"
|
|
28233
|
+
});
|
|
28234
|
+
if (result.error) {
|
|
28235
|
+
const errorPayload = extractErrorPayload(result.error);
|
|
28236
|
+
writeErrorWithHints(errorPayload);
|
|
28237
|
+
surfaceUnauthorizedHint({
|
|
28238
|
+
...authFailureContext,
|
|
28239
|
+
payload: errorPayload
|
|
28240
|
+
});
|
|
28241
|
+
process.exitCode = 1;
|
|
28242
|
+
return;
|
|
28243
|
+
}
|
|
28244
|
+
const sent = result.data?.data ?? null;
|
|
28245
|
+
if (flags.json) this.log(JSON.stringify({
|
|
28246
|
+
interaction: built.envelope,
|
|
28247
|
+
sent
|
|
28248
|
+
}, null, 2));
|
|
28249
|
+
else this.log(JSON.stringify(sent, null, 2));
|
|
28250
|
+
});
|
|
28251
|
+
}
|
|
28252
|
+
};
|
|
28253
|
+
//#endregion
|
|
27068
28254
|
//#region src/oclif/commands/payments-register-payout-address.ts
|
|
27069
28255
|
var PaymentsRegisterPayoutAddressCommand = class PaymentsRegisterPayoutAddressCommand extends Command {
|
|
27070
28256
|
static description = `Register the default payout address your org receives x402 payments at.
|
|
@@ -28677,6 +29863,7 @@ const COMMANDS = {
|
|
|
28677
29863
|
"payments:charge": PaymentsChargeCommand,
|
|
28678
29864
|
"payments:pay-challenge": PaymentsPayCommand,
|
|
28679
29865
|
"payments:pay": PaymentsPayCommand,
|
|
29866
|
+
"payments:pay-email": PaymentsPayEmailCommand,
|
|
28680
29867
|
"payments:pay-email-step": PaymentsPayEmailStepCommand
|
|
28681
29868
|
};
|
|
28682
29869
|
//#endregion
|