Skip to content

Commit

Permalink
Merge pull request #136 from hopinc/webhook-events
Browse files Browse the repository at this point in the history
Webhook events
  • Loading branch information
robjmorrissey authored Sep 26, 2023
2 parents a577d5c + 4e70edb commit 691563f
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-elephants-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@onehop/js': minor
---

Implement possible webhook events
1 change: 1 addition & 0 deletions src/util/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './constants.ts';
export * from './size.ts';
export * from './types.ts';
export * from './webhooks.ts';
178 changes: 178 additions & 0 deletions src/util/webhooks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
export const POSSIBLE_EVENTS: Record<
string,
{
id: string;
name: string;
}[]
> = {
Channels: [
{
id: 'channel.client.connected',
name: 'Client Connected',
},
{
id: 'channel.client.disconnected',
name: 'Client Disconnected',
},
{
id: 'channel.created',
name: 'Created',
},
{
id: 'channel.deleted',
name: 'Deleted',
},
{
id: 'channel.updated',
name: 'Updated',
},
],
Ignite: [
{
id: 'ignite.deployment.created',
name: 'Deployment Created',
},
{
id: 'ignite.deployment.updated',
name: 'Deployment Updated',
},
{
id: 'ignite.deployment.deleted',
name: 'Deployment Deleted',
},
{
id: 'ignite.deployment.build.started',
name: 'Build Started',
},
{
id: 'ignite.deployment.build.completed',
name: 'Build Completed',
},
{
id: 'ignite.deployment.build.created',
name: 'Build Created',
},
{
id: 'ignite.deployment.build.updated',
name: 'Build Updated',
},
{
id: 'ignite.deployment.build.failed',
name: 'Build Failed',
},
{
id: 'ignite.deployment.build.cancelled',
name: 'Build Cancelled',
},
{
id: 'ignite.deployment.deploy.validating',
name: 'Deploy Validating',
},
{
id: 'ignite.deployment.rollout.created',
name: 'Rollout Created',
},
{
id: 'ignite.deployment.rollout.updated',
name: 'Rollout Updated',
},
{
id: 'ignite.deployment.container.created',
name: 'Container Created',
},
{
id: 'ignite.deployment.container.updated',
name: 'Container Updated',
},
{
id: 'ignite.deployment.container.metrics_update',
name: 'Container Metrics Update',
},
{
id: 'ignite.deployment.container.deleted',
name: 'Container Deleted',
},
{
id: 'ignite.deployment.healthcheck.created',
name: 'Healthcheck Created',
},
{
id: 'ignite.deployment.healthcheck.updated',
name: 'Healthcheck Updated',
},
{
id: 'ignite.deployment.healthcheck.deleted',
name: 'Healthcheck Deleted',
},
{
id: 'ignite.deployment.healthcheck.events.failed',
name: 'Healthcheck Events Failed',
},
{
id: 'ignite.deployment.healthcheck.events.succeeded',
name: 'Healthcheck Events Succeeded',
},
{
id: 'ignite.deployment.gateway.created',
name: 'Gateway Created',
},
{
id: 'ignite.deployment.gateway.updated',
name: 'Gateway Updated',
},
{
id: 'ignite.deployment.gateway.deleted',
name: 'Gateway Deleted',
},
],
Project: [
{
id: 'project.member.created',
name: 'Member Created',
},
{
id: 'project.member.updated',
name: 'Member Updated',
},
{
id: 'project.member.deleted',
name: 'Member Deleted',
},
{
id: 'project.members.add',
name: 'Member Added',
},
{
id: 'project.members.remove',
name: 'Member Removed',
},
{
id: 'project.updated',
name: 'Updated',
},
{
id: 'project.tokens.create',
name: 'Token Created',
},
{
id: 'project.tokens.delete',
name: 'Token Deleted',
},
{
id: 'project.secrets.create',
name: 'Secret Created',
},
{
id: 'project.secrets.update',
name: 'Secret Updated',
},
{
id: 'project.secrets.delete',
name: 'Secret Deleted',
},
{
id: 'project.finance.transaction',
name: 'Finance Transaction',
},
],
};

0 comments on commit 691563f

Please sign in to comment.