feat(auth): Google/Apple login, named custom providers, identity link/unlink
This commit is contained in:
+37
-1
@@ -1,6 +1,6 @@
|
||||
// Code generated by apigen. DO NOT EDIT.
|
||||
|
||||
import type { LoginViaCustomRequest, LoginViaCustomResponse, LoginViaDeviceRequest, LoginViaDeviceResponse, RefreshAccessTokenRequest, RefreshAccessTokenResponse } from './auth.js';
|
||||
import type { LinkViaAppleRequest, LinkViaCustomRequest, LinkViaGoogleRequest, LoginViaAppleRequest, LoginViaAppleResponse, LoginViaCustomRequest, LoginViaCustomResponse, LoginViaDeviceRequest, LoginViaDeviceResponse, LoginViaGoogleRequest, LoginViaGoogleResponse, RefreshAccessTokenRequest, RefreshAccessTokenResponse, UnlinkIdentityRequest } from './auth.js';
|
||||
import type { AddBattlePassXpRequest, AddBattlePassXpResponse, ClaimBattlePassRewardRequest, ClaimBattlePassRewardResponse, GetBattlePassProgressRequest, GetBattlePassProgressResponse, PurchaseBattlePassPremiumRequest, PurchaseBattlePassPremiumResponse } from './battlepass.js';
|
||||
import type { ListCatalogItemsResponse } from './catalog.js';
|
||||
import type { GetInventoryResponse } from './inventory.js';
|
||||
@@ -118,6 +118,24 @@ export const api = {
|
||||
): Promise<HandleScenarioCallbackResponse> =>
|
||||
t.request<HandleScenarioCallbackResponse>('POST', '/sdk/v1/scenarios/callback', body),
|
||||
|
||||
linkViaApple: (
|
||||
t: Transport,
|
||||
body: LinkViaAppleRequest,
|
||||
): Promise<void> =>
|
||||
t.request<void>('POST', '/sdk/v1/authorization/apple/link', body),
|
||||
|
||||
linkViaCustom: (
|
||||
t: Transport,
|
||||
body: LinkViaCustomRequest,
|
||||
): Promise<void> =>
|
||||
t.request<void>('POST', '/sdk/v1/authorization/custom/link', body),
|
||||
|
||||
linkViaGoogle: (
|
||||
t: Transport,
|
||||
body: LinkViaGoogleRequest,
|
||||
): Promise<void> =>
|
||||
t.request<void>('POST', '/sdk/v1/authorization/google/link', body),
|
||||
|
||||
listCatalogItems: (
|
||||
t: Transport,
|
||||
): Promise<ListCatalogItemsResponse> =>
|
||||
@@ -143,6 +161,12 @@ export const api = {
|
||||
): Promise<ListStoresResponse> =>
|
||||
t.request<ListStoresResponse>('GET', '/sdk/v1/stores'),
|
||||
|
||||
loginViaApple: (
|
||||
t: Transport,
|
||||
body: LoginViaAppleRequest,
|
||||
): Promise<LoginViaAppleResponse> =>
|
||||
t.request<LoginViaAppleResponse>('POST', '/sdk/v1/authorization/apple', body),
|
||||
|
||||
loginViaCustom: (
|
||||
t: Transport,
|
||||
body: LoginViaCustomRequest,
|
||||
@@ -155,6 +179,12 @@ export const api = {
|
||||
): Promise<LoginViaDeviceResponse> =>
|
||||
t.request<LoginViaDeviceResponse>('POST', '/sdk/v1/authorization/device', body),
|
||||
|
||||
loginViaGoogle: (
|
||||
t: Transport,
|
||||
body: LoginViaGoogleRequest,
|
||||
): Promise<LoginViaGoogleResponse> =>
|
||||
t.request<LoginViaGoogleResponse>('POST', '/sdk/v1/authorization/google', body),
|
||||
|
||||
purchaseBattlePassPremium: (
|
||||
t: Transport,
|
||||
body: PurchaseBattlePassPremiumRequest,
|
||||
@@ -193,6 +223,12 @@ export const api = {
|
||||
): Promise<TriggerScenarioResponse> =>
|
||||
t.request<TriggerScenarioResponse>('POST', '/sdk/v1/scenarios/trigger', body),
|
||||
|
||||
unlinkIdentity: (
|
||||
t: Transport,
|
||||
body: UnlinkIdentityRequest,
|
||||
): Promise<void> =>
|
||||
t.request<void>('POST', '/sdk/v1/authorization/unlink', body),
|
||||
|
||||
updateProjectStorage: (
|
||||
t: Transport,
|
||||
body: UpdateProjectStorageRequest,
|
||||
|
||||
@@ -1,10 +1,37 @@
|
||||
// Code generated by apigen. DO NOT EDIT.
|
||||
|
||||
export interface LinkViaAppleRequest {
|
||||
"idToken": string;
|
||||
}
|
||||
|
||||
export interface LinkViaCustomRequest {
|
||||
"customData": { [key: string]: unknown };
|
||||
"provider"?: string;
|
||||
}
|
||||
|
||||
export interface LinkViaGoogleRequest {
|
||||
"idToken": string;
|
||||
}
|
||||
|
||||
export interface LoginViaAppleRequest {
|
||||
"idToken": string;
|
||||
"key": string;
|
||||
"language": string;
|
||||
"nickname"?: string;
|
||||
"region": string;
|
||||
}
|
||||
|
||||
export interface LoginViaAppleResponse {
|
||||
"accessToken"?: string;
|
||||
"refreshToken"?: string;
|
||||
}
|
||||
|
||||
export interface LoginViaCustomRequest {
|
||||
"customData"?: { [key: string]: unknown };
|
||||
"key"?: string;
|
||||
"language"?: string;
|
||||
"nickname"?: string;
|
||||
"provider"?: string;
|
||||
"region"?: string;
|
||||
}
|
||||
|
||||
@@ -26,6 +53,19 @@ export interface LoginViaDeviceResponse {
|
||||
"refreshToken"?: string;
|
||||
}
|
||||
|
||||
export interface LoginViaGoogleRequest {
|
||||
"idToken": string;
|
||||
"key": string;
|
||||
"language": string;
|
||||
"nickname"?: string;
|
||||
"region": string;
|
||||
}
|
||||
|
||||
export interface LoginViaGoogleResponse {
|
||||
"accessToken"?: string;
|
||||
"refreshToken"?: string;
|
||||
}
|
||||
|
||||
export interface RefreshAccessTokenRequest {
|
||||
"refreshToken"?: string;
|
||||
}
|
||||
@@ -35,3 +75,7 @@ export interface RefreshAccessTokenResponse {
|
||||
"refreshToken"?: string;
|
||||
}
|
||||
|
||||
export interface UnlinkIdentityRequest {
|
||||
"provider": string;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,10 +11,17 @@ export interface Player {
|
||||
}
|
||||
|
||||
export interface PlayerProfile {
|
||||
"identities"?: PlayerProfileIdentity[];
|
||||
"player"?: Player;
|
||||
"wallets"?: Wallet[];
|
||||
}
|
||||
|
||||
export interface PlayerProfileIdentity {
|
||||
"createdAt": string;
|
||||
"provider": string;
|
||||
"subject": string;
|
||||
}
|
||||
|
||||
export interface Wallet {
|
||||
"balance"?: number;
|
||||
"currency"?: string;
|
||||
|
||||
Reference in New Issue
Block a user