@colveor/admin 0.0.0-stage → 0.5.2

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 (154) hide show
  1. package/LICENSE.md +106 -0
  2. package/TAILWINDADMIN-LICENSE +21 -0
  3. package/dist/account/data.d.ts +1 -0
  4. package/dist/account/data.js +44 -0
  5. package/dist/account/profile.d.ts +6 -0
  6. package/dist/account/profile.js +118 -0
  7. package/dist/account/sessions.d.ts +1 -0
  8. package/dist/account/sessions.js +26 -0
  9. package/dist/account/shared.d.ts +26 -0
  10. package/dist/account/shared.js +44 -0
  11. package/dist/account/two-factor.d.ts +5 -0
  12. package/dist/account/two-factor.js +60 -0
  13. package/dist/actions.d.ts +39 -0
  14. package/dist/actions.js +81 -0
  15. package/dist/api/audit.gen.d.ts +80 -0
  16. package/dist/api/audit.gen.js +43 -0
  17. package/dist/api/auth.gen.d.ts +537 -0
  18. package/dist/api/auth.gen.js +313 -0
  19. package/dist/api/errors.gen.d.ts +16 -0
  20. package/dist/api/errors.gen.js +2 -0
  21. package/dist/api/gormx.gen.d.ts +60 -0
  22. package/dist/api/gormx.gen.js +16 -0
  23. package/dist/api/health.gen.d.ts +103 -0
  24. package/dist/api/health.gen.js +23 -0
  25. package/dist/api/index.gen.d.ts +21 -0
  26. package/dist/api/index.gen.js +22 -0
  27. package/dist/api/invitations.gen.d.ts +128 -0
  28. package/dist/api/invitations.gen.js +57 -0
  29. package/dist/api/ledger.gen.d.ts +269 -0
  30. package/dist/api/ledger.gen.js +113 -0
  31. package/dist/api/msgtemplate.gen.d.ts +31 -0
  32. package/dist/api/msgtemplate.gen.js +2 -0
  33. package/dist/api/notifications.gen.d.ts +66 -0
  34. package/dist/api/notifications.gen.js +28 -0
  35. package/dist/api/outbox.gen.d.ts +8 -0
  36. package/dist/api/outbox.gen.js +2 -0
  37. package/dist/api/queue.gen.d.ts +112 -0
  38. package/dist/api/queue.gen.js +15 -0
  39. package/dist/api/rbac.gen.d.ts +406 -0
  40. package/dist/api/rbac.gen.js +191 -0
  41. package/dist/api/reauth.gen.d.ts +289 -0
  42. package/dist/api/reauth.gen.js +122 -0
  43. package/dist/api/recorded_payments.gen.d.ts +171 -0
  44. package/dist/api/recorded_payments.gen.js +79 -0
  45. package/dist/api/sessions.gen.d.ts +64 -0
  46. package/dist/api/sessions.gen.js +48 -0
  47. package/dist/api/settings.gen.d.ts +147 -0
  48. package/dist/api/settings.gen.js +69 -0
  49. package/dist/api/storage.gen.d.ts +327 -0
  50. package/dist/api/storage.gen.js +208 -0
  51. package/dist/api/support_access.gen.d.ts +155 -0
  52. package/dist/api/support_access.gen.js +131 -0
  53. package/dist/api/users.gen.d.ts +407 -0
  54. package/dist/api/users.gen.js +159 -0
  55. package/dist/api/verification.gen.d.ts +427 -0
  56. package/dist/api/verification.gen.js +280 -0
  57. package/dist/api/webhooks.gen.d.ts +110 -0
  58. package/dist/api/webhooks.gen.js +45 -0
  59. package/dist/auth-layout.d.ts +9 -0
  60. package/dist/auth-layout.js +5 -0
  61. package/dist/client.d.ts +41 -0
  62. package/dist/client.js +72 -0
  63. package/dist/config.d.ts +27 -0
  64. package/dist/config.js +82 -0
  65. package/dist/dates.d.ts +4 -0
  66. package/dist/dates.js +16 -0
  67. package/dist/header.d.ts +12 -0
  68. package/dist/header.js +105 -0
  69. package/dist/icons.d.ts +2 -0
  70. package/dist/icons.js +15 -0
  71. package/dist/index.d.ts +28 -0
  72. package/dist/index.js +42 -0
  73. package/dist/kit/avatar.d.ts +5 -0
  74. package/dist/kit/avatar.js +16 -0
  75. package/dist/kit/badge.d.ts +10 -0
  76. package/dist/kit/badge.js +31 -0
  77. package/dist/kit/card.d.ts +12 -0
  78. package/dist/kit/card.js +7 -0
  79. package/dist/kit/code-area.d.ts +15 -0
  80. package/dist/kit/code-area.js +69 -0
  81. package/dist/kit/dropdown.d.ts +26 -0
  82. package/dist/kit/dropdown.js +67 -0
  83. package/dist/kit/filter-tabs.d.ts +9 -0
  84. package/dist/kit/filter-tabs.js +7 -0
  85. package/dist/kit/modal.d.ts +8 -0
  86. package/dist/kit/modal.js +15 -0
  87. package/dist/kit/page-header.d.ts +13 -0
  88. package/dist/kit/page-header.js +13 -0
  89. package/dist/kit/search.d.ts +4 -0
  90. package/dist/kit/search.js +16 -0
  91. package/dist/kit/tooltip.d.ts +17 -0
  92. package/dist/kit/tooltip.js +52 -0
  93. package/dist/message-editor.d.ts +9 -0
  94. package/dist/message-editor.js +80 -0
  95. package/dist/money.d.ts +10 -0
  96. package/dist/money.js +17 -0
  97. package/dist/next.d.ts +6 -0
  98. package/dist/next.js +19 -0
  99. package/dist/pages/account.d.ts +1 -0
  100. package/dist/pages/account.js +47 -0
  101. package/dist/pages/audit.d.ts +1 -0
  102. package/dist/pages/audit.js +88 -0
  103. package/dist/pages/forgot-password.d.ts +1 -0
  104. package/dist/pages/forgot-password.js +73 -0
  105. package/dist/pages/ledger.d.ts +1 -0
  106. package/dist/pages/ledger.js +132 -0
  107. package/dist/pages/roles.d.ts +1 -0
  108. package/dist/pages/roles.js +102 -0
  109. package/dist/pages/settings.d.ts +1 -0
  110. package/dist/pages/settings.js +86 -0
  111. package/dist/pages/sign-in.d.ts +5 -0
  112. package/dist/pages/sign-in.js +117 -0
  113. package/dist/pages/status.d.ts +1 -0
  114. package/dist/pages/status.js +122 -0
  115. package/dist/pages/support.d.ts +1 -0
  116. package/dist/pages/support.js +90 -0
  117. package/dist/pages/teams.d.ts +1 -0
  118. package/dist/pages/teams.js +94 -0
  119. package/dist/pages/users.d.ts +1 -0
  120. package/dist/pages/users.js +158 -0
  121. package/dist/pages/webhooks.d.ts +1 -0
  122. package/dist/pages/webhooks.js +88 -0
  123. package/dist/permissions.d.ts +5 -0
  124. package/dist/permissions.js +31 -0
  125. package/dist/proof.d.ts +10 -0
  126. package/dist/proof.js +78 -0
  127. package/dist/proxy.d.ts +10 -0
  128. package/dist/proxy.js +166 -0
  129. package/dist/retry.d.ts +8 -0
  130. package/dist/retry.js +30 -0
  131. package/dist/router.d.ts +13 -0
  132. package/dist/router.js +14 -0
  133. package/dist/setting-fields.d.ts +12 -0
  134. package/dist/setting-fields.js +102 -0
  135. package/dist/setting-list.d.ts +22 -0
  136. package/dist/setting-list.js +78 -0
  137. package/dist/shell.d.ts +40 -0
  138. package/dist/shell.js +97 -0
  139. package/dist/support.d.ts +37 -0
  140. package/dist/support.js +76 -0
  141. package/dist/table.d.ts +40 -0
  142. package/dist/table.js +73 -0
  143. package/dist/ui.d.ts +39 -0
  144. package/dist/ui.js +56 -0
  145. package/dist/user-actions.d.ts +30 -0
  146. package/dist/user-actions.js +129 -0
  147. package/dist/user-roles.d.ts +4 -0
  148. package/dist/user-roles.js +51 -0
  149. package/dist/user-row-menu.d.ts +14 -0
  150. package/dist/user-row-menu.js +45 -0
  151. package/dist/version.d.ts +1 -0
  152. package/dist/version.js +3 -0
  153. package/package.json +59 -4
  154. package/README.md +0 -3
@@ -0,0 +1,2 @@
1
+ // Code generated by tygo. DO NOT EDIT.
2
+ export {};
@@ -0,0 +1,112 @@
1
+ export type JobType = string;
2
+ /**
3
+ * OTPDelivery carries one-time passwords only. It has a dedicated worker
4
+ * pool, so a campaign on Bulk can never hold up a login code.
5
+ */
6
+ export declare const OTPDelivery: JobType;
7
+ /**
8
+ * Default carries ordinary transactional jobs: notification email and
9
+ * SMS, webhooks.
10
+ */
11
+ export declare const Default: JobType;
12
+ /**
13
+ * Bulk carries large, low-priority batches such as campaigns.
14
+ */
15
+ export declare const Bulk: JobType;
16
+ /**
17
+ * Job is one unit of background work. Type is "<module>.<job>", e.g.
18
+ * "auth.send_otp" (section 42.4).
19
+ */
20
+ export interface Job {
21
+ Type: JobType;
22
+ Payload: string;
23
+ }
24
+ /**
25
+ * Options control how a job is queued. Zero values mean "use the default".
26
+ */
27
+ export interface Options {
28
+ Queue: JobType;
29
+ MaxRetry: number;
30
+ Timeout: number;
31
+ Deadline: string;
32
+ ProcessIn: number;
33
+ UniqueFor: number;
34
+ /**
35
+ * ID drops the job while another with the same ID is still queued or
36
+ * running. The outbox sets it, so a job sent twice after a crash runs once.
37
+ */
38
+ ID: string;
39
+ }
40
+ /**
41
+ * Enqueuer puts jobs on a queue. The API process uses it; it never runs jobs.
42
+ */
43
+ export type Enqueuer = unknown;
44
+ /**
45
+ * Handler processes one job's payload. Return nil when done, an error to
46
+ * retry, or an error wrapping ErrPermanent to stop retrying.
47
+ */
48
+ export type Handler = unknown;
49
+ /**
50
+ * Registry is where modules register the processors for their job types,
51
+ * and the jobs that run on a schedule.
52
+ */
53
+ export type Registry = unknown;
54
+ /**
55
+ * Inspector reads the state of the queues and of the worker processes that
56
+ * serve them. Workers report themselves through the broker, so any process
57
+ * (the API) can read it.
58
+ */
59
+ export type Inspector = unknown;
60
+ export interface Stats {
61
+ queues: QueueStats[];
62
+ /**
63
+ * Workers are the worker processes alive now, one entry per pool
64
+ * (verification codes, then the other queues) of each process.
65
+ */
66
+ workers: WorkerStats[];
67
+ /**
68
+ * Jobs are today's (UTC) runs of each job type, by every worker.
69
+ */
70
+ jobs: JobStats[];
71
+ }
72
+ /**
73
+ * JobStats counts one job type's runs today. A job that fails and is
74
+ * retried counts once per attempt.
75
+ */
76
+ export interface JobStats {
77
+ type: string;
78
+ processed_today: number;
79
+ failed_today: number;
80
+ average_ms: number;
81
+ last_run_at: string;
82
+ }
83
+ /**
84
+ * QueueStats counts one queue's jobs; Processed and Failed are today's.
85
+ */
86
+ export interface QueueStats {
87
+ name: string;
88
+ paused: boolean;
89
+ pending: number;
90
+ active: number;
91
+ scheduled: number;
92
+ retry: number;
93
+ /**
94
+ * Archived jobs failed every retry and wait for inspection.
95
+ */
96
+ archived: number;
97
+ processed_today: number;
98
+ failed_today: number;
99
+ /**
100
+ * LatencySeconds is how long the oldest pending job has waited.
101
+ */
102
+ latency_seconds: number;
103
+ }
104
+ export interface WorkerStats {
105
+ host: string;
106
+ pid: number;
107
+ status: string;
108
+ queues: string[];
109
+ concurrency: number;
110
+ busy: number;
111
+ started_at: string;
112
+ }
@@ -0,0 +1,15 @@
1
+ // Code generated by tygo. DO NOT EDIT.
2
+ /**
3
+ * OTPDelivery carries one-time passwords only. It has a dedicated worker
4
+ * pool, so a campaign on Bulk can never hold up a login code.
5
+ */
6
+ export const OTPDelivery = "otp_delivery";
7
+ /**
8
+ * Default carries ordinary transactional jobs: notification email and
9
+ * SMS, webhooks.
10
+ */
11
+ export const Default = "default";
12
+ /**
13
+ * Bulk carries large, low-priority batches such as campaigns.
14
+ */
15
+ export const Bulk = "bulk";
@@ -0,0 +1,406 @@
1
+ /**
2
+ * Actions recorded in the audit log (section 42.1), with the change, in its
3
+ * transaction. rbac.AccessDenied is declared in platform/rbac.
4
+ */
5
+ export declare const ActionRoleCreated = "rbac.RoleCreated";
6
+ /**
7
+ * Actions recorded in the audit log (section 42.1), with the change, in its
8
+ * transaction. rbac.AccessDenied is declared in platform/rbac.
9
+ */
10
+ export declare const ActionRoleUpdated = "rbac.RoleUpdated";
11
+ /**
12
+ * Actions recorded in the audit log (section 42.1), with the change, in its
13
+ * transaction. rbac.AccessDenied is declared in platform/rbac.
14
+ */
15
+ export declare const ActionRoleDeleted = "rbac.RoleDeleted";
16
+ /**
17
+ * Actions recorded in the audit log (section 42.1), with the change, in its
18
+ * transaction. rbac.AccessDenied is declared in platform/rbac.
19
+ */
20
+ export declare const ActionRolePermissionsChanged = "rbac.RolePermissionsChanged";
21
+ /**
22
+ * Actions recorded in the audit log (section 42.1), with the change, in its
23
+ * transaction. rbac.AccessDenied is declared in platform/rbac.
24
+ */
25
+ export declare const ActionUserRolesChanged = "rbac.UserRolesChanged";
26
+ /**
27
+ * Actions recorded in the audit log (section 42.1), with the change, in its
28
+ * transaction. rbac.AccessDenied is declared in platform/rbac.
29
+ */
30
+ export declare const ActionDefaultRoleChanged = "rbac.DefaultRoleChanged";
31
+ /**
32
+ * Actions recorded in the audit log (section 42.1), with the change, in its
33
+ * transaction. rbac.AccessDenied is declared in platform/rbac.
34
+ */
35
+ export declare const ActionTeamSuspended = "rbac.TeamSuspended";
36
+ /**
37
+ * Actions recorded in the audit log (section 42.1), with the change, in its
38
+ * transaction. rbac.AccessDenied is declared in platform/rbac.
39
+ */
40
+ export declare const ActionTeamReactivated = "rbac.TeamReactivated";
41
+ /**
42
+ * UserAccess is what goes into a user's access token.
43
+ */
44
+ export interface UserAccess {
45
+ /**
46
+ * Roles are the user's role slugs.
47
+ */
48
+ Roles: string[];
49
+ /**
50
+ * Version is the user's roles version (jwt.Claims.RolesVersion).
51
+ */
52
+ Version: number;
53
+ }
54
+ export interface PermissionResponse {
55
+ key: string;
56
+ module: string;
57
+ description: string;
58
+ /**
59
+ * Deprecated permissions are no longer declared by any module. They are
60
+ * kept so existing grants are not lost silently (Rule 20), but grant
61
+ * nothing.
62
+ */
63
+ deprecated: boolean;
64
+ }
65
+ /**
66
+ * ModuleResponse is a module and its permissions. A module that is no
67
+ * longer registered but left permissions behind is listed with enabled
68
+ * false and only its name.
69
+ */
70
+ export interface ModuleResponse {
71
+ name: string;
72
+ version: string;
73
+ description: string;
74
+ enabled: boolean;
75
+ dependencies: string[];
76
+ permissions: PermissionResponse[];
77
+ }
78
+ export interface RoleResponse {
79
+ id: string;
80
+ slug: string;
81
+ name: string;
82
+ description: string;
83
+ /**
84
+ * System roles are built in: they cannot be deleted or renamed.
85
+ */
86
+ system: boolean;
87
+ /**
88
+ * GrantsAll roles hold every permission, including future ones.
89
+ */
90
+ grants_all: boolean;
91
+ /**
92
+ * Default marks the role new users are given.
93
+ */
94
+ default: boolean;
95
+ /**
96
+ * Level ranks the role: users can only manage users and roles ranked
97
+ * below their own highest role.
98
+ */
99
+ level: number;
100
+ permissions: string[];
101
+ created_at: string;
102
+ updated_at: string;
103
+ }
104
+ export interface CreateRoleRequest {
105
+ slug: string;
106
+ /**
107
+ * Level must be below the caller's own rank (1-99).
108
+ */
109
+ level: number;
110
+ name: string;
111
+ description: string;
112
+ permissions: string[];
113
+ }
114
+ export interface UpdateRoleRequest {
115
+ name?: string;
116
+ description?: string;
117
+ /**
118
+ * Default: true makes this the role new users are given (existing
119
+ * users keep their roles). false is rejected: move the default by
120
+ * making another role the default.
121
+ */
122
+ default?: boolean;
123
+ /**
124
+ * Level re-ranks a custom role; it must stay below the caller's rank.
125
+ * Built-in levels are fixed.
126
+ */
127
+ level?: number;
128
+ }
129
+ /**
130
+ * SetRolePermissionsRequest replaces a role's permissions with exactly
131
+ * this set.
132
+ */
133
+ export interface SetRolePermissionsRequest {
134
+ permissions: string[];
135
+ }
136
+ /**
137
+ * SetUserRolesRequest replaces a user's roles with exactly this set, which
138
+ * must not be empty.
139
+ */
140
+ export interface SetUserRolesRequest {
141
+ roles: string[];
142
+ }
143
+ export interface UserRolesResponse {
144
+ user_id: string;
145
+ roles: string[];
146
+ /**
147
+ * Protected is true for the seeded super admin, whose roles never
148
+ * change.
149
+ */
150
+ protected: boolean;
151
+ /**
152
+ * Permissions are the effective permissions of all the roles together.
153
+ */
154
+ permissions: string[];
155
+ }
156
+ export interface MyPermissionsResponse {
157
+ roles: string[];
158
+ permissions: string[];
159
+ }
160
+ /**
161
+ * Team statuses (docs/team-status.md).
162
+ */
163
+ export declare const TeamActive = "active";
164
+ /**
165
+ * Team statuses (docs/team-status.md).
166
+ */
167
+ export declare const TeamSuspended = "suspended";
168
+ /**
169
+ * TeamStatusResponse is a team's status, for platform admins.
170
+ */
171
+ export interface TeamStatusResponse {
172
+ team: {
173
+ kind: string;
174
+ id: string;
175
+ };
176
+ status: string;
177
+ /**
178
+ * SuspendedBy is the team whose suspension applies: this one, or one
179
+ * above it. Absent when active.
180
+ */
181
+ suspended_by?: {
182
+ kind: string;
183
+ id: string;
184
+ };
185
+ /**
186
+ * Reason is the admin's, shown to platform admins only.
187
+ */
188
+ reason?: string;
189
+ suspended_at?: string;
190
+ }
191
+ /**
192
+ * RoleMemberResponse is a user holding a role, since when.
193
+ */
194
+ export interface RoleMemberResponse {
195
+ user_id: string;
196
+ since: string;
197
+ }
198
+ /**
199
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
200
+ * are defined by platform/rbac, which returns them from Require.
201
+ */
202
+ export declare const ErrCodeRoleNotFound = "rbac.role_not_found";
203
+ /**
204
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
205
+ * are defined by platform/rbac, which returns them from Require.
206
+ */
207
+ export declare const ErrCodeRoleExists = "rbac.role_exists";
208
+ /**
209
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
210
+ * are defined by platform/rbac, which returns them from Require.
211
+ */
212
+ export declare const ErrCodeInvalidSlug = "rbac.invalid_slug";
213
+ /**
214
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
215
+ * are defined by platform/rbac, which returns them from Require.
216
+ */
217
+ export declare const ErrCodeSystemRole = "rbac.system_role";
218
+ /**
219
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
220
+ * are defined by platform/rbac, which returns them from Require.
221
+ */
222
+ export declare const ErrCodeDefaultRole = "rbac.default_role";
223
+ /**
224
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
225
+ * are defined by platform/rbac, which returns them from Require.
226
+ */
227
+ export declare const ErrCodeNoRoles = "rbac.no_roles";
228
+ /**
229
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
230
+ * are defined by platform/rbac, which returns them from Require.
231
+ */
232
+ export declare const ErrCodeHierarchy = "rbac.hierarchy";
233
+ /**
234
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
235
+ * are defined by platform/rbac, which returns them from Require.
236
+ */
237
+ export declare const ErrCodeProtectedUser = "rbac.protected_user";
238
+ /**
239
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
240
+ * are defined by platform/rbac, which returns them from Require.
241
+ */
242
+ export declare const ErrCodeInvalidLevel = "rbac.invalid_level";
243
+ /**
244
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
245
+ * are defined by platform/rbac, which returns them from Require.
246
+ */
247
+ export declare const ErrCodeUnknownPermission = "rbac.unknown_permission";
248
+ /**
249
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
250
+ * are defined by platform/rbac, which returns them from Require.
251
+ */
252
+ export declare const ErrCodeUnknownRole = "rbac.unknown_role";
253
+ /**
254
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
255
+ * are defined by platform/rbac, which returns them from Require.
256
+ */
257
+ export declare const ErrCodeEscalation = "rbac.escalation";
258
+ /**
259
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
260
+ * are defined by platform/rbac, which returns them from Require.
261
+ */
262
+ export declare const ErrCodeLastSuperAdmin = "rbac.last_super_admin";
263
+ /**
264
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
265
+ * are defined by platform/rbac, which returns them from Require.
266
+ */
267
+ export declare const ErrCodeUserNotFound = "rbac.user_not_found";
268
+ /**
269
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
270
+ * are defined by platform/rbac, which returns them from Require.
271
+ */
272
+ export declare const ErrCodeInternal = "rbac.internal";
273
+ /**
274
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
275
+ * are defined by platform/rbac, which returns them from Require.
276
+ */
277
+ export declare const ErrCodeSuspendedAbove = "rbac.team_suspended_above";
278
+ /**
279
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
280
+ * are defined by platform/rbac, which returns them from Require.
281
+ */
282
+ export declare const ErrCodeTooManyUsers = "rbac.too_many_users";
283
+ /**
284
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
285
+ * are defined by platform/rbac, which returns them from Require.
286
+ */
287
+ export declare const ErrCodeTeamSuspended = "rbac.team_suspended";
288
+ /**
289
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
290
+ * are defined by platform/rbac, which returns them from Require.
291
+ */
292
+ export declare const ErrCodeForbidden = "rbac.forbidden";
293
+ /**
294
+ * Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
295
+ * are defined by platform/rbac, which returns them from Require.
296
+ */
297
+ export declare const ErrCodeTokenStale = "rbac.token_stale";
298
+ /**
299
+ * Permissions this module guards (section 25.1). rbac.manage has no default
300
+ * role: only super_admin (which grants everything) holds it until an
301
+ * operator grants it to another role.
302
+ */
303
+ export declare const PermissionRead: string;
304
+ /**
305
+ * Permissions this module guards (section 25.1). rbac.manage has no default
306
+ * role: only super_admin (which grants everything) holds it until an
307
+ * operator grants it to another role.
308
+ */
309
+ export declare const PermissionManage: string;
310
+ /**
311
+ * PermissionSuspendTeams lets a platform admin suspend and reactivate
312
+ * teams (docs/team-status.md), and see which are suspended.
313
+ */
314
+ export declare const PermissionSuspendTeams: string;
315
+ /**
316
+ * AccessService is what other modules consume: auth reads it when issuing
317
+ * tokens.
318
+ */
319
+ export type AccessService = unknown;
320
+ /**
321
+ * Service is the admin surface of the module, used by its HTTP handlers.
322
+ */
323
+ export type Service = AccessService;
324
+ /**
325
+ * TeamService gives and removes team roles (docs/rbac.md, "Team
326
+ * roles"). Every method checks the rules for the user it is acting for, by:
327
+ * they hold rbac.team.assign there, outrank the role and the person, and
328
+ * hold every permission the role grants. The module that declares a kind
329
+ * grants with no check through its rbac.TeamKind handle instead.
330
+ */
331
+ export type TeamService = unknown;
332
+ /**
333
+ * Team audit actions.
334
+ */
335
+ export declare const ActionTeamRoleAssigned = "rbac.TeamRoleAssigned";
336
+ /**
337
+ * Team audit actions.
338
+ */
339
+ export declare const ActionTeamRoleChanged = "rbac.TeamRoleChanged";
340
+ /**
341
+ * Team audit actions.
342
+ */
343
+ export declare const ActionTeamRoleRemoved = "rbac.TeamRoleRemoved";
344
+ /**
345
+ * Team audit actions.
346
+ */
347
+ export declare const ActionTeamDeleted = "rbac.TeamDeleted";
348
+ export interface TeamRoleResponse {
349
+ slug: string;
350
+ name: string;
351
+ kind: string;
352
+ level: number;
353
+ min_holders: number;
354
+ all_permissions: boolean;
355
+ permissions: string[];
356
+ }
357
+ export interface MemberResponse {
358
+ user_id: string;
359
+ team: {
360
+ kind: string;
361
+ id: string;
362
+ };
363
+ role: string;
364
+ role_name: string;
365
+ first_name: string;
366
+ last_name: string;
367
+ display_name?: string;
368
+ granted_by?: string;
369
+ created_at: string;
370
+ }
371
+ export interface SetMemberRequest {
372
+ role: string;
373
+ }
374
+ export interface MyTeamResponse {
375
+ team: {
376
+ kind: string;
377
+ id: string;
378
+ };
379
+ /**
380
+ * Path is the team and its ancestors, root first.
381
+ */
382
+ path: {
383
+ kind: string;
384
+ id: string;
385
+ }[];
386
+ /**
387
+ * Role is my role on this team itself; empty when I am a member
388
+ * through a team below it (a branch cashier, for the store).
389
+ */
390
+ role: string;
391
+ }
392
+ export interface TeamAccessResponse {
393
+ /**
394
+ * Roles are my roles on the team and above it, nearest first.
395
+ */
396
+ roles: string[];
397
+ level: number;
398
+ permissions: string[];
399
+ }
400
+ /**
401
+ * TeamAdmin is the HTTP side of team roles.
402
+ */
403
+ export type TeamAdmin = TeamService;
404
+ export declare const ErrCodeLastHolder = "rbac.last_holder";
405
+ export declare const ErrCodeRoleNotAssignable = "rbac.role_not_assignable";
406
+ export declare const ErrCodeOwnRole = "rbac.own_role";