Login page design
This commit is contained in:
@@ -20,7 +20,7 @@ export const Sha256 = pipe(
|
||||
(array) => array.byteLength === 32,
|
||||
() => B.error(`Expected Uint8Array to be 32 bytes long`),
|
||||
)),
|
||||
);
|
||||
).annotations({ identifier: "SHA-256" });
|
||||
|
||||
export class BooleanFromNumber extends S.transform(
|
||||
S.Number,
|
||||
@@ -31,67 +31,3 @@ export class BooleanFromNumber extends S.transform(
|
||||
encode: (i) => i ? 1 : 0,
|
||||
},
|
||||
).annotations({ identifier: "BooleanFromNumber" }) { }
|
||||
|
||||
export const SystemInformation = S.Struct({
|
||||
createdBy: S.Union(UserId, S.Null),
|
||||
createdAt: S.DateTimeUtc,
|
||||
modifiedBy: S.Union(UserId, S.Null),
|
||||
modifiedAt: S.DateTimeUtc,
|
||||
});
|
||||
|
||||
export type SystemInformation = typeof SystemInformation.Type;
|
||||
|
||||
// --- TABLES ------------------------------------------------------------------
|
||||
|
||||
export const AccessLog = S.Struct({
|
||||
timestamp: S.DateTimeUtc,
|
||||
requestId: RequestId,
|
||||
method: S.NonEmptyString,
|
||||
pathname: S.NonEmptyString,
|
||||
query: S.parseJson(S.Record({
|
||||
key: S.String,
|
||||
value: S.String,
|
||||
})),
|
||||
ip: S.Union(S.NonEmptyString, S.Null),
|
||||
});
|
||||
|
||||
export const Attachment = pipe(
|
||||
S.Struct({
|
||||
attachmentId: AttachmentId,
|
||||
pieceId: PieceId,
|
||||
sha256: Sha256,
|
||||
filename: S.NonEmptyString,
|
||||
mediaType: S.NonEmptyString,
|
||||
}),
|
||||
S.extend(SystemInformation),
|
||||
);
|
||||
|
||||
export const Piece = pipe(
|
||||
S.Struct({
|
||||
pieceId: PieceId,
|
||||
name: S.NonEmptyString,
|
||||
composer: S.Union(S.NonEmptyString, S.Null),
|
||||
lyricist: S.Union(S.NonEmptyString, S.Null),
|
||||
arranger: S.Union(S.NonEmptyString, S.Null),
|
||||
}),
|
||||
S.extend(SystemInformation),
|
||||
);
|
||||
|
||||
export const Session = S.Struct({
|
||||
sessionId: SessionId,
|
||||
userId: UserId,
|
||||
expiresAt: S.DateTimeUtc,
|
||||
});
|
||||
|
||||
export const User = S.Struct({
|
||||
userId: UserId,
|
||||
username: S.NonEmptyString,
|
||||
password: S.NonEmptyString,
|
||||
admin: BooleanFromNumber,
|
||||
});
|
||||
|
||||
export type AccessLog = typeof AccessLog.Type;
|
||||
export type Attachment = typeof Attachment.Type;
|
||||
export type Piece = typeof Piece.Type;
|
||||
export type Session = typeof Session.Type;
|
||||
export type User = typeof User.Type;
|
||||
|
||||
Reference in New Issue
Block a user