@celigo/api-specs 0.2.331 → 0.2.333

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/import.yml CHANGED
@@ -983,17 +983,27 @@ paths:
983
983
  - Imports
984
984
  summary: Preview NetSuite import field mappings against sample data
985
985
  description: |-
986
- Resolves a NetSuite import's Mapper 1.0 field mappings against supplied
987
- sample records and returns the mapped NetSuite record — the body fields
986
+ Resolves a NetSuite import's Mapper 1.0 field mappings against a supplied
987
+ sample record and returns the mapped NetSuite record — the body fields
988
988
  (`nlobjFieldIds`) and sublists (`nlobjSublistIds`) that *would* be sent —
989
- without writing anything to NetSuite. Handlebars expressions in the mapping
990
- are evaluated, so this is the way to confirm how a mapping resolves before
991
- running it live.
989
+ without writing anything to NetSuite. Handlebars expressions and lookups
990
+ (run as searches in the NetSuite account) are evaluated, so this is the way
991
+ to confirm how a row's expression and its lookup resolve before running
992
+ them live. Row conditions are evaluated too, but a lookup-based condition
993
+ (`conditional.lookupName`) is not proof of a run: on a `restletVersion:
994
+ suiteapp2.0` import the run reads the lookup's resolved value where the
995
+ preview reads its search, and the two can map opposite rows — see
996
+ `mapping.fields[].conditional` on the import.
997
+
998
+ Only the first record in `data` is mapped — send one record per request.
992
999
 
993
1000
  This is a stateless dry-run of the mapping engine: no Job is created and no
994
- NetSuite record is touched. It is the NetSuite-mapping counterpart to
995
- `POST /v1/imports/preview`, which previews the full import pipeline; use this
996
- operation when you specifically want the resolved NetSuite field values.
1001
+ NetSuite record is touched. The search for the existing record
1002
+ (`importConfig.internalIdLookup`) is not run, so the response does not show
1003
+ which record an update would change or whether one exists. It is the
1004
+ NetSuite-mapping counterpart to `POST /v1/imports/preview`, which previews
1005
+ the full import pipeline; use this operation when you specifically want the
1006
+ resolved NetSuite field values.
997
1007
  parameters:
998
1008
  - name: _connectionId
999
1009
  in: query
@@ -1053,7 +1063,8 @@ paths:
1053
1063
  Mapping resolved. The mapped NetSuite fields are under
1054
1064
  `data.returnedObjects.jsObjects.data[].data.nlobjFieldIds`. Inspect
1055
1065
  `data.returnedObjects.mappingErrors` before trusting the output — it
1056
- lists any fields that failed to resolve.
1066
+ lists any fields that failed to resolve, and a record with an error is
1067
+ absent from `jsObjects.data`.
1057
1068
  content:
1058
1069
  application/json:
1059
1070
  schema:
@@ -4074,6 +4085,21 @@ components:
4074
4085
  ## IMPORTANT
4075
4086
  This field is a string, NOT an object. Set it directly: "operation": "addupdate"
4076
4087
  Do NOT send {"type": "addupdate"} — that causes a Cast error.
4088
+ - |-
4089
+ On `attach` and `detach` the mapping's body rows are the operation's own
4090
+ properties — the mapping page's locked rows — not fields of the record
4091
+ type: the `customer` record metadata lists none of them, so do not check
4092
+ these rows against the record type's field list.
4093
+ Attach: `recordType` (Attach To Record Type), `celigo_nlobjAttachToId`
4094
+ (Attach To Internal ID), `celigo_nlobjAttachedType` (Attached Record Type)
4095
+ and `celigo_nlobjAttachedId` (Attached Internal ID). Detach: `recordType`
4096
+ (Detach From Record Type), `celigo_nlobjDetachFromId`,
4097
+ `celigo_nlobjDetachedType` and `celigo_nlobjDetachedId`. Both take the
4098
+ optional `celigo_nlobjAttachDetachAttributesRole` (Attribute Role) and
4099
+ `celigo_nlobjAttachDetachAttributesField` (Attribute Field). The mapping
4100
+ preview (`PUT /v1/netsuiteDA/previewImportMappingFields`) returns each of
4101
+ them under `nlobjFieldIds` with the value its row produced; it does not
4102
+ attach or detach anything.
4077
4103
  recordType:
4078
4104
  type: string
4079
4105
  x-celigo-ui-override: Required by the NetSuite import form (recordType is required:true). Encoded to mirror the form so builders produce connectable configurations.
@@ -4411,6 +4437,10 @@ components:
4411
4437
  The preview resolves the mapping without writing to NetSuite: the multiselect row
4412
4438
  NetSuite rejected at save time (see `fields[].dataType`) rendered exactly like the
4413
4439
  row it accepted, so a passed preview does not prove the save.
4440
+ - |-
4441
+ The preview maps one record per request, evaluates row conditions and lookups,
4442
+ and does not run `internalIdLookup` — the operation's request schema lists what it
4443
+ leaves out and what it does not report.
4414
4444
  properties:
4415
4445
  fields:
4416
4446
  type: array
@@ -4450,6 +4480,14 @@ components:
4450
4480
  helper rather than retry — see
4451
4481
  `mapping.lists[].fields[].extract` for examples of
4452
4482
  helpers observed present and missing.
4483
+ - |-
4484
+ A substitution that outputs a value takes triple braces.
4485
+ In the mapping preview double braces HTML-escaped the
4486
+ output — a field (`{{name}}`), a helper's result
4487
+ (`{{uppercase name}}`) and a substitution inside a block
4488
+ alike: `O'Brien` rendered as `O'Brien` and `A&B` as
4489
+ `A&B` — while the same expressions in triple braces
4490
+ and a plain path rendered the value unchanged.
4453
4491
  generate:
4454
4492
  type: string
4455
4493
  description: |
@@ -4713,7 +4751,53 @@ components:
4713
4751
  a lookup renamed or removed while a condition still references the
4714
4752
  old name is the typical cause. Fix the reference or restore the
4715
4753
  lookup — changing the RESTlet / SuiteScript version does not resolve
4716
- this error.
4754
+ this error. The mapping preview does not report it: there the row is
4755
+ left out of the mapped record with no error.
4756
+ - |-
4757
+ A search that finds nothing never fails the record through a
4758
+ lookup-based condition: with `allowFailures` false and no match, a
4759
+ `lookup_empty` row was applied and a `lookup_not_empty` row left
4760
+ out, and the lookup raised no error, on import runs with
4761
+ `restletVersion` `suiteapp2.0`, `suiteapp1.0` and `suitebundle` and
4762
+ in the mapping preview. `allowFailures` fails a record only on a
4763
+ row that takes its value from the lookup (`lookupName`).
4764
+ - |-
4765
+ On `restletVersion: suiteapp2.0` an import run reads the condition
4766
+ from the value the lookup resolves to under its own settings.
4767
+ `lookup_not_empty` held, and `lookup_empty` did not, when the
4768
+ search matched one record; when it matched several with
4769
+ `allowFailures` true (the lookup resolves to one of them); and
4770
+ when a lookup with `allowFailures` true fell back to a non-empty
4771
+ `default` — on no match, or on several matches with
4772
+ `useDefaultOnMultipleMatches` true. `lookup_empty` held when the
4773
+ search matched nothing and the lookup had no `default`, an empty
4774
+ one or a null one; when it matched several with `allowFailures`
4775
+ false; and when `useDefaultOnMultipleMatches` sent several
4776
+ matches to an empty `default`. Observed on a sublist row in a
4777
+ script's `imports.runMapping` for every case named here, and on
4778
+ a body row of import runs for all of them but the null `default`
4779
+ and one match with `allowFailures` true. A lookup with a
4780
+ `default` and `allowFailures: false` is refused in both: `Lookups
4781
+ with default set can not have allowFailures explicitly set to
4782
+ false.`
4783
+ - |-
4784
+ The mapping preview (`PUT /v1/netsuiteDA/previewImportMappingFields`)
4785
+ reads the condition from the search alone: no match is empty, one
4786
+ match or several is not, and `default` plays no part. Observed
4787
+ with `restletVersion: suiteapp2.0` in the request for the cases
4788
+ above other than a null `default` and a `default` with
4789
+ `allowFailures: false`, and for no match and one match with the
4790
+ other two values. Import runs on `suiteapp1.0` and `suitebundle`
4791
+ read it the same way (no match, one match, no match with a
4792
+ non-empty `default`, several matches with `allowFailures`
4793
+ false). The preview therefore maps the opposite of a `suiteapp2.0`
4794
+ run in two cases — no match on a lookup with a non-empty `default`
4795
+ (the preview applied the `lookup_empty` row, the run left it
4796
+ out), and several matches that the lookup does not resolve to a
4797
+ record, with `allowFailures` false or routed to an empty `default`
4798
+ (the preview left the `lookup_empty` row out, the run applied
4799
+ it). Give a lookup that only a condition reads no `default` and
4800
+ criteria that match at most one record, and the two agree.
4717
4801
  - |-
4718
4802
  `when: record_updated` requires an operation that can update an
4719
4803
  existing record: on an `add`-only operation every record fails with
@@ -4762,8 +4846,8 @@ components:
4762
4846
  record_created: Apply this mapping only when a new record is being created.
4763
4847
  record_updated: Apply this mapping only when an existing record is being updated.
4764
4848
  extract_not_empty: Apply this mapping only when the extracted source value is non-empty.
4765
- lookup_not_empty: Apply this mapping only when the lookup returns a value.
4766
- lookup_empty: Apply this mapping only when the lookup returns no value.
4849
+ lookup_not_empty: Apply this mapping only when the lookup named by `lookupName` returns a value.
4850
+ lookup_empty: Apply this mapping only when the lookup named by `lookupName` returns no value.
4767
4851
  ignore_if_set: Skip this mapping if the target field already has a value.
4768
4852
  description: Condition that controls when this field mapping is applied.
4769
4853
  description: |
@@ -4839,8 +4923,10 @@ components:
4839
4923
  - |-
4840
4924
  The mapper drives iteration from the `[*]` segments among the child extracts;
4841
4925
  scalar extracts tag along.
4842
- If no child uses `[*]` and none set `extract` at all (every child is a `hardCodedValue`),
4843
- the sublist renders a single static line.
4926
+ If no child uses `[*]`, the sublist renders a single line: a sublist whose
4927
+ only row extracts a root-level field (`contactExternalId`, resolved through a
4928
+ lookup) rendered one line in the mapping preview, as does one whose every
4929
+ child is a `hardCodedValue`.
4844
4930
  - |-
4845
4931
  A row that resolves its value through `lookupName`
4846
4932
  (typically `extract: ""`) is driven by the sibling
@@ -5132,7 +5218,18 @@ components:
5132
5218
  flow job (it never completes) instead of producing the
5133
5219
  `Cannot set properties of undefined (setting '_hasStarNotation')`
5134
5220
  error record. Cross-reference every row's `conditional.lookupName`
5135
- against the import's defined lookups.
5221
+ against the import's defined lookups. The mapping preview does not
5222
+ report it either: there the row is left out of the sublist with no
5223
+ error.
5224
+ - |-
5225
+ A lookup-based condition is read as on a body row — a miss never
5226
+ fails the record, and the mapping preview reads the search where a
5227
+ `suiteapp2.0` run reads the lookup's resolved value (see
5228
+ `mapping.fields[].conditional`). On an iterating sublist the preview
5229
+ evaluates it per line: with two lines whose lookup found an item for
5230
+ the first only, a `lookup_not_empty` row was written on the first
5231
+ line and a `lookup_empty` row on the second, with the lookup's
5232
+ `allowFailures` true and false alike.
5136
5233
  - |-
5137
5234
  The operation contract differs from body-field conditions:
5138
5235
  `when: record_updated` on an `add`-only operation is rejected
@@ -5188,8 +5285,8 @@ components:
5188
5285
  record_created: Apply this mapping only when a new record is being created.
5189
5286
  record_updated: Apply this mapping only when an existing record is being updated.
5190
5287
  extract_not_empty: Apply this mapping only when the extracted source value is non-empty.
5191
- lookup_not_empty: Apply this mapping only when the lookup returns a value.
5192
- lookup_empty: Apply this mapping only when the lookup returns no value.
5288
+ lookup_not_empty: Apply this mapping only when the lookup named by `lookupName` returns a value.
5289
+ lookup_empty: Apply this mapping only when the lookup named by `lookupName` returns no value.
5193
5290
  ignore_if_set: Skip this mapping if the target field already has a value.
5194
5291
  description: Field mappings for each column in the sublist.
5195
5292
  description: |
@@ -5493,13 +5590,24 @@ components:
5493
5590
  - boolean
5494
5591
  - 'null'
5495
5592
  description: |-
5496
- When true, a lookup miss (no matching record and no
5497
- `default`) resolves to `null` and the import continues, and
5498
- a search matching more than one record resolves to one of
5593
+ Governs a mapping row that takes its value from this lookup
5594
+ (`lookupName`). When true, a lookup miss (no matching record
5595
+ and no `default`) resolves to `null` and the import continues,
5596
+ and a search matching more than one record resolves to one of
5499
5597
  them unless `useDefaultOnMultipleMatches` routes it to
5500
5598
  `default`. When false (default), a miss and an ambiguous
5501
5599
  match both halt the record. May be stored as null (treated
5502
5600
  as unset).
5601
+ x-celigo-ai-guidance:
5602
+ - |-
5603
+ A miss never halts the record through a row condition that reads
5604
+ this lookup (`conditional.lookupName` with `lookup_empty` /
5605
+ `lookup_not_empty`), whatever this flag says — do not turn it on
5606
+ to keep a `lookup_empty` condition from failing. On a
5607
+ `restletVersion: suiteapp2.0` import the flag, `default` and
5608
+ `useDefaultOnMultipleMatches` do decide what such a condition
5609
+ reads when the search matches several records or falls back to a
5610
+ default — see `mapping.fields[].conditional`.
5503
5611
  map:
5504
5612
  type:
5505
5613
  - object
@@ -14164,9 +14272,13 @@ components:
14164
14272
  - Contains '{{' and '}}' pattern
14165
14273
  - Evaluated by the AFE 2.0 handlebars template engine
14166
14274
  - Can include logic, formatting, and computation
14167
- - Access input record fields with {{record.fieldName}} notation; a grouped
14168
- (array) record binds as `rows` instead — {{rows.0.fieldName}} / {{#each rows}}
14169
- - Examples: "{{record.firstName}} {{record.lastName}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
14275
+ - Access input record fields with {{{record.fieldName}}} notation; a grouped
14276
+ (array) record binds as `rows` instead — {{{rows.0.fieldName}}} / {{#each rows}}
14277
+ - Write a substitution that outputs a value with triple braces. Double braces
14278
+ HTML-escape what they output — a field and a helper's result alike: `O'Brien`
14279
+ is written as `O'Brien` and `A&B` as `A&B`. Block tags (`{{#if}}`,
14280
+ `{{else}}`, `{{/if}}`) keep double braces
14281
+ - Examples: "{{{record.firstName}}} {{{record.lastName}}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
14170
14282
  - Valid on scalars and on `object` rows, where the rendered output must
14171
14283
  parse into an object. On an array row the template goes in a
14172
14284
  `buildArrayHelper` entry instead: on an `objectarray` row's own
@@ -14176,7 +14288,7 @@ components:
14176
14288
  error
14177
14289
 
14178
14290
  ```json
14179
- "extract": "{{record.price}} {{record.currency}}" // Combines two fields
14291
+ "extract": "{{{record.price}}} {{{record.currency}}}" // Combines two fields
14180
14292
  ```
14181
14293
 
14182
14294
  **3. Hard-Coded Value (literal string)**
@@ -14232,9 +14344,9 @@ components:
14232
14344
  [{"extract": "$[*].field"}]`; an `objectarray` uses
14233
14345
  `buildArrayHelper: [{"extract": "$[*]", "mappings": [...]}]`
14234
14346
  with the children addressing the row relatively (`$.field`,
14235
- `{{rows.field}}`). An `extract` placed directly on the
14347
+ `{{{rows.field}}}`). An `extract` placed directly on the
14236
14348
  array-typed field yields nothing. Handlebars
14237
- extracts bind the array record as `rows` (`{{rows.0.field}}`),
14349
+ extracts bind the array record as `rows` (`{{{rows.0.field}}}`),
14238
14350
  an object record as `record`. The reverse holds too: `$[*]` on
14239
14351
  an object record iterates the object's values, not rows.
14240
14352
  - |-
@@ -14256,9 +14368,22 @@ components:
14256
14368
  - **Use a lookup** (`lookupName` + a small `lookups` entry)
14257
14369
  for value translation that would otherwise need a long
14258
14370
  `{{#if ...}}{{else if ...}}` chain.
14371
+ - |-
14372
+ ## TRIPLE BRACES FOR VALUES
14373
+ A substitution that outputs a value is written with triple
14374
+ braces. With double braces the mapper HTML-escapes the output —
14375
+ `&`, `<`, `>`, `"` and `'` become `&amp;`, `&lt;`, `&gt;`,
14376
+ `&quot;` and `&#x27;` — for a field (`{{record.name}}`), for a
14377
+ helper's result (`{{uppercase record.name}}`, `{{join ", "
14378
+ record.tags}}`) and inside a block (`{{#if
14379
+ record.name}}{{record.name}}{{/if}}`), with no error: the
14380
+ destination receives `O&#x27;Brien` for `O'Brien`. The same
14381
+ expressions with triple braces (`{{{record.name}}}`, `{{{uppercase
14382
+ record.name}}}`) and a JSONPath extract (`$.name`) write the value
14383
+ unchanged. Transformation 2.0 rules behave the same.
14259
14384
  examples:
14260
14385
  - $.fullName
14261
- - '{{record.fullName}}'
14386
+ - '{{{record.fullName}}}'
14262
14387
  - primary
14263
14388
  - $.lineItems[*].unitPrice
14264
14389
  extractDateFormat:
@@ -15288,9 +15413,13 @@ components:
15288
15413
  - Contains '{{' and '}}' pattern
15289
15414
  - Evaluated by the AFE 2.0 handlebars template engine
15290
15415
  - Can include logic, formatting, and computation
15291
- - Access input record fields with {{record.fieldName}} notation; a grouped
15292
- (array) record binds as `rows` instead — {{rows.0.fieldName}} / {{#each rows}}
15293
- - Examples: "{{record.firstName}} {{record.lastName}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
15416
+ - Access input record fields with {{{record.fieldName}}} notation; a grouped
15417
+ (array) record binds as `rows` instead — {{{rows.0.fieldName}}} / {{#each rows}}
15418
+ - Write a substitution that outputs a value with triple braces. Double braces
15419
+ HTML-escape what they output — a field and a helper's result alike: `O'Brien`
15420
+ is written as `O&#x27;Brien` and `A&B` as `A&amp;B`. Block tags (`{{#if}}`,
15421
+ `{{else}}`, `{{/if}}`) keep double braces
15422
+ - Examples: "{{{record.firstName}}} {{{record.lastName}}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
15294
15423
  - Valid on scalars and on `object` rows, where the rendered output must
15295
15424
  parse into an object. On an array row the template goes in a
15296
15425
  `buildArrayHelper` entry instead: on an `objectarray` row's own
@@ -15300,7 +15429,7 @@ components:
15300
15429
  error
15301
15430
 
15302
15431
  ```json
15303
- "extract": "{{record.price}} {{record.currency}}" // Combines two fields
15432
+ "extract": "{{{record.price}}} {{{record.currency}}}" // Combines two fields
15304
15433
  ```
15305
15434
 
15306
15435
  **3. Hard-Coded Value (literal string)**
@@ -15356,9 +15485,9 @@ components:
15356
15485
  [{"extract": "$[*].field"}]`; an `objectarray` uses
15357
15486
  `buildArrayHelper: [{"extract": "$[*]", "mappings": [...]}]`
15358
15487
  with the children addressing the row relatively (`$.field`,
15359
- `{{rows.field}}`). An `extract` placed directly on the
15488
+ `{{{rows.field}}}`). An `extract` placed directly on the
15360
15489
  array-typed field yields nothing. Handlebars
15361
- extracts bind the array record as `rows` (`{{rows.0.field}}`),
15490
+ extracts bind the array record as `rows` (`{{{rows.0.field}}}`),
15362
15491
  an object record as `record`. The reverse holds too: `$[*]` on
15363
15492
  an object record iterates the object's values, not rows.
15364
15493
  - |-
@@ -15380,9 +15509,22 @@ components:
15380
15509
  - **Use a lookup** (`lookupName` + a small `lookups` entry)
15381
15510
  for value translation that would otherwise need a long
15382
15511
  `{{#if ...}}{{else if ...}}` chain.
15512
+ - |-
15513
+ ## TRIPLE BRACES FOR VALUES
15514
+ A substitution that outputs a value is written with triple
15515
+ braces. With double braces the mapper HTML-escapes the output —
15516
+ `&`, `<`, `>`, `"` and `'` become `&amp;`, `&lt;`, `&gt;`,
15517
+ `&quot;` and `&#x27;` — for a field (`{{record.name}}`), for a
15518
+ helper's result (`{{uppercase record.name}}`, `{{join ", "
15519
+ record.tags}}`) and inside a block (`{{#if
15520
+ record.name}}{{record.name}}{{/if}}`), with no error: the
15521
+ destination receives `O&#x27;Brien` for `O'Brien`. The same
15522
+ expressions with triple braces (`{{{record.name}}}`, `{{{uppercase
15523
+ record.name}}}`) and a JSONPath extract (`$.name`) write the value
15524
+ unchanged. Transformation 2.0 rules behave the same.
15383
15525
  examples:
15384
15526
  - $.fullName
15385
- - '{{record.fullName}}'
15527
+ - '{{{record.fullName}}}'
15386
15528
  - primary
15387
15529
  - $.lineItems[*].unitPrice
15388
15530
  extractDateFormat:
@@ -16499,9 +16641,9 @@ components:
16499
16641
  the envelope shape on purpose.
16500
16642
  - |-
16501
16643
  Handlebars expressions inside `extract` reference the
16502
- `record` root on an object record (`{{record.field}}`,
16503
- `{{dateFormat ... record.field}}`) and `rows` on a
16504
- grouped one (`{{rows.0.field}}`), regardless of
16644
+ `record` root on an object record (`{{{record.field}}}`,
16645
+ `{{{dateFormat ... record.field}}}`) and `rows` on a
16646
+ grouped one (`{{{rows.0.field}}}`), regardless of
16505
16647
  `inputContext` — only JSONPath anchoring flips.
16506
16648
  - |-
16507
16649
  ## Grouped records
@@ -16513,7 +16655,7 @@ components:
16513
16655
  `$.rows[*]` whose children read `$.rows.field` — while
16514
16656
  `$.record[0].field` and `$.record[*]` resolve nothing,
16515
16657
  with no error (live, 2026-10-30). Handlebars extracts
16516
- read it as `rows` in both modes (`{{rows.0.field}}`).
16658
+ read it as `rows` in both modes (`{{{rows.0.field}}}`).
16517
16659
  - |-
16518
16660
  In `envelope` mode the output is still a bare record: a
16519
16661
  `modify` transform returns the record with its mapped
@@ -16562,10 +16704,10 @@ components:
16562
16704
  ## Handlebars expressions are NOT affected
16563
16705
 
16564
16706
  Handlebars expressions inside ``extract``
16565
- (``{{record.field}}``,
16566
- ``{{dateFormat ... record.field}}``, etc.) reference the
16707
+ (``{{{record.field}}}``,
16708
+ ``{{{dateFormat ... record.field}}}``, etc.) reference the
16567
16709
  runtime context's ``record`` root on an object record,
16568
- and ``rows`` (``{{rows.0.field}}``) on a grouped one,
16710
+ and ``rows`` (``{{{rows.0.field}}}``) on a grouped one,
16569
16711
  regardless of ``inputContext`` — the Handlebars runtime
16570
16712
  always sees the wrapped envelope. Only JSONPath
16571
16713
  behavior flips with this field.
@@ -16589,7 +16731,7 @@ components:
16589
16731
  source file: ``fileName``, ``fileSize``, and
16590
16732
  ``lastModifiedTime`` (epoch milliseconds). Reach it
16591
16733
  as ``$.fileMeta.<field>`` in envelope mode, or as
16592
- ``{{fileMeta.<field>}}`` from a Handlebars extract in
16734
+ ``{{{fileMeta.<field>}}}`` from a Handlebars extract in
16593
16735
  either mode. The keys are exactly these three —
16594
16736
  lowercase variants such as ``filesize`` or
16595
16737
  ``filename`` resolve empty. The standalone transform
@@ -16722,16 +16864,33 @@ components:
16722
16864
  - A dot path from the record root (e.g. `email`, `address.city`), read from the
16723
16865
  incoming record. A path that matches no field writes nothing.
16724
16866
  - Handlebars template (contains `{{`) for concatenation /
16725
- formatting / conditional logic (e.g. `{{firstName}} {{lastName}}`,
16726
- `{{#if mobile}}{{mobile}}{{else}}{{phone}}{{/if}}`). The template reads the
16867
+ formatting / conditional logic (e.g. `{{{firstName}}} {{{lastName}}}`,
16868
+ `{{#if mobile}}{{{mobile}}}{{else}}{{{phone}}}{{/if}}`). The template reads the
16727
16869
  record's fields by bare name: `{{record.firstName}}` and `{{data.firstName}}`
16728
16870
  render nothing, so the field is left out even when the record has the value.
16871
+ A substitution that outputs a value takes triple braces: double braces
16872
+ HTML-escape it (`O'Brien` is written as `O&#x27;Brien`).
16729
16873
 
16730
16874
  A `$.` JSONPath (the Mapper 2.0 `mappings` syntax) reads nothing here, and a bare
16731
16875
  string is read as a field path, not a constant: set constants in `hardCodedValue`.
16732
16876
  Omit when using `hardCodedValue`.
16733
16877
  examples:
16734
16878
  - address.city
16879
+ x-celigo-ai-guidance:
16880
+ - |-
16881
+ Double braces HTML-escape whatever they output — a field, a helper's result
16882
+ (`{{uppercase lastName}}`, `{{join ", " tags}}`) and a substitution inside a
16883
+ block — with no error: `&`, `<`, `>`, `"` and `'` are written as `&amp;`,
16884
+ `&lt;`, `&gt;`, `&quot;` and `&#x27;`. The same expressions in triple braces,
16885
+ and a plain path, write the value unchanged.
16886
+ - |-
16887
+ In a `dataType: json` row the rendered text is parsed, so a string value needs
16888
+ JSON escaping instead: `[{{{jsonSerialize name}}}]` wrote a value holding a
16889
+ double quote and an apostrophe intact, `["{{{name}}}"]` failed the row on it
16890
+ (`Expected ',' or ']' after array element in JSON`) and `["{{name}}"]` wrote
16891
+ the HTML-escaped text. Keep a space between the helper's closing braces and
16892
+ an object's closing brace: `{"name": {{{jsonSerialize name}}}}` failed with
16893
+ `malformed_expression`, `{"name": {{{jsonSerialize name}}} }` was parsed.
16735
16894
  hardCodedValue:
16736
16895
  type:
16737
16896
  - string
@@ -18743,7 +18902,7 @@ components:
18743
18902
  mode evaluates against the wrapped runtime envelope
18744
18903
  (``"$.record.field"``). See ``inputContext`` for the full
18745
18904
  per-mode contract. Handlebars expressions in ``extract`` always
18746
- reference ``{{record.field}}`` regardless — only JSONPath
18905
+ reference ``{{{record.field}}}`` regardless — only JSONPath
18747
18906
  behavior flips with ``inputContext``.
18748
18907
  - |-
18749
18908
  ## JSON structure — record { } or rows [ ]
@@ -18865,8 +19024,8 @@ components:
18865
19024
  - |-
18866
19025
  ## Handlebars expressions are NOT affected
18867
19026
 
18868
- Handlebars expressions inside ``extract`` (``{{record.field}}``,
18869
- ``{{dateFormat ... record.field}}``, etc.) ALWAYS reference the
19027
+ Handlebars expressions inside ``extract`` (``{{{record.field}}}``,
19028
+ ``{{{dateFormat ... record.field}}}``, etc.) ALWAYS reference the
18870
19029
  runtime context's ``record`` root regardless of
18871
19030
  ``inputContext`` — the Handlebars runtime always sees the
18872
19031
  wrapped envelope. Only JSONPath behavior flips with this field.
@@ -19655,9 +19814,47 @@ components:
19655
19814
  type: object
19656
19815
  description: |-
19657
19816
  Envelope for previewing how a NetSuite import's Mapper 1.0 field mappings
19658
- resolve against sample source records. Carries the sample data plus the
19817
+ resolve against a sample source record. Carries the sample data plus the
19659
19818
  NetSuite Distributed (`netsuite_da`) import configuration whose `mapping`
19660
19819
  is applied.
19820
+ x-celigo-ai-guidance:
19821
+ - |-
19822
+ Send one record per request. With two records in `data` the response held
19823
+ one mapped record, the first one's, whichever order they were sent in —
19824
+ with `importConfig.restletVersion` `suiteapp2.0`, `suiteapp1.0` and
19825
+ `suitebundle` alike. When the first record failed (`suiteapp2.0`), its
19826
+ error was returned and the second record was not mapped either.
19827
+ - |-
19828
+ `importConfig.internalIdLookup` is not run: on `operation: update` a
19829
+ lookup that matched no record left the response unchanged (all three
19830
+ `restletVersion` values), while an import run with such a lookup failed
19831
+ the record with `Cannot update record without internalid.`
19832
+ (`suiteapp2.0`). A mapped record in the response is not evidence that
19833
+ the record to update exists.
19834
+ - |-
19835
+ Put every lookup a mapping row names in `importConfig.lookups` — the
19836
+ preview reports no error for one that is missing. A sublist row whose
19837
+ `conditional.lookupName` was not defined was left out of the mapped
19838
+ record (all three `restletVersion` values), as was a body row
19839
+ (`suiteapp2.0`); a row whose `lookupName` was not defined was written
19840
+ with its source value untranslated (a body row on all three, a sublist
19841
+ row on `suiteapp2.0`). A run fails instead — see
19842
+ `mapping.fields[].conditional` and `lookups[].name` on the import.
19843
+ - |-
19844
+ A lookup-based row condition (`conditional.lookupName`) is read here from
19845
+ the lookup's search alone, while a run of a `restletVersion: suiteapp2.0`
19846
+ import reads the value the lookup resolves to. The preview maps the
19847
+ opposite of such a run when the search finds nothing and the lookup has a
19848
+ non-empty `default`, and when the search matches several records that
19849
+ the lookup does not resolve to one — see `mapping.fields[].conditional`
19850
+ on the import.
19851
+ - |-
19852
+ The record is mapped as sent. For a one-to-many import (`oneToMany` with
19853
+ `pathToMany`, set on the import and not part of this request) send the
19854
+ record the mapping receives: one element's fields at the root and the
19855
+ parent's fields under `_PARENT`. A parent record sent whole was not split
19856
+ (`suiteapp2.0`, with and without `oneToMany` / `pathToMany` added to
19857
+ `importConfig`): the rows' element paths read nothing.
19661
19858
  required:
19662
19859
  - data
19663
19860
  - importConfig
@@ -19665,9 +19862,9 @@ components:
19665
19862
  data:
19666
19863
  type: array
19667
19864
  description: |-
19668
- Sample source records to run the mappings against. Each record is the
19669
- input the mapper extracts from (the shape an upstream export would emit).
19670
- Handlebars expressions in `importConfig.mapping` are evaluated per record.
19865
+ Sample source record to run the mappings against — the input the mapper
19866
+ extracts from (the shape an upstream export would emit). Only the first
19867
+ element is mapped.
19671
19868
  items:
19672
19869
  type: object
19673
19870
  additionalProperties: true
@@ -19683,12 +19880,12 @@ components:
19683
19880
  mapping:
19684
19881
  type: object
19685
19882
  description: |-
19686
- Mapper 1.0 mapping configuration applied to each record. `fields`
19883
+ Mapper 1.0 mapping configuration applied to the record. `fields`
19687
19884
  maps individual fields; `lists` maps repeating sublists.
19688
19885
  properties:
19689
19886
  fields:
19690
19887
  type: array
19691
- description: Field-level mapping entries applied to each record.
19888
+ description: Field-level mapping entries applied to the record.
19692
19889
  items:
19693
19890
  $ref: '#/components/schemas/MappingField'
19694
19891
  lists:
@@ -19707,8 +19904,10 @@ components:
19707
19904
  lookups:
19708
19905
  type: array
19709
19906
  description: |-
19710
- Lookup definitions referenced by `mapping.fields[].lookupName` to
19711
- translate source values into NetSuite values during the preview.
19907
+ Lookup definitions the mapping's rows name — `lookupName` to
19908
+ translate a source value into a NetSuite value, and
19909
+ `conditional.lookupName` to decide whether a row is applied —
19910
+ on body rows and sublist rows.
19712
19911
  items:
19713
19912
  type: object
19714
19913
  additionalProperties: true
@@ -19722,7 +19921,7 @@ components:
19722
19921
  type: object
19723
19922
  description: |-
19724
19923
  Result of resolving a NetSuite import's field mappings against the supplied
19725
- sample records. The mapped NetSuite fields appear under
19924
+ sample record. The mapped NetSuite fields appear under
19726
19925
  `data.returnedObjects.jsObjects.data[].data.nlobjFieldIds`; mapping failures
19727
19926
  surface in `data.returnedObjects.mappingErrors`. No record is written to
19728
19927
  NetSuite.
@@ -19745,7 +19944,10 @@ components:
19745
19944
  properties:
19746
19945
  data:
19747
19946
  type: array
19748
- description: One entry per input record, in input order.
19947
+ description: |-
19948
+ The mapped record for the first input record: one entry
19949
+ whatever the number of records sent, and none when that
19950
+ record has an entry in `mappingErrors`.
19749
19951
  items:
19750
19952
  type: object
19751
19953
  properties:
@@ -19766,19 +19968,52 @@ components:
19766
19968
  nlobjSublistIds:
19767
19969
  type: object
19768
19970
  additionalProperties: true
19769
- description: Resolved sublist (line-item) values keyed by NetSuite sublist id. Empty when the mapping defines no `lists`.
19971
+ description: |-
19972
+ Resolved sublist (line-item) values keyed by NetSuite
19973
+ sublist id, each holding its `lines` — one object per
19974
+ line, keyed by field id. Empty when the mapping defines
19975
+ no `lists`; a sublist none of whose rows was applied to
19976
+ the record has no key here.
19770
19977
  originalSize:
19771
19978
  type: integer
19772
- description: Number of input records received.
19979
+ description: |-
19980
+ Number of mapped records in `data`, not the number sent: `1`
19981
+ for one record and for two, `0` when the record failed.
19773
19982
  processedCount:
19774
19983
  type: integer
19775
19984
  description: Number of records processed by the engine.
19776
19985
  mappingErrors:
19777
19986
  type: array
19778
- description: Mapping failures encountered while resolving fields. Empty when every field resolved cleanly.
19987
+ description: |-
19988
+ Mapping failures encountered while resolving fields. Empty when
19989
+ every field resolved cleanly. One failed row fails the whole
19990
+ record: nothing is returned for it in `jsObjects.data`.
19779
19991
  items:
19780
19992
  type: object
19781
19993
  additionalProperties: true
19994
+ properties:
19995
+ index:
19996
+ type: string
19997
+ description: Label of the failed record — `JSON Object Index 1` for the first record.
19998
+ indexNumber:
19999
+ type: integer
20000
+ description: Position of the failed record — `0` for the first record.
20001
+ error:
20002
+ type: object
20003
+ additionalProperties: true
20004
+ description: The engine's error for the record.
20005
+ properties:
20006
+ code:
20007
+ type: string
20008
+ description: Error code, such as `VALUE_LOOKUP_FAILED` for a lookup that matched no record or more than one.
20009
+ details:
20010
+ type: string
20011
+ description: |-
20012
+ What failed. A lookup failure quotes the search criteria as
20013
+ rendered for the record and the record type searched.
20014
+ stackTrace:
20015
+ type: string
20016
+ description: The mapping engine's stack trace for the failure.
19782
20017
  celigo_classname:
19783
20018
  type: string
19784
20019
  description: Internal engine class name for the result (e.g. `Celigo.integrator.mapping.model.MapToNetSuiteResult`).