@putdotio/sdk 11.4.3 → 11.4.4
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/README.md +2 -0
- package/dist/{index-CfQyzyBs.d.ts → index-BE2uTdeq.d.ts} +39 -39
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/utilities.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["RequestedFlag","missingFieldError","failMissingField","widenValidationError"],"sources":["../src/domains/account.ts","../src/domains/app-specific-passwords.ts","../src/core/validation.ts","../src/domains/oauth.ts","../src/domains/auth.ts","../src/domains/config.ts","../src/domains/download-links.ts","../src/domains/events.ts","../src/domains/family.ts","../src/domains/ifttt.ts","../src/domains/files.ts","../src/domains/friend-invites.ts","../src/domains/friends.ts","../src/domains/payment.ts","../src/domains/podcast.ts","../src/domains/rss.ts","../src/domains/sharing.ts","../src/domains/trash.ts","../src/domains/transfers.ts","../src/domains/tunnel.ts","../src/domains/zips.ts","../src/core/client.ts"],"sourcesContent":["import { Effect, Schema } from \"effect\";\nimport {\n PutioValidationError,\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n type PutioSdkError,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n requestJson,\n selectJsonField,\n type PutioSdkContext,\n} from \"../core/http.js\";\nconst RequestedFlag = Schema.Literal(1);\nexport const AccountDiskSchema = Schema.Struct({\n avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n used: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n});\nexport const AccountWarningsSchema = Schema.Struct({\n callback_url_has_failed: Schema.optional(Schema.Boolean),\n pushover_token_has_failed: Schema.optional(Schema.Boolean),\n});\nconst AccountSettingsFields = {\n beta_user: Schema.Boolean,\n callback_url: Schema.NullOr(Schema.String),\n dark_theme: Schema.Boolean,\n default_download_folder: Schema.Int,\n dont_autoselect_subtitles: Schema.Boolean,\n fluid_layout: Schema.Boolean,\n hide_subtitles: Schema.Boolean,\n history_enabled: Schema.Boolean,\n is_invisible: Schema.Boolean,\n locale: Schema.NullOr(Schema.String),\n login_mails_enabled: Schema.Boolean,\n next_episode: Schema.Boolean,\n pushover_token: Schema.NullOr(Schema.String),\n show_optimistic_usage: Schema.Boolean,\n sort_by: Schema.String,\n start_from: Schema.Boolean,\n subtitle_languages: Schema.Array(Schema.NullOr(Schema.String)).check(Schema.isMaxLength(2)),\n theater_mode: Schema.Boolean,\n theme: Schema.Literals([\"dark\", \"light\", \"auto\"]),\n transfer_sort_by: Schema.NullOr(Schema.String),\n trash_enabled: Schema.Boolean,\n tunnel_route_name: Schema.NullOr(Schema.String),\n two_factor_enabled: Schema.Boolean,\n use_private_download_ip: Schema.Boolean,\n use_start_from: Schema.Boolean,\n video_player: Schema.NullOr(Schema.Literals([\"html5\", \"flash\"])),\n};\nexport const AccountSettingsSchema = Schema.Struct(AccountSettingsFields);\nconst AccountFeaturesSchema = Schema.Record(Schema.String, Schema.Boolean);\nexport const PasInfoSchema = Schema.Struct({\n user_hash: Schema.String,\n});\nexport const AccountInfoBaseSchema = Schema.Struct({\n account_active: Schema.optional(Schema.NullOr(Schema.Boolean)),\n account_status: Schema.Literals([\"active\", \"inactive\", \"stranger\"]),\n avatar_url: Schema.String,\n can_create_sub_account: Schema.Boolean,\n disk: AccountDiskSchema,\n family_owner: Schema.optional(Schema.NullOr(Schema.String)),\n files_will_be_deleted_at: Schema.NullOr(Schema.String),\n is_admin: Schema.optional(Schema.Boolean),\n is_eligible_for_friend_invitation: Schema.Boolean,\n is_sub_account: Schema.Boolean,\n mail: Schema.String,\n monthly_bandwidth_usage: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n password_last_changed_at: Schema.NullOr(Schema.String),\n private_download_host_ip: Schema.NullOr(Schema.String),\n settings: AccountSettingsSchema,\n trash_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n user_id: Schema.Int,\n username: Schema.String,\n warnings: AccountWarningsSchema,\n});\nexport const AccountInfoQuerySchema = Schema.Struct({\n download_token: Schema.optional(RequestedFlag),\n features: Schema.optional(RequestedFlag),\n intercom: Schema.optional(RequestedFlag),\n pas: Schema.optional(RequestedFlag),\n platform: Schema.optional(Schema.Literals([\"web\", \"ios\"])),\n profitwell: Schema.optional(RequestedFlag),\n push_token: Schema.optional(RequestedFlag),\n});\nexport const AccountInfoBroadSchema = AccountInfoBaseSchema.pipe(\n Schema.fieldsAssign({\n download_token: Schema.optional(Schema.String),\n features: Schema.optional(AccountFeaturesSchema),\n paddle_user_id: Schema.optional(Schema.NullOr(Schema.Union([Schema.Int, Schema.String]))),\n pas: Schema.optional(PasInfoSchema),\n push_token: Schema.optional(Schema.String),\n user_hash: Schema.optional(Schema.String),\n }),\n);\nconst AccountInfoEnvelopeSchema = Schema.Struct({\n info: AccountInfoBroadSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst AccountSettingsEnvelopeSchema = Schema.Struct({\n settings: AccountSettingsSchema,\n status: Schema.Literal(\"OK\"),\n});\nexport const AccountSubtitleLanguageSchema = Schema.Struct({\n code: Schema.String,\n name: Schema.String,\n});\nconst AccountSubtitleLanguagesEnvelopeSchema = Schema.Struct({\n languages: Schema.Array(AccountSubtitleLanguageSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport const AccountTwoFactorSettingsSchema = Schema.Struct({\n code: Schema.String,\n enable: Schema.Boolean,\n});\nconst AccountSettingsPatchFields = {\n beta_user: Schema.optional(AccountSettingsFields.beta_user),\n callback_url: Schema.optional(AccountSettingsFields.callback_url),\n dark_theme: Schema.optional(AccountSettingsFields.dark_theme),\n default_download_folder: Schema.optional(AccountSettingsFields.default_download_folder),\n dont_autoselect_subtitles: Schema.optional(AccountSettingsFields.dont_autoselect_subtitles),\n fluid_layout: Schema.optional(AccountSettingsFields.fluid_layout),\n hide_subtitles: Schema.optional(AccountSettingsFields.hide_subtitles),\n history_enabled: Schema.optional(AccountSettingsFields.history_enabled),\n is_invisible: Schema.optional(AccountSettingsFields.is_invisible),\n locale: Schema.optional(AccountSettingsFields.locale),\n login_mails_enabled: Schema.optional(AccountSettingsFields.login_mails_enabled),\n next_episode: Schema.optional(AccountSettingsFields.next_episode),\n pushover_token: Schema.optional(AccountSettingsFields.pushover_token),\n show_optimistic_usage: Schema.optional(AccountSettingsFields.show_optimistic_usage),\n sort_by: Schema.optional(AccountSettingsFields.sort_by),\n start_from: Schema.optional(AccountSettingsFields.start_from),\n subtitle_languages: Schema.optional(AccountSettingsFields.subtitle_languages),\n theater_mode: Schema.optional(AccountSettingsFields.theater_mode),\n theme: Schema.optional(AccountSettingsFields.theme),\n transfer_sort_by: Schema.optional(AccountSettingsFields.transfer_sort_by),\n trash_enabled: Schema.optional(AccountSettingsFields.trash_enabled),\n tunnel_route_name: Schema.optional(AccountSettingsFields.tunnel_route_name),\n two_factor_enabled: Schema.optional(AccountSettingsFields.two_factor_enabled),\n use_private_download_ip: Schema.optional(AccountSettingsFields.use_private_download_ip),\n use_start_from: Schema.optional(AccountSettingsFields.use_start_from),\n video_player: Schema.optional(AccountSettingsFields.video_player),\n};\nconst SaveAccountSettingsCommonFields = {\n ...AccountSettingsPatchFields,\n two_factor_enabled: Schema.optional(AccountTwoFactorSettingsSchema),\n username: Schema.optional(Schema.String),\n};\nexport const SaveAccountSettingsPayloadSchema = Schema.Union([\n Schema.Struct(SaveAccountSettingsCommonFields),\n Schema.Struct({\n ...SaveAccountSettingsCommonFields,\n current_password: Schema.String,\n mail: Schema.String,\n password: Schema.optional(Schema.String),\n }),\n Schema.Struct({\n ...SaveAccountSettingsCommonFields,\n current_password: Schema.String,\n mail: Schema.optional(Schema.String),\n password: Schema.String,\n }),\n]);\nexport const AccountClearOptionsSchema = Schema.Struct({\n active_transfers: Schema.Boolean,\n files: Schema.Boolean,\n finished_transfers: Schema.Boolean,\n friends: Schema.Boolean,\n history: Schema.Boolean,\n rss_feeds: Schema.Boolean,\n rss_logs: Schema.Boolean,\n trash: Schema.Boolean,\n});\nconst AccountConfirmationSubjectSchema = Schema.Literals([\n \"mail_change\",\n \"password_change\",\n \"subscription_upgrade\",\n]);\nexport const AccountConfirmationSchema = Schema.Struct({\n created_at: Schema.String,\n subject: AccountConfirmationSubjectSchema,\n});\nconst AccountConfirmationsEnvelopeSchema = Schema.Struct({\n confirmations: Schema.Array(AccountConfirmationSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport type AccountDisk = Schema.Schema.Type<typeof AccountDiskSchema>;\nexport type AccountWarnings = Schema.Schema.Type<typeof AccountWarningsSchema>;\nexport type AccountSettings = Schema.Schema.Type<typeof AccountSettingsSchema>;\nexport type AccountInfoQuery = Schema.Schema.Type<typeof AccountInfoQuerySchema>;\nexport type PasInfo = Schema.Schema.Type<typeof PasInfoSchema>;\nexport type AccountInfoBase = Schema.Schema.Type<typeof AccountInfoBaseSchema>;\nexport type AccountInfoBroad = Schema.Schema.Type<typeof AccountInfoBroadSchema>;\nexport type SaveAccountSettingsPayload = Schema.Schema.Type<\n typeof SaveAccountSettingsPayloadSchema\n>;\nexport type AccountClearOptions = Schema.Schema.Type<typeof AccountClearOptionsSchema>;\nexport type AccountConfirmation = Schema.Schema.Type<typeof AccountConfirmationSchema>;\nexport type AccountSubtitleLanguage = Schema.Schema.Type<typeof AccountSubtitleLanguageSchema>;\nexport type AccountInfoResponseFor<TQuery extends AccountInfoQuery> = AccountInfoBase &\n (TQuery[\"download_token\"] extends 1\n ? {\n readonly download_token: string;\n }\n : {}) &\n (TQuery[\"features\"] extends 1\n ? {\n readonly features: Record<string, boolean>;\n }\n : {}) &\n (TQuery[\"intercom\"] extends 1\n ? {\n readonly user_hash?: string;\n }\n : {}) &\n (TQuery[\"pas\"] extends 1\n ? {\n readonly pas: PasInfo;\n }\n : {}) &\n (TQuery[\"profitwell\"] extends 1\n ? {\n readonly paddle_user_id: number | string | null;\n }\n : {}) &\n (TQuery[\"push_token\"] extends 1\n ? {\n readonly push_token: string;\n }\n : {});\nconst missingFieldError = (field: string) =>\n new PutioValidationError({\n cause: `Expected put.io to include \"${field}\" because it was requested`,\n });\nconst failMissingField = (field: string): Effect.Effect<never, PutioValidationError> =>\n Effect.fail(missingFieldError(field));\nconst widenValidationError = <A, E, R>(\n effect: Effect.Effect<A, E, R>,\n): Effect.Effect<A, E | PutioValidationError, R> => effect;\nconst mapSensitiveAccountDecodeError = (operation: \"destroy\" | \"saveSettings\") => () =>\n new PutioValidationError({\n cause: {\n domain: \"account\",\n operation,\n reason: \"Invalid request input\",\n },\n });\nconst hasDownloadToken = (\n value: AccountInfoBroad,\n): value is AccountInfoBroad & {\n readonly download_token: string;\n} => typeof value.download_token === \"string\";\nconst hasFeatures = (\n value: AccountInfoBroad,\n): value is AccountInfoBroad & {\n readonly features: Record<string, boolean>;\n} => typeof value.features === \"object\" && value.features !== null;\nconst hasPas = (\n value: AccountInfoBroad,\n): value is AccountInfoBroad & {\n readonly pas: PasInfo;\n} => typeof value.pas === \"object\" && value.pas !== null && typeof value.pas.user_hash === \"string\";\nconst hasPaddleUserId = (\n value: AccountInfoBroad,\n): value is AccountInfoBroad & {\n readonly paddle_user_id: number | string | null;\n} => \"paddle_user_id\" in value;\nconst hasPushToken = (\n value: AccountInfoBroad,\n): value is AccountInfoBroad & {\n readonly push_token: string;\n} => typeof value.push_token === \"string\";\nconst ensureAccountInfoFields = <TQuery extends AccountInfoQuery>(\n effect: Effect.Effect<AccountInfoBroad, PutioSdkError, PutioSdkContext>,\n query: TQuery,\n): Effect.Effect<\n AccountInfoResponseFor<TQuery>,\n PutioSdkError | PutioValidationError,\n PutioSdkContext\n> =>\n Effect.gen(function* () {\n const info = yield* widenValidationError(effect);\n if (query.download_token === 1 && !hasDownloadToken(info)) {\n return yield* failMissingField(\"download_token\");\n }\n if (query.features === 1 && !hasFeatures(info)) {\n return yield* failMissingField(\"features\");\n }\n if (query.pas === 1 && !hasPas(info)) {\n return yield* failMissingField(\"pas\");\n }\n if (query.profitwell === 1 && !hasPaddleUserId(info)) {\n return yield* failMissingField(\"paddle_user_id\");\n }\n if (query.push_token === 1 && !hasPushToken(info)) {\n return yield* failMissingField(\"push_token\");\n }\n // Requested-field checks above establish the query-conditioned contract.\n return info as AccountInfoResponseFor<TQuery>;\n });\nexport const SaveAccountSettingsErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"saveSettings\",\n knownErrors: [\n { errorType: \"INVALID_CURRENT_PASSWORD\", statusCode: 400 as const },\n { errorType: \"INVALID_NEW_PASSWORD\", statusCode: 400 as const },\n { errorType: \"INVALID_USERNAME\", statusCode: 400 as const },\n { errorType: \"INVALID_MAIL\", statusCode: 400 as const },\n { errorType: \"DISPOSABLE_MAIL_NOT_ALLOWED\", statusCode: 400 as const },\n { errorType: \"INVALID_CALLBACK_URL\", statusCode: 400 as const },\n { errorType: \"INVALID_PUSHOVER_TOKEN\", statusCode: 400 as const },\n { errorType: \"INVALID_CODE\", statusCode: 400 as const },\n { errorType: \"INVALID_ENABLE\", statusCode: 400 as const },\n { errorType: \"INVALID_VALUE\", statusCode: 400 as const },\n { errorType: \"PWNED_NEW_PASSWORD\", statusCode: 400 as const },\n { errorType: \"SAME_USERNAME\", statusCode: 409 as const },\n { errorType: \"EXISTING_MAIL\", statusCode: 409 as const },\n { errorType: \"USERNAME_EXISTS\", statusCode: 400 as const },\n { errorType: \"UNAVAILABLE_VALUE\", statusCode: 403 as const },\n { errorType: \"ALREADY_ENABLED\", statusCode: 403 as const },\n { errorType: \"INVALID_STATE\", statusCode: 403 as const },\n { errorType: \"NOT_ENABLED\", statusCode: 403 as const },\n ],\n});\nexport const AccountConfirmationsErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"listConfirmations\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport type SaveAccountSettingsError = PutioOperationFailure<typeof SaveAccountSettingsErrorSpec>;\nexport type AccountConfirmationsError = PutioOperationFailure<typeof AccountConfirmationsErrorSpec>;\nexport function getAccountInfo(query: {\n readonly download_token: 1;\n readonly pas: 1;\n}): Effect.Effect<\n AccountInfoBase & {\n readonly download_token: string;\n readonly pas: PasInfo;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: { readonly download_token: 1 }): Effect.Effect<\n AccountInfoBase & {\n readonly download_token: string;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: { readonly features: 1 }): Effect.Effect<\n AccountInfoBase & {\n readonly features: Record<string, boolean>;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: {\n readonly intercom: 1;\n readonly platform?: \"web\" | \"ios\";\n}): Effect.Effect<\n AccountInfoBase & {\n readonly user_hash?: string;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: { readonly pas: 1 }): Effect.Effect<\n AccountInfoBase & {\n readonly pas: PasInfo;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: { readonly profitwell: 1 }): Effect.Effect<\n AccountInfoBase & {\n readonly paddle_user_id: number | string | null;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: { readonly push_token: 1 }): Effect.Effect<\n AccountInfoBase & {\n readonly push_token: string;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(): Effect.Effect<AccountInfoBroad, PutioSdkError, PutioSdkContext>;\nexport function getAccountInfo(\n query: AccountInfoQuery,\n): Effect.Effect<AccountInfoBroad, PutioSdkError, PutioSdkContext>;\nexport function getAccountInfo(query: AccountInfoQuery = {}) {\n return Schema.decodeUnknownEffect(AccountInfoQuerySchema, {\n onExcessProperty: \"error\",\n })(query).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedQuery) => {\n const effect = requestJson(AccountInfoEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/account/info\",\n query: decodedQuery,\n }).pipe(selectJsonField(\"info\"));\n return ensureAccountInfoFields(effect, decodedQuery);\n }),\n );\n}\nexport const getAccountSettings = (): Effect.Effect<\n AccountSettings,\n PutioSdkError,\n PutioSdkContext\n> =>\n requestJson(AccountSettingsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/account/settings\",\n }).pipe(selectJsonField(\"settings\"));\nexport const listAccountSubtitleLanguages = (): Effect.Effect<\n ReadonlyArray<AccountSubtitleLanguage>,\n PutioSdkError,\n PutioSdkContext\n> =>\n requestJson(AccountSubtitleLanguagesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/account/subtitle_languages\",\n }).pipe(selectJsonField(\"languages\"));\nexport const saveAccountSettings = (\n payload: SaveAccountSettingsPayload,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n SaveAccountSettingsError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(SaveAccountSettingsPayloadSchema, {\n onExcessProperty: \"error\",\n })(payload).pipe(\n Effect.mapError(mapSensitiveAccountDecodeError(\"saveSettings\")),\n Effect.flatMap((decodedPayload) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"json\",\n value: decodedPayload,\n },\n method: \"POST\",\n path: \"/v2/account/settings\",\n }),\n ),\n withOperationErrors(SaveAccountSettingsErrorSpec),\n );\nexport const clearAccount = (\n options: AccountClearOptions,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(AccountClearOptionsSchema, {\n onExcessProperty: \"error\",\n })(options).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedOptions) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: decodedOptions,\n },\n method: \"POST\",\n path: \"/v2/account/clear\",\n }),\n ),\n );\nexport const destroyAccount = (\n currentPassword: string,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(Schema.String.check(Schema.isMinLength(1)))(currentPassword).pipe(\n Effect.mapError(mapSensitiveAccountDecodeError(\"destroy\")),\n Effect.flatMap((decodedPassword) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n current_password: decodedPassword,\n },\n },\n method: \"POST\",\n path: \"/v2/account/destroy\",\n }),\n ),\n );\nexport const listAccountConfirmations = (\n subject?: AccountConfirmation[\"subject\"],\n): Effect.Effect<ReadonlyArray<AccountConfirmation>, AccountConfirmationsError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(Schema.UndefinedOr(AccountConfirmationSubjectSchema))(subject).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedSubject) =>\n requestJson(AccountConfirmationsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/account/confirmation/list\",\n query: decodedSubject\n ? {\n type: decodedSubject,\n }\n : undefined,\n }),\n ),\n selectJsonField(\"confirmations\"),\n withOperationErrors(AccountConfirmationsErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\n\nimport {\n PutioErrorEnvelopeSchema,\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\n\nconst AppSpecificPasswordIdSchema = Schema.Int.check(Schema.isGreaterThan(0));\nconst AppSpecificPasswordNoteSchema = Schema.Trim.check(\n Schema.isMinLength(1),\n Schema.isMaxLength(255),\n);\nconst MaskedIpv4AddressPattern = /^(?:(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\\.){3}XXX$/;\nconst Ipv6HextetPattern = /^[\\dA-Fa-f]{1,4}$/;\n\nconst isMaskedIpv6Address = (value: string): boolean => {\n const compressedParts = value.split(\"::\");\n\n if (compressedParts.length > 2) {\n return false;\n }\n\n const hextets = compressedParts.flatMap((part) => (part === \"\" ? [] : part.split(\":\")));\n\n if (\n hextets.at(-1) !== \"X\" ||\n !hextets.slice(0, -1).every((part) => Ipv6HextetPattern.test(part))\n ) {\n return false;\n }\n\n return compressedParts.length === 2 ? hextets.length < 8 : hextets.length === 8;\n};\n\nconst MaskedIpAddressSchema = Schema.String.check(\n Schema.makeFilter((value) =>\n MaskedIpv4AddressPattern.test(value) || isMaskedIpv6Address(value)\n ? undefined\n : \"Expected a masked IP address\",\n ),\n);\n\nexport const AppSpecificPasswordSchema = Schema.Struct({\n created_at: Schema.String,\n id: AppSpecificPasswordIdSchema,\n ip_address: Schema.NullOr(MaskedIpAddressSchema),\n last_used_at: Schema.NullOr(Schema.String),\n note: Schema.String,\n});\n\nexport const CreateAppSpecificPasswordInputSchema = Schema.Struct({\n note: AppSpecificPasswordNoteSchema,\n});\n\nconst CreateAppSpecificPasswordEnvelopeSchema = AppSpecificPasswordSchema.pipe(\n Schema.fieldsAssign({\n password: Schema.String,\n status: Schema.Literal(\"OK\"),\n }),\n);\n\nconst ListAppSpecificPasswordsEnvelopeSchema = Schema.Struct({\n passwords: Schema.Array(AppSpecificPasswordSchema),\n status: Schema.Literal(\"OK\"),\n});\n\nexport type AppSpecificPassword = Schema.Schema.Type<typeof AppSpecificPasswordSchema>;\nexport type CreateAppSpecificPasswordInput = Schema.Schema.Type<\n typeof CreateAppSpecificPasswordInputSchema\n>;\nexport type CreateAppSpecificPasswordResult = AppSpecificPassword & {\n readonly password: string;\n};\n\nconst RestrictedAppSpecificPasswordError: {\n readonly errorType: \"invalid_scope\";\n readonly statusCode: 401;\n} = {\n errorType: \"invalid_scope\",\n statusCode: 401,\n};\n\nconst TooManyAppSpecificPasswordsErrorBodySchema = PutioErrorEnvelopeSchema.pipe(\n Schema.fieldsAssign({\n extra: Schema.Struct({\n limit: Schema.Int,\n }),\n }),\n);\n\nexport const CreateAppSpecificPasswordErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"appSpecificPasswords.create\",\n knownErrors: [\n { errorType: \"NOTE_REQUIRED\", statusCode: 400 as const },\n { errorType: \"NOTE_TOO_LONG\", statusCode: 400 as const },\n {\n bodySchema: TooManyAppSpecificPasswordsErrorBodySchema,\n errorType: \"TOO_MANY_APP_SPECIFIC_PASSWORDS\",\n statusCode: 403 as const,\n },\n RestrictedAppSpecificPasswordError,\n ],\n});\n\nexport const ListAppSpecificPasswordsErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"appSpecificPasswords.list\",\n knownErrors: [RestrictedAppSpecificPasswordError],\n});\n\nexport const DeleteAppSpecificPasswordErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"appSpecificPasswords.delete\",\n knownErrors: [RestrictedAppSpecificPasswordError],\n});\n\nexport const DeleteAllAppSpecificPasswordsErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"appSpecificPasswords.deleteAll\",\n knownErrors: [RestrictedAppSpecificPasswordError],\n});\n\nexport type CreateAppSpecificPasswordError = PutioOperationFailure<\n typeof CreateAppSpecificPasswordErrorSpec\n>;\nexport type ListAppSpecificPasswordsError = PutioOperationFailure<\n typeof ListAppSpecificPasswordsErrorSpec\n>;\nexport type DeleteAppSpecificPasswordError = PutioOperationFailure<\n typeof DeleteAppSpecificPasswordErrorSpec\n>;\nexport type DeleteAllAppSpecificPasswordsError = PutioOperationFailure<\n typeof DeleteAllAppSpecificPasswordsErrorSpec\n>;\n\nexport const createAppSpecificPassword = (\n input: CreateAppSpecificPasswordInput,\n): Effect.Effect<\n CreateAppSpecificPasswordResult,\n CreateAppSpecificPasswordError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(CreateAppSpecificPasswordInputSchema, {\n onExcessProperty: \"error\",\n })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(CreateAppSpecificPasswordEnvelopeSchema, {\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/app_specific_password/create\",\n }),\n ),\n selectJsonFields(\"created_at\", \"id\", \"ip_address\", \"last_used_at\", \"note\", \"password\"),\n withOperationErrors(CreateAppSpecificPasswordErrorSpec),\n );\n\nexport const listAppSpecificPasswords = (): Effect.Effect<\n ReadonlyArray<AppSpecificPassword>,\n ListAppSpecificPasswordsError,\n PutioSdkContext\n> =>\n requestJson(ListAppSpecificPasswordsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/app_specific_password/list\",\n }).pipe(selectJsonField(\"passwords\"), withOperationErrors(ListAppSpecificPasswordsErrorSpec));\n\nexport const deleteAppSpecificPassword = (\n id: number,\n): Effect.Effect<void, DeleteAppSpecificPasswordError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(AppSpecificPasswordIdSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/app_specific_password/${encodePathSegment(decodedId)}/delete`,\n }),\n ),\n Effect.asVoid,\n withOperationErrors(DeleteAppSpecificPasswordErrorSpec),\n );\n\nexport const deleteAllAppSpecificPasswords = (): Effect.Effect<\n void,\n DeleteAllAppSpecificPasswordsError,\n PutioSdkContext\n> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/app_specific_password/delete_all\",\n }).pipe(Effect.asVoid, withOperationErrors(DeleteAllAppSpecificPasswordsErrorSpec));\n","import { Effect, Schema } from \"effect\";\n\nimport { mapDecodeErrorToValidationError } from \"./errors.js\";\n\nexport const PositiveIntegerSchema = Schema.Int.check(Schema.isGreaterThan(0));\nexport const NonEmptyStringSchema = Schema.String.check(Schema.isMinLength(1));\n\nexport const decodeAndRun = <S extends Schema.Top, A, E, R>(\n schema: S,\n input: unknown,\n run: (decoded: S[\"Type\"]) => Effect.Effect<A, E, R>,\n) =>\n Schema.decodeUnknownEffect(schema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap(run),\n );\n\nexport const makeCursorSelectionSchema = <\n const TIdsField extends string,\n const TExcludeIdsField extends string,\n const TFields extends Schema.Struct.Fields,\n>(\n idsField: TIdsField,\n excludeIdsField: TExcludeIdsField,\n fields: TFields,\n) =>\n Schema.Struct({\n cursor: Schema.optional(NonEmptyStringSchema),\n [excludeIdsField]: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n [idsField]: Schema.optional(Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1))),\n ...fields,\n }).check(\n Schema.makeFilter((input) => input.cursor !== undefined || input[idsField] !== undefined, {\n expected: \"a non-empty cursor or file ID selection\",\n }),\n );\n","import { Effect, Schema } from \"effect\";\nimport {\n OkResponseSchema,\n buildPutioUrl,\n encodePathSegment,\n requestJson,\n selectJsonField,\n type PutioSdkContext,\n type PutioQueryValue,\n} from \"../core/http.js\";\nimport {\n mapDecodeErrorToValidationError,\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n type PutioSdkError,\n} from \"../core/errors.js\";\nconst OAuthAppBaseSchema = Schema.Struct({\n description: Schema.String,\n has_icon: Schema.NullOr(Schema.Boolean),\n id: Schema.Int,\n name: Schema.String,\n website: Schema.String,\n});\nexport const OAuthAppSchema = OAuthAppBaseSchema;\nexport const OwnedOAuthAppSchema = OAuthAppBaseSchema.pipe(\n Schema.fieldsAssign({\n callback: Schema.String,\n hidden: Schema.Boolean,\n secret: Schema.String,\n }),\n);\nexport const MyOAuthAppSchema = OwnedOAuthAppSchema.pipe(\n Schema.fieldsAssign({\n users: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n }),\n);\nexport const PopularOAuthAppSchema = OAuthAppBaseSchema.pipe(\n Schema.fieldsAssign({\n hidden: Schema.optional(Schema.Boolean),\n maker: Schema.String,\n users: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n }),\n);\nexport const OAuthAppSessionSchema = Schema.Struct({\n active: Schema.Boolean,\n app_id: Schema.Int,\n app_name: Schema.optional(Schema.String),\n client_name: Schema.String,\n created_at: Schema.String,\n id: Schema.Int,\n ip_address: Schema.String,\n last_used_at: Schema.NullOr(Schema.String),\n note: Schema.NullOr(Schema.String),\n user_agent: Schema.String,\n});\nexport const OAuthAppWithTokenSchema = Schema.Struct({\n app: Schema.Union([OwnedOAuthAppSchema, OAuthAppSchema]),\n status: Schema.Literal(\"OK\"),\n token: Schema.NullOr(Schema.String),\n});\nconst OAuthAppsEnvelopeSchema = Schema.Struct({\n apps: Schema.Array(MyOAuthAppSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst PopularOAuthAppsEnvelopeSchema = Schema.Struct({\n apps: Schema.Array(PopularOAuthAppSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst OAuthAppEnvelopeSchema = Schema.Struct({\n app: Schema.Union([OwnedOAuthAppSchema, OAuthAppSchema]),\n status: Schema.Literal(\"OK\"),\n});\nconst OAuthRegeneratedTokenEnvelopeSchema = Schema.Struct({\n access_token: Schema.String,\n status: Schema.Literal(\"OK\"),\n});\nconst OAuthAppIdSchema = Schema.Int.check(Schema.isGreaterThan(0));\nconst OAuthAppDescriptionSchema = Schema.String.check(Schema.isMinLength(10));\nconst OAuthAppUrlSchema = Schema.String.check(Schema.isMaxLength(255));\nexport const OAuthAppCreateInputSchema = Schema.Struct({\n callback: OAuthAppUrlSchema,\n description: OAuthAppDescriptionSchema,\n hidden: Schema.optional(Schema.Boolean),\n icon: Schema.optional(Schema.instanceOf(Blob)),\n name: Schema.String.check(Schema.isMinLength(5)),\n website: OAuthAppUrlSchema,\n});\nexport const OAuthAppUpdateInputSchema = Schema.Struct({\n callback: OAuthAppUrlSchema,\n description: OAuthAppDescriptionSchema,\n hidden: Schema.optional(Schema.Boolean),\n icon: Schema.optional(Schema.instanceOf(Blob)),\n id: OAuthAppIdSchema,\n website: OAuthAppUrlSchema,\n});\nexport const OAuthSetIconInputSchema = Schema.Struct({\n icon: Schema.instanceOf(Blob),\n});\nexport type OAuthApp = Schema.Schema.Type<typeof OAuthAppSchema>;\nexport type OwnedOAuthApp = Schema.Schema.Type<typeof OwnedOAuthAppSchema>;\nexport type MyOAuthApp = Schema.Schema.Type<typeof MyOAuthAppSchema>;\nexport type PopularOAuthApp = Schema.Schema.Type<typeof PopularOAuthAppSchema>;\nexport type OAuthAppSession = Schema.Schema.Type<typeof OAuthAppSessionSchema>;\nexport type OAuthAppCreateInput = Schema.Schema.Type<typeof OAuthAppCreateInputSchema>;\nexport type OAuthAppUpdateInput = Schema.Schema.Type<typeof OAuthAppUpdateInputSchema>;\nexport type OAuthSetIconInput = Schema.Schema.Type<typeof OAuthSetIconInputSchema>;\nexport const QueryOAuthAppsErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"query\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const GetOAuthAppErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"get\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const CreateOAuthAppErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"create\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const UpdateOAuthAppErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"update\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const DeleteOAuthAppErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"delete\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const RegenerateOAuthAppTokenErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"regenerateToken\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport type QueryOAuthAppsError = PutioOperationFailure<typeof QueryOAuthAppsErrorSpec>;\nexport type GetOAuthAppError = PutioOperationFailure<typeof GetOAuthAppErrorSpec>;\nexport type CreateOAuthAppError = PutioOperationFailure<typeof CreateOAuthAppErrorSpec>;\nexport type UpdateOAuthAppError = PutioOperationFailure<typeof UpdateOAuthAppErrorSpec>;\nexport type DeleteOAuthAppError = PutioOperationFailure<typeof DeleteOAuthAppErrorSpec>;\nexport type RegenerateOAuthAppTokenError = PutioOperationFailure<\n typeof RegenerateOAuthAppTokenErrorSpec\n>;\nconst appendOptionalBoolean = (formData: FormData, key: string, value?: boolean) => {\n if (value !== undefined) {\n formData.append(key, String(value));\n }\n};\nconst appendOptionalBlob = (formData: FormData, key: string, value?: Blob) => {\n if (value) {\n formData.append(key, value);\n }\n};\nconst makeCreateOAuthAppFormData = (input: OAuthAppCreateInput) => {\n const formData = new FormData();\n formData.append(\"name\", input.name);\n formData.append(\"description\", input.description);\n formData.append(\"website\", input.website);\n formData.append(\"callback\", input.callback);\n appendOptionalBoolean(formData, \"hidden\", input.hidden);\n appendOptionalBlob(formData, \"icon\", input.icon);\n return formData;\n};\nconst makeUpdateOAuthAppFormData = (input: OAuthAppUpdateInput) => {\n const formData = new FormData();\n formData.append(\"description\", input.description);\n formData.append(\"website\", input.website);\n formData.append(\"callback\", input.callback);\n appendOptionalBoolean(formData, \"hidden\", input.hidden);\n appendOptionalBlob(formData, \"icon\", input.icon);\n return formData;\n};\nexport const buildOAuthAuthorizeUrl = (options: {\n readonly baseUrl?: string | URL;\n readonly oauthToken: string;\n readonly query?: Readonly<Record<string, PutioQueryValue>>;\n}) =>\n buildPutioUrl(options.baseUrl ?? \"https://api.put.io\", \"/v2/oauth2/authorize\", {\n ...options.query,\n oauth_token: options.oauthToken,\n });\nexport const buildOAuthAppIconUrl = (options: {\n readonly baseUrl?: string | URL;\n readonly id: number;\n readonly oauthToken: string;\n}) =>\n buildPutioUrl(\n options.baseUrl ?? \"https://api.put.io\",\n `/v2/oauth/apps/${encodePathSegment(options.id)}/icon`,\n {\n oauth_token: options.oauthToken,\n },\n );\nexport const queryOAuthApps = (): Effect.Effect<\n ReadonlyArray<MyOAuthApp>,\n QueryOAuthAppsError,\n PutioSdkContext\n> =>\n requestJson(OAuthAppsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/oauth/apps\",\n }).pipe(selectJsonField(\"apps\"), withOperationErrors(QueryOAuthAppsErrorSpec));\nexport const getOAuthApp = (\n id: number,\n options?: {\n readonly edit?: boolean;\n },\n): Effect.Effect<\n Schema.Schema.Type<typeof OAuthAppWithTokenSchema>,\n GetOAuthAppError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(\n Schema.Struct({\n id: OAuthAppIdSchema,\n options: Schema.optional(\n Schema.Struct({\n edit: Schema.optional(Schema.Boolean),\n }),\n ),\n }),\n { onExcessProperty: \"error\" },\n )({ id, options }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OAuthAppWithTokenSchema, {\n method: \"GET\",\n path: decodedInput.options?.edit\n ? `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/edit`\n : `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`,\n }),\n ),\n withOperationErrors(GetOAuthAppErrorSpec),\n );\nexport const setOAuthAppIcon = (\n id: number,\n input: OAuthSetIconInput,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> => {\n return Schema.decodeUnknownEffect(\n Schema.Struct({\n id: OAuthAppIdSchema,\n input: OAuthSetIconInputSchema,\n }),\n { onExcessProperty: \"error\" },\n )({ id, input }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) => {\n const formData = new FormData();\n formData.append(\"icon\", decodedInput.input.icon);\n return requestJson(OkResponseSchema, {\n body: {\n type: \"form-data\",\n value: formData,\n },\n method: \"POST\",\n path: `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/icon`,\n });\n }),\n );\n};\nexport const createOAuthApp = (\n input: OAuthAppCreateInput,\n): Effect.Effect<\n Schema.Schema.Type<typeof OAuthAppEnvelopeSchema>,\n CreateOAuthAppError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(OAuthAppCreateInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OAuthAppEnvelopeSchema, {\n body: {\n type: \"form-data\",\n value: makeCreateOAuthAppFormData(decodedInput),\n },\n method: \"POST\",\n path: \"/v2/oauth/apps/register\",\n }),\n ),\n withOperationErrors(CreateOAuthAppErrorSpec),\n );\nexport const updateOAuthApp = (\n input: OAuthAppUpdateInput,\n): Effect.Effect<\n Schema.Schema.Type<typeof OAuthAppWithTokenSchema>,\n UpdateOAuthAppError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(OAuthAppUpdateInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OAuthAppWithTokenSchema, {\n body: {\n type: \"form-data\",\n value: makeUpdateOAuthAppFormData(decodedInput),\n },\n method: \"POST\",\n path: `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`,\n }),\n ),\n withOperationErrors(UpdateOAuthAppErrorSpec),\n );\nexport const deleteOAuthApp = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n DeleteOAuthAppError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(OAuthAppIdSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/oauth/apps/${encodePathSegment(decodedId)}/delete`,\n }),\n ),\n withOperationErrors(DeleteOAuthAppErrorSpec),\n );\nexport const regenerateOAuthAppToken = (\n id: number,\n): Effect.Effect<string, RegenerateOAuthAppTokenError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(OAuthAppIdSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OAuthRegeneratedTokenEnvelopeSchema, {\n method: \"POST\",\n path: `/v2/oauth/apps/${encodePathSegment(decodedId)}/regenerate_token`,\n }),\n ),\n selectJsonField(\"access_token\"),\n withOperationErrors(RegenerateOAuthAppTokenErrorSpec),\n );\nexport const getPopularOAuthApps = (): Effect.Effect<\n ReadonlyArray<PopularOAuthApp>,\n PutioSdkError,\n PutioSdkContext\n> =>\n requestJson(PopularOAuthAppsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/oauth/apps/popular\",\n }).pipe(selectJsonField(\"apps\"));\n","import { Effect, Schema } from \"effect\";\nimport {\n PutioApiError,\n PutioValidationError,\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n type PutioSdkError,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n buildPutioUrl,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema } from \"../core/validation.js\";\nimport { OAuthAppSchema, OAuthAppSessionSchema } from \"./oauth.js\";\nexport const LoginResponseSchema = Schema.Struct({\n access_token: Schema.String,\n user_id: Schema.Int,\n});\nconst OAuthAuthorizationCodeResponseSchema = Schema.Struct({\n access_token: Schema.String,\n});\nexport const OAuthAuthorizationCodeExchangeErrorCodeSchema = Schema.Literals([\n \"access_denied\",\n \"invalid_request\",\n \"unauthorized_client\",\n]);\nexport class OAuthAuthorizationCodeExchangeError extends Schema.TaggedError<OAuthAuthorizationCodeExchangeError>()(\n \"OAuthAuthorizationCodeExchangeError\",\n {\n code: OAuthAuthorizationCodeExchangeErrorCodeSchema,\n status: Schema.Literal(400),\n },\n) {}\nconst TokenScopeSchema = Schema.NullOr(\n Schema.Literals([\n \"default\",\n \"two_factor\",\n \"files_public_access\",\n \"files_download\",\n \"token_validate\",\n ]),\n);\nexport const ValidateTokenResponseSchema = Schema.Struct({\n result: Schema.Boolean,\n token_id: Schema.NullOr(Schema.Int),\n token_scope: TokenScopeSchema,\n user_id: Schema.NullOr(Schema.Int),\n});\nconst RecoveryCodeEntrySchema = Schema.Struct({\n code: Schema.String,\n used_at: Schema.NullOr(Schema.String),\n});\nexport const TwoFactorRecoveryCodesSchema = Schema.Struct({\n codes: Schema.Array(RecoveryCodeEntrySchema),\n created_at: Schema.String,\n});\nexport const GenerateTOTPResponseSchema = Schema.Struct({\n recovery_codes: TwoFactorRecoveryCodesSchema,\n secret: Schema.String,\n uri: Schema.String,\n});\nexport const VerifyTOTPResponseSchema = Schema.Struct({\n token: Schema.String,\n user_id: Schema.Int,\n});\nexport const AuthorizationCodeSchema = Schema.Struct({\n code: Schema.String,\n qr_code_url: Schema.String,\n});\nconst AuthorizationCodeEnvelopeSchema = Schema.Struct({\n code: Schema.String,\n qr_code_url: Schema.String,\n status: Schema.Literal(\"OK\"),\n});\nconst CodeMatchEnvelopeSchema = Schema.Struct({\n oauth_token: Schema.NullOr(Schema.String),\n status: Schema.Literal(\"OK\"),\n});\nconst LinkDeviceEnvelopeSchema = Schema.Struct({\n app: OAuthAppSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst GrantsEnvelopeSchema = Schema.Struct({\n apps: Schema.Array(OAuthAppSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst ClientsEnvelopeSchema = Schema.Struct({\n clients: Schema.Array(OAuthAppSessionSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst VoucherEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n voucher: Schema.Struct({\n days: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n owner: Schema.NullOr(Schema.String),\n }),\n});\nconst GiftCardEnvelopeSchema = Schema.Struct({\n gift_card: Schema.Struct({\n days: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n plan: Schema.Boolean,\n }),\n status: Schema.Literal(\"OK\"),\n});\nconst FamilyInviteEnvelopeSchema = Schema.Struct({\n invite: Schema.Struct({\n owner: Schema.String,\n plan: Schema.String,\n }),\n status: Schema.Literal(\"OK\"),\n});\nconst FriendInviteEnvelopeSchema = Schema.Struct({\n invite: Schema.Struct({\n inviter: Schema.String,\n plan: Schema.Struct({\n code: Schema.String,\n name: Schema.String,\n period: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n }),\n }),\n status: Schema.Literal(\"OK\"),\n});\nconst ExistsEnvelopeSchema = Schema.Struct({\n exists: Schema.Boolean,\n status: Schema.Literal(\"OK\"),\n});\nconst ResetPasswordEnvelopeSchema = Schema.Struct({\n access_token: Schema.String,\n status: Schema.Literal(\"OK\"),\n});\nconst GenerateTOTPEnvelopeSchema = Schema.Struct({\n recovery_codes: TwoFactorRecoveryCodesSchema,\n secret: Schema.String,\n status: Schema.Literal(\"OK\"),\n uri: Schema.String,\n});\nconst VerifyTOTPEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n token: Schema.String,\n user_id: Schema.Int,\n});\nconst RecoveryCodesEnvelopeSchema = Schema.Struct({\n recovery_codes: TwoFactorRecoveryCodesSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst AuthClientIdSchema = Schema.Union([NonEmptyStringSchema, PositiveIntegerSchema]);\nconst LoginInputSchema = Schema.Struct({\n callbackUrl: Schema.optional(NonEmptyStringSchema),\n clientId: AuthClientIdSchema,\n clientName: Schema.optional(NonEmptyStringSchema),\n clientSecret: NonEmptyStringSchema,\n fingerprint: Schema.optional(NonEmptyStringSchema),\n password: NonEmptyStringSchema,\n username: NonEmptyStringSchema,\n});\nexport const RegisterInputSchema = Schema.Struct({\n client_id: AuthClientIdSchema,\n family_invite_code: Schema.optional(NonEmptyStringSchema),\n friend_invite_code: Schema.optional(NonEmptyStringSchema),\n gift_card_confirmation_code: Schema.optional(NonEmptyStringSchema),\n mail: NonEmptyStringSchema,\n password: NonEmptyStringSchema,\n plan_name: Schema.optional(NonEmptyStringSchema),\n username: NonEmptyStringSchema,\n voucher_code: Schema.optional(NonEmptyStringSchema),\n});\nexport const OAuthAuthorizationCodeExchangeInputSchema = Schema.Struct({\n clientId: AuthClientIdSchema,\n clientSecret: NonEmptyStringSchema,\n code: NonEmptyStringSchema,\n redirectUri: Schema.optional(NonEmptyStringSchema),\n});\nconst AuthExistsInputSchema = Schema.Struct({\n key: Schema.Literals([\"mail\", \"username\"]),\n value: NonEmptyStringSchema,\n});\nconst AuthResetPasswordInputSchema = Schema.Struct({\n key: NonEmptyStringSchema,\n password: NonEmptyStringSchema,\n});\nconst AuthGetCodeInputSchema = Schema.Struct({\n appId: AuthClientIdSchema,\n clientName: Schema.optional(NonEmptyStringSchema),\n});\nconst AuthVerifyTotpInputSchema = Schema.Struct({\n code: NonEmptyStringSchema,\n twoFactorScopedToken: NonEmptyStringSchema,\n});\nexport type LoginResponse = Schema.Schema.Type<typeof LoginResponseSchema>;\nexport type ValidateTokenResponse = Schema.Schema.Type<typeof ValidateTokenResponseSchema>;\nexport type TwoFactorRecoveryCodes = Schema.Schema.Type<typeof TwoFactorRecoveryCodesSchema>;\nexport type GenerateTOTPResponse = Schema.Schema.Type<typeof GenerateTOTPResponseSchema>;\nexport type VerifyTOTPResponse = Schema.Schema.Type<typeof VerifyTOTPResponseSchema>;\nexport type RegisterInput = Schema.Schema.Type<typeof RegisterInputSchema>;\nexport type LoginInput = Schema.Schema.Type<typeof LoginInputSchema>;\nexport type AuthGetCodeInput = Schema.Schema.Type<typeof AuthGetCodeInputSchema>;\nexport type OAuthAuthorizationCodeExchangeInput = Schema.Schema.Type<\n typeof OAuthAuthorizationCodeExchangeInputSchema\n>;\nexport const LoginErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"login\",\n knownErrors: [\n { statusCode: 401 as const },\n { errorType: \"invalid_app_credentials\", statusCode: 403 as const },\n { errorType: \"password_reset_required\", statusCode: 403 as const },\n ],\n});\nexport const RegisterErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"register\",\n knownErrors: [\n { errorType: \"INVALID_USERNAME\", statusCode: 400 as const },\n { errorType: \"INVALID_MAIL\", statusCode: 400 as const },\n { errorType: \"REDEEMED_VOUCHER_CODE\", statusCode: 400 as const },\n { errorType: \"USERNAME_EXISTS\", statusCode: 400 as const },\n { errorType: \"MAIL_EXISTS\", statusCode: 400 as const },\n { errorType: \"PWNED_NEW_PASSWORD\", statusCode: 400 as const },\n { errorType: \"DISPOSABLE_MAIL_NOT_ALLOWED\", statusCode: 400 as const },\n { statusCode: 403 as const },\n { errorType: \"CLIENT_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"INVALID_VOUCHER_CODE\", statusCode: 404 as const },\n { errorType: \"INVALID_GIFT_CARD_CONFIRMATION_CODE\", statusCode: 404 as const },\n { errorType: \"FAMILY_INVITE_INVALID_CODE\", statusCode: 404 as const },\n { errorType: \"FAMILY_INVITE_OWNER_NOT_ACTIVE\", statusCode: 404 as const },\n { errorType: \"FRIEND_INVITE_INVALID_CODE\", statusCode: 404 as const },\n { errorType: \"FRIEND_INVITE_OWNER_NOT_ACTIVE\", statusCode: 404 as const },\n { errorType: \"PLAN_NOT_FOUND\", statusCode: 404 as const },\n ],\n});\nexport const VoucherLookupErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"getVoucher\",\n knownErrors: [{ errorType: \"INVALID_VOUCHER_CODE\", statusCode: 404 as const }],\n});\nexport const GiftCardLookupErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"getGiftCard\",\n knownErrors: [{ errorType: \"INVALID_CONFIRMATION_CODE\", statusCode: 404 as const }],\n});\nexport const FamilyInviteLookupErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"getFamilyInvite\",\n knownErrors: [{ errorType: \"INVALID_FAMILY_INVITE_CODE\", statusCode: 404 as const }],\n});\nexport const FriendInviteLookupErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"getFriendInvite\",\n knownErrors: [\n { errorType: \"INVALID_FRIEND_INVITE_CODE\", statusCode: 404 as const },\n { errorType: \"FRIEND_INVITE_INVALID_CODE\", statusCode: 404 as const },\n ],\n});\nexport const ForgotPasswordErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"forgotPassword\",\n knownErrors: [{ statusCode: 404 as const }],\n});\nexport const ResetPasswordErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"resetPassword\",\n knownErrors: [\n { errorType: \"INVALID_PASSWORD_RESET_KEY\", statusCode: 400 as const },\n { errorType: \"PWNED_NEW_PASSWORD\", statusCode: 400 as const },\n ],\n});\nexport const LinkDeviceErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"linkDevice\",\n knownErrors: [{ statusCode: 404 as const }],\n});\nexport const GrantsErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"grants\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const ClientsErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"clients\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const RevokeOAuthGrantErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"revokeApp\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const RevokeOAuthClientErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"revokeClient\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const RevokeAllOAuthClientsErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"revokeAllClients\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const GenerateTOTPErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"generateTOTP\",\n knownErrors: [\n { errorType: \"already_exists\", statusCode: 403 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const VerifyTOTPErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"verifyTOTP\",\n knownErrors: [\n { errorType: \"invalid_setup\", statusCode: 400 as const },\n { errorType: \"invalid_code\", statusCode: 400 as const },\n { errorType: \"code_not_found\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const RecoveryCodesErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"getRecoveryCodes\",\n knownErrors: [\n { errorType: \"invalid_setup\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const RegenerateRecoveryCodesErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"regenerateRecoveryCodes\",\n knownErrors: [\n { errorType: \"invalid_setup\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport type LoginError = PutioOperationFailure<typeof LoginErrorSpec>;\nexport type RegisterError = PutioOperationFailure<typeof RegisterErrorSpec>;\nexport type VoucherLookupError = PutioOperationFailure<typeof VoucherLookupErrorSpec>;\nexport type GiftCardLookupError = PutioOperationFailure<typeof GiftCardLookupErrorSpec>;\nexport type FamilyInviteLookupError = PutioOperationFailure<typeof FamilyInviteLookupErrorSpec>;\nexport type FriendInviteLookupError = PutioOperationFailure<typeof FriendInviteLookupErrorSpec>;\nexport type ForgotPasswordError = PutioOperationFailure<typeof ForgotPasswordErrorSpec>;\nexport type ResetPasswordError = PutioOperationFailure<typeof ResetPasswordErrorSpec>;\nexport type LinkDeviceError = PutioOperationFailure<typeof LinkDeviceErrorSpec>;\nexport type GrantsError = PutioOperationFailure<typeof GrantsErrorSpec>;\nexport type ClientsError = PutioOperationFailure<typeof ClientsErrorSpec>;\nexport type RevokeOAuthGrantError = PutioOperationFailure<typeof RevokeOAuthGrantErrorSpec>;\nexport type RevokeOAuthClientError = PutioOperationFailure<typeof RevokeOAuthClientErrorSpec>;\nexport type RevokeAllOAuthClientsError = PutioOperationFailure<\n typeof RevokeAllOAuthClientsErrorSpec\n>;\nexport type GenerateTOTPError = PutioOperationFailure<typeof GenerateTOTPErrorSpec>;\nexport type VerifyTOTPError = PutioOperationFailure<typeof VerifyTOTPErrorSpec>;\nexport type RecoveryCodesError = PutioOperationFailure<typeof RecoveryCodesErrorSpec>;\nexport type RegenerateRecoveryCodesError = PutioOperationFailure<\n typeof RegenerateRecoveryCodesErrorSpec\n>;\nconst decodeAuthInput = <S extends Schema.Top, A, E, R>(\n operation: string,\n schema: S,\n input: unknown,\n run: (decoded: S[\"Type\"]) => Effect.Effect<A, E, R>,\n) =>\n Schema.decodeUnknownEffect(schema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(\n () =>\n new PutioValidationError({\n cause: {\n domain: \"auth\",\n operation,\n reason: \"Invalid request input\",\n },\n }),\n ),\n Effect.flatMap(run),\n );\nexport const buildAuthLoginUrl = (options: {\n readonly clientId: string | number;\n readonly redirectUri: string;\n readonly responseType?: string;\n readonly state: string;\n readonly clientName?: string;\n readonly webAppUrl?: string | URL;\n}) =>\n buildPutioUrl(options.webAppUrl ?? \"https://app.put.io\", \"/authenticate\", {\n client_id: options.clientId,\n client_name: options.clientName,\n isolated: 1,\n redirect_uri: options.redirectUri,\n response_type: options.responseType ?? \"token\",\n state: options.state,\n });\nconst isOAuthAuthorizationCodeExchangeErrorCode = Schema.is(\n OAuthAuthorizationCodeExchangeErrorCodeSchema,\n);\nconst mapOAuthAuthorizationCodeExchangeError = (\n error: PutioSdkError,\n): PutioSdkError | OAuthAuthorizationCodeExchangeError =>\n error instanceof PutioApiError &&\n error.status === 400 &&\n isOAuthAuthorizationCodeExchangeErrorCode(error.body.error)\n ? new OAuthAuthorizationCodeExchangeError({\n code: error.body.error,\n status: 400,\n })\n : error;\nexport const exchangeOAuthAuthorizationCode = (\n input: OAuthAuthorizationCodeExchangeInput,\n): Effect.Effect<string, PutioSdkError | OAuthAuthorizationCodeExchangeError, PutioSdkContext> =>\n decodeAuthInput(\n \"exchangeAuthorizationCode\",\n OAuthAuthorizationCodeExchangeInputSchema,\n input,\n (decodedInput) =>\n requestJson(OAuthAuthorizationCodeResponseSchema, {\n auth: { type: \"none\" },\n body: {\n type: \"form\",\n value: {\n client_id: decodedInput.clientId,\n client_secret: decodedInput.clientSecret,\n code: decodedInput.code,\n grant_type: \"authorization_code\",\n redirect_uri: decodedInput.redirectUri,\n },\n },\n method: \"POST\",\n path: \"/v2/oauth2/access_token\",\n }).pipe(\n selectJsonField(\"access_token\"),\n Effect.mapError(mapOAuthAuthorizationCodeExchangeError),\n ),\n );\nexport const login = (\n input: LoginInput,\n): Effect.Effect<LoginResponse, LoginError, PutioSdkContext> =>\n decodeAuthInput(\"login\", LoginInputSchema, input, (decodedInput) =>\n requestJson(LoginResponseSchema, {\n auth: {\n type: \"basic\",\n password: decodedInput.password,\n username: decodedInput.username,\n },\n method: \"PUT\",\n path: decodedInput.fingerprint\n ? `/v2/oauth2/authorizations/clients/${encodePathSegment(decodedInput.clientId)}/${encodePathSegment(decodedInput.fingerprint)}`\n : `/v2/oauth2/authorizations/clients/${encodePathSegment(decodedInput.clientId)}`,\n query: {\n callback_url: decodedInput.callbackUrl,\n client_name: decodedInput.clientName,\n client_secret: decodedInput.clientSecret,\n },\n }).pipe(selectJsonFields(\"access_token\", \"user_id\")),\n ).pipe(withOperationErrors(LoginErrorSpec));\nexport const logout = (): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n PutioSdkError,\n PutioSdkContext\n> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/oauth/grants/logout\",\n });\nexport const register = (\n input: RegisterInput,\n): Effect.Effect<\n {\n readonly access_token: string;\n },\n RegisterError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"register\", RegisterInputSchema, input, (decodedInput) =>\n requestJson(ResetPasswordEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/registration/register\",\n }).pipe(selectJsonFields(\"access_token\")),\n ).pipe(withOperationErrors(RegisterErrorSpec));\nexport const exists = (\n key: \"mail\" | \"username\",\n value: string,\n): Effect.Effect<boolean, PutioSdkError, PutioSdkContext> =>\n decodeAuthInput(\"exists\", AuthExistsInputSchema, { key, value }, (decodedInput) =>\n requestJson(ExistsEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/registration/exists/${encodePathSegment(decodedInput.key)}`,\n query: {\n value: decodedInput.value,\n },\n }).pipe(selectJsonField(\"exists\")),\n );\nexport const getVoucher = (\n code: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof VoucherEnvelopeSchema>[\"voucher\"],\n VoucherLookupError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"getVoucher\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(VoucherEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/registration/voucher/${encodePathSegment(decodedCode)}`,\n }).pipe(selectJsonField(\"voucher\")),\n ).pipe(withOperationErrors(VoucherLookupErrorSpec));\nexport const getGiftCard = (\n code: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof GiftCardEnvelopeSchema>[\"gift_card\"],\n GiftCardLookupError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"getGiftCard\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(GiftCardEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/registration/gift_card/${encodePathSegment(decodedCode)}`,\n }).pipe(selectJsonField(\"gift_card\")),\n ).pipe(withOperationErrors(GiftCardLookupErrorSpec));\nexport const getFamilyInvite = (\n code: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof FamilyInviteEnvelopeSchema>[\"invite\"],\n FamilyInviteLookupError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"getFamilyInvite\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(FamilyInviteEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/registration/family/${encodePathSegment(decodedCode)}`,\n }).pipe(selectJsonField(\"invite\")),\n ).pipe(withOperationErrors(FamilyInviteLookupErrorSpec));\nexport const getFriendInvite = (\n code: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof FriendInviteEnvelopeSchema>[\"invite\"],\n FriendInviteLookupError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"getFriendInvite\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(FriendInviteEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/registration/friend/${encodePathSegment(decodedCode)}`,\n }).pipe(selectJsonField(\"invite\")),\n ).pipe(withOperationErrors(FriendInviteLookupErrorSpec));\nexport const forgotPassword = (\n mail: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ForgotPasswordError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"forgotPassword\", NonEmptyStringSchema, mail, (decodedMail) =>\n requestJson(OkResponseSchema, {\n auth: {\n type: \"none\",\n },\n body: {\n type: \"form\",\n value: {\n mail: decodedMail,\n },\n },\n method: \"POST\",\n path: \"/v2/registration/password/forgot\",\n }),\n ).pipe(withOperationErrors(ForgotPasswordErrorSpec));\nexport const resetPassword = (\n key: string,\n password: string,\n): Effect.Effect<\n {\n readonly access_token: string;\n },\n ResetPasswordError,\n PutioSdkContext\n> =>\n decodeAuthInput(\n \"resetPassword\",\n AuthResetPasswordInputSchema,\n { key, password },\n (decodedInput) =>\n requestJson(ResetPasswordEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/registration/password/reset\",\n }).pipe(selectJsonFields(\"access_token\")),\n ).pipe(withOperationErrors(ResetPasswordErrorSpec));\nexport const getCode = (\n input: AuthGetCodeInput,\n): Effect.Effect<\n Schema.Schema.Type<typeof AuthorizationCodeSchema>,\n PutioSdkError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"getCode\", AuthGetCodeInputSchema, input, (decodedInput) =>\n requestJson(AuthorizationCodeEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: \"/v2/oauth2/oob/code\",\n query: {\n app_id: decodedInput.appId,\n client_name: decodedInput.clientName,\n },\n }).pipe(selectJsonFields(\"code\", \"qr_code_url\")),\n );\nexport const checkCodeMatch = (\n code: string,\n): Effect.Effect<string | null, PutioSdkError, PutioSdkContext> =>\n decodeAuthInput(\"checkCodeMatch\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(CodeMatchEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/oauth2/oob/code/${encodePathSegment(decodedCode)}`,\n }).pipe(selectJsonField(\"oauth_token\")),\n );\nexport const linkDevice = (\n code: string,\n): Effect.Effect<Schema.Schema.Type<typeof OAuthAppSchema>, LinkDeviceError, PutioSdkContext> =>\n decodeAuthInput(\"linkDevice\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(LinkDeviceEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n code: decodedCode,\n },\n },\n method: \"POST\",\n path: \"/v2/oauth2/oob/code\",\n }).pipe(selectJsonField(\"app\")),\n ).pipe(withOperationErrors(LinkDeviceErrorSpec));\nexport const grants = (): Effect.Effect<\n ReadonlyArray<Schema.Schema.Type<typeof OAuthAppSchema>>,\n GrantsError,\n PutioSdkContext\n> =>\n requestJson(GrantsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/oauth/grants/\",\n }).pipe(selectJsonField(\"apps\"), withOperationErrors(GrantsErrorSpec));\nexport const revokeApp = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n RevokeOAuthGrantError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"revokeApp\", PositiveIntegerSchema, id, (decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/oauth/grants/${encodePathSegment(decodedId)}/delete`,\n }),\n ).pipe(withOperationErrors(RevokeOAuthGrantErrorSpec));\nexport const clients = (): Effect.Effect<\n ReadonlyArray<Schema.Schema.Type<typeof OAuthAppSessionSchema>>,\n ClientsError,\n PutioSdkContext\n> =>\n requestJson(ClientsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/oauth/clients/\",\n }).pipe(selectJsonField(\"clients\"), withOperationErrors(ClientsErrorSpec));\nexport const revokeClient = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n RevokeOAuthClientError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"revokeClient\", PositiveIntegerSchema, id, (decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/oauth/clients/${encodePathSegment(decodedId)}/delete`,\n }),\n ).pipe(withOperationErrors(RevokeOAuthClientErrorSpec));\nexport const revokeAllClients = (): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n RevokeAllOAuthClientsError,\n PutioSdkContext\n> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/oauth/clients/delete-all\",\n }).pipe(withOperationErrors(RevokeAllOAuthClientsErrorSpec));\nexport const validateToken = (\n token: string,\n): Effect.Effect<ValidateTokenResponse, PutioSdkError, PutioSdkContext> =>\n decodeAuthInput(\"validateToken\", NonEmptyStringSchema, token, (decodedToken) =>\n requestJson(ValidateTokenResponseSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: \"/v2/oauth2/validate\",\n query: {\n oauth_token: decodedToken,\n },\n }),\n );\nexport const generateTOTP = (): Effect.Effect<\n GenerateTOTPResponse,\n GenerateTOTPError,\n PutioSdkContext\n> =>\n requestJson(GenerateTOTPEnvelopeSchema, {\n method: \"POST\",\n path: \"/v2/two_factor/generate/totp\",\n }).pipe(\n Effect.map(({ recovery_codes, secret, uri }) => ({\n recovery_codes,\n secret,\n uri,\n })),\n withOperationErrors(GenerateTOTPErrorSpec),\n );\nexport const verifyTOTP = (\n twoFactorScopedToken: string,\n code: string,\n): Effect.Effect<VerifyTOTPResponse, VerifyTOTPError, PutioSdkContext> =>\n decodeAuthInput(\n \"verifyTOTP\",\n AuthVerifyTotpInputSchema,\n { code, twoFactorScopedToken },\n (decodedInput) =>\n requestJson(VerifyTOTPEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n body: {\n type: \"form\",\n value: {\n code: decodedInput.code,\n },\n },\n method: \"POST\",\n path: \"/v2/two_factor/verify/totp\",\n query: {\n oauth_token: decodedInput.twoFactorScopedToken,\n },\n }).pipe(\n Effect.map(({ token, user_id }) => ({\n token,\n user_id,\n })),\n ),\n ).pipe(withOperationErrors(VerifyTOTPErrorSpec));\nexport const getRecoveryCodes = (): Effect.Effect<\n TwoFactorRecoveryCodes,\n RecoveryCodesError,\n PutioSdkContext\n> =>\n requestJson(RecoveryCodesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/two_factor/recovery_codes\",\n }).pipe(selectJsonField(\"recovery_codes\"), withOperationErrors(RecoveryCodesErrorSpec));\nexport const regenerateRecoveryCodes = (): Effect.Effect<\n TwoFactorRecoveryCodes,\n RegenerateRecoveryCodesError,\n PutioSdkContext\n> =>\n requestJson(RecoveryCodesEnvelopeSchema, {\n method: \"POST\",\n path: \"/v2/two_factor/recovery_codes/refresh\",\n }).pipe(selectJsonField(\"recovery_codes\"), withOperationErrors(RegenerateRecoveryCodesErrorSpec));\n","import { Effect, Schema, SchemaIssue, SchemaParser } from \"effect\";\nimport { mapDecodeErrorToValidationError, type PutioSdkError } from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport type PutioJsonPrimitive = string | number | boolean | null;\nexport type PutioJsonValue =\n | PutioJsonPrimitive\n | {\n readonly [key: string]: PutioJsonValue;\n }\n | ReadonlyArray<PutioJsonValue>;\nexport type PutioJsonObject = {\n readonly [key: string]: PutioJsonValue;\n};\nconst nativeObjectConstructorSource = Function.prototype.toString.call(Object);\nconst nativeArrayConstructorSource = Function.prototype.toString.call(Array);\nconst hasMatchingNativeConstructor = (prototype: object, constructorSource: string): boolean => {\n const constructor = Object.getOwnPropertyDescriptor(prototype, \"constructor\")?.value;\n const constructorPrototype =\n typeof constructor === \"function\"\n ? Object.getOwnPropertyDescriptor(constructor, \"prototype\")?.value\n : undefined;\n return (\n typeof constructor === \"function\" &&\n constructorPrototype === prototype &&\n Function.prototype.toString.call(constructor) === constructorSource\n );\n};\nconst isPlainRecord = (value: object): value is Record<string, unknown> => {\n try {\n const prototype = Object.getPrototypeOf(value);\n if (prototype === null) {\n return true;\n }\n if (Object.getPrototypeOf(prototype) !== null) {\n return false;\n }\n return hasMatchingNativeConstructor(prototype, nativeObjectConstructorSource);\n } catch {\n return false;\n }\n};\nconst isPlainArray = (value: ReadonlyArray<unknown>): boolean => {\n try {\n const prototype = Object.getPrototypeOf(value);\n return (\n prototype !== null &&\n Object.getPrototypeOf(prototype) !== null &&\n hasMatchingNativeConstructor(prototype, nativeArrayConstructorSource)\n );\n } catch {\n return false;\n }\n};\ntype JsonWalkMode = \"snapshot\" | \"validate\";\ntype JsonWalkResult =\n | { readonly _tag: \"Invalid\" }\n | { readonly _tag: \"Validated\" }\n | { readonly _tag: \"Snapshot\"; readonly value: PutioJsonValue };\nconst invalidJsonWalk: JsonWalkResult = { _tag: \"Invalid\" };\nconst validatedJsonWalk: JsonWalkResult = { _tag: \"Validated\" };\nconst walkJsonValue = (\n value: unknown,\n mode: JsonWalkMode,\n ancestors: Set<object> = new Set(),\n): JsonWalkResult => {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\") {\n return mode === \"snapshot\" ? { _tag: \"Snapshot\", value } : validatedJsonWalk;\n }\n if (typeof value === \"number\") {\n return Number.isFinite(value)\n ? mode === \"snapshot\"\n ? { _tag: \"Snapshot\", value }\n : validatedJsonWalk\n : invalidJsonWalk;\n }\n if (typeof value !== \"object\" || ancestors.has(value)) {\n return invalidJsonWalk;\n }\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n if (!isPlainArray(value)) {\n return invalidJsonWalk;\n }\n const descriptors = Object.getOwnPropertyDescriptors(value);\n const lengthDescriptor = descriptors[\"length\"];\n if (\n lengthDescriptor === undefined ||\n !(\"value\" in lengthDescriptor) ||\n !Number.isSafeInteger(lengthDescriptor.value) ||\n lengthDescriptor.value < 0\n ) {\n return invalidJsonWalk;\n }\n const output: Array<PutioJsonValue> | undefined = mode === \"snapshot\" ? [] : undefined;\n for (let index = 0; index < lengthDescriptor.value; index += 1) {\n const descriptor = descriptors[String(index)];\n if (descriptor === undefined || !(\"value\" in descriptor)) {\n return invalidJsonWalk;\n }\n const item = walkJsonValue(descriptor.value, mode, ancestors);\n if (item._tag === \"Invalid\") {\n return item;\n }\n if (output === undefined) {\n if (item._tag !== \"Validated\") {\n return invalidJsonWalk;\n }\n } else {\n if (item._tag !== \"Snapshot\") {\n return invalidJsonWalk;\n }\n output.push(item.value);\n }\n }\n return output === undefined ? validatedJsonWalk : { _tag: \"Snapshot\", value: output };\n }\n if (!isPlainRecord(value)) {\n return invalidJsonWalk;\n }\n const output: Record<string, PutioJsonValue> | undefined = mode === \"snapshot\" ? {} : undefined;\n for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {\n if (!descriptor.enumerable) {\n continue;\n }\n if (!(\"value\" in descriptor)) {\n return invalidJsonWalk;\n }\n const item = walkJsonValue(descriptor.value, mode, ancestors);\n if (item._tag === \"Invalid\") {\n return item;\n }\n if (output === undefined) {\n if (item._tag !== \"Validated\") {\n return invalidJsonWalk;\n }\n continue;\n }\n if (item._tag !== \"Snapshot\") {\n return invalidJsonWalk;\n }\n Object.defineProperty(output, key, {\n configurable: true,\n enumerable: true,\n value: item.value,\n writable: true,\n });\n }\n return output === undefined ? validatedJsonWalk : { _tag: \"Snapshot\", value: output };\n } catch {\n return invalidJsonWalk;\n } finally {\n ancestors.delete(value);\n }\n};\nconst snapshotJsonValue = (value: unknown): PutioJsonValue | undefined => {\n const result = walkJsonValue(value, \"snapshot\");\n return result._tag === \"Snapshot\" ? result.value : undefined;\n};\nconst snapshotJsonObject = (value: unknown): PutioJsonObject | undefined => {\n const snapshot = snapshotJsonValue(value);\n return typeof snapshot === \"object\" && snapshot !== null && !Array.isArray(snapshot)\n ? snapshot\n : undefined;\n};\nconst isJsonValue = (value: unknown): value is PutioJsonValue =>\n walkJsonValue(value, \"validate\")._tag === \"Validated\";\nconst isJsonObject = (value: unknown): value is PutioJsonObject =>\n typeof value === \"object\" && value !== null && isJsonValue(value) && !Array.isArray(value);\nexport const JsonValueSchema = Schema.declareConstructor<PutioJsonValue>()(\n [],\n () => (input, ast, options) => {\n const snapshot = snapshotJsonValue(input);\n return snapshot === undefined\n ? Effect.fail(new SchemaIssue.InvalidType(ast, input, options))\n : Effect.succeed(snapshot);\n },\n {\n expected: \"a JSON-compatible value\",\n },\n);\nconst JsonValueResponseSchema = Schema.declareConstructor<PutioJsonValue>()(\n [],\n () => (input, ast, options) =>\n isJsonValue(input)\n ? Effect.succeed(input)\n : Effect.fail(new SchemaIssue.InvalidType(ast, input, options)),\n {\n expected: \"a JSON-compatible value\",\n },\n);\nconst JsonObjectResponseSchema = Schema.declareConstructor<PutioJsonObject>()(\n [],\n () => (input, ast, options) =>\n isJsonObject(input)\n ? Effect.succeed(input)\n : Effect.fail(new SchemaIssue.InvalidType(ast, input, options)),\n {\n expected: \"a JSON object\",\n },\n);\nexport const JsonObjectSchema = Schema.declareConstructor<PutioJsonObject>()(\n [],\n () => (input, ast, options) => {\n const snapshot = snapshotJsonObject(input);\n return snapshot === undefined\n ? Effect.fail(new SchemaIssue.InvalidType(ast, input, options))\n : Effect.succeed(snapshot);\n },\n {\n expected: \"a JSON object\",\n },\n);\nconst ConfigKeySchema = Schema.String.check(\n Schema.isMinLength(1),\n Schema.isPattern(/^(?!\\.{1,2}$)/),\n Schema.makeFilter((key: string) => key.isWellFormed(), {\n expected: \"a well-formed Unicode config key\",\n }),\n);\nconst ConfigSetKeyInputSchema = Schema.Struct({\n key: ConfigKeySchema,\n value: JsonValueSchema,\n});\nconst getResponseEnvelopeFields = (\n input: unknown,\n valueField: \"config\" | \"value\",\n): { readonly status: unknown; readonly value: unknown } | undefined => {\n if (typeof input !== \"object\" || input === null || !isPlainRecord(input)) {\n return undefined;\n }\n try {\n const statusDescriptor = Object.getOwnPropertyDescriptor(input, \"status\");\n const valueDescriptor = Object.getOwnPropertyDescriptor(input, valueField);\n if (\n statusDescriptor === undefined ||\n !(\"value\" in statusDescriptor) ||\n valueDescriptor === undefined ||\n !(\"value\" in valueDescriptor)\n ) {\n return undefined;\n }\n return {\n status: statusDescriptor.value,\n value: valueDescriptor.value,\n };\n } catch {\n return undefined;\n }\n};\nconst makeConfigEnvelopeSchema = <A>(schema: Schema.ConstraintDecoder<A, never>) =>\n Schema.declareConstructor<{\n readonly config: A;\n readonly status: \"OK\";\n }>()([schema], ([configSchema]) => (input, ast, options) => {\n const fields = getResponseEnvelopeFields(input, \"config\");\n if (fields === undefined || fields.status !== \"OK\") {\n return Effect.fail(new SchemaIssue.InvalidType(ast, input, options));\n }\n return SchemaParser.decodeUnknownEffect(configSchema)(fields.value, options).pipe(\n Effect.map((config) => ({ config, status: \"OK\" })),\n );\n });\nconst makeConfigValueEnvelopeSchema = <A>(schema: Schema.ConstraintDecoder<A, never>) =>\n Schema.declareConstructor<{\n readonly status: \"OK\";\n readonly value: A;\n }>()([schema], ([valueSchema]) => (input, ast, options) => {\n const fields = getResponseEnvelopeFields(input, \"value\");\n if (fields === undefined || fields.status !== \"OK\") {\n return Effect.fail(new SchemaIssue.InvalidType(ast, input, options));\n }\n return SchemaParser.decodeUnknownEffect(valueSchema)(fields.value, options).pipe(\n Effect.map((value) => ({ status: \"OK\", value })),\n );\n });\nconst ConfigEnvelopeSchema = makeConfigEnvelopeSchema(JsonObjectResponseSchema);\nconst ConfigValueEnvelopeSchema = makeConfigValueEnvelopeSchema(JsonValueResponseSchema);\nexport const readConfig = (): Effect.Effect<PutioJsonObject, PutioSdkError, PutioSdkContext> =>\n requestJson(ConfigEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/config\",\n }).pipe(selectJsonField(\"config\"));\nexport const readConfigWith = <A>(\n schema: Schema.ConstraintDecoder<A, never>,\n): Effect.Effect<A, PutioSdkError, PutioSdkContext> =>\n requestJson(makeConfigEnvelopeSchema(JsonObjectResponseSchema.pipe(Schema.decodeTo(schema))), {\n method: \"GET\",\n path: \"/v2/config\",\n }).pipe(Effect.map((envelope) => envelope[\"config\"]));\nexport const writeConfig = (\n config: PutioJsonObject,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(JsonObjectSchema)(config).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedConfig) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"json\",\n value: {\n config: decodedConfig,\n },\n },\n method: \"PUT\",\n path: \"/v2/config\",\n }),\n ),\n );\nexport const getConfigKey = (\n key: string,\n): Effect.Effect<PutioJsonValue, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedKey) =>\n requestJson(ConfigValueEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/config/${encodePathSegment(decodedKey)}`,\n }),\n ),\n selectJsonField(\"value\"),\n );\nexport const getConfigKeyWith = <A>(\n key: string,\n schema: Schema.ConstraintDecoder<A, never>,\n): Effect.Effect<A, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedKey) =>\n requestJson(\n makeConfigValueEnvelopeSchema(JsonValueResponseSchema.pipe(Schema.decodeTo(schema))),\n {\n method: \"GET\",\n path: `/v2/config/${encodePathSegment(decodedKey)}`,\n },\n ),\n ),\n Effect.map((envelope) => envelope[\"value\"]),\n );\nexport const setConfigKey = (\n key: string,\n value: PutioJsonValue,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(ConfigSetKeyInputSchema, { onExcessProperty: \"error\" })({\n key,\n value,\n }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"json\",\n value: {\n value: decodedInput.value,\n },\n },\n method: \"PUT\",\n path: `/v2/config/${encodePathSegment(decodedInput.key)}`,\n }),\n ),\n );\nexport const deleteConfigKey = (\n key: string,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedKey) =>\n requestJson(OkResponseSchema, {\n method: \"DELETE\",\n path: `/v2/config/${encodePathSegment(decodedKey)}`,\n }),\n ),\n );\n","import { Effect, Schema } from \"effect\";\nimport { toCursorSelectionForm } from \"../core/forms.js\";\nimport { PositiveIntegerSchema, makeCursorSelectionSchema } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n encodePathSegment,\n requestJson,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport const DownloadLinksStatusSchema = Schema.Literals([\"NEW\", \"PROCESSING\", \"DONE\", \"ERROR\"]);\nexport const DownloadLinksCreateInputSchema = makeCursorSelectionSchema(\"ids\", \"excludeIds\", {});\nexport const DownloadLinksPayloadSchema = Schema.Struct({\n download_links: Schema.Array(Schema.String),\n media_links: Schema.Array(Schema.String),\n mp4_links: Schema.Array(Schema.String),\n});\nconst DownloadLinksCreateEnvelopeSchema = Schema.Struct({\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n status: Schema.Literal(\"OK\"),\n});\nconst DownloadLinksPendingEnvelopeSchema = Schema.Struct({\n error_msg: Schema.optional(Schema.NullOr(Schema.String)),\n links: Schema.Null,\n links_status: Schema.Literals([\"NEW\", \"PROCESSING\"]),\n status: Schema.Literal(\"OK\"),\n});\nconst DownloadLinksDoneEnvelopeSchema = Schema.Struct({\n error_msg: Schema.optional(Schema.NullOr(Schema.String)),\n links: DownloadLinksPayloadSchema,\n links_status: Schema.Literal(\"DONE\"),\n status: Schema.Literal(\"OK\"),\n});\nconst DownloadLinksErrorEnvelopeSchema = Schema.Struct({\n error_msg: Schema.String,\n links: Schema.Null,\n links_status: Schema.Literal(\"ERROR\"),\n status: Schema.Literal(\"OK\"),\n});\nexport const DownloadLinksInfoSchema = Schema.Union([\n DownloadLinksPendingEnvelopeSchema,\n DownloadLinksDoneEnvelopeSchema,\n DownloadLinksErrorEnvelopeSchema,\n]);\nexport type DownloadLinksStatus = Schema.Schema.Type<typeof DownloadLinksStatusSchema>;\nexport type DownloadLinksCreateInput = Schema.Schema.Type<typeof DownloadLinksCreateInputSchema>;\nexport type DownloadLinksPayload = Schema.Schema.Type<typeof DownloadLinksPayloadSchema>;\nexport type DownloadLinksInfo = Schema.Schema.Type<typeof DownloadLinksInfoSchema>;\nexport const CreateDownloadLinksErrorSpec = definePutioOperationErrorSpec({\n domain: \"downloadLinks\",\n operation: \"create\",\n knownErrors: [\n { errorType: \"DownloadLinksConcurrentLimit\", statusCode: 400 as const },\n { errorType: \"DownloadLinksTooManyFilesRequested\", statusCode: 400 as const },\n { errorType: \"DownloadLinksTooManyChildrenRequested\", statusCode: 400 as const },\n { errorType: \"BadRequest\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const GetDownloadLinksErrorSpec = definePutioOperationErrorSpec({\n domain: \"downloadLinks\",\n operation: \"get\",\n knownErrors: [\n { errorType: \"LINKS_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport type CreateDownloadLinksError = PutioOperationFailure<typeof CreateDownloadLinksErrorSpec>;\nexport type GetDownloadLinksError = PutioOperationFailure<typeof GetDownloadLinksErrorSpec>;\nexport const createDownloadLinks = (\n input: DownloadLinksCreateInput = {},\n): Effect.Effect<\n {\n readonly id: number;\n },\n CreateDownloadLinksError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(DownloadLinksCreateInputSchema, { onExcessProperty: \"error\" })(\n input,\n ).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(DownloadLinksCreateEnvelopeSchema, {\n body: {\n type: \"form\",\n value: toCursorSelectionForm(decodedInput),\n },\n method: \"POST\",\n path: \"/v2/download_links/create\",\n }),\n ),\n selectJsonFields(\"id\"),\n withOperationErrors(CreateDownloadLinksErrorSpec),\n );\nexport const getDownloadLinks = (\n id: number,\n): Effect.Effect<DownloadLinksInfo, GetDownloadLinksError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(DownloadLinksInfoSchema, {\n method: \"GET\",\n path: `/v2/download_links/${encodePathSegment(decodedId)}`,\n }),\n ),\n withOperationErrors(GetDownloadLinksErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\nimport { PositiveIntegerSchema } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestArrayBuffer,\n requestJson,\n type PutioSdkContext,\n} from \"../core/http.js\";\nconst HistoryEventBaseSchema = Schema.Struct({\n created_at: Schema.String,\n id: Schema.Int,\n type: Schema.String,\n user_id: Schema.Int,\n});\nconst HistoryFileEventSchema = HistoryEventBaseSchema.pipe(\n Schema.fieldsAssign({\n file_id: Schema.Int,\n file_name: Schema.String,\n file_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n }),\n);\nconst HistoryTransferEventSchema = HistoryEventBaseSchema.pipe(\n Schema.fieldsAssign({\n source: Schema.String,\n transfer_name: Schema.String,\n }),\n);\nexport const HistoryFileSharedEventSchema = HistoryFileEventSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n sharing_user_name: Schema.String,\n type: Schema.Literal(\"file_shared\"),\n }),\n);\nexport const HistoryUploadEventSchema = HistoryFileEventSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n type: Schema.Literal(\"upload\"),\n }),\n);\nexport const HistoryFileFromRssDeletedEventSchema = HistoryFileEventSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n file_source: Schema.String,\n type: Schema.Literal(\"file_from_rss_deleted_for_space\"),\n }),\n);\nexport const HistoryTransferCompletedEventSchema = HistoryTransferEventSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n file_id: Schema.Int,\n transfer_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n type: Schema.Literal(\"transfer_completed\"),\n }),\n);\nexport const HistoryTransferErrorEventSchema = HistoryTransferEventSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n type: Schema.Literal(\"transfer_error\"),\n }),\n);\nexport const HistoryTransferFromRssErrorEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n rss_id: Schema.Int,\n transfer_name: Schema.String,\n type: Schema.Literal(\"transfer_from_rss_error\"),\n }),\n);\nexport const HistoryTransferCallbackErrorEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n message: Schema.String,\n transfer_id: Schema.Int,\n transfer_name: Schema.String,\n type: Schema.Literal(\"transfer_callback_error\"),\n }),\n);\nexport const HistoryPrivateTorrentPinEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n new_host_ip: Schema.String,\n pinned_host_ip: Schema.String,\n type: Schema.Literal(\"private_torrent_pin\"),\n user_download_name: Schema.String,\n }),\n);\nexport const HistoryRssFilterPausedEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n rss_filter_id: Schema.Int,\n rss_filter_title: Schema.String,\n type: Schema.Literal(\"rss_filter_paused\"),\n }),\n);\nexport const HistoryVoucherEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n type: Schema.Literal(\"voucher\"),\n voucher: Schema.Int,\n voucher_owner_id: Schema.Int,\n voucher_owner_name: Schema.String,\n }),\n);\nexport const HistoryZipCreatedEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n type: Schema.Literal(\"zip_created\"),\n zip_id: Schema.Int,\n zip_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n }),\n);\nexport const HistoryKnownEventTypeSchema = Schema.Literals([\n \"file_shared\",\n \"upload\",\n \"file_from_rss_deleted_for_space\",\n \"transfer_completed\",\n \"transfer_error\",\n \"transfer_from_rss_error\",\n \"transfer_callback_error\",\n \"private_torrent_pin\",\n \"rss_filter_paused\",\n \"voucher\",\n \"zip_created\",\n]);\nexport const HistoryEventSchema = Schema.Union([\n HistoryFileSharedEventSchema,\n HistoryUploadEventSchema,\n HistoryFileFromRssDeletedEventSchema,\n HistoryTransferCompletedEventSchema,\n HistoryTransferErrorEventSchema,\n HistoryTransferFromRssErrorEventSchema,\n HistoryTransferCallbackErrorEventSchema,\n HistoryPrivateTorrentPinEventSchema,\n HistoryRssFilterPausedEventSchema,\n HistoryVoucherEventSchema,\n HistoryZipCreatedEventSchema,\n HistoryEventBaseSchema,\n]);\nexport const EventsListQuerySchema = Schema.Struct({\n before: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n});\nconst EventsListEnvelopeSchema = Schema.Struct({\n events: Schema.Array(HistoryEventSchema),\n has_more: Schema.Boolean,\n status: Schema.Literal(\"OK\"),\n});\nexport type HistoryKnownEventType = Schema.Schema.Type<typeof HistoryKnownEventTypeSchema>;\nexport type HistoryEvent = Schema.Schema.Type<typeof HistoryEventSchema>;\nexport type EventsListQuery = Schema.Schema.Type<typeof EventsListQuerySchema>;\nexport type EventsListResponse = Schema.Schema.Type<typeof EventsListEnvelopeSchema>;\nexport type HistoryFileSharedEvent = Schema.Schema.Type<typeof HistoryFileSharedEventSchema>;\nexport type HistoryTransferCompletedEvent = Schema.Schema.Type<\n typeof HistoryTransferCompletedEventSchema\n>;\nexport type HistoryZipCreatedEvent = Schema.Schema.Type<typeof HistoryZipCreatedEventSchema>;\nexport const ListEventsErrorSpec = definePutioOperationErrorSpec({\n domain: \"events\",\n operation: \"list\",\n knownErrors: [\n { errorType: \"INVALID_PER_PAGE\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const DeleteEventErrorSpec = definePutioOperationErrorSpec({\n domain: \"events\",\n operation: \"delete\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const ClearEventsErrorSpec = definePutioOperationErrorSpec({\n domain: \"events\",\n operation: \"clear\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const GetEventTorrentErrorSpec = definePutioOperationErrorSpec({\n domain: \"events\",\n operation: \"getTorrent\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"INVALID_EVENT\", statusCode: 500 as const },\n { statusCode: 404 as const },\n { statusCode: 500 as const },\n ],\n});\nexport type ListEventsError = PutioOperationFailure<typeof ListEventsErrorSpec>;\nexport type DeleteEventError = PutioOperationFailure<typeof DeleteEventErrorSpec>;\nexport type ClearEventsError = PutioOperationFailure<typeof ClearEventsErrorSpec>;\nexport type GetEventTorrentError = PutioOperationFailure<typeof GetEventTorrentErrorSpec>;\nexport const listEvents = (\n query: EventsListQuery = {},\n): Effect.Effect<EventsListResponse, ListEventsError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(EventsListQuerySchema, { onExcessProperty: \"error\" })(query).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedQuery) =>\n requestJson(EventsListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/events/list\",\n query: decodedQuery,\n }),\n ),\n withOperationErrors(ListEventsErrorSpec),\n );\nexport const deleteEvent = (\n id: number,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, DeleteEventError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/events/delete/${encodePathSegment(decodedId)}`,\n }),\n ),\n withOperationErrors(DeleteEventErrorSpec),\n );\nexport const clearEvents = (): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ClearEventsError,\n PutioSdkContext\n> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/events/delete\",\n }).pipe(withOperationErrors(ClearEventsErrorSpec));\nexport const getEventTorrent = (\n id: number,\n): Effect.Effect<Uint8Array, GetEventTorrentError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestArrayBuffer({\n method: \"GET\",\n path: `/v2/events/${encodePathSegment(decodedId)}/torrent`,\n }),\n ),\n withOperationErrors(GetEventTorrentErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { NonEmptyStringSchema } from \"../core/validation.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nconst NonNegativeIntegerSchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));\nconst NonNegativeIntegerFromStringSchema = Schema.NumberFromString.check(\n Schema.isInt(),\n Schema.isGreaterThanOrEqualTo(0),\n);\nexport const FamilyInviteSchema = Schema.Struct({\n code: Schema.String,\n created_at: Schema.String,\n user_id: Schema.NullOr(Schema.Int),\n});\nexport const FamilyMemberSchema = Schema.Struct({\n avatar_url: Schema.String,\n created_at: Schema.String,\n disk_used: Schema.Union([NonNegativeIntegerSchema, NonNegativeIntegerFromStringSchema]),\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n is_owner: Schema.Boolean,\n name: Schema.String,\n});\nconst FamilyInvitesEnvelopeSchema = Schema.Struct({\n invites: Schema.Array(FamilyInviteSchema),\n limit: NonNegativeIntegerSchema,\n remaining_limit: NonNegativeIntegerSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst FamilyMembersEnvelopeSchema = Schema.Struct({\n members: Schema.Array(FamilyMemberSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst FamilyCreateInviteEnvelopeSchema = Schema.Struct({\n code: Schema.String,\n status: Schema.Literal(\"OK\"),\n});\nexport type FamilyInvite = Schema.Schema.Type<typeof FamilyInviteSchema>;\nexport type FamilyMember = Schema.Schema.Type<typeof FamilyMemberSchema>;\nexport type FamilyInvitesResponse = {\n readonly invites: ReadonlyArray<FamilyInvite>;\n readonly limit: number;\n readonly remaining_limit: number;\n};\nconst RestrictedFamilyError = { errorType: \"invalid_scope\", statusCode: 401 as const };\nexport const ListFamilyInvitesErrorSpec = definePutioOperationErrorSpec({\n domain: \"family\",\n operation: \"listInvites\",\n knownErrors: [RestrictedFamilyError],\n});\nexport const ListFamilyMembersErrorSpec = definePutioOperationErrorSpec({\n domain: \"family\",\n operation: \"listMembers\",\n knownErrors: [RestrictedFamilyError],\n});\nexport const CreateFamilyInviteErrorSpec = definePutioOperationErrorSpec({\n domain: \"family\",\n operation: \"createInvite\",\n knownErrors: [\n { errorType: \"FAMILY_SUB_ACCOUNT_NOT_ALLOWED\", statusCode: 403 as const },\n { errorType: \"FAMILY_SUB_ACCOUNT_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"FAMILY_UNUSED_INVITE_LIMIT_EXCEEDED\", statusCode: 403 as const },\n RestrictedFamilyError,\n { statusCode: 403 as const },\n ],\n});\nexport const RemoveFamilyMemberErrorSpec = definePutioOperationErrorSpec({\n domain: \"family\",\n operation: \"removeMember\",\n knownErrors: [RestrictedFamilyError, { statusCode: 404 as const }],\n});\nexport const JoinFamilyErrorSpec = definePutioOperationErrorSpec({\n domain: \"family\",\n operation: \"join\",\n knownErrors: [\n { errorType: \"FAMILY_INVITE_ACTIVE_USER\", statusCode: 403 as const },\n { errorType: \"FAMILY_INVITE_ANOTHER_FAMILY\", statusCode: 403 as const },\n { errorType: \"FAMILY_INVITE_INVALID_CODE\", statusCode: 403 as const },\n { errorType: \"FAMILY_INVITE_OWNER_NOT_FOUND\", statusCode: 403 as const },\n { errorType: \"FAMILY_INVITE_OWNER_NOT_ACTIVE\", statusCode: 403 as const },\n { errorType: \"FAMILY_INVITE_OWNER_NO_LIMIT\", statusCode: 403 as const },\n { errorType: \"FAMILY_LIMIT_EXCEEDED\", statusCode: 403 as const },\n RestrictedFamilyError,\n { statusCode: 403 as const },\n ],\n});\nexport type ListFamilyInvitesError = PutioOperationFailure<typeof ListFamilyInvitesErrorSpec>;\nexport type ListFamilyMembersError = PutioOperationFailure<typeof ListFamilyMembersErrorSpec>;\nexport type CreateFamilyInviteError = PutioOperationFailure<typeof CreateFamilyInviteErrorSpec>;\nexport type RemoveFamilyMemberError = PutioOperationFailure<typeof RemoveFamilyMemberErrorSpec>;\nexport type JoinFamilyError = PutioOperationFailure<typeof JoinFamilyErrorSpec>;\nexport const listFamilyInvites = (): Effect.Effect<\n FamilyInvitesResponse,\n ListFamilyInvitesError,\n PutioSdkContext\n> =>\n requestJson(FamilyInvitesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/family/invites\",\n }).pipe(\n selectJsonFields(\"invites\", \"limit\", \"remaining_limit\"),\n withOperationErrors(ListFamilyInvitesErrorSpec),\n );\nexport const listFamilyMembers = (): Effect.Effect<\n ReadonlyArray<FamilyMember>,\n ListFamilyMembersError,\n PutioSdkContext\n> =>\n requestJson(FamilyMembersEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/family/members\",\n }).pipe(selectJsonField(\"members\"), withOperationErrors(ListFamilyMembersErrorSpec));\nexport const createFamilyInvite = (): Effect.Effect<\n {\n readonly code: string;\n },\n CreateFamilyInviteError,\n PutioSdkContext\n> =>\n requestJson(FamilyCreateInviteEnvelopeSchema, {\n method: \"POST\",\n path: \"/v2/family/sub_account\",\n }).pipe(selectJsonFields(\"code\"), withOperationErrors(CreateFamilyInviteErrorSpec));\nexport const removeFamilyMember = (\n username: string,\n): Effect.Effect<void, RemoveFamilyMemberError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(NonEmptyStringSchema)(username).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedUsername) =>\n requestJson(OkResponseSchema, {\n method: \"DELETE\",\n path: `/v2/family/sub_account/${encodePathSegment(decodedUsername)}`,\n }),\n ),\n Effect.asVoid,\n withOperationErrors(RemoveFamilyMemberErrorSpec),\n );\nexport const joinFamily = (\n inviteCode: string,\n): Effect.Effect<void, JoinFamilyError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(NonEmptyStringSchema)(inviteCode).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInviteCode) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/family/join/${encodePathSegment(decodedInviteCode)}`,\n }),\n ),\n Effect.asVoid,\n withOperationErrors(JoinFamilyErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\n\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n requestJson,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema, decodeAndRun } from \"../core/validation.js\";\nimport { JsonObjectSchema, type PutioJsonObject } from \"./config.js\";\n\nconst IFTTTStatusEnvelopeSchema = Schema.Struct({\n enabled: Schema.Boolean,\n status: Schema.Literal(\"OK\"),\n});\n\nexport type IftttEventType = \"playback_started\" | \"playback_stopped\" | (string & {});\n\nexport type IftttEventInput =\n | {\n readonly clientName?: string;\n readonly eventType: \"playback_started\" | \"playback_stopped\";\n readonly ingredients: {\n readonly file_id: number;\n readonly file_name: string;\n readonly file_type: string;\n };\n }\n | {\n readonly clientName?: string;\n readonly eventType: IftttEventType;\n readonly ingredients: PutioJsonObject;\n };\n\nconst IftttPlaybackIngredientsSchema = Schema.Struct({\n file_id: PositiveIntegerSchema,\n file_name: NonEmptyStringSchema,\n file_type: NonEmptyStringSchema,\n});\nconst isIftttPlaybackIngredients = Schema.is(IftttPlaybackIngredientsSchema);\nconst IftttEventInputSchema = Schema.Struct({\n clientName: Schema.optional(NonEmptyStringSchema),\n eventType: NonEmptyStringSchema,\n ingredients: JsonObjectSchema,\n}).check(\n Schema.makeFilter(\n (input) =>\n input.eventType !== \"playback_started\" && input.eventType !== \"playback_stopped\"\n ? true\n : isIftttPlaybackIngredients(input.ingredients),\n { expected: \"complete playback ingredients for playback events\" },\n ),\n);\n\nexport const GetIftttStatusErrorSpec = definePutioOperationErrorSpec({\n domain: \"ifttt\",\n operation: \"getStatus\",\n knownErrors: [{ statusCode: 402 as const }],\n});\n\nexport const SendIftttEventErrorSpec = definePutioOperationErrorSpec({\n domain: \"ifttt\",\n operation: \"sendEvent\",\n knownErrors: [\n { errorType: \"INVALID_EVENT_TYPE\", statusCode: 400 as const },\n { errorType: \"MISSING_INGREDIENTS\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 402 as const },\n { statusCode: 400 as const },\n ],\n});\n\nexport type GetIftttStatusError = PutioOperationFailure<typeof GetIftttStatusErrorSpec>;\nexport type SendIftttEventError = PutioOperationFailure<typeof SendIftttEventErrorSpec>;\n\nexport const getIftttStatus = (): Effect.Effect<\n { readonly enabled: boolean },\n GetIftttStatusError,\n PutioSdkContext\n> =>\n requestJson(IFTTTStatusEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/ifttt-client/status\",\n }).pipe(selectJsonFields(\"enabled\"), withOperationErrors(GetIftttStatusErrorSpec));\n\nexport const sendIftttEvent = (\n input: IftttEventInput,\n): Effect.Effect<void, SendIftttEventError, PutioSdkContext> =>\n decodeAndRun(IftttEventInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n client_name: decodedInput.clientName,\n event_type: decodedInput.eventType,\n ingredients: decodedInput.ingredients,\n },\n },\n method: \"POST\",\n path: \"/v2/ifttt-client/event\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(SendIftttEventErrorSpec));\n","import { Effect, Schema } from \"effect\";\nimport { joinCsv, toCursorSelectionForm } from \"../core/forms.js\";\nimport {\n mapDecodeErrorToValidationError,\n mapConfigurationError,\n PutioValidationError,\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n type PutioSdkError,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n PutioSdkConfig,\n buildPutioUrl,\n encodePathSegment,\n requestJson,\n requestText,\n requestVoid,\n selectJsonField,\n type PutioSdkConfigShape,\n type PutioSdkContext,\n} from \"../core/http.js\";\nimport {\n NonEmptyStringSchema,\n PositiveIntegerSchema,\n decodeAndRun,\n makeCursorSelectionSchema,\n} from \"../core/validation.js\";\nconst RequestedFlag = Schema.Literal(1);\nconst NonNegativeFileIdSchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));\n// Readable file ids: real ids plus the virtual sharing tree put.io serves\n// from the same routes (-2 is the \"shared with you\" root, ids below it are\n// per-sharer folders). -1 is not a file and stays rejected.\nexport const SHARED_WITH_YOU_ROOT_ID = -2;\nconst ReadableFileIdSchema = Schema.Int.check(\n Schema.makeFilter((id: number) => id >= 0 || id <= SHARED_WITH_YOU_ROOT_ID, {\n expected: \"a file id that is non-negative or a virtual sharing id (-2 or lower)\",\n }),\n);\nconst PositiveFileIdSchema = Schema.Int.check(Schema.isGreaterThan(0));\nexport const FileTypeSchema = Schema.Literals([\n \"FOLDER\",\n \"FILE\",\n \"AUDIO\",\n \"VIDEO\",\n \"IMAGE\",\n \"ARCHIVE\",\n \"PDF\",\n \"TEXT\",\n \"SWF\",\n]);\nexport const FolderTypeSchema = Schema.Literals([\"REGULAR\", \"SHARED_ROOT\", \"SHARED_FRIEND\"]);\nexport const FileSortSchema = Schema.Literals([\n \"NAME_ASC\",\n \"NAME_DESC\",\n \"SIZE_ASC\",\n \"SIZE_DESC\",\n \"DATE_ASC\",\n \"DATE_DESC\",\n \"MODIFIED_ASC\",\n \"MODIFIED_DESC\",\n \"TYPE_ASC\",\n \"TYPE_DESC\",\n \"WATCH_ASC\",\n \"WATCH_DESC\",\n]);\nexport const FileSetSortInputSchema = Schema.Struct({\n fileId: NonNegativeFileIdSchema,\n sortBy: FileSortSchema,\n});\nexport const FileCopyInputSchema = Schema.Struct({\n fileId: PositiveFileIdSchema,\n name: Schema.optional(Schema.String.check(Schema.isMinLength(1))),\n parentId: NonNegativeFileIdSchema,\n});\nexport const FileTouchInputSchema = Schema.Struct({\n fileIds: Schema.Array(NonNegativeFileIdSchema).check(Schema.isMinLength(1)),\n updatedAt: Schema.optional(Schema.Date),\n});\nexport const FileMediaMetadataSchema = Schema.Struct({\n aspect_ratio: Schema.optional(\n Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n ),\n codec: Schema.optional(Schema.NullOr(Schema.String)),\n duration: Schema.optional(Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)))),\n height: Schema.optional(Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))),\n width: Schema.optional(Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))),\n});\nexport const FileMediaInfoFormatSchema = Schema.Struct({\n bit_rate: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n duration: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n name: Schema.optional(Schema.String),\n});\nexport const FileMediaInfoStreamSchema = Schema.Struct({\n channels: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n codec_name: Schema.optional(Schema.String),\n codec_type: Schema.optional(Schema.String),\n height: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n // FFmpeg reports an unknown codec level as -99, including MJPEG streams.\n level: Schema.optional(\n Schema.Union([Schema.Literal(-99), Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))]),\n ),\n profile: Schema.optional(Schema.NullOr(Schema.String)),\n // put.io only derives an RFC 6381 codec string for MP4-family containers;\n // Matroska and other streams report null.\n rfc6381_codec: Schema.optional(Schema.NullOr(Schema.String)),\n width: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nexport const FileMediaInfoSchema = Schema.Struct({\n format: Schema.optional(Schema.NullOr(FileMediaInfoFormatSchema)),\n mime_type: Schema.optional(Schema.NullOr(Schema.String)),\n playback_issues: Schema.optional(Schema.Array(Schema.String)),\n streams: Schema.optional(Schema.Array(FileMediaInfoStreamSchema)),\n});\nexport const FileBaseSchema = Schema.Struct({\n content_type: Schema.NullOr(Schema.String),\n created_at: Schema.String,\n crc32: Schema.NullOr(Schema.String),\n extension: Schema.NullOr(Schema.String),\n file_type: FileTypeSchema,\n first_accessed_at: Schema.NullOr(Schema.String),\n folder_type: FolderTypeSchema,\n icon: Schema.NullOr(Schema.String),\n id: Schema.Int,\n is_hidden: Schema.Boolean,\n is_mp4_available: Schema.Boolean,\n is_shared: Schema.Boolean,\n name: Schema.String,\n opensubtitles_hash: Schema.NullOr(Schema.String),\n parent_id: Schema.NullOr(Schema.Int),\n screenshot: Schema.NullOr(Schema.String),\n sha1: Schema.optional(Schema.NullOr(Schema.String)),\n size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n start_from: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n updated_at: Schema.String,\n});\nexport const FileBroadSchema = FileBaseSchema.pipe(\n Schema.fieldsAssign({\n content_type_and_codecs: Schema.optional(Schema.NullOr(Schema.String)),\n media_info: Schema.optional(Schema.NullOr(FileMediaInfoSchema)),\n media_metadata: Schema.optional(Schema.NullOr(FileMediaMetadataSchema)),\n mp4_size: Schema.optional(Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)))),\n mp4_stream_url: Schema.optional(Schema.NullOr(Schema.String)),\n need_convert: Schema.optional(Schema.Boolean),\n sender_name: Schema.optional(Schema.String),\n sort_by: Schema.optional(FileSortSchema),\n stream_url: Schema.optional(Schema.NullOr(Schema.String)),\n video_metadata: Schema.optional(Schema.NullOr(FileMediaMetadataSchema)),\n }),\n);\nexport const FileQuerySchema = Schema.Struct({\n codecs: Schema.optional(RequestedFlag),\n media_info: Schema.optional(RequestedFlag),\n media_metadata: Schema.optional(RequestedFlag),\n mp4_status: Schema.optional(RequestedFlag),\n mp4_stream_url: Schema.optional(RequestedFlag),\n stream_url: Schema.optional(RequestedFlag),\n video_metadata: Schema.optional(RequestedFlag),\n});\nexport const FileGetChildInputSchema = Schema.Struct({\n name: Schema.String.check(Schema.isMinLength(1)),\n parentId: NonNegativeFileIdSchema,\n query: Schema.optional(FileQuerySchema),\n});\nexport const FilesListQuerySchema = FileQuerySchema.mapFields(\n ({ codecs: _codecs, media_info: _mediaInfo, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n breadcrumbs: Schema.optional(RequestedFlag),\n codecs_parent: Schema.optional(RequestedFlag),\n content_type: Schema.optional(Schema.String),\n file_type: Schema.optional(Schema.String),\n hidden: Schema.optional(RequestedFlag),\n media_info_parent: Schema.optional(RequestedFlag),\n media_metadata_parent: Schema.optional(RequestedFlag),\n mp4_status_parent: Schema.optional(RequestedFlag),\n mp4_stream_url_parent: Schema.optional(RequestedFlag),\n no_cursor: Schema.optional(RequestedFlag),\n per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n sort: Schema.optional(FileSortSchema),\n sort_by: Schema.optional(FileSortSchema),\n stream_url_parent: Schema.optional(RequestedFlag),\n total: Schema.optional(RequestedFlag),\n video_metadata_parent: Schema.optional(RequestedFlag),\n }),\n);\nexport const FilesSearchQuerySchema = Schema.Struct({\n per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n query: Schema.String,\n});\nexport const FileBreadcrumbSchema = Schema.Tuple([Schema.Int, Schema.String]);\nconst FileEnvelopeSchema = Schema.Struct({\n file: FileBroadSchema,\n status: Schema.Literal(\"OK\"),\n});\nexport const FilesListEnvelopeSchema = Schema.Struct({\n breadcrumbs: Schema.optional(Schema.Array(FileBreadcrumbSchema)),\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(FileBroadSchema),\n parent: Schema.NullOr(FileBroadSchema),\n status: Schema.Literal(\"OK\"),\n total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst FilesListContinueEnvelopeSchema = Schema.Struct({\n breadcrumbs: Schema.optional(Schema.Array(FileBreadcrumbSchema)),\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(FileBroadSchema),\n parent: Schema.optional(Schema.NullOr(FileBroadSchema)),\n status: Schema.Literal(\"OK\"),\n total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst FilesSearchEnvelopeSchema = Schema.Struct({\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(FileBroadSchema),\n status: Schema.Literal(\"OK\"),\n total: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n});\nconst FilesListInputSchema = Schema.Struct({\n parent: Schema.Union([ReadableFileIdSchema, Schema.Literal(\"friends\")]),\n query: FilesListQuerySchema,\n});\nconst FilesContinueInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n query: Schema.Struct({\n per_page: Schema.optional(PositiveIntegerSchema),\n }),\n});\nconst FileGetInputSchema = Schema.Struct({\n id: ReadableFileIdSchema,\n query: Schema.optional(FileQuerySchema),\n});\nconst FilesSearchContinueInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n query: Schema.Struct({\n per_page: Schema.optional(PositiveIntegerSchema),\n }),\n});\nconst FileSubtitlesInputSchema = Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: Schema.Struct({\n languages: Schema.optional(Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1))),\n }),\n});\nconst FileNextInputSchema = Schema.Struct({\n fileId: PositiveFileIdSchema,\n fileType: FileTypeSchema,\n});\nconst FileCreateFolderInputSchema = Schema.Struct({\n name: Schema.optional(NonEmptyStringSchema),\n parent_id: Schema.optional(NonNegativeFileIdSchema),\n path: Schema.optional(NonEmptyStringSchema),\n}).check(\n Schema.makeFilter((input) => input.name !== undefined || input.path !== undefined, {\n expected: \"a non-empty folder name or path\",\n }),\n);\nconst FileRenameInputSchema = Schema.Struct({\n file_id: PositiveFileIdSchema,\n name: NonEmptyStringSchema,\n});\nconst FileStartFromSetInputSchema = Schema.Struct({\n file_id: PositiveFileIdSchema,\n time: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n});\nconst FileStartFromEnvelopeSchema = Schema.Struct({\n start_from: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n});\nconst FileDownloadUrlEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n url: Schema.String,\n});\nconst FileCanWriteEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n user_id: Schema.Int,\n});\nconst FileUploadTransferSchema = Schema.Struct({\n id: Schema.Int,\n name: Schema.String,\n});\nconst FileUploadEnvelopeSchema = Schema.Struct({\n file: Schema.optional(FileBroadSchema),\n status: Schema.Literal(\"OK\"),\n transfer: Schema.optional(FileUploadTransferSchema),\n});\nconst FileConversionNotAvailableSchema = Schema.Struct({\n id: Schema.Int,\n status: Schema.Literal(\"NOT_AVAILABLE\"),\n});\nconst FileConversionInQueueSchema = Schema.Struct({\n id: Schema.Int,\n percent_done: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n status: Schema.Literal(\"IN_QUEUE\"),\n});\nconst FileConversionConvertingSchema = Schema.Struct({\n id: Schema.Int,\n percent_done: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"CONVERTING\"),\n});\nconst FileConversionCompletedSchema = Schema.Struct({\n id: Schema.Int,\n percent_done: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"COMPLETED\"),\n});\nconst FileConversionErrorSchema = Schema.Struct({\n id: Schema.Int,\n status: Schema.Literal(\"ERROR\"),\n});\nexport const FileConversionStatusSchema = Schema.Union([\n FileConversionNotAvailableSchema,\n FileConversionInQueueSchema,\n FileConversionConvertingSchema,\n FileConversionCompletedSchema,\n FileConversionErrorSchema,\n]);\nconst FileConversionStatusEnvelopeSchema = Schema.Struct({\n mp4: FileConversionStatusSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst FilesBulkConvertEnvelopeSchema = Schema.Struct({\n count: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n});\nconst ActiveConversionFields = {\n name: Schema.String,\n};\nexport const FileActiveConversionSchema = Schema.Union([\n FileConversionNotAvailableSchema.pipe(Schema.fieldsAssign(ActiveConversionFields)),\n FileConversionInQueueSchema.pipe(Schema.fieldsAssign(ActiveConversionFields)),\n FileConversionConvertingSchema.pipe(Schema.fieldsAssign(ActiveConversionFields)),\n FileConversionCompletedSchema.pipe(Schema.fieldsAssign(ActiveConversionFields)),\n FileConversionErrorSchema.pipe(Schema.fieldsAssign(ActiveConversionFields)),\n]);\nconst FileActiveConversionsEnvelopeSchema = Schema.Struct({\n mp4s: Schema.Array(FileActiveConversionSchema),\n});\nexport const FileSubtitleSchema = Schema.Struct({\n format: Schema.String,\n key: Schema.String,\n language: Schema.String,\n language_code: Schema.String,\n name: Schema.String,\n source: Schema.String,\n url: Schema.String,\n});\nconst FileSubtitlesEnvelopeSchema = Schema.Struct({\n default: Schema.NullOr(Schema.String),\n subtitles: Schema.Array(FileSubtitleSchema),\n});\nconst FileDeleteResultEnvelopeSchema = Schema.Struct({\n cursor: Schema.NullOr(Schema.String),\n skipped: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n});\nexport const FilesMoveErrorSchema = Schema.Struct({\n error_type: Schema.String,\n id: Schema.Int,\n name: Schema.NullOr(Schema.String),\n status_code: Schema.Int,\n});\nconst FilesMoveEnvelopeSchema = Schema.Struct({\n errors: Schema.Array(FilesMoveErrorSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport const FileExtractionStatusSchema = Schema.Literals([\n \"ERROR\",\n \"EXTRACTED\",\n \"EXTRACTING\",\n \"NEW\",\n \"PASSWORD\",\n \"PASSWORD_OBTAINED\",\n \"SENT_TO_QUEUE\",\n]);\nexport const FileExtractionSchema = Schema.Struct({\n files: Schema.Array(Schema.Int),\n id: Schema.Int,\n message: Schema.NullOr(Schema.String),\n name: Schema.String,\n num_parts: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: FileExtractionStatusSchema,\n});\nconst FileExtractionsEnvelopeSchema = Schema.Struct({\n extractions: Schema.Array(FileExtractionSchema),\n status: Schema.optional(Schema.Literal(\"OK\")),\n});\nconst FilesBulkSelectionSchema = Schema.Struct({\n cursor: Schema.optional(NonEmptyStringSchema),\n excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n ids: Schema.optional(Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1))),\n}).check(\n Schema.makeFilter((input) => input.cursor !== undefined || input.ids !== undefined, {\n expected: \"a non-empty cursor or file ID selection\",\n }),\n);\nconst FilesDeleteOptionsSchema = Schema.Struct({\n ignoreFileOwner: Schema.optional(Schema.Boolean),\n partialDelete: Schema.optional(Schema.Boolean),\n skipTrash: Schema.optional(Schema.Boolean),\n});\nconst FilesSelectionDeleteOptionsSchema = Schema.Struct({\n partialDelete: Schema.optional(Schema.Boolean),\n skipTrash: Schema.optional(Schema.Boolean),\n});\nconst FilesIdsInputSchema = Schema.Array(PositiveFileIdSchema).check(Schema.isMinLength(1));\nconst FilesMoveInputSchema = Schema.Struct({\n ids: FilesIdsInputSchema,\n parentId: NonNegativeFileIdSchema,\n});\nconst FilesMoveSelectionInputSchema = Schema.Struct({\n parentId: NonNegativeFileIdSchema,\n selection: FilesBulkSelectionSchema,\n});\nconst FilesWatchStatusInputSchema = makeCursorSelectionSchema(\"ids\", \"excludeIds\", {\n watched: Schema.Boolean,\n});\nconst FilesExtractInputSchema = makeCursorSelectionSchema(\"ids\", \"excludeIds\", {\n password: Schema.optional(NonEmptyStringSchema),\n});\nconst FileUploadInputSchema = Schema.Struct({\n file: Schema.instanceOf(Blob),\n fileName: Schema.optional(NonEmptyStringSchema),\n parentId: Schema.optional(NonNegativeFileIdSchema),\n});\nconst FileUploadOptionsSchema = Schema.Struct({\n oauthToken: Schema.optional(NonEmptyStringSchema),\n});\nconst FileDirectAccessOptionsSchema = Schema.Struct({\n oauthToken: Schema.optional(NonEmptyStringSchema),\n useTunnel: Schema.optional(Schema.Boolean),\n});\nconst FileApiDownloadUrlOptionsSchema = FileDirectAccessOptionsSchema.pipe(\n Schema.fieldsAssign({ name: Schema.optional(NonEmptyStringSchema) }),\n);\nconst FileApiMp4DownloadUrlOptionsSchema = FileDirectAccessOptionsSchema.pipe(\n Schema.fieldsAssign({\n convert: Schema.optional(Schema.Boolean),\n name: Schema.optional(NonEmptyStringSchema),\n }),\n);\nconst FileHlsStreamUrlOptionsSchema = Schema.Struct({\n maxSubtitleCount: Schema.optional(PositiveIntegerSchema),\n oauthToken: Schema.optional(NonEmptyStringSchema),\n playOriginal: Schema.optional(Schema.Boolean),\n subtitleLanguages: Schema.optional(\n Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1)),\n ),\n});\nconst FileHlsMasterPlaylistOptionsSchema = Schema.Struct({\n maxSubtitleCount: Schema.optional(PositiveIntegerSchema),\n playOriginal: Schema.optional(Schema.Boolean),\n subtitleLanguages: Schema.optional(\n Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1)),\n ),\n});\nconst FileXspfPlaylistUrlOptionsSchema = Schema.Struct({\n oauthToken: Schema.optional(NonEmptyStringSchema),\n});\nconst FilesNextFileSchema = Schema.Struct({\n id: Schema.Int,\n name: Schema.String,\n parent_id: Schema.NullOr(Schema.Int),\n});\nconst FilesNextFileEnvelopeSchema = Schema.Struct({\n next_file: FilesNextFileSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst FilesNextVideoEnvelopeSchema = Schema.Struct({\n next_video: FilesNextFileSchema,\n status: Schema.Literal(\"OK\"),\n});\nexport type FileType = Schema.Schema.Type<typeof FileTypeSchema>;\nexport type FolderType = Schema.Schema.Type<typeof FolderTypeSchema>;\nexport type FileSort = Schema.Schema.Type<typeof FileSortSchema>;\nexport type FileSetSortInput = Schema.Schema.Type<typeof FileSetSortInputSchema>;\nexport type FileCopyInput = Schema.Schema.Type<typeof FileCopyInputSchema>;\nexport type FileTouchInput = Schema.Schema.Type<typeof FileTouchInputSchema>;\nexport type FileMediaMetadata = Schema.Schema.Type<typeof FileMediaMetadataSchema>;\nexport type FileMediaInfo = Schema.Schema.Type<typeof FileMediaInfoSchema>;\nexport type FileBase = Schema.Schema.Type<typeof FileBaseSchema>;\nexport type FileBroad = Schema.Schema.Type<typeof FileBroadSchema>;\nexport type FileCore = FileBase;\nexport type FileVideoMetadata = FileMediaMetadata;\nexport type FileQuery = Schema.Schema.Type<typeof FileQuerySchema>;\nexport type FileGetChildInput = Schema.Schema.Type<typeof FileGetChildInputSchema>;\nexport type FilesListQuery = Schema.Schema.Type<typeof FilesListQuerySchema>;\nexport type FilesSearchQuery = Schema.Schema.Type<typeof FilesSearchQuerySchema>;\nexport type FileBreadcrumb = Schema.Schema.Type<typeof FileBreadcrumbSchema>;\nexport type FileListResponse = Schema.Schema.Type<typeof FilesListEnvelopeSchema>;\nexport type FileListContinuationResponse = Schema.Schema.Type<\n typeof FilesListContinueEnvelopeSchema\n>;\nexport type FileSearchResponse = Schema.Schema.Type<typeof FilesSearchEnvelopeSchema>;\nexport type FileCreateFolderInput = Schema.Schema.Type<typeof FileCreateFolderInputSchema>;\nexport type FileRenameInput = Schema.Schema.Type<typeof FileRenameInputSchema>;\nexport type FileStartFromSetInput = Schema.Schema.Type<typeof FileStartFromSetInputSchema>;\nexport type FileConversionStatus = Schema.Schema.Type<typeof FileConversionStatusSchema>;\nexport type FileActiveConversion = Schema.Schema.Type<typeof FileActiveConversionSchema>;\nexport type FileExtractionStatus = Schema.Schema.Type<typeof FileExtractionStatusSchema>;\nexport type FileExtraction = Schema.Schema.Type<typeof FileExtractionSchema>;\nexport type FileSubtitle = Schema.Schema.Type<typeof FileSubtitleSchema>;\nexport type FilesMoveError = Schema.Schema.Type<typeof FilesMoveErrorSchema>;\ntype FilesBulkSelectionShape = Schema.Schema.Type<typeof FilesBulkSelectionSchema>;\nexport type FilesBulkSelection =\n | (FilesBulkSelectionShape & { readonly cursor: string })\n | (FilesBulkSelectionShape & { readonly ids: ReadonlyArray<number> });\nexport type FileUploadTransfer = Schema.Schema.Type<typeof FileUploadTransferSchema>;\nexport type FileUploadEnvelope = Schema.Schema.Type<typeof FileUploadEnvelopeSchema>;\nexport type FileUploadResult =\n | {\n readonly type: \"file\";\n readonly file: FileBroad;\n }\n | {\n readonly type: \"transfer\";\n readonly transfer: FileUploadTransfer;\n };\nexport type FileDirectAccessOptions = {\n readonly oauthToken?: string;\n readonly useTunnel?: boolean;\n};\nexport type FileApiDownloadUrlOptions = FileDirectAccessOptions & {\n readonly name?: string;\n};\nexport type FileApiMp4DownloadUrlOptions = FileDirectAccessOptions & {\n readonly convert?: boolean;\n readonly name?: string;\n};\nexport type FileHlsMasterPlaylistOptions = Schema.Schema.Type<\n typeof FileHlsMasterPlaylistOptionsSchema\n>;\nexport type FileHlsStreamUrlOptions = {\n readonly maxSubtitleCount?: number;\n readonly oauthToken?: string;\n readonly playOriginal?: boolean;\n readonly subtitleLanguages?: ReadonlyArray<string>;\n};\nexport type FileXspfPlaylistUrlOptions = {\n readonly oauthToken?: string;\n};\nexport type FileUploadInput = {\n readonly file: Blob;\n readonly fileName?: string;\n readonly parentId?: number;\n};\nexport type FileUploadRequestDescriptor = {\n readonly body: FormData;\n readonly method: \"POST\";\n readonly url: string;\n};\nexport type FileResponseFor<TQuery extends FileQuery> = FileBase &\n (TQuery[\"stream_url\"] extends 1\n ? {\n readonly stream_url: string | null;\n }\n : {}) &\n (TQuery[\"mp4_status\"] extends 1\n ? {\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n }\n : {}) &\n (TQuery[\"mp4_stream_url\"] extends 1\n ?\n | {\n readonly is_mp4_available: true;\n readonly mp4_stream_url: string | null;\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n }\n | {\n readonly is_mp4_available: false;\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n }\n : {}) &\n (TQuery[\"video_metadata\"] extends 1\n ? TQuery[\"media_metadata\"] extends 1\n ? {}\n : {\n readonly video_metadata: FileMediaMetadata | null;\n }\n : {}) &\n (TQuery[\"media_metadata\"] extends 1\n ? {\n readonly media_metadata: FileMediaMetadata | null;\n }\n : {}) &\n (TQuery[\"codecs\"] extends 1\n ? {\n readonly content_type_and_codecs: string | null;\n }\n : {}) &\n (TQuery[\"media_info\"] extends 1\n ? {\n readonly media_info: FileMediaInfo | null;\n }\n : {});\nexport const QueryFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"query\",\n knownErrors: [\n { statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const ContinueFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"continue\",\n knownErrors: [\n { statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const GetFileErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"get\",\n knownErrors: [\n { statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const GetHlsMasterPlaylistErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"hlsMasterPlaylist\",\n knownErrors: [\n { errorType: \"INVALID_MEDIA\", statusCode: 400 as const },\n { errorType: \"MP4_NOT_FOUND\", statusCode: 400 as const },\n { errorType: \"MP4_NOT_READY\", statusCode: 400 as const },\n { statusCode: 400 as const },\n { statusCode: 402 as const },\n { statusCode: 404 as const },\n { errorType: \"FILE_NOT_READY\", statusCode: 503 as const },\n ],\n});\nexport const GetFileChildErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"getChild\",\n knownErrors: [\n { statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const CopyFileErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"copy\",\n knownErrors: [\n { errorType: \"NAME_ALREADY_EXIST\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const TouchFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"touch\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 403 as const },\n ],\n});\nexport const CanWriteFileErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"canWrite\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 402 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const SearchFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"search\",\n knownErrors: [\n { errorType: \"SEARCH_TOO_LONG_QUERY\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const CreateFolderErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"createFolder\",\n knownErrors: [\n { errorType: \"EMPTY_NAME\", statusCode: 400 as const },\n { errorType: \"SLASH_IN_NAME\", statusCode: 400 as const },\n { errorType: \"NAME_TOO_LONG\", statusCode: 400 as const },\n { errorType: \"NAME_ALREADY_EXIST\", statusCode: 400 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const RenameFileErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"rename\",\n knownErrors: [\n { errorType: \"EMPTY_NAME\", statusCode: 400 as const },\n { errorType: \"SLASH_IN_NAME\", statusCode: 400 as const },\n { errorType: \"NAME_TOO_LONG\", statusCode: 400 as const },\n { errorType: \"NAME_ALREADY_EXIST\", statusCode: 400 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const StartFromErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"startFrom\",\n knownErrors: [\n { errorType: \"FEATURE_DISABLED\", statusCode: 400 as const },\n { errorType: \"INVALID_MEDIA\", statusCode: 400 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const DownloadUrlErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"getDownloadUrl\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 402 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const FileMp4ErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"mp4\",\n knownErrors: [\n { errorType: \"INVALID_MEDIA\", statusCode: 400 as const },\n { errorType: \"MP4_NOT_FOUND\", statusCode: 400 as const },\n { errorType: \"NotFile\", statusCode: 400 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const FileSubtitlesErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"listSubtitles\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n { statusCode: 402 as const },\n ],\n});\nexport const FileActiveConversionsErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"listActiveConversions\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 402 as const },\n ],\n});\nexport const FileMp4MutationErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"manageMp4\",\n knownErrors: [\n { errorType: \"MP4_NOT_FOUND\", statusCode: 400 as const },\n { errorType: \"NotFile\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 402 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const FileExtractionsErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"extract\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 402 as const },\n ],\n});\nexport const FileWatchStatusErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"setWatchStatus\",\n knownErrors: [\n { errorType: \"FEATURE_DISABLED\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const FileUploadErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"upload\",\n knownErrors: [\n { errorType: \"Unauthorized\", statusCode: 401 as const },\n { statusCode: 401 as const },\n { statusCode: 402 as const },\n { statusCode: 429 as const },\n ],\n});\nexport type QueryFilesError = PutioOperationFailure<typeof QueryFilesErrorSpec>;\nexport type ContinueFilesError = PutioOperationFailure<typeof ContinueFilesErrorSpec>;\nexport type GetFileError = PutioOperationFailure<typeof GetFileErrorSpec>;\nexport type GetHlsMasterPlaylistError = PutioOperationFailure<typeof GetHlsMasterPlaylistErrorSpec>;\nexport type GetFileChildError = PutioOperationFailure<typeof GetFileChildErrorSpec>;\nexport type CopyFileError = PutioOperationFailure<typeof CopyFileErrorSpec>;\nexport type TouchFilesError = PutioOperationFailure<typeof TouchFilesErrorSpec>;\nexport type CanWriteFileError = PutioOperationFailure<typeof CanWriteFileErrorSpec>;\nexport type SearchFilesError = PutioOperationFailure<typeof SearchFilesErrorSpec>;\nexport type CreateFolderError = PutioOperationFailure<typeof CreateFolderErrorSpec>;\nexport type RenameFileError = PutioOperationFailure<typeof RenameFileErrorSpec>;\nexport type StartFromError = PutioOperationFailure<typeof StartFromErrorSpec>;\nexport type DownloadUrlError = PutioOperationFailure<typeof DownloadUrlErrorSpec>;\nexport type FileMp4Error = PutioOperationFailure<typeof FileMp4ErrorSpec>;\nexport type FileSubtitlesError = PutioOperationFailure<typeof FileSubtitlesErrorSpec>;\nexport type FileActiveConversionsError = PutioOperationFailure<\n typeof FileActiveConversionsErrorSpec\n>;\nexport type FileMp4MutationError = PutioOperationFailure<typeof FileMp4MutationErrorSpec>;\nexport type FileExtractionsError = PutioOperationFailure<typeof FileExtractionsErrorSpec>;\nexport type FileWatchStatusError = PutioOperationFailure<typeof FileWatchStatusErrorSpec>;\nexport type FileUploadError = PutioOperationFailure<typeof FileUploadErrorSpec>;\nconst missingFieldError = (field: string) =>\n new PutioValidationError({\n cause: `Expected put.io to include \"${field}\" because it was requested`,\n });\nconst failMissingField = (field: string): Effect.Effect<never, PutioValidationError> =>\n Effect.fail(missingFieldError(field));\nconst widenValidationError = <A, E, R>(\n effect: Effect.Effect<A, E, R>,\n): Effect.Effect<A, E | PutioValidationError, R> => effect;\nconst hasStreamUrl = (\n value: FileBroad,\n): value is FileBroad & {\n readonly stream_url: string | null;\n} => \"stream_url\" in value;\nconst hasMp4StreamUrl = (\n value: FileBroad,\n): value is FileBroad & {\n readonly mp4_stream_url: string | null;\n} => \"mp4_stream_url\" in value;\nconst hasMp4StreamUrlWhenAvailable = (\n value: FileBroad,\n): value is FileBroad &\n (\n | {\n readonly is_mp4_available: true;\n readonly mp4_stream_url: string | null;\n }\n | {\n readonly is_mp4_available: false;\n }\n ) => !value.is_mp4_available || hasMp4StreamUrl(value);\nconst hasMp4StatusFields = (\n value: FileBroad,\n): value is FileBroad & {\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n} => \"mp4_size\" in value && typeof value.need_convert === \"boolean\";\nconst hasVideoMetadata = (\n value: FileBroad,\n): value is FileBroad & {\n readonly video_metadata: FileMediaMetadata | null;\n} => \"video_metadata\" in value;\nconst hasMediaMetadata = (\n value: FileBroad,\n): value is FileBroad & {\n readonly media_metadata: FileMediaMetadata | null;\n} => \"media_metadata\" in value;\nconst hasCodecs = (\n value: FileBroad,\n): value is FileBroad & {\n readonly content_type_and_codecs: string | null;\n} => \"content_type_and_codecs\" in value;\nconst hasMediaInfo = (\n value: FileBroad,\n): value is FileBroad & {\n readonly media_info: FileMediaInfo | null;\n} => \"media_info\" in value;\nconst useTunnelToQuery = (useTunnel?: boolean) =>\n useTunnel === false\n ? {\n notunnel: 1,\n }\n : {};\nconst resolveRouteContext = (\n oauthToken?: string,\n): Effect.Effect<\n {\n readonly config: PutioSdkConfigShape;\n readonly oauthToken: string;\n },\n PutioSdkError,\n PutioSdkConfig\n> =>\n Effect.gen(function* () {\n const config = yield* PutioSdkConfig;\n const resolvedOauthToken = oauthToken ?? config.accessToken;\n if (resolvedOauthToken) {\n return {\n config,\n oauthToken: resolvedOauthToken,\n };\n }\n return yield* Effect.fail(\n mapConfigurationError(\n \"This helper requires an oauth token, but neither an override nor PutioSdkConfig.accessToken was provided\",\n ),\n );\n });\nconst normalizeFileName = (name: string) => encodeURIComponent(name);\nconst toUploadResult = (value: FileUploadEnvelope): FileUploadResult => {\n if (value.file) {\n return {\n file: value.file,\n type: \"file\",\n };\n }\n if (value.transfer) {\n return {\n transfer: value.transfer,\n type: \"transfer\",\n };\n }\n throw new PutioValidationError({\n cause: 'Expected put.io upload response to contain either \"file\" or \"transfer\"',\n });\n};\nexport const buildFileApiDownloadUrl = (\n baseUrl: string | URL,\n fileId: number,\n options: FileApiDownloadUrlOptions = {},\n): string =>\n buildPutioUrl(\n baseUrl,\n options.name\n ? `/v2/files/${encodePathSegment(fileId)}/download/${normalizeFileName(options.name)}`\n : `/v2/files/${encodePathSegment(fileId)}/download`,\n {\n ...useTunnelToQuery(options.useTunnel),\n oauth_token: options.oauthToken,\n },\n );\nexport const buildFileApiContentUrl = (\n baseUrl: string | URL,\n fileId: number,\n options: FileDirectAccessOptions = {},\n): string =>\n buildPutioUrl(baseUrl, `/v2/files/${encodePathSegment(fileId)}/stream`, {\n ...useTunnelToQuery(options.useTunnel),\n oauth_token: options.oauthToken,\n });\nexport const buildFileApiMp4DownloadUrl = (\n baseUrl: string | URL,\n fileId: number,\n options: FileApiMp4DownloadUrlOptions = {},\n): string =>\n buildPutioUrl(\n baseUrl,\n options.name\n ? `/v2/files/${encodePathSegment(fileId)}/mp4/download/${normalizeFileName(options.name)}`\n : `/v2/files/${encodePathSegment(fileId)}/mp4/download`,\n {\n ...useTunnelToQuery(options.useTunnel),\n convert: options.convert ? 1 : undefined,\n oauth_token: options.oauthToken,\n },\n );\nexport const buildFileHlsStreamUrl = (\n baseUrl: string | URL,\n fileId: number,\n options: FileHlsStreamUrlOptions = {},\n): string =>\n buildPutioUrl(baseUrl, `/v2/files/${encodePathSegment(fileId)}/hls/media.m3u8`, {\n max_subtitle_count: options.maxSubtitleCount,\n oauth_token: options.oauthToken,\n original:\n typeof options.playOriginal === \"boolean\" ? (options.playOriginal ? 1 : 0) : undefined,\n subtitle_languages: joinCsv(options.subtitleLanguages),\n });\nexport const buildFileXspfPlaylistUrl = (\n baseUrl: string | URL,\n fileId: number,\n options: FileXspfPlaylistUrlOptions = {},\n): string =>\n buildPutioUrl(baseUrl, `/v2/files/${encodePathSegment(fileId)}/xspf`, {\n oauth_token: options.oauthToken,\n });\nexport const createFileUploadFormData = (input: FileUploadInput): FormData => {\n const formData = new FormData();\n formData.append(\"file\", input.file);\n if (input.fileName) {\n formData.append(\"filename\", input.fileName);\n }\n if (input.parentId !== undefined) {\n formData.append(\"parent_id\", String(input.parentId));\n }\n return formData;\n};\nconst ensureFileQueryFields = <TQuery extends FileQuery, E>(\n effect: Effect.Effect<FileBroad, E, PutioSdkContext>,\n query: TQuery,\n): Effect.Effect<FileResponseFor<TQuery>, E | PutioValidationError, PutioSdkContext> =>\n Effect.gen(function* () {\n const file = yield* widenValidationError(effect);\n if (query.stream_url === 1 && !hasStreamUrl(file)) {\n return yield* failMissingField(\"stream_url\");\n }\n if ((query.mp4_status === 1 || query.mp4_stream_url === 1) && !hasMp4StatusFields(file)) {\n return yield* failMissingField(\n query.mp4_stream_url === 1 ? \"mp4_size/need_convert\" : \"mp4_size\",\n );\n }\n if (query.mp4_stream_url === 1 && !hasMp4StreamUrlWhenAvailable(file)) {\n return yield* failMissingField(\"mp4_stream_url\");\n }\n if (query.video_metadata === 1 && query.media_metadata !== 1 && !hasVideoMetadata(file)) {\n return yield* failMissingField(\"video_metadata\");\n }\n if (query.media_metadata === 1 && !hasMediaMetadata(file)) {\n return yield* failMissingField(\"media_metadata\");\n }\n if (query.codecs === 1 && !hasCodecs(file)) {\n return yield* failMissingField(\"content_type_and_codecs\");\n }\n if (query.media_info === 1 && !hasMediaInfo(file)) {\n return yield* failMissingField(\"media_info\");\n }\n // Requested-field checks above turn the decoded broad payload into the\n // query-conditioned response contract the rest of the SDK can trust.\n return file as FileResponseFor<TQuery>;\n });\nexport const queryFiles = (\n parent: number | \"friends\",\n query: FilesListQuery = {},\n): Effect.Effect<FileListResponse, QueryFilesError, PutioSdkContext> =>\n decodeAndRun(FilesListInputSchema, { parent, query }, (decodedInput) =>\n requestJson(FilesListEnvelopeSchema, {\n method: \"GET\",\n path:\n decodedInput.parent === \"friends\"\n ? \"/v2/files/list/items-shared-with-you\"\n : \"/v2/files/list\",\n query:\n decodedInput.parent === \"friends\"\n ? decodedInput.query\n : {\n ...decodedInput.query,\n parent_id: decodedInput.parent,\n },\n }),\n ).pipe(withOperationErrors(QueryFilesErrorSpec));\nexport const continueFiles = (\n cursor: string,\n query: {\n readonly per_page?: number;\n } = {},\n): Effect.Effect<FileListContinuationResponse, ContinueFilesError, PutioSdkContext> =>\n decodeAndRun(FilesContinueInputSchema, { cursor, query }, (decodedInput) =>\n requestJson(FilesListContinueEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n cursor: decodedInput.cursor,\n },\n },\n method: \"POST\",\n path: \"/v2/files/list/continue\",\n query: decodedInput.query,\n }),\n ).pipe(withOperationErrors(ContinueFilesErrorSpec));\nexport function getFile(input: {\n readonly id: number;\n}): Effect.Effect<FileCore, GetFileError | PutioValidationError, PutioSdkContext>;\nexport function getFile<TQuery extends FileQuery>(input: {\n readonly id: number;\n readonly query: TQuery;\n}): Effect.Effect<FileResponseFor<TQuery>, GetFileError | PutioValidationError, PutioSdkContext>;\nexport function getFile(input: { readonly id: number; readonly query?: FileQuery | null }) {\n return decodeAndRun(FileGetInputSchema, input, (decodedInput) => {\n const effect = requestJson(FileEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedInput.id)}`,\n query: decodedInput.query,\n }).pipe(selectJsonField(\"file\"), withOperationErrors(GetFileErrorSpec));\n return decodedInput.query === undefined\n ? effect\n : ensureFileQueryFields(effect, decodedInput.query);\n });\n}\nexport function getFileChild(input: {\n readonly name: string;\n readonly parentId: number;\n}): Effect.Effect<FileCore, GetFileChildError | PutioValidationError, PutioSdkContext>;\nexport function getFileChild<TQuery extends FileQuery>(input: {\n readonly name: string;\n readonly parentId: number;\n readonly query: TQuery;\n}): Effect.Effect<\n FileResponseFor<TQuery>,\n GetFileChildError | PutioValidationError,\n PutioSdkContext\n>;\nexport function getFileChild(input: FileGetChildInput) {\n return Schema.decodeUnknownEffect(FileGetChildInputSchema, { onExcessProperty: \"error\" })(\n input,\n ).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) => {\n const effect = requestJson(FileEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedInput.parentId)}/child`,\n query: {\n ...decodedInput.query,\n name: decodedInput.name,\n },\n }).pipe(selectJsonField(\"file\"), withOperationErrors(GetFileChildErrorSpec));\n return decodedInput.query === undefined\n ? effect\n : ensureFileQueryFields(effect, decodedInput.query);\n }),\n );\n}\nexport const copyFile = (\n input: FileCopyInput,\n): Effect.Effect<FileBroad, CopyFileError | PutioValidationError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(FileCopyInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(FileEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n file_id: decodedInput.fileId,\n name: decodedInput.name,\n parent_id: decodedInput.parentId,\n },\n },\n method: \"POST\",\n path: \"/v2/files/copy\",\n }),\n ),\n selectJsonField(\"file\"),\n withOperationErrors(CopyFileErrorSpec),\n );\nexport const touchFiles = (\n input: FileTouchInput,\n): Effect.Effect<void, TouchFilesError | PutioValidationError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(FileTouchInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n file_ids: joinCsv(decodedInput.fileIds),\n updated_at: decodedInput.updatedAt?.toISOString(),\n },\n },\n method: \"POST\",\n path: \"/v2/files/touch\",\n }),\n ),\n Effect.asVoid,\n withOperationErrors(TouchFilesErrorSpec),\n );\nexport const canWriteFile = (\n fileId: number,\n): Effect.Effect<number, CanWriteFileError | PutioValidationError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveFileIdSchema)(fileId).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedFileId) =>\n requestJson(FileCanWriteEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/can-write`,\n }),\n ),\n selectJsonField(\"user_id\"),\n withOperationErrors(CanWriteFileErrorSpec),\n );\nexport const searchFiles = (\n query: FilesSearchQuery,\n): Effect.Effect<FileSearchResponse, SearchFilesError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(FilesSearchQuerySchema, { onExcessProperty: \"error\" })(query).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedQuery) =>\n requestJson(FilesSearchEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/files/search\",\n query: decodedQuery,\n }),\n ),\n withOperationErrors(SearchFilesErrorSpec),\n );\nexport const continueSearch = (\n cursor: string,\n query: {\n readonly per_page?: number;\n } = {},\n): Effect.Effect<FileSearchResponse, SearchFilesError, PutioSdkContext> =>\n decodeAndRun(FilesSearchContinueInputSchema, { cursor, query }, (decodedInput) =>\n requestJson(FilesSearchEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n cursor: decodedInput.cursor,\n },\n },\n method: \"POST\",\n path: \"/v2/files/search/continue\",\n query: decodedInput.query,\n }),\n ).pipe(withOperationErrors(SearchFilesErrorSpec));\nexport const setFileSort = (\n input: FileSetSortInput,\n): Effect.Effect<void, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(FileSetSortInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n file_id: decodedInput.fileId,\n sort_by: decodedInput.sortBy,\n },\n },\n method: \"POST\",\n path: \"/v2/files/set-sort-by\",\n }),\n ),\n Effect.asVoid,\n );\nexport const resetFileSortSettings = (): Effect.Effect<void, PutioSdkError, PutioSdkContext> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/files/remove-sort-by-settings\",\n }).pipe(Effect.asVoid);\nexport const createFolder = (\n input: FileCreateFolderInput,\n): Effect.Effect<FileBroad, CreateFolderError, PutioSdkContext> =>\n decodeAndRun(FileCreateFolderInputSchema, input, (decodedInput) =>\n requestJson(FileEnvelopeSchema, {\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/files/create-folder\",\n }),\n ).pipe(selectJsonField(\"file\"), withOperationErrors(CreateFolderErrorSpec));\nexport const renameFile = (\n input: FileRenameInput,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, RenameFileError, PutioSdkContext> =>\n decodeAndRun(FileRenameInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/files/rename\",\n }),\n ).pipe(withOperationErrors(RenameFileErrorSpec));\nexport const deleteFiles = (\n ids: ReadonlyArray<number>,\n options: {\n readonly ignoreFileOwner?: boolean;\n readonly partialDelete?: boolean;\n readonly skipTrash?: boolean;\n } = {},\n): Effect.Effect<\n Schema.Schema.Type<typeof FileDeleteResultEnvelopeSchema>,\n PutioSdkError,\n PutioSdkContext\n> =>\n decodeAndRun(\n Schema.Struct({ ids: FilesIdsInputSchema, options: FilesDeleteOptionsSchema }),\n { ids, options },\n (decodedInput) =>\n requestJson(FileDeleteResultEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n file_ids: joinCsv(decodedInput.ids),\n },\n },\n method: \"POST\",\n path: \"/v2/files/delete\",\n query: {\n partial_delete: decodedInput.options.partialDelete,\n skip_nonexistents: true,\n skip_owner_check: decodedInput.options.ignoreFileOwner,\n skip_trash: decodedInput.options.skipTrash,\n },\n }),\n );\nexport const deleteFileSelection = (\n selection: FilesBulkSelection,\n options: {\n readonly partialDelete?: boolean;\n readonly skipTrash?: boolean;\n } = {},\n): Effect.Effect<\n Schema.Schema.Type<typeof FileDeleteResultEnvelopeSchema>,\n PutioSdkError,\n PutioSdkContext\n> =>\n decodeAndRun(\n Schema.Struct({\n options: FilesSelectionDeleteOptionsSchema,\n selection: FilesBulkSelectionSchema,\n }),\n { options, selection },\n (decodedInput) =>\n requestJson(FileDeleteResultEnvelopeSchema, {\n body: {\n type: \"form\",\n value: toCursorSelectionForm(decodedInput.selection),\n },\n method: \"POST\",\n path: \"/v2/files/delete\",\n query: {\n partial_delete: decodedInput.options.partialDelete,\n skip_nonexistents: true,\n skip_trash: decodedInput.options.skipTrash,\n },\n }),\n );\nexport const moveFiles = (\n ids: ReadonlyArray<number>,\n parentId: number,\n): Effect.Effect<ReadonlyArray<FilesMoveError>, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(FilesMoveInputSchema, { ids, parentId }, (decodedInput) =>\n requestJson(FilesMoveEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n file_ids: joinCsv(decodedInput.ids),\n parent_id: decodedInput.parentId,\n },\n },\n method: \"POST\",\n path: \"/v2/files/move\",\n }),\n ).pipe(selectJsonField(\"errors\"));\nexport const moveFileSelection = (\n selection: FilesBulkSelection,\n parentId: number,\n): Effect.Effect<ReadonlyArray<FilesMoveError>, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(FilesMoveSelectionInputSchema, { parentId, selection }, (decodedInput) =>\n requestJson(FilesMoveEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm(decodedInput.selection),\n parent_id: decodedInput.parentId,\n },\n },\n method: \"POST\",\n path: \"/v2/files/move\",\n }),\n ).pipe(selectJsonField(\"errors\"));\nexport const getStartFrom = (\n fileId: number,\n): Effect.Effect<number, StartFromError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(FileStartFromEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/start-from`,\n }),\n ).pipe(selectJsonField(\"start_from\"), withOperationErrors(StartFromErrorSpec));\nexport const getDownloadUrl = (\n fileId: number,\n): Effect.Effect<string, DownloadUrlError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(FileDownloadUrlEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/url`,\n }),\n ).pipe(selectJsonField(\"url\"), withOperationErrors(DownloadUrlErrorSpec));\nexport const getApiDownloadUrl = (\n fileId: number,\n options: FileApiDownloadUrlOptions = {},\n): Effect.Effect<string, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileApiDownloadUrlOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) =>\n buildFileApiDownloadUrl(config.baseUrl ?? \"https://api.put.io\", decoded.fileId, {\n ...decoded.options,\n oauthToken,\n }),\n ),\n ),\n );\nexport const getApiContentUrl = (\n fileId: number,\n options: FileDirectAccessOptions = {},\n): Effect.Effect<string, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileDirectAccessOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) =>\n buildFileApiContentUrl(config.baseUrl ?? \"https://api.put.io\", decoded.fileId, {\n ...decoded.options,\n oauthToken,\n }),\n ),\n ),\n );\nexport const getApiMp4DownloadUrl = (\n fileId: number,\n options: FileApiMp4DownloadUrlOptions = {},\n): Effect.Effect<string, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileApiMp4DownloadUrlOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) =>\n buildFileApiMp4DownloadUrl(config.baseUrl ?? \"https://api.put.io\", decoded.fileId, {\n ...decoded.options,\n oauthToken,\n }),\n ),\n ),\n );\nexport const getHlsStreamUrl = (\n fileId: number,\n options: FileHlsStreamUrlOptions = {},\n): Effect.Effect<string, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileHlsStreamUrlOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) =>\n buildFileHlsStreamUrl(config.baseUrl ?? \"https://api.put.io\", decoded.fileId, {\n ...decoded.options,\n oauthToken,\n }),\n ),\n ),\n );\n/**\n * Fetches the HLS master playlist the player would load, so callers can\n * inspect the served variant's CODECS, VIDEO-RANGE, and rendition set without\n * handling the tokenized URL. `playOriginal` selects the original file over\n * the MP4 conversion.\n */\nexport const getHlsMasterPlaylist = (\n fileId: number,\n options: FileHlsMasterPlaylistOptions = {},\n): Effect.Effect<string, GetHlsMasterPlaylistError | PutioValidationError, PutioSdkContext> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileHlsMasterPlaylistOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n requestText({\n headers: { accept: \"application/vnd.apple.mpegurl, application/x-mpegURL, */*\" },\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decoded.fileId)}/hls/media.m3u8`,\n query: {\n max_subtitle_count: decoded.options.maxSubtitleCount,\n original:\n typeof decoded.options.playOriginal === \"boolean\"\n ? decoded.options.playOriginal\n ? 1\n : 0\n : undefined,\n subtitle_languages: joinCsv(decoded.options.subtitleLanguages),\n },\n }),\n ).pipe(withOperationErrors(GetHlsMasterPlaylistErrorSpec));\nexport const getXspfPlaylistUrl = (\n fileId: number,\n options: FileXspfPlaylistUrlOptions = {},\n): Effect.Effect<string, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileXspfPlaylistUrlOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) =>\n buildFileXspfPlaylistUrl(config.baseUrl ?? \"https://api.put.io\", decoded.fileId, {\n oauthToken,\n }),\n ),\n ),\n );\nexport const listFileSubtitles = (\n fileId: number,\n options: {\n readonly languages?: ReadonlyArray<string>;\n } = {},\n): Effect.Effect<\n {\n readonly default: string | null;\n readonly subtitles: ReadonlyArray<FileSubtitle>;\n },\n FileSubtitlesError,\n PutioSdkContext\n> =>\n decodeAndRun(FileSubtitlesInputSchema, { fileId, options }, (decodedInput) =>\n requestJson(FileSubtitlesEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedInput.fileId)}/subtitles`,\n query: decodedInput.options.languages\n ? {\n languages: joinCsv(decodedInput.options.languages),\n }\n : undefined,\n }),\n ).pipe(withOperationErrors(FileSubtitlesErrorSpec));\nexport const setStartFrom = (\n input: FileStartFromSetInput,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, StartFromError, PutioSdkContext> =>\n decodeAndRun(FileStartFromSetInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n time: decodedInput.time,\n },\n },\n method: \"POST\",\n path: `/v2/files/${encodePathSegment(decodedInput.file_id)}/start-from`,\n }),\n ).pipe(withOperationErrors(StartFromErrorSpec));\nexport const resetStartFrom = (\n fileId: number,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, StartFromError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/start-from/delete`,\n }),\n ).pipe(withOperationErrors(StartFromErrorSpec));\nexport const getMp4Status = (\n fileId: number,\n): Effect.Effect<FileConversionStatus, FileMp4Error, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(FileConversionStatusEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/mp4`,\n }),\n ).pipe(selectJsonField(\"mp4\"), withOperationErrors(FileMp4ErrorSpec));\nexport const convertFileToMp4 = (\n fileId: number,\n): Effect.Effect<FileConversionStatus, FileMp4Error, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(FileConversionStatusEnvelopeSchema, {\n method: \"POST\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/mp4`,\n }),\n ).pipe(selectJsonField(\"mp4\"), withOperationErrors(FileMp4ErrorSpec));\nexport const deleteFileMp4 = (\n fileId: number,\n): Effect.Effect<void, FileMp4MutationError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestVoid({\n method: \"DELETE\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/mp4`,\n }),\n ).pipe(withOperationErrors(FileMp4MutationErrorSpec));\nexport const putMp4ToMyFiles = (\n fileId: number,\n): Effect.Effect<void, FileMp4MutationError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestVoid({\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/put-mp4-to-my-folders`,\n }),\n ).pipe(withOperationErrors(FileMp4MutationErrorSpec));\nexport const convertFilesToMp4 = (\n ids: ReadonlyArray<number>,\n): Effect.Effect<number, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(FilesIdsInputSchema, ids, (decodedIds) =>\n requestJson(FilesBulkConvertEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n file_ids: joinCsv(decodedIds),\n },\n },\n method: \"POST\",\n path: \"/v2/files/convert_mp4\",\n }),\n ).pipe(selectJsonField(\"count\"));\nexport const convertFileSelectionToMp4 = (\n selection: FilesBulkSelection,\n): Effect.Effect<number, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(FilesBulkSelectionSchema, selection, (decodedSelection) =>\n requestJson(FilesBulkConvertEnvelopeSchema, {\n body: {\n type: \"form\",\n value: toCursorSelectionForm(decodedSelection),\n },\n method: \"POST\",\n path: \"/v2/files/convert_mp4\",\n }),\n ).pipe(selectJsonField(\"count\"));\nexport const listActiveMp4Conversions = (): Effect.Effect<\n ReadonlyArray<FileActiveConversion>,\n FileActiveConversionsError,\n PutioSdkContext\n> =>\n requestJson(FileActiveConversionsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/mp4/queue\",\n }).pipe(selectJsonField(\"mp4s\"), withOperationErrors(FileActiveConversionsErrorSpec));\nexport const setFilesWatchStatus = (\n selection: FilesBulkSelection & {\n readonly watched: boolean;\n },\n): Effect.Effect<void, FileWatchStatusError, PutioSdkContext> =>\n decodeAndRun(FilesWatchStatusInputSchema, selection, (decodedSelection) =>\n requestVoid({\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm(decodedSelection),\n watched: decodedSelection.watched,\n },\n },\n method: \"POST\",\n path: \"/v2/files/watch-status\",\n }),\n ).pipe(withOperationErrors(FileWatchStatusErrorSpec));\nexport const extractFiles = (\n selection: FilesBulkSelection & {\n readonly password?: string;\n },\n): Effect.Effect<ReadonlyArray<FileExtraction>, FileExtractionsError, PutioSdkContext> =>\n decodeAndRun(FilesExtractInputSchema, selection, (decodedSelection) =>\n requestJson(FileExtractionsEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm(decodedSelection, \"user_file_ids\"),\n password: decodedSelection.password,\n },\n },\n method: \"POST\",\n path: \"/v2/files/extract\",\n }),\n ).pipe(selectJsonField(\"extractions\"), withOperationErrors(FileExtractionsErrorSpec));\nexport const listFileExtractions = (): Effect.Effect<\n ReadonlyArray<FileExtraction>,\n FileExtractionsError,\n PutioSdkContext\n> =>\n requestJson(FileExtractionsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/files/extract\",\n }).pipe(selectJsonField(\"extractions\"), withOperationErrors(FileExtractionsErrorSpec));\nexport const deleteFileExtraction = (\n extractionId: number,\n): Effect.Effect<void, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(PositiveIntegerSchema, extractionId, (decodedExtractionId) =>\n requestVoid({\n method: \"DELETE\",\n path: `/v2/files/extract/${encodePathSegment(decodedExtractionId)}`,\n }),\n );\nexport const findNextFile = (\n fileId: number,\n fileType: FileType,\n): Effect.Effect<Schema.Schema.Type<typeof FilesNextFileSchema>, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(FileNextInputSchema, { fileId, fileType }, (decodedInput) =>\n requestJson(FilesNextFileEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedInput.fileId)}/next-file`,\n query: {\n file_type: decodedInput.fileType,\n },\n }),\n ).pipe(selectJsonField(\"next_file\"));\nexport const findNextVideo = (\n fileId: number,\n): Effect.Effect<Schema.Schema.Type<typeof FilesNextFileSchema>, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(FilesNextVideoEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/next-video`,\n }),\n ).pipe(selectJsonField(\"next_video\"));\nexport const createFileUploadRequest = (\n input: FileUploadInput,\n options: {\n readonly oauthToken?: string;\n } = {},\n): Effect.Effect<FileUploadRequestDescriptor, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({ input: FileUploadInputSchema, options: FileUploadOptionsSchema }),\n { input, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) => ({\n body: createFileUploadFormData(decoded.input),\n method: \"POST\" as const,\n url: buildPutioUrl(config.uploadBaseUrl ?? \"https://upload.put.io\", \"/v2/files/upload\", {\n oauth_token: oauthToken,\n }),\n })),\n ),\n );\nexport const uploadFile = (\n input: FileUploadInput,\n options: {\n readonly oauthToken?: string;\n } = {},\n): Effect.Effect<FileUploadResult, FileUploadError | PutioValidationError, PutioSdkContext> =>\n decodeAndRun(\n Schema.Struct({ input: FileUploadInputSchema, options: FileUploadOptionsSchema }),\n { input, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.flatMap(({ config, oauthToken }) =>\n requestJson(FileUploadEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n baseUrl: config.uploadBaseUrl ?? \"https://upload.put.io\",\n body: {\n type: \"form-data\",\n value: createFileUploadFormData(decoded.input),\n },\n method: \"POST\",\n path: \"/v2/files/upload\",\n query: {\n oauth_token: oauthToken,\n },\n }),\n ),\n ),\n ).pipe(Effect.map(toUploadResult), withOperationErrors(FileUploadErrorSpec));\n","import { Effect, Schema } from \"effect\";\n\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { requestJson, selectJsonFields, type PutioSdkContext } from \"../core/http.js\";\n\nexport const FriendInviteJoinedUserStatusSchema = Schema.Literals([\n \"CONVERTED\",\n \"IN_TRIAL\",\n \"TRIAL_ENDED\",\n \"TRIAL_NOT_STARTED\",\n \"UNKNOWN\",\n]);\n\nexport const FriendInviteJoinedUserSchema = Schema.Struct({\n avatar_url: Schema.String,\n created_at: Schema.String,\n earned_amount: Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n name: Schema.String,\n status: FriendInviteJoinedUserStatusSchema,\n});\n\nexport const FriendInviteSchema = Schema.Struct({\n code: Schema.String,\n created_at: Schema.String,\n user: Schema.NullOr(FriendInviteJoinedUserSchema),\n});\n\nconst FriendInvitesListEnvelopeSchema = Schema.Struct({\n invites: Schema.Array(FriendInviteSchema),\n remaining_limit: Schema.Int,\n status: Schema.Literal(\"OK\"),\n});\n\nconst FriendInviteCreateEnvelopeSchema = Schema.Struct({\n code: Schema.String,\n status: Schema.optional(Schema.Literal(\"OK\")),\n});\n\nexport type FriendInviteJoinedUserStatus = Schema.Schema.Type<\n typeof FriendInviteJoinedUserStatusSchema\n>;\nexport type FriendInviteJoinedUser = Schema.Schema.Type<typeof FriendInviteJoinedUserSchema>;\nexport type FriendInvite = Schema.Schema.Type<typeof FriendInviteSchema>;\n\nexport const ListFriendInvitesErrorSpec = definePutioOperationErrorSpec({\n domain: \"friendInvites\",\n operation: \"list\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\n\nexport const CreateFriendInviteErrorSpec = definePutioOperationErrorSpec({\n domain: \"friendInvites\",\n operation: \"create\",\n knownErrors: [\n { errorType: \"FRIEND_INVITATION_NOT_ALLOWED\", statusCode: 403 as const },\n { errorType: \"FRIEND_INVITATION_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 403 as const },\n ],\n});\n\nexport type ListFriendInvitesError = PutioOperationFailure<typeof ListFriendInvitesErrorSpec>;\nexport type CreateFriendInviteError = PutioOperationFailure<typeof CreateFriendInviteErrorSpec>;\n\nexport const listFriendInvites = (): Effect.Effect<\n {\n readonly invites: ReadonlyArray<FriendInvite>;\n readonly remaining_limit: number;\n },\n ListFriendInvitesError,\n PutioSdkContext\n> =>\n requestJson(FriendInvitesListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/account/friend_invites\",\n }).pipe(\n selectJsonFields(\"invites\", \"remaining_limit\"),\n withOperationErrors(ListFriendInvitesErrorSpec),\n );\n\nexport const createFriendInvite = (): Effect.Effect<\n {\n readonly code: string;\n },\n CreateFriendInviteError,\n PutioSdkContext\n> =>\n requestJson(FriendInviteCreateEnvelopeSchema, {\n method: \"POST\",\n path: \"/v2/account/create_friend_invitation\",\n }).pipe(selectJsonFields(\"code\"), withOperationErrors(CreateFriendInviteErrorSpec));\n","import { Effect, Schema } from \"effect\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { NonEmptyStringSchema } from \"../core/validation.js\";\nimport { FileBroadSchema, type FileBroad } from \"./files.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport const FriendBaseSchema = Schema.Struct({\n avatar_url: Schema.String,\n id: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n name: Schema.String,\n});\nexport const FriendSchema = FriendBaseSchema.pipe(\n Schema.fieldsAssign({\n has_received_files: Schema.Boolean,\n has_shared_files: Schema.Boolean,\n }),\n);\nexport const UserSearchResultSchema = FriendBaseSchema.pipe(\n Schema.fieldsAssign({\n invited: Schema.Boolean,\n }),\n);\nconst FriendsListEnvelopeSchema = Schema.Struct({\n friends: Schema.Array(FriendSchema),\n status: Schema.Literal(\"OK\"),\n total: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n});\nconst FriendRequestsEnvelopeSchema = Schema.Struct({\n friends: Schema.Array(FriendBaseSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst FriendRequestsCountEnvelopeSchema = Schema.Struct({\n count: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n});\nconst FriendSearchEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n users: Schema.Array(UserSearchResultSchema),\n});\nconst FriendSharedFolderEnvelopeSchema = Schema.Struct({\n file: Schema.NullOr(FileBroadSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport type FriendBase = Schema.Schema.Type<typeof FriendBaseSchema>;\nexport type Friend = Schema.Schema.Type<typeof FriendSchema>;\nexport type UserSearchResult = Schema.Schema.Type<typeof UserSearchResultSchema>;\nexport const ListFriendsErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"list\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const SearchFriendsErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"search\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const ListWaitingRequestsErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"listWaitingRequests\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const CountWaitingRequestsErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"countWaitingRequests\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const ListSentRequestsErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"listSentRequests\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const SendFriendRequestErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"sendRequest\",\n knownErrors: [\n { errorType: \"USER_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const RemoveFriendErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"remove\",\n knownErrors: [\n { errorType: \"USER_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ApproveFriendRequestErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"approve\",\n knownErrors: [\n { errorType: \"USER_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const DenyFriendRequestErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"deny\",\n knownErrors: [\n { errorType: \"USER_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const FriendSharedFolderErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"sharedFolder\",\n knownErrors: [\n { errorType: \"NotFound\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport type ListFriendsError = PutioOperationFailure<typeof ListFriendsErrorSpec>;\nexport type SearchFriendsError = PutioOperationFailure<typeof SearchFriendsErrorSpec>;\nexport type ListWaitingRequestsError = PutioOperationFailure<typeof ListWaitingRequestsErrorSpec>;\nexport type CountWaitingRequestsError = PutioOperationFailure<typeof CountWaitingRequestsErrorSpec>;\nexport type ListSentRequestsError = PutioOperationFailure<typeof ListSentRequestsErrorSpec>;\nexport type SendFriendRequestError = PutioOperationFailure<typeof SendFriendRequestErrorSpec>;\nexport type RemoveFriendError = PutioOperationFailure<typeof RemoveFriendErrorSpec>;\nexport type ApproveFriendRequestError = PutioOperationFailure<typeof ApproveFriendRequestErrorSpec>;\nexport type DenyFriendRequestError = PutioOperationFailure<typeof DenyFriendRequestErrorSpec>;\nexport type FriendSharedFolderError = PutioOperationFailure<typeof FriendSharedFolderErrorSpec>;\nconst decodeUsername = (username: string) =>\n Schema.decodeUnknownEffect(NonEmptyStringSchema)(username).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n );\nexport const listFriends = (): Effect.Effect<\n {\n readonly friends: ReadonlyArray<Friend>;\n readonly total: number;\n },\n ListFriendsError,\n PutioSdkContext\n> =>\n requestJson(FriendsListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/friends/list\",\n }).pipe(selectJsonFields(\"friends\", \"total\"), withOperationErrors(ListFriendsErrorSpec));\nexport const searchFriends = (\n username: string,\n): Effect.Effect<ReadonlyArray<UserSearchResult>, SearchFriendsError, PutioSdkContext> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(FriendSearchEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/friends/user-search/${encodePathSegment(decodedUsername)}`,\n }),\n ),\n selectJsonField(\"users\"),\n withOperationErrors(SearchFriendsErrorSpec),\n );\nexport const listWaitingRequests = (): Effect.Effect<\n ReadonlyArray<FriendBase>,\n ListWaitingRequestsError,\n PutioSdkContext\n> =>\n requestJson(FriendRequestsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/friends/waiting-requests\",\n }).pipe(selectJsonField(\"friends\"), withOperationErrors(ListWaitingRequestsErrorSpec));\nexport const countWaitingRequests = (): Effect.Effect<\n number,\n CountWaitingRequestsError,\n PutioSdkContext\n> =>\n requestJson(FriendRequestsCountEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/friends/waiting-requests-count\",\n }).pipe(selectJsonField(\"count\"), withOperationErrors(CountWaitingRequestsErrorSpec));\nexport const listSentRequests = (): Effect.Effect<\n ReadonlyArray<FriendBase>,\n ListSentRequestsError,\n PutioSdkContext\n> =>\n requestJson(FriendRequestsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/friends/sent-requests\",\n }).pipe(selectJsonField(\"friends\"), withOperationErrors(ListSentRequestsErrorSpec));\nexport const sendFriendRequest = (\n username: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n SendFriendRequestError,\n PutioSdkContext\n> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/friends/${encodePathSegment(decodedUsername)}/request`,\n }),\n ),\n withOperationErrors(SendFriendRequestErrorSpec),\n );\nexport const removeFriend = (\n username: string,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, RemoveFriendError, PutioSdkContext> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/friends/${encodePathSegment(decodedUsername)}/unfriend`,\n }),\n ),\n withOperationErrors(RemoveFriendErrorSpec),\n );\nexport const approveFriendRequest = (\n username: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ApproveFriendRequestError,\n PutioSdkContext\n> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/friends/${encodePathSegment(decodedUsername)}/approve`,\n }),\n ),\n withOperationErrors(ApproveFriendRequestErrorSpec),\n );\nexport const denyFriendRequest = (\n username: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n DenyFriendRequestError,\n PutioSdkContext\n> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/friends/${encodePathSegment(decodedUsername)}/deny`,\n }),\n ),\n withOperationErrors(DenyFriendRequestErrorSpec),\n );\nexport const getFriendSharedFolder = (\n username: string,\n): Effect.Effect<FileBroad | null, FriendSharedFolderError, PutioSdkContext> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(FriendSharedFolderEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/friends/${encodePathSegment(decodedUsername)}/files`,\n }),\n ),\n selectJsonField(\"file\"),\n withOperationErrors(FriendSharedFolderErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\nimport { joinCsv } from \"../core/forms.js\";\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n requestJson,\n selectJsonField,\n type PutioSdkContext,\n} from \"../core/http.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema, decodeAndRun } from \"../core/validation.js\";\nexport const PaymentPlanTypeSchema = Schema.Literals([\"onetime\", \"subscription\"]);\nexport const PaymentOptionPlanTypeSchema = Schema.Literals([\"onetime\", \"subscription\", \"trial\"]);\nexport const PaymentProviderNameSchema = Schema.Literals([\n \"Paddle\",\n \"PaddleBilling\",\n \"Fastspring\",\n \"OpenNode\",\n]);\nexport const PaymentTypeSchema = Schema.Literals([\"credit-card\", \"cryptocurrency\"]);\nexport const UserSubscriptionStatusSchema = Schema.Literals([\n \"ACTIVE\",\n \"CANCELED\",\n \"PAST_DUE\",\n \"TRIALING\",\n]);\nexport const PaymentSubscriptionInfoSchema = Schema.Struct({\n id: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n need_payment_information_update: Schema.optional(Schema.Boolean),\n next_billing_date: Schema.optional(Schema.NullOr(Schema.String)),\n next_retry_date: Schema.optional(Schema.NullOr(Schema.String)),\n status: Schema.optional(Schema.NullOr(UserSubscriptionStatusSchema)),\n update_url: Schema.optional(Schema.NullOr(Schema.String)),\n});\nexport const PaymentInfoPlanSchema = Schema.Struct({\n code: Schema.optional(Schema.String),\n group_code: Schema.optional(Schema.String),\n period_days: Schema.optional(Schema.NullOr(Schema.Int.check(Schema.isGreaterThan(0)))),\n storage_space: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n subscription: Schema.optional(PaymentSubscriptionInfoSchema),\n type: Schema.optional(Schema.NullOr(PaymentPlanTypeSchema)),\n});\nconst PaymentLastPaymentSchema = Schema.Struct({\n method: Schema.optional(Schema.String),\n provider: Schema.optional(Schema.String),\n});\nexport const PaymentInfoSchema = Schema.Struct({\n expiration_date: Schema.optional(Schema.String),\n extend_30: Schema.NullOr(Schema.String),\n extend_365: Schema.NullOr(Schema.String),\n has_pending_payment: Schema.Boolean,\n last_payment: Schema.optional(PaymentLastPaymentSchema),\n pending_bitpay: Schema.NullOr(Schema.String),\n plan: Schema.optional(PaymentInfoPlanSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst PaymentPlanCommonPropertiesSchema = Schema.Struct({\n family_invites: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n seed_ratio: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n seed_time: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n storage_space: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n torrent_slot: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n});\nconst PaymentSubPlanSchema = Schema.Struct({\n code: Schema.String,\n daily_price: Schema.NullOr(Schema.String),\n fastspring_url: Schema.NullOr(Schema.String),\n is_trial_subscription: Schema.Boolean,\n period_days: Schema.NullOr(Schema.Int.check(Schema.isGreaterThan(0))),\n price: Schema.NullOr(Schema.String),\n subscription_trial_period: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n type: PaymentPlanTypeSchema,\n});\nexport const PaymentPlanGroupSchema = Schema.Struct({\n common_properties: PaymentPlanCommonPropertiesSchema,\n plan_group_code: Schema.String,\n sub_plans: Schema.Array(PaymentSubPlanSchema),\n});\nconst PaymentPlansEnvelopeSchema = Schema.Struct({\n plans: Schema.Array(PaymentPlanGroupSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport const PaymentOptionSchema = Schema.Struct({\n discount_percent: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n name: PaymentTypeSchema,\n suitable_plan_types: Schema.Array(PaymentOptionPlanTypeSchema),\n});\nconst PaymentOptionsEnvelopeSchema = Schema.Struct({\n options: Schema.Array(PaymentOptionSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst PaymentHistoryPlanSchema = Schema.Struct({\n name: Schema.String,\n period_days: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n price: Schema.NullOr(Schema.String),\n type: Schema.NullOr(PaymentPlanTypeSchema),\n});\nconst PaymentRefundSchema = Schema.Struct({\n amount_actual: Schema.String,\n});\nexport const PaymentHistoryItemSchema = Schema.Struct({\n amount: Schema.String,\n amount_actual: Schema.optional(Schema.String),\n amount_currency: Schema.String,\n actual_currency_code: Schema.optional(Schema.String),\n coupon_code: Schema.NullOr(Schema.String),\n date: Schema.String,\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n invoice: Schema.NullOr(Schema.String),\n plan: PaymentHistoryPlanSchema,\n refunded: Schema.Boolean,\n refunds: Schema.Array(PaymentRefundSchema),\n return_status: Schema.String,\n type: Schema.String,\n});\nconst PaymentHistoryEnvelopeSchema = Schema.Struct({\n payments: Schema.Array(PaymentHistoryItemSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport const PaymentInviteSchema = Schema.Struct({\n is_converted: Schema.Boolean,\n url: Schema.String,\n used_by: Schema.NullOr(Schema.String),\n});\nconst PaymentInvitesEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n vouchers: Schema.Array(PaymentInviteSchema),\n});\nconst PaymentChangePlanCurrentPlanSchema = Schema.Struct({\n plan_type: Schema.NullOr(PaymentPlanTypeSchema),\n subscription_payment_provider: Schema.NullOr(PaymentProviderNameSchema),\n});\nconst PaymentChangePlanTargetPlanSchema = Schema.Struct({\n hd_avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n is_trial_subscription: Schema.Boolean,\n new_code: Schema.String,\n period_days: Schema.NullOr(Schema.Int.check(Schema.isGreaterThan(0))),\n plan_code: Schema.String,\n plan_name: Schema.String,\n plan_type: PaymentPlanTypeSchema,\n price: Schema.String,\n simulated_expiration: Schema.NullOr(Schema.String),\n subscription_trial_period: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst PaymentChangePlanProviderPaddlePreviewSchema = Schema.Struct({\n charge_amount: Schema.NullOr(Schema.String),\n currency: Schema.String,\n next_billing_date: Schema.NullOr(Schema.String),\n});\nconst PaymentChangePlanProviderPaddleBillingPreviewSchema = Schema.Struct({\n next_billing_date: Schema.NullOr(Schema.String),\n});\nconst PaymentChangePlanProviderFastspringPreviewSchema = Schema.Struct({\n charge_amount: Schema.NullOr(Schema.String),\n currency: Schema.String,\n prorated_amount: Schema.NullOr(Schema.String),\n refund_amount: Schema.NullOr(Schema.String),\n});\nconst PaymentChangePlanDiscountSchema = Schema.Struct({\n discount: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n type: Schema.Literals([\"percentage\", \"amount\"]),\n});\nexport const PaymentChangePlanPreviewSchema = Schema.Struct({\n Fastspring: PaymentChangePlanProviderFastspringPreviewSchema,\n Paddle: PaymentChangePlanProviderPaddlePreviewSchema,\n PaddleBilling: PaymentChangePlanProviderPaddleBillingPreviewSchema,\n amount: Schema.NullOr(Schema.String),\n charge_amount: Schema.Boolean,\n credit: Schema.NullOr(Schema.String),\n currency: Schema.String,\n current_plan: PaymentChangePlanCurrentPlanSchema,\n discount: Schema.optional(PaymentChangePlanDiscountSchema),\n is_product_change: Schema.NullOr(Schema.Boolean),\n new_remaining_days: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n prorated: Schema.NullOr(Schema.String),\n status: Schema.Literal(\"OK\"),\n target_plan: PaymentChangePlanTargetPlanSchema,\n});\nconst PaddlePaymentProviderSchema = Schema.Struct({\n plan_id: Schema.Int.check(Schema.isGreaterThan(0)),\n provider: Schema.Literal(\"Paddle\"),\n type: Schema.Literal(\"credit-card\"),\n vendor_id: Schema.Int.check(Schema.isGreaterThan(0)),\n});\nconst PaddleBillingPaymentProviderSchema = Schema.Struct({\n price_id: Schema.NullOr(Schema.String),\n provider: Schema.Literal(\"PaddleBilling\"),\n type: Schema.Literal(\"credit-card\"),\n});\nconst FastspringPaymentProviderSchema = Schema.Struct({\n provider: Schema.Literal(\"Fastspring\"),\n type: Schema.Literal(\"credit-card\"),\n url: Schema.String,\n});\nconst OpenNodePaymentProviderSchema = Schema.Struct({\n discount_percent: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n provider: Schema.Literal(\"OpenNode\"),\n type: Schema.Literal(\"cryptocurrency\"),\n});\nexport const PaymentProviderSchema = Schema.Union([\n FastspringPaymentProviderSchema,\n OpenNodePaymentProviderSchema,\n PaddleBillingPaymentProviderSchema,\n PaddlePaymentProviderSchema,\n]);\nconst PaymentChangePlanCheckoutSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n urls: Schema.Array(PaymentProviderSchema),\n});\nconst PaymentChangePlanConfirmationSchema = Schema.Struct({\n confirmation: Schema.Literal(true),\n status: Schema.Literal(\"OK\"),\n});\nconst PaymentSubscriptionUpdateSchema = Schema.Struct({\n amount: Schema.String,\n billing_date: Schema.String,\n currency: Schema.String,\n});\nconst PaymentChangePlanSubscriptionUpdatedSchema = Schema.Struct({\n charged_amount: Schema.String,\n charged_currency: Schema.String,\n next_payment: PaymentSubscriptionUpdateSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst PaymentChangePlanSuccessSchema = OkResponseSchema;\nexport const PaymentChangePlanSubmitSchema = Schema.Union([\n PaymentChangePlanCheckoutSchema,\n PaymentChangePlanConfirmationSchema,\n PaymentChangePlanSubscriptionUpdatedSchema,\n PaymentChangePlanSuccessSchema,\n]);\nconst PaymentFastspringConfirmEnvelopeSchema = Schema.Struct({\n confirmed: Schema.Boolean,\n status: Schema.Literal(\"OK\"),\n});\nconst PaymentPaddleBillingInvoiceEnvelopeSchema = Schema.Struct({\n status: Schema.optional(Schema.Literal(\"OK\")),\n url: Schema.String,\n});\nconst PaymentPaddleBillingUpdatePaymentMethodEnvelopeSchema = Schema.Struct({\n status: Schema.optional(Schema.Literal(\"OK\")),\n transaction_id: Schema.String,\n});\nconst PaymentVoucherPlanSchema = Schema.Struct({\n expiration_date: Schema.NullOr(Schema.String),\n type: Schema.NullOr(PaymentPlanTypeSchema),\n});\nconst PaymentVoucherTargetPlanSchema = Schema.Struct({\n code: Schema.String,\n group_code: Schema.String,\n hd_avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n name: Schema.String,\n simulated_expiration: Schema.optional(Schema.NullOr(Schema.String)),\n type: PaymentPlanTypeSchema,\n});\nexport const PaymentVoucherInfoSchema = Schema.Struct({\n current_plan: PaymentVoucherPlanSchema,\n new_remaining_days: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n target_plan: PaymentVoucherTargetPlanSchema,\n});\nconst PaymentOpenNodeChargeEnvelopeSchema = Schema.Struct({\n opennode: Schema.Struct({\n checkout_url: Schema.String,\n }),\n status: Schema.Literal(\"OK\"),\n});\nexport type PaymentInfo = Schema.Schema.Type<typeof PaymentInfoSchema>;\nexport type PaymentPlanGroup = Schema.Schema.Type<typeof PaymentPlanGroupSchema>;\nexport type PaymentOption = Schema.Schema.Type<typeof PaymentOptionSchema>;\nexport type PaymentHistoryItem = Schema.Schema.Type<typeof PaymentHistoryItemSchema>;\nexport type PaymentInvite = Schema.Schema.Type<typeof PaymentInviteSchema>;\nexport type PaymentChangePlanPreview = Schema.Schema.Type<typeof PaymentChangePlanPreviewSchema>;\nexport type PaymentProvider = Schema.Schema.Type<typeof PaymentProviderSchema>;\nexport type PaymentChangePlanSubmitResponse = Schema.Schema.Type<\n typeof PaymentChangePlanSubmitSchema\n>;\nexport type PaymentVoucherInfo = Schema.Schema.Type<typeof PaymentVoucherInfoSchema>;\nconst PaymentHistoryQuerySchema = Schema.Struct({\n unreported_only: Schema.optional(Schema.Boolean),\n});\nconst PaymentChangePlanPreviewInputSchema = Schema.Struct({\n coupon_code: Schema.optional(NonEmptyStringSchema),\n payment_type: Schema.optional(PaymentTypeSchema),\n plan_path: NonEmptyStringSchema,\n});\nconst PaymentChangePlanSubmitInputSchema = Schema.Struct({\n confirmation_code: Schema.optional(NonEmptyStringSchema),\n coupon_code: Schema.optional(NonEmptyStringSchema),\n payment_type: Schema.optional(PaymentTypeSchema),\n plan_path: NonEmptyStringSchema,\n});\nconst PaymentPaddleWaitingPaymentInputSchema = Schema.Struct({\n checkout_id: NonEmptyStringSchema,\n product_id: Schema.Union([NonEmptyStringSchema, PositiveIntegerSchema]),\n});\nconst PaymentIdsSchema = Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1));\nexport type PaymentHistoryQuery = Schema.Schema.Type<typeof PaymentHistoryQuerySchema>;\nexport type PaymentChangePlanPreviewInput = Schema.Schema.Type<\n typeof PaymentChangePlanPreviewInputSchema\n>;\nexport type PaymentChangePlanSubmitInput = Schema.Schema.Type<\n typeof PaymentChangePlanSubmitInputSchema\n>;\nexport type PaymentPaddleWaitingPaymentInput = Schema.Schema.Type<\n typeof PaymentPaddleWaitingPaymentInputSchema\n>;\nconst RestrictedPaymentError = { errorType: \"invalid_scope\", statusCode: 401 as const };\nconst CommonPaymentActionErrors = [\n { errorType: \"PAYMENT_SUB_ACCOUNT_NOT_ALLOWED\", statusCode: 403 as const },\n RestrictedPaymentError,\n] as const;\nexport const GetPaymentInfoErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"getInfo\",\n knownErrors: [RestrictedPaymentError],\n});\nexport const ListPaymentPlansErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"listPlans\",\n knownErrors: [RestrictedPaymentError],\n});\nexport const ListPaymentOptionsErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"listOptions\",\n knownErrors: [{ statusCode: 400 as const }],\n});\nexport const ListPaymentHistoryErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"listHistory\",\n knownErrors: [RestrictedPaymentError],\n});\nexport const ListPaymentInvitesErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"listInvites\",\n knownErrors: [RestrictedPaymentError],\n});\nexport const PreviewPaymentChangePlanErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"previewChangePlan\",\n knownErrors: [\n { errorType: \"PAYMENT_PLAN_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_INSUFFICIENT_DISK_SPACE\", statusCode: 400 as const },\n { errorType: \"PAYMENT_UPDATE_INFORMATION\", statusCode: 400 as const },\n { errorType: \"PAYMENT_FAMILY_ERROR\", statusCode: 400 as const },\n { errorType: \"PAYMENT_PLAN_CHANGE_NOT_ALLOWED\", statusCode: 400 as const },\n { errorType: \"PAYMENT_COUPON_CODE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_COUPON_CODE_NO_LONGER_AVAILABLE\", statusCode: 410 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n { statusCode: 410 as const },\n ],\n});\nexport const SubmitPaymentChangePlanErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"submitChangePlan\",\n knownErrors: [\n { errorType: \"PADDLE_ERROR\", statusCode: 400 as const },\n { errorType: \"PADDLE_BILLING_INVALID_COUPON\", statusCode: 400 as const },\n { errorType: \"PADDLE_BILLING_SUBSCRIPTION_CANNOT_CHANGE_PLAN\", statusCode: 400 as const },\n { errorType: \"CONFIRMATION_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"INVALID_CONFIRMATION\", statusCode: 400 as const },\n { errorType: \"PAYMENT_COUPON_CODE_NO_LONGER_AVAILABLE\", statusCode: 410 as const },\n { errorType: \"PAYMENT_COUPON_CODE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_FAMILY_ERROR\", statusCode: 400 as const },\n { errorType: \"PAYMENT_FASTSPRING_INACTIVE_SUBSCRIPTION\", statusCode: 400 as const },\n { errorType: \"PAYMENT_FASTSPRING_PRORATION_NOT_SUPPORTED\", statusCode: 400 as const },\n { errorType: \"PAYMENT_INSUFFICIENT_DISK_SPACE\", statusCode: 400 as const },\n { errorType: \"PAYMENT_NOT_ENOUGH_DAYS\", statusCode: 400 as const },\n { errorType: \"PAYMENT_PLAN_CHANGE_NOT_ALLOWED\", statusCode: 400 as const },\n { errorType: \"PAYMENT_PLAN_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_PROVIDER_ERROR\", statusCode: 400 as const },\n { errorType: \"PAYMENT_TRIAL_ERROR\", statusCode: 403 as const },\n { errorType: \"PAYMENT_UNKNOWN_PLAN\", statusCode: 400 as const },\n { errorType: \"PAYMENT_UNKNOWN_PROVIDER\", statusCode: 400 as const },\n { errorType: \"PAYMENT_UPDATE_INFORMATION\", statusCode: 400 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 400 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n { statusCode: 410 as const },\n ],\n});\nexport const ConfirmFastspringOrderErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"confirmFastspringOrder\",\n knownErrors: [RestrictedPaymentError],\n});\nexport const StopSubscriptionErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"stopSubscription\",\n knownErrors: [\n { errorType: \"PAYMENT_SUBSCRIPTION_NOT_FOUND\", statusCode: 404 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 404 as const },\n ],\n});\nexport const GetPaymentVoucherInfoErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"getVoucherInfo\",\n knownErrors: [\n { errorType: \"PAYMENT_COUPON_CODE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_COUPON_CODE_NO_LONGER_AVAILABLE\", statusCode: 410 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 404 as const },\n { statusCode: 410 as const },\n ],\n});\nexport const RedeemPaymentVoucherErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"redeemVoucher\",\n knownErrors: [\n { errorType: \"PAYMENT_COUPON_CODE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_COUPON_CODE_ALREADY_USED\", statusCode: 404 as const },\n { errorType: \"PAYMENT_VOUCHER_CODE_NOT_REDEEMED\", statusCode: 400 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ReportPaymentsErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"reportPayments\",\n knownErrors: [\n { errorType: \"PAYMENT_BAD_REQUEST\", statusCode: 400 as const },\n RestrictedPaymentError,\n { statusCode: 400 as const },\n ],\n});\nexport const CreatePaddleWaitingPaymentErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"createPaddleWaitingPayment\",\n knownErrors: [\n { errorType: \"PAYMENT_PADDLE_WAITING\", statusCode: 404 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 404 as const },\n ],\n});\nexport const GetPaddleBillingInvoiceUrlErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"getPaddleBillingInvoiceUrl\",\n knownErrors: [\n { errorType: \"PADDLE_BILLING_PAYMENT_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PADDLE_BILLING_INVOICE_NOT_AVAILABLE\", statusCode: 404 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 404 as const },\n ],\n});\nexport const CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec =\n definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"createPaddleBillingUpdatePaymentMethodTransaction\",\n knownErrors: [\n { errorType: \"PADDLE_BILLING_SUBSCRIPTION_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PADDLE_BILLING_SUBSCRIPTION_CANCELED\", statusCode: 404 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 404 as const },\n ],\n });\nexport const CreateOpenNodeChargeErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"createOpenNodeCharge\",\n knownErrors: [\n { errorType: \"PAYMENT_UNKNOWN_PLAN\", statusCode: 400 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 400 as const },\n ],\n});\nexport type GetPaymentInfoError = PutioOperationFailure<typeof GetPaymentInfoErrorSpec>;\nexport type ListPaymentPlansError = PutioOperationFailure<typeof ListPaymentPlansErrorSpec>;\nexport type ListPaymentOptionsError = PutioOperationFailure<typeof ListPaymentOptionsErrorSpec>;\nexport type ListPaymentHistoryError = PutioOperationFailure<typeof ListPaymentHistoryErrorSpec>;\nexport type ListPaymentInvitesError = PutioOperationFailure<typeof ListPaymentInvitesErrorSpec>;\nexport type PreviewPaymentChangePlanError = PutioOperationFailure<\n typeof PreviewPaymentChangePlanErrorSpec\n>;\nexport type SubmitPaymentChangePlanError = PutioOperationFailure<\n typeof SubmitPaymentChangePlanErrorSpec\n>;\nexport type ConfirmFastspringOrderError = PutioOperationFailure<\n typeof ConfirmFastspringOrderErrorSpec\n>;\nexport type StopSubscriptionError = PutioOperationFailure<typeof StopSubscriptionErrorSpec>;\nexport type GetPaymentVoucherInfoError = PutioOperationFailure<\n typeof GetPaymentVoucherInfoErrorSpec\n>;\nexport type RedeemPaymentVoucherError = PutioOperationFailure<typeof RedeemPaymentVoucherErrorSpec>;\nexport type ReportPaymentsError = PutioOperationFailure<typeof ReportPaymentsErrorSpec>;\nexport type CreatePaddleWaitingPaymentError = PutioOperationFailure<\n typeof CreatePaddleWaitingPaymentErrorSpec\n>;\nexport type GetPaddleBillingInvoiceUrlError = PutioOperationFailure<\n typeof GetPaddleBillingInvoiceUrlErrorSpec\n>;\nexport type CreatePaddleBillingUpdatePaymentMethodTransactionError = PutioOperationFailure<\n typeof CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec\n>;\nexport type CreateOpenNodeChargeError = PutioOperationFailure<typeof CreateOpenNodeChargeErrorSpec>;\nexport type ClassifiedPaymentChangePlanSubmitResponse =\n | {\n readonly data: Schema.Schema.Type<typeof PaymentChangePlanCheckoutSchema>;\n readonly type: \"checkout\";\n }\n | {\n readonly data: Schema.Schema.Type<typeof PaymentChangePlanConfirmationSchema>;\n readonly type: \"confirmation_required\";\n }\n | {\n readonly data: Schema.Schema.Type<typeof PaymentChangePlanSubscriptionUpdatedSchema>;\n readonly type: \"subscription_updated\";\n }\n | {\n readonly data: Schema.Schema.Type<typeof PaymentChangePlanSuccessSchema>;\n readonly type: \"success\";\n };\nexport const classifyPaymentChangePlanResponse = (\n response: PaymentChangePlanSubmitResponse,\n): ClassifiedPaymentChangePlanSubmitResponse => {\n if (\"urls\" in response) {\n return {\n data: response,\n type: \"checkout\",\n };\n }\n if (\"confirmation\" in response) {\n return {\n data: response,\n type: \"confirmation_required\",\n };\n }\n if (\"next_payment\" in response) {\n return {\n data: response,\n type: \"subscription_updated\",\n };\n }\n return {\n data: response,\n type: \"success\",\n };\n};\nexport const getPaymentInfo = (): Effect.Effect<\n PaymentInfo,\n GetPaymentInfoError,\n PutioSdkContext\n> =>\n requestJson(PaymentInfoSchema, {\n method: \"GET\",\n path: \"/v2/payment/info\",\n }).pipe(withOperationErrors(GetPaymentInfoErrorSpec));\nexport const listPaymentPlans = (): Effect.Effect<\n ReadonlyArray<PaymentPlanGroup>,\n ListPaymentPlansError,\n PutioSdkContext\n> =>\n requestJson(PaymentPlansEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/payment/plans\",\n }).pipe(selectJsonField(\"plans\"), withOperationErrors(ListPaymentPlansErrorSpec));\nexport const listPaymentOptions = (): Effect.Effect<\n ReadonlyArray<Schema.Schema.Type<typeof PaymentOptionSchema>>,\n ListPaymentOptionsError,\n PutioSdkContext\n> =>\n requestJson(PaymentOptionsEnvelopeSchema, {\n auth: { type: \"none\" },\n method: \"GET\",\n path: \"/v2/payment/options\",\n }).pipe(selectJsonField(\"options\"), withOperationErrors(ListPaymentOptionsErrorSpec));\nexport const listPaymentHistory = (\n query: PaymentHistoryQuery = {},\n): Effect.Effect<ReadonlyArray<PaymentHistoryItem>, ListPaymentHistoryError, PutioSdkContext> =>\n decodeAndRun(PaymentHistoryQuerySchema, query, (decodedQuery) =>\n requestJson(PaymentHistoryEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/payment/history\",\n query: decodedQuery,\n }).pipe(selectJsonField(\"payments\")),\n ).pipe(withOperationErrors(ListPaymentHistoryErrorSpec));\nexport const listPaymentInvites = (): Effect.Effect<\n ReadonlyArray<Schema.Schema.Type<typeof PaymentInviteSchema>>,\n ListPaymentInvitesError,\n PutioSdkContext\n> =>\n requestJson(PaymentInvitesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/payment/invites\",\n }).pipe(selectJsonField(\"vouchers\"), withOperationErrors(ListPaymentInvitesErrorSpec));\nexport const previewPaymentChangePlan = (\n input: PaymentChangePlanPreviewInput,\n): Effect.Effect<PaymentChangePlanPreview, PreviewPaymentChangePlanError, PutioSdkContext> =>\n decodeAndRun(PaymentChangePlanPreviewInputSchema, input, (decodedInput) =>\n requestJson(PaymentChangePlanPreviewSchema, {\n method: \"GET\",\n path: `/v2/payment/change_plan/${encodeURIComponent(decodedInput.plan_path)}`,\n query: {\n coupon_code: decodedInput.coupon_code,\n payment_type: decodedInput.payment_type,\n },\n }),\n ).pipe(withOperationErrors(PreviewPaymentChangePlanErrorSpec));\nexport const submitPaymentChangePlan = (\n input: PaymentChangePlanSubmitInput,\n): Effect.Effect<PaymentChangePlanSubmitResponse, SubmitPaymentChangePlanError, PutioSdkContext> =>\n decodeAndRun(PaymentChangePlanSubmitInputSchema, input, (decodedInput) =>\n requestJson(PaymentChangePlanSubmitSchema, {\n body: {\n type: \"form\",\n value: {\n confirmation_code: decodedInput.confirmation_code,\n payment_type: decodedInput.payment_type,\n },\n },\n method: \"POST\",\n path: `/v2/payment/change_plan/${encodeURIComponent(decodedInput.plan_path)}`,\n query: {\n coupon_code: decodedInput.coupon_code,\n },\n }),\n ).pipe(withOperationErrors(SubmitPaymentChangePlanErrorSpec));\nexport const confirmFastspringOrder = (\n reference: string,\n): Effect.Effect<boolean, ConfirmFastspringOrderError, PutioSdkContext> =>\n decodeAndRun(NonEmptyStringSchema, reference, (decodedReference) =>\n requestJson(PaymentFastspringConfirmEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/payment/fs-confirm/${encodeURIComponent(decodedReference)}`,\n }).pipe(selectJsonField(\"confirmed\")),\n ).pipe(withOperationErrors(ConfirmFastspringOrderErrorSpec));\nexport const stopPaymentSubscription = (): Effect.Effect<\n void,\n StopSubscriptionError,\n PutioSdkContext\n> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/payment/stop_subscription\",\n }).pipe(Effect.asVoid, withOperationErrors(StopSubscriptionErrorSpec));\nexport const getPaymentVoucherInfo = (\n code: string,\n): Effect.Effect<PaymentVoucherInfo, GetPaymentVoucherInfoError, PutioSdkContext> =>\n decodeAndRun(NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(PaymentVoucherInfoSchema, {\n method: \"GET\",\n path: `/v2/payment/redeem_voucher/${encodeURIComponent(decodedCode)}`,\n }),\n ).pipe(withOperationErrors(GetPaymentVoucherInfoErrorSpec));\nexport const redeemPaymentVoucher = (\n code: string,\n): Effect.Effect<void, RedeemPaymentVoucherError, PutioSdkContext> =>\n decodeAndRun(NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/payment/redeem_voucher/${encodeURIComponent(decodedCode)}`,\n }),\n ).pipe(Effect.asVoid, withOperationErrors(RedeemPaymentVoucherErrorSpec));\nexport const reportPayments = (\n paymentIds: ReadonlyArray<number>,\n): Effect.Effect<void, ReportPaymentsError, PutioSdkContext> =>\n decodeAndRun(PaymentIdsSchema, paymentIds, (decodedPaymentIds) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n payment_ids: joinCsv(decodedPaymentIds),\n },\n },\n method: \"POST\",\n path: \"/v2/payment/report\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(ReportPaymentsErrorSpec));\nexport const createPaddleWaitingPayment = (\n input: PaymentPaddleWaitingPaymentInput,\n): Effect.Effect<void, CreatePaddleWaitingPaymentError, PutioSdkContext> =>\n decodeAndRun(PaymentPaddleWaitingPaymentInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/payment/paddle_waiting_payment\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(CreatePaddleWaitingPaymentErrorSpec));\nexport const getPaddleBillingInvoiceUrl = (\n paymentId: number,\n): Effect.Effect<string, GetPaddleBillingInvoiceUrlError, PutioSdkContext> =>\n decodeAndRun(PositiveIntegerSchema, paymentId, (decodedPaymentId) =>\n requestJson(PaymentPaddleBillingInvoiceEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/payment/methods/paddle_billing/invoice/${encodeURIComponent(decodedPaymentId)}`,\n }).pipe(selectJsonField(\"url\")),\n ).pipe(withOperationErrors(GetPaddleBillingInvoiceUrlErrorSpec));\nexport const createPaddleBillingUpdatePaymentMethodTransaction = (\n userSubscriptionId: number,\n): Effect.Effect<string, CreatePaddleBillingUpdatePaymentMethodTransactionError, PutioSdkContext> =>\n decodeAndRun(PositiveIntegerSchema, userSubscriptionId, (decodedUserSubscriptionId) =>\n requestJson(PaymentPaddleBillingUpdatePaymentMethodEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/payment/methods/paddle_billing/update_payment_method/${encodeURIComponent(\n decodedUserSubscriptionId,\n )}`,\n }).pipe(selectJsonField(\"transaction_id\")),\n ).pipe(withOperationErrors(CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec));\nexport const createOpenNodeCharge = (\n planPath: string,\n): Effect.Effect<string, CreateOpenNodeChargeError, PutioSdkContext> =>\n decodeAndRun(NonEmptyStringSchema, planPath, (decodedPlanPath) =>\n requestJson(PaymentOpenNodeChargeEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n plan_fs_path: decodedPlanPath,\n },\n },\n method: \"POST\",\n path: \"/v2/payment/methods/opennode/charge\",\n }).pipe(\n selectJsonField(\"opennode\"),\n Effect.map(({ checkout_url }) => checkout_url),\n ),\n ).pipe(withOperationErrors(CreateOpenNodeChargeErrorSpec));\n","import { Effect, Schema } from \"effect\";\n\nimport { joinCsv } from \"../core/forms.js\";\nimport { mapDecodeErrorToValidationError, type PutioSdkError } from \"../core/errors.js\";\nimport { requestJson, selectJsonFields, type PutioSdkContext } from \"../core/http.js\";\n\nexport const PodcastLinkTypeSchema = Schema.Literals([\"all\", \"audio\", \"video\", \"mp4\"]);\nexport const PodcastGetLinksInputSchema = Schema.Struct({\n parentId: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n types: Schema.optional(Schema.Array(PodcastLinkTypeSchema).check(Schema.isMinLength(1))),\n});\nexport const PodcastLinksSchema = Schema.Struct({\n all: Schema.optional(Schema.String),\n audio: Schema.optional(Schema.String),\n video: Schema.optional(Schema.String),\n mp4: Schema.optional(Schema.String),\n});\nconst PodcastLinksEnvelopeSchema = Schema.Struct({\n links: PodcastLinksSchema,\n status: Schema.Literal(\"OK\"),\n token: Schema.String,\n});\n\nexport type PodcastLinkType = Schema.Schema.Type<typeof PodcastLinkTypeSchema>;\nexport type PodcastGetLinksInput = Schema.Schema.Type<typeof PodcastGetLinksInputSchema>;\nexport type PodcastLinks = Schema.Schema.Type<typeof PodcastLinksSchema>;\nexport type PodcastLinksResponse = Pick<\n Schema.Schema.Type<typeof PodcastLinksEnvelopeSchema>,\n \"links\" | \"token\"\n>;\n\nexport const getPodcastLinks = (\n input: PodcastGetLinksInput,\n): Effect.Effect<PodcastLinksResponse, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PodcastGetLinksInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(PodcastLinksEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/podcast/links\",\n query: {\n parent_id: decodedInput.parentId,\n type: decodedInput.types ? joinCsv(decodedInput.types) : undefined,\n },\n }),\n ),\n selectJsonFields(\"links\", \"token\"),\n );\n","import { Effect, Schema } from \"effect\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport const RssFeedSchema = Schema.Struct({\n created_at: Schema.String,\n delete_old_files: Schema.Boolean,\n extract: Schema.Boolean,\n failed_item_count: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n keyword: Schema.NullOr(Schema.String),\n last_error: Schema.NullOr(Schema.String),\n last_fetch: Schema.NullOr(Schema.String),\n parent_dir_id: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n parentdirid: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n paused: Schema.Boolean,\n paused_at: Schema.NullOr(Schema.String),\n rss_source_url: Schema.String,\n start_at: Schema.NullOr(Schema.String),\n title: Schema.String,\n unwanted_keywords: Schema.String,\n updated_at: Schema.String,\n});\nexport const RssFeedParamsSchema = Schema.Struct({\n delete_old_files: Schema.optional(Schema.Boolean),\n dont_process_whole_feed: Schema.optional(Schema.Boolean),\n keyword: Schema.optional(Schema.NullOr(Schema.String)),\n parent_dir_id: Schema.optional(\n Schema.Union([Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), Schema.Literal(\"newf\")]),\n ),\n rss_source_url: NonEmptyStringSchema,\n title: NonEmptyStringSchema,\n unwanted_keywords: Schema.optional(Schema.String),\n});\nconst RssFeedUpdateInputSchema = Schema.Struct({\n id: PositiveIntegerSchema,\n params: RssFeedParamsSchema,\n});\nconst RssFeedItemRetryInputSchema = Schema.Struct({\n feedId: PositiveIntegerSchema,\n itemId: PositiveIntegerSchema,\n});\nconst RssFeedItemBaseSchema = Schema.Struct({\n detected_date: Schema.String,\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n processed_at: Schema.String,\n publish_date: Schema.NullOr(Schema.String),\n title: Schema.String,\n});\nexport const RssFeedItemSucceededSchema = RssFeedItemBaseSchema.pipe(\n Schema.fieldsAssign({\n is_failed: Schema.Literal(false),\n user_file_id: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n }),\n);\nexport const RssFeedItemFailedSchema = RssFeedItemBaseSchema.pipe(\n Schema.fieldsAssign({\n failure_reason: Schema.String,\n is_failed: Schema.Literal(true),\n }),\n);\nexport const RssFeedItemSchema = Schema.Union([\n RssFeedItemSucceededSchema,\n RssFeedItemFailedSchema,\n]);\nconst RssFeedsEnvelopeSchema = Schema.Struct({\n feeds: Schema.Array(RssFeedSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst RssFeedEnvelopeSchema = Schema.Struct({\n feed: RssFeedSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst RssFeedItemsEnvelopeSchema = Schema.Struct({\n feed: RssFeedSchema,\n items: Schema.Array(RssFeedItemSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport type RssFeed = Schema.Schema.Type<typeof RssFeedSchema>;\nexport type RssFeedParams = Schema.Schema.Type<typeof RssFeedParamsSchema>;\nexport type RssFeedItem = Schema.Schema.Type<typeof RssFeedItemSchema>;\nexport const ListRssFeedsErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"list\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const GetRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"get\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const CreateRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"create\",\n knownErrors: [\n { errorType: \"URL_REQUIRED\", statusCode: 400 as const },\n { errorType: \"URL_NOT_VALID\", statusCode: 400 as const },\n { errorType: \"FEED_CANNOT_FETCHED\", statusCode: 400 as const },\n { errorType: \"FEED_CANNOT_PARSED\", statusCode: 400 as const },\n { errorType: \"TITLE_REQUIRED\", statusCode: 400 as const },\n { errorType: \"TOO_MANY_RSS_FEEDS\", statusCode: 403 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 402 as const },\n { statusCode: 403 as const },\n ],\n});\nexport const UpdateRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"update\",\n knownErrors: [\n { errorType: \"URL_NOT_VALID\", statusCode: 400 as const },\n { errorType: \"FEED_CANNOT_FETCHED\", statusCode: 400 as const },\n { errorType: \"FEED_CANNOT_PARSED\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 400 as const },\n { statusCode: 402 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const PauseRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"pause\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ResumeRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"resume\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 402 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const DeleteRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"delete\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ListRssFeedItemsErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"listItems\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ClearRssFeedLogsErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"clearLogs\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const RetryRssFeedItemErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"retryItem\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 402 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const RetryAllRssFeedItemsErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"retryAll\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 402 as const },\n { statusCode: 404 as const },\n ],\n});\nexport type ListRssFeedsError = PutioOperationFailure<typeof ListRssFeedsErrorSpec>;\nexport type GetRssFeedError = PutioOperationFailure<typeof GetRssFeedErrorSpec>;\nexport type CreateRssFeedError = PutioOperationFailure<typeof CreateRssFeedErrorSpec>;\nexport type UpdateRssFeedError = PutioOperationFailure<typeof UpdateRssFeedErrorSpec>;\nexport type PauseRssFeedError = PutioOperationFailure<typeof PauseRssFeedErrorSpec>;\nexport type ResumeRssFeedError = PutioOperationFailure<typeof ResumeRssFeedErrorSpec>;\nexport type DeleteRssFeedError = PutioOperationFailure<typeof DeleteRssFeedErrorSpec>;\nexport type ListRssFeedItemsError = PutioOperationFailure<typeof ListRssFeedItemsErrorSpec>;\nexport type ClearRssFeedLogsError = PutioOperationFailure<typeof ClearRssFeedLogsErrorSpec>;\nexport type RetryRssFeedItemError = PutioOperationFailure<typeof RetryRssFeedItemErrorSpec>;\nexport type RetryAllRssFeedItemsError = PutioOperationFailure<typeof RetryAllRssFeedItemsErrorSpec>;\nconst toCreateBody = (params: RssFeedParams) => ({\n delete_old_files: params.delete_old_files ? \"on\" : undefined,\n dont_process_whole_feed: params.dont_process_whole_feed,\n keyword: params.keyword ?? undefined,\n parent_dir_id: params.parent_dir_id,\n rss_source_url: params.rss_source_url,\n title: params.title,\n unwanted_keywords: params.unwanted_keywords ?? \"\",\n});\nconst toUpdateBody = (params: RssFeedParams) => ({\n delete_old_files: params.delete_old_files,\n dont_process_whole_feed: params.dont_process_whole_feed,\n keyword: params.keyword ?? undefined,\n parent_dir_id: params.parent_dir_id,\n rss_source_url: params.rss_source_url,\n title: params.title,\n unwanted_keywords: params.unwanted_keywords ?? \"\",\n});\nexport const listRssFeeds = (): Effect.Effect<\n ReadonlyArray<RssFeed>,\n ListRssFeedsError,\n PutioSdkContext\n> =>\n requestJson(RssFeedsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/rss/list\",\n }).pipe(selectJsonField(\"feeds\"), withOperationErrors(ListRssFeedsErrorSpec));\nexport const getRssFeed = (id: number): Effect.Effect<RssFeed, GetRssFeedError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(RssFeedEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/rss/${encodePathSegment(decodedId)}`,\n }),\n ),\n selectJsonField(\"feed\"),\n withOperationErrors(GetRssFeedErrorSpec),\n );\nexport const createRssFeed = (\n params: RssFeedParams,\n): Effect.Effect<RssFeed, CreateRssFeedError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(RssFeedParamsSchema, { onExcessProperty: \"error\" })(params).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedParams) =>\n requestJson(RssFeedEnvelopeSchema, {\n body: {\n type: \"form\",\n value: toCreateBody(decodedParams),\n },\n method: \"POST\",\n path: \"/v2/rss/create\",\n }),\n ),\n selectJsonField(\"feed\"),\n withOperationErrors(CreateRssFeedErrorSpec),\n );\nexport const updateRssFeed = (\n id: number,\n params: RssFeedParams,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n UpdateRssFeedError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(RssFeedUpdateInputSchema, { onExcessProperty: \"error\" })({\n id,\n params,\n }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: toUpdateBody(decodedInput.params),\n },\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedInput.id)}`,\n }),\n ),\n withOperationErrors(UpdateRssFeedErrorSpec),\n );\nexport const pauseRssFeed = (\n id: number,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PauseRssFeedError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedId)}/pause`,\n }),\n ),\n withOperationErrors(PauseRssFeedErrorSpec),\n );\nexport const resumeRssFeed = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ResumeRssFeedError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedId)}/resume`,\n }),\n ),\n withOperationErrors(ResumeRssFeedErrorSpec),\n );\nexport const deleteRssFeed = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n DeleteRssFeedError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedId)}/delete`,\n }),\n ),\n withOperationErrors(DeleteRssFeedErrorSpec),\n );\nexport const listRssFeedItems = (\n id: number,\n): Effect.Effect<\n {\n readonly feed: RssFeed;\n readonly items: ReadonlyArray<RssFeedItem>;\n },\n ListRssFeedItemsError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(RssFeedItemsEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/rss/${encodePathSegment(decodedId)}/items`,\n }),\n ),\n selectJsonFields(\"feed\", \"items\"),\n withOperationErrors(ListRssFeedItemsErrorSpec),\n );\nexport const clearRssFeedLogs = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ClearRssFeedLogsError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedId)}/clear-log`,\n }),\n ),\n withOperationErrors(ClearRssFeedLogsErrorSpec),\n );\nexport const retryRssFeedItem = (\n feedId: number,\n itemId: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n RetryRssFeedItemError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(RssFeedItemRetryInputSchema, { onExcessProperty: \"error\" })({\n feedId,\n itemId,\n }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedInput.feedId)}/items/${encodePathSegment(decodedInput.itemId)}/retry`,\n }),\n ),\n withOperationErrors(RetryRssFeedItemErrorSpec),\n );\nexport const retryAllRssFeedItems = (\n feedId: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n RetryAllRssFeedItemsError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(feedId).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedFeedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedFeedId)}/retry-all`,\n }),\n ),\n withOperationErrors(RetryAllRssFeedItemsErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\nimport { joinCsv, toCursorSelectionForm } from \"../core/forms.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { FileBroadSchema } from \"./files.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport const SharingCloneStatusSchema = Schema.Literals([\"NEW\", \"PROCESSING\", \"DONE\", \"ERROR\"]);\nexport const SharingCloneInputSchema = Schema.Struct({\n cursor: Schema.optional(NonEmptyStringSchema),\n excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n ids: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n parentId: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst SharingCloneEnvelopeSchema = Schema.Struct({\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n status: Schema.Literal(\"OK\"),\n});\nexport const SharingCloneInfoSchema = Schema.Union([\n Schema.Struct({\n shared_file_clone_status: Schema.Literals([\"NEW\", \"PROCESSING\", \"DONE\"]),\n status: Schema.Literal(\"OK\"),\n }),\n Schema.Struct({\n error_msg: Schema.String,\n shared_file_clone_status: Schema.Literal(\"ERROR\"),\n status: Schema.Literal(\"OK\"),\n }),\n]);\nexport const SharedFileSchema = FileBroadSchema.pipe(\n Schema.fieldsAssign({\n shared_with: Schema.Union([\n Schema.Literal(\"everyone\"),\n Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n ]),\n }),\n);\nexport const SharingShareInputSchema = Schema.Struct({\n cursor: Schema.optional(NonEmptyStringSchema),\n excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n ids: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n target: Schema.Union([\n Schema.Struct({\n type: Schema.Literal(\"everyone\"),\n }),\n Schema.Struct({\n friendNames: Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1)),\n type: Schema.Literal(\"friends\"),\n }),\n ]),\n});\nconst SharedFilesEnvelopeSchema = Schema.Struct({\n shared: Schema.Array(SharedFileSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport const SharedFileShareSchema = Schema.Struct({\n share_id: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n user_avatar_url: Schema.String,\n user_name: Schema.String,\n});\nexport const SharedFileSharedWithSchema = Schema.Union([\n Schema.Struct({\n share_type: Schema.Literal(\"everyone\"),\n status: Schema.optional(Schema.Literal(\"OK\")),\n }),\n Schema.Struct({\n share_type: Schema.Literal(\"friends\"),\n shares: Schema.Array(SharedFileShareSchema),\n status: Schema.optional(Schema.Literal(\"OK\")),\n }),\n]);\nexport const SharingUnshareInputSchema = Schema.Struct({\n fileId: PositiveIntegerSchema,\n shares: Schema.optional(\n Schema.Array(Schema.Union([PositiveIntegerSchema, NonEmptyStringSchema])),\n ),\n});\nexport const PublicShareSchema = Schema.Struct({\n created_at: Schema.String,\n expiration_date: Schema.String,\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n owner: Schema.Struct({\n name: Schema.String,\n }),\n push_token: Schema.String,\n token: Schema.String,\n user_file: Schema.Struct({\n file_type: Schema.String,\n id: Schema.Int,\n name: Schema.String,\n }),\n});\nconst PublicShareEnvelopeSchema = Schema.Struct({\n public_share: PublicShareSchema,\n status: Schema.optional(Schema.Literal(\"OK\")),\n});\nconst PublicSharesEnvelopeSchema = Schema.Struct({\n public_shares: Schema.Array(PublicShareSchema),\n status: Schema.optional(Schema.Literal(\"OK\")),\n});\nconst PublicShareFileListEnvelopeSchema = Schema.Struct({\n breadcrumbs: Schema.optional(Schema.Array(Schema.Tuple([Schema.Int, Schema.String]))),\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(FileBroadSchema),\n parent: Schema.NullOr(FileBroadSchema),\n status: Schema.Literal(\"OK\"),\n total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst PublicShareFileListContinueEnvelopeSchema = Schema.Struct({\n breadcrumbs: Schema.optional(Schema.Array(Schema.Tuple([Schema.Int, Schema.String]))),\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(FileBroadSchema),\n parent: Schema.optional(Schema.NullOr(FileBroadSchema)),\n status: Schema.Literal(\"OK\"),\n total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst PublicShareFileUrlEnvelopeSchema = Schema.Struct({\n status: Schema.optional(Schema.Literal(\"OK\")),\n url: Schema.String,\n});\nexport const PublicShareListQuerySchema = Schema.Struct({\n breadcrumbs: Schema.optional(Schema.Literal(1)),\n content_type: Schema.optional(Schema.String),\n file_type: Schema.optional(Schema.String),\n hidden: Schema.optional(Schema.Literal(1)),\n media_info_parent: Schema.optional(Schema.Literal(1)),\n mp4_status_parent: Schema.optional(Schema.Literal(1)),\n parent_id: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n sort: Schema.optional(Schema.String),\n sort_by: Schema.optional(Schema.String),\n stream_url_parent: Schema.optional(Schema.Literal(1)),\n total: Schema.optional(Schema.Literal(1)),\n video_metadata_parent: Schema.optional(Schema.Literal(1)),\n});\nconst PublicShareContinueInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n query: Schema.Struct({\n per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n }),\n});\nexport type SharingCloneInput = Schema.Schema.Type<typeof SharingCloneInputSchema>;\nexport type SharingCloneInfo = Schema.Schema.Type<typeof SharingCloneInfoSchema>;\nexport type SharedFile = Schema.Schema.Type<typeof SharedFileSchema>;\nexport type SharedFileShare = Schema.Schema.Type<typeof SharedFileShareSchema>;\nexport type SharedFileSharedWith = Schema.Schema.Type<typeof SharedFileSharedWithSchema>;\nexport type SharingShareInput = Schema.Schema.Type<typeof SharingShareInputSchema>;\nexport type SharingUnshareInput = Schema.Schema.Type<typeof SharingUnshareInputSchema>;\nexport type PublicShare = Schema.Schema.Type<typeof PublicShareSchema>;\nexport type PublicShareListQuery = Schema.Schema.Type<typeof PublicShareListQuerySchema>;\nexport const CreateSharingCloneErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"clone\",\n knownErrors: [\n { errorType: \"SharedFileCloneConcurrentLimitError\", statusCode: 400 as const },\n { errorType: \"SharedFileCloneTooManyFilesError\", statusCode: 400 as const },\n { errorType: \"SharedFileCloneTooManyChildren\", statusCode: 400 as const },\n { errorType: \"SharedFileCloneTooManyChildrenError\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const GetSharingCloneInfoErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"getCloneInfo\",\n knownErrors: [\n { errorType: \"SHARED_FILE_CLONE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ShareFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"shareFiles\",\n knownErrors: [\n { errorType: \"ALREADY_SHARED\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const ListSharedFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"listSharedFiles\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const GetSharedWithErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"getSharedWith\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const UnshareFileErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"unshare\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const CreatePublicShareErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"createPublicShare\",\n knownErrors: [\n { errorType: \"PUBLIC_SHARE_NOT_ALLOWED_PLAN\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_FOLDER_ROOT_NOT_ALLOWED\", statusCode: 400 as const },\n { errorType: \"PUBLIC_SHARE_SINGLE_FILE_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_FOLDER_LINK_COUNT_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_FOLDER_MAX_SIZE_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_FOLDER_MAX_CHILDREN_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_DAILY_TOTAL_LINK_COUNT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_WEEKLY_TOTAL_LINK_COUNT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ListPublicSharesErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"listPublicShares\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const DeletePublicShareErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"deletePublicShare\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const GetPublicShareErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"getPublicShare\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ListPublicShareFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"listPublicShareFiles\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ContinuePublicShareFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"continuePublicShareFiles\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const GetPublicShareFileUrlErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"getPublicShareFileUrl\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport type CreateSharingCloneError = PutioOperationFailure<typeof CreateSharingCloneErrorSpec>;\nexport type GetSharingCloneInfoError = PutioOperationFailure<typeof GetSharingCloneInfoErrorSpec>;\nexport type ShareFilesError = PutioOperationFailure<typeof ShareFilesErrorSpec>;\nexport type ListSharedFilesError = PutioOperationFailure<typeof ListSharedFilesErrorSpec>;\nexport type GetSharedWithError = PutioOperationFailure<typeof GetSharedWithErrorSpec>;\nexport type UnshareFileError = PutioOperationFailure<typeof UnshareFileErrorSpec>;\nexport type CreatePublicShareError = PutioOperationFailure<typeof CreatePublicShareErrorSpec>;\nexport type ListPublicSharesError = PutioOperationFailure<typeof ListPublicSharesErrorSpec>;\nexport type DeletePublicShareError = PutioOperationFailure<typeof DeletePublicShareErrorSpec>;\nexport type GetPublicShareError = PutioOperationFailure<typeof GetPublicShareErrorSpec>;\nexport type ListPublicShareFilesError = PutioOperationFailure<typeof ListPublicShareFilesErrorSpec>;\nexport type ContinuePublicShareFilesError = PutioOperationFailure<\n typeof ContinuePublicShareFilesErrorSpec\n>;\nexport type GetPublicShareFileUrlError = PutioOperationFailure<\n typeof GetPublicShareFileUrlErrorSpec\n>;\nconst toShareTarget = (target: SharingShareInput[\"target\"]): string =>\n target.type === \"everyone\" ? \"everyone\" : target.friendNames.join(\",\");\nexport const cloneSharedFiles = (\n input: SharingCloneInput = {},\n): Effect.Effect<\n {\n readonly id: number;\n },\n CreateSharingCloneError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(SharingCloneInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(SharingCloneEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm(decodedInput),\n parent_id: decodedInput.parentId ?? 0,\n },\n },\n method: \"POST\",\n path: \"/v2/sharing/clone\",\n }),\n ),\n selectJsonFields(\"id\"),\n withOperationErrors(CreateSharingCloneErrorSpec),\n );\nexport const getSharingCloneInfo = (\n id: number,\n): Effect.Effect<SharingCloneInfo, GetSharingCloneInfoError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(SharingCloneInfoSchema, {\n method: \"GET\",\n path: `/v2/sharing/clone/${encodePathSegment(decodedId)}`,\n }),\n ),\n withOperationErrors(GetSharingCloneInfoErrorSpec),\n );\nexport const shareFiles = (\n input: SharingShareInput,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, ShareFilesError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(SharingShareInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm(decodedInput),\n friends: toShareTarget(decodedInput.target),\n },\n },\n method: \"POST\",\n path: \"/v2/files/share\",\n }),\n ),\n withOperationErrors(ShareFilesErrorSpec),\n );\nexport const listSharedFiles = (): Effect.Effect<\n ReadonlyArray<SharedFile>,\n ListSharedFilesError,\n PutioSdkContext\n> =>\n requestJson(SharedFilesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/files/shared\",\n }).pipe(selectJsonField(\"shared\"), withOperationErrors(ListSharedFilesErrorSpec));\nexport const getSharedWith = (\n fileId: number,\n): Effect.Effect<SharedFileSharedWith, GetSharedWithError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedFileId) =>\n requestJson(SharedFileSharedWithSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/shared-with-v2`,\n }),\n ),\n withOperationErrors(GetSharedWithErrorSpec),\n );\nexport const unshareFile = (\n input: SharingUnshareInput,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, UnshareFileError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(SharingUnshareInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n shares: joinCsv(decodedInput.shares) ?? \"everyone\",\n },\n },\n method: \"POST\",\n path: `/v2/files/${encodePathSegment(decodedInput.fileId)}/unshare`,\n }),\n ),\n withOperationErrors(UnshareFileErrorSpec),\n );\nexport const createPublicShare = (\n fileId: number,\n): Effect.Effect<PublicShare, CreatePublicShareError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedFileId) =>\n requestJson(PublicShareEnvelopeSchema, {\n method: \"POST\",\n path: `/v2/public_share/${encodePathSegment(decodedFileId)}`,\n }),\n ),\n selectJsonField(\"public_share\"),\n withOperationErrors(CreatePublicShareErrorSpec),\n );\nexport const listPublicShares = (): Effect.Effect<\n ReadonlyArray<PublicShare>,\n ListPublicSharesError,\n PutioSdkContext\n> =>\n requestJson(PublicSharesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/public_share/list\",\n }).pipe(selectJsonField(\"public_shares\"), withOperationErrors(ListPublicSharesErrorSpec));\nexport const deletePublicShare = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n DeletePublicShareError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"DELETE\",\n path: `/v2/public_share/${encodePathSegment(decodedId)}`,\n }),\n ),\n withOperationErrors(DeletePublicShareErrorSpec),\n );\nexport const getPublicShare = (): Effect.Effect<\n PublicShare,\n GetPublicShareError,\n PutioSdkContext\n> =>\n requestJson(PublicShareEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/public_share\",\n }).pipe(selectJsonField(\"public_share\"), withOperationErrors(GetPublicShareErrorSpec));\nexport const listPublicShareFiles = (\n query: PublicShareListQuery = {},\n): Effect.Effect<\n Schema.Schema.Type<typeof PublicShareFileListEnvelopeSchema>,\n ListPublicShareFilesError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PublicShareListQuerySchema, { onExcessProperty: \"error\" })(query).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedQuery) =>\n requestJson(PublicShareFileListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/public_share/files/list\",\n query: decodedQuery,\n }),\n ),\n withOperationErrors(ListPublicShareFilesErrorSpec),\n );\nexport const continuePublicShareFiles = (\n cursor: string,\n query: {\n readonly per_page?: number;\n } = {},\n): Effect.Effect<\n Schema.Schema.Type<typeof PublicShareFileListContinueEnvelopeSchema>,\n ContinuePublicShareFilesError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PublicShareContinueInputSchema, { onExcessProperty: \"error\" })({\n cursor,\n query,\n }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(PublicShareFileListContinueEnvelopeSchema, {\n body: {\n type: \"form\",\n value: { cursor: decodedInput.cursor },\n },\n method: \"POST\",\n path: \"/v2/public_share/files/list/continue\",\n query: decodedInput.query,\n }),\n ),\n withOperationErrors(ContinuePublicShareFilesErrorSpec),\n );\nexport const getPublicShareFileUrl = (\n fileId: number,\n): Effect.Effect<string, GetPublicShareFileUrlError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedFileId) =>\n requestJson(PublicShareFileUrlEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/public_share/files/${encodePathSegment(decodedFileId)}/url`,\n }),\n ),\n selectJsonField(\"url\"),\n withOperationErrors(GetPublicShareFileUrlErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\n\nimport { joinCsv } from \"../core/forms.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema, decodeAndRun } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { FileTypeSchema } from \"./files.js\";\nimport { OkResponseSchema, requestJson, type PutioSdkContext } from \"../core/http.js\";\n\nexport const TrashFileSchema = Schema.Struct({\n content_type: Schema.NullOr(Schema.String),\n created_at: Schema.String,\n deleted_at: Schema.String,\n expiration_date: Schema.String,\n extension: Schema.NullOr(Schema.String),\n file_type: FileTypeSchema,\n first_accessed_at: Schema.NullOr(Schema.String),\n folder_type: Schema.Literal(\"REGULAR\"),\n icon: Schema.NullOr(Schema.String),\n id: Schema.Int,\n name: Schema.String,\n parent_id: Schema.NullOr(Schema.Int),\n screenshot: Schema.Unknown,\n size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n});\n\nconst TrashListEnvelopeSchema = Schema.Struct({\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(TrashFileSchema),\n status: Schema.Literal(\"OK\"),\n total: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n trash_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n});\n\nconst TrashContinueEnvelopeSchema = Schema.Struct({\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(TrashFileSchema),\n status: Schema.Literal(\"OK\"),\n});\n\nexport type TrashFile = Schema.Schema.Type<typeof TrashFileSchema>;\nexport type TrashListResponse = Schema.Schema.Type<typeof TrashListEnvelopeSchema>;\nexport type TrashContinueResponse = Schema.Schema.Type<typeof TrashContinueEnvelopeSchema>;\nconst TrashListQuerySchema = Schema.Struct({\n per_page: Schema.optional(PositiveIntegerSchema),\n});\nconst TrashCursorBulkInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n file_ids: Schema.optional(Schema.Never),\n useCursor: Schema.Literal(true),\n});\nconst TrashIdsBulkInputSchema = Schema.Struct({\n cursor: Schema.optional(Schema.Never),\n file_ids: Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1)),\n useCursor: Schema.optional(Schema.Literal(false)),\n});\nconst TrashBulkInputSchema = Schema.Union([TrashCursorBulkInputSchema, TrashIdsBulkInputSchema]);\nconst TrashContinueInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n query: TrashListQuerySchema,\n});\nexport type TrashListQuery = Schema.Schema.Type<typeof TrashListQuerySchema>;\nexport type TrashBulkInput = Schema.Schema.Type<typeof TrashBulkInputSchema>;\n\nconst RestrictedReadError = { errorType: \"invalid_scope\", statusCode: 401 as const };\nconst RestrictedWriteError = { errorType: \"invalid_scope\", statusCode: 401 as const };\n\nexport const ListTrashErrorSpec = definePutioOperationErrorSpec({\n domain: \"trash\",\n operation: \"list\",\n knownErrors: [RestrictedReadError],\n});\n\nexport const ContinueTrashErrorSpec = definePutioOperationErrorSpec({\n domain: \"trash\",\n operation: \"continue\",\n knownErrors: [RestrictedReadError, { statusCode: 400 as const }],\n});\n\nexport const RestoreTrashErrorSpec = definePutioOperationErrorSpec({\n domain: \"trash\",\n operation: \"restore\",\n knownErrors: [\n { errorType: \"TRASH_FILE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"TRASH_LOCK_TIMEOUT\", statusCode: 400 as const },\n { errorType: \"TRASH_INCOMPLETE_TRASH\", statusCode: 400 as const },\n { errorType: \"TRASH_RESTORE_TOO_MANY_FILES\", statusCode: 400 as const },\n RestrictedWriteError,\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\n\nexport const DeleteTrashErrorSpec = definePutioOperationErrorSpec({\n domain: \"trash\",\n operation: \"delete\",\n knownErrors: [\n { errorType: \"TRASH_FILE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"TRASH_LOCK_TIMEOUT\", statusCode: 400 as const },\n RestrictedWriteError,\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\n\nexport const EmptyTrashErrorSpec = definePutioOperationErrorSpec({\n domain: \"trash\",\n operation: \"empty\",\n knownErrors: [\n { errorType: \"TRASH_LOCK_TIMEOUT\", statusCode: 400 as const },\n RestrictedWriteError,\n ],\n});\n\nexport type ListTrashError = PutioOperationFailure<typeof ListTrashErrorSpec>;\nexport type ContinueTrashError = PutioOperationFailure<typeof ContinueTrashErrorSpec>;\nexport type RestoreTrashError = PutioOperationFailure<typeof RestoreTrashErrorSpec>;\nexport type DeleteTrashError = PutioOperationFailure<typeof DeleteTrashErrorSpec>;\nexport type EmptyTrashError = PutioOperationFailure<typeof EmptyTrashErrorSpec>;\n\nconst toBulkTrashBody = (input: TrashBulkInput) => {\n if (input.useCursor === true) {\n return {\n cursor: input.cursor,\n file_ids: undefined,\n };\n }\n return {\n cursor: undefined,\n file_ids: joinCsv(input.file_ids),\n };\n};\n\nexport const listTrash = (\n query: TrashListQuery = {},\n): Effect.Effect<TrashListResponse, ListTrashError, PutioSdkContext> =>\n decodeAndRun(TrashListQuerySchema, query, (decodedQuery) =>\n requestJson(TrashListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/trash/list\",\n query: decodedQuery,\n }),\n ).pipe(withOperationErrors(ListTrashErrorSpec));\n\nexport const continueTrash = (\n cursor: string,\n query: TrashListQuery = {},\n): Effect.Effect<TrashContinueResponse, ContinueTrashError, PutioSdkContext> =>\n decodeAndRun(TrashContinueInputSchema, { cursor, query }, (decodedInput) =>\n requestJson(TrashContinueEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n cursor: decodedInput.cursor,\n },\n },\n method: \"POST\",\n path: \"/v2/trash/list/continue\",\n query: decodedInput.query,\n }),\n ).pipe(withOperationErrors(ContinueTrashErrorSpec));\n\nexport const restoreTrash = (\n input: TrashBulkInput,\n): Effect.Effect<void, RestoreTrashError, PutioSdkContext> =>\n decodeAndRun(TrashBulkInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: toBulkTrashBody(decodedInput),\n },\n method: \"POST\",\n path: \"/v2/trash/restore\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(RestoreTrashErrorSpec));\n\nexport const deleteTrash = (\n input: TrashBulkInput,\n): Effect.Effect<void, DeleteTrashError, PutioSdkContext> =>\n decodeAndRun(TrashBulkInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: toBulkTrashBody(decodedInput),\n },\n method: \"POST\",\n path: \"/v2/trash/delete\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(DeleteTrashErrorSpec));\n\nexport const emptyTrash = (): Effect.Effect<void, EmptyTrashError, PutioSdkContext> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/trash/empty\",\n }).pipe(Effect.asVoid, withOperationErrors(EmptyTrashErrorSpec));\n","import { Effect, Schema } from \"effect\";\nimport { joinCsv } from \"../core/forms.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema, decodeAndRun } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n type PutioSdkError,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestArrayBuffer,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nconst TransferIdSchema = PositiveIntegerSchema;\nconst TransferIdsSchema = Schema.Array(TransferIdSchema).check(Schema.isMinLength(1));\nexport const TransferTypeSchema = Schema.Literals([\n \"URL\",\n \"TORRENT\",\n \"PLAYLIST\",\n \"LIVE_STREAM\",\n \"N/A\",\n]);\nexport const TransferStatusSchema = Schema.Literals([\n \"WAITING\",\n \"PREPARING_DOWNLOAD\",\n \"IN_QUEUE\",\n \"DOWNLOADING\",\n \"WAITING_FOR_COMPLETE_QUEUE\",\n \"WAITING_FOR_DOWNLOADER\",\n \"COMPLETING\",\n \"STOPPING\",\n \"SEEDING\",\n \"COMPLETED\",\n \"ERROR\",\n \"PREPARING_SEED\",\n]);\nconst TransferLinkSchema = Schema.Struct({\n label: Schema.String,\n url: Schema.NullOr(Schema.String),\n});\nconst NullableInt = Schema.NullOr(Schema.Int);\nconst NullableNonNegativeNumber = Schema.NullOr(\n Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n);\nexport const TransferBaseSchema = Schema.Struct({\n availability: NullableNonNegativeNumber,\n callback_url: Schema.NullOr(Schema.String),\n client_ip: Schema.NullOr(Schema.String),\n completion_percent: NullableNonNegativeNumber,\n created_at: Schema.String,\n created_torrent: Schema.Boolean,\n current_ratio: NullableNonNegativeNumber,\n download_id: NullableInt,\n down_speed: NullableNonNegativeNumber,\n downloaded: NullableNonNegativeNumber,\n error_message: Schema.NullOr(Schema.String),\n estimated_time: NullableNonNegativeNumber,\n file_id: NullableInt,\n finished_at: Schema.NullOr(Schema.String),\n hash: Schema.NullOr(Schema.String),\n id: Schema.Int,\n is_private: Schema.Boolean,\n links: Schema.optional(Schema.Array(TransferLinkSchema)),\n name: Schema.String,\n peers_connected: NullableInt,\n peers_getting_from_us: NullableInt,\n peers_sending_to_us: NullableInt,\n percent_done: NullableNonNegativeNumber,\n recorded_seconds: Schema.optional(NullableNonNegativeNumber),\n save_parent_id: Schema.Int,\n seconds_seeding: NullableNonNegativeNumber,\n simulated: Schema.Boolean,\n size: NullableNonNegativeNumber,\n source: Schema.String,\n started_at: Schema.NullOr(Schema.String),\n status: TransferStatusSchema,\n subscription_id: NullableInt,\n torrent_link: Schema.NullOr(Schema.String),\n tracker: Schema.NullOr(Schema.String),\n tracker_message: Schema.NullOr(Schema.String),\n type: TransferTypeSchema,\n uploaded: NullableNonNegativeNumber,\n up_speed: NullableNonNegativeNumber,\n userfile_exists: Schema.optional(Schema.Boolean),\n});\nconst TransferErrorSchema = TransferBaseSchema.mapFields(\n ({ error_message: _errorMessage, status: _status, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n error_message: Schema.String,\n status: Schema.Literal(\"ERROR\"),\n }),\n);\nconst TransferCompletedSchema = TransferBaseSchema.mapFields(\n ({ status: _status, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n status: Schema.Literal(\"COMPLETED\"),\n }),\n);\nconst TransferLiveSchema = TransferBaseSchema.mapFields(\n ({ recorded_seconds: _recordedSeconds, type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n recorded_seconds: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n type: Schema.Literal(\"LIVE_STREAM\"),\n }),\n);\nconst TransferTorrentSeedingSchema = TransferBaseSchema.mapFields(\n ({\n current_ratio: _currentRatio,\n seconds_seeding: _secondsSeeding,\n status: _status,\n type: _type,\n ...fields\n }) => fields,\n).pipe(\n Schema.fieldsAssign({\n current_ratio: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n seconds_seeding: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literals([\"SEEDING\", \"COMPLETED\", \"PREPARING_SEED\"]),\n type: Schema.Literal(\"TORRENT\"),\n }),\n);\nexport const TransferSchema = Schema.Union([\n TransferErrorSchema,\n TransferLiveSchema,\n TransferTorrentSeedingSchema,\n TransferCompletedSchema,\n TransferBaseSchema,\n]);\nexport const TransfersListQuerySchema = Schema.Struct({\n per_page: Schema.optional(PositiveIntegerSchema),\n});\nexport const TransferAddInputSchema = Schema.Struct({\n callback_url: Schema.optional(NonEmptyStringSchema),\n save_parent_id: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n url: NonEmptyStringSchema,\n});\nconst TransferContinueInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n query: TransfersListQuerySchema,\n});\nconst TransferInfoUrlSchema = Schema.String.check(\n Schema.isMinLength(1),\n Schema.isPattern(/^[^\\r\\n]+$/),\n);\nconst TransferInfoUrlsSchema = Schema.Array(TransferInfoUrlSchema).check(Schema.isMinLength(1));\nconst TransferAddManyInputSchema = Schema.Array(TransferAddInputSchema).check(\n Schema.isMinLength(1),\n);\nconst TransferCleanIdsSchema = Schema.Array(TransferIdSchema);\nconst TrackerSchema = Schema.String.check(Schema.isPattern(/^[^,\\s]+$/));\nexport const TransferAddTrackersInputSchema = Schema.Struct({\n trackers: Schema.Array(TrackerSchema).check(Schema.isMinLength(1)),\n transferId: TransferIdSchema,\n});\nconst TransferRemoveIdsInputSchema = Schema.Struct({\n filter: Schema.optional(Schema.Never),\n ids: TransferIdsSchema,\n});\nconst TransferRemoveFilterInputSchema = Schema.Struct({\n filter: Schema.Literals([\"all\", \"completed\"]),\n ids: Schema.optional(Schema.Never),\n});\nexport const TransferRemoveInputSchema = Schema.Union([\n TransferRemoveIdsInputSchema,\n TransferRemoveFilterInputSchema,\n]);\nconst TransferInfoItemSchema = Schema.Struct({\n error: Schema.optional(Schema.String),\n error_message: Schema.optional(Schema.String),\n file_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n human_size: Schema.String,\n name: Schema.String,\n type_name: Schema.String,\n url: Schema.String,\n});\nconst TransfersListEnvelopeSchema = Schema.Struct({\n cursor: Schema.optional(Schema.NullOr(Schema.String)),\n status: Schema.Literal(\"OK\"),\n total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n transfers: Schema.Array(TransferSchema),\n});\nconst TransfersContinueEnvelopeSchema = Schema.Struct({\n cursor: Schema.NullOr(Schema.String),\n status: Schema.Literal(\"OK\"),\n transfers: Schema.Array(TransferSchema),\n});\nconst TransferEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n transfer: TransferSchema,\n});\nconst TransferCountEnvelopeSchema = Schema.Struct({\n count: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n});\nconst TransferInfoEnvelopeSchema = Schema.Struct({\n disk_avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n ret: Schema.Array(TransferInfoItemSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst TransfersAddMultiErrorSchema = Schema.Struct({\n error_type: Schema.String,\n status_code: Schema.Int,\n url: Schema.String,\n});\nconst TransfersAddMultiEnvelopeSchema = Schema.Struct({\n errors: Schema.Array(TransfersAddMultiErrorSchema),\n status: Schema.Literal(\"OK\"),\n transfers: Schema.Array(TransferSchema),\n});\nconst TransfersCleanEnvelopeSchema = Schema.Struct({\n deleted_ids: Schema.Array(Schema.Int),\n status: Schema.Literal(\"OK\"),\n});\nexport type TransferType = Schema.Schema.Type<typeof TransferTypeSchema>;\nexport type TransferStatus = Schema.Schema.Type<typeof TransferStatusSchema>;\nexport type TransferLink = Schema.Schema.Type<typeof TransferLinkSchema>;\nexport type Transfer = Schema.Schema.Type<typeof TransferSchema>;\nexport type TransfersListQuery = Schema.Schema.Type<typeof TransfersListQuerySchema>;\nexport type TransferAddInput = Schema.Schema.Type<typeof TransferAddInputSchema>;\nexport type TransferAddTrackersInput = Schema.Schema.Type<typeof TransferAddTrackersInputSchema>;\nexport type TransferRemoveInput = Schema.Schema.Type<typeof TransferRemoveInputSchema>;\nexport type TransferInfoItem = Schema.Schema.Type<typeof TransferInfoItemSchema>;\nexport type TransfersListResponse = Schema.Schema.Type<typeof TransfersListEnvelopeSchema>;\nexport type TransfersContinueResponse = Schema.Schema.Type<typeof TransfersContinueEnvelopeSchema>;\nexport type TransfersAddMultiError = Schema.Schema.Type<typeof TransfersAddMultiErrorSchema>;\nexport const ListTransfersErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"list\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const GetTransferErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"get\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const GetTransferTorrentErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"getTorrent\",\n knownErrors: [\n { errorType: \"NOT_TORRENT\", statusCode: 400 as const },\n { errorType: \"IS_MAGNET\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const AddTransferTrackersErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"addTrackers\",\n knownErrors: [\n { errorType: \"NO_TRACKERS\", statusCode: 400 as const },\n { errorType: \"TORRENT_NOT_ACTIVE\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 402 as const },\n { errorType: \"TRANSFER_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"TRANSFER_INVALID\", statusCode: 500 as const },\n { errorType: \"TORRENT_NOT_READY\", statusCode: 500 as const },\n ],\n});\nexport const RemoveTransfersErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"remove\",\n knownErrors: [\n { statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const AddTransferErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"add\",\n knownErrors: [\n { errorType: \"EMPTY_URL\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const AddManyTransfersErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"addMany\",\n knownErrors: [\n { errorType: \"TOO_MANY_URLS\", statusCode: 403 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const RetryTransferErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"retry\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ReannounceTransferErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"reannounce\",\n knownErrors: [\n { errorType: \"NOT_TORRENT\", statusCode: 400 as const },\n { errorType: \"TORRENT_NOT_ACTIVE\", statusCode: 400 as const },\n { errorType: \"BadRequest\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n { statusCode: 500 as const },\n ],\n});\nexport const StopRecordingTransferErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"stopRecording\",\n knownErrors: [\n { errorType: \"NOT_RECORDING\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport type ListTransfersError = PutioOperationFailure<typeof ListTransfersErrorSpec>;\nexport type GetTransferError = PutioOperationFailure<typeof GetTransferErrorSpec>;\nexport type GetTransferTorrentError = PutioOperationFailure<typeof GetTransferTorrentErrorSpec>;\nexport type AddTransferTrackersError = PutioOperationFailure<typeof AddTransferTrackersErrorSpec>;\nexport type RemoveTransfersError = PutioOperationFailure<typeof RemoveTransfersErrorSpec>;\nexport type AddTransferError = PutioOperationFailure<typeof AddTransferErrorSpec>;\nexport type AddManyTransfersError = PutioOperationFailure<typeof AddManyTransfersErrorSpec>;\nexport type RetryTransferError = PutioOperationFailure<typeof RetryTransferErrorSpec>;\nexport type ReannounceTransferError = PutioOperationFailure<typeof ReannounceTransferErrorSpec>;\nexport type StopRecordingTransferError = PutioOperationFailure<\n typeof StopRecordingTransferErrorSpec\n>;\nexport const listTransfers = (\n query: TransfersListQuery = {},\n): Effect.Effect<TransfersListResponse, ListTransfersError, PutioSdkContext> =>\n decodeAndRun(TransfersListQuerySchema, query, (decodedQuery) =>\n requestJson(TransfersListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/transfers/list\",\n query: decodedQuery,\n }),\n ).pipe(withOperationErrors(ListTransfersErrorSpec));\nexport const continueTransfers = (\n cursor: string,\n query: TransfersListQuery = {},\n): Effect.Effect<TransfersContinueResponse, ListTransfersError, PutioSdkContext> =>\n decodeAndRun(TransferContinueInputSchema, { cursor, query }, (decodedInput) =>\n requestJson(TransfersContinueEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n cursor: decodedInput.cursor,\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/list/continue\",\n query: decodedInput.query,\n }),\n ).pipe(withOperationErrors(ListTransfersErrorSpec));\nexport const getTransfer = (\n id: number,\n): Effect.Effect<Transfer, GetTransferError, PutioSdkContext> =>\n decodeAndRun(TransferIdSchema, id, (decodedId) =>\n requestJson(TransferEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/transfers/${encodePathSegment(decodedId)}`,\n }).pipe(selectJsonField(\"transfer\")),\n ).pipe(withOperationErrors(GetTransferErrorSpec));\nexport const getTransferTorrent = (\n id: number,\n): Effect.Effect<Uint8Array, GetTransferTorrentError, PutioSdkContext> =>\n decodeAndRun(TransferIdSchema, id, (decodedId) =>\n requestArrayBuffer({\n method: \"GET\",\n path: `/v2/transfers/${encodePathSegment(decodedId)}/torrent`,\n }),\n ).pipe(withOperationErrors(GetTransferTorrentErrorSpec));\nexport const countTransfers = (): Effect.Effect<number, PutioSdkError, PutioSdkContext> =>\n requestJson(TransferCountEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/transfers/count\",\n }).pipe(selectJsonField(\"count\"));\nexport const getTransferInfo = (\n urls: ReadonlyArray<string>,\n): Effect.Effect<\n {\n readonly disk_avail: number;\n readonly ret: ReadonlyArray<TransferInfoItem>;\n },\n PutioSdkError,\n PutioSdkContext\n> =>\n decodeAndRun(TransferInfoUrlsSchema, urls, (decodedUrls) =>\n requestJson(TransferInfoEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n urls: decodedUrls.join(\"\\n\"),\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/info\",\n }).pipe(selectJsonFields(\"disk_avail\", \"ret\")),\n );\nexport const addTransfer = (\n input: TransferAddInput,\n): Effect.Effect<Transfer, AddTransferError, PutioSdkContext> =>\n decodeAndRun(TransferAddInputSchema, input, (decodedInput) =>\n requestJson(TransferEnvelopeSchema, {\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/transfers/add\",\n }).pipe(selectJsonField(\"transfer\")),\n ).pipe(withOperationErrors(AddTransferErrorSpec));\nexport const addManyTransfers = (\n inputs: ReadonlyArray<TransferAddInput>,\n): Effect.Effect<\n {\n readonly errors: ReadonlyArray<TransfersAddMultiError>;\n readonly transfers: ReadonlyArray<Transfer>;\n },\n AddManyTransfersError,\n PutioSdkContext\n> =>\n decodeAndRun(TransferAddManyInputSchema, inputs, (decodedInputs) =>\n requestJson(TransfersAddMultiEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n urls: JSON.stringify(decodedInputs),\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/add-multi\",\n }).pipe(selectJsonFields(\"errors\", \"transfers\")),\n ).pipe(withOperationErrors(AddManyTransfersErrorSpec));\nexport const addTransferTrackers = (\n input: TransferAddTrackersInput,\n): Effect.Effect<void, AddTransferTrackersError, PutioSdkContext> =>\n decodeAndRun(TransferAddTrackersInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n trackers: joinCsv(decodedInput.trackers),\n },\n },\n method: \"POST\",\n path: `/v2/transfers/add-trackers/${encodePathSegment(decodedInput.transferId)}`,\n }),\n ).pipe(Effect.asVoid, withOperationErrors(AddTransferTrackersErrorSpec));\nexport const cancelTransfers = (\n ids: ReadonlyArray<number>,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(TransferIdsSchema, ids, (decodedIds) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n transfer_ids: joinCsv(decodedIds),\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/cancel\",\n }),\n );\nexport const cleanTransfers = (\n ids: ReadonlyArray<number> = [],\n): Effect.Effect<\n {\n readonly deleted_ids: ReadonlyArray<number>;\n },\n PutioSdkError,\n PutioSdkContext\n> =>\n decodeAndRun(TransferCleanIdsSchema, ids, (decodedIds) =>\n requestJson(TransfersCleanEnvelopeSchema, {\n body: {\n type: \"form\",\n value: decodedIds.length > 0 ? { transfer_ids: joinCsv(decodedIds) } : {},\n },\n method: \"POST\",\n path: \"/v2/transfers/clean\",\n }).pipe(selectJsonFields(\"deleted_ids\")),\n );\nexport const removeTransfers = (\n input: TransferRemoveInput,\n): Effect.Effect<void, RemoveTransfersError, PutioSdkContext> =>\n decodeAndRun(TransferRemoveInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value:\n decodedInput.ids !== undefined\n ? { transfer_ids: joinCsv(decodedInput.ids) }\n : { remove_filter: decodedInput.filter },\n },\n method: \"POST\",\n path: \"/v2/transfers/remove\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(RemoveTransfersErrorSpec));\nexport const retryTransfer = (\n id: number,\n): Effect.Effect<Transfer, RetryTransferError, PutioSdkContext> =>\n decodeAndRun(TransferIdSchema, id, (decodedId) =>\n requestJson(TransferEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n id: decodedId,\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/retry\",\n }).pipe(selectJsonField(\"transfer\")),\n ).pipe(withOperationErrors(RetryTransferErrorSpec));\nexport const reannounceTransfer = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ReannounceTransferError,\n PutioSdkContext\n> =>\n decodeAndRun(TransferIdSchema, id, (decodedId) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n id: decodedId,\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/reannounce\",\n }),\n ).pipe(withOperationErrors(ReannounceTransferErrorSpec));\nexport const stopTransferRecording = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n StopRecordingTransferError,\n PutioSdkContext\n> =>\n decodeAndRun(TransferIdSchema, id, (decodedId) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n transfer_id: decodedId,\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/stop-recording\",\n }),\n ).pipe(withOperationErrors(StopRecordingTransferErrorSpec));\n","import { Effect, Schema } from \"effect\";\n\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { requestJson, selectJsonField, type PutioSdkContext } from \"../core/http.js\";\n\nexport const TunnelRouteSchema = Schema.Struct({\n description: Schema.String,\n hosts: Schema.Array(Schema.String),\n name: Schema.String,\n});\n\nconst TunnelRoutesEnvelopeSchema = Schema.Struct({\n routes: Schema.Array(TunnelRouteSchema),\n status: Schema.Literal(\"OK\"),\n});\n\nexport type TunnelRoute = Schema.Schema.Type<typeof TunnelRouteSchema>;\n\nexport const ListTunnelRoutesErrorSpec = definePutioOperationErrorSpec({\n domain: \"tunnel\",\n operation: \"listRoutes\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\n\nexport type ListTunnelRoutesError = PutioOperationFailure<typeof ListTunnelRoutesErrorSpec>;\n\nexport const listTunnelRoutes = (): Effect.Effect<\n ReadonlyArray<TunnelRoute>,\n ListTunnelRoutesError,\n PutioSdkContext\n> =>\n requestJson(TunnelRoutesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/tunnel/routes\",\n }).pipe(selectJsonField(\"routes\"), withOperationErrors(ListTunnelRoutesErrorSpec));\n","import { Effect, Schema } from \"effect\";\nimport { toCursorSelectionForm } from \"../core/forms.js\";\nimport {\n PositiveIntegerSchema,\n decodeAndRun,\n makeCursorSelectionSchema,\n} from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport const ZipStatusSchema = Schema.Literals([\"NEW\", \"PROCESSING\", \"DONE\", \"ERROR\"]);\nconst ZipSummarySchema = Schema.Struct({\n created_at: Schema.String,\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n});\nconst ZipsListEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n zips: Schema.Array(ZipSummarySchema),\n});\nconst ZipCreateEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n zip_id: Schema.Int.check(Schema.isGreaterThan(0)),\n});\nconst ZipInfoPendingSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n url: Schema.Null,\n zip_status: Schema.Literals([\"NEW\", \"PROCESSING\"]),\n});\nconst ZipInfoErrorSchema = Schema.Struct({\n error_msg: Schema.String,\n status: Schema.Literal(\"OK\"),\n url: Schema.Null,\n zip_status: Schema.Literal(\"ERROR\"),\n});\nconst ZipMissingFileSchema = Schema.Struct({\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n missing: Schema.Boolean,\n name: Schema.String,\n});\nconst ZipInfoDoneSchema = Schema.Struct({\n id: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n missing_files: Schema.Array(Schema.Union([Schema.String, ZipMissingFileSchema])),\n size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n url: Schema.String,\n zip_status: Schema.Literal(\"DONE\"),\n});\nconst ZipInfoSchema = Schema.Union([ZipInfoPendingSchema, ZipInfoErrorSchema, ZipInfoDoneSchema]);\nexport type ZipSummary = Schema.Schema.Type<typeof ZipSummarySchema>;\nexport type ZipCreateResponse = Schema.Schema.Type<typeof ZipCreateEnvelopeSchema>;\nexport type ZipInfo = Schema.Schema.Type<typeof ZipInfoSchema>;\nconst CreateZipInputSchema = makeCursorSelectionSchema(\"file_ids\", \"exclude_ids\", {});\nexport type CreateZipInput = Schema.Schema.Type<typeof CreateZipInputSchema>;\nconst FilesReadScopeError = { errorType: \"invalid_scope\", statusCode: 401 as const };\nconst FilesWriteScopeError = { errorType: \"invalid_scope\", statusCode: 401 as const };\nexport const ListZipsErrorSpec = definePutioOperationErrorSpec({\n domain: \"zips\",\n operation: \"list\",\n knownErrors: [FilesReadScopeError],\n});\nexport const CreateZipErrorSpec = definePutioOperationErrorSpec({\n domain: \"zips\",\n operation: \"create\",\n knownErrors: [\n { errorType: \"ZIP_TOTAL_SIZE_EXCEEDED\", statusCode: 403 as const },\n FilesWriteScopeError,\n { statusCode: 400 as const },\n { statusCode: 403 as const },\n ],\n});\nexport const GetZipErrorSpec = definePutioOperationErrorSpec({\n domain: \"zips\",\n operation: \"get\",\n knownErrors: [\n { errorType: \"LINK_EXPIRED\", statusCode: 410 as const },\n { errorType: \"ERROR_IN_ZIP\", statusCode: 500 as const },\n FilesReadScopeError,\n { statusCode: 403 as const },\n { statusCode: 410 as const },\n { statusCode: 500 as const },\n ],\n});\nexport const CancelZipErrorSpec = definePutioOperationErrorSpec({\n domain: \"zips\",\n operation: \"cancel\",\n knownErrors: [\n { errorType: \"LINK_EXPIRED\", statusCode: 410 as const },\n FilesWriteScopeError,\n { statusCode: 403 as const },\n { statusCode: 410 as const },\n ],\n});\nexport type ListZipsError = PutioOperationFailure<typeof ListZipsErrorSpec>;\nexport type CreateZipError = PutioOperationFailure<typeof CreateZipErrorSpec>;\nexport type GetZipError = PutioOperationFailure<typeof GetZipErrorSpec>;\nexport type CancelZipError = PutioOperationFailure<typeof CancelZipErrorSpec>;\nexport const listZips = (): Effect.Effect<\n ReadonlyArray<ZipSummary>,\n ListZipsError,\n PutioSdkContext\n> =>\n requestJson(ZipsListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/zips/list\",\n }).pipe(selectJsonField(\"zips\"), withOperationErrors(ListZipsErrorSpec));\nexport const createZip = (\n input: CreateZipInput,\n): Effect.Effect<number, CreateZipError, PutioSdkContext> =>\n decodeAndRun(CreateZipInputSchema, input, (decodedInput) =>\n requestJson(ZipCreateEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm({\n cursor: decodedInput.cursor,\n excludeIds: decodedInput.exclude_ids,\n ids: decodedInput.file_ids,\n }),\n },\n },\n method: \"POST\",\n path: \"/v2/zips/create\",\n }),\n ).pipe(selectJsonField(\"zip_id\"), withOperationErrors(CreateZipErrorSpec));\nexport const getZip = (id: number): Effect.Effect<ZipInfo, GetZipError, PutioSdkContext> =>\n decodeAndRun(PositiveIntegerSchema, id, (decodedId) =>\n requestJson(ZipInfoSchema, {\n method: \"GET\",\n path: `/v2/zips/${encodePathSegment(decodedId)}`,\n }),\n ).pipe(withOperationErrors(GetZipErrorSpec));\nexport const cancelZip = (id: number): Effect.Effect<void, CancelZipError, PutioSdkContext> =>\n decodeAndRun(PositiveIntegerSchema, id, (decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"GET\",\n path: `/v2/zips/${encodePathSegment(decodedId)}/cancel`,\n }),\n ).pipe(Effect.asVoid, withOperationErrors(CancelZipErrorSpec));\n","import { Cause, Context, Effect, Exit, Layer, ManagedRuntime, Schema } from \"effect\";\n\nimport {\n clearAccount,\n destroyAccount,\n getAccountInfo,\n getAccountSettings,\n listAccountSubtitleLanguages,\n listAccountConfirmations,\n saveAccountSettings,\n} from \"../domains/account.js\";\nimport type {\n AccountInfoBase,\n AccountInfoBroad,\n AccountInfoQuery,\n PasInfo,\n} from \"../domains/account.js\";\nimport {\n createAppSpecificPassword,\n deleteAllAppSpecificPasswords,\n deleteAppSpecificPassword,\n listAppSpecificPasswords,\n} from \"../domains/app-specific-passwords.js\";\nimport {\n buildAuthLoginUrl,\n checkCodeMatch,\n clients,\n exchangeOAuthAuthorizationCode,\n exists,\n forgotPassword,\n generateTOTP,\n getCode,\n getFamilyInvite,\n getFriendInvite,\n getGiftCard,\n getRecoveryCodes,\n getVoucher,\n grants,\n linkDevice,\n login,\n logout,\n regenerateRecoveryCodes,\n register,\n resetPassword,\n revokeAllClients,\n revokeApp,\n revokeClient,\n validateToken,\n verifyTOTP,\n} from \"../domains/auth.js\";\nimport {\n deleteConfigKey,\n getConfigKey,\n getConfigKeyWith,\n readConfig,\n readConfigWith,\n setConfigKey,\n writeConfig,\n} from \"../domains/config.js\";\nimport { createDownloadLinks, getDownloadLinks } from \"../domains/download-links.js\";\nimport { clearEvents, deleteEvent, getEventTorrent, listEvents } from \"../domains/events.js\";\nimport {\n createFamilyInvite,\n joinFamily,\n listFamilyInvites,\n listFamilyMembers,\n removeFamilyMember,\n} from \"../domains/family.js\";\nimport { getIftttStatus, sendIftttEvent } from \"../domains/ifttt.js\";\nimport {\n canWriteFile,\n copyFile,\n createFileUploadFormData,\n createFileUploadRequest,\n continueFiles,\n continueSearch,\n convertFileToMp4,\n convertFileSelectionToMp4,\n convertFilesToMp4,\n createFolder,\n deleteFileExtraction,\n deleteFileMp4,\n deleteFileSelection,\n deleteFiles,\n extractFiles,\n findNextFile,\n findNextVideo,\n getApiContentUrl,\n getApiDownloadUrl,\n getApiMp4DownloadUrl,\n getDownloadUrl,\n getFileChild,\n getHlsMasterPlaylist,\n getHlsStreamUrl,\n getXspfPlaylistUrl,\n getFile,\n getMp4Status,\n getStartFrom,\n listActiveMp4Conversions,\n listFileExtractions,\n listFileSubtitles,\n moveFiles,\n moveFileSelection,\n putMp4ToMyFiles,\n queryFiles,\n renameFile,\n resetFileSortSettings,\n resetStartFrom,\n searchFiles,\n setFileSort,\n setFilesWatchStatus,\n setStartFrom,\n touchFiles,\n uploadFile,\n} from \"../domains/files.js\";\nimport type { FileCore, FileQuery, FileResponseFor, FileVideoMetadata } from \"../domains/files.js\";\nimport { createFriendInvite, listFriendInvites } from \"../domains/friend-invites.js\";\nimport {\n approveFriendRequest,\n countWaitingRequests,\n denyFriendRequest,\n getFriendSharedFolder,\n listFriends,\n listSentRequests,\n listWaitingRequests,\n removeFriend,\n searchFriends,\n sendFriendRequest,\n} from \"../domains/friends.js\";\nimport { makePutioSdkConfig, makePutioSdkLiveLayer, PutioSdkConfig } from \"./http.js\";\nimport type { PutioSdkConfigShape, PutioSdkContext } from \"./http.js\";\nimport {\n buildOAuthAppIconUrl,\n buildOAuthAuthorizeUrl,\n createOAuthApp,\n deleteOAuthApp,\n getOAuthApp,\n getPopularOAuthApps,\n queryOAuthApps,\n regenerateOAuthAppToken,\n setOAuthAppIcon,\n updateOAuthApp,\n} from \"../domains/oauth.js\";\nimport {\n classifyPaymentChangePlanResponse,\n confirmFastspringOrder,\n createOpenNodeCharge,\n createPaddleBillingUpdatePaymentMethodTransaction,\n createPaddleWaitingPayment,\n getPaymentInfo,\n getPaddleBillingInvoiceUrl,\n getPaymentVoucherInfo,\n listPaymentHistory,\n listPaymentInvites,\n listPaymentOptions,\n listPaymentPlans,\n previewPaymentChangePlan,\n redeemPaymentVoucher,\n reportPayments,\n stopPaymentSubscription,\n submitPaymentChangePlan,\n} from \"../domains/payment.js\";\nimport { getPodcastLinks } from \"../domains/podcast.js\";\nimport {\n clearRssFeedLogs,\n createRssFeed,\n deleteRssFeed,\n getRssFeed,\n listRssFeedItems,\n listRssFeeds,\n pauseRssFeed,\n resumeRssFeed,\n retryAllRssFeedItems,\n retryRssFeedItem,\n updateRssFeed,\n} from \"../domains/rss.js\";\nimport {\n cloneSharedFiles,\n continuePublicShareFiles,\n createPublicShare,\n deletePublicShare,\n getPublicShare,\n getPublicShareFileUrl,\n getSharedWith,\n getSharingCloneInfo,\n listPublicShareFiles,\n listPublicShares,\n listSharedFiles,\n shareFiles,\n unshareFile,\n} from \"../domains/sharing.js\";\nimport {\n continueTrash,\n deleteTrash,\n emptyTrash,\n listTrash,\n restoreTrash,\n} from \"../domains/trash.js\";\nimport {\n addManyTransfers,\n addTransfer,\n addTransferTrackers,\n cancelTransfers,\n cleanTransfers,\n continueTransfers,\n countTransfers,\n getTransfer,\n getTransferInfo,\n getTransferTorrent,\n listTransfers,\n reannounceTransfer,\n removeTransfers,\n retryTransfer,\n stopTransferRecording,\n} from \"../domains/transfers.js\";\nimport { listTunnelRoutes } from \"../domains/tunnel.js\";\nimport { cancelZip, createZip, getZip, listZips } from \"../domains/zips.js\";\nimport { mapConfigurationError } from \"./errors.js\";\n\ntype PutioSdkPromiseRuntime = ManagedRuntime.ManagedRuntime<PutioSdkContext, never>;\ntype PutioSdkPromiseRuntimeConfig = Omit<PutioSdkConfigShape, \"accessToken\">;\n\ninterface PutioSdkPromiseState {\n accessToken: string | undefined;\n readonly runtimeConfig: PutioSdkPromiseRuntimeConfig;\n}\n\nconst promiseClientRuntimeCache = new WeakMap<PutioSdkPromiseState, PutioSdkPromiseRuntime>();\nconst disposedPromiseClientStates = new WeakSet<PutioSdkPromiseState>();\n\nconst getPromiseClientRuntime = (state: PutioSdkPromiseState): PutioSdkPromiseRuntime => {\n if (disposedPromiseClientStates.has(state)) {\n throw mapConfigurationError(\n \"This Promise client has been disposed and can no longer execute SDK effects\",\n );\n }\n\n const cachedRuntime = promiseClientRuntimeCache.get(state);\n\n if (cachedRuntime) {\n return cachedRuntime;\n }\n\n const runtime = ManagedRuntime.make(makePutioSdkLiveLayer(state.runtimeConfig));\n promiseClientRuntimeCache.set(state, runtime);\n return runtime;\n};\n\nconst disposePromiseClientRuntime = async (state: PutioSdkPromiseState): Promise<void> => {\n disposedPromiseClientStates.add(state);\n\n const runtime = promiseClientRuntimeCache.get(state);\n promiseClientRuntimeCache.delete(state);\n\n if (!runtime) {\n return;\n }\n\n await runtime.dispose();\n};\n\nconst rejectWithSdkFailure = <A, E>(exit: Exit.Exit<A, E>): Promise<A> =>\n Exit.match(exit, {\n onSuccess: (value) => Promise.resolve(value),\n onFailure: (cause) => {\n const failure = cause.reasons.find(Cause.isFailReason);\n\n if (failure) {\n return Promise.reject(failure.error);\n }\n\n return Promise.reject(Cause.squash(cause));\n },\n });\n\nconst provideSdk = async <A, E>(\n state: PutioSdkPromiseState,\n effect: Effect.Effect<A, E, PutioSdkContext>,\n) => {\n const operationConfig = {\n ...state.runtimeConfig,\n accessToken: state.accessToken,\n };\n const operation = Effect.provideService(effect, PutioSdkConfig, operationConfig);\n\n return rejectWithSdkFailure(await getPromiseClientRuntime(state).runPromiseExit(operation));\n};\n\nconst snapshotUrl = (value: string | URL | undefined): string | URL | undefined =>\n typeof value === \"string\" || value === undefined ? value : new URL(value.href);\n\ntype PromiseOperation<T> = T extends (...args: infer Args) => infer Result\n ? Result extends Effect.Effect<infer Success, infer _Error, infer _Requirements>\n ? (...args: Args) => Promise<Success>\n : T\n : never;\n\ntype OperationBoundary = \"input-free\" | \"pure\" | \"validated\";\ntype Operation = (...args: never[]) => unknown;\nconst operationEntryMarker = Symbol(\"PutioSdkOperationEntry\");\ninterface OperationEntry<T extends Operation> {\n readonly [operationEntryMarker]: true;\n readonly boundary: OperationBoundary;\n readonly run: T;\n}\n\ntype EffectOperation<T extends Operation> =\n ReturnType<T> extends Effect.Effect<infer _Success, infer _Error, infer _Requirements>\n ? T\n : never;\n\ntype InputFreeEffectOperation<T extends Operation> =\n Parameters<T> extends [] ? EffectOperation<T> : never;\n\ntype ValidatedEffectOperation<T extends Operation> =\n Parameters<T> extends [] ? never : EffectOperation<T>;\n\ntype EffectReturnMember<T> =\n T extends Effect.Effect<infer _Success, infer _Error, infer _Requirements> ? T : never;\n\ntype PureOperation<T extends Operation> = [EffectReturnMember<ReturnType<T>>] extends [never]\n ? T\n : never;\n\nconst operationAtBoundary = <T extends Operation>(\n run: T,\n boundary: OperationBoundary,\n): OperationEntry<T> => {\n const entry = { boundary, run };\n Object.defineProperty(entry, operationEntryMarker, { value: true });\n return Object.freeze(entry) as OperationEntry<T>;\n};\n\nconst inputFree = <T extends Operation>(\n operation: InputFreeEffectOperation<T>,\n): OperationEntry<T> => operationAtBoundary(operation, \"input-free\");\n\nconst pure = <T extends Operation>(operation: PureOperation<T>): OperationEntry<T> =>\n operationAtBoundary(operation, \"pure\");\n\nconst validated = <T extends Operation>(\n operation: ValidatedEffectOperation<T>,\n): OperationEntry<T> => operationAtBoundary(operation, \"validated\");\n\ntype EffectOperationTree<T> =\n T extends OperationEntry<infer TOperation>\n ? TOperation\n : T extends object\n ? { [Key in keyof T]: EffectOperationTree<T[Key]> }\n : never;\n\ntype PromiseOperationTree<T> =\n T extends OperationEntry<infer TOperation>\n ? PromiseOperation<TOperation>\n : T extends object\n ? { [Key in keyof T]: PromiseOperationTree<T[Key]> }\n : never;\n\nconst isOperationEntry = (value: unknown): value is OperationEntry<Operation> =>\n typeof value === \"object\" &&\n value !== null &&\n Object.getPrototypeOf(value) === Object.prototype &&\n Object.isFrozen(value) &&\n Object.hasOwn(value, operationEntryMarker) &&\n value[operationEntryMarker] === true &&\n Object.hasOwn(value, \"boundary\") &&\n Object.hasOwn(value, \"run\") &&\n Reflect.ownKeys(value).length === 3 &&\n (value.boundary === \"input-free\" ||\n value.boundary === \"pure\" ||\n value.boundary === \"validated\") &&\n typeof value.run === \"function\";\n\nconst runClassifiedOperation = (\n entry: OperationEntry<Operation>,\n args: ReadonlyArray<unknown>,\n): unknown => {\n const result: unknown = Reflect.apply(entry.run, undefined, args);\n\n if (entry.boundary === \"pure\") {\n if (Effect.isEffect(result)) {\n throw new TypeError(\"Pure SDK operation returned an Effect\");\n }\n\n return result;\n }\n\n if (!Effect.isEffect(result)) {\n throw new TypeError(`${entry.boundary} SDK operation did not return an Effect`);\n }\n\n return result;\n};\n\nconst cloneOperationTree = <T extends object>(tree: T): EffectOperationTree<T> =>\n Object.fromEntries(\n Object.entries(tree).map(([key, value]) => [\n key,\n isOperationEntry(value) ? value.run : cloneOperationTree(value as object),\n ]),\n ) as EffectOperationTree<T>;\n\nconst runPromiseOperation = (\n entry: OperationEntry<Operation>,\n state: PutioSdkPromiseState,\n args: ReadonlyArray<unknown>,\n): unknown => {\n const result = runClassifiedOperation(entry, args);\n\n return entry.boundary === \"pure\"\n ? result\n : provideSdk(state, result as Effect.Effect<unknown, unknown, PutioSdkContext>);\n};\n\nconst makePromiseOperationTree = <T extends object>(\n tree: T,\n state: PutioSdkPromiseState,\n): PromiseOperationTree<T> =>\n Object.fromEntries(\n Object.entries(tree).map(([key, value]) => [\n key,\n isOperationEntry(value)\n ? (...args: ReadonlyArray<unknown>) => runPromiseOperation(value, state, args)\n : makePromiseOperationTree(value as object, state),\n ]),\n ) as PromiseOperationTree<T>;\n\nconst assertClassifiedOperationTree = (tree: object, parentPath = \"\"): void => {\n const entries = Object.entries(tree);\n\n if (Object.getPrototypeOf(tree) !== Object.prototype || entries.length === 0) {\n throw new TypeError(\n `SDK operation namespace ${parentPath || \"<root>\"} is not a non-empty plain object`,\n );\n }\n\n for (const [key, value] of entries) {\n const path = parentPath ? `${parentPath}.${key}` : key;\n\n if (isOperationEntry(value)) {\n continue;\n }\n\n if (typeof value === \"object\" && value !== null) {\n assertClassifiedOperationTree(value as object, path);\n } else {\n throw new TypeError(`SDK operation ${path} has no request-boundary classification`);\n }\n }\n};\n\nconst sharedOperationTree = {\n account: {\n appSpecificPasswords: {\n create: validated(createAppSpecificPassword),\n delete: validated(deleteAppSpecificPassword),\n deleteAll: inputFree(deleteAllAppSpecificPasswords),\n list: inputFree(listAppSpecificPasswords),\n },\n clear: validated(clearAccount),\n destroy: validated(destroyAccount),\n getInfo: validated(getAccountInfo),\n getSettings: inputFree(getAccountSettings),\n listSubtitleLanguages: inputFree(listAccountSubtitleLanguages),\n listConfirmations: validated(listAccountConfirmations),\n saveSettings: validated(saveAccountSettings),\n },\n auth: {\n buildLoginUrl: pure(buildAuthLoginUrl),\n checkCodeMatch: validated(checkCodeMatch),\n clients: inputFree(clients),\n exchangeAuthorizationCode: validated(exchangeOAuthAuthorizationCode),\n exists: validated(exists),\n forgotPassword: validated(forgotPassword),\n getCode: validated(getCode),\n getFamilyInvite: validated(getFamilyInvite),\n getFriendInvite: validated(getFriendInvite),\n getGiftCard: validated(getGiftCard),\n getVoucher: validated(getVoucher),\n grants: inputFree(grants),\n linkDevice: validated(linkDevice),\n login: validated(login),\n logout: inputFree(logout),\n register: validated(register),\n resetPassword: validated(resetPassword),\n revokeAllClients: inputFree(revokeAllClients),\n revokeApp: validated(revokeApp),\n revokeClient: validated(revokeClient),\n twoFactor: {\n generateTOTP: inputFree(generateTOTP),\n getRecoveryCodes: inputFree(getRecoveryCodes),\n regenerateRecoveryCodes: inputFree(regenerateRecoveryCodes),\n verifyTOTP: validated(verifyTOTP),\n },\n validateToken: validated(validateToken),\n },\n config: {\n deleteKey: validated(deleteConfigKey),\n getKey: validated(getConfigKey),\n getKeyWith: validated(getConfigKeyWith),\n read: inputFree(readConfig),\n readWith: validated(readConfigWith),\n setKey: validated(setConfigKey),\n write: validated(writeConfig),\n },\n downloadLinks: {\n create: validated(createDownloadLinks),\n get: validated(getDownloadLinks),\n },\n events: {\n clear: inputFree(clearEvents),\n delete: validated(deleteEvent),\n getTorrent: validated(getEventTorrent),\n list: validated(listEvents),\n },\n family: {\n createInvite: inputFree(createFamilyInvite),\n join: validated(joinFamily),\n listInvites: inputFree(listFamilyInvites),\n listMembers: inputFree(listFamilyMembers),\n removeMember: validated(removeFamilyMember),\n },\n ifttt: {\n getStatus: inputFree(getIftttStatus),\n sendEvent: validated(sendIftttEvent),\n },\n podcast: {\n getLinks: validated(getPodcastLinks),\n },\n files: {\n canWrite: validated(canWriteFile),\n continue: validated(continueFiles),\n continueSearch: validated(continueSearch),\n copy: validated(copyFile),\n convertToMp4: validated(convertFileToMp4),\n convertManyToMp4: validated(convertFilesToMp4),\n convertSelectionToMp4: validated(convertFileSelectionToMp4),\n createUploadRequest: validated(createFileUploadRequest),\n createFolder: validated(createFolder),\n deleteExtraction: validated(deleteFileExtraction),\n deleteMp4: validated(deleteFileMp4),\n deleteSelection: validated(deleteFileSelection),\n delete: validated(deleteFiles),\n extract: validated(extractFiles),\n findNext: validated(findNextFile),\n findNextVideo: validated(findNextVideo),\n getApiContentUrl: validated(getApiContentUrl),\n getApiDownloadUrl: validated(getApiDownloadUrl),\n getApiMp4DownloadUrl: validated(getApiMp4DownloadUrl),\n get: validated(getFile),\n getChild: validated(getFileChild),\n getDownloadUrl: validated(getDownloadUrl),\n getHlsMasterPlaylist: validated(getHlsMasterPlaylist),\n getHlsStreamUrl: validated(getHlsStreamUrl),\n getXspfPlaylistUrl: validated(getXspfPlaylistUrl),\n getMp4Status: validated(getMp4Status),\n getStartFrom: validated(getStartFrom),\n list: validated(queryFiles),\n listActiveConversions: inputFree(listActiveMp4Conversions),\n listExtractions: inputFree(listFileExtractions),\n listSubtitles: validated(listFileSubtitles),\n move: validated(moveFiles),\n moveSelection: validated(moveFileSelection),\n putMp4ToMyFiles: validated(putMp4ToMyFiles),\n rename: validated(renameFile),\n resetSortSettings: inputFree(resetFileSortSettings),\n resetStartFrom: validated(resetStartFrom),\n search: validated(searchFiles),\n setSort: validated(setFileSort),\n setWatchStatus: validated(setFilesWatchStatus),\n setStartFrom: validated(setStartFrom),\n touch: validated(touchFiles),\n upload: validated(uploadFile),\n },\n friendInvites: {\n create: inputFree(createFriendInvite),\n list: inputFree(listFriendInvites),\n },\n friends: {\n approve: validated(approveFriendRequest),\n countWaitingRequests: inputFree(countWaitingRequests),\n deny: validated(denyFriendRequest),\n list: inputFree(listFriends),\n listSentRequests: inputFree(listSentRequests),\n listWaitingRequests: inputFree(listWaitingRequests),\n remove: validated(removeFriend),\n search: validated(searchFriends),\n sendRequest: validated(sendFriendRequest),\n sharedFolder: validated(getFriendSharedFolder),\n },\n oauth: {\n buildAuthorizeUrl: pure(buildOAuthAuthorizeUrl),\n buildIconUrl: pure(buildOAuthAppIconUrl),\n create: validated(createOAuthApp),\n delete: validated(deleteOAuthApp),\n get: validated(getOAuthApp),\n getPopularApps: inputFree(getPopularOAuthApps),\n query: inputFree(queryOAuthApps),\n regenerateToken: validated(regenerateOAuthAppToken),\n setIcon: validated(setOAuthAppIcon),\n update: validated(updateOAuthApp),\n },\n payment: {\n changePlan: {\n classifyResponse: pure(classifyPaymentChangePlanResponse),\n preview: validated(previewPaymentChangePlan),\n submit: validated(submitPaymentChangePlan),\n },\n confirmFastspringOrder: validated(confirmFastspringOrder),\n getInfo: inputFree(getPaymentInfo),\n listHistory: validated(listPaymentHistory),\n listInvites: inputFree(listPaymentInvites),\n listOptions: inputFree(listPaymentOptions),\n listPlans: inputFree(listPaymentPlans),\n methods: {\n addPaddleWaitingPayment: validated(createPaddleWaitingPayment),\n createOpenNodeCharge: validated(createOpenNodeCharge),\n createPaddleBillingUpdatePaymentMethodTransaction: validated(\n createPaddleBillingUpdatePaymentMethodTransaction,\n ),\n getPaddleBillingInvoiceUrl: validated(getPaddleBillingInvoiceUrl),\n },\n report: validated(reportPayments),\n stopSubscription: inputFree(stopPaymentSubscription),\n voucher: {\n getInfo: validated(getPaymentVoucherInfo),\n redeem: validated(redeemPaymentVoucher),\n },\n },\n rss: {\n clearLogs: validated(clearRssFeedLogs),\n create: validated(createRssFeed),\n delete: validated(deleteRssFeed),\n get: validated(getRssFeed),\n list: inputFree(listRssFeeds),\n listItems: validated(listRssFeedItems),\n pause: validated(pauseRssFeed),\n resume: validated(resumeRssFeed),\n retryAll: validated(retryAllRssFeedItems),\n retryItem: validated(retryRssFeedItem),\n update: validated(updateRssFeed),\n },\n sharing: {\n clone: validated(cloneSharedFiles),\n getCloneInfo: validated(getSharingCloneInfo),\n getSharedWith: validated(getSharedWith),\n listSharedFiles: inputFree(listSharedFiles),\n publicAccess: {\n continueFiles: validated(continuePublicShareFiles),\n get: inputFree(getPublicShare),\n getFileUrl: validated(getPublicShareFileUrl),\n listFiles: validated(listPublicShareFiles),\n },\n publicShares: {\n create: validated(createPublicShare),\n delete: validated(deletePublicShare),\n list: inputFree(listPublicShares),\n },\n shareFiles: validated(shareFiles),\n unshare: validated(unshareFile),\n },\n tunnel: {\n listRoutes: inputFree(listTunnelRoutes),\n },\n trash: {\n continue: validated(continueTrash),\n delete: validated(deleteTrash),\n empty: inputFree(emptyTrash),\n list: validated(listTrash),\n restore: validated(restoreTrash),\n },\n transfers: {\n add: validated(addTransfer),\n addMany: validated(addManyTransfers),\n addTrackers: validated(addTransferTrackers),\n cancel: validated(cancelTransfers),\n clean: validated(cleanTransfers),\n continue: validated(continueTransfers),\n count: inputFree(countTransfers),\n get: validated(getTransfer),\n getTorrent: validated(getTransferTorrent),\n info: validated(getTransferInfo),\n list: validated(listTransfers),\n reannounce: validated(reannounceTransfer),\n remove: validated(removeTransfers),\n retry: validated(retryTransfer),\n stopRecording: validated(stopTransferRecording),\n },\n zips: {\n cancel: validated(cancelZip),\n create: validated(createZip),\n get: validated(getZip),\n list: inputFree(listZips),\n },\n};\n\nassertClassifiedOperationTree(sharedOperationTree);\n\nexport const createPutioSdkEffectClient = () => cloneOperationTree(sharedOperationTree);\n\nexport type PutioSdkEffectClient = ReturnType<typeof createPutioSdkEffectClient>;\n\nexport class PutioSdk extends Context.Service<PutioSdk, PutioSdkEffectClient>()(\"PutioSdk\") {}\n\nexport const makePutioSdkEffectClientLayer = () =>\n Layer.succeed(PutioSdk, createPutioSdkEffectClient());\n\nexport const makePutioSdkLiveClientLayer = (config: PutioSdkConfigShape) =>\n Layer.mergeAll(makePutioSdkEffectClientLayer(), makePutioSdkLiveLayer(config));\n\nexport const createPutioSdkPromiseClient = (initialConfig: PutioSdkConfigShape = {}) => {\n const normalizedConfig = makePutioSdkConfig({\n ...initialConfig,\n baseUrl: snapshotUrl(initialConfig.baseUrl),\n uploadBaseUrl: snapshotUrl(initialConfig.uploadBaseUrl),\n webAppUrl: snapshotUrl(initialConfig.webAppUrl),\n });\n const runtimeConfig: PutioSdkPromiseRuntimeConfig = {\n baseUrl: normalizedConfig.baseUrl,\n uploadBaseUrl: normalizedConfig.uploadBaseUrl,\n webAppUrl: normalizedConfig.webAppUrl,\n };\n const config: PutioSdkPromiseState = {\n accessToken: initialConfig.accessToken,\n runtimeConfig,\n };\n\n function getInfo(query: {\n readonly download_token: 1;\n readonly pas: 1;\n }): Promise<AccountInfoBase & { readonly download_token: string; readonly pas: PasInfo }>;\n function getInfo(query: {\n readonly download_token: 1;\n }): Promise<AccountInfoBase & { readonly download_token: string }>;\n function getInfo(query: {\n readonly features: 1;\n }): Promise<AccountInfoBase & { readonly features: Record<string, boolean> }>;\n function getInfo(query: {\n readonly intercom: 1;\n readonly platform?: \"web\" | \"ios\";\n }): Promise<AccountInfoBase & { readonly user_hash?: string }>;\n function getInfo(query: {\n readonly pas: 1;\n }): Promise<AccountInfoBase & { readonly pas: PasInfo }>;\n function getInfo(query: {\n readonly profitwell: 1;\n }): Promise<AccountInfoBase & { readonly paddle_user_id: number | string | null }>;\n function getInfo(query: {\n readonly push_token: 1;\n }): Promise<AccountInfoBase & { readonly push_token: string }>;\n function getInfo(): Promise<AccountInfoBroad>;\n function getInfo(query: AccountInfoQuery): Promise<AccountInfoBroad>;\n function getInfo(query: AccountInfoQuery = {}) {\n return provideSdk(config, getAccountInfo(query));\n }\n\n function getFileById(input: {\n readonly id: number;\n readonly query: { readonly stream_url: 1; readonly video_metadata: 1 };\n }): Promise<\n FileCore & {\n readonly stream_url: string | null;\n readonly video_metadata: FileVideoMetadata;\n }\n >;\n function getFileById(input: {\n readonly id: number;\n readonly query: { readonly mp4_stream_url: 1 };\n }): Promise<\n FileCore &\n (\n | {\n readonly is_mp4_available: true;\n readonly mp4_stream_url: string | null;\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n }\n | {\n readonly is_mp4_available: false;\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n }\n )\n >;\n function getFileById(input: {\n readonly id: number;\n readonly query?: FileQuery;\n }): Promise<FileCore>;\n function getFileById(input: { readonly id: number; readonly query?: FileQuery }) {\n return provideSdk(config, getFile(input));\n }\n\n function getChildByName(input: {\n readonly name: string;\n readonly parentId: number;\n }): Promise<FileCore>;\n function getChildByName<TQuery extends FileQuery>(input: {\n readonly name: string;\n readonly parentId: number;\n readonly query: TQuery;\n }): Promise<FileResponseFor<TQuery>>;\n function getChildByName(input: {\n readonly name: string;\n readonly parentId: number;\n readonly query?: FileQuery;\n }) {\n return provideSdk(config, getFileChild(input));\n }\n\n const operations = makePromiseOperationTree(sharedOperationTree, config);\n\n return {\n dispose: () => disposePromiseClientRuntime(config),\n setAccessToken: (accessToken: string | undefined): void => {\n config.accessToken = accessToken;\n },\n ...operations,\n account: {\n ...operations.account,\n getInfo,\n },\n auth: {\n ...operations.auth,\n buildLoginUrl: (options: Parameters<typeof buildAuthLoginUrl>[0]) =>\n buildAuthLoginUrl({\n ...options,\n webAppUrl: options.webAppUrl ?? config.runtimeConfig.webAppUrl,\n }),\n },\n config: {\n ...operations.config,\n getKeyWith: <A>(key: string, schema: Schema.ConstraintDecoder<A, never>): Promise<A> =>\n provideSdk(config, getConfigKeyWith(key, schema)),\n readWith: <A>(schema: Schema.ConstraintDecoder<A, never>): Promise<A> =>\n provideSdk(config, readConfigWith(schema)),\n },\n files: {\n ...operations.files,\n createUploadFormData: createFileUploadFormData,\n get: getFileById,\n getChild: getChildByName,\n },\n };\n};\n\nexport type PutioSdkPromiseClient = ReturnType<typeof createPutioSdkPromiseClient>;\n"],"mappings":";;;AAeA,MAAMA,kBAAgB,OAAO,QAAQ,CAAC;AACtC,MAAa,oBAAoB,OAAO,OAAO;CAC7C,OAAO,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;CAC3D,MAAM,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;CAC1D,MAAM,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAC5D,CAAC;AACD,MAAa,wBAAwB,OAAO,OAAO;CACjD,yBAAyB,OAAO,SAAS,OAAO,OAAO;CACvD,2BAA2B,OAAO,SAAS,OAAO,OAAO;AAC3D,CAAC;AACD,MAAM,wBAAwB;CAC5B,WAAW,OAAO;CAClB,cAAc,OAAO,OAAO,OAAO,MAAM;CACzC,YAAY,OAAO;CACnB,yBAAyB,OAAO;CAChC,2BAA2B,OAAO;CAClC,cAAc,OAAO;CACrB,gBAAgB,OAAO;CACvB,iBAAiB,OAAO;CACxB,cAAc,OAAO;CACrB,QAAQ,OAAO,OAAO,OAAO,MAAM;CACnC,qBAAqB,OAAO;CAC5B,cAAc,OAAO;CACrB,gBAAgB,OAAO,OAAO,OAAO,MAAM;CAC3C,uBAAuB,OAAO;CAC9B,SAAS,OAAO;CAChB,YAAY,OAAO;CACnB,oBAAoB,OAAO,MAAM,OAAO,OAAO,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;CAC1F,cAAc,OAAO;CACrB,OAAO,OAAO,SAAS;EAAC;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A,SAAS,QAAQ,QAA0B,CAAC,GAAG;EAC7C,OAAO,WAAW,QAAQ,eAAe,KAAK,CAAC;CACjD;CAkCA,SAAS,YAAY,OAA4D;EAC/E,OAAO,WAAW,QAAQ,QAAQ,KAAK,CAAC;CAC1C;CAWA,SAAS,eAAe,OAIrB;EACD,OAAO,WAAW,QAAQ,aAAa,KAAK,CAAC;CAC/C;CAEA,MAAM,aAAa,yBAAyB,qBAAqB,MAAM;CAEvE,OAAO;EACL,eAAe,4BAA4B,MAAM;EACjD,iBAAiB,gBAA0C;GACzD,OAAO,cAAc;EACvB;EACA,GAAG;EACH,SAAS;GACP,GAAG,WAAW;GACd;EACF;EACA,MAAM;GACJ,GAAG,WAAW;GACd,gBAAgB,YACd,kBAAkB;IAChB,GAAG;IACH,WAAW,QAAQ,aAAa,OAAO,cAAc;GACvD,CAAC;EACL;EACA,QAAQ;GACN,GAAG,WAAW;GACd,aAAgB,KAAa,WAC3B,WAAW,QAAQ,iBAAiB,KAAK,MAAM,CAAC;GAClD,WAAc,WACZ,WAAW,QAAQ,eAAe,MAAM,CAAC;EAC7C;EACA,OAAO;GACL,GAAG,WAAW;GACd,sBAAsB;GACtB,KAAK;GACL,UAAU;EACZ;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["RequestedFlag","missingFieldError","failMissingField","widenValidationError"],"sources":["../src/domains/account.ts","../src/domains/app-specific-passwords.ts","../src/core/validation.ts","../src/domains/oauth.ts","../src/domains/auth.ts","../src/domains/config.ts","../src/domains/download-links.ts","../src/domains/events.ts","../src/domains/family.ts","../src/domains/ifttt.ts","../src/domains/files.ts","../src/domains/friend-invites.ts","../src/domains/friends.ts","../src/domains/payment.ts","../src/domains/podcast.ts","../src/domains/rss.ts","../src/domains/sharing.ts","../src/domains/trash.ts","../src/domains/transfers.ts","../src/domains/tunnel.ts","../src/domains/zips.ts","../src/core/client.ts"],"sourcesContent":["import { Effect, Schema } from \"effect\";\nimport {\n PutioValidationError,\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n type PutioSdkError,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n requestJson,\n selectJsonField,\n type PutioSdkContext,\n} from \"../core/http.js\";\nconst RequestedFlag = Schema.Literal(1);\nexport const AccountDiskSchema = Schema.Struct({\n avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n used: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n});\nexport const AccountWarningsSchema = Schema.Struct({\n callback_url_has_failed: Schema.optional(Schema.Boolean),\n pushover_token_has_failed: Schema.optional(Schema.Boolean),\n});\nconst AccountSettingsFields = {\n beta_user: Schema.Boolean,\n callback_url: Schema.NullOr(Schema.String),\n dark_theme: Schema.Boolean,\n default_download_folder: Schema.Int,\n dont_autoselect_subtitles: Schema.Boolean,\n fluid_layout: Schema.Boolean,\n hide_subtitles: Schema.Boolean,\n history_enabled: Schema.Boolean,\n is_invisible: Schema.Boolean,\n locale: Schema.NullOr(Schema.String),\n login_mails_enabled: Schema.Boolean,\n next_episode: Schema.Boolean,\n pushover_token: Schema.NullOr(Schema.String),\n show_optimistic_usage: Schema.Boolean,\n sort_by: Schema.String,\n start_from: Schema.Boolean,\n subtitle_languages: Schema.Array(Schema.NullOr(Schema.String)).check(Schema.isMaxLength(2)),\n theater_mode: Schema.Boolean,\n theme: Schema.Literals([\"dark\", \"light\", \"auto\"]),\n transfer_sort_by: Schema.NullOr(Schema.String),\n trash_enabled: Schema.Boolean,\n tunnel_route_name: Schema.NullOr(Schema.String),\n two_factor_enabled: Schema.Boolean,\n use_private_download_ip: Schema.Boolean,\n use_start_from: Schema.Boolean,\n video_player: Schema.NullOr(Schema.Literals([\"html5\", \"flash\"])),\n};\nexport const AccountSettingsSchema = Schema.Struct(AccountSettingsFields);\nconst AccountFeaturesSchema = Schema.Record(Schema.String, Schema.Boolean);\nexport const PasInfoSchema = Schema.Struct({\n user_hash: Schema.String,\n});\nexport const AccountInfoBaseSchema = Schema.Struct({\n account_active: Schema.optional(Schema.NullOr(Schema.Boolean)),\n account_status: Schema.Literals([\"active\", \"inactive\", \"stranger\"]),\n avatar_url: Schema.String,\n can_create_sub_account: Schema.Boolean,\n disk: AccountDiskSchema,\n family_owner: Schema.optional(Schema.NullOr(Schema.String)),\n files_will_be_deleted_at: Schema.NullOr(Schema.String),\n is_admin: Schema.optional(Schema.Boolean),\n is_eligible_for_friend_invitation: Schema.Boolean,\n is_sub_account: Schema.Boolean,\n mail: Schema.String,\n monthly_bandwidth_usage: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n password_last_changed_at: Schema.NullOr(Schema.String),\n private_download_host_ip: Schema.NullOr(Schema.String),\n settings: AccountSettingsSchema,\n trash_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n user_id: Schema.Int,\n username: Schema.String,\n warnings: AccountWarningsSchema,\n});\nexport const AccountInfoQuerySchema = Schema.Struct({\n download_token: Schema.optional(RequestedFlag),\n features: Schema.optional(RequestedFlag),\n intercom: Schema.optional(RequestedFlag),\n pas: Schema.optional(RequestedFlag),\n platform: Schema.optional(Schema.Literals([\"web\", \"ios\"])),\n profitwell: Schema.optional(RequestedFlag),\n push_token: Schema.optional(RequestedFlag),\n});\nexport const AccountInfoBroadSchema = AccountInfoBaseSchema.pipe(\n Schema.fieldsAssign({\n download_token: Schema.optional(Schema.String),\n features: Schema.optional(AccountFeaturesSchema),\n paddle_user_id: Schema.optional(Schema.NullOr(Schema.Union([Schema.Int, Schema.String]))),\n pas: Schema.optional(PasInfoSchema),\n push_token: Schema.optional(Schema.String),\n user_hash: Schema.optional(Schema.String),\n }),\n);\nconst AccountInfoEnvelopeSchema = Schema.Struct({\n info: AccountInfoBroadSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst AccountSettingsEnvelopeSchema = Schema.Struct({\n settings: AccountSettingsSchema,\n status: Schema.Literal(\"OK\"),\n});\nexport const AccountSubtitleLanguageSchema = Schema.Struct({\n code: Schema.String,\n name: Schema.String,\n});\nconst AccountSubtitleLanguagesEnvelopeSchema = Schema.Struct({\n languages: Schema.Array(AccountSubtitleLanguageSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport const AccountTwoFactorSettingsSchema = Schema.Struct({\n code: Schema.String,\n enable: Schema.Boolean,\n});\nconst AccountSettingsPatchFields = {\n beta_user: Schema.optional(AccountSettingsFields.beta_user),\n callback_url: Schema.optional(AccountSettingsFields.callback_url),\n dark_theme: Schema.optional(AccountSettingsFields.dark_theme),\n default_download_folder: Schema.optional(AccountSettingsFields.default_download_folder),\n dont_autoselect_subtitles: Schema.optional(AccountSettingsFields.dont_autoselect_subtitles),\n fluid_layout: Schema.optional(AccountSettingsFields.fluid_layout),\n hide_subtitles: Schema.optional(AccountSettingsFields.hide_subtitles),\n history_enabled: Schema.optional(AccountSettingsFields.history_enabled),\n is_invisible: Schema.optional(AccountSettingsFields.is_invisible),\n locale: Schema.optional(AccountSettingsFields.locale),\n login_mails_enabled: Schema.optional(AccountSettingsFields.login_mails_enabled),\n next_episode: Schema.optional(AccountSettingsFields.next_episode),\n pushover_token: Schema.optional(AccountSettingsFields.pushover_token),\n show_optimistic_usage: Schema.optional(AccountSettingsFields.show_optimistic_usage),\n sort_by: Schema.optional(AccountSettingsFields.sort_by),\n start_from: Schema.optional(AccountSettingsFields.start_from),\n subtitle_languages: Schema.optional(AccountSettingsFields.subtitle_languages),\n theater_mode: Schema.optional(AccountSettingsFields.theater_mode),\n theme: Schema.optional(AccountSettingsFields.theme),\n transfer_sort_by: Schema.optional(AccountSettingsFields.transfer_sort_by),\n trash_enabled: Schema.optional(AccountSettingsFields.trash_enabled),\n tunnel_route_name: Schema.optional(AccountSettingsFields.tunnel_route_name),\n two_factor_enabled: Schema.optional(AccountSettingsFields.two_factor_enabled),\n use_private_download_ip: Schema.optional(AccountSettingsFields.use_private_download_ip),\n use_start_from: Schema.optional(AccountSettingsFields.use_start_from),\n video_player: Schema.optional(AccountSettingsFields.video_player),\n};\nconst SaveAccountSettingsCommonFields = {\n ...AccountSettingsPatchFields,\n two_factor_enabled: Schema.optional(AccountTwoFactorSettingsSchema),\n username: Schema.optional(Schema.String),\n};\nexport const SaveAccountSettingsPayloadSchema = Schema.Union([\n Schema.Struct(SaveAccountSettingsCommonFields),\n Schema.Struct({\n ...SaveAccountSettingsCommonFields,\n current_password: Schema.String,\n mail: Schema.String,\n password: Schema.optional(Schema.String),\n }),\n Schema.Struct({\n ...SaveAccountSettingsCommonFields,\n current_password: Schema.String,\n mail: Schema.optional(Schema.String),\n password: Schema.String,\n }),\n]);\nexport const AccountClearOptionsSchema = Schema.Struct({\n active_transfers: Schema.Boolean,\n files: Schema.Boolean,\n finished_transfers: Schema.Boolean,\n friends: Schema.Boolean,\n history: Schema.Boolean,\n rss_feeds: Schema.Boolean,\n rss_logs: Schema.Boolean,\n trash: Schema.Boolean,\n});\nconst AccountConfirmationSubjectSchema = Schema.Literals([\n \"mail_change\",\n \"password_change\",\n \"subscription_upgrade\",\n]);\nexport const AccountConfirmationSchema = Schema.Struct({\n created_at: Schema.String,\n subject: AccountConfirmationSubjectSchema,\n});\nconst AccountConfirmationsEnvelopeSchema = Schema.Struct({\n confirmations: Schema.Array(AccountConfirmationSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport type AccountDisk = Schema.Schema.Type<typeof AccountDiskSchema>;\nexport type AccountWarnings = Schema.Schema.Type<typeof AccountWarningsSchema>;\nexport type AccountSettings = Schema.Schema.Type<typeof AccountSettingsSchema>;\nexport type AccountInfoQuery = Schema.Schema.Type<typeof AccountInfoQuerySchema>;\nexport type PasInfo = Schema.Schema.Type<typeof PasInfoSchema>;\nexport type AccountInfoBase = Schema.Schema.Type<typeof AccountInfoBaseSchema>;\nexport type AccountInfoBroad = Schema.Schema.Type<typeof AccountInfoBroadSchema>;\nexport type SaveAccountSettingsPayload = Schema.Schema.Type<\n typeof SaveAccountSettingsPayloadSchema\n>;\nexport type AccountClearOptions = Schema.Schema.Type<typeof AccountClearOptionsSchema>;\nexport type AccountConfirmation = Schema.Schema.Type<typeof AccountConfirmationSchema>;\nexport type AccountSubtitleLanguage = Schema.Schema.Type<typeof AccountSubtitleLanguageSchema>;\nexport type AccountInfoResponseFor<TQuery extends AccountInfoQuery> = AccountInfoBase &\n (TQuery[\"download_token\"] extends 1\n ? {\n readonly download_token: string;\n }\n : {}) &\n (TQuery[\"features\"] extends 1\n ? {\n readonly features: Record<string, boolean>;\n }\n : {}) &\n (TQuery[\"intercom\"] extends 1\n ? {\n readonly user_hash?: string;\n }\n : {}) &\n (TQuery[\"pas\"] extends 1\n ? {\n readonly pas: PasInfo;\n }\n : {}) &\n (TQuery[\"profitwell\"] extends 1\n ? {\n readonly paddle_user_id: number | string | null;\n }\n : {}) &\n (TQuery[\"push_token\"] extends 1\n ? {\n readonly push_token: string;\n }\n : {});\nconst missingFieldError = (field: string) =>\n new PutioValidationError({\n cause: `Expected put.io to include \"${field}\" because it was requested`,\n });\nconst failMissingField = (field: string): Effect.Effect<never, PutioValidationError> =>\n Effect.fail(missingFieldError(field));\nconst widenValidationError = <A, E, R>(\n effect: Effect.Effect<A, E, R>,\n): Effect.Effect<A, E | PutioValidationError, R> => effect;\nconst mapSensitiveAccountDecodeError = (operation: \"destroy\" | \"saveSettings\") => () =>\n new PutioValidationError({\n cause: {\n domain: \"account\",\n operation,\n reason: \"Invalid request input\",\n },\n });\nconst hasDownloadToken = (\n value: AccountInfoBroad,\n): value is AccountInfoBroad & {\n readonly download_token: string;\n} => typeof value.download_token === \"string\";\nconst hasFeatures = (\n value: AccountInfoBroad,\n): value is AccountInfoBroad & {\n readonly features: Record<string, boolean>;\n} => typeof value.features === \"object\" && value.features !== null;\nconst hasPas = (\n value: AccountInfoBroad,\n): value is AccountInfoBroad & {\n readonly pas: PasInfo;\n} => typeof value.pas === \"object\" && value.pas !== null && typeof value.pas.user_hash === \"string\";\nconst hasPaddleUserId = (\n value: AccountInfoBroad,\n): value is AccountInfoBroad & {\n readonly paddle_user_id: number | string | null;\n} => \"paddle_user_id\" in value;\nconst hasPushToken = (\n value: AccountInfoBroad,\n): value is AccountInfoBroad & {\n readonly push_token: string;\n} => typeof value.push_token === \"string\";\nconst ensureAccountInfoFields = <TQuery extends AccountInfoQuery>(\n effect: Effect.Effect<AccountInfoBroad, PutioSdkError, PutioSdkContext>,\n query: TQuery,\n): Effect.Effect<\n AccountInfoResponseFor<TQuery>,\n PutioSdkError | PutioValidationError,\n PutioSdkContext\n> =>\n Effect.gen(function* () {\n const info = yield* widenValidationError(effect);\n if (query.download_token === 1 && !hasDownloadToken(info)) {\n return yield* failMissingField(\"download_token\");\n }\n if (query.features === 1 && !hasFeatures(info)) {\n return yield* failMissingField(\"features\");\n }\n if (query.pas === 1 && !hasPas(info)) {\n return yield* failMissingField(\"pas\");\n }\n if (query.profitwell === 1 && !hasPaddleUserId(info)) {\n return yield* failMissingField(\"paddle_user_id\");\n }\n if (query.push_token === 1 && !hasPushToken(info)) {\n return yield* failMissingField(\"push_token\");\n }\n // Requested-field checks above establish the query-conditioned contract.\n return info as AccountInfoResponseFor<TQuery>;\n });\nexport const SaveAccountSettingsErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"saveSettings\",\n knownErrors: [\n { errorType: \"INVALID_CURRENT_PASSWORD\", statusCode: 400 as const },\n { errorType: \"INVALID_NEW_PASSWORD\", statusCode: 400 as const },\n { errorType: \"INVALID_USERNAME\", statusCode: 400 as const },\n { errorType: \"INVALID_MAIL\", statusCode: 400 as const },\n { errorType: \"DISPOSABLE_MAIL_NOT_ALLOWED\", statusCode: 400 as const },\n { errorType: \"INVALID_CALLBACK_URL\", statusCode: 400 as const },\n { errorType: \"INVALID_PUSHOVER_TOKEN\", statusCode: 400 as const },\n { errorType: \"INVALID_CODE\", statusCode: 400 as const },\n { errorType: \"INVALID_ENABLE\", statusCode: 400 as const },\n { errorType: \"INVALID_VALUE\", statusCode: 400 as const },\n { errorType: \"PWNED_NEW_PASSWORD\", statusCode: 400 as const },\n { errorType: \"SAME_USERNAME\", statusCode: 409 as const },\n { errorType: \"EXISTING_MAIL\", statusCode: 409 as const },\n { errorType: \"USERNAME_EXISTS\", statusCode: 400 as const },\n { errorType: \"UNAVAILABLE_VALUE\", statusCode: 403 as const },\n { errorType: \"ALREADY_ENABLED\", statusCode: 403 as const },\n { errorType: \"INVALID_STATE\", statusCode: 403 as const },\n { errorType: \"NOT_ENABLED\", statusCode: 403 as const },\n ],\n});\nexport const AccountConfirmationsErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"listConfirmations\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport type SaveAccountSettingsError = PutioOperationFailure<typeof SaveAccountSettingsErrorSpec>;\nexport type AccountConfirmationsError = PutioOperationFailure<typeof AccountConfirmationsErrorSpec>;\nexport function getAccountInfo(query: {\n readonly download_token: 1;\n readonly pas: 1;\n}): Effect.Effect<\n AccountInfoBase & {\n readonly download_token: string;\n readonly pas: PasInfo;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: { readonly download_token: 1 }): Effect.Effect<\n AccountInfoBase & {\n readonly download_token: string;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: { readonly features: 1 }): Effect.Effect<\n AccountInfoBase & {\n readonly features: Record<string, boolean>;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: {\n readonly intercom: 1;\n readonly platform?: \"web\" | \"ios\";\n}): Effect.Effect<\n AccountInfoBase & {\n readonly user_hash?: string;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: { readonly pas: 1 }): Effect.Effect<\n AccountInfoBase & {\n readonly pas: PasInfo;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: { readonly profitwell: 1 }): Effect.Effect<\n AccountInfoBase & {\n readonly paddle_user_id: number | string | null;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(query: { readonly push_token: 1 }): Effect.Effect<\n AccountInfoBase & {\n readonly push_token: string;\n },\n PutioSdkError,\n PutioSdkContext\n>;\nexport function getAccountInfo(): Effect.Effect<AccountInfoBroad, PutioSdkError, PutioSdkContext>;\nexport function getAccountInfo(\n query: AccountInfoQuery,\n): Effect.Effect<AccountInfoBroad, PutioSdkError, PutioSdkContext>;\nexport function getAccountInfo(query: AccountInfoQuery = {}) {\n return Schema.decodeUnknownEffect(AccountInfoQuerySchema, {\n onExcessProperty: \"error\",\n })(query).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedQuery) => {\n const effect = requestJson(AccountInfoEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/account/info\",\n query: decodedQuery,\n }).pipe(selectJsonField(\"info\"));\n return ensureAccountInfoFields(effect, decodedQuery);\n }),\n );\n}\nexport const getAccountSettings = (): Effect.Effect<\n AccountSettings,\n PutioSdkError,\n PutioSdkContext\n> =>\n requestJson(AccountSettingsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/account/settings\",\n }).pipe(selectJsonField(\"settings\"));\nexport const listAccountSubtitleLanguages = (): Effect.Effect<\n ReadonlyArray<AccountSubtitleLanguage>,\n PutioSdkError,\n PutioSdkContext\n> =>\n requestJson(AccountSubtitleLanguagesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/account/subtitle_languages\",\n }).pipe(selectJsonField(\"languages\"));\nexport const saveAccountSettings = (\n payload: SaveAccountSettingsPayload,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n SaveAccountSettingsError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(SaveAccountSettingsPayloadSchema, {\n onExcessProperty: \"error\",\n })(payload).pipe(\n Effect.mapError(mapSensitiveAccountDecodeError(\"saveSettings\")),\n Effect.flatMap((decodedPayload) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"json\",\n value: decodedPayload,\n },\n method: \"POST\",\n path: \"/v2/account/settings\",\n }),\n ),\n withOperationErrors(SaveAccountSettingsErrorSpec),\n );\nexport const clearAccount = (\n options: AccountClearOptions,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(AccountClearOptionsSchema, {\n onExcessProperty: \"error\",\n })(options).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedOptions) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: decodedOptions,\n },\n method: \"POST\",\n path: \"/v2/account/clear\",\n }),\n ),\n );\nexport const destroyAccount = (\n currentPassword: string,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(Schema.String.check(Schema.isMinLength(1)))(currentPassword).pipe(\n Effect.mapError(mapSensitiveAccountDecodeError(\"destroy\")),\n Effect.flatMap((decodedPassword) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n current_password: decodedPassword,\n },\n },\n method: \"POST\",\n path: \"/v2/account/destroy\",\n }),\n ),\n );\nexport const listAccountConfirmations = (\n subject?: AccountConfirmation[\"subject\"],\n): Effect.Effect<ReadonlyArray<AccountConfirmation>, AccountConfirmationsError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(Schema.UndefinedOr(AccountConfirmationSubjectSchema))(subject).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedSubject) =>\n requestJson(AccountConfirmationsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/account/confirmation/list\",\n query: decodedSubject\n ? {\n type: decodedSubject,\n }\n : undefined,\n }),\n ),\n selectJsonField(\"confirmations\"),\n withOperationErrors(AccountConfirmationsErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\n\nimport {\n PutioErrorEnvelopeSchema,\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\n\nconst AppSpecificPasswordIdSchema = Schema.Int.check(Schema.isGreaterThan(0));\nconst AppSpecificPasswordNoteSchema = Schema.Trim.check(\n Schema.isMinLength(1),\n Schema.isMaxLength(255),\n);\nconst MaskedIpv4AddressPattern = /^(?:(?:25[0-5]|2[0-4]\\d|1?\\d?\\d)\\.){3}XXX$/;\nconst Ipv6HextetPattern = /^[\\dA-Fa-f]{1,4}$/;\n\nconst isMaskedIpv6Address = (value: string): boolean => {\n const compressedParts = value.split(\"::\");\n\n if (compressedParts.length > 2) {\n return false;\n }\n\n const hextets = compressedParts.flatMap((part) => (part === \"\" ? [] : part.split(\":\")));\n\n if (\n hextets.at(-1) !== \"X\" ||\n !hextets.slice(0, -1).every((part) => Ipv6HextetPattern.test(part))\n ) {\n return false;\n }\n\n return compressedParts.length === 2 ? hextets.length < 8 : hextets.length === 8;\n};\n\nconst MaskedIpAddressSchema = Schema.String.check(\n Schema.makeFilter((value) =>\n MaskedIpv4AddressPattern.test(value) || isMaskedIpv6Address(value)\n ? undefined\n : \"Expected a masked IP address\",\n ),\n);\n\nexport const AppSpecificPasswordSchema = Schema.Struct({\n created_at: Schema.String,\n id: AppSpecificPasswordIdSchema,\n ip_address: Schema.NullOr(MaskedIpAddressSchema),\n last_used_at: Schema.NullOr(Schema.String),\n note: Schema.String,\n});\n\nexport const CreateAppSpecificPasswordInputSchema = Schema.Struct({\n note: AppSpecificPasswordNoteSchema,\n});\n\nconst CreateAppSpecificPasswordEnvelopeSchema = AppSpecificPasswordSchema.pipe(\n Schema.fieldsAssign({\n password: Schema.String,\n status: Schema.Literal(\"OK\"),\n }),\n);\n\nconst ListAppSpecificPasswordsEnvelopeSchema = Schema.Struct({\n passwords: Schema.Array(AppSpecificPasswordSchema),\n status: Schema.Literal(\"OK\"),\n});\n\nexport type AppSpecificPassword = Schema.Schema.Type<typeof AppSpecificPasswordSchema>;\nexport type CreateAppSpecificPasswordInput = Schema.Schema.Type<\n typeof CreateAppSpecificPasswordInputSchema\n>;\nexport type CreateAppSpecificPasswordResult = AppSpecificPassword & {\n readonly password: string;\n};\n\nconst RestrictedAppSpecificPasswordError: {\n readonly errorType: \"invalid_scope\";\n readonly statusCode: 401;\n} = {\n errorType: \"invalid_scope\",\n statusCode: 401,\n};\n\nconst TooManyAppSpecificPasswordsErrorBodySchema = PutioErrorEnvelopeSchema.pipe(\n Schema.fieldsAssign({\n extra: Schema.Struct({\n limit: Schema.Int,\n }),\n }),\n);\n\nexport const CreateAppSpecificPasswordErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"appSpecificPasswords.create\",\n knownErrors: [\n { errorType: \"NOTE_REQUIRED\", statusCode: 400 as const },\n { errorType: \"NOTE_TOO_LONG\", statusCode: 400 as const },\n {\n bodySchema: TooManyAppSpecificPasswordsErrorBodySchema,\n errorType: \"TOO_MANY_APP_SPECIFIC_PASSWORDS\",\n statusCode: 403 as const,\n },\n RestrictedAppSpecificPasswordError,\n ],\n});\n\nexport const ListAppSpecificPasswordsErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"appSpecificPasswords.list\",\n knownErrors: [RestrictedAppSpecificPasswordError],\n});\n\nexport const DeleteAppSpecificPasswordErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"appSpecificPasswords.delete\",\n knownErrors: [RestrictedAppSpecificPasswordError],\n});\n\nexport const DeleteAllAppSpecificPasswordsErrorSpec = definePutioOperationErrorSpec({\n domain: \"account\",\n operation: \"appSpecificPasswords.deleteAll\",\n knownErrors: [RestrictedAppSpecificPasswordError],\n});\n\nexport type CreateAppSpecificPasswordError = PutioOperationFailure<\n typeof CreateAppSpecificPasswordErrorSpec\n>;\nexport type ListAppSpecificPasswordsError = PutioOperationFailure<\n typeof ListAppSpecificPasswordsErrorSpec\n>;\nexport type DeleteAppSpecificPasswordError = PutioOperationFailure<\n typeof DeleteAppSpecificPasswordErrorSpec\n>;\nexport type DeleteAllAppSpecificPasswordsError = PutioOperationFailure<\n typeof DeleteAllAppSpecificPasswordsErrorSpec\n>;\n\nexport const createAppSpecificPassword = (\n input: CreateAppSpecificPasswordInput,\n): Effect.Effect<\n CreateAppSpecificPasswordResult,\n CreateAppSpecificPasswordError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(CreateAppSpecificPasswordInputSchema, {\n onExcessProperty: \"error\",\n })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(CreateAppSpecificPasswordEnvelopeSchema, {\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/app_specific_password/create\",\n }),\n ),\n selectJsonFields(\"created_at\", \"id\", \"ip_address\", \"last_used_at\", \"note\", \"password\"),\n withOperationErrors(CreateAppSpecificPasswordErrorSpec),\n );\n\nexport const listAppSpecificPasswords = (): Effect.Effect<\n ReadonlyArray<AppSpecificPassword>,\n ListAppSpecificPasswordsError,\n PutioSdkContext\n> =>\n requestJson(ListAppSpecificPasswordsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/app_specific_password/list\",\n }).pipe(selectJsonField(\"passwords\"), withOperationErrors(ListAppSpecificPasswordsErrorSpec));\n\nexport const deleteAppSpecificPassword = (\n id: number,\n): Effect.Effect<void, DeleteAppSpecificPasswordError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(AppSpecificPasswordIdSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/app_specific_password/${encodePathSegment(decodedId)}/delete`,\n }),\n ),\n Effect.asVoid,\n withOperationErrors(DeleteAppSpecificPasswordErrorSpec),\n );\n\nexport const deleteAllAppSpecificPasswords = (): Effect.Effect<\n void,\n DeleteAllAppSpecificPasswordsError,\n PutioSdkContext\n> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/app_specific_password/delete_all\",\n }).pipe(Effect.asVoid, withOperationErrors(DeleteAllAppSpecificPasswordsErrorSpec));\n","import { Effect, Schema } from \"effect\";\n\nimport { mapDecodeErrorToValidationError } from \"./errors.js\";\n\nexport const PositiveIntegerSchema = Schema.Int.check(Schema.isGreaterThan(0));\nexport const NonEmptyStringSchema = Schema.String.check(Schema.isMinLength(1));\n\nexport const decodeAndRun = <S extends Schema.Top, A, E, R>(\n schema: S,\n input: unknown,\n run: (decoded: S[\"Type\"]) => Effect.Effect<A, E, R>,\n) =>\n Schema.decodeUnknownEffect(schema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap(run),\n );\n\nexport const makeCursorSelectionSchema = <\n const TIdsField extends string,\n const TExcludeIdsField extends string,\n const TFields extends Schema.Struct.Fields,\n>(\n idsField: TIdsField,\n excludeIdsField: TExcludeIdsField,\n fields: TFields,\n) =>\n Schema.Struct({\n cursor: Schema.optional(NonEmptyStringSchema),\n [excludeIdsField]: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n [idsField]: Schema.optional(Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1))),\n ...fields,\n }).check(\n Schema.makeFilter((input) => input.cursor !== undefined || input[idsField] !== undefined, {\n expected: \"a non-empty cursor or file ID selection\",\n }),\n );\n","import { Effect, Schema } from \"effect\";\nimport {\n OkResponseSchema,\n buildPutioUrl,\n encodePathSegment,\n requestJson,\n selectJsonField,\n type PutioSdkContext,\n type PutioQueryValue,\n} from \"../core/http.js\";\nimport {\n mapDecodeErrorToValidationError,\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n type PutioSdkError,\n} from \"../core/errors.js\";\nconst OAuthAppBaseSchema = Schema.Struct({\n description: Schema.String,\n has_icon: Schema.NullOr(Schema.Boolean),\n id: Schema.Int,\n name: Schema.String,\n website: Schema.String,\n});\nexport const OAuthAppSchema = OAuthAppBaseSchema;\nexport const OwnedOAuthAppSchema = OAuthAppBaseSchema.pipe(\n Schema.fieldsAssign({\n callback: Schema.String,\n hidden: Schema.Boolean,\n secret: Schema.String,\n }),\n);\nexport const MyOAuthAppSchema = OwnedOAuthAppSchema.pipe(\n Schema.fieldsAssign({\n users: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n }),\n);\nexport const PopularOAuthAppSchema = OAuthAppBaseSchema.pipe(\n Schema.fieldsAssign({\n hidden: Schema.optional(Schema.Boolean),\n maker: Schema.String,\n users: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n }),\n);\nexport const OAuthAppSessionSchema = Schema.Struct({\n active: Schema.Boolean,\n app_id: Schema.Int,\n app_name: Schema.optional(Schema.String),\n client_name: Schema.String,\n created_at: Schema.String,\n id: Schema.Int,\n ip_address: Schema.String,\n last_used_at: Schema.NullOr(Schema.String),\n note: Schema.NullOr(Schema.String),\n user_agent: Schema.String,\n});\nexport const OAuthAppWithTokenSchema = Schema.Struct({\n app: Schema.Union([OwnedOAuthAppSchema, OAuthAppSchema]),\n status: Schema.Literal(\"OK\"),\n token: Schema.NullOr(Schema.String),\n});\nconst OAuthAppsEnvelopeSchema = Schema.Struct({\n apps: Schema.Array(MyOAuthAppSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst PopularOAuthAppsEnvelopeSchema = Schema.Struct({\n apps: Schema.Array(PopularOAuthAppSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst OAuthAppEnvelopeSchema = Schema.Struct({\n app: Schema.Union([OwnedOAuthAppSchema, OAuthAppSchema]),\n status: Schema.Literal(\"OK\"),\n});\nconst OAuthRegeneratedTokenEnvelopeSchema = Schema.Struct({\n access_token: Schema.String,\n status: Schema.Literal(\"OK\"),\n});\nconst OAuthAppIdSchema = Schema.Int.check(Schema.isGreaterThan(0));\nconst OAuthAppDescriptionSchema = Schema.String.check(Schema.isMinLength(10));\nconst OAuthAppUrlSchema = Schema.String.check(Schema.isMaxLength(255));\nexport const OAuthAppCreateInputSchema = Schema.Struct({\n callback: OAuthAppUrlSchema,\n description: OAuthAppDescriptionSchema,\n hidden: Schema.optional(Schema.Boolean),\n icon: Schema.optional(Schema.instanceOf(Blob)),\n name: Schema.String.check(Schema.isMinLength(5)),\n website: OAuthAppUrlSchema,\n});\nexport const OAuthAppUpdateInputSchema = Schema.Struct({\n callback: OAuthAppUrlSchema,\n description: OAuthAppDescriptionSchema,\n hidden: Schema.optional(Schema.Boolean),\n icon: Schema.optional(Schema.instanceOf(Blob)),\n id: OAuthAppIdSchema,\n website: OAuthAppUrlSchema,\n});\nexport const OAuthSetIconInputSchema = Schema.Struct({\n icon: Schema.instanceOf(Blob),\n});\nexport type OAuthApp = Schema.Schema.Type<typeof OAuthAppSchema>;\nexport type OwnedOAuthApp = Schema.Schema.Type<typeof OwnedOAuthAppSchema>;\nexport type MyOAuthApp = Schema.Schema.Type<typeof MyOAuthAppSchema>;\nexport type PopularOAuthApp = Schema.Schema.Type<typeof PopularOAuthAppSchema>;\nexport type OAuthAppSession = Schema.Schema.Type<typeof OAuthAppSessionSchema>;\nexport type OAuthAppCreateInput = Schema.Schema.Type<typeof OAuthAppCreateInputSchema>;\nexport type OAuthAppUpdateInput = Schema.Schema.Type<typeof OAuthAppUpdateInputSchema>;\nexport type OAuthSetIconInput = Schema.Schema.Type<typeof OAuthSetIconInputSchema>;\nexport const QueryOAuthAppsErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"query\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const GetOAuthAppErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"get\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const CreateOAuthAppErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"create\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const UpdateOAuthAppErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"update\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const DeleteOAuthAppErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"delete\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const RegenerateOAuthAppTokenErrorSpec = definePutioOperationErrorSpec({\n domain: \"oauth\",\n operation: \"regenerateToken\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport type QueryOAuthAppsError = PutioOperationFailure<typeof QueryOAuthAppsErrorSpec>;\nexport type GetOAuthAppError = PutioOperationFailure<typeof GetOAuthAppErrorSpec>;\nexport type CreateOAuthAppError = PutioOperationFailure<typeof CreateOAuthAppErrorSpec>;\nexport type UpdateOAuthAppError = PutioOperationFailure<typeof UpdateOAuthAppErrorSpec>;\nexport type DeleteOAuthAppError = PutioOperationFailure<typeof DeleteOAuthAppErrorSpec>;\nexport type RegenerateOAuthAppTokenError = PutioOperationFailure<\n typeof RegenerateOAuthAppTokenErrorSpec\n>;\nconst appendOptionalBoolean = (formData: FormData, key: string, value?: boolean) => {\n if (value !== undefined) {\n formData.append(key, String(value));\n }\n};\nconst appendOptionalBlob = (formData: FormData, key: string, value?: Blob) => {\n if (value) {\n formData.append(key, value);\n }\n};\nconst makeCreateOAuthAppFormData = (input: OAuthAppCreateInput) => {\n const formData = new FormData();\n formData.append(\"name\", input.name);\n formData.append(\"description\", input.description);\n formData.append(\"website\", input.website);\n formData.append(\"callback\", input.callback);\n appendOptionalBoolean(formData, \"hidden\", input.hidden);\n appendOptionalBlob(formData, \"icon\", input.icon);\n return formData;\n};\nconst makeUpdateOAuthAppFormData = (input: OAuthAppUpdateInput) => {\n const formData = new FormData();\n formData.append(\"description\", input.description);\n formData.append(\"website\", input.website);\n formData.append(\"callback\", input.callback);\n appendOptionalBoolean(formData, \"hidden\", input.hidden);\n appendOptionalBlob(formData, \"icon\", input.icon);\n return formData;\n};\nexport const buildOAuthAuthorizeUrl = (options: {\n readonly baseUrl?: string | URL;\n readonly oauthToken: string;\n readonly query?: Readonly<Record<string, PutioQueryValue>>;\n}) =>\n buildPutioUrl(options.baseUrl ?? \"https://api.put.io\", \"/v2/oauth2/authorize\", {\n ...options.query,\n oauth_token: options.oauthToken,\n });\nexport const buildOAuthAppIconUrl = (options: {\n readonly baseUrl?: string | URL;\n readonly id: number;\n readonly oauthToken: string;\n}) =>\n buildPutioUrl(\n options.baseUrl ?? \"https://api.put.io\",\n `/v2/oauth/apps/${encodePathSegment(options.id)}/icon`,\n {\n oauth_token: options.oauthToken,\n },\n );\nexport const queryOAuthApps = (): Effect.Effect<\n ReadonlyArray<MyOAuthApp>,\n QueryOAuthAppsError,\n PutioSdkContext\n> =>\n requestJson(OAuthAppsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/oauth/apps\",\n }).pipe(selectJsonField(\"apps\"), withOperationErrors(QueryOAuthAppsErrorSpec));\nexport const getOAuthApp = (\n id: number,\n options?: {\n readonly edit?: boolean;\n },\n): Effect.Effect<\n Schema.Schema.Type<typeof OAuthAppWithTokenSchema>,\n GetOAuthAppError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(\n Schema.Struct({\n id: OAuthAppIdSchema,\n options: Schema.optional(\n Schema.Struct({\n edit: Schema.optional(Schema.Boolean),\n }),\n ),\n }),\n { onExcessProperty: \"error\" },\n )({ id, options }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OAuthAppWithTokenSchema, {\n method: \"GET\",\n path: decodedInput.options?.edit\n ? `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/edit`\n : `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`,\n }),\n ),\n withOperationErrors(GetOAuthAppErrorSpec),\n );\nexport const setOAuthAppIcon = (\n id: number,\n input: OAuthSetIconInput,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> => {\n return Schema.decodeUnknownEffect(\n Schema.Struct({\n id: OAuthAppIdSchema,\n input: OAuthSetIconInputSchema,\n }),\n { onExcessProperty: \"error\" },\n )({ id, input }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) => {\n const formData = new FormData();\n formData.append(\"icon\", decodedInput.input.icon);\n return requestJson(OkResponseSchema, {\n body: {\n type: \"form-data\",\n value: formData,\n },\n method: \"POST\",\n path: `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}/icon`,\n });\n }),\n );\n};\nexport const createOAuthApp = (\n input: OAuthAppCreateInput,\n): Effect.Effect<\n Schema.Schema.Type<typeof OAuthAppEnvelopeSchema>,\n CreateOAuthAppError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(OAuthAppCreateInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OAuthAppEnvelopeSchema, {\n body: {\n type: \"form-data\",\n value: makeCreateOAuthAppFormData(decodedInput),\n },\n method: \"POST\",\n path: \"/v2/oauth/apps/register\",\n }),\n ),\n withOperationErrors(CreateOAuthAppErrorSpec),\n );\nexport const updateOAuthApp = (\n input: OAuthAppUpdateInput,\n): Effect.Effect<\n Schema.Schema.Type<typeof OAuthAppWithTokenSchema>,\n UpdateOAuthAppError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(OAuthAppUpdateInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OAuthAppWithTokenSchema, {\n body: {\n type: \"form-data\",\n value: makeUpdateOAuthAppFormData(decodedInput),\n },\n method: \"POST\",\n path: `/v2/oauth/apps/${encodePathSegment(decodedInput.id)}`,\n }),\n ),\n withOperationErrors(UpdateOAuthAppErrorSpec),\n );\nexport const deleteOAuthApp = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n DeleteOAuthAppError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(OAuthAppIdSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/oauth/apps/${encodePathSegment(decodedId)}/delete`,\n }),\n ),\n withOperationErrors(DeleteOAuthAppErrorSpec),\n );\nexport const regenerateOAuthAppToken = (\n id: number,\n): Effect.Effect<string, RegenerateOAuthAppTokenError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(OAuthAppIdSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OAuthRegeneratedTokenEnvelopeSchema, {\n method: \"POST\",\n path: `/v2/oauth/apps/${encodePathSegment(decodedId)}/regenerate_token`,\n }),\n ),\n selectJsonField(\"access_token\"),\n withOperationErrors(RegenerateOAuthAppTokenErrorSpec),\n );\nexport const getPopularOAuthApps = (): Effect.Effect<\n ReadonlyArray<PopularOAuthApp>,\n PutioSdkError,\n PutioSdkContext\n> =>\n requestJson(PopularOAuthAppsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/oauth/apps/popular\",\n }).pipe(selectJsonField(\"apps\"));\n","import { Effect, Schema } from \"effect\";\nimport {\n PutioApiError,\n PutioValidationError,\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n type PutioSdkError,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n buildPutioUrl,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema } from \"../core/validation.js\";\nimport { OAuthAppSchema, OAuthAppSessionSchema } from \"./oauth.js\";\nexport const LoginResponseSchema = Schema.Struct({\n access_token: Schema.String,\n user_id: Schema.Int,\n});\nconst OAuthAuthorizationCodeResponseSchema = Schema.Struct({\n access_token: Schema.String,\n});\nexport const OAuthAuthorizationCodeExchangeErrorCodeSchema = Schema.Literals([\n \"access_denied\",\n \"invalid_request\",\n \"unauthorized_client\",\n]);\nexport class OAuthAuthorizationCodeExchangeError extends Schema.TaggedError<OAuthAuthorizationCodeExchangeError>()(\n \"OAuthAuthorizationCodeExchangeError\",\n {\n code: OAuthAuthorizationCodeExchangeErrorCodeSchema,\n status: Schema.Literal(400),\n },\n) {}\nconst TokenScopeSchema = Schema.NullOr(\n Schema.Literals([\n \"default\",\n \"two_factor\",\n \"files_public_access\",\n \"files_download\",\n \"token_validate\",\n ]),\n);\nexport const ValidateTokenResponseSchema = Schema.Struct({\n result: Schema.Boolean,\n token_id: Schema.NullOr(Schema.Int),\n token_scope: TokenScopeSchema,\n user_id: Schema.NullOr(Schema.Int),\n});\nconst RecoveryCodeEntrySchema = Schema.Struct({\n code: Schema.String,\n used_at: Schema.NullOr(Schema.String),\n});\nexport const TwoFactorRecoveryCodesSchema = Schema.Struct({\n codes: Schema.Array(RecoveryCodeEntrySchema),\n created_at: Schema.String,\n});\nexport const GenerateTOTPResponseSchema = Schema.Struct({\n recovery_codes: TwoFactorRecoveryCodesSchema,\n secret: Schema.String,\n uri: Schema.String,\n});\nexport const VerifyTOTPResponseSchema = Schema.Struct({\n token: Schema.String,\n user_id: Schema.Int,\n});\nexport const AuthorizationCodeSchema = Schema.Struct({\n code: Schema.String,\n qr_code_url: Schema.String,\n});\nconst AuthorizationCodeEnvelopeSchema = Schema.Struct({\n code: Schema.String,\n qr_code_url: Schema.String,\n status: Schema.Literal(\"OK\"),\n});\nconst CodeMatchEnvelopeSchema = Schema.Struct({\n oauth_token: Schema.NullOr(Schema.String),\n status: Schema.Literal(\"OK\"),\n});\nconst LinkDeviceEnvelopeSchema = Schema.Struct({\n app: OAuthAppSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst GrantsEnvelopeSchema = Schema.Struct({\n apps: Schema.Array(OAuthAppSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst ClientsEnvelopeSchema = Schema.Struct({\n clients: Schema.Array(OAuthAppSessionSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst VoucherEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n voucher: Schema.Struct({\n days: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n owner: Schema.NullOr(Schema.String),\n }),\n});\nconst GiftCardEnvelopeSchema = Schema.Struct({\n gift_card: Schema.Struct({\n days: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n plan: Schema.Boolean,\n }),\n status: Schema.Literal(\"OK\"),\n});\nconst FamilyInviteEnvelopeSchema = Schema.Struct({\n invite: Schema.Struct({\n owner: Schema.String,\n plan: Schema.String,\n }),\n status: Schema.Literal(\"OK\"),\n});\nconst FriendInviteEnvelopeSchema = Schema.Struct({\n invite: Schema.Struct({\n inviter: Schema.String,\n plan: Schema.Struct({\n code: Schema.String,\n name: Schema.String,\n period: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n }),\n }),\n status: Schema.Literal(\"OK\"),\n});\nconst ExistsEnvelopeSchema = Schema.Struct({\n exists: Schema.Boolean,\n status: Schema.Literal(\"OK\"),\n});\nconst ResetPasswordEnvelopeSchema = Schema.Struct({\n access_token: Schema.String,\n status: Schema.Literal(\"OK\"),\n});\nconst GenerateTOTPEnvelopeSchema = Schema.Struct({\n recovery_codes: TwoFactorRecoveryCodesSchema,\n secret: Schema.String,\n status: Schema.Literal(\"OK\"),\n uri: Schema.String,\n});\nconst VerifyTOTPEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n token: Schema.String,\n user_id: Schema.Int,\n});\nconst RecoveryCodesEnvelopeSchema = Schema.Struct({\n recovery_codes: TwoFactorRecoveryCodesSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst AuthClientIdSchema = Schema.Union([NonEmptyStringSchema, PositiveIntegerSchema]);\nconst LoginInputSchema = Schema.Struct({\n callbackUrl: Schema.optional(NonEmptyStringSchema),\n clientId: AuthClientIdSchema,\n clientName: Schema.optional(NonEmptyStringSchema),\n clientSecret: NonEmptyStringSchema,\n fingerprint: Schema.optional(NonEmptyStringSchema),\n password: NonEmptyStringSchema,\n username: NonEmptyStringSchema,\n});\nexport const RegisterInputSchema = Schema.Struct({\n client_id: AuthClientIdSchema,\n family_invite_code: Schema.optional(NonEmptyStringSchema),\n friend_invite_code: Schema.optional(NonEmptyStringSchema),\n gift_card_confirmation_code: Schema.optional(NonEmptyStringSchema),\n mail: NonEmptyStringSchema,\n password: NonEmptyStringSchema,\n plan_name: Schema.optional(NonEmptyStringSchema),\n username: NonEmptyStringSchema,\n voucher_code: Schema.optional(NonEmptyStringSchema),\n});\nexport const OAuthAuthorizationCodeExchangeInputSchema = Schema.Struct({\n clientId: AuthClientIdSchema,\n clientSecret: NonEmptyStringSchema,\n code: NonEmptyStringSchema,\n redirectUri: Schema.optional(NonEmptyStringSchema),\n});\nconst AuthExistsInputSchema = Schema.Struct({\n key: Schema.Literals([\"mail\", \"username\"]),\n value: NonEmptyStringSchema,\n});\nconst AuthResetPasswordInputSchema = Schema.Struct({\n key: NonEmptyStringSchema,\n password: NonEmptyStringSchema,\n});\nconst AuthGetCodeInputSchema = Schema.Struct({\n appId: AuthClientIdSchema,\n clientName: Schema.optional(NonEmptyStringSchema),\n});\nconst AuthVerifyTotpInputSchema = Schema.Struct({\n code: NonEmptyStringSchema,\n twoFactorScopedToken: NonEmptyStringSchema,\n});\nexport type LoginResponse = Schema.Schema.Type<typeof LoginResponseSchema>;\nexport type ValidateTokenResponse = Schema.Schema.Type<typeof ValidateTokenResponseSchema>;\nexport type TwoFactorRecoveryCodes = Schema.Schema.Type<typeof TwoFactorRecoveryCodesSchema>;\nexport type GenerateTOTPResponse = Schema.Schema.Type<typeof GenerateTOTPResponseSchema>;\nexport type VerifyTOTPResponse = Schema.Schema.Type<typeof VerifyTOTPResponseSchema>;\nexport type RegisterInput = Schema.Schema.Type<typeof RegisterInputSchema>;\nexport type LoginInput = Schema.Schema.Type<typeof LoginInputSchema>;\nexport type AuthGetCodeInput = Schema.Schema.Type<typeof AuthGetCodeInputSchema>;\nexport type OAuthAuthorizationCodeExchangeInput = Schema.Schema.Type<\n typeof OAuthAuthorizationCodeExchangeInputSchema\n>;\nexport const LoginErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"login\",\n knownErrors: [\n { statusCode: 401 as const },\n { errorType: \"invalid_app_credentials\", statusCode: 403 as const },\n { errorType: \"password_reset_required\", statusCode: 403 as const },\n ],\n});\nexport const RegisterErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"register\",\n knownErrors: [\n { errorType: \"INVALID_USERNAME\", statusCode: 400 as const },\n { errorType: \"INVALID_MAIL\", statusCode: 400 as const },\n { errorType: \"REDEEMED_VOUCHER_CODE\", statusCode: 400 as const },\n { errorType: \"USERNAME_EXISTS\", statusCode: 400 as const },\n { errorType: \"MAIL_EXISTS\", statusCode: 400 as const },\n { errorType: \"PWNED_NEW_PASSWORD\", statusCode: 400 as const },\n { errorType: \"DISPOSABLE_MAIL_NOT_ALLOWED\", statusCode: 400 as const },\n { statusCode: 403 as const },\n { errorType: \"CLIENT_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"INVALID_VOUCHER_CODE\", statusCode: 404 as const },\n { errorType: \"INVALID_GIFT_CARD_CONFIRMATION_CODE\", statusCode: 404 as const },\n { errorType: \"FAMILY_INVITE_INVALID_CODE\", statusCode: 404 as const },\n { errorType: \"FAMILY_INVITE_OWNER_NOT_ACTIVE\", statusCode: 404 as const },\n { errorType: \"FRIEND_INVITE_INVALID_CODE\", statusCode: 404 as const },\n { errorType: \"FRIEND_INVITE_OWNER_NOT_ACTIVE\", statusCode: 404 as const },\n { errorType: \"PLAN_NOT_FOUND\", statusCode: 404 as const },\n ],\n});\nexport const VoucherLookupErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"getVoucher\",\n knownErrors: [{ errorType: \"INVALID_VOUCHER_CODE\", statusCode: 404 as const }],\n});\nexport const GiftCardLookupErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"getGiftCard\",\n knownErrors: [{ errorType: \"INVALID_CONFIRMATION_CODE\", statusCode: 404 as const }],\n});\nexport const FamilyInviteLookupErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"getFamilyInvite\",\n knownErrors: [{ errorType: \"INVALID_FAMILY_INVITE_CODE\", statusCode: 404 as const }],\n});\nexport const FriendInviteLookupErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"getFriendInvite\",\n knownErrors: [\n { errorType: \"INVALID_FRIEND_INVITE_CODE\", statusCode: 404 as const },\n { errorType: \"FRIEND_INVITE_INVALID_CODE\", statusCode: 404 as const },\n ],\n});\nexport const ForgotPasswordErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"forgotPassword\",\n knownErrors: [{ statusCode: 404 as const }],\n});\nexport const ResetPasswordErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"resetPassword\",\n knownErrors: [\n { errorType: \"INVALID_PASSWORD_RESET_KEY\", statusCode: 400 as const },\n { errorType: \"PWNED_NEW_PASSWORD\", statusCode: 400 as const },\n ],\n});\nexport const LinkDeviceErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"linkDevice\",\n knownErrors: [{ statusCode: 404 as const }],\n});\nexport const GrantsErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"grants\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const ClientsErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"clients\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const RevokeOAuthGrantErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"revokeApp\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const RevokeOAuthClientErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"revokeClient\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const RevokeAllOAuthClientsErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"revokeAllClients\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const GenerateTOTPErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"generateTOTP\",\n knownErrors: [\n { errorType: \"already_exists\", statusCode: 403 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const VerifyTOTPErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"verifyTOTP\",\n knownErrors: [\n { errorType: \"invalid_setup\", statusCode: 400 as const },\n { errorType: \"invalid_code\", statusCode: 400 as const },\n { errorType: \"code_not_found\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const RecoveryCodesErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"getRecoveryCodes\",\n knownErrors: [\n { errorType: \"invalid_setup\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const RegenerateRecoveryCodesErrorSpec = definePutioOperationErrorSpec({\n domain: \"auth\",\n operation: \"regenerateRecoveryCodes\",\n knownErrors: [\n { errorType: \"invalid_setup\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport type LoginError = PutioOperationFailure<typeof LoginErrorSpec>;\nexport type RegisterError = PutioOperationFailure<typeof RegisterErrorSpec>;\nexport type VoucherLookupError = PutioOperationFailure<typeof VoucherLookupErrorSpec>;\nexport type GiftCardLookupError = PutioOperationFailure<typeof GiftCardLookupErrorSpec>;\nexport type FamilyInviteLookupError = PutioOperationFailure<typeof FamilyInviteLookupErrorSpec>;\nexport type FriendInviteLookupError = PutioOperationFailure<typeof FriendInviteLookupErrorSpec>;\nexport type ForgotPasswordError = PutioOperationFailure<typeof ForgotPasswordErrorSpec>;\nexport type ResetPasswordError = PutioOperationFailure<typeof ResetPasswordErrorSpec>;\nexport type LinkDeviceError = PutioOperationFailure<typeof LinkDeviceErrorSpec>;\nexport type GrantsError = PutioOperationFailure<typeof GrantsErrorSpec>;\nexport type ClientsError = PutioOperationFailure<typeof ClientsErrorSpec>;\nexport type RevokeOAuthGrantError = PutioOperationFailure<typeof RevokeOAuthGrantErrorSpec>;\nexport type RevokeOAuthClientError = PutioOperationFailure<typeof RevokeOAuthClientErrorSpec>;\nexport type RevokeAllOAuthClientsError = PutioOperationFailure<\n typeof RevokeAllOAuthClientsErrorSpec\n>;\nexport type GenerateTOTPError = PutioOperationFailure<typeof GenerateTOTPErrorSpec>;\nexport type VerifyTOTPError = PutioOperationFailure<typeof VerifyTOTPErrorSpec>;\nexport type RecoveryCodesError = PutioOperationFailure<typeof RecoveryCodesErrorSpec>;\nexport type RegenerateRecoveryCodesError = PutioOperationFailure<\n typeof RegenerateRecoveryCodesErrorSpec\n>;\nconst decodeAuthInput = <S extends Schema.Top, A, E, R>(\n operation: string,\n schema: S,\n input: unknown,\n run: (decoded: S[\"Type\"]) => Effect.Effect<A, E, R>,\n) =>\n Schema.decodeUnknownEffect(schema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(\n () =>\n new PutioValidationError({\n cause: {\n domain: \"auth\",\n operation,\n reason: \"Invalid request input\",\n },\n }),\n ),\n Effect.flatMap(run),\n );\nexport const buildAuthLoginUrl = (options: {\n readonly clientId: string | number;\n readonly redirectUri: string;\n readonly responseType?: string;\n readonly state: string;\n readonly clientName?: string;\n readonly webAppUrl?: string | URL;\n}) =>\n buildPutioUrl(options.webAppUrl ?? \"https://app.put.io\", \"/authenticate\", {\n client_id: options.clientId,\n client_name: options.clientName,\n isolated: 1,\n redirect_uri: options.redirectUri,\n response_type: options.responseType ?? \"token\",\n state: options.state,\n });\nconst isOAuthAuthorizationCodeExchangeErrorCode = Schema.is(\n OAuthAuthorizationCodeExchangeErrorCodeSchema,\n);\nconst mapOAuthAuthorizationCodeExchangeError = (\n error: PutioSdkError,\n): PutioSdkError | OAuthAuthorizationCodeExchangeError =>\n error instanceof PutioApiError &&\n error.status === 400 &&\n isOAuthAuthorizationCodeExchangeErrorCode(error.body.error)\n ? new OAuthAuthorizationCodeExchangeError({\n code: error.body.error,\n status: 400,\n })\n : error;\nexport const exchangeOAuthAuthorizationCode = (\n input: OAuthAuthorizationCodeExchangeInput,\n): Effect.Effect<string, PutioSdkError | OAuthAuthorizationCodeExchangeError, PutioSdkContext> =>\n decodeAuthInput(\n \"exchangeAuthorizationCode\",\n OAuthAuthorizationCodeExchangeInputSchema,\n input,\n (decodedInput) =>\n requestJson(OAuthAuthorizationCodeResponseSchema, {\n auth: { type: \"none\" },\n body: {\n type: \"form\",\n value: {\n client_id: decodedInput.clientId,\n client_secret: decodedInput.clientSecret,\n code: decodedInput.code,\n grant_type: \"authorization_code\",\n redirect_uri: decodedInput.redirectUri,\n },\n },\n method: \"POST\",\n path: \"/v2/oauth2/access_token\",\n }).pipe(\n selectJsonField(\"access_token\"),\n Effect.mapError(mapOAuthAuthorizationCodeExchangeError),\n ),\n );\nexport const login = (\n input: LoginInput,\n): Effect.Effect<LoginResponse, LoginError, PutioSdkContext> =>\n decodeAuthInput(\"login\", LoginInputSchema, input, (decodedInput) =>\n requestJson(LoginResponseSchema, {\n auth: {\n type: \"basic\",\n password: decodedInput.password,\n username: decodedInput.username,\n },\n method: \"PUT\",\n path: decodedInput.fingerprint\n ? `/v2/oauth2/authorizations/clients/${encodePathSegment(decodedInput.clientId)}/${encodePathSegment(decodedInput.fingerprint)}`\n : `/v2/oauth2/authorizations/clients/${encodePathSegment(decodedInput.clientId)}`,\n query: {\n callback_url: decodedInput.callbackUrl,\n client_name: decodedInput.clientName,\n client_secret: decodedInput.clientSecret,\n },\n }).pipe(selectJsonFields(\"access_token\", \"user_id\")),\n ).pipe(withOperationErrors(LoginErrorSpec));\nexport const logout = (): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n PutioSdkError,\n PutioSdkContext\n> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/oauth/grants/logout\",\n });\nexport const register = (\n input: RegisterInput,\n): Effect.Effect<\n {\n readonly access_token: string;\n },\n RegisterError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"register\", RegisterInputSchema, input, (decodedInput) =>\n requestJson(ResetPasswordEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/registration/register\",\n }).pipe(selectJsonFields(\"access_token\")),\n ).pipe(withOperationErrors(RegisterErrorSpec));\nexport const exists = (\n key: \"mail\" | \"username\",\n value: string,\n): Effect.Effect<boolean, PutioSdkError, PutioSdkContext> =>\n decodeAuthInput(\"exists\", AuthExistsInputSchema, { key, value }, (decodedInput) =>\n requestJson(ExistsEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/registration/exists/${encodePathSegment(decodedInput.key)}`,\n query: {\n value: decodedInput.value,\n },\n }).pipe(selectJsonField(\"exists\")),\n );\nexport const getVoucher = (\n code: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof VoucherEnvelopeSchema>[\"voucher\"],\n VoucherLookupError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"getVoucher\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(VoucherEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/registration/voucher/${encodePathSegment(decodedCode)}`,\n }).pipe(selectJsonField(\"voucher\")),\n ).pipe(withOperationErrors(VoucherLookupErrorSpec));\nexport const getGiftCard = (\n code: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof GiftCardEnvelopeSchema>[\"gift_card\"],\n GiftCardLookupError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"getGiftCard\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(GiftCardEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/registration/gift_card/${encodePathSegment(decodedCode)}`,\n }).pipe(selectJsonField(\"gift_card\")),\n ).pipe(withOperationErrors(GiftCardLookupErrorSpec));\nexport const getFamilyInvite = (\n code: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof FamilyInviteEnvelopeSchema>[\"invite\"],\n FamilyInviteLookupError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"getFamilyInvite\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(FamilyInviteEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/registration/family/${encodePathSegment(decodedCode)}`,\n }).pipe(selectJsonField(\"invite\")),\n ).pipe(withOperationErrors(FamilyInviteLookupErrorSpec));\nexport const getFriendInvite = (\n code: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof FriendInviteEnvelopeSchema>[\"invite\"],\n FriendInviteLookupError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"getFriendInvite\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(FriendInviteEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/registration/friend/${encodePathSegment(decodedCode)}`,\n }).pipe(selectJsonField(\"invite\")),\n ).pipe(withOperationErrors(FriendInviteLookupErrorSpec));\nexport const forgotPassword = (\n mail: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ForgotPasswordError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"forgotPassword\", NonEmptyStringSchema, mail, (decodedMail) =>\n requestJson(OkResponseSchema, {\n auth: {\n type: \"none\",\n },\n body: {\n type: \"form\",\n value: {\n mail: decodedMail,\n },\n },\n method: \"POST\",\n path: \"/v2/registration/password/forgot\",\n }),\n ).pipe(withOperationErrors(ForgotPasswordErrorSpec));\nexport const resetPassword = (\n key: string,\n password: string,\n): Effect.Effect<\n {\n readonly access_token: string;\n },\n ResetPasswordError,\n PutioSdkContext\n> =>\n decodeAuthInput(\n \"resetPassword\",\n AuthResetPasswordInputSchema,\n { key, password },\n (decodedInput) =>\n requestJson(ResetPasswordEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/registration/password/reset\",\n }).pipe(selectJsonFields(\"access_token\")),\n ).pipe(withOperationErrors(ResetPasswordErrorSpec));\nexport const getCode = (\n input: AuthGetCodeInput,\n): Effect.Effect<\n Schema.Schema.Type<typeof AuthorizationCodeSchema>,\n PutioSdkError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"getCode\", AuthGetCodeInputSchema, input, (decodedInput) =>\n requestJson(AuthorizationCodeEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: \"/v2/oauth2/oob/code\",\n query: {\n app_id: decodedInput.appId,\n client_name: decodedInput.clientName,\n },\n }).pipe(selectJsonFields(\"code\", \"qr_code_url\")),\n );\nexport const checkCodeMatch = (\n code: string,\n): Effect.Effect<string | null, PutioSdkError, PutioSdkContext> =>\n decodeAuthInput(\"checkCodeMatch\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(CodeMatchEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: `/v2/oauth2/oob/code/${encodePathSegment(decodedCode)}`,\n }).pipe(selectJsonField(\"oauth_token\")),\n );\nexport const linkDevice = (\n code: string,\n): Effect.Effect<Schema.Schema.Type<typeof OAuthAppSchema>, LinkDeviceError, PutioSdkContext> =>\n decodeAuthInput(\"linkDevice\", NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(LinkDeviceEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n code: decodedCode,\n },\n },\n method: \"POST\",\n path: \"/v2/oauth2/oob/code\",\n }).pipe(selectJsonField(\"app\")),\n ).pipe(withOperationErrors(LinkDeviceErrorSpec));\nexport const grants = (): Effect.Effect<\n ReadonlyArray<Schema.Schema.Type<typeof OAuthAppSchema>>,\n GrantsError,\n PutioSdkContext\n> =>\n requestJson(GrantsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/oauth/grants/\",\n }).pipe(selectJsonField(\"apps\"), withOperationErrors(GrantsErrorSpec));\nexport const revokeApp = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n RevokeOAuthGrantError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"revokeApp\", PositiveIntegerSchema, id, (decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/oauth/grants/${encodePathSegment(decodedId)}/delete`,\n }),\n ).pipe(withOperationErrors(RevokeOAuthGrantErrorSpec));\nexport const clients = (): Effect.Effect<\n ReadonlyArray<Schema.Schema.Type<typeof OAuthAppSessionSchema>>,\n ClientsError,\n PutioSdkContext\n> =>\n requestJson(ClientsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/oauth/clients/\",\n }).pipe(selectJsonField(\"clients\"), withOperationErrors(ClientsErrorSpec));\nexport const revokeClient = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n RevokeOAuthClientError,\n PutioSdkContext\n> =>\n decodeAuthInput(\"revokeClient\", PositiveIntegerSchema, id, (decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/oauth/clients/${encodePathSegment(decodedId)}/delete`,\n }),\n ).pipe(withOperationErrors(RevokeOAuthClientErrorSpec));\nexport const revokeAllClients = (): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n RevokeAllOAuthClientsError,\n PutioSdkContext\n> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/oauth/clients/delete-all\",\n }).pipe(withOperationErrors(RevokeAllOAuthClientsErrorSpec));\nexport const validateToken = (\n token: string,\n): Effect.Effect<ValidateTokenResponse, PutioSdkError, PutioSdkContext> =>\n decodeAuthInput(\"validateToken\", NonEmptyStringSchema, token, (decodedToken) =>\n requestJson(ValidateTokenResponseSchema, {\n auth: {\n type: \"none\",\n },\n method: \"GET\",\n path: \"/v2/oauth2/validate\",\n query: {\n oauth_token: decodedToken,\n },\n }),\n );\nexport const generateTOTP = (): Effect.Effect<\n GenerateTOTPResponse,\n GenerateTOTPError,\n PutioSdkContext\n> =>\n requestJson(GenerateTOTPEnvelopeSchema, {\n method: \"POST\",\n path: \"/v2/two_factor/generate/totp\",\n }).pipe(\n Effect.map(({ recovery_codes, secret, uri }) => ({\n recovery_codes,\n secret,\n uri,\n })),\n withOperationErrors(GenerateTOTPErrorSpec),\n );\nexport const verifyTOTP = (\n twoFactorScopedToken: string,\n code: string,\n): Effect.Effect<VerifyTOTPResponse, VerifyTOTPError, PutioSdkContext> =>\n decodeAuthInput(\n \"verifyTOTP\",\n AuthVerifyTotpInputSchema,\n { code, twoFactorScopedToken },\n (decodedInput) =>\n requestJson(VerifyTOTPEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n body: {\n type: \"form\",\n value: {\n code: decodedInput.code,\n },\n },\n method: \"POST\",\n path: \"/v2/two_factor/verify/totp\",\n query: {\n oauth_token: decodedInput.twoFactorScopedToken,\n },\n }).pipe(\n Effect.map(({ token, user_id }) => ({\n token,\n user_id,\n })),\n ),\n ).pipe(withOperationErrors(VerifyTOTPErrorSpec));\nexport const getRecoveryCodes = (): Effect.Effect<\n TwoFactorRecoveryCodes,\n RecoveryCodesError,\n PutioSdkContext\n> =>\n requestJson(RecoveryCodesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/two_factor/recovery_codes\",\n }).pipe(selectJsonField(\"recovery_codes\"), withOperationErrors(RecoveryCodesErrorSpec));\nexport const regenerateRecoveryCodes = (): Effect.Effect<\n TwoFactorRecoveryCodes,\n RegenerateRecoveryCodesError,\n PutioSdkContext\n> =>\n requestJson(RecoveryCodesEnvelopeSchema, {\n method: \"POST\",\n path: \"/v2/two_factor/recovery_codes/refresh\",\n }).pipe(selectJsonField(\"recovery_codes\"), withOperationErrors(RegenerateRecoveryCodesErrorSpec));\n","import { Effect, Schema, SchemaIssue, SchemaParser } from \"effect\";\nimport { mapDecodeErrorToValidationError, type PutioSdkError } from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport type PutioJsonPrimitive = string | number | boolean | null;\nexport type PutioJsonValue =\n | PutioJsonPrimitive\n | {\n readonly [key: string]: PutioJsonValue;\n }\n | ReadonlyArray<PutioJsonValue>;\nexport type PutioJsonObject = {\n readonly [key: string]: PutioJsonValue;\n};\nconst nativeObjectConstructorSource = Function.prototype.toString.call(Object);\nconst nativeArrayConstructorSource = Function.prototype.toString.call(Array);\nconst hasMatchingNativeConstructor = (prototype: object, constructorSource: string): boolean => {\n const constructor = Object.getOwnPropertyDescriptor(prototype, \"constructor\")?.value;\n const constructorPrototype =\n typeof constructor === \"function\"\n ? Object.getOwnPropertyDescriptor(constructor, \"prototype\")?.value\n : undefined;\n return (\n typeof constructor === \"function\" &&\n constructorPrototype === prototype &&\n Function.prototype.toString.call(constructor) === constructorSource\n );\n};\nconst isPlainRecord = (value: object): value is Record<string, unknown> => {\n try {\n const prototype = Object.getPrototypeOf(value);\n if (prototype === null) {\n return true;\n }\n if (Object.getPrototypeOf(prototype) !== null) {\n return false;\n }\n return hasMatchingNativeConstructor(prototype, nativeObjectConstructorSource);\n } catch {\n return false;\n }\n};\nconst isPlainArray = (value: ReadonlyArray<unknown>): boolean => {\n try {\n const prototype = Object.getPrototypeOf(value);\n return (\n prototype !== null &&\n Object.getPrototypeOf(prototype) !== null &&\n hasMatchingNativeConstructor(prototype, nativeArrayConstructorSource)\n );\n } catch {\n return false;\n }\n};\ntype JsonWalkMode = \"snapshot\" | \"validate\";\ntype JsonWalkResult =\n | { readonly _tag: \"Invalid\" }\n | { readonly _tag: \"Validated\" }\n | { readonly _tag: \"Snapshot\"; readonly value: PutioJsonValue };\nconst invalidJsonWalk: JsonWalkResult = { _tag: \"Invalid\" };\nconst validatedJsonWalk: JsonWalkResult = { _tag: \"Validated\" };\nconst walkJsonValue = (\n value: unknown,\n mode: JsonWalkMode,\n ancestors: Set<object> = new Set(),\n): JsonWalkResult => {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\") {\n return mode === \"snapshot\" ? { _tag: \"Snapshot\", value } : validatedJsonWalk;\n }\n if (typeof value === \"number\") {\n return Number.isFinite(value)\n ? mode === \"snapshot\"\n ? { _tag: \"Snapshot\", value }\n : validatedJsonWalk\n : invalidJsonWalk;\n }\n if (typeof value !== \"object\" || ancestors.has(value)) {\n return invalidJsonWalk;\n }\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n if (!isPlainArray(value)) {\n return invalidJsonWalk;\n }\n const descriptors = Object.getOwnPropertyDescriptors(value);\n const lengthDescriptor = descriptors[\"length\"];\n if (\n lengthDescriptor === undefined ||\n !(\"value\" in lengthDescriptor) ||\n !Number.isSafeInteger(lengthDescriptor.value) ||\n lengthDescriptor.value < 0\n ) {\n return invalidJsonWalk;\n }\n const output: Array<PutioJsonValue> | undefined = mode === \"snapshot\" ? [] : undefined;\n for (let index = 0; index < lengthDescriptor.value; index += 1) {\n const descriptor = descriptors[String(index)];\n if (descriptor === undefined || !(\"value\" in descriptor)) {\n return invalidJsonWalk;\n }\n const item = walkJsonValue(descriptor.value, mode, ancestors);\n if (item._tag === \"Invalid\") {\n return item;\n }\n if (output === undefined) {\n if (item._tag !== \"Validated\") {\n return invalidJsonWalk;\n }\n } else {\n if (item._tag !== \"Snapshot\") {\n return invalidJsonWalk;\n }\n output.push(item.value);\n }\n }\n return output === undefined ? validatedJsonWalk : { _tag: \"Snapshot\", value: output };\n }\n if (!isPlainRecord(value)) {\n return invalidJsonWalk;\n }\n const output: Record<string, PutioJsonValue> | undefined = mode === \"snapshot\" ? {} : undefined;\n for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {\n if (!descriptor.enumerable) {\n continue;\n }\n if (!(\"value\" in descriptor)) {\n return invalidJsonWalk;\n }\n const item = walkJsonValue(descriptor.value, mode, ancestors);\n if (item._tag === \"Invalid\") {\n return item;\n }\n if (output === undefined) {\n if (item._tag !== \"Validated\") {\n return invalidJsonWalk;\n }\n continue;\n }\n if (item._tag !== \"Snapshot\") {\n return invalidJsonWalk;\n }\n Object.defineProperty(output, key, {\n configurable: true,\n enumerable: true,\n value: item.value,\n writable: true,\n });\n }\n return output === undefined ? validatedJsonWalk : { _tag: \"Snapshot\", value: output };\n } catch {\n return invalidJsonWalk;\n } finally {\n ancestors.delete(value);\n }\n};\nconst snapshotJsonValue = (value: unknown): PutioJsonValue | undefined => {\n const result = walkJsonValue(value, \"snapshot\");\n return result._tag === \"Snapshot\" ? result.value : undefined;\n};\nconst snapshotJsonObject = (value: unknown): PutioJsonObject | undefined => {\n const snapshot = snapshotJsonValue(value);\n return typeof snapshot === \"object\" && snapshot !== null && !Array.isArray(snapshot)\n ? snapshot\n : undefined;\n};\nconst isJsonValue = (value: unknown): value is PutioJsonValue =>\n walkJsonValue(value, \"validate\")._tag === \"Validated\";\nconst isJsonObject = (value: unknown): value is PutioJsonObject =>\n typeof value === \"object\" && value !== null && isJsonValue(value) && !Array.isArray(value);\nexport const JsonValueSchema = Schema.declareConstructor<PutioJsonValue>()(\n [],\n () => (input, ast, options) => {\n const snapshot = snapshotJsonValue(input);\n return snapshot === undefined\n ? Effect.fail(new SchemaIssue.InvalidType(ast, input, options))\n : Effect.succeed(snapshot);\n },\n {\n expected: \"a JSON-compatible value\",\n },\n);\nconst JsonValueResponseSchema = Schema.declareConstructor<PutioJsonValue>()(\n [],\n () => (input, ast, options) =>\n isJsonValue(input)\n ? Effect.succeed(input)\n : Effect.fail(new SchemaIssue.InvalidType(ast, input, options)),\n {\n expected: \"a JSON-compatible value\",\n },\n);\nconst JsonObjectResponseSchema = Schema.declareConstructor<PutioJsonObject>()(\n [],\n () => (input, ast, options) =>\n isJsonObject(input)\n ? Effect.succeed(input)\n : Effect.fail(new SchemaIssue.InvalidType(ast, input, options)),\n {\n expected: \"a JSON object\",\n },\n);\nexport const JsonObjectSchema = Schema.declareConstructor<PutioJsonObject>()(\n [],\n () => (input, ast, options) => {\n const snapshot = snapshotJsonObject(input);\n return snapshot === undefined\n ? Effect.fail(new SchemaIssue.InvalidType(ast, input, options))\n : Effect.succeed(snapshot);\n },\n {\n expected: \"a JSON object\",\n },\n);\nconst ConfigKeySchema = Schema.String.check(\n Schema.isMinLength(1),\n Schema.isPattern(/^(?!\\.{1,2}$)/),\n Schema.makeFilter((key: string) => key.isWellFormed(), {\n expected: \"a well-formed Unicode config key\",\n }),\n);\nconst ConfigSetKeyInputSchema = Schema.Struct({\n key: ConfigKeySchema,\n value: JsonValueSchema,\n});\nconst getResponseEnvelopeFields = (\n input: unknown,\n valueField: \"config\" | \"value\",\n): { readonly status: unknown; readonly value: unknown } | undefined => {\n if (typeof input !== \"object\" || input === null || !isPlainRecord(input)) {\n return undefined;\n }\n try {\n const statusDescriptor = Object.getOwnPropertyDescriptor(input, \"status\");\n const valueDescriptor = Object.getOwnPropertyDescriptor(input, valueField);\n if (\n statusDescriptor === undefined ||\n !(\"value\" in statusDescriptor) ||\n valueDescriptor === undefined ||\n !(\"value\" in valueDescriptor)\n ) {\n return undefined;\n }\n return {\n status: statusDescriptor.value,\n value: valueDescriptor.value,\n };\n } catch {\n return undefined;\n }\n};\nconst makeConfigEnvelopeSchema = <A>(schema: Schema.ConstraintDecoder<A, never>) =>\n Schema.declareConstructor<{\n readonly config: A;\n readonly status: \"OK\";\n }>()([schema], ([configSchema]) => (input, ast, options) => {\n const fields = getResponseEnvelopeFields(input, \"config\");\n if (fields === undefined || fields.status !== \"OK\") {\n return Effect.fail(new SchemaIssue.InvalidType(ast, input, options));\n }\n return SchemaParser.decodeUnknownEffect(configSchema)(fields.value, options).pipe(\n Effect.map((config) => ({ config, status: \"OK\" })),\n );\n });\nconst makeConfigValueEnvelopeSchema = <A>(schema: Schema.ConstraintDecoder<A, never>) =>\n Schema.declareConstructor<{\n readonly status: \"OK\";\n readonly value: A;\n }>()([schema], ([valueSchema]) => (input, ast, options) => {\n const fields = getResponseEnvelopeFields(input, \"value\");\n if (fields === undefined || fields.status !== \"OK\") {\n return Effect.fail(new SchemaIssue.InvalidType(ast, input, options));\n }\n return SchemaParser.decodeUnknownEffect(valueSchema)(fields.value, options).pipe(\n Effect.map((value) => ({ status: \"OK\", value })),\n );\n });\nconst ConfigEnvelopeSchema = makeConfigEnvelopeSchema(JsonObjectResponseSchema);\nconst ConfigValueEnvelopeSchema = makeConfigValueEnvelopeSchema(JsonValueResponseSchema);\nexport const readConfig = (): Effect.Effect<PutioJsonObject, PutioSdkError, PutioSdkContext> =>\n requestJson(ConfigEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/config\",\n }).pipe(selectJsonField(\"config\"));\nexport const readConfigWith = <A>(\n schema: Schema.ConstraintDecoder<A, never>,\n): Effect.Effect<A, PutioSdkError, PutioSdkContext> =>\n requestJson(makeConfigEnvelopeSchema(JsonObjectResponseSchema.pipe(Schema.decodeTo(schema))), {\n method: \"GET\",\n path: \"/v2/config\",\n }).pipe(Effect.map((envelope) => envelope[\"config\"]));\nexport const writeConfig = (\n config: PutioJsonObject,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(JsonObjectSchema)(config).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedConfig) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"json\",\n value: {\n config: decodedConfig,\n },\n },\n method: \"PUT\",\n path: \"/v2/config\",\n }),\n ),\n );\nexport const getConfigKey = (\n key: string,\n): Effect.Effect<PutioJsonValue, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedKey) =>\n requestJson(ConfigValueEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/config/${encodePathSegment(decodedKey)}`,\n }),\n ),\n selectJsonField(\"value\"),\n );\nexport const getConfigKeyWith = <A>(\n key: string,\n schema: Schema.ConstraintDecoder<A, never>,\n): Effect.Effect<A, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedKey) =>\n requestJson(\n makeConfigValueEnvelopeSchema(JsonValueResponseSchema.pipe(Schema.decodeTo(schema))),\n {\n method: \"GET\",\n path: `/v2/config/${encodePathSegment(decodedKey)}`,\n },\n ),\n ),\n Effect.map((envelope) => envelope[\"value\"]),\n );\nexport const setConfigKey = (\n key: string,\n value: PutioJsonValue,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(ConfigSetKeyInputSchema, { onExcessProperty: \"error\" })({\n key,\n value,\n }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"json\",\n value: {\n value: decodedInput.value,\n },\n },\n method: \"PUT\",\n path: `/v2/config/${encodePathSegment(decodedInput.key)}`,\n }),\n ),\n );\nexport const deleteConfigKey = (\n key: string,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedKey) =>\n requestJson(OkResponseSchema, {\n method: \"DELETE\",\n path: `/v2/config/${encodePathSegment(decodedKey)}`,\n }),\n ),\n );\n","import { Effect, Schema } from \"effect\";\nimport { toCursorSelectionForm } from \"../core/forms.js\";\nimport { PositiveIntegerSchema, makeCursorSelectionSchema } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n encodePathSegment,\n requestJson,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport const DownloadLinksStatusSchema = Schema.Literals([\"NEW\", \"PROCESSING\", \"DONE\", \"ERROR\"]);\nexport const DownloadLinksCreateInputSchema = makeCursorSelectionSchema(\"ids\", \"excludeIds\", {});\nexport const DownloadLinksPayloadSchema = Schema.Struct({\n download_links: Schema.Array(Schema.String),\n media_links: Schema.Array(Schema.String),\n mp4_links: Schema.Array(Schema.String),\n});\nconst DownloadLinksCreateEnvelopeSchema = Schema.Struct({\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n status: Schema.Literal(\"OK\"),\n});\nconst DownloadLinksPendingEnvelopeSchema = Schema.Struct({\n error_msg: Schema.optional(Schema.NullOr(Schema.String)),\n links: Schema.Null,\n links_status: Schema.Literals([\"NEW\", \"PROCESSING\"]),\n status: Schema.Literal(\"OK\"),\n});\nconst DownloadLinksDoneEnvelopeSchema = Schema.Struct({\n error_msg: Schema.optional(Schema.NullOr(Schema.String)),\n links: DownloadLinksPayloadSchema,\n links_status: Schema.Literal(\"DONE\"),\n status: Schema.Literal(\"OK\"),\n});\nconst DownloadLinksErrorEnvelopeSchema = Schema.Struct({\n error_msg: Schema.String,\n links: Schema.Null,\n links_status: Schema.Literal(\"ERROR\"),\n status: Schema.Literal(\"OK\"),\n});\nexport const DownloadLinksInfoSchema = Schema.Union([\n DownloadLinksPendingEnvelopeSchema,\n DownloadLinksDoneEnvelopeSchema,\n DownloadLinksErrorEnvelopeSchema,\n]);\nexport type DownloadLinksStatus = Schema.Schema.Type<typeof DownloadLinksStatusSchema>;\nexport type DownloadLinksCreateInput = Schema.Schema.Type<typeof DownloadLinksCreateInputSchema>;\nexport type DownloadLinksPayload = Schema.Schema.Type<typeof DownloadLinksPayloadSchema>;\nexport type DownloadLinksInfo = Schema.Schema.Type<typeof DownloadLinksInfoSchema>;\nexport const CreateDownloadLinksErrorSpec = definePutioOperationErrorSpec({\n domain: \"downloadLinks\",\n operation: \"create\",\n knownErrors: [\n { errorType: \"DownloadLinksConcurrentLimit\", statusCode: 400 as const },\n { errorType: \"DownloadLinksTooManyFilesRequested\", statusCode: 400 as const },\n { errorType: \"DownloadLinksTooManyChildrenRequested\", statusCode: 400 as const },\n { errorType: \"BadRequest\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const GetDownloadLinksErrorSpec = definePutioOperationErrorSpec({\n domain: \"downloadLinks\",\n operation: \"get\",\n knownErrors: [\n { errorType: \"LINKS_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport type CreateDownloadLinksError = PutioOperationFailure<typeof CreateDownloadLinksErrorSpec>;\nexport type GetDownloadLinksError = PutioOperationFailure<typeof GetDownloadLinksErrorSpec>;\nexport const createDownloadLinks = (\n input: DownloadLinksCreateInput = {},\n): Effect.Effect<\n {\n readonly id: number;\n },\n CreateDownloadLinksError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(DownloadLinksCreateInputSchema, { onExcessProperty: \"error\" })(\n input,\n ).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(DownloadLinksCreateEnvelopeSchema, {\n body: {\n type: \"form\",\n value: toCursorSelectionForm(decodedInput),\n },\n method: \"POST\",\n path: \"/v2/download_links/create\",\n }),\n ),\n selectJsonFields(\"id\"),\n withOperationErrors(CreateDownloadLinksErrorSpec),\n );\nexport const getDownloadLinks = (\n id: number,\n): Effect.Effect<DownloadLinksInfo, GetDownloadLinksError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(DownloadLinksInfoSchema, {\n method: \"GET\",\n path: `/v2/download_links/${encodePathSegment(decodedId)}`,\n }),\n ),\n withOperationErrors(GetDownloadLinksErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\nimport { PositiveIntegerSchema } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestArrayBuffer,\n requestJson,\n type PutioSdkContext,\n} from \"../core/http.js\";\nconst HistoryEventBaseSchema = Schema.Struct({\n created_at: Schema.String,\n id: Schema.Int,\n type: Schema.String,\n user_id: Schema.Int,\n});\nconst HistoryFileEventSchema = HistoryEventBaseSchema.pipe(\n Schema.fieldsAssign({\n file_id: Schema.Int,\n file_name: Schema.String,\n file_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n }),\n);\nconst HistoryTransferEventSchema = HistoryEventBaseSchema.pipe(\n Schema.fieldsAssign({\n source: Schema.String,\n transfer_name: Schema.String,\n }),\n);\nexport const HistoryFileSharedEventSchema = HistoryFileEventSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n sharing_user_name: Schema.String,\n type: Schema.Literal(\"file_shared\"),\n }),\n);\nexport const HistoryUploadEventSchema = HistoryFileEventSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n type: Schema.Literal(\"upload\"),\n }),\n);\nexport const HistoryFileFromRssDeletedEventSchema = HistoryFileEventSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n file_source: Schema.String,\n type: Schema.Literal(\"file_from_rss_deleted_for_space\"),\n }),\n);\nexport const HistoryTransferCompletedEventSchema = HistoryTransferEventSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n file_id: Schema.Int,\n transfer_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n type: Schema.Literal(\"transfer_completed\"),\n }),\n);\nexport const HistoryTransferErrorEventSchema = HistoryTransferEventSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n type: Schema.Literal(\"transfer_error\"),\n }),\n);\nexport const HistoryTransferFromRssErrorEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n rss_id: Schema.Int,\n transfer_name: Schema.String,\n type: Schema.Literal(\"transfer_from_rss_error\"),\n }),\n);\nexport const HistoryTransferCallbackErrorEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n message: Schema.String,\n transfer_id: Schema.Int,\n transfer_name: Schema.String,\n type: Schema.Literal(\"transfer_callback_error\"),\n }),\n);\nexport const HistoryPrivateTorrentPinEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n new_host_ip: Schema.String,\n pinned_host_ip: Schema.String,\n type: Schema.Literal(\"private_torrent_pin\"),\n user_download_name: Schema.String,\n }),\n);\nexport const HistoryRssFilterPausedEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n rss_filter_id: Schema.Int,\n rss_filter_title: Schema.String,\n type: Schema.Literal(\"rss_filter_paused\"),\n }),\n);\nexport const HistoryVoucherEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n type: Schema.Literal(\"voucher\"),\n voucher: Schema.Int,\n voucher_owner_id: Schema.Int,\n voucher_owner_name: Schema.String,\n }),\n);\nexport const HistoryZipCreatedEventSchema = HistoryEventBaseSchema.mapFields(\n ({ type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n type: Schema.Literal(\"zip_created\"),\n zip_id: Schema.Int,\n zip_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n }),\n);\nexport const HistoryKnownEventTypeSchema = Schema.Literals([\n \"file_shared\",\n \"upload\",\n \"file_from_rss_deleted_for_space\",\n \"transfer_completed\",\n \"transfer_error\",\n \"transfer_from_rss_error\",\n \"transfer_callback_error\",\n \"private_torrent_pin\",\n \"rss_filter_paused\",\n \"voucher\",\n \"zip_created\",\n]);\nexport const HistoryEventSchema = Schema.Union([\n HistoryFileSharedEventSchema,\n HistoryUploadEventSchema,\n HistoryFileFromRssDeletedEventSchema,\n HistoryTransferCompletedEventSchema,\n HistoryTransferErrorEventSchema,\n HistoryTransferFromRssErrorEventSchema,\n HistoryTransferCallbackErrorEventSchema,\n HistoryPrivateTorrentPinEventSchema,\n HistoryRssFilterPausedEventSchema,\n HistoryVoucherEventSchema,\n HistoryZipCreatedEventSchema,\n HistoryEventBaseSchema,\n]);\nexport const EventsListQuerySchema = Schema.Struct({\n before: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n});\nconst EventsListEnvelopeSchema = Schema.Struct({\n events: Schema.Array(HistoryEventSchema),\n has_more: Schema.Boolean,\n status: Schema.Literal(\"OK\"),\n});\nexport type HistoryKnownEventType = Schema.Schema.Type<typeof HistoryKnownEventTypeSchema>;\nexport type HistoryEvent = Schema.Schema.Type<typeof HistoryEventSchema>;\nexport type EventsListQuery = Schema.Schema.Type<typeof EventsListQuerySchema>;\nexport type EventsListResponse = Schema.Schema.Type<typeof EventsListEnvelopeSchema>;\nexport type HistoryFileSharedEvent = Schema.Schema.Type<typeof HistoryFileSharedEventSchema>;\nexport type HistoryTransferCompletedEvent = Schema.Schema.Type<\n typeof HistoryTransferCompletedEventSchema\n>;\nexport type HistoryZipCreatedEvent = Schema.Schema.Type<typeof HistoryZipCreatedEventSchema>;\nexport const ListEventsErrorSpec = definePutioOperationErrorSpec({\n domain: \"events\",\n operation: \"list\",\n knownErrors: [\n { errorType: \"INVALID_PER_PAGE\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const DeleteEventErrorSpec = definePutioOperationErrorSpec({\n domain: \"events\",\n operation: \"delete\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const ClearEventsErrorSpec = definePutioOperationErrorSpec({\n domain: \"events\",\n operation: \"clear\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const GetEventTorrentErrorSpec = definePutioOperationErrorSpec({\n domain: \"events\",\n operation: \"getTorrent\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"INVALID_EVENT\", statusCode: 500 as const },\n { statusCode: 404 as const },\n { statusCode: 500 as const },\n ],\n});\nexport type ListEventsError = PutioOperationFailure<typeof ListEventsErrorSpec>;\nexport type DeleteEventError = PutioOperationFailure<typeof DeleteEventErrorSpec>;\nexport type ClearEventsError = PutioOperationFailure<typeof ClearEventsErrorSpec>;\nexport type GetEventTorrentError = PutioOperationFailure<typeof GetEventTorrentErrorSpec>;\nexport const listEvents = (\n query: EventsListQuery = {},\n): Effect.Effect<EventsListResponse, ListEventsError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(EventsListQuerySchema, { onExcessProperty: \"error\" })(query).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedQuery) =>\n requestJson(EventsListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/events/list\",\n query: decodedQuery,\n }),\n ),\n withOperationErrors(ListEventsErrorSpec),\n );\nexport const deleteEvent = (\n id: number,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, DeleteEventError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/events/delete/${encodePathSegment(decodedId)}`,\n }),\n ),\n withOperationErrors(DeleteEventErrorSpec),\n );\nexport const clearEvents = (): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ClearEventsError,\n PutioSdkContext\n> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/events/delete\",\n }).pipe(withOperationErrors(ClearEventsErrorSpec));\nexport const getEventTorrent = (\n id: number,\n): Effect.Effect<Uint8Array, GetEventTorrentError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestArrayBuffer({\n method: \"GET\",\n path: `/v2/events/${encodePathSegment(decodedId)}/torrent`,\n }),\n ),\n withOperationErrors(GetEventTorrentErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { NonEmptyStringSchema } from \"../core/validation.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nconst NonNegativeIntegerSchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));\nconst NonNegativeIntegerFromStringSchema = Schema.NumberFromString.check(\n Schema.isInt(),\n Schema.isGreaterThanOrEqualTo(0),\n);\nexport const FamilyInviteSchema = Schema.Struct({\n code: Schema.String,\n created_at: Schema.String,\n user_id: Schema.NullOr(Schema.Int),\n});\nexport const FamilyMemberSchema = Schema.Struct({\n avatar_url: Schema.String,\n created_at: Schema.String,\n disk_used: Schema.Union([NonNegativeIntegerSchema, NonNegativeIntegerFromStringSchema]),\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n is_owner: Schema.Boolean,\n name: Schema.String,\n});\nconst FamilyInvitesEnvelopeSchema = Schema.Struct({\n invites: Schema.Array(FamilyInviteSchema),\n limit: NonNegativeIntegerSchema,\n remaining_limit: NonNegativeIntegerSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst FamilyMembersEnvelopeSchema = Schema.Struct({\n members: Schema.Array(FamilyMemberSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst FamilyCreateInviteEnvelopeSchema = Schema.Struct({\n code: Schema.String,\n status: Schema.Literal(\"OK\"),\n});\nexport type FamilyInvite = Schema.Schema.Type<typeof FamilyInviteSchema>;\nexport type FamilyMember = Schema.Schema.Type<typeof FamilyMemberSchema>;\nexport type FamilyInvitesResponse = {\n readonly invites: ReadonlyArray<FamilyInvite>;\n readonly limit: number;\n readonly remaining_limit: number;\n};\nconst RestrictedFamilyError = { errorType: \"invalid_scope\", statusCode: 401 as const };\nexport const ListFamilyInvitesErrorSpec = definePutioOperationErrorSpec({\n domain: \"family\",\n operation: \"listInvites\",\n knownErrors: [RestrictedFamilyError],\n});\nexport const ListFamilyMembersErrorSpec = definePutioOperationErrorSpec({\n domain: \"family\",\n operation: \"listMembers\",\n knownErrors: [RestrictedFamilyError],\n});\nexport const CreateFamilyInviteErrorSpec = definePutioOperationErrorSpec({\n domain: \"family\",\n operation: \"createInvite\",\n knownErrors: [\n { errorType: \"FAMILY_SUB_ACCOUNT_NOT_ALLOWED\", statusCode: 403 as const },\n { errorType: \"FAMILY_SUB_ACCOUNT_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"FAMILY_UNUSED_INVITE_LIMIT_EXCEEDED\", statusCode: 403 as const },\n RestrictedFamilyError,\n { statusCode: 403 as const },\n ],\n});\nexport const RemoveFamilyMemberErrorSpec = definePutioOperationErrorSpec({\n domain: \"family\",\n operation: \"removeMember\",\n knownErrors: [RestrictedFamilyError, { statusCode: 404 as const }],\n});\nexport const JoinFamilyErrorSpec = definePutioOperationErrorSpec({\n domain: \"family\",\n operation: \"join\",\n knownErrors: [\n { errorType: \"FAMILY_INVITE_ACTIVE_USER\", statusCode: 403 as const },\n { errorType: \"FAMILY_INVITE_ANOTHER_FAMILY\", statusCode: 403 as const },\n { errorType: \"FAMILY_INVITE_INVALID_CODE\", statusCode: 403 as const },\n { errorType: \"FAMILY_INVITE_OWNER_NOT_FOUND\", statusCode: 403 as const },\n { errorType: \"FAMILY_INVITE_OWNER_NOT_ACTIVE\", statusCode: 403 as const },\n { errorType: \"FAMILY_INVITE_OWNER_NO_LIMIT\", statusCode: 403 as const },\n { errorType: \"FAMILY_LIMIT_EXCEEDED\", statusCode: 403 as const },\n RestrictedFamilyError,\n { statusCode: 403 as const },\n ],\n});\nexport type ListFamilyInvitesError = PutioOperationFailure<typeof ListFamilyInvitesErrorSpec>;\nexport type ListFamilyMembersError = PutioOperationFailure<typeof ListFamilyMembersErrorSpec>;\nexport type CreateFamilyInviteError = PutioOperationFailure<typeof CreateFamilyInviteErrorSpec>;\nexport type RemoveFamilyMemberError = PutioOperationFailure<typeof RemoveFamilyMemberErrorSpec>;\nexport type JoinFamilyError = PutioOperationFailure<typeof JoinFamilyErrorSpec>;\nexport const listFamilyInvites = (): Effect.Effect<\n FamilyInvitesResponse,\n ListFamilyInvitesError,\n PutioSdkContext\n> =>\n requestJson(FamilyInvitesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/family/invites\",\n }).pipe(\n selectJsonFields(\"invites\", \"limit\", \"remaining_limit\"),\n withOperationErrors(ListFamilyInvitesErrorSpec),\n );\nexport const listFamilyMembers = (): Effect.Effect<\n ReadonlyArray<FamilyMember>,\n ListFamilyMembersError,\n PutioSdkContext\n> =>\n requestJson(FamilyMembersEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/family/members\",\n }).pipe(selectJsonField(\"members\"), withOperationErrors(ListFamilyMembersErrorSpec));\nexport const createFamilyInvite = (): Effect.Effect<\n {\n readonly code: string;\n },\n CreateFamilyInviteError,\n PutioSdkContext\n> =>\n requestJson(FamilyCreateInviteEnvelopeSchema, {\n method: \"POST\",\n path: \"/v2/family/sub_account\",\n }).pipe(selectJsonFields(\"code\"), withOperationErrors(CreateFamilyInviteErrorSpec));\nexport const removeFamilyMember = (\n username: string,\n): Effect.Effect<void, RemoveFamilyMemberError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(NonEmptyStringSchema)(username).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedUsername) =>\n requestJson(OkResponseSchema, {\n method: \"DELETE\",\n path: `/v2/family/sub_account/${encodePathSegment(decodedUsername)}`,\n }),\n ),\n Effect.asVoid,\n withOperationErrors(RemoveFamilyMemberErrorSpec),\n );\nexport const joinFamily = (\n inviteCode: string,\n): Effect.Effect<void, JoinFamilyError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(NonEmptyStringSchema)(inviteCode).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInviteCode) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/family/join/${encodePathSegment(decodedInviteCode)}`,\n }),\n ),\n Effect.asVoid,\n withOperationErrors(JoinFamilyErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\n\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n requestJson,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema, decodeAndRun } from \"../core/validation.js\";\nimport { JsonObjectSchema, type PutioJsonObject } from \"./config.js\";\n\nconst IFTTTStatusEnvelopeSchema = Schema.Struct({\n enabled: Schema.Boolean,\n status: Schema.Literal(\"OK\"),\n});\n\nexport type IftttEventType = \"playback_started\" | \"playback_stopped\" | (string & {});\n\nexport type IftttEventInput =\n | {\n readonly clientName?: string;\n readonly eventType: \"playback_started\" | \"playback_stopped\";\n readonly ingredients: {\n readonly file_id: number;\n readonly file_name: string;\n readonly file_type: string;\n };\n }\n | {\n readonly clientName?: string;\n readonly eventType: IftttEventType;\n readonly ingredients: PutioJsonObject;\n };\n\nconst IftttPlaybackIngredientsSchema = Schema.Struct({\n file_id: PositiveIntegerSchema,\n file_name: NonEmptyStringSchema,\n file_type: NonEmptyStringSchema,\n});\nconst isIftttPlaybackIngredients = Schema.is(IftttPlaybackIngredientsSchema);\nconst IftttEventInputSchema = Schema.Struct({\n clientName: Schema.optional(NonEmptyStringSchema),\n eventType: NonEmptyStringSchema,\n ingredients: JsonObjectSchema,\n}).check(\n Schema.makeFilter(\n (input) =>\n input.eventType !== \"playback_started\" && input.eventType !== \"playback_stopped\"\n ? true\n : isIftttPlaybackIngredients(input.ingredients),\n { expected: \"complete playback ingredients for playback events\" },\n ),\n);\n\nexport const GetIftttStatusErrorSpec = definePutioOperationErrorSpec({\n domain: \"ifttt\",\n operation: \"getStatus\",\n knownErrors: [{ statusCode: 402 as const }],\n});\n\nexport const SendIftttEventErrorSpec = definePutioOperationErrorSpec({\n domain: \"ifttt\",\n operation: \"sendEvent\",\n knownErrors: [\n { errorType: \"INVALID_EVENT_TYPE\", statusCode: 400 as const },\n { errorType: \"MISSING_INGREDIENTS\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 402 as const },\n { statusCode: 400 as const },\n ],\n});\n\nexport type GetIftttStatusError = PutioOperationFailure<typeof GetIftttStatusErrorSpec>;\nexport type SendIftttEventError = PutioOperationFailure<typeof SendIftttEventErrorSpec>;\n\nexport const getIftttStatus = (): Effect.Effect<\n { readonly enabled: boolean },\n GetIftttStatusError,\n PutioSdkContext\n> =>\n requestJson(IFTTTStatusEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/ifttt-client/status\",\n }).pipe(selectJsonFields(\"enabled\"), withOperationErrors(GetIftttStatusErrorSpec));\n\nexport const sendIftttEvent = (\n input: IftttEventInput,\n): Effect.Effect<void, SendIftttEventError, PutioSdkContext> =>\n decodeAndRun(IftttEventInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n client_name: decodedInput.clientName,\n event_type: decodedInput.eventType,\n ingredients: decodedInput.ingredients,\n },\n },\n method: \"POST\",\n path: \"/v2/ifttt-client/event\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(SendIftttEventErrorSpec));\n","import { Effect, Schema } from \"effect\";\nimport { joinCsv, toCursorSelectionForm } from \"../core/forms.js\";\nimport {\n mapDecodeErrorToValidationError,\n mapConfigurationError,\n PutioValidationError,\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n type PutioSdkError,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n PutioSdkConfig,\n buildPutioUrl,\n encodePathSegment,\n requestJson,\n requestText,\n requestVoid,\n selectJsonField,\n type PutioSdkConfigShape,\n type PutioSdkContext,\n} from \"../core/http.js\";\nimport {\n NonEmptyStringSchema,\n PositiveIntegerSchema,\n decodeAndRun,\n makeCursorSelectionSchema,\n} from \"../core/validation.js\";\nconst RequestedFlag = Schema.Literal(1);\nconst NonNegativeFileIdSchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));\n// Readable file ids: real ids plus the virtual sharing tree put.io serves\n// from the same routes (-2 is the \"shared with you\" root, ids below it are\n// per-sharer folders). -1 is not a file and stays rejected.\nexport const SHARED_WITH_YOU_ROOT_ID = -2;\nconst ReadableFileIdSchema = Schema.Int.check(\n Schema.makeFilter((id: number) => id >= 0 || id <= SHARED_WITH_YOU_ROOT_ID, {\n expected: \"a file id that is non-negative or a virtual sharing id (-2 or lower)\",\n }),\n);\nconst PositiveFileIdSchema = Schema.Int.check(Schema.isGreaterThan(0));\nexport const FileTypeSchema = Schema.Literals([\n \"FOLDER\",\n \"FILE\",\n \"AUDIO\",\n \"VIDEO\",\n \"IMAGE\",\n \"ARCHIVE\",\n \"PDF\",\n \"TEXT\",\n \"SWF\",\n]);\nexport const FolderTypeSchema = Schema.Literals([\"REGULAR\", \"SHARED_ROOT\", \"SHARED_FRIEND\"]);\nexport const FileSortSchema = Schema.Literals([\n \"NAME_ASC\",\n \"NAME_DESC\",\n \"SIZE_ASC\",\n \"SIZE_DESC\",\n \"DATE_ASC\",\n \"DATE_DESC\",\n \"MODIFIED_ASC\",\n \"MODIFIED_DESC\",\n \"TYPE_ASC\",\n \"TYPE_DESC\",\n \"WATCH_ASC\",\n \"WATCH_DESC\",\n]);\nexport const FileSetSortInputSchema = Schema.Struct({\n fileId: NonNegativeFileIdSchema,\n sortBy: FileSortSchema,\n});\nexport const FileCopyInputSchema = Schema.Struct({\n fileId: PositiveFileIdSchema,\n name: Schema.optional(Schema.String.check(Schema.isMinLength(1))),\n parentId: NonNegativeFileIdSchema,\n});\nexport const FileTouchInputSchema = Schema.Struct({\n fileIds: Schema.Array(NonNegativeFileIdSchema).check(Schema.isMinLength(1)),\n updatedAt: Schema.optional(Schema.Date),\n});\nexport const FileMediaMetadataSchema = Schema.Struct({\n aspect_ratio: Schema.optional(\n Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n ),\n codec: Schema.optional(Schema.NullOr(Schema.String)),\n duration: Schema.optional(Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)))),\n height: Schema.optional(Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))),\n width: Schema.optional(Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))),\n});\nexport const FileMediaInfoFormatSchema = Schema.Struct({\n bit_rate: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n duration: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n name: Schema.optional(Schema.String),\n});\nexport const FileMediaInfoStreamSchema = Schema.Struct({\n channels: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n // Streams whose codec was not identified can carry a null name.\n codec_name: Schema.optional(Schema.NullOr(Schema.String)),\n codec_type: Schema.optional(Schema.String),\n height: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n // FFmpeg reports an unknown codec level as -99, including MJPEG streams.\n level: Schema.optional(\n Schema.Union([Schema.Literal(-99), Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))]),\n ),\n profile: Schema.optional(Schema.NullOr(Schema.String)),\n // put.io only derives an RFC 6381 codec string for MP4-family containers;\n // Matroska and other streams report null.\n rfc6381_codec: Schema.optional(Schema.NullOr(Schema.String)),\n width: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nexport const FileMediaInfoSchema = Schema.Struct({\n format: Schema.optional(Schema.NullOr(FileMediaInfoFormatSchema)),\n mime_type: Schema.optional(Schema.NullOr(Schema.String)),\n playback_issues: Schema.optional(Schema.Array(Schema.String)),\n streams: Schema.optional(Schema.Array(FileMediaInfoStreamSchema)),\n});\nexport const FileBaseSchema = Schema.Struct({\n content_type: Schema.NullOr(Schema.String),\n created_at: Schema.String,\n crc32: Schema.NullOr(Schema.String),\n extension: Schema.NullOr(Schema.String),\n file_type: FileTypeSchema,\n first_accessed_at: Schema.NullOr(Schema.String),\n folder_type: FolderTypeSchema,\n icon: Schema.NullOr(Schema.String),\n id: Schema.Int,\n is_hidden: Schema.Boolean,\n is_mp4_available: Schema.Boolean,\n is_shared: Schema.Boolean,\n name: Schema.String,\n opensubtitles_hash: Schema.NullOr(Schema.String),\n parent_id: Schema.NullOr(Schema.Int),\n screenshot: Schema.NullOr(Schema.String),\n sha1: Schema.optional(Schema.NullOr(Schema.String)),\n size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n start_from: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n updated_at: Schema.String,\n});\nexport const FileBroadSchema = FileBaseSchema.pipe(\n Schema.fieldsAssign({\n content_type_and_codecs: Schema.optional(Schema.NullOr(Schema.String)),\n media_info: Schema.optional(Schema.NullOr(FileMediaInfoSchema)),\n media_metadata: Schema.optional(Schema.NullOr(FileMediaMetadataSchema)),\n mp4_size: Schema.optional(Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)))),\n mp4_stream_url: Schema.optional(Schema.NullOr(Schema.String)),\n need_convert: Schema.optional(Schema.Boolean),\n sender_name: Schema.optional(Schema.String),\n sort_by: Schema.optional(FileSortSchema),\n stream_url: Schema.optional(Schema.NullOr(Schema.String)),\n video_metadata: Schema.optional(Schema.NullOr(FileMediaMetadataSchema)),\n }),\n);\nexport const FileQuerySchema = Schema.Struct({\n codecs: Schema.optional(RequestedFlag),\n media_info: Schema.optional(RequestedFlag),\n media_metadata: Schema.optional(RequestedFlag),\n mp4_status: Schema.optional(RequestedFlag),\n mp4_stream_url: Schema.optional(RequestedFlag),\n stream_url: Schema.optional(RequestedFlag),\n video_metadata: Schema.optional(RequestedFlag),\n});\nexport const FileGetChildInputSchema = Schema.Struct({\n name: Schema.String.check(Schema.isMinLength(1)),\n parentId: NonNegativeFileIdSchema,\n query: Schema.optional(FileQuerySchema),\n});\nexport const FilesListQuerySchema = FileQuerySchema.mapFields(\n ({ codecs: _codecs, media_info: _mediaInfo, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n breadcrumbs: Schema.optional(RequestedFlag),\n codecs_parent: Schema.optional(RequestedFlag),\n content_type: Schema.optional(Schema.String),\n file_type: Schema.optional(Schema.String),\n hidden: Schema.optional(RequestedFlag),\n media_info_parent: Schema.optional(RequestedFlag),\n media_metadata_parent: Schema.optional(RequestedFlag),\n mp4_status_parent: Schema.optional(RequestedFlag),\n mp4_stream_url_parent: Schema.optional(RequestedFlag),\n no_cursor: Schema.optional(RequestedFlag),\n per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n sort: Schema.optional(FileSortSchema),\n sort_by: Schema.optional(FileSortSchema),\n stream_url_parent: Schema.optional(RequestedFlag),\n total: Schema.optional(RequestedFlag),\n video_metadata_parent: Schema.optional(RequestedFlag),\n }),\n);\nexport const FilesSearchQuerySchema = Schema.Struct({\n per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n query: Schema.String,\n});\nexport const FileBreadcrumbSchema = Schema.Tuple([Schema.Int, Schema.String]);\nconst FileEnvelopeSchema = Schema.Struct({\n file: FileBroadSchema,\n status: Schema.Literal(\"OK\"),\n});\nexport const FilesListEnvelopeSchema = Schema.Struct({\n breadcrumbs: Schema.optional(Schema.Array(FileBreadcrumbSchema)),\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(FileBroadSchema),\n parent: Schema.NullOr(FileBroadSchema),\n status: Schema.Literal(\"OK\"),\n total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst FilesListContinueEnvelopeSchema = Schema.Struct({\n breadcrumbs: Schema.optional(Schema.Array(FileBreadcrumbSchema)),\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(FileBroadSchema),\n parent: Schema.optional(Schema.NullOr(FileBroadSchema)),\n status: Schema.Literal(\"OK\"),\n total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst FilesSearchEnvelopeSchema = Schema.Struct({\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(FileBroadSchema),\n status: Schema.Literal(\"OK\"),\n total: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n});\nconst FilesListInputSchema = Schema.Struct({\n parent: Schema.Union([ReadableFileIdSchema, Schema.Literal(\"friends\")]),\n query: FilesListQuerySchema,\n});\nconst FilesContinueInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n query: Schema.Struct({\n per_page: Schema.optional(PositiveIntegerSchema),\n }),\n});\nconst FileGetInputSchema = Schema.Struct({\n id: ReadableFileIdSchema,\n query: Schema.optional(FileQuerySchema),\n});\nconst FilesSearchContinueInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n query: Schema.Struct({\n per_page: Schema.optional(PositiveIntegerSchema),\n }),\n});\nconst FileSubtitlesInputSchema = Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: Schema.Struct({\n languages: Schema.optional(Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1))),\n }),\n});\nconst FileNextInputSchema = Schema.Struct({\n fileId: PositiveFileIdSchema,\n fileType: FileTypeSchema,\n});\nconst FileCreateFolderInputSchema = Schema.Struct({\n name: Schema.optional(NonEmptyStringSchema),\n parent_id: Schema.optional(NonNegativeFileIdSchema),\n path: Schema.optional(NonEmptyStringSchema),\n}).check(\n Schema.makeFilter((input) => input.name !== undefined || input.path !== undefined, {\n expected: \"a non-empty folder name or path\",\n }),\n);\nconst FileRenameInputSchema = Schema.Struct({\n file_id: PositiveFileIdSchema,\n name: NonEmptyStringSchema,\n});\nconst FileStartFromSetInputSchema = Schema.Struct({\n file_id: PositiveFileIdSchema,\n time: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n});\nconst FileStartFromEnvelopeSchema = Schema.Struct({\n start_from: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n});\nconst FileDownloadUrlEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n url: Schema.String,\n});\nconst FileCanWriteEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n user_id: Schema.Int,\n});\nconst FileUploadTransferSchema = Schema.Struct({\n id: Schema.Int,\n name: Schema.String,\n});\nconst FileUploadEnvelopeSchema = Schema.Struct({\n file: Schema.optional(FileBroadSchema),\n status: Schema.Literal(\"OK\"),\n transfer: Schema.optional(FileUploadTransferSchema),\n});\nconst FileConversionNotAvailableSchema = Schema.Struct({\n id: Schema.Int,\n status: Schema.Literal(\"NOT_AVAILABLE\"),\n});\nconst FileConversionInQueueSchema = Schema.Struct({\n id: Schema.Int,\n percent_done: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n status: Schema.Literal(\"IN_QUEUE\"),\n});\nconst FileConversionConvertingSchema = Schema.Struct({\n id: Schema.Int,\n percent_done: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"CONVERTING\"),\n});\nconst FileConversionCompletedSchema = Schema.Struct({\n id: Schema.Int,\n percent_done: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"COMPLETED\"),\n});\nconst FileConversionErrorSchema = Schema.Struct({\n id: Schema.Int,\n status: Schema.Literal(\"ERROR\"),\n});\nexport const FileConversionStatusSchema = Schema.Union([\n FileConversionNotAvailableSchema,\n FileConversionInQueueSchema,\n FileConversionConvertingSchema,\n FileConversionCompletedSchema,\n FileConversionErrorSchema,\n]);\nconst FileConversionStatusEnvelopeSchema = Schema.Struct({\n mp4: FileConversionStatusSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst FilesBulkConvertEnvelopeSchema = Schema.Struct({\n count: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n});\nconst ActiveConversionFields = {\n name: Schema.String,\n};\nexport const FileActiveConversionSchema = Schema.Union([\n FileConversionNotAvailableSchema.pipe(Schema.fieldsAssign(ActiveConversionFields)),\n FileConversionInQueueSchema.pipe(Schema.fieldsAssign(ActiveConversionFields)),\n FileConversionConvertingSchema.pipe(Schema.fieldsAssign(ActiveConversionFields)),\n FileConversionCompletedSchema.pipe(Schema.fieldsAssign(ActiveConversionFields)),\n FileConversionErrorSchema.pipe(Schema.fieldsAssign(ActiveConversionFields)),\n]);\nconst FileActiveConversionsEnvelopeSchema = Schema.Struct({\n mp4s: Schema.Array(FileActiveConversionSchema),\n});\nexport const FileSubtitleSchema = Schema.Struct({\n format: Schema.String,\n key: Schema.String,\n language: Schema.String,\n language_code: Schema.String,\n name: Schema.String,\n source: Schema.String,\n url: Schema.String,\n});\nconst FileSubtitlesEnvelopeSchema = Schema.Struct({\n default: Schema.NullOr(Schema.String),\n subtitles: Schema.Array(FileSubtitleSchema),\n});\nconst FileDeleteResultEnvelopeSchema = Schema.Struct({\n cursor: Schema.NullOr(Schema.String),\n skipped: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n});\nexport const FilesMoveErrorSchema = Schema.Struct({\n error_type: Schema.String,\n id: Schema.Int,\n name: Schema.NullOr(Schema.String),\n status_code: Schema.Int,\n});\nconst FilesMoveEnvelopeSchema = Schema.Struct({\n errors: Schema.Array(FilesMoveErrorSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport const FileExtractionStatusSchema = Schema.Literals([\n \"ERROR\",\n \"EXTRACTED\",\n \"EXTRACTING\",\n \"NEW\",\n \"PASSWORD\",\n \"PASSWORD_OBTAINED\",\n \"SENT_TO_QUEUE\",\n]);\nexport const FileExtractionSchema = Schema.Struct({\n files: Schema.Array(Schema.Int),\n id: Schema.Int,\n message: Schema.NullOr(Schema.String),\n name: Schema.String,\n num_parts: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: FileExtractionStatusSchema,\n});\nconst FileExtractionsEnvelopeSchema = Schema.Struct({\n extractions: Schema.Array(FileExtractionSchema),\n status: Schema.optional(Schema.Literal(\"OK\")),\n});\nconst FilesBulkSelectionSchema = Schema.Struct({\n cursor: Schema.optional(NonEmptyStringSchema),\n excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n ids: Schema.optional(Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1))),\n}).check(\n Schema.makeFilter((input) => input.cursor !== undefined || input.ids !== undefined, {\n expected: \"a non-empty cursor or file ID selection\",\n }),\n);\nconst FilesDeleteOptionsSchema = Schema.Struct({\n ignoreFileOwner: Schema.optional(Schema.Boolean),\n partialDelete: Schema.optional(Schema.Boolean),\n skipTrash: Schema.optional(Schema.Boolean),\n});\nconst FilesSelectionDeleteOptionsSchema = Schema.Struct({\n partialDelete: Schema.optional(Schema.Boolean),\n skipTrash: Schema.optional(Schema.Boolean),\n});\nconst FilesIdsInputSchema = Schema.Array(PositiveFileIdSchema).check(Schema.isMinLength(1));\nconst FilesMoveInputSchema = Schema.Struct({\n ids: FilesIdsInputSchema,\n parentId: NonNegativeFileIdSchema,\n});\nconst FilesMoveSelectionInputSchema = Schema.Struct({\n parentId: NonNegativeFileIdSchema,\n selection: FilesBulkSelectionSchema,\n});\nconst FilesWatchStatusInputSchema = makeCursorSelectionSchema(\"ids\", \"excludeIds\", {\n watched: Schema.Boolean,\n});\nconst FilesExtractInputSchema = makeCursorSelectionSchema(\"ids\", \"excludeIds\", {\n password: Schema.optional(NonEmptyStringSchema),\n});\nconst FileUploadInputSchema = Schema.Struct({\n file: Schema.instanceOf(Blob),\n fileName: Schema.optional(NonEmptyStringSchema),\n parentId: Schema.optional(NonNegativeFileIdSchema),\n});\nconst FileUploadOptionsSchema = Schema.Struct({\n oauthToken: Schema.optional(NonEmptyStringSchema),\n});\nconst FileDirectAccessOptionsSchema = Schema.Struct({\n oauthToken: Schema.optional(NonEmptyStringSchema),\n useTunnel: Schema.optional(Schema.Boolean),\n});\nconst FileApiDownloadUrlOptionsSchema = FileDirectAccessOptionsSchema.pipe(\n Schema.fieldsAssign({ name: Schema.optional(NonEmptyStringSchema) }),\n);\nconst FileApiMp4DownloadUrlOptionsSchema = FileDirectAccessOptionsSchema.pipe(\n Schema.fieldsAssign({\n convert: Schema.optional(Schema.Boolean),\n name: Schema.optional(NonEmptyStringSchema),\n }),\n);\nconst FileHlsStreamUrlOptionsSchema = Schema.Struct({\n maxSubtitleCount: Schema.optional(PositiveIntegerSchema),\n oauthToken: Schema.optional(NonEmptyStringSchema),\n playOriginal: Schema.optional(Schema.Boolean),\n subtitleLanguages: Schema.optional(\n Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1)),\n ),\n});\nconst FileHlsMasterPlaylistOptionsSchema = Schema.Struct({\n maxSubtitleCount: Schema.optional(PositiveIntegerSchema),\n playOriginal: Schema.optional(Schema.Boolean),\n subtitleLanguages: Schema.optional(\n Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1)),\n ),\n});\nconst FileXspfPlaylistUrlOptionsSchema = Schema.Struct({\n oauthToken: Schema.optional(NonEmptyStringSchema),\n});\nconst FilesNextFileSchema = Schema.Struct({\n id: Schema.Int,\n name: Schema.String,\n parent_id: Schema.NullOr(Schema.Int),\n});\nconst FilesNextFileEnvelopeSchema = Schema.Struct({\n next_file: FilesNextFileSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst FilesNextVideoEnvelopeSchema = Schema.Struct({\n next_video: FilesNextFileSchema,\n status: Schema.Literal(\"OK\"),\n});\nexport type FileType = Schema.Schema.Type<typeof FileTypeSchema>;\nexport type FolderType = Schema.Schema.Type<typeof FolderTypeSchema>;\nexport type FileSort = Schema.Schema.Type<typeof FileSortSchema>;\nexport type FileSetSortInput = Schema.Schema.Type<typeof FileSetSortInputSchema>;\nexport type FileCopyInput = Schema.Schema.Type<typeof FileCopyInputSchema>;\nexport type FileTouchInput = Schema.Schema.Type<typeof FileTouchInputSchema>;\nexport type FileMediaMetadata = Schema.Schema.Type<typeof FileMediaMetadataSchema>;\nexport type FileMediaInfo = Schema.Schema.Type<typeof FileMediaInfoSchema>;\nexport type FileBase = Schema.Schema.Type<typeof FileBaseSchema>;\nexport type FileBroad = Schema.Schema.Type<typeof FileBroadSchema>;\nexport type FileCore = FileBase;\nexport type FileVideoMetadata = FileMediaMetadata;\nexport type FileQuery = Schema.Schema.Type<typeof FileQuerySchema>;\nexport type FileGetChildInput = Schema.Schema.Type<typeof FileGetChildInputSchema>;\nexport type FilesListQuery = Schema.Schema.Type<typeof FilesListQuerySchema>;\nexport type FilesSearchQuery = Schema.Schema.Type<typeof FilesSearchQuerySchema>;\nexport type FileBreadcrumb = Schema.Schema.Type<typeof FileBreadcrumbSchema>;\nexport type FileListResponse = Schema.Schema.Type<typeof FilesListEnvelopeSchema>;\nexport type FileListContinuationResponse = Schema.Schema.Type<\n typeof FilesListContinueEnvelopeSchema\n>;\nexport type FileSearchResponse = Schema.Schema.Type<typeof FilesSearchEnvelopeSchema>;\nexport type FileCreateFolderInput = Schema.Schema.Type<typeof FileCreateFolderInputSchema>;\nexport type FileRenameInput = Schema.Schema.Type<typeof FileRenameInputSchema>;\nexport type FileStartFromSetInput = Schema.Schema.Type<typeof FileStartFromSetInputSchema>;\nexport type FileConversionStatus = Schema.Schema.Type<typeof FileConversionStatusSchema>;\nexport type FileActiveConversion = Schema.Schema.Type<typeof FileActiveConversionSchema>;\nexport type FileExtractionStatus = Schema.Schema.Type<typeof FileExtractionStatusSchema>;\nexport type FileExtraction = Schema.Schema.Type<typeof FileExtractionSchema>;\nexport type FileSubtitle = Schema.Schema.Type<typeof FileSubtitleSchema>;\nexport type FilesMoveError = Schema.Schema.Type<typeof FilesMoveErrorSchema>;\ntype FilesBulkSelectionShape = Schema.Schema.Type<typeof FilesBulkSelectionSchema>;\nexport type FilesBulkSelection =\n | (FilesBulkSelectionShape & { readonly cursor: string })\n | (FilesBulkSelectionShape & { readonly ids: ReadonlyArray<number> });\nexport type FileUploadTransfer = Schema.Schema.Type<typeof FileUploadTransferSchema>;\nexport type FileUploadEnvelope = Schema.Schema.Type<typeof FileUploadEnvelopeSchema>;\nexport type FileUploadResult =\n | {\n readonly type: \"file\";\n readonly file: FileBroad;\n }\n | {\n readonly type: \"transfer\";\n readonly transfer: FileUploadTransfer;\n };\nexport type FileDirectAccessOptions = {\n readonly oauthToken?: string;\n readonly useTunnel?: boolean;\n};\nexport type FileApiDownloadUrlOptions = FileDirectAccessOptions & {\n readonly name?: string;\n};\nexport type FileApiMp4DownloadUrlOptions = FileDirectAccessOptions & {\n readonly convert?: boolean;\n readonly name?: string;\n};\nexport type FileHlsMasterPlaylistOptions = Schema.Schema.Type<\n typeof FileHlsMasterPlaylistOptionsSchema\n>;\nexport type FileHlsStreamUrlOptions = {\n readonly maxSubtitleCount?: number;\n readonly oauthToken?: string;\n readonly playOriginal?: boolean;\n readonly subtitleLanguages?: ReadonlyArray<string>;\n};\nexport type FileXspfPlaylistUrlOptions = {\n readonly oauthToken?: string;\n};\nexport type FileUploadInput = {\n readonly file: Blob;\n readonly fileName?: string;\n readonly parentId?: number;\n};\nexport type FileUploadRequestDescriptor = {\n readonly body: FormData;\n readonly method: \"POST\";\n readonly url: string;\n};\nexport type FileResponseFor<TQuery extends FileQuery> = FileBase &\n (TQuery[\"stream_url\"] extends 1\n ? {\n readonly stream_url: string | null;\n }\n : {}) &\n (TQuery[\"mp4_status\"] extends 1\n ? {\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n }\n : {}) &\n (TQuery[\"mp4_stream_url\"] extends 1\n ?\n | {\n readonly is_mp4_available: true;\n readonly mp4_stream_url: string | null;\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n }\n | {\n readonly is_mp4_available: false;\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n }\n : {}) &\n (TQuery[\"video_metadata\"] extends 1\n ? TQuery[\"media_metadata\"] extends 1\n ? {}\n : {\n readonly video_metadata: FileMediaMetadata | null;\n }\n : {}) &\n (TQuery[\"media_metadata\"] extends 1\n ? {\n readonly media_metadata: FileMediaMetadata | null;\n }\n : {}) &\n (TQuery[\"codecs\"] extends 1\n ? {\n readonly content_type_and_codecs: string | null;\n }\n : {}) &\n (TQuery[\"media_info\"] extends 1\n ? {\n readonly media_info: FileMediaInfo | null;\n }\n : {});\nexport const QueryFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"query\",\n knownErrors: [\n { statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const ContinueFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"continue\",\n knownErrors: [\n { statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const GetFileErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"get\",\n knownErrors: [\n { statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const GetHlsMasterPlaylistErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"hlsMasterPlaylist\",\n knownErrors: [\n { errorType: \"INVALID_MEDIA\", statusCode: 400 as const },\n { errorType: \"MP4_NOT_FOUND\", statusCode: 400 as const },\n { errorType: \"MP4_NOT_READY\", statusCode: 400 as const },\n { statusCode: 400 as const },\n { statusCode: 402 as const },\n { statusCode: 404 as const },\n { errorType: \"FILE_NOT_READY\", statusCode: 503 as const },\n ],\n});\nexport const GetFileChildErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"getChild\",\n knownErrors: [\n { statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const CopyFileErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"copy\",\n knownErrors: [\n { errorType: \"NAME_ALREADY_EXIST\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const TouchFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"touch\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 403 as const },\n ],\n});\nexport const CanWriteFileErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"canWrite\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 402 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const SearchFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"search\",\n knownErrors: [\n { errorType: \"SEARCH_TOO_LONG_QUERY\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const CreateFolderErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"createFolder\",\n knownErrors: [\n { errorType: \"EMPTY_NAME\", statusCode: 400 as const },\n { errorType: \"SLASH_IN_NAME\", statusCode: 400 as const },\n { errorType: \"NAME_TOO_LONG\", statusCode: 400 as const },\n { errorType: \"NAME_ALREADY_EXIST\", statusCode: 400 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const RenameFileErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"rename\",\n knownErrors: [\n { errorType: \"EMPTY_NAME\", statusCode: 400 as const },\n { errorType: \"SLASH_IN_NAME\", statusCode: 400 as const },\n { errorType: \"NAME_TOO_LONG\", statusCode: 400 as const },\n { errorType: \"NAME_ALREADY_EXIST\", statusCode: 400 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const StartFromErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"startFrom\",\n knownErrors: [\n { errorType: \"FEATURE_DISABLED\", statusCode: 400 as const },\n { errorType: \"INVALID_MEDIA\", statusCode: 400 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const DownloadUrlErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"getDownloadUrl\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 402 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const FileMp4ErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"mp4\",\n knownErrors: [\n { errorType: \"INVALID_MEDIA\", statusCode: 400 as const },\n { errorType: \"MP4_NOT_FOUND\", statusCode: 400 as const },\n { errorType: \"NotFile\", statusCode: 400 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const FileSubtitlesErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"listSubtitles\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n { statusCode: 402 as const },\n ],\n});\nexport const FileActiveConversionsErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"listActiveConversions\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 402 as const },\n ],\n});\nexport const FileMp4MutationErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"manageMp4\",\n knownErrors: [\n { errorType: \"MP4_NOT_FOUND\", statusCode: 400 as const },\n { errorType: \"NotFile\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 402 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const FileExtractionsErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"extract\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 402 as const },\n ],\n});\nexport const FileWatchStatusErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"setWatchStatus\",\n knownErrors: [\n { errorType: \"FEATURE_DISABLED\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const FileUploadErrorSpec = definePutioOperationErrorSpec({\n domain: \"files\",\n operation: \"upload\",\n knownErrors: [\n { errorType: \"Unauthorized\", statusCode: 401 as const },\n { statusCode: 401 as const },\n { statusCode: 402 as const },\n { statusCode: 429 as const },\n ],\n});\nexport type QueryFilesError = PutioOperationFailure<typeof QueryFilesErrorSpec>;\nexport type ContinueFilesError = PutioOperationFailure<typeof ContinueFilesErrorSpec>;\nexport type GetFileError = PutioOperationFailure<typeof GetFileErrorSpec>;\nexport type GetHlsMasterPlaylistError = PutioOperationFailure<typeof GetHlsMasterPlaylistErrorSpec>;\nexport type GetFileChildError = PutioOperationFailure<typeof GetFileChildErrorSpec>;\nexport type CopyFileError = PutioOperationFailure<typeof CopyFileErrorSpec>;\nexport type TouchFilesError = PutioOperationFailure<typeof TouchFilesErrorSpec>;\nexport type CanWriteFileError = PutioOperationFailure<typeof CanWriteFileErrorSpec>;\nexport type SearchFilesError = PutioOperationFailure<typeof SearchFilesErrorSpec>;\nexport type CreateFolderError = PutioOperationFailure<typeof CreateFolderErrorSpec>;\nexport type RenameFileError = PutioOperationFailure<typeof RenameFileErrorSpec>;\nexport type StartFromError = PutioOperationFailure<typeof StartFromErrorSpec>;\nexport type DownloadUrlError = PutioOperationFailure<typeof DownloadUrlErrorSpec>;\nexport type FileMp4Error = PutioOperationFailure<typeof FileMp4ErrorSpec>;\nexport type FileSubtitlesError = PutioOperationFailure<typeof FileSubtitlesErrorSpec>;\nexport type FileActiveConversionsError = PutioOperationFailure<\n typeof FileActiveConversionsErrorSpec\n>;\nexport type FileMp4MutationError = PutioOperationFailure<typeof FileMp4MutationErrorSpec>;\nexport type FileExtractionsError = PutioOperationFailure<typeof FileExtractionsErrorSpec>;\nexport type FileWatchStatusError = PutioOperationFailure<typeof FileWatchStatusErrorSpec>;\nexport type FileUploadError = PutioOperationFailure<typeof FileUploadErrorSpec>;\nconst missingFieldError = (field: string) =>\n new PutioValidationError({\n cause: `Expected put.io to include \"${field}\" because it was requested`,\n });\nconst failMissingField = (field: string): Effect.Effect<never, PutioValidationError> =>\n Effect.fail(missingFieldError(field));\nconst widenValidationError = <A, E, R>(\n effect: Effect.Effect<A, E, R>,\n): Effect.Effect<A, E | PutioValidationError, R> => effect;\nconst hasStreamUrl = (\n value: FileBroad,\n): value is FileBroad & {\n readonly stream_url: string | null;\n} => \"stream_url\" in value;\nconst hasMp4StreamUrl = (\n value: FileBroad,\n): value is FileBroad & {\n readonly mp4_stream_url: string | null;\n} => \"mp4_stream_url\" in value;\nconst hasMp4StreamUrlWhenAvailable = (\n value: FileBroad,\n): value is FileBroad &\n (\n | {\n readonly is_mp4_available: true;\n readonly mp4_stream_url: string | null;\n }\n | {\n readonly is_mp4_available: false;\n }\n ) => !value.is_mp4_available || hasMp4StreamUrl(value);\nconst hasMp4StatusFields = (\n value: FileBroad,\n): value is FileBroad & {\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n} => \"mp4_size\" in value && typeof value.need_convert === \"boolean\";\nconst hasVideoMetadata = (\n value: FileBroad,\n): value is FileBroad & {\n readonly video_metadata: FileMediaMetadata | null;\n} => \"video_metadata\" in value;\nconst hasMediaMetadata = (\n value: FileBroad,\n): value is FileBroad & {\n readonly media_metadata: FileMediaMetadata | null;\n} => \"media_metadata\" in value;\nconst hasCodecs = (\n value: FileBroad,\n): value is FileBroad & {\n readonly content_type_and_codecs: string | null;\n} => \"content_type_and_codecs\" in value;\nconst hasMediaInfo = (\n value: FileBroad,\n): value is FileBroad & {\n readonly media_info: FileMediaInfo | null;\n} => \"media_info\" in value;\nconst useTunnelToQuery = (useTunnel?: boolean) =>\n useTunnel === false\n ? {\n notunnel: 1,\n }\n : {};\nconst resolveRouteContext = (\n oauthToken?: string,\n): Effect.Effect<\n {\n readonly config: PutioSdkConfigShape;\n readonly oauthToken: string;\n },\n PutioSdkError,\n PutioSdkConfig\n> =>\n Effect.gen(function* () {\n const config = yield* PutioSdkConfig;\n const resolvedOauthToken = oauthToken ?? config.accessToken;\n if (resolvedOauthToken) {\n return {\n config,\n oauthToken: resolvedOauthToken,\n };\n }\n return yield* Effect.fail(\n mapConfigurationError(\n \"This helper requires an oauth token, but neither an override nor PutioSdkConfig.accessToken was provided\",\n ),\n );\n });\nconst normalizeFileName = (name: string) => encodeURIComponent(name);\nconst toUploadResult = (value: FileUploadEnvelope): FileUploadResult => {\n if (value.file) {\n return {\n file: value.file,\n type: \"file\",\n };\n }\n if (value.transfer) {\n return {\n transfer: value.transfer,\n type: \"transfer\",\n };\n }\n throw new PutioValidationError({\n cause: 'Expected put.io upload response to contain either \"file\" or \"transfer\"',\n });\n};\nexport const buildFileApiDownloadUrl = (\n baseUrl: string | URL,\n fileId: number,\n options: FileApiDownloadUrlOptions = {},\n): string =>\n buildPutioUrl(\n baseUrl,\n options.name\n ? `/v2/files/${encodePathSegment(fileId)}/download/${normalizeFileName(options.name)}`\n : `/v2/files/${encodePathSegment(fileId)}/download`,\n {\n ...useTunnelToQuery(options.useTunnel),\n oauth_token: options.oauthToken,\n },\n );\nexport const buildFileApiContentUrl = (\n baseUrl: string | URL,\n fileId: number,\n options: FileDirectAccessOptions = {},\n): string =>\n buildPutioUrl(baseUrl, `/v2/files/${encodePathSegment(fileId)}/stream`, {\n ...useTunnelToQuery(options.useTunnel),\n oauth_token: options.oauthToken,\n });\nexport const buildFileApiMp4DownloadUrl = (\n baseUrl: string | URL,\n fileId: number,\n options: FileApiMp4DownloadUrlOptions = {},\n): string =>\n buildPutioUrl(\n baseUrl,\n options.name\n ? `/v2/files/${encodePathSegment(fileId)}/mp4/download/${normalizeFileName(options.name)}`\n : `/v2/files/${encodePathSegment(fileId)}/mp4/download`,\n {\n ...useTunnelToQuery(options.useTunnel),\n convert: options.convert ? 1 : undefined,\n oauth_token: options.oauthToken,\n },\n );\nexport const buildFileHlsStreamUrl = (\n baseUrl: string | URL,\n fileId: number,\n options: FileHlsStreamUrlOptions = {},\n): string =>\n buildPutioUrl(baseUrl, `/v2/files/${encodePathSegment(fileId)}/hls/media.m3u8`, {\n max_subtitle_count: options.maxSubtitleCount,\n oauth_token: options.oauthToken,\n original:\n typeof options.playOriginal === \"boolean\" ? (options.playOriginal ? 1 : 0) : undefined,\n subtitle_languages: joinCsv(options.subtitleLanguages),\n });\nexport const buildFileXspfPlaylistUrl = (\n baseUrl: string | URL,\n fileId: number,\n options: FileXspfPlaylistUrlOptions = {},\n): string =>\n buildPutioUrl(baseUrl, `/v2/files/${encodePathSegment(fileId)}/xspf`, {\n oauth_token: options.oauthToken,\n });\nexport const createFileUploadFormData = (input: FileUploadInput): FormData => {\n const formData = new FormData();\n formData.append(\"file\", input.file);\n if (input.fileName) {\n formData.append(\"filename\", input.fileName);\n }\n if (input.parentId !== undefined) {\n formData.append(\"parent_id\", String(input.parentId));\n }\n return formData;\n};\nconst ensureFileQueryFields = <TQuery extends FileQuery, E>(\n effect: Effect.Effect<FileBroad, E, PutioSdkContext>,\n query: TQuery,\n): Effect.Effect<FileResponseFor<TQuery>, E | PutioValidationError, PutioSdkContext> =>\n Effect.gen(function* () {\n const file = yield* widenValidationError(effect);\n if (query.stream_url === 1 && !hasStreamUrl(file)) {\n return yield* failMissingField(\"stream_url\");\n }\n if ((query.mp4_status === 1 || query.mp4_stream_url === 1) && !hasMp4StatusFields(file)) {\n return yield* failMissingField(\n query.mp4_stream_url === 1 ? \"mp4_size/need_convert\" : \"mp4_size\",\n );\n }\n if (query.mp4_stream_url === 1 && !hasMp4StreamUrlWhenAvailable(file)) {\n return yield* failMissingField(\"mp4_stream_url\");\n }\n if (query.video_metadata === 1 && query.media_metadata !== 1 && !hasVideoMetadata(file)) {\n return yield* failMissingField(\"video_metadata\");\n }\n if (query.media_metadata === 1 && !hasMediaMetadata(file)) {\n return yield* failMissingField(\"media_metadata\");\n }\n if (query.codecs === 1 && !hasCodecs(file)) {\n return yield* failMissingField(\"content_type_and_codecs\");\n }\n if (query.media_info === 1 && !hasMediaInfo(file)) {\n return yield* failMissingField(\"media_info\");\n }\n // Requested-field checks above turn the decoded broad payload into the\n // query-conditioned response contract the rest of the SDK can trust.\n return file as FileResponseFor<TQuery>;\n });\nexport const queryFiles = (\n parent: number | \"friends\",\n query: FilesListQuery = {},\n): Effect.Effect<FileListResponse, QueryFilesError, PutioSdkContext> =>\n decodeAndRun(FilesListInputSchema, { parent, query }, (decodedInput) =>\n requestJson(FilesListEnvelopeSchema, {\n method: \"GET\",\n path:\n decodedInput.parent === \"friends\"\n ? \"/v2/files/list/items-shared-with-you\"\n : \"/v2/files/list\",\n query:\n decodedInput.parent === \"friends\"\n ? decodedInput.query\n : {\n ...decodedInput.query,\n parent_id: decodedInput.parent,\n },\n }),\n ).pipe(withOperationErrors(QueryFilesErrorSpec));\nexport const continueFiles = (\n cursor: string,\n query: {\n readonly per_page?: number;\n } = {},\n): Effect.Effect<FileListContinuationResponse, ContinueFilesError, PutioSdkContext> =>\n decodeAndRun(FilesContinueInputSchema, { cursor, query }, (decodedInput) =>\n requestJson(FilesListContinueEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n cursor: decodedInput.cursor,\n },\n },\n method: \"POST\",\n path: \"/v2/files/list/continue\",\n query: decodedInput.query,\n }),\n ).pipe(withOperationErrors(ContinueFilesErrorSpec));\nexport function getFile(input: {\n readonly id: number;\n}): Effect.Effect<FileCore, GetFileError | PutioValidationError, PutioSdkContext>;\nexport function getFile<TQuery extends FileQuery>(input: {\n readonly id: number;\n readonly query: TQuery;\n}): Effect.Effect<FileResponseFor<TQuery>, GetFileError | PutioValidationError, PutioSdkContext>;\nexport function getFile(input: { readonly id: number; readonly query?: FileQuery | null }) {\n return decodeAndRun(FileGetInputSchema, input, (decodedInput) => {\n const effect = requestJson(FileEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedInput.id)}`,\n query: decodedInput.query,\n }).pipe(selectJsonField(\"file\"), withOperationErrors(GetFileErrorSpec));\n return decodedInput.query === undefined\n ? effect\n : ensureFileQueryFields(effect, decodedInput.query);\n });\n}\nexport function getFileChild(input: {\n readonly name: string;\n readonly parentId: number;\n}): Effect.Effect<FileCore, GetFileChildError | PutioValidationError, PutioSdkContext>;\nexport function getFileChild<TQuery extends FileQuery>(input: {\n readonly name: string;\n readonly parentId: number;\n readonly query: TQuery;\n}): Effect.Effect<\n FileResponseFor<TQuery>,\n GetFileChildError | PutioValidationError,\n PutioSdkContext\n>;\nexport function getFileChild(input: FileGetChildInput) {\n return Schema.decodeUnknownEffect(FileGetChildInputSchema, { onExcessProperty: \"error\" })(\n input,\n ).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) => {\n const effect = requestJson(FileEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedInput.parentId)}/child`,\n query: {\n ...decodedInput.query,\n name: decodedInput.name,\n },\n }).pipe(selectJsonField(\"file\"), withOperationErrors(GetFileChildErrorSpec));\n return decodedInput.query === undefined\n ? effect\n : ensureFileQueryFields(effect, decodedInput.query);\n }),\n );\n}\nexport const copyFile = (\n input: FileCopyInput,\n): Effect.Effect<FileBroad, CopyFileError | PutioValidationError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(FileCopyInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(FileEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n file_id: decodedInput.fileId,\n name: decodedInput.name,\n parent_id: decodedInput.parentId,\n },\n },\n method: \"POST\",\n path: \"/v2/files/copy\",\n }),\n ),\n selectJsonField(\"file\"),\n withOperationErrors(CopyFileErrorSpec),\n );\nexport const touchFiles = (\n input: FileTouchInput,\n): Effect.Effect<void, TouchFilesError | PutioValidationError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(FileTouchInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n file_ids: joinCsv(decodedInput.fileIds),\n updated_at: decodedInput.updatedAt?.toISOString(),\n },\n },\n method: \"POST\",\n path: \"/v2/files/touch\",\n }),\n ),\n Effect.asVoid,\n withOperationErrors(TouchFilesErrorSpec),\n );\nexport const canWriteFile = (\n fileId: number,\n): Effect.Effect<number, CanWriteFileError | PutioValidationError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveFileIdSchema)(fileId).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedFileId) =>\n requestJson(FileCanWriteEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/can-write`,\n }),\n ),\n selectJsonField(\"user_id\"),\n withOperationErrors(CanWriteFileErrorSpec),\n );\nexport const searchFiles = (\n query: FilesSearchQuery,\n): Effect.Effect<FileSearchResponse, SearchFilesError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(FilesSearchQuerySchema, { onExcessProperty: \"error\" })(query).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedQuery) =>\n requestJson(FilesSearchEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/files/search\",\n query: decodedQuery,\n }),\n ),\n withOperationErrors(SearchFilesErrorSpec),\n );\nexport const continueSearch = (\n cursor: string,\n query: {\n readonly per_page?: number;\n } = {},\n): Effect.Effect<FileSearchResponse, SearchFilesError, PutioSdkContext> =>\n decodeAndRun(FilesSearchContinueInputSchema, { cursor, query }, (decodedInput) =>\n requestJson(FilesSearchEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n cursor: decodedInput.cursor,\n },\n },\n method: \"POST\",\n path: \"/v2/files/search/continue\",\n query: decodedInput.query,\n }),\n ).pipe(withOperationErrors(SearchFilesErrorSpec));\nexport const setFileSort = (\n input: FileSetSortInput,\n): Effect.Effect<void, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(FileSetSortInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n file_id: decodedInput.fileId,\n sort_by: decodedInput.sortBy,\n },\n },\n method: \"POST\",\n path: \"/v2/files/set-sort-by\",\n }),\n ),\n Effect.asVoid,\n );\nexport const resetFileSortSettings = (): Effect.Effect<void, PutioSdkError, PutioSdkContext> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/files/remove-sort-by-settings\",\n }).pipe(Effect.asVoid);\nexport const createFolder = (\n input: FileCreateFolderInput,\n): Effect.Effect<FileBroad, CreateFolderError, PutioSdkContext> =>\n decodeAndRun(FileCreateFolderInputSchema, input, (decodedInput) =>\n requestJson(FileEnvelopeSchema, {\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/files/create-folder\",\n }),\n ).pipe(selectJsonField(\"file\"), withOperationErrors(CreateFolderErrorSpec));\nexport const renameFile = (\n input: FileRenameInput,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, RenameFileError, PutioSdkContext> =>\n decodeAndRun(FileRenameInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/files/rename\",\n }),\n ).pipe(withOperationErrors(RenameFileErrorSpec));\nexport const deleteFiles = (\n ids: ReadonlyArray<number>,\n options: {\n readonly ignoreFileOwner?: boolean;\n readonly partialDelete?: boolean;\n readonly skipTrash?: boolean;\n } = {},\n): Effect.Effect<\n Schema.Schema.Type<typeof FileDeleteResultEnvelopeSchema>,\n PutioSdkError,\n PutioSdkContext\n> =>\n decodeAndRun(\n Schema.Struct({ ids: FilesIdsInputSchema, options: FilesDeleteOptionsSchema }),\n { ids, options },\n (decodedInput) =>\n requestJson(FileDeleteResultEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n file_ids: joinCsv(decodedInput.ids),\n },\n },\n method: \"POST\",\n path: \"/v2/files/delete\",\n query: {\n partial_delete: decodedInput.options.partialDelete,\n skip_nonexistents: true,\n skip_owner_check: decodedInput.options.ignoreFileOwner,\n skip_trash: decodedInput.options.skipTrash,\n },\n }),\n );\nexport const deleteFileSelection = (\n selection: FilesBulkSelection,\n options: {\n readonly partialDelete?: boolean;\n readonly skipTrash?: boolean;\n } = {},\n): Effect.Effect<\n Schema.Schema.Type<typeof FileDeleteResultEnvelopeSchema>,\n PutioSdkError,\n PutioSdkContext\n> =>\n decodeAndRun(\n Schema.Struct({\n options: FilesSelectionDeleteOptionsSchema,\n selection: FilesBulkSelectionSchema,\n }),\n { options, selection },\n (decodedInput) =>\n requestJson(FileDeleteResultEnvelopeSchema, {\n body: {\n type: \"form\",\n value: toCursorSelectionForm(decodedInput.selection),\n },\n method: \"POST\",\n path: \"/v2/files/delete\",\n query: {\n partial_delete: decodedInput.options.partialDelete,\n skip_nonexistents: true,\n skip_trash: decodedInput.options.skipTrash,\n },\n }),\n );\nexport const moveFiles = (\n ids: ReadonlyArray<number>,\n parentId: number,\n): Effect.Effect<ReadonlyArray<FilesMoveError>, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(FilesMoveInputSchema, { ids, parentId }, (decodedInput) =>\n requestJson(FilesMoveEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n file_ids: joinCsv(decodedInput.ids),\n parent_id: decodedInput.parentId,\n },\n },\n method: \"POST\",\n path: \"/v2/files/move\",\n }),\n ).pipe(selectJsonField(\"errors\"));\nexport const moveFileSelection = (\n selection: FilesBulkSelection,\n parentId: number,\n): Effect.Effect<ReadonlyArray<FilesMoveError>, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(FilesMoveSelectionInputSchema, { parentId, selection }, (decodedInput) =>\n requestJson(FilesMoveEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm(decodedInput.selection),\n parent_id: decodedInput.parentId,\n },\n },\n method: \"POST\",\n path: \"/v2/files/move\",\n }),\n ).pipe(selectJsonField(\"errors\"));\nexport const getStartFrom = (\n fileId: number,\n): Effect.Effect<number, StartFromError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(FileStartFromEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/start-from`,\n }),\n ).pipe(selectJsonField(\"start_from\"), withOperationErrors(StartFromErrorSpec));\nexport const getDownloadUrl = (\n fileId: number,\n): Effect.Effect<string, DownloadUrlError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(FileDownloadUrlEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/url`,\n }),\n ).pipe(selectJsonField(\"url\"), withOperationErrors(DownloadUrlErrorSpec));\nexport const getApiDownloadUrl = (\n fileId: number,\n options: FileApiDownloadUrlOptions = {},\n): Effect.Effect<string, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileApiDownloadUrlOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) =>\n buildFileApiDownloadUrl(config.baseUrl ?? \"https://api.put.io\", decoded.fileId, {\n ...decoded.options,\n oauthToken,\n }),\n ),\n ),\n );\nexport const getApiContentUrl = (\n fileId: number,\n options: FileDirectAccessOptions = {},\n): Effect.Effect<string, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileDirectAccessOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) =>\n buildFileApiContentUrl(config.baseUrl ?? \"https://api.put.io\", decoded.fileId, {\n ...decoded.options,\n oauthToken,\n }),\n ),\n ),\n );\nexport const getApiMp4DownloadUrl = (\n fileId: number,\n options: FileApiMp4DownloadUrlOptions = {},\n): Effect.Effect<string, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileApiMp4DownloadUrlOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) =>\n buildFileApiMp4DownloadUrl(config.baseUrl ?? \"https://api.put.io\", decoded.fileId, {\n ...decoded.options,\n oauthToken,\n }),\n ),\n ),\n );\nexport const getHlsStreamUrl = (\n fileId: number,\n options: FileHlsStreamUrlOptions = {},\n): Effect.Effect<string, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileHlsStreamUrlOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) =>\n buildFileHlsStreamUrl(config.baseUrl ?? \"https://api.put.io\", decoded.fileId, {\n ...decoded.options,\n oauthToken,\n }),\n ),\n ),\n );\n/**\n * Fetches the HLS master playlist the player would load, so callers can\n * inspect the served variant's CODECS, VIDEO-RANGE, and rendition set without\n * handling the tokenized URL. `playOriginal` selects the original file over\n * the MP4 conversion.\n */\nexport const getHlsMasterPlaylist = (\n fileId: number,\n options: FileHlsMasterPlaylistOptions = {},\n): Effect.Effect<string, GetHlsMasterPlaylistError | PutioValidationError, PutioSdkContext> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileHlsMasterPlaylistOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n requestText({\n headers: { accept: \"application/vnd.apple.mpegurl, application/x-mpegURL, */*\" },\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decoded.fileId)}/hls/media.m3u8`,\n query: {\n max_subtitle_count: decoded.options.maxSubtitleCount,\n original:\n typeof decoded.options.playOriginal === \"boolean\"\n ? decoded.options.playOriginal\n ? 1\n : 0\n : undefined,\n subtitle_languages: joinCsv(decoded.options.subtitleLanguages),\n },\n }),\n ).pipe(withOperationErrors(GetHlsMasterPlaylistErrorSpec));\nexport const getXspfPlaylistUrl = (\n fileId: number,\n options: FileXspfPlaylistUrlOptions = {},\n): Effect.Effect<string, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({\n fileId: PositiveFileIdSchema,\n options: FileXspfPlaylistUrlOptionsSchema,\n }),\n { fileId, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) =>\n buildFileXspfPlaylistUrl(config.baseUrl ?? \"https://api.put.io\", decoded.fileId, {\n oauthToken,\n }),\n ),\n ),\n );\nexport const listFileSubtitles = (\n fileId: number,\n options: {\n readonly languages?: ReadonlyArray<string>;\n } = {},\n): Effect.Effect<\n {\n readonly default: string | null;\n readonly subtitles: ReadonlyArray<FileSubtitle>;\n },\n FileSubtitlesError,\n PutioSdkContext\n> =>\n decodeAndRun(FileSubtitlesInputSchema, { fileId, options }, (decodedInput) =>\n requestJson(FileSubtitlesEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedInput.fileId)}/subtitles`,\n query: decodedInput.options.languages\n ? {\n languages: joinCsv(decodedInput.options.languages),\n }\n : undefined,\n }),\n ).pipe(withOperationErrors(FileSubtitlesErrorSpec));\nexport const setStartFrom = (\n input: FileStartFromSetInput,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, StartFromError, PutioSdkContext> =>\n decodeAndRun(FileStartFromSetInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n time: decodedInput.time,\n },\n },\n method: \"POST\",\n path: `/v2/files/${encodePathSegment(decodedInput.file_id)}/start-from`,\n }),\n ).pipe(withOperationErrors(StartFromErrorSpec));\nexport const resetStartFrom = (\n fileId: number,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, StartFromError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/start-from/delete`,\n }),\n ).pipe(withOperationErrors(StartFromErrorSpec));\nexport const getMp4Status = (\n fileId: number,\n): Effect.Effect<FileConversionStatus, FileMp4Error, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(FileConversionStatusEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/mp4`,\n }),\n ).pipe(selectJsonField(\"mp4\"), withOperationErrors(FileMp4ErrorSpec));\nexport const convertFileToMp4 = (\n fileId: number,\n): Effect.Effect<FileConversionStatus, FileMp4Error, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(FileConversionStatusEnvelopeSchema, {\n method: \"POST\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/mp4`,\n }),\n ).pipe(selectJsonField(\"mp4\"), withOperationErrors(FileMp4ErrorSpec));\nexport const deleteFileMp4 = (\n fileId: number,\n): Effect.Effect<void, FileMp4MutationError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestVoid({\n method: \"DELETE\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/mp4`,\n }),\n ).pipe(withOperationErrors(FileMp4MutationErrorSpec));\nexport const putMp4ToMyFiles = (\n fileId: number,\n): Effect.Effect<void, FileMp4MutationError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestVoid({\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/put-mp4-to-my-folders`,\n }),\n ).pipe(withOperationErrors(FileMp4MutationErrorSpec));\nexport const convertFilesToMp4 = (\n ids: ReadonlyArray<number>,\n): Effect.Effect<number, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(FilesIdsInputSchema, ids, (decodedIds) =>\n requestJson(FilesBulkConvertEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n file_ids: joinCsv(decodedIds),\n },\n },\n method: \"POST\",\n path: \"/v2/files/convert_mp4\",\n }),\n ).pipe(selectJsonField(\"count\"));\nexport const convertFileSelectionToMp4 = (\n selection: FilesBulkSelection,\n): Effect.Effect<number, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(FilesBulkSelectionSchema, selection, (decodedSelection) =>\n requestJson(FilesBulkConvertEnvelopeSchema, {\n body: {\n type: \"form\",\n value: toCursorSelectionForm(decodedSelection),\n },\n method: \"POST\",\n path: \"/v2/files/convert_mp4\",\n }),\n ).pipe(selectJsonField(\"count\"));\nexport const listActiveMp4Conversions = (): Effect.Effect<\n ReadonlyArray<FileActiveConversion>,\n FileActiveConversionsError,\n PutioSdkContext\n> =>\n requestJson(FileActiveConversionsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/mp4/queue\",\n }).pipe(selectJsonField(\"mp4s\"), withOperationErrors(FileActiveConversionsErrorSpec));\nexport const setFilesWatchStatus = (\n selection: FilesBulkSelection & {\n readonly watched: boolean;\n },\n): Effect.Effect<void, FileWatchStatusError, PutioSdkContext> =>\n decodeAndRun(FilesWatchStatusInputSchema, selection, (decodedSelection) =>\n requestVoid({\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm(decodedSelection),\n watched: decodedSelection.watched,\n },\n },\n method: \"POST\",\n path: \"/v2/files/watch-status\",\n }),\n ).pipe(withOperationErrors(FileWatchStatusErrorSpec));\nexport const extractFiles = (\n selection: FilesBulkSelection & {\n readonly password?: string;\n },\n): Effect.Effect<ReadonlyArray<FileExtraction>, FileExtractionsError, PutioSdkContext> =>\n decodeAndRun(FilesExtractInputSchema, selection, (decodedSelection) =>\n requestJson(FileExtractionsEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm(decodedSelection, \"user_file_ids\"),\n password: decodedSelection.password,\n },\n },\n method: \"POST\",\n path: \"/v2/files/extract\",\n }),\n ).pipe(selectJsonField(\"extractions\"), withOperationErrors(FileExtractionsErrorSpec));\nexport const listFileExtractions = (): Effect.Effect<\n ReadonlyArray<FileExtraction>,\n FileExtractionsError,\n PutioSdkContext\n> =>\n requestJson(FileExtractionsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/files/extract\",\n }).pipe(selectJsonField(\"extractions\"), withOperationErrors(FileExtractionsErrorSpec));\nexport const deleteFileExtraction = (\n extractionId: number,\n): Effect.Effect<void, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(PositiveIntegerSchema, extractionId, (decodedExtractionId) =>\n requestVoid({\n method: \"DELETE\",\n path: `/v2/files/extract/${encodePathSegment(decodedExtractionId)}`,\n }),\n );\nexport const findNextFile = (\n fileId: number,\n fileType: FileType,\n): Effect.Effect<Schema.Schema.Type<typeof FilesNextFileSchema>, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(FileNextInputSchema, { fileId, fileType }, (decodedInput) =>\n requestJson(FilesNextFileEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedInput.fileId)}/next-file`,\n query: {\n file_type: decodedInput.fileType,\n },\n }),\n ).pipe(selectJsonField(\"next_file\"));\nexport const findNextVideo = (\n fileId: number,\n): Effect.Effect<Schema.Schema.Type<typeof FilesNextFileSchema>, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(PositiveFileIdSchema, fileId, (decodedFileId) =>\n requestJson(FilesNextVideoEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/next-video`,\n }),\n ).pipe(selectJsonField(\"next_video\"));\nexport const createFileUploadRequest = (\n input: FileUploadInput,\n options: {\n readonly oauthToken?: string;\n } = {},\n): Effect.Effect<FileUploadRequestDescriptor, PutioSdkError, PutioSdkConfig> =>\n decodeAndRun(\n Schema.Struct({ input: FileUploadInputSchema, options: FileUploadOptionsSchema }),\n { input, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.map(({ config, oauthToken }) => ({\n body: createFileUploadFormData(decoded.input),\n method: \"POST\" as const,\n url: buildPutioUrl(config.uploadBaseUrl ?? \"https://upload.put.io\", \"/v2/files/upload\", {\n oauth_token: oauthToken,\n }),\n })),\n ),\n );\nexport const uploadFile = (\n input: FileUploadInput,\n options: {\n readonly oauthToken?: string;\n } = {},\n): Effect.Effect<FileUploadResult, FileUploadError | PutioValidationError, PutioSdkContext> =>\n decodeAndRun(\n Schema.Struct({ input: FileUploadInputSchema, options: FileUploadOptionsSchema }),\n { input, options },\n (decoded) =>\n resolveRouteContext(decoded.options.oauthToken).pipe(\n Effect.flatMap(({ config, oauthToken }) =>\n requestJson(FileUploadEnvelopeSchema, {\n auth: {\n type: \"none\",\n },\n baseUrl: config.uploadBaseUrl ?? \"https://upload.put.io\",\n body: {\n type: \"form-data\",\n value: createFileUploadFormData(decoded.input),\n },\n method: \"POST\",\n path: \"/v2/files/upload\",\n query: {\n oauth_token: oauthToken,\n },\n }),\n ),\n ),\n ).pipe(Effect.map(toUploadResult), withOperationErrors(FileUploadErrorSpec));\n","import { Effect, Schema } from \"effect\";\n\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { requestJson, selectJsonFields, type PutioSdkContext } from \"../core/http.js\";\n\nexport const FriendInviteJoinedUserStatusSchema = Schema.Literals([\n \"CONVERTED\",\n \"IN_TRIAL\",\n \"TRIAL_ENDED\",\n \"TRIAL_NOT_STARTED\",\n \"UNKNOWN\",\n]);\n\nexport const FriendInviteJoinedUserSchema = Schema.Struct({\n avatar_url: Schema.String,\n created_at: Schema.String,\n earned_amount: Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n name: Schema.String,\n status: FriendInviteJoinedUserStatusSchema,\n});\n\nexport const FriendInviteSchema = Schema.Struct({\n code: Schema.String,\n created_at: Schema.String,\n user: Schema.NullOr(FriendInviteJoinedUserSchema),\n});\n\nconst FriendInvitesListEnvelopeSchema = Schema.Struct({\n invites: Schema.Array(FriendInviteSchema),\n remaining_limit: Schema.Int,\n status: Schema.Literal(\"OK\"),\n});\n\nconst FriendInviteCreateEnvelopeSchema = Schema.Struct({\n code: Schema.String,\n status: Schema.optional(Schema.Literal(\"OK\")),\n});\n\nexport type FriendInviteJoinedUserStatus = Schema.Schema.Type<\n typeof FriendInviteJoinedUserStatusSchema\n>;\nexport type FriendInviteJoinedUser = Schema.Schema.Type<typeof FriendInviteJoinedUserSchema>;\nexport type FriendInvite = Schema.Schema.Type<typeof FriendInviteSchema>;\n\nexport const ListFriendInvitesErrorSpec = definePutioOperationErrorSpec({\n domain: \"friendInvites\",\n operation: \"list\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\n\nexport const CreateFriendInviteErrorSpec = definePutioOperationErrorSpec({\n domain: \"friendInvites\",\n operation: \"create\",\n knownErrors: [\n { errorType: \"FRIEND_INVITATION_NOT_ALLOWED\", statusCode: 403 as const },\n { errorType: \"FRIEND_INVITATION_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 403 as const },\n ],\n});\n\nexport type ListFriendInvitesError = PutioOperationFailure<typeof ListFriendInvitesErrorSpec>;\nexport type CreateFriendInviteError = PutioOperationFailure<typeof CreateFriendInviteErrorSpec>;\n\nexport const listFriendInvites = (): Effect.Effect<\n {\n readonly invites: ReadonlyArray<FriendInvite>;\n readonly remaining_limit: number;\n },\n ListFriendInvitesError,\n PutioSdkContext\n> =>\n requestJson(FriendInvitesListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/account/friend_invites\",\n }).pipe(\n selectJsonFields(\"invites\", \"remaining_limit\"),\n withOperationErrors(ListFriendInvitesErrorSpec),\n );\n\nexport const createFriendInvite = (): Effect.Effect<\n {\n readonly code: string;\n },\n CreateFriendInviteError,\n PutioSdkContext\n> =>\n requestJson(FriendInviteCreateEnvelopeSchema, {\n method: \"POST\",\n path: \"/v2/account/create_friend_invitation\",\n }).pipe(selectJsonFields(\"code\"), withOperationErrors(CreateFriendInviteErrorSpec));\n","import { Effect, Schema } from \"effect\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { NonEmptyStringSchema } from \"../core/validation.js\";\nimport { FileBroadSchema, type FileBroad } from \"./files.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport const FriendBaseSchema = Schema.Struct({\n avatar_url: Schema.String,\n id: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n name: Schema.String,\n});\nexport const FriendSchema = FriendBaseSchema.pipe(\n Schema.fieldsAssign({\n has_received_files: Schema.Boolean,\n has_shared_files: Schema.Boolean,\n }),\n);\nexport const UserSearchResultSchema = FriendBaseSchema.pipe(\n Schema.fieldsAssign({\n invited: Schema.Boolean,\n }),\n);\nconst FriendsListEnvelopeSchema = Schema.Struct({\n friends: Schema.Array(FriendSchema),\n status: Schema.Literal(\"OK\"),\n total: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n});\nconst FriendRequestsEnvelopeSchema = Schema.Struct({\n friends: Schema.Array(FriendBaseSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst FriendRequestsCountEnvelopeSchema = Schema.Struct({\n count: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n});\nconst FriendSearchEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n users: Schema.Array(UserSearchResultSchema),\n});\nconst FriendSharedFolderEnvelopeSchema = Schema.Struct({\n file: Schema.NullOr(FileBroadSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport type FriendBase = Schema.Schema.Type<typeof FriendBaseSchema>;\nexport type Friend = Schema.Schema.Type<typeof FriendSchema>;\nexport type UserSearchResult = Schema.Schema.Type<typeof UserSearchResultSchema>;\nexport const ListFriendsErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"list\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const SearchFriendsErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"search\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const ListWaitingRequestsErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"listWaitingRequests\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const CountWaitingRequestsErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"countWaitingRequests\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const ListSentRequestsErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"listSentRequests\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const SendFriendRequestErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"sendRequest\",\n knownErrors: [\n { errorType: \"USER_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const RemoveFriendErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"remove\",\n knownErrors: [\n { errorType: \"USER_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ApproveFriendRequestErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"approve\",\n knownErrors: [\n { errorType: \"USER_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const DenyFriendRequestErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"deny\",\n knownErrors: [\n { errorType: \"USER_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const FriendSharedFolderErrorSpec = definePutioOperationErrorSpec({\n domain: \"friends\",\n operation: \"sharedFolder\",\n knownErrors: [\n { errorType: \"NotFound\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport type ListFriendsError = PutioOperationFailure<typeof ListFriendsErrorSpec>;\nexport type SearchFriendsError = PutioOperationFailure<typeof SearchFriendsErrorSpec>;\nexport type ListWaitingRequestsError = PutioOperationFailure<typeof ListWaitingRequestsErrorSpec>;\nexport type CountWaitingRequestsError = PutioOperationFailure<typeof CountWaitingRequestsErrorSpec>;\nexport type ListSentRequestsError = PutioOperationFailure<typeof ListSentRequestsErrorSpec>;\nexport type SendFriendRequestError = PutioOperationFailure<typeof SendFriendRequestErrorSpec>;\nexport type RemoveFriendError = PutioOperationFailure<typeof RemoveFriendErrorSpec>;\nexport type ApproveFriendRequestError = PutioOperationFailure<typeof ApproveFriendRequestErrorSpec>;\nexport type DenyFriendRequestError = PutioOperationFailure<typeof DenyFriendRequestErrorSpec>;\nexport type FriendSharedFolderError = PutioOperationFailure<typeof FriendSharedFolderErrorSpec>;\nconst decodeUsername = (username: string) =>\n Schema.decodeUnknownEffect(NonEmptyStringSchema)(username).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n );\nexport const listFriends = (): Effect.Effect<\n {\n readonly friends: ReadonlyArray<Friend>;\n readonly total: number;\n },\n ListFriendsError,\n PutioSdkContext\n> =>\n requestJson(FriendsListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/friends/list\",\n }).pipe(selectJsonFields(\"friends\", \"total\"), withOperationErrors(ListFriendsErrorSpec));\nexport const searchFriends = (\n username: string,\n): Effect.Effect<ReadonlyArray<UserSearchResult>, SearchFriendsError, PutioSdkContext> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(FriendSearchEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/friends/user-search/${encodePathSegment(decodedUsername)}`,\n }),\n ),\n selectJsonField(\"users\"),\n withOperationErrors(SearchFriendsErrorSpec),\n );\nexport const listWaitingRequests = (): Effect.Effect<\n ReadonlyArray<FriendBase>,\n ListWaitingRequestsError,\n PutioSdkContext\n> =>\n requestJson(FriendRequestsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/friends/waiting-requests\",\n }).pipe(selectJsonField(\"friends\"), withOperationErrors(ListWaitingRequestsErrorSpec));\nexport const countWaitingRequests = (): Effect.Effect<\n number,\n CountWaitingRequestsError,\n PutioSdkContext\n> =>\n requestJson(FriendRequestsCountEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/friends/waiting-requests-count\",\n }).pipe(selectJsonField(\"count\"), withOperationErrors(CountWaitingRequestsErrorSpec));\nexport const listSentRequests = (): Effect.Effect<\n ReadonlyArray<FriendBase>,\n ListSentRequestsError,\n PutioSdkContext\n> =>\n requestJson(FriendRequestsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/friends/sent-requests\",\n }).pipe(selectJsonField(\"friends\"), withOperationErrors(ListSentRequestsErrorSpec));\nexport const sendFriendRequest = (\n username: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n SendFriendRequestError,\n PutioSdkContext\n> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/friends/${encodePathSegment(decodedUsername)}/request`,\n }),\n ),\n withOperationErrors(SendFriendRequestErrorSpec),\n );\nexport const removeFriend = (\n username: string,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, RemoveFriendError, PutioSdkContext> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/friends/${encodePathSegment(decodedUsername)}/unfriend`,\n }),\n ),\n withOperationErrors(RemoveFriendErrorSpec),\n );\nexport const approveFriendRequest = (\n username: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ApproveFriendRequestError,\n PutioSdkContext\n> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/friends/${encodePathSegment(decodedUsername)}/approve`,\n }),\n ),\n withOperationErrors(ApproveFriendRequestErrorSpec),\n );\nexport const denyFriendRequest = (\n username: string,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n DenyFriendRequestError,\n PutioSdkContext\n> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/friends/${encodePathSegment(decodedUsername)}/deny`,\n }),\n ),\n withOperationErrors(DenyFriendRequestErrorSpec),\n );\nexport const getFriendSharedFolder = (\n username: string,\n): Effect.Effect<FileBroad | null, FriendSharedFolderError, PutioSdkContext> =>\n decodeUsername(username).pipe(\n Effect.flatMap((decodedUsername) =>\n requestJson(FriendSharedFolderEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/friends/${encodePathSegment(decodedUsername)}/files`,\n }),\n ),\n selectJsonField(\"file\"),\n withOperationErrors(FriendSharedFolderErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\nimport { joinCsv } from \"../core/forms.js\";\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n requestJson,\n selectJsonField,\n type PutioSdkContext,\n} from \"../core/http.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema, decodeAndRun } from \"../core/validation.js\";\nexport const PaymentPlanTypeSchema = Schema.Literals([\"onetime\", \"subscription\"]);\nexport const PaymentOptionPlanTypeSchema = Schema.Literals([\"onetime\", \"subscription\", \"trial\"]);\nexport const PaymentProviderNameSchema = Schema.Literals([\n \"Paddle\",\n \"PaddleBilling\",\n \"Fastspring\",\n \"OpenNode\",\n]);\nexport const PaymentTypeSchema = Schema.Literals([\"credit-card\", \"cryptocurrency\"]);\nexport const UserSubscriptionStatusSchema = Schema.Literals([\n \"ACTIVE\",\n \"CANCELED\",\n \"PAST_DUE\",\n \"TRIALING\",\n]);\nexport const PaymentSubscriptionInfoSchema = Schema.Struct({\n id: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n need_payment_information_update: Schema.optional(Schema.Boolean),\n next_billing_date: Schema.optional(Schema.NullOr(Schema.String)),\n next_retry_date: Schema.optional(Schema.NullOr(Schema.String)),\n status: Schema.optional(Schema.NullOr(UserSubscriptionStatusSchema)),\n update_url: Schema.optional(Schema.NullOr(Schema.String)),\n});\nexport const PaymentInfoPlanSchema = Schema.Struct({\n code: Schema.optional(Schema.String),\n group_code: Schema.optional(Schema.String),\n period_days: Schema.optional(Schema.NullOr(Schema.Int.check(Schema.isGreaterThan(0)))),\n storage_space: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n subscription: Schema.optional(PaymentSubscriptionInfoSchema),\n type: Schema.optional(Schema.NullOr(PaymentPlanTypeSchema)),\n});\nconst PaymentLastPaymentSchema = Schema.Struct({\n method: Schema.optional(Schema.String),\n provider: Schema.optional(Schema.String),\n});\nexport const PaymentInfoSchema = Schema.Struct({\n expiration_date: Schema.optional(Schema.String),\n extend_30: Schema.NullOr(Schema.String),\n extend_365: Schema.NullOr(Schema.String),\n has_pending_payment: Schema.Boolean,\n last_payment: Schema.optional(PaymentLastPaymentSchema),\n pending_bitpay: Schema.NullOr(Schema.String),\n plan: Schema.optional(PaymentInfoPlanSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst PaymentPlanCommonPropertiesSchema = Schema.Struct({\n family_invites: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n seed_ratio: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n seed_time: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n storage_space: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n torrent_slot: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n});\nconst PaymentSubPlanSchema = Schema.Struct({\n code: Schema.String,\n daily_price: Schema.NullOr(Schema.String),\n fastspring_url: Schema.NullOr(Schema.String),\n is_trial_subscription: Schema.Boolean,\n period_days: Schema.NullOr(Schema.Int.check(Schema.isGreaterThan(0))),\n price: Schema.NullOr(Schema.String),\n subscription_trial_period: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n type: PaymentPlanTypeSchema,\n});\nexport const PaymentPlanGroupSchema = Schema.Struct({\n common_properties: PaymentPlanCommonPropertiesSchema,\n plan_group_code: Schema.String,\n sub_plans: Schema.Array(PaymentSubPlanSchema),\n});\nconst PaymentPlansEnvelopeSchema = Schema.Struct({\n plans: Schema.Array(PaymentPlanGroupSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport const PaymentOptionSchema = Schema.Struct({\n discount_percent: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n name: PaymentTypeSchema,\n suitable_plan_types: Schema.Array(PaymentOptionPlanTypeSchema),\n});\nconst PaymentOptionsEnvelopeSchema = Schema.Struct({\n options: Schema.Array(PaymentOptionSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst PaymentHistoryPlanSchema = Schema.Struct({\n name: Schema.String,\n period_days: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n price: Schema.NullOr(Schema.String),\n type: Schema.NullOr(PaymentPlanTypeSchema),\n});\nconst PaymentRefundSchema = Schema.Struct({\n amount_actual: Schema.String,\n});\nexport const PaymentHistoryItemSchema = Schema.Struct({\n amount: Schema.String,\n amount_actual: Schema.optional(Schema.String),\n amount_currency: Schema.String,\n actual_currency_code: Schema.optional(Schema.String),\n coupon_code: Schema.NullOr(Schema.String),\n date: Schema.String,\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n invoice: Schema.NullOr(Schema.String),\n plan: PaymentHistoryPlanSchema,\n refunded: Schema.Boolean,\n refunds: Schema.Array(PaymentRefundSchema),\n return_status: Schema.String,\n type: Schema.String,\n});\nconst PaymentHistoryEnvelopeSchema = Schema.Struct({\n payments: Schema.Array(PaymentHistoryItemSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport const PaymentInviteSchema = Schema.Struct({\n is_converted: Schema.Boolean,\n url: Schema.String,\n used_by: Schema.NullOr(Schema.String),\n});\nconst PaymentInvitesEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n vouchers: Schema.Array(PaymentInviteSchema),\n});\nconst PaymentChangePlanCurrentPlanSchema = Schema.Struct({\n plan_type: Schema.NullOr(PaymentPlanTypeSchema),\n subscription_payment_provider: Schema.NullOr(PaymentProviderNameSchema),\n});\nconst PaymentChangePlanTargetPlanSchema = Schema.Struct({\n hd_avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n is_trial_subscription: Schema.Boolean,\n new_code: Schema.String,\n period_days: Schema.NullOr(Schema.Int.check(Schema.isGreaterThan(0))),\n plan_code: Schema.String,\n plan_name: Schema.String,\n plan_type: PaymentPlanTypeSchema,\n price: Schema.String,\n simulated_expiration: Schema.NullOr(Schema.String),\n subscription_trial_period: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst PaymentChangePlanProviderPaddlePreviewSchema = Schema.Struct({\n charge_amount: Schema.NullOr(Schema.String),\n currency: Schema.String,\n next_billing_date: Schema.NullOr(Schema.String),\n});\nconst PaymentChangePlanProviderPaddleBillingPreviewSchema = Schema.Struct({\n next_billing_date: Schema.NullOr(Schema.String),\n});\nconst PaymentChangePlanProviderFastspringPreviewSchema = Schema.Struct({\n charge_amount: Schema.NullOr(Schema.String),\n currency: Schema.String,\n prorated_amount: Schema.NullOr(Schema.String),\n refund_amount: Schema.NullOr(Schema.String),\n});\nconst PaymentChangePlanDiscountSchema = Schema.Struct({\n discount: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n type: Schema.Literals([\"percentage\", \"amount\"]),\n});\nexport const PaymentChangePlanPreviewSchema = Schema.Struct({\n Fastspring: PaymentChangePlanProviderFastspringPreviewSchema,\n Paddle: PaymentChangePlanProviderPaddlePreviewSchema,\n PaddleBilling: PaymentChangePlanProviderPaddleBillingPreviewSchema,\n amount: Schema.NullOr(Schema.String),\n charge_amount: Schema.Boolean,\n credit: Schema.NullOr(Schema.String),\n currency: Schema.String,\n current_plan: PaymentChangePlanCurrentPlanSchema,\n discount: Schema.optional(PaymentChangePlanDiscountSchema),\n is_product_change: Schema.NullOr(Schema.Boolean),\n new_remaining_days: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n prorated: Schema.NullOr(Schema.String),\n status: Schema.Literal(\"OK\"),\n target_plan: PaymentChangePlanTargetPlanSchema,\n});\nconst PaddlePaymentProviderSchema = Schema.Struct({\n plan_id: Schema.Int.check(Schema.isGreaterThan(0)),\n provider: Schema.Literal(\"Paddle\"),\n type: Schema.Literal(\"credit-card\"),\n vendor_id: Schema.Int.check(Schema.isGreaterThan(0)),\n});\nconst PaddleBillingPaymentProviderSchema = Schema.Struct({\n price_id: Schema.NullOr(Schema.String),\n provider: Schema.Literal(\"PaddleBilling\"),\n type: Schema.Literal(\"credit-card\"),\n});\nconst FastspringPaymentProviderSchema = Schema.Struct({\n provider: Schema.Literal(\"Fastspring\"),\n type: Schema.Literal(\"credit-card\"),\n url: Schema.String,\n});\nconst OpenNodePaymentProviderSchema = Schema.Struct({\n discount_percent: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n provider: Schema.Literal(\"OpenNode\"),\n type: Schema.Literal(\"cryptocurrency\"),\n});\nexport const PaymentProviderSchema = Schema.Union([\n FastspringPaymentProviderSchema,\n OpenNodePaymentProviderSchema,\n PaddleBillingPaymentProviderSchema,\n PaddlePaymentProviderSchema,\n]);\nconst PaymentChangePlanCheckoutSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n urls: Schema.Array(PaymentProviderSchema),\n});\nconst PaymentChangePlanConfirmationSchema = Schema.Struct({\n confirmation: Schema.Literal(true),\n status: Schema.Literal(\"OK\"),\n});\nconst PaymentSubscriptionUpdateSchema = Schema.Struct({\n amount: Schema.String,\n billing_date: Schema.String,\n currency: Schema.String,\n});\nconst PaymentChangePlanSubscriptionUpdatedSchema = Schema.Struct({\n charged_amount: Schema.String,\n charged_currency: Schema.String,\n next_payment: PaymentSubscriptionUpdateSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst PaymentChangePlanSuccessSchema = OkResponseSchema;\nexport const PaymentChangePlanSubmitSchema = Schema.Union([\n PaymentChangePlanCheckoutSchema,\n PaymentChangePlanConfirmationSchema,\n PaymentChangePlanSubscriptionUpdatedSchema,\n PaymentChangePlanSuccessSchema,\n]);\nconst PaymentFastspringConfirmEnvelopeSchema = Schema.Struct({\n confirmed: Schema.Boolean,\n status: Schema.Literal(\"OK\"),\n});\nconst PaymentPaddleBillingInvoiceEnvelopeSchema = Schema.Struct({\n status: Schema.optional(Schema.Literal(\"OK\")),\n url: Schema.String,\n});\nconst PaymentPaddleBillingUpdatePaymentMethodEnvelopeSchema = Schema.Struct({\n status: Schema.optional(Schema.Literal(\"OK\")),\n transaction_id: Schema.String,\n});\nconst PaymentVoucherPlanSchema = Schema.Struct({\n expiration_date: Schema.NullOr(Schema.String),\n type: Schema.NullOr(PaymentPlanTypeSchema),\n});\nconst PaymentVoucherTargetPlanSchema = Schema.Struct({\n code: Schema.String,\n group_code: Schema.String,\n hd_avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n name: Schema.String,\n simulated_expiration: Schema.optional(Schema.NullOr(Schema.String)),\n type: PaymentPlanTypeSchema,\n});\nexport const PaymentVoucherInfoSchema = Schema.Struct({\n current_plan: PaymentVoucherPlanSchema,\n new_remaining_days: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n target_plan: PaymentVoucherTargetPlanSchema,\n});\nconst PaymentOpenNodeChargeEnvelopeSchema = Schema.Struct({\n opennode: Schema.Struct({\n checkout_url: Schema.String,\n }),\n status: Schema.Literal(\"OK\"),\n});\nexport type PaymentInfo = Schema.Schema.Type<typeof PaymentInfoSchema>;\nexport type PaymentPlanGroup = Schema.Schema.Type<typeof PaymentPlanGroupSchema>;\nexport type PaymentOption = Schema.Schema.Type<typeof PaymentOptionSchema>;\nexport type PaymentHistoryItem = Schema.Schema.Type<typeof PaymentHistoryItemSchema>;\nexport type PaymentInvite = Schema.Schema.Type<typeof PaymentInviteSchema>;\nexport type PaymentChangePlanPreview = Schema.Schema.Type<typeof PaymentChangePlanPreviewSchema>;\nexport type PaymentProvider = Schema.Schema.Type<typeof PaymentProviderSchema>;\nexport type PaymentChangePlanSubmitResponse = Schema.Schema.Type<\n typeof PaymentChangePlanSubmitSchema\n>;\nexport type PaymentVoucherInfo = Schema.Schema.Type<typeof PaymentVoucherInfoSchema>;\nconst PaymentHistoryQuerySchema = Schema.Struct({\n unreported_only: Schema.optional(Schema.Boolean),\n});\nconst PaymentChangePlanPreviewInputSchema = Schema.Struct({\n coupon_code: Schema.optional(NonEmptyStringSchema),\n payment_type: Schema.optional(PaymentTypeSchema),\n plan_path: NonEmptyStringSchema,\n});\nconst PaymentChangePlanSubmitInputSchema = Schema.Struct({\n confirmation_code: Schema.optional(NonEmptyStringSchema),\n coupon_code: Schema.optional(NonEmptyStringSchema),\n payment_type: Schema.optional(PaymentTypeSchema),\n plan_path: NonEmptyStringSchema,\n});\nconst PaymentPaddleWaitingPaymentInputSchema = Schema.Struct({\n checkout_id: NonEmptyStringSchema,\n product_id: Schema.Union([NonEmptyStringSchema, PositiveIntegerSchema]),\n});\nconst PaymentIdsSchema = Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1));\nexport type PaymentHistoryQuery = Schema.Schema.Type<typeof PaymentHistoryQuerySchema>;\nexport type PaymentChangePlanPreviewInput = Schema.Schema.Type<\n typeof PaymentChangePlanPreviewInputSchema\n>;\nexport type PaymentChangePlanSubmitInput = Schema.Schema.Type<\n typeof PaymentChangePlanSubmitInputSchema\n>;\nexport type PaymentPaddleWaitingPaymentInput = Schema.Schema.Type<\n typeof PaymentPaddleWaitingPaymentInputSchema\n>;\nconst RestrictedPaymentError = { errorType: \"invalid_scope\", statusCode: 401 as const };\nconst CommonPaymentActionErrors = [\n { errorType: \"PAYMENT_SUB_ACCOUNT_NOT_ALLOWED\", statusCode: 403 as const },\n RestrictedPaymentError,\n] as const;\nexport const GetPaymentInfoErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"getInfo\",\n knownErrors: [RestrictedPaymentError],\n});\nexport const ListPaymentPlansErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"listPlans\",\n knownErrors: [RestrictedPaymentError],\n});\nexport const ListPaymentOptionsErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"listOptions\",\n knownErrors: [{ statusCode: 400 as const }],\n});\nexport const ListPaymentHistoryErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"listHistory\",\n knownErrors: [RestrictedPaymentError],\n});\nexport const ListPaymentInvitesErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"listInvites\",\n knownErrors: [RestrictedPaymentError],\n});\nexport const PreviewPaymentChangePlanErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"previewChangePlan\",\n knownErrors: [\n { errorType: \"PAYMENT_PLAN_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_INSUFFICIENT_DISK_SPACE\", statusCode: 400 as const },\n { errorType: \"PAYMENT_UPDATE_INFORMATION\", statusCode: 400 as const },\n { errorType: \"PAYMENT_FAMILY_ERROR\", statusCode: 400 as const },\n { errorType: \"PAYMENT_PLAN_CHANGE_NOT_ALLOWED\", statusCode: 400 as const },\n { errorType: \"PAYMENT_COUPON_CODE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_COUPON_CODE_NO_LONGER_AVAILABLE\", statusCode: 410 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n { statusCode: 410 as const },\n ],\n});\nexport const SubmitPaymentChangePlanErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"submitChangePlan\",\n knownErrors: [\n { errorType: \"PADDLE_ERROR\", statusCode: 400 as const },\n { errorType: \"PADDLE_BILLING_INVALID_COUPON\", statusCode: 400 as const },\n { errorType: \"PADDLE_BILLING_SUBSCRIPTION_CANNOT_CHANGE_PLAN\", statusCode: 400 as const },\n { errorType: \"CONFIRMATION_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"INVALID_CONFIRMATION\", statusCode: 400 as const },\n { errorType: \"PAYMENT_COUPON_CODE_NO_LONGER_AVAILABLE\", statusCode: 410 as const },\n { errorType: \"PAYMENT_COUPON_CODE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_FAMILY_ERROR\", statusCode: 400 as const },\n { errorType: \"PAYMENT_FASTSPRING_INACTIVE_SUBSCRIPTION\", statusCode: 400 as const },\n { errorType: \"PAYMENT_FASTSPRING_PRORATION_NOT_SUPPORTED\", statusCode: 400 as const },\n { errorType: \"PAYMENT_INSUFFICIENT_DISK_SPACE\", statusCode: 400 as const },\n { errorType: \"PAYMENT_NOT_ENOUGH_DAYS\", statusCode: 400 as const },\n { errorType: \"PAYMENT_PLAN_CHANGE_NOT_ALLOWED\", statusCode: 400 as const },\n { errorType: \"PAYMENT_PLAN_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_PROVIDER_ERROR\", statusCode: 400 as const },\n { errorType: \"PAYMENT_TRIAL_ERROR\", statusCode: 403 as const },\n { errorType: \"PAYMENT_UNKNOWN_PLAN\", statusCode: 400 as const },\n { errorType: \"PAYMENT_UNKNOWN_PROVIDER\", statusCode: 400 as const },\n { errorType: \"PAYMENT_UPDATE_INFORMATION\", statusCode: 400 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 400 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n { statusCode: 410 as const },\n ],\n});\nexport const ConfirmFastspringOrderErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"confirmFastspringOrder\",\n knownErrors: [RestrictedPaymentError],\n});\nexport const StopSubscriptionErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"stopSubscription\",\n knownErrors: [\n { errorType: \"PAYMENT_SUBSCRIPTION_NOT_FOUND\", statusCode: 404 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 404 as const },\n ],\n});\nexport const GetPaymentVoucherInfoErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"getVoucherInfo\",\n knownErrors: [\n { errorType: \"PAYMENT_COUPON_CODE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_COUPON_CODE_NO_LONGER_AVAILABLE\", statusCode: 410 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 404 as const },\n { statusCode: 410 as const },\n ],\n});\nexport const RedeemPaymentVoucherErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"redeemVoucher\",\n knownErrors: [\n { errorType: \"PAYMENT_COUPON_CODE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PAYMENT_COUPON_CODE_ALREADY_USED\", statusCode: 404 as const },\n { errorType: \"PAYMENT_VOUCHER_CODE_NOT_REDEEMED\", statusCode: 400 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ReportPaymentsErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"reportPayments\",\n knownErrors: [\n { errorType: \"PAYMENT_BAD_REQUEST\", statusCode: 400 as const },\n RestrictedPaymentError,\n { statusCode: 400 as const },\n ],\n});\nexport const CreatePaddleWaitingPaymentErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"createPaddleWaitingPayment\",\n knownErrors: [\n { errorType: \"PAYMENT_PADDLE_WAITING\", statusCode: 404 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 404 as const },\n ],\n});\nexport const GetPaddleBillingInvoiceUrlErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"getPaddleBillingInvoiceUrl\",\n knownErrors: [\n { errorType: \"PADDLE_BILLING_PAYMENT_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PADDLE_BILLING_INVOICE_NOT_AVAILABLE\", statusCode: 404 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 404 as const },\n ],\n});\nexport const CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec =\n definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"createPaddleBillingUpdatePaymentMethodTransaction\",\n knownErrors: [\n { errorType: \"PADDLE_BILLING_SUBSCRIPTION_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"PADDLE_BILLING_SUBSCRIPTION_CANCELED\", statusCode: 404 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 404 as const },\n ],\n });\nexport const CreateOpenNodeChargeErrorSpec = definePutioOperationErrorSpec({\n domain: \"payment\",\n operation: \"createOpenNodeCharge\",\n knownErrors: [\n { errorType: \"PAYMENT_UNKNOWN_PLAN\", statusCode: 400 as const },\n ...CommonPaymentActionErrors,\n { statusCode: 400 as const },\n ],\n});\nexport type GetPaymentInfoError = PutioOperationFailure<typeof GetPaymentInfoErrorSpec>;\nexport type ListPaymentPlansError = PutioOperationFailure<typeof ListPaymentPlansErrorSpec>;\nexport type ListPaymentOptionsError = PutioOperationFailure<typeof ListPaymentOptionsErrorSpec>;\nexport type ListPaymentHistoryError = PutioOperationFailure<typeof ListPaymentHistoryErrorSpec>;\nexport type ListPaymentInvitesError = PutioOperationFailure<typeof ListPaymentInvitesErrorSpec>;\nexport type PreviewPaymentChangePlanError = PutioOperationFailure<\n typeof PreviewPaymentChangePlanErrorSpec\n>;\nexport type SubmitPaymentChangePlanError = PutioOperationFailure<\n typeof SubmitPaymentChangePlanErrorSpec\n>;\nexport type ConfirmFastspringOrderError = PutioOperationFailure<\n typeof ConfirmFastspringOrderErrorSpec\n>;\nexport type StopSubscriptionError = PutioOperationFailure<typeof StopSubscriptionErrorSpec>;\nexport type GetPaymentVoucherInfoError = PutioOperationFailure<\n typeof GetPaymentVoucherInfoErrorSpec\n>;\nexport type RedeemPaymentVoucherError = PutioOperationFailure<typeof RedeemPaymentVoucherErrorSpec>;\nexport type ReportPaymentsError = PutioOperationFailure<typeof ReportPaymentsErrorSpec>;\nexport type CreatePaddleWaitingPaymentError = PutioOperationFailure<\n typeof CreatePaddleWaitingPaymentErrorSpec\n>;\nexport type GetPaddleBillingInvoiceUrlError = PutioOperationFailure<\n typeof GetPaddleBillingInvoiceUrlErrorSpec\n>;\nexport type CreatePaddleBillingUpdatePaymentMethodTransactionError = PutioOperationFailure<\n typeof CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec\n>;\nexport type CreateOpenNodeChargeError = PutioOperationFailure<typeof CreateOpenNodeChargeErrorSpec>;\nexport type ClassifiedPaymentChangePlanSubmitResponse =\n | {\n readonly data: Schema.Schema.Type<typeof PaymentChangePlanCheckoutSchema>;\n readonly type: \"checkout\";\n }\n | {\n readonly data: Schema.Schema.Type<typeof PaymentChangePlanConfirmationSchema>;\n readonly type: \"confirmation_required\";\n }\n | {\n readonly data: Schema.Schema.Type<typeof PaymentChangePlanSubscriptionUpdatedSchema>;\n readonly type: \"subscription_updated\";\n }\n | {\n readonly data: Schema.Schema.Type<typeof PaymentChangePlanSuccessSchema>;\n readonly type: \"success\";\n };\nexport const classifyPaymentChangePlanResponse = (\n response: PaymentChangePlanSubmitResponse,\n): ClassifiedPaymentChangePlanSubmitResponse => {\n if (\"urls\" in response) {\n return {\n data: response,\n type: \"checkout\",\n };\n }\n if (\"confirmation\" in response) {\n return {\n data: response,\n type: \"confirmation_required\",\n };\n }\n if (\"next_payment\" in response) {\n return {\n data: response,\n type: \"subscription_updated\",\n };\n }\n return {\n data: response,\n type: \"success\",\n };\n};\nexport const getPaymentInfo = (): Effect.Effect<\n PaymentInfo,\n GetPaymentInfoError,\n PutioSdkContext\n> =>\n requestJson(PaymentInfoSchema, {\n method: \"GET\",\n path: \"/v2/payment/info\",\n }).pipe(withOperationErrors(GetPaymentInfoErrorSpec));\nexport const listPaymentPlans = (): Effect.Effect<\n ReadonlyArray<PaymentPlanGroup>,\n ListPaymentPlansError,\n PutioSdkContext\n> =>\n requestJson(PaymentPlansEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/payment/plans\",\n }).pipe(selectJsonField(\"plans\"), withOperationErrors(ListPaymentPlansErrorSpec));\nexport const listPaymentOptions = (): Effect.Effect<\n ReadonlyArray<Schema.Schema.Type<typeof PaymentOptionSchema>>,\n ListPaymentOptionsError,\n PutioSdkContext\n> =>\n requestJson(PaymentOptionsEnvelopeSchema, {\n auth: { type: \"none\" },\n method: \"GET\",\n path: \"/v2/payment/options\",\n }).pipe(selectJsonField(\"options\"), withOperationErrors(ListPaymentOptionsErrorSpec));\nexport const listPaymentHistory = (\n query: PaymentHistoryQuery = {},\n): Effect.Effect<ReadonlyArray<PaymentHistoryItem>, ListPaymentHistoryError, PutioSdkContext> =>\n decodeAndRun(PaymentHistoryQuerySchema, query, (decodedQuery) =>\n requestJson(PaymentHistoryEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/payment/history\",\n query: decodedQuery,\n }).pipe(selectJsonField(\"payments\")),\n ).pipe(withOperationErrors(ListPaymentHistoryErrorSpec));\nexport const listPaymentInvites = (): Effect.Effect<\n ReadonlyArray<Schema.Schema.Type<typeof PaymentInviteSchema>>,\n ListPaymentInvitesError,\n PutioSdkContext\n> =>\n requestJson(PaymentInvitesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/payment/invites\",\n }).pipe(selectJsonField(\"vouchers\"), withOperationErrors(ListPaymentInvitesErrorSpec));\nexport const previewPaymentChangePlan = (\n input: PaymentChangePlanPreviewInput,\n): Effect.Effect<PaymentChangePlanPreview, PreviewPaymentChangePlanError, PutioSdkContext> =>\n decodeAndRun(PaymentChangePlanPreviewInputSchema, input, (decodedInput) =>\n requestJson(PaymentChangePlanPreviewSchema, {\n method: \"GET\",\n path: `/v2/payment/change_plan/${encodeURIComponent(decodedInput.plan_path)}`,\n query: {\n coupon_code: decodedInput.coupon_code,\n payment_type: decodedInput.payment_type,\n },\n }),\n ).pipe(withOperationErrors(PreviewPaymentChangePlanErrorSpec));\nexport const submitPaymentChangePlan = (\n input: PaymentChangePlanSubmitInput,\n): Effect.Effect<PaymentChangePlanSubmitResponse, SubmitPaymentChangePlanError, PutioSdkContext> =>\n decodeAndRun(PaymentChangePlanSubmitInputSchema, input, (decodedInput) =>\n requestJson(PaymentChangePlanSubmitSchema, {\n body: {\n type: \"form\",\n value: {\n confirmation_code: decodedInput.confirmation_code,\n payment_type: decodedInput.payment_type,\n },\n },\n method: \"POST\",\n path: `/v2/payment/change_plan/${encodeURIComponent(decodedInput.plan_path)}`,\n query: {\n coupon_code: decodedInput.coupon_code,\n },\n }),\n ).pipe(withOperationErrors(SubmitPaymentChangePlanErrorSpec));\nexport const confirmFastspringOrder = (\n reference: string,\n): Effect.Effect<boolean, ConfirmFastspringOrderError, PutioSdkContext> =>\n decodeAndRun(NonEmptyStringSchema, reference, (decodedReference) =>\n requestJson(PaymentFastspringConfirmEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/payment/fs-confirm/${encodeURIComponent(decodedReference)}`,\n }).pipe(selectJsonField(\"confirmed\")),\n ).pipe(withOperationErrors(ConfirmFastspringOrderErrorSpec));\nexport const stopPaymentSubscription = (): Effect.Effect<\n void,\n StopSubscriptionError,\n PutioSdkContext\n> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/payment/stop_subscription\",\n }).pipe(Effect.asVoid, withOperationErrors(StopSubscriptionErrorSpec));\nexport const getPaymentVoucherInfo = (\n code: string,\n): Effect.Effect<PaymentVoucherInfo, GetPaymentVoucherInfoError, PutioSdkContext> =>\n decodeAndRun(NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(PaymentVoucherInfoSchema, {\n method: \"GET\",\n path: `/v2/payment/redeem_voucher/${encodeURIComponent(decodedCode)}`,\n }),\n ).pipe(withOperationErrors(GetPaymentVoucherInfoErrorSpec));\nexport const redeemPaymentVoucher = (\n code: string,\n): Effect.Effect<void, RedeemPaymentVoucherError, PutioSdkContext> =>\n decodeAndRun(NonEmptyStringSchema, code, (decodedCode) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/payment/redeem_voucher/${encodeURIComponent(decodedCode)}`,\n }),\n ).pipe(Effect.asVoid, withOperationErrors(RedeemPaymentVoucherErrorSpec));\nexport const reportPayments = (\n paymentIds: ReadonlyArray<number>,\n): Effect.Effect<void, ReportPaymentsError, PutioSdkContext> =>\n decodeAndRun(PaymentIdsSchema, paymentIds, (decodedPaymentIds) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n payment_ids: joinCsv(decodedPaymentIds),\n },\n },\n method: \"POST\",\n path: \"/v2/payment/report\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(ReportPaymentsErrorSpec));\nexport const createPaddleWaitingPayment = (\n input: PaymentPaddleWaitingPaymentInput,\n): Effect.Effect<void, CreatePaddleWaitingPaymentError, PutioSdkContext> =>\n decodeAndRun(PaymentPaddleWaitingPaymentInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/payment/paddle_waiting_payment\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(CreatePaddleWaitingPaymentErrorSpec));\nexport const getPaddleBillingInvoiceUrl = (\n paymentId: number,\n): Effect.Effect<string, GetPaddleBillingInvoiceUrlError, PutioSdkContext> =>\n decodeAndRun(PositiveIntegerSchema, paymentId, (decodedPaymentId) =>\n requestJson(PaymentPaddleBillingInvoiceEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/payment/methods/paddle_billing/invoice/${encodeURIComponent(decodedPaymentId)}`,\n }).pipe(selectJsonField(\"url\")),\n ).pipe(withOperationErrors(GetPaddleBillingInvoiceUrlErrorSpec));\nexport const createPaddleBillingUpdatePaymentMethodTransaction = (\n userSubscriptionId: number,\n): Effect.Effect<string, CreatePaddleBillingUpdatePaymentMethodTransactionError, PutioSdkContext> =>\n decodeAndRun(PositiveIntegerSchema, userSubscriptionId, (decodedUserSubscriptionId) =>\n requestJson(PaymentPaddleBillingUpdatePaymentMethodEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/payment/methods/paddle_billing/update_payment_method/${encodeURIComponent(\n decodedUserSubscriptionId,\n )}`,\n }).pipe(selectJsonField(\"transaction_id\")),\n ).pipe(withOperationErrors(CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec));\nexport const createOpenNodeCharge = (\n planPath: string,\n): Effect.Effect<string, CreateOpenNodeChargeError, PutioSdkContext> =>\n decodeAndRun(NonEmptyStringSchema, planPath, (decodedPlanPath) =>\n requestJson(PaymentOpenNodeChargeEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n plan_fs_path: decodedPlanPath,\n },\n },\n method: \"POST\",\n path: \"/v2/payment/methods/opennode/charge\",\n }).pipe(\n selectJsonField(\"opennode\"),\n Effect.map(({ checkout_url }) => checkout_url),\n ),\n ).pipe(withOperationErrors(CreateOpenNodeChargeErrorSpec));\n","import { Effect, Schema } from \"effect\";\n\nimport { joinCsv } from \"../core/forms.js\";\nimport { mapDecodeErrorToValidationError, type PutioSdkError } from \"../core/errors.js\";\nimport { requestJson, selectJsonFields, type PutioSdkContext } from \"../core/http.js\";\n\nexport const PodcastLinkTypeSchema = Schema.Literals([\"all\", \"audio\", \"video\", \"mp4\"]);\nexport const PodcastGetLinksInputSchema = Schema.Struct({\n parentId: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n types: Schema.optional(Schema.Array(PodcastLinkTypeSchema).check(Schema.isMinLength(1))),\n});\nexport const PodcastLinksSchema = Schema.Struct({\n all: Schema.optional(Schema.String),\n audio: Schema.optional(Schema.String),\n video: Schema.optional(Schema.String),\n mp4: Schema.optional(Schema.String),\n});\nconst PodcastLinksEnvelopeSchema = Schema.Struct({\n links: PodcastLinksSchema,\n status: Schema.Literal(\"OK\"),\n token: Schema.String,\n});\n\nexport type PodcastLinkType = Schema.Schema.Type<typeof PodcastLinkTypeSchema>;\nexport type PodcastGetLinksInput = Schema.Schema.Type<typeof PodcastGetLinksInputSchema>;\nexport type PodcastLinks = Schema.Schema.Type<typeof PodcastLinksSchema>;\nexport type PodcastLinksResponse = Pick<\n Schema.Schema.Type<typeof PodcastLinksEnvelopeSchema>,\n \"links\" | \"token\"\n>;\n\nexport const getPodcastLinks = (\n input: PodcastGetLinksInput,\n): Effect.Effect<PodcastLinksResponse, PutioSdkError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PodcastGetLinksInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(PodcastLinksEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/podcast/links\",\n query: {\n parent_id: decodedInput.parentId,\n type: decodedInput.types ? joinCsv(decodedInput.types) : undefined,\n },\n }),\n ),\n selectJsonFields(\"links\", \"token\"),\n );\n","import { Effect, Schema } from \"effect\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport const RssFeedSchema = Schema.Struct({\n created_at: Schema.String,\n delete_old_files: Schema.Boolean,\n extract: Schema.Boolean,\n failed_item_count: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n keyword: Schema.NullOr(Schema.String),\n last_error: Schema.NullOr(Schema.String),\n last_fetch: Schema.NullOr(Schema.String),\n parent_dir_id: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n parentdirid: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n paused: Schema.Boolean,\n paused_at: Schema.NullOr(Schema.String),\n rss_source_url: Schema.String,\n start_at: Schema.NullOr(Schema.String),\n title: Schema.String,\n unwanted_keywords: Schema.String,\n updated_at: Schema.String,\n});\nexport const RssFeedParamsSchema = Schema.Struct({\n delete_old_files: Schema.optional(Schema.Boolean),\n dont_process_whole_feed: Schema.optional(Schema.Boolean),\n keyword: Schema.optional(Schema.NullOr(Schema.String)),\n parent_dir_id: Schema.optional(\n Schema.Union([Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), Schema.Literal(\"newf\")]),\n ),\n rss_source_url: NonEmptyStringSchema,\n title: NonEmptyStringSchema,\n unwanted_keywords: Schema.optional(Schema.String),\n});\nconst RssFeedUpdateInputSchema = Schema.Struct({\n id: PositiveIntegerSchema,\n params: RssFeedParamsSchema,\n});\nconst RssFeedItemRetryInputSchema = Schema.Struct({\n feedId: PositiveIntegerSchema,\n itemId: PositiveIntegerSchema,\n});\nconst RssFeedItemBaseSchema = Schema.Struct({\n detected_date: Schema.String,\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n processed_at: Schema.String,\n publish_date: Schema.NullOr(Schema.String),\n title: Schema.String,\n});\nexport const RssFeedItemSucceededSchema = RssFeedItemBaseSchema.pipe(\n Schema.fieldsAssign({\n is_failed: Schema.Literal(false),\n user_file_id: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n }),\n);\nexport const RssFeedItemFailedSchema = RssFeedItemBaseSchema.pipe(\n Schema.fieldsAssign({\n failure_reason: Schema.String,\n is_failed: Schema.Literal(true),\n }),\n);\nexport const RssFeedItemSchema = Schema.Union([\n RssFeedItemSucceededSchema,\n RssFeedItemFailedSchema,\n]);\nconst RssFeedsEnvelopeSchema = Schema.Struct({\n feeds: Schema.Array(RssFeedSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst RssFeedEnvelopeSchema = Schema.Struct({\n feed: RssFeedSchema,\n status: Schema.Literal(\"OK\"),\n});\nconst RssFeedItemsEnvelopeSchema = Schema.Struct({\n feed: RssFeedSchema,\n items: Schema.Array(RssFeedItemSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport type RssFeed = Schema.Schema.Type<typeof RssFeedSchema>;\nexport type RssFeedParams = Schema.Schema.Type<typeof RssFeedParamsSchema>;\nexport type RssFeedItem = Schema.Schema.Type<typeof RssFeedItemSchema>;\nexport const ListRssFeedsErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"list\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const GetRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"get\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const CreateRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"create\",\n knownErrors: [\n { errorType: \"URL_REQUIRED\", statusCode: 400 as const },\n { errorType: \"URL_NOT_VALID\", statusCode: 400 as const },\n { errorType: \"FEED_CANNOT_FETCHED\", statusCode: 400 as const },\n { errorType: \"FEED_CANNOT_PARSED\", statusCode: 400 as const },\n { errorType: \"TITLE_REQUIRED\", statusCode: 400 as const },\n { errorType: \"TOO_MANY_RSS_FEEDS\", statusCode: 403 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 402 as const },\n { statusCode: 403 as const },\n ],\n});\nexport const UpdateRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"update\",\n knownErrors: [\n { errorType: \"URL_NOT_VALID\", statusCode: 400 as const },\n { errorType: \"FEED_CANNOT_FETCHED\", statusCode: 400 as const },\n { errorType: \"FEED_CANNOT_PARSED\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 400 as const },\n { statusCode: 402 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const PauseRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"pause\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ResumeRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"resume\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 402 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const DeleteRssFeedErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"delete\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ListRssFeedItemsErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"listItems\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ClearRssFeedLogsErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"clearLogs\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const RetryRssFeedItemErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"retryItem\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 402 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const RetryAllRssFeedItemsErrorSpec = definePutioOperationErrorSpec({\n domain: \"rss\",\n operation: \"retryAll\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { errorType: \"NotFound\", statusCode: 404 as const },\n { statusCode: 402 as const },\n { statusCode: 404 as const },\n ],\n});\nexport type ListRssFeedsError = PutioOperationFailure<typeof ListRssFeedsErrorSpec>;\nexport type GetRssFeedError = PutioOperationFailure<typeof GetRssFeedErrorSpec>;\nexport type CreateRssFeedError = PutioOperationFailure<typeof CreateRssFeedErrorSpec>;\nexport type UpdateRssFeedError = PutioOperationFailure<typeof UpdateRssFeedErrorSpec>;\nexport type PauseRssFeedError = PutioOperationFailure<typeof PauseRssFeedErrorSpec>;\nexport type ResumeRssFeedError = PutioOperationFailure<typeof ResumeRssFeedErrorSpec>;\nexport type DeleteRssFeedError = PutioOperationFailure<typeof DeleteRssFeedErrorSpec>;\nexport type ListRssFeedItemsError = PutioOperationFailure<typeof ListRssFeedItemsErrorSpec>;\nexport type ClearRssFeedLogsError = PutioOperationFailure<typeof ClearRssFeedLogsErrorSpec>;\nexport type RetryRssFeedItemError = PutioOperationFailure<typeof RetryRssFeedItemErrorSpec>;\nexport type RetryAllRssFeedItemsError = PutioOperationFailure<typeof RetryAllRssFeedItemsErrorSpec>;\nconst toCreateBody = (params: RssFeedParams) => ({\n delete_old_files: params.delete_old_files ? \"on\" : undefined,\n dont_process_whole_feed: params.dont_process_whole_feed,\n keyword: params.keyword ?? undefined,\n parent_dir_id: params.parent_dir_id,\n rss_source_url: params.rss_source_url,\n title: params.title,\n unwanted_keywords: params.unwanted_keywords ?? \"\",\n});\nconst toUpdateBody = (params: RssFeedParams) => ({\n delete_old_files: params.delete_old_files,\n dont_process_whole_feed: params.dont_process_whole_feed,\n keyword: params.keyword ?? undefined,\n parent_dir_id: params.parent_dir_id,\n rss_source_url: params.rss_source_url,\n title: params.title,\n unwanted_keywords: params.unwanted_keywords ?? \"\",\n});\nexport const listRssFeeds = (): Effect.Effect<\n ReadonlyArray<RssFeed>,\n ListRssFeedsError,\n PutioSdkContext\n> =>\n requestJson(RssFeedsEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/rss/list\",\n }).pipe(selectJsonField(\"feeds\"), withOperationErrors(ListRssFeedsErrorSpec));\nexport const getRssFeed = (id: number): Effect.Effect<RssFeed, GetRssFeedError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(RssFeedEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/rss/${encodePathSegment(decodedId)}`,\n }),\n ),\n selectJsonField(\"feed\"),\n withOperationErrors(GetRssFeedErrorSpec),\n );\nexport const createRssFeed = (\n params: RssFeedParams,\n): Effect.Effect<RssFeed, CreateRssFeedError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(RssFeedParamsSchema, { onExcessProperty: \"error\" })(params).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedParams) =>\n requestJson(RssFeedEnvelopeSchema, {\n body: {\n type: \"form\",\n value: toCreateBody(decodedParams),\n },\n method: \"POST\",\n path: \"/v2/rss/create\",\n }),\n ),\n selectJsonField(\"feed\"),\n withOperationErrors(CreateRssFeedErrorSpec),\n );\nexport const updateRssFeed = (\n id: number,\n params: RssFeedParams,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n UpdateRssFeedError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(RssFeedUpdateInputSchema, { onExcessProperty: \"error\" })({\n id,\n params,\n }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: toUpdateBody(decodedInput.params),\n },\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedInput.id)}`,\n }),\n ),\n withOperationErrors(UpdateRssFeedErrorSpec),\n );\nexport const pauseRssFeed = (\n id: number,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PauseRssFeedError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedId)}/pause`,\n }),\n ),\n withOperationErrors(PauseRssFeedErrorSpec),\n );\nexport const resumeRssFeed = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ResumeRssFeedError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedId)}/resume`,\n }),\n ),\n withOperationErrors(ResumeRssFeedErrorSpec),\n );\nexport const deleteRssFeed = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n DeleteRssFeedError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedId)}/delete`,\n }),\n ),\n withOperationErrors(DeleteRssFeedErrorSpec),\n );\nexport const listRssFeedItems = (\n id: number,\n): Effect.Effect<\n {\n readonly feed: RssFeed;\n readonly items: ReadonlyArray<RssFeedItem>;\n },\n ListRssFeedItemsError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(RssFeedItemsEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/rss/${encodePathSegment(decodedId)}/items`,\n }),\n ),\n selectJsonFields(\"feed\", \"items\"),\n withOperationErrors(ListRssFeedItemsErrorSpec),\n );\nexport const clearRssFeedLogs = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ClearRssFeedLogsError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedId)}/clear-log`,\n }),\n ),\n withOperationErrors(ClearRssFeedLogsErrorSpec),\n );\nexport const retryRssFeedItem = (\n feedId: number,\n itemId: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n RetryRssFeedItemError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(RssFeedItemRetryInputSchema, { onExcessProperty: \"error\" })({\n feedId,\n itemId,\n }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedInput.feedId)}/items/${encodePathSegment(decodedInput.itemId)}/retry`,\n }),\n ),\n withOperationErrors(RetryRssFeedItemErrorSpec),\n );\nexport const retryAllRssFeedItems = (\n feedId: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n RetryAllRssFeedItemsError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(feedId).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedFeedId) =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: `/v2/rss/${encodePathSegment(decodedFeedId)}/retry-all`,\n }),\n ),\n withOperationErrors(RetryAllRssFeedItemsErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\nimport { joinCsv, toCursorSelectionForm } from \"../core/forms.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n mapDecodeErrorToValidationError,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { FileBroadSchema } from \"./files.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport const SharingCloneStatusSchema = Schema.Literals([\"NEW\", \"PROCESSING\", \"DONE\", \"ERROR\"]);\nexport const SharingCloneInputSchema = Schema.Struct({\n cursor: Schema.optional(NonEmptyStringSchema),\n excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n ids: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n parentId: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst SharingCloneEnvelopeSchema = Schema.Struct({\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n status: Schema.Literal(\"OK\"),\n});\nexport const SharingCloneInfoSchema = Schema.Union([\n Schema.Struct({\n shared_file_clone_status: Schema.Literals([\"NEW\", \"PROCESSING\", \"DONE\"]),\n status: Schema.Literal(\"OK\"),\n }),\n Schema.Struct({\n error_msg: Schema.String,\n shared_file_clone_status: Schema.Literal(\"ERROR\"),\n status: Schema.Literal(\"OK\"),\n }),\n]);\nexport const SharedFileSchema = FileBroadSchema.pipe(\n Schema.fieldsAssign({\n shared_with: Schema.Union([\n Schema.Literal(\"everyone\"),\n Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n ]),\n }),\n);\nexport const SharingShareInputSchema = Schema.Struct({\n cursor: Schema.optional(NonEmptyStringSchema),\n excludeIds: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n ids: Schema.optional(Schema.Array(PositiveIntegerSchema)),\n target: Schema.Union([\n Schema.Struct({\n type: Schema.Literal(\"everyone\"),\n }),\n Schema.Struct({\n friendNames: Schema.Array(NonEmptyStringSchema).check(Schema.isMinLength(1)),\n type: Schema.Literal(\"friends\"),\n }),\n ]),\n});\nconst SharedFilesEnvelopeSchema = Schema.Struct({\n shared: Schema.Array(SharedFileSchema),\n status: Schema.Literal(\"OK\"),\n});\nexport const SharedFileShareSchema = Schema.Struct({\n share_id: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n user_avatar_url: Schema.String,\n user_name: Schema.String,\n});\nexport const SharedFileSharedWithSchema = Schema.Union([\n Schema.Struct({\n share_type: Schema.Literal(\"everyone\"),\n status: Schema.optional(Schema.Literal(\"OK\")),\n }),\n Schema.Struct({\n share_type: Schema.Literal(\"friends\"),\n shares: Schema.Array(SharedFileShareSchema),\n status: Schema.optional(Schema.Literal(\"OK\")),\n }),\n]);\nexport const SharingUnshareInputSchema = Schema.Struct({\n fileId: PositiveIntegerSchema,\n shares: Schema.optional(\n Schema.Array(Schema.Union([PositiveIntegerSchema, NonEmptyStringSchema])),\n ),\n});\nexport const PublicShareSchema = Schema.Struct({\n created_at: Schema.String,\n expiration_date: Schema.String,\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n owner: Schema.Struct({\n name: Schema.String,\n }),\n push_token: Schema.String,\n token: Schema.String,\n user_file: Schema.Struct({\n file_type: Schema.String,\n id: Schema.Int,\n name: Schema.String,\n }),\n});\nconst PublicShareEnvelopeSchema = Schema.Struct({\n public_share: PublicShareSchema,\n status: Schema.optional(Schema.Literal(\"OK\")),\n});\nconst PublicSharesEnvelopeSchema = Schema.Struct({\n public_shares: Schema.Array(PublicShareSchema),\n status: Schema.optional(Schema.Literal(\"OK\")),\n});\nconst PublicShareFileListEnvelopeSchema = Schema.Struct({\n breadcrumbs: Schema.optional(Schema.Array(Schema.Tuple([Schema.Int, Schema.String]))),\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(FileBroadSchema),\n parent: Schema.NullOr(FileBroadSchema),\n status: Schema.Literal(\"OK\"),\n total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst PublicShareFileListContinueEnvelopeSchema = Schema.Struct({\n breadcrumbs: Schema.optional(Schema.Array(Schema.Tuple([Schema.Int, Schema.String]))),\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(FileBroadSchema),\n parent: Schema.optional(Schema.NullOr(FileBroadSchema)),\n status: Schema.Literal(\"OK\"),\n total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n});\nconst PublicShareFileUrlEnvelopeSchema = Schema.Struct({\n status: Schema.optional(Schema.Literal(\"OK\")),\n url: Schema.String,\n});\nexport const PublicShareListQuerySchema = Schema.Struct({\n breadcrumbs: Schema.optional(Schema.Literal(1)),\n content_type: Schema.optional(Schema.String),\n file_type: Schema.optional(Schema.String),\n hidden: Schema.optional(Schema.Literal(1)),\n media_info_parent: Schema.optional(Schema.Literal(1)),\n mp4_status_parent: Schema.optional(Schema.Literal(1)),\n parent_id: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n sort: Schema.optional(Schema.String),\n sort_by: Schema.optional(Schema.String),\n stream_url_parent: Schema.optional(Schema.Literal(1)),\n total: Schema.optional(Schema.Literal(1)),\n video_metadata_parent: Schema.optional(Schema.Literal(1)),\n});\nconst PublicShareContinueInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n query: Schema.Struct({\n per_page: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n }),\n});\nexport type SharingCloneInput = Schema.Schema.Type<typeof SharingCloneInputSchema>;\nexport type SharingCloneInfo = Schema.Schema.Type<typeof SharingCloneInfoSchema>;\nexport type SharedFile = Schema.Schema.Type<typeof SharedFileSchema>;\nexport type SharedFileShare = Schema.Schema.Type<typeof SharedFileShareSchema>;\nexport type SharedFileSharedWith = Schema.Schema.Type<typeof SharedFileSharedWithSchema>;\nexport type SharingShareInput = Schema.Schema.Type<typeof SharingShareInputSchema>;\nexport type SharingUnshareInput = Schema.Schema.Type<typeof SharingUnshareInputSchema>;\nexport type PublicShare = Schema.Schema.Type<typeof PublicShareSchema>;\nexport type PublicShareListQuery = Schema.Schema.Type<typeof PublicShareListQuerySchema>;\nexport const CreateSharingCloneErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"clone\",\n knownErrors: [\n { errorType: \"SharedFileCloneConcurrentLimitError\", statusCode: 400 as const },\n { errorType: \"SharedFileCloneTooManyFilesError\", statusCode: 400 as const },\n { errorType: \"SharedFileCloneTooManyChildren\", statusCode: 400 as const },\n { errorType: \"SharedFileCloneTooManyChildrenError\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const GetSharingCloneInfoErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"getCloneInfo\",\n knownErrors: [\n { errorType: \"SHARED_FILE_CLONE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ShareFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"shareFiles\",\n knownErrors: [\n { errorType: \"ALREADY_SHARED\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const ListSharedFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"listSharedFiles\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const GetSharedWithErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"getSharedWith\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const UnshareFileErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"unshare\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const CreatePublicShareErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"createPublicShare\",\n knownErrors: [\n { errorType: \"PUBLIC_SHARE_NOT_ALLOWED_PLAN\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_FOLDER_ROOT_NOT_ALLOWED\", statusCode: 400 as const },\n { errorType: \"PUBLIC_SHARE_SINGLE_FILE_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_FOLDER_LINK_COUNT_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_FOLDER_MAX_SIZE_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_FOLDER_MAX_CHILDREN_LIMIT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_DAILY_TOTAL_LINK_COUNT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"PUBLIC_SHARE_WEEKLY_TOTAL_LINK_COUNT_EXCEEDED\", statusCode: 403 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ListPublicSharesErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"listPublicShares\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\nexport const DeletePublicShareErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"deletePublicShare\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const GetPublicShareErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"getPublicShare\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ListPublicShareFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"listPublicShareFiles\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ContinuePublicShareFilesErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"continuePublicShareFiles\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const GetPublicShareFileUrlErrorSpec = definePutioOperationErrorSpec({\n domain: \"sharing\",\n operation: \"getPublicShareFileUrl\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport type CreateSharingCloneError = PutioOperationFailure<typeof CreateSharingCloneErrorSpec>;\nexport type GetSharingCloneInfoError = PutioOperationFailure<typeof GetSharingCloneInfoErrorSpec>;\nexport type ShareFilesError = PutioOperationFailure<typeof ShareFilesErrorSpec>;\nexport type ListSharedFilesError = PutioOperationFailure<typeof ListSharedFilesErrorSpec>;\nexport type GetSharedWithError = PutioOperationFailure<typeof GetSharedWithErrorSpec>;\nexport type UnshareFileError = PutioOperationFailure<typeof UnshareFileErrorSpec>;\nexport type CreatePublicShareError = PutioOperationFailure<typeof CreatePublicShareErrorSpec>;\nexport type ListPublicSharesError = PutioOperationFailure<typeof ListPublicSharesErrorSpec>;\nexport type DeletePublicShareError = PutioOperationFailure<typeof DeletePublicShareErrorSpec>;\nexport type GetPublicShareError = PutioOperationFailure<typeof GetPublicShareErrorSpec>;\nexport type ListPublicShareFilesError = PutioOperationFailure<typeof ListPublicShareFilesErrorSpec>;\nexport type ContinuePublicShareFilesError = PutioOperationFailure<\n typeof ContinuePublicShareFilesErrorSpec\n>;\nexport type GetPublicShareFileUrlError = PutioOperationFailure<\n typeof GetPublicShareFileUrlErrorSpec\n>;\nconst toShareTarget = (target: SharingShareInput[\"target\"]): string =>\n target.type === \"everyone\" ? \"everyone\" : target.friendNames.join(\",\");\nexport const cloneSharedFiles = (\n input: SharingCloneInput = {},\n): Effect.Effect<\n {\n readonly id: number;\n },\n CreateSharingCloneError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(SharingCloneInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(SharingCloneEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm(decodedInput),\n parent_id: decodedInput.parentId ?? 0,\n },\n },\n method: \"POST\",\n path: \"/v2/sharing/clone\",\n }),\n ),\n selectJsonFields(\"id\"),\n withOperationErrors(CreateSharingCloneErrorSpec),\n );\nexport const getSharingCloneInfo = (\n id: number,\n): Effect.Effect<SharingCloneInfo, GetSharingCloneInfoError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(SharingCloneInfoSchema, {\n method: \"GET\",\n path: `/v2/sharing/clone/${encodePathSegment(decodedId)}`,\n }),\n ),\n withOperationErrors(GetSharingCloneInfoErrorSpec),\n );\nexport const shareFiles = (\n input: SharingShareInput,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, ShareFilesError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(SharingShareInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm(decodedInput),\n friends: toShareTarget(decodedInput.target),\n },\n },\n method: \"POST\",\n path: \"/v2/files/share\",\n }),\n ),\n withOperationErrors(ShareFilesErrorSpec),\n );\nexport const listSharedFiles = (): Effect.Effect<\n ReadonlyArray<SharedFile>,\n ListSharedFilesError,\n PutioSdkContext\n> =>\n requestJson(SharedFilesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/files/shared\",\n }).pipe(selectJsonField(\"shared\"), withOperationErrors(ListSharedFilesErrorSpec));\nexport const getSharedWith = (\n fileId: number,\n): Effect.Effect<SharedFileSharedWith, GetSharedWithError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedFileId) =>\n requestJson(SharedFileSharedWithSchema, {\n method: \"GET\",\n path: `/v2/files/${encodePathSegment(decodedFileId)}/shared-with-v2`,\n }),\n ),\n withOperationErrors(GetSharedWithErrorSpec),\n );\nexport const unshareFile = (\n input: SharingUnshareInput,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, UnshareFileError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(SharingUnshareInputSchema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n shares: joinCsv(decodedInput.shares) ?? \"everyone\",\n },\n },\n method: \"POST\",\n path: `/v2/files/${encodePathSegment(decodedInput.fileId)}/unshare`,\n }),\n ),\n withOperationErrors(UnshareFileErrorSpec),\n );\nexport const createPublicShare = (\n fileId: number,\n): Effect.Effect<PublicShare, CreatePublicShareError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedFileId) =>\n requestJson(PublicShareEnvelopeSchema, {\n method: \"POST\",\n path: `/v2/public_share/${encodePathSegment(decodedFileId)}`,\n }),\n ),\n selectJsonField(\"public_share\"),\n withOperationErrors(CreatePublicShareErrorSpec),\n );\nexport const listPublicShares = (): Effect.Effect<\n ReadonlyArray<PublicShare>,\n ListPublicSharesError,\n PutioSdkContext\n> =>\n requestJson(PublicSharesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/public_share/list\",\n }).pipe(selectJsonField(\"public_shares\"), withOperationErrors(ListPublicSharesErrorSpec));\nexport const deletePublicShare = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n DeletePublicShareError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(id).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"DELETE\",\n path: `/v2/public_share/${encodePathSegment(decodedId)}`,\n }),\n ),\n withOperationErrors(DeletePublicShareErrorSpec),\n );\nexport const getPublicShare = (): Effect.Effect<\n PublicShare,\n GetPublicShareError,\n PutioSdkContext\n> =>\n requestJson(PublicShareEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/public_share\",\n }).pipe(selectJsonField(\"public_share\"), withOperationErrors(GetPublicShareErrorSpec));\nexport const listPublicShareFiles = (\n query: PublicShareListQuery = {},\n): Effect.Effect<\n Schema.Schema.Type<typeof PublicShareFileListEnvelopeSchema>,\n ListPublicShareFilesError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PublicShareListQuerySchema, { onExcessProperty: \"error\" })(query).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedQuery) =>\n requestJson(PublicShareFileListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/public_share/files/list\",\n query: decodedQuery,\n }),\n ),\n withOperationErrors(ListPublicShareFilesErrorSpec),\n );\nexport const continuePublicShareFiles = (\n cursor: string,\n query: {\n readonly per_page?: number;\n } = {},\n): Effect.Effect<\n Schema.Schema.Type<typeof PublicShareFileListContinueEnvelopeSchema>,\n ContinuePublicShareFilesError,\n PutioSdkContext\n> =>\n Schema.decodeUnknownEffect(PublicShareContinueInputSchema, { onExcessProperty: \"error\" })({\n cursor,\n query,\n }).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedInput) =>\n requestJson(PublicShareFileListContinueEnvelopeSchema, {\n body: {\n type: \"form\",\n value: { cursor: decodedInput.cursor },\n },\n method: \"POST\",\n path: \"/v2/public_share/files/list/continue\",\n query: decodedInput.query,\n }),\n ),\n withOperationErrors(ContinuePublicShareFilesErrorSpec),\n );\nexport const getPublicShareFileUrl = (\n fileId: number,\n): Effect.Effect<string, GetPublicShareFileUrlError, PutioSdkContext> =>\n Schema.decodeUnknownEffect(PositiveIntegerSchema)(fileId).pipe(\n Effect.mapError(mapDecodeErrorToValidationError),\n Effect.flatMap((decodedFileId) =>\n requestJson(PublicShareFileUrlEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/public_share/files/${encodePathSegment(decodedFileId)}/url`,\n }),\n ),\n selectJsonField(\"url\"),\n withOperationErrors(GetPublicShareFileUrlErrorSpec),\n );\n","import { Effect, Schema } from \"effect\";\n\nimport { joinCsv } from \"../core/forms.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema, decodeAndRun } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { FileTypeSchema } from \"./files.js\";\nimport { OkResponseSchema, requestJson, type PutioSdkContext } from \"../core/http.js\";\n\nexport const TrashFileSchema = Schema.Struct({\n content_type: Schema.NullOr(Schema.String),\n created_at: Schema.String,\n deleted_at: Schema.String,\n expiration_date: Schema.String,\n extension: Schema.NullOr(Schema.String),\n file_type: FileTypeSchema,\n first_accessed_at: Schema.NullOr(Schema.String),\n folder_type: Schema.Literal(\"REGULAR\"),\n icon: Schema.NullOr(Schema.String),\n id: Schema.Int,\n name: Schema.String,\n parent_id: Schema.NullOr(Schema.Int),\n screenshot: Schema.Unknown,\n size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n});\n\nconst TrashListEnvelopeSchema = Schema.Struct({\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(TrashFileSchema),\n status: Schema.Literal(\"OK\"),\n total: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n trash_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n});\n\nconst TrashContinueEnvelopeSchema = Schema.Struct({\n cursor: Schema.NullOr(Schema.String),\n files: Schema.Array(TrashFileSchema),\n status: Schema.Literal(\"OK\"),\n});\n\nexport type TrashFile = Schema.Schema.Type<typeof TrashFileSchema>;\nexport type TrashListResponse = Schema.Schema.Type<typeof TrashListEnvelopeSchema>;\nexport type TrashContinueResponse = Schema.Schema.Type<typeof TrashContinueEnvelopeSchema>;\nconst TrashListQuerySchema = Schema.Struct({\n per_page: Schema.optional(PositiveIntegerSchema),\n});\nconst TrashCursorBulkInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n file_ids: Schema.optional(Schema.Never),\n useCursor: Schema.Literal(true),\n});\nconst TrashIdsBulkInputSchema = Schema.Struct({\n cursor: Schema.optional(Schema.Never),\n file_ids: Schema.Array(PositiveIntegerSchema).check(Schema.isMinLength(1)),\n useCursor: Schema.optional(Schema.Literal(false)),\n});\nconst TrashBulkInputSchema = Schema.Union([TrashCursorBulkInputSchema, TrashIdsBulkInputSchema]);\nconst TrashContinueInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n query: TrashListQuerySchema,\n});\nexport type TrashListQuery = Schema.Schema.Type<typeof TrashListQuerySchema>;\nexport type TrashBulkInput = Schema.Schema.Type<typeof TrashBulkInputSchema>;\n\nconst RestrictedReadError = { errorType: \"invalid_scope\", statusCode: 401 as const };\nconst RestrictedWriteError = { errorType: \"invalid_scope\", statusCode: 401 as const };\n\nexport const ListTrashErrorSpec = definePutioOperationErrorSpec({\n domain: \"trash\",\n operation: \"list\",\n knownErrors: [RestrictedReadError],\n});\n\nexport const ContinueTrashErrorSpec = definePutioOperationErrorSpec({\n domain: \"trash\",\n operation: \"continue\",\n knownErrors: [RestrictedReadError, { statusCode: 400 as const }],\n});\n\nexport const RestoreTrashErrorSpec = definePutioOperationErrorSpec({\n domain: \"trash\",\n operation: \"restore\",\n knownErrors: [\n { errorType: \"TRASH_FILE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"TRASH_LOCK_TIMEOUT\", statusCode: 400 as const },\n { errorType: \"TRASH_INCOMPLETE_TRASH\", statusCode: 400 as const },\n { errorType: \"TRASH_RESTORE_TOO_MANY_FILES\", statusCode: 400 as const },\n RestrictedWriteError,\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\n\nexport const DeleteTrashErrorSpec = definePutioOperationErrorSpec({\n domain: \"trash\",\n operation: \"delete\",\n knownErrors: [\n { errorType: \"TRASH_FILE_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"TRASH_LOCK_TIMEOUT\", statusCode: 400 as const },\n RestrictedWriteError,\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\n\nexport const EmptyTrashErrorSpec = definePutioOperationErrorSpec({\n domain: \"trash\",\n operation: \"empty\",\n knownErrors: [\n { errorType: \"TRASH_LOCK_TIMEOUT\", statusCode: 400 as const },\n RestrictedWriteError,\n ],\n});\n\nexport type ListTrashError = PutioOperationFailure<typeof ListTrashErrorSpec>;\nexport type ContinueTrashError = PutioOperationFailure<typeof ContinueTrashErrorSpec>;\nexport type RestoreTrashError = PutioOperationFailure<typeof RestoreTrashErrorSpec>;\nexport type DeleteTrashError = PutioOperationFailure<typeof DeleteTrashErrorSpec>;\nexport type EmptyTrashError = PutioOperationFailure<typeof EmptyTrashErrorSpec>;\n\nconst toBulkTrashBody = (input: TrashBulkInput) => {\n if (input.useCursor === true) {\n return {\n cursor: input.cursor,\n file_ids: undefined,\n };\n }\n return {\n cursor: undefined,\n file_ids: joinCsv(input.file_ids),\n };\n};\n\nexport const listTrash = (\n query: TrashListQuery = {},\n): Effect.Effect<TrashListResponse, ListTrashError, PutioSdkContext> =>\n decodeAndRun(TrashListQuerySchema, query, (decodedQuery) =>\n requestJson(TrashListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/trash/list\",\n query: decodedQuery,\n }),\n ).pipe(withOperationErrors(ListTrashErrorSpec));\n\nexport const continueTrash = (\n cursor: string,\n query: TrashListQuery = {},\n): Effect.Effect<TrashContinueResponse, ContinueTrashError, PutioSdkContext> =>\n decodeAndRun(TrashContinueInputSchema, { cursor, query }, (decodedInput) =>\n requestJson(TrashContinueEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n cursor: decodedInput.cursor,\n },\n },\n method: \"POST\",\n path: \"/v2/trash/list/continue\",\n query: decodedInput.query,\n }),\n ).pipe(withOperationErrors(ContinueTrashErrorSpec));\n\nexport const restoreTrash = (\n input: TrashBulkInput,\n): Effect.Effect<void, RestoreTrashError, PutioSdkContext> =>\n decodeAndRun(TrashBulkInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: toBulkTrashBody(decodedInput),\n },\n method: \"POST\",\n path: \"/v2/trash/restore\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(RestoreTrashErrorSpec));\n\nexport const deleteTrash = (\n input: TrashBulkInput,\n): Effect.Effect<void, DeleteTrashError, PutioSdkContext> =>\n decodeAndRun(TrashBulkInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: toBulkTrashBody(decodedInput),\n },\n method: \"POST\",\n path: \"/v2/trash/delete\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(DeleteTrashErrorSpec));\n\nexport const emptyTrash = (): Effect.Effect<void, EmptyTrashError, PutioSdkContext> =>\n requestJson(OkResponseSchema, {\n method: \"POST\",\n path: \"/v2/trash/empty\",\n }).pipe(Effect.asVoid, withOperationErrors(EmptyTrashErrorSpec));\n","import { Effect, Schema } from \"effect\";\nimport { joinCsv } from \"../core/forms.js\";\nimport { NonEmptyStringSchema, PositiveIntegerSchema, decodeAndRun } from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n type PutioSdkError,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestArrayBuffer,\n requestJson,\n selectJsonField,\n selectJsonFields,\n type PutioSdkContext,\n} from \"../core/http.js\";\nconst TransferIdSchema = PositiveIntegerSchema;\nconst TransferIdsSchema = Schema.Array(TransferIdSchema).check(Schema.isMinLength(1));\nexport const TransferTypeSchema = Schema.Literals([\n \"URL\",\n \"TORRENT\",\n \"PLAYLIST\",\n \"LIVE_STREAM\",\n \"N/A\",\n]);\nexport const TransferStatusSchema = Schema.Literals([\n \"WAITING\",\n \"PREPARING_DOWNLOAD\",\n \"IN_QUEUE\",\n \"DOWNLOADING\",\n \"WAITING_FOR_COMPLETE_QUEUE\",\n \"WAITING_FOR_DOWNLOADER\",\n \"COMPLETING\",\n \"STOPPING\",\n \"SEEDING\",\n \"COMPLETED\",\n \"ERROR\",\n \"PREPARING_SEED\",\n]);\nconst TransferLinkSchema = Schema.Struct({\n label: Schema.String,\n url: Schema.NullOr(Schema.String),\n});\nconst NullableInt = Schema.NullOr(Schema.Int);\nconst NullableNonNegativeNumber = Schema.NullOr(\n Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n);\nexport const TransferBaseSchema = Schema.Struct({\n availability: NullableNonNegativeNumber,\n callback_url: Schema.NullOr(Schema.String),\n client_ip: Schema.NullOr(Schema.String),\n completion_percent: NullableNonNegativeNumber,\n created_at: Schema.String,\n created_torrent: Schema.Boolean,\n current_ratio: NullableNonNegativeNumber,\n download_id: NullableInt,\n down_speed: NullableNonNegativeNumber,\n downloaded: NullableNonNegativeNumber,\n error_message: Schema.NullOr(Schema.String),\n estimated_time: NullableNonNegativeNumber,\n file_id: NullableInt,\n finished_at: Schema.NullOr(Schema.String),\n hash: Schema.NullOr(Schema.String),\n id: Schema.Int,\n is_private: Schema.Boolean,\n links: Schema.optional(Schema.Array(TransferLinkSchema)),\n name: Schema.String,\n peers_connected: NullableInt,\n peers_getting_from_us: NullableInt,\n peers_sending_to_us: NullableInt,\n percent_done: NullableNonNegativeNumber,\n recorded_seconds: Schema.optional(NullableNonNegativeNumber),\n save_parent_id: Schema.Int,\n seconds_seeding: NullableNonNegativeNumber,\n simulated: Schema.Boolean,\n size: NullableNonNegativeNumber,\n source: Schema.String,\n started_at: Schema.NullOr(Schema.String),\n status: TransferStatusSchema,\n subscription_id: NullableInt,\n torrent_link: Schema.NullOr(Schema.String),\n tracker: Schema.NullOr(Schema.String),\n tracker_message: Schema.NullOr(Schema.String),\n type: TransferTypeSchema,\n uploaded: NullableNonNegativeNumber,\n up_speed: NullableNonNegativeNumber,\n userfile_exists: Schema.optional(Schema.Boolean),\n});\nconst TransferErrorSchema = TransferBaseSchema.mapFields(\n ({ error_message: _errorMessage, status: _status, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n error_message: Schema.String,\n status: Schema.Literal(\"ERROR\"),\n }),\n);\nconst TransferCompletedSchema = TransferBaseSchema.mapFields(\n ({ status: _status, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n status: Schema.Literal(\"COMPLETED\"),\n }),\n);\nconst TransferLiveSchema = TransferBaseSchema.mapFields(\n ({ recorded_seconds: _recordedSeconds, type: _type, ...fields }) => fields,\n).pipe(\n Schema.fieldsAssign({\n recorded_seconds: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n type: Schema.Literal(\"LIVE_STREAM\"),\n }),\n);\nconst TransferTorrentSeedingSchema = TransferBaseSchema.mapFields(\n ({\n current_ratio: _currentRatio,\n seconds_seeding: _secondsSeeding,\n status: _status,\n type: _type,\n ...fields\n }) => fields,\n).pipe(\n Schema.fieldsAssign({\n current_ratio: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n seconds_seeding: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literals([\"SEEDING\", \"COMPLETED\", \"PREPARING_SEED\"]),\n type: Schema.Literal(\"TORRENT\"),\n }),\n);\nexport const TransferSchema = Schema.Union([\n TransferErrorSchema,\n TransferLiveSchema,\n TransferTorrentSeedingSchema,\n TransferCompletedSchema,\n TransferBaseSchema,\n]);\nexport const TransfersListQuerySchema = Schema.Struct({\n per_page: Schema.optional(PositiveIntegerSchema),\n});\nexport const TransferAddInputSchema = Schema.Struct({\n callback_url: Schema.optional(NonEmptyStringSchema),\n save_parent_id: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n url: NonEmptyStringSchema,\n});\nconst TransferContinueInputSchema = Schema.Struct({\n cursor: NonEmptyStringSchema,\n query: TransfersListQuerySchema,\n});\nconst TransferInfoUrlSchema = Schema.String.check(\n Schema.isMinLength(1),\n Schema.isPattern(/^[^\\r\\n]+$/),\n);\nconst TransferInfoUrlsSchema = Schema.Array(TransferInfoUrlSchema).check(Schema.isMinLength(1));\nconst TransferAddManyInputSchema = Schema.Array(TransferAddInputSchema).check(\n Schema.isMinLength(1),\n);\nconst TransferCleanIdsSchema = Schema.Array(TransferIdSchema);\nconst TrackerSchema = Schema.String.check(Schema.isPattern(/^[^,\\s]+$/));\nexport const TransferAddTrackersInputSchema = Schema.Struct({\n trackers: Schema.Array(TrackerSchema).check(Schema.isMinLength(1)),\n transferId: TransferIdSchema,\n});\nconst TransferRemoveIdsInputSchema = Schema.Struct({\n filter: Schema.optional(Schema.Never),\n ids: TransferIdsSchema,\n});\nconst TransferRemoveFilterInputSchema = Schema.Struct({\n filter: Schema.Literals([\"all\", \"completed\"]),\n ids: Schema.optional(Schema.Never),\n});\nexport const TransferRemoveInputSchema = Schema.Union([\n TransferRemoveIdsInputSchema,\n TransferRemoveFilterInputSchema,\n]);\nconst TransferInfoItemSchema = Schema.Struct({\n error: Schema.optional(Schema.String),\n error_message: Schema.optional(Schema.String),\n file_size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n human_size: Schema.String,\n name: Schema.String,\n type_name: Schema.String,\n url: Schema.String,\n});\nconst TransfersListEnvelopeSchema = Schema.Struct({\n cursor: Schema.optional(Schema.NullOr(Schema.String)),\n status: Schema.Literal(\"OK\"),\n total: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n transfers: Schema.Array(TransferSchema),\n});\nconst TransfersContinueEnvelopeSchema = Schema.Struct({\n cursor: Schema.NullOr(Schema.String),\n status: Schema.Literal(\"OK\"),\n transfers: Schema.Array(TransferSchema),\n});\nconst TransferEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n transfer: TransferSchema,\n});\nconst TransferCountEnvelopeSchema = Schema.Struct({\n count: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n});\nconst TransferInfoEnvelopeSchema = Schema.Struct({\n disk_avail: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n ret: Schema.Array(TransferInfoItemSchema),\n status: Schema.Literal(\"OK\"),\n});\nconst TransfersAddMultiErrorSchema = Schema.Struct({\n error_type: Schema.String,\n status_code: Schema.Int,\n url: Schema.String,\n});\nconst TransfersAddMultiEnvelopeSchema = Schema.Struct({\n errors: Schema.Array(TransfersAddMultiErrorSchema),\n status: Schema.Literal(\"OK\"),\n transfers: Schema.Array(TransferSchema),\n});\nconst TransfersCleanEnvelopeSchema = Schema.Struct({\n deleted_ids: Schema.Array(Schema.Int),\n status: Schema.Literal(\"OK\"),\n});\nexport type TransferType = Schema.Schema.Type<typeof TransferTypeSchema>;\nexport type TransferStatus = Schema.Schema.Type<typeof TransferStatusSchema>;\nexport type TransferLink = Schema.Schema.Type<typeof TransferLinkSchema>;\nexport type Transfer = Schema.Schema.Type<typeof TransferSchema>;\nexport type TransfersListQuery = Schema.Schema.Type<typeof TransfersListQuerySchema>;\nexport type TransferAddInput = Schema.Schema.Type<typeof TransferAddInputSchema>;\nexport type TransferAddTrackersInput = Schema.Schema.Type<typeof TransferAddTrackersInputSchema>;\nexport type TransferRemoveInput = Schema.Schema.Type<typeof TransferRemoveInputSchema>;\nexport type TransferInfoItem = Schema.Schema.Type<typeof TransferInfoItemSchema>;\nexport type TransfersListResponse = Schema.Schema.Type<typeof TransfersListEnvelopeSchema>;\nexport type TransfersContinueResponse = Schema.Schema.Type<typeof TransfersContinueEnvelopeSchema>;\nexport type TransfersAddMultiError = Schema.Schema.Type<typeof TransfersAddMultiErrorSchema>;\nexport const ListTransfersErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"list\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const GetTransferErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"get\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const GetTransferTorrentErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"getTorrent\",\n knownErrors: [\n { errorType: \"NOT_TORRENT\", statusCode: 400 as const },\n { errorType: \"IS_MAGNET\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const AddTransferTrackersErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"addTrackers\",\n knownErrors: [\n { errorType: \"NO_TRACKERS\", statusCode: 400 as const },\n { errorType: \"TORRENT_NOT_ACTIVE\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 402 as const },\n { errorType: \"TRANSFER_NOT_FOUND\", statusCode: 404 as const },\n { errorType: \"TRANSFER_INVALID\", statusCode: 500 as const },\n { errorType: \"TORRENT_NOT_READY\", statusCode: 500 as const },\n ],\n});\nexport const RemoveTransfersErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"remove\",\n knownErrors: [\n { statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n ],\n});\nexport const AddTransferErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"add\",\n knownErrors: [\n { errorType: \"EMPTY_URL\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const AddManyTransfersErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"addMany\",\n knownErrors: [\n { errorType: \"TOO_MANY_URLS\", statusCode: 403 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n ],\n});\nexport const RetryTransferErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"retry\",\n knownErrors: [\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 403 as const },\n { statusCode: 404 as const },\n ],\n});\nexport const ReannounceTransferErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"reannounce\",\n knownErrors: [\n { errorType: \"NOT_TORRENT\", statusCode: 400 as const },\n { errorType: \"TORRENT_NOT_ACTIVE\", statusCode: 400 as const },\n { errorType: \"BadRequest\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n { statusCode: 500 as const },\n ],\n});\nexport const StopRecordingTransferErrorSpec = definePutioOperationErrorSpec({\n domain: \"transfers\",\n operation: \"stopRecording\",\n knownErrors: [\n { errorType: \"NOT_RECORDING\", statusCode: 400 as const },\n { errorType: \"invalid_scope\", statusCode: 401 as const },\n { statusCode: 400 as const },\n { statusCode: 404 as const },\n ],\n});\nexport type ListTransfersError = PutioOperationFailure<typeof ListTransfersErrorSpec>;\nexport type GetTransferError = PutioOperationFailure<typeof GetTransferErrorSpec>;\nexport type GetTransferTorrentError = PutioOperationFailure<typeof GetTransferTorrentErrorSpec>;\nexport type AddTransferTrackersError = PutioOperationFailure<typeof AddTransferTrackersErrorSpec>;\nexport type RemoveTransfersError = PutioOperationFailure<typeof RemoveTransfersErrorSpec>;\nexport type AddTransferError = PutioOperationFailure<typeof AddTransferErrorSpec>;\nexport type AddManyTransfersError = PutioOperationFailure<typeof AddManyTransfersErrorSpec>;\nexport type RetryTransferError = PutioOperationFailure<typeof RetryTransferErrorSpec>;\nexport type ReannounceTransferError = PutioOperationFailure<typeof ReannounceTransferErrorSpec>;\nexport type StopRecordingTransferError = PutioOperationFailure<\n typeof StopRecordingTransferErrorSpec\n>;\nexport const listTransfers = (\n query: TransfersListQuery = {},\n): Effect.Effect<TransfersListResponse, ListTransfersError, PutioSdkContext> =>\n decodeAndRun(TransfersListQuerySchema, query, (decodedQuery) =>\n requestJson(TransfersListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/transfers/list\",\n query: decodedQuery,\n }),\n ).pipe(withOperationErrors(ListTransfersErrorSpec));\nexport const continueTransfers = (\n cursor: string,\n query: TransfersListQuery = {},\n): Effect.Effect<TransfersContinueResponse, ListTransfersError, PutioSdkContext> =>\n decodeAndRun(TransferContinueInputSchema, { cursor, query }, (decodedInput) =>\n requestJson(TransfersContinueEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n cursor: decodedInput.cursor,\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/list/continue\",\n query: decodedInput.query,\n }),\n ).pipe(withOperationErrors(ListTransfersErrorSpec));\nexport const getTransfer = (\n id: number,\n): Effect.Effect<Transfer, GetTransferError, PutioSdkContext> =>\n decodeAndRun(TransferIdSchema, id, (decodedId) =>\n requestJson(TransferEnvelopeSchema, {\n method: \"GET\",\n path: `/v2/transfers/${encodePathSegment(decodedId)}`,\n }).pipe(selectJsonField(\"transfer\")),\n ).pipe(withOperationErrors(GetTransferErrorSpec));\nexport const getTransferTorrent = (\n id: number,\n): Effect.Effect<Uint8Array, GetTransferTorrentError, PutioSdkContext> =>\n decodeAndRun(TransferIdSchema, id, (decodedId) =>\n requestArrayBuffer({\n method: \"GET\",\n path: `/v2/transfers/${encodePathSegment(decodedId)}/torrent`,\n }),\n ).pipe(withOperationErrors(GetTransferTorrentErrorSpec));\nexport const countTransfers = (): Effect.Effect<number, PutioSdkError, PutioSdkContext> =>\n requestJson(TransferCountEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/transfers/count\",\n }).pipe(selectJsonField(\"count\"));\nexport const getTransferInfo = (\n urls: ReadonlyArray<string>,\n): Effect.Effect<\n {\n readonly disk_avail: number;\n readonly ret: ReadonlyArray<TransferInfoItem>;\n },\n PutioSdkError,\n PutioSdkContext\n> =>\n decodeAndRun(TransferInfoUrlsSchema, urls, (decodedUrls) =>\n requestJson(TransferInfoEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n urls: decodedUrls.join(\"\\n\"),\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/info\",\n }).pipe(selectJsonFields(\"disk_avail\", \"ret\")),\n );\nexport const addTransfer = (\n input: TransferAddInput,\n): Effect.Effect<Transfer, AddTransferError, PutioSdkContext> =>\n decodeAndRun(TransferAddInputSchema, input, (decodedInput) =>\n requestJson(TransferEnvelopeSchema, {\n body: {\n type: \"form\",\n value: decodedInput,\n },\n method: \"POST\",\n path: \"/v2/transfers/add\",\n }).pipe(selectJsonField(\"transfer\")),\n ).pipe(withOperationErrors(AddTransferErrorSpec));\nexport const addManyTransfers = (\n inputs: ReadonlyArray<TransferAddInput>,\n): Effect.Effect<\n {\n readonly errors: ReadonlyArray<TransfersAddMultiError>;\n readonly transfers: ReadonlyArray<Transfer>;\n },\n AddManyTransfersError,\n PutioSdkContext\n> =>\n decodeAndRun(TransferAddManyInputSchema, inputs, (decodedInputs) =>\n requestJson(TransfersAddMultiEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n urls: JSON.stringify(decodedInputs),\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/add-multi\",\n }).pipe(selectJsonFields(\"errors\", \"transfers\")),\n ).pipe(withOperationErrors(AddManyTransfersErrorSpec));\nexport const addTransferTrackers = (\n input: TransferAddTrackersInput,\n): Effect.Effect<void, AddTransferTrackersError, PutioSdkContext> =>\n decodeAndRun(TransferAddTrackersInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n trackers: joinCsv(decodedInput.trackers),\n },\n },\n method: \"POST\",\n path: `/v2/transfers/add-trackers/${encodePathSegment(decodedInput.transferId)}`,\n }),\n ).pipe(Effect.asVoid, withOperationErrors(AddTransferTrackersErrorSpec));\nexport const cancelTransfers = (\n ids: ReadonlyArray<number>,\n): Effect.Effect<Schema.Schema.Type<typeof OkResponseSchema>, PutioSdkError, PutioSdkContext> =>\n decodeAndRun(TransferIdsSchema, ids, (decodedIds) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n transfer_ids: joinCsv(decodedIds),\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/cancel\",\n }),\n );\nexport const cleanTransfers = (\n ids: ReadonlyArray<number> = [],\n): Effect.Effect<\n {\n readonly deleted_ids: ReadonlyArray<number>;\n },\n PutioSdkError,\n PutioSdkContext\n> =>\n decodeAndRun(TransferCleanIdsSchema, ids, (decodedIds) =>\n requestJson(TransfersCleanEnvelopeSchema, {\n body: {\n type: \"form\",\n value: decodedIds.length > 0 ? { transfer_ids: joinCsv(decodedIds) } : {},\n },\n method: \"POST\",\n path: \"/v2/transfers/clean\",\n }).pipe(selectJsonFields(\"deleted_ids\")),\n );\nexport const removeTransfers = (\n input: TransferRemoveInput,\n): Effect.Effect<void, RemoveTransfersError, PutioSdkContext> =>\n decodeAndRun(TransferRemoveInputSchema, input, (decodedInput) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value:\n decodedInput.ids !== undefined\n ? { transfer_ids: joinCsv(decodedInput.ids) }\n : { remove_filter: decodedInput.filter },\n },\n method: \"POST\",\n path: \"/v2/transfers/remove\",\n }),\n ).pipe(Effect.asVoid, withOperationErrors(RemoveTransfersErrorSpec));\nexport const retryTransfer = (\n id: number,\n): Effect.Effect<Transfer, RetryTransferError, PutioSdkContext> =>\n decodeAndRun(TransferIdSchema, id, (decodedId) =>\n requestJson(TransferEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n id: decodedId,\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/retry\",\n }).pipe(selectJsonField(\"transfer\")),\n ).pipe(withOperationErrors(RetryTransferErrorSpec));\nexport const reannounceTransfer = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n ReannounceTransferError,\n PutioSdkContext\n> =>\n decodeAndRun(TransferIdSchema, id, (decodedId) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n id: decodedId,\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/reannounce\",\n }),\n ).pipe(withOperationErrors(ReannounceTransferErrorSpec));\nexport const stopTransferRecording = (\n id: number,\n): Effect.Effect<\n Schema.Schema.Type<typeof OkResponseSchema>,\n StopRecordingTransferError,\n PutioSdkContext\n> =>\n decodeAndRun(TransferIdSchema, id, (decodedId) =>\n requestJson(OkResponseSchema, {\n body: {\n type: \"form\",\n value: {\n transfer_id: decodedId,\n },\n },\n method: \"POST\",\n path: \"/v2/transfers/stop-recording\",\n }),\n ).pipe(withOperationErrors(StopRecordingTransferErrorSpec));\n","import { Effect, Schema } from \"effect\";\n\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport { requestJson, selectJsonField, type PutioSdkContext } from \"../core/http.js\";\n\nexport const TunnelRouteSchema = Schema.Struct({\n description: Schema.String,\n hosts: Schema.Array(Schema.String),\n name: Schema.String,\n});\n\nconst TunnelRoutesEnvelopeSchema = Schema.Struct({\n routes: Schema.Array(TunnelRouteSchema),\n status: Schema.Literal(\"OK\"),\n});\n\nexport type TunnelRoute = Schema.Schema.Type<typeof TunnelRouteSchema>;\n\nexport const ListTunnelRoutesErrorSpec = definePutioOperationErrorSpec({\n domain: \"tunnel\",\n operation: \"listRoutes\",\n knownErrors: [{ errorType: \"invalid_scope\", statusCode: 401 as const }],\n});\n\nexport type ListTunnelRoutesError = PutioOperationFailure<typeof ListTunnelRoutesErrorSpec>;\n\nexport const listTunnelRoutes = (): Effect.Effect<\n ReadonlyArray<TunnelRoute>,\n ListTunnelRoutesError,\n PutioSdkContext\n> =>\n requestJson(TunnelRoutesEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/tunnel/routes\",\n }).pipe(selectJsonField(\"routes\"), withOperationErrors(ListTunnelRoutesErrorSpec));\n","import { Effect, Schema } from \"effect\";\nimport { toCursorSelectionForm } from \"../core/forms.js\";\nimport {\n PositiveIntegerSchema,\n decodeAndRun,\n makeCursorSelectionSchema,\n} from \"../core/validation.js\";\nimport {\n definePutioOperationErrorSpec,\n withOperationErrors,\n type PutioOperationFailure,\n} from \"../core/errors.js\";\nimport {\n OkResponseSchema,\n encodePathSegment,\n requestJson,\n selectJsonField,\n type PutioSdkContext,\n} from \"../core/http.js\";\nexport const ZipStatusSchema = Schema.Literals([\"NEW\", \"PROCESSING\", \"DONE\", \"ERROR\"]);\nconst ZipSummarySchema = Schema.Struct({\n created_at: Schema.String,\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n});\nconst ZipsListEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n zips: Schema.Array(ZipSummarySchema),\n});\nconst ZipCreateEnvelopeSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n zip_id: Schema.Int.check(Schema.isGreaterThan(0)),\n});\nconst ZipInfoPendingSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n url: Schema.Null,\n zip_status: Schema.Literals([\"NEW\", \"PROCESSING\"]),\n});\nconst ZipInfoErrorSchema = Schema.Struct({\n error_msg: Schema.String,\n status: Schema.Literal(\"OK\"),\n url: Schema.Null,\n zip_status: Schema.Literal(\"ERROR\"),\n});\nconst ZipMissingFileSchema = Schema.Struct({\n id: Schema.Int.check(Schema.isGreaterThan(0)),\n missing: Schema.Boolean,\n name: Schema.String,\n});\nconst ZipInfoDoneSchema = Schema.Struct({\n id: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))),\n missing_files: Schema.Array(Schema.Union([Schema.String, ZipMissingFileSchema])),\n size: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),\n status: Schema.Literal(\"OK\"),\n url: Schema.String,\n zip_status: Schema.Literal(\"DONE\"),\n});\nconst ZipInfoSchema = Schema.Union([ZipInfoPendingSchema, ZipInfoErrorSchema, ZipInfoDoneSchema]);\nexport type ZipSummary = Schema.Schema.Type<typeof ZipSummarySchema>;\nexport type ZipCreateResponse = Schema.Schema.Type<typeof ZipCreateEnvelopeSchema>;\nexport type ZipInfo = Schema.Schema.Type<typeof ZipInfoSchema>;\nconst CreateZipInputSchema = makeCursorSelectionSchema(\"file_ids\", \"exclude_ids\", {});\nexport type CreateZipInput = Schema.Schema.Type<typeof CreateZipInputSchema>;\nconst FilesReadScopeError = { errorType: \"invalid_scope\", statusCode: 401 as const };\nconst FilesWriteScopeError = { errorType: \"invalid_scope\", statusCode: 401 as const };\nexport const ListZipsErrorSpec = definePutioOperationErrorSpec({\n domain: \"zips\",\n operation: \"list\",\n knownErrors: [FilesReadScopeError],\n});\nexport const CreateZipErrorSpec = definePutioOperationErrorSpec({\n domain: \"zips\",\n operation: \"create\",\n knownErrors: [\n { errorType: \"ZIP_TOTAL_SIZE_EXCEEDED\", statusCode: 403 as const },\n FilesWriteScopeError,\n { statusCode: 400 as const },\n { statusCode: 403 as const },\n ],\n});\nexport const GetZipErrorSpec = definePutioOperationErrorSpec({\n domain: \"zips\",\n operation: \"get\",\n knownErrors: [\n { errorType: \"LINK_EXPIRED\", statusCode: 410 as const },\n { errorType: \"ERROR_IN_ZIP\", statusCode: 500 as const },\n FilesReadScopeError,\n { statusCode: 403 as const },\n { statusCode: 410 as const },\n { statusCode: 500 as const },\n ],\n});\nexport const CancelZipErrorSpec = definePutioOperationErrorSpec({\n domain: \"zips\",\n operation: \"cancel\",\n knownErrors: [\n { errorType: \"LINK_EXPIRED\", statusCode: 410 as const },\n FilesWriteScopeError,\n { statusCode: 403 as const },\n { statusCode: 410 as const },\n ],\n});\nexport type ListZipsError = PutioOperationFailure<typeof ListZipsErrorSpec>;\nexport type CreateZipError = PutioOperationFailure<typeof CreateZipErrorSpec>;\nexport type GetZipError = PutioOperationFailure<typeof GetZipErrorSpec>;\nexport type CancelZipError = PutioOperationFailure<typeof CancelZipErrorSpec>;\nexport const listZips = (): Effect.Effect<\n ReadonlyArray<ZipSummary>,\n ListZipsError,\n PutioSdkContext\n> =>\n requestJson(ZipsListEnvelopeSchema, {\n method: \"GET\",\n path: \"/v2/zips/list\",\n }).pipe(selectJsonField(\"zips\"), withOperationErrors(ListZipsErrorSpec));\nexport const createZip = (\n input: CreateZipInput,\n): Effect.Effect<number, CreateZipError, PutioSdkContext> =>\n decodeAndRun(CreateZipInputSchema, input, (decodedInput) =>\n requestJson(ZipCreateEnvelopeSchema, {\n body: {\n type: \"form\",\n value: {\n ...toCursorSelectionForm({\n cursor: decodedInput.cursor,\n excludeIds: decodedInput.exclude_ids,\n ids: decodedInput.file_ids,\n }),\n },\n },\n method: \"POST\",\n path: \"/v2/zips/create\",\n }),\n ).pipe(selectJsonField(\"zip_id\"), withOperationErrors(CreateZipErrorSpec));\nexport const getZip = (id: number): Effect.Effect<ZipInfo, GetZipError, PutioSdkContext> =>\n decodeAndRun(PositiveIntegerSchema, id, (decodedId) =>\n requestJson(ZipInfoSchema, {\n method: \"GET\",\n path: `/v2/zips/${encodePathSegment(decodedId)}`,\n }),\n ).pipe(withOperationErrors(GetZipErrorSpec));\nexport const cancelZip = (id: number): Effect.Effect<void, CancelZipError, PutioSdkContext> =>\n decodeAndRun(PositiveIntegerSchema, id, (decodedId) =>\n requestJson(OkResponseSchema, {\n method: \"GET\",\n path: `/v2/zips/${encodePathSegment(decodedId)}/cancel`,\n }),\n ).pipe(Effect.asVoid, withOperationErrors(CancelZipErrorSpec));\n","import { Cause, Context, Effect, Exit, Layer, ManagedRuntime, Schema } from \"effect\";\n\nimport {\n clearAccount,\n destroyAccount,\n getAccountInfo,\n getAccountSettings,\n listAccountSubtitleLanguages,\n listAccountConfirmations,\n saveAccountSettings,\n} from \"../domains/account.js\";\nimport type {\n AccountInfoBase,\n AccountInfoBroad,\n AccountInfoQuery,\n PasInfo,\n} from \"../domains/account.js\";\nimport {\n createAppSpecificPassword,\n deleteAllAppSpecificPasswords,\n deleteAppSpecificPassword,\n listAppSpecificPasswords,\n} from \"../domains/app-specific-passwords.js\";\nimport {\n buildAuthLoginUrl,\n checkCodeMatch,\n clients,\n exchangeOAuthAuthorizationCode,\n exists,\n forgotPassword,\n generateTOTP,\n getCode,\n getFamilyInvite,\n getFriendInvite,\n getGiftCard,\n getRecoveryCodes,\n getVoucher,\n grants,\n linkDevice,\n login,\n logout,\n regenerateRecoveryCodes,\n register,\n resetPassword,\n revokeAllClients,\n revokeApp,\n revokeClient,\n validateToken,\n verifyTOTP,\n} from \"../domains/auth.js\";\nimport {\n deleteConfigKey,\n getConfigKey,\n getConfigKeyWith,\n readConfig,\n readConfigWith,\n setConfigKey,\n writeConfig,\n} from \"../domains/config.js\";\nimport { createDownloadLinks, getDownloadLinks } from \"../domains/download-links.js\";\nimport { clearEvents, deleteEvent, getEventTorrent, listEvents } from \"../domains/events.js\";\nimport {\n createFamilyInvite,\n joinFamily,\n listFamilyInvites,\n listFamilyMembers,\n removeFamilyMember,\n} from \"../domains/family.js\";\nimport { getIftttStatus, sendIftttEvent } from \"../domains/ifttt.js\";\nimport {\n canWriteFile,\n copyFile,\n createFileUploadFormData,\n createFileUploadRequest,\n continueFiles,\n continueSearch,\n convertFileToMp4,\n convertFileSelectionToMp4,\n convertFilesToMp4,\n createFolder,\n deleteFileExtraction,\n deleteFileMp4,\n deleteFileSelection,\n deleteFiles,\n extractFiles,\n findNextFile,\n findNextVideo,\n getApiContentUrl,\n getApiDownloadUrl,\n getApiMp4DownloadUrl,\n getDownloadUrl,\n getFileChild,\n getHlsMasterPlaylist,\n getHlsStreamUrl,\n getXspfPlaylistUrl,\n getFile,\n getMp4Status,\n getStartFrom,\n listActiveMp4Conversions,\n listFileExtractions,\n listFileSubtitles,\n moveFiles,\n moveFileSelection,\n putMp4ToMyFiles,\n queryFiles,\n renameFile,\n resetFileSortSettings,\n resetStartFrom,\n searchFiles,\n setFileSort,\n setFilesWatchStatus,\n setStartFrom,\n touchFiles,\n uploadFile,\n} from \"../domains/files.js\";\nimport type { FileCore, FileQuery, FileResponseFor, FileVideoMetadata } from \"../domains/files.js\";\nimport { createFriendInvite, listFriendInvites } from \"../domains/friend-invites.js\";\nimport {\n approveFriendRequest,\n countWaitingRequests,\n denyFriendRequest,\n getFriendSharedFolder,\n listFriends,\n listSentRequests,\n listWaitingRequests,\n removeFriend,\n searchFriends,\n sendFriendRequest,\n} from \"../domains/friends.js\";\nimport { makePutioSdkConfig, makePutioSdkLiveLayer, PutioSdkConfig } from \"./http.js\";\nimport type { PutioSdkConfigShape, PutioSdkContext } from \"./http.js\";\nimport {\n buildOAuthAppIconUrl,\n buildOAuthAuthorizeUrl,\n createOAuthApp,\n deleteOAuthApp,\n getOAuthApp,\n getPopularOAuthApps,\n queryOAuthApps,\n regenerateOAuthAppToken,\n setOAuthAppIcon,\n updateOAuthApp,\n} from \"../domains/oauth.js\";\nimport {\n classifyPaymentChangePlanResponse,\n confirmFastspringOrder,\n createOpenNodeCharge,\n createPaddleBillingUpdatePaymentMethodTransaction,\n createPaddleWaitingPayment,\n getPaymentInfo,\n getPaddleBillingInvoiceUrl,\n getPaymentVoucherInfo,\n listPaymentHistory,\n listPaymentInvites,\n listPaymentOptions,\n listPaymentPlans,\n previewPaymentChangePlan,\n redeemPaymentVoucher,\n reportPayments,\n stopPaymentSubscription,\n submitPaymentChangePlan,\n} from \"../domains/payment.js\";\nimport { getPodcastLinks } from \"../domains/podcast.js\";\nimport {\n clearRssFeedLogs,\n createRssFeed,\n deleteRssFeed,\n getRssFeed,\n listRssFeedItems,\n listRssFeeds,\n pauseRssFeed,\n resumeRssFeed,\n retryAllRssFeedItems,\n retryRssFeedItem,\n updateRssFeed,\n} from \"../domains/rss.js\";\nimport {\n cloneSharedFiles,\n continuePublicShareFiles,\n createPublicShare,\n deletePublicShare,\n getPublicShare,\n getPublicShareFileUrl,\n getSharedWith,\n getSharingCloneInfo,\n listPublicShareFiles,\n listPublicShares,\n listSharedFiles,\n shareFiles,\n unshareFile,\n} from \"../domains/sharing.js\";\nimport {\n continueTrash,\n deleteTrash,\n emptyTrash,\n listTrash,\n restoreTrash,\n} from \"../domains/trash.js\";\nimport {\n addManyTransfers,\n addTransfer,\n addTransferTrackers,\n cancelTransfers,\n cleanTransfers,\n continueTransfers,\n countTransfers,\n getTransfer,\n getTransferInfo,\n getTransferTorrent,\n listTransfers,\n reannounceTransfer,\n removeTransfers,\n retryTransfer,\n stopTransferRecording,\n} from \"../domains/transfers.js\";\nimport { listTunnelRoutes } from \"../domains/tunnel.js\";\nimport { cancelZip, createZip, getZip, listZips } from \"../domains/zips.js\";\nimport { mapConfigurationError } from \"./errors.js\";\n\ntype PutioSdkPromiseRuntime = ManagedRuntime.ManagedRuntime<PutioSdkContext, never>;\ntype PutioSdkPromiseRuntimeConfig = Omit<PutioSdkConfigShape, \"accessToken\">;\n\ninterface PutioSdkPromiseState {\n accessToken: string | undefined;\n readonly runtimeConfig: PutioSdkPromiseRuntimeConfig;\n}\n\nconst promiseClientRuntimeCache = new WeakMap<PutioSdkPromiseState, PutioSdkPromiseRuntime>();\nconst disposedPromiseClientStates = new WeakSet<PutioSdkPromiseState>();\n\nconst getPromiseClientRuntime = (state: PutioSdkPromiseState): PutioSdkPromiseRuntime => {\n if (disposedPromiseClientStates.has(state)) {\n throw mapConfigurationError(\n \"This Promise client has been disposed and can no longer execute SDK effects\",\n );\n }\n\n const cachedRuntime = promiseClientRuntimeCache.get(state);\n\n if (cachedRuntime) {\n return cachedRuntime;\n }\n\n const runtime = ManagedRuntime.make(makePutioSdkLiveLayer(state.runtimeConfig));\n promiseClientRuntimeCache.set(state, runtime);\n return runtime;\n};\n\nconst disposePromiseClientRuntime = async (state: PutioSdkPromiseState): Promise<void> => {\n disposedPromiseClientStates.add(state);\n\n const runtime = promiseClientRuntimeCache.get(state);\n promiseClientRuntimeCache.delete(state);\n\n if (!runtime) {\n return;\n }\n\n await runtime.dispose();\n};\n\nconst rejectWithSdkFailure = <A, E>(exit: Exit.Exit<A, E>): Promise<A> =>\n Exit.match(exit, {\n onSuccess: (value) => Promise.resolve(value),\n onFailure: (cause) => {\n const failure = cause.reasons.find(Cause.isFailReason);\n\n if (failure) {\n return Promise.reject(failure.error);\n }\n\n return Promise.reject(Cause.squash(cause));\n },\n });\n\nconst provideSdk = async <A, E>(\n state: PutioSdkPromiseState,\n effect: Effect.Effect<A, E, PutioSdkContext>,\n) => {\n const operationConfig = {\n ...state.runtimeConfig,\n accessToken: state.accessToken,\n };\n const operation = Effect.provideService(effect, PutioSdkConfig, operationConfig);\n\n return rejectWithSdkFailure(await getPromiseClientRuntime(state).runPromiseExit(operation));\n};\n\nconst snapshotUrl = (value: string | URL | undefined): string | URL | undefined =>\n typeof value === \"string\" || value === undefined ? value : new URL(value.href);\n\ntype PromiseOperation<T> = T extends (...args: infer Args) => infer Result\n ? Result extends Effect.Effect<infer Success, infer _Error, infer _Requirements>\n ? (...args: Args) => Promise<Success>\n : T\n : never;\n\ntype OperationBoundary = \"input-free\" | \"pure\" | \"validated\";\ntype Operation = (...args: never[]) => unknown;\nconst operationEntryMarker = Symbol(\"PutioSdkOperationEntry\");\ninterface OperationEntry<T extends Operation> {\n readonly [operationEntryMarker]: true;\n readonly boundary: OperationBoundary;\n readonly run: T;\n}\n\ntype EffectOperation<T extends Operation> =\n ReturnType<T> extends Effect.Effect<infer _Success, infer _Error, infer _Requirements>\n ? T\n : never;\n\ntype InputFreeEffectOperation<T extends Operation> =\n Parameters<T> extends [] ? EffectOperation<T> : never;\n\ntype ValidatedEffectOperation<T extends Operation> =\n Parameters<T> extends [] ? never : EffectOperation<T>;\n\ntype EffectReturnMember<T> =\n T extends Effect.Effect<infer _Success, infer _Error, infer _Requirements> ? T : never;\n\ntype PureOperation<T extends Operation> = [EffectReturnMember<ReturnType<T>>] extends [never]\n ? T\n : never;\n\nconst operationAtBoundary = <T extends Operation>(\n run: T,\n boundary: OperationBoundary,\n): OperationEntry<T> => {\n const entry = { boundary, run };\n Object.defineProperty(entry, operationEntryMarker, { value: true });\n return Object.freeze(entry) as OperationEntry<T>;\n};\n\nconst inputFree = <T extends Operation>(\n operation: InputFreeEffectOperation<T>,\n): OperationEntry<T> => operationAtBoundary(operation, \"input-free\");\n\nconst pure = <T extends Operation>(operation: PureOperation<T>): OperationEntry<T> =>\n operationAtBoundary(operation, \"pure\");\n\nconst validated = <T extends Operation>(\n operation: ValidatedEffectOperation<T>,\n): OperationEntry<T> => operationAtBoundary(operation, \"validated\");\n\ntype EffectOperationTree<T> =\n T extends OperationEntry<infer TOperation>\n ? TOperation\n : T extends object\n ? { [Key in keyof T]: EffectOperationTree<T[Key]> }\n : never;\n\ntype PromiseOperationTree<T> =\n T extends OperationEntry<infer TOperation>\n ? PromiseOperation<TOperation>\n : T extends object\n ? { [Key in keyof T]: PromiseOperationTree<T[Key]> }\n : never;\n\nconst isOperationEntry = (value: unknown): value is OperationEntry<Operation> =>\n typeof value === \"object\" &&\n value !== null &&\n Object.getPrototypeOf(value) === Object.prototype &&\n Object.isFrozen(value) &&\n Object.hasOwn(value, operationEntryMarker) &&\n value[operationEntryMarker] === true &&\n Object.hasOwn(value, \"boundary\") &&\n Object.hasOwn(value, \"run\") &&\n Reflect.ownKeys(value).length === 3 &&\n (value.boundary === \"input-free\" ||\n value.boundary === \"pure\" ||\n value.boundary === \"validated\") &&\n typeof value.run === \"function\";\n\nconst runClassifiedOperation = (\n entry: OperationEntry<Operation>,\n args: ReadonlyArray<unknown>,\n): unknown => {\n const result: unknown = Reflect.apply(entry.run, undefined, args);\n\n if (entry.boundary === \"pure\") {\n if (Effect.isEffect(result)) {\n throw new TypeError(\"Pure SDK operation returned an Effect\");\n }\n\n return result;\n }\n\n if (!Effect.isEffect(result)) {\n throw new TypeError(`${entry.boundary} SDK operation did not return an Effect`);\n }\n\n return result;\n};\n\nconst cloneOperationTree = <T extends object>(tree: T): EffectOperationTree<T> =>\n Object.fromEntries(\n Object.entries(tree).map(([key, value]) => [\n key,\n isOperationEntry(value) ? value.run : cloneOperationTree(value as object),\n ]),\n ) as EffectOperationTree<T>;\n\nconst runPromiseOperation = (\n entry: OperationEntry<Operation>,\n state: PutioSdkPromiseState,\n args: ReadonlyArray<unknown>,\n): unknown => {\n const result = runClassifiedOperation(entry, args);\n\n return entry.boundary === \"pure\"\n ? result\n : provideSdk(state, result as Effect.Effect<unknown, unknown, PutioSdkContext>);\n};\n\nconst makePromiseOperationTree = <T extends object>(\n tree: T,\n state: PutioSdkPromiseState,\n): PromiseOperationTree<T> =>\n Object.fromEntries(\n Object.entries(tree).map(([key, value]) => [\n key,\n isOperationEntry(value)\n ? (...args: ReadonlyArray<unknown>) => runPromiseOperation(value, state, args)\n : makePromiseOperationTree(value as object, state),\n ]),\n ) as PromiseOperationTree<T>;\n\nconst assertClassifiedOperationTree = (tree: object, parentPath = \"\"): void => {\n const entries = Object.entries(tree);\n\n if (Object.getPrototypeOf(tree) !== Object.prototype || entries.length === 0) {\n throw new TypeError(\n `SDK operation namespace ${parentPath || \"<root>\"} is not a non-empty plain object`,\n );\n }\n\n for (const [key, value] of entries) {\n const path = parentPath ? `${parentPath}.${key}` : key;\n\n if (isOperationEntry(value)) {\n continue;\n }\n\n if (typeof value === \"object\" && value !== null) {\n assertClassifiedOperationTree(value as object, path);\n } else {\n throw new TypeError(`SDK operation ${path} has no request-boundary classification`);\n }\n }\n};\n\nconst sharedOperationTree = {\n account: {\n appSpecificPasswords: {\n create: validated(createAppSpecificPassword),\n delete: validated(deleteAppSpecificPassword),\n deleteAll: inputFree(deleteAllAppSpecificPasswords),\n list: inputFree(listAppSpecificPasswords),\n },\n clear: validated(clearAccount),\n destroy: validated(destroyAccount),\n getInfo: validated(getAccountInfo),\n getSettings: inputFree(getAccountSettings),\n listSubtitleLanguages: inputFree(listAccountSubtitleLanguages),\n listConfirmations: validated(listAccountConfirmations),\n saveSettings: validated(saveAccountSettings),\n },\n auth: {\n buildLoginUrl: pure(buildAuthLoginUrl),\n checkCodeMatch: validated(checkCodeMatch),\n clients: inputFree(clients),\n exchangeAuthorizationCode: validated(exchangeOAuthAuthorizationCode),\n exists: validated(exists),\n forgotPassword: validated(forgotPassword),\n getCode: validated(getCode),\n getFamilyInvite: validated(getFamilyInvite),\n getFriendInvite: validated(getFriendInvite),\n getGiftCard: validated(getGiftCard),\n getVoucher: validated(getVoucher),\n grants: inputFree(grants),\n linkDevice: validated(linkDevice),\n login: validated(login),\n logout: inputFree(logout),\n register: validated(register),\n resetPassword: validated(resetPassword),\n revokeAllClients: inputFree(revokeAllClients),\n revokeApp: validated(revokeApp),\n revokeClient: validated(revokeClient),\n twoFactor: {\n generateTOTP: inputFree(generateTOTP),\n getRecoveryCodes: inputFree(getRecoveryCodes),\n regenerateRecoveryCodes: inputFree(regenerateRecoveryCodes),\n verifyTOTP: validated(verifyTOTP),\n },\n validateToken: validated(validateToken),\n },\n config: {\n deleteKey: validated(deleteConfigKey),\n getKey: validated(getConfigKey),\n getKeyWith: validated(getConfigKeyWith),\n read: inputFree(readConfig),\n readWith: validated(readConfigWith),\n setKey: validated(setConfigKey),\n write: validated(writeConfig),\n },\n downloadLinks: {\n create: validated(createDownloadLinks),\n get: validated(getDownloadLinks),\n },\n events: {\n clear: inputFree(clearEvents),\n delete: validated(deleteEvent),\n getTorrent: validated(getEventTorrent),\n list: validated(listEvents),\n },\n family: {\n createInvite: inputFree(createFamilyInvite),\n join: validated(joinFamily),\n listInvites: inputFree(listFamilyInvites),\n listMembers: inputFree(listFamilyMembers),\n removeMember: validated(removeFamilyMember),\n },\n ifttt: {\n getStatus: inputFree(getIftttStatus),\n sendEvent: validated(sendIftttEvent),\n },\n podcast: {\n getLinks: validated(getPodcastLinks),\n },\n files: {\n canWrite: validated(canWriteFile),\n continue: validated(continueFiles),\n continueSearch: validated(continueSearch),\n copy: validated(copyFile),\n convertToMp4: validated(convertFileToMp4),\n convertManyToMp4: validated(convertFilesToMp4),\n convertSelectionToMp4: validated(convertFileSelectionToMp4),\n createUploadRequest: validated(createFileUploadRequest),\n createFolder: validated(createFolder),\n deleteExtraction: validated(deleteFileExtraction),\n deleteMp4: validated(deleteFileMp4),\n deleteSelection: validated(deleteFileSelection),\n delete: validated(deleteFiles),\n extract: validated(extractFiles),\n findNext: validated(findNextFile),\n findNextVideo: validated(findNextVideo),\n getApiContentUrl: validated(getApiContentUrl),\n getApiDownloadUrl: validated(getApiDownloadUrl),\n getApiMp4DownloadUrl: validated(getApiMp4DownloadUrl),\n get: validated(getFile),\n getChild: validated(getFileChild),\n getDownloadUrl: validated(getDownloadUrl),\n getHlsMasterPlaylist: validated(getHlsMasterPlaylist),\n getHlsStreamUrl: validated(getHlsStreamUrl),\n getXspfPlaylistUrl: validated(getXspfPlaylistUrl),\n getMp4Status: validated(getMp4Status),\n getStartFrom: validated(getStartFrom),\n list: validated(queryFiles),\n listActiveConversions: inputFree(listActiveMp4Conversions),\n listExtractions: inputFree(listFileExtractions),\n listSubtitles: validated(listFileSubtitles),\n move: validated(moveFiles),\n moveSelection: validated(moveFileSelection),\n putMp4ToMyFiles: validated(putMp4ToMyFiles),\n rename: validated(renameFile),\n resetSortSettings: inputFree(resetFileSortSettings),\n resetStartFrom: validated(resetStartFrom),\n search: validated(searchFiles),\n setSort: validated(setFileSort),\n setWatchStatus: validated(setFilesWatchStatus),\n setStartFrom: validated(setStartFrom),\n touch: validated(touchFiles),\n upload: validated(uploadFile),\n },\n friendInvites: {\n create: inputFree(createFriendInvite),\n list: inputFree(listFriendInvites),\n },\n friends: {\n approve: validated(approveFriendRequest),\n countWaitingRequests: inputFree(countWaitingRequests),\n deny: validated(denyFriendRequest),\n list: inputFree(listFriends),\n listSentRequests: inputFree(listSentRequests),\n listWaitingRequests: inputFree(listWaitingRequests),\n remove: validated(removeFriend),\n search: validated(searchFriends),\n sendRequest: validated(sendFriendRequest),\n sharedFolder: validated(getFriendSharedFolder),\n },\n oauth: {\n buildAuthorizeUrl: pure(buildOAuthAuthorizeUrl),\n buildIconUrl: pure(buildOAuthAppIconUrl),\n create: validated(createOAuthApp),\n delete: validated(deleteOAuthApp),\n get: validated(getOAuthApp),\n getPopularApps: inputFree(getPopularOAuthApps),\n query: inputFree(queryOAuthApps),\n regenerateToken: validated(regenerateOAuthAppToken),\n setIcon: validated(setOAuthAppIcon),\n update: validated(updateOAuthApp),\n },\n payment: {\n changePlan: {\n classifyResponse: pure(classifyPaymentChangePlanResponse),\n preview: validated(previewPaymentChangePlan),\n submit: validated(submitPaymentChangePlan),\n },\n confirmFastspringOrder: validated(confirmFastspringOrder),\n getInfo: inputFree(getPaymentInfo),\n listHistory: validated(listPaymentHistory),\n listInvites: inputFree(listPaymentInvites),\n listOptions: inputFree(listPaymentOptions),\n listPlans: inputFree(listPaymentPlans),\n methods: {\n addPaddleWaitingPayment: validated(createPaddleWaitingPayment),\n createOpenNodeCharge: validated(createOpenNodeCharge),\n createPaddleBillingUpdatePaymentMethodTransaction: validated(\n createPaddleBillingUpdatePaymentMethodTransaction,\n ),\n getPaddleBillingInvoiceUrl: validated(getPaddleBillingInvoiceUrl),\n },\n report: validated(reportPayments),\n stopSubscription: inputFree(stopPaymentSubscription),\n voucher: {\n getInfo: validated(getPaymentVoucherInfo),\n redeem: validated(redeemPaymentVoucher),\n },\n },\n rss: {\n clearLogs: validated(clearRssFeedLogs),\n create: validated(createRssFeed),\n delete: validated(deleteRssFeed),\n get: validated(getRssFeed),\n list: inputFree(listRssFeeds),\n listItems: validated(listRssFeedItems),\n pause: validated(pauseRssFeed),\n resume: validated(resumeRssFeed),\n retryAll: validated(retryAllRssFeedItems),\n retryItem: validated(retryRssFeedItem),\n update: validated(updateRssFeed),\n },\n sharing: {\n clone: validated(cloneSharedFiles),\n getCloneInfo: validated(getSharingCloneInfo),\n getSharedWith: validated(getSharedWith),\n listSharedFiles: inputFree(listSharedFiles),\n publicAccess: {\n continueFiles: validated(continuePublicShareFiles),\n get: inputFree(getPublicShare),\n getFileUrl: validated(getPublicShareFileUrl),\n listFiles: validated(listPublicShareFiles),\n },\n publicShares: {\n create: validated(createPublicShare),\n delete: validated(deletePublicShare),\n list: inputFree(listPublicShares),\n },\n shareFiles: validated(shareFiles),\n unshare: validated(unshareFile),\n },\n tunnel: {\n listRoutes: inputFree(listTunnelRoutes),\n },\n trash: {\n continue: validated(continueTrash),\n delete: validated(deleteTrash),\n empty: inputFree(emptyTrash),\n list: validated(listTrash),\n restore: validated(restoreTrash),\n },\n transfers: {\n add: validated(addTransfer),\n addMany: validated(addManyTransfers),\n addTrackers: validated(addTransferTrackers),\n cancel: validated(cancelTransfers),\n clean: validated(cleanTransfers),\n continue: validated(continueTransfers),\n count: inputFree(countTransfers),\n get: validated(getTransfer),\n getTorrent: validated(getTransferTorrent),\n info: validated(getTransferInfo),\n list: validated(listTransfers),\n reannounce: validated(reannounceTransfer),\n remove: validated(removeTransfers),\n retry: validated(retryTransfer),\n stopRecording: validated(stopTransferRecording),\n },\n zips: {\n cancel: validated(cancelZip),\n create: validated(createZip),\n get: validated(getZip),\n list: inputFree(listZips),\n },\n};\n\nassertClassifiedOperationTree(sharedOperationTree);\n\nexport const createPutioSdkEffectClient = () => cloneOperationTree(sharedOperationTree);\n\nexport type PutioSdkEffectClient = ReturnType<typeof createPutioSdkEffectClient>;\n\nexport class PutioSdk extends Context.Service<PutioSdk, PutioSdkEffectClient>()(\"PutioSdk\") {}\n\nexport const makePutioSdkEffectClientLayer = () =>\n Layer.succeed(PutioSdk, createPutioSdkEffectClient());\n\nexport const makePutioSdkLiveClientLayer = (config: PutioSdkConfigShape) =>\n Layer.mergeAll(makePutioSdkEffectClientLayer(), makePutioSdkLiveLayer(config));\n\nexport const createPutioSdkPromiseClient = (initialConfig: PutioSdkConfigShape = {}) => {\n const normalizedConfig = makePutioSdkConfig({\n ...initialConfig,\n baseUrl: snapshotUrl(initialConfig.baseUrl),\n uploadBaseUrl: snapshotUrl(initialConfig.uploadBaseUrl),\n webAppUrl: snapshotUrl(initialConfig.webAppUrl),\n });\n const runtimeConfig: PutioSdkPromiseRuntimeConfig = {\n baseUrl: normalizedConfig.baseUrl,\n uploadBaseUrl: normalizedConfig.uploadBaseUrl,\n webAppUrl: normalizedConfig.webAppUrl,\n };\n const config: PutioSdkPromiseState = {\n accessToken: initialConfig.accessToken,\n runtimeConfig,\n };\n\n function getInfo(query: {\n readonly download_token: 1;\n readonly pas: 1;\n }): Promise<AccountInfoBase & { readonly download_token: string; readonly pas: PasInfo }>;\n function getInfo(query: {\n readonly download_token: 1;\n }): Promise<AccountInfoBase & { readonly download_token: string }>;\n function getInfo(query: {\n readonly features: 1;\n }): Promise<AccountInfoBase & { readonly features: Record<string, boolean> }>;\n function getInfo(query: {\n readonly intercom: 1;\n readonly platform?: \"web\" | \"ios\";\n }): Promise<AccountInfoBase & { readonly user_hash?: string }>;\n function getInfo(query: {\n readonly pas: 1;\n }): Promise<AccountInfoBase & { readonly pas: PasInfo }>;\n function getInfo(query: {\n readonly profitwell: 1;\n }): Promise<AccountInfoBase & { readonly paddle_user_id: number | string | null }>;\n function getInfo(query: {\n readonly push_token: 1;\n }): Promise<AccountInfoBase & { readonly push_token: string }>;\n function getInfo(): Promise<AccountInfoBroad>;\n function getInfo(query: AccountInfoQuery): Promise<AccountInfoBroad>;\n function getInfo(query: AccountInfoQuery = {}) {\n return provideSdk(config, getAccountInfo(query));\n }\n\n function getFileById(input: {\n readonly id: number;\n readonly query: { readonly stream_url: 1; readonly video_metadata: 1 };\n }): Promise<\n FileCore & {\n readonly stream_url: string | null;\n readonly video_metadata: FileVideoMetadata;\n }\n >;\n function getFileById(input: {\n readonly id: number;\n readonly query: { readonly mp4_stream_url: 1 };\n }): Promise<\n FileCore &\n (\n | {\n readonly is_mp4_available: true;\n readonly mp4_stream_url: string | null;\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n }\n | {\n readonly is_mp4_available: false;\n readonly mp4_size: number | null;\n readonly need_convert: boolean;\n }\n )\n >;\n function getFileById(input: {\n readonly id: number;\n readonly query?: FileQuery;\n }): Promise<FileCore>;\n function getFileById(input: { readonly id: number; readonly query?: FileQuery }) {\n return provideSdk(config, getFile(input));\n }\n\n function getChildByName(input: {\n readonly name: string;\n readonly parentId: number;\n }): Promise<FileCore>;\n function getChildByName<TQuery extends FileQuery>(input: {\n readonly name: string;\n readonly parentId: number;\n readonly query: TQuery;\n }): Promise<FileResponseFor<TQuery>>;\n function getChildByName(input: {\n readonly name: string;\n readonly parentId: number;\n readonly query?: FileQuery;\n }) {\n return provideSdk(config, getFileChild(input));\n }\n\n const operations = makePromiseOperationTree(sharedOperationTree, config);\n\n return {\n dispose: () => disposePromiseClientRuntime(config),\n setAccessToken: (accessToken: string | undefined): void => {\n config.accessToken = accessToken;\n },\n ...operations,\n account: {\n ...operations.account,\n getInfo,\n },\n auth: {\n ...operations.auth,\n buildLoginUrl: (options: Parameters<typeof buildAuthLoginUrl>[0]) =>\n buildAuthLoginUrl({\n ...options,\n webAppUrl: options.webAppUrl ?? config.runtimeConfig.webAppUrl,\n }),\n },\n config: {\n ...operations.config,\n getKeyWith: <A>(key: string, schema: Schema.ConstraintDecoder<A, never>): Promise<A> =>\n provideSdk(config, getConfigKeyWith(key, schema)),\n readWith: <A>(schema: Schema.ConstraintDecoder<A, never>): Promise<A> =>\n provideSdk(config, readConfigWith(schema)),\n },\n files: {\n ...operations.files,\n createUploadFormData: createFileUploadFormData,\n get: getFileById,\n getChild: getChildByName,\n },\n };\n};\n\nexport type PutioSdkPromiseClient = ReturnType<typeof createPutioSdkPromiseClient>;\n"],"mappings":";;;AAeA,MAAMA,kBAAgB,OAAO,QAAQ,CAAC;AACtC,MAAa,oBAAoB,OAAO,OAAO;CAC7C,OAAO,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;CAC3D,MAAM,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;CAC1D,MAAM,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAC5D,CAAC;AACD,MAAa,wBAAwB,OAAO,OAAO;CACjD,yBAAyB,OAAO,SAAS,OAAO,OAAO;CACvD,2BAA2B,OAAO,SAAS,OAAO,OAAO;AAC3D,CAAC;AACD,MAAM,wBAAwB;CAC5B,WAAW,OAAO;CAClB,cAA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