diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1a07af4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig is awesome: https://editorconfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +indent_style = space +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +[*.ts] +indent_size = 2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c457f0e..655f16b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: "Test, Lint & Deploy" +name: 'Test, Lint & Deploy' on: [push, pull_request] env: DIRENV_WARN_TIMEOUT: 5m diff --git a/.github/workflows/update-flake-lock.yml b/.github/workflows/update-flake-lock.yml index 98ba9f8..065cd00 100644 --- a/.github/workflows/update-flake-lock.yml +++ b/.github/workflows/update-flake-lock.yml @@ -17,5 +17,5 @@ jobs: - name: Update flake.lock uses: DeterminateSystems/update-flake-lock@main with: - pr-title: "chore: update flake.lock" - commit-msg: "chore: update flake.lock" + pr-title: 'chore: update flake.lock' + commit-msg: 'chore: update flake.lock' diff --git a/.yamlfmt b/.yamlfmt index 763a687..9da12de 100644 --- a/.yamlfmt +++ b/.yamlfmt @@ -1,4 +1,5 @@ gitignore_excludes: true eof_newline: true exclude: - - .yamllint \ No newline at end of file + - .yamllint + - .pre-commit-config.yaml diff --git a/.yamllint b/.yamllint index 294f47c..8b71f5b 100644 --- a/.yamllint +++ b/.yamllint @@ -1,3 +1,3 @@ ignore: | .pre-commit-config.yaml - node_modules \ No newline at end of file + node_modules diff --git a/deno.jsonc b/deno.jsonc index 50bcb10..f43e122 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -13,6 +13,7 @@ "fetch-mock": "npm:fetch-mock@^11.1.3", "typescript": "npm:typescript@^5.4.5" }, + "nodeModulesDir": "auto", "tasks": { "build": "deno run -A scripts/build_npm.ts", "check": "deno check src/**/*.ts", @@ -61,6 +62,7 @@ "singleQuote": true, "proseWrap": "always", "exclude": [ + ".pre-commit-config.yaml", "cov_profile/", "docs/", "dist/", diff --git a/flake.lock b/flake.lock index cbba402..18f9c5c 100644 --- a/flake.lock +++ b/flake.lock @@ -57,11 +57,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728384100, - "narHash": "sha256-mDU3jEm3Bwwia60j3QLsZ1U+luWAIMonJ581RAVUIWA=", + "lastModified": 1729507178, + "narHash": "sha256-3UZqmGSK+uMUGkydhnqng/iaT857JtAxH9DtucTbUQs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4033dced94fdf9fef89a4a0257a6338076178567", + "rev": "e156ec8b02301cd455ab96bbd53ebd7bf7d1e29d", "type": "github" }, "original": { @@ -108,11 +108,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1728092656, - "narHash": "sha256-eMeCTJZ5xBeQ0f9Os7K8DThNVSo9gy4umZLDfF5q6OM=", + "lastModified": 1729104314, + "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "1211305a5b237771e13fcca0c51e60ad47326a9a", + "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", "type": "github" }, "original": { diff --git a/openapitools.json b/openapitools.json index 954c9e3..64b196b 100644 --- a/openapitools.json +++ b/openapitools.json @@ -2,7 +2,10 @@ "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "7.9.0", + "version": "7.10.0-20241021.102936-40", + "repository": { + "downloadUrl": "https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.10.0-SNAPSHOT/openapi-generator-cli-${versionName}.jar" + }, "generators": { "v2": { "generatorName": "typescript", diff --git a/src/v2/generated/.openapi-generator/VERSION b/src/v2/generated/.openapi-generator/VERSION index 4bc5d61..6935482 100644 --- a/src/v2/generated/.openapi-generator/VERSION +++ b/src/v2/generated/.openapi-generator/VERSION @@ -1 +1 @@ -7.9.0 +7.10.0-SNAPSHOT diff --git a/src/v2/generated/apis/baseapi.ts b/src/v2/generated/apis/baseapi.ts index 46ed74b..3e1df15 100644 --- a/src/v2/generated/apis/baseapi.ts +++ b/src/v2/generated/apis/baseapi.ts @@ -30,7 +30,7 @@ export class BaseAPIRequestFactory { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; + override name: "RequiredError" = "RequiredError"; constructor(public api: string, public method: string, public field: string) { super("Required parameter " + field + " was null or undefined when calling " + api + "." + method + "."); } diff --git a/src/v2/generated/auth/auth.ts b/src/v2/generated/auth/auth.ts index 8763a5a..8e53bf2 100644 --- a/src/v2/generated/auth/auth.ts +++ b/src/v2/generated/auth/auth.ts @@ -51,6 +51,7 @@ export type ApiKeyConfiguration = string; export type HttpBasicConfiguration = { "username": string, "password": string }; export type HttpBearerConfiguration = { tokenProvider: TokenProvider }; export type OAuth2Configuration = { accessToken: string }; +export type HttpSignatureConfiguration = unknown; // TODO: Implement export type AuthMethodsConfiguration = { "default"?: SecurityAuthentication, diff --git a/src/v2/generated/http/http.ts b/src/v2/generated/http/http.ts index 231a58d..922bfd7 100644 --- a/src/v2/generated/http/http.ts +++ b/src/v2/generated/http/http.ts @@ -167,9 +167,12 @@ export class ResponseContext { return result; } - const parameters = this.headers[headerName].split(";"); + const parameters = this.headers[headerName]!.split(";"); for (const parameter of parameters) { let [key, value] = parameter.split("=", 2); + if (!key) { + continue; + } key = key.toLowerCase().trim(); if (value === undefined) { result[""] = key; @@ -234,9 +237,9 @@ export function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLib export class HttpInfo extends ResponseContext { public constructor( - public httpStatusCode: number, - public headers: Headers, - public body: ResponseBody, + httpStatusCode: number, + headers: Headers, + body: ResponseBody, public data: T, ) { super(httpStatusCode, headers, body); diff --git a/src/v2/generated/models/ObjectSerializer.ts b/src/v2/generated/models/ObjectSerializer.ts index d2f6aa9..06395ae 100644 --- a/src/v2/generated/models/ObjectSerializer.ts +++ b/src/v2/generated/models/ObjectSerializer.ts @@ -307,7 +307,7 @@ type MimeTypeDescriptor = { * the payload. */ const parseMimeType = (mimeType: string): MimeTypeDescriptor => { - const [type, subtype] = mimeType.split('/'); + const [type = '', subtype = ''] = mimeType.split('/'); return { type, subtype, @@ -514,7 +514,7 @@ export class ObjectSerializer { if (mediaType === undefined) { return undefined; } - return mediaType.split(";")[0].trim().toLowerCase(); + return (mediaType.split(";")[0] ?? '').trim().toLowerCase(); } /** diff --git a/src/v2/generated/servers.ts b/src/v2/generated/servers.ts index 9ba74ac..3f00eee 100644 --- a/src/v2/generated/servers.ts +++ b/src/v2/generated/servers.ts @@ -30,9 +30,8 @@ export class ServerConfiguration implements private getUrl() { let replacedUrl = this.url; - for (const key in this.variableConfiguration) { - var re = new RegExp("{" + key + "}","g"); - replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]); + for (const [key, value] of Object.entries(this.variableConfiguration)) { + replacedUrl = replacedUrl.replaceAll(`{${key}}`, value); } return replacedUrl }