@krak-stack/auth 0.1.0 → 0.1.2

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.
Files changed (42) hide show
  1. package/README.md +26 -7
  2. package/dist/backend/api.d.ts +80 -6
  3. package/dist/backend/api.d.ts.map +1 -1
  4. package/dist/backend/api.js +31 -4
  5. package/dist/backend/api.js.map +1 -1
  6. package/dist/backend/index.d.ts +100 -41
  7. package/dist/backend/index.d.ts.map +1 -1
  8. package/dist/backend/index.js +5 -12
  9. package/dist/backend/index.js.map +1 -1
  10. package/dist/backend/schema.d.ts +12 -1
  11. package/dist/backend/schema.d.ts.map +1 -1
  12. package/dist/backend/schema.js +11 -3
  13. package/dist/backend/schema.js.map +1 -1
  14. package/dist/components/index.d.ts +3 -0
  15. package/dist/components/index.d.ts.map +1 -0
  16. package/dist/components/index.js +3 -0
  17. package/dist/components/index.js.map +1 -0
  18. package/dist/components/organization-switcher.d.ts +11 -0
  19. package/dist/components/organization-switcher.d.ts.map +1 -0
  20. package/dist/components/organization-switcher.js +569 -0
  21. package/dist/components/organization-switcher.js.map +1 -0
  22. package/dist/components/user-button.d.ts +11 -0
  23. package/dist/components/user-button.d.ts.map +1 -0
  24. package/dist/components/user-button.js +613 -0
  25. package/dist/components/user-button.js.map +1 -0
  26. package/dist/frontend/api.d.ts +18 -2
  27. package/dist/frontend/api.d.ts.map +1 -1
  28. package/dist/frontend/index.d.ts +35 -11
  29. package/dist/frontend/index.d.ts.map +1 -1
  30. package/dist/frontend/index.js +4 -4
  31. package/dist/frontend/index.js.map +1 -1
  32. package/dist/frontend/schema.d.ts +9 -1
  33. package/dist/frontend/schema.d.ts.map +1 -1
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +2 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/schema.d.ts +29 -1
  39. package/dist/schema.d.ts.map +1 -1
  40. package/dist/schema.js +61 -2
  41. package/dist/schema.js.map +1 -1
  42. package/package.json +13 -2
package/README.md CHANGED
@@ -15,17 +15,27 @@ bun add @krak-stack/auth effect
15
15
 
16
16
  ## Backend Auth API
17
17
 
18
+ Users:
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.
22
+
23
+ Organizations:
24
+
25
+ - `listOrganizationsByIds({ query: { ids } })` - returns matching organizations and missing IDs for a comma-separated ID list.
26
+ - `getOrganization({ params: { id } })` - returns one organization by ID.
27
+
18
28
  ```ts
19
29
  import { Effect } from "effect";
20
- import { BackendClient } from "@krak-stack/auth/backend";
30
+ import { AuthClient } from "@krak-stack/auth/backend";
21
31
 
22
32
  const users = await Effect.runPromise(
23
33
  Effect.gen(function* () {
24
- const client = yield* BackendClient;
34
+ const client = yield* AuthClient;
25
35
  return yield* client.listUsersByIds({
26
36
  query: { ids: "user_1,user_2" },
27
37
  });
28
- }).pipe(Effect.provide(BackendClient.layer)),
38
+ }).pipe(Effect.provide(AuthClient.layer)),
29
39
  );
30
40
  ```
31
41
 
@@ -33,16 +43,25 @@ const users = await Effect.runPromise(
33
43
 
34
44
  ```ts
35
45
  import { Effect } from "effect";
36
- import { FrontendClient } from "@krak-stack/auth/frontend";
46
+ import { AuthClient } from "@krak-stack/auth/frontend";
37
47
 
38
48
  const organizations = await Effect.runPromise(
39
49
  Effect.gen(function* () {
40
- const client = yield* FrontendClient;
50
+ const client = yield* AuthClient;
41
51
  return yield* client.listUserOrganizations({
42
52
  params: { userId: "user_1" },
43
53
  });
44
- }).pipe(Effect.provide(FrontendClient.layer)),
54
+ }).pipe(Effect.provide(AuthClient.layer)),
45
55
  );
46
56
  ```
47
57
 
48
- Atom clients are also exported as `BackendApiClient` and `FrontendApiClient`.
58
+ The frontend subpath also exports `FrontendApiClient` for Atom-based browser state.
59
+
60
+ ## Components
61
+
62
+ ```tsx
63
+ import { OrganizationSwitcher, UserButton } from "@krak-stack/auth/components";
64
+
65
+ <OrganizationSwitcher side="bottom" />
66
+ <UserButton signOutRedirect="/" side="bottom" />
67
+ ```
@@ -15,7 +15,19 @@ export declare const BackendApiGroup: HttpApiGroup.HttpApiGroup<"backend", HttpA
15
15
  readonly updatedAt: import("effect/Schema").Date;
16
16
  }>>;
17
17
  readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
18
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizationsByIds", "GET", "/organizations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
18
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getUser", "GET", "/users/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
19
+ readonly id: import("effect/Schema").NonEmptyString;
20
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
21
+ readonly id: import("effect/Schema").String;
22
+ readonly name: import("effect/Schema").String;
23
+ readonly email: import("effect/Schema").String;
24
+ readonly emailVerified: import("effect/Schema").Boolean;
25
+ readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
26
+ readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
27
+ readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
28
+ readonly createdAt: import("effect/Schema").Date;
29
+ readonly updatedAt: import("effect/Schema").Date;
30
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizationsByIds", "GET", "/organizations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
19
31
  readonly ids: import("effect/Schema").NonEmptyString;
20
32
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
21
33
  readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
@@ -23,11 +35,36 @@ export declare const BackendApiGroup: HttpApiGroup.HttpApiGroup<"backend", HttpA
23
35
  readonly name: import("effect/Schema").String;
24
36
  readonly slug: import("effect/Schema").String;
25
37
  readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
26
- readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
38
+ readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
39
+ readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
40
+ readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
41
+ readonly name: import("effect/Schema").String;
42
+ readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
43
+ readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String>;
44
+ readonly location: import("effect/Schema").NullOr<import("effect/Schema").String>;
45
+ }>>;
46
+ }>>;
27
47
  readonly createdAt: import("effect/Schema").Date;
28
48
  }>>;
29
49
  readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
30
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false>;
50
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganization", "GET", "/organizations/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
51
+ readonly id: import("effect/Schema").NonEmptyString;
52
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
53
+ readonly id: import("effect/Schema").String;
54
+ readonly name: import("effect/Schema").String;
55
+ readonly slug: import("effect/Schema").String;
56
+ readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
57
+ readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
58
+ readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
59
+ readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
60
+ readonly name: import("effect/Schema").String;
61
+ readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
62
+ readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String>;
63
+ readonly location: import("effect/Schema").NullOr<import("effect/Schema").String>;
64
+ }>>;
65
+ }>>;
66
+ readonly createdAt: import("effect/Schema").Date;
67
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never>, false>;
31
68
  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<{
32
69
  readonly ids: import("effect/Schema").NonEmptyString;
33
70
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
@@ -43,7 +80,19 @@ export declare const BackendApi: HttpApi.HttpApi<"BackendApi", HttpApiGroup.Http
43
80
  readonly updatedAt: import("effect/Schema").Date;
44
81
  }>>;
45
82
  readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
46
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizationsByIds", "GET", "/api/organizations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
83
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getUser", "GET", "/api/users/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
84
+ readonly id: import("effect/Schema").NonEmptyString;
85
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
86
+ readonly id: import("effect/Schema").String;
87
+ readonly name: import("effect/Schema").String;
88
+ readonly email: import("effect/Schema").String;
89
+ readonly emailVerified: import("effect/Schema").Boolean;
90
+ readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
91
+ readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
92
+ readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
93
+ readonly createdAt: import("effect/Schema").Date;
94
+ readonly updatedAt: import("effect/Schema").Date;
95
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizationsByIds", "GET", "/api/organizations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
47
96
  readonly ids: import("effect/Schema").NonEmptyString;
48
97
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
49
98
  readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
@@ -51,9 +100,34 @@ export declare const BackendApi: HttpApi.HttpApi<"BackendApi", HttpApiGroup.Http
51
100
  readonly name: import("effect/Schema").String;
52
101
  readonly slug: import("effect/Schema").String;
53
102
  readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
54
- readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
103
+ readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
104
+ readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
105
+ readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
106
+ readonly name: import("effect/Schema").String;
107
+ readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
108
+ readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String>;
109
+ readonly location: import("effect/Schema").NullOr<import("effect/Schema").String>;
110
+ }>>;
111
+ }>>;
55
112
  readonly createdAt: import("effect/Schema").Date;
56
113
  }>>;
57
114
  readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
58
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false>>;
115
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganization", "GET", "/api/organizations/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
116
+ readonly id: import("effect/Schema").NonEmptyString;
117
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
118
+ readonly id: import("effect/Schema").String;
119
+ readonly name: import("effect/Schema").String;
120
+ readonly slug: import("effect/Schema").String;
121
+ readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
122
+ readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
123
+ readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
124
+ readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
125
+ readonly name: import("effect/Schema").String;
126
+ readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
127
+ readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String>;
128
+ readonly location: import("effect/Schema").NullOr<import("effect/Schema").String>;
129
+ }>>;
130
+ }>>;
131
+ readonly createdAt: import("effect/Schema").Date;
132
+ }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof HttpApiError.NotFound>, never, never>, false>>;
59
133
  //# 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;AAQjC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;4HAmCzB,CAAC;AAEJ,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;6HAEN,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;AAUjC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2JAuEzB,CAAC;AAEJ,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4JAEN,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { HttpApi, OpenApi } from "effect/unstable/httpapi";
2
2
  import { HttpApiEndpoint, HttpApiError, HttpApiGroup, } from "effect/unstable/httpapi";
3
- import { BackendIdsQuery, BackendOrganizationsResponse, BackendUsersResponse, } from "./schema";
3
+ import { Organization, User } from "../schema";
4
+ import { BackendIdParams, BackendIdsQuery, BackendOrganizationsResponse, BackendUsersResponse, } from "./schema";
4
5
  export const BackendApiGroup = HttpApiGroup.make("backend")
5
6
  .add(HttpApiEndpoint.get("listUsersByIds", "/users", {
6
7
  query: BackendIdsQuery,
@@ -8,8 +9,21 @@ export const BackendApiGroup = HttpApiGroup.make("backend")
8
9
  error: [HttpApiError.Unauthorized, HttpApiError.InternalServerError],
9
10
  }).annotateMerge(OpenApi.annotations({
10
11
  title: "List users by IDs",
11
- summary: "Hydrate user records for backend services",
12
+ summary: "List users by IDs",
12
13
  description: "Returns trusted user records for a comma-separated list of IDs. Requires a service API key.",
14
+ })))
15
+ .add(HttpApiEndpoint.get("getUser", "/users/:id", {
16
+ params: BackendIdParams,
17
+ success: User,
18
+ error: [
19
+ HttpApiError.Unauthorized,
20
+ HttpApiError.NotFound,
21
+ HttpApiError.InternalServerError,
22
+ ],
23
+ }).annotateMerge(OpenApi.annotations({
24
+ title: "Get user",
25
+ summary: "Get a user by ID",
26
+ description: "Returns a trusted user record by ID. Requires a service API key.",
13
27
  })))
14
28
  .add(HttpApiEndpoint.get("listOrganizationsByIds", "/organizations", {
15
29
  query: BackendIdsQuery,
@@ -17,12 +31,25 @@ export const BackendApiGroup = HttpApiGroup.make("backend")
17
31
  error: [HttpApiError.Unauthorized, HttpApiError.InternalServerError],
18
32
  }).annotateMerge(OpenApi.annotations({
19
33
  title: "List organizations by IDs",
20
- summary: "Hydrate organization records for backend services",
34
+ summary: "List organizations by IDs",
21
35
  description: "Returns trusted organization records for a comma-separated list of IDs. Requires a service API key.",
36
+ })))
37
+ .add(HttpApiEndpoint.get("getOrganization", "/organizations/:id", {
38
+ params: BackendIdParams,
39
+ success: Organization,
40
+ error: [
41
+ HttpApiError.Unauthorized,
42
+ HttpApiError.NotFound,
43
+ HttpApiError.InternalServerError,
44
+ ],
45
+ }).annotateMerge(OpenApi.annotations({
46
+ title: "Get organization",
47
+ summary: "Get an organization by ID",
48
+ description: "Returns a trusted organization record by ID. Requires a service API key.",
22
49
  })))
23
50
  .annotateMerge(OpenApi.annotations({
24
51
  title: "Backend",
25
- description: "Server-to-server authentication and identity hydration endpoints for trusted services.",
52
+ description: "Server-to-server authentication and identity endpoints for trusted services.",
26
53
  }));
27
54
  export const BackendApi = HttpApi.make("BackendApi")
28
55
  .add(BackendApiGroup)
@@ -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,EACL,eAAe,EACf,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC;KACxD,GAAG,CACF,eAAe,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,EAAE;IAC9C,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,oBAAoB;IAC7B,KAAK,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,mBAAmB,CAAC;CACrE,CAAC,CAAC,aAAa,CACd,OAAO,CAAC,WAAW,CAAC;IAClB,KAAK,EAAE,mBAAmB;IAC1B,OAAO,EAAE,2CAA2C;IACpD,WAAW,EACT,6FAA6F;CAChG,CAAC,CACH,CACF;KACA,GAAG,CACF,eAAe,CAAC,GAAG,CAAC,wBAAwB,EAAE,gBAAgB,EAAE;IAC9D,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,4BAA4B;IACrC,KAAK,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,mBAAmB,CAAC;CACrE,CAAC,CAAC,aAAa,CACd,OAAO,CAAC,WAAW,CAAC;IAClB,KAAK,EAAE,2BAA2B;IAClC,OAAO,EAAE,mDAAmD;IAC5D,WAAW,EACT,qGAAqG;CACxG,CA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,CAAC,mBAAmB;KACjC;CACF,CAAC,CAAC,aAAa,CACd,OAAO,CAAC,WAAW,CAAC;IAClB,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EACT,kEAAkE;CACrE,CAAC,CACH,CACF;KACA,GAAG,CACF,eAAe,CAAC,GAAG,CAAC,wBAAwB,EAAE,gBAAgB,EAAE;IAC9D,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,4BAA4B;IACrC,KAAK,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,mBAAmB,CAAC;CACrE,CAAC,CAAC,aAAa,CACd,OAAO,CAAC,WAAW,CAAC;IAClB,KAAK,EAAE,2BAA2B;IAClC,OAAO,EAAE,2BAA2B;IACpC,WAAW,EACT,qGAAqG;CACxG,CAAC,CACH,CACF;KACA,GAAG,CACF,eAAe,CAAC,GAAG,CAAC,iBAAiB,EAAE,oBAAoB,EAAE;IAC3D,MAAM,EAAE,eAAe;IACvB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE;QACL,YAAY,CAAC,YAAY;QACzB,YAAY,CAAC,QAAQ;QACrB,YAAY,CAAC,mBAAmB;KACjC;CACF,CAAC,CAAC,aAAa,CACd,OAAO,CAAC,WAAW,CAAC;IAClB,KAAK,EAAE,kBAAkB;IACzB,OAAO,EAAE,2BAA2B;IACpC,WAAW,EACT,0EAA0E;CAC7E,CAAC,CACH,CACF;KACA,aAAa,CACZ,OAAO,CAAC,WAAW,CAAC;IAClB,KAAK,EAAE,SAAS;IAChB,WAAW,EACT,8EAA8E;CACjF,CAAC,CACH,CAAC;AAEJ,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;KACjD,GAAG,CAAC,eAAe,CAAC;KACpB,MAAM,CAAC,MAAM,CAAC,CAAC"}
@@ -1,38 +1,7 @@
1
1
  import { Context, Effect, Layer, Redacted } from "effect";
2
2
  import { HttpClient } from "effect/unstable/http";
3
3
  import { HttpApiClient } from "effect/unstable/httpapi";
4
- import { AtomHttpApi } from "effect/unstable/reactivity";
5
- declare const BackendApiClient_base: AtomHttpApi.AtomHttpApiClient<BackendApiClient, "BackendApiClient", import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"backend", 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<{
6
- readonly ids: import("effect/Schema").NonEmptyString;
7
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
8
- readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
9
- readonly id: import("effect/Schema").String;
10
- readonly name: import("effect/Schema").String;
11
- readonly email: import("effect/Schema").String;
12
- readonly emailVerified: import("effect/Schema").Boolean;
13
- readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
14
- readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
15
- readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
16
- readonly createdAt: import("effect/Schema").Date;
17
- readonly updatedAt: import("effect/Schema").Date;
18
- }>>;
19
- readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
20
- }>>, 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<"listOrganizationsByIds", "GET", "/api/organizations", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
21
- readonly ids: import("effect/Schema").NonEmptyString;
22
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
23
- readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
24
- readonly id: import("effect/Schema").String;
25
- readonly name: import("effect/Schema").String;
26
- readonly slug: import("effect/Schema").String;
27
- readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
28
- readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
29
- readonly createdAt: import("effect/Schema").Date;
30
- }>>;
31
- readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
32
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never>, false>>;
33
- export declare class BackendApiClient extends BackendApiClient_base {
34
- }
35
- declare const BackendClientConfig_base: Context.ServiceClass<BackendClientConfig, "BackendClientConfig", {
4
+ declare const AuthClientConfig_base: Context.ServiceClass<AuthClientConfig, "AuthClientConfig", {
36
5
  baseUrl: string;
37
6
  apiKey: Redacted.Redacted<string>;
38
7
  }> & {
@@ -41,10 +10,10 @@ declare const BackendClientConfig_base: Context.ServiceClass<BackendClientConfig
41
10
  apiKey: Redacted.Redacted<string>;
42
11
  }, import("effect/Config").ConfigError, never>;
43
12
  };
44
- export declare class BackendClientConfig extends BackendClientConfig_base {
45
- static readonly layer: Layer.Layer<BackendClientConfig, import("effect/Config").ConfigError, never>;
13
+ export declare class AuthClientConfig extends AuthClientConfig_base {
14
+ static readonly layer: Layer.Layer<AuthClientConfig, import("effect/Config").ConfigError, never>;
46
15
  }
47
- declare const BackendClient_base: Context.ServiceClass<BackendClient, "BackendClient", {
16
+ declare const AuthClient_base: Context.ServiceClass<AuthClient, "AuthClient", {
48
17
  readonly listUsersByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
49
18
  readonly query: {
50
19
  readonly ids: string;
@@ -64,6 +33,22 @@ declare const BackendClient_base: Context.ServiceClass<BackendClient, "BackendCl
64
33
  }[];
65
34
  readonly missingIds: readonly string[];
66
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>;
67
52
  readonly listOrganizationsByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
68
53
  readonly query: {
69
54
  readonly ids: string;
@@ -75,11 +60,40 @@ declare const BackendClient_base: Context.ServiceClass<BackendClient, "BackendCl
75
60
  readonly name: string;
76
61
  readonly slug: string;
77
62
  readonly logo: string | null;
78
- readonly metadata: unknown;
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;
79
72
  readonly createdAt: Date;
80
73
  }[];
81
74
  readonly missingIds: readonly string[];
82
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>;
83
97
  }> & {
84
98
  readonly make: Effect.Effect<{
85
99
  readonly listUsersByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
@@ -101,6 +115,22 @@ declare const BackendClient_base: Context.ServiceClass<BackendClient, "BackendCl
101
115
  }[];
102
116
  readonly missingIds: readonly string[];
103
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>;
104
134
  readonly listOrganizationsByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
105
135
  readonly query: {
106
136
  readonly ids: string;
@@ -112,17 +142,46 @@ declare const BackendClient_base: Context.ServiceClass<BackendClient, "BackendCl
112
142
  readonly name: string;
113
143
  readonly slug: string;
114
144
  readonly logo: string | null;
115
- readonly metadata: unknown;
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;
116
154
  readonly createdAt: Date;
117
155
  }[];
118
156
  readonly missingIds: readonly string[];
119
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>;
120
- }, never, HttpClient.HttpClient | BackendClientConfig>;
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>;
121
180
  };
122
- export declare class BackendClient extends BackendClient_base {
123
- static readonly layer: Layer.Layer<BackendClient, import("effect/Config").ConfigError, never>;
181
+ export declare class AuthClient extends AuthClient_base {
182
+ static readonly layer: Layer.Layer<AuthClient, import("effect/Config").ConfigError, never>;
124
183
  }
125
184
  export { BackendApi, BackendApiGroup } from "./api";
126
185
  export type { BackendOrganizationsResponse, BackendUsersResponse } from "./schema";
127
- export type { Organization, User } from "../schema";
186
+ export type { Organization, OrganizationMetadata, User } from "../schema";
128
187
  //# 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,OAAO,EAAE,MAAM,EAAE,KA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,qBAAa,UAAW,SAAQ,eAgB/B;IACC,MAAM,CAAC,QAAQ,CAAC,KAAK,sEAGnB;CACH;AAED,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACpD,YAAY,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACnF,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
@@ -1,21 +1,14 @@
1
1
  import { Context, Effect, Layer, Redacted } from "effect";
2
2
  import { FetchHttpClient, HttpClient, HttpClientRequest, } from "effect/unstable/http";
3
3
  import { HttpApiClient } from "effect/unstable/httpapi";
4
- import { AtomHttpApi } from "effect/unstable/reactivity";
5
- import { defaultBaseUrl, readClientConfig } from "../config";
4
+ import { readClientConfig } from "../config";
6
5
  import { BackendApi } from "./api";
7
- export class BackendApiClient extends AtomHttpApi.Service()("BackendApiClient", {
8
- api: BackendApi,
9
- baseUrl: defaultBaseUrl(),
10
- httpClient: FetchHttpClient.layer,
11
- }) {
12
- }
13
- export class BackendClientConfig extends Context.Service()("BackendClientConfig", { make: readClientConfig }) {
6
+ export class AuthClientConfig extends Context.Service()("AuthClientConfig", { make: readClientConfig }) {
14
7
  static layer = Layer.effect(this, this.make);
15
8
  }
16
- export class BackendClient extends Context.Service()("BackendClient", {
9
+ export class AuthClient extends Context.Service()("AuthClient", {
17
10
  make: Effect.gen(function* () {
18
- const config = yield* BackendClientConfig;
11
+ const config = yield* AuthClientConfig;
19
12
  const http = yield* HttpClient.HttpClient;
20
13
  return yield* HttpApiClient.group(BackendApi, {
21
14
  group: "backend",
@@ -24,7 +17,7 @@ export class BackendClient extends Context.Service()("BackendClient", {
24
17
  });
25
18
  }),
26
19
  }) {
27
- static layer = Layer.effect(this, this.make).pipe(Layer.provide(BackendClientConfig.layer), Layer.provide(FetchHttpClient.layer));
20
+ static layer = Layer.effect(this, this.make).pipe(Layer.provide(AuthClientConfig.layer), Layer.provide(FetchHttpClient.layer));
28
21
  }
29
22
  export { BackendApi, BackendApiGroup } from "./api";
30
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EACL,eAAe,EACf,UAAU,EACV,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,MAAM,OAAO,gBAAiB,SAAQ,WAAW,CAAC,OAAO,EAAoB,CAC3E,kBAAkB,EAClB;IACE,GAAG,EAAE,UAAU;IACf,OAAO,EAAE,cAAc,EAAE;IACzB,UAAU,EAAE,eAAe,CAAC,KAAK;CAClC,CACF;CAAG;AAEJ,MAAM,OAAO,mBAAoB,SAAQ,OAAO,CAAC,OAAO,EAAuB,CAC7E,qBAAqB,EACrB,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAC3B;IACC,MAAM,CAAU,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;;AAGxD,MAAM,OAAO,aAAc,SAAQ,OAAO,CAAC,OAAO,EAAiB,CACjE,eAAe,EACf;IACE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACxB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,mBAAmB,CAAC;QAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,C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EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;;AAGxD,MAAM,OAAO,UAAW,SAAQ,OAAO,CAAC,OAAO,EAAc,CAC3D,YAAY,EACZ;IACE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACxB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,gBAAgB,CAAC;QACvC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;QAE1C,OAAO,KAAK,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE;YAC5C,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAClD,iBAAiB,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CACtE;SACF,CAAC,CAAC;IACL,CAAC,CAAC;CACH,CACF;IACC,MAAM,CAAU,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CACxD,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,EACrC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CACrC,CAAC;;AAGJ,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC"}
@@ -2,6 +2,9 @@ import { Schema } from "effect";
2
2
  export declare const BackendIdsQuery: Schema.Struct<{
3
3
  readonly ids: Schema.NonEmptyString;
4
4
  }>;
5
+ export declare const BackendIdParams: Schema.Struct<{
6
+ readonly id: Schema.NonEmptyString;
7
+ }>;
5
8
  export declare const BackendUsersResponse: Schema.Struct<{
6
9
  readonly data: Schema.$Array<Schema.Struct<{
7
10
  readonly id: Schema.String;
@@ -22,7 +25,15 @@ export declare const BackendOrganizationsResponse: Schema.Struct<{
22
25
  readonly name: Schema.String;
23
26
  readonly slug: Schema.String;
24
27
  readonly logo: Schema.NullOr<Schema.String>;
25
- readonly metadata: Schema.NullOr<Schema.Unknown>;
28
+ readonly metadata: Schema.NullOr<Schema.Struct<{
29
+ readonly translations: Schema.$Array<Schema.Struct<{
30
+ readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
31
+ readonly name: Schema.String;
32
+ readonly logo: Schema.NullOr<Schema.String>;
33
+ readonly contactEmail: Schema.NullOr<Schema.String>;
34
+ readonly location: Schema.NullOr<Schema.String>;
35
+ }>>;
36
+ }>>;
26
37
  readonly createdAt: Schema.Date;
27
38
  }>>;
28
39
  readonly missingIds: Schema.$Array<Schema.String>;
@@ -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,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,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"}
@@ -5,16 +5,24 @@ export const BackendIdsQuery = Schema.Struct({
5
5
  }).annotate({
6
6
  identifier: "BackendIdsQuery",
7
7
  title: "Backend IDs query",
8
- description: "Comma-separated resource IDs used to hydrate backend records.",
8
+ description: "Comma-separated resource IDs used to return backend records.",
9
9
  examples: [{ ids: "user_1,user_2,user_3" }],
10
10
  });
11
+ export const BackendIdParams = Schema.Struct({
12
+ id: Schema.NonEmptyString,
13
+ }).annotate({
14
+ identifier: "BackendIdParams",
15
+ title: "Backend ID params",
16
+ description: "Resource ID used to return a backend record.",
17
+ examples: [{ id: "user_1" }],
18
+ });
11
19
  export const BackendUsersResponse = Schema.Struct({
12
20
  data: Schema.Array(User),
13
21
  missingIds: Schema.Array(Schema.String),
14
22
  }).annotate({
15
23
  identifier: "BackendUsersResponse",
16
24
  title: "Backend users response",
17
- description: "Batch user hydration response with records and requested IDs that were not found.",
25
+ description: "Batch user response with records and requested IDs that were not found.",
18
26
  });
19
27
  export const BackendOrganizationsResponse = Schema.Struct({
20
28
  data: Schema.Array(Organization),
@@ -22,6 +30,6 @@ export const BackendOrganizationsResponse = Schema.Struct({
22
30
  }).annotate({
23
31
  identifier: "BackendOrganizationsResponse",
24
32
  title: "Backend organizations response",
25
- description: "Batch organization hydration response with records and requested IDs that were not found.",
33
+ description: "Batch organization response with records and requested IDs that were not found.",
26
34
  });
27
35
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/backend/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,GA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8DAA8D;IAC3E,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,sBAAsB,EAAE,CAAC;CAC5C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,EAAE,EAAE,MAAM,CAAC,cAAc;CAC1B,CAAC,CAAC,QAAQ,CAAC;IACV,UAAU,EAAE,iBAAiB;IAC7B,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;CACxC,CAAC,CAAC,QAAQ,CAAC;IACV,UAAU,EAAE,sBAAsB;IAClC,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EACT,yEAAyE;CAC5E,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;CACxC,CAAC,CAAC,QAAQ,CAAC;IACV,UAAU,EAAE,8BAA8B;IAC1C,KAAK,EAAE,gCAAgC;IACvC,WAAW,EACT,iFAAiF;CACpF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { OrganizationSwitcher } from "./organization-switcher";
2
+ export { UserButton } from "./user-button";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { OrganizationSwitcher } from "./organization-switcher";
2
+ export { UserButton } from "./user-button";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ import { DropdownMenuContent } from "@/components/ui/dropdown-menu";
3
+ type OrganizationSwitcherProps = {
4
+ side?: ComponentProps<typeof DropdownMenuContent>["side"];
5
+ className?: string;
6
+ renderUnauthenticated?: () => ReactNode;
7
+ locked?: boolean;
8
+ };
9
+ export declare function OrganizationSwitcher({ side, className, renderUnauthenticated, locked, }: OrganizationSwitcherProps): import("react").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=organization-switcher.d.ts.map