harvester_sdk 1.0.48 → 1.0.50

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/index.d.ts CHANGED
@@ -722,3 +722,46 @@ export declare const MongoRegionSummarySchema: Schema<any, import("mongoose").Mo
722
722
  } & {
723
723
  __v: number;
724
724
  }>;
725
+ export declare const MongoServerReportSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
726
+ versionKey: false;
727
+ toJSON: {
728
+ virtuals: true;
729
+ };
730
+ toObject: {
731
+ virtuals: true;
732
+ };
733
+ }, {
734
+ timestamp: number;
735
+ additional_info: any;
736
+ year?: number | null | undefined;
737
+ month?: number | null | undefined;
738
+ day?: number | null | undefined;
739
+ server_name?: string | null | undefined;
740
+ server_id?: string | null | undefined;
741
+ post_count?: number | null | undefined;
742
+ error_message?: string | null | undefined;
743
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
744
+ timestamp: number;
745
+ additional_info: any;
746
+ year?: number | null | undefined;
747
+ month?: number | null | undefined;
748
+ day?: number | null | undefined;
749
+ server_name?: string | null | undefined;
750
+ server_id?: string | null | undefined;
751
+ post_count?: number | null | undefined;
752
+ error_message?: string | null | undefined;
753
+ }>, {}> & import("mongoose").FlatRecord<{
754
+ timestamp: number;
755
+ additional_info: any;
756
+ year?: number | null | undefined;
757
+ month?: number | null | undefined;
758
+ day?: number | null | undefined;
759
+ server_name?: string | null | undefined;
760
+ server_id?: string | null | undefined;
761
+ post_count?: number | null | undefined;
762
+ error_message?: string | null | undefined;
763
+ }> & {
764
+ _id: import("mongoose").Types.ObjectId;
765
+ } & {
766
+ __v: number;
767
+ }>;
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.MongoRegionSummarySchema = exports.MongoApiKeySchema = exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoSourceSchema = exports.MongoSourceGroupSchema = exports.MongoRegionSchema = exports.MongoDataSchema = exports.HarvesterSDKError = exports.createHarvesterSDK = exports.HarvesterSDK = void 0;
17
+ exports.MongoServerReportSchema = exports.MongoRegionSummarySchema = exports.MongoApiKeySchema = exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoSourceSchema = exports.MongoSourceGroupSchema = exports.MongoRegionSchema = exports.MongoDataSchema = exports.HarvesterSDKError = exports.createHarvesterSDK = exports.HarvesterSDK = void 0;
18
18
  // Export types for consumers
19
19
  __exportStar(require("./types"), exports);
20
20
  // Export SDK
@@ -326,3 +326,18 @@ exports.MongoRegionSummarySchema = new mongoose_1.Schema({
326
326
  toJSON: { virtuals: true },
327
327
  toObject: { virtuals: true },
328
328
  });
329
+ exports.MongoServerReportSchema = new mongoose_1.Schema({
330
+ timestamp: { type: Number, default: Date.now },
331
+ year: { type: Number },
332
+ month: { type: Number },
333
+ day: { type: Number },
334
+ server_name: { type: String },
335
+ server_id: { type: String },
336
+ post_count: { type: Number },
337
+ error_message: { type: String },
338
+ additional_info: { type: Object, default: {} }, // flexible field for any additional info
339
+ }, {
340
+ versionKey: false,
341
+ toJSON: { virtuals: true },
342
+ toObject: { virtuals: true },
343
+ });
package/dist/types.d.ts CHANGED
@@ -1967,6 +1967,40 @@ export declare const zodRegionSummarySchema: z.ZodObject<{
1967
1967
  start_date?: number | undefined;
1968
1968
  end_date?: number | undefined;
1969
1969
  }>;
1970
+ export declare const zodServerReportSchema: z.ZodObject<{
1971
+ _id: z.ZodOptional<z.ZodString>;
1972
+ timestamp: z.ZodOptional<z.ZodNumber>;
1973
+ year: z.ZodOptional<z.ZodNumber>;
1974
+ month: z.ZodOptional<z.ZodNumber>;
1975
+ day: z.ZodOptional<z.ZodNumber>;
1976
+ server_name: z.ZodOptional<z.ZodString>;
1977
+ server_id: z.ZodOptional<z.ZodString>;
1978
+ post_count: z.ZodOptional<z.ZodNumber>;
1979
+ error_message: z.ZodOptional<z.ZodString>;
1980
+ additional_info: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1981
+ }, "strip", z.ZodTypeAny, {
1982
+ _id?: string | undefined;
1983
+ timestamp?: number | undefined;
1984
+ year?: number | undefined;
1985
+ month?: number | undefined;
1986
+ day?: number | undefined;
1987
+ server_name?: string | undefined;
1988
+ server_id?: string | undefined;
1989
+ post_count?: number | undefined;
1990
+ error_message?: string | undefined;
1991
+ additional_info?: Record<string, any> | undefined;
1992
+ }, {
1993
+ _id?: string | undefined;
1994
+ timestamp?: number | undefined;
1995
+ year?: number | undefined;
1996
+ month?: number | undefined;
1997
+ day?: number | undefined;
1998
+ server_name?: string | undefined;
1999
+ server_id?: string | undefined;
2000
+ post_count?: number | undefined;
2001
+ error_message?: string | undefined;
2002
+ additional_info?: Record<string, any> | undefined;
2003
+ }>;
1970
2004
  export type RegionType = z.infer<typeof zodRegionSchema>;
1971
2005
  export type SourceGroupType = z.infer<typeof zodSourceGroupSchema>;
1972
2006
  export type SourceType = z.infer<typeof zodSourceSchema>;
@@ -1978,6 +2012,7 @@ export type GeoType = z.infer<typeof zodGeoSchema>;
1978
2012
  export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
1979
2013
  export type DashboardStatsType = z.infer<typeof zodDashboardStatsSchema>;
1980
2014
  export type RegionSummaryType = z.infer<typeof zodRegionSummarySchema>;
2015
+ export type ServerReportType = z.infer<typeof zodServerReportSchema>;
1981
2016
  export type TelegramMetadataType = z.infer<typeof telegramMetadataSchema>;
1982
2017
  export type FacebookMetadataType = z.infer<typeof facebookMetadataSchema>;
1983
2018
  export type InstagramMetadataType = z.infer<typeof instagramMetadataSchema>;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zodRegionSummarySchema = exports.zodDashboardStatsSchema = exports.zodDataSchemaWithValidation = exports.zodDataSchema = exports.authorSchema = exports.repliesInfoSchema = exports.mediaItemSchema = exports.websiteMetadataSchema = exports.tiktokMetadataSchema = exports.instagramMetadataSchema = exports.facebookMetadataSchema = exports.telegramMetadataSchema = exports.zodGeoSelectionSchema = exports.zodGeoSchema = exports.zodSourceSchema = exports.zodSourceGroupSchema = exports.zodRegionSchema = exports.generalStatusList = exports.sourceStatusList = exports.priorityLevels = exports.platformEntityMap = exports.entityTypesList = exports.platformsList = void 0;
3
+ exports.zodServerReportSchema = exports.zodRegionSummarySchema = exports.zodDashboardStatsSchema = exports.zodDataSchemaWithValidation = exports.zodDataSchema = exports.authorSchema = exports.repliesInfoSchema = exports.mediaItemSchema = exports.websiteMetadataSchema = exports.tiktokMetadataSchema = exports.instagramMetadataSchema = exports.facebookMetadataSchema = exports.telegramMetadataSchema = exports.zodGeoSelectionSchema = exports.zodGeoSchema = exports.zodSourceSchema = exports.zodSourceGroupSchema = exports.zodRegionSchema = exports.generalStatusList = exports.sourceStatusList = exports.priorityLevels = exports.platformEntityMap = exports.entityTypesList = exports.platformsList = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.platformsList = [
6
6
  'telegram',
@@ -59,13 +59,17 @@ exports.zodRegionSchema = zod_1.z.object({
59
59
  updated_at: zod_1.z.number().optional(),
60
60
  status: zod_1.z.enum(exports.generalStatusList).optional(),
61
61
  notes: zod_1.z.string().optional(),
62
- coordinates: zod_1.z.object({
62
+ coordinates: zod_1.z
63
+ .object({
63
64
  type: zod_1.z.enum(['point', 'polygon']).optional(),
64
- coordinates: zod_1.z.union([
65
+ coordinates: zod_1.z
66
+ .union([
65
67
  zod_1.z.tuple([zod_1.z.number(), zod_1.z.number()]),
66
68
  zod_1.z.array(zod_1.z.tuple([zod_1.z.number(), zod_1.z.number()])), // polygon: [[lng, lat], [lng, lat], ...]
67
- ]).optional(),
68
- }).optional(),
69
+ ])
70
+ .optional(),
71
+ })
72
+ .optional(),
69
73
  });
70
74
  exports.zodSourceGroupSchema = zod_1.z.object({
71
75
  _id: zod_1.z.string().optional(),
@@ -140,13 +144,17 @@ exports.zodGeoSelectionSchema = zod_1.z.object({
140
144
  status: zod_1.z.enum(exports.generalStatusList).optional(),
141
145
  created_at: zod_1.z.number().optional(),
142
146
  updated_at: zod_1.z.number().optional(),
143
- coordinates: zod_1.z.object({
147
+ coordinates: zod_1.z
148
+ .object({
144
149
  type: zod_1.z.enum(['point', 'polygon']).optional(),
145
- coordinates: zod_1.z.union([
150
+ coordinates: zod_1.z
151
+ .union([
146
152
  zod_1.z.tuple([zod_1.z.number(), zod_1.z.number()]),
147
153
  zod_1.z.array(zod_1.z.tuple([zod_1.z.number(), zod_1.z.number()])), // polygon: [[lng, lat], [lng, lat], ...]
148
- ]).optional(),
149
- }).optional(),
154
+ ])
155
+ .optional(),
156
+ })
157
+ .optional(),
150
158
  lat: zod_1.z.number().optional(),
151
159
  lng: zod_1.z.number().optional(),
152
160
  });
@@ -378,3 +386,15 @@ exports.zodRegionSummarySchema = zod_1.z.object({
378
386
  start_date: zod_1.z.number().optional(),
379
387
  end_date: zod_1.z.number().optional(),
380
388
  });
389
+ exports.zodServerReportSchema = zod_1.z.object({
390
+ _id: zod_1.z.string().optional(),
391
+ timestamp: zod_1.z.number().optional(),
392
+ year: zod_1.z.number().optional(),
393
+ month: zod_1.z.number().optional(),
394
+ day: zod_1.z.number().optional(),
395
+ server_name: zod_1.z.string().optional(),
396
+ server_id: zod_1.z.string().optional(),
397
+ post_count: zod_1.z.number().optional(),
398
+ error_message: zod_1.z.string().optional(),
399
+ additional_info: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
400
+ });
package/index.ts CHANGED
@@ -359,3 +359,22 @@ export const MongoRegionSummarySchema = new Schema(
359
359
  toObject: { virtuals: true },
360
360
  },
361
361
  );
362
+
363
+ export const MongoServerReportSchema = new Schema(
364
+ {
365
+ timestamp: { type: Number, default: Date.now }, // report generation timestamp
366
+ year: { type: Number }, // e.g., 2024
367
+ month: { type: Number }, // e.g., 6 for June
368
+ day: { type: Number }, // e.g., 10
369
+ server_name: { type: String }, // e.g., "Server-1"
370
+ server_id: { type: String }, // e.g., "server-1" (group_id or source_id depending on the context)
371
+ post_count: { type: Number }, // number of posts processed
372
+ error_message: { type: String }, // any error messages encountered during processing
373
+ additional_info: { type: Object, default: {} }, // flexible field for any additional info
374
+ },
375
+ {
376
+ versionKey: false,
377
+ toJSON: { virtuals: true },
378
+ toObject: { virtuals: true },
379
+ },
380
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harvester_sdk",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "description": "SDK for interacting with the Harvester API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/types.ts CHANGED
@@ -63,13 +63,17 @@ export const zodRegionSchema = z.object({
63
63
  updated_at: z.number().optional(), // last update date
64
64
  status: z.enum(generalStatusList).optional(),
65
65
  notes: z.string().optional(), // internal notes about the region
66
- coordinates: z.object({
67
- type: z.enum(['point', 'polygon']).optional(),
68
- coordinates: z.union([
69
- z.tuple([z.number(), z.number()]), // point: [lng, lat]
70
- z.array(z.tuple([z.number(), z.number()])), // polygon: [[lng, lat], [lng, lat], ...]
71
- ]).optional(),
72
- }).optional(),
66
+ coordinates: z
67
+ .object({
68
+ type: z.enum(['point', 'polygon']).optional(),
69
+ coordinates: z
70
+ .union([
71
+ z.tuple([z.number(), z.number()]), // point: [lng, lat]
72
+ z.array(z.tuple([z.number(), z.number()])), // polygon: [[lng, lat], [lng, lat], ...]
73
+ ])
74
+ .optional(),
75
+ })
76
+ .optional(),
73
77
  });
74
78
 
75
79
  export const zodSourceGroupSchema = z.object({
@@ -150,13 +154,17 @@ export const zodGeoSelectionSchema = z.object({
150
154
  status: z.enum(generalStatusList).optional(),
151
155
  created_at: z.number().optional(), // creation date
152
156
  updated_at: z.number().optional(), // last update date
153
- coordinates: z.object({
154
- type: z.enum(['point', 'polygon']).optional(),
155
- coordinates: z.union([
156
- z.tuple([z.number(), z.number()]), // point: [lng, lat]
157
- z.array(z.tuple([z.number(), z.number()])), // polygon: [[lng, lat], [lng, lat], ...]
158
- ]).optional(),
159
- }).optional(),
157
+ coordinates: z
158
+ .object({
159
+ type: z.enum(['point', 'polygon']).optional(),
160
+ coordinates: z
161
+ .union([
162
+ z.tuple([z.number(), z.number()]), // point: [lng, lat]
163
+ z.array(z.tuple([z.number(), z.number()])), // polygon: [[lng, lat], [lng, lat], ...]
164
+ ])
165
+ .optional(),
166
+ })
167
+ .optional(),
160
168
  lat: z.number().optional(),
161
169
  lng: z.number().optional(),
162
170
  });
@@ -420,6 +428,19 @@ export const zodRegionSummarySchema = z.object({
420
428
  end_date: z.number().optional(),
421
429
  });
422
430
 
431
+ export const zodServerReportSchema = z.object({
432
+ _id: z.string().optional(),
433
+ timestamp: z.number().optional(),
434
+ year: z.number().optional(),
435
+ month: z.number().optional(),
436
+ day: z.number().optional(),
437
+ server_name: z.string().optional(),
438
+ server_id: z.string().optional(), // group_id or source_id depending on the context
439
+ post_count: z.number().optional(),
440
+ error_message: z.string().optional(),
441
+ additional_info: z.record(z.string(), z.any()).optional(),
442
+ });
443
+
423
444
  export type RegionType = z.infer<typeof zodRegionSchema>;
424
445
  export type SourceGroupType = z.infer<typeof zodSourceGroupSchema>;
425
446
  export type SourceType = z.infer<typeof zodSourceSchema>;
@@ -431,6 +452,7 @@ export type GeoType = z.infer<typeof zodGeoSchema>;
431
452
  export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
432
453
  export type DashboardStatsType = z.infer<typeof zodDashboardStatsSchema>;
433
454
  export type RegionSummaryType = z.infer<typeof zodRegionSummarySchema>;
455
+ export type ServerReportType = z.infer<typeof zodServerReportSchema>;
434
456
 
435
457
  // Platform-specific metadata types
436
458
  export type TelegramMetadataType = z.infer<typeof telegramMetadataSchema>;