From d95c687346d6d554a64cfc0638674b009dec47be Mon Sep 17 00:00:00 2001 From: Guilherme Werner Date: Fri, 5 Jan 2024 11:49:17 -0300 Subject: [PATCH] Add mintaka as dependency --- package.json | 2 +- src/api.ts | 30 ++--- src/client.ts | 10 +- src/http/index.ts | 192 ----------------------------- src/index.ts | 37 ------ src/oauth2/index.ts | 60 ---------- src/server.ts | 1 - yarn.lock | 285 ++++++++++++++++++++++++-------------------- 8 files changed, 171 insertions(+), 446 deletions(-) delete mode 100644 src/http/index.ts delete mode 100644 src/oauth2/index.ts diff --git a/package.json b/package.json index bd12d94..aa06ccd 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "prepare": "npm run build" }, "dependencies": { + "@tribufu/mintaka": "^0.1.0", "axios": "^1.6.3", "camelcase-keys": "^9.1.2", "fp-ts": "^2.16.1", @@ -26,7 +27,6 @@ "uuid": "^9.0.1" }, "devDependencies": { - "@types/dotenv": "^8.2.0", "@types/json-bigint": "^1.0.4", "@types/jsonwebtoken": "^9.0.5", "@types/node": "^20.10.6", diff --git a/src/api.ts b/src/api.ts index 6ce8ef0..b25dc4c 100644 --- a/src/api.ts +++ b/src/api.ts @@ -1,17 +1,11 @@ // Copyright (c) Tribufu. All Rights Reserved. -import { HeaderMap, TribufuHttp } from "./http"; +import { HttpHeaders, HttpClient } from "@tribufu/mintaka"; import { JavaScriptRuntime } from "./node"; import { TribufuApiOptions } from "./options"; -import { TribufuBot } from "./bot"; -import { TribufuClient } from "./client"; -import { TribufuServer } from "./server"; -import axios, { AxiosInstance } from "axios"; import jwt from "jsonwebtoken"; import { TokenPayload } from "./token"; import { TRIBUFU_API_URL, TRIBUFU_VERSION } from "."; -import camelcaseKeys from "camelcase-keys"; -import snakecaseKeys from "snakecase-keys"; /** * **Tribufu API** @@ -24,13 +18,13 @@ import snakecaseKeys from "snakecase-keys"; * - A client give you read and write access to the Tribufu API as a client application. */ export class TribufuApi { - protected readonly http: TribufuHttp; + protected readonly http: HttpClient; protected readonly options: TribufuApiOptions; constructor(options?: TribufuApiOptions | null) { this.options = options || {}; - this.http = new TribufuHttp({ + this.http = new HttpClient({ baseUrl: TribufuApi.getBaseUrl(), headers: TribufuApi.defaultHeaders(), logEnabled: TribufuApi.debugEnabled(), @@ -129,12 +123,10 @@ export class TribufuApi { * Get the default headers for the Tribufu API. * @returns HeaderMap */ - private static defaultHeaders(): HeaderMap { - const headers = { - "X-Tribufu-Language": "javascript", - "X-Tribufu-Version": TRIBUFU_VERSION, - }; - + private static defaultHeaders(): HttpHeaders { + const headers = new HttpHeaders(); + headers.set("X-Tribufu-Language", "javascript"); + headers.set("X-Tribufu-Version", TRIBUFU_VERSION); return headers; } @@ -197,16 +189,16 @@ export class TribufuApi { * Get current headers with the api key or access token. * @returns HeaderMap */ - protected getHeaders(): HeaderMap { - let headers: HeaderMap = {}; + protected getHeaders(): HttpHeaders { + let headers = TribufuApi.defaultHeaders(); if (this.options.apiKey) { - headers["Authorization"] = `ApiKey ${this.options.apiKey}`; + headers.set("Authorization", `ApiKey ${this.options.apiKey}`); return headers; } if (this.options.accessToken) { - headers["Authorization"] = `Bearer ${this.options.accessToken}`; + headers.set("Authorization", `Bearer ${this.options.accessToken}`); return headers; } diff --git a/src/client.ts b/src/client.ts index bc8f835..80cb64d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,7 +1,7 @@ // Copyright (c) Tribufu. All Rights Reserved. -import { CookieMap, HeaderMap } from "./http"; -import { OAuth2GrantType, OAuth2IntrospectionRequest, OAuth2IntrospectionResponse, OAuth2TokenRequest, OAuth2TokenResponse } from "./oauth2"; +import { HttpCookieMap, HttpHeaders } from "@tribufu/mintaka"; +import { OAuth2GrantType, OAuth2IntrospectionRequest, OAuth2IntrospectionResponse, OAuth2TokenRequest, OAuth2TokenResponse } from "@tribufu/mintaka"; import { TribufuApi } from "./api"; import { User } from "./models/user"; @@ -68,7 +68,7 @@ export class TribufuClient extends TribufuApi { * const client = TribufuClient.fromCookies(cookies, "TRIBUFU_"); * ``` */ - public static fromCookies(cookies: CookieMap, prefix: string = ""): TribufuClient | null { + public static fromCookies(cookies: HttpCookieMap, prefix: string = ""): TribufuClient | null { const client = TribufuClient.fromEnv(prefix); const accessToken = cookies["access_token"] || null; const refreshToken = cookies["refresh_token"] || null; @@ -109,9 +109,9 @@ export class TribufuClient extends TribufuApi { /** * Get the headers for a oauth2 request. - * @returns HeaderMap + * @returns HttpHeaders */ - private getOAuthHeaders(): HeaderMap { + private getOAuthHeaders(): HttpHeaders { let headers = this.getHeaders(); headers["Authorization"] = `Basic ${Buffer.from(`${this.clientId}:${this.clientSecret}`, "binary").toString("base64")}`; headers["Content-Type"] = "application/x-www-form-urlencoded"; diff --git a/src/http/index.ts b/src/http/index.ts deleted file mode 100644 index 1f9e96e..0000000 --- a/src/http/index.ts +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Tribufu. All Rights Reserved. - -import axios, { AxiosInstance } from "axios"; -import camelcaseKeys from "camelcase-keys"; -import snakecaseKeys from "snakecase-keys"; - -export type HeaderMap = { - [key: string]: string -}; - -export type CookieMap = { - [key: string]: string; -}; - -export interface ErrorResponse { - error: string; -}; - -export interface MessageResponse { - message: string; -}; - -export interface TribufuHttpOptions { - baseUrl?: string | null; - headers?: HeaderMap; - logEnabled?: boolean; - logTarget?: string; -}; - -/** - * Tribufu Http - * - * Helper class to make HTTP requests to the Tribufu API. - */ -export class TribufuHttp { - private readonly inner: AxiosInstance; - protected readonly options: TribufuHttpOptions; - - constructor(options?: TribufuHttpOptions | null) { - const defaultOptions = TribufuHttp.defaultOptions(); - - this.options = { - baseUrl: options?.baseUrl || defaultOptions.baseUrl, - headers: options?.headers || defaultOptions.headers, - logEnabled: options?.logEnabled || defaultOptions.logEnabled, - logTarget: options?.logTarget || defaultOptions.logTarget, - }; - - const inner = axios.create({ - baseURL: this.options?.baseUrl || undefined, - headers: this.options?.headers || undefined, - }); - - inner.interceptors.request.use((req) => { - if (this.options.logEnabled ?? false) { - console.log(`(${this.options.logTarget}) ${req.method?.toUpperCase()} ${req.baseURL}${req.url}`); - } - - const contentType = req.headers["Content-Type"]; - if (req.data && (contentType === "application/json" || contentType === "application/x-www-form-urlencoded")) { - req.data = snakecaseKeys(req.data); - } - - return req; - }); - - inner.interceptors.response.use((res) => { - if (res.data) { - res.data = camelcaseKeys(res.data); - } - - return res; - }); - - this.inner = inner; - } - - private static defaultOptions(): TribufuHttpOptions { - return { - baseUrl: null, - headers: {}, - logEnabled: false, - logTarget: "TribufuHttp", - }; - }; - - /** - * Get a resource from the Tribufu API. - * @returns T | null - */ - public async get(path: string, headers?: HeaderMap | null): Promise { - try { - const requestHeaders = headers || this.options.headers; - const response = await this.inner.get(path, { headers: requestHeaders }); - - if (response.status !== 200) { - return null; - } - - return response.data as T; - } catch (error) { - return null; - } - } - - /** - * Create a resource to the Tribufu API. - * @param path - * @param body - * @param headers - * @returns T | null - */ - public async post(path: string, body: S, headers?: HeaderMap | null): Promise { - try { - const requestHeaders = headers || this.options.headers; - const response = await this.inner.post(path, body, { headers: requestHeaders }); - - if (response.status !== 200) { - return null; - } - - return response.data as T; - } catch (error) { - return null; - } - } - - /** - * Update a resource on the Tribufu API. - * @param path - * @param body - * @param headers - * @returns T | null - */ - public async put(path: string, body: S, headers?: HeaderMap | null): Promise { - try { - const requestHeaders = headers || this.options.headers; - const response = await this.inner.put(path, body, { headers: requestHeaders }); - - if (response.status !== 200) { - return null; - } - - return response.data as T; - } catch (error) { - return null; - } - } - - /** - * Patch a resource on the Tribufu API. - * @param path - * @param body - * @param headers - * @returns T | null - */ - public async patch(path: string, body: S, headers?: HeaderMap | null): Promise { - try { - const requestHeaders = headers || this.options.headers; - const response = await this.inner.patch(path, body, { headers: requestHeaders }); - - if (response.status !== 200) { - return null; - } - - return response.data as T; - } catch (error) { - return null; - } - } - - /** - * Delete a resource from the Tribufu API. - * @param path - * @param headers - * @returns T | null - */ - public async delete(path: string, headers?: HeaderMap | null): Promise { - try { - const requestHeaders = headers || this.options.headers; - const response = await this.inner.delete(path, { headers: requestHeaders }); - - if (response.status !== 200) { - return null; - } - - return response.data as T; - } catch (error) { - return null; - } - } -} diff --git a/src/index.ts b/src/index.ts index 2e18295..11877c6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,47 +18,10 @@ import { TribufuBot } from "./bot"; import { TribufuClient } from "./client"; import { TribufuServer } from "./server"; -import { - TribufuHttp, - TribufuHttpOptions -} from "./http"; - export { TribufuApi, TribufuApiOptions, TribufuBot, TribufuClient, - TribufuHttp, - TribufuHttpOptions, TribufuServer, }; - -import { - OAuth2AuthorizeRequest, - OAuth2ClientType, - OAuth2CodeResponse, - OAuth2GrantType, - OAuth2IntrospectionRequest, - OAuth2IntrospectionResponse, - OAuth2ResponseType, - OAuth2RevokeRequest, - OAuth2TokenHintType, - OAuth2TokenRequest, - OAuth2TokenResponse, - OAuth2TokenType -} from "./oauth2"; - -export { - OAuth2AuthorizeRequest, - OAuth2ClientType, - OAuth2CodeResponse, - OAuth2GrantType, - OAuth2IntrospectionRequest, - OAuth2IntrospectionResponse, - OAuth2ResponseType, - OAuth2RevokeRequest, - OAuth2TokenHintType, - OAuth2TokenRequest, - OAuth2TokenResponse, - OAuth2TokenType -}; diff --git a/src/oauth2/index.ts b/src/oauth2/index.ts deleted file mode 100644 index 1bb1df5..0000000 --- a/src/oauth2/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Tribufu. All Rights Reserved. - -export type OAuth2ClientType = "web" | "native"; -export type OAuth2GrantType = "authorization_code" | "client_credentials" | "device_code" | "password" | "passkey" | "refresh_token"; -export type OAuth2ResponseType = "code" | "token"; -export type OAuth2TokenHintType = "refresh_token" | "access_token"; -export type OAuth2TokenType = "bearer"; - -export interface OAuth2AuthorizeRequest { - response_type: OAuth2ResponseType; - client_id: string; - client_secret: string; - scope?: string | null; - redirect_uri: string; - state?: string | null; -}; - -export interface OAuth2CodeResponse { - code: string; - state?: string | null; -}; - -export interface OAuth2TokenRequest { - grant_type: OAuth2GrantType; - code?: string | null; - refresh_token?: string | null; - username?: string | null; - password?: string | null; - passkey?: string | null; - client_id: string; - client_secret: string; - redirect_uri?: string | null; -}; - -export interface OAuth2RevokeRequest { - token: string; - token_type_hint: OAuth2TokenHintType; -}; - -export interface OAuth2TokenResponse { - token_type: OAuth2TokenType; - access_token: string; - refresh_token?: string | null; - scope?: string | null; - state?: string | null; - expires_in: number; -}; - -export interface OAuth2IntrospectionRequest { - token: string; - token_type_hint: OAuth2TokenHintType; -}; - -export interface OAuth2IntrospectionResponse { - active: boolean; - client_id?: string | null; - username?: string | null; - scope?: string | null; - exp?: number | null; -}; diff --git a/src/server.ts b/src/server.ts index b936b49..469b75d 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,6 +1,5 @@ // Copyright (c) Tribufu. All Rights Reserved. -import { TribufuApi } from "./api"; import { TribufuClient } from "./client"; /** diff --git a/yarn.lock b/yarn.lock index f829247..f6969a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,120 +2,120 @@ # yarn lockfile v1 -"@esbuild/aix-ppc64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.10.tgz#fb3922a0183d27446de00cf60d4f7baaadf98d84" - integrity sha512-Q+mk96KJ+FZ30h9fsJl+67IjNJm3x2eX+GBWGmocAKgzp27cowCOOqSdscX80s0SpdFXZnIv/+1xD1EctFx96Q== +"@esbuild/aix-ppc64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz#2acd20be6d4f0458bc8c784103495ff24f13b1d3" + integrity sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g== -"@esbuild/android-arm64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.10.tgz#ef31015416dd79398082409b77aaaa2ade4d531a" - integrity sha512-1X4CClKhDgC3by7k8aOWZeBXQX8dHT5QAMCAQDArCLaYfkppoARvh0fit3X2Qs+MXDngKcHv6XXyQCpY0hkK1Q== +"@esbuild/android-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz#b45d000017385c9051a4f03e17078abb935be220" + integrity sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q== -"@esbuild/android-arm@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.10.tgz#1c23c7e75473aae9fb323be5d9db225142f47f52" - integrity sha512-7W0bK7qfkw1fc2viBfrtAEkDKHatYfHzr/jKAHNr9BvkYDXPcC6bodtm8AyLJNNuqClLNaeTLuwURt4PRT9d7w== +"@esbuild/android-arm@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.11.tgz#f46f55414e1c3614ac682b29977792131238164c" + integrity sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw== -"@esbuild/android-x64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.10.tgz#df6a4e6d6eb8da5595cfce16d4e3f6bc24464707" - integrity sha512-O/nO/g+/7NlitUxETkUv/IvADKuZXyH4BHf/g/7laqKC4i/7whLpB0gvpPc2zpF0q9Q6FXS3TS75QHac9MvVWw== +"@esbuild/android-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.11.tgz#bfc01e91740b82011ef503c48f548950824922b2" + integrity sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg== -"@esbuild/darwin-arm64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.10.tgz#8462a55db07c1b2fad61c8244ce04469ef1043be" - integrity sha512-YSRRs2zOpwypck+6GL3wGXx2gNP7DXzetmo5pHXLrY/VIMsS59yKfjPizQ4lLt5vEI80M41gjm2BxrGZ5U+VMA== +"@esbuild/darwin-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz#533fb7f5a08c37121d82c66198263dcc1bed29bf" + integrity sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ== -"@esbuild/darwin-x64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.10.tgz#d1de20bfd41bb75b955ba86a6b1004539e8218c1" - integrity sha512-alfGtT+IEICKtNE54hbvPg13xGBe4GkVxyGWtzr+yHO7HIiRJppPDhOKq3zstTcVf8msXb/t4eavW3jCDpMSmA== +"@esbuild/darwin-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz#62f3819eff7e4ddc656b7c6815a31cf9a1e7d98e" + integrity sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g== -"@esbuild/freebsd-arm64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.10.tgz#16904879e34c53a2e039d1284695d2db3e664d57" - integrity sha512-dMtk1wc7FSH8CCkE854GyGuNKCewlh+7heYP/sclpOG6Cectzk14qdUIY5CrKDbkA/OczXq9WesqnPl09mj5dg== +"@esbuild/freebsd-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz#d478b4195aa3ca44160272dab85ef8baf4175b4a" + integrity sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA== -"@esbuild/freebsd-x64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.10.tgz#8ad9e5ca9786ca3f1ef1411bfd10b08dcd9d4cef" - integrity sha512-G5UPPspryHu1T3uX8WiOEUa6q6OlQh6gNl4CO4Iw5PS+Kg5bVggVFehzXBJY6X6RSOMS8iXDv2330VzaObm4Ag== +"@esbuild/freebsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz#7bdcc1917409178257ca6a1a27fe06e797ec18a2" + integrity sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw== -"@esbuild/linux-arm64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.10.tgz#d82cf2c590faece82d28bbf1cfbe36f22ae25bd2" - integrity sha512-QxaouHWZ+2KWEj7cGJmvTIHVALfhpGxo3WLmlYfJ+dA5fJB6lDEIg+oe/0//FuyVHuS3l79/wyBxbHr0NgtxJQ== +"@esbuild/linux-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz#58ad4ff11685fcc735d7ff4ca759ab18fcfe4545" + integrity sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg== -"@esbuild/linux-arm@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.10.tgz#477b8e7c7bcd34369717b04dd9ee6972c84f4029" - integrity sha512-j6gUW5aAaPgD416Hk9FHxn27On28H4eVI9rJ4az7oCGTFW48+LcgNDBN+9f8rKZz7EEowo889CPKyeaD0iw9Kg== +"@esbuild/linux-arm@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz#ce82246d873b5534d34de1e5c1b33026f35e60e3" + integrity sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q== -"@esbuild/linux-ia32@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.10.tgz#d55ff822cf5b0252a57112f86857ff23be6cab0e" - integrity sha512-4ub1YwXxYjj9h1UIZs2hYbnTZBtenPw5NfXCRgEkGb0b6OJ2gpkMvDqRDYIDRjRdWSe/TBiZltm3Y3Q8SN1xNg== +"@esbuild/linux-ia32@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz#cbae1f313209affc74b80f4390c4c35c6ab83fa4" + integrity sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA== -"@esbuild/linux-loong64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.10.tgz#a9ad057d7e48d6c9f62ff50f6f208e331c4543c7" - integrity sha512-lo3I9k+mbEKoxtoIbM0yC/MZ1i2wM0cIeOejlVdZ3D86LAcFXFRdeuZmh91QJvUTW51bOK5W2BznGNIl4+mDaA== +"@esbuild/linux-loong64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz#5f32aead1c3ec8f4cccdb7ed08b166224d4e9121" + integrity sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg== -"@esbuild/linux-mips64el@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.10.tgz#b011a96924773d60ebab396fbd7a08de66668179" - integrity sha512-J4gH3zhHNbdZN0Bcr1QUGVNkHTdpijgx5VMxeetSk6ntdt+vR1DqGmHxQYHRmNb77tP6GVvD+K0NyO4xjd7y4A== +"@esbuild/linux-mips64el@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz#38eecf1cbb8c36a616261de858b3c10d03419af9" + integrity sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg== -"@esbuild/linux-ppc64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.10.tgz#5d8b59929c029811e473f2544790ea11d588d4dd" - integrity sha512-tgT/7u+QhV6ge8wFMzaklOY7KqiyitgT1AUHMApau32ZlvTB/+efeCtMk4eXS+uEymYK249JsoiklZN64xt6oQ== +"@esbuild/linux-ppc64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz#9c5725a94e6ec15b93195e5a6afb821628afd912" + integrity sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA== -"@esbuild/linux-riscv64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.10.tgz#292b06978375b271bd8bc0a554e0822957508d22" - integrity sha512-0f/spw0PfBMZBNqtKe5FLzBDGo0SKZKvMl5PHYQr3+eiSscfJ96XEknCe+JoOayybWUFQbcJTrk946i3j9uYZA== +"@esbuild/linux-riscv64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz#2dc4486d474a2a62bbe5870522a9a600e2acb916" + integrity sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ== -"@esbuild/linux-s390x@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.10.tgz#d30af63530f8d4fa96930374c9dd0d62bf59e069" - integrity sha512-pZFe0OeskMHzHa9U38g+z8Yx5FNCLFtUnJtQMpwhS+r4S566aK2ci3t4NCP4tjt6d5j5uo4h7tExZMjeKoehAA== +"@esbuild/linux-s390x@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz#4ad8567df48f7dd4c71ec5b1753b6f37561a65a8" + integrity sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q== -"@esbuild/linux-x64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.10.tgz#898c72eeb74d9f2fb43acf316125b475548b75ce" - integrity sha512-SpYNEqg/6pZYoc+1zLCjVOYvxfZVZj6w0KROZ3Fje/QrM3nfvT2llI+wmKSrWuX6wmZeTapbarvuNNK/qepSgA== +"@esbuild/linux-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz#b7390c4d5184f203ebe7ddaedf073df82a658766" + integrity sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA== -"@esbuild/netbsd-x64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.10.tgz#fd473a5ae261b43eab6dad4dbd5a3155906e6c91" - integrity sha512-ACbZ0vXy9zksNArWlk2c38NdKg25+L9pr/mVaj9SUq6lHZu/35nx2xnQVRGLrC1KKQqJKRIB0q8GspiHI3J80Q== +"@esbuild/netbsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz#d633c09492a1721377f3bccedb2d821b911e813d" + integrity sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ== -"@esbuild/openbsd-x64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.10.tgz#96eb8992e526717b5272321eaad3e21f3a608e46" - integrity sha512-PxcgvjdSjtgPMiPQrM3pwSaG4kGphP+bLSb+cihuP0LYdZv1epbAIecHVl5sD3npkfYBZ0ZnOjR878I7MdJDFg== +"@esbuild/openbsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz#17388c76e2f01125bf831a68c03a7ffccb65d1a2" + integrity sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw== -"@esbuild/sunos-x64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.10.tgz#c16ee1c167f903eaaa6acf7372bee42d5a89c9bc" - integrity sha512-ZkIOtrRL8SEJjr+VHjmW0znkPs+oJXhlJbNwfI37rvgeMtk3sxOQevXPXjmAPZPigVTncvFqLMd+uV0IBSEzqA== +"@esbuild/sunos-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz#e320636f00bb9f4fdf3a80e548cb743370d41767" + integrity sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ== -"@esbuild/win32-arm64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.10.tgz#7e417d1971dbc7e469b4eceb6a5d1d667b5e3dcc" - integrity sha512-+Sa4oTDbpBfGpl3Hn3XiUe4f8TU2JF7aX8cOfqFYMMjXp6ma6NJDztl5FDG8Ezx0OjwGikIHw+iA54YLDNNVfw== +"@esbuild/win32-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz#c778b45a496e90b6fc373e2a2bb072f1441fe0ee" + integrity sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ== -"@esbuild/win32-ia32@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.10.tgz#2b52dfec6cd061ecb36171c13bae554888b439e5" - integrity sha512-EOGVLK1oWMBXgfttJdPHDTiivYSjX6jDNaATeNOaCOFEVcfMjtbx7WVQwPSE1eIfCp/CaSF2nSrDtzc4I9f8TQ== +"@esbuild/win32-ia32@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz#481a65fee2e5cce74ec44823e6b09ecedcc5194c" + integrity sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg== -"@esbuild/win32-x64@0.19.10": - version "0.19.10" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.10.tgz#bd123a74f243d2f3a1f046447bb9b363ee25d072" - integrity sha512-whqLG6Sc70AbU73fFYvuYzaE4MNMBIlR1Y/IrUeOXFrWHxBEjjbZaQ3IXIQS8wJdAzue2GwYZCjOrgrU1oUHoA== +"@esbuild/win32-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz#a5d300008960bb39677c46bf16f53ec70d8dee04" + integrity sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw== "@isaacs/cliui@^8.0.2": version "8.0.2" @@ -134,6 +134,21 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@tribufu/mintaka@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@tribufu/mintaka/-/mintaka-0.1.0.tgz#28cb190a7ea2ff2995c71529e5016600060567b5" + integrity sha512-SiSJzvF+F0FZMNmGw+GWAbcjVeuYyHFzunEuGXE9BMaxybbFuywJJEHu4IemHl+cCzg6AMHs74v/y5gpg0Eyig== + dependencies: + axios "^1.6.3" + camelcase-keys "^9.1.2" + fp-ts "^2.16.1" + json-bigint "^1.0.0" + jsonwebtoken "^9.0.2" + snakecase-keys "^5.5.0" + toml "^3.0.0" + uuid "^9.0.1" + uuidv7 "^0.6.3" + "@types/dotenv@^8.2.0": version "8.2.0" resolved "https://registry.yarnpkg.com/@types/dotenv/-/dotenv-8.2.0.tgz#5cd64710c3c98e82d9d15844375a33bf1b45d053" @@ -193,11 +208,11 @@ asynckit@^0.4.0: integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== axios@^1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.3.tgz#7f50f23b3aa246eff43c54834272346c396613f4" - integrity sha512-fWyNdeawGam70jXSVlKl+SUNVcL6j6W79CuSIPfi6HnDUmSCH6gyUys/HrqHeA/wU0Az41rRgean494d0Jb+ww== + version "1.6.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.4.tgz#184ee1f63d412caffcf30d2c50982253c3ee86e0" + integrity sha512-heJnIs6N4aa1eSthhN9M5ioILu8Wi8vmQW9iHQ9NUvfkJb0lEEDUiIdQNAuBtfUt3FxReaKdpQA5DbmMOqzF/A== dependencies: - follow-redirects "^1.15.0" + follow-redirects "^1.15.4" form-data "^4.0.0" proxy-from-env "^1.1.0" @@ -322,33 +337,33 @@ esbuild-node-externals@^1.12.0: tslib "^2.4.1" esbuild@^0.19.10: - version "0.19.10" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.10.tgz#55e83e4a6b702e3498b9f872d84bfb4ebcb6d16e" - integrity sha512-S1Y27QGt/snkNYrRcswgRFqZjaTG5a5xM3EQo97uNBnH505pdzSNe/HLBq1v0RO7iK/ngdbhJB6mDAp0OK+iUA== + version "0.19.11" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.11.tgz#4a02dca031e768b5556606e1b468fe72e3325d96" + integrity sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA== optionalDependencies: - "@esbuild/aix-ppc64" "0.19.10" - "@esbuild/android-arm" "0.19.10" - "@esbuild/android-arm64" "0.19.10" - "@esbuild/android-x64" "0.19.10" - "@esbuild/darwin-arm64" "0.19.10" - "@esbuild/darwin-x64" "0.19.10" - "@esbuild/freebsd-arm64" "0.19.10" - "@esbuild/freebsd-x64" "0.19.10" - "@esbuild/linux-arm" "0.19.10" - "@esbuild/linux-arm64" "0.19.10" - "@esbuild/linux-ia32" "0.19.10" - "@esbuild/linux-loong64" "0.19.10" - "@esbuild/linux-mips64el" "0.19.10" - "@esbuild/linux-ppc64" "0.19.10" - "@esbuild/linux-riscv64" "0.19.10" - "@esbuild/linux-s390x" "0.19.10" - "@esbuild/linux-x64" "0.19.10" - "@esbuild/netbsd-x64" "0.19.10" - "@esbuild/openbsd-x64" "0.19.10" - "@esbuild/sunos-x64" "0.19.10" - "@esbuild/win32-arm64" "0.19.10" - "@esbuild/win32-ia32" "0.19.10" - "@esbuild/win32-x64" "0.19.10" + "@esbuild/aix-ppc64" "0.19.11" + "@esbuild/android-arm" "0.19.11" + "@esbuild/android-arm64" "0.19.11" + "@esbuild/android-x64" "0.19.11" + "@esbuild/darwin-arm64" "0.19.11" + "@esbuild/darwin-x64" "0.19.11" + "@esbuild/freebsd-arm64" "0.19.11" + "@esbuild/freebsd-x64" "0.19.11" + "@esbuild/linux-arm" "0.19.11" + "@esbuild/linux-arm64" "0.19.11" + "@esbuild/linux-ia32" "0.19.11" + "@esbuild/linux-loong64" "0.19.11" + "@esbuild/linux-mips64el" "0.19.11" + "@esbuild/linux-ppc64" "0.19.11" + "@esbuild/linux-riscv64" "0.19.11" + "@esbuild/linux-s390x" "0.19.11" + "@esbuild/linux-x64" "0.19.11" + "@esbuild/netbsd-x64" "0.19.11" + "@esbuild/openbsd-x64" "0.19.11" + "@esbuild/sunos-x64" "0.19.11" + "@esbuild/win32-arm64" "0.19.11" + "@esbuild/win32-ia32" "0.19.11" + "@esbuild/win32-x64" "0.19.11" find-up@^5.0.0: version "5.0.0" @@ -358,10 +373,10 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" -follow-redirects@^1.15.0: - version "1.15.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" - integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== +follow-redirects@^1.15.4: + version "1.15.4" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf" + integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw== foreground-child@^3.1.0: version "3.1.1" @@ -381,9 +396,9 @@ form-data@^4.0.0: mime-types "^2.1.12" fp-ts@^2.16.1: - version "2.16.1" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.16.1.tgz#6abc401ce42b65364ca8f0b0d995c5840c68a930" - integrity sha512-by7U5W8dkIzcvDofUcO42yl9JbnHTEDBrzu3pt5fKT+Z4Oy85I21K80EYJYdjQGC2qum4Vo55Ag57iiIK4FYuA== + version "2.16.2" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.16.2.tgz#7faa90f6fc2e8cf84c711d2c4e606afe2be9e342" + integrity sha512-CkqAjnIKFqvo3sCyoBTqgJvF+bHrSik584S9nhTjtBESLx26cbtVMR/T9a6ApChOcSDAaM3JydDmWDUn4EEXng== glob@^10.3.7: version "10.3.10" @@ -659,7 +674,6 @@ snakecase-keys@^5.5.0: type-fest "^3.12.0" "string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: - name string-width-cjs version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -678,7 +692,6 @@ string-width@^5.0.1, string-width@^5.1.2: strip-ansi "^7.0.1" "strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - name strip-ansi-cjs version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -692,6 +705,11 @@ strip-ansi@^7.0.1: dependencies: ansi-regex "^6.0.1" +toml@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" + integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== + tslib@^2.0.3, tslib@^2.4.1: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" @@ -722,6 +740,11 @@ uuid@^9.0.1: resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== +uuidv7@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/uuidv7/-/uuidv7-0.6.3.tgz#2abcfa683b4ad4a0cbbbaedffc3ef940c110cf10" + integrity sha512-zV3eW2NlXTsun/aJ7AixxZjH/byQcH/r3J99MI0dDEkU2cJIBJxhEWUHDTpOaLPRNhebPZoeHuykYREkI9HafA== + which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"