harvester_sdk 1.0.33 → 1.0.35
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 +8 -2
- package/dist/types.d.ts +7 -4
- package/dist/types.js +1 -0
- package/package.json +1 -1
- package/sdk.ts +9 -3
- package/types.ts +2 -1
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
|
-
getGeosByRegions(regionIds: string, params?: PaginationParams): Promise<PaginatedResponse<
|
|
145
|
+
getGeosByRegions(regionIds: string, params?: PaginationParams): Promise<PaginatedResponse<GeoSelectionWithRegion>>;
|
|
140
146
|
/**
|
|
141
147
|
* Get data with filters
|
|
142
148
|
*
|
package/dist/types.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export declare const zodSourceGroupSchema: z.ZodObject<{
|
|
|
50
50
|
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
51
51
|
notes: z.ZodOptional<z.ZodString>;
|
|
52
52
|
status: z.ZodOptional<z.ZodEnum<["active", "inactive", "deleted"]>>;
|
|
53
|
+
active_sources: z.ZodOptional<z.ZodNumber>;
|
|
53
54
|
}, "strip", z.ZodTypeAny, {
|
|
54
55
|
name: string;
|
|
55
56
|
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch";
|
|
@@ -61,6 +62,7 @@ export declare const zodSourceGroupSchema: z.ZodObject<{
|
|
|
61
62
|
description?: string | undefined;
|
|
62
63
|
region_id?: string | undefined;
|
|
63
64
|
max_active_sources?: number | undefined;
|
|
65
|
+
active_sources?: number | undefined;
|
|
64
66
|
}, {
|
|
65
67
|
name: string;
|
|
66
68
|
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "youtube" | "twitter" | "x" | "reddit" | "linkedin" | "snapchat" | "whatsapp" | "discord" | "twitch";
|
|
@@ -72,6 +74,7 @@ export declare const zodSourceGroupSchema: z.ZodObject<{
|
|
|
72
74
|
description?: string | undefined;
|
|
73
75
|
region_id?: string | undefined;
|
|
74
76
|
max_active_sources?: number | undefined;
|
|
77
|
+
active_sources?: number | undefined;
|
|
75
78
|
}>;
|
|
76
79
|
export declare const zodSourceSchema: z.ZodObject<{
|
|
77
80
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -1851,14 +1854,14 @@ export declare const zodDashboardStatsSchema: z.ZodObject<{
|
|
|
1851
1854
|
total_sources: z.ZodOptional<z.ZodNumber>;
|
|
1852
1855
|
}, "strip", z.ZodTypeAny, {
|
|
1853
1856
|
region_id?: string | undefined;
|
|
1857
|
+
active_sources?: number | undefined;
|
|
1854
1858
|
total_sources?: number | undefined;
|
|
1855
1859
|
region_name?: string | undefined;
|
|
1856
|
-
active_sources?: number | undefined;
|
|
1857
1860
|
}, {
|
|
1858
1861
|
region_id?: string | undefined;
|
|
1862
|
+
active_sources?: number | undefined;
|
|
1859
1863
|
total_sources?: number | undefined;
|
|
1860
1864
|
region_name?: string | undefined;
|
|
1861
|
-
active_sources?: number | undefined;
|
|
1862
1865
|
}>, "many">>;
|
|
1863
1866
|
}, "strip", z.ZodTypeAny, {
|
|
1864
1867
|
total_active_sources?: number | undefined;
|
|
@@ -1867,9 +1870,9 @@ export declare const zodDashboardStatsSchema: z.ZodObject<{
|
|
|
1867
1870
|
total_groups?: number | undefined;
|
|
1868
1871
|
regions?: {
|
|
1869
1872
|
region_id?: string | undefined;
|
|
1873
|
+
active_sources?: number | undefined;
|
|
1870
1874
|
total_sources?: number | undefined;
|
|
1871
1875
|
region_name?: string | undefined;
|
|
1872
|
-
active_sources?: number | undefined;
|
|
1873
1876
|
}[] | undefined;
|
|
1874
1877
|
}, {
|
|
1875
1878
|
total_active_sources?: number | undefined;
|
|
@@ -1878,9 +1881,9 @@ export declare const zodDashboardStatsSchema: z.ZodObject<{
|
|
|
1878
1881
|
total_groups?: number | undefined;
|
|
1879
1882
|
regions?: {
|
|
1880
1883
|
region_id?: string | undefined;
|
|
1884
|
+
active_sources?: number | undefined;
|
|
1881
1885
|
total_sources?: number | undefined;
|
|
1882
1886
|
region_name?: string | undefined;
|
|
1883
|
-
active_sources?: number | undefined;
|
|
1884
1887
|
}[] | undefined;
|
|
1885
1888
|
}>;
|
|
1886
1889
|
export type RegionType = z.infer<typeof zodRegionSchema>;
|
package/dist/types.js
CHANGED
|
@@ -71,6 +71,7 @@ exports.zodSourceGroupSchema = zod_1.z.object({
|
|
|
71
71
|
updated_at: zod_1.z.number().optional(),
|
|
72
72
|
notes: zod_1.z.string().optional(),
|
|
73
73
|
status: zod_1.z.enum(exports.generalStatusList).optional(),
|
|
74
|
+
active_sources: zod_1.z.number().optional(), // e.g., current number of active sources
|
|
74
75
|
});
|
|
75
76
|
exports.zodSourceSchema = zod_1.z.object({
|
|
76
77
|
_id: zod_1.z.string().optional(),
|
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,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<
|
|
228
|
-
const response = await this.client.get<PaginatedResponse<
|
|
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),
|
package/types.ts
CHANGED
|
@@ -76,6 +76,7 @@ export const zodSourceGroupSchema = z.object({
|
|
|
76
76
|
updated_at: z.number().optional(), // last update date
|
|
77
77
|
notes: z.string().optional(), // internal notes about the source group
|
|
78
78
|
status: z.enum(generalStatusList).optional(),
|
|
79
|
+
active_sources: z.number().optional(), // e.g., current number of active sources
|
|
79
80
|
});
|
|
80
81
|
|
|
81
82
|
export const zodSourceSchema = z.object({
|
|
@@ -406,4 +407,4 @@ export type TelegramMetadataType = z.infer<typeof telegramMetadataSchema>;
|
|
|
406
407
|
export type FacebookMetadataType = z.infer<typeof facebookMetadataSchema>;
|
|
407
408
|
export type InstagramMetadataType = z.infer<typeof instagramMetadataSchema>;
|
|
408
409
|
export type TiktokMetadataType = z.infer<typeof tiktokMetadataSchema>;
|
|
409
|
-
export type WebsiteMetadataType = z.infer<typeof websiteMetadataSchema>;
|
|
410
|
+
export type WebsiteMetadataType = z.infer<typeof websiteMetadataSchema>;
|