-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Design-System-Project/feature/tfr2-107-add…
…-api-code Refactor project structure
- Loading branch information
Showing
113 changed files
with
1,910 additions
and
1,344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,57 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
node_modules/ | ||
/.pnp | ||
.pnp.js | ||
.yarn/install-state.gz | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
.next/ | ||
/out/ | ||
|
||
# production | ||
dist/ | ||
|
||
# misc | ||
.DS_Store | ||
node_modules | ||
.turbo | ||
*.pem | ||
.cache/ | ||
|
||
# debug | ||
*.log | ||
.next | ||
dist | ||
dist-ssr | ||
*.local | ||
.env | ||
.cache | ||
server/dist | ||
public/dist | ||
storybook-static/ | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
certificates | ||
|
||
# editors | ||
.vscode | ||
.idea | ||
|
||
# monorepo | ||
.turbo | ||
|
||
|
||
# package specific | ||
packages/components/src/components | ||
packages/components/components.json | ||
|
||
# database | ||
packages/database/supabase/.branches | ||
packages/database/supabase/.temp | ||
packages/database/supabase/.env | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
NEXT_PUBLIC_SUPABASE_URL= | ||
NEXT_PUBLIC_SUPABASE_ANON_KEY= |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
apps/dashboard/src/app/(dashboard)/integrations/providers/figma/_actions/index.ts
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
...ashboard/src/app/(dashboard)/integrations/providers/figma/_actions/installation.action.ts
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
apps/dashboard/src/app/(dashboard)/integrations/providers/figma/_components/provider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 2 additions & 10 deletions
12
...ashboard)/integrations/providers/figma/resources/[resourceId]/_actions/resource.action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
'use server'; | ||
|
||
import { eq } from 'drizzle-orm'; | ||
import { isAuthenticated } from '@/lib/supabase/server/utils/is-authenticated'; | ||
import { database } from '@ds-project/database/client'; | ||
import { api } from '@ds-project/api/rsc'; | ||
|
||
export async function getResource(resourceId: string) { | ||
if (!(await isAuthenticated())) { | ||
throw new Error('Not authenticated'); | ||
} | ||
|
||
return database.query.resourcesTable.findFirst({ | ||
where: (resource) => eq(resource.id, resourceId), | ||
}); | ||
return api.resources.byId({ id: resourceId }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 4 additions & 23 deletions
27
...d/src/app/(dashboard)/integrations/providers/figma/resources/_actions/resources.action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,9 @@ | ||
import { eq } from 'drizzle-orm'; | ||
import { isAuthenticated } from '@/lib/supabase/server/utils/is-authenticated'; | ||
import { getProjectId } from '@/lib/supabase/server/utils/get-project-id'; | ||
import { database } from '@ds-project/database/client'; | ||
import { api } from '@ds-project/api/rsc'; | ||
|
||
export async function getResources() { | ||
if (!(await isAuthenticated())) { | ||
throw new Error('Not authenticated'); | ||
} | ||
const project = await api.projects.current(); | ||
|
||
const projectId = await getProjectId(); | ||
if (!project?.id) throw new Error('No project associated with this account'); | ||
|
||
if (!projectId) throw new Error('No project associated with this account'); | ||
|
||
return database.query.resourcesTable.findMany({ | ||
with: { | ||
project: { | ||
with: { | ||
resources: true, | ||
accountsToProjects: { | ||
where: (accountsToProjects) => | ||
eq(accountsToProjects.projectId, projectId), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
return api.resources.byProjectId({ projectId: project.id }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
apps/dashboard/src/app/(dashboard)/integrations/providers/github/_actions/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from './installation.action'; | ||
export * from './request-tokens.action'; | ||
export * from './select-repository.action'; |
24 changes: 0 additions & 24 deletions
24
...shboard/src/app/(dashboard)/integrations/providers/github/_actions/installation.action.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.