@viu/emporix-sdk 3.1.1 → 3.2.1

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.ts CHANGED
@@ -9140,6 +9140,14 @@ type ImportRun$1 = {
9140
9140
  * Records deleted.
9141
9141
  */
9142
9142
  deleted?: number;
9143
+ /**
9144
+ * Source rows that repeat a key already imported in this run. The import keeps the last row of each repeated key and discards earlier rows. Duplicate keys do not fail the run; they mean the source feed is not unique on the key the stream imports by.
9145
+ */
9146
+ duplicateKeys?: number;
9147
+ /**
9148
+ * Child records that were not imported because their parent could not be found. Counted separately from `skipped`, which counts records that were already up to date.
9149
+ */
9150
+ unresolvedParents?: number;
9143
9151
  /**
9144
9152
  * A terminal status message, typically set on failure.
9145
9153
  */
@@ -9215,6 +9223,14 @@ type ImportRunStream$1 = {
9215
9223
  * Records deleted.
9216
9224
  */
9217
9225
  deleted?: number;
9226
+ /**
9227
+ * Source rows that repeat a key already imported in this run. The import keeps the last row of each repeated key and discards earlier rows. Duplicate keys do not fail the run; they mean the source feed is not unique on the key the stream imports by.
9228
+ */
9229
+ duplicateKeys?: number;
9230
+ /**
9231
+ * Child records that were not imported because their parent could not be found. Counted separately from `skipped`, which counts records that were already up to date.
9232
+ */
9233
+ unresolvedParents?: number;
9218
9234
  /**
9219
9235
  * A per-stream status message.
9220
9236
  */
@@ -9374,6 +9390,313 @@ type HealthThresholds = {
9374
9390
  */
9375
9391
  failedRunIsRed?: boolean;
9376
9392
  };
9393
+ /**
9394
+ * Tenant health thresholds
9395
+ *
9396
+ * The tenant-wide thresholds, together with the built-in defaults they fall back to.
9397
+ */
9398
+ type HealthSettings = {
9399
+ thresholds?: HealthThresholds;
9400
+ builtInDefaults?: HealthThresholds;
9401
+ };
9402
+ /**
9403
+ * Job group
9404
+ *
9405
+ * A named set of import configurations, used to scope the import statistics.
9406
+ */
9407
+ type JobGroup = {
9408
+ /**
9409
+ * The job group identifier.
9410
+ */
9411
+ id?: string;
9412
+ /**
9413
+ * The job group name. Unique within the tenant.
9414
+ */
9415
+ name?: string;
9416
+ /**
9417
+ * The configurations in the group.
9418
+ */
9419
+ configIds?: Array<string>;
9420
+ /**
9421
+ * When the group was created.
9422
+ */
9423
+ createdAt?: string;
9424
+ /**
9425
+ * When the group was last changed.
9426
+ */
9427
+ updatedAt?: string;
9428
+ };
9429
+ /**
9430
+ * Import limits
9431
+ *
9432
+ * The import limits that apply to the tenant.
9433
+ */
9434
+ type ImportLicense$1 = {
9435
+ /**
9436
+ * The maximum number of records a single run may write per target type. Records beyond the limit are skipped and the run finishes as `PARTIAL`.
9437
+ */
9438
+ maxRecordsPerEntity?: number;
9439
+ /**
9440
+ * The maximum number of runs that may be active at once for the tenant. A run requested beyond this limit is rejected with `429`.
9441
+ */
9442
+ maxConcurrentImports?: number;
9443
+ /**
9444
+ * The number of records written to the target per request.
9445
+ */
9446
+ batchSize?: number;
9447
+ /**
9448
+ * The number of target writes performed in parallel.
9449
+ */
9450
+ workers?: number;
9451
+ };
9452
+ /**
9453
+ * Statistics summary
9454
+ *
9455
+ * Headline totals for the window. Rates are fractions between 0 and 1.
9456
+ */
9457
+ type ImportStatsSummary = {
9458
+ /**
9459
+ * The number of runs started in the window.
9460
+ */
9461
+ totalRuns?: number;
9462
+ /**
9463
+ * The number of runs that finished successfully.
9464
+ */
9465
+ succeeded?: number;
9466
+ /**
9467
+ * The number of runs that finished with some records failing.
9468
+ */
9469
+ partial?: number;
9470
+ /**
9471
+ * The number of runs that failed.
9472
+ */
9473
+ failed?: number;
9474
+ /**
9475
+ * The number of runs that were cancelled.
9476
+ */
9477
+ cancelled?: number;
9478
+ /**
9479
+ * The number of source records read.
9480
+ */
9481
+ recordsRead?: number;
9482
+ /**
9483
+ * The number of target objects created.
9484
+ */
9485
+ created?: number;
9486
+ /**
9487
+ * The number of target objects updated.
9488
+ */
9489
+ updated?: number;
9490
+ /**
9491
+ * The number of records skipped because nothing had changed.
9492
+ */
9493
+ skipped?: number;
9494
+ /**
9495
+ * The number of target objects deleted.
9496
+ */
9497
+ deleted?: number;
9498
+ /**
9499
+ * The number of records that could not be imported.
9500
+ */
9501
+ failedRecords?: number;
9502
+ /**
9503
+ * The share of runs that finished successfully.
9504
+ */
9505
+ successRate?: number;
9506
+ /**
9507
+ * The share of records that failed.
9508
+ */
9509
+ failureRate?: number;
9510
+ /**
9511
+ * The share of processed records that resulted in a deletion.
9512
+ */
9513
+ deletionRate?: number;
9514
+ /**
9515
+ * The share of records skipped as unchanged.
9516
+ */
9517
+ skipRate?: number;
9518
+ /**
9519
+ * The mean duration of a finished run, in seconds.
9520
+ */
9521
+ avgRunDurationSec?: number;
9522
+ /**
9523
+ * The mean number of objects created per run.
9524
+ */
9525
+ avgCreatedPerRun?: number;
9526
+ /**
9527
+ * The mean number of objects updated per run.
9528
+ */
9529
+ avgUpdatedPerRun?: number;
9530
+ /**
9531
+ * The number of distinct target objects currently held by the imports in scope.
9532
+ */
9533
+ distinctEntities?: number;
9534
+ /**
9535
+ * The number of runs currently in progress.
9536
+ */
9537
+ activeRuns?: number;
9538
+ };
9539
+ /**
9540
+ * Statistics time bucket
9541
+ *
9542
+ * One bucket of the time series, in UTC.
9543
+ */
9544
+ type ImportStatsPoint = {
9545
+ /**
9546
+ * The start of the bucket.
9547
+ */
9548
+ bucket?: string;
9549
+ runs?: number;
9550
+ succeeded?: number;
9551
+ failed?: number;
9552
+ recordsRead?: number;
9553
+ created?: number;
9554
+ updated?: number;
9555
+ deleted?: number;
9556
+ skipped?: number;
9557
+ failedRecords?: number;
9558
+ };
9559
+ /**
9560
+ * Stream health
9561
+ *
9562
+ * The health of one stream over the window, and the thresholds the verdict used.
9563
+ */
9564
+ type ImportStreamHealth = {
9565
+ streamId?: string;
9566
+ /**
9567
+ * The configuration the stream belongs to.
9568
+ */
9569
+ configId?: string;
9570
+ name?: string;
9571
+ /**
9572
+ * The target type the stream writes to.
9573
+ */
9574
+ targetType?: string;
9575
+ /**
9576
+ * The status of the stream's most recent run.
9577
+ */
9578
+ lastRunStatus?: string;
9579
+ lastRunAt?: string;
9580
+ /**
9581
+ * The number of seconds since the stream last detected new data.
9582
+ */
9583
+ watermarkAgeSeconds?: number;
9584
+ /**
9585
+ * The share of the stream's records that failed in the window.
9586
+ */
9587
+ failureRatio?: number;
9588
+ /**
9589
+ * The stream's health verdict.
9590
+ */
9591
+ health?: 'GREEN' | 'AMBER' | 'RED';
9592
+ thresholds?: ImportEffectiveThresholds;
9593
+ };
9594
+ /**
9595
+ * Effective thresholds
9596
+ *
9597
+ * The threshold values the verdict was actually computed with, after resolving every level.
9598
+ */
9599
+ type ImportEffectiveThresholds = {
9600
+ failureRatioAmber?: number;
9601
+ failureRatioRed?: number;
9602
+ staleAmberHours?: number;
9603
+ staleRedHours?: number;
9604
+ failedRunIsRed?: boolean;
9605
+ /**
9606
+ * Whether any level overrides the built-in defaults.
9607
+ */
9608
+ customised?: boolean;
9609
+ };
9610
+ /**
9611
+ * Named count
9612
+ */
9613
+ type ImportStatsNamedCount = {
9614
+ streamId?: string;
9615
+ name?: string;
9616
+ count?: number;
9617
+ };
9618
+ /**
9619
+ * Error bucket
9620
+ *
9621
+ * A count of errors sharing the same stage and code.
9622
+ */
9623
+ type ImportStatsErrorBucket = {
9624
+ /**
9625
+ * The pipeline stage the error occurred in.
9626
+ */
9627
+ stage?: string;
9628
+ errorCode?: string;
9629
+ count?: number;
9630
+ };
9631
+ /**
9632
+ * Stream changes
9633
+ *
9634
+ * The counts of streams added and removed during the time window.
9635
+ */
9636
+ type ImportStreamChanges = {
9637
+ added?: number;
9638
+ removed?: number;
9639
+ /**
9640
+ * When stream tracking began for the tenant. Streams created before this point are not counted, so a window reaching further back is not comparable.
9641
+ */
9642
+ trackingSince?: string;
9643
+ series?: Array<{
9644
+ bucket?: string;
9645
+ added?: number;
9646
+ removed?: number;
9647
+ }>;
9648
+ };
9649
+ /**
9650
+ * Import statistics
9651
+ *
9652
+ * Aggregated import metrics for the requested window and scope. A section that was not requested via the `sections` parameter is returned as `null`.
9653
+ */
9654
+ type ImportStats$1 = {
9655
+ summary?: ImportStatsSummary;
9656
+ /**
9657
+ * Activity per time bucket, ordered oldest first and gap-free.
9658
+ */
9659
+ series?: Array<ImportStatsPoint>;
9660
+ /**
9661
+ * The health of each stream in scope.
9662
+ */
9663
+ streamHealth?: Array<ImportStreamHealth>;
9664
+ /**
9665
+ * The streams with the most errors during the time window, ordered by error count in descending order.
9666
+ */
9667
+ topFailingStreams?: Array<ImportStatsNamedCount>;
9668
+ /**
9669
+ * The most common errors in the window, grouped by stage and code.
9670
+ */
9671
+ errorBreakdown?: Array<ImportStatsErrorBucket>;
9672
+ streamChanges?: ImportStreamChanges;
9673
+ /**
9674
+ * The source data does not match what the import process expects during the specified time window. These issues are not failures: the runs succeed, so they do not appear in pass/fail counters.
9675
+ */
9676
+ sourceIssues?: Array<ImportSourceIssue>;
9677
+ };
9678
+ type ImportSourceIssue = {
9679
+ /**
9680
+ * The stream the problem was observed on.
9681
+ */
9682
+ streamId?: string;
9683
+ /**
9684
+ * The configuration that owns the stream.
9685
+ */
9686
+ configId?: string;
9687
+ /**
9688
+ * The stream name.
9689
+ */
9690
+ name?: string;
9691
+ /**
9692
+ * Source rows that repeat a key already imported in the same run. The import keeps the last row of each repeated key and discards earlier rows.
9693
+ */
9694
+ duplicateKeys?: number;
9695
+ /**
9696
+ * Child records that were not imported because their parent could not be found.
9697
+ */
9698
+ unresolvedParents?: number;
9699
+ };
9377
9700
  type PostImporttoolTriggerRunData = {
9378
9701
  body?: {
9379
9702
  /**
@@ -9436,6 +9759,47 @@ type GetImporttoolSearchDataRecordsData = {
9436
9759
  };
9437
9760
  url: '/importtool/{tenant}/data/records';
9438
9761
  };
9762
+ type GetImporttoolStatsData = {
9763
+ body?: never;
9764
+ path: {
9765
+ /**
9766
+ * The tenant you want to access.
9767
+ *
9768
+ */
9769
+ tenant: string;
9770
+ };
9771
+ query?: {
9772
+ /**
9773
+ * Restricts the statistics to a single configuration.
9774
+ */
9775
+ configId?: string;
9776
+ /**
9777
+ * Restricts the statistics to several configurations, as a comma-separated list of identifiers. Ignored when `configId` is given.
9778
+ */
9779
+ configIds?: string;
9780
+ /**
9781
+ * Restricts the statistics to a single stream. Takes precedence over the configuration filters.
9782
+ */
9783
+ streamId?: string;
9784
+ /**
9785
+ * The start of the window, as an ISO-8601 instant. When omitted, defaults to 30 days ago.
9786
+ */
9787
+ from?: string;
9788
+ /**
9789
+ * The end of the window, as an ISO-8601 instant. Exclusive. When omitted, defaults to now.
9790
+ */
9791
+ to?: string;
9792
+ /**
9793
+ * The bucket size of the returned time series.
9794
+ */
9795
+ granularity?: 'DAY' | 'WEEK' | 'MONTH';
9796
+ /**
9797
+ * A comma-separated list of the sections to compute: `TOTALS`, `STREAMS`, `ERRORS`, `CHANGES`. When omitted, defaults to all sections. A section not requested through the `sections` parameter is returned as `null`.
9798
+ */
9799
+ sections?: string;
9800
+ };
9801
+ url: '/importtool/{tenant}/stats';
9802
+ };
9439
9803
 
9440
9804
  /**
9441
9805
  * Public types for the Import Service — stable names aliased over the
@@ -9464,7 +9828,11 @@ type ImportCancelResult = CancelResult;
9464
9828
  type ImportErrorRecord = ErrorRecord;
9465
9829
  /** A record that was imported, with its keys, stored fields and last outcome. */
9466
9830
  type ImportedRecord = ImportedRecord$1;
9467
- /** Body for `triggerRun`: `{ mode?, dryRun? }`. `mode` defaults to `DELTA` server-side. */
9831
+ /**
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.
9835
+ */
9468
9836
  type ImportRunInput = NonNullable<PostImporttoolTriggerRunData["body"]>;
9469
9837
  /** Lifecycle status of an {@link ImportRun}. */
9470
9838
  type ImportRunStatus = NonNullable<ImportRun["status"]>;
@@ -9527,6 +9895,23 @@ type ImportPage<T> = PaginatedItems<T> & {
9527
9895
  /** Total number of pages. */
9528
9896
  totalPages: number;
9529
9897
  };
9898
+ /**
9899
+ * Aggregated import analytics: totals, a time series, an error breakdown and
9900
+ * per-stream health. Every section is optional — the `sections` filter decides
9901
+ * which ones the service computes.
9902
+ */
9903
+ type ImportStats = ImportStats$1;
9904
+ /** Query for {@link ImportsService.stats}. All filters optional. */
9905
+ type ImportStatsQuery = Omit<NonNullable<GetImporttoolStatsData["query"]>, never>;
9906
+ /** One dashboard job group: a configuration and the runs grouped under it. */
9907
+ type ImportJobGroup = JobGroup;
9908
+ /**
9909
+ * The tenant's health thresholds — the error rates above which a stream counts
9910
+ * as degraded or failing in {@link ImportStats}.
9911
+ */
9912
+ type ImportHealthThresholds = HealthSettings;
9913
+ /** The tenant's import limits and current consumption. */
9914
+ type ImportLicense = ImportLicense$1;
9530
9915
 
9531
9916
  /** One-based paging options, shared by every paginated import endpoint. */
9532
9917
  interface ImportPageOptions {
@@ -9632,6 +10017,59 @@ declare class ImportService {
9632
10017
  searchRecords(opts: SearchImportedRecordsOptions, auth?: AuthContext): Promise<ImportPage<ImportedRecord>>;
9633
10018
  /** Search the imported records produced by one stream. */
9634
10019
  searchStreamRecords(streamId: string, opts?: SearchStreamRecordsOptions, auth?: AuthContext): Promise<ImportPage<ImportedRecord>>;
10020
+ /**
10021
+ * Aggregated import analytics.
10022
+ *
10023
+ * Every section is optional in the response, and `sections` is what decides
10024
+ * which the service computes — asking for all of them on a tenant with a long
10025
+ * history is the expensive call, so name the ones you render.
10026
+ *
10027
+ * `from` / `to` are ISO timestamps. Omitted, the service picks its own window;
10028
+ * do not assume it is «everything».
10029
+ *
10030
+ * **Preview upstream**: the contract may change without a major bump.
10031
+ */
10032
+ stats(query?: ImportStatsQuery, auth?: AuthContext): Promise<ImportStats>;
10033
+ /**
10034
+ * The dashboard's job groups: configurations with their runs grouped under
10035
+ * them.
10036
+ *
10037
+ * Named after the path rather than the summary («Retrieving job groups»)
10038
+ * because the resource lives under `/dashboard` and is shaped for that view —
10039
+ * a caller wanting plain run history wants {@link listRuns}.
10040
+ *
10041
+ * **Preview upstream**: the contract may change without a major bump.
10042
+ */
10043
+ listJobGroups(auth?: AuthContext): Promise<ImportJobGroup[]>;
10044
+ /**
10045
+ * The tenant's health thresholds — the error rates above which a stream counts
10046
+ * as degraded or failing in {@link stats}.
10047
+ *
10048
+ * Read-only here: changing them needs `importtool.import_manage`, which this
10049
+ * service does not cover.
10050
+ *
10051
+ * **Preview upstream**: the contract may change without a major bump.
10052
+ */
10053
+ getHealthThresholds(auth?: AuthContext): Promise<ImportHealthThresholds>;
10054
+ /**
10055
+ * The tenant's import limits and current consumption.
10056
+ *
10057
+ * **Preview upstream**: the contract may change without a major bump.
10058
+ */
10059
+ getLicense(auth?: AuthContext): Promise<ImportLicense>;
10060
+ /**
10061
+ * Retry only the failed records of a finished run.
10062
+ *
10063
+ * Returns a **new** run — the retry is its own run with `retry: true`, not a
10064
+ * mutation of the original. Poll it with {@link getRun} or follow it with
10065
+ * {@link streamRun} exactly as you would a triggered run.
10066
+ *
10067
+ * Not retried on a 5xx, for the same reason {@link triggerRun} is not: a POST
10068
+ * that timed out may already have queued the retry.
10069
+ *
10070
+ * **Preview upstream**: the contract may change without a major bump.
10071
+ */
10072
+ retryRun(runId: string, auth?: AuthContext): Promise<ImportRun>;
9635
10073
  }
9636
10074
 
9637
10075
  type BaseUnit = {
package/dist/index.js CHANGED
@@ -945,7 +945,7 @@ var HttpClient = class {
945
945
  };
946
946
 
947
947
  // package.json
948
- var version = "3.1.1";
948
+ var version = "3.2.1";
949
949
 
950
950
  // src/version.ts
951
951
  var SDK_VERSION = version;
@@ -4464,6 +4464,91 @@ var ImportService = class {
4464
4464
  });
4465
4465
  return toPage(wire, args);
4466
4466
  }
4467
+ // ─── Analytics and retry (upstream release 2026-08-26) ─────────────────────
4468
+ /**
4469
+ * Aggregated import analytics.
4470
+ *
4471
+ * Every section is optional in the response, and `sections` is what decides
4472
+ * which the service computes — asking for all of them on a tenant with a long
4473
+ * history is the expensive call, so name the ones you render.
4474
+ *
4475
+ * `from` / `to` are ISO timestamps. Omitted, the service picks its own window;
4476
+ * do not assume it is «everything».
4477
+ *
4478
+ * **Preview upstream**: the contract may change without a major bump.
4479
+ */
4480
+ async stats(query = {}, auth2 = SERVICE22) {
4481
+ return this.ctx.http.request({
4482
+ method: "GET",
4483
+ path: `${this.base()}/stats`,
4484
+ query: { ...query },
4485
+ auth: auth2
4486
+ });
4487
+ }
4488
+ /**
4489
+ * The dashboard's job groups: configurations with their runs grouped under
4490
+ * them.
4491
+ *
4492
+ * Named after the path rather than the summary («Retrieving job groups»)
4493
+ * because the resource lives under `/dashboard` and is shaped for that view —
4494
+ * a caller wanting plain run history wants {@link listRuns}.
4495
+ *
4496
+ * **Preview upstream**: the contract may change without a major bump.
4497
+ */
4498
+ async listJobGroups(auth2 = SERVICE22) {
4499
+ return this.ctx.http.request({
4500
+ method: "GET",
4501
+ path: `${this.base()}/dashboard/job-groups`,
4502
+ auth: auth2
4503
+ });
4504
+ }
4505
+ /**
4506
+ * The tenant's health thresholds — the error rates above which a stream counts
4507
+ * as degraded or failing in {@link stats}.
4508
+ *
4509
+ * Read-only here: changing them needs `importtool.import_manage`, which this
4510
+ * service does not cover.
4511
+ *
4512
+ * **Preview upstream**: the contract may change without a major bump.
4513
+ */
4514
+ async getHealthThresholds(auth2 = SERVICE22) {
4515
+ return this.ctx.http.request({
4516
+ method: "GET",
4517
+ path: `${this.base()}/settings/health-thresholds`,
4518
+ auth: auth2
4519
+ });
4520
+ }
4521
+ /**
4522
+ * The tenant's import limits and current consumption.
4523
+ *
4524
+ * **Preview upstream**: the contract may change without a major bump.
4525
+ */
4526
+ async getLicense(auth2 = SERVICE22) {
4527
+ return this.ctx.http.request({
4528
+ method: "GET",
4529
+ path: `${this.base()}/license`,
4530
+ auth: auth2
4531
+ });
4532
+ }
4533
+ /**
4534
+ * Retry only the failed records of a finished run.
4535
+ *
4536
+ * Returns a **new** run — the retry is its own run with `retry: true`, not a
4537
+ * mutation of the original. Poll it with {@link getRun} or follow it with
4538
+ * {@link streamRun} exactly as you would a triggered run.
4539
+ *
4540
+ * Not retried on a 5xx, for the same reason {@link triggerRun} is not: a POST
4541
+ * that timed out may already have queued the retry.
4542
+ *
4543
+ * **Preview upstream**: the contract may change without a major bump.
4544
+ */
4545
+ async retryRun(runId, auth2 = SERVICE22) {
4546
+ return this.ctx.http.request({
4547
+ method: "POST",
4548
+ path: `${this.base()}/runs/${encodeURIComponent(runId)}/retry`,
4549
+ auth: auth2
4550
+ });
4551
+ }
4467
4552
  };
4468
4553
 
4469
4554
  // src/services/unit-handling.ts