@putdotio/sdk 11.0.1 → 11.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +27 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -400,7 +400,7 @@ const DeleteAllAppSpecificPasswordsErrorSpec = definePutioOperationErrorSpec({
|
|
|
400
400
|
operation: "appSpecificPasswords.deleteAll",
|
|
401
401
|
knownErrors: [RestrictedAppSpecificPasswordError]
|
|
402
402
|
});
|
|
403
|
-
const createAppSpecificPassword = (input) => Schema.decodeUnknownEffect(CreateAppSpecificPasswordInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(CreateAppSpecificPasswordEnvelopeSchema, {
|
|
403
|
+
const createAppSpecificPassword = (input) => Schema.decodeUnknownEffect(CreateAppSpecificPasswordInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(CreateAppSpecificPasswordEnvelopeSchema, {
|
|
404
404
|
body: {
|
|
405
405
|
type: "form",
|
|
406
406
|
value: decodedInput
|
|
@@ -588,20 +588,20 @@ const queryOAuthApps = () => requestJson(OAuthAppsEnvelopeSchema, {
|
|
|
588
588
|
path: "/v2/oauth/apps"
|
|
589
589
|
}).pipe(selectJsonField("apps"), withOperationErrors(QueryOAuthAppsErrorSpec));
|
|
590
590
|
const getOAuthApp = (id, options) => Schema.decodeUnknownEffect(Schema.Struct({
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
}))({
|
|
594
|
-
|
|
595
|
-
|
|
591
|
+
id: OAuthAppIdSchema,
|
|
592
|
+
options: Schema.optional(Schema.Struct({ edit: Schema.optional(Schema.Boolean) }))
|
|
593
|
+
}), { onExcessProperty: "error" })({
|
|
594
|
+
id,
|
|
595
|
+
options
|
|
596
596
|
}).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppWithTokenSchema, {
|
|
597
597
|
method: "GET",
|
|
598
|
-
path: decodedInput.edit ? `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/edit` : `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`
|
|
598
|
+
path: decodedInput.options?.edit ? `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/edit` : `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`
|
|
599
599
|
})), withOperationErrors(GetOAuthAppErrorSpec));
|
|
600
600
|
const setOAuthAppIcon = (id, input) => {
|
|
601
601
|
return Schema.decodeUnknownEffect(Schema.Struct({
|
|
602
602
|
id: OAuthAppIdSchema,
|
|
603
603
|
input: OAuthSetIconInputSchema
|
|
604
|
-
}))({
|
|
604
|
+
}), { onExcessProperty: "error" })({
|
|
605
605
|
id,
|
|
606
606
|
input
|
|
607
607
|
}).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => {
|
|
@@ -617,7 +617,7 @@ const setOAuthAppIcon = (id, input) => {
|
|
|
617
617
|
});
|
|
618
618
|
}));
|
|
619
619
|
};
|
|
620
|
-
const createOAuthApp = (input) => Schema.decodeUnknownEffect(OAuthAppCreateInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppEnvelopeSchema, {
|
|
620
|
+
const createOAuthApp = (input) => Schema.decodeUnknownEffect(OAuthAppCreateInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppEnvelopeSchema, {
|
|
621
621
|
body: {
|
|
622
622
|
type: "form-data",
|
|
623
623
|
value: makeCreateOAuthAppFormData(decodedInput)
|
|
@@ -625,7 +625,7 @@ const createOAuthApp = (input) => Schema.decodeUnknownEffect(OAuthAppCreateInput
|
|
|
625
625
|
method: "POST",
|
|
626
626
|
path: "/v2/oauth/apps/register"
|
|
627
627
|
})), withOperationErrors(CreateOAuthAppErrorSpec));
|
|
628
|
-
const updateOAuthApp = (input) => Schema.decodeUnknownEffect(OAuthAppUpdateInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppWithTokenSchema, {
|
|
628
|
+
const updateOAuthApp = (input) => Schema.decodeUnknownEffect(OAuthAppUpdateInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OAuthAppWithTokenSchema, {
|
|
629
629
|
body: {
|
|
630
630
|
type: "form-data",
|
|
631
631
|
value: makeUpdateOAuthAppFormData(decodedInput)
|
|
@@ -1411,7 +1411,7 @@ const getConfigKeyWith = (key, schema) => Schema.decodeUnknownEffect(ConfigKeySc
|
|
|
1411
1411
|
method: "GET",
|
|
1412
1412
|
path: `/v2/config/${encodePathSegment(decodedKey)}`
|
|
1413
1413
|
})), Effect.map((envelope) => envelope["value"]));
|
|
1414
|
-
const setConfigKey = (key, value) => Schema.decodeUnknownEffect(ConfigSetKeyInputSchema)({
|
|
1414
|
+
const setConfigKey = (key, value) => Schema.decodeUnknownEffect(ConfigSetKeyInputSchema, { onExcessProperty: "error" })({
|
|
1415
1415
|
key,
|
|
1416
1416
|
value
|
|
1417
1417
|
}).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
@@ -1509,7 +1509,7 @@ const GetDownloadLinksErrorSpec = definePutioOperationErrorSpec({
|
|
|
1509
1509
|
{ statusCode: 404 }
|
|
1510
1510
|
]
|
|
1511
1511
|
});
|
|
1512
|
-
const createDownloadLinks = (input = {}) => Schema.decodeUnknownEffect(DownloadLinksCreateInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(DownloadLinksCreateEnvelopeSchema, {
|
|
1512
|
+
const createDownloadLinks = (input = {}) => Schema.decodeUnknownEffect(DownloadLinksCreateInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(DownloadLinksCreateEnvelopeSchema, {
|
|
1513
1513
|
body: {
|
|
1514
1514
|
type: "form",
|
|
1515
1515
|
value: toCursorSelectionForm(decodedInput)
|
|
@@ -1669,7 +1669,7 @@ const GetEventTorrentErrorSpec = definePutioOperationErrorSpec({
|
|
|
1669
1669
|
{ statusCode: 500 }
|
|
1670
1670
|
]
|
|
1671
1671
|
});
|
|
1672
|
-
const listEvents = (query = {}) => Schema.decodeUnknownEffect(EventsListQuerySchema)(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(EventsListEnvelopeSchema, {
|
|
1672
|
+
const listEvents = (query = {}) => Schema.decodeUnknownEffect(EventsListQuerySchema, { onExcessProperty: "error" })(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(EventsListEnvelopeSchema, {
|
|
1673
1673
|
method: "GET",
|
|
1674
1674
|
path: "/v2/events/list",
|
|
1675
1675
|
query: decodedQuery
|
|
@@ -2632,7 +2632,7 @@ function getFile(input) {
|
|
|
2632
2632
|
});
|
|
2633
2633
|
}
|
|
2634
2634
|
function getFileChild(input) {
|
|
2635
|
-
return Schema.decodeUnknownEffect(FileGetChildInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => {
|
|
2635
|
+
return Schema.decodeUnknownEffect(FileGetChildInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => {
|
|
2636
2636
|
const effect = requestJson(FileEnvelopeSchema, {
|
|
2637
2637
|
method: "GET",
|
|
2638
2638
|
path: `/v2/files/${encodePathSegment(decodedInput.parentId)}/child`,
|
|
@@ -2644,7 +2644,7 @@ function getFileChild(input) {
|
|
|
2644
2644
|
return decodedInput.query === void 0 ? effect : ensureFileQueryFields(effect, decodedInput.query);
|
|
2645
2645
|
}));
|
|
2646
2646
|
}
|
|
2647
|
-
const copyFile = (input) => Schema.decodeUnknownEffect(FileCopyInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(FileEnvelopeSchema, {
|
|
2647
|
+
const copyFile = (input) => Schema.decodeUnknownEffect(FileCopyInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(FileEnvelopeSchema, {
|
|
2648
2648
|
body: {
|
|
2649
2649
|
type: "form",
|
|
2650
2650
|
value: {
|
|
@@ -2656,7 +2656,7 @@ const copyFile = (input) => Schema.decodeUnknownEffect(FileCopyInputSchema)(inpu
|
|
|
2656
2656
|
method: "POST",
|
|
2657
2657
|
path: "/v2/files/copy"
|
|
2658
2658
|
})), selectJsonField("file"), withOperationErrors(CopyFileErrorSpec));
|
|
2659
|
-
const touchFiles = (input) => Schema.decodeUnknownEffect(FileTouchInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
2659
|
+
const touchFiles = (input) => Schema.decodeUnknownEffect(FileTouchInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
2660
2660
|
body: {
|
|
2661
2661
|
type: "form",
|
|
2662
2662
|
value: {
|
|
@@ -2671,7 +2671,7 @@ const canWriteFile = (fileId) => Schema.decodeUnknownEffect(PositiveFileIdSchema
|
|
|
2671
2671
|
method: "GET",
|
|
2672
2672
|
path: `/v2/files/${encodePathSegment(decodedFileId)}/can-write`
|
|
2673
2673
|
})), selectJsonField("user_id"), withOperationErrors(CanWriteFileErrorSpec));
|
|
2674
|
-
const searchFiles = (query) => Schema.decodeUnknownEffect(FilesSearchQuerySchema)(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(FilesSearchEnvelopeSchema, {
|
|
2674
|
+
const searchFiles = (query) => Schema.decodeUnknownEffect(FilesSearchQuerySchema, { onExcessProperty: "error" })(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(FilesSearchEnvelopeSchema, {
|
|
2675
2675
|
method: "GET",
|
|
2676
2676
|
path: "/v2/files/search",
|
|
2677
2677
|
query: decodedQuery
|
|
@@ -2688,7 +2688,7 @@ const continueSearch = (cursor, query = {}) => decodeAndRun(FilesSearchContinueI
|
|
|
2688
2688
|
path: "/v2/files/search/continue",
|
|
2689
2689
|
query: decodedInput.query
|
|
2690
2690
|
})).pipe(withOperationErrors(SearchFilesErrorSpec));
|
|
2691
|
-
const setFileSort = (input) => Schema.decodeUnknownEffect(FileSetSortInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
2691
|
+
const setFileSort = (input) => Schema.decodeUnknownEffect(FileSetSortInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
2692
2692
|
body: {
|
|
2693
2693
|
type: "form",
|
|
2694
2694
|
value: {
|
|
@@ -3899,7 +3899,7 @@ const PodcastLinksEnvelopeSchema = Schema.Struct({
|
|
|
3899
3899
|
status: Schema.Literal("OK"),
|
|
3900
3900
|
token: Schema.String
|
|
3901
3901
|
});
|
|
3902
|
-
const getPodcastLinks = (input) => Schema.decodeUnknownEffect(PodcastGetLinksInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(PodcastLinksEnvelopeSchema, {
|
|
3902
|
+
const getPodcastLinks = (input) => Schema.decodeUnknownEffect(PodcastGetLinksInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(PodcastLinksEnvelopeSchema, {
|
|
3903
3903
|
method: "GET",
|
|
3904
3904
|
path: "/v2/podcast/links",
|
|
3905
3905
|
query: {
|
|
@@ -4198,7 +4198,7 @@ const getRssFeed = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchema)(id)
|
|
|
4198
4198
|
method: "GET",
|
|
4199
4199
|
path: `/v2/rss/${encodePathSegment(decodedId)}`
|
|
4200
4200
|
})), selectJsonField("feed"), withOperationErrors(GetRssFeedErrorSpec));
|
|
4201
|
-
const createRssFeed = (params) => Schema.decodeUnknownEffect(RssFeedParamsSchema)(params).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedParams) => requestJson(RssFeedEnvelopeSchema, {
|
|
4201
|
+
const createRssFeed = (params) => Schema.decodeUnknownEffect(RssFeedParamsSchema, { onExcessProperty: "error" })(params).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedParams) => requestJson(RssFeedEnvelopeSchema, {
|
|
4202
4202
|
body: {
|
|
4203
4203
|
type: "form",
|
|
4204
4204
|
value: toCreateBody(decodedParams)
|
|
@@ -4206,7 +4206,7 @@ const createRssFeed = (params) => Schema.decodeUnknownEffect(RssFeedParamsSchema
|
|
|
4206
4206
|
method: "POST",
|
|
4207
4207
|
path: "/v2/rss/create"
|
|
4208
4208
|
})), selectJsonField("feed"), withOperationErrors(CreateRssFeedErrorSpec));
|
|
4209
|
-
const updateRssFeed = (id, params) => Schema.decodeUnknownEffect(RssFeedUpdateInputSchema)({
|
|
4209
|
+
const updateRssFeed = (id, params) => Schema.decodeUnknownEffect(RssFeedUpdateInputSchema, { onExcessProperty: "error" })({
|
|
4210
4210
|
id,
|
|
4211
4211
|
params
|
|
4212
4212
|
}).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
@@ -4237,7 +4237,7 @@ const clearRssFeedLogs = (id) => Schema.decodeUnknownEffect(PositiveIntegerSchem
|
|
|
4237
4237
|
method: "POST",
|
|
4238
4238
|
path: `/v2/rss/${encodePathSegment(decodedId)}/clear-log`
|
|
4239
4239
|
})), withOperationErrors(ClearRssFeedLogsErrorSpec));
|
|
4240
|
-
const retryRssFeedItem = (feedId, itemId) => Schema.decodeUnknownEffect(RssFeedItemRetryInputSchema)({
|
|
4240
|
+
const retryRssFeedItem = (feedId, itemId) => Schema.decodeUnknownEffect(RssFeedItemRetryInputSchema, { onExcessProperty: "error" })({
|
|
4241
4241
|
feedId,
|
|
4242
4242
|
itemId
|
|
4243
4243
|
}).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
@@ -4563,7 +4563,7 @@ const GetPublicShareFileUrlErrorSpec = definePutioOperationErrorSpec({
|
|
|
4563
4563
|
]
|
|
4564
4564
|
});
|
|
4565
4565
|
const toShareTarget = (target) => target.type === "everyone" ? "everyone" : target.friendNames.join(",");
|
|
4566
|
-
const cloneSharedFiles = (input = {}) => Schema.decodeUnknownEffect(SharingCloneInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(SharingCloneEnvelopeSchema, {
|
|
4566
|
+
const cloneSharedFiles = (input = {}) => Schema.decodeUnknownEffect(SharingCloneInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(SharingCloneEnvelopeSchema, {
|
|
4567
4567
|
body: {
|
|
4568
4568
|
type: "form",
|
|
4569
4569
|
value: {
|
|
@@ -4578,7 +4578,7 @@ const getSharingCloneInfo = (id) => Schema.decodeUnknownEffect(PositiveIntegerSc
|
|
|
4578
4578
|
method: "GET",
|
|
4579
4579
|
path: `/v2/sharing/clone/${encodePathSegment(decodedId)}`
|
|
4580
4580
|
})), withOperationErrors(GetSharingCloneInfoErrorSpec));
|
|
4581
|
-
const shareFiles = (input) => Schema.decodeUnknownEffect(SharingShareInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
4581
|
+
const shareFiles = (input) => Schema.decodeUnknownEffect(SharingShareInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
4582
4582
|
body: {
|
|
4583
4583
|
type: "form",
|
|
4584
4584
|
value: {
|
|
@@ -4597,7 +4597,7 @@ const getSharedWith = (fileId) => Schema.decodeUnknownEffect(PositiveIntegerSche
|
|
|
4597
4597
|
method: "GET",
|
|
4598
4598
|
path: `/v2/files/${encodePathSegment(decodedFileId)}/shared-with-v2`
|
|
4599
4599
|
})), withOperationErrors(GetSharedWithErrorSpec));
|
|
4600
|
-
const unshareFile = (input) => Schema.decodeUnknownEffect(SharingUnshareInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
4600
|
+
const unshareFile = (input) => Schema.decodeUnknownEffect(SharingUnshareInputSchema, { onExcessProperty: "error" })(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
|
|
4601
4601
|
body: {
|
|
4602
4602
|
type: "form",
|
|
4603
4603
|
value: { shares: joinCsv(decodedInput.shares) ?? "everyone" }
|
|
@@ -4621,12 +4621,12 @@ const getPublicShare = () => requestJson(PublicShareEnvelopeSchema, {
|
|
|
4621
4621
|
method: "GET",
|
|
4622
4622
|
path: "/v2/public_share"
|
|
4623
4623
|
}).pipe(selectJsonField("public_share"), withOperationErrors(GetPublicShareErrorSpec));
|
|
4624
|
-
const listPublicShareFiles = (query = {}) => Schema.decodeUnknownEffect(PublicShareListQuerySchema)(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(PublicShareFileListEnvelopeSchema, {
|
|
4624
|
+
const listPublicShareFiles = (query = {}) => Schema.decodeUnknownEffect(PublicShareListQuerySchema, { onExcessProperty: "error" })(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => requestJson(PublicShareFileListEnvelopeSchema, {
|
|
4625
4625
|
method: "GET",
|
|
4626
4626
|
path: "/v2/public_share/files/list",
|
|
4627
4627
|
query: decodedQuery
|
|
4628
4628
|
})), withOperationErrors(ListPublicShareFilesErrorSpec));
|
|
4629
|
-
const continuePublicShareFiles = (cursor, query = {}) => Schema.decodeUnknownEffect(PublicShareContinueInputSchema)({
|
|
4629
|
+
const continuePublicShareFiles = (cursor, query = {}) => Schema.decodeUnknownEffect(PublicShareContinueInputSchema, { onExcessProperty: "error" })({
|
|
4630
4630
|
cursor,
|
|
4631
4631
|
query
|
|
4632
4632
|
}).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(PublicShareFileListContinueEnvelopeSchema, {
|