@krak-stack/auth 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access.d.ts +1 -3
- package/dist/access.js +1 -3
- package/dist/admin/api.group.d.ts +36 -36
- package/dist/admin/api.group.js +13 -13
- package/dist/api.d.ts +837 -837
- package/dist/auth/api.group.d.ts +86 -86
- package/dist/auth/api.group.js +8 -8
- package/dist/auth/schema.d.ts +48 -40
- package/dist/auth/schema.js +12 -9
- package/dist/components/admin-organization-form.js +1 -0
- package/dist/components/admin-organizations.d.ts +4 -5
- package/dist/components/admin-organizations.js +34 -31
- package/dist/components/admin-users.d.ts +5 -6
- package/dist/components/admin-users.js +51 -50
- package/dist/components/api-key-edit-form.js +2 -1
- package/dist/components/auth-atoms.d.ts +103 -103
- package/dist/components/auth-client-api.d.ts +834 -2351
- package/dist/components/auth-client-api.js +11 -7
- package/dist/components/auth-forms.js +6 -1
- package/dist/components/auth-provider.d.ts +13 -13
- package/dist/components/member-required.js +2 -2
- package/dist/components/organization-switcher.js +72 -69
- package/dist/components/user-button.js +31 -26
- package/dist/extra/api.group.d.ts +19 -19
- package/dist/extra/api.group.js +3 -3
- package/dist/extra/schema.d.ts +1 -2
- package/dist/extra/schema.js +1 -2
- package/dist/query.js +5 -5
- package/dist/server/api.group.d.ts +29 -29
- package/dist/server/api.group.js +12 -12
- package/dist/service.d.ts +1513 -1951
- package/package.json +4 -4
|
@@ -3,19 +3,19 @@ import { HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/unstable/htt
|
|
|
3
3
|
import { ExtraBadRequest } from "./schema.js";
|
|
4
4
|
export * from "./schema.js";
|
|
5
5
|
export type { Organization, OrganizationMetadata } from "../schema.js";
|
|
6
|
-
export declare const ExtraApiGroup: HttpApiGroup.HttpApiGroup<"authExtra", HttpApiEndpoint.HttpApiEndpoint<"createApiKey", "POST", "/auth/create-api-key",
|
|
6
|
+
export declare const ExtraApiGroup: HttpApiGroup.HttpApiGroup<"authExtra", HttpApiEndpoint.HttpApiEndpoint<"createApiKey", "POST", "/auth/create-api-key", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
7
7
|
readonly configId: Schema.Union<readonly [Schema.Literal<"user">, Schema.Literal<"organization">, Schema.Literal<"service">]>;
|
|
8
8
|
readonly name: Schema.optional<Schema.NonEmptyString>;
|
|
9
9
|
readonly organizationId: Schema.optional<Schema.String>;
|
|
10
10
|
readonly permissions: Schema.optional<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
11
11
|
readonly referrers: Schema.optional<Schema.$Array<Schema.String>>;
|
|
12
|
-
}>>,
|
|
12
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
13
13
|
readonly id: Schema.String;
|
|
14
14
|
readonly key: Schema.String;
|
|
15
|
-
}>>,
|
|
15
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganizationPublicProfile", "GET", "/auth/organization-profile", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
16
16
|
readonly organizationId: Schema.String;
|
|
17
17
|
readonly locale: Schema.optional<Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>>;
|
|
18
|
-
}>>,
|
|
18
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
19
19
|
readonly id: Schema.String;
|
|
20
20
|
readonly name: Schema.String;
|
|
21
21
|
readonly slug: Schema.String;
|
|
@@ -65,12 +65,12 @@ export declare const ExtraApiGroup: HttpApiGroup.HttpApiGroup<"authExtra", HttpA
|
|
|
65
65
|
}>>>;
|
|
66
66
|
readonly logo: Schema.NullOr<Schema.String>;
|
|
67
67
|
readonly icon: Schema.NullOr<Schema.String>;
|
|
68
|
-
}>>,
|
|
68
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getProjectPublicConfig", "GET", "/auth/project-config", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
69
69
|
readonly projectId: Schema.optional<Schema.String>;
|
|
70
70
|
readonly clientId: Schema.optional<Schema.String>;
|
|
71
71
|
readonly host: Schema.optional<Schema.String>;
|
|
72
72
|
readonly rootHost: Schema.optional<Schema.String>;
|
|
73
|
-
}>>,
|
|
73
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
74
74
|
readonly projectKey: Schema.String;
|
|
75
75
|
readonly name: Schema.NullOr<Schema.String>;
|
|
76
76
|
readonly logoUrl: Schema.NullOr<Schema.String>;
|
|
@@ -82,28 +82,28 @@ export declare const ExtraApiGroup: HttpApiGroup.HttpApiGroup<"authExtra", HttpA
|
|
|
82
82
|
readonly emailOtp: Schema.Boolean;
|
|
83
83
|
readonly google: Schema.Boolean;
|
|
84
84
|
}>;
|
|
85
|
-
}>>,
|
|
85
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"setPassword", "POST", "/auth/set-password", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
86
86
|
readonly newPassword: Schema.NonEmptyString;
|
|
87
|
-
}>>,
|
|
87
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
88
88
|
readonly ok: Schema.Boolean;
|
|
89
|
-
}>>,
|
|
90
|
-
|
|
91
|
-
}>>,
|
|
89
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateApiKey", "PATCH", "/auth/api-key/:keyId", Schema.toCodecStringTree<Schema.Struct<{
|
|
90
|
+
keyId: Schema.NonEmptyString;
|
|
91
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
92
92
|
readonly configId: Schema.Union<readonly [Schema.Literal<"user">, Schema.Literal<"organization">, Schema.Literal<"service">]>;
|
|
93
93
|
readonly name: Schema.NonEmptyString;
|
|
94
94
|
readonly enabled: Schema.Boolean;
|
|
95
95
|
readonly permissions: Schema.optional<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
96
96
|
readonly referrers: Schema.optional<Schema.$Array<Schema.String>>;
|
|
97
|
-
}>>,
|
|
97
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
98
98
|
readonly ok: Schema.Boolean;
|
|
99
|
-
}>>,
|
|
99
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"uploadUserImage", "POST", "/auth/image/upload", never, never, Schema.toCodecJson<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<Schema.Struct<{
|
|
100
100
|
readonly file: Schema.decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, Schema.$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
101
|
-
}>>>,
|
|
101
|
+
}>>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
102
102
|
readonly url: Schema.String;
|
|
103
|
-
}>>,
|
|
103
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"verifyApiKey", "POST", "/auth/verify-api-key", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
104
104
|
readonly key: Schema.NonEmptyString;
|
|
105
105
|
readonly configId: Schema.optional<Schema.Union<readonly [Schema.Literal<"user">, Schema.Literal<"organization">, Schema.Literal<"service">]>>;
|
|
106
|
-
}>>,
|
|
106
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
107
107
|
readonly valid: Schema.Boolean;
|
|
108
108
|
readonly error: Schema.NullOr<Schema.Struct<{
|
|
109
109
|
readonly message: Schema.String;
|
|
@@ -123,8 +123,8 @@ export declare const ExtraApiGroup: HttpApiGroup.HttpApiGroup<"authExtra", HttpA
|
|
|
123
123
|
readonly permissions: Schema.NullOr<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
124
124
|
readonly metadata: Schema.NullOr<Schema.Unknown>;
|
|
125
125
|
}>>;
|
|
126
|
-
}>>,
|
|
126
|
+
}>>, Schema.toCodecJson<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"verifyPassword", "POST", "/auth/verify-password", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
127
127
|
readonly password: Schema.NonEmptyString;
|
|
128
|
-
}>>,
|
|
128
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
129
129
|
readonly ok: Schema.Boolean;
|
|
130
|
-
}>>,
|
|
130
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never>, false>;
|
package/dist/extra/api.group.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ExtraBadRequest, ExtraCreateApiKeyPayload, ExtraCreateApiKeyResponse, E
|
|
|
5
5
|
export * from "./schema.js";
|
|
6
6
|
export const ExtraApiGroup = HttpApiGroup.make("authExtra")
|
|
7
7
|
.add(HttpApiEndpoint.get("getProjectPublicConfig", "/auth/project-config", {
|
|
8
|
-
query: ExtraProjectPublicConfigQuery,
|
|
8
|
+
query: ExtraProjectPublicConfigQuery.fields,
|
|
9
9
|
success: ExtraProjectPublicConfig,
|
|
10
10
|
error: [HttpApiError.InternalServerError],
|
|
11
11
|
}).annotateMerge(OpenApi.annotations({
|
|
@@ -14,7 +14,7 @@ export const ExtraApiGroup = HttpApiGroup.make("authExtra")
|
|
|
14
14
|
description: "Returns resolved public branding and authentication options through the proxied auth API.",
|
|
15
15
|
})))
|
|
16
16
|
.add(HttpApiEndpoint.patch("updateApiKey", "/auth/api-key/:keyId", {
|
|
17
|
-
params:
|
|
17
|
+
params: { keyId: Schema.NonEmptyString },
|
|
18
18
|
payload: Schema.Struct({
|
|
19
19
|
configId: ExtraUpdateApiKeyPayload.fields.configId,
|
|
20
20
|
name: ExtraUpdateApiKeyPayload.fields.name,
|
|
@@ -35,7 +35,7 @@ export const ExtraApiGroup = HttpApiGroup.make("authExtra")
|
|
|
35
35
|
description: "Updates API key details and server-only permissions after verifying user ownership or organization key-management access.",
|
|
36
36
|
})))
|
|
37
37
|
.add(HttpApiEndpoint.get("getOrganizationPublicProfile", "/auth/organization-profile", {
|
|
38
|
-
query: ExtraOrganizationPublicProfileQuery,
|
|
38
|
+
query: ExtraOrganizationPublicProfileQuery.fields,
|
|
39
39
|
success: ExtraOrganizationPublicProfile,
|
|
40
40
|
error: [HttpApiError.NotFound, HttpApiError.InternalServerError],
|
|
41
41
|
}).annotateMerge(OpenApi.annotations({
|
package/dist/extra/schema.d.ts
CHANGED
|
@@ -162,8 +162,7 @@ export declare const ExtraOkResponse: Schema.Struct<{
|
|
|
162
162
|
export declare const ExtraUploadedAsset: Schema.Struct<{
|
|
163
163
|
readonly url: Schema.String;
|
|
164
164
|
}>;
|
|
165
|
-
declare const ExtraBadRequest_base: Schema.Class<ExtraBadRequest, Schema.
|
|
166
|
-
readonly _tag: Schema.tag<"ExtraBadRequest">;
|
|
165
|
+
declare const ExtraBadRequest_base: Schema.Class<ExtraBadRequest, Schema.TaggedStruct<"ExtraBadRequest", {
|
|
167
166
|
readonly message: Schema.String;
|
|
168
167
|
}>, import("effect/Cause").YieldableError>;
|
|
169
168
|
export declare class ExtraBadRequest extends ExtraBadRequest_base {
|
package/dist/extra/schema.js
CHANGED
|
@@ -283,8 +283,7 @@ export const ExtraUploadedAsset = Schema.Struct({
|
|
|
283
283
|
},
|
|
284
284
|
],
|
|
285
285
|
});
|
|
286
|
-
export class ExtraBadRequest extends Schema.
|
|
287
|
-
_tag: Schema.tag("ExtraBadRequest"),
|
|
286
|
+
export class ExtraBadRequest extends Schema.TaggedError()("ExtraBadRequest", {
|
|
288
287
|
message: Schema.String,
|
|
289
288
|
}, {
|
|
290
289
|
identifier: "ExtraBadRequest",
|
package/dist/query.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect,
|
|
1
|
+
import { Effect, Schema, SchemaIssue, SchemaTransformation } from "effect";
|
|
2
2
|
const parseSortParam = (sort) => {
|
|
3
3
|
const id = sort.startsWith("-") ? sort.slice(1) : sort;
|
|
4
4
|
if (!id || id.includes(",") || id.includes(":")) {
|
|
@@ -28,9 +28,9 @@ export const SortParamFromString = Schema.String.pipe(Schema.decodeTo(SortParam,
|
|
|
28
28
|
decode: (sort) => {
|
|
29
29
|
const sortParam = parseSortParam(sort);
|
|
30
30
|
if (!sortParam) {
|
|
31
|
-
return Effect.fail(new SchemaIssue.InvalidValue(
|
|
31
|
+
return Effect.fail(new SchemaIssue.InvalidValue({
|
|
32
32
|
message: 'Expected sort in the format "field" or "-field"',
|
|
33
|
-
}));
|
|
33
|
+
}, sort));
|
|
34
34
|
}
|
|
35
35
|
return Effect.succeed(sortParam);
|
|
36
36
|
},
|
|
@@ -48,9 +48,9 @@ export const SortParamsFromString = Schema.String.pipe(Schema.decodeTo(Schema.Ar
|
|
|
48
48
|
for (const part of parts) {
|
|
49
49
|
const sortParam = parseSortParam(part);
|
|
50
50
|
if (!sortParam) {
|
|
51
|
-
return Effect.fail(new SchemaIssue.InvalidValue(
|
|
51
|
+
return Effect.fail(new SchemaIssue.InvalidValue({
|
|
52
52
|
message: 'Expected sort in the format "field,-otherField"',
|
|
53
|
-
}));
|
|
53
|
+
}, sort));
|
|
54
54
|
}
|
|
55
55
|
sortParams.push(sortParam);
|
|
56
56
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/unstable/httpapi";
|
|
2
|
-
export declare const ServerUsersApiGroup: HttpApiGroup.HttpApiGroup<"users", HttpApiEndpoint.HttpApiEndpoint<"getUser", "GET", "/users/:id",
|
|
2
|
+
export declare const ServerUsersApiGroup: HttpApiGroup.HttpApiGroup<"users", HttpApiEndpoint.HttpApiEndpoint<"getUser", "GET", "/users/:id", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
3
3
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
4
|
-
}>>,
|
|
4
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
5
5
|
readonly id: import("effect/Schema").String;
|
|
6
6
|
readonly name: import("effect/Schema").String;
|
|
7
7
|
readonly email: import("effect/Schema").String;
|
|
@@ -12,13 +12,13 @@ export declare const ServerUsersApiGroup: HttpApiGroup.HttpApiGroup<"users", Htt
|
|
|
12
12
|
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
13
13
|
readonly createdAt: import("effect/Schema").Date;
|
|
14
14
|
readonly updatedAt: import("effect/Schema").Date;
|
|
15
|
-
}>>,
|
|
15
|
+
}>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getUserActiveOrganization", "GET", "/organizations/user/:userId/active", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
16
16
|
readonly userId: import("effect/Schema").NonEmptyString;
|
|
17
|
-
}>>,
|
|
17
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
18
18
|
readonly id: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
19
|
-
}>>,
|
|
19
|
+
}>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listUsersByIds", "GET", "/users", never, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
20
20
|
readonly ids: import("effect/Schema").NonEmptyString;
|
|
21
|
-
}>>,
|
|
21
|
+
}>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
22
22
|
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
23
23
|
readonly id: import("effect/Schema").String;
|
|
24
24
|
readonly name: import("effect/Schema").String;
|
|
@@ -32,11 +32,11 @@ export declare const ServerUsersApiGroup: HttpApiGroup.HttpApiGroup<"users", Htt
|
|
|
32
32
|
readonly updatedAt: import("effect/Schema").Date;
|
|
33
33
|
}>>;
|
|
34
34
|
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
35
|
-
}>>,
|
|
36
|
-
export declare const ServerOrganizationsApiGroup: HttpApiGroup.HttpApiGroup<"organizations", HttpApiEndpoint.HttpApiEndpoint<"getActiveMember", "GET", "/organizations/:organizationId/members/:userId",
|
|
35
|
+
}>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false>;
|
|
36
|
+
export declare const ServerOrganizationsApiGroup: HttpApiGroup.HttpApiGroup<"organizations", HttpApiEndpoint.HttpApiEndpoint<"getActiveMember", "GET", "/organizations/:organizationId/members/:userId", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
37
37
|
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
38
38
|
readonly userId: import("effect/Schema").NonEmptyString;
|
|
39
|
-
}>>,
|
|
39
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
40
40
|
readonly id: import("effect/Schema").String;
|
|
41
41
|
readonly organizationId: import("effect/Schema").String;
|
|
42
42
|
readonly userId: import("effect/Schema").String;
|
|
@@ -54,9 +54,9 @@ export declare const ServerOrganizationsApiGroup: HttpApiGroup.HttpApiGroup<"org
|
|
|
54
54
|
readonly createdAt: import("effect/Schema").Date;
|
|
55
55
|
readonly updatedAt: import("effect/Schema").Date;
|
|
56
56
|
}>;
|
|
57
|
-
}>>,
|
|
57
|
+
}>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganization", "GET", "/organizations/:id", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
58
58
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
59
|
-
}>>,
|
|
59
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
60
60
|
readonly id: import("effect/Schema").String;
|
|
61
61
|
readonly name: import("effect/Schema").String;
|
|
62
62
|
readonly slug: import("effect/Schema").String;
|
|
@@ -114,9 +114,9 @@ export declare const ServerOrganizationsApiGroup: HttpApiGroup.HttpApiGroup<"org
|
|
|
114
114
|
}>, import("effect/Schema").Unknown, never, never>>;
|
|
115
115
|
readonly parentId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
116
116
|
readonly createdAt: import("effect/Schema").Date;
|
|
117
|
-
}>>,
|
|
117
|
+
}>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganizationChildren", "GET", "/organizations/:organizationId/children", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
118
118
|
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
119
|
-
}>>,
|
|
119
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
120
120
|
readonly id: import("effect/Schema").String;
|
|
121
121
|
readonly name: import("effect/Schema").String;
|
|
122
122
|
readonly slug: import("effect/Schema").String;
|
|
@@ -174,9 +174,9 @@ export declare const ServerOrganizationsApiGroup: HttpApiGroup.HttpApiGroup<"org
|
|
|
174
174
|
}>, import("effect/Schema").Unknown, never, never>>;
|
|
175
175
|
readonly parentId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
176
176
|
readonly createdAt: import("effect/Schema").Date;
|
|
177
|
-
}>>>,
|
|
177
|
+
}>>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizationMembers", "GET", "/organizations/:organizationId/members", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
178
178
|
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
179
|
-
}>>,
|
|
179
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
180
180
|
readonly id: import("effect/Schema").String;
|
|
181
181
|
readonly organizationId: import("effect/Schema").String;
|
|
182
182
|
readonly userId: import("effect/Schema").String;
|
|
@@ -194,10 +194,10 @@ export declare const ServerOrganizationsApiGroup: HttpApiGroup.HttpApiGroup<"org
|
|
|
194
194
|
readonly createdAt: import("effect/Schema").Date;
|
|
195
195
|
readonly updatedAt: import("effect/Schema").Date;
|
|
196
196
|
}>;
|
|
197
|
-
}>>>,
|
|
197
|
+
}>>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizations", "GET", "/organizations", never, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
198
198
|
readonly ids: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
199
199
|
readonly userId: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
200
|
-
}>>,
|
|
200
|
+
}>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
201
201
|
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
202
202
|
readonly id: import("effect/Schema").String;
|
|
203
203
|
readonly name: import("effect/Schema").String;
|
|
@@ -258,14 +258,14 @@ export declare const ServerOrganizationsApiGroup: HttpApiGroup.HttpApiGroup<"org
|
|
|
258
258
|
readonly createdAt: import("effect/Schema").Date;
|
|
259
259
|
}>>;
|
|
260
260
|
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
261
|
-
}>>,
|
|
262
|
-
export declare const ServerDomainsApiGroup: HttpApiGroup.HttpApiGroup<"domains", HttpApiEndpoint.HttpApiEndpoint<"createDomain", "POST", "/domains",
|
|
261
|
+
}>>, import("effect/Schema").toCodecJson<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false>;
|
|
262
|
+
export declare const ServerDomainsApiGroup: HttpApiGroup.HttpApiGroup<"domains", HttpApiEndpoint.HttpApiEndpoint<"createDomain", "POST", "/domains", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
263
263
|
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
264
264
|
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
265
265
|
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
266
266
|
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
267
267
|
readonly managed: import("effect/Schema").Boolean;
|
|
268
|
-
}>>,
|
|
268
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
269
269
|
readonly id: import("effect/Schema").String;
|
|
270
270
|
readonly hostname: import("effect/Schema").String;
|
|
271
271
|
readonly rootHostname: import("effect/Schema").String;
|
|
@@ -280,9 +280,9 @@ export declare const ServerDomainsApiGroup: HttpApiGroup.HttpApiGroup<"domains",
|
|
|
280
280
|
readonly active: import("effect/Schema").Boolean;
|
|
281
281
|
readonly createdAt: import("effect/Schema").Date;
|
|
282
282
|
readonly updatedAt: import("effect/Schema").Date;
|
|
283
|
-
}>>,
|
|
283
|
+
}>>, import("effect/Schema").toCodecJson<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteDomain", "DELETE", "/domains/:id", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
284
284
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
285
|
-
}>>,
|
|
285
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
286
286
|
readonly id: import("effect/Schema").String;
|
|
287
287
|
readonly hostname: import("effect/Schema").String;
|
|
288
288
|
readonly rootHostname: import("effect/Schema").String;
|
|
@@ -297,9 +297,9 @@ export declare const ServerDomainsApiGroup: HttpApiGroup.HttpApiGroup<"domains",
|
|
|
297
297
|
readonly active: import("effect/Schema").Boolean;
|
|
298
298
|
readonly createdAt: import("effect/Schema").Date;
|
|
299
299
|
readonly updatedAt: import("effect/Schema").Date;
|
|
300
|
-
}>>,
|
|
300
|
+
}>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomain", "GET", "/domains/:id", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
301
301
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
302
|
-
}>>,
|
|
302
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
303
303
|
readonly id: import("effect/Schema").String;
|
|
304
304
|
readonly hostname: import("effect/Schema").String;
|
|
305
305
|
readonly rootHostname: import("effect/Schema").String;
|
|
@@ -314,9 +314,9 @@ export declare const ServerDomainsApiGroup: HttpApiGroup.HttpApiGroup<"domains",
|
|
|
314
314
|
readonly active: import("effect/Schema").Boolean;
|
|
315
315
|
readonly createdAt: import("effect/Schema").Date;
|
|
316
316
|
readonly updatedAt: import("effect/Schema").Date;
|
|
317
|
-
}>>,
|
|
317
|
+
}>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainByHost", "GET", "/domains/by-host/:hostname", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
318
318
|
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
319
|
-
}>>,
|
|
319
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
320
320
|
readonly id: import("effect/Schema").String;
|
|
321
321
|
readonly hostname: import("effect/Schema").String;
|
|
322
322
|
readonly rootHostname: import("effect/Schema").String;
|
|
@@ -331,12 +331,12 @@ export declare const ServerDomainsApiGroup: HttpApiGroup.HttpApiGroup<"domains",
|
|
|
331
331
|
readonly active: import("effect/Schema").Boolean;
|
|
332
332
|
readonly createdAt: import("effect/Schema").Date;
|
|
333
333
|
readonly updatedAt: import("effect/Schema").Date;
|
|
334
|
-
}>>,
|
|
334
|
+
}>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainRecords", "GET", "/domains/:id/records", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
335
335
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
336
|
-
}>>,
|
|
336
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
337
337
|
readonly required: import("effect/Schema").Boolean;
|
|
338
338
|
readonly status: import("effect/Schema").String;
|
|
339
339
|
readonly type: import("effect/Schema").String;
|
|
340
340
|
readonly name: import("effect/Schema").String;
|
|
341
341
|
readonly value: import("effect/Schema").String;
|
|
342
|
-
}>>>,
|
|
342
|
+
}>>>, import("effect/Schema").toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never>, false>;
|
package/dist/server/api.group.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Member, Organization, User } from "../schema.js";
|
|
|
4
4
|
import { ServerActiveOrganization, ServerCreateDomainPayload, ServerDomain, ServerDomainHostParams, ServerDomainIdParams, ServerDomainRecordsResponse, ServerIdParams, ServerIdsQuery, ServerMemberParams, ServerMembersResponse, ServerOrganizationChildrenResponse, ServerOrganizationIdParams, ServerOrganizationsQuery, ServerOrganizationsResponse, ServerUserIdParams, ServerUsersResponse, } from "./schema.js";
|
|
5
5
|
export const ServerUsersApiGroup = HttpApiGroup.make("users")
|
|
6
6
|
.add(HttpApiEndpoint.get("listUsersByIds", "/users", {
|
|
7
|
-
query: ServerIdsQuery,
|
|
7
|
+
query: ServerIdsQuery.fields,
|
|
8
8
|
success: ServerUsersResponse,
|
|
9
9
|
error: [HttpApiError.Unauthorized, HttpApiError.InternalServerError],
|
|
10
10
|
}).annotateMerge(OpenApi.annotations({
|
|
@@ -13,7 +13,7 @@ export const ServerUsersApiGroup = HttpApiGroup.make("users")
|
|
|
13
13
|
description: "Returns trusted user records for a comma-separated list of IDs. Requires a service API key.",
|
|
14
14
|
})))
|
|
15
15
|
.add(HttpApiEndpoint.get("getUser", "/users/:id", {
|
|
16
|
-
params: ServerIdParams,
|
|
16
|
+
params: ServerIdParams.fields,
|
|
17
17
|
success: User,
|
|
18
18
|
error: [
|
|
19
19
|
HttpApiError.Unauthorized,
|
|
@@ -26,7 +26,7 @@ export const ServerUsersApiGroup = HttpApiGroup.make("users")
|
|
|
26
26
|
description: "Returns a trusted user record by ID. Requires a service API key.",
|
|
27
27
|
})))
|
|
28
28
|
.add(HttpApiEndpoint.get("getUserActiveOrganization", "/organizations/user/:userId/active", {
|
|
29
|
-
params: ServerUserIdParams,
|
|
29
|
+
params: ServerUserIdParams.fields,
|
|
30
30
|
success: ServerActiveOrganization,
|
|
31
31
|
error: [HttpApiError.Unauthorized, HttpApiError.InternalServerError],
|
|
32
32
|
}).annotateMerge(OpenApi.annotations({
|
|
@@ -40,7 +40,7 @@ export const ServerUsersApiGroup = HttpApiGroup.make("users")
|
|
|
40
40
|
}));
|
|
41
41
|
export const ServerOrganizationsApiGroup = HttpApiGroup.make("organizations")
|
|
42
42
|
.add(HttpApiEndpoint.get("listOrganizations", "/organizations", {
|
|
43
|
-
query: ServerOrganizationsQuery,
|
|
43
|
+
query: ServerOrganizationsQuery.fields,
|
|
44
44
|
success: ServerOrganizationsResponse,
|
|
45
45
|
error: [
|
|
46
46
|
HttpApiError.BadRequest,
|
|
@@ -53,7 +53,7 @@ export const ServerOrganizationsApiGroup = HttpApiGroup.make("organizations")
|
|
|
53
53
|
description: "Returns trusted organization records for either a comma-separated list of IDs or a user ID. Exactly one of ids or userId is required. Requires a service API key.",
|
|
54
54
|
})))
|
|
55
55
|
.add(HttpApiEndpoint.get("getOrganization", "/organizations/:id", {
|
|
56
|
-
params: ServerIdParams,
|
|
56
|
+
params: ServerIdParams.fields,
|
|
57
57
|
success: Organization,
|
|
58
58
|
error: [
|
|
59
59
|
HttpApiError.Unauthorized,
|
|
@@ -66,7 +66,7 @@ export const ServerOrganizationsApiGroup = HttpApiGroup.make("organizations")
|
|
|
66
66
|
description: "Returns a trusted organization record by ID. Requires a service API key.",
|
|
67
67
|
})))
|
|
68
68
|
.add(HttpApiEndpoint.get("getOrganizationChildren", "/organizations/:organizationId/children", {
|
|
69
|
-
params: ServerOrganizationIdParams,
|
|
69
|
+
params: ServerOrganizationIdParams.fields,
|
|
70
70
|
success: ServerOrganizationChildrenResponse,
|
|
71
71
|
error: [HttpApiError.Unauthorized, HttpApiError.InternalServerError],
|
|
72
72
|
}).annotateMerge(OpenApi.annotations({
|
|
@@ -75,7 +75,7 @@ export const ServerOrganizationsApiGroup = HttpApiGroup.make("organizations")
|
|
|
75
75
|
description: "Returns direct child organizations for a parent organization. Requires a service API key.",
|
|
76
76
|
})))
|
|
77
77
|
.add(HttpApiEndpoint.get("getActiveMember", "/organizations/:organizationId/members/:userId", {
|
|
78
|
-
params: ServerMemberParams,
|
|
78
|
+
params: ServerMemberParams.fields,
|
|
79
79
|
success: Member,
|
|
80
80
|
error: [
|
|
81
81
|
HttpApiError.Unauthorized,
|
|
@@ -88,7 +88,7 @@ export const ServerOrganizationsApiGroup = HttpApiGroup.make("organizations")
|
|
|
88
88
|
description: "Returns the member record and role for a user in an organization. Requires a service API key.",
|
|
89
89
|
})))
|
|
90
90
|
.add(HttpApiEndpoint.get("listOrganizationMembers", "/organizations/:organizationId/members", {
|
|
91
|
-
params: ServerOrganizationIdParams,
|
|
91
|
+
params: ServerOrganizationIdParams.fields,
|
|
92
92
|
success: ServerMembersResponse,
|
|
93
93
|
error: [HttpApiError.Unauthorized, HttpApiError.InternalServerError],
|
|
94
94
|
}).annotateMerge(OpenApi.annotations({
|
|
@@ -115,7 +115,7 @@ export const ServerDomainsApiGroup = HttpApiGroup.make("domains")
|
|
|
115
115
|
description: "Registers an auth hostname for a trusted service. Managed domains are provisioned in Cloudflare by auth; unmanaged domains are only registered for auth request resolution. Requires a service API key.",
|
|
116
116
|
})))
|
|
117
117
|
.add(HttpApiEndpoint.get("getDomain", "/domains/:id", {
|
|
118
|
-
params: ServerDomainIdParams,
|
|
118
|
+
params: ServerDomainIdParams.fields,
|
|
119
119
|
success: ServerDomain,
|
|
120
120
|
error: [
|
|
121
121
|
HttpApiError.Unauthorized,
|
|
@@ -124,7 +124,7 @@ export const ServerDomainsApiGroup = HttpApiGroup.make("domains")
|
|
|
124
124
|
],
|
|
125
125
|
}))
|
|
126
126
|
.add(HttpApiEndpoint.get("getDomainByHost", "/domains/by-host/:hostname", {
|
|
127
|
-
params: ServerDomainHostParams,
|
|
127
|
+
params: ServerDomainHostParams.fields,
|
|
128
128
|
success: ServerDomain,
|
|
129
129
|
error: [
|
|
130
130
|
HttpApiError.Unauthorized,
|
|
@@ -133,7 +133,7 @@ export const ServerDomainsApiGroup = HttpApiGroup.make("domains")
|
|
|
133
133
|
],
|
|
134
134
|
}))
|
|
135
135
|
.add(HttpApiEndpoint.get("getDomainRecords", "/domains/:id/records", {
|
|
136
|
-
params: ServerDomainIdParams,
|
|
136
|
+
params: ServerDomainIdParams.fields,
|
|
137
137
|
success: ServerDomainRecordsResponse,
|
|
138
138
|
error: [
|
|
139
139
|
HttpApiError.Unauthorized,
|
|
@@ -142,7 +142,7 @@ export const ServerDomainsApiGroup = HttpApiGroup.make("domains")
|
|
|
142
142
|
],
|
|
143
143
|
}))
|
|
144
144
|
.add(HttpApiEndpoint.delete("deleteDomain", "/domains/:id", {
|
|
145
|
-
params: ServerDomainIdParams,
|
|
145
|
+
params: ServerDomainIdParams.fields,
|
|
146
146
|
success: ServerDomain,
|
|
147
147
|
error: [
|
|
148
148
|
HttpApiError.Unauthorized,
|