@krak-stack/auth 0.1.25 → 0.1.28
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/api.d.ts +252 -0
- package/dist/api.js +12 -0
- package/dist/better-auth/api.d.ts +4 -4
- package/dist/better-auth/api.js +1 -1
- package/dist/better-auth/index.d.ts +2 -2
- package/dist/components/api-key.d.ts +4 -0
- package/dist/components/api-key.js +20 -0
- package/dist/components/auth-api-client.d.ts +252 -0
- package/dist/components/auth-api-client.js +29 -0
- package/dist/components/organization-switcher.d.ts +2 -0
- package/dist/components/organization-switcher.js +71 -71
- package/dist/components/user-button.js +26 -39
- package/dist/extra/api.d.ts +37 -37
- package/dist/extra/api.js +1 -1
- package/dist/extra/index.d.ts +22 -22
- package/dist/extra/index.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/server/api.d.ts +141 -133
- package/dist/server/api.js +3 -3
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/schema.d.ts +9 -1
- package/dist/server/schema.js +21 -1
- package/dist/service.d.ts +694 -0
- package/dist/service.js +67 -0
- package/package.json +11 -1
- package/dist/client.d.ts +0 -1352
- package/dist/client.js +0 -105
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { AtomHttpApi } from "effect/unstable/reactivity";
|
|
2
|
+
export declare const authApiClient: (baseUrl?: string | undefined) => AtomHttpApi.AtomHttpApiClient<object, `AuthApi:${string}`, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"auth", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getSession", "GET", "/api/auth/get-session", 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").NullOr<import("effect/Schema").Struct<{
|
|
3
|
+
readonly session: import("effect/Schema").Struct<{
|
|
4
|
+
readonly id: import("effect/Schema").String;
|
|
5
|
+
readonly expiresAt: import("effect/Schema").Date;
|
|
6
|
+
readonly token: import("effect/Schema").String;
|
|
7
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
8
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
9
|
+
readonly ipAddress: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
10
|
+
readonly userAgent: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
11
|
+
readonly userId: import("effect/Schema").String;
|
|
12
|
+
readonly impersonatedBy: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
13
|
+
readonly activeOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
14
|
+
}>;
|
|
15
|
+
readonly user: import("effect/Schema").Struct<{
|
|
16
|
+
readonly id: import("effect/Schema").String;
|
|
17
|
+
readonly name: import("effect/Schema").String;
|
|
18
|
+
readonly email: import("effect/Schema").String;
|
|
19
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
20
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
21
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
22
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
23
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
24
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
25
|
+
}>;
|
|
26
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | 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 | typeof import("../better-auth").TooManyRequests>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"users", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getUser", "GET", "/api/users/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
27
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
28
|
+
}>>, 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").Struct<{
|
|
29
|
+
readonly id: import("effect/Schema").String;
|
|
30
|
+
readonly name: import("effect/Schema").String;
|
|
31
|
+
readonly email: import("effect/Schema").String;
|
|
32
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
33
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
34
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
35
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
36
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
37
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
38
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getUserActiveOrganization", "GET", "/api/organizations/user/:userId/active", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
39
|
+
readonly userId: import("effect/Schema").NonEmptyString;
|
|
40
|
+
}>>, 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").Struct<{
|
|
41
|
+
readonly id: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
42
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listUsersByIds", "GET", "/api/users", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
43
|
+
readonly ids: import("effect/Schema").NonEmptyString;
|
|
44
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
45
|
+
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
46
|
+
readonly id: import("effect/Schema").String;
|
|
47
|
+
readonly name: import("effect/Schema").String;
|
|
48
|
+
readonly email: import("effect/Schema").String;
|
|
49
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
50
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
51
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
52
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
53
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
54
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
55
|
+
}>>;
|
|
56
|
+
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
57
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"organizations", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getActiveMember", "GET", "/api/organizations/:organizationId/members/:userId", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
58
|
+
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
59
|
+
readonly userId: import("effect/Schema").NonEmptyString;
|
|
60
|
+
}>>, 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").Struct<{
|
|
61
|
+
readonly id: import("effect/Schema").String;
|
|
62
|
+
readonly organizationId: import("effect/Schema").String;
|
|
63
|
+
readonly userId: import("effect/Schema").String;
|
|
64
|
+
readonly role: import("effect/Schema").String;
|
|
65
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
66
|
+
readonly user: import("effect/Schema").Struct<{
|
|
67
|
+
readonly id: import("effect/Schema").String;
|
|
68
|
+
readonly name: import("effect/Schema").String;
|
|
69
|
+
readonly email: import("effect/Schema").String;
|
|
70
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
71
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
72
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
73
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
74
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
75
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
76
|
+
}>;
|
|
77
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getOrganization", "GET", "/api/organizations/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
78
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
79
|
+
}>>, 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").Struct<{
|
|
80
|
+
readonly id: import("effect/Schema").String;
|
|
81
|
+
readonly name: import("effect/Schema").String;
|
|
82
|
+
readonly slug: import("effect/Schema").String;
|
|
83
|
+
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
84
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
85
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
86
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
87
|
+
readonly name: import("effect/Schema").String;
|
|
88
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
89
|
+
readonly icon: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
90
|
+
readonly contactEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
91
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
92
|
+
}>>;
|
|
93
|
+
}>>;
|
|
94
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
95
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listOrganizationMembers", "GET", "/api/organizations/:organizationId/members", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
96
|
+
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
97
|
+
}>>, 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<{
|
|
98
|
+
readonly id: import("effect/Schema").String;
|
|
99
|
+
readonly organizationId: import("effect/Schema").String;
|
|
100
|
+
readonly userId: import("effect/Schema").String;
|
|
101
|
+
readonly role: import("effect/Schema").String;
|
|
102
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
103
|
+
readonly user: import("effect/Schema").Struct<{
|
|
104
|
+
readonly id: import("effect/Schema").String;
|
|
105
|
+
readonly name: import("effect/Schema").String;
|
|
106
|
+
readonly email: import("effect/Schema").String;
|
|
107
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
108
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
109
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
110
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
111
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
112
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
113
|
+
}>;
|
|
114
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listOrganizations", "GET", "/api/organizations", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
115
|
+
readonly ids: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
116
|
+
readonly userId: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
117
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
118
|
+
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
119
|
+
readonly id: import("effect/Schema").String;
|
|
120
|
+
readonly name: import("effect/Schema").String;
|
|
121
|
+
readonly slug: import("effect/Schema").String;
|
|
122
|
+
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
123
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
124
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
125
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
126
|
+
readonly name: import("effect/Schema").String;
|
|
127
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
128
|
+
readonly icon: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
129
|
+
readonly contactEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
130
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
131
|
+
}>>;
|
|
132
|
+
}>>;
|
|
133
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
134
|
+
}>>;
|
|
135
|
+
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
136
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"domains", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"createDomain", "POST", "/api/domains", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
137
|
+
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
138
|
+
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
139
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
140
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
141
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
142
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
143
|
+
readonly id: import("effect/Schema").String;
|
|
144
|
+
readonly hostname: import("effect/Schema").String;
|
|
145
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
146
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
147
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
148
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
149
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
150
|
+
readonly active: import("effect/Schema").Boolean;
|
|
151
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
152
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
153
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"deleteDomain", "DELETE", "/api/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
154
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
155
|
+
}>>, 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<{
|
|
156
|
+
readonly id: import("effect/Schema").String;
|
|
157
|
+
readonly hostname: import("effect/Schema").String;
|
|
158
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
159
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
160
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
161
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
162
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
163
|
+
readonly active: import("effect/Schema").Boolean;
|
|
164
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
165
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
166
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getDomain", "GET", "/api/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
167
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
168
|
+
}>>, 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").Struct<{
|
|
169
|
+
readonly id: import("effect/Schema").String;
|
|
170
|
+
readonly hostname: import("effect/Schema").String;
|
|
171
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
172
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
173
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
174
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
175
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
176
|
+
readonly active: import("effect/Schema").Boolean;
|
|
177
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
178
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
179
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getDomainByHost", "GET", "/api/domains/by-host/:hostname", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
180
|
+
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
181
|
+
}>>, 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").Struct<{
|
|
182
|
+
readonly id: import("effect/Schema").String;
|
|
183
|
+
readonly hostname: import("effect/Schema").String;
|
|
184
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
185
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
186
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
187
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
188
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
189
|
+
readonly active: import("effect/Schema").Boolean;
|
|
190
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
191
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
192
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | 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/domains/:id/records", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
193
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
194
|
+
}>>, 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<{
|
|
195
|
+
readonly required: import("effect/Schema").Boolean;
|
|
196
|
+
readonly status: import("effect/Schema").String;
|
|
197
|
+
readonly type: import("effect/Schema").String;
|
|
198
|
+
readonly name: import("effect/Schema").String;
|
|
199
|
+
readonly value: import("effect/Schema").String;
|
|
200
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"authExtra", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"createApiKey", "POST", "/api/auth/create-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
201
|
+
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
202
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
203
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
204
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
205
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
206
|
+
readonly id: import("effect/Schema").String;
|
|
207
|
+
readonly key: import("effect/Schema").String;
|
|
208
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"presign", "POST", "/api/organizations/logo/presign", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
209
|
+
readonly fileName: import("effect/Schema").NonEmptyString;
|
|
210
|
+
readonly contentType: import("effect/Schema").NonEmptyString;
|
|
211
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
212
|
+
readonly uploadUrl: import("effect/Schema").String;
|
|
213
|
+
readonly url: import("effect/Schema").String;
|
|
214
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | 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<"presignUserImageUpload", "POST", "/api/auth/image/presign", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
215
|
+
readonly fileName: import("effect/Schema").NonEmptyString;
|
|
216
|
+
readonly contentType: import("effect/Schema").NonEmptyString;
|
|
217
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
218
|
+
readonly uploadUrl: import("effect/Schema").String;
|
|
219
|
+
readonly url: import("effect/Schema").String;
|
|
220
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("../extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"setPassword", "POST", "/api/auth/set-password", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
221
|
+
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
222
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
223
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
224
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyApiKey", "POST", "/api/auth/verify-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
225
|
+
readonly key: import("effect/Schema").NonEmptyString;
|
|
226
|
+
readonly configId: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>>;
|
|
227
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
228
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
229
|
+
readonly valid: import("effect/Schema").Boolean;
|
|
230
|
+
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
231
|
+
readonly message: import("effect/Schema").String;
|
|
232
|
+
readonly code: import("effect/Schema").String;
|
|
233
|
+
}>>;
|
|
234
|
+
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
235
|
+
readonly id: import("effect/Schema").String;
|
|
236
|
+
readonly configId: import("effect/Schema").String;
|
|
237
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
238
|
+
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
239
|
+
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
240
|
+
readonly referenceId: import("effect/Schema").String;
|
|
241
|
+
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
242
|
+
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
243
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
244
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
245
|
+
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
246
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
247
|
+
}>>;
|
|
248
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyPassword", "POST", "/api/auth/verify-password", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
249
|
+
readonly password: import("effect/Schema").NonEmptyString;
|
|
250
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
251
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
252
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../extra").ExtraBadRequest>, never, never>, false>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { FetchHttpClient, HttpClient } from "effect/unstable/http";
|
|
3
|
+
import { AtomHttpApi } from "effect/unstable/reactivity";
|
|
4
|
+
import { AuthApi } from "../api";
|
|
5
|
+
const authApiUrl = (baseUrl) => {
|
|
6
|
+
const url = baseUrl?.trim() ||
|
|
7
|
+
(typeof window === "undefined"
|
|
8
|
+
? "http://localhost:3000"
|
|
9
|
+
: window.location.origin);
|
|
10
|
+
return url.replace(/\/$/, "");
|
|
11
|
+
};
|
|
12
|
+
const createAuthApiClient = (key) => AtomHttpApi.Service()(`AuthApi:${key}`, {
|
|
13
|
+
api: AuthApi,
|
|
14
|
+
baseUrl: key,
|
|
15
|
+
httpClient: FetchHttpClient.layer,
|
|
16
|
+
transformClient: (client) => HttpClient.makeWith((request) => client.postprocess(request).pipe(Effect.provideService(FetchHttpClient.RequestInit, {
|
|
17
|
+
credentials: "include",
|
|
18
|
+
})), client.preprocess),
|
|
19
|
+
});
|
|
20
|
+
const authApiClients = new Map();
|
|
21
|
+
export const authApiClient = (baseUrl) => {
|
|
22
|
+
const key = authApiUrl(baseUrl);
|
|
23
|
+
const existing = authApiClients.get(key);
|
|
24
|
+
if (existing)
|
|
25
|
+
return existing;
|
|
26
|
+
const client = createAuthApiClient(key);
|
|
27
|
+
authApiClients.set(key, client);
|
|
28
|
+
return client;
|
|
29
|
+
};
|
|
@@ -7,6 +7,7 @@ declare const messages: {
|
|
|
7
7
|
readonly organization_contact_email: "Contact email";
|
|
8
8
|
readonly organization_create_description: "Create a workspace for team-based access.";
|
|
9
9
|
readonly organization_create_error: "Could not create the organization.";
|
|
10
|
+
readonly organization_copy_id: "Copy organization ID";
|
|
10
11
|
readonly organization_create_slug_conflict: "That organization slug is already in use. Choose a different slug.";
|
|
11
12
|
readonly organization_create_title: "Create organization";
|
|
12
13
|
readonly organization_edit_description: "Update the active organization's canonical details and localized profile.";
|
|
@@ -85,6 +86,7 @@ declare const messages: {
|
|
|
85
86
|
readonly organization_contact_email: "E-mail de contact";
|
|
86
87
|
readonly organization_create_description: "Créez un espace de travail pour l'accès en équipe.";
|
|
87
88
|
readonly organization_create_error: "Impossible de créer l'organisation.";
|
|
89
|
+
readonly organization_copy_id: "Copier l'ID de l'organisation";
|
|
88
90
|
readonly organization_create_slug_conflict: "Ce slug d'organisation est déjà utilisé. Choisissez un autre slug.";
|
|
89
91
|
readonly organization_create_title: "Créer une organisation";
|
|
90
92
|
readonly organization_edit_description: "Mettez à jour les détails canoniques et le profil localisé de l'organisation active.";
|