|
2262 | 2262 | "post": {
|
2263 | 2263 | "operationId": "v1-create-a-function",
|
2264 | 2264 | "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, |
2266 | 2267 | "parameters": [
|
2267 | 2268 | {
|
2268 | 2269 | "name": "ref",
|
|
2301 | 2302 | "required": false,
|
2302 | 2303 | "in": "query",
|
2303 | 2304 | "schema": { "type": "string" }
|
2304 |
| - }, |
2305 |
| - { |
2306 |
| - "name": "compute_multiplier", |
2307 |
| - "required": false, |
2308 |
| - "in": "query", |
2309 |
| - "schema": { "minimum": 1, "maximum": 4, "type": "number" } |
2310 | 2305 | }
|
2311 | 2306 | ],
|
2312 | 2307 | "requestBody": {
|
|
2332 | 2327 | },
|
2333 | 2328 | "tags": ["Edge Functions"],
|
2334 | 2329 | "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": [] }] |
2335 | 2369 | }
|
2336 | 2370 | },
|
2337 | 2371 | "/v1/projects/{ref}/functions/deploy": {
|
|
2352 | 2386 | "required": false,
|
2353 | 2387 | "in": "query",
|
2354 | 2388 | "schema": { "pattern": "/^[A-Za-z0-9_-]+$/", "type": "string" }
|
| 2389 | + }, |
| 2390 | + { |
| 2391 | + "name": "bundleOnly", |
| 2392 | + "required": false, |
| 2393 | + "in": "query", |
| 2394 | + "schema": { "type": "boolean" } |
2355 | 2395 | }
|
2356 | 2396 | ],
|
2357 | 2397 | "requestBody": {
|
|
2366 | 2406 | "201": {
|
2367 | 2407 | "description": "",
|
2368 | 2408 | "content": {
|
2369 |
| - "application/json": { "schema": { "$ref": "#/components/schemas/FunctionResponse" } } |
| 2409 | + "application/json": { |
| 2410 | + "schema": { "$ref": "#/components/schemas/DeployFunctionResponse" } |
| 2411 | + } |
2370 | 2412 | }
|
2371 | 2413 | },
|
2372 | 2414 | "403": { "description": "" },
|
|
2461 | 2503 | "required": false,
|
2462 | 2504 | "in": "query",
|
2463 | 2505 | "schema": { "type": "string" }
|
2464 |
| - }, |
2465 |
| - { |
2466 |
| - "name": "compute_multiplier", |
2467 |
| - "required": false, |
2468 |
| - "in": "query", |
2469 |
| - "schema": { "minimum": 1, "maximum": 4, "type": "number" } |
2470 | 2506 | }
|
2471 | 2507 | ],
|
2472 | 2508 | "requestBody": {
|
|
4594 | 4630 | "verify_jwt": { "type": "boolean" },
|
4595 | 4631 | "import_map": { "type": "boolean" },
|
4596 | 4632 | "entrypoint_path": { "type": "string" },
|
4597 |
| - "import_map_path": { "type": "string" }, |
4598 |
| - "compute_multiplier": { "type": "number" } |
| 4633 | + "import_map_path": { "type": "string" } |
4599 | 4634 | },
|
4600 | 4635 | "required": ["version", "created_at", "updated_at", "id", "slug", "name", "status"]
|
4601 | 4636 | },
|
|
4605 | 4640 | "slug": { "type": "string", "pattern": "/^[A-Za-z0-9_-]+$/" },
|
4606 | 4641 | "name": { "type": "string" },
|
4607 | 4642 | "body": { "type": "string" },
|
4608 |
| - "verify_jwt": { "type": "boolean" }, |
4609 |
| - "compute_multiplier": { "type": "number", "minimum": 1, "maximum": 4 } |
| 4643 | + "verify_jwt": { "type": "boolean" } |
4610 | 4644 | },
|
4611 | 4645 | "required": ["slug", "name", "body"]
|
4612 | 4646 | },
|
4613 |
| - "FunctionDeployBody": { |
| 4647 | + "BulkUpdateFunctionBody": { |
4614 | 4648 | "type": "object",
|
4615 | 4649 | "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": { |
4617 | 4667 | "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" } |
4633 | 4669 | }
|
4634 | 4670 | },
|
| 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 | + }, |
4635 | 4690 | "required": ["file", "metadata"]
|
4636 | 4691 | },
|
| 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 | + }, |
4637 | 4709 | "FunctionSlugResponse": {
|
4638 | 4710 | "type": "object",
|
4639 | 4711 | "properties": {
|
|
4647 | 4719 | "verify_jwt": { "type": "boolean" },
|
4648 | 4720 | "import_map": { "type": "boolean" },
|
4649 | 4721 | "entrypoint_path": { "type": "string" },
|
4650 |
| - "import_map_path": { "type": "string" }, |
4651 |
| - "compute_multiplier": { "type": "number" } |
| 4722 | + "import_map_path": { "type": "string" } |
4652 | 4723 | },
|
4653 | 4724 | "required": ["version", "created_at", "updated_at", "id", "slug", "name", "status"]
|
4654 | 4725 | },
|
|
4657 | 4728 | "properties": {
|
4658 | 4729 | "name": { "type": "string" },
|
4659 | 4730 | "body": { "type": "string" },
|
4660 |
| - "verify_jwt": { "type": "boolean" }, |
4661 |
| - "compute_multiplier": { "type": "number", "minimum": 1, "maximum": 4 } |
| 4731 | + "verify_jwt": { "type": "boolean" } |
4662 | 4732 | }
|
4663 | 4733 | },
|
4664 | 4734 | "V1StorageBucketResponse": {
|
|
0 commit comments