@remit/api-zod-schemas 0.0.70 → 0.0.72
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 +10 -0
- package/middleware.d.ts.map +1 -1
- package/middleware.js +10 -1
- package/middleware.js.map +1 -1
- package/middleware.ts +10 -0
- package/package.json +1 -1
- package/schemas.d.ts +138 -0
- package/schemas.d.ts.map +1 -1
- package/schemas.js +47 -3
- package/schemas.js.map +1 -1
- package/schemas.ts +57 -3
package/schemas.ts
CHANGED
|
@@ -97,6 +97,12 @@ export const ClassificationPresetGroupSchema = z.enum(["Hosted", "Custom", "Loca
|
|
|
97
97
|
|
|
98
98
|
export const ClassificationAdapterShapeSchema = z.enum(["DecisionApi", "ChatJsonSchema", "JinaClassify"]);
|
|
99
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
|
+
|
|
100
106
|
export const SortOrderSchema = z.enum(["asc", "desc"]);
|
|
101
107
|
|
|
102
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"]);
|
|
@@ -161,7 +167,7 @@ export const ContentEncodingSchema = z.enum(["none", "gzip", "zstd"]);
|
|
|
161
167
|
|
|
162
168
|
export const SenderOverrideSchema = z.enum(["none", "blocked", "neverSpam"]);
|
|
163
169
|
|
|
164
|
-
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"]);
|
|
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", "ClassificationUsage"]);
|
|
165
171
|
|
|
166
172
|
export const ConfigImportStateSchema = z.enum(["Pending", "Complete"]);
|
|
167
173
|
|
|
@@ -1208,6 +1214,20 @@ export const ClassificationNotConfiguredSchema = z.object({
|
|
|
1208
1214
|
state: z.literal("NotConfigured")
|
|
1209
1215
|
});
|
|
1210
1216
|
|
|
1217
|
+
export const ClassificationCostPricedSchema = z.object({
|
|
1218
|
+
state: z.literal("Priced"),
|
|
1219
|
+
currency: z.literal("USD"),
|
|
1220
|
+
amount: z.number()
|
|
1221
|
+
});
|
|
1222
|
+
|
|
1223
|
+
export const ClassificationUsageSchema = z.object({
|
|
1224
|
+
accountId: z.string().min(25).max(25),
|
|
1225
|
+
calls: z.number(),
|
|
1226
|
+
dailyLimit: z.number(),
|
|
1227
|
+
resetsAt: z.string().datetime(),
|
|
1228
|
+
cost: z.union([ClassificationCostPricedSchema, ClassificationNoPriceSchema])
|
|
1229
|
+
});
|
|
1230
|
+
|
|
1211
1231
|
export const ClassificationConfiguredSchema = z.object({
|
|
1212
1232
|
state: z.literal("Configured"),
|
|
1213
1233
|
presetId: ClassificationPresetIdSchema,
|
|
@@ -1216,7 +1236,8 @@ export const ClassificationConfiguredSchema = z.object({
|
|
|
1216
1236
|
apiKeySaved: z.boolean(),
|
|
1217
1237
|
enabled: z.boolean(),
|
|
1218
1238
|
dailyLimit: z.number(),
|
|
1219
|
-
savedAt: z.number()
|
|
1239
|
+
savedAt: z.number(),
|
|
1240
|
+
usage: z.array(ClassificationUsageSchema)
|
|
1220
1241
|
});
|
|
1221
1242
|
|
|
1222
1243
|
export const UserSettingsResponseSchema = z.object({
|
|
@@ -1236,6 +1257,29 @@ export const UpdateUserSettingsInputSchema = z.object({
|
|
|
1236
1257
|
classificationDailyLimit: z.number().min(1).optional()
|
|
1237
1258
|
});
|
|
1238
1259
|
|
|
1260
|
+
export const ClassificationTestInputSchema = z.object({
|
|
1261
|
+
presetId: ClassificationPresetIdSchema,
|
|
1262
|
+
model: z.string(),
|
|
1263
|
+
baseUrl: z.string(),
|
|
1264
|
+
apiKey: z.string()
|
|
1265
|
+
});
|
|
1266
|
+
|
|
1267
|
+
export const ClassificationTestPassedSchema = z.object({
|
|
1268
|
+
state: z.literal("Passed"),
|
|
1269
|
+
latencyMs: z.number(),
|
|
1270
|
+
label: ClassificationLabelSchema,
|
|
1271
|
+
confidence: z.number()
|
|
1272
|
+
});
|
|
1273
|
+
|
|
1274
|
+
export const ClassificationTestFailedSchema = z.object({
|
|
1275
|
+
state: z.literal("Failed"),
|
|
1276
|
+
latencyMs: z.number(),
|
|
1277
|
+
status: z.number().optional(),
|
|
1278
|
+
kind: ClassificationFailureKindSchema,
|
|
1279
|
+
field: ClassificationFieldSchema.optional(),
|
|
1280
|
+
fix: z.string()
|
|
1281
|
+
});
|
|
1282
|
+
|
|
1239
1283
|
export const CalendarTaskResponseSchema = z.object({
|
|
1240
1284
|
calendarTaskId: z.string().min(25).max(25),
|
|
1241
1285
|
calendarId: z.string().min(25).max(25),
|
|
@@ -2142,11 +2186,21 @@ export const MutedFlagSettingSchema = z.object({
|
|
|
2142
2186
|
value: MutedFlagSchema
|
|
2143
2187
|
});
|
|
2144
2188
|
|
|
2189
|
+
export const DailyCountSchema = z.object({
|
|
2190
|
+
date: z.string().date(),
|
|
2191
|
+
calls: z.number()
|
|
2192
|
+
});
|
|
2193
|
+
|
|
2194
|
+
export const DailyCountSettingSchema = z.object({
|
|
2195
|
+
kind: z.literal("DailyCount"),
|
|
2196
|
+
value: DailyCountSchema
|
|
2197
|
+
});
|
|
2198
|
+
|
|
2145
2199
|
export const AccountSettingSchema = z.object({
|
|
2146
2200
|
accountSettingId: z.string().min(25).max(25),
|
|
2147
2201
|
accountConfigId: z.string().min(25).max(25),
|
|
2148
2202
|
name: z.string(),
|
|
2149
|
-
value: z.union([BooleanSettingSchema, StringSettingSchema, NumberSettingSchema, StringListSettingSchema, MapSettingSchema, MutedFlagSettingSchema]),
|
|
2203
|
+
value: z.union([BooleanSettingSchema, StringSettingSchema, NumberSettingSchema, StringListSettingSchema, MapSettingSchema, MutedFlagSettingSchema, DailyCountSettingSchema]),
|
|
2150
2204
|
createdAt: z.number(),
|
|
2151
2205
|
updatedAt: z.number()
|
|
2152
2206
|
});
|