@shipfox/client-workspace-settings 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 +51 -0
- package/dist/components/members/form-errors.d.ts +1 -0
- package/dist/components/members/form-errors.d.ts.map +1 -1
- package/dist/components/members/form-errors.js +26 -13
- package/dist/components/members/form-errors.js.map +1 -1
- package/dist/components/members/workspace-members-section.d.ts.map +1 -1
- package/dist/components/members/workspace-members-section.js +31 -28
- package/dist/components/members/workspace-members-section.js.map +1 -1
- package/dist/core/membership.d.ts +41 -0
- package/dist/core/membership.d.ts.map +1 -0
- package/dist/core/membership.js +16 -0
- package/dist/core/membership.js.map +1 -0
- package/dist/feature.d.ts +15 -72
- package/dist/feature.d.ts.map +1 -1
- package/dist/feature.js +20 -102
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/create-invitation.d.ts +4 -2
- package/dist/hooks/api/create-invitation.d.ts.map +1 -1
- package/dist/hooks/api/create-invitation.js +6 -3
- package/dist/hooks/api/create-invitation.js.map +1 -1
- package/dist/hooks/api/invitation-mapper.d.ts +2 -2
- package/dist/hooks/api/invitation-mapper.d.ts.map +1 -1
- package/dist/hooks/api/invitation-mapper.js.map +1 -1
- package/dist/hooks/api/list-invitations.d.ts +5 -5
- package/dist/hooks/api/list-invitations.d.ts.map +1 -1
- package/dist/hooks/api/list-invitations.js.map +1 -1
- package/dist/hooks/api/list-members.d.ts +10 -11
- package/dist/hooks/api/list-members.d.ts.map +1 -1
- package/dist/hooks/api/list-members.js +11 -5
- package/dist/hooks/api/list-members.js.map +1 -1
- package/dist/hooks/api/membership-mapper.d.ts +4 -0
- package/dist/hooks/api/membership-mapper.d.ts.map +1 -0
- package/dist/hooks/api/membership-mapper.js +14 -0
- package/dist/hooks/api/membership-mapper.js.map +1 -0
- package/dist/hooks/api/remove-member.d.ts +2 -1
- package/dist/hooks/api/remove-member.d.ts.map +1 -1
- package/dist/hooks/api/remove-member.js +6 -8
- package/dist/hooks/api/remove-member.js.map +1 -1
- package/dist/hooks/api/revoke-invitation.d.ts +2 -1
- package/dist/hooks/api/revoke-invitation.d.ts.map +1 -1
- package/dist/hooks/api/revoke-invitation.js +4 -4
- package/dist/hooks/api/revoke-invitation.js.map +1 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +10 -16
- package/src/components/members/form-errors.test.ts +57 -4
- package/src/components/members/form-errors.ts +21 -10
- package/src/components/members/workspace-members-section.tsx +38 -35
- package/src/core/membership.test.ts +69 -0
- package/src/core/membership.ts +64 -0
- package/src/feature.ts +27 -104
- package/src/hooks/api/create-invitation.ts +8 -4
- package/src/hooks/api/invitation-mapper.ts +2 -2
- package/src/hooks/api/list-invitations.ts +2 -2
- package/src/hooks/api/list-members.ts +17 -7
- package/src/hooks/api/membership-mapper.test.ts +24 -0
- package/src/hooks/api/membership-mapper.ts +15 -0
- package/src/hooks/api/remove-member.ts +11 -8
- package/src/hooks/api/revoke-invitation.ts +11 -6
- package/src/index.ts +0 -7
- package/test/pages.tsx +1 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/core/invitation.d.ts +0 -15
- package/dist/core/invitation.d.ts.map +0 -1
- package/dist/core/invitation.js +0 -3
- package/dist/core/invitation.js.map +0 -1
- package/dist/pages/events-settings-page.d.ts +0 -2
- package/dist/pages/events-settings-page.d.ts.map +0 -1
- package/dist/pages/events-settings-page.js +0 -30
- package/dist/pages/events-settings-page.js.map +0 -1
- package/dist/pages/integrations-settings-page.d.ts +0 -2
- package/dist/pages/integrations-settings-page.d.ts.map +0 -1
- package/dist/pages/integrations-settings-page.js +0 -10
- package/dist/pages/integrations-settings-page.js.map +0 -1
- package/dist/pages/model-providers-settings-page.d.ts +0 -2
- package/dist/pages/model-providers-settings-page.d.ts.map +0 -1
- package/dist/pages/model-providers-settings-page.js +0 -20
- package/dist/pages/model-providers-settings-page.js.map +0 -1
- package/dist/pages/provisioners-settings-page.d.ts +0 -2
- package/dist/pages/provisioners-settings-page.d.ts.map +0 -1
- package/dist/pages/provisioners-settings-page.js +0 -14
- package/dist/pages/provisioners-settings-page.js.map +0 -1
- package/dist/pages/runners-settings-page.d.ts +0 -2
- package/dist/pages/runners-settings-page.d.ts.map +0 -1
- package/dist/pages/runners-settings-page.js +0 -14
- package/dist/pages/runners-settings-page.js.map +0 -1
- package/dist/pages/secrets-settings-page.d.ts +0 -2
- package/dist/pages/secrets-settings-page.d.ts.map +0 -1
- package/dist/pages/secrets-settings-page.js +0 -14
- package/dist/pages/secrets-settings-page.js.map +0 -1
- package/dist/pages/variables-settings-page.d.ts +0 -2
- package/dist/pages/variables-settings-page.d.ts.map +0 -1
- package/dist/pages/variables-settings-page.js +0 -14
- package/dist/pages/variables-settings-page.js.map +0 -1
- package/dist/routes/agents.d.ts +0 -6
- package/dist/routes/agents.d.ts.map +0 -1
- package/dist/routes/agents.js +0 -7
- package/dist/routes/agents.js.map +0 -1
- package/dist/routes/events.d.ts +0 -8
- package/dist/routes/events.d.ts.map +0 -1
- package/dist/routes/events.js +0 -9
- package/dist/routes/events.js.map +0 -1
- package/dist/routes/integrations.d.ts +0 -6
- package/dist/routes/integrations.d.ts.map +0 -1
- package/dist/routes/integrations.js +0 -7
- package/dist/routes/integrations.js.map +0 -1
- package/dist/routes/provisioners.d.ts +0 -6
- package/dist/routes/provisioners.d.ts.map +0 -1
- package/dist/routes/provisioners.js +0 -7
- package/dist/routes/provisioners.js.map +0 -1
- package/dist/routes/runners.d.ts +0 -6
- package/dist/routes/runners.d.ts.map +0 -1
- package/dist/routes/runners.js +0 -7
- package/dist/routes/runners.js.map +0 -1
- package/dist/routes/secrets.d.ts +0 -6
- package/dist/routes/secrets.d.ts.map +0 -1
- package/dist/routes/secrets.js +0 -7
- package/dist/routes/secrets.js.map +0 -1
- package/dist/routes/variables.d.ts +0 -6
- package/dist/routes/variables.d.ts.map +0 -1
- package/dist/routes/variables.js +0 -7
- package/dist/routes/variables.js.map +0 -1
- package/src/core/invitation.ts +0 -15
- package/src/pages/events-settings-page.tsx +0 -25
- package/src/pages/integrations-settings-page.test.tsx +0 -72
- package/src/pages/integrations-settings-page.tsx +0 -6
- package/src/pages/model-providers-settings-page.test.tsx +0 -48
- package/src/pages/model-providers-settings-page.tsx +0 -15
- package/src/pages/provisioners-settings-page.test.tsx +0 -29
- package/src/pages/provisioners-settings-page.tsx +0 -14
- package/src/pages/runners-settings-page.test.tsx +0 -23
- package/src/pages/runners-settings-page.tsx +0 -14
- package/src/pages/secrets-settings-page.tsx +0 -14
- package/src/pages/variables-settings-page.tsx +0 -14
- package/src/routes/agents.tsx +0 -3
- package/src/routes/events.tsx +0 -7
- package/src/routes/integrations.tsx +0 -3
- package/src/routes/provisioners.tsx +0 -3
- package/src/routes/runners.tsx +0 -3
- package/src/routes/secrets.tsx +0 -3
- package/src/routes/variables.tsx +0 -3
- package/test/typecheck/route-ids.tsx +0 -7
- package/test/typecheck/settings-composition.tsx +0 -95
package/dist/feature.js
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { defineClientFeature } from '@shipfox/client-shell';
|
|
2
|
+
export const workspaceSettingsNavigation = [
|
|
3
|
+
{
|
|
4
|
+
id: 'nav.settings',
|
|
5
|
+
scope: 'workspace',
|
|
6
|
+
label: 'Settings',
|
|
7
|
+
to: '/workspaces/$wid/settings',
|
|
8
|
+
order: 200
|
|
9
|
+
}
|
|
10
|
+
];
|
|
11
|
+
export const workspaceSettingsSections = [
|
|
12
|
+
{
|
|
13
|
+
id: 'settings.members',
|
|
14
|
+
pathSegment: 'members',
|
|
15
|
+
label: 'Members',
|
|
16
|
+
icon: 'userLine',
|
|
17
|
+
order: 100
|
|
18
|
+
}
|
|
19
|
+
];
|
|
2
20
|
export const workspaceSettingsFeature = defineClientFeature({
|
|
3
21
|
id: 'shipfox.workspace-settings',
|
|
4
22
|
routes: [
|
|
@@ -11,110 +29,10 @@ export const workspaceSettingsFeature = defineClientFeature({
|
|
|
11
29
|
path: '/workspaces/$wid/settings/members',
|
|
12
30
|
parent: 'workspaceSettings',
|
|
13
31
|
impl: '@shipfox/client-workspace-settings/routes/members'
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
path: '/workspaces/$wid/settings/runners',
|
|
17
|
-
parent: 'workspaceSettings',
|
|
18
|
-
impl: '@shipfox/client-workspace-settings/routes/runners'
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
path: '/workspaces/$wid/settings/provisioners',
|
|
22
|
-
parent: 'workspaceSettings',
|
|
23
|
-
impl: '@shipfox/client-workspace-settings/routes/provisioners'
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
path: '/workspaces/$wid/settings/agents',
|
|
27
|
-
parent: 'workspaceSettings',
|
|
28
|
-
impl: '@shipfox/client-workspace-settings/routes/agents'
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
path: '/workspaces/$wid/settings/secrets',
|
|
32
|
-
parent: 'workspaceSettings',
|
|
33
|
-
impl: '@shipfox/client-workspace-settings/routes/secrets'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
path: '/workspaces/$wid/settings/variables',
|
|
37
|
-
parent: 'workspaceSettings',
|
|
38
|
-
impl: '@shipfox/client-workspace-settings/routes/variables'
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
path: '/workspaces/$wid/settings/integrations',
|
|
42
|
-
parent: 'workspaceSettings',
|
|
43
|
-
impl: '@shipfox/client-workspace-settings/routes/integrations'
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
path: '/workspaces/$wid/settings/events',
|
|
47
|
-
parent: 'workspaceSettings',
|
|
48
|
-
impl: '@shipfox/client-workspace-settings/routes/events'
|
|
49
32
|
}
|
|
50
33
|
],
|
|
51
|
-
navigation:
|
|
52
|
-
|
|
53
|
-
id: 'nav.settings',
|
|
54
|
-
scope: 'workspace',
|
|
55
|
-
label: 'Settings',
|
|
56
|
-
to: '/workspaces/$wid/settings',
|
|
57
|
-
order: 200
|
|
58
|
-
}
|
|
59
|
-
],
|
|
60
|
-
settingsSections: [
|
|
61
|
-
{
|
|
62
|
-
id: 'settings.members',
|
|
63
|
-
pathSegment: 'members',
|
|
64
|
-
label: 'Members',
|
|
65
|
-
icon: 'userLine',
|
|
66
|
-
order: 100
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: 'settings.runners',
|
|
70
|
-
pathSegment: 'runners',
|
|
71
|
-
label: 'Runners',
|
|
72
|
-
icon: 'settings3Line',
|
|
73
|
-
order: 200
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: 'settings.provisioners',
|
|
77
|
-
pathSegment: 'provisioners',
|
|
78
|
-
label: 'Runner provisioners',
|
|
79
|
-
icon: 'serverLine',
|
|
80
|
-
order: 300
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
id: 'settings.agents',
|
|
84
|
-
pathSegment: 'agents',
|
|
85
|
-
label: 'Agents',
|
|
86
|
-
icon: 'robot2Line',
|
|
87
|
-
order: 400
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: 'settings.secrets',
|
|
91
|
-
pathSegment: 'secrets',
|
|
92
|
-
label: 'Secrets',
|
|
93
|
-
icon: 'keyLine',
|
|
94
|
-
order: 500
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
id: 'settings.variables',
|
|
98
|
-
pathSegment: 'variables',
|
|
99
|
-
label: 'Variables',
|
|
100
|
-
icon: 'bracesLine',
|
|
101
|
-
order: 600
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: 'settings.integrations',
|
|
105
|
-
pathSegment: 'integrations',
|
|
106
|
-
label: 'Integrations',
|
|
107
|
-
icon: 'plugLine',
|
|
108
|
-
order: 700
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
id: 'settings.events',
|
|
112
|
-
pathSegment: 'events',
|
|
113
|
-
label: 'Events',
|
|
114
|
-
icon: 'pulseLine',
|
|
115
|
-
order: 800
|
|
116
|
-
}
|
|
117
|
-
]
|
|
34
|
+
navigation: workspaceSettingsNavigation,
|
|
35
|
+
settingsSections: workspaceSettingsSections
|
|
118
36
|
});
|
|
119
37
|
|
|
120
38
|
//# sourceMappingURL=feature.js.map
|
package/dist/feature.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/feature.ts"],"sourcesContent":["import {defineClientFeature
|
|
1
|
+
{"version":3,"sources":["../src/feature.ts"],"sourcesContent":["import {\n defineClientFeature,\n type NavTabEntry,\n type SettingsSectionEntry,\n} from '@shipfox/client-shell';\n\nexport const workspaceSettingsNavigation = [\n {\n id: 'nav.settings',\n scope: 'workspace',\n label: 'Settings',\n to: '/workspaces/$wid/settings',\n order: 200,\n },\n] as const satisfies readonly NavTabEntry[];\n\nexport const workspaceSettingsSections = [\n {\n id: 'settings.members',\n pathSegment: 'members',\n label: 'Members',\n icon: 'userLine',\n order: 100,\n },\n] as const satisfies readonly SettingsSectionEntry[];\n\nexport const workspaceSettingsFeature = defineClientFeature({\n id: 'shipfox.workspace-settings',\n routes: [\n {\n path: '/workspaces/$wid/settings',\n parent: 'workspaceSettings',\n impl: '@shipfox/client-workspace-settings/routes/index',\n },\n {\n path: '/workspaces/$wid/settings/members',\n parent: 'workspaceSettings',\n impl: '@shipfox/client-workspace-settings/routes/members',\n },\n ],\n navigation: workspaceSettingsNavigation,\n settingsSections: workspaceSettingsSections,\n});\n"],"names":["defineClientFeature","workspaceSettingsNavigation","id","scope","label","to","order","workspaceSettingsSections","pathSegment","icon","workspaceSettingsFeature","routes","path","parent","impl","navigation","settingsSections"],"mappings":"AAAA,SACEA,mBAAmB,QAGd,wBAAwB;AAE/B,OAAO,MAAMC,8BAA8B;IACzC;QACEC,IAAI;QACJC,OAAO;QACPC,OAAO;QACPC,IAAI;QACJC,OAAO;IACT;CACD,CAA2C;AAE5C,OAAO,MAAMC,4BAA4B;IACvC;QACEL,IAAI;QACJM,aAAa;QACbJ,OAAO;QACPK,MAAM;QACNH,OAAO;IACT;CACD,CAAoD;AAErD,OAAO,MAAMI,2BAA2BV,oBAAoB;IAC1DE,IAAI;IACJS,QAAQ;QACN;YACEC,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;QACA;YACEF,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;KACD;IACDC,YAAYd;IACZe,kBAAkBT;AACpB,GAAG"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { type CreateInvitationBodyDto } from '@shipfox/api-workspaces-dto';
|
|
2
|
+
import type { CreateInvitationCommand, PendingInvitation } from '#core/membership.js';
|
|
3
|
+
export declare function toCreateInvitationBody(command: CreateInvitationCommand): CreateInvitationBodyDto;
|
|
4
|
+
export declare function useCreateInvitation(workspaceId: string): import("@tanstack/react-query").UseMutationResult<PendingInvitation, Error, CreateInvitationCommand, unknown>;
|
|
3
5
|
//# sourceMappingURL=create-invitation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-invitation.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/create-invitation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-invitation.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/create-invitation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,uBAAuB,EAAsB,MAAM,6BAA6B,CAAC;AAG9F,OAAO,KAAK,EAAC,uBAAuB,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAmBpF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,uBAAuB,CAEhG;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,iHAQtD"}
|
|
@@ -6,12 +6,15 @@ import { listInvitationsQueryOptions } from './list-invitations.js';
|
|
|
6
6
|
async function createInvitation(params) {
|
|
7
7
|
const response = await checkedApiRequest(invitationDtoSchema, `/workspaces/${params.workspaceId}/invitations`, {
|
|
8
8
|
method: 'POST',
|
|
9
|
-
body:
|
|
10
|
-
email: params.command.email
|
|
11
|
-
}
|
|
9
|
+
body: toCreateInvitationBody(params.command)
|
|
12
10
|
});
|
|
13
11
|
return toInvitation(response);
|
|
14
12
|
}
|
|
13
|
+
export function toCreateInvitationBody(command) {
|
|
14
|
+
return {
|
|
15
|
+
email: command.email
|
|
16
|
+
};
|
|
17
|
+
}
|
|
15
18
|
export function useCreateInvitation(workspaceId) {
|
|
16
19
|
const queryClient = useQueryClient();
|
|
17
20
|
return useMutation({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/create-invitation.ts"],"sourcesContent":["import {invitationDtoSchema} from '@shipfox/api-workspaces-dto';\nimport {checkedApiRequest} from '@shipfox/client-api';\nimport {useMutation, useQueryClient} from '@tanstack/react-query';\nimport type {CreateInvitationCommand,
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/create-invitation.ts"],"sourcesContent":["import {type CreateInvitationBodyDto, invitationDtoSchema} from '@shipfox/api-workspaces-dto';\nimport {checkedApiRequest} from '@shipfox/client-api';\nimport {useMutation, useQueryClient} from '@tanstack/react-query';\nimport type {CreateInvitationCommand, PendingInvitation} from '#core/membership.js';\nimport {toInvitation} from './invitation-mapper.js';\nimport {listInvitationsQueryOptions} from './list-invitations.js';\n\nasync function createInvitation(params: {\n workspaceId: string;\n command: CreateInvitationCommand;\n}): Promise<PendingInvitation> {\n const response = await checkedApiRequest(\n invitationDtoSchema,\n `/workspaces/${params.workspaceId}/invitations`,\n {\n method: 'POST',\n body: toCreateInvitationBody(params.command),\n },\n );\n return toInvitation(response);\n}\n\nexport function toCreateInvitationBody(command: CreateInvitationCommand): CreateInvitationBodyDto {\n return {email: command.email};\n}\n\nexport function useCreateInvitation(workspaceId: string) {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (command: CreateInvitationCommand) => createInvitation({workspaceId, command}),\n onSuccess: async () => {\n await queryClient.invalidateQueries(listInvitationsQueryOptions(workspaceId));\n },\n });\n}\n"],"names":["invitationDtoSchema","checkedApiRequest","useMutation","useQueryClient","toInvitation","listInvitationsQueryOptions","createInvitation","params","response","workspaceId","method","body","toCreateInvitationBody","command","email","useCreateInvitation","queryClient","mutationFn","onSuccess","invalidateQueries"],"mappings":"AAAA,SAAsCA,mBAAmB,QAAO,8BAA8B;AAC9F,SAAQC,iBAAiB,QAAO,sBAAsB;AACtD,SAAQC,WAAW,EAAEC,cAAc,QAAO,wBAAwB;AAElE,SAAQC,YAAY,QAAO,yBAAyB;AACpD,SAAQC,2BAA2B,QAAO,wBAAwB;AAElE,eAAeC,iBAAiBC,MAG/B;IACC,MAAMC,WAAW,MAAMP,kBACrBD,qBACA,CAAC,YAAY,EAAEO,OAAOE,WAAW,CAAC,YAAY,CAAC,EAC/C;QACEC,QAAQ;QACRC,MAAMC,uBAAuBL,OAAOM,OAAO;IAC7C;IAEF,OAAOT,aAAaI;AACtB;AAEA,OAAO,SAASI,uBAAuBC,OAAgC;IACrE,OAAO;QAACC,OAAOD,QAAQC,KAAK;IAAA;AAC9B;AAEA,OAAO,SAASC,oBAAoBN,WAAmB;IACrD,MAAMO,cAAcb;IACpB,OAAOD,YAAY;QACjBe,YAAY,CAACJ,UAAqCP,iBAAiB;gBAACG;gBAAaI;YAAO;QACxFK,WAAW;YACT,MAAMF,YAAYG,iBAAiB,CAACd,4BAA4BI;QAClE;IACF;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { InvitationDto } from '@shipfox/api-workspaces-dto';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function toInvitation(dto: InvitationDto):
|
|
2
|
+
import type { PendingInvitation } from '#core/membership.js';
|
|
3
|
+
export declare function toInvitation(dto: InvitationDto): PendingInvitation;
|
|
4
4
|
//# sourceMappingURL=invitation-mapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-mapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/invitation-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"invitation-mapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/invitation-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAE3D,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,iBAAiB,CAYlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/invitation-mapper.ts"],"sourcesContent":["import type {InvitationDto} from '@shipfox/api-workspaces-dto';\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/invitation-mapper.ts"],"sourcesContent":["import type {InvitationDto} from '@shipfox/api-workspaces-dto';\nimport type {PendingInvitation} from '#core/membership.js';\n\nexport function toInvitation(dto: InvitationDto): PendingInvitation {\n return {\n id: dto.id,\n workspaceId: dto.workspace_id,\n email: dto.email,\n expiresAt: dto.expires_at,\n acceptedAt: dto.accepted_at,\n invitedByUserId: dto.invited_by_user_id,\n invitedByDisplay: dto.invited_by_display,\n createdAt: dto.created_at,\n updatedAt: dto.updated_at,\n };\n}\n"],"names":["toInvitation","dto","id","workspaceId","workspace_id","email","expiresAt","expires_at","acceptedAt","accepted_at","invitedByUserId","invited_by_user_id","invitedByDisplay","invited_by_display","createdAt","created_at","updatedAt","updated_at"],"mappings":"AAGA,OAAO,SAASA,aAAaC,GAAkB;IAC7C,OAAO;QACLC,IAAID,IAAIC,EAAE;QACVC,aAAaF,IAAIG,YAAY;QAC7BC,OAAOJ,IAAII,KAAK;QAChBC,WAAWL,IAAIM,UAAU;QACzBC,YAAYP,IAAIQ,WAAW;QAC3BC,iBAAiBT,IAAIU,kBAAkB;QACvCC,kBAAkBX,IAAIY,kBAAkB;QACxCC,WAAWb,IAAIc,UAAU;QACzBC,WAAWf,IAAIgB,UAAU;IAC3B;AACF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PendingInvitation } from '#core/membership.js';
|
|
2
2
|
export declare const listInvitationsQueryKey: (workspaceId: string) => readonly ["workspaces", string, "invitations"];
|
|
3
|
-
export declare function listInvitationsQueryOptions(workspaceId: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<
|
|
4
|
-
queryFn?: import("@tanstack/react-query").QueryFunction<
|
|
3
|
+
export declare function listInvitationsQueryOptions(workspaceId: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<PendingInvitation[], Error, PendingInvitation[], readonly ["workspaces", string, "invitations"]>, "queryFn"> & {
|
|
4
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<PendingInvitation[], readonly ["workspaces", string, "invitations"], never>;
|
|
5
5
|
} & {
|
|
6
6
|
queryKey: readonly ["workspaces", string, "invitations"] & {
|
|
7
|
-
[dataTagSymbol]:
|
|
7
|
+
[dataTagSymbol]: PendingInvitation[];
|
|
8
8
|
[dataTagErrorSymbol]: Error;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
export declare function useListInvitations(workspaceId: string): import("@tanstack/react-query").UseQueryResult<NoInfer<
|
|
11
|
+
export declare function useListInvitations(workspaceId: string): import("@tanstack/react-query").UseQueryResult<NoInfer<PendingInvitation[]>, Error>;
|
|
12
12
|
//# sourceMappingURL=list-invitations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-invitations.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/list-invitations.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"list-invitations.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/list-invitations.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAG3D,eAAO,MAAM,uBAAuB,GAAI,aAAa,MAAM,mDACN,CAAC;AAUtD,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM;;;;;;;EAK9D;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,uFAErD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/list-invitations.ts"],"sourcesContent":["import {listInvitationsResponseSchema} from '@shipfox/api-workspaces-dto';\nimport {checkedApiRequest} from '@shipfox/client-api';\nimport {queryOptions, useQuery} from '@tanstack/react-query';\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/list-invitations.ts"],"sourcesContent":["import {listInvitationsResponseSchema} from '@shipfox/api-workspaces-dto';\nimport {checkedApiRequest} from '@shipfox/client-api';\nimport {queryOptions, useQuery} from '@tanstack/react-query';\nimport type {PendingInvitation} from '#core/membership.js';\nimport {toInvitation} from './invitation-mapper.js';\n\nexport const listInvitationsQueryKey = (workspaceId: string) =>\n ['workspaces', workspaceId, 'invitations'] as const;\n\nasync function listInvitations(workspaceId: string): Promise<PendingInvitation[]> {\n const response = await checkedApiRequest(\n listInvitationsResponseSchema,\n `/workspaces/${workspaceId}/invitations`,\n );\n return response.invitations.map(toInvitation);\n}\n\nexport function listInvitationsQueryOptions(workspaceId: string) {\n return queryOptions({\n queryKey: listInvitationsQueryKey(workspaceId),\n queryFn: () => listInvitations(workspaceId),\n });\n}\n\nexport function useListInvitations(workspaceId: string) {\n return useQuery(listInvitationsQueryOptions(workspaceId));\n}\n"],"names":["listInvitationsResponseSchema","checkedApiRequest","queryOptions","useQuery","toInvitation","listInvitationsQueryKey","workspaceId","listInvitations","response","invitations","map","listInvitationsQueryOptions","queryKey","queryFn","useListInvitations"],"mappings":"AAAA,SAAQA,6BAA6B,QAAO,8BAA8B;AAC1E,SAAQC,iBAAiB,QAAO,sBAAsB;AACtD,SAAQC,YAAY,EAAEC,QAAQ,QAAO,wBAAwB;AAE7D,SAAQC,YAAY,QAAO,yBAAyB;AAEpD,OAAO,MAAMC,0BAA0B,CAACC,cACtC;QAAC;QAAcA;QAAa;KAAc,CAAU;AAEtD,eAAeC,gBAAgBD,WAAmB;IAChD,MAAME,WAAW,MAAMP,kBACrBD,+BACA,CAAC,YAAY,EAAEM,YAAY,YAAY,CAAC;IAE1C,OAAOE,SAASC,WAAW,CAACC,GAAG,CAACN;AAClC;AAEA,OAAO,SAASO,4BAA4BL,WAAmB;IAC7D,OAAOJ,aAAa;QAClBU,UAAUP,wBAAwBC;QAClCO,SAAS,IAAMN,gBAAgBD;IACjC;AACF;AAEA,OAAO,SAASQ,mBAAmBR,WAAmB;IACpD,OAAOH,SAASQ,4BAA4BL;AAC9C"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import type { WorkspaceMember } from '#core/membership.js';
|
|
1
2
|
export declare const listMembersQueryKey: (workspaceId: string) => readonly ["workspaces", string, "members"];
|
|
2
|
-
export declare function
|
|
3
|
-
members
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}[];
|
|
12
|
-
}>, Error>;
|
|
3
|
+
export declare function listMembersQueryOptions(workspaceId: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<WorkspaceMember[], Error, WorkspaceMember[], readonly ["workspaces", string, "members"]>, "queryFn"> & {
|
|
4
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<WorkspaceMember[], readonly ["workspaces", string, "members"], never>;
|
|
5
|
+
} & {
|
|
6
|
+
queryKey: readonly ["workspaces", string, "members"] & {
|
|
7
|
+
[dataTagSymbol]: WorkspaceMember[];
|
|
8
|
+
[dataTagErrorSymbol]: Error;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function useListMembers(workspaceId: string): import("@tanstack/react-query").UseQueryResult<NoInfer<WorkspaceMember[]>, Error>;
|
|
13
12
|
//# sourceMappingURL=list-members.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-members.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/list-members.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-members.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/list-members.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAGzD,eAAO,MAAM,mBAAmB,GAAI,aAAa,MAAM,+CACN,CAAC;AAUlD,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM;;;;;;;EAK1D;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,qFAEjD"}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { listMembersResponseSchema } from '@shipfox/api-workspaces-dto';
|
|
2
|
+
import { checkedApiRequest } from '@shipfox/client-api';
|
|
3
|
+
import { queryOptions, useQuery } from '@tanstack/react-query';
|
|
4
|
+
import { toWorkspaceMember } from './membership-mapper.js';
|
|
3
5
|
export const listMembersQueryKey = (workspaceId)=>[
|
|
4
6
|
'workspaces',
|
|
5
7
|
workspaceId,
|
|
6
8
|
'members'
|
|
7
9
|
];
|
|
8
10
|
async function listMembers(workspaceId) {
|
|
9
|
-
|
|
11
|
+
const response = await checkedApiRequest(listMembersResponseSchema, `/workspaces/${workspaceId}/members`);
|
|
12
|
+
return response.members.map(toWorkspaceMember);
|
|
10
13
|
}
|
|
11
|
-
export function
|
|
12
|
-
return
|
|
14
|
+
export function listMembersQueryOptions(workspaceId) {
|
|
15
|
+
return queryOptions({
|
|
13
16
|
queryKey: listMembersQueryKey(workspaceId),
|
|
14
17
|
queryFn: ()=>listMembers(workspaceId)
|
|
15
18
|
});
|
|
16
19
|
}
|
|
20
|
+
export function useListMembers(workspaceId) {
|
|
21
|
+
return useQuery(listMembersQueryOptions(workspaceId));
|
|
22
|
+
}
|
|
17
23
|
|
|
18
24
|
//# sourceMappingURL=list-members.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/list-members.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/list-members.ts"],"sourcesContent":["import {listMembersResponseSchema} from '@shipfox/api-workspaces-dto';\nimport {checkedApiRequest} from '@shipfox/client-api';\nimport {queryOptions, useQuery} from '@tanstack/react-query';\nimport type {WorkspaceMember} from '#core/membership.js';\nimport {toWorkspaceMember} from './membership-mapper.js';\n\nexport const listMembersQueryKey = (workspaceId: string) =>\n ['workspaces', workspaceId, 'members'] as const;\n\nasync function listMembers(workspaceId: string): Promise<WorkspaceMember[]> {\n const response = await checkedApiRequest(\n listMembersResponseSchema,\n `/workspaces/${workspaceId}/members`,\n );\n return response.members.map(toWorkspaceMember);\n}\n\nexport function listMembersQueryOptions(workspaceId: string) {\n return queryOptions({\n queryKey: listMembersQueryKey(workspaceId),\n queryFn: () => listMembers(workspaceId),\n });\n}\n\nexport function useListMembers(workspaceId: string) {\n return useQuery(listMembersQueryOptions(workspaceId));\n}\n"],"names":["listMembersResponseSchema","checkedApiRequest","queryOptions","useQuery","toWorkspaceMember","listMembersQueryKey","workspaceId","listMembers","response","members","map","listMembersQueryOptions","queryKey","queryFn","useListMembers"],"mappings":"AAAA,SAAQA,yBAAyB,QAAO,8BAA8B;AACtE,SAAQC,iBAAiB,QAAO,sBAAsB;AACtD,SAAQC,YAAY,EAAEC,QAAQ,QAAO,wBAAwB;AAE7D,SAAQC,iBAAiB,QAAO,yBAAyB;AAEzD,OAAO,MAAMC,sBAAsB,CAACC,cAClC;QAAC;QAAcA;QAAa;KAAU,CAAU;AAElD,eAAeC,YAAYD,WAAmB;IAC5C,MAAME,WAAW,MAAMP,kBACrBD,2BACA,CAAC,YAAY,EAAEM,YAAY,QAAQ,CAAC;IAEtC,OAAOE,SAASC,OAAO,CAACC,GAAG,CAACN;AAC9B;AAEA,OAAO,SAASO,wBAAwBL,WAAmB;IACzD,OAAOJ,aAAa;QAClBU,UAAUP,oBAAoBC;QAC9BO,SAAS,IAAMN,YAAYD;IAC7B;AACF;AAEA,OAAO,SAASQ,eAAeR,WAAmB;IAChD,OAAOH,SAASQ,wBAAwBL;AAC1C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { MembershipWithUserDto } from '@shipfox/api-workspaces-dto';
|
|
2
|
+
import type { WorkspaceMember } from '#core/membership.js';
|
|
3
|
+
export declare function toWorkspaceMember(dto: MembershipWithUserDto): WorkspaceMember;
|
|
4
|
+
//# sourceMappingURL=membership-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"membership-mapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/membership-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEzD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,qBAAqB,GAAG,eAAe,CAW7E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function toWorkspaceMember(dto) {
|
|
2
|
+
return {
|
|
3
|
+
id: dto.id,
|
|
4
|
+
userId: dto.user_id,
|
|
5
|
+
workspaceId: dto.workspace_id,
|
|
6
|
+
email: dto.user_email,
|
|
7
|
+
name: dto.user_name,
|
|
8
|
+
role: 'admin',
|
|
9
|
+
joinedAt: dto.created_at,
|
|
10
|
+
updatedAt: dto.updated_at
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=membership-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/membership-mapper.ts"],"sourcesContent":["import type {MembershipWithUserDto} from '@shipfox/api-workspaces-dto';\nimport type {WorkspaceMember} from '#core/membership.js';\n\nexport function toWorkspaceMember(dto: MembershipWithUserDto): WorkspaceMember {\n return {\n id: dto.id,\n userId: dto.user_id,\n workspaceId: dto.workspace_id,\n email: dto.user_email,\n name: dto.user_name,\n role: 'admin',\n joinedAt: dto.created_at,\n updatedAt: dto.updated_at,\n };\n}\n"],"names":["toWorkspaceMember","dto","id","userId","user_id","workspaceId","workspace_id","email","user_email","name","user_name","role","joinedAt","created_at","updatedAt","updated_at"],"mappings":"AAGA,OAAO,SAASA,kBAAkBC,GAA0B;IAC1D,OAAO;QACLC,IAAID,IAAIC,EAAE;QACVC,QAAQF,IAAIG,OAAO;QACnBC,aAAaJ,IAAIK,YAAY;QAC7BC,OAAON,IAAIO,UAAU;QACrBC,MAAMR,IAAIS,SAAS;QACnBC,MAAM;QACNC,UAAUX,IAAIY,UAAU;QACxBC,WAAWb,IAAIc,UAAU;IAC3B;AACF"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { RemoveWorkspaceMemberCommand } from '#core/membership.js';
|
|
2
|
+
export declare function useRemoveMember(workspaceId: string): import("@tanstack/react-query").UseMutationResult<void, Error, RemoveWorkspaceMemberCommand, unknown>;
|
|
2
3
|
//# sourceMappingURL=remove-member.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-member.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/remove-member.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove-member.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/remove-member.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,qBAAqB,CAAC;AAWtE,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,yGAQlD"}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { checkedApiRequest, emptyResponseSchema } from '@shipfox/client-api';
|
|
2
2
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { listMembersQueryOptions } from './list-members.js';
|
|
4
4
|
async function removeMember(params) {
|
|
5
|
-
await
|
|
5
|
+
await checkedApiRequest(emptyResponseSchema, `/workspaces/${params.workspaceId}/members/${params.command.userId}`, {
|
|
6
6
|
method: 'DELETE'
|
|
7
7
|
});
|
|
8
8
|
}
|
|
9
9
|
export function useRemoveMember(workspaceId) {
|
|
10
10
|
const queryClient = useQueryClient();
|
|
11
11
|
return useMutation({
|
|
12
|
-
mutationFn: (
|
|
12
|
+
mutationFn: (command)=>removeMember({
|
|
13
13
|
workspaceId,
|
|
14
|
-
|
|
14
|
+
command
|
|
15
15
|
}),
|
|
16
16
|
onSuccess: async ()=>{
|
|
17
|
-
await queryClient.invalidateQueries(
|
|
18
|
-
queryKey: listMembersQueryKey(workspaceId)
|
|
19
|
-
});
|
|
17
|
+
await queryClient.invalidateQueries(listMembersQueryOptions(workspaceId));
|
|
20
18
|
}
|
|
21
19
|
});
|
|
22
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/remove-member.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/remove-member.ts"],"sourcesContent":["import {checkedApiRequest, emptyResponseSchema} from '@shipfox/client-api';\nimport {useMutation, useQueryClient} from '@tanstack/react-query';\nimport type {RemoveWorkspaceMemberCommand} from '#core/membership.js';\nimport {listMembersQueryOptions} from './list-members.js';\n\nasync function removeMember(params: {workspaceId: string; command: RemoveWorkspaceMemberCommand}) {\n await checkedApiRequest(\n emptyResponseSchema,\n `/workspaces/${params.workspaceId}/members/${params.command.userId}`,\n {method: 'DELETE'},\n );\n}\n\nexport function useRemoveMember(workspaceId: string) {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (command: RemoveWorkspaceMemberCommand) => removeMember({workspaceId, command}),\n onSuccess: async () => {\n await queryClient.invalidateQueries(listMembersQueryOptions(workspaceId));\n },\n });\n}\n"],"names":["checkedApiRequest","emptyResponseSchema","useMutation","useQueryClient","listMembersQueryOptions","removeMember","params","workspaceId","command","userId","method","useRemoveMember","queryClient","mutationFn","onSuccess","invalidateQueries"],"mappings":"AAAA,SAAQA,iBAAiB,EAAEC,mBAAmB,QAAO,sBAAsB;AAC3E,SAAQC,WAAW,EAAEC,cAAc,QAAO,wBAAwB;AAElE,SAAQC,uBAAuB,QAAO,oBAAoB;AAE1D,eAAeC,aAAaC,MAAoE;IAC9F,MAAMN,kBACJC,qBACA,CAAC,YAAY,EAAEK,OAAOC,WAAW,CAAC,SAAS,EAAED,OAAOE,OAAO,CAACC,MAAM,EAAE,EACpE;QAACC,QAAQ;IAAQ;AAErB;AAEA,OAAO,SAASC,gBAAgBJ,WAAmB;IACjD,MAAMK,cAAcT;IACpB,OAAOD,YAAY;QACjBW,YAAY,CAACL,UAA0CH,aAAa;gBAACE;gBAAaC;YAAO;QACzFM,WAAW;YACT,MAAMF,YAAYG,iBAAiB,CAACX,wBAAwBG;QAC9D;IACF;AACF"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { RevokeInvitationCommand } from '#core/membership.js';
|
|
2
|
+
export declare function useRevokeInvitation(workspaceId: string): import("@tanstack/react-query").UseMutationResult<void, Error, RevokeInvitationCommand, unknown>;
|
|
2
3
|
//# sourceMappingURL=revoke-invitation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revoke-invitation.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/revoke-invitation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"revoke-invitation.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/revoke-invitation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AAajE,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,oGAQtD"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { checkedApiRequest, emptyResponseSchema } from '@shipfox/client-api';
|
|
2
2
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
import { listInvitationsQueryOptions } from './list-invitations.js';
|
|
4
4
|
async function revokeInvitation(params) {
|
|
5
|
-
await
|
|
5
|
+
await checkedApiRequest(emptyResponseSchema, `/workspaces/${params.workspaceId}/invitations/${params.command.invitationId}`, {
|
|
6
6
|
method: 'DELETE'
|
|
7
7
|
});
|
|
8
8
|
}
|
|
9
9
|
export function useRevokeInvitation(workspaceId) {
|
|
10
10
|
const queryClient = useQueryClient();
|
|
11
11
|
return useMutation({
|
|
12
|
-
mutationFn: (
|
|
12
|
+
mutationFn: (command)=>revokeInvitation({
|
|
13
13
|
workspaceId,
|
|
14
|
-
|
|
14
|
+
command
|
|
15
15
|
}),
|
|
16
16
|
onSuccess: async ()=>{
|
|
17
17
|
await queryClient.invalidateQueries(listInvitationsQueryOptions(workspaceId));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/revoke-invitation.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/revoke-invitation.ts"],"sourcesContent":["import {checkedApiRequest, emptyResponseSchema} from '@shipfox/client-api';\nimport {useMutation, useQueryClient} from '@tanstack/react-query';\nimport type {RevokeInvitationCommand} from '#core/membership.js';\nimport {listInvitationsQueryOptions} from './list-invitations.js';\n\nasync function revokeInvitation(params: {workspaceId: string; command: RevokeInvitationCommand}) {\n await checkedApiRequest(\n emptyResponseSchema,\n `/workspaces/${params.workspaceId}/invitations/${params.command.invitationId}`,\n {\n method: 'DELETE',\n },\n );\n}\n\nexport function useRevokeInvitation(workspaceId: string) {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (command: RevokeInvitationCommand) => revokeInvitation({workspaceId, command}),\n onSuccess: async () => {\n await queryClient.invalidateQueries(listInvitationsQueryOptions(workspaceId));\n },\n });\n}\n"],"names":["checkedApiRequest","emptyResponseSchema","useMutation","useQueryClient","listInvitationsQueryOptions","revokeInvitation","params","workspaceId","command","invitationId","method","useRevokeInvitation","queryClient","mutationFn","onSuccess","invalidateQueries"],"mappings":"AAAA,SAAQA,iBAAiB,EAAEC,mBAAmB,QAAO,sBAAsB;AAC3E,SAAQC,WAAW,EAAEC,cAAc,QAAO,wBAAwB;AAElE,SAAQC,2BAA2B,QAAO,wBAAwB;AAElE,eAAeC,iBAAiBC,MAA+D;IAC7F,MAAMN,kBACJC,qBACA,CAAC,YAAY,EAAEK,OAAOC,WAAW,CAAC,aAAa,EAAED,OAAOE,OAAO,CAACC,YAAY,EAAE,EAC9E;QACEC,QAAQ;IACV;AAEJ;AAEA,OAAO,SAASC,oBAAoBJ,WAAmB;IACrD,MAAMK,cAAcT;IACpB,OAAOD,YAAY;QACjBW,YAAY,CAACL,UAAqCH,iBAAiB;gBAACE;gBAAaC;YAAO;QACxFM,WAAW;YACT,MAAMF,YAAYG,iBAAiB,CAACX,4BAA4BG;QAClE;IACF;AACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
export * from './pages/events-settings-page.js';
|
|
2
|
-
export * from './pages/integrations-settings-page.js';
|
|
3
1
|
export * from './pages/members-settings-page.js';
|
|
4
|
-
export * from './pages/model-providers-settings-page.js';
|
|
5
|
-
export * from './pages/provisioners-settings-page.js';
|
|
6
|
-
export * from './pages/runners-settings-page.js';
|
|
7
|
-
export * from './pages/secrets-settings-page.js';
|
|
8
|
-
export * from './pages/variables-settings-page.js';
|
|
9
2
|
//# 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,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export * from './pages/events-settings-page.js';
|
|
2
|
-
export * from './pages/integrations-settings-page.js';
|
|
3
1
|
export * from './pages/members-settings-page.js';
|
|
4
|
-
export * from './pages/model-providers-settings-page.js';
|
|
5
|
-
export * from './pages/provisioners-settings-page.js';
|
|
6
|
-
export * from './pages/runners-settings-page.js';
|
|
7
|
-
export * from './pages/secrets-settings-page.js';
|
|
8
|
-
export * from './pages/variables-settings-page.js';
|
|
9
2
|
|
|
10
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './pages/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './pages/members-settings-page.js';\n"],"names":[],"mappings":"AAAA,cAAc,mCAAmC"}
|