@shipfox/client-triggers 4.0.0 → 5.0.0
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 +11 -0
- package/dist/feature.d.ts +16 -0
- package/dist/feature.d.ts.map +1 -0
- package/dist/feature.js +22 -0
- package/dist/feature.js.map +1 -0
- package/dist/routes/events-settings.d.ts +8 -0
- package/dist/routes/events-settings.d.ts.map +1 -0
- package/dist/routes/events-settings.js +37 -0
- package/dist/routes/events-settings.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +12 -3
- package/src/feature.ts +15 -0
- package/src/routes/events-settings.tsx +30 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/client-triggers",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -17,14 +17,23 @@
|
|
|
17
17
|
".": {
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./feature": {
|
|
22
|
+
"types": "./dist/feature.d.ts",
|
|
23
|
+
"default": "./dist/feature.js"
|
|
24
|
+
},
|
|
25
|
+
"./routes/*": {
|
|
26
|
+
"types": "./dist/routes/*.d.ts",
|
|
27
|
+
"default": "./dist/routes/*.js"
|
|
20
28
|
}
|
|
21
29
|
},
|
|
22
30
|
"dependencies": {
|
|
23
31
|
"@swc/helpers": "^0.5.17",
|
|
24
|
-
"@shipfox/api-triggers-dto": "5.0.0",
|
|
25
32
|
"@shipfox/client-api": "4.0.0",
|
|
26
|
-
"@shipfox/client-integrations": "
|
|
33
|
+
"@shipfox/client-integrations": "5.0.0",
|
|
34
|
+
"@shipfox/client-shell": "5.0.0",
|
|
27
35
|
"@shipfox/client-ui": "4.0.0",
|
|
36
|
+
"@shipfox/api-triggers-dto": "5.0.0",
|
|
28
37
|
"@shipfox/react-ui": "0.3.5"
|
|
29
38
|
},
|
|
30
39
|
"peerDependencies": {
|
package/src/feature.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {defineClientFeature} from '@shipfox/client-shell';
|
|
2
|
+
|
|
3
|
+
export const triggersFeature = defineClientFeature({
|
|
4
|
+
id: 'shipfox.triggers',
|
|
5
|
+
routes: [
|
|
6
|
+
{
|
|
7
|
+
path: '/workspaces/$wid/settings/events',
|
|
8
|
+
parent: 'workspaceSettings',
|
|
9
|
+
impl: '@shipfox/client-triggers/routes/events-settings',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
settingsSections: [
|
|
13
|
+
{id: 'settings.events', pathSegment: 'events', label: 'Events', icon: 'pulseLine', order: 800},
|
|
14
|
+
],
|
|
15
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {defineRoute, useActiveWorkspace} from '@shipfox/client-shell/runtime';
|
|
2
|
+
import {getRouteApi} from '@tanstack/react-router';
|
|
3
|
+
import type {TriggerEventFilters} from '#hooks/api/trigger-events.js';
|
|
4
|
+
import {EventsPage} from '#pages/events-page.js';
|
|
5
|
+
import {type TriggerEventsSearch, validateTriggerEventsSearch} from '#search.js';
|
|
6
|
+
|
|
7
|
+
const routeApi = getRouteApi('/workspaces/$wid/settings/events');
|
|
8
|
+
|
|
9
|
+
// Wrapped (not just re-typed) so the search validator's own type is portable outside this
|
|
10
|
+
// package: TanStack Router's `const` generics capture the exact declared function, and a
|
|
11
|
+
// route module consumed from another package (apps/client's composed router) can't print a
|
|
12
|
+
// type that only resolves through this package's internal `#search.js` path.
|
|
13
|
+
function validateSearch(search: Record<string, unknown>): TriggerEventsSearch {
|
|
14
|
+
return validateTriggerEventsSearch(search);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default defineRoute({
|
|
18
|
+
validateSearch,
|
|
19
|
+
component: () => {
|
|
20
|
+
const workspace = useActiveWorkspace();
|
|
21
|
+
const search = routeApi.useSearch();
|
|
22
|
+
const navigate = routeApi.useNavigate();
|
|
23
|
+
const onFiltersChange = (patch: Partial<TriggerEventFilters>) => {
|
|
24
|
+
void navigate({search: {...search, ...patch}, replace: true});
|
|
25
|
+
};
|
|
26
|
+
return (
|
|
27
|
+
<EventsPage workspaceId={workspace.id} filters={search} onFiltersChange={onFiltersChange} />
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
});
|