@remit/api-zod-schemas 0.0.87 → 0.0.89
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/README.md +24 -0
- package/middleware.js +1 -1
- package/middleware.js.map +1 -1
- package/middleware.ts +1 -1
- package/package.json +1 -1
- package/schemas.d.ts +792 -0
- package/schemas.d.ts.map +1 -1
- package/schemas.js +107 -1
- package/schemas.js.map +1 -1
- package/schemas.ts +131 -1
package/schemas.ts
CHANGED
|
@@ -135,6 +135,16 @@ export const PlacementActionSchema = z.enum(["MoveToInbox", "MoveToJunk"]);
|
|
|
135
135
|
|
|
136
136
|
export const PlacementConfidenceSchema = z.enum(["Confident", "Unsure"]);
|
|
137
137
|
|
|
138
|
+
export const SpamSenderScreenRuleSchema = z.enum(["ReportedSender", "NeverSpam", "Vip", "WellKnown", "Newsletter"]);
|
|
139
|
+
|
|
140
|
+
export const SpamActionSchema = z.enum(["None", "Warn", "Junk"]);
|
|
141
|
+
|
|
142
|
+
export const SpamKindSchema = z.enum(["Spam", "Phishing"]);
|
|
143
|
+
|
|
144
|
+
export const SpamReasonNameSchema = z.enum(["DmarcFail", "SignerMismatch", "ReplyToMismatch", "LinkTextMismatch", "LinkDomainDistant", "PunycodeDomain", "MixedScriptDomain", "ConfusableDomains", "SingleOffDomainLink", "GeneratedName", "FirstContactDomain", "RecentlyRegisteredDomain", "UnknownRegistrationDate", "ClassifierSpam", "ClassifierPhishing", "ProviderSpam", "DisplayNameForeignAddress", "DisplayNameLookalike", "BackendSymbol"]);
|
|
145
|
+
|
|
146
|
+
export const SpamFailureKindSchema = z.enum(["Unreachable", "TimedOut", "ServiceError", "Unparseable"]);
|
|
147
|
+
|
|
138
148
|
export const OutboxAttachmentStateSchema = z.enum(["Pending", "Stored"]);
|
|
139
149
|
|
|
140
150
|
export const OutboxAttachmentRejectionReasonSchema = z.enum(["EmptyFile", "UnusableFilename", "FileTooLarge", "MessageTooLarge", "TooManyAttachments", "ReservationExpired", "UploadMissing", "SizeMismatch"]);
|
|
@@ -187,6 +197,8 @@ export const ConfigImportRefKindSchema = z.enum(["FolderRole", "MailboxOverride"
|
|
|
187
197
|
|
|
188
198
|
export const SyncWarningStateSchema = z.enum(["Retrying", "GaveUp"]);
|
|
189
199
|
|
|
200
|
+
export const ProviderSpamVerdictSchema = z.enum(["Spam", "Clean", "Absent"]);
|
|
201
|
+
|
|
190
202
|
export const MessagePlacementMoveStateSchema = z.enum(["pending", "queued", "processing", "processed"]);
|
|
191
203
|
|
|
192
204
|
export const FlagPushOperationSchema = z.enum(["add", "remove"]);
|
|
@@ -1023,6 +1035,8 @@ export const OrganizeJobRequestSchema = z.object({
|
|
|
1023
1035
|
actionLabelId: z.string(),
|
|
1024
1036
|
actionMailboxId: z.string(),
|
|
1025
1037
|
sourceMailboxId: z.string(),
|
|
1038
|
+
sentAfter: z.string(),
|
|
1039
|
+
sentBefore: z.string(),
|
|
1026
1040
|
matchedCount: z.number(),
|
|
1027
1041
|
appliedCount: z.number(),
|
|
1028
1042
|
failedCount: z.number(),
|
|
@@ -1634,6 +1648,45 @@ export const MessagePlacementVerdictSchema = z.object({
|
|
|
1634
1648
|
decidedAt: z.number()
|
|
1635
1649
|
});
|
|
1636
1650
|
|
|
1651
|
+
export const SpamVerdictNotCheckedSchema = z.object({
|
|
1652
|
+
state: z.literal("NotChecked")
|
|
1653
|
+
});
|
|
1654
|
+
|
|
1655
|
+
export const SpamScreenBySenderSchema = z.object({
|
|
1656
|
+
rule: SpamSenderScreenRuleSchema
|
|
1657
|
+
});
|
|
1658
|
+
|
|
1659
|
+
export const SpamScreenByFilterSchema = z.object({
|
|
1660
|
+
rule: z.literal("Filter"),
|
|
1661
|
+
filterId: z.string().min(25).max(25)
|
|
1662
|
+
});
|
|
1663
|
+
|
|
1664
|
+
export const SpamVerdictScreenedOutSchema = z.object({
|
|
1665
|
+
state: z.literal("ScreenedOut"),
|
|
1666
|
+
screen: z.union([SpamScreenBySenderSchema, SpamScreenByFilterSchema])
|
|
1667
|
+
});
|
|
1668
|
+
|
|
1669
|
+
export const SpamReasonSchema = z.object({
|
|
1670
|
+
name: SpamReasonNameSchema,
|
|
1671
|
+
symbol: z.string(),
|
|
1672
|
+
score: z.number(),
|
|
1673
|
+
options: z.array(z.string())
|
|
1674
|
+
});
|
|
1675
|
+
|
|
1676
|
+
export const SpamCheckedSchema = z.object({
|
|
1677
|
+
state: z.literal("Checked"),
|
|
1678
|
+
score: z.number().min(0).max(1),
|
|
1679
|
+
action: SpamActionSchema,
|
|
1680
|
+
kind: SpamKindSchema,
|
|
1681
|
+
reasons: z.array(SpamReasonSchema),
|
|
1682
|
+
modelCalled: z.boolean()
|
|
1683
|
+
});
|
|
1684
|
+
|
|
1685
|
+
export const SpamFailedSchema = z.object({
|
|
1686
|
+
state: z.literal("Failed"),
|
|
1687
|
+
kind: SpamFailureKindSchema
|
|
1688
|
+
});
|
|
1689
|
+
|
|
1637
1690
|
export const ThreadMessageResponseSchema = z.object({
|
|
1638
1691
|
threadMessageId: z.string().min(25).max(25),
|
|
1639
1692
|
threadId: z.string().min(25).max(25),
|
|
@@ -1663,7 +1716,8 @@ export const ThreadMessageResponseSchema = z.object({
|
|
|
1663
1716
|
autoMoved: AutoMovedInfoSchema.optional(),
|
|
1664
1717
|
labels: z.array(LabelSummaryResponseSchema).optional(),
|
|
1665
1718
|
spamReport: MessageSpamReportSchema.optional(),
|
|
1666
|
-
placementVerdict: MessagePlacementVerdictSchema.optional()
|
|
1719
|
+
placementVerdict: MessagePlacementVerdictSchema.optional(),
|
|
1720
|
+
spamVerdict: z.union([SpamVerdictNotCheckedSchema, SpamVerdictScreenedOutSchema, SpamCheckedSchema, SpamFailedSchema])
|
|
1667
1721
|
});
|
|
1668
1722
|
|
|
1669
1723
|
export const ThreadMessageListResponseSchema = z.object({
|
|
@@ -1963,6 +2017,7 @@ export const MessageSummaryResponseSchema = z.object({
|
|
|
1963
2017
|
syncStatus: MessageSyncStatusSchema,
|
|
1964
2018
|
abandonedMutation: MessageMutationSchema,
|
|
1965
2019
|
authenticity: MessageAuthenticitySchema.optional(),
|
|
2020
|
+
spamVerdict: z.union([SpamVerdictNotCheckedSchema, SpamVerdictScreenedOutSchema, SpamCheckedSchema, SpamFailedSchema]),
|
|
1966
2021
|
messageIdHeader: z.string().optional(),
|
|
1967
2022
|
autoMoved: AutoMovedInfoSchema.optional(),
|
|
1968
2023
|
labels: z.array(LabelSummaryResponseSchema).optional(),
|
|
@@ -2072,6 +2127,7 @@ export const MessageRecordSchema = z.object({
|
|
|
2072
2127
|
placementDecidedAt: z.number().optional(),
|
|
2073
2128
|
classifierScores: z.array(ClassifierScoreSchema),
|
|
2074
2129
|
spamReport: MessageSpamReportSchema.optional(),
|
|
2130
|
+
spamVerdict: z.union([SpamVerdictNotCheckedSchema, SpamVerdictScreenedOutSchema, SpamCheckedSchema, SpamFailedSchema]),
|
|
2075
2131
|
createdAt: z.number(),
|
|
2076
2132
|
updatedAt: z.number()
|
|
2077
2133
|
});
|
|
@@ -2104,6 +2160,7 @@ export const MessageSchema = z.object({
|
|
|
2104
2160
|
placementDecidedAt: z.number().optional(),
|
|
2105
2161
|
classifierScores: z.array(ClassifierScoreSchema),
|
|
2106
2162
|
spamReport: MessageSpamReportSchema.optional(),
|
|
2163
|
+
spamVerdict: z.union([SpamVerdictNotCheckedSchema, SpamVerdictScreenedOutSchema, SpamCheckedSchema, SpamFailedSchema]),
|
|
2107
2164
|
createdAt: z.number(),
|
|
2108
2165
|
updatedAt: z.number(),
|
|
2109
2166
|
messageIdHeader: z.string().optional()
|
|
@@ -2385,6 +2442,63 @@ export const MessageFlagSchema = z.object({
|
|
|
2385
2442
|
updatedAt: z.number()
|
|
2386
2443
|
});
|
|
2387
2444
|
|
|
2445
|
+
export const SpamHeaderSchema = z.object({
|
|
2446
|
+
name: z.string(),
|
|
2447
|
+
value: z.string()
|
|
2448
|
+
});
|
|
2449
|
+
|
|
2450
|
+
export const SpamLinkSchema = z.object({
|
|
2451
|
+
href: z.string(),
|
|
2452
|
+
text: z.string()
|
|
2453
|
+
});
|
|
2454
|
+
|
|
2455
|
+
export const SpamRequestMessageSchema = z.object({
|
|
2456
|
+
raw: z.string(),
|
|
2457
|
+
headers: z.array(SpamHeaderSchema),
|
|
2458
|
+
text: z.string(),
|
|
2459
|
+
html: z.string(),
|
|
2460
|
+
links: z.array(SpamLinkSchema)
|
|
2461
|
+
});
|
|
2462
|
+
|
|
2463
|
+
export const SpamRequestEnvelopeSchema = z.object({
|
|
2464
|
+
mailFrom: z.string(),
|
|
2465
|
+
rcpt: z.array(z.string()),
|
|
2466
|
+
ip: z.string(),
|
|
2467
|
+
helo: z.string()
|
|
2468
|
+
});
|
|
2469
|
+
|
|
2470
|
+
export const SpamRequestAuthenticationSchema = z.object({
|
|
2471
|
+
dmarc: AuthResultVerdictSchema,
|
|
2472
|
+
spf: AuthResultVerdictSchema,
|
|
2473
|
+
dkim: AuthResultVerdictSchema,
|
|
2474
|
+
signerDomain: z.string(),
|
|
2475
|
+
envelopeDomain: z.string()
|
|
2476
|
+
});
|
|
2477
|
+
|
|
2478
|
+
export const SpamRequestProviderSchema = z.object({
|
|
2479
|
+
verdict: ProviderSpamVerdictSchema,
|
|
2480
|
+
score: z.string(),
|
|
2481
|
+
headers: z.array(SpamHeaderSchema)
|
|
2482
|
+
});
|
|
2483
|
+
|
|
2484
|
+
export const SpamRequestContextSchema = z.object({
|
|
2485
|
+
knownSender: z.boolean(),
|
|
2486
|
+
senderMessagesSeen: z.number(),
|
|
2487
|
+
senderDomainMessagesSeen: z.number(),
|
|
2488
|
+
senderDomainRegisteredAt: z.string().optional(),
|
|
2489
|
+
receivedAt: z.string(),
|
|
2490
|
+
classifierScores: z.array(ClassifierScoreSchema),
|
|
2491
|
+
modelAllowed: z.boolean()
|
|
2492
|
+
});
|
|
2493
|
+
|
|
2494
|
+
export const SpamRequestSchema = z.object({
|
|
2495
|
+
message: SpamRequestMessageSchema,
|
|
2496
|
+
envelope: SpamRequestEnvelopeSchema,
|
|
2497
|
+
authentication: SpamRequestAuthenticationSchema,
|
|
2498
|
+
provider: SpamRequestProviderSchema,
|
|
2499
|
+
context: SpamRequestContextSchema
|
|
2500
|
+
});
|
|
2501
|
+
|
|
2388
2502
|
export const MessagePlacementMoveSchema = z.object({
|
|
2389
2503
|
messageId: z.string().min(25).max(25),
|
|
2390
2504
|
accountId: z.string().min(25).max(25),
|
|
@@ -2419,6 +2533,22 @@ export const EnvelopeSchema = z.object({
|
|
|
2419
2533
|
updatedAt: z.number()
|
|
2420
2534
|
});
|
|
2421
2535
|
|
|
2536
|
+
export const DomainRegistrationPublishedSchema = z.object({
|
|
2537
|
+
state: z.literal("Published"),
|
|
2538
|
+
registeredAt: z.string()
|
|
2539
|
+
});
|
|
2540
|
+
|
|
2541
|
+
export const DomainRegistrationUnpublishedSchema = z.object({
|
|
2542
|
+
state: z.literal("Unpublished")
|
|
2543
|
+
});
|
|
2544
|
+
|
|
2545
|
+
export const DomainRegistrationSchema = z.object({
|
|
2546
|
+
domainRegistrationId: z.string().max(256),
|
|
2547
|
+
registration: z.union([DomainRegistrationPublishedSchema, DomainRegistrationUnpublishedSchema]),
|
|
2548
|
+
createdAt: z.number(),
|
|
2549
|
+
updatedAt: z.number()
|
|
2550
|
+
});
|
|
2551
|
+
|
|
2422
2552
|
export const SenderSignerStandingSchema = z.object({
|
|
2423
2553
|
accountConfigId: z.string().min(25).max(25),
|
|
2424
2554
|
senderKey: z.string().max(256),
|