@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/dist/index.js CHANGED
@@ -948,7 +948,7 @@ var HttpClient = class {
948
948
  };
949
949
 
950
950
  // package.json
951
- var version = "4.8.0";
951
+ var version = "4.9.1";
952
952
 
953
953
  // src/version.ts
954
954
  var SDK_VERSION = version;
@@ -5001,6 +5001,103 @@ var ImportService = class {
5001
5001
  auth: auth2
5002
5002
  });
5003
5003
  }
5004
+ // ─── File queue (upstream release 2026-10-28) ──────────────────────────────
5005
+ /**
5006
+ * A file-based stream's queue: what it still has to import, in load order,
5007
+ * and the files it already dealt with, newest first. `historyLimit` caps
5008
+ * `history` only (1–500, default 100); `pending` comes back whole up to 2000
5009
+ * files — see {@link ImportFileQueue}.
5010
+ */
5011
+ async listStreamFiles(streamId, opts = {}, auth2 = SERVICE23) {
5012
+ const query = {};
5013
+ if (opts.historyLimit !== void 0) query.historyLimit = opts.historyLimit;
5014
+ return this.ctx.http.request({
5015
+ method: "GET",
5016
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files`,
5017
+ query,
5018
+ auth: auth2
5019
+ });
5020
+ }
5021
+ /**
5022
+ * Queue a delimited file (CSV or one of its variants) for a file-based
5023
+ * stream's next run. Nothing is imported by this call — trigger a run for
5024
+ * that.
5025
+ *
5026
+ * `fileName` is required: the service displays it and infers the compression
5027
+ * from it, and a bare `Blob` would otherwise arrive named «blob».
5028
+ *
5029
+ * The service recognises a file by the SHA-256 of its content, whatever its
5030
+ * name, and answers `409` when the stream already imported or queued those
5031
+ * bytes; a file that previously `FAILED` is accepted again. It also answers
5032
+ * `409` when the stream does not read files, or when a run in flight uses
5033
+ * bytes this upload would replace. `413`: the file is over the limit from
5034
+ * {@link getStreamFileLimits}. `503`: uploading is not configured in this
5035
+ * environment.
5036
+ *
5037
+ * Not retried on a 5xx: a request that timed out may have queued the file,
5038
+ * and sending it again would then answer `409`. Check {@link listStreamFiles}
5039
+ * instead.
5040
+ */
5041
+ async uploadStreamFile(streamId, file, fileName, auth2 = SERVICE23) {
5042
+ const fd = new FormData();
5043
+ fd.set("file", file, fileName);
5044
+ return this.ctx.http.request({
5045
+ method: "POST",
5046
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files`,
5047
+ body: fd,
5048
+ auth: auth2
5049
+ });
5050
+ }
5051
+ /**
5052
+ * The largest file this environment accepts, and whether uploading is
5053
+ * available at all — check it to refuse an oversize file before sending it.
5054
+ *
5055
+ * When `gatewayLimited` is `true`, a larger file is refused by the API gateway
5056
+ * with the gateway's own `413` body, before it reaches the service. Publish
5057
+ * such a file at an HTTP(S) URL and set it as the connection's file URL
5058
+ * instead.
5059
+ */
5060
+ async getStreamFileLimits(streamId, auth2 = SERVICE23) {
5061
+ return this.ctx.http.request({
5062
+ method: "GET",
5063
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files/limits`,
5064
+ auth: auth2
5065
+ });
5066
+ }
5067
+ /**
5068
+ * Set the order in which a stream's waiting files are read, and resolve to
5069
+ * the queue in that order. For an `INCREMENTAL` feed the order is the data: a
5070
+ * later file's values win on a key an earlier one also carries, so place an
5071
+ * older export first.
5072
+ *
5073
+ * Takes **every** waiting file's id, in load order — not a single file to
5074
+ * move. A list that is not exactly the waiting set answers `400`. `409` means
5075
+ * the job has a run in flight, or the queue is too long to reorder (the
5076
+ * queue's `pendingTruncated`).
5077
+ */
5078
+ async setStreamFileOrder(streamId, fileIds, auth2 = SERVICE23) {
5079
+ return this.ctx.http.request({
5080
+ method: "PUT",
5081
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files/order`,
5082
+ body: fileIds,
5083
+ auth: auth2
5084
+ });
5085
+ }
5086
+ /**
5087
+ * Remove a waiting file from the queue and delete its stored bytes.
5088
+ *
5089
+ * Only a `PENDING` file can go: a file a run has claimed or already imported
5090
+ * answers `409`, and so does any file while the job has a run in flight. An
5091
+ * imported file stays in the history on purpose — removing it would make the
5092
+ * same bytes importable again.
5093
+ */
5094
+ async deleteStreamFile(streamId, fileId, auth2 = SERVICE23) {
5095
+ await this.ctx.http.request({
5096
+ method: "DELETE",
5097
+ path: `${this.base()}/streams/${encodeURIComponent(streamId)}/files/${encodeURIComponent(fileId)}`,
5098
+ auth: auth2
5099
+ });
5100
+ }
5004
5101
  };
5005
5102
 
5006
5103
  // src/services/audit-log.ts