Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
87 lines
2.8 KiB
TypeScript
87 lines
2.8 KiB
TypeScript
export function buildEmailDeliveredPayload(params: {
|
|
messageId: string;
|
|
providerMessageId: string;
|
|
to: string;
|
|
deliveredAt?: string;
|
|
provider: string;
|
|
}): Record<string, unknown> {
|
|
if (!params.messageId) throw new Error('messageId is required');
|
|
if (!params.providerMessageId) throw new Error('providerMessageId is required');
|
|
if (!params.to) throw new Error('to is required');
|
|
if (!params.provider) throw new Error('provider is required');
|
|
|
|
return {
|
|
messageId: params.messageId,
|
|
providerMessageId: params.providerMessageId,
|
|
to: params.to,
|
|
...(params.deliveredAt ? { deliveredAt: params.deliveredAt } : {}),
|
|
provider: params.provider,
|
|
};
|
|
}
|
|
|
|
export function buildEmailBouncedPayload(params: {
|
|
messageId: string;
|
|
providerMessageId: string;
|
|
to: string;
|
|
bouncedAt?: string;
|
|
bounceType: 'hard' | 'soft';
|
|
smtpCode?: string;
|
|
smtpMessage?: string;
|
|
}): Record<string, unknown> {
|
|
if (!params.messageId) throw new Error('messageId is required');
|
|
if (!params.providerMessageId) throw new Error('providerMessageId is required');
|
|
if (!params.to) throw new Error('to is required');
|
|
if (!params.bounceType) throw new Error('bounceType is required');
|
|
|
|
return {
|
|
messageId: params.messageId,
|
|
providerMessageId: params.providerMessageId,
|
|
to: params.to,
|
|
...(params.bouncedAt ? { bouncedAt: params.bouncedAt } : {}),
|
|
bounceType: params.bounceType,
|
|
...(params.smtpCode ? { smtpCode: params.smtpCode } : {}),
|
|
...(params.smtpMessage ? { smtpMessage: params.smtpMessage } : {}),
|
|
};
|
|
}
|
|
|
|
export function buildEmailComplaintReceivedPayload(params: {
|
|
messageId: string;
|
|
providerMessageId: string;
|
|
to: string;
|
|
complainedAt?: string;
|
|
provider: string;
|
|
complaintType?: string;
|
|
}): Record<string, unknown> {
|
|
if (!params.messageId) throw new Error('messageId is required');
|
|
if (!params.providerMessageId) throw new Error('providerMessageId is required');
|
|
if (!params.to) throw new Error('to is required');
|
|
if (!params.provider) throw new Error('provider is required');
|
|
|
|
return {
|
|
messageId: params.messageId,
|
|
providerMessageId: params.providerMessageId,
|
|
to: params.to,
|
|
...(params.complainedAt ? { complainedAt: params.complainedAt } : {}),
|
|
provider: params.provider,
|
|
...(params.complaintType ? { complaintType: params.complaintType } : {}),
|
|
};
|
|
}
|
|
|
|
export function buildEmailUnsubscribedPayload(params: {
|
|
recipientEmail: string;
|
|
unsubscribedAt?: string;
|
|
source: string;
|
|
messageId?: string;
|
|
}): Record<string, unknown> {
|
|
if (!params.recipientEmail) throw new Error('recipientEmail is required');
|
|
if (!params.source) throw new Error('source is required');
|
|
|
|
return {
|
|
recipientEmail: params.recipientEmail,
|
|
...(params.unsubscribedAt ? { unsubscribedAt: params.unsubscribedAt } : {}),
|
|
source: params.source,
|
|
...(params.messageId ? { messageId: params.messageId } : {}),
|
|
};
|
|
}
|
|
|