@viu/emporix-sdk 3.3.0 → 3.4.0

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/index.d.cts CHANGED
@@ -3509,6 +3509,22 @@ type SelfHostedParams = {
3509
3509
  * Name of the header required for authorization e.g. `Authorization`.
3510
3510
  */
3511
3511
  authorizationHeaderName?: string;
3512
+ fileProcessingConfig?: FileProcessingConfig;
3513
+ };
3514
+ /**
3515
+ * Optional additional config for file processing (preview).
3516
+ *
3517
+ * **The `fileProcessingConfig` field is in preview mode** - some of the features may not be fully operational yet.
3518
+ */
3519
+ type FileProcessingConfig = {
3520
+ /**
3521
+ * When true, file processing uses the Responses API on the self-hosted LLM.
3522
+ */
3523
+ useResponsesApi?: boolean;
3524
+ /**
3525
+ * Optional extra model identifier used for file processing.
3526
+ */
3527
+ extraModelKey?: string;
3512
3528
  };
3513
3529
  type SelfHostedParamsRequest = SelfHostedParams & {
3514
3530
  [key: string]: unknown;
@@ -9100,6 +9116,33 @@ type ImportRun$1 = {
9100
9116
  * What triggered the run.
9101
9117
  */
9102
9118
  trigger?: 'MANUAL' | 'SCHEDULED';
9119
+ /**
9120
+ * Dry-run only. A sample of the mapped records that would be written, so the mapping can be previewed without a real import. Absent on normal runs.
9121
+ */
9122
+ dryRunSample?: Array<{
9123
+ /**
9124
+ * The stream that produced the sample record.
9125
+ */
9126
+ stream?: string;
9127
+ /**
9128
+ * The resolved target type the record would be written to.
9129
+ */
9130
+ targetType?: string;
9131
+ /**
9132
+ * The record's natural/deterministic key.
9133
+ */
9134
+ key?: string;
9135
+ /**
9136
+ * The mapped target fields that would be written.
9137
+ */
9138
+ fields?: {
9139
+ [key: string]: unknown;
9140
+ };
9141
+ }>;
9142
+ /**
9143
+ * What requested the run. The `origin` value from the trigger request, or the `trigger` value when `origin` was omitted. Use this field to distinguish a dashboard run from a run started by an integration scenario. The field is absent on runs recorded before it existed.
9144
+ */
9145
+ origin?: string;
9103
9146
  /**
9104
9147
  * The run status.
9105
9148
  */
@@ -9711,6 +9754,14 @@ type PostImporttoolTriggerRunData = {
9711
9754
  * When `true`, every extracted record is rewritten, even if unchanged. It bypasses the idempotency `skip-if-unchanged` check. Use it to force target IDs and values to be rewritten.
9712
9755
  */
9713
9756
  force?: boolean;
9757
+ /**
9758
+ * Dry-run only. How many mapped records to sample per stream for the preview returned as `dryRunSample`. Clamped to 1-100; defaults to 25.
9759
+ */
9760
+ sampleSize?: number;
9761
+ /**
9762
+ * What requested this run. Examples: `Dashboard`, an integration scenario name, or a scheduler name. The `trigger` field records only `MANUAL` or `SCHEDULED`. Use `origin` when more than one system calls this endpoint. If you omit `origin` or send a blank value, the service stores the `trigger` value. The service rejects values longer than 40 characters and values that contain control characters. It does not shorten them.
9763
+ */
9764
+ origin?: string;
9714
9765
  };
9715
9766
  path: {
9716
9767
  /**
@@ -9816,7 +9867,19 @@ type ImportConfig = ImportConfig$1;
9816
9867
  type ImportStream = ImportStream$1;
9817
9868
  /** A cron schedule for a configuration. `cron` is a six-field Spring expression. */
9818
9869
  type ImportSchedule = Schedule;
9819
- /** An import run with its reconciled counters. */
9870
+ /**
9871
+ * An import run with its reconciled counters.
9872
+ *
9873
+ * Two counters describe the **source feed** rather than the import: a run can
9874
+ * report `SUCCEEDED` while `duplicateKeys` (source rows repeating a key already
9875
+ * imported in the run — only the last survives) and `unresolvedParents` (child
9876
+ * records whose parent was not found, distinct from `skipped`, which means
9877
+ * already up to date) hide real data loss from the pass/fail counters.
9878
+ *
9879
+ * `dryRunSample` carries the previewed records on a dry run and is absent on a
9880
+ * normal one. `origin` echoes what asked for the run, and is absent on runs
9881
+ * recorded before that field existed.
9882
+ */
9820
9883
  type ImportRun = ImportRun$1;
9821
9884
  /** Per-stream progress within a run. */
9822
9885
  type ImportRunStream = ImportRunStream$1;
@@ -9829,9 +9892,19 @@ type ImportErrorRecord = ErrorRecord;
9829
9892
  /** A record that was imported, with its keys, stored fields and last outcome. */
9830
9893
  type ImportedRecord = ImportedRecord$1;
9831
9894
  /**
9832
- * Body for `triggerRun`: `{ mode?, dryRun?, force? }`. `mode` defaults to
9833
- * `DELTA` server-side; `force` rewrites every extracted record, bypassing the
9834
- * skip-if-unchanged idempotency.
9895
+ * Body for `triggerRun`: `{ mode?, dryRun?, force?, sampleSize?, origin? }`.
9896
+ *
9897
+ * - `mode` defaults to `DELTA` server-side.
9898
+ * - `force` rewrites every extracted record, bypassing the skip-if-unchanged
9899
+ * idempotency.
9900
+ * - `sampleSize` is **dry-run only**: how many mapped records to sample per
9901
+ * stream into the run's `dryRunSample`. Clamped to 1–100, defaults to 25.
9902
+ * - `origin` is free text naming *what* asked for the run (`"Dashboard"`, an
9903
+ * integration scenario, your own scheduler), as opposed to `trigger`, which
9904
+ * only ever records `MANUAL` or `SCHEDULED`. Omitted or blank, the service
9905
+ * stores the `trigger` value instead. **Over 40 characters or containing
9906
+ * control characters is rejected, not shortened** — a truncated label in an
9907
+ * audit trail is worse than a refused request.
9835
9908
  */
9836
9909
  type ImportRunInput = NonNullable<PostImporttoolTriggerRunData["body"]>;
9837
9910
  /** Lifecycle status of an {@link ImportRun}. */
@@ -9972,13 +10045,58 @@ declare class ImportService {
9972
10045
  * a normal result rather than an error.
9973
10046
  */
9974
10047
  getSchedule(configId: string, auth?: AuthContext): Promise<ImportSchedule | null>;
9975
- /** Create or replace a configuration's schedule. */
10048
+ /**
10049
+ * Create or replace a configuration's schedule.
10050
+ *
10051
+ * **`cron` is a six-field Spring expression** (`second minute hour
10052
+ * day-of-month month day-of-week`). The familiar five-field `"0 * * * *"` is
10053
+ * not «hourly» here, it is invalid, and the service answers `400` rather than
10054
+ * storing it — which it used to do, leaving a schedule that silently never
10055
+ * fired.
10056
+ *
10057
+ * A `404` means no configuration with that id, so there is nothing to
10058
+ * schedule. Use {@link deleteSchedule} to clear a schedule that outlived its
10059
+ * configuration.
10060
+ */
9976
10061
  setSchedule(configId: string, input: ImportSchedule, auth?: AuthContext): Promise<ImportSchedule>;
10062
+ /**
10063
+ * Remove a configuration's schedule. It then runs only when triggered.
10064
+ *
10065
+ * **Idempotent, and deliberately not gated on the configuration existing.**
10066
+ * Removing a schedule that is not there also resolves — and unlike
10067
+ * {@link setSchedule}, this does not require the configuration to exist. That
10068
+ * is the point: a schedule left behind by a deleted configuration is exactly
10069
+ * what needs removing, so refusing those would leave them with no way out.
10070
+ *
10071
+ * The service answers `204`, so this resolves to `void` rather than to the
10072
+ * removed schedule.
10073
+ */
10074
+ deleteSchedule(configId: string, auth?: AuthContext): Promise<void>;
9977
10075
  /**
9978
10076
  * Trigger a run. `mode` defaults to `DELTA` server-side; `dryRun: true` maps
9979
10077
  * and validates without writing to the target.
9980
10078
  *
10079
+ * A dry run can also hand back what it *would* have written: pass
10080
+ * `sampleSize` (1–100, default 25) and read the run's `dryRunSample`. Set
10081
+ * `origin` to name what asked for the run — `trigger` only distinguishes
10082
+ * `MANUAL` from `SCHEDULED`, so without it a dashboard click and an
10083
+ * integration scenario are indistinguishable in the history. Note the service
10084
+ * **rejects** an `origin` over 40 characters instead of shortening it.
10085
+ *
9981
10086
  * Not retried on a 5xx: a POST that timed out may already have queued a run.
10087
+ *
10088
+ * @example
10089
+ * ```ts
10090
+ * // Preview the mapping without writing anything.
10091
+ * const run = await client.imports.triggerRun(configId, {
10092
+ * dryRun: true,
10093
+ * sampleSize: 5,
10094
+ * origin: "Dashboard",
10095
+ * });
10096
+ * for (const row of run.dryRunSample ?? []) {
10097
+ * console.log(row.stream, row.targetType, row.key, row.fields);
10098
+ * }
10099
+ * ```
9982
10100
  */
9983
10101
  triggerRun(configId: string, input?: ImportRunInput, auth?: AuthContext): Promise<ImportRun>;
9984
10102
  /** List a configuration's runs, newest first. */
package/dist/index.d.ts CHANGED
@@ -3509,6 +3509,22 @@ type SelfHostedParams = {
3509
3509
  * Name of the header required for authorization e.g. `Authorization`.
3510
3510
  */
3511
3511
  authorizationHeaderName?: string;
3512
+ fileProcessingConfig?: FileProcessingConfig;
3513
+ };
3514
+ /**
3515
+ * Optional additional config for file processing (preview).
3516
+ *
3517
+ * **The `fileProcessingConfig` field is in preview mode** - some of the features may not be fully operational yet.
3518
+ */
3519
+ type FileProcessingConfig = {
3520
+ /**
3521
+ * When true, file processing uses the Responses API on the self-hosted LLM.
3522
+ */
3523
+ useResponsesApi?: boolean;
3524
+ /**
3525
+ * Optional extra model identifier used for file processing.
3526
+ */
3527
+ extraModelKey?: string;
3512
3528
  };
3513
3529
  type SelfHostedParamsRequest = SelfHostedParams & {
3514
3530
  [key: string]: unknown;
@@ -9100,6 +9116,33 @@ type ImportRun$1 = {
9100
9116
  * What triggered the run.
9101
9117
  */
9102
9118
  trigger?: 'MANUAL' | 'SCHEDULED';
9119
+ /**
9120
+ * Dry-run only. A sample of the mapped records that would be written, so the mapping can be previewed without a real import. Absent on normal runs.
9121
+ */
9122
+ dryRunSample?: Array<{
9123
+ /**
9124
+ * The stream that produced the sample record.
9125
+ */
9126
+ stream?: string;
9127
+ /**
9128
+ * The resolved target type the record would be written to.
9129
+ */
9130
+ targetType?: string;
9131
+ /**
9132
+ * The record's natural/deterministic key.
9133
+ */
9134
+ key?: string;
9135
+ /**
9136
+ * The mapped target fields that would be written.
9137
+ */
9138
+ fields?: {
9139
+ [key: string]: unknown;
9140
+ };
9141
+ }>;
9142
+ /**
9143
+ * What requested the run. The `origin` value from the trigger request, or the `trigger` value when `origin` was omitted. Use this field to distinguish a dashboard run from a run started by an integration scenario. The field is absent on runs recorded before it existed.
9144
+ */
9145
+ origin?: string;
9103
9146
  /**
9104
9147
  * The run status.
9105
9148
  */
@@ -9711,6 +9754,14 @@ type PostImporttoolTriggerRunData = {
9711
9754
  * When `true`, every extracted record is rewritten, even if unchanged. It bypasses the idempotency `skip-if-unchanged` check. Use it to force target IDs and values to be rewritten.
9712
9755
  */
9713
9756
  force?: boolean;
9757
+ /**
9758
+ * Dry-run only. How many mapped records to sample per stream for the preview returned as `dryRunSample`. Clamped to 1-100; defaults to 25.
9759
+ */
9760
+ sampleSize?: number;
9761
+ /**
9762
+ * What requested this run. Examples: `Dashboard`, an integration scenario name, or a scheduler name. The `trigger` field records only `MANUAL` or `SCHEDULED`. Use `origin` when more than one system calls this endpoint. If you omit `origin` or send a blank value, the service stores the `trigger` value. The service rejects values longer than 40 characters and values that contain control characters. It does not shorten them.
9763
+ */
9764
+ origin?: string;
9714
9765
  };
9715
9766
  path: {
9716
9767
  /**
@@ -9816,7 +9867,19 @@ type ImportConfig = ImportConfig$1;
9816
9867
  type ImportStream = ImportStream$1;
9817
9868
  /** A cron schedule for a configuration. `cron` is a six-field Spring expression. */
9818
9869
  type ImportSchedule = Schedule;
9819
- /** An import run with its reconciled counters. */
9870
+ /**
9871
+ * An import run with its reconciled counters.
9872
+ *
9873
+ * Two counters describe the **source feed** rather than the import: a run can
9874
+ * report `SUCCEEDED` while `duplicateKeys` (source rows repeating a key already
9875
+ * imported in the run — only the last survives) and `unresolvedParents` (child
9876
+ * records whose parent was not found, distinct from `skipped`, which means
9877
+ * already up to date) hide real data loss from the pass/fail counters.
9878
+ *
9879
+ * `dryRunSample` carries the previewed records on a dry run and is absent on a
9880
+ * normal one. `origin` echoes what asked for the run, and is absent on runs
9881
+ * recorded before that field existed.
9882
+ */
9820
9883
  type ImportRun = ImportRun$1;
9821
9884
  /** Per-stream progress within a run. */
9822
9885
  type ImportRunStream = ImportRunStream$1;
@@ -9829,9 +9892,19 @@ type ImportErrorRecord = ErrorRecord;
9829
9892
  /** A record that was imported, with its keys, stored fields and last outcome. */
9830
9893
  type ImportedRecord = ImportedRecord$1;
9831
9894
  /**
9832
- * Body for `triggerRun`: `{ mode?, dryRun?, force? }`. `mode` defaults to
9833
- * `DELTA` server-side; `force` rewrites every extracted record, bypassing the
9834
- * skip-if-unchanged idempotency.
9895
+ * Body for `triggerRun`: `{ mode?, dryRun?, force?, sampleSize?, origin? }`.
9896
+ *
9897
+ * - `mode` defaults to `DELTA` server-side.
9898
+ * - `force` rewrites every extracted record, bypassing the skip-if-unchanged
9899
+ * idempotency.
9900
+ * - `sampleSize` is **dry-run only**: how many mapped records to sample per
9901
+ * stream into the run's `dryRunSample`. Clamped to 1–100, defaults to 25.
9902
+ * - `origin` is free text naming *what* asked for the run (`"Dashboard"`, an
9903
+ * integration scenario, your own scheduler), as opposed to `trigger`, which
9904
+ * only ever records `MANUAL` or `SCHEDULED`. Omitted or blank, the service
9905
+ * stores the `trigger` value instead. **Over 40 characters or containing
9906
+ * control characters is rejected, not shortened** — a truncated label in an
9907
+ * audit trail is worse than a refused request.
9835
9908
  */
9836
9909
  type ImportRunInput = NonNullable<PostImporttoolTriggerRunData["body"]>;
9837
9910
  /** Lifecycle status of an {@link ImportRun}. */
@@ -9972,13 +10045,58 @@ declare class ImportService {
9972
10045
  * a normal result rather than an error.
9973
10046
  */
9974
10047
  getSchedule(configId: string, auth?: AuthContext): Promise<ImportSchedule | null>;
9975
- /** Create or replace a configuration's schedule. */
10048
+ /**
10049
+ * Create or replace a configuration's schedule.
10050
+ *
10051
+ * **`cron` is a six-field Spring expression** (`second minute hour
10052
+ * day-of-month month day-of-week`). The familiar five-field `"0 * * * *"` is
10053
+ * not «hourly» here, it is invalid, and the service answers `400` rather than
10054
+ * storing it — which it used to do, leaving a schedule that silently never
10055
+ * fired.
10056
+ *
10057
+ * A `404` means no configuration with that id, so there is nothing to
10058
+ * schedule. Use {@link deleteSchedule} to clear a schedule that outlived its
10059
+ * configuration.
10060
+ */
9976
10061
  setSchedule(configId: string, input: ImportSchedule, auth?: AuthContext): Promise<ImportSchedule>;
10062
+ /**
10063
+ * Remove a configuration's schedule. It then runs only when triggered.
10064
+ *
10065
+ * **Idempotent, and deliberately not gated on the configuration existing.**
10066
+ * Removing a schedule that is not there also resolves — and unlike
10067
+ * {@link setSchedule}, this does not require the configuration to exist. That
10068
+ * is the point: a schedule left behind by a deleted configuration is exactly
10069
+ * what needs removing, so refusing those would leave them with no way out.
10070
+ *
10071
+ * The service answers `204`, so this resolves to `void` rather than to the
10072
+ * removed schedule.
10073
+ */
10074
+ deleteSchedule(configId: string, auth?: AuthContext): Promise<void>;
9977
10075
  /**
9978
10076
  * Trigger a run. `mode` defaults to `DELTA` server-side; `dryRun: true` maps
9979
10077
  * and validates without writing to the target.
9980
10078
  *
10079
+ * A dry run can also hand back what it *would* have written: pass
10080
+ * `sampleSize` (1–100, default 25) and read the run's `dryRunSample`. Set
10081
+ * `origin` to name what asked for the run — `trigger` only distinguishes
10082
+ * `MANUAL` from `SCHEDULED`, so without it a dashboard click and an
10083
+ * integration scenario are indistinguishable in the history. Note the service
10084
+ * **rejects** an `origin` over 40 characters instead of shortening it.
10085
+ *
9981
10086
  * Not retried on a 5xx: a POST that timed out may already have queued a run.
10087
+ *
10088
+ * @example
10089
+ * ```ts
10090
+ * // Preview the mapping without writing anything.
10091
+ * const run = await client.imports.triggerRun(configId, {
10092
+ * dryRun: true,
10093
+ * sampleSize: 5,
10094
+ * origin: "Dashboard",
10095
+ * });
10096
+ * for (const row of run.dryRunSample ?? []) {
10097
+ * console.log(row.stream, row.targetType, row.key, row.fields);
10098
+ * }
10099
+ * ```
9982
10100
  */
9983
10101
  triggerRun(configId: string, input?: ImportRunInput, auth?: AuthContext): Promise<ImportRun>;
9984
10102
  /** List a configuration's runs, newest first. */
package/dist/index.js CHANGED
@@ -945,7 +945,7 @@ var HttpClient = class {
945
945
  };
946
946
 
947
947
  // package.json
948
- var version = "3.3.0";
948
+ var version = "3.4.0";
949
949
 
950
950
  // src/version.ts
951
951
  var SDK_VERSION = version;
@@ -4330,7 +4330,19 @@ var ImportService = class {
4330
4330
  });
4331
4331
  return res ?? null;
4332
4332
  }
4333
- /** Create or replace a configuration's schedule. */
4333
+ /**
4334
+ * Create or replace a configuration's schedule.
4335
+ *
4336
+ * **`cron` is a six-field Spring expression** (`second minute hour
4337
+ * day-of-month month day-of-week`). The familiar five-field `"0 * * * *"` is
4338
+ * not «hourly» here, it is invalid, and the service answers `400` rather than
4339
+ * storing it — which it used to do, leaving a schedule that silently never
4340
+ * fired.
4341
+ *
4342
+ * A `404` means no configuration with that id, so there is nothing to
4343
+ * schedule. Use {@link deleteSchedule} to clear a schedule that outlived its
4344
+ * configuration.
4345
+ */
4334
4346
  async setSchedule(configId, input, auth2 = SERVICE22) {
4335
4347
  return this.ctx.http.request({
4336
4348
  method: "PUT",
@@ -4339,11 +4351,50 @@ var ImportService = class {
4339
4351
  auth: auth2
4340
4352
  });
4341
4353
  }
4354
+ /**
4355
+ * Remove a configuration's schedule. It then runs only when triggered.
4356
+ *
4357
+ * **Idempotent, and deliberately not gated on the configuration existing.**
4358
+ * Removing a schedule that is not there also resolves — and unlike
4359
+ * {@link setSchedule}, this does not require the configuration to exist. That
4360
+ * is the point: a schedule left behind by a deleted configuration is exactly
4361
+ * what needs removing, so refusing those would leave them with no way out.
4362
+ *
4363
+ * The service answers `204`, so this resolves to `void` rather than to the
4364
+ * removed schedule.
4365
+ */
4366
+ async deleteSchedule(configId, auth2 = SERVICE22) {
4367
+ await this.ctx.http.request({
4368
+ method: "DELETE",
4369
+ path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
4370
+ auth: auth2
4371
+ });
4372
+ }
4342
4373
  /**
4343
4374
  * Trigger a run. `mode` defaults to `DELTA` server-side; `dryRun: true` maps
4344
4375
  * and validates without writing to the target.
4345
4376
  *
4377
+ * A dry run can also hand back what it *would* have written: pass
4378
+ * `sampleSize` (1–100, default 25) and read the run's `dryRunSample`. Set
4379
+ * `origin` to name what asked for the run — `trigger` only distinguishes
4380
+ * `MANUAL` from `SCHEDULED`, so without it a dashboard click and an
4381
+ * integration scenario are indistinguishable in the history. Note the service
4382
+ * **rejects** an `origin` over 40 characters instead of shortening it.
4383
+ *
4346
4384
  * Not retried on a 5xx: a POST that timed out may already have queued a run.
4385
+ *
4386
+ * @example
4387
+ * ```ts
4388
+ * // Preview the mapping without writing anything.
4389
+ * const run = await client.imports.triggerRun(configId, {
4390
+ * dryRun: true,
4391
+ * sampleSize: 5,
4392
+ * origin: "Dashboard",
4393
+ * });
4394
+ * for (const row of run.dryRunSample ?? []) {
4395
+ * console.log(row.stream, row.targetType, row.key, row.fields);
4396
+ * }
4397
+ * ```
4347
4398
  */
4348
4399
  async triggerRun(configId, input = {}, auth2 = SERVICE22) {
4349
4400
  return this.ctx.http.request({