@remit/api-zod-schemas 0.0.92 → 0.0.94

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/schemas.ts CHANGED
@@ -129,8 +129,6 @@ export const StarColorSchema = z.enum(["none", "yellow", "orange", "red", "purpl
129
129
 
130
130
  export const SenderTrustSchema = z.enum(["unknown", "wellknown", "vip"]);
131
131
 
132
- export const DisplayNameCorrespondenceSchema = z.enum(["Corresponds", "Lookalike", "ForeignAddress", "Unrelated", "NoClaim"]);
133
-
134
132
  export const MessageStatusSchema = z.enum(["active", "deleting", "deleted", "moving"]);
135
133
 
136
134
  export const MessageSyncStatusSchema = z.enum(["synced", "pending", "failed", "abandoned"]);
@@ -147,6 +145,8 @@ export const SpamReasonNameSchema = z.enum(["DmarcFail", "SignerMismatch", "Repl
147
145
 
148
146
  export const SpamModelOutcomeSchema = z.enum(["Answered", "NotConfigured", "DailyLimit", "RateLimited", "OutOfBand"]);
149
147
 
148
+ export const SpamJudgeNameSchema = z.enum(["Inline", "Rspamd", "Model"]);
149
+
150
150
  export const SpamFailureKindSchema = z.enum(["Unreachable", "TimedOut", "ServiceError", "Unparseable"]);
151
151
 
152
152
  export const OutboxAttachmentStateSchema = z.enum(["Pending", "Stored"]);
@@ -199,6 +199,8 @@ export const ConfigImportStateSchema = z.enum(["Pending", "Complete"]);
199
199
 
200
200
  export const ConfigImportRefKindSchema = z.enum(["FolderRole", "MailboxOverride", "FilterAction"]);
201
201
 
202
+ export const DisplayNameCorrespondenceSchema = z.enum(["Corresponds", "Lookalike", "ForeignAddress", "Unrelated", "NoClaim"]);
203
+
202
204
  export const SyncWarningStateSchema = z.enum(["Retrying", "GaveUp"]);
203
205
 
204
206
  export const ProviderSpamVerdictSchema = z.enum(["Spam", "Clean", "Absent"]);
@@ -1650,8 +1652,6 @@ export const MessageAuthenticitySchema = z.object({
1650
1652
  fromDomain: z.string(),
1651
1653
  dkimDomain: z.string().optional(),
1652
1654
  dkimMismatch: z.boolean(),
1653
- displayNameCorrespondence: DisplayNameCorrespondenceSchema.optional(),
1654
- offDomainLinkDomains: z.array(z.string()).optional(),
1655
1655
  signerDomain: z.string().optional(),
1656
1656
  envelopeDomain: z.string().optional(),
1657
1657
  signerMessageCount: z.number().optional(),
@@ -1716,7 +1716,8 @@ export const SpamCheckedSchema = z.object({
1716
1716
  action: SpamActionSchema,
1717
1717
  kind: SpamKindSchema,
1718
1718
  reasons: z.array(SpamReasonSchema),
1719
- modelOutcome: SpamModelOutcomeSchema
1719
+ modelOutcome: SpamModelOutcomeSchema,
1720
+ decidedBy: SpamJudgeNameSchema
1720
1721
  });
1721
1722
 
1722
1723
  export const SpamFailedSchema = z.object({
@@ -1749,12 +1750,13 @@ export const ThreadMessageResponseSchema = z.object({
1749
1750
  status: MessageStatusSchema,
1750
1751
  syncStatus: MessageSyncStatusSchema,
1751
1752
  abandonedMutation: MessageMutationSchema,
1752
- accountId: z.string().min(25).max(25).optional(),
1753
+ accountId: z.string().min(25).max(25),
1753
1754
  autoMoved: AutoMovedInfoSchema.optional(),
1754
1755
  labels: z.array(LabelSummaryResponseSchema).optional(),
1755
1756
  spamReport: MessageSpamReportSchema.optional(),
1756
1757
  placementVerdict: MessagePlacementVerdictSchema.optional(),
1757
- spamVerdict: z.union([SpamVerdictNotCheckedSchema, SpamVerdictScreenedOutSchema, SpamCheckedSchema, SpamFailedSchema])
1758
+ spamVerdict: z.union([SpamVerdictNotCheckedSchema, SpamVerdictScreenedOutSchema, SpamCheckedSchema, SpamFailedSchema]),
1759
+ spamCleared: z.boolean()
1758
1760
  });
1759
1761
 
1760
1762
  export const ThreadMessageListResponseSchema = z.object({
@@ -2055,6 +2057,7 @@ export const MessageSummaryResponseSchema = z.object({
2055
2057
  abandonedMutation: MessageMutationSchema,
2056
2058
  authenticity: MessageAuthenticitySchema.optional(),
2057
2059
  spamVerdict: z.union([SpamVerdictNotCheckedSchema, SpamVerdictScreenedOutSchema, SpamCheckedSchema, SpamFailedSchema]),
2060
+ spamCleared: z.boolean(),
2058
2061
  messageIdHeader: z.string().optional(),
2059
2062
  autoMoved: AutoMovedInfoSchema.optional(),
2060
2063
  labels: z.array(LabelSummaryResponseSchema).optional(),
@@ -2164,6 +2167,7 @@ export const MessageRecordSchema = z.object({
2164
2167
  classifierScores: z.array(ClassifierScoreSchema),
2165
2168
  spamReport: MessageSpamReportSchema.optional(),
2166
2169
  spamVerdict: z.union([SpamVerdictNotCheckedSchema, SpamVerdictScreenedOutSchema, SpamCheckedSchema, SpamFailedSchema]),
2170
+ spamCleared: z.boolean(),
2167
2171
  createdAt: z.number(),
2168
2172
  updatedAt: z.number()
2169
2173
  });
@@ -2196,6 +2200,7 @@ export const MessageSchema = z.object({
2196
2200
  classifierScores: z.array(ClassifierScoreSchema),
2197
2201
  spamReport: MessageSpamReportSchema.optional(),
2198
2202
  spamVerdict: z.union([SpamVerdictNotCheckedSchema, SpamVerdictScreenedOutSchema, SpamCheckedSchema, SpamFailedSchema]),
2203
+ spamCleared: z.boolean(),
2199
2204
  createdAt: z.number(),
2200
2205
  updatedAt: z.number(),
2201
2206
  messageIdHeader: z.string().optional()
@@ -2557,6 +2562,21 @@ export const SpamRequestSchema = z.object({
2557
2562
  context: SpamRequestContextSchema
2558
2563
  });
2559
2564
 
2565
+ export const SpamInlineJudgeConfigSchema = z.object({
2566
+ name: z.literal("Inline"),
2567
+ thresholds: z.union([SpamThresholdsUnsetSchema, SpamThresholdsSetSchema])
2568
+ });
2569
+
2570
+ export const SpamRspamdJudgeConfigSchema = z.object({
2571
+ name: z.literal("Rspamd"),
2572
+ url: z.string()
2573
+ });
2574
+
2575
+ export const SpamModelJudgeConfigSchema = z.object({
2576
+ name: z.literal("Model"),
2577
+ thresholds: SpamThresholdsSetSchema
2578
+ });
2579
+
2560
2580
  export const MessagePlacementMoveSchema = z.object({
2561
2581
  messageId: z.string().min(25).max(25),
2562
2582
  accountId: z.string().min(25).max(25),