Feature/self hosted families for enterprise (#800)

* Billing Sync Api Keys / Free Bitwarden Families Page updates (#767)

* Work on billing sync api key maintenance

* Add sync status call

* Work on sync status copy

* Return actual model

* Update api calls/models

* Fix linting

* Run linting

* Add in notAllowedValueAsync.validator.ts (#774)

* Add in notAllowedValueAsync.validator.ts

* Fix lint error

* Run prettier

* [PS-248] Feature/manage billing sync connection (#770)

* Define org connection request and responses

* Add organization connection API CRUD

* Linter fixes

* Handle create vs update in component

* PR feedback

* Remove unused import

* Linter fixes

* Use self hosted endpoints for f4e (#779)

* Use self hosted endpoints for f4e

* Call the method

* Chore/merge/self hosted families for enterprise (#778)

* Remove keytar and biometric logic (#706)

* [bug] CL - fix default button display and callout header class (#756)

* [EC-142] Fix error during import of 1pux containing new email field format (#758)

* Add support for complex email field type

* Ensure complex email field type gets imported on identities

* Update introduction for CL (#729)

* Add jsdoc comments for user verification, password reprompt, and appApiAction (#754)

* Rename and add comments to clarify password reprompt classes

* Add comment for appApiAction

* copy default options (#764)

* Update jest configs to remove roots (#766)

* Remove support for alreadyEncrypted (#762)

* Add tests for domain models (#768)

* Fix language always defaulting to english (#765)

* Rename Export DTOs (#763)

* [BEEEP] Allow linking to ciphers (#760)

* Remove userId from data models (#771)

* Add reorganization notice (#776)

* Add reorganization notice

* [BEEEP] Add banner component (#759)

Co-authored-by: Oscar Hinton <oscar@oscarhinton.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>

* Chore/merge/self hosted families for enterprise (#796)

* Remove keytar and biometric logic (#706)

* [bug] CL - fix default button display and callout header class (#756)

* [EC-142] Fix error during import of 1pux containing new email field format (#758)

* Add support for complex email field type

* Ensure complex email field type gets imported on identities

* Update introduction for CL (#729)

* Add jsdoc comments for user verification, password reprompt, and appApiAction (#754)

* Rename and add comments to clarify password reprompt classes

* Add comment for appApiAction

* copy default options (#764)

* Update jest configs to remove roots (#766)

* Remove support for alreadyEncrypted (#762)

* Add tests for domain models (#768)

* Fix language always defaulting to english (#765)

* Rename Export DTOs (#763)

* [BEEEP] Allow linking to ciphers (#760)

* Remove userId from data models (#771)

* Add reorganization notice (#776)

* Add reorganization notice

* [BEEEP] Add banner component (#759)

* [EC-159] [BEEEP] Remove factory providers in Angular DI (#775)

* Forwarded email alias generation (#772)

* generate forwarded alias with SL and AD

* added forwarded email to type list

* add ApiService dep

* ApiServiceAbstraction

* use proper status codes

* only generate on button press

* reset username to `-`

* reset username when forwarded

* Authorization header for anonaddy

* use proper anonaddy json path

* firefox relay support

* update description for firefox

* log username generation errors

* PS-302 Added DeviceId to the 2FA email request and set it when calling the endpoint that's needed to see if it's a 2FA email because of a new device (#782)

* [EC-154] [BEEEP] Add token for localesDirectory (#783)

* Add token for localesDirectory

* Add token for SYSTEM_LANGUAGE

* [PS-74] Fix user authentication state checks (#721)

* Create authService.authStatus, refactor isLocked checks

* Rename authStatus -> getAuthStatus

* [CP-30] Added creditCardNumber pipe for viewing saved card numbers properly (#590)

Co-authored-by: Hinton <oscar@oscarhinton.com>

* Fix linting (#789)

* fix default forwardedService property name (#788)

* Stop clearing list on every reload (#784)

* [EC-151] Hide Subscription/Billing information for Provider-managed organizations (#777)

* add canManageBilling permission and hasProvider helper method

* [feat] End User Vault Refresh (#790)

* Move access logic to org model (#713)

* [feature] Allow for top level groupings to be collapsed (#712)

* [End User Vault Refresh] Refactor route permission checking (#727)

* Update admin access logic

* Centralize route permission handling

* Add permission check for disabled orgs

* [EndUserVaultRefresh] Add base routing guard (#732)

* Add a base class for Angular routing guards

* Update Guard naming convention

* Bump node-forge to 1.2.1 (#722)

* Remove Internet Explorer logic (#723)

* Username generator (#734)

* add support for username generation

* remove unused Router

* pr feedback

* Bump electron and related dependencies (#736)

* PS-91 make isMacAppStore return true/false (#735)

* return false if undefined from isMacAppStore

* PS-91 use strict equality instead of null coalescing

Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>

Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>

* [bug] Fix Safari CSV importer for URL and Notes (#730)

* Fix import path for safari importer (#740)

* Force updates to be silent (#739)

* support for username gen website setting (#738)

* Fix jslibModule forms (#742)

* Add DatePipe provider to JslibModule (#741)

* Feature/move to jest (#744)

* Switch to jest

* Fix jslib-angular package name

* Make angular test project

* Split up tests by jslib project

* Remove obsolete node test script

* Use legacy deps with jest-preset-angular

* Move web tests to common

* Remove build from pipeline

This was only being used because we were not using ts runners.
We are now, so build is unnecessary

* Remove the VerifyMasterPasswordComponent from jslib module (#747)

* Add ellipsis pipe to jslib module (#746)

* add ellipsis pipe to jslib module

* Add ellipsis pipe to exports

* Add ColorPasswordCountPipe to JslibModule (#751)

* Generator cleanup (#753)

* type is null by default

* rename generator component

* remove showWebsiteOption

* shorthand if check

* EC-134 Fix api token refresh (#749)

* Fix apikey token refresh

* Refactor: use class for TokenRequestTwoFactor

* Remove keytar and biometric logic (#706)

* [bug] CL - fix default button display and callout header class (#756)

* [EC-142] Fix error during import of 1pux containing new email field format (#758)

* Add support for complex email field type

* Ensure complex email field type gets imported on identities

* [euvr] Separate Billing Payment/History APIs (#750)

* [euvr] Separate Billing Payment/History APIs

* Updated to new accounts billing API

* Removed getUserBilling as it will become obsolete once merged

* [end user vault refresh] Base Changes For Vault Filters (#737)

* [dependency] Update icons

* Avoid duplicate fullSync api calls (#716)

* Tweak component library slightly (#715)

* Check runtime name vs mangled name (#724)

* Add Chromatic (#719)

* Update SECURITY.md (#725)

* Update SECURITY.md

Add link to our HackerOne program for submitting potential security issues.

* Revise language on SECURITY.md

* Remove error Response type check (#731)

* Remove error Response type check

Minimization is impacting type checking in a non-consistent way.
The previous type check works locally,
but not from build artifacts 🤷. We only set `captchaRequired` on
our errors when we want a resubmit with captcha included, so we're safe
keying off that

* linter

* [JslibModule] Add JslibModule (#733)

* Add ellipsis pipe (#728)

* add ellipsis pipe

* run prettier

* Account for ellipsis length in returned string

* Fix complete words case

* Fix another complete words issue

* fix for if there are not spaces in long value

* extract length check to beginning of method

* condense if statements

* remove log

* [refactor] Add optional folders param to folderService.getAllNested()

This will be used later for use cases where the vault filters service needs to build a list of nested folders that have been filtered by organization

* [feature] Add organization filters

This is an MVP implementation of the changes needed for the vault refresh. This includes collapsable top level groupings, and organization based filters that dynamically adjust folders and collections.

* [refactor] Break down vault filter into several components

These changes rename and rewrite the GroupingsComponent into a VaultFiltersModule. The module follows typical angular patterns for structure and purpose, and contain components for each filter type. The mostly communicate via Input and Output, and depend on a VaultFilterService for sending and recieving data from other parts of the product.

* [bug] Add missing events for folder add/edit

* [refactor] Dont directly change activeFilter in VaultFilterComponent

* [refactor] Move DisplayMode to a dedicated file

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: Oscar Hinton <oscar@oscarhinton.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>

* [CL-16 Component Library] Menu Dropdown (#761)

* [bug] Add missing null check in vault filters (#769)

* [bug] Add @Injectable to VaultFilterService (#781)

* [fix] Ran prettier

* [fix] Fix merge issue

I used createUrlTree when merging guards because I knew that was the angular standard, didn't notice that redirect was a helper method from us

* Remove BaseGuard (#791)

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Oscar Hinton <oscar@oscarhinton.com>
Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
Co-authored-by: David Frankel <42774874+frankeld@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
Co-authored-by: Vincent Salucci <vincesalucci21@gmail.com>

* [EC-192] Use ts-jest instead of deprecated ts-jest/utils (#792)

* [SG-230] “All Items” and “Trash” missing from Organization Vault (#795)

Co-authored-by: Oscar Hinton <oscar@oscarhinton.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
Co-authored-by: Anthony Garera <gareraanthony@gmail.com>
Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Addison Beck <addisonbeck1@gmail.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
Co-authored-by: David Frankel <42774874+frankeld@users.noreply.github.com>
Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>
Co-authored-by: Vincent Salucci <vincesalucci21@gmail.com>

Co-authored-by: Justin Baur <admin@justinbaur.com>
Co-authored-by: Justin Baur <136baur@gmail.com>
Co-authored-by: Oscar Hinton <oscar@oscarhinton.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
Co-authored-by: Anthony Garera <gareraanthony@gmail.com>
Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Addison Beck <addisonbeck1@gmail.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
Co-authored-by: David Frankel <42774874+frankeld@users.noreply.github.com>
Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>
Co-authored-by: Vincent Salucci <vincesalucci21@gmail.com>
This commit is contained in:
Matt Gibson 2022-05-10 17:02:51 -04:00 committed by GitHub
parent 4a09edf590
commit 1370006f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 1258 additions and 772 deletions

View File

@ -0,0 +1,21 @@
import { AbstractControl, AsyncValidatorFn, ValidationErrors } from "@angular/forms";
export function notAllowedValueAsync(
valueGetter: () => Promise<string>,
caseInsensitive = false
): AsyncValidatorFn {
return async (control: AbstractControl): Promise<ValidationErrors | null> => {
let notAllowedValue = await valueGetter();
let controlValue = control.value;
if (caseInsensitive) {
notAllowedValue = notAllowedValue.toLowerCase();
controlValue = controlValue.toLowerCase();
}
if (controlValue === notAllowedValue) {
return {
notAllowedValue: true,
};
}
};
}

View File

@ -1,5 +1,11 @@
import { OrganizationConnectionType } from "jslib-common/enums/organizationConnectionType";
import { OrganizationConnectionRequest } from "jslib-common/models/request/organizationConnectionRequest";
import { BillingHistoryResponse } from "jslib-common/models/response/billingHistoryResponse";
import { BillingPaymentResponse } from "jslib-common/models/response/billingPaymentResponse";
import {
OrganizationConnectionConfigApis,
OrganizationConnectionResponse,
} from "jslib-common/models/response/organizationConnectionResponse";
import { PolicyType } from "../enums/policyType";
import { SetKeyConnectorKeyRequest } from "../models/request/account/setKeyConnectorKeyRequest";
@ -39,6 +45,7 @@ import { KeysRequest } from "../models/request/keysRequest";
import { OrganizationSponsorshipCreateRequest } from "../models/request/organization/organizationSponsorshipCreateRequest";
import { OrganizationSponsorshipRedeemRequest } from "../models/request/organization/organizationSponsorshipRedeemRequest";
import { OrganizationSsoRequest } from "../models/request/organization/organizationSsoRequest";
import { OrganizationApiKeyRequest } from "../models/request/organizationApiKeyRequest";
import { OrganizationCreateRequest } from "../models/request/organizationCreateRequest";
import { OrganizationImportRequest } from "../models/request/organizationImportRequest";
import { OrganizationKeysRequest } from "../models/request/organizationKeysRequest";
@ -121,9 +128,11 @@ import { IdentityTwoFactorResponse } from "../models/response/identityTwoFactorR
import { KeyConnectorUserKeyResponse } from "../models/response/keyConnectorUserKeyResponse";
import { ListResponse } from "../models/response/listResponse";
import { OrganizationSsoResponse } from "../models/response/organization/organizationSsoResponse";
import { OrganizationApiKeyInformationResponse } from "../models/response/organizationApiKeyInformationResponse";
import { OrganizationAutoEnrollStatusResponse } from "../models/response/organizationAutoEnrollStatusResponse";
import { OrganizationKeysResponse } from "../models/response/organizationKeysResponse";
import { OrganizationResponse } from "../models/response/organizationResponse";
import { OrganizationSponsorshipSyncStatusResponse } from "../models/response/organizationSponsorshipSyncStatusResponse";
import { OrganizationSubscriptionResponse } from "../models/response/organizationSubscriptionResponse";
import { OrganizationUserBulkPublicKeyResponse } from "../models/response/organizationUserBulkPublicKeyResponse";
import { OrganizationUserBulkResponse } from "../models/response/organizationUserBulkResponse";
@ -508,6 +517,22 @@ export abstract class ApiService {
getOrganization: (id: string) => Promise<OrganizationResponse>;
getOrganizationBilling: (id: string) => Promise<BillingResponse>;
getOrganizationSubscription: (id: string) => Promise<OrganizationSubscriptionResponse>;
getCloudCommunicationsEnabled: () => Promise<boolean>;
abstract getOrganizationConnection<TConfig extends OrganizationConnectionConfigApis>(
id: string,
type: OrganizationConnectionType,
configType: { new (response: any): TConfig }
): Promise<OrganizationConnectionResponse<TConfig>>;
abstract createOrganizationConnection<TConfig extends OrganizationConnectionConfigApis>(
request: OrganizationConnectionRequest,
configType: { new (response: any): TConfig }
): Promise<OrganizationConnectionResponse<TConfig>>;
abstract updateOrganizationConnection<TConfig extends OrganizationConnectionConfigApis>(
request: OrganizationConnectionRequest,
configType: { new (response: any): TConfig },
organizationConnectionId: string
): Promise<OrganizationConnectionResponse<TConfig>>;
deleteOrganizationConnection: (id: string) => Promise<void>;
getOrganizationLicense: (id: string, installationId: string) => Promise<any>;
getOrganizationTaxInfo: (id: string) => Promise<TaxInfoResponse>;
getOrganizationAutoEnrollStatus: (
@ -525,11 +550,14 @@ export abstract class ApiService {
postOrganizationLicenseUpdate: (id: string, data: FormData) => Promise<any>;
postOrganizationApiKey: (
id: string,
request: SecretVerificationRequest
request: OrganizationApiKeyRequest
) => Promise<ApiKeyResponse>;
getOrganizationApiKeyInformation: (
id: string
) => Promise<ListResponse<OrganizationApiKeyInformationResponse>>;
postOrganizationRotateApiKey: (
id: string,
request: SecretVerificationRequest
request: OrganizationApiKeyRequest
) => Promise<ApiKeyResponse>;
postOrganizationSso: (
id: string,
@ -666,6 +694,9 @@ export abstract class ApiService {
sponsorshipOrgId: string,
request: OrganizationSponsorshipCreateRequest
) => Promise<void>;
getSponsorshipSyncStatus: (
sponsoredOrgId: string
) => Promise<OrganizationSponsorshipSyncStatusResponse>;
deleteRevokeSponsorship: (sponsoringOrganizationId: string) => Promise<void>;
deleteRemoveSponsorship: (sponsoringOrgId: string) => Promise<void>;
postPreValidateSponsorshipToken: (sponsorshipToken: string) => Promise<boolean>;

View File

@ -0,0 +1,4 @@
export enum OrganizationApiKeyType {
Default = 0,
BillingSync = 1,
}

View File

@ -0,0 +1,3 @@
export enum OrganizationConnectionType {
CloudBillingSync = 1,
}

View File

@ -0,0 +1,13 @@
import { BaseResponse } from "../response/baseResponse";
export class BillingSyncConfigApi extends BaseResponse {
billingSyncKey: string;
constructor(data: any) {
super(data);
if (data == null) {
return;
}
this.billingSyncKey = this.getResponseProperty("BillingSyncKey");
}
}

View File

@ -39,6 +39,9 @@ export class OrganizationData {
planProductType: ProductType;
keyConnectorEnabled: boolean;
keyConnectorUrl: string;
familySponsorshipLastSyncDate?: Date;
familySponsorshipValidUntil?: Date;
familySponsorshipToDelete?: boolean;
constructor(response: ProfileOrganizationResponse) {
this.id = response.id;
@ -74,5 +77,8 @@ export class OrganizationData {
this.planProductType = response.planProductType;
this.keyConnectorEnabled = response.keyConnectorEnabled;
this.keyConnectorUrl = response.keyConnectorUrl;
this.familySponsorshipLastSyncDate = response.familySponsorshipLastSyncDate;
this.familySponsorshipValidUntil = response.familySponsorshipValidUntil;
this.familySponsorshipToDelete = response.familySponsorshipToDelete;
}
}

View File

@ -40,6 +40,9 @@ export class Organization {
planProductType: ProductType;
keyConnectorEnabled: boolean;
keyConnectorUrl: string;
familySponsorshipLastSyncDate?: Date;
familySponsorshipValidUntil?: Date;
familySponsorshipToDelete?: boolean;
constructor(obj?: OrganizationData) {
if (obj == null) {
@ -80,6 +83,9 @@ export class Organization {
this.planProductType = obj.planProductType;
this.keyConnectorEnabled = obj.keyConnectorEnabled;
this.keyConnectorUrl = obj.keyConnectorUrl;
this.familySponsorshipLastSyncDate = obj.familySponsorshipLastSyncDate;
this.familySponsorshipValidUntil = obj.familySponsorshipValidUntil;
this.familySponsorshipToDelete = obj.familySponsorshipToDelete;
}
get canAccess() {

View File

@ -0,0 +1,3 @@
export class BillingSyncConfigRequest {
constructor(private billingSyncKey: string) {}
}

View File

@ -0,0 +1,7 @@
import { OrganizationApiKeyType } from "../../enums/organizationApiKeyType";
import { SecretVerificationRequest } from "./secretVerificationRequest";
export class OrganizationApiKeyRequest extends SecretVerificationRequest {
type: OrganizationApiKeyType = OrganizationApiKeyType.Default;
}

View File

@ -0,0 +1,15 @@
import { OrganizationConnectionType } from "jslib-common/enums/organizationConnectionType";
import { BillingSyncConfigRequest } from "./billingSyncConfigRequest";
/**API request config types for OrganizationConnectionRequest */
export type OrganizationConnectionRequestConfigs = BillingSyncConfigRequest;
export class OrganizationConnectionRequest {
constructor(
public organizationId: string,
public type: OrganizationConnectionType,
public enabled: boolean,
public config: OrganizationConnectionRequestConfigs
) {}
}

View File

@ -2,9 +2,11 @@ import { BaseResponse } from "./baseResponse";
export class ApiKeyResponse extends BaseResponse {
apiKey: string;
revisionDate: Date;
constructor(response: any) {
super(response);
this.apiKey = this.getResponseProperty("ApiKey");
this.revisionDate = new Date(this.getResponseProperty("RevisionDate"));
}
}

View File

@ -0,0 +1,12 @@
import { OrganizationApiKeyType } from "../../enums/organizationApiKeyType";
import { BaseResponse } from "./baseResponse";
export class OrganizationApiKeyInformationResponse extends BaseResponse {
keyType: OrganizationApiKeyType;
constructor(response: any) {
super(response);
this.keyType = this.getResponseProperty("KeyType");
}
}

View File

@ -0,0 +1,28 @@
import { OrganizationConnectionType } from "jslib-common/enums/organizationConnectionType";
import { BillingSyncConfigApi } from "../api/billingSyncConfigApi";
import { BaseResponse } from "./baseResponse";
/**API response config types for OrganizationConnectionResponse */
export type OrganizationConnectionConfigApis = BillingSyncConfigApi;
export class OrganizationConnectionResponse<
TConfig extends OrganizationConnectionConfigApis
> extends BaseResponse {
id: string;
type: OrganizationConnectionType;
organizationId: string;
enabled: boolean;
config: TConfig;
constructor(response: any, configType: { new (response: any): TConfig }) {
super(response);
this.id = this.getResponseProperty("Id");
this.type = this.getResponseProperty("Type");
this.organizationId = this.getResponseProperty("OrganizationId");
this.enabled = this.getResponseProperty("Enabled");
const rawConfig = this.getResponseProperty("Config");
this.config = rawConfig == null ? null : new configType(rawConfig);
}
}

View File

@ -0,0 +1,13 @@
import { BaseResponse } from "./baseResponse";
export class OrganizationSponsorshipSyncStatusResponse extends BaseResponse {
lastSyncDate?: Date;
constructor(response: any) {
super(response);
const lastSyncDate = this.getResponseProperty("LastSyncDate");
if (lastSyncDate) {
this.lastSyncDate = new Date(lastSyncDate);
}
}
}

View File

@ -40,6 +40,9 @@ export class ProfileOrganizationResponse extends BaseResponse {
planProductType: ProductType;
keyConnectorEnabled: boolean;
keyConnectorUrl: string;
familySponsorshipLastSyncDate?: Date;
familySponsorshipValidUntil?: Date;
familySponsorshipToDelete?: boolean;
constructor(response: any) {
super(response);
@ -77,5 +80,18 @@ export class ProfileOrganizationResponse extends BaseResponse {
this.planProductType = this.getResponseProperty("PlanProductType");
this.keyConnectorEnabled = this.getResponseProperty("KeyConnectorEnabled") ?? false;
this.keyConnectorUrl = this.getResponseProperty("KeyConnectorUrl");
const familySponsorshipLastSyncDateString = this.getResponseProperty(
"FamilySponsorshipLastSyncDate"
);
if (familySponsorshipLastSyncDateString) {
this.familySponsorshipLastSyncDate = new Date(familySponsorshipLastSyncDateString);
}
const familySponsorshipValidUntilString = this.getResponseProperty(
"FamilySponsorshipValidUntil"
);
if (familySponsorshipValidUntilString) {
this.familySponsorshipValidUntil = new Date(familySponsorshipValidUntilString);
}
this.familySponsorshipToDelete = this.getResponseProperty("FamilySponsorshipToDelete");
}
}

View File

@ -1,8 +1,14 @@
import { AppIdService } from "jslib-common/abstractions/appId.service";
import { OrganizationConnectionType } from "jslib-common/enums/organizationConnectionType";
import { DeviceRequest } from "jslib-common/models/request/deviceRequest";
import { TokenRequestTwoFactor } from "jslib-common/models/request/identityToken/tokenRequestTwoFactor";
import { OrganizationConnectionRequest } from "jslib-common/models/request/organizationConnectionRequest";
import { BillingHistoryResponse } from "jslib-common/models/response/billingHistoryResponse";
import { BillingPaymentResponse } from "jslib-common/models/response/billingPaymentResponse";
import {
OrganizationConnectionConfigApis,
OrganizationConnectionResponse,
} from "jslib-common/models/response/organizationConnectionResponse";
import { ApiService as ApiServiceAbstraction } from "../abstractions/api.service";
import { EnvironmentService } from "../abstractions/environment.service";
@ -47,6 +53,7 @@ import { KeysRequest } from "../models/request/keysRequest";
import { OrganizationSponsorshipCreateRequest } from "../models/request/organization/organizationSponsorshipCreateRequest";
import { OrganizationSponsorshipRedeemRequest } from "../models/request/organization/organizationSponsorshipRedeemRequest";
import { OrganizationSsoRequest } from "../models/request/organization/organizationSsoRequest";
import { OrganizationApiKeyRequest } from "../models/request/organizationApiKeyRequest";
import { OrganizationCreateRequest } from "../models/request/organizationCreateRequest";
import { OrganizationImportRequest } from "../models/request/organizationImportRequest";
import { OrganizationKeysRequest } from "../models/request/organizationKeysRequest";
@ -130,9 +137,11 @@ import { IdentityTwoFactorResponse } from "../models/response/identityTwoFactorR
import { KeyConnectorUserKeyResponse } from "../models/response/keyConnectorUserKeyResponse";
import { ListResponse } from "../models/response/listResponse";
import { OrganizationSsoResponse } from "../models/response/organization/organizationSsoResponse";
import { OrganizationApiKeyInformationResponse } from "../models/response/organizationApiKeyInformationResponse";
import { OrganizationAutoEnrollStatusResponse } from "../models/response/organizationAutoEnrollStatusResponse";
import { OrganizationKeysResponse } from "../models/response/organizationKeysResponse";
import { OrganizationResponse } from "../models/response/organizationResponse";
import { OrganizationSponsorshipSyncStatusResponse } from "../models/response/organizationSponsorshipSyncStatusResponse";
import { OrganizationSubscriptionResponse } from "../models/response/organizationSubscriptionResponse";
import { OrganizationUserBulkPublicKeyResponse } from "../models/response/organizationUserBulkPublicKeyResponse";
import { OrganizationUserBulkResponse } from "../models/response/organizationUserBulkResponse";
@ -1654,6 +1663,47 @@ export class ApiService implements ApiServiceAbstraction {
return new OrganizationSubscriptionResponse(r);
}
async getCloudCommunicationsEnabled(): Promise<boolean> {
const r = await this.send("GET", "/organizations/connections/enabled", null, true, true);
return r as boolean;
}
async getOrganizationConnection<TConfig extends OrganizationConnectionConfigApis>(
id: string,
type: OrganizationConnectionType,
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);
}
async createOrganizationConnection<TConfig extends OrganizationConnectionConfigApis>(
request: OrganizationConnectionRequest,
configType: { new (response: any): TConfig }
): Promise<OrganizationConnectionResponse<TConfig>> {
const r = await this.send("POST", "/organizations/connections/", request, true, true);
return new OrganizationConnectionResponse(r, configType);
}
async updateOrganizationConnection<TConfig extends OrganizationConnectionConfigApis>(
request: OrganizationConnectionRequest,
configType: { new (response: any): TConfig },
organizationConnectionId?: string
): Promise<OrganizationConnectionResponse<TConfig>> {
const r = await this.send(
"PUT",
"/organizations/connections/" + organizationConnectionId,
request,
true,
true
);
return new OrganizationConnectionResponse(r, configType);
}
async deleteOrganizationConnection(id: string): Promise<void> {
return this.send("DELETE", "/organizations/connections/" + id, null, true, false);
}
async getOrganizationLicense(id: string, installationId: string): Promise<any> {
return this.send(
"GET",
@ -1709,15 +1759,28 @@ export class ApiService implements ApiServiceAbstraction {
async postOrganizationApiKey(
id: string,
request: SecretVerificationRequest
request: OrganizationApiKeyRequest
): Promise<ApiKeyResponse> {
const r = await this.send("POST", "/organizations/" + id + "/api-key", request, true, true);
return new ApiKeyResponse(r);
}
async getOrganizationApiKeyInformation(
id: string
): Promise<ListResponse<OrganizationApiKeyInformationResponse>> {
const r = await this.send(
"GET",
"/organizations/" + id + "/api-key-information",
null,
true,
true
);
return new ListResponse(r, OrganizationApiKeyInformationResponse);
}
async postOrganizationRotateApiKey(
id: string,
request: SecretVerificationRequest
request: OrganizationApiKeyRequest
): Promise<ApiKeyResponse> {
const r = await this.send(
"POST",
@ -2268,17 +2331,35 @@ export class ApiService implements ApiServiceAbstraction {
): Promise<void> {
return await this.send(
"POST",
"/organization/sponsorship/" + sponsoredOrgId + "/families-for-enterprise",
"/organization/sponsorship/" +
(this.platformUtilsService.isSelfHost() ? "self-hosted/" : "") +
sponsoredOrgId +
"/families-for-enterprise",
request,
true,
false
);
}
async getSponsorshipSyncStatus(
sponsoredOrgId: string
): Promise<OrganizationSponsorshipSyncStatusResponse> {
const response = await this.send(
"GET",
"/organization/sponsorship/" + sponsoredOrgId + "/sync-status",
null,
true,
true
);
return new OrganizationSponsorshipSyncStatusResponse(response);
}
async deleteRevokeSponsorship(sponsoringOrganizationId: string): Promise<void> {
return await this.send(
"DELETE",
"/organization/sponsorship/" + sponsoringOrganizationId,
"/organization/sponsorship/" +
(this.platformUtilsService.isSelfHost() ? "self-hosted/" : "") +
sponsoringOrganizationId,
null,
true,
false

1757
package-lock.json generated

File diff suppressed because it is too large Load Diff