Skip to content

Commit 9c448b9

Browse files
saltcodgithub-actions[bot]
authored andcommitted
feat: update mgmt api docs
1 parent b7df65f commit 9c448b9

File tree

3 files changed

+435
-142
lines changed

3 files changed

+435
-142
lines changed

apps/docs/spec/api_v1_openapi.json

Lines changed: 109 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,8 @@
22622262
"post": {
22632263
"operationId": "v1-create-a-function",
22642264
"summary": "Create a function",
2265-
"description": "Creates a function and adds it to the specified project.",
2265+
"description": "This endpoint is deprecated - use the deploy endpoint. Creates a function and adds it to the specified project.",
2266+
"deprecated": true,
22662267
"parameters": [
22672268
{
22682269
"name": "ref",
@@ -2301,12 +2302,6 @@
23012302
"required": false,
23022303
"in": "query",
23032304
"schema": { "type": "string" }
2304-
},
2305-
{
2306-
"name": "compute_multiplier",
2307-
"required": false,
2308-
"in": "query",
2309-
"schema": { "minimum": 1, "maximum": 4, "type": "number" }
23102305
}
23112306
],
23122307
"requestBody": {
@@ -2332,6 +2327,45 @@
23322327
},
23332328
"tags": ["Edge Functions"],
23342329
"security": [{ "bearer": [] }]
2330+
},
2331+
"put": {
2332+
"operationId": "v1-bulk-update-functions",
2333+
"summary": "Bulk update functions",
2334+
"description": "Bulk update functions. It will create a new function or replace existing. The operation is idempotent. NOTE: You will need to manually bump the version.",
2335+
"parameters": [
2336+
{
2337+
"name": "ref",
2338+
"required": true,
2339+
"in": "path",
2340+
"description": "Project ref",
2341+
"schema": { "minLength": 20, "maxLength": 20, "type": "string" }
2342+
}
2343+
],
2344+
"requestBody": {
2345+
"required": true,
2346+
"content": {
2347+
"application/json": {
2348+
"schema": {
2349+
"type": "array",
2350+
"items": { "$ref": "#/components/schemas/BulkUpdateFunctionBody" }
2351+
}
2352+
}
2353+
}
2354+
},
2355+
"responses": {
2356+
"200": {
2357+
"description": "",
2358+
"content": {
2359+
"application/json": {
2360+
"schema": { "$ref": "#/components/schemas/BulkUpdateFunctionResponse" }
2361+
}
2362+
}
2363+
},
2364+
"403": { "description": "" },
2365+
"500": { "description": "Failed to update functions" }
2366+
},
2367+
"tags": ["Edge Functions"],
2368+
"security": [{ "bearer": [] }]
23352369
}
23362370
},
23372371
"/v1/projects/{ref}/functions/deploy": {
@@ -2352,6 +2386,12 @@
23522386
"required": false,
23532387
"in": "query",
23542388
"schema": { "pattern": "/^[A-Za-z0-9_-]+$/", "type": "string" }
2389+
},
2390+
{
2391+
"name": "bundleOnly",
2392+
"required": false,
2393+
"in": "query",
2394+
"schema": { "type": "boolean" }
23552395
}
23562396
],
23572397
"requestBody": {
@@ -2366,7 +2406,9 @@
23662406
"201": {
23672407
"description": "",
23682408
"content": {
2369-
"application/json": { "schema": { "$ref": "#/components/schemas/FunctionResponse" } }
2409+
"application/json": {
2410+
"schema": { "$ref": "#/components/schemas/DeployFunctionResponse" }
2411+
}
23702412
}
23712413
},
23722414
"403": { "description": "" },
@@ -2461,12 +2503,6 @@
24612503
"required": false,
24622504
"in": "query",
24632505
"schema": { "type": "string" }
2464-
},
2465-
{
2466-
"name": "compute_multiplier",
2467-
"required": false,
2468-
"in": "query",
2469-
"schema": { "minimum": 1, "maximum": 4, "type": "number" }
24702506
}
24712507
],
24722508
"requestBody": {
@@ -4594,8 +4630,7 @@
45944630
"verify_jwt": { "type": "boolean" },
45954631
"import_map": { "type": "boolean" },
45964632
"entrypoint_path": { "type": "string" },
4597-
"import_map_path": { "type": "string" },
4598-
"compute_multiplier": { "type": "number" }
4633+
"import_map_path": { "type": "string" }
45994634
},
46004635
"required": ["version", "created_at", "updated_at", "id", "slug", "name", "status"]
46014636
},
@@ -4605,35 +4640,72 @@
46054640
"slug": { "type": "string", "pattern": "/^[A-Za-z0-9_-]+$/" },
46064641
"name": { "type": "string" },
46074642
"body": { "type": "string" },
4608-
"verify_jwt": { "type": "boolean" },
4609-
"compute_multiplier": { "type": "number", "minimum": 1, "maximum": 4 }
4643+
"verify_jwt": { "type": "boolean" }
46104644
},
46114645
"required": ["slug", "name", "body"]
46124646
},
4613-
"FunctionDeployBody": {
4647+
"BulkUpdateFunctionBody": {
46144648
"type": "object",
46154649
"properties": {
4616-
"file": {
4650+
"version": { "type": "integer" },
4651+
"created_at": { "type": "integer", "format": "int64" },
4652+
"id": { "type": "string" },
4653+
"slug": { "type": "string" },
4654+
"name": { "type": "string" },
4655+
"status": { "enum": ["ACTIVE", "REMOVED", "THROTTLED"], "type": "string" },
4656+
"verify_jwt": { "type": "boolean" },
4657+
"import_map": { "type": "boolean" },
4658+
"entrypoint_path": { "type": "string" },
4659+
"import_map_path": { "type": "string" }
4660+
},
4661+
"required": ["version", "id", "slug", "name", "status"]
4662+
},
4663+
"BulkUpdateFunctionResponse": {
4664+
"type": "object",
4665+
"properties": {
4666+
"functions": {
46174667
"type": "array",
4618-
"items": { "type": "file", "items": { "type": "string", "format": "binary" } }
4619-
},
4620-
"metadata": {
4621-
"type": "object",
4622-
"properties": {
4623-
"entrypoint_path": { "required": true, "type": "string" },
4624-
"import_map_path": { "required": false, "type": "string" },
4625-
"static_patterns": {
4626-
"required": false,
4627-
"type": "array",
4628-
"items": { "type": "string" }
4629-
},
4630-
"verify_jwt": { "required": false, "type": "boolean" },
4631-
"name": { "required": false, "type": "string" }
4632-
}
4668+
"items": { "$ref": "#/components/schemas/FunctionResponse" }
46334669
}
46344670
},
4671+
"required": ["functions"]
4672+
},
4673+
"FunctionDeployMetadata": {
4674+
"type": "object",
4675+
"properties": {
4676+
"entrypoint_path": { "type": "string" },
4677+
"import_map_path": { "type": "string" },
4678+
"static_patterns": { "type": "array", "items": { "type": "string" } },
4679+
"verify_jwt": { "type": "boolean" },
4680+
"name": { "type": "string" }
4681+
},
4682+
"required": ["entrypoint_path"]
4683+
},
4684+
"FunctionDeployBody": {
4685+
"type": "object",
4686+
"properties": {
4687+
"file": { "type": "array", "items": { "type": "string", "format": "binary" } },
4688+
"metadata": { "$ref": "#/components/schemas/FunctionDeployMetadata" }
4689+
},
46354690
"required": ["file", "metadata"]
46364691
},
4692+
"DeployFunctionResponse": {
4693+
"type": "object",
4694+
"properties": {
4695+
"version": { "type": "integer" },
4696+
"created_at": { "type": "integer", "format": "int64" },
4697+
"updated_at": { "type": "integer", "format": "int64" },
4698+
"id": { "type": "string" },
4699+
"slug": { "type": "string" },
4700+
"name": { "type": "string" },
4701+
"status": { "enum": ["ACTIVE", "REMOVED", "THROTTLED"], "type": "string" },
4702+
"verify_jwt": { "type": "boolean" },
4703+
"import_map": { "type": "boolean" },
4704+
"entrypoint_path": { "type": "string" },
4705+
"import_map_path": { "type": "string" }
4706+
},
4707+
"required": ["version", "id", "slug", "name", "status"]
4708+
},
46374709
"FunctionSlugResponse": {
46384710
"type": "object",
46394711
"properties": {
@@ -4647,8 +4719,7 @@
46474719
"verify_jwt": { "type": "boolean" },
46484720
"import_map": { "type": "boolean" },
46494721
"entrypoint_path": { "type": "string" },
4650-
"import_map_path": { "type": "string" },
4651-
"compute_multiplier": { "type": "number" }
4722+
"import_map_path": { "type": "string" }
46524723
},
46534724
"required": ["version", "created_at", "updated_at", "id", "slug", "name", "status"]
46544725
},
@@ -4657,8 +4728,7 @@
46574728
"properties": {
46584729
"name": { "type": "string" },
46594730
"body": { "type": "string" },
4660-
"verify_jwt": { "type": "boolean" },
4661-
"compute_multiplier": { "type": "number", "minimum": 1, "maximum": 4 }
4731+
"verify_jwt": { "type": "boolean" }
46624732
}
46634733
},
46644734
"V1StorageBucketResponse": {

apps/docs/spec/common-api-sections.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@
225225
"type": "category",
226226
"title": "Edge Functions",
227227
"items": [
228+
{
229+
"id": "v1-bulk-update-functions",
230+
"title": "Bulk update functions",
231+
"slug": "v1-bulk-update-functions",
232+
"type": "operation"
233+
},
228234
{
229235
"id": "v1-create-a-function",
230236
"title": "Create a function",

0 commit comments

Comments
 (0)