1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 15:23:33 +00:00

[deps] Autofill: Update prettier to v3 (#7014)

* [deps] Autofill: Update prettier to v3

* prettier formatting updates

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
This commit is contained in:
renovate[bot]
2023-11-29 16:15:20 -05:00
committed by GitHub
parent 4ff5f38e89
commit 28de9439be
1145 changed files with 5898 additions and 5612 deletions

View File

@@ -156,7 +156,7 @@ export class ApiService implements ApiServiceAbstraction {
private environmentService: EnvironmentService,
private appIdService: AppIdService,
private logoutCallback: (expired: boolean) => Promise<void>,
private customUserAgent: string = null
private customUserAgent: string = null,
) {
this.device = platformUtilsService.getDevice();
this.deviceType = this.device.toString();
@@ -185,7 +185,7 @@ export class ApiService implements ApiServiceAbstraction {
| UserApiTokenRequest
| PasswordTokenRequest
| SsoTokenRequest
| WebAuthnLoginTokenRequest
| WebAuthnLoginTokenRequest,
): Promise<IdentityTokenResponse | IdentityTwoFactorResponse | IdentityCaptchaResponse> {
const headers = new Headers({
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
@@ -209,7 +209,7 @@ export class ApiService implements ApiServiceAbstraction {
cache: "no-store",
headers: headers,
method: "POST",
})
}),
);
let responseJson: any = null;
@@ -285,7 +285,7 @@ export class ApiService implements ApiServiceAbstraction {
const requests = await this.getAuthRequests();
const activeRequests = requests.data.filter((m) => !m.isAnswered && !m.isExpired);
const lastRequest = activeRequests.sort((a: AuthRequestResponse, b: AuthRequestResponse) =>
a.creationDate.localeCompare(b.creationDate)
a.creationDate.localeCompare(b.creationDate),
)[activeRequests.length - 1];
return lastRequest;
}
@@ -328,7 +328,7 @@ export class ApiService implements ApiServiceAbstraction {
request,
false,
true,
this.environmentService.getIdentityUrl()
this.environmentService.getIdentityUrl(),
);
return new PreloginResponse(r);
}
@@ -373,7 +373,7 @@ export class ApiService implements ApiServiceAbstraction {
request,
false,
true,
this.environmentService.getIdentityUrl()
this.environmentService.getIdentityUrl(),
);
return new RegisterResponse(r);
}
@@ -425,7 +425,7 @@ export class ApiService implements ApiServiceAbstraction {
}
postAccountVerifyPassword(
request: SecretVerificationRequest
request: SecretVerificationRequest,
): Promise<MasterPasswordPolicyResponse> {
return this.send("POST", "/accounts/verify-password", request, true, true);
}
@@ -457,7 +457,7 @@ export class ApiService implements ApiServiceAbstraction {
async postUserRotateApiKey(
id: string,
request: SecretVerificationRequest
request: SecretVerificationRequest,
): Promise<ApiKeyResponse> {
const r = await this.send("POST", "/accounts/rotate-api-key", request, true, true);
return new ApiKeyResponse(r);
@@ -506,7 +506,7 @@ export class ApiService implements ApiServiceAbstraction {
"/ciphers/organization-details?organizationId=" + organizationId,
null,
true,
true
true,
);
return new ListResponse(r, CipherResponse);
}
@@ -580,7 +580,7 @@ export class ApiService implements ApiServiceAbstraction {
postPurgeCiphers(
request: SecretVerificationRequest,
organizationId: string = null
organizationId: string = null,
): Promise<any> {
let path = "/ciphers/purge";
if (organizationId != null) {
@@ -616,14 +616,14 @@ export class ApiService implements ApiServiceAbstraction {
}
async putRestoreManyCiphers(
request: CipherBulkRestoreRequest
request: CipherBulkRestoreRequest,
): Promise<ListResponse<CipherResponse>> {
const r = await this.send("PUT", "/ciphers/restore", request, true, true);
return new ListResponse<CipherResponse>(r, CipherResponse);
}
async putRestoreManyCiphersAdmin(
request: CipherBulkRestoreRequest
request: CipherBulkRestoreRequest,
): Promise<ListResponse<CipherResponse>> {
const r = await this.send("PUT", "/ciphers/restore-admin", request, true, true);
return new ListResponse<CipherResponse>(r, CipherResponse);
@@ -634,7 +634,7 @@ export class ApiService implements ApiServiceAbstraction {
async getAttachmentData(
cipherId: string,
attachmentId: string,
emergencyAccessId?: string
emergencyAccessId?: string,
): Promise<AttachmentResponse> {
const path =
(emergencyAccessId != null ? "/emergency-access/" + emergencyAccessId + "/" : "/ciphers/") +
@@ -647,7 +647,7 @@ export class ApiService implements ApiServiceAbstraction {
async postCipherAttachment(
id: string,
request: AttachmentRequest
request: AttachmentRequest,
): Promise<AttachmentUploadDataResponse> {
const r = await this.send("POST", "/ciphers/" + id + "/attachment/v2", request, true, true);
return new AttachmentUploadDataResponse(r);
@@ -681,7 +681,7 @@ export class ApiService implements ApiServiceAbstraction {
"/ciphers/" + id + "/attachment/" + attachmentId + "/admin",
null,
true,
false
false,
);
}
@@ -689,27 +689,27 @@ export class ApiService implements ApiServiceAbstraction {
id: string,
attachmentId: string,
data: FormData,
organizationId: string
organizationId: string,
): Promise<any> {
return this.send(
"POST",
"/ciphers/" + id + "/attachment/" + attachmentId + "/share?organizationId=" + organizationId,
data,
true,
false
false,
);
}
async renewAttachmentUploadUrl(
id: string,
attachmentId: string
attachmentId: string,
): Promise<AttachmentUploadDataResponse> {
const r = await this.send(
"GET",
"/ciphers/" + id + "/attachment/" + attachmentId + "/renew",
null,
true,
true
true,
);
return new AttachmentUploadDataResponse(r);
}
@@ -722,14 +722,14 @@ export class ApiService implements ApiServiceAbstraction {
async getCollectionAccessDetails(
organizationId: string,
id: string
id: string,
): Promise<CollectionAccessDetailsResponse> {
const r = await this.send(
"GET",
"/organizations/" + organizationId + "/collections/" + id + "/details",
null,
true,
true
true,
);
return new CollectionAccessDetailsResponse(r);
}
@@ -745,48 +745,48 @@ export class ApiService implements ApiServiceAbstraction {
"/organizations/" + organizationId + "/collections",
null,
true,
true
true,
);
return new ListResponse(r, CollectionResponse);
}
async getManyCollectionsWithAccessDetails(
organizationId: string
organizationId: string,
): Promise<ListResponse<CollectionAccessDetailsResponse>> {
const r = await this.send(
"GET",
"/organizations/" + organizationId + "/collections/details",
null,
true,
true
true,
);
return new ListResponse(r, CollectionAccessDetailsResponse);
}
async getCollectionUsers(
organizationId: string,
id: string
id: string,
): Promise<SelectionReadOnlyResponse[]> {
const r = await this.send(
"GET",
"/organizations/" + organizationId + "/collections/" + id + "/users",
null,
true,
true
true,
);
return r.map((dr: any) => new SelectionReadOnlyResponse(dr));
}
async postCollection(
organizationId: string,
request: CollectionRequest
request: CollectionRequest,
): Promise<CollectionResponse> {
const r = await this.send(
"POST",
"/organizations/" + organizationId + "/collections",
request,
true,
true
true,
);
return new CollectionResponse(r);
}
@@ -794,14 +794,14 @@ export class ApiService implements ApiServiceAbstraction {
async putCollection(
organizationId: string,
id: string,
request: CollectionRequest
request: CollectionRequest,
): Promise<CollectionResponse> {
const r = await this.send(
"PUT",
"/organizations/" + organizationId + "/collections/" + id,
request,
true,
true
true,
);
return new CollectionResponse(r);
}
@@ -809,14 +809,14 @@ export class ApiService implements ApiServiceAbstraction {
async putCollectionUsers(
organizationId: string,
id: string,
request: SelectionReadOnlyRequest[]
request: SelectionReadOnlyRequest[],
): Promise<any> {
await this.send(
"PUT",
"/organizations/" + organizationId + "/collections/" + id + "/users",
request,
true,
false
false,
);
}
@@ -826,7 +826,7 @@ export class ApiService implements ApiServiceAbstraction {
"/organizations/" + organizationId + "/collections/" + id,
null,
true,
false
false,
);
}
@@ -836,21 +836,21 @@ export class ApiService implements ApiServiceAbstraction {
"/organizations/" + organizationId + "/collections",
new CollectionBulkDeleteRequest(collectionIds),
true,
false
false,
);
}
deleteCollectionUser(
organizationId: string,
id: string,
organizationUserId: string
organizationUserId: string,
): Promise<any> {
return this.send(
"DELETE",
"/organizations/" + organizationId + "/collections/" + id + "/user/" + organizationUserId,
null,
true,
false
false,
);
}
@@ -862,7 +862,7 @@ export class ApiService implements ApiServiceAbstraction {
"/organizations/" + organizationId + "/groups/" + id + "/users",
null,
true,
true
true,
);
return r;
}
@@ -873,7 +873,7 @@ export class ApiService implements ApiServiceAbstraction {
"/organizations/" + organizationId + "/groups/" + id + "/users",
request,
true,
false
false,
);
}
@@ -883,7 +883,7 @@ export class ApiService implements ApiServiceAbstraction {
"/organizations/" + organizationId + "/groups/" + id + "/user/" + organizationUserId,
null,
true,
false
false,
);
}
@@ -931,20 +931,20 @@ export class ApiService implements ApiServiceAbstraction {
}
async getTwoFactorOrganizationProviders(
organizationId: string
organizationId: string,
): Promise<ListResponse<TwoFactorProviderResponse>> {
const r = await this.send(
"GET",
"/organizations/" + organizationId + "/two-factor",
null,
true,
true
true,
);
return new ListResponse(r, TwoFactorProviderResponse);
}
async getTwoFactorAuthenticator(
request: SecretVerificationRequest
request: SecretVerificationRequest,
): Promise<TwoFactorAuthenticatorResponse> {
const r = await this.send("POST", "/two-factor/get-authenticator", request, true, true);
return new TwoFactorAuthenticatorResponse(r);
@@ -962,14 +962,14 @@ export class ApiService implements ApiServiceAbstraction {
async getTwoFactorOrganizationDuo(
organizationId: string,
request: SecretVerificationRequest
request: SecretVerificationRequest,
): Promise<TwoFactorDuoResponse> {
const r = await this.send(
"POST",
"/organizations/" + organizationId + "/two-factor/get-duo",
request,
true,
true
true,
);
return new TwoFactorDuoResponse(r);
}
@@ -980,14 +980,14 @@ export class ApiService implements ApiServiceAbstraction {
}
async getTwoFactorWebAuthn(
request: SecretVerificationRequest
request: SecretVerificationRequest,
): Promise<TwoFactorWebAuthnResponse> {
const r = await this.send("POST", "/two-factor/get-webauthn", request, true, true);
return new TwoFactorWebAuthnResponse(r);
}
async getTwoFactorWebAuthnChallenge(
request: SecretVerificationRequest
request: SecretVerificationRequest,
): Promise<ChallengeResponse> {
const r = await this.send("POST", "/two-factor/get-webauthn-challenge", request, true, true);
return new ChallengeResponse(r);
@@ -999,7 +999,7 @@ export class ApiService implements ApiServiceAbstraction {
}
async putTwoFactorAuthenticator(
request: UpdateTwoFactorAuthenticatorRequest
request: UpdateTwoFactorAuthenticatorRequest,
): Promise<TwoFactorAuthenticatorResponse> {
const r = await this.send("PUT", "/two-factor/authenticator", request, true, true);
return new TwoFactorAuthenticatorResponse(r);
@@ -1017,27 +1017,27 @@ export class ApiService implements ApiServiceAbstraction {
async putTwoFactorOrganizationDuo(
organizationId: string,
request: UpdateTwoFactorDuoRequest
request: UpdateTwoFactorDuoRequest,
): Promise<TwoFactorDuoResponse> {
const r = await this.send(
"PUT",
"/organizations/" + organizationId + "/two-factor/duo",
request,
true,
true
true,
);
return new TwoFactorDuoResponse(r);
}
async putTwoFactorYubiKey(
request: UpdateTwoFactorYubioOtpRequest
request: UpdateTwoFactorYubioOtpRequest,
): Promise<TwoFactorYubiKeyResponse> {
const r = await this.send("PUT", "/two-factor/yubikey", request, true, true);
return new TwoFactorYubiKeyResponse(r);
}
async putTwoFactorWebAuthn(
request: UpdateTwoFactorWebAuthnRequest
request: UpdateTwoFactorWebAuthnRequest,
): Promise<TwoFactorWebAuthnResponse> {
const response = request.deviceResponse.response as AuthenticatorAttestationResponse;
const data: any = Object.assign({}, request);
@@ -1058,7 +1058,7 @@ export class ApiService implements ApiServiceAbstraction {
}
async deleteTwoFactorWebAuthn(
request: UpdateTwoFactorWebAuthnDeleteRequest
request: UpdateTwoFactorWebAuthnDeleteRequest,
): Promise<TwoFactorWebAuthnResponse> {
const r = await this.send("DELETE", "/two-factor/webauthn", request, true, true);
return new TwoFactorWebAuthnResponse(r);
@@ -1071,14 +1071,14 @@ export class ApiService implements ApiServiceAbstraction {
async putTwoFactorOrganizationDisable(
organizationId: string,
request: TwoFactorProviderRequest
request: TwoFactorProviderRequest,
): Promise<TwoFactorProviderResponse> {
const r = await this.send(
"PUT",
"/organizations/" + organizationId + "/two-factor/disable",
request,
true,
true
true,
);
return new TwoFactorProviderResponse(r);
}
@@ -1101,20 +1101,20 @@ export class ApiService implements ApiServiceAbstraction {
"/two-factor/get-device-verification-settings",
null,
true,
true
true,
);
return new DeviceVerificationResponse(r);
}
async putDeviceVerificationSettings(
request: DeviceVerificationRequest
request: DeviceVerificationRequest,
): Promise<DeviceVerificationResponse> {
const r = await this.send(
"PUT",
"/two-factor/device-verification-settings",
request,
true,
true
true,
);
return new DeviceVerificationResponse(r);
}
@@ -1129,7 +1129,7 @@ export class ApiService implements ApiServiceAbstraction {
async getOrganizationConnection<TConfig extends OrganizationConnectionConfigApis>(
id: string,
type: OrganizationConnectionType,
configType: { new (response: any): TConfig }
configType: { new (response: any): TConfig },
): Promise<OrganizationConnectionResponse<TConfig>> {
const r = await this.send("GET", `/organizations/connections/${id}/${type}`, null, true, true);
return new OrganizationConnectionResponse(r, configType);
@@ -1137,7 +1137,7 @@ export class ApiService implements ApiServiceAbstraction {
async createOrganizationConnection<TConfig extends OrganizationConnectionConfigApis>(
request: OrganizationConnectionRequest,
configType: { new (response: any): TConfig }
configType: { new (response: any): TConfig },
): Promise<OrganizationConnectionResponse<TConfig>> {
const r = await this.send("POST", "/organizations/connections/", request, true, true);
return new OrganizationConnectionResponse(r, configType);
@@ -1146,14 +1146,14 @@ export class ApiService implements ApiServiceAbstraction {
async updateOrganizationConnection<TConfig extends OrganizationConnectionConfigApis>(
request: OrganizationConnectionRequest,
configType: { new (response: any): TConfig },
organizationConnectionId?: string
organizationConnectionId?: string,
): Promise<OrganizationConnectionResponse<TConfig>> {
const r = await this.send(
"PUT",
"/organizations/connections/" + organizationConnectionId,
request,
true,
true
true,
);
return new OrganizationConnectionResponse(r, configType);
}
@@ -1182,7 +1182,7 @@ export class ApiService implements ApiServiceAbstraction {
// Provider User APIs
async getProviderUsers(
providerId: string
providerId: string,
): Promise<ListResponse<ProviderUserUserDetailsResponse>> {
const r = await this.send("GET", "/providers/" + providerId + "/users", null, true, true);
return new ListResponse(r, ProviderUserUserDetailsResponse);
@@ -1203,41 +1203,41 @@ export class ApiService implements ApiServiceAbstraction {
"/providers/" + providerId + "/users/" + id + "/reinvite",
null,
true,
false
false,
);
}
async postManyProviderUserReinvite(
providerId: string,
request: ProviderUserBulkRequest
request: ProviderUserBulkRequest,
): Promise<ListResponse<ProviderUserBulkResponse>> {
const r = await this.send(
"POST",
"/providers/" + providerId + "/users/reinvite",
request,
true,
true
true,
);
return new ListResponse(r, ProviderUserBulkResponse);
}
async postProviderUserBulkConfirm(
providerId: string,
request: ProviderUserBulkConfirmRequest
request: ProviderUserBulkConfirmRequest,
): Promise<ListResponse<ProviderUserBulkResponse>> {
const r = await this.send(
"POST",
"/providers/" + providerId + "/users/confirm",
request,
true,
true
true,
);
return new ListResponse(r, ProviderUserBulkResponse);
}
async deleteManyProviderUsers(
providerId: string,
request: ProviderUserBulkRequest
request: ProviderUserBulkRequest,
): Promise<ListResponse<ProviderUserBulkResponse>> {
const r = await this.send("DELETE", "/providers/" + providerId + "/users", request, true, true);
return new ListResponse(r, ProviderUserBulkResponse);
@@ -1246,41 +1246,41 @@ export class ApiService implements ApiServiceAbstraction {
postProviderUserAccept(
providerId: string,
id: string,
request: ProviderUserAcceptRequest
request: ProviderUserAcceptRequest,
): Promise<any> {
return this.send(
"POST",
"/providers/" + providerId + "/users/" + id + "/accept",
request,
true,
false
false,
);
}
postProviderUserConfirm(
providerId: string,
id: string,
request: ProviderUserConfirmRequest
request: ProviderUserConfirmRequest,
): Promise<any> {
return this.send(
"POST",
"/providers/" + providerId + "/users/" + id + "/confirm",
request,
true,
false
false,
);
}
async postProviderUsersPublicKey(
providerId: string,
request: ProviderUserBulkRequest
request: ProviderUserBulkRequest,
): Promise<ListResponse<ProviderUserBulkPublicKeyResponse>> {
const r = await this.send(
"POST",
"/providers/" + providerId + "/users/public-keys",
request,
true,
true
true,
);
return new ListResponse(r, ProviderUserBulkPublicKeyResponse);
}
@@ -1288,7 +1288,7 @@ export class ApiService implements ApiServiceAbstraction {
putProviderUser(
providerId: string,
id: string,
request: ProviderUserUpdateRequest
request: ProviderUserUpdateRequest,
): Promise<any> {
return this.send("PUT", "/providers/" + providerId + "/users/" + id, request, true, false);
}
@@ -1300,41 +1300,41 @@ export class ApiService implements ApiServiceAbstraction {
// Provider Organization APIs
async getProviderClients(
providerId: string
providerId: string,
): Promise<ListResponse<ProviderOrganizationOrganizationDetailsResponse>> {
const r = await this.send(
"GET",
"/providers/" + providerId + "/organizations",
null,
true,
true
true,
);
return new ListResponse(r, ProviderOrganizationOrganizationDetailsResponse);
}
postProviderAddOrganization(
providerId: string,
request: ProviderAddOrganizationRequest
request: ProviderAddOrganizationRequest,
): Promise<any> {
return this.send(
"POST",
"/providers/" + providerId + "/organizations/add",
request,
true,
false
false,
);
}
async postProviderCreateOrganization(
providerId: string,
request: ProviderOrganizationCreateRequest
request: ProviderOrganizationCreateRequest,
): Promise<ProviderOrganizationResponse> {
const r = await this.send(
"POST",
"/providers/" + providerId + "/organizations",
request,
true,
true
true,
);
return new ProviderOrganizationResponse(r);
}
@@ -1345,7 +1345,7 @@ export class ApiService implements ApiServiceAbstraction {
"/providers/" + providerId + "/organizations/" + id,
null,
true,
false
false,
);
}
@@ -1357,7 +1357,7 @@ export class ApiService implements ApiServiceAbstraction {
this.addEventParameters("/events", start, end, token),
null,
true,
true
true,
);
return new ListResponse(r, EventResponse);
}
@@ -1366,14 +1366,14 @@ export class ApiService implements ApiServiceAbstraction {
id: string,
start: string,
end: string,
token: string
token: string,
): Promise<ListResponse<EventResponse>> {
const r = await this.send(
"GET",
this.addEventParameters("/ciphers/" + id + "/events", start, end, token),
null,
true,
true
true,
);
return new ListResponse(r, EventResponse);
}
@@ -1382,14 +1382,14 @@ export class ApiService implements ApiServiceAbstraction {
id: string,
start: string,
end: string,
token: string
token: string,
): Promise<ListResponse<EventResponse>> {
const r = await this.send(
"GET",
this.addEventParameters("/organizations/" + id + "/events", start, end, token),
null,
true,
true
true,
);
return new ListResponse(r, EventResponse);
}
@@ -1399,7 +1399,7 @@ export class ApiService implements ApiServiceAbstraction {
id: string,
start: string,
end: string,
token: string
token: string,
): Promise<ListResponse<EventResponse>> {
const r = await this.send(
"GET",
@@ -1407,11 +1407,11 @@ export class ApiService implements ApiServiceAbstraction {
"/organizations/" + organizationId + "/users/" + id + "/events",
start,
end,
token
token,
),
null,
true,
true
true,
);
return new ListResponse(r, EventResponse);
}
@@ -1420,14 +1420,14 @@ export class ApiService implements ApiServiceAbstraction {
id: string,
start: string,
end: string,
token: string
token: string,
): Promise<ListResponse<EventResponse>> {
const r = await this.send(
"GET",
this.addEventParameters("/providers/" + id + "/events", start, end, token),
null,
true,
true
true,
);
return new ListResponse(r, EventResponse);
}
@@ -1437,7 +1437,7 @@ export class ApiService implements ApiServiceAbstraction {
id: string,
start: string,
end: string,
token: string
token: string,
): Promise<ListResponse<EventResponse>> {
const r = await this.send(
"GET",
@@ -1445,11 +1445,11 @@ export class ApiService implements ApiServiceAbstraction {
"/providers/" + providerId + "/users/" + id + "/events",
start,
end,
token
token,
),
null,
true,
true
true,
);
return new ListResponse(r, EventResponse);
}
@@ -1471,7 +1471,7 @@ export class ApiService implements ApiServiceAbstraction {
method: "POST",
body: JSON.stringify(request),
headers: headers,
})
}),
);
if (response.status !== 200) {
return Promise.reject("Event post failed.");
@@ -1507,7 +1507,7 @@ export class ApiService implements ApiServiceAbstraction {
// Key Connector
async getMasterKeyFromKeyConnector(
keyConnectorUrl: string
keyConnectorUrl: string,
): Promise<KeyConnectorUserKeyResponse> {
const authHeader = await this.getActiveBearerToken();
@@ -1519,7 +1519,7 @@ export class ApiService implements ApiServiceAbstraction {
Accept: "application/json",
Authorization: "Bearer " + authHeader,
}),
})
}),
);
if (response.status !== 200) {
@@ -1532,7 +1532,7 @@ export class ApiService implements ApiServiceAbstraction {
async postUserKeyToKeyConnector(
keyConnectorUrl: string,
request: KeyConnectorUserKeyRequest
request: KeyConnectorUserKeyRequest,
): Promise<void> {
const authHeader = await this.getActiveBearerToken();
@@ -1546,7 +1546,7 @@ export class ApiService implements ApiServiceAbstraction {
"Content-Type": "application/json; charset=utf-8",
}),
body: JSON.stringify(request),
})
}),
);
if (response.status !== 200) {
@@ -1564,7 +1564,7 @@ export class ApiService implements ApiServiceAbstraction {
Accept: "application/json",
"Content-Type": "application/json; charset=utf-8",
}),
})
}),
);
if (response.status !== 200) {
@@ -1579,7 +1579,7 @@ export class ApiService implements ApiServiceAbstraction {
"/organizations/" + organizationId + "/export",
null,
true,
true
true,
);
return new OrganizationExportResponse(r);
}
@@ -1603,7 +1603,7 @@ export class ApiService implements ApiServiceAbstraction {
request.headers.set("Bitwarden-Client-Name", this.platformUtilsService.getClientType());
request.headers.set(
"Bitwarden-Client-Version",
await this.platformUtilsService.getApplicationVersionNumber()
await this.platformUtilsService.getApplicationVersionNumber(),
);
return this.nativeFetch(request);
}
@@ -1631,7 +1631,7 @@ export class ApiService implements ApiServiceAbstraction {
credentials: this.getCredentials(),
headers: headers,
method: "GET",
})
}),
);
if (response.status === 200) {
@@ -1645,7 +1645,7 @@ export class ApiService implements ApiServiceAbstraction {
async postCreateSponsorship(
sponsoredOrgId: string,
request: OrganizationSponsorshipCreateRequest
request: OrganizationSponsorshipCreateRequest,
): Promise<void> {
return await this.send(
"POST",
@@ -1655,19 +1655,19 @@ export class ApiService implements ApiServiceAbstraction {
"/families-for-enterprise",
request,
true,
false
false,
);
}
async getSponsorshipSyncStatus(
sponsoredOrgId: string
sponsoredOrgId: string,
): Promise<OrganizationSponsorshipSyncStatusResponse> {
const response = await this.send(
"GET",
"/organization/sponsorship/" + sponsoredOrgId + "/sync-status",
null,
true,
true
true,
);
return new OrganizationSponsorshipSyncStatusResponse(response);
}
@@ -1680,7 +1680,7 @@ export class ApiService implements ApiServiceAbstraction {
sponsoringOrganizationId,
null,
true,
false
false,
);
}
@@ -1690,7 +1690,7 @@ export class ApiService implements ApiServiceAbstraction {
"/organization/sponsorship/sponsored/" + sponsoringOrgId,
null,
true,
false
false,
);
}
@@ -1701,21 +1701,21 @@ export class ApiService implements ApiServiceAbstraction {
encodeURIComponent(sponsorshipToken),
null,
true,
true
true,
);
return r as boolean;
}
async postRedeemSponsorship(
sponsorshipToken: string,
request: OrganizationSponsorshipRedeemRequest
request: OrganizationSponsorshipRedeemRequest,
): Promise<void> {
return await this.send(
"POST",
"/organization/sponsorship/redeem?sponsorshipToken=" + encodeURIComponent(sponsorshipToken),
request,
true,
false
false,
);
}
@@ -1725,7 +1725,7 @@ export class ApiService implements ApiServiceAbstraction {
"/organization/sponsorship/" + sponsoringOrgId + "/families-for-enterprise/resend",
null,
true,
false
false,
);
}
@@ -1770,7 +1770,7 @@ export class ApiService implements ApiServiceAbstraction {
credentials: this.getCredentials(),
headers: headers,
method: "POST",
})
}),
);
if (response.status === 200) {
@@ -1779,7 +1779,7 @@ export class ApiService implements ApiServiceAbstraction {
await this.tokenService.setTokens(
tokenResponse.accessToken,
tokenResponse.refreshToken,
null
null,
);
} else {
const error = await this.handleError(response, true, true);
@@ -1797,7 +1797,7 @@ export class ApiService implements ApiServiceAbstraction {
clientId,
clientSecret,
new TokenTwoFactorRequest(),
deviceRequest
deviceRequest,
);
const response = await this.postIdentityToken(tokenRequest);
@@ -1815,7 +1815,7 @@ export class ApiService implements ApiServiceAbstraction {
authed: boolean,
hasResponse: boolean,
apiUrl?: string,
alterHeaders?: (headers: Headers) => void
alterHeaders?: (headers: Headers) => void,
): Promise<any> {
apiUrl = Utils.isNullOrWhitespace(apiUrl) ? this.environmentService.getApiUrl() : apiUrl;
@@ -1878,7 +1878,7 @@ export class ApiService implements ApiServiceAbstraction {
private async handleError(
response: Response,
tokenError: boolean,
authed: boolean
authed: boolean,
): Promise<ErrorResponse> {
let responseJson: any = null;
if (this.isJsonResponse(response)) {