Initial Implementation of Profile Pictures

This commit is contained in:
2023-08-21 02:46:50 -03:00
parent 9b8d0e248f
commit 1328ca7c4c
13 changed files with 130 additions and 67 deletions

View File

@@ -12,7 +12,7 @@ export const HttpError = t.iface([], {
"timestamp": "string",
});
const HttpErrorTI: t.ITypeSuite = {
const exportedTypeSuite: t.ITypeSuite = {
HttpError,
};
export default HttpErrorTI;
export default exportedTypeSuite;

View File

@@ -1,5 +1,5 @@
import { createCheckers } from "ts-interface-checker";
import HttpErrorTI from "./httpError.model-ti";
import HttpError from "./httpError.model-ti";
const HttpErrorChecker = createCheckers(HttpErrorTI)['HttpError'];
export default HttpErrorChecker;
const HttpErrorChecker = createCheckers(HttpError)['HttpError'];
export default HttpErrorChecker;

View File

@@ -1,6 +1,6 @@
import { createCheckers } from "ts-interface-checker";
import TokenTI from "../token/token.model-ti";
import UserTI from "./user.model-ti";
import User from "./user.model-ti";
import Token from "../token/token.model-ti";
const UserChecker = createCheckers(UserTI, TokenTI)['User'];
export default UserChecker;
const UserChecker = createCheckers(User, Token)['User'];
export default UserChecker;

View File

@@ -10,14 +10,13 @@ export const User = t.iface([], {
"email": t.opt("string"),
"username": "string",
"password": t.opt("string"),
"profilePictureUrl": t.opt("string"),
"accessToken": t.opt("Token"),
"refreshToken": t.opt("Token"),
"authorities": t.opt(t.array(t.iface([], {
"authority": "string",
}))),
"roles": t.opt(t.array("string")),
});
const UserTI: t.ITypeSuite = {
const exportedTypeSuite: t.ITypeSuite = {
User,
};
export default UserTI;
export default exportedTypeSuite;

View File

@@ -6,8 +6,9 @@ export interface User {
email?: string,
username: string,
password?: string,
profilePictureUrl?: string,
accessToken?: Token,
refreshToken?: Token,
authorities?: Array<{authority: string}>,
roles?: Array<string>,
validateAccessToken?: () => Token | undefined;
};
};