@celigo/api-specs 0.2.80 → 0.2.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/flow.yml CHANGED
@@ -4135,20 +4135,48 @@ components:
4135
4135
  extracts evaluate against that envelope:
4136
4136
 
4137
4137
  - **Lookup steps**: `{"statusCode": 200, "data": [<result records>],
4138
- "errors": []}` — `data` holds the records the lookup returned, so
4139
- extracts must start from it: `data[0].name` copies a field of the
4140
- first result, `data` copies the whole result array. A bare
4141
- result-record field name (e.g. `name`) resolves to nothing and merges
4142
- nothing.
4138
+ "errors": []}` — `data` holds the records the lookup step returns,
4139
+ AFTER the export's own `transform` and output `filter` have run, so
4140
+ extracts must start from it and name transformed fields by their
4141
+ transformed name: `data[0].name` copies a field of the first result,
4142
+ `data` copies the whole result array. A bare result-record field name
4143
+ (e.g. `name`) resolves to nothing and merges nothing, and so does the
4144
+ raw response path a transform consumed.
4143
4145
  - **Import steps**: `{"id": "<destination record id>", "statusCode": 200,
4144
- "ignored": false, "errors": [], "_json": <raw destination response>}` —
4145
- use `id` for the destination-assigned id and `_json.<path>` for fields
4146
- inside the destination's response body. The full envelope (including
4147
- `id`) is present on real runs and in flow-builder previews; flow TEST
4148
- runs never execute imports, and their mock-built envelope carries no
4149
- `id` — an `extract: "id"` merges nothing in a test run even though it
4150
- works on real runs.
4146
+ "ignored": false, "errors": [], "_json": <raw destination response>,
4147
+ ...<response body fields flattened at the root>}` — use `id` for the
4148
+ destination-assigned id and `_json.<path>` (or the flattened
4149
+ `<path>`) for fields inside the destination's response body. The full
4150
+ envelope (including `id`) is present on real runs and in flow-builder
4151
+ previews; flow TEST runs never execute imports, and their mock-built
4152
+ envelope carries no `id` — an `extract: "id"` merges nothing in a test
4153
+ run even though it works on real runs.
4154
+
4155
+ An `extract` may also be a Handlebars expression. It evaluates against
4156
+ the same envelope as a plain path, so every path inside `{{ }}` starts
4157
+ where the plain paths start — `{{data.0.name}}`,
4158
+ `{{#compare data.0.count "==" 1}}yes{{else}}no{{/compare}}`,
4159
+ `{{#if data.length}}found{{/if}}` on a lookup; `{{_json.order.id}}` or
4160
+ `{{id}}` on an import. Index arrays with dots inside Handlebars
4161
+ (`data.0.name` or `data.[0].name`; `data[0].name` renders nothing), and
4162
+ expect a string result (`"1"`, `"false"`). There is no `record` object in
4163
+ this context: `{{record.<anything>}}` renders nothing. Prefer a plain
4164
+ path when the value is simply copied.
4151
4165
  x-celigo-ai-guidance:
4166
+ - |-
4167
+ Handlebars is allowed in `extract` but only rooted at the envelope —
4168
+ `{{data.0.x}}` on a lookup, `{{_json.x}}` / `{{id}}` on an import. The
4169
+ `record.` root belongs to import-mapping templates; here every
4170
+ `{{record.…}}` form renders nothing, silently, and `{{data[0].x}}`
4171
+ (bracket index inside Handlebars) renders nothing too. Use Handlebars
4172
+ only for a derived value (a flag, a concatenation); copy values with a
4173
+ plain path.
4174
+ - |-
4175
+ A lookup's `data[]` is the step's output after its `transform` and
4176
+ `filter`, so author extracts against the transformed records — never
4177
+ against the raw response the transform consumed, and never against a
4178
+ saved `mockOutput` as stored (it is the raw response; the transform
4179
+ runs on top of it in a test run).
4152
4180
  - |-
4153
4181
  Send `fields` and `lists` as bare arrays, exactly as GET returns them.
4154
4182
  Never wrap either in an object (e.g. `"fields": {"type": [...]}`): the
@@ -4190,22 +4218,29 @@ components:
4190
4218
  properties:
4191
4219
  extract:
4192
4220
  type: string
4221
+ x-celigo-agent:
4222
+ - handlebars
4193
4223
  description: |
4194
4224
  Path within the canonical response envelope to copy the value
4195
- from. For lookup steps, paths start from the envelope's `data`
4196
- array (`data[0].x` and `data.0.x` are equivalent; `data` alone
4197
- copies every result); for import steps, use the envelope fields
4198
- `id`, `statusCode`, `ignored`, or `_json.<path>` for the raw
4199
- response body. Paths that skip the envelope (bare response
4200
- field names) resolve to nothing, and a `[*]` wildcard is not
4201
- honored here — `data[*].x` merges nothing; iterate arrays with
4202
- `lists` instead.
4225
+ from, or a Handlebars expression over that same envelope. For
4226
+ lookup steps, paths start from the envelope's `data` array
4227
+ (`data[0].x` and `data.0.x` are equivalent; `data` alone
4228
+ copies every result) — a lookup result field written without
4229
+ the `data` prefix resolves to nothing. For import steps, use
4230
+ the envelope fields `id`, `statusCode`, `ignored`, `_json.<path>`
4231
+ for the raw response body, or the body field itself at the
4232
+ envelope root (`orderNumber` and `_json.orderNumber` read the
4233
+ same value). A `[*]` wildcard is not honored here — `data[*].x`
4234
+ merges nothing; iterate arrays with `lists` instead. Inside
4235
+ Handlebars, index with dots (`{{data.0.x}}`, never
4236
+ `{{data[0].x}}`) and never use a `record.` root.
4203
4237
  examples:
4204
4238
  - data[0].customer.name
4205
4239
  - data.0.fields.Product Name
4206
4240
  - data
4207
4241
  - id
4208
4242
  - _json.orderNumber
4243
+ - '{{#if data.length}}found{{else}}missing{{/if}}'
4209
4244
  generate:
4210
4245
  type: string
4211
4246
  description: |