Skip to content

Commit

Permalink
ENG-54002: implementing mapping endpoint and type (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
crisefd authored Feb 8, 2024
1 parent c1685c5 commit 811f19d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@al/core",
"version": "1.2.21",
"version": "1.2.22",
"description": "Node Enterprise Packages for Alert Logic (NEPAL) Core Library",
"main": "./dist/index.cjs.js",
"types": "./dist/index.d.ts",
Expand Down
14 changes: 14 additions & 0 deletions src/aims-client/aims-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
AIMSUserDetails,
AIMSEnrollURI,
AIMSLicenseAcceptanceStatus,
AIMSMappedAccount,
} from './types';
import { aimsTypeSchematics } from './aims.schematics';

Expand Down Expand Up @@ -899,6 +900,19 @@ export class AIMSClientInstance implements AlValidationSchemaProvider {
} );
}

/**
* Retrieves the mapped account given an account ID
* @param accountId ALert Logic's account ID
*/
async getMappedAccount(accountId: string): Promise<AIMSMappedAccount> {
return await this.client.get({
service_stack: AlLocation.InsightAPI,
service_name: this.serviceName,
version: this.serviceVersion,
path: `/${accountId}/mapping`
})
}

/**
* Triggers Frontline PCI scan migration for a given account.
*/
Expand Down
7 changes: 7 additions & 0 deletions src/aims-client/types/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { AlChangeStamp } from '../../types';

export interface AIMSMappedAccount {
alertlogic_account: string;
frontline_account: string;
created: AlChangeStamp;
modified: AlChangeStamp;
}

export interface AIMSAuthentication {
user: AIMSUser;
account: AIMSAccount;
Expand Down

0 comments on commit 811f19d

Please sign in to comment.