@krak-stack/auth 0.2.29 → 0.2.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/admin/api.group.d.ts +94 -0
- package/dist/admin/api.group.js +3 -3
- package/dist/admin/schema.d.ts +215 -0
- package/dist/admin/schema.js +39 -1
- package/dist/api.d.ts +94 -0
- package/dist/components/admin-organizations.js +10 -1
- package/dist/components/admin-users.js +18 -1
- package/dist/components/auth-client-api.d.ts +94 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @krak-stack/auth
|
|
2
2
|
|
|
3
|
+
## 0.2.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Preserve shared table column filters through admin user and organization query state and HTTP requests. Validate endpoint-specific fields and filter kinds, apply parameterized predicates before pagination and counting, and retain project scope. Configure typed boolean/date and organization-type controls; hide preview-only relationship filters until full option catalogs are available. Require registry 0.1.58 or later for the shared filter and menu updates.
|
|
8
|
+
|
|
9
|
+
## 0.2.30
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Upgrade Effect dependencies to 4.1.0 for compatibility with the registry crypto migration.
|
|
14
|
+
|
|
3
15
|
## 0.2.29
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -229,6 +229,53 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
229
229
|
readonly direction: "asc" | "desc";
|
|
230
230
|
}[]>>;
|
|
231
231
|
readonly projectId: Schema.optional<Schema.String>;
|
|
232
|
+
readonly filters: Schema.optional<Schema.declare<readonly ({
|
|
233
|
+
readonly id: string;
|
|
234
|
+
readonly kind: "number";
|
|
235
|
+
readonly min?: number | undefined;
|
|
236
|
+
readonly max?: number | undefined;
|
|
237
|
+
} | {
|
|
238
|
+
readonly id: string;
|
|
239
|
+
readonly kind: "date";
|
|
240
|
+
readonly from?: string | undefined;
|
|
241
|
+
readonly to?: string | undefined;
|
|
242
|
+
} | {
|
|
243
|
+
readonly id: string;
|
|
244
|
+
readonly kind: "text";
|
|
245
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
246
|
+
readonly value: string;
|
|
247
|
+
} | {
|
|
248
|
+
readonly id: string;
|
|
249
|
+
readonly kind: "boolean";
|
|
250
|
+
readonly value: boolean;
|
|
251
|
+
} | {
|
|
252
|
+
readonly id: string;
|
|
253
|
+
readonly kind: "values";
|
|
254
|
+
readonly values: readonly [string, ...string[]];
|
|
255
|
+
})[], readonly ({
|
|
256
|
+
readonly id: string;
|
|
257
|
+
readonly kind: "number";
|
|
258
|
+
readonly min?: number | undefined;
|
|
259
|
+
readonly max?: number | undefined;
|
|
260
|
+
} | {
|
|
261
|
+
readonly id: string;
|
|
262
|
+
readonly kind: "date";
|
|
263
|
+
readonly from?: string | undefined;
|
|
264
|
+
readonly to?: string | undefined;
|
|
265
|
+
} | {
|
|
266
|
+
readonly id: string;
|
|
267
|
+
readonly kind: "text";
|
|
268
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
269
|
+
readonly value: string;
|
|
270
|
+
} | {
|
|
271
|
+
readonly id: string;
|
|
272
|
+
readonly kind: "boolean";
|
|
273
|
+
readonly value: boolean;
|
|
274
|
+
} | {
|
|
275
|
+
readonly id: string;
|
|
276
|
+
readonly kind: "values";
|
|
277
|
+
readonly values: readonly [string, ...string[]];
|
|
278
|
+
})[]>>;
|
|
232
279
|
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
233
280
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
234
281
|
readonly id: Schema.String;
|
|
@@ -270,6 +317,53 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
270
317
|
readonly direction: "asc" | "desc";
|
|
271
318
|
}[]>>;
|
|
272
319
|
readonly projectId: Schema.optional<Schema.String>;
|
|
320
|
+
readonly filters: Schema.optional<Schema.declare<readonly ({
|
|
321
|
+
readonly id: string;
|
|
322
|
+
readonly kind: "number";
|
|
323
|
+
readonly min?: number | undefined;
|
|
324
|
+
readonly max?: number | undefined;
|
|
325
|
+
} | {
|
|
326
|
+
readonly id: string;
|
|
327
|
+
readonly kind: "date";
|
|
328
|
+
readonly from?: string | undefined;
|
|
329
|
+
readonly to?: string | undefined;
|
|
330
|
+
} | {
|
|
331
|
+
readonly id: string;
|
|
332
|
+
readonly kind: "text";
|
|
333
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
334
|
+
readonly value: string;
|
|
335
|
+
} | {
|
|
336
|
+
readonly id: string;
|
|
337
|
+
readonly kind: "boolean";
|
|
338
|
+
readonly value: boolean;
|
|
339
|
+
} | {
|
|
340
|
+
readonly id: string;
|
|
341
|
+
readonly kind: "values";
|
|
342
|
+
readonly values: readonly [string, ...string[]];
|
|
343
|
+
})[], readonly ({
|
|
344
|
+
readonly id: string;
|
|
345
|
+
readonly kind: "number";
|
|
346
|
+
readonly min?: number | undefined;
|
|
347
|
+
readonly max?: number | undefined;
|
|
348
|
+
} | {
|
|
349
|
+
readonly id: string;
|
|
350
|
+
readonly kind: "date";
|
|
351
|
+
readonly from?: string | undefined;
|
|
352
|
+
readonly to?: string | undefined;
|
|
353
|
+
} | {
|
|
354
|
+
readonly id: string;
|
|
355
|
+
readonly kind: "text";
|
|
356
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
357
|
+
readonly value: string;
|
|
358
|
+
} | {
|
|
359
|
+
readonly id: string;
|
|
360
|
+
readonly kind: "boolean";
|
|
361
|
+
readonly value: boolean;
|
|
362
|
+
} | {
|
|
363
|
+
readonly id: string;
|
|
364
|
+
readonly kind: "values";
|
|
365
|
+
readonly values: readonly [string, ...string[]];
|
|
366
|
+
})[]>>;
|
|
273
367
|
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
274
368
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
275
369
|
readonly id: Schema.String;
|
package/dist/admin/api.group.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi, } from "effect/http-api";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
import { AdminCreateOrganizationPayload, AdminApiKey, AdminApiKeyIdParams,
|
|
3
|
+
import { AdminCreateOrganizationPayload, AdminApiKey, AdminApiKeyIdParams, AdminUserListQuery, AdminOrganizationListQuery, AdminOrganization, AdminOrganizationIdParams, AdminUpdateApiKeyPayload, AdminUpdateOrganizationPayload, DashboardStatsQuery, DashboardStatsResponse, PaginatedAdminOrganizations, PaginatedAdminUsers, ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, } from "./schema.js";
|
|
4
4
|
export * from "./schema.js";
|
|
5
5
|
export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
6
6
|
.add(HttpApiEndpoint.get("dashboardStats", "/admin/dashboard-stats", {
|
|
@@ -100,7 +100,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
100
100
|
description: "Disables rate-limit enforcement for an API key.",
|
|
101
101
|
})))
|
|
102
102
|
.add(HttpApiEndpoint.get("listUsers", "/admin/users", {
|
|
103
|
-
query:
|
|
103
|
+
query: AdminUserListQuery.fields,
|
|
104
104
|
success: PaginatedAdminUsers,
|
|
105
105
|
error: [
|
|
106
106
|
HttpApiError.Unauthorized,
|
|
@@ -113,7 +113,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
113
113
|
description: "Returns paginated auth user records with optional filtering and sorting.",
|
|
114
114
|
})))
|
|
115
115
|
.add(HttpApiEndpoint.get("listOrganizations", "/admin/organizations", {
|
|
116
|
-
query:
|
|
116
|
+
query: AdminOrganizationListQuery.fields,
|
|
117
117
|
success: PaginatedAdminOrganizations,
|
|
118
118
|
error: [
|
|
119
119
|
HttpApiError.Unauthorized,
|
package/dist/admin/schema.d.ts
CHANGED
|
@@ -1,6 +1,174 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload } from "../server/schema.js";
|
|
3
3
|
export declare const AdminListQuery: Schema.Struct<{
|
|
4
|
+
readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
|
|
5
|
+
readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
|
|
6
|
+
readonly globalFilter: Schema.optional<Schema.String>;
|
|
7
|
+
readonly sort: Schema.optional<Schema.declare<readonly {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly direction: "asc" | "desc";
|
|
10
|
+
}[], readonly {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly direction: "asc" | "desc";
|
|
13
|
+
}[]>>;
|
|
14
|
+
readonly filters: Schema.optional<Schema.declare<readonly ({
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly kind: "number";
|
|
17
|
+
readonly min?: number | undefined;
|
|
18
|
+
readonly max?: number | undefined;
|
|
19
|
+
} | {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly kind: "date";
|
|
22
|
+
readonly from?: string | undefined;
|
|
23
|
+
readonly to?: string | undefined;
|
|
24
|
+
} | {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly kind: "text";
|
|
27
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
28
|
+
readonly value: string;
|
|
29
|
+
} | {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly kind: "boolean";
|
|
32
|
+
readonly value: boolean;
|
|
33
|
+
} | {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly kind: "values";
|
|
36
|
+
readonly values: readonly [string, ...string[]];
|
|
37
|
+
})[], readonly ({
|
|
38
|
+
readonly id: string;
|
|
39
|
+
readonly kind: "number";
|
|
40
|
+
readonly min?: number | undefined;
|
|
41
|
+
readonly max?: number | undefined;
|
|
42
|
+
} | {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly kind: "date";
|
|
45
|
+
readonly from?: string | undefined;
|
|
46
|
+
readonly to?: string | undefined;
|
|
47
|
+
} | {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly kind: "text";
|
|
50
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
51
|
+
readonly value: string;
|
|
52
|
+
} | {
|
|
53
|
+
readonly id: string;
|
|
54
|
+
readonly kind: "boolean";
|
|
55
|
+
readonly value: boolean;
|
|
56
|
+
} | {
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly kind: "values";
|
|
59
|
+
readonly values: readonly [string, ...string[]];
|
|
60
|
+
})[]>>;
|
|
61
|
+
readonly projectId: Schema.optional<Schema.String>;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const AdminUserColumnFilter: Schema.Union<readonly [Schema.Struct<{
|
|
64
|
+
readonly id: Schema.NonEmptyString;
|
|
65
|
+
readonly kind: Schema.Literal<"text">;
|
|
66
|
+
readonly operator: Schema.Literals<readonly ["contains", "equals", "startsWith", "endsWith"]>;
|
|
67
|
+
readonly value: Schema.NonEmptyString;
|
|
68
|
+
}>, Schema.Struct<{
|
|
69
|
+
readonly id: Schema.NonEmptyString;
|
|
70
|
+
readonly kind: Schema.Literal<"number">;
|
|
71
|
+
readonly min: Schema.optional<Schema.Finite>;
|
|
72
|
+
readonly max: Schema.optional<Schema.Finite>;
|
|
73
|
+
}>, Schema.Struct<{
|
|
74
|
+
readonly id: Schema.NonEmptyString;
|
|
75
|
+
readonly kind: Schema.Literal<"date">;
|
|
76
|
+
readonly from: Schema.optional<Schema.String>;
|
|
77
|
+
readonly to: Schema.optional<Schema.String>;
|
|
78
|
+
}>, Schema.Struct<{
|
|
79
|
+
readonly id: Schema.NonEmptyString;
|
|
80
|
+
readonly kind: Schema.Literal<"boolean">;
|
|
81
|
+
readonly value: Schema.Boolean;
|
|
82
|
+
}>, Schema.Struct<{
|
|
83
|
+
readonly id: Schema.NonEmptyString;
|
|
84
|
+
readonly kind: Schema.Literal<"values">;
|
|
85
|
+
readonly values: Schema.NonEmptyArray<Schema.String>;
|
|
86
|
+
}>]>;
|
|
87
|
+
export declare const AdminOrganizationColumnFilter: Schema.Union<readonly [Schema.Struct<{
|
|
88
|
+
readonly id: Schema.NonEmptyString;
|
|
89
|
+
readonly kind: Schema.Literal<"text">;
|
|
90
|
+
readonly operator: Schema.Literals<readonly ["contains", "equals", "startsWith", "endsWith"]>;
|
|
91
|
+
readonly value: Schema.NonEmptyString;
|
|
92
|
+
}>, Schema.Struct<{
|
|
93
|
+
readonly id: Schema.NonEmptyString;
|
|
94
|
+
readonly kind: Schema.Literal<"number">;
|
|
95
|
+
readonly min: Schema.optional<Schema.Finite>;
|
|
96
|
+
readonly max: Schema.optional<Schema.Finite>;
|
|
97
|
+
}>, Schema.Struct<{
|
|
98
|
+
readonly id: Schema.NonEmptyString;
|
|
99
|
+
readonly kind: Schema.Literal<"date">;
|
|
100
|
+
readonly from: Schema.optional<Schema.String>;
|
|
101
|
+
readonly to: Schema.optional<Schema.String>;
|
|
102
|
+
}>, Schema.Struct<{
|
|
103
|
+
readonly id: Schema.NonEmptyString;
|
|
104
|
+
readonly kind: Schema.Literal<"boolean">;
|
|
105
|
+
readonly value: Schema.Boolean;
|
|
106
|
+
}>, Schema.Struct<{
|
|
107
|
+
readonly id: Schema.NonEmptyString;
|
|
108
|
+
readonly kind: Schema.Literal<"values">;
|
|
109
|
+
readonly values: Schema.NonEmptyArray<Schema.String>;
|
|
110
|
+
}>]>;
|
|
111
|
+
export declare const AdminUserListQuery: Schema.Struct<{
|
|
112
|
+
readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
|
|
113
|
+
readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
|
|
114
|
+
readonly globalFilter: Schema.optional<Schema.String>;
|
|
115
|
+
readonly sort: Schema.optional<Schema.declare<readonly {
|
|
116
|
+
readonly id: string;
|
|
117
|
+
readonly direction: "asc" | "desc";
|
|
118
|
+
}[], readonly {
|
|
119
|
+
readonly id: string;
|
|
120
|
+
readonly direction: "asc" | "desc";
|
|
121
|
+
}[]>>;
|
|
122
|
+
readonly projectId: Schema.optional<Schema.String>;
|
|
123
|
+
readonly filters: Schema.optional<Schema.declare<readonly ({
|
|
124
|
+
readonly id: string;
|
|
125
|
+
readonly kind: "number";
|
|
126
|
+
readonly min?: number | undefined;
|
|
127
|
+
readonly max?: number | undefined;
|
|
128
|
+
} | {
|
|
129
|
+
readonly id: string;
|
|
130
|
+
readonly kind: "date";
|
|
131
|
+
readonly from?: string | undefined;
|
|
132
|
+
readonly to?: string | undefined;
|
|
133
|
+
} | {
|
|
134
|
+
readonly id: string;
|
|
135
|
+
readonly kind: "text";
|
|
136
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
137
|
+
readonly value: string;
|
|
138
|
+
} | {
|
|
139
|
+
readonly id: string;
|
|
140
|
+
readonly kind: "boolean";
|
|
141
|
+
readonly value: boolean;
|
|
142
|
+
} | {
|
|
143
|
+
readonly id: string;
|
|
144
|
+
readonly kind: "values";
|
|
145
|
+
readonly values: readonly [string, ...string[]];
|
|
146
|
+
})[], readonly ({
|
|
147
|
+
readonly id: string;
|
|
148
|
+
readonly kind: "number";
|
|
149
|
+
readonly min?: number | undefined;
|
|
150
|
+
readonly max?: number | undefined;
|
|
151
|
+
} | {
|
|
152
|
+
readonly id: string;
|
|
153
|
+
readonly kind: "date";
|
|
154
|
+
readonly from?: string | undefined;
|
|
155
|
+
readonly to?: string | undefined;
|
|
156
|
+
} | {
|
|
157
|
+
readonly id: string;
|
|
158
|
+
readonly kind: "text";
|
|
159
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
160
|
+
readonly value: string;
|
|
161
|
+
} | {
|
|
162
|
+
readonly id: string;
|
|
163
|
+
readonly kind: "boolean";
|
|
164
|
+
readonly value: boolean;
|
|
165
|
+
} | {
|
|
166
|
+
readonly id: string;
|
|
167
|
+
readonly kind: "values";
|
|
168
|
+
readonly values: readonly [string, ...string[]];
|
|
169
|
+
})[]>>;
|
|
170
|
+
}>;
|
|
171
|
+
export declare const AdminOrganizationListQuery: Schema.Struct<{
|
|
4
172
|
readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
|
|
5
173
|
readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
|
|
6
174
|
readonly globalFilter: Schema.optional<Schema.String>;
|
|
@@ -12,6 +180,53 @@ export declare const AdminListQuery: Schema.Struct<{
|
|
|
12
180
|
readonly direction: "asc" | "desc";
|
|
13
181
|
}[]>>;
|
|
14
182
|
readonly projectId: Schema.optional<Schema.String>;
|
|
183
|
+
readonly filters: Schema.optional<Schema.declare<readonly ({
|
|
184
|
+
readonly id: string;
|
|
185
|
+
readonly kind: "number";
|
|
186
|
+
readonly min?: number | undefined;
|
|
187
|
+
readonly max?: number | undefined;
|
|
188
|
+
} | {
|
|
189
|
+
readonly id: string;
|
|
190
|
+
readonly kind: "date";
|
|
191
|
+
readonly from?: string | undefined;
|
|
192
|
+
readonly to?: string | undefined;
|
|
193
|
+
} | {
|
|
194
|
+
readonly id: string;
|
|
195
|
+
readonly kind: "text";
|
|
196
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
197
|
+
readonly value: string;
|
|
198
|
+
} | {
|
|
199
|
+
readonly id: string;
|
|
200
|
+
readonly kind: "boolean";
|
|
201
|
+
readonly value: boolean;
|
|
202
|
+
} | {
|
|
203
|
+
readonly id: string;
|
|
204
|
+
readonly kind: "values";
|
|
205
|
+
readonly values: readonly [string, ...string[]];
|
|
206
|
+
})[], readonly ({
|
|
207
|
+
readonly id: string;
|
|
208
|
+
readonly kind: "number";
|
|
209
|
+
readonly min?: number | undefined;
|
|
210
|
+
readonly max?: number | undefined;
|
|
211
|
+
} | {
|
|
212
|
+
readonly id: string;
|
|
213
|
+
readonly kind: "date";
|
|
214
|
+
readonly from?: string | undefined;
|
|
215
|
+
readonly to?: string | undefined;
|
|
216
|
+
} | {
|
|
217
|
+
readonly id: string;
|
|
218
|
+
readonly kind: "text";
|
|
219
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
220
|
+
readonly value: string;
|
|
221
|
+
} | {
|
|
222
|
+
readonly id: string;
|
|
223
|
+
readonly kind: "boolean";
|
|
224
|
+
readonly value: boolean;
|
|
225
|
+
} | {
|
|
226
|
+
readonly id: string;
|
|
227
|
+
readonly kind: "values";
|
|
228
|
+
readonly values: readonly [string, ...string[]];
|
|
229
|
+
})[]>>;
|
|
15
230
|
}>;
|
|
16
231
|
export declare const AdminProjectPreview: Schema.Struct<{
|
|
17
232
|
readonly id: Schema.String;
|
package/dist/admin/schema.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { ApiKeyPermissionGrant } from "../access.js";
|
|
3
|
-
import { PaginatedResponse, Query } from "@krak-stack/registry/query";
|
|
3
|
+
import { ColumnFilter, ColumnFilters, PaginatedResponse, Query, } from "@krak-stack/registry/query";
|
|
4
4
|
import { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, } from "../server/schema.js";
|
|
5
5
|
export const AdminListQuery = Schema.Struct({
|
|
6
6
|
...Query.fields,
|
|
@@ -11,6 +11,44 @@ export const AdminListQuery = Schema.Struct({
|
|
|
11
11
|
description: "Paginated administrative list query optionally scoped to linked project records.",
|
|
12
12
|
examples: [{ page: 0, pageSize: 10, projectId: "project-id" }],
|
|
13
13
|
});
|
|
14
|
+
export const AdminUserColumnFilter = ColumnFilter.check(Schema.makeFilter((filter) => {
|
|
15
|
+
switch (filter.id) {
|
|
16
|
+
case "name":
|
|
17
|
+
case "email":
|
|
18
|
+
case "role":
|
|
19
|
+
return filter.kind === "text";
|
|
20
|
+
case "emailVerified":
|
|
21
|
+
case "banned":
|
|
22
|
+
return filter.kind === "boolean";
|
|
23
|
+
case "createdAt":
|
|
24
|
+
case "lastSignedIn":
|
|
25
|
+
return filter.kind === "date";
|
|
26
|
+
default:
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
})).annotate({ identifier: "AdminUserColumnFilter" });
|
|
30
|
+
export const AdminOrganizationColumnFilter = ColumnFilter.check(Schema.makeFilter((filter) => {
|
|
31
|
+
switch (filter.id) {
|
|
32
|
+
case "name":
|
|
33
|
+
case "slug":
|
|
34
|
+
return filter.kind === "text";
|
|
35
|
+
case "createdAt":
|
|
36
|
+
return filter.kind === "date";
|
|
37
|
+
case "userId":
|
|
38
|
+
return (filter.kind === "values" &&
|
|
39
|
+
filter.values.every((value) => ["personal", "standard"].includes(value)));
|
|
40
|
+
default:
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
})).annotate({ identifier: "AdminOrganizationColumnFilter" });
|
|
44
|
+
export const AdminUserListQuery = Schema.Struct({
|
|
45
|
+
...AdminListQuery.fields,
|
|
46
|
+
filters: Schema.optional(ColumnFilters.check(Schema.makeFilter((filters) => filters.every(Schema.is(AdminUserColumnFilter))))),
|
|
47
|
+
}).annotate({ identifier: "AdminUserListQuery" });
|
|
48
|
+
export const AdminOrganizationListQuery = Schema.Struct({
|
|
49
|
+
...AdminListQuery.fields,
|
|
50
|
+
filters: Schema.optional(ColumnFilters.check(Schema.makeFilter((filters) => filters.every(Schema.is(AdminOrganizationColumnFilter))))),
|
|
51
|
+
}).annotate({ identifier: "AdminOrganizationListQuery" });
|
|
14
52
|
export const AdminProjectPreview = Schema.Struct({
|
|
15
53
|
id: Schema.String,
|
|
16
54
|
name: Schema.String,
|
package/dist/api.d.ts
CHANGED
|
@@ -2189,6 +2189,53 @@ export declare const AuthClientApi: HttpApi.HttpApi<"AuthClientApi", import("eff
|
|
|
2189
2189
|
readonly direction: "asc" | "desc";
|
|
2190
2190
|
}[]>>;
|
|
2191
2191
|
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
2192
|
+
readonly filters: import("effect/Schema").optional<import("effect/Schema").declare<readonly ({
|
|
2193
|
+
readonly id: string;
|
|
2194
|
+
readonly kind: "number";
|
|
2195
|
+
readonly min?: number | undefined;
|
|
2196
|
+
readonly max?: number | undefined;
|
|
2197
|
+
} | {
|
|
2198
|
+
readonly id: string;
|
|
2199
|
+
readonly kind: "date";
|
|
2200
|
+
readonly from?: string | undefined;
|
|
2201
|
+
readonly to?: string | undefined;
|
|
2202
|
+
} | {
|
|
2203
|
+
readonly id: string;
|
|
2204
|
+
readonly kind: "text";
|
|
2205
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
2206
|
+
readonly value: string;
|
|
2207
|
+
} | {
|
|
2208
|
+
readonly id: string;
|
|
2209
|
+
readonly kind: "boolean";
|
|
2210
|
+
readonly value: boolean;
|
|
2211
|
+
} | {
|
|
2212
|
+
readonly id: string;
|
|
2213
|
+
readonly kind: "values";
|
|
2214
|
+
readonly values: readonly [string, ...string[]];
|
|
2215
|
+
})[], readonly ({
|
|
2216
|
+
readonly id: string;
|
|
2217
|
+
readonly kind: "number";
|
|
2218
|
+
readonly min?: number | undefined;
|
|
2219
|
+
readonly max?: number | undefined;
|
|
2220
|
+
} | {
|
|
2221
|
+
readonly id: string;
|
|
2222
|
+
readonly kind: "date";
|
|
2223
|
+
readonly from?: string | undefined;
|
|
2224
|
+
readonly to?: string | undefined;
|
|
2225
|
+
} | {
|
|
2226
|
+
readonly id: string;
|
|
2227
|
+
readonly kind: "text";
|
|
2228
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
2229
|
+
readonly value: string;
|
|
2230
|
+
} | {
|
|
2231
|
+
readonly id: string;
|
|
2232
|
+
readonly kind: "boolean";
|
|
2233
|
+
readonly value: boolean;
|
|
2234
|
+
} | {
|
|
2235
|
+
readonly id: string;
|
|
2236
|
+
readonly kind: "values";
|
|
2237
|
+
readonly values: readonly [string, ...string[]];
|
|
2238
|
+
})[]>>;
|
|
2192
2239
|
}>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
2193
2240
|
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
2194
2241
|
readonly id: import("effect/Schema").String;
|
|
@@ -2230,6 +2277,53 @@ export declare const AuthClientApi: HttpApi.HttpApi<"AuthClientApi", import("eff
|
|
|
2230
2277
|
readonly direction: "asc" | "desc";
|
|
2231
2278
|
}[]>>;
|
|
2232
2279
|
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
2280
|
+
readonly filters: import("effect/Schema").optional<import("effect/Schema").declare<readonly ({
|
|
2281
|
+
readonly id: string;
|
|
2282
|
+
readonly kind: "number";
|
|
2283
|
+
readonly min?: number | undefined;
|
|
2284
|
+
readonly max?: number | undefined;
|
|
2285
|
+
} | {
|
|
2286
|
+
readonly id: string;
|
|
2287
|
+
readonly kind: "date";
|
|
2288
|
+
readonly from?: string | undefined;
|
|
2289
|
+
readonly to?: string | undefined;
|
|
2290
|
+
} | {
|
|
2291
|
+
readonly id: string;
|
|
2292
|
+
readonly kind: "text";
|
|
2293
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
2294
|
+
readonly value: string;
|
|
2295
|
+
} | {
|
|
2296
|
+
readonly id: string;
|
|
2297
|
+
readonly kind: "boolean";
|
|
2298
|
+
readonly value: boolean;
|
|
2299
|
+
} | {
|
|
2300
|
+
readonly id: string;
|
|
2301
|
+
readonly kind: "values";
|
|
2302
|
+
readonly values: readonly [string, ...string[]];
|
|
2303
|
+
})[], readonly ({
|
|
2304
|
+
readonly id: string;
|
|
2305
|
+
readonly kind: "number";
|
|
2306
|
+
readonly min?: number | undefined;
|
|
2307
|
+
readonly max?: number | undefined;
|
|
2308
|
+
} | {
|
|
2309
|
+
readonly id: string;
|
|
2310
|
+
readonly kind: "date";
|
|
2311
|
+
readonly from?: string | undefined;
|
|
2312
|
+
readonly to?: string | undefined;
|
|
2313
|
+
} | {
|
|
2314
|
+
readonly id: string;
|
|
2315
|
+
readonly kind: "text";
|
|
2316
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
2317
|
+
readonly value: string;
|
|
2318
|
+
} | {
|
|
2319
|
+
readonly id: string;
|
|
2320
|
+
readonly kind: "boolean";
|
|
2321
|
+
readonly value: boolean;
|
|
2322
|
+
} | {
|
|
2323
|
+
readonly id: string;
|
|
2324
|
+
readonly kind: "values";
|
|
2325
|
+
readonly values: readonly [string, ...string[]];
|
|
2326
|
+
})[]>>;
|
|
2233
2327
|
}>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
2234
2328
|
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
2235
2329
|
readonly id: import("effect/Schema").String;
|
|
@@ -224,12 +224,13 @@ export function AdminOrganizationsTable({ messages: messageOverrides, onSearchCh
|
|
|
224
224
|
},
|
|
225
225
|
],
|
|
226
226
|
},
|
|
227
|
-
}, state: tableRequest.search, onStateChange: ({ page, pageSize, globalFilter, sort }) => {
|
|
227
|
+
}, state: tableRequest.search, onStateChange: ({ page, pageSize, globalFilter, sort, filters }) => {
|
|
228
228
|
const nextSearch = Schema.decodeUnknownSync(Query)({
|
|
229
229
|
page,
|
|
230
230
|
pageSize,
|
|
231
231
|
globalFilter,
|
|
232
232
|
sort,
|
|
233
|
+
filters,
|
|
233
234
|
});
|
|
234
235
|
setTableRequest((current) => ({
|
|
235
236
|
...current,
|
|
@@ -261,6 +262,7 @@ const organizationColumns = (m, locale, baseUrl, impersonate, impersonateAsOrgan
|
|
|
261
262
|
{
|
|
262
263
|
field: "memberCount",
|
|
263
264
|
headerName: m.admin_column_members,
|
|
265
|
+
filterable: false,
|
|
264
266
|
type: "list",
|
|
265
267
|
typeOptions: {
|
|
266
268
|
emptyLabel: "0",
|
|
@@ -302,6 +304,11 @@ const organizationColumns = (m, locale, baseUrl, impersonate, impersonateAsOrgan
|
|
|
302
304
|
{
|
|
303
305
|
field: "userId",
|
|
304
306
|
headerName: m.organization_type,
|
|
307
|
+
filterOptions: [
|
|
308
|
+
{ value: "personal", label: m.organization_type_personal },
|
|
309
|
+
{ value: "standard", label: m.organization_type_standard },
|
|
310
|
+
],
|
|
311
|
+
filterValueGetter: ({ data }) => (data.userId ? "personal" : "standard"),
|
|
305
312
|
cellRenderer: ({ data }) => (_jsx(Badge, { variant: data.userId ? "secondary" : "outline", children: data.userId
|
|
306
313
|
? m.organization_type_personal
|
|
307
314
|
: m.organization_type_standard })),
|
|
@@ -309,6 +316,7 @@ const organizationColumns = (m, locale, baseUrl, impersonate, impersonateAsOrgan
|
|
|
309
316
|
{
|
|
310
317
|
field: "projects",
|
|
311
318
|
headerName: m.admin_column_projects,
|
|
319
|
+
filterable: false,
|
|
312
320
|
type: "list",
|
|
313
321
|
typeOptions: {
|
|
314
322
|
emptyLabel: "-",
|
|
@@ -326,6 +334,7 @@ const organizationColumns = (m, locale, baseUrl, impersonate, impersonateAsOrgan
|
|
|
326
334
|
{
|
|
327
335
|
field: "createdAt",
|
|
328
336
|
headerName: m.admin_column_created,
|
|
337
|
+
type: "date",
|
|
329
338
|
cellRenderer: ({ data }) => (_jsx("span", { className: "text-muted-foreground text-sm", children: new Date(data.createdAt).toLocaleDateString() })),
|
|
330
339
|
},
|
|
331
340
|
];
|
|
@@ -199,12 +199,13 @@ export function AdminUsersTable({ onSearchChange, reloadKey = 0, search, }) {
|
|
|
199
199
|
},
|
|
200
200
|
],
|
|
201
201
|
},
|
|
202
|
-
}, state: tableRequest.search, onStateChange: ({ page, pageSize, globalFilter, sort }) => {
|
|
202
|
+
}, state: tableRequest.search, onStateChange: ({ page, pageSize, globalFilter, sort, filters }) => {
|
|
203
203
|
const nextSearch = Schema.decodeUnknownSync(Query)({
|
|
204
204
|
page,
|
|
205
205
|
pageSize,
|
|
206
206
|
globalFilter,
|
|
207
207
|
sort,
|
|
208
|
+
filters,
|
|
208
209
|
});
|
|
209
210
|
setTableRequest((current) => ({
|
|
210
211
|
...current,
|
|
@@ -242,6 +243,7 @@ const userColumns = (m, baseUrl) => [
|
|
|
242
243
|
{
|
|
243
244
|
field: "organizations",
|
|
244
245
|
headerName: m.admin_column_organizations,
|
|
246
|
+
filterable: false,
|
|
245
247
|
type: "list",
|
|
246
248
|
typeOptions: {
|
|
247
249
|
emptyLabel: "-",
|
|
@@ -259,6 +261,7 @@ const userColumns = (m, baseUrl) => [
|
|
|
259
261
|
{
|
|
260
262
|
field: "projects",
|
|
261
263
|
headerName: m.admin_column_projects,
|
|
264
|
+
filterable: false,
|
|
262
265
|
type: "list",
|
|
263
266
|
typeOptions: {
|
|
264
267
|
emptyLabel: "-",
|
|
@@ -276,11 +279,17 @@ const userColumns = (m, baseUrl) => [
|
|
|
276
279
|
{
|
|
277
280
|
field: "emailVerified",
|
|
278
281
|
headerName: m.admin_column_verified,
|
|
282
|
+
type: "boolean",
|
|
283
|
+
typeOptions: {
|
|
284
|
+
trueLabel: m.admin_column_verified,
|
|
285
|
+
falseLabel: m.admin_column_unverified,
|
|
286
|
+
},
|
|
279
287
|
cellRenderer: ({ data }) => data.emailVerified ? (_jsx(Badge, { variant: "outline", children: m.admin_column_verified })) : (_jsx(Badge, { variant: "secondary", children: m.admin_column_unverified })),
|
|
280
288
|
},
|
|
281
289
|
{
|
|
282
290
|
field: "role",
|
|
283
291
|
headerName: m.admin_column_role,
|
|
292
|
+
filterValueGetter: ({ data }) => data.role ?? "user",
|
|
284
293
|
cellRenderer: ({ data }) => {
|
|
285
294
|
const role = data.role;
|
|
286
295
|
if (!role)
|
|
@@ -291,16 +300,24 @@ const userColumns = (m, baseUrl) => [
|
|
|
291
300
|
{
|
|
292
301
|
field: "banned",
|
|
293
302
|
headerName: m.admin_column_status,
|
|
303
|
+
type: "boolean",
|
|
304
|
+
filterValueGetter: ({ data }) => Boolean(data.banned),
|
|
305
|
+
typeOptions: {
|
|
306
|
+
trueLabel: m.admin_status_banned,
|
|
307
|
+
falseLabel: m.admin_status_active,
|
|
308
|
+
},
|
|
294
309
|
cellRenderer: ({ data }) => data.banned ? (_jsx(Badge, { variant: "destructive", children: m.admin_status_banned })) : (_jsx(Badge, { variant: "outline", children: m.admin_status_active })),
|
|
295
310
|
},
|
|
296
311
|
{
|
|
297
312
|
field: "lastSignedIn",
|
|
298
313
|
headerName: m.admin_column_last_signed_in,
|
|
314
|
+
type: "dateTime",
|
|
299
315
|
cellRenderer: ({ data }) => (_jsx("span", { className: "text-muted-foreground text-sm", children: data.lastSignedIn ? new Date(data.lastSignedIn).toLocaleString() : "-" })),
|
|
300
316
|
},
|
|
301
317
|
{
|
|
302
318
|
field: "createdAt",
|
|
303
319
|
headerName: m.admin_column_created,
|
|
320
|
+
type: "date",
|
|
304
321
|
cellRenderer: ({ data }) => (_jsx("span", { className: "text-muted-foreground text-sm", children: new Date(data.createdAt).toLocaleDateString() })),
|
|
305
322
|
},
|
|
306
323
|
];
|
|
@@ -243,6 +243,53 @@ export declare const authHttpClient: (baseUrl?: string | undefined, getLocale?:
|
|
|
243
243
|
readonly direction: "asc" | "desc";
|
|
244
244
|
}[]>>;
|
|
245
245
|
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
246
|
+
readonly filters: import("effect/Schema").optional<import("effect/Schema").declare<readonly ({
|
|
247
|
+
readonly id: string;
|
|
248
|
+
readonly kind: "number";
|
|
249
|
+
readonly min?: number | undefined;
|
|
250
|
+
readonly max?: number | undefined;
|
|
251
|
+
} | {
|
|
252
|
+
readonly id: string;
|
|
253
|
+
readonly kind: "date";
|
|
254
|
+
readonly from?: string | undefined;
|
|
255
|
+
readonly to?: string | undefined;
|
|
256
|
+
} | {
|
|
257
|
+
readonly id: string;
|
|
258
|
+
readonly kind: "text";
|
|
259
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
260
|
+
readonly value: string;
|
|
261
|
+
} | {
|
|
262
|
+
readonly id: string;
|
|
263
|
+
readonly kind: "boolean";
|
|
264
|
+
readonly value: boolean;
|
|
265
|
+
} | {
|
|
266
|
+
readonly id: string;
|
|
267
|
+
readonly kind: "values";
|
|
268
|
+
readonly values: readonly [string, ...string[]];
|
|
269
|
+
})[], readonly ({
|
|
270
|
+
readonly id: string;
|
|
271
|
+
readonly kind: "number";
|
|
272
|
+
readonly min?: number | undefined;
|
|
273
|
+
readonly max?: number | undefined;
|
|
274
|
+
} | {
|
|
275
|
+
readonly id: string;
|
|
276
|
+
readonly kind: "date";
|
|
277
|
+
readonly from?: string | undefined;
|
|
278
|
+
readonly to?: string | undefined;
|
|
279
|
+
} | {
|
|
280
|
+
readonly id: string;
|
|
281
|
+
readonly kind: "text";
|
|
282
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
283
|
+
readonly value: string;
|
|
284
|
+
} | {
|
|
285
|
+
readonly id: string;
|
|
286
|
+
readonly kind: "boolean";
|
|
287
|
+
readonly value: boolean;
|
|
288
|
+
} | {
|
|
289
|
+
readonly id: string;
|
|
290
|
+
readonly kind: "values";
|
|
291
|
+
readonly values: readonly [string, ...string[]];
|
|
292
|
+
})[]>>;
|
|
246
293
|
}>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
247
294
|
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
248
295
|
readonly id: import("effect/Schema").String;
|
|
@@ -285,6 +332,53 @@ export declare const authHttpClient: (baseUrl?: string | undefined, getLocale?:
|
|
|
285
332
|
readonly direction: "asc" | "desc";
|
|
286
333
|
}[]>>;
|
|
287
334
|
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
335
|
+
readonly filters: import("effect/Schema").optional<import("effect/Schema").declare<readonly ({
|
|
336
|
+
readonly id: string;
|
|
337
|
+
readonly kind: "number";
|
|
338
|
+
readonly min?: number | undefined;
|
|
339
|
+
readonly max?: number | undefined;
|
|
340
|
+
} | {
|
|
341
|
+
readonly id: string;
|
|
342
|
+
readonly kind: "date";
|
|
343
|
+
readonly from?: string | undefined;
|
|
344
|
+
readonly to?: string | undefined;
|
|
345
|
+
} | {
|
|
346
|
+
readonly id: string;
|
|
347
|
+
readonly kind: "text";
|
|
348
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
349
|
+
readonly value: string;
|
|
350
|
+
} | {
|
|
351
|
+
readonly id: string;
|
|
352
|
+
readonly kind: "boolean";
|
|
353
|
+
readonly value: boolean;
|
|
354
|
+
} | {
|
|
355
|
+
readonly id: string;
|
|
356
|
+
readonly kind: "values";
|
|
357
|
+
readonly values: readonly [string, ...string[]];
|
|
358
|
+
})[], readonly ({
|
|
359
|
+
readonly id: string;
|
|
360
|
+
readonly kind: "number";
|
|
361
|
+
readonly min?: number | undefined;
|
|
362
|
+
readonly max?: number | undefined;
|
|
363
|
+
} | {
|
|
364
|
+
readonly id: string;
|
|
365
|
+
readonly kind: "date";
|
|
366
|
+
readonly from?: string | undefined;
|
|
367
|
+
readonly to?: string | undefined;
|
|
368
|
+
} | {
|
|
369
|
+
readonly id: string;
|
|
370
|
+
readonly kind: "text";
|
|
371
|
+
readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
|
|
372
|
+
readonly value: string;
|
|
373
|
+
} | {
|
|
374
|
+
readonly id: string;
|
|
375
|
+
readonly kind: "boolean";
|
|
376
|
+
readonly value: boolean;
|
|
377
|
+
} | {
|
|
378
|
+
readonly id: string;
|
|
379
|
+
readonly kind: "values";
|
|
380
|
+
readonly values: readonly [string, ...string[]];
|
|
381
|
+
})[]>>;
|
|
288
382
|
}>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
289
383
|
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
290
384
|
readonly id: import("effect/Schema").String;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krak-stack/auth",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.31",
|
|
4
4
|
"description": "Effect HttpApi clients and schemas for KrakStack Auth.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -71,17 +71,17 @@
|
|
|
71
71
|
"prepack": "bun run build"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@effect/atom-react": "^4.
|
|
74
|
+
"@effect/atom-react": "^4.1.0",
|
|
75
75
|
"@lucas-barake/effect-form-react": "1.1.0",
|
|
76
76
|
"react-qr-code": "^2.2.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@krak-stack/registry": "0.1.
|
|
79
|
+
"@krak-stack/registry": "0.1.58"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
|
-
"@krak-stack/registry": "^0.1.
|
|
82
|
+
"@krak-stack/registry": "^0.1.58",
|
|
83
83
|
"@tanstack/react-router": "^1.170.15",
|
|
84
|
-
"effect": "^4.
|
|
84
|
+
"effect": "^4.1.0",
|
|
85
85
|
"input-otp": "^1.5.0",
|
|
86
86
|
"lucide-react": "^1.18.0",
|
|
87
87
|
"react": "^19.2.0"
|