@primitivedotdev/sdk 0.19.0 → 0.21.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/generated/index.js +1 -1
- package/dist/api/generated/sdk.gen.js +235 -0
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +40 -5
- package/dist/{api-C5VR_Opg.js → api-BjzvA2Fy.js} +308 -6
- package/dist/{index-oRkCqj6u.d.ts → index-QTYQpSFt.d.ts} +999 -60
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/oclif/api-command.js +87 -13
- package/dist/oclif/auth.js +65 -10
- package/dist/oclif/commands/emails-latest.js +23 -12
- package/dist/oclif/commands/emails-poll.js +121 -0
- package/dist/oclif/commands/emails-wait.js +171 -0
- package/dist/oclif/commands/emails-watch.js +165 -0
- package/dist/oclif/commands/functions-deploy.js +117 -0
- package/dist/oclif/commands/functions-redeploy.js +106 -0
- package/dist/oclif/commands/login.js +18 -14
- package/dist/oclif/commands/logout.js +9 -8
- package/dist/oclif/commands/send.js +21 -7
- package/dist/oclif/commands/whoami.js +15 -6
- package/dist/oclif/fish-completion.js +1 -1
- package/dist/oclif/index.js +16 -0
- package/dist/openapi/openapi.generated.js +1317 -51
- package/dist/openapi/operations.generated.js +995 -1
- package/oclif.manifest.json +2083 -335
- package/package.json +4 -1
|
@@ -1459,6 +1459,310 @@ export const operationManifest = [
|
|
|
1459
1459
|
"tag": "Emails",
|
|
1460
1460
|
"tagCommand": "emails"
|
|
1461
1461
|
},
|
|
1462
|
+
{
|
|
1463
|
+
"binaryResponse": false,
|
|
1464
|
+
"bodyRequired": false,
|
|
1465
|
+
"command": "search-emails",
|
|
1466
|
+
"description": "Searches inbound emails with structured filters and optional\nfull-text matching across parsed email fields. This endpoint is\noptimized for filtered inbox views and CLI polling workflows:\ncallers that only need new accepted mail can pass\n`sort=received_at_asc`, `snippet=false`, `include_facets=false`,\nand a `date_from` timestamp.\n\n`q`, `subject`, and `body` use the same English full-text index\nas the web inbox search. Structured filters such as `from`, `to`,\n`domain_id`, status, attachment presence, and spam score bounds\nare combined with the text query.\n",
|
|
1467
|
+
"hasJsonBody": false,
|
|
1468
|
+
"method": "GET",
|
|
1469
|
+
"operationId": "searchEmails",
|
|
1470
|
+
"path": "/emails/search",
|
|
1471
|
+
"pathParams": [],
|
|
1472
|
+
"queryParams": [
|
|
1473
|
+
{
|
|
1474
|
+
"description": "Full-text search DSL query.",
|
|
1475
|
+
"enum": null,
|
|
1476
|
+
"name": "q",
|
|
1477
|
+
"required": false,
|
|
1478
|
+
"type": "string"
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
"description": "Filter by sender address or sender domain.",
|
|
1482
|
+
"enum": null,
|
|
1483
|
+
"name": "from",
|
|
1484
|
+
"required": false,
|
|
1485
|
+
"type": "string"
|
|
1486
|
+
},
|
|
1487
|
+
{
|
|
1488
|
+
"description": "Filter by recipient address or recipient domain.",
|
|
1489
|
+
"enum": null,
|
|
1490
|
+
"name": "to",
|
|
1491
|
+
"required": false,
|
|
1492
|
+
"type": "string"
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
"description": "Full-text search restricted to the subject field.",
|
|
1496
|
+
"enum": null,
|
|
1497
|
+
"name": "subject",
|
|
1498
|
+
"required": false,
|
|
1499
|
+
"type": "string"
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
"description": "Full-text search restricted to the parsed text body.",
|
|
1503
|
+
"enum": null,
|
|
1504
|
+
"name": "body",
|
|
1505
|
+
"required": false,
|
|
1506
|
+
"type": "string"
|
|
1507
|
+
},
|
|
1508
|
+
{
|
|
1509
|
+
"description": "Filter by domain ID.",
|
|
1510
|
+
"enum": null,
|
|
1511
|
+
"name": "domain_id",
|
|
1512
|
+
"required": false,
|
|
1513
|
+
"type": "string"
|
|
1514
|
+
},
|
|
1515
|
+
{
|
|
1516
|
+
"description": "Filter by inbound email lifecycle status.",
|
|
1517
|
+
"enum": null,
|
|
1518
|
+
"name": "status",
|
|
1519
|
+
"required": false,
|
|
1520
|
+
"type": "string"
|
|
1521
|
+
},
|
|
1522
|
+
{
|
|
1523
|
+
"description": "Filter emails received on or after this timestamp.",
|
|
1524
|
+
"enum": null,
|
|
1525
|
+
"name": "date_from",
|
|
1526
|
+
"required": false,
|
|
1527
|
+
"type": "string"
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
"description": "Filter emails received on or before this timestamp.",
|
|
1531
|
+
"enum": null,
|
|
1532
|
+
"name": "date_to",
|
|
1533
|
+
"required": false,
|
|
1534
|
+
"type": "string"
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
"description": "Filter by whether the email has one or more attachments.",
|
|
1538
|
+
"enum": [
|
|
1539
|
+
"true",
|
|
1540
|
+
"false"
|
|
1541
|
+
],
|
|
1542
|
+
"name": "has_attachment",
|
|
1543
|
+
"required": false,
|
|
1544
|
+
"type": "string"
|
|
1545
|
+
},
|
|
1546
|
+
{
|
|
1547
|
+
"description": "Filter to emails with spam score below this value.",
|
|
1548
|
+
"enum": null,
|
|
1549
|
+
"name": "spam_score_lt",
|
|
1550
|
+
"required": false,
|
|
1551
|
+
"type": "number"
|
|
1552
|
+
},
|
|
1553
|
+
{
|
|
1554
|
+
"description": "Filter to emails with spam score greater than or equal to this value.",
|
|
1555
|
+
"enum": null,
|
|
1556
|
+
"name": "spam_score_gte",
|
|
1557
|
+
"required": false,
|
|
1558
|
+
"type": "number"
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
"description": "Sort mode. Defaults to relevance when a text query is present,\notherwise `received_at_desc`.\n",
|
|
1562
|
+
"enum": [
|
|
1563
|
+
"relevance",
|
|
1564
|
+
"received_at_desc",
|
|
1565
|
+
"received_at_asc"
|
|
1566
|
+
],
|
|
1567
|
+
"name": "sort",
|
|
1568
|
+
"required": false,
|
|
1569
|
+
"type": "string"
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
"description": "Opaque pagination cursor from a previous search response.",
|
|
1573
|
+
"enum": null,
|
|
1574
|
+
"name": "cursor",
|
|
1575
|
+
"required": false,
|
|
1576
|
+
"type": "string"
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
"description": "Number of results per page",
|
|
1580
|
+
"enum": null,
|
|
1581
|
+
"name": "limit",
|
|
1582
|
+
"required": false,
|
|
1583
|
+
"type": "integer"
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
"description": "Include subject/body highlight snippets when text search is active.",
|
|
1587
|
+
"enum": [
|
|
1588
|
+
"true",
|
|
1589
|
+
"false"
|
|
1590
|
+
],
|
|
1591
|
+
"name": "snippet",
|
|
1592
|
+
"required": false,
|
|
1593
|
+
"type": "string"
|
|
1594
|
+
},
|
|
1595
|
+
{
|
|
1596
|
+
"description": "Include facet counts for sender, domain, status, and attachment presence.",
|
|
1597
|
+
"enum": [
|
|
1598
|
+
"true",
|
|
1599
|
+
"false"
|
|
1600
|
+
],
|
|
1601
|
+
"name": "include_facets",
|
|
1602
|
+
"required": false,
|
|
1603
|
+
"type": "string"
|
|
1604
|
+
}
|
|
1605
|
+
],
|
|
1606
|
+
"requestSchema": null,
|
|
1607
|
+
"responseSchema": {
|
|
1608
|
+
"type": "array",
|
|
1609
|
+
"items": {
|
|
1610
|
+
"allOf": [
|
|
1611
|
+
{
|
|
1612
|
+
"type": "object",
|
|
1613
|
+
"properties": {
|
|
1614
|
+
"id": {
|
|
1615
|
+
"type": "string",
|
|
1616
|
+
"format": "uuid"
|
|
1617
|
+
},
|
|
1618
|
+
"message_id": {
|
|
1619
|
+
"type": [
|
|
1620
|
+
"string",
|
|
1621
|
+
"null"
|
|
1622
|
+
]
|
|
1623
|
+
},
|
|
1624
|
+
"domain_id": {
|
|
1625
|
+
"type": [
|
|
1626
|
+
"string",
|
|
1627
|
+
"null"
|
|
1628
|
+
],
|
|
1629
|
+
"format": "uuid"
|
|
1630
|
+
},
|
|
1631
|
+
"org_id": {
|
|
1632
|
+
"type": [
|
|
1633
|
+
"string",
|
|
1634
|
+
"null"
|
|
1635
|
+
],
|
|
1636
|
+
"format": "uuid"
|
|
1637
|
+
},
|
|
1638
|
+
"status": {
|
|
1639
|
+
"type": "string",
|
|
1640
|
+
"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",
|
|
1641
|
+
"enum": [
|
|
1642
|
+
"pending",
|
|
1643
|
+
"accepted",
|
|
1644
|
+
"completed",
|
|
1645
|
+
"rejected"
|
|
1646
|
+
]
|
|
1647
|
+
},
|
|
1648
|
+
"sender": {
|
|
1649
|
+
"type": "string",
|
|
1650
|
+
"description": "SMTP envelope sender (return-path) the inbound mail server\naccepted. For most legitimate mail this equals the bare\naddress in the From header; for mailing lists, bounce\nhandlers, and forwarders it is typically the bounce address\nrather than the human-visible sender.\n\nFor the parsed From-header value (with display name handling\nand a sender-fallback when the header is unparseable), GET\nthe email by id and use `from_email`.\n"
|
|
1651
|
+
},
|
|
1652
|
+
"recipient": {
|
|
1653
|
+
"type": "string"
|
|
1654
|
+
},
|
|
1655
|
+
"subject": {
|
|
1656
|
+
"type": [
|
|
1657
|
+
"string",
|
|
1658
|
+
"null"
|
|
1659
|
+
]
|
|
1660
|
+
},
|
|
1661
|
+
"domain": {
|
|
1662
|
+
"type": "string"
|
|
1663
|
+
},
|
|
1664
|
+
"spam_score": {
|
|
1665
|
+
"type": [
|
|
1666
|
+
"number",
|
|
1667
|
+
"null"
|
|
1668
|
+
]
|
|
1669
|
+
},
|
|
1670
|
+
"created_at": {
|
|
1671
|
+
"type": "string",
|
|
1672
|
+
"format": "date-time"
|
|
1673
|
+
},
|
|
1674
|
+
"received_at": {
|
|
1675
|
+
"type": "string",
|
|
1676
|
+
"format": "date-time"
|
|
1677
|
+
},
|
|
1678
|
+
"raw_size_bytes": {
|
|
1679
|
+
"type": [
|
|
1680
|
+
"integer",
|
|
1681
|
+
"null"
|
|
1682
|
+
]
|
|
1683
|
+
},
|
|
1684
|
+
"webhook_status": {
|
|
1685
|
+
"type": [
|
|
1686
|
+
"string",
|
|
1687
|
+
"null"
|
|
1688
|
+
],
|
|
1689
|
+
"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",
|
|
1690
|
+
"enum": [
|
|
1691
|
+
"pending",
|
|
1692
|
+
"in_flight",
|
|
1693
|
+
"fired",
|
|
1694
|
+
"failed",
|
|
1695
|
+
"exhausted",
|
|
1696
|
+
null
|
|
1697
|
+
]
|
|
1698
|
+
},
|
|
1699
|
+
"webhook_attempt_count": {
|
|
1700
|
+
"type": "integer"
|
|
1701
|
+
}
|
|
1702
|
+
},
|
|
1703
|
+
"required": [
|
|
1704
|
+
"id",
|
|
1705
|
+
"status",
|
|
1706
|
+
"sender",
|
|
1707
|
+
"recipient",
|
|
1708
|
+
"domain",
|
|
1709
|
+
"created_at",
|
|
1710
|
+
"received_at",
|
|
1711
|
+
"webhook_attempt_count"
|
|
1712
|
+
]
|
|
1713
|
+
},
|
|
1714
|
+
{
|
|
1715
|
+
"type": "object",
|
|
1716
|
+
"properties": {
|
|
1717
|
+
"attachment_count": {
|
|
1718
|
+
"type": "integer",
|
|
1719
|
+
"description": "Number of parsed attachments on the email."
|
|
1720
|
+
},
|
|
1721
|
+
"from_known_address": {
|
|
1722
|
+
"type": "boolean",
|
|
1723
|
+
"description": "Whether the parsed From address is known to this org from prior authenticated inbound mail."
|
|
1724
|
+
},
|
|
1725
|
+
"score": {
|
|
1726
|
+
"type": "number",
|
|
1727
|
+
"description": "Relevance score. Present only when sorting by relevance."
|
|
1728
|
+
},
|
|
1729
|
+
"highlights": {
|
|
1730
|
+
"type": "object",
|
|
1731
|
+
"properties": {
|
|
1732
|
+
"subject": {
|
|
1733
|
+
"type": "array",
|
|
1734
|
+
"items": {
|
|
1735
|
+
"type": "string"
|
|
1736
|
+
},
|
|
1737
|
+
"description": "Subject snippets with matching terms highlighted."
|
|
1738
|
+
},
|
|
1739
|
+
"body": {
|
|
1740
|
+
"type": "array",
|
|
1741
|
+
"items": {
|
|
1742
|
+
"type": "string"
|
|
1743
|
+
},
|
|
1744
|
+
"description": "Body snippets with matching terms highlighted."
|
|
1745
|
+
}
|
|
1746
|
+
},
|
|
1747
|
+
"required": [
|
|
1748
|
+
"subject",
|
|
1749
|
+
"body"
|
|
1750
|
+
]
|
|
1751
|
+
}
|
|
1752
|
+
},
|
|
1753
|
+
"required": [
|
|
1754
|
+
"attachment_count",
|
|
1755
|
+
"from_known_address"
|
|
1756
|
+
]
|
|
1757
|
+
}
|
|
1758
|
+
]
|
|
1759
|
+
}
|
|
1760
|
+
},
|
|
1761
|
+
"sdkName": "searchEmails",
|
|
1762
|
+
"summary": "Search inbound emails",
|
|
1763
|
+
"tag": "Emails",
|
|
1764
|
+
"tagCommand": "emails"
|
|
1765
|
+
},
|
|
1462
1766
|
{
|
|
1463
1767
|
"binaryResponse": false,
|
|
1464
1768
|
"bodyRequired": true,
|
|
@@ -2211,6 +2515,696 @@ export const operationManifest = [
|
|
|
2211
2515
|
"tag": "Filters",
|
|
2212
2516
|
"tagCommand": "filters"
|
|
2213
2517
|
},
|
|
2518
|
+
{
|
|
2519
|
+
"binaryResponse": false,
|
|
2520
|
+
"bodyRequired": true,
|
|
2521
|
+
"command": "create-function",
|
|
2522
|
+
"description": "Creates and deploys a new function. The handler must be a single\nESM module that exports a default async function receiving the\n`email.received` event (see the Webhook payload section for the\nfull schema). Code is bundled before being uploaded; ship a\nsingle self-contained file rather than relying on external\nimports.\n\n**Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`\n(optional) is capped at 5 MiB UTF-8 and is stored only on the\nedge runtime side; it is not persisted in Primitive's database.\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",
|
|
2523
|
+
"hasJsonBody": true,
|
|
2524
|
+
"method": "POST",
|
|
2525
|
+
"operationId": "createFunction",
|
|
2526
|
+
"path": "/functions",
|
|
2527
|
+
"pathParams": [],
|
|
2528
|
+
"queryParams": [],
|
|
2529
|
+
"requestSchema": {
|
|
2530
|
+
"type": "object",
|
|
2531
|
+
"additionalProperties": false,
|
|
2532
|
+
"properties": {
|
|
2533
|
+
"name": {
|
|
2534
|
+
"type": "string",
|
|
2535
|
+
"pattern": "^[a-z0-9_-]{1,64}$",
|
|
2536
|
+
"description": "Slug-style name. Lowercase letters, digits, hyphens, and\nunderscores. 1 to 64 characters. Must be unique within the\norg; a 409 is returned on collision.\n"
|
|
2537
|
+
},
|
|
2538
|
+
"code": {
|
|
2539
|
+
"type": "string",
|
|
2540
|
+
"minLength": 1,
|
|
2541
|
+
"maxLength": 1048576,
|
|
2542
|
+
"description": "Bundled handler as a single ESM module. Up to 1 MiB UTF-8.\nMust export a default `{ async fetch(req, env, ctx) { ... } }`\nobject.\n"
|
|
2543
|
+
},
|
|
2544
|
+
"sourceMap": {
|
|
2545
|
+
"type": "string",
|
|
2546
|
+
"minLength": 1,
|
|
2547
|
+
"maxLength": 5242880,
|
|
2548
|
+
"description": "Optional source map for the bundle. Up to 5 MiB UTF-8.\nStored only on the runtime side (not in Primitive's\ndatabase) and used to symbolicate stack traces in the\nfunction's logs.\n"
|
|
2549
|
+
}
|
|
2550
|
+
},
|
|
2551
|
+
"required": [
|
|
2552
|
+
"name",
|
|
2553
|
+
"code"
|
|
2554
|
+
]
|
|
2555
|
+
},
|
|
2556
|
+
"responseSchema": {
|
|
2557
|
+
"type": "object",
|
|
2558
|
+
"description": "Returned by POST /functions on a successful deploy.",
|
|
2559
|
+
"properties": {
|
|
2560
|
+
"id": {
|
|
2561
|
+
"type": "string",
|
|
2562
|
+
"format": "uuid"
|
|
2563
|
+
},
|
|
2564
|
+
"name": {
|
|
2565
|
+
"type": "string"
|
|
2566
|
+
},
|
|
2567
|
+
"deploy_status": {
|
|
2568
|
+
"type": "string",
|
|
2569
|
+
"enum": [
|
|
2570
|
+
"pending",
|
|
2571
|
+
"deployed",
|
|
2572
|
+
"failed"
|
|
2573
|
+
],
|
|
2574
|
+
"description": "Lifecycle state of the latest deploy attempt:\n * `pending` — deploy in flight; the runtime has not yet\n confirmed the new bundle is live.\n * `deployed` — the running edge handler is the latest code.\n * `failed` — the most recent deploy attempt failed; the\n previously-live code (if any) is still running. The\n `deploy_error` field carries the error message.\n"
|
|
2575
|
+
},
|
|
2576
|
+
"gateway_url": {
|
|
2577
|
+
"type": "string",
|
|
2578
|
+
"format": "uri"
|
|
2579
|
+
}
|
|
2580
|
+
},
|
|
2581
|
+
"required": [
|
|
2582
|
+
"id",
|
|
2583
|
+
"name",
|
|
2584
|
+
"deploy_status",
|
|
2585
|
+
"gateway_url"
|
|
2586
|
+
]
|
|
2587
|
+
},
|
|
2588
|
+
"sdkName": "createFunction",
|
|
2589
|
+
"summary": "Deploy a function",
|
|
2590
|
+
"tag": "Functions",
|
|
2591
|
+
"tagCommand": "functions"
|
|
2592
|
+
},
|
|
2593
|
+
{
|
|
2594
|
+
"binaryResponse": false,
|
|
2595
|
+
"bodyRequired": true,
|
|
2596
|
+
"command": "create-function-secret",
|
|
2597
|
+
"description": "Idempotent insert-or-update keyed on `(function_id, key)`.\nReturns 201 the first time the key is set, 200 on subsequent\nupdates. Values are encrypted at rest and only become visible\nto the running handler on the next deploy (`PUT /functions/{id}`\nwith the existing code is sufficient to refresh bindings).\n\nKeys must match `^[A-Z_][A-Z0-9_]*$` (uppercase letters,\ndigits, underscores; first character is a letter or\nunderscore). Values are at most 4096 UTF-8 bytes. System-\nmanaged keys are reserved and rejected.\n",
|
|
2598
|
+
"hasJsonBody": true,
|
|
2599
|
+
"method": "POST",
|
|
2600
|
+
"operationId": "createFunctionSecret",
|
|
2601
|
+
"path": "/functions/{id}/secrets",
|
|
2602
|
+
"pathParams": [
|
|
2603
|
+
{
|
|
2604
|
+
"description": "Resource UUID",
|
|
2605
|
+
"enum": null,
|
|
2606
|
+
"name": "id",
|
|
2607
|
+
"required": true,
|
|
2608
|
+
"type": "string"
|
|
2609
|
+
}
|
|
2610
|
+
],
|
|
2611
|
+
"queryParams": [],
|
|
2612
|
+
"requestSchema": {
|
|
2613
|
+
"type": "object",
|
|
2614
|
+
"additionalProperties": false,
|
|
2615
|
+
"description": "Body for POST /functions/{id}/secrets.",
|
|
2616
|
+
"properties": {
|
|
2617
|
+
"key": {
|
|
2618
|
+
"type": "string",
|
|
2619
|
+
"pattern": "^[A-Z_][A-Z0-9_]*$",
|
|
2620
|
+
"description": "Uppercase letters, digits, and underscores. Must start with\na letter or underscore. System-managed keys (e.g.\nPRIMITIVE_WEBHOOK_SECRET) are reserved.\n"
|
|
2621
|
+
},
|
|
2622
|
+
"value": {
|
|
2623
|
+
"type": "string",
|
|
2624
|
+
"minLength": 1,
|
|
2625
|
+
"maxLength": 4096,
|
|
2626
|
+
"description": "Secret value, up to 4096 UTF-8 bytes. Encrypted at rest.\nNever returned by any read endpoint.\n"
|
|
2627
|
+
}
|
|
2628
|
+
},
|
|
2629
|
+
"required": [
|
|
2630
|
+
"key",
|
|
2631
|
+
"value"
|
|
2632
|
+
]
|
|
2633
|
+
},
|
|
2634
|
+
"responseSchema": {
|
|
2635
|
+
"type": "object",
|
|
2636
|
+
"description": "Returned by POST and PUT secret routes.",
|
|
2637
|
+
"properties": {
|
|
2638
|
+
"key": {
|
|
2639
|
+
"type": "string"
|
|
2640
|
+
},
|
|
2641
|
+
"created_at": {
|
|
2642
|
+
"type": "string",
|
|
2643
|
+
"format": "date-time"
|
|
2644
|
+
},
|
|
2645
|
+
"updated_at": {
|
|
2646
|
+
"type": "string",
|
|
2647
|
+
"format": "date-time"
|
|
2648
|
+
},
|
|
2649
|
+
"created": {
|
|
2650
|
+
"type": "boolean",
|
|
2651
|
+
"description": "True if this call inserted a new row, false if it updated an existing one."
|
|
2652
|
+
}
|
|
2653
|
+
},
|
|
2654
|
+
"required": [
|
|
2655
|
+
"key",
|
|
2656
|
+
"created_at",
|
|
2657
|
+
"updated_at",
|
|
2658
|
+
"created"
|
|
2659
|
+
]
|
|
2660
|
+
},
|
|
2661
|
+
"sdkName": "createFunctionSecret",
|
|
2662
|
+
"summary": "Create or update a secret",
|
|
2663
|
+
"tag": "Functions",
|
|
2664
|
+
"tagCommand": "functions"
|
|
2665
|
+
},
|
|
2666
|
+
{
|
|
2667
|
+
"binaryResponse": false,
|
|
2668
|
+
"bodyRequired": false,
|
|
2669
|
+
"command": "delete-function",
|
|
2670
|
+
"description": "Soft-deletes the function row, removes the script from the edge\nruntime, and deactivates the auto-wired webhook endpoint so no\nfurther inbound mail is delivered. Past deploy history,\ninvocations, and logs are retained.\n\nReturns 502 if the runtime delete fails partway; the function\nrow stays in place and the call is safe to retry until it\nsucceeds.\n",
|
|
2671
|
+
"hasJsonBody": false,
|
|
2672
|
+
"method": "DELETE",
|
|
2673
|
+
"operationId": "deleteFunction",
|
|
2674
|
+
"path": "/functions/{id}",
|
|
2675
|
+
"pathParams": [
|
|
2676
|
+
{
|
|
2677
|
+
"description": "Resource UUID",
|
|
2678
|
+
"enum": null,
|
|
2679
|
+
"name": "id",
|
|
2680
|
+
"required": true,
|
|
2681
|
+
"type": "string"
|
|
2682
|
+
}
|
|
2683
|
+
],
|
|
2684
|
+
"queryParams": [],
|
|
2685
|
+
"requestSchema": null,
|
|
2686
|
+
"responseSchema": null,
|
|
2687
|
+
"sdkName": "deleteFunction",
|
|
2688
|
+
"summary": "Delete a function",
|
|
2689
|
+
"tag": "Functions",
|
|
2690
|
+
"tagCommand": "functions"
|
|
2691
|
+
},
|
|
2692
|
+
{
|
|
2693
|
+
"binaryResponse": false,
|
|
2694
|
+
"bodyRequired": false,
|
|
2695
|
+
"command": "delete-function-secret",
|
|
2696
|
+
"description": "Removes the secret. The binding stays live in the running\nhandler until the next deploy refreshes the binding set\n(`PUT /functions/{id}` with the existing code is sufficient).\nReturns 404 if the key did not exist. Managed system keys\ncannot be deleted.\n",
|
|
2697
|
+
"hasJsonBody": false,
|
|
2698
|
+
"method": "DELETE",
|
|
2699
|
+
"operationId": "deleteFunctionSecret",
|
|
2700
|
+
"path": "/functions/{id}/secrets/{key}",
|
|
2701
|
+
"pathParams": [
|
|
2702
|
+
{
|
|
2703
|
+
"description": "Resource UUID",
|
|
2704
|
+
"enum": null,
|
|
2705
|
+
"name": "id",
|
|
2706
|
+
"required": true,
|
|
2707
|
+
"type": "string"
|
|
2708
|
+
},
|
|
2709
|
+
{
|
|
2710
|
+
"description": "Secret key. Must match `^[A-Z_][A-Z0-9_]*$`.",
|
|
2711
|
+
"enum": null,
|
|
2712
|
+
"name": "key",
|
|
2713
|
+
"required": true,
|
|
2714
|
+
"type": "string"
|
|
2715
|
+
}
|
|
2716
|
+
],
|
|
2717
|
+
"queryParams": [],
|
|
2718
|
+
"requestSchema": null,
|
|
2719
|
+
"responseSchema": null,
|
|
2720
|
+
"sdkName": "deleteFunctionSecret",
|
|
2721
|
+
"summary": "Delete a secret",
|
|
2722
|
+
"tag": "Functions",
|
|
2723
|
+
"tagCommand": "functions"
|
|
2724
|
+
},
|
|
2725
|
+
{
|
|
2726
|
+
"binaryResponse": false,
|
|
2727
|
+
"bodyRequired": false,
|
|
2728
|
+
"command": "get-function",
|
|
2729
|
+
"description": "Returns the full record for a function, including its current\nsource code and the deploy status / error from the most recent\ndeploy attempt.\n",
|
|
2730
|
+
"hasJsonBody": false,
|
|
2731
|
+
"method": "GET",
|
|
2732
|
+
"operationId": "getFunction",
|
|
2733
|
+
"path": "/functions/{id}",
|
|
2734
|
+
"pathParams": [
|
|
2735
|
+
{
|
|
2736
|
+
"description": "Resource UUID",
|
|
2737
|
+
"enum": null,
|
|
2738
|
+
"name": "id",
|
|
2739
|
+
"required": true,
|
|
2740
|
+
"type": "string"
|
|
2741
|
+
}
|
|
2742
|
+
],
|
|
2743
|
+
"queryParams": [],
|
|
2744
|
+
"requestSchema": null,
|
|
2745
|
+
"responseSchema": {
|
|
2746
|
+
"type": "object",
|
|
2747
|
+
"description": "Full function record returned by GET / PUT.",
|
|
2748
|
+
"properties": {
|
|
2749
|
+
"id": {
|
|
2750
|
+
"type": "string",
|
|
2751
|
+
"format": "uuid"
|
|
2752
|
+
},
|
|
2753
|
+
"name": {
|
|
2754
|
+
"type": "string"
|
|
2755
|
+
},
|
|
2756
|
+
"code": {
|
|
2757
|
+
"type": "string",
|
|
2758
|
+
"description": "The bundled handler source. UTF-8 string up to 1 MiB. The\nsame value most recently passed as `code` to POST or PUT.\n"
|
|
2759
|
+
},
|
|
2760
|
+
"deploy_status": {
|
|
2761
|
+
"type": "string",
|
|
2762
|
+
"enum": [
|
|
2763
|
+
"pending",
|
|
2764
|
+
"deployed",
|
|
2765
|
+
"failed"
|
|
2766
|
+
],
|
|
2767
|
+
"description": "Lifecycle state of the latest deploy attempt:\n * `pending` — deploy in flight; the runtime has not yet\n confirmed the new bundle is live.\n * `deployed` — the running edge handler is the latest code.\n * `failed` — the most recent deploy attempt failed; the\n previously-live code (if any) is still running. The\n `deploy_error` field carries the error message.\n"
|
|
2768
|
+
},
|
|
2769
|
+
"deploy_error": {
|
|
2770
|
+
"type": [
|
|
2771
|
+
"string",
|
|
2772
|
+
"null"
|
|
2773
|
+
],
|
|
2774
|
+
"description": "Error message from the most recent failed deploy, or null\nafter a successful deploy. Surface this to users to explain\na `failed` status without polling.\n"
|
|
2775
|
+
},
|
|
2776
|
+
"deployed_at": {
|
|
2777
|
+
"type": [
|
|
2778
|
+
"string",
|
|
2779
|
+
"null"
|
|
2780
|
+
],
|
|
2781
|
+
"format": "date-time"
|
|
2782
|
+
},
|
|
2783
|
+
"gateway_url": {
|
|
2784
|
+
"type": "string",
|
|
2785
|
+
"format": "uri"
|
|
2786
|
+
},
|
|
2787
|
+
"created_at": {
|
|
2788
|
+
"type": "string",
|
|
2789
|
+
"format": "date-time"
|
|
2790
|
+
},
|
|
2791
|
+
"updated_at": {
|
|
2792
|
+
"type": "string",
|
|
2793
|
+
"format": "date-time"
|
|
2794
|
+
}
|
|
2795
|
+
},
|
|
2796
|
+
"required": [
|
|
2797
|
+
"id",
|
|
2798
|
+
"name",
|
|
2799
|
+
"code",
|
|
2800
|
+
"deploy_status",
|
|
2801
|
+
"gateway_url",
|
|
2802
|
+
"created_at",
|
|
2803
|
+
"updated_at"
|
|
2804
|
+
]
|
|
2805
|
+
},
|
|
2806
|
+
"sdkName": "getFunction",
|
|
2807
|
+
"summary": "Get a function",
|
|
2808
|
+
"tag": "Functions",
|
|
2809
|
+
"tagCommand": "functions"
|
|
2810
|
+
},
|
|
2811
|
+
{
|
|
2812
|
+
"binaryResponse": false,
|
|
2813
|
+
"bodyRequired": false,
|
|
2814
|
+
"command": "list-function-secrets",
|
|
2815
|
+
"description": "Returns metadata for every secret bound to the function, with\nmanaged entries (provisioned by Primitive) listed first and\nuser-set entries listed alphabetically after. **Values are\nnever returned.** Secret writes are write-only.\n\nManaged entries (e.g. `PRIMITIVE_WEBHOOK_SECRET`,\n`PRIMITIVE_API_KEY`) carry a `description` instead of\n`created_at` / `updated_at`. They cannot be created, updated,\nor deleted via this API.\n",
|
|
2816
|
+
"hasJsonBody": false,
|
|
2817
|
+
"method": "GET",
|
|
2818
|
+
"operationId": "listFunctionSecrets",
|
|
2819
|
+
"path": "/functions/{id}/secrets",
|
|
2820
|
+
"pathParams": [
|
|
2821
|
+
{
|
|
2822
|
+
"description": "Resource UUID",
|
|
2823
|
+
"enum": null,
|
|
2824
|
+
"name": "id",
|
|
2825
|
+
"required": true,
|
|
2826
|
+
"type": "string"
|
|
2827
|
+
}
|
|
2828
|
+
],
|
|
2829
|
+
"queryParams": [],
|
|
2830
|
+
"requestSchema": null,
|
|
2831
|
+
"responseSchema": {
|
|
2832
|
+
"type": "object",
|
|
2833
|
+
"properties": {
|
|
2834
|
+
"items": {
|
|
2835
|
+
"type": "array",
|
|
2836
|
+
"items": {
|
|
2837
|
+
"type": "object",
|
|
2838
|
+
"description": "One row from GET /functions/{id}/secrets. Discriminate on the\n`managed` field:\n * `managed = true` — system secret provisioned by Primitive.\n `description` is set; `created_at` / `updated_at` are\n null because the row is virtual (resolved at deploy time\n from the managed registry, not stored in the secrets\n table).\n * `managed = false` — secret the user set via the API.\n `created_at` / `updated_at` are set; `description` is\n null.\n",
|
|
2839
|
+
"properties": {
|
|
2840
|
+
"key": {
|
|
2841
|
+
"type": "string"
|
|
2842
|
+
},
|
|
2843
|
+
"managed": {
|
|
2844
|
+
"type": "boolean",
|
|
2845
|
+
"description": "True for managed system secrets, false for user-set entries."
|
|
2846
|
+
},
|
|
2847
|
+
"description": {
|
|
2848
|
+
"type": [
|
|
2849
|
+
"string",
|
|
2850
|
+
"null"
|
|
2851
|
+
],
|
|
2852
|
+
"description": "Set on managed entries only; null on user-set entries."
|
|
2853
|
+
},
|
|
2854
|
+
"created_at": {
|
|
2855
|
+
"type": [
|
|
2856
|
+
"string",
|
|
2857
|
+
"null"
|
|
2858
|
+
],
|
|
2859
|
+
"format": "date-time",
|
|
2860
|
+
"description": "Set on user-set entries only; null on managed entries."
|
|
2861
|
+
},
|
|
2862
|
+
"updated_at": {
|
|
2863
|
+
"type": [
|
|
2864
|
+
"string",
|
|
2865
|
+
"null"
|
|
2866
|
+
],
|
|
2867
|
+
"format": "date-time",
|
|
2868
|
+
"description": "Set on user-set entries only; null on managed entries."
|
|
2869
|
+
}
|
|
2870
|
+
},
|
|
2871
|
+
"required": [
|
|
2872
|
+
"key",
|
|
2873
|
+
"managed"
|
|
2874
|
+
]
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2877
|
+
},
|
|
2878
|
+
"required": [
|
|
2879
|
+
"items"
|
|
2880
|
+
]
|
|
2881
|
+
},
|
|
2882
|
+
"sdkName": "listFunctionSecrets",
|
|
2883
|
+
"summary": "List a function's secrets",
|
|
2884
|
+
"tag": "Functions",
|
|
2885
|
+
"tagCommand": "functions"
|
|
2886
|
+
},
|
|
2887
|
+
{
|
|
2888
|
+
"binaryResponse": false,
|
|
2889
|
+
"bodyRequired": false,
|
|
2890
|
+
"command": "list-functions",
|
|
2891
|
+
"description": "Returns every active (non-deleted) function in the org, newest\nfirst. Each entry carries the deploy status and the gateway URL\nthat the platform's webhook delivery loop posts to. To inspect\nthe source code or deploy errors, use `GET /functions/{id}`.\n",
|
|
2892
|
+
"hasJsonBody": false,
|
|
2893
|
+
"method": "GET",
|
|
2894
|
+
"operationId": "listFunctions",
|
|
2895
|
+
"path": "/functions",
|
|
2896
|
+
"pathParams": [],
|
|
2897
|
+
"queryParams": [],
|
|
2898
|
+
"requestSchema": null,
|
|
2899
|
+
"responseSchema": {
|
|
2900
|
+
"type": "array",
|
|
2901
|
+
"items": {
|
|
2902
|
+
"type": "object",
|
|
2903
|
+
"description": "One row from the function listing.",
|
|
2904
|
+
"properties": {
|
|
2905
|
+
"id": {
|
|
2906
|
+
"type": "string",
|
|
2907
|
+
"format": "uuid",
|
|
2908
|
+
"description": "Function id, also the script name in the edge runtime."
|
|
2909
|
+
},
|
|
2910
|
+
"name": {
|
|
2911
|
+
"type": "string",
|
|
2912
|
+
"description": "Slug-style name set on creation. Stable; cannot be changed."
|
|
2913
|
+
},
|
|
2914
|
+
"deploy_status": {
|
|
2915
|
+
"type": "string",
|
|
2916
|
+
"enum": [
|
|
2917
|
+
"pending",
|
|
2918
|
+
"deployed",
|
|
2919
|
+
"failed"
|
|
2920
|
+
],
|
|
2921
|
+
"description": "Lifecycle state of the latest deploy attempt:\n * `pending` — deploy in flight; the runtime has not yet\n confirmed the new bundle is live.\n * `deployed` — the running edge handler is the latest code.\n * `failed` — the most recent deploy attempt failed; the\n previously-live code (if any) is still running. The\n `deploy_error` field carries the error message.\n"
|
|
2922
|
+
},
|
|
2923
|
+
"deployed_at": {
|
|
2924
|
+
"type": [
|
|
2925
|
+
"string",
|
|
2926
|
+
"null"
|
|
2927
|
+
],
|
|
2928
|
+
"format": "date-time",
|
|
2929
|
+
"description": "Timestamp of the most recent successful deploy. Null until the first deploy succeeds."
|
|
2930
|
+
},
|
|
2931
|
+
"gateway_url": {
|
|
2932
|
+
"type": "string",
|
|
2933
|
+
"format": "uri",
|
|
2934
|
+
"description": "URL the platform's webhook delivery loop posts to in order\nto invoke the function. Reference only; not directly\ncallable from outside.\n"
|
|
2935
|
+
},
|
|
2936
|
+
"created_at": {
|
|
2937
|
+
"type": "string",
|
|
2938
|
+
"format": "date-time"
|
|
2939
|
+
},
|
|
2940
|
+
"updated_at": {
|
|
2941
|
+
"type": "string",
|
|
2942
|
+
"format": "date-time"
|
|
2943
|
+
}
|
|
2944
|
+
},
|
|
2945
|
+
"required": [
|
|
2946
|
+
"id",
|
|
2947
|
+
"name",
|
|
2948
|
+
"deploy_status",
|
|
2949
|
+
"gateway_url",
|
|
2950
|
+
"created_at",
|
|
2951
|
+
"updated_at"
|
|
2952
|
+
]
|
|
2953
|
+
}
|
|
2954
|
+
},
|
|
2955
|
+
"sdkName": "listFunctions",
|
|
2956
|
+
"summary": "List functions",
|
|
2957
|
+
"tag": "Functions",
|
|
2958
|
+
"tagCommand": "functions"
|
|
2959
|
+
},
|
|
2960
|
+
{
|
|
2961
|
+
"binaryResponse": false,
|
|
2962
|
+
"bodyRequired": true,
|
|
2963
|
+
"command": "set-function-secret",
|
|
2964
|
+
"description": "Path-keyed companion to `POST /functions/{id}/secrets`.\nIdempotent: returns 201 the first time the key is set, 200 on\nsubsequent updates. Same validation rules and same write-only\nguarantees as the POST verb; the new value lands in the running\nhandler on the next deploy.\n",
|
|
2965
|
+
"hasJsonBody": true,
|
|
2966
|
+
"method": "PUT",
|
|
2967
|
+
"operationId": "setFunctionSecret",
|
|
2968
|
+
"path": "/functions/{id}/secrets/{key}",
|
|
2969
|
+
"pathParams": [
|
|
2970
|
+
{
|
|
2971
|
+
"description": "Resource UUID",
|
|
2972
|
+
"enum": null,
|
|
2973
|
+
"name": "id",
|
|
2974
|
+
"required": true,
|
|
2975
|
+
"type": "string"
|
|
2976
|
+
},
|
|
2977
|
+
{
|
|
2978
|
+
"description": "Secret key. Must match `^[A-Z_][A-Z0-9_]*$`.",
|
|
2979
|
+
"enum": null,
|
|
2980
|
+
"name": "key",
|
|
2981
|
+
"required": true,
|
|
2982
|
+
"type": "string"
|
|
2983
|
+
}
|
|
2984
|
+
],
|
|
2985
|
+
"queryParams": [],
|
|
2986
|
+
"requestSchema": {
|
|
2987
|
+
"type": "object",
|
|
2988
|
+
"additionalProperties": false,
|
|
2989
|
+
"description": "Body for PUT /functions/{id}/secrets/{key}. Key comes from the path.",
|
|
2990
|
+
"properties": {
|
|
2991
|
+
"value": {
|
|
2992
|
+
"type": "string",
|
|
2993
|
+
"minLength": 1,
|
|
2994
|
+
"maxLength": 4096
|
|
2995
|
+
}
|
|
2996
|
+
},
|
|
2997
|
+
"required": [
|
|
2998
|
+
"value"
|
|
2999
|
+
]
|
|
3000
|
+
},
|
|
3001
|
+
"responseSchema": {
|
|
3002
|
+
"type": "object",
|
|
3003
|
+
"description": "Returned by POST and PUT secret routes.",
|
|
3004
|
+
"properties": {
|
|
3005
|
+
"key": {
|
|
3006
|
+
"type": "string"
|
|
3007
|
+
},
|
|
3008
|
+
"created_at": {
|
|
3009
|
+
"type": "string",
|
|
3010
|
+
"format": "date-time"
|
|
3011
|
+
},
|
|
3012
|
+
"updated_at": {
|
|
3013
|
+
"type": "string",
|
|
3014
|
+
"format": "date-time"
|
|
3015
|
+
},
|
|
3016
|
+
"created": {
|
|
3017
|
+
"type": "boolean",
|
|
3018
|
+
"description": "True if this call inserted a new row, false if it updated an existing one."
|
|
3019
|
+
}
|
|
3020
|
+
},
|
|
3021
|
+
"required": [
|
|
3022
|
+
"key",
|
|
3023
|
+
"created_at",
|
|
3024
|
+
"updated_at",
|
|
3025
|
+
"created"
|
|
3026
|
+
]
|
|
3027
|
+
},
|
|
3028
|
+
"sdkName": "setFunctionSecret",
|
|
3029
|
+
"summary": "Set a secret by key",
|
|
3030
|
+
"tag": "Functions",
|
|
3031
|
+
"tagCommand": "functions"
|
|
3032
|
+
},
|
|
3033
|
+
{
|
|
3034
|
+
"binaryResponse": false,
|
|
3035
|
+
"bodyRequired": false,
|
|
3036
|
+
"command": "test-function",
|
|
3037
|
+
"description": "Sends a real test email from a Primitive-controlled sender to a\nsynthetic local-part on one of the org's verified inbound\ndomains. The function fires through the normal MX delivery\npath, so reply / send-mail calls from inside the handler\nagainst the inbound's `email.id` work the same as in\nproduction. Returns immediately after the send is queued; the\ninvocation appears on the function's invocations list within a\nfew seconds.\n\nRequires that the function is currently `deployed`. Returns 422\nif the function is in `pending` or `failed` state, or if the\norg has no verified inbound domain to receive the test mail.\n",
|
|
3038
|
+
"hasJsonBody": false,
|
|
3039
|
+
"method": "POST",
|
|
3040
|
+
"operationId": "testFunction",
|
|
3041
|
+
"path": "/functions/{id}/test",
|
|
3042
|
+
"pathParams": [
|
|
3043
|
+
{
|
|
3044
|
+
"description": "Resource UUID",
|
|
3045
|
+
"enum": null,
|
|
3046
|
+
"name": "id",
|
|
3047
|
+
"required": true,
|
|
3048
|
+
"type": "string"
|
|
3049
|
+
}
|
|
3050
|
+
],
|
|
3051
|
+
"queryParams": [],
|
|
3052
|
+
"requestSchema": null,
|
|
3053
|
+
"responseSchema": {
|
|
3054
|
+
"type": "object",
|
|
3055
|
+
"description": "Metadata returned by POST /functions/{id}/test. The send is\nqueued; the actual invocation lands on the function's\ninvocations list a few seconds later as the inbound mail\ntraverses the MX path.\n",
|
|
3056
|
+
"properties": {
|
|
3057
|
+
"inbound_domain": {
|
|
3058
|
+
"type": "string",
|
|
3059
|
+
"description": "Verified inbound domain the test email was sent to."
|
|
3060
|
+
},
|
|
3061
|
+
"to": {
|
|
3062
|
+
"type": "string",
|
|
3063
|
+
"description": "Synthetic local-part plus inbound_domain. Visible in the org's inbox."
|
|
3064
|
+
},
|
|
3065
|
+
"from": {
|
|
3066
|
+
"type": "string",
|
|
3067
|
+
"description": "Primitive-controlled outbound sender used for the test."
|
|
3068
|
+
},
|
|
3069
|
+
"send_id": {
|
|
3070
|
+
"type": "string",
|
|
3071
|
+
"description": "Outbound message id from the underlying send. NOT the\ninbound email's id; the inbound id is created when the\nemail arrives via MX and lands on the function's\ninvocations list.\n"
|
|
3072
|
+
},
|
|
3073
|
+
"subject": {
|
|
3074
|
+
"type": "string",
|
|
3075
|
+
"description": "Subject placed on the test email so it can be located in the inbox."
|
|
3076
|
+
},
|
|
3077
|
+
"poll_since": {
|
|
3078
|
+
"type": "string",
|
|
3079
|
+
"format": "date-time",
|
|
3080
|
+
"description": "ISO timestamp suitable as a `since` lower bound when\npolling /emails for the inbound's arrival. Captured\nslightly before the send to absorb light clock skew.\n"
|
|
3081
|
+
},
|
|
3082
|
+
"watch_url": {
|
|
3083
|
+
"type": "string",
|
|
3084
|
+
"format": "uri",
|
|
3085
|
+
"description": "Function detail page where invocations show up live."
|
|
3086
|
+
}
|
|
3087
|
+
},
|
|
3088
|
+
"required": [
|
|
3089
|
+
"inbound_domain",
|
|
3090
|
+
"to",
|
|
3091
|
+
"from",
|
|
3092
|
+
"send_id",
|
|
3093
|
+
"subject",
|
|
3094
|
+
"poll_since",
|
|
3095
|
+
"watch_url"
|
|
3096
|
+
]
|
|
3097
|
+
},
|
|
3098
|
+
"sdkName": "testFunction",
|
|
3099
|
+
"summary": "Send a test invocation",
|
|
3100
|
+
"tag": "Functions",
|
|
3101
|
+
"tagCommand": "functions"
|
|
3102
|
+
},
|
|
3103
|
+
{
|
|
3104
|
+
"binaryResponse": false,
|
|
3105
|
+
"bodyRequired": true,
|
|
3106
|
+
"command": "update-function",
|
|
3107
|
+
"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 a 502 deploy failure, the previously-deployed code stays\nlive; the runtime never serves a half-built bundle. The\n`deploy_error` field on the returned record carries the error\nthat came back from the runtime so you can surface it to users\nwithout polling.\n",
|
|
3108
|
+
"hasJsonBody": true,
|
|
3109
|
+
"method": "PUT",
|
|
3110
|
+
"operationId": "updateFunction",
|
|
3111
|
+
"path": "/functions/{id}",
|
|
3112
|
+
"pathParams": [
|
|
3113
|
+
{
|
|
3114
|
+
"description": "Resource UUID",
|
|
3115
|
+
"enum": null,
|
|
3116
|
+
"name": "id",
|
|
3117
|
+
"required": true,
|
|
3118
|
+
"type": "string"
|
|
3119
|
+
}
|
|
3120
|
+
],
|
|
3121
|
+
"queryParams": [],
|
|
3122
|
+
"requestSchema": {
|
|
3123
|
+
"type": "object",
|
|
3124
|
+
"additionalProperties": false,
|
|
3125
|
+
"properties": {
|
|
3126
|
+
"code": {
|
|
3127
|
+
"type": "string",
|
|
3128
|
+
"minLength": 1,
|
|
3129
|
+
"maxLength": 1048576,
|
|
3130
|
+
"description": "New bundled handler. Same rules as CreateFunctionInput.code."
|
|
3131
|
+
},
|
|
3132
|
+
"sourceMap": {
|
|
3133
|
+
"type": "string",
|
|
3134
|
+
"minLength": 1,
|
|
3135
|
+
"maxLength": 5242880
|
|
3136
|
+
}
|
|
3137
|
+
},
|
|
3138
|
+
"required": [
|
|
3139
|
+
"code"
|
|
3140
|
+
]
|
|
3141
|
+
},
|
|
3142
|
+
"responseSchema": {
|
|
3143
|
+
"type": "object",
|
|
3144
|
+
"description": "Full function record returned by GET / PUT.",
|
|
3145
|
+
"properties": {
|
|
3146
|
+
"id": {
|
|
3147
|
+
"type": "string",
|
|
3148
|
+
"format": "uuid"
|
|
3149
|
+
},
|
|
3150
|
+
"name": {
|
|
3151
|
+
"type": "string"
|
|
3152
|
+
},
|
|
3153
|
+
"code": {
|
|
3154
|
+
"type": "string",
|
|
3155
|
+
"description": "The bundled handler source. UTF-8 string up to 1 MiB. The\nsame value most recently passed as `code` to POST or PUT.\n"
|
|
3156
|
+
},
|
|
3157
|
+
"deploy_status": {
|
|
3158
|
+
"type": "string",
|
|
3159
|
+
"enum": [
|
|
3160
|
+
"pending",
|
|
3161
|
+
"deployed",
|
|
3162
|
+
"failed"
|
|
3163
|
+
],
|
|
3164
|
+
"description": "Lifecycle state of the latest deploy attempt:\n * `pending` — deploy in flight; the runtime has not yet\n confirmed the new bundle is live.\n * `deployed` — the running edge handler is the latest code.\n * `failed` — the most recent deploy attempt failed; the\n previously-live code (if any) is still running. The\n `deploy_error` field carries the error message.\n"
|
|
3165
|
+
},
|
|
3166
|
+
"deploy_error": {
|
|
3167
|
+
"type": [
|
|
3168
|
+
"string",
|
|
3169
|
+
"null"
|
|
3170
|
+
],
|
|
3171
|
+
"description": "Error message from the most recent failed deploy, or null\nafter a successful deploy. Surface this to users to explain\na `failed` status without polling.\n"
|
|
3172
|
+
},
|
|
3173
|
+
"deployed_at": {
|
|
3174
|
+
"type": [
|
|
3175
|
+
"string",
|
|
3176
|
+
"null"
|
|
3177
|
+
],
|
|
3178
|
+
"format": "date-time"
|
|
3179
|
+
},
|
|
3180
|
+
"gateway_url": {
|
|
3181
|
+
"type": "string",
|
|
3182
|
+
"format": "uri"
|
|
3183
|
+
},
|
|
3184
|
+
"created_at": {
|
|
3185
|
+
"type": "string",
|
|
3186
|
+
"format": "date-time"
|
|
3187
|
+
},
|
|
3188
|
+
"updated_at": {
|
|
3189
|
+
"type": "string",
|
|
3190
|
+
"format": "date-time"
|
|
3191
|
+
}
|
|
3192
|
+
},
|
|
3193
|
+
"required": [
|
|
3194
|
+
"id",
|
|
3195
|
+
"name",
|
|
3196
|
+
"code",
|
|
3197
|
+
"deploy_status",
|
|
3198
|
+
"gateway_url",
|
|
3199
|
+
"created_at",
|
|
3200
|
+
"updated_at"
|
|
3201
|
+
]
|
|
3202
|
+
},
|
|
3203
|
+
"sdkName": "updateFunction",
|
|
3204
|
+
"summary": "Update and redeploy a function",
|
|
3205
|
+
"tag": "Functions",
|
|
3206
|
+
"tagCommand": "functions"
|
|
3207
|
+
},
|
|
2214
3208
|
{
|
|
2215
3209
|
"binaryResponse": false,
|
|
2216
3210
|
"bodyRequired": false,
|
|
@@ -3131,7 +4125,7 @@ export const operationManifest = [
|
|
|
3131
4125
|
"binaryResponse": false,
|
|
3132
4126
|
"bodyRequired": true,
|
|
3133
4127
|
"command": "send-email",
|
|
3134
|
-
"description": "Sends an outbound email through Primitive's outbound relay. By default\nthe request returns once the relay accepts the message for delivery.\nSet `wait: true` to wait for the first downstream SMTP delivery outcome.\n",
|
|
4128
|
+
"description": "Sends an outbound email through Primitive's outbound relay. By default\nthe request returns once the relay accepts the message for delivery.\nSet `wait: true` to wait for the first downstream SMTP delivery outcome.\n\n**Host routing.** /send-mail is served by the attachments-\nsupporting host (`https://api.primitive.dev/v1`) so the\nrequest body can carry inline attachments up to ~30 MiB raw.\nThe primary host (`https://www.primitive.dev/api/v1`) also\naccepts /send-mail for attachment-free sends; sends WITH\nattachments to the primary host return 413\n`attachments_unsupported_on_this_endpoint`. The typed SDKs\nroute /send-mail to the attachments host automatically.\n",
|
|
3135
4129
|
"hasJsonBody": true,
|
|
3136
4130
|
"method": "POST",
|
|
3137
4131
|
"operationId": "sendEmail",
|