@krak-stack/auth 0.1.40 → 0.1.42
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/admin/api.group.d.ts +197 -0
- package/dist/admin/api.group.js +159 -0
- package/dist/admin/schema.d.ts +128 -0
- package/dist/admin/schema.js +190 -0
- package/dist/api.d.ts +264 -11
- package/dist/api.js +14 -5
- package/dist/better-auth/{index.d.ts → api.group.d.ts} +6 -8
- package/dist/better-auth/{api.js → api.group.js} +2 -4
- package/dist/components/admin-organization-form.d.ts +3 -3
- package/dist/components/admin-organization-form.js +9 -19
- package/dist/components/admin-organizations.js +16 -12
- package/dist/components/admin-users.d.ts +1 -1
- package/dist/components/admin-users.js +35 -18
- package/dist/components/{auth-api-client.d.ts → auth-client-api.d.ts} +179 -209
- package/dist/components/auth-client-api.js +29 -0
- package/dist/components/auth-forms.js +3 -3
- package/dist/components/auth-provider.js +2 -2
- package/dist/components/organization-switcher.js +15 -16
- package/dist/components/user-button.js +3 -3
- package/dist/components/utils.d.ts +11 -0
- package/dist/components/utils.js +24 -0
- package/dist/extra/api.group.d.ts +68 -0
- package/dist/extra/{api.js → api.group.js} +5 -17
- package/dist/index.d.ts +5 -3
- package/dist/index.js +5 -3
- package/dist/query.d.ts +49 -0
- package/dist/query.js +114 -0
- package/dist/server/{api.d.ts → api.group.d.ts} +0 -196
- package/dist/server/{api.js → api.group.js} +1 -6
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +2 -1
- package/dist/service.d.ts +12 -24
- package/dist/service.js +2 -2
- package/package.json +13 -5
- package/dist/better-auth/api.d.ts +0 -55
- package/dist/better-auth/index.js +0 -12
- package/dist/components/auth-api-client.js +0 -29
- package/dist/extra/api.d.ts +0 -139
- package/dist/extra/index.d.ts +0 -76
- package/dist/extra/index.js +0 -14
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/unstable/httpapi";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export * from "./schema";
|
|
4
|
+
export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEndpoint.HttpApiEndpoint<"createDomain", "POST", "/admin/domains", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
5
|
+
readonly hostname: Schema.NonEmptyString;
|
|
6
|
+
readonly rootHostname: Schema.NonEmptyString;
|
|
7
|
+
readonly projectId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
8
|
+
readonly organizationId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
9
|
+
readonly managed: Schema.Boolean;
|
|
10
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
11
|
+
readonly id: Schema.String;
|
|
12
|
+
readonly hostname: Schema.String;
|
|
13
|
+
readonly rootHostname: Schema.String;
|
|
14
|
+
readonly projectId: Schema.NullOr<Schema.String>;
|
|
15
|
+
readonly projectName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
16
|
+
readonly projectLogo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
17
|
+
readonly organizationId: Schema.NullOr<Schema.String>;
|
|
18
|
+
readonly organizationName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
19
|
+
readonly organizationLogo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
20
|
+
readonly hostnameId: Schema.String;
|
|
21
|
+
readonly managed: Schema.Boolean;
|
|
22
|
+
readonly active: Schema.Boolean;
|
|
23
|
+
readonly createdAt: Schema.Date;
|
|
24
|
+
readonly updatedAt: Schema.Date;
|
|
25
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createOrganization", "POST", "/admin/organizations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
26
|
+
readonly name: Schema.NonEmptyString;
|
|
27
|
+
readonly slug: Schema.NonEmptyString;
|
|
28
|
+
readonly logo: Schema.optional<Schema.String>;
|
|
29
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
30
|
+
readonly id: Schema.String;
|
|
31
|
+
readonly name: Schema.String;
|
|
32
|
+
readonly slug: Schema.String;
|
|
33
|
+
readonly logo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
34
|
+
readonly metadata: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
35
|
+
readonly createdAt: Schema.Date;
|
|
36
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"dashboardStats", "GET", "/admin/dashboard-stats", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
37
|
+
readonly days: Schema.optional<Schema.Union<readonly [Schema.Literal<"7">, Schema.Literal<"14">, Schema.Literal<"30">, Schema.Literal<"90">]>>;
|
|
38
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
39
|
+
readonly totalUsers: Schema.Number;
|
|
40
|
+
readonly totalOrganizations: Schema.Number;
|
|
41
|
+
readonly totalProjects: Schema.Number;
|
|
42
|
+
readonly totalDomains: Schema.Number;
|
|
43
|
+
readonly totalApiKeys: Schema.Number;
|
|
44
|
+
readonly totalOauthClients: Schema.Number;
|
|
45
|
+
readonly dailyActiveUsers: Schema.Number;
|
|
46
|
+
readonly dailyActiveUsersByDay: Schema.$Array<Schema.Struct<{
|
|
47
|
+
readonly date: Schema.String;
|
|
48
|
+
readonly count: Schema.Number;
|
|
49
|
+
}>>;
|
|
50
|
+
readonly signupsByDay: Schema.$Array<Schema.Struct<{
|
|
51
|
+
readonly date: Schema.String;
|
|
52
|
+
readonly count: Schema.Number;
|
|
53
|
+
}>>;
|
|
54
|
+
readonly projectConnections: Schema.$Array<Schema.Struct<{
|
|
55
|
+
readonly projectId: Schema.String;
|
|
56
|
+
readonly projectName: Schema.String;
|
|
57
|
+
readonly users: Schema.Number;
|
|
58
|
+
readonly organizations: Schema.Number;
|
|
59
|
+
}>>;
|
|
60
|
+
}>>, 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
|
+
readonly id: Schema.NonEmptyString;
|
|
62
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
63
|
+
readonly id: Schema.String;
|
|
64
|
+
readonly hostname: Schema.String;
|
|
65
|
+
readonly rootHostname: Schema.String;
|
|
66
|
+
readonly projectId: Schema.NullOr<Schema.String>;
|
|
67
|
+
readonly projectName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
68
|
+
readonly projectLogo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
69
|
+
readonly organizationId: Schema.NullOr<Schema.String>;
|
|
70
|
+
readonly organizationName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
71
|
+
readonly organizationLogo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
72
|
+
readonly hostnameId: Schema.String;
|
|
73
|
+
readonly managed: Schema.Boolean;
|
|
74
|
+
readonly active: Schema.Boolean;
|
|
75
|
+
readonly createdAt: Schema.Date;
|
|
76
|
+
readonly updatedAt: Schema.Date;
|
|
77
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteOrganization", "DELETE", "/admin/organizations/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
78
|
+
readonly id: Schema.String;
|
|
79
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
80
|
+
readonly id: Schema.String;
|
|
81
|
+
readonly name: Schema.String;
|
|
82
|
+
readonly slug: Schema.String;
|
|
83
|
+
readonly logo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
84
|
+
readonly metadata: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
85
|
+
readonly createdAt: Schema.Date;
|
|
86
|
+
}>>, 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<{
|
|
87
|
+
readonly id: Schema.NonEmptyString;
|
|
88
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
|
|
89
|
+
readonly required: Schema.Boolean;
|
|
90
|
+
readonly status: Schema.String;
|
|
91
|
+
readonly type: Schema.String;
|
|
92
|
+
readonly name: Schema.String;
|
|
93
|
+
readonly value: Schema.String;
|
|
94
|
+
}>>>, 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<{
|
|
95
|
+
readonly id: Schema.String;
|
|
96
|
+
readonly hostname: Schema.String;
|
|
97
|
+
readonly rootHostname: Schema.String;
|
|
98
|
+
readonly projectId: Schema.NullOr<Schema.String>;
|
|
99
|
+
readonly projectName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
100
|
+
readonly projectLogo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
101
|
+
readonly organizationId: Schema.NullOr<Schema.String>;
|
|
102
|
+
readonly organizationName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
103
|
+
readonly organizationLogo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
104
|
+
readonly hostnameId: Schema.String;
|
|
105
|
+
readonly managed: Schema.Boolean;
|
|
106
|
+
readonly active: Schema.Boolean;
|
|
107
|
+
readonly createdAt: Schema.Date;
|
|
108
|
+
readonly updatedAt: Schema.Date;
|
|
109
|
+
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizations", "GET", "/admin/organizations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
110
|
+
readonly page: Schema.Int;
|
|
111
|
+
readonly pageSize: Schema.Int;
|
|
112
|
+
readonly globalFilter: Schema.optional<Schema.String>;
|
|
113
|
+
readonly sort: Schema.optional<Schema.decodeTo<Schema.String, Schema.decodeTo<Schema.$Array<Schema.Struct<{
|
|
114
|
+
readonly id: Schema.NonEmptyString;
|
|
115
|
+
readonly direction: Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>;
|
|
116
|
+
}>>, Schema.String, never, never>, never, never>>;
|
|
117
|
+
readonly projectId: Schema.optional<Schema.String>;
|
|
118
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
119
|
+
readonly data: Schema.$Array<Schema.Schema<{
|
|
120
|
+
readonly id: string;
|
|
121
|
+
readonly name: string;
|
|
122
|
+
readonly slug: string;
|
|
123
|
+
readonly logo?: string | null | undefined;
|
|
124
|
+
readonly metadata?: string | null | undefined;
|
|
125
|
+
readonly createdAt: Date;
|
|
126
|
+
}>>;
|
|
127
|
+
readonly meta: Schema.Struct<{
|
|
128
|
+
readonly page: Schema.Int;
|
|
129
|
+
readonly pageSize: Schema.Int;
|
|
130
|
+
readonly total: Schema.Int;
|
|
131
|
+
readonly pageCount: Schema.Int;
|
|
132
|
+
}>;
|
|
133
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listUsers", "GET", "/admin/users", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
134
|
+
readonly page: Schema.Int;
|
|
135
|
+
readonly pageSize: Schema.Int;
|
|
136
|
+
readonly globalFilter: Schema.optional<Schema.String>;
|
|
137
|
+
readonly sort: Schema.optional<Schema.decodeTo<Schema.String, Schema.decodeTo<Schema.$Array<Schema.Struct<{
|
|
138
|
+
readonly id: Schema.NonEmptyString;
|
|
139
|
+
readonly direction: Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>;
|
|
140
|
+
}>>, Schema.String, never, never>, never, never>>;
|
|
141
|
+
readonly projectId: Schema.optional<Schema.String>;
|
|
142
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
143
|
+
readonly data: Schema.$Array<Schema.Schema<Schema.Struct.ReadonlySide<{
|
|
144
|
+
readonly id: Schema.String;
|
|
145
|
+
readonly name: Schema.String;
|
|
146
|
+
readonly email: Schema.String;
|
|
147
|
+
readonly emailVerified: Schema.Boolean;
|
|
148
|
+
readonly image: Schema.NullOr<Schema.String>;
|
|
149
|
+
readonly createdAt: Schema.Date;
|
|
150
|
+
readonly role: Schema.NullOr<Schema.String>;
|
|
151
|
+
readonly banned: Schema.NullOr<Schema.Boolean>;
|
|
152
|
+
readonly banReason: Schema.NullOr<Schema.String>;
|
|
153
|
+
readonly banExpires: Schema.NullOr<Schema.Date>;
|
|
154
|
+
}, "Type">>>;
|
|
155
|
+
readonly meta: Schema.Struct<{
|
|
156
|
+
readonly page: Schema.Int;
|
|
157
|
+
readonly pageSize: Schema.Int;
|
|
158
|
+
readonly total: Schema.Int;
|
|
159
|
+
readonly pageCount: Schema.Int;
|
|
160
|
+
}>;
|
|
161
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateDomain", "PATCH", "/admin/domains/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
162
|
+
readonly id: Schema.NonEmptyString;
|
|
163
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
164
|
+
readonly hostname: Schema.NonEmptyString;
|
|
165
|
+
readonly rootHostname: Schema.NonEmptyString;
|
|
166
|
+
readonly projectId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
167
|
+
readonly organizationId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
168
|
+
readonly managed: Schema.Boolean;
|
|
169
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
170
|
+
readonly id: Schema.String;
|
|
171
|
+
readonly hostname: Schema.String;
|
|
172
|
+
readonly rootHostname: Schema.String;
|
|
173
|
+
readonly projectId: Schema.NullOr<Schema.String>;
|
|
174
|
+
readonly projectName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
175
|
+
readonly projectLogo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
176
|
+
readonly organizationId: Schema.NullOr<Schema.String>;
|
|
177
|
+
readonly organizationName: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
178
|
+
readonly organizationLogo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
179
|
+
readonly hostnameId: Schema.String;
|
|
180
|
+
readonly managed: Schema.Boolean;
|
|
181
|
+
readonly active: Schema.Boolean;
|
|
182
|
+
readonly createdAt: Schema.Date;
|
|
183
|
+
readonly updatedAt: Schema.Date;
|
|
184
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateOrganization", "PATCH", "/admin/organizations/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
185
|
+
readonly id: Schema.String;
|
|
186
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
187
|
+
readonly name: Schema.optional<Schema.NonEmptyString>;
|
|
188
|
+
readonly slug: Schema.optional<Schema.NonEmptyString>;
|
|
189
|
+
readonly logo: Schema.optional<Schema.String>;
|
|
190
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
191
|
+
readonly id: Schema.String;
|
|
192
|
+
readonly name: Schema.String;
|
|
193
|
+
readonly slug: Schema.String;
|
|
194
|
+
readonly logo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
195
|
+
readonly metadata: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
196
|
+
readonly createdAt: Schema.Date;
|
|
197
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never>, false>;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi, } from "effect/unstable/httpapi";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { AdminCreateOrganizationPayload, AdminListQuery, AdminOrganization, AdminOrganizationIdParams, AdminUpdateOrganizationPayload, DashboardStatsQuery, DashboardStatsResponse, PaginatedAdminOrganizations, PaginatedAdminUsers, ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, } from "./schema";
|
|
4
|
+
export * from "./schema";
|
|
5
|
+
export const AdminApiGroup = HttpApiGroup.make("admin")
|
|
6
|
+
.add(HttpApiEndpoint.get("dashboardStats", "/admin/dashboard-stats", {
|
|
7
|
+
query: DashboardStatsQuery,
|
|
8
|
+
success: DashboardStatsResponse,
|
|
9
|
+
error: [
|
|
10
|
+
HttpApiError.Unauthorized,
|
|
11
|
+
HttpApiError.Forbidden,
|
|
12
|
+
HttpApiError.InternalServerError,
|
|
13
|
+
],
|
|
14
|
+
}).annotateMerge(OpenApi.annotations({
|
|
15
|
+
title: "Dashboard stats",
|
|
16
|
+
summary: "Get dashboard statistics",
|
|
17
|
+
description: "Returns user, organization, and daily active user counts for authenticated administrators.",
|
|
18
|
+
})))
|
|
19
|
+
.add(HttpApiEndpoint.get("listUsers", "/admin/users", {
|
|
20
|
+
query: AdminListQuery,
|
|
21
|
+
success: PaginatedAdminUsers,
|
|
22
|
+
error: [
|
|
23
|
+
HttpApiError.Unauthorized,
|
|
24
|
+
HttpApiError.Forbidden,
|
|
25
|
+
HttpApiError.InternalServerError,
|
|
26
|
+
],
|
|
27
|
+
}).annotateMerge(OpenApi.annotations({
|
|
28
|
+
title: "List users",
|
|
29
|
+
summary: "List users for administrators",
|
|
30
|
+
description: "Returns paginated auth user records with optional filtering and sorting.",
|
|
31
|
+
})))
|
|
32
|
+
.add(HttpApiEndpoint.get("listOrganizations", "/admin/organizations", {
|
|
33
|
+
query: AdminListQuery,
|
|
34
|
+
success: PaginatedAdminOrganizations,
|
|
35
|
+
error: [
|
|
36
|
+
HttpApiError.Unauthorized,
|
|
37
|
+
HttpApiError.Forbidden,
|
|
38
|
+
HttpApiError.InternalServerError,
|
|
39
|
+
],
|
|
40
|
+
}).annotateMerge(OpenApi.annotations({
|
|
41
|
+
title: "List organizations",
|
|
42
|
+
summary: "List organizations for administrators",
|
|
43
|
+
description: "Returns paginated app-managed organization records with optional filtering and sorting.",
|
|
44
|
+
})))
|
|
45
|
+
.add(HttpApiEndpoint.post("createOrganization", "/admin/organizations", {
|
|
46
|
+
payload: AdminCreateOrganizationPayload,
|
|
47
|
+
success: AdminOrganization,
|
|
48
|
+
error: [
|
|
49
|
+
HttpApiError.Unauthorized,
|
|
50
|
+
HttpApiError.Forbidden,
|
|
51
|
+
HttpApiError.InternalServerError,
|
|
52
|
+
],
|
|
53
|
+
}).annotateMerge(OpenApi.annotations({
|
|
54
|
+
title: "Create organization",
|
|
55
|
+
summary: "Create an organization",
|
|
56
|
+
description: "Creates an app-managed organization record.",
|
|
57
|
+
})))
|
|
58
|
+
.add(HttpApiEndpoint.patch("updateOrganization", "/admin/organizations/:id", {
|
|
59
|
+
params: AdminOrganizationIdParams,
|
|
60
|
+
payload: AdminUpdateOrganizationPayload,
|
|
61
|
+
success: AdminOrganization,
|
|
62
|
+
error: [
|
|
63
|
+
HttpApiError.Unauthorized,
|
|
64
|
+
HttpApiError.Forbidden,
|
|
65
|
+
HttpApiError.NotFound,
|
|
66
|
+
HttpApiError.InternalServerError,
|
|
67
|
+
],
|
|
68
|
+
}).annotateMerge(OpenApi.annotations({
|
|
69
|
+
title: "Update organization",
|
|
70
|
+
summary: "Update an organization",
|
|
71
|
+
description: "Updates an app-managed organization record.",
|
|
72
|
+
})))
|
|
73
|
+
.add(HttpApiEndpoint.delete("deleteOrganization", "/admin/organizations/:id", {
|
|
74
|
+
params: AdminOrganizationIdParams,
|
|
75
|
+
success: AdminOrganization,
|
|
76
|
+
error: [
|
|
77
|
+
HttpApiError.Unauthorized,
|
|
78
|
+
HttpApiError.Forbidden,
|
|
79
|
+
HttpApiError.NotFound,
|
|
80
|
+
HttpApiError.InternalServerError,
|
|
81
|
+
],
|
|
82
|
+
}).annotateMerge(OpenApi.annotations({
|
|
83
|
+
title: "Delete organization",
|
|
84
|
+
summary: "Delete an organization",
|
|
85
|
+
description: "Deletes an app-managed organization record.",
|
|
86
|
+
})))
|
|
87
|
+
.add(HttpApiEndpoint.get("listDomains", "/admin/domains", {
|
|
88
|
+
success: Schema.Array(ServerDomain),
|
|
89
|
+
error: [
|
|
90
|
+
HttpApiError.Unauthorized,
|
|
91
|
+
HttpApiError.Forbidden,
|
|
92
|
+
HttpApiError.InternalServerError,
|
|
93
|
+
],
|
|
94
|
+
}).annotateMerge(OpenApi.annotations({
|
|
95
|
+
title: "List domains",
|
|
96
|
+
summary: "List auth domains",
|
|
97
|
+
description: "Returns auth-owned custom hostnames for administrators.",
|
|
98
|
+
})))
|
|
99
|
+
.add(HttpApiEndpoint.post("createDomain", "/admin/domains", {
|
|
100
|
+
payload: ServerCreateDomainPayload,
|
|
101
|
+
success: ServerDomain,
|
|
102
|
+
error: [
|
|
103
|
+
HttpApiError.Unauthorized,
|
|
104
|
+
HttpApiError.Forbidden,
|
|
105
|
+
HttpApiError.BadRequest,
|
|
106
|
+
HttpApiError.InternalServerError,
|
|
107
|
+
],
|
|
108
|
+
}).annotateMerge(OpenApi.annotations({
|
|
109
|
+
title: "Create domain",
|
|
110
|
+
summary: "Create an auth domain",
|
|
111
|
+
description: "Registers an auth-owned custom hostname.",
|
|
112
|
+
})))
|
|
113
|
+
.add(HttpApiEndpoint.patch("updateDomain", "/admin/domains/:id", {
|
|
114
|
+
params: ServerDomainIdParams,
|
|
115
|
+
payload: ServerUpdateDomainPayload,
|
|
116
|
+
success: ServerDomain,
|
|
117
|
+
error: [
|
|
118
|
+
HttpApiError.Unauthorized,
|
|
119
|
+
HttpApiError.Forbidden,
|
|
120
|
+
HttpApiError.NotFound,
|
|
121
|
+
HttpApiError.InternalServerError,
|
|
122
|
+
],
|
|
123
|
+
}).annotateMerge(OpenApi.annotations({
|
|
124
|
+
title: "Update domain",
|
|
125
|
+
summary: "Update an auth domain",
|
|
126
|
+
description: "Updates trust target, ownership links, and Cloudflare management mode for an auth hostname.",
|
|
127
|
+
})))
|
|
128
|
+
.add(HttpApiEndpoint.get("getDomainRecords", "/admin/domains/:id/records", {
|
|
129
|
+
params: ServerDomainIdParams,
|
|
130
|
+
success: ServerDomainRecordsResponse,
|
|
131
|
+
error: [
|
|
132
|
+
HttpApiError.Unauthorized,
|
|
133
|
+
HttpApiError.Forbidden,
|
|
134
|
+
HttpApiError.NotFound,
|
|
135
|
+
HttpApiError.InternalServerError,
|
|
136
|
+
],
|
|
137
|
+
}).annotateMerge(OpenApi.annotations({
|
|
138
|
+
title: "Get domain records",
|
|
139
|
+
summary: "Get auth domain DNS records",
|
|
140
|
+
description: "Returns DNS records and refreshed status for an auth-owned custom hostname.",
|
|
141
|
+
})))
|
|
142
|
+
.add(HttpApiEndpoint.delete("deleteDomain", "/admin/domains/:id", {
|
|
143
|
+
params: ServerDomainIdParams,
|
|
144
|
+
success: ServerDomain,
|
|
145
|
+
error: [
|
|
146
|
+
HttpApiError.Unauthorized,
|
|
147
|
+
HttpApiError.Forbidden,
|
|
148
|
+
HttpApiError.NotFound,
|
|
149
|
+
HttpApiError.InternalServerError,
|
|
150
|
+
],
|
|
151
|
+
}).annotateMerge(OpenApi.annotations({
|
|
152
|
+
title: "Delete domain",
|
|
153
|
+
summary: "Delete an auth domain",
|
|
154
|
+
description: "Deletes an auth-owned custom hostname.",
|
|
155
|
+
})))
|
|
156
|
+
.annotateMerge(OpenApi.annotations({
|
|
157
|
+
title: "Admin",
|
|
158
|
+
description: "Administrative KrakStack authentication endpoints.",
|
|
159
|
+
}));
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload } from "../server/schema";
|
|
3
|
+
export declare const AdminListQuery: Schema.Struct<{
|
|
4
|
+
readonly page: Schema.Int;
|
|
5
|
+
readonly pageSize: Schema.Int;
|
|
6
|
+
readonly globalFilter: Schema.optional<Schema.String>;
|
|
7
|
+
readonly sort: Schema.optional<Schema.decodeTo<Schema.String, Schema.decodeTo<Schema.$Array<Schema.Struct<{
|
|
8
|
+
readonly id: Schema.NonEmptyString;
|
|
9
|
+
readonly direction: Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>;
|
|
10
|
+
}>>, Schema.String, never, never>, never, never>>;
|
|
11
|
+
readonly projectId: Schema.optional<Schema.String>;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const AdminUser: Schema.Struct<{
|
|
14
|
+
readonly id: Schema.String;
|
|
15
|
+
readonly name: Schema.String;
|
|
16
|
+
readonly email: Schema.String;
|
|
17
|
+
readonly emailVerified: Schema.Boolean;
|
|
18
|
+
readonly image: Schema.NullOr<Schema.String>;
|
|
19
|
+
readonly createdAt: Schema.Date;
|
|
20
|
+
readonly role: Schema.NullOr<Schema.String>;
|
|
21
|
+
readonly banned: Schema.NullOr<Schema.Boolean>;
|
|
22
|
+
readonly banReason: Schema.NullOr<Schema.String>;
|
|
23
|
+
readonly banExpires: Schema.NullOr<Schema.Date>;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const AdminOrganization: Schema.Struct<{
|
|
26
|
+
readonly id: Schema.String;
|
|
27
|
+
readonly name: Schema.String;
|
|
28
|
+
readonly slug: Schema.String;
|
|
29
|
+
readonly logo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
30
|
+
readonly metadata: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
31
|
+
readonly createdAt: Schema.Date;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const AdminOrganizationIdParams: Schema.Struct<{
|
|
34
|
+
readonly id: Schema.String;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const AdminCreateOrganizationPayload: Schema.Struct<{
|
|
37
|
+
readonly name: Schema.NonEmptyString;
|
|
38
|
+
readonly slug: Schema.NonEmptyString;
|
|
39
|
+
readonly logo: Schema.optional<Schema.String>;
|
|
40
|
+
}>;
|
|
41
|
+
export declare const AdminUpdateOrganizationPayload: Schema.Struct<{
|
|
42
|
+
readonly name: Schema.optional<Schema.NonEmptyString>;
|
|
43
|
+
readonly slug: Schema.optional<Schema.NonEmptyString>;
|
|
44
|
+
readonly logo: Schema.optional<Schema.String>;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const DashboardStatsQuery: Schema.Struct<{
|
|
47
|
+
readonly days: Schema.optional<Schema.Union<readonly [Schema.Literal<"7">, Schema.Literal<"14">, Schema.Literal<"30">, Schema.Literal<"90">]>>;
|
|
48
|
+
}>;
|
|
49
|
+
export declare const DailyActiveUsersByDay: Schema.Struct<{
|
|
50
|
+
readonly date: Schema.String;
|
|
51
|
+
readonly count: Schema.Number;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const SignupsByDay: Schema.Struct<{
|
|
54
|
+
readonly date: Schema.String;
|
|
55
|
+
readonly count: Schema.Number;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const ProjectConnections: Schema.Struct<{
|
|
58
|
+
readonly projectId: Schema.String;
|
|
59
|
+
readonly projectName: Schema.String;
|
|
60
|
+
readonly users: Schema.Number;
|
|
61
|
+
readonly organizations: Schema.Number;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const DashboardStatsResponse: Schema.Struct<{
|
|
64
|
+
readonly totalUsers: Schema.Number;
|
|
65
|
+
readonly totalOrganizations: Schema.Number;
|
|
66
|
+
readonly totalProjects: Schema.Number;
|
|
67
|
+
readonly totalDomains: Schema.Number;
|
|
68
|
+
readonly totalApiKeys: Schema.Number;
|
|
69
|
+
readonly totalOauthClients: Schema.Number;
|
|
70
|
+
readonly dailyActiveUsers: Schema.Number;
|
|
71
|
+
readonly dailyActiveUsersByDay: Schema.$Array<Schema.Struct<{
|
|
72
|
+
readonly date: Schema.String;
|
|
73
|
+
readonly count: Schema.Number;
|
|
74
|
+
}>>;
|
|
75
|
+
readonly signupsByDay: Schema.$Array<Schema.Struct<{
|
|
76
|
+
readonly date: Schema.String;
|
|
77
|
+
readonly count: Schema.Number;
|
|
78
|
+
}>>;
|
|
79
|
+
readonly projectConnections: Schema.$Array<Schema.Struct<{
|
|
80
|
+
readonly projectId: Schema.String;
|
|
81
|
+
readonly projectName: Schema.String;
|
|
82
|
+
readonly users: Schema.Number;
|
|
83
|
+
readonly organizations: Schema.Number;
|
|
84
|
+
}>>;
|
|
85
|
+
}>;
|
|
86
|
+
export declare const PaginatedAdminUsers: Schema.Struct<{
|
|
87
|
+
readonly data: Schema.$Array<Schema.Schema<Schema.Struct.ReadonlySide<{
|
|
88
|
+
readonly id: Schema.String;
|
|
89
|
+
readonly name: Schema.String;
|
|
90
|
+
readonly email: Schema.String;
|
|
91
|
+
readonly emailVerified: Schema.Boolean;
|
|
92
|
+
readonly image: Schema.NullOr<Schema.String>;
|
|
93
|
+
readonly createdAt: Schema.Date;
|
|
94
|
+
readonly role: Schema.NullOr<Schema.String>;
|
|
95
|
+
readonly banned: Schema.NullOr<Schema.Boolean>;
|
|
96
|
+
readonly banReason: Schema.NullOr<Schema.String>;
|
|
97
|
+
readonly banExpires: Schema.NullOr<Schema.Date>;
|
|
98
|
+
}, "Type">>>;
|
|
99
|
+
readonly meta: Schema.Struct<{
|
|
100
|
+
readonly page: Schema.Int;
|
|
101
|
+
readonly pageSize: Schema.Int;
|
|
102
|
+
readonly total: Schema.Int;
|
|
103
|
+
readonly pageCount: Schema.Int;
|
|
104
|
+
}>;
|
|
105
|
+
}>;
|
|
106
|
+
export declare const PaginatedAdminOrganizations: Schema.Struct<{
|
|
107
|
+
readonly data: Schema.$Array<Schema.Schema<{
|
|
108
|
+
readonly id: string;
|
|
109
|
+
readonly name: string;
|
|
110
|
+
readonly slug: string;
|
|
111
|
+
readonly logo?: string | null | undefined;
|
|
112
|
+
readonly metadata?: string | null | undefined;
|
|
113
|
+
readonly createdAt: Date;
|
|
114
|
+
}>>;
|
|
115
|
+
readonly meta: Schema.Struct<{
|
|
116
|
+
readonly page: Schema.Int;
|
|
117
|
+
readonly pageSize: Schema.Int;
|
|
118
|
+
readonly total: Schema.Int;
|
|
119
|
+
readonly pageCount: Schema.Int;
|
|
120
|
+
}>;
|
|
121
|
+
}>;
|
|
122
|
+
export type AdminListQuery = typeof AdminListQuery.Type;
|
|
123
|
+
export type AdminUser = typeof AdminUser.Type;
|
|
124
|
+
export type AdminOrganization = typeof AdminOrganization.Type;
|
|
125
|
+
export type AdminCreateOrganizationPayload = typeof AdminCreateOrganizationPayload.Type;
|
|
126
|
+
export type AdminUpdateOrganizationPayload = typeof AdminUpdateOrganizationPayload.Type;
|
|
127
|
+
export { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, };
|
|
128
|
+
export { SortParamsFromString } from "../query";
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { PaginatedResponse, Query } from "../query";
|
|
3
|
+
import { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, } from "../server/schema";
|
|
4
|
+
export const AdminListQuery = Schema.Struct({
|
|
5
|
+
...Query.fields,
|
|
6
|
+
projectId: Schema.optional(Schema.String),
|
|
7
|
+
}).annotate({
|
|
8
|
+
identifier: "AdminListQuery",
|
|
9
|
+
title: "Admin list query",
|
|
10
|
+
description: "Paginated administrative list query optionally scoped to linked project records.",
|
|
11
|
+
examples: [{ page: 0, pageSize: 10, projectId: "project-id" }],
|
|
12
|
+
});
|
|
13
|
+
export const AdminUser = Schema.Struct({
|
|
14
|
+
id: Schema.String,
|
|
15
|
+
name: Schema.String,
|
|
16
|
+
email: Schema.String,
|
|
17
|
+
emailVerified: Schema.Boolean,
|
|
18
|
+
image: Schema.NullOr(Schema.String),
|
|
19
|
+
createdAt: Schema.Date,
|
|
20
|
+
role: Schema.NullOr(Schema.String),
|
|
21
|
+
banned: Schema.NullOr(Schema.Boolean),
|
|
22
|
+
banReason: Schema.NullOr(Schema.String),
|
|
23
|
+
banExpires: Schema.NullOr(Schema.Date),
|
|
24
|
+
}).annotate({
|
|
25
|
+
identifier: "AdminUser",
|
|
26
|
+
title: "Admin user",
|
|
27
|
+
description: "Administrative user record returned in paginated user lists.",
|
|
28
|
+
examples: [
|
|
29
|
+
{
|
|
30
|
+
id: "user-id",
|
|
31
|
+
name: "Ada Lovelace",
|
|
32
|
+
email: "ada@example.com",
|
|
33
|
+
emailVerified: true,
|
|
34
|
+
image: null,
|
|
35
|
+
createdAt: new Date("2026-01-01T00:00:00.000Z"),
|
|
36
|
+
role: "admin",
|
|
37
|
+
banned: false,
|
|
38
|
+
banReason: null,
|
|
39
|
+
banExpires: null,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
});
|
|
43
|
+
export const AdminOrganization = Schema.Struct({
|
|
44
|
+
id: Schema.String,
|
|
45
|
+
name: Schema.String,
|
|
46
|
+
slug: Schema.String,
|
|
47
|
+
logo: Schema.optional(Schema.NullOr(Schema.String)),
|
|
48
|
+
metadata: Schema.optional(Schema.NullOr(Schema.String)),
|
|
49
|
+
createdAt: Schema.Date,
|
|
50
|
+
}).annotate({
|
|
51
|
+
identifier: "AdminOrganization",
|
|
52
|
+
title: "Admin organization",
|
|
53
|
+
description: "Administrative organization record managed by KrakStack Auth.",
|
|
54
|
+
examples: [
|
|
55
|
+
{
|
|
56
|
+
id: "organization-id",
|
|
57
|
+
name: "KrakStack",
|
|
58
|
+
slug: "krakstack",
|
|
59
|
+
logo: "https://example.com/logo.svg",
|
|
60
|
+
metadata: '{"tier":"internal"}',
|
|
61
|
+
createdAt: new Date("2026-01-01T00:00:00.000Z"),
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
export const AdminOrganizationIdParams = Schema.Struct({
|
|
66
|
+
id: Schema.String,
|
|
67
|
+
}).annotate({
|
|
68
|
+
identifier: "AdminOrganizationIdParams",
|
|
69
|
+
title: "Admin organization ID params",
|
|
70
|
+
description: "Path parameters used to identify an organization.",
|
|
71
|
+
examples: [{ id: "organization-id" }],
|
|
72
|
+
});
|
|
73
|
+
export const AdminCreateOrganizationPayload = Schema.Struct({
|
|
74
|
+
name: Schema.NonEmptyString,
|
|
75
|
+
slug: Schema.NonEmptyString,
|
|
76
|
+
logo: Schema.optional(Schema.String),
|
|
77
|
+
}).annotate({
|
|
78
|
+
identifier: "AdminCreateOrganizationPayload",
|
|
79
|
+
title: "Create organization payload",
|
|
80
|
+
description: "Payload used by administrators to create an organization.",
|
|
81
|
+
examples: [{ name: "KrakStack", slug: "krakstack" }],
|
|
82
|
+
});
|
|
83
|
+
export const AdminUpdateOrganizationPayload = Schema.Struct({
|
|
84
|
+
name: Schema.optional(Schema.NonEmptyString),
|
|
85
|
+
slug: Schema.optional(Schema.NonEmptyString),
|
|
86
|
+
logo: Schema.optional(Schema.String),
|
|
87
|
+
}).annotate({
|
|
88
|
+
identifier: "AdminUpdateOrganizationPayload",
|
|
89
|
+
title: "Update organization payload",
|
|
90
|
+
description: "Payload used by administrators to update an organization.",
|
|
91
|
+
examples: [{ name: "KrakStack Labs", slug: "krakstack-labs" }],
|
|
92
|
+
});
|
|
93
|
+
export const DashboardStatsQuery = Schema.Struct({
|
|
94
|
+
days: Schema.optional(Schema.Union([
|
|
95
|
+
Schema.Literal("7"),
|
|
96
|
+
Schema.Literal("14"),
|
|
97
|
+
Schema.Literal("30"),
|
|
98
|
+
Schema.Literal("90"),
|
|
99
|
+
])),
|
|
100
|
+
}).annotate({
|
|
101
|
+
identifier: "DashboardStatsQuery",
|
|
102
|
+
title: "Dashboard stats query",
|
|
103
|
+
description: "Time range used for dashboard chart series.",
|
|
104
|
+
examples: [{ days: "14" }],
|
|
105
|
+
});
|
|
106
|
+
export const DailyActiveUsersByDay = Schema.Struct({
|
|
107
|
+
date: Schema.String,
|
|
108
|
+
count: Schema.Number,
|
|
109
|
+
}).annotate({
|
|
110
|
+
identifier: "DailyActiveUsersByDay",
|
|
111
|
+
title: "Daily active users by day",
|
|
112
|
+
description: "Distinct authenticated users active on a calendar day.",
|
|
113
|
+
examples: [{ date: "2026-06-26", count: 18 }],
|
|
114
|
+
});
|
|
115
|
+
export const SignupsByDay = Schema.Struct({
|
|
116
|
+
date: Schema.String,
|
|
117
|
+
count: Schema.Number,
|
|
118
|
+
}).annotate({
|
|
119
|
+
identifier: "SignupsByDay",
|
|
120
|
+
title: "Signups by day",
|
|
121
|
+
description: "Users registered on a calendar day.",
|
|
122
|
+
examples: [{ date: "2026-06-26", count: 4 }],
|
|
123
|
+
});
|
|
124
|
+
export const ProjectConnections = Schema.Struct({
|
|
125
|
+
projectId: Schema.String,
|
|
126
|
+
projectName: Schema.String,
|
|
127
|
+
users: Schema.Number,
|
|
128
|
+
organizations: Schema.Number,
|
|
129
|
+
}).annotate({
|
|
130
|
+
identifier: "ProjectConnections",
|
|
131
|
+
title: "Project connections",
|
|
132
|
+
description: "Number of connected users and organizations for a project.",
|
|
133
|
+
examples: [
|
|
134
|
+
{
|
|
135
|
+
projectId: "project-id",
|
|
136
|
+
projectName: "Dashboard",
|
|
137
|
+
users: 12,
|
|
138
|
+
organizations: 3,
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
});
|
|
142
|
+
export const DashboardStatsResponse = Schema.Struct({
|
|
143
|
+
totalUsers: Schema.Number,
|
|
144
|
+
totalOrganizations: Schema.Number,
|
|
145
|
+
totalProjects: Schema.Number,
|
|
146
|
+
totalDomains: Schema.Number,
|
|
147
|
+
totalApiKeys: Schema.Number,
|
|
148
|
+
totalOauthClients: Schema.Number,
|
|
149
|
+
dailyActiveUsers: Schema.Number,
|
|
150
|
+
dailyActiveUsersByDay: Schema.Array(DailyActiveUsersByDay),
|
|
151
|
+
signupsByDay: Schema.Array(SignupsByDay),
|
|
152
|
+
projectConnections: Schema.Array(ProjectConnections),
|
|
153
|
+
}).annotate({
|
|
154
|
+
identifier: "DashboardStatsResponse",
|
|
155
|
+
title: "Dashboard stats response",
|
|
156
|
+
description: "Administrative dashboard statistics.",
|
|
157
|
+
examples: [
|
|
158
|
+
{
|
|
159
|
+
totalUsers: 42,
|
|
160
|
+
totalOrganizations: 3,
|
|
161
|
+
totalProjects: 2,
|
|
162
|
+
totalDomains: 5,
|
|
163
|
+
totalApiKeys: 7,
|
|
164
|
+
totalOauthClients: 1,
|
|
165
|
+
dailyActiveUsers: 18,
|
|
166
|
+
dailyActiveUsersByDay: [{ date: "2026-06-26", count: 18 }],
|
|
167
|
+
signupsByDay: [{ date: "2026-06-26", count: 4 }],
|
|
168
|
+
projectConnections: [
|
|
169
|
+
{
|
|
170
|
+
projectId: "project-id",
|
|
171
|
+
projectName: "Dashboard",
|
|
172
|
+
users: 12,
|
|
173
|
+
organizations: 3,
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
});
|
|
179
|
+
export const PaginatedAdminUsers = PaginatedResponse(AdminUser).annotate({
|
|
180
|
+
identifier: "PaginatedAdminUsers",
|
|
181
|
+
title: "Paginated admin users",
|
|
182
|
+
description: "Paginated administrative user list response.",
|
|
183
|
+
});
|
|
184
|
+
export const PaginatedAdminOrganizations = PaginatedResponse(AdminOrganization).annotate({
|
|
185
|
+
identifier: "PaginatedAdminOrganizations",
|
|
186
|
+
title: "Paginated admin organizations",
|
|
187
|
+
description: "Paginated administrative organization list response.",
|
|
188
|
+
});
|
|
189
|
+
export { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, };
|
|
190
|
+
export { SortParamsFromString } from "../query";
|