diff --git a/.changeset/soft-elephants-push.md b/.changeset/soft-elephants-push.md new file mode 100644 index 00000000..1c175200 --- /dev/null +++ b/.changeset/soft-elephants-push.md @@ -0,0 +1,5 @@ +--- +'@onehop/js': minor +--- + +Implement possible webhook events diff --git a/src/util/index.ts b/src/util/index.ts index 7988ae1e..521a9563 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -1,3 +1,4 @@ export * from './constants.ts'; export * from './size.ts'; export * from './types.ts'; +export * from './webhooks.ts'; diff --git a/src/util/webhooks.ts b/src/util/webhooks.ts new file mode 100644 index 00000000..f8592fcc --- /dev/null +++ b/src/util/webhooks.ts @@ -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', + }, + ], +};