-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into create-execution-an…
…d-its-data-in-atomic-transaction
- Loading branch information
Showing
43 changed files
with
1,381 additions
and
301 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
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
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
31 changes: 31 additions & 0 deletions
31
packages/cli/src/PublicApi/v1/handlers/credentials/spec/paths/credentials.id.transfer.yml
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,31 @@ | ||
put: | ||
x-eov-operation-id: transferCredential | ||
x-eov-operation-handler: v1/handlers/credentials/credentials.handler | ||
tags: | ||
- Workflow | ||
summary: Transfer a credential to another project. | ||
description: Transfer a credential to another project. | ||
parameters: | ||
- $ref: '../schemas/parameters/credentialId.yml' | ||
requestBody: | ||
description: Destination project for the credential transfer. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
destinationProjectId: | ||
type: string | ||
description: The ID of the project to transfer the credential to. | ||
required: | ||
- destinationProjectId | ||
required: true | ||
responses: | ||
'200': | ||
description: Operation successful. | ||
'400': | ||
$ref: '../../../../shared/spec/responses/badRequest.yml' | ||
'401': | ||
$ref: '../../../../shared/spec/responses/unauthorized.yml' | ||
'404': | ||
$ref: '../../../../shared/spec/responses/notFound.yml' |
6 changes: 6 additions & 0 deletions
6
packages/cli/src/PublicApi/v1/handlers/credentials/spec/schemas/parameters/credentialId.yml
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,6 @@ | ||
name: id | ||
in: path | ||
description: The ID of the credential. | ||
required: true | ||
schema: | ||
type: string |
65 changes: 65 additions & 0 deletions
65
packages/cli/src/PublicApi/v1/handlers/projects/projects.handler.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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { globalScope, isLicensed, validCursor } from '../../shared/middlewares/global.middleware'; | ||
import type { Response } from 'express'; | ||
import type { ProjectRequest } from '@/requests'; | ||
import type { PaginatedRequest } from '@/PublicApi/types'; | ||
import Container from 'typedi'; | ||
import { ProjectController } from '@/controllers/project.controller'; | ||
import { ProjectRepository } from '@/databases/repositories/project.repository'; | ||
import { encodeNextCursor } from '../../shared/services/pagination.service'; | ||
|
||
type Create = ProjectRequest.Create; | ||
type Update = ProjectRequest.Update; | ||
type Delete = ProjectRequest.Delete; | ||
type GetAll = PaginatedRequest; | ||
|
||
export = { | ||
createProject: [ | ||
isLicensed('feat:projectRole:admin'), | ||
globalScope('project:create'), | ||
async (req: Create, res: Response) => { | ||
const project = await Container.get(ProjectController).createProject(req); | ||
|
||
return res.status(201).json(project); | ||
}, | ||
], | ||
updateProject: [ | ||
isLicensed('feat:projectRole:admin'), | ||
globalScope('project:update'), | ||
async (req: Update, res: Response) => { | ||
await Container.get(ProjectController).updateProject(req); | ||
|
||
return res.status(204).send(); | ||
}, | ||
], | ||
deleteProject: [ | ||
isLicensed('feat:projectRole:admin'), | ||
globalScope('project:delete'), | ||
async (req: Delete, res: Response) => { | ||
await Container.get(ProjectController).deleteProject(req); | ||
|
||
return res.status(204).send(); | ||
}, | ||
], | ||
getProjects: [ | ||
isLicensed('feat:projectRole:admin'), | ||
globalScope('project:list'), | ||
validCursor, | ||
async (req: GetAll, res: Response) => { | ||
const { offset = 0, limit = 100 } = req.query; | ||
|
||
const [projects, count] = await Container.get(ProjectRepository).findAndCount({ | ||
skip: offset, | ||
take: limit, | ||
}); | ||
|
||
return res.json({ | ||
data: projects, | ||
nextCursor: encodeNextCursor({ | ||
offset, | ||
limit, | ||
numberOfTotalRecords: count, | ||
}), | ||
}); | ||
}, | ||
], | ||
}; |
Oops, something went wrong.