@voyantjs/auth-react 0.6.7 → 0.6.9
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/hooks/use-current-user.d.ts +0 -1
- package/dist/hooks/use-current-user.d.ts.map +1 -1
- package/dist/hooks/use-current-workspace.d.ts +10 -6
- package/dist/hooks/use-current-workspace.d.ts.map +1 -1
- package/dist/hooks/use-organization-invitation-mutation.d.ts +6 -8
- package/dist/hooks/use-organization-invitation-mutation.d.ts.map +1 -1
- package/dist/hooks/use-organization-invitations.d.ts +3 -4
- package/dist/hooks/use-organization-invitations.d.ts.map +1 -1
- package/dist/hooks/use-organization-member-mutation.d.ts +7 -8
- package/dist/hooks/use-organization-member-mutation.d.ts.map +1 -1
- package/dist/hooks/use-organization-members.d.ts +2 -4
- package/dist/hooks/use-organization-members.d.ts.map +1 -1
- package/dist/hooks/use-workspace-mutation.d.ts +10 -7
- package/dist/hooks/use-workspace-mutation.d.ts.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/query-keys.d.ts +5 -15
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +3 -5
- package/dist/query-options.d.ts +88 -89
- package/dist/query-options.d.ts.map +1 -1
- package/dist/query-options.js +11 -11
- package/dist/schemas.d.ts +46 -68
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +23 -30
- package/package.json +5 -5
|
@@ -10,6 +10,5 @@ export declare function useCurrentUser(options?: UseCurrentUserOptions): import(
|
|
|
10
10
|
isSupportUser: boolean;
|
|
11
11
|
createdAt: string;
|
|
12
12
|
profilePictureUrl?: string | null | undefined;
|
|
13
|
-
activeOrganizationId?: string | null | undefined;
|
|
14
13
|
}, Error>;
|
|
15
14
|
//# sourceMappingURL=use-current-user.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-current-user.d.ts","sourceRoot":"","sources":["../../src/hooks/use-current-user.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B
|
|
1
|
+
{"version":3,"file":"use-current-user.d.ts","sourceRoot":"","sources":["../../src/hooks/use-current-user.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B;;;;;;;;;UAQjE"}
|
|
@@ -2,17 +2,21 @@ export interface UseCurrentWorkspaceOptions {
|
|
|
2
2
|
enabled?: boolean;
|
|
3
3
|
}
|
|
4
4
|
export declare function useCurrentWorkspace(options?: UseCurrentWorkspaceOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
-
|
|
5
|
+
activeOrganization: {
|
|
6
6
|
id: string;
|
|
7
7
|
name: string;
|
|
8
|
-
slug
|
|
8
|
+
slug?: string | null | undefined;
|
|
9
9
|
logo?: string | null | undefined;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
createdAt?: string | null | undefined;
|
|
11
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
12
|
+
} | null;
|
|
13
|
+
organizations: {
|
|
12
14
|
id: string;
|
|
13
15
|
name: string;
|
|
14
|
-
slug
|
|
16
|
+
slug?: string | null | undefined;
|
|
15
17
|
logo?: string | null | undefined;
|
|
16
|
-
|
|
18
|
+
createdAt?: string | null | undefined;
|
|
19
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
20
|
+
}[];
|
|
17
21
|
}, Error>;
|
|
18
22
|
//# sourceMappingURL=use-current-workspace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-current-workspace.d.ts","sourceRoot":"","sources":["../../src/hooks/use-current-workspace.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,0BAA+B
|
|
1
|
+
{"version":3,"file":"use-current-workspace.d.ts","sourceRoot":"","sources":["../../src/hooks/use-current-workspace.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,0BAA+B;;;;;;;;;;;;;;;;;UAQ3E"}
|
|
@@ -15,22 +15,20 @@ export declare function useOrganizationInvitationMutation(): {
|
|
|
15
15
|
organizationId: string;
|
|
16
16
|
email: string;
|
|
17
17
|
role: string | string[];
|
|
18
|
-
status:
|
|
19
|
-
inviterId: string;
|
|
18
|
+
status: string;
|
|
20
19
|
expiresAt: string;
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
inviterId?: string | null | undefined;
|
|
21
|
+
createdAt?: string | null | undefined;
|
|
23
22
|
}, Error, InviteOrganizationMemberInput, unknown>;
|
|
24
23
|
cancel: import("@tanstack/react-query").UseMutationResult<{
|
|
25
24
|
id: string;
|
|
26
25
|
organizationId: string;
|
|
27
26
|
email: string;
|
|
28
27
|
role: string | string[];
|
|
29
|
-
status:
|
|
30
|
-
inviterId: string;
|
|
28
|
+
status: string;
|
|
31
29
|
expiresAt: string;
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
inviterId?: string | null | undefined;
|
|
31
|
+
createdAt?: string | null | undefined;
|
|
34
32
|
} | null, Error, CancelOrganizationInvitationInput, unknown>;
|
|
35
33
|
};
|
|
36
34
|
//# sourceMappingURL=use-organization-invitation-mutation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-organization-invitation-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-organization-invitation-mutation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAK5B,OAAO,EAAgC,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAEzF,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;IAC5C,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC7B;AAED,MAAM,WAAW,iCAAiC;IAChD,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,iCAAiC
|
|
1
|
+
{"version":3,"file":"use-organization-invitation-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-organization-invitation-mutation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAK5B,OAAO,EAAgC,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAEzF,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;IAC5C,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC7B;AAED,MAAM,WAAW,iCAAiC;IAChD,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,iCAAiC;;;;;;;;;;;;;;;;;;;;;EA+BhD"}
|
|
@@ -8,10 +8,9 @@ export declare function useOrganizationInvitations(options?: UseOrganizationInvi
|
|
|
8
8
|
organizationId: string;
|
|
9
9
|
email: string;
|
|
10
10
|
role: string | string[];
|
|
11
|
-
status:
|
|
12
|
-
inviterId: string;
|
|
11
|
+
status: string;
|
|
13
12
|
expiresAt: string;
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
inviterId?: string | null | undefined;
|
|
14
|
+
createdAt?: string | null | undefined;
|
|
16
15
|
}[], Error>;
|
|
17
16
|
//# sourceMappingURL=use-organization-invitations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-organization-invitations.d.ts","sourceRoot":"","sources":["../../src/hooks/use-organization-invitations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,kBAAkB,CAAA;AAG1E,MAAM,WAAW,iCAAiC;IAChD,OAAO,CAAC,EAAE,kCAAkC,CAAA;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC
|
|
1
|
+
{"version":3,"file":"use-organization-invitations.d.ts","sourceRoot":"","sources":["../../src/hooks/use-organization-invitations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,kBAAkB,CAAA;AAG1E,MAAM,WAAW,iCAAiC;IAChD,OAAO,CAAC,EAAE,kCAAkC,CAAA;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC;;;;;;;;;YAQzF"}
|
|
@@ -12,33 +12,32 @@ export interface RemoveOrganizationMemberInput {
|
|
|
12
12
|
export declare function useOrganizationMemberMutation(): {
|
|
13
13
|
updateRole: import("@tanstack/react-query").UseMutationResult<{
|
|
14
14
|
id: string;
|
|
15
|
-
organizationId: string;
|
|
16
15
|
userId: string;
|
|
16
|
+
organizationId: string;
|
|
17
17
|
role: string | string[];
|
|
18
18
|
createdAt: string;
|
|
19
19
|
user: {
|
|
20
20
|
id: string;
|
|
21
21
|
email: string;
|
|
22
|
-
name
|
|
22
|
+
name?: string | null | undefined;
|
|
23
23
|
image?: string | null | undefined;
|
|
24
24
|
};
|
|
25
|
-
teamId?: string | undefined;
|
|
26
25
|
}, Error, UpdateOrganizationMemberRoleInput, unknown>;
|
|
27
26
|
remove: import("@tanstack/react-query").UseMutationResult<{
|
|
28
|
-
member
|
|
27
|
+
member?: {
|
|
29
28
|
id: string;
|
|
30
|
-
organizationId: string;
|
|
31
29
|
userId: string;
|
|
30
|
+
organizationId: string;
|
|
32
31
|
role: string | string[];
|
|
33
32
|
createdAt: string;
|
|
34
33
|
user: {
|
|
35
34
|
id: string;
|
|
36
35
|
email: string;
|
|
37
|
-
name
|
|
36
|
+
name?: string | null | undefined;
|
|
38
37
|
image?: string | null | undefined;
|
|
39
38
|
};
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
} | null | undefined;
|
|
40
|
+
success?: boolean | undefined;
|
|
42
41
|
}, Error, RemoveOrganizationMemberInput, unknown>;
|
|
43
42
|
};
|
|
44
43
|
//# sourceMappingURL=use-organization-member-mutation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-organization-member-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-organization-member-mutation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAK5B,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,eAAe,CAAA;AAEtB,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;IAC5C,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAED,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAED,wBAAgB,6BAA6B
|
|
1
|
+
{"version":3,"file":"use-organization-member-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-organization-member-mutation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAK5B,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,eAAe,CAAA;AAEtB,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;IAC5C,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAED,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAED,wBAAgB,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiC5C"}
|
|
@@ -6,18 +6,16 @@ export interface UseOrganizationMembersOptions {
|
|
|
6
6
|
export declare function useOrganizationMembers(options?: UseOrganizationMembersOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
7
7
|
members: {
|
|
8
8
|
id: string;
|
|
9
|
-
organizationId: string;
|
|
10
9
|
userId: string;
|
|
10
|
+
organizationId: string;
|
|
11
11
|
role: string | string[];
|
|
12
12
|
createdAt: string;
|
|
13
13
|
user: {
|
|
14
14
|
id: string;
|
|
15
15
|
email: string;
|
|
16
|
-
name
|
|
16
|
+
name?: string | null | undefined;
|
|
17
17
|
image?: string | null | undefined;
|
|
18
18
|
};
|
|
19
|
-
teamId?: string | undefined;
|
|
20
19
|
}[];
|
|
21
|
-
total: number;
|
|
22
20
|
}, Error>;
|
|
23
21
|
//# sourceMappingURL=use-organization-members.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-organization-members.d.ts","sourceRoot":"","sources":["../../src/hooks/use-organization-members.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAA;AAGtE,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,8BAA8B,CAAA;IACxC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,6BAAkC
|
|
1
|
+
{"version":3,"file":"use-organization-members.d.ts","sourceRoot":"","sources":["../../src/hooks/use-organization-members.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAA;AAGtE,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,8BAA8B,CAAA;IACxC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,6BAAkC;;;;;;;;;;;;;;UAQjF"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
export declare function useWorkspaceMutation(): {
|
|
2
2
|
setActiveOrganization: import("@tanstack/react-query").UseMutationResult<{
|
|
3
|
-
|
|
3
|
+
activeOrganization: {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
|
-
slug
|
|
6
|
+
slug?: string | null | undefined;
|
|
7
7
|
logo?: string | null | undefined;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
createdAt?: string | null | undefined;
|
|
9
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
10
|
+
} | null;
|
|
11
|
+
organizations: {
|
|
10
12
|
id: string;
|
|
11
13
|
name: string;
|
|
12
|
-
slug
|
|
14
|
+
slug?: string | null | undefined;
|
|
13
15
|
logo?: string | null | undefined;
|
|
14
|
-
|
|
16
|
+
createdAt?: string | null | undefined;
|
|
17
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
18
|
+
}[];
|
|
15
19
|
}, Error, string, unknown>;
|
|
16
20
|
refreshCurrentUser: import("@tanstack/react-query").UseMutationResult<{
|
|
17
21
|
id: string;
|
|
@@ -22,7 +26,6 @@ export declare function useWorkspaceMutation(): {
|
|
|
22
26
|
isSupportUser: boolean;
|
|
23
27
|
createdAt: string;
|
|
24
28
|
profilePictureUrl?: string | null | undefined;
|
|
25
|
-
activeOrganizationId?: string | null | undefined;
|
|
26
29
|
}, Error, void, unknown>;
|
|
27
30
|
};
|
|
28
31
|
//# sourceMappingURL=use-workspace-mutation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-workspace-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-workspace-mutation.ts"],"names":[],"mappings":"AASA,wBAAgB,oBAAoB
|
|
1
|
+
{"version":3,"file":"use-workspace-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-workspace-mutation.ts"],"names":[],"mappings":"AASA,wBAAgB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BnC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export type { AuthStatus, CurrentUser
|
|
1
|
+
export type { AuthStatus, CurrentUser } from "@voyantjs/auth/workspace";
|
|
2
2
|
export { defaultFetcher, fetchWithValidation, VoyantApiError, type VoyantFetcher, withQueryParams, } from "./client.js";
|
|
3
3
|
export * from "./hooks/index.js";
|
|
4
4
|
export { useVoyantAuthContext, type VoyantAuthContextValue, VoyantAuthProvider, type VoyantAuthProviderProps, } from "./provider.js";
|
|
5
|
-
export type
|
|
6
|
-
export { authQueryKeys } from "./query-keys.js";
|
|
5
|
+
export { authQueryKeys, type OrganizationInvitationsListFilters, type OrganizationMembersListFilters, } from "./query-keys.js";
|
|
7
6
|
export { getAuthStatusQueryOptions, getCurrentUserQueryOptions, getCurrentWorkspaceQueryOptions, getOrganizationInvitationsQueryOptions, getOrganizationMembersQueryOptions, } from "./query-options.js";
|
|
8
7
|
export * from "./schemas.js";
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACvE,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,EAClB,eAAe,GAChB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,oBAAoB,EACpB,KAAK,sBAAsB,EAC3B,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,aAAa,EACb,KAAK,kCAAkC,EACvC,KAAK,8BAA8B,GACpC,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,EAC/B,sCAAsC,EACtC,kCAAkC,GACnC,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { defaultFetcher, fetchWithValidation, VoyantApiError, withQueryParams, } from "./client.js";
|
|
2
2
|
export * from "./hooks/index.js";
|
|
3
3
|
export { useVoyantAuthContext, VoyantAuthProvider, } from "./provider.js";
|
|
4
|
-
export { authQueryKeys } from "./query-keys.js";
|
|
4
|
+
export { authQueryKeys, } from "./query-keys.js";
|
|
5
5
|
export { getAuthStatusQueryOptions, getCurrentUserQueryOptions, getCurrentWorkspaceQueryOptions, getOrganizationInvitationsQueryOptions, getOrganizationMembersQueryOptions, } from "./query-options.js";
|
|
6
6
|
export * from "./schemas.js";
|
package/dist/query-keys.d.ts
CHANGED
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
export interface OrganizationMembersListFilters {
|
|
2
|
-
|
|
3
|
-
offset?: number | string | undefined;
|
|
4
|
-
sortBy?: string | undefined;
|
|
5
|
-
sortDirection?: "asc" | "desc" | undefined;
|
|
6
|
-
filterField?: string | undefined;
|
|
7
|
-
filterValue?: string | number | boolean | Array<string | number> | undefined;
|
|
8
|
-
filterOperator?: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
9
|
-
organizationId?: string | undefined;
|
|
10
|
-
organizationSlug?: string | undefined;
|
|
2
|
+
organizationId?: string;
|
|
11
3
|
}
|
|
12
4
|
export interface OrganizationInvitationsListFilters {
|
|
13
|
-
organizationId?: string
|
|
5
|
+
organizationId?: string;
|
|
14
6
|
}
|
|
15
7
|
export declare const authQueryKeys: {
|
|
16
8
|
all: readonly ["auth"];
|
|
17
9
|
currentUser: () => readonly ["auth", "current-user"];
|
|
18
|
-
currentWorkspace: () => readonly ["auth", "current-workspace"];
|
|
19
10
|
authStatus: () => readonly ["auth", "status"];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
organizationInvitations: () => readonly ["auth", "organization-invitations"];
|
|
23
|
-
organizationInvitationsList: (filters?: OrganizationInvitationsListFilters) => readonly ["auth", "organization-invitations", "list", OrganizationInvitationsListFilters];
|
|
11
|
+
currentWorkspace: () => readonly ["auth", "current-workspace"];
|
|
12
|
+
organizationMembers: (filters?: OrganizationMembersListFilters) => readonly ["auth", "organization-members", OrganizationMembersListFilters];
|
|
13
|
+
organizationInvitations: (filters?: OrganizationInvitationsListFilters) => readonly ["auth", "organization-invitations", OrganizationInvitationsListFilters];
|
|
24
14
|
};
|
|
25
15
|
//# sourceMappingURL=query-keys.d.ts.map
|
package/dist/query-keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,8BAA8B;IAC7C,
|
|
1
|
+
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,8BAA8B;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,kCAAkC;IACjD,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,eAAO,MAAM,aAAa;;;;;oCAKO,8BAA8B;wCAE1B,kCAAkC;CAEtE,CAAA"}
|
package/dist/query-keys.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export const authQueryKeys = {
|
|
2
2
|
all: ["auth"],
|
|
3
3
|
currentUser: () => [...authQueryKeys.all, "current-user"],
|
|
4
|
-
currentWorkspace: () => [...authQueryKeys.all, "current-workspace"],
|
|
5
4
|
authStatus: () => [...authQueryKeys.all, "status"],
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
organizationInvitations: () => [...authQueryKeys.all, "organization-invitations"],
|
|
9
|
-
organizationInvitationsList: (filters = {}) => [...authQueryKeys.organizationInvitations(), "list", filters],
|
|
5
|
+
currentWorkspace: () => [...authQueryKeys.all, "current-workspace"],
|
|
6
|
+
organizationMembers: (filters = {}) => [...authQueryKeys.all, "organization-members", filters],
|
|
7
|
+
organizationInvitations: (filters = {}) => [...authQueryKeys.all, "organization-invitations", filters],
|
|
10
8
|
};
|
package/dist/query-options.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export declare function getCurrentUserQueryOptions(client: FetchWithValidationOp
|
|
|
9
9
|
isSupportUser: boolean;
|
|
10
10
|
createdAt: string;
|
|
11
11
|
profilePictureUrl?: string | null | undefined;
|
|
12
|
-
activeOrganizationId?: string | null | undefined;
|
|
13
12
|
}, Error, {
|
|
14
13
|
id: string;
|
|
15
14
|
email: string;
|
|
@@ -19,7 +18,6 @@ export declare function getCurrentUserQueryOptions(client: FetchWithValidationOp
|
|
|
19
18
|
isSupportUser: boolean;
|
|
20
19
|
createdAt: string;
|
|
21
20
|
profilePictureUrl?: string | null | undefined;
|
|
22
|
-
activeOrganizationId?: string | null | undefined;
|
|
23
21
|
}, readonly ["auth", "current-user"]>, "queryFn"> & {
|
|
24
22
|
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
25
23
|
id: string;
|
|
@@ -30,7 +28,6 @@ export declare function getCurrentUserQueryOptions(client: FetchWithValidationOp
|
|
|
30
28
|
isSupportUser: boolean;
|
|
31
29
|
createdAt: string;
|
|
32
30
|
profilePictureUrl?: string | null | undefined;
|
|
33
|
-
activeOrganizationId?: string | null | undefined;
|
|
34
31
|
}, readonly ["auth", "current-user"], never> | undefined;
|
|
35
32
|
} & {
|
|
36
33
|
queryKey: readonly ["auth", "current-user"] & {
|
|
@@ -43,91 +40,106 @@ export declare function getCurrentUserQueryOptions(client: FetchWithValidationOp
|
|
|
43
40
|
isSupportUser: boolean;
|
|
44
41
|
createdAt: string;
|
|
45
42
|
profilePictureUrl?: string | null | undefined;
|
|
46
|
-
|
|
43
|
+
};
|
|
44
|
+
[dataTagErrorSymbol]: Error;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export declare function getAuthStatusQueryOptions(client: FetchWithValidationOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
48
|
+
userExists: boolean;
|
|
49
|
+
authenticated: boolean;
|
|
50
|
+
reason?: string | undefined;
|
|
51
|
+
}, Error, {
|
|
52
|
+
userExists: boolean;
|
|
53
|
+
authenticated: boolean;
|
|
54
|
+
reason?: string | undefined;
|
|
55
|
+
}, readonly ["auth", "status"]>, "queryFn"> & {
|
|
56
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
57
|
+
userExists: boolean;
|
|
58
|
+
authenticated: boolean;
|
|
59
|
+
reason?: string | undefined;
|
|
60
|
+
}, readonly ["auth", "status"], never> | undefined;
|
|
61
|
+
} & {
|
|
62
|
+
queryKey: readonly ["auth", "status"] & {
|
|
63
|
+
[dataTagSymbol]: {
|
|
64
|
+
userExists: boolean;
|
|
65
|
+
authenticated: boolean;
|
|
66
|
+
reason?: string | undefined;
|
|
47
67
|
};
|
|
48
68
|
[dataTagErrorSymbol]: Error;
|
|
49
69
|
};
|
|
50
70
|
};
|
|
51
71
|
export declare function getCurrentWorkspaceQueryOptions(client: FetchWithValidationOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
52
|
-
organizations: {
|
|
53
|
-
id: string;
|
|
54
|
-
name: string;
|
|
55
|
-
slug: string;
|
|
56
|
-
logo?: string | null | undefined;
|
|
57
|
-
}[];
|
|
58
72
|
activeOrganization: {
|
|
59
73
|
id: string;
|
|
60
74
|
name: string;
|
|
61
|
-
slug
|
|
75
|
+
slug?: string | null | undefined;
|
|
62
76
|
logo?: string | null | undefined;
|
|
77
|
+
createdAt?: string | null | undefined;
|
|
78
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
63
79
|
} | null;
|
|
64
|
-
}, Error, {
|
|
65
80
|
organizations: {
|
|
66
81
|
id: string;
|
|
67
82
|
name: string;
|
|
68
|
-
slug
|
|
83
|
+
slug?: string | null | undefined;
|
|
69
84
|
logo?: string | null | undefined;
|
|
85
|
+
createdAt?: string | null | undefined;
|
|
86
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
70
87
|
}[];
|
|
88
|
+
}, Error, {
|
|
71
89
|
activeOrganization: {
|
|
72
90
|
id: string;
|
|
73
91
|
name: string;
|
|
74
|
-
slug
|
|
92
|
+
slug?: string | null | undefined;
|
|
75
93
|
logo?: string | null | undefined;
|
|
94
|
+
createdAt?: string | null | undefined;
|
|
95
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
76
96
|
} | null;
|
|
97
|
+
organizations: {
|
|
98
|
+
id: string;
|
|
99
|
+
name: string;
|
|
100
|
+
slug?: string | null | undefined;
|
|
101
|
+
logo?: string | null | undefined;
|
|
102
|
+
createdAt?: string | null | undefined;
|
|
103
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
104
|
+
}[];
|
|
77
105
|
}, readonly ["auth", "current-workspace"]>, "queryFn"> & {
|
|
78
106
|
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
79
|
-
|
|
107
|
+
activeOrganization: {
|
|
80
108
|
id: string;
|
|
81
109
|
name: string;
|
|
82
|
-
slug
|
|
110
|
+
slug?: string | null | undefined;
|
|
83
111
|
logo?: string | null | undefined;
|
|
84
|
-
|
|
85
|
-
|
|
112
|
+
createdAt?: string | null | undefined;
|
|
113
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
114
|
+
} | null;
|
|
115
|
+
organizations: {
|
|
86
116
|
id: string;
|
|
87
117
|
name: string;
|
|
88
|
-
slug
|
|
118
|
+
slug?: string | null | undefined;
|
|
89
119
|
logo?: string | null | undefined;
|
|
90
|
-
|
|
120
|
+
createdAt?: string | null | undefined;
|
|
121
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
122
|
+
}[];
|
|
91
123
|
}, readonly ["auth", "current-workspace"], never> | undefined;
|
|
92
124
|
} & {
|
|
93
125
|
queryKey: readonly ["auth", "current-workspace"] & {
|
|
94
126
|
[dataTagSymbol]: {
|
|
95
|
-
|
|
127
|
+
activeOrganization: {
|
|
96
128
|
id: string;
|
|
97
129
|
name: string;
|
|
98
|
-
slug
|
|
130
|
+
slug?: string | null | undefined;
|
|
99
131
|
logo?: string | null | undefined;
|
|
100
|
-
|
|
101
|
-
|
|
132
|
+
createdAt?: string | null | undefined;
|
|
133
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
134
|
+
} | null;
|
|
135
|
+
organizations: {
|
|
102
136
|
id: string;
|
|
103
137
|
name: string;
|
|
104
|
-
slug
|
|
138
|
+
slug?: string | null | undefined;
|
|
105
139
|
logo?: string | null | undefined;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
export declare function getAuthStatusQueryOptions(client: FetchWithValidationOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
112
|
-
userExists: boolean;
|
|
113
|
-
authenticated: boolean;
|
|
114
|
-
reason?: string | undefined;
|
|
115
|
-
}, Error, {
|
|
116
|
-
userExists: boolean;
|
|
117
|
-
authenticated: boolean;
|
|
118
|
-
reason?: string | undefined;
|
|
119
|
-
}, readonly ["auth", "status"]>, "queryFn"> & {
|
|
120
|
-
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
121
|
-
userExists: boolean;
|
|
122
|
-
authenticated: boolean;
|
|
123
|
-
reason?: string | undefined;
|
|
124
|
-
}, readonly ["auth", "status"], never> | undefined;
|
|
125
|
-
} & {
|
|
126
|
-
queryKey: readonly ["auth", "status"] & {
|
|
127
|
-
[dataTagSymbol]: {
|
|
128
|
-
userExists: boolean;
|
|
129
|
-
authenticated: boolean;
|
|
130
|
-
reason?: string | undefined;
|
|
140
|
+
createdAt?: string | null | undefined;
|
|
141
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
142
|
+
}[];
|
|
131
143
|
};
|
|
132
144
|
[dataTagErrorSymbol]: Error;
|
|
133
145
|
};
|
|
@@ -135,71 +147,63 @@ export declare function getAuthStatusQueryOptions(client: FetchWithValidationOpt
|
|
|
135
147
|
export declare function getOrganizationMembersQueryOptions(filters: OrganizationMembersListFilters, client: FetchWithValidationOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
136
148
|
members: {
|
|
137
149
|
id: string;
|
|
138
|
-
organizationId: string;
|
|
139
150
|
userId: string;
|
|
151
|
+
organizationId: string;
|
|
140
152
|
role: string | string[];
|
|
141
153
|
createdAt: string;
|
|
142
154
|
user: {
|
|
143
155
|
id: string;
|
|
144
156
|
email: string;
|
|
145
|
-
name
|
|
157
|
+
name?: string | null | undefined;
|
|
146
158
|
image?: string | null | undefined;
|
|
147
159
|
};
|
|
148
|
-
teamId?: string | undefined;
|
|
149
160
|
}[];
|
|
150
|
-
total: number;
|
|
151
161
|
}, Error, {
|
|
152
162
|
members: {
|
|
153
163
|
id: string;
|
|
154
|
-
organizationId: string;
|
|
155
164
|
userId: string;
|
|
165
|
+
organizationId: string;
|
|
156
166
|
role: string | string[];
|
|
157
167
|
createdAt: string;
|
|
158
168
|
user: {
|
|
159
169
|
id: string;
|
|
160
170
|
email: string;
|
|
161
|
-
name
|
|
171
|
+
name?: string | null | undefined;
|
|
162
172
|
image?: string | null | undefined;
|
|
163
173
|
};
|
|
164
|
-
teamId?: string | undefined;
|
|
165
174
|
}[];
|
|
166
|
-
|
|
167
|
-
}, readonly ["auth", "organization-members", "list", OrganizationMembersListFilters]>, "queryFn"> & {
|
|
175
|
+
}, readonly ["auth", "organization-members", OrganizationMembersListFilters]>, "queryFn"> & {
|
|
168
176
|
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
169
177
|
members: {
|
|
170
178
|
id: string;
|
|
171
|
-
organizationId: string;
|
|
172
179
|
userId: string;
|
|
180
|
+
organizationId: string;
|
|
173
181
|
role: string | string[];
|
|
174
182
|
createdAt: string;
|
|
175
183
|
user: {
|
|
176
184
|
id: string;
|
|
177
185
|
email: string;
|
|
178
|
-
name
|
|
186
|
+
name?: string | null | undefined;
|
|
179
187
|
image?: string | null | undefined;
|
|
180
188
|
};
|
|
181
|
-
teamId?: string | undefined;
|
|
182
189
|
}[];
|
|
183
|
-
|
|
184
|
-
}, readonly ["auth", "organization-members", "list", OrganizationMembersListFilters], never> | undefined;
|
|
190
|
+
}, readonly ["auth", "organization-members", OrganizationMembersListFilters], never> | undefined;
|
|
185
191
|
} & {
|
|
186
|
-
queryKey: readonly ["auth", "organization-members",
|
|
192
|
+
queryKey: readonly ["auth", "organization-members", OrganizationMembersListFilters] & {
|
|
187
193
|
[dataTagSymbol]: {
|
|
188
194
|
members: {
|
|
189
195
|
id: string;
|
|
190
|
-
organizationId: string;
|
|
191
196
|
userId: string;
|
|
197
|
+
organizationId: string;
|
|
192
198
|
role: string | string[];
|
|
193
199
|
createdAt: string;
|
|
194
200
|
user: {
|
|
195
201
|
id: string;
|
|
196
202
|
email: string;
|
|
197
|
-
name
|
|
203
|
+
name?: string | null | undefined;
|
|
198
204
|
image?: string | null | undefined;
|
|
199
205
|
};
|
|
200
|
-
teamId?: string | undefined;
|
|
201
206
|
}[];
|
|
202
|
-
total: number;
|
|
203
207
|
};
|
|
204
208
|
[dataTagErrorSymbol]: Error;
|
|
205
209
|
};
|
|
@@ -209,48 +213,43 @@ export declare function getOrganizationInvitationsQueryOptions(filters: Organiza
|
|
|
209
213
|
organizationId: string;
|
|
210
214
|
email: string;
|
|
211
215
|
role: string | string[];
|
|
212
|
-
status:
|
|
213
|
-
inviterId: string;
|
|
216
|
+
status: string;
|
|
214
217
|
expiresAt: string;
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
inviterId?: string | null | undefined;
|
|
219
|
+
createdAt?: string | null | undefined;
|
|
217
220
|
}[], Error, {
|
|
218
221
|
id: string;
|
|
219
222
|
organizationId: string;
|
|
220
223
|
email: string;
|
|
221
224
|
role: string | string[];
|
|
222
|
-
status:
|
|
223
|
-
inviterId: string;
|
|
225
|
+
status: string;
|
|
224
226
|
expiresAt: string;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}[], readonly ["auth", "organization-invitations",
|
|
227
|
+
inviterId?: string | null | undefined;
|
|
228
|
+
createdAt?: string | null | undefined;
|
|
229
|
+
}[], readonly ["auth", "organization-invitations", OrganizationInvitationsListFilters]>, "queryFn"> & {
|
|
228
230
|
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
229
231
|
id: string;
|
|
230
232
|
organizationId: string;
|
|
231
233
|
email: string;
|
|
232
234
|
role: string | string[];
|
|
233
|
-
status:
|
|
234
|
-
inviterId: string;
|
|
235
|
+
status: string;
|
|
235
236
|
expiresAt: string;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}[], readonly ["auth", "organization-invitations",
|
|
237
|
+
inviterId?: string | null | undefined;
|
|
238
|
+
createdAt?: string | null | undefined;
|
|
239
|
+
}[], readonly ["auth", "organization-invitations", OrganizationInvitationsListFilters], never> | undefined;
|
|
239
240
|
} & {
|
|
240
|
-
queryKey: readonly ["auth", "organization-invitations",
|
|
241
|
+
queryKey: readonly ["auth", "organization-invitations", OrganizationInvitationsListFilters] & {
|
|
241
242
|
[dataTagSymbol]: {
|
|
242
243
|
id: string;
|
|
243
244
|
organizationId: string;
|
|
244
245
|
email: string;
|
|
245
246
|
role: string | string[];
|
|
246
|
-
status:
|
|
247
|
-
inviterId: string;
|
|
247
|
+
status: string;
|
|
248
248
|
expiresAt: string;
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
inviterId?: string | null | undefined;
|
|
250
|
+
createdAt?: string | null | undefined;
|
|
251
251
|
}[];
|
|
252
252
|
[dataTagErrorSymbol]: Error;
|
|
253
253
|
};
|
|
254
254
|
};
|
|
255
|
-
export type { OrganizationInvitationsListFilters, OrganizationMembersListFilters, } from "./query-keys.js";
|
|
256
255
|
//# sourceMappingURL=query-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAwC,MAAM,aAAa,CAAA;AACnG,OAAO,EAEL,KAAK,kCAAkC,EACvC,KAAK,8BAA8B,EACpC,MAAM,iBAAiB,CAAA;AASxB,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,0BAA0B
|
|
1
|
+
{"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAwC,MAAM,aAAa,CAAA;AACnG,OAAO,EAEL,KAAK,kCAAkC,EACvC,KAAK,8BAA8B,EACpC,MAAM,iBAAiB,CAAA;AASxB,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5E;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;EAK3E;AAED,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKjF;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,8BAA8B,EACvC,MAAM,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWnC;AAED,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,kCAAkC,EAC3C,MAAM,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWnC"}
|
package/dist/query-options.js
CHANGED
|
@@ -2,34 +2,34 @@
|
|
|
2
2
|
import { queryOptions } from "@tanstack/react-query";
|
|
3
3
|
import { fetchWithValidation, withQueryParams } from "./client.js";
|
|
4
4
|
import { authQueryKeys, } from "./query-keys.js";
|
|
5
|
-
import { authStatusSchema, currentUserSchema, currentWorkspaceSchema,
|
|
5
|
+
import { authStatusSchema, currentUserSchema, currentWorkspaceSchema, organizationInvitationsResponseSchema, organizationMembersResponseSchema, } from "./schemas.js";
|
|
6
6
|
export function getCurrentUserQueryOptions(client) {
|
|
7
7
|
return queryOptions({
|
|
8
8
|
queryKey: authQueryKeys.currentUser(),
|
|
9
9
|
queryFn: () => fetchWithValidation("/auth/me", currentUserSchema, client),
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
export function getCurrentWorkspaceQueryOptions(client) {
|
|
13
|
-
return queryOptions({
|
|
14
|
-
queryKey: authQueryKeys.currentWorkspace(),
|
|
15
|
-
queryFn: () => fetchWithValidation("/auth/workspace", currentWorkspaceSchema, client),
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
12
|
export function getAuthStatusQueryOptions(client) {
|
|
19
13
|
return queryOptions({
|
|
20
14
|
queryKey: authQueryKeys.authStatus(),
|
|
21
15
|
queryFn: () => fetchWithValidation("/auth/status", authStatusSchema, client),
|
|
22
16
|
});
|
|
23
17
|
}
|
|
18
|
+
export function getCurrentWorkspaceQueryOptions(client) {
|
|
19
|
+
return queryOptions({
|
|
20
|
+
queryKey: authQueryKeys.currentWorkspace(),
|
|
21
|
+
queryFn: () => fetchWithValidation("/auth/workspace/current", currentWorkspaceSchema, client),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
24
|
export function getOrganizationMembersQueryOptions(filters, client) {
|
|
25
25
|
return queryOptions({
|
|
26
|
-
queryKey: authQueryKeys.
|
|
27
|
-
queryFn: () => fetchWithValidation(withQueryParams("/auth/organization/list-members", filters),
|
|
26
|
+
queryKey: authQueryKeys.organizationMembers(filters),
|
|
27
|
+
queryFn: () => fetchWithValidation(withQueryParams("/auth/organization/list-members", filters), organizationMembersResponseSchema, client),
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
export function getOrganizationInvitationsQueryOptions(filters, client) {
|
|
31
31
|
return queryOptions({
|
|
32
|
-
queryKey: authQueryKeys.
|
|
33
|
-
queryFn: () => fetchWithValidation(withQueryParams("/auth/organization/list-invitations", filters),
|
|
32
|
+
queryKey: authQueryKeys.organizationInvitations(filters),
|
|
33
|
+
queryFn: () => fetchWithValidation(withQueryParams("/auth/organization/list-invitations", filters), organizationInvitationsResponseSchema, client),
|
|
34
34
|
});
|
|
35
35
|
}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,33 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const organizationRoleSchema: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
3
|
-
export declare const organizationInvitationStatusSchema: z.ZodEnum<{
|
|
4
|
-
pending: "pending";
|
|
5
|
-
accepted: "accepted";
|
|
6
|
-
rejected: "rejected";
|
|
7
|
-
canceled: "canceled";
|
|
8
|
-
}>;
|
|
9
|
-
export declare const workspaceOrganizationSchema: z.ZodObject<{
|
|
10
|
-
id: z.ZodString;
|
|
11
|
-
name: z.ZodString;
|
|
12
|
-
slug: z.ZodString;
|
|
13
|
-
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
export type WorkspaceOrganization = z.infer<typeof workspaceOrganizationSchema>;
|
|
16
|
-
export declare const currentWorkspaceSchema: z.ZodObject<{
|
|
17
|
-
organizations: z.ZodArray<z.ZodObject<{
|
|
18
|
-
id: z.ZodString;
|
|
19
|
-
name: z.ZodString;
|
|
20
|
-
slug: z.ZodString;
|
|
21
|
-
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
-
}, z.core.$strip>>;
|
|
23
|
-
activeOrganization: z.ZodNullable<z.ZodObject<{
|
|
24
|
-
id: z.ZodString;
|
|
25
|
-
name: z.ZodString;
|
|
26
|
-
slug: z.ZodString;
|
|
27
|
-
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
-
}, z.core.$strip>>;
|
|
29
|
-
}, z.core.$strip>;
|
|
30
|
-
export type CurrentWorkspace = z.infer<typeof currentWorkspaceSchema>;
|
|
31
2
|
export declare const currentUserSchema: z.ZodObject<{
|
|
32
3
|
id: z.ZodString;
|
|
33
4
|
email: z.ZodString;
|
|
@@ -37,7 +8,6 @@ export declare const currentUserSchema: z.ZodObject<{
|
|
|
37
8
|
isSupportUser: z.ZodBoolean;
|
|
38
9
|
createdAt: z.ZodString;
|
|
39
10
|
profilePictureUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
-
activeOrganizationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
11
|
}, z.core.$strip>;
|
|
42
12
|
export type CurrentUser = z.infer<typeof currentUserSchema>;
|
|
43
13
|
export declare const authStatusSchema: z.ZodObject<{
|
|
@@ -46,61 +16,81 @@ export declare const authStatusSchema: z.ZodObject<{
|
|
|
46
16
|
reason: z.ZodOptional<z.ZodString>;
|
|
47
17
|
}, z.core.$strip>;
|
|
48
18
|
export type AuthStatus = z.infer<typeof authStatusSchema>;
|
|
49
|
-
export declare const
|
|
19
|
+
export declare const organizationRoleSchema: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
20
|
+
export type OrganizationRole = z.infer<typeof organizationRoleSchema>;
|
|
21
|
+
export declare const organizationSummarySchema: z.ZodObject<{
|
|
50
22
|
id: z.ZodString;
|
|
51
|
-
email: z.ZodString;
|
|
52
23
|
name: z.ZodString;
|
|
53
|
-
|
|
24
|
+
slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
54
28
|
}, z.core.$strip>;
|
|
55
|
-
export type
|
|
29
|
+
export type OrganizationSummary = z.infer<typeof organizationSummarySchema>;
|
|
30
|
+
export declare const currentWorkspaceSchema: z.ZodObject<{
|
|
31
|
+
activeOrganization: z.ZodNullable<z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
organizations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
44
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
46
|
+
}, z.core.$strip>>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type CurrentWorkspace = z.infer<typeof currentWorkspaceSchema>;
|
|
56
49
|
export declare const organizationMemberSchema: z.ZodObject<{
|
|
57
50
|
id: z.ZodString;
|
|
58
|
-
organizationId: z.ZodString;
|
|
59
51
|
userId: z.ZodString;
|
|
52
|
+
organizationId: z.ZodString;
|
|
60
53
|
role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
61
54
|
createdAt: z.ZodString;
|
|
62
|
-
teamId: z.ZodOptional<z.ZodString>;
|
|
63
55
|
user: z.ZodObject<{
|
|
64
56
|
id: z.ZodString;
|
|
65
57
|
email: z.ZodString;
|
|
66
|
-
name: z.ZodString
|
|
58
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
59
|
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
68
60
|
}, z.core.$strip>;
|
|
69
61
|
}, z.core.$strip>;
|
|
70
62
|
export type OrganizationMember = z.infer<typeof organizationMemberSchema>;
|
|
71
|
-
export declare const
|
|
63
|
+
export declare const organizationMembersResponseSchema: z.ZodObject<{
|
|
72
64
|
members: z.ZodArray<z.ZodObject<{
|
|
73
65
|
id: z.ZodString;
|
|
74
|
-
organizationId: z.ZodString;
|
|
75
66
|
userId: z.ZodString;
|
|
67
|
+
organizationId: z.ZodString;
|
|
76
68
|
role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
77
69
|
createdAt: z.ZodString;
|
|
78
|
-
teamId: z.ZodOptional<z.ZodString>;
|
|
79
70
|
user: z.ZodObject<{
|
|
80
71
|
id: z.ZodString;
|
|
81
72
|
email: z.ZodString;
|
|
82
|
-
name: z.ZodString
|
|
73
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
74
|
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
75
|
}, z.core.$strip>;
|
|
85
76
|
}, z.core.$strip>>;
|
|
86
|
-
total: z.ZodNumber;
|
|
87
77
|
}, z.core.$strip>;
|
|
88
|
-
export type
|
|
78
|
+
export type OrganizationMembersResponse = z.infer<typeof organizationMembersResponseSchema>;
|
|
89
79
|
export declare const organizationRemoveMemberSchema: z.ZodObject<{
|
|
90
|
-
member: z.ZodObject<{
|
|
80
|
+
member: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
91
81
|
id: z.ZodString;
|
|
92
|
-
organizationId: z.ZodString;
|
|
93
82
|
userId: z.ZodString;
|
|
83
|
+
organizationId: z.ZodString;
|
|
94
84
|
role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
95
85
|
createdAt: z.ZodString;
|
|
96
|
-
teamId: z.ZodOptional<z.ZodString>;
|
|
97
86
|
user: z.ZodObject<{
|
|
98
87
|
id: z.ZodString;
|
|
99
88
|
email: z.ZodString;
|
|
100
|
-
name: z.ZodString
|
|
89
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
90
|
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
102
91
|
}, z.core.$strip>;
|
|
103
|
-
}, z.core.$strip
|
|
92
|
+
}, z.core.$strip>>>;
|
|
93
|
+
success: z.ZodOptional<z.ZodBoolean>;
|
|
104
94
|
}, z.core.$strip>;
|
|
105
95
|
export type OrganizationRemoveMemberResult = z.infer<typeof organizationRemoveMemberSchema>;
|
|
106
96
|
export declare const organizationInvitationSchema: z.ZodObject<{
|
|
@@ -108,33 +98,21 @@ export declare const organizationInvitationSchema: z.ZodObject<{
|
|
|
108
98
|
organizationId: z.ZodString;
|
|
109
99
|
email: z.ZodString;
|
|
110
100
|
role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
111
|
-
status: z.
|
|
112
|
-
|
|
113
|
-
accepted: "accepted";
|
|
114
|
-
rejected: "rejected";
|
|
115
|
-
canceled: "canceled";
|
|
116
|
-
}>;
|
|
117
|
-
inviterId: z.ZodString;
|
|
101
|
+
status: z.ZodString;
|
|
102
|
+
inviterId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
103
|
expiresAt: z.ZodString;
|
|
119
|
-
createdAt: z.ZodString
|
|
120
|
-
teamId: z.ZodOptional<z.ZodString>;
|
|
104
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
121
105
|
}, z.core.$strip>;
|
|
122
106
|
export type OrganizationInvitation = z.infer<typeof organizationInvitationSchema>;
|
|
123
|
-
export declare const
|
|
107
|
+
export declare const organizationInvitationsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
124
108
|
id: z.ZodString;
|
|
125
109
|
organizationId: z.ZodString;
|
|
126
110
|
email: z.ZodString;
|
|
127
111
|
role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
128
|
-
status: z.
|
|
129
|
-
|
|
130
|
-
accepted: "accepted";
|
|
131
|
-
rejected: "rejected";
|
|
132
|
-
canceled: "canceled";
|
|
133
|
-
}>;
|
|
134
|
-
inviterId: z.ZodString;
|
|
112
|
+
status: z.ZodString;
|
|
113
|
+
inviterId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
114
|
expiresAt: z.ZodString;
|
|
136
|
-
createdAt: z.ZodString
|
|
137
|
-
teamId: z.ZodOptional<z.ZodString>;
|
|
115
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
138
116
|
}, z.core.$strip>>;
|
|
139
|
-
export type
|
|
117
|
+
export type OrganizationInvitationsResponse = z.infer<typeof organizationInvitationsResponseSchema>;
|
|
140
118
|
//# sourceMappingURL=schemas.d.ts.map
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB;;;;;;;;;iBAS5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,sBAAsB,6DAA6C,CAAA;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE,eAAO,MAAM,yBAAyB;;;;;;;iBAOpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;iBAGjC,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AASrE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;iBAOnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;iBAE5C,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAE3F,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;iBAGzC,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AAE3F,eAAO,MAAM,4BAA4B;;;;;;;;;iBASvC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEjF,eAAO,MAAM,qCAAqC;;;;;;;;;kBAAwC,CAAA;AAC1F,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAA"}
|
package/dist/schemas.js
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export const organizationRoleSchema = z.union([z.string(), z.array(z.string())]);
|
|
3
|
-
export const organizationInvitationStatusSchema = z.enum([
|
|
4
|
-
"pending",
|
|
5
|
-
"accepted",
|
|
6
|
-
"rejected",
|
|
7
|
-
"canceled",
|
|
8
|
-
]);
|
|
9
|
-
export const workspaceOrganizationSchema = z.object({
|
|
10
|
-
id: z.string(),
|
|
11
|
-
name: z.string(),
|
|
12
|
-
slug: z.string(),
|
|
13
|
-
logo: z.string().nullable().optional(),
|
|
14
|
-
});
|
|
15
|
-
export const currentWorkspaceSchema = z.object({
|
|
16
|
-
organizations: z.array(workspaceOrganizationSchema),
|
|
17
|
-
activeOrganization: workspaceOrganizationSchema.nullable(),
|
|
18
|
-
});
|
|
19
2
|
export const currentUserSchema = z.object({
|
|
20
3
|
id: z.string(),
|
|
21
4
|
email: z.string(),
|
|
@@ -25,44 +8,54 @@ export const currentUserSchema = z.object({
|
|
|
25
8
|
isSupportUser: z.boolean(),
|
|
26
9
|
createdAt: z.string(),
|
|
27
10
|
profilePictureUrl: z.string().nullable().optional(),
|
|
28
|
-
activeOrganizationId: z.string().nullable().optional(),
|
|
29
11
|
});
|
|
30
12
|
export const authStatusSchema = z.object({
|
|
31
13
|
userExists: z.boolean(),
|
|
32
14
|
authenticated: z.boolean(),
|
|
33
15
|
reason: z.string().optional(),
|
|
34
16
|
});
|
|
35
|
-
export const
|
|
17
|
+
export const organizationRoleSchema = z.union([z.string(), z.array(z.string())]);
|
|
18
|
+
export const organizationSummarySchema = z.object({
|
|
36
19
|
id: z.string(),
|
|
37
|
-
email: z.string(),
|
|
38
20
|
name: z.string(),
|
|
21
|
+
slug: z.string().nullable().optional(),
|
|
22
|
+
logo: z.string().nullable().optional(),
|
|
23
|
+
createdAt: z.string().nullable().optional(),
|
|
24
|
+
metadata: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
25
|
+
});
|
|
26
|
+
export const currentWorkspaceSchema = z.object({
|
|
27
|
+
activeOrganization: organizationSummarySchema.nullable(),
|
|
28
|
+
organizations: z.array(organizationSummarySchema).default([]),
|
|
29
|
+
});
|
|
30
|
+
const organizationMemberUserSchema = z.object({
|
|
31
|
+
id: z.string(),
|
|
32
|
+
email: z.string(),
|
|
33
|
+
name: z.string().nullable().optional(),
|
|
39
34
|
image: z.string().nullable().optional(),
|
|
40
35
|
});
|
|
41
36
|
export const organizationMemberSchema = z.object({
|
|
42
37
|
id: z.string(),
|
|
43
|
-
organizationId: z.string(),
|
|
44
38
|
userId: z.string(),
|
|
39
|
+
organizationId: z.string(),
|
|
45
40
|
role: organizationRoleSchema,
|
|
46
41
|
createdAt: z.string(),
|
|
47
|
-
teamId: z.string().optional(),
|
|
48
42
|
user: organizationMemberUserSchema,
|
|
49
43
|
});
|
|
50
|
-
export const
|
|
44
|
+
export const organizationMembersResponseSchema = z.object({
|
|
51
45
|
members: z.array(organizationMemberSchema),
|
|
52
|
-
total: z.number(),
|
|
53
46
|
});
|
|
54
47
|
export const organizationRemoveMemberSchema = z.object({
|
|
55
|
-
member: organizationMemberSchema,
|
|
48
|
+
member: organizationMemberSchema.nullable().optional(),
|
|
49
|
+
success: z.boolean().optional(),
|
|
56
50
|
});
|
|
57
51
|
export const organizationInvitationSchema = z.object({
|
|
58
52
|
id: z.string(),
|
|
59
53
|
organizationId: z.string(),
|
|
60
54
|
email: z.string(),
|
|
61
55
|
role: organizationRoleSchema,
|
|
62
|
-
status:
|
|
63
|
-
inviterId: z.string(),
|
|
56
|
+
status: z.string(),
|
|
57
|
+
inviterId: z.string().nullable().optional(),
|
|
64
58
|
expiresAt: z.string(),
|
|
65
|
-
createdAt: z.string(),
|
|
66
|
-
teamId: z.string().optional(),
|
|
59
|
+
createdAt: z.string().nullable().optional(),
|
|
67
60
|
});
|
|
68
|
-
export const
|
|
61
|
+
export const organizationInvitationsResponseSchema = z.array(organizationInvitationSchema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/auth-react",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react": "^19.0.0",
|
|
36
36
|
"react-dom": "^19.0.0",
|
|
37
37
|
"zod": "^4.0.0",
|
|
38
|
-
"@voyantjs/auth": "0.6.
|
|
38
|
+
"@voyantjs/auth": "0.6.9"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"typescript": "^6.0.2",
|
|
47
47
|
"vitest": "^4.1.2",
|
|
48
48
|
"zod": "^4.3.6",
|
|
49
|
-
"@voyantjs/auth": "0.6.
|
|
50
|
-
"@voyantjs/react": "0.6.
|
|
49
|
+
"@voyantjs/auth": "0.6.9",
|
|
50
|
+
"@voyantjs/react": "0.6.9",
|
|
51
51
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@voyantjs/react": "0.6.
|
|
54
|
+
"@voyantjs/react": "0.6.9"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
|
57
57
|
"dist"
|