mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 03:03:43 +00:00
[PM-23826] Crowdstrike integration dialog (#15757)
This commit is contained in:
@@ -1 +1,6 @@
|
||||
export * from "./services";
|
||||
export * from "./models/organization-integration-type";
|
||||
export * from "./models/organization-integration-request";
|
||||
export * from "./models/organization-integration-response";
|
||||
export * from "./models/organization-integration-configuration-request";
|
||||
export * from "./models/organization-integration-configuration-response";
|
||||
|
||||
@@ -5,11 +5,13 @@ import { OrganizationIntegrationType } from "./organization-integration-type";
|
||||
|
||||
export class OrganizationIntegrationResponse extends BaseResponse {
|
||||
id: OrganizationIntegrationId;
|
||||
organizationIntegrationType: OrganizationIntegrationType;
|
||||
type: OrganizationIntegrationType;
|
||||
configuration: string;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.id = this.getResponseProperty("Id");
|
||||
this.organizationIntegrationType = this.getResponseProperty("Type");
|
||||
this.type = this.getResponseProperty("Type");
|
||||
this.configuration = this.getResponseProperty("Configuration");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,17 +11,17 @@ import { OrganizationIntegrationApiService } from "./organization-integration-ap
|
||||
|
||||
export const mockIntegrationResponse: any = {
|
||||
id: "1" as OrganizationIntegrationId,
|
||||
organizationIntegrationType: OrganizationIntegrationType.Hec,
|
||||
type: OrganizationIntegrationType.Hec,
|
||||
};
|
||||
|
||||
export const mockIntegrationResponses: any[] = [
|
||||
{
|
||||
id: "1" as OrganizationIntegrationId,
|
||||
OrganizationIntegrationType: OrganizationIntegrationType.Hec,
|
||||
type: OrganizationIntegrationType.Hec,
|
||||
},
|
||||
{
|
||||
id: "2" as OrganizationIntegrationId,
|
||||
OrganizationIntegrationType: OrganizationIntegrationType.Webhook,
|
||||
type: OrganizationIntegrationType.Webhook,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -46,7 +46,7 @@ describe("OrganizationIntegrationApiService", () => {
|
||||
expect(result).toEqual(mockIntegrationResponses);
|
||||
expect(apiService.send).toHaveBeenCalledWith(
|
||||
"GET",
|
||||
`organizations/${orgId}/integrations`,
|
||||
`/organizations/${orgId}/integrations`,
|
||||
null,
|
||||
true,
|
||||
true,
|
||||
@@ -63,12 +63,10 @@ describe("OrganizationIntegrationApiService", () => {
|
||||
apiService.send.mockReturnValue(Promise.resolve(mockIntegrationResponse));
|
||||
|
||||
const result = await service.createOrganizationIntegration(orgId, request);
|
||||
expect(result.organizationIntegrationType).toEqual(
|
||||
mockIntegrationResponse.organizationIntegrationType,
|
||||
);
|
||||
expect(result.type).toEqual(mockIntegrationResponse.type);
|
||||
expect(apiService.send).toHaveBeenCalledWith(
|
||||
"POST",
|
||||
`organizations/${orgId.toString()}/integrations`,
|
||||
`/organizations/${orgId.toString()}/integrations`,
|
||||
request,
|
||||
true,
|
||||
true,
|
||||
@@ -86,12 +84,10 @@ describe("OrganizationIntegrationApiService", () => {
|
||||
apiService.send.mockReturnValue(Promise.resolve(mockIntegrationResponse));
|
||||
|
||||
const result = await service.updateOrganizationIntegration(orgId, integrationId, request);
|
||||
expect(result.organizationIntegrationType).toEqual(
|
||||
mockIntegrationResponse.organizationIntegrationType,
|
||||
);
|
||||
expect(result.type).toEqual(mockIntegrationResponse.type);
|
||||
expect(apiService.send).toHaveBeenCalledWith(
|
||||
"PUT",
|
||||
`organizations/${orgId}/integrations/${integrationId}`,
|
||||
`/organizations/${orgId}/integrations/${integrationId}`,
|
||||
request,
|
||||
true,
|
||||
true,
|
||||
@@ -106,7 +102,7 @@ describe("OrganizationIntegrationApiService", () => {
|
||||
|
||||
expect(apiService.send).toHaveBeenCalledWith(
|
||||
"DELETE",
|
||||
`organizations/${orgId}/integrations/${integrationId}`,
|
||||
`/organizations/${orgId}/integrations/${integrationId}`,
|
||||
null,
|
||||
true,
|
||||
false,
|
||||
|
||||
@@ -15,7 +15,7 @@ export class OrganizationIntegrationApiService {
|
||||
): Promise<OrganizationIntegrationResponse[]> {
|
||||
const response = await this.apiService.send(
|
||||
"GET",
|
||||
`organizations/${orgId}/integrations`,
|
||||
`/organizations/${orgId}/integrations`,
|
||||
null,
|
||||
true,
|
||||
true,
|
||||
@@ -29,7 +29,7 @@ export class OrganizationIntegrationApiService {
|
||||
): Promise<OrganizationIntegrationResponse> {
|
||||
const response = await this.apiService.send(
|
||||
"POST",
|
||||
`organizations/${orgId}/integrations`,
|
||||
`/organizations/${orgId}/integrations`,
|
||||
request,
|
||||
true,
|
||||
true,
|
||||
@@ -44,7 +44,7 @@ export class OrganizationIntegrationApiService {
|
||||
): Promise<OrganizationIntegrationResponse> {
|
||||
const response = await this.apiService.send(
|
||||
"PUT",
|
||||
`organizations/${orgId}/integrations/${integrationId}`,
|
||||
`/organizations/${orgId}/integrations/${integrationId}`,
|
||||
request,
|
||||
true,
|
||||
true,
|
||||
@@ -58,7 +58,7 @@ export class OrganizationIntegrationApiService {
|
||||
): Promise<any> {
|
||||
await this.apiService.send(
|
||||
"DELETE",
|
||||
`organizations/${orgId}/integrations/${integrationId}`,
|
||||
`/organizations/${orgId}/integrations/${integrationId}`,
|
||||
null,
|
||||
true,
|
||||
false,
|
||||
|
||||
Reference in New Issue
Block a user