@celigo/api-specs 0.2.138 → 0.2.139
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/ai-agent.yml +141 -53
- package/dist/asynchelper.yml +92 -27
- package/dist/connection.yml +2 -2
- package/dist/export.yml +141 -53
- package/dist/flow.yml +1 -1
- package/dist/httpconnector.yml +49 -26
- package/dist/httpconnectorresource.yml +49 -26
- package/dist/import.yml +141 -53
- package/dist/processor.yml +248 -1
- package/dist/tool.yml +141 -53
- package/dist/tradingpartnerconnector.yml +49 -26
- package/package.json +1 -1
- package/schemas.json +6 -1
package/dist/import.yml
CHANGED
|
@@ -12130,7 +12130,7 @@ components:
|
|
|
12130
12130
|
|
|
12131
12131
|
**Common filter patterns**
|
|
12132
12132
|
|
|
12133
|
-
1. **Pattern matching**:
|
|
12133
|
+
1. **Pattern matching**: Regular expressions with `matches`
|
|
12134
12134
|
2. **Value range filtering**: Numbers between min and max values
|
|
12135
12135
|
3. **Date range filtering**: Items created/modified within specific time ranges
|
|
12136
12136
|
4. **Status checking**: Items with specific status values or properties
|
|
@@ -12180,9 +12180,12 @@ components:
|
|
|
12180
12180
|
- `"endswith"`: String ends with specified suffix (ends with)
|
|
12181
12181
|
- `"contains"`: String contains specified substring (contains)
|
|
12182
12182
|
- `"doesnotcontain"`: String does not contain specified substring (does not contain)
|
|
12183
|
-
- `"
|
|
12184
|
-
- `"
|
|
12185
|
-
- `"matches"`: Matches
|
|
12183
|
+
- `"empty"`: Field is missing or empty (is empty)
|
|
12184
|
+
- `"notempty"`: Field contains a value (is not empty)
|
|
12185
|
+
- `"matches"`: Matches a regular expression (matches)
|
|
12186
|
+
|
|
12187
|
+
`isempty`, `isnotempty` and `anyof` are not operators: they are refused with 422
|
|
12188
|
+
"Invalid operation: <name>".
|
|
12186
12189
|
|
|
12187
12190
|
**Logical Operators**
|
|
12188
12191
|
- `"and"`: All conditions must be true
|
|
@@ -12202,7 +12205,11 @@ components:
|
|
|
12202
12205
|
**Using `extract` to access record fields:**
|
|
12203
12206
|
- Retrieves values from the current record being processed
|
|
12204
12207
|
- Can access nested properties using dot notation (e.g., `"customer.email"`)
|
|
12205
|
-
-
|
|
12208
|
+
- In a record filter, must be wrapped in a type conversion (`string`, `number`,
|
|
12209
|
+
`boolean` or `epochtime`): a bare `["extract", ...]` operand is refused with 422
|
|
12210
|
+
"Field operation extract must be called by a Type Conversion Operation but was called
|
|
12211
|
+
by <operator>", both when an import's filter is saved and by
|
|
12212
|
+
`POST /v1/processors/filter`
|
|
12206
12213
|
|
|
12207
12214
|
**Using `settings` to access configuration values:**
|
|
12208
12215
|
- Retrieves values from the integration's configuration settings
|
|
@@ -12220,7 +12227,20 @@ components:
|
|
|
12220
12227
|
- `"floor"`: Round number down to the nearest integer
|
|
12221
12228
|
- `"abs"`: Get absolute value of a number
|
|
12222
12229
|
|
|
12223
|
-
|
|
12230
|
+
**Handlebars operands**
|
|
12231
|
+
- An operand can also be a string holding exactly one Handlebars expression, such as
|
|
12232
|
+
`"{{record.status}}"` or `"{{lowercase record.code}}"`, on either side of the
|
|
12233
|
+
operator. It renders against the record (`record.<field>`; an unprefixed
|
|
12234
|
+
`{{status}}` renders empty) before the comparison.
|
|
12235
|
+
- The rendered value is a string: wrap it in `["number", ...]` to compare it with a
|
|
12236
|
+
number, or the rule is refused with 422.
|
|
12237
|
+
- `epochtime` does not render Handlebars: `["epochtime", "{{timestamp}}"]` is refused
|
|
12238
|
+
with 422 "invalid datetime format".
|
|
12239
|
+
- A string with text around the expression, or with more than one expression, is
|
|
12240
|
+
compared as a literal.
|
|
12241
|
+
|
|
12242
|
+
Choose the type conversion that matches the comparison — `number` for numeric
|
|
12243
|
+
comparisons, `epochtime` for dates, `string` for text. For example:
|
|
12224
12244
|
|
|
12225
12245
|
```json
|
|
12226
12246
|
[
|
|
@@ -12311,8 +12331,11 @@ components:
|
|
|
12311
12331
|
[
|
|
12312
12332
|
"notequals",
|
|
12313
12333
|
[
|
|
12314
|
-
"
|
|
12315
|
-
|
|
12334
|
+
"string",
|
|
12335
|
+
[
|
|
12336
|
+
"extract",
|
|
12337
|
+
"status"
|
|
12338
|
+
]
|
|
12316
12339
|
],
|
|
12317
12340
|
"cancelled"
|
|
12318
12341
|
]
|
|
@@ -12323,8 +12346,11 @@ components:
|
|
|
12323
12346
|
[
|
|
12324
12347
|
"startswith",
|
|
12325
12348
|
[
|
|
12326
|
-
"
|
|
12327
|
-
|
|
12349
|
+
"string",
|
|
12350
|
+
[
|
|
12351
|
+
"extract",
|
|
12352
|
+
"filename"
|
|
12353
|
+
]
|
|
12328
12354
|
],
|
|
12329
12355
|
"HC"
|
|
12330
12356
|
]
|
|
@@ -12345,29 +12371,26 @@ components:
|
|
|
12345
12371
|
]
|
|
12346
12372
|
```
|
|
12347
12373
|
|
|
12348
|
-
Example 4: Order date is after January 1, 2023
|
|
12374
|
+
Example 4: Order date is after January 1, 2023 (UTC). Compare dates as `epochtime`
|
|
12375
|
+
against epoch milliseconds: a `string` comparison of ISO timestamps orders values with
|
|
12376
|
+
different UTC offsets wrongly.
|
|
12349
12377
|
```json
|
|
12350
12378
|
[
|
|
12351
12379
|
"greaterthan",
|
|
12352
12380
|
[
|
|
12353
|
-
"
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
```
|
|
12359
|
-
|
|
12360
|
-
Example 5: Category contains any of ["Urgent", "High Priority"]
|
|
12361
|
-
```json
|
|
12362
|
-
[
|
|
12363
|
-
"anyof",
|
|
12364
|
-
[
|
|
12365
|
-
"extract",
|
|
12366
|
-
"category"
|
|
12381
|
+
"epochtime",
|
|
12382
|
+
[
|
|
12383
|
+
"extract",
|
|
12384
|
+
"orderDate"
|
|
12385
|
+
]
|
|
12367
12386
|
],
|
|
12368
|
-
|
|
12387
|
+
1672531200000
|
|
12369
12388
|
]
|
|
12370
12389
|
```
|
|
12390
|
+
x-celigo-ai-guidance:
|
|
12391
|
+
- |-
|
|
12392
|
+
To test whether a field has a value, use `notempty` on the wrapped extract, not a
|
|
12393
|
+
`matches` pattern: a record without the field matches `.*\S.*`.
|
|
12371
12394
|
items:
|
|
12372
12395
|
oneOf:
|
|
12373
12396
|
- title: String
|
|
@@ -12558,14 +12581,15 @@ components:
|
|
|
12558
12581
|
- `objectarray`: Array of objects (most common array type)
|
|
12559
12582
|
- `arrayarray`: Array of arrays (for matrix/table structures)
|
|
12560
12583
|
|
|
12561
|
-
Array dataTypes can be populated
|
|
12562
|
-
unchanged via `extract` alone (when the source is
|
|
12563
|
-
the right shape),
|
|
12584
|
+
Array dataTypes can be populated three ways: pass a source array
|
|
12585
|
+
through unchanged via a JSONPath `extract` alone (when the source is
|
|
12586
|
+
already an array of the right shape), construct/iterate via
|
|
12587
|
+
`buildArrayHelper`, or set a constant with `hardCodedValue`.
|
|
12564
12588
|
|
|
12565
12589
|
IMPORTANT: The dataType controls which additional fields are relevant:
|
|
12566
12590
|
- For date-like string fields: extractDateFormat, generateDateFormat, etc. become relevant
|
|
12567
12591
|
- For object types: 'mappings' array becomes relevant
|
|
12568
|
-
- For array types: `
|
|
12592
|
+
- For array types: a JSONPath `extract` alone, `buildArrayHelper`, or `hardCodedValue` (see above)
|
|
12569
12593
|
|
|
12570
12594
|
When analyzing existing mappings or generating new ones, always check dataType first
|
|
12571
12595
|
to understand what additional fields should be present.
|
|
@@ -12628,9 +12652,12 @@ components:
|
|
|
12628
12652
|
- Access input record fields with {{record.fieldName}} notation; a grouped
|
|
12629
12653
|
(array) record binds as `rows` instead — {{rows.0.fieldName}} / {{#each rows}}
|
|
12630
12654
|
- Examples: "{{record.firstName}} {{record.lastName}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
|
|
12631
|
-
- Valid on `object
|
|
12632
|
-
|
|
12633
|
-
|
|
12655
|
+
- Valid on scalars and on `object` rows, where the rendered output must
|
|
12656
|
+
parse into an object. On an array row the template goes in a
|
|
12657
|
+
`buildArrayHelper` entry instead: on an `objectarray` row's own
|
|
12658
|
+
`extract` it is refused with 422 ("buildArrayHelper" must be present
|
|
12659
|
+
for object array datatype), and on a primitive-array row's own
|
|
12660
|
+
`extract` it renders null without an error
|
|
12634
12661
|
|
|
12635
12662
|
```json
|
|
12636
12663
|
"extract": "{{record.price}} {{record.currency}}" // Combines two fields
|
|
@@ -12829,6 +12856,19 @@ components:
|
|
|
12829
12856
|
- countryCodeToName
|
|
12830
12857
|
- statusMapping
|
|
12831
12858
|
- departmentCodes
|
|
12859
|
+
hardCodedValue:
|
|
12860
|
+
type: string
|
|
12861
|
+
description: |
|
|
12862
|
+
Constant written to the destination instead of an extracted value. On a primitive
|
|
12863
|
+
array (`stringarray`, `numberarray`, `booleanarray`) the string is split on commas,
|
|
12864
|
+
verbatim and untrimmed, into elements of the array's type (`"A,B"` gives `["A", "B"]`).
|
|
12865
|
+
On an `object` it must be a JSON object string and on an `objectarray` a JSON array
|
|
12866
|
+
string (an object string becomes one element); the save parses it and refuses non-JSON
|
|
12867
|
+
or the wrong shape with 422, and an array row with a constant needs no `buildArrayHelper`.
|
|
12868
|
+
examples:
|
|
12869
|
+
- USD
|
|
12870
|
+
- A,B
|
|
12871
|
+
- '[{"code": "A"}, {"code": "B"}]'
|
|
12832
12872
|
description:
|
|
12833
12873
|
type: string
|
|
12834
12874
|
description: |
|
|
@@ -12964,15 +13004,25 @@ components:
|
|
|
12964
13004
|
processor renders the entire destination array as null with no
|
|
12965
13005
|
validation error. To emit a fixed number of static elements, add
|
|
12966
13006
|
that many sibling constructed entries — never index the extract.
|
|
13007
|
+
- |-
|
|
13008
|
+
An entry's `extract` can be a Handlebars template. On an
|
|
13009
|
+
`objectarray` it must render a JSON object (one element) or a JSON
|
|
13010
|
+
array (one element per item). On a primitive array each entry
|
|
13011
|
+
renders one element, so a serialized array becomes one string
|
|
13012
|
+
element. A bare literal entry extract is refused with 422 ("extract
|
|
13013
|
+
only supports json path or handlebars expression"); set a constant
|
|
13014
|
+
with the row's `hardCodedValue` instead.
|
|
12967
13015
|
description: |
|
|
12968
13016
|
**Purpose**
|
|
12969
13017
|
Configures how to construct arrays in the output record, handling various array types and inputs.
|
|
12970
13018
|
|
|
12971
13019
|
**Guidance**
|
|
12972
|
-
This is the
|
|
13020
|
+
This is the mechanism for building array data types:
|
|
12973
13021
|
|
|
12974
13022
|
**When to Use**
|
|
12975
|
-
- REQUIRED when dataType ends with "array" (stringarray, objectarray, etc.)
|
|
13023
|
+
- REQUIRED when dataType ends with "array" (stringarray, objectarray, etc.), unless the
|
|
13024
|
+
row passes a source array through with a JSONPath `extract` alone or sets
|
|
13025
|
+
`hardCodedValue`
|
|
12976
13026
|
- Each entry in this array contributes elements to the output array
|
|
12977
13027
|
- Multiple entries allow combining data from different input arrays
|
|
12978
13028
|
|
|
@@ -13597,14 +13647,15 @@ components:
|
|
|
13597
13647
|
- `objectarray`: Array of objects (most common array type)
|
|
13598
13648
|
- `arrayarray`: Array of arrays (for matrix/table structures)
|
|
13599
13649
|
|
|
13600
|
-
Array dataTypes can be populated
|
|
13601
|
-
unchanged via `extract` alone (when the source is
|
|
13602
|
-
the right shape),
|
|
13650
|
+
Array dataTypes can be populated three ways: pass a source array
|
|
13651
|
+
through unchanged via a JSONPath `extract` alone (when the source is
|
|
13652
|
+
already an array of the right shape), construct/iterate via
|
|
13653
|
+
`buildArrayHelper`, or set a constant with `hardCodedValue`.
|
|
13603
13654
|
|
|
13604
13655
|
IMPORTANT: The dataType controls which additional fields are relevant:
|
|
13605
13656
|
- For date-like string fields: extractDateFormat, generateDateFormat, etc. become relevant
|
|
13606
13657
|
- For object types: 'mappings' array becomes relevant
|
|
13607
|
-
- For array types: `
|
|
13658
|
+
- For array types: a JSONPath `extract` alone, `buildArrayHelper`, or `hardCodedValue` (see above)
|
|
13608
13659
|
|
|
13609
13660
|
When analyzing existing mappings or generating new ones, always check dataType first
|
|
13610
13661
|
to understand what additional fields should be present.
|
|
@@ -13667,9 +13718,12 @@ components:
|
|
|
13667
13718
|
- Access input record fields with {{record.fieldName}} notation; a grouped
|
|
13668
13719
|
(array) record binds as `rows` instead — {{rows.0.fieldName}} / {{#each rows}}
|
|
13669
13720
|
- Examples: "{{record.firstName}} {{record.lastName}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
|
|
13670
|
-
- Valid on `object
|
|
13671
|
-
|
|
13672
|
-
|
|
13721
|
+
- Valid on scalars and on `object` rows, where the rendered output must
|
|
13722
|
+
parse into an object. On an array row the template goes in a
|
|
13723
|
+
`buildArrayHelper` entry instead: on an `objectarray` row's own
|
|
13724
|
+
`extract` it is refused with 422 ("buildArrayHelper" must be present
|
|
13725
|
+
for object array datatype), and on a primitive-array row's own
|
|
13726
|
+
`extract` it renders null without an error
|
|
13673
13727
|
|
|
13674
13728
|
```json
|
|
13675
13729
|
"extract": "{{record.price}} {{record.currency}}" // Combines two fields
|
|
@@ -13868,6 +13922,19 @@ components:
|
|
|
13868
13922
|
- countryCodeToName
|
|
13869
13923
|
- statusMapping
|
|
13870
13924
|
- departmentCodes
|
|
13925
|
+
hardCodedValue:
|
|
13926
|
+
type: string
|
|
13927
|
+
description: |
|
|
13928
|
+
Constant written to the destination instead of an extracted value. On a primitive
|
|
13929
|
+
array (`stringarray`, `numberarray`, `booleanarray`) the string is split on commas,
|
|
13930
|
+
verbatim and untrimmed, into elements of the array's type (`"A,B"` gives `["A", "B"]`).
|
|
13931
|
+
On an `object` it must be a JSON object string and on an `objectarray` a JSON array
|
|
13932
|
+
string (an object string becomes one element); the save parses it and refuses non-JSON
|
|
13933
|
+
or the wrong shape with 422, and an array row with a constant needs no `buildArrayHelper`.
|
|
13934
|
+
examples:
|
|
13935
|
+
- USD
|
|
13936
|
+
- A,B
|
|
13937
|
+
- '[{"code": "A"}, {"code": "B"}]'
|
|
13871
13938
|
description:
|
|
13872
13939
|
type: string
|
|
13873
13940
|
description: |
|
|
@@ -14003,15 +14070,25 @@ components:
|
|
|
14003
14070
|
processor renders the entire destination array as null with no
|
|
14004
14071
|
validation error. To emit a fixed number of static elements, add
|
|
14005
14072
|
that many sibling constructed entries — never index the extract.
|
|
14073
|
+
- |-
|
|
14074
|
+
An entry's `extract` can be a Handlebars template. On an
|
|
14075
|
+
`objectarray` it must render a JSON object (one element) or a JSON
|
|
14076
|
+
array (one element per item). On a primitive array each entry
|
|
14077
|
+
renders one element, so a serialized array becomes one string
|
|
14078
|
+
element. A bare literal entry extract is refused with 422 ("extract
|
|
14079
|
+
only supports json path or handlebars expression"); set a constant
|
|
14080
|
+
with the row's `hardCodedValue` instead.
|
|
14006
14081
|
description: |
|
|
14007
14082
|
**Purpose**
|
|
14008
14083
|
Configures how to construct arrays in the output record, handling various array types and inputs.
|
|
14009
14084
|
|
|
14010
14085
|
**Guidance**
|
|
14011
|
-
This is the
|
|
14086
|
+
This is the mechanism for building array data types:
|
|
14012
14087
|
|
|
14013
14088
|
**When to Use**
|
|
14014
|
-
- REQUIRED when dataType ends with "array" (stringarray, objectarray, etc.)
|
|
14089
|
+
- REQUIRED when dataType ends with "array" (stringarray, objectarray, etc.), unless the
|
|
14090
|
+
row passes a source array through with a JSONPath `extract` alone or sets
|
|
14091
|
+
`hardCodedValue`
|
|
14015
14092
|
- Each entry in this array contributes elements to the output array
|
|
14016
14093
|
- Multiple entries allow combining data from different input arrays
|
|
14017
14094
|
|
|
@@ -14773,7 +14850,7 @@ components:
|
|
|
14773
14850
|
- envelope
|
|
14774
14851
|
x-enumDescriptions:
|
|
14775
14852
|
record: The transform processor evaluates `mappings[].extract` JSONPath against the flat record itself (`$.field`, no `record.` segment) — the default when absent.
|
|
14776
|
-
envelope: The transform processor evaluates JSONPath against the wrapped runtime envelope `{record, settings,
|
|
14853
|
+
envelope: The transform processor evaluates JSONPath against the wrapped runtime envelope `{record, job, testMode, settings, headers, queryParams}` (file-provider steps also carry `fileMeta`) — record fields need the `record.` segment (`$.record.field`), while `headers` and `queryParams` sit beside `record` (`$.headers['X-Id']`, `$.queryParams.src`).
|
|
14777
14854
|
description: |
|
|
14778
14855
|
Controls the JSON shape the transformTwoDotZero processor
|
|
14779
14856
|
evaluates `mappings[].extract` JSONPath values against at
|
|
@@ -14793,10 +14870,12 @@ components:
|
|
|
14793
14870
|
`"$.PLACEHOLDER_<field>"`.
|
|
14794
14871
|
This is the dominant Celigo idiom and the right choice for new transforms.
|
|
14795
14872
|
- `envelope`: the processor sees a wrapped object
|
|
14796
|
-
`{record: {...},
|
|
14797
|
-
`fileMeta` on file-provider steps).
|
|
14873
|
+
`{record: {...}, job, testMode, settings, headers,
|
|
14874
|
+
queryParams}` (plus `fileMeta` on file-provider steps).
|
|
14798
14875
|
`mappings[].extract` JSONPath MUST include the
|
|
14799
|
-
`record.` segment — e.g.
|
|
14876
|
+
`record.` segment for record fields — e.g.
|
|
14877
|
+
`"$.record.orderId"` — and reads `headers` and
|
|
14878
|
+
`queryParams` beside it (`$.headers['X-Id']`);
|
|
14800
14879
|
PLACEHOLDER extracts use `"$.record.PLACEHOLDER_<field>"`.
|
|
14801
14880
|
Pick this only when the transform was authored against
|
|
14802
14881
|
the envelope shape on purpose.
|
|
@@ -14805,6 +14884,11 @@ components:
|
|
|
14805
14884
|
(`{{record.field}}`, `{{dateFormat ... record.field}}`)
|
|
14806
14885
|
ALWAYS reference the `record` root regardless of
|
|
14807
14886
|
`inputContext` — only JSONPath anchoring flips.
|
|
14887
|
+
- |-
|
|
14888
|
+
In `envelope` mode a `modify` transform merges its mapped
|
|
14889
|
+
fields into `record` and keeps the rest of the envelope
|
|
14890
|
+
around it; a `create` transform returns only the mapped
|
|
14891
|
+
fields, as a bare record.
|
|
14808
14892
|
- |-
|
|
14809
14893
|
Emit `inputContext` explicitly on new v2 transforms:
|
|
14810
14894
|
unset is read as `record`, but stating it makes the
|
|
@@ -14825,13 +14909,17 @@ components:
|
|
|
14825
14909
|
|
|
14826
14910
|
- ``envelope``: the transform processor sees a wrapped
|
|
14827
14911
|
object of the shape
|
|
14828
|
-
``{record: {...},
|
|
14829
|
-
``fileMeta`` on file-provider
|
|
14912
|
+
``{record: {...}, job, testMode, settings, headers,
|
|
14913
|
+
queryParams}`` (plus ``fileMeta`` on file-provider
|
|
14914
|
+
steps; ``headers`` and ``queryParams`` sit beside
|
|
14915
|
+
``record``) — the
|
|
14830
14916
|
same runtime-context envelope Handlebars / SQL /
|
|
14831
14917
|
GraphQL templates render against. ``mappings[].extract``
|
|
14832
|
-
JSONPath values MUST include the
|
|
14833
|
-
— for example ``"$.record.orderId"``
|
|
14834
|
-
``"$.record.customer.email"
|
|
14918
|
+
JSONPath values for record fields MUST include the
|
|
14919
|
+
``record.`` segment — for example ``"$.record.orderId"``
|
|
14920
|
+
or ``"$.record.customer.email"`` — while ``headers`` and
|
|
14921
|
+
``queryParams`` are read beside it
|
|
14922
|
+
(``"$.headers['X-Id']"``). PLACEHOLDER extracts
|
|
14835
14923
|
use ``"$.record.PLACEHOLDER_<field>"``. Pick this
|
|
14836
14924
|
mode only when the export was authored against the
|
|
14837
14925
|
envelope shape on purpose (typically because an
|
package/dist/processor.yml
CHANGED
|
@@ -23,7 +23,8 @@ tags:
|
|
|
23
23
|
|
|
24
24
|
These are one-shot transformation calls — they do not create or modify
|
|
25
25
|
any resources. Use them to test parsing rules, preview file definitions,
|
|
26
|
-
or transform data outside of a flow.
|
|
26
|
+
or transform data outside of a flow. The filter and Handlebars processors
|
|
27
|
+
test a step's filter rules or templates the same way.
|
|
27
28
|
|
|
28
29
|
## Processor descriptor schema
|
|
29
30
|
|
|
@@ -1047,6 +1048,212 @@ paths:
|
|
|
1047
1048
|
type: string
|
|
1048
1049
|
path:
|
|
1049
1050
|
type: string
|
|
1051
|
+
/v1/processors/filter:
|
|
1052
|
+
post:
|
|
1053
|
+
x-internal: false
|
|
1054
|
+
operationId: evaluateFilterRules
|
|
1055
|
+
tags:
|
|
1056
|
+
- Parsers & Generators
|
|
1057
|
+
summary: Test filter rules against records
|
|
1058
|
+
description: |-
|
|
1059
|
+
Evaluates export and import filter rules (`Filter.expression`) against the records in `data` and
|
|
1060
|
+
returns the records that pass. Nothing is saved and no flow runs, so it checks a rule before the
|
|
1061
|
+
rule is saved on a step. Rules are validated as they are when a filter is saved: an unknown
|
|
1062
|
+
operator or a bare `extract` is refused with 422.
|
|
1063
|
+
|
|
1064
|
+
Send each record bare, the way it reaches a step's filter. A record wrapped as
|
|
1065
|
+
`{"record": {...}}` is evaluated as that wrapper, so field rules don't match it.
|
|
1066
|
+
requestBody:
|
|
1067
|
+
required: true
|
|
1068
|
+
content:
|
|
1069
|
+
application/json:
|
|
1070
|
+
schema:
|
|
1071
|
+
type: object
|
|
1072
|
+
required:
|
|
1073
|
+
- rules
|
|
1074
|
+
- data
|
|
1075
|
+
properties:
|
|
1076
|
+
rules:
|
|
1077
|
+
type: object
|
|
1078
|
+
description: The filter expression to evaluate, in the shape of a step's `filter.expression`.
|
|
1079
|
+
required:
|
|
1080
|
+
- version
|
|
1081
|
+
- rules
|
|
1082
|
+
properties:
|
|
1083
|
+
version:
|
|
1084
|
+
type: string
|
|
1085
|
+
enum:
|
|
1086
|
+
- '1'
|
|
1087
|
+
x-enumDescriptions:
|
|
1088
|
+
'1': Version 1 of the Celigo expression-based filter format.
|
|
1089
|
+
description: Version of the filter format used by `rules`.
|
|
1090
|
+
rules:
|
|
1091
|
+
type: array
|
|
1092
|
+
description: Prefix-notation rule in the grammar of `Filter.expression.rules`.
|
|
1093
|
+
x-celigo-agent:
|
|
1094
|
+
- filter
|
|
1095
|
+
items: {}
|
|
1096
|
+
data:
|
|
1097
|
+
type: array
|
|
1098
|
+
description: Records to evaluate, each a bare record object.
|
|
1099
|
+
items:
|
|
1100
|
+
type: object
|
|
1101
|
+
additionalProperties: true
|
|
1102
|
+
examples:
|
|
1103
|
+
default:
|
|
1104
|
+
summary: Keep the records whose email has a value
|
|
1105
|
+
value:
|
|
1106
|
+
rules:
|
|
1107
|
+
version: '1'
|
|
1108
|
+
rules:
|
|
1109
|
+
- notempty
|
|
1110
|
+
- - string
|
|
1111
|
+
- - extract
|
|
1112
|
+
- email
|
|
1113
|
+
data:
|
|
1114
|
+
- email: a@example.com
|
|
1115
|
+
- email: ''
|
|
1116
|
+
- {}
|
|
1117
|
+
responses:
|
|
1118
|
+
'200':
|
|
1119
|
+
description: The records that pass the rules.
|
|
1120
|
+
content:
|
|
1121
|
+
application/json:
|
|
1122
|
+
schema:
|
|
1123
|
+
type: object
|
|
1124
|
+
properties:
|
|
1125
|
+
mediaType:
|
|
1126
|
+
type: string
|
|
1127
|
+
description: Always `json` for the filter processor.
|
|
1128
|
+
enum:
|
|
1129
|
+
- json
|
|
1130
|
+
x-enumDescriptions:
|
|
1131
|
+
json: Response data is formatted as JSON.
|
|
1132
|
+
data:
|
|
1133
|
+
type: array
|
|
1134
|
+
description: The input records that pass the rules, unchanged and in input order.
|
|
1135
|
+
items:
|
|
1136
|
+
type: object
|
|
1137
|
+
additionalProperties: true
|
|
1138
|
+
duration:
|
|
1139
|
+
type: integer
|
|
1140
|
+
description: Processing time in milliseconds.
|
|
1141
|
+
examples:
|
|
1142
|
+
default:
|
|
1143
|
+
value:
|
|
1144
|
+
mediaType: json
|
|
1145
|
+
data:
|
|
1146
|
+
- email: a@example.com
|
|
1147
|
+
duration: 0
|
|
1148
|
+
'401':
|
|
1149
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
1150
|
+
'422':
|
|
1151
|
+
description: |-
|
|
1152
|
+
The rules are invalid, for example an unknown operator ("Invalid operation: isnotempty.") or
|
|
1153
|
+
an `extract` that is not wrapped in a type conversion ("Field operation extract must be called
|
|
1154
|
+
by a Type Conversion Operation but was called by notempty.").
|
|
1155
|
+
content:
|
|
1156
|
+
application/json:
|
|
1157
|
+
schema:
|
|
1158
|
+
$ref: '#/components/schemas/Error'
|
|
1159
|
+
/v1/processors/handlebars:
|
|
1160
|
+
post:
|
|
1161
|
+
x-internal: false
|
|
1162
|
+
operationId: renderHandlebarsTemplate
|
|
1163
|
+
tags:
|
|
1164
|
+
- Parsers & Generators
|
|
1165
|
+
summary: Render a Handlebars template
|
|
1166
|
+
description: |-
|
|
1167
|
+
Renders a Handlebars template against the object in `data` and returns the result. Nothing is
|
|
1168
|
+
saved and no flow runs, so it tests a template or a helper before the template is saved on a
|
|
1169
|
+
step.
|
|
1170
|
+
|
|
1171
|
+
`data` is the template's root context: `{{name}}` reads `data.name`. A template written for a
|
|
1172
|
+
step reads the record as `{{record.<field>}}`, so send the record under `record`
|
|
1173
|
+
(`"data": {"record": {...}}`). Double braces HTML-escape the value (`&` renders as `&`);
|
|
1174
|
+
triple braces insert it unchanged. A `timestamp` with no time zone renders in UTC.
|
|
1175
|
+
|
|
1176
|
+
An unknown helper is refused with 422. `GET /v1/processors` lists helpers under the handlebars
|
|
1177
|
+
entry's `helperFunctions`, but that list is not complete: `eq` and `truncateWords`, for
|
|
1178
|
+
example, render although it omits them, so render a doubtful helper once here before relying
|
|
1179
|
+
on it.
|
|
1180
|
+
requestBody:
|
|
1181
|
+
required: true
|
|
1182
|
+
content:
|
|
1183
|
+
application/json:
|
|
1184
|
+
schema:
|
|
1185
|
+
type: object
|
|
1186
|
+
required:
|
|
1187
|
+
- rules
|
|
1188
|
+
- data
|
|
1189
|
+
properties:
|
|
1190
|
+
rules:
|
|
1191
|
+
type: object
|
|
1192
|
+
required:
|
|
1193
|
+
- template
|
|
1194
|
+
properties:
|
|
1195
|
+
template:
|
|
1196
|
+
type: string
|
|
1197
|
+
description: The Handlebars template to render.
|
|
1198
|
+
x-celigo-agent:
|
|
1199
|
+
- handlebars
|
|
1200
|
+
resultMode:
|
|
1201
|
+
type: string
|
|
1202
|
+
description: Form of the result; `text` returns the rendered string.
|
|
1203
|
+
examples:
|
|
1204
|
+
- text
|
|
1205
|
+
data:
|
|
1206
|
+
type: object
|
|
1207
|
+
additionalProperties: true
|
|
1208
|
+
description: Root context the template renders against.
|
|
1209
|
+
examples:
|
|
1210
|
+
step_template:
|
|
1211
|
+
summary: Render a step template against a record
|
|
1212
|
+
value:
|
|
1213
|
+
rules:
|
|
1214
|
+
template: '{{record.name}} | {{{record.name}}}'
|
|
1215
|
+
resultMode: text
|
|
1216
|
+
data:
|
|
1217
|
+
record:
|
|
1218
|
+
name: Smith & Sons
|
|
1219
|
+
responses:
|
|
1220
|
+
'200':
|
|
1221
|
+
description: The rendered template.
|
|
1222
|
+
content:
|
|
1223
|
+
application/json:
|
|
1224
|
+
schema:
|
|
1225
|
+
type: object
|
|
1226
|
+
properties:
|
|
1227
|
+
mediaType:
|
|
1228
|
+
type: string
|
|
1229
|
+
description: Always `text` for the handlebars processor.
|
|
1230
|
+
enum:
|
|
1231
|
+
- text
|
|
1232
|
+
x-enumDescriptions:
|
|
1233
|
+
text: Response data is the rendered text.
|
|
1234
|
+
data:
|
|
1235
|
+
description: |-
|
|
1236
|
+
The rendered result, normally a string. A template that renders only a helper's
|
|
1237
|
+
numeric result can come back as a JSON number.
|
|
1238
|
+
duration:
|
|
1239
|
+
type: integer
|
|
1240
|
+
description: Processing time in milliseconds.
|
|
1241
|
+
examples:
|
|
1242
|
+
default:
|
|
1243
|
+
value:
|
|
1244
|
+
mediaType: text
|
|
1245
|
+
data: Smith & Sons | Smith & Sons
|
|
1246
|
+
duration: 0
|
|
1247
|
+
'401':
|
|
1248
|
+
$ref: '#/components/responses/401-unauthorized'
|
|
1249
|
+
'422':
|
|
1250
|
+
description: |-
|
|
1251
|
+
The template could not be rendered, for example because it calls a helper that does not
|
|
1252
|
+
exist ('Missing helper: "first"').
|
|
1253
|
+
content:
|
|
1254
|
+
application/json:
|
|
1255
|
+
schema:
|
|
1256
|
+
$ref: '#/components/schemas/Error'
|
|
1050
1257
|
components:
|
|
1051
1258
|
securitySchemes:
|
|
1052
1259
|
bearerAuth:
|
|
@@ -1219,6 +1426,46 @@ components:
|
|
|
1219
1426
|
traceKeysDuplicate:
|
|
1220
1427
|
type: boolean
|
|
1221
1428
|
description: When true, duplicate trace keys were detected in the output records.
|
|
1429
|
+
Error:
|
|
1430
|
+
type: object
|
|
1431
|
+
description: Standard error response envelope returned by integrator.io APIs.
|
|
1432
|
+
properties:
|
|
1433
|
+
errors:
|
|
1434
|
+
type: array
|
|
1435
|
+
description: List of errors that occurred while processing the request.
|
|
1436
|
+
items:
|
|
1437
|
+
type: object
|
|
1438
|
+
properties:
|
|
1439
|
+
code:
|
|
1440
|
+
oneOf:
|
|
1441
|
+
- type: string
|
|
1442
|
+
- type: integer
|
|
1443
|
+
description: |-
|
|
1444
|
+
Machine-readable error code. Usually a string like
|
|
1445
|
+
`invalid_ref`, `missing_required_field`, or `unauthorized`;
|
|
1446
|
+
may be an **integer** when the error mirrors an upstream HTTP
|
|
1447
|
+
status (e.g. `500`) — most commonly returned by connection-ping
|
|
1448
|
+
and adaptor-proxy responses.
|
|
1449
|
+
message:
|
|
1450
|
+
type: string
|
|
1451
|
+
description: Human-readable description of the error.
|
|
1452
|
+
field:
|
|
1453
|
+
type: string
|
|
1454
|
+
description: |-
|
|
1455
|
+
Optional pointer to the document field that caused the error.
|
|
1456
|
+
Used by structural validation errors (`missing_required_field`,
|
|
1457
|
+
`invalid_ref`) to indicate which field is at fault
|
|
1458
|
+
(e.g. `_id`, `type`, `http.baseURI`).
|
|
1459
|
+
source:
|
|
1460
|
+
type: string
|
|
1461
|
+
description: |-
|
|
1462
|
+
Optional origin layer for the error — e.g. `application` when
|
|
1463
|
+
the error came from the remote system the adaptor called,
|
|
1464
|
+
`connector` when the adaptor itself rejected the request.
|
|
1465
|
+
required:
|
|
1466
|
+
- message
|
|
1467
|
+
required:
|
|
1468
|
+
- errors
|
|
1222
1469
|
responses:
|
|
1223
1470
|
401-unauthorized:
|
|
1224
1471
|
description: |-
|