@fuzdev/fuz_app 0.161.0 → 0.163.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 (151) hide show
  1. package/dist/auth/CLAUDE.md +47 -36
  2. package/dist/auth/account_action_specs.d.ts +614 -150
  3. package/dist/auth/account_action_specs.d.ts.map +1 -1
  4. package/dist/auth/account_action_specs.js +56 -52
  5. package/dist/auth/account_route_schema.d.ts +401 -94
  6. package/dist/auth/account_route_schema.d.ts.map +1 -1
  7. package/dist/auth/account_route_schema.js +54 -39
  8. package/dist/auth/account_routes.js +1 -1
  9. package/dist/auth/account_schema.d.ts +531 -118
  10. package/dist/auth/account_schema.d.ts.map +1 -1
  11. package/dist/auth/account_schema.js +76 -58
  12. package/dist/auth/admin_action_specs.d.ts +1753 -240
  13. package/dist/auth/admin_action_specs.d.ts.map +1 -1
  14. package/dist/auth/admin_action_specs.js +28 -26
  15. package/dist/auth/admin_actions.d.ts +4 -4
  16. package/dist/auth/admin_actions.d.ts.map +1 -1
  17. package/dist/auth/admin_actions.js +3 -3
  18. package/dist/auth/all_cell_actions.d.ts +3 -3
  19. package/dist/auth/all_cell_actions.d.ts.map +1 -1
  20. package/dist/auth/all_cell_actions.js +1 -1
  21. package/dist/auth/api_token.d.ts +4 -4
  22. package/dist/auth/api_token.d.ts.map +1 -1
  23. package/dist/auth/api_token.js +3 -3
  24. package/dist/auth/audit_emitter.d.ts +8 -3
  25. package/dist/auth/audit_emitter.d.ts.map +1 -1
  26. package/dist/auth/audit_emitter.js +32 -9
  27. package/dist/auth/audit_log_queries.d.ts.map +1 -1
  28. package/dist/auth/audit_log_queries.js +4 -3
  29. package/dist/auth/audit_log_schema.d.ts +798 -291
  30. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  31. package/dist/auth/audit_log_schema.js +192 -201
  32. package/dist/auth/bootstrap_route_schema.d.ts +173 -50
  33. package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
  34. package/dist/auth/bootstrap_route_schema.js +35 -16
  35. package/dist/auth/cell_grant_action_specs.d.ts +1 -1
  36. package/dist/auth/cell_grant_action_specs.js +1 -1
  37. package/dist/auth/cell_grant_actions.d.ts +4 -4
  38. package/dist/auth/cell_grant_actions.d.ts.map +1 -1
  39. package/dist/auth/cell_grant_actions.js +1 -1
  40. package/dist/auth/credential_type_schema.d.ts +16 -29
  41. package/dist/auth/credential_type_schema.d.ts.map +1 -1
  42. package/dist/auth/credential_type_schema.js +14 -18
  43. package/dist/auth/grant_path_schema.d.ts +15 -29
  44. package/dist/auth/grant_path_schema.d.ts.map +1 -1
  45. package/dist/auth/grant_path_schema.js +13 -17
  46. package/dist/auth/invite_schema.d.ts +98 -26
  47. package/dist/auth/invite_schema.d.ts.map +1 -1
  48. package/dist/auth/invite_schema.js +21 -14
  49. package/dist/auth/migrations.d.ts.map +1 -1
  50. package/dist/auth/migrations.js +28 -1
  51. package/dist/auth/name_schema.d.ts +7 -6
  52. package/dist/auth/name_schema.d.ts.map +1 -1
  53. package/dist/auth/name_schema.js +8 -9
  54. package/dist/auth/password.d.ts +15 -7
  55. package/dist/auth/password.d.ts.map +1 -1
  56. package/dist/auth/password.js +16 -9
  57. package/dist/auth/role_grant_offer_action_specs.d.ts +72 -72
  58. package/dist/auth/role_grant_offer_action_specs.js +2 -2
  59. package/dist/auth/role_grant_offer_actions.d.ts +4 -4
  60. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  61. package/dist/auth/role_grant_offer_actions.js +3 -3
  62. package/dist/auth/role_grant_offer_notifications.d.ts +60 -60
  63. package/dist/auth/role_grant_offer_notifications.js +2 -2
  64. package/dist/auth/role_grant_offer_schema.d.ts +8 -8
  65. package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
  66. package/dist/auth/role_grant_offer_schema.js +10 -10
  67. package/dist/auth/role_schema.d.ts +47 -55
  68. package/dist/auth/role_schema.d.ts.map +1 -1
  69. package/dist/auth/role_schema.js +29 -35
  70. package/dist/auth/scope_kind_schema.d.ts +22 -26
  71. package/dist/auth/scope_kind_schema.d.ts.map +1 -1
  72. package/dist/auth/scope_kind_schema.js +19 -19
  73. package/dist/auth/self_service_role_action_specs.js +1 -1
  74. package/dist/auth/self_service_role_actions.d.ts +6 -6
  75. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  76. package/dist/auth/self_service_role_actions.js +7 -6
  77. package/dist/auth/signup_route_schema.d.ts +71 -21
  78. package/dist/auth/signup_route_schema.d.ts.map +1 -1
  79. package/dist/auth/signup_route_schema.js +18 -16
  80. package/dist/auth/standard_rpc_actions.d.ts +1 -1
  81. package/dist/auth/standard_rpc_actions.js +1 -1
  82. package/dist/auth/token_lifetime.d.ts +33 -9
  83. package/dist/auth/token_lifetime.d.ts.map +1 -1
  84. package/dist/auth/token_lifetime.js +8 -7
  85. package/dist/auth/token_scope.d.ts +99 -25
  86. package/dist/auth/token_scope.d.ts.map +1 -1
  87. package/dist/auth/token_scope.js +57 -35
  88. package/dist/dev/setup.d.ts +14 -7
  89. package/dist/dev/setup.d.ts.map +1 -1
  90. package/dist/dev/setup.js +11 -6
  91. package/dist/primitive_schemas.d.ts +2 -22
  92. package/dist/primitive_schemas.d.ts.map +1 -1
  93. package/dist/primitive_schemas.js +2 -24
  94. package/dist/primitive_schemas_fuz.d.ts +56 -2
  95. package/dist/primitive_schemas_fuz.d.ts.map +1 -1
  96. package/dist/primitive_schemas_fuz.js +54 -4
  97. package/dist/testing/CLAUDE.md +29 -8
  98. package/dist/testing/admin_integration.d.ts +3 -3
  99. package/dist/testing/admin_integration.d.ts.map +1 -1
  100. package/dist/testing/admin_integration.js +1 -1
  101. package/dist/testing/app_server.d.ts +3 -1
  102. package/dist/testing/app_server.d.ts.map +1 -1
  103. package/dist/testing/app_server.js +6 -2
  104. package/dist/testing/audit_drift_guard.d.ts.map +1 -1
  105. package/dist/testing/audit_drift_guard.js +12 -13
  106. package/dist/testing/cross_backend/default_spine_surface.d.ts +2 -2
  107. package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
  108. package/dist/testing/cross_backend/default_spine_surface.js +2 -2
  109. package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
  110. package/dist/testing/cross_backend/identity_parity.js +43 -8
  111. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +3 -3
  112. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
  113. package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
  114. package/dist/testing/cross_backend/session_cap.js +4 -3
  115. package/dist/testing/cross_backend/setup.d.ts +1 -1
  116. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  117. package/dist/testing/cross_backend/setup.js +45 -42
  118. package/dist/testing/cross_backend/spine_suites.d.ts +3 -3
  119. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  120. package/dist/testing/cross_backend/standard.d.ts +4 -4
  121. package/dist/testing/cross_backend/standard.d.ts.map +1 -1
  122. package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
  123. package/dist/testing/cross_backend/token_lifetime.js +34 -1
  124. package/dist/testing/db_entities.d.ts +3 -1
  125. package/dist/testing/db_entities.d.ts.map +1 -1
  126. package/dist/testing/db_entities.js +4 -2
  127. package/dist/testing/integration.d.ts.map +1 -1
  128. package/dist/testing/integration.js +4 -3
  129. package/dist/testing/token_scope_fixtures.d.ts +24 -0
  130. package/dist/testing/token_scope_fixtures.d.ts.map +1 -0
  131. package/dist/testing/token_scope_fixtures.js +49 -0
  132. package/dist/testing/transports/bootstrap.d.ts +1 -1
  133. package/dist/testing/transports/bootstrap.d.ts.map +1 -1
  134. package/dist/testing/transports/bootstrap.js +13 -12
  135. package/dist/ui/BootstrapForm.svelte +4 -2
  136. package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
  137. package/dist/ui/SignupForm.svelte +4 -2
  138. package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
  139. package/dist/zod.d.ts +2 -1
  140. package/dist/zod.d.ts.map +1 -1
  141. package/dist/zod.js +6 -2
  142. package/package.json +1 -1
  143. package/dist/auth/audit_log_schema_fuz.d.ts +0 -39
  144. package/dist/auth/audit_log_schema_fuz.d.ts.map +0 -1
  145. package/dist/auth/audit_log_schema_fuz.js +0 -37
  146. package/dist/auth/role_schema_fuz.d.ts +0 -30
  147. package/dist/auth/role_schema_fuz.d.ts.map +0 -1
  148. package/dist/auth/role_schema_fuz.js +0 -30
  149. package/dist/auth/scope_kind_schema_fuz.d.ts +0 -31
  150. package/dist/auth/scope_kind_schema_fuz.d.ts.map +0 -1
  151. package/dist/auth/scope_kind_schema_fuz.js +0 -31
@@ -13,26 +13,90 @@
13
13
  *
14
14
  * @module
15
15
  */
16
- import { z } from 'zod';
17
- /** Input for `POST /bootstrap`. `token` is the one-shot token file contents. */
18
- export declare const BootstrapInput: z.ZodObject<{
19
- token: z.ZodString;
20
- username: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
21
- password: z.ZodString;
22
- }, z.core.$strict>;
23
- export type BootstrapInput = z.infer<typeof BootstrapInput>;
24
- /** Output for `POST /bootstrap`. Session cookie is the operative side effect. */
25
- export declare const BootstrapOutput: z.ZodObject<{
26
- ok: z.ZodLiteral<true>;
27
- account: z.ZodObject<{
28
- id: z.ZodUUID & z.ZodType<import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">, string, z.core.$ZodTypeInternals<import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">, string>>;
29
- username: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
30
- }, z.core.$strict>;
31
- actor: z.ZodObject<{
32
- id: z.ZodUUID & z.ZodType<import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">, string, z.core.$ZodTypeInternals<import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">, string>>;
33
- }, z.core.$strict>;
34
- }, z.core.$strict>;
35
- export type BootstrapOutput = z.infer<typeof BootstrapOutput>;
16
+ import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
17
+ /**
18
+ * The longest `token` `POST /bootstrap` takes, in UTF-16 code units: the token
19
+ * file's cap, `MAX_SECURE_FILE_SIZE` bytes. A token that can match the file is
20
+ * at most that many bytes in UTF-8, and no more code units than bytes, so the
21
+ * bound refuses none that could match. A longer one is a malformed body, a
22
+ * `400 invalid_request_body` refused before the bootstrap window or the token
23
+ * file is read, with no audit row. Twin of the Rust spine's
24
+ * `BOOTSTRAP_TOKEN_LENGTH_MAX`, which counts the same units.
25
+ */
26
+ export declare const BOOTSTRAP_TOKEN_LENGTH_MAX = 4096;
27
+ /**
28
+ * Input for `POST /bootstrap`, a `@fuzdev/fuz_schema` schema. `token` is the
29
+ * one-shot token file contents, 1 to `BOOTSTRAP_TOKEN_LENGTH_MAX` UTF-16 code
30
+ * units.
31
+ */
32
+ export declare const BootstrapInput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
33
+ username: string;
34
+ token: string;
35
+ password: string;
36
+ }, {
37
+ username: string;
38
+ token: string;
39
+ password: string;
40
+ }, "object", {
41
+ token: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
42
+ username: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
43
+ password: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
44
+ }>;
45
+ export type BootstrapInput = Infer<typeof BootstrapInput>;
46
+ /**
47
+ * Output for `POST /bootstrap`, a `@fuzdev/fuz_schema` schema. Session cookie
48
+ * is the operative side effect. Its `username` is the account row's,
49
+ * `UsernameCanonical`.
50
+ */
51
+ export declare const BootstrapOutput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
52
+ account: {
53
+ id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
54
+ username: string;
55
+ };
56
+ actor: {
57
+ id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
58
+ };
59
+ ok: true;
60
+ }, {
61
+ account: {
62
+ id: string;
63
+ username: string;
64
+ };
65
+ actor: {
66
+ id: string;
67
+ };
68
+ ok: true;
69
+ }, "object", {
70
+ ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
71
+ account: import("@fuzdev/fuz_schema/schema.ts").Schema<{
72
+ id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
73
+ username: string;
74
+ }, {
75
+ id: string;
76
+ username: string;
77
+ }, "object", {
78
+ id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
79
+ readonly '~types'?: {
80
+ readonly input: string;
81
+ readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
82
+ } | undefined;
83
+ };
84
+ username: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
85
+ }>;
86
+ actor: import("@fuzdev/fuz_schema/schema.ts").Schema<{
87
+ id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
88
+ }, {
89
+ id: string;
90
+ }, "object", {
91
+ id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
92
+ readonly '~types'?: {
93
+ readonly input: string;
94
+ readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
95
+ } | undefined;
96
+ };
97
+ }>;
98
+ }>;
99
+ export type BootstrapOutput = Infer<typeof BootstrapOutput>;
36
100
  /**
37
101
  * The `POST /bootstrap` route shape minus its handler — pure hono-free data.
38
102
  * `create_bootstrap_route_specs` spreads this and attaches the live handler;
@@ -49,38 +113,97 @@ export declare const bootstrap_route_shape: {
49
113
  mints_credential: true;
50
114
  description: string;
51
115
  transaction: false;
52
- input: z.ZodObject<{
53
- token: z.ZodString;
54
- username: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
55
- password: z.ZodString;
56
- }, z.core.$strict>;
57
- output: z.ZodObject<{
58
- ok: z.ZodLiteral<true>;
59
- account: z.ZodObject<{
60
- id: z.ZodUUID & z.ZodType<import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">, string, z.core.$ZodTypeInternals<import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">, string>>;
61
- username: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
62
- }, z.core.$strict>;
63
- actor: z.ZodObject<{
64
- id: z.ZodUUID & z.ZodType<import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">, string, z.core.$ZodTypeInternals<import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">, string>>;
65
- }, z.core.$strict>;
66
- }, z.core.$strict>;
116
+ input: import("@fuzdev/fuz_schema/schema.ts").Schema<{
117
+ username: string;
118
+ token: string;
119
+ password: string;
120
+ }, {
121
+ username: string;
122
+ token: string;
123
+ password: string;
124
+ }, "object", {
125
+ token: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
126
+ username: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
127
+ password: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
128
+ }>;
129
+ output: import("@fuzdev/fuz_schema/schema.ts").Schema<{
130
+ account: {
131
+ id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
132
+ username: string;
133
+ };
134
+ actor: {
135
+ id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
136
+ };
137
+ ok: true;
138
+ }, {
139
+ account: {
140
+ id: string;
141
+ username: string;
142
+ };
143
+ actor: {
144
+ id: string;
145
+ };
146
+ ok: true;
147
+ }, "object", {
148
+ ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
149
+ account: import("@fuzdev/fuz_schema/schema.ts").Schema<{
150
+ id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
151
+ username: string;
152
+ }, {
153
+ id: string;
154
+ username: string;
155
+ }, "object", {
156
+ id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
157
+ readonly '~types'?: {
158
+ readonly input: string;
159
+ readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
160
+ } | undefined;
161
+ };
162
+ username: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
163
+ }>;
164
+ actor: import("@fuzdev/fuz_schema/schema.ts").Schema<{
165
+ id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
166
+ }, {
167
+ id: string;
168
+ }, "object", {
169
+ id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
170
+ readonly '~types'?: {
171
+ readonly input: string;
172
+ readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
173
+ } | undefined;
174
+ };
175
+ }>;
176
+ }>;
67
177
  rate_limit: "ip";
68
178
  errors: {
69
- 400: z.ZodObject<{
70
- error: z.ZodEnum<{
71
- invalid_request_body: "invalid_request_body";
72
- invalid_json_body: "invalid_json_body";
73
- }>;
74
- }, z.core.$loose>;
75
- 401: z.ZodObject<{
76
- error: z.ZodLiteral<"invalid_token">;
77
- }, z.core.$loose>;
78
- 403: z.ZodObject<{
79
- error: z.ZodLiteral<"already_bootstrapped">;
80
- }, z.core.$loose>;
81
- 404: z.ZodObject<{
82
- error: z.ZodLiteral<"token_file_missing">;
83
- }, z.core.$loose>;
179
+ 400: import("@fuzdev/fuz_schema/schema.ts").Schema<{
180
+ error: "invalid_request_body" | "invalid_json_body";
181
+ } & Record<string, unknown>, {
182
+ error: "invalid_request_body" | "invalid_json_body";
183
+ } & Record<string, unknown>, "loose_object", {
184
+ error: import("@fuzdev/fuz_schema/schema.ts").Schema<"invalid_request_body" | "invalid_json_body", "invalid_request_body" | "invalid_json_body", "one_of", readonly ["invalid_json_body", "invalid_request_body"]>;
185
+ }>;
186
+ 401: import("@fuzdev/fuz_schema/schema.ts").Schema<{
187
+ error: "invalid_token";
188
+ } & Record<string, unknown>, {
189
+ error: "invalid_token";
190
+ } & Record<string, unknown>, "loose_object", {
191
+ error: import("@fuzdev/fuz_schema/schema.ts").Schema<"invalid_token", "invalid_token", "literal", "invalid_token">;
192
+ }>;
193
+ 403: import("@fuzdev/fuz_schema/schema.ts").Schema<{
194
+ error: "already_bootstrapped";
195
+ } & Record<string, unknown>, {
196
+ error: "already_bootstrapped";
197
+ } & Record<string, unknown>, "loose_object", {
198
+ error: import("@fuzdev/fuz_schema/schema.ts").Schema<"already_bootstrapped", "already_bootstrapped", "literal", "already_bootstrapped">;
199
+ }>;
200
+ 404: import("@fuzdev/fuz_schema/schema.ts").Schema<{
201
+ error: "token_file_missing";
202
+ } & Record<string, unknown>, {
203
+ error: "token_file_missing";
204
+ } & Record<string, unknown>, "loose_object", {
205
+ error: import("@fuzdev/fuz_schema/schema.ts").Schema<"token_file_missing", "token_file_missing", "literal", "token_file_missing">;
206
+ }>;
84
207
  };
85
208
  };
86
209
  //# sourceMappingURL=bootstrap_route_schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap_route_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/bootstrap_route_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,gFAAgF;AAChF,eAAO,MAAM,cAAc;;;;kBAIzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,iFAAiF;AACjF,eAAO,MAAM,eAAe;;;;;;;;;kBAI1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBI,CAAC"}
1
+ {"version":3,"file":"bootstrap_route_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/bootstrap_route_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EASN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AActC;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;EAMzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBI,CAAC"}
@@ -13,21 +13,42 @@
13
13
  *
14
14
  * @module
15
15
  */
16
- import { z } from 'zod';
17
- import { Uuid, Username } from '../primitive_schemas.js';
16
+ import { meta } from '@fuzdev/fuz_schema/meta.ts';
17
+ import { literal, loose_object, max_length, min_length, object, one_of, pipe, string } from '@fuzdev/fuz_schema/schema.ts';
18
+ import { Username, UsernameCanonical, Uuid } from '../primitive_schemas_fuz.js';
18
19
  import { Password } from './password.js';
19
20
  import { ERROR_INVALID_TOKEN, ERROR_ALREADY_BOOTSTRAPPED, ERROR_TOKEN_FILE_MISSING, ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY } from '../http/error_schemas.js';
20
- /** Input for `POST /bootstrap`. `token` is the one-shot token file contents. */
21
- export const BootstrapInput = z.strictObject({
22
- token: z.string().min(1).meta({ sensitivity: 'secret' }),
21
+ /**
22
+ * The longest `token` `POST /bootstrap` takes, in UTF-16 code units: the token
23
+ * file's cap, `MAX_SECURE_FILE_SIZE` bytes. A token that can match the file is
24
+ * at most that many bytes in UTF-8, and no more code units than bytes, so the
25
+ * bound refuses none that could match. A longer one is a malformed body, a
26
+ * `400 invalid_request_body` refused before the bootstrap window or the token
27
+ * file is read, with no audit row. Twin of the Rust spine's
28
+ * `BOOTSTRAP_TOKEN_LENGTH_MAX`, which counts the same units.
29
+ */
30
+ export const BOOTSTRAP_TOKEN_LENGTH_MAX = 4096;
31
+ /**
32
+ * Input for `POST /bootstrap`, a `@fuzdev/fuz_schema` schema. `token` is the
33
+ * one-shot token file contents, 1 to `BOOTSTRAP_TOKEN_LENGTH_MAX` UTF-16 code
34
+ * units.
35
+ */
36
+ export const BootstrapInput = object({
37
+ token: meta(pipe(string, min_length(1), max_length(BOOTSTRAP_TOKEN_LENGTH_MAX)), {
38
+ sensitivity: 'secret'
39
+ }),
23
40
  username: Username,
24
41
  password: Password
25
42
  });
26
- /** Output for `POST /bootstrap`. Session cookie is the operative side effect. */
27
- export const BootstrapOutput = z.strictObject({
28
- ok: z.literal(true),
29
- account: z.strictObject({ id: Uuid, username: Username }),
30
- actor: z.strictObject({ id: Uuid })
43
+ /**
44
+ * Output for `POST /bootstrap`, a `@fuzdev/fuz_schema` schema. Session cookie
45
+ * is the operative side effect. Its `username` is the account row's,
46
+ * `UsernameCanonical`.
47
+ */
48
+ export const BootstrapOutput = object({
49
+ ok: literal(true),
50
+ account: object({ id: Uuid, username: UsernameCanonical }),
51
+ actor: object({ id: Uuid })
31
52
  });
32
53
  /**
33
54
  * The `POST /bootstrap` route shape minus its handler — pure hono-free data.
@@ -46,11 +67,9 @@ export const bootstrap_route_shape = {
46
67
  output: BootstrapOutput,
47
68
  rate_limit: 'ip',
48
69
  errors: {
49
- 400: z.looseObject({
50
- error: z.enum([ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY])
51
- }),
52
- 401: z.looseObject({ error: z.literal(ERROR_INVALID_TOKEN) }),
53
- 403: z.looseObject({ error: z.literal(ERROR_ALREADY_BOOTSTRAPPED) }),
54
- 404: z.looseObject({ error: z.literal(ERROR_TOKEN_FILE_MISSING) })
70
+ 400: loose_object({ error: one_of([ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY]) }),
71
+ 401: loose_object({ error: literal(ERROR_INVALID_TOKEN) }),
72
+ 403: loose_object({ error: literal(ERROR_ALREADY_BOOTSTRAPPED) }),
73
+ 404: loose_object({ error: literal(ERROR_TOKEN_FILE_MISSING) })
55
74
  }
56
75
  };
@@ -25,7 +25,7 @@ export declare const ERROR_CELL_GRANT_NOT_FOUND: "cell_grant_not_found";
25
25
  export declare const ERROR_CELL_GRANT_PRINCIPAL_IS_OWNER: "cell_grant_principal_is_owner";
26
26
  /**
27
27
  * Error reason — role-shaped principal references a role string not
28
- * registered in the role schema. Would produce a dead grant row that
28
+ * registered in the role registry. Would produce a dead grant row that
29
29
  * no role_grant could match.
30
30
  */
31
31
  export declare const ERROR_CELL_GRANT_UNKNOWN_ROLE: "cell_grant_unknown_role";
@@ -28,7 +28,7 @@ export const ERROR_CELL_GRANT_NOT_FOUND = 'cell_grant_not_found';
28
28
  export const ERROR_CELL_GRANT_PRINCIPAL_IS_OWNER = 'cell_grant_principal_is_owner';
29
29
  /**
30
30
  * Error reason — role-shaped principal references a role string not
31
- * registered in the role schema. Would produce a dead grant row that
31
+ * registered in the role registry. Would produce a dead grant row that
32
32
  * no role_grant could match.
33
33
  */
34
34
  export const ERROR_CELL_GRANT_UNKNOWN_ROLE = 'cell_grant_unknown_role';
@@ -12,7 +12,7 @@
12
12
  * - `cell_grant_create` — admin / owner only. Refuses a cell whose
13
13
  * `moderation` doesn't admit an audience (403 `cell_grant_unapproved`,
14
14
  * after the manage gate). Validates role-shaped
15
- * principals against the role schema; rejects owner-as-principal.
15
+ * principals against the role registry; rejects owner-as-principal.
16
16
  * Actor-shaped principals carry a pre-resolved `actor_id` (callers pick
17
17
  * via `actor_search`). Idempotent — re-granting the same principal
18
18
  * updates `level` via UPSERT. A mounted `authorize_grant_create` is asked
@@ -38,7 +38,7 @@
38
38
  * @module
39
39
  */
40
40
  import { type ActionContext, type RpcAction } from '../actions/action_types.js';
41
- import type { RoleSchemaResult } from './role_schema.js';
41
+ import type { RoleRegistry } from './role_schema.js';
42
42
  import type { ActionFactoryDeps } from './deps.js';
43
43
  import type { RequestActorContext } from './request_context.js';
44
44
  import type { Uuid } from '../primitive_schemas.js';
@@ -128,7 +128,7 @@ export type CellGrantRevokeAuthorize = (auth: RequestActorContext, input: CellGr
128
128
  /**
129
129
  * Dependencies for `create_cell_grant_actions`.
130
130
  *
131
- * `roles` is the role schema — read for the role-validity gate on
131
+ * `roles` is the role registry — read for the role-validity gate on
132
132
  * `cell_grant_create`; `authorize_grant_create` is the optional consumer gate
133
133
  * (`CellGrantCreateAuthorize`) and `authorize_grant_revoke` the optional
134
134
  * steward widening of `cell_grant_revoke` (`CellGrantRevokeAuthorize`). The
@@ -136,7 +136,7 @@ export type CellGrantRevokeAuthorize = (auth: RequestActorContext, input: CellGr
136
136
  * fire-and-forget plumbing.
137
137
  */
138
138
  export type CellGrantActionDeps = ActionFactoryDeps & {
139
- roles: RoleSchemaResult;
139
+ roles: RoleRegistry;
140
140
  authorize_grant_create?: CellGrantCreateAuthorize;
141
141
  authorize_grant_revoke?: CellGrantRevokeAuthorize;
142
142
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cell_grant_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_grant_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAGN,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EASN,KAAK,oBAAoB,EAMzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAKN,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,MAAM,6BAA6B,CAAC;AAOrC;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC7C,gCAAgC;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,iDAAiD;IACjD,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,iEAAiE;IACjE,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACrC,sEAAsE;IACtE,SAAS,EAAE,4BAA4B,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACtC,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,6BAA6B,EACpC,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C,+BAA+B;IAC/B,QAAQ,EAAE,IAAI,CAAC;IACf,gCAAgC;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,iDAAiD;IACjD,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,QAAQ,EAAE,IAAI,CAAC;IACf,mCAAmC;IACnC,KAAK,EAAE,cAAc,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACtC,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,6BAA6B,EACpC,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG;IACrD,KAAK,EAAE,gBAAgB,CAAC;IACxB,sBAAsB,CAAC,EAAE,wBAAwB,CAAC;IAClD,sBAAsB,CAAC,EAAE,wBAAwB,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,YAAY,KAAG,SAShD,CAAC;AA4EH,mDAAmD;AACnD,eAAO,MAAM,yBAAyB,GAAI,MAAM,mBAAmB,KAAG,KAAK,CAAC,SAAS,CAwJpF,CAAC"}
1
+ {"version":3,"file":"cell_grant_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_grant_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAGN,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EASN,KAAK,oBAAoB,EAMzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAKN,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,MAAM,6BAA6B,CAAC;AAOrC;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC7C,gCAAgC;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,iDAAiD;IACjD,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,iEAAiE;IACjE,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACrC,sEAAsE;IACtE,SAAS,EAAE,4BAA4B,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACtC,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,6BAA6B,EACpC,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C,+BAA+B;IAC/B,QAAQ,EAAE,IAAI,CAAC;IACf,gCAAgC;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,iDAAiD;IACjD,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,QAAQ,EAAE,IAAI,CAAC;IACf,mCAAmC;IACnC,KAAK,EAAE,cAAc,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACtC,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,6BAA6B,EACpC,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG;IACrD,KAAK,EAAE,YAAY,CAAC;IACpB,sBAAsB,CAAC,EAAE,wBAAwB,CAAC;IAClD,sBAAsB,CAAC,EAAE,wBAAwB,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,YAAY,KAAG,SAShD,CAAC;AA4EH,mDAAmD;AACnD,eAAO,MAAM,yBAAyB,GAAI,MAAM,mBAAmB,KAAG,KAAK,CAAC,SAAS,CAwJpF,CAAC"}
@@ -12,7 +12,7 @@
12
12
  * - `cell_grant_create` — admin / owner only. Refuses a cell whose
13
13
  * `moderation` doesn't admit an audience (403 `cell_grant_unapproved`,
14
14
  * after the manage gate). Validates role-shaped
15
- * principals against the role schema; rejects owner-as-principal.
15
+ * principals against the role registry; rejects owner-as-principal.
16
16
  * Actor-shaped principals carry a pre-resolved `actor_id` (callers pick
17
17
  * via `actor_search`). Idempotent — re-granting the same principal
18
18
  * updates `level` via UPSERT. A mounted `authorize_grant_create` is asked
@@ -15,19 +15,19 @@
15
15
  * `BuiltinCredentialType` is the closed set middleware sets on the Hono
16
16
  * context (`hono_context.ts`) and the audit log records — middleware only
17
17
  * ever authenticates through a builtin. Consumer-declared types live in
18
- * the registry `create_credential_type_schema` builds, consulted when
18
+ * the registry `create_credential_type_registry` builds, consulted when
19
19
  * validating `RoleSpec.required_credential_types`.
20
20
  *
21
21
  * @module
22
22
  */
23
- import { z } from 'zod';
23
+ import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
24
24
  /**
25
- * Zod schema for valid credential-type name strings: the shared name grammar
25
+ * Valid credential-type name strings: the shared name grammar
26
26
  * (`auth/name_schema.ts`), runs of lowercase letters joined by single
27
27
  * underscores, at most `NAME_LENGTH_MAX` characters.
28
28
  */
29
- export declare const CredentialTypeName: z.ZodString;
30
- export type CredentialTypeName = z.infer<typeof CredentialTypeName>;
29
+ export declare const CredentialTypeName: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
30
+ export type CredentialTypeName = Infer<typeof CredentialTypeName>;
31
31
  /** Cookie-based session credential. */
32
32
  export declare const CREDENTIAL_TYPE_SESSION = "session";
33
33
  /**
@@ -41,13 +41,8 @@ export declare const CREDENTIAL_TYPE_API_TOKEN = "api_token";
41
41
  export declare const CREDENTIAL_TYPE_DAEMON_TOKEN = "daemon_token";
42
42
  /** The builtin credential-type names as a const tuple. */
43
43
  export declare const BUILTIN_CREDENTIAL_TYPES: readonly ["session", "api_token", "daemon_token"];
44
- /** Zod enum for builtin credential types only. */
45
- export declare const BuiltinCredentialType: z.ZodEnum<{
46
- daemon_token: "daemon_token";
47
- session: "session";
48
- api_token: "api_token";
49
- }>;
50
- export type BuiltinCredentialType = z.infer<typeof BuiltinCredentialType>;
44
+ /** A builtin credential-type name, the closed set middleware authenticates through. */
45
+ export type BuiltinCredentialType = (typeof BUILTIN_CREDENTIAL_TYPES)[number];
51
46
  /**
52
47
  * Per-credential-type metadata. `description` is admin-UI-facing copy
53
48
  * (mirrors `RoleSpec.description` and `ScopeKindMeta.description`).
@@ -62,20 +57,12 @@ export interface CredentialTypeMeta {
62
57
  * Typed `ReadonlyMap` for the contract — but JS Maps don't honor
63
58
  * `Object.freeze` for `.set` / `.delete` / `.clear` (they mutate
64
59
  * internal slots, not own properties), so freeze adds no runtime guard
65
- * here. Read once at startup by `create_credential_type_schema`;
60
+ * here. Read once at startup by `create_credential_type_registry`;
66
61
  * runtime mutation has no effect on already-built schemas.
67
62
  */
68
63
  export declare const builtin_credential_type_meta: ReadonlyMap<string, CredentialTypeMeta>;
69
- /** The result of `create_credential_type_schema` — a Zod schema and metadata map. */
70
- export interface CredentialTypeSchemaResult {
71
- /**
72
- * Zod schema that validates credential-type name strings against the
73
- * registered set (builtins + consumer-declared). Use at I/O
74
- * boundaries (admin UIs, codegen) and as the construction-time check
75
- * inside `create_role_schema` for every
76
- * `RoleSpec.required_credential_types` entry.
77
- */
78
- CredentialType: z.ZodType<string>;
64
+ /** The result of `create_credential_type_registry` — the metadata map. */
65
+ export interface CredentialTypeRegistry {
79
66
  /**
80
67
  * Map of every registered credential-type to its metadata. Keyed by
81
68
  * name. Read at startup by admin / codegen surfaces.
@@ -83,31 +70,31 @@ export interface CredentialTypeSchemaResult {
83
70
  credential_types: ReadonlyMap<string, CredentialTypeMeta>;
84
71
  }
85
72
  /**
86
- * Create a credential-type schema from the builtin set plus optional
73
+ * Create a credential-type registry from the builtin set plus optional
87
74
  * consumer-declared additions.
88
75
  *
89
76
  * Builtins (`session`, `api_token`, `daemon_token`) are always present;
90
77
  * consumer entries that collide with a builtin name throw at
91
- * construction. Pass the result into `create_role_schema`'s optional
78
+ * construction. Pass the result into `create_role_registry`'s optional
92
79
  * `credential_types` parameter so each role's
93
80
  * `required_credential_types` entries are validated against this set
94
81
  * at construction time.
95
82
  *
96
83
  * @param consumer_types - optional consumer-declared credential-type set with optional metadata
97
- * @returns `{CredentialType, credential_types}` — Zod schema and metadata map
84
+ * @returns `{credential_types}` — the metadata map
98
85
  *
99
86
  * @throws Error if any `consumer_types` key fails `CredentialTypeName` (its grammar or its length cap), collides with a builtin name, or appears more than once
100
87
  *
101
88
  * @example
102
89
  * ```ts
103
90
  * // simple — builtins only
104
- * const {CredentialType, credential_types} = create_credential_type_schema();
91
+ * const {credential_types} = create_credential_type_registry();
105
92
  *
106
93
  * // with consumer extensions
107
- * const {CredentialType} = create_credential_type_schema({
94
+ * const {credential_types} = create_credential_type_registry({
108
95
  * sso_assertion: {description: 'OIDC SSO assertion bound to an IdP-asserted account.'},
109
96
  * });
110
97
  * ```
111
98
  */
112
- export declare const create_credential_type_schema: (consumer_types?: Record<string, CredentialTypeMeta>) => CredentialTypeSchemaResult;
99
+ export declare const create_credential_type_registry: (consumer_types?: Record<string, CredentialTypeMeta>) => CredentialTypeRegistry;
113
100
  //# sourceMappingURL=credential_type_schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"credential_type_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/credential_type_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,aAAwC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAIpE,uCAAuC;AACvC,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,cAAc,CAAC;AAErD,yEAAyE;AACzE,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAE3D,0DAA0D;AAC1D,eAAO,MAAM,wBAAwB,mDAI3B,CAAC;AAEX,kDAAkD;AAClD,eAAO,MAAM,qBAAqB;;;;EAAmC,CAAC;AACtE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAa/E,CAAC;AAEH,qFAAqF;AACrF,MAAM,WAAW,0BAA0B;IAC1C;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC;;;OAGG;IACH,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,6BAA6B,GACzC,iBAAgB,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAM,KACrD,0BA2BF,CAAC"}
1
+ {"version":3,"file":"credential_type_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/credential_type_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAuB,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAI/E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,0MAAwC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAIlE,uCAAuC;AACvC,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,cAAc,CAAC;AAErD,yEAAyE;AACzE,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAE3D,0DAA0D;AAC1D,eAAO,MAAM,wBAAwB,mDAI3B,CAAC;AAEX,uFAAuF;AACvF,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAa/E,CAAC;AAEH,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACtC;;;OAGG;IACH,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,+BAA+B,GAC3C,iBAAgB,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAM,KACrD,sBAwBF,CAAC"}