asfur 1.0.39 → 1.0.41

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
@@ -688,7 +688,7 @@ export declare const MongoConversationSchema: Schema<{
688
688
  }> & {
689
689
  __v: number;
690
690
  }>;
691
- export declare const MongoAutomationJobSchema: Schema<{
691
+ export declare const MongoJobSchema: Schema<{
692
692
  status: "inactive" | "active";
693
693
  user_id: string;
694
694
  query: {
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.MongoAutomationJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
17
+ exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
18
18
  // Export types for consumers
19
19
  __exportStar(require("./types"), exports);
20
20
  const mongoose_1 = require("mongoose");
@@ -134,7 +134,7 @@ exports.MongoConversationSchema = new mongoose_1.Schema({
134
134
  toJSON: { virtuals: true },
135
135
  toObject: { virtuals: true },
136
136
  });
137
- exports.MongoAutomationJobSchema = new mongoose_1.Schema({
137
+ exports.MongoJobSchema = new mongoose_1.Schema({
138
138
  user_id: { type: String, required: true },
139
139
  job_name: { type: String, required: true },
140
140
  job_description: { type: String },
@@ -147,7 +147,7 @@ exports.MongoAutomationJobSchema = new mongoose_1.Schema({
147
147
  updated_at: { type: Number, default: Date.now },
148
148
  schedule: { type: String },
149
149
  schedule_text: { type: String },
150
- active_until: { type: Number },
150
+ active_until: { type: Number || undefined },
151
151
  query: { type: mongoose_1.Schema.Types.Mixed, required: true }, // query associated with the job
152
152
  }, {
153
153
  versionKey: false,
package/dist/types.d.ts CHANGED
@@ -329,7 +329,7 @@ export declare const zodConversationSchema: z.ZodObject<{
329
329
  updated_at?: number | Date | undefined;
330
330
  thread_id?: string | undefined;
331
331
  }>;
332
- export declare const zodAutomationJobSchema: z.ZodObject<{
332
+ export declare const zodJobSchema: z.ZodObject<{
333
333
  _id: z.ZodOptional<z.ZodString>;
334
334
  job_name: z.ZodString;
335
335
  job_description: z.ZodOptional<z.ZodString>;
@@ -487,5 +487,5 @@ export type RelativeTimeRangeType = (typeof relativeTimeRangeList)[number];
487
487
  export type AddSourceToReviewType = Pick<SourceType, 'platform' | 'url' | 'description' | 'source_public_id'>;
488
488
  export type UserSettingsType = z.infer<typeof zodUserSettingsSchema>;
489
489
  export type ConversationType = z.infer<typeof zodConversationSchema>;
490
- export type AutomationJobType = z.infer<typeof zodAutomationJobSchema>;
490
+ export type JobType = z.infer<typeof zodJobSchema>;
491
491
  export type CronScheduleResponseType = z.infer<typeof zodCronScheduleResponseSchema>;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zodCronScheduleResponseSchema = exports.zodAutomationJobSchema = exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.relativeTimeRangeList = exports.zodDataSchema = exports.zodSourceSchema = exports.generalStatusList = exports.statusList = exports.platformsList = void 0;
3
+ exports.zodCronScheduleResponseSchema = exports.zodJobSchema = exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.relativeTimeRangeList = exports.zodDataSchema = exports.zodSourceSchema = exports.generalStatusList = exports.statusList = exports.platformsList = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.platformsList = [
6
6
  'telegram',
@@ -121,7 +121,7 @@ exports.zodConversationSchema = zod_1.z.object({
121
121
  created_at: zod_1.z.coerce.date().or(zod_1.z.number()).optional(),
122
122
  updated_at: zod_1.z.coerce.date().or(zod_1.z.number()).optional(), // last update date
123
123
  });
124
- exports.zodAutomationJobSchema = zod_1.z.object({
124
+ exports.zodJobSchema = zod_1.z.object({
125
125
  _id: zod_1.z.string().optional(),
126
126
  job_name: zod_1.z.string().nonempty('Job name must be provided'),
127
127
  job_description: zod_1.z.string().optional(),
package/index.ts CHANGED
@@ -3,11 +3,11 @@ export * from './types';
3
3
 
4
4
  import { Schema } from 'mongoose';
5
5
  import {
6
- AutomationJobType,
7
6
  ConversationType,
8
7
  DataType,
9
8
  generalStatusList,
10
9
  InstructionsType,
10
+ JobType,
11
11
  QueryType,
12
12
  SourceType,
13
13
  UserSettingsType,
@@ -152,7 +152,7 @@ export const MongoConversationSchema = new Schema<ConversationType>(
152
152
  }
153
153
  );
154
154
 
155
- export const MongoAutomationJobSchema = new Schema<AutomationJobType>(
155
+ export const MongoJobSchema = new Schema<JobType>(
156
156
  {
157
157
  user_id: { type: String, required: true }, // user identifier
158
158
  job_name: { type: String, required: true }, // name of the automation job
@@ -166,7 +166,7 @@ export const MongoAutomationJobSchema = new Schema<AutomationJobType>(
166
166
  updated_at: { type: Number, default: Date.now }, // last update date
167
167
  schedule: { type: String }, // cron schedule for the job
168
168
  schedule_text: { type: String }, // cron schedule in free-text format
169
- active_until: { type: Number }, // optional date until which the job is active
169
+ active_until: { type: Number || undefined }, // optional date until which the job is active
170
170
  query: { type: Schema.Types.Mixed, required: true }, // query associated with the job
171
171
  },
172
172
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "SDK for interacting with the Asfur API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/types.ts CHANGED
@@ -133,7 +133,7 @@ export const zodConversationSchema = z.object({
133
133
  updated_at: z.coerce.date().or(z.number()).optional(), // last update date
134
134
  });
135
135
 
136
- export const zodAutomationJobSchema = z.object({
136
+ export const zodJobSchema = z.object({
137
137
  _id: z.string().optional(),
138
138
  job_name: z.string().nonempty('Job name must be provided'), // name of the automation job
139
139
  job_description: z.string().optional(), // optional description for the job
@@ -170,5 +170,5 @@ export type AddSourceToReviewType = Pick<
170
170
  >;
171
171
  export type UserSettingsType = z.infer<typeof zodUserSettingsSchema>;
172
172
  export type ConversationType = z.infer<typeof zodConversationSchema>;
173
- export type AutomationJobType = z.infer<typeof zodAutomationJobSchema>;
173
+ export type JobType = z.infer<typeof zodJobSchema>;
174
174
  export type CronScheduleResponseType = z.infer<typeof zodCronScheduleResponseSchema>;