invariant.ts 965 B

12345678910111213141516171819202122232425
  1. /** Package-owned invariant companion for the GitHub webhook adapter. */
  2. import type { Context } from '@deepseek-ai/cordis'
  3. import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants'
  4. const PACKAGE_NAME = '@deepseek-ai/dsh-webhook-github'
  5. /** Cordis invariant-companion plugin name. */
  6. export const name = 'webhook-github-invariant'
  7. /** Registry required before reserving this package's invariant ownership. */
  8. export const inject = ['invariants']
  9. /**
  10. * No runtime invariant: authentication and input validation occur at the exact
  11. * HTTP operation; dsh-host-webserver owns route/disposer symmetry.
  12. */
  13. const install: InvariantInstaller = () => {}
  14. /**
  15. * Register this package's explained empty invariant.
  16. * @param ctx - Cordis context carrying the invariant registry.
  17. * @returns the invariant registration disposer.
  18. */
  19. export const apply = (ctx: Context): Promise<() => void> =>
  20. Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install))