Repository navigation
feat(projects): add project identity and lifecycle foundation #8580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
00a83d0
feat(projects): add project identity and lifecycle foundation
mzxchandra aa9b415
feat(projects): create projects with their initial environment
mzxchandra 91cba23
docs(projects): record project files follow-up
mzxchandra 0980ad1
docs(projects): explain project and workspace creation flows
mzxchandra a14b448
fix(projects): stage activation after compatible writers deploy
mzxchandra c1c8e5d
refactor(projects): prepare compatible writers for the SQL backfill
mzxchandra 99189f2
fix(projects): clean up automatically created fixture Projects
mzxchandra 30bc9d8
chore(projects): merge staging into foundation
mzxchandra 552ce68
fix(workflows): guard restore against concurrent workspace archive
mzxchandra 0b7eed6
fix(projects): close lifecycle races and surface rollout conflicts
mzxchandra 634b19e
fix(workflows): return not found when import loses archive race
mzxchandra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,45 @@ | ||
| import { | ||
| archiveProjectContract, | ||
| getProjectContract, | ||
| renameProjectContract, | ||
| } from '@/lib/api/contracts/projects' | ||
| import { | ||
| defineInternalJsonRoute, | ||
| internalOrchestrationErrorPolicy, | ||
| internalRateLimits, | ||
| internalSessionAuth, | ||
| } from '@/lib/api/server/routes' | ||
| import { | ||
| archiveProject, | ||
| getProject, | ||
| projectOperations, | ||
| renameProject, | ||
| } from '@/lib/projects/application' | ||
|
|
||
| export const GET = defineInternalJsonRoute({ | ||
| contract: getProjectContract, | ||
| auth: internalSessionAuth, | ||
| operation: projectOperations.get, | ||
| rateLimit: internalRateLimits.user({ bucketName: 'projects.read' }), | ||
| errorPolicy: internalOrchestrationErrorPolicy, | ||
| mapInput: ({ params, query }) => ({ projectId: params.id, ...query }), | ||
| useCase: getProject, | ||
| }) | ||
| export const PATCH = defineInternalJsonRoute({ | ||
| contract: renameProjectContract, | ||
| auth: internalSessionAuth, | ||
| operation: projectOperations.rename, | ||
| rateLimit: internalRateLimits.user({ bucketName: 'projects.write' }), | ||
| errorPolicy: internalOrchestrationErrorPolicy, | ||
| mapInput: ({ params, body }) => ({ projectId: params.id, name: body.name }), | ||
| useCase: renameProject, | ||
| }) | ||
| export const DELETE = defineInternalJsonRoute({ | ||
| contract: archiveProjectContract, | ||
| auth: internalSessionAuth, | ||
| operation: projectOperations.archive, | ||
| rateLimit: internalRateLimits.user({ bucketName: 'projects.write' }), | ||
| errorPolicy: internalOrchestrationErrorPolicy, | ||
| mapInput: ({ params }) => ({ projectId: params.id }), | ||
| useCase: archiveProject, | ||
| }) |
18 changes: 18 additions & 0 deletions
18
apps/sim/app/api/projects/by-workspace/[workspaceId]/route.ts
This file contains hidden or 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,18 @@ | ||
| import { getWorkspaceProjectContract } from '@/lib/api/contracts/projects' | ||
| import { | ||
| defineInternalJsonRoute, | ||
| internalOrchestrationErrorPolicy, | ||
| internalRateLimits, | ||
| internalSessionAuth, | ||
| } from '@/lib/api/server/routes' | ||
| import { getWorkspaceProject, projectOperations } from '@/lib/projects/application' | ||
|
|
||
| export const GET = defineInternalJsonRoute({ | ||
| contract: getWorkspaceProjectContract, | ||
| auth: internalSessionAuth, | ||
| operation: projectOperations.get, | ||
| rateLimit: internalRateLimits.user({ bucketName: 'projects.read' }), | ||
| errorPolicy: internalOrchestrationErrorPolicy, | ||
| mapInput: ({ params }) => params, | ||
| useCase: getWorkspaceProject, | ||
| }) |
This file contains hidden or 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,28 @@ | ||
| import { createProjectContract, listProjectsContract } from '@/lib/api/contracts/projects' | ||
| import { | ||
| defineInternalJsonRoute, | ||
| internalOrchestrationErrorPolicy, | ||
| internalRateLimits, | ||
| internalSessionAuth, | ||
| } from '@/lib/api/server/routes' | ||
| import { createProject, listProjects, projectOperations } from '@/lib/projects/application' | ||
|
|
||
| export const GET = defineInternalJsonRoute({ | ||
| contract: listProjectsContract, | ||
| auth: internalSessionAuth, | ||
| operation: projectOperations.list, | ||
| rateLimit: internalRateLimits.user({ bucketName: 'projects.read' }), | ||
| errorPolicy: internalOrchestrationErrorPolicy, | ||
| mapInput: ({ query }) => query, | ||
| useCase: listProjects, | ||
| }) | ||
|
|
||
| export const POST = defineInternalJsonRoute({ | ||
| contract: createProjectContract, | ||
| auth: internalSessionAuth, | ||
| operation: projectOperations.create, | ||
| rateLimit: internalRateLimits.user({ bucketName: 'projects.write' }), | ||
| errorPolicy: internalOrchestrationErrorPolicy, | ||
| mapInput: ({ body }) => body, | ||
| useCase: createProject, | ||
| }) |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.