From f11d98d8a79eb923c02a2c6f58f0afc3423f0f78 Mon Sep 17 00:00:00 2001 From: Dustin Do Date: Fri, 19 Jul 2024 00:55:27 +0700 Subject: [PATCH] feat(api): add exchange rate api (#146) --- .vscode/settings.json | 1 + apps/api/package.json | 1 + .../migration.sql | 15 + .../migration.sql | 2 + apps/api/prisma/schema.prisma | 13 + apps/api/types/got-fix.d.ts | 4 + apps/api/v1/index.ts | 2 + apps/api/v1/routes/exchange-rates.ts | 70 ++++ .../api/v1/services/exchange-rates.service.ts | 138 ++++++++ packages/validation/src/prisma/index.ts | 330 ++++++++++++++++++ pnpm-lock.yaml | 199 ++++++++++- 11 files changed, 768 insertions(+), 7 deletions(-) create mode 100644 apps/api/prisma/migrations/20240718080526_add_currency_exchange_rate/migration.sql create mode 100644 apps/api/prisma/migrations/20240718080935_set_exchange_rate_date_to_string/migration.sql create mode 100644 apps/api/types/got-fix.d.ts create mode 100644 apps/api/v1/routes/exchange-rates.ts create mode 100644 apps/api/v1/services/exchange-rates.service.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index a29ad3d7..db6c0734 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,6 +14,7 @@ }, "editor.formatOnSave": true, "cSpell.words": [ + "EXCHANGERATES", "hono", "openai" ] diff --git a/apps/api/package.json b/apps/api/package.json index 5866d62f..492c229c 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -24,6 +24,7 @@ "@prisma/client": "^5.16.0", "@vercel/blob": "^0.23.4", "dayjs": "^1.11.11", + "got": "^14.4.1", "hono": "^4.4.8", "next": "^14.2.4", "openai": "^4.52.7", diff --git a/apps/api/prisma/migrations/20240718080526_add_currency_exchange_rate/migration.sql b/apps/api/prisma/migrations/20240718080526_add_currency_exchange_rate/migration.sql new file mode 100644 index 00000000..bd5f2af1 --- /dev/null +++ b/apps/api/prisma/migrations/20240718080526_add_currency_exchange_rate/migration.sql @@ -0,0 +1,15 @@ +-- CreateTable +CREATE TABLE "CurrencyExchangeRate" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "fromCurrency" TEXT NOT NULL, + "toCurrency" TEXT NOT NULL, + "rate" DECIMAL(65,30) NOT NULL, + "date" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "CurrencyExchangeRate_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "CurrencyExchangeRate_fromCurrency_toCurrency_date_key" ON "CurrencyExchangeRate"("fromCurrency", "toCurrency", "date"); diff --git a/apps/api/prisma/migrations/20240718080935_set_exchange_rate_date_to_string/migration.sql b/apps/api/prisma/migrations/20240718080935_set_exchange_rate_date_to_string/migration.sql new file mode 100644 index 00000000..a4741c56 --- /dev/null +++ b/apps/api/prisma/migrations/20240718080935_set_exchange_rate_date_to_string/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "CurrencyExchangeRate" ALTER COLUMN "date" SET DATA TYPE TEXT; diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index d5459b28..ad9ba819 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -199,3 +199,16 @@ model CachedGptResponse { query String response String } + +model CurrencyExchangeRate { + id String @id @default(cuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + fromCurrency String + toCurrency String + rate Decimal + date String // YYYY-MM-DD + + @@unique([fromCurrency, toCurrency, date]) +} diff --git a/apps/api/types/got-fix.d.ts b/apps/api/types/got-fix.d.ts new file mode 100644 index 00000000..78effa5d --- /dev/null +++ b/apps/api/types/got-fix.d.ts @@ -0,0 +1,4 @@ +declare module 'got' { + import * as got from 'got/dist/source' + export = got +} diff --git a/apps/api/v1/index.ts b/apps/api/v1/index.ts index 9f0709ea..bfbd6f28 100644 --- a/apps/api/v1/index.ts +++ b/apps/api/v1/index.ts @@ -3,11 +3,13 @@ import { authMiddleware } from './middlewares/auth' import authApp from './routes/auth' import budgetsApp from './routes/budgets' import categoriesApp from './routes/categories' +import exchangeRatesApp from './routes/exchange-rates' import transactionsApp from './routes/transactions' import usersApp from './routes/users' import walletsApp from './routes/wallets' export const hono = new Hono() + .route('/exchange-rates', exchangeRatesApp) .use('*', authMiddleware) diff --git a/apps/api/v1/routes/exchange-rates.ts b/apps/api/v1/routes/exchange-rates.ts new file mode 100644 index 00000000..1d9b271f --- /dev/null +++ b/apps/api/v1/routes/exchange-rates.ts @@ -0,0 +1,70 @@ +import { zValidator } from '@hono/zod-validator' +import { Hono } from 'hono' +import { z } from 'zod' +import { + getExchangeRate, + getExchangeRates, +} from '../services/exchange-rates.service' + +const router = new Hono() + .use(async (c, next) => { + const apiKey = c.req.header('x-api-key') + + if (!apiKey || apiKey !== process.env.API_SECRET_KEY) { + return c.json({ message: 'Unauthorized' }, 401) + } + + await next() + }) + + .get( + '/', + zValidator( + 'query', + z.object({ + date: z.string().default('latest'), + }), + ), + async (c) => { + const { date } = c.req.valid('query') + + const exchangeRates = await getExchangeRates({ date }) + + return c.json(exchangeRates) + }, + ) + + .get( + '/:fromCurrency/:toCurrency', + zValidator( + 'query', + z.object({ + date: z.string().default('latest'), + }), + ), + zValidator( + 'param', + z.object({ + fromCurrency: z.string(), + toCurrency: z.string(), + }), + ), + async (c) => { + const { fromCurrency, toCurrency } = c.req.valid('param') + const { date } = c.req.valid('query') + + const exchangeRate = await getExchangeRate({ + date, + fromCurrency: fromCurrency, + toCurrency: toCurrency, + }) + + if (!exchangeRate) { + return c.json({ message: 'Exchange rate not found' }, 404) + } + + return c.json(exchangeRate) + }, + ) + +export default router diff --git a/apps/api/v1/services/exchange-rates.service.ts b/apps/api/v1/services/exchange-rates.service.ts new file mode 100644 index 00000000..7e2944d0 --- /dev/null +++ b/apps/api/v1/services/exchange-rates.service.ts @@ -0,0 +1,138 @@ +import got from 'got' +import { getLogger } from '../../lib/log' +import prisma from '../../lib/prisma' + +const API_KEY = process.env.EXCHANGERATES_API_KEY +const BASE_URL = 'http://api.exchangeratesapi.io/v1/' +const BASE_CURRENCY = 'EUR' +const DEFAULT_SYMBOLS = ['USD', 'JPY', 'AUD', 'VND', 'SGD', 'CNY'] +const client = got.extend({ + prefixUrl: BASE_URL, +}) + +export async function getExchangeRates({ + date = 'latest', + base = BASE_CURRENCY, + symbols = DEFAULT_SYMBOLS, +}: { + date?: string | 'latest' + base?: string + symbols?: string[] +}) { + const logger = getLogger(`services.exchange-rates:${getExchangeRates.name}`) + logger.debug( + 'Getting exchange rates. Date: %s, Base: %s, Symbols: %o', + date, + base, + symbols, + ) + + // YYYY-MM-DD + const dateStr = (date === 'latest' ? new Date() : new Date(date)) + .toISOString() + .split('T')[0] + + // Find records in database + const rates = await prisma.currencyExchangeRate.findMany({ + where: { + date: dateStr, + fromCurrency: base, + toCurrency: { + in: symbols, + }, + }, + }) + + // If some rates are missing, call the API + const missingSymbols = symbols.filter( + (symbol) => + !rates.find( + (rate) => rate.toCurrency === symbol && rate.fromCurrency === base, + ), + ) + + if (missingSymbols.length === 0) { + logger.debug('All rates are found in the database') + return rates + } + + const missingSymbolsStr = missingSymbols.join(',') + + logger.debug('Some rates are missing. Calling the API: %s', missingSymbolsStr) + + const missingRates = await client + .get(`${date === 'latest' ? date : dateStr}`, { + searchParams: { + access_key: API_KEY, + base, + symbols: missingSymbolsStr, + }, + }) + .json<{ + success: boolean + timestamp: number + base: string + date: string + rates: Record + }>() + // Save the result to database + logger.debug('Saving the missing rates to the database') + await prisma.currencyExchangeRate.createMany({ + data: Object.entries(missingRates.rates).map(([toCurrency, rate]) => ({ + date: missingRates.date, + fromCurrency: base, + toCurrency, + rate, + })), + }) + // Return all the rates + const allRates = await prisma.currencyExchangeRate.findMany({ + where: { + date: dateStr, + fromCurrency: base, + toCurrency: { + in: symbols, + }, + }, + }) + + logger.debug('All rates are found') + + return allRates +} + +export async function getExchangeRate({ + date = 'latest', + fromCurrency = BASE_CURRENCY, + toCurrency, +}: { + date?: string | 'latest' + fromCurrency?: string + toCurrency: string +}) { + const baseRates = await getExchangeRates({ + date, + base: BASE_CURRENCY, + symbols: [fromCurrency, toCurrency], + }) + const fromRate = baseRates.find((rate) => rate.toCurrency === fromCurrency) + const toRate = baseRates.find((rate) => rate.toCurrency === toCurrency) + + if (!(fromRate && toRate)) { + return null + } + + const rateDecimal = toRate.rate.div(fromRate.rate) + const rate = rateDecimal.toNumber() + + return { + rate, + rateDecimal, + fromCurrency, + toCurrency, + // YYYY-MM-DD + date: date === 'latest' ? new Date().toISOString().split('T')[0] : date, + [fromCurrency]: 1, + [toCurrency]: rate, + } +} diff --git a/packages/validation/src/prisma/index.ts b/packages/validation/src/prisma/index.ts index b51ae790..91b91a81 100644 --- a/packages/validation/src/prisma/index.ts +++ b/packages/validation/src/prisma/index.ts @@ -56,6 +56,8 @@ export const CategoryScalarFieldEnumSchema = z.enum(['id','createdAt','updatedAt export const CachedGptResponseScalarFieldEnumSchema = z.enum(['id','createdAt','updatedAt','query','response']); +export const CurrencyExchangeRateScalarFieldEnumSchema = z.enum(['id','createdAt','updatedAt','fromCurrency','toCurrency','rate','date']); + export const SortOrderSchema = z.enum(['asc','desc']); export const QueryModeSchema = z.enum(['default','insensitive']); @@ -404,6 +406,22 @@ export const CachedGptResponseSchema = z.object({ export type CachedGptResponse = z.infer +///////////////////////////////////////// +// CURRENCY EXCHANGE RATE SCHEMA +///////////////////////////////////////// + +export const CurrencyExchangeRateSchema = z.object({ + id: z.string().cuid(), + createdAt: z.coerce.date(), + updatedAt: z.coerce.date(), + fromCurrency: z.string(), + toCurrency: z.string(), + rate: z.instanceof(Prisma.Decimal, { message: "Field 'rate' must be a Decimal. Location: ['Models', 'CurrencyExchangeRate']"}), + date: z.string(), +}) + +export type CurrencyExchangeRate = z.infer + ///////////////////////////////////////// // SELECT & INCLUDE ///////////////////////////////////////// @@ -730,6 +748,19 @@ export const CachedGptResponseSelectSchema: z.ZodType = z.object({ + id: z.boolean().optional(), + createdAt: z.boolean().optional(), + updatedAt: z.boolean().optional(), + fromCurrency: z.boolean().optional(), + toCurrency: z.boolean().optional(), + rate: z.boolean().optional(), + date: z.boolean().optional(), +}).strict() + ///////////////////////////////////////// // INPUT TYPES @@ -1572,6 +1603,83 @@ export const CachedGptResponseScalarWhereWithAggregatesInputSchema: z.ZodType StringWithAggregatesFilterSchema),z.string() ]).optional(), }).strict(); +export const CurrencyExchangeRateWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => CurrencyExchangeRateWhereInputSchema),z.lazy(() => CurrencyExchangeRateWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => CurrencyExchangeRateWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => CurrencyExchangeRateWhereInputSchema),z.lazy(() => CurrencyExchangeRateWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + fromCurrency: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + toCurrency: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + rate: z.union([ z.lazy(() => DecimalFilterSchema),z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }) ]).optional(), + date: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), +}).strict(); + +export const CurrencyExchangeRateOrderByWithRelationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + fromCurrency: z.lazy(() => SortOrderSchema).optional(), + toCurrency: z.lazy(() => SortOrderSchema).optional(), + rate: z.lazy(() => SortOrderSchema).optional(), + date: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const CurrencyExchangeRateWhereUniqueInputSchema: z.ZodType = z.union([ + z.object({ + id: z.string().cuid(), + fromCurrency_toCurrency_date: z.lazy(() => CurrencyExchangeRateFromCurrencyToCurrencyDateCompoundUniqueInputSchema) + }), + z.object({ + id: z.string().cuid(), + }), + z.object({ + fromCurrency_toCurrency_date: z.lazy(() => CurrencyExchangeRateFromCurrencyToCurrencyDateCompoundUniqueInputSchema), + }), +]) +.and(z.object({ + id: z.string().cuid().optional(), + fromCurrency_toCurrency_date: z.lazy(() => CurrencyExchangeRateFromCurrencyToCurrencyDateCompoundUniqueInputSchema).optional(), + AND: z.union([ z.lazy(() => CurrencyExchangeRateWhereInputSchema),z.lazy(() => CurrencyExchangeRateWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => CurrencyExchangeRateWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => CurrencyExchangeRateWhereInputSchema),z.lazy(() => CurrencyExchangeRateWhereInputSchema).array() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + fromCurrency: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + toCurrency: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + rate: z.union([ z.lazy(() => DecimalFilterSchema),z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }) ]).optional(), + date: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), +}).strict()); + +export const CurrencyExchangeRateOrderByWithAggregationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + fromCurrency: z.lazy(() => SortOrderSchema).optional(), + toCurrency: z.lazy(() => SortOrderSchema).optional(), + rate: z.lazy(() => SortOrderSchema).optional(), + date: z.lazy(() => SortOrderSchema).optional(), + _count: z.lazy(() => CurrencyExchangeRateCountOrderByAggregateInputSchema).optional(), + _avg: z.lazy(() => CurrencyExchangeRateAvgOrderByAggregateInputSchema).optional(), + _max: z.lazy(() => CurrencyExchangeRateMaxOrderByAggregateInputSchema).optional(), + _min: z.lazy(() => CurrencyExchangeRateMinOrderByAggregateInputSchema).optional(), + _sum: z.lazy(() => CurrencyExchangeRateSumOrderByAggregateInputSchema).optional() +}).strict(); + +export const CurrencyExchangeRateScalarWhereWithAggregatesInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => CurrencyExchangeRateScalarWhereWithAggregatesInputSchema),z.lazy(() => CurrencyExchangeRateScalarWhereWithAggregatesInputSchema).array() ]).optional(), + OR: z.lazy(() => CurrencyExchangeRateScalarWhereWithAggregatesInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => CurrencyExchangeRateScalarWhereWithAggregatesInputSchema),z.lazy(() => CurrencyExchangeRateScalarWhereWithAggregatesInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), + fromCurrency: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + toCurrency: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + rate: z.union([ z.lazy(() => DecimalWithAggregatesFilterSchema),z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }) ]).optional(), + date: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), +}).strict(); + export const UserCreateInputSchema: z.ZodType = z.object({ id: z.string().cuid().optional(), createdAt: z.coerce.date().optional(), @@ -2363,6 +2471,76 @@ export const CachedGptResponseUncheckedUpdateManyInputSchema: z.ZodType StringFieldUpdateOperationsInputSchema) ]).optional(), }).strict(); +export const CurrencyExchangeRateCreateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + fromCurrency: z.string(), + toCurrency: z.string(), + rate: z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }), + date: z.string() +}).strict(); + +export const CurrencyExchangeRateUncheckedCreateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + fromCurrency: z.string(), + toCurrency: z.string(), + rate: z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }), + date: z.string() +}).strict(); + +export const CurrencyExchangeRateUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + fromCurrency: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + toCurrency: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rate: z.union([ z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }),z.lazy(() => DecimalFieldUpdateOperationsInputSchema) ]).optional(), + date: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const CurrencyExchangeRateUncheckedUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + fromCurrency: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + toCurrency: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rate: z.union([ z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }),z.lazy(() => DecimalFieldUpdateOperationsInputSchema) ]).optional(), + date: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const CurrencyExchangeRateCreateManyInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + fromCurrency: z.string(), + toCurrency: z.string(), + rate: z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }), + date: z.string() +}).strict(); + +export const CurrencyExchangeRateUpdateManyMutationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + fromCurrency: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + toCurrency: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rate: z.union([ z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }),z.lazy(() => DecimalFieldUpdateOperationsInputSchema) ]).optional(), + date: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const CurrencyExchangeRateUncheckedUpdateManyInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + fromCurrency: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + toCurrency: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rate: z.union([ z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }),z.lazy(() => DecimalFieldUpdateOperationsInputSchema) ]).optional(), + date: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + export const StringFilterSchema: z.ZodType = z.object({ equals: z.string().optional(), in: z.string().array().optional(), @@ -3053,6 +3231,50 @@ export const CachedGptResponseMinOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional() }).strict(); +export const CurrencyExchangeRateFromCurrencyToCurrencyDateCompoundUniqueInputSchema: z.ZodType = z.object({ + fromCurrency: z.string(), + toCurrency: z.string(), + date: z.string() +}).strict(); + +export const CurrencyExchangeRateCountOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + fromCurrency: z.lazy(() => SortOrderSchema).optional(), + toCurrency: z.lazy(() => SortOrderSchema).optional(), + rate: z.lazy(() => SortOrderSchema).optional(), + date: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const CurrencyExchangeRateAvgOrderByAggregateInputSchema: z.ZodType = z.object({ + rate: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const CurrencyExchangeRateMaxOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + fromCurrency: z.lazy(() => SortOrderSchema).optional(), + toCurrency: z.lazy(() => SortOrderSchema).optional(), + rate: z.lazy(() => SortOrderSchema).optional(), + date: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const CurrencyExchangeRateMinOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + fromCurrency: z.lazy(() => SortOrderSchema).optional(), + toCurrency: z.lazy(() => SortOrderSchema).optional(), + rate: z.lazy(() => SortOrderSchema).optional(), + date: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const CurrencyExchangeRateSumOrderByAggregateInputSchema: z.ZodType = z.object({ + rate: z.lazy(() => SortOrderSchema).optional() +}).strict(); + export const UserWalletAccountCreateNestedManyWithoutUserInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => UserWalletAccountCreateWithoutUserInputSchema),z.lazy(() => UserWalletAccountCreateWithoutUserInputSchema).array(),z.lazy(() => UserWalletAccountUncheckedCreateWithoutUserInputSchema),z.lazy(() => UserWalletAccountUncheckedCreateWithoutUserInputSchema).array() ]).optional(), connectOrCreate: z.union([ z.lazy(() => UserWalletAccountCreateOrConnectWithoutUserInputSchema),z.lazy(() => UserWalletAccountCreateOrConnectWithoutUserInputSchema).array() ]).optional(), @@ -7076,6 +7298,68 @@ export const CachedGptResponseFindUniqueOrThrowArgsSchema: z.ZodType = z.object({ + select: CurrencyExchangeRateSelectSchema.optional(), + where: CurrencyExchangeRateWhereInputSchema.optional(), + orderBy: z.union([ CurrencyExchangeRateOrderByWithRelationInputSchema.array(),CurrencyExchangeRateOrderByWithRelationInputSchema ]).optional(), + cursor: CurrencyExchangeRateWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ CurrencyExchangeRateScalarFieldEnumSchema,CurrencyExchangeRateScalarFieldEnumSchema.array() ]).optional(), + relationLoadStrategy: RelationLoadStrategySchema.optional(), +}).strict() ; + +export const CurrencyExchangeRateFindFirstOrThrowArgsSchema: z.ZodType = z.object({ + select: CurrencyExchangeRateSelectSchema.optional(), + where: CurrencyExchangeRateWhereInputSchema.optional(), + orderBy: z.union([ CurrencyExchangeRateOrderByWithRelationInputSchema.array(),CurrencyExchangeRateOrderByWithRelationInputSchema ]).optional(), + cursor: CurrencyExchangeRateWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ CurrencyExchangeRateScalarFieldEnumSchema,CurrencyExchangeRateScalarFieldEnumSchema.array() ]).optional(), + relationLoadStrategy: RelationLoadStrategySchema.optional(), +}).strict() ; + +export const CurrencyExchangeRateFindManyArgsSchema: z.ZodType = z.object({ + select: CurrencyExchangeRateSelectSchema.optional(), + where: CurrencyExchangeRateWhereInputSchema.optional(), + orderBy: z.union([ CurrencyExchangeRateOrderByWithRelationInputSchema.array(),CurrencyExchangeRateOrderByWithRelationInputSchema ]).optional(), + cursor: CurrencyExchangeRateWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ CurrencyExchangeRateScalarFieldEnumSchema,CurrencyExchangeRateScalarFieldEnumSchema.array() ]).optional(), + relationLoadStrategy: RelationLoadStrategySchema.optional(), +}).strict() ; + +export const CurrencyExchangeRateAggregateArgsSchema: z.ZodType = z.object({ + where: CurrencyExchangeRateWhereInputSchema.optional(), + orderBy: z.union([ CurrencyExchangeRateOrderByWithRelationInputSchema.array(),CurrencyExchangeRateOrderByWithRelationInputSchema ]).optional(), + cursor: CurrencyExchangeRateWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() ; + +export const CurrencyExchangeRateGroupByArgsSchema: z.ZodType = z.object({ + where: CurrencyExchangeRateWhereInputSchema.optional(), + orderBy: z.union([ CurrencyExchangeRateOrderByWithAggregationInputSchema.array(),CurrencyExchangeRateOrderByWithAggregationInputSchema ]).optional(), + by: CurrencyExchangeRateScalarFieldEnumSchema.array(), + having: CurrencyExchangeRateScalarWhereWithAggregatesInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() ; + +export const CurrencyExchangeRateFindUniqueArgsSchema: z.ZodType = z.object({ + select: CurrencyExchangeRateSelectSchema.optional(), + where: CurrencyExchangeRateWhereUniqueInputSchema, + relationLoadStrategy: RelationLoadStrategySchema.optional(), +}).strict() ; + +export const CurrencyExchangeRateFindUniqueOrThrowArgsSchema: z.ZodType = z.object({ + select: CurrencyExchangeRateSelectSchema.optional(), + where: CurrencyExchangeRateWhereUniqueInputSchema, + relationLoadStrategy: RelationLoadStrategySchema.optional(), +}).strict() ; + export const UserCreateArgsSchema: z.ZodType = z.object({ select: UserSelectSchema.optional(), include: UserIncludeSchema.optional(), @@ -7570,4 +7854,50 @@ export const CachedGptResponseUpdateManyArgsSchema: z.ZodType = z.object({ where: CachedGptResponseWhereInputSchema.optional(), +}).strict() ; + +export const CurrencyExchangeRateCreateArgsSchema: z.ZodType = z.object({ + select: CurrencyExchangeRateSelectSchema.optional(), + data: z.union([ CurrencyExchangeRateCreateInputSchema,CurrencyExchangeRateUncheckedCreateInputSchema ]), + relationLoadStrategy: RelationLoadStrategySchema.optional(), +}).strict() ; + +export const CurrencyExchangeRateUpsertArgsSchema: z.ZodType = z.object({ + select: CurrencyExchangeRateSelectSchema.optional(), + where: CurrencyExchangeRateWhereUniqueInputSchema, + create: z.union([ CurrencyExchangeRateCreateInputSchema,CurrencyExchangeRateUncheckedCreateInputSchema ]), + update: z.union([ CurrencyExchangeRateUpdateInputSchema,CurrencyExchangeRateUncheckedUpdateInputSchema ]), + relationLoadStrategy: RelationLoadStrategySchema.optional(), +}).strict() ; + +export const CurrencyExchangeRateCreateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ CurrencyExchangeRateCreateManyInputSchema,CurrencyExchangeRateCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() ; + +export const CurrencyExchangeRateCreateManyAndReturnArgsSchema: z.ZodType = z.object({ + data: z.union([ CurrencyExchangeRateCreateManyInputSchema,CurrencyExchangeRateCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() ; + +export const CurrencyExchangeRateDeleteArgsSchema: z.ZodType = z.object({ + select: CurrencyExchangeRateSelectSchema.optional(), + where: CurrencyExchangeRateWhereUniqueInputSchema, + relationLoadStrategy: RelationLoadStrategySchema.optional(), +}).strict() ; + +export const CurrencyExchangeRateUpdateArgsSchema: z.ZodType = z.object({ + select: CurrencyExchangeRateSelectSchema.optional(), + data: z.union([ CurrencyExchangeRateUpdateInputSchema,CurrencyExchangeRateUncheckedUpdateInputSchema ]), + where: CurrencyExchangeRateWhereUniqueInputSchema, + relationLoadStrategy: RelationLoadStrategySchema.optional(), +}).strict() ; + +export const CurrencyExchangeRateUpdateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ CurrencyExchangeRateUpdateManyMutationInputSchema,CurrencyExchangeRateUncheckedUpdateManyInputSchema ]), + where: CurrencyExchangeRateWhereInputSchema.optional(), +}).strict() ; + +export const CurrencyExchangeRateDeleteManyArgsSchema: z.ZodType = z.object({ + where: CurrencyExchangeRateWhereInputSchema.optional(), }).strict() ; \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 861dde9d..adaabda3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,12 +50,15 @@ importers: dayjs: specifier: ^1.11.11 version: 1.11.11 + got: + specifier: ^14.4.1 + version: 14.4.1 hono: specifier: ^4.4.8 version: 4.4.8 next: specifier: ^14.2.4 - version: 14.2.4(@babel/core@7.24.7)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 14.2.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) openai: specifier: ^4.52.7 version: 4.52.7 @@ -2264,6 +2267,9 @@ packages: resolution: {integrity: sha512-lzD84av1ZQhYUS+jsGqJiCMaJO2dn9u+RTT9n9q6D3SaKVwWqv+7AoRKqBu19bkwyE+iFRl1ymr40QS90jVFYg==} engines: {node: '>=14.15'} + '@sec-ant/readable-stream@0.4.1': + resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} + '@segment/loosely-validate-event@2.0.0': resolution: {integrity: sha512-ZMCSfztDBqwotkl848ODgVcAmN4OItEWDCkshcKz0/W6gGSQayuuCtWV/MlodFivAZD793d6UgANd6wCXUfrIw==} @@ -2279,6 +2285,10 @@ packages: '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@sindresorhus/is@6.3.1': + resolution: {integrity: sha512-FX4MfcifwJyFOI2lPoX7PQxCqx8BG1HCho7WdiXwpEQx1Ycij0JxkfYtGK7yqNScrZGSlt6RE6sw8QYoH7eKnQ==} + engines: {node: '>=16'} + '@sinonjs/commons@3.0.1': resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} @@ -2291,6 +2301,10 @@ packages: '@swc/helpers@0.5.5': resolution: {integrity: sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==} + '@szmarczak/http-timer@5.0.1': + resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} + engines: {node: '>=14.16'} + '@tanstack/query-async-storage-persister@5.51.1': resolution: {integrity: sha512-DvJ1BovRJfpV1/OZn1IYeeS0c8H2vgK0vxmjhgzv2KrKeAd/rFx4hf8XAIty4ypgbgIMLnE5U3+nuI72ztTIvA==} @@ -2339,6 +2353,9 @@ packages: '@types/hammerjs@2.0.45': resolution: {integrity: sha512-qkcUlZmX6c4J8q45taBKTL3p+LbITgyx7qhlPYOdOHZB7B31K0mXbP5YA7i7SgDeEGuI9MnumiKPEMrxg8j3KQ==} + '@types/http-cache-semantics@4.0.4': + resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} + '@types/istanbul-lib-coverage@2.0.6': resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} @@ -2762,6 +2779,14 @@ packages: resolution: {integrity: sha512-qXCd4rh6I07cnDqh8V48/94Tc/WSfj+o3Gn6NZ0aZovS255bUx8O13uKxRFd2eWG0xgsco7+YItQNPaa5E85hg==} engines: {node: ^16.14.0 || >=18.0.0} + cacheable-lookup@7.0.0: + resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} + engines: {node: '>=14.16'} + + cacheable-request@12.0.1: + resolution: {integrity: sha512-Yo9wGIQUaAfIbk+qY0X4cDQgCosecfBe3V9NSyeY4qPC2SAkbCS4Xj79VP8WOzitpJUZKc/wsRCYF5ariDIwkg==} + engines: {node: '>=18'} + call-bind@1.0.7: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} @@ -3174,6 +3199,10 @@ packages: resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} engines: {node: '>=0.10'} + decompress-response@6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} + dedent@1.5.3: resolution: {integrity: sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==} peerDependencies: @@ -3197,6 +3226,10 @@ packages: defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} + defer-to-connect@2.0.1: + resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} + engines: {node: '>=10'} + define-data-property@1.1.4: resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} engines: {node: '>= 0.4'} @@ -3674,6 +3707,10 @@ packages: form-data-encoder@1.7.2: resolution: {integrity: sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==} + form-data-encoder@4.0.2: + resolution: {integrity: sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==} + engines: {node: '>= 18'} + form-data@3.0.1: resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==} engines: {node: '>= 6'} @@ -3760,6 +3797,14 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + + get-stream@9.0.1: + resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==} + engines: {node: '>=18'} + get-symbol-description@1.0.2: resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} engines: {node: '>= 0.4'} @@ -3811,6 +3856,10 @@ packages: gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + got@14.4.1: + resolution: {integrity: sha512-IvDJbJBUeexX74xNQuMIVgCRRuNOm5wuK+OC3Dc2pnSoh1AOmgc7JVj7WC+cJ4u0aPcO9KZ2frTXcqK4W/5qTQ==} + engines: {node: '>=20'} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -3891,6 +3940,9 @@ packages: html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + http-cache-semantics@4.1.1: + resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + http-errors@2.0.0: resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} engines: {node: '>= 0.8'} @@ -3899,6 +3951,10 @@ packages: resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} engines: {node: '>= 6'} + http2-wrapper@2.2.1: + resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} + engines: {node: '>=10.19.0'} + https-proxy-agent@5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} @@ -4137,6 +4193,10 @@ packages: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} + is-stream@4.0.1: + resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} + engines: {node: '>=18'} + is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} @@ -4425,6 +4485,9 @@ packages: engines: {node: '>=4'} hasBin: true + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + json-parse-better-errors@1.0.2: resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} @@ -4449,6 +4512,9 @@ packages: jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} @@ -4637,6 +4703,10 @@ packages: lower-case@2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} + lowercase-keys@3.0.0: + resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + lru-cache@10.2.2: resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} engines: {node: 14 || >=16.14} @@ -4802,6 +4872,14 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} + mimic-response@3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + + mimic-response@4.0.0: + resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -4973,6 +5051,10 @@ packages: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} + normalize-url@8.0.1: + resolution: {integrity: sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==} + engines: {node: '>=14.16'} + npm-package-arg@7.0.0: resolution: {integrity: sha512-xXxr8y5U0kl8dVkz2oK7yZjPBvqM2fwaO5l3Yg13p03v8+E3qQcD0JNhHzjL1vyGgxcKkD0cco+NLR72iuPk3g==} @@ -5079,6 +5161,10 @@ packages: resolution: {integrity: sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==} deprecated: This package is no longer supported. + p-cancelable@4.0.1: + resolution: {integrity: sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==} + engines: {node: '>=14.16'} + p-finally@1.0.0: resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} engines: {node: '>=4'} @@ -5381,6 +5467,10 @@ packages: quick-format-unescaped@4.0.4: resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} + quick-lru@5.1.1: + resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} + engines: {node: '>=10'} + ramda@0.27.2: resolution: {integrity: sha512-SbiLPU40JuJniHexQSAgad32hfwd+DRUdwF2PlVuI5RZD0/vahUco7R8vD86J/tcEKKF9vZrUVwgtmGCqlCKyA==} @@ -5609,6 +5699,9 @@ packages: requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + resolve-alpn@1.2.1: + resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} + resolve-cwd@3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} engines: {node: '>=8'} @@ -5636,6 +5729,10 @@ packages: resolve@1.7.1: resolution: {integrity: sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==} + responselike@3.0.0: + resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} + engines: {node: '>=14.16'} + restore-cursor@2.0.0: resolution: {integrity: sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==} engines: {node: '>=4'} @@ -6240,6 +6337,10 @@ packages: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} + type-fest@4.22.0: + resolution: {integrity: sha512-hxMO1k4ip1uTVGgPbs1hVpYyhz2P91A6tQyH2H9POx3U6T3MdhIcfY8L2hRu/LRmzPFdfduOS0RIDjFlP2urPw==} + engines: {node: '>=16'} + typed-array-buffer@1.0.2: resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} engines: {node: '>= 0.4'} @@ -9347,6 +9448,8 @@ snapshots: transitivePeerDependencies: - supports-color + '@sec-ant/readable-stream@0.4.1': {} + '@segment/loosely-validate-event@2.0.0': dependencies: component-type: 1.2.2 @@ -9362,6 +9465,8 @@ snapshots: '@sinclair/typebox@0.27.8': {} + '@sindresorhus/is@6.3.1': {} + '@sinonjs/commons@3.0.1': dependencies: type-detect: 4.0.8 @@ -9377,6 +9482,10 @@ snapshots: '@swc/counter': 0.1.3 tslib: 2.6.3 + '@szmarczak/http-timer@5.0.1': + dependencies: + defer-to-connect: 2.0.1 + '@tanstack/query-async-storage-persister@5.51.1': dependencies: '@tanstack/query-persist-client-core': 5.51.1 @@ -9431,6 +9540,8 @@ snapshots: '@types/hammerjs@2.0.45': {} + '@types/http-cache-semantics@4.0.4': {} + '@types/istanbul-lib-coverage@2.0.6': {} '@types/istanbul-lib-report@3.0.3': @@ -9921,6 +10032,18 @@ snapshots: tar: 6.2.1 unique-filename: 3.0.0 + cacheable-lookup@7.0.0: {} + + cacheable-request@12.0.1: + dependencies: + '@types/http-cache-semantics': 4.0.4 + get-stream: 9.0.1 + http-cache-semantics: 4.1.1 + keyv: 4.5.4 + mimic-response: 4.0.0 + normalize-url: 8.0.1 + responselike: 3.0.0 + call-bind@1.0.7: dependencies: es-define-property: 1.0.0 @@ -10328,6 +10451,10 @@ snapshots: decode-uri-component@0.2.2: {} + decompress-response@6.0.0: + dependencies: + mimic-response: 3.1.0 + dedent@1.5.3(babel-plugin-macros@3.1.0): optionalDependencies: babel-plugin-macros: 3.1.0 @@ -10345,6 +10472,8 @@ snapshots: dependencies: clone: 1.0.4 + defer-to-connect@2.0.1: {} + define-data-property@1.1.4: dependencies: es-define-property: 1.0.0 @@ -10935,6 +11064,8 @@ snapshots: form-data-encoder@1.7.2: {} + form-data-encoder@4.0.2: {} + form-data@3.0.1: dependencies: asynckit: 0.4.0 @@ -11022,6 +11153,13 @@ snapshots: get-stream@6.0.1: {} + get-stream@8.0.1: {} + + get-stream@9.0.1: + dependencies: + '@sec-ant/readable-stream': 0.4.1 + is-stream: 4.0.1 + get-symbol-description@1.0.2: dependencies: call-bind: 1.0.7 @@ -11095,6 +11233,21 @@ snapshots: dependencies: get-intrinsic: 1.2.4 + got@14.4.1: + dependencies: + '@sindresorhus/is': 6.3.1 + '@szmarczak/http-timer': 5.0.1 + cacheable-lookup: 7.0.0 + cacheable-request: 12.0.1 + decompress-response: 6.0.0 + form-data-encoder: 4.0.2 + get-stream: 8.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 3.0.0 + p-cancelable: 4.0.1 + responselike: 3.0.0 + type-fest: 4.22.0 + graceful-fs@4.2.11: {} graphql-tag@2.12.6(graphql@15.8.0): @@ -11160,6 +11313,8 @@ snapshots: html-escaper@2.0.2: {} + http-cache-semantics@4.1.1: {} + http-errors@2.0.0: dependencies: depd: 2.0.0 @@ -11176,6 +11331,11 @@ snapshots: transitivePeerDependencies: - supports-color + http2-wrapper@2.2.1: + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 @@ -11387,6 +11547,8 @@ snapshots: is-stream@2.0.1: {} + is-stream@4.0.1: {} + is-string@1.0.7: dependencies: has-tostringtag: 1.0.2 @@ -11930,6 +12092,8 @@ snapshots: jsesc@2.5.2: {} + json-buffer@3.0.1: {} + json-parse-better-errors@1.0.2: {} json-parse-even-better-errors@2.3.1: {} @@ -11959,6 +12123,10 @@ snapshots: optionalDependencies: graceful-fs: 4.2.11 + keyv@4.5.4: + dependencies: + json-buffer: 3.0.1 + kind-of@6.0.3: {} kleur@3.0.3: {} @@ -12106,6 +12274,8 @@ snapshots: dependencies: tslib: 2.6.3 + lowercase-keys@3.0.0: {} + lru-cache@10.2.2: {} lru-cache@5.1.1: @@ -12364,6 +12534,10 @@ snapshots: mimic-fn@2.1.0: {} + mimic-response@3.1.0: {} + + mimic-response@4.0.0: {} + min-indent@1.0.1: {} minimatch@3.1.2: @@ -12458,7 +12632,7 @@ snapshots: nested-error-stacks@2.0.1: {} - next@14.2.4(@babel/core@7.24.7)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + next@14.2.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@next/env': 14.2.4 '@swc/helpers': 0.5.5 @@ -12468,7 +12642,7 @@ snapshots: postcss: 8.4.31 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - styled-jsx: 5.1.1(@babel/core@7.24.7)(babel-plugin-macros@3.1.0)(react@18.3.1) + styled-jsx: 5.1.1(react@18.3.1) optionalDependencies: '@next/swc-darwin-arm64': 14.2.4 '@next/swc-darwin-x64': 14.2.4 @@ -12514,6 +12688,8 @@ snapshots: normalize-path@3.0.0: {} + normalize-url@8.0.1: {} + npm-package-arg@7.0.0: dependencies: hosted-git-info: 3.0.8 @@ -12636,6 +12812,8 @@ snapshots: os-homedir: 1.0.2 os-tmpdir: 1.0.2 + p-cancelable@4.0.1: {} + p-finally@1.0.0: {} p-limit@2.3.0: @@ -12925,6 +13103,8 @@ snapshots: quick-format-unescaped@4.0.4: {} + quick-lru@5.1.1: {} + ramda@0.27.2: {} range-parser@1.2.1: {} @@ -13234,6 +13414,8 @@ snapshots: requires-port@1.0.0: {} + resolve-alpn@1.2.1: {} + resolve-cwd@3.0.0: dependencies: resolve-from: 5.0.0 @@ -13256,6 +13438,10 @@ snapshots: dependencies: path-parse: 1.0.7 + responselike@3.0.0: + dependencies: + lowercase-keys: 3.0.0 + restore-cursor@2.0.0: dependencies: onetime: 2.0.1 @@ -13636,13 +13822,10 @@ snapshots: structured-headers@0.4.1: {} - styled-jsx@5.1.1(@babel/core@7.24.7)(babel-plugin-macros@3.1.0)(react@18.3.1): + styled-jsx@5.1.1(react@18.3.1): dependencies: client-only: 0.0.1 react: 18.3.1 - optionalDependencies: - '@babel/core': 7.24.7 - babel-plugin-macros: 3.1.0 styleq@0.1.3: {} @@ -13871,6 +14054,8 @@ snapshots: type-fest@2.19.0: {} + type-fest@4.22.0: {} + typed-array-buffer@1.0.2: dependencies: call-bind: 1.0.7