From 3a98eb337fffa83941478150b0dad2d3ffdfe0ee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 20 Oct 2024 01:00:36 +0000 Subject: [PATCH 1/6] chore: update flake.lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/4033dced94fdf9fef89a4a0257a6338076178567?narHash=sha256-mDU3jEm3Bwwia60j3QLsZ1U%2BluWAIMonJ581RAVUIWA%3D' (2024-10-08) → 'github:NixOS/nixpkgs/75d8eea61e93c46fed1919f9ec798b7911378b22?narHash=sha256-Tl9738VMXlVjv7EVq3znrsodyUy0w1ekD0wsouzDybg%3D' (2024-10-19) • Updated input 'pre-commit-hooks-nix': 'github:cachix/pre-commit-hooks.nix/1211305a5b237771e13fcca0c51e60ad47326a9a?narHash=sha256-eMeCTJZ5xBeQ0f9Os7K8DThNVSo9gy4umZLDfF5q6OM%3D' (2024-10-05) → 'github:cachix/pre-commit-hooks.nix/3c3e88f0f544d6bb54329832616af7eb971b6be6?narHash=sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ%2B/nVtALHIciX/BI%3D' (2024-10-16) --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index cbba402..4e6346f 100644 --- a/flake.lock +++ b/flake.lock @@ -57,11 +57,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728384100, - "narHash": "sha256-mDU3jEm3Bwwia60j3QLsZ1U+luWAIMonJ581RAVUIWA=", + "lastModified": 1729381852, + "narHash": "sha256-Tl9738VMXlVjv7EVq3znrsodyUy0w1ekD0wsouzDybg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4033dced94fdf9fef89a4a0257a6338076178567", + "rev": "75d8eea61e93c46fed1919f9ec798b7911378b22", "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": { From d1d903b7a6fbc28498d14708c126e30fe61a3e13 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Mon, 21 Oct 2024 11:40:51 +0100 Subject: [PATCH 2/6] chore: update flake.lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/75d8eea61e93c46fed1919f9ec798b7911378b22' (2024-10-19) → 'github:NixOS/nixpkgs/e156ec8b02301cd455ab96bbd53ebd7bf7d1e29d' (2024-10-21) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 4e6346f..18f9c5c 100644 --- a/flake.lock +++ b/flake.lock @@ -57,11 +57,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1729381852, - "narHash": "sha256-Tl9738VMXlVjv7EVq3znrsodyUy0w1ekD0wsouzDybg=", + "lastModified": 1729507178, + "narHash": "sha256-3UZqmGSK+uMUGkydhnqng/iaT857JtAxH9DtucTbUQs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "75d8eea61e93c46fed1919f9ec798b7911378b22", + "rev": "e156ec8b02301cd455ab96bbd53ebd7bf7d1e29d", "type": "github" }, "original": { From 5bbc6a9bb1646c3ea61599514cd0ae69d8ed7189 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Mon, 21 Oct 2024 11:43:22 +0100 Subject: [PATCH 3/6] fix: use nightly --- openapitools.json | 5 ++++- src/v2/generated/.openapi-generator/VERSION | 2 +- src/v2/generated/apis/baseapi.ts | 2 +- src/v2/generated/auth/auth.ts | 1 + src/v2/generated/http/http.ts | 11 +++++++---- src/v2/generated/models/ObjectSerializer.ts | 4 ++-- src/v2/generated/servers.ts | 5 ++--- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/openapitools.json b/openapitools.json index 954c9e3..bc2ca95 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 } From ee05acfb718f5f29a41f2a90bbf942a5371211de Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Mon, 21 Oct 2024 11:45:24 +0100 Subject: [PATCH 4/6] style: formatting --- .github/workflows/main.yml | 2 +- .github/workflows/update-flake-lock.yml | 4 ++-- .yamlfmt | 3 ++- deno.jsonc | 1 + openapitools.json | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) 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..20eff81 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 \ No newline at end of file diff --git a/deno.jsonc b/deno.jsonc index 50bcb10..9cd2e33 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -61,6 +61,7 @@ "singleQuote": true, "proseWrap": "always", "exclude": [ + ".pre-commit-config.yaml", "cov_profile/", "docs/", "dist/", diff --git a/openapitools.json b/openapitools.json index bc2ca95..64b196b 100644 --- a/openapitools.json +++ b/openapitools.json @@ -4,7 +4,7 @@ "generator-cli": { "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" + "downloadUrl": "https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.10.0-SNAPSHOT/openapi-generator-cli-${versionName}.jar" }, "generators": { "v2": { From 98ece6faa72463659d103bcc2f9cf72c5530b1f7 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Mon, 21 Oct 2024 11:50:24 +0100 Subject: [PATCH 5/6] style: formatting --- .editorconfig | 15 +++++++++++++++ .yamlfmt | 2 +- .yamllint | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .editorconfig 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/.yamlfmt b/.yamlfmt index 20eff81..9da12de 100644 --- a/.yamlfmt +++ b/.yamlfmt @@ -2,4 +2,4 @@ gitignore_excludes: true eof_newline: true exclude: - .yamllint - - .pre-commit-config.yaml \ No newline at end of file + - .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 From 7793df655cbff3fed23416f1ccf565d1aa26e2e0 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Thu, 17 Oct 2024 12:56:13 +0100 Subject: [PATCH 6/6] chore: auto-install npm deps --- deno.jsonc | 1 + 1 file changed, 1 insertion(+) diff --git a/deno.jsonc b/deno.jsonc index 9cd2e33..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",