Skip to content

Commit 46b029c

Browse files
committed
sidebar notoken & perm state, add DS read to read token
1 parent c1a88cd commit 46b029c

File tree

14 files changed

+36
-17
lines changed

14 files changed

+36
-17
lines changed

apps/web/src/components/sidebar.tsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function AppCard({
3939
<div>
4040
<div className="flex items-center gap-2">
4141
<h3 className="font-semibold text-sm">{app.name}</h3>
42-
<span className="text-xs text-muted-foreground">({state})</span>
42+
{/* <span className="text-xs text-muted-foreground">({state})</span> */}
4343
</div>
4444
</div>
4545
</div>
@@ -75,28 +75,34 @@ function SidebarContent({ activeAppId }: { activeAppId?: string }) {
7575

7676
useEffect(() => {
7777
async function fetchToolStates() {
78-
if (!token) return;
79-
setIsLoading(true);
80-
// setError(undefined);
81-
try {
82-
const allStates = await checkToolState(token);
78+
if (!token) {
8379
const states = Object.values(TOOLS).map((app) => {
84-
return [app.id, allStates[app.ds]] as const;
80+
return [app.id, 'available'] as const;
8581
});
8682
setToolStates(Object.fromEntries(states));
87-
} catch (error) {
88-
if (error instanceof InvalidTokenError) {
89-
// setError('Invalid token');
90-
setToken(null);
91-
} else {
92-
console.error('Failed to fetch tool states:', error);
93-
// setError('Failed to fetch tool states');
83+
} else {
84+
setIsLoading(true);
85+
// setError(undefined);
86+
try {
87+
const allStates = await checkToolState(token);
88+
const states = Object.values(TOOLS).map((app) => {
89+
return [app.id, allStates[app.ds] ?? 'available'] as const;
90+
});
91+
setToolStates(Object.fromEntries(states));
92+
} catch (error) {
93+
if (error instanceof InvalidTokenError) {
94+
// setError('Invalid token');
95+
setToken(null);
96+
} else {
97+
console.error('Failed to fetch tool states:', error);
98+
// setError('Failed to fetch tool states');
99+
}
100+
} finally {
101+
setIsLoading(false);
94102
}
95-
} finally {
96-
setIsLoading(false);
97103
}
98104
}
99-
if (token) fetchToolStates();
105+
fetchToolStates();
100106
}, [token, setToken]);
101107

102108
return (

tinybird/datasources/auth0.datasource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TOKEN "append" APPEND
2+
TOKEN "read" READ
23

34
# Refer to https://github.com/auth0/auth0-log-schemas and https://auth0.com/docs/deploy-monitor/logs/log-event-type-codes for the type codes
45

tinybird/datasources/clerk.datasource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TOKEN "append" APPEND
2+
TOKEN "read" READ
23

34
# Refer to https://clerk.com/docs/webhooks/overview#payload-structure
45

tinybird/datasources/github.datasource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TOKEN "append" APPEND
2+
TOKEN "read" READ
23

34
# Refer to https://docs.github.com/en/webhooks/webhook-events-and-payloads
45

tinybird/datasources/gitlab.datasource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TOKEN "append" APPEND
2+
TOKEN "read" READ
23

34
# Refer to https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html
45

tinybird/datasources/knock.datasource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TOKEN "append" APPEND
2+
TOKEN "read" READ
23

34
# Refer to https://docs.knock.app/developer-tools/outbound-webhooks/event-types
45

tinybird/datasources/mailgun.datasource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TOKEN "append" APPEND
2+
TOKEN "read" READ
23

34
# Refer to https://mailgun-docs.redoc.ly/docs/mailgun/user-manual/events/#event-structure
45

tinybird/datasources/orb.datasource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TOKEN "append" APPEND
2+
TOKEN "read" READ
23

34
# Refer to https://docs.withorb.com/guides/integrations-and-exports/webhooks for the `details` schema definition for each resource type
45

tinybird/datasources/pagerduty.datasource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TOKEN "append" APPEND
2+
TOKEN "read" READ
23

34
# Refer to https://developer.pagerduty.com/docs/webhooks-overview#webhook-payload
45

tinybird/datasources/resend.datasource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TOKEN "append" APPEND
2+
TOKEN "read" READ
23

34
# Refer to https://resend.com/docs/dashboard/webhooks/event-types
45

0 commit comments

Comments
 (0)