harvester_sdk 1.0.25 → 1.0.26
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/dist/sdk.d.ts +0 -36
- package/dist/sdk.js +1 -56
- package/package.json +1 -1
- package/sdk.ts +1 -60
package/dist/sdk.d.ts
CHANGED
|
@@ -116,27 +116,6 @@ export declare class HarvesterSDK {
|
|
|
116
116
|
* ```
|
|
117
117
|
*/
|
|
118
118
|
getRegions(params?: GetRegionsParams): Promise<PaginatedResponse<RegionType>>;
|
|
119
|
-
/**
|
|
120
|
-
* Get a single region by ID
|
|
121
|
-
*
|
|
122
|
-
* @param regionId - The region ID
|
|
123
|
-
* @returns The region object
|
|
124
|
-
*/
|
|
125
|
-
getRegionById(regionId: string): Promise<RegionType>;
|
|
126
|
-
/**
|
|
127
|
-
* Get a region by slug
|
|
128
|
-
*
|
|
129
|
-
* @param slug - The region slug (e.g., 'new-york')
|
|
130
|
-
* @returns The region object
|
|
131
|
-
*/
|
|
132
|
-
getRegionBySlug(slug: string): Promise<RegionType>;
|
|
133
|
-
/**
|
|
134
|
-
* Get all geographies
|
|
135
|
-
*
|
|
136
|
-
* @param params - Optional filter and pagination parameters
|
|
137
|
-
* @returns Paginated list of geographies
|
|
138
|
-
*/
|
|
139
|
-
getGeos(params?: GetGeosParams): Promise<PaginatedResponse<GeoType>>;
|
|
140
119
|
/**
|
|
141
120
|
* Get geographies by region ID
|
|
142
121
|
*
|
|
@@ -150,21 +129,6 @@ export declare class HarvesterSDK {
|
|
|
150
129
|
* ```
|
|
151
130
|
*/
|
|
152
131
|
getGeosByRegion(regionId: string, params?: PaginationParams): Promise<PaginatedResponse<GeoType>>;
|
|
153
|
-
/**
|
|
154
|
-
* Get a single geography by ID
|
|
155
|
-
*
|
|
156
|
-
* @param geoId - The geography ID
|
|
157
|
-
* @returns The geography object
|
|
158
|
-
*/
|
|
159
|
-
getGeoById(geoId: string): Promise<GeoType>;
|
|
160
|
-
/**
|
|
161
|
-
* Search geographies by text
|
|
162
|
-
*
|
|
163
|
-
* @param query - Search query
|
|
164
|
-
* @param params - Optional filter parameters
|
|
165
|
-
* @returns Paginated list of matching geographies
|
|
166
|
-
*/
|
|
167
|
-
searchGeos(query: string, params?: GetGeosParams): Promise<PaginatedResponse<GeoType>>;
|
|
168
132
|
/**
|
|
169
133
|
* Get data with filters
|
|
170
134
|
*
|
package/dist/sdk.js
CHANGED
|
@@ -82,41 +82,9 @@ class HarvesterSDK {
|
|
|
82
82
|
});
|
|
83
83
|
return response.data;
|
|
84
84
|
}
|
|
85
|
-
/**
|
|
86
|
-
* Get a single region by ID
|
|
87
|
-
*
|
|
88
|
-
* @param regionId - The region ID
|
|
89
|
-
* @returns The region object
|
|
90
|
-
*/
|
|
91
|
-
async getRegionById(regionId) {
|
|
92
|
-
const response = await this.client.get(`/regions/${regionId}`);
|
|
93
|
-
return response.data.data;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Get a region by slug
|
|
97
|
-
*
|
|
98
|
-
* @param slug - The region slug (e.g., 'new-york')
|
|
99
|
-
* @returns The region object
|
|
100
|
-
*/
|
|
101
|
-
async getRegionBySlug(slug) {
|
|
102
|
-
const response = await this.client.get(`/regions/slug/${slug}`);
|
|
103
|
-
return response.data.data;
|
|
104
|
-
}
|
|
105
85
|
// ============================================
|
|
106
86
|
// GEOGRAPHIES
|
|
107
87
|
// ============================================
|
|
108
|
-
/**
|
|
109
|
-
* Get all geographies
|
|
110
|
-
*
|
|
111
|
-
* @param params - Optional filter and pagination parameters
|
|
112
|
-
* @returns Paginated list of geographies
|
|
113
|
-
*/
|
|
114
|
-
async getGeos(params) {
|
|
115
|
-
const response = await this.client.get('/geos', {
|
|
116
|
-
params: this.buildQueryParams(params),
|
|
117
|
-
});
|
|
118
|
-
return response.data;
|
|
119
|
-
}
|
|
120
88
|
/**
|
|
121
89
|
* Get geographies by region ID
|
|
122
90
|
*
|
|
@@ -130,34 +98,11 @@ class HarvesterSDK {
|
|
|
130
98
|
* ```
|
|
131
99
|
*/
|
|
132
100
|
async getGeosByRegion(regionId, params) {
|
|
133
|
-
const response = await this.client.get(`/
|
|
101
|
+
const response = await this.client.get(`/geo-selections/${regionId}`, {
|
|
134
102
|
params: this.buildQueryParams(params),
|
|
135
103
|
});
|
|
136
104
|
return response.data;
|
|
137
105
|
}
|
|
138
|
-
/**
|
|
139
|
-
* Get a single geography by ID
|
|
140
|
-
*
|
|
141
|
-
* @param geoId - The geography ID
|
|
142
|
-
* @returns The geography object
|
|
143
|
-
*/
|
|
144
|
-
async getGeoById(geoId) {
|
|
145
|
-
const response = await this.client.get(`/geos/${geoId}`);
|
|
146
|
-
return response.data.data;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Search geographies by text
|
|
150
|
-
*
|
|
151
|
-
* @param query - Search query
|
|
152
|
-
* @param params - Optional filter parameters
|
|
153
|
-
* @returns Paginated list of matching geographies
|
|
154
|
-
*/
|
|
155
|
-
async searchGeos(query, params) {
|
|
156
|
-
const response = await this.client.get('/geos/search', {
|
|
157
|
-
params: this.buildQueryParams({ ...params, search: query }),
|
|
158
|
-
});
|
|
159
|
-
return response.data;
|
|
160
|
-
}
|
|
161
106
|
// ============================================
|
|
162
107
|
// DATA
|
|
163
108
|
// ============================================
|
package/package.json
CHANGED
package/sdk.ts
CHANGED
|
@@ -192,45 +192,10 @@ export class HarvesterSDK {
|
|
|
192
192
|
return response.data;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
/**
|
|
196
|
-
* Get a single region by ID
|
|
197
|
-
*
|
|
198
|
-
* @param regionId - The region ID
|
|
199
|
-
* @returns The region object
|
|
200
|
-
*/
|
|
201
|
-
async getRegionById(regionId: string): Promise<RegionType> {
|
|
202
|
-
const response = await this.client.get<SDKResponse<RegionType>>(`/regions/${regionId}`);
|
|
203
|
-
return response.data.data;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Get a region by slug
|
|
208
|
-
*
|
|
209
|
-
* @param slug - The region slug (e.g., 'new-york')
|
|
210
|
-
* @returns The region object
|
|
211
|
-
*/
|
|
212
|
-
async getRegionBySlug(slug: string): Promise<RegionType> {
|
|
213
|
-
const response = await this.client.get<SDKResponse<RegionType>>(`/regions/slug/${slug}`);
|
|
214
|
-
return response.data.data;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
195
|
// ============================================
|
|
218
196
|
// GEOGRAPHIES
|
|
219
197
|
// ============================================
|
|
220
198
|
|
|
221
|
-
/**
|
|
222
|
-
* Get all geographies
|
|
223
|
-
*
|
|
224
|
-
* @param params - Optional filter and pagination parameters
|
|
225
|
-
* @returns Paginated list of geographies
|
|
226
|
-
*/
|
|
227
|
-
async getGeos(params?: GetGeosParams): Promise<PaginatedResponse<GeoType>> {
|
|
228
|
-
const response = await this.client.get<PaginatedResponse<GeoType>>('/geos', {
|
|
229
|
-
params: this.buildQueryParams(params),
|
|
230
|
-
});
|
|
231
|
-
return response.data;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
199
|
/**
|
|
235
200
|
* Get geographies by region ID
|
|
236
201
|
*
|
|
@@ -244,36 +209,12 @@ export class HarvesterSDK {
|
|
|
244
209
|
* ```
|
|
245
210
|
*/
|
|
246
211
|
async getGeosByRegion(regionId: string, params?: PaginationParams): Promise<PaginatedResponse<GeoType>> {
|
|
247
|
-
const response = await this.client.get<PaginatedResponse<GeoType>>(`/
|
|
212
|
+
const response = await this.client.get<PaginatedResponse<GeoType>>(`/geo-selections/${regionId}`, {
|
|
248
213
|
params: this.buildQueryParams(params),
|
|
249
214
|
});
|
|
250
215
|
return response.data;
|
|
251
216
|
}
|
|
252
217
|
|
|
253
|
-
/**
|
|
254
|
-
* Get a single geography by ID
|
|
255
|
-
*
|
|
256
|
-
* @param geoId - The geography ID
|
|
257
|
-
* @returns The geography object
|
|
258
|
-
*/
|
|
259
|
-
async getGeoById(geoId: string): Promise<GeoType> {
|
|
260
|
-
const response = await this.client.get<SDKResponse<GeoType>>(`/geos/${geoId}`);
|
|
261
|
-
return response.data.data;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Search geographies by text
|
|
266
|
-
*
|
|
267
|
-
* @param query - Search query
|
|
268
|
-
* @param params - Optional filter parameters
|
|
269
|
-
* @returns Paginated list of matching geographies
|
|
270
|
-
*/
|
|
271
|
-
async searchGeos(query: string, params?: GetGeosParams): Promise<PaginatedResponse<GeoType>> {
|
|
272
|
-
const response = await this.client.get<PaginatedResponse<GeoType>>('/geos/search', {
|
|
273
|
-
params: this.buildQueryParams({ ...params, search: query }),
|
|
274
|
-
});
|
|
275
|
-
return response.data;
|
|
276
|
-
}
|
|
277
218
|
|
|
278
219
|
// ============================================
|
|
279
220
|
// DATA
|