@shipfox/client-invitations 4.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +47 -0
- package/dist/complete-acceptance.d.ts +1 -1
- package/dist/complete-acceptance.js +1 -1
- package/dist/complete-acceptance.js.map +1 -1
- package/dist/core/invitation-acceptance.d.ts +9 -0
- package/dist/core/invitation-acceptance.d.ts.map +1 -0
- package/dist/core/invitation-acceptance.js +3 -0
- package/dist/core/invitation-acceptance.js.map +1 -0
- package/dist/core/invitation-preview.d.ts +21 -0
- package/dist/core/invitation-preview.d.ts.map +1 -0
- package/dist/core/invitation-preview.js +5 -0
- package/dist/core/invitation-preview.js.map +1 -0
- package/dist/hooks/api/accept-invitation.d.ts +1 -8
- package/dist/hooks/api/accept-invitation.d.ts.map +1 -1
- package/dist/hooks/api/accept-invitation.js +7 -4
- package/dist/hooks/api/accept-invitation.js.map +1 -1
- package/dist/hooks/api/invitation-acceptance-mapper.d.ts +4 -0
- package/dist/hooks/api/invitation-acceptance-mapper.d.ts.map +1 -0
- package/dist/hooks/api/invitation-acceptance-mapper.js +12 -0
- package/dist/hooks/api/invitation-acceptance-mapper.js.map +1 -0
- package/dist/hooks/api/invitation-preview-mapper.d.ts +4 -0
- package/dist/hooks/api/invitation-preview-mapper.d.ts.map +1 -0
- package/dist/hooks/api/invitation-preview-mapper.js +32 -0
- package/dist/hooks/api/invitation-preview-mapper.js.map +1 -0
- package/dist/hooks/api/preview-invitation.d.ts +12 -7
- package/dist/hooks/api/preview-invitation.d.ts.map +1 -1
- package/dist/hooks/api/preview-invitation.js +12 -6
- package/dist/hooks/api/preview-invitation.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/pages/invitation-accept-page.d.ts.map +1 -1
- package/dist/pages/invitation-accept-page.js +17 -19
- package/dist/pages/invitation-accept-page.js.map +1 -1
- package/dist/routes/accept.d.ts +2 -0
- package/dist/routes/accept.d.ts.map +1 -1
- package/dist/routes/accept.js +2 -0
- package/dist/routes/accept.js.map +1 -1
- package/dist/routes/inputs.d.ts +5 -0
- package/dist/routes/inputs.d.ts.map +1 -0
- package/dist/routes/inputs.js +8 -0
- package/dist/routes/inputs.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +10 -12
- package/src/complete-acceptance.ts +1 -1
- package/src/core/invitation-acceptance.ts +8 -0
- package/src/core/invitation-preview.ts +18 -0
- package/src/hooks/api/accept-invitation.ts +7 -8
- package/src/hooks/api/invitation-acceptance-mapper.test.ts +23 -0
- package/src/hooks/api/invitation-acceptance-mapper.ts +13 -0
- package/src/hooks/api/invitation-preview-mapper.test.ts +36 -0
- package/src/hooks/api/invitation-preview-mapper.ts +22 -0
- package/src/hooks/api/preview-invitation.ts +24 -9
- package/src/index.ts +3 -0
- package/src/pages/invitation-accept-page.tsx +24 -20
- package/src/routes/accept.tsx +5 -1
- package/src/routes/inputs.test.ts +11 -0
- package/src/routes/inputs.ts +10 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
$ shipfox-swc
|
|
2
|
-
Successfully compiled:
|
|
2
|
+
Successfully compiled: 12 files with swc (210.19ms)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @shipfox/client-invitations
|
|
2
2
|
|
|
3
|
+
## 6.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 475ce59: Republishes all public packages after restoring release authorization.
|
|
8
|
+
- 3f8f1cb: Enforces typed route-input and browser-storage boundaries across client features.
|
|
9
|
+
- Updated dependencies [475ce59]
|
|
10
|
+
- Updated dependencies [3f8f1cb]
|
|
11
|
+
- @shipfox/api-auth-dto@9.0.1
|
|
12
|
+
- @shipfox/api-workspaces-dto@9.0.1
|
|
13
|
+
- @shipfox/client-api@6.0.1
|
|
14
|
+
- @shipfox/client-shell@6.0.1
|
|
15
|
+
- @shipfox/client-ui@6.0.1
|
|
16
|
+
- @shipfox/react-ui@0.3.6
|
|
17
|
+
|
|
18
|
+
## 6.0.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- c56c124: Converges auth sessions and invitation responses on checked domain boundaries.
|
|
23
|
+
- Updated dependencies [401b583]
|
|
24
|
+
- Updated dependencies [82eda45]
|
|
25
|
+
- Updated dependencies [9c9d266]
|
|
26
|
+
- Updated dependencies [cd90c19]
|
|
27
|
+
- Updated dependencies [24be269]
|
|
28
|
+
- Updated dependencies [c56c124]
|
|
29
|
+
- Updated dependencies [4a6d124]
|
|
30
|
+
- Updated dependencies [c02ac42]
|
|
31
|
+
- @shipfox/client-shell@6.0.0
|
|
32
|
+
- @shipfox/api-workspaces-dto@9.0.0
|
|
33
|
+
- @shipfox/client-api@6.0.0
|
|
34
|
+
- @shipfox/api-auth-dto@7.1.0
|
|
35
|
+
- @shipfox/client-ui@6.0.0
|
|
36
|
+
- @shipfox/react-ui@0.3.5
|
|
37
|
+
|
|
38
|
+
## 5.0.0
|
|
39
|
+
|
|
40
|
+
### Major Changes
|
|
41
|
+
|
|
42
|
+
- ffd727b: Converges auth session and invitation state onto shared camelCase domain types validated at the API boundary, replacing the raw snake_case DTOs previously returned by login, signup, password reset, email verification, workspace creation, and invitation preview. `AuthState.user`, `useRefreshAuth()`, and `usePreviewInvitation()` now resolve to `UserIdentity`/`AuthenticatedSession`/`InvitationPreview` shapes (for example `accessToken` instead of `token`, `workspaceName` instead of `workspace_name`). Also moves the shared `AuthShell` component and session mapping helpers into `@shipfox/client-shell`, breaking the former `client-auth` ↔ `client-invitations` circular dependency.
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- 79df9d1: Fixes invitation query declarations for packed TypeScript consumers.
|
|
47
|
+
- Updated dependencies [ffd727b]
|
|
48
|
+
- @shipfox/client-shell@5.0.0
|
|
49
|
+
|
|
3
50
|
## 4.0.0
|
|
4
51
|
|
|
5
52
|
### Patch Changes
|
|
@@ -6,7 +6,7 @@ import type { NavigateOptions } from '@tanstack/react-router';
|
|
|
6
6
|
* routes the user into the workspace home.
|
|
7
7
|
*
|
|
8
8
|
* `refreshAuth` is passed in so this helper stays a plain function (no hook).
|
|
9
|
-
* Call sites construct it via `useRefreshAuth()` from `@shipfox/client-
|
|
9
|
+
* Call sites construct it via `useRefreshAuth()` from `@shipfox/client-shell/runtime`.
|
|
10
10
|
*/
|
|
11
11
|
export declare function completeInvitationAcceptance(params: {
|
|
12
12
|
workspaceId: string;
|
|
@@ -6,7 +6,7 @@ import { toast } from '@shipfox/react-ui/toast';
|
|
|
6
6
|
* routes the user into the workspace home.
|
|
7
7
|
*
|
|
8
8
|
* `refreshAuth` is passed in so this helper stays a plain function (no hook).
|
|
9
|
-
* Call sites construct it via `useRefreshAuth()` from `@shipfox/client-
|
|
9
|
+
* Call sites construct it via `useRefreshAuth()` from `@shipfox/client-shell/runtime`.
|
|
10
10
|
*/ export async function completeInvitationAcceptance(params) {
|
|
11
11
|
// Access tokens embed memberships at issue time, so refresh before AuthGuard
|
|
12
12
|
// reads the accepted workspace.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/complete-acceptance.ts"],"sourcesContent":["import {toast} from '@shipfox/react-ui/toast';\nimport type {NavigateOptions} from '@tanstack/react-router';\n\n/**\n * Final step of every successful invitation accept path (existing-user match,\n * signup-with-invitation success, login-then-accept). Refreshes the auth\n * session so the JWT carries the new membership before navigating, then\n * routes the user into the workspace home.\n *\n * `refreshAuth` is passed in so this helper stays a plain function (no hook).\n * Call sites construct it via `useRefreshAuth()` from `@shipfox/client-
|
|
1
|
+
{"version":3,"sources":["../src/complete-acceptance.ts"],"sourcesContent":["import {toast} from '@shipfox/react-ui/toast';\nimport type {NavigateOptions} from '@tanstack/react-router';\n\n/**\n * Final step of every successful invitation accept path (existing-user match,\n * signup-with-invitation success, login-then-accept). Refreshes the auth\n * session so the JWT carries the new membership before navigating, then\n * routes the user into the workspace home.\n *\n * `refreshAuth` is passed in so this helper stays a plain function (no hook).\n * Call sites construct it via `useRefreshAuth()` from `@shipfox/client-shell/runtime`.\n */\nexport async function completeInvitationAcceptance(params: {\n workspaceId: string;\n workspaceName: string;\n refreshAuth: () => Promise<unknown>;\n navigate: (opts: NavigateOptions) => Promise<void> | void;\n}): Promise<void> {\n // Access tokens embed memberships at issue time, so refresh before AuthGuard\n // reads the accepted workspace.\n try {\n await params.refreshAuth();\n } catch {\n // Even if refresh fails the membership is real in the DB; surface the\n // success toast and let the user re-auth if their session has fully\n // expired. The next API call will redirect to login as usual.\n }\n toast.success(`You joined ${params.workspaceName}.`);\n await params.navigate({\n to: '/workspaces/$wid',\n params: {wid: params.workspaceId},\n });\n}\n"],"names":["toast","completeInvitationAcceptance","params","refreshAuth","success","workspaceName","navigate","to","wid","workspaceId"],"mappings":"AAAA,SAAQA,KAAK,QAAO,0BAA0B;AAG9C;;;;;;;;CAQC,GACD,OAAO,eAAeC,6BAA6BC,MAKlD;IACC,6EAA6E;IAC7E,gCAAgC;IAChC,IAAI;QACF,MAAMA,OAAOC,WAAW;IAC1B,EAAE,OAAM;IACN,sEAAsE;IACtE,oEAAoE;IACpE,8DAA8D;IAChE;IACAH,MAAMI,OAAO,CAAC,CAAC,WAAW,EAAEF,OAAOG,aAAa,CAAC,CAAC,CAAC;IACnD,MAAMH,OAAOI,QAAQ,CAAC;QACpBC,IAAI;QACJL,QAAQ;YAACM,KAAKN,OAAOO,WAAW;QAAA;IAClC;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation-acceptance.d.ts","sourceRoot":"","sources":["../../src/core/invitation-acceptance.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,aAAa,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/invitation-acceptance.ts"],"sourcesContent":["export interface InvitationAcceptance {\n membership: {\n id: string;\n userId: string;\n workspaceId: string;\n };\n alreadyMember: boolean;\n}\n"],"names":[],"mappings":"AAAA,WAOC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type InvitationPreview = {
|
|
2
|
+
status: 'pending';
|
|
3
|
+
workspaceId: string;
|
|
4
|
+
workspaceName: string;
|
|
5
|
+
email: string;
|
|
6
|
+
invitedByDisplay?: string;
|
|
7
|
+
expiresAt: string;
|
|
8
|
+
} | {
|
|
9
|
+
status: 'expired';
|
|
10
|
+
workspaceName: string;
|
|
11
|
+
expiresAt: string;
|
|
12
|
+
} | {
|
|
13
|
+
status: 'already_used';
|
|
14
|
+
workspaceName: string;
|
|
15
|
+
} | {
|
|
16
|
+
status: 'invalid';
|
|
17
|
+
};
|
|
18
|
+
export declare function pendingInvitation(preview: InvitationPreview | undefined): Extract<InvitationPreview, {
|
|
19
|
+
status: 'pending';
|
|
20
|
+
}> | undefined;
|
|
21
|
+
//# sourceMappingURL=invitation-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation-preview.d.ts","sourceRoot":"","sources":["../../src/core/invitation-preview.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GACzB;IACE,MAAM,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,GACD;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,GAC7D;IAAC,MAAM,EAAE,cAAc,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAC,GAC/C;IAAC,MAAM,EAAE,SAAS,CAAA;CAAC,CAAC;AAExB,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACrC,OAAO,CAAC,iBAAiB,EAAE;IAAC,MAAM,EAAE,SAAS,CAAA;CAAC,CAAC,GAAG,SAAS,CAE7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/invitation-preview.ts"],"sourcesContent":["export type InvitationPreview =\n | {\n status: 'pending';\n workspaceId: string;\n workspaceName: string;\n email: string;\n invitedByDisplay?: string;\n expiresAt: string;\n }\n | {status: 'expired'; workspaceName: string; expiresAt: string}\n | {status: 'already_used'; workspaceName: string}\n | {status: 'invalid'};\n\nexport function pendingInvitation(\n preview: InvitationPreview | undefined,\n): Extract<InvitationPreview, {status: 'pending'}> | undefined {\n return preview?.status === 'pending' ? preview : undefined;\n}\n"],"names":["pendingInvitation","preview","status","undefined"],"mappings":"AAaA,OAAO,SAASA,kBACdC,OAAsC;IAEtC,OAAOA,SAASC,WAAW,YAAYD,UAAUE;AACnD"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
export declare function useAcceptInvitation(): import("@tanstack/react-query").UseMutationResult<{
|
|
2
|
-
membership: {
|
|
3
|
-
id: string;
|
|
4
|
-
user_id: string;
|
|
5
|
-
workspace_id: string;
|
|
6
|
-
};
|
|
7
|
-
already_member: boolean;
|
|
8
|
-
}, Error, {
|
|
1
|
+
export declare function useAcceptInvitation(): import("@tanstack/react-query").UseMutationResult<import("../../index.js").InvitationAcceptance, Error, {
|
|
9
2
|
token: string;
|
|
10
3
|
}, unknown>;
|
|
11
4
|
//# sourceMappingURL=accept-invitation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accept-invitation.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/accept-invitation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accept-invitation.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/accept-invitation.ts"],"names":[],"mappings":"AAaA,wBAAgB,mBAAmB;WARc,MAAM;YAUtD"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { acceptInvitationResponseSchema } from '@shipfox/api-workspaces-dto';
|
|
2
|
+
import { checkedApiRequest } from '@shipfox/client-api';
|
|
2
3
|
import { useMutation } from '@tanstack/react-query';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
import { toInvitationAcceptance } from './invitation-acceptance-mapper.js';
|
|
5
|
+
async function acceptInvitation(command) {
|
|
6
|
+
const response = await checkedApiRequest(acceptInvitationResponseSchema, '/invitations/accept', {
|
|
5
7
|
method: 'POST',
|
|
6
|
-
body
|
|
8
|
+
body: command
|
|
7
9
|
});
|
|
10
|
+
return toInvitationAcceptance(response);
|
|
8
11
|
}
|
|
9
12
|
export function useAcceptInvitation() {
|
|
10
13
|
return useMutation({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/accept-invitation.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/accept-invitation.ts"],"sourcesContent":["import {acceptInvitationResponseSchema} from '@shipfox/api-workspaces-dto';\nimport {checkedApiRequest} from '@shipfox/client-api';\nimport {useMutation} from '@tanstack/react-query';\nimport {toInvitationAcceptance} from './invitation-acceptance-mapper.js';\n\nasync function acceptInvitation(command: {token: string}) {\n const response = await checkedApiRequest(acceptInvitationResponseSchema, '/invitations/accept', {\n method: 'POST',\n body: command,\n });\n return toInvitationAcceptance(response);\n}\n\nexport function useAcceptInvitation() {\n return useMutation({mutationFn: acceptInvitation});\n}\n"],"names":["acceptInvitationResponseSchema","checkedApiRequest","useMutation","toInvitationAcceptance","acceptInvitation","command","response","method","body","useAcceptInvitation","mutationFn"],"mappings":"AAAA,SAAQA,8BAA8B,QAAO,8BAA8B;AAC3E,SAAQC,iBAAiB,QAAO,sBAAsB;AACtD,SAAQC,WAAW,QAAO,wBAAwB;AAClD,SAAQC,sBAAsB,QAAO,oCAAoC;AAEzE,eAAeC,iBAAiBC,OAAwB;IACtD,MAAMC,WAAW,MAAML,kBAAkBD,gCAAgC,uBAAuB;QAC9FO,QAAQ;QACRC,MAAMH;IACR;IACA,OAAOF,uBAAuBG;AAChC;AAEA,OAAO,SAASG;IACd,OAAOP,YAAY;QAACQ,YAAYN;IAAgB;AAClD"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AcceptInvitationResponseDto } from '@shipfox/api-workspaces-dto';
|
|
2
|
+
import type { InvitationAcceptance } from '#core/invitation-acceptance.js';
|
|
3
|
+
export declare function toInvitationAcceptance(dto: AcceptInvitationResponseDto): InvitationAcceptance;
|
|
4
|
+
//# sourceMappingURL=invitation-acceptance-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation-acceptance-mapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/invitation-acceptance-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,2BAA2B,EAAC,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEzE,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,2BAA2B,GAAG,oBAAoB,CAS7F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function toInvitationAcceptance(dto) {
|
|
2
|
+
return {
|
|
3
|
+
membership: {
|
|
4
|
+
id: dto.membership.id,
|
|
5
|
+
userId: dto.membership.user_id,
|
|
6
|
+
workspaceId: dto.membership.workspace_id
|
|
7
|
+
},
|
|
8
|
+
alreadyMember: dto.already_member
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=invitation-acceptance-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/invitation-acceptance-mapper.ts"],"sourcesContent":["import type {AcceptInvitationResponseDto} from '@shipfox/api-workspaces-dto';\nimport type {InvitationAcceptance} from '#core/invitation-acceptance.js';\n\nexport function toInvitationAcceptance(dto: AcceptInvitationResponseDto): InvitationAcceptance {\n return {\n membership: {\n id: dto.membership.id,\n userId: dto.membership.user_id,\n workspaceId: dto.membership.workspace_id,\n },\n alreadyMember: dto.already_member,\n };\n}\n"],"names":["toInvitationAcceptance","dto","membership","id","userId","user_id","workspaceId","workspace_id","alreadyMember","already_member"],"mappings":"AAGA,OAAO,SAASA,uBAAuBC,GAAgC;IACrE,OAAO;QACLC,YAAY;YACVC,IAAIF,IAAIC,UAAU,CAACC,EAAE;YACrBC,QAAQH,IAAIC,UAAU,CAACG,OAAO;YAC9BC,aAAaL,IAAIC,UAAU,CAACK,YAAY;QAC1C;QACAC,eAAeP,IAAIQ,cAAc;IACnC;AACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PreviewInvitationResponseDto } from '@shipfox/api-workspaces-dto';
|
|
2
|
+
import type { InvitationPreview } from '#core/invitation-preview.js';
|
|
3
|
+
export declare function toInvitationPreview(dto: PreviewInvitationResponseDto): InvitationPreview;
|
|
4
|
+
//# sourceMappingURL=invitation-preview-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation-preview-mapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/invitation-preview-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAEnE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,4BAA4B,GAAG,iBAAiB,CAkBxF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function toInvitationPreview(dto) {
|
|
2
|
+
switch(dto.status){
|
|
3
|
+
case 'pending':
|
|
4
|
+
return {
|
|
5
|
+
status: dto.status,
|
|
6
|
+
workspaceId: dto.workspace_id,
|
|
7
|
+
workspaceName: dto.workspace_name,
|
|
8
|
+
email: dto.email,
|
|
9
|
+
...dto.invited_by_display ? {
|
|
10
|
+
invitedByDisplay: dto.invited_by_display
|
|
11
|
+
} : {},
|
|
12
|
+
expiresAt: dto.expires_at
|
|
13
|
+
};
|
|
14
|
+
case 'expired':
|
|
15
|
+
return {
|
|
16
|
+
status: dto.status,
|
|
17
|
+
workspaceName: dto.workspace_name,
|
|
18
|
+
expiresAt: dto.expires_at
|
|
19
|
+
};
|
|
20
|
+
case 'already_used':
|
|
21
|
+
return {
|
|
22
|
+
status: dto.status,
|
|
23
|
+
workspaceName: dto.workspace_name
|
|
24
|
+
};
|
|
25
|
+
case 'invalid':
|
|
26
|
+
return {
|
|
27
|
+
status: dto.status
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=invitation-preview-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/invitation-preview-mapper.ts"],"sourcesContent":["import type {PreviewInvitationResponseDto} from '@shipfox/api-workspaces-dto';\nimport type {InvitationPreview} from '#core/invitation-preview.js';\n\nexport function toInvitationPreview(dto: PreviewInvitationResponseDto): InvitationPreview {\n switch (dto.status) {\n case 'pending':\n return {\n status: dto.status,\n workspaceId: dto.workspace_id,\n workspaceName: dto.workspace_name,\n email: dto.email,\n ...(dto.invited_by_display ? {invitedByDisplay: dto.invited_by_display} : {}),\n expiresAt: dto.expires_at,\n };\n case 'expired':\n return {status: dto.status, workspaceName: dto.workspace_name, expiresAt: dto.expires_at};\n case 'already_used':\n return {status: dto.status, workspaceName: dto.workspace_name};\n case 'invalid':\n return {status: dto.status};\n }\n}\n"],"names":["toInvitationPreview","dto","status","workspaceId","workspace_id","workspaceName","workspace_name","email","invited_by_display","invitedByDisplay","expiresAt","expires_at"],"mappings":"AAGA,OAAO,SAASA,oBAAoBC,GAAiC;IACnE,OAAQA,IAAIC,MAAM;QAChB,KAAK;YACH,OAAO;gBACLA,QAAQD,IAAIC,MAAM;gBAClBC,aAAaF,IAAIG,YAAY;gBAC7BC,eAAeJ,IAAIK,cAAc;gBACjCC,OAAON,IAAIM,KAAK;gBAChB,GAAIN,IAAIO,kBAAkB,GAAG;oBAACC,kBAAkBR,IAAIO,kBAAkB;gBAAA,IAAI,CAAC,CAAC;gBAC5EE,WAAWT,IAAIU,UAAU;YAC3B;QACF,KAAK;YACH,OAAO;gBAACT,QAAQD,IAAIC,MAAM;gBAAEG,eAAeJ,IAAIK,cAAc;gBAAEI,WAAWT,IAAIU,UAAU;YAAA;QAC1F,KAAK;YACH,OAAO;gBAACT,QAAQD,IAAIC,MAAM;gBAAEG,eAAeJ,IAAIK,cAAc;YAAA;QAC/D,KAAK;YACH,OAAO;gBAACJ,QAAQD,IAAIC,MAAM;YAAA;IAC9B;AACF"}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
+
import { type FetchQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { InvitationPreview } from '#core/invitation-preview.js';
|
|
1
3
|
export declare const previewInvitationQueryKey: (token: string) => readonly ["invitations", "preview", string];
|
|
4
|
+
type PreviewInvitationQueryOptions = FetchQueryOptions<InvitationPreview, Error, InvitationPreview, ReturnType<typeof previewInvitationQueryKey>>;
|
|
5
|
+
export declare function previewInvitationQueryOptions(token: string): PreviewInvitationQueryOptions;
|
|
2
6
|
export declare function usePreviewInvitation(token: string | undefined): import("@tanstack/react-query").UseQueryResult<NoInfer<{
|
|
3
7
|
status: "pending";
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
workspaceName: string;
|
|
6
10
|
email: string;
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
invitedByDisplay?: string;
|
|
12
|
+
expiresAt: string;
|
|
9
13
|
} | {
|
|
10
14
|
status: "expired";
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
workspaceName: string;
|
|
16
|
+
expiresAt: string;
|
|
13
17
|
} | {
|
|
14
18
|
status: "already_used";
|
|
15
|
-
|
|
19
|
+
workspaceName: string;
|
|
16
20
|
} | {
|
|
17
21
|
status: "invalid";
|
|
18
22
|
}>, Error>;
|
|
23
|
+
export {};
|
|
19
24
|
//# sourceMappingURL=preview-invitation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-invitation.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/preview-invitation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preview-invitation.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/preview-invitation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,iBAAiB,EAAyB,MAAM,uBAAuB,CAAC;AACrF,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAGnE,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,gDACX,CAAC;AAE7C,KAAK,6BAA6B,GAAG,iBAAiB,CACpD,iBAAiB,EACjB,KAAK,EACL,iBAAiB,EACjB,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAC7C,CAAC;AAWF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,6BAA6B,CAQ1F;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;;;;;;;;;;;;;;;;WAE7D"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { previewInvitationResponseSchema } from '@shipfox/api-workspaces-dto';
|
|
2
|
+
import { checkedApiRequest } from '@shipfox/client-api';
|
|
3
|
+
import { queryOptions, useQuery } from '@tanstack/react-query';
|
|
4
|
+
import { toInvitationPreview } from './invitation-preview-mapper.js';
|
|
3
5
|
export const previewInvitationQueryKey = (token)=>[
|
|
4
6
|
'invitations',
|
|
5
7
|
'preview',
|
|
@@ -9,16 +11,20 @@ async function previewInvitation(token) {
|
|
|
9
11
|
const params = new URLSearchParams({
|
|
10
12
|
token
|
|
11
13
|
});
|
|
12
|
-
|
|
14
|
+
const response = await checkedApiRequest(previewInvitationResponseSchema, `/invitations/preview?${params.toString()}`);
|
|
15
|
+
return toInvitationPreview(response);
|
|
13
16
|
}
|
|
14
|
-
export function
|
|
15
|
-
return
|
|
16
|
-
queryKey: previewInvitationQueryKey(token
|
|
17
|
+
export function previewInvitationQueryOptions(token) {
|
|
18
|
+
return queryOptions({
|
|
19
|
+
queryKey: previewInvitationQueryKey(token),
|
|
17
20
|
queryFn: ()=>previewInvitation(token),
|
|
18
21
|
enabled: Boolean(token),
|
|
19
22
|
retry: false,
|
|
20
23
|
staleTime: 30_000
|
|
21
24
|
});
|
|
22
25
|
}
|
|
26
|
+
export function usePreviewInvitation(token) {
|
|
27
|
+
return useQuery(previewInvitationQueryOptions(token ?? ''));
|
|
28
|
+
}
|
|
23
29
|
|
|
24
30
|
//# sourceMappingURL=preview-invitation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/preview-invitation.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/preview-invitation.ts"],"sourcesContent":["import {previewInvitationResponseSchema} from '@shipfox/api-workspaces-dto';\nimport {checkedApiRequest} from '@shipfox/client-api';\nimport {type FetchQueryOptions, queryOptions, useQuery} from '@tanstack/react-query';\nimport type {InvitationPreview} from '#core/invitation-preview.js';\nimport {toInvitationPreview} from './invitation-preview-mapper.js';\n\nexport const previewInvitationQueryKey = (token: string) =>\n ['invitations', 'preview', token] as const;\n\ntype PreviewInvitationQueryOptions = FetchQueryOptions<\n InvitationPreview,\n Error,\n InvitationPreview,\n ReturnType<typeof previewInvitationQueryKey>\n>;\n\nasync function previewInvitation(token: string): Promise<InvitationPreview> {\n const params = new URLSearchParams({token});\n const response = await checkedApiRequest(\n previewInvitationResponseSchema,\n `/invitations/preview?${params.toString()}`,\n );\n return toInvitationPreview(response);\n}\n\nexport function previewInvitationQueryOptions(token: string): PreviewInvitationQueryOptions {\n return queryOptions({\n queryKey: previewInvitationQueryKey(token),\n queryFn: () => previewInvitation(token),\n enabled: Boolean(token),\n retry: false,\n staleTime: 30_000,\n });\n}\n\nexport function usePreviewInvitation(token: string | undefined) {\n return useQuery(previewInvitationQueryOptions(token ?? ''));\n}\n"],"names":["previewInvitationResponseSchema","checkedApiRequest","queryOptions","useQuery","toInvitationPreview","previewInvitationQueryKey","token","previewInvitation","params","URLSearchParams","response","toString","previewInvitationQueryOptions","queryKey","queryFn","enabled","Boolean","retry","staleTime","usePreviewInvitation"],"mappings":"AAAA,SAAQA,+BAA+B,QAAO,8BAA8B;AAC5E,SAAQC,iBAAiB,QAAO,sBAAsB;AACtD,SAAgCC,YAAY,EAAEC,QAAQ,QAAO,wBAAwB;AAErF,SAAQC,mBAAmB,QAAO,iCAAiC;AAEnE,OAAO,MAAMC,4BAA4B,CAACC,QACxC;QAAC;QAAe;QAAWA;KAAM,CAAU;AAS7C,eAAeC,kBAAkBD,KAAa;IAC5C,MAAME,SAAS,IAAIC,gBAAgB;QAACH;IAAK;IACzC,MAAMI,WAAW,MAAMT,kBACrBD,iCACA,CAAC,qBAAqB,EAAEQ,OAAOG,QAAQ,IAAI;IAE7C,OAAOP,oBAAoBM;AAC7B;AAEA,OAAO,SAASE,8BAA8BN,KAAa;IACzD,OAAOJ,aAAa;QAClBW,UAAUR,0BAA0BC;QACpCQ,SAAS,IAAMP,kBAAkBD;QACjCS,SAASC,QAAQV;QACjBW,OAAO;QACPC,WAAW;IACb;AACF;AAEA,OAAO,SAASC,qBAAqBb,KAAyB;IAC5D,OAAOH,SAASS,8BAA8BN,SAAS;AACzD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export type { InvitationAcceptance } from '#core/invitation-acceptance.js';
|
|
2
|
+
export { type InvitationPreview, pendingInvitation } from '#core/invitation-preview.js';
|
|
1
3
|
export { completeInvitationAcceptance } from './complete-acceptance.js';
|
|
2
4
|
export { useAcceptInvitation } from './hooks/api/accept-invitation.js';
|
|
3
|
-
export { previewInvitationQueryKey, usePreviewInvitation, } from './hooks/api/preview-invitation.js';
|
|
5
|
+
export { previewInvitationQueryKey, previewInvitationQueryOptions, usePreviewInvitation, } from './hooks/api/preview-invitation.js';
|
|
4
6
|
export { InvitationAcceptPage } from './pages/invitation-accept-page.js';
|
|
5
7
|
//# 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,OAAO,EAAC,4BAA4B,EAAC,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,mCAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAC,KAAK,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACtF,OAAO,EAAC,4BAA4B,EAAC,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,mCAAmC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
export { pendingInvitation } from '#core/invitation-preview.js';
|
|
1
2
|
export { completeInvitationAcceptance } from './complete-acceptance.js';
|
|
2
3
|
export { useAcceptInvitation } from './hooks/api/accept-invitation.js';
|
|
3
|
-
export { previewInvitationQueryKey, usePreviewInvitation } from './hooks/api/preview-invitation.js';
|
|
4
|
+
export { previewInvitationQueryKey, previewInvitationQueryOptions, usePreviewInvitation } from './hooks/api/preview-invitation.js';
|
|
4
5
|
export { InvitationAcceptPage } from './pages/invitation-accept-page.js';
|
|
5
6
|
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {completeInvitationAcceptance} from './complete-acceptance.js';\nexport {useAcceptInvitation} from './hooks/api/accept-invitation.js';\nexport {\n previewInvitationQueryKey,\n usePreviewInvitation,\n} from './hooks/api/preview-invitation.js';\nexport {InvitationAcceptPage} from './pages/invitation-accept-page.js';\n"],"names":["completeInvitationAcceptance","useAcceptInvitation","previewInvitationQueryKey","usePreviewInvitation","InvitationAcceptPage"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type {InvitationAcceptance} from '#core/invitation-acceptance.js';\nexport {type InvitationPreview, pendingInvitation} from '#core/invitation-preview.js';\nexport {completeInvitationAcceptance} from './complete-acceptance.js';\nexport {useAcceptInvitation} from './hooks/api/accept-invitation.js';\nexport {\n previewInvitationQueryKey,\n previewInvitationQueryOptions,\n usePreviewInvitation,\n} from './hooks/api/preview-invitation.js';\nexport {InvitationAcceptPage} from './pages/invitation-accept-page.js';\n"],"names":["pendingInvitation","completeInvitationAcceptance","useAcceptInvitation","previewInvitationQueryKey","previewInvitationQueryOptions","usePreviewInvitation","InvitationAcceptPage"],"mappings":"AACA,SAAgCA,iBAAiB,QAAO,8BAA8B;AACtF,SAAQC,4BAA4B,QAAO,2BAA2B;AACtE,SAAQC,mBAAmB,QAAO,mCAAmC;AACrE,SACEC,yBAAyB,EACzBC,6BAA6B,EAC7BC,oBAAoB,QACf,oCAAoC;AAC3C,SAAQC,oBAAoB,QAAO,oCAAoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-accept-page.d.ts","sourceRoot":"","sources":["../../src/pages/invitation-accept-page.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invitation-accept-page.d.ts","sourceRoot":"","sources":["../../src/pages/invitation-accept-page.tsx"],"names":[],"mappings":"AAwBA,wBAAgB,oBAAoB,uCA2OnC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AuthShell, useAuthState, useRefreshAuth } from '@shipfox/client-
|
|
2
|
+
import { AuthShell, useAuthState, useRefreshAuth, useRouteSearch } from '@shipfox/client-shell/runtime';
|
|
3
3
|
import { createSingleFlight } from '@shipfox/client-ui';
|
|
4
4
|
import { Button } from '@shipfox/react-ui/button';
|
|
5
5
|
import { Callout } from '@shipfox/react-ui/callout';
|
|
@@ -7,19 +7,17 @@ import { ShipfoxLoader } from '@shipfox/react-ui/loader';
|
|
|
7
7
|
import { toast } from '@shipfox/react-ui/toast';
|
|
8
8
|
import { Text } from '@shipfox/react-ui/typography';
|
|
9
9
|
import { formatDate } from '@shipfox/react-ui/utils';
|
|
10
|
-
import { Link, useNavigate
|
|
10
|
+
import { Link, useNavigate } from '@tanstack/react-router';
|
|
11
11
|
import { useCallback, useEffect, useRef } from 'react';
|
|
12
12
|
import { completeInvitationAcceptance } from '#complete-acceptance.js';
|
|
13
13
|
import { useAcceptInvitation } from '#hooks/api/accept-invitation.js';
|
|
14
14
|
import { usePreviewInvitation } from '#hooks/api/preview-invitation.js';
|
|
15
|
+
import { validateInvitationAcceptSearch } from '../routes/inputs.js';
|
|
15
16
|
const invitationAccepts = createSingleFlight();
|
|
16
17
|
const toastedTerminals = new Set();
|
|
17
18
|
const TOASTED_TERMINALS_MAX = 32;
|
|
18
19
|
export function InvitationAcceptPage() {
|
|
19
|
-
const
|
|
20
|
-
strict: false
|
|
21
|
-
});
|
|
22
|
-
const token = typeof search.token === 'string' && search.token.length > 0 ? search.token : undefined;
|
|
20
|
+
const { token } = useRouteSearch(validateInvitationAcceptSearch);
|
|
23
21
|
const navigate = useNavigate();
|
|
24
22
|
const auth = useAuthState();
|
|
25
23
|
const refreshAuth = useRefreshAuth();
|
|
@@ -57,7 +55,7 @@ export function InvitationAcceptPage() {
|
|
|
57
55
|
const result = await accept.mutateAsync({
|
|
58
56
|
token: params.token
|
|
59
57
|
});
|
|
60
|
-
await completeAccept(result.membership.
|
|
58
|
+
await completeAccept(result.membership.workspaceId, params.workspaceName);
|
|
61
59
|
}, [
|
|
62
60
|
accept,
|
|
63
61
|
completeAccept
|
|
@@ -77,7 +75,7 @@ export function InvitationAcceptPage() {
|
|
|
77
75
|
hasKickedAccept.current = true;
|
|
78
76
|
invitationAccepts.run(token, async ()=>await runAccept({
|
|
79
77
|
token,
|
|
80
|
-
workspaceName: data.
|
|
78
|
+
workspaceName: data.workspaceName
|
|
81
79
|
})).catch(()=>{
|
|
82
80
|
// The mutation surfaces its error via accept.error; the UI re-renders
|
|
83
81
|
// into the auth-match-error state below.
|
|
@@ -166,7 +164,7 @@ export function InvitationAcceptPage() {
|
|
|
166
164
|
type: "error",
|
|
167
165
|
children: [
|
|
168
166
|
"This invitation expired on ",
|
|
169
|
-
formatDate(data.
|
|
167
|
+
formatDate(data.expiresAt),
|
|
170
168
|
". Ask your administrator to send a new one."
|
|
171
169
|
]
|
|
172
170
|
}),
|
|
@@ -180,7 +178,7 @@ export function InvitationAcceptPage() {
|
|
|
180
178
|
notifyOnce(`already-used:${token}`, ()=>toast.info(`This invitation has already been accepted.`));
|
|
181
179
|
return /*#__PURE__*/ _jsxs(AuthShell, {
|
|
182
180
|
title: "Invitation already used",
|
|
183
|
-
description: data.
|
|
181
|
+
description: data.workspaceName,
|
|
184
182
|
children: [
|
|
185
183
|
/*#__PURE__*/ _jsxs(Callout, {
|
|
186
184
|
role: "alert",
|
|
@@ -188,7 +186,7 @@ export function InvitationAcceptPage() {
|
|
|
188
186
|
children: [
|
|
189
187
|
"This invitation has already been accepted.",
|
|
190
188
|
' ',
|
|
191
|
-
auth.isAuthenticated ? `Open your dashboard to access ${data.
|
|
189
|
+
auth.isAuthenticated ? `Open your dashboard to access ${data.workspaceName} if your account is a member.` : `Log in to access ${data.workspaceName}.`
|
|
192
190
|
]
|
|
193
191
|
}),
|
|
194
192
|
auth.isAuthenticated ? null : /*#__PURE__*/ _jsx(Button, {
|
|
@@ -206,13 +204,13 @@ export function InvitationAcceptPage() {
|
|
|
206
204
|
]
|
|
207
205
|
});
|
|
208
206
|
}
|
|
209
|
-
const inviterLine = data.
|
|
207
|
+
const inviterLine = data.invitedByDisplay != null ? `Invited by ${data.invitedByDisplay} to join as ${data.email}.` : `Invited to join as ${data.email}.`;
|
|
210
208
|
if (!auth.isAuthenticated) {
|
|
211
209
|
const redirect = `/invitations/accept?token=${encodeURIComponent(token)}`;
|
|
212
210
|
const signupHref = `/auth/signup?redirect=${encodeURIComponent(redirect)}`;
|
|
213
211
|
const loginHref = `/auth/login?redirect=${encodeURIComponent(redirect)}`;
|
|
214
212
|
return /*#__PURE__*/ _jsxs(AuthShell, {
|
|
215
|
-
title: data.
|
|
213
|
+
title: data.workspaceName,
|
|
216
214
|
description: inviterLine,
|
|
217
215
|
children: [
|
|
218
216
|
/*#__PURE__*/ _jsxs("div", {
|
|
@@ -255,7 +253,7 @@ export function InvitationAcceptPage() {
|
|
|
255
253
|
const redirect = `/invitations/accept?token=${encodeURIComponent(token)}`;
|
|
256
254
|
const logoutHref = `/auth/logout?redirect=${encodeURIComponent(redirect)}`;
|
|
257
255
|
return /*#__PURE__*/ _jsxs(AuthShell, {
|
|
258
|
-
title: data.
|
|
256
|
+
title: data.workspaceName,
|
|
259
257
|
description: inviterLine,
|
|
260
258
|
children: [
|
|
261
259
|
/*#__PURE__*/ _jsxs(Callout, {
|
|
@@ -298,7 +296,7 @@ export function InvitationAcceptPage() {
|
|
|
298
296
|
// result. Show either the pending state or the error state.
|
|
299
297
|
if (accept.isError) {
|
|
300
298
|
return /*#__PURE__*/ _jsxs(AuthShell, {
|
|
301
|
-
title: data.
|
|
299
|
+
title: data.workspaceName,
|
|
302
300
|
description: inviterLine,
|
|
303
301
|
children: [
|
|
304
302
|
/*#__PURE__*/ _jsxs(Callout, {
|
|
@@ -306,7 +304,7 @@ export function InvitationAcceptPage() {
|
|
|
306
304
|
type: "error",
|
|
307
305
|
children: [
|
|
308
306
|
"We couldn't add you to ",
|
|
309
|
-
data.
|
|
307
|
+
data.workspaceName,
|
|
310
308
|
". Try again in a moment."
|
|
311
309
|
]
|
|
312
310
|
}),
|
|
@@ -316,7 +314,7 @@ export function InvitationAcceptPage() {
|
|
|
316
314
|
onClick: ()=>{
|
|
317
315
|
runAccept({
|
|
318
316
|
token,
|
|
319
|
-
workspaceName: data.
|
|
317
|
+
workspaceName: data.workspaceName
|
|
320
318
|
}).catch(()=>{
|
|
321
319
|
// The mutation state drives the rendered error; avoid an
|
|
322
320
|
// unhandled rejection from the click handler.
|
|
@@ -328,7 +326,7 @@ export function InvitationAcceptPage() {
|
|
|
328
326
|
});
|
|
329
327
|
}
|
|
330
328
|
return /*#__PURE__*/ _jsx(AuthShell, {
|
|
331
|
-
title: data.
|
|
329
|
+
title: data.workspaceName,
|
|
332
330
|
description: inviterLine,
|
|
333
331
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
334
332
|
className: "flex flex-col items-center gap-12",
|
|
@@ -340,7 +338,7 @@ export function InvitationAcceptPage() {
|
|
|
340
338
|
className: "text-foreground-neutral-subtle",
|
|
341
339
|
children: [
|
|
342
340
|
"Adding you to ",
|
|
343
|
-
data.
|
|
341
|
+
data.workspaceName,
|
|
344
342
|
"…"
|
|
345
343
|
]
|
|
346
344
|
})
|