mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
[EC-826] Merge license sync feature branch to master (#4503)
* [EC-816] Separate cloud and selfhosted subscription components (#4383) * [EC-636] Add license sync to web vault (#4441) * [EC-1036] Show correct last license sync date (#4558) * [EC-1044] Fix: accidentally changed shared i18n string
This commit is contained in:
@@ -58,4 +58,5 @@ export class OrganizationApiServiceAbstraction {
|
||||
updateKeys: (id: string, request: OrganizationKeysRequest) => Promise<OrganizationKeysResponse>;
|
||||
getSso: (id: string) => Promise<OrganizationSsoResponse>;
|
||||
updateSso: (id: string, request: OrganizationSsoRequest) => Promise<OrganizationSsoResponse>;
|
||||
selfHostedSyncLicense: (id: string) => Promise<void>;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { BaseResponse } from "../response/base.response";
|
||||
|
||||
export class BillingSyncConfigApi extends BaseResponse {
|
||||
billingSyncKey: string;
|
||||
lastLicenseSync: Date;
|
||||
|
||||
constructor(data: any) {
|
||||
super(data);
|
||||
@@ -9,5 +10,10 @@ export class BillingSyncConfigApi extends BaseResponse {
|
||||
return;
|
||||
}
|
||||
this.billingSyncKey = this.getResponseProperty("BillingSyncKey");
|
||||
|
||||
const lastLicenseSyncString = this.getResponseProperty("LastLicenseSync");
|
||||
if (lastLicenseSyncString) {
|
||||
this.lastLicenseSync = new Date(lastLicenseSyncString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,13 @@ export class OrganizationApiService implements OrganizationApiServiceAbstraction
|
||||
}
|
||||
|
||||
async createLicense(data: FormData): Promise<OrganizationResponse> {
|
||||
const r = await this.apiService.send("POST", "/organizations/license", data, true, true);
|
||||
const r = await this.apiService.send(
|
||||
"POST",
|
||||
"/organizations/licenses/self-hosted",
|
||||
data,
|
||||
true,
|
||||
true
|
||||
);
|
||||
return new OrganizationResponse(r);
|
||||
}
|
||||
|
||||
@@ -177,7 +183,13 @@ export class OrganizationApiService implements OrganizationApiServiceAbstraction
|
||||
}
|
||||
|
||||
async updateLicense(id: string, data: FormData): Promise<void> {
|
||||
await this.apiService.send("POST", "/organizations/" + id + "/license", data, true, false);
|
||||
await this.apiService.send(
|
||||
"POST",
|
||||
"/organizations/licenses/self-hosted/" + id,
|
||||
data,
|
||||
true,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
async importDirectory(organizationId: string, request: ImportDirectoryRequest): Promise<void> {
|
||||
@@ -270,4 +282,14 @@ export class OrganizationApiService implements OrganizationApiServiceAbstraction
|
||||
// Not broadcasting anything because data on this response doesn't correspond to `Organization`
|
||||
return new OrganizationSsoResponse(r);
|
||||
}
|
||||
|
||||
async selfHostedSyncLicense(id: string) {
|
||||
await this.apiService.send(
|
||||
"POST",
|
||||
"/organizations/licenses/self-hosted/" + id + "/sync/",
|
||||
null,
|
||||
true,
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user