@krak-stack/auth 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access.d.ts +1 -3
- package/dist/access.js +1 -3
- package/dist/admin/api.group.d.ts +36 -36
- package/dist/admin/api.group.js +13 -13
- package/dist/api.d.ts +837 -837
- package/dist/auth/api.group.d.ts +86 -86
- package/dist/auth/api.group.js +8 -8
- package/dist/auth/schema.d.ts +48 -40
- package/dist/auth/schema.js +12 -9
- package/dist/components/admin-organization-form.js +1 -0
- package/dist/components/admin-organizations.d.ts +4 -5
- package/dist/components/admin-organizations.js +34 -31
- package/dist/components/admin-users.d.ts +5 -6
- package/dist/components/admin-users.js +51 -50
- package/dist/components/api-key-edit-form.js +2 -1
- package/dist/components/auth-atoms.d.ts +103 -103
- package/dist/components/auth-client-api.d.ts +834 -2351
- package/dist/components/auth-client-api.js +11 -7
- package/dist/components/auth-forms.js +6 -1
- package/dist/components/auth-provider.d.ts +13 -13
- package/dist/components/member-required.js +2 -2
- package/dist/components/organization-switcher.js +72 -69
- package/dist/components/user-button.js +31 -26
- package/dist/extra/api.group.d.ts +19 -19
- package/dist/extra/api.group.js +3 -3
- package/dist/extra/schema.d.ts +1 -2
- package/dist/extra/schema.js +1 -2
- package/dist/query.js +5 -5
- package/dist/server/api.group.d.ts +29 -29
- package/dist/server/api.group.js +12 -12
- package/dist/service.d.ts +1513 -1951
- package/package.json +4 -4
package/dist/access.d.ts
CHANGED
|
@@ -28,9 +28,7 @@ export type CurrentActor = {
|
|
|
28
28
|
readonly permissions: ReadonlySet<string>;
|
|
29
29
|
};
|
|
30
30
|
export declare const CurrentActor: Context.Service<CurrentActor, CurrentActor>;
|
|
31
|
-
declare const Forbidden_base: Schema.Class<Forbidden, Schema.
|
|
32
|
-
readonly _tag: Schema.tag<"Forbidden">;
|
|
33
|
-
}>, import("effect/Cause").YieldableError>;
|
|
31
|
+
declare const Forbidden_base: Schema.Class<Forbidden, Schema.TaggedStruct<"Forbidden", {}>, import("effect/Cause").YieldableError>;
|
|
34
32
|
export declare class Forbidden extends Forbidden_base {
|
|
35
33
|
}
|
|
36
34
|
export type Policy<E = never, R = never> = Effect.Effect<void, Forbidden | E, CurrentActor | R>;
|
package/dist/access.js
CHANGED
|
@@ -6,9 +6,7 @@ export const ApiKeyPermissionGrant = Schema.Record(Schema.String, Schema.Array(S
|
|
|
6
6
|
description: "Resource and action permissions assigned to an API key.",
|
|
7
7
|
});
|
|
8
8
|
export const CurrentActor = Context.Service("@krak-stack/auth/CurrentActor");
|
|
9
|
-
export class Forbidden extends Schema.
|
|
10
|
-
_tag: Schema.tag("Forbidden"),
|
|
11
|
-
}, {
|
|
9
|
+
export class Forbidden extends Schema.TaggedError()("Forbidden", {}, {
|
|
12
10
|
identifier: "Forbidden",
|
|
13
11
|
title: "Forbidden",
|
|
14
12
|
description: "The authenticated actor lacks a required permission.",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/unstable/httpapi";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
export * from "./schema.js";
|
|
4
|
-
export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEndpoint.HttpApiEndpoint<"createDomain", "POST", "/admin/domains",
|
|
4
|
+
export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEndpoint.HttpApiEndpoint<"createDomain", "POST", "/admin/domains", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
5
5
|
readonly hostname: Schema.NonEmptyString;
|
|
6
6
|
readonly rootHostname: Schema.NonEmptyString;
|
|
7
7
|
readonly projectId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
8
8
|
readonly organizationId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
9
9
|
readonly managed: Schema.Boolean;
|
|
10
|
-
}>>,
|
|
10
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
11
11
|
readonly id: Schema.String;
|
|
12
12
|
readonly hostname: Schema.String;
|
|
13
13
|
readonly rootHostname: Schema.String;
|
|
@@ -22,12 +22,12 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
22
22
|
readonly active: Schema.Boolean;
|
|
23
23
|
readonly createdAt: Schema.Date;
|
|
24
24
|
readonly updatedAt: Schema.Date;
|
|
25
|
-
}>>,
|
|
25
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createOrganization", "POST", "/admin/organizations", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
26
26
|
readonly name: Schema.NonEmptyString;
|
|
27
27
|
readonly slug: Schema.NonEmptyString;
|
|
28
28
|
readonly logo: Schema.optional<Schema.String>;
|
|
29
29
|
readonly parentId: Schema.optional<Schema.String>;
|
|
30
|
-
}>>,
|
|
30
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
31
31
|
readonly id: Schema.String;
|
|
32
32
|
readonly name: Schema.String;
|
|
33
33
|
readonly slug: Schema.String;
|
|
@@ -47,9 +47,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
47
47
|
readonly logo: Schema.NullOr<Schema.String>;
|
|
48
48
|
}>>>;
|
|
49
49
|
readonly createdAt: Schema.Date;
|
|
50
|
-
}>>,
|
|
50
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"dashboardStats", "GET", "/admin/dashboard-stats", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
51
51
|
readonly days: Schema.optional<Schema.Union<readonly [Schema.Literal<"7">, Schema.Literal<"14">, Schema.Literal<"30">, Schema.Literal<"90">]>>;
|
|
52
|
-
}>>,
|
|
52
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
53
53
|
readonly totalUsers: Schema.Number;
|
|
54
54
|
readonly totalOrganizations: Schema.Number;
|
|
55
55
|
readonly totalProjects: Schema.Number;
|
|
@@ -71,9 +71,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
71
71
|
readonly users: Schema.Number;
|
|
72
72
|
readonly organizations: Schema.Number;
|
|
73
73
|
}>>;
|
|
74
|
-
}>>,
|
|
74
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteApiKey", "DELETE", "/admin/api-keys/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
75
75
|
readonly id: Schema.String;
|
|
76
|
-
}>>,
|
|
76
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
77
77
|
readonly id: Schema.String;
|
|
78
78
|
readonly configId: Schema.String;
|
|
79
79
|
readonly name: Schema.NullOr<Schema.String>;
|
|
@@ -91,9 +91,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
91
91
|
readonly referrers: Schema.$Array<Schema.String>;
|
|
92
92
|
readonly createdAt: Schema.Date;
|
|
93
93
|
readonly updatedAt: Schema.Date;
|
|
94
|
-
}>>,
|
|
94
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteDomain", "DELETE", "/admin/domains/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
95
95
|
readonly id: Schema.NonEmptyString;
|
|
96
|
-
}>>,
|
|
96
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
97
97
|
readonly id: Schema.String;
|
|
98
98
|
readonly hostname: Schema.String;
|
|
99
99
|
readonly rootHostname: Schema.String;
|
|
@@ -108,9 +108,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
108
108
|
readonly active: Schema.Boolean;
|
|
109
109
|
readonly createdAt: Schema.Date;
|
|
110
110
|
readonly updatedAt: Schema.Date;
|
|
111
|
-
}>>,
|
|
111
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteOrganization", "DELETE", "/admin/organizations/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
112
112
|
readonly id: Schema.String;
|
|
113
|
-
}>>,
|
|
113
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
114
114
|
readonly id: Schema.String;
|
|
115
115
|
readonly name: Schema.String;
|
|
116
116
|
readonly slug: Schema.String;
|
|
@@ -130,9 +130,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
130
130
|
readonly logo: Schema.NullOr<Schema.String>;
|
|
131
131
|
}>>>;
|
|
132
132
|
readonly createdAt: Schema.Date;
|
|
133
|
-
}>>,
|
|
133
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"disableApiKeyRateLimit", "POST", "/admin/api-keys/:id/disable-rate-limit", Schema.toCodecStringTree<Schema.Struct<{
|
|
134
134
|
readonly id: Schema.String;
|
|
135
|
-
}>>,
|
|
135
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
136
136
|
readonly id: Schema.String;
|
|
137
137
|
readonly configId: Schema.String;
|
|
138
138
|
readonly name: Schema.NullOr<Schema.String>;
|
|
@@ -150,9 +150,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
150
150
|
readonly referrers: Schema.$Array<Schema.String>;
|
|
151
151
|
readonly createdAt: Schema.Date;
|
|
152
152
|
readonly updatedAt: Schema.Date;
|
|
153
|
-
}>>,
|
|
153
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"enableApiKeyRateLimit", "POST", "/admin/api-keys/:id/enable-rate-limit", Schema.toCodecStringTree<Schema.Struct<{
|
|
154
154
|
readonly id: Schema.String;
|
|
155
|
-
}>>,
|
|
155
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
156
156
|
readonly id: Schema.String;
|
|
157
157
|
readonly configId: Schema.String;
|
|
158
158
|
readonly name: Schema.NullOr<Schema.String>;
|
|
@@ -170,15 +170,15 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
170
170
|
readonly referrers: Schema.$Array<Schema.String>;
|
|
171
171
|
readonly createdAt: Schema.Date;
|
|
172
172
|
readonly updatedAt: Schema.Date;
|
|
173
|
-
}>>,
|
|
173
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainRecords", "GET", "/admin/domains/:id/records", Schema.toCodecStringTree<Schema.Struct<{
|
|
174
174
|
readonly id: Schema.NonEmptyString;
|
|
175
|
-
}>>,
|
|
175
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
|
|
176
176
|
readonly required: Schema.Boolean;
|
|
177
177
|
readonly status: Schema.String;
|
|
178
178
|
readonly type: Schema.String;
|
|
179
179
|
readonly name: Schema.String;
|
|
180
180
|
readonly value: Schema.String;
|
|
181
|
-
}>>>,
|
|
181
|
+
}>>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listApiKeys", "GET", "/admin/api-keys", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
|
|
182
182
|
readonly id: Schema.String;
|
|
183
183
|
readonly configId: Schema.String;
|
|
184
184
|
readonly name: Schema.NullOr<Schema.String>;
|
|
@@ -196,7 +196,7 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
196
196
|
readonly referrers: Schema.$Array<Schema.String>;
|
|
197
197
|
readonly createdAt: Schema.Date;
|
|
198
198
|
readonly updatedAt: Schema.Date;
|
|
199
|
-
}>>>,
|
|
199
|
+
}>>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listDomains", "GET", "/admin/domains", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
|
|
200
200
|
readonly id: Schema.String;
|
|
201
201
|
readonly hostname: Schema.String;
|
|
202
202
|
readonly rootHostname: Schema.String;
|
|
@@ -211,7 +211,7 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
211
211
|
readonly active: Schema.Boolean;
|
|
212
212
|
readonly createdAt: Schema.Date;
|
|
213
213
|
readonly updatedAt: Schema.Date;
|
|
214
|
-
}>>>,
|
|
214
|
+
}>>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizations", "GET", "/admin/organizations", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
215
215
|
readonly page: Schema.Int;
|
|
216
216
|
readonly pageSize: Schema.Int;
|
|
217
217
|
readonly globalFilter: Schema.optional<Schema.String>;
|
|
@@ -220,7 +220,7 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
220
220
|
readonly direction: Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>;
|
|
221
221
|
}>>, Schema.String, never, never>, never, never>>;
|
|
222
222
|
readonly projectId: Schema.optional<Schema.String>;
|
|
223
|
-
}>>,
|
|
223
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
224
224
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
225
225
|
readonly id: Schema.String;
|
|
226
226
|
readonly name: Schema.String;
|
|
@@ -248,7 +248,7 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
248
248
|
readonly total: Schema.Int;
|
|
249
249
|
readonly pageCount: Schema.Int;
|
|
250
250
|
}>;
|
|
251
|
-
}>>,
|
|
251
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listUsers", "GET", "/admin/users", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
252
252
|
readonly page: Schema.Int;
|
|
253
253
|
readonly pageSize: Schema.Int;
|
|
254
254
|
readonly globalFilter: Schema.optional<Schema.String>;
|
|
@@ -257,7 +257,7 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
257
257
|
readonly direction: Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>;
|
|
258
258
|
}>>, Schema.String, never, never>, never, never>>;
|
|
259
259
|
readonly projectId: Schema.optional<Schema.String>;
|
|
260
|
-
}>>,
|
|
260
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
261
261
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
262
262
|
readonly id: Schema.String;
|
|
263
263
|
readonly name: Schema.String;
|
|
@@ -287,9 +287,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
287
287
|
readonly total: Schema.Int;
|
|
288
288
|
readonly pageCount: Schema.Int;
|
|
289
289
|
}>;
|
|
290
|
-
}>>,
|
|
290
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"resetApiKeyRateLimit", "POST", "/admin/api-keys/:id/reset-rate-limit", Schema.toCodecStringTree<Schema.Struct<{
|
|
291
291
|
readonly id: Schema.String;
|
|
292
|
-
}>>,
|
|
292
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
293
293
|
readonly id: Schema.String;
|
|
294
294
|
readonly configId: Schema.String;
|
|
295
295
|
readonly name: Schema.NullOr<Schema.String>;
|
|
@@ -307,16 +307,16 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
307
307
|
readonly referrers: Schema.$Array<Schema.String>;
|
|
308
308
|
readonly createdAt: Schema.Date;
|
|
309
309
|
readonly updatedAt: Schema.Date;
|
|
310
|
-
}>>,
|
|
310
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateApiKey", "PATCH", "/admin/api-keys/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
311
311
|
readonly id: Schema.String;
|
|
312
|
-
}>>,
|
|
312
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
313
313
|
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
314
314
|
readonly enabled: Schema.optional<Schema.Boolean>;
|
|
315
315
|
readonly rateLimitEnabled: Schema.optional<Schema.Boolean>;
|
|
316
316
|
readonly rateLimitMax: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
317
317
|
readonly rateLimitTimeWindow: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
318
318
|
readonly referrers: Schema.optional<Schema.$Array<Schema.String>>;
|
|
319
|
-
}>>,
|
|
319
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
320
320
|
readonly id: Schema.String;
|
|
321
321
|
readonly configId: Schema.String;
|
|
322
322
|
readonly name: Schema.NullOr<Schema.String>;
|
|
@@ -334,15 +334,15 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
334
334
|
readonly referrers: Schema.$Array<Schema.String>;
|
|
335
335
|
readonly createdAt: Schema.Date;
|
|
336
336
|
readonly updatedAt: Schema.Date;
|
|
337
|
-
}>>,
|
|
337
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateDomain", "PATCH", "/admin/domains/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
338
338
|
readonly id: Schema.NonEmptyString;
|
|
339
|
-
}>>,
|
|
339
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
340
340
|
readonly hostname: Schema.NonEmptyString;
|
|
341
341
|
readonly rootHostname: Schema.NonEmptyString;
|
|
342
342
|
readonly projectId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
343
343
|
readonly organizationId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
344
344
|
readonly managed: Schema.Boolean;
|
|
345
|
-
}>>,
|
|
345
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
346
346
|
readonly id: Schema.String;
|
|
347
347
|
readonly hostname: Schema.String;
|
|
348
348
|
readonly rootHostname: Schema.String;
|
|
@@ -357,14 +357,14 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
357
357
|
readonly active: Schema.Boolean;
|
|
358
358
|
readonly createdAt: Schema.Date;
|
|
359
359
|
readonly updatedAt: Schema.Date;
|
|
360
|
-
}>>,
|
|
360
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateOrganization", "PATCH", "/admin/organizations/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
361
361
|
readonly id: Schema.String;
|
|
362
|
-
}>>,
|
|
362
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
363
363
|
readonly name: Schema.optional<Schema.NonEmptyString>;
|
|
364
364
|
readonly slug: Schema.optional<Schema.NonEmptyString>;
|
|
365
365
|
readonly logo: Schema.optional<Schema.String>;
|
|
366
366
|
readonly parentId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
367
|
-
}>>,
|
|
367
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
368
368
|
readonly id: Schema.String;
|
|
369
369
|
readonly name: Schema.String;
|
|
370
370
|
readonly slug: Schema.String;
|
|
@@ -384,4 +384,4 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
|
|
|
384
384
|
readonly logo: Schema.NullOr<Schema.String>;
|
|
385
385
|
}>>>;
|
|
386
386
|
readonly createdAt: Schema.Date;
|
|
387
|
-
}>>,
|
|
387
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never>, false>;
|
package/dist/admin/api.group.js
CHANGED
|
@@ -4,7 +4,7 @@ import { AdminCreateOrganizationPayload, AdminApiKey, AdminApiKeyIdParams, Admin
|
|
|
4
4
|
export * from "./schema.js";
|
|
5
5
|
export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
6
6
|
.add(HttpApiEndpoint.get("dashboardStats", "/admin/dashboard-stats", {
|
|
7
|
-
query: DashboardStatsQuery,
|
|
7
|
+
query: DashboardStatsQuery.fields,
|
|
8
8
|
success: DashboardStatsResponse,
|
|
9
9
|
error: [
|
|
10
10
|
HttpApiError.Unauthorized,
|
|
@@ -29,7 +29,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
29
29
|
description: "Returns all API key metadata for authenticated administrators.",
|
|
30
30
|
})))
|
|
31
31
|
.add(HttpApiEndpoint.delete("deleteApiKey", "/admin/api-keys/:id", {
|
|
32
|
-
params: AdminApiKeyIdParams,
|
|
32
|
+
params: AdminApiKeyIdParams.fields,
|
|
33
33
|
success: AdminApiKey,
|
|
34
34
|
error: [
|
|
35
35
|
HttpApiError.Unauthorized,
|
|
@@ -43,7 +43,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
43
43
|
description: "Deletes an API key for authenticated administrators.",
|
|
44
44
|
})))
|
|
45
45
|
.add(HttpApiEndpoint.patch("updateApiKey", "/admin/api-keys/:id", {
|
|
46
|
-
params: AdminApiKeyIdParams,
|
|
46
|
+
params: AdminApiKeyIdParams.fields,
|
|
47
47
|
payload: AdminUpdateApiKeyPayload,
|
|
48
48
|
success: AdminApiKey,
|
|
49
49
|
error: [
|
|
@@ -58,7 +58,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
58
58
|
description: "Updates API key metadata, referrer restrictions, and rate-limit settings for authenticated administrators.",
|
|
59
59
|
})))
|
|
60
60
|
.add(HttpApiEndpoint.post("resetApiKeyRateLimit", "/admin/api-keys/:id/reset-rate-limit", {
|
|
61
|
-
params: AdminApiKeyIdParams,
|
|
61
|
+
params: AdminApiKeyIdParams.fields,
|
|
62
62
|
success: AdminApiKey,
|
|
63
63
|
error: [
|
|
64
64
|
HttpApiError.Unauthorized,
|
|
@@ -72,7 +72,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
72
72
|
description: "Resets request count and last-used window state for an API key.",
|
|
73
73
|
})))
|
|
74
74
|
.add(HttpApiEndpoint.post("enableApiKeyRateLimit", "/admin/api-keys/:id/enable-rate-limit", {
|
|
75
|
-
params: AdminApiKeyIdParams,
|
|
75
|
+
params: AdminApiKeyIdParams.fields,
|
|
76
76
|
success: AdminApiKey,
|
|
77
77
|
error: [
|
|
78
78
|
HttpApiError.Unauthorized,
|
|
@@ -86,7 +86,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
86
86
|
description: "Enables rate-limit enforcement for an API key.",
|
|
87
87
|
})))
|
|
88
88
|
.add(HttpApiEndpoint.post("disableApiKeyRateLimit", "/admin/api-keys/:id/disable-rate-limit", {
|
|
89
|
-
params: AdminApiKeyIdParams,
|
|
89
|
+
params: AdminApiKeyIdParams.fields,
|
|
90
90
|
success: AdminApiKey,
|
|
91
91
|
error: [
|
|
92
92
|
HttpApiError.Unauthorized,
|
|
@@ -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: AdminListQuery,
|
|
103
|
+
query: AdminListQuery.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: AdminListQuery,
|
|
116
|
+
query: AdminListQuery.fields,
|
|
117
117
|
success: PaginatedAdminOrganizations,
|
|
118
118
|
error: [
|
|
119
119
|
HttpApiError.Unauthorized,
|
|
@@ -139,7 +139,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
139
139
|
description: "Creates an app-managed organization record.",
|
|
140
140
|
})))
|
|
141
141
|
.add(HttpApiEndpoint.patch("updateOrganization", "/admin/organizations/:id", {
|
|
142
|
-
params: AdminOrganizationIdParams,
|
|
142
|
+
params: AdminOrganizationIdParams.fields,
|
|
143
143
|
payload: AdminUpdateOrganizationPayload,
|
|
144
144
|
success: AdminOrganization,
|
|
145
145
|
error: [
|
|
@@ -154,7 +154,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
154
154
|
description: "Updates an app-managed organization record.",
|
|
155
155
|
})))
|
|
156
156
|
.add(HttpApiEndpoint.delete("deleteOrganization", "/admin/organizations/:id", {
|
|
157
|
-
params: AdminOrganizationIdParams,
|
|
157
|
+
params: AdminOrganizationIdParams.fields,
|
|
158
158
|
success: AdminOrganization,
|
|
159
159
|
error: [
|
|
160
160
|
HttpApiError.Unauthorized,
|
|
@@ -194,7 +194,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
194
194
|
description: "Registers an auth-owned custom hostname.",
|
|
195
195
|
})))
|
|
196
196
|
.add(HttpApiEndpoint.patch("updateDomain", "/admin/domains/:id", {
|
|
197
|
-
params: ServerDomainIdParams,
|
|
197
|
+
params: ServerDomainIdParams.fields,
|
|
198
198
|
payload: ServerUpdateDomainPayload,
|
|
199
199
|
success: ServerDomain,
|
|
200
200
|
error: [
|
|
@@ -209,7 +209,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
209
209
|
description: "Updates trust target, ownership links, and Cloudflare management mode for an auth hostname.",
|
|
210
210
|
})))
|
|
211
211
|
.add(HttpApiEndpoint.get("getDomainRecords", "/admin/domains/:id/records", {
|
|
212
|
-
params: ServerDomainIdParams,
|
|
212
|
+
params: ServerDomainIdParams.fields,
|
|
213
213
|
success: ServerDomainRecordsResponse,
|
|
214
214
|
error: [
|
|
215
215
|
HttpApiError.Unauthorized,
|
|
@@ -223,7 +223,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
|
223
223
|
description: "Returns DNS records and refreshed status for an auth-owned custom hostname.",
|
|
224
224
|
})))
|
|
225
225
|
.add(HttpApiEndpoint.delete("deleteDomain", "/admin/domains/:id", {
|
|
226
|
-
params: ServerDomainIdParams,
|
|
226
|
+
params: ServerDomainIdParams.fields,
|
|
227
227
|
success: ServerDomain,
|
|
228
228
|
error: [
|
|
229
229
|
HttpApiError.Unauthorized,
|