Commit 4332995a authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Upgrade packages.

parent e8c77040
This diff is collapsed.
......@@ -17,16 +17,16 @@
"url": "https://git.nomics.world/progedo/data-catalogue.git"
},
"scripts": {
"build": "svelte-kit build",
"build": "vite build",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"configure": "node --experimental-specifier-resolution=node package/scripts/configure.js",
"dev": "svelte-kit dev",
"dev": "vite dev",
"format": "prettier --write --plugin-search-dir=. .",
"lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"package": "svelte-kit package",
"prepare": "svelte-kit sync",
"preview": "svelte-kit preview"
"preview": "vite preview"
},
"dependencies": {
"command-line-args": "^5.2.0",
......@@ -45,9 +45,9 @@
"@auditors/json5": "^0.3.0",
"@eraviart/svelte-json-tree": "^0.2.0",
"@iconify/svelte": "^2.1.2",
"@progedo/lib": "^0.3.2",
"@sveltejs/adapter-node": "^1.0.0-next.78",
"@sveltejs/kit": "^1.0.0-next.354",
"@progedo/lib": "^0.3.4",
"@sveltejs/adapter-node": "^1.0.0-next.81",
"@sveltejs/kit": "^1.0.0-next.377",
"@tailwindcss/forms": "^0.5.0",
"@tailwindcss/typography": "^0.5.0",
"@types/command-line-args": "^5.2.0",
......@@ -86,7 +86,8 @@
"tippy.js": "^6.3.1",
"tslib": "^2.0.0",
"typescript": "^4.0.0",
"uid-safe": "^2.1.5"
"uid-safe": "^2.1.5",
"vite": "^3.0.0"
},
"type": "module"
}
......@@ -258,36 +258,3 @@ export const postgreSqlConfigurationNameByLanguage: {
function assertNeverRelation(relation: never): never {
throw new Error("Unexpected relation: " + relation)
}
export function relationLabel(
relation: StudyOrganizationRelation | StudyTermRelation,
): string {
return relation
}
export function relationLabelPluralUpper(
relation: StudyOrganizationRelation | StudyTermRelation,
) {
switch (relation) {
case StudyOrganizationRelation.Depositor:
return "Depositors"
case StudyOrganizationRelation.Distributor:
return "Distributors"
case StudyOrganizationRelation.Producer:
return "Producers"
case StudyTermRelation.DataKind:
return "Data Kinds"
case StudyTermRelation.Keyword:
return "Keywords"
case StudyTermRelation.Nation:
return "Nations"
case StudyTermRelation.Territory:
return "Territories"
case StudyTermRelation.TopicClass:
return "Topics Classes"
case StudyTermRelation.Year:
return "Years"
default:
assertNeverRelation(relation)
}
}
......@@ -10,7 +10,7 @@ import { fetchZammadApi, fetchZammadApiList } from "$lib/server/zammad"
const { devAuthentication, devUser } = config
export const get: RequestHandler = async ({ locals, url }) => {
export const GET: RequestHandler = async ({ locals, url }) => {
const [query, queryError] = validateLoginLogoutQuery(url.searchParams) as [
{ redirect: string },
unknown,
......
......@@ -6,7 +6,7 @@ import { db } from "$lib/server/database"
import { hashJsonObject, type SessionRecord } from "$lib/server/session_handler"
import { fetchZammadApi, fetchZammadApiList } from "$lib/server/zammad"
export const post: RequestHandler = async ({ locals, request, url }) => {
export const POST: RequestHandler = async ({ locals, request, url }) => {
const client = locals.openIdConnectClient
// Since method callbackParams doesn't accept a SvelteKit request as a parameter,
// create a dummy URL for a GET request and use it as a parameter of callbackParams.
......
......@@ -3,7 +3,7 @@ import type { JSONValue } from "@sveltejs/kit/types/internal"
import { validateLoginLogoutQuery } from "$lib/server/auditors/queries"
export const get: RequestHandler = ({ locals, url }) => {
export const GET: RequestHandler = ({ locals, url }) => {
const [query, queryError] = validateLoginLogoutQuery(url.searchParams) as [
{ redirect: string },
unknown,
......
import type { RequestHandler } from "@sveltejs/kit"
export const get: RequestHandler = async ({ locals }) => {
export const GET: RequestHandler = async ({ locals }) => {
const { session } = locals
const { redirectUrl } = session
delete session.redirectUrl
......
import type { RequestHandler } from "@sveltejs/kit"
import type { JSONValue } from "@sveltejs/kit/types/internal"
export const get: RequestHandler = ({ locals }) => {
export const GET: RequestHandler = ({ locals }) => {
return {
body: (locals.openIdConnectClient?.metadata ?? {}) as JSONValue,
}
......
......@@ -36,7 +36,7 @@ function auditPutBody(audit: Audit, dataUnknown: unknown): [unknown, unknown] {
return audit.reduceRemaining(data, errors, remainingKeys)
}
export const put: RequestHandler = async ({ locals, request, url }) => {
export const PUT: RequestHandler = async ({ locals, request, url }) => {
const user = locals.user
if (user == null) {
return {
......
......@@ -72,7 +72,7 @@ function auditCodeBookQuery(
return audit.reduceRemaining(data, errors, remainingKeys, auditSetNullish({}))
}
export const get: RequestHandler = async ({ params: requestParams, url }) => {
export const GET: RequestHandler = async ({ params: requestParams, url }) => {
const [params, paramsError] = validateStudyParameters(requestParams) as [
{ segments: string },
unknown,
......
......@@ -72,7 +72,7 @@ function auditPostBody(audit: Audit, dataUnknown: unknown): [unknown, unknown] {
return audit.reduceRemaining(data, errors, remainingKeys)
}
export const post: RequestHandler = async ({
export const POST: RequestHandler = async ({
locals,
params: requestParams,
request,
......
......@@ -9,7 +9,7 @@ import { isSignedBackendGetRequest } from "$lib/server/backend"
import { DataProducer } from "$lib/server/data_producers"
import { db } from "$lib/server/database"
export const get: RequestHandler = async ({
export const GET: RequestHandler = async ({
locals,
params: requestParams,
request,
......
......@@ -68,7 +68,7 @@ function auditPostBody(audit: Audit, dataUnknown: unknown): [unknown, unknown] {
return audit.reduceRemaining(data, errors, remainingKeys)
}
export const post: RequestHandler = async ({ locals, request, url }) => {
export const POST: RequestHandler = async ({ locals, request, url }) => {
const user = locals.user
if (user == null) {
return {
......
......@@ -34,7 +34,7 @@ function auditBody(audit: Audit, dataUnknown: unknown): [unknown, unknown] {
return audit.reduceRemaining(data, errors, remainingKeys)
}
export const put: RequestHandler = async ({ locals, request, url }) => {
export const PUT: RequestHandler = async ({ locals, request, url }) => {
const [body, bodyError] = auditBody(cleanAudit, await request.json()) as [
{ language: Language },
unknown,
......
......@@ -7,7 +7,7 @@ import { validateCartQuery } from "$lib/server/auditors/queries"
import { DataProducer } from "$lib/server/data_producers"
import { db } from "$lib/server/database"
export const get: RequestHandler = async ({ url }) => {
export const GET: RequestHandler = async ({ url }) => {
const [query, queryError] = validateCartQuery(url.searchParams) as [
ValidCartQuery,
unknown,
......
......@@ -7,7 +7,7 @@ import { validateDemandsQuery } from "$lib/server/auditors/queries"
import { DataProducer } from "$lib/server/data_producers"
import { db } from "$lib/server/database"
export const get: RequestHandler = async ({ locals, url }) => {
export const GET: RequestHandler = async ({ locals, url }) => {
const user = locals.user
if (user == null) {
return {
......
......@@ -3,7 +3,7 @@ import type { JSONValue } from "@sveltejs/kit/types/private"
import { fetchZammadApiList } from "$lib/server/zammad"
export const get: RequestHandler = async ({ locals }) => {
export const GET: RequestHandler = async ({ locals }) => {
const user = locals.user
if (user == null) {
return {
......
......@@ -654,7 +654,7 @@ function escapeXml(s: string): string {
.replace(/'/g, "'")
}
export const get: RequestHandler = async ({ url }) => {
export const GET: RequestHandler = async ({ url }) => {
const [query, queryError] = auditOaiPmhQuery(
cleanAudit,
url.searchParams,
......@@ -689,7 +689,7 @@ export const get: RequestHandler = async ({ url }) => {
)
}
export const post: RequestHandler = async ({ request, url }) => {
export const POST: RequestHandler = async ({ request, url }) => {
const [body, bodyError] = auditOaiPmhQuery(
cleanAudit,
new URLSearchParams(await request.text()),
......
......@@ -8,7 +8,7 @@ import { validateApiSeriesQuery } from "$lib/server/auditors/queries"
import { DataProducer } from "$lib/server/data_producers"
import { db } from "$lib/server/database"
export const get: RequestHandler = async ({ params: requestParams, url }) => {
export const GET: RequestHandler = async ({ params: requestParams, url }) => {
const [params, paramsError] = validateSeriesParameters(requestParams) as [
{ segments: string },
unknown,
......
......@@ -10,7 +10,7 @@ import { validateApiSearchCountQuery } from "$lib/server/auditors/queries"
import { addSeriesSpecificSqlClauses } from "$lib/server/data_producers"
import { db } from "$lib/server/database"
export const get: RequestHandler = async ({ url }) => {
export const GET: RequestHandler = async ({ url }) => {
const [query, queryError] = validateApiSearchCountQuery(url.searchParams) as [
ValidApiSearchCountQuery,
unknown,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment