@putdotio/sdk 9.1.1 → 9.1.2

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
@@ -1,6 +1,6 @@
1
1
  import { A as mapTransportError, C as PutioValidationError, D as makeResponseError, E as fallbackPutioErrorEnvelope, M as responseRateLimitHeaders, N as withOperationErrors, O as mapConfigurationError, S as PutioTransportError, T as definePutioOperationErrorSpec, _ as PutioAuthError, a as buildPutioUrl, b as PutioOperationError, c as requestArrayBuffer, d as selectJsonField, f as selectJsonFields, g as PutioApiError, h as DEFAULT_PUTIO_WEB_APP_URL, i as PutioSdkConfig, j as parseErrorBody, k as mapDecodeErrorToValidationError, l as requestJson, m as DEFAULT_PUTIO_UPLOAD_BASE_URL, n as toCursorSelectionForm, o as makePutioSdkConfig, p as DEFAULT_PUTIO_API_BASE_URL, r as OkResponseSchema, s as makePutioSdkLayer, t as joinCsv, u as requestVoid, v as PutioConfigurationError, w as decodePutioErrorEnvelope, x as PutioRateLimitError, y as PutioErrorEnvelopeSchema } from "./forms-DM_sjuyz.js";
2
2
  import { FetchHttpClient } from "@effect/platform";
3
- import { Effect, Layer, ManagedRuntime, Schema } from "effect";
3
+ import { Cause, Effect, Exit, Layer, ManagedRuntime, Option, Schema } from "effect";
4
4
  //#region src/domains/account.ts
5
5
  const RequestedFlag$1 = Schema.Literal(1);
6
6
  const AccountDiskSchema = Schema.Struct({
@@ -4390,7 +4390,15 @@ const disposePromiseClientRuntime = async (config) => {
4390
4390
  if (!runtime) return;
4391
4391
  await runtime.dispose();
4392
4392
  };
4393
- const provideSdk = async (config, effect) => getPromiseClientRuntime(config).runPromise(effect);
4393
+ const rejectWithSdkFailure = (exit) => Exit.match(exit, {
4394
+ onSuccess: (value) => Promise.resolve(value),
4395
+ onFailure: (cause) => {
4396
+ const failure = Cause.failureOption(cause);
4397
+ if (Option.isSome(failure)) return Promise.reject(failure.value);
4398
+ return Promise.reject(Cause.squash(cause));
4399
+ }
4400
+ });
4401
+ const provideSdk = async (config, effect) => rejectWithSdkFailure(await getPromiseClientRuntime(config).runPromiseExit(effect));
4394
4402
  const createPutioSdkEffectClient = () => ({
4395
4403
  account: {
4396
4404
  clear: clearAccount,