@shipfox/client-projects 5.0.0 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +74 -0
- package/dist/chrome.d.ts.map +1 -1
- package/dist/chrome.js +7 -10
- package/dist/chrome.js.map +1 -1
- package/dist/components/model-provider-reminder-banner.d.ts.map +1 -1
- package/dist/components/model-provider-reminder-banner.js +4 -2
- package/dist/components/model-provider-reminder-banner.js.map +1 -1
- package/dist/components/source-strip.d.ts +2 -2
- package/dist/components/source-strip.d.ts.map +1 -1
- package/dist/components/source-strip.js +2 -2
- package/dist/components/source-strip.js.map +1 -1
- package/dist/core/definition.d.ts +32 -0
- package/dist/core/definition.d.ts.map +1 -0
- package/dist/core/definition.js +3 -0
- package/dist/core/definition.js.map +1 -0
- package/dist/core/project.d.ts +26 -0
- package/dist/core/project.d.ts.map +1 -0
- package/dist/core/project.js +12 -0
- package/dist/core/project.js.map +1 -0
- package/dist/feature.d.ts +8 -0
- package/dist/feature.d.ts.map +1 -1
- package/dist/feature.js +11 -10
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/definitions.d.ts +12 -88
- package/dist/hooks/api/definitions.d.ts.map +1 -1
- package/dist/hooks/api/definitions.js +18 -10
- package/dist/hooks/api/definitions.js.map +1 -1
- package/dist/hooks/api/mappers.d.ts +17 -0
- package/dist/hooks/api/mappers.d.ts.map +1 -0
- package/dist/hooks/api/mappers.js +56 -0
- package/dist/hooks/api/mappers.js.map +1 -0
- package/dist/hooks/api/projects.d.ts +18 -84
- package/dist/hooks/api/projects.d.ts.map +1 -1
- package/dist/hooks/api/projects.js +72 -29
- package/dist/hooks/api/projects.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/pages/create-project-page.d.ts.map +1 -1
- package/dist/pages/create-project-page.js +12 -37
- package/dist/pages/create-project-page.js.map +1 -1
- package/dist/pages/create-project-page.stories.js +3 -1
- package/dist/pages/create-project-page.stories.js.map +1 -1
- package/dist/pages/home-router.d.ts +4 -1
- package/dist/pages/home-router.d.ts.map +1 -1
- package/dist/pages/home-router.js +4 -2
- package/dist/pages/home-router.js.map +1 -1
- package/dist/pages/projects-hub-page.d.ts +3 -1
- package/dist/pages/projects-hub-page.d.ts.map +1 -1
- package/dist/pages/projects-hub-page.js +26 -30
- package/dist/pages/projects-hub-page.js.map +1 -1
- package/dist/routes/home.d.ts +3 -2
- package/dist/routes/home.d.ts.map +1 -1
- package/dist/routes/home.js +7 -2
- package/dist/routes/home.js.map +1 -1
- package/dist/routes/inputs.d.ts +6 -0
- package/dist/routes/inputs.d.ts.map +1 -0
- package/dist/routes/inputs.js +14 -0
- package/dist/routes/inputs.js.map +1 -0
- package/dist/routes/search.d.ts +5 -0
- package/dist/routes/search.d.ts.map +1 -0
- package/dist/routes/search.js +8 -0
- package/dist/routes/search.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +14 -15
- package/src/chrome.tsx +11 -6
- package/src/components/model-provider-reminder-banner.tsx +12 -10
- package/src/components/project-switcher.test.tsx +2 -1
- package/src/components/source-strip.tsx +5 -5
- package/src/core/definition.ts +31 -0
- package/src/core/project.ts +47 -0
- package/src/feature.ts +13 -11
- package/src/hooks/api/definitions.ts +54 -19
- package/src/hooks/api/mappers.ts +67 -0
- package/src/hooks/api/projects.test.ts +11 -4
- package/src/hooks/api/projects.ts +114 -39
- package/src/index.ts +9 -0
- package/src/pages/create-project-page.stories.tsx +6 -1
- package/src/pages/create-project-page.test.tsx +3 -1
- package/src/pages/create-project-page.tsx +16 -51
- package/src/pages/home-router.tsx +3 -2
- package/src/pages/projects-hub-page.test.tsx +13 -8
- package/src/pages/projects-hub-page.tsx +24 -34
- package/src/routes/home.tsx +6 -2
- package/src/routes/inputs.test.ts +14 -0
- package/src/routes/inputs.ts +15 -0
- package/src/routes/search.ts +8 -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: 22 files with swc (58.12ms)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# @shipfox/client-projects
|
|
2
2
|
|
|
3
|
+
## 6.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 102c5f4: Isolates private browser state and React Query data across authenticated principal transitions.
|
|
8
|
+
- Updated dependencies [4b85404]
|
|
9
|
+
- Updated dependencies [102c5f4]
|
|
10
|
+
- @shipfox/api-definitions-dto@9.0.2
|
|
11
|
+
- @shipfox/api-integration-core-dto@9.0.2
|
|
12
|
+
- @shipfox/api-projects-dto@9.0.2
|
|
13
|
+
- @shipfox/react-ui@0.3.7
|
|
14
|
+
- @shipfox/client-ui@6.0.2
|
|
15
|
+
- @shipfox/client-shell@6.0.2
|
|
16
|
+
- @shipfox/client-auth@6.0.2
|
|
17
|
+
- @shipfox/client-agent@6.0.2
|
|
18
|
+
- @shipfox/client-integrations@6.0.2
|
|
19
|
+
|
|
20
|
+
## 6.0.1
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 475ce59: Republishes all public packages after restoring release authorization.
|
|
25
|
+
- 3f8f1cb: Enforces typed route-input and browser-storage boundaries across client features.
|
|
26
|
+
- Updated dependencies [475ce59]
|
|
27
|
+
- Updated dependencies [3f8f1cb]
|
|
28
|
+
- @shipfox/api-definitions-dto@9.0.1
|
|
29
|
+
- @shipfox/api-integration-core-dto@9.0.1
|
|
30
|
+
- @shipfox/api-projects-dto@9.0.1
|
|
31
|
+
- @shipfox/client-agent@6.0.1
|
|
32
|
+
- @shipfox/client-api@6.0.1
|
|
33
|
+
- @shipfox/client-auth@6.0.1
|
|
34
|
+
- @shipfox/client-integrations@6.0.1
|
|
35
|
+
- @shipfox/client-shell@6.0.1
|
|
36
|
+
- @shipfox/client-ui@6.0.1
|
|
37
|
+
- @shipfox/react-ui@0.3.6
|
|
38
|
+
|
|
39
|
+
## 6.0.0
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- 401b583: Exposes typed feature-owned navigation and settings contributions and enforces coordinator-owned client composition.
|
|
44
|
+
- 125c90f: Adds checked Projects domain models and resource-owned query cache policy.
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- 82eda45: Adds validated URL-owned project and workflow run filters for shareable navigation state.
|
|
49
|
+
- c02ac42: Converges the integrations client on a package-owned domain model (camelCase, schema-validated) instead of exposing raw snake_case API DTOs, changing the shape of `useSourceConnectionsQuery`, `useIntegrationConnectionsQuery`, `useIntegrationProvidersQuery`, `useRepositoriesInfiniteQuery`, and the `ConnectionPicker`/`ProviderGrid`/`RepositoryPicker` props. Adds `emptyResponseSchema` to `@shipfox/client-api` for schema-validated DELETE requests with no response body.
|
|
50
|
+
- Updated dependencies [401b583]
|
|
51
|
+
- Updated dependencies [e009149]
|
|
52
|
+
- Updated dependencies [d784a07]
|
|
53
|
+
- Updated dependencies [891e469]
|
|
54
|
+
- Updated dependencies [82eda45]
|
|
55
|
+
- Updated dependencies [f2d50a8]
|
|
56
|
+
- Updated dependencies [cd90c19]
|
|
57
|
+
- Updated dependencies [24be269]
|
|
58
|
+
- Updated dependencies [c56c124]
|
|
59
|
+
- Updated dependencies [fa07be9]
|
|
60
|
+
- Updated dependencies [46aa52f]
|
|
61
|
+
- Updated dependencies [9d8f510]
|
|
62
|
+
- Updated dependencies [02974d6]
|
|
63
|
+
- Updated dependencies [4a6d124]
|
|
64
|
+
- Updated dependencies [c02ac42]
|
|
65
|
+
- Updated dependencies [c097dff]
|
|
66
|
+
- @shipfox/client-agent@6.0.0
|
|
67
|
+
- @shipfox/client-integrations@6.0.0
|
|
68
|
+
- @shipfox/client-shell@6.0.0
|
|
69
|
+
- @shipfox/client-auth@6.0.0
|
|
70
|
+
- @shipfox/client-api@6.0.0
|
|
71
|
+
- @shipfox/api-integration-core-dto@9.0.0
|
|
72
|
+
- @shipfox/api-definitions-dto@6.0.0
|
|
73
|
+
- @shipfox/api-projects-dto@8.0.0
|
|
74
|
+
- @shipfox/client-ui@6.0.0
|
|
75
|
+
- @shipfox/react-ui@0.3.5
|
|
76
|
+
|
|
3
77
|
## 5.0.0
|
|
4
78
|
|
|
5
79
|
### Major Changes
|
package/dist/chrome.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../src/chrome.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../src/chrome.tsx"],"names":[],"mappings":"AAWA,wBAAgB,iBAAiB,gCAOhC;AAED,wBAAgB,kBAAkB,uCAUjC"}
|
package/dist/chrome.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useActiveWorkspace } from '@shipfox/client-shell/runtime';
|
|
3
|
-
import { Outlet, useNavigate
|
|
2
|
+
import { parseWorkspaceProjectParams, useActiveWorkspace, useRouteParams } from '@shipfox/client-shell/runtime';
|
|
3
|
+
import { Outlet, useNavigate } from '@tanstack/react-router';
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
5
|
import { ProjectCrumb } from '#components/project-crumb.js';
|
|
6
6
|
import { useProjectQuery } from '#hooks/api/projects.js';
|
|
7
|
+
import { projectRouteParams } from './routes/inputs.js';
|
|
7
8
|
export function ProjectBreadcrumb() {
|
|
8
9
|
const workspace = useActiveWorkspace();
|
|
9
|
-
const { pid } =
|
|
10
|
-
strict: false
|
|
11
|
-
});
|
|
10
|
+
const { pid } = useRouteParams(parseWorkspaceProjectParams);
|
|
12
11
|
const project = useProjectQuery(pid).data;
|
|
13
12
|
return /*#__PURE__*/ _jsx(ProjectCrumb, {
|
|
14
13
|
workspaceId: workspace.id,
|
|
@@ -17,13 +16,11 @@ export function ProjectBreadcrumb() {
|
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
18
|
export function ProjectLayoutGuard() {
|
|
20
|
-
const { wid, pid } =
|
|
21
|
-
strict: false
|
|
22
|
-
});
|
|
19
|
+
const { wid, pid } = useRouteParams(projectRouteParams);
|
|
23
20
|
const navigate = useNavigate();
|
|
24
21
|
const project = useProjectQuery(pid).data;
|
|
25
22
|
useEffect(()=>{
|
|
26
|
-
if (project && project.
|
|
23
|
+
if (project && project.workspaceId !== wid) void navigate({
|
|
27
24
|
to: '/workspaces/$wid',
|
|
28
25
|
params: {
|
|
29
26
|
wid
|
|
@@ -35,7 +32,7 @@ export function ProjectLayoutGuard() {
|
|
|
35
32
|
project,
|
|
36
33
|
wid
|
|
37
34
|
]);
|
|
38
|
-
if (project && project.
|
|
35
|
+
if (project && project.workspaceId !== wid) return null;
|
|
39
36
|
return /*#__PURE__*/ _jsx(Outlet, {});
|
|
40
37
|
}
|
|
41
38
|
|
package/dist/chrome.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chrome.tsx"],"sourcesContent":["import {useActiveWorkspace} from '@shipfox/client-shell/runtime';\nimport {Outlet, useNavigate
|
|
1
|
+
{"version":3,"sources":["../src/chrome.tsx"],"sourcesContent":["import {\n parseWorkspaceProjectParams,\n useActiveWorkspace,\n useRouteParams,\n} from '@shipfox/client-shell/runtime';\nimport {Outlet, useNavigate} from '@tanstack/react-router';\nimport {useEffect} from 'react';\nimport {ProjectCrumb} from '#components/project-crumb.js';\nimport {useProjectQuery} from '#hooks/api/projects.js';\nimport {projectRouteParams} from './routes/inputs.js';\n\nexport function ProjectBreadcrumb() {\n const workspace = useActiveWorkspace();\n const {pid} = useRouteParams(parseWorkspaceProjectParams);\n const project = useProjectQuery(pid).data;\n return (\n <ProjectCrumb workspaceId={workspace.id} projectId={project?.id} projectName={project?.name} />\n );\n}\n\nexport function ProjectLayoutGuard() {\n const {wid, pid} = useRouteParams(projectRouteParams);\n const navigate = useNavigate();\n const project = useProjectQuery(pid).data;\n useEffect(() => {\n if (project && project.workspaceId !== wid)\n void navigate({to: '/workspaces/$wid', params: {wid}, replace: true});\n }, [navigate, project, wid]);\n if (project && project.workspaceId !== wid) return null;\n return <Outlet />;\n}\n"],"names":["parseWorkspaceProjectParams","useActiveWorkspace","useRouteParams","Outlet","useNavigate","useEffect","ProjectCrumb","useProjectQuery","projectRouteParams","ProjectBreadcrumb","workspace","pid","project","data","workspaceId","id","projectId","projectName","name","ProjectLayoutGuard","wid","navigate","to","params","replace"],"mappings":";AAAA,SACEA,2BAA2B,EAC3BC,kBAAkB,EAClBC,cAAc,QACT,gCAAgC;AACvC,SAAQC,MAAM,EAAEC,WAAW,QAAO,yBAAyB;AAC3D,SAAQC,SAAS,QAAO,QAAQ;AAChC,SAAQC,YAAY,QAAO,+BAA+B;AAC1D,SAAQC,eAAe,QAAO,yBAAyB;AACvD,SAAQC,kBAAkB,QAAO,qBAAqB;AAEtD,OAAO,SAASC;IACd,MAAMC,YAAYT;IAClB,MAAM,EAACU,GAAG,EAAC,GAAGT,eAAeF;IAC7B,MAAMY,UAAUL,gBAAgBI,KAAKE,IAAI;IACzC,qBACE,KAACP;QAAaQ,aAAaJ,UAAUK,EAAE;QAAEC,WAAWJ,SAASG;QAAIE,aAAaL,SAASM;;AAE3F;AAEA,OAAO,SAASC;IACd,MAAM,EAACC,GAAG,EAAET,GAAG,EAAC,GAAGT,eAAeM;IAClC,MAAMa,WAAWjB;IACjB,MAAMQ,UAAUL,gBAAgBI,KAAKE,IAAI;IACzCR,UAAU;QACR,IAAIO,WAAWA,QAAQE,WAAW,KAAKM,KACrC,KAAKC,SAAS;YAACC,IAAI;YAAoBC,QAAQ;gBAACH;YAAG;YAAGI,SAAS;QAAI;IACvE,GAAG;QAACH;QAAUT;QAASQ;KAAI;IAC3B,IAAIR,WAAWA,QAAQE,WAAW,KAAKM,KAAK,OAAO;IACnD,qBAAO,KAACjB;AACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-provider-reminder-banner.d.ts","sourceRoot":"","sources":["../../src/components/model-provider-reminder-banner.tsx"],"names":[],"mappings":"AAcA,wBAAgB,2BAA2B,CAAC,EAAC,WAAW,EAAC,EAAE;IAAC,WAAW,EAAE,MAAM,CAAA;CAAC,
|
|
1
|
+
{"version":3,"file":"model-provider-reminder-banner.d.ts","sourceRoot":"","sources":["../../src/components/model-provider-reminder-banner.tsx"],"names":[],"mappings":"AAcA,wBAAgB,2BAA2B,CAAC,EAAC,WAAW,EAAC,EAAE;IAAC,WAAW,EAAE,MAAM,CAAA;CAAC,sCAoC/E"}
|
|
@@ -9,7 +9,7 @@ export function ModelProviderReminderBanner({ workspaceId }) {
|
|
|
9
9
|
const configsQuery = useModelProviderConfigsQuery(workspaceId);
|
|
10
10
|
const [dismissed, setDismissed] = useState(()=>isReminderDismissed(workspaceId));
|
|
11
11
|
const configs = configsQuery.data?.configs;
|
|
12
|
-
const unconfigured = Array.isArray(configs) && configs.length === 0 && configsQuery.data?.
|
|
12
|
+
const unconfigured = Array.isArray(configs) && configs.length === 0 && configsQuery.data?.defaultProviderId === null;
|
|
13
13
|
if (!unconfigured || dismissed) return null;
|
|
14
14
|
return /*#__PURE__*/ _jsxs(Alert, {
|
|
15
15
|
variant: "info",
|
|
@@ -58,11 +58,13 @@ function dismissReminder(workspaceId) {
|
|
|
58
58
|
}
|
|
59
59
|
function reminderStorage(workspaceId) {
|
|
60
60
|
return createTypedBrowserStorage(sessionStorageOrUndefined, {
|
|
61
|
-
key:
|
|
61
|
+
key: 'shipfox.modelProviderReminder.dismissed',
|
|
62
62
|
lifetime: 'session',
|
|
63
63
|
principalScope: 'workspace',
|
|
64
64
|
serialize: (dismissed)=>JSON.stringify(dismissed),
|
|
65
65
|
parse: (raw)=>raw === 'true'
|
|
66
|
+
}, {
|
|
67
|
+
workspaceId
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
70
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/model-provider-reminder-banner.tsx"],"sourcesContent":["import {useModelProviderConfigsQuery} from '@shipfox/client-agent';\nimport {createTypedBrowserStorage, sessionStorageOrUndefined} from '@shipfox/client-ui';\nimport {\n Alert,\n AlertActions,\n AlertClose,\n AlertContent,\n AlertDescription,\n AlertTitle,\n} from '@shipfox/react-ui/alert';\nimport {Button} from '@shipfox/react-ui/button';\nimport {Link} from '@tanstack/react-router';\nimport {useState} from 'react';\n\nexport function ModelProviderReminderBanner({workspaceId}: {workspaceId: string}) {\n const configsQuery = useModelProviderConfigsQuery(workspaceId);\n const [dismissed, setDismissed] = useState(() => isReminderDismissed(workspaceId));\n const configs = configsQuery.data?.configs;\n const unconfigured =\n Array.isArray(configs)
|
|
1
|
+
{"version":3,"sources":["../../src/components/model-provider-reminder-banner.tsx"],"sourcesContent":["import {useModelProviderConfigsQuery} from '@shipfox/client-agent';\nimport {createTypedBrowserStorage, sessionStorageOrUndefined} from '@shipfox/client-ui';\nimport {\n Alert,\n AlertActions,\n AlertClose,\n AlertContent,\n AlertDescription,\n AlertTitle,\n} from '@shipfox/react-ui/alert';\nimport {Button} from '@shipfox/react-ui/button';\nimport {Link} from '@tanstack/react-router';\nimport {useState} from 'react';\n\nexport function ModelProviderReminderBanner({workspaceId}: {workspaceId: string}) {\n const configsQuery = useModelProviderConfigsQuery(workspaceId);\n const [dismissed, setDismissed] = useState(() => isReminderDismissed(workspaceId));\n const configs = configsQuery.data?.configs;\n const unconfigured =\n Array.isArray(configs) && configs.length === 0 && configsQuery.data?.defaultProviderId === null;\n\n if (!unconfigured || dismissed) return null;\n\n return (\n <Alert\n variant=\"info\"\n animated={false}\n onOpenChange={(open) => {\n if (!open) {\n dismissReminder(workspaceId);\n setDismissed(true);\n }\n }}\n >\n <AlertContent className=\"pr-28\">\n <AlertTitle>Finish setting up a model provider</AlertTitle>\n <AlertDescription>\n Add workspace credentials, or keep using the instance default.\n </AlertDescription>\n <AlertActions>\n <Button asChild size=\"sm\" variant=\"secondary\">\n <Link to=\"/workspaces/$wid/settings/agents\" params={{wid: workspaceId}}>\n Agents\n </Link>\n </Button>\n </AlertActions>\n </AlertContent>\n <AlertClose />\n </Alert>\n );\n}\n\nfunction isReminderDismissed(workspaceId: string): boolean {\n return reminderStorage(workspaceId).read() === true;\n}\n\nfunction dismissReminder(workspaceId: string): void {\n reminderStorage(workspaceId).write(true);\n}\n\nfunction reminderStorage(workspaceId: string) {\n return createTypedBrowserStorage(\n sessionStorageOrUndefined,\n {\n key: 'shipfox.modelProviderReminder.dismissed',\n lifetime: 'session' as const,\n principalScope: 'workspace' as const,\n serialize: (dismissed: boolean) => JSON.stringify(dismissed),\n parse: (raw: string) => raw === 'true',\n },\n {workspaceId},\n );\n}\n"],"names":["useModelProviderConfigsQuery","createTypedBrowserStorage","sessionStorageOrUndefined","Alert","AlertActions","AlertClose","AlertContent","AlertDescription","AlertTitle","Button","Link","useState","ModelProviderReminderBanner","workspaceId","configsQuery","dismissed","setDismissed","isReminderDismissed","configs","data","unconfigured","Array","isArray","length","defaultProviderId","variant","animated","onOpenChange","open","dismissReminder","className","asChild","size","to","params","wid","reminderStorage","read","write","key","lifetime","principalScope","serialize","JSON","stringify","parse","raw"],"mappings":";AAAA,SAAQA,4BAA4B,QAAO,wBAAwB;AACnE,SAAQC,yBAAyB,EAAEC,yBAAyB,QAAO,qBAAqB;AACxF,SACEC,KAAK,EACLC,YAAY,EACZC,UAAU,EACVC,YAAY,EACZC,gBAAgB,EAChBC,UAAU,QACL,0BAA0B;AACjC,SAAQC,MAAM,QAAO,2BAA2B;AAChD,SAAQC,IAAI,QAAO,yBAAyB;AAC5C,SAAQC,QAAQ,QAAO,QAAQ;AAE/B,OAAO,SAASC,4BAA4B,EAACC,WAAW,EAAwB;IAC9E,MAAMC,eAAed,6BAA6Ba;IAClD,MAAM,CAACE,WAAWC,aAAa,GAAGL,SAAS,IAAMM,oBAAoBJ;IACrE,MAAMK,UAAUJ,aAAaK,IAAI,EAAED;IACnC,MAAME,eACJC,MAAMC,OAAO,CAACJ,YAAYA,QAAQK,MAAM,KAAK,KAAKT,aAAaK,IAAI,EAAEK,sBAAsB;IAE7F,IAAI,CAACJ,gBAAgBL,WAAW,OAAO;IAEvC,qBACE,MAACZ;QACCsB,SAAQ;QACRC,UAAU;QACVC,cAAc,CAACC;YACb,IAAI,CAACA,MAAM;gBACTC,gBAAgBhB;gBAChBG,aAAa;YACf;QACF;;0BAEA,MAACV;gBAAawB,WAAU;;kCACtB,KAACtB;kCAAW;;kCACZ,KAACD;kCAAiB;;kCAGlB,KAACH;kCACC,cAAA,KAACK;4BAAOsB,OAAO;4BAACC,MAAK;4BAAKP,SAAQ;sCAChC,cAAA,KAACf;gCAAKuB,IAAG;gCAAmCC,QAAQ;oCAACC,KAAKtB;gCAAW;0CAAG;;;;;;0BAM9E,KAACR;;;AAGP;AAEA,SAASY,oBAAoBJ,WAAmB;IAC9C,OAAOuB,gBAAgBvB,aAAawB,IAAI,OAAO;AACjD;AAEA,SAASR,gBAAgBhB,WAAmB;IAC1CuB,gBAAgBvB,aAAayB,KAAK,CAAC;AACrC;AAEA,SAASF,gBAAgBvB,WAAmB;IAC1C,OAAOZ,0BACLC,2BACA;QACEqC,KAAK;QACLC,UAAU;QACVC,gBAAgB;QAChBC,WAAW,CAAC3B,YAAuB4B,KAAKC,SAAS,CAAC7B;QAClD8B,OAAO,CAACC,MAAgBA,QAAQ;IAClC,GACA;QAACjC;IAAW;AAEhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DefinitionSyncSummary } from '#core/definition.js';
|
|
2
2
|
/**
|
|
3
3
|
* We cannot cheaply resolve `external_repository_id` → `owner/repo`
|
|
4
4
|
* (no by-id endpoint; `listRepositories` is paginated by connection).
|
|
@@ -8,7 +8,7 @@ import type { DefinitionSyncSummaryDto } from '@shipfox/api-definitions-dto';
|
|
|
8
8
|
export declare function SourceStrip({ connectionId, externalRepositoryId, sync, isPending, }: {
|
|
9
9
|
connectionId: string;
|
|
10
10
|
externalRepositoryId: string;
|
|
11
|
-
sync:
|
|
11
|
+
sync: DefinitionSyncSummary | null | undefined;
|
|
12
12
|
isPending: boolean;
|
|
13
13
|
}): import("react").JSX.Element;
|
|
14
14
|
//# sourceMappingURL=source-strip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-strip.d.ts","sourceRoot":"","sources":["../../src/components/source-strip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"source-strip.d.ts","sourceRoot":"","sources":["../../src/components/source-strip.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,qBAAqB,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,YAAY,EACZ,oBAAoB,EACpB,IAAI,EACJ,SAAS,GACV,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,SAAS,EAAE,OAAO,CAAC;CACpB,+BAmCA"}
|
|
@@ -14,7 +14,7 @@ import { Code, Text } from '@shipfox/react-ui/typography';
|
|
|
14
14
|
*/ export function SourceStrip({ connectionId, externalRepositoryId, sync, isPending }) {
|
|
15
15
|
const workspace = useActiveWorkspace();
|
|
16
16
|
const connectionsQuery = useSourceConnectionsQuery(workspace.id);
|
|
17
|
-
const connection = connectionsQuery.data?.
|
|
17
|
+
const connection = connectionsQuery.data?.find((c)=>c.id === connectionId);
|
|
18
18
|
return /*#__PURE__*/ _jsxs("section", {
|
|
19
19
|
className: "flex flex-col gap-8 rounded-8 border border-border-neutral-base bg-background-neutral-base px-14 py-10 sm:flex-row sm:items-center sm:justify-between",
|
|
20
20
|
"aria-label": "Project source",
|
|
@@ -35,7 +35,7 @@ import { Code, Text } from '@shipfox/react-ui/typography';
|
|
|
35
35
|
size: "sm",
|
|
36
36
|
bold: true,
|
|
37
37
|
className: "truncate",
|
|
38
|
-
children: connection?.
|
|
38
|
+
children: connection?.displayName ?? 'Connected source'
|
|
39
39
|
}),
|
|
40
40
|
/*#__PURE__*/ _jsxs(Tooltip, {
|
|
41
41
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/source-strip.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/components/source-strip.tsx"],"sourcesContent":["import {useActiveWorkspace} from '@shipfox/client-auth';\nimport {useSourceConnectionsQuery} from '@shipfox/client-integrations';\nimport {StatusBadge} from '@shipfox/react-ui/badge';\nimport {Icon, type IconName} from '@shipfox/react-ui/icon';\nimport {Skeleton} from '@shipfox/react-ui/skeleton';\nimport {Tooltip, TooltipContent, TooltipTrigger} from '@shipfox/react-ui/tooltip';\nimport {Code, Text} from '@shipfox/react-ui/typography';\nimport type {DefinitionSyncSummary} from '#core/definition.js';\n\n/**\n * We cannot cheaply resolve `external_repository_id` → `owner/repo`\n * (no by-id endpoint; `listRepositories` is paginated by connection).\n * The strip surfaces the raw id as a `<Code>` chip with a tooltip carrying the\n * full string.\n */\nexport function SourceStrip({\n connectionId,\n externalRepositoryId,\n sync,\n isPending,\n}: {\n connectionId: string;\n externalRepositoryId: string;\n sync: DefinitionSyncSummary | null | undefined;\n isPending: boolean;\n}) {\n const workspace = useActiveWorkspace();\n const connectionsQuery = useSourceConnectionsQuery(workspace.id);\n const connection = connectionsQuery.data?.find((c) => c.id === connectionId);\n\n return (\n <section\n className=\"flex flex-col gap-8 rounded-8 border border-border-neutral-base bg-background-neutral-base px-14 py-10 sm:flex-row sm:items-center sm:justify-between\"\n aria-label=\"Project source\"\n >\n <div className=\"flex min-w-0 items-center gap-10\">\n <Icon name={providerIconName(connection?.provider)} className=\"size-20 shrink-0\" />\n <div className=\"flex min-w-0 flex-col gap-2 sm:flex-row sm:items-center sm:gap-10\">\n {connectionsQuery.isPending ? (\n <Skeleton className=\"h-16 w-160\" />\n ) : (\n <Text size=\"sm\" bold className=\"truncate\">\n {connection?.displayName ?? 'Connected source'}\n </Text>\n )}\n <Tooltip>\n <TooltipTrigger asChild>\n <Code variant=\"label\" className=\"truncate text-foreground-neutral-muted\">\n {externalRepositoryId}\n </Code>\n </TooltipTrigger>\n <TooltipContent>{externalRepositoryId}</TooltipContent>\n </Tooltip>\n </div>\n </div>\n <div className=\"shrink-0\">\n <SyncBadge sync={sync} isPending={isPending} />\n </div>\n </section>\n );\n}\n\nfunction providerIconName(provider: string | undefined): IconName {\n if (provider === 'github') return 'github' as IconName;\n return 'componentLine' as IconName;\n}\n\nfunction SyncBadge({\n sync,\n isPending,\n}: {\n sync: DefinitionSyncSummary | null | undefined;\n isPending: boolean;\n}) {\n if (isPending) return <StatusBadge variant=\"neutral\">Loading</StatusBadge>;\n if (sync === undefined) return <StatusBadge variant=\"neutral\">Unavailable</StatusBadge>;\n if (sync === null) return <StatusBadge variant=\"neutral\">No sync</StatusBadge>;\n\n const variantByStatus = {\n pending: 'neutral',\n syncing: 'info',\n succeeded: 'success',\n failed: 'error',\n } as const;\n\n return (\n <StatusBadge variant={variantByStatus[sync.status as keyof typeof variantByStatus]}>\n {sync.status}\n </StatusBadge>\n );\n}\n"],"names":["useActiveWorkspace","useSourceConnectionsQuery","StatusBadge","Icon","Skeleton","Tooltip","TooltipContent","TooltipTrigger","Code","Text","SourceStrip","connectionId","externalRepositoryId","sync","isPending","workspace","connectionsQuery","id","connection","data","find","c","section","className","aria-label","div","name","providerIconName","provider","size","bold","displayName","asChild","variant","SyncBadge","undefined","variantByStatus","pending","syncing","succeeded","failed","status"],"mappings":";AAAA,SAAQA,kBAAkB,QAAO,uBAAuB;AACxD,SAAQC,yBAAyB,QAAO,+BAA+B;AACvE,SAAQC,WAAW,QAAO,0BAA0B;AACpD,SAAQC,IAAI,QAAsB,yBAAyB;AAC3D,SAAQC,QAAQ,QAAO,6BAA6B;AACpD,SAAQC,OAAO,EAAEC,cAAc,EAAEC,cAAc,QAAO,4BAA4B;AAClF,SAAQC,IAAI,EAAEC,IAAI,QAAO,+BAA+B;AAGxD;;;;;CAKC,GACD,OAAO,SAASC,YAAY,EAC1BC,YAAY,EACZC,oBAAoB,EACpBC,IAAI,EACJC,SAAS,EAMV;IACC,MAAMC,YAAYf;IAClB,MAAMgB,mBAAmBf,0BAA0Bc,UAAUE,EAAE;IAC/D,MAAMC,aAAaF,iBAAiBG,IAAI,EAAEC,KAAK,CAACC,IAAMA,EAAEJ,EAAE,KAAKN;IAE/D,qBACE,MAACW;QACCC,WAAU;QACVC,cAAW;;0BAEX,MAACC;gBAAIF,WAAU;;kCACb,KAACpB;wBAAKuB,MAAMC,iBAAiBT,YAAYU;wBAAWL,WAAU;;kCAC9D,MAACE;wBAAIF,WAAU;;4BACZP,iBAAiBF,SAAS,iBACzB,KAACV;gCAASmB,WAAU;+CAEpB,KAACd;gCAAKoB,MAAK;gCAAKC,IAAI;gCAACP,WAAU;0CAC5BL,YAAYa,eAAe;;0CAGhC,MAAC1B;;kDACC,KAACE;wCAAeyB,OAAO;kDACrB,cAAA,KAACxB;4CAAKyB,SAAQ;4CAAQV,WAAU;sDAC7BX;;;kDAGL,KAACN;kDAAgBM;;;;;;;;0BAIvB,KAACa;gBAAIF,WAAU;0BACb,cAAA,KAACW;oBAAUrB,MAAMA;oBAAMC,WAAWA;;;;;AAI1C;AAEA,SAASa,iBAAiBC,QAA4B;IACpD,IAAIA,aAAa,UAAU,OAAO;IAClC,OAAO;AACT;AAEA,SAASM,UAAU,EACjBrB,IAAI,EACJC,SAAS,EAIV;IACC,IAAIA,WAAW,qBAAO,KAACZ;QAAY+B,SAAQ;kBAAU;;IACrD,IAAIpB,SAASsB,WAAW,qBAAO,KAACjC;QAAY+B,SAAQ;kBAAU;;IAC9D,IAAIpB,SAAS,MAAM,qBAAO,KAACX;QAAY+B,SAAQ;kBAAU;;IAEzD,MAAMG,kBAAkB;QACtBC,SAAS;QACTC,SAAS;QACTC,WAAW;QACXC,QAAQ;IACV;IAEA,qBACE,KAACtC;QAAY+B,SAASG,eAAe,CAACvB,KAAK4B,MAAM,CAAiC;kBAC/E5B,KAAK4B,MAAM;;AAGlB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface Definition {
|
|
2
|
+
id: string;
|
|
3
|
+
projectId: string;
|
|
4
|
+
configPath: string | null;
|
|
5
|
+
source: 'manual' | 'vcs';
|
|
6
|
+
sha: string | null;
|
|
7
|
+
ref: string | null;
|
|
8
|
+
name: string;
|
|
9
|
+
workflowDocument: unknown;
|
|
10
|
+
workflowModel: unknown;
|
|
11
|
+
manualTrigger: {
|
|
12
|
+
name: string;
|
|
13
|
+
} | null;
|
|
14
|
+
fetchedAt: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DefinitionSyncSummary {
|
|
19
|
+
ref: string | null;
|
|
20
|
+
status: 'pending' | 'syncing' | 'succeeded' | 'failed';
|
|
21
|
+
lastSyncAt: string;
|
|
22
|
+
startedAt: string | null;
|
|
23
|
+
finishedAt: string | null;
|
|
24
|
+
lastErrorCode: string | null;
|
|
25
|
+
lastErrorMessage: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface DefinitionList {
|
|
28
|
+
definitions: Definition[];
|
|
29
|
+
sync: DefinitionSyncSummary | null;
|
|
30
|
+
nextCursor: string | null;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/core/definition.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAC;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACnC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/definition.ts"],"sourcesContent":["export interface Definition {\n id: string;\n projectId: string;\n configPath: string | null;\n source: 'manual' | 'vcs';\n sha: string | null;\n ref: string | null;\n name: string;\n workflowDocument: unknown;\n workflowModel: unknown;\n manualTrigger: {name: string} | null;\n fetchedAt: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface DefinitionSyncSummary {\n ref: string | null;\n status: 'pending' | 'syncing' | 'succeeded' | 'failed';\n lastSyncAt: string;\n startedAt: string | null;\n finishedAt: string | null;\n lastErrorCode: string | null;\n lastErrorMessage: string | null;\n}\n\nexport interface DefinitionList {\n definitions: Definition[];\n sync: DefinitionSyncSummary | null;\n nextCursor: string | null;\n}\n"],"names":[],"mappings":"AA0BA,WAIC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface ProjectSource {
|
|
2
|
+
connectionId: string;
|
|
3
|
+
externalRepositoryId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Project {
|
|
6
|
+
id: string;
|
|
7
|
+
workspaceId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
source: ProjectSource;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ProjectList {
|
|
14
|
+
projects: Project[];
|
|
15
|
+
nextCursor: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface CreateProjectCommand {
|
|
18
|
+
workspaceId: string;
|
|
19
|
+
name: string;
|
|
20
|
+
source: ProjectSource;
|
|
21
|
+
}
|
|
22
|
+
export declare function projectNameFromRepository(repositoryId: string): string;
|
|
23
|
+
export declare function selectProjectSource<T extends {
|
|
24
|
+
externalRepositoryId: string;
|
|
25
|
+
}>(repositories: T[], selectedRepositoryId: string | undefined): T | undefined;
|
|
26
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/core/project.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;CACvB;AAID,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAOtE;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS;IAAC,oBAAoB,EAAE,MAAM,CAAA;CAAC,EAC1E,YAAY,EAAE,CAAC,EAAE,EACjB,oBAAoB,EAAE,MAAM,GAAG,SAAS,GACvC,CAAC,GAAG,SAAS,CAOf"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const REPOSITORY_NAME_SPLIT_RE = /[/-]/;
|
|
2
|
+
export function projectNameFromRepository(repositoryId) {
|
|
3
|
+
return repositoryId.trim().split(REPOSITORY_NAME_SPLIT_RE).filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join(' ');
|
|
4
|
+
}
|
|
5
|
+
export function selectProjectSource(repositories, selectedRepositoryId) {
|
|
6
|
+
if (selectedRepositoryId) {
|
|
7
|
+
return repositories.find((repository)=>repository.externalRepositoryId === selectedRepositoryId);
|
|
8
|
+
}
|
|
9
|
+
return repositories[0];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/project.ts"],"sourcesContent":["export interface ProjectSource {\n connectionId: string;\n externalRepositoryId: string;\n}\n\nexport interface Project {\n id: string;\n workspaceId: string;\n name: string;\n source: ProjectSource;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ProjectList {\n projects: Project[];\n nextCursor: string | null;\n}\n\nexport interface CreateProjectCommand {\n workspaceId: string;\n name: string;\n source: ProjectSource;\n}\n\nconst REPOSITORY_NAME_SPLIT_RE = /[/-]/;\n\nexport function projectNameFromRepository(repositoryId: string): string {\n return repositoryId\n .trim()\n .split(REPOSITORY_NAME_SPLIT_RE)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ');\n}\n\nexport function selectProjectSource<T extends {externalRepositoryId: string}>(\n repositories: T[],\n selectedRepositoryId: string | undefined,\n): T | undefined {\n if (selectedRepositoryId) {\n return repositories.find(\n (repository) => repository.externalRepositoryId === selectedRepositoryId,\n );\n }\n return repositories[0];\n}\n"],"names":["REPOSITORY_NAME_SPLIT_RE","projectNameFromRepository","repositoryId","trim","split","filter","Boolean","map","part","charAt","toUpperCase","slice","join","selectProjectSource","repositories","selectedRepositoryId","find","repository","externalRepositoryId"],"mappings":"AAyBA,MAAMA,2BAA2B;AAEjC,OAAO,SAASC,0BAA0BC,YAAoB;IAC5D,OAAOA,aACJC,IAAI,GACJC,KAAK,CAACJ,0BACNK,MAAM,CAACC,SACPC,GAAG,CAAC,CAACC,OAASA,KAAKC,MAAM,CAAC,GAAGC,WAAW,KAAKF,KAAKG,KAAK,CAAC,IACxDC,IAAI,CAAC;AACV;AAEA,OAAO,SAASC,oBACdC,YAAiB,EACjBC,oBAAwC;IAExC,IAAIA,sBAAsB;QACxB,OAAOD,aAAaE,IAAI,CACtB,CAACC,aAAeA,WAAWC,oBAAoB,KAAKH;IAExD;IACA,OAAOD,YAAY,CAAC,EAAE;AACxB"}
|
package/dist/feature.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
export declare const projectsNavigation: readonly [{
|
|
2
|
+
readonly id: "nav.projects";
|
|
3
|
+
readonly scope: "workspace";
|
|
4
|
+
readonly label: "Projects";
|
|
5
|
+
readonly to: "/workspaces/$wid";
|
|
6
|
+
readonly exact: true;
|
|
7
|
+
readonly order: 100;
|
|
8
|
+
}];
|
|
1
9
|
export declare const projectsFeature: {
|
|
2
10
|
readonly id: "shipfox.projects";
|
|
3
11
|
readonly routes: readonly [{
|
package/dist/feature.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../src/feature.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../src/feature.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;EASY,CAAC;AAE5C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;CAoB1B,CAAC"}
|
package/dist/feature.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { defineClientFeature } from '@shipfox/client-shell';
|
|
2
|
+
export const projectsNavigation = [
|
|
3
|
+
{
|
|
4
|
+
id: 'nav.projects',
|
|
5
|
+
scope: 'workspace',
|
|
6
|
+
label: 'Projects',
|
|
7
|
+
to: '/workspaces/$wid',
|
|
8
|
+
exact: true,
|
|
9
|
+
order: 100
|
|
10
|
+
}
|
|
11
|
+
];
|
|
2
12
|
export const projectsFeature = defineClientFeature({
|
|
3
13
|
id: 'shipfox.projects',
|
|
4
14
|
routes: [
|
|
@@ -18,16 +28,7 @@ export const projectsFeature = defineClientFeature({
|
|
|
18
28
|
impl: '@shipfox/client-projects/routes/project-index'
|
|
19
29
|
}
|
|
20
30
|
],
|
|
21
|
-
navigation:
|
|
22
|
-
{
|
|
23
|
-
id: 'nav.projects',
|
|
24
|
-
scope: 'workspace',
|
|
25
|
-
label: 'Projects',
|
|
26
|
-
to: '/workspaces/$wid',
|
|
27
|
-
exact: true,
|
|
28
|
-
order: 100
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
+
navigation: projectsNavigation
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
//# sourceMappingURL=feature.js.map
|
package/dist/feature.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/feature.ts"],"sourcesContent":["import {defineClientFeature} from '@shipfox/client-shell';\n\nexport const projectsFeature = defineClientFeature({\n id: 'shipfox.projects',\n routes: [\n {\n path: '/workspaces/$wid',\n parent: 'workspaceLayout',\n impl: '@shipfox/client-projects/routes/home',\n },\n {\n path: '/workspaces/$wid/projects/new',\n parent: 'workspaceLayout',\n impl: '@shipfox/client-projects/routes/create-project',\n },\n {\n path: '/workspaces/$wid/projects/$pid',\n parent: 'projectLayout',\n impl: '@shipfox/client-projects/routes/project-index',\n },\n ],\n navigation:
|
|
1
|
+
{"version":3,"sources":["../src/feature.ts"],"sourcesContent":["import {defineClientFeature, type NavTabEntry} from '@shipfox/client-shell';\n\nexport const projectsNavigation = [\n {\n id: 'nav.projects',\n scope: 'workspace',\n label: 'Projects',\n to: '/workspaces/$wid',\n exact: true,\n order: 100,\n },\n] as const satisfies readonly NavTabEntry[];\n\nexport const projectsFeature = defineClientFeature({\n id: 'shipfox.projects',\n routes: [\n {\n path: '/workspaces/$wid',\n parent: 'workspaceLayout',\n impl: '@shipfox/client-projects/routes/home',\n },\n {\n path: '/workspaces/$wid/projects/new',\n parent: 'workspaceLayout',\n impl: '@shipfox/client-projects/routes/create-project',\n },\n {\n path: '/workspaces/$wid/projects/$pid',\n parent: 'projectLayout',\n impl: '@shipfox/client-projects/routes/project-index',\n },\n ],\n navigation: projectsNavigation,\n});\n"],"names":["defineClientFeature","projectsNavigation","id","scope","label","to","exact","order","projectsFeature","routes","path","parent","impl","navigation"],"mappings":"AAAA,SAAQA,mBAAmB,QAAyB,wBAAwB;AAE5E,OAAO,MAAMC,qBAAqB;IAChC;QACEC,IAAI;QACJC,OAAO;QACPC,OAAO;QACPC,IAAI;QACJC,OAAO;QACPC,OAAO;IACT;CACD,CAA2C;AAE5C,OAAO,MAAMC,kBAAkBR,oBAAoB;IACjDE,IAAI;IACJO,QAAQ;QACN;YACEC,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;QACA;YACEF,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;QACA;YACEF,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;KACD;IACDC,YAAYZ;AACd,GAAG"}
|
|
@@ -1,97 +1,21 @@
|
|
|
1
|
+
import { type InfiniteData, type UseInfiniteQueryOptions, type UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { DefinitionList } from '#core/definition.js';
|
|
1
3
|
export declare const definitionsQueryKeys: {
|
|
2
4
|
all: readonly ["definitions"];
|
|
3
5
|
list: (projectId: string) => readonly ["definitions", "list", string];
|
|
4
6
|
};
|
|
7
|
+
type DefinitionListQueryKey = ReturnType<typeof definitionsQueryKeys.list> | readonly ['definitions', 'list'];
|
|
8
|
+
type DefinitionListInfiniteQueryOptions = UseInfiniteQueryOptions<DefinitionList, Error, InfiniteData<DefinitionList, string | undefined>, DefinitionListQueryKey, string | undefined>;
|
|
9
|
+
type DefinitionListQueryOptions = UseQueryOptions<DefinitionList, Error, DefinitionList, DefinitionListQueryKey>;
|
|
5
10
|
export declare function listDefinitions({ projectId, limit, cursor, signal, }: {
|
|
6
11
|
projectId: string;
|
|
7
12
|
limit?: number;
|
|
8
13
|
cursor?: string | undefined;
|
|
9
|
-
signal?: AbortSignal;
|
|
10
|
-
}): Promise<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
sha: string | null;
|
|
17
|
-
ref: string | null;
|
|
18
|
-
name: string;
|
|
19
|
-
workflow_document: unknown;
|
|
20
|
-
workflow_model: unknown;
|
|
21
|
-
manual_trigger: {
|
|
22
|
-
name: string;
|
|
23
|
-
} | null;
|
|
24
|
-
fetched_at: string;
|
|
25
|
-
created_at: string;
|
|
26
|
-
updated_at: string;
|
|
27
|
-
}[];
|
|
28
|
-
sync: {
|
|
29
|
-
ref: string | null;
|
|
30
|
-
status: "pending" | "syncing" | "succeeded" | "failed";
|
|
31
|
-
last_sync_at: string;
|
|
32
|
-
started_at: string | null;
|
|
33
|
-
finished_at: string | null;
|
|
34
|
-
last_error_code: "unknown" | "no-workflow-files" | "invalid-definition" | "provider-repository-not-found" | "provider-file-not-found" | "provider-access-denied" | "provider-rate-limited" | "provider-timeout" | "provider-unavailable" | "provider-malformed-response" | "content-too-large" | "too-many-files" | "connection-unavailable" | null;
|
|
35
|
-
last_error_message: string | null;
|
|
36
|
-
} | null;
|
|
37
|
-
next_cursor: string | null;
|
|
38
|
-
}>;
|
|
39
|
-
export declare function useDefinitionsInfiniteQuery(projectId: string | undefined, limit?: number): import("@tanstack/react-query").UseInfiniteQueryResult<import("@tanstack/react-query").InfiniteData<{
|
|
40
|
-
definitions: {
|
|
41
|
-
id: string;
|
|
42
|
-
project_id: string;
|
|
43
|
-
config_path: string | null;
|
|
44
|
-
source: "manual" | "vcs";
|
|
45
|
-
sha: string | null;
|
|
46
|
-
ref: string | null;
|
|
47
|
-
name: string;
|
|
48
|
-
workflow_document: unknown;
|
|
49
|
-
workflow_model: unknown;
|
|
50
|
-
manual_trigger: {
|
|
51
|
-
name: string;
|
|
52
|
-
} | null;
|
|
53
|
-
fetched_at: string;
|
|
54
|
-
created_at: string;
|
|
55
|
-
updated_at: string;
|
|
56
|
-
}[];
|
|
57
|
-
sync: {
|
|
58
|
-
ref: string | null;
|
|
59
|
-
status: "pending" | "syncing" | "succeeded" | "failed";
|
|
60
|
-
last_sync_at: string;
|
|
61
|
-
started_at: string | null;
|
|
62
|
-
finished_at: string | null;
|
|
63
|
-
last_error_code: "unknown" | "no-workflow-files" | "invalid-definition" | "provider-repository-not-found" | "provider-file-not-found" | "provider-access-denied" | "provider-rate-limited" | "provider-timeout" | "provider-unavailable" | "provider-malformed-response" | "content-too-large" | "too-many-files" | "connection-unavailable" | null;
|
|
64
|
-
last_error_message: string | null;
|
|
65
|
-
} | null;
|
|
66
|
-
next_cursor: string | null;
|
|
67
|
-
}, unknown>, Error>;
|
|
68
|
-
export declare function useDefinitionsQuery(projectId: string | undefined): import("@tanstack/react-query").UseQueryResult<NoInfer<{
|
|
69
|
-
definitions: {
|
|
70
|
-
id: string;
|
|
71
|
-
project_id: string;
|
|
72
|
-
config_path: string | null;
|
|
73
|
-
source: "manual" | "vcs";
|
|
74
|
-
sha: string | null;
|
|
75
|
-
ref: string | null;
|
|
76
|
-
name: string;
|
|
77
|
-
workflow_document: unknown;
|
|
78
|
-
workflow_model: unknown;
|
|
79
|
-
manual_trigger: {
|
|
80
|
-
name: string;
|
|
81
|
-
} | null;
|
|
82
|
-
fetched_at: string;
|
|
83
|
-
created_at: string;
|
|
84
|
-
updated_at: string;
|
|
85
|
-
}[];
|
|
86
|
-
sync: {
|
|
87
|
-
ref: string | null;
|
|
88
|
-
status: "pending" | "syncing" | "succeeded" | "failed";
|
|
89
|
-
last_sync_at: string;
|
|
90
|
-
started_at: string | null;
|
|
91
|
-
finished_at: string | null;
|
|
92
|
-
last_error_code: "unknown" | "no-workflow-files" | "invalid-definition" | "provider-repository-not-found" | "provider-file-not-found" | "provider-access-denied" | "provider-rate-limited" | "provider-timeout" | "provider-unavailable" | "provider-malformed-response" | "content-too-large" | "too-many-files" | "connection-unavailable" | null;
|
|
93
|
-
last_error_message: string | null;
|
|
94
|
-
} | null;
|
|
95
|
-
next_cursor: string | null;
|
|
96
|
-
}>, Error>;
|
|
14
|
+
signal?: AbortSignal | undefined;
|
|
15
|
+
}): Promise<DefinitionList>;
|
|
16
|
+
export declare function definitionsInfiniteQueryOptions(projectId: string | undefined, limit?: number): DefinitionListInfiniteQueryOptions;
|
|
17
|
+
export declare function definitionsQueryOptions(projectId: string | undefined): DefinitionListQueryOptions;
|
|
18
|
+
export declare function useDefinitionsInfiniteQuery(projectId: string | undefined, limit?: number): import("@tanstack/react-query").UseInfiniteQueryResult<InfiniteData<DefinitionList, string | undefined>, Error>;
|
|
19
|
+
export declare function useDefinitionsQuery(projectId: string | undefined): import("@tanstack/react-query").UseQueryResult<NoInfer<DefinitionList>, Error>;
|
|
20
|
+
export {};
|
|
97
21
|
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/definitions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/definitions.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EAGrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAGxD,eAAO,MAAM,oBAAoB;;sBAEb,MAAM;CACzB,CAAC;AAEF,KAAK,sBAAsB,GACvB,UAAU,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GAC5C,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACrC,KAAK,kCAAkC,GAAG,uBAAuB,CAC/D,cAAc,EACd,KAAK,EACL,YAAY,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC,EAChD,sBAAsB,EACtB,MAAM,GAAG,SAAS,CACnB,CAAC;AACF,KAAK,0BAA0B,GAAG,eAAe,CAC/C,cAAc,EACd,KAAK,EACL,cAAc,EACd,sBAAsB,CACvB,CAAC;AACF,wBAAsB,eAAe,CAAC,EACpC,SAAS,EACT,KAAU,EACV,MAAM,EACN,MAAM,GACP,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAClC,GAAG,OAAO,CAAC,cAAc,CAAC,CAQ1B;AACD,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,SAAK,GACT,kCAAkC,CAYpC;AACD,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,0BAA0B,CAQjG;AACD,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,SAAK,mHAEpF;AACD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,kFAEhE"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { definitionListResponseSchema } from '@shipfox/api-definitions-dto';
|
|
2
|
+
import { checkedApiRequest } from '@shipfox/client-api';
|
|
3
|
+
import { keepPreviousData, queryOptions, useInfiniteQuery, useQuery } from '@tanstack/react-query';
|
|
4
|
+
import { toDefinitionList } from './mappers.js';
|
|
3
5
|
export const definitionsQueryKeys = {
|
|
4
6
|
all: [
|
|
5
7
|
'definitions'
|
|
@@ -16,12 +18,12 @@ export async function listDefinitions({ projectId, limit = 50, cursor, signal })
|
|
|
16
18
|
limit: String(limit)
|
|
17
19
|
});
|
|
18
20
|
if (cursor) params.set('cursor', cursor);
|
|
19
|
-
return await
|
|
21
|
+
return toDefinitionList(await checkedApiRequest(definitionListResponseSchema, `/definitions?${params.toString()}`, {
|
|
20
22
|
signal
|
|
21
|
-
});
|
|
23
|
+
}));
|
|
22
24
|
}
|
|
23
|
-
export function
|
|
24
|
-
return
|
|
25
|
+
export function definitionsInfiniteQueryOptions(projectId, limit = 50) {
|
|
26
|
+
return {
|
|
25
27
|
queryKey: projectId ? definitionsQueryKeys.list(projectId) : [
|
|
26
28
|
...definitionsQueryKeys.all,
|
|
27
29
|
'list'
|
|
@@ -34,12 +36,12 @@ export function useDefinitionsInfiniteQuery(projectId, limit = 50) {
|
|
|
34
36
|
cursor: pageParam,
|
|
35
37
|
signal
|
|
36
38
|
}),
|
|
37
|
-
getNextPageParam: (lastPage)=>lastPage.
|
|
39
|
+
getNextPageParam: (lastPage)=>lastPage.nextCursor ?? undefined,
|
|
38
40
|
placeholderData: keepPreviousData
|
|
39
|
-
}
|
|
41
|
+
};
|
|
40
42
|
}
|
|
41
|
-
export function
|
|
42
|
-
return
|
|
43
|
+
export function definitionsQueryOptions(projectId) {
|
|
44
|
+
return queryOptions({
|
|
43
45
|
queryKey: projectId ? definitionsQueryKeys.list(projectId) : [
|
|
44
46
|
...definitionsQueryKeys.all,
|
|
45
47
|
'list'
|
|
@@ -51,5 +53,11 @@ export function useDefinitionsQuery(projectId) {
|
|
|
51
53
|
})
|
|
52
54
|
});
|
|
53
55
|
}
|
|
56
|
+
export function useDefinitionsInfiniteQuery(projectId, limit = 50) {
|
|
57
|
+
return useInfiniteQuery(definitionsInfiniteQueryOptions(projectId, limit));
|
|
58
|
+
}
|
|
59
|
+
export function useDefinitionsQuery(projectId) {
|
|
60
|
+
return useQuery(definitionsQueryOptions(projectId));
|
|
61
|
+
}
|
|
54
62
|
|
|
55
63
|
//# sourceMappingURL=definitions.js.map
|