@narrative.io/data-collaboration-sdk-ts 0.0.77 → 0.0.78
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,16 +1,21 @@
|
|
|
1
1
|
import { BaseApi } from '../base-api';
|
|
2
2
|
import { type ApiRecords } from '../types';
|
|
3
|
-
import { type CompanyInfo } from './types';
|
|
3
|
+
import { type CompanyInfo, type WhoAmI } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* A class for accessing the Company Info API
|
|
6
6
|
* @extends BaseApi
|
|
7
7
|
*/
|
|
8
8
|
declare class CompanyInfoApi extends BaseApi {
|
|
9
9
|
companyId: () => Promise<number>;
|
|
10
|
+
/**
|
|
11
|
+
* Get the logged in company id
|
|
12
|
+
* @returns {Promise<WhoAmI>}
|
|
13
|
+
*/
|
|
14
|
+
whoami(): Promise<WhoAmI>;
|
|
10
15
|
/**
|
|
11
16
|
* Get a list of all providers in the Data Streams Market
|
|
12
17
|
* @returns {Promise<ApiRecords<CompanyInfo[]>>} - Promise resolving to an array of CompanyInfo records
|
|
13
18
|
*/
|
|
14
19
|
getAllProvidersCompanyInfo(): Promise<ApiRecords<CompanyInfo>>;
|
|
15
20
|
}
|
|
16
|
-
export { type CompanyInfo, CompanyInfoApi };
|
|
21
|
+
export { type CompanyInfo, type WhoAmI, CompanyInfoApi };
|
|
@@ -14,6 +14,13 @@ class CompanyInfoApi extends BaseApi {
|
|
|
14
14
|
companyId = async () => {
|
|
15
15
|
return (await this.get(`${resourceName}/whoami`)).id;
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Get the logged in company id
|
|
19
|
+
* @returns {Promise<WhoAmI>}
|
|
20
|
+
*/
|
|
21
|
+
async whoami() {
|
|
22
|
+
return await this.get(`${resourceName}/whoami?with_user_id=true`);
|
|
23
|
+
}
|
|
17
24
|
/**
|
|
18
25
|
* Get a list of all providers in the Data Streams Market
|
|
19
26
|
* @returns {Promise<ApiRecords<CompanyInfo[]>>} - Promise resolving to an array of CompanyInfo records
|