feat(auth): add facebook identity psid login
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Facebook identity 绑定请求
|
||||
*/
|
||||
import { z } from "zod";
|
||||
|
||||
import { stringOrEmpty } from "../nullable-defaults";
|
||||
|
||||
export const FacebookIdentityRequestSchema = z.object({
|
||||
asid: stringOrEmpty,
|
||||
psid: stringOrEmpty,
|
||||
});
|
||||
|
||||
export type FacebookIdentityRequestInput = z.input<
|
||||
typeof FacebookIdentityRequestSchema
|
||||
>;
|
||||
export type FacebookIdentityRequestData = z.output<
|
||||
typeof FacebookIdentityRequestSchema
|
||||
>;
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Facebook identity 绑定响应
|
||||
*/
|
||||
import { z } from "zod";
|
||||
|
||||
import { arrayOrEmpty, stringOrEmpty } from "../nullable-defaults";
|
||||
|
||||
export const FacebookIdentityBindingSchema = z.object({
|
||||
conflicts: arrayOrEmpty(z.unknown()),
|
||||
bound: arrayOrEmpty(z.unknown()),
|
||||
});
|
||||
|
||||
export const FacebookIdentityResponseSchema = z.object({
|
||||
fbAsid: stringOrEmpty,
|
||||
fbPsid: stringOrEmpty,
|
||||
facebookBinding: FacebookIdentityBindingSchema.default({
|
||||
conflicts: [],
|
||||
bound: [],
|
||||
}),
|
||||
});
|
||||
|
||||
export type FacebookIdentityResponseInput = z.input<
|
||||
typeof FacebookIdentityResponseSchema
|
||||
>;
|
||||
export type FacebookIdentityResponseData = z.output<
|
||||
typeof FacebookIdentityResponseSchema
|
||||
>;
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Facebook PSID 登录请求
|
||||
*/
|
||||
import { z } from "zod";
|
||||
|
||||
import { booleanOrTrue, stringOrEmpty } from "../nullable-defaults";
|
||||
|
||||
export const FacebookPsidLoginRequestSchema = z.object({
|
||||
psid: z.string(),
|
||||
deviceId: stringOrEmpty,
|
||||
bindToGuest: booleanOrTrue,
|
||||
});
|
||||
|
||||
export type FacebookPsidLoginRequestInput = z.input<
|
||||
typeof FacebookPsidLoginRequestSchema
|
||||
>;
|
||||
export type FacebookPsidLoginRequestData = z.output<
|
||||
typeof FacebookPsidLoginRequestSchema
|
||||
>;
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Facebook PSID 登录响应
|
||||
*/
|
||||
import { z } from "zod";
|
||||
|
||||
import {
|
||||
booleanOrFalse,
|
||||
schemaOrNull,
|
||||
stringOrEmpty,
|
||||
} from "../nullable-defaults";
|
||||
import { UserSchema } from "../user/user";
|
||||
|
||||
export const FacebookPsidLoginResponseSchema = z.object({
|
||||
token: z.string(),
|
||||
refreshToken: stringOrEmpty,
|
||||
matchedBy: stringOrEmpty,
|
||||
fbAsid: stringOrEmpty,
|
||||
fbPsid: stringOrEmpty,
|
||||
hasCompleteFacebookIdentity: booleanOrFalse,
|
||||
isGuest: booleanOrFalse,
|
||||
user: schemaOrNull(UserSchema),
|
||||
userId: stringOrEmpty,
|
||||
});
|
||||
|
||||
export type FacebookPsidLoginResponseInput = z.input<
|
||||
typeof FacebookPsidLoginResponseSchema
|
||||
>;
|
||||
export type FacebookPsidLoginResponseData = z.output<
|
||||
typeof FacebookPsidLoginResponseSchema
|
||||
>;
|
||||
@@ -2,7 +2,11 @@
|
||||
* @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 "./fb_id_login_request";
|
||||
export * from "./google_login_request";
|
||||
|
||||
@@ -17,6 +17,8 @@ export const UserSchema = z.object({
|
||||
platform: stringOrEmpty,
|
||||
country: stringOrEmpty,
|
||||
countryCode: stringOrEmpty,
|
||||
fbAsid: stringOrEmpty,
|
||||
fbPsid: stringOrEmpty,
|
||||
intimacy: numberOrZero,
|
||||
dolBalance: numberOrZero,
|
||||
creditBalance: numberOrZero,
|
||||
|
||||
Reference in New Issue
Block a user