diff --git a/packages/store-client/package.json b/packages/store-client/package.json new file mode 100644 index 0000000..3147e8a --- /dev/null +++ b/packages/store-client/package.json @@ -0,0 +1,19 @@ +{ + "name": "store-client", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "generate": "openapi-ts -i ../../store/openapi.json -o src/client -c @hey-api/client-fetch" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "@hey-api/client-fetch": "^0.5.6" + }, + "devDependencies": { + "@hey-api/openapi-ts": "^0.60.0" + } +} diff --git a/packages/store-client/src/client/index.ts b/packages/store-client/src/client/index.ts new file mode 100644 index 0000000..81abc82 --- /dev/null +++ b/packages/store-client/src/client/index.ts @@ -0,0 +1,3 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from './sdk.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/packages/store-client/src/client/sdk.gen.ts b/packages/store-client/src/client/sdk.gen.ts new file mode 100644 index 0000000..97e748c --- /dev/null +++ b/packages/store-client/src/client/sdk.gen.ts @@ -0,0 +1,55 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { createClient, createConfig, type OptionsLegacyParser } from '@hey-api/client-fetch'; +import type { GetV1NodesByUserJsonData, GetV1NodesByUserJsonError, GetV1NodesByUserJsonResponse, GetV1NodesByUserBySystemJsonData, GetV1NodesByUserBySystemJsonError, GetV1NodesByUserBySystemJsonResponse, GetV1NodesByUserBySystemByNodeIdby-.+jsonData, GetV1NodesByUserBySystemByNodeIdby-.+jsonError, GetV1NodesByUserBySystemByNodeIdby-.+jsonResponse, GetV1NodesByUserBySystemByNodeIdby-.+WasmData, GetV1NodesByUserBySystemByNodeIdby-.+WasmError, GetV1NodesByUserBySystemByNodeIdby-.+WasmResponse, PostV1NodesError, PostV1NodesResponse, GetV1UsersUsersJsonError, GetV1UsersUsersJsonResponse, GetV1UsersByUserIdJsonData, GetV1UsersByUserIdJsonError, GetV1UsersByUserIdJsonResponse } from './types.gen'; + +export const client = createClient(createConfig()); + +export const getV1NodesByUserJson = (options: OptionsLegacyParser) => { + return (options?.client ?? client).get({ + ...options, + url: '/v1/nodes/{user}.json' + }); +}; + +export const getV1NodesByUserBySystemJson = (options: OptionsLegacyParser) => { + return (options?.client ?? client).get({ + ...options, + url: '/v1/nodes/{user}/{system}.json' + }); +}; + +export const getV1NodesByUserBySystemByNodeIdby-.+Json = (options: OptionsLegacyParser) => { + return (options?.client ?? client).get({ + ...options, + url: '/v1/nodes/{user}/{system}/{nodeId}{.+\\.json}' + }); +}; + +export const getV1NodesByUserBySystemByNodeIdby-.+Wasm = (options: OptionsLegacyParser) => { + return (options?.client ?? client).get({ + ...options, + url: '/v1/nodes/{user}/{system}/{nodeId}{.+\\.wasm}' + }); +}; + +export const postV1Nodes = (options?: OptionsLegacyParser) => { + return (options?.client ?? client).post({ + ...options, + url: '/v1/nodes' + }); +}; + +export const getV1UsersUsersJson = (options?: OptionsLegacyParser) => { + return (options?.client ?? client).get({ + ...options, + url: '/v1/users/users.json' + }); +}; + +export const getV1UsersByUserIdJson = (options?: OptionsLegacyParser) => { + return (options?.client ?? client).get({ + ...options, + url: '/v1/users/{userId}.json' + }); +}; \ No newline at end of file diff --git a/packages/store-client/src/client/types.gen.ts b/packages/store-client/src/client/types.gen.ts new file mode 100644 index 0000000..0cc89c9 --- /dev/null +++ b/packages/store-client/src/client/types.gen.ts @@ -0,0 +1,173 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type NodeDefinition = { + id: string; + inputs?: { + [key: string]: NodeInput; + }; + outputs?: Array<(string)>; + meta?: { + description?: string; + title?: string; + }; +}; + +export type NodeInput = { + internal?: boolean; + external?: boolean; + setting?: string; + label?: string; + description?: string; + accepts?: Array<(string)>; + hidden?: boolean; + type: 'seed'; + value?: number; +} | { + internal?: boolean; + external?: boolean; + setting?: string; + label?: string; + description?: string; + accepts?: Array<(string)>; + hidden?: boolean; + type: 'boolean'; + value?: boolean; +} | { + internal?: boolean; + external?: boolean; + setting?: string; + label?: string; + description?: string; + accepts?: Array<(string)>; + hidden?: boolean; + type: 'float'; + element?: 'slider'; + value?: number; + min?: number; + max?: number; + step?: number; +} | { + internal?: boolean; + external?: boolean; + setting?: string; + label?: string; + description?: string; + accepts?: Array<(string)>; + hidden?: boolean; + type: 'integer'; + element?: 'slider'; + value?: number; + min?: number; + max?: number; +} | { + internal?: boolean; + external?: boolean; + setting?: string; + label?: string; + description?: string; + accepts?: Array<(string)>; + hidden?: boolean; + type: 'select'; + options?: Array<(string)>; + value?: number; +} | { + internal?: boolean; + external?: boolean; + setting?: string; + label?: string; + description?: string; + accepts?: Array<(string)>; + hidden?: boolean; + type: 'vec3'; + value?: Array<(number)>; +} | { + internal?: boolean; + external?: boolean; + setting?: string; + label?: string; + description?: string; + accepts?: Array<(string)>; + hidden?: boolean; + type: 'geometry'; +} | { + internal?: boolean; + external?: boolean; + setting?: string; + label?: string; + description?: string; + accepts?: Array<(string)>; + hidden?: boolean; + type: 'path'; +}; + +export type type = 'seed'; + +export type element = 'slider'; + +export type User = { + id: string; + name: string; +}; + +export type GetV1NodesByUserJsonData = { + path: { + user: string; + }; +}; + +export type GetV1NodesByUserJsonResponse = (Array); + +export type GetV1NodesByUserJsonError = unknown; + +export type GetV1NodesByUserBySystemJsonData = { + path: { + system?: string; + user: string; + }; +}; + +export type GetV1NodesByUserBySystemJsonResponse = (Array); + +export type GetV1NodesByUserBySystemJsonError = unknown; + +export type GetV1NodesByUserBySystemByNodeIdby-.+jsonData = { + path: { + nodeId: string; + system: string; + user: string; + }; +}; + +export type GetV1NodesByUserBySystemByNodeIdby-.+jsonResponse = (NodeDefinition); + +export type GetV1NodesByUserBySystemByNodeIdby-.+jsonError = unknown; + +export type GetV1NodesByUserBySystemByNodeIdby-.+WasmData = { + path: { + nodeId: string; + system: string; + user: string; + }; +}; + +export type GetV1NodesByUserBySystemByNodeIdby-.+WasmResponse = (unknown); + +export type GetV1NodesByUserBySystemByNodeIdby-.+WasmError = unknown; + +export type PostV1NodesResponse = (NodeDefinition); + +export type PostV1NodesError = unknown; + +export type GetV1UsersUsersJsonResponse = (Array); + +export type GetV1UsersUsersJsonError = unknown; + +export type GetV1UsersByUserIdJsonData = { + path?: { + userId?: string; + }; +}; + +export type GetV1UsersByUserIdJsonResponse = (User); + +export type GetV1UsersByUserIdJsonError = unknown; \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8849e5..936c7e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -153,6 +153,16 @@ importers: specifier: ^8.0.0 version: 8.0.0 + packages/store-client: + dependencies: + '@hey-api/client-fetch': + specifier: ^0.5.6 + version: 0.5.6 + devDependencies: + '@hey-api/openapi-ts': + specifier: ^0.60.0 + version: 0.60.0(typescript@5.6.3) + packages/types: dependencies: zod: @@ -266,6 +276,10 @@ packages: '@antfu/utils@0.7.10': resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} + '@apidevtools/json-schema-ref-parser@11.7.3': + resolution: {integrity: sha512-WApSdLdXEBb/1FUPca2lteASewEfpjEYJ8oXZP+0gExK5qSfsEKBKcA+WjY6Q4wvXwyv0+W6Kvc372pSceib9w==} + engines: {node: '>= 16'} + '@babel/code-frame@7.26.2': resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} @@ -1082,6 +1096,16 @@ packages: resolution: {integrity: sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@hey-api/client-fetch@0.5.6': + resolution: {integrity: sha512-9Pd5P9qcxgb5+SprTIy4Z425rfIfl16Spqaco3kxwN1K9GDMMifOcA3qieEfV3aXLkMzUMdQZNSKHbZcJrJREQ==} + + '@hey-api/openapi-ts@0.60.0': + resolution: {integrity: sha512-6g7TuIQ40OluuKJOJGi4dVqa/EWGStcPMA1wGaKAWkEfzhepRINBR5FMlYrWB1bOeAQSrlZJyj0MHRQzY5D4sA==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + typescript: ^5.x + '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} @@ -1144,6 +1168,9 @@ packages: '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + '@jsdevtools/ono@7.1.3': + resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} + '@mdx-js/react@3.1.0': resolution: {integrity: sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==} peerDependencies: @@ -1963,6 +1990,14 @@ packages: peerDependencies: esbuild: '>=0.18' + c12@2.0.1: + resolution: {integrity: sha512-Z4JgsKXHG37C6PYUtIxCfLJZvo6FyhHJoClwwb9ftUkLpPSkuYqn6Tr+vnaN8hymm0kIbcg6Ey3kv/Q71k5w/A==} + peerDependencies: + magicast: ^0.3.5 + peerDependenciesMeta: + magicast: + optional: true + cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -2002,6 +2037,13 @@ packages: resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==} engines: {node: '>= 14.16.0'} + chownr@2.0.0: + resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} + engines: {node: '>=10'} + + citty@0.1.6: + resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -2019,6 +2061,10 @@ packages: comlink@4.4.1: resolution: {integrity: sha512-+1dlx0aY5Jo1vHy/tSsIGpSkN4tS9rZSW8FIhG0JH/crs9wwweswIo/POr451r7bZww3hFbPAKnTpimzL/mm4Q==} + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -2168,6 +2214,10 @@ packages: domutils@2.8.0: resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} + dotenv@16.4.7: + resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} + engines: {node: '>=12'} + drizzle-kit@0.30.1: resolution: {integrity: sha512-HmA/NeewvHywhJ2ENXD3KvOuM/+K2dGLJfxVfIHsGwaqKICJnS+Ke2L6UcSrSrtMJLJaT0Im1Qv4TFXfaZShyw==} hasBin: true @@ -2449,6 +2499,10 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} + execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + expect-type@1.1.0: resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} engines: {node: '>=12.0.0'} @@ -2517,6 +2571,10 @@ packages: resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} engines: {node: '>= 6'} + fs-minipass@2.1.0: + resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} + engines: {node: '>= 8'} + fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -2539,9 +2597,17 @@ packages: resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} engines: {node: '>= 0.4'} + get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + get-tsconfig@4.8.1: resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} + giget@1.2.3: + resolution: {integrity: sha512-8EHPljDvs7qKykr6uw8b+lqLiUc/vUg+KVTI0uND4s63TdsZM2Xus3mflvF0DDG9SiM4RlCkFGL+7aAjRmV7KA==} + hasBin: true + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -2590,6 +2656,11 @@ packages: resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} engines: {node: '>=10'} + handlebars@4.7.8: + resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} + engines: {node: '>=0.4.7'} + hasBin: true + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -2628,6 +2699,10 @@ packages: resolution: {integrity: sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==} engines: {node: '>= 14'} + human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -2715,6 +2790,10 @@ packages: is-reference@3.0.2: resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} + is-stream@3.0.0: + resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + is-typed-array@1.1.13: resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} engines: {node: '>= 0.4'} @@ -2867,6 +2946,9 @@ packages: memoizerific@1.11.3: resolution: {integrity: sha512-/EuHYwAPdLtXwAwSZkh/Gutery6pD2KYd44oQLhAvQp/50mpyduZh8Q7PYHXTCJ+wuXxt7oij2LXyIJOOYFPog==} + merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -2891,6 +2973,10 @@ packages: engines: {node: '>=4'} hasBin: true + mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} + min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -2909,6 +2995,18 @@ packages: minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + minipass@3.3.6: + resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} + engines: {node: '>=8'} + + minipass@5.0.0: + resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} + engines: {node: '>=8'} + + minizlib@2.1.2: + resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} + engines: {node: '>= 8'} + mitt@3.0.1: resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} @@ -2916,6 +3014,11 @@ packages: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true + mkdirp@1.0.4: + resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} + engines: {node: '>=10'} + hasBin: true + mlly@1.7.2: resolution: {integrity: sha512-tN3dvVHYVz4DhSXinXIk7u9syPYaJvio118uomkovAtWBT+RdbP6Lfh/5Lvo519YMmwBafwlh20IPTXIStscpA==} @@ -2943,6 +3046,9 @@ packages: engines: {node: '>= 4.4.x'} hasBin: true + neo-async@2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} @@ -2972,18 +3078,34 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} hasBin: true + npm-run-path@5.3.0: + resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + nwsapi@2.2.13: resolution: {integrity: sha512-cTGB9ptp9dY9A5VbMSe7fQBcl/tt22Vcqdq8+eN93rblOuE0aCFu4aZ2vMwct/2t+lFnosm8RkQW1I0Omb1UtQ==} + nypm@0.3.12: + resolution: {integrity: sha512-D3pzNDWIvgA+7IORhD/IuWzEk4uXv6GsgOxiid4UU3h9oq5IqV1KtPDi63n4sZJ/xcWlr88c0QM2RgN5VbOhFA==} + engines: {node: ^14.16.0 || >=16.10.0} + hasBin: true + obuf@1.1.2: resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} ofetch@1.4.1: resolution: {integrity: sha512-QZj2DfGplQAr2oj9KzceK9Hwz6Whxazmn85yYeVuS3u9XTMOGMRx0kO95MQ+vLsj/S/NwBDMMLU5hpxvI6Tklw==} + ohash@1.1.4: + resolution: {integrity: sha512-FlDryZAahJmEF3VR3w1KogSEdWX3WhA5GPakFx4J81kEAiHyLMpdLLElS8n8dfNadMgAne/MywcvmogzscVt4g==} + once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + open@8.4.2: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} @@ -3029,6 +3151,10 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} @@ -3206,6 +3332,9 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + rc9@2.1.2: + resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} + react-dom@18.3.1: resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} peerDependencies: @@ -3326,6 +3455,10 @@ packages: siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + sirv@2.0.4: resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} engines: {node: '>= 10'} @@ -3376,6 +3509,10 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} + strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} + strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -3465,6 +3602,10 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + tar@6.2.1: + resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} + engines: {node: '>=10'} + terser@5.36.0: resolution: {integrity: sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==} engines: {node: '>=10'} @@ -3623,6 +3764,11 @@ packages: ufo@1.5.4: resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + uglify-js@3.19.3: + resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} + engines: {node: '>=0.8.0'} + hasBin: true + unconfig@0.5.5: resolution: {integrity: sha512-VQZ5PT9HDX+qag0XdgQi8tJepPhXiR/yVOkn707gJDKo31lGjRilPREiQJ9Z6zd/Ugpv6ZvO5VxVIcatldYcNQ==} @@ -3820,6 +3966,9 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + wordwrap@1.0.0: + resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -3849,6 +3998,9 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + yaml@1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} @@ -3881,6 +4033,12 @@ snapshots: '@antfu/utils@0.7.10': {} + '@apidevtools/json-schema-ref-parser@11.7.3': + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + js-yaml: 4.1.0 + '@babel/code-frame@7.26.2': dependencies: '@babel/helper-validator-identifier': 7.25.9 @@ -4412,6 +4570,18 @@ snapshots: dependencies: levn: 0.4.1 + '@hey-api/client-fetch@0.5.6': {} + + '@hey-api/openapi-ts@0.60.0(typescript@5.6.3)': + dependencies: + '@apidevtools/json-schema-ref-parser': 11.7.3 + c12: 2.0.1 + commander: 12.1.0 + handlebars: 4.7.8 + typescript: 5.6.3 + transitivePeerDependencies: + - magicast + '@humanfs/core@0.19.1': {} '@humanfs/node@0.16.6': @@ -4482,6 +4652,8 @@ snapshots: '@jridgewell/sourcemap-codec': 1.5.0 optional: true + '@jsdevtools/ono@7.1.3': {} + '@mdx-js/react@3.1.0(@types/react@18.3.12)(react@18.3.1)': dependencies: '@types/mdx': 2.0.13 @@ -5498,6 +5670,21 @@ snapshots: esbuild: 0.23.1 load-tsconfig: 0.2.5 + c12@2.0.1: + dependencies: + chokidar: 4.0.1 + confbox: 0.1.8 + defu: 6.1.4 + dotenv: 16.4.7 + giget: 1.2.3 + jiti: 2.4.0 + mlly: 1.7.2 + ohash: 1.1.4 + pathe: 1.1.2 + perfect-debounce: 1.0.0 + pkg-types: 1.2.1 + rc9: 2.1.2 + cac@6.7.14: {} call-bind@1.0.7: @@ -5546,6 +5733,12 @@ snapshots: dependencies: readdirp: 4.0.2 + chownr@2.0.0: {} + + citty@0.1.6: + dependencies: + consola: 3.2.3 + color-convert@2.0.1: dependencies: color-name: 1.1.4 @@ -5561,6 +5754,8 @@ snapshots: comlink@4.4.1: {} + commander@12.1.0: {} + commander@2.20.3: optional: true @@ -5683,6 +5878,8 @@ snapshots: domelementtype: 2.3.0 domhandler: 4.3.1 + dotenv@16.4.7: {} + drizzle-kit@0.30.1: dependencies: '@drizzle-team/brocli': 0.10.2 @@ -6065,6 +6262,18 @@ snapshots: esutils@2.0.3: {} + execa@8.0.1: + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.3.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + expect-type@1.1.0: {} fast-deep-equal@3.1.3: {} @@ -6134,6 +6343,10 @@ snapshots: mime-types: 2.1.35 optional: true + fs-minipass@2.1.0: + dependencies: + minipass: 3.3.6 + fs.realpath@1.0.0: {} fsevents@2.3.3: @@ -6154,10 +6367,23 @@ snapshots: has-symbols: 1.0.3 hasown: 2.0.2 + get-stream@8.0.1: {} + get-tsconfig@4.8.1: dependencies: resolve-pkg-maps: 1.0.0 + giget@1.2.3: + dependencies: + citty: 0.1.6 + consola: 3.2.3 + defu: 6.1.4 + node-fetch-native: 1.6.4 + nypm: 0.3.12 + ohash: 1.1.4 + pathe: 1.1.2 + tar: 6.2.1 + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -6208,6 +6434,15 @@ snapshots: dependencies: duplexer: 0.1.2 + handlebars@4.7.8: + dependencies: + minimist: 1.2.8 + neo-async: 2.6.2 + source-map: 0.6.1 + wordwrap: 1.0.0 + optionalDependencies: + uglify-js: 3.19.3 + has-flag@4.0.0: {} has-property-descriptors@1.0.2: @@ -6254,6 +6489,8 @@ snapshots: - supports-color optional: true + human-signals@5.0.0: {} + iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 @@ -6335,6 +6572,8 @@ snapshots: dependencies: '@types/estree': 1.0.6 + is-stream@3.0.0: {} + is-typed-array@1.1.13: dependencies: which-typed-array: 1.1.15 @@ -6352,8 +6591,7 @@ snapshots: jiti@2.0.0-beta.3: {} - jiti@2.4.0: - optional: true + jiti@2.4.0: {} js-tokens@4.0.0: {} @@ -6497,6 +6735,8 @@ snapshots: dependencies: map-or-similar: 1.5.0 + merge-stream@2.0.0: {} + merge2@1.4.1: {} meshoptimizer@0.18.1: {} @@ -6517,6 +6757,8 @@ snapshots: mime@1.6.0: optional: true + mimic-fn@4.0.0: {} + min-indent@1.0.1: {} minimatch@3.1.2: @@ -6533,12 +6775,25 @@ snapshots: minimist@1.2.8: {} + minipass@3.3.6: + dependencies: + yallist: 4.0.0 + + minipass@5.0.0: {} + + minizlib@2.1.2: + dependencies: + minipass: 3.3.6 + yallist: 4.0.0 + mitt@3.0.1: {} mkdirp@0.5.6: dependencies: minimist: 1.2.8 + mkdirp@1.0.4: {} + mlly@1.7.2: dependencies: acorn: 8.14.0 @@ -6562,6 +6817,8 @@ snapshots: sax: 1.4.1 optional: true + neo-async@2.6.2: {} + no-case@3.0.4: dependencies: lower-case: 2.0.2 @@ -6590,9 +6847,22 @@ snapshots: npm-bundled: 2.0.1 npm-normalize-package-bin: 2.0.0 + npm-run-path@5.3.0: + dependencies: + path-key: 4.0.0 + nwsapi@2.2.13: optional: true + nypm@0.3.12: + dependencies: + citty: 0.1.6 + consola: 3.2.3 + execa: 8.0.1 + pathe: 1.1.2 + pkg-types: 1.2.1 + ufo: 1.5.4 + obuf@1.1.2: {} ofetch@1.4.1: @@ -6601,10 +6871,16 @@ snapshots: node-fetch-native: 1.6.4 ufo: 1.5.4 + ohash@1.1.4: {} + once@1.4.0: dependencies: wrappy: 1.0.2 + onetime@6.0.0: + dependencies: + mimic-fn: 4.0.0 + open@8.4.2: dependencies: define-lazy-prop: 2.0.0 @@ -6653,6 +6929,8 @@ snapshots: path-key@3.1.1: {} + path-key@4.0.0: {} + pathe@1.1.2: {} pathval@2.0.0: {} @@ -6798,6 +7076,11 @@ snapshots: queue-microtask@1.2.3: {} + rc9@2.1.2: + dependencies: + defu: 6.1.4 + destr: 2.0.3 + react-dom@18.3.1(react@18.3.1): dependencies: loose-envify: 1.4.0 @@ -6935,6 +7218,8 @@ snapshots: siginfo@2.0.0: {} + signal-exit@4.1.0: {} + sirv@2.0.4: dependencies: '@polka/url': 1.0.0-next.28 @@ -6985,6 +7270,8 @@ snapshots: dependencies: ansi-regex: 5.0.1 + strip-final-newline@3.0.0: {} + strip-indent@3.0.0: dependencies: min-indent: 1.0.1 @@ -7073,6 +7360,15 @@ snapshots: symbol-tree@3.2.4: optional: true + tar@6.2.1: + dependencies: + chownr: 2.0.0 + fs-minipass: 2.1.0 + minipass: 5.0.0 + minizlib: 2.1.2 + mkdirp: 1.0.4 + yallist: 4.0.0 + terser@5.36.0: dependencies: '@jridgewell/source-map': 0.3.6 @@ -7222,6 +7518,9 @@ snapshots: ufo@1.5.4: {} + uglify-js@3.19.3: + optional: true + unconfig@0.5.5: dependencies: '@antfu/utils': 0.7.10 @@ -7447,6 +7746,8 @@ snapshots: word-wrap@1.2.5: {} + wordwrap@1.0.0: {} + wrappy@1.0.2: {} ws@8.18.0: {} @@ -7462,6 +7763,8 @@ snapshots: yallist@3.1.1: optional: true + yallist@4.0.0: {} + yaml@1.10.2: {} yn@3.1.1: diff --git a/store/compose.yml b/store/compose.yml index c9192d5..7f287f9 100644 --- a/store/compose.yml +++ b/store/compose.yml @@ -9,7 +9,7 @@ services: volumes: - .:/app - deno-cache:/deno-dir/ - command: run --allow-net --allow-env --allow-read --watch src/main.ts + command: task dev depends_on: - db diff --git a/store/deno.json b/store/deno.json index 0f3dd04..2e40cf2 100644 --- a/store/deno.json +++ b/store/deno.json @@ -1,6 +1,6 @@ { "tasks": { - "dev": "deno run --watch main.ts", + "dev": "deno run -A --watch src/main.ts", "test": "deno run vitest", "drizzle": "podman-compose exec app deno --env -A --node-modules-dir npm:drizzle-kit", "upload": "deno run --allow-read --allow-net bin/upload.ts" diff --git a/store/openapi.json b/store/openapi.json new file mode 100644 index 0000000..3b8195e --- /dev/null +++ b/store/openapi.json @@ -0,0 +1 @@ +404 Not Found \ No newline at end of file diff --git a/store/src/main.ts b/store/src/main.ts index 2b34e50..194e5ab 100644 --- a/store/src/main.ts +++ b/store/src/main.ts @@ -1,18 +1,22 @@ -import { OpenAPIHono } from "@hono/zod-openapi"; import { router } from "./routes/router.ts"; import { createUser } from "./routes/user/user.service.ts"; import { swaggerUI } from "@hono/swagger-ui"; import { logger } from "hono/logger"; import { cors } from "hono/cors"; -await createUser("max"); +async function init() { + const openapi = await router.request("/openapi.json"); + const json = await openapi.text(); + Deno.writeTextFile("openapi.json", json); -const app = new OpenAPIHono(); -app.use("/v1/*", cors()); -app.use(logger()); -app.route("v1", router); + await createUser("max"); +} +await init(); -app.doc("/openapi.json", { +router.use(logger()); +router.use(cors()); + +router.doc("/openapi.json", { openapi: "3.0.0", info: { version: "1.0.0", @@ -20,6 +24,6 @@ app.doc("/openapi.json", { }, }); -app.get("/ui", swaggerUI({ url: "/openapi.json" })); +router.get("/ui", swaggerUI({ url: "/openapi.json" })); -Deno.serve(app.fetch); +Deno.serve(router.fetch);