harvester_sdk 1.0.32 → 1.0.34
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/README.md +3 -1
- package/dist/sdk.d.ts +8 -2
- package/dist/sdk.js +2 -2
- package/package.json +1 -1
- package/sdk.ts +12 -6
package/README.md
CHANGED
package/dist/sdk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import { RegionType,
|
|
2
|
+
import { RegionType, DataType, platformsList, GeoSelectionType } from './types';
|
|
3
3
|
export interface HarvesterSDKConfig {
|
|
4
4
|
baseUrl: string;
|
|
5
5
|
apiKey?: string;
|
|
@@ -76,6 +76,12 @@ export interface TokenCountResult {
|
|
|
76
76
|
data_url_tokens: number;
|
|
77
77
|
documents_count: number;
|
|
78
78
|
}
|
|
79
|
+
export interface GeoSelectionWithRegion extends GeoSelectionType {
|
|
80
|
+
region?: {
|
|
81
|
+
_id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
79
85
|
/**
|
|
80
86
|
* Harvester SDK - Client for interacting with the Harvester API
|
|
81
87
|
*
|
|
@@ -136,7 +142,7 @@ export declare class HarvesterSDK {
|
|
|
136
142
|
* const geos = await harvester.getGeosByRegion('region-id', { limit: 50 });
|
|
137
143
|
* ```
|
|
138
144
|
*/
|
|
139
|
-
|
|
145
|
+
getGeosByRegions(regionIds: string, params?: PaginationParams): Promise<PaginatedResponse<GeoSelectionWithRegion>>;
|
|
140
146
|
/**
|
|
141
147
|
* Get data with filters
|
|
142
148
|
*
|
package/dist/sdk.js
CHANGED
|
@@ -97,8 +97,8 @@ class HarvesterSDK {
|
|
|
97
97
|
* const geos = await harvester.getGeosByRegion('region-id', { limit: 50 });
|
|
98
98
|
* ```
|
|
99
99
|
*/
|
|
100
|
-
async
|
|
101
|
-
const response = await this.client.get(`/geo-selections/${
|
|
100
|
+
async getGeosByRegions(regionIds, params) {
|
|
101
|
+
const response = await this.client.get(`/geo-selections/${regionIds}`, {
|
|
102
102
|
params: this.buildQueryParams(params),
|
|
103
103
|
});
|
|
104
104
|
return response.data;
|
package/package.json
CHANGED
package/sdk.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
2
|
-
import { RegionType, GeoType, DataType, platformsList } from './types';
|
|
2
|
+
import { RegionType, GeoType, DataType, platformsList, GeoSelectionType } from './types';
|
|
3
3
|
|
|
4
4
|
// SDK Configuration
|
|
5
5
|
export interface HarvesterSDKConfig {
|
|
@@ -108,6 +108,10 @@ export interface TokenCountResult {
|
|
|
108
108
|
documents_count: number;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
export interface GeoSelectionWithRegion extends GeoSelectionType {
|
|
112
|
+
region?: { _id: string; name: string };
|
|
113
|
+
}
|
|
114
|
+
|
|
111
115
|
/**
|
|
112
116
|
* Harvester SDK - Client for interacting with the Harvester API
|
|
113
117
|
*
|
|
@@ -221,12 +225,14 @@ export class HarvesterSDK {
|
|
|
221
225
|
* const geos = await harvester.getGeosByRegion('region-id', { limit: 50 });
|
|
222
226
|
* ```
|
|
223
227
|
*/
|
|
224
|
-
|
|
225
|
-
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
async getGeosByRegions(
|
|
231
|
+
regionIds: string,
|
|
226
232
|
params?: PaginationParams
|
|
227
|
-
): Promise<PaginatedResponse<
|
|
228
|
-
const response = await this.client.get<PaginatedResponse<
|
|
229
|
-
`/geo-selections/${
|
|
233
|
+
): Promise<PaginatedResponse<GeoSelectionWithRegion>> {
|
|
234
|
+
const response = await this.client.get<PaginatedResponse<GeoSelectionWithRegion>>(
|
|
235
|
+
`/geo-selections/${regionIds}`,
|
|
230
236
|
{
|
|
231
237
|
params: this.buildQueryParams(params),
|
|
232
238
|
}
|