@narrative.io/data-collaboration-sdk-ts 0.0.28 → 0.0.29
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.
package/build/base-api.js
CHANGED
|
@@ -13,7 +13,7 @@ export class BaseApi {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor(config) {
|
|
15
15
|
this.apiKey = config.apiKey;
|
|
16
|
-
this.environment = config.environment
|
|
16
|
+
this.environment = config.environment ?? 'prod';
|
|
17
17
|
this.base_api = mande(`${this.getBaseUrl()}`, {
|
|
18
18
|
headers: this.getHeaders()
|
|
19
19
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseApi } from '../base-api';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import type { RosettaStoneResponse, SampleRecords, SampleRecord } from './types';
|
|
3
|
+
declare class RosettaStoneApi extends BaseApi {
|
|
4
4
|
getLabelsFromSample(sample: SampleRecords): Promise<RosettaStoneResponse[]>;
|
|
5
5
|
}
|
|
6
|
+
export { RosettaStoneApi, type SampleRecords, type RosettaStoneResponse, type SampleRecord };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BaseApi } from '../base-api';
|
|
2
2
|
const resourceName = 'rosetta-stone';
|
|
3
|
-
|
|
3
|
+
class RosettaStoneApi extends BaseApi {
|
|
4
4
|
async getLabelsFromSample(sample) {
|
|
5
5
|
return await this.post(`${resourceName}/labels/sample`, sample);
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
+
export { RosettaStoneApi };
|