@oxide/turnstile.ts 0.6.7 → 0.7.0-rc.0
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/dist/{Api-tAayYJvL.d.cts → Api-Z7zZcVks.d.cts} +145 -34
- package/dist/{Api-tAayYJvL.d.ts → Api-Z7zZcVks.d.ts} +145 -34
- package/dist/Api.cjs +87 -0
- package/dist/Api.d.cts +1 -1
- package/dist/Api.d.ts +1 -1
- package/dist/Api.js +87 -0
- package/dist/retry.cjs +87 -0
- package/dist/retry.d.cts +1 -1
- package/dist/retry.d.ts +1 -1
- package/dist/retry.js +87 -0
- package/dist/validate.cjs +196 -41
- package/dist/validate.d.cts +1438 -663
- package/dist/validate.d.ts +1438 -663
- package/dist/validate.js +180 -41
- package/package.json +1 -1
- package/src/Api.ts +200 -32
- package/src/util.ts +1 -1
- package/src/validate.ts +195 -47
package/dist/validate.js
CHANGED
|
@@ -54,6 +54,7 @@ var DocumentParent = z.preprocess(
|
|
|
54
54
|
var TypedUuidForDepartmentId = z.preprocess(processResponseBody, z.string().uuid());
|
|
55
55
|
var TypedUuidForRoleId = z.preprocess(processResponseBody, z.string().uuid());
|
|
56
56
|
var TypedUuidForListingId = z.preprocess(processResponseBody, z.string().uuid());
|
|
57
|
+
var TypedUuidForPoolId = z.preprocess(processResponseBody, z.string().uuid());
|
|
57
58
|
var TypedUuidForReviewerId = z.preprocess(processResponseBody, z.string().uuid());
|
|
58
59
|
var TypedUuidForReviewId = z.preprocess(processResponseBody, z.string().uuid());
|
|
59
60
|
var TypedUuidForInterviewerId = z.preprocess(processResponseBody, z.string().uuid());
|
|
@@ -107,6 +108,10 @@ var TurnstilePermission = z.preprocess(
|
|
|
107
108
|
"GetListingsAll",
|
|
108
109
|
"CreateListing",
|
|
109
110
|
"ManageListingsAll",
|
|
111
|
+
"GetPoolsAssigned",
|
|
112
|
+
"GetPoolsAll",
|
|
113
|
+
"CreatePool",
|
|
114
|
+
"ManagePoolsAll",
|
|
110
115
|
"GetReviewersAssigned",
|
|
111
116
|
"GetReviewersAll",
|
|
112
117
|
"GetReviewerSelf",
|
|
@@ -217,6 +222,8 @@ var TurnstilePermission = z.preprocess(
|
|
|
217
222
|
z.object({ "GetRoles": TypedUuidForRoleId.array().refine(...uniqueItems) }),
|
|
218
223
|
z.object({ "GetListing": TypedUuidForListingId }),
|
|
219
224
|
z.object({ "GetListings": TypedUuidForListingId.array().refine(...uniqueItems) }),
|
|
225
|
+
z.object({ "GetPool": TypedUuidForPoolId }),
|
|
226
|
+
z.object({ "GetPools": TypedUuidForPoolId.array().refine(...uniqueItems) }),
|
|
220
227
|
z.object({ "GetReviewer": TypedUuidForReviewerId }),
|
|
221
228
|
z.object({ "GetReviewers": TypedUuidForReviewerId.array().refine(...uniqueItems) }),
|
|
222
229
|
z.object({ "CreateReviewer": TypedUuidForUserId }),
|
|
@@ -501,6 +508,18 @@ var ApplicationStateRecord = z.preprocess(
|
|
|
501
508
|
"updatedAt": z.coerce.date()
|
|
502
509
|
})
|
|
503
510
|
);
|
|
511
|
+
var ListingPoolAssociation = z.preprocess(processResponseBody, z.enum(["first", "early_positive", "positive"]));
|
|
512
|
+
var PoolAction = z.preprocess(
|
|
513
|
+
processResponseBody,
|
|
514
|
+
z.union([
|
|
515
|
+
z.object({
|
|
516
|
+
"action": z.enum(["add"]),
|
|
517
|
+
"association": ListingPoolAssociation,
|
|
518
|
+
"count": z.number().min(0).max(4294967295)
|
|
519
|
+
}),
|
|
520
|
+
z.object({ "action": z.enum(["triage"]) })
|
|
521
|
+
])
|
|
522
|
+
);
|
|
504
523
|
var ReviewScore = z.preprocess(
|
|
505
524
|
processResponseBody,
|
|
506
525
|
z.enum(["emphatic_yes", "yes", "pass", "no", "emphatic_no", "incomplete"])
|
|
@@ -518,6 +537,7 @@ var Reviews = z.preprocess(
|
|
|
518
537
|
var ExpandedApplicationSummary = z.preprocess(
|
|
519
538
|
processResponseBody,
|
|
520
539
|
z.object({
|
|
540
|
+
"action": PoolAction,
|
|
521
541
|
"applicant": ApplicantInfo,
|
|
522
542
|
"application": Application,
|
|
523
543
|
"documents": Document.array(),
|
|
@@ -542,6 +562,10 @@ var ApplicationSummaryResponse = z.preprocess(
|
|
|
542
562
|
processResponseBody,
|
|
543
563
|
z.object({ "summary": ExpandedApplicationSummary, "users": Evaluator.array() })
|
|
544
564
|
);
|
|
565
|
+
var AssignPool = z.preprocess(
|
|
566
|
+
processResponseBody,
|
|
567
|
+
z.object({ "association": ListingPoolAssociation, "listing": TypedUuidForListingId })
|
|
568
|
+
);
|
|
545
569
|
var AttachDocument = z.preprocess(
|
|
546
570
|
processResponseBody,
|
|
547
571
|
z.object({ "externalId": z.string(), "mime": z.string().optional() })
|
|
@@ -608,6 +632,14 @@ var CreateMapper = z.preprocess(
|
|
|
608
632
|
"rule": z.record(z.unknown())
|
|
609
633
|
})
|
|
610
634
|
);
|
|
635
|
+
var CreatePool = z.preprocess(
|
|
636
|
+
processResponseBody,
|
|
637
|
+
z.object({
|
|
638
|
+
"description": z.string().optional(),
|
|
639
|
+
"name": z.string(),
|
|
640
|
+
"reviwers": TypedUuidForReviewerId.array().optional()
|
|
641
|
+
})
|
|
642
|
+
);
|
|
611
643
|
var CreateReview = z.preprocess(
|
|
612
644
|
processResponseBody,
|
|
613
645
|
z.object({
|
|
@@ -642,45 +674,7 @@ var ReviewAssignment = z.preprocess(
|
|
|
642
674
|
"updatedAt": z.coerce.date()
|
|
643
675
|
})
|
|
644
676
|
);
|
|
645
|
-
var
|
|
646
|
-
var NotificationMedium = z.preprocess(processResponseBody, z.enum(["Email"]));
|
|
647
|
-
var RenderedEmail = z.preprocess(
|
|
648
|
-
processResponseBody,
|
|
649
|
-
z.object({
|
|
650
|
-
"from": z.string(),
|
|
651
|
-
"html": z.string().optional(),
|
|
652
|
-
"name": z.string(),
|
|
653
|
-
"subject": z.string(),
|
|
654
|
-
"text": z.string()
|
|
655
|
-
})
|
|
656
|
-
);
|
|
657
|
-
var RecipientId = z.preprocess(
|
|
658
|
-
processResponseBody,
|
|
659
|
-
z.union([
|
|
660
|
-
z.object({ "Applicant": TypedUuidForApplicantId }),
|
|
661
|
-
z.object({ "Custom": z.string() }),
|
|
662
|
-
z.object({ "Reviewer": TypedUuidForReviewerId })
|
|
663
|
-
])
|
|
664
|
-
);
|
|
665
|
-
var NotificationStatus = z.preprocess(processResponseBody, z.enum(["Failed", "Pending", "Scheduled", "Sent"]));
|
|
666
|
-
var Notification_for_RenderedEmail = z.preprocess(
|
|
667
|
-
processResponseBody,
|
|
668
|
-
z.object({
|
|
669
|
-
"createdAt": z.coerce.date(),
|
|
670
|
-
"deletedAt": z.coerce.date().optional(),
|
|
671
|
-
"id": TypedUuidForNotificationId,
|
|
672
|
-
"kind": z.string(),
|
|
673
|
-
"medium": NotificationMedium,
|
|
674
|
-
"message": RenderedEmail.optional(),
|
|
675
|
-
"recipient": RecipientId,
|
|
676
|
-
"status": NotificationStatus,
|
|
677
|
-
"updatedAt": z.coerce.date()
|
|
678
|
-
})
|
|
679
|
-
);
|
|
680
|
-
var CreatedAssignment = z.preprocess(
|
|
681
|
-
processResponseBody,
|
|
682
|
-
z.object({ "assignment": ReviewAssignment, "notification": Notification_for_RenderedEmail })
|
|
683
|
-
);
|
|
677
|
+
var CreatedAssignment = z.preprocess(processResponseBody, z.object({ "assignment": ReviewAssignment }));
|
|
684
678
|
var CreateReviewAssignmentsResponse = z.preprocess(
|
|
685
679
|
processResponseBody,
|
|
686
680
|
z.object({
|
|
@@ -795,6 +789,19 @@ var Listing = z.preprocess(
|
|
|
795
789
|
"updatedAt": z.coerce.date()
|
|
796
790
|
})
|
|
797
791
|
);
|
|
792
|
+
var TypedUuidForListingPoolId = z.preprocess(processResponseBody, z.string().uuid());
|
|
793
|
+
var ListingPool = z.preprocess(
|
|
794
|
+
processResponseBody,
|
|
795
|
+
z.object({
|
|
796
|
+
"association": ListingPoolAssociation,
|
|
797
|
+
"createdAt": z.coerce.date(),
|
|
798
|
+
"deletedAt": z.coerce.date().optional(),
|
|
799
|
+
"id": TypedUuidForListingPoolId,
|
|
800
|
+
"listingId": TypedUuidForListingId,
|
|
801
|
+
"poolId": TypedUuidForPoolId,
|
|
802
|
+
"updatedAt": z.coerce.date()
|
|
803
|
+
})
|
|
804
|
+
);
|
|
798
805
|
var TypedUuidForMagicLinkRedirectUriId = z.preprocess(processResponseBody, z.string().uuid());
|
|
799
806
|
var MagicLinkRedirectUri = z.preprocess(
|
|
800
807
|
processResponseBody,
|
|
@@ -865,11 +872,46 @@ var Mapper = z.preprocess(
|
|
|
865
872
|
"updatedAt": z.coerce.date()
|
|
866
873
|
})
|
|
867
874
|
);
|
|
875
|
+
var NotificationMedium = z.preprocess(processResponseBody, z.enum(["Email"]));
|
|
876
|
+
var NotificationStatus = z.preprocess(processResponseBody, z.enum(["Failed", "Pending", "Scheduled", "Sent"]));
|
|
877
|
+
var TypedUuidForNotificationId = z.preprocess(processResponseBody, z.string().uuid());
|
|
878
|
+
var RenderedEmail = z.preprocess(
|
|
879
|
+
processResponseBody,
|
|
880
|
+
z.object({
|
|
881
|
+
"from": z.string(),
|
|
882
|
+
"html": z.string().optional(),
|
|
883
|
+
"name": z.string(),
|
|
884
|
+
"subject": z.string(),
|
|
885
|
+
"text": z.string()
|
|
886
|
+
})
|
|
887
|
+
);
|
|
888
|
+
var RecipientId = z.preprocess(
|
|
889
|
+
processResponseBody,
|
|
890
|
+
z.union([
|
|
891
|
+
z.object({ "Applicant": TypedUuidForApplicantId }),
|
|
892
|
+
z.object({ "Custom": z.string() }),
|
|
893
|
+
z.object({ "Reviewer": TypedUuidForReviewerId })
|
|
894
|
+
])
|
|
895
|
+
);
|
|
896
|
+
var Notification_for_RenderedEmail = z.preprocess(
|
|
897
|
+
processResponseBody,
|
|
898
|
+
z.object({
|
|
899
|
+
"createdAt": z.coerce.date(),
|
|
900
|
+
"deletedAt": z.coerce.date().optional(),
|
|
901
|
+
"id": TypedUuidForNotificationId,
|
|
902
|
+
"kind": z.string(),
|
|
903
|
+
"medium": NotificationMedium,
|
|
904
|
+
"message": RenderedEmail.optional(),
|
|
905
|
+
"recipient": RecipientId,
|
|
906
|
+
"status": NotificationStatus,
|
|
907
|
+
"updatedAt": z.coerce.date()
|
|
908
|
+
})
|
|
909
|
+
);
|
|
868
910
|
var OAuthAuthzCodeExchangeBody = z.preprocess(
|
|
869
911
|
processResponseBody,
|
|
870
912
|
z.object({
|
|
871
|
-
"clientId": TypedUuidForOAuthClientId,
|
|
872
|
-
"clientSecret": SecretString,
|
|
913
|
+
"clientId": TypedUuidForOAuthClientId.optional(),
|
|
914
|
+
"clientSecret": SecretString.optional(),
|
|
873
915
|
"code": z.string(),
|
|
874
916
|
"grantType": z.string(),
|
|
875
917
|
"pkceVerifier": z.string().optional(),
|
|
@@ -981,6 +1023,19 @@ var Operation_for_TurnstilePermission_and_TransitionApplicationToDeferredBatchEn
|
|
|
981
1023
|
})
|
|
982
1024
|
);
|
|
983
1025
|
var OptionalTransitionBody = z.preprocess(processResponseBody, z.object({ "message": EmailConfig.optional() }));
|
|
1026
|
+
var Pool = z.preprocess(
|
|
1027
|
+
processResponseBody,
|
|
1028
|
+
z.object({
|
|
1029
|
+
"createdAt": z.coerce.date(),
|
|
1030
|
+
"deletedAt": z.coerce.date().optional(),
|
|
1031
|
+
"description": z.string().optional(),
|
|
1032
|
+
"id": TypedUuidForPoolId,
|
|
1033
|
+
"listings": ListingPool.array(),
|
|
1034
|
+
"name": z.string(),
|
|
1035
|
+
"reviewers": TypedUuidForReviewerId.array(),
|
|
1036
|
+
"updatedAt": z.coerce.date()
|
|
1037
|
+
})
|
|
1038
|
+
);
|
|
984
1039
|
var RegisterApplicant = z.preprocess(processResponseBody, z.object({ "email": z.string() }));
|
|
985
1040
|
var Review = z.preprocess(
|
|
986
1041
|
processResponseBody,
|
|
@@ -1256,6 +1311,15 @@ var ViewApplicationParams = z.preprocess(
|
|
|
1256
1311
|
query: z.object({})
|
|
1257
1312
|
})
|
|
1258
1313
|
);
|
|
1314
|
+
var ApplyReviewActionParams = z.preprocess(
|
|
1315
|
+
processResponseBody,
|
|
1316
|
+
z.object({
|
|
1317
|
+
path: z.object({
|
|
1318
|
+
application: TypedUuidForApplicationId
|
|
1319
|
+
}),
|
|
1320
|
+
query: z.object({})
|
|
1321
|
+
})
|
|
1322
|
+
);
|
|
1259
1323
|
var ListApplicationReviewAssignmentsParams = z.preprocess(
|
|
1260
1324
|
processResponseBody,
|
|
1261
1325
|
z.object({
|
|
@@ -1314,6 +1378,15 @@ var GetApplicationInterviewCodeParams = z.preprocess(
|
|
|
1314
1378
|
query: z.object({})
|
|
1315
1379
|
})
|
|
1316
1380
|
);
|
|
1381
|
+
var SimulateReviewActionParams = z.preprocess(
|
|
1382
|
+
processResponseBody,
|
|
1383
|
+
z.object({
|
|
1384
|
+
path: z.object({
|
|
1385
|
+
application: TypedUuidForApplicationId
|
|
1386
|
+
}),
|
|
1387
|
+
query: z.object({})
|
|
1388
|
+
})
|
|
1389
|
+
);
|
|
1317
1390
|
var SubmitApplicationParams = z.preprocess(
|
|
1318
1391
|
processResponseBody,
|
|
1319
1392
|
z.object({
|
|
@@ -1864,6 +1937,56 @@ var DeleteOauthClientSecretParams = z.preprocess(
|
|
|
1864
1937
|
query: z.object({})
|
|
1865
1938
|
})
|
|
1866
1939
|
);
|
|
1940
|
+
var ListPoolsParams = z.preprocess(
|
|
1941
|
+
processResponseBody,
|
|
1942
|
+
z.object({
|
|
1943
|
+
path: z.object({}),
|
|
1944
|
+
query: z.object({})
|
|
1945
|
+
})
|
|
1946
|
+
);
|
|
1947
|
+
var CreatePoolParams = z.preprocess(
|
|
1948
|
+
processResponseBody,
|
|
1949
|
+
z.object({
|
|
1950
|
+
path: z.object({}),
|
|
1951
|
+
query: z.object({})
|
|
1952
|
+
})
|
|
1953
|
+
);
|
|
1954
|
+
var ViewPoolParams = z.preprocess(
|
|
1955
|
+
processResponseBody,
|
|
1956
|
+
z.object({
|
|
1957
|
+
path: z.object({
|
|
1958
|
+
pool: TypedUuidForPoolId
|
|
1959
|
+
}),
|
|
1960
|
+
query: z.object({})
|
|
1961
|
+
})
|
|
1962
|
+
);
|
|
1963
|
+
var UpdatePoolParams = z.preprocess(
|
|
1964
|
+
processResponseBody,
|
|
1965
|
+
z.object({
|
|
1966
|
+
path: z.object({
|
|
1967
|
+
pool: TypedUuidForPoolId
|
|
1968
|
+
}),
|
|
1969
|
+
query: z.object({})
|
|
1970
|
+
})
|
|
1971
|
+
);
|
|
1972
|
+
var AssignPoolParams = z.preprocess(
|
|
1973
|
+
processResponseBody,
|
|
1974
|
+
z.object({
|
|
1975
|
+
path: z.object({
|
|
1976
|
+
pool: TypedUuidForPoolId
|
|
1977
|
+
}),
|
|
1978
|
+
query: z.object({})
|
|
1979
|
+
})
|
|
1980
|
+
);
|
|
1981
|
+
var UnassignPoolParams = z.preprocess(
|
|
1982
|
+
processResponseBody,
|
|
1983
|
+
z.object({
|
|
1984
|
+
path: z.object({
|
|
1985
|
+
assignment: TypedUuidForListingPoolId
|
|
1986
|
+
}),
|
|
1987
|
+
query: z.object({})
|
|
1988
|
+
})
|
|
1989
|
+
);
|
|
1867
1990
|
var ListReviewsParams = z.preprocess(
|
|
1868
1991
|
processResponseBody,
|
|
1869
1992
|
z.object({
|
|
@@ -1991,6 +2114,9 @@ export {
|
|
|
1991
2114
|
ApplicationStateRecord,
|
|
1992
2115
|
ApplicationSummariesResponse,
|
|
1993
2116
|
ApplicationSummaryResponse,
|
|
2117
|
+
ApplyReviewActionParams,
|
|
2118
|
+
AssignPool,
|
|
2119
|
+
AssignPoolParams,
|
|
1994
2120
|
AttachDocument,
|
|
1995
2121
|
AttachDocumentParams,
|
|
1996
2122
|
AuthzCodeCallbackParams,
|
|
@@ -2022,6 +2148,8 @@ export {
|
|
|
2022
2148
|
CreateOauthClientSecretParams,
|
|
2023
2149
|
CreateOperationApplicationTransitionDeclineParams,
|
|
2024
2150
|
CreateOperationApplicationTransitionDeferParams,
|
|
2151
|
+
CreatePool,
|
|
2152
|
+
CreatePoolParams,
|
|
2025
2153
|
CreateReview,
|
|
2026
2154
|
CreateReviewAssignments,
|
|
2027
2155
|
CreateReviewAssignmentsResponse,
|
|
@@ -2089,11 +2217,14 @@ export {
|
|
|
2089
2217
|
ListOauthClientsParams,
|
|
2090
2218
|
ListOperationTasksParams,
|
|
2091
2219
|
ListOperationsParams,
|
|
2220
|
+
ListPoolsParams,
|
|
2092
2221
|
ListReviewSummariesParams,
|
|
2093
2222
|
ListReviewersParams,
|
|
2094
2223
|
ListReviewsParams,
|
|
2095
2224
|
ListRolesParams,
|
|
2096
2225
|
Listing,
|
|
2226
|
+
ListingPool,
|
|
2227
|
+
ListingPoolAssociation,
|
|
2097
2228
|
MagicLink,
|
|
2098
2229
|
MagicLinkExchangeParams,
|
|
2099
2230
|
MagicLinkExchangeRequest,
|
|
@@ -2126,6 +2257,8 @@ export {
|
|
|
2126
2257
|
Operation_for_TurnstilePermission_and_TransitionApplicationToDeferredBatchEndpoint,
|
|
2127
2258
|
OptionalTransitionBody,
|
|
2128
2259
|
Permissions_for_TurnstilePermission,
|
|
2260
|
+
Pool,
|
|
2261
|
+
PoolAction,
|
|
2129
2262
|
RecipientId,
|
|
2130
2263
|
RegisterApplicant,
|
|
2131
2264
|
RegisterApplicantParams,
|
|
@@ -2147,6 +2280,7 @@ export {
|
|
|
2147
2280
|
ScalarApplicationState,
|
|
2148
2281
|
SecretString,
|
|
2149
2282
|
SetApiUserContactEmailParams,
|
|
2283
|
+
SimulateReviewActionParams,
|
|
2150
2284
|
SubmitApplicationParams,
|
|
2151
2285
|
TransitionApplicationToDeclinedBatch,
|
|
2152
2286
|
TransitionApplicationToDeclinedBatchEndpoint,
|
|
@@ -2176,6 +2310,7 @@ export {
|
|
|
2176
2310
|
TypedUuidForInterviewId,
|
|
2177
2311
|
TypedUuidForInterviewerId,
|
|
2178
2312
|
TypedUuidForListingId,
|
|
2313
|
+
TypedUuidForListingPoolId,
|
|
2179
2314
|
TypedUuidForMagicLinkAttemptId,
|
|
2180
2315
|
TypedUuidForMagicLinkId,
|
|
2181
2316
|
TypedUuidForMagicLinkRedirectUriId,
|
|
@@ -2188,12 +2323,14 @@ export {
|
|
|
2188
2323
|
TypedUuidForOnboardingId,
|
|
2189
2324
|
TypedUuidForOperationId,
|
|
2190
2325
|
TypedUuidForOperationTaskId,
|
|
2326
|
+
TypedUuidForPoolId,
|
|
2191
2327
|
TypedUuidForReviewAssignmentId,
|
|
2192
2328
|
TypedUuidForReviewId,
|
|
2193
2329
|
TypedUuidForReviewerId,
|
|
2194
2330
|
TypedUuidForRoleId,
|
|
2195
2331
|
TypedUuidForUserId,
|
|
2196
2332
|
TypedUuidForUserProviderId,
|
|
2333
|
+
UnassignPoolParams,
|
|
2197
2334
|
UpdateApiUserParams,
|
|
2198
2335
|
UpdateApplicantContact,
|
|
2199
2336
|
UpdateApplicantContactParams,
|
|
@@ -2205,6 +2342,7 @@ export {
|
|
|
2205
2342
|
UpdateListing,
|
|
2206
2343
|
UpdateListingParams,
|
|
2207
2344
|
UpdateListingStateParams,
|
|
2345
|
+
UpdatePoolParams,
|
|
2208
2346
|
UpdateReview,
|
|
2209
2347
|
UpdateReviewParams,
|
|
2210
2348
|
ViewApplicantParams,
|
|
@@ -2216,6 +2354,7 @@ export {
|
|
|
2216
2354
|
ViewDocumentDataParams,
|
|
2217
2355
|
ViewDocumentParams,
|
|
2218
2356
|
ViewListingParams,
|
|
2357
|
+
ViewPoolParams,
|
|
2219
2358
|
ViewReviewParams,
|
|
2220
2359
|
ViewRoleParams
|
|
2221
2360
|
};
|