@primitivedotdev/sdk 0.28.0 → 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 +2 -2
- package/dist/api/index.js +3 -3
- package/dist/{api-3znV8SSN.js → api-DtnAfZka.js} +20 -1
- package/dist/{index-BKeS9sOb.d.ts → index-BUQQvkI3.d.ts} +178 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/openapi/index.js +1 -1
- package/dist/{operations.generated-x1Go1Xkb.js → operations.generated-B3sb0jWW.js} +927 -124
- package/package.json +1 -1
|
@@ -1546,6 +1546,37 @@ const openapiDocument = {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
1548
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
|
+
},
|
|
1549
1580
|
"/functions/{id}/secrets": {
|
|
1550
1581
|
"parameters": [{ "$ref": "#/components/parameters/ResourceId" }],
|
|
1551
1582
|
"get": {
|
|
@@ -3846,8 +3877,13 @@ const openapiDocument = {
|
|
|
3846
3877
|
},
|
|
3847
3878
|
"TestInvocationResult": {
|
|
3848
3879
|
"type": "object",
|
|
3849
|
-
"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",
|
|
3850
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
|
+
},
|
|
3851
3887
|
"inbound_domain": {
|
|
3852
3888
|
"type": "string",
|
|
3853
3889
|
"description": "Verified inbound domain the test email was sent to."
|
|
@@ -3877,127 +3913,203 @@ const openapiDocument = {
|
|
|
3877
3913
|
"type": "string",
|
|
3878
3914
|
"format": "uri",
|
|
3879
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."
|
|
3880
3920
|
}
|
|
3881
3921
|
},
|
|
3882
3922
|
"required": [
|
|
3923
|
+
"test_run_id",
|
|
3883
3924
|
"inbound_domain",
|
|
3884
3925
|
"to",
|
|
3885
3926
|
"from",
|
|
3886
3927
|
"send_id",
|
|
3887
3928
|
"subject",
|
|
3888
3929
|
"poll_since",
|
|
3889
|
-
"watch_url"
|
|
3930
|
+
"watch_url",
|
|
3931
|
+
"trace_url"
|
|
3890
3932
|
]
|
|
3891
3933
|
},
|
|
3892
|
-
"
|
|
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": {
|
|
3893
3947
|
"type": "object",
|
|
3894
|
-
"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",
|
|
3895
3948
|
"properties": {
|
|
3896
3949
|
"id": {
|
|
3897
3950
|
"type": "string",
|
|
3898
|
-
"format": "uuid"
|
|
3899
|
-
"description": "Unique log row id (stable across pages)."
|
|
3951
|
+
"format": "uuid"
|
|
3900
3952
|
},
|
|
3901
3953
|
"function_id": {
|
|
3902
3954
|
"type": "string",
|
|
3903
|
-
"format": "uuid"
|
|
3904
|
-
"description": "The function this log row belongs to."
|
|
3955
|
+
"format": "uuid"
|
|
3905
3956
|
},
|
|
3906
|
-
"
|
|
3957
|
+
"inbound_domain": { "type": "string" },
|
|
3958
|
+
"to": { "type": "string" },
|
|
3959
|
+
"from": { "type": "string" },
|
|
3960
|
+
"subject": { "type": "string" },
|
|
3961
|
+
"poll_since": {
|
|
3907
3962
|
"type": "string",
|
|
3908
|
-
"
|
|
3909
|
-
"debug",
|
|
3910
|
-
"log",
|
|
3911
|
-
"info",
|
|
3912
|
-
"warn",
|
|
3913
|
-
"error"
|
|
3914
|
-
],
|
|
3915
|
-
"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"
|
|
3916
3964
|
},
|
|
3917
|
-
"
|
|
3965
|
+
"created_at": {
|
|
3918
3966
|
"type": "string",
|
|
3919
|
-
"
|
|
3967
|
+
"format": "date-time"
|
|
3920
3968
|
},
|
|
3921
|
-
"
|
|
3922
|
-
"type": "string",
|
|
3923
|
-
"format": "date-time"
|
|
3924
|
-
"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"
|
|
3925
3972
|
},
|
|
3926
|
-
"
|
|
3927
|
-
"type": ["object", "null"],
|
|
3928
|
-
"additionalProperties": true,
|
|
3929
|
-
"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"
|
|
3930
|
-
}
|
|
3973
|
+
"send_error": { "type": ["string", "null"] }
|
|
3931
3974
|
},
|
|
3932
3975
|
"required": [
|
|
3933
3976
|
"id",
|
|
3934
3977
|
"function_id",
|
|
3935
|
-
"
|
|
3936
|
-
"
|
|
3937
|
-
"
|
|
3978
|
+
"inbound_domain",
|
|
3979
|
+
"to",
|
|
3980
|
+
"from",
|
|
3981
|
+
"subject",
|
|
3982
|
+
"poll_since",
|
|
3983
|
+
"created_at",
|
|
3984
|
+
"sent_at",
|
|
3985
|
+
"send_error"
|
|
3938
3986
|
]
|
|
3939
3987
|
},
|
|
3940
|
-
"
|
|
3941
|
-
"type": "object",
|
|
3942
|
-
"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",
|
|
3988
|
+
"FunctionTestRunSend": {
|
|
3989
|
+
"type": ["object", "null"],
|
|
3943
3990
|
"properties": {
|
|
3944
|
-
"
|
|
3945
|
-
|
|
3946
|
-
"
|
|
3947
|
-
"description": "True for managed system secrets, false for user-set entries."
|
|
3948
|
-
},
|
|
3949
|
-
"description": {
|
|
3950
|
-
"type": ["string", "null"],
|
|
3951
|
-
"description": "Set on managed entries only; null on user-set entries."
|
|
3991
|
+
"id": {
|
|
3992
|
+
"type": "string",
|
|
3993
|
+
"format": "uuid"
|
|
3952
3994
|
},
|
|
3995
|
+
"status": { "$ref": "#/components/schemas/SentEmailStatus" },
|
|
3996
|
+
"queue_id": { "type": ["string", "null"] },
|
|
3953
3997
|
"created_at": {
|
|
3954
|
-
"type":
|
|
3955
|
-
"format": "date-time"
|
|
3956
|
-
"description": "Set on user-set entries only; null on managed entries."
|
|
3998
|
+
"type": "string",
|
|
3999
|
+
"format": "date-time"
|
|
3957
4000
|
},
|
|
3958
4001
|
"updated_at": {
|
|
3959
|
-
"type":
|
|
3960
|
-
"format": "date-time"
|
|
3961
|
-
"description": "Set on user-set entries only; null on managed entries."
|
|
4002
|
+
"type": "string",
|
|
4003
|
+
"format": "date-time"
|
|
3962
4004
|
}
|
|
3963
4005
|
},
|
|
3964
|
-
"required": [
|
|
4006
|
+
"required": [
|
|
4007
|
+
"id",
|
|
4008
|
+
"status",
|
|
4009
|
+
"queue_id",
|
|
4010
|
+
"created_at",
|
|
4011
|
+
"updated_at"
|
|
4012
|
+
]
|
|
3965
4013
|
},
|
|
3966
|
-
"
|
|
3967
|
-
"type": "object",
|
|
3968
|
-
"additionalProperties": false,
|
|
3969
|
-
"description": "Body for POST /functions/{id}/secrets.",
|
|
4014
|
+
"FunctionTestRunInboundEmail": {
|
|
4015
|
+
"type": ["object", "null"],
|
|
3970
4016
|
"properties": {
|
|
3971
|
-
"
|
|
4017
|
+
"id": {
|
|
3972
4018
|
"type": "string",
|
|
3973
|
-
"
|
|
3974
|
-
"description": "Uppercase letters, digits, and underscores. Must start with\na letter or underscore. System-managed keys (e.g.\nPRIMITIVE_WEBHOOK_SECRET) are reserved.\n"
|
|
4019
|
+
"format": "uuid"
|
|
3975
4020
|
},
|
|
3976
|
-
"
|
|
4021
|
+
"status": { "$ref": "#/components/schemas/EmailStatus" },
|
|
4022
|
+
"received_at": {
|
|
3977
4023
|
"type": "string",
|
|
3978
|
-
"
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
}
|
|
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"] }
|
|
3982
4033
|
},
|
|
3983
|
-
"required": [
|
|
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
|
+
]
|
|
3984
4046
|
},
|
|
3985
|
-
"
|
|
3986
|
-
"type": "object",
|
|
3987
|
-
"
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
"
|
|
3993
|
-
|
|
3994
|
-
|
|
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
|
+
]
|
|
3995
4084
|
},
|
|
3996
|
-
"
|
|
4085
|
+
"FunctionTestRunDelivery": {
|
|
3997
4086
|
"type": "object",
|
|
3998
|
-
"description": "Returned by POST and PUT secret routes.",
|
|
3999
4087
|
"properties": {
|
|
4000
|
-
"
|
|
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"] },
|
|
4001
4113
|
"created_at": {
|
|
4002
4114
|
"type": "string",
|
|
4003
4115
|
"format": "date-time"
|
|
@@ -4006,58 +4118,305 @@ const openapiDocument = {
|
|
|
4006
4118
|
"type": "string",
|
|
4007
4119
|
"format": "date-time"
|
|
4008
4120
|
},
|
|
4009
|
-
"
|
|
4010
|
-
"type": "boolean",
|
|
4011
|
-
"description": "True if this call inserted a new row, false if it updated an existing one."
|
|
4012
|
-
}
|
|
4121
|
+
"endpoint": { "$ref": "#/components/schemas/FunctionTestRunDeliveryEndpoint" }
|
|
4013
4122
|
},
|
|
4014
4123
|
"required": [
|
|
4015
|
-
"
|
|
4124
|
+
"id",
|
|
4125
|
+
"endpoint_id",
|
|
4126
|
+
"endpoint_url",
|
|
4127
|
+
"status",
|
|
4128
|
+
"attempt_count",
|
|
4129
|
+
"duration_ms",
|
|
4130
|
+
"last_error",
|
|
4131
|
+
"last_error_code",
|
|
4016
4132
|
"created_at",
|
|
4017
4133
|
"updated_at",
|
|
4018
|
-
"
|
|
4134
|
+
"endpoint"
|
|
4019
4135
|
]
|
|
4020
|
-
}
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
"type": "
|
|
4050
|
-
"
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
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": {
|
|
4286
|
+
"type": ["object", "null"],
|
|
4287
|
+
"additionalProperties": true,
|
|
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"
|
|
4289
|
+
}
|
|
4290
|
+
},
|
|
4291
|
+
"required": [
|
|
4292
|
+
"id",
|
|
4293
|
+
"function_id",
|
|
4294
|
+
"level",
|
|
4295
|
+
"message",
|
|
4296
|
+
"ts"
|
|
4297
|
+
]
|
|
4298
|
+
},
|
|
4299
|
+
"FunctionSecretListItem": {
|
|
4300
|
+
"type": "object",
|
|
4301
|
+
"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",
|
|
4302
|
+
"properties": {
|
|
4303
|
+
"key": { "type": "string" },
|
|
4304
|
+
"managed": {
|
|
4305
|
+
"type": "boolean",
|
|
4306
|
+
"description": "True for managed system secrets, false for user-set entries."
|
|
4307
|
+
},
|
|
4308
|
+
"description": {
|
|
4309
|
+
"type": ["string", "null"],
|
|
4310
|
+
"description": "Set on managed entries only; null on user-set entries."
|
|
4311
|
+
},
|
|
4312
|
+
"created_at": {
|
|
4313
|
+
"type": ["string", "null"],
|
|
4314
|
+
"format": "date-time",
|
|
4315
|
+
"description": "Set on user-set entries only; null on managed entries."
|
|
4316
|
+
},
|
|
4317
|
+
"updated_at": {
|
|
4318
|
+
"type": ["string", "null"],
|
|
4319
|
+
"format": "date-time",
|
|
4320
|
+
"description": "Set on user-set entries only; null on managed entries."
|
|
4321
|
+
}
|
|
4322
|
+
},
|
|
4323
|
+
"required": ["key", "managed"]
|
|
4324
|
+
},
|
|
4325
|
+
"CreateFunctionSecretInput": {
|
|
4326
|
+
"type": "object",
|
|
4327
|
+
"additionalProperties": false,
|
|
4328
|
+
"description": "Body for POST /functions/{id}/secrets.",
|
|
4329
|
+
"properties": {
|
|
4330
|
+
"key": {
|
|
4331
|
+
"type": "string",
|
|
4332
|
+
"pattern": "^[A-Z_][A-Z0-9_]*$",
|
|
4333
|
+
"description": "Uppercase letters, digits, and underscores. Must start with\na letter or underscore. System-managed keys (e.g.\nPRIMITIVE_WEBHOOK_SECRET) are reserved.\n"
|
|
4334
|
+
},
|
|
4335
|
+
"value": {
|
|
4336
|
+
"type": "string",
|
|
4337
|
+
"minLength": 1,
|
|
4338
|
+
"maxLength": 4096,
|
|
4339
|
+
"description": "Secret value, up to 4096 UTF-8 bytes. Encrypted at rest.\nNever returned by any read endpoint.\n"
|
|
4340
|
+
}
|
|
4341
|
+
},
|
|
4342
|
+
"required": ["key", "value"]
|
|
4343
|
+
},
|
|
4344
|
+
"SetFunctionSecretInput": {
|
|
4345
|
+
"type": "object",
|
|
4346
|
+
"additionalProperties": false,
|
|
4347
|
+
"description": "Body for PUT /functions/{id}/secrets/{key}. Key comes from the path.",
|
|
4348
|
+
"properties": { "value": {
|
|
4349
|
+
"type": "string",
|
|
4350
|
+
"minLength": 1,
|
|
4351
|
+
"maxLength": 4096
|
|
4352
|
+
} },
|
|
4353
|
+
"required": ["value"]
|
|
4354
|
+
},
|
|
4355
|
+
"FunctionSecretWriteResult": {
|
|
4356
|
+
"type": "object",
|
|
4357
|
+
"description": "Returned by POST and PUT secret routes.",
|
|
4358
|
+
"properties": {
|
|
4359
|
+
"key": { "type": "string" },
|
|
4360
|
+
"created_at": {
|
|
4361
|
+
"type": "string",
|
|
4362
|
+
"format": "date-time"
|
|
4363
|
+
},
|
|
4364
|
+
"updated_at": {
|
|
4365
|
+
"type": "string",
|
|
4366
|
+
"format": "date-time"
|
|
4367
|
+
},
|
|
4368
|
+
"created": {
|
|
4369
|
+
"type": "boolean",
|
|
4370
|
+
"description": "True if this call inserted a new row, false if it updated an existing one."
|
|
4371
|
+
}
|
|
4372
|
+
},
|
|
4373
|
+
"required": [
|
|
4374
|
+
"key",
|
|
4375
|
+
"created_at",
|
|
4376
|
+
"updated_at",
|
|
4377
|
+
"created"
|
|
4378
|
+
]
|
|
4379
|
+
}
|
|
4380
|
+
}
|
|
4381
|
+
}
|
|
4382
|
+
};
|
|
4383
|
+
//#endregion
|
|
4384
|
+
//#region ../packages/api-core/src/openapi/operations.generated.ts
|
|
4385
|
+
const operationManifest = [
|
|
4386
|
+
{
|
|
4387
|
+
"binaryResponse": false,
|
|
4388
|
+
"bodyRequired": false,
|
|
4389
|
+
"command": "get-account",
|
|
4390
|
+
"description": null,
|
|
4391
|
+
"hasJsonBody": false,
|
|
4392
|
+
"method": "GET",
|
|
4393
|
+
"operationId": "getAccount",
|
|
4394
|
+
"path": "/account",
|
|
4395
|
+
"pathParams": [],
|
|
4396
|
+
"queryParams": [],
|
|
4397
|
+
"requestSchema": null,
|
|
4398
|
+
"responseSchema": {
|
|
4399
|
+
"type": "object",
|
|
4400
|
+
"properties": {
|
|
4401
|
+
"id": {
|
|
4402
|
+
"type": "string",
|
|
4403
|
+
"format": "uuid"
|
|
4404
|
+
},
|
|
4405
|
+
"email": { "type": "string" },
|
|
4406
|
+
"plan": { "type": "string" },
|
|
4407
|
+
"created_at": {
|
|
4408
|
+
"type": "string",
|
|
4409
|
+
"format": "date-time"
|
|
4410
|
+
},
|
|
4411
|
+
"onboarding_completed": { "type": "boolean" },
|
|
4412
|
+
"onboarding_step": { "type": ["string", "null"] },
|
|
4413
|
+
"stripe_subscription_status": { "type": ["string", "null"] },
|
|
4414
|
+
"subscription_current_period_end": {
|
|
4415
|
+
"type": ["string", "null"],
|
|
4416
|
+
"format": "date-time"
|
|
4417
|
+
},
|
|
4418
|
+
"subscription_cancel_at_period_end": { "type": ["boolean", "null"] },
|
|
4419
|
+
"spam_threshold": {
|
|
4061
4420
|
"type": ["number", "null"],
|
|
4062
4421
|
"minimum": 0,
|
|
4063
4422
|
"maximum": 15
|
|
@@ -6538,6 +6897,439 @@ const operationManifest = [
|
|
|
6538
6897
|
"tag": "Functions",
|
|
6539
6898
|
"tagCommand": "functions"
|
|
6540
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
|
+
},
|
|
6541
7333
|
{
|
|
6542
7334
|
"binaryResponse": false,
|
|
6543
7335
|
"bodyRequired": false,
|
|
@@ -6854,8 +7646,13 @@ const operationManifest = [
|
|
|
6854
7646
|
},
|
|
6855
7647
|
"responseSchema": {
|
|
6856
7648
|
"type": "object",
|
|
6857
|
-
"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",
|
|
6858
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
|
+
},
|
|
6859
7656
|
"inbound_domain": {
|
|
6860
7657
|
"type": "string",
|
|
6861
7658
|
"description": "Verified inbound domain the test email was sent to."
|
|
@@ -6885,16 +7682,22 @@ const operationManifest = [
|
|
|
6885
7682
|
"type": "string",
|
|
6886
7683
|
"format": "uri",
|
|
6887
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."
|
|
6888
7689
|
}
|
|
6889
7690
|
},
|
|
6890
7691
|
"required": [
|
|
7692
|
+
"test_run_id",
|
|
6891
7693
|
"inbound_domain",
|
|
6892
7694
|
"to",
|
|
6893
7695
|
"from",
|
|
6894
7696
|
"send_id",
|
|
6895
7697
|
"subject",
|
|
6896
7698
|
"poll_since",
|
|
6897
|
-
"watch_url"
|
|
7699
|
+
"watch_url",
|
|
7700
|
+
"trace_url"
|
|
6898
7701
|
]
|
|
6899
7702
|
},
|
|
6900
7703
|
"sdkName": "testFunction",
|