@settlemint/dalp-cli 3.1.18-main.34455919642 → 3.1.18-main.34460939478

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/dalp.js CHANGED
@@ -41218,7 +41218,7 @@ async function* decodeEventStream(body) {
41218
41218
  await reader.cancel().catch(() => {});
41219
41219
  }
41220
41220
  }
41221
- async function* streamRequest(transport, route, input, options) {
41221
+ async function* openEventStream(transport, route, input, options, signal, closed) {
41222
41222
  const prepared = prepareRequest(transport, route, input, options);
41223
41223
  prepared.headers.set("Accept", "text/event-stream");
41224
41224
  const response = await transport.fetch(prepared.url, {
@@ -41226,7 +41226,7 @@ async function* streamRequest(transport, route, input, options) {
41226
41226
  headers: prepared.headers,
41227
41227
  credentials: transport.credentials,
41228
41228
  ...prepared.body === undefined ? {} : { body: prepared.body },
41229
- ...options?.signal === undefined ? {} : { signal: options.signal }
41229
+ signal
41230
41230
  });
41231
41231
  if (!response.ok) {
41232
41232
  await readResponse(response);
@@ -41235,7 +41235,48 @@ async function* streamRequest(transport, route, input, options) {
41235
41235
  if (response.body === null) {
41236
41236
  return;
41237
41237
  }
41238
- yield* decodeEventStream(response.body);
41238
+ try {
41239
+ yield* decodeEventStream(response.body);
41240
+ } catch (error) {
41241
+ if (!closed.byConsumer) {
41242
+ throw error;
41243
+ }
41244
+ }
41245
+ }
41246
+ function streamRequest(transport, route, input, options) {
41247
+ const closing = new AbortController;
41248
+ const callerSignal = options?.signal;
41249
+ if (callerSignal !== undefined) {
41250
+ if (callerSignal.aborted) {
41251
+ closing.abort(callerSignal.reason);
41252
+ } else {
41253
+ callerSignal.addEventListener("abort", () => closing.abort(callerSignal.reason), { once: true });
41254
+ }
41255
+ }
41256
+ const closed = { byConsumer: false };
41257
+ const frames = openEventStream(transport, route, input, options, closing.signal, closed);
41258
+ const close = () => {
41259
+ closed.byConsumer = true;
41260
+ closing.abort();
41261
+ };
41262
+ return {
41263
+ [Symbol.asyncIterator]() {
41264
+ return this;
41265
+ },
41266
+ next: (...args) => frames.next(...args),
41267
+ return: (value) => {
41268
+ close();
41269
+ return frames.return(value);
41270
+ },
41271
+ throw: (error) => {
41272
+ close();
41273
+ return frames.throw(error);
41274
+ },
41275
+ async[Symbol.asyncDispose]() {
41276
+ close();
41277
+ await frames.return(undefined);
41278
+ }
41279
+ };
41239
41280
  }
41240
41281
 
41241
41282
  // ../sdk/src/proxy/fetch-executor.ts
@@ -41318,7 +41359,7 @@ var WEBHOOK_MANIFEST_VERSION = Webhook.MANIFEST_VERSION;
41318
41359
  // ../sdk/package.json
41319
41360
  var package_default = {
41320
41361
  name: "@settlemint/dalp-sdk",
41321
- version: "3.1.18-main.34455919642",
41362
+ version: "3.1.18-main.34460939478",
41322
41363
  private: false,
41323
41364
  description: "Fully typed SDK for the DALP tokenization platform API",
41324
41365
  homepage: "https://settlemint.com",
@@ -109982,7 +110023,7 @@ async function runCommand(context, operation, errorContext = UNKNOWN_COMMAND_ERR
109982
110023
  // package.json
109983
110024
  var package_default2 = {
109984
110025
  name: "@settlemint/dalp-cli",
109985
- version: "3.1.18-main.34455919642",
110026
+ version: "3.1.18-main.34460939478",
109986
110027
  private: false,
109987
110028
  description: "CLI for the Digital Asset Lifecycle Platform \u2014 manage tokens, identities, compliance, and more from the command line.",
109988
110029
  homepage: "https://settlemint.com",
@@ -111306,4 +111347,4 @@ if (false) {}
111306
111347
  // src/bin.ts
111307
111348
  await cli.serve();
111308
111349
 
111309
- //# debugId=FA0AAC2B798D850264756E2164756E21
111350
+ //# debugId=1E2143C3DE66A04D64756E2164756E21