harvester_sdk 1.0.33 → 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.
Files changed (3) hide show
  1. package/dist/sdk.d.ts +8 -2
  2. package/package.json +1 -1
  3. package/sdk.ts +9 -3
package/dist/sdk.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
- import { RegionType, GeoType, DataType, platformsList } from './types';
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
- getGeosByRegions(regionIds: string, params?: PaginationParams): Promise<PaginatedResponse<GeoType>>;
145
+ getGeosByRegions(regionIds: string, params?: PaginationParams): Promise<PaginatedResponse<GeoSelectionWithRegion>>;
140
146
  /**
141
147
  * Get data with filters
142
148
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harvester_sdk",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "SDK for interacting with the Harvester API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
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,11 +225,13 @@ export class HarvesterSDK {
221
225
  * const geos = await harvester.getGeosByRegion('region-id', { limit: 50 });
222
226
  * ```
223
227
  */
228
+
229
+
224
230
  async getGeosByRegions(
225
231
  regionIds: string,
226
232
  params?: PaginationParams
227
- ): Promise<PaginatedResponse<GeoType>> {
228
- const response = await this.client.get<PaginatedResponse<GeoType>>(
233
+ ): Promise<PaginatedResponse<GeoSelectionWithRegion>> {
234
+ const response = await this.client.get<PaginatedResponse<GeoSelectionWithRegion>>(
229
235
  `/geo-selections/${regionIds}`,
230
236
  {
231
237
  params: this.buildQueryParams(params),