@classytic/crm 0.5.0 → 0.7.0
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/CHANGELOG.md +124 -0
- package/dist/events.d.ts +475 -2
- package/dist/events.js +180 -59
- package/dist/index.d.ts +2095 -780
- package/dist/index.js +1787 -72
- package/package.json +8 -8
- package/dist/index2.d.ts +0 -746
- /package/dist/{rolldown-runtime.js → chunk.js} +0 -0
package/dist/index2.d.ts
DELETED
|
@@ -1,746 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime.js";
|
|
2
|
-
import { $ as IMessageAttachment, $n as ContactUpdated, $t as CAMPAIGN_TRANSITIONS, A as AccountRepository, An as SchemaBuildConfig, Ar as PipelineArchived, At as buildActivitySchema, B as OpportunityRepositoryDeps, Bn as ActivityOutcomeRecorded, Bt as ISubscriptionDocument, C as ActivityRepository, Cn as LEAD_TRANSITIONS, Cr as OpportunityAssigned, Ct as ILossReasonDocument, D as SubscriptionRepositoryDeps, Dn as IStageDocument, Dr as OpportunityStageAdvanced, Dt as buildNoteSchema, E as SubscriptionRepository, En as IPipelineDocument, Er as OpportunityLost, Et as INoteDocument, F as MergeContactInput, Fn as AccountEnriched, Fr as SubscriptionCreated, Ft as ActivityStatus, G as composeScorers, Gn as CampaignCompleted, Gt as SUBSCRIPTION_TRANSITIONS, H as LeadRepositoryDeps, Hn as ActivityRescheduled, Ht as buildSubscriptionSchema, I as CloseInput, In as AccountMerged, Ir as SubscriptionUnsubscribed, It as ActivityType, J as PipelineRepositoryDeps, Jn as CampaignResumed, Jt as ICampaignDocument, K as defaultLeadScorer, Kn as CampaignCreated, Kt as SubscriptionStatus, L as MoveStageInput, Ln as AccountUpdated, Lr as crmEventDefinitions, Lt as SUBJECT_KINDS, M as MergeAccountInput, Mn as tenantFieldDef, Mr as SubscriptionBounced, Mt as ACTIVITY_STATUSES, N as ContactRepository, Nn as AccountAssigned, Nr as SubscriptionComplained, Nt as ACTIVITY_TRANSITIONS, O as CampaignRepository, On as buildPipelineSchema, Or as OpportunityStageRegressed, Ot as createNoteModel, P as ContactRepositoryDeps, Pn as AccountCreated, Pr as SubscriptionConfirmed, Pt as ACTIVITY_TYPES, Q as createCrmModels, Qn as ContactMerged, Qt as CAMPAIGN_STATUSES, R as OpenOpportunityInput, Rn as ActivityCancelled, Rr as CRM_EVENTS, Rt as SubjectKind, S as NoteRepositoryDeps, Sn as LEAD_STATUSES, Sr as OpportunityAmountChanged, St as EmailEventKind, T as SubscribeInput, Tn as canTransitionLead, Tr as OpportunityExtended, Tt as createLossReasonModel, U as LeadInput, Un as CampaignActivated, Ut as createSubscriptionModel, V as LeadRepository, Vn as ActivityPlanned, Vt as ISubscriptionStatusEntry, W as LeadScorer, Wn as CampaignArchived, Wt as SUBSCRIPTION_STATUSES, X as CreateModelsOptions, Xn as ContactCreated, Xt as buildCampaignSchema, Y as CRM_MODEL_NAMES, Yn as ContactAssigned, Yt as ICampaignStatusEntry, Z as CrmModels, Zn as ContactEnriched, Zt as createCampaignModel, _ as EmailEventRepositoryDeps, _n as canTransitionOpportunity, _r as LeadStatusChanged, _t as EmailEventSubjectKind, a as CrmEngine, an as IContactDocument, ar as CrmEventSchema, at as createConversationModel, b as LossReasonRepositoryDeps, bn as buildLeadSchema, br as NoteAdded, bt as createEmailEventModel, c as ResolvedCrmConfig, cn as buildContactSchema, cr as EmailEventComplained, ct as CONVERSATION_STATUSES, d as MessageRepositoryDeps, dn as IOpportunityStatusEntry, dr as LeadAssigned, dt as ConversationStatus, en as CampaignStatus, er as ConversationAssigned, et as IMessageDocument, f as RecordMessageInput, fn as buildOpportunitySchema, fr as LeadConverted, ft as MESSAGE_DELIVERY_STATUSES, g as EmailEventRepository, gn as OpportunityStatus, gr as LeadScored, gt as EMAIL_EVENT_SUBJECT_KINDS, h as OpenConversationInput, hn as OPPORTUNITY_TRANSITIONS, hr as LeadEnriched, ht as MessageDirection, i as CrmContext, in as createAccountModel, ir as CrmEventDefinition, it as buildConversationSchema, j as AccountRepositoryDeps, jn as TenantFieldType, jr as PipelineCreated, jt as createActivityModel, k as CampaignRepositoryDeps, kn as createPipelineModel, kr as OpportunityWon, kt as IActivityDocument, l as _ModelTypes, ln as createContactModel, lr as EmailEventOpened, lt as ConversationChannel, m as ConversationRepositoryDeps, mn as OPPORTUNITY_STATUSES, mr as LeadDisqualified, mt as MessageDeliveryStatus, n as createEvent, nn as IAccountDocument, nr as ConversationReopened, nt as createMessageModel, o as CrmLogger, on as IContactInfoEmbedded, or as EmailEventBounced, ot as CONVERSATION_CHANNELS, p as ConversationRepository, pn as createOpportunityModel, pr as LeadCreated, pt as MESSAGE_DIRECTIONS, q as PipelineRepository, qn as CampaignPaused, qt as canTransitionSubscription, r as CrmConfig, rn as buildAccountSchema, rr as ConversationResolved, rt as IConversationDocument, s as CrmRepositories, sn as IContactName, sr as EmailEventClicked, st as CONVERSATION_PARTICIPANT_KINDS, t as InProcessCrmBus, tn as canTransitionCampaign, tr as ConversationCreated, tt as buildMessageSchema, u as MessageRepository, un as IOpportunityDocument, ur as EmailEventUnsubscribed, ut as ConversationParticipantKind, v as RecordEmailEventInput, vn as ILeadDocument, vr as MessageReceived, vt as IEmailEventDocument, w as ActivityRepositoryDeps, wn as LeadStatus, wr as OpportunityCreated, wt as buildLossReasonSchema, x as NoteRepository, xn as createLeadModel, xr as OpportunityAbandoned, xt as EMAIL_EVENT_KINDS, y as LossReasonRepository, yn as ILeadStatusEntry, yr as MessageSent, yt as buildEmailEventSchema, z as OpportunityRepository, zn as ActivityCompleted, zr as CrmEventName, zt as canTransitionActivity } from "./index.js";
|
|
3
|
-
import { EventTransport } from "@classytic/primitives/events";
|
|
4
|
-
import * as _classytic_primitives_state_machine0 from "@classytic/primitives/state-machine";
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import { StatusChangeEntry, StatusHistory, appendStatus, lastTransitionTo, latestEntry, timeInStatus } from "@classytic/primitives/status-history";
|
|
7
|
-
|
|
8
|
-
//#region src/engine/create-crm.d.ts
|
|
9
|
-
|
|
10
|
-
declare function createCrm(config: CrmConfig): Promise<CrmEngine>;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/repositories/create-repositories.d.ts
|
|
13
|
-
interface CreateCrmRepositoriesDeps {
|
|
14
|
-
events: EventTransport;
|
|
15
|
-
config: ResolvedCrmConfig;
|
|
16
|
-
}
|
|
17
|
-
declare function createCrmRepositories(models: CrmModels, deps: CreateCrmRepositoriesDeps): CrmRepositories;
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/services/lead.service.d.ts
|
|
20
|
-
interface ConvertLeadInput {
|
|
21
|
-
pipelineId: string;
|
|
22
|
-
/** Defaults to `<companyName> — <source>` / `<fullName> — New`. */
|
|
23
|
-
opportunityName?: string;
|
|
24
|
-
/** Stored flat on the opportunity (`amount` + `currency`). */
|
|
25
|
-
amount?: number;
|
|
26
|
-
currency?: string;
|
|
27
|
-
expectedCloseAt?: Date;
|
|
28
|
-
by?: string;
|
|
29
|
-
}
|
|
30
|
-
interface ConvertResult {
|
|
31
|
-
lead: ILeadDocument;
|
|
32
|
-
contact: IContactDocument;
|
|
33
|
-
account?: IAccountDocument;
|
|
34
|
-
opportunity: IOpportunityDocument;
|
|
35
|
-
/** Convenience string id — same as `String(contact._id)`. */
|
|
36
|
-
contactId: string;
|
|
37
|
-
/** Convenience string id — present only when an account was created. */
|
|
38
|
-
accountId?: string;
|
|
39
|
-
/** Convenience string id — same as `String(opportunity._id)`. */
|
|
40
|
-
opportunityId: string;
|
|
41
|
-
}
|
|
42
|
-
interface LeadServiceDeps {
|
|
43
|
-
lead: LeadRepository;
|
|
44
|
-
contact: ContactRepository;
|
|
45
|
-
account: AccountRepository;
|
|
46
|
-
opportunity: OpportunityRepository;
|
|
47
|
-
events: EventTransport;
|
|
48
|
-
}
|
|
49
|
-
declare class LeadService {
|
|
50
|
-
private readonly leads;
|
|
51
|
-
private readonly contacts;
|
|
52
|
-
private readonly accounts;
|
|
53
|
-
private readonly opportunities;
|
|
54
|
-
private readonly events;
|
|
55
|
-
constructor(deps: LeadServiceDeps);
|
|
56
|
-
/**
|
|
57
|
-
* Construct from an already-built CrmEngine — the host's preferred path.
|
|
58
|
-
* Avoids manually wiring four repositories.
|
|
59
|
-
*/
|
|
60
|
-
static fromEngine(engine: CrmEngine): LeadService;
|
|
61
|
-
/**
|
|
62
|
-
* Convert a Lead into Account + Contact + Opportunity, then transition
|
|
63
|
-
* the lead. Wrap the call in `connection.transaction()` and pass the
|
|
64
|
-
* session via `ctx.session` for atomicity — all four writes commit or
|
|
65
|
-
* roll back together.
|
|
66
|
-
*
|
|
67
|
-
* Best-effort compensation: if a downstream write fails, already-
|
|
68
|
-
* created docs are deleted in reverse order. The reverse delete may
|
|
69
|
-
* itself fail (e.g. transient DB issues) — when transactions are
|
|
70
|
-
* active, prefer that path; compensation is the no-transaction
|
|
71
|
-
* fallback.
|
|
72
|
-
*/
|
|
73
|
-
convert(leadId: string, input: ConvertLeadInput, ctx?: CrmContext): Promise<ConvertResult>;
|
|
74
|
-
/**
|
|
75
|
-
* The state-machine hop from whichever status the lead is in to
|
|
76
|
-
* `converted`. We do this directly (instead of calling
|
|
77
|
-
* `LeadRepository.qualify` first then a hypothetical `complete`)
|
|
78
|
-
* because the conversion is "this lead is done" regardless of where
|
|
79
|
-
* it started — bypassing the `qualified` waypoint is intentional when
|
|
80
|
-
* a Lead is converted directly from `new` (importers, webhooks).
|
|
81
|
-
*/
|
|
82
|
-
private _markConverted;
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/core/state-machines.d.ts
|
|
86
|
-
/**
|
|
87
|
-
* Declarative state machines for every CRM aggregate that has lifecycle
|
|
88
|
-
* transitions. Single source of truth for what `from -> to` moves are
|
|
89
|
-
* legal — the repositories' domain verbs (`qualify`, `convert`, `win`,
|
|
90
|
-
* `lose`, `confirm`, `unsubscribe`, ...) call `assertTransition` before
|
|
91
|
-
* they touch Mongo.
|
|
92
|
-
*
|
|
93
|
-
* Per PACKAGE_RULES §30: "State machines map to Arc Actions". The host
|
|
94
|
-
* exposes each domain verb as an arc Action (`POST /:id/action` with
|
|
95
|
-
* `{ action: 'qualify' }`); the verb's implementation lives on the
|
|
96
|
-
* Repository class and uses these machines internally.
|
|
97
|
-
*
|
|
98
|
-
* Built on `@classytic/primitives/state-machine` so the same shape lights
|
|
99
|
-
* up across kits (mongokit's `claim()` pairing, sqlitekit follow-ups).
|
|
100
|
-
*/
|
|
101
|
-
declare const LEAD_MACHINE: _classytic_primitives_state_machine0.StateMachine<"new" | "contacted" | "qualified" | "converted" | "disqualified" | "nurturing">;
|
|
102
|
-
declare const OPPORTUNITY_MACHINE: _classytic_primitives_state_machine0.StateMachine<"open" | "won" | "lost" | "abandoned">;
|
|
103
|
-
declare const CAMPAIGN_MACHINE: _classytic_primitives_state_machine0.StateMachine<"draft" | "active" | "paused" | "completed" | "archived">;
|
|
104
|
-
declare const SUBSCRIPTION_MACHINE: _classytic_primitives_state_machine0.StateMachine<"pending" | "confirmed" | "unsubscribed" | "bounced" | "complained">;
|
|
105
|
-
declare const ACTIVITY_MACHINE: _classytic_primitives_state_machine0.StateMachine<"completed" | "planned" | "in_progress" | "cancelled">;
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/core/errors.d.ts
|
|
108
|
-
/**
|
|
109
|
-
* CRM error vocabulary. Hosts catch `CrmError` at API edges.
|
|
110
|
-
*/
|
|
111
|
-
declare class CrmError extends Error {
|
|
112
|
-
readonly code: string;
|
|
113
|
-
readonly details?: Record<string, unknown>;
|
|
114
|
-
constructor(code: string, message: string, details?: Record<string, unknown>);
|
|
115
|
-
}
|
|
116
|
-
declare class NotFoundError extends CrmError {
|
|
117
|
-
constructor(kind: string, id: string);
|
|
118
|
-
}
|
|
119
|
-
declare class InvalidLeadTransitionError extends CrmError {
|
|
120
|
-
constructor(details: {
|
|
121
|
-
from: string;
|
|
122
|
-
to: string;
|
|
123
|
-
leadId: string;
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
declare class InvalidOpportunityTransitionError extends CrmError {
|
|
127
|
-
constructor(details: {
|
|
128
|
-
from: string;
|
|
129
|
-
to: string;
|
|
130
|
-
opportunityId: string;
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
declare class InvalidActivityTransitionError extends CrmError {
|
|
134
|
-
constructor(details: {
|
|
135
|
-
from: string;
|
|
136
|
-
to: string;
|
|
137
|
-
activityId: string;
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
declare class StageNotInPipelineError extends CrmError {
|
|
141
|
-
constructor(details: {
|
|
142
|
-
pipelineId: string;
|
|
143
|
-
stageId: string;
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
declare class LeadAlreadyConvertedError extends CrmError {
|
|
147
|
-
constructor(leadId: string);
|
|
148
|
-
}
|
|
149
|
-
declare class DuplicateLeadError extends CrmError {
|
|
150
|
-
constructor(details: {
|
|
151
|
-
email?: string;
|
|
152
|
-
phone?: string;
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
declare class EmptyPipelineError extends CrmError {
|
|
156
|
-
constructor(pipelineId: string);
|
|
157
|
-
}
|
|
158
|
-
declare class InvalidCampaignTransitionError extends CrmError {
|
|
159
|
-
constructor(details: {
|
|
160
|
-
from: string;
|
|
161
|
-
to: string;
|
|
162
|
-
campaignId: string;
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
declare class DuplicateCampaignError extends CrmError {
|
|
166
|
-
constructor(name: string);
|
|
167
|
-
}
|
|
168
|
-
declare class InvalidSubscriptionTransitionError extends CrmError {
|
|
169
|
-
constructor(details: {
|
|
170
|
-
from: string;
|
|
171
|
-
to: string;
|
|
172
|
-
subscriptionId: string;
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
declare class DuplicateSubscriptionError extends CrmError {
|
|
176
|
-
constructor(details: {
|
|
177
|
-
contactId: string;
|
|
178
|
-
campaignId: string;
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
declare class InvalidConfirmationTokenError extends CrmError {
|
|
182
|
-
constructor();
|
|
183
|
-
}
|
|
184
|
-
declare class InvalidUnsubscribeTokenError extends CrmError {
|
|
185
|
-
constructor();
|
|
186
|
-
}
|
|
187
|
-
//#endregion
|
|
188
|
-
//#region src/shared/calculators/forecast.d.ts
|
|
189
|
-
type OpportunityForecast = Pick<IOpportunityDocument, 'amount' | 'currency' | 'probability' | 'status' | 'expectedCloseAt' | 'stageId' | 'statusHistory'>;
|
|
190
|
-
interface ForecastRow {
|
|
191
|
-
/** Bucket key — ISO month `YYYY-MM` by default. */
|
|
192
|
-
bucket: string;
|
|
193
|
-
/** Σ amount. */
|
|
194
|
-
committed: number;
|
|
195
|
-
/** Σ amount × probability. */
|
|
196
|
-
weighted: number;
|
|
197
|
-
/** Number of opportunities in the bucket. */
|
|
198
|
-
count: number;
|
|
199
|
-
currency: string;
|
|
200
|
-
}
|
|
201
|
-
interface ForecastOptions {
|
|
202
|
-
/** Bucket function. Default: ISO month from `expectedCloseAt`. */
|
|
203
|
-
bucket?: (o: OpportunityForecast) => string;
|
|
204
|
-
/** Filter before bucketing. Default: open + has amount + has expectedCloseAt. */
|
|
205
|
-
include?: (o: OpportunityForecast) => boolean;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Aggregate opportunities into a forecast table — one row per bucket.
|
|
209
|
-
* Currency mismatch within a bucket throws — partition by currency
|
|
210
|
-
* upstream when multi-currency.
|
|
211
|
-
*/
|
|
212
|
-
declare function forecast(opportunities: readonly OpportunityForecast[], options?: ForecastOptions): ForecastRow[];
|
|
213
|
-
interface ConversionRow {
|
|
214
|
-
stageId: string;
|
|
215
|
-
currentCount: number;
|
|
216
|
-
wonFromHere: number;
|
|
217
|
-
lostFromHere: number;
|
|
218
|
-
conversionRate: number;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* "Where do deals die?" summary — opportunities partitioned across
|
|
222
|
-
* stages with current count + won/lost-from-here.
|
|
223
|
-
*/
|
|
224
|
-
declare function pipelineConversion(opportunities: readonly OpportunityForecast[], stageIds: readonly string[]): ConversionRow[];
|
|
225
|
-
//#endregion
|
|
226
|
-
//#region src/validators/common.d.ts
|
|
227
|
-
declare const objectIdLike: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
228
|
-
declare const metadataSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
229
|
-
declare const tagsSchema: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
230
|
-
declare const moneyAmountSchema: z.ZodNumber;
|
|
231
|
-
declare const currencyCodeSchema: z.ZodString;
|
|
232
|
-
//#endregion
|
|
233
|
-
//#region src/validators/pipeline.schema.d.ts
|
|
234
|
-
declare const stageInputSchema: z.ZodObject<{
|
|
235
|
-
name: z.ZodString;
|
|
236
|
-
sequence: z.ZodNumber;
|
|
237
|
-
defaultProbability: z.ZodNumber;
|
|
238
|
-
color: z.ZodOptional<z.ZodString>;
|
|
239
|
-
description: z.ZodOptional<z.ZodString>;
|
|
240
|
-
}, z.core.$strip>;
|
|
241
|
-
declare const createPipelineSchema: z.ZodObject<{
|
|
242
|
-
name: z.ZodString;
|
|
243
|
-
stages: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
244
|
-
name: z.ZodString;
|
|
245
|
-
sequence: z.ZodNumber;
|
|
246
|
-
defaultProbability: z.ZodNumber;
|
|
247
|
-
color: z.ZodOptional<z.ZodString>;
|
|
248
|
-
description: z.ZodOptional<z.ZodString>;
|
|
249
|
-
}, z.core.$strip>>>;
|
|
250
|
-
teamRef: z.ZodOptional<z.ZodString>;
|
|
251
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
252
|
-
}, z.core.$strip>;
|
|
253
|
-
declare const updatePipelineSchema: z.ZodObject<{
|
|
254
|
-
name: z.ZodOptional<z.ZodString>;
|
|
255
|
-
stages: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
256
|
-
name: z.ZodString;
|
|
257
|
-
sequence: z.ZodNumber;
|
|
258
|
-
defaultProbability: z.ZodNumber;
|
|
259
|
-
color: z.ZodOptional<z.ZodString>;
|
|
260
|
-
description: z.ZodOptional<z.ZodString>;
|
|
261
|
-
}, z.core.$strip>>>>;
|
|
262
|
-
teamRef: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
263
|
-
metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
264
|
-
}, z.core.$strip>;
|
|
265
|
-
declare const stageInputSchemaExport: z.ZodObject<{
|
|
266
|
-
name: z.ZodString;
|
|
267
|
-
sequence: z.ZodNumber;
|
|
268
|
-
defaultProbability: z.ZodNumber;
|
|
269
|
-
color: z.ZodOptional<z.ZodString>;
|
|
270
|
-
description: z.ZodOptional<z.ZodString>;
|
|
271
|
-
}, z.core.$strip>;
|
|
272
|
-
declare const pipelineFilterSchema: z.ZodObject<{
|
|
273
|
-
isArchived: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
|
|
274
|
-
teamRef: z.ZodOptional<z.ZodString>;
|
|
275
|
-
}, z.core.$strip>;
|
|
276
|
-
type CreatePipelineDto = z.infer<typeof createPipelineSchema>;
|
|
277
|
-
type UpdatePipelineDto = z.infer<typeof updatePipelineSchema>;
|
|
278
|
-
type StageInputDto = z.infer<typeof stageInputSchema>;
|
|
279
|
-
//#endregion
|
|
280
|
-
//#region src/validators/lead.schema.d.ts
|
|
281
|
-
declare const createLeadSchema: z.ZodObject<{
|
|
282
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
283
|
-
firstName: z.ZodOptional<z.ZodString>;
|
|
284
|
-
lastName: z.ZodOptional<z.ZodString>;
|
|
285
|
-
email: z.ZodOptional<z.ZodString>;
|
|
286
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
287
|
-
companyName: z.ZodOptional<z.ZodString>;
|
|
288
|
-
jobTitle: z.ZodOptional<z.ZodString>;
|
|
289
|
-
source: z.ZodOptional<z.ZodString>;
|
|
290
|
-
campaignRef: z.ZodOptional<z.ZodString>;
|
|
291
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
292
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
293
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
294
|
-
}, z.core.$strip>;
|
|
295
|
-
declare const updateLeadSchema: z.ZodObject<{
|
|
296
|
-
fullName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
297
|
-
firstName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
298
|
-
lastName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
299
|
-
email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
300
|
-
phone: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
301
|
-
companyName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
302
|
-
jobTitle: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
303
|
-
source: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
304
|
-
campaignRef: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
305
|
-
ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
306
|
-
tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
307
|
-
metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
308
|
-
}, z.core.$strip>;
|
|
309
|
-
declare const leadFilterSchema: z.ZodObject<{
|
|
310
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
311
|
-
new: "new";
|
|
312
|
-
contacted: "contacted";
|
|
313
|
-
qualified: "qualified";
|
|
314
|
-
converted: "converted";
|
|
315
|
-
disqualified: "disqualified";
|
|
316
|
-
nurturing: "nurturing";
|
|
317
|
-
}>>;
|
|
318
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
319
|
-
email: z.ZodOptional<z.ZodString>;
|
|
320
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
321
|
-
source: z.ZodOptional<z.ZodString>;
|
|
322
|
-
campaignRef: z.ZodOptional<z.ZodString>;
|
|
323
|
-
scoreMin: z.ZodOptional<z.ZodNumber>;
|
|
324
|
-
scoreMax: z.ZodOptional<z.ZodNumber>;
|
|
325
|
-
}, z.core.$strip>;
|
|
326
|
-
declare const convertLeadSchema: z.ZodObject<{
|
|
327
|
-
pipelineId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
328
|
-
opportunityName: z.ZodOptional<z.ZodString>;
|
|
329
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
330
|
-
currency: z.ZodOptional<z.ZodString>;
|
|
331
|
-
expectedCloseAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
332
|
-
by: z.ZodOptional<z.ZodString>;
|
|
333
|
-
}, z.core.$strip>;
|
|
334
|
-
type CreateLeadDto = z.infer<typeof createLeadSchema>;
|
|
335
|
-
type UpdateLeadDto = z.infer<typeof updateLeadSchema>;
|
|
336
|
-
type ConvertLeadDto = z.infer<typeof convertLeadSchema>;
|
|
337
|
-
type LeadFilterDto = z.infer<typeof leadFilterSchema>;
|
|
338
|
-
//#endregion
|
|
339
|
-
//#region src/validators/opportunity.schema.d.ts
|
|
340
|
-
declare const openOpportunitySchema: z.ZodObject<{
|
|
341
|
-
name: z.ZodString;
|
|
342
|
-
pipelineId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
343
|
-
stageId: z.ZodOptional<z.ZodString>;
|
|
344
|
-
accountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
345
|
-
primaryContactId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
346
|
-
sourceLeadId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
347
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
348
|
-
currency: z.ZodOptional<z.ZodString>;
|
|
349
|
-
probability: z.ZodOptional<z.ZodNumber>;
|
|
350
|
-
expectedCloseAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
351
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
352
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
353
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
354
|
-
}, z.core.$strip>;
|
|
355
|
-
declare const moveStageSchema: z.ZodObject<{
|
|
356
|
-
stageId: z.ZodString;
|
|
357
|
-
by: z.ZodOptional<z.ZodString>;
|
|
358
|
-
note: z.ZodOptional<z.ZodString>;
|
|
359
|
-
probability: z.ZodOptional<z.ZodNumber>;
|
|
360
|
-
}, z.core.$strip>;
|
|
361
|
-
declare const closeWinSchema: z.ZodObject<{
|
|
362
|
-
by: z.ZodOptional<z.ZodString>;
|
|
363
|
-
note: z.ZodOptional<z.ZodString>;
|
|
364
|
-
closedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
365
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
366
|
-
}, z.core.$strip>;
|
|
367
|
-
declare const closeLossSchema: z.ZodObject<{
|
|
368
|
-
by: z.ZodOptional<z.ZodString>;
|
|
369
|
-
note: z.ZodOptional<z.ZodString>;
|
|
370
|
-
closedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
371
|
-
lostReasonId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
372
|
-
}, z.core.$strip>;
|
|
373
|
-
declare const opportunityFilterSchema: z.ZodObject<{
|
|
374
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
375
|
-
open: "open";
|
|
376
|
-
won: "won";
|
|
377
|
-
lost: "lost";
|
|
378
|
-
abandoned: "abandoned";
|
|
379
|
-
}>>;
|
|
380
|
-
pipelineId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
381
|
-
stageId: z.ZodOptional<z.ZodString>;
|
|
382
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
383
|
-
accountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
384
|
-
expectedCloseFrom: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
385
|
-
expectedCloseTo: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
386
|
-
}, z.core.$strip>;
|
|
387
|
-
type OpenOpportunityDto = z.infer<typeof openOpportunitySchema>;
|
|
388
|
-
type MoveStageDto = z.infer<typeof moveStageSchema>;
|
|
389
|
-
type CloseWinDto = z.infer<typeof closeWinSchema>;
|
|
390
|
-
type CloseLossDto = z.infer<typeof closeLossSchema>;
|
|
391
|
-
type OpportunityFilterDto = z.infer<typeof opportunityFilterSchema>;
|
|
392
|
-
//#endregion
|
|
393
|
-
//#region src/validators/contact.schema.d.ts
|
|
394
|
-
declare const createContactSchema: z.ZodObject<{
|
|
395
|
-
name: z.ZodObject<{
|
|
396
|
-
given: z.ZodString;
|
|
397
|
-
family: z.ZodDefault<z.ZodString>;
|
|
398
|
-
middle: z.ZodOptional<z.ZodString>;
|
|
399
|
-
prefix: z.ZodOptional<z.ZodString>;
|
|
400
|
-
suffix: z.ZodOptional<z.ZodString>;
|
|
401
|
-
preferred: z.ZodOptional<z.ZodString>;
|
|
402
|
-
}, z.core.$strip>;
|
|
403
|
-
contact: z.ZodDefault<z.ZodObject<{
|
|
404
|
-
email: z.ZodOptional<z.ZodString>;
|
|
405
|
-
personalEmail: z.ZodOptional<z.ZodString>;
|
|
406
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
407
|
-
alternatePhone: z.ZodOptional<z.ZodString>;
|
|
408
|
-
whatsapp: z.ZodOptional<z.ZodString>;
|
|
409
|
-
telegram: z.ZodOptional<z.ZodString>;
|
|
410
|
-
linkedin: z.ZodOptional<z.ZodString>;
|
|
411
|
-
instagram: z.ZodOptional<z.ZodString>;
|
|
412
|
-
}, z.core.$strip>>;
|
|
413
|
-
jobTitle: z.ZodOptional<z.ZodString>;
|
|
414
|
-
accountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
415
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
416
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
417
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
418
|
-
}, z.core.$strip>;
|
|
419
|
-
declare const updateContactSchema: z.ZodObject<{
|
|
420
|
-
name: z.ZodOptional<z.ZodObject<{
|
|
421
|
-
given: z.ZodString;
|
|
422
|
-
family: z.ZodDefault<z.ZodString>;
|
|
423
|
-
middle: z.ZodOptional<z.ZodString>;
|
|
424
|
-
prefix: z.ZodOptional<z.ZodString>;
|
|
425
|
-
suffix: z.ZodOptional<z.ZodString>;
|
|
426
|
-
preferred: z.ZodOptional<z.ZodString>;
|
|
427
|
-
}, z.core.$strip>>;
|
|
428
|
-
contact: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
429
|
-
email: z.ZodOptional<z.ZodString>;
|
|
430
|
-
personalEmail: z.ZodOptional<z.ZodString>;
|
|
431
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
432
|
-
alternatePhone: z.ZodOptional<z.ZodString>;
|
|
433
|
-
whatsapp: z.ZodOptional<z.ZodString>;
|
|
434
|
-
telegram: z.ZodOptional<z.ZodString>;
|
|
435
|
-
linkedin: z.ZodOptional<z.ZodString>;
|
|
436
|
-
instagram: z.ZodOptional<z.ZodString>;
|
|
437
|
-
}, z.core.$strip>>>;
|
|
438
|
-
jobTitle: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
439
|
-
accountId: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>>;
|
|
440
|
-
ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
441
|
-
tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
442
|
-
metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
443
|
-
}, z.core.$strip>;
|
|
444
|
-
declare const contactFilterSchema: z.ZodObject<{
|
|
445
|
-
accountId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
446
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
447
|
-
email: z.ZodOptional<z.ZodString>;
|
|
448
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
449
|
-
}, z.core.$strip>;
|
|
450
|
-
type CreateContactDto = z.infer<typeof createContactSchema>;
|
|
451
|
-
type UpdateContactDto = z.infer<typeof updateContactSchema>;
|
|
452
|
-
//#endregion
|
|
453
|
-
//#region src/validators/account.schema.d.ts
|
|
454
|
-
declare const createAccountSchema: z.ZodObject<{
|
|
455
|
-
name: z.ZodString;
|
|
456
|
-
domain: z.ZodOptional<z.ZodString>;
|
|
457
|
-
industry: z.ZodOptional<z.ZodString>;
|
|
458
|
-
sizeBucket: z.ZodOptional<z.ZodString>;
|
|
459
|
-
annualRevenueAmount: z.ZodOptional<z.ZodNumber>;
|
|
460
|
-
annualRevenueCurrency: z.ZodOptional<z.ZodString>;
|
|
461
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
462
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
463
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
464
|
-
}, z.core.$strip>;
|
|
465
|
-
declare const updateAccountSchema: z.ZodObject<{
|
|
466
|
-
name: z.ZodOptional<z.ZodString>;
|
|
467
|
-
domain: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
468
|
-
industry: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
469
|
-
sizeBucket: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
470
|
-
annualRevenueAmount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
471
|
-
annualRevenueCurrency: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
472
|
-
ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
473
|
-
tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
474
|
-
metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
475
|
-
}, z.core.$strip>;
|
|
476
|
-
declare const accountFilterSchema: z.ZodObject<{
|
|
477
|
-
domain: z.ZodOptional<z.ZodString>;
|
|
478
|
-
industry: z.ZodOptional<z.ZodString>;
|
|
479
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
480
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
481
|
-
}, z.core.$strip>;
|
|
482
|
-
type CreateAccountDto = z.infer<typeof createAccountSchema>;
|
|
483
|
-
type UpdateAccountDto = z.infer<typeof updateAccountSchema>;
|
|
484
|
-
//#endregion
|
|
485
|
-
//#region src/validators/campaign.schema.d.ts
|
|
486
|
-
declare const createCampaignSchema: z.ZodObject<{
|
|
487
|
-
name: z.ZodString;
|
|
488
|
-
description: z.ZodOptional<z.ZodString>;
|
|
489
|
-
utmSource: z.ZodOptional<z.ZodString>;
|
|
490
|
-
utmMedium: z.ZodOptional<z.ZodString>;
|
|
491
|
-
utmCampaign: z.ZodOptional<z.ZodString>;
|
|
492
|
-
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
493
|
-
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
494
|
-
budgetAmount: z.ZodOptional<z.ZodNumber>;
|
|
495
|
-
expectedRevenueAmount: z.ZodOptional<z.ZodNumber>;
|
|
496
|
-
currency: z.ZodOptional<z.ZodString>;
|
|
497
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
498
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
499
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
500
|
-
}, z.core.$strip>;
|
|
501
|
-
declare const updateCampaignSchema: z.ZodObject<{
|
|
502
|
-
name: z.ZodOptional<z.ZodString>;
|
|
503
|
-
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
504
|
-
utmSource: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
505
|
-
utmMedium: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
506
|
-
utmCampaign: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
507
|
-
startDate: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
508
|
-
endDate: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
509
|
-
budgetAmount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
510
|
-
expectedRevenueAmount: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
511
|
-
currency: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
512
|
-
ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
513
|
-
tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
514
|
-
metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
515
|
-
}, z.core.$strip>;
|
|
516
|
-
declare const completeCampaignSchema: z.ZodObject<{
|
|
517
|
-
by: z.ZodOptional<z.ZodString>;
|
|
518
|
-
note: z.ZodOptional<z.ZodString>;
|
|
519
|
-
actualRevenueAmount: z.ZodOptional<z.ZodNumber>;
|
|
520
|
-
}, z.core.$strip>;
|
|
521
|
-
declare const campaignFilterSchema: z.ZodObject<{
|
|
522
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
523
|
-
draft: "draft";
|
|
524
|
-
active: "active";
|
|
525
|
-
paused: "paused";
|
|
526
|
-
completed: "completed";
|
|
527
|
-
archived: "archived";
|
|
528
|
-
}>>;
|
|
529
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
530
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
531
|
-
startDateFrom: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
532
|
-
startDateTo: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
533
|
-
}, z.core.$strip>;
|
|
534
|
-
type CreateCampaignDto = z.infer<typeof createCampaignSchema>;
|
|
535
|
-
type UpdateCampaignDto = z.infer<typeof updateCampaignSchema>;
|
|
536
|
-
type CompleteCampaignDto = z.infer<typeof completeCampaignSchema>;
|
|
537
|
-
//#endregion
|
|
538
|
-
//#region src/validators/subscription.schema.d.ts
|
|
539
|
-
declare const subscribeSchema: z.ZodObject<{
|
|
540
|
-
contactId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
541
|
-
campaignId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
542
|
-
source: z.ZodOptional<z.ZodString>;
|
|
543
|
-
consentIpAddress: z.ZodOptional<z.ZodString>;
|
|
544
|
-
consentUserAgent: z.ZodOptional<z.ZodString>;
|
|
545
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
546
|
-
requireDoubleOptIn: z.ZodOptional<z.ZodBoolean>;
|
|
547
|
-
}, z.core.$strip>;
|
|
548
|
-
declare const confirmSubscriptionSchema: z.ZodObject<{
|
|
549
|
-
token: z.ZodString;
|
|
550
|
-
}, z.core.$strip>;
|
|
551
|
-
declare const unsubscribeSchema: z.ZodObject<{
|
|
552
|
-
token: z.ZodString;
|
|
553
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
554
|
-
}, z.core.$strip>;
|
|
555
|
-
declare const subscriptionFilterSchema: z.ZodObject<{
|
|
556
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
557
|
-
pending: "pending";
|
|
558
|
-
confirmed: "confirmed";
|
|
559
|
-
unsubscribed: "unsubscribed";
|
|
560
|
-
bounced: "bounced";
|
|
561
|
-
complained: "complained";
|
|
562
|
-
}>>;
|
|
563
|
-
contactId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
564
|
-
campaignId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
565
|
-
}, z.core.$strip>;
|
|
566
|
-
type SubscribeDto = z.infer<typeof subscribeSchema>;
|
|
567
|
-
type ConfirmSubscriptionDto = z.infer<typeof confirmSubscriptionSchema>;
|
|
568
|
-
type UnsubscribeDto = z.infer<typeof unsubscribeSchema>;
|
|
569
|
-
//#endregion
|
|
570
|
-
//#region src/validators/activity.schema.d.ts
|
|
571
|
-
declare const planActivitySchema: z.ZodObject<{
|
|
572
|
-
type: z.ZodEnum<{
|
|
573
|
-
call: "call";
|
|
574
|
-
email: "email";
|
|
575
|
-
meeting: "meeting";
|
|
576
|
-
task: "task";
|
|
577
|
-
note: "note";
|
|
578
|
-
sms: "sms";
|
|
579
|
-
social: "social";
|
|
580
|
-
demo: "demo";
|
|
581
|
-
other: "other";
|
|
582
|
-
}>;
|
|
583
|
-
subjectKind: z.ZodEnum<{
|
|
584
|
-
lead: "lead";
|
|
585
|
-
opportunity: "opportunity";
|
|
586
|
-
contact: "contact";
|
|
587
|
-
account: "account";
|
|
588
|
-
}>;
|
|
589
|
-
subjectId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
590
|
-
title: z.ZodString;
|
|
591
|
-
description: z.ZodOptional<z.ZodString>;
|
|
592
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
593
|
-
participantIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
594
|
-
dueDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
595
|
-
externalRef: z.ZodOptional<z.ZodString>;
|
|
596
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
597
|
-
}, z.core.$strip>;
|
|
598
|
-
declare const updateActivitySchema: z.ZodObject<{
|
|
599
|
-
type: z.ZodOptional<z.ZodEnum<{
|
|
600
|
-
call: "call";
|
|
601
|
-
email: "email";
|
|
602
|
-
meeting: "meeting";
|
|
603
|
-
task: "task";
|
|
604
|
-
note: "note";
|
|
605
|
-
sms: "sms";
|
|
606
|
-
social: "social";
|
|
607
|
-
demo: "demo";
|
|
608
|
-
other: "other";
|
|
609
|
-
}>>;
|
|
610
|
-
subjectKind: z.ZodOptional<z.ZodEnum<{
|
|
611
|
-
lead: "lead";
|
|
612
|
-
opportunity: "opportunity";
|
|
613
|
-
contact: "contact";
|
|
614
|
-
account: "account";
|
|
615
|
-
}>>;
|
|
616
|
-
subjectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
617
|
-
title: z.ZodOptional<z.ZodString>;
|
|
618
|
-
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
619
|
-
ownerId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
620
|
-
participantIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
621
|
-
dueDate: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
622
|
-
externalRef: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
623
|
-
metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
624
|
-
}, z.core.$strip>;
|
|
625
|
-
declare const cancelActivitySchema: z.ZodObject<{
|
|
626
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
627
|
-
}, z.core.$strip>;
|
|
628
|
-
declare const activityFilterSchema: z.ZodObject<{
|
|
629
|
-
type: z.ZodOptional<z.ZodEnum<{
|
|
630
|
-
call: "call";
|
|
631
|
-
email: "email";
|
|
632
|
-
meeting: "meeting";
|
|
633
|
-
task: "task";
|
|
634
|
-
note: "note";
|
|
635
|
-
sms: "sms";
|
|
636
|
-
social: "social";
|
|
637
|
-
demo: "demo";
|
|
638
|
-
other: "other";
|
|
639
|
-
}>>;
|
|
640
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
641
|
-
completed: "completed";
|
|
642
|
-
planned: "planned";
|
|
643
|
-
in_progress: "in_progress";
|
|
644
|
-
cancelled: "cancelled";
|
|
645
|
-
}>>;
|
|
646
|
-
subjectKind: z.ZodOptional<z.ZodEnum<{
|
|
647
|
-
lead: "lead";
|
|
648
|
-
opportunity: "opportunity";
|
|
649
|
-
contact: "contact";
|
|
650
|
-
account: "account";
|
|
651
|
-
}>>;
|
|
652
|
-
subjectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
653
|
-
ownerId: z.ZodOptional<z.ZodString>;
|
|
654
|
-
dueDateFrom: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
655
|
-
dueDateTo: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
656
|
-
}, z.core.$strip>;
|
|
657
|
-
type PlanActivityDto = z.infer<typeof planActivitySchema>;
|
|
658
|
-
type CancelActivityDto = z.infer<typeof cancelActivitySchema>;
|
|
659
|
-
//#endregion
|
|
660
|
-
//#region src/validators/note.schema.d.ts
|
|
661
|
-
declare const addNoteSchema: z.ZodObject<{
|
|
662
|
-
subjectKind: z.ZodEnum<{
|
|
663
|
-
lead: "lead";
|
|
664
|
-
opportunity: "opportunity";
|
|
665
|
-
contact: "contact";
|
|
666
|
-
account: "account";
|
|
667
|
-
}>;
|
|
668
|
-
subjectId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
669
|
-
body: z.ZodString;
|
|
670
|
-
authorId: z.ZodOptional<z.ZodString>;
|
|
671
|
-
pinned: z.ZodOptional<z.ZodBoolean>;
|
|
672
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
673
|
-
}, z.core.$strip>;
|
|
674
|
-
declare const updateNoteSchema: z.ZodObject<{
|
|
675
|
-
body: z.ZodOptional<z.ZodString>;
|
|
676
|
-
pinned: z.ZodOptional<z.ZodBoolean>;
|
|
677
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
678
|
-
}, z.core.$strip>;
|
|
679
|
-
declare const noteFilterSchema: z.ZodObject<{
|
|
680
|
-
subjectKind: z.ZodOptional<z.ZodEnum<{
|
|
681
|
-
lead: "lead";
|
|
682
|
-
opportunity: "opportunity";
|
|
683
|
-
contact: "contact";
|
|
684
|
-
account: "account";
|
|
685
|
-
}>>;
|
|
686
|
-
subjectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
687
|
-
authorId: z.ZodOptional<z.ZodString>;
|
|
688
|
-
pinned: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
|
|
689
|
-
}, z.core.$strip>;
|
|
690
|
-
type AddNoteDto = z.infer<typeof addNoteSchema>;
|
|
691
|
-
type UpdateNoteDto = z.infer<typeof updateNoteSchema>;
|
|
692
|
-
//#endregion
|
|
693
|
-
//#region src/validators/loss-reason.schema.d.ts
|
|
694
|
-
declare const createLossReasonSchema: z.ZodObject<{
|
|
695
|
-
name: z.ZodString;
|
|
696
|
-
description: z.ZodOptional<z.ZodString>;
|
|
697
|
-
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
698
|
-
sequence: z.ZodOptional<z.ZodNumber>;
|
|
699
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
700
|
-
}, z.core.$strip>;
|
|
701
|
-
declare const updateLossReasonSchema: z.ZodObject<{
|
|
702
|
-
name: z.ZodOptional<z.ZodString>;
|
|
703
|
-
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
704
|
-
isActive: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
705
|
-
sequence: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
706
|
-
metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
707
|
-
}, z.core.$strip>;
|
|
708
|
-
declare const lossReasonFilterSchema: z.ZodObject<{
|
|
709
|
-
isActive: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
|
|
710
|
-
}, z.core.$strip>;
|
|
711
|
-
type CreateLossReasonDto = z.infer<typeof createLossReasonSchema>;
|
|
712
|
-
type UpdateLossReasonDto = z.infer<typeof updateLossReasonSchema>;
|
|
713
|
-
//#endregion
|
|
714
|
-
//#region src/validators/email-event.schema.d.ts
|
|
715
|
-
declare const recordEmailEventSchema: z.ZodObject<{
|
|
716
|
-
subjectKind: z.ZodEnum<{
|
|
717
|
-
contact: "contact";
|
|
718
|
-
subscription: "subscription";
|
|
719
|
-
}>;
|
|
720
|
-
subjectId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
721
|
-
campaignId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
722
|
-
messageId: z.ZodOptional<z.ZodString>;
|
|
723
|
-
url: z.ZodOptional<z.ZodString>;
|
|
724
|
-
userAgent: z.ZodOptional<z.ZodString>;
|
|
725
|
-
ip: z.ZodOptional<z.ZodString>;
|
|
726
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
727
|
-
}, z.core.$strip>;
|
|
728
|
-
declare const emailEventFilterSchema: z.ZodObject<{
|
|
729
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
730
|
-
open: "open";
|
|
731
|
-
click: "click";
|
|
732
|
-
bounce: "bounce";
|
|
733
|
-
complaint: "complaint";
|
|
734
|
-
unsubscribe: "unsubscribe";
|
|
735
|
-
}>>;
|
|
736
|
-
subjectKind: z.ZodOptional<z.ZodEnum<{
|
|
737
|
-
contact: "contact";
|
|
738
|
-
subscription: "subscription";
|
|
739
|
-
}>>;
|
|
740
|
-
subjectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
741
|
-
campaignId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
742
|
-
messageId: z.ZodOptional<z.ZodString>;
|
|
743
|
-
}, z.core.$strip>;
|
|
744
|
-
type RecordEmailEventDto = z.infer<typeof recordEmailEventSchema>;
|
|
745
|
-
//#endregion
|
|
746
|
-
export { ACTIVITY_MACHINE, ACTIVITY_STATUSES, ACTIVITY_TRANSITIONS, ACTIVITY_TYPES, AccountAssigned, AccountCreated, AccountEnriched, AccountMerged, AccountRepository, AccountRepositoryDeps, AccountUpdated, ActivityCancelled, ActivityCompleted, ActivityOutcomeRecorded, ActivityPlanned, ActivityRepository, ActivityRepositoryDeps, ActivityRescheduled, type ActivityStatus, type ActivityType, CAMPAIGN_MACHINE, CAMPAIGN_STATUSES, CAMPAIGN_TRANSITIONS, CONVERSATION_CHANNELS, CONVERSATION_PARTICIPANT_KINDS, CONVERSATION_STATUSES, CRM_EVENTS, CRM_MODEL_NAMES, CampaignActivated, CampaignArchived, CampaignCompleted, CampaignCreated, CampaignPaused, CampaignRepository, CampaignRepositoryDeps, CampaignResumed, type CampaignStatus, CloseInput, ContactAssigned, ContactCreated, ContactEnriched, ContactMerged, ContactRepository, ContactRepositoryDeps, ContactUpdated, ConversationAssigned, type ConversationChannel, ConversationCreated, type ConversationParticipantKind, ConversationReopened, ConversationRepository, ConversationRepositoryDeps, ConversationResolved, type ConversationStatus, ConversionRow, ConvertLeadInput, ConvertResult, CreateCrmRepositoriesDeps, CreateModelsOptions, CrmConfig, CrmContext, CrmEngine, CrmError, CrmEventDefinition, CrmEventName, CrmEventSchema, CrmLogger, CrmModels, CrmRepositories, DuplicateCampaignError, DuplicateLeadError, DuplicateSubscriptionError, EMAIL_EVENT_KINDS, EMAIL_EVENT_SUBJECT_KINDS, EmailEventBounced, EmailEventClicked, EmailEventComplained, type EmailEventKind, EmailEventOpened, EmailEventRepository, EmailEventRepositoryDeps, EmailEventSubjectKind, EmailEventUnsubscribed, EmptyPipelineError, ForecastOptions, ForecastRow, IAccountDocument, IActivityDocument, ICampaignDocument, ICampaignStatusEntry, IContactDocument, IContactInfoEmbedded, IContactName, IConversationDocument, IEmailEventDocument, ILeadDocument, ILeadStatusEntry, ILossReasonDocument, IMessageAttachment, IMessageDocument, INoteDocument, IOpportunityDocument, IOpportunityStatusEntry, IPipelineDocument, IStageDocument, ISubscriptionDocument, ISubscriptionStatusEntry, InProcessCrmBus, InvalidActivityTransitionError, InvalidCampaignTransitionError, InvalidConfirmationTokenError, InvalidLeadTransitionError, InvalidOpportunityTransitionError, InvalidSubscriptionTransitionError, InvalidUnsubscribeTokenError, LEAD_MACHINE, LEAD_STATUSES, LEAD_TRANSITIONS, LeadAlreadyConvertedError, LeadAssigned, LeadConverted, LeadCreated, LeadDisqualified, LeadEnriched, LeadInput, LeadRepository, LeadRepositoryDeps, LeadScored, LeadScorer, LeadService, LeadServiceDeps, type LeadStatus, LeadStatusChanged, LossReasonRepository, LossReasonRepositoryDeps, MESSAGE_DELIVERY_STATUSES, MESSAGE_DIRECTIONS, MergeAccountInput, MergeContactInput, type MessageDeliveryStatus, type MessageDirection, MessageReceived, MessageRepository, MessageRepositoryDeps, MessageSent, MoveStageInput, NotFoundError, NoteAdded, NoteRepository, NoteRepositoryDeps, OPPORTUNITY_MACHINE, OPPORTUNITY_STATUSES, OPPORTUNITY_TRANSITIONS, OpenConversationInput, OpenOpportunityInput, OpportunityAbandoned, OpportunityAmountChanged, OpportunityAssigned, OpportunityCreated, OpportunityExtended, OpportunityForecast, OpportunityLost, OpportunityRepository, OpportunityRepositoryDeps, OpportunityStageAdvanced, OpportunityStageRegressed, type OpportunityStatus, OpportunityWon, PipelineArchived, PipelineCreated, PipelineRepository, PipelineRepositoryDeps, RecordEmailEventInput, RecordMessageInput, ResolvedCrmConfig, SUBJECT_KINDS, SUBSCRIPTION_MACHINE, SUBSCRIPTION_STATUSES, SUBSCRIPTION_TRANSITIONS, SchemaBuildConfig, StageNotInPipelineError, type StatusChangeEntry, type StatusHistory, type SubjectKind, SubscribeInput, SubscriptionBounced, SubscriptionComplained, SubscriptionConfirmed, SubscriptionCreated, SubscriptionRepository, SubscriptionRepositoryDeps, type SubscriptionStatus, SubscriptionUnsubscribed, TenantFieldType, _ModelTypes, appendStatus, buildAccountSchema, buildActivitySchema, buildCampaignSchema, buildContactSchema, buildConversationSchema, buildEmailEventSchema, buildLeadSchema, buildLossReasonSchema, buildMessageSchema, buildNoteSchema, buildOpportunitySchema, buildPipelineSchema, buildSubscriptionSchema, canTransitionActivity, canTransitionCampaign, canTransitionLead, canTransitionOpportunity, canTransitionSubscription, composeScorers, createAccountModel, createActivityModel, createCampaignModel, createContactModel, createConversationModel, createCrm, createCrmModels, createCrmRepositories, createEmailEventModel, createEvent, createLeadModel, createLossReasonModel, createMessageModel, createNoteModel, createOpportunityModel, createPipelineModel, createSubscriptionModel, crmEventDefinitions, defaultLeadScorer, forecast, lastTransitionTo, latestEntry, pipelineConversion, tenantFieldDef, timeInStatus, index_d_exports as validators };
|