@squadbase/server 0.0.1-beta.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.
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const zUser: z.ZodObject<{
4
+ username: z.ZodString;
5
+ email: z.ZodString;
6
+ firstName: z.ZodString;
7
+ lastName: z.ZodString;
8
+ iconUrl: z.ZodNullable<z.ZodString>;
9
+ roles: z.ZodArray<z.ZodString, "many">;
10
+ }, "strip", z.ZodTypeAny, {
11
+ username: string;
12
+ email: string;
13
+ firstName: string;
14
+ lastName: string;
15
+ iconUrl: string | null;
16
+ roles: string[];
17
+ }, {
18
+ username: string;
19
+ email: string;
20
+ firstName: string;
21
+ lastName: string;
22
+ iconUrl: string | null;
23
+ roles: string[];
24
+ }>;
25
+ type User = z.infer<typeof zUser>;
26
+
27
+ type GetCookie = () => Promise<string | undefined> | string | undefined;
28
+ type ServerClientOptions = {
29
+ projectId: string;
30
+ cookieOptions: {
31
+ getCookie: GetCookie;
32
+ };
33
+ mockUser?: User;
34
+ _internal_base_url?: string;
35
+ };
36
+ declare class ServerClient {
37
+ private readonly options;
38
+ constructor(options: ServerClientOptions);
39
+ getUser(): Promise<{
40
+ username: string;
41
+ email: string;
42
+ firstName: string;
43
+ lastName: string;
44
+ iconUrl: string | null;
45
+ roles: string[];
46
+ }>;
47
+ }
48
+ declare const createServerClient: (options: ServerClientOptions) => ServerClient;
49
+
50
+ export { type GetCookie, ServerClient, type ServerClientOptions, type User, createServerClient };
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const zUser: z.ZodObject<{
4
+ username: z.ZodString;
5
+ email: z.ZodString;
6
+ firstName: z.ZodString;
7
+ lastName: z.ZodString;
8
+ iconUrl: z.ZodNullable<z.ZodString>;
9
+ roles: z.ZodArray<z.ZodString, "many">;
10
+ }, "strip", z.ZodTypeAny, {
11
+ username: string;
12
+ email: string;
13
+ firstName: string;
14
+ lastName: string;
15
+ iconUrl: string | null;
16
+ roles: string[];
17
+ }, {
18
+ username: string;
19
+ email: string;
20
+ firstName: string;
21
+ lastName: string;
22
+ iconUrl: string | null;
23
+ roles: string[];
24
+ }>;
25
+ type User = z.infer<typeof zUser>;
26
+
27
+ type GetCookie = () => Promise<string | undefined> | string | undefined;
28
+ type ServerClientOptions = {
29
+ projectId: string;
30
+ cookieOptions: {
31
+ getCookie: GetCookie;
32
+ };
33
+ mockUser?: User;
34
+ _internal_base_url?: string;
35
+ };
36
+ declare class ServerClient {
37
+ private readonly options;
38
+ constructor(options: ServerClientOptions);
39
+ getUser(): Promise<{
40
+ username: string;
41
+ email: string;
42
+ firstName: string;
43
+ lastName: string;
44
+ iconUrl: string | null;
45
+ roles: string[];
46
+ }>;
47
+ }
48
+ declare const createServerClient: (options: ServerClientOptions) => ServerClient;
49
+
50
+ export { type GetCookie, ServerClient, type ServerClientOptions, type User, createServerClient };