@ampsec/platform-client 27.1.0 → 27.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { AgentDto } from '../../dto';
|
|
2
2
|
import { RestClient } from './RestClient';
|
|
3
|
+
export type TokenResponse = {
|
|
4
|
+
token: string;
|
|
5
|
+
};
|
|
3
6
|
export declare class AgentIdentityService {
|
|
4
7
|
protected readonly rest: RestClient;
|
|
5
8
|
constructor(rest: RestClient);
|
|
6
|
-
exchangeToken(targetTenantId: string): Promise<
|
|
9
|
+
exchangeToken(targetTenantId: string): Promise<TokenResponse>;
|
|
7
10
|
me(): Promise<AgentDto>;
|
|
8
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentIdentityService.js","sourceRoot":"","sources":["../../../../src/services/rest/AgentIdentityService.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AgentIdentityService.js","sourceRoot":"","sources":["../../../../src/services/rest/AgentIdentityService.ts"],"names":[],"mappings":";;;AAOA,MAAa,oBAAoB;IAE/B,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,KAAK,CAAC,aAAa,CAAC,cAAsB;QACxC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YAC/B,GAAG,EAAE,6BAA6B;YAClC,MAAM,EAAE,KAAK;YACb,MAAM,EAAE;gBACN,GAAG,EAAE,cAAc;aACpB;SACF,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAqB,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,EAAE;QACN,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YAC/B,GAAG,EAAE,YAAY;YACjB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAgB,CAAC;IAC9B,CAAC;CACF;AAvBD,oDAuBC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import {AgentDto} from '../../dto';
|
|
2
2
|
import {RestClient} from './RestClient';
|
|
3
3
|
|
|
4
|
+
export type TokenResponse = {
|
|
5
|
+
token: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
4
8
|
export class AgentIdentityService {
|
|
5
9
|
protected readonly rest: RestClient;
|
|
6
10
|
constructor(rest: RestClient) {
|
|
7
11
|
this.rest = rest;
|
|
8
12
|
}
|
|
9
|
-
async exchangeToken(targetTenantId: string): Promise<
|
|
13
|
+
async exchangeToken(targetTenantId: string): Promise<TokenResponse> {
|
|
10
14
|
const res = await this.rest.call({
|
|
11
15
|
url: '/api/v1/auth/token/exchange',
|
|
12
16
|
method: 'GET',
|
|
@@ -14,7 +18,7 @@ export class AgentIdentityService {
|
|
|
14
18
|
tid: targetTenantId,
|
|
15
19
|
},
|
|
16
20
|
});
|
|
17
|
-
return res.data as
|
|
21
|
+
return res.data as TokenResponse;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
async me(): Promise<AgentDto> {
|