@viu/emporix-sdk 4.8.0 → 4.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @viu/emporix-sdk
2
2
 
3
+ ## 4.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#436](https://github.com/viuteam/emporix-sdk/pull/436) [`aa748b6`](https://github.com/viuteam/emporix-sdk/commit/aa748b610d1b264743ed0fe5f35ec4e7138e4f29) Thanks [@viu-release-bot](https://github.com/apps/viu-release-bot)! - chore(sdk): sync generated types with upstream Emporix API specs
8
+
9
+ Updated services: ai-rag-indexer,ai-service,indexing-service,search-service
10
+
11
+ ## 4.9.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#433](https://github.com/viuteam/emporix-sdk/pull/433) [`989fff3`](https://github.com/viuteam/emporix-sdk/commit/989fff32c4ce0c202c34812f0b3f9b3fac7642da) Thanks [@amnael1](https://github.com/amnael1)! - feat(sdk): manage the file queue of a file-based import stream
16
+
17
+ The Import Service can now read delimited files (CSV and its variants). Five new `client.imports` methods manage a stream's file queue: `listStreamFiles`, `uploadStreamFile` (multipart, `fileName` required), `getStreamFileLimits`, `setStreamFileOrder` and `deleteStreamFile`, with the new types `ImportFile`, `ImportFileStatus`, `ImportFileQueue` and `ImportFileUploadLimits`. An upload is not retried on a 5xx, because the service dedupes on the content hash and a repeat of an upload that went through answers `409`.
18
+
19
+ The vendored spec also brings the reconciled run counters (`collapsed`, `embedded`), `filesRead` / `fileNames` on run streams, `sourceDataset` and `fileMode` on streams, and documented error codes including `CONFIGURATION`, `EXTERNAL_SYSTEM` and `REJECTED_BY_SOURCE`. They arrive through the existing type aliases.
20
+
3
21
  ## 4.8.0
4
22
 
5
23
  ### Minor 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.8.0";
1250
+ var version = "4.9.1";
1251
1251
 
1252
1252
  // src/version.ts
1253
1253
  var SDK_VERSION = version;
@@ -9160,6 +9160,103 @@ var ImportService = class {
9160
9160
  auth: auth2
9161
9161
  });
9162
9162
  }
9163
+ // ─── File queue (upstream release 2026-10-28) ──────────────────────────────
9164
+ /**
9165
+ * A file-based stream's queue: what it still has to import, in load order,
9166
+ * and the files it already dealt with, newest first. `historyLimit` caps
9167
+ * `history` only (1–500, default 100); `pending` comes back whole up to 2000
9168
+ * files — see {@link ImportFileQueue}.
9169
+ */
9170
+ async listStreamFiles(streamId, opts = {}, auth2 = SERVICE30) {
9171
+ const query = {};
9172
+ if (opts.historyLimit !== void 0) query.historyLimit = opts.historyLimit;
9173
+ return this.ctx.http.request({
9174
+ method: "GET",
9175
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files`,
9176
+ query,
9177
+ auth: auth2
9178
+ });
9179
+ }
9180
+ /**
9181
+ * Queue a delimited file (CSV or one of its variants) for a file-based
9182
+ * stream's next run. Nothing is imported by this call — trigger a run for
9183
+ * that.
9184
+ *
9185
+ * `fileName` is required: the service displays it and infers the compression
9186
+ * from it, and a bare `Blob` would otherwise arrive named «blob».
9187
+ *
9188
+ * The service recognises a file by the SHA-256 of its content, whatever its
9189
+ * name, and answers `409` when the stream already imported or queued those
9190
+ * bytes; a file that previously `FAILED` is accepted again. It also answers
9191
+ * `409` when the stream does not read files, or when a run in flight uses
9192
+ * bytes this upload would replace. `413`: the file is over the limit from
9193
+ * {@link getStreamFileLimits}. `503`: uploading is not configured in this
9194
+ * environment.
9195
+ *
9196
+ * Not retried on a 5xx: a request that timed out may have queued the file,
9197
+ * and sending it again would then answer `409`. Check {@link listStreamFiles}
9198
+ * instead.
9199
+ */
9200
+ async uploadStreamFile(streamId, file, fileName, auth2 = SERVICE30) {
9201
+ const fd = new FormData();
9202
+ fd.set("file", file, fileName);
9203
+ return this.ctx.http.request({
9204
+ method: "POST",
9205
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files`,
9206
+ body: fd,
9207
+ auth: auth2
9208
+ });
9209
+ }
9210
+ /**
9211
+ * The largest file this environment accepts, and whether uploading is
9212
+ * available at all — check it to refuse an oversize file before sending it.
9213
+ *
9214
+ * When `gatewayLimited` is `true`, a larger file is refused by the API gateway
9215
+ * with the gateway's own `413` body, before it reaches the service. Publish
9216
+ * such a file at an HTTP(S) URL and set it as the connection's file URL
9217
+ * instead.
9218
+ */
9219
+ async getStreamFileLimits(streamId, auth2 = SERVICE30) {
9220
+ return this.ctx.http.request({
9221
+ method: "GET",
9222
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files/limits`,
9223
+ auth: auth2
9224
+ });
9225
+ }
9226
+ /**
9227
+ * Set the order in which a stream's waiting files are read, and resolve to
9228
+ * the queue in that order. For an `INCREMENTAL` feed the order is the data: a
9229
+ * later file's values win on a key an earlier one also carries, so place an
9230
+ * older export first.
9231
+ *
9232
+ * Takes **every** waiting file's id, in load order — not a single file to
9233
+ * move. A list that is not exactly the waiting set answers `400`. `409` means
9234
+ * the job has a run in flight, or the queue is too long to reorder (the
9235
+ * queue's `pendingTruncated`).
9236
+ */
9237
+ async setStreamFileOrder(streamId, fileIds, auth2 = SERVICE30) {
9238
+ return this.ctx.http.request({
9239
+ method: "PUT",
9240
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files/order`,
9241
+ body: fileIds,
9242
+ auth: auth2
9243
+ });
9244
+ }
9245
+ /**
9246
+ * Remove a waiting file from the queue and delete its stored bytes.
9247
+ *
9248
+ * Only a `PENDING` file can go: a file a run has claimed or already imported
9249
+ * answers `409`, and so does any file while the job has a run in flight. An
9250
+ * imported file stays in the history on purpose — removing it would make the
9251
+ * same bytes importable again.
9252
+ */
9253
+ async deleteStreamFile(streamId, fileId, auth2 = SERVICE30) {
9254
+ await this.ctx.http.request({
9255
+ method: "DELETE",
9256
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files/${encodeURIComponent(fileId)}`,
9257
+ auth: auth2
9258
+ });
9259
+ }
9163
9260
  };
9164
9261
 
9165
9262
  // src/services/audit-log.ts