@oxy.so/contracts 4.17.0 → 4.21.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.
Files changed (50) hide show
  1. package/dist/cjs/accountAccess.js +72 -0
  2. package/dist/cjs/agency.js +112 -1
  3. package/dist/cjs/applicationRoles.js +211 -0
  4. package/dist/cjs/client/check.js +9 -0
  5. package/dist/cjs/client/index.js +22 -1
  6. package/dist/cjs/client/safety.js +183 -2
  7. package/dist/cjs/client/signIn.js +2 -0
  8. package/dist/cjs/index.js +13 -3
  9. package/dist/cjs/safety.js +430 -1
  10. package/dist/cjs/serviceToken.js +14 -0
  11. package/dist/esm/accountAccess.js +69 -0
  12. package/dist/esm/agency.js +111 -0
  13. package/dist/esm/applicationRoles.js +207 -0
  14. package/dist/esm/client/check.js +8 -0
  15. package/dist/esm/client/index.js +1 -1
  16. package/dist/esm/client/safety.js +183 -2
  17. package/dist/esm/client/signIn.js +2 -0
  18. package/dist/esm/index.js +4 -1
  19. package/dist/esm/safety.js +423 -0
  20. package/dist/esm/serviceToken.js +11 -0
  21. package/dist/types/accountAccess.d.ts +128 -0
  22. package/dist/types/accountEmail.d.ts +2 -2
  23. package/dist/types/agency.d.ts +327 -2
  24. package/dist/types/agentKeys.d.ts +6 -6
  25. package/dist/types/applicationRoles.d.ts +438 -0
  26. package/dist/types/client/agentKeys.d.ts +2 -2
  27. package/dist/types/client/check.d.ts +3 -0
  28. package/dist/types/client/deviceSession.d.ts +1 -1
  29. package/dist/types/client/index.d.ts +1 -1
  30. package/dist/types/client/safety.d.ts +204 -4
  31. package/dist/types/client/signIn.d.ts +1 -1
  32. package/dist/types/deviceSession.d.ts +4 -4
  33. package/dist/types/email/messages.d.ts +2 -2
  34. package/dist/types/externalIdentity.d.ts +4 -4
  35. package/dist/types/index.d.ts +5 -2
  36. package/dist/types/inference/accountBilling.d.ts +2 -2
  37. package/dist/types/inference/catalogue.d.ts +22 -22
  38. package/dist/types/inference/providerConnection.d.ts +4 -4
  39. package/dist/types/inference/realtime.d.ts +74 -74
  40. package/dist/types/inference/request.d.ts +60 -60
  41. package/dist/types/inference/usage.d.ts +4 -4
  42. package/dist/types/products/access.d.ts +4 -4
  43. package/dist/types/safety.d.ts +2374 -2
  44. package/dist/types/serviceToken.d.ts +11 -0
  45. package/dist/types/signIn.d.ts +5 -5
  46. package/dist/types/userResponse.d.ts +2 -2
  47. package/package.json +5 -20
  48. package/dist/cjs/.tsbuildinfo +0 -1
  49. package/dist/esm/.tsbuildinfo +0 -1
  50. package/dist/types/.tsbuildinfo +0 -1
@@ -0,0 +1,438 @@
1
+ /**
2
+ * Application roles — the wire contract for permissions an APPLICATION declares
3
+ * about its own users, and for the grants that give them to Oxy users.
4
+ *
5
+ * Oxy decides who holds an app's operator powers (who may run Mercaria's
6
+ * payments desk, moderate GoWay, administer Homiio), so no app keeps an
7
+ * allow-list of Oxy user ids in its environment. The app declares a closed
8
+ * vocabulary of keys, its owners grant them to people, and the app's backend
9
+ * asks Oxy which of them the human behind a request holds
10
+ * (`GET /applications/:appId/roles/me`, read through `@oxy.so/core/server`).
11
+ *
12
+ * ## Why an application key can never collide with an Oxy permission
13
+ *
14
+ * Every permission Oxy itself checks (`app:update`, `apps:create`,
15
+ * `credentials:rotate`, every scope) is spelled with a COLON. An application key
16
+ * is dot-separated lowercase segments and cannot contain one, so the two
17
+ * vocabularies are disjoint by syntax, not by convention. They are also stored
18
+ * apart (scoped to one application id) and no Oxy gate ever reads an
19
+ * application key. A key means something only to the application that declared
20
+ * it.
21
+ *
22
+ * The pattern is exported as a SOURCE string because the API renders the same
23
+ * text into a Postgres CHECK; JavaScript's `RegExp` and Postgres' ARE agree on
24
+ * everything it uses (anchors, classes, a capturing group, a bounded repeat).
25
+ *
26
+ * Platform-agnostic — zod only, no react/react-native/expo.
27
+ */
28
+ import { z } from 'zod';
29
+ /**
30
+ * Two to four dot-separated segments, each a lowercase letter followed by
31
+ * lowercase letters, digits or underscores: `payments.operate`,
32
+ * `catalog.review.publish`. At least two segments so a key always names an
33
+ * area and an action; never a colon (see the header).
34
+ */
35
+ export declare const APPLICATION_PERMISSION_KEY_PATTERN_SOURCE = "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,3}$";
36
+ export declare const APPLICATION_PERMISSION_KEY_PATTERN: RegExp;
37
+ export declare const APPLICATION_PERMISSION_KEY_MAX_LENGTH = 64;
38
+ export declare const APPLICATION_PERMISSION_DESCRIPTION_MAX_LENGTH = 280;
39
+ /** How many live keys one application may declare. Operator powers are few. */
40
+ export declare const APPLICATION_PERMISSIONS_MAX_DECLARED = 64;
41
+ export declare const APPLICATION_ROLE_REASON_MAX_LENGTH = 500;
42
+ export declare const APPLICATION_ROLE_GRANTS_PAGE_DEFAULT = 50;
43
+ export declare const APPLICATION_ROLE_GRANTS_PAGE_MAX = 200;
44
+ /**
45
+ * The `error` codes the application-roles routes answer beyond the generic
46
+ * ones (`BAD_REQUEST`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`). Renaming one
47
+ * is a breaking change.
48
+ */
49
+ export declare const APPLICATION_ROLE_ERROR_CODES: {
50
+ /** 403: a grant naming yourself on an application you do not own outright. */
51
+ readonly selfGrantForbidden: "SELF_GRANT_FORBIDDEN";
52
+ /** 422: the key is not a live declared permission of this application. */
53
+ readonly unknownPermission: "UNKNOWN_PERMISSION";
54
+ /** 422: the grantee is not a person (an organization, project, bot or channel). */
55
+ readonly granteeNotAPerson: "GRANTEE_NOT_A_PERSON";
56
+ /** 409: the grantee already holds the key; `details.grantId` names the live grant. */
57
+ readonly alreadyGranted: "ALREADY_GRANTED";
58
+ /** 409: the grant was already revoked. */
59
+ readonly alreadyRevoked: "ALREADY_REVOKED";
60
+ /** 403: the bearer's session belongs to a DIFFERENT application. */
61
+ readonly sessionApplicationMismatch: "SESSION_APPLICATION_MISMATCH";
62
+ };
63
+ export type ApplicationRoleErrorCode = (typeof APPLICATION_ROLE_ERROR_CODES)[keyof typeof APPLICATION_ROLE_ERROR_CODES];
64
+ /** Whether `value` is a well-formed application permission key. */
65
+ export declare function isApplicationPermissionKey(value: unknown): value is string;
66
+ export declare const applicationPermissionKeySchema: z.ZodString;
67
+ /** One key as the application's owners declare it. */
68
+ export declare const applicationPermissionDeclarationSchema: z.ZodObject<{
69
+ key: z.ZodString;
70
+ description: z.ZodEffects<z.ZodString, string, string>;
71
+ }, "strict", z.ZodTypeAny, {
72
+ description: string;
73
+ key: string;
74
+ }, {
75
+ description: string;
76
+ key: string;
77
+ }>;
78
+ /**
79
+ * `PUT /applications/:appId/roles/permissions` — the WHOLE vocabulary.
80
+ *
81
+ * Declarative: a key present here and not live is added, a live key absent
82
+ * here is retired (and every grant of it revoked), a live key present here
83
+ * keeps its identity and takes the new description. Sending the same body twice
84
+ * changes nothing.
85
+ */
86
+ export declare const declareApplicationPermissionsRequestSchema: z.ZodEffects<z.ZodObject<{
87
+ permissions: z.ZodArray<z.ZodObject<{
88
+ key: z.ZodString;
89
+ description: z.ZodEffects<z.ZodString, string, string>;
90
+ }, "strict", z.ZodTypeAny, {
91
+ description: string;
92
+ key: string;
93
+ }, {
94
+ description: string;
95
+ key: string;
96
+ }>, "many">;
97
+ }, "strict", z.ZodTypeAny, {
98
+ permissions: {
99
+ description: string;
100
+ key: string;
101
+ }[];
102
+ }, {
103
+ permissions: {
104
+ description: string;
105
+ key: string;
106
+ }[];
107
+ }>, {
108
+ permissions: {
109
+ description: string;
110
+ key: string;
111
+ }[];
112
+ }, {
113
+ permissions: {
114
+ description: string;
115
+ key: string;
116
+ }[];
117
+ }>;
118
+ /** A declared key. Retired keys are history: they confer nothing. */
119
+ export declare const applicationPermissionSchema: z.ZodObject<{
120
+ key: z.ZodString;
121
+ description: z.ZodString;
122
+ declaredAt: z.ZodString;
123
+ declaredByUserId: z.ZodNullable<z.ZodString>;
124
+ retiredAt: z.ZodNullable<z.ZodString>;
125
+ retiredByUserId: z.ZodNullable<z.ZodString>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ description: string;
128
+ key: string;
129
+ declaredAt: string;
130
+ declaredByUserId: string | null;
131
+ retiredAt: string | null;
132
+ retiredByUserId: string | null;
133
+ }, {
134
+ description: string;
135
+ key: string;
136
+ declaredAt: string;
137
+ declaredByUserId: string | null;
138
+ retiredAt: string | null;
139
+ retiredByUserId: string | null;
140
+ }>;
141
+ export declare const applicationPermissionListSchema: z.ZodObject<{
142
+ items: z.ZodArray<z.ZodObject<{
143
+ key: z.ZodString;
144
+ description: z.ZodString;
145
+ declaredAt: z.ZodString;
146
+ declaredByUserId: z.ZodNullable<z.ZodString>;
147
+ retiredAt: z.ZodNullable<z.ZodString>;
148
+ retiredByUserId: z.ZodNullable<z.ZodString>;
149
+ }, "strip", z.ZodTypeAny, {
150
+ description: string;
151
+ key: string;
152
+ declaredAt: string;
153
+ declaredByUserId: string | null;
154
+ retiredAt: string | null;
155
+ retiredByUserId: string | null;
156
+ }, {
157
+ description: string;
158
+ key: string;
159
+ declaredAt: string;
160
+ declaredByUserId: string | null;
161
+ retiredAt: string | null;
162
+ retiredByUserId: string | null;
163
+ }>, "many">;
164
+ }, "strip", z.ZodTypeAny, {
165
+ items: {
166
+ description: string;
167
+ key: string;
168
+ declaredAt: string;
169
+ declaredByUserId: string | null;
170
+ retiredAt: string | null;
171
+ retiredByUserId: string | null;
172
+ }[];
173
+ }, {
174
+ items: {
175
+ description: string;
176
+ key: string;
177
+ declaredAt: string;
178
+ declaredByUserId: string | null;
179
+ retiredAt: string | null;
180
+ retiredByUserId: string | null;
181
+ }[];
182
+ }>;
183
+ export declare const declareApplicationPermissionsResponseSchema: z.ZodObject<{
184
+ items: z.ZodArray<z.ZodObject<{
185
+ key: z.ZodString;
186
+ description: z.ZodString;
187
+ declaredAt: z.ZodString;
188
+ declaredByUserId: z.ZodNullable<z.ZodString>;
189
+ retiredAt: z.ZodNullable<z.ZodString>;
190
+ retiredByUserId: z.ZodNullable<z.ZodString>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ description: string;
193
+ key: string;
194
+ declaredAt: string;
195
+ declaredByUserId: string | null;
196
+ retiredAt: string | null;
197
+ retiredByUserId: string | null;
198
+ }, {
199
+ description: string;
200
+ key: string;
201
+ declaredAt: string;
202
+ declaredByUserId: string | null;
203
+ retiredAt: string | null;
204
+ retiredByUserId: string | null;
205
+ }>, "many">;
206
+ } & {
207
+ /** Keys that became live with this declaration. */
208
+ added: z.ZodArray<z.ZodString, "many">;
209
+ /** Keys this declaration retired. */
210
+ retired: z.ZodArray<z.ZodString, "many">;
211
+ /** Live keys whose description changed. */
212
+ described: z.ZodArray<z.ZodString, "many">;
213
+ /** Live grants revoked because their key was retired. */
214
+ revokedGrants: z.ZodNumber;
215
+ }, "strip", z.ZodTypeAny, {
216
+ items: {
217
+ description: string;
218
+ key: string;
219
+ declaredAt: string;
220
+ declaredByUserId: string | null;
221
+ retiredAt: string | null;
222
+ retiredByUserId: string | null;
223
+ }[];
224
+ added: string[];
225
+ retired: string[];
226
+ described: string[];
227
+ revokedGrants: number;
228
+ }, {
229
+ items: {
230
+ description: string;
231
+ key: string;
232
+ declaredAt: string;
233
+ declaredByUserId: string | null;
234
+ retiredAt: string | null;
235
+ retiredByUserId: string | null;
236
+ }[];
237
+ added: string[];
238
+ retired: string[];
239
+ described: string[];
240
+ revokedGrants: number;
241
+ }>;
242
+ /** One grant of one key to one Oxy user. Revocation is a stamp, never a delete. */
243
+ export declare const applicationRoleGrantSchema: z.ZodObject<{
244
+ id: z.ZodString;
245
+ applicationId: z.ZodString;
246
+ permission: z.ZodString;
247
+ userId: z.ZodString;
248
+ /** The grantee's handle, for display. */
249
+ username: z.ZodNullable<z.ZodString>;
250
+ /** The HUMAN who granted it; null once that account was erased. */
251
+ grantedByUserId: z.ZodNullable<z.ZodString>;
252
+ grantedAt: z.ZodString;
253
+ grantReason: z.ZodNullable<z.ZodString>;
254
+ revokedAt: z.ZodNullable<z.ZodString>;
255
+ revokedByUserId: z.ZodNullable<z.ZodString>;
256
+ revokeReason: z.ZodNullable<z.ZodString>;
257
+ }, "strip", z.ZodTypeAny, {
258
+ username: string | null;
259
+ id: string;
260
+ applicationId: string;
261
+ revokedAt: string | null;
262
+ userId: string;
263
+ permission: string;
264
+ grantedByUserId: string | null;
265
+ grantedAt: string;
266
+ grantReason: string | null;
267
+ revokedByUserId: string | null;
268
+ revokeReason: string | null;
269
+ }, {
270
+ username: string | null;
271
+ id: string;
272
+ applicationId: string;
273
+ revokedAt: string | null;
274
+ userId: string;
275
+ permission: string;
276
+ grantedByUserId: string | null;
277
+ grantedAt: string;
278
+ grantReason: string | null;
279
+ revokedByUserId: string | null;
280
+ revokeReason: string | null;
281
+ }>;
282
+ export declare const applicationRoleGrantListSchema: z.ZodObject<{
283
+ items: z.ZodArray<z.ZodObject<{
284
+ id: z.ZodString;
285
+ applicationId: z.ZodString;
286
+ permission: z.ZodString;
287
+ userId: z.ZodString;
288
+ /** The grantee's handle, for display. */
289
+ username: z.ZodNullable<z.ZodString>;
290
+ /** The HUMAN who granted it; null once that account was erased. */
291
+ grantedByUserId: z.ZodNullable<z.ZodString>;
292
+ grantedAt: z.ZodString;
293
+ grantReason: z.ZodNullable<z.ZodString>;
294
+ revokedAt: z.ZodNullable<z.ZodString>;
295
+ revokedByUserId: z.ZodNullable<z.ZodString>;
296
+ revokeReason: z.ZodNullable<z.ZodString>;
297
+ }, "strip", z.ZodTypeAny, {
298
+ username: string | null;
299
+ id: string;
300
+ applicationId: string;
301
+ revokedAt: string | null;
302
+ userId: string;
303
+ permission: string;
304
+ grantedByUserId: string | null;
305
+ grantedAt: string;
306
+ grantReason: string | null;
307
+ revokedByUserId: string | null;
308
+ revokeReason: string | null;
309
+ }, {
310
+ username: string | null;
311
+ id: string;
312
+ applicationId: string;
313
+ revokedAt: string | null;
314
+ userId: string;
315
+ permission: string;
316
+ grantedByUserId: string | null;
317
+ grantedAt: string;
318
+ grantReason: string | null;
319
+ revokedByUserId: string | null;
320
+ revokeReason: string | null;
321
+ }>, "many">;
322
+ nextCursor: z.ZodNullable<z.ZodString>;
323
+ }, "strip", z.ZodTypeAny, {
324
+ items: {
325
+ username: string | null;
326
+ id: string;
327
+ applicationId: string;
328
+ revokedAt: string | null;
329
+ userId: string;
330
+ permission: string;
331
+ grantedByUserId: string | null;
332
+ grantedAt: string;
333
+ grantReason: string | null;
334
+ revokedByUserId: string | null;
335
+ revokeReason: string | null;
336
+ }[];
337
+ nextCursor: string | null;
338
+ }, {
339
+ items: {
340
+ username: string | null;
341
+ id: string;
342
+ applicationId: string;
343
+ revokedAt: string | null;
344
+ userId: string;
345
+ permission: string;
346
+ grantedByUserId: string | null;
347
+ grantedAt: string;
348
+ grantReason: string | null;
349
+ revokedByUserId: string | null;
350
+ revokeReason: string | null;
351
+ }[];
352
+ nextCursor: string | null;
353
+ }>;
354
+ /** `POST /applications/:appId/roles/grants` — name the grantee by id OR handle. */
355
+ export declare const createApplicationRoleGrantRequestSchema: z.ZodEffects<z.ZodObject<{
356
+ userId: z.ZodOptional<z.ZodString>;
357
+ username: z.ZodOptional<z.ZodString>;
358
+ permission: z.ZodString;
359
+ reason: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
360
+ }, "strict", z.ZodTypeAny, {
361
+ permission: string;
362
+ username?: string | undefined;
363
+ reason?: string | undefined;
364
+ userId?: string | undefined;
365
+ }, {
366
+ permission: string;
367
+ username?: string | undefined;
368
+ reason?: string | undefined;
369
+ userId?: string | undefined;
370
+ }>, {
371
+ permission: string;
372
+ username?: string | undefined;
373
+ reason?: string | undefined;
374
+ userId?: string | undefined;
375
+ }, {
376
+ permission: string;
377
+ username?: string | undefined;
378
+ reason?: string | undefined;
379
+ userId?: string | undefined;
380
+ }>;
381
+ /** `POST /applications/:appId/roles/grants/:grantId/revoke`. */
382
+ export declare const revokeApplicationRoleGrantRequestSchema: z.ZodObject<{
383
+ reason: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
384
+ }, "strict", z.ZodTypeAny, {
385
+ reason?: string | undefined;
386
+ }, {
387
+ reason?: string | undefined;
388
+ }>;
389
+ /** `GET /applications/:appId/roles/grants` query. */
390
+ export declare const listApplicationRoleGrantsQuerySchema: z.ZodObject<{
391
+ permission: z.ZodOptional<z.ZodString>;
392
+ userId: z.ZodOptional<z.ZodString>;
393
+ includeRevoked: z.ZodOptional<z.ZodEffects<z.ZodEnum<["true", "false"]>, boolean, "true" | "false">>;
394
+ limit: z.ZodOptional<z.ZodNumber>;
395
+ cursor: z.ZodOptional<z.ZodString>;
396
+ }, "strict", z.ZodTypeAny, {
397
+ limit?: number | undefined;
398
+ cursor?: string | undefined;
399
+ userId?: string | undefined;
400
+ permission?: string | undefined;
401
+ includeRevoked?: boolean | undefined;
402
+ }, {
403
+ limit?: number | undefined;
404
+ cursor?: string | undefined;
405
+ userId?: string | undefined;
406
+ permission?: string | undefined;
407
+ includeRevoked?: "true" | "false" | undefined;
408
+ }>;
409
+ /**
410
+ * `GET /applications/:appId/roles/me` — the keys the HUMAN behind the bearer
411
+ * holds for this application, in no particular order. `userId` is that human
412
+ * (the operator), which is NOT the account the session speaks as when a person
413
+ * is acting as an organization.
414
+ */
415
+ export declare const applicationRolesMeSchema: z.ZodObject<{
416
+ applicationId: z.ZodString;
417
+ userId: z.ZodString;
418
+ permissions: z.ZodArray<z.ZodString, "many">;
419
+ }, "strip", z.ZodTypeAny, {
420
+ permissions: string[];
421
+ applicationId: string;
422
+ userId: string;
423
+ }, {
424
+ permissions: string[];
425
+ applicationId: string;
426
+ userId: string;
427
+ }>;
428
+ export type ApplicationPermissionDeclaration = z.infer<typeof applicationPermissionDeclarationSchema>;
429
+ export type DeclareApplicationPermissionsRequest = z.infer<typeof declareApplicationPermissionsRequestSchema>;
430
+ export type ApplicationPermissionDefinition = z.infer<typeof applicationPermissionSchema>;
431
+ export type ApplicationPermissionList = z.infer<typeof applicationPermissionListSchema>;
432
+ export type DeclareApplicationPermissionsResponse = z.infer<typeof declareApplicationPermissionsResponseSchema>;
433
+ export type ApplicationRoleGrant = z.infer<typeof applicationRoleGrantSchema>;
434
+ export type ApplicationRoleGrantList = z.infer<typeof applicationRoleGrantListSchema>;
435
+ export type CreateApplicationRoleGrantRequest = z.infer<typeof createApplicationRoleGrantRequestSchema>;
436
+ export type RevokeApplicationRoleGrantRequest = z.infer<typeof revokeApplicationRoleGrantRequestSchema>;
437
+ export type ListApplicationRoleGrantsQuery = z.infer<typeof listApplicationRoleGrantsQuerySchema>;
438
+ export type ApplicationRolesMe = z.infer<typeof applicationRolesMeSchema>;
@@ -10,8 +10,8 @@ export type AgentProofAction = (typeof AGENT_PROOF_ACTIONS)[number];
10
10
  export declare const ACCOUNT_AUTH_METHODS: readonly ["identity", "agent_key"];
11
11
  export type AccountAuthMethod = (typeof ACCOUNT_AUTH_METHODS)[number];
12
12
  export declare const agentProofClaimsCheck: import("./check").Check<{
13
- expiresAt: number;
14
13
  accountId: string;
14
+ expiresAt: number;
15
15
  version: 1;
16
16
  audience: "oxy-api/agent";
17
17
  action: "agent_signin" | "agent_enroll" | "agent_rotate" | "agent_recover" | "agent_governance";
@@ -82,8 +82,8 @@ export declare const executeAgentKeyOperationCheck: import("./check").Check<{
82
82
  }>;
83
83
  export declare const agentKeyOperationChallengeCheck: import("./check").Check<{
84
84
  claims: {
85
- expiresAt: number;
86
85
  accountId: string;
86
+ expiresAt: number;
87
87
  version: 1;
88
88
  audience: "oxy-api/agent";
89
89
  action: "agent_signin" | "agent_enroll" | "agent_rotate" | "agent_recover" | "agent_governance";
@@ -24,6 +24,7 @@
24
24
  * strictObject(shape) unknown keys FAIL (`.strict()`)
25
25
  * looseObject(shape) unknown keys are KEPT (`.passthrough()`)
26
26
  * refine(c, test) a further condition, run once `c` passes
27
+ * transform(c, f) `f` rewrites the value once `c` passes
27
28
  * union / discriminatedUnion as Zod 3 reports them
28
29
  *
29
30
  * A failure carries the first issue Zod would report and whether Zod would have
@@ -113,6 +114,8 @@ export declare function refineAt<T>(inner: Check<T>, test: (value: T) => {
113
114
  path: CheckPath;
114
115
  message: string;
115
116
  } | undefined): Check<T>;
117
+ /** Zod's `.transform()`: rewrites a value `inner` accepted. */
118
+ export declare function transform<T, U>(inner: Check<T>, rewrite: (value: T) => U): Check<U>;
116
119
  /** Narrows a checked value to a branded contract type (Zod's `.brand()`). */
117
120
  export declare function branded<T extends B, B>(inner: Check<B>): Check<T>;
118
121
  export interface ArrayRule {
@@ -72,8 +72,8 @@ export declare const sessionAccountsChangedEventCheck: import("./check").Check<{
72
72
  userId: string;
73
73
  }>;
74
74
  export declare const deviceBackgroundCredentialResponseCheck: import("./check").Check<{
75
- expiresAt: string;
76
75
  accountId: string;
76
+ expiresAt: string;
77
77
  deviceId: string;
78
78
  secret: string;
79
79
  }>;
@@ -30,7 +30,7 @@ export { ORGANIZATION_ALIAS_KINDS, ORGANIZATION_CLAIM_DECISIONS, ORGANIZATION_CL
30
30
  export { cancelProductSubscriptionCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productSubscriptionCancellationResultCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products';
31
31
  export { recommendationRequestCheck } from './recommendations';
32
32
  export { isFullReputationBalance } from './reputation';
33
- export { profileAccessDecisionCheck, profileAccessInputCheck } from './safety';
33
+ export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, profileAccessDecisionCheck, profileAccessInputCheck, purchaseApprovalCheck, purchaseApprovalListCheck, purchaseReviewInputCheck, safetyOrganizationsInputCheck, safetyOrganizationsResponseCheck, safetyPeopleInputCheck, safetyPeopleResponseCheck, supervisionAcceptInputCheck, supervisionContactInputCheck, supervisionContactsResponseCheck, supervisionInvitationCheck, supervisionInviteInputCheck, supervisionReviewInputCheck, supervisionStateCheck, } from './safety';
34
34
  export { publicApplicationCheck } from './sessionStatus';
35
35
  export { EMAIL_ACCOUNTS_MAX, EMAIL_SIGNIN_CHOICE_TTL_MS, EMAIL_SIGNIN_LINK_TTL_MS, EMAIL_SIGNIN_LONG_CODE_ALPHABET, EMAIL_SIGNIN_LONG_CODE_LENGTH, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, REAUTH_ACTIONS, SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS, SIGNIN_SECOND_FACTOR_TTL_MS, SIGN_IN_ERROR_CODES, TOTP_BACKUP_CODE_COUNT, TOTP_DIGITS, TOTP_PERIOD_SECONDS, emailSignInChooseAccountCheck, emailSignInLinkResponseCheck, emailSignInPendingCheck, emailSignInStartResponseCheck, isEmailSignInChooseAccount, isSecondFactorRequired, normalizeEmailSignInCode, reauthProofCheck, secondFactorRequiredCheck, signInMethodsCheck, totpBackupCodesResponseCheck, totpEnrollResponseCheck, } from './signIn';
36
36
  export { BOT_USERNAME_INVALID_MESSAGE, BOT_USERNAME_SUFFIX, NUMERIC_USERNAME_MESSAGE, RESERVED_USERNAMES, RESERVED_USERNAME_MESSAGE, USERNAME_INVALID_MESSAGE, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, applyBotUsernameSuffix, botUsernameCheck, stripDisallowedUsernameCharacters, usernameCheck, usernameCheckForAccountKind, } from './username';