Compare commits

..

No commits in common. "main" and "v0.2.1" have entirely different histories.
main ... v0.2.1

69 changed files with 1580 additions and 2416 deletions

View File

@ -1,32 +1,7 @@
#!/bin/bash #!/bin/bash
version_file="../version.txt"
# update new release dependency
cd back cd back
# update the Maven version number mvn versions:set -DnewVersion=$(cat ../version.txt)
mvn versions:set -DnewVersion=$(sed 's/dev/SNAPSHOT/g' $version_file)
if grep -q "DEV" "$version_file"; then
# update all versions release of dependency
mvn versions:use-latest-releases
# update our manage dependency as snapshoot
mvn versions:use-latest-versions -Dincludes=kangaroo-and-rabbit
else
# update our manage dependency as release (must be done before)
mvn versions:use-latest-releases -Dincludes=kangaroo-and-rabbit
fi
cd - cd -
cd front
if grep -q "dev" "$version_file"; then
# update all dependency
pnpm install
pnpm run update_packages
else
# in case of release ==> can not do it automatically ...
echo not implemented
fi
cd -

View File

@ -6,7 +6,7 @@
FROM archlinux:base-devel AS builder FROM archlinux:base-devel AS builder
# update system # update system
RUN pacman -Syu --noconfirm && pacman-db-upgrade \ RUN pacman -Syu --noconfirm && pacman-db-upgrade \
&& pacman -S --noconfirm jdk-openjdk maven npm pnpm \ && pacman -S --noconfirm jdk-openjdk maven npm \
&& pacman -Scc --noconfirm && pacman -Scc --noconfirm
ENV PATH /tmp/node_modules/.bin:$PATH ENV PATH /tmp/node_modules/.bin:$PATH
@ -29,15 +29,14 @@ RUN mvn clean compile assembly:single
###################################################################################### ######################################################################################
FROM builder AS buildFront FROM builder AS buildFront
RUN echo "@kangaroo-and-rabbit:registry=https://gitea.atria-soft.org/api/packages/kangaroo-and-rabbit/npm/" > /root/.npmrc ADD front/package-lock.json \
front/package.json \
ADD front/package.json \
front/karma.conf.js \ front/karma.conf.js \
front/protractor.conf.js \ front/protractor.conf.js \
/tmp/ /tmp/
# install and cache app dependencies # install and cache app dependencies
RUN pnpm install RUN npm install
ADD front/e2e \ ADD front/e2e \
front/tsconfig.json \ front/tsconfig.json \
@ -59,6 +58,15 @@ FROM bellsoft/liberica-openjdk-alpine:latest
# add wget to manage the health check... # add wget to manage the health check...
RUN apk add --no-cache wget RUN apk add --no-cache wget
#FROM archlinux:base
#RUN pacman -Syu --noconfirm && pacman-db-upgrade
## install package
#RUN pacman -S --noconfirm jdk-openjdk wget
## intall npm
#RUN pacman -S --noconfirm npm
## clean all the caches Need only on the release environment
#RUN pacman -Scc --noconfirm
ENV LANG=C.UTF-8 ENV LANG=C.UTF-8
COPY --from=buildBack /tmp/out/maven/*.jar /application/application.jar COPY --from=buildBack /tmp/out/maven/*.jar /application/application.jar

View File

@ -20,17 +20,12 @@
<dependency> <dependency>
<groupId>kangaroo-and-rabbit</groupId> <groupId>kangaroo-and-rabbit</groupId>
<artifactId>archidata</artifactId> <artifactId>archidata</artifactId>
<version>0.12.0</version> <version>0.7.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId> <artifactId>slf4j-simple</artifactId>
<version>2.1.0-alpha1</version> <version>2.0.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.17.1</version>
</dependency> </dependency>
<!-- <!--
************************************************************ ************************************************************
@ -40,25 +35,15 @@
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId> <artifactId>junit-jupiter-api</artifactId>
<version>5.11.0-M2</version> <version>5.10.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId> <artifactId>junit-jupiter-engine</artifactId>
<version>5.11.0-M2</version> <version>5.10.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.24.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.1</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<sourceDirectory>src</sourceDirectory> <sourceDirectory>src</sourceDirectory>
@ -195,10 +180,24 @@
<mainClass>org.kar.karideo.WebLauncher</mainClass> <mainClass>org.kar.karideo.WebLauncher</mainClass>
</configuration> </configuration>
</plugin> </plugin>
<!-- Check the style of the code -->
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<configLocation>CheckStyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<failsOnError>true</failsOnError>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>net.revelc.code.formatter</groupId> <groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId> <artifactId>formatter-maven-plugin</artifactId>
<version>2.23.0</version> <version>2.12.2</version>
<configuration> <configuration>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
<lineEnding>LF</lineEnding> <lineEnding>LF</lineEnding>
@ -222,23 +221,7 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.5.0</version>
<configuration>
<includeFilterFile>spotbugs-security-include.xml</includeFilterFile>
<excludeFilterFile>spotbugs-security-exclude.xml</excludeFilterFile>
<!--<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>1.12.0</version>
</plugin>
</plugins>
--> -->
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<!-- Generate Java-docs As Part Of Project Reports --> <!-- Generate Java-docs As Part Of Project Reports -->

View File

@ -10,7 +10,10 @@ import org.glassfish.jersey.server.ResourceConfig;
import org.kar.archidata.GlobalConfiguration; import org.kar.archidata.GlobalConfiguration;
import org.kar.archidata.UpdateJwtPublicKey; import org.kar.archidata.UpdateJwtPublicKey;
import org.kar.archidata.api.DataResource; import org.kar.archidata.api.DataResource;
import org.kar.archidata.catcher.GenericCatcher; import org.kar.archidata.catcher.ExceptionCatcher;
import org.kar.archidata.catcher.FailExceptionCatcher;
import org.kar.archidata.catcher.InputExceptionCatcher;
import org.kar.archidata.catcher.SystemExceptionCatcher;
import org.kar.archidata.db.DBConfig; import org.kar.archidata.db.DBConfig;
import org.kar.archidata.filter.CORSFilter; import org.kar.archidata.filter.CORSFilter;
import org.kar.archidata.filter.OptionFilter; import org.kar.archidata.filter.OptionFilter;
@ -92,7 +95,10 @@ public class WebLauncher {
// global authentication system // global authentication system
rc.register(KarideoAuthenticationFilter.class); rc.register(KarideoAuthenticationFilter.class);
// register exception catcher // register exception catcher
GenericCatcher.addAll(rc); rc.register(InputExceptionCatcher.class);
rc.register(SystemExceptionCatcher.class);
rc.register(FailExceptionCatcher.class);
rc.register(ExceptionCatcher.class);
// add default resource: // add default resource:
rc.register(UserResource.class); rc.register(UserResource.class);
rc.register(SeriesResource.class); rc.register(SeriesResource.class);
@ -108,7 +114,7 @@ public class WebLauncher {
// add jackson to be discover when we are ins stand-alone server // add jackson to be discover when we are ins stand-alone server
rc.register(JacksonFeature.class); rc.register(JacksonFeature.class);
// enable this to show low level request // enable this to show low level request
// rc.property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, Level.WARNING.getName()); //rc.property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, Level.WARNING.getName());
this.server = GrizzlyHttpServerFactory.createHttpServer(getBaseURI(), rc); this.server = GrizzlyHttpServerFactory.createHttpServer(getBaseURI(), rc);
final HttpServer serverLink = this.server; final HttpServer serverLink = this.server;

View File

@ -4,8 +4,7 @@ package org.kar.karideo;
import java.util.List; import java.util.List;
import org.kar.archidata.api.DataResource; import org.kar.archidata.api.DataResource;
import org.kar.archidata.externalRestApi.AnalyzeApi; import org.kar.archidata.dataAccess.DataFactoryTsApi;
import org.kar.archidata.externalRestApi.TsGenerateApi;
import org.kar.archidata.tools.ConfigBaseVariable; import org.kar.archidata.tools.ConfigBaseVariable;
import org.kar.karideo.api.Front; import org.kar.karideo.api.Front;
import org.kar.karideo.api.HealthCheck; import org.kar.karideo.api.HealthCheck;
@ -15,6 +14,7 @@ import org.kar.karideo.api.SeriesResource;
import org.kar.karideo.api.TypeResource; import org.kar.karideo.api.TypeResource;
import org.kar.karideo.api.UserMediaAdvancementResource; import org.kar.karideo.api.UserMediaAdvancementResource;
import org.kar.karideo.api.UserResource; import org.kar.karideo.api.UserResource;
import org.kar.karideo.migration.Initialization;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -23,18 +23,18 @@ public class WebLauncherLocal extends WebLauncher {
private WebLauncherLocal() {} private WebLauncherLocal() {}
public static void generateObjects() throws Exception {
LOGGER.info("Generate APIs");
final List<Class<?>> listOfResources = List.of(Front.class, HealthCheck.class, SeasonResource.class, SeriesResource.class, TypeResource.class, UserMediaAdvancementResource.class,
UserResource.class, MediaResource.class, DataResource.class);
final AnalyzeApi api = new AnalyzeApi();
api.addAllApi(listOfResources);
TsGenerateApi.generateApi(api, "../front/src/app/back-api/");
LOGGER.info("Generate APIs (DONE)");
}
public static void main(final String[] args) throws Exception { public static void main(final String[] args) throws Exception {
generateObjects(); DataFactoryTsApi.generatePackage(List.of(
Front.class,
HealthCheck.class,
SeasonResource.class,
SeriesResource.class,
TypeResource.class,
UserMediaAdvancementResource.class,
UserResource.class,
MediaResource.class,
DataResource.class),
Initialization.CLASSES_BASE, "../front/src/app/back-api/");
final WebLauncherLocal launcher = new WebLauncherLocal(); final WebLauncherLocal launcher = new WebLauncherLocal();
launcher.process(); launcher.process();
LOGGER.info("end-configure the server & wait finish process:"); LOGGER.info("end-configure the server & wait finish process:");

View File

@ -1,5 +1,6 @@
package org.kar.karideo.api; package org.kar.karideo.api;
import org.kar.archidata.api.FrontGeneric; import org.kar.archidata.api.FrontGeneric;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;

View File

@ -89,7 +89,7 @@ public class MediaResource {
@FormDataParam("fileName") String fileName, // @FormDataParam("fileName") String fileName, //
@FormDataParam("universe") String universe, // @FormDataParam("universe") String universe, //
@FormDataParam("series") String series, // @FormDataParam("series") String series, //
// @FormDataParam("seriesId") String seriesId, // Not used ... //@FormDataParam("seriesId") String seriesId, // Not used ...
@FormDataParam("season") String season, // @FormDataParam("season") String season, //
@FormDataParam("episode") String episode, // @FormDataParam("episode") String episode, //
@FormDataParam("title") String title, // @FormDataParam("title") String title, //
@ -107,7 +107,7 @@ public class MediaResource {
title = multipartCorrection(title); title = multipartCorrection(title);
typeId = multipartCorrection(typeId); typeId = multipartCorrection(typeId);
// public NodeSmall uploadFile(final FormDataMultiPart form) { //public NodeSmall uploadFile(final FormDataMultiPart form) {
LOGGER.info("Upload media file: {}", fileMetaData); LOGGER.info("Upload media file: {}", fileMetaData);
LOGGER.info(" - fileName: {}", fileName); LOGGER.info(" - fileName: {}", fileName);
LOGGER.info(" - universe: {}", universe); LOGGER.info(" - universe: {}", universe);
@ -136,10 +136,10 @@ public class MediaResource {
ex.printStackTrace(); ex.printStackTrace();
throw new FailException("can not create input media (the data model has an internal error"); throw new FailException("can not create input media (the data model has an internal error");
} }
} else if (data != null && data.deleted != null && data.deleted) { } else if (data!= null && data.deleted != null && data.deleted) {
LOGGER.info("Data already exist but deleted"); LOGGER.info("Data already exist but deleted");
System.out.flush(); System.out.flush();
DataTools.undelete(data.uuid); DataTools.undelete(data.id);
data.deleted = false; data.deleted = false;
} else { } else {
LOGGER.info("Data already exist ... all good"); LOGGER.info("Data already exist ... all good");
@ -179,7 +179,7 @@ public class MediaResource {
try { try {
final Media media = new Media(); final Media media = new Media();
media.name = title; media.name = title;
media.dataId = data.uuid; media.dataId = data.id;
media.typeId = typeNode.id; media.typeId = typeNode.id;
media.seriesId = null; media.seriesId = null;
if (seriesNode != null) { if (seriesNode != null) {

View File

@ -35,6 +35,7 @@ import jakarta.ws.rs.core.MediaType;
public class SeasonResource { public class SeasonResource {
static final Logger LOGGER = LoggerFactory.getLogger(SeasonResource.class); static final Logger LOGGER = LoggerFactory.getLogger(SeasonResource.class);
@GET @GET
@RolesAllowed("USER") @RolesAllowed("USER")
@Operation(description = "Get a specific Season with his ID", tags = "GLOBAL") @Operation(description = "Get a specific Season with his ID", tags = "GLOBAL")
@ -51,7 +52,9 @@ public class SeasonResource {
return DataAccess.get(Season.class, id); return DataAccess.get(Season.class, id);
} }
/* ============================================================================= ADMIN SECTION: ============================================================================= */ /* =============================================================================
* ADMIN SECTION:
* ============================================================================= */
@POST @POST
@RolesAllowed("ADMIN") @RolesAllowed("ADMIN")

View File

@ -51,7 +51,9 @@ public class SeriesResource {
return DataAccess.get(Series.class, id); return DataAccess.get(Series.class, id);
} }
/* ============================================================================= ADMIN SECTION: ============================================================================= */ /* =============================================================================
* ADMIN SECTION:
* ============================================================================= */
@POST @POST
@RolesAllowed("ADMIN") @RolesAllowed("ADMIN")

View File

@ -34,6 +34,7 @@ import jakarta.ws.rs.core.MediaType;
public class TypeResource { public class TypeResource {
static final Logger LOGGER = LoggerFactory.getLogger(TypeResource.class); static final Logger LOGGER = LoggerFactory.getLogger(TypeResource.class);
@GET @GET
@RolesAllowed("USER") @RolesAllowed("USER")
@Operation(description = "Get all Type", tags = "GLOBAL") @Operation(description = "Get all Type", tags = "GLOBAL")
@ -54,7 +55,9 @@ public class TypeResource {
return DataAccess.get(Type.class, id); return DataAccess.get(Type.class, id);
} }
/* ============================================================================= ADMIN SECTION: ============================================================================= */ /* =============================================================================
* ADMIN SECTION:
* ============================================================================= */
@POST @POST
@RolesAllowed("ADMIN") @RolesAllowed("ADMIN")

View File

@ -46,15 +46,19 @@ public class UserMediaAdvancementResource {
return DataAccess.getsWhere(UserMediaAdvancement.class, new Condition(new QueryCondition("userId", "=", gc.userByToken.id))); return DataAccess.getsWhere(UserMediaAdvancement.class, new Condition(new QueryCondition("userId", "=", gc.userByToken.id)));
} }
/* ============================================================================= Modification SECTION: ============================================================================= */ /* =============================================================================
* Modification SECTION:
* ============================================================================= */
public record MediaInformations(int time, float percent, int count) { public record MediaInformations(
} int time,
float percent,
int count) {}
// @POST //@POST
// @Path("{id}") //@Path("{id}")
// @RolesAllowed("USER") //@RolesAllowed("USER")
// @Consumes(MediaType.APPLICATION_JSON) //@Consumes(MediaType.APPLICATION_JSON)
public UserMediaAdvancement post(@Context final SecurityContext sc, @PathParam("id") final Long id, final MediaInformations data) throws Exception { public UserMediaAdvancement post(@Context final SecurityContext sc, @PathParam("id") final Long id, final MediaInformations data) throws Exception {
final GenericContext gc = (GenericContext) sc.getUserPrincipal(); final GenericContext gc = (GenericContext) sc.getUserPrincipal();
final UserMediaAdvancement elem = new UserMediaAdvancement(); final UserMediaAdvancement elem = new UserMediaAdvancement();
@ -66,8 +70,10 @@ public class UserMediaAdvancementResource {
return DataAccess.insert(elem); return DataAccess.insert(elem);
} }
public record MediaInformationsDelta(int time, float percent, boolean addCount) { public record MediaInformationsDelta(
} int time,
float percent,
boolean addCount) {}
@PATCH @PATCH
@Path("{id}") @Path("{id}")

View File

@ -4,57 +4,57 @@ package org.kar.karideo.internal;
//import io.scenarium.logger.Logger; //import io.scenarium.logger.Logger;
public class Log { public class Log {
// private static final String LIB_NAME = "logger"; // private static final String LIB_NAME = "logger";
// private static final String LIB_NAME_DRAW = Logger.getDrawableName(LIB_NAME); // private static final String LIB_NAME_DRAW = Logger.getDrawableName(LIB_NAME);
// private static final boolean PRINT_CRITICAL = Logger.getNeedPrint(LIB_NAME, LogLevel.CRITICAL); // private static final boolean PRINT_CRITICAL = Logger.getNeedPrint(LIB_NAME, LogLevel.CRITICAL);
// private static final boolean PRINT_ERROR = Logger.getNeedPrint(LIB_NAME, LogLevel.ERROR); // private static final boolean PRINT_ERROR = Logger.getNeedPrint(LIB_NAME, LogLevel.ERROR);
// private static final boolean PRINT_WARNING = Logger.getNeedPrint(LIB_NAME, LogLevel.WARNING); // private static final boolean PRINT_WARNING = Logger.getNeedPrint(LIB_NAME, LogLevel.WARNING);
// private static final boolean PRINT_INFO = Logger.getNeedPrint(LIB_NAME, LogLevel.INFO); // private static final boolean PRINT_INFO = Logger.getNeedPrint(LIB_NAME, LogLevel.INFO);
// private static final boolean PRINT_DEBUG = Logger.getNeedPrint(LIB_NAME, LogLevel.DEBUG); // private static final boolean PRINT_DEBUG = Logger.getNeedPrint(LIB_NAME, LogLevel.DEBUG);
// private static final boolean PRINT_VERBOSE = Logger.getNeedPrint(LIB_NAME, LogLevel.VERBOSE); // private static final boolean PRINT_VERBOSE = Logger.getNeedPrint(LIB_NAME, LogLevel.VERBOSE);
// private static final boolean PRINT_TODO = Logger.getNeedPrint(LIB_NAME, LogLevel.TODO); // private static final boolean PRINT_TODO = Logger.getNeedPrint(LIB_NAME, LogLevel.TODO);
// private static final boolean PRINT_PRINT = Logger.getNeedPrint(LIB_NAME, LogLevel.PRINT); // private static final boolean PRINT_PRINT = Logger.getNeedPrint(LIB_NAME, LogLevel.PRINT);
// //
// private Log() {} // private Log() {}
// //
// public static void print(String data) { // public static void print(String data) {
// if (PRINT_PRINT) // if (PRINT_PRINT)
// Logger.print(LIB_NAME_DRAW, data); // Logger.print(LIB_NAME_DRAW, data);
// } // }
// //
// public static void todo(String data) { // public static void todo(String data) {
// if (PRINT_TODO) // if (PRINT_TODO)
// Logger.todo(LIB_NAME_DRAW, data); // Logger.todo(LIB_NAME_DRAW, data);
// } // }
// //
// public static void critical(String data) { // public static void critical(String data) {
// if (PRINT_CRITICAL) // if (PRINT_CRITICAL)
// Logger.critical(LIB_NAME_DRAW, data); // Logger.critical(LIB_NAME_DRAW, data);
// } // }
// //
// public static void error(String data) { // public static void error(String data) {
// if (PRINT_ERROR) // if (PRINT_ERROR)
// Logger.error(LIB_NAME_DRAW, data); // Logger.error(LIB_NAME_DRAW, data);
// } // }
// //
// public static void warning(String data) { // public static void warning(String data) {
// if (PRINT_WARNING) // if (PRINT_WARNING)
// Logger.warning(LIB_NAME_DRAW, data); // Logger.warning(LIB_NAME_DRAW, data);
// } // }
// //
// public static void info(String data) { // public static void info(String data) {
// if (PRINT_INFO) // if (PRINT_INFO)
// Logger.info(LIB_NAME_DRAW, data); // Logger.info(LIB_NAME_DRAW, data);
// } // }
// //
// public static void debug(String data) { // public static void debug(String data) {
// if (PRINT_DEBUG) // if (PRINT_DEBUG)
// Logger.debug(LIB_NAME_DRAW, data); // Logger.debug(LIB_NAME_DRAW, data);
// } // }
// //
// public static void verbose(String data) { // public static void verbose(String data) {
// if (PRINT_VERBOSE) // if (PRINT_VERBOSE)
// Logger.verbose(LIB_NAME_DRAW, data); // Logger.verbose(LIB_NAME_DRAW, data);
// } // }
} }

View File

@ -2,7 +2,6 @@ package org.kar.karideo.migration;
import java.util.List; import java.util.List;
import org.kar.archidata.dataAccess.DataAccess;
import org.kar.archidata.migration.MigrationSqlStep; import org.kar.archidata.migration.MigrationSqlStep;
import org.kar.archidata.model.Data; import org.kar.archidata.model.Data;
import org.kar.archidata.model.User; import org.kar.archidata.model.User;
@ -11,16 +10,12 @@ import org.kar.karideo.model.Season;
import org.kar.karideo.model.Series; import org.kar.karideo.model.Series;
import org.kar.karideo.model.Type; import org.kar.karideo.model.Type;
import org.kar.karideo.model.UserMediaAdvancement; import org.kar.karideo.model.UserMediaAdvancement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Initialization extends MigrationSqlStep { public class Initialization extends MigrationSqlStep {
private static final Logger LOGGER = LoggerFactory.getLogger(Initialization.class);
public static final int KARSO_INITIALISATION_ID = 1; public static final int KARSO_INITIALISATION_ID = 1;
public static final List<Class<?>> CLASSES_BASE = List.of(Data.class, Media.class, Type.class, Series.class, Season.class, User.class, UserMediaAdvancement.class); public static final List<Class<?>> CLASSES_BASE = List.of(Data.class, Media.class, Type.class, Series.class, Season.class, User.class, UserMediaAdvancement.class);
@Override @Override
public String getName() { public String getName() {
return "Initialization"; return "Initialization";
@ -32,9 +27,13 @@ public class Initialization extends MigrationSqlStep {
@Override @Override
public void generateStep() throws Exception { public void generateStep() throws Exception {
for (final Class<?> clazz : CLASSES_BASE) { addClass(Data.class);
addClass(clazz); addClass(Media.class);
} addClass(Type.class);
addClass(Series.class);
addClass(Season.class);
addClass(User.class);
addClass(UserMediaAdvancement.class);
addAction(""" addAction("""
INSERT INTO `type` (`id`, `name`, `description`) VALUES INSERT INTO `type` (`id`, `name`, `description`) VALUES
@ -67,25 +66,4 @@ public class Initialization extends MigrationSqlStep {
""", "mysql"); """, "mysql");
} }
public static void dropAll() {
for (final Class<?> element : CLASSES_BASE) {
try {
DataAccess.drop(element);
} catch (final Exception ex) {
LOGGER.error("Fail to drop table !!!!!!");
ex.printStackTrace();
}
}
}
public static void cleanAll() {
for (final Class<?> element : CLASSES_BASE) {
try {
DataAccess.cleanAll(element);
} catch (final Exception ex) {
LOGGER.error("Fail to clean table !!!!!!");
ex.printStackTrace();
}
}
}
} }

View File

@ -10,7 +10,7 @@ import java.util.UUID;
import org.kar.archidata.api.DataResource; import org.kar.archidata.api.DataResource;
import org.kar.archidata.dataAccess.DataAccess; import org.kar.archidata.dataAccess.DataAccess;
import org.kar.archidata.dataAccess.addOn.model.LinkTableLongLong; import org.kar.archidata.dataAccess.addOn.model.LinkTable;
import org.kar.archidata.dataAccess.options.AccessDeletedItems; import org.kar.archidata.dataAccess.options.AccessDeletedItems;
import org.kar.archidata.dataAccess.options.OverrideTableName; import org.kar.archidata.dataAccess.options.OverrideTableName;
import org.kar.archidata.migration.MigrationSqlStep; import org.kar.archidata.migration.MigrationSqlStep;
@ -42,10 +42,10 @@ public class Migration20240226 extends MigrationSqlStep {
"""); """);
addAction(() -> { addAction(() -> {
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data")); final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
for (final UUIDConversion elem : datas) { for (final UUIDConversion elem: datas) {
elem.uuid = UuidUtils.nextUUID(); elem.uuid = UuidUtils.nextUUID();
} }
for (final UUIDConversion elem : datas) { for (final UUIDConversion elem: datas) {
DataAccess.update(elem, elem.id, List.of("uuid"), new OverrideTableName("data")); DataAccess.update(elem, elem.id, List.of("uuid"), new OverrideTableName("data"));
} }
}); });
@ -53,18 +53,18 @@ public class Migration20240226 extends MigrationSqlStep {
ALTER TABLE `data` CHANGE `uuid` `uuid` binary(16) DEFAULT (UUID_TO_BIN(UUID(), TRUE)); ALTER TABLE `data` CHANGE `uuid` `uuid` binary(16) DEFAULT (UUID_TO_BIN(UUID(), TRUE));
"""); """);
final List<String> tableToTransform = List.of("media", "season", "series", "type", "user"); final List<String> tableToTransform = List.of("media", "season", "series", "type", "user");
for (final String tableName : tableToTransform) { for (final String tableName : tableToTransform ) {
addAction("ALTER TABLE `" + tableName + "` ADD `covers` text NULL;"); addAction("ALTER TABLE `" + tableName + "` ADD `covers` text NULL;");
addAction(() -> { addAction(() -> {
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data")); final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
final List<CoverConversion> medias = DataAccess.gets(CoverConversion.class, new AccessDeletedItems(), new OverrideTableName(tableName)); final List<CoverConversion> medias = DataAccess.gets(CoverConversion.class, new AccessDeletedItems(), new OverrideTableName(tableName));
final List<LinkTableLongLong> links = DataAccess.gets(LinkTableLongLong.class, new OverrideTableName(tableName + "_link_cover")); final List<LinkTable> links = DataAccess.gets(LinkTable.class, new OverrideTableName(tableName + "_link_cover"));
LOGGER.info("Get somes data: {} {} {}", datas.size(), medias.size(), links.size()); LOGGER.info("Get somes data: {} {} {}", datas.size(), medias.size(), links.size());
for (final CoverConversion media : medias) { for (final CoverConversion media: medias) {
final List<UUID> values = new ArrayList<>(); final List<UUID> values = new ArrayList<>();
for (final LinkTableLongLong link : links) { for (final LinkTable link: links) {
if (link.object1Id.equals(media.id)) { if (link.object1Id.equals(media.id)) {
for (final UUIDConversion data : datas) { for (final UUIDConversion data: datas) {
if (data.id.equals(link.object2Id)) { if (data.id.equals(link.object2Id)) {
values.add(data.uuid); values.add(data.uuid);
break; break;
@ -88,8 +88,8 @@ public class Migration20240226 extends MigrationSqlStep {
addAction(() -> { addAction(() -> {
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data")); final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
final List<MediaConversion> medias = DataAccess.gets(MediaConversion.class, new AccessDeletedItems(), new OverrideTableName("media")); final List<MediaConversion> medias = DataAccess.gets(MediaConversion.class, new AccessDeletedItems(), new OverrideTableName("media"));
for (final MediaConversion media : medias) { for (final MediaConversion media: medias) {
for (final UUIDConversion data : datas) { for (final UUIDConversion data: datas) {
if (data.id.equals(media.dataId)) { if (data.id.equals(media.dataId)) {
media.dataUUID = data.uuid; media.dataUUID = data.uuid;
DataAccess.update(media, media.id, List.of("dataUUID"), new OverrideTableName("media")); DataAccess.update(media, media.id, List.of("dataUUID"), new OverrideTableName("media"));
@ -107,7 +107,7 @@ public class Migration20240226 extends MigrationSqlStep {
// Move the files... // Move the files...
addAction(() -> { addAction(() -> {
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data")); final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
for (final UUIDConversion data : datas) { for (final UUIDConversion data: datas) {
final String origin = DataResource.getFileDataOld(data.id); final String origin = DataResource.getFileDataOld(data.id);
final String destination = DataResource.getFileData(data.uuid); final String destination = DataResource.getFileData(data.uuid);
LOGGER.info("move file = {}", origin); LOGGER.info("move file = {}", origin);
@ -119,7 +119,11 @@ public class Migration20240226 extends MigrationSqlStep {
} }
} }
}); });
/* I am not sure then I prefer keep the primary key for the moment addAction(""" ALTER TABLE `data` DROP `id`; """); */ /* I am not sure then I prefer keep the primary key for the moment
addAction("""
ALTER TABLE `data` DROP `id`;
""");
*/
addAction(""" addAction("""
ALTER TABLE `data` CHANGE `id` `idOld` bigint NOT NULL DEFAULT 0; ALTER TABLE `data` CHANGE `id` `idOld` bigint NOT NULL DEFAULT 0;
"""); """);

View File

@ -9,7 +9,6 @@ import org.kar.archidata.model.GenericDataSoftDelete;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType; import jakarta.persistence.FetchType;
@ -20,41 +19,43 @@ import jakarta.persistence.Table;
@Table(name = "media") @Table(name = "media")
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class Media extends GenericDataSoftDelete { public class Media extends GenericDataSoftDelete {
@Schema(description = "Name of the media (this represent the title)") // Name of the media (this represent the title)
@Column(nullable = false, length = 0) @Column(nullable = false, length = 0)
public String name; public String name;
@Schema(description = "Description of the media") // Description of the media
@Column(length = 0) @Column(length = 0)
public String description; public String description;
@Schema(description = "Foreign Key Id of the data") // Foreign Key Id of the data
@ManyToOne(fetch = FetchType.LAZY, targetEntity = Data.class) @ManyToOne(fetch = FetchType.LAZY, targetEntity = Data.class)
@Column(nullable = false) @Column(nullable = false)
public UUID dataId; public UUID dataId;
@Schema(description = "Type of the media") // Type of the media")
@ManyToOne(fetch = FetchType.LAZY, targetEntity = Type.class) @ManyToOne(fetch = FetchType.LAZY, targetEntity = Type.class)
public Long typeId; public Long typeId;
@Schema(description = "Series reference of the media") // Series reference of the media
@ManyToOne(fetch = FetchType.LAZY, targetEntity = Series.class) @ManyToOne(fetch = FetchType.LAZY, targetEntity = Series.class)
public Long seriesId; public Long seriesId;
@Schema(description = "Season reference of the media") // Season reference of the media
@ManyToOne(fetch = FetchType.LAZY, targetEntity = Season.class) @ManyToOne(fetch = FetchType.LAZY, targetEntity = Season.class)
public Long seasonId; public Long seasonId;
@Schema(description = "Episode Id") // Episode Id
public Integer episode; public Integer episode;
// ") // ")
public Integer date; public Integer date;
@Schema(description = "Creation years of the media") // Creation years of the media
public Integer time; public Integer time;
@Schema(description = "Limitation Age of the media") // Limitation Age of the media
public Integer ageLimit; public Integer ageLimit;
@Schema(description = "List of Id of the specific covers") // List of Id of the specific covers
@DataJson(targetEntity = Data.class) @DataJson(targetEntity = Data.class)
public List<UUID> covers = null; public List<UUID> covers = null;
@Override @Override
public String toString() { public String toString() {
return "Media [name=" + this.name + ", description=" + this.description + ", dataId=" + this.dataId + ", typeId=" + this.typeId + ", seriesId=" + this.seriesId + ", seasonId=" + this.seasonId return "Media [name=" + this.name + ", description=" + this.description + ", dataId=" + this.dataId + ", typeId=" + this.typeId
+ ", episode=" + this.episode + ", date=" + this.date + ", time=" + this.time + ", ageLimit=" + this.ageLimit + ", covers=" + this.covers + "]"; + ", seriesId=" + this.seriesId + ", seasonId=" + this.seasonId + ", episode=" + this.episode + ", date=" + this.date
+ ", time=" + this.time + ", ageLimit=" + this.ageLimit + ", covers=" + this.covers + "]";
} }
} }

View File

@ -55,7 +55,7 @@ public class TestHealthCheck {
@Order(1) @Order(1)
@Test @Test
// @RepeatedTest(10) //@RepeatedTest(10)
public void checkHealthCheck() throws Exception { public void checkHealthCheck() throws Exception {
final HealthResult result = api.get(HealthResult.class, "health_check"); final HealthResult result = api.get(HealthResult.class, "health_check");
Assertions.assertEquals(result.value(), "alive and kicking"); Assertions.assertEquals(result.value(), "alive and kicking");

View File

@ -12,23 +12,17 @@ public class WebLauncherTest extends WebLauncher {
public WebLauncherTest() { public WebLauncherTest() {
LOGGER.debug("Configure REST system"); LOGGER.debug("Configure REST system");
// for local test: // for local test:
ConfigBaseVariable.apiAdress = "http://127.0.0.1:12342/test/api/"; ConfigBaseVariable.apiAdress = "http://127.0.0.1:12345/test/api/";
// Enable the test mode permit to access to the test token (never use it in production).
ConfigBaseVariable.testMode = "true"; ConfigBaseVariable.testMode = "true";
//ConfigBaseVariable.dbPort = "3306";
// for the test we a in memory sqlite.. // for the test we a in memory sqlite..
if (true) {
if (!"true".equalsIgnoreCase(System.getenv("TEST_E2E_MODE"))) {
ConfigBaseVariable.dbType = "sqlite"; ConfigBaseVariable.dbType = "sqlite";
ConfigBaseVariable.dbHost = "memory"; ConfigBaseVariable.dbHost = "memory";
// for test we need to connect all time the DB // for test we need to connect all time the DB
ConfigBaseVariable.dbKeepConnected = "true"; ConfigBaseVariable.dbKeepConnected = "true";
}
} else { //ConfigBaseVariable.dbHost = "localhost";
// Enable this if you want to access to a local MySQL base to test with an adminer //ConfigBaseVariable.dbUser = "root";
ConfigBaseVariable.bdDatabase = "test_db"; //ConfigBaseVariable.dbPassword = "ZERTYSDGFVHSDFGHJYZSDFGSQxfgsqdfgsqdrf4564654";
ConfigBaseVariable.dbPort = "3309";
ConfigBaseVariable.dbUser = "root";
ConfigBaseVariable.dbPassword = "password";
}
} }
} }

View File

@ -19,32 +19,32 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^18.0.2", "@angular/animations": "^17.3.5",
"@angular/cdk": "^18.0.2", "@angular/cdk": "^17.3.5",
"@angular/common": "^18.0.2", "@angular/common": "^17.3.5",
"@angular/compiler": "^18.0.2", "@angular/compiler": "^17.3.5",
"@angular/core": "^18.0.2", "@angular/core": "^17.3.5",
"@angular/forms": "^18.0.2", "@angular/forms": "^17.3.5",
"@angular/material": "^18.0.2", "@angular/material": "^17.3.5",
"@angular/platform-browser": "^18.0.2", "@angular/platform-browser": "^17.3.5",
"@angular/platform-browser-dynamic": "^18.0.2", "@angular/platform-browser-dynamic": "^17.3.5",
"@angular/router": "^18.0.2", "@angular/router": "^17.3.5",
"rxjs": "^7.8.1", "rxjs": "^7.8.1",
"zone.js": "^0.14.6", "zone.js": "^0.14.4",
"zod": "3.23.8", "zod": "3.22.4",
"@kangaroo-and-rabbit/kar-cw": "^0.4.1" "@kangaroo-and-rabbit/kar-cw": "^0.2.1"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^18.0.3", "@angular-devkit/build-angular": "^17.3.5",
"@angular-eslint/builder": "18.0.1", "@angular-eslint/builder": "17.3.0",
"@angular-eslint/eslint-plugin": "18.0.1", "@angular-eslint/eslint-plugin": "17.3.0",
"@angular-eslint/eslint-plugin-template": "18.0.1", "@angular-eslint/eslint-plugin-template": "17.3.0",
"@angular-eslint/schematics": "18.0.1", "@angular-eslint/schematics": "17.3.0",
"@angular-eslint/template-parser": "18.0.1", "@angular-eslint/template-parser": "17.3.0",
"@angular/cli": "^18.0.3", "@angular/cli": "^17.3.5",
"@angular/compiler-cli": "^18.0.2", "@angular/compiler-cli": "^17.3.5",
"@angular/language-service": "^18.0.2", "@angular/language-service": "^17.3.5",
"npm-check-updates": "^16.14.20", "npm-check-updates": "^16.14.18",
"tslib": "^2.6.3" "tslib": "^2.6.2"
} }
} }

302
front/pnpm-lock.yaml generated
View File

@ -6,52 +6,52 @@ settings:
dependencies: dependencies:
'@angular/animations': '@angular/animations':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/core@17.3.5) version: 17.3.4(@angular/core@17.3.4)
'@angular/cdk': '@angular/cdk':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/common@17.3.5)(@angular/core@17.3.5)(rxjs@7.8.1) version: 17.3.4(@angular/common@17.3.4)(@angular/core@17.3.4)(rxjs@7.8.1)
'@angular/common': '@angular/common':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/core@17.3.5)(rxjs@7.8.1) version: 17.3.4(@angular/core@17.3.4)(rxjs@7.8.1)
'@angular/compiler': '@angular/compiler':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/core@17.3.5) version: 17.3.4(@angular/core@17.3.4)
'@angular/core': '@angular/core':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) version: 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
'@angular/forms': '@angular/forms':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/common@17.3.5)(@angular/core@17.3.5)(@angular/platform-browser@17.3.5)(rxjs@7.8.1) version: 17.3.4(@angular/common@17.3.4)(@angular/core@17.3.4)(@angular/platform-browser@17.3.4)(rxjs@7.8.1)
'@angular/material': '@angular/material':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/animations@17.3.5)(@angular/cdk@17.3.5)(@angular/common@17.3.5)(@angular/core@17.3.5)(@angular/forms@17.3.5)(@angular/platform-browser@17.3.5)(rxjs@7.8.1) version: 17.3.4(@angular/animations@17.3.4)(@angular/cdk@17.3.4)(@angular/common@17.3.4)(@angular/core@17.3.4)(@angular/forms@17.3.4)(@angular/platform-browser@17.3.4)(rxjs@7.8.1)
'@angular/platform-browser': '@angular/platform-browser':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/animations@17.3.5)(@angular/common@17.3.5)(@angular/core@17.3.5) version: 17.3.4(@angular/animations@17.3.4)(@angular/common@17.3.4)(@angular/core@17.3.4)
'@angular/platform-browser-dynamic': '@angular/platform-browser-dynamic':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/common@17.3.5)(@angular/compiler@17.3.5)(@angular/core@17.3.5)(@angular/platform-browser@17.3.5) version: 17.3.4(@angular/common@17.3.4)(@angular/compiler@17.3.4)(@angular/core@17.3.4)(@angular/platform-browser@17.3.4)
'@angular/router': '@angular/router':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/common@17.3.5)(@angular/core@17.3.5)(@angular/platform-browser@17.3.5)(rxjs@7.8.1) version: 17.3.4(@angular/common@17.3.4)(@angular/core@17.3.4)(@angular/platform-browser@17.3.4)(rxjs@7.8.1)
'@kangaroo-and-rabbit/kar-cw': '@kangaroo-and-rabbit/kar-cw':
specifier: ^0.2.1 specifier: ^0.2.0
version: 0.2.1(@angular/common@17.3.5)(@angular/compiler@17.3.5)(@angular/core@17.3.5)(@angular/forms@17.3.5)(@angular/platform-browser-dynamic@17.3.5)(@angular/platform-browser@17.3.5)(@angular/router@17.3.5)(rxjs@7.8.1)(zone.js@0.14.4) version: 0.2.0(@angular/common@17.3.4)(@angular/compiler@17.3.4)(@angular/core@17.3.4)(@angular/forms@17.3.4)(@angular/platform-browser-dynamic@17.3.4)(@angular/platform-browser@17.3.4)(@angular/router@17.3.4)(rxjs@7.8.1)(zone.js@0.14.4)
rxjs: rxjs:
specifier: ^7.8.1 specifier: ^7.8.1
version: 7.8.1 version: 7.8.1
zod: zod:
specifier: 3.23.0 specifier: 3.22.4
version: 3.23.0 version: 3.22.4
zone.js: zone.js:
specifier: ^0.14.4 specifier: ^0.14.4
version: 0.14.4 version: 0.14.4
devDependencies: devDependencies:
'@angular-devkit/build-angular': '@angular-devkit/build-angular':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/compiler-cli@17.3.5)(typescript@5.4.5) version: 17.3.4(@angular/compiler-cli@17.3.4)(typescript@5.4.5)
'@angular-eslint/builder': '@angular-eslint/builder':
specifier: 17.3.0 specifier: 17.3.0
version: 17.3.0(eslint@8.57.0)(typescript@5.4.5) version: 17.3.0(eslint@8.57.0)(typescript@5.4.5)
@ -63,19 +63,19 @@ devDependencies:
version: 17.3.0(eslint@8.57.0)(typescript@5.4.5) version: 17.3.0(eslint@8.57.0)(typescript@5.4.5)
'@angular-eslint/schematics': '@angular-eslint/schematics':
specifier: 17.3.0 specifier: 17.3.0
version: 17.3.0(@angular/cli@17.3.5)(eslint@8.57.0)(typescript@5.4.5) version: 17.3.0(@angular/cli@17.3.4)(eslint@8.57.0)(typescript@5.4.5)
'@angular-eslint/template-parser': '@angular-eslint/template-parser':
specifier: 17.3.0 specifier: 17.3.0
version: 17.3.0(eslint@8.57.0)(typescript@5.4.5) version: 17.3.0(eslint@8.57.0)(typescript@5.4.5)
'@angular/cli': '@angular/cli':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5 version: 17.3.4
'@angular/compiler-cli': '@angular/compiler-cli':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5(@angular/compiler@17.3.5)(typescript@5.4.5) version: 17.3.4(@angular/compiler@17.3.4)(typescript@5.4.5)
'@angular/language-service': '@angular/language-service':
specifier: ^17.3.5 specifier: ^17.3.4
version: 17.3.5 version: 17.3.4
npm-check-updates: npm-check-updates:
specifier: ^16.14.18 specifier: ^16.14.18
version: 16.14.18 version: 16.14.18
@ -98,18 +98,18 @@ packages:
'@jridgewell/trace-mapping': 0.3.25 '@jridgewell/trace-mapping': 0.3.25
dev: true dev: true
/@angular-devkit/architect@0.1703.5: /@angular-devkit/architect@0.1703.4:
resolution: {integrity: sha512-j3+9QeXIafuRMtk7N5Cmm/IiMSS/TOaybzfCv/LK+DP3hjEd8f8Az7hPmevUuOArvWNzUvoUeu30GmR3wABydA==} resolution: {integrity: sha512-o+XCMOiMh8tmQGEwcxjAj2/lmUVT7CGSUAM31ydDomVOFFw4CnBvsoyKqQNRC+/AUXvovb2dCegQl/lTAnrwOg==}
engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'}
dependencies: dependencies:
'@angular-devkit/core': 17.3.5 '@angular-devkit/core': 17.3.4
rxjs: 7.8.1 rxjs: 7.8.1
transitivePeerDependencies: transitivePeerDependencies:
- chokidar - chokidar
dev: true dev: true
/@angular-devkit/build-angular@17.3.5(@angular/compiler-cli@17.3.5)(typescript@5.4.5): /@angular-devkit/build-angular@17.3.4(@angular/compiler-cli@17.3.4)(typescript@5.4.5):
resolution: {integrity: sha512-Ju2MkMidJglJq/iWgM9CNbhK7A/2n0LNYPZx+ucb+aOFWvurCQrU4Mt/es6xCsxOEs5OPhjqdva8mxE5FHwzTQ==} resolution: {integrity: sha512-8KieoPrsJcFPoza0gLQ6yebtIb3WdH3j/V1TnAihk4tVpgtdch8tOBE3FP1TnSW3RF+iCsA0I5NO9/4YbEsWtw==}
engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'}
peerDependencies: peerDependencies:
'@angular/compiler-cli': ^17.0.0 '@angular/compiler-cli': ^17.0.0
@ -150,10 +150,10 @@ packages:
optional: true optional: true
dependencies: dependencies:
'@ampproject/remapping': 2.3.0 '@ampproject/remapping': 2.3.0
'@angular-devkit/architect': 0.1703.5 '@angular-devkit/architect': 0.1703.4
'@angular-devkit/build-webpack': 0.1703.5(webpack-dev-server@4.15.1)(webpack@5.90.3) '@angular-devkit/build-webpack': 0.1703.4(webpack-dev-server@4.15.1)(webpack@5.90.3)
'@angular-devkit/core': 17.3.5 '@angular-devkit/core': 17.3.4
'@angular/compiler-cli': 17.3.5(@angular/compiler@17.3.5)(typescript@5.4.5) '@angular/compiler-cli': 17.3.4(@angular/compiler@17.3.4)(typescript@5.4.5)
'@babel/core': 7.24.0 '@babel/core': 7.24.0
'@babel/generator': 7.23.6 '@babel/generator': 7.23.6
'@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-annotate-as-pure': 7.22.5
@ -164,7 +164,7 @@ packages:
'@babel/preset-env': 7.24.0(@babel/core@7.24.0) '@babel/preset-env': 7.24.0(@babel/core@7.24.0)
'@babel/runtime': 7.24.0 '@babel/runtime': 7.24.0
'@discoveryjs/json-ext': 0.5.7 '@discoveryjs/json-ext': 0.5.7
'@ngtools/webpack': 17.3.5(@angular/compiler-cli@17.3.5)(typescript@5.4.5)(webpack@5.90.3) '@ngtools/webpack': 17.3.4(@angular/compiler-cli@17.3.4)(typescript@5.4.5)(webpack@5.90.3)
'@vitejs/plugin-basic-ssl': 1.1.0(vite@5.1.7) '@vitejs/plugin-basic-ssl': 1.1.0(vite@5.1.7)
ansi-colors: 4.1.3 ansi-colors: 4.1.3
autoprefixer: 10.4.18(postcss@8.4.35) autoprefixer: 10.4.18(postcss@8.4.35)
@ -236,14 +236,14 @@ packages:
- webpack-cli - webpack-cli
dev: true dev: true
/@angular-devkit/build-webpack@0.1703.5(webpack-dev-server@4.15.1)(webpack@5.90.3): /@angular-devkit/build-webpack@0.1703.4(webpack-dev-server@4.15.1)(webpack@5.90.3):
resolution: {integrity: sha512-KcoKlWhDP6+2q3laQ6elXLt2QrVxWJFdCPUC9dIm0Tnc997Tal/UVhlDKaZgITYDgDvRFqG+tzNm2uFd8l7h+A==} resolution: {integrity: sha512-9Vsl6rfIH8kF02W7i3tW/aMOT2Ld1zpcok7n7JdL3Pb7oW0SOjt73FN6Ykm/hVig12gsOGJtEsDfQRsnCddmfQ==}
engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'}
peerDependencies: peerDependencies:
webpack: ^5.30.0 webpack: ^5.30.0
webpack-dev-server: ^4.0.0 webpack-dev-server: ^4.0.0
dependencies: dependencies:
'@angular-devkit/architect': 0.1703.5 '@angular-devkit/architect': 0.1703.4
rxjs: 7.8.1 rxjs: 7.8.1
webpack: 5.90.3(esbuild@0.20.1) webpack: 5.90.3(esbuild@0.20.1)
webpack-dev-server: 4.15.1(webpack@5.90.3) webpack-dev-server: 4.15.1(webpack@5.90.3)
@ -251,8 +251,8 @@ packages:
- chokidar - chokidar
dev: true dev: true
/@angular-devkit/core@17.3.5: /@angular-devkit/core@17.3.4:
resolution: {integrity: sha512-iqGv45HVI+yRROoTqQTY0QChYlRCZkFUfIjdfJLegjc6xq9sLtxDr03CWM45BKGG5lSxDOy+qu/pdRvtL3V2eg==} resolution: {integrity: sha512-vE69/Db555NTRPh+LUFO3rAQBbv7QGrK59F7chRggDZKamtCq/FfhEg2O+0BXQnUitOQN6WgQ79+payFYWyCCg==}
engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'}
peerDependencies: peerDependencies:
chokidar: ^3.5.2 chokidar: ^3.5.2
@ -268,11 +268,11 @@ packages:
source-map: 0.7.4 source-map: 0.7.4
dev: true dev: true
/@angular-devkit/schematics@17.3.5: /@angular-devkit/schematics@17.3.4:
resolution: {integrity: sha512-oh/mvpMKxGfk5v9QIB7LfGsDC/iVpmsIAvbb4+1ddCx86EJXdz3xWnVDbUehOd6n7HJXnQrNirWjWvWquM2GhQ==} resolution: {integrity: sha512-Z6801QhIwrMTcKPzdo9si+ZtJkPz8fys0ftOTfTM66+tDECasU7pvk8Dr54WkDY29mdSHzPxpSxAsooEwfxvQQ==}
engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'}
dependencies: dependencies:
'@angular-devkit/core': 17.3.5 '@angular-devkit/core': 17.3.4
jsonc-parser: 3.2.1 jsonc-parser: 3.2.1
magic-string: 0.30.8 magic-string: 0.30.8
ora: 5.4.1 ora: 5.4.1
@ -333,14 +333,14 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@angular-eslint/schematics@17.3.0(@angular/cli@17.3.5)(eslint@8.57.0)(typescript@5.4.5): /@angular-eslint/schematics@17.3.0(@angular/cli@17.3.4)(eslint@8.57.0)(typescript@5.4.5):
resolution: {integrity: sha512-5yssd5EOomxlKt9vN/OXXCTCuI3Pmfj16pkjBDoW0wzC8/M2l5zlXIEfoKumHYv2wtF553LhaMXVYVU35e0lTw==} resolution: {integrity: sha512-5yssd5EOomxlKt9vN/OXXCTCuI3Pmfj16pkjBDoW0wzC8/M2l5zlXIEfoKumHYv2wtF553LhaMXVYVU35e0lTw==}
peerDependencies: peerDependencies:
'@angular/cli': '>= 17.0.0 < 18.0.0' '@angular/cli': '>= 17.0.0 < 18.0.0'
dependencies: dependencies:
'@angular-eslint/eslint-plugin': 17.3.0(eslint@8.57.0)(typescript@5.4.5) '@angular-eslint/eslint-plugin': 17.3.0(eslint@8.57.0)(typescript@5.4.5)
'@angular-eslint/eslint-plugin-template': 17.3.0(eslint@8.57.0)(typescript@5.4.5) '@angular-eslint/eslint-plugin-template': 17.3.0(eslint@8.57.0)(typescript@5.4.5)
'@angular/cli': 17.3.5 '@angular/cli': 17.3.4
'@nx/devkit': 18.2.4(nx@18.2.4) '@nx/devkit': 18.2.4(nx@18.2.4)
ignore: 5.3.1 ignore: 5.3.1
nx: 18.2.4 nx: 18.2.4
@ -381,40 +381,40 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@angular/animations@17.3.5(@angular/core@17.3.5): /@angular/animations@17.3.4(@angular/core@17.3.4):
resolution: {integrity: sha512-hbfCnBxwhYQMKB+9tDcmfvckUtB8LdY1gPST6TZ7CzrWCSPddsnXxqxBZSBjBI6zXvE4FOV3kUzaUXM/Bq5sRw==} resolution: {integrity: sha512-2nBgXRdTSVPZMueV6ZJjajDRucwJBLxwiVhGafk/nI5MJF0Yss/Jfp2Kfzk5Xw2AqGhz0rd00IyNNUQIzO2mlw==}
engines: {node: ^18.13.0 || >=20.9.0} engines: {node: ^18.13.0 || >=20.9.0}
peerDependencies: peerDependencies:
'@angular/core': 17.3.5 '@angular/core': 17.3.4
dependencies: dependencies:
'@angular/core': 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) '@angular/core': 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
/@angular/cdk@17.3.5(@angular/common@17.3.5)(@angular/core@17.3.5)(rxjs@7.8.1): /@angular/cdk@17.3.4(@angular/common@17.3.4)(@angular/core@17.3.4)(rxjs@7.8.1):
resolution: {integrity: sha512-6y8+yIPWG0wTdPwHIPxKrEFCX1JxxBh4aXcmQnrNTDIvtoEPGaea9SU9XKaU8ahiZMlcpUXqKLG0BVbEhA1Oow==} resolution: {integrity: sha512-/wbKUbc0YC3HGE2TCgW7D07Q99PZ/5uoRvMyWw0/wHa8VLNavXZPecbvtyLs//3HnqoCMSUFE7E2Mrd7jAWfcA==}
peerDependencies: peerDependencies:
'@angular/common': ^17.0.0 || ^18.0.0 '@angular/common': ^17.0.0 || ^18.0.0
'@angular/core': ^17.0.0 || ^18.0.0 '@angular/core': ^17.0.0 || ^18.0.0
rxjs: ^6.5.3 || ^7.4.0 rxjs: ^6.5.3 || ^7.4.0
dependencies: dependencies:
'@angular/common': 17.3.5(@angular/core@17.3.5)(rxjs@7.8.1) '@angular/common': 17.3.4(@angular/core@17.3.4)(rxjs@7.8.1)
'@angular/core': 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) '@angular/core': 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
rxjs: 7.8.1 rxjs: 7.8.1
tslib: 2.6.2 tslib: 2.6.2
optionalDependencies: optionalDependencies:
parse5: 7.1.2 parse5: 7.1.2
dev: false dev: false
/@angular/cli@17.3.5: /@angular/cli@17.3.4:
resolution: {integrity: sha512-6MHJzPKy4uB9qlJO1eKs4rtDlRuCe0lOiz1f3kHFZ/GQQm5xA1xsmZJMN4ASsnu4yU3oZs6vJ/vt8i2/jvdPbA==} resolution: {integrity: sha512-o4oIA2stUwXOur/T/kP3Zr8ZUCB4VYmvjACbsQ3tpzVCFYPeaW9psQagBNJfaBVVDSYL+EacVYBYJR9ZImvcGw==}
engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'}
hasBin: true hasBin: true
dependencies: dependencies:
'@angular-devkit/architect': 0.1703.5 '@angular-devkit/architect': 0.1703.4
'@angular-devkit/core': 17.3.5 '@angular-devkit/core': 17.3.4
'@angular-devkit/schematics': 17.3.5 '@angular-devkit/schematics': 17.3.4
'@schematics/angular': 17.3.5 '@schematics/angular': 17.3.4
'@yarnpkg/lockfile': 1.1.0 '@yarnpkg/lockfile': 1.1.0
ansi-colors: 4.1.3 ansi-colors: 4.1.3
ini: 4.1.2 ini: 4.1.2
@ -435,27 +435,27 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@angular/common@17.3.5(@angular/core@17.3.5)(rxjs@7.8.1): /@angular/common@17.3.4(@angular/core@17.3.4)(rxjs@7.8.1):
resolution: {integrity: sha512-Ox91WxSnOSrQ6I21cHi69EfT2Pxtd5Knb5AsdwpxqE57V2E7EnWMhb+LP+holCtFUhK529EGXCk788M+Elyw6g==} resolution: {integrity: sha512-rEsmtwUMJaNvaimh9hwaHdDLXaOIrjEnYdhmJUvDaKPQaFfSbH3CGGVz9brUyzVJyiWJYkYM0ssxavczeiEe8g==}
engines: {node: ^18.13.0 || >=20.9.0} engines: {node: ^18.13.0 || >=20.9.0}
peerDependencies: peerDependencies:
'@angular/core': 17.3.5 '@angular/core': 17.3.4
rxjs: ^6.5.3 || ^7.4.0 rxjs: ^6.5.3 || ^7.4.0
dependencies: dependencies:
'@angular/core': 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) '@angular/core': 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
rxjs: 7.8.1 rxjs: 7.8.1
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
/@angular/compiler-cli@17.3.5(@angular/compiler@17.3.5)(typescript@5.4.5): /@angular/compiler-cli@17.3.4(@angular/compiler@17.3.4)(typescript@5.4.5):
resolution: {integrity: sha512-R53JNbbVDHWSGdL0e2vGQ5iJCrILOWZ1oemKjekOFB93fUBlEyi+nZmm4uTO7RU8PgjB0UpxI6ok5ZE3Amkt6A==} resolution: {integrity: sha512-TVWjpZSI/GIXTYsmVgEKYjBckcW8Aj62DcxLNehRFR+c7UB95OY3ZFjU8U4jL0XvWPgTkkVWQVq+P6N4KCBsyw==}
engines: {node: ^18.13.0 || >=20.9.0} engines: {node: ^18.13.0 || >=20.9.0}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
'@angular/compiler': 17.3.5 '@angular/compiler': 17.3.4
typescript: '>=5.2 <5.5' typescript: '>=5.2 <5.5'
dependencies: dependencies:
'@angular/compiler': 17.3.5(@angular/core@17.3.5) '@angular/compiler': 17.3.4(@angular/core@17.3.4)
'@babel/core': 7.23.9 '@babel/core': 7.23.9
'@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/sourcemap-codec': 1.4.15
chokidar: 3.6.0 chokidar: 3.6.0
@ -469,20 +469,20 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@angular/compiler@17.3.5(@angular/core@17.3.5): /@angular/compiler@17.3.4(@angular/core@17.3.4):
resolution: {integrity: sha512-lTubBFNlpH9zK46+yeVI7VJQNUELLAB8W1ucndYLCA9Rr9Jop+rYIXijmr42AGokOYr7yLc8HRiSQ5e+X2pUQg==} resolution: {integrity: sha512-YrDClIzgj6nQwiYHrfV6AkT1C5LCDgJh+LICus/2EY1w80j1Qf48Zh4asictReePdVE2Tarq6dnpDh4RW6LenQ==}
engines: {node: ^18.13.0 || >=20.9.0} engines: {node: ^18.13.0 || >=20.9.0}
peerDependencies: peerDependencies:
'@angular/core': 17.3.5 '@angular/core': 17.3.4
peerDependenciesMeta: peerDependenciesMeta:
'@angular/core': '@angular/core':
optional: true optional: true
dependencies: dependencies:
'@angular/core': 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) '@angular/core': 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
tslib: 2.6.2 tslib: 2.6.2
/@angular/core@17.3.5(rxjs@7.8.1)(zone.js@0.14.4): /@angular/core@17.3.4(rxjs@7.8.1)(zone.js@0.14.4):
resolution: {integrity: sha512-y6P27lcrKy3yMx/rtMuGsAnDyVEsS3BdyArTXcD0TOImVGHhVIaB0L95DUCam3ajTe2f2x39eozJZDh7QSpJaw==} resolution: {integrity: sha512-fvhBkfa/DDBzp1UcNzSxHj+Z9DebSS/o9pZpZlbu/0uEiu9hScmScnhaty5E0EbutzHB0SVUCz7zZuDeAywvWg==}
engines: {node: ^18.13.0 || >=20.9.0} engines: {node: ^18.13.0 || >=20.9.0}
peerDependencies: peerDependencies:
rxjs: ^6.5.3 || ^7.4.0 rxjs: ^6.5.3 || ^7.4.0
@ -492,44 +492,44 @@ packages:
tslib: 2.6.2 tslib: 2.6.2
zone.js: 0.14.4 zone.js: 0.14.4
/@angular/forms@17.3.5(@angular/common@17.3.5)(@angular/core@17.3.5)(@angular/platform-browser@17.3.5)(rxjs@7.8.1): /@angular/forms@17.3.4(@angular/common@17.3.4)(@angular/core@17.3.4)(@angular/platform-browser@17.3.4)(rxjs@7.8.1):
resolution: {integrity: sha512-Rf/8XWHdFYZQaOVTJ0QVwxQm9fDqQqIJc0yfPcH/DYL5pT7R0U2z98I5McZawzUBJUo1Zt1gijzDlzNUGf6jiA==} resolution: {integrity: sha512-XWA/FAs0r7VRdztMIfGU9EE0Chj+1U/sDnzJK3ZPO0n8F8oDAEWGJyiw8GIyWTLs+mz43thVIED3DhbRNsXbWw==}
engines: {node: ^18.13.0 || >=20.9.0} engines: {node: ^18.13.0 || >=20.9.0}
peerDependencies: peerDependencies:
'@angular/common': 17.3.5 '@angular/common': 17.3.4
'@angular/core': 17.3.5 '@angular/core': 17.3.4
'@angular/platform-browser': 17.3.5 '@angular/platform-browser': 17.3.4
rxjs: ^6.5.3 || ^7.4.0 rxjs: ^6.5.3 || ^7.4.0
dependencies: dependencies:
'@angular/common': 17.3.5(@angular/core@17.3.5)(rxjs@7.8.1) '@angular/common': 17.3.4(@angular/core@17.3.4)(rxjs@7.8.1)
'@angular/core': 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) '@angular/core': 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
'@angular/platform-browser': 17.3.5(@angular/animations@17.3.5)(@angular/common@17.3.5)(@angular/core@17.3.5) '@angular/platform-browser': 17.3.4(@angular/animations@17.3.4)(@angular/common@17.3.4)(@angular/core@17.3.4)
rxjs: 7.8.1 rxjs: 7.8.1
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
/@angular/language-service@17.3.5: /@angular/language-service@17.3.4:
resolution: {integrity: sha512-s3W5o+pRPU3jNWeeyO4XEdc28+s4MPhew+k0meQfZ11VMdmShzwFu5nPgOMmLB3fBhQqlSBrHUh1P9SB7Hu3FQ==} resolution: {integrity: sha512-CgLg/7P0+NEeGU+vqvoG0rh2ns5iyfi/UO4JTxN1iMjuFBAUhGHxjiItPy8cN2XK/dWgOhXAFe4oqxA4dMBp/Q==}
engines: {node: ^18.13.0 || >=20.9.0} engines: {node: ^18.13.0 || >=20.9.0}
dev: true dev: true
/@angular/material@17.3.5(@angular/animations@17.3.5)(@angular/cdk@17.3.5)(@angular/common@17.3.5)(@angular/core@17.3.5)(@angular/forms@17.3.5)(@angular/platform-browser@17.3.5)(rxjs@7.8.1): /@angular/material@17.3.4(@angular/animations@17.3.4)(@angular/cdk@17.3.4)(@angular/common@17.3.4)(@angular/core@17.3.4)(@angular/forms@17.3.4)(@angular/platform-browser@17.3.4)(rxjs@7.8.1):
resolution: {integrity: sha512-1+QqBQ8HVOwxOkx/v2n53JA9ALOee55yVDbnAv7TkseNN4JEDxOcE5TO5HGmdV2A4tcsXQ00MIdy04jiB4sCng==} resolution: {integrity: sha512-SgCroIlHKt3s9pTEYlhW4ww6Gm1sIzJKuk0wlputPZvQS5PTJ8YY8vDg4QohpQcltlaXCbutt4qw+CBNU9W9iA==}
peerDependencies: peerDependencies:
'@angular/animations': ^17.0.0 || ^18.0.0 '@angular/animations': ^17.0.0 || ^18.0.0
'@angular/cdk': 17.3.5 '@angular/cdk': 17.3.4
'@angular/common': ^17.0.0 || ^18.0.0 '@angular/common': ^17.0.0 || ^18.0.0
'@angular/core': ^17.0.0 || ^18.0.0 '@angular/core': ^17.0.0 || ^18.0.0
'@angular/forms': ^17.0.0 || ^18.0.0 '@angular/forms': ^17.0.0 || ^18.0.0
'@angular/platform-browser': ^17.0.0 || ^18.0.0 '@angular/platform-browser': ^17.0.0 || ^18.0.0
rxjs: ^6.5.3 || ^7.4.0 rxjs: ^6.5.3 || ^7.4.0
dependencies: dependencies:
'@angular/animations': 17.3.5(@angular/core@17.3.5) '@angular/animations': 17.3.4(@angular/core@17.3.4)
'@angular/cdk': 17.3.5(@angular/common@17.3.5)(@angular/core@17.3.5)(rxjs@7.8.1) '@angular/cdk': 17.3.4(@angular/common@17.3.4)(@angular/core@17.3.4)(rxjs@7.8.1)
'@angular/common': 17.3.5(@angular/core@17.3.5)(rxjs@7.8.1) '@angular/common': 17.3.4(@angular/core@17.3.4)(rxjs@7.8.1)
'@angular/core': 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) '@angular/core': 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
'@angular/forms': 17.3.5(@angular/common@17.3.5)(@angular/core@17.3.5)(@angular/platform-browser@17.3.5)(rxjs@7.8.1) '@angular/forms': 17.3.4(@angular/common@17.3.4)(@angular/core@17.3.4)(@angular/platform-browser@17.3.4)(rxjs@7.8.1)
'@angular/platform-browser': 17.3.5(@angular/animations@17.3.5)(@angular/common@17.3.5)(@angular/core@17.3.5) '@angular/platform-browser': 17.3.4(@angular/animations@17.3.4)(@angular/common@17.3.4)(@angular/core@17.3.4)
'@material/animation': 15.0.0-canary.7f224ddd4.0 '@material/animation': 15.0.0-canary.7f224ddd4.0
'@material/auto-init': 15.0.0-canary.7f224ddd4.0 '@material/auto-init': 15.0.0-canary.7f224ddd4.0
'@material/banner': 15.0.0-canary.7f224ddd4.0 '@material/banner': 15.0.0-canary.7f224ddd4.0
@ -581,51 +581,51 @@ packages:
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
/@angular/platform-browser-dynamic@17.3.5(@angular/common@17.3.5)(@angular/compiler@17.3.5)(@angular/core@17.3.5)(@angular/platform-browser@17.3.5): /@angular/platform-browser-dynamic@17.3.4(@angular/common@17.3.4)(@angular/compiler@17.3.4)(@angular/core@17.3.4)(@angular/platform-browser@17.3.4):
resolution: {integrity: sha512-KuS4j3Gh1h/CEj+bIOc/IcZIdiCB/DNbtUvz1eNp1o23aM8QutqelI3A4WBnQuR4yq8Z/8M3FH9F1OVwwhn2QQ==} resolution: {integrity: sha512-S53jPyQtInVYkjdGEFt4dxM1NrHNkWCvXGRsCO7Uh+laDf1OpIDp9YHf49OZohYLajJradN6y4QfdZL6IUwXKA==}
engines: {node: ^18.13.0 || >=20.9.0} engines: {node: ^18.13.0 || >=20.9.0}
peerDependencies: peerDependencies:
'@angular/common': 17.3.5 '@angular/common': 17.3.4
'@angular/compiler': 17.3.5 '@angular/compiler': 17.3.4
'@angular/core': 17.3.5 '@angular/core': 17.3.4
'@angular/platform-browser': 17.3.5 '@angular/platform-browser': 17.3.4
dependencies: dependencies:
'@angular/common': 17.3.5(@angular/core@17.3.5)(rxjs@7.8.1) '@angular/common': 17.3.4(@angular/core@17.3.4)(rxjs@7.8.1)
'@angular/compiler': 17.3.5(@angular/core@17.3.5) '@angular/compiler': 17.3.4(@angular/core@17.3.4)
'@angular/core': 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) '@angular/core': 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
'@angular/platform-browser': 17.3.5(@angular/animations@17.3.5)(@angular/common@17.3.5)(@angular/core@17.3.5) '@angular/platform-browser': 17.3.4(@angular/animations@17.3.4)(@angular/common@17.3.4)(@angular/core@17.3.4)
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
/@angular/platform-browser@17.3.5(@angular/animations@17.3.5)(@angular/common@17.3.5)(@angular/core@17.3.5): /@angular/platform-browser@17.3.4(@angular/animations@17.3.4)(@angular/common@17.3.4)(@angular/core@17.3.4):
resolution: {integrity: sha512-ITlu/GTD64Sr0FMaFCJiHoTJrEZw8qRFXjPjv3BKhAp5dQKcwnCm02o1NOaj5d8oIItIh5fbI2zP0CSU2qNZkQ==} resolution: {integrity: sha512-W2nH9WSQJfdNG4HH9B1Cvj5CTmy9gF3321I+65Tnb8jFmpeljYDBC/VVUhTZUCRpg8udMWeMHEQHuSb8CbozmQ==}
engines: {node: ^18.13.0 || >=20.9.0} engines: {node: ^18.13.0 || >=20.9.0}
peerDependencies: peerDependencies:
'@angular/animations': 17.3.5 '@angular/animations': 17.3.4
'@angular/common': 17.3.5 '@angular/common': 17.3.4
'@angular/core': 17.3.5 '@angular/core': 17.3.4
peerDependenciesMeta: peerDependenciesMeta:
'@angular/animations': '@angular/animations':
optional: true optional: true
dependencies: dependencies:
'@angular/animations': 17.3.5(@angular/core@17.3.5) '@angular/animations': 17.3.4(@angular/core@17.3.4)
'@angular/common': 17.3.5(@angular/core@17.3.5)(rxjs@7.8.1) '@angular/common': 17.3.4(@angular/core@17.3.4)(rxjs@7.8.1)
'@angular/core': 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) '@angular/core': 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
/@angular/router@17.3.5(@angular/common@17.3.5)(@angular/core@17.3.5)(@angular/platform-browser@17.3.5)(rxjs@7.8.1): /@angular/router@17.3.4(@angular/common@17.3.4)(@angular/core@17.3.4)(@angular/platform-browser@17.3.4)(rxjs@7.8.1):
resolution: {integrity: sha512-KsIIs3t9IpxsdMSrJDZzO5WgIWkVE6Ep5WWiSyPIgEfA+ndGpJLmyv0d/r1yKKlYUJxz7Hde55o4thgT2n2x/A==} resolution: {integrity: sha512-B1zjUYyhN66dp47zdF96NRwo0dEdM5In4Ob8HN64PAbnaK3y1EPp31aN6EGernPvKum1ibgwSZw+Uwnbkuv7Ww==}
engines: {node: ^18.13.0 || >=20.9.0} engines: {node: ^18.13.0 || >=20.9.0}
peerDependencies: peerDependencies:
'@angular/common': 17.3.5 '@angular/common': 17.3.4
'@angular/core': 17.3.5 '@angular/core': 17.3.4
'@angular/platform-browser': 17.3.5 '@angular/platform-browser': 17.3.4
rxjs: ^6.5.3 || ^7.4.0 rxjs: ^6.5.3 || ^7.4.0
dependencies: dependencies:
'@angular/common': 17.3.5(@angular/core@17.3.5)(rxjs@7.8.1) '@angular/common': 17.3.4(@angular/core@17.3.4)(rxjs@7.8.1)
'@angular/core': 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) '@angular/core': 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
'@angular/platform-browser': 17.3.5(@angular/animations@17.3.5)(@angular/common@17.3.5)(@angular/core@17.3.5) '@angular/platform-browser': 17.3.4(@angular/animations@17.3.4)(@angular/common@17.3.4)(@angular/core@17.3.4)
rxjs: 7.8.1 rxjs: 7.8.1
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
@ -2470,26 +2470,26 @@ packages:
'@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/sourcemap-codec': 1.4.15
dev: true dev: true
/@kangaroo-and-rabbit/kar-cw@0.2.1(@angular/common@17.3.5)(@angular/compiler@17.3.5)(@angular/core@17.3.5)(@angular/forms@17.3.5)(@angular/platform-browser-dynamic@17.3.5)(@angular/platform-browser@17.3.5)(@angular/router@17.3.5)(rxjs@7.8.1)(zone.js@0.14.4): /@kangaroo-and-rabbit/kar-cw@0.2.0(@angular/common@17.3.4)(@angular/compiler@17.3.4)(@angular/core@17.3.4)(@angular/forms@17.3.4)(@angular/platform-browser-dynamic@17.3.4)(@angular/platform-browser@17.3.4)(@angular/router@17.3.4)(rxjs@7.8.1)(zone.js@0.14.4):
resolution: {integrity: sha512-gxvT5xRyXM7Ht0KV5VQcyqfUj14ufqzh0saImFTxXN/FdGCbZhyQ5pd45COLYAyXoHYiJSrKi3WFMfX9ottIUQ==, tarball: https://gitea.atria-soft.org/api/packages/kangaroo-and-rabbit/npm/%40kangaroo-and-rabbit%2Fkar-cw/-/0.2.1/kar-cw-0.2.1.tgz} resolution: {integrity: sha512-Wg58CD4Mfh96rIWNBjRevBWcIBREJTqkqEelOIDfnrPQru8Gr0kovMccAvXDvBGEeklRSS8Oyg/Y5DuZLWlS2A==, tarball: https://gitea.atria-soft.org/api/packages/kangaroo-and-rabbit/npm/%40kangaroo-and-rabbit%2Fkar-cw/-/0.2.0/kar-cw-0.2.0.tgz}
peerDependencies: peerDependencies:
'@angular/common': ^17.3.4 '@angular/common': ^17.3.3
'@angular/compiler': ^17.3.4 '@angular/compiler': ^17.3.3
'@angular/core': ^17.3.4 '@angular/core': ^17.3.3
'@angular/forms': ^17.3.4 '@angular/forms': ^17.3.3
'@angular/platform-browser': ^17.3.4 '@angular/platform-browser': ^17.3.3
'@angular/platform-browser-dynamic': ^17.3.4 '@angular/platform-browser-dynamic': ^17.3.3
'@angular/router': ^17.3.4 '@angular/router': ^17.3.3
rxjs: ~7.8.0 rxjs: ~7.8.0
zone.js: ~0.14.3 zone.js: ~0.14.3
dependencies: dependencies:
'@angular/common': 17.3.5(@angular/core@17.3.5)(rxjs@7.8.1) '@angular/common': 17.3.4(@angular/core@17.3.4)(rxjs@7.8.1)
'@angular/compiler': 17.3.5(@angular/core@17.3.5) '@angular/compiler': 17.3.4(@angular/core@17.3.4)
'@angular/core': 17.3.5(rxjs@7.8.1)(zone.js@0.14.4) '@angular/core': 17.3.4(rxjs@7.8.1)(zone.js@0.14.4)
'@angular/forms': 17.3.5(@angular/common@17.3.5)(@angular/core@17.3.5)(@angular/platform-browser@17.3.5)(rxjs@7.8.1) '@angular/forms': 17.3.4(@angular/common@17.3.4)(@angular/core@17.3.4)(@angular/platform-browser@17.3.4)(rxjs@7.8.1)
'@angular/platform-browser': 17.3.5(@angular/animations@17.3.5)(@angular/common@17.3.5)(@angular/core@17.3.5) '@angular/platform-browser': 17.3.4(@angular/animations@17.3.4)(@angular/common@17.3.4)(@angular/core@17.3.4)
'@angular/platform-browser-dynamic': 17.3.5(@angular/common@17.3.5)(@angular/compiler@17.3.5)(@angular/core@17.3.5)(@angular/platform-browser@17.3.5) '@angular/platform-browser-dynamic': 17.3.4(@angular/common@17.3.4)(@angular/compiler@17.3.4)(@angular/core@17.3.4)(@angular/platform-browser@17.3.4)
'@angular/router': 17.3.5(@angular/common@17.3.5)(@angular/core@17.3.5)(@angular/platform-browser@17.3.5)(rxjs@7.8.1) '@angular/router': 17.3.4(@angular/common@17.3.4)(@angular/core@17.3.4)(@angular/platform-browser@17.3.4)(rxjs@7.8.1)
rxjs: 7.8.1 rxjs: 7.8.1
tslib: 2.6.2 tslib: 2.6.2
zone.js: 0.14.4 zone.js: 0.14.4
@ -3158,15 +3158,15 @@ packages:
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
/@ngtools/webpack@17.3.5(@angular/compiler-cli@17.3.5)(typescript@5.4.5)(webpack@5.90.3): /@ngtools/webpack@17.3.4(@angular/compiler-cli@17.3.4)(typescript@5.4.5)(webpack@5.90.3):
resolution: {integrity: sha512-0heI0yHUckdGI8uywu/wkp24KR/tdYMKYJOaYIU+9JydyN1zJRpbR7x0thddl7+k/zu2ZGbfFdv1779Ecw/xdA==} resolution: {integrity: sha512-3uNX4tRTKPm91mSQcnmQtqDMMKLGDevJERSPJU7hlOXZZ05QrT4et1mwvXNYYMpXqi2OkC7D4ryIS2YxAiItBA==}
engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'}
peerDependencies: peerDependencies:
'@angular/compiler-cli': ^17.0.0 '@angular/compiler-cli': ^17.0.0
typescript: '>=5.2 <5.5' typescript: '>=5.2 <5.5'
webpack: ^5.54.0 webpack: ^5.54.0
dependencies: dependencies:
'@angular/compiler-cli': 17.3.5(@angular/compiler@17.3.5)(typescript@5.4.5) '@angular/compiler-cli': 17.3.4(@angular/compiler@17.3.4)(typescript@5.4.5)
typescript: 5.4.5 typescript: 5.4.5
webpack: 5.90.3(esbuild@0.20.1) webpack: 5.90.3(esbuild@0.20.1)
dev: true dev: true
@ -3611,12 +3611,12 @@ packages:
dev: true dev: true
optional: true optional: true
/@schematics/angular@17.3.5: /@schematics/angular@17.3.4:
resolution: {integrity: sha512-SWCK16Eob0K86hpZ3NHmrTS6LSzTlhvnIdf3BXC6nzoiyDhcAS0oJ2Tjdq1opW/PaL1hB7MulcbIhxYln5du0w==} resolution: {integrity: sha512-Rqhp5l76Ej6BOZCHPrvHlA2SBkjv1aHFWAfW9gREke826j46D+fuA0eDAdgeVTz0Fx9e7XM3LdtWsz7CBlV4Ug==}
engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'}
dependencies: dependencies:
'@angular-devkit/core': 17.3.5 '@angular-devkit/core': 17.3.4
'@angular-devkit/schematics': 17.3.5 '@angular-devkit/schematics': 17.3.4
jsonc-parser: 3.2.1 jsonc-parser: 3.2.1
transitivePeerDependencies: transitivePeerDependencies:
- chokidar - chokidar
@ -9806,8 +9806,8 @@ packages:
engines: {node: '>=12.20'} engines: {node: '>=12.20'}
dev: true dev: true
/zod@3.23.0: /zod@3.22.4:
resolution: {integrity: sha512-OFLT+LTocvabn6q76BTwVB0hExEBS0IduTr3cqZyMqEDbOnYmcU+y0tUAYbND4uwclpBGi4I4UUBGzylWpjLGA==} resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==}
dev: false dev: false
/zone.js@0.14.4: /zone.js@0.14.4:

View File

@ -1,6 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
export namespace Front {
}

View File

@ -1,35 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import {
HTTPMimeType,
HTTPRequestModel,
RESTConfig,
RESTRequestJson,
} from "../rest-tools";
import {
HealthResult,
isHealthResult,
} from "../model";
export namespace HealthCheck {
/**
* Get the server state (health)
*/
export function getHealth({
restConfig,
}: {
restConfig: RESTConfig,
}): Promise<HealthResult> {
return RESTRequestJson({
restModel: {
endPoint: "/health_check/",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isHealthResult);
};
}

View File

@ -1,12 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
export * from "./data-resource"
export * from "./front"
export * from "./health-check"
export * from "./media-resource"
export * from "./season-resource"
export * from "./series-resource"
export * from "./type-resource"
export * from "./user-media-advancement-resource"
export * from "./user-resource"

View File

@ -1,93 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import {
HTTPMimeType,
HTTPRequestModel,
RESTConfig,
RESTRequestJson,
} from "../rest-tools";
import { z as zod } from "zod"
import {
Long,
UserKarideo,
UserOut,
ZodUserKarideo,
isUserKarideo,
isUserOut,
} from "../model";
export namespace UserResource {
/**
* Get a specific user data
*/
export function get({
restConfig,
params,
}: {
restConfig: RESTConfig,
params: {
id: Long,
},
}): Promise<UserKarideo> {
return RESTRequestJson({
restModel: {
endPoint: "/users/{id}",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
params,
}, isUserKarideo);
};
/**
* Get the user personal data
*/
export function getMe({
restConfig,
}: {
restConfig: RESTConfig,
}): Promise<UserOut> {
return RESTRequestJson({
restModel: {
endPoint: "/users/me",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isUserOut);
};
export const ZodGetsTypeReturn = zod.array(ZodUserKarideo);
export type GetsTypeReturn = zod.infer<typeof ZodGetsTypeReturn>;
export function isGetsTypeReturn(data: any): data is GetsTypeReturn {
try {
ZodGetsTypeReturn.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGetsTypeReturn' error=${e}`);
return false;
}
}
/**
* Get all the users
*/
export function gets({
restConfig,
}: {
restConfig: RESTConfig,
}): Promise<GetsTypeReturn> {
return RESTRequestJson({
restModel: {
endPoint: "/users/",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isGetsTypeReturn);
};
}

View File

@ -1,71 +1,47 @@
/** /**
* Interface of the server (auto-generated code) * API of the server (auto-generated code)
*/ */
import { import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools"
HTTPMimeType, import {UUID, } from "./model"
HTTPRequestModel,
RESTConfig,
RESTRequestJson,
RESTRequestVoid,
} from "../rest-tools";
import {
UUID,
} from "../model";
export namespace DataResource { export namespace DataResource {
/** /**
* Get back some data from the data environment (with a beautiful name (permit download with basic name) * Insert a new data in the data environment
*/ */
export function retrieveDataFull({ export function uploadFile({ restConfig, data, }: {
restConfig,
queries,
params,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
queries: { data: {
Authorization?: string, file: File,
}, },
params: { }): Promise<void> {
name: string, return RESTRequestVoid({
uuid: UUID,
},
data: string,
}): Promise<object> {
return RESTRequestJson({
restModel: { restModel: {
endPoint: "/data/{uuid}/{name}", endPoint: "/data//upload/",
requestType: HTTPRequestModel.GET, requestType: HTTPRequestModel.POST,
contentType: HTTPMimeType.MULTIPART,
accept: HTTPMimeType.JSON,
}, },
restConfig, restConfig,
params,
queries,
data, data,
}); });
}; };
/** /**
* Get back some data from the data environment * Get back some data from the data environment
*/ */
export function retrieveDataId({ // TODO: unmanaged "Response" type: please specify @AsyncType or considered as 'void'.
restConfig, export function retrieveDataId({ restConfig, queries, params, data, }: {
queries,
params,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
queries: { queries: {
Authorization?: string, Authorization: string,
}, },
params: { params: {
uuid: UUID, id: UUID,
}, },
data: string, data: string,
}): Promise<object> { }): Promise<void> {
return RESTRequestJson({ return RESTRequestVoid({
restModel: { restModel: {
endPoint: "/data/{uuid}", endPoint: "/data/{id}",
requestType: HTTPRequestModel.GET, requestType: HTTPRequestModel.GET,
}, },
restConfig, restConfig,
@ -77,24 +53,20 @@ export namespace DataResource {
/** /**
* Get a thumbnail of from the data environment (if resize is possible) * Get a thumbnail of from the data environment (if resize is possible)
*/ */
export function retrieveDataThumbnailId({ // TODO: unmanaged "Response" type: please specify @AsyncType or considered as 'void'.
restConfig, export function retrieveDataThumbnailId({ restConfig, queries, params, data, }: {
queries,
params,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
queries: { queries: {
Authorization?: string, Authorization: string,
}, },
params: { params: {
uuid: UUID, id: UUID,
}, },
data: string, data: string,
}): Promise<object> { }): Promise<void> {
return RESTRequestJson({ return RESTRequestVoid({
restModel: { restModel: {
endPoint: "/data/thumbnail/{uuid}", endPoint: "/data/thumbnail/{id}",
requestType: HTTPRequestModel.GET, requestType: HTTPRequestModel.GET,
}, },
restConfig, restConfig,
@ -104,24 +76,28 @@ export namespace DataResource {
}); });
}; };
/** /**
* Insert a new data in the data environment * Get back some data from the data environment (with a beautiful name (permit download with basic name)
*/ */
export function uploadFile({ // TODO: unmanaged "Response" type: please specify @AsyncType or considered as 'void'.
restConfig, export function retrieveDataFull({ restConfig, queries, params, data, }: {
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
data: { queries: {
file: File, Authorization: string,
}, },
params: {
name: string,
id: UUID,
},
data: string,
}): Promise<void> { }): Promise<void> {
return RESTRequestVoid({ return RESTRequestVoid({
restModel: { restModel: {
endPoint: "/data//upload/", endPoint: "/data/{id}/{name}",
requestType: HTTPRequestModel.POST, requestType: HTTPRequestModel.GET,
contentType: HTTPMimeType.MULTIPART,
}, },
restConfig, restConfig,
params,
queries,
data, data,
}); });
}; };

View File

@ -0,0 +1,8 @@
/**
* API of the server (auto-generated code)
*/
import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools"
import {} from "./model"
export namespace Front {
}

View File

@ -0,0 +1,23 @@
/**
* API of the server (auto-generated code)
*/
import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools"
import {HealthResult, isHealthResult, } from "./model"
export namespace HealthCheck {
/**
* Get the server state (health)
*/
export function getHealth({ restConfig, }: {
restConfig: RESTConfig,
}): Promise<HealthResult> {
return RESTRequestJson({
restModel: {
endPoint: "/health_check",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isHealthResult);
};
}

View File

@ -1,7 +1,13 @@
/** /**
* Interface of the server (auto-generated code) * Global import of the package
*/ */
export * from "./model"; export * from "./model";
export * from "./api"; export * from "./front";
export * from "./rest-tools"; export * from "./health-check";
export * from "./season-resource";
export * from "./series-resource";
export * from "./type-resource";
export * from "./user-media-advancement-resource";
export * from "./user-resource";
export * from "./media-resource";
export * from "./data-resource";

View File

@ -1,34 +1,34 @@
/** /**
* Interface of the server (auto-generated code) * API of the server (auto-generated code)
*/ */
import { import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools"
HTTPMimeType, import {UUID, Long, Media, isMedia, } from "./model"
HTTPRequestModel,
RESTCallbacks,
RESTConfig,
RESTRequestJson,
RESTRequestVoid,
} from "../rest-tools";
import { z as zod } from "zod"
import {
Long,
Media,
MediaWrite,
UUID,
ZodMedia,
isMedia,
} from "../model";
export namespace MediaResource { export namespace MediaResource {
/** /**
* Get a specific Media with his ID * Remove a specific Media
*/ */
export function get({ export function remove({ restConfig, params, }: {
restConfig: RESTConfig,
params: {
id: Long,
},
}): Promise<void> {
return RESTRequestVoid({
restModel: {
endPoint: "/media/{id}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON,
},
restConfig, restConfig,
params, params,
}: { });
};
/**
* Get a specific Media with his ID
*/
export function get({ restConfig, params, }: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
@ -44,50 +44,15 @@ export namespace MediaResource {
params, params,
}, isMedia); }, isMedia);
}; };
export const ZodGetsTypeReturn = zod.array(ZodMedia);
export type GetsTypeReturn = zod.infer<typeof ZodGetsTypeReturn>;
export function isGetsTypeReturn(data: any): data is GetsTypeReturn {
try {
ZodGetsTypeReturn.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGetsTypeReturn' error=${e}`);
return false;
}
}
/**
* Get all Media
*/
export function gets({
restConfig,
}: {
restConfig: RESTConfig,
}): Promise<GetsTypeReturn> {
return RESTRequestJson({
restModel: {
endPoint: "/media/",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isGetsTypeReturn);
};
/** /**
* Modify a specific Media * Modify a specific Media
*/ */
export function patch({ export function patch({ restConfig, params, data, }: {
restConfig,
params,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
}, },
data: MediaWrite, data: Media,
}): Promise<Media> { }): Promise<Media> {
return RESTRequestJson({ return RESTRequestJson({
restModel: { restModel: {
@ -102,60 +67,24 @@ export namespace MediaResource {
}, isMedia); }, isMedia);
}; };
/** /**
* Remove a specific Media * Get all Media
*/ */
export function remove({ export function gets({ restConfig, }: {
restConfig,
params,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { }): Promise<Media[]> {
id: Long, return RESTRequestJsonArray({
},
}): Promise<void> {
return RESTRequestVoid({
restModel: { restModel: {
endPoint: "/media/{id}", endPoint: "/media",
requestType: HTTPRequestModel.DELETE, requestType: HTTPRequestModel.GET,
contentType: HTTPMimeType.TEXT_PLAIN,
},
restConfig,
params,
});
};
/**
* Remove a specific cover of a media
*/
export function removeCover({
restConfig,
params,
}: {
restConfig: RESTConfig,
params: {
coverId: UUID,
id: Long,
},
}): Promise<Media> {
return RESTRequestJson({
restModel: {
endPoint: "/media/{id}/cover/{coverId}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON, accept: HTTPMimeType.JSON,
}, },
restConfig, restConfig,
params,
}, isMedia); }, isMedia);
}; };
/** /**
* Upload a new season cover media * Upload a new season cover media
*/ */
export function uploadCover({ export function uploadCover({ restConfig, params, data, callback, }: {
restConfig,
params,
data,
callback,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
@ -179,14 +108,31 @@ export namespace MediaResource {
callback, callback,
}, isMedia); }, isMedia);
}; };
/**
* Remove a specific cover of a media
*/
export function removeCover({ restConfig, params, }: {
restConfig: RESTConfig,
params: {
coverId: UUID,
id: Long,
},
}): Promise<Media> {
return RESTRequestJson({
restModel: {
endPoint: "/media/{id}/cover/{coverId}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON,
},
restConfig,
params,
}, isMedia);
};
/** /**
* Create a new Media * Create a new Media
*/ */
export function uploadFile({ export function uploadFile({ restConfig, data, callback, }: {
restConfig,
data,
callback,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
data: { data: {
fileName: string, fileName: string,
@ -202,7 +148,7 @@ export namespace MediaResource {
}): Promise<Media> { }): Promise<Media> {
return RESTRequestJson({ return RESTRequestJson({
restModel: { restModel: {
endPoint: "/media/", endPoint: "/media",
requestType: HTTPRequestModel.POST, requestType: HTTPRequestModel.POST,
contentType: HTTPMimeType.MULTIPART, contentType: HTTPMimeType.MULTIPART,
accept: HTTPMimeType.JSON, accept: HTTPMimeType.JSON,

View File

@ -0,0 +1,435 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const ZodUUID = zod.string().uuid();
export type UUID = zod.infer<typeof ZodUUID>;
export function isUUID(data: any): data is UUID {
try {
ZodUUID.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodLong = zod.number();
export type Long = zod.infer<typeof ZodLong>;
export function isLong(data: any): data is Long {
try {
ZodLong.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodInteger = zod.number().safe();
export type Integer = zod.infer<typeof ZodInteger>;
export function isInteger(data: any): data is Integer {
try {
ZodInteger.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodFloat = zod.number();
export type Float = zod.infer<typeof ZodFloat>;
export function isFloat(data: any): data is Float {
try {
ZodFloat.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodInstant = zod.string();
export type Instant = zod.infer<typeof ZodInstant>;
export function isInstant(data: any): data is Instant {
try {
ZodInstant.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodDate = zod.date();
export type Date = zod.infer<typeof ZodDate>;
export function isDate(data: any): data is Date {
try {
ZodDate.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodTimestamp = zod.date();
export type Timestamp = zod.infer<typeof ZodTimestamp>;
export function isTimestamp(data: any): data is Timestamp {
try {
ZodTimestamp.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodLocalDate = zod.date();
export type LocalDate = zod.infer<typeof ZodLocalDate>;
export function isLocalDate(data: any): data is LocalDate {
try {
ZodLocalDate.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodLocalTime = zod.date();
export type LocalTime = zod.infer<typeof ZodLocalTime>;
export function isLocalTime(data: any): data is LocalTime {
try {
ZodLocalTime.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodRestErrorResponse = zod.object({
uuid: ZodUUID.optional(),
name: zod.string().max(255).optional(),
message: zod.string().max(255).optional(),
time: zod.string().max(255).optional(),
status: ZodInteger,
statusMessage: zod.string().max(255).optional()
});
export type RestErrorResponse = zod.infer<typeof ZodRestErrorResponse>;
export function isRestErrorResponse(data: any): data is RestErrorResponse {
try {
ZodRestErrorResponse.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodHealthResult = zod.object({
});
export type HealthResult = zod.infer<typeof ZodHealthResult>;
export function isHealthResult(data: any): data is HealthResult {
try {
ZodHealthResult.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodGenericTiming = zod.object({
// Create time of the object
createdAt: ZodDate.readonly().optional(),
// When update the object
updatedAt: ZodDate.readonly().optional()
});
export type GenericTiming = zod.infer<typeof ZodGenericTiming>;
export function isGenericTiming(data: any): data is GenericTiming {
try {
ZodGenericTiming.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodGenericData = ZodGenericTiming.extend({
// Unique Id of the object
id: ZodLong.readonly().optional()
});
export type GenericData = zod.infer<typeof ZodGenericData>;
export function isGenericData(data: any): data is GenericData {
try {
ZodGenericData.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodGenericDataSoftDelete = ZodGenericData.extend({
// Deleted state
deleted: zod.boolean().readonly().optional()
});
export type GenericDataSoftDelete = zod.infer<typeof ZodGenericDataSoftDelete>;
export function isGenericDataSoftDelete(data: any): data is GenericDataSoftDelete {
try {
ZodGenericDataSoftDelete.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodSeason = ZodGenericDataSoftDelete.extend({
// Name of the media (this represent the title)
name: zod.string().optional(),
// Description of the media
description: zod.string().optional(),
// series parent ID
parentId: ZodLong.optional(),
// List of Id of the specific covers
covers: zod.array(ZodUUID).optional()
});
export type Season = zod.infer<typeof ZodSeason>;
export function isSeason(data: any): data is Season {
try {
ZodSeason.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodSeries = ZodGenericDataSoftDelete.extend({
// Name of the media (this represent the title)
name: zod.string().optional(),
// Description of the media
description: zod.string().optional(),
// series parent ID
parentId: ZodLong.optional(),
// List of Id of the specific covers
covers: zod.array(ZodUUID).optional()
});
export type Series = zod.infer<typeof ZodSeries>;
export function isSeries(data: any): data is Series {
try {
ZodSeries.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodType = ZodGenericDataSoftDelete.extend({
// Name of the media (this represent the title)
name: zod.string().optional(),
// Description of the media
description: zod.string().optional(),
// List of Id of the specific covers
covers: zod.array(ZodUUID).optional()
});
export type Type = zod.infer<typeof ZodType>;
export function isType(data: any): data is Type {
try {
ZodType.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodUserMediaAdvancement = ZodGenericDataSoftDelete.extend({
// Foreign Key Id of the user
userId: ZodLong.optional(),
// Id of the media
mediaId: ZodLong.optional(),
// Percent of advancement in the media
percent: ZodFloat.optional(),
// Number of second of advancement in the media
time: ZodInteger.optional(),
// Number of time this media has been read
count: ZodInteger.optional()
});
export type UserMediaAdvancement = zod.infer<typeof ZodUserMediaAdvancement>;
export function isUserMediaAdvancement(data: any): data is UserMediaAdvancement {
try {
ZodUserMediaAdvancement.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodMediaInformationsDelta = zod.object({
});
export type MediaInformationsDelta = zod.infer<typeof ZodMediaInformationsDelta>;
export function isMediaInformationsDelta(data: any): data is MediaInformationsDelta {
try {
ZodMediaInformationsDelta.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodUser = ZodGenericDataSoftDelete.extend({
login: zod.string().max(128).optional(),
lastConnection: ZodTimestamp.optional(),
admin: zod.boolean(),
blocked: zod.boolean(),
removed: zod.boolean(),
covers: zod.array(ZodLong).optional()
});
export type User = zod.infer<typeof ZodUser>;
export function isUser(data: any): data is User {
try {
ZodUser.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodUserKarideo = ZodUser.extend({
});
export type UserKarideo = zod.infer<typeof ZodUserKarideo>;
export function isUserKarideo(data: any): data is UserKarideo {
try {
ZodUserKarideo.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodUserOut = zod.object({
id: ZodLong,
login: zod.string().max(255).optional()
});
export type UserOut = zod.infer<typeof ZodUserOut>;
export function isUserOut(data: any): data is UserOut {
try {
ZodUserOut.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodMedia = ZodGenericDataSoftDelete.extend({
name: zod.string().optional(),
description: zod.string().optional(),
dataId: ZodUUID.optional(),
typeId: ZodLong.optional(),
seriesId: ZodLong.optional(),
seasonId: ZodLong.optional(),
episode: ZodInteger.optional(),
date: ZodInteger.optional(),
time: ZodInteger.optional(),
ageLimit: ZodInteger.optional(),
covers: zod.array(ZodUUID).optional()
});
export type Media = zod.infer<typeof ZodMedia>;
export function isMedia(data: any): data is Media {
try {
ZodMedia.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodUUIDGenericData = ZodGenericTiming.extend({
// Unique UUID of the object
id: ZodUUID.readonly().optional()
});
export type UUIDGenericData = zod.infer<typeof ZodUUIDGenericData>;
export function isUUIDGenericData(data: any): data is UUIDGenericData {
try {
ZodUUIDGenericData.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodUUIDGenericDataSoftDelete = ZodUUIDGenericData.extend({
// Deleted state
deleted: zod.boolean().readonly().optional()
});
export type UUIDGenericDataSoftDelete = zod.infer<typeof ZodUUIDGenericDataSoftDelete>;
export function isUUIDGenericDataSoftDelete(data: any): data is UUIDGenericDataSoftDelete {
try {
ZodUUIDGenericDataSoftDelete.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}
export const ZodData = ZodUUIDGenericDataSoftDelete.extend({
// Sha512 of the data
sha512: zod.string().max(128).optional(),
// Mime -type of the media
mimeType: zod.string().max(128).optional(),
// Size in Byte of the data
size: ZodLong.optional()
});
export type Data = zod.infer<typeof ZodData>;
export function isData(data: any): data is Data {
try {
ZodData.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data ${e}`);
return false;
}
}

View File

@ -1,8 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const ZodFloat = zod.number();
export type Float = zod.infer<typeof ZodFloat>;

View File

@ -1,46 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodGenericData} from "./generic-data";
export const ZodGenericDataSoftDelete = ZodGenericData.extend({
/**
* Deleted state
*/
deleted: zod.boolean().readonly().optional(),
});
export type GenericDataSoftDelete = zod.infer<typeof ZodGenericDataSoftDelete>;
export function isGenericDataSoftDelete(data: any): data is GenericDataSoftDelete {
try {
ZodGenericDataSoftDelete.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGenericDataSoftDelete' error=${e}`);
return false;
}
}
export const ZodGenericDataSoftDeleteWrite = ZodGenericDataSoftDelete.omit({
deleted: true,
id: true,
createdAt: true,
updatedAt: true,
}).partial();
export type GenericDataSoftDeleteWrite = zod.infer<typeof ZodGenericDataSoftDeleteWrite>;
export function isGenericDataSoftDeleteWrite(data: any): data is GenericDataSoftDeleteWrite {
try {
ZodGenericDataSoftDeleteWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGenericDataSoftDeleteWrite' error=${e}`);
return false;
}
}

View File

@ -1,46 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodLong} from "./long";
import {ZodGenericTiming} from "./generic-timing";
export const ZodGenericData = ZodGenericTiming.extend({
/**
* Unique Id of the object
*/
id: ZodLong.readonly(),
});
export type GenericData = zod.infer<typeof ZodGenericData>;
export function isGenericData(data: any): data is GenericData {
try {
ZodGenericData.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGenericData' error=${e}`);
return false;
}
}
export const ZodGenericDataWrite = ZodGenericData.omit({
id: true,
createdAt: true,
updatedAt: true,
}).partial();
export type GenericDataWrite = zod.infer<typeof ZodGenericDataWrite>;
export function isGenericDataWrite(data: any): data is GenericDataWrite {
try {
ZodGenericDataWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGenericDataWrite' error=${e}`);
return false;
}
}

View File

@ -1,48 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodIsoDate} from "./iso-date";
export const ZodGenericTiming = zod.object({
/**
* Create time of the object
*/
createdAt: ZodIsoDate.readonly().optional(),
/**
* When update the object
*/
updatedAt: ZodIsoDate.readonly().optional(),
});
export type GenericTiming = zod.infer<typeof ZodGenericTiming>;
export function isGenericTiming(data: any): data is GenericTiming {
try {
ZodGenericTiming.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGenericTiming' error=${e}`);
return false;
}
}
export const ZodGenericTimingWrite = ZodGenericTiming.omit({
createdAt: true,
updatedAt: true,
}).partial();
export type GenericTimingWrite = zod.infer<typeof ZodGenericTimingWrite>;
export function isGenericTimingWrite(data: any): data is GenericTimingWrite {
try {
ZodGenericTimingWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGenericTimingWrite' error=${e}`);
return false;
}
}

View File

@ -1,35 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const ZodHealthResult = zod.object({
});
export type HealthResult = zod.infer<typeof ZodHealthResult>;
export function isHealthResult(data: any): data is HealthResult {
try {
ZodHealthResult.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodHealthResult' error=${e}`);
return false;
}
}
export const ZodHealthResultWrite = ZodHealthResult.partial();
export type HealthResultWrite = zod.infer<typeof ZodHealthResultWrite>;
export function isHealthResultWrite(data: any): data is HealthResultWrite {
try {
ZodHealthResultWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodHealthResultWrite' error=${e}`);
return false;
}
}

View File

@ -1,24 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
export * from "./float"
export * from "./generic-data"
export * from "./generic-data-soft-delete"
export * from "./generic-timing"
export * from "./health-result"
export * from "./int"
export * from "./integer"
export * from "./iso-date"
export * from "./long"
export * from "./media"
export * from "./media-informations-delta"
export * from "./rest-error-response"
export * from "./season"
export * from "./series"
export * from "./timestamp"
export * from "./type"
export * from "./user"
export * from "./user-karideo"
export * from "./user-media-advancement"
export * from "./user-out"
export * from "./uuid"

View File

@ -1,35 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const Zodint = zod.object({
});
export type int = zod.infer<typeof Zodint>;
export function isint(data: any): data is int {
try {
Zodint.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='Zodint' error=${e}`);
return false;
}
}
export const ZodintWrite = Zodint.partial();
export type intWrite = zod.infer<typeof ZodintWrite>;
export function isintWrite(data: any): data is intWrite {
try {
ZodintWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodintWrite' error=${e}`);
return false;
}
}

View File

@ -1,8 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const ZodInteger = zod.number().safe();
export type Integer = zod.infer<typeof ZodInteger>;

View File

@ -1,8 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const ZodIsoDate = zod.string().datetime({ precision: 3 });
export type IsoDate = zod.infer<typeof ZodIsoDate>;

View File

@ -1,8 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const ZodLong = zod.number();
export type Long = zod.infer<typeof ZodLong>;

View File

@ -1,35 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const ZodMediaInformationsDelta = zod.object({
});
export type MediaInformationsDelta = zod.infer<typeof ZodMediaInformationsDelta>;
export function isMediaInformationsDelta(data: any): data is MediaInformationsDelta {
try {
ZodMediaInformationsDelta.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodMediaInformationsDelta' error=${e}`);
return false;
}
}
export const ZodMediaInformationsDeltaWrite = ZodMediaInformationsDelta.partial();
export type MediaInformationsDeltaWrite = zod.infer<typeof ZodMediaInformationsDeltaWrite>;
export function isMediaInformationsDeltaWrite(data: any): data is MediaInformationsDeltaWrite {
try {
ZodMediaInformationsDeltaWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodMediaInformationsDeltaWrite' error=${e}`);
return false;
}
}

View File

@ -1,86 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodUUID} from "./uuid";
import {ZodLong} from "./long";
import {ZodInteger} from "./integer";
import {ZodGenericDataSoftDelete} from "./generic-data-soft-delete";
export const ZodMedia = ZodGenericDataSoftDelete.extend({
/**
* Name of the media (this represent the title)
*/
name: zod.string(),
/**
* Description of the media
*/
description: zod.string().optional(),
/**
* Foreign Key Id of the data
*/
dataId: ZodUUID,
/**
* Type of the media
*/
typeId: ZodLong.optional(),
/**
* Series reference of the media
*/
seriesId: ZodLong.optional(),
/**
* Season reference of the media
*/
seasonId: ZodLong.optional(),
/**
* Episode Id
*/
episode: ZodInteger.optional(),
date: ZodInteger.optional(),
/**
* Creation years of the media
*/
time: ZodInteger.optional(),
/**
* Limitation Age of the media
*/
ageLimit: ZodInteger.optional(),
/**
* List of Id of the specific covers
*/
covers: zod.array(ZodUUID),
});
export type Media = zod.infer<typeof ZodMedia>;
export function isMedia(data: any): data is Media {
try {
ZodMedia.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodMedia' error=${e}`);
return false;
}
}
export const ZodMediaWrite = ZodMedia.omit({
deleted: true,
id: true,
createdAt: true,
updatedAt: true,
}).partial();
export type MediaWrite = zod.infer<typeof ZodMediaWrite>;
export function isMediaWrite(data: any): data is MediaWrite {
try {
ZodMediaWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodMediaWrite' error=${e}`);
return false;
}
}

View File

@ -1,43 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodUUID} from "./uuid";
import {Zodint} from "./int";
export const ZodRestErrorResponse = zod.object({
uuid: ZodUUID.optional(),
name: zod.string(),
message: zod.string(),
time: zod.string(),
status: Zodint,
statusMessage: zod.string(),
});
export type RestErrorResponse = zod.infer<typeof ZodRestErrorResponse>;
export function isRestErrorResponse(data: any): data is RestErrorResponse {
try {
ZodRestErrorResponse.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodRestErrorResponse' error=${e}`);
return false;
}
}
export const ZodRestErrorResponseWrite = ZodRestErrorResponse.partial();
export type RestErrorResponseWrite = zod.infer<typeof ZodRestErrorResponseWrite>;
export function isRestErrorResponseWrite(data: any): data is RestErrorResponseWrite {
try {
ZodRestErrorResponseWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodRestErrorResponseWrite' error=${e}`);
return false;
}
}

View File

@ -1,60 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodLong} from "./long";
import {ZodUUID} from "./uuid";
import {ZodGenericDataSoftDelete} from "./generic-data-soft-delete";
export const ZodSeason = ZodGenericDataSoftDelete.extend({
/**
* Name of the media (this represent the title)
*/
name: zod.string(),
/**
* Description of the media
*/
description: zod.string().optional(),
/**
* series parent ID
*/
parentId: ZodLong,
/**
* List of Id of the specific covers
*/
covers: zod.array(ZodUUID),
});
export type Season = zod.infer<typeof ZodSeason>;
export function isSeason(data: any): data is Season {
try {
ZodSeason.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodSeason' error=${e}`);
return false;
}
}
export const ZodSeasonWrite = ZodSeason.omit({
deleted: true,
id: true,
createdAt: true,
updatedAt: true,
}).partial();
export type SeasonWrite = zod.infer<typeof ZodSeasonWrite>;
export function isSeasonWrite(data: any): data is SeasonWrite {
try {
ZodSeasonWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodSeasonWrite' error=${e}`);
return false;
}
}

View File

@ -1,60 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodLong} from "./long";
import {ZodUUID} from "./uuid";
import {ZodGenericDataSoftDelete} from "./generic-data-soft-delete";
export const ZodSeries = ZodGenericDataSoftDelete.extend({
/**
* Name of the media (this represent the title)
*/
name: zod.string(),
/**
* Description of the media
*/
description: zod.string().optional(),
/**
* series parent ID
*/
parentId: ZodLong,
/**
* List of Id of the specific covers
*/
covers: zod.array(ZodUUID),
});
export type Series = zod.infer<typeof ZodSeries>;
export function isSeries(data: any): data is Series {
try {
ZodSeries.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodSeries' error=${e}`);
return false;
}
}
export const ZodSeriesWrite = ZodSeries.omit({
deleted: true,
id: true,
createdAt: true,
updatedAt: true,
}).partial();
export type SeriesWrite = zod.infer<typeof ZodSeriesWrite>;
export function isSeriesWrite(data: any): data is SeriesWrite {
try {
ZodSeriesWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodSeriesWrite' error=${e}`);
return false;
}
}

View File

@ -1,8 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const ZodTimestamp = zod.string().datetime({ precision: 3 });
export type Timestamp = zod.infer<typeof ZodTimestamp>;

View File

@ -1,55 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodUUID} from "./uuid";
import {ZodGenericDataSoftDelete} from "./generic-data-soft-delete";
export const ZodType = ZodGenericDataSoftDelete.extend({
/**
* Name of the media (this represent the title)
*/
name: zod.string(),
/**
* Description of the media
*/
description: zod.string().optional(),
/**
* List of Id of the specific covers
*/
covers: zod.array(ZodUUID),
});
export type Type = zod.infer<typeof ZodType>;
export function isType(data: any): data is Type {
try {
ZodType.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodType' error=${e}`);
return false;
}
}
export const ZodTypeWrite = ZodType.omit({
deleted: true,
id: true,
createdAt: true,
updatedAt: true,
}).partial();
export type TypeWrite = zod.infer<typeof ZodTypeWrite>;
export function isTypeWrite(data: any): data is TypeWrite {
try {
ZodTypeWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodTypeWrite' error=${e}`);
return false;
}
}

View File

@ -1,42 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodUser} from "./user";
export const ZodUserKarideo = ZodUser.extend({
});
export type UserKarideo = zod.infer<typeof ZodUserKarideo>;
export function isUserKarideo(data: any): data is UserKarideo {
try {
ZodUserKarideo.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodUserKarideo' error=${e}`);
return false;
}
}
export const ZodUserKarideoWrite = ZodUserKarideo.omit({
deleted: true,
id: true,
createdAt: true,
updatedAt: true,
}).partial();
export type UserKarideoWrite = zod.infer<typeof ZodUserKarideoWrite>;
export function isUserKarideoWrite(data: any): data is UserKarideoWrite {
try {
ZodUserKarideoWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodUserKarideoWrite' error=${e}`);
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodLong} from "./long";
import {ZodFloat} from "./float";
import {ZodInteger} from "./integer";
import {ZodGenericDataSoftDelete} from "./generic-data-soft-delete";
export const ZodUserMediaAdvancement = ZodGenericDataSoftDelete.extend({
/**
* Foreign Key Id of the user
*/
userId: ZodLong,
/**
* Id of the media
*/
mediaId: ZodLong,
/**
* Percent of advancement in the media
*/
percent: ZodFloat,
/**
* Number of second of advancement in the media
*/
time: ZodInteger,
/**
* Number of time this media has been read
*/
count: ZodInteger,
});
export type UserMediaAdvancement = zod.infer<typeof ZodUserMediaAdvancement>;
export function isUserMediaAdvancement(data: any): data is UserMediaAdvancement {
try {
ZodUserMediaAdvancement.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodUserMediaAdvancement' error=${e}`);
return false;
}
}
export const ZodUserMediaAdvancementWrite = ZodUserMediaAdvancement.omit({
deleted: true,
id: true,
createdAt: true,
updatedAt: true,
}).partial();
export type UserMediaAdvancementWrite = zod.infer<typeof ZodUserMediaAdvancementWrite>;
export function isUserMediaAdvancementWrite(data: any): data is UserMediaAdvancementWrite {
try {
ZodUserMediaAdvancementWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodUserMediaAdvancementWrite' error=${e}`);
return false;
}
}

View File

@ -1,38 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodLong} from "./long";
export const ZodUserOut = zod.object({
id: ZodLong,
login: zod.string().max(255).optional(),
});
export type UserOut = zod.infer<typeof ZodUserOut>;
export function isUserOut(data: any): data is UserOut {
try {
ZodUserOut.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodUserOut' error=${e}`);
return false;
}
}
export const ZodUserOutWrite = ZodUserOut.partial();
export type UserOutWrite = zod.infer<typeof ZodUserOutWrite>;
export function isUserOutWrite(data: any): data is UserOutWrite {
try {
ZodUserOutWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodUserOutWrite' error=${e}`);
return false;
}
}

View File

@ -1,53 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
import {ZodTimestamp} from "./timestamp";
import {ZodUUID} from "./uuid";
import {ZodGenericDataSoftDelete} from "./generic-data-soft-delete";
export const ZodUser = ZodGenericDataSoftDelete.extend({
login: zod.string().max(128).optional(),
lastConnection: ZodTimestamp.optional(),
admin: zod.boolean(),
blocked: zod.boolean(),
removed: zod.boolean(),
/**
* List of Id of the specific covers
*/
covers: zod.array(ZodUUID).optional(),
});
export type User = zod.infer<typeof ZodUser>;
export function isUser(data: any): data is User {
try {
ZodUser.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodUser' error=${e}`);
return false;
}
}
export const ZodUserWrite = ZodUser.omit({
deleted: true,
id: true,
createdAt: true,
updatedAt: true,
}).partial();
export type UserWrite = zod.infer<typeof ZodUserWrite>;
export function isUserWrite(data: any): data is UserWrite {
try {
ZodUserWrite.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodUserWrite' error=${e}`);
return false;
}
}

View File

@ -1,8 +0,0 @@
/**
* Interface of the server (auto-generated code)
*/
import { z as zod } from "zod";
export const ZodUUID = zod.string().uuid();
export type UUID = zod.infer<typeof ZodUUID>;

View File

@ -4,25 +4,25 @@
* @license MPL-2 * @license MPL-2
*/ */
import { RestErrorResponse, isRestErrorResponse } from "./model"; import { RestErrorResponse } from "./model"
export enum HTTPRequestModel { export enum HTTPRequestModel {
DELETE = "DELETE", DELETE = 'DELETE',
GET = "GET", GET = 'GET',
PATCH = "PATCH", PATCH = 'PATCH',
POST = "POST", POST = 'POST',
PUT = "PUT", PUT = 'PUT',
} }
export enum HTTPMimeType { export enum HTTPMimeType {
ALL = "*/*", ALL = '*/*',
CSV = "text/csv", CSV = 'text/csv',
IMAGE = "image/*", IMAGE = 'image/*',
IMAGE_JPEG = "image/jpeg", IMAGE_JPEG = 'image/jpeg',
IMAGE_PNG = "image/png", IMAGE_PNG = 'image/png',
JSON = "application/json", JSON = 'application/json',
MULTIPART = "multipart/form-data", MULTIPART = 'multipart/form-data',
OCTET_STREAM = "application/octet-stream", OCTET_STREAM = 'application/octet-stream',
TEXT_PLAIN = "text/plain", TEXT_PLAIN = 'text/plain',
} }
export interface RESTConfig { export interface RESTConfig {
@ -50,6 +50,23 @@ export interface ModelResponseHttp {
data: any; data: any;
} }
export function isArrayOf<TYPE>(
data: any,
typeChecker: (subData: any) => subData is TYPE,
length?: number
): data is TYPE[] {
if (!Array.isArray(data)) {
return false;
}
if (!data.every(typeChecker)) {
return false;
}
if (length !== undefined && data.length != length) {
return false;
}
return true;
}
function isNullOrUndefined(data: any): data is undefined | null { function isNullOrUndefined(data: any): data is undefined | null {
return data === undefined || data === null; return data === undefined || data === null;
} }
@ -58,61 +75,48 @@ function isNullOrUndefined(data: any): data is undefined | null {
export type ProgressCallback = (count: number, total: number) => void; export type ProgressCallback = (count: number, total: number) => void;
export interface RESTAbort { export interface RESTAbort {
abort?: () => boolean; abort?: () => boolean
} }
// Rest generic callback have a basic model to upload and download advancement. // Rest generic callback have a basic model to upload and download advancement.
export interface RESTCallbacks { export interface RESTCallbacks {
progressUpload?: ProgressCallback; progressUpload?: ProgressCallback,
progressDownload?: ProgressCallback; progressDownload?: ProgressCallback,
abortHandle?: RESTAbort; abortHandle?: RESTAbort,
} };
export interface RESTRequestType { export interface RESTRequestType {
restModel: RESTModel; restModel: RESTModel,
restConfig: RESTConfig; restConfig: RESTConfig,
data?: any; data?: any,
params?: object; params?: object,
queries?: object; queries?: object,
callback?: RESTCallbacks; callback?: RESTCallbacks,
} };
function replaceAll(input, searchValue, replaceValue) {
return input.split(searchValue).join(replaceValue);
}
function removeTrailingSlashes(input: string): string { function removeTrailingSlashes(input: string): string {
if (isNullOrUndefined(input)) { if (isNullOrUndefined(input)) {
return "undefined"; return "undefined";
} }
return input.replace(/\/+$/, ""); return input.replace(/\/+$/, '');
} }
function removeLeadingSlashes(input: string): string { function removeLeadingSlashes(input: string): string {
if (isNullOrUndefined(input)) { if (isNullOrUndefined(input)) {
return ""; return "";
} }
return input.replace(/^\/+/, ""); return input.replace(/^\/+/, '');
} }
export function RESTUrl({ export function RESTUrl({ restModel, restConfig, params, queries }: RESTRequestType): string {
restModel,
restConfig,
params,
queries,
}: RESTRequestType): string {
// Create the URL PATH: // Create the URL PATH:
let generateUrl = `${removeTrailingSlashes( let generateUrl = `${removeTrailingSlashes(restConfig.server)}/${removeLeadingSlashes(restModel.endPoint)}`;
restConfig.server
)}/${removeLeadingSlashes(restModel.endPoint)}`;
if (params !== undefined) { if (params !== undefined) {
for (let key of Object.keys(params)) { for (let key of Object.keys(params)) {
generateUrl = replaceAll(generateUrl, `{${key}}`, `${params[key]}`); generateUrl = generateUrl.replaceAll(`{${key}}`, `${params[key]}`);
} }
} }
if ( if (queries === undefined && (restConfig.token === undefined || restModel.tokenInUrl !== true)) {
queries === undefined &&
(restConfig.token === undefined || restModel.tokenInUrl !== true)
) {
return generateUrl; return generateUrl;
} }
const searchParams = new URLSearchParams(); const searchParams = new URLSearchParams();
@ -120,8 +124,8 @@ export function RESTUrl({
for (let key of Object.keys(queries)) { for (let key of Object.keys(queries)) {
const value = queries[key]; const value = queries[key];
if (Array.isArray(value)) { if (Array.isArray(value)) {
for (const element of value) { for (let iii = 0; iii < value.length; iii++) {
searchParams.append(`${key}`, `${element}`); searchParams.append(`${key}`, `${value[iii]}`);
} }
} else { } else {
searchParams.append(`${key}`, `${value}`); searchParams.append(`${key}`, `${value}`);
@ -129,43 +133,36 @@ export function RESTUrl({
} }
} }
if (restConfig.token !== undefined && restModel.tokenInUrl === true) { if (restConfig.token !== undefined && restModel.tokenInUrl === true) {
searchParams.append("Authorization", `Bearer ${restConfig.token}`); searchParams.append('Authorization', `Bearer ${restConfig.token}`);
} }
return generateUrl + "?" + searchParams.toString(); return generateUrl + "?" + searchParams.toString();
} }
export function fetchProgress(
generateUrl: string, export function fetchProgress(generateUrl: string, { method, headers, body }: {
{ method: HTTPRequestModel,
method, headers: any,
headers, body: any,
body, }, { progressUpload, progressDownload, abortHandle }: RESTCallbacks): Promise<Response> {
}: { const xhr = {
method: HTTPRequestModel; io: new XMLHttpRequest()
headers: any; }
body: any;
},
{ progressUpload, progressDownload, abortHandle }: RESTCallbacks
): Promise<Response> {
const xhr: {
io?: XMLHttpRequest;
} = {
io: new XMLHttpRequest(),
};
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// Stream the upload progress // Stream the upload progress
if (progressUpload) { if (progressUpload) {
xhr.io?.upload.addEventListener("progress", (dataEvent) => { xhr.io.upload.addEventListener("progress", (dataEvent) => {
if (dataEvent.lengthComputable) { if (dataEvent.lengthComputable) {
//console.log(` ==> has a progress event: ${dataEvent.loaded} / ${dataEvent.total}`);
progressUpload(dataEvent.loaded, dataEvent.total); progressUpload(dataEvent.loaded, dataEvent.total);
} }
}); });
} }
// Stream the download progress // Stream the download progress
if (progressDownload) { if (progressDownload) {
xhr.io?.addEventListener("progress", (dataEvent) => { xhr.io.addEventListener("progress", (dataEvent) => {
if (dataEvent.lengthComputable) { if (dataEvent.lengthComputable) {
progressDownload(dataEvent.loaded, dataEvent.total); //console.log(` ==> download progress:: ${dataEvent.loaded} / ${dataEvent.total}`);
progressUpload(dataEvent.loaded, dataEvent.total);
} }
}); });
} }
@ -176,43 +173,38 @@ export function fetchProgress(
xhr.io.abort(); xhr.io.abort();
return true; return true;
} }
console.log( console.log(`Request abort (FAIL) on the XMLHttpRequest: ${generateUrl}`);
`Request abort (FAIL) on the XMLHttpRequest: ${generateUrl}`
);
return false; return false;
}; }
} }
// Check if we have an internal Fail: // Check if we have an internal Fail:
xhr.io?.addEventListener("error", () => { xhr.io.addEventListener('error', () => {
xhr.io = undefined; xhr.io = undefined;
reject(new TypeError("Failed to fetch")); reject(new TypeError('Failed to fetch'))
}); });
// Capture the end of the stream // Capture the end of the stream
xhr.io?.addEventListener("loadend", () => { xhr.io.addEventListener("loadend", () => {
if (xhr.io?.readyState !== XMLHttpRequest.DONE) { if (xhr.io.readyState !== XMLHttpRequest.DONE) {
//console.log(` ==> READY state`);
return; return;
} }
if (xhr.io?.status === 0) { if (xhr.io.status === 0) {
//the stream has been aborted //the stream has been aborted
reject(new TypeError("Fetch has been aborted")); reject(new TypeError('Fetch has been aborted'));
return; return;
} }
// Stream is ended, transform in a generic response: // Stream is ended, transform in a generic response:
const response = new Response(xhr.io.response, { const response = new Response(xhr.io.response, {
status: xhr.io.status, status: xhr.io.status,
statusText: xhr.io.statusText, statusText: xhr.io.statusText
}); });
const headersArray = replaceAll( const headersArray = xhr.io.getAllResponseHeaders().trim().replaceAll("\r\n", "\n").split('\n');
xhr.io.getAllResponseHeaders().trim(),
"\r\n",
"\n"
).split("\n");
headersArray.forEach(function (header) { headersArray.forEach(function (header) {
const firstColonIndex = header.indexOf(":"); const firstColonIndex = header.indexOf(':');
if (firstColonIndex !== -1) { if (firstColonIndex !== -1) {
const key = header.substring(0, firstColonIndex).trim(); var key = header.substring(0, firstColonIndex).trim();
const value = header.substring(firstColonIndex + 1).trim(); var value = header.substring(firstColonIndex + 1).trim();
response.headers.set(key, value); response.headers.set(key, value);
} else { } else {
response.headers.set(header, ""); response.headers.set(header, "");
@ -221,38 +213,31 @@ export function fetchProgress(
xhr.io = undefined; xhr.io = undefined;
resolve(response); resolve(response);
}); });
xhr.io?.open(method, generateUrl, true); xhr.io.open(method, generateUrl, true);
if (!isNullOrUndefined(headers)) { if (!isNullOrUndefined(headers)) {
for (const [key, value] of Object.entries(headers)) { for (const [key, value] of Object.entries(headers)) {
xhr.io?.setRequestHeader(key, value as string); xhr.io.setRequestHeader(key, value as string);
} }
} }
xhr.io?.send(body); xhr.io.send(body);
}); });
} }
export function RESTRequest({ export function RESTRequest({ restModel, restConfig, data, params, queries, callback }: RESTRequestType): Promise<ModelResponseHttp> {
restModel,
restConfig,
data,
params,
queries,
callback,
}: RESTRequestType): Promise<ModelResponseHttp> {
// Create the URL PATH: // Create the URL PATH:
let generateUrl = RESTUrl({ restModel, restConfig, data, params, queries }); let generateUrl = RESTUrl({ restModel, restConfig, data, params, queries });
let headers: any = {}; let headers: any = {};
if (restConfig.token !== undefined && restModel.tokenInUrl !== true) { if (restConfig.token !== undefined && restModel.tokenInUrl !== true) {
headers["Authorization"] = `Bearer ${restConfig.token}`; headers['Authorization'] = `Bearer ${restConfig.token}`;
} }
if (restModel.accept !== undefined) { if (restModel.accept !== undefined) {
headers["Accept"] = restModel.accept; headers['Accept'] = restModel.accept;
} }
if (restModel.requestType !== HTTPRequestModel.GET) { if (restModel.requestType !== HTTPRequestModel.GET) {
// if Get we have not a content type, the body is empty // if Get we have not a content type, the body is empty
if (restModel.contentType !== HTTPMimeType.MULTIPART) { if (restModel.contentType !== HTTPMimeType.MULTIPART) {
// special case of multi-part ==> no content type otherwise the browser does not set the ";bundary=--****" // special case of multi-part ==> no content type otherwise the browser does not set the ";bundary=--****"
headers["Content-Type"] = restModel.contentType; headers['Content-Type'] = restModel.contentType;
} }
} }
let body = data; let body = data;
@ -263,16 +248,14 @@ export function RESTRequest({
for (const name in data) { for (const name in data) {
formData.append(name, data[name]); formData.append(name, data[name]);
} }
body = formData; body = formData
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let action: undefined | Promise<Response> = undefined; let action: undefined | Promise<Response> = undefined;
if ( if (isNullOrUndefined(callback)
isNullOrUndefined(callback) || || (isNullOrUndefined(callback.progressDownload)
(isNullOrUndefined(callback.progressDownload) && && isNullOrUndefined(callback.progressUpload)
isNullOrUndefined(callback.progressUpload) && && isNullOrUndefined(callback.abortHandle))) {
isNullOrUndefined(callback.abortHandle))
) {
// No information needed: call the generic fetch interface // No information needed: call the generic fetch interface
action = fetch(generateUrl, { action = fetch(generateUrl, {
method: restModel.requestType, method: restModel.requestType,
@ -281,152 +264,99 @@ export function RESTRequest({
}); });
} else { } else {
// need progression information: call old fetch model (XMLHttpRequest) that permit to keep % upload and % download for HTTP1.x // need progression information: call old fetch model (XMLHttpRequest) that permit to keep % upload and % download for HTTP1.x
action = fetchProgress( action = fetchProgress(generateUrl, {
generateUrl,
{
method: restModel.requestType ?? HTTPRequestModel.GET, method: restModel.requestType ?? HTTPRequestModel.GET,
headers, headers,
body, body,
}, }, callback);
callback
);
} }
action action.then((response: Response) => {
.then((response: Response) => {
if (response.status >= 200 && response.status <= 299) { if (response.status >= 200 && response.status <= 299) {
const contentType = response.headers.get("Content-Type"); const contentType = response.headers.get('Content-Type');
if ( if (restModel.accept !== contentType) {
!isNullOrUndefined(restModel.accept) &&
restModel.accept !== contentType
) {
reject({ reject({
name: "Model accept type incompatible",
time: Date().toString(), time: Date().toString(),
status: 901, status: 901,
message: `REST Content type are not compatible: ${restModel.accept} != ${contentType}`, error: `REST check wrong type: ${restModel.accept} != ${contentType}`,
statusMessage: "Fetch error", statusMessage: "Fetch error",
error: "rest-tools.ts Wrong type in the message return type", message: "rest-tools.ts Wrong type in the message return type"
} as RestErrorResponse); } as RestErrorResponse);
} else if (contentType === HTTPMimeType.JSON) { } else if (contentType === HTTPMimeType.JSON) {
response response
.json() .json()
.then((value: any) => { .then((value: any) => {
//console.log(`RECEIVE ==> ${response.status}=${ JSON.stringify(value, null, 2)}`);
resolve({ status: response.status, data: value }); resolve({ status: response.status, data: value });
}) })
.catch((reason: Error) => { .catch((reason: any) => {
reject({ reject({
name: "API serialization error",
time: Date().toString(), time: Date().toString(),
status: 902, status: 902,
message: `REST parse json fail: ${reason}`, error: `REST parse json fail: ${reason}`,
statusMessage: "Fetch parse error", statusMessage: "Fetch parse error",
error: "rest-tools.ts Wrong message model to parse", message: "rest-tools.ts Wrong message model to parse"
} as RestErrorResponse); } as RestErrorResponse);
}); });
} else { } else {
resolve({ status: response.status, data: response.body }); resolve({ status: response.status, data: response.body });
} }
} else { } else {
// the answer is not correct not a 2XX
// clone the response to keep the raw data if case of error:
response
.clone()
.json()
.then((value: any) => {
if (isRestErrorResponse(value)) {
reject(value);
} else {
response
.text()
.then((dataError: string) => {
reject({ reject({
name: "API serialization error",
time: Date().toString(),
status: 903,
message: `REST parse error json with wrong type fail. ${dataError}`,
statusMessage: "Fetch parse error",
error: "rest-tools.ts Wrong message model to parse",
} as RestErrorResponse);
})
.catch((reason: any) => {
reject({
name: "API serialization error",
time: Date().toString(), time: Date().toString(),
status: response.status, status: response.status,
message: `unmanaged error model: ??? with error: ${reason}`, error: `${response.body}`,
statusMessage: "Fetch ERROR parse error", statusMessage: "Fetch code error",
error: "rest-tools.ts Wrong message model to parse", message: "rest-tools.ts Wrong return code"
} as RestErrorResponse); } as RestErrorResponse);
});
} }
}) }).catch((error: any) => {
.catch((reason: Error) => {
response
.text()
.then((dataError: string) => {
reject({ reject({
name: "API serialization error",
time: Date().toString(),
status: response.status,
message: `unmanaged error model: ${dataError} with error: ${reason}`,
statusMessage: "Fetch ERROR TEXT parse error",
error: "rest-tools.ts Wrong message model to parse",
} as RestErrorResponse);
})
.catch((reason: any) => {
reject({
name: "API serialization error",
time: Date().toString(),
status: response.status,
message: `unmanaged error model: ??? with error: ${reason}`,
statusMessage: "Fetch ERROR TEXT FAIL",
error: "rest-tools.ts Wrong message model to parse",
} as RestErrorResponse);
});
});
}
})
.catch((error: Error) => {
if (isRestErrorResponse(error)) {
reject(error);
} else {
reject({
name: "Request fail",
time: Date(), time: Date(),
status: 999, status: 999,
message: error, error: error,
statusMessage: "Fetch catch error", statusMessage: "Fetch catch error",
error: "rest-tools.ts detect an error in the fetch request", message: "rest-tools.ts detect an error in the fetch request"
}); });
}
}); });
}); });
} }
export function RESTRequestJson<TYPE>(
request: RESTRequestType,
checker?: (data: any) => data is TYPE export function RESTRequestJson<TYPE>(request: RESTRequestType, checker: (data: any) => data is TYPE): Promise<TYPE> {
): Promise<TYPE> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
RESTRequest(request) RESTRequest(request).then((value: ModelResponseHttp) => {
.then((value: ModelResponseHttp) => { if (checker(value.data)) {
if (isNullOrUndefined(checker)) {
console.log(`Have no check of MODEL in API: ${RESTUrl(request)}`);
resolve(value.data);
} else if (checker === undefined || checker(value.data)) {
resolve(value.data); resolve(value.data);
} else { } else {
reject({ reject({
name: "Model check fail",
time: Date().toString(), time: Date().toString(),
status: 950, status: 950,
error: "REST Fail to verify the data", error: "REST Fail to verify the data",
statusMessage: "API cast ERROR", statusMessage: "API cast ERROR",
message: "api.ts Check type as fail", message: "api.ts Check type as fail"
} as RestErrorResponse); } as RestErrorResponse);
} }
}) }).catch((reason: RestErrorResponse) => {
.catch((reason: RestErrorResponse) => { reject(reason);
});
});
}
export function RESTRequestJsonArray<TYPE>(request: RESTRequestType, checker: (data: any) => data is TYPE): Promise<TYPE[]> {
return new Promise((resolve, reject) => {
RESTRequest(request).then((value: ModelResponseHttp) => {
if (isArrayOf(value.data, checker)) {
resolve(value.data);
} else {
reject({
time: Date().toString(),
status: 950,
error: "REST Fail to verify the data",
statusMessage: "API cast ERROR",
message: "api.ts Check type as fail"
} as RestErrorResponse);
}
}).catch((reason: RestErrorResponse) => {
reject(reason); reject(reason);
}); });
}); });
@ -434,11 +364,9 @@ export function RESTRequestJson<TYPE>(
export function RESTRequestVoid(request: RESTRequestType): Promise<void> { export function RESTRequestVoid(request: RESTRequestType): Promise<void> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
RESTRequest(request) RESTRequest(request).then((value: ModelResponseHttp) => {
.then((value: ModelResponseHttp) => {
resolve(); resolve();
}) }).catch((reason: RestErrorResponse) => {
.catch((reason: RestErrorResponse) => {
reject(reason); reject(reason);
}); });
}); });

View File

@ -1,34 +1,34 @@
/** /**
* Interface of the server (auto-generated code) * API of the server (auto-generated code)
*/ */
import { import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools"
HTTPMimeType, import {UUID, Long, Season, isSeason, } from "./model"
HTTPRequestModel,
RESTCallbacks,
RESTConfig,
RESTRequestJson,
RESTRequestVoid,
} from "../rest-tools";
import { z as zod } from "zod"
import {
Long,
Season,
SeasonWrite,
UUID,
ZodSeason,
isSeason,
} from "../model";
export namespace SeasonResource { export namespace SeasonResource {
/** /**
* Get all season * Remove a specific season
*/ */
export function get({ export function remove({ restConfig, params, }: {
restConfig: RESTConfig,
params: {
id: Long,
},
}): Promise<void> {
return RESTRequestVoid({
restModel: {
endPoint: "/season/{id}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON,
},
restConfig, restConfig,
params, params,
}: { });
};
/**
* Get all season
*/
export function get({ restConfig, params, }: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
@ -45,50 +45,15 @@ export namespace SeasonResource {
params, params,
}, isSeason); }, isSeason);
}; };
export const ZodGetsTypeReturn = zod.array(ZodSeason);
export type GetsTypeReturn = zod.infer<typeof ZodGetsTypeReturn>;
export function isGetsTypeReturn(data: any): data is GetsTypeReturn {
try {
ZodGetsTypeReturn.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGetsTypeReturn' error=${e}`);
return false;
}
}
/**
* Get a specific Season with his ID
*/
export function gets({
restConfig,
}: {
restConfig: RESTConfig,
}): Promise<GetsTypeReturn> {
return RESTRequestJson({
restModel: {
endPoint: "/season/",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isGetsTypeReturn);
};
/** /**
* Modify a specific season * Modify a specific season
*/ */
export function patch({ export function patch({ restConfig, params, data, }: {
restConfig,
params,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
}, },
data: SeasonWrite, data: Season,
}): Promise<Season> { }): Promise<Season> {
return RESTRequestJson({ return RESTRequestJson({
restModel: { restModel: {
@ -105,16 +70,13 @@ export namespace SeasonResource {
/** /**
* Create a new season * Create a new season
*/ */
export function post({ export function post({ restConfig, data, }: {
restConfig,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
data: SeasonWrite, data: Season,
}): Promise<Season> { }): Promise<Season> {
return RESTRequestJson({ return RESTRequestJson({
restModel: { restModel: {
endPoint: "/season/", endPoint: "/season",
requestType: HTTPRequestModel.POST, requestType: HTTPRequestModel.POST,
contentType: HTTPMimeType.JSON, contentType: HTTPMimeType.JSON,
accept: HTTPMimeType.JSON, accept: HTTPMimeType.JSON,
@ -124,60 +86,24 @@ export namespace SeasonResource {
}, isSeason); }, isSeason);
}; };
/** /**
* Remove a specific season * Get a specific Season with his ID
*/ */
export function remove({ export function gets({ restConfig, }: {
restConfig,
params,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { }): Promise<Season[]> {
id: Long, return RESTRequestJsonArray({
},
}): Promise<void> {
return RESTRequestVoid({
restModel: { restModel: {
endPoint: "/season/{id}", endPoint: "/season",
requestType: HTTPRequestModel.DELETE, requestType: HTTPRequestModel.GET,
contentType: HTTPMimeType.TEXT_PLAIN,
},
restConfig,
params,
});
};
/**
* Remove a specific cover of a season
*/
export function removeCover({
restConfig,
params,
}: {
restConfig: RESTConfig,
params: {
coverId: UUID,
id: Long,
},
}): Promise<Season> {
return RESTRequestJson({
restModel: {
endPoint: "/season/{id}/cover/{coverId}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON, accept: HTTPMimeType.JSON,
}, },
restConfig, restConfig,
params,
}, isSeason); }, isSeason);
}; };
/** /**
* Upload a new season cover season * Upload a new season cover season
*/ */
export function uploadCover({ export function uploadCover({ restConfig, params, data, callback, }: {
restConfig,
params,
data,
callback,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
@ -201,4 +127,25 @@ export namespace SeasonResource {
callback, callback,
}, isSeason); }, isSeason);
}; };
/**
* Remove a specific cover of a season
*/
export function removeCover({ restConfig, params, }: {
restConfig: RESTConfig,
params: {
coverId: UUID,
id: Long,
},
}): Promise<Season> {
return RESTRequestJson({
restModel: {
endPoint: "/season/{id}/cover/{coverId}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON,
},
restConfig,
params,
}, isSeason);
};
} }

View File

@ -1,34 +1,34 @@
/** /**
* Interface of the server (auto-generated code) * API of the server (auto-generated code)
*/ */
import { import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools"
HTTPMimeType, import {UUID, Long, Series, isSeries, } from "./model"
HTTPRequestModel,
RESTCallbacks,
RESTConfig,
RESTRequestJson,
RESTRequestVoid,
} from "../rest-tools";
import { z as zod } from "zod"
import {
Long,
Series,
SeriesWrite,
UUID,
ZodSeries,
isSeries,
} from "../model";
export namespace SeriesResource { export namespace SeriesResource {
/** /**
* Get a specific Series with his ID * Remove a specific Series
*/ */
export function get({ export function remove({ restConfig, params, }: {
restConfig: RESTConfig,
params: {
id: Long,
},
}): Promise<void> {
return RESTRequestVoid({
restModel: {
endPoint: "/series/{id}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON,
},
restConfig, restConfig,
params, params,
}: { });
};
/**
* Get a specific Series with his ID
*/
export function get({ restConfig, params, }: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
@ -45,50 +45,15 @@ export namespace SeriesResource {
params, params,
}, isSeries); }, isSeries);
}; };
export const ZodGetsTypeReturn = zod.array(ZodSeries);
export type GetsTypeReturn = zod.infer<typeof ZodGetsTypeReturn>;
export function isGetsTypeReturn(data: any): data is GetsTypeReturn {
try {
ZodGetsTypeReturn.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGetsTypeReturn' error=${e}`);
return false;
}
}
/**
* Get all Series
*/
export function gets({
restConfig,
}: {
restConfig: RESTConfig,
}): Promise<GetsTypeReturn> {
return RESTRequestJson({
restModel: {
endPoint: "/series/",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isGetsTypeReturn);
};
/** /**
* Modify a specific Series * Modify a specific Series
*/ */
export function patch({ export function patch({ restConfig, params, data, }: {
restConfig,
params,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
}, },
data: SeriesWrite, data: Series,
}): Promise<Series> { }): Promise<Series> {
return RESTRequestJson({ return RESTRequestJson({
restModel: { restModel: {
@ -105,16 +70,13 @@ export namespace SeriesResource {
/** /**
* Create a new Series * Create a new Series
*/ */
export function post({ export function post({ restConfig, data, }: {
restConfig,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
data: SeriesWrite, data: Series,
}): Promise<Series> { }): Promise<Series> {
return RESTRequestJson({ return RESTRequestJson({
restModel: { restModel: {
endPoint: "/series/", endPoint: "/series",
requestType: HTTPRequestModel.POST, requestType: HTTPRequestModel.POST,
contentType: HTTPMimeType.JSON, contentType: HTTPMimeType.JSON,
accept: HTTPMimeType.JSON, accept: HTTPMimeType.JSON,
@ -124,60 +86,24 @@ export namespace SeriesResource {
}, isSeries); }, isSeries);
}; };
/** /**
* Remove a specific Series * Get all Series
*/ */
export function remove({ export function gets({ restConfig, }: {
restConfig,
params,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { }): Promise<Series[]> {
id: Long, return RESTRequestJsonArray({
},
}): Promise<void> {
return RESTRequestVoid({
restModel: { restModel: {
endPoint: "/series/{id}", endPoint: "/series",
requestType: HTTPRequestModel.DELETE, requestType: HTTPRequestModel.GET,
contentType: HTTPMimeType.TEXT_PLAIN,
},
restConfig,
params,
});
};
/**
* Remove a specific Series of a season
*/
export function removeCover({
restConfig,
params,
}: {
restConfig: RESTConfig,
params: {
coverId: UUID,
id: Long,
},
}): Promise<Series> {
return RESTRequestJson({
restModel: {
endPoint: "/series/{id}/cover/{coverId}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON, accept: HTTPMimeType.JSON,
}, },
restConfig, restConfig,
params,
}, isSeries); }, isSeries);
}; };
/** /**
* Upload a new season cover Series * Upload a new season cover Series
*/ */
export function uploadCover({ export function uploadCover({ restConfig, params, data, callback, }: {
restConfig,
params,
data,
callback,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
@ -201,4 +127,25 @@ export namespace SeriesResource {
callback, callback,
}, isSeries); }, isSeries);
}; };
/**
* Remove a specific Series of a season
*/
export function removeCover({ restConfig, params, }: {
restConfig: RESTConfig,
params: {
coverId: UUID,
id: Long,
},
}): Promise<Series> {
return RESTRequestJson({
restModel: {
endPoint: "/series/{id}/cover/{coverId}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON,
},
restConfig,
params,
}, isSeries);
};
} }

View File

@ -1,34 +1,34 @@
/** /**
* Interface of the server (auto-generated code) * API of the server (auto-generated code)
*/ */
import { import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools"
HTTPMimeType, import {UUID, Long, Type, isType, } from "./model"
HTTPRequestModel,
RESTCallbacks,
RESTConfig,
RESTRequestJson,
RESTRequestVoid,
} from "../rest-tools";
import { z as zod } from "zod"
import {
Long,
Type,
TypeWrite,
UUID,
ZodType,
isType,
} from "../model";
export namespace TypeResource { export namespace TypeResource {
/** /**
* Get a specific Type with his ID * Remove a specific Type
*/ */
export function get({ export function remove({ restConfig, params, }: {
restConfig: RESTConfig,
params: {
id: Long,
},
}): Promise<void> {
return RESTRequestVoid({
restModel: {
endPoint: "/type/{id}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON,
},
restConfig, restConfig,
params, params,
}: { });
};
/**
* Get a specific Type with his ID
*/
export function get({ restConfig, params, }: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
@ -45,50 +45,15 @@ export namespace TypeResource {
params, params,
}, isType); }, isType);
}; };
export const ZodGetsTypeReturn = zod.array(ZodType);
export type GetsTypeReturn = zod.infer<typeof ZodGetsTypeReturn>;
export function isGetsTypeReturn(data: any): data is GetsTypeReturn {
try {
ZodGetsTypeReturn.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGetsTypeReturn' error=${e}`);
return false;
}
}
/**
* Get all Type
*/
export function gets({
restConfig,
}: {
restConfig: RESTConfig,
}): Promise<GetsTypeReturn> {
return RESTRequestJson({
restModel: {
endPoint: "/type/",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isGetsTypeReturn);
};
/** /**
* Modify a specific Type * Modify a specific Type
*/ */
export function patch({ export function patch({ restConfig, params, data, }: {
restConfig,
params,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
}, },
data: TypeWrite, data: Type,
}): Promise<Type> { }): Promise<Type> {
return RESTRequestJson({ return RESTRequestJson({
restModel: { restModel: {
@ -105,16 +70,13 @@ export namespace TypeResource {
/** /**
* Create a new Type * Create a new Type
*/ */
export function post({ export function post({ restConfig, data, }: {
restConfig,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
data: TypeWrite, data: Type,
}): Promise<Type> { }): Promise<Type> {
return RESTRequestJson({ return RESTRequestJson({
restModel: { restModel: {
endPoint: "/type/", endPoint: "/type",
requestType: HTTPRequestModel.POST, requestType: HTTPRequestModel.POST,
contentType: HTTPMimeType.JSON, contentType: HTTPMimeType.JSON,
accept: HTTPMimeType.JSON, accept: HTTPMimeType.JSON,
@ -124,60 +86,24 @@ export namespace TypeResource {
}, isType); }, isType);
}; };
/** /**
* Remove a specific Type * Get all Type
*/ */
export function remove({ export function gets({ restConfig, }: {
restConfig,
params,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { }): Promise<Type[]> {
id: Long, return RESTRequestJsonArray({
},
}): Promise<void> {
return RESTRequestVoid({
restModel: { restModel: {
endPoint: "/type/{id}", endPoint: "/type",
requestType: HTTPRequestModel.DELETE, requestType: HTTPRequestModel.GET,
contentType: HTTPMimeType.TEXT_PLAIN,
},
restConfig,
params,
});
};
/**
* Remove a specific cover of a type
*/
export function removeCover({
restConfig,
params,
}: {
restConfig: RESTConfig,
params: {
coverId: UUID,
id: Long,
},
}): Promise<Type> {
return RESTRequestJson({
restModel: {
endPoint: "/type/{id}/cover/{coverId}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON, accept: HTTPMimeType.JSON,
}, },
restConfig, restConfig,
params,
}, isType); }, isType);
}; };
/** /**
* Upload a new season cover Type * Upload a new season cover Type
*/ */
export function uploadCover({ export function uploadCover({ restConfig, params, data, callback, }: {
restConfig,
params,
data,
callback,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
@ -201,4 +127,25 @@ export namespace TypeResource {
callback, callback,
}, isType); }, isType);
}; };
/**
* Remove a specific cover of a type
*/
export function removeCover({ restConfig, params, }: {
restConfig: RESTConfig,
params: {
coverId: UUID,
id: Long,
},
}): Promise<Type> {
return RESTRequestJson({
restModel: {
endPoint: "/type/{id}/cover/{coverId}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON,
},
restConfig,
params,
}, isType);
};
} }

View File

@ -1,32 +1,34 @@
/** /**
* Interface of the server (auto-generated code) * API of the server (auto-generated code)
*/ */
import { import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools"
HTTPMimeType, import {Long, UserMediaAdvancement, MediaInformationsDelta, isUserMediaAdvancement, } from "./model"
HTTPRequestModel,
RESTConfig,
RESTRequestJson,
RESTRequestVoid,
} from "../rest-tools";
import { z as zod } from "zod"
import {
Long,
MediaInformationsDeltaWrite,
UserMediaAdvancement,
ZodUserMediaAdvancement,
isUserMediaAdvancement,
} from "../model";
export namespace UserMediaAdvancementResource { export namespace UserMediaAdvancementResource {
/** /**
* Get a specific user advancement with his ID * Remove a specific user advancement
*/ */
export function get({ export function remove({ restConfig, params, }: {
restConfig: RESTConfig,
params: {
id: Long,
},
}): Promise<void> {
return RESTRequestVoid({
restModel: {
endPoint: "/advancement/{id}",
requestType: HTTPRequestModel.DELETE,
contentType: HTTPMimeType.TEXT_PLAIN,
accept: HTTPMimeType.JSON,
},
restConfig, restConfig,
params, params,
}: { });
};
/**
* Get a specific user advancement with his ID
*/
export function get({ restConfig, params, }: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
@ -42,50 +44,15 @@ export namespace UserMediaAdvancementResource {
params, params,
}, isUserMediaAdvancement); }, isUserMediaAdvancement);
}; };
export const ZodGetsTypeReturn = zod.array(ZodUserMediaAdvancement);
export type GetsTypeReturn = zod.infer<typeof ZodGetsTypeReturn>;
export function isGetsTypeReturn(data: any): data is GetsTypeReturn {
try {
ZodGetsTypeReturn.parse(data);
return true;
} catch (e: any) {
console.log(`Fail to parse data type='ZodGetsTypeReturn' error=${e}`);
return false;
}
}
/**
* Get all user advancement
*/
export function gets({
restConfig,
}: {
restConfig: RESTConfig,
}): Promise<GetsTypeReturn> {
return RESTRequestJson({
restModel: {
endPoint: "/advancement/",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isGetsTypeReturn);
};
/** /**
* Modify a user advancement * Modify a user advancement
*/ */
export function patch({ export function patch({ restConfig, params, data, }: {
restConfig,
params,
data,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { params: {
id: Long, id: Long,
}, },
data: MediaInformationsDeltaWrite, data: MediaInformationsDelta,
}): Promise<UserMediaAdvancement> { }): Promise<UserMediaAdvancement> {
return RESTRequestJson({ return RESTRequestJson({
restModel: { restModel: {
@ -100,25 +67,18 @@ export namespace UserMediaAdvancementResource {
}, isUserMediaAdvancement); }, isUserMediaAdvancement);
}; };
/** /**
* Remove a specific user advancement * Get all user advancement
*/ */
export function remove({ export function gets({ restConfig, }: {
restConfig,
params,
}: {
restConfig: RESTConfig, restConfig: RESTConfig,
params: { }): Promise<UserMediaAdvancement[]> {
id: Long, return RESTRequestJsonArray({
},
}): Promise<void> {
return RESTRequestVoid({
restModel: { restModel: {
endPoint: "/advancement/{id}", endPoint: "/advancement",
requestType: HTTPRequestModel.DELETE, requestType: HTTPRequestModel.GET,
contentType: HTTPMimeType.TEXT_PLAIN, accept: HTTPMimeType.JSON,
}, },
restConfig, restConfig,
params, }, isUserMediaAdvancement);
});
}; };
} }

View File

@ -0,0 +1,57 @@
/**
* API of the server (auto-generated code)
*/
import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools"
import {Long, UserKarideo, UserOut, isUserKarideo, isUserOut, } from "./model"
export namespace UserResource {
/**
* Get a specific user data
*/
export function get({ restConfig, params, }: {
restConfig: RESTConfig,
params: {
id: Long,
},
}): Promise<UserKarideo> {
return RESTRequestJson({
restModel: {
endPoint: "/users/{id}",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
params,
}, isUserKarideo);
};
/**
* Get all the users
*/
export function gets({ restConfig, }: {
restConfig: RESTConfig,
}): Promise<UserKarideo[]> {
return RESTRequestJsonArray({
restModel: {
endPoint: "/users",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isUserKarideo);
};
/**
* Get the user personal data
*/
export function getMe({ restConfig, }: {
restConfig: RESTConfig,
}): Promise<UserOut> {
return RESTRequestJson({
restModel: {
endPoint: "/users/me",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isUserOut);
};
}

View File

@ -1,8 +1,8 @@
<div> <div>
<div class="count-base"> <div class="count-base">
@if(countVideo) { @if(countvideo) {
<div class="count"> <div class="count">
{{countVideo}} {{countvideo}}
</div> </div>
} }
</div> </div>

View File

@ -20,7 +20,7 @@ export class ElementSeriesComponent implements OnInit {
name: string = 'plouf'; name: string = 'plouf';
description: string = ''; description: string = '';
countVideo: number = null; countvideo: number = null;
covers: string[]; covers: string[];
@ -43,9 +43,9 @@ export class ElementSeriesComponent implements OnInit {
this.seriesService.countVideo(this.element.id) this.seriesService.countVideo(this.element.id)
.then((response) => { .then((response) => {
self.countVideo = response; self.countvideo = response;
}).catch((response) => { }).catch((response) => {
self.countVideo = 0; self.countvideo = 0;
}); });
} }
} }

View File

@ -1,8 +1,8 @@
<div> <div>
<div class="count-base"> <div class="count-base">
@if(countVideo) { @if(countvideo) {
<span class="count"> <span class="count">
{{countVideo}} {{countvideo}}
</span> </span>
} }
</div> </div>

View File

@ -23,7 +23,6 @@ export class FileParsedElement {
public nameDetected: boolean = false; public nameDetected: boolean = false;
public episodeDetected: boolean = false; public episodeDetected: boolean = false;
constructor( constructor(
public id: number,
public file: File, public file: File,
public series: string, public series: string,
public season: number, public season: number,
@ -95,7 +94,6 @@ export class UploadScene implements OnInit {
globalSeries: string = ''; globalSeries: string = '';
globalSeason: number = null; globalSeason: number = null;
cancelHandle: RESTAbort = {}; cancelHandle: RESTAbort = {};
dataUniqueId: number = 0;
constructor( constructor(
private MediaService: MediaService, private MediaService: MediaService,
private seasonService: SeasonService, private seasonService: SeasonService,
@ -309,7 +307,7 @@ export class UploadScene implements OnInit {
} }
// remove extension // remove extension
title = title.replace(new RegExp('\\.(mkv|MKV|Mkv|webm|WEBM|Webm|mp4)'), ''); title = title.replace(new RegExp('\\.(mkv|MKV|Mkv|webm|WEBM|Webm|mp4)'), '');
const tmp = new FileParsedElement(this.dataUniqueId++, file, series, season, episode, title); let tmp = new FileParsedElement(file, series, season, episode, title);
console.log(`==>${JSON.stringify(tmp)}`); console.log(`==>${JSON.stringify(tmp)}`);
// add it in the list. // add it in the list.
this.parsedElement.push(tmp); this.parsedElement.push(tmp);

View File

@ -126,21 +126,11 @@
} }
<!--<button (click)="onTakeScreenShoot()"><i class="material-icons">add_a_photo</i></button>--> <!--<button (click)="onTakeScreenShoot()"><i class="material-icons">add_a_photo</i></button>-->
<button (click)="onVolumeMenu()"><i class="material-icons">volume_up</i></button> <button (click)="onVolumeMenu()"><i class="material-icons">volume_up</i></button>
<button class="bigPause" (click)="onPauseToggle()">
@if(!isPlaying) { @if(!isPlaying) {
<i class="material-icons">play_circle_outline</i> <button class="bigPause" (click)="onPauseToggle()"><i class="material-icons">play_circle_outline</i></button>
<button class="bigRewind" (click)="onRewind()"><i class="material-icons">fast_rewind</i></button>
<button class="bigForward" (click)="onForward()"><i class="material-icons">fast_forward</i></button>
} }
</button>
<button class="bigRewind" (click)="onRewind()">
@if(!isPlaying) {
<i class="material-icons">fast_rewind</i>
}
</button>
<button class="bigForward" (click)="onForward()">
@if(!isPlaying) {
<i class="material-icons">fast_forward</i>
}
</button>
</div> </div>
} }
@if(!isFullScreen || !isPlaying) { @if(!isFullScreen || !isPlaying) {

View File

@ -5,9 +5,7 @@
import { Environment } from "@kangaroo-and-rabbit/kar-cw"; import { Environment } from "@kangaroo-and-rabbit/kar-cw";
const serverBaseAddress = 'http://atria-soft.org' const serverSSOAddress = 'http://atria-soft.org'
const serverSSOAddress = `${serverBaseAddress}/karso`
//const serverSSOAddress = 'http://localhost:4200'
const environment_back_prod: Environment = { const environment_back_prod: Environment = {
production: false, production: false,
@ -15,13 +13,13 @@ const environment_back_prod: Environment = {
applName: "karideo", applName: "karideo",
defaultServer: "karideo", defaultServer: "karideo",
server: { server: {
karideo: `${serverBaseAddress}/karideo/api`, karideo: `${serverSSOAddress}/karideo/api`,
karso: `${serverSSOAddress}/api`, karso: `${serverSSOAddress}/karso/api`,
}, },
ssoSite: `${serverSSOAddress}/`, ssoSite: `${serverSSOAddress}/karso/`,
ssoSignIn: `${serverSSOAddress}/signin/karideo-dev/`, ssoSignIn: `${serverSSOAddress}/karso/signin/karideo-dev/`,
ssoSignUp: `${serverSSOAddress}/signup/karideo-dev/`, ssoSignUp: `${serverSSOAddress}/karso/signup/karideo-dev/`,
ssoSignOut: `${serverSSOAddress}/signout/karideo-dev/`, ssoSignOut: `${serverSSOAddress}/karso/signout/karideo-dev/`,
tokenStoredInPermanentStorage: false, tokenStoredInPermanentStorage: false,
}; };
@ -32,14 +30,13 @@ const environment_local: Environment = {
defaultServer: "karideo", defaultServer: "karideo",
server: { server: {
karideo: 'http://localhost:18080/karideo/api', karideo: 'http://localhost:18080/karideo/api',
karso: `${serverSSOAddress}/api`, karso: `${serverSSOAddress}/karso/api`,
}, },
ssoSite: `${serverSSOAddress}/`, ssoSite: `${serverSSOAddress}/karso/`,
ssoSignIn: `${serverSSOAddress}/signin/karideo-dev/`, ssoSignIn: `${serverSSOAddress}/karso/signin/karideo-dev/`,
ssoSignUp: `${serverSSOAddress}/signup/karideo-dev/`, ssoSignUp: `${serverSSOAddress}/karso/signup/karideo-dev/`,
ssoSignOut: `${serverSSOAddress}/signout/karideo-dev/`, ssoSignOut: `${serverSSOAddress}/karso/signout/karideo-dev/`,
tokenStoredInPermanentStorage: false, tokenStoredInPermanentStorage: false,
replaceDataToRealServer: true,
}; };
const environment_hybrid: Environment = { const environment_hybrid: Environment = {
@ -48,13 +45,13 @@ const environment_hybrid: Environment = {
applName: "karideo", applName: "karideo",
defaultServer: "karideo", defaultServer: "karideo",
server: { server: {
karideo: `${serverBaseAddress}/karideo/api`, karideo: `${serverSSOAddress}/karideo/api`,
karso: `${serverSSOAddress}/api`, karso: `${serverSSOAddress}/karso/api`,
}, },
ssoSite: `${serverSSOAddress}/`, ssoSite: `${serverSSOAddress}/karso/`,
ssoSignIn: `${serverSSOAddress}/signin/karideo-dev/`, ssoSignIn: `${serverSSOAddress}/karso/signin/karideo-dev/`,
ssoSignUp: `${serverSSOAddress}/signup/karideo-dev/`, ssoSignUp: `${serverSSOAddress}/karso/signup/karideo-dev/`,
ssoSignOut: `${serverSSOAddress}/signout/karideo-dev/`, ssoSignOut: `${serverSSOAddress}/karso/signout/karideo-dev/`,
tokenStoredInPermanentStorage: false, tokenStoredInPermanentStorage: false,
}; };

View File

@ -9,15 +9,15 @@
"moduleResolution": "node", "moduleResolution": "node",
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"target": "ES2018", "target": "ES2022",
"typeRoots": [ "typeRoots": [
"node_modules/@types" "node_modules/@types"
], ],
"lib": [ "lib": [
"ES2018", "ES2022",
"dom" "dom"
], ],
"module": "ES2020", "module": "ES2022",
"baseUrl": "./src", "baseUrl": "./src",
"paths": { "paths": {
"@app/*": [ "@app/*": [

View File

@ -1 +1 @@
0.3.0 0.2.1