@avakado.ai/schemas 1.1.10 → 1.1.12

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/enums.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { CAMPAIGN_STATUS, CONVERSATION_PRIORITY, CONVERSATION_STATUS, CURRENT_SUBSCRIPTION_STATUSES, LEDGER_CATEGORY, LEDGER_DIRECTIONS, LEDGER_SOURCE_TYPES, LEDGER_STATUSES, OAUTH_GRANT_MODES, PAYMENT_STATUS, PENDING_CHANGE_TYPES, SUBSCRIPTION_STATUS, TASK_REFERENCE_TYPES, TASK_STATUS, TASK_TYPES } from "./types.js";
package/models.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Action, AgentModel, AmountSchema, Api, ApiAuthenticationSchema, ApiAuthenticators, BillingLog, Business, BusinessSchema, CallSession, Campaign, CampaignSchema, Channel, ChannelCapabilityDefaults, Collection, Conversation, ConversationSchema, Data, DemonstrationModel, Document, 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
@@ -1,18 +1,49 @@
1
1
  {
2
2
  "name": "@avakado.ai/schemas",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Canonical Mongo schemas, models, enums and index declarations shared by the Avakado services.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
7
+ "types": "./types.d.ts",
7
8
  "exports": {
8
- ".": "./src/index.js",
9
- "./models": "./src/models/index.js",
10
- "./models/*": "./src/models/*",
11
- "./enums": "./src/enums/index.js",
12
- "./runtime": "./src/runtime.js"
9
+ ".": {
10
+ "types": "./types.d.ts",
11
+ "import": "./src/index.js",
12
+ "default": "./src/index.js"
13
+ },
14
+ "./models": {
15
+ "types": "./models.d.ts",
16
+ "import": "./src/models/index.js",
17
+ "default": "./src/models/index.js"
18
+ },
19
+ "./models/*.js": {
20
+ "types": "./types/models/*.d.ts",
21
+ "import": "./src/models/*.js",
22
+ "default": "./src/models/*.js"
23
+ },
24
+ "./models/*": {
25
+ "types": "./types/models/*.d.ts",
26
+ "import": "./src/models/*.js",
27
+ "default": "./src/models/*.js"
28
+ },
29
+ "./enums": {
30
+ "types": "./enums.d.ts",
31
+ "import": "./src/enums/index.js",
32
+ "default": "./src/enums/index.js"
33
+ },
34
+ "./runtime": {
35
+ "types": "./runtime.d.ts",
36
+ "import": "./src/runtime.js",
37
+ "default": "./src/runtime.js"
38
+ }
13
39
  },
14
40
  "files": [
15
41
  "src",
42
+ "types",
43
+ "types.d.ts",
44
+ "models.d.ts",
45
+ "enums.d.ts",
46
+ "runtime.d.ts",
16
47
  "README.md",
17
48
  "LICENSE"
18
49
  ],
@@ -26,7 +57,8 @@
26
57
  "mongoose": "^8.19.2"
27
58
  },
28
59
  "scripts": {
29
- "test": "node ../../scripts/check-imports.mjs ."
60
+ "test": "node ../../scripts/check-imports.mjs .",
61
+ "types": "node scripts/emit-types.mjs"
30
62
  },
31
63
  "publishConfig": {
32
64
  "access": "public"
package/runtime.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { configureSchemas, defineModel, getSchemaConfig, type SchemaRuntimeConfig } from "./types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Action, Task_Tree } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { AgentModel } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { BillingLog } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Business, BusinessSchema } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { CallSession } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Campaign, CampaignSchema, Task, TaskSchema } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Channel, ChannelCapabilityDefaults } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Collection } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Conversation, ConversationSchema } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Data } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { DemonstrationModel } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Document } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Api, Providers } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Lead, LeadTemplate } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Log } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Message, MessageSession } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { OAuthAuthorizationCode, OAuthClient, OAuthRefreshToken, OAuthRevokedJti } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { AmountSchema, Payment, PaymentSchema } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Plan } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Subscription, SubscriptionSchema } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Ticket } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { TriggerTemplate } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { UsageLog, UsageLogSchema } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { RoleScopes, ScopesEnum, User } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Workflow, WorkflowSchema } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { WorkflowLogs } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { ApiAuthenticationSchema, ApiAuthenticators } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Template } from "../../types.js";
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+ export { Notification } from "../../types.js";
package/types.d.ts ADDED
@@ -0,0 +1,797 @@
1
+ // Generated by scripts/emit-types.mjs. Run `npm run types` after a schema change.
2
+
3
+
4
+ import type { Model, Schema, Types } from "mongoose";
5
+
6
+ export interface SchemaRuntimeConfig {
7
+ sendKafkaMessage: ((input: { topic: string; message: unknown; acks?: number }) => Promise<void>) | null;
8
+ getAuthProvider: ((providerName: string) => any) | null;
9
+ providerSupportsRefresh: ((provider: any) => boolean) | null;
10
+ }
11
+
12
+ export function configureSchemas(next?: Partial<SchemaRuntimeConfig>): SchemaRuntimeConfig;
13
+ export function getSchemaConfig(): SchemaRuntimeConfig;
14
+ export function defineModel<T = any>(name: string, schema: Schema<T>, collection?: string): Model<T>;
15
+
16
+ export interface Action {
17
+ name?: string;
18
+ business?: Types.ObjectId;
19
+ description?: string;
20
+ needsApproval?: boolean;
21
+ inputSchema?: any;
22
+ outputSchema?: any;
23
+ functionString?: string;
24
+ errorFunction?: string;
25
+ UI?: any;
26
+ task?: { rootId?: string; rootKey?: string; nodes?: { id?: string; core?: { type: "task" | "conditional"; coreExecution?: { compiledInstructions?: string; _id: Types.ObjectId; template?: { id?: string; data?: any; }; }; _id: Types.ObjectId; input?: { schema?: any; mapper?: any; preset?: any; compiledMapper?: string; }; output?: { schema?: any; mapper?: any; }; meta?: { label?: string; apiId?: string; }; }; children?: { id?: string; key?: string; _id: Types.ObjectId; }[]; _id: Types.ObjectId; meta?: { label?: string; }; }[]; _id: Types.ObjectId; };
27
+ _id: Types.ObjectId;
28
+ createdAt?: Date;
29
+ updatedAt?: Date;
30
+ }
31
+
32
+ export interface AgentModel {
33
+ runtime?: "TURN_BASED" | "REALTIME" | "BACKGROUND";
34
+ modelConfig?: { provider: "openai" | "gemini" | "anthropic" | "custom"; customProviderRef: string; providerData?: any; model: string; modelSettings?: { temperature?: number; toolChoice?: string; topP?: number; frequencyPenalty?: number; presencePenalty?: number; parallelToolCalls?: boolean; truncation?: "auto" | "disabled"; maxTokens?: number; store?: boolean; promptCacheRetention?: string; reasoning?: { effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"; mode?: string; context?: string; summary?: "auto" | "concise" | "detailed"; }; text?: { verbosity?: "low" | "medium" | "high"; }; promptCacheOptions?: { mode?: "implicit" | "explicit"; ttl?: "30m"; }; }; };
35
+ workflow?: Types.ObjectId;
36
+ collections?: Types.ObjectId[];
37
+ channels?: Types.ObjectId[];
38
+ actions?: Types.ObjectId[];
39
+ tool_choice?: "auto" | "none" | "required";
40
+ business?: Types.ObjectId;
41
+ createdBy?: Types.ObjectId;
42
+ isPublic?: boolean;
43
+ isFeatured?: boolean;
44
+ _id: Types.ObjectId;
45
+ createdAt?: Date;
46
+ updatedAt?: Date;
47
+ personalInfo?: { name?: string; description?: string; avatar?: string; systemPrompt?: { role?: string; objective?: string; instructionsAndWorkflow?: string; constraintsAndRules?: string; }; };
48
+ modality?: string;
49
+ responseConfig?: { provider: "openai" | "gemini" | "anthropic" | "elevenlabs" | "custom"; };
50
+ }
51
+
52
+ export interface Amount {
53
+ value: number;
54
+ currency?: string;
55
+ }
56
+
57
+ export interface Api {
58
+ provider?: Types.ObjectId;
59
+ title?: string;
60
+ description?: string;
61
+ version?: string;
62
+ requiredScopes?: string[];
63
+ _id: Types.ObjectId;
64
+ createdAt?: Date;
65
+ updatedAt?: Date;
66
+ schemas?: { input?: any; config?: any; output?: any; error?: any; auth?: "oauth2" | "apiKey" | "basic" | "bearer" | "jwt" | "hmac" | "customHeader" | "mtls" | "cookie" | "none"; };
67
+ requestTemplate?: { method?: string; headers?: any; body?: any; url?: { base?: string; path?: string; params?: any; }; };
68
+ metadata?: { category?: string; feature?: string; };
69
+ }
70
+
71
+ export interface ApiMethods {
72
+ evaluateExpressions(...args: any[]): any;
73
+ }
74
+
75
+ export interface ApiAuthentication {
76
+ provider?: Types.ObjectId;
77
+ accountDetails?: any;
78
+ scope?: string[];
79
+ isActive?: boolean;
80
+ createdBy?: Types.ObjectId;
81
+ business?: Types.ObjectId;
82
+ credentials?: any;
83
+ config?: any;
84
+ _id: Types.ObjectId;
85
+ createdAt?: Date;
86
+ updatedAt?: Date;
87
+ authType?: string;
88
+ }
89
+
90
+ export interface ApiAuthenticators {
91
+ provider?: Types.ObjectId;
92
+ accountDetails?: any;
93
+ scope?: string[];
94
+ isActive?: boolean;
95
+ createdBy?: Types.ObjectId;
96
+ business?: Types.ObjectId;
97
+ credentials?: any;
98
+ config?: any;
99
+ _id: Types.ObjectId;
100
+ createdAt?: Date;
101
+ updatedAt?: Date;
102
+ authType?: string;
103
+ }
104
+
105
+ export interface ApiAuthenticatorsMethods {
106
+ getSecrets(): any;
107
+ getCredentials(): Promise<any>;
108
+ _resolveProvider(): Promise<any>;
109
+ _plain(value?: any): any;
110
+ _enrichedCredentials(): any;
111
+ _isAccessTokenFresh(): any;
112
+ validateToken(): Promise<any>;
113
+ refreshToken(): Promise<any>;
114
+ ensureValidToken(): Promise<any>;
115
+ hasAllScopes(scopes?: any): any;
116
+ }
117
+
118
+ export interface BillingLog {
119
+ business: Types.ObjectId;
120
+ category: "ai.conversation" | "ai.analysis" | "ai.summarization" | "ai.transcription" | "ai.embedding" | "messaging.outbound" | "messaging.inbound" | "messaging.template" | "workflow.execution" | "workflow.step" | "platform.api_call" | "platform.storage" | "platform.export";
121
+ status?: "success" | "failed" | "refunded" | "pending";
122
+ source?: { conversation?: Types.ObjectId; message?: Types.ObjectId; campaign?: Types.ObjectId; workflow?: Types.ObjectId; channel?: Types.ObjectId; agent?: Types.ObjectId; lead?: Types.ObjectId; externalId?: string; };
123
+ ai?: { model?: string; inputTokens?: number; cachedTokens?: number; outputTokens?: number; totalTokens?: number; turns?: number; toolCallCount?: number; };
124
+ messaging?: { channel?: "Whatsapp" | "Telegram" | "SMS" | "Email" | "Web" | "Phone"; provider?: string; messageType?: string; segmentCount?: number; templateName?: string; direction?: "inbound" | "outbound"; };
125
+ workflow?: { stepsExecuted?: number; stepsFailed?: number; durationMs?: number; };
126
+ cost: { providerCostUsd?: number; creditRate?: number; creditsCharged?: number; currency?: string; };
127
+ error?: string;
128
+ raw?: any;
129
+ _id: Types.ObjectId;
130
+ createdAt?: Date;
131
+ updatedAt?: Date;
132
+ }
133
+
134
+ export interface Business {
135
+ name?: string;
136
+ logoURL?: string;
137
+ facts?: string[];
138
+ quickQuestions?: { label?: string; value?: string; _id: Types.ObjectId; }[];
139
+ sector?: string;
140
+ tagline?: string;
141
+ address?: string;
142
+ description?: string;
143
+ MAX_DAYS?: number;
144
+ createdBy?: Types.ObjectId;
145
+ documents?: Types.ObjectId[];
146
+ _id: Types.ObjectId;
147
+ createdAt?: Date;
148
+ updatedAt?: Date;
149
+ contact?: { mail?: string; phone?: string; website?: string; };
150
+ credits?: { freeTrailClaimed?: boolean; freeTrailExpiry?: Date; currentSubscription?: Types.ObjectId; active?: boolean; balance?: number; carryForward?: number; lastUpdated?: Date; };
151
+ }
152
+
153
+ export interface CallSession {
154
+ lead?: Types.ObjectId;
155
+ conversation?: Types.ObjectId;
156
+ campaign?: Types.ObjectId;
157
+ business?: Types.ObjectId;
158
+ channel?: Types.ObjectId;
159
+ agent?: Types.ObjectId;
160
+ externalCallSessionId?: string;
161
+ direction?: string;
162
+ transcripts?: { speaker?: "Lead" | "agent" | "user" | "system"; transcript?: string; startMs?: number; endMs?: number; confidence?: number; source?: string; usage?: any; }[];
163
+ callDetails?: any;
164
+ usage?: any;
165
+ sequenceOfEvents?: any[];
166
+ isSummarized?: boolean;
167
+ _id: Types.ObjectId;
168
+ createdAt?: Date;
169
+ updatedAt?: Date;
170
+ statusTimeline?: { scheduledAt?: Date; initiatedAt?: Date; ringingAt?: Date; in_progressAt?: Date; completedAt?: Date; failedAt?: Date; busyAt?: Date; no_answerAt?: Date; canceledAt?: Date; rejectedAt?: Date; durationSec?: number; };
171
+ recording?: { status?: "none" | "pending" | "stored" | "failed"; key?: string; url?: string; };
172
+ }
173
+
174
+ export interface Campaign {
175
+ name?: string;
176
+ business: Types.ObjectId;
177
+ channel: Types.ObjectId;
178
+ leads?: Types.ObjectId[];
179
+ config?: any;
180
+ status?: "pending" | "active" | "completed";
181
+ cancel_requested?: boolean;
182
+ createdBy: Types.ObjectId;
183
+ _id: Types.ObjectId;
184
+ createdAt?: Date;
185
+ updatedAt?: Date;
186
+ timeLines?: { scheduledAt?: Date; startedAt?: Date; completedAt?: Date; cancelledAt?: Date; lastTaskStartedAt?: Date; };
187
+ }
188
+
189
+ export interface CampaignMethods {
190
+ updateTimeLine(timeLine?: any, currentStatus?: any): Promise<any>;
191
+ }
192
+
193
+ export interface Channel {
194
+ name: string;
195
+ business: Types.ObjectId;
196
+ provider?: Types.ObjectId;
197
+ apiAuthenticator?: Types.ObjectId;
198
+ type?: "whatsapp" | "telegram" | "website" | "web" | "phone" | "instagram" | "sms" | "email";
199
+ runtime?: "TURN_BASED" | "REALTIME";
200
+ config?: any;
201
+ externalId?: string;
202
+ status?: string;
203
+ webhookUrl?: string;
204
+ systemPrompt?: string;
205
+ isPublic?: boolean;
206
+ UIElements?: any;
207
+ _id: Types.ObjectId;
208
+ createdAt?: Date;
209
+ updatedAt?: Date;
210
+ settings?: { responseFormatCapabilities?: { key?: string; enabled?: boolean; label?: string; description?: string; }[]; };
211
+ }
212
+
213
+ export interface ChannelMethods {
214
+ updateStatus(status?: any): any;
215
+ }
216
+
217
+ export interface Collection {
218
+ name: string;
219
+ source?: "website" | "youtube" | "file" | "text";
220
+ status?: "active" | "loading" | "failed" | "cancelled";
221
+ error?: string;
222
+ metaData?: { progressStages?: { name?: "webcrawler" | "embed and upsert" | "Chunking" | "Parsing"; accomplished?: boolean; status?: "PENDING" | "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED"; error?: string; startedAt?: Date; completedAt?: Date; failedAt?: Date; moreInfo?: any; }[]; webcrawler?: { options?: any; jobId?: string; lastUpdate?: any; urls?: string[]; }; chunkingDetails?: { strategy?: "recursiveStructural" | "recursiveSemantic"; tunables?: { MIN_TOKENS?: number; MAX_TOKENS?: number; OVERLAP_TOKENS?: number; }; }; parserDetails?: { tier?: "fast" | "cost_effective" | "agentic" | "agentic_plus"; expand?: "text" | "items" | "markdown" | "metadata" | "images_content_metadata" | "xlsx_content_metadata" | "output_pdf_content_metadata"[]; version?: "latest"; source_url?: string; jobId?: string; lastUpdate?: any; advancedOptions?: { disable_cache?: boolean; page_ranges?: { target_pages?: string; max_pages?: number; }; agentic_options?: { custom_prompt?: string; }; output_options?: { extract_printed_page_number?: boolean; images_to_save?: "screenshot" | "embedded" | "layout"[]; markdown?: { annotate_links?: boolean; inline_images?: boolean; tables?: { compact_markdown_tables?: boolean; markdown_table_multiline_separator?: string; merge_continued_tables?: boolean; output_tables_as_markdown?: boolean; }; spatial_text?: { do_not_unroll_columns?: boolean; preserve_layout_alignment_across_pages?: boolean; preserve_very_small_text?: boolean; }; tables_as_spreadsheet?: { enable?: boolean; guess_sheet_name?: boolean; }; }; }; input_options?: { html?: { make_all_elements_visible?: boolean; remove_fixed_elements?: boolean; remove_navigation_elements?: boolean; }; presentation?: { out_of_bounds_content?: boolean; skip_embedded_data?: boolean; }; spreadsheet?: { detect_sub_tables_in_sheets?: boolean; force_formula_computation_in_sheets?: boolean; include_hidden_sheets?: boolean; }; }; processing_options?: { aggressive_table_extraction?: boolean; disable_heuristics?: boolean; specialized_chart_parsing?: "agentic_plus" | "agentic" | "efficient"; cost_optimizer?: { enable?: boolean; }; ignore?: { ignore_diagonal_text?: boolean; ignore_text_in_image?: boolean; ignore_hidden_text?: boolean; }; ocr_parameters?: { languages?: "en" | "fr" | "de" | "es" | "it" | "pt" | "ru" | "zh"[]; }; }; processing_control?: { job_failure_conditions?: { allowed_page_failure_ratio?: number; fail_on_buggy_font?: boolean; fail_on_image_extraction_error?: boolean; fail_on_image_ocr_error?: boolean; fail_on_markdown_reconstruction_error?: boolean; }; timeouts?: { base_in_seconds?: number; extra_time_per_page_in_seconds?: number; }; }; }; }; };
223
+ description?: string;
224
+ tags?: string[];
225
+ business?: Types.ObjectId;
226
+ createdBy?: Types.ObjectId;
227
+ isPublic?: boolean;
228
+ isFeatured?: boolean;
229
+ _id: Types.ObjectId;
230
+ createdAt?: Date;
231
+ updatedAt?: Date;
232
+ }
233
+
234
+ export interface CollectionStatics {
235
+ updateStage(collectionId?: any, stageName?: any, updates?: any): Promise<any>;
236
+ startStage(collectionId?: any, stageName?: any, moreInfo?: any): any;
237
+ cancelStage(collectionId?: any, stageName?: any, moreInfo?: any): any;
238
+ pendingStage(collectionId?: any, stageName?: any, moreInfo?: any): any;
239
+ completeStage(collectionId?: any, stageName?: any, moreInfo?: any): any;
240
+ failStage(collectionId?: any, stageName?: any, error?: any, moreInfo?: any): any;
241
+ updateMetadata(collectionId?: any, updates?: any): Promise<any>;
242
+ updateStatus(collectionId?: any, status?: any, error?: any): Promise<any>;
243
+ }
244
+
245
+ export interface Conversation {
246
+ agent?: Types.ObjectId;
247
+ business?: Types.ObjectId;
248
+ channel?: Types.ObjectId;
249
+ lead?: Types.ObjectId;
250
+ campaign?: Types.ObjectId;
251
+ externalConversationId?: string;
252
+ status?: "open" | "pending" | "snoozed" | "completed" | "closed" | "archived" | "spam";
253
+ priority?: "low" | "normal" | "high" | "urgent";
254
+ _id: Types.ObjectId;
255
+ createdAt?: Date;
256
+ updatedAt?: Date;
257
+ config?: { tags?: string[]; assignment?: { agentReply?: boolean; handoffReason?: string; handoffUrgency?: string; assignedAt?: Date; assignedTo?: string; }; };
258
+ metadata?: { extractedData?: any; userLocation?: any; openai?: { lastResponseId?: string; lastResponseAt?: Date; }; CreditsUsage?: { conversationCredits?: number; analysisCredits?: number; miscellaneousCredits?: number; totalCredits?: number; }; };
259
+ }
260
+
261
+ export interface ConversationMethods {
262
+ updateStatus(status?: any): Promise<any>;
263
+ }
264
+
265
+ export interface Data {
266
+ collection?: Types.ObjectId;
267
+ content?: string;
268
+ chunkNumber?: number;
269
+ summary?: string;
270
+ embeddingVector?: number[];
271
+ newTopics?: string[];
272
+ _id: Types.ObjectId;
273
+ createdAt?: Date;
274
+ updatedAt?: Date;
275
+ metadata?: { tokensUsed?: number; chunkSize?: number; createdAt?: Date; url?: string; tokenUsage?: { embeddingTokens?: number; embeddingModel?: string; summarizationInputTokens?: number; summarizationOutputTokens?: number; summarizationTotalTokens?: number; summarizationModel?: string; }; };
276
+ }
277
+
278
+ export interface DemonstrationModel {
279
+ transcripts?: any;
280
+ miscellaneous?: any;
281
+ kind?: string;
282
+ demoEndedAt?: Date;
283
+ _id: Types.ObjectId;
284
+ createdAt?: Date;
285
+ updatedAt?: Date;
286
+ lead?: { name?: string; email?: string; phone?: string; department?: string; source?: string; };
287
+ organization?: { id?: string; name?: string; industry?: string; };
288
+ }
289
+
290
+ export interface Document {
291
+ name?: string;
292
+ contentType?: string;
293
+ user?: Types.ObjectId;
294
+ viewers?: Types.ObjectId[];
295
+ type?: string;
296
+ _id: Types.ObjectId;
297
+ createdAt?: Date;
298
+ updatedAt?: Date;
299
+ data?: { FileName?: string; resource_id?: string; mimetype?: string; originalname?: string; fileIdentifier?: string; preview_url?: string; download_url?: string; };
300
+ }
301
+
302
+ export interface Lead {
303
+ template?: Types.ObjectId;
304
+ business: Types.ObjectId;
305
+ createdBy?: Types.ObjectId;
306
+ name?: string;
307
+ contactDetails?: { whatsapp?: { platform: string; handle?: string; label?: string; isPrimary?: boolean; metadata?: any; }[]; telegram?: { platform: string; handle?: string; label?: string; isPrimary?: boolean; metadata?: any; }[]; email?: { platform: string; handle?: string; label?: string; isPrimary?: boolean; metadata?: any; }[]; phone?: { platform: string; handle?: string; label?: string; isPrimary?: boolean; metadata?: any; }[]; twitter?: { platform: string; handle?: string; label?: string; isPrimary?: boolean; metadata?: any; }[]; instagram?: { platform: string; handle?: string; label?: string; isPrimary?: boolean; metadata?: any; }[]; facebook?: { platform: string; handle?: string; label?: string; isPrimary?: boolean; metadata?: any; }[]; };
308
+ source?: string;
309
+ tags?: string[];
310
+ leadScore?: number;
311
+ status?: "new" | "contacted" | "qualified" | "converted" | "lost";
312
+ notes?: string[];
313
+ lastInteractedAt?: Date;
314
+ nextFollowUpAt?: Date;
315
+ pendingTasks?: any;
316
+ data?: any;
317
+ _id: Types.ObjectId;
318
+ createdAt?: Date;
319
+ updatedAt?: Date;
320
+ }
321
+
322
+ export interface LeadTemplate {
323
+ business: Types.ObjectId;
324
+ createdBy: Types.ObjectId;
325
+ name: string;
326
+ description?: string;
327
+ fields?: any;
328
+ isActive?: boolean;
329
+ _id: Types.ObjectId;
330
+ createdAt?: Date;
331
+ updatedAt?: Date;
332
+ }
333
+
334
+ export interface Log {
335
+ user?: Types.ObjectId;
336
+ business?: Types.ObjectId;
337
+ level?: "warn" | "error" | "info" | "debug";
338
+ event?: string;
339
+ category?: "AUTHENTICATION" | "PAYMENT" | "CREDIT" | "SUBSCRIPTION" | "API_ACCESS" | "WEBHOOK" | "ERROR" | "OTHER";
340
+ status?: "SUCCESS" | "FAILURE" | "PENDING";
341
+ message?: string;
342
+ service?: string;
343
+ environment?: "dev" | "staging" | "prod";
344
+ requestId?: string;
345
+ meta?: any;
346
+ data?: any;
347
+ error?: any;
348
+ response?: any;
349
+ _id: Types.ObjectId;
350
+ createdAt?: Date;
351
+ updatedAt?: Date;
352
+ }
353
+
354
+ export interface Message {
355
+ conversation?: Types.ObjectId;
356
+ campaign?: Types.ObjectId;
357
+ business?: Types.ObjectId;
358
+ externalMessageId?: string;
359
+ direction?: string;
360
+ type?: "text" | "image" | "audio" | "voice" | "video" | "document" | "file" | "sticker" | "location" | "contacts" | "interactive" | "button" | "order" | "unknown" | "template";
361
+ kind?: "message" | "postback" | "system";
362
+ content?: any;
363
+ repliedTo?: Types.ObjectId;
364
+ reactions?: { emoji?: string; by?: string; at?: Date; }[];
365
+ usage?: any;
366
+ misc?: any;
367
+ errors?: any[];
368
+ isInternalNote?: boolean;
369
+ isSummarized?: boolean;
370
+ _id: Types.ObjectId;
371
+ createdAt?: Date;
372
+ updatedAt?: Date;
373
+ sender?: { type?: "Lead" | "agent" | "user" | "system" | "unknown"; id?: string; name?: string; ref?: Types.ObjectId; refModel?: "Lead" | "Agent" | "Users"; };
374
+ statusTimeline?: { scheduled?: Date; initiated?: Date; sent?: Date; delivered?: Date; read?: Date; failed?: Date; stopped?: Date; };
375
+ }
376
+
377
+ export interface MessageSession {
378
+ campaign?: Types.ObjectId;
379
+ firstMessage?: Types.ObjectId;
380
+ lastMessage?: Types.ObjectId;
381
+ conversation?: Types.ObjectId;
382
+ business?: Types.ObjectId;
383
+ _id: Types.ObjectId;
384
+ }
385
+
386
+ export interface Notification {
387
+ business?: Types.ObjectId;
388
+ head?: string;
389
+ body?: string;
390
+ type?: string;
391
+ attachments?: any;
392
+ status?: string;
393
+ _id: Types.ObjectId;
394
+ createdAt?: Date;
395
+ updatedAt?: Date;
396
+ }
397
+
398
+ export interface OAuthAuthorizationCode {
399
+ codeHash: string;
400
+ clientId: string;
401
+ user: Types.ObjectId;
402
+ redirectUri: string;
403
+ scope?: string;
404
+ codeChallenge?: string;
405
+ codeChallengeMethod?: "S256" | "plain";
406
+ expiresAt: Date;
407
+ consumedAt?: Date;
408
+ _id: Types.ObjectId;
409
+ createdAt?: Date;
410
+ updatedAt?: Date;
411
+ }
412
+
413
+ export interface OAuthClient {
414
+ clientId: string;
415
+ name: string;
416
+ business?: Types.ObjectId;
417
+ createdBy?: Types.ObjectId;
418
+ secretHash?: string;
419
+ secretVersion?: number;
420
+ redirectUris?: string[];
421
+ allowedOrigins?: string[];
422
+ grantMode: "access_refresh" | "access_only" | "permanent";
423
+ isFirstParty?: boolean;
424
+ revokedAt?: Date;
425
+ _id: Types.ObjectId;
426
+ createdAt?: Date;
427
+ updatedAt?: Date;
428
+ }
429
+
430
+ export interface OAuthRefreshToken {
431
+ tokenHash: string;
432
+ clientId: string;
433
+ user: Types.ObjectId;
434
+ familyId: string;
435
+ expiresAt: Date;
436
+ usedAt?: Date;
437
+ revokedAt?: Date;
438
+ _id: Types.ObjectId;
439
+ createdAt?: Date;
440
+ updatedAt?: Date;
441
+ }
442
+
443
+ export interface OAuthRevokedJti {
444
+ jti: string;
445
+ expiresAt: Date;
446
+ _id: Types.ObjectId;
447
+ createdAt?: Date;
448
+ updatedAt?: Date;
449
+ }
450
+
451
+ export interface Payment {
452
+ business: Types.ObjectId;
453
+ subscription?: Types.ObjectId;
454
+ gateway?: string;
455
+ gatewayReference?: any;
456
+ gatewayPaymentId?: string;
457
+ gatewayInvoiceId?: string;
458
+ amount?: { value: number; currency?: string; };
459
+ notes?: any;
460
+ status?: "authorized" | "captured" | "failed" | "refunded";
461
+ failureReason?: string;
462
+ retryCount?: number;
463
+ paidAt?: Date;
464
+ _id: Types.ObjectId;
465
+ createdAt?: Date;
466
+ updatedAt?: Date;
467
+ events?: { authorized?: Date; captured?: Date; failed?: Date; refunded?: Date; };
468
+ }
469
+
470
+ export interface Plan {
471
+ business?: Types.ObjectId;
472
+ code?: string;
473
+ public?: boolean;
474
+ name: string;
475
+ description?: string;
476
+ amount?: { value: number; currency?: string; };
477
+ type: "FREE" | "BASE" | "TOPUP" | "ENTERPRISE" | "TEST";
478
+ validity?: number;
479
+ credits?: number;
480
+ spendRatio?: 1080 | 1666 | 1583;
481
+ status?: "active" | "inactive";
482
+ features?: string[];
483
+ allowedTopUps?: Types.ObjectId[];
484
+ autoRenew?: boolean;
485
+ _id: Types.ObjectId;
486
+ createdAt?: Date;
487
+ updatedAt?: Date;
488
+ paymentGateWay?: { razorpay?: { plan_id?: string; }; };
489
+ }
490
+
491
+ export interface Providers {
492
+ name?: string;
493
+ description?: string;
494
+ icon?: string;
495
+ color?: string;
496
+ basicScopes?: string[];
497
+ apiFilters?: any;
498
+ createdBy?: Types.ObjectId;
499
+ _id: Types.ObjectId;
500
+ createdAt?: Date;
501
+ updatedAt?: Date;
502
+ }
503
+
504
+ export interface Subscription {
505
+ business: Types.ObjectId;
506
+ createdBy?: Types.ObjectId;
507
+ plan: Types.ObjectId;
508
+ planCode: string;
509
+ gateway?: "razorpay" | "none";
510
+ gatewaySubscriptionId?: string;
511
+ status?: "created" | "pending_payment" | "authenticated" | "active" | "pending" | "pending_downgrade" | "cancel_at_period_end" | "paused" | "halted" | "cancelled" | "expired" | "completed";
512
+ amount?: { value: number; currency?: string; };
513
+ creditsPerCycle?: number;
514
+ spendRatio?: 1080 | 1666 | 1583;
515
+ cancelAtPeriodEnd?: boolean;
516
+ cancelledAt?: Date;
517
+ cancelReason?: string;
518
+ startedAt?: Date;
519
+ endedAt?: Date;
520
+ shortUrl?: string;
521
+ gatewayPayload?: any;
522
+ _id: Types.ObjectId;
523
+ createdAt?: Date;
524
+ updatedAt?: Date;
525
+ billing?: { periodStart?: Date; periodEnd?: Date; nextChargeAt?: Date; paidCount?: number; totalCount?: number; };
526
+ pendingChange?: { type?: "upgrade" | "downgrade" | "cancel"; targetPlan?: Types.ObjectId; targetPlanCode?: string; applyAt?: Date; chargeAmount?: number; creditDelta?: number; orderId?: string; };
527
+ creditGrant?: { lastCycle?: number; lastGrantedAt?: Date; lastPaymentId?: string; };
528
+ }
529
+
530
+ export interface Task {
531
+ business: Types.ObjectId;
532
+ campaign?: Types.ObjectId;
533
+ lead?: Types.ObjectId;
534
+ status?: "pending" | "in-progress" | "completed" | "failed" | "skipped";
535
+ attempts?: number;
536
+ type: "quick" | "webhook";
537
+ data?: any;
538
+ error?: any;
539
+ response?: any;
540
+ _id: Types.ObjectId;
541
+ createdAt?: Date;
542
+ updatedAt?: Date;
543
+ timeLine?: { startedAt?: Date; failedAt?: Date; completedAt?: Date; };
544
+ references?: { type?: "Message" | "CallSession"; id?: Types.ObjectId; };
545
+ }
546
+
547
+ export interface TaskMethods {
548
+ updateTimeLine(timeLine?: any, currentStatus?: any): Promise<any>;
549
+ updateError(error?: any): Promise<any>;
550
+ updateResponse(response?: any): Promise<any>;
551
+ }
552
+
553
+ export interface Template {
554
+ name: string;
555
+ createdBy?: Types.ObjectId;
556
+ type: "agent" | "action";
557
+ status?: string;
558
+ description?: string;
559
+ imageUrl?: string;
560
+ tags?: string[];
561
+ version?: string;
562
+ applicableSectors?: string[];
563
+ isPublic?: boolean;
564
+ UIElements?: any;
565
+ isFeatured?: boolean;
566
+ _id: Types.ObjectId;
567
+ createdAt?: Date;
568
+ updatedAt?: Date;
569
+ data?: { collections?: Types.ObjectId[]; actions?: Types.ObjectId[]; facets?: string[]; personalInfo?: { name?: string; model?: string; temperature?: number; systemPrompt?: { role?: string; objective?: string; instructionsAndWorkflow?: string; constraintsAndRules?: string; }; }; };
570
+ config?: any;
571
+ }
572
+
573
+ export interface Ticket {
574
+ business?: Types.ObjectId;
575
+ issueSummary: string;
576
+ channel: "telegram" | "whatsapp" | "web" | "phone" | "instagram" | "sms" | "email";
577
+ priority?: "low" | "medium" | "high";
578
+ status?: "pending" | "responded" | "resolved";
579
+ notifierEmail: string;
580
+ _id: Types.ObjectId;
581
+ createdAt?: Date;
582
+ updatedAt?: Date;
583
+ contactDetails?: { email?: string; phone?: string; telegramId?: string; whatsappId?: string; instagramId?: string; };
584
+ response?: { channelId?: Types.ObjectId; from?: string; to?: string; cc?: string; subject?: string; bcc?: string; text?: string; html?: string; updatedAt?: Date; sentAt?: Date; resolvedAt?: Date; };
585
+ }
586
+
587
+ export interface TicketMethods {
588
+ markSent(response?: any): any;
589
+ markResolved(): any;
590
+ }
591
+
592
+ export interface TriggerTemplate {
593
+ name: string;
594
+ description?: string;
595
+ type?: string;
596
+ payload?: any;
597
+ _id: Types.ObjectId;
598
+ createdAt?: Date;
599
+ updatedAt?: Date;
600
+ }
601
+
602
+ export interface UsageLog {
603
+ business: Types.ObjectId;
604
+ direction: "credit" | "debit" | "reset";
605
+ credits: number;
606
+ status?: "posted" | "pending" | "failed" | "reversed";
607
+ payment?: Types.ObjectId;
608
+ idempotencyKey?: string;
609
+ meta?: any;
610
+ note?: string;
611
+ createdBy?: Types.ObjectId;
612
+ _id: Types.ObjectId;
613
+ createdAt?: Date;
614
+ updatedAt?: Date;
615
+ source?: { type?: "Message" | "CallSession" | "Subscription" | "Payment" | "Collection"; id?: Types.ObjectId; };
616
+ }
617
+
618
+ export interface User {
619
+ name?: string;
620
+ email?: string;
621
+ password?: string;
622
+ role?: "admin" | "manager" | "superAdmin";
623
+ scopes?: "auth:login" | "auth:register" | "auth:logout" | "auth:refresh" | "user:read" | "user:update" | "user:delete" | "business:read" | "business:create" | "business:update" | "business:delete" | "business:manage_members" | "business:view_analytics" | "business:export_data" | "agent:read" | "agent:create" | "agent:update" | "agent:delete" | "agent:deploy" | "agent:test" | "agent:view_conversations" | "agent:manage_prompts" | "collection:read" | "collection:create" | "collection:update" | "collection:delete" | "collection:upload_files" | "collection:manage_permissions" | "channel:read" | "channel:create" | "channel:update" | "channel:delete" | "channel:connect" | "channel:view_webhooks" | "action:read" | "action:create" | "action:update" | "action:delete" | "action:test" | "action:manage_integrations" | "conversation:read" | "conversation:create" | "conversation:update" | "conversation:delete" | "conversation:export" | "conversation:analyze" | "ticket:read" | "ticket:create" | "ticket:update" | "ticket:delete" | "ticket:assign" | "ticket:escalate" | "analytics:read" | "analytics:export" | "analytics:custom_reports" | "analytics:real_time" | "file:upload" | "file:download" | "file:delete" | "file:share" | "template:read" | "template:create" | "template:update" | "template:delete" | "template:publish" | "template:subscribe" | "admin:users" | "admin:businesses" | "admin:system_settings" | "admin:logs" | "admin:backup" | "admin:updates" | "super:all" | "super:platform_management" | "super:billing" | "super:support" | "super:marketplace" | "webhook:read" | "webhook:create" | "webhook:update" | "webhook:delete" | "webhook:test" | "subscription:read" | "subscription:upgrade" | "subscription:downgrade" | "subscription:cancel" | "subscription:billing" | "notification:read" | "notification:update" | "notification:delete" | "integration:read" | "integration:create" | "integration:update" | "integration:delete" | "workflow:read" | "workflow:create" | "workflow:update" | "workflow:delete" | "lead:read" | "lead:create" | "lead:update" | "lead:delete" | "lead:import" | "lead:export" | "message:read" | "message:send" | "message:delete" | "call:read" | "call:initiate" | "call:record" | "campaign:read" | "campaign:create" | "campaign:update" | "campaign:delete" | "campaign:launch" | "campaign:analytics" | "team:read" | "team:create" | "team:update" | "team:delete" | "team:manage_members" | "conversation:assign" | "conversation:reply" | "channel:manage_agents"[];
624
+ business?: Types.ObjectId;
625
+ isVerified?: boolean;
626
+ emailToken?: string;
627
+ _id: Types.ObjectId;
628
+ createdAt?: Date;
629
+ updatedAt?: Date;
630
+ }
631
+
632
+ export interface UserMethods {
633
+ hasScope(scope?: any): any;
634
+ hasAnyScope(scopes?: any): any;
635
+ hasAllScopes(scopes?: any): any;
636
+ addScopes(scopes?: any): any;
637
+ removeScopes(scopes?: any): any;
638
+ }
639
+
640
+ export interface Workflow {
641
+ name?: string;
642
+ trigger: string;
643
+ business?: Types.ObjectId;
644
+ status?: "active" | "disabled";
645
+ task?: { rootId?: string; rootKey?: string; nodes?: { id?: string; core?: { type: "task" | "conditional"; coreExecution?: { compiledInstructions?: string; _id: Types.ObjectId; template?: { id?: string; data?: any; }; }; _id: Types.ObjectId; input?: { schema?: any; mapper?: any; preset?: any; compiledMapper?: string; }; output?: { schema?: any; mapper?: any; }; meta?: { label?: string; apiId?: string; }; }; children?: { id?: string; key?: string; _id: Types.ObjectId; }[]; _id: Types.ObjectId; meta?: { label?: string; }; }[]; _id: Types.ObjectId; };
646
+ createdBy?: Types.ObjectId;
647
+ _id: Types.ObjectId;
648
+ createdAt?: Date;
649
+ updatedAt?: Date;
650
+ }
651
+
652
+ export interface WorkflowMethods {
653
+ updateStatus(status?: any): any;
654
+ }
655
+
656
+ export interface WorkflowLogs {
657
+ workflowId?: string;
658
+ executionId?: string;
659
+ nodeId?: string;
660
+ lable?: string;
661
+ nodeInput?: any;
662
+ nodeInputError?: any;
663
+ nodeOutput?: any;
664
+ nodeError?: any;
665
+ nodeStatus?: "pending" | "in-progress" | "completed" | "failed" | "skipped";
666
+ _id: Types.ObjectId;
667
+ createdAt?: Date;
668
+ updatedAt?: Date;
669
+ trigger?: { conversationId?: string; };
670
+ }
671
+
672
+ export const AmountSchema: Schema<Amount>;
673
+
674
+ export const ApiAuthenticationSchema: Schema<ApiAuthentication>;
675
+
676
+ export const BusinessSchema: Schema<Business>;
677
+
678
+ export const CampaignSchema: Schema<Campaign>;
679
+
680
+ export const ConversationSchema: Schema<Conversation>;
681
+
682
+ export const PaymentSchema: Schema<Payment>;
683
+
684
+ export const SubscriptionSchema: Schema<Subscription>;
685
+
686
+ export const TaskSchema: Schema<Task>;
687
+
688
+ export const UsageLogSchema: Schema<UsageLog>;
689
+
690
+ export const Action: Model<Action, {}, {}>;
691
+
692
+ export const AgentModel: Model<AgentModel, {}, {}>;
693
+
694
+ export const Api: Model<Api, {}, ApiMethods>;
695
+
696
+ export const ApiAuthenticators: Model<ApiAuthenticators, {}, ApiAuthenticatorsMethods>;
697
+
698
+ export const BillingLog: Model<BillingLog, {}, {}>;
699
+
700
+ export const Business: Model<Business, {}, {}>;
701
+
702
+ export const CallSession: Model<CallSession, {}, {}>;
703
+
704
+ export const Campaign: Model<Campaign, {}, CampaignMethods>;
705
+
706
+ export const Channel: Model<Channel, {}, ChannelMethods>;
707
+
708
+ export const Collection: Model<Collection, {}, {}> & CollectionStatics;
709
+
710
+ export const Conversation: Model<Conversation, {}, ConversationMethods>;
711
+
712
+ export const Data: Model<Data, {}, {}>;
713
+
714
+ export const DemonstrationModel: Model<DemonstrationModel, {}, {}>;
715
+
716
+ export const Document: Model<Document, {}, {}>;
717
+
718
+ export const Lead: Model<Lead, {}, {}>;
719
+
720
+ export const LeadTemplate: Model<LeadTemplate, {}, {}>;
721
+
722
+ export const Log: Model<Log, {}, {}>;
723
+
724
+ export const Message: Model<Message, {}, {}>;
725
+
726
+ export const MessageSession: Model<MessageSession, {}, {}>;
727
+
728
+ export const Notification: Model<Notification, {}, {}>;
729
+
730
+ export const OAuthAuthorizationCode: Model<OAuthAuthorizationCode, {}, {}>;
731
+
732
+ export const OAuthClient: Model<OAuthClient, {}, {}>;
733
+
734
+ export const OAuthRefreshToken: Model<OAuthRefreshToken, {}, {}>;
735
+
736
+ export const OAuthRevokedJti: Model<OAuthRevokedJti, {}, {}>;
737
+
738
+ export const Payment: Model<Payment, {}, {}>;
739
+
740
+ export const Plan: Model<Plan, {}, {}>;
741
+
742
+ export const Providers: Model<Providers, {}, {}>;
743
+
744
+ export const Subscription: Model<Subscription, {}, {}>;
745
+
746
+ export const Task: Model<Task, {}, TaskMethods>;
747
+
748
+ export const Template: Model<Template, {}, {}>;
749
+
750
+ export const Ticket: Model<Ticket, {}, TicketMethods>;
751
+
752
+ export const TriggerTemplate: Model<TriggerTemplate, {}, {}>;
753
+
754
+ export const UsageLog: Model<UsageLog, {}, {}>;
755
+
756
+ export const User: Model<User, {}, UserMethods>;
757
+
758
+ export const Workflow: Model<Workflow, {}, WorkflowMethods>;
759
+
760
+ export const WorkflowLogs: Model<WorkflowLogs, {}, {}>;
761
+
762
+ export const CAMPAIGN_STATUS: readonly ["pending", "active", "completed"];
763
+
764
+ export const CONVERSATION_PRIORITY: readonly ["low", "normal", "high", "urgent"];
765
+
766
+ export const CONVERSATION_STATUS: readonly ["open", "pending", "snoozed", "completed", "closed", "archived", "spam"];
767
+
768
+ export const CURRENT_SUBSCRIPTION_STATUSES: readonly ["created", "pending_payment", "authenticated", "active", "pending", "pending_downgrade", "cancel_at_period_end", "paused", "halted"];
769
+
770
+ export const ChannelCapabilityDefaults: { whatsapp: readonly unknown[]; telegram: readonly unknown[]; sms: readonly unknown[]; email: readonly unknown[]; web: readonly unknown[]; instagram: readonly unknown[]; phone: readonly unknown[] };
771
+
772
+ export const LEDGER_CATEGORY: { PLAN_GRANT: "plan.grant"; TOPUP_GRANT: "topup.grant"; UPGRADE_GRANT: "upgrade.grant"; REFUND: "refund"; ADJUSTMENT: "adjustment"; AI_LLM: "ai.llm"; AI_TRANSCRIPTION: "ai.transcription"; AI_EMBEDDING: "ai.embedding"; MESSAGING_WHATSAPP: "messaging.whatsapp"; MESSAGING_SMS: "messaging.sms"; PLATFORM_STORAGE: "platform.storage"; PLATFORM_API: "platform.api"; THIRD_PARTY: "third_party" };
773
+
774
+ export const LEDGER_DIRECTIONS: readonly ["credit", "debit", "reset"];
775
+
776
+ export const LEDGER_SOURCE_TYPES: readonly ["Message", "CallSession", "Subscription", "Payment", "Collection"];
777
+
778
+ export const LEDGER_STATUSES: readonly ["posted", "pending", "failed", "reversed"];
779
+
780
+ export const OAUTH_GRANT_MODES: readonly ["access_refresh", "access_only", "permanent"];
781
+
782
+ export const PAYMENT_STATUS: readonly ["authorized", "captured", "failed", "refunded"];
783
+
784
+ export const PENDING_CHANGE_TYPES: readonly ["upgrade", "downgrade", "cancel"];
785
+
786
+ export const RoleScopes: { superAdmin: readonly ["super:all", "super:platform_management", "super:billing", "super:support", "super:marketplace", "admin:users", "admin:businesses", "admin:system_settings", "admin:logs", "admin:backup", "admin:updates", "business:read", "business:create", "business:update", "business:delete", "business:manage_members", "business:view_analytics", "business:export_data", "agent:read", "agent:create", "agent:update", "agent:delete", "agent:deploy", "agent:test", "agent:view_conversations", "agent:manage_prompts", "collection:read", "collection:create", "collection:update", "collection:delete", "collection:upload_files", "collection:manage_permissions", "channel:read", "channel:create", "channel:update", "channel:delete", "channel:connect", "channel:view_webhooks", "action:read", "action:create", "action:update", "action:delete", "action:test", "action:manage_integrations", "conversation:read", "conversation:create", "conversation:update", "conversation:delete", "conversation:export", "conversation:analyze", "ticket:read", "ticket:create", "ticket:update", "ticket:delete", "ticket:assign", "ticket:escalate", "analytics:read", "analytics:export", "analytics:custom_reports", "analytics:real_time", "file:upload", "file:download", "file:delete", "file:share", "template:read", "template:create", "template:update", "template:delete", "template:publish", "template:subscribe", "webhook:read", "webhook:create", "webhook:update", "webhook:delete", "webhook:test", "subscription:read", "subscription:upgrade", "subscription:downgrade", "subscription:cancel", "subscription:billing", "auth:login", "auth:register", "auth:logout", "auth:refresh", "user:read", "user:update", "user:delete", "notification:read", "notification:update", "notification:delete", "integration:read", "integration:create", "integration:update", "integration:delete", "workflow:read", "workflow:create", "workflow:update", "workflow:delete", "lead:read", "lead:create", "lead:update", "lead:delete", "lead:import", "lead:export", "message:read", "message:send", "message:delete", "call:read", "call:initiate", "call:record", "campaign:read", "campaign:create", "campaign:update", "campaign:delete", "campaign:launch", "campaign:analytics", "team:read", "team:create", "team:update", "team:delete", "team:manage_members", "conversation:assign", "conversation:reply", "channel:manage_agents"]; admin: readonly ["admin:users", "business:read", "business:update", "business:manage_members", "business:view_analytics", "business:export_data", "agent:read", "agent:create", "agent:update", "agent:delete", "agent:deploy", "agent:test", "agent:view_conversations", "agent:manage_prompts", "collection:read", "collection:create", "collection:update", "collection:delete", "collection:upload_files", "collection:manage_permissions", "channel:read", "channel:create", "channel:update", "channel:delete", "channel:connect", "channel:view_webhooks", "action:read", "action:create", "action:update", "action:delete", "action:test", "action:manage_integrations", "conversation:read", "conversation:create", "conversation:update", "conversation:delete", "conversation:export", "conversation:analyze", "ticket:read", "ticket:create", "ticket:update", "ticket:delete", "ticket:assign", "ticket:escalate", "analytics:read", "analytics:export", "analytics:custom_reports", "analytics:real_time", "file:upload", "file:download", "file:delete", "file:share", "template:read", "template:subscribe", "webhook:read", "webhook:create", "webhook:update", "webhook:delete", "webhook:test", "subscription:read", "subscription:upgrade", "subscription:downgrade", "subscription:cancel", "subscription:billing", "auth:login", "auth:logout", "auth:refresh", "user:read", "user:update", "notification:read", "notification:update", "notification:delete", "integration:read", "integration:create", "integration:update", "integration:delete", "workflow:read", "workflow:create", "workflow:update", "workflow:delete", "lead:read", "lead:create", "lead:update", "lead:delete", "lead:import", "lead:export", "message:read", "message:send", "message:delete", "call:read", "call:initiate", "call:record", "campaign:read", "campaign:create", "campaign:update", "campaign:delete", "campaign:launch", "campaign:analytics", "team:read", "team:create", "team:update", "team:delete", "team:manage_members", "conversation:assign", "conversation:reply", "channel:manage_agents"]; manager: readonly ["business:read", "business:view_analytics", "agent:read", "agent:test", "agent:view_conversations", "collection:read", "collection:upload_files", "channel:read", "action:read", "action:test", "conversation:read", "conversation:export", "conversation:analyze", "ticket:read", "ticket:create", "ticket:update", "analytics:read", "analytics:export", "file:upload", "file:download", "file:share", "template:read", "template:subscribe", "webhook:read", "subscription:read", "auth:login", "auth:logout", "auth:refresh", "user:read", "user:update", "notification:read", "workflow:read", "lead:read", "lead:create", "lead:update", "lead:export", "message:read", "message:send", "call:read", "call:record", "campaign:read", "campaign:analytics", "team:read", "conversation:assign", "conversation:reply"] };
787
+
788
+ export const SUBSCRIPTION_STATUS: readonly ["created", "pending_payment", "authenticated", "active", "pending", "pending_downgrade", "cancel_at_period_end", "paused", "halted", "cancelled", "expired", "completed"];
789
+
790
+ export const ScopesEnum: { "auth:login": "User can login to the system"; "auth:register": "User can register new accounts"; "auth:logout": "User can logout from the system"; "auth:refresh": "User can refresh their access token"; "user:read": "User can read their own profile"; "user:update": "User can update their own profile"; "user:delete": "User can delete their own account"; "business:read": "User can read business information"; "business:create": "User can create new businesses"; "business:update": "User can update business information"; "business:delete": "User can delete businesses"; "business:manage_members": "User can manage business members"; "business:view_analytics": "User can view business analytics"; "business:export_data": "User can export business data"; "agent:read": "User can read agent information"; "agent:create": "User can create new agents"; "agent:update": "User can update agent configurations"; "agent:delete": "User can delete agents"; "agent:deploy": "User can deploy agents to channels"; "agent:test": "User can test agent responses"; "agent:view_conversations": "User can view agent conversations"; "agent:manage_prompts": "User can manage agent prompts"; "collection:read": "User can read knowledge collections"; "collection:create": "User can create new collections"; "collection:update": "User can update collection content"; "collection:delete": "User can delete collections"; "collection:upload_files": "User can upload files to collections"; "collection:manage_permissions": "User can manage collection access"; "channel:read": "User can read channel configurations"; "channel:create": "User can create new channels"; "channel:update": "User can update channel settings"; "channel:delete": "User can delete channels"; "channel:connect": "User can connect external platforms"; "channel:view_webhooks": "User can view webhook configurations"; "action:read": "User can read available actions"; "action:create": "User can create new actions"; "action:update": "User can update action configurations"; "action:delete": "User can delete actions"; "action:test": "User can test action functionality"; "action:manage_integrations": "User can manage external integrations"; "conversation:read": "User can read conversations"; "conversation:create": "User can create new conversations"; "conversation:update": "User can update conversation status"; "conversation:delete": "User can delete conversations"; "conversation:export": "User can export conversation data"; "conversation:analyze": "User can analyze conversation patterns"; "ticket:read": "User can read support tickets"; "ticket:create": "User can create new tickets"; "ticket:update": "User can update ticket status"; "ticket:delete": "User can delete tickets"; "ticket:assign": "User can assign tickets to team members"; "ticket:escalate": "User can escalate tickets"; "analytics:read": "User can view analytics dashboard"; "analytics:export": "User can export analytics data"; "analytics:custom_reports": "User can create custom reports"; "analytics:real_time": "User can view real-time analytics"; "file:upload": "User can upload files"; "file:download": "User can download files"; "file:delete": "User can delete files"; "file:share": "User can share files with team members"; "template:read": "User can read available templates"; "template:create": "User can create new templates"; "template:update": "User can update template content"; "template:delete": "User can delete templates"; "template:publish": "User can publish templates to marketplace"; "template:subscribe": "User can subscribe to templates"; "admin:users": "User can manage all users"; "admin:businesses": "User can manage all businesses"; "admin:system_settings": "User can modify system settings"; "admin:logs": "User can view system logs"; "admin:backup": "User can perform system backups"; "admin:updates": "User can manage system updates"; "super:all": "Super admin has access to everything"; "super:platform_management": "User can manage platform-wide settings"; "super:billing": "User can manage billing and subscriptions"; "super:support": "User can manage platform support"; "super:marketplace": "User can manage marketplace content"; "webhook:read": "User can read webhook configurations"; "webhook:create": "User can create new webhooks"; "webhook:update": "User can update webhook settings"; "webhook:delete": "User can delete webhooks"; "webhook:test": "User can test webhook endpoints"; "subscription:read": "User can read subscription details"; "subscription:upgrade": "User can upgrade subscription"; "subscription:downgrade": "User can downgrade subscription"; "subscription:cancel": "User can cancel subscription"; "subscription:billing": "User can manage billing information"; "notification:read": "User can read notifications"; "notification:update": "User can update notification status"; "notification:delete": "User can delete notifications"; "integration:read": "User can read integration details"; "integration:create": "User can create new integrations"; "integration:update": "User can update integration configurations"; "integration:delete": "User can delete integrations"; "workflow:read": "User can read workflow details"; "workflow:create": "User can create new workflows"; "workflow:update": "User can update workflow configurations"; "workflow:delete": "User can delete workflows"; "lead:read": "User can read leads and lead templates"; "lead:create": "User can create new leads"; "lead:update": "User can update lead information"; "lead:delete": "User can delete leads"; "lead:import": "User can bulk import leads"; "lead:export": "User can export lead data"; "message:read": "User can read messages"; "message:send": "User can send messages in conversations"; "message:delete": "User can delete messages"; "call:read": "User can read call sessions and transcripts"; "call:initiate": "User can initiate outbound calls"; "call:record": "User can access call recordings"; "campaign:read": "User can read campaigns"; "campaign:create": "User can create new campaigns"; "campaign:update": "User can update campaigns"; "campaign:delete": "User can delete campaigns"; "campaign:launch": "User can launch and schedule campaigns"; "campaign:analytics": "User can view campaign analytics"; "team:read": "User can read team information"; "team:create": "User can create new teams"; "team:update": "User can update team settings"; "team:delete": "User can delete teams"; "team:manage_members": "User can add or remove team members"; "conversation:assign": "User can assign conversations to agents or teams"; "conversation:reply": "User can send messages in conversations"; "channel:manage_agents": "User can assign agents to channels" };
791
+
792
+ export const TASK_REFERENCE_TYPES: readonly ["Message", "CallSession"];
793
+
794
+ export const TASK_STATUS: readonly ["pending", "in-progress", "completed", "failed", "skipped"];
795
+
796
+ export const TASK_TYPES: readonly ["quick", "webhook"];
797
+