From 5fee3a1390a40805b09c9de64f8f14a4e94d36eb Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 22 Apr 2024 23:08:29 +0200 Subject: [PATCH] [DEV] update the API generation and video button --- .../karideo/migration/Migration20240226.java | 6 +- front/package.json | 2 +- front/pnpm-lock.yaml | 8 +-- front/src/app/back-api/data-resource.ts | 47 +++++++++++++--- front/src/app/back-api/front.ts | 14 ++++- front/src/app/back-api/health-check.ts | 20 ++++++- front/src/app/back-api/media-resource.ts | 56 ++++++++++++++++--- front/src/app/back-api/season-resource.ts | 55 +++++++++++++++--- front/src/app/back-api/series-resource.ts | 55 +++++++++++++++--- front/src/app/back-api/type-resource.ts | 55 +++++++++++++++--- .../user-media-advancement-resource.ts | 38 +++++++++++-- front/src/app/back-api/user-resource.ts | 32 +++++++++-- front/src/app/scene/video/video.html | 20 +++++-- front/src/environments/environment.ts | 1 + 14 files changed, 335 insertions(+), 74 deletions(-) diff --git a/back/src/org/kar/karideo/migration/Migration20240226.java b/back/src/org/kar/karideo/migration/Migration20240226.java index e088645..f460800 100644 --- a/back/src/org/kar/karideo/migration/Migration20240226.java +++ b/back/src/org/kar/karideo/migration/Migration20240226.java @@ -10,7 +10,7 @@ import java.util.UUID; import org.kar.archidata.api.DataResource; import org.kar.archidata.dataAccess.DataAccess; -import org.kar.archidata.dataAccess.addOn.model.LinkTable; +import org.kar.archidata.dataAccess.addOn.model.LinkTableLongLong; import org.kar.archidata.dataAccess.options.AccessDeletedItems; import org.kar.archidata.dataAccess.options.OverrideTableName; import org.kar.archidata.migration.MigrationSqlStep; @@ -58,11 +58,11 @@ public class Migration20240226 extends MigrationSqlStep { addAction(() -> { final List datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data")); final List medias = DataAccess.gets(CoverConversion.class, new AccessDeletedItems(), new OverrideTableName(tableName)); - final List links = DataAccess.gets(LinkTable.class, new OverrideTableName(tableName + "_link_cover")); + final List links = DataAccess.gets(LinkTableLongLong.class, new OverrideTableName(tableName + "_link_cover")); LOGGER.info("Get somes data: {} {} {}", datas.size(), medias.size(), links.size()); for (final CoverConversion media: medias) { final List values = new ArrayList<>(); - for (final LinkTable link: links) { + for (final LinkTableLongLong link: links) { if (link.object1Id.equals(media.id)) { for (final UUIDConversion data: datas) { if (data.id.equals(link.object2Id)) { diff --git a/front/package.json b/front/package.json index 6f93373..ab5707a 100644 --- a/front/package.json +++ b/front/package.json @@ -31,7 +31,7 @@ "@angular/router": "^17.3.5", "rxjs": "^7.8.1", "zone.js": "^0.14.4", - "zod": "3.22.4", + "zod": "3.23.0", "@kangaroo-and-rabbit/kar-cw": "^0.2.1" }, "devDependencies": { diff --git a/front/pnpm-lock.yaml b/front/pnpm-lock.yaml index 4c8d97f..87b43a1 100644 --- a/front/pnpm-lock.yaml +++ b/front/pnpm-lock.yaml @@ -42,8 +42,8 @@ dependencies: specifier: ^7.8.1 version: 7.8.1 zod: - specifier: 3.22.4 - version: 3.22.4 + specifier: 3.23.0 + version: 3.23.0 zone.js: specifier: ^0.14.4 version: 0.14.4 @@ -9806,8 +9806,8 @@ packages: engines: {node: '>=12.20'} dev: true - /zod@3.22.4: - resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} + /zod@3.23.0: + resolution: {integrity: sha512-OFLT+LTocvabn6q76BTwVB0hExEBS0IduTr3cqZyMqEDbOnYmcU+y0tUAYbND4uwclpBGi4I4UUBGzylWpjLGA==} dev: false /zone.js@0.14.4: diff --git a/front/src/app/back-api/data-resource.ts b/front/src/app/back-api/data-resource.ts index a12d927..df18ebc 100644 --- a/front/src/app/back-api/data-resource.ts +++ b/front/src/app/back-api/data-resource.ts @@ -1,14 +1,28 @@ /** * API of the server (auto-generated code) */ -import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools" -import {UUID, } from "./model" +import { + HTTPMimeType, + HTTPRequestModel, + ModelResponseHttp, + RESTCallbacks, + RESTConfig, + RESTRequestJson, + RESTRequestJsonArray, + RESTRequestVoid +} from "./rest-tools" +import { + UUID, +} from "./model" export namespace DataResource { /** * Insert a new data in the data environment */ - export function uploadFile({ restConfig, data, }: { + export function uploadFile({ + restConfig, + data, + }: { restConfig: RESTConfig, data: { file: File, @@ -29,10 +43,15 @@ export namespace DataResource { * Get back some data from the data environment */ // TODO: unmanaged "Response" type: please specify @AsyncType or considered as 'void'. - export function retrieveDataId({ restConfig, queries, params, data, }: { + export function retrieveDataId({ + restConfig, + queries, + params, + data, + }: { restConfig: RESTConfig, queries: { - Authorization: string, + Authorization?: string, }, params: { id: UUID, @@ -54,10 +73,15 @@ export namespace DataResource { * Get a thumbnail of from the data environment (if resize is possible) */ // TODO: unmanaged "Response" type: please specify @AsyncType or considered as 'void'. - export function retrieveDataThumbnailId({ restConfig, queries, params, data, }: { + export function retrieveDataThumbnailId({ + restConfig, + queries, + params, + data, + }: { restConfig: RESTConfig, queries: { - Authorization: string, + Authorization?: string, }, params: { id: UUID, @@ -79,10 +103,15 @@ export namespace DataResource { * Get back some data from the data environment (with a beautiful name (permit download with basic name) */ // TODO: unmanaged "Response" type: please specify @AsyncType or considered as 'void'. - export function retrieveDataFull({ restConfig, queries, params, data, }: { + export function retrieveDataFull({ + restConfig, + queries, + params, + data, + }: { restConfig: RESTConfig, queries: { - Authorization: string, + Authorization?: string, }, params: { name: string, diff --git a/front/src/app/back-api/front.ts b/front/src/app/back-api/front.ts index d478ff9..f7e397d 100644 --- a/front/src/app/back-api/front.ts +++ b/front/src/app/back-api/front.ts @@ -1,8 +1,18 @@ /** * API of the server (auto-generated code) */ -import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools" -import {} from "./model" +import { + HTTPMimeType, + HTTPRequestModel, + ModelResponseHttp, + RESTCallbacks, + RESTConfig, + RESTRequestJson, + RESTRequestJsonArray, + RESTRequestVoid +} from "./rest-tools" +import { +} from "./model" export namespace Front { } diff --git a/front/src/app/back-api/health-check.ts b/front/src/app/back-api/health-check.ts index e87eff3..510e612 100644 --- a/front/src/app/back-api/health-check.ts +++ b/front/src/app/back-api/health-check.ts @@ -1,14 +1,28 @@ /** * API of the server (auto-generated code) */ -import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools" -import {HealthResult, isHealthResult, } from "./model" +import { + HTTPMimeType, + HTTPRequestModel, + ModelResponseHttp, + RESTCallbacks, + RESTConfig, + RESTRequestJson, + RESTRequestJsonArray, + RESTRequestVoid +} from "./rest-tools" +import { + HealthResult, + isHealthResult, +} from "./model" export namespace HealthCheck { /** * Get the server state (health) */ - export function getHealth({ restConfig, }: { + export function getHealth({ + restConfig, + }: { restConfig: RESTConfig, }): Promise { return RESTRequestJson({ diff --git a/front/src/app/back-api/media-resource.ts b/front/src/app/back-api/media-resource.ts index b8ed4ed..2006044 100644 --- a/front/src/app/back-api/media-resource.ts +++ b/front/src/app/back-api/media-resource.ts @@ -1,14 +1,31 @@ /** * API of the server (auto-generated code) */ -import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools" -import {UUID, Long, Media, isMedia, } from "./model" +import { + HTTPMimeType, + HTTPRequestModel, + ModelResponseHttp, + RESTCallbacks, + RESTConfig, + RESTRequestJson, + RESTRequestJsonArray, + RESTRequestVoid +} from "./rest-tools" +import { + Media, + Long, + UUID, + isMedia, +} from "./model" export namespace MediaResource { /** * Remove a specific Media */ - export function remove({ restConfig, params, }: { + export function remove({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -28,7 +45,10 @@ export namespace MediaResource { /** * Get a specific Media with his ID */ - export function get({ restConfig, params, }: { + export function get({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -47,7 +67,11 @@ export namespace MediaResource { /** * Modify a specific Media */ - export function patch({ restConfig, params, data, }: { + export function patch({ + restConfig, + params, + data, + }: { restConfig: RESTConfig, params: { id: Long, @@ -69,7 +93,9 @@ export namespace MediaResource { /** * Get all Media */ - export function gets({ restConfig, }: { + export function gets({ + restConfig, + }: { restConfig: RESTConfig, }): Promise { return RESTRequestJsonArray({ @@ -84,7 +110,12 @@ export namespace MediaResource { /** * Upload a new season cover media */ - export function uploadCover({ restConfig, params, data, callback, }: { + export function uploadCover({ + restConfig, + params, + data, + callback, + }: { restConfig: RESTConfig, params: { id: Long, @@ -111,7 +142,10 @@ export namespace MediaResource { /** * Remove a specific cover of a media */ - export function removeCover({ restConfig, params, }: { + export function removeCover({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { coverId: UUID, @@ -132,7 +166,11 @@ export namespace MediaResource { /** * Create a new Media */ - export function uploadFile({ restConfig, data, callback, }: { + export function uploadFile({ + restConfig, + data, + callback, + }: { restConfig: RESTConfig, data: { fileName: string, diff --git a/front/src/app/back-api/season-resource.ts b/front/src/app/back-api/season-resource.ts index b419678..d42eb8c 100644 --- a/front/src/app/back-api/season-resource.ts +++ b/front/src/app/back-api/season-resource.ts @@ -1,14 +1,31 @@ /** * API of the server (auto-generated code) */ -import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools" -import {UUID, Long, Season, isSeason, } from "./model" +import { + HTTPMimeType, + HTTPRequestModel, + ModelResponseHttp, + RESTCallbacks, + RESTConfig, + RESTRequestJson, + RESTRequestJsonArray, + RESTRequestVoid +} from "./rest-tools" +import { + Long, + UUID, + Season, + isSeason, +} from "./model" export namespace SeasonResource { /** * Remove a specific season */ - export function remove({ restConfig, params, }: { + export function remove({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -28,7 +45,10 @@ export namespace SeasonResource { /** * Get all season */ - export function get({ restConfig, params, }: { + export function get({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -48,7 +68,11 @@ export namespace SeasonResource { /** * Modify a specific season */ - export function patch({ restConfig, params, data, }: { + export function patch({ + restConfig, + params, + data, + }: { restConfig: RESTConfig, params: { id: Long, @@ -70,7 +94,10 @@ export namespace SeasonResource { /** * Create a new season */ - export function post({ restConfig, data, }: { + export function post({ + restConfig, + data, + }: { restConfig: RESTConfig, data: Season, }): Promise { @@ -88,7 +115,9 @@ export namespace SeasonResource { /** * Get a specific Season with his ID */ - export function gets({ restConfig, }: { + export function gets({ + restConfig, + }: { restConfig: RESTConfig, }): Promise { return RESTRequestJsonArray({ @@ -103,7 +132,12 @@ export namespace SeasonResource { /** * Upload a new season cover season */ - export function uploadCover({ restConfig, params, data, callback, }: { + export function uploadCover({ + restConfig, + params, + data, + callback, + }: { restConfig: RESTConfig, params: { id: Long, @@ -130,7 +164,10 @@ export namespace SeasonResource { /** * Remove a specific cover of a season */ - export function removeCover({ restConfig, params, }: { + export function removeCover({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { coverId: UUID, diff --git a/front/src/app/back-api/series-resource.ts b/front/src/app/back-api/series-resource.ts index daf8157..ecccc19 100644 --- a/front/src/app/back-api/series-resource.ts +++ b/front/src/app/back-api/series-resource.ts @@ -1,14 +1,31 @@ /** * API of the server (auto-generated code) */ -import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools" -import {UUID, Long, Series, isSeries, } from "./model" +import { + HTTPMimeType, + HTTPRequestModel, + ModelResponseHttp, + RESTCallbacks, + RESTConfig, + RESTRequestJson, + RESTRequestJsonArray, + RESTRequestVoid +} from "./rest-tools" +import { + Long, + UUID, + Series, + isSeries, +} from "./model" export namespace SeriesResource { /** * Remove a specific Series */ - export function remove({ restConfig, params, }: { + export function remove({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -28,7 +45,10 @@ export namespace SeriesResource { /** * Get a specific Series with his ID */ - export function get({ restConfig, params, }: { + export function get({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -48,7 +68,11 @@ export namespace SeriesResource { /** * Modify a specific Series */ - export function patch({ restConfig, params, data, }: { + export function patch({ + restConfig, + params, + data, + }: { restConfig: RESTConfig, params: { id: Long, @@ -70,7 +94,10 @@ export namespace SeriesResource { /** * Create a new Series */ - export function post({ restConfig, data, }: { + export function post({ + restConfig, + data, + }: { restConfig: RESTConfig, data: Series, }): Promise { @@ -88,7 +115,9 @@ export namespace SeriesResource { /** * Get all Series */ - export function gets({ restConfig, }: { + export function gets({ + restConfig, + }: { restConfig: RESTConfig, }): Promise { return RESTRequestJsonArray({ @@ -103,7 +132,12 @@ export namespace SeriesResource { /** * Upload a new season cover Series */ - export function uploadCover({ restConfig, params, data, callback, }: { + export function uploadCover({ + restConfig, + params, + data, + callback, + }: { restConfig: RESTConfig, params: { id: Long, @@ -130,7 +164,10 @@ export namespace SeriesResource { /** * Remove a specific Series of a season */ - export function removeCover({ restConfig, params, }: { + export function removeCover({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { coverId: UUID, diff --git a/front/src/app/back-api/type-resource.ts b/front/src/app/back-api/type-resource.ts index 5fd39be..784a0b2 100644 --- a/front/src/app/back-api/type-resource.ts +++ b/front/src/app/back-api/type-resource.ts @@ -1,14 +1,31 @@ /** * API of the server (auto-generated code) */ -import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools" -import {UUID, Long, Type, isType, } from "./model" +import { + HTTPMimeType, + HTTPRequestModel, + ModelResponseHttp, + RESTCallbacks, + RESTConfig, + RESTRequestJson, + RESTRequestJsonArray, + RESTRequestVoid +} from "./rest-tools" +import { + Type, + Long, + UUID, + isType, +} from "./model" export namespace TypeResource { /** * Remove a specific Type */ - export function remove({ restConfig, params, }: { + export function remove({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -28,7 +45,10 @@ export namespace TypeResource { /** * Get a specific Type with his ID */ - export function get({ restConfig, params, }: { + export function get({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -48,7 +68,11 @@ export namespace TypeResource { /** * Modify a specific Type */ - export function patch({ restConfig, params, data, }: { + export function patch({ + restConfig, + params, + data, + }: { restConfig: RESTConfig, params: { id: Long, @@ -70,7 +94,10 @@ export namespace TypeResource { /** * Create a new Type */ - export function post({ restConfig, data, }: { + export function post({ + restConfig, + data, + }: { restConfig: RESTConfig, data: Type, }): Promise { @@ -88,7 +115,9 @@ export namespace TypeResource { /** * Get all Type */ - export function gets({ restConfig, }: { + export function gets({ + restConfig, + }: { restConfig: RESTConfig, }): Promise { return RESTRequestJsonArray({ @@ -103,7 +132,12 @@ export namespace TypeResource { /** * Upload a new season cover Type */ - export function uploadCover({ restConfig, params, data, callback, }: { + export function uploadCover({ + restConfig, + params, + data, + callback, + }: { restConfig: RESTConfig, params: { id: Long, @@ -130,7 +164,10 @@ export namespace TypeResource { /** * Remove a specific cover of a type */ - export function removeCover({ restConfig, params, }: { + export function removeCover({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { coverId: UUID, diff --git a/front/src/app/back-api/user-media-advancement-resource.ts b/front/src/app/back-api/user-media-advancement-resource.ts index e1e264b..e601d43 100644 --- a/front/src/app/back-api/user-media-advancement-resource.ts +++ b/front/src/app/back-api/user-media-advancement-resource.ts @@ -1,14 +1,31 @@ /** * API of the server (auto-generated code) */ -import { HTTPMimeType, HTTPRequestModel, ModelResponseHttp, RESTConfig, RESTCallbacks, RESTRequestJson, RESTRequestJsonArray, RESTRequestVoid } from "./rest-tools" -import {Long, UserMediaAdvancement, MediaInformationsDelta, isUserMediaAdvancement, } from "./model" +import { + HTTPMimeType, + HTTPRequestModel, + ModelResponseHttp, + RESTCallbacks, + RESTConfig, + RESTRequestJson, + RESTRequestJsonArray, + RESTRequestVoid +} from "./rest-tools" +import { + MediaInformationsDelta, + Long, + UserMediaAdvancement, + isUserMediaAdvancement, +} from "./model" export namespace UserMediaAdvancementResource { /** * Remove a specific user advancement */ - export function remove({ restConfig, params, }: { + export function remove({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -28,7 +45,10 @@ export namespace UserMediaAdvancementResource { /** * Get a specific user advancement with his ID */ - export function get({ restConfig, params, }: { + export function get({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -47,7 +67,11 @@ export namespace UserMediaAdvancementResource { /** * Modify a user advancement */ - export function patch({ restConfig, params, data, }: { + export function patch({ + restConfig, + params, + data, + }: { restConfig: RESTConfig, params: { id: Long, @@ -69,7 +93,9 @@ export namespace UserMediaAdvancementResource { /** * Get all user advancement */ - export function gets({ restConfig, }: { + export function gets({ + restConfig, + }: { restConfig: RESTConfig, }): Promise { return RESTRequestJsonArray({ diff --git a/front/src/app/back-api/user-resource.ts b/front/src/app/back-api/user-resource.ts index 872274a..dd36b40 100644 --- a/front/src/app/back-api/user-resource.ts +++ b/front/src/app/back-api/user-resource.ts @@ -1,14 +1,32 @@ /** * 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" +import { + HTTPMimeType, + HTTPRequestModel, + ModelResponseHttp, + RESTCallbacks, + RESTConfig, + RESTRequestJson, + RESTRequestJsonArray, + RESTRequestVoid +} from "./rest-tools" +import { + UserKarideo, + Long, + UserOut, + isUserKarideo, + isUserOut, +} from "./model" export namespace UserResource { /** * Get a specific user data */ - export function get({ restConfig, params, }: { + export function get({ + restConfig, + params, + }: { restConfig: RESTConfig, params: { id: Long, @@ -27,7 +45,9 @@ export namespace UserResource { /** * Get all the users */ - export function gets({ restConfig, }: { + export function gets({ + restConfig, + }: { restConfig: RESTConfig, }): Promise { return RESTRequestJsonArray({ @@ -42,7 +62,9 @@ export namespace UserResource { /** * Get the user personal data */ - export function getMe({ restConfig, }: { + export function getMe({ + restConfig, + }: { restConfig: RESTConfig, }): Promise { return RESTRequestJson({ diff --git a/front/src/app/scene/video/video.html b/front/src/app/scene/video/video.html index bb8b63f..f88f938 100644 --- a/front/src/app/scene/video/video.html +++ b/front/src/app/scene/video/video.html @@ -126,11 +126,21 @@ } - @if(!isPlaying) { - - - - } + + + } @if(!isFullScreen || !isPlaying) { diff --git a/front/src/environments/environment.ts b/front/src/environments/environment.ts index 2f66446..f67d297 100644 --- a/front/src/environments/environment.ts +++ b/front/src/environments/environment.ts @@ -37,6 +37,7 @@ const environment_local: Environment = { ssoSignUp: `${serverSSOAddress}/karso/signup/karideo-dev/`, ssoSignOut: `${serverSSOAddress}/karso/signout/karideo-dev/`, tokenStoredInPermanentStorage: false, + replaceDataToRealServer: true, }; const environment_hybrid: Environment = {