refactor(schemas): group network schemas by direction

Move request and response schemas into matching subdirectories, extract the shared chat lock type, and update barrels and imports without changing wire formats.
This commit is contained in:
2026-07-14 15:12:19 +08:00
parent 8eaea17156
commit 759481b621
75 changed files with 222 additions and 124 deletions
+11 -1
View File
@@ -17,8 +17,19 @@
"./src/data/dto/metrics", "./src/data/dto/metrics",
"./src/data/dto/user", "./src/data/dto/user",
"./src/data/schemas/auth", "./src/data/schemas/auth",
"./src/data/schemas/auth/request",
"./src/data/schemas/auth/response",
"./src/data/schemas/chat", "./src/data/schemas/chat",
"./src/data/schemas/chat/request",
"./src/data/schemas/chat/response",
"./src/data/schemas/metrics", "./src/data/schemas/metrics",
"./src/data/schemas/metrics/request",
"./src/data/schemas/payment",
"./src/data/schemas/payment/request",
"./src/data/schemas/payment/response",
"./src/data/schemas/private-room",
"./src/data/schemas/private-room/request",
"./src/data/schemas/private-room/response",
"./src/data/schemas/user", "./src/data/schemas/user",
"./src/data/storage/app", "./src/data/storage/app",
"./src/data/storage/auth", "./src/data/storage/auth",
@@ -35,7 +46,6 @@
"./src/utils", "./src/utils",
"./src/stores/auth", "./src/stores/auth",
"./src/stores/chat", "./src/stores/chat",
"./src/stores/sidebar",
"./src/stores/user" "./src/stores/user"
] ]
} }
@@ -5,7 +5,7 @@ import {
FacebookIdentityRequestSchema, FacebookIdentityRequestSchema,
type FacebookIdentityRequestInput, type FacebookIdentityRequestInput,
type FacebookIdentityRequestData, type FacebookIdentityRequestData,
} from "@/data/schemas/auth/facebook_identity_request"; } from "@/data/schemas/auth/request/facebook_identity_request";
export class FacebookIdentityRequest { export class FacebookIdentityRequest {
private constructor(input: FacebookIdentityRequestInput) { private constructor(input: FacebookIdentityRequestInput) {
@@ -5,7 +5,7 @@ import {
FacebookLoginRequestSchema, FacebookLoginRequestSchema,
type FacebookLoginRequestInput, type FacebookLoginRequestInput,
type FacebookLoginRequestData, type FacebookLoginRequestData,
} from "@/data/schemas/auth/facebook_login_request"; } from "@/data/schemas/auth/request/facebook_login_request";
export class FacebookLoginRequest { export class FacebookLoginRequest {
declare readonly accessToken: string; declare readonly accessToken: string;
@@ -5,7 +5,7 @@ import {
FacebookPsidLoginRequestSchema, FacebookPsidLoginRequestSchema,
type FacebookPsidLoginRequestInput, type FacebookPsidLoginRequestInput,
type FacebookPsidLoginRequestData, type FacebookPsidLoginRequestData,
} from "@/data/schemas/auth/facebook_psid_login_request"; } from "@/data/schemas/auth/request/facebook_psid_login_request";
export class FacebookPsidLoginRequest { export class FacebookPsidLoginRequest {
private constructor(input: FacebookPsidLoginRequestInput) { private constructor(input: FacebookPsidLoginRequestInput) {
@@ -5,7 +5,7 @@ import {
FbIdLoginRequestSchema, FbIdLoginRequestSchema,
type FbIdLoginRequestInput, type FbIdLoginRequestInput,
type FbIdLoginRequestData, type FbIdLoginRequestData,
} from "@/data/schemas/auth/fb_id_login_request"; } from "@/data/schemas/auth/request/fb_id_login_request";
export class FbIdLoginRequest { export class FbIdLoginRequest {
declare readonly fbId: string; declare readonly fbId: string;
@@ -5,7 +5,7 @@ import {
GoogleLoginRequestSchema, GoogleLoginRequestSchema,
type GoogleLoginRequestInput, type GoogleLoginRequestInput,
type GoogleLoginRequestData, type GoogleLoginRequestData,
} from "@/data/schemas/auth/google_login_request"; } from "@/data/schemas/auth/request/google_login_request";
export class GoogleLoginRequest { export class GoogleLoginRequest {
declare readonly idToken: string; declare readonly idToken: string;
@@ -5,7 +5,7 @@ import {
GuestLoginRequestSchema, GuestLoginRequestSchema,
type GuestLoginRequestInput, type GuestLoginRequestInput,
type GuestLoginRequestData, type GuestLoginRequestData,
} from "@/data/schemas/auth/guest_login_request"; } from "@/data/schemas/auth/request/guest_login_request";
export class GuestLoginRequest { export class GuestLoginRequest {
declare readonly deviceId: string; declare readonly deviceId: string;
+1 -1
View File
@@ -5,7 +5,7 @@ import {
LoginRequestSchema, LoginRequestSchema,
type LoginRequestInput, type LoginRequestInput,
type LoginRequestData, type LoginRequestData,
} from "@/data/schemas/auth/login_request"; } from "@/data/schemas/auth/request/login_request";
export class LoginRequest { export class LoginRequest {
declare readonly email: string; declare readonly email: string;
@@ -5,7 +5,7 @@ import {
RefreshTokenRequestSchema, RefreshTokenRequestSchema,
type RefreshTokenRequestInput, type RefreshTokenRequestInput,
type RefreshTokenRequestData, type RefreshTokenRequestData,
} from "@/data/schemas/auth/refresh_token_request"; } from "@/data/schemas/auth/request/refresh_token_request";
export class RefreshTokenRequest { export class RefreshTokenRequest {
declare readonly refreshToken: string; declare readonly refreshToken: string;
@@ -5,7 +5,7 @@ import {
RegisterRequestSchema, RegisterRequestSchema,
type RegisterRequestInput, type RegisterRequestInput,
type RegisterRequestData, type RegisterRequestData,
} from "@/data/schemas/auth/register_request"; } from "@/data/schemas/auth/request/register_request";
export class RegisterRequest { export class RegisterRequest {
declare readonly username: string; declare readonly username: string;
@@ -5,7 +5,7 @@ import {
FacebookIdentityResponseSchema, FacebookIdentityResponseSchema,
type FacebookIdentityResponseInput, type FacebookIdentityResponseInput,
type FacebookIdentityResponseData, type FacebookIdentityResponseData,
} from "@/data/schemas/auth/facebook_identity_response"; } from "@/data/schemas/auth/response/facebook_identity_response";
export class FacebookIdentityResponse { export class FacebookIdentityResponse {
private constructor(input: FacebookIdentityResponseInput) { private constructor(input: FacebookIdentityResponseInput) {
@@ -5,7 +5,7 @@ import {
FacebookPsidLoginResponseSchema, FacebookPsidLoginResponseSchema,
type FacebookPsidLoginResponseInput, type FacebookPsidLoginResponseInput,
type FacebookPsidLoginResponseData, type FacebookPsidLoginResponseData,
} from "@/data/schemas/auth/facebook_psid_login_response"; } from "@/data/schemas/auth/response/facebook_psid_login_response";
export class FacebookPsidLoginResponse { export class FacebookPsidLoginResponse {
private constructor(input: FacebookPsidLoginResponseInput) { private constructor(input: FacebookPsidLoginResponseInput) {
@@ -5,7 +5,7 @@ import {
GuestLoginResponseSchema, GuestLoginResponseSchema,
type GuestLoginResponseInput, type GuestLoginResponseInput,
type GuestLoginResponseData, type GuestLoginResponseData,
} from "@/data/schemas/auth/guest_login_response"; } from "@/data/schemas/auth/response/guest_login_response";
import { User } from "@/data/dto/user/user"; import { User } from "@/data/dto/user/user";
export class GuestLoginResponse { export class GuestLoginResponse {
+1 -1
View File
@@ -5,7 +5,7 @@ import {
LoginResponseSchema, LoginResponseSchema,
type LoginResponseInput, type LoginResponseInput,
type LoginResponseData, type LoginResponseData,
} from "@/data/schemas/auth/login_response"; } from "@/data/schemas/auth/response/login_response";
import { User } from "@/data/dto/user/user"; import { User } from "@/data/dto/user/user";
export class LoginResponse { export class LoginResponse {
@@ -5,7 +5,7 @@ import {
LogoutResponseSchema, LogoutResponseSchema,
type LogoutResponseInput, type LogoutResponseInput,
type LogoutResponseData, type LogoutResponseData,
} from "@/data/schemas/auth/logout_response"; } from "@/data/schemas/auth/response/logout_response";
export class LogoutResponse { export class LogoutResponse {
declare readonly success: boolean; declare readonly success: boolean;
@@ -5,7 +5,7 @@ import {
RefreshTokenResponseSchema, RefreshTokenResponseSchema,
type RefreshTokenResponseInput, type RefreshTokenResponseInput,
type RefreshTokenResponseData, type RefreshTokenResponseData,
} from "@/data/schemas/auth/refresh_token_response"; } from "@/data/schemas/auth/response/refresh_token_response";
export class RefreshTokenResponse { export class RefreshTokenResponse {
declare readonly token: string; declare readonly token: string;
@@ -5,7 +5,7 @@ import {
SendMessageRequestSchema, SendMessageRequestSchema,
type SendMessageRequestInput, type SendMessageRequestInput,
type SendMessageRequestData, type SendMessageRequestData,
} from "@/data/schemas/chat/send_message_request"; } from "@/data/schemas/chat/request/send_message_request";
export class SendMessageRequest { export class SendMessageRequest {
declare readonly message: string; declare readonly message: string;
@@ -5,7 +5,7 @@ import {
UnlockPrivateRequestSchema, UnlockPrivateRequestSchema,
type UnlockPrivateRequestData, type UnlockPrivateRequestData,
type UnlockPrivateRequestInput, type UnlockPrivateRequestInput,
} from "@/data/schemas/chat/unlock_private_request"; } from "@/data/schemas/chat/request/unlock_private_request";
export class UnlockPrivateRequest { export class UnlockPrivateRequest {
declare readonly messageId?: string; declare readonly messageId?: string;
@@ -5,7 +5,7 @@ import {
ChatHistoryResponseSchema, ChatHistoryResponseSchema,
type ChatHistoryResponseInput, type ChatHistoryResponseInput,
type ChatHistoryResponseData, type ChatHistoryResponseData,
} from "@/data/schemas/chat/chat_history_response"; } from "@/data/schemas/chat/response/chat_history_response";
import { ChatMessage } from "../chat_message"; import { ChatMessage } from "../chat_message";
export class ChatHistoryResponse { export class ChatHistoryResponse {
@@ -6,7 +6,7 @@ import {
type UnlockHistoryReason, type UnlockHistoryReason,
type UnlockHistoryResponseData, type UnlockHistoryResponseData,
type UnlockHistoryResponseInput, type UnlockHistoryResponseInput,
} from "@/data/schemas/chat/unlock_history_response"; } from "@/data/schemas/chat/response/unlock_history_response";
export class UnlockHistoryResponse { export class UnlockHistoryResponse {
declare readonly unlocked: boolean; declare readonly unlocked: boolean;
@@ -3,7 +3,7 @@ import {
type UnlockPrivateReason, type UnlockPrivateReason,
type UnlockPrivateResponseData, type UnlockPrivateResponseData,
type UnlockPrivateResponseInput, type UnlockPrivateResponseInput,
} from "@/data/schemas/chat/unlock_private_response"; } from "@/data/schemas/chat/response/unlock_private_response";
import type { ChatLockDetailData } from "@/data/schemas/chat"; import type { ChatLockDetailData } from "@/data/schemas/chat";
import type { ChatImageData, ChatLockType } from "@/data/schemas/chat"; import type { ChatImageData, ChatLockType } from "@/data/schemas/chat";
+1 -1
View File
@@ -5,7 +5,7 @@ import {
AppEventSchema, AppEventSchema,
type AppEventInput, type AppEventInput,
type AppEventData, type AppEventData,
} from "@/data/schemas/metrics/app_event"; } from "@/data/schemas/metrics/request/app_event";
export class AppEvent { export class AppEvent {
declare readonly userId: string; declare readonly userId: string;
+1 -1
View File
@@ -5,7 +5,7 @@ import {
PwaEventSchema, PwaEventSchema,
type PwaEventInput, type PwaEventInput,
type PwaEventData, type PwaEventData,
} from "@/data/schemas/metrics/pwa_event"; } from "@/data/schemas/metrics/request/pwa_event";
export class PwaEvent { export class PwaEvent {
declare readonly deviceId: string; declare readonly deviceId: string;
@@ -6,7 +6,7 @@ import {
type CreatePaymentOrderRequestData, type CreatePaymentOrderRequestData,
type CreatePaymentOrderRequestInput, type CreatePaymentOrderRequestInput,
type PayChannel, type PayChannel,
} from "@/data/schemas/payment/create_payment_order_request"; } from "@/data/schemas/payment/request/create_payment_order_request";
export type { PayChannel }; export type { PayChannel };
@@ -5,7 +5,7 @@ import {
CreatePaymentOrderResponseSchema, CreatePaymentOrderResponseSchema,
type CreatePaymentOrderResponseData, type CreatePaymentOrderResponseData,
type CreatePaymentOrderResponseInput, type CreatePaymentOrderResponseInput,
} from "@/data/schemas/payment/create_payment_order_response"; } from "@/data/schemas/payment/response/create_payment_order_response";
export class CreatePaymentOrderResponse { export class CreatePaymentOrderResponse {
declare readonly orderId: string; declare readonly orderId: string;
@@ -6,7 +6,7 @@ import {
type PaymentOrderStatus, type PaymentOrderStatus,
type PaymentOrderStatusResponseData, type PaymentOrderStatusResponseData,
type PaymentOrderStatusResponseInput, type PaymentOrderStatusResponseInput,
} from "@/data/schemas/payment/payment_order_status_response"; } from "@/data/schemas/payment/response/payment_order_status_response";
export type { PaymentOrderStatus }; export type { PaymentOrderStatus };
@@ -6,7 +6,7 @@ import {
type FirstRechargeOfferData, type FirstRechargeOfferData,
type PaymentPlansResponseData, type PaymentPlansResponseData,
type PaymentPlansResponseInput, type PaymentPlansResponseInput,
} from "@/data/schemas/payment/payment_plans_response"; } from "@/data/schemas/payment/response/payment_plans_response";
import { PaymentPlan } from "../payment_plan"; import { PaymentPlan } from "../payment_plan";
@@ -2,7 +2,7 @@ import {
TipPaymentPlansResponseSchema, TipPaymentPlansResponseSchema,
type TipPaymentPlansResponseData, type TipPaymentPlansResponseData,
type TipPaymentPlansResponseInput, type TipPaymentPlansResponseInput,
} from "@/data/schemas/payment/tip_payment_plans_response"; } from "@/data/schemas/payment/response/tip_payment_plans_response";
import { TipPaymentPlan } from "../tip_payment_plan"; import { TipPaymentPlan } from "../tip_payment_plan";
+15 -15
View File
@@ -2,19 +2,19 @@
* @file Automatically generated by barrelsby. * @file Automatically generated by barrelsby.
*/ */
export * from "./facebook_identity_request";
export * from "./facebook_identity_response";
export * from "./facebook_login_request";
export * from "./facebook_psid_login_request";
export * from "./facebook_psid_login_response";
export * from "./facebook_user_data"; export * from "./facebook_user_data";
export * from "./fb_id_login_request"; export * from "./request/facebook_identity_request";
export * from "./google_login_request"; export * from "./request/facebook_login_request";
export * from "./guest_login_request"; export * from "./request/facebook_psid_login_request";
export * from "./guest_login_response"; export * from "./request/fb_id_login_request";
export * from "./login_request"; export * from "./request/google_login_request";
export * from "./login_response"; export * from "./request/guest_login_request";
export * from "./logout_response"; export * from "./request/login_request";
export * from "./refresh_token_request"; export * from "./request/refresh_token_request";
export * from "./refresh_token_response"; export * from "./request/register_request";
export * from "./register_request"; export * from "./response/facebook_identity_response";
export * from "./response/facebook_psid_login_response";
export * from "./response/guest_login_response";
export * from "./response/login_response";
export * from "./response/logout_response";
export * from "./response/refresh_token_response";
@@ -3,7 +3,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { stringOrEmpty } from "../nullable-defaults"; import { stringOrEmpty } from "../../nullable-defaults";
export const FacebookIdentityRequestSchema = z.object({ export const FacebookIdentityRequestSchema = z.object({
asid: stringOrEmpty, asid: stringOrEmpty,
@@ -4,7 +4,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { booleanOrFalse, stringOrEmpty } from "../nullable-defaults"; import { booleanOrFalse, stringOrEmpty } from "../../nullable-defaults";
export const FacebookLoginRequestSchema = z.object({ export const FacebookLoginRequestSchema = z.object({
accessToken: z.string(), accessToken: z.string(),
@@ -3,7 +3,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { booleanOrTrue, stringOrEmpty } from "../nullable-defaults"; import { booleanOrTrue, stringOrEmpty } from "../../nullable-defaults";
export const FacebookPsidLoginRequestSchema = z.object({ export const FacebookPsidLoginRequestSchema = z.object({
psid: z.string(), psid: z.string(),
@@ -4,7 +4,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { booleanOrFalse, stringOrEmpty } from "../nullable-defaults"; import { booleanOrFalse, stringOrEmpty } from "../../nullable-defaults";
export const FbIdLoginRequestSchema = z.object({ export const FbIdLoginRequestSchema = z.object({
fbId: z.string(), fbId: z.string(),
@@ -4,7 +4,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { booleanOrFalse, stringOrEmpty } from "../nullable-defaults"; import { booleanOrFalse, stringOrEmpty } from "../../nullable-defaults";
export const GoogleLoginRequestSchema = z.object({ export const GoogleLoginRequestSchema = z.object({
idToken: z.string(), idToken: z.string(),
@@ -4,7 +4,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { booleanOrFalse } from "../nullable-defaults"; import { booleanOrFalse } from "../../nullable-defaults";
export const GuestLoginRequestSchema = z.object({ export const GuestLoginRequestSchema = z.object({
deviceId: z.string(), deviceId: z.string(),
+13
View File
@@ -0,0 +1,13 @@
/**
* @file Automatically generated by barrelsby.
*/
export * from "./facebook_identity_request";
export * from "./facebook_login_request";
export * from "./facebook_psid_login_request";
export * from "./fb_id_login_request";
export * from "./google_login_request";
export * from "./guest_login_request";
export * from "./login_request";
export * from "./refresh_token_request";
export * from "./register_request";
@@ -4,7 +4,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { booleanOrFalse, stringOrEmpty } from "../nullable-defaults"; import { booleanOrFalse, stringOrEmpty } from "../../nullable-defaults";
export const LoginRequestSchema = z.object({ export const LoginRequestSchema = z.object({
email: stringOrEmpty, email: stringOrEmpty,
@@ -4,7 +4,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { booleanOrFalse, stringOrEmpty } from "../nullable-defaults"; import { booleanOrFalse, stringOrEmpty } from "../../nullable-defaults";
export const RegisterRequestSchema = z.object({ export const RegisterRequestSchema = z.object({
username: z.string(), username: z.string(),
@@ -3,7 +3,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { arrayOrEmpty, stringOrEmpty } from "../nullable-defaults"; import { arrayOrEmpty, stringOrEmpty } from "../../nullable-defaults";
export const FacebookIdentityBindingSchema = z.object({ export const FacebookIdentityBindingSchema = z.object({
conflicts: arrayOrEmpty(z.unknown()), conflicts: arrayOrEmpty(z.unknown()),
@@ -7,8 +7,8 @@ import {
booleanOrFalse, booleanOrFalse,
schemaOrNull, schemaOrNull,
stringOrEmpty, stringOrEmpty,
} from "../nullable-defaults"; } from "../../nullable-defaults";
import { UserSchema } from "../user/user"; import { UserSchema } from "../../user/user";
export const FacebookPsidLoginResponseSchema = z.object({ export const FacebookPsidLoginResponseSchema = z.object({
token: z.string(), token: z.string(),
@@ -4,8 +4,8 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { booleanOrTrue, numberOr, schemaOrNull } from "../nullable-defaults"; import { booleanOrTrue, numberOr, schemaOrNull } from "../../nullable-defaults";
import { UserSchema } from "../user/user"; import { UserSchema } from "../../user/user";
export const GuestLoginResponseSchema = z.object({ export const GuestLoginResponseSchema = z.object({
token: z.string(), token: z.string(),
+10
View File
@@ -0,0 +1,10 @@
/**
* @file Automatically generated by barrelsby.
*/
export * from "./facebook_identity_response";
export * from "./facebook_psid_login_response";
export * from "./guest_login_response";
export * from "./login_response";
export * from "./logout_response";
export * from "./refresh_token_response";
@@ -4,8 +4,8 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { stringOrEmpty } from "../nullable-defaults"; import { stringOrEmpty } from "../../nullable-defaults";
import { UserSchema } from "../user/user"; import { UserSchema } from "../../user/user";
export const LoginResponseSchema = z.object({ export const LoginResponseSchema = z.object({
user: UserSchema, user: UserSchema,
@@ -4,7 +4,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { booleanOrTrue } from "../nullable-defaults"; import { booleanOrTrue } from "../../nullable-defaults";
export const LogoutResponseSchema = z.object({ export const LogoutResponseSchema = z.object({
success: booleanOrTrue, success: booleanOrTrue,
+9
View File
@@ -0,0 +1,9 @@
import { z } from "zod";
export const ChatLockTypeSchema = z.enum([
"voice_message",
"image_paywall",
"private_message",
]);
export type ChatLockType = z.output<typeof ChatLockTypeSchema>;
+7 -6
View File
@@ -2,11 +2,12 @@
* @file Automatically generated by barrelsby. * @file Automatically generated by barrelsby.
*/ */
export * from "./chat_history_response"; export * from "./chat_lock_type";
export * from "./chat_message"; export * from "./chat_message";
export * from "./chat_payloads"; export * from "./chat_payloads";
export * from "./chat_send_response"; export * from "./request/send_message_request";
export * from "./send_message_request"; export * from "./request/unlock_private_request";
export * from "./unlock_history_response"; export * from "./response/chat_history_response";
export * from "./unlock_private_request"; export * from "./response/chat_send_response";
export * from "./unlock_private_response"; export * from "./response/unlock_history_response";
export * from "./response/unlock_private_response";
+6
View File
@@ -0,0 +1,6 @@
/**
* @file Automatically generated by barrelsby.
*/
export * from "./send_message_request";
export * from "./unlock_private_request";
@@ -4,7 +4,11 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { booleanOrFalse, numberOrZero, stringOrEmpty } from "../nullable-defaults"; import {
booleanOrFalse,
numberOrZero,
stringOrEmpty,
} from "../../nullable-defaults";
export const SendMessageRequestSchema = z.object({ export const SendMessageRequestSchema = z.object({
message: stringOrEmpty, message: stringOrEmpty,
@@ -3,11 +3,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
export const ChatLockTypeSchema = z.enum([ import { ChatLockTypeSchema } from "../chat_lock_type";
"voice_message",
"image_paywall",
"private_message",
]);
export const UnlockPrivateRequestSchema = z export const UnlockPrivateRequestSchema = z
.object({ .object({
@@ -19,8 +15,6 @@ export const UnlockPrivateRequestSchema = z
message: "messageId or lockType is required", message: "messageId or lockType is required",
}); });
export type ChatLockType = z.output<typeof ChatLockTypeSchema>;
export type UnlockPrivateRequestInput = z.input< export type UnlockPrivateRequestInput = z.input<
typeof UnlockPrivateRequestSchema typeof UnlockPrivateRequestSchema
>; >;
@@ -4,8 +4,12 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { arrayOrEmpty, booleanOrFalse, numberOrZero } from "../nullable-defaults"; import {
import { ChatMessageSchema } from "./chat_message"; arrayOrEmpty,
booleanOrFalse,
numberOrZero,
} from "../../nullable-defaults";
import { ChatMessageSchema } from "../chat_message";
export const ChatHistoryResponseSchema = z.object({ export const ChatHistoryResponseSchema = z.object({
messages: arrayOrEmpty(ChatMessageSchema), messages: arrayOrEmpty(ChatMessageSchema),
@@ -9,8 +9,8 @@ import {
numberOrLazy, numberOrLazy,
numberOrZero, numberOrZero,
stringOrEmpty, stringOrEmpty,
} from "../nullable-defaults"; } from "../../nullable-defaults";
import { ChatImageSchema, ChatLockDetailSchema } from "./chat_payloads"; import { ChatImageSchema, ChatLockDetailSchema } from "../chat_payloads";
export const ChatSendResponseSchema = z.object({ export const ChatSendResponseSchema = z.object({
reply: stringOrEmpty, reply: stringOrEmpty,
+8
View File
@@ -0,0 +1,8 @@
/**
* @file Automatically generated by barrelsby.
*/
export * from "./chat_history_response";
export * from "./chat_send_response";
export * from "./unlock_history_response";
export * from "./unlock_private_response";
@@ -3,7 +3,12 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { arrayOrEmpty, booleanOrFalse, numberOrZero, recordOrEmpty } from "../nullable-defaults"; import {
arrayOrEmpty,
booleanOrFalse,
numberOrZero,
recordOrEmpty,
} from "../../nullable-defaults";
export const UnlockHistoryCostsByMessageSchema = recordOrEmpty(z.number()); export const UnlockHistoryCostsByMessageSchema = recordOrEmpty(z.number());
@@ -5,9 +5,9 @@ import {
numberOrZero, numberOrZero,
stringOrEmpty, stringOrEmpty,
stringOrNull, stringOrNull,
} from "../nullable-defaults"; } from "../../nullable-defaults";
import { ChatImageSchema, ChatLockDetailSchema } from "./chat_payloads"; import { ChatImageSchema, ChatLockDetailSchema } from "../chat_payloads";
import { ChatLockTypeSchema } from "./unlock_private_request"; import { ChatLockTypeSchema } from "../chat_lock_type";
/** /**
* / * /
+2 -2
View File
@@ -2,5 +2,5 @@
* @file Automatically generated by barrelsby. * @file Automatically generated by barrelsby.
*/ */
export * from "./app_event"; export * from "./request/app_event";
export * from "./pwa_event"; export * from "./request/pwa_event";
@@ -4,7 +4,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { stringOrEmpty } from "../nullable-defaults"; import { stringOrEmpty } from "../../nullable-defaults";
export const AppEventSchema = z.object({ export const AppEventSchema = z.object({
userId: stringOrEmpty, userId: stringOrEmpty,
@@ -0,0 +1,6 @@
/**
* @file Automatically generated by barrelsby.
*/
export * from "./app_event";
export * from "./pwa_event";
@@ -8,7 +8,7 @@ import {
booleanOrFalse, booleanOrFalse,
numberOrZero, numberOrZero,
stringOrEmpty, stringOrEmpty,
} from "../nullable-defaults"; } from "../../nullable-defaults";
export const PwaEventSchema = z.object({ export const PwaEventSchema = z.object({
deviceId: stringOrEmpty, deviceId: stringOrEmpty,
+6 -6
View File
@@ -1,11 +1,11 @@
/** /**
* @file Payment schema barrel. * @file Automatically generated by barrelsby.
*/ */
export * from "./create_payment_order_request";
export * from "./create_payment_order_response";
export * from "./payment_order_status_response";
export * from "./payment_plan"; export * from "./payment_plan";
export * from "./payment_plans_response";
export * from "./tip_payment_plan"; export * from "./tip_payment_plan";
export * from "./tip_payment_plans_response"; export * from "./request/create_payment_order_request";
export * from "./response/create_payment_order_response";
export * from "./response/payment_order_status_response";
export * from "./response/payment_plans_response";
export * from "./response/tip_payment_plans_response";
@@ -0,0 +1,5 @@
/**
* @file Automatically generated by barrelsby.
*/
export * from "./create_payment_order_request";
@@ -3,7 +3,7 @@
*/ */
import { z } from "zod"; import { z } from "zod";
import { stringOrNull } from "../nullable-defaults"; import { stringOrNull } from "../../nullable-defaults";
const paymentUrlKeys = [ const paymentUrlKeys = [
"cashierUrl", "cashierUrl",
@@ -0,0 +1,8 @@
/**
* @file Automatically generated by barrelsby.
*/
export * from "./create_payment_order_response";
export * from "./payment_order_status_response";
export * from "./payment_plans_response";
export * from "./tip_payment_plans_response";
@@ -9,8 +9,8 @@ import {
numberOrZero, numberOrZero,
schemaOrNull, schemaOrNull,
stringOrEmpty, stringOrEmpty,
} from "../nullable-defaults"; } from "../../nullable-defaults";
import { PaymentPlanSchema } from "./payment_plan"; import { PaymentPlanSchema } from "../payment_plan";
export const FirstRechargeOfferSchema = z.object({ export const FirstRechargeOfferSchema = z.object({
enabled: booleanOrFalse, enabled: booleanOrFalse,
@@ -1,7 +1,7 @@
import { z } from "zod"; import { z } from "zod";
import { arrayOrEmpty } from "../nullable-defaults"; import { arrayOrEmpty } from "../../nullable-defaults";
import { TipPaymentPlanSchema } from "./tip_payment_plan"; import { TipPaymentPlanSchema } from "../tip_payment_plan";
export const TipPaymentPlansResponseSchema = z.object({ export const TipPaymentPlansResponseSchema = z.object({
plans: arrayOrEmpty(TipPaymentPlanSchema), plans: arrayOrEmpty(TipPaymentPlanSchema),
+7 -3
View File
@@ -1,4 +1,8 @@
/**
* @file Automatically generated by barrelsby.
*/
export * from "./private_album"; export * from "./private_album";
export * from "./private_albums_response"; export * from "./request/unlock_private_album_request";
export * from "./private_album_unlock_response"; export * from "./response/private_album_unlock_response";
export * from "./unlock_private_album_request"; export * from "./response/private_albums_response";
@@ -0,0 +1,5 @@
/**
* @file Automatically generated by barrelsby.
*/
export * from "./unlock_private_album_request";
@@ -1,6 +1,6 @@
import { z } from "zod"; import { z } from "zod";
import { numberOrZero } from "../nullable-defaults"; import { numberOrZero } from "../../nullable-defaults";
export const UnlockPrivateAlbumRequestSchema = z.object({ export const UnlockPrivateAlbumRequestSchema = z.object({
expectedCost: numberOrZero, expectedCost: numberOrZero,
@@ -0,0 +1,6 @@
/**
* @file Automatically generated by barrelsby.
*/
export * from "./private_album_unlock_response";
export * from "./private_albums_response";
@@ -5,8 +5,8 @@ import {
booleanOrFalse, booleanOrFalse,
numberOrZero, numberOrZero,
stringOrEmpty, stringOrEmpty,
} from "../nullable-defaults"; } from "../../nullable-defaults";
import { PrivateAlbumImageSchema } from "./private_album"; import { PrivateAlbumImageSchema } from "../private_album";
export const PrivateAlbumUnlockReasonSchema = z.enum([ export const PrivateAlbumUnlockReasonSchema = z.enum([
"ok", "ok",
@@ -1,7 +1,7 @@
import { z } from "zod"; import { z } from "zod";
import { arrayOrEmpty, numberOrZero } from "../nullable-defaults"; import { arrayOrEmpty, numberOrZero } from "../../nullable-defaults";
import { PrivateAlbumSchema } from "./private_album"; import { PrivateAlbumSchema } from "../private_album";
export const PrivateAlbumsResponseSchema = z.object({ export const PrivateAlbumsResponseSchema = z.object({
items: arrayOrEmpty(PrivateAlbumSchema), items: arrayOrEmpty(PrivateAlbumSchema),
+20 -20
View File
@@ -42,28 +42,28 @@ export * from "../dto/user/avatar_data";
export * from "../dto/user/personality_traits"; export * from "../dto/user/personality_traits";
export * from "../dto/user/recent_memory"; export * from "../dto/user/recent_memory";
export * from "../dto/user/user"; export * from "../dto/user/user";
export * from "../schemas/auth/facebook_login_request"; export * from "../schemas/auth/request/facebook_login_request";
export * from "../schemas/auth/facebook_identity_request"; export * from "../schemas/auth/request/facebook_identity_request";
export * from "../schemas/auth/facebook_identity_response"; export * from "../schemas/auth/response/facebook_identity_response";
export * from "../schemas/auth/facebook_psid_login_request"; export * from "../schemas/auth/request/facebook_psid_login_request";
export * from "../schemas/auth/facebook_psid_login_response"; export * from "../schemas/auth/response/facebook_psid_login_response";
export * from "../schemas/auth/facebook_user_data"; export * from "../schemas/auth/facebook_user_data";
export * from "../schemas/auth/fb_id_login_request"; export * from "../schemas/auth/request/fb_id_login_request";
export * from "../schemas/auth/google_login_request"; export * from "../schemas/auth/request/google_login_request";
export * from "../schemas/auth/guest_login_request"; export * from "../schemas/auth/request/guest_login_request";
export * from "../schemas/auth/guest_login_response"; export * from "../schemas/auth/response/guest_login_response";
export * from "../schemas/auth/login_request"; export * from "../schemas/auth/request/login_request";
export * from "../schemas/auth/login_response"; export * from "../schemas/auth/response/login_response";
export * from "../schemas/auth/logout_response"; export * from "../schemas/auth/response/logout_response";
export * from "../schemas/auth/refresh_token_request"; export * from "../schemas/auth/request/refresh_token_request";
export * from "../schemas/auth/refresh_token_response"; export * from "../schemas/auth/response/refresh_token_response";
export * from "../schemas/auth/register_request"; export * from "../schemas/auth/request/register_request";
export * from "../schemas/chat/chat_history_response"; export * from "../schemas/chat/response/chat_history_response";
export * from "../schemas/chat/chat_message"; export * from "../schemas/chat/chat_message";
export * from "../schemas/chat/chat_send_response"; export * from "../schemas/chat/response/chat_send_response";
export * from "../schemas/chat/send_message_request"; export * from "../schemas/chat/request/send_message_request";
export * from "../schemas/metrics/app_event"; export * from "../schemas/metrics/request/app_event";
export * from "../schemas/metrics/pwa_event"; export * from "../schemas/metrics/request/pwa_event";
export * from "../schemas/user/avatar_data"; export * from "../schemas/user/avatar_data";
export * from "../schemas/user/personality_traits"; export * from "../schemas/user/personality_traits";
export * from "../schemas/user/recent_memory"; export * from "../schemas/user/recent_memory";