diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 17509b56882d..09edf2f7e318 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -37849,6 +37849,121 @@ components: type: string x-enum-varnames: - RULESET + ResolveVulnerableSymbolsRequest: + description: The definition of `ResolveVulnerableSymbolsRequest` object. + properties: + data: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestData' + type: object + ResolveVulnerableSymbolsRequestData: + description: The definition of `ResolveVulnerableSymbolsRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestDataAttributes' + id: + description: The `ResolveVulnerableSymbolsRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequestDataType' + required: + - type + type: object + ResolveVulnerableSymbolsRequestDataAttributes: + description: The definition of `ResolveVulnerableSymbolsRequestDataAttributes` + object. + properties: + purls: + description: The `attributes` `purls`. + items: + type: string + type: array + type: object + ResolveVulnerableSymbolsRequestDataType: + default: resolve-vulnerable-symbols-request + description: Resolve vulnerable symbols request resource type. + enum: + - resolve-vulnerable-symbols-request + example: resolve-vulnerable-symbols-request + type: string + x-enum-varnames: + - RESOLVE_VULNERABLE_SYMBOLS_REQUEST + ResolveVulnerableSymbolsResponse: + description: The definition of `ResolveVulnerableSymbolsResponse` object. + properties: + data: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseData' + type: object + ResolveVulnerableSymbolsResponseData: + description: The definition of `ResolveVulnerableSymbolsResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseDataAttributes' + id: + description: The `ResolveVulnerableSymbolsResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseDataType' + required: + - type + type: object + ResolveVulnerableSymbolsResponseDataAttributes: + description: The definition of `ResolveVulnerableSymbolsResponseDataAttributes` + object. + properties: + results: + description: The `attributes` `results`. + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResults' + type: array + type: object + ResolveVulnerableSymbolsResponseDataType: + default: resolve-vulnerable-symbols-response + description: Resolve vulnerable symbols response resource type. + enum: + - resolve-vulnerable-symbols-response + example: resolve-vulnerable-symbols-response + type: string + x-enum-varnames: + - RESOLVE_VULNERABLE_SYMBOLS_RESPONSE + ResolveVulnerableSymbolsResponseResults: + description: The definition of `ResolveVulnerableSymbolsResponseResults` object. + properties: + purl: + description: The `items` `purl`. + type: string + vulnerable_symbols: + description: The `items` `vulnerable_symbols`. + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResultsVulnerableSymbols' + type: array + type: object + ResolveVulnerableSymbolsResponseResultsVulnerableSymbols: + description: The definition of `ResolveVulnerableSymbolsResponseResultsVulnerableSymbols` + object. + properties: + advisory_id: + description: The `items` `advisory_id`. + type: string + symbols: + description: The `items` `symbols`. + items: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols' + type: array + type: object + ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols: + description: The definition of `ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols` + object. + properties: + name: + description: The `items` `name`. + type: string + type: + description: The `items` `type`. + type: string + value: + description: The `items` `value`. + type: string + type: object ResourceFilterAttributes: description: Attributes of a resource filter. example: @@ -40193,6 +40308,243 @@ components: example: report_id type: string type: object + ScaRequest: + description: The definition of `ScaRequest` object. + properties: + data: + $ref: '#/components/schemas/ScaRequestData' + type: object + ScaRequestData: + description: The definition of `ScaRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/ScaRequestDataAttributes' + id: + description: The `ScaRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/ScaRequestDataType' + required: + - type + type: object + ScaRequestDataAttributes: + description: The definition of `ScaRequestDataAttributes` object. + properties: + commit: + $ref: '#/components/schemas/ScaRequestDataAttributesCommit' + dependencies: + description: The `attributes` `dependencies`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItems' + type: array + env: + description: The `attributes` `env`. + type: string + files: + description: The `attributes` `files`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesFilesItems' + type: array + relations: + description: The `attributes` `relations`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesRelationsItems' + type: array + repository: + $ref: '#/components/schemas/ScaRequestDataAttributesRepository' + service: + description: The `attributes` `service`. + type: string + tags: + additionalProperties: + type: string + description: The `attributes` `tags`. + type: object + vulnerabilities: + description: The `attributes` `vulnerabilities`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesVulnerabilitiesItems' + type: array + type: object + ScaRequestDataAttributesCommit: + description: The definition of `ScaRequestDataAttributesCommit` object. + properties: + author_date: + description: The `commit` `author_date`. + type: string + author_email: + description: The `commit` `author_email`. + type: string + author_name: + description: The `commit` `author_name`. + type: string + branch: + description: The `commit` `branch`. + type: string + committer_email: + description: The `commit` `committer_email`. + type: string + committer_name: + description: The `commit` `committer_name`. + type: string + sha: + description: The `commit` `sha`. + type: string + type: object + ScaRequestDataAttributesDependenciesItems: + description: The definition of `ScaRequestDataAttributesDependenciesItems` object. + properties: + exclusions: + description: The `items` `exclusions`. + items: + type: string + type: array + group: + description: The `items` `group`. + type: string + is_dev: + description: The `items` `is_dev`. + type: boolean + is_direct: + description: The `items` `is_direct`. + type: boolean + language: + description: The `items` `language`. + type: string + locations: + description: The `items` `locations`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItems' + type: array + name: + description: The `items` `name`. + type: string + package_manager: + description: The `items` `package_manager`. + type: string + purl: + description: The `items` `purl`. + type: string + reachable_symbol_properties: + description: The `items` `reachable_symbol_properties`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems' + type: array + version: + description: The `items` `version`. + type: string + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItems: + description: The definition of `ScaRequestDataAttributesDependenciesItemsLocationsItems` + object. + properties: + block: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + name: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + namespace: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + version: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition' + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition: + description: A position in a file + properties: + end: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition' + file_name: + description: The `file_name`. + type: string + start: + $ref: '#/components/schemas/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition' + type: object + ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition: + description: A position + properties: + col: + description: The `col`. + format: int32 + maximum: 2147483647 + type: integer + line: + description: The `line`. + format: int32 + maximum: 2147483647 + type: integer + type: object + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems: + description: The definition of `ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems` + object. + properties: + name: + description: The `items` `name`. + type: string + value: + description: The `items` `value`. + type: string + type: object + ScaRequestDataAttributesFilesItems: + description: The definition of `ScaRequestDataAttributesFilesItems` object. + properties: + name: + description: The `items` `name`. + type: string + purl: + description: The `items` `purl`. + type: string + type: object + ScaRequestDataAttributesRelationsItems: + description: The definition of `ScaRequestDataAttributesRelationsItems` object. + properties: + depends_on: + description: The `items` `depends_on`. + items: + type: string + type: array + ref: + description: The `items` `ref`. + type: string + type: object + ScaRequestDataAttributesRepository: + description: The definition of `ScaRequestDataAttributesRepository` object. + properties: + url: + description: The `repository` `url`. + type: string + type: object + ScaRequestDataAttributesVulnerabilitiesItems: + description: The definition of `ScaRequestDataAttributesVulnerabilitiesItems` + object. + properties: + affects: + description: The `items` `affects`. + items: + $ref: '#/components/schemas/ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems' + type: array + bom_ref: + description: The `items` `bom_ref`. + type: string + id: + description: The `items` `id`. + type: string + type: object + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems: + description: The definition of `ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems` + object. + properties: + ref: + description: The `items` `ref`. + type: string + type: object + ScaRequestDataType: + default: scarequests + description: Scarequests resource type. + enum: + - scarequests + example: scarequests + type: string + x-enum-varnames: + - SCAREQUESTS ScalarColumn: description: A single column in a scalar query response. oneOf: @@ -73460,6 +73812,58 @@ paths: cursorPath: meta.page.after limitParam: body.data.attributes.page.limit resultsPath: data + /api/v2/static-analysis-sca/dependencies: + post: + description: Post dependencies for analysis + operationId: CreateSCAResult + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScaRequest' + required: true + responses: + '200': + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Post dependencies for analysis + tags: + - Static Analysis + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols: + post: + description: Post vulnerable symbols + operationId: CreateSCAResolveVulnerableSymbols + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResolveVulnerableSymbolsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ResolveVulnerableSymbolsResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: POST request to resolve vulnerable symbols + tags: + - Static Analysis + x-unstable: '**Note**: This endpoint may be subject to changes.' /api/v2/synthetics/settings/on_demand_concurrency_cap: get: description: Get the on-demand concurrency cap. @@ -76975,6 +77379,8 @@ tags: description: Find out more at url: https://docs.datadoghq.com/tracing/metrics/metrics_namespace/ name: Spans Metrics +- description: API for static analysis + name: Static Analysis - description: "Datadog Synthetics uses simulated user requests and browser rendering to help you ensure uptime,\nidentify regional issues, and track your application performance. Datadog Synthetics tests come in\ntwo different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/)\nand diff --git a/features/v1/logs_pipelines.feature b/features/v1/logs_pipelines.feature index 66305bbbaf2c..cdb150dd6edf 100644 --- a/features/v1/logs_pipelines.feature +++ b/features/v1/logs_pipelines.feature @@ -24,14 +24,14 @@ Feature: Logs Pipelines @generated @skip @team:DataDog/event-platform-experience Scenario: Create a pipeline returns "Bad Request" response Given new "CreateLogsPipeline" request - And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} + And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/event-platform-experience Scenario: Create a pipeline returns "OK" response Given new "CreateLogsPipeline" request - And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} + And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} When the request is sent Then the response status is 200 OK @@ -128,7 +128,7 @@ Feature: Logs Pipelines Scenario: Update a pipeline returns "Bad Request" response Given new "UpdateLogsPipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" - And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} + And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} When the request is sent Then the response status is 400 Bad Request @@ -136,7 +136,7 @@ Feature: Logs Pipelines Scenario: Update a pipeline returns "OK" response Given new "UpdateLogsPipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" - And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} + And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []} When the request is sent Then the response status is 200 OK diff --git a/features/v2/static_analysis.feature b/features/v2/static_analysis.feature new file mode 100644 index 000000000000..85bf4d83ae13 --- /dev/null +++ b/features/v2/static_analysis.feature @@ -0,0 +1,24 @@ +@endpoint(static-analysis) @endpoint(static-analysis-v2) +Feature: Static Analysis + API for static analysis + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "StaticAnalysis" API + + @generated @skip @team:DataDog/k9-vm-sca + Scenario: POST request to resolve vulnerable symbols returns "OK" response + Given operation "CreateSCAResolveVulnerableSymbols" enabled + And new "CreateSCAResolveVulnerableSymbols" request + And body with value {"data": {"attributes": {"purls": []}, "type": "resolve-vulnerable-symbols-request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-vm-sca + Scenario: Post dependencies for analysis returns "OK" response + Given operation "CreateSCAResult" enabled + And new "CreateSCAResult" request + And body with value {"data": {"attributes": {"commit": {}, "dependencies": [{"exclusions": [], "locations": [{"block": {"end": {}, "start": {}}, "name": {"end": {}, "start": {}}, "namespace": {"end": {}, "start": {}}, "version": {"end": {}, "start": {}}}], "reachable_symbol_properties": [{}]}], "files": [{}], "relations": [{"depends_on": []}], "repository": {}, "vulnerabilities": [{"affects": [{}]}]}, "type": "scarequests"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index c4c269d3cab9..ad6dcc7086aa 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3780,6 +3780,18 @@ "type": "safe" } }, + "CreateSCAResult": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "CreateSCAResolveVulnerableSymbols": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, "GetOnDemandConcurrencyCap": { "tag": "Synthetics", "undo": { diff --git a/packages/datadog-api-client/README.md b/packages/datadog-api-client/README.md index 151dc7767b8d..826c0da708ee 100644 --- a/packages/datadog-api-client/README.md +++ b/packages/datadog-api-client/README.md @@ -429,6 +429,7 @@ apiInstance | Spa | @datadog/datadog-api-client-spa | [README.md](../../services/spa/README.md) | | Spans | @datadog/datadog-api-client-spans | [README.md](../../services/spans/README.md) | | Spans Metrics | @datadog/datadog-api-client-spans-metrics | [README.md](../../services/spans-metrics/README.md) | +| Static Analysis | @datadog/datadog-api-client-static-analysis | [README.md](../../services/static-analysis/README.md) | | Synthetics | @datadog/datadog-api-client-synthetics | [README.md](../../services/synthetics/README.md) | | Tags | @datadog/datadog-api-client-tags | [README.md](../../services/tags/README.md) | | Teams | @datadog/datadog-api-client-teams | [README.md](../../services/teams/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 0689e2fae8b9..3640cb7dc94e 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -8151,6 +8151,20 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "SpansListResponse", }, + "StaticAnalysisApi.V2.CreateSCAResult": { + body: { + type: "ScaRequest", + format: "", + }, + operationResponseType: "{}", + }, + "StaticAnalysisApi.V2.CreateSCAResolveVulnerableSymbols": { + body: { + type: "ResolveVulnerableSymbolsRequest", + format: "", + }, + operationResponseType: "ResolveVulnerableSymbolsResponse", + }, "SyntheticsApi.V2.GetOnDemandConcurrencyCap": { operationResponseType: "OnDemandConcurrencyCapResponse", }, diff --git a/services/static_analysis/.yarnrc.yml b/services/static_analysis/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/static_analysis/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/static_analysis/README.md b/services/static_analysis/README.md new file mode 100644 index 000000000000..20eb5f746f58 --- /dev/null +++ b/services/static_analysis/README.md @@ -0,0 +1,43 @@ +# @datadog/datadog-api-client-static-analysis + +## Description + +API for static analysis + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-static-analysis +# Yarn +yarn add @datadog/datadog-api-client-static-analysis +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { StaticAnalysisApiV2 } from "@datadog/datadog-api-client-static-analysis"; + +const configuration = createConfiguration(); +// Enable unstable operations +const configurationOpts = { + unstableOperations: { + "StaticAnalysisApi.v2.createSCAResult": true + } +} + +const configuration = createConfiguration(configurationOpts); +const apiInstance = new StaticAnalysisApiV2(configuration); +const params = {/* parameters */}; + +apiInstance.createSCAResult(params).then(() => { + console.log("API called successfully."); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/static_analysis/package.json b/services/static_analysis/package.json new file mode 100644 index 000000000000..eee6ad8e44e9 --- /dev/null +++ b/services/static_analysis/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-static-analysis", + "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/static-analysis" + }, + "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.0" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/static_analysis/src/index.ts b/services/static_analysis/src/index.ts new file mode 100644 index 000000000000..d45242845be0 --- /dev/null +++ b/services/static_analysis/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { StaticAnalysisApi as StaticAnalysisApiV2 } from "./v2/StaticAnalysisApi"; diff --git a/services/static_analysis/src/v2/StaticAnalysisApi.ts b/services/static_analysis/src/v2/StaticAnalysisApi.ts new file mode 100644 index 000000000000..d202c3d3efd8 --- /dev/null +++ b/services/static_analysis/src/v2/StaticAnalysisApi.ts @@ -0,0 +1,338 @@ +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 { ResolveVulnerableSymbolsRequest } from "./models/ResolveVulnerableSymbolsRequest"; +import { ResolveVulnerableSymbolsResponse } from "./models/ResolveVulnerableSymbolsResponse"; +import { ScaRequest } from "./models/ScaRequest"; +import { version } from "../version"; + +export class StaticAnalysisApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("static-analysis", version); + } + } + public async createSCAResolveVulnerableSymbols( + body: ResolveVulnerableSymbolsRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "StaticAnalysisApi.v2.createSCAResolveVulnerableSymbols" + ] + ) { + throw new Error( + "Unstable operation 'createSCAResolveVulnerableSymbols' is disabled. Enable it by setting `configuration.unstableOperations['StaticAnalysisApi.v2.createSCAResolveVulnerableSymbols'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createSCAResolveVulnerableSymbols"); + } + + // Path Params + const localVarPath = + "/api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "StaticAnalysisApi.v2.createSCAResolveVulnerableSymbols", + StaticAnalysisApi.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, "ResolveVulnerableSymbolsRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async createSCAResult( + body: ScaRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["StaticAnalysisApi.v2.createSCAResult"]) { + throw new Error( + "Unstable operation 'createSCAResult' is disabled. Enable it by setting `configuration.unstableOperations['StaticAnalysisApi.v2.createSCAResult'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createSCAResult"); + } + + // Path Params + const localVarPath = "/api/v2/static-analysis-sca/dependencies"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "StaticAnalysisApi.v2.createSCAResult", + StaticAnalysisApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + 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, "ScaRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } +} + +export class StaticAnalysisApiResponseProcessor { + /** + * 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 createSCAResolveVulnerableSymbols + * @throws ApiException if the response code was not in [200, 299] + */ + public async createSCAResolveVulnerableSymbols( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: ResolveVulnerableSymbolsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "ResolveVulnerableSymbolsResponse", + ) as ResolveVulnerableSymbolsResponse; + return 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: ResolveVulnerableSymbolsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "ResolveVulnerableSymbolsResponse", + "", + ) as ResolveVulnerableSymbolsResponse; + 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 createSCAResult + * @throws ApiException if the response code was not in [200, 299] + */ + public async createSCAResult(response: ResponseContext): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + return; + } + 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) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface StaticAnalysisApiCreateSCAResolveVulnerableSymbolsRequest { + /** + * @type ResolveVulnerableSymbolsRequest + */ + body: ResolveVulnerableSymbolsRequest; +} + +export interface StaticAnalysisApiCreateSCAResultRequest { + /** + * @type ScaRequest + */ + body: ScaRequest; +} + +export class StaticAnalysisApi { + private requestFactory: StaticAnalysisApiRequestFactory; + private responseProcessor: StaticAnalysisApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: StaticAnalysisApiRequestFactory, + responseProcessor?: StaticAnalysisApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || new StaticAnalysisApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new StaticAnalysisApiResponseProcessor(); + } + + /** + * Post vulnerable symbols + * @param param The request object + */ + public createSCAResolveVulnerableSymbols( + param: StaticAnalysisApiCreateSCAResolveVulnerableSymbolsRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.createSCAResolveVulnerableSymbols( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createSCAResolveVulnerableSymbols( + responseContext, + ); + }); + }); + } + + /** + * Post dependencies for analysis + * @param param The request object + */ + public createSCAResult( + param: StaticAnalysisApiCreateSCAResultRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.createSCAResult( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createSCAResult(responseContext); + }); + }); + } +} diff --git a/services/static_analysis/src/v2/index.ts b/services/static_analysis/src/v2/index.ts new file mode 100644 index 000000000000..236aee1d37b3 --- /dev/null +++ b/services/static_analysis/src/v2/index.ts @@ -0,0 +1,33 @@ +export { + StaticAnalysisApiCreateSCAResolveVulnerableSymbolsRequest, + StaticAnalysisApiCreateSCAResultRequest, + StaticAnalysisApi, +} from "./StaticAnalysisApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { ResolveVulnerableSymbolsRequest } from "./models/ResolveVulnerableSymbolsRequest"; +export { ResolveVulnerableSymbolsRequestData } from "./models/ResolveVulnerableSymbolsRequestData"; +export { ResolveVulnerableSymbolsRequestDataAttributes } from "./models/ResolveVulnerableSymbolsRequestDataAttributes"; +export { ResolveVulnerableSymbolsRequestDataType } from "./models/ResolveVulnerableSymbolsRequestDataType"; +export { ResolveVulnerableSymbolsResponse } from "./models/ResolveVulnerableSymbolsResponse"; +export { ResolveVulnerableSymbolsResponseData } from "./models/ResolveVulnerableSymbolsResponseData"; +export { ResolveVulnerableSymbolsResponseDataAttributes } from "./models/ResolveVulnerableSymbolsResponseDataAttributes"; +export { ResolveVulnerableSymbolsResponseDataType } from "./models/ResolveVulnerableSymbolsResponseDataType"; +export { ResolveVulnerableSymbolsResponseResults } from "./models/ResolveVulnerableSymbolsResponseResults"; +export { ResolveVulnerableSymbolsResponseResultsVulnerableSymbols } from "./models/ResolveVulnerableSymbolsResponseResultsVulnerableSymbols"; +export { ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols } from "./models/ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols"; +export { ScaRequest } from "./models/ScaRequest"; +export { ScaRequestData } from "./models/ScaRequestData"; +export { ScaRequestDataAttributes } from "./models/ScaRequestDataAttributes"; +export { ScaRequestDataAttributesCommit } from "./models/ScaRequestDataAttributesCommit"; +export { ScaRequestDataAttributesDependenciesItems } from "./models/ScaRequestDataAttributesDependenciesItems"; +export { ScaRequestDataAttributesDependenciesItemsLocationsItems } from "./models/ScaRequestDataAttributesDependenciesItemsLocationsItems"; +export { ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition } from "./models/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition"; +export { ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition } from "./models/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition"; +export { ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems } from "./models/ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems"; +export { ScaRequestDataAttributesFilesItems } from "./models/ScaRequestDataAttributesFilesItems"; +export { ScaRequestDataAttributesRelationsItems } from "./models/ScaRequestDataAttributesRelationsItems"; +export { ScaRequestDataAttributesRepository } from "./models/ScaRequestDataAttributesRepository"; +export { ScaRequestDataAttributesVulnerabilitiesItems } from "./models/ScaRequestDataAttributesVulnerabilitiesItems"; +export { ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems } from "./models/ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems"; +export { ScaRequestDataType } from "./models/ScaRequestDataType"; diff --git a/services/static_analysis/src/v2/models/APIErrorResponse.ts b/services/static_analysis/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/static_analysis/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/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequest.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequest.ts new file mode 100644 index 000000000000..7355ab29e530 --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequest.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ResolveVulnerableSymbolsRequestData } from "./ResolveVulnerableSymbolsRequestData"; + +/** + * The definition of `ResolveVulnerableSymbolsRequest` object. + */ +export class ResolveVulnerableSymbolsRequest { + /** + * The definition of `ResolveVulnerableSymbolsRequestData` object. + */ + "data"?: ResolveVulnerableSymbolsRequestData; + /** + * 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: "ResolveVulnerableSymbolsRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ResolveVulnerableSymbolsRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequestData.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequestData.ts new file mode 100644 index 000000000000..93f1f070e048 --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequestData.ts @@ -0,0 +1,64 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ResolveVulnerableSymbolsRequestDataAttributes } from "./ResolveVulnerableSymbolsRequestDataAttributes"; +import { ResolveVulnerableSymbolsRequestDataType } from "./ResolveVulnerableSymbolsRequestDataType"; + +/** + * The definition of `ResolveVulnerableSymbolsRequestData` object. + */ +export class ResolveVulnerableSymbolsRequestData { + /** + * The definition of `ResolveVulnerableSymbolsRequestDataAttributes` object. + */ + "attributes"?: ResolveVulnerableSymbolsRequestDataAttributes; + /** + * The `ResolveVulnerableSymbolsRequestData` `id`. + */ + "id"?: string; + /** + * Resolve vulnerable symbols request resource type. + */ + "type": ResolveVulnerableSymbolsRequestDataType; + /** + * 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: "ResolveVulnerableSymbolsRequestDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "ResolveVulnerableSymbolsRequestDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ResolveVulnerableSymbolsRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequestDataAttributes.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequestDataAttributes.ts new file mode 100644 index 000000000000..974d87db839d --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequestDataAttributes.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * The definition of `ResolveVulnerableSymbolsRequestDataAttributes` object. + */ +export class ResolveVulnerableSymbolsRequestDataAttributes { + /** + * The `attributes` `purls`. + */ + "purls"?: 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 = { + purls: { + baseName: "purls", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ResolveVulnerableSymbolsRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequestDataType.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequestDataType.ts new file mode 100644 index 000000000000..d133b6f9ce91 --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsRequestDataType.ts @@ -0,0 +1,10 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Resolve vulnerable symbols request resource type. + */ +export type ResolveVulnerableSymbolsRequestDataType = + | typeof RESOLVE_VULNERABLE_SYMBOLS_REQUEST + | UnparsedObject; +export const RESOLVE_VULNERABLE_SYMBOLS_REQUEST = + "resolve-vulnerable-symbols-request"; diff --git a/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponse.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponse.ts new file mode 100644 index 000000000000..225e07d221c4 --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ResolveVulnerableSymbolsResponseData } from "./ResolveVulnerableSymbolsResponseData"; + +/** + * The definition of `ResolveVulnerableSymbolsResponse` object. + */ +export class ResolveVulnerableSymbolsResponse { + /** + * The definition of `ResolveVulnerableSymbolsResponseData` object. + */ + "data"?: ResolveVulnerableSymbolsResponseData; + /** + * 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: "ResolveVulnerableSymbolsResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ResolveVulnerableSymbolsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseData.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseData.ts new file mode 100644 index 000000000000..25a156649bfb --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseData.ts @@ -0,0 +1,64 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ResolveVulnerableSymbolsResponseDataAttributes } from "./ResolveVulnerableSymbolsResponseDataAttributes"; +import { ResolveVulnerableSymbolsResponseDataType } from "./ResolveVulnerableSymbolsResponseDataType"; + +/** + * The definition of `ResolveVulnerableSymbolsResponseData` object. + */ +export class ResolveVulnerableSymbolsResponseData { + /** + * The definition of `ResolveVulnerableSymbolsResponseDataAttributes` object. + */ + "attributes"?: ResolveVulnerableSymbolsResponseDataAttributes; + /** + * The `ResolveVulnerableSymbolsResponseData` `id`. + */ + "id"?: string; + /** + * Resolve vulnerable symbols response resource type. + */ + "type": ResolveVulnerableSymbolsResponseDataType; + /** + * 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: "ResolveVulnerableSymbolsResponseDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "ResolveVulnerableSymbolsResponseDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ResolveVulnerableSymbolsResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseDataAttributes.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseDataAttributes.ts new file mode 100644 index 000000000000..12de6baab8ad --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseDataAttributes.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ResolveVulnerableSymbolsResponseResults } from "./ResolveVulnerableSymbolsResponseResults"; + +/** + * The definition of `ResolveVulnerableSymbolsResponseDataAttributes` object. + */ +export class ResolveVulnerableSymbolsResponseDataAttributes { + /** + * The `attributes` `results`. + */ + "results"?: 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 = { + results: { + baseName: "results", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ResolveVulnerableSymbolsResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseDataType.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseDataType.ts new file mode 100644 index 000000000000..c4185b66aa04 --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseDataType.ts @@ -0,0 +1,10 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Resolve vulnerable symbols response resource type. + */ +export type ResolveVulnerableSymbolsResponseDataType = + | typeof RESOLVE_VULNERABLE_SYMBOLS_RESPONSE + | UnparsedObject; +export const RESOLVE_VULNERABLE_SYMBOLS_RESPONSE = + "resolve-vulnerable-symbols-response"; diff --git a/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseResults.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseResults.ts new file mode 100644 index 000000000000..9ec686404ff9 --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseResults.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ResolveVulnerableSymbolsResponseResultsVulnerableSymbols } from "./ResolveVulnerableSymbolsResponseResultsVulnerableSymbols"; + +/** + * The definition of `ResolveVulnerableSymbolsResponseResults` object. + */ +export class ResolveVulnerableSymbolsResponseResults { + /** + * The `items` `purl`. + */ + "purl"?: string; + /** + * The `items` `vulnerable_symbols`. + */ + "vulnerableSymbols"?: 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 = { + purl: { + baseName: "purl", + type: "string", + }, + vulnerableSymbols: { + baseName: "vulnerable_symbols", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ResolveVulnerableSymbolsResponseResults.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseResultsVulnerableSymbols.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseResultsVulnerableSymbols.ts new file mode 100644 index 000000000000..b5e93deea50f --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseResultsVulnerableSymbols.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols } from "./ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols"; + +/** + * The definition of `ResolveVulnerableSymbolsResponseResultsVulnerableSymbols` object. + */ +export class ResolveVulnerableSymbolsResponseResultsVulnerableSymbols { + /** + * The `items` `advisory_id`. + */ + "advisoryId"?: string; + /** + * The `items` `symbols`. + */ + "symbols"?: 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 = { + advisoryId: { + baseName: "advisory_id", + type: "string", + }, + symbols: { + baseName: "symbols", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ResolveVulnerableSymbolsResponseResultsVulnerableSymbols.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols.ts b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols.ts new file mode 100644 index 000000000000..8c355596a515 --- /dev/null +++ b/services/static_analysis/src/v2/models/ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols.ts @@ -0,0 +1,60 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * The definition of `ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols` object. + */ +export class ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols { + /** + * The `items` `name`. + */ + "name"?: string; + /** + * The `items` `type`. + */ + "type"?: string; + /** + * The `items` `value`. + */ + "value"?: 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 = { + name: { + baseName: "name", + type: "string", + }, + type: { + baseName: "type", + type: "string", + }, + value: { + baseName: "value", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequest.ts b/services/static_analysis/src/v2/models/ScaRequest.ts new file mode 100644 index 000000000000..08ebfcc0adbe --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequest.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ScaRequestData } from "./ScaRequestData"; + +/** + * The definition of `ScaRequest` object. + */ +export class ScaRequest { + /** + * The definition of `ScaRequestData` object. + */ + "data"?: ScaRequestData; + /** + * 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: "ScaRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestData.ts b/services/static_analysis/src/v2/models/ScaRequestData.ts new file mode 100644 index 000000000000..ea1893701508 --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestData.ts @@ -0,0 +1,64 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ScaRequestDataAttributes } from "./ScaRequestDataAttributes"; +import { ScaRequestDataType } from "./ScaRequestDataType"; + +/** + * The definition of `ScaRequestData` object. + */ +export class ScaRequestData { + /** + * The definition of `ScaRequestDataAttributes` object. + */ + "attributes"?: ScaRequestDataAttributes; + /** + * The `ScaRequestData` `id`. + */ + "id"?: string; + /** + * Scarequests resource type. + */ + "type": ScaRequestDataType; + /** + * 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: "ScaRequestDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "ScaRequestDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributes.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributes.ts new file mode 100644 index 000000000000..5c8aeffc1de2 --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributes.ts @@ -0,0 +1,115 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ScaRequestDataAttributesCommit } from "./ScaRequestDataAttributesCommit"; +import { ScaRequestDataAttributesDependenciesItems } from "./ScaRequestDataAttributesDependenciesItems"; +import { ScaRequestDataAttributesFilesItems } from "./ScaRequestDataAttributesFilesItems"; +import { ScaRequestDataAttributesRelationsItems } from "./ScaRequestDataAttributesRelationsItems"; +import { ScaRequestDataAttributesRepository } from "./ScaRequestDataAttributesRepository"; +import { ScaRequestDataAttributesVulnerabilitiesItems } from "./ScaRequestDataAttributesVulnerabilitiesItems"; + +/** + * The definition of `ScaRequestDataAttributes` object. + */ +export class ScaRequestDataAttributes { + /** + * The definition of `ScaRequestDataAttributesCommit` object. + */ + "commit"?: ScaRequestDataAttributesCommit; + /** + * The `attributes` `dependencies`. + */ + "dependencies"?: Array; + /** + * The `attributes` `env`. + */ + "env"?: string; + /** + * The `attributes` `files`. + */ + "files"?: Array; + /** + * The `attributes` `relations`. + */ + "relations"?: Array; + /** + * The definition of `ScaRequestDataAttributesRepository` object. + */ + "repository"?: ScaRequestDataAttributesRepository; + /** + * The `attributes` `service`. + */ + "service"?: string; + /** + * The `attributes` `tags`. + */ + "tags"?: { [key: string]: string }; + /** + * The `attributes` `vulnerabilities`. + */ + "vulnerabilities"?: 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 = { + commit: { + baseName: "commit", + type: "ScaRequestDataAttributesCommit", + }, + dependencies: { + baseName: "dependencies", + type: "Array", + }, + env: { + baseName: "env", + type: "string", + }, + files: { + baseName: "files", + type: "Array", + }, + relations: { + baseName: "relations", + type: "Array", + }, + repository: { + baseName: "repository", + type: "ScaRequestDataAttributesRepository", + }, + service: { + baseName: "service", + type: "string", + }, + tags: { + baseName: "tags", + type: "{ [key: string]: string; }", + }, + vulnerabilities: { + baseName: "vulnerabilities", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesCommit.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesCommit.ts new file mode 100644 index 000000000000..02a768e2b19a --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesCommit.ts @@ -0,0 +1,92 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * The definition of `ScaRequestDataAttributesCommit` object. + */ +export class ScaRequestDataAttributesCommit { + /** + * The `commit` `author_date`. + */ + "authorDate"?: string; + /** + * The `commit` `author_email`. + */ + "authorEmail"?: string; + /** + * The `commit` `author_name`. + */ + "authorName"?: string; + /** + * The `commit` `branch`. + */ + "branch"?: string; + /** + * The `commit` `committer_email`. + */ + "committerEmail"?: string; + /** + * The `commit` `committer_name`. + */ + "committerName"?: string; + /** + * The `commit` `sha`. + */ + "sha"?: 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 = { + authorDate: { + baseName: "author_date", + type: "string", + }, + authorEmail: { + baseName: "author_email", + type: "string", + }, + authorName: { + baseName: "author_name", + type: "string", + }, + branch: { + baseName: "branch", + type: "string", + }, + committerEmail: { + baseName: "committer_email", + type: "string", + }, + committerName: { + baseName: "committer_name", + type: "string", + }, + sha: { + baseName: "sha", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesCommit.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItems.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItems.ts new file mode 100644 index 000000000000..8dc5b56b0ade --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItems.ts @@ -0,0 +1,127 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ScaRequestDataAttributesDependenciesItemsLocationsItems } from "./ScaRequestDataAttributesDependenciesItemsLocationsItems"; +import { ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems } from "./ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems"; + +/** + * The definition of `ScaRequestDataAttributesDependenciesItems` object. + */ +export class ScaRequestDataAttributesDependenciesItems { + /** + * The `items` `exclusions`. + */ + "exclusions"?: Array; + /** + * The `items` `group`. + */ + "group"?: string; + /** + * The `items` `is_dev`. + */ + "isDev"?: boolean; + /** + * The `items` `is_direct`. + */ + "isDirect"?: boolean; + /** + * The `items` `language`. + */ + "language"?: string; + /** + * The `items` `locations`. + */ + "locations"?: Array; + /** + * The `items` `name`. + */ + "name"?: string; + /** + * The `items` `package_manager`. + */ + "packageManager"?: string; + /** + * The `items` `purl`. + */ + "purl"?: string; + /** + * The `items` `reachable_symbol_properties`. + */ + "reachableSymbolProperties"?: Array; + /** + * The `items` `version`. + */ + "version"?: 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 = { + exclusions: { + baseName: "exclusions", + type: "Array", + }, + group: { + baseName: "group", + type: "string", + }, + isDev: { + baseName: "is_dev", + type: "boolean", + }, + isDirect: { + baseName: "is_direct", + type: "boolean", + }, + language: { + baseName: "language", + type: "string", + }, + locations: { + baseName: "locations", + type: "Array", + }, + name: { + baseName: "name", + type: "string", + }, + packageManager: { + baseName: "package_manager", + type: "string", + }, + purl: { + baseName: "purl", + type: "string", + }, + reachableSymbolProperties: { + baseName: "reachable_symbol_properties", + type: "Array", + }, + version: { + baseName: "version", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesDependenciesItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsLocationsItems.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsLocationsItems.ts new file mode 100644 index 000000000000..2a3f46320e00 --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsLocationsItems.ts @@ -0,0 +1,70 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition } from "./ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition"; + +/** + * The definition of `ScaRequestDataAttributesDependenciesItemsLocationsItems` object. + */ +export class ScaRequestDataAttributesDependenciesItemsLocationsItems { + /** + * A position in a file + */ + "block"?: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition; + /** + * A position in a file + */ + "name"?: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition; + /** + * A position in a file + */ + "namespace"?: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition; + /** + * A position in a file + */ + "version"?: ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition; + /** + * 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 = { + block: { + baseName: "block", + type: "ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition", + }, + name: { + baseName: "name", + type: "ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition", + }, + namespace: { + baseName: "namespace", + type: "ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition", + }, + version: { + baseName: "version", + type: "ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesDependenciesItemsLocationsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition.ts new file mode 100644 index 000000000000..482a4fa3fd80 --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition.ts @@ -0,0 +1,62 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition } from "./ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition"; + +/** + * A position in a file + */ +export class ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition { + /** + * A position + */ + "end"?: ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition; + /** + * The `file_name`. + */ + "fileName"?: string; + /** + * A position + */ + "start"?: ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition; + /** + * 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 = { + end: { + baseName: "end", + type: "ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition", + }, + fileName: { + baseName: "file_name", + type: "string", + }, + start: { + baseName: "start", + type: "ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.ts new file mode 100644 index 000000000000..8decd7d902af --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * A position + */ +export class ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition { + /** + * The `col`. + */ + "col"?: number; + /** + * The `line`. + */ + "line"?: 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 = { + col: { + baseName: "col", + type: "number", + format: "int32", + }, + line: { + baseName: "line", + type: "number", + format: "int32", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems.ts new file mode 100644 index 000000000000..47132abce01a --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * The definition of `ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems` object. + */ +export class ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems { + /** + * The `items` `name`. + */ + "name"?: string; + /** + * The `items` `value`. + */ + "value"?: 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 = { + name: { + baseName: "name", + type: "string", + }, + value: { + baseName: "value", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesFilesItems.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesFilesItems.ts new file mode 100644 index 000000000000..11f8d33292d1 --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesFilesItems.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * The definition of `ScaRequestDataAttributesFilesItems` object. + */ +export class ScaRequestDataAttributesFilesItems { + /** + * The `items` `name`. + */ + "name"?: string; + /** + * The `items` `purl`. + */ + "purl"?: 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 = { + name: { + baseName: "name", + type: "string", + }, + purl: { + baseName: "purl", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesFilesItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesRelationsItems.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesRelationsItems.ts new file mode 100644 index 000000000000..a3a292d2000e --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesRelationsItems.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * The definition of `ScaRequestDataAttributesRelationsItems` object. + */ +export class ScaRequestDataAttributesRelationsItems { + /** + * The `items` `depends_on`. + */ + "dependsOn"?: Array; + /** + * The `items` `ref`. + */ + "ref"?: 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 = { + dependsOn: { + baseName: "depends_on", + type: "Array", + }, + ref: { + baseName: "ref", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesRelationsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesRepository.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesRepository.ts new file mode 100644 index 000000000000..70e427aec0e9 --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesRepository.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * The definition of `ScaRequestDataAttributesRepository` object. + */ +export class ScaRequestDataAttributesRepository { + /** + * The `repository` `url`. + */ + "url"?: 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 = { + url: { + baseName: "url", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesRepository.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesVulnerabilitiesItems.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesVulnerabilitiesItems.ts new file mode 100644 index 000000000000..09d74990568d --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesVulnerabilitiesItems.ts @@ -0,0 +1,62 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems } from "./ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems"; + +/** + * The definition of `ScaRequestDataAttributesVulnerabilitiesItems` object. + */ +export class ScaRequestDataAttributesVulnerabilitiesItems { + /** + * The `items` `affects`. + */ + "affects"?: Array; + /** + * The `items` `bom_ref`. + */ + "bomRef"?: string; + /** + * The `items` `id`. + */ + "id"?: 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 = { + affects: { + baseName: "affects", + type: "Array", + }, + bomRef: { + baseName: "bom_ref", + type: "string", + }, + id: { + baseName: "id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesVulnerabilitiesItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems.ts b/services/static_analysis/src/v2/models/ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems.ts new file mode 100644 index 000000000000..e15d635c9f80 --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * The definition of `ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems` object. + */ +export class ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems { + /** + * The `items` `ref`. + */ + "ref"?: 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 = { + ref: { + baseName: "ref", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/static_analysis/src/v2/models/ScaRequestDataType.ts b/services/static_analysis/src/v2/models/ScaRequestDataType.ts new file mode 100644 index 000000000000..4986d5608bed --- /dev/null +++ b/services/static_analysis/src/v2/models/ScaRequestDataType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Scarequests resource type. + */ +export type ScaRequestDataType = typeof SCAREQUESTS | UnparsedObject; +export const SCAREQUESTS = "scarequests"; diff --git a/services/static_analysis/src/v2/models/TypingInfo.ts b/services/static_analysis/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..3a8075f9ff9e --- /dev/null +++ b/services/static_analysis/src/v2/models/TypingInfo.ts @@ -0,0 +1,78 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { ResolveVulnerableSymbolsRequest } from "./ResolveVulnerableSymbolsRequest"; +import { ResolveVulnerableSymbolsRequestData } from "./ResolveVulnerableSymbolsRequestData"; +import { ResolveVulnerableSymbolsRequestDataAttributes } from "./ResolveVulnerableSymbolsRequestDataAttributes"; +import { ResolveVulnerableSymbolsResponse } from "./ResolveVulnerableSymbolsResponse"; +import { ResolveVulnerableSymbolsResponseData } from "./ResolveVulnerableSymbolsResponseData"; +import { ResolveVulnerableSymbolsResponseDataAttributes } from "./ResolveVulnerableSymbolsResponseDataAttributes"; +import { ResolveVulnerableSymbolsResponseResults } from "./ResolveVulnerableSymbolsResponseResults"; +import { ResolveVulnerableSymbolsResponseResultsVulnerableSymbols } from "./ResolveVulnerableSymbolsResponseResultsVulnerableSymbols"; +import { ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols } from "./ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols"; +import { ScaRequest } from "./ScaRequest"; +import { ScaRequestData } from "./ScaRequestData"; +import { ScaRequestDataAttributes } from "./ScaRequestDataAttributes"; +import { ScaRequestDataAttributesCommit } from "./ScaRequestDataAttributesCommit"; +import { ScaRequestDataAttributesDependenciesItems } from "./ScaRequestDataAttributesDependenciesItems"; +import { ScaRequestDataAttributesDependenciesItemsLocationsItems } from "./ScaRequestDataAttributesDependenciesItemsLocationsItems"; +import { ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition } from "./ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition"; +import { ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition } from "./ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition"; +import { ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems } from "./ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems"; +import { ScaRequestDataAttributesFilesItems } from "./ScaRequestDataAttributesFilesItems"; +import { ScaRequestDataAttributesRelationsItems } from "./ScaRequestDataAttributesRelationsItems"; +import { ScaRequestDataAttributesRepository } from "./ScaRequestDataAttributesRepository"; +import { ScaRequestDataAttributesVulnerabilitiesItems } from "./ScaRequestDataAttributesVulnerabilitiesItems"; +import { ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems } from "./ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + ResolveVulnerableSymbolsRequestDataType: [ + "resolve-vulnerable-symbols-request", + ], + ResolveVulnerableSymbolsResponseDataType: [ + "resolve-vulnerable-symbols-response", + ], + ScaRequestDataType: ["scarequests"], + }, + oneOfMap: {}, + typeMap: { + APIErrorResponse: APIErrorResponse, + ResolveVulnerableSymbolsRequest: ResolveVulnerableSymbolsRequest, + ResolveVulnerableSymbolsRequestData: ResolveVulnerableSymbolsRequestData, + ResolveVulnerableSymbolsRequestDataAttributes: + ResolveVulnerableSymbolsRequestDataAttributes, + ResolveVulnerableSymbolsResponse: ResolveVulnerableSymbolsResponse, + ResolveVulnerableSymbolsResponseData: ResolveVulnerableSymbolsResponseData, + ResolveVulnerableSymbolsResponseDataAttributes: + ResolveVulnerableSymbolsResponseDataAttributes, + ResolveVulnerableSymbolsResponseResults: + ResolveVulnerableSymbolsResponseResults, + ResolveVulnerableSymbolsResponseResultsVulnerableSymbols: + ResolveVulnerableSymbolsResponseResultsVulnerableSymbols, + ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols: + ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols, + ScaRequest: ScaRequest, + ScaRequestData: ScaRequestData, + ScaRequestDataAttributes: ScaRequestDataAttributes, + ScaRequestDataAttributesCommit: ScaRequestDataAttributesCommit, + ScaRequestDataAttributesDependenciesItems: + ScaRequestDataAttributesDependenciesItems, + ScaRequestDataAttributesDependenciesItemsLocationsItems: + ScaRequestDataAttributesDependenciesItemsLocationsItems, + ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition: + ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition, + ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition: + ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition, + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems: + ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems, + ScaRequestDataAttributesFilesItems: ScaRequestDataAttributesFilesItems, + ScaRequestDataAttributesRelationsItems: + ScaRequestDataAttributesRelationsItems, + ScaRequestDataAttributesRepository: ScaRequestDataAttributesRepository, + ScaRequestDataAttributesVulnerabilitiesItems: + ScaRequestDataAttributesVulnerabilitiesItems, + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems: + ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems, + }, +}; diff --git a/services/static_analysis/tsconfig.json b/services/static_analysis/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/static_analysis/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 89089aed98b6..70f512fbb8ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1000,6 +1000,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-static-analysis@workspace:services/static_analysis": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-static-analysis@workspace:services/static_analysis" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.0" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-synthetics@workspace:services/synthetics": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-synthetics@workspace:services/synthetics"