Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .changeset/trigger-registry-connector-cluster-removed.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
---
'@objectstack/spec': major
---

The `trigger-registry.zod.ts` Connector cluster is removed (#4499)

`@objectstack/spec/automation` no longer exports the third declaration of the
connector vocabulary: `ConnectorSchema`, `ConnectorInstanceSchema`,
`ConnectorOperationSchema`, `ConnectorTriggerSchema`, `ConnectorCategorySchema`,
`AuthenticationSchema` / `AuthenticationTypeSchema` / `AuthFieldSchema` /
`OAuth2ConfigSchema`, `OperationTypeSchema` / `OperationParameterSchema`, their
inferred types, and the `Connector.apiKey()` / `Connector.oauth2()` factory
helpers — 630 lines, all of `automation/trigger-registry.zod.ts`.

Despite the filename, the file contained no trigger registry. Every export was
connector vocabulary, self-contained and read by nothing:

- the automation engine registers and validates connectors against
`ConnectorSchema` from `integration/connector.zod.ts` (ADR-0097) — it never
imported this one;
- the stack `connectors:` collection parses `DeclarativeConnectorEntrySchema`;
- outside the spec package, the only references anywhere in the monorepo were
the two documentation generators that published it.

This closes the connector triple-declaration: `integration/connector.zod.ts`
is the one live contract (ADR-0097), the six per-provider "templates" fell in
#4480, and this cluster is the last copy (Prime Directive #12 — one
capability, one contract).

**Migration.** If you imported any of these names from
`@objectstack/spec/automation`, there is nothing to migrate *to* on that
module: nothing ever consumed what you built against them. Declare real
connector instances with `defineConnector` / the stack `connectors:` collection
(`DeclarativeConnectorEntrySchema`), or materialize them from a provider
document via connector-openapi / connector-mcp. Note the name collision when
migrating types: the live `integration/connector.zod.ts` also exports a
`ConnectorTriggerSchema` and a `Connector` type with *different shapes* — a
find-and-replace of the import path is not a migration.

The removal also deletes the "When to use Integration Connector vs. Trigger
Registry?" comparison from `integration/connector.zod.ts`'s header, which
steered "lightweight" cases to the dead file with the platform's authority —
the same defect class as the `capabilities.readOnly` prescription #4487
corrected. No D2 conversion: none of this was storable stack metadata, so
there is no source for `os migrate meta` to rewrite.
1 change: 0 additions & 1 deletion content/docs/getting-started/quick-reference.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -157,7 +157,6 @@ Flows, state machines, approvals, and integrations.
| **[State Machine](/docs/references/automation/state-machine)** | `state-machine.zod.ts` | StateMachine | State machine definitions |
| **[Webhook](/docs/references/automation/webhook)** | `webhook.zod.ts` | Webhook | Outbound webhooks |
| **[ETL](/docs/references/automation/etl)** | `etl.zod.ts` | ETLPipeline | Data transformation pipelines |
| **[Trigger Registry](/docs/references/automation/trigger-registry)** | `trigger-registry.zod.ts` | TriggerRegistry | Event-driven triggers |
| **[Sync](/docs/references/automation/sync)** | `sync.zod.ts` | DataSyncConfig, SyncMode | Bi-directional data sync |

## Security Protocol (3 schemas)
Expand Down
51 changes: 3 additions & 48 deletions content/docs/references/automation/connector.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,58 +8,13 @@ description: Connector protocol schemas
## TypeScript Usage

```typescript
import { Connector, ConnectorTrigger, DataSyncConfig } from '@objectstack/spec/automation';
import type { Connector, ConnectorTrigger, DataSyncConfig } from '@objectstack/spec/automation';
import { DataSyncConfig } from '@objectstack/spec/automation';
import type { DataSyncConfig } from '@objectstack/spec/automation';

// Validate data
const result = Connector.parse(data);
const result = DataSyncConfig.parse(data);
```

---

## Connector

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Connector ID (snake_case) |
| **name** | `string` | ✅ | Connector name |
| **description** | `string` | optional | Connector description |
| **version** | `string` | optional | Connector version |
| **icon** | `string` | optional | Connector icon |
| **category** | `Enum<'crm' \| 'payment' \| 'communication' \| 'storage' \| 'analytics' \| 'database' \| 'marketing' \| 'accounting' \| 'hr' \| 'productivity' \| 'ecommerce' \| 'support' \| 'devtools' \| 'social' \| 'other'>` | ✅ | Connector category |
| **baseUrl** | `string` | optional | API base URL |
| **authentication** | `{ type: Enum<'none' \| 'apiKey' \| 'basic' \| 'bearer' \| 'oauth1' \| 'oauth2' \| 'custom'>; fields?: { name: string; label: string; type: Enum<'text' \| 'password' \| 'url' \| 'select'>; description?: string; … }[]; oauth2?: object; test?: object }` | ✅ | Authentication config |
| **operations** | `{ id: string; name: string; description?: string; type: Enum<'read' \| 'write' \| 'delete' \| 'search' \| 'trigger' \| 'action'>; … }[]` | optional | Connector operations |
| **triggers** | `{ id: string; name: string; description?: string; type: Enum<'webhook' \| 'polling' \| 'stream'>; … }[]` | optional | Connector triggers |
| **rateLimit** | `{ requestsPerSecond?: number; requestsPerMinute?: number; requestsPerHour?: number }` | optional | Rate limiting |
| **author** | `string` | optional | Connector author |
| **documentation** | `string` | optional | Documentation URL |
| **homepage** | `string` | optional | Homepage URL |
| **license** | `string` | optional | License (SPDX identifier) |
| **tags** | `string[]` | optional | Connector tags |
| **verified** | `boolean` | ✅ | Verified connector |
| **metadata** | `Record<string, any>` | optional | Custom metadata |


---

## ConnectorTrigger

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Trigger ID (snake_case) |
| **name** | `string` | ✅ | Trigger name |
| **description** | `string` | optional | Trigger description |
| **type** | `Enum<'webhook' \| 'polling' \| 'stream'>` | ✅ | Trigger mechanism |
| **config** | `Record<string, any>` | optional | Trigger configuration |
| **outputSchema** | `Record<string, any>` | optional | Event payload schema |
| **pollingIntervalMs** | `integer` | optional | Polling interval in ms |


---

## DataSyncConfig
Expand Down
1 change: 0 additions & 1 deletion content/docs/references/automation/index.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,5 @@ This section contains all protocol schemas for the automation layer of ObjectSta
<Card href="/docs/references/automation/state-machine" title="State Machine" description="Source: packages/spec/src/automation/state-machine.zod.ts" />
<Card href="/docs/references/automation/sync" title="Sync" description="Source: packages/spec/src/automation/sync.zod.ts" />
<Card href="/docs/references/automation/time-relative-trigger" title="Time Relative Trigger" description="Source: packages/spec/src/automation/time-relative-trigger.zod.ts" />
<Card href="/docs/references/automation/trigger-registry" title="Trigger Registry" description="Source: packages/spec/src/automation/trigger-registry.zod.ts" />
<Card href="/docs/references/automation/webhook" title="Webhook" description="Source: packages/spec/src/automation/webhook.zod.ts" />
</Cards>
1 change: 0 additions & 1 deletion content/docs/references/automation/meta.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,6 @@
"node-executor",
"state-machine",
"time-relative-trigger",
"trigger-registry",
"---Integration & Data---",
"bpmn-interop",
"connector",
Expand Down
Loading
Loading