From 3d8a8c0c661487a2a4e8ce0fc2804545fc54389b Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 21 Jul 2026 09:35:34 +0000 Subject: [PATCH] Regenerate client from commit 86a61b6 of spec repo --- .generator/schemas/v2/openapi.yaml | 482 ++++++++++++++++++ packages/datadog-api-client/README.md | 1 + .../src/support/scenarios_model_mapping.ts | 14 + services/ddsql/.yarnrc.yml | 1 + services/ddsql/README.md | 47 ++ services/ddsql/package.json | 43 ++ services/ddsql/src/index.ts | 3 + services/ddsql/src/v2/DDSQLApi.ts | 399 +++++++++++++++ services/ddsql/src/v2/index.ts | 26 + .../ddsql/src/v2/models/APIErrorResponse.ts | 45 ++ .../src/v2/models/DdsqlTabularQueryColumn.ts | 69 +++ .../models/DdsqlTabularQueryFetchRequest.ts | 47 ++ ...DdsqlTabularQueryFetchRequestAttributes.ts | 46 ++ .../DdsqlTabularQueryFetchRequestData.ts | 57 +++ .../DdsqlTabularQueryFetchRequestType.ts | 9 + .../src/v2/models/DdsqlTabularQueryRequest.ts | 47 ++ .../DdsqlTabularQueryRequestAttributes.ts | 70 +++ .../v2/models/DdsqlTabularQueryRequestData.ts | 57 +++ .../v2/models/DdsqlTabularQueryRequestType.ts | 9 + .../v2/models/DdsqlTabularQueryResponse.ts | 60 +++ .../DdsqlTabularQueryResponseAttributes.ts | 78 +++ .../models/DdsqlTabularQueryResponseData.ts | 67 +++ .../models/DdsqlTabularQueryResponseMeta.ts | 57 +++ .../models/DdsqlTabularQueryResponseType.ts | 9 + .../src/v2/models/DdsqlTabularQueryState.ts | 14 + .../v2/models/DdsqlTabularQueryTimeWindow.ts | 59 +++ .../ddsql/src/v2/models/JSONAPIErrorItem.ts | 78 +++ .../src/v2/models/JSONAPIErrorItemSource.ts | 60 +++ .../src/v2/models/JSONAPIErrorResponse.ts | 47 ++ services/ddsql/src/v2/models/TypingInfo.ts | 47 ++ services/ddsql/tsconfig.json | 28 + yarn.lock | 9 + 32 files changed, 2085 insertions(+) create mode 100644 services/ddsql/.yarnrc.yml create mode 100644 services/ddsql/README.md create mode 100644 services/ddsql/package.json create mode 100644 services/ddsql/src/index.ts create mode 100644 services/ddsql/src/v2/DDSQLApi.ts create mode 100644 services/ddsql/src/v2/index.ts create mode 100644 services/ddsql/src/v2/models/APIErrorResponse.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryColumn.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequest.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestAttributes.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestData.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestType.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryRequest.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryRequestAttributes.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryRequestData.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryRequestType.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryResponse.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryResponseAttributes.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryResponseData.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryResponseMeta.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryResponseType.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryState.ts create mode 100644 services/ddsql/src/v2/models/DdsqlTabularQueryTimeWindow.ts create mode 100644 services/ddsql/src/v2/models/JSONAPIErrorItem.ts create mode 100644 services/ddsql/src/v2/models/JSONAPIErrorItemSource.ts create mode 100644 services/ddsql/src/v2/models/JSONAPIErrorResponse.ts create mode 100644 services/ddsql/src/v2/models/TypingInfo.ts create mode 100644 services/ddsql/tsconfig.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 61320cadad6b..dc7fca455901 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -30970,6 +30970,257 @@ components: example: 1722439510282 format: int64 type: integer + DdsqlTabularQueryColumn: + description: A single column of a DDSQL tabular query result. + properties: + name: + description: Name of the column as projected by the SQL statement. + example: service + type: string + type: + description: |- + DDSQL data type of the column's values, for example `VARCHAR`, `BIGINT`, + `DECIMAL`, `BOOLEAN`, `TIMESTAMP`, `JSON`, or an array variant such as + `VARCHAR[]`. See the + [DDSQL data-types reference](https://docs.datadoghq.com/ddsql_reference/#data-types) + for the full, up-to-date list. + example: VARCHAR + type: string + values: + description: |- + Column values in row order. The element type matches the column's `type`; + for example a `VARCHAR` column carries strings, a `TIMESTAMP` column carries + Unix-millisecond integers. `null` is allowed for missing values. + example: + - web-store + - checkout + items: {} + type: array + required: + - name + - type + - values + type: object + DdsqlTabularQueryColumns: + description: |- + Column-major result set. Each element carries one column's name, type, and values, + with one value per row of the result. Set when `state` is `completed`. + items: + $ref: "#/components/schemas/DdsqlTabularQueryColumn" + type: array + DdsqlTabularQueryFetchRequest: + description: Wrapper for a DDSQL tabular query fetch request. + properties: + data: + $ref: "#/components/schemas/DdsqlTabularQueryFetchRequestData" + required: + - data + type: object + DdsqlTabularQueryFetchRequestAttributes: + description: Attributes describing which previously submitted DDSQL query to fetch. + properties: + query_id: + description: |- + Opaque token returned by an earlier execute or fetch response that carried + `state: running`. Identifies the query to poll for results. + example: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ==" + type: string + required: + - query_id + type: object + DdsqlTabularQueryFetchRequestData: + description: JSON:API resource object for a DDSQL tabular query fetch request. + properties: + attributes: + $ref: "#/components/schemas/DdsqlTabularQueryFetchRequestAttributes" + type: + $ref: "#/components/schemas/DdsqlTabularQueryFetchRequestType" + required: + - type + - attributes + type: object + DdsqlTabularQueryFetchRequestType: + default: ddsql_query_fetch_request + description: JSON:API resource type for a DDSQL tabular query fetch request. + enum: + - ddsql_query_fetch_request + example: ddsql_query_fetch_request + type: string + x-enum-varnames: + - DDSQL_QUERY_FETCH_REQUEST + DdsqlTabularQueryRequest: + description: Wrapper for a DDSQL tabular query execution request. + properties: + data: + $ref: "#/components/schemas/DdsqlTabularQueryRequestData" + required: + - data + type: object + DdsqlTabularQueryRequestAttributes: + description: Attributes describing the DDSQL query to execute. + properties: + query: + description: |- + The DDSQL statement to execute. DDSQL is Datadog's SQL dialect, which is a subset + of PostgreSQL, scoped to Datadog data sources. + example: "SELECT cloud_provider, count(*) FROM dd.hosts group by cloud_provider" + type: string + row_limit: + description: |- + Cap on the number of rows returned. Defaults to 5,000 when omitted. Must be + between 1 and 10,000 inclusive; values outside this range are rejected with 400. + example: 1000 + format: int64 + maximum: 10000 + minimum: 1 + type: integer + time: + $ref: "#/components/schemas/DdsqlTabularQueryTimeWindow" + required: + - query + - time + type: object + DdsqlTabularQueryRequestData: + description: JSON:API resource object for a DDSQL tabular query execution request. + properties: + attributes: + $ref: "#/components/schemas/DdsqlTabularQueryRequestAttributes" + type: + $ref: "#/components/schemas/DdsqlTabularQueryRequestType" + required: + - type + - attributes + type: object + DdsqlTabularQueryRequestType: + default: ddsql_query_request + description: JSON:API resource type for a DDSQL tabular query request. + enum: + - ddsql_query_request + example: ddsql_query_request + type: string + x-enum-varnames: + - DDSQL_QUERY_REQUEST + DdsqlTabularQueryResponse: + description: |- + Response envelope for both the execute and fetch DDSQL tabular query endpoints. + Carries the JSON:API primary resource and a top-level `meta` block with + request-scoped observability handles. + properties: + data: + $ref: "#/components/schemas/DdsqlTabularQueryResponseData" + meta: + $ref: "#/components/schemas/DdsqlTabularQueryResponseMeta" + required: + - data + - meta + type: object + DdsqlTabularQueryResponseAttributes: + description: |- + Attributes of a DDSQL tabular query response. `query_id` is set when + `state` is `running`; `columns` is set when `state` is `completed`. + properties: + columns: + $ref: "#/components/schemas/DdsqlTabularQueryColumns" + query_id: + description: |- + Opaque token to pass to the fetch endpoint to poll for results. + Set when `state` is `running` and absent when `state` is `completed`. + example: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ==" + type: string + state: + $ref: "#/components/schemas/DdsqlTabularQueryState" + warnings: + $ref: "#/components/schemas/DdsqlTabularQueryWarnings" + required: + - state + type: object + DdsqlTabularQueryResponseData: + description: JSON:API resource object for a DDSQL tabular query response. + properties: + attributes: + $ref: "#/components/schemas/DdsqlTabularQueryResponseAttributes" + id: + description: Stable identifier for the query response resource. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/DdsqlTabularQueryResponseType" + required: + - id + - type + - attributes + type: object + DdsqlTabularQueryResponseMeta: + description: |- + Top-level JSON:API meta block accompanying every DDSQL tabular query response. + Carries standard observability handles for client-side correlation. + properties: + elapsed: + description: Server-side time spent serving this request, in milliseconds. + example: 87 + format: int64 + type: integer + request_id: + description: |- + Echo of the `DD-Request-ID` header assigned by Datadog's edge to this request, + for support correlation. + example: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7082" + type: string + required: + - elapsed + - request_id + type: object + DdsqlTabularQueryResponseType: + default: ddsql_query_response + description: JSON:API resource type for a DDSQL tabular query response. + enum: + - ddsql_query_response + example: ddsql_query_response + type: string + x-enum-varnames: + - DDSQL_QUERY_RESPONSE + DdsqlTabularQueryState: + description: |- + Lifecycle state of a DDSQL tabular query response. + `running` means the query is still executing and the client should poll + the fetch endpoint with the returned `query_id`. `completed` means the + result set is inlined in `columns` and no further polling is required. + enum: + - running + - completed + example: completed + type: string + x-enum-varnames: + - RUNNING + - COMPLETED + DdsqlTabularQueryTimeWindow: + description: |- + Time window scoping the underlying data sources, expressed in Unix milliseconds + since the epoch. Inclusive on `from_timestamp`, exclusive on `to_timestamp`. + Results from static tables (for example, `dd.hosts`) are not affected by the + time window, but the field must still be provided. + properties: + from_timestamp: + description: Start of the query window (inclusive), in Unix milliseconds since the epoch. + example: 1736942400000 + format: int64 + type: integer + to_timestamp: + description: End of the query window (exclusive), in Unix milliseconds since the epoch. + example: 1736946000000 + format: int64 + type: integer + required: + - from_timestamp + - to_timestamp + type: object + DdsqlTabularQueryWarnings: + description: Non-fatal messages emitted by the query engine while serving this response. + items: + description: A single non-fatal warning message. + example: "Query result was truncated at the configured row_limit." + type: string + type: array DefaultRulesetsPerLanguageData: description: The primary data object in the default rulesets per language response. properties: @@ -133799,6 +134050,231 @@ paths: x-unstable: |- **Note: Data Access is in preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).** + /api/v2/ddsql/query/tabular: + post: + description: |- + Submit a DDSQL statement and return either a `running` state with an opaque `query_id` + for the client to poll, or a `completed` state with the column-major result set inlined + when the query finishes quickly enough to be served synchronously. + operationId: ExecuteDdsqlTabularQuery + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + query: "SELECT cloud_provider, count(*) FROM dd.hosts group by cloud_provider" + row_limit: 1000 + time: + from_timestamp: 1736942400000 + to_timestamp: 1736946000000 + type: ddsql_query_request + schema: + $ref: "#/components/schemas/DdsqlTabularQueryRequest" + required: true + responses: + "200": + content: + application/json: + examples: + completed: + summary: Query finished synchronously + value: + data: + attributes: + columns: + - name: service + type: VARCHAR + values: + - web-store + - checkout + - name: count + type: BIGINT + values: + - 1024 + - 512 + state: completed + id: "00000000-0000-0000-0000-000000000000" + type: ddsql_query_response + meta: + elapsed: 318 + request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7081" + default: + summary: Query finished synchronously + value: + data: + attributes: + columns: + - name: service + type: VARCHAR + values: + - web-store + - checkout + - name: count + type: BIGINT + values: + - 1024 + - 512 + state: completed + id: "00000000-0000-0000-0000-000000000000" + type: ddsql_query_response + meta: + elapsed: 318 + request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7081" + running: + summary: Query still executing + value: + data: + attributes: + query_id: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ==" + state: running + id: "00000000-0000-0000-0000-000000000000" + type: ddsql_query_response + meta: + elapsed: 42 + request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7081" + schema: + $ref: "#/components/schemas/DdsqlTabularQueryResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Execute a tabular DDSQL query + tags: + - DDSQL + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/ddsql/query/tabular/fetch: + post: + description: |- + Poll a previously submitted DDSQL query for results. Pass the opaque `query_id` returned + by a prior `ExecuteDdsqlTabularQuery` (or by a prior `FetchDdsqlTabularQuery` that + returned `state: running`) and the server returns either a `running` state to poll again + or a `completed` state with the column-major result set inlined. + operationId: FetchDdsqlTabularQuery + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + query_id: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ==" + type: ddsql_query_fetch_request + schema: + $ref: "#/components/schemas/DdsqlTabularQueryFetchRequest" + required: true + responses: + "200": + content: + application/json: + examples: + completed: + summary: Query finished + value: + data: + attributes: + columns: + - name: service + type: VARCHAR + values: + - web-store + - checkout + - name: count + type: BIGINT + values: + - 1024 + - 512 + state: completed + id: "00000000-0000-0000-0000-000000000000" + type: ddsql_query_response + meta: + elapsed: 87 + request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7082" + default: + summary: Query finished + value: + data: + attributes: + columns: + - name: service + type: VARCHAR + values: + - web-store + - checkout + - name: count + type: BIGINT + values: + - 1024 + - 512 + state: completed + id: "00000000-0000-0000-0000-000000000000" + type: ddsql_query_response + meta: + elapsed: 87 + request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7082" + running: + summary: Query still executing + value: + data: + attributes: + query_id: "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIGxvZ3MifQ==" + state: running + id: "00000000-0000-0000-0000-000000000000" + type: ddsql_query_response + meta: + elapsed: 12 + request_id: "req-7f3e7d2c-1a0b-4d3e-9b2a-3c4d5e6f7082" + schema: + $ref: "#/components/schemas/DdsqlTabularQueryResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Fetch the result of a DDSQL query + tags: + - DDSQL + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/deletion/data/{product}: post: description: Creates a data deletion request by providing a query and a timeframe targeting the proper data. @@ -201815,6 +202291,12 @@ tags: Programmatic management of a customer's Datadog organization. Use this API to perform self-service organization lifecycle actions such as disabling the authenticated org. name: Customer Org + - description: |- + Execute DDSQL queries against the Datadog data catalog and poll for their results. + Queries are dispatched asynchronously: the initial request may return a `running` state with + a `query_id`, and clients poll the fetch endpoint until the response transitions to + `completed` with a column-major result set. + name: DDSQL - description: |- Search, send, or delete events for DORA Metrics to measure and improve your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/) for more information. diff --git a/packages/datadog-api-client/README.md b/packages/datadog-api-client/README.md index 1819c58fb6a6..098cca7c38a5 100644 --- a/packages/datadog-api-client/README.md +++ b/packages/datadog-api-client/README.md @@ -391,6 +391,7 @@ apiInstance | Data Deletion | @datadog/datadog-api-client-data-deletion | [README.md](../../services/data-deletion/README.md) | | Data Observability | @datadog/datadog-api-client-data-observability | [README.md](../../services/data-observability/README.md) | | Datasets | @datadog/datadog-api-client-datasets | [README.md](../../services/datasets/README.md) | +| DDSQL | @datadog/datadog-api-client-ddsql | [README.md](../../services/ddsql/README.md) | | Deployment Gates | @datadog/datadog-api-client-deployment-gates | [README.md](../../services/deployment-gates/README.md) | | Domain Allowlist | @datadog/datadog-api-client-domain-allowlist | [README.md](../../services/domain-allowlist/README.md) | | DORA Metrics | @datadog/datadog-api-client-dora-metrics | [README.md](../../services/dora-metrics/README.md) | diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 54ae172bab12..39d4c22f7e39 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -8872,6 +8872,20 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "{}", }, + "DDSQLApi.V2.ExecuteDdsqlTabularQuery": { + body: { + type: "DdsqlTabularQueryRequest", + format: "", + }, + operationResponseType: "DdsqlTabularQueryResponse", + }, + "DDSQLApi.V2.FetchDdsqlTabularQuery": { + body: { + type: "DdsqlTabularQueryFetchRequest", + format: "", + }, + operationResponseType: "DdsqlTabularQueryResponse", + }, "DataDeletionApi.V2.CreateDataDeletionRequest": { product: { type: "string", diff --git a/services/ddsql/.yarnrc.yml b/services/ddsql/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/ddsql/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/ddsql/README.md b/services/ddsql/README.md new file mode 100644 index 000000000000..5cbb81c8cb6a --- /dev/null +++ b/services/ddsql/README.md @@ -0,0 +1,47 @@ +# @datadog/datadog-api-client-ddsql + +## Description + +Execute DDSQL queries against the Datadog data catalog and poll for their results. +Queries are dispatched asynchronously: the initial request may return a `running` state with +a `query_id`, and clients poll the fetch endpoint until the response transitions to +`completed` with a column-major result set. + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-ddsql +# Yarn +yarn add @datadog/datadog-api-client-ddsql +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { DDSQLApiV2 } from "@datadog/datadog-api-client-ddsql"; +import { v2 } from "@datadog/datadog-api-client-ddsql"; + +const configuration = createConfiguration(); +// Enable unstable operations +const configurationOpts = { + unstableOperations: { + "DDSQLApi.v2.executeDdsqlTabularQuery": true + } +} + +const configuration = createConfiguration(configurationOpts); +const apiInstance = new DDSQLApiV2(configuration); +const params = {/* parameters */}; + +apiInstance.executeDdsqlTabularQuery(params).then((data) => { + console.log("API called successfully. Returned data: " + JSON.stringify(data)); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/ddsql/package.json b/services/ddsql/package.json new file mode 100644 index 000000000000..1f94afa7005a --- /dev/null +++ b/services/ddsql/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-ddsql", + "description": "", + "author": "", + "keywords": [ + "api", + "fetch", + "typescript" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/DataDog/datadog-api-client-typescript.git", + "directory": "services/ddsql" + }, + "files": [ + "dist/**/*" + ], + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "prepack": "yarn workspace @datadog/datadog-api-client build && yarn build", + "build": "yarn generate-version-files && tsc", + "generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts" + }, + "dependencies": { + "@datadog/datadog-api-client": "^2.0.0-beta.2" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/ddsql/src/index.ts b/services/ddsql/src/index.ts new file mode 100644 index 000000000000..b7e777240e68 --- /dev/null +++ b/services/ddsql/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { DDSQLApi as DDSQLApiV2 } from "./v2/DDSQLApi"; diff --git a/services/ddsql/src/v2/DDSQLApi.ts b/services/ddsql/src/v2/DDSQLApi.ts new file mode 100644 index 000000000000..af3712b1fdee --- /dev/null +++ b/services/ddsql/src/v2/DDSQLApi.ts @@ -0,0 +1,399 @@ +import { + ApiException, + BaseAPIRequestFactory, + BaseServerConfiguration, + buildUserAgent, + Configuration, + createConfiguration, + deserialize, + getPreferredMediaType, + HttpMethod, + isBrowser, + logger, + normalizeMediaType, + parse, + RequiredError, + RequestContext, + ResponseContext, + serialize, + ServerConfiguration, + stringify, + applySecurityAuthentication, +} from "@datadog/datadog-api-client"; + +import { TypingInfo } from "./models/TypingInfo"; +import { APIErrorResponse } from "./models/APIErrorResponse"; +import { DdsqlTabularQueryFetchRequest } from "./models/DdsqlTabularQueryFetchRequest"; +import { DdsqlTabularQueryRequest } from "./models/DdsqlTabularQueryRequest"; +import { DdsqlTabularQueryResponse } from "./models/DdsqlTabularQueryResponse"; +import { JSONAPIErrorResponse } from "./models/JSONAPIErrorResponse"; +import { version } from "../version"; + +export class DDSQLApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("ddsql", version); + } + } + public async executeDdsqlTabularQuery( + body: DdsqlTabularQueryRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["DDSQLApi.v2.executeDdsqlTabularQuery"]) { + throw new Error( + "Unstable operation 'executeDdsqlTabularQuery' is disabled. Enable it by setting `configuration.unstableOperations['DDSQLApi.v2.executeDdsqlTabularQuery'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "executeDdsqlTabularQuery"); + } + + // Path Params + const localVarPath = "/api/v2/ddsql/query/tabular"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "DDSQLApi.v2.executeDdsqlTabularQuery", + DDSQLApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "DdsqlTabularQueryRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async fetchDdsqlTabularQuery( + body: DdsqlTabularQueryFetchRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["DDSQLApi.v2.fetchDdsqlTabularQuery"]) { + throw new Error( + "Unstable operation 'fetchDdsqlTabularQuery' is disabled. Enable it by setting `configuration.unstableOperations['DDSQLApi.v2.fetchDdsqlTabularQuery'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "fetchDdsqlTabularQuery"); + } + + // Path Params + const localVarPath = "/api/v2/ddsql/query/tabular/fetch"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "DDSQLApi.v2.fetchDdsqlTabularQuery", + DDSQLApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "DdsqlTabularQueryFetchRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class DDSQLApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to executeDdsqlTabularQuery + * @throws ApiException if the response code was not in [200, 299] + */ + public async executeDdsqlTabularQuery( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: DdsqlTabularQueryResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DdsqlTabularQueryResponse", + ) as DdsqlTabularQueryResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 500 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DdsqlTabularQueryResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DdsqlTabularQueryResponse", + "", + ) as DdsqlTabularQueryResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to fetchDdsqlTabularQuery + * @throws ApiException if the response code was not in [200, 299] + */ + public async fetchDdsqlTabularQuery( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: DdsqlTabularQueryResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DdsqlTabularQueryResponse", + ) as DdsqlTabularQueryResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 500 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DdsqlTabularQueryResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DdsqlTabularQueryResponse", + "", + ) as DdsqlTabularQueryResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface DDSQLApiExecuteDdsqlTabularQueryRequest { + /** + * @type DdsqlTabularQueryRequest + */ + body: DdsqlTabularQueryRequest; +} + +export interface DDSQLApiFetchDdsqlTabularQueryRequest { + /** + * @type DdsqlTabularQueryFetchRequest + */ + body: DdsqlTabularQueryFetchRequest; +} + +export class DDSQLApi { + private requestFactory: DDSQLApiRequestFactory; + private responseProcessor: DDSQLApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: DDSQLApiRequestFactory, + responseProcessor?: DDSQLApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || new DDSQLApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new DDSQLApiResponseProcessor(); + } + + /** + * Submit a DDSQL statement and return either a `running` state with an opaque `query_id` + * for the client to poll, or a `completed` state with the column-major result set inlined + * when the query finishes quickly enough to be served synchronously. + * @param param The request object + */ + public executeDdsqlTabularQuery( + param: DDSQLApiExecuteDdsqlTabularQueryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.executeDdsqlTabularQuery( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.executeDdsqlTabularQuery( + responseContext, + ); + }); + }); + } + + /** + * Poll a previously submitted DDSQL query for results. Pass the opaque `query_id` returned + * by a prior `ExecuteDdsqlTabularQuery` (or by a prior `FetchDdsqlTabularQuery` that + * returned `state: running`) and the server returns either a `running` state to poll again + * or a `completed` state with the column-major result set inlined. + * @param param The request object + */ + public fetchDdsqlTabularQuery( + param: DDSQLApiFetchDdsqlTabularQueryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.fetchDdsqlTabularQuery( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.fetchDdsqlTabularQuery(responseContext); + }); + }); + } +} diff --git a/services/ddsql/src/v2/index.ts b/services/ddsql/src/v2/index.ts new file mode 100644 index 000000000000..aa4b71000298 --- /dev/null +++ b/services/ddsql/src/v2/index.ts @@ -0,0 +1,26 @@ +export { + DDSQLApiExecuteDdsqlTabularQueryRequest, + DDSQLApiFetchDdsqlTabularQueryRequest, + DDSQLApi, +} from "./DDSQLApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { DdsqlTabularQueryColumn } from "./models/DdsqlTabularQueryColumn"; +export { DdsqlTabularQueryFetchRequest } from "./models/DdsqlTabularQueryFetchRequest"; +export { DdsqlTabularQueryFetchRequestAttributes } from "./models/DdsqlTabularQueryFetchRequestAttributes"; +export { DdsqlTabularQueryFetchRequestData } from "./models/DdsqlTabularQueryFetchRequestData"; +export { DdsqlTabularQueryFetchRequestType } from "./models/DdsqlTabularQueryFetchRequestType"; +export { DdsqlTabularQueryRequest } from "./models/DdsqlTabularQueryRequest"; +export { DdsqlTabularQueryRequestAttributes } from "./models/DdsqlTabularQueryRequestAttributes"; +export { DdsqlTabularQueryRequestData } from "./models/DdsqlTabularQueryRequestData"; +export { DdsqlTabularQueryRequestType } from "./models/DdsqlTabularQueryRequestType"; +export { DdsqlTabularQueryResponse } from "./models/DdsqlTabularQueryResponse"; +export { DdsqlTabularQueryResponseAttributes } from "./models/DdsqlTabularQueryResponseAttributes"; +export { DdsqlTabularQueryResponseData } from "./models/DdsqlTabularQueryResponseData"; +export { DdsqlTabularQueryResponseMeta } from "./models/DdsqlTabularQueryResponseMeta"; +export { DdsqlTabularQueryResponseType } from "./models/DdsqlTabularQueryResponseType"; +export { DdsqlTabularQueryState } from "./models/DdsqlTabularQueryState"; +export { DdsqlTabularQueryTimeWindow } from "./models/DdsqlTabularQueryTimeWindow"; +export { JSONAPIErrorItem } from "./models/JSONAPIErrorItem"; +export { JSONAPIErrorItemSource } from "./models/JSONAPIErrorItemSource"; +export { JSONAPIErrorResponse } from "./models/JSONAPIErrorResponse"; diff --git a/services/ddsql/src/v2/models/APIErrorResponse.ts b/services/ddsql/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/ddsql/src/v2/models/APIErrorResponse.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * API error response. + */ +export class APIErrorResponse { + /** + * A list of errors. + */ + "errors": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return APIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryColumn.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryColumn.ts new file mode 100644 index 000000000000..aa3bb799edb8 --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryColumn.ts @@ -0,0 +1,69 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * A single column of a DDSQL tabular query result. + */ +export class DdsqlTabularQueryColumn { + /** + * Name of the column as projected by the SQL statement. + */ + "name": string; + /** + * DDSQL data type of the column's values, for example `VARCHAR`, `BIGINT`, + * `DECIMAL`, `BOOLEAN`, `TIMESTAMP`, `JSON`, or an array variant such as + * `VARCHAR[]`. See the + * [DDSQL data-types reference](https://docs.datadoghq.com/ddsql_reference/#data-types) + * for the full, up-to-date list. + */ + "type": string; + /** + * Column values in row order. The element type matches the column's `type`; + * for example a `VARCHAR` column carries strings, a `TIMESTAMP` column carries + * Unix-millisecond integers. `null` is allowed for missing values. + */ + "values": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + values: { + baseName: "values", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryColumn.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequest.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequest.ts new file mode 100644 index 000000000000..eaf3a5a02b62 --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequest.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DdsqlTabularQueryFetchRequestData } from "./DdsqlTabularQueryFetchRequestData"; + +/** + * Wrapper for a DDSQL tabular query fetch request. + */ +export class DdsqlTabularQueryFetchRequest { + /** + * JSON:API resource object for a DDSQL tabular query fetch request. + */ + "data": DdsqlTabularQueryFetchRequestData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "DdsqlTabularQueryFetchRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryFetchRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestAttributes.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestAttributes.ts new file mode 100644 index 000000000000..179c7c3fda1a --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestAttributes.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes describing which previously submitted DDSQL query to fetch. + */ +export class DdsqlTabularQueryFetchRequestAttributes { + /** + * Opaque token returned by an earlier execute or fetch response that carried + * `state: running`. Identifies the query to poll for results. + */ + "queryId": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + queryId: { + baseName: "query_id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryFetchRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestData.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestData.ts new file mode 100644 index 000000000000..b40c93852fdf --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DdsqlTabularQueryFetchRequestAttributes } from "./DdsqlTabularQueryFetchRequestAttributes"; +import { DdsqlTabularQueryFetchRequestType } from "./DdsqlTabularQueryFetchRequestType"; + +/** + * JSON:API resource object for a DDSQL tabular query fetch request. + */ +export class DdsqlTabularQueryFetchRequestData { + /** + * Attributes describing which previously submitted DDSQL query to fetch. + */ + "attributes": DdsqlTabularQueryFetchRequestAttributes; + /** + * JSON:API resource type for a DDSQL tabular query fetch request. + */ + "type": DdsqlTabularQueryFetchRequestType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "DdsqlTabularQueryFetchRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "DdsqlTabularQueryFetchRequestType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryFetchRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestType.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestType.ts new file mode 100644 index 000000000000..d42b60bc61c4 --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryFetchRequestType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * JSON:API resource type for a DDSQL tabular query fetch request. + */ +export type DdsqlTabularQueryFetchRequestType = + | typeof DDSQL_QUERY_FETCH_REQUEST + | UnparsedObject; +export const DDSQL_QUERY_FETCH_REQUEST = "ddsql_query_fetch_request"; diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryRequest.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryRequest.ts new file mode 100644 index 000000000000..26a2f82ae3a6 --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryRequest.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DdsqlTabularQueryRequestData } from "./DdsqlTabularQueryRequestData"; + +/** + * Wrapper for a DDSQL tabular query execution request. + */ +export class DdsqlTabularQueryRequest { + /** + * JSON:API resource object for a DDSQL tabular query execution request. + */ + "data": DdsqlTabularQueryRequestData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "DdsqlTabularQueryRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryRequestAttributes.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryRequestAttributes.ts new file mode 100644 index 000000000000..5dd187015368 --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryRequestAttributes.ts @@ -0,0 +1,70 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DdsqlTabularQueryTimeWindow } from "./DdsqlTabularQueryTimeWindow"; + +/** + * Attributes describing the DDSQL query to execute. + */ +export class DdsqlTabularQueryRequestAttributes { + /** + * The DDSQL statement to execute. DDSQL is Datadog's SQL dialect, which is a subset + * of PostgreSQL, scoped to Datadog data sources. + */ + "query": string; + /** + * Cap on the number of rows returned. Defaults to 5,000 when omitted. Must be + * between 1 and 10,000 inclusive; values outside this range are rejected with 400. + */ + "rowLimit"?: number; + /** + * Time window scoping the underlying data sources, expressed in Unix milliseconds + * since the epoch. Inclusive on `from_timestamp`, exclusive on `to_timestamp`. + * Results from static tables (for example, `dd.hosts`) are not affected by the + * time window, but the field must still be provided. + */ + "time": DdsqlTabularQueryTimeWindow; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + query: { + baseName: "query", + type: "string", + required: true, + }, + rowLimit: { + baseName: "row_limit", + type: "number", + format: "int64", + }, + time: { + baseName: "time", + type: "DdsqlTabularQueryTimeWindow", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryRequestData.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryRequestData.ts new file mode 100644 index 000000000000..cca0075fb719 --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryRequestData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DdsqlTabularQueryRequestAttributes } from "./DdsqlTabularQueryRequestAttributes"; +import { DdsqlTabularQueryRequestType } from "./DdsqlTabularQueryRequestType"; + +/** + * JSON:API resource object for a DDSQL tabular query execution request. + */ +export class DdsqlTabularQueryRequestData { + /** + * Attributes describing the DDSQL query to execute. + */ + "attributes": DdsqlTabularQueryRequestAttributes; + /** + * JSON:API resource type for a DDSQL tabular query request. + */ + "type": DdsqlTabularQueryRequestType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "DdsqlTabularQueryRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "DdsqlTabularQueryRequestType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryRequestType.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryRequestType.ts new file mode 100644 index 000000000000..14d09dc5e44c --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryRequestType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * JSON:API resource type for a DDSQL tabular query request. + */ +export type DdsqlTabularQueryRequestType = + | typeof DDSQL_QUERY_REQUEST + | UnparsedObject; +export const DDSQL_QUERY_REQUEST = "ddsql_query_request"; diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryResponse.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryResponse.ts new file mode 100644 index 000000000000..3a67a102f38f --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryResponse.ts @@ -0,0 +1,60 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DdsqlTabularQueryResponseData } from "./DdsqlTabularQueryResponseData"; +import { DdsqlTabularQueryResponseMeta } from "./DdsqlTabularQueryResponseMeta"; + +/** + * Response envelope for both the execute and fetch DDSQL tabular query endpoints. + * Carries the JSON:API primary resource and a top-level `meta` block with + * request-scoped observability handles. + */ +export class DdsqlTabularQueryResponse { + /** + * JSON:API resource object for a DDSQL tabular query response. + */ + "data": DdsqlTabularQueryResponseData; + /** + * Top-level JSON:API meta block accompanying every DDSQL tabular query response. + * Carries standard observability handles for client-side correlation. + */ + "meta": DdsqlTabularQueryResponseMeta; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "DdsqlTabularQueryResponseData", + required: true, + }, + meta: { + baseName: "meta", + type: "DdsqlTabularQueryResponseMeta", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryResponseAttributes.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryResponseAttributes.ts new file mode 100644 index 000000000000..0c1645369dd3 --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryResponseAttributes.ts @@ -0,0 +1,78 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DdsqlTabularQueryColumn } from "./DdsqlTabularQueryColumn"; +import { DdsqlTabularQueryState } from "./DdsqlTabularQueryState"; + +/** + * Attributes of a DDSQL tabular query response. `query_id` is set when + * `state` is `running`; `columns` is set when `state` is `completed`. + */ +export class DdsqlTabularQueryResponseAttributes { + /** + * Column-major result set. Each element carries one column's name, type, and values, + * with one value per row of the result. Set when `state` is `completed`. + */ + "columns"?: Array; + /** + * Opaque token to pass to the fetch endpoint to poll for results. + * Set when `state` is `running` and absent when `state` is `completed`. + */ + "queryId"?: string; + /** + * Lifecycle state of a DDSQL tabular query response. + * `running` means the query is still executing and the client should poll + * the fetch endpoint with the returned `query_id`. `completed` means the + * result set is inlined in `columns` and no further polling is required. + */ + "state": DdsqlTabularQueryState; + /** + * Non-fatal messages emitted by the query engine while serving this response. + */ + "warnings"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + columns: { + baseName: "columns", + type: "Array", + }, + queryId: { + baseName: "query_id", + type: "string", + }, + state: { + baseName: "state", + type: "DdsqlTabularQueryState", + required: true, + }, + warnings: { + baseName: "warnings", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryResponseData.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryResponseData.ts new file mode 100644 index 000000000000..da6d17fe4aa3 --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryResponseData.ts @@ -0,0 +1,67 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DdsqlTabularQueryResponseAttributes } from "./DdsqlTabularQueryResponseAttributes"; +import { DdsqlTabularQueryResponseType } from "./DdsqlTabularQueryResponseType"; + +/** + * JSON:API resource object for a DDSQL tabular query response. + */ +export class DdsqlTabularQueryResponseData { + /** + * Attributes of a DDSQL tabular query response. `query_id` is set when + * `state` is `running`; `columns` is set when `state` is `completed`. + */ + "attributes": DdsqlTabularQueryResponseAttributes; + /** + * Stable identifier for the query response resource. + */ + "id": string; + /** + * JSON:API resource type for a DDSQL tabular query response. + */ + "type": DdsqlTabularQueryResponseType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "DdsqlTabularQueryResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "DdsqlTabularQueryResponseType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryResponseMeta.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryResponseMeta.ts new file mode 100644 index 000000000000..a7f177545a96 --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryResponseMeta.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Top-level JSON:API meta block accompanying every DDSQL tabular query response. + * Carries standard observability handles for client-side correlation. + */ +export class DdsqlTabularQueryResponseMeta { + /** + * Server-side time spent serving this request, in milliseconds. + */ + "elapsed": number; + /** + * Echo of the `DD-Request-ID` header assigned by Datadog's edge to this request, + * for support correlation. + */ + "requestId": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + elapsed: { + baseName: "elapsed", + type: "number", + required: true, + format: "int64", + }, + requestId: { + baseName: "request_id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryResponseMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryResponseType.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryResponseType.ts new file mode 100644 index 000000000000..a0b8f11c10ef --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryResponseType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * JSON:API resource type for a DDSQL tabular query response. + */ +export type DdsqlTabularQueryResponseType = + | typeof DDSQL_QUERY_RESPONSE + | UnparsedObject; +export const DDSQL_QUERY_RESPONSE = "ddsql_query_response"; diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryState.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryState.ts new file mode 100644 index 000000000000..1fe34d41652d --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryState.ts @@ -0,0 +1,14 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Lifecycle state of a DDSQL tabular query response. + * `running` means the query is still executing and the client should poll + * the fetch endpoint with the returned `query_id`. `completed` means the + * result set is inlined in `columns` and no further polling is required. + */ +export type DdsqlTabularQueryState = + | typeof RUNNING + | typeof COMPLETED + | UnparsedObject; +export const RUNNING = "running"; +export const COMPLETED = "completed"; diff --git a/services/ddsql/src/v2/models/DdsqlTabularQueryTimeWindow.ts b/services/ddsql/src/v2/models/DdsqlTabularQueryTimeWindow.ts new file mode 100644 index 000000000000..021c889c0a72 --- /dev/null +++ b/services/ddsql/src/v2/models/DdsqlTabularQueryTimeWindow.ts @@ -0,0 +1,59 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Time window scoping the underlying data sources, expressed in Unix milliseconds + * since the epoch. Inclusive on `from_timestamp`, exclusive on `to_timestamp`. + * Results from static tables (for example, `dd.hosts`) are not affected by the + * time window, but the field must still be provided. + */ +export class DdsqlTabularQueryTimeWindow { + /** + * Start of the query window (inclusive), in Unix milliseconds since the epoch. + */ + "fromTimestamp": number; + /** + * End of the query window (exclusive), in Unix milliseconds since the epoch. + */ + "toTimestamp": number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + fromTimestamp: { + baseName: "from_timestamp", + type: "number", + required: true, + format: "int64", + }, + toTimestamp: { + baseName: "to_timestamp", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DdsqlTabularQueryTimeWindow.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/JSONAPIErrorItem.ts b/services/ddsql/src/v2/models/JSONAPIErrorItem.ts new file mode 100644 index 000000000000..a1ca45cd463c --- /dev/null +++ b/services/ddsql/src/v2/models/JSONAPIErrorItem.ts @@ -0,0 +1,78 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { JSONAPIErrorItemSource } from "./JSONAPIErrorItemSource"; + +/** + * API error response body + */ +export class JSONAPIErrorItem { + /** + * A human-readable explanation specific to this occurrence of the error. + */ + "detail"?: string; + /** + * Non-standard meta-information about the error + */ + "meta"?: { [key: string]: any }; + /** + * References to the source of the error. + */ + "source"?: JSONAPIErrorItemSource; + /** + * Status code of the response. + */ + "status"?: string; + /** + * Short human-readable summary of the error. + */ + "title"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + detail: { + baseName: "detail", + type: "string", + }, + meta: { + baseName: "meta", + type: "{ [key: string]: any; }", + }, + source: { + baseName: "source", + type: "JSONAPIErrorItemSource", + }, + status: { + baseName: "status", + type: "string", + }, + title: { + baseName: "title", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return JSONAPIErrorItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/JSONAPIErrorItemSource.ts b/services/ddsql/src/v2/models/JSONAPIErrorItemSource.ts new file mode 100644 index 000000000000..5889114315fa --- /dev/null +++ b/services/ddsql/src/v2/models/JSONAPIErrorItemSource.ts @@ -0,0 +1,60 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * References to the source of the error. + */ +export class JSONAPIErrorItemSource { + /** + * A string indicating the name of a single request header which caused the error. + */ + "header"?: string; + /** + * A string indicating which URI query parameter caused the error. + */ + "parameter"?: string; + /** + * A JSON pointer to the value in the request document that caused the error. + */ + "pointer"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + header: { + baseName: "header", + type: "string", + }, + parameter: { + baseName: "parameter", + type: "string", + }, + pointer: { + baseName: "pointer", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return JSONAPIErrorItemSource.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/JSONAPIErrorResponse.ts b/services/ddsql/src/v2/models/JSONAPIErrorResponse.ts new file mode 100644 index 000000000000..68aa04ffc27b --- /dev/null +++ b/services/ddsql/src/v2/models/JSONAPIErrorResponse.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { JSONAPIErrorItem } from "./JSONAPIErrorItem"; + +/** + * API error response. + */ +export class JSONAPIErrorResponse { + /** + * A list of errors. + */ + "errors": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return JSONAPIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/ddsql/src/v2/models/TypingInfo.ts b/services/ddsql/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..cb4f36b928ee --- /dev/null +++ b/services/ddsql/src/v2/models/TypingInfo.ts @@ -0,0 +1,47 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { DdsqlTabularQueryColumn } from "./DdsqlTabularQueryColumn"; +import { DdsqlTabularQueryFetchRequest } from "./DdsqlTabularQueryFetchRequest"; +import { DdsqlTabularQueryFetchRequestAttributes } from "./DdsqlTabularQueryFetchRequestAttributes"; +import { DdsqlTabularQueryFetchRequestData } from "./DdsqlTabularQueryFetchRequestData"; +import { DdsqlTabularQueryRequest } from "./DdsqlTabularQueryRequest"; +import { DdsqlTabularQueryRequestAttributes } from "./DdsqlTabularQueryRequestAttributes"; +import { DdsqlTabularQueryRequestData } from "./DdsqlTabularQueryRequestData"; +import { DdsqlTabularQueryResponse } from "./DdsqlTabularQueryResponse"; +import { DdsqlTabularQueryResponseAttributes } from "./DdsqlTabularQueryResponseAttributes"; +import { DdsqlTabularQueryResponseData } from "./DdsqlTabularQueryResponseData"; +import { DdsqlTabularQueryResponseMeta } from "./DdsqlTabularQueryResponseMeta"; +import { DdsqlTabularQueryTimeWindow } from "./DdsqlTabularQueryTimeWindow"; +import { JSONAPIErrorItem } from "./JSONAPIErrorItem"; +import { JSONAPIErrorItemSource } from "./JSONAPIErrorItemSource"; +import { JSONAPIErrorResponse } from "./JSONAPIErrorResponse"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + DdsqlTabularQueryFetchRequestType: ["ddsql_query_fetch_request"], + DdsqlTabularQueryRequestType: ["ddsql_query_request"], + DdsqlTabularQueryResponseType: ["ddsql_query_response"], + DdsqlTabularQueryState: ["running", "completed"], + }, + oneOfMap: {}, + typeMap: { + APIErrorResponse: APIErrorResponse, + DdsqlTabularQueryColumn: DdsqlTabularQueryColumn, + DdsqlTabularQueryFetchRequest: DdsqlTabularQueryFetchRequest, + DdsqlTabularQueryFetchRequestAttributes: + DdsqlTabularQueryFetchRequestAttributes, + DdsqlTabularQueryFetchRequestData: DdsqlTabularQueryFetchRequestData, + DdsqlTabularQueryRequest: DdsqlTabularQueryRequest, + DdsqlTabularQueryRequestAttributes: DdsqlTabularQueryRequestAttributes, + DdsqlTabularQueryRequestData: DdsqlTabularQueryRequestData, + DdsqlTabularQueryResponse: DdsqlTabularQueryResponse, + DdsqlTabularQueryResponseAttributes: DdsqlTabularQueryResponseAttributes, + DdsqlTabularQueryResponseData: DdsqlTabularQueryResponseData, + DdsqlTabularQueryResponseMeta: DdsqlTabularQueryResponseMeta, + DdsqlTabularQueryTimeWindow: DdsqlTabularQueryTimeWindow, + JSONAPIErrorItem: JSONAPIErrorItem, + JSONAPIErrorItemSource: JSONAPIErrorItemSource, + JSONAPIErrorResponse: JSONAPIErrorResponse, + }, +}; diff --git a/services/ddsql/tsconfig.json b/services/ddsql/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/ddsql/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + "esModuleInterop": true, + "resolveJsonModule": true, + + "noImplicitAny": true, + "noImplicitThis": true, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, // TODO: reenable (unused imports!) + "noUnusedParameters": false /* Report errors on unused parameters. */, // TODO: set to true again + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + + "sourceMap": true, + "outDir": "./dist", + "lib": ["es6", "es7"] + }, + "exclude": ["dist", "node_modules", "tests"], + "include": ["src"] +} diff --git a/yarn.lock b/yarn.lock index a009d21c6921..19f185e700f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -667,6 +667,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-ddsql@workspace:services/ddsql": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-ddsql@workspace:services/ddsql" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.2" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-deployment-gates@workspace:services/deployment_gates": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-deployment-gates@workspace:services/deployment_gates"