@narrative.io/data-collaboration-sdk-ts 0.0.18 → 0.0.19
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.
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseApi } from '../base-api';
|
|
2
|
+
import { type CompanyInfo } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A class for accessing the Contracts API.
|
|
5
|
+
* @extends BaseApi
|
|
6
|
+
*/
|
|
7
|
+
declare class CompanyInfoApi extends BaseApi {
|
|
8
|
+
private readonly companyId;
|
|
9
|
+
/**
|
|
10
|
+
* Get a customer contract based on the contract ID
|
|
11
|
+
*
|
|
12
|
+
* @param contractId - ID of the customer contract
|
|
13
|
+
* @returns Promise that resolves to the customer contract
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
getCompanyInfo(contractId: string): Promise<CompanyInfo>;
|
|
17
|
+
}
|
|
18
|
+
export { type CompanyInfo, CompanyInfoApi };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseApi } from '../base-api';
|
|
2
|
+
/**
|
|
3
|
+
* The name of the resource to be used in API requests.
|
|
4
|
+
* @constant
|
|
5
|
+
* @private
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
const resourceName = 'company-info';
|
|
9
|
+
/**
|
|
10
|
+
* A class for accessing the Contracts API.
|
|
11
|
+
* @extends BaseApi
|
|
12
|
+
*/
|
|
13
|
+
class CompanyInfoApi extends BaseApi {
|
|
14
|
+
companyId = async () => {
|
|
15
|
+
return await this.get(`${resourceName}/whoami`);
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Get a customer contract based on the contract ID
|
|
19
|
+
*
|
|
20
|
+
* @param contractId - ID of the customer contract
|
|
21
|
+
* @returns Promise that resolves to the customer contract
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
async getCompanyInfo(contractId) {
|
|
25
|
+
const companyId = await this.companyId();
|
|
26
|
+
return await this.get(`${resourceName}/${companyId}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export { CompanyInfoApi };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface CompanyInfo {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
short_description: string;
|
|
5
|
+
long_description: string;
|
|
6
|
+
company_type: string;
|
|
7
|
+
image_url: string;
|
|
8
|
+
location: string;
|
|
9
|
+
size: string;
|
|
10
|
+
website: string;
|
|
11
|
+
contact: string;
|
|
12
|
+
created_at: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/index.d.ts
CHANGED
|
@@ -11,8 +11,9 @@ import { type Attribute } from './attributes/types';
|
|
|
11
11
|
import { PingApi } from './ping';
|
|
12
12
|
import { type PingStatus } from './ping/types';
|
|
13
13
|
import { type Product, ProductsApi } from './products';
|
|
14
|
+
import { CompanyInfoApi, type CompanyInfo } from './company-info';
|
|
14
15
|
declare class NarrativeApi extends BaseApi {
|
|
15
16
|
}
|
|
16
|
-
interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi {
|
|
17
|
+
interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi {
|
|
17
18
|
}
|
|
18
|
-
export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, type PingStatus, type Attribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount };
|
|
19
|
+
export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, type PingStatus, type Attribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount, type CompanyInfo };
|
package/build/index.js
CHANGED
|
@@ -6,7 +6,8 @@ import { applyMixins } from './utils';
|
|
|
6
6
|
import { AttributeApi } from './attributes';
|
|
7
7
|
import { PingApi } from './ping';
|
|
8
8
|
import { ProductsApi } from './products';
|
|
9
|
+
import { CompanyInfoApi } from './company-info';
|
|
9
10
|
class NarrativeApi extends BaseApi {
|
|
10
11
|
}
|
|
11
|
-
applyMixins(NarrativeApi, [BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi]);
|
|
12
|
-
export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi };
|
|
12
|
+
applyMixins(NarrativeApi, [BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi]);
|
|
13
|
+
export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi };
|