@putdotio/sdk 13.3.1 → 14.0.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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { A as PutioOperationError, B as isPutioOperationError, C as DEFAULT_PUTIO_API_BASE_URL, D as PutioAuthError, E as PutioApiError, F as definePutioOperationErrorSpec, G as mapTransportError, H as makeResponseError, I as fallbackPutioErrorEnvelope, J as withOperationErrors, K as parseErrorBody, L as isPutioApiError, M as PutioTransportError, N as PutioValidationError, O as PutioConfigurationError, P as decodePutioErrorEnvelope, R as isPutioAuthError, S as selectJsonFields, T as DEFAULT_PUTIO_WEB_APP_URL, U as mapConfigurationError, V as isPutioRateLimitError, W as mapDecodeErrorToValidationError, _ as requestArrayBuffer, a as decodeAndRun, b as requestVoid, c as PutioHttpClient, d as encodePathSegment, f as makePutioFetchClient, g as makePutioSdkLiveLayer, h as makePutioSdkLayer, i as PositiveIntegerSchema, j as PutioRateLimitError, k as PutioErrorEnvelopeSchema, l as PutioSdkConfig, m as makePutioSdkConfig, n as toCursorSelectionForm, o as makeCursorSelectionSchema, p as makePutioFetchLayer, q as responseRateLimitHeaders, r as NonEmptyStringSchema, s as OkResponseSchema, t as joinCsv, u as buildPutioUrl, v as requestJson, w as DEFAULT_PUTIO_UPLOAD_BASE_URL, x as selectJsonField, y as requestText, z as isPutioErrorEnvelope } from "./forms-DnapntwW.js";
2
- import { Cause, Context, Effect, Exit, Layer, ManagedRuntime, Schema, SchemaIssue, SchemaParser } from "effect";
3
- //#region src/domains/account.ts
1
+ import { A as PutioOperationError, B as isPutioOperationError, C as PositiveIntegerSchema, D as PutioAuthError, E as PutioApiError, F as definePutioOperationErrorSpec, G as parseErrorBody, H as mapConfigurationError, I as fallbackPutioErrorEnvelope, J as withOperationErrors, K as responseRateLimitHeaders, L as isPutioApiError, M as PutioTransportError, N as PutioValidationError, O as PutioConfigurationError, P as decodePutioErrorEnvelope, R as isPutioAuthError, S as NonEmptyStringSchema, T as decodeAndRun, U as mapDecodeErrorToValidationError, V as isPutioRateLimitError, W as mapTransportError, _ as selectJsonField, a as PutioSdkConfig, b as DEFAULT_PUTIO_UPLOAD_BASE_URL, c as makePutioFetchClient, d as putioSdkLayer, f as putioSdkLiveLayer, g as requestVoid, h as requestText, i as PutioHttpClient, j as PutioRateLimitError, k as PutioErrorEnvelopeSchema, l as makePutioFetchLayer, m as requestJson, n as toCursorSelectionForm, o as buildPutioUrl, p as requestArrayBuffer, q as toPutioResponseError, r as OkResponseSchema, s as encodePathSegment, t as joinCsv, u as normalizePutioSdkOptions, v as selectJsonFields, w as cursorSelectionSchema, x as DEFAULT_PUTIO_WEB_APP_URL, y as DEFAULT_PUTIO_API_BASE_URL, z as isPutioErrorEnvelope } from "./forms-B9-NYUR5.js";
2
+ import { Context, Effect, Layer, ManagedRuntime, Predicate, Schema, SchemaIssue, SchemaParser, Struct } from "effect";
3
+ // src/domains/account.ts
4
4
  const RequestedFlag$1 = Schema.Literal(1);
5
5
  const AccountDiskSchema = Schema.Struct({
6
6
  avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
@@ -180,26 +180,19 @@ const AccountConfirmationsEnvelopeSchema = Schema.Struct({
180
180
  confirmations: Schema.Array(AccountConfirmationSchema),
181
181
  status: Schema.Literal("OK")
182
182
  });
183
- const missingFieldError$1 = (field) => new PutioValidationError({ cause: `Expected put.io to include "${field}" because it was requested` });
184
- const failMissingField$1 = (field) => Effect.fail(missingFieldError$1(field));
185
- const widenValidationError$1 = (effect) => effect;
183
+ const failMissingField$1 = (field) => Effect.fail(new PutioValidationError({ cause: `Expected put.io to include "${field}" because it was requested` }));
186
184
  const mapSensitiveAccountDecodeError = (operation) => () => new PutioValidationError({ cause: {
187
185
  domain: "account",
188
186
  operation,
189
187
  reason: "Invalid request input"
190
188
  } });
191
- const hasDownloadToken = (value) => typeof value.download_token === "string";
192
- const hasFeatures = (value) => typeof value.features === "object" && value.features !== null;
193
- const hasPas = (value) => typeof value.pas === "object" && value.pas !== null && typeof value.pas.user_hash === "string";
194
- const hasPaddleUserId = (value) => "paddle_user_id" in value;
195
- const hasPushToken = (value) => typeof value.push_token === "string";
196
189
  const ensureAccountInfoFields = (effect, query) => Effect.gen(function* () {
197
- const info = yield* widenValidationError$1(effect);
198
- if (query.download_token === 1 && !hasDownloadToken(info)) return yield* failMissingField$1("download_token");
199
- if (query.features === 1 && !hasFeatures(info)) return yield* failMissingField$1("features");
200
- if (query.pas === 1 && !hasPas(info)) return yield* failMissingField$1("pas");
201
- if (query.profitwell === 1 && !hasPaddleUserId(info)) return yield* failMissingField$1("paddle_user_id");
202
- if (query.push_token === 1 && !hasPushToken(info)) return yield* failMissingField$1("push_token");
190
+ const info = yield* effect;
191
+ if (query.download_token === 1 && info.download_token === void 0) return yield* failMissingField$1("download_token");
192
+ if (query.features === 1 && info.features === void 0) return yield* failMissingField$1("features");
193
+ if (query.pas === 1 && info.pas === void 0) return yield* failMissingField$1("pas");
194
+ if (query.profitwell === 1 && !("paddle_user_id" in info)) return yield* failMissingField$1("paddle_user_id");
195
+ if (query.push_token === 1 && info.push_token === void 0) return yield* failMissingField$1("push_token");
203
196
  return info;
204
197
  });
205
198
  const SaveAccountSettingsErrorSpec = definePutioOperationErrorSpec({
@@ -289,14 +282,14 @@ const AccountConfirmationsErrorSpec = definePutioOperationErrorSpec({
289
282
  }]
290
283
  });
291
284
  function getAccountInfo(query = {}) {
292
- return Schema.decodeUnknownEffect(AccountInfoQuerySchema, { onExcessProperty: "error" })(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => {
285
+ return decodeAndRun(AccountInfoQuerySchema, query, (decodedQuery) => {
293
286
  const effect = requestJson(AccountInfoEnvelopeSchema, {
294
287
  method: "GET",
295
288
  path: "/v2/account/info",
296
289
  query: decodedQuery
297
290
  }).pipe(selectJsonField("info"));
298
291
  return ensureAccountInfoFields(effect, decodedQuery);
299
- }));
292
+ });
300
293
  }
301
294
  const getAccountSettings = () => requestJson(AccountSettingsEnvelopeSchema, {
302
295
  method: "GET",
@@ -314,14 +307,14 @@ const saveAccountSettings = (payload) => Schema.decodeUnknownEffect(SaveAccountS
314
307
  method: "POST",
315
308
  path: "/v2/account/settings"
316
309
  })), withOperationErrors(SaveAccountSettingsErrorSpec));
317
- const clearAccount = (options) => Schema.decodeUnknownEffect(AccountClearOptionsSchema, { onExcessProperty: "error" })(options).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedOptions) => requestJson(OkResponseSchema, {
310
+ const clearAccount = (options) => decodeAndRun(AccountClearOptionsSchema, options, (decodedOptions) => requestJson(OkResponseSchema, {
318
311
  body: {
319
312
  type: "form",
320
313
  value: decodedOptions
321
314
  },
322
315
  method: "POST",
323
316
  path: "/v2/account/clear"
324
- })));
317
+ }));
325
318
  const destroyAccount = (currentPassword) => Schema.decodeUnknownEffect(Schema.String.check(Schema.isMinLength(1)))(currentPassword).pipe(Effect.mapError(mapSensitiveAccountDecodeError("destroy")), Effect.flatMap((decodedPassword) => requestJson(OkResponseSchema, {
326
319
  body: {
327
320
  type: "form",
@@ -330,13 +323,12 @@ const destroyAccount = (currentPassword) => Schema.decodeUnknownEffect(Schema.St
330
323
  method: "POST",
331
324
  path: "/v2/account/destroy"
332
325
  })));
333
- const listAccountConfirmations = (subject) => Schema.decodeUnknownEffect(Schema.UndefinedOr(AccountConfirmationSubjectSchema))(subject).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedSubject) => requestJson(AccountConfirmationsEnvelopeSchema, {
326
+ const listAccountConfirmations = (subject) => decodeAndRun(Schema.UndefinedOr(AccountConfirmationSubjectSchema), subject, (decodedSubject) => requestJson(AccountConfirmationsEnvelopeSchema, {
334
327
  method: "GET",
335
328
  path: "/v2/account/confirmation/list",
336
329
  query: decodedSubject ? { type: decodedSubject } : void 0
337
- })), selectJsonField("confirmations"), withOperationErrors(AccountConfirmationsErrorSpec));
338
- //#endregion
339
- //#region src/domains/app-specific-passwords.ts
330
+ })).pipe(selectJsonField("confirmations"), withOperationErrors(AccountConfirmationsErrorSpec));
331
+ // src/domains/app-specific-passwords.ts
340
332
  const AppSpecificPasswordIdSchema = Schema.Int.check(Schema.isGreaterThan(0));
341
333
  const AppSpecificPasswordNoteSchema = Schema.Trim.check(Schema.isMinLength(1), Schema.isMaxLength(255));
342
334
  const MaskedIpv4AddressPattern = /^(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}XXX$/;
@@ -405,43 +397,41 @@ const DeleteAllAppSpecificPasswordsErrorSpec = definePutioOperationErrorSpec({
405
397
  operation: "appSpecificPasswords.deleteAll",
406
398
  knownErrors: [RestrictedAppSpecificPasswordError]
407
399
  });
408
- const createAppSpecificPassword = (input) => Schema.decodeUnknownEffect(CreateAppSpecificPasswordInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(CreateAppSpecificPasswordEnvelopeSchema, {
400
+ const createAppSpecificPassword = (input) => decodeAndRun(CreateAppSpecificPasswordInputSchema, input, (decodedInput) => requestJson(CreateAppSpecificPasswordEnvelopeSchema, {
409
401
  body: {
410
402
  type: "form",
411
403
  value: decodedInput
412
404
  },
413
405
  method: "POST",
414
406
  path: "/v2/app_specific_password/create"
415
- })), selectJsonFields("created_at", "id", "ip_address", "last_used_at", "note", "password"), withOperationErrors(CreateAppSpecificPasswordErrorSpec));
407
+ })).pipe(selectJsonFields("created_at", "id", "ip_address", "last_used_at", "note", "password"), withOperationErrors(CreateAppSpecificPasswordErrorSpec));
416
408
  const listAppSpecificPasswords = () => requestJson(ListAppSpecificPasswordsEnvelopeSchema, {
417
409
  method: "GET",
418
410
  path: "/v2/app_specific_password/list"
419
411
  }).pipe(selectJsonField("passwords"), withOperationErrors(ListAppSpecificPasswordsErrorSpec));
420
- const deleteAppSpecificPassword = (id) => Schema.decodeUnknownEffect(AppSpecificPasswordIdSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
412
+ const deleteAppSpecificPassword = (id) => decodeAndRun(AppSpecificPasswordIdSchema, id, (decodedId) => requestJson(OkResponseSchema, {
421
413
  method: "POST",
422
414
  path: `/v2/app_specific_password/${encodePathSegment(decodedId)}/delete`
423
- })), Effect.asVoid, withOperationErrors(DeleteAppSpecificPasswordErrorSpec));
415
+ })).pipe(Effect.asVoid, withOperationErrors(DeleteAppSpecificPasswordErrorSpec));
424
416
  const deleteAllAppSpecificPasswords = () => requestJson(OkResponseSchema, {
425
417
  method: "POST",
426
418
  path: "/v2/app_specific_password/delete_all"
427
419
  }).pipe(Effect.asVoid, withOperationErrors(DeleteAllAppSpecificPasswordsErrorSpec));
428
- //#endregion
429
- //#region src/domains/oauth.ts
430
- const OAuthAppBaseSchema = Schema.Struct({
420
+ // src/domains/oauth.ts
421
+ const OAuthAppSchema = Schema.Struct({
431
422
  description: Schema.String,
432
423
  has_icon: Schema.NullOr(Schema.Boolean),
433
424
  id: Schema.Int,
434
425
  name: Schema.String,
435
426
  website: Schema.String
436
427
  });
437
- const OAuthAppSchema = OAuthAppBaseSchema;
438
- const OwnedOAuthAppSchema = OAuthAppBaseSchema.pipe(Schema.fieldsAssign({
428
+ const OwnedOAuthAppSchema = OAuthAppSchema.pipe(Schema.fieldsAssign({
439
429
  callback: Schema.String,
440
430
  hidden: Schema.Boolean,
441
431
  secret: Schema.String
442
432
  }));
443
433
  const MyOAuthAppSchema = OwnedOAuthAppSchema.pipe(Schema.fieldsAssign({ users: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)) }));
444
- const PopularOAuthAppSchema = OAuthAppBaseSchema.pipe(Schema.fieldsAssign({
434
+ const PopularOAuthAppSchema = OAuthAppSchema.pipe(Schema.fieldsAssign({
445
435
  hidden: Schema.optional(Schema.Boolean),
446
436
  maker: Schema.String,
447
437
  users: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))
@@ -581,66 +571,63 @@ const queryOAuthApps = () => requestJson(OAuthAppsEnvelopeSchema, {
581
571
  method: "GET",
582
572
  path: "/v2/oauth/apps"
583
573
  }).pipe(selectJsonField("apps"), withOperationErrors(QueryOAuthAppsErrorSpec));
584
- const getOAuthApp = (id, options) => Schema.decodeUnknownEffect(Schema.Struct({
574
+ const getOAuthApp = (id, options) => decodeAndRun(Schema.Struct({
585
575
  id: OAuthAppIdSchema,
586
576
  options: Schema.optional(Schema.Struct({ edit: Schema.optional(Schema.Boolean) }))
587
- }), { onExcessProperty: "error" })({
577
+ }), {
588
578
  id,
589
579
  options
590
- }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppWithTokenSchema, {
580
+ }, (decodedInput) => requestJson(OAuthAppWithTokenSchema, {
591
581
  method: "GET",
592
582
  path: decodedInput.options?.edit ? `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/edit` : `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`
593
- })), withOperationErrors(GetOAuthAppErrorSpec));
594
- const setOAuthAppIcon = (id, input) => {
595
- return Schema.decodeUnknownEffect(Schema.Struct({
596
- id: OAuthAppIdSchema,
597
- input: OAuthSetIconInputSchema
598
- }), { onExcessProperty: "error" })({
599
- id,
600
- input
601
- }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => {
602
- const formData = new FormData();
603
- formData.append("icon", decodedInput.input.icon);
604
- return requestJson(OkResponseSchema, {
605
- body: {
606
- type: "form-data",
607
- value: formData
608
- },
609
- method: "POST",
610
- path: `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/icon`
611
- });
612
- }));
613
- };
614
- const createOAuthApp = (input) => Schema.decodeUnknownEffect(OAuthAppCreateInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppEnvelopeSchema, {
583
+ })).pipe(withOperationErrors(GetOAuthAppErrorSpec));
584
+ const setOAuthAppIcon = (id, input) => decodeAndRun(Schema.Struct({
585
+ id: OAuthAppIdSchema,
586
+ input: OAuthSetIconInputSchema
587
+ }), {
588
+ id,
589
+ input
590
+ }, (decodedInput) => {
591
+ const formData = new FormData();
592
+ formData.append("icon", decodedInput.input.icon);
593
+ return requestJson(OkResponseSchema, {
594
+ body: {
595
+ type: "form-data",
596
+ value: formData
597
+ },
598
+ method: "POST",
599
+ path: `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/icon`
600
+ });
601
+ });
602
+ const createOAuthApp = (input) => decodeAndRun(OAuthAppCreateInputSchema, input, (decodedInput) => requestJson(OAuthAppEnvelopeSchema, {
615
603
  body: {
616
604
  type: "form-data",
617
605
  value: makeCreateOAuthAppFormData(decodedInput)
618
606
  },
619
607
  method: "POST",
620
608
  path: "/v2/oauth/apps/register"
621
- })), withOperationErrors(CreateOAuthAppErrorSpec));
622
- const updateOAuthApp = (input) => Schema.decodeUnknownEffect(OAuthAppUpdateInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppWithTokenSchema, {
609
+ })).pipe(withOperationErrors(CreateOAuthAppErrorSpec));
610
+ const updateOAuthApp = (input) => decodeAndRun(OAuthAppUpdateInputSchema, input, (decodedInput) => requestJson(OAuthAppWithTokenSchema, {
623
611
  body: {
624
612
  type: "form-data",
625
613
  value: makeUpdateOAuthAppFormData(decodedInput)
626
614
  },
627
615
  method: "POST",
628
616
  path: `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`
629
- })), withOperationErrors(UpdateOAuthAppErrorSpec));
630
- const deleteOAuthApp = (id) => Schema.decodeUnknownEffect(OAuthAppIdSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
617
+ })).pipe(withOperationErrors(UpdateOAuthAppErrorSpec));
618
+ const deleteOAuthApp = (id) => decodeAndRun(OAuthAppIdSchema, id, (decodedId) => requestJson(OkResponseSchema, {
631
619
  method: "POST",
632
620
  path: `/v2/oauth/apps/${encodePathSegment(decodedId)}/delete`
633
- })), withOperationErrors(DeleteOAuthAppErrorSpec));
634
- const regenerateOAuthAppToken = (id) => Schema.decodeUnknownEffect(OAuthAppIdSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OAuthRegeneratedTokenEnvelopeSchema, {
621
+ })).pipe(withOperationErrors(DeleteOAuthAppErrorSpec));
622
+ const regenerateOAuthAppToken = (id) => decodeAndRun(OAuthAppIdSchema, id, (decodedId) => requestJson(OAuthRegeneratedTokenEnvelopeSchema, {
635
623
  method: "POST",
636
624
  path: `/v2/oauth/apps/${encodePathSegment(decodedId)}/regenerate_token`
637
- })), selectJsonField("access_token"), withOperationErrors(RegenerateOAuthAppTokenErrorSpec));
625
+ })).pipe(selectJsonField("access_token"), withOperationErrors(RegenerateOAuthAppTokenErrorSpec));
638
626
  const getPopularOAuthApps = () => requestJson(PopularOAuthAppsEnvelopeSchema, {
639
627
  method: "GET",
640
628
  path: "/v2/oauth/apps/popular"
641
629
  }).pipe(selectJsonField("apps"));
642
- //#endregion
643
- //#region src/domains/auth.ts
630
+ // src/domains/auth.ts
644
631
  const LoginResponseSchema = Schema.Struct({
645
632
  access_token: Schema.String,
646
633
  user_id: Schema.Int
@@ -689,11 +676,7 @@ const AuthorizationCodeSchema = Schema.Struct({
689
676
  code: Schema.String,
690
677
  qr_code_url: Schema.String
691
678
  });
692
- const AuthorizationCodeEnvelopeSchema = Schema.Struct({
693
- code: Schema.String,
694
- qr_code_url: Schema.String,
695
- status: Schema.Literal("OK")
696
- });
679
+ const AuthorizationCodeEnvelopeSchema = AuthorizationCodeSchema.pipe(Schema.fieldsAssign({ status: Schema.Literal("OK") }));
697
680
  const CodeMatchEnvelopeSchema = Schema.Struct({
698
681
  oauth_token: Schema.NullOr(Schema.String),
699
682
  status: Schema.Literal("OK")
@@ -746,21 +729,12 @@ const ExistsEnvelopeSchema = Schema.Struct({
746
729
  exists: Schema.Boolean,
747
730
  status: Schema.Literal("OK")
748
731
  });
749
- const ResetPasswordEnvelopeSchema = Schema.Struct({
732
+ const AccessTokenEnvelopeSchema = Schema.Struct({
750
733
  access_token: Schema.String,
751
734
  status: Schema.Literal("OK")
752
735
  });
753
- const GenerateTOTPEnvelopeSchema = Schema.Struct({
754
- recovery_codes: TwoFactorRecoveryCodesSchema,
755
- secret: Schema.String,
756
- status: Schema.Literal("OK"),
757
- uri: Schema.String
758
- });
759
- const VerifyTOTPEnvelopeSchema = Schema.Struct({
760
- status: Schema.Literal("OK"),
761
- token: Schema.String,
762
- user_id: Schema.Int
763
- });
736
+ const GenerateTOTPEnvelopeSchema = GenerateTOTPResponseSchema.pipe(Schema.fieldsAssign({ status: Schema.Literal("OK") }));
737
+ const VerifyTOTPEnvelopeSchema = VerifyTOTPResponseSchema.pipe(Schema.fieldsAssign({ status: Schema.Literal("OK") }));
764
738
  const RecoveryCodesEnvelopeSchema = Schema.Struct({
765
739
  recovery_codes: TwoFactorRecoveryCodesSchema,
766
740
  status: Schema.Literal("OK")
@@ -1097,7 +1071,7 @@ const logout = () => requestJson(OkResponseSchema, {
1097
1071
  method: "POST",
1098
1072
  path: "/v2/oauth/grants/logout"
1099
1073
  });
1100
- const register = (input) => decodeAuthInput("register", RegisterInputSchema, input, (decodedInput) => requestJson(ResetPasswordEnvelopeSchema, {
1074
+ const register = (input) => decodeAuthInput("register", RegisterInputSchema, input, (decodedInput) => requestJson(AccessTokenEnvelopeSchema, {
1101
1075
  auth: { type: "none" },
1102
1076
  body: {
1103
1077
  type: "form",
@@ -1147,7 +1121,7 @@ const forgotPassword = (mail) => decodeAuthInput("forgotPassword", NonEmptyStrin
1147
1121
  const resetPassword = (key, password) => decodeAuthInput("resetPassword", AuthResetPasswordInputSchema, {
1148
1122
  key,
1149
1123
  password
1150
- }, (decodedInput) => requestJson(ResetPasswordEnvelopeSchema, {
1124
+ }, (decodedInput) => requestJson(AccessTokenEnvelopeSchema, {
1151
1125
  auth: { type: "none" },
1152
1126
  body: {
1153
1127
  type: "form",
@@ -1207,11 +1181,7 @@ const validateToken = (token) => decodeAuthInput("validateToken", NonEmptyString
1207
1181
  const generateTOTP = () => requestJson(GenerateTOTPEnvelopeSchema, {
1208
1182
  method: "POST",
1209
1183
  path: "/v2/two_factor/generate/totp"
1210
- }).pipe(Effect.map(({ recovery_codes, secret, uri }) => ({
1211
- recovery_codes,
1212
- secret,
1213
- uri
1214
- })), withOperationErrors(GenerateTOTPErrorSpec));
1184
+ }).pipe(selectJsonFields("recovery_codes", "secret", "uri"), withOperationErrors(GenerateTOTPErrorSpec));
1215
1185
  const verifyTOTP = (twoFactorScopedToken, code) => decodeAuthInput("verifyTOTP", AuthVerifyTotpInputSchema, {
1216
1186
  code,
1217
1187
  twoFactorScopedToken
@@ -1224,10 +1194,7 @@ const verifyTOTP = (twoFactorScopedToken, code) => decodeAuthInput("verifyTOTP",
1224
1194
  method: "POST",
1225
1195
  path: "/v2/two_factor/verify/totp",
1226
1196
  query: { oauth_token: decodedInput.twoFactorScopedToken }
1227
- }).pipe(Effect.map(({ token, user_id }) => ({
1228
- token,
1229
- user_id
1230
- })))).pipe(withOperationErrors(VerifyTOTPErrorSpec));
1197
+ }).pipe(selectJsonFields("token", "user_id"))).pipe(withOperationErrors(VerifyTOTPErrorSpec));
1231
1198
  const getRecoveryCodes = () => requestJson(RecoveryCodesEnvelopeSchema, {
1232
1199
  method: "GET",
1233
1200
  path: "/v2/two_factor/recovery_codes"
@@ -1236,154 +1203,109 @@ const regenerateRecoveryCodes = () => requestJson(RecoveryCodesEnvelopeSchema, {
1236
1203
  method: "POST",
1237
1204
  path: "/v2/two_factor/recovery_codes/refresh"
1238
1205
  }).pipe(selectJsonField("recovery_codes"), withOperationErrors(RegenerateRecoveryCodesErrorSpec));
1239
- //#endregion
1240
- //#region src/domains/config.ts
1206
+ // src/domains/config.ts
1241
1207
  const nativeObjectConstructorSource = Function.prototype.toString.call(Object);
1242
1208
  const nativeArrayConstructorSource = Function.prototype.toString.call(Array);
1243
- const hasMatchingNativeConstructor = (prototype, constructorSource) => {
1209
+ const isNativePrototype = (prototype, constructorSource) => {
1244
1210
  const constructor = Object.getOwnPropertyDescriptor(prototype, "constructor")?.value;
1245
- const constructorPrototype = typeof constructor === "function" ? Object.getOwnPropertyDescriptor(constructor, "prototype")?.value : void 0;
1246
- return typeof constructor === "function" && constructorPrototype === prototype && Function.prototype.toString.call(constructor) === constructorSource;
1211
+ return Predicate.isFunction(constructor) && Object.getOwnPropertyDescriptor(constructor, "prototype")?.value === prototype && Function.prototype.toString.call(constructor) === constructorSource;
1247
1212
  };
1248
1213
  const isPlainRecord = (value) => {
1249
1214
  try {
1215
+ if (Array.isArray(value)) return false;
1250
1216
  const prototype = Object.getPrototypeOf(value);
1251
1217
  if (prototype === null) return true;
1252
1218
  if (Object.getPrototypeOf(prototype) !== null) return false;
1253
- return hasMatchingNativeConstructor(prototype, nativeObjectConstructorSource);
1219
+ return isNativePrototype(prototype, nativeObjectConstructorSource);
1254
1220
  } catch {
1255
1221
  return false;
1256
1222
  }
1257
1223
  };
1258
1224
  const isPlainArray = (value) => {
1259
1225
  try {
1226
+ if (!Array.isArray(value)) return false;
1260
1227
  const prototype = Object.getPrototypeOf(value);
1261
- return prototype !== null && Object.getPrototypeOf(prototype) !== null && hasMatchingNativeConstructor(prototype, nativeArrayConstructorSource);
1228
+ return prototype !== null && Object.getPrototypeOf(prototype) !== null && isNativePrototype(prototype, nativeArrayConstructorSource);
1262
1229
  } catch {
1263
1230
  return false;
1264
1231
  }
1265
1232
  };
1266
- const invalidJsonWalk = { _tag: "Invalid" };
1267
- const validatedJsonWalk = { _tag: "Validated" };
1268
- const walkJsonValue = (value, mode, ancestors = /* @__PURE__ */ new Set()) => {
1269
- if (value === null || typeof value === "string" || typeof value === "boolean") return mode === "snapshot" ? {
1270
- _tag: "Snapshot",
1271
- value
1272
- } : validatedJsonWalk;
1273
- if (typeof value === "number") return Number.isFinite(value) ? mode === "snapshot" ? {
1274
- _tag: "Snapshot",
1275
- value
1276
- } : validatedJsonWalk : invalidJsonWalk;
1277
- if (typeof value !== "object" || ancestors.has(value)) return invalidJsonWalk;
1233
+ const copyOfJsonValue = (value, copies) => (Predicate.isObjectKeyword(value) ? copies.get(value) : void 0) ?? value;
1234
+ const isJsonValueWithin = (value, ancestors, copies) => {
1235
+ if (Predicate.isNull(value) || Predicate.isString(value) || Predicate.isBoolean(value)) return true;
1236
+ if (Predicate.isNumber(value)) return Number.isFinite(value);
1237
+ if (!Predicate.isObjectKeyword(value) || ancestors.has(value)) return false;
1278
1238
  ancestors.add(value);
1279
1239
  try {
1280
1240
  if (Array.isArray(value)) {
1281
- if (!isPlainArray(value)) return invalidJsonWalk;
1241
+ if (!isPlainArray(value)) return false;
1282
1242
  const descriptors = Object.getOwnPropertyDescriptors(value);
1283
- const lengthDescriptor = descriptors["length"];
1284
- if (lengthDescriptor === void 0 || !("value" in lengthDescriptor) || !Number.isSafeInteger(lengthDescriptor.value) || lengthDescriptor.value < 0) return invalidJsonWalk;
1285
- const output = mode === "snapshot" ? [] : void 0;
1286
- for (let index = 0; index < lengthDescriptor.value; index += 1) {
1243
+ const length = descriptors["length"]?.value;
1244
+ if (!Number.isSafeInteger(length) || length < 0) return false;
1245
+ const output = [];
1246
+ for (let index = 0; index < length; index += 1) {
1287
1247
  const descriptor = descriptors[String(index)];
1288
- if (descriptor === void 0 || !("value" in descriptor)) return invalidJsonWalk;
1289
- const item = walkJsonValue(descriptor.value, mode, ancestors);
1290
- if (item._tag === "Invalid") return item;
1291
- if (output === void 0) {
1292
- if (item._tag !== "Validated") return invalidJsonWalk;
1293
- } else {
1294
- if (item._tag !== "Snapshot") return invalidJsonWalk;
1295
- output.push(item.value);
1296
- }
1248
+ if (descriptor === void 0 || !("value" in descriptor) || !isJsonValueWithin(descriptor.value, ancestors, copies)) return false;
1249
+ if (copies !== void 0) output.push(copyOfJsonValue(descriptor.value, copies));
1297
1250
  }
1298
- return output === void 0 ? validatedJsonWalk : {
1299
- _tag: "Snapshot",
1300
- value: output
1301
- };
1251
+ copies?.set(value, output);
1252
+ return true;
1302
1253
  }
1303
- if (!isPlainRecord(value)) return invalidJsonWalk;
1304
- const output = mode === "snapshot" ? {} : void 0;
1254
+ if (!isPlainRecord(value)) return false;
1255
+ const output = {};
1305
1256
  for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {
1306
1257
  if (!descriptor.enumerable) continue;
1307
- if (!("value" in descriptor)) return invalidJsonWalk;
1308
- const item = walkJsonValue(descriptor.value, mode, ancestors);
1309
- if (item._tag === "Invalid") return item;
1310
- if (output === void 0) {
1311
- if (item._tag !== "Validated") return invalidJsonWalk;
1312
- continue;
1313
- }
1314
- if (item._tag !== "Snapshot") return invalidJsonWalk;
1315
- Object.defineProperty(output, key, {
1258
+ if (!("value" in descriptor) || !isJsonValueWithin(descriptor.value, ancestors, copies)) return false;
1259
+ if (copies !== void 0) Object.defineProperty(output, key, {
1316
1260
  configurable: true,
1317
1261
  enumerable: true,
1318
- value: item.value,
1262
+ value: copyOfJsonValue(descriptor.value, copies),
1319
1263
  writable: true
1320
1264
  });
1321
1265
  }
1322
- return output === void 0 ? validatedJsonWalk : {
1323
- _tag: "Snapshot",
1324
- value: output
1325
- };
1266
+ copies?.set(value, output);
1267
+ return true;
1326
1268
  } catch {
1327
- return invalidJsonWalk;
1269
+ return false;
1328
1270
  } finally {
1329
1271
  ancestors.delete(value);
1330
1272
  }
1331
1273
  };
1332
- const snapshotJsonValue = (value) => {
1333
- const result = walkJsonValue(value, "snapshot");
1334
- return result._tag === "Snapshot" ? result.value : void 0;
1335
- };
1336
- const snapshotJsonObject = (value) => {
1337
- const snapshot = snapshotJsonValue(value);
1338
- return typeof snapshot === "object" && snapshot !== null && !Array.isArray(snapshot) ? snapshot : void 0;
1339
- };
1340
- const isJsonValue = (value) => walkJsonValue(value, "validate")._tag === "Validated";
1341
- const isJsonObject = (value) => typeof value === "object" && value !== null && isJsonValue(value) && !Array.isArray(value);
1274
+ const isJsonValue = (value) => isJsonValueWithin(value, /* @__PURE__ */ new Set(), void 0);
1275
+ const isJsonObjectValue = (value) => Predicate.isObjectKeyword(value) && !Array.isArray(value);
1276
+ const isJsonObject = (value) => isJsonValue(value) && isJsonObjectValue(value);
1342
1277
  const JsonValueSchema = Schema.declareConstructor()([], () => (input, ast, options) => {
1343
- const snapshot = snapshotJsonValue(input);
1344
- return snapshot === void 0 ? Effect.fail(new SchemaIssue.InvalidType(ast, input, options)) : Effect.succeed(snapshot);
1278
+ const copies = /* @__PURE__ */ new Map();
1279
+ return isJsonValueWithin(input, /* @__PURE__ */ new Set(), copies) ? Effect.succeed(copyOfJsonValue(input, copies)) : Effect.fail(new SchemaIssue.InvalidType(ast, input, options));
1345
1280
  }, { expected: "a JSON-compatible value" });
1346
1281
  const JsonValueResponseSchema = Schema.declareConstructor()([], () => (input, ast, options) => isJsonValue(input) ? Effect.succeed(input) : Effect.fail(new SchemaIssue.InvalidType(ast, input, options)), { expected: "a JSON-compatible value" });
1347
1282
  const JsonObjectResponseSchema = Schema.declareConstructor()([], () => (input, ast, options) => isJsonObject(input) ? Effect.succeed(input) : Effect.fail(new SchemaIssue.InvalidType(ast, input, options)), { expected: "a JSON object" });
1348
1283
  const JsonObjectSchema = Schema.declareConstructor()([], () => (input, ast, options) => {
1349
- const snapshot = snapshotJsonObject(input);
1350
- return snapshot === void 0 ? Effect.fail(new SchemaIssue.InvalidType(ast, input, options)) : Effect.succeed(snapshot);
1284
+ const copies = /* @__PURE__ */ new Map();
1285
+ if (!isJsonValueWithin(input, /* @__PURE__ */ new Set(), copies)) return Effect.fail(new SchemaIssue.InvalidType(ast, input, options));
1286
+ const copy = copyOfJsonValue(input, copies);
1287
+ return isJsonObjectValue(copy) ? Effect.succeed(copy) : Effect.fail(new SchemaIssue.InvalidType(ast, input, options));
1351
1288
  }, { expected: "a JSON object" });
1352
1289
  const ConfigKeySchema = Schema.String.check(Schema.isMinLength(1), Schema.isPattern(/^(?!\.{1,2}$)/), Schema.makeFilter((key) => key.isWellFormed(), { expected: "a well-formed Unicode config key" }));
1353
1290
  const ConfigSetKeyInputSchema = Schema.Struct({
1354
1291
  key: ConfigKeySchema,
1355
1292
  value: JsonValueSchema
1356
1293
  });
1357
- const getResponseEnvelopeFields = (input, valueField) => {
1358
- if (typeof input !== "object" || input === null || !isPlainRecord(input)) return;
1359
- try {
1360
- const statusDescriptor = Object.getOwnPropertyDescriptor(input, "status");
1361
- const valueDescriptor = Object.getOwnPropertyDescriptor(input, valueField);
1362
- if (statusDescriptor === void 0 || !("value" in statusDescriptor) || valueDescriptor === void 0 || !("value" in valueDescriptor)) return;
1363
- return {
1364
- status: statusDescriptor.value,
1365
- value: valueDescriptor.value
1366
- };
1367
- } catch {
1368
- return;
1369
- }
1370
- };
1371
- const makeConfigEnvelopeSchema = (schema) => Schema.declareConstructor()([schema], ([configSchema]) => (input, ast, options) => {
1372
- const fields = getResponseEnvelopeFields(input, "config");
1373
- if (fields === void 0 || fields.status !== "OK") return Effect.fail(new SchemaIssue.InvalidType(ast, input, options));
1374
- return SchemaParser.decodeUnknownEffect(configSchema)(fields.value, options).pipe(Effect.map((config) => ({
1375
- config,
1376
- status: "OK"
1377
- })));
1378
- });
1379
- const makeConfigValueEnvelopeSchema = (schema) => Schema.declareConstructor()([schema], ([valueSchema]) => (input, ast, options) => {
1380
- const fields = getResponseEnvelopeFields(input, "value");
1381
- if (fields === void 0 || fields.status !== "OK") return Effect.fail(new SchemaIssue.InvalidType(ast, input, options));
1382
- return SchemaParser.decodeUnknownEffect(valueSchema)(fields.value, options).pipe(Effect.map((value) => ({
1383
- status: "OK",
1384
- value
1385
- })));
1386
- });
1294
+ const okEnvelopeField = (status, field) => status !== void 0 && "value" in status && status.value === "OK" && field !== void 0 && "value" in field ? field : void 0;
1295
+ const makeConfigEnvelopeSchema = (schema) => Schema.declareConstructor()([schema], ([configSchema]) => (input, ast, options) => Effect.try({
1296
+ try: () => isPlainRecord(input) ? okEnvelopeField(Object.getOwnPropertyDescriptor(input, "status"), Object.getOwnPropertyDescriptor(input, "config")) : void 0,
1297
+ catch: () => new SchemaIssue.InvalidType(ast, input, options)
1298
+ }).pipe(Effect.flatMap((field) => field === void 0 ? Effect.fail(new SchemaIssue.InvalidType(ast, input, options)) : SchemaParser.decodeUnknownEffect(configSchema)(field.value, options)), Effect.map((config) => ({
1299
+ config,
1300
+ status: "OK"
1301
+ }))));
1302
+ const makeConfigValueEnvelopeSchema = (schema) => Schema.declareConstructor()([schema], ([valueSchema]) => (input, ast, options) => Effect.try({
1303
+ try: () => isPlainRecord(input) ? okEnvelopeField(Object.getOwnPropertyDescriptor(input, "status"), Object.getOwnPropertyDescriptor(input, "value")) : void 0,
1304
+ catch: () => new SchemaIssue.InvalidType(ast, input, options)
1305
+ }).pipe(Effect.flatMap((field) => field === void 0 ? Effect.fail(new SchemaIssue.InvalidType(ast, input, options)) : SchemaParser.decodeUnknownEffect(valueSchema)(field.value, options)), Effect.map((value) => ({
1306
+ status: "OK",
1307
+ value
1308
+ }))));
1387
1309
  const ConfigEnvelopeSchema = makeConfigEnvelopeSchema(JsonObjectResponseSchema);
1388
1310
  const ConfigValueEnvelopeSchema = makeConfigValueEnvelopeSchema(JsonValueResponseSchema);
1389
1311
  const readConfig = () => requestJson(ConfigEnvelopeSchema, {
@@ -1394,46 +1316,45 @@ const readConfigWith = (schema) => requestJson(makeConfigEnvelopeSchema(JsonObje
1394
1316
  method: "GET",
1395
1317
  path: "/v2/config"
1396
1318
  }).pipe(Effect.map((envelope) => envelope["config"]));
1397
- const writeConfig = (config) => Schema.decodeUnknownEffect(JsonObjectSchema)(config).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedConfig) => requestJson(OkResponseSchema, {
1319
+ const writeConfig = (config) => decodeAndRun(JsonObjectSchema, config, (decodedConfig) => requestJson(OkResponseSchema, {
1398
1320
  body: {
1399
1321
  type: "json",
1400
1322
  value: { config: decodedConfig }
1401
1323
  },
1402
1324
  method: "PUT",
1403
1325
  path: "/v2/config"
1404
- })));
1405
- const getConfigKey = (key) => Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedKey) => requestJson(ConfigValueEnvelopeSchema, {
1326
+ }));
1327
+ const getConfigKey = (key) => decodeAndRun(ConfigKeySchema, key, (decodedKey) => requestJson(ConfigValueEnvelopeSchema, {
1406
1328
  method: "GET",
1407
1329
  path: `/v2/config/${encodePathSegment(decodedKey)}`
1408
- })), selectJsonField("value"));
1409
- const getConfigKeyWith = (key, schema) => Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedKey) => requestJson(makeConfigValueEnvelopeSchema(JsonValueResponseSchema.pipe(Schema.decodeTo(schema))), {
1330
+ })).pipe(selectJsonField("value"));
1331
+ const getConfigKeyWith = (key, schema) => decodeAndRun(ConfigKeySchema, key, (decodedKey) => requestJson(makeConfigValueEnvelopeSchema(JsonValueResponseSchema.pipe(Schema.decodeTo(schema))), {
1410
1332
  method: "GET",
1411
1333
  path: `/v2/config/${encodePathSegment(decodedKey)}`
1412
- })), Effect.map((envelope) => envelope["value"]));
1413
- const setConfigKey = (key, value) => Schema.decodeUnknownEffect(ConfigSetKeyInputSchema, { onExcessProperty: "error" })({
1334
+ })).pipe(Effect.map((envelope) => envelope["value"]));
1335
+ const setConfigKey = (key, value) => decodeAndRun(ConfigSetKeyInputSchema, {
1414
1336
  key,
1415
1337
  value
1416
- }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
1338
+ }, (decodedInput) => requestJson(OkResponseSchema, {
1417
1339
  body: {
1418
1340
  type: "json",
1419
1341
  value: { value: decodedInput.value }
1420
1342
  },
1421
1343
  method: "PUT",
1422
1344
  path: `/v2/config/${encodePathSegment(decodedInput.key)}`
1423
- })));
1424
- const deleteConfigKey = (key) => Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedKey) => requestJson(OkResponseSchema, {
1345
+ }));
1346
+ const deleteConfigKey = (key) => decodeAndRun(ConfigKeySchema, key, (decodedKey) => requestJson(OkResponseSchema, {
1425
1347
  method: "DELETE",
1426
1348
  path: `/v2/config/${encodePathSegment(decodedKey)}`
1427
- })));
1428
- //#endregion
1429
- //#region src/domains/download-links.ts
1349
+ }));
1350
+ // src/domains/download-links.ts
1430
1351
  const DownloadLinksStatusSchema = Schema.Literals([
1431
1352
  "NEW",
1432
1353
  "PROCESSING",
1433
1354
  "DONE",
1434
1355
  "ERROR"
1435
1356
  ]);
1436
- const DownloadLinksCreateInputSchema = makeCursorSelectionSchema("ids", "excludeIds", {});
1357
+ const DownloadLinksCreateInputSchema = cursorSelectionSchema("ids", "excludeIds", {});
1437
1358
  const DownloadLinksPayloadSchema = Schema.Struct({
1438
1359
  download_links: Schema.Array(Schema.String),
1439
1360
  media_links: Schema.Array(Schema.String),
@@ -1508,20 +1429,19 @@ const GetDownloadLinksErrorSpec = definePutioOperationErrorSpec({
1508
1429
  { statusCode: 404 }
1509
1430
  ]
1510
1431
  });
1511
- const createDownloadLinks = (input = {}) => Schema.decodeUnknownEffect(DownloadLinksCreateInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(DownloadLinksCreateEnvelopeSchema, {
1432
+ const createDownloadLinks = (input = {}) => decodeAndRun(DownloadLinksCreateInputSchema, input, (decodedInput) => requestJson(DownloadLinksCreateEnvelopeSchema, {
1512
1433
  body: {
1513
1434
  type: "form",
1514
1435
  value: toCursorSelectionForm(decodedInput)
1515
1436
  },
1516
1437
  method: "POST",
1517
1438
  path: "/v2/download_links/create"
1518
- })), selectJsonFields("id"), withOperationErrors(CreateDownloadLinksErrorSpec));
1519
- const getDownloadLinks = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(DownloadLinksInfoSchema, {
1439
+ })).pipe(selectJsonFields("id"), withOperationErrors(CreateDownloadLinksErrorSpec));
1440
+ const getDownloadLinks = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(DownloadLinksInfoSchema, {
1520
1441
  method: "GET",
1521
1442
  path: `/v2/download_links/${encodePathSegment(decodedId)}`
1522
- })), withOperationErrors(GetDownloadLinksErrorSpec));
1523
- //#endregion
1524
- //#region src/domains/events.ts
1443
+ })).pipe(withOperationErrors(GetDownloadLinksErrorSpec));
1444
+ // src/domains/events.ts
1525
1445
  const HistoryEventBaseSchema = Schema.Struct({
1526
1446
  created_at: Schema.String,
1527
1447
  id: Schema.Int,
@@ -1668,25 +1588,24 @@ const GetEventTorrentErrorSpec = definePutioOperationErrorSpec({
1668
1588
  { statusCode: 500 }
1669
1589
  ]
1670
1590
  });
1671
- const listEvents = (query = {}) => Schema.decodeUnknownEffect(EventsListQuerySchema, { onExcessProperty: "error" })(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(EventsListEnvelopeSchema, {
1591
+ const listEvents = (query = {}) => decodeAndRun(EventsListQuerySchema, query, (decodedQuery) => requestJson(EventsListEnvelopeSchema, {
1672
1592
  method: "GET",
1673
1593
  path: "/v2/events/list",
1674
1594
  query: decodedQuery
1675
- })), withOperationErrors(ListEventsErrorSpec));
1676
- const deleteEvent = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
1595
+ })).pipe(withOperationErrors(ListEventsErrorSpec));
1596
+ const deleteEvent = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(OkResponseSchema, {
1677
1597
  method: "POST",
1678
1598
  path: `/v2/events/delete/${encodePathSegment(decodedId)}`
1679
- })), withOperationErrors(DeleteEventErrorSpec));
1599
+ })).pipe(withOperationErrors(DeleteEventErrorSpec));
1680
1600
  const clearEvents = () => requestJson(OkResponseSchema, {
1681
1601
  method: "POST",
1682
1602
  path: "/v2/events/delete"
1683
1603
  }).pipe(withOperationErrors(ClearEventsErrorSpec));
1684
- const getEventTorrent = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestArrayBuffer({
1604
+ const getEventTorrent = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestArrayBuffer({
1685
1605
  method: "GET",
1686
1606
  path: `/v2/events/${encodePathSegment(decodedId)}/torrent`
1687
- })), withOperationErrors(GetEventTorrentErrorSpec));
1688
- //#endregion
1689
- //#region src/domains/family.ts
1607
+ })).pipe(withOperationErrors(GetEventTorrentErrorSpec));
1608
+ // src/domains/family.ts
1690
1609
  const NonNegativeIntegerSchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
1691
1610
  const NonNegativeIntegerFromStringSchema = Schema.NumberFromString.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0));
1692
1611
  const FamilyInviteSchema = Schema.Struct({
@@ -1803,16 +1722,15 @@ const createFamilyInvite = () => requestJson(FamilyCreateInviteEnvelopeSchema, {
1803
1722
  method: "POST",
1804
1723
  path: "/v2/family/sub_account"
1805
1724
  }).pipe(selectJsonFields("code"), withOperationErrors(CreateFamilyInviteErrorSpec));
1806
- const removeFamilyMember = (username) => Schema.decodeUnknownEffect(NonEmptyStringSchema)(username).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedUsername) => requestJson(OkResponseSchema, {
1725
+ const removeFamilyMember = (username) => decodeAndRun(NonEmptyStringSchema, username, (decodedUsername) => requestJson(OkResponseSchema, {
1807
1726
  method: "DELETE",
1808
1727
  path: `/v2/family/sub_account/${encodePathSegment(decodedUsername)}`
1809
- })), Effect.asVoid, withOperationErrors(RemoveFamilyMemberErrorSpec));
1810
- const joinFamily = (inviteCode) => Schema.decodeUnknownEffect(NonEmptyStringSchema)(inviteCode).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInviteCode) => requestJson(OkResponseSchema, {
1728
+ })).pipe(Effect.asVoid, withOperationErrors(RemoveFamilyMemberErrorSpec));
1729
+ const joinFamily = (inviteCode) => decodeAndRun(NonEmptyStringSchema, inviteCode, (decodedInviteCode) => requestJson(OkResponseSchema, {
1811
1730
  method: "POST",
1812
1731
  path: `/v2/family/join/${encodePathSegment(decodedInviteCode)}`
1813
- })), Effect.asVoid, withOperationErrors(JoinFamilyErrorSpec));
1814
- //#endregion
1815
- //#region src/domains/ifttt.ts
1732
+ })).pipe(Effect.asVoid, withOperationErrors(JoinFamilyErrorSpec));
1733
+ // src/domains/ifttt.ts
1816
1734
  const IFTTTStatusEnvelopeSchema = Schema.Struct({
1817
1735
  enabled: Schema.Boolean,
1818
1736
  status: Schema.Literal("OK")
@@ -1869,8 +1787,7 @@ const sendIftttEvent = (input) => decodeAndRun(IftttEventInputSchema, input, (de
1869
1787
  method: "POST",
1870
1788
  path: "/v2/ifttt-client/event"
1871
1789
  })).pipe(Effect.asVoid, withOperationErrors(SendIftttEventErrorSpec));
1872
- //#endregion
1873
- //#region src/domains/files.ts
1790
+ // src/domains/files.ts
1874
1791
  const RequestedFlag = Schema.Literal(1);
1875
1792
  const NonNegativeFileIdSchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
1876
1793
  const SHARED_WITH_YOU_ROOT_ID = -2;
@@ -2030,14 +1947,7 @@ const FilesListEnvelopeSchema = Schema.Struct({
2030
1947
  status: Schema.Literal("OK"),
2031
1948
  total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))
2032
1949
  });
2033
- const FilesListContinueEnvelopeSchema = Schema.Struct({
2034
- breadcrumbs: Schema.optional(Schema.Array(FileBreadcrumbSchema)),
2035
- cursor: Schema.NullOr(Schema.String),
2036
- files: Schema.Array(FileBroadSchema),
2037
- parent: Schema.optional(Schema.NullOr(FileBroadSchema)),
2038
- status: Schema.Literal("OK"),
2039
- total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))
2040
- });
1950
+ const FilesListContinueEnvelopeSchema = FilesListEnvelopeSchema.pipe(Schema.fieldsAssign({ parent: Schema.optional(Schema.NullOr(FileBroadSchema)) }));
2041
1951
  const FilesSearchEnvelopeSchema = Schema.Struct({
2042
1952
  cursor: Schema.NullOr(Schema.String),
2043
1953
  files: Schema.Array(FileBroadSchema),
@@ -2056,10 +1966,6 @@ const FileGetInputSchema = Schema.Struct({
2056
1966
  id: ReadableFileIdSchema,
2057
1967
  query: Schema.optional(FileQuerySchema)
2058
1968
  });
2059
- const FilesSearchContinueInputSchema = Schema.Struct({
2060
- cursor: NonEmptyStringSchema,
2061
- query: Schema.Struct({ per_page: Schema.optional(PositiveIntegerSchema) })
2062
- });
2063
1969
  const FileSubtitlesInputSchema = Schema.Struct({
2064
1970
  fileId: PositiveFileIdSchema,
2065
1971
  options: Schema.Struct({ languages: Schema.optional(Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1))) })
@@ -2222,8 +2128,8 @@ const FilesMoveSelectionInputSchema = Schema.Struct({
2222
2128
  parentId: NonNegativeFileIdSchema,
2223
2129
  selection: FilesBulkSelectionSchema
2224
2130
  });
2225
- const FilesWatchStatusInputSchema = makeCursorSelectionSchema("ids", "excludeIds", { watched: Schema.Boolean });
2226
- const FilesExtractInputSchema = makeCursorSelectionSchema("ids", "excludeIds", { password: Schema.optional(NonEmptyStringSchema) });
2131
+ const FilesWatchStatusInputSchema = cursorSelectionSchema("ids", "excludeIds", { watched: Schema.Boolean });
2132
+ const FilesExtractInputSchema = cursorSelectionSchema("ids", "excludeIds", { password: Schema.optional(NonEmptyStringSchema) });
2227
2133
  const FileUploadInputSchema = Schema.Struct({
2228
2134
  file: Schema.instanceOf(Blob),
2229
2135
  fileName: Schema.optional(NonEmptyStringSchema),
@@ -2561,13 +2467,11 @@ const FileUploadErrorSpec = definePutioOperationErrorSpec({
2561
2467
  { statusCode: 429 }
2562
2468
  ]
2563
2469
  });
2564
- const missingFieldError = (field) => new PutioValidationError({ cause: `Expected put.io to include "${field}" because it was requested` });
2565
- const failMissingField = (field) => Effect.fail(missingFieldError(field));
2566
- const widenValidationError = (effect) => effect;
2470
+ const failMissingField = (field) => Effect.fail(new PutioValidationError({ cause: `Expected put.io to include "${field}" because it was requested` }));
2567
2471
  const hasStreamUrl = (value) => "stream_url" in value;
2568
2472
  const hasMp4StreamUrl = (value) => "mp4_stream_url" in value;
2569
2473
  const hasMp4StreamUrlWhenAvailable = (value) => !value.is_mp4_available || hasMp4StreamUrl(value);
2570
- const hasMp4StatusFields = (value) => "mp4_size" in value && typeof value.need_convert === "boolean";
2474
+ const hasMp4StatusFields = (value) => "mp4_size" in value && value.need_convert !== void 0;
2571
2475
  const hasVideoMetadata = (value) => "video_metadata" in value;
2572
2476
  const hasMediaMetadata = (value) => "media_metadata" in value;
2573
2477
  const hasCodecs = (value) => "content_type_and_codecs" in value;
@@ -2585,19 +2489,19 @@ const resolveRouteContext = (token) => Effect.gen(function* () {
2585
2489
  const resolveApiBaseUrl = Effect.gen(function* () {
2586
2490
  return (yield* PutioSdkConfig).baseUrl ?? "https://api.put.io";
2587
2491
  });
2588
- const normalizeFileName = (name) => encodeURIComponent(name);
2492
+ const toOriginalFlag = (playOriginal) => playOriginal === void 0 ? void 0 : playOriginal ? 1 : 0;
2589
2493
  const toUploadResult = (value) => {
2590
- if (value.file) return {
2494
+ if (value.file) return Effect.succeed({
2591
2495
  file: value.file,
2592
2496
  type: "file"
2593
- };
2594
- if (value.transfer) return {
2497
+ });
2498
+ if (value.transfer) return Effect.succeed({
2595
2499
  transfer: value.transfer,
2596
2500
  type: "transfer"
2597
- };
2598
- throw new PutioValidationError({ cause: "Expected put.io upload response to contain either \"file\" or \"transfer\"" });
2501
+ });
2502
+ return Effect.fail(new PutioValidationError({ cause: "Expected put.io upload response to contain either \"file\" or \"transfer\"" }));
2599
2503
  };
2600
- const buildFileApiDownloadUrl = (baseUrl, fileId, options) => buildPutioUrl(baseUrl, options.name ? `/v2/files/${encodePathSegment(fileId)}/download/${normalizeFileName(options.name)}` : `/v2/files/${encodePathSegment(fileId)}/download`, {
2504
+ const buildFileApiDownloadUrl = (baseUrl, fileId, options) => buildPutioUrl(baseUrl, options.name ? `/v2/files/${encodePathSegment(fileId)}/download/${encodePathSegment(options.name)}` : `/v2/files/${encodePathSegment(fileId)}/download`, {
2601
2505
  ...useTunnelToQuery(options.useTunnel),
2602
2506
  oauth_token: options.downloadToken
2603
2507
  });
@@ -2605,7 +2509,7 @@ const buildFileApiContentUrl = (baseUrl, fileId, options) => buildPutioUrl(baseU
2605
2509
  ...useTunnelToQuery(options.useTunnel),
2606
2510
  oauth_token: options.downloadToken
2607
2511
  });
2608
- const buildFileApiMp4DownloadUrl = (baseUrl, fileId, options) => buildPutioUrl(baseUrl, options.name ? `/v2/files/${encodePathSegment(fileId)}/mp4/download/${normalizeFileName(options.name)}` : `/v2/files/${encodePathSegment(fileId)}/mp4/download`, {
2512
+ const buildFileApiMp4DownloadUrl = (baseUrl, fileId, options) => buildPutioUrl(baseUrl, options.name ? `/v2/files/${encodePathSegment(fileId)}/mp4/download/${encodePathSegment(options.name)}` : `/v2/files/${encodePathSegment(fileId)}/mp4/download`, {
2609
2513
  ...useTunnelToQuery(options.useTunnel),
2610
2514
  convert: options.convert ? 1 : void 0,
2611
2515
  oauth_token: options.downloadToken
@@ -2613,7 +2517,7 @@ const buildFileApiMp4DownloadUrl = (baseUrl, fileId, options) => buildPutioUrl(b
2613
2517
  const buildFileHlsStreamUrl = (baseUrl, fileId, options) => buildPutioUrl(baseUrl, `/v2/files/${encodePathSegment(fileId)}/hls/media.m3u8`, {
2614
2518
  max_subtitle_count: options.maxSubtitleCount,
2615
2519
  oauth_token: options.downloadToken,
2616
- original: typeof options.playOriginal === "boolean" ? options.playOriginal ? 1 : 0 : void 0,
2520
+ original: toOriginalFlag(options.playOriginal),
2617
2521
  subtitle_languages: joinCsv(options.subtitleLanguages)
2618
2522
  });
2619
2523
  const buildFileXspfPlaylistUrl = (baseUrl, fileId, options) => buildPutioUrl(baseUrl, `/v2/files/${encodePathSegment(fileId)}/xspf`, { oauth_token: options.downloadToken });
@@ -2625,7 +2529,7 @@ const createFileUploadFormData = (input) => {
2625
2529
  return formData;
2626
2530
  };
2627
2531
  const ensureFileQueryFields = (effect, query) => Effect.gen(function* () {
2628
- const file = yield* widenValidationError(effect);
2532
+ const file = yield* effect;
2629
2533
  if (query.stream_url === 1 && !hasStreamUrl(file)) return yield* failMissingField("stream_url");
2630
2534
  if ((query.mp4_status === 1 || query.mp4_stream_url === 1) && !hasMp4StatusFields(file)) return yield* failMissingField(query.mp4_stream_url === 1 ? "mp4_size/need_convert" : "mp4_size");
2631
2535
  if (query.mp4_stream_url === 1 && !hasMp4StreamUrlWhenAvailable(file)) return yield* failMissingField("mp4_stream_url");
@@ -2669,7 +2573,7 @@ function getFile(input) {
2669
2573
  });
2670
2574
  }
2671
2575
  function getFileChild(input) {
2672
- return Schema.decodeUnknownEffect(FileGetChildInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => {
2576
+ return decodeAndRun(FileGetChildInputSchema, input, (decodedInput) => {
2673
2577
  const effect = requestJson(FileEnvelopeSchema, {
2674
2578
  method: "GET",
2675
2579
  path: `/v2/files/${encodePathSegment(decodedInput.parentId)}/child`,
@@ -2679,9 +2583,9 @@ function getFileChild(input) {
2679
2583
  }
2680
2584
  }).pipe(selectJsonField("file"), withOperationErrors(GetFileChildErrorSpec));
2681
2585
  return decodedInput.query === void 0 ? effect : ensureFileQueryFields(effect, decodedInput.query);
2682
- }));
2586
+ });
2683
2587
  }
2684
- const copyFile = (input) => Schema.decodeUnknownEffect(FileCopyInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(FileEnvelopeSchema, {
2588
+ const copyFile = (input) => decodeAndRun(FileCopyInputSchema, input, (decodedInput) => requestJson(FileEnvelopeSchema, {
2685
2589
  body: {
2686
2590
  type: "form",
2687
2591
  value: {
@@ -2692,8 +2596,8 @@ const copyFile = (input) => Schema.decodeUnknownEffect(FileCopyInputSchema, { on
2692
2596
  },
2693
2597
  method: "POST",
2694
2598
  path: "/v2/files/copy"
2695
- })), selectJsonField("file"), withOperationErrors(CopyFileErrorSpec));
2696
- const touchFiles = (input) => Schema.decodeUnknownEffect(FileTouchInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
2599
+ })).pipe(selectJsonField("file"), withOperationErrors(CopyFileErrorSpec));
2600
+ const touchFiles = (input) => decodeAndRun(FileTouchInputSchema, input, (decodedInput) => requestJson(OkResponseSchema, {
2697
2601
  body: {
2698
2602
  type: "form",
2699
2603
  value: {
@@ -2703,17 +2607,17 @@ const touchFiles = (input) => Schema.decodeUnknownEffect(FileTouchInputSchema, {
2703
2607
  },
2704
2608
  method: "POST",
2705
2609
  path: "/v2/files/touch"
2706
- })), Effect.asVoid, withOperationErrors(TouchFilesErrorSpec));
2707
- const canWriteFile = (fileId) => Schema.decodeUnknownEffect(PositiveFileIdSchema)(fileId).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedFileId) => requestJson(FileCanWriteEnvelopeSchema, {
2610
+ })).pipe(Effect.asVoid, withOperationErrors(TouchFilesErrorSpec));
2611
+ const canWriteFile = (fileId) => decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) => requestJson(FileCanWriteEnvelopeSchema, {
2708
2612
  method: "GET",
2709
2613
  path: `/v2/files/${encodePathSegment(decodedFileId)}/can-write`
2710
- })), selectJsonField("user_id"), withOperationErrors(CanWriteFileErrorSpec));
2711
- const searchFiles = (query) => Schema.decodeUnknownEffect(FilesSearchQuerySchema, { onExcessProperty: "error" })(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(FilesSearchEnvelopeSchema, {
2614
+ })).pipe(selectJsonField("user_id"), withOperationErrors(CanWriteFileErrorSpec));
2615
+ const searchFiles = (query) => decodeAndRun(FilesSearchQuerySchema, query, (decodedQuery) => requestJson(FilesSearchEnvelopeSchema, {
2712
2616
  method: "GET",
2713
2617
  path: "/v2/files/search",
2714
2618
  query: decodedQuery
2715
- })), withOperationErrors(SearchFilesErrorSpec));
2716
- const continueSearch = (cursor, query = {}) => decodeAndRun(FilesSearchContinueInputSchema, {
2619
+ })).pipe(withOperationErrors(SearchFilesErrorSpec));
2620
+ const continueSearch = (cursor, query = {}) => decodeAndRun(FilesContinueInputSchema, {
2717
2621
  cursor,
2718
2622
  query
2719
2623
  }, (decodedInput) => requestJson(FilesSearchEnvelopeSchema, {
@@ -2725,7 +2629,7 @@ const continueSearch = (cursor, query = {}) => decodeAndRun(FilesSearchContinueI
2725
2629
  path: "/v2/files/search/continue",
2726
2630
  query: decodedInput.query
2727
2631
  })).pipe(withOperationErrors(SearchFilesErrorSpec));
2728
- const setFileSort = (input) => Schema.decodeUnknownEffect(FileSetSortInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
2632
+ const setFileSort = (input) => decodeAndRun(FileSetSortInputSchema, input, (decodedInput) => requestJson(OkResponseSchema, {
2729
2633
  body: {
2730
2634
  type: "form",
2731
2635
  value: {
@@ -2735,7 +2639,7 @@ const setFileSort = (input) => Schema.decodeUnknownEffect(FileSetSortInputSchema
2735
2639
  },
2736
2640
  method: "POST",
2737
2641
  path: "/v2/files/set-sort-by"
2738
- })), Effect.asVoid);
2642
+ })).pipe(Effect.asVoid);
2739
2643
  const resetFileSortSettings = () => requestJson(OkResponseSchema, {
2740
2644
  method: "POST",
2741
2645
  path: "/v2/files/remove-sort-by-settings"
@@ -2877,7 +2781,7 @@ const getHlsMasterPlaylist = (fileId, options = {}) => decodeAndRun(Schema.Struc
2877
2781
  path: `/v2/files/${encodePathSegment(decoded.fileId)}/hls/media.m3u8`,
2878
2782
  query: {
2879
2783
  max_subtitle_count: decoded.options.maxSubtitleCount,
2880
- original: typeof decoded.options.playOriginal === "boolean" ? decoded.options.playOriginal ? 1 : 0 : void 0,
2784
+ original: toOriginalFlag(decoded.options.playOriginal),
2881
2785
  subtitle_languages: joinCsv(decoded.options.subtitleLanguages)
2882
2786
  }
2883
2787
  })).pipe(withOperationErrors(GetHlsMasterPlaylistErrorSpec));
@@ -3013,9 +2917,8 @@ const uploadFile = (input, options = {}) => decodeAndRun(Schema.Struct({
3013
2917
  method: "POST",
3014
2918
  path: "/v2/files/upload",
3015
2919
  query: { oauth_token: token }
3016
- })))).pipe(Effect.map(toUploadResult), withOperationErrors(FileUploadErrorSpec));
3017
- //#endregion
3018
- //#region src/domains/friend-invites.ts
2920
+ })))).pipe(Effect.flatMap(toUploadResult), withOperationErrors(FileUploadErrorSpec));
2921
+ // src/domains/friend-invites.ts
3019
2922
  const FriendInviteJoinedUserStatusSchema = Schema.Literals([
3020
2923
  "CONVERTED",
3021
2924
  "IN_TRIAL",
@@ -3079,8 +2982,7 @@ const createFriendInvite = () => requestJson(FriendInviteCreateEnvelopeSchema, {
3079
2982
  method: "POST",
3080
2983
  path: "/v2/account/create_friend_invitation"
3081
2984
  }).pipe(selectJsonFields("code"), withOperationErrors(CreateFriendInviteErrorSpec));
3082
- //#endregion
3083
- //#region src/domains/friends.ts
2985
+ // src/domains/friends.ts
3084
2986
  const FriendBaseSchema = Schema.Struct({
3085
2987
  avatar_url: Schema.String,
3086
2988
  id: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
@@ -3227,15 +3129,14 @@ const FriendSharedFolderErrorSpec = definePutioOperationErrorSpec({
3227
3129
  { statusCode: 404 }
3228
3130
  ]
3229
3131
  });
3230
- const decodeUsername = (username) => Schema.decodeUnknownEffect(NonEmptyStringSchema)(username).pipe(Effect.mapError(mapDecodeErrorToValidationError));
3231
3132
  const listFriends = () => requestJson(FriendsListEnvelopeSchema, {
3232
3133
  method: "GET",
3233
3134
  path: "/v2/friends/list"
3234
3135
  }).pipe(selectJsonFields("friends", "total"), withOperationErrors(ListFriendsErrorSpec));
3235
- const searchFriends = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(FriendSearchEnvelopeSchema, {
3136
+ const searchFriends = (username) => decodeAndRun(NonEmptyStringSchema, username, (decodedUsername) => requestJson(FriendSearchEnvelopeSchema, {
3236
3137
  method: "GET",
3237
3138
  path: `/v2/friends/user-search/${encodePathSegment(decodedUsername)}`
3238
- })), selectJsonField("users"), withOperationErrors(SearchFriendsErrorSpec));
3139
+ })).pipe(selectJsonField("users"), withOperationErrors(SearchFriendsErrorSpec));
3239
3140
  const listWaitingRequests = () => requestJson(FriendRequestsEnvelopeSchema, {
3240
3141
  method: "GET",
3241
3142
  path: "/v2/friends/waiting-requests"
@@ -3248,28 +3149,27 @@ const listSentRequests = () => requestJson(FriendRequestsEnvelopeSchema, {
3248
3149
  method: "GET",
3249
3150
  path: "/v2/friends/sent-requests"
3250
3151
  }).pipe(selectJsonField("friends"), withOperationErrors(ListSentRequestsErrorSpec));
3251
- const sendFriendRequest = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(OkResponseSchema, {
3152
+ const sendFriendRequest = (username) => decodeAndRun(NonEmptyStringSchema, username, (decodedUsername) => requestJson(OkResponseSchema, {
3252
3153
  method: "POST",
3253
3154
  path: `/v2/friends/${encodePathSegment(decodedUsername)}/request`
3254
- })), withOperationErrors(SendFriendRequestErrorSpec));
3255
- const removeFriend = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(OkResponseSchema, {
3155
+ })).pipe(withOperationErrors(SendFriendRequestErrorSpec));
3156
+ const removeFriend = (username) => decodeAndRun(NonEmptyStringSchema, username, (decodedUsername) => requestJson(OkResponseSchema, {
3256
3157
  method: "POST",
3257
3158
  path: `/v2/friends/${encodePathSegment(decodedUsername)}/unfriend`
3258
- })), withOperationErrors(RemoveFriendErrorSpec));
3259
- const approveFriendRequest = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(OkResponseSchema, {
3159
+ })).pipe(withOperationErrors(RemoveFriendErrorSpec));
3160
+ const approveFriendRequest = (username) => decodeAndRun(NonEmptyStringSchema, username, (decodedUsername) => requestJson(OkResponseSchema, {
3260
3161
  method: "POST",
3261
3162
  path: `/v2/friends/${encodePathSegment(decodedUsername)}/approve`
3262
- })), withOperationErrors(ApproveFriendRequestErrorSpec));
3263
- const denyFriendRequest = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(OkResponseSchema, {
3163
+ })).pipe(withOperationErrors(ApproveFriendRequestErrorSpec));
3164
+ const denyFriendRequest = (username) => decodeAndRun(NonEmptyStringSchema, username, (decodedUsername) => requestJson(OkResponseSchema, {
3264
3165
  method: "POST",
3265
3166
  path: `/v2/friends/${encodePathSegment(decodedUsername)}/deny`
3266
- })), withOperationErrors(DenyFriendRequestErrorSpec));
3267
- const getFriendSharedFolder = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(FriendSharedFolderEnvelopeSchema, {
3167
+ })).pipe(withOperationErrors(DenyFriendRequestErrorSpec));
3168
+ const getFriendSharedFolder = (username) => decodeAndRun(NonEmptyStringSchema, username, (decodedUsername) => requestJson(FriendSharedFolderEnvelopeSchema, {
3268
3169
  method: "GET",
3269
3170
  path: `/v2/friends/${encodePathSegment(decodedUsername)}/files`
3270
- })), selectJsonField("file"), withOperationErrors(FriendSharedFolderErrorSpec));
3271
- //#endregion
3272
- //#region src/domains/payment.ts
3171
+ })).pipe(selectJsonField("file"), withOperationErrors(FriendSharedFolderErrorSpec));
3172
+ // src/domains/payment.ts
3273
3173
  const PaymentPlanTypeSchema = Schema.Literals(["onetime", "subscription"]);
3274
3174
  const PaymentOptionPlanTypeSchema = Schema.Literals([
3275
3175
  "onetime",
@@ -3864,7 +3764,7 @@ const listPaymentInvites = () => requestJson(PaymentInvitesEnvelopeSchema, {
3864
3764
  }).pipe(selectJsonField("vouchers"), withOperationErrors(ListPaymentInvitesErrorSpec));
3865
3765
  const previewPaymentChangePlan = (input) => decodeAndRun(PaymentChangePlanPreviewInputSchema, input, (decodedInput) => requestJson(PaymentChangePlanPreviewSchema, {
3866
3766
  method: "GET",
3867
- path: `/v2/payment/change_plan/${encodeURIComponent(decodedInput.plan_path)}`,
3767
+ path: `/v2/payment/change_plan/${encodePathSegment(decodedInput.plan_path)}`,
3868
3768
  query: {
3869
3769
  coupon_code: decodedInput.coupon_code,
3870
3770
  payment_type: decodedInput.payment_type
@@ -3879,12 +3779,12 @@ const submitPaymentChangePlan = (input) => decodeAndRun(PaymentChangePlanSubmitI
3879
3779
  }
3880
3780
  },
3881
3781
  method: "POST",
3882
- path: `/v2/payment/change_plan/${encodeURIComponent(decodedInput.plan_path)}`,
3782
+ path: `/v2/payment/change_plan/${encodePathSegment(decodedInput.plan_path)}`,
3883
3783
  query: { coupon_code: decodedInput.coupon_code }
3884
3784
  })).pipe(withOperationErrors(SubmitPaymentChangePlanErrorSpec));
3885
3785
  const confirmFastspringOrder = (reference) => decodeAndRun(NonEmptyStringSchema, reference, (decodedReference) => requestJson(PaymentFastspringConfirmEnvelopeSchema, {
3886
3786
  method: "GET",
3887
- path: `/v2/payment/fs-confirm/${encodeURIComponent(decodedReference)}`
3787
+ path: `/v2/payment/fs-confirm/${encodePathSegment(decodedReference)}`
3888
3788
  }).pipe(selectJsonField("confirmed"))).pipe(withOperationErrors(ConfirmFastspringOrderErrorSpec));
3889
3789
  const stopPaymentSubscription = () => requestJson(OkResponseSchema, {
3890
3790
  method: "POST",
@@ -3892,11 +3792,11 @@ const stopPaymentSubscription = () => requestJson(OkResponseSchema, {
3892
3792
  }).pipe(Effect.asVoid, withOperationErrors(StopSubscriptionErrorSpec));
3893
3793
  const getPaymentVoucherInfo = (code) => decodeAndRun(NonEmptyStringSchema, code, (decodedCode) => requestJson(PaymentVoucherInfoSchema, {
3894
3794
  method: "GET",
3895
- path: `/v2/payment/redeem_voucher/${encodeURIComponent(decodedCode)}`
3795
+ path: `/v2/payment/redeem_voucher/${encodePathSegment(decodedCode)}`
3896
3796
  })).pipe(withOperationErrors(GetPaymentVoucherInfoErrorSpec));
3897
3797
  const redeemPaymentVoucher = (code) => decodeAndRun(NonEmptyStringSchema, code, (decodedCode) => requestJson(OkResponseSchema, {
3898
3798
  method: "POST",
3899
- path: `/v2/payment/redeem_voucher/${encodeURIComponent(decodedCode)}`
3799
+ path: `/v2/payment/redeem_voucher/${encodePathSegment(decodedCode)}`
3900
3800
  })).pipe(Effect.asVoid, withOperationErrors(RedeemPaymentVoucherErrorSpec));
3901
3801
  const reportPayments = (paymentIds) => decodeAndRun(PaymentIdsSchema, paymentIds, (decodedPaymentIds) => requestJson(OkResponseSchema, {
3902
3802
  body: {
@@ -3916,11 +3816,11 @@ const createPaddleWaitingPayment = (input) => decodeAndRun(PaymentPaddleWaitingP
3916
3816
  })).pipe(Effect.asVoid, withOperationErrors(CreatePaddleWaitingPaymentErrorSpec));
3917
3817
  const getPaddleBillingInvoiceUrl = (paymentId) => decodeAndRun(PositiveIntegerSchema, paymentId, (decodedPaymentId) => requestJson(PaymentPaddleBillingInvoiceEnvelopeSchema, {
3918
3818
  method: "GET",
3919
- path: `/v2/payment/methods/paddle_billing/invoice/${encodeURIComponent(decodedPaymentId)}`
3819
+ path: `/v2/payment/methods/paddle_billing/invoice/${encodePathSegment(decodedPaymentId)}`
3920
3820
  }).pipe(selectJsonField("url"))).pipe(withOperationErrors(GetPaddleBillingInvoiceUrlErrorSpec));
3921
3821
  const createPaddleBillingUpdatePaymentMethodTransaction = (userSubscriptionId) => decodeAndRun(PositiveIntegerSchema, userSubscriptionId, (decodedUserSubscriptionId) => requestJson(PaymentPaddleBillingUpdatePaymentMethodEnvelopeSchema, {
3922
3822
  method: "GET",
3923
- path: `/v2/payment/methods/paddle_billing/update_payment_method/${encodeURIComponent(decodedUserSubscriptionId)}`
3823
+ path: `/v2/payment/methods/paddle_billing/update_payment_method/${encodePathSegment(decodedUserSubscriptionId)}`
3924
3824
  }).pipe(selectJsonField("transaction_id"))).pipe(withOperationErrors(CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec));
3925
3825
  const createOpenNodeCharge = (planPath) => decodeAndRun(NonEmptyStringSchema, planPath, (decodedPlanPath) => requestJson(PaymentOpenNodeChargeEnvelopeSchema, {
3926
3826
  body: {
@@ -3929,9 +3829,8 @@ const createOpenNodeCharge = (planPath) => decodeAndRun(NonEmptyStringSchema, pl
3929
3829
  },
3930
3830
  method: "POST",
3931
3831
  path: "/v2/payment/methods/opennode/charge"
3932
- }).pipe(selectJsonField("opennode"), Effect.map(({ checkout_url }) => checkout_url))).pipe(withOperationErrors(CreateOpenNodeChargeErrorSpec));
3933
- //#endregion
3934
- //#region src/domains/podcast.ts
3832
+ }).pipe(selectJsonField("opennode"), selectJsonField("checkout_url"))).pipe(withOperationErrors(CreateOpenNodeChargeErrorSpec));
3833
+ // src/domains/podcast.ts
3935
3834
  const PodcastLinkTypeSchema = Schema.Literals([
3936
3835
  "all",
3937
3836
  "audio",
@@ -3953,16 +3852,15 @@ const PodcastLinksEnvelopeSchema = Schema.Struct({
3953
3852
  status: Schema.Literal("OK"),
3954
3853
  token: Schema.String
3955
3854
  });
3956
- const getPodcastLinks = (input) => Schema.decodeUnknownEffect(PodcastGetLinksInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(PodcastLinksEnvelopeSchema, {
3855
+ const getPodcastLinks = (input) => decodeAndRun(PodcastGetLinksInputSchema, input, (decodedInput) => requestJson(PodcastLinksEnvelopeSchema, {
3957
3856
  method: "GET",
3958
3857
  path: "/v2/podcast/links",
3959
3858
  query: {
3960
3859
  parent_id: decodedInput.parentId,
3961
3860
  type: decodedInput.types ? joinCsv(decodedInput.types) : void 0
3962
3861
  }
3963
- })), selectJsonFields("links", "token"));
3964
- //#endregion
3965
- //#region src/domains/rss.ts
3862
+ })).pipe(selectJsonFields("links", "token"));
3863
+ // src/domains/rss.ts
3966
3864
  const RssFeedSchema = Schema.Struct({
3967
3865
  created_at: Schema.String,
3968
3866
  delete_old_files: Schema.Boolean,
@@ -4236,74 +4134,68 @@ const toCreateBody = (params) => ({
4236
4134
  unwanted_keywords: params.unwanted_keywords ?? ""
4237
4135
  });
4238
4136
  const toUpdateBody = (params) => ({
4239
- delete_old_files: params.delete_old_files,
4240
- dont_process_whole_feed: params.dont_process_whole_feed,
4241
- keyword: params.keyword ?? void 0,
4242
- parent_dir_id: params.parent_dir_id,
4243
- rss_source_url: params.rss_source_url,
4244
- title: params.title,
4245
- unwanted_keywords: params.unwanted_keywords ?? ""
4137
+ ...toCreateBody(params),
4138
+ delete_old_files: params.delete_old_files
4246
4139
  });
4247
4140
  const listRssFeeds = () => requestJson(RssFeedsEnvelopeSchema, {
4248
4141
  method: "GET",
4249
4142
  path: "/v2/rss/list"
4250
4143
  }).pipe(selectJsonField("feeds"), withOperationErrors(ListRssFeedsErrorSpec));
4251
- const getRssFeed = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(RssFeedEnvelopeSchema, {
4144
+ const getRssFeed = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(RssFeedEnvelopeSchema, {
4252
4145
  method: "GET",
4253
4146
  path: `/v2/rss/${encodePathSegment(decodedId)}`
4254
- })), selectJsonField("feed"), withOperationErrors(GetRssFeedErrorSpec));
4255
- const createRssFeed = (params) => Schema.decodeUnknownEffect(RssFeedParamsSchema, { onExcessProperty: "error" })(params).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedParams) => requestJson(RssFeedEnvelopeSchema, {
4147
+ })).pipe(selectJsonField("feed"), withOperationErrors(GetRssFeedErrorSpec));
4148
+ const createRssFeed = (params) => decodeAndRun(RssFeedParamsSchema, params, (decodedParams) => requestJson(RssFeedEnvelopeSchema, {
4256
4149
  body: {
4257
4150
  type: "form",
4258
4151
  value: toCreateBody(decodedParams)
4259
4152
  },
4260
4153
  method: "POST",
4261
4154
  path: "/v2/rss/create"
4262
- })), selectJsonField("feed"), withOperationErrors(CreateRssFeedErrorSpec));
4263
- const updateRssFeed = (id, params) => Schema.decodeUnknownEffect(RssFeedUpdateInputSchema, { onExcessProperty: "error" })({
4155
+ })).pipe(selectJsonField("feed"), withOperationErrors(CreateRssFeedErrorSpec));
4156
+ const updateRssFeed = (id, params) => decodeAndRun(RssFeedUpdateInputSchema, {
4264
4157
  id,
4265
4158
  params
4266
- }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
4159
+ }, (decodedInput) => requestJson(OkResponseSchema, {
4267
4160
  body: {
4268
4161
  type: "form",
4269
4162
  value: toUpdateBody(decodedInput.params)
4270
4163
  },
4271
4164
  method: "POST",
4272
4165
  path: `/v2/rss/${encodePathSegment(decodedInput.id)}`
4273
- })), withOperationErrors(UpdateRssFeedErrorSpec));
4274
- const pauseRssFeed = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
4166
+ })).pipe(withOperationErrors(UpdateRssFeedErrorSpec));
4167
+ const pauseRssFeed = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(OkResponseSchema, {
4275
4168
  method: "POST",
4276
4169
  path: `/v2/rss/${encodePathSegment(decodedId)}/pause`
4277
- })), withOperationErrors(PauseRssFeedErrorSpec));
4278
- const resumeRssFeed = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
4170
+ })).pipe(withOperationErrors(PauseRssFeedErrorSpec));
4171
+ const resumeRssFeed = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(OkResponseSchema, {
4279
4172
  method: "POST",
4280
4173
  path: `/v2/rss/${encodePathSegment(decodedId)}/resume`
4281
- })), withOperationErrors(ResumeRssFeedErrorSpec));
4282
- const deleteRssFeed = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
4174
+ })).pipe(withOperationErrors(ResumeRssFeedErrorSpec));
4175
+ const deleteRssFeed = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(OkResponseSchema, {
4283
4176
  method: "POST",
4284
4177
  path: `/v2/rss/${encodePathSegment(decodedId)}/delete`
4285
- })), withOperationErrors(DeleteRssFeedErrorSpec));
4286
- const listRssFeedItems = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(RssFeedItemsEnvelopeSchema, {
4178
+ })).pipe(withOperationErrors(DeleteRssFeedErrorSpec));
4179
+ const listRssFeedItems = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(RssFeedItemsEnvelopeSchema, {
4287
4180
  method: "GET",
4288
4181
  path: `/v2/rss/${encodePathSegment(decodedId)}/items`
4289
- })), selectJsonFields("feed", "items"), withOperationErrors(ListRssFeedItemsErrorSpec));
4290
- const clearRssFeedLogs = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
4182
+ })).pipe(selectJsonFields("feed", "items"), withOperationErrors(ListRssFeedItemsErrorSpec));
4183
+ const clearRssFeedLogs = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(OkResponseSchema, {
4291
4184
  method: "POST",
4292
4185
  path: `/v2/rss/${encodePathSegment(decodedId)}/clear-log`
4293
- })), withOperationErrors(ClearRssFeedLogsErrorSpec));
4294
- const retryRssFeedItem = (feedId, itemId) => Schema.decodeUnknownEffect(RssFeedItemRetryInputSchema, { onExcessProperty: "error" })({
4186
+ })).pipe(withOperationErrors(ClearRssFeedLogsErrorSpec));
4187
+ const retryRssFeedItem = (feedId, itemId) => decodeAndRun(RssFeedItemRetryInputSchema, {
4295
4188
  feedId,
4296
4189
  itemId
4297
- }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
4190
+ }, (decodedInput) => requestJson(OkResponseSchema, {
4298
4191
  method: "POST",
4299
4192
  path: `/v2/rss/${encodePathSegment(decodedInput.feedId)}/items/${encodePathSegment(decodedInput.itemId)}/retry`
4300
- })), withOperationErrors(RetryRssFeedItemErrorSpec));
4301
- const retryAllRssFeedItems = (feedId) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(feedId).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedFeedId) => requestJson(OkResponseSchema, {
4193
+ })).pipe(withOperationErrors(RetryRssFeedItemErrorSpec));
4194
+ const retryAllRssFeedItems = (feedId) => decodeAndRun(PositiveIntegerSchema, feedId, (decodedFeedId) => requestJson(OkResponseSchema, {
4302
4195
  method: "POST",
4303
4196
  path: `/v2/rss/${encodePathSegment(decodedFeedId)}/retry-all`
4304
- })), withOperationErrors(RetryAllRssFeedItemsErrorSpec));
4305
- //#endregion
4306
- //#region src/domains/sharing.ts
4197
+ })).pipe(withOperationErrors(RetryAllRssFeedItemsErrorSpec));
4198
+ // src/domains/sharing.ts
4307
4199
  const SharingCloneStatusSchema = Schema.Literals([
4308
4200
  "NEW",
4309
4201
  "PROCESSING",
@@ -4384,22 +4276,7 @@ const PublicSharesEnvelopeSchema = Schema.Struct({
4384
4276
  public_shares: Schema.Array(PublicShareSchema),
4385
4277
  status: Schema.optional(Schema.Literal("OK"))
4386
4278
  });
4387
- const PublicShareFileListEnvelopeSchema = Schema.Struct({
4388
- breadcrumbs: Schema.optional(Schema.Array(Schema.Tuple([Schema.Int, Schema.String]))),
4389
- cursor: Schema.NullOr(Schema.String),
4390
- files: Schema.Array(FileBroadSchema),
4391
- parent: Schema.NullOr(FileBroadSchema),
4392
- status: Schema.Literal("OK"),
4393
- total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))
4394
- });
4395
- const PublicShareFileListContinueEnvelopeSchema = Schema.Struct({
4396
- breadcrumbs: Schema.optional(Schema.Array(Schema.Tuple([Schema.Int, Schema.String]))),
4397
- cursor: Schema.NullOr(Schema.String),
4398
- files: Schema.Array(FileBroadSchema),
4399
- parent: Schema.optional(Schema.NullOr(FileBroadSchema)),
4400
- status: Schema.Literal("OK"),
4401
- total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))
4402
- });
4279
+ const PublicShareFileListContinueEnvelopeSchema = FilesListEnvelopeSchema.pipe(Schema.fieldsAssign({ parent: Schema.optional(Schema.NullOr(FileBroadSchema)) }));
4403
4280
  const PublicShareFileUrlEnvelopeSchema = Schema.Struct({
4404
4281
  status: Schema.optional(Schema.Literal("OK")),
4405
4282
  url: Schema.String
@@ -4617,7 +4494,7 @@ const GetPublicShareFileUrlErrorSpec = definePutioOperationErrorSpec({
4617
4494
  ]
4618
4495
  });
4619
4496
  const toShareTarget = (target) => target.type === "everyone" ? "everyone" : target.friendNames.join(",");
4620
- const cloneSharedFiles = (input = {}) => Schema.decodeUnknownEffect(SharingCloneInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(SharingCloneEnvelopeSchema, {
4497
+ const cloneSharedFiles = (input = {}) => decodeAndRun(SharingCloneInputSchema, input, (decodedInput) => requestJson(SharingCloneEnvelopeSchema, {
4621
4498
  body: {
4622
4499
  type: "form",
4623
4500
  value: {
@@ -4627,12 +4504,12 @@ const cloneSharedFiles = (input = {}) => Schema.decodeUnknownEffect(SharingClone
4627
4504
  },
4628
4505
  method: "POST",
4629
4506
  path: "/v2/sharing/clone"
4630
- })), selectJsonFields("id"), withOperationErrors(CreateSharingCloneErrorSpec));
4631
- const getSharingCloneInfo = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(SharingCloneInfoSchema, {
4507
+ })).pipe(selectJsonFields("id"), withOperationErrors(CreateSharingCloneErrorSpec));
4508
+ const getSharingCloneInfo = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(SharingCloneInfoSchema, {
4632
4509
  method: "GET",
4633
4510
  path: `/v2/sharing/clone/${encodePathSegment(decodedId)}`
4634
- })), withOperationErrors(GetSharingCloneInfoErrorSpec));
4635
- const shareFiles = (input) => Schema.decodeUnknownEffect(SharingShareInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
4511
+ })).pipe(withOperationErrors(GetSharingCloneInfoErrorSpec));
4512
+ const shareFiles = (input) => decodeAndRun(SharingShareInputSchema, input, (decodedInput) => requestJson(OkResponseSchema, {
4636
4513
  body: {
4637
4514
  type: "form",
4638
4515
  value: {
@@ -4642,48 +4519,48 @@ const shareFiles = (input) => Schema.decodeUnknownEffect(SharingShareInputSchema
4642
4519
  },
4643
4520
  method: "POST",
4644
4521
  path: "/v2/files/share"
4645
- })), withOperationErrors(ShareFilesErrorSpec));
4522
+ })).pipe(withOperationErrors(ShareFilesErrorSpec));
4646
4523
  const listSharedFiles = () => requestJson(SharedFilesEnvelopeSchema, {
4647
4524
  method: "GET",
4648
4525
  path: "/v2/files/shared"
4649
4526
  }).pipe(selectJsonField("shared"), withOperationErrors(ListSharedFilesErrorSpec));
4650
- const getSharedWith = (fileId) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedFileId) => requestJson(SharedFileSharedWithSchema, {
4527
+ const getSharedWith = (fileId) => decodeAndRun(PositiveIntegerSchema, fileId, (decodedFileId) => requestJson(SharedFileSharedWithSchema, {
4651
4528
  method: "GET",
4652
4529
  path: `/v2/files/${encodePathSegment(decodedFileId)}/shared-with-v2`
4653
- })), withOperationErrors(GetSharedWithErrorSpec));
4654
- const unshareFile = (input) => Schema.decodeUnknownEffect(SharingUnshareInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
4530
+ })).pipe(withOperationErrors(GetSharedWithErrorSpec));
4531
+ const unshareFile = (input) => decodeAndRun(SharingUnshareInputSchema, input, (decodedInput) => requestJson(OkResponseSchema, {
4655
4532
  body: {
4656
4533
  type: "form",
4657
4534
  value: { shares: joinCsv(decodedInput.shares) ?? "everyone" }
4658
4535
  },
4659
4536
  method: "POST",
4660
4537
  path: `/v2/files/${encodePathSegment(decodedInput.fileId)}/unshare`
4661
- })), withOperationErrors(UnshareFileErrorSpec));
4662
- const createPublicShare = (fileId) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedFileId) => requestJson(PublicShareEnvelopeSchema, {
4538
+ })).pipe(withOperationErrors(UnshareFileErrorSpec));
4539
+ const createPublicShare = (fileId) => decodeAndRun(PositiveIntegerSchema, fileId, (decodedFileId) => requestJson(PublicShareEnvelopeSchema, {
4663
4540
  method: "POST",
4664
4541
  path: `/v2/public_share/${encodePathSegment(decodedFileId)}`
4665
- })), selectJsonField("public_share"), withOperationErrors(CreatePublicShareErrorSpec));
4542
+ })).pipe(selectJsonField("public_share"), withOperationErrors(CreatePublicShareErrorSpec));
4666
4543
  const listPublicShares = () => requestJson(PublicSharesEnvelopeSchema, {
4667
4544
  method: "GET",
4668
4545
  path: "/v2/public_share/list"
4669
4546
  }).pipe(selectJsonField("public_shares"), withOperationErrors(ListPublicSharesErrorSpec));
4670
- const deletePublicShare = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
4547
+ const deletePublicShare = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(OkResponseSchema, {
4671
4548
  method: "DELETE",
4672
4549
  path: `/v2/public_share/${encodePathSegment(decodedId)}`
4673
- })), withOperationErrors(DeletePublicShareErrorSpec));
4550
+ })).pipe(withOperationErrors(DeletePublicShareErrorSpec));
4674
4551
  const getPublicShare = () => requestJson(PublicShareEnvelopeSchema, {
4675
4552
  method: "GET",
4676
4553
  path: "/v2/public_share"
4677
4554
  }).pipe(selectJsonField("public_share"), withOperationErrors(GetPublicShareErrorSpec));
4678
- const listPublicShareFiles = (query = {}) => Schema.decodeUnknownEffect(PublicShareListQuerySchema, { onExcessProperty: "error" })(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(PublicShareFileListEnvelopeSchema, {
4555
+ const listPublicShareFiles = (query = {}) => decodeAndRun(PublicShareListQuerySchema, query, (decodedQuery) => requestJson(FilesListEnvelopeSchema, {
4679
4556
  method: "GET",
4680
4557
  path: "/v2/public_share/files/list",
4681
4558
  query: decodedQuery
4682
- })), withOperationErrors(ListPublicShareFilesErrorSpec));
4683
- const continuePublicShareFiles = (cursor, query = {}) => Schema.decodeUnknownEffect(PublicShareContinueInputSchema, { onExcessProperty: "error" })({
4559
+ })).pipe(withOperationErrors(ListPublicShareFilesErrorSpec));
4560
+ const continuePublicShareFiles = (cursor, query = {}) => decodeAndRun(PublicShareContinueInputSchema, {
4684
4561
  cursor,
4685
4562
  query
4686
- }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(PublicShareFileListContinueEnvelopeSchema, {
4563
+ }, (decodedInput) => requestJson(PublicShareFileListContinueEnvelopeSchema, {
4687
4564
  body: {
4688
4565
  type: "form",
4689
4566
  value: { cursor: decodedInput.cursor }
@@ -4691,13 +4568,12 @@ const continuePublicShareFiles = (cursor, query = {}) => Schema.decodeUnknownEff
4691
4568
  method: "POST",
4692
4569
  path: "/v2/public_share/files/list/continue",
4693
4570
  query: decodedInput.query
4694
- })), withOperationErrors(ContinuePublicShareFilesErrorSpec));
4695
- const getPublicShareFileUrl = (fileId) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedFileId) => requestJson(PublicShareFileUrlEnvelopeSchema, {
4571
+ })).pipe(withOperationErrors(ContinuePublicShareFilesErrorSpec));
4572
+ const getPublicShareFileUrl = (fileId) => decodeAndRun(PositiveIntegerSchema, fileId, (decodedFileId) => requestJson(PublicShareFileUrlEnvelopeSchema, {
4696
4573
  method: "GET",
4697
4574
  path: `/v2/public_share/files/${encodePathSegment(decodedFileId)}/url`
4698
- })), selectJsonField("url"), withOperationErrors(GetPublicShareFileUrlErrorSpec));
4699
- //#endregion
4700
- //#region src/domains/trash.ts
4575
+ })).pipe(selectJsonField("url"), withOperationErrors(GetPublicShareFileUrlErrorSpec));
4576
+ // src/domains/trash.ts
4701
4577
  const TrashFileSchema = Schema.Struct({
4702
4578
  content_type: Schema.NullOr(Schema.String),
4703
4579
  created_at: Schema.String,
@@ -4742,23 +4618,19 @@ const TrashContinueInputSchema = Schema.Struct({
4742
4618
  cursor: NonEmptyStringSchema,
4743
4619
  query: TrashListQuerySchema
4744
4620
  });
4745
- const RestrictedReadError = {
4746
- errorType: "invalid_scope",
4747
- statusCode: 401
4748
- };
4749
- const RestrictedWriteError = {
4621
+ const RestrictedScopeError$1 = {
4750
4622
  errorType: "invalid_scope",
4751
4623
  statusCode: 401
4752
4624
  };
4753
4625
  const ListTrashErrorSpec = definePutioOperationErrorSpec({
4754
4626
  domain: "trash",
4755
4627
  operation: "list",
4756
- knownErrors: [RestrictedReadError]
4628
+ knownErrors: [RestrictedScopeError$1]
4757
4629
  });
4758
4630
  const ContinueTrashErrorSpec = definePutioOperationErrorSpec({
4759
4631
  domain: "trash",
4760
4632
  operation: "continue",
4761
- knownErrors: [RestrictedReadError, { statusCode: 400 }]
4633
+ knownErrors: [RestrictedScopeError$1, { statusCode: 400 }]
4762
4634
  });
4763
4635
  const RestoreTrashErrorSpec = definePutioOperationErrorSpec({
4764
4636
  domain: "trash",
@@ -4780,7 +4652,7 @@ const RestoreTrashErrorSpec = definePutioOperationErrorSpec({
4780
4652
  errorType: "TRASH_RESTORE_TOO_MANY_FILES",
4781
4653
  statusCode: 400
4782
4654
  },
4783
- RestrictedWriteError,
4655
+ RestrictedScopeError$1,
4784
4656
  { statusCode: 400 },
4785
4657
  { statusCode: 404 }
4786
4658
  ]
@@ -4797,7 +4669,7 @@ const DeleteTrashErrorSpec = definePutioOperationErrorSpec({
4797
4669
  errorType: "TRASH_LOCK_TIMEOUT",
4798
4670
  statusCode: 400
4799
4671
  },
4800
- RestrictedWriteError,
4672
+ RestrictedScopeError$1,
4801
4673
  { statusCode: 400 },
4802
4674
  { statusCode: 404 }
4803
4675
  ]
@@ -4808,7 +4680,7 @@ const EmptyTrashErrorSpec = definePutioOperationErrorSpec({
4808
4680
  knownErrors: [{
4809
4681
  errorType: "TRASH_LOCK_TIMEOUT",
4810
4682
  statusCode: 400
4811
- }, RestrictedWriteError]
4683
+ }, RestrictedScopeError$1]
4812
4684
  });
4813
4685
  const toBulkTrashBody = (input) => {
4814
4686
  if (input.useCursor === true) return {
@@ -4857,8 +4729,7 @@ const emptyTrash = () => requestJson(OkResponseSchema, {
4857
4729
  method: "POST",
4858
4730
  path: "/v2/trash/empty"
4859
4731
  }).pipe(Effect.asVoid, withOperationErrors(EmptyTrashErrorSpec));
4860
- //#endregion
4861
- //#region src/domains/transfers.ts
4732
+ // src/domains/transfers.ts
4862
4733
  const TransferIdSchema = PositiveIntegerSchema;
4863
4734
  const TransferIdsSchema = Schema.Array(TransferIdSchema).check(Schema.isMinLength(1));
4864
4735
  const TransferTypeSchema = Schema.Literals([
@@ -5298,8 +5169,7 @@ const stopTransferRecording = (id) => decodeAndRun(TransferIdSchema, id, (decode
5298
5169
  method: "POST",
5299
5170
  path: "/v2/transfers/stop-recording"
5300
5171
  })).pipe(withOperationErrors(StopRecordingTransferErrorSpec));
5301
- //#endregion
5302
- //#region src/domains/rate-limits.ts
5172
+ // src/domains/rate-limits.ts
5303
5173
  const RemoveRateLimitBanInputSchema = Schema.Struct({
5304
5174
  captchaToken: NonEmptyStringSchema,
5305
5175
  id: NonEmptyStringSchema
@@ -5338,8 +5208,7 @@ const removeRateLimitBan = (input) => Schema.decodeUnknownEffect(RemoveRateLimit
5338
5208
  method: "DELETE",
5339
5209
  path: `/v2/ban/${encodePathSegment(id)}`
5340
5210
  })), withOperationErrors(RemoveRateLimitBanErrorSpec));
5341
- //#endregion
5342
- //#region src/domains/tunnel.ts
5211
+ // src/domains/tunnel.ts
5343
5212
  const TunnelRouteSchema = Schema.Struct({
5344
5213
  description: Schema.String,
5345
5214
  hosts: Schema.Array(Schema.String),
@@ -5361,8 +5230,7 @@ const listTunnelRoutes = () => requestJson(TunnelRoutesEnvelopeSchema, {
5361
5230
  method: "GET",
5362
5231
  path: "/v2/tunnel/routes"
5363
5232
  }).pipe(selectJsonField("routes"), withOperationErrors(ListTunnelRoutesErrorSpec));
5364
- //#endregion
5365
- //#region src/domains/zips.ts
5233
+ // src/domains/zips.ts
5366
5234
  const ZipStatusSchema = Schema.Literals([
5367
5235
  "NEW",
5368
5236
  "PROCESSING",
@@ -5410,19 +5278,19 @@ const ZipInfoSchema = Schema.Union([
5410
5278
  ZipInfoErrorSchema,
5411
5279
  ZipInfoDoneSchema
5412
5280
  ]);
5413
- const CreateZipInputSchema = makeCursorSelectionSchema("file_ids", "exclude_ids", {});
5414
- const FilesReadScopeError = {
5415
- errorType: "invalid_scope",
5416
- statusCode: 401
5417
- };
5418
- const FilesWriteScopeError = {
5281
+ const CreateZipInputSchema = Schema.Struct({
5282
+ cursor: Schema.optional(NonEmptyStringSchema),
5283
+ exclude_ids: Schema.optional(Schema.Array(PositiveIntegerSchema)),
5284
+ file_ids: Schema.optional(Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1)))
5285
+ }).check(Schema.makeFilter((input) => input.cursor !== void 0 || input.file_ids !== void 0, { expected: "a non-empty cursor or file ID selection" }));
5286
+ const RestrictedScopeError = {
5419
5287
  errorType: "invalid_scope",
5420
5288
  statusCode: 401
5421
5289
  };
5422
5290
  const ListZipsErrorSpec = definePutioOperationErrorSpec({
5423
5291
  domain: "zips",
5424
5292
  operation: "list",
5425
- knownErrors: [FilesReadScopeError]
5293
+ knownErrors: [RestrictedScopeError]
5426
5294
  });
5427
5295
  const CreateZipErrorSpec = definePutioOperationErrorSpec({
5428
5296
  domain: "zips",
@@ -5432,7 +5300,7 @@ const CreateZipErrorSpec = definePutioOperationErrorSpec({
5432
5300
  errorType: "ZIP_TOTAL_SIZE_EXCEEDED",
5433
5301
  statusCode: 403
5434
5302
  },
5435
- FilesWriteScopeError,
5303
+ RestrictedScopeError,
5436
5304
  { statusCode: 400 },
5437
5305
  { statusCode: 403 }
5438
5306
  ]
@@ -5449,7 +5317,7 @@ const GetZipErrorSpec = definePutioOperationErrorSpec({
5449
5317
  errorType: "ERROR_IN_ZIP",
5450
5318
  statusCode: 500
5451
5319
  },
5452
- FilesReadScopeError,
5320
+ RestrictedScopeError,
5453
5321
  { statusCode: 403 },
5454
5322
  { statusCode: 410 },
5455
5323
  { statusCode: 500 }
@@ -5463,7 +5331,7 @@ const CancelZipErrorSpec = definePutioOperationErrorSpec({
5463
5331
  errorType: "LINK_EXPIRED",
5464
5332
  statusCode: 410
5465
5333
  },
5466
- FilesWriteScopeError,
5334
+ RestrictedScopeError,
5467
5335
  { statusCode: 403 },
5468
5336
  { statusCode: 410 }
5469
5337
  ]
@@ -5475,11 +5343,11 @@ const listZips = () => requestJson(ZipsListEnvelopeSchema, {
5475
5343
  const createZip = (input) => decodeAndRun(CreateZipInputSchema, input, (decodedInput) => requestJson(ZipCreateEnvelopeSchema, {
5476
5344
  body: {
5477
5345
  type: "form",
5478
- value: { ...toCursorSelectionForm({
5346
+ value: toCursorSelectionForm({
5479
5347
  cursor: decodedInput.cursor,
5480
5348
  excludeIds: decodedInput.exclude_ids,
5481
5349
  ids: decodedInput.file_ids
5482
- }) }
5350
+ })
5483
5351
  },
5484
5352
  method: "POST",
5485
5353
  path: "/v2/zips/create"
@@ -5492,342 +5360,290 @@ const cancelZip = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) =>
5492
5360
  method: "GET",
5493
5361
  path: `/v2/zips/${encodePathSegment(decodedId)}/cancel`
5494
5362
  })).pipe(Effect.asVoid, withOperationErrors(CancelZipErrorSpec));
5495
- //#endregion
5496
- //#region src/core/client.ts
5497
- const promiseClientRuntimeCache = /* @__PURE__ */ new WeakMap();
5498
- const disposedPromiseClientStates = /* @__PURE__ */ new WeakSet();
5363
+ // src/core/client.ts
5499
5364
  const getPromiseClientRuntime = (state) => {
5500
- if (disposedPromiseClientStates.has(state)) throw mapConfigurationError("This Promise client has been disposed and can no longer execute SDK effects");
5501
- const cachedRuntime = promiseClientRuntimeCache.get(state);
5502
- if (cachedRuntime) return cachedRuntime;
5503
- const runtime = ManagedRuntime.make(makePutioSdkLiveLayer(state.runtimeConfig));
5504
- promiseClientRuntimeCache.set(state, runtime);
5505
- return runtime;
5365
+ if (state.disposed) throw mapConfigurationError("This Promise client has been disposed and can no longer execute SDK effects");
5366
+ state.runtime ??= ManagedRuntime.make(putioSdkLiveLayer(state.runtimeConfig));
5367
+ return state.runtime;
5506
5368
  };
5507
5369
  const disposePromiseClientRuntime = async (state) => {
5508
- disposedPromiseClientStates.add(state);
5509
- const runtime = promiseClientRuntimeCache.get(state);
5510
- promiseClientRuntimeCache.delete(state);
5511
- if (!runtime) return;
5512
- await runtime.dispose();
5370
+ const { runtime } = state;
5371
+ state.disposed = true;
5372
+ state.runtime = void 0;
5373
+ await runtime?.dispose();
5513
5374
  };
5514
- const rejectWithSdkFailure = (exit) => Exit.match(exit, {
5515
- onSuccess: (value) => Promise.resolve(value),
5516
- onFailure: (cause) => {
5517
- const failure = cause.reasons.find(Cause.isFailReason);
5518
- if (failure) return Promise.reject(failure.error);
5519
- return Promise.reject(Cause.squash(cause));
5520
- }
5521
- });
5522
- const provideSdk = async (state, effect) => {
5523
- const operationConfig = {
5524
- ...state.runtimeConfig,
5525
- accessToken: state.accessToken
5526
- };
5527
- const operation = Effect.provideService(effect, PutioSdkConfig, operationConfig);
5528
- return rejectWithSdkFailure(await getPromiseClientRuntime(state).runPromiseExit(operation));
5529
- };
5530
- const snapshotUrl = (value) => typeof value === "string" || value === void 0 ? value : new URL(value.href);
5375
+ const provideSdk = async (state, effect) => getPromiseClientRuntime(state).runPromise(Effect.provideService(effect, PutioSdkConfig, {
5376
+ ...state.runtimeConfig,
5377
+ accessToken: state.accessToken
5378
+ }));
5379
+ const snapshotUrl = (value) => Predicate.isString(value) || value === void 0 ? value : new URL(value.href);
5531
5380
  const snapshotHeaders = (value) => value === void 0 ? void 0 : [...new Headers(value)];
5532
- const operationEntryMarker = Symbol("PutioSdkOperationEntry");
5533
- const operationAtBoundary = (run, boundary) => {
5534
- const entry = {
5535
- boundary,
5536
- run
5537
- };
5538
- Object.defineProperty(entry, operationEntryMarker, { value: true });
5539
- return Object.freeze(entry);
5540
- };
5541
- const inputFree = (operation) => operationAtBoundary(operation, "input-free");
5542
- const pure = (operation) => operationAtBoundary(operation, "pure");
5543
- const validated = (operation) => operationAtBoundary(operation, "validated");
5544
- const isOperationEntry = (value) => typeof value === "object" && value !== null && Object.getPrototypeOf(value) === Object.prototype && Object.isFrozen(value) && Object.hasOwn(value, operationEntryMarker) && value[operationEntryMarker] === true && Object.hasOwn(value, "boundary") && Object.hasOwn(value, "run") && Reflect.ownKeys(value).length === 3 && (value.boundary === "input-free" || value.boundary === "pure" || value.boundary === "validated") && typeof value.run === "function";
5545
- const runClassifiedOperation = (entry, args) => {
5546
- const result = Reflect.apply(entry.run, void 0, args);
5547
- if (entry.boundary === "pure") {
5548
- if (Effect.isEffect(result)) throw new TypeError("Pure SDK operation returned an Effect");
5549
- return result;
5550
- }
5551
- if (!Effect.isEffect(result)) throw new TypeError(`${entry.boundary} SDK operation did not return an Effect`);
5552
- return result;
5553
- };
5554
- const cloneOperationTree = (tree) => Object.fromEntries(Object.entries(tree).map(([key, value]) => [key, isOperationEntry(value) ? value.run : cloneOperationTree(value)]));
5555
- const runPromiseOperation = (entry, state, args) => {
5556
- const result = runClassifiedOperation(entry, args);
5557
- return entry.boundary === "pure" ? result : provideSdk(state, result);
5558
- };
5559
- const makePromiseOperationTree = (tree, state) => Object.fromEntries(Object.entries(tree).map(([key, value]) => [key, isOperationEntry(value) ? (...args) => runPromiseOperation(value, state, args) : makePromiseOperationTree(value, state)]));
5560
- const assertClassifiedOperationTree = (tree, parentPath = "") => {
5561
- const entries = Object.entries(tree);
5562
- if (Object.getPrototypeOf(tree) !== Object.prototype || entries.length === 0) throw new TypeError(`SDK operation namespace ${parentPath || "<root>"} is not a non-empty plain object`);
5563
- for (const [key, value] of entries) {
5564
- const path = parentPath ? `${parentPath}.${key}` : key;
5565
- if (isOperationEntry(value)) continue;
5566
- if (typeof value === "object" && value !== null) assertClassifiedOperationTree(value, path);
5567
- else throw new TypeError(`SDK operation ${path} has no request-boundary classification`);
5381
+ var OperationEntry = class {
5382
+ run;
5383
+ toPromise;
5384
+ constructor(run, toPromise) {
5385
+ this.run = run;
5386
+ this.toPromise = toPromise;
5568
5387
  }
5569
5388
  };
5389
+ const effect = (operation) => new OperationEntry(operation, (state) => (...args) => provideSdk(state, operation(...args)));
5390
+ const pure = (operation) => new OperationEntry(operation, () => operation);
5391
+ const mapOperationTree = (tree, toOperation) => Object.fromEntries(Object.entries(tree).map(([key, value]) => [key, value instanceof OperationEntry ? toOperation(value) : mapOperationTree(value, toOperation)]));
5570
5392
  const sharedOperationTree = {
5571
5393
  account: {
5572
5394
  appSpecificPasswords: {
5573
- create: validated(createAppSpecificPassword),
5574
- delete: validated(deleteAppSpecificPassword),
5575
- deleteAll: inputFree(deleteAllAppSpecificPasswords),
5576
- list: inputFree(listAppSpecificPasswords)
5577
- },
5578
- clear: validated(clearAccount),
5579
- destroy: validated(destroyAccount),
5580
- getInfo: validated(getAccountInfo),
5581
- getSettings: inputFree(getAccountSettings),
5582
- listSubtitleLanguages: inputFree(listAccountSubtitleLanguages),
5583
- listConfirmations: validated(listAccountConfirmations),
5584
- saveSettings: validated(saveAccountSettings)
5395
+ create: effect(createAppSpecificPassword),
5396
+ delete: effect(deleteAppSpecificPassword),
5397
+ deleteAll: effect(deleteAllAppSpecificPasswords),
5398
+ list: effect(listAppSpecificPasswords)
5399
+ },
5400
+ clear: effect(clearAccount),
5401
+ destroy: effect(destroyAccount),
5402
+ getInfo: effect(getAccountInfo),
5403
+ getSettings: effect(getAccountSettings),
5404
+ listSubtitleLanguages: effect(listAccountSubtitleLanguages),
5405
+ listConfirmations: effect(listAccountConfirmations),
5406
+ saveSettings: effect(saveAccountSettings)
5585
5407
  },
5586
5408
  auth: {
5587
5409
  buildLoginUrl: pure(buildAuthLoginUrl),
5588
- checkCodeMatch: validated(checkCodeMatch),
5589
- clients: inputFree(clients),
5590
- exchangeAuthorizationCode: validated(exchangeOAuthAuthorizationCode),
5591
- exists: validated(exists),
5592
- forgotPassword: validated(forgotPassword),
5593
- getCode: validated(getCode),
5594
- getFamilyInvite: validated(getFamilyInvite),
5595
- getFriendInvite: validated(getFriendInvite),
5596
- getGiftCard: validated(getGiftCard),
5597
- getVoucher: validated(getVoucher),
5598
- grants: inputFree(grants),
5599
- linkDevice: validated(linkDevice),
5600
- login: validated(login),
5601
- logout: inputFree(logout),
5602
- register: validated(register),
5603
- resetPassword: validated(resetPassword),
5604
- revokeAllClients: inputFree(revokeAllClients),
5605
- revokeApp: validated(revokeApp),
5606
- revokeClient: validated(revokeClient),
5410
+ checkCodeMatch: effect(checkCodeMatch),
5411
+ clients: effect(clients),
5412
+ exchangeAuthorizationCode: effect(exchangeOAuthAuthorizationCode),
5413
+ exists: effect(exists),
5414
+ forgotPassword: effect(forgotPassword),
5415
+ getCode: effect(getCode),
5416
+ getFamilyInvite: effect(getFamilyInvite),
5417
+ getFriendInvite: effect(getFriendInvite),
5418
+ getGiftCard: effect(getGiftCard),
5419
+ getVoucher: effect(getVoucher),
5420
+ grants: effect(grants),
5421
+ linkDevice: effect(linkDevice),
5422
+ login: effect(login),
5423
+ logout: effect(logout),
5424
+ register: effect(register),
5425
+ resetPassword: effect(resetPassword),
5426
+ revokeAllClients: effect(revokeAllClients),
5427
+ revokeApp: effect(revokeApp),
5428
+ revokeClient: effect(revokeClient),
5607
5429
  twoFactor: {
5608
- generateTOTP: inputFree(generateTOTP),
5609
- getRecoveryCodes: inputFree(getRecoveryCodes),
5610
- regenerateRecoveryCodes: inputFree(regenerateRecoveryCodes),
5611
- verifyTOTP: validated(verifyTOTP)
5430
+ generateTOTP: effect(generateTOTP),
5431
+ getRecoveryCodes: effect(getRecoveryCodes),
5432
+ regenerateRecoveryCodes: effect(regenerateRecoveryCodes),
5433
+ verifyTOTP: effect(verifyTOTP)
5612
5434
  },
5613
- validateToken: validated(validateToken)
5435
+ validateToken: effect(validateToken)
5614
5436
  },
5615
5437
  config: {
5616
- deleteKey: validated(deleteConfigKey),
5617
- getKey: validated(getConfigKey),
5618
- getKeyWith: validated(getConfigKeyWith),
5619
- read: inputFree(readConfig),
5620
- readWith: validated(readConfigWith),
5621
- setKey: validated(setConfigKey),
5622
- write: validated(writeConfig)
5438
+ deleteKey: effect(deleteConfigKey),
5439
+ getKey: effect(getConfigKey),
5440
+ getKeyWith: effect(getConfigKeyWith),
5441
+ read: effect(readConfig),
5442
+ readWith: effect(readConfigWith),
5443
+ setKey: effect(setConfigKey),
5444
+ write: effect(writeConfig)
5623
5445
  },
5624
5446
  downloadLinks: {
5625
- create: validated(createDownloadLinks),
5626
- get: validated(getDownloadLinks)
5447
+ create: effect(createDownloadLinks),
5448
+ get: effect(getDownloadLinks)
5627
5449
  },
5628
5450
  events: {
5629
- clear: inputFree(clearEvents),
5630
- delete: validated(deleteEvent),
5631
- getTorrent: validated(getEventTorrent),
5632
- list: validated(listEvents)
5451
+ clear: effect(clearEvents),
5452
+ delete: effect(deleteEvent),
5453
+ getTorrent: effect(getEventTorrent),
5454
+ list: effect(listEvents)
5633
5455
  },
5634
5456
  family: {
5635
- createInvite: inputFree(createFamilyInvite),
5636
- join: validated(joinFamily),
5637
- listInvites: inputFree(listFamilyInvites),
5638
- listMembers: inputFree(listFamilyMembers),
5639
- removeMember: validated(removeFamilyMember)
5457
+ createInvite: effect(createFamilyInvite),
5458
+ join: effect(joinFamily),
5459
+ listInvites: effect(listFamilyInvites),
5460
+ listMembers: effect(listFamilyMembers),
5461
+ removeMember: effect(removeFamilyMember)
5640
5462
  },
5641
5463
  ifttt: {
5642
- getStatus: inputFree(getIftttStatus),
5643
- sendEvent: validated(sendIftttEvent)
5464
+ getStatus: effect(getIftttStatus),
5465
+ sendEvent: effect(sendIftttEvent)
5644
5466
  },
5645
- podcast: { getLinks: validated(getPodcastLinks) },
5467
+ podcast: { getLinks: effect(getPodcastLinks) },
5646
5468
  files: {
5647
- canWrite: validated(canWriteFile),
5648
- continue: validated(continueFiles),
5649
- continueSearch: validated(continueSearch),
5650
- copy: validated(copyFile),
5651
- convertToMp4: validated(convertFileToMp4),
5652
- convertManyToMp4: validated(convertFilesToMp4),
5653
- convertSelectionToMp4: validated(convertFileSelectionToMp4),
5654
- createUploadRequest: validated(createFileUploadRequest),
5655
- createFolder: validated(createFolder),
5656
- deleteExtraction: validated(deleteFileExtraction),
5657
- deleteMp4: validated(deleteFileMp4),
5658
- deleteSelection: validated(deleteFileSelection),
5659
- delete: validated(deleteFiles),
5660
- extract: validated(extractFiles),
5661
- findNext: validated(findNextFile),
5662
- findNextVideo: validated(findNextVideo),
5663
- getApiContentUrl: validated(getApiContentUrl),
5664
- getApiDownloadUrl: validated(getApiDownloadUrl),
5665
- getApiMp4DownloadUrl: validated(getApiMp4DownloadUrl),
5666
- get: validated(getFile),
5667
- getChild: validated(getFileChild),
5668
- getDownloadUrl: validated(getDownloadUrl),
5669
- getHlsMasterPlaylist: validated(getHlsMasterPlaylist),
5670
- getHlsStreamUrl: validated(getHlsStreamUrl),
5671
- getXspfPlaylistUrl: validated(getXspfPlaylistUrl),
5672
- getMp4Status: validated(getMp4Status),
5673
- getStartFrom: validated(getStartFrom),
5674
- list: validated(queryFiles),
5675
- listActiveConversions: inputFree(listActiveMp4Conversions),
5676
- listExtractions: inputFree(listFileExtractions),
5677
- listSubtitles: validated(listFileSubtitles),
5678
- move: validated(moveFiles),
5679
- moveSelection: validated(moveFileSelection),
5680
- putMp4ToMyFiles: validated(putMp4ToMyFiles),
5681
- rename: validated(renameFile),
5682
- resetSortSettings: inputFree(resetFileSortSettings),
5683
- resetStartFrom: validated(resetStartFrom),
5684
- search: validated(searchFiles),
5685
- setSort: validated(setFileSort),
5686
- setWatchStatus: validated(setFilesWatchStatus),
5687
- setStartFrom: validated(setStartFrom),
5688
- touch: validated(touchFiles),
5689
- upload: validated(uploadFile)
5469
+ canWrite: effect(canWriteFile),
5470
+ continue: effect(continueFiles),
5471
+ continueSearch: effect(continueSearch),
5472
+ copy: effect(copyFile),
5473
+ convertToMp4: effect(convertFileToMp4),
5474
+ convertManyToMp4: effect(convertFilesToMp4),
5475
+ convertSelectionToMp4: effect(convertFileSelectionToMp4),
5476
+ createUploadRequest: effect(createFileUploadRequest),
5477
+ createFolder: effect(createFolder),
5478
+ deleteExtraction: effect(deleteFileExtraction),
5479
+ deleteMp4: effect(deleteFileMp4),
5480
+ deleteSelection: effect(deleteFileSelection),
5481
+ delete: effect(deleteFiles),
5482
+ extract: effect(extractFiles),
5483
+ findNext: effect(findNextFile),
5484
+ findNextVideo: effect(findNextVideo),
5485
+ getApiContentUrl: effect(getApiContentUrl),
5486
+ getApiDownloadUrl: effect(getApiDownloadUrl),
5487
+ getApiMp4DownloadUrl: effect(getApiMp4DownloadUrl),
5488
+ get: effect(getFile),
5489
+ getChild: effect(getFileChild),
5490
+ getDownloadUrl: effect(getDownloadUrl),
5491
+ getHlsMasterPlaylist: effect(getHlsMasterPlaylist),
5492
+ getHlsStreamUrl: effect(getHlsStreamUrl),
5493
+ getXspfPlaylistUrl: effect(getXspfPlaylistUrl),
5494
+ getMp4Status: effect(getMp4Status),
5495
+ getStartFrom: effect(getStartFrom),
5496
+ list: effect(queryFiles),
5497
+ listActiveConversions: effect(listActiveMp4Conversions),
5498
+ listExtractions: effect(listFileExtractions),
5499
+ listSubtitles: effect(listFileSubtitles),
5500
+ move: effect(moveFiles),
5501
+ moveSelection: effect(moveFileSelection),
5502
+ putMp4ToMyFiles: effect(putMp4ToMyFiles),
5503
+ rename: effect(renameFile),
5504
+ resetSortSettings: effect(resetFileSortSettings),
5505
+ resetStartFrom: effect(resetStartFrom),
5506
+ search: effect(searchFiles),
5507
+ setSort: effect(setFileSort),
5508
+ setWatchStatus: effect(setFilesWatchStatus),
5509
+ setStartFrom: effect(setStartFrom),
5510
+ touch: effect(touchFiles),
5511
+ upload: effect(uploadFile)
5690
5512
  },
5691
5513
  friendInvites: {
5692
- create: inputFree(createFriendInvite),
5693
- list: inputFree(listFriendInvites)
5514
+ create: effect(createFriendInvite),
5515
+ list: effect(listFriendInvites)
5694
5516
  },
5695
5517
  friends: {
5696
- approve: validated(approveFriendRequest),
5697
- countWaitingRequests: inputFree(countWaitingRequests),
5698
- deny: validated(denyFriendRequest),
5699
- list: inputFree(listFriends),
5700
- listSentRequests: inputFree(listSentRequests),
5701
- listWaitingRequests: inputFree(listWaitingRequests),
5702
- remove: validated(removeFriend),
5703
- search: validated(searchFriends),
5704
- sendRequest: validated(sendFriendRequest),
5705
- sharedFolder: validated(getFriendSharedFolder)
5518
+ approve: effect(approveFriendRequest),
5519
+ countWaitingRequests: effect(countWaitingRequests),
5520
+ deny: effect(denyFriendRequest),
5521
+ list: effect(listFriends),
5522
+ listSentRequests: effect(listSentRequests),
5523
+ listWaitingRequests: effect(listWaitingRequests),
5524
+ remove: effect(removeFriend),
5525
+ search: effect(searchFriends),
5526
+ sendRequest: effect(sendFriendRequest),
5527
+ sharedFolder: effect(getFriendSharedFolder)
5706
5528
  },
5707
5529
  oauth: {
5708
5530
  buildAuthorizeUrl: pure(buildOAuthAuthorizeUrl),
5709
5531
  buildIconUrl: pure(buildOAuthAppIconUrl),
5710
- create: validated(createOAuthApp),
5711
- delete: validated(deleteOAuthApp),
5712
- get: validated(getOAuthApp),
5713
- getPopularApps: inputFree(getPopularOAuthApps),
5714
- query: inputFree(queryOAuthApps),
5715
- regenerateToken: validated(regenerateOAuthAppToken),
5716
- setIcon: validated(setOAuthAppIcon),
5717
- update: validated(updateOAuthApp)
5532
+ create: effect(createOAuthApp),
5533
+ delete: effect(deleteOAuthApp),
5534
+ get: effect(getOAuthApp),
5535
+ getPopularApps: effect(getPopularOAuthApps),
5536
+ query: effect(queryOAuthApps),
5537
+ regenerateToken: effect(regenerateOAuthAppToken),
5538
+ setIcon: effect(setOAuthAppIcon),
5539
+ update: effect(updateOAuthApp)
5718
5540
  },
5719
5541
  payment: {
5720
5542
  changePlan: {
5721
5543
  classifyResponse: pure(classifyPaymentChangePlanResponse),
5722
- preview: validated(previewPaymentChangePlan),
5723
- submit: validated(submitPaymentChangePlan)
5724
- },
5725
- confirmFastspringOrder: validated(confirmFastspringOrder),
5726
- getInfo: inputFree(getPaymentInfo),
5727
- listHistory: validated(listPaymentHistory),
5728
- listInvites: inputFree(listPaymentInvites),
5729
- listOptions: inputFree(listPaymentOptions),
5730
- listPlans: inputFree(listPaymentPlans),
5544
+ preview: effect(previewPaymentChangePlan),
5545
+ submit: effect(submitPaymentChangePlan)
5546
+ },
5547
+ confirmFastspringOrder: effect(confirmFastspringOrder),
5548
+ getInfo: effect(getPaymentInfo),
5549
+ listHistory: effect(listPaymentHistory),
5550
+ listInvites: effect(listPaymentInvites),
5551
+ listOptions: effect(listPaymentOptions),
5552
+ listPlans: effect(listPaymentPlans),
5731
5553
  methods: {
5732
- addPaddleWaitingPayment: validated(createPaddleWaitingPayment),
5733
- createOpenNodeCharge: validated(createOpenNodeCharge),
5734
- createPaddleBillingUpdatePaymentMethodTransaction: validated(createPaddleBillingUpdatePaymentMethodTransaction),
5735
- getPaddleBillingInvoiceUrl: validated(getPaddleBillingInvoiceUrl)
5554
+ addPaddleWaitingPayment: effect(createPaddleWaitingPayment),
5555
+ createOpenNodeCharge: effect(createOpenNodeCharge),
5556
+ createPaddleBillingUpdatePaymentMethodTransaction: effect(createPaddleBillingUpdatePaymentMethodTransaction),
5557
+ getPaddleBillingInvoiceUrl: effect(getPaddleBillingInvoiceUrl)
5736
5558
  },
5737
- report: validated(reportPayments),
5738
- stopSubscription: inputFree(stopPaymentSubscription),
5559
+ report: effect(reportPayments),
5560
+ stopSubscription: effect(stopPaymentSubscription),
5739
5561
  voucher: {
5740
- getInfo: validated(getPaymentVoucherInfo),
5741
- redeem: validated(redeemPaymentVoucher)
5562
+ getInfo: effect(getPaymentVoucherInfo),
5563
+ redeem: effect(redeemPaymentVoucher)
5742
5564
  }
5743
5565
  },
5744
- rateLimits: { removeBan: validated(removeRateLimitBan) },
5566
+ rateLimits: { removeBan: effect(removeRateLimitBan) },
5745
5567
  rss: {
5746
- clearLogs: validated(clearRssFeedLogs),
5747
- create: validated(createRssFeed),
5748
- delete: validated(deleteRssFeed),
5749
- get: validated(getRssFeed),
5750
- list: inputFree(listRssFeeds),
5751
- listItems: validated(listRssFeedItems),
5752
- pause: validated(pauseRssFeed),
5753
- resume: validated(resumeRssFeed),
5754
- retryAll: validated(retryAllRssFeedItems),
5755
- retryItem: validated(retryRssFeedItem),
5756
- update: validated(updateRssFeed)
5568
+ clearLogs: effect(clearRssFeedLogs),
5569
+ create: effect(createRssFeed),
5570
+ delete: effect(deleteRssFeed),
5571
+ get: effect(getRssFeed),
5572
+ list: effect(listRssFeeds),
5573
+ listItems: effect(listRssFeedItems),
5574
+ pause: effect(pauseRssFeed),
5575
+ resume: effect(resumeRssFeed),
5576
+ retryAll: effect(retryAllRssFeedItems),
5577
+ retryItem: effect(retryRssFeedItem),
5578
+ update: effect(updateRssFeed)
5757
5579
  },
5758
5580
  sharing: {
5759
- clone: validated(cloneSharedFiles),
5760
- getCloneInfo: validated(getSharingCloneInfo),
5761
- getSharedWith: validated(getSharedWith),
5762
- listSharedFiles: inputFree(listSharedFiles),
5581
+ clone: effect(cloneSharedFiles),
5582
+ getCloneInfo: effect(getSharingCloneInfo),
5583
+ getSharedWith: effect(getSharedWith),
5584
+ listSharedFiles: effect(listSharedFiles),
5763
5585
  publicAccess: {
5764
- continueFiles: validated(continuePublicShareFiles),
5765
- get: inputFree(getPublicShare),
5766
- getFileUrl: validated(getPublicShareFileUrl),
5767
- listFiles: validated(listPublicShareFiles)
5586
+ continueFiles: effect(continuePublicShareFiles),
5587
+ get: effect(getPublicShare),
5588
+ getFileUrl: effect(getPublicShareFileUrl),
5589
+ listFiles: effect(listPublicShareFiles)
5768
5590
  },
5769
5591
  publicShares: {
5770
- create: validated(createPublicShare),
5771
- delete: validated(deletePublicShare),
5772
- list: inputFree(listPublicShares)
5592
+ create: effect(createPublicShare),
5593
+ delete: effect(deletePublicShare),
5594
+ list: effect(listPublicShares)
5773
5595
  },
5774
- shareFiles: validated(shareFiles),
5775
- unshare: validated(unshareFile)
5596
+ shareFiles: effect(shareFiles),
5597
+ unshare: effect(unshareFile)
5776
5598
  },
5777
- tunnel: { listRoutes: inputFree(listTunnelRoutes) },
5599
+ tunnel: { listRoutes: effect(listTunnelRoutes) },
5778
5600
  trash: {
5779
- continue: validated(continueTrash),
5780
- delete: validated(deleteTrash),
5781
- empty: inputFree(emptyTrash),
5782
- list: validated(listTrash),
5783
- restore: validated(restoreTrash)
5601
+ continue: effect(continueTrash),
5602
+ delete: effect(deleteTrash),
5603
+ empty: effect(emptyTrash),
5604
+ list: effect(listTrash),
5605
+ restore: effect(restoreTrash)
5784
5606
  },
5785
5607
  transfers: {
5786
- add: validated(addTransfer),
5787
- addMany: validated(addManyTransfers),
5788
- addTrackers: validated(addTransferTrackers),
5789
- cancel: validated(cancelTransfers),
5790
- clean: validated(cleanTransfers),
5791
- continue: validated(continueTransfers),
5792
- count: inputFree(countTransfers),
5793
- get: validated(getTransfer),
5794
- getTorrent: validated(getTransferTorrent),
5795
- info: validated(getTransferInfo),
5796
- list: validated(listTransfers),
5797
- reannounce: validated(reannounceTransfer),
5798
- remove: validated(removeTransfers),
5799
- retry: validated(retryTransfer),
5800
- stopRecording: validated(stopTransferRecording)
5608
+ add: effect(addTransfer),
5609
+ addMany: effect(addManyTransfers),
5610
+ addTrackers: effect(addTransferTrackers),
5611
+ cancel: effect(cancelTransfers),
5612
+ clean: effect(cleanTransfers),
5613
+ continue: effect(continueTransfers),
5614
+ count: effect(countTransfers),
5615
+ get: effect(getTransfer),
5616
+ getTorrent: effect(getTransferTorrent),
5617
+ info: effect(getTransferInfo),
5618
+ list: effect(listTransfers),
5619
+ reannounce: effect(reannounceTransfer),
5620
+ remove: effect(removeTransfers),
5621
+ retry: effect(retryTransfer),
5622
+ stopRecording: effect(stopTransferRecording)
5801
5623
  },
5802
5624
  zips: {
5803
- cancel: validated(cancelZip),
5804
- create: validated(createZip),
5805
- get: validated(getZip),
5806
- list: inputFree(listZips)
5625
+ cancel: effect(cancelZip),
5626
+ create: effect(createZip),
5627
+ get: effect(getZip),
5628
+ list: effect(listZips)
5807
5629
  }
5808
5630
  };
5809
- assertClassifiedOperationTree(sharedOperationTree);
5810
- const createPutioSdkEffectClient = () => cloneOperationTree(sharedOperationTree);
5631
+ const createPutioSdkEffectClient = () => mapOperationTree(sharedOperationTree, (entry) => entry.run);
5811
5632
  var PutioSdk = class extends Context.Service()("PutioSdk") {};
5812
5633
  const makePutioSdkEffectClientLayer = () => Layer.succeed(PutioSdk, createPutioSdkEffectClient());
5813
- const makePutioSdkLiveClientLayer = (config) => Layer.mergeAll(makePutioSdkEffectClientLayer(), makePutioSdkLiveLayer(config));
5634
+ const makePutioSdkLiveClientLayer = (config) => Layer.mergeAll(makePutioSdkEffectClientLayer(), putioSdkLiveLayer(config));
5814
5635
  const createPutioSdkPromiseClient = (initialConfig = {}) => {
5815
- const normalizedConfig = makePutioSdkConfig({
5816
- ...initialConfig,
5817
- baseUrl: snapshotUrl(initialConfig.baseUrl),
5818
- headers: snapshotHeaders(initialConfig.headers),
5819
- uploadBaseUrl: snapshotUrl(initialConfig.uploadBaseUrl),
5820
- webAppUrl: snapshotUrl(initialConfig.webAppUrl)
5821
- });
5822
- const runtimeConfig = {
5823
- baseUrl: normalizedConfig.baseUrl,
5824
- headers: normalizedConfig.headers,
5825
- uploadBaseUrl: normalizedConfig.uploadBaseUrl,
5826
- webAppUrl: normalizedConfig.webAppUrl
5827
- };
5828
5636
  const config = {
5829
5637
  accessToken: initialConfig.accessToken,
5830
- runtimeConfig
5638
+ disposed: false,
5639
+ runtime: void 0,
5640
+ runtimeConfig: Struct.omit(normalizePutioSdkOptions({
5641
+ ...initialConfig,
5642
+ baseUrl: snapshotUrl(initialConfig.baseUrl),
5643
+ headers: snapshotHeaders(initialConfig.headers),
5644
+ uploadBaseUrl: snapshotUrl(initialConfig.uploadBaseUrl),
5645
+ webAppUrl: snapshotUrl(initialConfig.webAppUrl)
5646
+ }), ["accessToken"])
5831
5647
  };
5832
5648
  function getInfo(query = {}) {
5833
5649
  return provideSdk(config, getAccountInfo(query));
@@ -5838,7 +5654,7 @@ const createPutioSdkPromiseClient = (initialConfig = {}) => {
5838
5654
  function getChildByName(input) {
5839
5655
  return provideSdk(config, getFileChild(input));
5840
5656
  }
5841
- const operations = makePromiseOperationTree(sharedOperationTree, config);
5657
+ const operations = mapOperationTree(sharedOperationTree, (entry) => entry.toPromise(config));
5842
5658
  return {
5843
5659
  dispose: () => disposePromiseClientRuntime(config),
5844
5660
  setAccessToken: (accessToken) => {
@@ -5869,7 +5685,6 @@ const createPutioSdkPromiseClient = (initialConfig = {}) => {
5869
5685
  }
5870
5686
  };
5871
5687
  };
5872
- //#endregion
5873
- export { AccountClearOptionsSchema, AccountConfirmationSchema, AccountConfirmationsErrorSpec, AccountDiskSchema, AccountInfoBaseSchema, AccountInfoBroadSchema, AccountInfoQuerySchema, AccountSettingsSchema, AccountSubtitleLanguageSchema, AccountTwoFactorSettingsSchema, AccountWarningsSchema, AddManyTransfersErrorSpec, AddTransferErrorSpec, AddTransferTrackersErrorSpec, AppSpecificPasswordSchema, ApproveFriendRequestErrorSpec, AuthorizationCodeSchema, CanWriteFileErrorSpec, CancelZipErrorSpec, ClearEventsErrorSpec, ClearRssFeedLogsErrorSpec, ClientsErrorSpec, ConfirmFastspringOrderErrorSpec, ContinueFilesErrorSpec, ContinuePublicShareFilesErrorSpec, ContinueTrashErrorSpec, CopyFileErrorSpec, CountWaitingRequestsErrorSpec, CreateAppSpecificPasswordErrorSpec, CreateAppSpecificPasswordInputSchema, CreateDownloadLinksErrorSpec, CreateFamilyInviteErrorSpec, CreateFolderErrorSpec, CreateFriendInviteErrorSpec, CreateOAuthAppErrorSpec, CreateOpenNodeChargeErrorSpec, CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec, CreatePaddleWaitingPaymentErrorSpec, CreatePublicShareErrorSpec, CreateRssFeedErrorSpec, CreateSharingCloneErrorSpec, CreateZipErrorSpec, DEFAULT_PUTIO_API_BASE_URL, DEFAULT_PUTIO_UPLOAD_BASE_URL, DEFAULT_PUTIO_WEB_APP_URL, DeleteAllAppSpecificPasswordsErrorSpec, DeleteAppSpecificPasswordErrorSpec, DeleteEventErrorSpec, DeleteOAuthAppErrorSpec, DeletePublicShareErrorSpec, DeleteRssFeedErrorSpec, DeleteTrashErrorSpec, DenyFriendRequestErrorSpec, DownloadLinksCreateInputSchema, DownloadLinksInfoSchema, DownloadLinksPayloadSchema, DownloadLinksStatusSchema, DownloadUrlErrorSpec, EmptyTrashErrorSpec, EventsListQuerySchema, FamilyInviteLookupErrorSpec, FamilyInviteSchema, FamilyMemberSchema, FileActiveConversionSchema, FileActiveConversionsErrorSpec, FileBaseSchema, FileBreadcrumbSchema, FileBroadSchema, FileConversionStatusSchema, FileCopyInputSchema, FileExtractionSchema, FileExtractionStatusSchema, FileExtractionsErrorSpec, FileGetChildInputSchema, FileMediaInfoFormatSchema, FileMediaInfoSchema, FileMediaInfoStreamSchema, FileMediaMetadataSchema, FileMp4ErrorSpec, FileMp4MutationErrorSpec, FileQuerySchema, FileSetSortInputSchema, FileSortSchema, FileSubtitleSchema, FileSubtitlesErrorSpec, FileTouchInputSchema, FileTypeSchema, FileUploadErrorSpec, FileWatchStatusErrorSpec, FilesListEnvelopeSchema, FilesListQuerySchema, FilesMoveErrorSchema, FilesSearchQuerySchema, FolderTypeSchema, ForgotPasswordErrorSpec, FriendBaseSchema, FriendInviteJoinedUserSchema, FriendInviteJoinedUserStatusSchema, FriendInviteLookupErrorSpec, FriendInviteSchema, FriendSchema, FriendSharedFolderErrorSpec, GenerateTOTPErrorSpec, GenerateTOTPResponseSchema, GetDownloadLinksErrorSpec, GetEventTorrentErrorSpec, GetFileChildErrorSpec, GetFileErrorSpec, GetHlsMasterPlaylistErrorSpec, GetIftttStatusErrorSpec, GetOAuthAppErrorSpec, GetPaddleBillingInvoiceUrlErrorSpec, GetPaymentInfoErrorSpec, GetPaymentVoucherInfoErrorSpec, GetPublicShareErrorSpec, GetPublicShareFileUrlErrorSpec, GetRssFeedErrorSpec, GetSharedWithErrorSpec, GetSharingCloneInfoErrorSpec, GetTransferErrorSpec, GetTransferTorrentErrorSpec, GetZipErrorSpec, GiftCardLookupErrorSpec, GrantsErrorSpec, HistoryEventSchema, HistoryFileFromRssDeletedEventSchema, HistoryFileSharedEventSchema, HistoryKnownEventTypeSchema, HistoryPrivateTorrentPinEventSchema, HistoryRssFilterPausedEventSchema, HistoryTransferCallbackErrorEventSchema, HistoryTransferCompletedEventSchema, HistoryTransferErrorEventSchema, HistoryTransferFromRssErrorEventSchema, HistoryUploadEventSchema, HistoryVoucherEventSchema, HistoryZipCreatedEventSchema, JoinFamilyErrorSpec, JsonObjectSchema, JsonValueSchema, LinkDeviceErrorSpec, ListAppSpecificPasswordsErrorSpec, ListEventsErrorSpec, ListFamilyInvitesErrorSpec, ListFamilyMembersErrorSpec, ListFriendInvitesErrorSpec, ListFriendsErrorSpec, ListPaymentHistoryErrorSpec, ListPaymentInvitesErrorSpec, ListPaymentOptionsErrorSpec, ListPaymentPlansErrorSpec, ListPublicShareFilesErrorSpec, ListPublicSharesErrorSpec, ListRssFeedItemsErrorSpec, ListRssFeedsErrorSpec, ListSentRequestsErrorSpec, ListSharedFilesErrorSpec, ListTransfersErrorSpec, ListTrashErrorSpec, ListTunnelRoutesErrorSpec, ListWaitingRequestsErrorSpec, ListZipsErrorSpec, LoginErrorSpec, LoginResponseSchema, MyOAuthAppSchema, OAuthAppCreateInputSchema, OAuthAppSchema, OAuthAppSessionSchema, OAuthAppUpdateInputSchema, OAuthAppWithTokenSchema, OAuthAuthorizationCodeExchangeError, OAuthAuthorizationCodeExchangeErrorCodeSchema, OAuthAuthorizationCodeExchangeInputSchema, OAuthSetIconInputSchema, OkResponseSchema, OwnedOAuthAppSchema, PasInfoSchema, PauseRssFeedErrorSpec, PaymentChangePlanPreviewSchema, PaymentChangePlanSubmitSchema, PaymentHistoryItemSchema, PaymentInfoPlanSchema, PaymentInfoSchema, PaymentInviteSchema, PaymentOptionPlanTypeSchema, PaymentOptionSchema, PaymentPlanGroupSchema, PaymentPlanTypeSchema, PaymentProviderNameSchema, PaymentProviderSchema, PaymentSubscriptionInfoSchema, PaymentTypeSchema, PaymentVoucherInfoSchema, PodcastGetLinksInputSchema, PodcastLinkTypeSchema, PodcastLinksSchema, PopularOAuthAppSchema, PreviewPaymentChangePlanErrorSpec, PublicShareListQuerySchema, PublicShareSchema, PutioApiError, PutioAuthError, PutioConfigurationError, PutioErrorEnvelopeSchema, PutioHttpClient, PutioOperationError, PutioRateLimitError, PutioSdk, PutioSdkConfig, PutioTransportError, PutioValidationError, QueryFilesErrorSpec, QueryOAuthAppsErrorSpec, ReannounceTransferErrorSpec, RecoveryCodesErrorSpec, RedeemPaymentVoucherErrorSpec, RegenerateOAuthAppTokenErrorSpec, RegenerateRecoveryCodesErrorSpec, RegisterErrorSpec, RegisterInputSchema, RemoveFamilyMemberErrorSpec, RemoveFriendErrorSpec, RemoveRateLimitBanErrorSpec, RemoveTransfersErrorSpec, RenameFileErrorSpec, ReportPaymentsErrorSpec, ResetPasswordErrorSpec, RestoreTrashErrorSpec, ResumeRssFeedErrorSpec, RetryAllRssFeedItemsErrorSpec, RetryRssFeedItemErrorSpec, RetryTransferErrorSpec, RevokeAllOAuthClientsErrorSpec, RevokeOAuthClientErrorSpec, RevokeOAuthGrantErrorSpec, RssFeedItemFailedSchema, RssFeedItemSchema, RssFeedItemSucceededSchema, RssFeedParamsSchema, RssFeedSchema, SHARED_WITH_YOU_ROOT_ID, SaveAccountSettingsErrorSpec, SaveAccountSettingsPayloadSchema, SearchFilesErrorSpec, SearchFriendsErrorSpec, SendFriendRequestErrorSpec, SendIftttEventErrorSpec, ShareFilesErrorSpec, SharedFileSchema, SharedFileShareSchema, SharedFileSharedWithSchema, SharingCloneInfoSchema, SharingCloneInputSchema, SharingCloneStatusSchema, SharingShareInputSchema, SharingUnshareInputSchema, StartFromErrorSpec, StopRecordingTransferErrorSpec, StopSubscriptionErrorSpec, SubmitPaymentChangePlanErrorSpec, TouchFilesErrorSpec, TransferAddInputSchema, TransferAddTrackersInputSchema, TransferBaseSchema, TransferRemoveInputSchema, TransferSchema, TransferStatusSchema, TransferTypeSchema, TransfersListQuerySchema, TrashFileSchema, TunnelRouteSchema, TwoFactorRecoveryCodesSchema, UnshareFileErrorSpec, UpdateOAuthAppErrorSpec, UpdateRssFeedErrorSpec, UserSearchResultSchema, UserSubscriptionStatusSchema, ValidateTokenResponseSchema, VerifyTOTPErrorSpec, VerifyTOTPResponseSchema, VoucherLookupErrorSpec, ZipStatusSchema, addManyTransfers, addTransfer, addTransferTrackers, approveFriendRequest, buildAuthLoginUrl, buildFileApiContentUrl, buildFileApiDownloadUrl, buildFileApiMp4DownloadUrl, buildFileHlsStreamUrl, buildFileXspfPlaylistUrl, buildOAuthAppIconUrl, buildOAuthAuthorizeUrl, buildPutioUrl, canWriteFile, cancelTransfers, cancelZip, checkCodeMatch, classifyPaymentChangePlanResponse, cleanTransfers, clearAccount, clearEvents, clearRssFeedLogs, clients, cloneSharedFiles, confirmFastspringOrder, continueFiles, continuePublicShareFiles, continueSearch, continueTransfers, continueTrash, convertFileSelectionToMp4, convertFileToMp4, convertFilesToMp4, copyFile, countTransfers, countWaitingRequests, createAppSpecificPassword, createDownloadLinks, createFamilyInvite, createFileUploadFormData, createFileUploadRequest, createFolder, createFriendInvite, createOAuthApp, createOpenNodeCharge, createPaddleBillingUpdatePaymentMethodTransaction, createPaddleWaitingPayment, createPublicShare, createPutioSdkEffectClient, createPutioSdkPromiseClient, createRssFeed, createZip, decodePutioErrorEnvelope, definePutioOperationErrorSpec, deleteAllAppSpecificPasswords, deleteAppSpecificPassword, deleteConfigKey, deleteEvent, deleteFileExtraction, deleteFileMp4, deleteFileSelection, deleteFiles, deleteOAuthApp, deletePublicShare, deleteRssFeed, deleteTrash, denyFriendRequest, destroyAccount, emptyTrash, encodePathSegment, exchangeOAuthAuthorizationCode, exists, extractFiles, fallbackPutioErrorEnvelope, findNextFile, findNextVideo, forgotPassword, generateTOTP, getAccountInfo, getAccountSettings, getApiContentUrl, getApiDownloadUrl, getApiMp4DownloadUrl, getCode, getConfigKey, getConfigKeyWith, getDownloadLinks, getDownloadUrl, getEventTorrent, getFamilyInvite, getFile, getFileChild, getFriendInvite, getFriendSharedFolder, getGiftCard, getHlsMasterPlaylist, getHlsStreamUrl, getIftttStatus, getMp4Status, getOAuthApp, getPaddleBillingInvoiceUrl, getPaymentInfo, getPaymentVoucherInfo, getPodcastLinks, getPopularOAuthApps, getPublicShare, getPublicShareFileUrl, getRecoveryCodes, getRssFeed, getSharedWith, getSharingCloneInfo, getStartFrom, getTransfer, getTransferInfo, getTransferTorrent, getVoucher, getXspfPlaylistUrl, getZip, grants, isPutioApiError, isPutioAuthError, isPutioErrorEnvelope, isPutioOperationError, isPutioRateLimitError, joinFamily, linkDevice, listAccountConfirmations, listAccountSubtitleLanguages, listActiveMp4Conversions, listAppSpecificPasswords, listEvents, listFamilyInvites, listFamilyMembers, listFileExtractions, listFileSubtitles, listFriendInvites, listFriends, listPaymentHistory, listPaymentInvites, listPaymentOptions, listPaymentPlans, listPublicShareFiles, listPublicShares, listRssFeedItems, listRssFeeds, listSentRequests, listSharedFiles, listTransfers, listTrash, listTunnelRoutes, listWaitingRequests, listZips, login, logout, makePutioFetchClient, makePutioFetchLayer, makePutioSdkConfig, makePutioSdkEffectClientLayer, makePutioSdkLayer, makePutioSdkLiveClientLayer, makePutioSdkLiveLayer, makeResponseError, mapConfigurationError, mapDecodeErrorToValidationError, mapTransportError, moveFileSelection, moveFiles, parseErrorBody, pauseRssFeed, previewPaymentChangePlan, putMp4ToMyFiles, queryFiles, queryOAuthApps, readConfig, readConfigWith, reannounceTransfer, redeemPaymentVoucher, regenerateOAuthAppToken, regenerateRecoveryCodes, register, removeFamilyMember, removeFriend, removeRateLimitBan, removeTransfers, renameFile, reportPayments, requestArrayBuffer, requestJson, requestText, requestVoid, resetFileSortSettings, resetPassword, resetStartFrom, responseRateLimitHeaders, restoreTrash, resumeRssFeed, retryAllRssFeedItems, retryRssFeedItem, retryTransfer, revokeAllClients, revokeApp, revokeClient, saveAccountSettings, searchFiles, searchFriends, selectJsonField, selectJsonFields, sendFriendRequest, sendIftttEvent, setConfigKey, setFileSort, setFilesWatchStatus, setOAuthAppIcon, setStartFrom, shareFiles, stopPaymentSubscription, stopTransferRecording, submitPaymentChangePlan, touchFiles, unshareFile, updateOAuthApp, updateRssFeed, uploadFile, validateToken, verifyTOTP, withOperationErrors, writeConfig };
5688
+ export { AccountClearOptionsSchema, AccountConfirmationSchema, AccountConfirmationsErrorSpec, AccountDiskSchema, AccountInfoBaseSchema, AccountInfoBroadSchema, AccountInfoQuerySchema, AccountSettingsSchema, AccountSubtitleLanguageSchema, AccountTwoFactorSettingsSchema, AccountWarningsSchema, AddManyTransfersErrorSpec, AddTransferErrorSpec, AddTransferTrackersErrorSpec, AppSpecificPasswordSchema, ApproveFriendRequestErrorSpec, AuthorizationCodeSchema, CanWriteFileErrorSpec, CancelZipErrorSpec, ClearEventsErrorSpec, ClearRssFeedLogsErrorSpec, ClientsErrorSpec, ConfirmFastspringOrderErrorSpec, ContinueFilesErrorSpec, ContinuePublicShareFilesErrorSpec, ContinueTrashErrorSpec, CopyFileErrorSpec, CountWaitingRequestsErrorSpec, CreateAppSpecificPasswordErrorSpec, CreateAppSpecificPasswordInputSchema, CreateDownloadLinksErrorSpec, CreateFamilyInviteErrorSpec, CreateFolderErrorSpec, CreateFriendInviteErrorSpec, CreateOAuthAppErrorSpec, CreateOpenNodeChargeErrorSpec, CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec, CreatePaddleWaitingPaymentErrorSpec, CreatePublicShareErrorSpec, CreateRssFeedErrorSpec, CreateSharingCloneErrorSpec, CreateZipErrorSpec, DEFAULT_PUTIO_API_BASE_URL, DEFAULT_PUTIO_UPLOAD_BASE_URL, DEFAULT_PUTIO_WEB_APP_URL, DeleteAllAppSpecificPasswordsErrorSpec, DeleteAppSpecificPasswordErrorSpec, DeleteEventErrorSpec, DeleteOAuthAppErrorSpec, DeletePublicShareErrorSpec, DeleteRssFeedErrorSpec, DeleteTrashErrorSpec, DenyFriendRequestErrorSpec, DownloadLinksCreateInputSchema, DownloadLinksInfoSchema, DownloadLinksPayloadSchema, DownloadLinksStatusSchema, DownloadUrlErrorSpec, EmptyTrashErrorSpec, EventsListQuerySchema, FamilyInviteLookupErrorSpec, FamilyInviteSchema, FamilyMemberSchema, FileActiveConversionSchema, FileActiveConversionsErrorSpec, FileBaseSchema, FileBreadcrumbSchema, FileBroadSchema, FileConversionStatusSchema, FileCopyInputSchema, FileExtractionSchema, FileExtractionStatusSchema, FileExtractionsErrorSpec, FileGetChildInputSchema, FileMediaInfoFormatSchema, FileMediaInfoSchema, FileMediaInfoStreamSchema, FileMediaMetadataSchema, FileMp4ErrorSpec, FileMp4MutationErrorSpec, FileQuerySchema, FileSetSortInputSchema, FileSortSchema, FileSubtitleSchema, FileSubtitlesErrorSpec, FileTouchInputSchema, FileTypeSchema, FileUploadErrorSpec, FileWatchStatusErrorSpec, FilesListEnvelopeSchema, FilesListQuerySchema, FilesMoveErrorSchema, FilesSearchQuerySchema, FolderTypeSchema, ForgotPasswordErrorSpec, FriendBaseSchema, FriendInviteJoinedUserSchema, FriendInviteJoinedUserStatusSchema, FriendInviteLookupErrorSpec, FriendInviteSchema, FriendSchema, FriendSharedFolderErrorSpec, GenerateTOTPErrorSpec, GenerateTOTPResponseSchema, GetDownloadLinksErrorSpec, GetEventTorrentErrorSpec, GetFileChildErrorSpec, GetFileErrorSpec, GetHlsMasterPlaylistErrorSpec, GetIftttStatusErrorSpec, GetOAuthAppErrorSpec, GetPaddleBillingInvoiceUrlErrorSpec, GetPaymentInfoErrorSpec, GetPaymentVoucherInfoErrorSpec, GetPublicShareErrorSpec, GetPublicShareFileUrlErrorSpec, GetRssFeedErrorSpec, GetSharedWithErrorSpec, GetSharingCloneInfoErrorSpec, GetTransferErrorSpec, GetTransferTorrentErrorSpec, GetZipErrorSpec, GiftCardLookupErrorSpec, GrantsErrorSpec, HistoryEventSchema, HistoryFileFromRssDeletedEventSchema, HistoryFileSharedEventSchema, HistoryKnownEventTypeSchema, HistoryPrivateTorrentPinEventSchema, HistoryRssFilterPausedEventSchema, HistoryTransferCallbackErrorEventSchema, HistoryTransferCompletedEventSchema, HistoryTransferErrorEventSchema, HistoryTransferFromRssErrorEventSchema, HistoryUploadEventSchema, HistoryVoucherEventSchema, HistoryZipCreatedEventSchema, JoinFamilyErrorSpec, JsonObjectSchema, JsonValueSchema, LinkDeviceErrorSpec, ListAppSpecificPasswordsErrorSpec, ListEventsErrorSpec, ListFamilyInvitesErrorSpec, ListFamilyMembersErrorSpec, ListFriendInvitesErrorSpec, ListFriendsErrorSpec, ListPaymentHistoryErrorSpec, ListPaymentInvitesErrorSpec, ListPaymentOptionsErrorSpec, ListPaymentPlansErrorSpec, ListPublicShareFilesErrorSpec, ListPublicSharesErrorSpec, ListRssFeedItemsErrorSpec, ListRssFeedsErrorSpec, ListSentRequestsErrorSpec, ListSharedFilesErrorSpec, ListTransfersErrorSpec, ListTrashErrorSpec, ListTunnelRoutesErrorSpec, ListWaitingRequestsErrorSpec, ListZipsErrorSpec, LoginErrorSpec, LoginResponseSchema, MyOAuthAppSchema, OAuthAppCreateInputSchema, OAuthAppSchema, OAuthAppSessionSchema, OAuthAppUpdateInputSchema, OAuthAppWithTokenSchema, OAuthAuthorizationCodeExchangeError, OAuthAuthorizationCodeExchangeErrorCodeSchema, OAuthAuthorizationCodeExchangeInputSchema, OAuthSetIconInputSchema, OkResponseSchema, OwnedOAuthAppSchema, PasInfoSchema, PauseRssFeedErrorSpec, PaymentChangePlanPreviewSchema, PaymentChangePlanSubmitSchema, PaymentHistoryItemSchema, PaymentInfoPlanSchema, PaymentInfoSchema, PaymentInviteSchema, PaymentOptionPlanTypeSchema, PaymentOptionSchema, PaymentPlanGroupSchema, PaymentPlanTypeSchema, PaymentProviderNameSchema, PaymentProviderSchema, PaymentSubscriptionInfoSchema, PaymentTypeSchema, PaymentVoucherInfoSchema, PodcastGetLinksInputSchema, PodcastLinkTypeSchema, PodcastLinksSchema, PopularOAuthAppSchema, PreviewPaymentChangePlanErrorSpec, PublicShareListQuerySchema, PublicShareSchema, PutioApiError, PutioAuthError, PutioConfigurationError, PutioErrorEnvelopeSchema, PutioHttpClient, PutioOperationError, PutioRateLimitError, PutioSdk, PutioSdkConfig, PutioTransportError, PutioValidationError, QueryFilesErrorSpec, QueryOAuthAppsErrorSpec, ReannounceTransferErrorSpec, RecoveryCodesErrorSpec, RedeemPaymentVoucherErrorSpec, RegenerateOAuthAppTokenErrorSpec, RegenerateRecoveryCodesErrorSpec, RegisterErrorSpec, RegisterInputSchema, RemoveFamilyMemberErrorSpec, RemoveFriendErrorSpec, RemoveRateLimitBanErrorSpec, RemoveTransfersErrorSpec, RenameFileErrorSpec, ReportPaymentsErrorSpec, ResetPasswordErrorSpec, RestoreTrashErrorSpec, ResumeRssFeedErrorSpec, RetryAllRssFeedItemsErrorSpec, RetryRssFeedItemErrorSpec, RetryTransferErrorSpec, RevokeAllOAuthClientsErrorSpec, RevokeOAuthClientErrorSpec, RevokeOAuthGrantErrorSpec, RssFeedItemFailedSchema, RssFeedItemSchema, RssFeedItemSucceededSchema, RssFeedParamsSchema, RssFeedSchema, SHARED_WITH_YOU_ROOT_ID, SaveAccountSettingsErrorSpec, SaveAccountSettingsPayloadSchema, SearchFilesErrorSpec, SearchFriendsErrorSpec, SendFriendRequestErrorSpec, SendIftttEventErrorSpec, ShareFilesErrorSpec, SharedFileSchema, SharedFileShareSchema, SharedFileSharedWithSchema, SharingCloneInfoSchema, SharingCloneInputSchema, SharingCloneStatusSchema, SharingShareInputSchema, SharingUnshareInputSchema, StartFromErrorSpec, StopRecordingTransferErrorSpec, StopSubscriptionErrorSpec, SubmitPaymentChangePlanErrorSpec, TouchFilesErrorSpec, TransferAddInputSchema, TransferAddTrackersInputSchema, TransferBaseSchema, TransferRemoveInputSchema, TransferSchema, TransferStatusSchema, TransferTypeSchema, TransfersListQuerySchema, TrashFileSchema, TunnelRouteSchema, TwoFactorRecoveryCodesSchema, UnshareFileErrorSpec, UpdateOAuthAppErrorSpec, UpdateRssFeedErrorSpec, UserSearchResultSchema, UserSubscriptionStatusSchema, ValidateTokenResponseSchema, VerifyTOTPErrorSpec, VerifyTOTPResponseSchema, VoucherLookupErrorSpec, ZipStatusSchema, addManyTransfers, addTransfer, addTransferTrackers, approveFriendRequest, buildAuthLoginUrl, buildFileApiContentUrl, buildFileApiDownloadUrl, buildFileApiMp4DownloadUrl, buildFileHlsStreamUrl, buildFileXspfPlaylistUrl, buildOAuthAppIconUrl, buildOAuthAuthorizeUrl, buildPutioUrl, canWriteFile, cancelTransfers, cancelZip, checkCodeMatch, classifyPaymentChangePlanResponse, cleanTransfers, clearAccount, clearEvents, clearRssFeedLogs, clients, cloneSharedFiles, confirmFastspringOrder, continueFiles, continuePublicShareFiles, continueSearch, continueTransfers, continueTrash, convertFileSelectionToMp4, convertFileToMp4, convertFilesToMp4, copyFile, countTransfers, countWaitingRequests, createAppSpecificPassword, createDownloadLinks, createFamilyInvite, createFileUploadFormData, createFileUploadRequest, createFolder, createFriendInvite, createOAuthApp, createOpenNodeCharge, createPaddleBillingUpdatePaymentMethodTransaction, createPaddleWaitingPayment, createPublicShare, createPutioSdkEffectClient, createPutioSdkPromiseClient, createRssFeed, createZip, decodePutioErrorEnvelope, definePutioOperationErrorSpec, deleteAllAppSpecificPasswords, deleteAppSpecificPassword, deleteConfigKey, deleteEvent, deleteFileExtraction, deleteFileMp4, deleteFileSelection, deleteFiles, deleteOAuthApp, deletePublicShare, deleteRssFeed, deleteTrash, denyFriendRequest, destroyAccount, emptyTrash, encodePathSegment, exchangeOAuthAuthorizationCode, exists, extractFiles, fallbackPutioErrorEnvelope, findNextFile, findNextVideo, forgotPassword, generateTOTP, getAccountInfo, getAccountSettings, getApiContentUrl, getApiDownloadUrl, getApiMp4DownloadUrl, getCode, getConfigKey, getConfigKeyWith, getDownloadLinks, getDownloadUrl, getEventTorrent, getFamilyInvite, getFile, getFileChild, getFriendInvite, getFriendSharedFolder, getGiftCard, getHlsMasterPlaylist, getHlsStreamUrl, getIftttStatus, getMp4Status, getOAuthApp, getPaddleBillingInvoiceUrl, getPaymentInfo, getPaymentVoucherInfo, getPodcastLinks, getPopularOAuthApps, getPublicShare, getPublicShareFileUrl, getRecoveryCodes, getRssFeed, getSharedWith, getSharingCloneInfo, getStartFrom, getTransfer, getTransferInfo, getTransferTorrent, getVoucher, getXspfPlaylistUrl, getZip, grants, isPutioApiError, isPutioAuthError, isPutioErrorEnvelope, isPutioOperationError, isPutioRateLimitError, joinFamily, linkDevice, listAccountConfirmations, listAccountSubtitleLanguages, listActiveMp4Conversions, listAppSpecificPasswords, listEvents, listFamilyInvites, listFamilyMembers, listFileExtractions, listFileSubtitles, listFriendInvites, listFriends, listPaymentHistory, listPaymentInvites, listPaymentOptions, listPaymentPlans, listPublicShareFiles, listPublicShares, listRssFeedItems, listRssFeeds, listSentRequests, listSharedFiles, listTransfers, listTrash, listTunnelRoutes, listWaitingRequests, listZips, login, logout, makePutioFetchClient, makePutioFetchLayer, makePutioSdkEffectClientLayer, makePutioSdkLiveClientLayer, mapConfigurationError, mapDecodeErrorToValidationError, mapTransportError, moveFileSelection, moveFiles, normalizePutioSdkOptions, parseErrorBody, pauseRssFeed, previewPaymentChangePlan, putMp4ToMyFiles, putioSdkLayer, putioSdkLiveLayer, queryFiles, queryOAuthApps, readConfig, readConfigWith, reannounceTransfer, redeemPaymentVoucher, regenerateOAuthAppToken, regenerateRecoveryCodes, register, removeFamilyMember, removeFriend, removeRateLimitBan, removeTransfers, renameFile, reportPayments, requestArrayBuffer, requestJson, requestText, requestVoid, resetFileSortSettings, resetPassword, resetStartFrom, responseRateLimitHeaders, restoreTrash, resumeRssFeed, retryAllRssFeedItems, retryRssFeedItem, retryTransfer, revokeAllClients, revokeApp, revokeClient, saveAccountSettings, searchFiles, searchFriends, selectJsonField, selectJsonFields, sendFriendRequest, sendIftttEvent, setConfigKey, setFileSort, setFilesWatchStatus, setOAuthAppIcon, setStartFrom, shareFiles, stopPaymentSubscription, stopTransferRecording, submitPaymentChangePlan, toPutioResponseError, touchFiles, unshareFile, updateOAuthApp, updateRssFeed, uploadFile, validateToken, verifyTOTP, withOperationErrors, writeConfig };
5874
5689
 
5875
5690
  //# sourceMappingURL=index.js.map