@remit/api-zod-schemas 0.0.101 → 0.0.103
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 +23 -21
- package/middleware.d.ts.map +1 -1
- package/middleware.js +61 -5
- package/middleware.js.map +1 -1
- package/middleware.ts +61 -6
- package/package.json +1 -1
- package/schemas.d.ts +919 -900
- package/schemas.d.ts.map +1 -1
- package/schemas.js +112 -101
- package/schemas.js.map +1 -1
- package/schemas.ts +135 -122
package/schemas.ts
CHANGED
|
@@ -41,6 +41,16 @@ export const ClassificationPresetIdSchema = z.enum(["Jev", "Jina", "Mistral", "G
|
|
|
41
41
|
|
|
42
42
|
export const ClassificationDefaultSourceSchema = z.enum(["Config", "Operator"]);
|
|
43
43
|
|
|
44
|
+
export const ClassificationPresetGroupSchema = z.enum(["Hosted", "Custom", "Local"]);
|
|
45
|
+
|
|
46
|
+
export const ClassificationAdapterShapeSchema = z.enum(["DecisionApi", "ChatJsonSchema", "JinaClassify"]);
|
|
47
|
+
|
|
48
|
+
export const ClassificationValueSourceSchema = z.enum(["Saved", "Deployment", "Default"]);
|
|
49
|
+
|
|
50
|
+
export const ClassificationUnrunnableReasonSchema = z.enum(["NoBaseUrl", "NoApiKey"]);
|
|
51
|
+
|
|
52
|
+
export const SpamLabelPlacementSchema = z.enum(["MoveToSpam", "WarnOnly"]);
|
|
53
|
+
|
|
44
54
|
export const PersonStatusSchema = z.enum(["Active", "Disabled"]);
|
|
45
55
|
|
|
46
56
|
export const PeopleErrorCodeSchema = z.enum(["sign_in_disabled", "caller_disabled", "foreign_origin", "step_up_required", "wrong_password", "step_up_locked", "cannot_disable_self"]);
|
|
@@ -105,16 +115,6 @@ export const RecurrenceScopeSchema = z.enum(["This", "Following", "All"]);
|
|
|
105
115
|
|
|
106
116
|
export const CalendarInviteAnswerSchema = z.enum(["Accepted", "Tentative", "Declined"]);
|
|
107
117
|
|
|
108
|
-
export const ClassificationPresetGroupSchema = z.enum(["Hosted", "Custom", "Local"]);
|
|
109
|
-
|
|
110
|
-
export const ClassificationAdapterShapeSchema = z.enum(["DecisionApi", "ChatJsonSchema", "JinaClassify"]);
|
|
111
|
-
|
|
112
|
-
export const ClassificationValueSourceSchema = z.enum(["Saved", "Deployment", "Default"]);
|
|
113
|
-
|
|
114
|
-
export const ClassificationUnrunnableReasonSchema = z.enum(["NoBaseUrl", "NoApiKey"]);
|
|
115
|
-
|
|
116
|
-
export const SpamLabelPlacementSchema = z.enum(["MoveToSpam", "WarnOnly"]);
|
|
117
|
-
|
|
118
118
|
export const ClassificationFailureKindSchema = z.enum(["Unauthorized", "ModelNotFound", "RateLimited", "Rejected", "ProviderError", "Unreachable", "TimedOut", "Unparseable"]);
|
|
119
119
|
|
|
120
120
|
export const ClassificationFieldSchema = z.enum(["ApiKey", "Model", "BaseUrl"]);
|
|
@@ -707,6 +707,107 @@ export const PutClassificationDefaultInputSchema = z.object({
|
|
|
707
707
|
dailyLimit: z.number()
|
|
708
708
|
});
|
|
709
709
|
|
|
710
|
+
export const ClassificationPricedSchema = z.object({
|
|
711
|
+
state: z.literal("Priced"),
|
|
712
|
+
currency: z.literal("USD"),
|
|
713
|
+
perMillionInputTokens: z.number()
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
export const ClassificationNoPriceSchema = z.object({
|
|
717
|
+
state: z.literal("NoPrice")
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
export const ClassificationPresetSchema = z.object({
|
|
721
|
+
presetId: ClassificationPresetIdSchema,
|
|
722
|
+
label: z.string(),
|
|
723
|
+
group: ClassificationPresetGroupSchema,
|
|
724
|
+
adapterShape: ClassificationAdapterShapeSchema,
|
|
725
|
+
defaultBaseUrl: z.string().optional(),
|
|
726
|
+
defaultModel: z.string(),
|
|
727
|
+
needsKey: z.boolean(),
|
|
728
|
+
price: z.union([ClassificationPricedSchema, ClassificationNoPriceSchema])
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
export const ClassificationNotConfiguredSchema = z.object({
|
|
732
|
+
state: z.literal("NotConfigured")
|
|
733
|
+
});
|
|
734
|
+
|
|
735
|
+
export const ClassificationSourcesSchema = z.object({
|
|
736
|
+
presetId: ClassificationValueSourceSchema,
|
|
737
|
+
model: ClassificationValueSourceSchema,
|
|
738
|
+
baseUrl: ClassificationValueSourceSchema,
|
|
739
|
+
apiKey: ClassificationValueSourceSchema,
|
|
740
|
+
enabled: ClassificationValueSourceSchema,
|
|
741
|
+
dailyLimit: ClassificationValueSourceSchema
|
|
742
|
+
});
|
|
743
|
+
|
|
744
|
+
export const ClassificationCostPricedSchema = z.object({
|
|
745
|
+
state: z.literal("Priced"),
|
|
746
|
+
currency: z.literal("USD"),
|
|
747
|
+
amount: z.number()
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
export const ClassificationUsageSchema = z.object({
|
|
751
|
+
accountId: z.string().min(25).max(25),
|
|
752
|
+
calls: z.number(),
|
|
753
|
+
dailyLimit: z.number(),
|
|
754
|
+
resetsAt: z.string().datetime(),
|
|
755
|
+
cost: z.union([ClassificationCostPricedSchema, ClassificationNoPriceSchema])
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
export const ClassificationConfiguredSchema = z.object({
|
|
759
|
+
state: z.literal("Configured"),
|
|
760
|
+
presetId: ClassificationPresetIdSchema,
|
|
761
|
+
model: z.string(),
|
|
762
|
+
baseUrl: z.string(),
|
|
763
|
+
enabled: z.boolean(),
|
|
764
|
+
dailyLimit: z.number(),
|
|
765
|
+
sources: ClassificationSourcesSchema,
|
|
766
|
+
usage: z.array(ClassificationUsageSchema)
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
export const ClassificationUnrunnableSchema = z.object({
|
|
770
|
+
state: z.literal("Unrunnable"),
|
|
771
|
+
presetId: ClassificationPresetIdSchema,
|
|
772
|
+
reason: ClassificationUnrunnableReasonSchema
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
export const SpamThresholdsUnsetSchema = z.object({
|
|
776
|
+
state: z.literal("Unset")
|
|
777
|
+
});
|
|
778
|
+
|
|
779
|
+
export const SpamThresholdsSetSchema = z.object({
|
|
780
|
+
state: z.literal("Set"),
|
|
781
|
+
cleanBelow: z.number().min(0).max(1),
|
|
782
|
+
spamAt: z.number().min(0).max(1)
|
|
783
|
+
});
|
|
784
|
+
|
|
785
|
+
export const SpamSettingsSchema = z.object({
|
|
786
|
+
thresholds: z.union([SpamThresholdsUnsetSchema, SpamThresholdsSetSchema]),
|
|
787
|
+
spamPlacement: SpamLabelPlacementSchema,
|
|
788
|
+
phishingPlacement: SpamLabelPlacementSchema
|
|
789
|
+
});
|
|
790
|
+
|
|
791
|
+
export const UserSettingsResponseSchema = z.object({
|
|
792
|
+
defaultInvitationSenderAccountId: z.string().min(25).max(25).optional(),
|
|
793
|
+
defaultInvitationSenderChosen: z.boolean(),
|
|
794
|
+
classificationPresets: z.array(ClassificationPresetSchema),
|
|
795
|
+
classification: z.union([ClassificationNotConfiguredSchema, ClassificationConfiguredSchema, ClassificationUnrunnableSchema]),
|
|
796
|
+
spam: SpamSettingsSchema
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
export const UpdateUserSettingsInputSchema = z.object({
|
|
800
|
+
defaultInvitationSenderAccountId: z.string().min(25).max(25).optional(),
|
|
801
|
+
classificationPresetId: ClassificationPresetIdSchema.optional(),
|
|
802
|
+
classificationModel: z.string().optional(),
|
|
803
|
+
classificationBaseUrl: z.string().optional(),
|
|
804
|
+
classificationApiKey: z.string().optional(),
|
|
805
|
+
classificationEnabled: z.boolean().optional(),
|
|
806
|
+
classificationDailyLimit: z.number().min(1).optional(),
|
|
807
|
+
spamPlacementSpam: SpamLabelPlacementSchema.optional(),
|
|
808
|
+
spamPlacementPhishing: SpamLabelPlacementSchema.optional()
|
|
809
|
+
});
|
|
810
|
+
|
|
710
811
|
export const PersonSchema = z.object({
|
|
711
812
|
userId: z.string(),
|
|
712
813
|
email: z.string(),
|
|
@@ -725,7 +826,29 @@ export const PeopleForbiddenErrorSchema = z.object({
|
|
|
725
826
|
statusCode: z.literal(403),
|
|
726
827
|
message: z.string(),
|
|
727
828
|
details: z.record(z.string(), z.string()).optional(),
|
|
728
|
-
code: z.union([z.literal("sign_in_disabled"), z.literal("caller_disabled"), z.literal("foreign_origin"), z.literal("step_up_required"), z.literal("wrong_password")])
|
|
829
|
+
code: z.union([z.literal("sign_in_disabled"), z.literal("caller_disabled"), z.literal("foreign_origin"), z.literal("step_up_required"), z.literal("wrong_password"), z.literal("forbidden")])
|
|
830
|
+
});
|
|
831
|
+
|
|
832
|
+
export const PeopleAuditEventSchema = z.object({
|
|
833
|
+
auditEventId: z.string(),
|
|
834
|
+
occurredAt: z.number(),
|
|
835
|
+
actor: z.string(),
|
|
836
|
+
target: z.string(),
|
|
837
|
+
action: z.string(),
|
|
838
|
+
outcome: z.string(),
|
|
839
|
+
clientIp: z.string()
|
|
840
|
+
});
|
|
841
|
+
|
|
842
|
+
export const PeopleAuditResponseSchema = z.object({
|
|
843
|
+
events: z.array(PeopleAuditEventSchema)
|
|
844
|
+
});
|
|
845
|
+
|
|
846
|
+
export const InvitePersonInputSchema = z.object({
|
|
847
|
+
email: z.string()
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
export const PersonInviteResponseSchema = z.object({
|
|
851
|
+
email: z.string()
|
|
729
852
|
});
|
|
730
853
|
|
|
731
854
|
export const StepUpInputSchema = z.object({
|
|
@@ -746,13 +869,8 @@ export const StepUpLockedErrorSchema = z.object({
|
|
|
746
869
|
code: z.literal("step_up_locked")
|
|
747
870
|
});
|
|
748
871
|
|
|
749
|
-
export const SignOutPersonInputSchema = z.object({
|
|
750
|
-
stepUpToken: z.string()
|
|
751
|
-
});
|
|
752
|
-
|
|
753
872
|
export const UpdatePersonInputSchema = z.object({
|
|
754
|
-
status: PersonStatusSchema
|
|
755
|
-
stepUpToken: z.string()
|
|
873
|
+
status: PersonStatusSchema
|
|
756
874
|
});
|
|
757
875
|
|
|
758
876
|
export const CannotDisableSelfErrorSchema = z.object({
|
|
@@ -762,10 +880,6 @@ export const CannotDisableSelfErrorSchema = z.object({
|
|
|
762
880
|
code: z.literal("cannot_disable_self")
|
|
763
881
|
});
|
|
764
882
|
|
|
765
|
-
export const CreatePasswordResetInputSchema = z.object({
|
|
766
|
-
stepUpToken: z.string()
|
|
767
|
-
});
|
|
768
|
-
|
|
769
883
|
export const PasswordResetResponseSchema = z.object({
|
|
770
884
|
person: PersonSchema,
|
|
771
885
|
resetUrl: z.string(),
|
|
@@ -1340,107 +1454,6 @@ export const CalendarFreeBusyResponseSchema = z.object({
|
|
|
1340
1454
|
items: z.array(CalendarFreeBusySpanSchema)
|
|
1341
1455
|
});
|
|
1342
1456
|
|
|
1343
|
-
export const ClassificationPricedSchema = z.object({
|
|
1344
|
-
state: z.literal("Priced"),
|
|
1345
|
-
currency: z.literal("USD"),
|
|
1346
|
-
perMillionInputTokens: z.number()
|
|
1347
|
-
});
|
|
1348
|
-
|
|
1349
|
-
export const ClassificationNoPriceSchema = z.object({
|
|
1350
|
-
state: z.literal("NoPrice")
|
|
1351
|
-
});
|
|
1352
|
-
|
|
1353
|
-
export const ClassificationPresetSchema = z.object({
|
|
1354
|
-
presetId: ClassificationPresetIdSchema,
|
|
1355
|
-
label: z.string(),
|
|
1356
|
-
group: ClassificationPresetGroupSchema,
|
|
1357
|
-
adapterShape: ClassificationAdapterShapeSchema,
|
|
1358
|
-
defaultBaseUrl: z.string().optional(),
|
|
1359
|
-
defaultModel: z.string(),
|
|
1360
|
-
needsKey: z.boolean(),
|
|
1361
|
-
price: z.union([ClassificationPricedSchema, ClassificationNoPriceSchema])
|
|
1362
|
-
});
|
|
1363
|
-
|
|
1364
|
-
export const ClassificationNotConfiguredSchema = z.object({
|
|
1365
|
-
state: z.literal("NotConfigured")
|
|
1366
|
-
});
|
|
1367
|
-
|
|
1368
|
-
export const ClassificationSourcesSchema = z.object({
|
|
1369
|
-
presetId: ClassificationValueSourceSchema,
|
|
1370
|
-
model: ClassificationValueSourceSchema,
|
|
1371
|
-
baseUrl: ClassificationValueSourceSchema,
|
|
1372
|
-
apiKey: ClassificationValueSourceSchema,
|
|
1373
|
-
enabled: ClassificationValueSourceSchema,
|
|
1374
|
-
dailyLimit: ClassificationValueSourceSchema
|
|
1375
|
-
});
|
|
1376
|
-
|
|
1377
|
-
export const ClassificationCostPricedSchema = z.object({
|
|
1378
|
-
state: z.literal("Priced"),
|
|
1379
|
-
currency: z.literal("USD"),
|
|
1380
|
-
amount: z.number()
|
|
1381
|
-
});
|
|
1382
|
-
|
|
1383
|
-
export const ClassificationUsageSchema = z.object({
|
|
1384
|
-
accountId: z.string().min(25).max(25),
|
|
1385
|
-
calls: z.number(),
|
|
1386
|
-
dailyLimit: z.number(),
|
|
1387
|
-
resetsAt: z.string().datetime(),
|
|
1388
|
-
cost: z.union([ClassificationCostPricedSchema, ClassificationNoPriceSchema])
|
|
1389
|
-
});
|
|
1390
|
-
|
|
1391
|
-
export const ClassificationConfiguredSchema = z.object({
|
|
1392
|
-
state: z.literal("Configured"),
|
|
1393
|
-
presetId: ClassificationPresetIdSchema,
|
|
1394
|
-
model: z.string(),
|
|
1395
|
-
baseUrl: z.string(),
|
|
1396
|
-
enabled: z.boolean(),
|
|
1397
|
-
dailyLimit: z.number(),
|
|
1398
|
-
sources: ClassificationSourcesSchema,
|
|
1399
|
-
usage: z.array(ClassificationUsageSchema)
|
|
1400
|
-
});
|
|
1401
|
-
|
|
1402
|
-
export const ClassificationUnrunnableSchema = z.object({
|
|
1403
|
-
state: z.literal("Unrunnable"),
|
|
1404
|
-
presetId: ClassificationPresetIdSchema,
|
|
1405
|
-
reason: ClassificationUnrunnableReasonSchema
|
|
1406
|
-
});
|
|
1407
|
-
|
|
1408
|
-
export const SpamThresholdsUnsetSchema = z.object({
|
|
1409
|
-
state: z.literal("Unset")
|
|
1410
|
-
});
|
|
1411
|
-
|
|
1412
|
-
export const SpamThresholdsSetSchema = z.object({
|
|
1413
|
-
state: z.literal("Set"),
|
|
1414
|
-
cleanBelow: z.number().min(0).max(1),
|
|
1415
|
-
spamAt: z.number().min(0).max(1)
|
|
1416
|
-
});
|
|
1417
|
-
|
|
1418
|
-
export const SpamSettingsSchema = z.object({
|
|
1419
|
-
thresholds: z.union([SpamThresholdsUnsetSchema, SpamThresholdsSetSchema]),
|
|
1420
|
-
spamPlacement: SpamLabelPlacementSchema,
|
|
1421
|
-
phishingPlacement: SpamLabelPlacementSchema
|
|
1422
|
-
});
|
|
1423
|
-
|
|
1424
|
-
export const UserSettingsResponseSchema = z.object({
|
|
1425
|
-
defaultInvitationSenderAccountId: z.string().min(25).max(25).optional(),
|
|
1426
|
-
defaultInvitationSenderChosen: z.boolean(),
|
|
1427
|
-
classificationPresets: z.array(ClassificationPresetSchema),
|
|
1428
|
-
classification: z.union([ClassificationNotConfiguredSchema, ClassificationConfiguredSchema, ClassificationUnrunnableSchema]),
|
|
1429
|
-
spam: SpamSettingsSchema
|
|
1430
|
-
});
|
|
1431
|
-
|
|
1432
|
-
export const UpdateUserSettingsInputSchema = z.object({
|
|
1433
|
-
defaultInvitationSenderAccountId: z.string().min(25).max(25).optional(),
|
|
1434
|
-
classificationPresetId: ClassificationPresetIdSchema.optional(),
|
|
1435
|
-
classificationModel: z.string().optional(),
|
|
1436
|
-
classificationBaseUrl: z.string().optional(),
|
|
1437
|
-
classificationApiKey: z.string().optional(),
|
|
1438
|
-
classificationEnabled: z.boolean().optional(),
|
|
1439
|
-
classificationDailyLimit: z.number().min(1).optional(),
|
|
1440
|
-
spamPlacementSpam: SpamLabelPlacementSchema.optional(),
|
|
1441
|
-
spamPlacementPhishing: SpamLabelPlacementSchema.optional()
|
|
1442
|
-
});
|
|
1443
|
-
|
|
1444
1457
|
export const ClassificationTestInputSchema = z.object({
|
|
1445
1458
|
presetId: ClassificationPresetIdSchema,
|
|
1446
1459
|
model: z.string(),
|