From 30bea985ff68ebf530415ce872dead17b1563e6a Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 10 Sep 2025 06:39:39 +1000 Subject: [PATCH] added deno provider --- providers/src/deno/v00.00.00000/provider.yaml | 53 + .../deno/v00.00.00000/services/database.yaml | 745 +++++++ .../v00.00.00000/services/deployment.yaml | 1801 +++++++++++++++++ .../deno/v00.00.00000/services/domain.yaml | 796 ++++++++ .../v00.00.00000/services/organization.yaml | 341 ++++ .../deno/v00.00.00000/services/project.yaml | 652 ++++++ 6 files changed, 4388 insertions(+) create mode 100644 providers/src/deno/v00.00.00000/provider.yaml create mode 100644 providers/src/deno/v00.00.00000/services/database.yaml create mode 100644 providers/src/deno/v00.00.00000/services/deployment.yaml create mode 100644 providers/src/deno/v00.00.00000/services/domain.yaml create mode 100644 providers/src/deno/v00.00.00000/services/organization.yaml create mode 100644 providers/src/deno/v00.00.00000/services/project.yaml diff --git a/providers/src/deno/v00.00.00000/provider.yaml b/providers/src/deno/v00.00.00000/provider.yaml new file mode 100644 index 00000000..552da320 --- /dev/null +++ b/providers/src/deno/v00.00.00000/provider.yaml @@ -0,0 +1,53 @@ +id: deno +name: deno +version: v00.00.00000 +providerServices: + database: + id: database:v00.00.00000 + name: database + preferred: true + service: + $ref: deno/v00.00.00000/services/database.yaml + title: database API + version: v00.00.00000 + description: Operations about databases + deployment: + id: deployment:v00.00.00000 + name: deployment + preferred: true + service: + $ref: deno/v00.00.00000/services/deployment.yaml + title: deployment API + version: v00.00.00000 + description: Operations about deployments + domain: + id: domain:v00.00.00000 + name: domain + preferred: true + service: + $ref: deno/v00.00.00000/services/domain.yaml + title: domain API + version: v00.00.00000 + description: Operations about domains + organization: + id: organization:v00.00.00000 + name: organization + preferred: true + service: + $ref: deno/v00.00.00000/services/organization.yaml + title: organization API + version: v00.00.00000 + description: Operations about organizations + project: + id: project:v00.00.00000 + name: project + preferred: true + service: + $ref: deno/v00.00.00000/services/project.yaml + title: project API + version: v00.00.00000 + description: Operations about projects +config: + auth: + credentialsenvvar: DENO_DEPLOY_TOKEN + type: bearer diff --git a/providers/src/deno/v00.00.00000/services/database.yaml b/providers/src/deno/v00.00.00000/services/database.yaml new file mode 100644 index 00000000..9dc6d47e --- /dev/null +++ b/providers/src/deno/v00.00.00000/services/database.yaml @@ -0,0 +1,745 @@ +openapi: 3.0.3 +info: + title: database API + description: Operations about databases + version: 1.0.0 +paths: + /organizations/{organizationId}/databases: + get: + tags: + - database + summary: List KV databases of an organization + description: >- + This API returns a list of KV databases belonging to the specified + organization + + in a pagenated manner. + + The URLs for the next, previous, first, and last page are returned in + the + + `Link` header of the response, if any. + operationId: list_kv_databases + parameters: + - name: page + in: query + description: The page number to return. + required: false + schema: + type: integer + default: 1 + nullable: true + minimum: 1 + - name: limit + in: query + description: The maximum number of items to return per page. + required: false + schema: + type: integer + default: 20 + nullable: true + maximum: 100 + minimum: 1 + - name: q + in: query + description: Query by KV database ID + required: false + schema: + type: string + nullable: true + - name: sort + in: query + description: The field to sort by. Currently only `created_at` is supported. + required: false + schema: + type: string + nullable: true + - name: order + in: query + description: Sort order, either `asc` or `desc`. Defaults to `asc`. + required: false + schema: + type: string + nullable: true + - name: organizationId + in: path + description: Organization ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + headers: + Link: + schema: + $ref: '#/components/schemas/PaginationLinkHeader' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/KvDatabase' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + post: + tags: + - database + summary: Create a KV database + description: |- + This API allows you to create a new KV database under the specified + organization. You will then be able to associate the created KV database + with a new deployment by specifying the KV database ID in the "Create a + deployment" API call. + operationId: create_kv_database + parameters: + - name: organizationId + in: path + description: Organization ID + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateKvDatabaseRequest' + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/KvDatabase' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /databases/{databaseId}: + patch: + tags: + - database + summary: Update KV database details + operationId: update_kv_database + parameters: + - name: databaseId + in: path + description: KV database ID + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateKvDatabaseRequest' + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/KvDatabase' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /databases/{databaseId}/database_backups: + post: + tags: + - databaseBackup + summary: Enable a database backup + description: >- + This API allows you to enable a backup for a KV database. The backup can + be + + stored in your S3 bucket. + + + Currently, only one backup can be enabled per database. When a second + backup + + is being configured, the API will return a `409 Conflict` error. + operationId: enable_kv_backup + parameters: + - name: databaseId + in: path + description: KV database ID + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnableKvDatabaseBackupRequest' + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/EnableKvDatabaseBackupResponse' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '409': + description: >- + This can happen either when another backup configuration is in + progress since multiple configurations can't be processed + simultaneously, or when there is one backup already enabled for the + database since currently only one backup is supported per database. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '500': + description: Failed to enable a database backup for some reason. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + get: + tags: + - databaseBackup + summary: List database backups of a database + description: |- + This API returns a list of backups of the specified KV database. + + Note that currently more than one backups are not supported for a single + database. So this API will return either an empty list or a list with a + single item. + operationId: list_kv_backups + parameters: + - name: databaseId + in: path + description: KV database ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/KvDatabaseBackup' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /database_backups/{databaseBackupId}: + get: + tags: + - databaseBackup + summary: Get database backup details + description: This API returns the details of the specified database backup. + operationId: get_kv_backup + parameters: + - name: databaseBackupId + in: path + description: KV Backup ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/KvDatabaseBackup' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + delete: + tags: + - databaseBackup + summary: Disable a database backup + description: This API allows you to disable a backup for a KV database. + operationId: disable_kv_backup + parameters: + - name: databaseBackupId + in: path + description: KV Backup ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/DisableKvDatabaseBackupResponse' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '409': + description: >- + Another backup configuration is ongoing. Only one can be processed + simultaneously. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' +components: + schemas: + PaginationLinkHeader: + type: string + description: >- + Pagination links. + + This header provides URLS for the `prev`, `next`, `first`, and `last` + pages. + + The format conforms to [RFC 8288](https://tools.ietf.org/html/rfc8288). + example: >- + ; rel="next", + ; rel="prev", + ; rel="first", + ; rel="last" + KvDatabase: + type: object + required: + - id + - organizationId + - description + - updatedAt + - createdAt + properties: + id: + type: string + format: uuid + description: A KV database ID + organizationId: + type: string + format: uuid + description: An organization ID that this KV database belongs to + description: + type: string + description: A description of this KV database + updatedAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + createdAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + additionalProperties: false + ErrorBody: + type: object + required: + - code + - message + properties: + code: + type: string + description: The error code + message: + type: string + description: The error message + CreateKvDatabaseRequest: + type: object + properties: + description: + type: string + description: >- + The description of the KV database. If this is `null`, an empty + string + + will be set. + example: My KV database + nullable: true + maxLength: 1000 + additionalProperties: false + UpdateKvDatabaseRequest: + type: object + properties: + description: + type: string + description: >- + The description of the KV database to be updated to. If this is + `null`, no + + update will be made to the KV database description. + example: My KV database + nullable: true + maxLength: 1000 + additionalProperties: false + EnableKvDatabaseBackupRequest: + oneOf: + - type: object + required: + - endpoint + - bucketName + - bucketRegion + - accessKeyId + - secretAccessKey + - kind + properties: + endpoint: + type: string + description: |- + S3 endpoint URL + + Allowed endpoints as of now are: + - https://s3.us-east-1.amazonaws.com + - https://s3.us-east-2.amazonaws.com + - https://s3.us-west-1.amazonaws.com + - https://s3.us-west-2.amazonaws.com + - https://s3.us-gov-west-1.amazonaws.com + - https://s3.us-gov-east-1.amazonaws.com + - https://s3.ca-central-1.amazonaws.com + - https://s3.eu-north-1.amazonaws.com + - https://s3.eu-west-1.amazonaws.com + - https://s3.eu-west-2.amazonaws.com + - https://s3.eu-west-3.amazonaws.com + - https://s3.eu-central-1.amazonaws.com + - https://s3.eu-south-1.amazonaws.com + - https://s3.af-south-1.amazonaws.com + - https://s3.ap-northeast-1.amazonaws.com + - https://s3.ap-northeast-2.amazonaws.com + - https://s3.ap-northeast-3.amazonaws.com + - https://s3.ap-southeast-1.amazonaws.com + - https://s3.ap-southeast-2.amazonaws.com + - https://s3.ap-southeast-3.amazonaws.com + - https://s3.ap-east-1.amazonaws.com + - https://s3.ap-south-1.amazonaws.com + - https://s3.sa-east-1.amazonaws.com + - https://s3.me-south-1.amazonaws.com + - https://s3.cn-north-1.amazonaws.com + - https://s3.cn-northwest-1.amazonaws.com + - https://storage.googleapis.com + + If you want to use a different endpoint, please contact us. + example: https://s3.us-east-1.amazonaws.com + bucketName: + type: string + description: S3 bucket name + example: my-bucket + bucketRegion: + type: string + description: S3 bucket region + example: us-east-1 + accessKeyId: + type: string + description: Access key ID + example: AKIAIOSFODNN7EXAMPLE + secretAccessKey: + type: string + description: Secret access key + example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + prefix: + type: string + description: Prefix to prepend to all keys when accessing the S3 bucket + example: backup/ + kind: + type: string + enum: + - s3 + discriminator: + propertyName: kind + EnableKvDatabaseBackupResponse: + type: object + required: + - id + properties: + id: + type: string + format: uuid + KvDatabaseBackup: + allOf: + - $ref: '#/components/schemas/KvDatabaseBackupTarget' + - type: object + required: + - id + - status + properties: + id: + type: string + format: uuid + description: The ID of the backup + status: + $ref: '#/components/schemas/KvDatabaseBackupStatus' + DisableKvDatabaseBackupResponse: + type: object + KvDatabaseBackupTarget: + oneOf: + - type: object + required: + - endpoint + - bucketName + - bucketRegion + - accessKeyId + - prefix + - kind + properties: + endpoint: + type: string + description: S3 endpoint URL + example: https://s3.us-east-1.amazonaws.com + bucketName: + type: string + description: S3 bucket name + example: my-bucket + bucketRegion: + type: string + description: S3 bucket region + example: us-east-1 + accessKeyId: + type: string + description: Access key ID + example: AKIAIOSFODNN7EXAMPLE + prefix: + type: string + description: Prefix to prepend to all keys when accessing the S3 bucket + example: backup/ + kind: + type: string + enum: + - s3 + discriminator: + propertyName: kind + KvDatabaseBackupStatus: + oneOf: + - type: object + required: + - code + properties: + code: + type: string + enum: + - pending + - type: object + required: + - code + properties: + code: + type: string + enum: + - active + - type: object + description: >- + An error occurred during the backup operation. One example is when + the + + provided S3 credentials are not correct. + + + If this status is set, the backup has failed permanently and needs + to be + + reconfigured by deleting and creating a new one using [disable a + database backup](#delete-/database_backups/-databaseBackupId-) + + and [enable a database + backup](#post-/databases/-databaseId-/database_backups). + required: + - message + - code + properties: + message: + type: string + description: The detailed error message + example: this is an error message. + code: + type: string + enum: + - failed + description: The status of a KV database backup. + example: + code: active + discriminator: + propertyName: code + x-stackQL-resources: + databases: + id: deno.database.databases + name: databases + title: Databases + methods: + list_kv_databases: + operation: + $ref: '#/paths/~1organizations~1{organizationId}~1databases/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_kv_database: + operation: + $ref: '#/paths/~1organizations~1{organizationId}~1databases/post' + response: + mediaType: application/json + openAPIDocKey: '200' + update_kv_database: + operation: + $ref: '#/paths/~1databases~1{databaseId}/patch' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: >- + #/components/x-stackQL-resources/databases/methods/list_kv_databases + insert: + - $ref: >- + #/components/x-stackQL-resources/databases/methods/create_kv_database + update: + - $ref: >- + #/components/x-stackQL-resources/databases/methods/update_kv_database + delete: [] + replace: [] + backups: + id: deno.database.backups + name: backups + title: Backups + methods: + enable_kv_backup: + operation: + $ref: '#/paths/~1databases~1{databaseId}~1database_backups/post' + response: + mediaType: application/json + openAPIDocKey: '200' + list_kv_backups: + operation: + $ref: '#/paths/~1databases~1{databaseId}~1database_backups/get' + response: + mediaType: application/json + openAPIDocKey: '200' + get_kv_backup: + operation: + $ref: '#/paths/~1database_backups~1{databaseBackupId}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + disable_kv_backup: + operation: + $ref: '#/paths/~1database_backups~1{databaseBackupId}/delete' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/backups/methods/list_kv_backups' + - $ref: '#/components/x-stackQL-resources/backups/methods/get_kv_backup' + insert: [] + update: [] + delete: [] + replace: [] +servers: + - url: https://api.deno.com/v1 diff --git a/providers/src/deno/v00.00.00000/services/deployment.yaml b/providers/src/deno/v00.00.00000/services/deployment.yaml new file mode 100644 index 00000000..a5d8d62f --- /dev/null +++ b/providers/src/deno/v00.00.00000/services/deployment.yaml @@ -0,0 +1,1801 @@ +openapi: 3.0.3 +info: + title: deployment API + description: Operations about deployments + version: 1.0.0 +paths: + /projects/{projectId}/deployments: + get: + tags: + - deployment + summary: List deployments of a project + description: >- + This API returns a list of deployments belonging to the specified + project in + + a pagenated manner. + + + The URLs for the next, previous, first, and last page are returned in + the + + `Link` header of the response, if any. + operationId: list_deployments + parameters: + - name: page + in: query + description: The page number to return. + required: false + schema: + type: integer + default: 1 + nullable: true + minimum: 1 + - name: limit + in: query + description: The maximum number of items to return per page. + required: false + schema: + type: integer + default: 20 + nullable: true + maximum: 100 + minimum: 1 + - name: q + in: query + description: Query by deployment ID + required: false + schema: + type: string + nullable: true + - name: sort + in: query + description: >- + The field to sort by, either `id` or `created_at`. Defaults to + `created_at`. + required: false + schema: + type: string + nullable: true + - name: order + in: query + description: Sort order, either `asc` or `desc`. Defaults to `asc`. + required: false + schema: + type: string + nullable: true + - name: projectId + in: path + description: Project ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + headers: + Link: + schema: + $ref: '#/components/schemas/PaginationLinkHeader' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Deployment' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + post: + tags: + - deployment + summary: Create a deployment + description: >- + This API initiates a build process for a new deployment. + + + Note that this process is asynchronous; the completion of this API + doesn't + + mean the deployment is ready. In order to keep track of the progress of + the + + build, call the "Get build logs of a deployment" API or the "Get + deployment + + details" API. + operationId: create_deployment + parameters: + - name: projectId + in: path + description: Project ID + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDeploymentRequest' + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Deployment' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /deployments/{deploymentId}/redeploy: + post: + tags: + - deployment + summary: Redeploy a deployment with different configuration + operationId: redeploy_deployment + parameters: + - name: deploymentId + in: path + description: Deployment ID + required: true + schema: + $ref: '#/components/schemas/DeploymentId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RedeployRequest' + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Deployment' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /deployments/{deploymentId}: + get: + tags: + - deployment + summary: Get deployment details + operationId: get_deployment + parameters: + - name: deploymentId + in: path + description: Deployment ID + required: true + schema: + $ref: '#/components/schemas/DeploymentId' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Deployment' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + delete: + tags: + - deployment + summary: Delete a deployment + operationId: delete_deployment + parameters: + - name: deploymentId + in: path + description: Deployment ID + required: true + schema: + $ref: '#/components/schemas/DeploymentId' + responses: + '200': + description: Success + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /deployments/{deploymentId}/build_logs: + get: + tags: + - deployment + summary: Get build logs of a deployment + description: >- + This API returns build logs of the specified deployment. It's useful to + watch + + the build progress, figure out what went wrong in case of a build + failure, + + and so on. + + + The response format can be controlled by the `Accept` header; if + + `application/x-ndjson` is specified, the response will be a stream of + + newline-delimited JSON objects. Otherwise it will be a JSON array of + + objects. + operationId: get_build_logs + parameters: + - name: deploymentId + in: path + description: Deployment ID + required: true + schema: + type: string + responses: + '200': + description: Success + content: + application/x-ndjson: + schema: + $ref: '#/components/schemas/BuildLogsResponseEntry' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BuildLogsResponseEntry' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /deployments/{deploymentId}/app_logs: + get: + tags: + - deployment + summary: Get execution logs of a deployment + description: >- + This API can return either past logs or real-time logs depending on the + + presence of the since and until query parameters; if at least one of + them + + is provided, past logs are returned, otherwise real-time logs are + returned. + + + Also, the response format can be controlled by the `Accept` header; if + + `application/x-ndjson` is specified, the response will be a stream of + + newline-delimited JSON objects. Otherwise it will be a JSON array of + + objects. + operationId: get_app_logs + parameters: + - name: q + in: query + description: Text to search for in log message. + required: false + schema: + type: string + nullable: true + example: foobar + - name: level + in: query + description: |- + Log level(s) to filter logs by. + + Defaults to all levels (i.e. no filter applied). + + Multiple levels can be specified using comma-separated format. + required: false + schema: + allOf: + - $ref: '#/components/schemas/LogLevel' + nullable: true + example: error,warning + - name: region + in: query + description: |- + Region(s) to filter logs by. + + Defaults to all regions (i.e. no filter applied). + + Multiple regions can be specified using comma-separated format. + required: false + schema: + allOf: + - $ref: '#/components/schemas/Region' + nullable: true + example: gcp-us-central1,gcp-us-east1 + - name: since + in: query + description: >- + Start time of the time range to filter logs by. + + + Defaults to the Unix Epoch (though the log retention period is 2 + weeks as + + of now). + + + If neither `since` nor `until` is specified, real-time logs are + returned. + required: false + schema: + type: string + format: date-time + nullable: true + example: '2021-08-01T00:00:00Z' + - name: until + in: query + description: >- + End time of the time range to filter logs by. + + + Defaults to the current time. + + + If neither `since` nor `until` is specified, real-time logs are + returned. + required: false + schema: + type: string + format: date-time + nullable: true + example: '2021-08-01T00:00:00Z' + - name: limit + in: query + description: |- + Maximum number of logs to return in one request. + + This is only effective for the past log mode. + required: false + schema: + type: integer + default: 100 + nullable: true + maximum: 10000 + minimum: 1 + - name: sort + in: query + description: |- + The field to sort by. Currently only `time` is supported. + + This is only effective for the past log mode. + required: false + schema: + type: string + nullable: true + - name: order + in: query + description: >- + Sort order, either `asc` or `desc`. Defaults to `desc`. + + + For backward compatibility, `timeAsc` and `timeDesc` are also + supported, + + but deprecated. + + + This is only effective for the past log mode. + required: false + schema: + type: string + nullable: true + - name: cursor + in: query + description: >- + Opaque value that represents the cursor of the last log returned in + the + + previous request. + + + This is only effective for the past log mode. + required: false + schema: + type: string + nullable: true + - name: deploymentId + in: path + description: Deployment ID + required: true + schema: + type: string + responses: + '200': + description: Success + headers: + Link: + schema: + $ref: '#/components/schemas/CursorLinkHeader' + description: This header is present only in the past log mode. + content: + application/x-ndjson: + schema: + $ref: '#/components/schemas/AppLogsResponseEntry' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AppLogsResponseEntry' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /deployments/{deploymentId}/domains/{domain}: + put: + tags: + - deployment + summary: Attach a domain to a deployment + description: >- + This API allows you to attach a domain to an existing deployment. Once + + attached, the deployment will become accessible via that domain. + + + If the specified domain is already attached to another deployment, it + will + + be detached from the current deployment and attached to the new one. + operationId: attach_domain_to_deployment + parameters: + - name: deploymentId + in: path + description: Deployment ID + required: true + schema: + $ref: '#/components/schemas/DeploymentId' + - name: domain + in: path + description: >- + Domain name to attach to the deployment. + + + Two placeholders can be used in the domain name, which will be + substituted + + accordingly: + + + - `{project.name}`: The name of the project. + + - `{deployment.id}`: The ID of the deployment. + + + The domain name you specify here must be either equal to one of the + custom + + domains you have registered, or a subdomain of one of the wildcard + domains + + you have registered. Let's say you have registered `example.com` and + + `*.example.net` as custom domains via [add a + domain](#post-/organizations/-organizationId-/domains) + + endpoint and set DNS records needed to verify you are the owner of + these. + + In this case, the following table shows what domains are attachable + and why: + + + | Domain | Attachable? | + Comment + | + + | ----------------------------------------------- | ----------- | + ------------------------------------------------------------------------------------------- + | + + | `example.com` | ✅ | + Exactly matches the registered custom domain + `example.com` | + + | `foo.example.net` | ✅ | + Covered by + `*.example.net` + | + + | `*.example.net` | ✅ | + Exactly matches the registered custom domain + `*.example.net` | + + | `{project.name}.example.net` | ✅ | + Covered by `*.example.net`, and the placeholder is + valid | + + | `my-{project.name}.example.net` | ✅ | + Covered by `*.example.net`, and the placeholder is + valid | + + | `my-{project.name}-{deployment.id}.example.net` | ✅ | + Covered by `*.example.net`, and the placeholders are + valid | + + | `foo.example.com` | ❌ | The + custom domain `example.com` is registered, but not `foo.example.com` + or `*.example.com` | + + | `example.net` | ❌ | Not + a subdomain of + `*.example.net` + | + + | `foo.bar.example.net` | ❌ | Not + a subdomain of + `*.example.net` + | + + | `{project.id}.example.net` | ❌ | The + placeholder is not + valid + | + + + Besides your custom domains, you can also use `deno.dev` domain + without + + the need to register it. In this case, though, only two formats are + + allowed as follows: + + + | Domain | Attachable? | + + | ----------------------------------------- | ----------- | + + | `{project.name}.deno.dev` | ✅ | + + | `{project.name}-{deployment.id}.deno.dev` | ✅ | + + | `foo.deno.dev` | ❌ | + + | `my-{project.name}.deno.dev` | ❌ | + + | `{deployment.id}.deno.dev` | ❌ | + + | `{deployment.id}-{project.name}.deno.dev` | ❌ | + + + Lastly, keep in mind that in order for the attached domain to work + + properly, you also need to set up TLS certificates, either by + + [provisioning a + certificate](#post-/domains/-domainId-/certificates/provision) + + or by [uploading a + certificate](#post-/domains/-domainId-/certificates). + + This is not needed for `deno.dev` domains. + required: true + schema: + type: string + example: '{project.name}-{deployment.id}.deno.dev' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/AttachDomainResponse' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + delete: + tags: + - deployment + summary: Detach a domain from a deployment + description: >- + This API disassociates a domain from a deployment. Once this operation + is + + completed, the deployment will no longer be accessible via that domain. + operationId: detach_domain_from_deployment + parameters: + - name: deploymentId + in: path + description: Deployment ID + required: true + schema: + $ref: '#/components/schemas/DeploymentId' + - name: domain + in: path + description: Domain to detach + required: true + schema: + type: string + responses: + '200': + description: Success + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' +components: + schemas: + PaginationLinkHeader: + type: string + description: >- + Pagination links. + + This header provides URLS for the `prev`, `next`, `first`, and `last` + pages. + + The format conforms to [RFC 8288](https://tools.ietf.org/html/rfc8288). + example: >- + ; rel="next", + ; rel="prev", + ; rel="first", + ; rel="last" + Deployment: + type: object + required: + - id + - projectId + - status + - databases + - createdAt + - updatedAt + properties: + id: + $ref: '#/components/schemas/DeploymentId' + projectId: + type: string + format: uuid + example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 + description: + type: string + description: >- + The description of this deployment. This is present only when the + `status` + + is `success`. + example: My deployment + nullable: true + status: + $ref: '#/components/schemas/DeploymentStatus' + domains: + type: array + items: + type: string + example: + - example.com + nullable: true + databases: + type: object + description: |- + The KV databases that this deployment has access to. + Currently, only `"default"` database is supported. + additionalProperties: + type: string + format: uuid + example: + default: 5b484959-cba2-482d-95ab-ba592784af80 + requestTimeout: + type: integer + format: int32 + description: >- + The wall-clock timeout in milliseconds for requests to the + deployment. + + + This becomes `null` when no timeout is set, or the deployment has + not been + + done successfully yet. + example: 10000 + nullable: true + minimum: 1 + permissions: + allOf: + - $ref: '#/components/schemas/DeploymentPermissions' + nullable: true + createdAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + updatedAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + additionalProperties: false + ErrorBody: + type: object + required: + - code + - message + properties: + code: + type: string + description: The error code + message: + type: string + description: The error message + CreateDeploymentRequest: + type: object + required: + - entryPointUrl + - assets + - envVars + properties: + entryPointUrl: + type: string + description: >- + An URL of the entry point of the application. + + This is the file that will be executed when the deployment is + invoked. + importMapUrl: + type: string + description: >- + An URL of the import map file. + + + If `null` is given, import map auto-discovery logic will be + performed, + + where it looks for Deno's config file (i.e. `deno.json` or + `deno.jsonc`) + + which may contain an embedded import map or a path to an import map + file. + + If found, that import map will be used. + + + If an empty string is given, no import map will be used. + nullable: true + lockFileUrl: + type: string + description: >- + An URL of the lock file. + + + If `null` is given, lock file auto-discovery logic will be + performed, + + where it looks for Deno's config file (i.e. `deno.json` or + `deno.jsonc`) + + which may contain a path to a lock file or boolean value, such as + `"lock": + + false` or `"lock": "my-lock.lock"`. If a config file is found, the + + semantics of the lock field is the same as the Deno CLI, so refer to + [the + + CLI doc + page](https://docs.deno.com/runtime/manual/basics/modules/integrity_checking#auto-generated-lockfile). + + + If an empty string is given, no lock file will be used. + nullable: true + compilerOptions: + allOf: + - $ref: '#/components/schemas/CompilerOptions' + nullable: true + assets: + $ref: '#/components/schemas/Assets' + domains: + type: array + items: + $ref: '#/components/schemas/AttachableDomain' + description: >- + A list of domains that will be attached to the deployment once it's + + successfully deployed. + + + If this field is omitted or `null` is provided, the default domain + will be + + attached to the deployment, which looks like + `projectname-deploymentid.deno.dev`. + + + If an empty list is provided, no domain will be attached to the + deployment. + + In this case, the default one will not get attached either. + + + If a list is provided, only the domains in the list will be + attached, but + + the default domain will not. + nullable: true + envVars: + type: object + description: >- + A dictionary of environment variables to be set in the runtime + environment + + of the deployment. + additionalProperties: + type: string + databases: + type: object + description: >- + KV database ID mappings to associate with the deployment. + + + A key represents a KV database name (e.g. `"default"`), and a value + is a + + KV database ID. + + + Currently, only `"default"` database is supported. If any other + database + + name is specified, that will be rejected. + + + If not provided, the deployment will be created with no KV database + + attached. + additionalProperties: + type: string + format: uuid + nullable: true + requestTimeout: + type: integer + format: int32 + description: >- + The wall-clock timeout in milliseconds for requests to the + deployment. + + + If not provided, the system default value will be used. + example: 10000 + nullable: true + minimum: 1 + permissions: + allOf: + - $ref: '#/components/schemas/DeploymentPermissions' + nullable: true + description: + type: string + description: >- + A description of the created deployment. If not provided, an empty + string + + will be set. + nullable: true + maxLength: 1000 + enableCron: + type: boolean + description: >- + Enables cron functionality for this deployment. Requires a database + to be attached. + + When multiple projects share the same database, only the first + project to enable crons + + will have access to cron management. Other projects sharing the + database cannot use crons. + nullable: true + additionalProperties: false + example: + entryPointUrl: main.ts + importMapUrl: null + lockFileUrl: null + compilerOptions: null + assets: + main.ts: + kind: file + content: | + Deno.serve((req: Request) => new Response("Hello World")); + encoding: utf-8 + images/cat1.png: + kind: file + content: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk + encoding: base64 + images/cat2.png: + kind: file + gitSha1: 5c4f8729e5c30a91a890e24d7285e89f418c637b + symlink.png: + kind: symlink + target: images/cat1.png + domains: + - '{project.name}-{deployment.id}.deno.dev' + - '{project.name}.deno.dev' + - foo.example.com + envVars: + MY_ENV: hey + databases: + default: 5b484959-cba2-482d-95ab-ba592784af80 + requestTimeout: 10000 + permissions: + net: + - example.com + - 34.120.54.55 + - '[2600:1901:0:6d85::]' + - '*' + description: My first deployment + DeploymentId: + type: string + description: >- + A deployment ID + + + Note that this is not UUID v4, as opposed to organization ID and project + ID. + example: abcde12vwxyz + RedeployRequest: + type: object + properties: + envVars: + type: object + description: >- + A dictionary of environment variables to be set in the runtime + environment + + of the deployment. + + + The provided environment variables will be _merged_ with the + existing one. + + For example, if the existing environment variables are: + + + ```json + + { + + "a": "alice", + + "b": "bob" + + "c": "charlie" + + } + + ``` + + + and you pass the following environment variables in your redeploy + request: + + + ```json + + { + + "a": "alice2", + + "b": null, + + "d": "david" + + } + + ``` + + + then the result will be: + + + ```json + + { + + "a": "alice2", + + "c": "charlie", + + "d": "david" + + } + + ``` + + + If `envVars` itself is not provided, no update will happen to the + + existing environment variables. + + + For a historical reason, `env_vars` is also accepted as well as + `envVars`, + + although `env_vars` is deprecated. + additionalProperties: + type: string + nullable: true + example: + MY_ENV: hey + ENV_TO_BE_DELETED: null + nullable: true + databases: + type: object + description: >- + KV database ID mappings to associate with the deployment. + + + A key represents a KV database name (e.g. `"default"`), and a value + is a + + KV database ID. + + + Currently, only `"default"` database is supported. If any other + database + + name is specified, that will be rejected. + + + The provided KV database mappings will be _merged_ with the existing + one, + + just like `env_vars`. + + + If `databases` itself is not provided, no update will happen to the + + existing KV database mappings. + additionalProperties: + type: string + format: uuid + nullable: true + example: + default: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 + nullable: true + requestTimeout: + type: integer + format: int32 + description: >- + The wall-clock timeout in milliseconds for requests to the + deployment. + + + If not provided, no update will happen to the existing request + timeout. + example: 10000 + nullable: true + minimum: 1 + permissions: + allOf: + - $ref: '#/components/schemas/DeploymentPermissionsOverwrite' + nullable: true + description: + type: string + description: >- + A description of the created deployment. If not provided, no update + will + + happen to the description. + example: Updated description + nullable: true + additionalProperties: false + BuildLogsResponseEntry: + type: object + required: + - level + - message + properties: + level: + type: string + example: info + message: + type: string + example: Downloaded https://deno.land/std@0.202.0/testing/asserts.ts (2/3) + additionalProperties: false + LogLevel: + type: string + enum: + - error + - warning + - info + - debug + Region: + type: string + enum: + - gcp-asia-east1 + - gcp-asia-east2 + - gcp-asia-northeast1 + - gcp-asia-northeast2 + - gcp-asia-northeast3 + - gcp-asia-south1 + - gcp-asia-south2 + - gcp-asia-southeast1 + - gcp-asia-southeast2 + - gcp-australia-southeast1 + - gcp-australia-southeast2 + - gcp-europe-central2 + - gcp-europe-north1 + - gcp-europe-southwest1 + - gcp-europe-west1 + - gcp-europe-west2 + - gcp-europe-west3 + - gcp-europe-west4 + - gcp-europe-west6 + - gcp-europe-west8 + - gcp-me-west1 + - gcp-northamerica-northeast1 + - gcp-northamerica-northeast2 + - gcp-southamerica-east1 + - gcp-southamerica-west1 + - gcp-us-central1 + - gcp-us-east1 + - gcp-us-east4 + - gcp-us-east5 + - gcp-us-south1 + - gcp-us-west1 + - gcp-us-west2 + - gcp-us-west3 + - gcp-us-west4 + CursorLinkHeader: + type: string + description: |- + Pagination links. + This header provides a URL for the `next` page. + The format conforms to [RFC 8288](https://tools.ietf.org/html/rfc8288). + example: ; rel="next" + AppLogsResponseEntry: + type: object + required: + - time + - level + - message + - region + properties: + time: + type: string + format: date-time + description: Log timestamp + example: '2021-08-01T00:00:00Z' + level: + $ref: '#/components/schemas/LogLevel' + message: + type: string + example: log message + region: + $ref: '#/components/schemas/Region' + additionalProperties: false + AttachDomainResponse: + type: object + required: + - domain + properties: + domain: + type: string + description: >- + The domain that was attached to the deployment with placeholders + resolved. + example: myproject-mydeployment.deno.dev + DeploymentStatus: + type: string + description: The status of a deployment. + enum: + - failed + - pending + - success + example: success + DeploymentPermissions: + type: object + description: >- + Permissions to be set for the deployment. + + + Currently only `net` is supported, where you can specify a list of IP + + addresses and/or hostnames that the deployment is allowed to make + outbound + + network requests to. + properties: + net: + type: array + items: + type: string + description: >- + A list of IP addresses that the deployment is allowed to make + outbound + + network requests to. + + + Each element must be a valid IPv4, IPv6, or a hostname like + `example.com` + + although outbound network requests using IPv6 are not supported yet + in + + Deno Deploy regardless. + + In addition to these, a special value `*` can be used, which means + all + + accesses are allowed. Also note the following: + + + - If omitted, all accesses will be allowed. + + - If an empty list is provided, all accesses will be **denied**. + example: + - example.com + - 34.120.54.55 + - '[2600:1901:0:6d85::]' + - '*' + nullable: true + additionalProperties: false + CompilerOptions: + type: object + description: >- + Compiler options to be used when building the deployment. + + + If `null` is given, Deno's config file (i.e. `deno.json` or + `deno.jsonc`) + + will be auto-discovered, which may contain a `compilerOptions` field. If + + found, that compiler options will be applied. + + + If an empty object `{}` is given, [the default compiler + options](https://docs.deno.com/runtime/manual/advanced/typescript/configuration#how-deno-uses-a-configuration-file) + + will be applied. + properties: + experimentalDecorators: + type: boolean + description: >- + Whether to enable TypeScript's experimental decorators. If set to + `false`, + + ECMAScript decorators will be enabled instead. + + + If omitted, this field will be interpreted as `false`. + + + If the code being deployed uses any kind of decorators, this field + must be + + set. Otherwise, the build process will fail. + nullable: true + emitDecoratorMetadata: + type: boolean + description: >- + Whether to emit experimental decorator meta data when emitting a + + TypeScript's experimental decorator. + + + This is effective only when `experimentalDecorators` is set to + `true`. + + + If omitted, this field will be interpreted as `false`. + nullable: true + jsx: + type: string + nullable: true + jsxFactory: + type: string + nullable: true + jsxFragmentFactory: + type: string + nullable: true + jsxImportSource: + type: string + nullable: true + jsxPrecompileSkipElements: + type: array + items: + type: string + nullable: true + additionalProperties: false + Assets: + type: object + description: >- + A map whose key represents a file path, and the value is an asset that + + composes the deployment. + + + Each asset is one of the following three kinds: + + + 1. A file with content data (which is UTF-8 for text, or base64 for + binary) + + 2. A file with a git sha1 hash of the content + + 3. A symbolic link to another asset + + + Assets that were uploaded in some of the previous deployments don't need + to + + be uploaded again. In this case, in order to identify the asset, just + provide the + + git SHA-1 hash of the content (use `git hash-object -t 'blob' ` + command to generate). + additionalProperties: + $ref: '#/components/schemas/Asset' + AttachableDomain: + type: string + description: >- + Domain name to attach to the deployment. + + + Two placeholders can be used in the domain name, which will be + substituted + + accordingly: + + + - `{project.name}`: The name of the project. + + - `{deployment.id}`: The ID of the deployment. + + + The domain name you specify here must be either equal to one of the + custom + + domains you have registered, or a subdomain of one of the wildcard + domains + + you have registered. Let's say you have registered `example.com` and + + `*.example.net` as custom domains via [add a + domain](#post-/organizations/-organizationId-/domains) + + endpoint and set DNS records needed to verify you are the owner of + these. In + + this case, the following table shows what domains are attachable and + why: + + + | Domain | Attachable? | + Comment + | + + | ----------------------------------------------- | ----------- | + ------------------------------------------------------------------------------------------- + | + + | `example.com` | ✅ | Exactly + matches the registered custom domain + `example.com` | + + | `foo.example.net` | ✅ | Covered + by + `*.example.net` + | + + | `*.example.net` | ✅ | Exactly + matches the registered custom domain + `*.example.net` | + + | `{project.name}.example.net` | ✅ | Covered + by `*.example.net`, and the placeholder is + valid | + + | `my-{project.name}.example.net` | ✅ | Covered + by `*.example.net`, and the placeholder is + valid | + + | `my-{project.name}-{deployment.id}.example.net` | ✅ | Covered + by `*.example.net`, and the placeholders are + valid | + + | `foo.example.com` | ❌ | The + custom domain `example.com` is registered, but not `foo.example.com` or + `*.example.com` | + + | `example.net` | ❌ | Not a + subdomain of + `*.example.net` + | + + | `foo.bar.example.net` | ❌ | Not a + subdomain of + `*.example.net` + | + + | `{project.id}.example.net` | ❌ | The + placeholder is not + valid | + + + Besides your custom domains, you can also use `deno.dev` domain without + + the need to register it. In this case, though, only two template formats + + and two known (if you know the project name & deployment ID values) + domains + + are allowed as follows: + + + | Domain | Attachable? | + + | ----------------------------------------- | ----------- | + + | `{project.name}.deno.dev` | ✅ | + + | `{project.name}-{deployment.id}.deno.dev` | ✅ | + + | `myproject.deno.dev` | ✅ | + + | `myproject-mydeploymentid.deno.dev` | ✅ | + + | `foo.deno.dev` | ❌ | + + | `my-{project.name}.deno.dev` | ❌ | + + | `{deployment.id}.deno.dev` | ❌ | + + | `{deployment.id}-{project.name}.deno.dev` | ❌ | + + + Lastly, keep in mind that in order for the attached domain to work + + properly, you also need to set up TLS certificates, either by + + [provisioning a + certificate](#post-/domains/-domainId-/certificates/provision) + + or by [uploading a certificate](#post-/domains/-domainId-/certificates). + + This is not needed for `deno.dev` domains. + DeploymentPermissionsOverwrite: + type: object + description: >- + Permissions to be overwritten for the deployment's existing permissions. + + + Currently only `net` is supported, where you can specify a list of IP + + addresses and/or hostnames that the deployment is allowed to make + outbound + + network requests to. + properties: + net: + type: array + items: + type: string + description: >- + A list of IP addresses that the deployment is allowed to make + outbound + + network requests to. + + + Each element must be a valid IPv4, IPv6, or a hostname like + `example.com` + + although outbound network requests using IPv6 are not supported yet + in + + Deno Deploy regardless. + + In addition to these, a special value `*` can be used, which means + all + + accesses are allowed. Also note the following: + + + - If omitted, no update will happen to the existing permissions. + + - If an empty list is provided, all accesses will be **denied**. + example: + - example.com + - 34.120.54.55 + - '[2600:1901:0:6d85::]' + - '*' + nullable: true + additionalProperties: false + Asset: + oneOf: + - allOf: + - $ref: '#/components/schemas/File' + - type: object + required: + - kind + properties: + kind: + type: string + enum: + - file + - allOf: + - $ref: '#/components/schemas/Symlink' + - type: object + required: + - kind + properties: + kind: + type: string + enum: + - symlink + discriminator: + propertyName: kind + File: + oneOf: + - type: object + required: + - content + properties: + content: + type: string + encoding: + $ref: '#/components/schemas/Encoding' + - type: object + required: + - gitSha1 + properties: + gitSha1: + type: string + Symlink: + type: object + required: + - target + properties: + target: + type: string + additionalProperties: false + Encoding: + type: string + enum: + - utf-8 + - base64 + x-stackQL-resources: + deployments: + id: deno.deployment.deployments + name: deployments + title: Deployments + methods: + list_deployments: + operation: + $ref: '#/paths/~1projects~1{projectId}~1deployments/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_deployment: + operation: + $ref: '#/paths/~1projects~1{projectId}~1deployments/post' + response: + mediaType: application/json + openAPIDocKey: '200' + redeploy_deployment: + operation: + $ref: '#/paths/~1deployments~1{deploymentId}~1redeploy/post' + response: + mediaType: application/json + openAPIDocKey: '200' + get_deployment: + operation: + $ref: '#/paths/~1deployments~1{deploymentId}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_deployment: + operation: + $ref: '#/paths/~1deployments~1{deploymentId}/delete' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: >- + #/components/x-stackQL-resources/deployments/methods/list_deployments + - $ref: >- + #/components/x-stackQL-resources/deployments/methods/get_deployment + insert: + - $ref: >- + #/components/x-stackQL-resources/deployments/methods/create_deployment + update: [] + delete: + - $ref: >- + #/components/x-stackQL-resources/deployments/methods/delete_deployment + replace: [] + build_logs: + id: deno.deployment.build_logs + name: build_logs + title: Build Logs + methods: + get_build_logs: + operation: + $ref: '#/paths/~1deployments~1{deploymentId}~1build_logs/get' + response: + mediaType: application/x-ndjson + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/build_logs/methods/get_build_logs' + insert: [] + update: [] + delete: [] + replace: [] + app_logs: + id: deno.deployment.app_logs + name: app_logs + title: App Logs + methods: + get_app_logs: + operation: + $ref: '#/paths/~1deployments~1{deploymentId}~1app_logs/get' + response: + mediaType: application/x-ndjson + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/app_logs/methods/get_app_logs' + insert: [] + update: [] + delete: [] + replace: [] + domains: + id: deno.deployment.domains + name: domains + title: Domains + methods: + attach_domain_to_deployment: + operation: + $ref: '#/paths/~1deployments~1{deploymentId}~1domains~1{domain}/put' + response: + mediaType: application/json + openAPIDocKey: '200' + detach_domain_from_deployment: + operation: + $ref: '#/paths/~1deployments~1{deploymentId}~1domains~1{domain}/delete' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: [] + insert: [] + update: [] + delete: + - $ref: >- + #/components/x-stackQL-resources/domains/methods/detach_domain_from_deployment + replace: + - $ref: >- + #/components/x-stackQL-resources/domains/methods/attach_domain_to_deployment +servers: + - url: https://api.deno.com/v1 diff --git a/providers/src/deno/v00.00.00000/services/domain.yaml b/providers/src/deno/v00.00.00000/services/domain.yaml new file mode 100644 index 00000000..cc01620a --- /dev/null +++ b/providers/src/deno/v00.00.00000/services/domain.yaml @@ -0,0 +1,796 @@ +openapi: 3.0.3 +info: + title: domain API + description: Operations about domains + version: 1.0.0 +paths: + /organizations/{organizationId}/domains: + get: + tags: + - domain + summary: List domains of an organization + description: >- + This API returns a list of domains belonging to the specified + organization + + in a pagenated manner. + + + The URLs for the next, previous, first, and last page are returned in + the + + `Link` header of the response, if any. + operationId: list_domains + parameters: + - name: page + in: query + description: The page number to return. + required: false + schema: + type: integer + default: 1 + nullable: true + minimum: 1 + - name: limit + in: query + description: The maximum number of items to return per page. + required: false + schema: + type: integer + default: 20 + nullable: true + maximum: 100 + minimum: 1 + - name: q + in: query + description: Query by domain + required: false + schema: + type: string + nullable: true + - name: sort + in: query + description: >- + The field to sort by, `domain`, `created_at`, or `updated_at`. + Defaults to `updated_at`. + required: false + schema: + type: string + nullable: true + - name: order + in: query + description: Sort order, either `asc` or `desc`. Defaults to `asc`. + required: false + schema: + type: string + nullable: true + - name: organizationId + in: path + description: Organization ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + headers: + Link: + schema: + $ref: '#/components/schemas/PaginationLinkHeader' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Domain' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + post: + tags: + - domain + summary: Add a domain to an organization + description: >- + This API allows you to add a new domain to the specified organization. + + + ### Steps to make the added domain available for actual use + + + In order to make the added domain available for actual use, you first + need + + to verify that you are the owner of the domain by calling + + [the verify ownership of a domain + endpoint](https://deno-provider.stackql.io/services/domain/domains/#lifecycle-methods) + + after properly setting up the DNS records for the domain as specified in + the + + `dnsRecords` field of the response of this API. + + + You then also need to have TLS certificates ready for the domain, either + by + + [enabling + auto-provision](https://deno-provider.stackql.io/services/domain/certificates/#lifecycle-methods) + + or by [uploading them manually](https://deno-provider.stackql.io/services/domain/certificates/). + operationId: create_domain + parameters: + - name: organizationId + in: path + description: Organization ID + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDomainRequest' + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Domain' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /domains/{domainId}: + get: + tags: + - domain + summary: Get domain details + operationId: get_domain + parameters: + - name: domainId + in: path + description: Domain ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Domain' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + patch: + tags: + - domain + summary: Associate a domain with a deployment + description: >- + This API allows you to either: + + + 1. associate a domain with a deployment, or + + 2. disassociate a domain from a deployment + + + Domain association is required in order to serve the deployment on the + + domain. + + + If the ownership of the domain is not verified yet, this API will + trigger + + the verification process before associating the domain with the + deployment. + + + The same functionality is provided by [Attach a domain to a deployment] + with + + more flexibility. Consider using that API instead. + + + [Attach a domain to a deployment]: + #put-/deployments/-deploymentId-/domains/-domain- + operationId: update_domain_association + parameters: + - name: domainId + in: path + description: Domain ID + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDomainAssociationRequest' + required: true + responses: + '200': + description: Success + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + deprecated: true + delete: + tags: + - domain + summary: Delete a domain + operationId: delete_domain + parameters: + - name: domainId + in: path + description: Domain ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /domains/{domainId}/verify: + post: + tags: + - domain + summary: Verify ownership of a domain + description: >- + This API triggers the ownership verification of a domain. It should be + + called after necessary DNS records that appear in the `dnsRecords` field + + of the response of [add a + domain](https://deno-provider.stackql.io/services/domain/domains/) + + are set up. + + + ### Domain reactivation + + + If a previously vefified domain, owned by the same organization, was + deleted + + and then re-added, deployments associated with the domain will become + + accessible via the domain once the verification is successfully + completed. + + + For example, if the domain `*.example.com` was owned and verified by + + `example-org` and `foo.example.com` was attached to + `example-deployment`, + + the deployment was accessible via `foo.example.com`. However, if the + domain + + is deleted from the organization, access to the deployment via + + `foo.example.com` is lost, which we refer to as domain deactivation. + + + Subsequently, if `*.example.com` (or even `foo.example.com`) is re-added + to + + the organization and verified, the deployment becomes accessible via + + `foo.example.com` again without any further steps, i.e. the domain is + + reactivated. + operationId: verify_domain + parameters: + - name: domainId + in: path + description: Domain ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /domains/{domainId}/certificates: + post: + tags: + - domain + summary: Upload TLS certificate for a domain + description: >- + This API allows you to upload a TLS certificate for a domain. + + + If the ownership of the domain is not verified yet, this API will + trigger + + the verification process before storing the certificate. + operationId: add_domain_certificate + parameters: + - name: domainId + in: path + description: Domain ID + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AddDomainCertificateRequest' + required: true + responses: + '200': + description: Success + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /domains/{domainId}/certificates/provision: + post: + tags: + - domain + summary: Provision TLS certificates for a domain + description: >- + This API begins the provisioning of TLS certificates for a domain. + + + Note that a call to this API may take a while, up to a minute or so. + + + If the ownership of the domain is not verified yet, this API will + trigger + + the verification process before provisioning the certificate. + operationId: provision_domain_certificates + parameters: + - name: domainId + in: path + description: Domain ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' +components: + schemas: + PaginationLinkHeader: + type: string + description: >- + Pagination links. + + This header provides URLS for the `prev`, `next`, `first`, and `last` + pages. + + The format conforms to [RFC 8288](https://tools.ietf.org/html/rfc8288). + example: >- + ; rel="next", + ; rel="prev", + ; rel="first", + ; rel="last" + Domain: + type: object + required: + - id + - organizationId + - domain + - token + - isValidated + - certificates + - provisioningStatus + - createdAt + - updatedAt + - dnsRecords + properties: + id: + type: string + format: uuid + description: The ID of the domain. + organizationId: + type: string + format: uuid + description: The ID of the organization that the domain is associated with. + domain: + type: string + description: The domain value. + example: example.com + token: + type: string + example: b7e28147130005f5593d09e6 + isValidated: + type: boolean + description: Whether the domain's ownership is validated or not. + certificates: + type: array + items: + $ref: '#/components/schemas/DomainCertificate' + description: TLS certificates for the domain. + provisioningStatus: + $ref: '#/components/schemas/ProvisioningStatus' + projectId: + type: string + format: uuid + description: >- + The ID of the project that the domain is associated with. + + + If the domain is not associated with any project, this field is + omitted. + nullable: true + deploymentId: + allOf: + - $ref: '#/components/schemas/DeploymentId' + nullable: true + createdAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + updatedAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + dnsRecords: + type: array + items: + $ref: '#/components/schemas/DnsRecord' + description: These records are used to verify the ownership of the domain. + additionalProperties: false + ErrorBody: + type: object + required: + - code + - message + properties: + code: + type: string + description: The error code + message: + type: string + description: The error message + CreateDomainRequest: + type: object + required: + - domain + properties: + domain: + type: string + example: foo.example.com + additionalProperties: false + UpdateDomainAssociationRequest: + type: object + properties: + deploymentId: + allOf: + - $ref: '#/components/schemas/DeploymentId' + nullable: true + additionalProperties: false + AddDomainCertificateRequest: + type: object + required: + - privateKey + - certificateChain + properties: + privateKey: + type: string + description: The PEM encoded private key for the TLS certificate + example: | + -----BEGIN EC PRIVATE KEY----- + foobar + -----END EC PRIVATE KEY----- + certificateChain: + type: string + description: The PRM encoded certificate chain for the TLS certificate + example: | + -----BEGIN CERTIFICATE----- + foobar + -----END CERTIFICATE----- + additionalProperties: false + DomainCertificate: + type: object + required: + - cipher + - expiresAt + - createdAt + - updatedAt + properties: + cipher: + $ref: '#/components/schemas/TlsCipher' + expiresAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + createdAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + updatedAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + additionalProperties: false + ProvisioningStatus: + oneOf: + - type: object + required: + - code + properties: + code: + type: string + enum: + - success + - type: object + required: + - message + - code + properties: + message: + type: string + code: + type: string + enum: + - failed + - type: object + required: + - code + properties: + code: + type: string + enum: + - pending + - type: object + required: + - code + properties: + code: + type: string + enum: + - manual + discriminator: + propertyName: code + DeploymentId: + type: string + description: >- + A deployment ID + + + Note that this is not UUID v4, as opposed to organization ID and project + ID. + example: abcde12vwxyz + DnsRecord: + type: object + required: + - type + - name + - content + properties: + type: + type: string + example: A + name: + type: string + example: deploy-sample + content: + type: string + example: 127.0.0.1 + additionalProperties: false + TlsCipher: + type: string + enum: + - rsa + - ec + x-stackQL-resources: + domains: + id: deno.domain.domains + name: domains + title: Domains + methods: + list_domains: + operation: + $ref: '#/paths/~1organizations~1{organizationId}~1domains/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_domain: + operation: + $ref: '#/paths/~1organizations~1{organizationId}~1domains/post' + response: + mediaType: application/json + openAPIDocKey: '200' + get_domain: + operation: + $ref: '#/paths/~1domains~1{domainId}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + update_domain_association: + operation: + $ref: '#/paths/~1domains~1{domainId}/patch' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_domain: + operation: + $ref: '#/paths/~1domains~1{domainId}/delete' + response: + mediaType: application/json + openAPIDocKey: '200' + verify_domain: + operation: + $ref: '#/paths/~1domains~1{domainId}~1verify/post' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/domains/methods/list_domains' + - $ref: '#/components/x-stackQL-resources/domains/methods/get_domain' + insert: + - $ref: '#/components/x-stackQL-resources/domains/methods/create_domain' + update: [] + delete: + - $ref: '#/components/x-stackQL-resources/domains/methods/delete_domain' + replace: [] + certificates: + id: deno.domain.certificates + name: certificates + title: Certificates + methods: + add_domain_certificate: + operation: + $ref: '#/paths/~1domains~1{domainId}~1certificates/post' + response: + mediaType: application/json + openAPIDocKey: '200' + provision_domain_certificates: + operation: + $ref: '#/paths/~1domains~1{domainId}~1certificates~1provision/post' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: [] + insert: [] + update: [] + delete: [] + replace: [] +servers: + - url: https://api.deno.com/v1 diff --git a/providers/src/deno/v00.00.00000/services/organization.yaml b/providers/src/deno/v00.00.00000/services/organization.yaml new file mode 100644 index 00000000..4089afa5 --- /dev/null +++ b/providers/src/deno/v00.00.00000/services/organization.yaml @@ -0,0 +1,341 @@ +openapi: 3.0.3 +info: + title: organization API + description: Operations about organizations + version: 1.0.0 +paths: + /organizations/{organizationId}: + get: + tags: + - organization + summary: Get organization details + operationId: get_organization + parameters: + - name: organizationId + in: path + description: Organization ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Organization' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /organizations/{organizationId}/analytics: + get: + tags: + - organization + summary: Retrieve organization analytics + description: >- + This API returns analytics for the specified organization. + + The analytics are returned as time series data in 15 minute intervals, + with + + the `time` field representing the start of the interval. + operationId: get_organization_analytics + parameters: + - name: organizationId + in: path + description: Organization ID + required: true + schema: + type: string + format: uuid + - name: since + in: query + description: |- + + Start of the time range in RFC3339 format. + + Defaults to 24 hours ago. + + Note that the maximum allowed time range is 24 hours. + + required: true + schema: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + - name: until + in: query + description: |- + + End of the time range in RFC3339 format. + + Defaults to the current time. + + Note that the maximum allowed time range is 24 hours. + + required: true + schema: + type: string + format: date-time + example: '2021-08-02T00:00:00Z' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Analytics' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' +components: + schemas: + Organization: + type: object + required: + - id + - name + - createdAt + - updatedAt + properties: + id: + type: string + format: uuid + name: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + additionalProperties: false + example: + id: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 + name: my-org + createdAt: '2021-08-01T00:00:00Z' + updatedAt: '2021-08-01T00:00:00Z' + ErrorBody: + type: object + required: + - code + - message + properties: + code: + type: string + description: The error code + message: + type: string + description: The error message + Analytics: + type: object + description: Project analytics data + required: + - fields + - values + properties: + fields: + type: array + items: + $ref: '#/components/schemas/AnalyticsFieldSchema' + values: + type: array + items: + type: array + items: + $ref: '#/components/schemas/AnalyticsDataValue' + additionalProperties: false + example: + fields: + - name: time + type: time + - name: requestCount + type: number + - name: cpuSeconds + type: number + - name: uptimeSeconds + type: number + - name: maxRssMemoryBytes + type: number + - name: networkIngressBytes + type: number + - name: networkEgressBytes + type: number + - name: kvReadCount + type: number + - name: kvWriteCount + type: number + - name: kvReadUnits + type: number + - name: kvWriteUnits + type: number + - name: kvStorageBytes + type: number + values: + - - '2023-08-01T00:00:00Z' + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - - '2023-08-01T00:15:00Z' + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - - '2023-08-01T00:30:00Z' + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - - '2023-08-01T00:45:00Z' + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - - '2023-08-01T01:00:00Z' + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + AnalyticsFieldSchema: + type: object + required: + - name + - type + properties: + name: + type: string + type: + $ref: '#/components/schemas/AnalyticsFieldType' + additionalProperties: false + AnalyticsDataValue: + oneOf: + - type: string + format: date-time + - type: number + format: double + - type: string + - type: boolean + - {} + AnalyticsFieldType: + type: string + description: >- + A data type that analytic data can be represented in. + + + Inspired by Grafana's data types defined at: + + https://github.com/grafana/grafana/blob/e3288834b37b9aac10c1f43f0e621b35874c1f8a/packages/grafana-data/src/types/dataFrame.ts#L11-L23 + enum: + - time + - number + - string + - boolean + - other + x-stackQL-resources: + organizations: + id: deno.organization.organizations + name: organizations + title: Organizations + methods: + get_organization: + operation: + $ref: '#/paths/~1organizations~1{organizationId}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: >- + #/components/x-stackQL-resources/organizations/methods/get_organization + insert: [] + update: [] + delete: [] + replace: [] + analytics: + id: deno.organization.analytics + name: analytics + title: Analytics + methods: + get_organization_analytics: + operation: + $ref: '#/paths/~1organizations~1{organizationId}~1analytics/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: >- + #/components/x-stackQL-resources/analytics/methods/get_organization_analytics + insert: [] + update: [] + delete: [] + replace: [] +servers: + - url: https://api.deno.com/v1 diff --git a/providers/src/deno/v00.00.00000/services/project.yaml b/providers/src/deno/v00.00.00000/services/project.yaml new file mode 100644 index 00000000..bfd57507 --- /dev/null +++ b/providers/src/deno/v00.00.00000/services/project.yaml @@ -0,0 +1,652 @@ +openapi: 3.0.3 +info: + title: project API + description: Operations about projects + version: 1.0.0 +paths: + /organizations/{organizationId}/projects: + get: + tags: + - project + summary: List projects of an organization + description: >- + This API returns a list of projects belonging to the specified + organization + + in a pagenated manner. + + The URLs for the next, previous, first, and last page are returned in + the + + `Link` header of the response, if any. + operationId: list_projects + parameters: + - name: page + in: query + description: The page number to return. + required: false + schema: + type: integer + default: 1 + nullable: true + minimum: 1 + - name: limit + in: query + description: The maximum number of items to return per page. + required: false + schema: + type: integer + default: 20 + nullable: true + maximum: 100 + minimum: 1 + - name: q + in: query + description: Query by project name or project ID + required: false + schema: + type: string + nullable: true + - name: sort + in: query + description: >- + The field to sort by, either `name`, `updated_at`, `requests`, or + `bandwidth`. Defaults to `updated_at`. + required: false + schema: + type: string + nullable: true + - name: order + in: query + description: Sort order, either `asc` or `desc`. Defaults to `asc`. + required: false + schema: + type: string + nullable: true + - name: organizationId + in: path + description: Organization ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + headers: + Link: + schema: + $ref: '#/components/schemas/PaginationLinkHeader' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Project' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + post: + tags: + - project + summary: Create a project + description: |- + This API allows you to create a new project under the specified + organization. + The project name is optional; if not provided, a random name will be + generated. + operationId: create_project + parameters: + - name: organizationId + in: path + description: Organization ID + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProjectRequest' + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /projects/{projectId}: + get: + tags: + - project + summary: Get project details + operationId: get_project + parameters: + - name: projectId + in: path + description: Project ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + patch: + tags: + - project + summary: Update project details + operationId: update_project + parameters: + - name: projectId + in: path + description: Project ID + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProjectRequest' + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + delete: + tags: + - project + summary: Delete a project + operationId: delete_project + parameters: + - name: projectId + in: path + description: Project ID + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Success + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + /projects/{projectId}/analytics: + get: + tags: + - project + summary: Retrieve project analytics + description: >- + This API returns analytics for the specified project. + + The analytics are returned as time series data in 15 minute intervals, + with + + the `time` field representing the start of the interval. + operationId: get_project_analytics + parameters: + - name: projectId + in: path + description: Project ID + required: true + schema: + type: string + format: uuid + - name: since + in: query + description: |- + + Start of the time range in RFC3339 format. + + Defaults to 24 hours ago. + + required: true + schema: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + - name: until + in: query + description: |- + + End of the time range in RFC3339 format. + + Defaults to the current time. + + required: true + schema: + type: string + format: date-time + example: '2021-08-02T00:00:00Z' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Analytics' + '400': + description: Invalid Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' +components: + schemas: + PaginationLinkHeader: + type: string + description: >- + Pagination links. + + This header provides URLS for the `prev`, `next`, `first`, and `last` + pages. + + The format conforms to [RFC 8288](https://tools.ietf.org/html/rfc8288). + example: >- + ; rel="next", + ; rel="prev", + ; rel="first", + ; rel="last" + Project: + type: object + required: + - id + - name + - description + - createdAt + - updatedAt + properties: + id: + type: string + format: uuid + example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 + name: + type: string + example: my-project + description: + type: string + example: this is my project. + maxLength: 1000 + createdAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + updatedAt: + type: string + format: date-time + example: '2021-08-01T00:00:00Z' + additionalProperties: false + ErrorBody: + type: object + required: + - code + - message + properties: + code: + type: string + description: The error code + message: + type: string + description: The error message + CreateProjectRequest: + type: object + properties: + name: + type: string + description: >- + The name of the project. This must be globally unique. If this is + `null`, + + a random unique name will be generated. + example: my-project + nullable: true + description: + type: string + description: >- + The description of the project. If this is `null`, an empty string + will be + + set. + example: This is my project. + nullable: true + maxLength: 1000 + additionalProperties: false + UpdateProjectRequest: + type: object + properties: + name: + type: string + description: >- + The name of the project to be updated to. This must be globally + unique. + + If this is `null`, no update will be made to the project name. + example: my-project2 + nullable: true + description: + type: string + description: >- + The description of the project to be updated to. If this is `null`, + no + + update will be made to the project description. + example: This is my project2. + nullable: true + maxLength: 1000 + additionalProperties: false + Analytics: + type: object + description: Project analytics data + required: + - fields + - values + properties: + fields: + type: array + items: + $ref: '#/components/schemas/AnalyticsFieldSchema' + values: + type: array + items: + type: array + items: + $ref: '#/components/schemas/AnalyticsDataValue' + additionalProperties: false + example: + fields: + - name: time + type: time + - name: requestCount + type: number + - name: cpuSeconds + type: number + - name: uptimeSeconds + type: number + - name: maxRssMemoryBytes + type: number + - name: networkIngressBytes + type: number + - name: networkEgressBytes + type: number + - name: kvReadCount + type: number + - name: kvWriteCount + type: number + - name: kvReadUnits + type: number + - name: kvWriteUnits + type: number + - name: kvStorageBytes + type: number + values: + - - '2023-08-01T00:00:00Z' + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - 111 + - - '2023-08-01T00:15:00Z' + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - 222 + - - '2023-08-01T00:30:00Z' + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - 333 + - - '2023-08-01T00:45:00Z' + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - 444 + - - '2023-08-01T01:00:00Z' + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + - 555 + AnalyticsFieldSchema: + type: object + required: + - name + - type + properties: + name: + type: string + type: + $ref: '#/components/schemas/AnalyticsFieldType' + additionalProperties: false + AnalyticsDataValue: + oneOf: + - type: string + format: date-time + - type: number + format: double + - type: string + - type: boolean + - {} + AnalyticsFieldType: + type: string + description: >- + A data type that analytic data can be represented in. + + + Inspired by Grafana's data types defined at: + + https://github.com/grafana/grafana/blob/e3288834b37b9aac10c1f43f0e621b35874c1f8a/packages/grafana-data/src/types/dataFrame.ts#L11-L23 + enum: + - time + - number + - string + - boolean + - other + x-stackQL-resources: + projects: + id: deno.project.projects + name: projects + title: Projects + methods: + list_projects: + operation: + $ref: '#/paths/~1organizations~1{organizationId}~1projects/get' + response: + mediaType: application/json + openAPIDocKey: '200' + create_project: + operation: + $ref: '#/paths/~1organizations~1{organizationId}~1projects/post' + response: + mediaType: application/json + openAPIDocKey: '200' + get_project: + operation: + $ref: '#/paths/~1projects~1{projectId}/get' + response: + mediaType: application/json + openAPIDocKey: '200' + update_project: + operation: + $ref: '#/paths/~1projects~1{projectId}/patch' + response: + mediaType: application/json + openAPIDocKey: '200' + delete_project: + operation: + $ref: '#/paths/~1projects~1{projectId}/delete' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: '#/components/x-stackQL-resources/projects/methods/list_projects' + - $ref: '#/components/x-stackQL-resources/projects/methods/get_project' + insert: + - $ref: '#/components/x-stackQL-resources/projects/methods/create_project' + update: + - $ref: '#/components/x-stackQL-resources/projects/methods/update_project' + delete: + - $ref: '#/components/x-stackQL-resources/projects/methods/delete_project' + replace: [] + analytics: + id: deno.project.analytics + name: analytics + title: Analytics + methods: + get_project_analytics: + operation: + $ref: '#/paths/~1projects~1{projectId}~1analytics/get' + response: + mediaType: application/json + openAPIDocKey: '200' + sqlVerbs: + select: + - $ref: >- + #/components/x-stackQL-resources/analytics/methods/get_project_analytics + insert: [] + update: [] + delete: [] + replace: [] +servers: + - url: https://api.deno.com/v1