@primitivedotdev/sdk 0.35.3 → 0.37.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 +2 -2
- package/dist/api/index.js +3 -3
- package/dist/{api-sEVL575r.js → api-Cxq2cH8Q.js} +87 -7
- package/dist/{index-C0seY6MO.d.ts → index-9uc511Ei.d.ts} +264 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/openapi/index.js +1 -1
- package/dist/{operations.generated-CgJWP2sH.js → operations.generated-CsHewGFi.js} +574 -4
- package/package.json +1 -1
|
@@ -1668,7 +1668,7 @@ const openapiDocument = {
|
|
|
1668
1668
|
"post": {
|
|
1669
1669
|
"operationId": "createFunction",
|
|
1670
1670
|
"summary": "Deploy a function",
|
|
1671
|
-
"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). Primitive signs\neach delivery and forwards the `Primitive-Signature` header to\nthe handler. Verify the raw request body with\n`PRIMITIVE_WEBHOOK_SECRET` before parsing JSON; after verification\nthe request body parses to an `email.received` event (see\n`EmailReceivedEvent` and the Webhook payload section for the full\nschema). Code is bundled before being uploaded; ship a single\nself-contained file rather than 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**
|
|
1671
|
+
"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). Primitive signs\neach delivery and forwards the `Primitive-Signature` header to\nthe handler. Verify the raw request body with\n`PRIMITIVE_WEBHOOK_SECRET` before parsing JSON; after verification\nthe request body parses to an `email.received` event (see\n`EmailReceivedEvent` and the Webhook payload section for the full\nschema). Code is bundled before being uploaded; ship a single\nself-contained file rather than 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**Routing.** On successful deploy, the function code is live\nin the runtime, but inbound mail will not reach it until at\nleast one route is bound. Routes are managed from the Primitive\ndashboard. A `deploy_status` of `deployed` means the script is\ninstalled, not that the function is receiving mail. The\ninternal runtime URL is not returned by the API and is not a\ncustomer-facing integration surface.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`,\n`PRIMITIVE_API_BASE_URL`) already bound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n",
|
|
1672
1672
|
"tags": ["Functions"],
|
|
1673
1673
|
"requestBody": {
|
|
1674
1674
|
"required": true,
|
|
@@ -1747,7 +1747,7 @@ const openapiDocument = {
|
|
|
1747
1747
|
"delete": {
|
|
1748
1748
|
"operationId": "deleteFunction",
|
|
1749
1749
|
"summary": "Delete a function",
|
|
1750
|
-
"description": "Soft-deletes the function row, removes the script from the edge\nruntime, and deactivates
|
|
1750
|
+
"description": "Soft-deletes the function row, removes the script from the edge\nruntime, and deactivates any route bound to this function 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",
|
|
1751
1751
|
"tags": ["Functions"],
|
|
1752
1752
|
"responses": {
|
|
1753
1753
|
"200": { "$ref": "#/components/responses/Deleted" },
|
|
@@ -1832,6 +1832,92 @@ const openapiDocument = {
|
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
1834
1834
|
},
|
|
1835
|
+
"/functions/routing-topology": { "get": {
|
|
1836
|
+
"operationId": "getOrgRoutingTopology",
|
|
1837
|
+
"summary": "Get the org's function routing topology",
|
|
1838
|
+
"description": "Returns a single snapshot of how inbound mail is routed across\nthis org's active domains and functions: which active domain has\nwhich function bound, the org's fallback function (if any), and\nevery deployed function with no route bound. Use this to answer\n\"which of my functions actually receive mail?\" diagnostically.\n",
|
|
1839
|
+
"tags": ["Functions"],
|
|
1840
|
+
"responses": {
|
|
1841
|
+
"200": {
|
|
1842
|
+
"description": "Routing topology",
|
|
1843
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
1844
|
+
"type": "object",
|
|
1845
|
+
"properties": { "data": { "$ref": "#/components/schemas/RoutingTopology" } }
|
|
1846
|
+
}] } } }
|
|
1847
|
+
},
|
|
1848
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
1849
|
+
"403": { "$ref": "#/components/responses/Forbidden" }
|
|
1850
|
+
}
|
|
1851
|
+
} },
|
|
1852
|
+
"/functions/{id}/routing": {
|
|
1853
|
+
"parameters": [{ "$ref": "#/components/parameters/ResourceId" }],
|
|
1854
|
+
"get": {
|
|
1855
|
+
"operationId": "getFunctionRouting",
|
|
1856
|
+
"summary": "Get a function's current route binding",
|
|
1857
|
+
"description": "Returns the endpoint binding for the function, or null when no\nroute is currently bound. The binding identifies whether the\nfunction receives mail for a specific domain (scoped) or for any\nactive domain that has no scoped binding (fallback).\n",
|
|
1858
|
+
"tags": ["Functions"],
|
|
1859
|
+
"responses": {
|
|
1860
|
+
"200": {
|
|
1861
|
+
"description": "Function routing",
|
|
1862
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
1863
|
+
"type": "object",
|
|
1864
|
+
"properties": { "data": { "oneOf": [{ "$ref": "#/components/schemas/FunctionRouting" }, { "type": "null" }] } }
|
|
1865
|
+
}] } } }
|
|
1866
|
+
},
|
|
1867
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
1868
|
+
"404": { "$ref": "#/components/responses/NotFound" }
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
},
|
|
1872
|
+
"/functions/{id}/route": {
|
|
1873
|
+
"parameters": [{ "$ref": "#/components/parameters/ResourceId" }],
|
|
1874
|
+
"put": {
|
|
1875
|
+
"operationId": "setFunctionRoute",
|
|
1876
|
+
"summary": "Bind a route to a function",
|
|
1877
|
+
"description": "Binds inbound mail to this function. The route target is either\na specific verified domain (scoped) or the org's fallback (any\nactive domain with no scoped binding). If another function is\nalready bound at the target, returns a `conflict` envelope\ndescribing the holder; re-issue with `takeover: true` to\ndeactivate that prior binding and install this one.\n",
|
|
1878
|
+
"tags": ["Functions"],
|
|
1879
|
+
"requestBody": {
|
|
1880
|
+
"required": true,
|
|
1881
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/FunctionRouteBody" } } }
|
|
1882
|
+
},
|
|
1883
|
+
"responses": {
|
|
1884
|
+
"200": {
|
|
1885
|
+
"description": "Route bound, or conflict requiring takeover",
|
|
1886
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
1887
|
+
"type": "object",
|
|
1888
|
+
"properties": { "data": { "$ref": "#/components/schemas/FunctionRouteResult" } }
|
|
1889
|
+
}] } } }
|
|
1890
|
+
},
|
|
1891
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
1892
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
1893
|
+
"404": { "$ref": "#/components/responses/NotFound" }
|
|
1894
|
+
}
|
|
1895
|
+
},
|
|
1896
|
+
"delete": {
|
|
1897
|
+
"operationId": "unsetFunctionRoute",
|
|
1898
|
+
"summary": "Unbind any route from a function",
|
|
1899
|
+
"description": "Deactivates every active endpoint bound to this function. The\nfunction stays deployed but stops receiving inbound mail. Safe\nto call when no route is currently bound (no-op).\n",
|
|
1900
|
+
"tags": ["Functions"],
|
|
1901
|
+
"responses": {
|
|
1902
|
+
"200": {
|
|
1903
|
+
"description": "Route unbound",
|
|
1904
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
1905
|
+
"type": "object",
|
|
1906
|
+
"properties": { "data": {
|
|
1907
|
+
"type": "object",
|
|
1908
|
+
"properties": { "unrouted": {
|
|
1909
|
+
"type": "boolean",
|
|
1910
|
+
"enum": [true]
|
|
1911
|
+
} },
|
|
1912
|
+
"required": ["unrouted"]
|
|
1913
|
+
} }
|
|
1914
|
+
}] } } }
|
|
1915
|
+
},
|
|
1916
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
1917
|
+
"404": { "$ref": "#/components/responses/NotFound" }
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
},
|
|
1835
1921
|
"/functions/{id}/secrets": {
|
|
1836
1922
|
"parameters": [{ "$ref": "#/components/parameters/ResourceId" }],
|
|
1837
1923
|
"get": {
|
|
@@ -5357,6 +5443,178 @@ const openapiDocument = {
|
|
|
5357
5443
|
"trace_url"
|
|
5358
5444
|
]
|
|
5359
5445
|
},
|
|
5446
|
+
"FunctionRouting": {
|
|
5447
|
+
"type": "object",
|
|
5448
|
+
"description": "A single route binding for a function. `domain` is null when the\nbinding is the org's fallback (any active domain without a scoped\nbinding); otherwise it carries the scoped domain. `rules` is\nreserved for future routing predicates.\n",
|
|
5449
|
+
"properties": {
|
|
5450
|
+
"endpoint_id": {
|
|
5451
|
+
"type": "string",
|
|
5452
|
+
"format": "uuid"
|
|
5453
|
+
},
|
|
5454
|
+
"enabled": { "type": "boolean" },
|
|
5455
|
+
"domain": {
|
|
5456
|
+
"type": ["object", "null"],
|
|
5457
|
+
"properties": {
|
|
5458
|
+
"id": {
|
|
5459
|
+
"type": "string",
|
|
5460
|
+
"format": "uuid"
|
|
5461
|
+
},
|
|
5462
|
+
"name": { "type": ["string", "null"] }
|
|
5463
|
+
},
|
|
5464
|
+
"required": ["id"]
|
|
5465
|
+
},
|
|
5466
|
+
"rules": {
|
|
5467
|
+
"type": "object",
|
|
5468
|
+
"description": "Future routing predicates. Currently empty."
|
|
5469
|
+
},
|
|
5470
|
+
"delivery_count": { "type": "integer" },
|
|
5471
|
+
"success_count": { "type": "integer" },
|
|
5472
|
+
"failure_count": { "type": "integer" },
|
|
5473
|
+
"consecutive_fails": { "type": "integer" },
|
|
5474
|
+
"last_delivery_at": {
|
|
5475
|
+
"type": ["string", "null"],
|
|
5476
|
+
"format": "date-time"
|
|
5477
|
+
},
|
|
5478
|
+
"last_success_at": {
|
|
5479
|
+
"type": ["string", "null"],
|
|
5480
|
+
"format": "date-time"
|
|
5481
|
+
},
|
|
5482
|
+
"last_failure_at": {
|
|
5483
|
+
"type": ["string", "null"],
|
|
5484
|
+
"format": "date-time"
|
|
5485
|
+
}
|
|
5486
|
+
},
|
|
5487
|
+
"required": [
|
|
5488
|
+
"endpoint_id",
|
|
5489
|
+
"enabled",
|
|
5490
|
+
"domain",
|
|
5491
|
+
"rules"
|
|
5492
|
+
]
|
|
5493
|
+
},
|
|
5494
|
+
"RoutingTopology": {
|
|
5495
|
+
"type": "object",
|
|
5496
|
+
"description": "Org-wide map of function routing: which domain points at which\nfunction, the org's fallback binding (if any), and every\ndeployed function with no route currently bound.\n",
|
|
5497
|
+
"properties": {
|
|
5498
|
+
"domains": {
|
|
5499
|
+
"type": "array",
|
|
5500
|
+
"items": {
|
|
5501
|
+
"type": "object",
|
|
5502
|
+
"properties": {
|
|
5503
|
+
"domain_id": {
|
|
5504
|
+
"type": "string",
|
|
5505
|
+
"format": "uuid"
|
|
5506
|
+
},
|
|
5507
|
+
"domain": { "type": "string" },
|
|
5508
|
+
"routed_function": {
|
|
5509
|
+
"type": ["object", "null"],
|
|
5510
|
+
"properties": {
|
|
5511
|
+
"id": {
|
|
5512
|
+
"type": "string",
|
|
5513
|
+
"format": "uuid"
|
|
5514
|
+
},
|
|
5515
|
+
"name": { "type": "string" }
|
|
5516
|
+
},
|
|
5517
|
+
"required": ["id", "name"]
|
|
5518
|
+
},
|
|
5519
|
+
"endpoint_enabled": { "type": ["boolean", "null"] }
|
|
5520
|
+
},
|
|
5521
|
+
"required": [
|
|
5522
|
+
"domain_id",
|
|
5523
|
+
"domain",
|
|
5524
|
+
"routed_function",
|
|
5525
|
+
"endpoint_enabled"
|
|
5526
|
+
]
|
|
5527
|
+
}
|
|
5528
|
+
},
|
|
5529
|
+
"fallback_function": {
|
|
5530
|
+
"type": ["object", "null"],
|
|
5531
|
+
"properties": {
|
|
5532
|
+
"id": {
|
|
5533
|
+
"type": "string",
|
|
5534
|
+
"format": "uuid"
|
|
5535
|
+
},
|
|
5536
|
+
"name": { "type": "string" }
|
|
5537
|
+
},
|
|
5538
|
+
"required": ["id", "name"]
|
|
5539
|
+
},
|
|
5540
|
+
"fallback_enabled": { "type": ["boolean", "null"] },
|
|
5541
|
+
"unrouted_functions": {
|
|
5542
|
+
"type": "array",
|
|
5543
|
+
"items": {
|
|
5544
|
+
"type": "object",
|
|
5545
|
+
"properties": {
|
|
5546
|
+
"id": {
|
|
5547
|
+
"type": "string",
|
|
5548
|
+
"format": "uuid"
|
|
5549
|
+
},
|
|
5550
|
+
"name": { "type": "string" }
|
|
5551
|
+
},
|
|
5552
|
+
"required": ["id", "name"]
|
|
5553
|
+
}
|
|
5554
|
+
}
|
|
5555
|
+
},
|
|
5556
|
+
"required": [
|
|
5557
|
+
"domains",
|
|
5558
|
+
"fallback_function",
|
|
5559
|
+
"fallback_enabled",
|
|
5560
|
+
"unrouted_functions"
|
|
5561
|
+
]
|
|
5562
|
+
},
|
|
5563
|
+
"FunctionRouteBody": {
|
|
5564
|
+
"type": "object",
|
|
5565
|
+
"description": "Target for a route binding. Either a specific verified domain\n(scoped) or the org-wide fallback. Pass `takeover: true` to\ndeactivate any conflicting binding before installing this one.\n",
|
|
5566
|
+
"properties": {
|
|
5567
|
+
"target": { "oneOf": [{
|
|
5568
|
+
"type": "object",
|
|
5569
|
+
"properties": {
|
|
5570
|
+
"kind": {
|
|
5571
|
+
"type": "string",
|
|
5572
|
+
"enum": ["domain"]
|
|
5573
|
+
},
|
|
5574
|
+
"domainId": {
|
|
5575
|
+
"type": "string",
|
|
5576
|
+
"format": "uuid"
|
|
5577
|
+
}
|
|
5578
|
+
},
|
|
5579
|
+
"required": ["kind", "domainId"]
|
|
5580
|
+
}, {
|
|
5581
|
+
"type": "object",
|
|
5582
|
+
"properties": { "kind": {
|
|
5583
|
+
"type": "string",
|
|
5584
|
+
"enum": ["fallback"]
|
|
5585
|
+
} },
|
|
5586
|
+
"required": ["kind"]
|
|
5587
|
+
}] },
|
|
5588
|
+
"takeover": {
|
|
5589
|
+
"type": "boolean",
|
|
5590
|
+
"description": "When true, deactivate any conflicting binding before installing this one."
|
|
5591
|
+
}
|
|
5592
|
+
},
|
|
5593
|
+
"required": ["target"]
|
|
5594
|
+
},
|
|
5595
|
+
"FunctionRouteResult": {
|
|
5596
|
+
"type": "object",
|
|
5597
|
+
"description": "On success, carries the new `routing`. On conflict, carries\n`conflict` describing the binding holder so the caller can\nre-issue with `takeover: true`.\n",
|
|
5598
|
+
"properties": {
|
|
5599
|
+
"routing": { "oneOf": [{ "$ref": "#/components/schemas/FunctionRouting" }, { "type": "null" }] },
|
|
5600
|
+
"conflict": {
|
|
5601
|
+
"type": "object",
|
|
5602
|
+
"properties": {
|
|
5603
|
+
"kind": {
|
|
5604
|
+
"type": "string",
|
|
5605
|
+
"enum": ["http", "function"]
|
|
5606
|
+
},
|
|
5607
|
+
"functionId": {
|
|
5608
|
+
"type": ["string", "null"],
|
|
5609
|
+
"format": "uuid"
|
|
5610
|
+
},
|
|
5611
|
+
"functionName": { "type": ["string", "null"] },
|
|
5612
|
+
"url": { "type": ["string", "null"] }
|
|
5613
|
+
},
|
|
5614
|
+
"required": ["kind"]
|
|
5615
|
+
}
|
|
5616
|
+
}
|
|
5617
|
+
},
|
|
5360
5618
|
"FunctionTestRunState": {
|
|
5361
5619
|
"type": "string",
|
|
5362
5620
|
"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",
|
|
@@ -9072,7 +9330,7 @@ const operationManifest = [
|
|
|
9072
9330
|
"binaryResponse": false,
|
|
9073
9331
|
"bodyRequired": true,
|
|
9074
9332
|
"command": "create-function",
|
|
9075
|
-
"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). Primitive signs\neach delivery and forwards the `Primitive-Signature` header to\nthe handler. Verify the raw request body with\n`PRIMITIVE_WEBHOOK_SECRET` before parsing JSON; after verification\nthe request body parses to an `email.received` event (see\n`EmailReceivedEvent` and the Webhook payload section for the full\nschema). Code is bundled before being uploaded; ship a single\nself-contained file rather than 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**
|
|
9333
|
+
"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). Primitive signs\neach delivery and forwards the `Primitive-Signature` header to\nthe handler. Verify the raw request body with\n`PRIMITIVE_WEBHOOK_SECRET` before parsing JSON; after verification\nthe request body parses to an `email.received` event (see\n`EmailReceivedEvent` and the Webhook payload section for the full\nschema). Code is bundled before being uploaded; ship a single\nself-contained file rather than 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**Routing.** On successful deploy, the function code is live\nin the runtime, but inbound mail will not reach it until at\nleast one route is bound. Routes are managed from the Primitive\ndashboard. A `deploy_status` of `deployed` means the script is\ninstalled, not that the function is receiving mail. The\ninternal runtime URL is not returned by the API and is not a\ncustomer-facing integration surface.\n\n**Secrets.** New functions ship with the managed secrets\n(`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`,\n`PRIMITIVE_API_BASE_URL`) already bound. Add user-set secrets via\n`POST /functions/{id}/secrets`; secret writes only land in the\nrunning handler on the next redeploy.\n",
|
|
9076
9334
|
"hasJsonBody": true,
|
|
9077
9335
|
"method": "POST",
|
|
9078
9336
|
"operationId": "createFunction",
|
|
@@ -9208,7 +9466,7 @@ const operationManifest = [
|
|
|
9208
9466
|
"binaryResponse": false,
|
|
9209
9467
|
"bodyRequired": false,
|
|
9210
9468
|
"command": "delete-function",
|
|
9211
|
-
"description": "Soft-deletes the function row, removes the script from the edge\nruntime, and deactivates
|
|
9469
|
+
"description": "Soft-deletes the function row, removes the script from the edge\nruntime, and deactivates any route bound to this function 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",
|
|
9212
9470
|
"hasJsonBody": false,
|
|
9213
9471
|
"method": "DELETE",
|
|
9214
9472
|
"operationId": "deleteFunction",
|
|
@@ -9329,6 +9587,77 @@ const operationManifest = [
|
|
|
9329
9587
|
"tag": "Functions",
|
|
9330
9588
|
"tagCommand": "functions"
|
|
9331
9589
|
},
|
|
9590
|
+
{
|
|
9591
|
+
"binaryResponse": false,
|
|
9592
|
+
"bodyRequired": false,
|
|
9593
|
+
"command": "get-function-routing",
|
|
9594
|
+
"description": "Returns the endpoint binding for the function, or null when no\nroute is currently bound. The binding identifies whether the\nfunction receives mail for a specific domain (scoped) or for any\nactive domain that has no scoped binding (fallback).\n",
|
|
9595
|
+
"hasJsonBody": false,
|
|
9596
|
+
"method": "GET",
|
|
9597
|
+
"operationId": "getFunctionRouting",
|
|
9598
|
+
"path": "/functions/{id}/routing",
|
|
9599
|
+
"pathParams": [{
|
|
9600
|
+
"description": "Resource UUID",
|
|
9601
|
+
"enum": null,
|
|
9602
|
+
"name": "id",
|
|
9603
|
+
"required": true,
|
|
9604
|
+
"type": "string"
|
|
9605
|
+
}],
|
|
9606
|
+
"queryParams": [],
|
|
9607
|
+
"requestSchema": null,
|
|
9608
|
+
"responseSchema": { "oneOf": [{
|
|
9609
|
+
"type": "object",
|
|
9610
|
+
"description": "A single route binding for a function. `domain` is null when the\nbinding is the org's fallback (any active domain without a scoped\nbinding); otherwise it carries the scoped domain. `rules` is\nreserved for future routing predicates.\n",
|
|
9611
|
+
"properties": {
|
|
9612
|
+
"endpoint_id": {
|
|
9613
|
+
"type": "string",
|
|
9614
|
+
"format": "uuid"
|
|
9615
|
+
},
|
|
9616
|
+
"enabled": { "type": "boolean" },
|
|
9617
|
+
"domain": {
|
|
9618
|
+
"type": ["object", "null"],
|
|
9619
|
+
"properties": {
|
|
9620
|
+
"id": {
|
|
9621
|
+
"type": "string",
|
|
9622
|
+
"format": "uuid"
|
|
9623
|
+
},
|
|
9624
|
+
"name": { "type": ["string", "null"] }
|
|
9625
|
+
},
|
|
9626
|
+
"required": ["id"]
|
|
9627
|
+
},
|
|
9628
|
+
"rules": {
|
|
9629
|
+
"type": "object",
|
|
9630
|
+
"description": "Future routing predicates. Currently empty."
|
|
9631
|
+
},
|
|
9632
|
+
"delivery_count": { "type": "integer" },
|
|
9633
|
+
"success_count": { "type": "integer" },
|
|
9634
|
+
"failure_count": { "type": "integer" },
|
|
9635
|
+
"consecutive_fails": { "type": "integer" },
|
|
9636
|
+
"last_delivery_at": {
|
|
9637
|
+
"type": ["string", "null"],
|
|
9638
|
+
"format": "date-time"
|
|
9639
|
+
},
|
|
9640
|
+
"last_success_at": {
|
|
9641
|
+
"type": ["string", "null"],
|
|
9642
|
+
"format": "date-time"
|
|
9643
|
+
},
|
|
9644
|
+
"last_failure_at": {
|
|
9645
|
+
"type": ["string", "null"],
|
|
9646
|
+
"format": "date-time"
|
|
9647
|
+
}
|
|
9648
|
+
},
|
|
9649
|
+
"required": [
|
|
9650
|
+
"endpoint_id",
|
|
9651
|
+
"enabled",
|
|
9652
|
+
"domain",
|
|
9653
|
+
"rules"
|
|
9654
|
+
]
|
|
9655
|
+
}, { "type": "null" }] },
|
|
9656
|
+
"sdkName": "getFunctionRouting",
|
|
9657
|
+
"summary": "Get a function's current route binding",
|
|
9658
|
+
"tag": "Functions",
|
|
9659
|
+
"tagCommand": "functions"
|
|
9660
|
+
},
|
|
9332
9661
|
{
|
|
9333
9662
|
"binaryResponse": false,
|
|
9334
9663
|
"bodyRequired": false,
|
|
@@ -9762,6 +10091,92 @@ const operationManifest = [
|
|
|
9762
10091
|
"tag": "Functions",
|
|
9763
10092
|
"tagCommand": "functions"
|
|
9764
10093
|
},
|
|
10094
|
+
{
|
|
10095
|
+
"binaryResponse": false,
|
|
10096
|
+
"bodyRequired": false,
|
|
10097
|
+
"command": "get-org-routing-topology",
|
|
10098
|
+
"description": "Returns a single snapshot of how inbound mail is routed across\nthis org's active domains and functions: which active domain has\nwhich function bound, the org's fallback function (if any), and\nevery deployed function with no route bound. Use this to answer\n\"which of my functions actually receive mail?\" diagnostically.\n",
|
|
10099
|
+
"hasJsonBody": false,
|
|
10100
|
+
"method": "GET",
|
|
10101
|
+
"operationId": "getOrgRoutingTopology",
|
|
10102
|
+
"path": "/functions/routing-topology",
|
|
10103
|
+
"pathParams": [],
|
|
10104
|
+
"queryParams": [],
|
|
10105
|
+
"requestSchema": null,
|
|
10106
|
+
"responseSchema": {
|
|
10107
|
+
"type": "object",
|
|
10108
|
+
"description": "Org-wide map of function routing: which domain points at which\nfunction, the org's fallback binding (if any), and every\ndeployed function with no route currently bound.\n",
|
|
10109
|
+
"properties": {
|
|
10110
|
+
"domains": {
|
|
10111
|
+
"type": "array",
|
|
10112
|
+
"items": {
|
|
10113
|
+
"type": "object",
|
|
10114
|
+
"properties": {
|
|
10115
|
+
"domain_id": {
|
|
10116
|
+
"type": "string",
|
|
10117
|
+
"format": "uuid"
|
|
10118
|
+
},
|
|
10119
|
+
"domain": { "type": "string" },
|
|
10120
|
+
"routed_function": {
|
|
10121
|
+
"type": ["object", "null"],
|
|
10122
|
+
"properties": {
|
|
10123
|
+
"id": {
|
|
10124
|
+
"type": "string",
|
|
10125
|
+
"format": "uuid"
|
|
10126
|
+
},
|
|
10127
|
+
"name": { "type": "string" }
|
|
10128
|
+
},
|
|
10129
|
+
"required": ["id", "name"]
|
|
10130
|
+
},
|
|
10131
|
+
"endpoint_enabled": { "type": ["boolean", "null"] }
|
|
10132
|
+
},
|
|
10133
|
+
"required": [
|
|
10134
|
+
"domain_id",
|
|
10135
|
+
"domain",
|
|
10136
|
+
"routed_function",
|
|
10137
|
+
"endpoint_enabled"
|
|
10138
|
+
]
|
|
10139
|
+
}
|
|
10140
|
+
},
|
|
10141
|
+
"fallback_function": {
|
|
10142
|
+
"type": ["object", "null"],
|
|
10143
|
+
"properties": {
|
|
10144
|
+
"id": {
|
|
10145
|
+
"type": "string",
|
|
10146
|
+
"format": "uuid"
|
|
10147
|
+
},
|
|
10148
|
+
"name": { "type": "string" }
|
|
10149
|
+
},
|
|
10150
|
+
"required": ["id", "name"]
|
|
10151
|
+
},
|
|
10152
|
+
"fallback_enabled": { "type": ["boolean", "null"] },
|
|
10153
|
+
"unrouted_functions": {
|
|
10154
|
+
"type": "array",
|
|
10155
|
+
"items": {
|
|
10156
|
+
"type": "object",
|
|
10157
|
+
"properties": {
|
|
10158
|
+
"id": {
|
|
10159
|
+
"type": "string",
|
|
10160
|
+
"format": "uuid"
|
|
10161
|
+
},
|
|
10162
|
+
"name": { "type": "string" }
|
|
10163
|
+
},
|
|
10164
|
+
"required": ["id", "name"]
|
|
10165
|
+
}
|
|
10166
|
+
}
|
|
10167
|
+
},
|
|
10168
|
+
"required": [
|
|
10169
|
+
"domains",
|
|
10170
|
+
"fallback_function",
|
|
10171
|
+
"fallback_enabled",
|
|
10172
|
+
"unrouted_functions"
|
|
10173
|
+
]
|
|
10174
|
+
},
|
|
10175
|
+
"sdkName": "getOrgRoutingTopology",
|
|
10176
|
+
"summary": "Get the org's function routing topology",
|
|
10177
|
+
"tag": "Functions",
|
|
10178
|
+
"tagCommand": "functions"
|
|
10179
|
+
},
|
|
9765
10180
|
{
|
|
9766
10181
|
"binaryResponse": false,
|
|
9767
10182
|
"bodyRequired": false,
|
|
@@ -9981,6 +10396,130 @@ const operationManifest = [
|
|
|
9981
10396
|
"tag": "Functions",
|
|
9982
10397
|
"tagCommand": "functions"
|
|
9983
10398
|
},
|
|
10399
|
+
{
|
|
10400
|
+
"binaryResponse": false,
|
|
10401
|
+
"bodyRequired": true,
|
|
10402
|
+
"command": "set-function-route",
|
|
10403
|
+
"description": "Binds inbound mail to this function. The route target is either\na specific verified domain (scoped) or the org's fallback (any\nactive domain with no scoped binding). If another function is\nalready bound at the target, returns a `conflict` envelope\ndescribing the holder; re-issue with `takeover: true` to\ndeactivate that prior binding and install this one.\n",
|
|
10404
|
+
"hasJsonBody": true,
|
|
10405
|
+
"method": "PUT",
|
|
10406
|
+
"operationId": "setFunctionRoute",
|
|
10407
|
+
"path": "/functions/{id}/route",
|
|
10408
|
+
"pathParams": [{
|
|
10409
|
+
"description": "Resource UUID",
|
|
10410
|
+
"enum": null,
|
|
10411
|
+
"name": "id",
|
|
10412
|
+
"required": true,
|
|
10413
|
+
"type": "string"
|
|
10414
|
+
}],
|
|
10415
|
+
"queryParams": [],
|
|
10416
|
+
"requestSchema": {
|
|
10417
|
+
"type": "object",
|
|
10418
|
+
"description": "Target for a route binding. Either a specific verified domain\n(scoped) or the org-wide fallback. Pass `takeover: true` to\ndeactivate any conflicting binding before installing this one.\n",
|
|
10419
|
+
"properties": {
|
|
10420
|
+
"target": { "oneOf": [{
|
|
10421
|
+
"type": "object",
|
|
10422
|
+
"properties": {
|
|
10423
|
+
"kind": {
|
|
10424
|
+
"type": "string",
|
|
10425
|
+
"enum": ["domain"]
|
|
10426
|
+
},
|
|
10427
|
+
"domainId": {
|
|
10428
|
+
"type": "string",
|
|
10429
|
+
"format": "uuid"
|
|
10430
|
+
}
|
|
10431
|
+
},
|
|
10432
|
+
"required": ["kind", "domainId"]
|
|
10433
|
+
}, {
|
|
10434
|
+
"type": "object",
|
|
10435
|
+
"properties": { "kind": {
|
|
10436
|
+
"type": "string",
|
|
10437
|
+
"enum": ["fallback"]
|
|
10438
|
+
} },
|
|
10439
|
+
"required": ["kind"]
|
|
10440
|
+
}] },
|
|
10441
|
+
"takeover": {
|
|
10442
|
+
"type": "boolean",
|
|
10443
|
+
"description": "When true, deactivate any conflicting binding before installing this one."
|
|
10444
|
+
}
|
|
10445
|
+
},
|
|
10446
|
+
"required": ["target"]
|
|
10447
|
+
},
|
|
10448
|
+
"responseSchema": {
|
|
10449
|
+
"type": "object",
|
|
10450
|
+
"description": "On success, carries the new `routing`. On conflict, carries\n`conflict` describing the binding holder so the caller can\nre-issue with `takeover: true`.\n",
|
|
10451
|
+
"properties": {
|
|
10452
|
+
"routing": { "oneOf": [{
|
|
10453
|
+
"type": "object",
|
|
10454
|
+
"description": "A single route binding for a function. `domain` is null when the\nbinding is the org's fallback (any active domain without a scoped\nbinding); otherwise it carries the scoped domain. `rules` is\nreserved for future routing predicates.\n",
|
|
10455
|
+
"properties": {
|
|
10456
|
+
"endpoint_id": {
|
|
10457
|
+
"type": "string",
|
|
10458
|
+
"format": "uuid"
|
|
10459
|
+
},
|
|
10460
|
+
"enabled": { "type": "boolean" },
|
|
10461
|
+
"domain": {
|
|
10462
|
+
"type": ["object", "null"],
|
|
10463
|
+
"properties": {
|
|
10464
|
+
"id": {
|
|
10465
|
+
"type": "string",
|
|
10466
|
+
"format": "uuid"
|
|
10467
|
+
},
|
|
10468
|
+
"name": { "type": ["string", "null"] }
|
|
10469
|
+
},
|
|
10470
|
+
"required": ["id"]
|
|
10471
|
+
},
|
|
10472
|
+
"rules": {
|
|
10473
|
+
"type": "object",
|
|
10474
|
+
"description": "Future routing predicates. Currently empty."
|
|
10475
|
+
},
|
|
10476
|
+
"delivery_count": { "type": "integer" },
|
|
10477
|
+
"success_count": { "type": "integer" },
|
|
10478
|
+
"failure_count": { "type": "integer" },
|
|
10479
|
+
"consecutive_fails": { "type": "integer" },
|
|
10480
|
+
"last_delivery_at": {
|
|
10481
|
+
"type": ["string", "null"],
|
|
10482
|
+
"format": "date-time"
|
|
10483
|
+
},
|
|
10484
|
+
"last_success_at": {
|
|
10485
|
+
"type": ["string", "null"],
|
|
10486
|
+
"format": "date-time"
|
|
10487
|
+
},
|
|
10488
|
+
"last_failure_at": {
|
|
10489
|
+
"type": ["string", "null"],
|
|
10490
|
+
"format": "date-time"
|
|
10491
|
+
}
|
|
10492
|
+
},
|
|
10493
|
+
"required": [
|
|
10494
|
+
"endpoint_id",
|
|
10495
|
+
"enabled",
|
|
10496
|
+
"domain",
|
|
10497
|
+
"rules"
|
|
10498
|
+
]
|
|
10499
|
+
}, { "type": "null" }] },
|
|
10500
|
+
"conflict": {
|
|
10501
|
+
"type": "object",
|
|
10502
|
+
"properties": {
|
|
10503
|
+
"kind": {
|
|
10504
|
+
"type": "string",
|
|
10505
|
+
"enum": ["http", "function"]
|
|
10506
|
+
},
|
|
10507
|
+
"functionId": {
|
|
10508
|
+
"type": ["string", "null"],
|
|
10509
|
+
"format": "uuid"
|
|
10510
|
+
},
|
|
10511
|
+
"functionName": { "type": ["string", "null"] },
|
|
10512
|
+
"url": { "type": ["string", "null"] }
|
|
10513
|
+
},
|
|
10514
|
+
"required": ["kind"]
|
|
10515
|
+
}
|
|
10516
|
+
}
|
|
10517
|
+
},
|
|
10518
|
+
"sdkName": "setFunctionRoute",
|
|
10519
|
+
"summary": "Bind a route to a function",
|
|
10520
|
+
"tag": "Functions",
|
|
10521
|
+
"tagCommand": "functions"
|
|
10522
|
+
},
|
|
9984
10523
|
{
|
|
9985
10524
|
"binaryResponse": false,
|
|
9986
10525
|
"bodyRequired": true,
|
|
@@ -10134,6 +10673,37 @@ const operationManifest = [
|
|
|
10134
10673
|
"tag": "Functions",
|
|
10135
10674
|
"tagCommand": "functions"
|
|
10136
10675
|
},
|
|
10676
|
+
{
|
|
10677
|
+
"binaryResponse": false,
|
|
10678
|
+
"bodyRequired": false,
|
|
10679
|
+
"command": "unset-function-route",
|
|
10680
|
+
"description": "Deactivates every active endpoint bound to this function. The\nfunction stays deployed but stops receiving inbound mail. Safe\nto call when no route is currently bound (no-op).\n",
|
|
10681
|
+
"hasJsonBody": false,
|
|
10682
|
+
"method": "DELETE",
|
|
10683
|
+
"operationId": "unsetFunctionRoute",
|
|
10684
|
+
"path": "/functions/{id}/route",
|
|
10685
|
+
"pathParams": [{
|
|
10686
|
+
"description": "Resource UUID",
|
|
10687
|
+
"enum": null,
|
|
10688
|
+
"name": "id",
|
|
10689
|
+
"required": true,
|
|
10690
|
+
"type": "string"
|
|
10691
|
+
}],
|
|
10692
|
+
"queryParams": [],
|
|
10693
|
+
"requestSchema": null,
|
|
10694
|
+
"responseSchema": {
|
|
10695
|
+
"type": "object",
|
|
10696
|
+
"properties": { "unrouted": {
|
|
10697
|
+
"type": "boolean",
|
|
10698
|
+
"enum": [true]
|
|
10699
|
+
} },
|
|
10700
|
+
"required": ["unrouted"]
|
|
10701
|
+
},
|
|
10702
|
+
"sdkName": "unsetFunctionRoute",
|
|
10703
|
+
"summary": "Unbind any route from a function",
|
|
10704
|
+
"tag": "Functions",
|
|
10705
|
+
"tagCommand": "functions"
|
|
10706
|
+
},
|
|
10137
10707
|
{
|
|
10138
10708
|
"binaryResponse": false,
|
|
10139
10709
|
"bodyRequired": true,
|
package/package.json
CHANGED