fix: use API v0 on iOS (#2858) [skip e2e]
This commit is contained in:
@@ -15,7 +15,10 @@ import { AuthApiServiceInterface } from './AuthApiServiceInterface'
|
||||
export class AuthApiService implements AuthApiServiceInterface {
|
||||
private operationsInProgress: Map<AuthApiOperations, boolean>
|
||||
|
||||
constructor(private authServer: AuthServerInterface) {
|
||||
constructor(
|
||||
private authServer: AuthServerInterface,
|
||||
private apiVersion: ApiVersion,
|
||||
) {
|
||||
this.operationsInProgress = new Map()
|
||||
}
|
||||
|
||||
@@ -50,7 +53,7 @@ export class AuthApiService implements AuthApiServiceInterface {
|
||||
|
||||
try {
|
||||
const response = await this.authServer.recoveryKeyParams({
|
||||
api_version: ApiVersion.v1,
|
||||
api_version: this.apiVersion,
|
||||
code_challenge: dto.codeChallenge,
|
||||
recovery_codes: dto.recoveryCodes,
|
||||
username: dto.username,
|
||||
@@ -78,7 +81,7 @@ export class AuthApiService implements AuthApiServiceInterface {
|
||||
|
||||
try {
|
||||
const response = await this.authServer.signInWithRecoveryCodes({
|
||||
api_version: ApiVersion.v1,
|
||||
api_version: this.apiVersion,
|
||||
code_verifier: dto.codeVerifier,
|
||||
password: dto.password,
|
||||
recovery_codes: dto.recoveryCodes,
|
||||
|
||||
@@ -23,7 +23,10 @@ import { GetUserSubscriptionRequestParams } from '../../Request/Subscription/Get
|
||||
export class SubscriptionApiService implements SubscriptionApiServiceInterface {
|
||||
private operationsInProgress: Map<SubscriptionApiOperations, boolean>
|
||||
|
||||
constructor(private subscriptionServer: SubscriptionServerInterface) {
|
||||
constructor(
|
||||
private subscriptionServer: SubscriptionServerInterface,
|
||||
private apiVersion: ApiVersion,
|
||||
) {
|
||||
this.operationsInProgress = new Map()
|
||||
}
|
||||
|
||||
@@ -36,7 +39,7 @@ export class SubscriptionApiService implements SubscriptionApiServiceInterface {
|
||||
|
||||
try {
|
||||
const response = await this.subscriptionServer.listInvites({
|
||||
[ApiEndpointParam.ApiVersion]: ApiVersion.v1,
|
||||
[ApiEndpointParam.ApiVersion]: this.apiVersion,
|
||||
})
|
||||
|
||||
return response
|
||||
@@ -56,7 +59,7 @@ export class SubscriptionApiService implements SubscriptionApiServiceInterface {
|
||||
|
||||
try {
|
||||
const response = await this.subscriptionServer.cancelInvite({
|
||||
[ApiEndpointParam.ApiVersion]: ApiVersion.v1,
|
||||
[ApiEndpointParam.ApiVersion]: this.apiVersion,
|
||||
inviteUuid,
|
||||
})
|
||||
|
||||
@@ -77,7 +80,7 @@ export class SubscriptionApiService implements SubscriptionApiServiceInterface {
|
||||
|
||||
try {
|
||||
const response = await this.subscriptionServer.invite({
|
||||
[ApiEndpointParam.ApiVersion]: ApiVersion.v1,
|
||||
[ApiEndpointParam.ApiVersion]: this.apiVersion,
|
||||
identifier: inviteeEmail,
|
||||
})
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ export class UserApiService implements UserApiServiceInterface {
|
||||
constructor(
|
||||
private userServer: UserServerInterface,
|
||||
private userRequestServer: UserRequestServerInterface,
|
||||
private apiVersion: ApiVersion,
|
||||
) {
|
||||
this.operationsInProgress = new Map()
|
||||
}
|
||||
@@ -72,7 +73,7 @@ export class UserApiService implements UserApiServiceInterface {
|
||||
|
||||
try {
|
||||
const response = await this.userServer.register({
|
||||
[ApiEndpointParam.ApiVersion]: ApiVersion.v1,
|
||||
[ApiEndpointParam.ApiVersion]: this.apiVersion,
|
||||
password: registerDTO.serverPassword,
|
||||
email: registerDTO.email,
|
||||
ephemeral: registerDTO.ephemeral,
|
||||
@@ -92,7 +93,7 @@ export class UserApiService implements UserApiServiceInterface {
|
||||
|
||||
try {
|
||||
const response = await this.userServer.update({
|
||||
[ApiEndpointParam.ApiVersion]: ApiVersion.v1,
|
||||
[ApiEndpointParam.ApiVersion]: this.apiVersion,
|
||||
user_uuid: updateDTO.userUuid,
|
||||
})
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ export class HttpService implements HttpServiceInterface {
|
||||
private environment: Environment,
|
||||
private appVersion: string,
|
||||
private snjsVersion: string,
|
||||
private apiVersion: ApiVersion,
|
||||
private logger: LoggerInterface,
|
||||
) {
|
||||
this.requestHandler = new FetchRequestHandler(this.snjsVersion, this.appVersion, this.environment, this.logger)
|
||||
@@ -247,7 +248,7 @@ export class HttpService implements HttpServiceInterface {
|
||||
const params = {
|
||||
...inParams,
|
||||
...{
|
||||
[ApiEndpointParam.ApiVersion]: ApiVersion.v1,
|
||||
[ApiEndpointParam.ApiVersion]: this.apiVersion,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user