Compare commits
No commits in common. "1a8a315afc230b13fc9eefdb653d9352a3c414da" and "83e019c8fad078c3cfd9878bbc7e29a7859cb659" have entirely different histories.
1a8a315afc
...
83e019c8fa
@ -20,7 +20,7 @@
|
||||
<dependency>
|
||||
<groupId>kangaroo-and-rabbit</groupId>
|
||||
<artifactId>archidata</artifactId>
|
||||
<version>0.23.2</version>
|
||||
<version>0.21.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- Loopback of logger JDK logging API to SLF4J -->
|
||||
<dependency>
|
||||
|
@ -6,7 +6,6 @@ import java.util.List;
|
||||
import org.kar.archidata.api.DataResource;
|
||||
import org.kar.archidata.externalRestApi.AnalyzeApi;
|
||||
import org.kar.archidata.externalRestApi.TsGenerateApi;
|
||||
import org.kar.archidata.model.token.JwtToken;
|
||||
import org.kar.archidata.tools.ConfigBaseVariable;
|
||||
import org.kar.karso.api.ApplicationResource;
|
||||
import org.kar.karso.api.ApplicationTokenResource;
|
||||
@ -31,7 +30,6 @@ public class WebLauncherLocal extends WebLauncher {
|
||||
SystemConfigResource.class);
|
||||
final AnalyzeApi api = new AnalyzeApi();
|
||||
api.addAllApi(listOfResources);
|
||||
api.addModel(JwtToken.class);
|
||||
TsGenerateApi.generateApi(api, "../front/src/back-api/");
|
||||
LOGGER.info("Generate APIs (DONE)");
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import org.kar.archidata.dataAccess.DBAccess;
|
||||
import org.kar.archidata.dataAccess.addOnSQL.AddOnManyToMany;
|
||||
import org.kar.archidata.filter.PartRight;
|
||||
import org.kar.archidata.migration.MigrationSqlStep;
|
||||
import org.kar.archidata.model.token.JwtToken;
|
||||
import org.kar.karso.api.UserResource;
|
||||
import org.kar.karso.model.Application;
|
||||
import org.kar.karso.model.ApplicationToken;
|
||||
@ -23,7 +22,7 @@ public class Initialization extends MigrationSqlStep {
|
||||
public static final int KARSO_INITIALISATION_ID = 1;
|
||||
|
||||
public static final List<Class<?>> CLASSES_BASE = List.of(Settings.class, UserAuth.class, Application.class,
|
||||
ApplicationToken.class, RightDescription.class, Right.class, JwtToken.class);
|
||||
ApplicationToken.class, RightDescription.class, Right.class);
|
||||
// created object
|
||||
private Application app = null;
|
||||
private UserAuth user = null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package org.kar.karso.model;
|
||||
|
||||
import org.kar.archidata.checker.CheckJPA;
|
||||
import org.kar.archidata.dataAccess.options.CheckJPA;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
|
@ -7,7 +7,7 @@ import java.time.ZoneOffset;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
import org.kar.archidata.checker.CheckJPA;
|
||||
import org.kar.archidata.dataAccess.options.CheckJPA;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
|
@ -4,7 +4,7 @@ import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
import org.kar.archidata.annotation.DataIfNotExists;
|
||||
import org.kar.archidata.checker.CheckJPA;
|
||||
import org.kar.archidata.dataAccess.options.CheckJPA;
|
||||
import org.kar.archidata.model.User;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package org.kar.karso.model;
|
||||
|
||||
import org.kar.archidata.checker.CheckJPA;
|
||||
import org.kar.archidata.dataAccess.options.CheckJPA;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
# URL for database connection
|
||||
VITE_API_BASE_URL=karso/api/
|
@ -1,27 +0,0 @@
|
||||
import type { StorybookConfig } from '@storybook/react-vite';
|
||||
|
||||
const config: StorybookConfig = {
|
||||
framework: {
|
||||
name: '@storybook/react-vite',
|
||||
options: {},
|
||||
},
|
||||
|
||||
core: {
|
||||
disableTelemetry: true,
|
||||
builder: '@storybook/builder-vite',
|
||||
},
|
||||
|
||||
stories: ['../src/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
|
||||
|
||||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
||||
|
||||
staticDirs: ['../public'],
|
||||
|
||||
typescript: {
|
||||
reactDocgen: false,
|
||||
},
|
||||
|
||||
docs: {},
|
||||
};
|
||||
|
||||
export default config;
|
@ -1,16 +0,0 @@
|
||||
<style>
|
||||
html {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.docs-story > :first-child {
|
||||
padding: 0;
|
||||
}
|
||||
.docs-story > * {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
#root #start-ui-storybook-wrapper {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
@ -1,43 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
import { Box } from '@chakra-ui/react';
|
||||
import { ChakraProvider } from '@chakra-ui/react';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
|
||||
import theme from '../src/theme';
|
||||
|
||||
// .storybook/preview.js
|
||||
export const parameters = {
|
||||
options: {
|
||||
storySort: {
|
||||
order: ['StyleGuide', 'Components', 'Fields', 'App Layout'],
|
||||
},
|
||||
},
|
||||
actions: {},
|
||||
layout: 'fullscreen',
|
||||
backgrounds: { disable: true, grid: { disable: true } },
|
||||
chakra: {
|
||||
theme,
|
||||
},
|
||||
};
|
||||
|
||||
const DocumentationWrapper = ({ children }) => {
|
||||
return (
|
||||
<Box id="start-ui-storybook-wrapper" p="4" pb="8" flex="1">
|
||||
{children}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export const decorators = [
|
||||
(Story, context) => (
|
||||
<ChakraProvider theme={theme}>
|
||||
{/* Using MemoryRouter to avoid route clashing with Storybook */}
|
||||
<MemoryRouter>
|
||||
<DocumentationWrapper>
|
||||
<Story {...context} />
|
||||
</DocumentationWrapper>
|
||||
</MemoryRouter>
|
||||
</ChakraProvider>
|
||||
),
|
||||
];
|
@ -1,2 +0,0 @@
|
||||
Proprietary
|
||||
@copyright Edouard Dupin 2024
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"display": "2025-01-14",
|
||||
"version": "0.0.1-dev\n - 2025-01-14T20:19:20+01:00",
|
||||
"commit": "0.0.1-dev\n",
|
||||
"date": "2025-01-14T20:19:20+01:00"
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
const dayjs = require('dayjs');
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const generateAppBuild = () => {
|
||||
const getVersion = () => fs.readFileSync('version.txt', 'utf8');
|
||||
|
||||
const commit = process.env.VERCEL_GIT_COMMIT_SHA
|
||||
? process.env.VERCEL_GIT_COMMIT_SHA
|
||||
: getVersion();
|
||||
|
||||
const appBuildContent = {
|
||||
display: `${dayjs().format('YYYY-MM-DD')}`,
|
||||
version: `${commit} - ${dayjs().format()}`,
|
||||
commit,
|
||||
date: dayjs().format(),
|
||||
};
|
||||
|
||||
fs.writeFileSync(
|
||||
'./app-build.json',
|
||||
JSON.stringify(appBuildContent, null, 2)
|
||||
);
|
||||
};
|
||||
|
||||
generateAppBuild();
|
10888
front/config sample.ts
10888
front/config sample.ts
File diff suppressed because it is too large
Load Diff
@ -1,13 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>karso</title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</head>
|
||||
<body style="width:100vw;height:100vh;min-width:100%;min-height:100%;">
|
||||
<div id="root" style="width:100%;height:100%;min-width:100%;min-height:100%;"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,18 +0,0 @@
|
||||
import type { KnipConfig } from 'knip';
|
||||
|
||||
const config: KnipConfig = {
|
||||
// Ignoring mostly shell binaries
|
||||
ignoreBinaries: ['export', 'sleep'],
|
||||
ignore: [
|
||||
// Related to tests
|
||||
'tests/**',
|
||||
'**.conf.js',
|
||||
'steps.d.ts',
|
||||
'steps_file.js',
|
||||
'env_ci/codecept.conf.js',
|
||||
// Generic components are useful.
|
||||
'src/components/**',
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
@ -1,94 +1,64 @@
|
||||
{
|
||||
"name": "karso",
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"description": "KAR web SSO application",
|
||||
"author": {
|
||||
"name": "Edouard DUPIN",
|
||||
"email": "yui.heero@gmail.farm"
|
||||
},
|
||||
"license": "PROPRIETARY",
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"scripts": {
|
||||
"update_packages": "ncu --target minor",
|
||||
"upgrade_packages": "ncu --upgrade ",
|
||||
"install_dependency": "pnpm install",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest watch",
|
||||
"build": "tsc && vite build",
|
||||
"static:build": "node build.js && pnpm build",
|
||||
"dev": "vite",
|
||||
"pretty": "prettier -w .",
|
||||
"lint": "pnpm tsc --noEmit",
|
||||
"storybook": "storybook dev -p 3001",
|
||||
"storybook:build": "storybook build && mv ./storybook-static ./public/storybook"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{ts,tsx,js,jsx,json}": "prettier --write"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lukemorales/query-key-factory": "1.3.4",
|
||||
"@tanstack/react-query": "^5.65.1",
|
||||
"@tanstack/react-query-devtools": "^5.65.1",
|
||||
"@chakra-ui/cli": "3.3.1",
|
||||
"@chakra-ui/react": "3.3.1",
|
||||
"@emotion/react": "11.14.0",
|
||||
"allotment": "1.20.2",
|
||||
"css-mediaquery": "0.1.2",
|
||||
"dayjs": "1.11.13",
|
||||
"history": "5.3.0",
|
||||
"next-themes": "^0.4.4",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"react-error-boundary": "5.0.0",
|
||||
"react-icons": "5.4.0",
|
||||
"react-router-dom": "7.1.1",
|
||||
"react-select": "5.9.0",
|
||||
"react-use": "17.6.0",
|
||||
"zod": "3.24.1",
|
||||
"zustand": "5.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chakra-ui/styled-system": "^2.12.0",
|
||||
"@playwright/test": "1.49.1",
|
||||
"@storybook/addon-actions": "8.4.7",
|
||||
"@storybook/addon-essentials": "8.4.7",
|
||||
"@storybook/addon-links": "8.4.7",
|
||||
"@storybook/addon-mdx-gfm": "8.4.7",
|
||||
"@storybook/react": "8.4.7",
|
||||
"@storybook/react-vite": "8.4.7",
|
||||
"@storybook/theming": "8.4.7",
|
||||
"@testing-library/jest-dom": "6.6.3",
|
||||
"@testing-library/react": "16.1.0",
|
||||
"@testing-library/user-event": "14.5.2",
|
||||
"@trivago/prettier-plugin-sort-imports": "5.2.1",
|
||||
"@types/jest": "29.5.14",
|
||||
"@types/node": "22.10.6",
|
||||
"@types/react": "18.3.8",
|
||||
"@types/react-dom": "18.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "8.20.0",
|
||||
"@typescript-eslint/parser": "8.20.0",
|
||||
"@vitejs/plugin-react": "4.3.4",
|
||||
"eslint": "9.18.0",
|
||||
"eslint-plugin-codeceptjs": "1.3.0",
|
||||
"eslint-plugin-import": "2.31.0",
|
||||
"eslint-plugin-react": "7.37.4",
|
||||
"eslint-plugin-react-hooks": "5.1.0",
|
||||
"eslint-plugin-storybook": "0.11.2",
|
||||
"jest": "29.7.0",
|
||||
"jest-environment-jsdom": "29.7.0",
|
||||
"knip": "5.42.0",
|
||||
"lint-staged": "15.3.0",
|
||||
"npm-check-updates": "^17.1.13",
|
||||
"prettier": "3.4.2",
|
||||
"puppeteer": "24.0.0",
|
||||
"react-is": "19.0.0",
|
||||
"storybook": "8.4.7",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.7.3",
|
||||
"vite": "6.0.7",
|
||||
"vitest": "2.1.8"
|
||||
}
|
||||
"name": "karso",
|
||||
"version": "0.0.0",
|
||||
"license": "MPL-2",
|
||||
"scripts": {
|
||||
"all": "npm run build && npm run test",
|
||||
"ng": "ng",
|
||||
"dev": "ng serve karso --configuration=develop --watch --port 4200",
|
||||
"dev-hot-update": "ng serve karso --configuration=develop --watch --hmr --port 4200",
|
||||
"dev_edge": "ng serve karso-edge --configuration=develop --watch --port 4199",
|
||||
"build": "ng build karso --prod",
|
||||
"test": "ng test karso",
|
||||
"test-coverage": "ng test karso --code-coverage",
|
||||
"lint": "ng lint",
|
||||
"style": "prettier --write .",
|
||||
"e2e": "ng e2e",
|
||||
"update_packages": "ncu --upgrade",
|
||||
"install_dependency": "pnpm install --force",
|
||||
"link_kar_cw": "pnpm link ../../kar-cw/dist/kar-cw/",
|
||||
"unlink_kar_cw": "pnpm unlink ../../kar-cw/dist/kar-cw/"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^18.0.2",
|
||||
"@angular/cdk": "^18.0.2",
|
||||
"@angular/common": "^18.0.2",
|
||||
"@angular/compiler": "^18.0.2",
|
||||
"@angular/core": "^18.0.2",
|
||||
"@angular/forms": "^18.0.2",
|
||||
"@angular/material": "^18.0.2",
|
||||
"@angular/platform-browser": "^18.0.2",
|
||||
"@angular/platform-browser-dynamic": "^18.0.2",
|
||||
"@angular/router": "^18.0.2",
|
||||
"rxjs": "^7.8.1",
|
||||
"zone.js": "^0.14.6",
|
||||
"zod": "3.23.8",
|
||||
"@kangaroo-and-rabbit/kar-cw": "^0.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^18.0.3",
|
||||
"@angular-eslint/builder": "18.0.1",
|
||||
"@angular-eslint/eslint-plugin": "18.0.1",
|
||||
"@angular-eslint/eslint-plugin-template": "18.0.1",
|
||||
"@angular-eslint/schematics": "18.0.1",
|
||||
"@angular-eslint/template-parser": "18.0.1",
|
||||
"@angular/cli": "^18.0.3",
|
||||
"@angular/compiler-cli": "^18.0.2",
|
||||
"@angular/language-service": "^18.0.2",
|
||||
"@playwright/test": "^1.44.1",
|
||||
"@types/jest": "^29.5.12",
|
||||
"jasmine": "^5.1.0",
|
||||
"jasmine-core": "^5.1.2",
|
||||
"karma": "^6.4.3",
|
||||
"karma-coverage": "^2.2.1",
|
||||
"karma-coverage-istanbul-reporter": "^3.0.3",
|
||||
"karma-firefox-launcher": "^2.1.3",
|
||||
"karma-jasmine": "^5.1.0",
|
||||
"karma-jasmine-html-reporter": "^2.1.0",
|
||||
"karma-spec-reporter": "^0.0.36",
|
||||
"prettier": "^3.3.1",
|
||||
"npm-check-updates": "^16.14.20",
|
||||
"tslib": "^2.6.3"
|
||||
}
|
||||
}
|
18869
front/pnpm-lock.yaml
generated
18869
front/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,16 +0,0 @@
|
||||
// Using a JS file, allowing us to add comments
|
||||
module.exports = {
|
||||
// This plugins line is mandatory for the plugin to work with pnpm.
|
||||
// https://github.com/trivago/prettier-plugin-sort-imports/blob/61d069711008c530f5a41ca4e254781abc5de358/README.md?plain=1#L89-L96
|
||||
plugins: ['@trivago/prettier-plugin-sort-imports'],
|
||||
endOfLine: 'lf',
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
tabWidth: 2,
|
||||
trailingComma: 'es5',
|
||||
arrowParens: 'always',
|
||||
importOrder: ['^react$', '^(?!^react$|^@/|^[./]).*', '^@/(.*)$', '^[./]'],
|
||||
importOrderSeparation: true,
|
||||
importOrderSortSpecifiers: true,
|
||||
importOrderParserPlugins: ['jsx', 'typescript'],
|
||||
};
|
@ -1,119 +0,0 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
ChakraProvider,
|
||||
Dialog,
|
||||
Select,
|
||||
Stack,
|
||||
Text,
|
||||
useDisclosure,
|
||||
} from '@chakra-ui/react';
|
||||
|
||||
import { environment } from '@/environment';
|
||||
import { App as SpaApp } from '@/scene/App';
|
||||
import { USERS, USERS_COLLECTION } from '@/service/session';
|
||||
import { hashLocalData } from '@/utils/sso';
|
||||
import { Toaster } from './components/ui/toaster';
|
||||
import { systemTheme } from './theme/theme';
|
||||
|
||||
const AppEnvHint = () => {
|
||||
const dialog = useDisclosure();
|
||||
const [selectUserTest, setSelectUserTest] = useState<string>('NO_USER');
|
||||
//const setUser = useRightsStore((store) => store.setUser);
|
||||
const buildEnv =
|
||||
process.env.NODE_ENV === 'development'
|
||||
? 'Development'
|
||||
: import.meta.env.VITE_DEV_ENV_NAME;
|
||||
const envName: Array<string> = [];
|
||||
!!buildEnv && envName.push(buildEnv);
|
||||
if (!envName.length) {
|
||||
return null;
|
||||
}
|
||||
const handleChange = (selectedOption) => {
|
||||
console.log(`SELECT: [${selectedOption.target.value}]`);
|
||||
setSelectUserTest(selectedOption.target.value);
|
||||
};
|
||||
const onClose = () => {
|
||||
dialog.onClose();
|
||||
if (selectUserTest == 'NO_USER') {
|
||||
window.location.href = `/${environment.applName}/sso/${hashLocalData()}/false/__LOGOUT__`;
|
||||
} else {
|
||||
window.location.href = `/${environment.applName}/sso/${hashLocalData()}/true/${USERS[selectUserTest]}`;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box
|
||||
as="button"
|
||||
zIndex="100000"
|
||||
position="fixed"
|
||||
top="0"
|
||||
insetStart="0"
|
||||
insetEnd="0"
|
||||
h="2px"
|
||||
bg="warning.400"
|
||||
cursor="pointer"
|
||||
data-test-id="devtools"
|
||||
onClick={dialog.onOpen}
|
||||
>
|
||||
<Text
|
||||
position="fixed"
|
||||
top="0"
|
||||
insetStart="4"
|
||||
bg="warning.400"
|
||||
color="warning.900"
|
||||
fontSize="0.6rem"
|
||||
fontWeight="bold"
|
||||
px="10px"
|
||||
marginLeft="25%"
|
||||
borderBottomStartRadius="sm"
|
||||
borderBottomEndRadius="sm"
|
||||
textTransform="uppercase"
|
||||
>
|
||||
{envName.join(' : ')}
|
||||
</Text>
|
||||
</Box >
|
||||
<Dialog.Root open={dialog.open} onOpenChange={dialog.onClose}>
|
||||
<Dialog.Content>
|
||||
<Dialog.Header>Outils développeurs</Dialog.Header>
|
||||
<Dialog.Body>
|
||||
<Stack>
|
||||
<Text>User</Text>
|
||||
<Select.Root onChange={handleChange} collection={USERS_COLLECTION}>
|
||||
<Select.Trigger>
|
||||
<Select.ValueText placeholder="Select test user" />
|
||||
</Select.Trigger>
|
||||
<Select.Content>
|
||||
{USERS_COLLECTION.items.map((value) => (
|
||||
<Select.Item item={value} key={value.value}>
|
||||
{value.label}
|
||||
</Select.Item>
|
||||
))}
|
||||
</Select.Content>
|
||||
</Select.Root>
|
||||
</Stack>
|
||||
</Dialog.Body>
|
||||
<Dialog.Footer>
|
||||
<Button onClick={onClose}>Close</Button>
|
||||
</Dialog.Footer>
|
||||
</Dialog.Content>
|
||||
</Dialog.Root>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
|
||||
return (
|
||||
<ChakraProvider value={systemTheme}>
|
||||
<AppEnvHint />
|
||||
<SpaApp />
|
||||
<Toaster />
|
||||
</ChakraProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
@ -7,9 +7,9 @@ import {ZodLong} from "./long";
|
||||
|
||||
export const ZodApplicationSmall = zod.object({
|
||||
id: ZodLong.optional(),
|
||||
name: zod.string().optional(),
|
||||
description: zod.string().optional(),
|
||||
redirect: zod.string().optional(),
|
||||
name: zod.string().max(255).optional(),
|
||||
description: zod.string().max(255).optional(),
|
||||
redirect: zod.string().max(255).optional(),
|
||||
|
||||
});
|
||||
|
||||
@ -26,9 +26,9 @@ export function isApplicationSmall(data: any): data is ApplicationSmall {
|
||||
}
|
||||
export const ZodApplicationSmallWrite = zod.object({
|
||||
id: ZodLong.nullable().optional(),
|
||||
name: zod.string().nullable().optional(),
|
||||
description: zod.string().nullable().optional(),
|
||||
redirect: zod.string().nullable().optional(),
|
||||
name: zod.string().max(255).nullable().optional(),
|
||||
description: zod.string().max(255).nullable().optional(),
|
||||
redirect: zod.string().max(255).nullable().optional(),
|
||||
|
||||
});
|
||||
|
||||
|
@ -7,11 +7,11 @@ import {ZodInteger} from "./integer";
|
||||
import {ZodGenericDataSoftDelete, ZodGenericDataSoftDeleteWrite } from "./generic-data-soft-delete";
|
||||
|
||||
export const ZodApplication = ZodGenericDataSoftDelete.extend({
|
||||
name: zod.string().optional(),
|
||||
description: zod.string().optional(),
|
||||
redirect: zod.string(),
|
||||
redirectDev: zod.string().optional(),
|
||||
notification: zod.string().optional(),
|
||||
name: zod.string().max(256).optional(),
|
||||
description: zod.string().max(2048).optional(),
|
||||
redirect: zod.string().max(2048),
|
||||
redirectDev: zod.string().max(2048).optional(),
|
||||
notification: zod.string().max(2048).optional(),
|
||||
/**
|
||||
* Expiration time
|
||||
*/
|
||||
@ -35,11 +35,11 @@ export function isApplication(data: any): data is Application {
|
||||
}
|
||||
}
|
||||
export const ZodApplicationWrite = ZodGenericDataSoftDeleteWrite.extend({
|
||||
name: zod.string().nullable().optional(),
|
||||
description: zod.string().nullable().optional(),
|
||||
redirect: zod.string().optional(),
|
||||
redirectDev: zod.string().nullable().optional(),
|
||||
notification: zod.string().nullable().optional(),
|
||||
name: zod.string().max(256).nullable().optional(),
|
||||
description: zod.string().max(2048).nullable().optional(),
|
||||
redirect: zod.string().max(2048).optional(),
|
||||
redirectDev: zod.string().max(2048).nullable().optional(),
|
||||
notification: zod.string().max(2048).nullable().optional(),
|
||||
/**
|
||||
* Expiration time
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@ import { z as zod } from "zod";
|
||||
|
||||
|
||||
export const ZodClientToken = zod.object({
|
||||
url: zod.string().optional(),
|
||||
url: zod.string().max(1024).optional(),
|
||||
jwt: zod.string().optional(),
|
||||
|
||||
});
|
||||
@ -22,7 +22,7 @@ export function isClientToken(data: any): data is ClientToken {
|
||||
}
|
||||
}
|
||||
export const ZodClientTokenWrite = zod.object({
|
||||
url: zod.string().nullable().optional(),
|
||||
url: zod.string().max(1024).nullable().optional(),
|
||||
jwt: zod.string().nullable().optional(),
|
||||
|
||||
});
|
||||
|
@ -6,7 +6,7 @@ import { z as zod } from "zod";
|
||||
import {ZodInteger} from "./integer";
|
||||
|
||||
export const ZodCreateTokenRequest = zod.object({
|
||||
name: zod.string().optional(),
|
||||
name: zod.string().max(255).optional(),
|
||||
validity: ZodInteger.optional(),
|
||||
|
||||
});
|
||||
@ -23,7 +23,7 @@ export function isCreateTokenRequest(data: any): data is CreateTokenRequest {
|
||||
}
|
||||
}
|
||||
export const ZodCreateTokenRequestWrite = zod.object({
|
||||
name: zod.string().nullable().optional(),
|
||||
name: zod.string().max(255).nullable().optional(),
|
||||
validity: ZodInteger.nullable().optional(),
|
||||
|
||||
});
|
||||
|
@ -17,9 +17,6 @@ export * from "./get-sign-up-available"
|
||||
export * from "./get-token"
|
||||
export * from "./integer"
|
||||
export * from "./iso-date"
|
||||
export * from "./jwt-header"
|
||||
export * from "./jwt-payload"
|
||||
export * from "./jwt-token"
|
||||
export * from "./long"
|
||||
export * from "./object-id"
|
||||
export * from "./part-right"
|
||||
|
@ -1,40 +0,0 @@
|
||||
/**
|
||||
* Interface of the server (auto-generated code)
|
||||
*/
|
||||
import { z as zod } from "zod";
|
||||
|
||||
|
||||
export const ZodJwtHeader = zod.object({
|
||||
typ: zod.string().max(128),
|
||||
alg: zod.string().max(128),
|
||||
|
||||
});
|
||||
|
||||
export type JwtHeader = zod.infer<typeof ZodJwtHeader>;
|
||||
|
||||
export function isJwtHeader(data: any): data is JwtHeader {
|
||||
try {
|
||||
ZodJwtHeader.parse(data);
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
console.log(`Fail to parse data type='ZodJwtHeader' error=${e}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
export const ZodJwtHeaderWrite = zod.object({
|
||||
typ: zod.string().max(128).optional(),
|
||||
alg: zod.string().max(128).optional(),
|
||||
|
||||
});
|
||||
|
||||
export type JwtHeaderWrite = zod.infer<typeof ZodJwtHeaderWrite>;
|
||||
|
||||
export function isJwtHeaderWrite(data: any): data is JwtHeaderWrite {
|
||||
try {
|
||||
ZodJwtHeaderWrite.parse(data);
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
console.log(`Fail to parse data type='ZodJwtHeaderWrite' error=${e}`);
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/**
|
||||
* Interface of the server (auto-generated code)
|
||||
*/
|
||||
import { z as zod } from "zod";
|
||||
|
||||
import {ZodLong} from "./long";
|
||||
|
||||
export const ZodJwtPayload = zod.object({
|
||||
sub: zod.string(),
|
||||
application: zod.string(),
|
||||
iss: zod.string(),
|
||||
right: zod.record(zod.string(), zod.record(zod.string(), ZodLong)),
|
||||
login: zod.string(),
|
||||
exp: ZodLong,
|
||||
iat: ZodLong,
|
||||
|
||||
});
|
||||
|
||||
export type JwtPayload = zod.infer<typeof ZodJwtPayload>;
|
||||
|
||||
export function isJwtPayload(data: any): data is JwtPayload {
|
||||
try {
|
||||
ZodJwtPayload.parse(data);
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
console.log(`Fail to parse data type='ZodJwtPayload' error=${e}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
export const ZodJwtPayloadWrite = zod.object({
|
||||
sub: zod.string().optional(),
|
||||
application: zod.string().optional(),
|
||||
iss: zod.string().optional(),
|
||||
right: zod.record(zod.string(), zod.record(zod.string(), ZodLong)).optional(),
|
||||
login: zod.string().optional(),
|
||||
exp: ZodLong.optional(),
|
||||
iat: ZodLong.optional(),
|
||||
|
||||
});
|
||||
|
||||
export type JwtPayloadWrite = zod.infer<typeof ZodJwtPayloadWrite>;
|
||||
|
||||
export function isJwtPayloadWrite(data: any): data is JwtPayloadWrite {
|
||||
try {
|
||||
ZodJwtPayloadWrite.parse(data);
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
console.log(`Fail to parse data type='ZodJwtPayloadWrite' error=${e}`);
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/**
|
||||
* Interface of the server (auto-generated code)
|
||||
*/
|
||||
import { z as zod } from "zod";
|
||||
|
||||
import {ZodJwtHeader, ZodJwtHeaderWrite } from "./jwt-header";
|
||||
import {ZodJwtPayload, ZodJwtPayloadWrite } from "./jwt-payload";
|
||||
|
||||
export const ZodJwtToken = zod.object({
|
||||
header: ZodJwtHeader,
|
||||
payload: ZodJwtPayload,
|
||||
signature: zod.string(),
|
||||
|
||||
});
|
||||
|
||||
export type JwtToken = zod.infer<typeof ZodJwtToken>;
|
||||
|
||||
export function isJwtToken(data: any): data is JwtToken {
|
||||
try {
|
||||
ZodJwtToken.parse(data);
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
console.log(`Fail to parse data type='ZodJwtToken' error=${e}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
export const ZodJwtTokenWrite = zod.object({
|
||||
header: ZodJwtHeader.optional(),
|
||||
payload: ZodJwtPayload.optional(),
|
||||
signature: zod.string().optional(),
|
||||
|
||||
});
|
||||
|
||||
export type JwtTokenWrite = zod.infer<typeof ZodJwtTokenWrite>;
|
||||
|
||||
export function isJwtTokenWrite(data: any): data is JwtTokenWrite {
|
||||
try {
|
||||
ZodJwtTokenWrite.parse(data);
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
console.log(`Fail to parse data type='ZodJwtTokenWrite' error=${e}`);
|
||||
return false;
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@ import { z as zod } from "zod";
|
||||
|
||||
|
||||
export const ZodPublicKey = zod.object({
|
||||
key: zod.string().optional(),
|
||||
key: zod.string().max(255).optional(),
|
||||
|
||||
});
|
||||
|
||||
@ -21,7 +21,7 @@ export function isPublicKey(data: any): data is PublicKey {
|
||||
}
|
||||
}
|
||||
export const ZodPublicKeyWrite = zod.object({
|
||||
key: zod.string().nullable().optional(),
|
||||
key: zod.string().max(255).nullable().optional(),
|
||||
|
||||
});
|
||||
|
||||
|
@ -14,15 +14,15 @@ export const ZodRightDescription = ZodGenericDataSoftDelete.extend({
|
||||
/**
|
||||
* Key of the property
|
||||
*/
|
||||
key: zod.string(),
|
||||
key: zod.string().max(64),
|
||||
/**
|
||||
* Title of the right
|
||||
*/
|
||||
title: zod.string(),
|
||||
title: zod.string().max(1024),
|
||||
/**
|
||||
* Description of the right
|
||||
*/
|
||||
description: zod.string(),
|
||||
description: zod.string().max(1024),
|
||||
|
||||
});
|
||||
|
||||
@ -45,15 +45,15 @@ export const ZodRightDescriptionWrite = ZodGenericDataSoftDeleteWrite.extend({
|
||||
/**
|
||||
* Key of the property
|
||||
*/
|
||||
key: zod.string().optional(),
|
||||
key: zod.string().max(64).optional(),
|
||||
/**
|
||||
* Title of the right
|
||||
*/
|
||||
title: zod.string().optional(),
|
||||
title: zod.string().max(1024).optional(),
|
||||
/**
|
||||
* Description of the right
|
||||
*/
|
||||
description: zod.string().optional(),
|
||||
description: zod.string().max(1024).optional(),
|
||||
|
||||
});
|
||||
|
||||
|
@ -6,7 +6,7 @@ import { z as zod } from "zod";
|
||||
import {ZodUser, ZodUserWrite } from "./user";
|
||||
|
||||
export const ZodUserAuthGet = ZodUser.extend({
|
||||
email: zod.string(),
|
||||
email: zod.string().max(512),
|
||||
avatar: zod.boolean(),
|
||||
|
||||
});
|
||||
@ -23,7 +23,7 @@ export function isUserAuthGet(data: any): data is UserAuthGet {
|
||||
}
|
||||
}
|
||||
export const ZodUserAuthGetWrite = ZodUserWrite.extend({
|
||||
email: zod.string().optional(),
|
||||
email: zod.string().max(512).optional(),
|
||||
avatar: zod.boolean().optional(),
|
||||
|
||||
});
|
||||
|
@ -7,7 +7,7 @@ import {ZodLong} from "./long";
|
||||
|
||||
export const ZodUserOut = zod.object({
|
||||
id: ZodLong,
|
||||
login: zod.string().optional(),
|
||||
login: zod.string().max(255).optional(),
|
||||
|
||||
});
|
||||
|
||||
@ -24,7 +24,7 @@ export function isUserOut(data: any): data is UserOut {
|
||||
}
|
||||
export const ZodUserOutWrite = zod.object({
|
||||
id: ZodLong,
|
||||
login: zod.string().nullable().optional(),
|
||||
login: zod.string().max(255).nullable().optional(),
|
||||
|
||||
});
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user