@krak-stack/auth 0.1.2 → 0.1.4
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/README.md +18 -17
- package/dist/backend/api.d.ts +96 -8
- package/dist/backend/api.d.ts.map +1 -1
- package/dist/backend/api.js +43 -8
- package/dist/backend/api.js.map +1 -1
- package/dist/backend/index.d.ts +3 -185
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.js +1 -21
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/schema.d.ts +37 -0
- package/dist/backend/schema.d.ts.map +1 -1
- package/dist/backend/schema.js +48 -1
- package/dist/backend/schema.js.map +1 -1
- package/dist/client.d.ts +325 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +35 -0
- package/dist/client.js.map +1 -0
- package/dist/components/organization-switcher.d.ts.map +1 -1
- package/dist/components/organization-switcher.js +1 -1
- package/dist/components/organization-switcher.js.map +1 -1
- package/dist/components/user-button.js +1 -1
- package/dist/components/user-button.js.map +1 -1
- package/dist/frontend/api.d.ts +4 -46
- package/dist/frontend/api.d.ts.map +1 -1
- package/dist/frontend/api.js +2 -20
- package/dist/frontend/api.js.map +1 -1
- package/dist/frontend/index.d.ts +4 -125
- package/dist/frontend/index.d.ts.map +1 -1
- package/dist/frontend/index.js +3 -20
- package/dist/frontend/index.js.map +1 -1
- package/dist/frontend/schema.d.ts +0 -24
- package/dist/frontend/schema.d.ts.map +1 -1
- package/dist/frontend/schema.js +0 -22
- package/dist/frontend/schema.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/schema.d.ts +19 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +32 -0
- package/dist/schema.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -13,43 +13,44 @@ bun add @krak-stack/auth effect
|
|
|
13
13
|
- `VITE_KRAKSTACK_AUTH_URL` - KrakStack Auth origin
|
|
14
14
|
- `KRAKSTACK_AUTH_SERVICE_API_KEY` - service API key for server clients
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Auth Client
|
|
17
17
|
|
|
18
18
|
Users:
|
|
19
19
|
|
|
20
|
-
- `listUsersByIds({ query: { ids } })` - returns matching users and missing IDs for a comma-separated ID list.
|
|
21
|
-
- `getUser({ params: { id } })` - returns one user by ID.
|
|
20
|
+
- `backend.listUsersByIds({ query: { ids } })` - returns matching users and missing IDs for a comma-separated ID list.
|
|
21
|
+
- `backend.getUser({ params: { id } })` - returns one user by ID.
|
|
22
22
|
|
|
23
23
|
Organizations:
|
|
24
24
|
|
|
25
|
-
- `
|
|
26
|
-
- `
|
|
25
|
+
- `backend.listOrganizations({ query: { ids } })` - returns matching organizations and missing IDs for a comma-separated ID list.
|
|
26
|
+
- `backend.listOrganizations({ query: { userId } })` - returns organizations for one user.
|
|
27
|
+
- `backend.getOrganization({ params: { id } })` - returns one organization by ID.
|
|
28
|
+
- `backend.getUserActiveOrganization({ params: { userId } })` - returns the active organization ID for one user.
|
|
29
|
+
- `frontend.presignOrganizationLogoUpload({ payload })` - returns a presigned organization logo upload URL.
|
|
30
|
+
|
|
31
|
+
Members:
|
|
32
|
+
|
|
33
|
+
- `backend.getActiveMember({ params: { organizationId, userId } })` - returns one user's membership and role in an organization.
|
|
34
|
+
- `backend.listOrganizationMembers({ params: { organizationId } })` - returns organization members with user contact details.
|
|
27
35
|
|
|
28
36
|
```ts
|
|
29
37
|
import { Effect } from "effect";
|
|
30
|
-
import { AuthClient } from "@krak-stack/auth
|
|
38
|
+
import { AuthClient } from "@krak-stack/auth";
|
|
31
39
|
|
|
32
40
|
const users = await Effect.runPromise(
|
|
33
41
|
Effect.gen(function* () {
|
|
34
42
|
const client = yield* AuthClient;
|
|
35
|
-
return yield* client.listUsersByIds({
|
|
43
|
+
return yield* client.backend.listUsersByIds({
|
|
36
44
|
query: { ids: "user_1,user_2" },
|
|
37
45
|
});
|
|
38
46
|
}).pipe(Effect.provide(AuthClient.layer)),
|
|
39
47
|
);
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Frontend Auth API
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
import { Effect } from "effect";
|
|
46
|
-
import { AuthClient } from "@krak-stack/auth/frontend";
|
|
47
48
|
|
|
48
49
|
const organizations = await Effect.runPromise(
|
|
49
50
|
Effect.gen(function* () {
|
|
50
51
|
const client = yield* AuthClient;
|
|
51
|
-
return yield* client.
|
|
52
|
-
|
|
52
|
+
return yield* client.backend.listOrganizations({
|
|
53
|
+
query: { userId: "user_1" },
|
|
53
54
|
});
|
|
54
55
|
}).pipe(Effect.provide(AuthClient.layer)),
|
|
55
56
|
);
|
|
@@ -60,7 +61,7 @@ The frontend subpath also exports `FrontendApiClient` for Atom-based browser sta
|
|
|
60
61
|
## Components
|
|
61
62
|
|
|
62
63
|
```tsx
|
|
63
|
-
import { OrganizationSwitcher, UserButton } from "@krak-stack/auth
|
|
64
|
+
import { OrganizationSwitcher, UserButton } from "@krak-stack/auth";
|
|
64
65
|
|
|
65
66
|
<OrganizationSwitcher side="bottom" />
|
|
66
67
|
<UserButton signOutRedirect="/" side="bottom" />
|
package/dist/backend/api.d.ts
CHANGED
|
@@ -27,8 +27,13 @@ export declare const BackendApiGroup: HttpApiGroup.HttpApiGroup<"backend", HttpA
|
|
|
27
27
|
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
28
28
|
readonly createdAt: import("effect/Schema").Date;
|
|
29
29
|
readonly updatedAt: import("effect/Schema").Date;
|
|
30
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
31
|
-
readonly
|
|
30
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getUserActiveOrganization", "GET", "/organizations/user/:userId/active", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
31
|
+
readonly userId: import("effect/Schema").NonEmptyString;
|
|
32
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
33
|
+
readonly id: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
34
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizations", "GET", "/organizations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
35
|
+
readonly ids: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
36
|
+
readonly userId: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
32
37
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
33
38
|
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
34
39
|
readonly id: import("effect/Schema").String;
|
|
@@ -47,7 +52,7 @@ export declare const BackendApiGroup: HttpApiGroup.HttpApiGroup<"backend", HttpA
|
|
|
47
52
|
readonly createdAt: import("effect/Schema").Date;
|
|
48
53
|
}>>;
|
|
49
54
|
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
50
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganization", "GET", "/organizations/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
55
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.BadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganization", "GET", "/organizations/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
51
56
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
52
57
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
53
58
|
readonly id: import("effect/Schema").String;
|
|
@@ -64,7 +69,46 @@ export declare const BackendApiGroup: HttpApiGroup.HttpApiGroup<"backend", HttpA
|
|
|
64
69
|
}>>;
|
|
65
70
|
}>>;
|
|
66
71
|
readonly createdAt: import("effect/Schema").Date;
|
|
67
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never
|
|
72
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getActiveMember", "GET", "/organizations/:organizationId/members/:userId", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
73
|
+
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
74
|
+
readonly userId: import("effect/Schema").NonEmptyString;
|
|
75
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
76
|
+
readonly id: import("effect/Schema").String;
|
|
77
|
+
readonly organizationId: import("effect/Schema").String;
|
|
78
|
+
readonly userId: import("effect/Schema").String;
|
|
79
|
+
readonly role: import("effect/Schema").String;
|
|
80
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
81
|
+
readonly user: import("effect/Schema").Struct<{
|
|
82
|
+
readonly id: import("effect/Schema").String;
|
|
83
|
+
readonly name: import("effect/Schema").String;
|
|
84
|
+
readonly email: import("effect/Schema").String;
|
|
85
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
86
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
87
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
88
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
89
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
90
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
91
|
+
}>;
|
|
92
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizationMembers", "GET", "/organizations/:organizationId/members", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
93
|
+
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
94
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
95
|
+
readonly id: import("effect/Schema").String;
|
|
96
|
+
readonly organizationId: import("effect/Schema").String;
|
|
97
|
+
readonly userId: import("effect/Schema").String;
|
|
98
|
+
readonly role: import("effect/Schema").String;
|
|
99
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
100
|
+
readonly user: import("effect/Schema").Struct<{
|
|
101
|
+
readonly id: import("effect/Schema").String;
|
|
102
|
+
readonly name: import("effect/Schema").String;
|
|
103
|
+
readonly email: import("effect/Schema").String;
|
|
104
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
105
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
106
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
107
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
108
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
109
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
110
|
+
}>;
|
|
111
|
+
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false>;
|
|
68
112
|
export declare const BackendApi: HttpApi.HttpApi<"BackendApi", HttpApiGroup.HttpApiGroup<"backend", HttpApiEndpoint.HttpApiEndpoint<"listUsersByIds", "GET", "/api/users", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
69
113
|
readonly ids: import("effect/Schema").NonEmptyString;
|
|
70
114
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
@@ -92,8 +136,13 @@ export declare const BackendApi: HttpApi.HttpApi<"BackendApi", HttpApiGroup.Http
|
|
|
92
136
|
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
93
137
|
readonly createdAt: import("effect/Schema").Date;
|
|
94
138
|
readonly updatedAt: import("effect/Schema").Date;
|
|
95
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
96
|
-
readonly
|
|
139
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getUserActiveOrganization", "GET", "/api/organizations/user/:userId/active", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
140
|
+
readonly userId: import("effect/Schema").NonEmptyString;
|
|
141
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
142
|
+
readonly id: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
143
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizations", "GET", "/api/organizations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
144
|
+
readonly ids: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
145
|
+
readonly userId: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
97
146
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
98
147
|
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
99
148
|
readonly id: import("effect/Schema").String;
|
|
@@ -112,7 +161,7 @@ export declare const BackendApi: HttpApi.HttpApi<"BackendApi", HttpApiGroup.Http
|
|
|
112
161
|
readonly createdAt: import("effect/Schema").Date;
|
|
113
162
|
}>>;
|
|
114
163
|
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
115
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganization", "GET", "/api/organizations/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
164
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.BadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganization", "GET", "/api/organizations/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
116
165
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
117
166
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
118
167
|
readonly id: import("effect/Schema").String;
|
|
@@ -129,5 +178,44 @@ export declare const BackendApi: HttpApi.HttpApi<"BackendApi", HttpApiGroup.Http
|
|
|
129
178
|
}>>;
|
|
130
179
|
}>>;
|
|
131
180
|
readonly createdAt: import("effect/Schema").Date;
|
|
132
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never
|
|
181
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getActiveMember", "GET", "/api/organizations/:organizationId/members/:userId", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
182
|
+
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
183
|
+
readonly userId: import("effect/Schema").NonEmptyString;
|
|
184
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
185
|
+
readonly id: import("effect/Schema").String;
|
|
186
|
+
readonly organizationId: import("effect/Schema").String;
|
|
187
|
+
readonly userId: import("effect/Schema").String;
|
|
188
|
+
readonly role: import("effect/Schema").String;
|
|
189
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
190
|
+
readonly user: import("effect/Schema").Struct<{
|
|
191
|
+
readonly id: import("effect/Schema").String;
|
|
192
|
+
readonly name: import("effect/Schema").String;
|
|
193
|
+
readonly email: import("effect/Schema").String;
|
|
194
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
195
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
196
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
197
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
198
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
199
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
200
|
+
}>;
|
|
201
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizationMembers", "GET", "/api/organizations/:organizationId/members", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
202
|
+
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
203
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
204
|
+
readonly id: import("effect/Schema").String;
|
|
205
|
+
readonly organizationId: import("effect/Schema").String;
|
|
206
|
+
readonly userId: import("effect/Schema").String;
|
|
207
|
+
readonly role: import("effect/Schema").String;
|
|
208
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
209
|
+
readonly user: import("effect/Schema").Struct<{
|
|
210
|
+
readonly id: import("effect/Schema").String;
|
|
211
|
+
readonly name: import("effect/Schema").String;
|
|
212
|
+
readonly email: import("effect/Schema").String;
|
|
213
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
214
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
215
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
216
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
217
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
218
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
219
|
+
}>;
|
|
220
|
+
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false>>;
|
|
133
221
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/backend/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,EACb,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/backend/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,EACb,MAAM,yBAAyB,CAAC;AAgBjC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6HAqIzB,CAAC;AAEJ,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8HAEN,CAAC"}
|
package/dist/backend/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpApi, OpenApi } from "effect/unstable/httpapi";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiError, HttpApiGroup, } from "effect/unstable/httpapi";
|
|
3
|
-
import { Organization, User } from "../schema";
|
|
4
|
-
import { BackendIdParams, BackendIdsQuery, BackendOrganizationsResponse, BackendUsersResponse, } from "./schema";
|
|
3
|
+
import { Member, Organization, User } from "../schema";
|
|
4
|
+
import { BackendActiveOrganization, BackendIdParams, BackendIdsQuery, BackendMemberParams, BackendMembersResponse, BackendOrganizationIdParams, BackendOrganizationsQuery, BackendOrganizationsResponse, BackendUserIdParams, BackendUsersResponse, } from "./schema";
|
|
5
5
|
export const BackendApiGroup = HttpApiGroup.make("backend")
|
|
6
6
|
.add(HttpApiEndpoint.get("listUsersByIds", "/users", {
|
|
7
7
|
query: BackendIdsQuery,
|
|
@@ -25,14 +25,27 @@ export const BackendApiGroup = HttpApiGroup.make("backend")
|
|
|
25
25
|
summary: "Get a user by ID",
|
|
26
26
|
description: "Returns a trusted user record by ID. Requires a service API key.",
|
|
27
27
|
})))
|
|
28
|
-
.add(HttpApiEndpoint.get("
|
|
29
|
-
|
|
30
|
-
success:
|
|
28
|
+
.add(HttpApiEndpoint.get("getUserActiveOrganization", "/organizations/user/:userId/active", {
|
|
29
|
+
params: BackendUserIdParams,
|
|
30
|
+
success: BackendActiveOrganization,
|
|
31
31
|
error: [HttpApiError.Unauthorized, HttpApiError.InternalServerError],
|
|
32
32
|
}).annotateMerge(OpenApi.annotations({
|
|
33
|
-
title: "
|
|
34
|
-
summary: "
|
|
35
|
-
description: "Returns
|
|
33
|
+
title: "Get user active organization",
|
|
34
|
+
summary: "Get active organization for a user",
|
|
35
|
+
description: "Returns the active organization ID from the user's latest auth session. Requires a service API key.",
|
|
36
|
+
})))
|
|
37
|
+
.add(HttpApiEndpoint.get("listOrganizations", "/organizations", {
|
|
38
|
+
query: BackendOrganizationsQuery,
|
|
39
|
+
success: BackendOrganizationsResponse,
|
|
40
|
+
error: [
|
|
41
|
+
HttpApiError.BadRequest,
|
|
42
|
+
HttpApiError.Unauthorized,
|
|
43
|
+
HttpApiError.InternalServerError,
|
|
44
|
+
],
|
|
45
|
+
}).annotateMerge(OpenApi.annotations({
|
|
46
|
+
title: "List organizations",
|
|
47
|
+
summary: "List organizations by IDs or user ID",
|
|
48
|
+
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.",
|
|
36
49
|
})))
|
|
37
50
|
.add(HttpApiEndpoint.get("getOrganization", "/organizations/:id", {
|
|
38
51
|
params: BackendIdParams,
|
|
@@ -46,6 +59,28 @@ export const BackendApiGroup = HttpApiGroup.make("backend")
|
|
|
46
59
|
title: "Get organization",
|
|
47
60
|
summary: "Get an organization by ID",
|
|
48
61
|
description: "Returns a trusted organization record by ID. Requires a service API key.",
|
|
62
|
+
})))
|
|
63
|
+
.add(HttpApiEndpoint.get("getActiveMember", "/organizations/:organizationId/members/:userId", {
|
|
64
|
+
params: BackendMemberParams,
|
|
65
|
+
success: Member,
|
|
66
|
+
error: [
|
|
67
|
+
HttpApiError.Unauthorized,
|
|
68
|
+
HttpApiError.NotFound,
|
|
69
|
+
HttpApiError.InternalServerError,
|
|
70
|
+
],
|
|
71
|
+
}).annotateMerge(OpenApi.annotations({
|
|
72
|
+
title: "Get active member",
|
|
73
|
+
summary: "Get a user's current organization membership",
|
|
74
|
+
description: "Returns the member record and role for a user in an organization. Requires a service API key.",
|
|
75
|
+
})))
|
|
76
|
+
.add(HttpApiEndpoint.get("listOrganizationMembers", "/organizations/:organizationId/members", {
|
|
77
|
+
params: BackendOrganizationIdParams,
|
|
78
|
+
success: BackendMembersResponse,
|
|
79
|
+
error: [HttpApiError.Unauthorized, HttpApiError.InternalServerError],
|
|
80
|
+
}).annotateMerge(OpenApi.annotations({
|
|
81
|
+
title: "List organization members",
|
|
82
|
+
summary: "List organization members",
|
|
83
|
+
description: "Returns organization members with user contact details. Requires a service API key.",
|
|
49
84
|
})))
|
|
50
85
|
.annotateMerge(OpenApi.annotations({
|
|
51
86
|
title: "Backend",
|
package/dist/backend/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/backend/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,GACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/backend/api.ts"],"names":[],"mappings":"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"}
|
package/dist/backend/index.d.ts
CHANGED
|
@@ -1,187 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { HttpClient } from "effect/unstable/http";
|
|
3
|
-
import { HttpApiClient } from "effect/unstable/httpapi";
|
|
4
|
-
declare const AuthClientConfig_base: Context.ServiceClass<AuthClientConfig, "AuthClientConfig", {
|
|
5
|
-
baseUrl: string;
|
|
6
|
-
apiKey: Redacted.Redacted<string>;
|
|
7
|
-
}> & {
|
|
8
|
-
readonly make: Effect.Effect<{
|
|
9
|
-
baseUrl: string;
|
|
10
|
-
apiKey: Redacted.Redacted<string>;
|
|
11
|
-
}, import("effect/Config").ConfigError, never>;
|
|
12
|
-
};
|
|
13
|
-
export declare class AuthClientConfig extends AuthClientConfig_base {
|
|
14
|
-
static readonly layer: Layer.Layer<AuthClientConfig, import("effect/Config").ConfigError, never>;
|
|
15
|
-
}
|
|
16
|
-
declare const AuthClient_base: Context.ServiceClass<AuthClient, "AuthClient", {
|
|
17
|
-
readonly listUsersByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
18
|
-
readonly query: {
|
|
19
|
-
readonly ids: string;
|
|
20
|
-
};
|
|
21
|
-
readonly responseMode?: Mode;
|
|
22
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
23
|
-
readonly data: readonly {
|
|
24
|
-
readonly id: string;
|
|
25
|
-
readonly name: string;
|
|
26
|
-
readonly email: string;
|
|
27
|
-
readonly emailVerified: boolean;
|
|
28
|
-
readonly image: string | null;
|
|
29
|
-
readonly role: string | null;
|
|
30
|
-
readonly banned: boolean | null;
|
|
31
|
-
readonly createdAt: Date;
|
|
32
|
-
readonly updatedAt: Date;
|
|
33
|
-
}[];
|
|
34
|
-
readonly missingIds: readonly string[];
|
|
35
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
36
|
-
readonly getUser: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
37
|
-
readonly params: {
|
|
38
|
-
readonly id: string;
|
|
39
|
-
};
|
|
40
|
-
readonly responseMode?: Mode;
|
|
41
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
42
|
-
readonly id: string;
|
|
43
|
-
readonly name: string;
|
|
44
|
-
readonly email: string;
|
|
45
|
-
readonly emailVerified: boolean;
|
|
46
|
-
readonly image: string | null;
|
|
47
|
-
readonly role: string | null;
|
|
48
|
-
readonly banned: boolean | null;
|
|
49
|
-
readonly createdAt: Date;
|
|
50
|
-
readonly updatedAt: Date;
|
|
51
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError | import("effect/unstable/httpapi/HttpApiError").NotFound), [Mode] extends ["response-only"] ? never : never>;
|
|
52
|
-
readonly listOrganizationsByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
53
|
-
readonly query: {
|
|
54
|
-
readonly ids: string;
|
|
55
|
-
};
|
|
56
|
-
readonly responseMode?: Mode;
|
|
57
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
58
|
-
readonly data: readonly {
|
|
59
|
-
readonly id: string;
|
|
60
|
-
readonly name: string;
|
|
61
|
-
readonly slug: string;
|
|
62
|
-
readonly logo: string | null;
|
|
63
|
-
readonly metadata: {
|
|
64
|
-
readonly translations: readonly {
|
|
65
|
-
readonly locale: "en" | "fr";
|
|
66
|
-
readonly name: string;
|
|
67
|
-
readonly logo: string | null;
|
|
68
|
-
readonly contactEmail: string | null;
|
|
69
|
-
readonly location: string | null;
|
|
70
|
-
}[];
|
|
71
|
-
} | null;
|
|
72
|
-
readonly createdAt: Date;
|
|
73
|
-
}[];
|
|
74
|
-
readonly missingIds: readonly string[];
|
|
75
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
76
|
-
readonly getOrganization: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
77
|
-
readonly params: {
|
|
78
|
-
readonly id: string;
|
|
79
|
-
};
|
|
80
|
-
readonly responseMode?: Mode;
|
|
81
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
82
|
-
readonly id: string;
|
|
83
|
-
readonly name: string;
|
|
84
|
-
readonly slug: string;
|
|
85
|
-
readonly logo: string | null;
|
|
86
|
-
readonly metadata: {
|
|
87
|
-
readonly translations: readonly {
|
|
88
|
-
readonly locale: "en" | "fr";
|
|
89
|
-
readonly name: string;
|
|
90
|
-
readonly logo: string | null;
|
|
91
|
-
readonly contactEmail: string | null;
|
|
92
|
-
readonly location: string | null;
|
|
93
|
-
}[];
|
|
94
|
-
} | null;
|
|
95
|
-
readonly createdAt: Date;
|
|
96
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError | import("effect/unstable/httpapi/HttpApiError").NotFound), [Mode] extends ["response-only"] ? never : never>;
|
|
97
|
-
}> & {
|
|
98
|
-
readonly make: Effect.Effect<{
|
|
99
|
-
readonly listUsersByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
100
|
-
readonly query: {
|
|
101
|
-
readonly ids: string;
|
|
102
|
-
};
|
|
103
|
-
readonly responseMode?: Mode;
|
|
104
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
105
|
-
readonly data: readonly {
|
|
106
|
-
readonly id: string;
|
|
107
|
-
readonly name: string;
|
|
108
|
-
readonly email: string;
|
|
109
|
-
readonly emailVerified: boolean;
|
|
110
|
-
readonly image: string | null;
|
|
111
|
-
readonly role: string | null;
|
|
112
|
-
readonly banned: boolean | null;
|
|
113
|
-
readonly createdAt: Date;
|
|
114
|
-
readonly updatedAt: Date;
|
|
115
|
-
}[];
|
|
116
|
-
readonly missingIds: readonly string[];
|
|
117
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
118
|
-
readonly getUser: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
119
|
-
readonly params: {
|
|
120
|
-
readonly id: string;
|
|
121
|
-
};
|
|
122
|
-
readonly responseMode?: Mode;
|
|
123
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
124
|
-
readonly id: string;
|
|
125
|
-
readonly name: string;
|
|
126
|
-
readonly email: string;
|
|
127
|
-
readonly emailVerified: boolean;
|
|
128
|
-
readonly image: string | null;
|
|
129
|
-
readonly role: string | null;
|
|
130
|
-
readonly banned: boolean | null;
|
|
131
|
-
readonly createdAt: Date;
|
|
132
|
-
readonly updatedAt: Date;
|
|
133
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError | import("effect/unstable/httpapi/HttpApiError").NotFound), [Mode] extends ["response-only"] ? never : never>;
|
|
134
|
-
readonly listOrganizationsByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
135
|
-
readonly query: {
|
|
136
|
-
readonly ids: string;
|
|
137
|
-
};
|
|
138
|
-
readonly responseMode?: Mode;
|
|
139
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
140
|
-
readonly data: readonly {
|
|
141
|
-
readonly id: string;
|
|
142
|
-
readonly name: string;
|
|
143
|
-
readonly slug: string;
|
|
144
|
-
readonly logo: string | null;
|
|
145
|
-
readonly metadata: {
|
|
146
|
-
readonly translations: readonly {
|
|
147
|
-
readonly locale: "en" | "fr";
|
|
148
|
-
readonly name: string;
|
|
149
|
-
readonly logo: string | null;
|
|
150
|
-
readonly contactEmail: string | null;
|
|
151
|
-
readonly location: string | null;
|
|
152
|
-
}[];
|
|
153
|
-
} | null;
|
|
154
|
-
readonly createdAt: Date;
|
|
155
|
-
}[];
|
|
156
|
-
readonly missingIds: readonly string[];
|
|
157
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
158
|
-
readonly getOrganization: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
159
|
-
readonly params: {
|
|
160
|
-
readonly id: string;
|
|
161
|
-
};
|
|
162
|
-
readonly responseMode?: Mode;
|
|
163
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
164
|
-
readonly id: string;
|
|
165
|
-
readonly name: string;
|
|
166
|
-
readonly slug: string;
|
|
167
|
-
readonly logo: string | null;
|
|
168
|
-
readonly metadata: {
|
|
169
|
-
readonly translations: readonly {
|
|
170
|
-
readonly locale: "en" | "fr";
|
|
171
|
-
readonly name: string;
|
|
172
|
-
readonly logo: string | null;
|
|
173
|
-
readonly contactEmail: string | null;
|
|
174
|
-
readonly location: string | null;
|
|
175
|
-
}[];
|
|
176
|
-
} | null;
|
|
177
|
-
readonly createdAt: Date;
|
|
178
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError | import("effect/unstable/httpapi/HttpApiError").NotFound), [Mode] extends ["response-only"] ? never : never>;
|
|
179
|
-
}, never, AuthClientConfig | HttpClient.HttpClient>;
|
|
180
|
-
};
|
|
181
|
-
export declare class AuthClient extends AuthClient_base {
|
|
182
|
-
static readonly layer: Layer.Layer<AuthClient, import("effect/Config").ConfigError, never>;
|
|
183
|
-
}
|
|
1
|
+
export { AuthClient, AuthClientConfig } from "../client";
|
|
184
2
|
export { BackendApi, BackendApiGroup } from "./api";
|
|
185
|
-
export type { BackendOrganizationsResponse, BackendUsersResponse } from "./schema";
|
|
186
|
-
export type { Organization, OrganizationMetadata, User } from "../schema";
|
|
3
|
+
export type { BackendActiveOrganization, BackendMembersResponse, BackendOrganizationsResponse, BackendUsersResponse, } from "./schema";
|
|
4
|
+
export type { Member, Organization, OrganizationMetadata, User, } from "../schema";
|
|
187
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACpD,YAAY,EACV,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,MAAM,EACN,YAAY,EACZ,oBAAoB,EACpB,IAAI,GACL,MAAM,WAAW,CAAC"}
|
package/dist/backend/index.js
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { FetchHttpClient, HttpClient, HttpClientRequest, } from "effect/unstable/http";
|
|
3
|
-
import { HttpApiClient } from "effect/unstable/httpapi";
|
|
4
|
-
import { readClientConfig } from "../config";
|
|
5
|
-
import { BackendApi } from "./api";
|
|
6
|
-
export class AuthClientConfig extends Context.Service()("AuthClientConfig", { make: readClientConfig }) {
|
|
7
|
-
static layer = Layer.effect(this, this.make);
|
|
8
|
-
}
|
|
9
|
-
export class AuthClient extends Context.Service()("AuthClient", {
|
|
10
|
-
make: Effect.gen(function* () {
|
|
11
|
-
const config = yield* AuthClientConfig;
|
|
12
|
-
const http = yield* HttpClient.HttpClient;
|
|
13
|
-
return yield* HttpApiClient.group(BackendApi, {
|
|
14
|
-
group: "backend",
|
|
15
|
-
baseUrl: config.baseUrl,
|
|
16
|
-
httpClient: HttpClient.mapRequest(http, (request) => HttpClientRequest.bearerToken(request, Redacted.value(config.apiKey))),
|
|
17
|
-
});
|
|
18
|
-
}),
|
|
19
|
-
}) {
|
|
20
|
-
static layer = Layer.effect(this, this.make).pipe(Layer.provide(AuthClientConfig.layer), Layer.provide(FetchHttpClient.layer));
|
|
21
|
-
}
|
|
1
|
+
export { AuthClient, AuthClientConfig } from "../client";
|
|
22
2
|
export { BackendApi, BackendApiGroup } from "./api";
|
|
23
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC"}
|
package/dist/backend/schema.d.ts
CHANGED
|
@@ -2,9 +2,26 @@ import { Schema } from "effect";
|
|
|
2
2
|
export declare const BackendIdsQuery: Schema.Struct<{
|
|
3
3
|
readonly ids: Schema.NonEmptyString;
|
|
4
4
|
}>;
|
|
5
|
+
export declare const BackendOrganizationsQuery: Schema.Struct<{
|
|
6
|
+
readonly ids: Schema.optional<Schema.NonEmptyString>;
|
|
7
|
+
readonly userId: Schema.optional<Schema.NonEmptyString>;
|
|
8
|
+
}>;
|
|
5
9
|
export declare const BackendIdParams: Schema.Struct<{
|
|
6
10
|
readonly id: Schema.NonEmptyString;
|
|
7
11
|
}>;
|
|
12
|
+
export declare const BackendUserIdParams: Schema.Struct<{
|
|
13
|
+
readonly userId: Schema.NonEmptyString;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const BackendOrganizationIdParams: Schema.Struct<{
|
|
16
|
+
readonly organizationId: Schema.NonEmptyString;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const BackendMemberParams: Schema.Struct<{
|
|
19
|
+
readonly organizationId: Schema.NonEmptyString;
|
|
20
|
+
readonly userId: Schema.NonEmptyString;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const BackendActiveOrganization: Schema.Struct<{
|
|
23
|
+
readonly id: Schema.NullOr<Schema.String>;
|
|
24
|
+
}>;
|
|
8
25
|
export declare const BackendUsersResponse: Schema.Struct<{
|
|
9
26
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
10
27
|
readonly id: Schema.String;
|
|
@@ -38,6 +55,26 @@ export declare const BackendOrganizationsResponse: Schema.Struct<{
|
|
|
38
55
|
}>>;
|
|
39
56
|
readonly missingIds: Schema.$Array<Schema.String>;
|
|
40
57
|
}>;
|
|
58
|
+
export declare const BackendMembersResponse: Schema.$Array<Schema.Struct<{
|
|
59
|
+
readonly id: Schema.String;
|
|
60
|
+
readonly organizationId: Schema.String;
|
|
61
|
+
readonly userId: Schema.String;
|
|
62
|
+
readonly role: Schema.String;
|
|
63
|
+
readonly createdAt: Schema.Date;
|
|
64
|
+
readonly user: Schema.Struct<{
|
|
65
|
+
readonly id: Schema.String;
|
|
66
|
+
readonly name: Schema.String;
|
|
67
|
+
readonly email: Schema.String;
|
|
68
|
+
readonly emailVerified: Schema.Boolean;
|
|
69
|
+
readonly image: Schema.NullOr<Schema.String>;
|
|
70
|
+
readonly role: Schema.NullOr<Schema.String>;
|
|
71
|
+
readonly banned: Schema.NullOr<Schema.Boolean>;
|
|
72
|
+
readonly createdAt: Schema.Date;
|
|
73
|
+
readonly updatedAt: Schema.Date;
|
|
74
|
+
}>;
|
|
75
|
+
}>>;
|
|
41
76
|
export type BackendUsersResponse = typeof BackendUsersResponse.Type;
|
|
42
77
|
export type BackendOrganizationsResponse = typeof BackendOrganizationsResponse.Type;
|
|
78
|
+
export type BackendMembersResponse = typeof BackendMembersResponse.Type;
|
|
79
|
+
export type BackendActiveOrganization = typeof BackendActiveOrganization.Type;
|
|
43
80
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/backend/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,eAAO,MAAM,eAAe;;EAO1B,CAAC;AAEH,eAAO,MAAM,eAAe;;EAO1B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;EAQ/B,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAQvC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,IAAI,CAAC;AACpE,MAAM,MAAM,4BAA4B,GACtC,OAAO,4BAA4B,CAAC,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/backend/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,eAAO,MAAM,eAAe;;EAO1B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;EASpC,CAAC;AAEH,eAAO,MAAM,eAAe;;EAO1B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;EAO9B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;EAOtC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;EAQ9B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;EAOpC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;EAQ/B,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAQvC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;GAIjC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,IAAI,CAAC;AACpE,MAAM,MAAM,4BAA4B,GACtC,OAAO,4BAA4B,CAAC,IAAI,CAAC;AAC3C,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAC,IAAI,CAAC;AACxE,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC,IAAI,CAAC"}
|