|
| 1 | +--- |
| 2 | +'@objectstack/service-automation': minor |
| 3 | +--- |
| 4 | + |
| 5 | +feat(service-automation): the connector sync executor pulls a `mapping`'s `connectorSource` and writes it through the import runner (#20919) |
| 6 | + |
| 7 | +`AutomationServicePlugin.pullConnectorSource({ mapping, context })` (and the |
| 8 | +exported `pullConnectorSource(deps, opts)`) reads the mapping through the |
| 9 | +protocol's `getMetaItem`, resolves `connectorSource.connector` to a declared |
| 10 | +(`connectors[]`) `rest` or `openapi` instance, makes ONE call to its read action, |
| 11 | +takes the array at `recordsPath` (default `body`), projects it through the |
| 12 | +mapping's `fieldMapping` and writes it with `@objectstack/core`'s `runImport` — |
| 13 | +the import door's coercion, `mode` / `upsertKey` matching and per-row verdicts, |
| 14 | +with the door's defaults for every knob `connectorSource` does not declare. |
| 15 | + |
| 16 | +- **Watermark, read from the target.** For `connectorSource.watermark`, the |
| 17 | + starting point sent as `query[watermark.param]` is the highest value already |
| 18 | + stored in the target field a `fieldMapping` entry copies `watermark.field` onto |
| 19 | + (transform `none`). Nothing else stores it. |
| 20 | +- **One response per pull.** The connector's paging is not followed. |
| 21 | +- **Loud refusals,** each a `ConnectorPullError` (`code`, `status`, `reason`) |
| 22 | + raised before anything is written: a plugin-registered or unregistered |
| 23 | + connector, a degraded instance, a provider other than `rest` / `openapi`, an |
| 24 | + undeclared action, `update` / `upsert` with an empty `upsertKey`, a |
| 25 | + `javascript` transform, an unmapped `watermark.field`, an `ok: false` answer, |
| 26 | + a non-array at `recordsPath` and a non-object record. |
| 27 | +- **Nothing schedules a pull** — a `job` will drive it; the caller supplies the |
| 28 | + execution context. |
| 29 | + |
| 30 | +The plugin now records the provider of each declared connector instance it |
| 31 | +materializes, which the executor reads. |
0 commit comments