pruning #3
5 changed files with 10 additions and 31 deletions
23
package-lock.json
generated
23
package-lock.json
generated
|
|
@ -8,7 +8,6 @@
|
||||||
"name": "doof",
|
"name": "doof",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^3.8.3",
|
|
||||||
"vue": "^3.5.12",
|
"vue": "^3.5.12",
|
||||||
"vue-router": "^4.4.5"
|
"vue-router": "^4.4.5"
|
||||||
},
|
},
|
||||||
|
|
@ -28,12 +27,10 @@
|
||||||
"husky": "^8.0.0",
|
"husky": "^8.0.0",
|
||||||
"lint-staged": "^13.3.0",
|
"lint-staged": "^13.3.0",
|
||||||
"msw": "^2.5.2",
|
"msw": "^2.5.2",
|
||||||
"node-fetch": "^2.6.9",
|
|
||||||
"openapi-fetch": "^0.9.5",
|
"openapi-fetch": "^0.9.5",
|
||||||
"openapi-typescript": "^7.4.2",
|
"openapi-typescript": "^7.4.2",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"typescript": "~5.5.4",
|
"typescript": "~5.5.4",
|
||||||
"undici": "^6.19.8",
|
|
||||||
"vitest": "^1.6.0",
|
"vitest": "^1.6.0",
|
||||||
"vue-tsc": "^2.0.29"
|
"vue-tsc": "^2.0.29"
|
||||||
}
|
}
|
||||||
|
|
@ -6296,6 +6293,7 @@
|
||||||
"version": "3.35.0",
|
"version": "3.35.0",
|
||||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.35.0.tgz",
|
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.35.0.tgz",
|
||||||
"integrity": "sha512-ntakECeqg81KqMueeGJ79Q5ZgQNR+6eaE8sxGCx62zMbAIj65q+uYvatToew3m6eAGdU4gNZwpZ34NMe4GYswg==",
|
"integrity": "sha512-ntakECeqg81KqMueeGJ79Q5ZgQNR+6eaE8sxGCx62zMbAIj65q+uYvatToew3m6eAGdU4gNZwpZ34NMe4GYswg==",
|
||||||
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
|
|
@ -14092,16 +14090,6 @@
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/undici": {
|
|
||||||
"version": "6.22.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.22.0.tgz",
|
|
||||||
"integrity": "sha512-hU/10obOIu62MGYjdskASR3CUAiYaFTtC9Pa6vHyf//mAipSvSQg6od2CnJswq7fvzNS3zJhxoRkgNVaHurWKw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18.17"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
"version": "6.21.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
||||||
|
|
@ -19968,7 +19956,8 @@
|
||||||
"core-js": {
|
"core-js": {
|
||||||
"version": "3.35.0",
|
"version": "3.35.0",
|
||||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.35.0.tgz",
|
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.35.0.tgz",
|
||||||
"integrity": "sha512-ntakECeqg81KqMueeGJ79Q5ZgQNR+6eaE8sxGCx62zMbAIj65q+uYvatToew3m6eAGdU4gNZwpZ34NMe4GYswg=="
|
"integrity": "sha512-ntakECeqg81KqMueeGJ79Q5ZgQNR+6eaE8sxGCx62zMbAIj65q+uYvatToew3m6eAGdU4gNZwpZ34NMe4GYswg==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"core-js-compat": {
|
"core-js-compat": {
|
||||||
"version": "3.35.0",
|
"version": "3.35.0",
|
||||||
|
|
@ -25517,12 +25506,6 @@
|
||||||
"integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==",
|
"integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"undici": {
|
|
||||||
"version": "6.22.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.22.0.tgz",
|
|
||||||
"integrity": "sha512-hU/10obOIu62MGYjdskASR3CUAiYaFTtC9Pa6vHyf//mAipSvSQg6od2CnJswq7fvzNS3zJhxoRkgNVaHurWKw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"undici-types": {
|
"undici-types": {
|
||||||
"version": "6.21.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
"codegen:check": "node scripts/codegen-check.js"
|
"codegen:check": "node scripts/codegen-check.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^3.8.3",
|
|
||||||
"vue": "^3.5.12",
|
"vue": "^3.5.12",
|
||||||
"vue-router": "^4.4.5"
|
"vue-router": "^4.4.5"
|
||||||
},
|
},
|
||||||
|
|
@ -38,12 +37,10 @@
|
||||||
"husky": "^8.0.0",
|
"husky": "^8.0.0",
|
||||||
"lint-staged": "^13.3.0",
|
"lint-staged": "^13.3.0",
|
||||||
"msw": "^2.5.2",
|
"msw": "^2.5.2",
|
||||||
"node-fetch": "^2.6.9",
|
|
||||||
"openapi-fetch": "^0.9.5",
|
"openapi-fetch": "^0.9.5",
|
||||||
"openapi-typescript": "^7.4.2",
|
"openapi-typescript": "^7.4.2",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"typescript": "~5.5.4",
|
"typescript": "~5.5.4",
|
||||||
"undici": "^6.19.8",
|
|
||||||
"vitest": "^1.6.0",
|
"vitest": "^1.6.0",
|
||||||
"vue-tsc": "^2.0.29"
|
"vue-tsc": "^2.0.29"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -146,8 +146,7 @@ export async function listRecipes(params?: { q?: string | null; cursor?: string
|
||||||
}
|
}
|
||||||
const { data, error, response } = await api.GET('/api/v1/recipes', { params: { query } })
|
const { data, error, response } = await api.GET('/api/v1/recipes', { params: { query } })
|
||||||
if (!response.ok) throw httpError(response, error)
|
if (!response.ok) throw httpError(response, error)
|
||||||
const mapped = fromOpenApiPage(data ?? null, (r) => decodeRecipe(r))
|
return fromOpenApiPage(data ?? null, (r) => decodeRecipe(r))
|
||||||
return { ...mapped, items: mapped.items.filter((r): r is Recipe => !!r) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getRecipe(id: number | string): Promise<Recipe> {
|
export async function getRecipe(id: number | string): Promise<Recipe> {
|
||||||
|
|
@ -194,7 +193,7 @@ export async function parseProduct(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Persons
|
// Persons
|
||||||
export async function listPersons(params?: { q?: string | null; cursor?: string | null; limit?: number }): Promise<Page<components['schemas']['Person']>> {
|
async function listPersons(params?: { q?: string | null; cursor?: string | null; limit?: number }): Promise<Page<components['schemas']['Person']>> {
|
||||||
const query: Record<string, unknown> = {}
|
const query: Record<string, unknown> = {}
|
||||||
if (params) {
|
if (params) {
|
||||||
if (params.q !== undefined) query.q = params.q
|
if (params.q !== undefined) query.q = params.q
|
||||||
|
|
@ -300,8 +299,8 @@ export async function getCurrentShoppingList(): Promise<CurrentShoppingListDTO>
|
||||||
return mapped
|
return mapped
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PurchaseExisting = { type: 'existing'; id: number; personId: number; ingredientId?: number | null }
|
type PurchaseExisting = { type: 'existing'; id: number; personId: number; ingredientId?: number | null }
|
||||||
export type PurchaseRefs = { type: 'refs'; personId: number; ingredientId?: number | null; recipeId?: number | null; mealId?: number | null }
|
type PurchaseRefs = { type: 'refs'; personId: number; ingredientId?: number | null; recipeId?: number | null; mealId?: number | null }
|
||||||
export type PurchaseRequest = PurchaseExisting | PurchaseRefs
|
export type PurchaseRequest = PurchaseExisting | PurchaseRefs
|
||||||
|
|
||||||
export async function purchaseShoppingList(
|
export async function purchaseShoppingList(
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ import { afterAll, afterEach, beforeAll } from 'vitest'
|
||||||
import { setupServer } from 'msw/node'
|
import { setupServer } from 'msw/node'
|
||||||
import { http, HttpResponse } from 'msw'
|
import { http, HttpResponse } from 'msw'
|
||||||
|
|
||||||
// Ensure global fetch is available in Node tests
|
// Ensure global fetch is available in Node tests (Node 18+ provides global fetch)
|
||||||
// Use Node 18+ global fetch (undici). Do not override so MSW can intercept.
|
// Do not override so MSW can intercept.
|
||||||
|
|
||||||
// Some CI envs inject corporate roots causing TLS issues; disable cert checks in tests only
|
// Some CI envs inject corporate roots causing TLS issues; disable cert checks in tests only
|
||||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
"allowJs": false,
|
"allowJs": false,
|
||||||
"checkJs": false,
|
"checkJs": false,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"types": ["node", "vite/client"],
|
"types": ["node"],
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["src/*"]
|
"@/*": ["src/*"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue