harvester_sdk 1.0.3 → 1.0.4

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
@@ -152,34 +152,6 @@ export declare const MongoDataSchema: Schema<any, import("mongoose").Model<any,
152
152
  } & {
153
153
  __v: number;
154
154
  }>;
155
- export declare const MongoInstructionsSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
156
- versionKey: false;
157
- toJSON: {
158
- virtuals: true;
159
- };
160
- toObject: {
161
- virtuals: true;
162
- };
163
- }, {
164
- created_at: number;
165
- updated_at: number;
166
- user_id: string;
167
- prompt?: string | null | undefined;
168
- }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
169
- created_at: number;
170
- updated_at: number;
171
- user_id: string;
172
- prompt?: string | null | undefined;
173
- }>, {}> & import("mongoose").FlatRecord<{
174
- created_at: number;
175
- updated_at: number;
176
- user_id: string;
177
- prompt?: string | null | undefined;
178
- }> & {
179
- _id: import("mongoose").Types.ObjectId;
180
- } & {
181
- __v: number;
182
- }>;
183
155
  export declare const MongoRegionSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
184
156
  versionKey: false;
185
157
  toJSON: {
@@ -193,19 +165,25 @@ export declare const MongoRegionSchema: Schema<any, import("mongoose").Model<any
193
165
  slug: string;
194
166
  created_at: number;
195
167
  updated_at: number;
168
+ status: "active" | "inactive" | "deleted";
196
169
  legend?: string | null | undefined;
170
+ notes?: string | null | undefined;
197
171
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
198
172
  name: string;
199
173
  slug: string;
200
174
  created_at: number;
201
175
  updated_at: number;
176
+ status: "active" | "inactive" | "deleted";
202
177
  legend?: string | null | undefined;
178
+ notes?: string | null | undefined;
203
179
  }>, {}> & import("mongoose").FlatRecord<{
204
180
  name: string;
205
181
  slug: string;
206
182
  created_at: number;
207
183
  updated_at: number;
184
+ status: "active" | "inactive" | "deleted";
208
185
  legend?: string | null | undefined;
186
+ notes?: string | null | undefined;
209
187
  }> & {
210
188
  _id: import("mongoose").Types.ObjectId;
211
189
  } & {
@@ -223,7 +201,9 @@ export declare const MongoSourceGroupSchema: Schema<any, import("mongoose").Mode
223
201
  name: string;
224
202
  created_at: number;
225
203
  updated_at: number;
204
+ status: "active" | "inactive" | "deleted";
226
205
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
206
+ notes?: string | null | undefined;
227
207
  description?: string | null | undefined;
228
208
  region_id?: string | null | undefined;
229
209
  max_active_sources?: number | null | undefined;
@@ -231,7 +211,9 @@ export declare const MongoSourceGroupSchema: Schema<any, import("mongoose").Mode
231
211
  name: string;
232
212
  created_at: number;
233
213
  updated_at: number;
214
+ status: "active" | "inactive" | "deleted";
234
215
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
216
+ notes?: string | null | undefined;
235
217
  description?: string | null | undefined;
236
218
  region_id?: string | null | undefined;
237
219
  max_active_sources?: number | null | undefined;
@@ -239,7 +221,9 @@ export declare const MongoSourceGroupSchema: Schema<any, import("mongoose").Mode
239
221
  name: string;
240
222
  created_at: number;
241
223
  updated_at: number;
224
+ status: "active" | "inactive" | "deleted";
242
225
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
226
+ notes?: string | null | undefined;
243
227
  description?: string | null | undefined;
244
228
  region_id?: string | null | undefined;
245
229
  max_active_sources?: number | null | undefined;
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.MongoApiKeySchema = exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoSourceGroupSchema = exports.MongoRegionSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
17
+ exports.MongoApiKeySchema = exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoSourceGroupSchema = exports.MongoRegionSchema = exports.MongoDataSchema = void 0;
18
18
  // Export types for consumers
19
19
  __exportStar(require("./types"), exports);
20
20
  const mongoose_1 = require("mongoose");
@@ -62,22 +62,18 @@ exports.MongoDataSchema = new mongoose_1.Schema({
62
62
  toJSON: { virtuals: true },
63
63
  toObject: { virtuals: true },
64
64
  });
65
- exports.MongoInstructionsSchema = new mongoose_1.Schema({
66
- user_id: { type: String, required: true },
67
- prompt: { type: String },
68
- created_at: { type: Number, default: Date.now },
69
- updated_at: { type: Number, default: Date.now },
70
- }, {
71
- versionKey: false,
72
- toJSON: { virtuals: true },
73
- toObject: { virtuals: true },
74
- });
75
65
  exports.MongoRegionSchema = new mongoose_1.Schema({
76
66
  name: { type: String, required: true },
77
67
  slug: { type: String, required: true },
78
68
  legend: { type: String },
79
69
  created_at: { type: Number, default: Date.now },
80
- updated_at: { type: Number, default: Date.now }, // last update date
70
+ updated_at: { type: Number, default: Date.now },
71
+ status: {
72
+ type: String,
73
+ enum: types_1.generalStatusList,
74
+ default: 'active',
75
+ },
76
+ notes: { type: String }, // internal notes about the region
81
77
  }, {
82
78
  versionKey: false,
83
79
  toJSON: { virtuals: true },
@@ -94,7 +90,13 @@ exports.MongoSourceGroupSchema = new mongoose_1.Schema({
94
90
  region_id: { type: String },
95
91
  max_active_sources: { type: Number },
96
92
  created_at: { type: Number, default: Date.now },
97
- updated_at: { type: Number, default: Date.now }, // last update date
93
+ updated_at: { type: Number, default: Date.now },
94
+ notes: { type: String },
95
+ status: {
96
+ type: String,
97
+ enum: types_1.generalStatusList,
98
+ default: 'active',
99
+ },
98
100
  }, {
99
101
  versionKey: false,
100
102
  toJSON: { virtuals: true },
@@ -120,7 +122,7 @@ exports.MongoSourceSchema = new mongoose_1.Schema({
120
122
  tags: { type: [String], default: [] },
121
123
  status: {
122
124
  type: String,
123
- enum: types_1.zodSourceStatusList,
125
+ enum: types_1.sourceStatusList,
124
126
  default: 'pending',
125
127
  },
126
128
  is_public: { type: Boolean, default: true },
package/dist/types.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare const platformEntityMap: {
8
8
  readonly tiktok: readonly ["profile", "hashtag"];
9
9
  readonly website: readonly ["website"];
10
10
  };
11
- export declare const zodSourceStatusList: readonly ["active", "pending", "inactive", "requested", "deleted"];
11
+ export declare const sourceStatusList: readonly ["active", "pending", "inactive", "requested", "deleted"];
12
12
  export declare const generalStatusList: readonly ["active", "inactive", "deleted"];
13
13
  export declare const zodRegionSchema: z.ZodObject<{
14
14
  _id: z.ZodOptional<z.ZodString>;
@@ -326,7 +326,8 @@ export type RegionType = z.infer<typeof zodRegionSchema>;
326
326
  export type SourceGroupType = z.infer<typeof zodSourceGroupSchema>;
327
327
  export type SourceType = z.infer<typeof zodSourceSchema>;
328
328
  export type DataType = z.infer<typeof zodDataSchema>;
329
- export type StatusType = (typeof zodSourceStatusList)[number];
329
+ export type SourceStatusType = (typeof sourceStatusList)[number];
330
+ export type StatusType = (typeof generalStatusList)[number];
330
331
  export type TimeRangeTypeLiteral = 'relative' | 'absolute';
331
332
  export type AddSourceToReviewType = Pick<SourceType, 'platform' | 'url' | 'description'> & Partial<Pick<SourceType, 'public_id'>>;
332
333
  export type GeoType = z.infer<typeof zodGeoSchema>;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAllowedEntitiesForPlatform = exports.zodDataSchema = exports.zodGeoSelectionSchema = exports.zodGeoSchema = exports.zodSourceSchema = exports.zodSourceGroupSchema = exports.zodRegionSchema = exports.generalStatusList = exports.zodSourceStatusList = exports.platformEntityMap = exports.entityTypesList = exports.platformsList = void 0;
3
+ exports.getAllowedEntitiesForPlatform = exports.zodDataSchema = exports.zodGeoSelectionSchema = exports.zodGeoSchema = exports.zodSourceSchema = exports.zodSourceGroupSchema = exports.zodRegionSchema = exports.generalStatusList = exports.sourceStatusList = exports.platformEntityMap = exports.entityTypesList = exports.platformsList = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.platformsList = [
6
6
  'telegram',
@@ -25,7 +25,7 @@ exports.platformEntityMap = {
25
25
  tiktok: ['profile', 'hashtag'],
26
26
  website: ['website'],
27
27
  };
28
- exports.zodSourceStatusList = [
28
+ exports.sourceStatusList = [
29
29
  'active',
30
30
  'pending',
31
31
  'inactive',
@@ -66,7 +66,7 @@ exports.zodSourceSchema = zod_1.z.object({
66
66
  description: zod_1.z.string().optional(),
67
67
  language: zod_1.z.string().optional(),
68
68
  tags: zod_1.z.array(zod_1.z.string()).optional(),
69
- status: zod_1.z.enum(exports.zodSourceStatusList),
69
+ status: zod_1.z.enum(exports.sourceStatusList),
70
70
  is_public: zod_1.z.boolean().default(true),
71
71
  metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
72
72
  created_at: zod_1.z.number().optional(),
package/index.ts CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  generalStatusList,
7
7
  platformsList,
8
8
  entityTypesList,
9
- zodSourceStatusList
9
+ sourceStatusList
10
10
  } from './types';
11
11
 
12
12
  export const MongoDataSchema = new Schema(
@@ -56,20 +56,6 @@ export const MongoDataSchema = new Schema(
56
56
  }
57
57
  );
58
58
 
59
- export const MongoInstructionsSchema = new Schema(
60
- {
61
- user_id: { type: String, required: true },
62
- prompt: { type: String },
63
- created_at: { type: Number, default: Date.now },
64
- updated_at: { type: Number, default: Date.now },
65
- },
66
- {
67
- versionKey: false,
68
- toJSON: { virtuals: true },
69
- toObject: { virtuals: true },
70
- }
71
- );
72
-
73
59
  export const MongoRegionSchema = new Schema(
74
60
  {
75
61
  name: { type: String, required: true }, // e.g., "New York"
@@ -77,6 +63,13 @@ export const MongoRegionSchema = new Schema(
77
63
  legend: { type: String }, // e.g., legend for maps
78
64
  created_at: { type: Number, default: Date.now }, // creation date
79
65
  updated_at: { type: Number, default: Date.now }, // last update date
66
+ status: {
67
+ type: String,
68
+ enum: generalStatusList,
69
+ default: 'active',
70
+ },
71
+ notes: { type: String }, // internal notes about the region
72
+
80
73
  },
81
74
  {
82
75
  versionKey: false,
@@ -98,6 +91,12 @@ export const MongoSourceGroupSchema = new Schema(
98
91
  max_active_sources: { type: Number }, // e.g., maximum number of active sources allowed
99
92
  created_at: { type: Number, default: Date.now }, // creation date
100
93
  updated_at: { type: Number, default: Date.now }, // last update date
94
+ notes: { type: String }, // internal notes about the source group
95
+ status: {
96
+ type: String,
97
+ enum: generalStatusList,
98
+ default: 'active',
99
+ },
101
100
  },
102
101
  {
103
102
  versionKey: false,
@@ -127,7 +126,7 @@ export const MongoSourceSchema = new Schema(
127
126
  tags: { type: [String], default: [] }, // array of tags
128
127
  status: {
129
128
  type: String,
130
- enum: zodSourceStatusList,
129
+ enum: sourceStatusList,
131
130
  default: 'pending',
132
131
  }, // INDEX
133
132
  is_public: { type: Boolean, default: true }, // true if the source is public
@@ -147,6 +146,7 @@ export const MongoSourceSchema = new Schema(
147
146
  default: undefined,
148
147
  }, // user who requested this source
149
148
  notes: { type: String }, // internal notes about the source
149
+
150
150
  },
151
151
  {
152
152
  versionKey: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harvester_sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
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
@@ -26,7 +26,7 @@ export const platformEntityMap = {
26
26
  website: ['website'],
27
27
  } as const;
28
28
 
29
- export const zodSourceStatusList = [
29
+ export const sourceStatusList = [
30
30
  'active', // active and approved sources
31
31
  'pending', // sources that are pending approval
32
32
  'inactive', // sources that are inactive
@@ -71,7 +71,7 @@ export const zodSourceSchema = z.object({
71
71
  description: z.string().optional(), // e.g., 'A channel about news and updates'
72
72
  language: z.string().optional(),
73
73
  tags: z.array(z.string()).optional(),
74
- status: z.enum(zodSourceStatusList), // INDEX
74
+ status: z.enum(sourceStatusList), // INDEX
75
75
  is_public: z.boolean().default(true), // true if the source is public
76
76
  metadata: z.record(z.string(), z.any()).optional(), // flexible per platform
77
77
  created_at: z.number().optional(),
@@ -159,7 +159,8 @@ export type RegionType = z.infer<typeof zodRegionSchema>;
159
159
  export type SourceGroupType = z.infer<typeof zodSourceGroupSchema>;
160
160
  export type SourceType = z.infer<typeof zodSourceSchema>;
161
161
  export type DataType = z.infer<typeof zodDataSchema>;
162
- export type StatusType = (typeof zodSourceStatusList)[number];
162
+ export type SourceStatusType = (typeof sourceStatusList)[number];
163
+ export type StatusType = (typeof generalStatusList)[number];
163
164
  export type TimeRangeTypeLiteral = 'relative' | 'absolute';
164
165
  export type AddSourceToReviewType = Pick<
165
166
  SourceType,