@classytic/crm 1.1.1 → 1.2.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/dist/events.d.ts CHANGED
@@ -8,79 +8,79 @@ import "@classytic/primitives/outbox";
8
8
  import "@classytic/repo-core/tenant";
9
9
  //#region src/events/event-constants.d.ts
10
10
  /** PACKAGE_RULES rule 12: `package:resource.verb`. */
11
- declare const CRM_EVENTS: {
12
- readonly LEAD_CREATED: "crm:lead.created";
13
- readonly LEAD_STATUS_CHANGED: "crm:lead.status_changed";
14
- readonly LEAD_SCORED: "crm:lead.scored";
15
- readonly LEAD_CONVERTED: "crm:lead.converted";
16
- readonly LEAD_DISQUALIFIED: "crm:lead.disqualified";
17
- readonly ACCOUNT_CREATED: "crm:account.created";
18
- readonly ACCOUNT_UPDATED: "crm:account.updated";
19
- readonly CONTACT_CREATED: "crm:contact.created";
20
- readonly CONTACT_UPDATED: "crm:contact.updated";
21
- readonly OPPORTUNITY_CREATED: "crm:opportunity.created";
22
- readonly OPPORTUNITY_STAGE_ADVANCED: "crm:opportunity.stage_advanced";
23
- readonly OPPORTUNITY_STAGE_REGRESSED: "crm:opportunity.stage_regressed";
24
- readonly OPPORTUNITY_WON: "crm:opportunity.won";
25
- readonly OPPORTUNITY_LOST: "crm:opportunity.lost";
26
- readonly OPPORTUNITY_ABANDONED: "crm:opportunity.abandoned";
27
- readonly PIPELINE_CREATED: "crm:pipeline.created";
28
- readonly PIPELINE_ARCHIVED: "crm:pipeline.archived";
29
- readonly ACTIVITY_PLANNED: "crm:activity.planned";
30
- readonly ACTIVITY_COMPLETED: "crm:activity.completed";
31
- readonly ACTIVITY_CANCELLED: "crm:activity.cancelled";
32
- readonly NOTE_ADDED: "crm:note.added";
33
- readonly CAMPAIGN_CREATED: "crm:campaign.created";
34
- readonly CAMPAIGN_ACTIVATED: "crm:campaign.activated";
35
- readonly CAMPAIGN_PAUSED: "crm:campaign.paused";
36
- readonly CAMPAIGN_RESUMED: "crm:campaign.resumed";
37
- readonly CAMPAIGN_COMPLETED: "crm:campaign.completed";
38
- readonly CAMPAIGN_ARCHIVED: "crm:campaign.archived";
39
- readonly SUBSCRIPTION_CREATED: "crm:subscription.created";
40
- readonly SUBSCRIPTION_CONFIRMED: "crm:subscription.confirmed";
41
- readonly SUBSCRIPTION_UNSUBSCRIBED: "crm:subscription.unsubscribed";
42
- readonly SUBSCRIPTION_BOUNCED: "crm:subscription.bounced";
43
- readonly SUBSCRIPTION_COMPLAINED: "crm:subscription.complained";
44
- readonly SEQUENCE_CREATED: "crm:sequence.created";
45
- readonly SEQUENCE_ACTIVATED: "crm:sequence.active";
46
- readonly SEQUENCE_PAUSED: "crm:sequence.paused";
47
- readonly SEQUENCE_ARCHIVED: "crm:sequence.archived";
48
- readonly ENROLLMENT_CREATED: "crm:enrollment.created";
49
- readonly ENROLLMENT_STEP_SENT: "crm:enrollment.step_sent";
50
- readonly ENROLLMENT_PAUSED: "crm:enrollment.paused";
51
- readonly ENROLLMENT_RESUMED: "crm:enrollment.resumed";
52
- readonly ENROLLMENT_COMPLETED: "crm:enrollment.completed";
53
- readonly ENROLLMENT_EXITED: "crm:enrollment.exited";
54
- readonly EMAIL_EVENT_OPENED: "crm:email_event.opened";
55
- readonly EMAIL_EVENT_CLICKED: "crm:email_event.clicked";
56
- readonly EMAIL_EVENT_BOUNCED: "crm:email_event.bounced";
57
- readonly EMAIL_EVENT_COMPLAINED: "crm:email_event.complained";
58
- readonly EMAIL_EVENT_UNSUBSCRIBED: "crm:email_event.unsubscribed";
59
- readonly LEAD_ENRICHED: "crm:lead.enriched";
60
- readonly LEAD_ASSIGNED: "crm:lead.assigned";
61
- readonly LEAD_ANONYMIZED: "crm:lead.anonymized";
62
- readonly CONTACT_ENRICHED: "crm:contact.enriched";
63
- readonly CONTACT_ASSIGNED: "crm:contact.assigned";
64
- readonly CONTACT_MERGED: "crm:contact.merged";
65
- readonly CONTACT_ANONYMIZED: "crm:contact.anonymized";
66
- readonly ACCOUNT_ENRICHED: "crm:account.enriched";
67
- readonly ACCOUNT_ASSIGNED: "crm:account.assigned";
68
- readonly ACCOUNT_MERGED: "crm:account.merged";
69
- readonly OPPORTUNITY_ASSIGNED: "crm:opportunity.assigned";
70
- readonly OPPORTUNITY_AMOUNT_CHANGED: "crm:opportunity.amount_changed";
71
- readonly OPPORTUNITY_EXTENDED: "crm:opportunity.extended";
72
- readonly ACTIVITY_RESCHEDULED: "crm:activity.rescheduled";
73
- readonly ACTIVITY_OUTCOME_RECORDED: "crm:activity.outcome_recorded";
74
- readonly SUPPRESSION_ADDED: "crm:suppression.added";
75
- readonly SUPPRESSION_REMOVED: "crm:suppression.removed";
76
- readonly CONVERSATION_CREATED: "crm:conversation.created";
77
- readonly CONVERSATION_ASSIGNED: "crm:conversation.assigned";
78
- readonly CONVERSATION_RESOLVED: "crm:conversation.resolved";
79
- readonly CONVERSATION_REOPENED: "crm:conversation.reopened";
80
- readonly MESSAGE_RECEIVED: "crm:message.received";
81
- readonly MESSAGE_SENT: "crm:message.sent";
11
+ export declare const CRM_EVENTS: {
12
+ readonly LEAD_CREATED: 'crm:lead.created';
13
+ readonly LEAD_STATUS_CHANGED: 'crm:lead.status_changed';
14
+ readonly LEAD_SCORED: 'crm:lead.scored';
15
+ readonly LEAD_CONVERTED: 'crm:lead.converted';
16
+ readonly LEAD_DISQUALIFIED: 'crm:lead.disqualified';
17
+ readonly ACCOUNT_CREATED: 'crm:account.created';
18
+ readonly ACCOUNT_UPDATED: 'crm:account.updated';
19
+ readonly CONTACT_CREATED: 'crm:contact.created';
20
+ readonly CONTACT_UPDATED: 'crm:contact.updated';
21
+ readonly OPPORTUNITY_CREATED: 'crm:opportunity.created';
22
+ readonly OPPORTUNITY_STAGE_ADVANCED: 'crm:opportunity.stage_advanced';
23
+ readonly OPPORTUNITY_STAGE_REGRESSED: 'crm:opportunity.stage_regressed';
24
+ readonly OPPORTUNITY_WON: 'crm:opportunity.won';
25
+ readonly OPPORTUNITY_LOST: 'crm:opportunity.lost';
26
+ readonly OPPORTUNITY_ABANDONED: 'crm:opportunity.abandoned';
27
+ readonly PIPELINE_CREATED: 'crm:pipeline.created';
28
+ readonly PIPELINE_ARCHIVED: 'crm:pipeline.archived';
29
+ readonly ACTIVITY_PLANNED: 'crm:activity.planned';
30
+ readonly ACTIVITY_COMPLETED: 'crm:activity.completed';
31
+ readonly ACTIVITY_CANCELLED: 'crm:activity.cancelled';
32
+ readonly NOTE_ADDED: 'crm:note.added';
33
+ readonly CAMPAIGN_CREATED: 'crm:campaign.created';
34
+ readonly CAMPAIGN_ACTIVATED: 'crm:campaign.activated';
35
+ readonly CAMPAIGN_PAUSED: 'crm:campaign.paused';
36
+ readonly CAMPAIGN_RESUMED: 'crm:campaign.resumed';
37
+ readonly CAMPAIGN_COMPLETED: 'crm:campaign.completed';
38
+ readonly CAMPAIGN_ARCHIVED: 'crm:campaign.archived';
39
+ readonly SUBSCRIPTION_CREATED: 'crm:subscription.created';
40
+ readonly SUBSCRIPTION_CONFIRMED: 'crm:subscription.confirmed';
41
+ readonly SUBSCRIPTION_UNSUBSCRIBED: 'crm:subscription.unsubscribed';
42
+ readonly SUBSCRIPTION_BOUNCED: 'crm:subscription.bounced';
43
+ readonly SUBSCRIPTION_COMPLAINED: 'crm:subscription.complained';
44
+ readonly SEQUENCE_CREATED: 'crm:sequence.created';
45
+ readonly SEQUENCE_ACTIVATED: 'crm:sequence.active';
46
+ readonly SEQUENCE_PAUSED: 'crm:sequence.paused';
47
+ readonly SEQUENCE_ARCHIVED: 'crm:sequence.archived';
48
+ readonly ENROLLMENT_CREATED: 'crm:enrollment.created';
49
+ readonly ENROLLMENT_STEP_SENT: 'crm:enrollment.step_sent';
50
+ readonly ENROLLMENT_PAUSED: 'crm:enrollment.paused';
51
+ readonly ENROLLMENT_RESUMED: 'crm:enrollment.resumed';
52
+ readonly ENROLLMENT_COMPLETED: 'crm:enrollment.completed';
53
+ readonly ENROLLMENT_EXITED: 'crm:enrollment.exited';
54
+ readonly EMAIL_EVENT_OPENED: 'crm:email_event.opened';
55
+ readonly EMAIL_EVENT_CLICKED: 'crm:email_event.clicked';
56
+ readonly EMAIL_EVENT_BOUNCED: 'crm:email_event.bounced';
57
+ readonly EMAIL_EVENT_COMPLAINED: 'crm:email_event.complained';
58
+ readonly EMAIL_EVENT_UNSUBSCRIBED: 'crm:email_event.unsubscribed';
59
+ readonly LEAD_ENRICHED: 'crm:lead.enriched';
60
+ readonly LEAD_ASSIGNED: 'crm:lead.assigned';
61
+ readonly LEAD_ANONYMIZED: 'crm:lead.anonymized';
62
+ readonly CONTACT_ENRICHED: 'crm:contact.enriched';
63
+ readonly CONTACT_ASSIGNED: 'crm:contact.assigned';
64
+ readonly CONTACT_MERGED: 'crm:contact.merged';
65
+ readonly CONTACT_ANONYMIZED: 'crm:contact.anonymized';
66
+ readonly ACCOUNT_ENRICHED: 'crm:account.enriched';
67
+ readonly ACCOUNT_ASSIGNED: 'crm:account.assigned';
68
+ readonly ACCOUNT_MERGED: 'crm:account.merged';
69
+ readonly OPPORTUNITY_ASSIGNED: 'crm:opportunity.assigned';
70
+ readonly OPPORTUNITY_AMOUNT_CHANGED: 'crm:opportunity.amount_changed';
71
+ readonly OPPORTUNITY_EXTENDED: 'crm:opportunity.extended';
72
+ readonly ACTIVITY_RESCHEDULED: 'crm:activity.rescheduled';
73
+ readonly ACTIVITY_OUTCOME_RECORDED: 'crm:activity.outcome_recorded';
74
+ readonly SUPPRESSION_ADDED: 'crm:suppression.added';
75
+ readonly SUPPRESSION_REMOVED: 'crm:suppression.removed';
76
+ readonly CONVERSATION_CREATED: 'crm:conversation.created';
77
+ readonly CONVERSATION_ASSIGNED: 'crm:conversation.assigned';
78
+ readonly CONVERSATION_RESOLVED: 'crm:conversation.resolved';
79
+ readonly CONVERSATION_REOPENED: 'crm:conversation.reopened';
80
+ readonly MESSAGE_RECEIVED: 'crm:message.received';
81
+ readonly MESSAGE_SENT: 'crm:message.sent';
82
82
  };
83
- type CrmEventName = (typeof CRM_EVENTS)[keyof typeof CRM_EVENTS];
83
+ export type CrmEventName = (typeof CRM_EVENTS)[keyof typeof CRM_EVENTS];
84
84
  //#endregion
85
85
  //#region src/events/event-catalog.d.ts
86
86
  /**
@@ -100,7 +100,7 @@ type CrmEventName = (typeof CRM_EVENTS)[keyof typeof CRM_EVENTS];
100
100
  * build. A kernel must not import arc, which is why the claim can only be
101
101
  * checked where both are visible.
102
102
  */
103
- interface CrmEventSchema {
103
+ export interface CrmEventSchema {
104
104
  type: 'object';
105
105
  properties?: Record<string, {
106
106
  type?: string;
@@ -110,7 +110,7 @@ interface CrmEventSchema {
110
110
  [key: string]: unknown;
111
111
  }
112
112
  /** Structurally assignable to arc's `EventDefinitionOutput` — do NOT import arc. */
113
- interface CrmEventDefinition<TSchema extends z.ZodType = z.ZodType> {
113
+ export interface CrmEventDefinition<TSchema extends z.ZodType = z.ZodType> {
114
114
  name: CrmEventName;
115
115
  version: number;
116
116
  description: string;
@@ -118,62 +118,62 @@ interface CrmEventDefinition<TSchema extends z.ZodType = z.ZodType> {
118
118
  schema: CrmEventSchema;
119
119
  create(payload: z.infer<TSchema>, meta?: Partial<EventMeta>): DomainEvent<z.infer<TSchema>>;
120
120
  }
121
- declare const LeadCreated: CrmEventDefinition<z.ZodObject<{
121
+ export declare const LeadCreated: CrmEventDefinition<z.ZodObject<{
122
122
  leadId: z.ZodString;
123
123
  email: z.ZodOptional<z.ZodString>;
124
124
  score: z.ZodNumber;
125
125
  }, z.core.$strip>>;
126
- declare const LeadStatusChanged: CrmEventDefinition<z.ZodObject<{
126
+ export declare const LeadStatusChanged: CrmEventDefinition<z.ZodObject<{
127
127
  leadId: z.ZodString;
128
128
  from: z.ZodString;
129
129
  to: z.ZodString;
130
130
  }, z.core.$strip>>;
131
- declare const LeadScored: CrmEventDefinition<z.ZodObject<{
131
+ export declare const LeadScored: CrmEventDefinition<z.ZodObject<{
132
132
  leadId: z.ZodString;
133
133
  score: z.ZodNumber;
134
134
  }, z.core.$strip>>;
135
- declare const LeadConverted: CrmEventDefinition<z.ZodObject<{
135
+ export declare const LeadConverted: CrmEventDefinition<z.ZodObject<{
136
136
  leadId: z.ZodString;
137
137
  contactId: z.ZodString;
138
138
  accountId: z.ZodOptional<z.ZodString>;
139
139
  opportunityId: z.ZodString;
140
140
  }, z.core.$strip>>;
141
- declare const LeadDisqualified: CrmEventDefinition<z.ZodObject<{
141
+ export declare const LeadDisqualified: CrmEventDefinition<z.ZodObject<{
142
142
  leadId: z.ZodString;
143
143
  reason: z.ZodString;
144
144
  }, z.core.$strip>>;
145
- declare const LeadEnriched: CrmEventDefinition<z.ZodObject<{
146
- leadId: z.ZodString;
145
+ export declare const LeadEnriched: CrmEventDefinition<z.ZodObject<{
147
146
  fields: z.ZodArray<z.ZodString>;
148
147
  provider: z.ZodOptional<z.ZodString>;
149
- }, z.core.$strip>>;
150
- declare const LeadAssigned: CrmEventDefinition<z.ZodObject<{
151
148
  leadId: z.ZodString;
149
+ }, z.core.$strip>>;
150
+ export declare const LeadAssigned: CrmEventDefinition<z.ZodObject<{
152
151
  ownerId: z.ZodString;
153
152
  previousOwnerId: z.ZodOptional<z.ZodString>;
153
+ leadId: z.ZodString;
154
154
  }, z.core.$strip>>;
155
- declare const LeadAnonymized: CrmEventDefinition<z.ZodObject<{
155
+ export declare const LeadAnonymized: CrmEventDefinition<z.ZodObject<{
156
156
  leadId: z.ZodString;
157
157
  fields: z.ZodArray<z.ZodString>;
158
158
  }, z.core.$strip>>;
159
- declare const AccountCreated: CrmEventDefinition<z.ZodObject<{
159
+ export declare const AccountCreated: CrmEventDefinition<z.ZodObject<{
160
160
  accountId: z.ZodString;
161
161
  name: z.ZodString;
162
162
  }, z.core.$strip>>;
163
- declare const AccountUpdated: CrmEventDefinition<z.ZodObject<{
163
+ export declare const AccountUpdated: CrmEventDefinition<z.ZodObject<{
164
164
  accountId: z.ZodString;
165
165
  }, z.core.$strip>>;
166
- declare const AccountEnriched: CrmEventDefinition<z.ZodObject<{
167
- accountId: z.ZodString;
166
+ export declare const AccountEnriched: CrmEventDefinition<z.ZodObject<{
168
167
  fields: z.ZodArray<z.ZodString>;
169
168
  provider: z.ZodOptional<z.ZodString>;
170
- }, z.core.$strip>>;
171
- declare const AccountAssigned: CrmEventDefinition<z.ZodObject<{
172
169
  accountId: z.ZodString;
170
+ }, z.core.$strip>>;
171
+ export declare const AccountAssigned: CrmEventDefinition<z.ZodObject<{
173
172
  ownerId: z.ZodString;
174
173
  previousOwnerId: z.ZodOptional<z.ZodString>;
174
+ accountId: z.ZodString;
175
175
  }, z.core.$strip>>;
176
- declare const AccountMerged: CrmEventDefinition<z.ZodObject<{
176
+ export declare const AccountMerged: CrmEventDefinition<z.ZodObject<{
177
177
  primaryId: z.ZodString;
178
178
  secondaryId: z.ZodString;
179
179
  strategy: z.ZodEnum<{
@@ -181,24 +181,24 @@ declare const AccountMerged: CrmEventDefinition<z.ZodObject<{
181
181
  preferSecondary: "preferSecondary";
182
182
  }>;
183
183
  }, z.core.$strip>>;
184
- declare const ContactCreated: CrmEventDefinition<z.ZodObject<{
184
+ export declare const ContactCreated: CrmEventDefinition<z.ZodObject<{
185
185
  contactId: z.ZodString;
186
186
  email: z.ZodOptional<z.ZodString>;
187
187
  }, z.core.$strip>>;
188
- declare const ContactUpdated: CrmEventDefinition<z.ZodObject<{
188
+ export declare const ContactUpdated: CrmEventDefinition<z.ZodObject<{
189
189
  contactId: z.ZodString;
190
190
  }, z.core.$strip>>;
191
- declare const ContactEnriched: CrmEventDefinition<z.ZodObject<{
192
- contactId: z.ZodString;
191
+ export declare const ContactEnriched: CrmEventDefinition<z.ZodObject<{
193
192
  fields: z.ZodArray<z.ZodString>;
194
193
  provider: z.ZodOptional<z.ZodString>;
195
- }, z.core.$strip>>;
196
- declare const ContactAssigned: CrmEventDefinition<z.ZodObject<{
197
194
  contactId: z.ZodString;
195
+ }, z.core.$strip>>;
196
+ export declare const ContactAssigned: CrmEventDefinition<z.ZodObject<{
198
197
  ownerId: z.ZodString;
199
198
  previousOwnerId: z.ZodOptional<z.ZodString>;
199
+ contactId: z.ZodString;
200
200
  }, z.core.$strip>>;
201
- declare const ContactMerged: CrmEventDefinition<z.ZodObject<{
201
+ export declare const ContactMerged: CrmEventDefinition<z.ZodObject<{
202
202
  primaryId: z.ZodString;
203
203
  secondaryId: z.ZodString;
204
204
  strategy: z.ZodEnum<{
@@ -206,16 +206,16 @@ declare const ContactMerged: CrmEventDefinition<z.ZodObject<{
206
206
  preferSecondary: "preferSecondary";
207
207
  }>;
208
208
  }, z.core.$strip>>;
209
- declare const ContactAnonymized: CrmEventDefinition<z.ZodObject<{
209
+ export declare const ContactAnonymized: CrmEventDefinition<z.ZodObject<{
210
210
  contactId: z.ZodString;
211
211
  fields: z.ZodArray<z.ZodString>;
212
212
  }, z.core.$strip>>;
213
- declare const OpportunityCreated: CrmEventDefinition<z.ZodObject<{
213
+ export declare const OpportunityCreated: CrmEventDefinition<z.ZodObject<{
214
214
  opportunityId: z.ZodString;
215
215
  pipelineId: z.ZodString;
216
216
  stageId: z.ZodString;
217
217
  }, z.core.$strip>>;
218
- declare const OpportunityStageAdvanced: CrmEventDefinition<z.ZodObject<{
218
+ export declare const OpportunityStageAdvanced: CrmEventDefinition<z.ZodObject<{
219
219
  opportunityId: z.ZodString;
220
220
  from: z.ZodObject<{
221
221
  stageId: z.ZodString;
@@ -226,7 +226,7 @@ declare const OpportunityStageAdvanced: CrmEventDefinition<z.ZodObject<{
226
226
  sequence: z.ZodNumber;
227
227
  }, z.core.$strip>;
228
228
  }, z.core.$strip>>;
229
- declare const OpportunityStageRegressed: CrmEventDefinition<z.ZodObject<{
229
+ export declare const OpportunityStageRegressed: CrmEventDefinition<z.ZodObject<{
230
230
  opportunityId: z.ZodString;
231
231
  from: z.ZodObject<{
232
232
  stageId: z.ZodString;
@@ -237,242 +237,242 @@ declare const OpportunityStageRegressed: CrmEventDefinition<z.ZodObject<{
237
237
  sequence: z.ZodNumber;
238
238
  }, z.core.$strip>;
239
239
  }, z.core.$strip>>;
240
- declare const OpportunityWon: CrmEventDefinition<z.ZodObject<{
240
+ export declare const OpportunityWon: CrmEventDefinition<z.ZodObject<{
241
241
  opportunityId: z.ZodString;
242
242
  amount: z.ZodOptional<z.ZodNumber>;
243
243
  }, z.core.$strip>>;
244
- declare const OpportunityLost: CrmEventDefinition<z.ZodObject<{
244
+ export declare const OpportunityLost: CrmEventDefinition<z.ZodObject<{
245
245
  opportunityId: z.ZodString;
246
246
  lostReasonId: z.ZodOptional<z.ZodString>;
247
247
  }, z.core.$strip>>;
248
- declare const OpportunityAbandoned: CrmEventDefinition<z.ZodObject<{
248
+ export declare const OpportunityAbandoned: CrmEventDefinition<z.ZodObject<{
249
249
  opportunityId: z.ZodString;
250
250
  }, z.core.$strip>>;
251
- declare const OpportunityAssigned: CrmEventDefinition<z.ZodObject<{
252
- opportunityId: z.ZodString;
251
+ export declare const OpportunityAssigned: CrmEventDefinition<z.ZodObject<{
253
252
  ownerId: z.ZodString;
254
253
  previousOwnerId: z.ZodOptional<z.ZodString>;
254
+ opportunityId: z.ZodString;
255
255
  }, z.core.$strip>>;
256
- declare const OpportunityAmountChanged: CrmEventDefinition<z.ZodObject<{
256
+ export declare const OpportunityAmountChanged: CrmEventDefinition<z.ZodObject<{
257
257
  opportunityId: z.ZodString;
258
258
  amount: z.ZodNumber;
259
259
  previousAmount: z.ZodOptional<z.ZodNumber>;
260
260
  reason: z.ZodOptional<z.ZodString>;
261
261
  by: z.ZodOptional<z.ZodString>;
262
262
  }, z.core.$strip>>;
263
- declare const OpportunityExtended: CrmEventDefinition<z.ZodObject<{
263
+ export declare const OpportunityExtended: CrmEventDefinition<z.ZodObject<{
264
264
  opportunityId: z.ZodString;
265
265
  expectedCloseAt: z.ZodISODateTime;
266
266
  previousExpectedCloseAt: z.ZodOptional<z.ZodISODateTime>;
267
267
  reason: z.ZodOptional<z.ZodString>;
268
268
  by: z.ZodOptional<z.ZodString>;
269
269
  }, z.core.$strip>>;
270
- declare const PipelineCreated: CrmEventDefinition<z.ZodObject<{
270
+ export declare const PipelineCreated: CrmEventDefinition<z.ZodObject<{
271
271
  pipelineId: z.ZodString;
272
272
  }, z.core.$strip>>;
273
- declare const PipelineArchived: CrmEventDefinition<z.ZodObject<{
273
+ export declare const PipelineArchived: CrmEventDefinition<z.ZodObject<{
274
274
  pipelineId: z.ZodString;
275
275
  }, z.core.$strip>>;
276
- declare const ActivityPlanned: CrmEventDefinition<z.ZodObject<{
276
+ export declare const ActivityPlanned: CrmEventDefinition<z.ZodObject<{
277
277
  activityId: z.ZodString;
278
278
  type: z.ZodString;
279
279
  subjectKind: z.ZodString;
280
280
  subjectId: z.ZodString;
281
281
  }, z.core.$strip>>;
282
- declare const ActivityCompleted: CrmEventDefinition<z.ZodObject<{
282
+ export declare const ActivityCompleted: CrmEventDefinition<z.ZodObject<{
283
283
  activityId: z.ZodString;
284
284
  completedAt: z.ZodISODateTime;
285
285
  }, z.core.$strip>>;
286
- declare const ActivityCancelled: CrmEventDefinition<z.ZodObject<{
286
+ export declare const ActivityCancelled: CrmEventDefinition<z.ZodObject<{
287
287
  activityId: z.ZodString;
288
288
  reason: z.ZodOptional<z.ZodString>;
289
289
  }, z.core.$strip>>;
290
- declare const ActivityRescheduled: CrmEventDefinition<z.ZodObject<{
290
+ export declare const ActivityRescheduled: CrmEventDefinition<z.ZodObject<{
291
291
  activityId: z.ZodString;
292
292
  dueDate: z.ZodISODateTime;
293
293
  previousDueDate: z.ZodOptional<z.ZodISODateTime>;
294
294
  reason: z.ZodOptional<z.ZodString>;
295
295
  by: z.ZodOptional<z.ZodString>;
296
296
  }, z.core.$strip>>;
297
- declare const ActivityOutcomeRecorded: CrmEventDefinition<z.ZodObject<{
297
+ export declare const ActivityOutcomeRecorded: CrmEventDefinition<z.ZodObject<{
298
298
  activityId: z.ZodString;
299
299
  outcome: z.ZodRecord<z.ZodString, z.ZodUnknown>;
300
300
  }, z.core.$strip>>;
301
- declare const NoteAdded: CrmEventDefinition<z.ZodObject<{
301
+ export declare const NoteAdded: CrmEventDefinition<z.ZodObject<{
302
302
  noteId: z.ZodString;
303
303
  subjectKind: z.ZodString;
304
304
  subjectId: z.ZodString;
305
305
  }, z.core.$strip>>;
306
- declare const CampaignCreated: CrmEventDefinition<z.ZodObject<{
306
+ export declare const CampaignCreated: CrmEventDefinition<z.ZodObject<{
307
307
  campaignId: z.ZodString;
308
308
  name: z.ZodString;
309
309
  }, z.core.$strip>>;
310
- declare const CampaignActivated: CrmEventDefinition<z.ZodObject<{
310
+ export declare const CampaignActivated: CrmEventDefinition<z.ZodObject<{
311
311
  campaignId: z.ZodString;
312
312
  }, z.core.$strip>>;
313
- declare const CampaignPaused: CrmEventDefinition<z.ZodObject<{
313
+ export declare const CampaignPaused: CrmEventDefinition<z.ZodObject<{
314
314
  campaignId: z.ZodString;
315
315
  reason: z.ZodOptional<z.ZodString>;
316
316
  }, z.core.$strip>>;
317
- declare const CampaignResumed: CrmEventDefinition<z.ZodObject<{
317
+ export declare const CampaignResumed: CrmEventDefinition<z.ZodObject<{
318
318
  campaignId: z.ZodString;
319
319
  }, z.core.$strip>>;
320
- declare const CampaignCompleted: CrmEventDefinition<z.ZodObject<{
320
+ export declare const CampaignCompleted: CrmEventDefinition<z.ZodObject<{
321
321
  campaignId: z.ZodString;
322
322
  actualRevenueAmount: z.ZodOptional<z.ZodNumber>;
323
323
  }, z.core.$strip>>;
324
- declare const CampaignArchived: CrmEventDefinition<z.ZodObject<{
324
+ export declare const CampaignArchived: CrmEventDefinition<z.ZodObject<{
325
325
  campaignId: z.ZodString;
326
326
  }, z.core.$strip>>;
327
- declare const SubscriptionCreated: CrmEventDefinition<z.ZodObject<{
327
+ export declare const SubscriptionCreated: CrmEventDefinition<z.ZodObject<{
328
328
  subscriptionId: z.ZodString;
329
329
  contactId: z.ZodString;
330
330
  campaignId: z.ZodString;
331
331
  requiresConfirmation: z.ZodBoolean;
332
332
  }, z.core.$strip>>;
333
- declare const SubscriptionConfirmed: CrmEventDefinition<z.ZodObject<{
333
+ export declare const SubscriptionConfirmed: CrmEventDefinition<z.ZodObject<{
334
334
  subscriptionId: z.ZodString;
335
335
  contactId: z.ZodString;
336
336
  campaignId: z.ZodString;
337
337
  confirmedAt: z.ZodISODateTime;
338
338
  }, z.core.$strip>>;
339
- declare const SubscriptionUnsubscribed: CrmEventDefinition<z.ZodObject<{
339
+ export declare const SubscriptionUnsubscribed: CrmEventDefinition<z.ZodObject<{
340
340
  subscriptionId: z.ZodString;
341
341
  contactId: z.ZodString;
342
342
  campaignId: z.ZodString;
343
343
  reason: z.ZodOptional<z.ZodString>;
344
344
  }, z.core.$strip>>;
345
- declare const SubscriptionBounced: CrmEventDefinition<z.ZodObject<{
345
+ export declare const SubscriptionBounced: CrmEventDefinition<z.ZodObject<{
346
346
  subscriptionId: z.ZodString;
347
347
  contactId: z.ZodString;
348
348
  campaignId: z.ZodString;
349
349
  reason: z.ZodOptional<z.ZodString>;
350
350
  }, z.core.$strip>>;
351
- declare const SubscriptionComplained: CrmEventDefinition<z.ZodObject<{
351
+ export declare const SubscriptionComplained: CrmEventDefinition<z.ZodObject<{
352
352
  subscriptionId: z.ZodString;
353
353
  contactId: z.ZodString;
354
354
  campaignId: z.ZodString;
355
355
  }, z.core.$strip>>;
356
- declare const SuppressionAdded: CrmEventDefinition<z.ZodObject<{
356
+ export declare const SuppressionAdded: CrmEventDefinition<z.ZodObject<{
357
357
  email: z.ZodString;
358
358
  reason: z.ZodEnum<{
359
359
  bounce: "bounce";
360
360
  complaint: "complaint";
361
- unsubscribe: "unsubscribe";
362
361
  manual: "manual";
362
+ unsubscribe: "unsubscribe";
363
363
  }>;
364
364
  source: z.ZodOptional<z.ZodString>;
365
365
  }, z.core.$strip>>;
366
- declare const SuppressionRemoved: CrmEventDefinition<z.ZodObject<{
366
+ export declare const SuppressionRemoved: CrmEventDefinition<z.ZodObject<{
367
367
  email: z.ZodString;
368
368
  }, z.core.$strip>>;
369
- declare const EmailEventOpened: CrmEventDefinition<z.ZodObject<{
369
+ export declare const EmailEventOpened: CrmEventDefinition<z.ZodObject<{
370
370
  eventId: z.ZodString;
371
371
  kind: z.ZodString;
372
372
  subjectKind: z.ZodString;
373
373
  subjectId: z.ZodString;
374
374
  campaignId: z.ZodOptional<z.ZodString>;
375
375
  }, z.core.$strip>>;
376
- declare const EmailEventClicked: CrmEventDefinition<z.ZodObject<{
376
+ export declare const EmailEventClicked: CrmEventDefinition<z.ZodObject<{
377
377
  eventId: z.ZodString;
378
378
  kind: z.ZodString;
379
379
  subjectKind: z.ZodString;
380
380
  subjectId: z.ZodString;
381
381
  campaignId: z.ZodOptional<z.ZodString>;
382
382
  }, z.core.$strip>>;
383
- declare const EmailEventBounced: CrmEventDefinition<z.ZodObject<{
383
+ export declare const EmailEventBounced: CrmEventDefinition<z.ZodObject<{
384
384
  eventId: z.ZodString;
385
385
  kind: z.ZodString;
386
386
  subjectKind: z.ZodString;
387
387
  subjectId: z.ZodString;
388
388
  campaignId: z.ZodOptional<z.ZodString>;
389
389
  }, z.core.$strip>>;
390
- declare const EmailEventComplained: CrmEventDefinition<z.ZodObject<{
390
+ export declare const EmailEventComplained: CrmEventDefinition<z.ZodObject<{
391
391
  eventId: z.ZodString;
392
392
  kind: z.ZodString;
393
393
  subjectKind: z.ZodString;
394
394
  subjectId: z.ZodString;
395
395
  campaignId: z.ZodOptional<z.ZodString>;
396
396
  }, z.core.$strip>>;
397
- declare const EmailEventUnsubscribed: CrmEventDefinition<z.ZodObject<{
397
+ export declare const EmailEventUnsubscribed: CrmEventDefinition<z.ZodObject<{
398
398
  eventId: z.ZodString;
399
399
  kind: z.ZodString;
400
400
  subjectKind: z.ZodString;
401
401
  subjectId: z.ZodString;
402
402
  campaignId: z.ZodOptional<z.ZodString>;
403
403
  }, z.core.$strip>>;
404
- declare const ConversationCreated: CrmEventDefinition<z.ZodObject<{
404
+ export declare const ConversationCreated: CrmEventDefinition<z.ZodObject<{
405
405
  conversationId: z.ZodString;
406
406
  channel: z.ZodString;
407
407
  participantKind: z.ZodString;
408
408
  participantId: z.ZodString;
409
409
  }, z.core.$strip>>;
410
- declare const ConversationAssigned: CrmEventDefinition<z.ZodObject<{
410
+ export declare const ConversationAssigned: CrmEventDefinition<z.ZodObject<{
411
411
  conversationId: z.ZodString;
412
412
  assigneeId: z.ZodString;
413
413
  previousAssigneeId: z.ZodOptional<z.ZodString>;
414
414
  }, z.core.$strip>>;
415
- declare const ConversationResolved: CrmEventDefinition<z.ZodObject<{
415
+ export declare const ConversationResolved: CrmEventDefinition<z.ZodObject<{
416
416
  conversationId: z.ZodString;
417
417
  status: z.ZodString;
418
418
  previousStatus: z.ZodString;
419
419
  }, z.core.$strip>>;
420
- declare const ConversationReopened: CrmEventDefinition<z.ZodObject<{
420
+ export declare const ConversationReopened: CrmEventDefinition<z.ZodObject<{
421
421
  conversationId: z.ZodString;
422
422
  status: z.ZodString;
423
423
  previousStatus: z.ZodString;
424
424
  }, z.core.$strip>>;
425
- declare const MessageReceived: CrmEventDefinition<z.ZodObject<{
425
+ export declare const MessageReceived: CrmEventDefinition<z.ZodObject<{
426
426
  messageId: z.ZodString;
427
427
  conversationId: z.ZodString;
428
428
  direction: z.ZodString;
429
429
  externalMessageId: z.ZodOptional<z.ZodString>;
430
430
  }, z.core.$strip>>;
431
- declare const MessageSent: CrmEventDefinition<z.ZodObject<{
431
+ export declare const MessageSent: CrmEventDefinition<z.ZodObject<{
432
432
  messageId: z.ZodString;
433
433
  conversationId: z.ZodString;
434
434
  direction: z.ZodString;
435
435
  externalMessageId: z.ZodOptional<z.ZodString>;
436
436
  }, z.core.$strip>>;
437
- declare const SequenceCreated: CrmEventDefinition<z.ZodObject<{
437
+ export declare const SequenceCreated: CrmEventDefinition<z.ZodObject<{
438
438
  sequenceId: z.ZodString;
439
439
  name: z.ZodOptional<z.ZodString>;
440
440
  }, z.core.$strip>>;
441
- declare const SequenceActivated: CrmEventDefinition<z.ZodObject<{
441
+ export declare const SequenceActivated: CrmEventDefinition<z.ZodObject<{
442
442
  sequenceId: z.ZodString;
443
443
  }, z.core.$strip>>;
444
- declare const SequencePaused: CrmEventDefinition<z.ZodObject<{
444
+ export declare const SequencePaused: CrmEventDefinition<z.ZodObject<{
445
445
  sequenceId: z.ZodString;
446
446
  }, z.core.$strip>>;
447
- declare const SequenceArchived: CrmEventDefinition<z.ZodObject<{
447
+ export declare const SequenceArchived: CrmEventDefinition<z.ZodObject<{
448
448
  sequenceId: z.ZodString;
449
449
  }, z.core.$strip>>;
450
- declare const EnrollmentCreated: CrmEventDefinition<z.ZodObject<{
450
+ export declare const EnrollmentCreated: CrmEventDefinition<z.ZodObject<{
451
451
  enrollmentId: z.ZodString;
452
452
  sequenceId: z.ZodString;
453
453
  subjectId: z.ZodString;
454
454
  subjectKind: z.ZodString;
455
455
  }, z.core.$strip>>;
456
- declare const EnrollmentStepSent: CrmEventDefinition<z.ZodObject<{
456
+ export declare const EnrollmentStepSent: CrmEventDefinition<z.ZodObject<{
457
457
  enrollmentId: z.ZodString;
458
458
  sequenceId: z.ZodOptional<z.ZodString>;
459
459
  stepIndex: z.ZodNumber;
460
460
  channel: z.ZodOptional<z.ZodString>;
461
461
  }, z.core.$strip>>;
462
- declare const EnrollmentPaused: CrmEventDefinition<z.ZodObject<{
462
+ export declare const EnrollmentPaused: CrmEventDefinition<z.ZodObject<{
463
463
  enrollmentId: z.ZodString;
464
464
  }, z.core.$strip>>;
465
- declare const EnrollmentResumed: CrmEventDefinition<z.ZodObject<{
465
+ export declare const EnrollmentResumed: CrmEventDefinition<z.ZodObject<{
466
466
  enrollmentId: z.ZodString;
467
467
  }, z.core.$strip>>;
468
- declare const EnrollmentCompleted: CrmEventDefinition<z.ZodObject<{
468
+ export declare const EnrollmentCompleted: CrmEventDefinition<z.ZodObject<{
469
469
  enrollmentId: z.ZodString;
470
470
  }, z.core.$strip>>;
471
- declare const EnrollmentExited: CrmEventDefinition<z.ZodObject<{
471
+ export declare const EnrollmentExited: CrmEventDefinition<z.ZodObject<{
472
472
  enrollmentId: z.ZodString;
473
473
  exitReason: z.ZodOptional<z.ZodString>;
474
474
  }, z.core.$strip>>;
475
- declare const crmEventDefinitions: ReadonlyArray<CrmEventDefinition>;
475
+ export declare const crmEventDefinitions: ReadonlyArray<CrmEventDefinition>;
476
476
  //#endregion
477
477
  //#region src/engine/engine-types.d.ts
478
478
  interface CrmLogger {
@@ -495,13 +495,13 @@ interface CrmContext extends OperationContext {
495
495
  }
496
496
  //#endregion
497
497
  //#region src/events/helpers.d.ts
498
- declare function createEvent<T>(type: string, payload: T, ctx?: CrmContext, meta?: Partial<EventMeta>): DomainEvent<T>;
498
+ export declare function createEvent<T>(type: string, payload: T, ctx?: CrmContext, meta?: Partial<EventMeta>): DomainEvent<T>;
499
499
  //#endregion
500
500
  //#region src/events/in-process-bus.d.ts
501
- declare class InProcessCrmBus extends InProcessEventBus {
501
+ export declare class InProcessCrmBus extends InProcessEventBus {
502
502
  constructor(options?: {
503
503
  logger?: CrmLogger;
504
504
  });
505
505
  }
506
506
  //#endregion
507
- export { AccountAssigned, AccountCreated, AccountEnriched, AccountMerged, AccountUpdated, ActivityCancelled, ActivityCompleted, ActivityOutcomeRecorded, ActivityPlanned, ActivityRescheduled, CRM_EVENTS, CampaignActivated, CampaignArchived, CampaignCompleted, CampaignCreated, CampaignPaused, CampaignResumed, ContactAnonymized, ContactAssigned, ContactCreated, ContactEnriched, ContactMerged, ContactUpdated, ConversationAssigned, ConversationCreated, ConversationReopened, ConversationResolved, CrmEventDefinition, CrmEventName, CrmEventSchema, EmailEventBounced, EmailEventClicked, EmailEventComplained, EmailEventOpened, EmailEventUnsubscribed, EnrollmentCompleted, EnrollmentCreated, EnrollmentExited, EnrollmentPaused, EnrollmentResumed, EnrollmentStepSent, InProcessCrmBus, LeadAnonymized, LeadAssigned, LeadConverted, LeadCreated, LeadDisqualified, LeadEnriched, LeadScored, LeadStatusChanged, MessageReceived, MessageSent, NoteAdded, OpportunityAbandoned, OpportunityAmountChanged, OpportunityAssigned, OpportunityCreated, OpportunityExtended, OpportunityLost, OpportunityStageAdvanced, OpportunityStageRegressed, OpportunityWon, PipelineArchived, PipelineCreated, SequenceActivated, SequenceArchived, SequenceCreated, SequencePaused, SubscriptionBounced, SubscriptionComplained, SubscriptionConfirmed, SubscriptionCreated, SubscriptionUnsubscribed, SuppressionAdded, SuppressionRemoved, createEvent, crmEventDefinitions };
507
+ export {};