harvester_sdk 1.0.1 → 1.0.2

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
@@ -260,7 +260,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
260
260
  name: string;
261
261
  created_at: number;
262
262
  updated_at: number;
263
- status: "active" | "pending" | "inactive" | "requested";
263
+ status: "active" | "pending" | "inactive" | "requested" | "deleted";
264
264
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
265
265
  entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
266
266
  tags: string[];
@@ -285,7 +285,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
285
285
  name: string;
286
286
  created_at: number;
287
287
  updated_at: number;
288
- status: "active" | "pending" | "inactive" | "requested";
288
+ status: "active" | "pending" | "inactive" | "requested" | "deleted";
289
289
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
290
290
  entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
291
291
  tags: string[];
@@ -310,7 +310,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
310
310
  name: string;
311
311
  created_at: number;
312
312
  updated_at: number;
313
- status: "active" | "pending" | "inactive" | "requested";
313
+ status: "active" | "pending" | "inactive" | "requested" | "deleted";
314
314
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
315
315
  entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
316
316
  tags: string[];
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"];
11
+ export declare const zodSourceStatusList: readonly ["active", "pending", "inactive", "requested", "deleted"];
12
12
  export declare const generalStatusList: readonly ["active", "inactive"];
13
13
  export declare const zodRegionSchema: z.ZodObject<{
14
14
  _id: z.ZodOptional<z.ZodString>;
@@ -60,7 +60,7 @@ export declare const zodSourceGroupSchema: z.ZodObject<{
60
60
  region_id?: string | undefined;
61
61
  max_active_sources?: number | undefined;
62
62
  }>;
63
- export declare const zodSourceSchema: z.ZodEffects<z.ZodObject<{
63
+ export declare const zodSourceSchema: z.ZodObject<{
64
64
  _id: z.ZodOptional<z.ZodString>;
65
65
  title: z.ZodOptional<z.ZodString>;
66
66
  platform: z.ZodEnum<["telegram", "facebook", "instagram", "tiktok", "website"]>;
@@ -71,7 +71,7 @@ export declare const zodSourceSchema: z.ZodEffects<z.ZodObject<{
71
71
  description: z.ZodOptional<z.ZodString>;
72
72
  language: z.ZodOptional<z.ZodString>;
73
73
  tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
74
- status: z.ZodEnum<["active", "pending", "inactive", "requested"]>;
74
+ status: z.ZodEnum<["active", "pending", "inactive", "requested", "deleted"]>;
75
75
  is_public: z.ZodDefault<z.ZodBoolean>;
76
76
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
77
77
  created_at: z.ZodOptional<z.ZodNumber>;
@@ -100,7 +100,7 @@ export declare const zodSourceSchema: z.ZodEffects<z.ZodObject<{
100
100
  notes: z.ZodOptional<z.ZodString>;
101
101
  }, "strip", z.ZodTypeAny, {
102
102
  name: string;
103
- status: "active" | "pending" | "inactive" | "requested";
103
+ status: "active" | "pending" | "inactive" | "requested" | "deleted";
104
104
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
105
105
  entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
106
106
  is_public: boolean;
@@ -126,59 +126,7 @@ export declare const zodSourceSchema: z.ZodEffects<z.ZodObject<{
126
126
  notes?: string | undefined;
127
127
  }, {
128
128
  name: string;
129
- status: "active" | "pending" | "inactive" | "requested";
130
- platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
131
- entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
132
- _id?: string | undefined;
133
- created_at?: number | undefined;
134
- updated_at?: number | undefined;
135
- description?: string | undefined;
136
- region_id?: string | undefined;
137
- title?: string | undefined;
138
- public_id?: string | number | undefined;
139
- url?: string | undefined;
140
- language?: string | undefined;
141
- tags?: string[] | undefined;
142
- is_public?: boolean | undefined;
143
- metadata?: Record<string, any> | undefined;
144
- group_id?: string | undefined;
145
- requested_by?: {
146
- user_id?: string | undefined;
147
- username?: string | undefined;
148
- full_name?: string | undefined;
149
- email?: string | undefined;
150
- requested_at?: number | undefined;
151
- } | undefined;
152
- notes?: string | undefined;
153
- }>, {
154
- name: string;
155
- status: "active" | "pending" | "inactive" | "requested";
156
- platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
157
- entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
158
- is_public: boolean;
159
- _id?: string | undefined;
160
- created_at?: number | undefined;
161
- updated_at?: number | undefined;
162
- description?: string | undefined;
163
- region_id?: string | undefined;
164
- title?: string | undefined;
165
- public_id?: string | number | undefined;
166
- url?: string | undefined;
167
- language?: string | undefined;
168
- tags?: string[] | undefined;
169
- metadata?: Record<string, any> | undefined;
170
- group_id?: string | undefined;
171
- requested_by?: {
172
- user_id?: string | undefined;
173
- username?: string | undefined;
174
- full_name?: string | undefined;
175
- email?: string | undefined;
176
- requested_at?: number | undefined;
177
- } | undefined;
178
- notes?: string | undefined;
179
- }, {
180
- name: string;
181
- status: "active" | "pending" | "inactive" | "requested";
129
+ status: "active" | "pending" | "inactive" | "requested" | "deleted";
182
130
  platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website";
183
131
  entity: "website" | "profile" | "group" | "page" | "channel" | "hashtag";
184
132
  _id?: string | undefined;
package/dist/types.js CHANGED
@@ -22,7 +22,8 @@ exports.zodSourceStatusList = [
22
22
  'active',
23
23
  'pending',
24
24
  'inactive',
25
- 'requested', // sources that are under review
25
+ 'requested',
26
+ 'deleted' // sources that have been deleted
26
27
  ];
27
28
  exports.generalStatusList = ['active', 'inactive'];
28
29
  exports.zodRegionSchema = zod_1.z.object({
@@ -72,14 +73,7 @@ exports.zodSourceSchema = zod_1.z
72
73
  })
73
74
  .optional(),
74
75
  notes: zod_1.z.string().optional(), // internal notes about the source
75
- })
76
- .refine((data) => {
77
- const allowedEntities = exports.platformEntityMap[data.platform];
78
- return allowedEntities.includes(data.entity);
79
- }, (data) => ({
80
- message: `Entity "${data.entity}" is not valid for platform "${data.platform}". Allowed entities: ${exports.platformEntityMap[data.platform].join(', ')}`,
81
- path: ['entity'],
82
- }));
76
+ });
83
77
  exports.zodGeoSchema = zod_1.z.object({
84
78
  _id: zod_1.z.string().optional(),
85
79
  geo_text: zod_1.z.string().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harvester_sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
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
@@ -24,6 +24,7 @@ export const zodSourceStatusList = [
24
24
  'pending', // sources that are pending approval
25
25
  'inactive', // sources that are inactive
26
26
  'requested', // sources that are under review
27
+ 'deleted' // sources that have been deleted
27
28
  ] as const;
28
29
 
29
30
  export const generalStatusList = ['active', 'inactive'] as const;
@@ -78,16 +79,6 @@ export const zodSourceSchema = z
78
79
  .optional(), // user who requested this source
79
80
  notes: z.string().optional(), // internal notes about the source
80
81
  })
81
- .refine(
82
- (data) => {
83
- const allowedEntities = platformEntityMap[data.platform] as readonly string[];
84
- return allowedEntities.includes(data.entity);
85
- },
86
- (data) => ({
87
- message: `Entity "${data.entity}" is not valid for platform "${data.platform}". Allowed entities: ${platformEntityMap[data.platform].join(', ')}`,
88
- path: ['entity'],
89
- })
90
- );
91
82
 
92
83
  export const zodGeoSchema = z.object({
93
84
  _id: z.string().optional(),