@primitivedotdev/sdk 0.27.1 → 0.29.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/dist/api/index.d.ts +4 -4
- package/dist/api/index.js +3 -3
- package/dist/{api-CZIBnM4Q.js → api-DtnAfZka.js} +78 -8
- package/dist/contract/index.d.ts +8 -2
- package/dist/contract/index.js +7 -2
- package/dist/{errors-T_0JE528.d.ts → errors-CO-rv_nK.d.ts} +1 -1
- package/dist/{index-9Rqocr-c.d.ts → index-BUQQvkI3.d.ts} +385 -22
- package/dist/{index-EQZK4vWT.d.ts → index-D_v8-0zX.d.ts} +19 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/openapi/index.js +1 -1
- package/dist/{operations.generated-T3exFpgJ.js → operations.generated-B3sb0jWW.js} +1325 -48
- package/dist/parser/index.d.ts +2 -1
- package/dist/parser/index.js +2 -0
- package/dist/{types-Nslo1CU0.d.ts → types-BRWDMD7H.d.ts} +8 -0
- package/dist/webhook/index.d.ts +3 -3
- package/dist/webhook/index.js +1 -1
- package/dist/{webhook-Bra-g1q8.js → webhook-D4FTpj38.js} +643 -460
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ const openapiDocument = {
|
|
|
10
10
|
"info": {
|
|
11
11
|
"title": "Primitive API",
|
|
12
12
|
"version": "1.0.0",
|
|
13
|
-
"description": "The Primitive API lets you manage domains, emails, webhook endpoints,\nfilters, and account settings programmatically.\n\n## Authentication\n\
|
|
13
|
+
"description": "The Primitive API lets you manage domains, emails, webhook endpoints,\nfilters, and account settings programmatically.\n\n## Authentication\n\nMost endpoints require a Bearer token in the `Authorization` header:\n\n```\nAuthorization: Bearer prim_<your_api_key>\n```\n\nAPI keys are org-scoped. Create and manage them in your dashboard\nunder Settings > API Keys. CLI login and signup endpoints explicitly\ndeclare `security: []`; they do not require an API key because they\nare used to mint one.\n\n## Rate Limiting\n\nThe API enforces a sliding window rate limit of **120 requests per\n60 seconds** per organization. When exceeded, the API returns `429`\nwith a `Retry-After` header indicating how many seconds to wait.\n\n## Pagination\n\nList endpoints use cursor-based pagination. Responses include a\n`meta` object with `total`, `limit`, and `cursor` fields. Pass the\n`cursor` value as a query parameter to fetch the next page. When\n`cursor` is `null`, there are no more results.\n\n## Response Format\n\nAll responses use a consistent envelope:\n\n```json\n{\n \"success\": true,\n \"data\": { ... },\n \"meta\": { \"total\": 42, \"limit\": 50, \"cursor\": \"...\" }\n}\n```\n\nErrors follow the same pattern:\n\n```json\n{\n \"success\": false,\n \"error\": { \"code\": \"not_found\", \"message\": \"Email not found\" }\n}\n```\n\n## Webhook signing\n\nOutbound webhook deliveries (configured via the `endpoints` API)\nare signed so receivers can verify they came from Primitive and\nhave not been tampered with in transit. The signing scheme is\ndeliberately simple so it can be reimplemented in any language\nin a few lines. The Node SDK's `verifyWebhookSignature` helper\nis the reference implementation; the wire details below let you\nwrite a verifier in Python, Go, Ruby, etc. without reading our\nsource.\n\n**Header**: `Primitive-Signature: t=<unix-seconds>,v1=<hex>`\n\nA legacy `MyMX-Signature` header is also sent on every delivery\nwith the same value, retained for back-compatibility with\nintegrations written before the rename. New code should read\n`Primitive-Signature`.\n\n**Signed string**: `${timestamp}.${rawBody}` where `timestamp`\nis the Unix-seconds integer from the `t=` parameter and\n`rawBody` is the exact bytes of the HTTP request body BEFORE\nany JSON decoding. Verify against the raw body, not a\nre-serialized parse, or you will silently mismatch on\ninsignificant whitespace.\n\n**Signature**: HMAC-SHA256 of the signed string, hex-encoded\n(lowercase). Use the account's webhook secret as the HMAC key,\nas a UTF-8 byte sequence.\n\n**Secret**: returned by `GET /account/webhook-secret`. The\nstring looks base64-shaped (e.g. `XNHBBW8VqoBjRfNs1tkZj11jTk...`)\nbut is NOT base64; use it AS-IS as a UTF-8 string for the HMAC\nkey. Base64-decoding before HMAC will silently produce\nmismatched signatures.\n\n**Tolerance**: by convention, reject deliveries whose `t=`\ntimestamp is more than 5 minutes off your wall-clock to defend\nagainst replay attacks. The Node SDK's helper enforces this by\ndefault.\n\n**Verification recipe** (any language):\n\n```\n1. Read the raw HTTP body (do not parse).\n2. Read `Primitive-Signature: t=<ts>,v1=<sig>`.\n3. Reject if abs(now - ts) > 300 seconds.\n4. expected = HMAC_SHA256_hex(secret_utf8, f\"{ts}.{rawBody}\")\n5. Constant-time compare expected to sig. Reject if not equal.\n```\n\nFor Node, use `verifyWebhookSignature` from\n`@primitivedotdev/sdk/webhook` (or the higher-level\n`handleWebhook` helper if you want a one-liner). For other\nlanguages, the recipe above is everything you need.\n\nTest deliveries: `POST /endpoints/{id}/test` triggers a fake\ndelivery to your endpoint URL, signed with your real account\nsecret, so you can confirm verification end-to-end without\nneeding real inbound mail. The test response carries the exact\n`signature` header value sent on the wire so you can compare\nstrings directly.\n",
|
|
14
14
|
"contact": {
|
|
15
15
|
"name": "Primitive",
|
|
16
16
|
"url": "https://primitive.dev"
|
|
@@ -182,6 +182,97 @@ const openapiDocument = {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
} },
|
|
185
|
+
"/cli/signup/start": { "post": {
|
|
186
|
+
"operationId": "startCliSignup",
|
|
187
|
+
"summary": "Start CLI account signup",
|
|
188
|
+
"description": "Starts a terminal-native CLI signup. The API validates the signup code,\ncreates a pending signup session, sends an email verification code, and\nreturns an opaque signup token used by the resend and verify steps. This\nendpoint does not require an API key.\n",
|
|
189
|
+
"tags": ["CLI"],
|
|
190
|
+
"security": [],
|
|
191
|
+
"requestBody": {
|
|
192
|
+
"required": true,
|
|
193
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/StartCliSignupInput" } } }
|
|
194
|
+
},
|
|
195
|
+
"responses": {
|
|
196
|
+
"201": {
|
|
197
|
+
"description": "CLI signup session created and verification email sent",
|
|
198
|
+
"headers": { "Cache-Control": {
|
|
199
|
+
"schema": { "type": "string" },
|
|
200
|
+
"description": "Always `no-store`"
|
|
201
|
+
} },
|
|
202
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
203
|
+
"type": "object",
|
|
204
|
+
"properties": { "data": { "$ref": "#/components/schemas/CliSignupStartResult" } }
|
|
205
|
+
}] } } }
|
|
206
|
+
},
|
|
207
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
208
|
+
"429": { "$ref": "#/components/responses/RateLimited" }
|
|
209
|
+
}
|
|
210
|
+
} },
|
|
211
|
+
"/cli/signup/resend": { "post": {
|
|
212
|
+
"operationId": "resendCliSignupVerification",
|
|
213
|
+
"summary": "Resend CLI signup verification code",
|
|
214
|
+
"description": "Sends a new email verification code for a pending CLI signup session.\nThis endpoint does not require an API key.\n",
|
|
215
|
+
"tags": ["CLI"],
|
|
216
|
+
"security": [],
|
|
217
|
+
"requestBody": {
|
|
218
|
+
"required": true,
|
|
219
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResendCliSignupVerificationInput" } } }
|
|
220
|
+
},
|
|
221
|
+
"responses": {
|
|
222
|
+
"200": {
|
|
223
|
+
"description": "Verification email resent",
|
|
224
|
+
"headers": { "Cache-Control": {
|
|
225
|
+
"schema": { "type": "string" },
|
|
226
|
+
"description": "Always `no-store`"
|
|
227
|
+
} },
|
|
228
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
229
|
+
"type": "object",
|
|
230
|
+
"properties": { "data": { "$ref": "#/components/schemas/CliSignupResendResult" } }
|
|
231
|
+
}] } } }
|
|
232
|
+
},
|
|
233
|
+
"400": {
|
|
234
|
+
"description": "Invalid token or expired token",
|
|
235
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
236
|
+
},
|
|
237
|
+
"429": {
|
|
238
|
+
"description": "Global rate limit exceeded or resend requested too quickly",
|
|
239
|
+
"headers": { "Retry-After": {
|
|
240
|
+
"schema": { "type": "integer" },
|
|
241
|
+
"description": "Seconds to wait before retrying"
|
|
242
|
+
} },
|
|
243
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
} },
|
|
247
|
+
"/cli/signup/verify": { "post": {
|
|
248
|
+
"operationId": "verifyCliSignup",
|
|
249
|
+
"summary": "Verify CLI signup and create API key",
|
|
250
|
+
"description": "Verifies the email code for a CLI signup session, creates the account,\nredeems the reserved signup code, mints an org-scoped CLI API key, and\nreturns the raw key exactly once. This endpoint does not require an API key.\n",
|
|
251
|
+
"tags": ["CLI"],
|
|
252
|
+
"security": [],
|
|
253
|
+
"requestBody": {
|
|
254
|
+
"required": true,
|
|
255
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/VerifyCliSignupInput" } } }
|
|
256
|
+
},
|
|
257
|
+
"responses": {
|
|
258
|
+
"200": {
|
|
259
|
+
"description": "CLI signup verified and API key created",
|
|
260
|
+
"headers": { "Cache-Control": {
|
|
261
|
+
"schema": { "type": "string" },
|
|
262
|
+
"description": "Always `no-store`"
|
|
263
|
+
} },
|
|
264
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
265
|
+
"type": "object",
|
|
266
|
+
"properties": { "data": { "$ref": "#/components/schemas/CliSignupVerifyResult" } }
|
|
267
|
+
}] } } }
|
|
268
|
+
},
|
|
269
|
+
"400": {
|
|
270
|
+
"description": "Invalid request, invalid verification code, expired token, invalid signup code, rejected password, or account creation failure",
|
|
271
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
272
|
+
},
|
|
273
|
+
"429": { "$ref": "#/components/responses/RateLimited" }
|
|
274
|
+
}
|
|
275
|
+
} },
|
|
185
276
|
"/cli/logout": { "post": {
|
|
186
277
|
"operationId": "cliLogout",
|
|
187
278
|
"summary": "Revoke the current CLI API key",
|
|
@@ -1322,7 +1413,7 @@ const openapiDocument = {
|
|
|
1322
1413
|
"post": {
|
|
1323
1414
|
"operationId": "createFunction",
|
|
1324
1415
|
"summary": "Deploy a function",
|
|
1325
|
-
"description": "Creates and deploys a new function. The handler must be a single\nESM module whose default export is an object with an async\n`fetch(request, env)` method (Workers-style). The gateway\nHMAC-verifies the POST against the org's webhook secret before\ninvoking the handler; the request body parses to an\n`email.received` event (see `EmailReceivedEvent` and the\nWebhook payload section for the full schema). Code is bundled\nbefore being uploaded; ship a single self-contained file rather\nthan relying on external imports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8
|
|
1416
|
+
"description": "Creates and deploys a new function. The handler must be a single\nESM module whose default export is an object with an async\n`fetch(request, env)` method (Workers-style). The gateway\nHMAC-verifies the POST against the org's webhook secret before\ninvoking the handler; the request body parses to an\n`email.received` event (see `EmailReceivedEvent` and the\nWebhook payload section for the full schema). Code is bundled\nbefore being uploaded; ship a single self-contained file rather\nthan relying on external imports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8, stored with each deployment\nattempt, and sent to the runtime so stack traces can resolve to\noriginal source files.\n\n**Auto-wiring.** On successful deploy, Primitive automatically\ncreates a webhook endpoint that delivers inbound mail to the\nfunction. There is nothing to configure on the Endpoints API\nfor this to work; the gateway URL returned here is for\nreference only and is not directly callable from outside.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already\nbound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n",
|
|
1326
1417
|
"tags": ["Functions"],
|
|
1327
1418
|
"requestBody": {
|
|
1328
1419
|
"required": true,
|
|
@@ -1336,13 +1427,18 @@ const openapiDocument = {
|
|
|
1336
1427
|
"properties": { "data": { "$ref": "#/components/schemas/CreateFunctionResult" } }
|
|
1337
1428
|
}] } } }
|
|
1338
1429
|
},
|
|
1339
|
-
"400": {
|
|
1430
|
+
"400": {
|
|
1431
|
+
"description": "Invalid request parameters or customer-correctable deploy rejection",
|
|
1432
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
1433
|
+
},
|
|
1340
1434
|
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
1341
1435
|
"409": {
|
|
1342
1436
|
"description": "A function with this name already exists in the org",
|
|
1343
1437
|
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
1344
1438
|
},
|
|
1345
|
-
"
|
|
1439
|
+
"424": { "$ref": "#/components/responses/DeployFailed" },
|
|
1440
|
+
"429": { "$ref": "#/components/responses/DeployFailed" },
|
|
1441
|
+
"503": { "$ref": "#/components/responses/DeployFailed" }
|
|
1346
1442
|
}
|
|
1347
1443
|
}
|
|
1348
1444
|
},
|
|
@@ -1368,7 +1464,7 @@ const openapiDocument = {
|
|
|
1368
1464
|
"put": {
|
|
1369
1465
|
"operationId": "updateFunction",
|
|
1370
1466
|
"summary": "Update and redeploy a function",
|
|
1371
|
-
"description": "Replaces the function's source code with the body's `code` and\ntriggers a redeploy. Same size limits as `POST /functions`.\nUse this verb to push secret writes into the running handler:\npassing the same `code` re-runs the deploy and refreshes the\nbinding set with the latest values from the secrets table.\n\nOn
|
|
1467
|
+
"description": "Replaces the function's source code with the body's `code` and\ntriggers a redeploy. Same size limits as `POST /functions`.\nUse this verb to push secret writes into the running handler:\npassing the same `code` re-runs the deploy and refreshes the\nbinding set with the latest values from the secrets table.\n\nOn deploy failure, the previously-deployed code stays live; the\nruntime never serves a half-built bundle. The response uses\n`error.code` `deploy_failed`, and the function's `deploy_error`\nfield carries the latest deploy error for dashboard/API reads.\n",
|
|
1372
1468
|
"tags": ["Functions"],
|
|
1373
1469
|
"requestBody": {
|
|
1374
1470
|
"required": true,
|
|
@@ -1382,10 +1478,15 @@ const openapiDocument = {
|
|
|
1382
1478
|
"properties": { "data": { "$ref": "#/components/schemas/FunctionDetail" } }
|
|
1383
1479
|
}] } } }
|
|
1384
1480
|
},
|
|
1385
|
-
"400": {
|
|
1481
|
+
"400": {
|
|
1482
|
+
"description": "Invalid request parameters or customer-correctable deploy rejection",
|
|
1483
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
1484
|
+
},
|
|
1386
1485
|
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
1387
1486
|
"404": { "$ref": "#/components/responses/NotFound" },
|
|
1388
|
-
"
|
|
1487
|
+
"424": { "$ref": "#/components/responses/DeployFailed" },
|
|
1488
|
+
"429": { "$ref": "#/components/responses/DeployFailed" },
|
|
1489
|
+
"503": { "$ref": "#/components/responses/DeployFailed" }
|
|
1389
1490
|
}
|
|
1390
1491
|
},
|
|
1391
1492
|
"delete": {
|
|
@@ -1445,6 +1546,37 @@ const openapiDocument = {
|
|
|
1445
1546
|
}
|
|
1446
1547
|
}
|
|
1447
1548
|
},
|
|
1549
|
+
"/functions/{id}/test-runs/{run_id}/trace": {
|
|
1550
|
+
"parameters": [{ "$ref": "#/components/parameters/ResourceId" }, {
|
|
1551
|
+
"name": "run_id",
|
|
1552
|
+
"in": "path",
|
|
1553
|
+
"required": true,
|
|
1554
|
+
"description": "Function test run id returned by POST /functions/{id}/test.",
|
|
1555
|
+
"schema": {
|
|
1556
|
+
"type": "string",
|
|
1557
|
+
"format": "uuid"
|
|
1558
|
+
}
|
|
1559
|
+
}],
|
|
1560
|
+
"get": {
|
|
1561
|
+
"operationId": "getFunctionTestRunTrace",
|
|
1562
|
+
"summary": "Get a function test run trace",
|
|
1563
|
+
"description": "Returns the current end-to-end trace for a function test run.\nThe trace is intentionally partial while the test is still in\nflight: callers can poll this endpoint and watch it fill in\nfrom send -> inbound -> webhook deliveries -> outbound\nrequests, logs, and replies.\n",
|
|
1564
|
+
"tags": ["Functions"],
|
|
1565
|
+
"responses": {
|
|
1566
|
+
"200": {
|
|
1567
|
+
"description": "Function test run trace",
|
|
1568
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
1569
|
+
"type": "object",
|
|
1570
|
+
"properties": { "data": { "$ref": "#/components/schemas/FunctionTestRunTrace" } }
|
|
1571
|
+
}] } } }
|
|
1572
|
+
},
|
|
1573
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
1574
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
1575
|
+
"403": { "$ref": "#/components/responses/Forbidden" },
|
|
1576
|
+
"404": { "$ref": "#/components/responses/NotFound" }
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
},
|
|
1448
1580
|
"/functions/{id}/secrets": {
|
|
1449
1581
|
"parameters": [{ "$ref": "#/components/parameters/ResourceId" }],
|
|
1450
1582
|
"get": {
|
|
@@ -1704,6 +1836,19 @@ const openapiDocument = {
|
|
|
1704
1836
|
}
|
|
1705
1837
|
} }
|
|
1706
1838
|
},
|
|
1839
|
+
"DeployFailed": {
|
|
1840
|
+
"description": "Function deploy could not be completed; previously deployed code remains live",
|
|
1841
|
+
"content": { "application/json": {
|
|
1842
|
+
"schema": { "$ref": "#/components/schemas/ErrorResponse" },
|
|
1843
|
+
"example": {
|
|
1844
|
+
"success": false,
|
|
1845
|
+
"error": {
|
|
1846
|
+
"code": "deploy_failed",
|
|
1847
|
+
"message": "Function deploy failed"
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
} }
|
|
1851
|
+
},
|
|
1707
1852
|
"RateLimited": {
|
|
1708
1853
|
"description": "Rate limit exceeded",
|
|
1709
1854
|
"headers": { "Retry-After": {
|
|
@@ -2063,6 +2208,162 @@ const openapiDocument = {
|
|
|
2063
2208
|
"org_name"
|
|
2064
2209
|
]
|
|
2065
2210
|
},
|
|
2211
|
+
"StartCliSignupInput": {
|
|
2212
|
+
"type": "object",
|
|
2213
|
+
"additionalProperties": false,
|
|
2214
|
+
"properties": {
|
|
2215
|
+
"email": {
|
|
2216
|
+
"type": "string",
|
|
2217
|
+
"format": "email",
|
|
2218
|
+
"maxLength": 254
|
|
2219
|
+
},
|
|
2220
|
+
"signup_code": {
|
|
2221
|
+
"type": "string",
|
|
2222
|
+
"minLength": 1,
|
|
2223
|
+
"maxLength": 128
|
|
2224
|
+
},
|
|
2225
|
+
"terms_accepted": {
|
|
2226
|
+
"type": "boolean",
|
|
2227
|
+
"const": true,
|
|
2228
|
+
"description": "Must be true to confirm acceptance of Primitive's Terms of Service and Privacy Policy"
|
|
2229
|
+
},
|
|
2230
|
+
"device_name": {
|
|
2231
|
+
"type": "string",
|
|
2232
|
+
"minLength": 1,
|
|
2233
|
+
"maxLength": 80,
|
|
2234
|
+
"description": "Human-readable device name used for the created CLI API key"
|
|
2235
|
+
},
|
|
2236
|
+
"metadata": {
|
|
2237
|
+
"type": "object",
|
|
2238
|
+
"additionalProperties": true,
|
|
2239
|
+
"description": "Optional client metadata stored with the signup session; serialized JSON must be 2048 bytes or fewer"
|
|
2240
|
+
}
|
|
2241
|
+
},
|
|
2242
|
+
"required": [
|
|
2243
|
+
"email",
|
|
2244
|
+
"signup_code",
|
|
2245
|
+
"terms_accepted"
|
|
2246
|
+
]
|
|
2247
|
+
},
|
|
2248
|
+
"CliSignupStartResult": {
|
|
2249
|
+
"type": "object",
|
|
2250
|
+
"properties": {
|
|
2251
|
+
"signup_token": {
|
|
2252
|
+
"type": "string",
|
|
2253
|
+
"description": "Opaque token used to verify or resend the pending CLI signup"
|
|
2254
|
+
},
|
|
2255
|
+
"email": {
|
|
2256
|
+
"type": "string",
|
|
2257
|
+
"format": "email"
|
|
2258
|
+
},
|
|
2259
|
+
"expires_in": {
|
|
2260
|
+
"type": "integer",
|
|
2261
|
+
"description": "Seconds until the pending signup expires"
|
|
2262
|
+
},
|
|
2263
|
+
"resend_after": {
|
|
2264
|
+
"type": "integer",
|
|
2265
|
+
"description": "Minimum seconds before requesting another verification email"
|
|
2266
|
+
},
|
|
2267
|
+
"verification_code_length": {
|
|
2268
|
+
"type": "integer",
|
|
2269
|
+
"description": "Number of digits in the emailed verification code"
|
|
2270
|
+
}
|
|
2271
|
+
},
|
|
2272
|
+
"required": [
|
|
2273
|
+
"signup_token",
|
|
2274
|
+
"email",
|
|
2275
|
+
"expires_in",
|
|
2276
|
+
"resend_after",
|
|
2277
|
+
"verification_code_length"
|
|
2278
|
+
]
|
|
2279
|
+
},
|
|
2280
|
+
"ResendCliSignupVerificationInput": {
|
|
2281
|
+
"type": "object",
|
|
2282
|
+
"additionalProperties": false,
|
|
2283
|
+
"properties": { "signup_token": {
|
|
2284
|
+
"type": "string",
|
|
2285
|
+
"minLength": 1
|
|
2286
|
+
} },
|
|
2287
|
+
"required": ["signup_token"]
|
|
2288
|
+
},
|
|
2289
|
+
"CliSignupResendResult": {
|
|
2290
|
+
"type": "object",
|
|
2291
|
+
"properties": {
|
|
2292
|
+
"email": {
|
|
2293
|
+
"type": "string",
|
|
2294
|
+
"format": "email"
|
|
2295
|
+
},
|
|
2296
|
+
"expires_in": {
|
|
2297
|
+
"type": "integer",
|
|
2298
|
+
"description": "Seconds until the pending signup expires"
|
|
2299
|
+
},
|
|
2300
|
+
"resend_after": {
|
|
2301
|
+
"type": "integer",
|
|
2302
|
+
"description": "Minimum seconds before requesting another verification email"
|
|
2303
|
+
},
|
|
2304
|
+
"verification_code_length": {
|
|
2305
|
+
"type": "integer",
|
|
2306
|
+
"description": "Number of digits in the emailed verification code"
|
|
2307
|
+
}
|
|
2308
|
+
},
|
|
2309
|
+
"required": [
|
|
2310
|
+
"email",
|
|
2311
|
+
"expires_in",
|
|
2312
|
+
"resend_after",
|
|
2313
|
+
"verification_code_length"
|
|
2314
|
+
]
|
|
2315
|
+
},
|
|
2316
|
+
"VerifyCliSignupInput": {
|
|
2317
|
+
"type": "object",
|
|
2318
|
+
"additionalProperties": false,
|
|
2319
|
+
"properties": {
|
|
2320
|
+
"signup_token": {
|
|
2321
|
+
"type": "string",
|
|
2322
|
+
"minLength": 1
|
|
2323
|
+
},
|
|
2324
|
+
"verification_code": {
|
|
2325
|
+
"type": "string",
|
|
2326
|
+
"minLength": 1,
|
|
2327
|
+
"maxLength": 32
|
|
2328
|
+
},
|
|
2329
|
+
"password": {
|
|
2330
|
+
"type": "string",
|
|
2331
|
+
"minLength": 1,
|
|
2332
|
+
"maxLength": 1024
|
|
2333
|
+
}
|
|
2334
|
+
},
|
|
2335
|
+
"required": [
|
|
2336
|
+
"signup_token",
|
|
2337
|
+
"verification_code",
|
|
2338
|
+
"password"
|
|
2339
|
+
]
|
|
2340
|
+
},
|
|
2341
|
+
"CliSignupVerifyResult": {
|
|
2342
|
+
"type": "object",
|
|
2343
|
+
"properties": {
|
|
2344
|
+
"api_key": {
|
|
2345
|
+
"type": "string",
|
|
2346
|
+
"description": "Newly-created API key for CLI authentication"
|
|
2347
|
+
},
|
|
2348
|
+
"key_id": {
|
|
2349
|
+
"type": "string",
|
|
2350
|
+
"format": "uuid"
|
|
2351
|
+
},
|
|
2352
|
+
"key_prefix": { "type": "string" },
|
|
2353
|
+
"org_id": {
|
|
2354
|
+
"type": "string",
|
|
2355
|
+
"format": "uuid"
|
|
2356
|
+
},
|
|
2357
|
+
"org_name": { "type": ["string", "null"] }
|
|
2358
|
+
},
|
|
2359
|
+
"required": [
|
|
2360
|
+
"api_key",
|
|
2361
|
+
"key_id",
|
|
2362
|
+
"key_prefix",
|
|
2363
|
+
"org_id",
|
|
2364
|
+
"org_name"
|
|
2365
|
+
]
|
|
2366
|
+
},
|
|
2066
2367
|
"CliLogoutInput": {
|
|
2067
2368
|
"type": "object",
|
|
2068
2369
|
"additionalProperties": false,
|
|
@@ -3529,7 +3830,7 @@ const openapiDocument = {
|
|
|
3529
3830
|
"type": "string",
|
|
3530
3831
|
"minLength": 1,
|
|
3531
3832
|
"maxLength": 5242880,
|
|
3532
|
-
"description": "Optional source map for the bundle. Up to 5 MiB UTF-8.\nStored
|
|
3833
|
+
"description": "Optional source map for the bundle. Up to 5 MiB UTF-8.\nStored with the deployment attempt and sent to the runtime\nto symbolicate stack traces in the function's logs.\n"
|
|
3533
3834
|
}
|
|
3534
3835
|
},
|
|
3535
3836
|
"required": ["name", "code"]
|
|
@@ -3576,8 +3877,13 @@ const openapiDocument = {
|
|
|
3576
3877
|
},
|
|
3577
3878
|
"TestInvocationResult": {
|
|
3578
3879
|
"type": "object",
|
|
3579
|
-
"description": "Metadata returned by POST /functions/{id}/test. The send is\nqueued;
|
|
3880
|
+
"description": "Metadata returned by POST /functions/{id}/test. The send is\nqueued; poll `trace_url` to watch the run progress through\nsend -> inbound -> webhook deliveries -> outbound requests,\nlogs, and replies.\n",
|
|
3580
3881
|
"properties": {
|
|
3882
|
+
"test_run_id": {
|
|
3883
|
+
"type": "string",
|
|
3884
|
+
"format": "uuid",
|
|
3885
|
+
"description": "Durable test run id used to fetch the run trace."
|
|
3886
|
+
},
|
|
3581
3887
|
"inbound_domain": {
|
|
3582
3888
|
"type": "string",
|
|
3583
3889
|
"description": "Verified inbound domain the test email was sent to."
|
|
@@ -3607,53 +3913,376 @@ const openapiDocument = {
|
|
|
3607
3913
|
"type": "string",
|
|
3608
3914
|
"format": "uri",
|
|
3609
3915
|
"description": "Function detail page where invocations show up live."
|
|
3916
|
+
},
|
|
3917
|
+
"trace_url": {
|
|
3918
|
+
"type": "string",
|
|
3919
|
+
"description": "Relative API URL for GET /functions/{id}/test-runs/{test_run_id}/trace."
|
|
3610
3920
|
}
|
|
3611
3921
|
},
|
|
3612
3922
|
"required": [
|
|
3923
|
+
"test_run_id",
|
|
3613
3924
|
"inbound_domain",
|
|
3614
3925
|
"to",
|
|
3615
3926
|
"from",
|
|
3616
3927
|
"send_id",
|
|
3617
3928
|
"subject",
|
|
3618
3929
|
"poll_since",
|
|
3619
|
-
"watch_url"
|
|
3930
|
+
"watch_url",
|
|
3931
|
+
"trace_url"
|
|
3620
3932
|
]
|
|
3621
3933
|
},
|
|
3622
|
-
"
|
|
3934
|
+
"FunctionTestRunState": {
|
|
3935
|
+
"type": "string",
|
|
3936
|
+
"description": "High-level state for a function test run trace:\n - `send_failed`: the initial test email send failed.\n - `waiting_for_send`: the test run was created but no send result has been recorded yet.\n - `waiting_for_inbound`: the test send was queued and the matching inbound email has not arrived yet.\n - `waiting_for_function`: the inbound email arrived and webhook/function processing is still in flight.\n - `completed`: the function webhook completed successfully.\n - `failed`: webhook delivery exhausted retries.\n",
|
|
3937
|
+
"enum": [
|
|
3938
|
+
"send_failed",
|
|
3939
|
+
"waiting_for_send",
|
|
3940
|
+
"waiting_for_inbound",
|
|
3941
|
+
"waiting_for_function",
|
|
3942
|
+
"completed",
|
|
3943
|
+
"failed"
|
|
3944
|
+
]
|
|
3945
|
+
},
|
|
3946
|
+
"FunctionTestRun": {
|
|
3623
3947
|
"type": "object",
|
|
3624
|
-
"description": "One row from GET /functions/{id}/logs. Represents a single\ncaptured log line emitted by the running handler (e.g. via\n`console.log` / `console.error`).\n",
|
|
3625
3948
|
"properties": {
|
|
3626
3949
|
"id": {
|
|
3627
3950
|
"type": "string",
|
|
3628
|
-
"format": "uuid"
|
|
3629
|
-
"description": "Unique log row id (stable across pages)."
|
|
3951
|
+
"format": "uuid"
|
|
3630
3952
|
},
|
|
3631
3953
|
"function_id": {
|
|
3632
3954
|
"type": "string",
|
|
3633
|
-
"format": "uuid"
|
|
3634
|
-
"description": "The function this log row belongs to."
|
|
3955
|
+
"format": "uuid"
|
|
3635
3956
|
},
|
|
3636
|
-
"
|
|
3957
|
+
"inbound_domain": { "type": "string" },
|
|
3958
|
+
"to": { "type": "string" },
|
|
3959
|
+
"from": { "type": "string" },
|
|
3960
|
+
"subject": { "type": "string" },
|
|
3961
|
+
"poll_since": {
|
|
3637
3962
|
"type": "string",
|
|
3638
|
-
"
|
|
3639
|
-
"debug",
|
|
3640
|
-
"log",
|
|
3641
|
-
"info",
|
|
3642
|
-
"warn",
|
|
3643
|
-
"error"
|
|
3644
|
-
],
|
|
3645
|
-
"description": "Severity. `log` is the runtime's default for unannotated\n`console.log` calls; the other levels match standard\n`console.*` methods.\n"
|
|
3963
|
+
"format": "date-time"
|
|
3646
3964
|
},
|
|
3647
|
-
"
|
|
3965
|
+
"created_at": {
|
|
3648
3966
|
"type": "string",
|
|
3649
|
-
"
|
|
3967
|
+
"format": "date-time"
|
|
3650
3968
|
},
|
|
3651
|
-
"
|
|
3652
|
-
"type": "string",
|
|
3653
|
-
"format": "date-time"
|
|
3654
|
-
"description": "When the handler emitted this line. Newest-first ordering\non this column drives pagination; clock is the runtime's,\nnot the gateway's.\n"
|
|
3969
|
+
"sent_at": {
|
|
3970
|
+
"type": ["string", "null"],
|
|
3971
|
+
"format": "date-time"
|
|
3655
3972
|
},
|
|
3656
|
-
"
|
|
3973
|
+
"send_error": { "type": ["string", "null"] }
|
|
3974
|
+
},
|
|
3975
|
+
"required": [
|
|
3976
|
+
"id",
|
|
3977
|
+
"function_id",
|
|
3978
|
+
"inbound_domain",
|
|
3979
|
+
"to",
|
|
3980
|
+
"from",
|
|
3981
|
+
"subject",
|
|
3982
|
+
"poll_since",
|
|
3983
|
+
"created_at",
|
|
3984
|
+
"sent_at",
|
|
3985
|
+
"send_error"
|
|
3986
|
+
]
|
|
3987
|
+
},
|
|
3988
|
+
"FunctionTestRunSend": {
|
|
3989
|
+
"type": ["object", "null"],
|
|
3990
|
+
"properties": {
|
|
3991
|
+
"id": {
|
|
3992
|
+
"type": "string",
|
|
3993
|
+
"format": "uuid"
|
|
3994
|
+
},
|
|
3995
|
+
"status": { "$ref": "#/components/schemas/SentEmailStatus" },
|
|
3996
|
+
"queue_id": { "type": ["string", "null"] },
|
|
3997
|
+
"created_at": {
|
|
3998
|
+
"type": "string",
|
|
3999
|
+
"format": "date-time"
|
|
4000
|
+
},
|
|
4001
|
+
"updated_at": {
|
|
4002
|
+
"type": "string",
|
|
4003
|
+
"format": "date-time"
|
|
4004
|
+
}
|
|
4005
|
+
},
|
|
4006
|
+
"required": [
|
|
4007
|
+
"id",
|
|
4008
|
+
"status",
|
|
4009
|
+
"queue_id",
|
|
4010
|
+
"created_at",
|
|
4011
|
+
"updated_at"
|
|
4012
|
+
]
|
|
4013
|
+
},
|
|
4014
|
+
"FunctionTestRunInboundEmail": {
|
|
4015
|
+
"type": ["object", "null"],
|
|
4016
|
+
"properties": {
|
|
4017
|
+
"id": {
|
|
4018
|
+
"type": "string",
|
|
4019
|
+
"format": "uuid"
|
|
4020
|
+
},
|
|
4021
|
+
"status": { "$ref": "#/components/schemas/EmailStatus" },
|
|
4022
|
+
"received_at": {
|
|
4023
|
+
"type": "string",
|
|
4024
|
+
"format": "date-time"
|
|
4025
|
+
},
|
|
4026
|
+
"from": { "type": "string" },
|
|
4027
|
+
"to": { "type": "string" },
|
|
4028
|
+
"subject": { "type": ["string", "null"] },
|
|
4029
|
+
"webhook_status": { "$ref": "#/components/schemas/EmailWebhookStatus" },
|
|
4030
|
+
"webhook_attempt_count": { "type": "integer" },
|
|
4031
|
+
"webhook_last_status_code": { "type": ["integer", "null"] },
|
|
4032
|
+
"webhook_last_error": { "type": ["string", "null"] }
|
|
4033
|
+
},
|
|
4034
|
+
"required": [
|
|
4035
|
+
"id",
|
|
4036
|
+
"status",
|
|
4037
|
+
"received_at",
|
|
4038
|
+
"from",
|
|
4039
|
+
"to",
|
|
4040
|
+
"subject",
|
|
4041
|
+
"webhook_status",
|
|
4042
|
+
"webhook_attempt_count",
|
|
4043
|
+
"webhook_last_status_code",
|
|
4044
|
+
"webhook_last_error"
|
|
4045
|
+
]
|
|
4046
|
+
},
|
|
4047
|
+
"FunctionTestRunDeliveryEndpoint": {
|
|
4048
|
+
"type": ["object", "null"],
|
|
4049
|
+
"properties": {
|
|
4050
|
+
"id": {
|
|
4051
|
+
"type": "string",
|
|
4052
|
+
"format": "uuid"
|
|
4053
|
+
},
|
|
4054
|
+
"kind": {
|
|
4055
|
+
"type": "string",
|
|
4056
|
+
"description": "Endpoint kind. Current traces may include `http` or `function`; future endpoint kinds may appear."
|
|
4057
|
+
},
|
|
4058
|
+
"function_id": {
|
|
4059
|
+
"type": ["string", "null"],
|
|
4060
|
+
"format": "uuid"
|
|
4061
|
+
},
|
|
4062
|
+
"function_name": { "type": ["string", "null"] },
|
|
4063
|
+
"domain_id": {
|
|
4064
|
+
"type": ["string", "null"],
|
|
4065
|
+
"format": "uuid"
|
|
4066
|
+
},
|
|
4067
|
+
"enabled": { "type": "boolean" },
|
|
4068
|
+
"deactivated_at": {
|
|
4069
|
+
"type": ["string", "null"],
|
|
4070
|
+
"format": "date-time"
|
|
4071
|
+
},
|
|
4072
|
+
"is_current_function": { "type": "boolean" }
|
|
4073
|
+
},
|
|
4074
|
+
"required": [
|
|
4075
|
+
"id",
|
|
4076
|
+
"kind",
|
|
4077
|
+
"function_id",
|
|
4078
|
+
"function_name",
|
|
4079
|
+
"domain_id",
|
|
4080
|
+
"enabled",
|
|
4081
|
+
"deactivated_at",
|
|
4082
|
+
"is_current_function"
|
|
4083
|
+
]
|
|
4084
|
+
},
|
|
4085
|
+
"FunctionTestRunDelivery": {
|
|
4086
|
+
"type": "object",
|
|
4087
|
+
"properties": {
|
|
4088
|
+
"id": {
|
|
4089
|
+
"type": "string",
|
|
4090
|
+
"description": "Webhook delivery id."
|
|
4091
|
+
},
|
|
4092
|
+
"endpoint_id": {
|
|
4093
|
+
"type": "string",
|
|
4094
|
+
"format": "uuid"
|
|
4095
|
+
},
|
|
4096
|
+
"endpoint_url": {
|
|
4097
|
+
"type": "string",
|
|
4098
|
+
"format": "uri"
|
|
4099
|
+
},
|
|
4100
|
+
"status": {
|
|
4101
|
+
"type": "string",
|
|
4102
|
+
"enum": [
|
|
4103
|
+
"pending",
|
|
4104
|
+
"delivered",
|
|
4105
|
+
"header_confirmed",
|
|
4106
|
+
"failed"
|
|
4107
|
+
]
|
|
4108
|
+
},
|
|
4109
|
+
"attempt_count": { "type": "integer" },
|
|
4110
|
+
"duration_ms": { "type": ["integer", "null"] },
|
|
4111
|
+
"last_error": { "type": ["string", "null"] },
|
|
4112
|
+
"last_error_code": { "type": ["string", "null"] },
|
|
4113
|
+
"created_at": {
|
|
4114
|
+
"type": "string",
|
|
4115
|
+
"format": "date-time"
|
|
4116
|
+
},
|
|
4117
|
+
"updated_at": {
|
|
4118
|
+
"type": "string",
|
|
4119
|
+
"format": "date-time"
|
|
4120
|
+
},
|
|
4121
|
+
"endpoint": { "$ref": "#/components/schemas/FunctionTestRunDeliveryEndpoint" }
|
|
4122
|
+
},
|
|
4123
|
+
"required": [
|
|
4124
|
+
"id",
|
|
4125
|
+
"endpoint_id",
|
|
4126
|
+
"endpoint_url",
|
|
4127
|
+
"status",
|
|
4128
|
+
"attempt_count",
|
|
4129
|
+
"duration_ms",
|
|
4130
|
+
"last_error",
|
|
4131
|
+
"last_error_code",
|
|
4132
|
+
"created_at",
|
|
4133
|
+
"updated_at",
|
|
4134
|
+
"endpoint"
|
|
4135
|
+
]
|
|
4136
|
+
},
|
|
4137
|
+
"FunctionTestRunOutboundRequest": {
|
|
4138
|
+
"type": "object",
|
|
4139
|
+
"properties": {
|
|
4140
|
+
"id": {
|
|
4141
|
+
"type": "string",
|
|
4142
|
+
"format": "uuid"
|
|
4143
|
+
},
|
|
4144
|
+
"function_id": {
|
|
4145
|
+
"type": "string",
|
|
4146
|
+
"format": "uuid"
|
|
4147
|
+
},
|
|
4148
|
+
"webhook_delivery_id": { "type": ["string", "null"] },
|
|
4149
|
+
"email_id": {
|
|
4150
|
+
"type": ["string", "null"],
|
|
4151
|
+
"format": "uuid"
|
|
4152
|
+
},
|
|
4153
|
+
"endpoint_id": {
|
|
4154
|
+
"type": ["string", "null"],
|
|
4155
|
+
"format": "uuid"
|
|
4156
|
+
},
|
|
4157
|
+
"method": { "type": "string" },
|
|
4158
|
+
"url": {
|
|
4159
|
+
"type": "string",
|
|
4160
|
+
"format": "uri"
|
|
4161
|
+
},
|
|
4162
|
+
"host": { "type": "string" },
|
|
4163
|
+
"path": { "type": "string" },
|
|
4164
|
+
"status_code": { "type": ["integer", "null"] },
|
|
4165
|
+
"ok": { "type": ["boolean", "null"] },
|
|
4166
|
+
"duration_ms": { "type": "integer" },
|
|
4167
|
+
"error": { "type": ["string", "null"] },
|
|
4168
|
+
"ts": {
|
|
4169
|
+
"type": "string",
|
|
4170
|
+
"format": "date-time"
|
|
4171
|
+
}
|
|
4172
|
+
},
|
|
4173
|
+
"required": [
|
|
4174
|
+
"id",
|
|
4175
|
+
"function_id",
|
|
4176
|
+
"webhook_delivery_id",
|
|
4177
|
+
"email_id",
|
|
4178
|
+
"endpoint_id",
|
|
4179
|
+
"method",
|
|
4180
|
+
"url",
|
|
4181
|
+
"host",
|
|
4182
|
+
"path",
|
|
4183
|
+
"status_code",
|
|
4184
|
+
"ok",
|
|
4185
|
+
"duration_ms",
|
|
4186
|
+
"error",
|
|
4187
|
+
"ts"
|
|
4188
|
+
]
|
|
4189
|
+
},
|
|
4190
|
+
"FunctionTestRunReply": {
|
|
4191
|
+
"type": "object",
|
|
4192
|
+
"properties": {
|
|
4193
|
+
"id": {
|
|
4194
|
+
"type": "string",
|
|
4195
|
+
"format": "uuid"
|
|
4196
|
+
},
|
|
4197
|
+
"status": { "$ref": "#/components/schemas/SentEmailStatus" },
|
|
4198
|
+
"to": { "type": "string" },
|
|
4199
|
+
"subject": { "type": "string" },
|
|
4200
|
+
"queue_id": { "type": ["string", "null"] },
|
|
4201
|
+
"created_at": {
|
|
4202
|
+
"type": "string",
|
|
4203
|
+
"format": "date-time"
|
|
4204
|
+
}
|
|
4205
|
+
},
|
|
4206
|
+
"required": [
|
|
4207
|
+
"id",
|
|
4208
|
+
"status",
|
|
4209
|
+
"to",
|
|
4210
|
+
"subject",
|
|
4211
|
+
"queue_id",
|
|
4212
|
+
"created_at"
|
|
4213
|
+
]
|
|
4214
|
+
},
|
|
4215
|
+
"FunctionTestRunTrace": {
|
|
4216
|
+
"type": "object",
|
|
4217
|
+
"description": "End-to-end trace for a `POST /functions/{id}/test` run. The\nshape is stable, but many nested sections are null or empty\nuntil the corresponding phase has happened.\n",
|
|
4218
|
+
"properties": {
|
|
4219
|
+
"state": { "$ref": "#/components/schemas/FunctionTestRunState" },
|
|
4220
|
+
"test_run": { "$ref": "#/components/schemas/FunctionTestRun" },
|
|
4221
|
+
"test_send": { "$ref": "#/components/schemas/FunctionTestRunSend" },
|
|
4222
|
+
"inbound_email": { "$ref": "#/components/schemas/FunctionTestRunInboundEmail" },
|
|
4223
|
+
"deliveries": {
|
|
4224
|
+
"type": "array",
|
|
4225
|
+
"items": { "$ref": "#/components/schemas/FunctionTestRunDelivery" }
|
|
4226
|
+
},
|
|
4227
|
+
"outbound_requests": {
|
|
4228
|
+
"type": "array",
|
|
4229
|
+
"items": { "$ref": "#/components/schemas/FunctionTestRunOutboundRequest" }
|
|
4230
|
+
},
|
|
4231
|
+
"logs": {
|
|
4232
|
+
"type": "array",
|
|
4233
|
+
"items": { "$ref": "#/components/schemas/FunctionLogRow" }
|
|
4234
|
+
},
|
|
4235
|
+
"replies": {
|
|
4236
|
+
"type": "array",
|
|
4237
|
+
"items": { "$ref": "#/components/schemas/FunctionTestRunReply" }
|
|
4238
|
+
}
|
|
4239
|
+
},
|
|
4240
|
+
"required": [
|
|
4241
|
+
"state",
|
|
4242
|
+
"test_run",
|
|
4243
|
+
"test_send",
|
|
4244
|
+
"inbound_email",
|
|
4245
|
+
"deliveries",
|
|
4246
|
+
"outbound_requests",
|
|
4247
|
+
"logs",
|
|
4248
|
+
"replies"
|
|
4249
|
+
]
|
|
4250
|
+
},
|
|
4251
|
+
"FunctionLogRow": {
|
|
4252
|
+
"type": "object",
|
|
4253
|
+
"description": "One row from GET /functions/{id}/logs. Represents a single\ncaptured log line emitted by the running handler (e.g. via\n`console.log` / `console.error`).\n",
|
|
4254
|
+
"properties": {
|
|
4255
|
+
"id": {
|
|
4256
|
+
"type": "string",
|
|
4257
|
+
"format": "uuid",
|
|
4258
|
+
"description": "Unique log row id (stable across pages)."
|
|
4259
|
+
},
|
|
4260
|
+
"function_id": {
|
|
4261
|
+
"type": "string",
|
|
4262
|
+
"format": "uuid",
|
|
4263
|
+
"description": "The function this log row belongs to."
|
|
4264
|
+
},
|
|
4265
|
+
"level": {
|
|
4266
|
+
"type": "string",
|
|
4267
|
+
"enum": [
|
|
4268
|
+
"debug",
|
|
4269
|
+
"log",
|
|
4270
|
+
"info",
|
|
4271
|
+
"warn",
|
|
4272
|
+
"error"
|
|
4273
|
+
],
|
|
4274
|
+
"description": "Severity. `log` is the runtime's default for unannotated\n`console.log` calls; the other levels match standard\n`console.*` methods.\n"
|
|
4275
|
+
},
|
|
4276
|
+
"message": {
|
|
4277
|
+
"type": "string",
|
|
4278
|
+
"description": "The textual message body. The runtime stringifies non-string\narguments before persisting, so this is always a plain\nstring.\n"
|
|
4279
|
+
},
|
|
4280
|
+
"ts": {
|
|
4281
|
+
"type": "string",
|
|
4282
|
+
"format": "date-time",
|
|
4283
|
+
"description": "When the handler emitted this line. Newest-first ordering\non this column drives pagination; clock is the runtime's,\nnot the gateway's.\n"
|
|
4284
|
+
},
|
|
4285
|
+
"metadata": {
|
|
3657
4286
|
"type": ["object", "null"],
|
|
3658
4287
|
"additionalProperties": true,
|
|
3659
4288
|
"description": "Optional structured payload the runtime attaches alongside\nthe message (e.g. extra args passed to `console.log`).\nShape is opaque; treat keys as untyped.\n"
|
|
@@ -4063,27 +4692,79 @@ const operationManifest = [
|
|
|
4063
4692
|
},
|
|
4064
4693
|
{
|
|
4065
4694
|
"binaryResponse": false,
|
|
4066
|
-
"bodyRequired":
|
|
4067
|
-
"command": "
|
|
4068
|
-
"description": "
|
|
4695
|
+
"bodyRequired": true,
|
|
4696
|
+
"command": "resend-cli-signup-verification",
|
|
4697
|
+
"description": "Sends a new email verification code for a pending CLI signup session.\nThis endpoint does not require an API key.\n",
|
|
4069
4698
|
"hasJsonBody": true,
|
|
4070
4699
|
"method": "POST",
|
|
4071
|
-
"operationId": "
|
|
4072
|
-
"path": "/cli/
|
|
4700
|
+
"operationId": "resendCliSignupVerification",
|
|
4701
|
+
"path": "/cli/signup/resend",
|
|
4073
4702
|
"pathParams": [],
|
|
4074
4703
|
"queryParams": [],
|
|
4075
4704
|
"requestSchema": {
|
|
4076
4705
|
"type": "object",
|
|
4077
4706
|
"additionalProperties": false,
|
|
4707
|
+
"properties": { "signup_token": {
|
|
4708
|
+
"type": "string",
|
|
4709
|
+
"minLength": 1
|
|
4710
|
+
} },
|
|
4711
|
+
"required": ["signup_token"]
|
|
4712
|
+
},
|
|
4713
|
+
"responseSchema": {
|
|
4714
|
+
"type": "object",
|
|
4078
4715
|
"properties": {
|
|
4079
|
-
"
|
|
4716
|
+
"email": {
|
|
4080
4717
|
"type": "string",
|
|
4081
|
-
"
|
|
4082
|
-
"maxLength": 80,
|
|
4083
|
-
"description": "Human-readable device name shown during browser approval"
|
|
4718
|
+
"format": "email"
|
|
4084
4719
|
},
|
|
4085
|
-
"
|
|
4086
|
-
"type": "
|
|
4720
|
+
"expires_in": {
|
|
4721
|
+
"type": "integer",
|
|
4722
|
+
"description": "Seconds until the pending signup expires"
|
|
4723
|
+
},
|
|
4724
|
+
"resend_after": {
|
|
4725
|
+
"type": "integer",
|
|
4726
|
+
"description": "Minimum seconds before requesting another verification email"
|
|
4727
|
+
},
|
|
4728
|
+
"verification_code_length": {
|
|
4729
|
+
"type": "integer",
|
|
4730
|
+
"description": "Number of digits in the emailed verification code"
|
|
4731
|
+
}
|
|
4732
|
+
},
|
|
4733
|
+
"required": [
|
|
4734
|
+
"email",
|
|
4735
|
+
"expires_in",
|
|
4736
|
+
"resend_after",
|
|
4737
|
+
"verification_code_length"
|
|
4738
|
+
]
|
|
4739
|
+
},
|
|
4740
|
+
"sdkName": "resendCliSignupVerification",
|
|
4741
|
+
"summary": "Resend CLI signup verification code",
|
|
4742
|
+
"tag": "CLI",
|
|
4743
|
+
"tagCommand": "cli"
|
|
4744
|
+
},
|
|
4745
|
+
{
|
|
4746
|
+
"binaryResponse": false,
|
|
4747
|
+
"bodyRequired": false,
|
|
4748
|
+
"command": "start-cli-login",
|
|
4749
|
+
"description": "Starts a browser-assisted CLI login session. The response includes a\ndevice code for polling and a user code that the user approves in the\nbrowser. This endpoint does not require an API key.\n",
|
|
4750
|
+
"hasJsonBody": true,
|
|
4751
|
+
"method": "POST",
|
|
4752
|
+
"operationId": "startCliLogin",
|
|
4753
|
+
"path": "/cli/login/start",
|
|
4754
|
+
"pathParams": [],
|
|
4755
|
+
"queryParams": [],
|
|
4756
|
+
"requestSchema": {
|
|
4757
|
+
"type": "object",
|
|
4758
|
+
"additionalProperties": false,
|
|
4759
|
+
"properties": {
|
|
4760
|
+
"device_name": {
|
|
4761
|
+
"type": "string",
|
|
4762
|
+
"minLength": 1,
|
|
4763
|
+
"maxLength": 80,
|
|
4764
|
+
"description": "Human-readable device name shown during browser approval"
|
|
4765
|
+
},
|
|
4766
|
+
"metadata": {
|
|
4767
|
+
"type": "object",
|
|
4087
4768
|
"additionalProperties": true,
|
|
4088
4769
|
"description": "Optional client metadata stored with the login session; serialized JSON must be 2048 bytes or fewer"
|
|
4089
4770
|
}
|
|
@@ -4132,6 +4813,158 @@ const operationManifest = [
|
|
|
4132
4813
|
"tag": "CLI",
|
|
4133
4814
|
"tagCommand": "cli"
|
|
4134
4815
|
},
|
|
4816
|
+
{
|
|
4817
|
+
"binaryResponse": false,
|
|
4818
|
+
"bodyRequired": true,
|
|
4819
|
+
"command": "start-cli-signup",
|
|
4820
|
+
"description": "Starts a terminal-native CLI signup. The API validates the signup code,\ncreates a pending signup session, sends an email verification code, and\nreturns an opaque signup token used by the resend and verify steps. This\nendpoint does not require an API key.\n",
|
|
4821
|
+
"hasJsonBody": true,
|
|
4822
|
+
"method": "POST",
|
|
4823
|
+
"operationId": "startCliSignup",
|
|
4824
|
+
"path": "/cli/signup/start",
|
|
4825
|
+
"pathParams": [],
|
|
4826
|
+
"queryParams": [],
|
|
4827
|
+
"requestSchema": {
|
|
4828
|
+
"type": "object",
|
|
4829
|
+
"additionalProperties": false,
|
|
4830
|
+
"properties": {
|
|
4831
|
+
"email": {
|
|
4832
|
+
"type": "string",
|
|
4833
|
+
"format": "email",
|
|
4834
|
+
"maxLength": 254
|
|
4835
|
+
},
|
|
4836
|
+
"signup_code": {
|
|
4837
|
+
"type": "string",
|
|
4838
|
+
"minLength": 1,
|
|
4839
|
+
"maxLength": 128
|
|
4840
|
+
},
|
|
4841
|
+
"terms_accepted": {
|
|
4842
|
+
"type": "boolean",
|
|
4843
|
+
"const": true,
|
|
4844
|
+
"description": "Must be true to confirm acceptance of Primitive's Terms of Service and Privacy Policy"
|
|
4845
|
+
},
|
|
4846
|
+
"device_name": {
|
|
4847
|
+
"type": "string",
|
|
4848
|
+
"minLength": 1,
|
|
4849
|
+
"maxLength": 80,
|
|
4850
|
+
"description": "Human-readable device name used for the created CLI API key"
|
|
4851
|
+
},
|
|
4852
|
+
"metadata": {
|
|
4853
|
+
"type": "object",
|
|
4854
|
+
"additionalProperties": true,
|
|
4855
|
+
"description": "Optional client metadata stored with the signup session; serialized JSON must be 2048 bytes or fewer"
|
|
4856
|
+
}
|
|
4857
|
+
},
|
|
4858
|
+
"required": [
|
|
4859
|
+
"email",
|
|
4860
|
+
"signup_code",
|
|
4861
|
+
"terms_accepted"
|
|
4862
|
+
]
|
|
4863
|
+
},
|
|
4864
|
+
"responseSchema": {
|
|
4865
|
+
"type": "object",
|
|
4866
|
+
"properties": {
|
|
4867
|
+
"signup_token": {
|
|
4868
|
+
"type": "string",
|
|
4869
|
+
"description": "Opaque token used to verify or resend the pending CLI signup"
|
|
4870
|
+
},
|
|
4871
|
+
"email": {
|
|
4872
|
+
"type": "string",
|
|
4873
|
+
"format": "email"
|
|
4874
|
+
},
|
|
4875
|
+
"expires_in": {
|
|
4876
|
+
"type": "integer",
|
|
4877
|
+
"description": "Seconds until the pending signup expires"
|
|
4878
|
+
},
|
|
4879
|
+
"resend_after": {
|
|
4880
|
+
"type": "integer",
|
|
4881
|
+
"description": "Minimum seconds before requesting another verification email"
|
|
4882
|
+
},
|
|
4883
|
+
"verification_code_length": {
|
|
4884
|
+
"type": "integer",
|
|
4885
|
+
"description": "Number of digits in the emailed verification code"
|
|
4886
|
+
}
|
|
4887
|
+
},
|
|
4888
|
+
"required": [
|
|
4889
|
+
"signup_token",
|
|
4890
|
+
"email",
|
|
4891
|
+
"expires_in",
|
|
4892
|
+
"resend_after",
|
|
4893
|
+
"verification_code_length"
|
|
4894
|
+
]
|
|
4895
|
+
},
|
|
4896
|
+
"sdkName": "startCliSignup",
|
|
4897
|
+
"summary": "Start CLI account signup",
|
|
4898
|
+
"tag": "CLI",
|
|
4899
|
+
"tagCommand": "cli"
|
|
4900
|
+
},
|
|
4901
|
+
{
|
|
4902
|
+
"binaryResponse": false,
|
|
4903
|
+
"bodyRequired": true,
|
|
4904
|
+
"command": "verify-cli-signup",
|
|
4905
|
+
"description": "Verifies the email code for a CLI signup session, creates the account,\nredeems the reserved signup code, mints an org-scoped CLI API key, and\nreturns the raw key exactly once. This endpoint does not require an API key.\n",
|
|
4906
|
+
"hasJsonBody": true,
|
|
4907
|
+
"method": "POST",
|
|
4908
|
+
"operationId": "verifyCliSignup",
|
|
4909
|
+
"path": "/cli/signup/verify",
|
|
4910
|
+
"pathParams": [],
|
|
4911
|
+
"queryParams": [],
|
|
4912
|
+
"requestSchema": {
|
|
4913
|
+
"type": "object",
|
|
4914
|
+
"additionalProperties": false,
|
|
4915
|
+
"properties": {
|
|
4916
|
+
"signup_token": {
|
|
4917
|
+
"type": "string",
|
|
4918
|
+
"minLength": 1
|
|
4919
|
+
},
|
|
4920
|
+
"verification_code": {
|
|
4921
|
+
"type": "string",
|
|
4922
|
+
"minLength": 1,
|
|
4923
|
+
"maxLength": 32
|
|
4924
|
+
},
|
|
4925
|
+
"password": {
|
|
4926
|
+
"type": "string",
|
|
4927
|
+
"minLength": 1,
|
|
4928
|
+
"maxLength": 1024
|
|
4929
|
+
}
|
|
4930
|
+
},
|
|
4931
|
+
"required": [
|
|
4932
|
+
"signup_token",
|
|
4933
|
+
"verification_code",
|
|
4934
|
+
"password"
|
|
4935
|
+
]
|
|
4936
|
+
},
|
|
4937
|
+
"responseSchema": {
|
|
4938
|
+
"type": "object",
|
|
4939
|
+
"properties": {
|
|
4940
|
+
"api_key": {
|
|
4941
|
+
"type": "string",
|
|
4942
|
+
"description": "Newly-created API key for CLI authentication"
|
|
4943
|
+
},
|
|
4944
|
+
"key_id": {
|
|
4945
|
+
"type": "string",
|
|
4946
|
+
"format": "uuid"
|
|
4947
|
+
},
|
|
4948
|
+
"key_prefix": { "type": "string" },
|
|
4949
|
+
"org_id": {
|
|
4950
|
+
"type": "string",
|
|
4951
|
+
"format": "uuid"
|
|
4952
|
+
},
|
|
4953
|
+
"org_name": { "type": ["string", "null"] }
|
|
4954
|
+
},
|
|
4955
|
+
"required": [
|
|
4956
|
+
"api_key",
|
|
4957
|
+
"key_id",
|
|
4958
|
+
"key_prefix",
|
|
4959
|
+
"org_id",
|
|
4960
|
+
"org_name"
|
|
4961
|
+
]
|
|
4962
|
+
},
|
|
4963
|
+
"sdkName": "verifyCliSignup",
|
|
4964
|
+
"summary": "Verify CLI signup and create API key",
|
|
4965
|
+
"tag": "CLI",
|
|
4966
|
+
"tagCommand": "cli"
|
|
4967
|
+
},
|
|
4135
4968
|
{
|
|
4136
4969
|
"binaryResponse": false,
|
|
4137
4970
|
"bodyRequired": true,
|
|
@@ -5802,7 +6635,7 @@ const operationManifest = [
|
|
|
5802
6635
|
"binaryResponse": false,
|
|
5803
6636
|
"bodyRequired": true,
|
|
5804
6637
|
"command": "create-function",
|
|
5805
|
-
"description": "Creates and deploys a new function. The handler must be a single\nESM module whose default export is an object with an async\n`fetch(request, env)` method (Workers-style). The gateway\nHMAC-verifies the POST against the org's webhook secret before\ninvoking the handler; the request body parses to an\n`email.received` event (see `EmailReceivedEvent` and the\nWebhook payload section for the full schema). Code is bundled\nbefore being uploaded; ship a single self-contained file rather\nthan relying on external imports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8
|
|
6638
|
+
"description": "Creates and deploys a new function. The handler must be a single\nESM module whose default export is an object with an async\n`fetch(request, env)` method (Workers-style). The gateway\nHMAC-verifies the POST against the org's webhook secret before\ninvoking the handler; the request body parses to an\n`email.received` event (see `EmailReceivedEvent` and the\nWebhook payload section for the full schema). Code is bundled\nbefore being uploaded; ship a single self-contained file rather\nthan relying on external imports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8, stored with each deployment\nattempt, and sent to the runtime so stack traces can resolve to\noriginal source files.\n\n**Auto-wiring.** On successful deploy, Primitive automatically\ncreates a webhook endpoint that delivers inbound mail to the\nfunction. There is nothing to configure on the Endpoints API\nfor this to work; the gateway URL returned here is for\nreference only and is not directly callable from outside.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already\nbound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n",
|
|
5806
6639
|
"hasJsonBody": true,
|
|
5807
6640
|
"method": "POST",
|
|
5808
6641
|
"operationId": "createFunction",
|
|
@@ -5828,7 +6661,7 @@ const operationManifest = [
|
|
|
5828
6661
|
"type": "string",
|
|
5829
6662
|
"minLength": 1,
|
|
5830
6663
|
"maxLength": 5242880,
|
|
5831
|
-
"description": "Optional source map for the bundle. Up to 5 MiB UTF-8.\nStored
|
|
6664
|
+
"description": "Optional source map for the bundle. Up to 5 MiB UTF-8.\nStored with the deployment attempt and sent to the runtime\nto symbolicate stack traces in the function's logs.\n"
|
|
5832
6665
|
}
|
|
5833
6666
|
},
|
|
5834
6667
|
"required": ["name", "code"]
|
|
@@ -6064,6 +6897,439 @@ const operationManifest = [
|
|
|
6064
6897
|
"tag": "Functions",
|
|
6065
6898
|
"tagCommand": "functions"
|
|
6066
6899
|
},
|
|
6900
|
+
{
|
|
6901
|
+
"binaryResponse": false,
|
|
6902
|
+
"bodyRequired": false,
|
|
6903
|
+
"command": "get-function-test-run-trace",
|
|
6904
|
+
"description": "Returns the current end-to-end trace for a function test run.\nThe trace is intentionally partial while the test is still in\nflight: callers can poll this endpoint and watch it fill in\nfrom send -> inbound -> webhook deliveries -> outbound\nrequests, logs, and replies.\n",
|
|
6905
|
+
"hasJsonBody": false,
|
|
6906
|
+
"method": "GET",
|
|
6907
|
+
"operationId": "getFunctionTestRunTrace",
|
|
6908
|
+
"path": "/functions/{id}/test-runs/{run_id}/trace",
|
|
6909
|
+
"pathParams": [{
|
|
6910
|
+
"description": "Resource UUID",
|
|
6911
|
+
"enum": null,
|
|
6912
|
+
"name": "id",
|
|
6913
|
+
"required": true,
|
|
6914
|
+
"type": "string"
|
|
6915
|
+
}, {
|
|
6916
|
+
"description": "Function test run id returned by POST /functions/{id}/test.",
|
|
6917
|
+
"enum": null,
|
|
6918
|
+
"name": "run_id",
|
|
6919
|
+
"required": true,
|
|
6920
|
+
"type": "string"
|
|
6921
|
+
}],
|
|
6922
|
+
"queryParams": [],
|
|
6923
|
+
"requestSchema": null,
|
|
6924
|
+
"responseSchema": {
|
|
6925
|
+
"type": "object",
|
|
6926
|
+
"description": "End-to-end trace for a `POST /functions/{id}/test` run. The\nshape is stable, but many nested sections are null or empty\nuntil the corresponding phase has happened.\n",
|
|
6927
|
+
"properties": {
|
|
6928
|
+
"state": {
|
|
6929
|
+
"type": "string",
|
|
6930
|
+
"description": "High-level state for a function test run trace:\n - `send_failed`: the initial test email send failed.\n - `waiting_for_send`: the test run was created but no send result has been recorded yet.\n - `waiting_for_inbound`: the test send was queued and the matching inbound email has not arrived yet.\n - `waiting_for_function`: the inbound email arrived and webhook/function processing is still in flight.\n - `completed`: the function webhook completed successfully.\n - `failed`: webhook delivery exhausted retries.\n",
|
|
6931
|
+
"enum": [
|
|
6932
|
+
"send_failed",
|
|
6933
|
+
"waiting_for_send",
|
|
6934
|
+
"waiting_for_inbound",
|
|
6935
|
+
"waiting_for_function",
|
|
6936
|
+
"completed",
|
|
6937
|
+
"failed"
|
|
6938
|
+
]
|
|
6939
|
+
},
|
|
6940
|
+
"test_run": {
|
|
6941
|
+
"type": "object",
|
|
6942
|
+
"properties": {
|
|
6943
|
+
"id": {
|
|
6944
|
+
"type": "string",
|
|
6945
|
+
"format": "uuid"
|
|
6946
|
+
},
|
|
6947
|
+
"function_id": {
|
|
6948
|
+
"type": "string",
|
|
6949
|
+
"format": "uuid"
|
|
6950
|
+
},
|
|
6951
|
+
"inbound_domain": { "type": "string" },
|
|
6952
|
+
"to": { "type": "string" },
|
|
6953
|
+
"from": { "type": "string" },
|
|
6954
|
+
"subject": { "type": "string" },
|
|
6955
|
+
"poll_since": {
|
|
6956
|
+
"type": "string",
|
|
6957
|
+
"format": "date-time"
|
|
6958
|
+
},
|
|
6959
|
+
"created_at": {
|
|
6960
|
+
"type": "string",
|
|
6961
|
+
"format": "date-time"
|
|
6962
|
+
},
|
|
6963
|
+
"sent_at": {
|
|
6964
|
+
"type": ["string", "null"],
|
|
6965
|
+
"format": "date-time"
|
|
6966
|
+
},
|
|
6967
|
+
"send_error": { "type": ["string", "null"] }
|
|
6968
|
+
},
|
|
6969
|
+
"required": [
|
|
6970
|
+
"id",
|
|
6971
|
+
"function_id",
|
|
6972
|
+
"inbound_domain",
|
|
6973
|
+
"to",
|
|
6974
|
+
"from",
|
|
6975
|
+
"subject",
|
|
6976
|
+
"poll_since",
|
|
6977
|
+
"created_at",
|
|
6978
|
+
"sent_at",
|
|
6979
|
+
"send_error"
|
|
6980
|
+
]
|
|
6981
|
+
},
|
|
6982
|
+
"test_send": {
|
|
6983
|
+
"type": ["object", "null"],
|
|
6984
|
+
"properties": {
|
|
6985
|
+
"id": {
|
|
6986
|
+
"type": "string",
|
|
6987
|
+
"format": "uuid"
|
|
6988
|
+
},
|
|
6989
|
+
"status": {
|
|
6990
|
+
"type": "string",
|
|
6991
|
+
"description": "Lifecycle status of a sent_emails row. Possible values:\n\n - `queued`: pre-call INSERT; the outbound agent has not\n yet replied.\n - `submitted_to_agent`: agent accepted; `queue_id` is set.\n - `agent_failed`: agent rejected; `error_code` and\n `error_message` carry the reason.\n - `gate_denied`: a recipient-scope gate denied the send;\n the agent was never called. The `gates` array carries\n the denial detail. /send-mail returns 403 in this case\n so callers see the denial synchronously; /sent-emails\n additionally records the row for historical lookup,\n which is when this status appears in a listing.\n - `unknown`: terminal indeterminate; the on-box log\n poller couldn't classify the receiver's response.\n - `delivered` / `bounced` / `deferred` / `wait_timeout`:\n terminal delivery outcomes (see DeliveryStatus).\n",
|
|
6992
|
+
"enum": [
|
|
6993
|
+
"queued",
|
|
6994
|
+
"submitted_to_agent",
|
|
6995
|
+
"agent_failed",
|
|
6996
|
+
"gate_denied",
|
|
6997
|
+
"unknown",
|
|
6998
|
+
"delivered",
|
|
6999
|
+
"bounced",
|
|
7000
|
+
"deferred",
|
|
7001
|
+
"wait_timeout"
|
|
7002
|
+
]
|
|
7003
|
+
},
|
|
7004
|
+
"queue_id": { "type": ["string", "null"] },
|
|
7005
|
+
"created_at": {
|
|
7006
|
+
"type": "string",
|
|
7007
|
+
"format": "date-time"
|
|
7008
|
+
},
|
|
7009
|
+
"updated_at": {
|
|
7010
|
+
"type": "string",
|
|
7011
|
+
"format": "date-time"
|
|
7012
|
+
}
|
|
7013
|
+
},
|
|
7014
|
+
"required": [
|
|
7015
|
+
"id",
|
|
7016
|
+
"status",
|
|
7017
|
+
"queue_id",
|
|
7018
|
+
"created_at",
|
|
7019
|
+
"updated_at"
|
|
7020
|
+
]
|
|
7021
|
+
},
|
|
7022
|
+
"inbound_email": {
|
|
7023
|
+
"type": ["object", "null"],
|
|
7024
|
+
"properties": {
|
|
7025
|
+
"id": {
|
|
7026
|
+
"type": "string",
|
|
7027
|
+
"format": "uuid"
|
|
7028
|
+
},
|
|
7029
|
+
"status": {
|
|
7030
|
+
"type": "string",
|
|
7031
|
+
"description": "Lifecycle status of an INBOUND email (a row in the `emails`\ntable). Distinct from `SentEmailStatus`, which describes\nthe OUTBOUND lifecycle (the `sent_emails` table) and uses\na different vocabulary because the lifecycles differ.\nPossible values:\n\n - `pending`: the row was inserted at ingestion (mx_main)\n and has not yet completed the spam / filter / auth\n pipeline. Body and parsed fields are present; webhook\n delivery is not yet scheduled. Most rows transition out\n of `pending` within seconds.\n - `accepted`: the inbound passed the policy gates and is\n queued for webhook delivery. The `webhook_status` field\n tracks the separate webhook-delivery lifecycle from\n this point.\n - `completed`: terminal success. Webhook delivery\n attempted and acknowledged by every active endpoint, OR\n no endpoints are configured, so the row is durably\n archived.\n - `rejected`: terminal failure at ingestion (spam, blocked\n sender, filter rule, malformed). The body and metadata\n are stored for auditing but no webhook fires and the\n row is not repliable.\n\nSee also `webhook_status` (separate enum tracking the\nwebhook-delivery state machine) and `SentEmailStatus` (the\noutbound vocabulary).\n",
|
|
7032
|
+
"enum": [
|
|
7033
|
+
"pending",
|
|
7034
|
+
"accepted",
|
|
7035
|
+
"completed",
|
|
7036
|
+
"rejected"
|
|
7037
|
+
]
|
|
7038
|
+
},
|
|
7039
|
+
"received_at": {
|
|
7040
|
+
"type": "string",
|
|
7041
|
+
"format": "date-time"
|
|
7042
|
+
},
|
|
7043
|
+
"from": { "type": "string" },
|
|
7044
|
+
"to": { "type": "string" },
|
|
7045
|
+
"subject": { "type": ["string", "null"] },
|
|
7046
|
+
"webhook_status": {
|
|
7047
|
+
"type": ["string", "null"],
|
|
7048
|
+
"description": "Webhook-delivery state for an inbound email. Tracks a\nSEPARATE lifecycle from the email's `status` field; the\nsame row carries both. Possible values:\n\n - `pending`: ingestion is past `pending` (the email itself\n is `accepted`) but the webhook fan-out has not yet\n started for this row.\n - `in_flight`: at least one delivery attempt is in flight.\n - `fired`: terminal success. Every active endpoint\n acknowledged the delivery (or accepted it after retries).\n - `failed`: terminal partial-failure. At least one endpoint\n exhausted its retry budget; some endpoints may still\n have succeeded.\n - `exhausted`: terminal failure. Every endpoint exhausted\n its retry budget without success.\n - `null`: no endpoints configured, so no webhook lifecycle\n applies.\n\nNote that the value `pending` here does NOT mean the email\nis `pending`; it means the email is past ingestion but\nwebhook delivery has not yet begun. Two overlapping uses\nof the word `pending` for distinct lifecycle phases.\n",
|
|
7049
|
+
"enum": [
|
|
7050
|
+
"pending",
|
|
7051
|
+
"in_flight",
|
|
7052
|
+
"fired",
|
|
7053
|
+
"failed",
|
|
7054
|
+
"exhausted",
|
|
7055
|
+
null
|
|
7056
|
+
]
|
|
7057
|
+
},
|
|
7058
|
+
"webhook_attempt_count": { "type": "integer" },
|
|
7059
|
+
"webhook_last_status_code": { "type": ["integer", "null"] },
|
|
7060
|
+
"webhook_last_error": { "type": ["string", "null"] }
|
|
7061
|
+
},
|
|
7062
|
+
"required": [
|
|
7063
|
+
"id",
|
|
7064
|
+
"status",
|
|
7065
|
+
"received_at",
|
|
7066
|
+
"from",
|
|
7067
|
+
"to",
|
|
7068
|
+
"subject",
|
|
7069
|
+
"webhook_status",
|
|
7070
|
+
"webhook_attempt_count",
|
|
7071
|
+
"webhook_last_status_code",
|
|
7072
|
+
"webhook_last_error"
|
|
7073
|
+
]
|
|
7074
|
+
},
|
|
7075
|
+
"deliveries": {
|
|
7076
|
+
"type": "array",
|
|
7077
|
+
"items": {
|
|
7078
|
+
"type": "object",
|
|
7079
|
+
"properties": {
|
|
7080
|
+
"id": {
|
|
7081
|
+
"type": "string",
|
|
7082
|
+
"description": "Webhook delivery id."
|
|
7083
|
+
},
|
|
7084
|
+
"endpoint_id": {
|
|
7085
|
+
"type": "string",
|
|
7086
|
+
"format": "uuid"
|
|
7087
|
+
},
|
|
7088
|
+
"endpoint_url": {
|
|
7089
|
+
"type": "string",
|
|
7090
|
+
"format": "uri"
|
|
7091
|
+
},
|
|
7092
|
+
"status": {
|
|
7093
|
+
"type": "string",
|
|
7094
|
+
"enum": [
|
|
7095
|
+
"pending",
|
|
7096
|
+
"delivered",
|
|
7097
|
+
"header_confirmed",
|
|
7098
|
+
"failed"
|
|
7099
|
+
]
|
|
7100
|
+
},
|
|
7101
|
+
"attempt_count": { "type": "integer" },
|
|
7102
|
+
"duration_ms": { "type": ["integer", "null"] },
|
|
7103
|
+
"last_error": { "type": ["string", "null"] },
|
|
7104
|
+
"last_error_code": { "type": ["string", "null"] },
|
|
7105
|
+
"created_at": {
|
|
7106
|
+
"type": "string",
|
|
7107
|
+
"format": "date-time"
|
|
7108
|
+
},
|
|
7109
|
+
"updated_at": {
|
|
7110
|
+
"type": "string",
|
|
7111
|
+
"format": "date-time"
|
|
7112
|
+
},
|
|
7113
|
+
"endpoint": {
|
|
7114
|
+
"type": ["object", "null"],
|
|
7115
|
+
"properties": {
|
|
7116
|
+
"id": {
|
|
7117
|
+
"type": "string",
|
|
7118
|
+
"format": "uuid"
|
|
7119
|
+
},
|
|
7120
|
+
"kind": {
|
|
7121
|
+
"type": "string",
|
|
7122
|
+
"description": "Endpoint kind. Current traces may include `http` or `function`; future endpoint kinds may appear."
|
|
7123
|
+
},
|
|
7124
|
+
"function_id": {
|
|
7125
|
+
"type": ["string", "null"],
|
|
7126
|
+
"format": "uuid"
|
|
7127
|
+
},
|
|
7128
|
+
"function_name": { "type": ["string", "null"] },
|
|
7129
|
+
"domain_id": {
|
|
7130
|
+
"type": ["string", "null"],
|
|
7131
|
+
"format": "uuid"
|
|
7132
|
+
},
|
|
7133
|
+
"enabled": { "type": "boolean" },
|
|
7134
|
+
"deactivated_at": {
|
|
7135
|
+
"type": ["string", "null"],
|
|
7136
|
+
"format": "date-time"
|
|
7137
|
+
},
|
|
7138
|
+
"is_current_function": { "type": "boolean" }
|
|
7139
|
+
},
|
|
7140
|
+
"required": [
|
|
7141
|
+
"id",
|
|
7142
|
+
"kind",
|
|
7143
|
+
"function_id",
|
|
7144
|
+
"function_name",
|
|
7145
|
+
"domain_id",
|
|
7146
|
+
"enabled",
|
|
7147
|
+
"deactivated_at",
|
|
7148
|
+
"is_current_function"
|
|
7149
|
+
]
|
|
7150
|
+
}
|
|
7151
|
+
},
|
|
7152
|
+
"required": [
|
|
7153
|
+
"id",
|
|
7154
|
+
"endpoint_id",
|
|
7155
|
+
"endpoint_url",
|
|
7156
|
+
"status",
|
|
7157
|
+
"attempt_count",
|
|
7158
|
+
"duration_ms",
|
|
7159
|
+
"last_error",
|
|
7160
|
+
"last_error_code",
|
|
7161
|
+
"created_at",
|
|
7162
|
+
"updated_at",
|
|
7163
|
+
"endpoint"
|
|
7164
|
+
]
|
|
7165
|
+
}
|
|
7166
|
+
},
|
|
7167
|
+
"outbound_requests": {
|
|
7168
|
+
"type": "array",
|
|
7169
|
+
"items": {
|
|
7170
|
+
"type": "object",
|
|
7171
|
+
"properties": {
|
|
7172
|
+
"id": {
|
|
7173
|
+
"type": "string",
|
|
7174
|
+
"format": "uuid"
|
|
7175
|
+
},
|
|
7176
|
+
"function_id": {
|
|
7177
|
+
"type": "string",
|
|
7178
|
+
"format": "uuid"
|
|
7179
|
+
},
|
|
7180
|
+
"webhook_delivery_id": { "type": ["string", "null"] },
|
|
7181
|
+
"email_id": {
|
|
7182
|
+
"type": ["string", "null"],
|
|
7183
|
+
"format": "uuid"
|
|
7184
|
+
},
|
|
7185
|
+
"endpoint_id": {
|
|
7186
|
+
"type": ["string", "null"],
|
|
7187
|
+
"format": "uuid"
|
|
7188
|
+
},
|
|
7189
|
+
"method": { "type": "string" },
|
|
7190
|
+
"url": {
|
|
7191
|
+
"type": "string",
|
|
7192
|
+
"format": "uri"
|
|
7193
|
+
},
|
|
7194
|
+
"host": { "type": "string" },
|
|
7195
|
+
"path": { "type": "string" },
|
|
7196
|
+
"status_code": { "type": ["integer", "null"] },
|
|
7197
|
+
"ok": { "type": ["boolean", "null"] },
|
|
7198
|
+
"duration_ms": { "type": "integer" },
|
|
7199
|
+
"error": { "type": ["string", "null"] },
|
|
7200
|
+
"ts": {
|
|
7201
|
+
"type": "string",
|
|
7202
|
+
"format": "date-time"
|
|
7203
|
+
}
|
|
7204
|
+
},
|
|
7205
|
+
"required": [
|
|
7206
|
+
"id",
|
|
7207
|
+
"function_id",
|
|
7208
|
+
"webhook_delivery_id",
|
|
7209
|
+
"email_id",
|
|
7210
|
+
"endpoint_id",
|
|
7211
|
+
"method",
|
|
7212
|
+
"url",
|
|
7213
|
+
"host",
|
|
7214
|
+
"path",
|
|
7215
|
+
"status_code",
|
|
7216
|
+
"ok",
|
|
7217
|
+
"duration_ms",
|
|
7218
|
+
"error",
|
|
7219
|
+
"ts"
|
|
7220
|
+
]
|
|
7221
|
+
}
|
|
7222
|
+
},
|
|
7223
|
+
"logs": {
|
|
7224
|
+
"type": "array",
|
|
7225
|
+
"items": {
|
|
7226
|
+
"type": "object",
|
|
7227
|
+
"description": "One row from GET /functions/{id}/logs. Represents a single\ncaptured log line emitted by the running handler (e.g. via\n`console.log` / `console.error`).\n",
|
|
7228
|
+
"properties": {
|
|
7229
|
+
"id": {
|
|
7230
|
+
"type": "string",
|
|
7231
|
+
"format": "uuid",
|
|
7232
|
+
"description": "Unique log row id (stable across pages)."
|
|
7233
|
+
},
|
|
7234
|
+
"function_id": {
|
|
7235
|
+
"type": "string",
|
|
7236
|
+
"format": "uuid",
|
|
7237
|
+
"description": "The function this log row belongs to."
|
|
7238
|
+
},
|
|
7239
|
+
"level": {
|
|
7240
|
+
"type": "string",
|
|
7241
|
+
"enum": [
|
|
7242
|
+
"debug",
|
|
7243
|
+
"log",
|
|
7244
|
+
"info",
|
|
7245
|
+
"warn",
|
|
7246
|
+
"error"
|
|
7247
|
+
],
|
|
7248
|
+
"description": "Severity. `log` is the runtime's default for unannotated\n`console.log` calls; the other levels match standard\n`console.*` methods.\n"
|
|
7249
|
+
},
|
|
7250
|
+
"message": {
|
|
7251
|
+
"type": "string",
|
|
7252
|
+
"description": "The textual message body. The runtime stringifies non-string\narguments before persisting, so this is always a plain\nstring.\n"
|
|
7253
|
+
},
|
|
7254
|
+
"ts": {
|
|
7255
|
+
"type": "string",
|
|
7256
|
+
"format": "date-time",
|
|
7257
|
+
"description": "When the handler emitted this line. Newest-first ordering\non this column drives pagination; clock is the runtime's,\nnot the gateway's.\n"
|
|
7258
|
+
},
|
|
7259
|
+
"metadata": {
|
|
7260
|
+
"type": ["object", "null"],
|
|
7261
|
+
"additionalProperties": true,
|
|
7262
|
+
"description": "Optional structured payload the runtime attaches alongside\nthe message (e.g. extra args passed to `console.log`).\nShape is opaque; treat keys as untyped.\n"
|
|
7263
|
+
}
|
|
7264
|
+
},
|
|
7265
|
+
"required": [
|
|
7266
|
+
"id",
|
|
7267
|
+
"function_id",
|
|
7268
|
+
"level",
|
|
7269
|
+
"message",
|
|
7270
|
+
"ts"
|
|
7271
|
+
]
|
|
7272
|
+
}
|
|
7273
|
+
},
|
|
7274
|
+
"replies": {
|
|
7275
|
+
"type": "array",
|
|
7276
|
+
"items": {
|
|
7277
|
+
"type": "object",
|
|
7278
|
+
"properties": {
|
|
7279
|
+
"id": {
|
|
7280
|
+
"type": "string",
|
|
7281
|
+
"format": "uuid"
|
|
7282
|
+
},
|
|
7283
|
+
"status": {
|
|
7284
|
+
"type": "string",
|
|
7285
|
+
"description": "Lifecycle status of a sent_emails row. Possible values:\n\n - `queued`: pre-call INSERT; the outbound agent has not\n yet replied.\n - `submitted_to_agent`: agent accepted; `queue_id` is set.\n - `agent_failed`: agent rejected; `error_code` and\n `error_message` carry the reason.\n - `gate_denied`: a recipient-scope gate denied the send;\n the agent was never called. The `gates` array carries\n the denial detail. /send-mail returns 403 in this case\n so callers see the denial synchronously; /sent-emails\n additionally records the row for historical lookup,\n which is when this status appears in a listing.\n - `unknown`: terminal indeterminate; the on-box log\n poller couldn't classify the receiver's response.\n - `delivered` / `bounced` / `deferred` / `wait_timeout`:\n terminal delivery outcomes (see DeliveryStatus).\n",
|
|
7286
|
+
"enum": [
|
|
7287
|
+
"queued",
|
|
7288
|
+
"submitted_to_agent",
|
|
7289
|
+
"agent_failed",
|
|
7290
|
+
"gate_denied",
|
|
7291
|
+
"unknown",
|
|
7292
|
+
"delivered",
|
|
7293
|
+
"bounced",
|
|
7294
|
+
"deferred",
|
|
7295
|
+
"wait_timeout"
|
|
7296
|
+
]
|
|
7297
|
+
},
|
|
7298
|
+
"to": { "type": "string" },
|
|
7299
|
+
"subject": { "type": "string" },
|
|
7300
|
+
"queue_id": { "type": ["string", "null"] },
|
|
7301
|
+
"created_at": {
|
|
7302
|
+
"type": "string",
|
|
7303
|
+
"format": "date-time"
|
|
7304
|
+
}
|
|
7305
|
+
},
|
|
7306
|
+
"required": [
|
|
7307
|
+
"id",
|
|
7308
|
+
"status",
|
|
7309
|
+
"to",
|
|
7310
|
+
"subject",
|
|
7311
|
+
"queue_id",
|
|
7312
|
+
"created_at"
|
|
7313
|
+
]
|
|
7314
|
+
}
|
|
7315
|
+
}
|
|
7316
|
+
},
|
|
7317
|
+
"required": [
|
|
7318
|
+
"state",
|
|
7319
|
+
"test_run",
|
|
7320
|
+
"test_send",
|
|
7321
|
+
"inbound_email",
|
|
7322
|
+
"deliveries",
|
|
7323
|
+
"outbound_requests",
|
|
7324
|
+
"logs",
|
|
7325
|
+
"replies"
|
|
7326
|
+
]
|
|
7327
|
+
},
|
|
7328
|
+
"sdkName": "getFunctionTestRunTrace",
|
|
7329
|
+
"summary": "Get a function test run trace",
|
|
7330
|
+
"tag": "Functions",
|
|
7331
|
+
"tagCommand": "functions"
|
|
7332
|
+
},
|
|
6067
7333
|
{
|
|
6068
7334
|
"binaryResponse": false,
|
|
6069
7335
|
"bodyRequired": false,
|
|
@@ -6380,8 +7646,13 @@ const operationManifest = [
|
|
|
6380
7646
|
},
|
|
6381
7647
|
"responseSchema": {
|
|
6382
7648
|
"type": "object",
|
|
6383
|
-
"description": "Metadata returned by POST /functions/{id}/test. The send is\nqueued;
|
|
7649
|
+
"description": "Metadata returned by POST /functions/{id}/test. The send is\nqueued; poll `trace_url` to watch the run progress through\nsend -> inbound -> webhook deliveries -> outbound requests,\nlogs, and replies.\n",
|
|
6384
7650
|
"properties": {
|
|
7651
|
+
"test_run_id": {
|
|
7652
|
+
"type": "string",
|
|
7653
|
+
"format": "uuid",
|
|
7654
|
+
"description": "Durable test run id used to fetch the run trace."
|
|
7655
|
+
},
|
|
6385
7656
|
"inbound_domain": {
|
|
6386
7657
|
"type": "string",
|
|
6387
7658
|
"description": "Verified inbound domain the test email was sent to."
|
|
@@ -6411,16 +7682,22 @@ const operationManifest = [
|
|
|
6411
7682
|
"type": "string",
|
|
6412
7683
|
"format": "uri",
|
|
6413
7684
|
"description": "Function detail page where invocations show up live."
|
|
7685
|
+
},
|
|
7686
|
+
"trace_url": {
|
|
7687
|
+
"type": "string",
|
|
7688
|
+
"description": "Relative API URL for GET /functions/{id}/test-runs/{test_run_id}/trace."
|
|
6414
7689
|
}
|
|
6415
7690
|
},
|
|
6416
7691
|
"required": [
|
|
7692
|
+
"test_run_id",
|
|
6417
7693
|
"inbound_domain",
|
|
6418
7694
|
"to",
|
|
6419
7695
|
"from",
|
|
6420
7696
|
"send_id",
|
|
6421
7697
|
"subject",
|
|
6422
7698
|
"poll_since",
|
|
6423
|
-
"watch_url"
|
|
7699
|
+
"watch_url",
|
|
7700
|
+
"trace_url"
|
|
6424
7701
|
]
|
|
6425
7702
|
},
|
|
6426
7703
|
"sdkName": "testFunction",
|
|
@@ -6432,7 +7709,7 @@ const operationManifest = [
|
|
|
6432
7709
|
"binaryResponse": false,
|
|
6433
7710
|
"bodyRequired": true,
|
|
6434
7711
|
"command": "update-function",
|
|
6435
|
-
"description": "Replaces the function's source code with the body's `code` and\ntriggers a redeploy. Same size limits as `POST /functions`.\nUse this verb to push secret writes into the running handler:\npassing the same `code` re-runs the deploy and refreshes the\nbinding set with the latest values from the secrets table.\n\nOn
|
|
7712
|
+
"description": "Replaces the function's source code with the body's `code` and\ntriggers a redeploy. Same size limits as `POST /functions`.\nUse this verb to push secret writes into the running handler:\npassing the same `code` re-runs the deploy and refreshes the\nbinding set with the latest values from the secrets table.\n\nOn deploy failure, the previously-deployed code stays live; the\nruntime never serves a half-built bundle. The response uses\n`error.code` `deploy_failed`, and the function's `deploy_error`\nfield carries the latest deploy error for dashboard/API reads.\n",
|
|
6436
7713
|
"hasJsonBody": true,
|
|
6437
7714
|
"method": "PUT",
|
|
6438
7715
|
"operationId": "updateFunction",
|