@viu/emporix-sdk 4.9.4 → 4.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @viu/emporix-sdk
2
2
 
3
+ ## 4.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#448](https://github.com/viuteam/emporix-sdk/pull/448) [`9805297`](https://github.com/viuteam/emporix-sdk/commit/9805297c8e6e959ecbcae7ece4eb146ef5f189ed) Thanks [@amnael1](https://github.com/amnael1)! - feat(sdk): queue a failed import file again, and document customer and legal-entity search
8
+
9
+ `client.imports.requeueStreamFile(streamId, fileId)` puts a `FAILED` file back at the end of a file-based stream's queue, so the next run reads the content the service already holds. It is not retried on a 5xx: a requeue that went through leaves the file `PENDING`, and a repeat answers `409`. The JSDoc of `triggerRun`, `retryRun` and the file-queue types now describes `lastProcessed` and the new `404` / `400` answers.
10
+
11
+ The Search Service accepts `customer` and `legal-entity` as a type besides custom schema types, with the matching read scopes; the `SearchService` JSDoc and the search docs say so, and describe index `analyzers` and `itemFields`. New type alias `SearchIndexAnalyzer`.
12
+
13
+ ### Patch Changes
14
+
15
+ - [#447](https://github.com/viuteam/emporix-sdk/pull/447) [`c2703d9`](https://github.com/viuteam/emporix-sdk/commit/c2703d9c8c0ee61ac7230479c83c49439eef7724) Thanks [@viu-release-bot](https://github.com/apps/viu-release-bot)! - chore(sdk): sync generated types with upstream Emporix API specs
16
+
17
+ Updated services: product,returns,schema
18
+
3
19
  ## 4.9.4
4
20
 
5
21
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1247,7 +1247,7 @@ var HttpClient = class {
1247
1247
  };
1248
1248
 
1249
1249
  // package.json
1250
- var version = "4.9.4";
1250
+ var version = "4.10.0";
1251
1251
 
1252
1252
  // src/version.ts
1253
1253
  var SDK_VERSION = version;
@@ -8523,13 +8523,18 @@ var SearchService = class {
8523
8523
  return `/search/${this.ctx.tenant}`;
8524
8524
  }
8525
8525
  /**
8526
- * Search the documents of one custom schema type. Paging, `sort` and
8527
- * `fields` travel as query parameters, not in the body.
8526
+ * Search the documents of one type — a custom schema type, `customer` or
8527
+ * `legal-entity`. Paging, `sort` and `fields` travel as query parameters, not
8528
+ * in the body.
8528
8529
  *
8529
8530
  * Filter and sort fields must be indexed on the index the search uses —
8530
- * `exact`, or `text: true` for a `CONTAINS` filter — or the call answers `400`. A saved-search call (`{ searchQueryId, query }`) answers
8531
- * `404` when no saved search has that id for `type`, and `502` means the
8532
- * Schema Service could not confirm that `type` is a custom entity.
8531
+ * `exact`, or `text: true` for a `CONTAINS` filter — or the call answers
8532
+ * `400`. A `TEXT` or `PHRASE` query may pick the field's `analyzer` or one of
8533
+ * its `additionalAnalyzers`. Conditions joined by `and` on fields of one
8534
+ * `itemFields` list must match the same list item. A saved-search call
8535
+ * (`{ searchQueryId, query }`) answers `404` when no saved search has that id
8536
+ * for `type`, and `502` means the Schema Service could not confirm that a
8537
+ * custom `type` is a custom entity.
8533
8538
  *
8534
8539
  * @example
8535
8540
  * const hits = await client.search.search("VEHICLE", {
@@ -8554,7 +8559,7 @@ var SearchService = class {
8554
8559
  page
8555
8560
  );
8556
8561
  }
8557
- /** List saved searches of one custom schema type (`opts.type`), or of every type. */
8562
+ /** List saved searches of one type (`opts.type`), or of every type. */
8558
8563
  async listSavedSearches(opts = {}, auth2 = SERVICE29) {
8559
8564
  const { query, page } = pageQuery(opts);
8560
8565
  const t = opts.type;
@@ -8602,7 +8607,7 @@ var SearchService = class {
8602
8607
  auth: auth2
8603
8608
  });
8604
8609
  }
8605
- /** List search indexes of one custom schema type (`opts.type`), or of every type. */
8610
+ /** List search indexes of one type (`opts.type`), or of every type. */
8606
8611
  async listIndexes(opts = {}, auth2 = SERVICE29) {
8607
8612
  const { query, page } = pageQuery(opts);
8608
8613
  const t = opts.type;
@@ -8896,6 +8901,11 @@ var ImportService = class {
8896
8901
  * streams. Read it back with {@link getRun}, or follow it with
8897
8902
  * {@link streamRun}, before treating a resolved call as a started import.
8898
8903
  *
8904
+ * A configuration that does not exist answers `404` (since 2026-11-06; it used
8905
+ * to be a `500`). A real run with nothing to import answers `400`: every stream
8906
+ * it starts from reads uploaded files, and none has ever had one. Upload a file
8907
+ * with {@link uploadStreamFile} first. A dry run is not refused for this.
8908
+ *
8899
8909
  * Not retried on a 5xx: a POST that timed out may already have queued a run.
8900
8910
  *
8901
8911
  * @example
@@ -9146,7 +9156,7 @@ var ImportService = class {
9146
9156
  * {@link streamRun} exactly as you would a triggered run. Like one, it comes
9147
9157
  * back `QUEUED`, answers `409` while the configuration has a run `QUEUED`,
9148
9158
  * `RUNNING` or `RESUMABLE`, runs the published mappings and can finish
9149
- * `ABORTED`.
9159
+ * `ABORTED`. A run that does not exist answers `404`.
9150
9160
  *
9151
9161
  * Not retried on a 5xx, for the same reason {@link triggerRun} is not: a POST
9152
9162
  * that timed out may already have queued the retry.
@@ -9257,6 +9267,29 @@ var ImportService = class {
9257
9267
  auth: auth2
9258
9268
  });
9259
9269
  }
9270
+ /**
9271
+ * Put a `FAILED` file back at the end of the stream's queue, so the next run
9272
+ * reads the content the service already holds — no new upload. Use it after
9273
+ * fixing the cause of the failure, a mapping say. Resolves to the file,
9274
+ * `PENDING` again.
9275
+ *
9276
+ * Only a failed file can be queued again; `409` otherwise. A file imported with
9277
+ * some records failing is `PROCESSED`: retry those records with
9278
+ * {@link retryRun} instead. On a `SNAPSHOT` stream a failed file cannot be
9279
+ * queued again once a newer file arrived, since the older snapshot would be
9280
+ * imported over newer data — upload a corrected current file instead. `409`
9281
+ * also when the stored content is gone, and while the job has a run in flight.
9282
+ *
9283
+ * Not retried on a 5xx: if the first attempt went through, the file is no
9284
+ * longer `FAILED` and a repeat answers `409`.
9285
+ */
9286
+ async requeueStreamFile(streamId, fileId, auth2 = SERVICE30) {
9287
+ return this.ctx.http.request({
9288
+ method: "POST",
9289
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files/${encodeURIComponent(fileId)}/requeue`,
9290
+ auth: auth2
9291
+ });
9292
+ }
9260
9293
  };
9261
9294
 
9262
9295
  // src/services/audit-log.ts