resources namespace connects these two parts without handwritten addresses.
Declare resources
bijection/sources.ts
fields when source names differ.
bijection/schema.ts
bijection/access.ts
defineTable(resource) infers the record type. There is no second validator to
keep synchronized. Pub/Sub rows are message occurrences with messageId,
publishedAt, attributes and typed data. Pods expose typed metadata, spec
and status fields.
Bind a deployment
Provision each private credential withbijection connection credential create <name> --from-file <file>. The credential’s provider-specific envelope contains
authentication material; put non-secret installation values in setup.
Place this file next to bijection.json:
bijection.bindings.ts
bijection dev and deployment push load this file after code generation
and apply it after the code and schema are deployed. Imported configuration files
participate in the dev watch. Dry runs validate the file without applying it.
The bindings program runs in the CLI and is never uploaded as application code.
The deployed resource contract validates setup and credential references. Binding
verifies provider identity, installs the existing source owner and schedules
acquisition. Reapplying unchanged configuration preserves its generation. Removing
a binding entry retains imported data and private credentials.
Query and observe
bijection/inventory.ts
useQuery(api.inventory.list) receives typed
rows through the normal client. Resource status uses the installed source’s
existing authority and query dependencies. It reports serving evidence separately
from acquisition work. An acquisition interval does not promise population
coverage or freshness. A missing or ambiguous installation produces a diagnostic;
use an explicit sourceId to select among authorized installations.
Share a connection
The simple binding above supplies everything at once. An operator program can share connection-owned fields and credential custody across several resources:Preserve atomic acquisition groups
Some providers acquire several tables together. Declare one group and bind it once:bijection/sources.ts
defineTable(sales.tables.orders) and defineTable(sales.tables.lines) in the
schema. PostgreSQL keeps its consistent initial snapshot and atomic transaction
publication. Mail accounts similarly expose tables.messages, tables.contents
and tables.memberships under one acquisition owner. A group status read selects
a typed collection name:
Commands use durable calls
Generated resource references expose only declared commands, with inferred arguments, underresources.<module>.<export>.commands. Submit them from mutations
through ctx.calls.add. A command changing a record requires its local target.
A collection create can infer its target when exactly one resource source is
installed. A child create still requires its parent record.
For example, a Calendar resource’s update capability uses the ordinary mutation
and generated-reference conventions:
Provider recipes
All constructors are exported by@bijectionhq/component-support/connectors.
They compose the existing native protocols and their evidence rules.
Broker routing names remain logical declarations where the native protocol owns
routing. Endpoints, subscriptions and credentials remain deployment configuration.
Operational messages validate JSON and the declared schema before acknowledging
receipts. Raw archives, event histories, conditional writes and custom HTTP
protocols remain explicit capabilities of the lower-level authoring primitives.
Connector authors use
defineResource or defineResourceGroup from
bijection/connectors over an ordinary integration. These primitives emit the
resource metadata that code generation, shared connections, bindings and the
native admission owner all consume.