@avakado.ai/schemas 1.1.27 → 1.1.28
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/models.d.ts +1 -1
- package/package.json +1 -1
- package/src/models/CronJob.js +26 -0
- package/src/models/index.js +1 -0
- package/types/models/CronJob.d.ts +3 -0
- package/types.d.ts +21 -0
package/models.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
|
|
2
2
|
|
|
3
|
-
export { Action, AgentModel, AmountSchema, Api, ApiAuthenticationSchema, ApiAuthenticators, BillingLog, Business, BusinessSchema, CallSession, Campaign, CampaignSchema, Channel, ChannelCapabilityDefaults, Collection, Conversation, ConversationSchema, Data, DemonstrationModel, Lead, LeadTemplate, Log, Message, MessageSession, Notification, OAuthAuthorizationCode, OAuthClient, OAuthRefreshToken, OAuthRevokedJti, Payment, PaymentSchema, Plan, Providers, RoleScopes, ScopesEnum, Subscription, SubscriptionSchema, Task, TaskSchema, Template, Ticket, TriggerTemplate, UsageLog, UsageLogSchema, User, Workflow, WorkflowLogs } from "./types.js";
|
|
3
|
+
export { Action, AgentModel, AmountSchema, Api, ApiAuthenticationSchema, ApiAuthenticators, BillingLog, Business, BusinessSchema, CallSession, Campaign, CampaignSchema, Channel, ChannelCapabilityDefaults, Collection, Conversation, ConversationSchema, CronJob, Data, DemonstrationModel, Lead, LeadTemplate, Log, Message, MessageSession, Notification, OAuthAuthorizationCode, OAuthClient, OAuthRefreshToken, OAuthRevokedJti, Payment, PaymentSchema, Plan, Providers, RoleScopes, ScopesEnum, Subscription, SubscriptionSchema, Task, TaskSchema, Template, Ticket, TriggerTemplate, UsageLog, UsageLogSchema, User, Workflow, WorkflowLogs } from "./types.js";
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Schema } from "mongoose";
|
|
2
|
+
import { defineModel } from "../runtime.js";
|
|
3
|
+
|
|
4
|
+
const CronJobSchema = new Schema({
|
|
5
|
+
_id: { type: String },
|
|
6
|
+
name: { type: String, required: true },
|
|
7
|
+
scheduleType: { type: String, enum: ["cron", "once"], default: "once" },
|
|
8
|
+
schedule: String,
|
|
9
|
+
runAt: Date,
|
|
10
|
+
type: { type: String, enum: ["shell", "http"], required: true },
|
|
11
|
+
command: String,
|
|
12
|
+
url: String,
|
|
13
|
+
method: { type: String, default: "GET" },
|
|
14
|
+
headers: String,
|
|
15
|
+
params: String,
|
|
16
|
+
body: String,
|
|
17
|
+
enabled: { type: Boolean, default: true },
|
|
18
|
+
lastRun: Date,
|
|
19
|
+
lastStatus: String,
|
|
20
|
+
miscIds: { type: Schema.Types.Mixed, default: () => ({}) },
|
|
21
|
+
createdAt: { type: Date, default: Date.now },
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
CronJobSchema.index({ scheduleType: 1, enabled: 1, runAt: 1 });
|
|
25
|
+
|
|
26
|
+
export const CronJob = defineModel("CronJob", CronJobSchema, "CronJobs");
|
package/src/models/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { User, ScopesEnum, RoleScopes } from "./User.js";
|
|
|
9
9
|
export { AgentModel } from "./Agent.js";
|
|
10
10
|
export { Channel, ChannelCapabilityDefaults } from "./Channels.js";
|
|
11
11
|
export { CallSession } from "./CallSessions.js";
|
|
12
|
+
export { CronJob } from "./CronJob.js";
|
|
12
13
|
export { Plan } from "./Plans.js";
|
|
13
14
|
export { Api, Providers } from "./ExternalServiceProviders.js";
|
|
14
15
|
export { Template } from "./market.js";
|
package/types.d.ts
CHANGED
|
@@ -235,6 +235,25 @@ export interface ConversationMethods {
|
|
|
235
235
|
updateStatus(status?: any): Promise<any>;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
export interface CronJob {
|
|
239
|
+
_id: string;
|
|
240
|
+
name: string;
|
|
241
|
+
scheduleType?: "cron" | "once";
|
|
242
|
+
schedule?: string;
|
|
243
|
+
runAt?: Date;
|
|
244
|
+
type: "shell" | "http";
|
|
245
|
+
command?: string;
|
|
246
|
+
url?: string;
|
|
247
|
+
method?: string;
|
|
248
|
+
headers?: string;
|
|
249
|
+
params?: string;
|
|
250
|
+
body?: string;
|
|
251
|
+
enabled?: boolean;
|
|
252
|
+
lastRun?: Date;
|
|
253
|
+
lastStatus?: string;
|
|
254
|
+
miscIds?: any;
|
|
255
|
+
createdAt?: Date;
|
|
256
|
+
}
|
|
238
257
|
|
|
239
258
|
export interface DemonstrationModel {
|
|
240
259
|
transcripts?: any;
|
|
@@ -659,6 +678,8 @@ export const Collection: Model<Collection, {}, {}> & CollectionStatics;
|
|
|
659
678
|
|
|
660
679
|
export const Conversation: Model<Conversation, {}, ConversationMethods>;
|
|
661
680
|
|
|
681
|
+
export const CronJob: Model<CronJob, {}, {}>;
|
|
682
|
+
|
|
662
683
|
export const DemonstrationModel: Model<DemonstrationModel, {}, {}>;
|
|
663
684
|
|
|
664
685
|
export const Lead: Model<Lead, {}, {}>;
|