backbone-integrations 0.6.1

Integration registry: connectors, integration accounts and an idempotent inbound event lane, with one OAuth flow (HMAC-bound state, PKCE)
Documentation
# =============================================================================
# integrations Module - Schema Index
# =============================================================================
# Version: 2.0
# Description: Module schema index. `module:` and `schema:` are stamped from the
# module name by `metaphor module create`. `schema:` gives this module its OWN
# Postgres schema (migrations emit `CREATE SCHEMA integrations` and qualify tables
# as `integrations.<table>`) — the convention every backbone module follows
# (see backbone-sapiens, backbone-bucket). Do not remove it.
# =============================================================================

module: integrations
version: 2
schema: integrations

# Tenancy: none, by design (ADR-0029). The module is tenant-agnostic and reusable —
# it ships no scoping column and no fence declaration. A composing backend-service
# that wants these tables org-scoped declares them in its tenancy.yaml; the
# decorator installs org_unit_id, the RLS policy, and the org-scoped per-unit
# uniques (the connector provider unique, the OAuth account
# provider+account_ref unique) at composition time. The module's own outbox
# events table keeps its tenant fence with the relay exemption
# (migrations/20260726100000_fence_outbox_company_id.up.sql) — it is relay
# infrastructure, not module tenancy.
description: "integrations domain module"

config:
  database: postgresql
  soft_delete: true
  audit: true
  default_timestamps: true
  generators:
    disabled:
      - graphql
      - grpc
      - proto
    # Don't re-export domain entities at the crate root (rec #4) — this module's outward contract is
    # the exports::types DTOs + ports, not internal entity representations. Durable across regen.
    reexport_entities: false

# Reuse sapiens for user identity (actors) — logical refs, no DB constraint.
external_imports:
  - module: sapiens
    types: [User]

# Shared value-object types available to all models in this module.
shared_types:
  Timestamps:
    created_at:
      type: datetime
      attributes: ["@default(now)"]
      description: "Record creation timestamp"
    updated_at:
      type: datetime
      attributes: ["@updated_at"]
      description: "Last update timestamp"
    deleted_at:
      type: datetime?
      description: "Soft delete timestamp"

  Actors:
    created_by:
      type: uuid?
      attributes: ["@foreign_key(sapiens.User.id)"]
      description: "User who created this record"
    updated_by:
      type: uuid?
      attributes: ["@foreign_key(sapiens.User.id)"]
      description: "User who last updated this record"
    deleted_by:
      type: uuid?
      attributes: ["@foreign_key(sapiens.User.id)"]
      description: "User who deleted this record"

  Metadata: [Timestamps, Actors]

# Import each entity model. Replace `example` with your real entities.
imports:
  - connector.model.yaml
  - integration_event.model.yaml
  # OAuth account connections — entity/DTOs/repository/service generate, but the
  # model disables its handler target: the surface is the verb-shaped OAuth
  # routes (authorize/complete/disconnect/status), never generic CRUD.
  - integration_account.model.yaml