@remit/api-zod-schemas 0.0.69 → 0.0.71
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 +14 -0
- package/middleware.d.ts.map +1 -1
- package/middleware.js +18 -1
- package/middleware.js.map +1 -1
- package/middleware.ts +18 -0
- package/package.json +1 -1
- package/schemas.d.ts +222 -0
- package/schemas.d.ts.map +1 -1
- package/schemas.js +68 -3
- package/schemas.js.map +1 -1
- package/schemas.ts +82 -3
package/schemas.ts
CHANGED
|
@@ -91,6 +91,18 @@ export const RecurrenceScopeSchema = z.enum(["This", "Following", "All"]);
|
|
|
91
91
|
|
|
92
92
|
export const CalendarInviteAnswerSchema = z.enum(["Accepted", "Tentative", "Declined"]);
|
|
93
93
|
|
|
94
|
+
export const ClassificationPresetIdSchema = z.enum(["Jev", "Jina", "Mistral", "Gemini", "OpenAiCompatible", "Local"]);
|
|
95
|
+
|
|
96
|
+
export const ClassificationPresetGroupSchema = z.enum(["Hosted", "Custom", "Local"]);
|
|
97
|
+
|
|
98
|
+
export const ClassificationAdapterShapeSchema = z.enum(["DecisionApi", "ChatJsonSchema", "JinaClassify"]);
|
|
99
|
+
|
|
100
|
+
export const ClassificationLabelSchema = z.enum(["Spam", "Phishing", "Priority", "Personal", "Newsletter", "Marketing", "Automated", "Transactional", "Social"]);
|
|
101
|
+
|
|
102
|
+
export const ClassificationFailureKindSchema = z.enum(["Unauthorized", "ModelNotFound", "RateLimited", "Rejected", "ProviderError", "Unreachable", "TimedOut", "Unparseable"]);
|
|
103
|
+
|
|
104
|
+
export const ClassificationFieldSchema = z.enum(["ApiKey", "Model", "BaseUrl"]);
|
|
105
|
+
|
|
94
106
|
export const SortOrderSchema = z.enum(["asc", "desc"]);
|
|
95
107
|
|
|
96
108
|
export const StarColorSchema = z.enum(["none", "yellow", "orange", "red", "purple", "blue", "teal", "green", "yellow_bang", "red_bang", "purple_question", "blue_info", "orange_guillemet", "green_check", "yellow_check", "blue_star"]);
|
|
@@ -155,7 +167,7 @@ export const ContentEncodingSchema = z.enum(["none", "gzip", "zstd"]);
|
|
|
155
167
|
|
|
156
168
|
export const SenderOverrideSchema = z.enum(["none", "blocked", "neverSpam"]);
|
|
157
169
|
|
|
158
|
-
export const AccountSettingNameSchema = z.enum(["Theme", "Density", "DefaultComposerFormat", "PinnedFolders", "AccountSignaturePlainText", "AccountSignatureHtml", "AccountDisplayName", "AccountMuted", "AccountComposeLanguages", "MailboxDisplayName", "MailboxMuted", "FolderRoleAppointment", "FolderRoleAppointmentLabel", "MailboxRole", "DefaultInvitationSenderAccountId"]);
|
|
170
|
+
export const AccountSettingNameSchema = z.enum(["Theme", "Density", "DefaultComposerFormat", "PinnedFolders", "AccountSignaturePlainText", "AccountSignatureHtml", "AccountDisplayName", "AccountMuted", "AccountComposeLanguages", "MailboxDisplayName", "MailboxMuted", "FolderRoleAppointment", "FolderRoleAppointmentLabel", "MailboxRole", "DefaultInvitationSenderAccountId", "ClassificationPresetId", "ClassificationModel", "ClassificationBaseUrl", "ClassificationApiKey", "ClassificationEnabled", "ClassificationDailyLimit"]);
|
|
159
171
|
|
|
160
172
|
export const ConfigImportStateSchema = z.enum(["Pending", "Complete"]);
|
|
161
173
|
|
|
@@ -1177,13 +1189,80 @@ export const CalendarFreeBusyResponseSchema = z.object({
|
|
|
1177
1189
|
items: z.array(CalendarFreeBusySpanSchema)
|
|
1178
1190
|
});
|
|
1179
1191
|
|
|
1192
|
+
export const ClassificationPricedSchema = z.object({
|
|
1193
|
+
state: z.literal("Priced"),
|
|
1194
|
+
currency: z.literal("USD"),
|
|
1195
|
+
perMillionInputTokens: z.number()
|
|
1196
|
+
});
|
|
1197
|
+
|
|
1198
|
+
export const ClassificationNoPriceSchema = z.object({
|
|
1199
|
+
state: z.literal("NoPrice")
|
|
1200
|
+
});
|
|
1201
|
+
|
|
1202
|
+
export const ClassificationPresetSchema = z.object({
|
|
1203
|
+
presetId: ClassificationPresetIdSchema,
|
|
1204
|
+
label: z.string(),
|
|
1205
|
+
group: ClassificationPresetGroupSchema,
|
|
1206
|
+
adapterShape: ClassificationAdapterShapeSchema,
|
|
1207
|
+
defaultBaseUrl: z.string().optional(),
|
|
1208
|
+
defaultModel: z.string(),
|
|
1209
|
+
needsKey: z.boolean(),
|
|
1210
|
+
price: z.union([ClassificationPricedSchema, ClassificationNoPriceSchema])
|
|
1211
|
+
});
|
|
1212
|
+
|
|
1213
|
+
export const ClassificationNotConfiguredSchema = z.object({
|
|
1214
|
+
state: z.literal("NotConfigured")
|
|
1215
|
+
});
|
|
1216
|
+
|
|
1217
|
+
export const ClassificationConfiguredSchema = z.object({
|
|
1218
|
+
state: z.literal("Configured"),
|
|
1219
|
+
presetId: ClassificationPresetIdSchema,
|
|
1220
|
+
model: z.string(),
|
|
1221
|
+
baseUrl: z.string(),
|
|
1222
|
+
apiKeySaved: z.boolean(),
|
|
1223
|
+
enabled: z.boolean(),
|
|
1224
|
+
dailyLimit: z.number(),
|
|
1225
|
+
savedAt: z.number()
|
|
1226
|
+
});
|
|
1227
|
+
|
|
1180
1228
|
export const UserSettingsResponseSchema = z.object({
|
|
1181
1229
|
defaultInvitationSenderAccountId: z.string().min(25).max(25).optional(),
|
|
1182
|
-
defaultInvitationSenderChosen: z.boolean()
|
|
1230
|
+
defaultInvitationSenderChosen: z.boolean(),
|
|
1231
|
+
classificationPresets: z.array(ClassificationPresetSchema),
|
|
1232
|
+
classification: z.union([ClassificationNotConfiguredSchema, ClassificationConfiguredSchema])
|
|
1183
1233
|
});
|
|
1184
1234
|
|
|
1185
1235
|
export const UpdateUserSettingsInputSchema = z.object({
|
|
1186
|
-
defaultInvitationSenderAccountId: z.string().min(25).max(25).optional()
|
|
1236
|
+
defaultInvitationSenderAccountId: z.string().min(25).max(25).optional(),
|
|
1237
|
+
classificationPresetId: ClassificationPresetIdSchema.optional(),
|
|
1238
|
+
classificationModel: z.string().optional(),
|
|
1239
|
+
classificationBaseUrl: z.string().optional(),
|
|
1240
|
+
classificationApiKey: z.string().optional(),
|
|
1241
|
+
classificationEnabled: z.boolean().optional(),
|
|
1242
|
+
classificationDailyLimit: z.number().min(1).optional()
|
|
1243
|
+
});
|
|
1244
|
+
|
|
1245
|
+
export const ClassificationTestInputSchema = z.object({
|
|
1246
|
+
presetId: ClassificationPresetIdSchema,
|
|
1247
|
+
model: z.string(),
|
|
1248
|
+
baseUrl: z.string(),
|
|
1249
|
+
apiKey: z.string()
|
|
1250
|
+
});
|
|
1251
|
+
|
|
1252
|
+
export const ClassificationTestPassedSchema = z.object({
|
|
1253
|
+
state: z.literal("Passed"),
|
|
1254
|
+
latencyMs: z.number(),
|
|
1255
|
+
label: ClassificationLabelSchema,
|
|
1256
|
+
confidence: z.number()
|
|
1257
|
+
});
|
|
1258
|
+
|
|
1259
|
+
export const ClassificationTestFailedSchema = z.object({
|
|
1260
|
+
state: z.literal("Failed"),
|
|
1261
|
+
latencyMs: z.number(),
|
|
1262
|
+
status: z.number().optional(),
|
|
1263
|
+
kind: ClassificationFailureKindSchema,
|
|
1264
|
+
field: ClassificationFieldSchema.optional(),
|
|
1265
|
+
fix: z.string()
|
|
1187
1266
|
});
|
|
1188
1267
|
|
|
1189
1268
|
export const CalendarTaskResponseSchema = z.object({
|