@krak-stack/auth 0.1.46 → 0.1.47

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.
@@ -58,7 +58,26 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
58
58
  readonly users: Schema.Number;
59
59
  readonly organizations: Schema.Number;
60
60
  }>>;
61
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteDomain", "DELETE", "/admin/domains/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
61
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteApiKey", "DELETE", "/admin/api-keys/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
62
+ readonly id: Schema.String;
63
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
64
+ readonly id: Schema.String;
65
+ readonly configId: Schema.String;
66
+ readonly name: Schema.NullOr<Schema.String>;
67
+ readonly start: Schema.NullOr<Schema.String>;
68
+ readonly referenceId: Schema.String;
69
+ readonly prefix: Schema.NullOr<Schema.String>;
70
+ readonly enabled: Schema.Boolean;
71
+ readonly rateLimitEnabled: Schema.Boolean;
72
+ readonly rateLimitTimeWindow: Schema.NullOr<Schema.Number>;
73
+ readonly rateLimitMax: Schema.NullOr<Schema.Number>;
74
+ readonly requestCount: Schema.Number;
75
+ readonly remaining: Schema.NullOr<Schema.Number>;
76
+ readonly lastRequest: Schema.NullOr<Schema.Date>;
77
+ readonly expiresAt: Schema.NullOr<Schema.Date>;
78
+ readonly createdAt: Schema.Date;
79
+ readonly updatedAt: Schema.Date;
80
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteDomain", "DELETE", "/admin/domains/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
62
81
  readonly id: Schema.NonEmptyString;
63
82
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
64
83
  readonly id: Schema.String;
@@ -85,6 +104,44 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
85
104
  readonly metadata: Schema.optional<Schema.NullOr<Schema.String>>;
86
105
  readonly memberCount: Schema.optional<Schema.Number>;
87
106
  readonly createdAt: Schema.Date;
107
+ }>>, HttpApiEndpoint.Json<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", HttpApiEndpoint.StringTree<Schema.Struct<{
108
+ readonly id: Schema.String;
109
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
110
+ readonly id: Schema.String;
111
+ readonly configId: Schema.String;
112
+ readonly name: Schema.NullOr<Schema.String>;
113
+ readonly start: Schema.NullOr<Schema.String>;
114
+ readonly referenceId: Schema.String;
115
+ readonly prefix: Schema.NullOr<Schema.String>;
116
+ readonly enabled: Schema.Boolean;
117
+ readonly rateLimitEnabled: Schema.Boolean;
118
+ readonly rateLimitTimeWindow: Schema.NullOr<Schema.Number>;
119
+ readonly rateLimitMax: Schema.NullOr<Schema.Number>;
120
+ readonly requestCount: Schema.Number;
121
+ readonly remaining: Schema.NullOr<Schema.Number>;
122
+ readonly lastRequest: Schema.NullOr<Schema.Date>;
123
+ readonly expiresAt: Schema.NullOr<Schema.Date>;
124
+ readonly createdAt: Schema.Date;
125
+ readonly updatedAt: Schema.Date;
126
+ }>>, HttpApiEndpoint.Json<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", HttpApiEndpoint.StringTree<Schema.Struct<{
127
+ readonly id: Schema.String;
128
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
129
+ readonly id: Schema.String;
130
+ readonly configId: Schema.String;
131
+ readonly name: Schema.NullOr<Schema.String>;
132
+ readonly start: Schema.NullOr<Schema.String>;
133
+ readonly referenceId: Schema.String;
134
+ readonly prefix: Schema.NullOr<Schema.String>;
135
+ readonly enabled: Schema.Boolean;
136
+ readonly rateLimitEnabled: Schema.Boolean;
137
+ readonly rateLimitTimeWindow: Schema.NullOr<Schema.Number>;
138
+ readonly rateLimitMax: Schema.NullOr<Schema.Number>;
139
+ readonly requestCount: Schema.Number;
140
+ readonly remaining: Schema.NullOr<Schema.Number>;
141
+ readonly lastRequest: Schema.NullOr<Schema.Date>;
142
+ readonly expiresAt: Schema.NullOr<Schema.Date>;
143
+ readonly createdAt: Schema.Date;
144
+ readonly updatedAt: Schema.Date;
88
145
  }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainRecords", "GET", "/admin/domains/:id/records", HttpApiEndpoint.StringTree<Schema.Struct<{
89
146
  readonly id: Schema.NonEmptyString;
90
147
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
@@ -93,7 +150,24 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
93
150
  readonly type: Schema.String;
94
151
  readonly name: Schema.String;
95
152
  readonly value: Schema.String;
96
- }>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listDomains", "GET", "/admin/domains", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
153
+ }>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listApiKeys", "GET", "/admin/api-keys", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
154
+ readonly id: Schema.String;
155
+ readonly configId: Schema.String;
156
+ readonly name: Schema.NullOr<Schema.String>;
157
+ readonly start: Schema.NullOr<Schema.String>;
158
+ readonly referenceId: Schema.String;
159
+ readonly prefix: Schema.NullOr<Schema.String>;
160
+ readonly enabled: Schema.Boolean;
161
+ readonly rateLimitEnabled: Schema.Boolean;
162
+ readonly rateLimitTimeWindow: Schema.NullOr<Schema.Number>;
163
+ readonly rateLimitMax: Schema.NullOr<Schema.Number>;
164
+ readonly requestCount: Schema.Number;
165
+ readonly remaining: Schema.NullOr<Schema.Number>;
166
+ readonly lastRequest: Schema.NullOr<Schema.Date>;
167
+ readonly expiresAt: Schema.NullOr<Schema.Date>;
168
+ readonly createdAt: Schema.Date;
169
+ readonly updatedAt: Schema.Date;
170
+ }>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listDomains", "GET", "/admin/domains", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
97
171
  readonly id: Schema.String;
98
172
  readonly hostname: Schema.String;
99
173
  readonly rootHostname: Schema.String;
@@ -162,7 +236,51 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
162
236
  readonly total: Schema.Int;
163
237
  readonly pageCount: Schema.Int;
164
238
  }>;
165
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateDomain", "PATCH", "/admin/domains/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
239
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"resetApiKeyRateLimit", "POST", "/admin/api-keys/:id/reset-rate-limit", HttpApiEndpoint.StringTree<Schema.Struct<{
240
+ readonly id: Schema.String;
241
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
242
+ readonly id: Schema.String;
243
+ readonly configId: Schema.String;
244
+ readonly name: Schema.NullOr<Schema.String>;
245
+ readonly start: Schema.NullOr<Schema.String>;
246
+ readonly referenceId: Schema.String;
247
+ readonly prefix: Schema.NullOr<Schema.String>;
248
+ readonly enabled: Schema.Boolean;
249
+ readonly rateLimitEnabled: Schema.Boolean;
250
+ readonly rateLimitTimeWindow: Schema.NullOr<Schema.Number>;
251
+ readonly rateLimitMax: Schema.NullOr<Schema.Number>;
252
+ readonly requestCount: Schema.Number;
253
+ readonly remaining: Schema.NullOr<Schema.Number>;
254
+ readonly lastRequest: Schema.NullOr<Schema.Date>;
255
+ readonly expiresAt: Schema.NullOr<Schema.Date>;
256
+ readonly createdAt: Schema.Date;
257
+ readonly updatedAt: Schema.Date;
258
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateApiKey", "PATCH", "/admin/api-keys/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
259
+ readonly id: Schema.String;
260
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
261
+ readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
262
+ readonly enabled: Schema.optional<Schema.Boolean>;
263
+ readonly rateLimitEnabled: Schema.optional<Schema.Boolean>;
264
+ readonly rateLimitMax: Schema.optional<Schema.NullOr<Schema.Number>>;
265
+ readonly rateLimitTimeWindow: Schema.optional<Schema.NullOr<Schema.Number>>;
266
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
267
+ readonly id: Schema.String;
268
+ readonly configId: Schema.String;
269
+ readonly name: Schema.NullOr<Schema.String>;
270
+ readonly start: Schema.NullOr<Schema.String>;
271
+ readonly referenceId: Schema.String;
272
+ readonly prefix: Schema.NullOr<Schema.String>;
273
+ readonly enabled: Schema.Boolean;
274
+ readonly rateLimitEnabled: Schema.Boolean;
275
+ readonly rateLimitTimeWindow: Schema.NullOr<Schema.Number>;
276
+ readonly rateLimitMax: Schema.NullOr<Schema.Number>;
277
+ readonly requestCount: Schema.Number;
278
+ readonly remaining: Schema.NullOr<Schema.Number>;
279
+ readonly lastRequest: Schema.NullOr<Schema.Date>;
280
+ readonly expiresAt: Schema.NullOr<Schema.Date>;
281
+ readonly createdAt: Schema.Date;
282
+ readonly updatedAt: Schema.Date;
283
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateDomain", "PATCH", "/admin/domains/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
166
284
  readonly id: Schema.NonEmptyString;
167
285
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
168
286
  readonly hostname: Schema.NonEmptyString;
@@ -1,6 +1,6 @@
1
1
  import { HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi, } from "effect/unstable/httpapi";
2
2
  import { Schema } from "effect";
3
- import { AdminCreateOrganizationPayload, AdminListQuery, AdminOrganization, AdminOrganizationIdParams, AdminUpdateOrganizationPayload, DashboardStatsQuery, DashboardStatsResponse, PaginatedAdminOrganizations, PaginatedAdminUsers, ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, } from "./schema";
3
+ import { AdminCreateOrganizationPayload, AdminApiKey, AdminApiKeyIdParams, AdminListQuery, AdminOrganization, AdminOrganizationIdParams, AdminUpdateApiKeyPayload, AdminUpdateOrganizationPayload, DashboardStatsQuery, DashboardStatsResponse, PaginatedAdminOrganizations, PaginatedAdminUsers, ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, } from "./schema";
4
4
  export * from "./schema";
5
5
  export const AdminApiGroup = HttpApiGroup.make("admin")
6
6
  .add(HttpApiEndpoint.get("dashboardStats", "/admin/dashboard-stats", {
@@ -15,6 +15,89 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
15
15
  title: "Dashboard stats",
16
16
  summary: "Get dashboard statistics",
17
17
  description: "Returns user, organization, and daily active user counts for authenticated administrators.",
18
+ })))
19
+ .add(HttpApiEndpoint.get("listApiKeys", "/admin/api-keys", {
20
+ success: Schema.Array(AdminApiKey),
21
+ error: [
22
+ HttpApiError.Unauthorized,
23
+ HttpApiError.Forbidden,
24
+ HttpApiError.InternalServerError,
25
+ ],
26
+ }).annotateMerge(OpenApi.annotations({
27
+ title: "List API keys",
28
+ summary: "List API keys for administrators",
29
+ description: "Returns all API key metadata for authenticated administrators.",
30
+ })))
31
+ .add(HttpApiEndpoint.delete("deleteApiKey", "/admin/api-keys/:id", {
32
+ params: AdminApiKeyIdParams,
33
+ success: AdminApiKey,
34
+ error: [
35
+ HttpApiError.Unauthorized,
36
+ HttpApiError.Forbidden,
37
+ HttpApiError.NotFound,
38
+ HttpApiError.InternalServerError,
39
+ ],
40
+ }).annotateMerge(OpenApi.annotations({
41
+ title: "Delete API key",
42
+ summary: "Delete an API key",
43
+ description: "Deletes an API key for authenticated administrators.",
44
+ })))
45
+ .add(HttpApiEndpoint.patch("updateApiKey", "/admin/api-keys/:id", {
46
+ params: AdminApiKeyIdParams,
47
+ payload: AdminUpdateApiKeyPayload,
48
+ success: AdminApiKey,
49
+ error: [
50
+ HttpApiError.Unauthorized,
51
+ HttpApiError.Forbidden,
52
+ HttpApiError.NotFound,
53
+ HttpApiError.InternalServerError,
54
+ ],
55
+ }).annotateMerge(OpenApi.annotations({
56
+ title: "Update API key",
57
+ summary: "Update an API key",
58
+ description: "Updates API key metadata and rate-limit settings for authenticated administrators.",
59
+ })))
60
+ .add(HttpApiEndpoint.post("resetApiKeyRateLimit", "/admin/api-keys/:id/reset-rate-limit", {
61
+ params: AdminApiKeyIdParams,
62
+ success: AdminApiKey,
63
+ error: [
64
+ HttpApiError.Unauthorized,
65
+ HttpApiError.Forbidden,
66
+ HttpApiError.NotFound,
67
+ HttpApiError.InternalServerError,
68
+ ],
69
+ }).annotateMerge(OpenApi.annotations({
70
+ title: "Reset API key rate limit",
71
+ summary: "Reset an API key rate-limit window",
72
+ description: "Resets request count and last-used window state for an API key.",
73
+ })))
74
+ .add(HttpApiEndpoint.post("enableApiKeyRateLimit", "/admin/api-keys/:id/enable-rate-limit", {
75
+ params: AdminApiKeyIdParams,
76
+ success: AdminApiKey,
77
+ error: [
78
+ HttpApiError.Unauthorized,
79
+ HttpApiError.Forbidden,
80
+ HttpApiError.NotFound,
81
+ HttpApiError.InternalServerError,
82
+ ],
83
+ }).annotateMerge(OpenApi.annotations({
84
+ title: "Enable API key rate limit",
85
+ summary: "Enable API key rate limiting",
86
+ description: "Enables rate-limit enforcement for an API key.",
87
+ })))
88
+ .add(HttpApiEndpoint.post("disableApiKeyRateLimit", "/admin/api-keys/:id/disable-rate-limit", {
89
+ params: AdminApiKeyIdParams,
90
+ success: AdminApiKey,
91
+ error: [
92
+ HttpApiError.Unauthorized,
93
+ HttpApiError.Forbidden,
94
+ HttpApiError.NotFound,
95
+ HttpApiError.InternalServerError,
96
+ ],
97
+ }).annotateMerge(OpenApi.annotations({
98
+ title: "Disable API key rate limit",
99
+ summary: "Disable API key rate limiting",
100
+ description: "Disables rate-limit enforcement for an API key.",
18
101
  })))
19
102
  .add(HttpApiEndpoint.get("listUsers", "/admin/users", {
20
103
  query: AdminListQuery,
@@ -35,6 +35,34 @@ export declare const AdminOrganization: Schema.Struct<{
35
35
  export declare const AdminOrganizationIdParams: Schema.Struct<{
36
36
  readonly id: Schema.String;
37
37
  }>;
38
+ export declare const AdminApiKeyIdParams: Schema.Struct<{
39
+ readonly id: Schema.String;
40
+ }>;
41
+ export declare const AdminApiKey: Schema.Struct<{
42
+ readonly id: Schema.String;
43
+ readonly configId: Schema.String;
44
+ readonly name: Schema.NullOr<Schema.String>;
45
+ readonly start: Schema.NullOr<Schema.String>;
46
+ readonly referenceId: Schema.String;
47
+ readonly prefix: Schema.NullOr<Schema.String>;
48
+ readonly enabled: Schema.Boolean;
49
+ readonly rateLimitEnabled: Schema.Boolean;
50
+ readonly rateLimitTimeWindow: Schema.NullOr<Schema.Number>;
51
+ readonly rateLimitMax: Schema.NullOr<Schema.Number>;
52
+ readonly requestCount: Schema.Number;
53
+ readonly remaining: Schema.NullOr<Schema.Number>;
54
+ readonly lastRequest: Schema.NullOr<Schema.Date>;
55
+ readonly expiresAt: Schema.NullOr<Schema.Date>;
56
+ readonly createdAt: Schema.Date;
57
+ readonly updatedAt: Schema.Date;
58
+ }>;
59
+ export declare const AdminUpdateApiKeyPayload: Schema.Struct<{
60
+ readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
61
+ readonly enabled: Schema.optional<Schema.Boolean>;
62
+ readonly rateLimitEnabled: Schema.optional<Schema.Boolean>;
63
+ readonly rateLimitMax: Schema.optional<Schema.NullOr<Schema.Number>>;
64
+ readonly rateLimitTimeWindow: Schema.optional<Schema.NullOr<Schema.Number>>;
65
+ }>;
38
66
  export declare const AdminCreateOrganizationPayload: Schema.Struct<{
39
67
  readonly name: Schema.NonEmptyString;
40
68
  readonly slug: Schema.NonEmptyString;
@@ -126,6 +154,8 @@ export declare const PaginatedAdminOrganizations: Schema.Struct<{
126
154
  export type AdminListQuery = typeof AdminListQuery.Type;
127
155
  export type AdminUser = typeof AdminUser.Type;
128
156
  export type AdminOrganization = typeof AdminOrganization.Type;
157
+ export type AdminApiKey = typeof AdminApiKey.Type;
158
+ export type AdminUpdateApiKeyPayload = typeof AdminUpdateApiKeyPayload.Type;
129
159
  export type AdminCreateOrganizationPayload = typeof AdminCreateOrganizationPayload.Type;
130
160
  export type AdminUpdateOrganizationPayload = typeof AdminUpdateOrganizationPayload.Type;
131
161
  export { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, };
@@ -74,6 +74,76 @@ export const AdminOrganizationIdParams = Schema.Struct({
74
74
  description: "Path parameters used to identify an organization.",
75
75
  examples: [{ id: "organization-id" }],
76
76
  });
77
+ export const AdminApiKeyIdParams = Schema.Struct({
78
+ id: Schema.String,
79
+ }).annotate({
80
+ identifier: "AdminApiKeyIdParams",
81
+ title: "Admin API key ID params",
82
+ description: "Path parameters used to identify an API key.",
83
+ examples: [{ id: "api-key-id" }],
84
+ });
85
+ export const AdminApiKey = Schema.Struct({
86
+ id: Schema.String,
87
+ configId: Schema.String,
88
+ name: Schema.NullOr(Schema.String),
89
+ start: Schema.NullOr(Schema.String),
90
+ referenceId: Schema.String,
91
+ prefix: Schema.NullOr(Schema.String),
92
+ enabled: Schema.Boolean,
93
+ rateLimitEnabled: Schema.Boolean,
94
+ rateLimitTimeWindow: Schema.NullOr(Schema.Number),
95
+ rateLimitMax: Schema.NullOr(Schema.Number),
96
+ requestCount: Schema.Number,
97
+ remaining: Schema.NullOr(Schema.Number),
98
+ lastRequest: Schema.NullOr(Schema.Date),
99
+ expiresAt: Schema.NullOr(Schema.Date),
100
+ createdAt: Schema.Date,
101
+ updatedAt: Schema.Date,
102
+ }).annotate({
103
+ identifier: "AdminApiKey",
104
+ title: "Admin API key",
105
+ description: "API key metadata returned to administrators.",
106
+ examples: [
107
+ {
108
+ id: "api-key-id",
109
+ configId: "service",
110
+ name: "Production service",
111
+ start: "svc_1234",
112
+ referenceId: "user-id",
113
+ prefix: "svc_",
114
+ enabled: true,
115
+ rateLimitEnabled: true,
116
+ rateLimitTimeWindow: 86400000,
117
+ rateLimitMax: 10000,
118
+ requestCount: 0,
119
+ remaining: null,
120
+ lastRequest: null,
121
+ expiresAt: null,
122
+ createdAt: new Date("2026-01-01T00:00:00.000Z"),
123
+ updatedAt: new Date("2026-01-01T00:00:00.000Z"),
124
+ },
125
+ ],
126
+ });
127
+ export const AdminUpdateApiKeyPayload = Schema.Struct({
128
+ name: Schema.optional(Schema.NullOr(Schema.String)),
129
+ enabled: Schema.optional(Schema.Boolean),
130
+ rateLimitEnabled: Schema.optional(Schema.Boolean),
131
+ rateLimitMax: Schema.optional(Schema.NullOr(Schema.Number)),
132
+ rateLimitTimeWindow: Schema.optional(Schema.NullOr(Schema.Number)),
133
+ }).annotate({
134
+ identifier: "AdminUpdateApiKeyPayload",
135
+ title: "Update API key payload",
136
+ description: "Payload used by administrators to update API key metadata and rate limits.",
137
+ examples: [
138
+ {
139
+ name: "Production service",
140
+ enabled: true,
141
+ rateLimitEnabled: true,
142
+ rateLimitMax: 10000,
143
+ rateLimitTimeWindow: 86400000,
144
+ },
145
+ ],
146
+ });
77
147
  export const AdminCreateOrganizationPayload = Schema.Struct({
78
148
  name: Schema.NonEmptyString,
79
149
  slug: Schema.NonEmptyString,
package/dist/api.d.ts CHANGED
@@ -371,7 +371,26 @@ export declare const AuthClientApi: HttpApi.HttpApi<"AuthClientApi", import("eff
371
371
  readonly users: import("effect/Schema").Number;
372
372
  readonly organizations: import("effect/Schema").Number;
373
373
  }>>;
374
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"deleteDomain", "DELETE", "/api/auth/admin/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
374
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"deleteApiKey", "DELETE", "/api/auth/admin/api-keys/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
375
+ readonly id: import("effect/Schema").String;
376
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
377
+ readonly id: import("effect/Schema").String;
378
+ readonly configId: import("effect/Schema").String;
379
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
380
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
381
+ readonly referenceId: import("effect/Schema").String;
382
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
383
+ readonly enabled: import("effect/Schema").Boolean;
384
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
385
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
386
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
387
+ readonly requestCount: import("effect/Schema").Number;
388
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
389
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
390
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
391
+ readonly createdAt: import("effect/Schema").Date;
392
+ readonly updatedAt: import("effect/Schema").Date;
393
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"deleteDomain", "DELETE", "/api/auth/admin/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
375
394
  readonly id: import("effect/Schema").NonEmptyString;
376
395
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
377
396
  readonly id: import("effect/Schema").String;
@@ -398,6 +417,44 @@ export declare const AuthClientApi: HttpApi.HttpApi<"AuthClientApi", import("eff
398
417
  readonly metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
399
418
  readonly memberCount: import("effect/Schema").optional<import("effect/Schema").Number>;
400
419
  readonly createdAt: import("effect/Schema").Date;
420
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"disableApiKeyRateLimit", "POST", "/api/auth/admin/api-keys/:id/disable-rate-limit", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
421
+ readonly id: import("effect/Schema").String;
422
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
423
+ readonly id: import("effect/Schema").String;
424
+ readonly configId: import("effect/Schema").String;
425
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
426
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
427
+ readonly referenceId: import("effect/Schema").String;
428
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
429
+ readonly enabled: import("effect/Schema").Boolean;
430
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
431
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
432
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
433
+ readonly requestCount: import("effect/Schema").Number;
434
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
435
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
436
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
437
+ readonly createdAt: import("effect/Schema").Date;
438
+ readonly updatedAt: import("effect/Schema").Date;
439
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"enableApiKeyRateLimit", "POST", "/api/auth/admin/api-keys/:id/enable-rate-limit", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
440
+ readonly id: import("effect/Schema").String;
441
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
442
+ readonly id: import("effect/Schema").String;
443
+ readonly configId: import("effect/Schema").String;
444
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
445
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
446
+ readonly referenceId: import("effect/Schema").String;
447
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
448
+ readonly enabled: import("effect/Schema").Boolean;
449
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
450
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
451
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
452
+ readonly requestCount: import("effect/Schema").Number;
453
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
454
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
455
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
456
+ readonly createdAt: import("effect/Schema").Date;
457
+ readonly updatedAt: import("effect/Schema").Date;
401
458
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getDomainRecords", "GET", "/api/auth/admin/domains/:id/records", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
402
459
  readonly id: import("effect/Schema").NonEmptyString;
403
460
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
@@ -406,7 +463,24 @@ export declare const AuthClientApi: HttpApi.HttpApi<"AuthClientApi", import("eff
406
463
  readonly type: import("effect/Schema").String;
407
464
  readonly name: import("effect/Schema").String;
408
465
  readonly value: import("effect/Schema").String;
409
- }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listDomains", "GET", "/api/auth/admin/domains", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
466
+ }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listApiKeys", "GET", "/api/auth/admin/api-keys", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
467
+ readonly id: import("effect/Schema").String;
468
+ readonly configId: import("effect/Schema").String;
469
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
470
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
471
+ readonly referenceId: import("effect/Schema").String;
472
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
473
+ readonly enabled: import("effect/Schema").Boolean;
474
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
475
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
476
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
477
+ readonly requestCount: import("effect/Schema").Number;
478
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
479
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
480
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
481
+ readonly createdAt: import("effect/Schema").Date;
482
+ readonly updatedAt: import("effect/Schema").Date;
483
+ }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listDomains", "GET", "/api/auth/admin/domains", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
410
484
  readonly id: import("effect/Schema").String;
411
485
  readonly hostname: import("effect/Schema").String;
412
486
  readonly rootHostname: import("effect/Schema").String;
@@ -475,7 +549,51 @@ export declare const AuthClientApi: HttpApi.HttpApi<"AuthClientApi", import("eff
475
549
  readonly total: import("effect/Schema").Int;
476
550
  readonly pageCount: import("effect/Schema").Int;
477
551
  }>;
478
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateDomain", "PATCH", "/api/auth/admin/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
552
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"resetApiKeyRateLimit", "POST", "/api/auth/admin/api-keys/:id/reset-rate-limit", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
553
+ readonly id: import("effect/Schema").String;
554
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
555
+ readonly id: import("effect/Schema").String;
556
+ readonly configId: import("effect/Schema").String;
557
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
558
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
559
+ readonly referenceId: import("effect/Schema").String;
560
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
561
+ readonly enabled: import("effect/Schema").Boolean;
562
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
563
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
564
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
565
+ readonly requestCount: import("effect/Schema").Number;
566
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
567
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
568
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
569
+ readonly createdAt: import("effect/Schema").Date;
570
+ readonly updatedAt: import("effect/Schema").Date;
571
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateApiKey", "PATCH", "/api/auth/admin/api-keys/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
572
+ readonly id: import("effect/Schema").String;
573
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
574
+ readonly name: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
575
+ readonly enabled: import("effect/Schema").optional<import("effect/Schema").Boolean>;
576
+ readonly rateLimitEnabled: import("effect/Schema").optional<import("effect/Schema").Boolean>;
577
+ readonly rateLimitMax: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Number>>;
578
+ readonly rateLimitTimeWindow: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Number>>;
579
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
580
+ readonly id: import("effect/Schema").String;
581
+ readonly configId: import("effect/Schema").String;
582
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
583
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
584
+ readonly referenceId: import("effect/Schema").String;
585
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
586
+ readonly enabled: import("effect/Schema").Boolean;
587
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
588
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
589
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
590
+ readonly requestCount: import("effect/Schema").Number;
591
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
592
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
593
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
594
+ readonly createdAt: import("effect/Schema").Date;
595
+ readonly updatedAt: import("effect/Schema").Date;
596
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateDomain", "PATCH", "/api/auth/admin/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
479
597
  readonly id: import("effect/Schema").NonEmptyString;
480
598
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
481
599
  readonly hostname: import("effect/Schema").NonEmptyString;
@@ -56,7 +56,26 @@ export declare const authClientApi: (baseUrl?: string | undefined) => AtomHttpAp
56
56
  readonly users: import("effect/Schema").Number;
57
57
  readonly organizations: import("effect/Schema").Number;
58
58
  }>>;
59
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"deleteDomain", "DELETE", "/api/auth/admin/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
59
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"deleteApiKey", "DELETE", "/api/auth/admin/api-keys/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
60
+ readonly id: import("effect/Schema").String;
61
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
62
+ readonly id: import("effect/Schema").String;
63
+ readonly configId: import("effect/Schema").String;
64
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
65
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
66
+ readonly referenceId: import("effect/Schema").String;
67
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
68
+ readonly enabled: import("effect/Schema").Boolean;
69
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
70
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
71
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
72
+ readonly requestCount: import("effect/Schema").Number;
73
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
74
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
75
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
76
+ readonly createdAt: import("effect/Schema").Date;
77
+ readonly updatedAt: import("effect/Schema").Date;
78
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"deleteDomain", "DELETE", "/api/auth/admin/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
60
79
  readonly id: import("effect/Schema").NonEmptyString;
61
80
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
62
81
  readonly id: import("effect/Schema").String;
@@ -83,6 +102,44 @@ export declare const authClientApi: (baseUrl?: string | undefined) => AtomHttpAp
83
102
  readonly metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
84
103
  readonly memberCount: import("effect/Schema").optional<import("effect/Schema").Number>;
85
104
  readonly createdAt: import("effect/Schema").Date;
105
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"disableApiKeyRateLimit", "POST", "/api/auth/admin/api-keys/:id/disable-rate-limit", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
106
+ readonly id: import("effect/Schema").String;
107
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
108
+ readonly id: import("effect/Schema").String;
109
+ readonly configId: import("effect/Schema").String;
110
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
111
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
112
+ readonly referenceId: import("effect/Schema").String;
113
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
114
+ readonly enabled: import("effect/Schema").Boolean;
115
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
116
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
117
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
118
+ readonly requestCount: import("effect/Schema").Number;
119
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
120
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
121
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
122
+ readonly createdAt: import("effect/Schema").Date;
123
+ readonly updatedAt: import("effect/Schema").Date;
124
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"enableApiKeyRateLimit", "POST", "/api/auth/admin/api-keys/:id/enable-rate-limit", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
125
+ readonly id: import("effect/Schema").String;
126
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
127
+ readonly id: import("effect/Schema").String;
128
+ readonly configId: import("effect/Schema").String;
129
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
130
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
131
+ readonly referenceId: import("effect/Schema").String;
132
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
133
+ readonly enabled: import("effect/Schema").Boolean;
134
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
135
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
136
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
137
+ readonly requestCount: import("effect/Schema").Number;
138
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
139
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
140
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
141
+ readonly createdAt: import("effect/Schema").Date;
142
+ readonly updatedAt: import("effect/Schema").Date;
86
143
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getDomainRecords", "GET", "/api/auth/admin/domains/:id/records", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
87
144
  readonly id: import("effect/Schema").NonEmptyString;
88
145
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
@@ -91,7 +148,24 @@ export declare const authClientApi: (baseUrl?: string | undefined) => AtomHttpAp
91
148
  readonly type: import("effect/Schema").String;
92
149
  readonly name: import("effect/Schema").String;
93
150
  readonly value: import("effect/Schema").String;
94
- }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listDomains", "GET", "/api/auth/admin/domains", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
151
+ }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listApiKeys", "GET", "/api/auth/admin/api-keys", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
152
+ readonly id: import("effect/Schema").String;
153
+ readonly configId: import("effect/Schema").String;
154
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
155
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
156
+ readonly referenceId: import("effect/Schema").String;
157
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
158
+ readonly enabled: import("effect/Schema").Boolean;
159
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
160
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
161
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
162
+ readonly requestCount: import("effect/Schema").Number;
163
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
164
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
165
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
166
+ readonly createdAt: import("effect/Schema").Date;
167
+ readonly updatedAt: import("effect/Schema").Date;
168
+ }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listDomains", "GET", "/api/auth/admin/domains", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
95
169
  readonly id: import("effect/Schema").String;
96
170
  readonly hostname: import("effect/Schema").String;
97
171
  readonly rootHostname: import("effect/Schema").String;
@@ -160,7 +234,51 @@ export declare const authClientApi: (baseUrl?: string | undefined) => AtomHttpAp
160
234
  readonly total: import("effect/Schema").Int;
161
235
  readonly pageCount: import("effect/Schema").Int;
162
236
  }>;
163
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateDomain", "PATCH", "/api/auth/admin/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
237
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"resetApiKeyRateLimit", "POST", "/api/auth/admin/api-keys/:id/reset-rate-limit", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
238
+ readonly id: import("effect/Schema").String;
239
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
240
+ readonly id: import("effect/Schema").String;
241
+ readonly configId: import("effect/Schema").String;
242
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
243
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
244
+ readonly referenceId: import("effect/Schema").String;
245
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
246
+ readonly enabled: import("effect/Schema").Boolean;
247
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
248
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
249
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
250
+ readonly requestCount: import("effect/Schema").Number;
251
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
252
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
253
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
254
+ readonly createdAt: import("effect/Schema").Date;
255
+ readonly updatedAt: import("effect/Schema").Date;
256
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateApiKey", "PATCH", "/api/auth/admin/api-keys/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
257
+ readonly id: import("effect/Schema").String;
258
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
259
+ readonly name: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
260
+ readonly enabled: import("effect/Schema").optional<import("effect/Schema").Boolean>;
261
+ readonly rateLimitEnabled: import("effect/Schema").optional<import("effect/Schema").Boolean>;
262
+ readonly rateLimitMax: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Number>>;
263
+ readonly rateLimitTimeWindow: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Number>>;
264
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
265
+ readonly id: import("effect/Schema").String;
266
+ readonly configId: import("effect/Schema").String;
267
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
268
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
269
+ readonly referenceId: import("effect/Schema").String;
270
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
271
+ readonly enabled: import("effect/Schema").Boolean;
272
+ readonly rateLimitEnabled: import("effect/Schema").Boolean;
273
+ readonly rateLimitTimeWindow: import("effect/Schema").NullOr<import("effect/Schema").Number>;
274
+ readonly rateLimitMax: import("effect/Schema").NullOr<import("effect/Schema").Number>;
275
+ readonly requestCount: import("effect/Schema").Number;
276
+ readonly remaining: import("effect/Schema").NullOr<import("effect/Schema").Number>;
277
+ readonly lastRequest: import("effect/Schema").NullOr<import("effect/Schema").Date>;
278
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
279
+ readonly createdAt: import("effect/Schema").Date;
280
+ readonly updatedAt: import("effect/Schema").Date;
281
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateDomain", "PATCH", "/api/auth/admin/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
164
282
  readonly id: import("effect/Schema").NonEmptyString;
165
283
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
166
284
  readonly hostname: import("effect/Schema").NonEmptyString;
@@ -12,20 +12,8 @@ const blockedRequestHeaders = [
12
12
  "upgrade",
13
13
  "cdn-loop",
14
14
  ];
15
- const parseUrl = (value) => {
16
- if (!value)
17
- return null;
18
- try {
19
- return new URL(value);
20
- }
21
- catch {
22
- return null;
23
- }
24
- };
25
15
  const forwardedUrl = (request) => {
26
- return (parseUrl(request.headers.get("origin")) ??
27
- parseUrl(request.headers.get("referer")) ??
28
- new URL(request.url));
16
+ return new URL(request.url);
29
17
  };
30
18
  const proxyHeaders = (request) => {
31
19
  const headers = new Headers(request.headers);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krak-stack/auth",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "description": "Effect HttpApi clients and schemas for KrakStack Auth.",
5
5
  "license": "MIT",
6
6
  "files": [