@putdotio/sdk 15.0.2 → 16.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,11 +1,11 @@
1
- import { A as PutioErrorEnvelopeSchema, B as isPutioErrorEnvelope, C as PositiveIntegerSchema, D as PutioApiError, E as decodeAndRunRedacted, F as decodePutioErrorEnvelope, G as mapTransportError, H as isPutioRateLimitError, I as definePutioOperationErrorSpec, J as toPutioResponseError, K as parseErrorBody, L as fallbackPutioErrorEnvelope, M as PutioRateLimitError, N as PutioTransportError, O as PutioAuthError, P as PutioValidationError, R as isPutioApiError, S as NonEmptyStringSchema, T as decodeAndRun, U as mapConfigurationError, V as isPutioOperationError, W as mapDecodeErrorToValidationError, Y as withOperationErrors, _ 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 PutioOperationError, k as PutioConfigurationError, l as makePutioFetchLayer, m as requestJson, n as toCursorSelectionForm, o as buildPutioUrl, p as requestArrayBuffer, q as responseRateLimitHeaders, 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 isPutioAuthError } from "./forms-C_Ti7aer.js";
2
- import { Context, Effect, Layer, ManagedRuntime, Predicate, Schema, SchemaIssue, SchemaParser, Struct } from "effect";
1
+ import { $ as mapContractError, A as requireRequestedBreadcrumbs, B as decodePutioErrorEnvelope, C as NonEmptyStringSchema, D as decodeAndRun, E as cursorSelectionSchema, F as PutioErrorEnvelopeSchema, G as isPutioConfigurationError, H as fallbackPutioErrorEnvelope, I as PutioOperationError, J as isPutioOperationError, K as isPutioContractError, L as PutioRateLimitError, M as PutioAuthError, N as PutioConfigurationError, O as decodeAndRunRedacted, P as PutioContractError, Q as mapConfigurationError, R as PutioTransportError, S as DEFAULT_PUTIO_WEB_APP_URL, T as PositiveIntegerSchema, U as isPutioApiError, V as definePutioOperationErrorSpec, W as isPutioAuthError, X as isPutioTransportError, Y as isPutioRateLimitError, Z as isPutioValidationError, _ as selectJsonField, a as PutioSdkConfig, at as withOperationErrors, b as DEFAULT_PUTIO_API_BASE_URL, c as makePutioFetchClient, d as putioSdkLayer, et as mapTransportError, f as putioSdkLiveLayer, g as requestVoid, h as requestText, i as PutioHttpClient, it as toPutioResponseError, j as PutioApiError, k as failMissingField, l as makePutioFetchLayer, m as requestJson, n as toCursorSelectionForm, nt as parseErrorBody, o as buildPutioUrl, p as requestArrayBuffer, q as isPutioErrorEnvelope, r as OkResponseSchema, rt as responseRateLimitHeaders, s as encodePathSegment, t as joinCsv, tt as mapValidationError, u as normalizePutioSdkOptions, v as selectJsonFields, w as NonNegativeNumberSchema, x as DEFAULT_PUTIO_UPLOAD_BASE_URL, y as revealAccessToken, z as PutioValidationError } from "./forms-CcQuZ3hG.js";
2
+ import { Cause, Context, Effect, Exit, Layer, ManagedRuntime, Predicate, Schema, SchemaIssue, SchemaParser } from "effect";
3
3
  // src/domains/account.ts
4
4
  const RequestedFlag$1 = Schema.Literal(1);
5
5
  const AccountDiskSchema = Schema.Struct({
6
- avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
7
- size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
8
- used: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))
6
+ avail: NonNegativeNumberSchema,
7
+ size: NonNegativeNumberSchema,
8
+ used: NonNegativeNumberSchema
9
9
  });
10
10
  const AccountWarningsSchema = Schema.Struct({
11
11
  callback_url_has_failed: Schema.optional(Schema.Boolean),
@@ -64,11 +64,11 @@ const AccountInfoBaseSchema = Schema.Struct({
64
64
  is_eligible_for_friend_invitation: Schema.Boolean,
65
65
  is_sub_account: Schema.Boolean,
66
66
  mail: Schema.String,
67
- monthly_bandwidth_usage: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
67
+ monthly_bandwidth_usage: NonNegativeNumberSchema,
68
68
  password_last_changed_at: Schema.NullOr(Schema.String),
69
69
  private_download_host_ip: Schema.NullOr(Schema.String),
70
70
  settings: AccountSettingsSchema,
71
- trash_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
71
+ trash_size: NonNegativeNumberSchema,
72
72
  user_id: Schema.Int,
73
73
  username: Schema.String,
74
74
  warnings: AccountWarningsSchema
@@ -180,14 +180,13 @@ const AccountConfirmationsEnvelopeSchema = Schema.Struct({
180
180
  confirmations: Schema.Array(AccountConfirmationSchema),
181
181
  status: Schema.Literal("OK")
182
182
  });
183
- const failMissingField$1 = (field) => Effect.fail(new PutioValidationError({ cause: `Expected put.io to include "${field}" because it was requested` }));
184
183
  const ensureAccountInfoFields = (effect, query) => Effect.gen(function* () {
185
184
  const info = yield* effect;
186
- if (query.download_token === 1 && info.download_token === void 0) return yield* failMissingField$1("download_token");
187
- if (query.features === 1 && info.features === void 0) return yield* failMissingField$1("features");
188
- if (query.pas === 1 && info.pas === void 0) return yield* failMissingField$1("pas");
189
- if (query.profitwell === 1 && !("paddle_user_id" in info)) return yield* failMissingField$1("paddle_user_id");
190
- if (query.push_token === 1 && info.push_token === void 0) return yield* failMissingField$1("push_token");
185
+ if (query.download_token === 1 && info.download_token === void 0) return yield* failMissingField("download_token");
186
+ if (query.features === 1 && info.features === void 0) return yield* failMissingField("features");
187
+ if (query.pas === 1 && info.pas === void 0) return yield* failMissingField("pas");
188
+ if (query.profitwell === 1 && !("paddle_user_id" in info)) return yield* failMissingField("paddle_user_id");
189
+ if (query.push_token === 1 && info.push_token === void 0) return yield* failMissingField("push_token");
191
190
  return info;
192
191
  });
193
192
  const SaveAccountSettingsErrorSpec = definePutioOperationErrorSpec({
@@ -318,7 +317,8 @@ const destroyAccount = (currentPassword) => decodeAndRunRedacted("account", "des
318
317
  method: "POST",
319
318
  path: "/v2/account/destroy"
320
319
  }));
321
- const listAccountConfirmations = (subject) => decodeAndRun(Schema.UndefinedOr(AccountConfirmationSubjectSchema), subject, (decodedSubject) => requestJson(AccountConfirmationsEnvelopeSchema, {
320
+ const OptionalAccountConfirmationSubjectSchema = Schema.UndefinedOr(AccountConfirmationSubjectSchema);
321
+ const listAccountConfirmations = (subject) => decodeAndRun(OptionalAccountConfirmationSubjectSchema, subject, (decodedSubject) => requestJson(AccountConfirmationsEnvelopeSchema, {
322
322
  method: "GET",
323
323
  path: "/v2/account/confirmation/list",
324
324
  query: decodedSubject ? { type: decodedSubject } : void 0
@@ -566,20 +566,22 @@ const queryOAuthApps = () => requestJson(OAuthAppsEnvelopeSchema, {
566
566
  method: "GET",
567
567
  path: "/v2/oauth/apps"
568
568
  }).pipe(selectJsonField("apps"), withOperationErrors(QueryOAuthAppsErrorSpec));
569
- const getOAuthApp = (id, options) => decodeAndRun(Schema.Struct({
569
+ const OAuthAppGetInputSchema = Schema.Struct({
570
570
  id: OAuthAppIdSchema,
571
571
  options: Schema.optional(Schema.Struct({ edit: Schema.optional(Schema.Boolean) }))
572
- }), {
572
+ });
573
+ const getOAuthApp = (id, options) => decodeAndRun(OAuthAppGetInputSchema, {
573
574
  id,
574
575
  options
575
576
  }, (decodedInput) => requestJson(OAuthAppWithTokenSchema, {
576
577
  method: "GET",
577
578
  path: decodedInput.options?.edit ? `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/edit` : `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`
578
579
  })).pipe(withOperationErrors(GetOAuthAppErrorSpec));
579
- const setOAuthAppIcon = (id, input) => decodeAndRun(Schema.Struct({
580
+ const OAuthAppSetIconInputSchema = Schema.Struct({
580
581
  id: OAuthAppIdSchema,
581
582
  input: OAuthSetIconInputSchema
582
- }), {
583
+ });
584
+ const setOAuthAppIcon = (id, input) => decodeAndRun(OAuthAppSetIconInputSchema, {
583
585
  id,
584
586
  input
585
587
  }, (decodedInput) => {
@@ -1298,14 +1300,12 @@ const makeConfigValueEnvelopeSchema = (schema) => Schema.declareConstructor()([s
1298
1300
  }))));
1299
1301
  const ConfigEnvelopeSchema = makeConfigEnvelopeSchema(JsonObjectResponseSchema);
1300
1302
  const ConfigValueEnvelopeSchema = makeConfigValueEnvelopeSchema(JsonValueResponseSchema);
1303
+ const decodeWithCallerSchema = (schema) => (value) => Schema.decodeEffect(schema)(value).pipe(Effect.mapError(mapValidationError));
1301
1304
  const readConfig = () => requestJson(ConfigEnvelopeSchema, {
1302
1305
  method: "GET",
1303
1306
  path: "/v2/config"
1304
1307
  }).pipe(selectJsonField("config"));
1305
- const readConfigWith = (schema) => requestJson(makeConfigEnvelopeSchema(JsonObjectResponseSchema.pipe(Schema.decodeTo(schema))), {
1306
- method: "GET",
1307
- path: "/v2/config"
1308
- }).pipe(Effect.map((envelope) => envelope["config"]));
1308
+ const readConfigWith = (schema) => readConfig().pipe(Effect.flatMap(decodeWithCallerSchema(schema)));
1309
1309
  const writeConfig = (config) => decodeAndRun(JsonObjectSchema, config, (decodedConfig) => requestJson(OkResponseSchema, {
1310
1310
  body: {
1311
1311
  type: "json",
@@ -1318,10 +1318,7 @@ const getConfigKey = (key) => decodeAndRun(ConfigKeySchema, key, (decodedKey) =>
1318
1318
  method: "GET",
1319
1319
  path: `/v2/config/${encodePathSegment(decodedKey)}`
1320
1320
  })).pipe(selectJsonField("value"));
1321
- const getConfigKeyWith = (key, schema) => decodeAndRun(ConfigKeySchema, key, (decodedKey) => requestJson(makeConfigValueEnvelopeSchema(JsonValueResponseSchema.pipe(Schema.decodeTo(schema))), {
1322
- method: "GET",
1323
- path: `/v2/config/${encodePathSegment(decodedKey)}`
1324
- })).pipe(Effect.map((envelope) => envelope["value"]));
1321
+ const getConfigKeyWith = (key, schema) => getConfigKey(key).pipe(Effect.flatMap(decodeWithCallerSchema(schema)));
1325
1322
  const setConfigKey = (key, value) => decodeAndRun(ConfigSetKeyInputSchema, {
1326
1323
  key,
1327
1324
  value
@@ -1419,7 +1416,7 @@ const GetDownloadLinksErrorSpec = definePutioOperationErrorSpec({
1419
1416
  { statusCode: 404 }
1420
1417
  ]
1421
1418
  });
1422
- const createDownloadLinks = (input = {}) => decodeAndRun(DownloadLinksCreateInputSchema, input, (decodedInput) => requestJson(DownloadLinksCreateEnvelopeSchema, {
1419
+ const createDownloadLinks = (input) => decodeAndRun(DownloadLinksCreateInputSchema, input, (decodedInput) => requestJson(DownloadLinksCreateEnvelopeSchema, {
1423
1420
  body: {
1424
1421
  type: "form",
1425
1422
  value: toCursorSelectionForm(decodedInput)
@@ -1441,7 +1438,7 @@ const HistoryEventBaseSchema = Schema.Struct({
1441
1438
  const HistoryFileEventSchema = HistoryEventBaseSchema.pipe(Schema.fieldsAssign({
1442
1439
  file_id: Schema.Int,
1443
1440
  file_name: Schema.String,
1444
- file_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))
1441
+ file_size: NonNegativeNumberSchema
1445
1442
  }));
1446
1443
  const HistoryTransferEventSchema = HistoryEventBaseSchema.pipe(Schema.fieldsAssign({
1447
1444
  source: Schema.String,
@@ -1458,7 +1455,7 @@ const HistoryFileFromRssDeletedEventSchema = HistoryFileEventSchema.mapFields(({
1458
1455
  }));
1459
1456
  const HistoryTransferCompletedEventSchema = HistoryTransferEventSchema.mapFields(({ type: _type, ...fields }) => fields).pipe(Schema.fieldsAssign({
1460
1457
  file_id: Schema.Int,
1461
- transfer_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
1458
+ transfer_size: NonNegativeNumberSchema,
1462
1459
  type: Schema.Literal("transfer_completed")
1463
1460
  }));
1464
1461
  const HistoryTransferErrorEventSchema = HistoryTransferEventSchema.mapFields(({ type: _type, ...fields }) => fields).pipe(Schema.fieldsAssign({ type: Schema.Literal("transfer_error") }));
@@ -1493,7 +1490,7 @@ const HistoryVoucherEventSchema = HistoryEventBaseSchema.mapFields(({ type: _typ
1493
1490
  const HistoryZipCreatedEventSchema = HistoryEventBaseSchema.mapFields(({ type: _type, ...fields }) => fields).pipe(Schema.fieldsAssign({
1494
1491
  type: Schema.Literal("zip_created"),
1495
1492
  zip_id: Schema.Int,
1496
- zip_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))
1493
+ zip_size: NonNegativeNumberSchema
1497
1494
  }));
1498
1495
  const HistoryKnownEventTypeSchema = Schema.Literals([
1499
1496
  "file_shared",
@@ -1827,15 +1824,15 @@ const FileTouchInputSchema = Schema.Struct({
1827
1824
  updatedAt: Schema.optional(Schema.Date)
1828
1825
  });
1829
1826
  const FileMediaMetadataSchema = Schema.Struct({
1830
- aspect_ratio: Schema.optional(Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)))),
1827
+ aspect_ratio: Schema.optional(Schema.NullOr(NonNegativeNumberSchema)),
1831
1828
  codec: Schema.optional(Schema.NullOr(Schema.String)),
1832
- duration: Schema.optional(Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)))),
1829
+ duration: Schema.optional(Schema.NullOr(NonNegativeNumberSchema)),
1833
1830
  height: Schema.optional(Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))),
1834
1831
  width: Schema.optional(Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))))
1835
1832
  });
1836
1833
  const FileMediaInfoFormatSchema = Schema.Struct({
1837
- bit_rate: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),
1838
- duration: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),
1834
+ bit_rate: Schema.optional(NonNegativeNumberSchema),
1835
+ duration: Schema.optional(NonNegativeNumberSchema),
1839
1836
  name: Schema.optional(Schema.String)
1840
1837
  });
1841
1838
  const FileMediaInfoStreamSchema = Schema.Struct({
@@ -1872,15 +1869,15 @@ const FileBaseSchema = Schema.Struct({
1872
1869
  parent_id: Schema.NullOr(Schema.Int),
1873
1870
  screenshot: Schema.NullOr(Schema.String),
1874
1871
  sha1: Schema.optional(Schema.NullOr(Schema.String)),
1875
- size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
1876
- start_from: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),
1872
+ size: NonNegativeNumberSchema,
1873
+ start_from: Schema.optional(NonNegativeNumberSchema),
1877
1874
  updated_at: Schema.String
1878
1875
  });
1879
1876
  const FileBroadSchema = FileBaseSchema.pipe(Schema.fieldsAssign({
1880
1877
  content_type_and_codecs: Schema.optional(Schema.NullOr(Schema.String)),
1881
1878
  media_info: Schema.optional(Schema.NullOr(FileMediaInfoSchema)),
1882
1879
  media_metadata: Schema.optional(Schema.NullOr(FileMediaMetadataSchema)),
1883
- mp4_size: Schema.optional(Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)))),
1880
+ mp4_size: Schema.optional(Schema.NullOr(NonNegativeNumberSchema)),
1884
1881
  mp4_stream_url: Schema.optional(Schema.NullOr(Schema.String)),
1885
1882
  need_convert: Schema.optional(Schema.Boolean),
1886
1883
  sender_name: Schema.optional(Schema.String),
@@ -1975,10 +1972,10 @@ const FileRenameInputSchema = Schema.Struct({
1975
1972
  });
1976
1973
  const FileStartFromSetInputSchema = Schema.Struct({
1977
1974
  file_id: PositiveFileIdSchema,
1978
- time: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))
1975
+ time: NonNegativeNumberSchema
1979
1976
  });
1980
1977
  const FileStartFromEnvelopeSchema = Schema.Struct({
1981
- start_from: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
1978
+ start_from: NonNegativeNumberSchema,
1982
1979
  status: Schema.Literal("OK")
1983
1980
  });
1984
1981
  const FileDownloadUrlEnvelopeSchema = Schema.Struct({
@@ -2004,18 +2001,18 @@ const FileConversionNotAvailableSchema = Schema.Struct({
2004
2001
  });
2005
2002
  const FileConversionInQueueSchema = Schema.Struct({
2006
2003
  id: Schema.Int,
2007
- percent_done: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),
2004
+ percent_done: Schema.optional(NonNegativeNumberSchema),
2008
2005
  status: Schema.Literal("IN_QUEUE")
2009
2006
  });
2010
2007
  const FileConversionConvertingSchema = Schema.Struct({
2011
2008
  id: Schema.Int,
2012
- percent_done: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
2009
+ percent_done: NonNegativeNumberSchema,
2013
2010
  status: Schema.Literal("CONVERTING")
2014
2011
  });
2015
2012
  const FileConversionCompletedSchema = Schema.Struct({
2016
2013
  id: Schema.Int,
2017
- percent_done: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
2018
- size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
2014
+ percent_done: NonNegativeNumberSchema,
2015
+ size: NonNegativeNumberSchema,
2019
2016
  status: Schema.Literal("COMPLETED")
2020
2017
  });
2021
2018
  const FileConversionErrorSchema = Schema.Struct({
@@ -2095,11 +2092,7 @@ const FileExtractionsEnvelopeSchema = Schema.Struct({
2095
2092
  extractions: Schema.Array(FileExtractionSchema),
2096
2093
  status: Schema.optional(Schema.Literal("OK"))
2097
2094
  });
2098
- const FilesBulkSelectionSchema = Schema.Struct({
2099
- cursor: Schema.optional(NonEmptyStringSchema),
2100
- excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),
2101
- ids: Schema.optional(Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1)))
2102
- }).check(Schema.makeFilter((input) => input.cursor !== void 0 || input.ids !== void 0, { expected: "a non-empty cursor or file ID selection" }));
2095
+ const FilesBulkSelectionSchema = cursorSelectionSchema({});
2103
2096
  const FilesDeleteOptionsSchema = Schema.Struct({
2104
2097
  ignoreFileOwner: Schema.optional(Schema.Boolean),
2105
2098
  partialDelete: Schema.optional(Schema.Boolean),
@@ -2279,6 +2272,14 @@ const SearchFilesErrorSpec = definePutioOperationErrorSpec({
2279
2272
  { statusCode: 400 }
2280
2273
  ]
2281
2274
  });
2275
+ const ContinueSearchErrorSpec = definePutioOperationErrorSpec({
2276
+ domain: "files",
2277
+ operation: "continueSearch",
2278
+ knownErrors: [{
2279
+ errorType: "invalid_scope",
2280
+ statusCode: 401
2281
+ }, { statusCode: 400 }]
2282
+ });
2282
2283
  const CreateFolderErrorSpec = definePutioOperationErrorSpec({
2283
2284
  domain: "files",
2284
2285
  operation: "createFolder",
@@ -2457,7 +2458,6 @@ const FileUploadErrorSpec = definePutioOperationErrorSpec({
2457
2458
  { statusCode: 429 }
2458
2459
  ]
2459
2460
  });
2460
- const failMissingField = (field) => Effect.fail(new PutioValidationError({ cause: `Expected put.io to include "${field}" because it was requested` }));
2461
2461
  const hasStreamUrl = (value) => "stream_url" in value;
2462
2462
  const hasMp4StreamUrl = (value) => "mp4_stream_url" in value;
2463
2463
  const hasMp4StreamUrlWhenAvailable = (value) => !value.is_mp4_available || hasMp4StreamUrl(value);
@@ -2469,15 +2469,15 @@ const hasMediaInfo = (value) => "media_info" in value;
2469
2469
  const useTunnelToQuery = (useTunnel) => useTunnel === false ? { notunnel: 1 } : {};
2470
2470
  const resolveRouteContext = (token) => Effect.gen(function* () {
2471
2471
  const config = yield* PutioSdkConfig;
2472
- const resolvedToken = token ?? config.accessToken;
2473
- if (resolvedToken) return {
2472
+ const resolvedToken = token ?? (yield* revealAccessToken(config.accessToken));
2473
+ if (resolvedToken === void 0) return yield* mapConfigurationError("This helper requires a token, but neither an override nor PutioSdkConfig.accessToken was provided");
2474
+ return {
2474
2475
  config,
2475
2476
  token: resolvedToken
2476
2477
  };
2477
- return yield* Effect.fail(mapConfigurationError("This helper requires a token, but neither an override nor PutioSdkConfig.accessToken was provided"));
2478
2478
  });
2479
2479
  const resolveApiBaseUrl = Effect.gen(function* () {
2480
- return (yield* PutioSdkConfig).baseUrl ?? "https://api.put.io";
2480
+ return (yield* PutioSdkConfig).baseUrl;
2481
2481
  });
2482
2482
  const toOriginalFlag = (playOriginal) => playOriginal === void 0 ? void 0 : playOriginal ? 1 : 0;
2483
2483
  const toUploadResult = (value) => {
@@ -2489,7 +2489,7 @@ const toUploadResult = (value) => {
2489
2489
  transfer: value.transfer,
2490
2490
  type: "transfer"
2491
2491
  });
2492
- return Effect.fail(new PutioValidationError({ cause: "Expected put.io upload response to contain either \"file\" or \"transfer\"" }));
2492
+ return Effect.fail(new PutioContractError({ cause: "Expected put.io upload response to contain either \"file\" or \"transfer\"" }));
2493
2493
  };
2494
2494
  const buildFileApiDownloadUrl = (baseUrl, fileId, options) => buildPutioUrl(baseUrl, options.name ? `/v2/files/${encodePathSegment(fileId)}/download/${encodePathSegment(options.name)}` : `/v2/files/${encodePathSegment(fileId)}/download`, {
2495
2495
  ...useTunnelToQuery(options.useTunnel),
@@ -2521,7 +2521,7 @@ const createFileUploadFormData = (input) => {
2521
2521
  const ensureFileQueryFields = (effect, query) => Effect.gen(function* () {
2522
2522
  const file = yield* effect;
2523
2523
  if (query.stream_url === 1 && !hasStreamUrl(file)) return yield* failMissingField("stream_url");
2524
- 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");
2524
+ if ((query.mp4_status === 1 || query.mp4_stream_url === 1) && !hasMp4StatusFields(file)) return yield* failMissingField("mp4_size" in file ? "need_convert" : "mp4_size");
2525
2525
  if (query.mp4_stream_url === 1 && !hasMp4StreamUrlWhenAvailable(file)) return yield* failMissingField("mp4_stream_url");
2526
2526
  if (query.video_metadata === 1 && query.media_metadata !== 1 && !hasVideoMetadata(file)) return yield* failMissingField("video_metadata");
2527
2527
  if (query.media_metadata === 1 && !hasMediaMetadata(file)) return yield* failMissingField("media_metadata");
@@ -2529,17 +2529,19 @@ const ensureFileQueryFields = (effect, query) => Effect.gen(function* () {
2529
2529
  if (query.media_info === 1 && !hasMediaInfo(file)) return yield* failMissingField("media_info");
2530
2530
  return file;
2531
2531
  });
2532
- const queryFiles = (parent, query = {}) => decodeAndRun(FilesListInputSchema, {
2533
- parent,
2534
- query
2535
- }, (decodedInput) => requestJson(FilesListEnvelopeSchema, {
2536
- method: "GET",
2537
- path: decodedInput.parent === "friends" ? "/v2/files/list/items-shared-with-you" : "/v2/files/list",
2538
- query: decodedInput.parent === "friends" ? decodedInput.query : {
2539
- ...decodedInput.query,
2540
- parent_id: decodedInput.parent
2541
- }
2542
- })).pipe(withOperationErrors(QueryFilesErrorSpec));
2532
+ function queryFiles(parent, query = {}) {
2533
+ return decodeAndRun(FilesListInputSchema, {
2534
+ parent,
2535
+ query
2536
+ }, (decodedInput) => requestJson(FilesListEnvelopeSchema, {
2537
+ method: "GET",
2538
+ path: decodedInput.parent === "friends" ? "/v2/files/list/items-shared-with-you" : "/v2/files/list",
2539
+ query: decodedInput.parent === "friends" ? decodedInput.query : {
2540
+ ...decodedInput.query,
2541
+ parent_id: decodedInput.parent
2542
+ }
2543
+ }).pipe(requireRequestedBreadcrumbs(decodedInput.query))).pipe(withOperationErrors(QueryFilesErrorSpec));
2544
+ }
2543
2545
  const continueFiles = (cursor, query = {}) => decodeAndRun(FilesContinueInputSchema, {
2544
2546
  cursor,
2545
2547
  query
@@ -2618,7 +2620,7 @@ const continueSearch = (cursor, query = {}) => decodeAndRun(FilesContinueInputSc
2618
2620
  method: "POST",
2619
2621
  path: "/v2/files/search/continue",
2620
2622
  query: decodedInput.query
2621
- })).pipe(withOperationErrors(SearchFilesErrorSpec));
2623
+ })).pipe(withOperationErrors(ContinueSearchErrorSpec));
2622
2624
  const setFileSort = (input) => decodeAndRun(FileSetSortInputSchema, input, (decodedInput) => requestJson(OkResponseSchema, {
2623
2625
  body: {
2624
2626
  type: "form",
@@ -2650,10 +2652,11 @@ const renameFile = (input) => decodeAndRun(FileRenameInputSchema, input, (decode
2650
2652
  method: "POST",
2651
2653
  path: "/v2/files/rename"
2652
2654
  })).pipe(withOperationErrors(RenameFileErrorSpec));
2653
- const deleteFiles = (ids, options = {}) => decodeAndRun(Schema.Struct({
2655
+ const FilesDeleteInputSchema = Schema.Struct({
2654
2656
  ids: FilesIdsInputSchema,
2655
2657
  options: FilesDeleteOptionsSchema
2656
- }), {
2658
+ });
2659
+ const deleteFiles = (ids, options = {}) => decodeAndRun(FilesDeleteInputSchema, {
2657
2660
  ids,
2658
2661
  options
2659
2662
  }, (decodedInput) => requestJson(FileDeleteResultEnvelopeSchema, {
@@ -2670,10 +2673,11 @@ const deleteFiles = (ids, options = {}) => decodeAndRun(Schema.Struct({
2670
2673
  skip_trash: decodedInput.options.skipTrash
2671
2674
  }
2672
2675
  }));
2673
- const deleteFileSelection = (selection, options = {}) => decodeAndRun(Schema.Struct({
2676
+ const FilesSelectionDeleteInputSchema = Schema.Struct({
2674
2677
  options: FilesSelectionDeleteOptionsSchema,
2675
2678
  selection: FilesBulkSelectionSchema
2676
- }), {
2679
+ });
2680
+ const deleteFileSelection = (selection, options = {}) => decodeAndRun(FilesSelectionDeleteInputSchema, {
2677
2681
  options,
2678
2682
  selection
2679
2683
  }, (decodedInput) => requestJson(FileDeleteResultEnvelopeSchema, {
@@ -2725,44 +2729,49 @@ const getDownloadUrl = (fileId) => decodeAndRun(PositiveFileIdSchema, fileId, (d
2725
2729
  method: "GET",
2726
2730
  path: `/v2/files/${encodePathSegment(decodedFileId)}/url`
2727
2731
  })).pipe(selectJsonField("url"), withOperationErrors(DownloadUrlErrorSpec));
2728
- const getApiDownloadUrl = (fileId, options) => decodeAndRun(Schema.Struct({
2732
+ const FileApiDownloadUrlInputSchema = Schema.Struct({
2729
2733
  fileId: PositiveFileIdSchema,
2730
2734
  options: FileApiDownloadUrlOptionsSchema
2731
- }), {
2735
+ });
2736
+ const getApiDownloadUrl = (fileId, options) => decodeAndRun(FileApiDownloadUrlInputSchema, {
2732
2737
  fileId,
2733
2738
  options
2734
2739
  }, (decoded) => resolveApiBaseUrl.pipe(Effect.map((baseUrl) => buildFileApiDownloadUrl(baseUrl, decoded.fileId, decoded.options))));
2735
- const getApiContentUrl = (fileId, options) => decodeAndRun(Schema.Struct({
2740
+ const FileApiContentUrlInputSchema = Schema.Struct({
2736
2741
  fileId: PositiveFileIdSchema,
2737
2742
  options: FileDirectAccessOptionsSchema
2738
- }), {
2743
+ });
2744
+ const getApiContentUrl = (fileId, options) => decodeAndRun(FileApiContentUrlInputSchema, {
2739
2745
  fileId,
2740
2746
  options
2741
2747
  }, (decoded) => resolveApiBaseUrl.pipe(Effect.map((baseUrl) => buildFileApiContentUrl(baseUrl, decoded.fileId, decoded.options))));
2742
- const getApiMp4DownloadUrl = (fileId, options) => decodeAndRun(Schema.Struct({
2748
+ const FileApiMp4DownloadUrlInputSchema = Schema.Struct({
2743
2749
  fileId: PositiveFileIdSchema,
2744
2750
  options: FileApiMp4DownloadUrlOptionsSchema
2745
- }), {
2751
+ });
2752
+ const getApiMp4DownloadUrl = (fileId, options) => decodeAndRun(FileApiMp4DownloadUrlInputSchema, {
2746
2753
  fileId,
2747
2754
  options
2748
2755
  }, (decoded) => resolveApiBaseUrl.pipe(Effect.map((baseUrl) => buildFileApiMp4DownloadUrl(baseUrl, decoded.fileId, decoded.options))));
2749
- const getHlsStreamUrl = (fileId, options) => decodeAndRun(Schema.Struct({
2756
+ const FileHlsStreamUrlInputSchema = Schema.Struct({
2750
2757
  fileId: PositiveFileIdSchema,
2751
2758
  options: FileHlsStreamUrlOptionsSchema
2752
- }), {
2759
+ });
2760
+ const getHlsStreamUrl = (fileId, options) => decodeAndRun(FileHlsStreamUrlInputSchema, {
2753
2761
  fileId,
2754
2762
  options
2755
2763
  }, (decoded) => resolveApiBaseUrl.pipe(Effect.map((baseUrl) => buildFileHlsStreamUrl(baseUrl, decoded.fileId, decoded.options))));
2764
+ const FileHlsMasterPlaylistInputSchema = Schema.Struct({
2765
+ fileId: PositiveFileIdSchema,
2766
+ options: FileHlsMasterPlaylistOptionsSchema
2767
+ });
2756
2768
  /**
2757
2769
  * Fetches the HLS master playlist the player would load, so callers can
2758
2770
  * inspect the served variant's CODECS, VIDEO-RANGE, and rendition set without
2759
2771
  * handling the tokenized URL. `playOriginal` selects the original file over
2760
2772
  * the MP4 conversion.
2761
2773
  */
2762
- const getHlsMasterPlaylist = (fileId, options = {}) => decodeAndRun(Schema.Struct({
2763
- fileId: PositiveFileIdSchema,
2764
- options: FileHlsMasterPlaylistOptionsSchema
2765
- }), {
2774
+ const getHlsMasterPlaylist = (fileId, options = {}) => decodeAndRun(FileHlsMasterPlaylistInputSchema, {
2766
2775
  fileId,
2767
2776
  options
2768
2777
  }, (decoded) => requestText({
@@ -2775,10 +2784,11 @@ const getHlsMasterPlaylist = (fileId, options = {}) => decodeAndRun(Schema.Struc
2775
2784
  subtitle_languages: joinCsv(decoded.options.subtitleLanguages)
2776
2785
  }
2777
2786
  })).pipe(withOperationErrors(GetHlsMasterPlaylistErrorSpec));
2778
- const getXspfPlaylistUrl = (fileId, options) => decodeAndRun(Schema.Struct({
2787
+ const FileXspfPlaylistUrlInputSchema = Schema.Struct({
2779
2788
  fileId: PositiveFileIdSchema,
2780
2789
  options: FileXspfPlaylistUrlOptionsSchema
2781
- }), {
2790
+ });
2791
+ const getXspfPlaylistUrl = (fileId, options) => decodeAndRun(FileXspfPlaylistUrlInputSchema, {
2782
2792
  fileId,
2783
2793
  options
2784
2794
  }, (decoded) => resolveApiBaseUrl.pipe(Effect.map((baseUrl) => buildFileXspfPlaylistUrl(baseUrl, decoded.fileId, decoded.options))));
@@ -2880,26 +2890,24 @@ const findNextVideo = (fileId) => decodeAndRun(PositiveFileIdSchema, fileId, (de
2880
2890
  method: "GET",
2881
2891
  path: `/v2/files/${encodePathSegment(decodedFileId)}/next-video`
2882
2892
  })).pipe(selectJsonField("next_video"));
2883
- const createFileUploadRequest = (input, options = {}) => decodeAndRun(Schema.Struct({
2893
+ const FileUploadCallInputSchema = Schema.Struct({
2884
2894
  input: FileUploadInputSchema,
2885
2895
  options: FileUploadOptionsSchema
2886
- }), {
2896
+ });
2897
+ const createFileUploadRequest = (input, options = {}) => decodeAndRun(FileUploadCallInputSchema, {
2887
2898
  input,
2888
2899
  options
2889
2900
  }, (decoded) => resolveRouteContext(decoded.options.oauthToken).pipe(Effect.map(({ config, token }) => ({
2890
2901
  body: createFileUploadFormData(decoded.input),
2891
2902
  method: "POST",
2892
- url: buildPutioUrl(config.uploadBaseUrl ?? "https://upload.put.io", "/v2/files/upload", { oauth_token: token })
2903
+ url: buildPutioUrl(config.uploadBaseUrl, "/v2/files/upload", { oauth_token: token })
2893
2904
  }))));
2894
- const uploadFile = (input, options = {}) => decodeAndRun(Schema.Struct({
2895
- input: FileUploadInputSchema,
2896
- options: FileUploadOptionsSchema
2897
- }), {
2905
+ const uploadFile = (input, options = {}) => decodeAndRun(FileUploadCallInputSchema, {
2898
2906
  input,
2899
2907
  options
2900
2908
  }, (decoded) => resolveRouteContext(decoded.options.oauthToken).pipe(Effect.flatMap(({ config, token }) => requestJson(FileUploadEnvelopeSchema, {
2901
2909
  auth: { type: "none" },
2902
- baseUrl: config.uploadBaseUrl ?? "https://upload.put.io",
2910
+ baseUrl: config.uploadBaseUrl,
2903
2911
  body: {
2904
2912
  type: "form-data",
2905
2913
  value: createFileUploadFormData(decoded.input)
@@ -2919,7 +2927,7 @@ const FriendInviteJoinedUserStatusSchema = Schema.Literals([
2919
2927
  const FriendInviteJoinedUserSchema = Schema.Struct({
2920
2928
  avatar_url: Schema.String,
2921
2929
  created_at: Schema.String,
2922
- earned_amount: Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),
2930
+ earned_amount: Schema.NullOr(NonNegativeNumberSchema),
2923
2931
  name: Schema.String,
2924
2932
  status: FriendInviteJoinedUserStatusSchema
2925
2933
  });
@@ -3191,7 +3199,7 @@ const PaymentInfoPlanSchema = Schema.Struct({
3191
3199
  code: Schema.optional(Schema.String),
3192
3200
  group_code: Schema.optional(Schema.String),
3193
3201
  period_days: Schema.optional(Schema.NullOr(Schema.Int.check(Schema.isGreaterThan(0)))),
3194
- storage_space: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),
3202
+ storage_space: Schema.optional(NonNegativeNumberSchema),
3195
3203
  subscription: Schema.optional(PaymentSubscriptionInfoSchema),
3196
3204
  type: Schema.optional(Schema.NullOr(PaymentPlanTypeSchema))
3197
3205
  });
@@ -3211,9 +3219,9 @@ const PaymentInfoSchema = Schema.Struct({
3211
3219
  });
3212
3220
  const PaymentPlanCommonPropertiesSchema = Schema.Struct({
3213
3221
  family_invites: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
3214
- seed_ratio: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
3215
- seed_time: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
3216
- storage_space: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
3222
+ seed_ratio: NonNegativeNumberSchema,
3223
+ seed_time: NonNegativeNumberSchema,
3224
+ storage_space: NonNegativeNumberSchema,
3217
3225
  torrent_slot: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))
3218
3226
  });
3219
3227
  const PaymentSubPlanSchema = Schema.Struct({
@@ -3236,7 +3244,7 @@ const PaymentPlansEnvelopeSchema = Schema.Struct({
3236
3244
  status: Schema.Literal("OK")
3237
3245
  });
3238
3246
  const PaymentOptionSchema = Schema.Struct({
3239
- discount_percent: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
3247
+ discount_percent: NonNegativeNumberSchema,
3240
3248
  name: PaymentTypeSchema,
3241
3249
  suitable_plan_types: Schema.Array(PaymentOptionPlanTypeSchema)
3242
3250
  });
@@ -3284,7 +3292,7 @@ const PaymentChangePlanCurrentPlanSchema = Schema.Struct({
3284
3292
  subscription_payment_provider: Schema.NullOr(PaymentProviderNameSchema)
3285
3293
  });
3286
3294
  const PaymentChangePlanTargetPlanSchema = Schema.Struct({
3287
- hd_avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
3295
+ hd_avail: NonNegativeNumberSchema,
3288
3296
  is_trial_subscription: Schema.Boolean,
3289
3297
  new_code: Schema.String,
3290
3298
  period_days: Schema.NullOr(Schema.Int.check(Schema.isGreaterThan(0))),
@@ -3308,7 +3316,7 @@ const PaymentChangePlanProviderFastspringPreviewSchema = Schema.Struct({
3308
3316
  refund_amount: Schema.NullOr(Schema.String)
3309
3317
  });
3310
3318
  const PaymentChangePlanDiscountSchema = Schema.Struct({
3311
- discount: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
3319
+ discount: NonNegativeNumberSchema,
3312
3320
  type: Schema.Literals(["percentage", "amount"])
3313
3321
  });
3314
3322
  const PaymentChangePlanPreviewSchema = Schema.Struct({
@@ -3344,7 +3352,7 @@ const FastspringPaymentProviderSchema = Schema.Struct({
3344
3352
  url: Schema.String
3345
3353
  });
3346
3354
  const OpenNodePaymentProviderSchema = Schema.Struct({
3347
- discount_percent: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
3355
+ discount_percent: NonNegativeNumberSchema,
3348
3356
  provider: Schema.Literal("OpenNode"),
3349
3357
  type: Schema.Literal("cryptocurrency")
3350
3358
  });
@@ -3399,7 +3407,7 @@ const PaymentVoucherPlanSchema = Schema.Struct({
3399
3407
  const PaymentVoucherTargetPlanSchema = Schema.Struct({
3400
3408
  code: Schema.String,
3401
3409
  group_code: Schema.String,
3402
- hd_avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
3410
+ hd_avail: NonNegativeNumberSchema,
3403
3411
  name: Schema.String,
3404
3412
  simulated_expiration: Schema.optional(Schema.NullOr(Schema.String)),
3405
3413
  type: PaymentPlanTypeSchema
@@ -4192,12 +4200,7 @@ const SharingCloneStatusSchema = Schema.Literals([
4192
4200
  "DONE",
4193
4201
  "ERROR"
4194
4202
  ]);
4195
- const SharingCloneInputSchema = Schema.Struct({
4196
- cursor: Schema.optional(NonEmptyStringSchema),
4197
- excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),
4198
- ids: Schema.optional(Schema.Array(PositiveIntegerSchema)),
4199
- parentId: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))
4200
- });
4203
+ const SharingCloneInputSchema = cursorSelectionSchema({ parentId: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))) });
4201
4204
  const SharingCloneEnvelopeSchema = Schema.Struct({
4202
4205
  id: Schema.Int.check(Schema.isGreaterThan(0)),
4203
4206
  status: Schema.Literal("OK")
@@ -4215,15 +4218,10 @@ const SharingCloneInfoSchema = Schema.Union([Schema.Struct({
4215
4218
  status: Schema.Literal("OK")
4216
4219
  })]);
4217
4220
  const SharedFileSchema = FileBroadSchema.pipe(Schema.fieldsAssign({ shared_with: Schema.Union([Schema.Literal("everyone"), Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))]) }));
4218
- const SharingShareInputSchema = Schema.Struct({
4219
- cursor: Schema.optional(NonEmptyStringSchema),
4220
- excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),
4221
- ids: Schema.optional(Schema.Array(PositiveIntegerSchema)),
4222
- target: Schema.Union([Schema.Struct({ type: Schema.Literal("everyone") }), Schema.Struct({
4223
- friendNames: Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1)),
4224
- type: Schema.Literal("friends")
4225
- })])
4226
- });
4221
+ const SharingShareInputSchema = cursorSelectionSchema({ target: Schema.Union([Schema.Struct({ type: Schema.Literal("everyone") }), Schema.Struct({
4222
+ friendNames: Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1)),
4223
+ type: Schema.Literal("friends")
4224
+ })]) });
4227
4225
  const SharedFilesEnvelopeSchema = Schema.Struct({
4228
4226
  shared: Schema.Array(SharedFileSchema),
4229
4227
  status: Schema.Literal("OK")
@@ -4253,7 +4251,7 @@ const PublicShareSchema = Schema.Struct({
4253
4251
  push_token: Schema.String,
4254
4252
  token: Schema.String,
4255
4253
  user_file: Schema.Struct({
4256
- file_type: Schema.String,
4254
+ file_type: FileTypeSchema,
4257
4255
  id: Schema.Int,
4258
4256
  name: Schema.String
4259
4257
  })
@@ -4280,8 +4278,8 @@ const PublicShareListQuerySchema = Schema.Struct({
4280
4278
  mp4_status_parent: Schema.optional(Schema.Literal(1)),
4281
4279
  parent_id: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
4282
4280
  per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),
4283
- sort: Schema.optional(Schema.String),
4284
- sort_by: Schema.optional(Schema.String),
4281
+ sort: Schema.optional(FileSortSchema),
4282
+ sort_by: Schema.optional(FileSortSchema),
4285
4283
  stream_url_parent: Schema.optional(Schema.Literal(1)),
4286
4284
  total: Schema.optional(Schema.Literal(1)),
4287
4285
  video_metadata_parent: Schema.optional(Schema.Literal(1))
@@ -4484,7 +4482,7 @@ const GetPublicShareFileUrlErrorSpec = definePutioOperationErrorSpec({
4484
4482
  ]
4485
4483
  });
4486
4484
  const toShareTarget = (target) => target.type === "everyone" ? "everyone" : target.friendNames.join(",");
4487
- const cloneSharedFiles = (input = {}) => decodeAndRun(SharingCloneInputSchema, input, (decodedInput) => requestJson(SharingCloneEnvelopeSchema, {
4485
+ const cloneSharedFiles = (input) => decodeAndRun(SharingCloneInputSchema, input, (decodedInput) => requestJson(SharingCloneEnvelopeSchema, {
4488
4486
  body: {
4489
4487
  type: "form",
4490
4488
  value: {
@@ -4542,11 +4540,13 @@ const getPublicShare = () => requestJson(PublicShareEnvelopeSchema, {
4542
4540
  method: "GET",
4543
4541
  path: "/v2/public_share"
4544
4542
  }).pipe(selectJsonField("public_share"), withOperationErrors(GetPublicShareErrorSpec));
4545
- const listPublicShareFiles = (query = {}) => decodeAndRun(PublicShareListQuerySchema, query, (decodedQuery) => requestJson(FilesListEnvelopeSchema, {
4546
- method: "GET",
4547
- path: "/v2/public_share/files/list",
4548
- query: decodedQuery
4549
- })).pipe(withOperationErrors(ListPublicShareFilesErrorSpec));
4543
+ function listPublicShareFiles(query = {}) {
4544
+ return decodeAndRun(PublicShareListQuerySchema, query, (decodedQuery) => requestJson(FilesListEnvelopeSchema, {
4545
+ method: "GET",
4546
+ path: "/v2/public_share/files/list",
4547
+ query: decodedQuery
4548
+ }).pipe(requireRequestedBreadcrumbs(decodedQuery))).pipe(withOperationErrors(ListPublicShareFilesErrorSpec));
4549
+ }
4550
4550
  const continuePublicShareFiles = (cursor, query = {}) => decodeAndRun(PublicShareContinueInputSchema, {
4551
4551
  cursor,
4552
4552
  query
@@ -4577,15 +4577,15 @@ const TrashFileSchema = Schema.Struct({
4577
4577
  id: Schema.Int,
4578
4578
  name: Schema.String,
4579
4579
  parent_id: Schema.NullOr(Schema.Int),
4580
- screenshot: Schema.Unknown,
4581
- size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))
4580
+ screenshot: Schema.Union([Schema.NullOr(Schema.String), Schema.Tuple([Schema.NullOr(Schema.String)])]),
4581
+ size: NonNegativeNumberSchema
4582
4582
  });
4583
4583
  const TrashListEnvelopeSchema = Schema.Struct({
4584
4584
  cursor: Schema.NullOr(Schema.String),
4585
4585
  files: Schema.Array(TrashFileSchema),
4586
4586
  status: Schema.Literal("OK"),
4587
4587
  total: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
4588
- trash_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))
4588
+ trash_size: NonNegativeNumberSchema
4589
4589
  });
4590
4590
  const TrashContinueEnvelopeSchema = Schema.Struct({
4591
4591
  cursor: Schema.NullOr(Schema.String),
@@ -4748,7 +4748,7 @@ const TransferLinkSchema = Schema.Struct({
4748
4748
  url: Schema.NullOr(Schema.String)
4749
4749
  });
4750
4750
  const NullableInt = Schema.NullOr(Schema.Int);
4751
- const NullableNonNegativeNumber = Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)));
4751
+ const NullableNonNegativeNumber = Schema.NullOr(NonNegativeNumberSchema);
4752
4752
  const TransferBaseSchema = Schema.Struct({
4753
4753
  availability: NullableNonNegativeNumber,
4754
4754
  callback_url: Schema.NullOr(Schema.String),
@@ -4796,12 +4796,12 @@ const TransferErrorSchema = TransferBaseSchema.mapFields(({ error_message: _erro
4796
4796
  }));
4797
4797
  const TransferCompletedSchema = TransferBaseSchema.mapFields(({ status: _status, ...fields }) => fields).pipe(Schema.fieldsAssign({ status: Schema.Literal("COMPLETED") }));
4798
4798
  const TransferLiveSchema = TransferBaseSchema.mapFields(({ recorded_seconds: _recordedSeconds, type: _type, ...fields }) => fields).pipe(Schema.fieldsAssign({
4799
- recorded_seconds: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
4799
+ recorded_seconds: NonNegativeNumberSchema,
4800
4800
  type: Schema.Literal("LIVE_STREAM")
4801
4801
  }));
4802
4802
  const TransferTorrentSeedingSchema = TransferBaseSchema.mapFields(({ current_ratio: _currentRatio, seconds_seeding: _secondsSeeding, status: _status, type: _type, ...fields }) => fields).pipe(Schema.fieldsAssign({
4803
- current_ratio: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
4804
- seconds_seeding: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
4803
+ current_ratio: NonNegativeNumberSchema,
4804
+ seconds_seeding: NonNegativeNumberSchema,
4805
4805
  status: Schema.Literals([
4806
4806
  "SEEDING",
4807
4807
  "COMPLETED",
@@ -4847,7 +4847,7 @@ const TransferRemoveInputSchema = Schema.Union([TransferRemoveIdsInputSchema, Tr
4847
4847
  const TransferInfoItemSchema = Schema.Struct({
4848
4848
  error: Schema.optional(Schema.String),
4849
4849
  error_message: Schema.optional(Schema.String),
4850
- file_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
4850
+ file_size: NonNegativeNumberSchema,
4851
4851
  human_size: Schema.String,
4852
4852
  name: Schema.String,
4853
4853
  type_name: Schema.String,
@@ -4873,7 +4873,7 @@ const TransferCountEnvelopeSchema = Schema.Struct({
4873
4873
  status: Schema.Literal("OK")
4874
4874
  });
4875
4875
  const TransferInfoEnvelopeSchema = Schema.Struct({
4876
- disk_avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
4876
+ disk_avail: NonNegativeNumberSchema,
4877
4877
  ret: Schema.Array(TransferInfoItemSchema),
4878
4878
  status: Schema.Literal("OK")
4879
4879
  });
@@ -4899,6 +4899,14 @@ const ListTransfersErrorSpec = definePutioOperationErrorSpec({
4899
4899
  statusCode: 401
4900
4900
  }, { statusCode: 400 }]
4901
4901
  });
4902
+ const ContinueTransfersErrorSpec = definePutioOperationErrorSpec({
4903
+ domain: "transfers",
4904
+ operation: "continue",
4905
+ knownErrors: [{
4906
+ errorType: "invalid_scope",
4907
+ statusCode: 401
4908
+ }, { statusCode: 400 }]
4909
+ });
4902
4910
  const GetTransferErrorSpec = definePutioOperationErrorSpec({
4903
4911
  domain: "transfers",
4904
4912
  operation: "get",
@@ -5063,11 +5071,21 @@ const StopRecordingTransferErrorSpec = definePutioOperationErrorSpec({
5063
5071
  { statusCode: 404 }
5064
5072
  ]
5065
5073
  });
5066
- const listTransfers = (query = {}) => decodeAndRun(TransfersListQuerySchema, query, (decodedQuery) => requestJson(TransfersListEnvelopeSchema, {
5067
- method: "GET",
5068
- path: "/v2/transfers/list",
5069
- query: decodedQuery
5070
- })).pipe(withOperationErrors(ListTransfersErrorSpec));
5074
+ const ensurePagedTransferFields = (response) => {
5075
+ if (response.cursor === void 0) return failMissingField("cursor");
5076
+ if (response.total === void 0) return failMissingField("total");
5077
+ return Effect.succeed(response);
5078
+ };
5079
+ function listTransfers(query = {}) {
5080
+ return decodeAndRun(TransfersListQuerySchema, query, (decodedQuery) => {
5081
+ const effect = requestJson(TransfersListEnvelopeSchema, {
5082
+ method: "GET",
5083
+ path: "/v2/transfers/list",
5084
+ query: decodedQuery
5085
+ });
5086
+ return decodedQuery.per_page === void 0 ? effect : Effect.flatMap(effect, ensurePagedTransferFields);
5087
+ }).pipe(withOperationErrors(ListTransfersErrorSpec));
5088
+ }
5071
5089
  const continueTransfers = (cursor, query = {}) => decodeAndRun(TransferContinueInputSchema, {
5072
5090
  cursor,
5073
5091
  query
@@ -5079,7 +5097,7 @@ const continueTransfers = (cursor, query = {}) => decodeAndRun(TransferContinueI
5079
5097
  method: "POST",
5080
5098
  path: "/v2/transfers/list/continue",
5081
5099
  query: decodedInput.query
5082
- })).pipe(withOperationErrors(ListTransfersErrorSpec));
5100
+ })).pipe(withOperationErrors(ContinueTransfersErrorSpec));
5083
5101
  const getTransfer = (id) => decodeAndRun(TransferIdSchema, id, (decodedId) => requestJson(TransferEnvelopeSchema, {
5084
5102
  method: "GET",
5085
5103
  path: `/v2/transfers/${encodePathSegment(decodedId)}`
@@ -5267,7 +5285,7 @@ const ZipMissingFileSchema = Schema.Struct({
5267
5285
  const ZipInfoDoneSchema = Schema.Struct({
5268
5286
  id: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),
5269
5287
  missing_files: Schema.Array(Schema.Union([Schema.String, ZipMissingFileSchema])),
5270
- size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
5288
+ size: NonNegativeNumberSchema,
5271
5289
  status: Schema.Literal("OK"),
5272
5290
  url: Schema.String,
5273
5291
  zip_status: Schema.Literal("DONE")
@@ -5362,7 +5380,10 @@ const cancelZip = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) =>
5362
5380
  // src/core/client.ts
5363
5381
  const getPromiseClientRuntime = (state) => {
5364
5382
  if (state.disposed) throw mapConfigurationError("This Promise client has been disposed and can no longer execute SDK effects");
5365
- state.runtime ??= ManagedRuntime.make(putioSdkLiveLayer(state.runtimeConfig));
5383
+ state.runtime ??= ManagedRuntime.make(putioSdkLiveLayer({
5384
+ ...state.config,
5385
+ accessToken: void 0
5386
+ }));
5366
5387
  return state.runtime;
5367
5388
  };
5368
5389
  const disposePromiseClientRuntime = async (state) => {
@@ -5371,21 +5392,26 @@ const disposePromiseClientRuntime = async (state) => {
5371
5392
  state.runtime = void 0;
5372
5393
  await runtime?.dispose();
5373
5394
  };
5374
- const provideSdk = async (state, effect) => getPromiseClientRuntime(state).runPromise(Effect.provideService(effect, PutioSdkConfig, {
5375
- ...state.runtimeConfig,
5376
- accessToken: state.accessToken
5377
- }));
5395
+ const provideSdk = async ({ signal, state }, effect) => {
5396
+ const runtime = getPromiseClientRuntime(state);
5397
+ const configured = Effect.provideService(effect, PutioSdkConfig, state.config);
5398
+ if (signal === void 0) return runtime.runPromise(configured);
5399
+ if (signal.aborted) throw signal.reason;
5400
+ const exit = await runtime.runPromiseExit(configured, { signal });
5401
+ if (Exit.isSuccess(exit)) return exit.value;
5402
+ throw signal.aborted && Cause.hasInterruptsOnly(exit.cause) ? signal.reason : Cause.squash(exit.cause);
5403
+ };
5378
5404
  const snapshotUrl = (value) => Predicate.isString(value) || value === void 0 ? value : new URL(value.href);
5379
5405
  const snapshotHeaders = (value) => value === void 0 ? void 0 : [...new Headers(value)];
5380
5406
  var OperationEntry = class {
5381
5407
  run;
5382
- toPromise;
5383
- constructor(run, toPromise) {
5408
+ bind;
5409
+ constructor(run, bind) {
5384
5410
  this.run = run;
5385
- this.toPromise = toPromise;
5411
+ this.bind = bind;
5386
5412
  }
5387
5413
  };
5388
- const effect = (operation) => new OperationEntry(operation, (state) => (...args) => provideSdk(state, operation(...args)));
5414
+ const effect = (operation) => new OperationEntry(operation, (provide) => (...args) => provide(operation(...args)));
5389
5415
  const pure = (operation) => new OperationEntry(operation, () => operation);
5390
5416
  const mapOperationTree = (tree, toOperation) => Object.fromEntries(Object.entries(tree).map(([key, value]) => [key, value instanceof OperationEntry ? toOperation(value) : mapOperationTree(value, toOperation)]));
5391
5417
  const sharedOperationTree = {
@@ -5627,63 +5653,70 @@ const sharedOperationTree = {
5627
5653
  list: effect(listZips)
5628
5654
  }
5629
5655
  };
5656
+ const bindOperationTree = (provide) => mapOperationTree(sharedOperationTree, (entry) => entry.bind(provide));
5657
+ const buildLoginUrlFrom = (webAppUrl) => (options) => buildAuthLoginUrl({
5658
+ ...options,
5659
+ webAppUrl: options.webAppUrl ?? webAppUrl
5660
+ });
5630
5661
  const createPutioSdkEffectClient = () => mapOperationTree(sharedOperationTree, (entry) => entry.run);
5631
- var PutioSdk = class extends Context.Service()("PutioSdk") {};
5632
- const makePutioSdkEffectClientLayer = () => Layer.succeed(PutioSdk, createPutioSdkEffectClient());
5633
- const makePutioSdkLiveClientLayer = (config) => Layer.mergeAll(makePutioSdkEffectClientLayer(), putioSdkLiveLayer(config));
5662
+ const makePutioSdkService = (config, httpClient) => {
5663
+ const context = Context.make(PutioSdkConfig, config).pipe(Context.add(PutioHttpClient, httpClient));
5664
+ const operations = bindOperationTree((operation) => Effect.provideContext(operation, context));
5665
+ return {
5666
+ ...operations,
5667
+ auth: {
5668
+ ...operations.auth,
5669
+ buildLoginUrl: buildLoginUrlFrom(config.webAppUrl)
5670
+ }
5671
+ };
5672
+ };
5673
+ var PutioSdk = class extends Context.Service()("@putdotio/sdk/PutioSdk") {};
5674
+ const makePutioSdkEffectClientLayer = () => Layer.effect(PutioSdk)(Effect.gen(function* () {
5675
+ return makePutioSdkService(yield* PutioSdkConfig, yield* PutioHttpClient);
5676
+ }));
5677
+ const makePutioSdkLiveClientLayer = (config) => Layer.provideMerge(makePutioSdkEffectClientLayer(), putioSdkLiveLayer(config));
5678
+ const createPromiseOperations = (state, signal) => {
5679
+ const runner = {
5680
+ signal,
5681
+ state
5682
+ };
5683
+ const operations = bindOperationTree((operation) => provideSdk(runner, operation));
5684
+ return {
5685
+ ...operations,
5686
+ auth: {
5687
+ ...operations.auth,
5688
+ buildLoginUrl: buildLoginUrlFrom(state.config.webAppUrl)
5689
+ },
5690
+ files: {
5691
+ ...operations.files,
5692
+ createUploadFormData: createFileUploadFormData
5693
+ }
5694
+ };
5695
+ };
5634
5696
  const createPutioSdkPromiseClient = (initialConfig = {}) => {
5635
- const config = {
5636
- accessToken: initialConfig.accessToken,
5637
- disposed: false,
5638
- runtime: void 0,
5639
- runtimeConfig: Struct.omit(normalizePutioSdkOptions({
5697
+ const state = {
5698
+ config: normalizePutioSdkOptions({
5640
5699
  ...initialConfig,
5641
5700
  baseUrl: snapshotUrl(initialConfig.baseUrl),
5642
5701
  headers: snapshotHeaders(initialConfig.headers),
5643
5702
  uploadBaseUrl: snapshotUrl(initialConfig.uploadBaseUrl),
5644
5703
  webAppUrl: snapshotUrl(initialConfig.webAppUrl)
5645
- }), ["accessToken"])
5704
+ }),
5705
+ disposed: false,
5706
+ runtime: void 0
5646
5707
  };
5647
- function getInfo(query = {}) {
5648
- return provideSdk(config, getAccountInfo(query));
5649
- }
5650
- function getFileById(input) {
5651
- return provideSdk(config, getFile(input));
5652
- }
5653
- function getChildByName(input) {
5654
- return provideSdk(config, getFileChild(input));
5655
- }
5656
- const operations = mapOperationTree(sharedOperationTree, (entry) => entry.toPromise(config));
5657
5708
  return {
5658
- dispose: () => disposePromiseClientRuntime(config),
5709
+ dispose: () => disposePromiseClientRuntime(state),
5659
5710
  setAccessToken: (accessToken) => {
5660
- config.accessToken = accessToken;
5661
- },
5662
- ...operations,
5663
- account: {
5664
- ...operations.account,
5665
- getInfo
5666
- },
5667
- auth: {
5668
- ...operations.auth,
5669
- buildLoginUrl: (options) => buildAuthLoginUrl({
5670
- ...options,
5671
- webAppUrl: options.webAppUrl ?? config.runtimeConfig.webAppUrl
5672
- })
5673
- },
5674
- config: {
5675
- ...operations.config,
5676
- getKeyWith: (key, schema) => provideSdk(config, getConfigKeyWith(key, schema)),
5677
- readWith: (schema) => provideSdk(config, readConfigWith(schema))
5711
+ state.config = normalizePutioSdkOptions({
5712
+ ...state.config,
5713
+ accessToken
5714
+ });
5678
5715
  },
5679
- files: {
5680
- ...operations.files,
5681
- createUploadFormData: createFileUploadFormData,
5682
- get: getFileById,
5683
- getChild: getChildByName
5684
- }
5716
+ withSignal: (signal) => createPromiseOperations(state, signal),
5717
+ ...createPromiseOperations(state, void 0)
5685
5718
  };
5686
5719
  };
5687
- 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 };
5720
+ 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, ContinueSearchErrorSpec, ContinueTransfersErrorSpec, 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, PutioContractError, 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, isPutioConfigurationError, isPutioContractError, isPutioErrorEnvelope, isPutioOperationError, isPutioRateLimitError, isPutioTransportError, isPutioValidationError, 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, mapContractError, mapTransportError, mapValidationError, 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 };
5688
5721
 
5689
5722
  //# sourceMappingURL=index.js.map