forked from cerc-io/snowballtools-base
feat(gql): deployment removal request
This commit is contained in:
parent
3cbea57294
commit
953c3fc10b
@ -232,7 +232,7 @@ export class Registry {
|
||||
}
|
||||
|
||||
async createApplicationDeploymentRemovalRequest (data: {
|
||||
deployment: Deployment
|
||||
deploymentId: string;
|
||||
}): Promise<{
|
||||
applicationDeploymentRemovalRequestId: string;
|
||||
applicationDeploymentRemovalRequestData: ApplicationDeploymentRemovalRequest;
|
||||
@ -240,7 +240,7 @@ export class Registry {
|
||||
const applicationDeploymentRemovalRequest = {
|
||||
type: APP_DEPLOYMENT_REMOVAL_REQUEST_TYPE,
|
||||
version: '1.0.0',
|
||||
deployment: data.deployment.id
|
||||
deployment: data.deploymentId
|
||||
};
|
||||
|
||||
const result = await this.registry.setRecord(
|
||||
|
@ -255,6 +255,20 @@ export const createResolvers = async (service: Service): Promise<any> => {
|
||||
}
|
||||
},
|
||||
|
||||
deleteDeployment: async (
|
||||
_: any,
|
||||
{
|
||||
deploymentId
|
||||
}: { deploymentId: string; }
|
||||
) => {
|
||||
try {
|
||||
return await service.deleteDeployment(deploymentId);
|
||||
} catch (err) {
|
||||
log(err);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
addDomain: async (
|
||||
_: any,
|
||||
{ projectId, data }: { projectId: string; data: { name: string } }
|
||||
|
@ -209,6 +209,7 @@ type Mutation {
|
||||
deleteProject(projectId: String!): Boolean!
|
||||
deleteDomain(domainId: String!): Boolean!
|
||||
rollbackDeployment(projectId: String!, deploymentId: String!): Boolean!
|
||||
deleteDeployment(deploymentId: String!): Boolean!
|
||||
addDomain(projectId: String!, data: AddDomainInput!): Boolean!
|
||||
updateDomain(domainId: String!, data: UpdateDomainInput!): Boolean!
|
||||
authenticateGitHub(code: String!): AuthResult!
|
||||
|
@ -694,6 +694,11 @@ export class Service {
|
||||
return newCurrentDeploymentUpdate && oldCurrentDeploymentUpdate;
|
||||
}
|
||||
|
||||
async deleteDeployment (deploymentId: string): Promise<boolean> {
|
||||
const result = await this.registry.createApplicationDeploymentRemovalRequest({ deploymentId });
|
||||
return (result !== undefined || result !== null);
|
||||
}
|
||||
|
||||
async addDomain (
|
||||
projectId: string,
|
||||
data: { name: string }
|
||||
|
Loading…
Reference in New Issue
Block a user