@putdotio/sdk 10.4.0 → 11.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
@@ -474,21 +474,24 @@ const OAuthRegeneratedTokenEnvelopeSchema = Schema.Struct({
474
474
  access_token: Schema.String,
475
475
  status: Schema.Literal("OK")
476
476
  });
477
+ const OAuthAppIdSchema = Schema.Int.check(Schema.isGreaterThan(0));
478
+ const OAuthAppDescriptionSchema = Schema.String.check(Schema.isMinLength(10));
479
+ const OAuthAppUrlSchema = Schema.String.check(Schema.isMaxLength(255));
477
480
  const OAuthAppCreateInputSchema = Schema.Struct({
478
- callback: Schema.String,
479
- description: Schema.String,
481
+ callback: OAuthAppUrlSchema,
482
+ description: OAuthAppDescriptionSchema,
480
483
  hidden: Schema.optional(Schema.Boolean),
481
484
  icon: Schema.optional(Schema.instanceOf(Blob)),
482
- name: Schema.String,
483
- website: Schema.String
485
+ name: Schema.String.check(Schema.isMinLength(5)),
486
+ website: OAuthAppUrlSchema
484
487
  });
485
488
  const OAuthAppUpdateInputSchema = Schema.Struct({
486
- callback: Schema.String,
487
- description: Schema.String,
489
+ callback: OAuthAppUrlSchema,
490
+ description: OAuthAppDescriptionSchema,
488
491
  hidden: Schema.optional(Schema.Boolean),
489
492
  icon: Schema.optional(Schema.instanceOf(Blob)),
490
- id: Schema.Int,
491
- website: Schema.String
493
+ id: OAuthAppIdSchema,
494
+ website: OAuthAppUrlSchema
492
495
  });
493
496
  const OAuthSetIconInputSchema = Schema.Struct({ icon: Schema.instanceOf(Blob) });
494
497
  const QueryOAuthAppsErrorSpec = definePutioOperationErrorSpec({
@@ -573,46 +576,60 @@ const queryOAuthApps = () => requestJson(OAuthAppsEnvelopeSchema, {
573
576
  method: "GET",
574
577
  path: "/v2/oauth/apps"
575
578
  }).pipe(selectJsonField("apps"), withOperationErrors(QueryOAuthAppsErrorSpec));
576
- const getOAuthApp = (id, options) => requestJson(OAuthAppWithTokenSchema, {
579
+ const getOAuthApp = (id, options) => Schema.decodeUnknownEffect(Schema.Struct({
580
+ edit: Schema.optional(Schema.Boolean),
581
+ id: OAuthAppIdSchema
582
+ }))({
583
+ edit: options?.edit,
584
+ id
585
+ }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppWithTokenSchema, {
577
586
  method: "GET",
578
- path: options?.edit ? `/v2/oauth/apps/${encodePathSegment(id)}/edit` : `/v2/oauth/apps/${encodePathSegment(id)}`
579
- }).pipe(withOperationErrors(GetOAuthAppErrorSpec));
587
+ path: decodedInput.edit ? `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/edit` : `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`
588
+ })), withOperationErrors(GetOAuthAppErrorSpec));
580
589
  const setOAuthAppIcon = (id, input) => {
581
- const formData = new FormData();
582
- formData.append("icon", input.icon);
583
- return requestJson(OkResponseSchema, {
584
- body: {
585
- type: "form-data",
586
- value: formData
587
- },
588
- method: "POST",
589
- path: `/v2/oauth/apps/${encodePathSegment(id)}/icon`
590
- });
590
+ return Schema.decodeUnknownEffect(Schema.Struct({
591
+ id: OAuthAppIdSchema,
592
+ input: OAuthSetIconInputSchema
593
+ }))({
594
+ id,
595
+ input
596
+ }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => {
597
+ const formData = new FormData();
598
+ formData.append("icon", decodedInput.input.icon);
599
+ return requestJson(OkResponseSchema, {
600
+ body: {
601
+ type: "form-data",
602
+ value: formData
603
+ },
604
+ method: "POST",
605
+ path: `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/icon`
606
+ });
607
+ }));
591
608
  };
592
- const createOAuthApp = (input) => requestJson(OAuthAppEnvelopeSchema, {
609
+ const createOAuthApp = (input) => Schema.decodeUnknownEffect(OAuthAppCreateInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppEnvelopeSchema, {
593
610
  body: {
594
611
  type: "form-data",
595
- value: makeCreateOAuthAppFormData(input)
612
+ value: makeCreateOAuthAppFormData(decodedInput)
596
613
  },
597
614
  method: "POST",
598
615
  path: "/v2/oauth/apps/register"
599
- }).pipe(withOperationErrors(CreateOAuthAppErrorSpec));
600
- const updateOAuthApp = (input) => requestJson(OAuthAppWithTokenSchema, {
616
+ })), withOperationErrors(CreateOAuthAppErrorSpec));
617
+ const updateOAuthApp = (input) => Schema.decodeUnknownEffect(OAuthAppUpdateInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppWithTokenSchema, {
601
618
  body: {
602
619
  type: "form-data",
603
- value: makeUpdateOAuthAppFormData(input)
620
+ value: makeUpdateOAuthAppFormData(decodedInput)
604
621
  },
605
622
  method: "POST",
606
- path: `/v2/oauth/apps/${encodePathSegment(input.id)}`
607
- }).pipe(withOperationErrors(UpdateOAuthAppErrorSpec));
608
- const deleteOAuthApp = (id) => requestJson(OkResponseSchema, {
623
+ path: `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`
624
+ })), withOperationErrors(UpdateOAuthAppErrorSpec));
625
+ const deleteOAuthApp = (id) => Schema.decodeUnknownEffect(OAuthAppIdSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
609
626
  method: "POST",
610
- path: `/v2/oauth/apps/${encodePathSegment(id)}/delete`
611
- }).pipe(withOperationErrors(DeleteOAuthAppErrorSpec));
612
- const regenerateOAuthAppToken = (id) => requestJson(OAuthRegeneratedTokenEnvelopeSchema, {
627
+ path: `/v2/oauth/apps/${encodePathSegment(decodedId)}/delete`
628
+ })), withOperationErrors(DeleteOAuthAppErrorSpec));
629
+ const regenerateOAuthAppToken = (id) => Schema.decodeUnknownEffect(OAuthAppIdSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OAuthRegeneratedTokenEnvelopeSchema, {
613
630
  method: "POST",
614
- path: `/v2/oauth/apps/${encodePathSegment(id)}/regenerate_token`
615
- }).pipe(selectJsonField("access_token"), withOperationErrors(RegenerateOAuthAppTokenErrorSpec));
631
+ path: `/v2/oauth/apps/${encodePathSegment(decodedId)}/regenerate_token`
632
+ })), selectJsonField("access_token"), withOperationErrors(RegenerateOAuthAppTokenErrorSpec));
616
633
  const getPopularOAuthApps = () => requestJson(PopularOAuthAppsEnvelopeSchema, {
617
634
  method: "GET",
618
635
  path: "/v2/oauth/apps/popular"
@@ -1366,6 +1383,16 @@ const deleteConfigKey = (key) => Schema.decodeUnknownEffect(ConfigKeySchema)(key
1366
1383
  path: `/v2/config/${encodePathSegment(decodedKey)}`
1367
1384
  })));
1368
1385
  //#endregion
1386
+ //#region src/core/validation.ts
1387
+ const PositiveIntegerSchema = Schema.Int.check(Schema.isGreaterThan(0));
1388
+ const NonEmptyStringSchema = Schema.String.check(Schema.isMinLength(1));
1389
+ const decodeAndRun = (schema, input, run) => Schema.decodeUnknownEffect(schema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap(run));
1390
+ const makeCursorSelectionSchema = (idsField, excludeIdsField) => Schema.Struct({
1391
+ cursor: Schema.optional(NonEmptyStringSchema),
1392
+ [excludeIdsField]: Schema.optional(Schema.Array(PositiveIntegerSchema)),
1393
+ [idsField]: Schema.optional(Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1)))
1394
+ }).check(Schema.makeFilter((input) => input.cursor !== void 0 || input[idsField] !== void 0, { expected: "a non-empty cursor or file ID selection" }));
1395
+ //#endregion
1369
1396
  //#region src/domains/download-links.ts
1370
1397
  const DownloadLinksStatusSchema = Schema.Literals([
1371
1398
  "NEW",
@@ -1373,11 +1400,7 @@ const DownloadLinksStatusSchema = Schema.Literals([
1373
1400
  "DONE",
1374
1401
  "ERROR"
1375
1402
  ]);
1376
- const DownloadLinksCreateInputSchema = Schema.Struct({
1377
- cursor: Schema.optional(Schema.String),
1378
- excludeIds: Schema.optional(Schema.Array(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))),
1379
- ids: Schema.optional(Schema.Array(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))))
1380
- });
1403
+ const DownloadLinksCreateInputSchema = makeCursorSelectionSchema("ids", "excludeIds");
1381
1404
  const DownloadLinksPayloadSchema = Schema.Struct({
1382
1405
  download_links: Schema.Array(Schema.String),
1383
1406
  media_links: Schema.Array(Schema.String),
@@ -1452,18 +1475,18 @@ const GetDownloadLinksErrorSpec = definePutioOperationErrorSpec({
1452
1475
  { statusCode: 404 }
1453
1476
  ]
1454
1477
  });
1455
- const createDownloadLinks = (input = {}) => requestJson(DownloadLinksCreateEnvelopeSchema, {
1478
+ const createDownloadLinks = (input = {}) => Schema.decodeUnknownEffect(DownloadLinksCreateInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(DownloadLinksCreateEnvelopeSchema, {
1456
1479
  body: {
1457
1480
  type: "form",
1458
- value: toCursorSelectionForm(input)
1481
+ value: toCursorSelectionForm(decodedInput)
1459
1482
  },
1460
1483
  method: "POST",
1461
1484
  path: "/v2/download_links/create"
1462
- }).pipe(selectJsonFields("id"), withOperationErrors(CreateDownloadLinksErrorSpec));
1463
- const getDownloadLinks = (id) => requestJson(DownloadLinksInfoSchema, {
1485
+ })), selectJsonFields("id"), withOperationErrors(CreateDownloadLinksErrorSpec));
1486
+ const getDownloadLinks = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(DownloadLinksInfoSchema, {
1464
1487
  method: "GET",
1465
- path: `/v2/download_links/${encodePathSegment(id)}`
1466
- }).pipe(withOperationErrors(GetDownloadLinksErrorSpec));
1488
+ path: `/v2/download_links/${encodePathSegment(decodedId)}`
1489
+ })), withOperationErrors(GetDownloadLinksErrorSpec));
1467
1490
  //#endregion
1468
1491
  //#region src/domains/events.ts
1469
1492
  const HistoryEventBaseSchema = Schema.Struct({
@@ -1612,23 +1635,23 @@ const GetEventTorrentErrorSpec = definePutioOperationErrorSpec({
1612
1635
  { statusCode: 500 }
1613
1636
  ]
1614
1637
  });
1615
- const listEvents = (query = {}) => requestJson(EventsListEnvelopeSchema, {
1638
+ const listEvents = (query = {}) => Schema.decodeUnknownEffect(EventsListQuerySchema)(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(EventsListEnvelopeSchema, {
1616
1639
  method: "GET",
1617
1640
  path: "/v2/events/list",
1618
- query
1619
- }).pipe(withOperationErrors(ListEventsErrorSpec));
1620
- const deleteEvent = (id) => requestJson(OkResponseSchema, {
1641
+ query: decodedQuery
1642
+ })), withOperationErrors(ListEventsErrorSpec));
1643
+ const deleteEvent = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
1621
1644
  method: "POST",
1622
- path: `/v2/events/delete/${encodePathSegment(id)}`
1623
- }).pipe(withOperationErrors(DeleteEventErrorSpec));
1645
+ path: `/v2/events/delete/${encodePathSegment(decodedId)}`
1646
+ })), withOperationErrors(DeleteEventErrorSpec));
1624
1647
  const clearEvents = () => requestJson(OkResponseSchema, {
1625
1648
  method: "POST",
1626
1649
  path: "/v2/events/delete"
1627
1650
  }).pipe(withOperationErrors(ClearEventsErrorSpec));
1628
- const getEventTorrent = (id) => requestArrayBuffer({
1651
+ const getEventTorrent = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestArrayBuffer({
1629
1652
  method: "GET",
1630
- path: `/v2/events/${encodePathSegment(id)}/torrent`
1631
- }).pipe(withOperationErrors(GetEventTorrentErrorSpec));
1653
+ path: `/v2/events/${encodePathSegment(decodedId)}/torrent`
1654
+ })), withOperationErrors(GetEventTorrentErrorSpec));
1632
1655
  //#endregion
1633
1656
  //#region src/domains/family.ts
1634
1657
  const NonNegativeIntegerSchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
@@ -1747,14 +1770,14 @@ const createFamilyInvite = () => requestJson(FamilyCreateInviteEnvelopeSchema, {
1747
1770
  method: "POST",
1748
1771
  path: "/v2/family/sub_account"
1749
1772
  }).pipe(selectJsonFields("code"), withOperationErrors(CreateFamilyInviteErrorSpec));
1750
- const removeFamilyMember = (username) => requestJson(OkResponseSchema, {
1773
+ const removeFamilyMember = (username) => Schema.decodeUnknownEffect(NonEmptyStringSchema)(username).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedUsername) => requestJson(OkResponseSchema, {
1751
1774
  method: "DELETE",
1752
- path: `/v2/family/sub_account/${encodePathSegment(username)}`
1753
- }).pipe(Effect.asVoid, withOperationErrors(RemoveFamilyMemberErrorSpec));
1754
- const joinFamily = (inviteCode) => requestJson(OkResponseSchema, {
1775
+ path: `/v2/family/sub_account/${encodePathSegment(decodedUsername)}`
1776
+ })), Effect.asVoid, withOperationErrors(RemoveFamilyMemberErrorSpec));
1777
+ const joinFamily = (inviteCode) => Schema.decodeUnknownEffect(NonEmptyStringSchema)(inviteCode).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInviteCode) => requestJson(OkResponseSchema, {
1755
1778
  method: "POST",
1756
- path: `/v2/family/join/${encodePathSegment(inviteCode)}`
1757
- }).pipe(Effect.asVoid, withOperationErrors(JoinFamilyErrorSpec));
1779
+ path: `/v2/family/join/${encodePathSegment(decodedInviteCode)}`
1780
+ })), Effect.asVoid, withOperationErrors(JoinFamilyErrorSpec));
1758
1781
  //#endregion
1759
1782
  //#region src/domains/ifttt.ts
1760
1783
  const IFTTTStatusEnvelopeSchema = Schema.Struct({
@@ -1945,8 +1968,7 @@ const FilesListQuerySchema = FileQuerySchema.mapFields(({ codecs: _codecs, media
1945
1968
  }));
1946
1969
  const FilesSearchQuerySchema = Schema.Struct({
1947
1970
  per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),
1948
- query: Schema.String,
1949
- type: Schema.optional(Schema.Union([FileTypeSchema, Schema.Array(FileTypeSchema)]))
1971
+ query: Schema.String
1950
1972
  });
1951
1973
  const FileBreadcrumbSchema = Schema.Tuple([Schema.Int, Schema.String]);
1952
1974
  const FileEnvelopeSchema = Schema.Struct({
@@ -2399,14 +2421,6 @@ const FileUploadErrorSpec = definePutioOperationErrorSpec({
2399
2421
  const missingFieldError = (field) => new PutioValidationError({ cause: `Expected put.io to include "${field}" because it was requested` });
2400
2422
  const failMissingField = (field) => Effect.fail(missingFieldError(field));
2401
2423
  const widenValidationError = (effect) => effect;
2402
- const normalizeFilesSearchQuery = (query) => {
2403
- const type = query.type === void 0 || typeof query.type === "string" ? query.type : joinCsv(query.type);
2404
- return {
2405
- per_page: query.per_page,
2406
- query: query.query,
2407
- type
2408
- };
2409
- };
2410
2424
  const hasStreamUrl = (value) => "stream_url" in value;
2411
2425
  const hasMp4StreamUrl = (value) => "mp4_stream_url" in value;
2412
2426
  const hasMp4StreamUrlWhenAvailable = (value) => !value.is_mp4_available || hasMp4StreamUrl(value);
@@ -2541,11 +2555,11 @@ const canWriteFile = (fileId) => Schema.decodeUnknownEffect(PositiveFileIdSchema
2541
2555
  method: "GET",
2542
2556
  path: `/v2/files/${encodePathSegment(decodedFileId)}/can-write`
2543
2557
  })), selectJsonField("user_id"), withOperationErrors(CanWriteFileErrorSpec));
2544
- const searchFiles = (query) => requestJson(FilesSearchEnvelopeSchema, {
2558
+ const searchFiles = (query) => Schema.decodeUnknownEffect(FilesSearchQuerySchema)(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(FilesSearchEnvelopeSchema, {
2545
2559
  method: "GET",
2546
2560
  path: "/v2/files/search",
2547
- query: normalizeFilesSearchQuery(query)
2548
- }).pipe(withOperationErrors(SearchFilesErrorSpec));
2561
+ query: decodedQuery
2562
+ })), withOperationErrors(SearchFilesErrorSpec));
2549
2563
  const continueSearch = (cursor, query = {}) => requestJson(FilesSearchEnvelopeSchema, {
2550
2564
  body: {
2551
2565
  type: "form",
@@ -2980,14 +2994,15 @@ const FriendSharedFolderErrorSpec = definePutioOperationErrorSpec({
2980
2994
  { statusCode: 404 }
2981
2995
  ]
2982
2996
  });
2997
+ const decodeUsername = (username) => Schema.decodeUnknownEffect(NonEmptyStringSchema)(username).pipe(Effect.mapError(mapDecodeErrorToValidationError));
2983
2998
  const listFriends = () => requestJson(FriendsListEnvelopeSchema, {
2984
2999
  method: "GET",
2985
3000
  path: "/v2/friends/list"
2986
3001
  }).pipe(selectJsonFields("friends", "total"), withOperationErrors(ListFriendsErrorSpec));
2987
- const searchFriends = (username) => requestJson(FriendSearchEnvelopeSchema, {
3002
+ const searchFriends = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(FriendSearchEnvelopeSchema, {
2988
3003
  method: "GET",
2989
- path: `/v2/friends/user-search/${encodePathSegment(username)}`
2990
- }).pipe(selectJsonField("users"), withOperationErrors(SearchFriendsErrorSpec));
3004
+ path: `/v2/friends/user-search/${encodePathSegment(decodedUsername)}`
3005
+ })), selectJsonField("users"), withOperationErrors(SearchFriendsErrorSpec));
2991
3006
  const listWaitingRequests = () => requestJson(FriendRequestsEnvelopeSchema, {
2992
3007
  method: "GET",
2993
3008
  path: "/v2/friends/waiting-requests"
@@ -3000,26 +3015,26 @@ const listSentRequests = () => requestJson(FriendRequestsEnvelopeSchema, {
3000
3015
  method: "GET",
3001
3016
  path: "/v2/friends/sent-requests"
3002
3017
  }).pipe(selectJsonField("friends"), withOperationErrors(ListSentRequestsErrorSpec));
3003
- const sendFriendRequest = (username) => requestJson(OkResponseSchema, {
3018
+ const sendFriendRequest = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(OkResponseSchema, {
3004
3019
  method: "POST",
3005
- path: `/v2/friends/${encodePathSegment(username)}/request`
3006
- }).pipe(withOperationErrors(SendFriendRequestErrorSpec));
3007
- const removeFriend = (username) => requestJson(OkResponseSchema, {
3020
+ path: `/v2/friends/${encodePathSegment(decodedUsername)}/request`
3021
+ })), withOperationErrors(SendFriendRequestErrorSpec));
3022
+ const removeFriend = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(OkResponseSchema, {
3008
3023
  method: "POST",
3009
- path: `/v2/friends/${encodePathSegment(username)}/unfriend`
3010
- }).pipe(withOperationErrors(RemoveFriendErrorSpec));
3011
- const approveFriendRequest = (username) => requestJson(OkResponseSchema, {
3024
+ path: `/v2/friends/${encodePathSegment(decodedUsername)}/unfriend`
3025
+ })), withOperationErrors(RemoveFriendErrorSpec));
3026
+ const approveFriendRequest = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(OkResponseSchema, {
3012
3027
  method: "POST",
3013
- path: `/v2/friends/${encodePathSegment(username)}/approve`
3014
- }).pipe(withOperationErrors(ApproveFriendRequestErrorSpec));
3015
- const denyFriendRequest = (username) => requestJson(OkResponseSchema, {
3028
+ path: `/v2/friends/${encodePathSegment(decodedUsername)}/approve`
3029
+ })), withOperationErrors(ApproveFriendRequestErrorSpec));
3030
+ const denyFriendRequest = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(OkResponseSchema, {
3016
3031
  method: "POST",
3017
- path: `/v2/friends/${encodePathSegment(username)}/deny`
3018
- }).pipe(withOperationErrors(DenyFriendRequestErrorSpec));
3019
- const getFriendSharedFolder = (username) => requestJson(FriendSharedFolderEnvelopeSchema, {
3032
+ path: `/v2/friends/${encodePathSegment(decodedUsername)}/deny`
3033
+ })), withOperationErrors(DenyFriendRequestErrorSpec));
3034
+ const getFriendSharedFolder = (username) => decodeUsername(username).pipe(Effect.flatMap((decodedUsername) => requestJson(FriendSharedFolderEnvelopeSchema, {
3020
3035
  method: "GET",
3021
- path: `/v2/friends/${encodePathSegment(username)}/files`
3022
- }).pipe(selectJsonField("file"), withOperationErrors(FriendSharedFolderErrorSpec));
3036
+ path: `/v2/friends/${encodePathSegment(decodedUsername)}/files`
3037
+ })), selectJsonField("file"), withOperationErrors(FriendSharedFolderErrorSpec));
3023
3038
  //#endregion
3024
3039
  //#region src/domains/payment.ts
3025
3040
  const PaymentPlanTypeSchema = Schema.Literals(["onetime", "subscription"]);
@@ -3276,10 +3291,6 @@ const PaymentOpenNodeChargeEnvelopeSchema = Schema.Struct({
3276
3291
  opennode: Schema.Struct({ checkout_url: Schema.String }),
3277
3292
  status: Schema.Literal("OK")
3278
3293
  });
3279
- const PaymentCoinbaseChargeEnvelopeSchema = Schema.Struct({
3280
- coinbase: Schema.Struct({ code: Schema.String }),
3281
- status: Schema.Literal("OK")
3282
- });
3283
3294
  const RestrictedPaymentError = {
3284
3295
  errorType: "invalid_scope",
3285
3296
  statusCode: 401
@@ -3549,18 +3560,6 @@ const CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec = definePutioOp
3549
3560
  { statusCode: 404 }
3550
3561
  ]
3551
3562
  });
3552
- const CreateCoinbaseChargeErrorSpec = definePutioOperationErrorSpec({
3553
- domain: "payment",
3554
- operation: "createCoinbaseCharge",
3555
- knownErrors: [
3556
- {
3557
- errorType: "PAYMENT_UNKNOWN_PLAN",
3558
- statusCode: 400
3559
- },
3560
- ...CommonPaymentActionErrors,
3561
- { statusCode: 400 }
3562
- ]
3563
- });
3564
3563
  const CreateOpenNodeChargeErrorSpec = definePutioOperationErrorSpec({
3565
3564
  domain: "payment",
3566
3565
  operation: "createOpenNodeCharge",
@@ -3673,14 +3672,6 @@ const createPaddleBillingUpdatePaymentMethodTransaction = (userSubscriptionId) =
3673
3672
  method: "GET",
3674
3673
  path: `/v2/payment/methods/paddle_billing/update_payment_method/${encodeURIComponent(userSubscriptionId)}`
3675
3674
  }).pipe(selectJsonField("transaction_id"), withOperationErrors(CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec));
3676
- const createCoinbaseCharge = (planPath) => requestJson(PaymentCoinbaseChargeEnvelopeSchema, {
3677
- body: {
3678
- type: "form",
3679
- value: { plan_fs_path: planPath }
3680
- },
3681
- method: "POST",
3682
- path: "/v2/payment/methods/coinbase/charge"
3683
- }).pipe(selectJsonField("coinbase"), Effect.map(({ code }) => code), withOperationErrors(CreateCoinbaseChargeErrorSpec));
3684
3675
  const createOpenNodeCharge = (planPath) => requestJson(PaymentOpenNodeChargeEnvelopeSchema, {
3685
3676
  body: {
3686
3677
  type: "form",
@@ -3746,10 +3737,18 @@ const RssFeedParamsSchema = Schema.Struct({
3746
3737
  dont_process_whole_feed: Schema.optional(Schema.Boolean),
3747
3738
  keyword: Schema.optional(Schema.NullOr(Schema.String)),
3748
3739
  parent_dir_id: Schema.optional(Schema.Union([Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), Schema.Literal("newf")])),
3749
- rss_source_url: Schema.String,
3750
- title: Schema.String,
3740
+ rss_source_url: NonEmptyStringSchema,
3741
+ title: NonEmptyStringSchema,
3751
3742
  unwanted_keywords: Schema.optional(Schema.String)
3752
3743
  });
3744
+ const RssFeedUpdateInputSchema = Schema.Struct({
3745
+ id: PositiveIntegerSchema,
3746
+ params: RssFeedParamsSchema
3747
+ });
3748
+ const RssFeedItemRetryInputSchema = Schema.Struct({
3749
+ feedId: PositiveIntegerSchema,
3750
+ itemId: PositiveIntegerSchema
3751
+ });
3753
3752
  const RssFeedItemBaseSchema = Schema.Struct({
3754
3753
  detected_date: Schema.String,
3755
3754
  id: Schema.Int.check(Schema.isGreaterThan(0)),
@@ -3999,54 +3998,60 @@ const listRssFeeds = () => requestJson(RssFeedsEnvelopeSchema, {
3999
3998
  method: "GET",
4000
3999
  path: "/v2/rss/list"
4001
4000
  }).pipe(selectJsonField("feeds"), withOperationErrors(ListRssFeedsErrorSpec));
4002
- const getRssFeed = (id) => requestJson(RssFeedEnvelopeSchema, {
4001
+ const getRssFeed = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(RssFeedEnvelopeSchema, {
4003
4002
  method: "GET",
4004
- path: `/v2/rss/${encodePathSegment(id)}`
4005
- }).pipe(selectJsonField("feed"), withOperationErrors(GetRssFeedErrorSpec));
4006
- const createRssFeed = (params) => requestJson(RssFeedEnvelopeSchema, {
4003
+ path: `/v2/rss/${encodePathSegment(decodedId)}`
4004
+ })), selectJsonField("feed"), withOperationErrors(GetRssFeedErrorSpec));
4005
+ const createRssFeed = (params) => Schema.decodeUnknownEffect(RssFeedParamsSchema)(params).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedParams) => requestJson(RssFeedEnvelopeSchema, {
4007
4006
  body: {
4008
4007
  type: "form",
4009
- value: toCreateBody(params)
4008
+ value: toCreateBody(decodedParams)
4010
4009
  },
4011
4010
  method: "POST",
4012
4011
  path: "/v2/rss/create"
4013
- }).pipe(selectJsonField("feed"), withOperationErrors(CreateRssFeedErrorSpec));
4014
- const updateRssFeed = (id, params) => requestJson(OkResponseSchema, {
4012
+ })), selectJsonField("feed"), withOperationErrors(CreateRssFeedErrorSpec));
4013
+ const updateRssFeed = (id, params) => Schema.decodeUnknownEffect(RssFeedUpdateInputSchema)({
4014
+ id,
4015
+ params
4016
+ }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
4015
4017
  body: {
4016
4018
  type: "form",
4017
- value: toUpdateBody(params)
4019
+ value: toUpdateBody(decodedInput.params)
4018
4020
  },
4019
4021
  method: "POST",
4020
- path: `/v2/rss/${encodePathSegment(id)}`
4021
- }).pipe(withOperationErrors(UpdateRssFeedErrorSpec));
4022
- const pauseRssFeed = (id) => requestJson(OkResponseSchema, {
4022
+ path: `/v2/rss/${encodePathSegment(decodedInput.id)}`
4023
+ })), withOperationErrors(UpdateRssFeedErrorSpec));
4024
+ const pauseRssFeed = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
4023
4025
  method: "POST",
4024
- path: `/v2/rss/${encodePathSegment(id)}/pause`
4025
- }).pipe(withOperationErrors(PauseRssFeedErrorSpec));
4026
- const resumeRssFeed = (id) => requestJson(OkResponseSchema, {
4026
+ path: `/v2/rss/${encodePathSegment(decodedId)}/pause`
4027
+ })), withOperationErrors(PauseRssFeedErrorSpec));
4028
+ const resumeRssFeed = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
4027
4029
  method: "POST",
4028
- path: `/v2/rss/${encodePathSegment(id)}/resume`
4029
- }).pipe(withOperationErrors(ResumeRssFeedErrorSpec));
4030
- const deleteRssFeed = (id) => requestJson(OkResponseSchema, {
4030
+ path: `/v2/rss/${encodePathSegment(decodedId)}/resume`
4031
+ })), withOperationErrors(ResumeRssFeedErrorSpec));
4032
+ const deleteRssFeed = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
4031
4033
  method: "POST",
4032
- path: `/v2/rss/${encodePathSegment(id)}/delete`
4033
- }).pipe(withOperationErrors(DeleteRssFeedErrorSpec));
4034
- const listRssFeedItems = (id) => requestJson(RssFeedItemsEnvelopeSchema, {
4034
+ path: `/v2/rss/${encodePathSegment(decodedId)}/delete`
4035
+ })), withOperationErrors(DeleteRssFeedErrorSpec));
4036
+ const listRssFeedItems = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(RssFeedItemsEnvelopeSchema, {
4035
4037
  method: "GET",
4036
- path: `/v2/rss/${encodePathSegment(id)}/items`
4037
- }).pipe(selectJsonFields("feed", "items"), withOperationErrors(ListRssFeedItemsErrorSpec));
4038
- const clearRssFeedLogs = (id) => requestJson(OkResponseSchema, {
4038
+ path: `/v2/rss/${encodePathSegment(decodedId)}/items`
4039
+ })), selectJsonFields("feed", "items"), withOperationErrors(ListRssFeedItemsErrorSpec));
4040
+ const clearRssFeedLogs = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
4039
4041
  method: "POST",
4040
- path: `/v2/rss/${encodePathSegment(id)}/clear-log`
4041
- }).pipe(withOperationErrors(ClearRssFeedLogsErrorSpec));
4042
- const retryRssFeedItem = (feedId, itemId) => requestJson(OkResponseSchema, {
4042
+ path: `/v2/rss/${encodePathSegment(decodedId)}/clear-log`
4043
+ })), withOperationErrors(ClearRssFeedLogsErrorSpec));
4044
+ const retryRssFeedItem = (feedId, itemId) => Schema.decodeUnknownEffect(RssFeedItemRetryInputSchema)({
4045
+ feedId,
4046
+ itemId
4047
+ }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
4043
4048
  method: "POST",
4044
- path: `/v2/rss/${encodePathSegment(feedId)}/items/${encodePathSegment(itemId)}/retry`
4045
- }).pipe(withOperationErrors(RetryRssFeedItemErrorSpec));
4046
- const retryAllRssFeedItems = (feedId) => requestJson(OkResponseSchema, {
4049
+ path: `/v2/rss/${encodePathSegment(decodedInput.feedId)}/items/${encodePathSegment(decodedInput.itemId)}/retry`
4050
+ })), withOperationErrors(RetryRssFeedItemErrorSpec));
4051
+ const retryAllRssFeedItems = (feedId) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(feedId).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedFeedId) => requestJson(OkResponseSchema, {
4047
4052
  method: "POST",
4048
- path: `/v2/rss/${encodePathSegment(feedId)}/retry-all`
4049
- }).pipe(withOperationErrors(RetryAllRssFeedItemsErrorSpec));
4053
+ path: `/v2/rss/${encodePathSegment(decodedFeedId)}/retry-all`
4054
+ })), withOperationErrors(RetryAllRssFeedItemsErrorSpec));
4050
4055
  //#endregion
4051
4056
  //#region src/domains/sharing.ts
4052
4057
  const SharingCloneStatusSchema = Schema.Literals([
@@ -4056,10 +4061,10 @@ const SharingCloneStatusSchema = Schema.Literals([
4056
4061
  "ERROR"
4057
4062
  ]);
4058
4063
  const SharingCloneInputSchema = Schema.Struct({
4059
- cursor: Schema.optional(Schema.String),
4060
- excludeIds: Schema.optional(Schema.Array(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))),
4061
- ids: Schema.optional(Schema.Array(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))),
4062
- parentId: Schema.optional(Schema.Int)
4064
+ cursor: Schema.optional(NonEmptyStringSchema),
4065
+ excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),
4066
+ ids: Schema.optional(Schema.Array(PositiveIntegerSchema)),
4067
+ parentId: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))
4063
4068
  });
4064
4069
  const SharingCloneEnvelopeSchema = Schema.Struct({
4065
4070
  id: Schema.Int.check(Schema.isGreaterThan(0)),
@@ -4079,11 +4084,11 @@ const SharingCloneInfoSchema = Schema.Union([Schema.Struct({
4079
4084
  })]);
4080
4085
  const SharedFileSchema = FileBroadSchema.pipe(Schema.fieldsAssign({ shared_with: Schema.Union([Schema.Literal("everyone"), Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))]) }));
4081
4086
  const SharingShareInputSchema = Schema.Struct({
4082
- cursor: Schema.optional(Schema.String),
4083
- excludeIds: Schema.optional(Schema.Array(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))),
4084
- ids: Schema.optional(Schema.Array(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))),
4087
+ cursor: Schema.optional(NonEmptyStringSchema),
4088
+ excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),
4089
+ ids: Schema.optional(Schema.Array(PositiveIntegerSchema)),
4085
4090
  target: Schema.Union([Schema.Struct({ type: Schema.Literal("everyone") }), Schema.Struct({
4086
- friendNames: Schema.Array(Schema.String).check(Schema.isMinLength(1)),
4091
+ friendNames: Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1)),
4087
4092
  type: Schema.Literal("friends")
4088
4093
  })])
4089
4094
  });
@@ -4105,8 +4110,8 @@ const SharedFileSharedWithSchema = Schema.Union([Schema.Struct({
4105
4110
  status: Schema.optional(Schema.Literal("OK"))
4106
4111
  })]);
4107
4112
  const SharingUnshareInputSchema = Schema.Struct({
4108
- fileId: Schema.Int.check(Schema.isGreaterThan(0)),
4109
- shares: Schema.optional(Schema.Array(Schema.Union([Schema.Int, Schema.String])))
4113
+ fileId: PositiveIntegerSchema,
4114
+ shares: Schema.optional(Schema.Array(Schema.Union([PositiveIntegerSchema, NonEmptyStringSchema])))
4110
4115
  });
4111
4116
  const PublicShareSchema = Schema.Struct({
4112
4117
  created_at: Schema.String,
@@ -4156,7 +4161,7 @@ const PublicShareListQuerySchema = Schema.Struct({
4156
4161
  hidden: Schema.optional(Schema.Literal(1)),
4157
4162
  media_info_parent: Schema.optional(Schema.Literal(1)),
4158
4163
  mp4_status_parent: Schema.optional(Schema.Literal(1)),
4159
- parent_id: Schema.optional(Schema.Int),
4164
+ parent_id: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
4160
4165
  per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),
4161
4166
  sort: Schema.optional(Schema.String),
4162
4167
  sort_by: Schema.optional(Schema.String),
@@ -4164,6 +4169,10 @@ const PublicShareListQuerySchema = Schema.Struct({
4164
4169
  total: Schema.optional(Schema.Literal(1)),
4165
4170
  video_metadata_parent: Schema.optional(Schema.Literal(1))
4166
4171
  });
4172
+ const PublicShareContinueInputSchema = Schema.Struct({
4173
+ cursor: NonEmptyStringSchema,
4174
+ query: Schema.Struct({ per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))) })
4175
+ });
4167
4176
  const CreateSharingCloneErrorSpec = definePutioOperationErrorSpec({
4168
4177
  domain: "sharing",
4169
4178
  operation: "clone",
@@ -4357,90 +4366,86 @@ const GetPublicShareFileUrlErrorSpec = definePutioOperationErrorSpec({
4357
4366
  { statusCode: 404 }
4358
4367
  ]
4359
4368
  });
4360
- const toShareTarget = (target) => {
4361
- if (target.type === "everyone") return Effect.succeed("everyone");
4362
- if (target.friendNames.length === 0) return Effect.fail(new PutioValidationError({ cause: "shareFiles target.friendNames must include at least one friend" }));
4363
- return Effect.succeed(target.friendNames.join(","));
4364
- };
4365
- const cloneSharedFiles = (input = {}) => requestJson(SharingCloneEnvelopeSchema, {
4369
+ const toShareTarget = (target) => target.type === "everyone" ? "everyone" : target.friendNames.join(",");
4370
+ const cloneSharedFiles = (input = {}) => Schema.decodeUnknownEffect(SharingCloneInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(SharingCloneEnvelopeSchema, {
4366
4371
  body: {
4367
4372
  type: "form",
4368
4373
  value: {
4369
- ...toCursorSelectionForm(input),
4370
- parent_id: input.parentId ?? 0
4374
+ ...toCursorSelectionForm(decodedInput),
4375
+ parent_id: decodedInput.parentId ?? 0
4371
4376
  }
4372
4377
  },
4373
4378
  method: "POST",
4374
4379
  path: "/v2/sharing/clone"
4375
- }).pipe(selectJsonFields("id"), withOperationErrors(CreateSharingCloneErrorSpec));
4376
- const getSharingCloneInfo = (id) => requestJson(SharingCloneInfoSchema, {
4380
+ })), selectJsonFields("id"), withOperationErrors(CreateSharingCloneErrorSpec));
4381
+ const getSharingCloneInfo = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(SharingCloneInfoSchema, {
4377
4382
  method: "GET",
4378
- path: `/v2/sharing/clone/${encodePathSegment(id)}`
4379
- }).pipe(withOperationErrors(GetSharingCloneInfoErrorSpec));
4380
- const shareFiles = (input) => Effect.gen(function* () {
4381
- const friends = yield* toShareTarget(input.target);
4382
- return yield* requestJson(OkResponseSchema, {
4383
- body: {
4384
- type: "form",
4385
- value: {
4386
- ...toCursorSelectionForm(input),
4387
- friends
4388
- }
4389
- },
4390
- method: "POST",
4391
- path: "/v2/files/share"
4392
- });
4393
- }).pipe(withOperationErrors(ShareFilesErrorSpec));
4383
+ path: `/v2/sharing/clone/${encodePathSegment(decodedId)}`
4384
+ })), withOperationErrors(GetSharingCloneInfoErrorSpec));
4385
+ const shareFiles = (input) => Schema.decodeUnknownEffect(SharingShareInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
4386
+ body: {
4387
+ type: "form",
4388
+ value: {
4389
+ ...toCursorSelectionForm(decodedInput),
4390
+ friends: toShareTarget(decodedInput.target)
4391
+ }
4392
+ },
4393
+ method: "POST",
4394
+ path: "/v2/files/share"
4395
+ })), withOperationErrors(ShareFilesErrorSpec));
4394
4396
  const listSharedFiles = () => requestJson(SharedFilesEnvelopeSchema, {
4395
4397
  method: "GET",
4396
4398
  path: "/v2/files/shared"
4397
4399
  }).pipe(selectJsonField("shared"), withOperationErrors(ListSharedFilesErrorSpec));
4398
- const getSharedWith = (fileId) => requestJson(SharedFileSharedWithSchema, {
4400
+ const getSharedWith = (fileId) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedFileId) => requestJson(SharedFileSharedWithSchema, {
4399
4401
  method: "GET",
4400
- path: `/v2/files/${encodePathSegment(fileId)}/shared-with-v2`
4401
- }).pipe(withOperationErrors(GetSharedWithErrorSpec));
4402
- const unshareFile = (input) => requestJson(OkResponseSchema, {
4402
+ path: `/v2/files/${encodePathSegment(decodedFileId)}/shared-with-v2`
4403
+ })), withOperationErrors(GetSharedWithErrorSpec));
4404
+ const unshareFile = (input) => Schema.decodeUnknownEffect(SharingUnshareInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
4403
4405
  body: {
4404
4406
  type: "form",
4405
- value: { shares: joinCsv(input.shares) ?? "everyone" }
4407
+ value: { shares: joinCsv(decodedInput.shares) ?? "everyone" }
4406
4408
  },
4407
4409
  method: "POST",
4408
- path: `/v2/files/${encodePathSegment(input.fileId)}/unshare`
4409
- }).pipe(withOperationErrors(UnshareFileErrorSpec));
4410
- const createPublicShare = (fileId) => requestJson(PublicShareEnvelopeSchema, {
4410
+ path: `/v2/files/${encodePathSegment(decodedInput.fileId)}/unshare`
4411
+ })), withOperationErrors(UnshareFileErrorSpec));
4412
+ const createPublicShare = (fileId) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedFileId) => requestJson(PublicShareEnvelopeSchema, {
4411
4413
  method: "POST",
4412
- path: `/v2/public_share/${encodePathSegment(fileId)}`
4413
- }).pipe(selectJsonField("public_share"), withOperationErrors(CreatePublicShareErrorSpec));
4414
+ path: `/v2/public_share/${encodePathSegment(decodedFileId)}`
4415
+ })), selectJsonField("public_share"), withOperationErrors(CreatePublicShareErrorSpec));
4414
4416
  const listPublicShares = () => requestJson(PublicSharesEnvelopeSchema, {
4415
4417
  method: "GET",
4416
4418
  path: "/v2/public_share/list"
4417
4419
  }).pipe(selectJsonField("public_shares"), withOperationErrors(ListPublicSharesErrorSpec));
4418
- const deletePublicShare = (id) => requestJson(OkResponseSchema, {
4420
+ const deletePublicShare = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
4419
4421
  method: "DELETE",
4420
- path: `/v2/public_share/${encodePathSegment(id)}`
4421
- }).pipe(withOperationErrors(DeletePublicShareErrorSpec));
4422
+ path: `/v2/public_share/${encodePathSegment(decodedId)}`
4423
+ })), withOperationErrors(DeletePublicShareErrorSpec));
4422
4424
  const getPublicShare = () => requestJson(PublicShareEnvelopeSchema, {
4423
4425
  method: "GET",
4424
4426
  path: "/v2/public_share"
4425
4427
  }).pipe(selectJsonField("public_share"), withOperationErrors(GetPublicShareErrorSpec));
4426
- const listPublicShareFiles = (query = {}) => requestJson(PublicShareFileListEnvelopeSchema, {
4428
+ const listPublicShareFiles = (query = {}) => Schema.decodeUnknownEffect(PublicShareListQuerySchema)(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(PublicShareFileListEnvelopeSchema, {
4427
4429
  method: "GET",
4428
4430
  path: "/v2/public_share/files/list",
4431
+ query: decodedQuery
4432
+ })), withOperationErrors(ListPublicShareFilesErrorSpec));
4433
+ const continuePublicShareFiles = (cursor, query = {}) => Schema.decodeUnknownEffect(PublicShareContinueInputSchema)({
4434
+ cursor,
4429
4435
  query
4430
- }).pipe(withOperationErrors(ListPublicShareFilesErrorSpec));
4431
- const continuePublicShareFiles = (cursor, query = {}) => requestJson(PublicShareFileListContinueEnvelopeSchema, {
4436
+ }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(PublicShareFileListContinueEnvelopeSchema, {
4432
4437
  body: {
4433
4438
  type: "form",
4434
- value: { cursor }
4439
+ value: { cursor: decodedInput.cursor }
4435
4440
  },
4436
4441
  method: "POST",
4437
4442
  path: "/v2/public_share/files/list/continue",
4438
- query
4439
- }).pipe(withOperationErrors(ContinuePublicShareFilesErrorSpec));
4440
- const getPublicShareFileUrl = (fileId) => requestJson(PublicShareFileUrlEnvelopeSchema, {
4443
+ query: decodedInput.query
4444
+ })), withOperationErrors(ContinuePublicShareFilesErrorSpec));
4445
+ const getPublicShareFileUrl = (fileId) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedFileId) => requestJson(PublicShareFileUrlEnvelopeSchema, {
4441
4446
  method: "GET",
4442
- path: `/v2/public_share/files/${encodePathSegment(fileId)}/url`
4443
- }).pipe(selectJsonField("url"), withOperationErrors(GetPublicShareFileUrlErrorSpec));
4447
+ path: `/v2/public_share/files/${encodePathSegment(decodedFileId)}/url`
4448
+ })), selectJsonField("url"), withOperationErrors(GetPublicShareFileUrlErrorSpec));
4444
4449
  //#endregion
4445
4450
  //#region src/domains/trash.ts
4446
4451
  const TrashFileSchema = Schema.Struct({
@@ -4471,6 +4476,22 @@ const TrashContinueEnvelopeSchema = Schema.Struct({
4471
4476
  files: Schema.Array(TrashFileSchema),
4472
4477
  status: Schema.Literal("OK")
4473
4478
  });
4479
+ const TrashListQuerySchema = Schema.Struct({ per_page: Schema.optional(PositiveIntegerSchema) });
4480
+ const TrashCursorBulkInputSchema = Schema.Struct({
4481
+ cursor: NonEmptyStringSchema,
4482
+ file_ids: Schema.optional(Schema.Never),
4483
+ useCursor: Schema.Literal(true)
4484
+ });
4485
+ const TrashIdsBulkInputSchema = Schema.Struct({
4486
+ cursor: Schema.optional(Schema.Never),
4487
+ file_ids: Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1)),
4488
+ useCursor: Schema.optional(Schema.Literal(false))
4489
+ });
4490
+ const TrashBulkInputSchema = Schema.Union([TrashCursorBulkInputSchema, TrashIdsBulkInputSchema]);
4491
+ const TrashContinueInputSchema = Schema.Struct({
4492
+ cursor: NonEmptyStringSchema,
4493
+ query: TrashListQuerySchema
4494
+ });
4474
4495
  const RestrictedReadError = {
4475
4496
  errorType: "invalid_scope",
4476
4497
  statusCode: 401
@@ -4540,46 +4561,48 @@ const EmptyTrashErrorSpec = definePutioOperationErrorSpec({
4540
4561
  }, RestrictedWriteError]
4541
4562
  });
4542
4563
  const toBulkTrashBody = (input) => {
4543
- if (input.useCursor) return {
4564
+ if (input.useCursor === true) return {
4544
4565
  cursor: input.cursor,
4545
4566
  file_ids: void 0
4546
4567
  };
4547
- if (!input.file_ids) throw new Error("trash bulk file_ids are required when useCursor is not set");
4548
4568
  return {
4549
4569
  cursor: void 0,
4550
4570
  file_ids: joinCsv(input.file_ids)
4551
4571
  };
4552
4572
  };
4553
- const listTrash = (query) => requestJson(TrashListEnvelopeSchema, {
4573
+ const listTrash = (query = {}) => decodeAndRun(TrashListQuerySchema, query, (decodedQuery) => requestJson(TrashListEnvelopeSchema, {
4554
4574
  method: "GET",
4555
4575
  path: "/v2/trash/list",
4576
+ query: decodedQuery
4577
+ })).pipe(withOperationErrors(ListTrashErrorSpec));
4578
+ const continueTrash = (cursor, query = {}) => decodeAndRun(TrashContinueInputSchema, {
4579
+ cursor,
4556
4580
  query
4557
- }).pipe(withOperationErrors(ListTrashErrorSpec));
4558
- const continueTrash = (cursor, query) => requestJson(TrashContinueEnvelopeSchema, {
4581
+ }, (decodedInput) => requestJson(TrashContinueEnvelopeSchema, {
4559
4582
  body: {
4560
4583
  type: "form",
4561
- value: { cursor }
4584
+ value: { cursor: decodedInput.cursor }
4562
4585
  },
4563
4586
  method: "POST",
4564
4587
  path: "/v2/trash/list/continue",
4565
- query
4566
- }).pipe(withOperationErrors(ContinueTrashErrorSpec));
4567
- const restoreTrash = (input) => requestJson(OkResponseSchema, {
4588
+ query: decodedInput.query
4589
+ })).pipe(withOperationErrors(ContinueTrashErrorSpec));
4590
+ const restoreTrash = (input) => decodeAndRun(TrashBulkInputSchema, input, (decodedInput) => requestJson(OkResponseSchema, {
4568
4591
  body: {
4569
4592
  type: "form",
4570
- value: toBulkTrashBody(input)
4593
+ value: toBulkTrashBody(decodedInput)
4571
4594
  },
4572
4595
  method: "POST",
4573
4596
  path: "/v2/trash/restore"
4574
- }).pipe(Effect.asVoid, withOperationErrors(RestoreTrashErrorSpec));
4575
- const deleteTrash = (input) => requestJson(OkResponseSchema, {
4597
+ })).pipe(Effect.asVoid, withOperationErrors(RestoreTrashErrorSpec));
4598
+ const deleteTrash = (input) => decodeAndRun(TrashBulkInputSchema, input, (decodedInput) => requestJson(OkResponseSchema, {
4576
4599
  body: {
4577
4600
  type: "form",
4578
- value: toBulkTrashBody(input)
4601
+ value: toBulkTrashBody(decodedInput)
4579
4602
  },
4580
4603
  method: "POST",
4581
4604
  path: "/v2/trash/delete"
4582
- }).pipe(Effect.asVoid, withOperationErrors(DeleteTrashErrorSpec));
4605
+ })).pipe(Effect.asVoid, withOperationErrors(DeleteTrashErrorSpec));
4583
4606
  const emptyTrash = () => requestJson(OkResponseSchema, {
4584
4607
  method: "POST",
4585
4608
  path: "/v2/trash/empty"
@@ -5086,6 +5109,7 @@ const ZipInfoSchema = Schema.Union([
5086
5109
  ZipInfoErrorSchema,
5087
5110
  ZipInfoDoneSchema
5088
5111
  ]);
5112
+ const CreateZipInputSchema = makeCursorSelectionSchema("file_ids", "exclude_ids");
5089
5113
  const FilesReadScopeError = {
5090
5114
  errorType: "invalid_scope",
5091
5115
  statusCode: 401
@@ -5147,26 +5171,26 @@ const listZips = () => requestJson(ZipsListEnvelopeSchema, {
5147
5171
  method: "GET",
5148
5172
  path: "/v2/zips/list"
5149
5173
  }).pipe(selectJsonField("zips"), withOperationErrors(ListZipsErrorSpec));
5150
- const createZip = (input) => requestJson(ZipCreateEnvelopeSchema, {
5174
+ const createZip = (input) => decodeAndRun(CreateZipInputSchema, input, (decodedInput) => requestJson(ZipCreateEnvelopeSchema, {
5151
5175
  body: {
5152
5176
  type: "form",
5153
5177
  value: { ...toCursorSelectionForm({
5154
- cursor: input.cursor,
5155
- excludeIds: input.exclude_ids,
5156
- ids: input.file_ids
5178
+ cursor: decodedInput.cursor,
5179
+ excludeIds: decodedInput.exclude_ids,
5180
+ ids: decodedInput.file_ids
5157
5181
  }) }
5158
5182
  },
5159
5183
  method: "POST",
5160
5184
  path: "/v2/zips/create"
5161
- }).pipe(selectJsonField("zip_id"), withOperationErrors(CreateZipErrorSpec));
5162
- const getZip = (id) => requestJson(ZipInfoSchema, {
5185
+ })).pipe(selectJsonField("zip_id"), withOperationErrors(CreateZipErrorSpec));
5186
+ const getZip = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(ZipInfoSchema, {
5163
5187
  method: "GET",
5164
- path: `/v2/zips/${encodePathSegment(id)}`
5165
- }).pipe(withOperationErrors(GetZipErrorSpec));
5166
- const cancelZip = (id) => requestJson(OkResponseSchema, {
5188
+ path: `/v2/zips/${encodePathSegment(decodedId)}`
5189
+ })).pipe(withOperationErrors(GetZipErrorSpec));
5190
+ const cancelZip = (id) => decodeAndRun(PositiveIntegerSchema, id, (decodedId) => requestJson(OkResponseSchema, {
5167
5191
  method: "GET",
5168
- path: `/v2/zips/${encodePathSegment(id)}/cancel`
5169
- }).pipe(Effect.asVoid, withOperationErrors(CancelZipErrorSpec));
5192
+ path: `/v2/zips/${encodePathSegment(decodedId)}/cancel`
5193
+ })).pipe(Effect.asVoid, withOperationErrors(CancelZipErrorSpec));
5170
5194
  //#endregion
5171
5195
  //#region src/core/client.ts
5172
5196
  const promiseClientRuntimeCache = /* @__PURE__ */ new WeakMap();
@@ -5364,7 +5388,6 @@ const createPutioSdkEffectClient = () => ({
5364
5388
  listPlans: listPaymentPlans,
5365
5389
  methods: {
5366
5390
  addPaddleWaitingPayment: createPaddleWaitingPayment,
5367
- createCoinbaseCharge,
5368
5391
  createOpenNodeCharge,
5369
5392
  createPaddleBillingUpdatePaymentMethodTransaction,
5370
5393
  getPaddleBillingInvoiceUrl
@@ -5637,7 +5660,6 @@ const createPutioSdkPromiseClient = (initialConfig = {}) => {
5637
5660
  listPlans: () => provideSdk(config, listPaymentPlans()),
5638
5661
  methods: {
5639
5662
  addPaddleWaitingPayment: (input) => provideSdk(config, createPaddleWaitingPayment(input)),
5640
- createCoinbaseCharge: (planPath) => provideSdk(config, createCoinbaseCharge(planPath)),
5641
5663
  createOpenNodeCharge: (planPath) => provideSdk(config, createOpenNodeCharge(planPath)),
5642
5664
  createPaddleBillingUpdatePaymentMethodTransaction: (userSubscriptionId) => provideSdk(config, createPaddleBillingUpdatePaymentMethodTransaction(userSubscriptionId)),
5643
5665
  getPaddleBillingInvoiceUrl: (paymentId) => provideSdk(config, getPaddleBillingInvoiceUrl(paymentId))
@@ -5715,6 +5737,6 @@ const createPutioSdkPromiseClient = (initialConfig = {}) => {
5715
5737
  };
5716
5738
  };
5717
5739
  //#endregion
5718
- 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, CreateCoinbaseChargeErrorSpec, 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, 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, RemoveTransfersErrorSpec, RenameFileErrorSpec, ReportPaymentsErrorSpec, ResetPasswordErrorSpec, RestoreTrashErrorSpec, ResumeRssFeedErrorSpec, RetryAllRssFeedItemsErrorSpec, RetryRssFeedItemErrorSpec, RetryTransferErrorSpec, RevokeAllOAuthClientsErrorSpec, RevokeOAuthClientErrorSpec, RevokeOAuthGrantErrorSpec, RssFeedItemFailedSchema, RssFeedItemSchema, RssFeedItemSucceededSchema, RssFeedParamsSchema, RssFeedSchema, 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, 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, createCoinbaseCharge, 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, getHlsStreamUrl, getIftttStatus, getMp4Status, getOAuthApp, getPaddleBillingInvoiceUrl, getPaymentInfo, getPaymentVoucherInfo, getPodcastLinks, getPopularOAuthApps, getPublicShare, getPublicShareFileUrl, getRecoveryCodes, getRssFeed, getSharedWith, getSharingCloneInfo, getStartFrom, getTransfer, getTransferInfo, getTransferTorrent, getVoucher, 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, removeTransfers, renameFile, reportPayments, requestArrayBuffer, requestJson, 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 };
5740
+ 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, 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, RemoveTransfersErrorSpec, RenameFileErrorSpec, ReportPaymentsErrorSpec, ResetPasswordErrorSpec, RestoreTrashErrorSpec, ResumeRssFeedErrorSpec, RetryAllRssFeedItemsErrorSpec, RetryRssFeedItemErrorSpec, RetryTransferErrorSpec, RevokeAllOAuthClientsErrorSpec, RevokeOAuthClientErrorSpec, RevokeOAuthGrantErrorSpec, RssFeedItemFailedSchema, RssFeedItemSchema, RssFeedItemSucceededSchema, RssFeedParamsSchema, RssFeedSchema, 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, 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, getHlsStreamUrl, getIftttStatus, getMp4Status, getOAuthApp, getPaddleBillingInvoiceUrl, getPaymentInfo, getPaymentVoucherInfo, getPodcastLinks, getPopularOAuthApps, getPublicShare, getPublicShareFileUrl, getRecoveryCodes, getRssFeed, getSharedWith, getSharingCloneInfo, getStartFrom, getTransfer, getTransferInfo, getTransferTorrent, getVoucher, 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, removeTransfers, renameFile, reportPayments, requestArrayBuffer, requestJson, 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 };
5719
5741
 
5720
5742
  //# sourceMappingURL=index.js.map