@astralibx/email-rule-engine 12.7.1 → 12.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2060 -29763
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.mjs +2055 -29738
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -55,6 +55,17 @@ declare const EMAIL_SEND_STATUS: {
|
|
|
55
55
|
readonly Throttled: "throttled";
|
|
56
56
|
};
|
|
57
57
|
type EmailSendStatus = (typeof EMAIL_SEND_STATUS)[keyof typeof EMAIL_SEND_STATUS];
|
|
58
|
+
declare const TARGET_MODE: {
|
|
59
|
+
readonly Query: "query";
|
|
60
|
+
readonly List: "list";
|
|
61
|
+
};
|
|
62
|
+
type TargetMode = (typeof TARGET_MODE)[keyof typeof TARGET_MODE];
|
|
63
|
+
declare const RUN_LOG_STATUS: {
|
|
64
|
+
readonly Completed: "completed";
|
|
65
|
+
readonly Cancelled: "cancelled";
|
|
66
|
+
readonly Failed: "failed";
|
|
67
|
+
};
|
|
68
|
+
type RunLogStatus = (typeof RUN_LOG_STATUS)[keyof typeof RUN_LOG_STATUS];
|
|
58
69
|
|
|
59
70
|
interface RuleCondition {
|
|
60
71
|
field: string;
|
|
@@ -202,6 +213,11 @@ interface SendEmailParams {
|
|
|
202
213
|
textBody: string;
|
|
203
214
|
ruleId: string;
|
|
204
215
|
autoApprove: boolean;
|
|
216
|
+
attachments?: Array<{
|
|
217
|
+
filename: string;
|
|
218
|
+
url: string;
|
|
219
|
+
contentType: string;
|
|
220
|
+
}>;
|
|
205
221
|
}
|
|
206
222
|
interface AgentSelection {
|
|
207
223
|
accountId: string;
|
|
@@ -272,7 +288,11 @@ interface EmailRuleEngineConfig {
|
|
|
272
288
|
templateId: string;
|
|
273
289
|
}) => Promise<AgentSelection | null>;
|
|
274
290
|
findIdentifier: (email: string) => Promise<RecipientIdentifier | null>;
|
|
275
|
-
sendTestEmail?: (to: string, subject: string, html: string, text: string
|
|
291
|
+
sendTestEmail?: (to: string, subject: string, html: string, text: string, attachments?: Array<{
|
|
292
|
+
filename: string;
|
|
293
|
+
url: string;
|
|
294
|
+
contentType: string;
|
|
295
|
+
}>) => Promise<void>;
|
|
276
296
|
};
|
|
277
297
|
platforms?: string[];
|
|
278
298
|
audiences?: string[];
|
|
@@ -331,6 +351,11 @@ interface EmailRuleEngineConfig {
|
|
|
331
351
|
};
|
|
332
352
|
}
|
|
333
353
|
|
|
354
|
+
interface EmailAttachment {
|
|
355
|
+
filename: string;
|
|
356
|
+
url: string;
|
|
357
|
+
contentType: string;
|
|
358
|
+
}
|
|
334
359
|
interface EmailTemplate {
|
|
335
360
|
_id: string;
|
|
336
361
|
name: string;
|
|
@@ -347,6 +372,7 @@ interface EmailTemplate {
|
|
|
347
372
|
variables: string[];
|
|
348
373
|
version: number;
|
|
349
374
|
isActive: boolean;
|
|
375
|
+
attachments?: EmailAttachment[];
|
|
350
376
|
createdAt: Date;
|
|
351
377
|
updatedAt: Date;
|
|
352
378
|
}
|
|
@@ -363,6 +389,7 @@ interface CreateEmailTemplateInput {
|
|
|
363
389
|
preheaders?: string[];
|
|
364
390
|
fields?: Record<string, string>;
|
|
365
391
|
variables?: string[];
|
|
392
|
+
attachments?: EmailAttachment[];
|
|
366
393
|
}
|
|
367
394
|
interface UpdateEmailTemplateInput {
|
|
368
395
|
name?: string;
|
|
@@ -376,6 +403,7 @@ interface UpdateEmailTemplateInput {
|
|
|
376
403
|
preheaders?: string[];
|
|
377
404
|
fields?: Record<string, string>;
|
|
378
405
|
variables?: string[];
|
|
406
|
+
attachments?: EmailAttachment[];
|
|
379
407
|
isActive?: boolean;
|
|
380
408
|
}
|
|
381
409
|
|
|
@@ -766,4 +794,4 @@ interface EmailRuleEngine {
|
|
|
766
794
|
*/
|
|
767
795
|
declare function createEmailRuleEngine(config: EmailRuleEngineConfig): EmailRuleEngine;
|
|
768
796
|
|
|
769
|
-
export { type AgentSelection, AlxEmailError, type BeforeSendParams, type BeforeSendResult, type CompiledTemplate, ConfigValidationError, type CreateEmailRuleInput, type CreateEmailTemplateInput, DuplicateSlugError, EMAIL_SEND_STATUS, EMAIL_TYPE, type EmailRule, type EmailRuleDocument, type EmailRuleEngine, type EmailRuleEngineConfig, type EmailRuleModel, type EmailRuleRunLog, type EmailRuleRunLogDocument, type EmailRuleRunLogModel, type EmailRuleRunLogStatics, type EmailRuleSend, type EmailRuleSendDocument, type EmailRuleSendModel, type EmailRuleSendStatics, type EmailRuleStatics, type EmailSendStatus, type EmailTemplate, type EmailTemplateDocument, type EmailTemplateModel, type EmailTemplateStatics, type EmailThrottleConfig, type EmailThrottleConfigDocument, type EmailThrottleConfigModel, type EmailThrottleConfigStatics, type EmailType, type IEmailRule, type IEmailRuleRunLog, type IEmailRuleSend, type IEmailTemplate, type IEmailThrottleConfig, type ListTarget, LockAcquisitionError, type PerRuleStats, type QueryTarget, RULE_OPERATOR, RUN_TRIGGER, type RecipientIdentifier, type RenderResult, type RuleCondition, RuleNotFoundError, type RuleOperator, type RuleRunStats, RuleRunnerService, RuleService, type RuleTarget, RuleTemplateIncompatibleError, type RunTrigger, SchedulerService, type SendEmailParams, TEMPLATE_AUDIENCE, TEMPLATE_CATEGORY, THROTTLE_WINDOW, type TemplateAudience, type TemplateCategory, TemplateNotFoundError, TemplateRenderService, TemplateService, TemplateSyntaxError, type ThrottleWindow, type UpdateEmailRuleInput, type UpdateEmailTemplateInput, type UpdateEmailThrottleConfigInput, createEmailRuleEngine, createEmailRuleRunLogSchema, createEmailRuleSchema, createEmailRuleSendSchema, createEmailTemplateSchema, createEmailThrottleConfigSchema, validateConfig };
|
|
797
|
+
export { type AgentSelection, AlxEmailError, type BeforeSendParams, type BeforeSendResult, type CompiledTemplate, ConfigValidationError, type CreateEmailRuleInput, type CreateEmailTemplateInput, DuplicateSlugError, EMAIL_SEND_STATUS, EMAIL_TYPE, type EmailAttachment, type EmailRule, type EmailRuleDocument, type EmailRuleEngine, type EmailRuleEngineConfig, type EmailRuleModel, type EmailRuleRunLog, type EmailRuleRunLogDocument, type EmailRuleRunLogModel, type EmailRuleRunLogStatics, type EmailRuleSend, type EmailRuleSendDocument, type EmailRuleSendModel, type EmailRuleSendStatics, type EmailRuleStatics, type EmailSendStatus, type EmailTemplate, type EmailTemplateDocument, type EmailTemplateModel, type EmailTemplateStatics, type EmailThrottleConfig, type EmailThrottleConfigDocument, type EmailThrottleConfigModel, type EmailThrottleConfigStatics, type EmailType, type IEmailRule, type IEmailRuleRunLog, type IEmailRuleSend, type IEmailTemplate, type IEmailThrottleConfig, type ListTarget, LockAcquisitionError, type PerRuleStats, type QueryTarget, RULE_OPERATOR, RUN_LOG_STATUS, RUN_TRIGGER, type RecipientIdentifier, type RenderResult, type RuleCondition, RuleNotFoundError, type RuleOperator, type RuleRunStats, RuleRunnerService, RuleService, type RuleTarget, RuleTemplateIncompatibleError, type RunLogStatus, type RunTrigger, SchedulerService, type SendEmailParams, TARGET_MODE, TEMPLATE_AUDIENCE, TEMPLATE_CATEGORY, THROTTLE_WINDOW, type TargetMode, type TemplateAudience, type TemplateCategory, TemplateNotFoundError, TemplateRenderService, TemplateService, TemplateSyntaxError, type ThrottleWindow, type UpdateEmailRuleInput, type UpdateEmailTemplateInput, type UpdateEmailThrottleConfigInput, createEmailRuleEngine, createEmailRuleRunLogSchema, createEmailRuleSchema, createEmailRuleSendSchema, createEmailTemplateSchema, createEmailThrottleConfigSchema, validateConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -55,6 +55,17 @@ declare const EMAIL_SEND_STATUS: {
|
|
|
55
55
|
readonly Throttled: "throttled";
|
|
56
56
|
};
|
|
57
57
|
type EmailSendStatus = (typeof EMAIL_SEND_STATUS)[keyof typeof EMAIL_SEND_STATUS];
|
|
58
|
+
declare const TARGET_MODE: {
|
|
59
|
+
readonly Query: "query";
|
|
60
|
+
readonly List: "list";
|
|
61
|
+
};
|
|
62
|
+
type TargetMode = (typeof TARGET_MODE)[keyof typeof TARGET_MODE];
|
|
63
|
+
declare const RUN_LOG_STATUS: {
|
|
64
|
+
readonly Completed: "completed";
|
|
65
|
+
readonly Cancelled: "cancelled";
|
|
66
|
+
readonly Failed: "failed";
|
|
67
|
+
};
|
|
68
|
+
type RunLogStatus = (typeof RUN_LOG_STATUS)[keyof typeof RUN_LOG_STATUS];
|
|
58
69
|
|
|
59
70
|
interface RuleCondition {
|
|
60
71
|
field: string;
|
|
@@ -202,6 +213,11 @@ interface SendEmailParams {
|
|
|
202
213
|
textBody: string;
|
|
203
214
|
ruleId: string;
|
|
204
215
|
autoApprove: boolean;
|
|
216
|
+
attachments?: Array<{
|
|
217
|
+
filename: string;
|
|
218
|
+
url: string;
|
|
219
|
+
contentType: string;
|
|
220
|
+
}>;
|
|
205
221
|
}
|
|
206
222
|
interface AgentSelection {
|
|
207
223
|
accountId: string;
|
|
@@ -272,7 +288,11 @@ interface EmailRuleEngineConfig {
|
|
|
272
288
|
templateId: string;
|
|
273
289
|
}) => Promise<AgentSelection | null>;
|
|
274
290
|
findIdentifier: (email: string) => Promise<RecipientIdentifier | null>;
|
|
275
|
-
sendTestEmail?: (to: string, subject: string, html: string, text: string
|
|
291
|
+
sendTestEmail?: (to: string, subject: string, html: string, text: string, attachments?: Array<{
|
|
292
|
+
filename: string;
|
|
293
|
+
url: string;
|
|
294
|
+
contentType: string;
|
|
295
|
+
}>) => Promise<void>;
|
|
276
296
|
};
|
|
277
297
|
platforms?: string[];
|
|
278
298
|
audiences?: string[];
|
|
@@ -331,6 +351,11 @@ interface EmailRuleEngineConfig {
|
|
|
331
351
|
};
|
|
332
352
|
}
|
|
333
353
|
|
|
354
|
+
interface EmailAttachment {
|
|
355
|
+
filename: string;
|
|
356
|
+
url: string;
|
|
357
|
+
contentType: string;
|
|
358
|
+
}
|
|
334
359
|
interface EmailTemplate {
|
|
335
360
|
_id: string;
|
|
336
361
|
name: string;
|
|
@@ -347,6 +372,7 @@ interface EmailTemplate {
|
|
|
347
372
|
variables: string[];
|
|
348
373
|
version: number;
|
|
349
374
|
isActive: boolean;
|
|
375
|
+
attachments?: EmailAttachment[];
|
|
350
376
|
createdAt: Date;
|
|
351
377
|
updatedAt: Date;
|
|
352
378
|
}
|
|
@@ -363,6 +389,7 @@ interface CreateEmailTemplateInput {
|
|
|
363
389
|
preheaders?: string[];
|
|
364
390
|
fields?: Record<string, string>;
|
|
365
391
|
variables?: string[];
|
|
392
|
+
attachments?: EmailAttachment[];
|
|
366
393
|
}
|
|
367
394
|
interface UpdateEmailTemplateInput {
|
|
368
395
|
name?: string;
|
|
@@ -376,6 +403,7 @@ interface UpdateEmailTemplateInput {
|
|
|
376
403
|
preheaders?: string[];
|
|
377
404
|
fields?: Record<string, string>;
|
|
378
405
|
variables?: string[];
|
|
406
|
+
attachments?: EmailAttachment[];
|
|
379
407
|
isActive?: boolean;
|
|
380
408
|
}
|
|
381
409
|
|
|
@@ -766,4 +794,4 @@ interface EmailRuleEngine {
|
|
|
766
794
|
*/
|
|
767
795
|
declare function createEmailRuleEngine(config: EmailRuleEngineConfig): EmailRuleEngine;
|
|
768
796
|
|
|
769
|
-
export { type AgentSelection, AlxEmailError, type BeforeSendParams, type BeforeSendResult, type CompiledTemplate, ConfigValidationError, type CreateEmailRuleInput, type CreateEmailTemplateInput, DuplicateSlugError, EMAIL_SEND_STATUS, EMAIL_TYPE, type EmailRule, type EmailRuleDocument, type EmailRuleEngine, type EmailRuleEngineConfig, type EmailRuleModel, type EmailRuleRunLog, type EmailRuleRunLogDocument, type EmailRuleRunLogModel, type EmailRuleRunLogStatics, type EmailRuleSend, type EmailRuleSendDocument, type EmailRuleSendModel, type EmailRuleSendStatics, type EmailRuleStatics, type EmailSendStatus, type EmailTemplate, type EmailTemplateDocument, type EmailTemplateModel, type EmailTemplateStatics, type EmailThrottleConfig, type EmailThrottleConfigDocument, type EmailThrottleConfigModel, type EmailThrottleConfigStatics, type EmailType, type IEmailRule, type IEmailRuleRunLog, type IEmailRuleSend, type IEmailTemplate, type IEmailThrottleConfig, type ListTarget, LockAcquisitionError, type PerRuleStats, type QueryTarget, RULE_OPERATOR, RUN_TRIGGER, type RecipientIdentifier, type RenderResult, type RuleCondition, RuleNotFoundError, type RuleOperator, type RuleRunStats, RuleRunnerService, RuleService, type RuleTarget, RuleTemplateIncompatibleError, type RunTrigger, SchedulerService, type SendEmailParams, TEMPLATE_AUDIENCE, TEMPLATE_CATEGORY, THROTTLE_WINDOW, type TemplateAudience, type TemplateCategory, TemplateNotFoundError, TemplateRenderService, TemplateService, TemplateSyntaxError, type ThrottleWindow, type UpdateEmailRuleInput, type UpdateEmailTemplateInput, type UpdateEmailThrottleConfigInput, createEmailRuleEngine, createEmailRuleRunLogSchema, createEmailRuleSchema, createEmailRuleSendSchema, createEmailTemplateSchema, createEmailThrottleConfigSchema, validateConfig };
|
|
797
|
+
export { type AgentSelection, AlxEmailError, type BeforeSendParams, type BeforeSendResult, type CompiledTemplate, ConfigValidationError, type CreateEmailRuleInput, type CreateEmailTemplateInput, DuplicateSlugError, EMAIL_SEND_STATUS, EMAIL_TYPE, type EmailAttachment, type EmailRule, type EmailRuleDocument, type EmailRuleEngine, type EmailRuleEngineConfig, type EmailRuleModel, type EmailRuleRunLog, type EmailRuleRunLogDocument, type EmailRuleRunLogModel, type EmailRuleRunLogStatics, type EmailRuleSend, type EmailRuleSendDocument, type EmailRuleSendModel, type EmailRuleSendStatics, type EmailRuleStatics, type EmailSendStatus, type EmailTemplate, type EmailTemplateDocument, type EmailTemplateModel, type EmailTemplateStatics, type EmailThrottleConfig, type EmailThrottleConfigDocument, type EmailThrottleConfigModel, type EmailThrottleConfigStatics, type EmailType, type IEmailRule, type IEmailRuleRunLog, type IEmailRuleSend, type IEmailTemplate, type IEmailThrottleConfig, type ListTarget, LockAcquisitionError, type PerRuleStats, type QueryTarget, RULE_OPERATOR, RUN_LOG_STATUS, RUN_TRIGGER, type RecipientIdentifier, type RenderResult, type RuleCondition, RuleNotFoundError, type RuleOperator, type RuleRunStats, RuleRunnerService, RuleService, type RuleTarget, RuleTemplateIncompatibleError, type RunLogStatus, type RunTrigger, SchedulerService, type SendEmailParams, TARGET_MODE, TEMPLATE_AUDIENCE, TEMPLATE_CATEGORY, THROTTLE_WINDOW, type TargetMode, type TemplateAudience, type TemplateCategory, TemplateNotFoundError, TemplateRenderService, TemplateService, TemplateSyntaxError, type ThrottleWindow, type UpdateEmailRuleInput, type UpdateEmailTemplateInput, type UpdateEmailThrottleConfigInput, createEmailRuleEngine, createEmailRuleRunLogSchema, createEmailRuleSchema, createEmailRuleSendSchema, createEmailTemplateSchema, createEmailThrottleConfigSchema, validateConfig };
|