@krak-stack/auth 0.1.35 → 0.1.37
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 +146 -146
- package/dist/config.js +6 -2
- package/dist/server/api.d.ts +85 -85
- package/dist/server/proxy.js +16 -1
- package/dist/service.js +7 -1
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -23,137 +23,38 @@ export declare const AuthApi: HttpApi.HttpApi<"AuthApi", import("effect/unstable
|
|
|
23
23
|
readonly createdAt: import("effect/Schema").Date;
|
|
24
24
|
readonly updatedAt: import("effect/Schema").Date;
|
|
25
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<"
|
|
27
|
-
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
28
|
-
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
29
|
-
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
30
|
-
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
31
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
32
|
-
readonly id: import("effect/Schema").String;
|
|
33
|
-
readonly key: import("effect/Schema").String;
|
|
34
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getProjectPublicConfig", "GET", "/api/auth/project-config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
35
|
-
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
36
|
-
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
37
|
-
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
38
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
39
|
-
readonly projectKey: import("effect/Schema").String;
|
|
40
|
-
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
41
|
-
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
42
|
-
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
43
|
-
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
44
|
-
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
45
|
-
readonly authOptions: import("effect/Schema").Struct<{
|
|
46
|
-
readonly emailPassword: import("effect/Schema").Boolean;
|
|
47
|
-
readonly emailOtp: import("effect/Schema").Boolean;
|
|
48
|
-
readonly google: import("effect/Schema").Boolean;
|
|
49
|
-
readonly signUp: import("effect/Schema").Boolean;
|
|
50
|
-
readonly signUpName: import("effect/Schema").Boolean;
|
|
51
|
-
}>;
|
|
52
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, 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<{
|
|
53
|
-
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
54
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
55
|
-
readonly ok: import("effect/Schema").Boolean;
|
|
56
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadOrganizationLogo", "POST", "/api/organizations/logo/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
|
|
57
|
-
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
58
|
-
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
59
|
-
readonly url: import("effect/Schema").String;
|
|
60
|
-
}>>, 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<"uploadUserImage", "POST", "/api/auth/image/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
|
|
61
|
-
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
62
|
-
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
63
|
-
readonly url: import("effect/Schema").String;
|
|
64
|
-
}>>, 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<"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<{
|
|
65
|
-
readonly key: import("effect/Schema").NonEmptyString;
|
|
66
|
-
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">]>>;
|
|
67
|
-
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
68
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
69
|
-
readonly valid: import("effect/Schema").Boolean;
|
|
70
|
-
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
71
|
-
readonly message: import("effect/Schema").String;
|
|
72
|
-
readonly code: import("effect/Schema").String;
|
|
73
|
-
}>>;
|
|
74
|
-
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
75
|
-
readonly id: import("effect/Schema").String;
|
|
76
|
-
readonly configId: import("effect/Schema").String;
|
|
77
|
-
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
78
|
-
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
79
|
-
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
80
|
-
readonly referenceId: import("effect/Schema").String;
|
|
81
|
-
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
82
|
-
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
83
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
84
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
85
|
-
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
86
|
-
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
87
|
-
}>>;
|
|
88
|
-
}>>, 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<{
|
|
89
|
-
readonly password: import("effect/Schema").NonEmptyString;
|
|
90
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
91
|
-
readonly ok: import("effect/Schema").Boolean;
|
|
92
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, 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<{
|
|
93
|
-
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
94
|
-
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
95
|
-
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
96
|
-
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
97
|
-
readonly managed: import("effect/Schema").Boolean;
|
|
98
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
99
|
-
readonly id: import("effect/Schema").String;
|
|
100
|
-
readonly hostname: import("effect/Schema").String;
|
|
101
|
-
readonly rootHostname: import("effect/Schema").String;
|
|
102
|
-
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
103
|
-
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
104
|
-
readonly hostnameId: import("effect/Schema").String;
|
|
105
|
-
readonly managed: import("effect/Schema").Boolean;
|
|
106
|
-
readonly active: import("effect/Schema").Boolean;
|
|
107
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
108
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
109
|
-
}>>, 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<{
|
|
110
|
-
readonly id: import("effect/Schema").NonEmptyString;
|
|
111
|
-
}>>, 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<{
|
|
112
|
-
readonly id: import("effect/Schema").String;
|
|
113
|
-
readonly hostname: import("effect/Schema").String;
|
|
114
|
-
readonly rootHostname: import("effect/Schema").String;
|
|
115
|
-
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
116
|
-
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
117
|
-
readonly hostnameId: import("effect/Schema").String;
|
|
118
|
-
readonly managed: import("effect/Schema").Boolean;
|
|
119
|
-
readonly active: import("effect/Schema").Boolean;
|
|
120
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
121
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
122
|
-
}>>, 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<{
|
|
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<{
|
|
123
27
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
124
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<{
|
|
125
29
|
readonly id: import("effect/Schema").String;
|
|
126
|
-
readonly
|
|
127
|
-
readonly
|
|
128
|
-
readonly
|
|
129
|
-
readonly
|
|
130
|
-
readonly
|
|
131
|
-
readonly
|
|
132
|
-
readonly active: import("effect/Schema").Boolean;
|
|
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>;
|
|
133
36
|
readonly createdAt: import("effect/Schema").Date;
|
|
134
37
|
readonly updatedAt: import("effect/Schema").Date;
|
|
135
|
-
}>>, 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<"
|
|
136
|
-
readonly
|
|
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;
|
|
137
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<{
|
|
138
|
-
readonly id: import("effect/Schema").String
|
|
139
|
-
|
|
140
|
-
readonly
|
|
141
|
-
|
|
142
|
-
readonly
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
readonly
|
|
154
|
-
|
|
155
|
-
readonly value: import("effect/Schema").String;
|
|
156
|
-
}>>>, 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<"organizations", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getActiveMember", "GET", "/api/organizations/:organizationId/members/:userId", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<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<{
|
|
157
58
|
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
158
59
|
readonly userId: import("effect/Schema").NonEmptyString;
|
|
159
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<{
|
|
@@ -232,35 +133,134 @@ export declare const AuthApi: HttpApi.HttpApi<"AuthApi", import("effect/unstable
|
|
|
232
133
|
readonly createdAt: import("effect/Schema").Date;
|
|
233
134
|
}>>;
|
|
234
135
|
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
235
|
-
}>>, 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<"
|
|
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<{
|
|
236
167
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
237
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<{
|
|
238
169
|
readonly id: import("effect/Schema").String;
|
|
239
|
-
readonly
|
|
240
|
-
readonly
|
|
241
|
-
readonly
|
|
242
|
-
readonly
|
|
243
|
-
readonly
|
|
244
|
-
readonly
|
|
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;
|
|
245
177
|
readonly createdAt: import("effect/Schema").Date;
|
|
246
178
|
readonly updatedAt: import("effect/Schema").Date;
|
|
247
|
-
}>>, 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<"
|
|
248
|
-
readonly
|
|
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;
|
|
249
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<{
|
|
250
|
-
readonly id: import("effect/Schema").
|
|
251
|
-
|
|
252
|
-
readonly
|
|
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<"getProjectPublicConfig", "GET", "/api/auth/project-config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
209
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
210
|
+
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
211
|
+
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
253
212
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
254
|
-
readonly
|
|
213
|
+
readonly projectKey: import("effect/Schema").String;
|
|
214
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
215
|
+
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
216
|
+
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
217
|
+
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
218
|
+
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
219
|
+
readonly authOptions: import("effect/Schema").Struct<{
|
|
220
|
+
readonly emailPassword: import("effect/Schema").Boolean;
|
|
221
|
+
readonly emailOtp: import("effect/Schema").Boolean;
|
|
222
|
+
readonly google: import("effect/Schema").Boolean;
|
|
223
|
+
readonly signUp: import("effect/Schema").Boolean;
|
|
224
|
+
readonly signUpName: import("effect/Schema").Boolean;
|
|
225
|
+
}>;
|
|
226
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, 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<{
|
|
227
|
+
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
228
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
229
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
230
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadOrganizationLogo", "POST", "/api/organizations/logo/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
|
|
231
|
+
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
232
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
233
|
+
readonly url: import("effect/Schema").String;
|
|
234
|
+
}>>, 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<"uploadUserImage", "POST", "/api/auth/image/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
|
|
235
|
+
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
236
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
237
|
+
readonly url: import("effect/Schema").String;
|
|
238
|
+
}>>, 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<"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<{
|
|
239
|
+
readonly key: import("effect/Schema").NonEmptyString;
|
|
240
|
+
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">]>>;
|
|
241
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
242
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
243
|
+
readonly valid: import("effect/Schema").Boolean;
|
|
244
|
+
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
245
|
+
readonly message: import("effect/Schema").String;
|
|
246
|
+
readonly code: import("effect/Schema").String;
|
|
247
|
+
}>>;
|
|
248
|
+
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
255
249
|
readonly id: import("effect/Schema").String;
|
|
256
|
-
readonly
|
|
257
|
-
readonly
|
|
258
|
-
readonly
|
|
259
|
-
readonly
|
|
260
|
-
readonly
|
|
261
|
-
readonly
|
|
250
|
+
readonly configId: import("effect/Schema").String;
|
|
251
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
252
|
+
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
253
|
+
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
254
|
+
readonly referenceId: import("effect/Schema").String;
|
|
255
|
+
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
256
|
+
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
262
257
|
readonly createdAt: import("effect/Schema").Date;
|
|
263
258
|
readonly updatedAt: import("effect/Schema").Date;
|
|
259
|
+
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
260
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
264
261
|
}>>;
|
|
265
|
-
|
|
266
|
-
|
|
262
|
+
}>>, 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<{
|
|
263
|
+
readonly password: import("effect/Schema").NonEmptyString;
|
|
264
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
265
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
266
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never>, false>>;
|
package/dist/config.js
CHANGED
|
@@ -2,11 +2,15 @@ import { Config, Context, Effect, Layer, Redacted } from "effect";
|
|
|
2
2
|
export const normalizeBaseUrl = (value) => value.replace(/\/$/, "");
|
|
3
3
|
export const defaultBaseUrl = () => {
|
|
4
4
|
const env = globalThis.process?.env;
|
|
5
|
-
return normalizeBaseUrl(env?.
|
|
5
|
+
return normalizeBaseUrl(env?.KRAKSTACK_AUTH_URL ??
|
|
6
|
+
env?.VITE_KRAKSTACK_AUTH_URL ??
|
|
7
|
+
"http://localhost:3000");
|
|
6
8
|
};
|
|
7
9
|
export class AuthClientConfig extends Context.Service()("@krak-stack/auth/AuthClientConfig", {
|
|
8
10
|
make: (options = {}) => Effect.gen(function* () {
|
|
9
|
-
const baseUrl = options.baseUrl ??
|
|
11
|
+
const baseUrl = options.baseUrl ??
|
|
12
|
+
process.env.KRAKSTACK_AUTH_URL ??
|
|
13
|
+
(yield* Config.string("VITE_KRAKSTACK_AUTH_URL"));
|
|
10
14
|
const apiKey = options.apiKey ??
|
|
11
15
|
(yield* Config.redacted("KRAKSTACK_AUTH_SERVICE_API_KEY"));
|
|
12
16
|
return {
|
package/dist/server/api.d.ts
CHANGED
|
@@ -177,71 +177,38 @@ export declare const ServerDomainsApiGroup: HttpApiGroup.HttpApiGroup<"domains",
|
|
|
177
177
|
readonly name: import("effect/Schema").String;
|
|
178
178
|
readonly value: import("effect/Schema").String;
|
|
179
179
|
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never>, false>;
|
|
180
|
-
export declare const ServerApi: HttpApi.HttpApi<"ServerApi", HttpApiGroup.HttpApiGroup<"
|
|
181
|
-
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
182
|
-
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
183
|
-
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
184
|
-
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
185
|
-
readonly managed: import("effect/Schema").Boolean;
|
|
186
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
187
|
-
readonly id: import("effect/Schema").String;
|
|
188
|
-
readonly hostname: import("effect/Schema").String;
|
|
189
|
-
readonly rootHostname: import("effect/Schema").String;
|
|
190
|
-
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
191
|
-
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
192
|
-
readonly hostnameId: import("effect/Schema").String;
|
|
193
|
-
readonly managed: import("effect/Schema").Boolean;
|
|
194
|
-
readonly active: import("effect/Schema").Boolean;
|
|
195
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
196
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
197
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteDomain", "DELETE", "/api/domains/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
198
|
-
readonly id: import("effect/Schema").NonEmptyString;
|
|
199
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
200
|
-
readonly id: import("effect/Schema").String;
|
|
201
|
-
readonly hostname: import("effect/Schema").String;
|
|
202
|
-
readonly rootHostname: import("effect/Schema").String;
|
|
203
|
-
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
204
|
-
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
205
|
-
readonly hostnameId: import("effect/Schema").String;
|
|
206
|
-
readonly managed: import("effect/Schema").Boolean;
|
|
207
|
-
readonly active: import("effect/Schema").Boolean;
|
|
208
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
209
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
210
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomain", "GET", "/api/domains/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
180
|
+
export declare const ServerApi: HttpApi.HttpApi<"ServerApi", HttpApiGroup.HttpApiGroup<"users", HttpApiEndpoint.HttpApiEndpoint<"getUser", "GET", "/api/users/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
211
181
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
212
182
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
213
183
|
readonly id: import("effect/Schema").String;
|
|
214
|
-
readonly
|
|
215
|
-
readonly
|
|
216
|
-
readonly
|
|
217
|
-
readonly
|
|
218
|
-
readonly
|
|
219
|
-
readonly
|
|
220
|
-
readonly active: import("effect/Schema").Boolean;
|
|
184
|
+
readonly name: import("effect/Schema").String;
|
|
185
|
+
readonly email: import("effect/Schema").String;
|
|
186
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
187
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
188
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
189
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
221
190
|
readonly createdAt: import("effect/Schema").Date;
|
|
222
191
|
readonly updatedAt: import("effect/Schema").Date;
|
|
223
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
224
|
-
readonly
|
|
192
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getUserActiveOrganization", "GET", "/api/organizations/user/:userId/active", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
193
|
+
readonly userId: import("effect/Schema").NonEmptyString;
|
|
225
194
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
226
|
-
readonly id: import("effect/Schema").String
|
|
227
|
-
|
|
228
|
-
readonly
|
|
229
|
-
|
|
230
|
-
readonly
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
readonly
|
|
242
|
-
|
|
243
|
-
readonly value: import("effect/Schema").String;
|
|
244
|
-
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never>, false> | HttpApiGroup.HttpApiGroup<"organizations", HttpApiEndpoint.HttpApiEndpoint<"getActiveMember", "GET", "/api/organizations/:organizationId/members/:userId", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
195
|
+
readonly id: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
196
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listUsersByIds", "GET", "/api/users", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
197
|
+
readonly ids: import("effect/Schema").NonEmptyString;
|
|
198
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
199
|
+
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
200
|
+
readonly id: import("effect/Schema").String;
|
|
201
|
+
readonly name: import("effect/Schema").String;
|
|
202
|
+
readonly email: import("effect/Schema").String;
|
|
203
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
204
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
205
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
206
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
207
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
208
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
209
|
+
}>>;
|
|
210
|
+
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
211
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false> | HttpApiGroup.HttpApiGroup<"organizations", HttpApiEndpoint.HttpApiEndpoint<"getActiveMember", "GET", "/api/organizations/:organizationId/members/:userId", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
245
212
|
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
246
213
|
readonly userId: import("effect/Schema").NonEmptyString;
|
|
247
214
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
@@ -320,35 +287,68 @@ export declare const ServerApi: HttpApi.HttpApi<"ServerApi", HttpApiGroup.HttpAp
|
|
|
320
287
|
readonly createdAt: import("effect/Schema").Date;
|
|
321
288
|
}>>;
|
|
322
289
|
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
323
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false> | HttpApiGroup.HttpApiGroup<"
|
|
290
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false> | HttpApiGroup.HttpApiGroup<"domains", HttpApiEndpoint.HttpApiEndpoint<"createDomain", "POST", "/api/domains", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
291
|
+
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
292
|
+
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
293
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
294
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
295
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
296
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
297
|
+
readonly id: import("effect/Schema").String;
|
|
298
|
+
readonly hostname: import("effect/Schema").String;
|
|
299
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
300
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
301
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
302
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
303
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
304
|
+
readonly active: import("effect/Schema").Boolean;
|
|
305
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
306
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
307
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteDomain", "DELETE", "/api/domains/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
308
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
309
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
310
|
+
readonly id: import("effect/Schema").String;
|
|
311
|
+
readonly hostname: import("effect/Schema").String;
|
|
312
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
313
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
314
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
315
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
316
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
317
|
+
readonly active: import("effect/Schema").Boolean;
|
|
318
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
319
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
320
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomain", "GET", "/api/domains/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
324
321
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
325
322
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
326
323
|
readonly id: import("effect/Schema").String;
|
|
327
|
-
readonly
|
|
328
|
-
readonly
|
|
329
|
-
readonly
|
|
330
|
-
readonly
|
|
331
|
-
readonly
|
|
332
|
-
readonly
|
|
324
|
+
readonly hostname: import("effect/Schema").String;
|
|
325
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
326
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
327
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
328
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
329
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
330
|
+
readonly active: import("effect/Schema").Boolean;
|
|
333
331
|
readonly createdAt: import("effect/Schema").Date;
|
|
334
332
|
readonly updatedAt: import("effect/Schema").Date;
|
|
335
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
336
|
-
readonly
|
|
333
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainByHost", "GET", "/api/domains/by-host/:hostname", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
334
|
+
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
337
335
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
338
|
-
readonly id: import("effect/Schema").
|
|
339
|
-
|
|
340
|
-
readonly
|
|
341
|
-
|
|
342
|
-
readonly
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
readonly
|
|
354
|
-
|
|
336
|
+
readonly id: import("effect/Schema").String;
|
|
337
|
+
readonly hostname: import("effect/Schema").String;
|
|
338
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
339
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
340
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
341
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
342
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
343
|
+
readonly active: import("effect/Schema").Boolean;
|
|
344
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
345
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
346
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainRecords", "GET", "/api/domains/:id/records", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
347
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
348
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
349
|
+
readonly required: import("effect/Schema").Boolean;
|
|
350
|
+
readonly status: import("effect/Schema").String;
|
|
351
|
+
readonly type: import("effect/Schema").String;
|
|
352
|
+
readonly name: import("effect/Schema").String;
|
|
353
|
+
readonly value: import("effect/Schema").String;
|
|
354
|
+
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never>, false>>;
|
package/dist/server/proxy.js
CHANGED
|
@@ -12,9 +12,24 @@ 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
|
+
const forwardedUrl = (request) => {
|
|
26
|
+
return (parseUrl(request.headers.get("origin")) ??
|
|
27
|
+
parseUrl(request.headers.get("referer")) ??
|
|
28
|
+
new URL(request.url));
|
|
29
|
+
};
|
|
15
30
|
const proxyHeaders = (request) => {
|
|
16
31
|
const headers = new Headers(request.headers);
|
|
17
|
-
const url =
|
|
32
|
+
const url = forwardedUrl(request);
|
|
18
33
|
for (const header of blockedRequestHeaders)
|
|
19
34
|
headers.delete(header);
|
|
20
35
|
for (const header of Array.from(headers.keys())) {
|
package/dist/service.js
CHANGED
|
@@ -6,12 +6,18 @@ import { AuthClientConfig } from "./config";
|
|
|
6
6
|
const forwardedAuthHeaderNames = [
|
|
7
7
|
"accept-language",
|
|
8
8
|
"cookie",
|
|
9
|
+
"origin",
|
|
10
|
+
"referer",
|
|
9
11
|
"user-agent",
|
|
10
12
|
];
|
|
11
13
|
const forwardedAuthHeaders = (headers) => {
|
|
14
|
+
const normalizedHeaders = {};
|
|
12
15
|
const forwarded = {};
|
|
16
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
17
|
+
normalizedHeaders[key.toLowerCase()] = value;
|
|
18
|
+
}
|
|
13
19
|
for (const name of forwardedAuthHeaderNames) {
|
|
14
|
-
const value =
|
|
20
|
+
const value = normalizedHeaders[name];
|
|
15
21
|
if (value)
|
|
16
22
|
forwarded[name] = value;
|
|
17
23
|
}
|