@putdotio/sdk 18.0.1 → 18.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"forms-BBMvLadC.js","names":[],"sources":["../src/core/errors.ts","../src/core/validation.ts","../src/core/defaults.ts","../src/core/response-body.ts","../src/core/secrets.ts","../src/core/http.ts","../src/core/forms.ts"],"sourcesContent":["import { Data, Effect, Predicate, Schema } from \"effect\";\nimport { dual, flow } from \"effect/Function\";\n\nexport const PutioErrorEnvelopeSchema = Schema.Struct({\n status: Schema.optional(Schema.String),\n error: Schema.optional(Schema.String),\n error_message: Schema.optional(Schema.String),\n error_type: Schema.optional(Schema.String),\n error_uri: Schema.optional(Schema.String),\n error_id: Schema.optional(Schema.NullOr(Schema.String)),\n extra: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n status_code: Schema.optional(Schema.Int),\n details: Schema.optional(Schema.Unknown),\n});\n\nexport type PutioErrorEnvelope = Schema.Schema.Type<typeof PutioErrorEnvelopeSchema>;\n\nexport interface PutioKnownErrorContract<\n TType extends string = string,\n TStatus extends number = number,\n TBody extends PutioErrorEnvelope = PutioErrorEnvelope,\n> {\n readonly bodySchema?: Schema.Schema<TBody> | undefined;\n readonly errorType?: TType | undefined;\n readonly statusCode?: TStatus | undefined;\n}\n\ntype ContractErrorType<TContract extends PutioKnownErrorContract> =\n TContract extends PutioKnownErrorContract<infer TType, number> ? TType : never;\n\ntype ContractStatusCode<TContract extends PutioKnownErrorContract> =\n TContract extends PutioKnownErrorContract<string, infer TStatus> ? TStatus : never;\n\ntype ContractBody<TContract extends PutioKnownErrorContract> = TContract extends {\n readonly bodySchema: Schema.Schema<infer TBody extends PutioErrorEnvelope>;\n}\n ? TBody\n : PutioErrorEnvelope;\n\nexport type PutioTypedErrorEnvelope<TContract extends PutioKnownErrorContract> =\n TContract extends PutioKnownErrorContract\n ? Omit<ContractBody<TContract>, \"error_message\" | \"error_type\" | \"status_code\"> & {\n readonly error_message?: string | undefined;\n readonly error_type?: [ContractErrorType<TContract>] extends [never]\n ? string | undefined\n : ContractErrorType<TContract> | undefined;\n readonly status_code?: [ContractStatusCode<TContract>] extends [never]\n ? number | undefined\n : ContractStatusCode<TContract> | undefined;\n }\n : never;\n\nexport interface PutioOperationErrorSpec<\n TDomain extends string = string,\n TOperation extends string = string,\n TContracts extends ReadonlyArray<PutioKnownErrorContract> =\n ReadonlyArray<PutioKnownErrorContract>,\n> {\n readonly domain: TDomain;\n readonly operation: TOperation;\n readonly knownErrors: TContracts;\n}\n\ntype KnownOperationContractOf<TContracts extends ReadonlyArray<PutioKnownErrorContract>> = Extract<\n TContracts[number],\n PutioKnownOperationErrorContract\n>;\n\ntype PutioOperationErrorReason<TContract extends PutioKnownErrorContract> = TContract extends {\n readonly errorType: infer TType extends string;\n}\n ? {\n readonly kind: \"error_type\";\n readonly errorType: TType;\n }\n : TContract extends { readonly statusCode: infer TStatus extends number }\n ? {\n readonly kind: \"status_code\";\n readonly statusCode: TStatus;\n }\n : never;\n\nexport type PutioKnownOperationErrorContract =\n | {\n readonly errorType: string;\n readonly statusCode?: number;\n }\n | {\n readonly errorType?: undefined;\n readonly statusCode: number;\n };\n\nconst isKnownContractMatch = <TContract extends PutioKnownErrorContract>(\n contract: TContract,\n error: PutioApiError | PutioAuthError,\n): contract is TContract & PutioKnownOperationErrorContract => {\n if (contract.bodySchema !== undefined && !Schema.is(contract.bodySchema)(error.body)) {\n return false;\n }\n\n if (contract.errorType !== undefined) {\n if (error.body.error_type !== contract.errorType) {\n return false;\n }\n\n return contract.statusCode === undefined || error.status === contract.statusCode;\n }\n\n if (contract.statusCode !== undefined) {\n return error.status === contract.statusCode;\n }\n\n return false;\n};\n\nconst isMatchableApiError = (error: PutioSdkError): error is PutioApiError | PutioAuthError =>\n Predicate.isTagged(error, \"PutioApiError\") || Predicate.isTagged(error, \"PutioAuthError\");\n\nconst PutioKnownOperationErrorContractSchema = Schema.Union([\n Schema.Struct({\n errorType: Schema.String,\n statusCode: Schema.optional(Schema.Int),\n }),\n Schema.Struct({\n errorType: Schema.optional(Schema.Undefined),\n statusCode: Schema.Int,\n }),\n]);\n\nconst PutioOperationErrorReasonSchema = Schema.Union([\n Schema.Struct({\n kind: Schema.Literal(\"error_type\"),\n errorType: Schema.String,\n }),\n Schema.Struct({\n kind: Schema.Literal(\"status_code\"),\n statusCode: Schema.Int,\n }),\n]);\n\nconst toOperationReason = (\n contract: PutioKnownOperationErrorContract,\n): PutioOperationErrorReason<PutioKnownOperationErrorContract> => {\n if (contract.errorType !== undefined) {\n return {\n kind: \"error_type\",\n errorType: contract.errorType,\n };\n }\n\n return {\n kind: \"status_code\",\n statusCode: contract.statusCode,\n };\n};\n\nconst CauseErrorFields = {\n cause: Schema.Defect(),\n};\n\nexport class PutioTransportError extends Schema.TaggedError<\n PutioTransportError,\n { readonly brand: unique symbol }\n>()(\"PutioTransportError\", { ...CauseErrorFields }) {}\n\nexport class PutioConfigurationError extends Schema.TaggedError<\n PutioConfigurationError,\n { readonly brand: unique symbol }\n>()(\"PutioConfigurationError\", { ...CauseErrorFields }) {}\n\nexport class PutioValidationError extends Schema.TaggedError<\n PutioValidationError,\n { readonly brand: unique symbol }\n>()(\"PutioValidationError\", { ...CauseErrorFields }) {}\n\nexport class PutioContractError extends Schema.TaggedError<\n PutioContractError,\n { readonly brand: unique symbol }\n>()(\"PutioContractError\", {\n cause: Schema.optional(Schema.Defect()),\n missingField: Schema.optional(Schema.String),\n}) {}\n\nconst RateLimitHeaderFields = {\n action: Schema.optional(Schema.String),\n id: Schema.optional(Schema.String),\n limit: Schema.optional(Schema.String),\n remaining: Schema.optional(Schema.String),\n retryAfter: Schema.optional(Schema.String),\n retryAfterSeconds: Schema.optional(Schema.Finite),\n reset: Schema.optional(Schema.String),\n};\n\nconst PutioResponseErrorFields = {\n status: Schema.Int,\n body: PutioErrorEnvelopeSchema,\n cause: Schema.optional(Schema.Defect()),\n};\n\nexport class PutioApiError extends Schema.TaggedError<\n PutioApiError,\n { readonly brand: unique symbol }\n>()(\"PutioApiError\", {\n ...PutioResponseErrorFields,\n}) {}\n\nexport class PutioAuthError extends Schema.TaggedError<\n PutioAuthError,\n { readonly brand: unique symbol }\n>()(\"PutioAuthError\", {\n ...PutioResponseErrorFields,\n}) {}\n\nexport class PutioRateLimitError extends Schema.TaggedError<\n PutioRateLimitError,\n { readonly brand: unique symbol }\n>()(\"PutioRateLimitError\", { ...PutioResponseErrorFields, ...RateLimitHeaderFields }) {}\n\nexport class PutioOperationError<\n TDomain extends string,\n TOperation extends string,\n TContract extends PutioKnownOperationErrorContract,\n> extends Data.TaggedError(\"PutioOperationError\")<{\n readonly body: PutioTypedErrorEnvelope<TContract>;\n readonly contract: TContract;\n readonly domain: TDomain;\n readonly operation: TOperation;\n readonly reason: PutioOperationErrorReason<TContract>;\n readonly status: number;\n}> {}\n\nexport type PutioSdkError =\n | PutioConfigurationError\n | PutioTransportError\n | PutioValidationError\n | PutioContractError\n | PutioApiError\n | PutioAuthError\n | PutioRateLimitError;\n\nexport type PutioUnhandledSdkError = PutioSdkError;\n\nexport type PutioOperationErrorFromSpec<TSpec extends PutioOperationErrorSpec> =\n PutioOperationError<\n TSpec[\"domain\"],\n TSpec[\"operation\"],\n KnownOperationContractOf<TSpec[\"knownErrors\"]>\n >;\n\nexport type PutioOperationFailure<TSpec extends PutioOperationErrorSpec> =\n | PutioUnhandledSdkError\n | PutioOperationErrorFromSpec<TSpec>;\n\nexport type AnyPutioOperationError = PutioOperationError<\n string,\n string,\n PutioKnownOperationErrorContract\n>;\n\nexport const definePutioOperationErrorSpec = <\n const TDomain extends string,\n const TOperation extends string,\n const TContracts extends ReadonlyArray<PutioKnownErrorContract>,\n>(\n spec: PutioOperationErrorSpec<TDomain, TOperation, TContracts>,\n) => spec;\n\nexport const decodePutioErrorEnvelope = Schema.decodeUnknownEffect(PutioErrorEnvelopeSchema);\n\nconst isPutioErrorEnvelopeValue = Schema.is(PutioErrorEnvelopeSchema);\n\nexport const isPutioErrorEnvelope = (value: unknown): value is PutioErrorEnvelope =>\n isPutioErrorEnvelopeValue(value);\n\nconst PutioOperationErrorValueSchema = Schema.TaggedStruct(\"PutioOperationError\", {\n body: PutioResponseErrorFields.body,\n status: PutioResponseErrorFields.status,\n contract: PutioKnownOperationErrorContractSchema,\n domain: Schema.String,\n operation: Schema.String,\n reason: PutioOperationErrorReasonSchema,\n});\n\nconst CauseErrorValueFields = {\n cause: Schema.optional(Schema.Defect()),\n};\n\nconst PutioTransportErrorValueSchema = Schema.Struct({\n ...PutioTransportError.fields,\n ...CauseErrorValueFields,\n});\n\nconst PutioConfigurationErrorValueSchema = Schema.Struct({\n ...PutioConfigurationError.fields,\n ...CauseErrorValueFields,\n});\n\nconst PutioValidationErrorValueSchema = Schema.Struct({\n ...PutioValidationError.fields,\n ...CauseErrorValueFields,\n});\n\nconst PutioContractErrorValueSchema = Schema.Struct(PutioContractError.fields);\n\nconst PutioApiErrorValueSchema = Schema.Struct(PutioApiError.fields);\n\nconst PutioAuthErrorValueSchema = Schema.Struct(PutioAuthError.fields);\n\nconst PutioRateLimitErrorValueSchema = Schema.Struct(PutioRateLimitError.fields);\n\nexport type PutioTransportErrorValue = typeof PutioTransportErrorValueSchema.Type;\n\nexport type PutioConfigurationErrorValue = typeof PutioConfigurationErrorValueSchema.Type;\n\nexport type PutioValidationErrorValue = typeof PutioValidationErrorValueSchema.Type;\n\nexport type PutioContractErrorValue = typeof PutioContractErrorValueSchema.Type;\n\nexport type PutioApiErrorValue = typeof PutioApiErrorValueSchema.Type;\n\nexport type PutioAuthErrorValue = typeof PutioAuthErrorValueSchema.Type;\n\nexport type PutioRateLimitErrorValue = typeof PutioRateLimitErrorValueSchema.Type;\n\nexport type PutioOperationErrorValue = typeof PutioOperationErrorValueSchema.Type;\n\nexport const isPutioTransportError = Schema.is(PutioTransportErrorValueSchema);\n\nexport const isPutioConfigurationError = Schema.is(PutioConfigurationErrorValueSchema);\n\nexport const isPutioValidationError = Schema.is(PutioValidationErrorValueSchema);\n\nexport const isPutioContractError = Schema.is(PutioContractErrorValueSchema);\n\nexport const isPutioApiError = Schema.is(PutioApiErrorValueSchema);\n\nexport const isPutioAuthError = Schema.is(PutioAuthErrorValueSchema);\n\nexport const isPutioRateLimitError = Schema.is(PutioRateLimitErrorValueSchema);\n\nexport const isPutioOperationError = Schema.is(PutioOperationErrorValueSchema);\n\nexport const fallbackPutioErrorEnvelope = (status: number): PutioErrorEnvelope => ({\n error_message: `put.io API request failed with status ${status}`,\n status_code: status,\n});\n\nconst getHeader = (headers: Headers, name: string): string | undefined =>\n headers.get(name) ?? undefined;\n\nconst deltaSecondsPattern = /^\\d+$/;\n\nconst httpDatePattern =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), \\d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4} \\d{2}:\\d{2}:\\d{2} GMT$/;\n\nconst parseRetryAfterSeconds = (value: string | undefined): number | undefined => {\n const trimmed = value?.trim();\n\n if (trimmed === undefined) {\n return undefined;\n }\n\n if (deltaSecondsPattern.test(trimmed)) {\n const seconds = Number(trimmed);\n\n return Number.isSafeInteger(seconds) ? seconds : undefined;\n }\n\n if (!httpDatePattern.test(trimmed)) {\n return undefined;\n }\n\n const retryAt = Date.parse(trimmed);\n\n return Number.isNaN(retryAt) ? undefined : Math.max(0, Math.ceil((retryAt - Date.now()) / 1000));\n};\n\nexport const responseRateLimitHeaders = (headers: Headers) => {\n const retryAfter = getHeader(headers, \"retry-after\");\n\n return {\n action: getHeader(headers, \"x-ratelimit-action\"),\n id: getHeader(headers, \"x-ratelimit-id\"),\n limit: getHeader(headers, \"x-ratelimit-limit\"),\n remaining: getHeader(headers, \"x-ratelimit-remaining\"),\n retryAfter,\n retryAfterSeconds: parseRetryAfterSeconds(retryAfter),\n reset: getHeader(headers, \"x-ratelimit-reset\"),\n };\n};\n\nexport const mapValidationError = (cause: unknown) => new PutioValidationError({ cause });\n\nexport const mapContractError = (cause: unknown) => new PutioContractError({ cause });\n\nexport const mapConfigurationError = (cause: unknown) => new PutioConfigurationError({ cause });\n\nexport const mapTransportError = (cause: unknown) => new PutioTransportError({ cause });\n\nexport const toPutioResponseError = (\n status: number,\n headers: Headers,\n body: PutioErrorEnvelope,\n cause?: unknown,\n): PutioSdkError => {\n if (status === 429) {\n return new PutioRateLimitError({\n status,\n body,\n ...responseRateLimitHeaders(headers),\n cause,\n });\n }\n\n if (status === 401 || status === 403) {\n return new PutioAuthError({ status, body, cause });\n }\n\n return new PutioApiError({ status, body, cause });\n};\n\nexport const parseErrorBody = (status: number) =>\n flow(\n decodePutioErrorEnvelope,\n Effect.orElseSucceed(() => fallbackPutioErrorEnvelope(status)),\n );\n\nexport const withOperationErrors: {\n <\n const TDomain extends string,\n const TOperation extends string,\n const TContracts extends ReadonlyArray<PutioKnownErrorContract>,\n >(\n spec: PutioOperationErrorSpec<TDomain, TOperation, TContracts>,\n ): <A, E extends PutioSdkError, R>(\n effect: Effect.Effect<A, E, R>,\n ) => Effect.Effect<\n A,\n E | PutioOperationError<TDomain, TOperation, KnownOperationContractOf<TContracts>>,\n R\n >;\n <\n A,\n E extends PutioSdkError,\n R,\n const TDomain extends string,\n const TOperation extends string,\n const TContracts extends ReadonlyArray<PutioKnownErrorContract>,\n >(\n effect: Effect.Effect<A, E, R>,\n spec: PutioOperationErrorSpec<TDomain, TOperation, TContracts>,\n ): Effect.Effect<\n A,\n E | PutioOperationError<TDomain, TOperation, KnownOperationContractOf<TContracts>>,\n R\n >;\n} = dual(\n 2,\n <A, E extends PutioSdkError, R>(\n effect: Effect.Effect<A, E, R>,\n spec: PutioOperationErrorSpec,\n ): Effect.Effect<A, E | AnyPutioOperationError, R> =>\n effect.pipe(\n Effect.mapError((error) => {\n if (!isMatchableApiError(error)) {\n return error;\n }\n\n const contract = spec.knownErrors.find((candidate) =>\n isKnownContractMatch(candidate, error),\n );\n\n if (!contract) {\n return error;\n }\n\n return new PutioOperationError({\n body: error.body,\n contract,\n domain: spec.domain,\n operation: spec.operation,\n reason: toOperationReason(contract),\n status: error.status,\n });\n }),\n ),\n);\n","import { Effect, Schema } from \"effect\";\n\nimport { mapValidationError, PutioContractError, PutioValidationError } from \"./errors.js\";\n\nexport const PositiveIntegerSchema = Schema.Int.check(Schema.isGreaterThan(0));\nexport const NonEmptyStringSchema = Schema.String.check(Schema.isMinLength(1));\nexport const NonNegativeNumberSchema = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));\n\nexport const decodeAndRun = <S extends Schema.Top, A, E, R>(\n schema: S,\n input: S[\"Encoded\"],\n run: (decoded: S[\"Type\"]) => Effect.Effect<A, E, R>,\n) =>\n Schema.decodeUnknownEffect(schema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapValidationError),\n Effect.flatMap(run),\n );\n\nexport const decodeAndRunRedacted =\n (domain: string, operation: string) =>\n <S extends Schema.Top, A, E, R>(\n schema: S,\n input: S[\"Encoded\"],\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: { domain, operation, reason: \"Invalid request input\" },\n }),\n ),\n Effect.flatMap(run),\n );\n\nexport const failMissingField = (field: string): Effect.Effect<never, PutioContractError> =>\n Effect.fail(new PutioContractError({ missingField: field }));\n\nexport const requireRequestedBreadcrumbs =\n (query: { readonly breadcrumbs?: 1 | undefined }) =>\n <A extends { readonly breadcrumbs?: unknown }, E, R>(\n effect: Effect.Effect<A, E, R>,\n ): Effect.Effect<A, E | PutioContractError, R> =>\n effect.pipe(\n Effect.filterOrElse(\n (response) => query.breadcrumbs !== 1 || response.breadcrumbs !== undefined,\n () => failMissingField(\"breadcrumbs\"),\n ),\n );\n\ntype CursorOrIdsSelection = {\n readonly cursor?: string | undefined;\n readonly ids?: ReadonlyArray<number> | undefined;\n};\n\nexport type CursorSelection<TFields extends CursorOrIdsSelection> =\n | (TFields & { readonly cursor: string })\n | (TFields & { readonly ids: ReadonlyArray<number> });\n\nexport const cursorSelectionSchema = <const TFields extends Schema.Struct.Fields>(\n fields: TFields,\n) =>\n 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 ...fields,\n }).check(\n Schema.makeFilter(\n (input: CursorOrIdsSelection) => input.cursor !== undefined || input.ids !== undefined,\n { expected: \"a non-empty cursor or file ID selection\" },\n ),\n );\n","export const DEFAULT_PUTIO_API_BASE_URL = \"https://api.put.io\";\nexport const DEFAULT_PUTIO_UPLOAD_BASE_URL = \"https://upload.put.io\";\nexport const DEFAULT_PUTIO_WEB_APP_URL = \"https://app.put.io\";\n","import {\n fallbackPutioErrorEnvelope,\n mapContractError,\n type PutioSdkError,\n toPutioResponseError,\n} from \"./errors.js\";\n\nexport const isSuccessStatus = (status: number) => status >= 200 && status < 300;\n\nexport const unparsableJsonBodyError = (status: number, headers: Headers): PutioSdkError =>\n isSuccessStatus(status)\n ? mapContractError(new SyntaxError(\"The HTTP response body is not valid JSON\"))\n : toPutioResponseError(\n status,\n headers,\n fallbackPutioErrorEnvelope(status),\n new SyntaxError(\"The HTTP error response body is not valid JSON\"),\n );\n","import { Effect, Predicate, Redacted } from \"effect\";\n\nimport { mapConfigurationError, type PutioConfigurationError } from \"./errors.js\";\n\nexport const revealSecret = (\n secret: string | Redacted.Redacted<string>,\n): Effect.Effect<string, PutioConfigurationError> =>\n Predicate.isString(secret)\n ? Effect.succeed(secret)\n : Effect.try({\n try: () => Redacted.value(secret),\n catch: mapConfigurationError,\n });\n\nexport const revealAccessToken = (\n accessToken: Redacted.Redacted<string> | undefined,\n): Effect.Effect<string | undefined, PutioConfigurationError> =>\n accessToken === undefined\n ? Effect.undefined\n : revealSecret(accessToken).pipe(Effect.map((token) => (token === \"\" ? undefined : token)));\n","import { Context, Effect, Layer, Predicate, Redacted, Schema, Struct } from \"effect\";\n\nimport {\n DEFAULT_PUTIO_API_BASE_URL,\n DEFAULT_PUTIO_UPLOAD_BASE_URL,\n DEFAULT_PUTIO_WEB_APP_URL,\n} from \"./defaults.js\";\nimport {\n mapConfigurationError,\n mapContractError,\n mapTransportError,\n mapValidationError,\n parseErrorBody,\n PutioConfigurationError,\n type PutioSdkError,\n PutioValidationError,\n toPutioResponseError,\n} from \"./errors.js\";\nimport { isSuccessStatus, unparsableJsonBodyError } from \"./response-body.js\";\nimport { revealAccessToken, revealSecret } from \"./secrets.js\";\n\nexport type PutioQueryValue = string | number | boolean | null | undefined;\n\nexport type PutioQuery = Readonly<Record<string, PutioQueryValue>>;\n\nexport type PutioPathSegment = string | number | boolean;\n\nexport type PutioSecret = string | Redacted.Redacted<string>;\n\nexport interface PutioSdkOptions {\n readonly accessToken?: PutioSecret | undefined;\n readonly baseUrl?: string | URL | undefined;\n readonly headers?: HeadersInit | undefined;\n readonly uploadBaseUrl?: string | URL | undefined;\n readonly webAppUrl?: string | URL | undefined;\n}\n\nexport interface PutioSdkResolvedConfig {\n readonly accessToken: Redacted.Redacted<string> | undefined;\n readonly baseUrl: string | URL;\n readonly headers: HeadersInit | undefined;\n readonly uploadBaseUrl: string | URL;\n readonly webAppUrl: string | URL;\n}\n\nexport class PutioSdkConfig extends Context.Service<PutioSdkConfig, PutioSdkResolvedConfig>()(\n \"@putdotio/sdk/PutioSdkConfig\",\n) {}\n\nexport interface PutioHttpRequest {\n readonly body?: BodyInit;\n readonly headers: Headers;\n readonly method: PutioRequestMethod;\n readonly url: string;\n}\n\nexport interface PutioHttpResponse {\n readonly arrayBuffer: Effect.Effect<ArrayBuffer, PutioSdkError>;\n readonly headers: Headers;\n readonly json: Effect.Effect<unknown, PutioSdkError>;\n readonly status: number;\n}\n\nexport interface PutioHttpClientService {\n readonly execute: (request: PutioHttpRequest) => Effect.Effect<PutioHttpResponse, PutioSdkError>;\n}\n\nexport class PutioHttpClient extends Context.Service<PutioHttpClient, PutioHttpClientService>()(\n \"@putdotio/sdk/PutioHttpClient\",\n) {}\n\nexport type PutioSdkContext = PutioSdkConfig | PutioHttpClient;\n\nconst redactPutioSecret = (\n secret: PutioSecret | undefined,\n): Redacted.Redacted<string> | undefined => {\n if (secret === undefined) {\n return undefined;\n }\n\n if (Predicate.isString(secret)) {\n return secret === \"\" ? undefined : Redacted.make(secret);\n }\n\n return secret;\n};\n\nexport const normalizePutioSdkOptions = (config: PutioSdkOptions): PutioSdkResolvedConfig => ({\n accessToken: redactPutioSecret(config.accessToken),\n baseUrl: config.baseUrl ?? DEFAULT_PUTIO_API_BASE_URL,\n headers: config.headers,\n uploadBaseUrl: config.uploadBaseUrl ?? DEFAULT_PUTIO_UPLOAD_BASE_URL,\n webAppUrl: config.webAppUrl ?? DEFAULT_PUTIO_WEB_APP_URL,\n});\n\nexport const putioSdkLayer = (config: PutioSdkOptions) =>\n Layer.succeed(PutioSdkConfig, normalizePutioSdkOptions(config));\n\nexport const putioSdkLiveLayer = (config: PutioSdkOptions) =>\n Layer.mergeAll(putioSdkLayer(config), makePutioFetchLayer());\n\nexport const makePutioFetchLayer = (\n fetchImplementation: typeof globalThis.fetch = globalThis.fetch,\n) => Layer.succeed(PutioHttpClient, makePutioFetchClient(fetchImplementation));\n\nconst decodeJsonText = Schema.decodeEffect(Schema.fromJsonString(Schema.Unknown));\n\nexport const makePutioFetchClient = (\n fetchImplementation: typeof globalThis.fetch = globalThis.fetch,\n): PutioHttpClientService => ({\n execute: (request) =>\n Effect.suspend(() => {\n const controller = new AbortController();\n\n const read = <A>(body: () => Promise<A>) =>\n Effect.tryPromise({ try: body, catch: mapTransportError }).pipe(\n Effect.onInterrupt(() => Effect.sync(() => controller.abort())),\n );\n\n return read(async () => {\n const response = await fetchImplementation(request.url, {\n body: request.body ?? null,\n headers: request.headers,\n method: request.method,\n signal: controller.signal,\n });\n\n return {\n arrayBuffer: read(() => response.arrayBuffer()),\n headers: response.headers,\n json: read(() => response.text()).pipe(\n Effect.flatMap((text) =>\n decodeJsonText(text).pipe(\n Effect.mapError(() => unparsableJsonBodyError(response.status, response.headers)),\n ),\n ),\n ),\n status: response.status,\n };\n });\n }),\n});\n\nexport const encodePathSegment = (value: PutioPathSegment): string =>\n encodeURIComponent(String(value));\n\nconst absoluteUrlPattern = /^(?:[a-z][a-z\\d+.-]*:|\\/\\/)/i;\n\nconst dotSegmentPattern = /^(?:\\.|%2e){1,2}$/i;\n\nconst parserRewrittenPattern = /[\\\\\\p{Cc}]|^ | $/u;\n\nconst normalizeApiPath = (path: string): string => {\n if (absoluteUrlPattern.test(path)) {\n throw mapConfigurationError(\"SDK API request paths must be relative to the configured baseUrl\");\n }\n\n if (parserRewrittenPattern.test(path)) {\n throw mapValidationError(\n \"SDK API request paths must not contain backslashes, control characters, or edge spaces\",\n );\n }\n\n const [pathname = \"\"] = path.split(/[?#]/, 1);\n\n if (pathname.split(\"/\").some((segment) => dotSegmentPattern.test(segment))) {\n throw mapValidationError(\"SDK API request paths must not contain dot segments\");\n }\n\n return path.startsWith(\"/\") ? path : `/${path}`;\n};\n\nexport const buildPutioUrl = (baseUrl: string | URL, path: string, query?: PutioQuery): string => {\n const url = new URL(normalizeApiPath(path), baseUrl);\n\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined && value !== null) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n return url.toString();\n};\n\nconst mapUrlBuildError = (cause: unknown) =>\n cause instanceof PutioConfigurationError || cause instanceof PutioValidationError\n ? cause\n : mapConfigurationError(cause);\n\nexport const OkResponseSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n});\n\nexport type PutioAuth =\n | { readonly type: \"config-token\" }\n | { readonly type: \"token\"; readonly token: PutioSecret }\n | { readonly type: \"basic\"; readonly username: string; readonly password: PutioSecret }\n | { readonly type: \"none\" };\n\ntype PutioRequestMethod = \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n\ntype PutioFormValue = Exclude<Schema.Json, boolean>;\n\ntype PutioRequestBody =\n | { readonly type: \"none\" }\n | { readonly type: \"json\"; readonly value: unknown }\n | { readonly type: \"form\"; readonly value: Readonly<Record<string, PutioFormValue | undefined>> }\n | { readonly type: \"form-data\"; readonly value: FormData };\n\ninterface PutioRequestOptions {\n readonly method: PutioRequestMethod;\n readonly path: string;\n readonly baseUrl?: string | URL | undefined;\n readonly query?: PutioQuery | undefined;\n readonly headers?: HeadersInit | undefined;\n readonly auth?: PutioAuth | undefined;\n readonly body?: PutioRequestBody | undefined;\n}\n\nconst decodeSuccessJson = <S extends Schema.Top>(schema: S, response: PutioHttpResponse) =>\n response.json.pipe(\n Effect.flatMap((json) =>\n Schema.decodeUnknownEffect(schema)(json).pipe(Effect.mapError(mapContractError)),\n ),\n );\n\nconst decodeFailure = (response: PutioHttpResponse, headers: Headers) =>\n response.json.pipe(\n Effect.flatMap(parseErrorBody(response.status)),\n Effect.map((body) => toPutioResponseError(response.status, headers, body)),\n );\n\nconst resolveAuthorization = (\n config: PutioSdkResolvedConfig,\n auth: PutioAuth | undefined,\n): Effect.Effect<string | undefined, PutioSdkError> => {\n const resolvedAuth = auth ?? { type: \"config-token\" as const };\n\n switch (resolvedAuth.type) {\n case \"none\":\n return Effect.undefined;\n case \"token\":\n return revealSecret(resolvedAuth.token).pipe(Effect.map((token) => `Token ${token}`));\n case \"basic\":\n return revealSecret(resolvedAuth.password).pipe(\n Effect.flatMap((password) =>\n Effect.try({\n try: () => `Basic ${btoa(`${resolvedAuth.username}:${password}`)}`,\n catch: mapConfigurationError,\n }),\n ),\n );\n case \"config-token\":\n return revealAccessToken(config.accessToken).pipe(\n Effect.flatMap((token) =>\n token === undefined\n ? Effect.fail(\n mapConfigurationError(\n \"This endpoint requires an access token, but PutioSdkConfig.accessToken is missing\",\n ),\n )\n : Effect.succeed(`Token ${token}`),\n ),\n );\n }\n};\n\nconst normalizeFormValue = (value: PutioFormValue): string => {\n if (value === null) {\n return \"\";\n }\n\n if (Predicate.isString(value)) {\n return value;\n }\n\n if (Predicate.isNumber(value)) {\n return String(value);\n }\n\n return JSON.stringify(value);\n};\n\nconst withBody = (body: PutioRequestBody): Effect.Effect<BodyInit | undefined, PutioSdkError> => {\n switch (body.type) {\n case \"none\":\n return Effect.undefined;\n case \"json\":\n return Effect.try({\n try: () => JSON.stringify(body.value),\n catch: mapValidationError,\n });\n case \"form\":\n return Effect.succeed(\n new URLSearchParams(\n Object.entries(body.value).flatMap(([key, value]) =>\n value === undefined ? [] : [[key, normalizeFormValue(value)]],\n ),\n ),\n );\n case \"form-data\":\n return Effect.succeed(body.value);\n }\n};\n\nconst buildRequestHeaders = (\n requestHeaders: HeadersInit | undefined,\n configHeaders: HeadersInit | undefined,\n authorization: string | undefined,\n bodyType: PutioRequestBody[\"type\"] | \"none\",\n): Headers => {\n const headers = new Headers(configHeaders);\n headers.delete(\"authorization\");\n new Headers(requestHeaders).forEach((value, name) => headers.set(name, value));\n\n if (!headers.has(\"accept\")) {\n headers.set(\"accept\", \"application/json\");\n }\n\n if (authorization) {\n headers.set(\"authorization\", authorization);\n }\n\n if (bodyType === \"json\" && !headers.has(\"content-type\")) {\n headers.set(\"content-type\", \"application/json\");\n }\n\n return headers;\n};\n\nconst makeRequest = Effect.fnUntraced(function* (\n url: string,\n options: PutioRequestOptions,\n configHeaders: HeadersInit | undefined,\n authorization?: string,\n) {\n const body = options.body ?? { type: \"none\" as const };\n\n const headers = yield* Effect.try({\n try: () => buildRequestHeaders(options.headers, configHeaders, authorization, body.type),\n catch: () => mapConfigurationError(\"SDK request headers must be valid HTTP header values\"),\n });\n\n const requestBody = yield* withBody(body);\n\n const request: PutioHttpRequest = { headers, method: options.method, url };\n\n return requestBody === undefined ? request : { ...request, body: requestBody };\n});\n\nconst executeRequest = Effect.fn(\"PutioSdk.executeRequest\")(function* (\n options: PutioRequestOptions,\n) {\n yield* Effect.annotateCurrentSpan(\"http.request.method\", options.method);\n\n const config = yield* PutioSdkConfig;\n const httpClient = yield* PutioHttpClient;\n const authorization = yield* resolveAuthorization(config, options.auth);\n\n const url = yield* Effect.try({\n try: () => buildPutioUrl(options.baseUrl ?? config.baseUrl, options.path, options.query),\n catch: mapUrlBuildError,\n });\n\n const request = yield* makeRequest(url, options, config.headers, authorization);\n\n return yield* httpClient.execute(request);\n});\n\nexport const requestJson = <S extends Schema.Top>(\n schema: S,\n options: PutioRequestOptions,\n): Effect.Effect<S[\"Type\"], PutioSdkError, PutioSdkContext | S[\"DecodingServices\"]> =>\n executeRequest(options).pipe(\n Effect.flatMap((response) =>\n isSuccessStatus(response.status)\n ? decodeSuccessJson(schema, response)\n : decodeFailure(response, response.headers).pipe(Effect.flatMap(Effect.fail)),\n ),\n );\n\nexport const selectJsonField =\n <K extends string>(field: K) =>\n <A extends { readonly [P in K]: unknown }, E, R>(\n effect: Effect.Effect<A, E, R>,\n ): Effect.Effect<A[K], E, R> =>\n effect.pipe(Effect.map((value) => value[field]));\n\nexport const selectJsonFields =\n <const K extends readonly string[]>(...fields: K) =>\n <A extends { readonly [P in K[number]]: unknown }, E, R>(\n effect: Effect.Effect<A, E, R>,\n ): Effect.Effect<Pick<A, K[number]>, E, R> =>\n effect.pipe(Effect.map((value) => Struct.pick(value, fields)));\n\nexport const requestArrayBuffer = (\n options: PutioRequestOptions,\n): Effect.Effect<Uint8Array, PutioSdkError, PutioSdkContext> =>\n executeRequest(options).pipe(\n Effect.flatMap((response) =>\n isSuccessStatus(response.status)\n ? response.arrayBuffer.pipe(Effect.map((buffer) => new Uint8Array(buffer)))\n : decodeFailure(response, response.headers).pipe(Effect.flatMap(Effect.fail)),\n ),\n );\n\nexport const requestText = (\n options: PutioRequestOptions,\n): Effect.Effect<string, PutioSdkError, PutioSdkContext> =>\n requestArrayBuffer(options).pipe(Effect.map((bytes) => new TextDecoder().decode(bytes)));\n\nexport const requestVoid = (\n options: PutioRequestOptions,\n): Effect.Effect<void, PutioSdkError, PutioSdkContext> =>\n executeRequest(options).pipe(\n Effect.flatMap((response) =>\n isSuccessStatus(response.status)\n ? Effect.ignore(response.arrayBuffer)\n : decodeFailure(response, response.headers).pipe(Effect.flatMap(Effect.fail)),\n ),\n );\n","type CsvValue = string | number;\n\nexport interface CursorSelectionInput<TValue extends CsvValue = number> {\n readonly cursor?: string | undefined;\n readonly excludeIds?: ReadonlyArray<TValue> | undefined;\n readonly ids?: ReadonlyArray<TValue> | undefined;\n}\n\nexport const joinCsv = <TValue extends CsvValue>(\n values: ReadonlyArray<TValue> | undefined,\n): string | undefined => (values && values.length > 0 ? values.join(\",\") : undefined);\n\ntype CursorSelectionForm<TIdsFieldName extends string> = {\n readonly cursor?: string | undefined;\n readonly exclude_ids?: string | undefined;\n} & Record<TIdsFieldName, string | undefined>;\n\nexport function toCursorSelectionForm<TValue extends CsvValue>(\n selection: CursorSelectionInput<TValue>,\n): CursorSelectionForm<\"file_ids\">;\nexport function toCursorSelectionForm<TValue extends CsvValue, const TIdsFieldName extends string>(\n selection: CursorSelectionInput<TValue>,\n idsFieldName: TIdsFieldName,\n): CursorSelectionForm<TIdsFieldName>;\nexport function toCursorSelectionForm(\n selection: CursorSelectionInput<CsvValue>,\n idsFieldName = \"file_ids\",\n): CursorSelectionForm<string> {\n return {\n cursor: selection.cursor,\n exclude_ids: joinCsv(selection.excludeIds),\n [idsFieldName]: joinCsv(selection.ids),\n };\n}\n"],"mappings":";;;AAGA,MAAa,2BAA2B,OAAO,OAAO;CACpD,QAAQ,OAAO,SAAS,OAAO,MAAM;CACrC,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,eAAe,OAAO,SAAS,OAAO,MAAM;CAC5C,YAAY,OAAO,SAAS,OAAO,MAAM;CACzC,WAAW,OAAO,SAAS,OAAO,MAAM;CACxC,UAAU,OAAO,SAAS,OAAO,OAAO,OAAO,MAAM,CAAC;CACtD,OAAO,OAAO,SAAS,OAAO,OAAO,OAAO,QAAQ,OAAO,OAA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,eAAe,QAAQ,UAAU,GAAG;CACvC;AACF"}
1
+ {"version":3,"file":"forms-BBMvLadC.js","names":[],"sources":["../src/core/errors.ts","../src/core/validation.ts","../src/core/defaults.ts","../src/core/response-body.ts","../src/core/secrets.ts","../src/core/http.ts","../src/core/forms.ts"],"sourcesContent":["import { Data, Effect, Predicate, Schema } from \"effect\";\nimport { dual, flow } from \"effect/Function\";\n\nexport const PutioErrorEnvelopeSchema = Schema.Struct({\n status: Schema.optional(Schema.String),\n error: Schema.optional(Schema.String),\n error_message: Schema.optional(Schema.String),\n error_type: Schema.optional(Schema.String),\n error_uri: Schema.optional(Schema.String),\n error_id: Schema.optional(Schema.NullOr(Schema.String)),\n extra: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n status_code: Schema.optional(Schema.Int),\n details: Schema.optional(Schema.Unknown),\n});\n\nexport type PutioErrorEnvelope = Schema.Schema.Type<typeof PutioErrorEnvelopeSchema>;\n\nexport interface PutioKnownErrorContract<\n TType extends string = string,\n TStatus extends number = number,\n TBody extends PutioErrorEnvelope = PutioErrorEnvelope,\n> {\n readonly bodySchema?: Schema.Schema<TBody> | undefined;\n readonly errorType?: TType | undefined;\n readonly statusCode?: TStatus | undefined;\n}\n\ntype ContractErrorType<TContract extends PutioKnownErrorContract> =\n TContract extends PutioKnownErrorContract<infer TType, number> ? TType : never;\n\ntype ContractStatusCode<TContract extends PutioKnownErrorContract> =\n TContract extends PutioKnownErrorContract<string, infer TStatus> ? TStatus : never;\n\ntype ContractBody<TContract extends PutioKnownErrorContract> = TContract extends {\n readonly bodySchema: Schema.Schema<infer TBody extends PutioErrorEnvelope>;\n}\n ? TBody\n : PutioErrorEnvelope;\n\nexport type PutioTypedErrorEnvelope<TContract extends PutioKnownErrorContract> =\n TContract extends PutioKnownErrorContract\n ? Omit<ContractBody<TContract>, \"error_message\" | \"error_type\" | \"status_code\"> & {\n readonly error_message?: string | undefined;\n readonly error_type?: [ContractErrorType<TContract>] extends [never]\n ? string | undefined\n : ContractErrorType<TContract> | undefined;\n readonly status_code?: [ContractStatusCode<TContract>] extends [never]\n ? number | undefined\n : ContractStatusCode<TContract> | undefined;\n }\n : never;\n\nexport interface PutioOperationErrorSpec<\n TDomain extends string = string,\n TOperation extends string = string,\n TContracts extends ReadonlyArray<PutioKnownErrorContract> =\n ReadonlyArray<PutioKnownErrorContract>,\n> {\n readonly domain: TDomain;\n readonly operation: TOperation;\n readonly knownErrors: TContracts;\n}\n\ntype KnownOperationContractOf<TContracts extends ReadonlyArray<PutioKnownErrorContract>> = Extract<\n TContracts[number],\n PutioKnownOperationErrorContract\n>;\n\ntype PutioOperationErrorReason<TContract extends PutioKnownErrorContract> = TContract extends {\n readonly errorType: infer TType extends string;\n}\n ? {\n readonly kind: \"error_type\";\n readonly errorType: TType;\n }\n : TContract extends { readonly statusCode: infer TStatus extends number }\n ? {\n readonly kind: \"status_code\";\n readonly statusCode: TStatus;\n }\n : never;\n\nexport type PutioKnownOperationErrorContract =\n | {\n readonly errorType: string;\n readonly statusCode?: number;\n }\n | {\n readonly errorType?: undefined;\n readonly statusCode: number;\n };\n\nconst isKnownContractMatch = <TContract extends PutioKnownErrorContract>(\n contract: TContract,\n error: PutioApiError | PutioAuthError,\n): contract is TContract & PutioKnownOperationErrorContract => {\n if (contract.bodySchema !== undefined && !Schema.is(contract.bodySchema)(error.body)) {\n return false;\n }\n\n if (contract.errorType !== undefined) {\n if (error.body.error_type !== contract.errorType) {\n return false;\n }\n\n return contract.statusCode === undefined || error.status === contract.statusCode;\n }\n\n if (contract.statusCode !== undefined) {\n return error.status === contract.statusCode;\n }\n\n return false;\n};\n\nconst isMatchableApiError = (error: PutioSdkError): error is PutioApiError | PutioAuthError =>\n Predicate.isTagged(error, \"PutioApiError\") || Predicate.isTagged(error, \"PutioAuthError\");\n\nconst PutioKnownOperationErrorContractSchema = Schema.Union([\n Schema.Struct({\n errorType: Schema.String,\n statusCode: Schema.optional(Schema.Int),\n }),\n Schema.Struct({\n errorType: Schema.optional(Schema.Undefined),\n statusCode: Schema.Int,\n }),\n]);\n\nconst PutioOperationErrorReasonSchema = Schema.Union([\n Schema.Struct({\n kind: Schema.Literal(\"error_type\"),\n errorType: Schema.String,\n }),\n Schema.Struct({\n kind: Schema.Literal(\"status_code\"),\n statusCode: Schema.Int,\n }),\n]);\n\nconst toOperationReason = (\n contract: PutioKnownOperationErrorContract,\n): PutioOperationErrorReason<PutioKnownOperationErrorContract> => {\n if (contract.errorType !== undefined) {\n return {\n kind: \"error_type\",\n errorType: contract.errorType,\n };\n }\n\n return {\n kind: \"status_code\",\n statusCode: contract.statusCode,\n };\n};\n\nconst CauseErrorFields = {\n cause: Schema.Defect(),\n};\n\nexport class PutioTransportError extends Schema.TaggedError<\n PutioTransportError,\n { readonly brand: unique symbol }\n>()(\"PutioTransportError\", { ...CauseErrorFields }) {}\n\nexport class PutioConfigurationError extends Schema.TaggedError<\n PutioConfigurationError,\n { readonly brand: unique symbol }\n>()(\"PutioConfigurationError\", { ...CauseErrorFields }) {}\n\nexport class PutioValidationError extends Schema.TaggedError<\n PutioValidationError,\n { readonly brand: unique symbol }\n>()(\"PutioValidationError\", { ...CauseErrorFields }) {}\n\nexport class PutioContractError extends Schema.TaggedError<\n PutioContractError,\n { readonly brand: unique symbol }\n>()(\"PutioContractError\", {\n cause: Schema.optional(Schema.Defect()),\n missingField: Schema.optional(Schema.String),\n}) {}\n\nconst RateLimitHeaderFields = {\n action: Schema.optional(Schema.String),\n id: Schema.optional(Schema.String),\n limit: Schema.optional(Schema.String),\n remaining: Schema.optional(Schema.String),\n retryAfter: Schema.optional(Schema.String),\n retryAfterSeconds: Schema.optional(Schema.Finite),\n reset: Schema.optional(Schema.String),\n};\n\nconst PutioResponseErrorFields = {\n status: Schema.Int,\n body: PutioErrorEnvelopeSchema,\n cause: Schema.optional(Schema.Defect()),\n};\n\nexport class PutioApiError extends Schema.TaggedError<\n PutioApiError,\n { readonly brand: unique symbol }\n>()(\"PutioApiError\", {\n ...PutioResponseErrorFields,\n}) {}\n\nexport class PutioAuthError extends Schema.TaggedError<\n PutioAuthError,\n { readonly brand: unique symbol }\n>()(\"PutioAuthError\", {\n ...PutioResponseErrorFields,\n}) {}\n\nexport class PutioRateLimitError extends Schema.TaggedError<\n PutioRateLimitError,\n { readonly brand: unique symbol }\n>()(\"PutioRateLimitError\", { ...PutioResponseErrorFields, ...RateLimitHeaderFields }) {}\n\nexport class PutioOperationError<\n TDomain extends string,\n TOperation extends string,\n TContract extends PutioKnownOperationErrorContract,\n> extends Data.TaggedError(\"PutioOperationError\")<{\n readonly body: PutioTypedErrorEnvelope<TContract>;\n readonly contract: TContract;\n readonly domain: TDomain;\n readonly operation: TOperation;\n readonly reason: PutioOperationErrorReason<TContract>;\n readonly status: number;\n}> {}\n\nexport type PutioSdkError =\n | PutioConfigurationError\n | PutioTransportError\n | PutioValidationError\n | PutioContractError\n | PutioApiError\n | PutioAuthError\n | PutioRateLimitError;\n\nexport type PutioUnhandledSdkError = PutioSdkError;\n\nexport type PutioOperationErrorFromSpec<TSpec extends PutioOperationErrorSpec> =\n PutioOperationError<\n TSpec[\"domain\"],\n TSpec[\"operation\"],\n KnownOperationContractOf<TSpec[\"knownErrors\"]>\n >;\n\nexport type PutioOperationFailure<TSpec extends PutioOperationErrorSpec> =\n | PutioUnhandledSdkError\n | PutioOperationErrorFromSpec<TSpec>;\n\nexport type AnyPutioOperationError = PutioOperationError<\n string,\n string,\n PutioKnownOperationErrorContract\n>;\n\nexport const definePutioOperationErrorSpec = <\n const TDomain extends string,\n const TOperation extends string,\n const TContracts extends ReadonlyArray<PutioKnownErrorContract>,\n>(\n spec: PutioOperationErrorSpec<TDomain, TOperation, TContracts>,\n) => spec;\n\nexport const decodePutioErrorEnvelope = Schema.decodeUnknownEffect(PutioErrorEnvelopeSchema);\n\nconst isPutioErrorEnvelopeValue = Schema.is(PutioErrorEnvelopeSchema);\n\nexport const isPutioErrorEnvelope = (value: unknown): value is PutioErrorEnvelope =>\n isPutioErrorEnvelopeValue(value);\n\nconst PutioOperationErrorValueSchema = Schema.TaggedStruct(\"PutioOperationError\", {\n body: PutioResponseErrorFields.body,\n status: PutioResponseErrorFields.status,\n contract: PutioKnownOperationErrorContractSchema,\n domain: Schema.String,\n operation: Schema.String,\n reason: PutioOperationErrorReasonSchema,\n});\n\nconst CauseErrorValueFields = {\n cause: Schema.optional(Schema.Defect()),\n};\n\nconst PutioTransportErrorValueSchema = Schema.Struct({\n ...PutioTransportError.fields,\n ...CauseErrorValueFields,\n});\n\nconst PutioConfigurationErrorValueSchema = Schema.Struct({\n ...PutioConfigurationError.fields,\n ...CauseErrorValueFields,\n});\n\nconst PutioValidationErrorValueSchema = Schema.Struct({\n ...PutioValidationError.fields,\n ...CauseErrorValueFields,\n});\n\nconst PutioContractErrorValueSchema = Schema.Struct(PutioContractError.fields);\n\nconst PutioApiErrorValueSchema = Schema.Struct(PutioApiError.fields);\n\nconst PutioAuthErrorValueSchema = Schema.Struct(PutioAuthError.fields);\n\nconst PutioRateLimitErrorValueSchema = Schema.Struct(PutioRateLimitError.fields);\n\nexport type PutioTransportErrorValue = typeof PutioTransportErrorValueSchema.Type;\n\nexport type PutioConfigurationErrorValue = typeof PutioConfigurationErrorValueSchema.Type;\n\nexport type PutioValidationErrorValue = typeof PutioValidationErrorValueSchema.Type;\n\nexport type PutioContractErrorValue = typeof PutioContractErrorValueSchema.Type;\n\nexport type PutioApiErrorValue = typeof PutioApiErrorValueSchema.Type;\n\nexport type PutioAuthErrorValue = typeof PutioAuthErrorValueSchema.Type;\n\nexport type PutioRateLimitErrorValue = typeof PutioRateLimitErrorValueSchema.Type;\n\nexport type PutioOperationErrorValue = typeof PutioOperationErrorValueSchema.Type;\n\nexport const isPutioTransportError = Schema.is(PutioTransportErrorValueSchema);\n\nexport const isPutioConfigurationError = Schema.is(PutioConfigurationErrorValueSchema);\n\nexport const isPutioValidationError = Schema.is(PutioValidationErrorValueSchema);\n\nexport const isPutioContractError = Schema.is(PutioContractErrorValueSchema);\n\nexport const isPutioApiError = Schema.is(PutioApiErrorValueSchema);\n\nexport const isPutioAuthError = Schema.is(PutioAuthErrorValueSchema);\n\nexport const isPutioRateLimitError = Schema.is(PutioRateLimitErrorValueSchema);\n\nexport const isPutioOperationError = Schema.is(PutioOperationErrorValueSchema);\n\nexport const fallbackPutioErrorEnvelope = (status: number): PutioErrorEnvelope => ({\n error_message: `put.io API request failed with status ${status}`,\n status_code: status,\n});\n\nconst getHeader = (headers: Headers, name: string): string | undefined =>\n headers.get(name) ?? undefined;\n\nconst deltaSecondsPattern = /^\\d+$/;\n\nconst httpDatePattern =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), \\d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4} \\d{2}:\\d{2}:\\d{2} GMT$/;\n\nconst parseRetryAfterSeconds = (value: string | undefined): number | undefined => {\n const trimmed = value?.trim();\n\n if (trimmed === undefined) {\n return undefined;\n }\n\n if (deltaSecondsPattern.test(trimmed)) {\n const seconds = Number(trimmed);\n\n return Number.isSafeInteger(seconds) ? seconds : undefined;\n }\n\n if (!httpDatePattern.test(trimmed)) {\n return undefined;\n }\n\n const retryAt = Date.parse(trimmed);\n\n return Number.isNaN(retryAt) ? undefined : Math.max(0, Math.ceil((retryAt - Date.now()) / 1000));\n};\n\nexport const responseRateLimitHeaders = (headers: Headers) => {\n const retryAfter = getHeader(headers, \"retry-after\");\n\n return {\n action: getHeader(headers, \"x-ratelimit-action\"),\n id: getHeader(headers, \"x-ratelimit-id\"),\n limit: getHeader(headers, \"x-ratelimit-limit\"),\n remaining: getHeader(headers, \"x-ratelimit-remaining\"),\n retryAfter,\n retryAfterSeconds: parseRetryAfterSeconds(retryAfter),\n reset: getHeader(headers, \"x-ratelimit-reset\"),\n };\n};\n\nexport const mapValidationError = (cause: unknown) => new PutioValidationError({ cause });\n\nexport const mapContractError = (cause: unknown) => new PutioContractError({ cause });\n\nexport const mapConfigurationError = (cause: unknown) => new PutioConfigurationError({ cause });\n\nexport const mapTransportError = (cause: unknown) => new PutioTransportError({ cause });\n\nexport const toPutioResponseError = (\n status: number,\n headers: Headers,\n body: PutioErrorEnvelope,\n cause?: unknown,\n): PutioSdkError => {\n if (status === 429) {\n return new PutioRateLimitError({\n status,\n body,\n ...responseRateLimitHeaders(headers),\n cause,\n });\n }\n\n if (status === 401 || status === 403) {\n return new PutioAuthError({ status, body, cause });\n }\n\n return new PutioApiError({ status, body, cause });\n};\n\nexport const parseErrorBody = (status: number) =>\n flow(\n decodePutioErrorEnvelope,\n Effect.orElseSucceed(() => fallbackPutioErrorEnvelope(status)),\n );\n\nexport const withOperationErrors: {\n <\n const TDomain extends string,\n const TOperation extends string,\n const TContracts extends ReadonlyArray<PutioKnownErrorContract>,\n >(\n spec: PutioOperationErrorSpec<TDomain, TOperation, TContracts>,\n ): <A, E extends PutioSdkError, R>(\n effect: Effect.Effect<A, E, R>,\n ) => Effect.Effect<\n A,\n E | PutioOperationError<TDomain, TOperation, KnownOperationContractOf<TContracts>>,\n R\n >;\n <\n A,\n E extends PutioSdkError,\n R,\n const TDomain extends string,\n const TOperation extends string,\n const TContracts extends ReadonlyArray<PutioKnownErrorContract>,\n >(\n effect: Effect.Effect<A, E, R>,\n spec: PutioOperationErrorSpec<TDomain, TOperation, TContracts>,\n ): Effect.Effect<\n A,\n E | PutioOperationError<TDomain, TOperation, KnownOperationContractOf<TContracts>>,\n R\n >;\n} = dual(\n 2,\n <A, E extends PutioSdkError, R>(\n effect: Effect.Effect<A, E, R>,\n spec: PutioOperationErrorSpec,\n ): Effect.Effect<A, E | AnyPutioOperationError, R> =>\n effect.pipe(\n Effect.mapError((error) => {\n if (!isMatchableApiError(error)) {\n return error;\n }\n\n const contract = spec.knownErrors.find((candidate) =>\n isKnownContractMatch(candidate, error),\n );\n\n if (!contract) {\n return error;\n }\n\n return new PutioOperationError({\n body: error.body,\n contract,\n domain: spec.domain,\n operation: spec.operation,\n reason: toOperationReason(contract),\n status: error.status,\n });\n }),\n ),\n);\n","import { Effect, Schema } from \"effect\";\n\nimport { mapValidationError, PutioContractError, PutioValidationError } from \"./errors.js\";\n\nexport const PositiveIntegerSchema = Schema.Int.check(Schema.isGreaterThan(0));\nexport const NonEmptyStringSchema = Schema.String.check(Schema.isMinLength(1));\nexport const NonNegativeNumberSchema = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));\n\nexport const decodeAndRun = <S extends Schema.Top, A, E, R>(\n schema: S,\n input: S[\"Encoded\"],\n run: (decoded: S[\"Type\"]) => Effect.Effect<A, E, R>,\n) =>\n Schema.decodeUnknownEffect(schema, { onExcessProperty: \"error\" })(input).pipe(\n Effect.mapError(mapValidationError),\n Effect.flatMap(run),\n );\n\nexport const decodeAndRunRedacted =\n (domain: string, operation: string) =>\n <S extends Schema.Top, A, E, R>(\n schema: S,\n input: S[\"Encoded\"],\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: { domain, operation, reason: \"Invalid request input\" },\n }),\n ),\n Effect.flatMap(run),\n );\n\nexport const failMissingField = (field: string): Effect.Effect<never, PutioContractError> =>\n Effect.fail(new PutioContractError({ missingField: field }));\n\nexport const requireRequestedBreadcrumbs =\n (query: { readonly breadcrumbs?: 1 | undefined }) =>\n <A extends { readonly breadcrumbs?: unknown }, E, R>(\n effect: Effect.Effect<A, E, R>,\n ): Effect.Effect<A, E | PutioContractError, R> =>\n effect.pipe(\n Effect.filterOrElse(\n (response) => query.breadcrumbs !== 1 || response.breadcrumbs !== undefined,\n () => failMissingField(\"breadcrumbs\"),\n ),\n );\n\ntype CursorOrIdsSelection = {\n readonly cursor?: string | undefined;\n readonly ids?: ReadonlyArray<number> | undefined;\n};\n\nexport type CursorSelection<TFields extends CursorOrIdsSelection> =\n | (TFields & { readonly cursor: string })\n | (TFields & { readonly ids: ReadonlyArray<number> });\n\nexport const cursorSelectionSchema = <const TFields extends Schema.Struct.Fields>(\n fields: TFields,\n) =>\n 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 ...fields,\n }).check(\n Schema.makeFilter(\n (input: CursorOrIdsSelection) => input.cursor !== undefined || input.ids !== undefined,\n { expected: \"a non-empty cursor or file ID selection\" },\n ),\n );\n","export const DEFAULT_PUTIO_API_BASE_URL = \"https://api.put.io\";\nexport const DEFAULT_PUTIO_UPLOAD_BASE_URL = \"https://upload.put.io\";\nexport const DEFAULT_PUTIO_WEB_APP_URL = \"https://app.put.io\";\n","import { fallbackPutioErrorEnvelope, mapContractError, toPutioResponseError } from \"./errors.js\";\nimport type { PutioSdkError } from \"./errors.js\";\n\nexport const isSuccessStatus = (status: number) => status >= 200 && status < 300;\n\nexport const unparsableJsonBodyError = (status: number, headers: Headers): PutioSdkError =>\n isSuccessStatus(status)\n ? mapContractError(new SyntaxError(\"The HTTP response body is not valid JSON\"))\n : toPutioResponseError(\n status,\n headers,\n fallbackPutioErrorEnvelope(status),\n new SyntaxError(\"The HTTP error response body is not valid JSON\"),\n );\n","import { Effect, Predicate, Redacted } from \"effect\";\n\nimport { mapConfigurationError } from \"./errors.js\";\nimport type { PutioConfigurationError } from \"./errors.js\";\n\nexport const revealSecret = (\n secret: string | Redacted.Redacted<string>,\n): Effect.Effect<string, PutioConfigurationError> =>\n Predicate.isString(secret)\n ? Effect.succeed(secret)\n : Effect.try({\n try: () => Redacted.value(secret),\n catch: mapConfigurationError,\n });\n\nexport const revealAccessToken = (\n accessToken: Redacted.Redacted<string> | undefined,\n): Effect.Effect<string | undefined, PutioConfigurationError> =>\n accessToken === undefined\n ? Effect.undefined\n : revealSecret(accessToken).pipe(Effect.map((token) => (token === \"\" ? undefined : token)));\n","import { Context, Effect, Layer, Predicate, Redacted, Schema, Struct } from \"effect\";\n\nimport {\n DEFAULT_PUTIO_API_BASE_URL,\n DEFAULT_PUTIO_UPLOAD_BASE_URL,\n DEFAULT_PUTIO_WEB_APP_URL,\n} from \"./defaults.js\";\nimport {\n mapConfigurationError,\n mapContractError,\n mapTransportError,\n mapValidationError,\n parseErrorBody,\n PutioConfigurationError,\n PutioValidationError,\n toPutioResponseError,\n} from \"./errors.js\";\nimport type { PutioSdkError } from \"./errors.js\";\nimport { isSuccessStatus, unparsableJsonBodyError } from \"./response-body.js\";\nimport { revealAccessToken, revealSecret } from \"./secrets.js\";\n\nexport type PutioQueryValue = string | number | boolean | null | undefined;\n\nexport type PutioQuery = Readonly<Record<string, PutioQueryValue>>;\n\nexport type PutioPathSegment = string | number | boolean;\n\nexport type PutioSecret = string | Redacted.Redacted<string>;\n\nexport interface PutioSdkOptions {\n readonly accessToken?: PutioSecret | undefined;\n readonly baseUrl?: string | URL | undefined;\n readonly headers?: HeadersInit | undefined;\n readonly uploadBaseUrl?: string | URL | undefined;\n readonly webAppUrl?: string | URL | undefined;\n}\n\nexport interface PutioSdkResolvedConfig {\n readonly accessToken: Redacted.Redacted<string> | undefined;\n readonly baseUrl: string | URL;\n readonly headers: HeadersInit | undefined;\n readonly uploadBaseUrl: string | URL;\n readonly webAppUrl: string | URL;\n}\n\nexport class PutioSdkConfig extends Context.Service<PutioSdkConfig, PutioSdkResolvedConfig>()(\n \"@putdotio/sdk/PutioSdkConfig\",\n) {}\n\nexport interface PutioHttpRequest {\n readonly body?: BodyInit;\n readonly headers: Headers;\n readonly method: PutioRequestMethod;\n readonly url: string;\n}\n\nexport interface PutioHttpResponse {\n readonly arrayBuffer: Effect.Effect<ArrayBuffer, PutioSdkError>;\n readonly headers: Headers;\n readonly json: Effect.Effect<unknown, PutioSdkError>;\n readonly status: number;\n}\n\nexport interface PutioHttpClientService {\n readonly execute: (request: PutioHttpRequest) => Effect.Effect<PutioHttpResponse, PutioSdkError>;\n}\n\nexport class PutioHttpClient extends Context.Service<PutioHttpClient, PutioHttpClientService>()(\n \"@putdotio/sdk/PutioHttpClient\",\n) {}\n\nexport type PutioSdkContext = PutioSdkConfig | PutioHttpClient;\n\nconst redactPutioSecret = (\n secret: PutioSecret | undefined,\n): Redacted.Redacted<string> | undefined => {\n if (secret === undefined) {\n return undefined;\n }\n\n if (Predicate.isString(secret)) {\n return secret === \"\" ? undefined : Redacted.make(secret);\n }\n\n return secret;\n};\n\nexport const normalizePutioSdkOptions = (config: PutioSdkOptions): PutioSdkResolvedConfig => ({\n accessToken: redactPutioSecret(config.accessToken),\n baseUrl: config.baseUrl ?? DEFAULT_PUTIO_API_BASE_URL,\n headers: config.headers,\n uploadBaseUrl: config.uploadBaseUrl ?? DEFAULT_PUTIO_UPLOAD_BASE_URL,\n webAppUrl: config.webAppUrl ?? DEFAULT_PUTIO_WEB_APP_URL,\n});\n\nexport const putioSdkLayer = (config: PutioSdkOptions) =>\n Layer.succeed(PutioSdkConfig, normalizePutioSdkOptions(config));\n\nexport const putioSdkLiveLayer = (config: PutioSdkOptions) =>\n Layer.mergeAll(putioSdkLayer(config), makePutioFetchLayer());\n\nexport const makePutioFetchLayer = (\n fetchImplementation: typeof globalThis.fetch = globalThis.fetch,\n) => Layer.succeed(PutioHttpClient, makePutioFetchClient(fetchImplementation));\n\nconst decodeJsonText = Schema.decodeEffect(Schema.fromJsonString(Schema.Unknown));\n\nexport const makePutioFetchClient = (\n fetchImplementation: typeof globalThis.fetch = globalThis.fetch,\n): PutioHttpClientService => ({\n execute: (request) =>\n Effect.suspend(() => {\n const controller = new AbortController();\n\n const read = <A>(body: () => Promise<A>) =>\n Effect.tryPromise({ try: body, catch: mapTransportError }).pipe(\n Effect.onInterrupt(() => Effect.sync(() => controller.abort())),\n );\n\n return read(async () => {\n const response = await fetchImplementation(request.url, {\n body: request.body ?? null,\n headers: request.headers,\n method: request.method,\n signal: controller.signal,\n });\n\n return {\n arrayBuffer: read(() => response.arrayBuffer()),\n headers: response.headers,\n json: read(() => response.text()).pipe(\n Effect.flatMap((text) =>\n decodeJsonText(text).pipe(\n Effect.mapError(() => unparsableJsonBodyError(response.status, response.headers)),\n ),\n ),\n ),\n status: response.status,\n };\n });\n }),\n});\n\nexport const encodePathSegment = (value: PutioPathSegment): string =>\n encodeURIComponent(String(value));\n\nconst absoluteUrlPattern = /^(?:[a-z][a-z\\d+.-]*:|\\/\\/)/i;\n\nconst dotSegmentPattern = /^(?:\\.|%2e){1,2}$/i;\n\nconst parserRewrittenPattern = /[\\\\\\p{Cc}]|^ | $/u;\n\nconst normalizeApiPath = (path: string): string => {\n if (absoluteUrlPattern.test(path)) {\n throw mapConfigurationError(\"SDK API request paths must be relative to the configured baseUrl\");\n }\n\n if (parserRewrittenPattern.test(path)) {\n throw mapValidationError(\n \"SDK API request paths must not contain backslashes, control characters, or edge spaces\",\n );\n }\n\n const [pathname = \"\"] = path.split(/[?#]/, 1);\n\n if (pathname.split(\"/\").some((segment) => dotSegmentPattern.test(segment))) {\n throw mapValidationError(\"SDK API request paths must not contain dot segments\");\n }\n\n return path.startsWith(\"/\") ? path : `/${path}`;\n};\n\nexport const buildPutioUrl = (baseUrl: string | URL, path: string, query?: PutioQuery): string => {\n const url = new URL(normalizeApiPath(path), baseUrl);\n\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined && value !== null) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n return url.toString();\n};\n\nconst mapUrlBuildError = (cause: unknown) =>\n cause instanceof PutioConfigurationError || cause instanceof PutioValidationError\n ? cause\n : mapConfigurationError(cause);\n\nexport const OkResponseSchema = Schema.Struct({\n status: Schema.Literal(\"OK\"),\n});\n\nexport type PutioAuth =\n | { readonly type: \"config-token\" }\n | { readonly type: \"token\"; readonly token: PutioSecret }\n | { readonly type: \"basic\"; readonly username: string; readonly password: PutioSecret }\n | { readonly type: \"none\" };\n\ntype PutioRequestMethod = \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n\ntype PutioFormValue = Exclude<Schema.Json, boolean>;\n\ntype PutioRequestBody =\n | { readonly type: \"none\" }\n | { readonly type: \"json\"; readonly value: unknown }\n | { readonly type: \"form\"; readonly value: Readonly<Record<string, PutioFormValue | undefined>> }\n | { readonly type: \"form-data\"; readonly value: FormData };\n\ninterface PutioRequestOptions {\n readonly method: PutioRequestMethod;\n readonly path: string;\n readonly baseUrl?: string | URL | undefined;\n readonly query?: PutioQuery | undefined;\n readonly headers?: HeadersInit | undefined;\n readonly auth?: PutioAuth | undefined;\n readonly body?: PutioRequestBody | undefined;\n}\n\nconst decodeSuccessJson = <S extends Schema.Top>(schema: S, response: PutioHttpResponse) =>\n response.json.pipe(\n Effect.flatMap((json) =>\n Schema.decodeUnknownEffect(schema)(json).pipe(Effect.mapError(mapContractError)),\n ),\n );\n\nconst decodeFailure = (response: PutioHttpResponse, headers: Headers) =>\n response.json.pipe(\n Effect.flatMap(parseErrorBody(response.status)),\n Effect.map((body) => toPutioResponseError(response.status, headers, body)),\n );\n\nconst resolveAuthorization = (\n config: PutioSdkResolvedConfig,\n auth: PutioAuth | undefined,\n): Effect.Effect<string | undefined, PutioSdkError> => {\n const resolvedAuth = auth ?? { type: \"config-token\" as const };\n\n switch (resolvedAuth.type) {\n case \"none\":\n return Effect.undefined;\n case \"token\":\n return revealSecret(resolvedAuth.token).pipe(Effect.map((token) => `Token ${token}`));\n case \"basic\":\n return revealSecret(resolvedAuth.password).pipe(\n Effect.flatMap((password) =>\n Effect.try({\n try: () => `Basic ${btoa(`${resolvedAuth.username}:${password}`)}`,\n catch: mapConfigurationError,\n }),\n ),\n );\n case \"config-token\":\n return revealAccessToken(config.accessToken).pipe(\n Effect.flatMap((token) =>\n token === undefined\n ? Effect.fail(\n mapConfigurationError(\n \"This endpoint requires an access token, but PutioSdkConfig.accessToken is missing\",\n ),\n )\n : Effect.succeed(`Token ${token}`),\n ),\n );\n }\n};\n\nconst normalizeFormValue = (value: PutioFormValue): string => {\n if (value === null) {\n return \"\";\n }\n\n if (Predicate.isString(value)) {\n return value;\n }\n\n if (Predicate.isNumber(value)) {\n return String(value);\n }\n\n return JSON.stringify(value);\n};\n\nconst withBody = (body: PutioRequestBody): Effect.Effect<BodyInit | undefined, PutioSdkError> => {\n switch (body.type) {\n case \"none\":\n return Effect.undefined;\n case \"json\":\n return Effect.try({\n try: () => JSON.stringify(body.value),\n catch: mapValidationError,\n });\n case \"form\":\n return Effect.succeed(\n new URLSearchParams(\n Object.entries(body.value).flatMap(([key, value]) =>\n value === undefined ? [] : [[key, normalizeFormValue(value)]],\n ),\n ),\n );\n case \"form-data\":\n return Effect.succeed(body.value);\n }\n};\n\nconst buildRequestHeaders = (\n requestHeaders: HeadersInit | undefined,\n configHeaders: HeadersInit | undefined,\n authorization: string | undefined,\n bodyType: PutioRequestBody[\"type\"] | \"none\",\n): Headers => {\n const headers = new Headers(configHeaders);\n headers.delete(\"authorization\");\n new Headers(requestHeaders).forEach((value, name) => headers.set(name, value));\n\n if (!headers.has(\"accept\")) {\n headers.set(\"accept\", \"application/json\");\n }\n\n if (authorization) {\n headers.set(\"authorization\", authorization);\n }\n\n if (bodyType === \"json\" && !headers.has(\"content-type\")) {\n headers.set(\"content-type\", \"application/json\");\n }\n\n return headers;\n};\n\nconst makeRequest = Effect.fnUntraced(function* (\n url: string,\n options: PutioRequestOptions,\n configHeaders: HeadersInit | undefined,\n authorization?: string,\n) {\n const body = options.body ?? { type: \"none\" as const };\n\n const headers = yield* Effect.try({\n try: () => buildRequestHeaders(options.headers, configHeaders, authorization, body.type),\n catch: () => mapConfigurationError(\"SDK request headers must be valid HTTP header values\"),\n });\n\n const requestBody = yield* withBody(body);\n\n const request: PutioHttpRequest = { headers, method: options.method, url };\n\n return requestBody === undefined ? request : { ...request, body: requestBody };\n});\n\nconst executeRequest = Effect.fn(\"PutioSdk.executeRequest\")(function* (\n options: PutioRequestOptions,\n) {\n yield* Effect.annotateCurrentSpan(\"http.request.method\", options.method);\n\n const config = yield* PutioSdkConfig;\n const httpClient = yield* PutioHttpClient;\n const authorization = yield* resolveAuthorization(config, options.auth);\n\n const url = yield* Effect.try({\n try: () => buildPutioUrl(options.baseUrl ?? config.baseUrl, options.path, options.query),\n catch: mapUrlBuildError,\n });\n\n const request = yield* makeRequest(url, options, config.headers, authorization);\n\n return yield* httpClient.execute(request);\n});\n\nexport const requestJson = <S extends Schema.Top>(\n schema: S,\n options: PutioRequestOptions,\n): Effect.Effect<S[\"Type\"], PutioSdkError, PutioSdkContext | S[\"DecodingServices\"]> =>\n executeRequest(options).pipe(\n Effect.flatMap((response) =>\n isSuccessStatus(response.status)\n ? decodeSuccessJson(schema, response)\n : decodeFailure(response, response.headers).pipe(Effect.flatMap(Effect.fail)),\n ),\n );\n\nexport const selectJsonField =\n <K extends string>(field: K) =>\n <A extends { readonly [P in K]: unknown }, E, R>(\n effect: Effect.Effect<A, E, R>,\n ): Effect.Effect<A[K], E, R> =>\n effect.pipe(Effect.map((value) => value[field]));\n\nexport const selectJsonFields =\n <const K extends ReadonlyArray<string>>(...fields: K) =>\n <A extends { readonly [P in K[number]]: unknown }, E, R>(\n effect: Effect.Effect<A, E, R>,\n ): Effect.Effect<Pick<A, K[number]>, E, R> =>\n effect.pipe(Effect.map((value) => Struct.pick(value, fields)));\n\nexport const requestArrayBuffer = (\n options: PutioRequestOptions,\n): Effect.Effect<Uint8Array, PutioSdkError, PutioSdkContext> =>\n executeRequest(options).pipe(\n Effect.flatMap((response) =>\n isSuccessStatus(response.status)\n ? response.arrayBuffer.pipe(Effect.map((buffer) => new Uint8Array(buffer)))\n : decodeFailure(response, response.headers).pipe(Effect.flatMap(Effect.fail)),\n ),\n );\n\nexport const requestText = (\n options: PutioRequestOptions,\n): Effect.Effect<string, PutioSdkError, PutioSdkContext> =>\n requestArrayBuffer(options).pipe(Effect.map((bytes) => new TextDecoder().decode(bytes)));\n\nexport const requestVoid = (\n options: PutioRequestOptions,\n): Effect.Effect<void, PutioSdkError, PutioSdkContext> =>\n executeRequest(options).pipe(\n Effect.flatMap((response) =>\n isSuccessStatus(response.status)\n ? Effect.ignore(response.arrayBuffer)\n : decodeFailure(response, response.headers).pipe(Effect.flatMap(Effect.fail)),\n ),\n );\n","type CsvValue = string | number;\n\nexport interface CursorSelectionInput<TValue extends CsvValue = number> {\n readonly cursor?: string | undefined;\n readonly excludeIds?: ReadonlyArray<TValue> | undefined;\n readonly ids?: ReadonlyArray<TValue> | undefined;\n}\n\nexport const joinCsv = <TValue extends CsvValue>(\n values: ReadonlyArray<TValue> | undefined,\n): string | undefined => (values && values.length > 0 ? values.join(\",\") : undefined);\n\ntype CursorSelectionForm<TIdsFieldName extends string> = {\n readonly cursor?: string | undefined;\n readonly exclude_ids?: string | undefined;\n} & Record<TIdsFieldName, string | undefined>;\n\nexport function toCursorSelectionForm<TValue extends CsvValue>(\n selection: CursorSelectionInput<TValue>,\n): CursorSelectionForm<\"file_ids\">;\nexport function toCursorSelectionForm<TValue extends CsvValue, const TIdsFieldName extends string>(\n selection: CursorSelectionInput<TValue>,\n idsFieldName: TIdsFieldName,\n): CursorSelectionForm<TIdsFieldName>;\nexport function toCursorSelectionForm(\n selection: CursorSelectionInput<CsvValue>,\n idsFieldName = \"file_ids\",\n): CursorSelectionForm<string> {\n return {\n cursor: selection.cursor,\n exclude_ids: joinCsv(selection.excludeIds),\n [idsFieldName]: joinCsv(selection.ids),\n };\n}\n"],"mappings":";;;AAGA,MAAa,2BAA2B,OAAO,OAAO;CACpD,QAAQ,OAAO,SAAS,OAAO,MAAM;CACrC,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,eAAe,OAAO,SAAS,OAAO,MAAM;CAC5C,YAAY,OAAO,SAAS,OAAO,MAAM;CACzC,WAAW,OAAO,SAAS,OAAO,MAAM;CACxC,UAAU,OAAO,SAAS,OAAO,OAAO,OAAO,MAAM,CAAC;CACtD,OAAO,OAAO,SAAS,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO,CAAC;CACnE,aAAa,OAAO,SAAS,OAAO,GA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
@@ -505,7 +505,7 @@ interface PutioRequestOptions {
505
505
  }
506
506
  declare const requestJson: <S extends Schema.Top>(schema: S, options: PutioRequestOptions) => Effect.Effect<S["Type"], PutioSdkError, PutioSdkContext | S["DecodingServices"]>;
507
507
  declare const selectJsonField: <K extends string>(field: K) => <A extends { readonly [P in K]: unknown; }, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A[K], E, R>;
508
- declare const selectJsonFields: <const K extends readonly string[]>(...fields: K) => <A extends { readonly [P in K[number]]: unknown; }, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<Pick<A, K[number]>, E, R>;
508
+ declare const selectJsonFields: <const K extends ReadonlyArray<string>>(...fields: K) => <A extends { readonly [P in K[number]]: unknown; }, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<Pick<A, K[number]>, E, R>;
509
509
  declare const requestArrayBuffer: (options: PutioRequestOptions) => Effect.Effect<Uint8Array, PutioSdkError, PutioSdkContext>;
510
510
  declare const requestText: (options: PutioRequestOptions) => Effect.Effect<string, PutioSdkError, PutioSdkContext>;
511
511
  declare const requestVoid: (options: PutioRequestOptions) => Effect.Effect<void, PutioSdkError, PutioSdkContext>;
@@ -532,6 +532,7 @@ declare const AccountSettingsSchema: Schema.Struct<{
532
532
  locale: Schema.NullOr<Schema.String>;
533
533
  login_mails_enabled: Schema.Boolean;
534
534
  next_episode: Schema.Boolean;
535
+ played_threshold_percent: Schema.Int;
535
536
  product_analytics_enabled: Schema.Boolean;
536
537
  pushover_token: Schema.NullOr<Schema.String>;
537
538
  show_optimistic_usage: Schema.Boolean;
@@ -584,6 +585,7 @@ declare const AccountInfoBaseSchema: Schema.Struct<{
584
585
  locale: Schema.NullOr<Schema.String>;
585
586
  login_mails_enabled: Schema.Boolean;
586
587
  next_episode: Schema.Boolean;
588
+ played_threshold_percent: Schema.Int;
587
589
  product_analytics_enabled: Schema.Boolean;
588
590
  pushover_token: Schema.NullOr<Schema.String>;
589
591
  show_optimistic_usage: Schema.Boolean;
@@ -650,6 +652,7 @@ declare const AccountInfoBroadSchema: Schema.Struct<{
650
652
  locale: Schema.NullOr<Schema.String>;
651
653
  login_mails_enabled: Schema.Boolean;
652
654
  next_episode: Schema.Boolean;
655
+ played_threshold_percent: Schema.Int;
653
656
  product_analytics_enabled: Schema.Boolean;
654
657
  pushover_token: Schema.NullOr<Schema.String>;
655
658
  show_optimistic_usage: Schema.Boolean;
@@ -704,6 +707,7 @@ declare const SaveAccountSettingsPayloadSchema: Schema.Union<readonly [Schema.St
704
707
  locale: Schema.optional<Schema.NullOr<Schema.String>>;
705
708
  login_mails_enabled: Schema.optional<Schema.Boolean>;
706
709
  next_episode: Schema.optional<Schema.Boolean>;
710
+ played_threshold_percent: Schema.optional<Schema.Int>;
707
711
  product_analytics_enabled: Schema.optional<Schema.Boolean>;
708
712
  pushover_token: Schema.optional<Schema.NullOr<Schema.String>>;
709
713
  show_optimistic_usage: Schema.optional<Schema.Boolean>;
@@ -737,6 +741,7 @@ declare const SaveAccountSettingsPayloadSchema: Schema.Union<readonly [Schema.St
737
741
  readonly locale: Schema.optional<Schema.NullOr<Schema.String>>;
738
742
  readonly login_mails_enabled: Schema.optional<Schema.Boolean>;
739
743
  readonly next_episode: Schema.optional<Schema.Boolean>;
744
+ readonly played_threshold_percent: Schema.optional<Schema.Int>;
740
745
  readonly product_analytics_enabled: Schema.optional<Schema.Boolean>;
741
746
  readonly pushover_token: Schema.optional<Schema.NullOr<Schema.String>>;
742
747
  readonly show_optimistic_usage: Schema.optional<Schema.Boolean>;
@@ -773,6 +778,7 @@ declare const SaveAccountSettingsPayloadSchema: Schema.Union<readonly [Schema.St
773
778
  readonly locale: Schema.optional<Schema.NullOr<Schema.String>>;
774
779
  readonly login_mails_enabled: Schema.optional<Schema.Boolean>;
775
780
  readonly next_episode: Schema.optional<Schema.Boolean>;
781
+ readonly played_threshold_percent: Schema.optional<Schema.Int>;
776
782
  readonly product_analytics_enabled: Schema.optional<Schema.Boolean>;
777
783
  readonly pushover_token: Schema.optional<Schema.NullOr<Schema.String>>;
778
784
  readonly show_optimistic_usage: Schema.optional<Schema.Boolean>;
@@ -5774,9 +5780,9 @@ type OperationResult<Kind extends OperationKind, Success, Failure, Requirements>
5774
5780
  readonly Failure: Failure;
5775
5781
  readonly Requirements: Requirements;
5776
5782
  })["Result"];
5777
- type Operation = (...args: never[]) => void;
5783
+ type Operation = (...args: Array<never>) => void;
5778
5784
  type SdkEffect = Effect.Effect<unknown, unknown, PutioSdkContext>;
5779
- type SdkEffectOperation = (...args: never[]) => SdkEffect;
5785
+ type SdkEffectOperation = (...args: Array<never>) => SdkEffect;
5780
5786
  type ResultOf<Kind extends OperationKind, TOperation extends SdkEffectOperation, Success> = OperationResult<Kind, Success, Effect.Error<ReturnType<TOperation>>, Effect.Services<ReturnType<TOperation>>>;
5781
5787
  interface AccountGetInfo<Kind extends OperationKind> {
5782
5788
  <TQuery extends AccountInfoQuery>(query: TQuery): ResultOf<Kind, typeof getAccountInfo, AccountInfoResponseFor<TQuery>>;
@@ -6138,6 +6144,7 @@ declare const makePutioSdkService: (config: PutioSdkResolvedConfig, httpClient:
6138
6144
  readonly locale: string | null;
6139
6145
  readonly login_mails_enabled: boolean;
6140
6146
  readonly next_episode: boolean;
6147
+ readonly played_threshold_percent: number;
6141
6148
  readonly product_analytics_enabled: boolean;
6142
6149
  readonly pushover_token: string | null;
6143
6150
  readonly show_optimistic_usage: boolean;
@@ -6176,6 +6183,7 @@ declare const makePutioSdkService: (config: PutioSdkResolvedConfig, httpClient:
6176
6183
  readonly locale?: string | null | undefined;
6177
6184
  readonly login_mails_enabled?: boolean | undefined;
6178
6185
  readonly next_episode?: boolean | undefined;
6186
+ readonly played_threshold_percent?: number | undefined;
6179
6187
  readonly product_analytics_enabled?: boolean | undefined;
6180
6188
  readonly pushover_token?: string | null | undefined;
6181
6189
  readonly show_optimistic_usage?: boolean | undefined;
@@ -6209,6 +6217,7 @@ declare const makePutioSdkService: (config: PutioSdkResolvedConfig, httpClient:
6209
6217
  readonly locale?: string | null | undefined;
6210
6218
  readonly login_mails_enabled?: boolean | undefined;
6211
6219
  readonly next_episode?: boolean | undefined;
6220
+ readonly played_threshold_percent?: number | undefined;
6212
6221
  readonly product_analytics_enabled?: boolean | undefined;
6213
6222
  readonly pushover_token?: string | null | undefined;
6214
6223
  readonly show_optimistic_usage?: boolean | undefined;
@@ -6245,6 +6254,7 @@ declare const makePutioSdkService: (config: PutioSdkResolvedConfig, httpClient:
6245
6254
  readonly locale?: string | null | undefined;
6246
6255
  readonly login_mails_enabled?: boolean | undefined;
6247
6256
  readonly next_episode?: boolean | undefined;
6257
+ readonly played_threshold_percent?: number | undefined;
6248
6258
  readonly product_analytics_enabled?: boolean | undefined;
6249
6259
  readonly pushover_token?: string | null | undefined;
6250
6260
  readonly show_optimistic_usage?: boolean | undefined;
@@ -9247,6 +9257,7 @@ declare const PutioSdk_base: Context.ServiceClass<PutioSdk, "@putdotio/sdk/Putio
9247
9257
  readonly locale: string | null;
9248
9258
  readonly login_mails_enabled: boolean;
9249
9259
  readonly next_episode: boolean;
9260
+ readonly played_threshold_percent: number;
9250
9261
  readonly product_analytics_enabled: boolean;
9251
9262
  readonly pushover_token: string | null;
9252
9263
  readonly show_optimistic_usage: boolean;
@@ -9285,6 +9296,7 @@ declare const PutioSdk_base: Context.ServiceClass<PutioSdk, "@putdotio/sdk/Putio
9285
9296
  readonly locale?: string | null | undefined;
9286
9297
  readonly login_mails_enabled?: boolean | undefined;
9287
9298
  readonly next_episode?: boolean | undefined;
9299
+ readonly played_threshold_percent?: number | undefined;
9288
9300
  readonly product_analytics_enabled?: boolean | undefined;
9289
9301
  readonly pushover_token?: string | null | undefined;
9290
9302
  readonly show_optimistic_usage?: boolean | undefined;
@@ -9318,6 +9330,7 @@ declare const PutioSdk_base: Context.ServiceClass<PutioSdk, "@putdotio/sdk/Putio
9318
9330
  readonly locale?: string | null | undefined;
9319
9331
  readonly login_mails_enabled?: boolean | undefined;
9320
9332
  readonly next_episode?: boolean | undefined;
9333
+ readonly played_threshold_percent?: number | undefined;
9321
9334
  readonly product_analytics_enabled?: boolean | undefined;
9322
9335
  readonly pushover_token?: string | null | undefined;
9323
9336
  readonly show_optimistic_usage?: boolean | undefined;
@@ -9354,6 +9367,7 @@ declare const PutioSdk_base: Context.ServiceClass<PutioSdk, "@putdotio/sdk/Putio
9354
9367
  readonly locale?: string | null | undefined;
9355
9368
  readonly login_mails_enabled?: boolean | undefined;
9356
9369
  readonly next_episode?: boolean | undefined;
9370
+ readonly played_threshold_percent?: number | undefined;
9357
9371
  readonly product_analytics_enabled?: boolean | undefined;
9358
9372
  readonly pushover_token?: string | null | undefined;
9359
9373
  readonly show_optimistic_usage?: boolean | undefined;
@@ -12358,6 +12372,7 @@ declare const createPromiseOperations: (state: PutioSdkPromiseState, signal: Abo
12358
12372
  readonly locale: string | null;
12359
12373
  readonly login_mails_enabled: boolean;
12360
12374
  readonly next_episode: boolean;
12375
+ readonly played_threshold_percent: number;
12361
12376
  readonly product_analytics_enabled: boolean;
12362
12377
  readonly pushover_token: string | null;
12363
12378
  readonly show_optimistic_usage: boolean;
@@ -12396,6 +12411,7 @@ declare const createPromiseOperations: (state: PutioSdkPromiseState, signal: Abo
12396
12411
  readonly locale?: string | null | undefined;
12397
12412
  readonly login_mails_enabled?: boolean | undefined;
12398
12413
  readonly next_episode?: boolean | undefined;
12414
+ readonly played_threshold_percent?: number | undefined;
12399
12415
  readonly product_analytics_enabled?: boolean | undefined;
12400
12416
  readonly pushover_token?: string | null | undefined;
12401
12417
  readonly show_optimistic_usage?: boolean | undefined;
@@ -12429,6 +12445,7 @@ declare const createPromiseOperations: (state: PutioSdkPromiseState, signal: Abo
12429
12445
  readonly locale?: string | null | undefined;
12430
12446
  readonly login_mails_enabled?: boolean | undefined;
12431
12447
  readonly next_episode?: boolean | undefined;
12448
+ readonly played_threshold_percent?: number | undefined;
12432
12449
  readonly product_analytics_enabled?: boolean | undefined;
12433
12450
  readonly pushover_token?: string | null | undefined;
12434
12451
  readonly show_optimistic_usage?: boolean | undefined;
@@ -12465,6 +12482,7 @@ declare const createPromiseOperations: (state: PutioSdkPromiseState, signal: Abo
12465
12482
  readonly locale?: string | null | undefined;
12466
12483
  readonly login_mails_enabled?: boolean | undefined;
12467
12484
  readonly next_episode?: boolean | undefined;
12485
+ readonly played_threshold_percent?: number | undefined;
12468
12486
  readonly product_analytics_enabled?: boolean | undefined;
12469
12487
  readonly pushover_token?: string | null | undefined;
12470
12488
  readonly show_optimistic_usage?: boolean | undefined;
@@ -15468,6 +15486,7 @@ declare const createPutioSdkPromiseClient: (initialConfig?: PutioSdkOptions) =>
15468
15486
  readonly locale: string | null;
15469
15487
  readonly login_mails_enabled: boolean;
15470
15488
  readonly next_episode: boolean;
15489
+ readonly played_threshold_percent: number;
15471
15490
  readonly product_analytics_enabled: boolean;
15472
15491
  readonly pushover_token: string | null;
15473
15492
  readonly show_optimistic_usage: boolean;
@@ -15506,6 +15525,7 @@ declare const createPutioSdkPromiseClient: (initialConfig?: PutioSdkOptions) =>
15506
15525
  readonly locale?: string | null | undefined;
15507
15526
  readonly login_mails_enabled?: boolean | undefined;
15508
15527
  readonly next_episode?: boolean | undefined;
15528
+ readonly played_threshold_percent?: number | undefined;
15509
15529
  readonly product_analytics_enabled?: boolean | undefined;
15510
15530
  readonly pushover_token?: string | null | undefined;
15511
15531
  readonly show_optimistic_usage?: boolean | undefined;
@@ -15539,6 +15559,7 @@ declare const createPutioSdkPromiseClient: (initialConfig?: PutioSdkOptions) =>
15539
15559
  readonly locale?: string | null | undefined;
15540
15560
  readonly login_mails_enabled?: boolean | undefined;
15541
15561
  readonly next_episode?: boolean | undefined;
15562
+ readonly played_threshold_percent?: number | undefined;
15542
15563
  readonly product_analytics_enabled?: boolean | undefined;
15543
15564
  readonly pushover_token?: string | null | undefined;
15544
15565
  readonly show_optimistic_usage?: boolean | undefined;
@@ -15575,6 +15596,7 @@ declare const createPutioSdkPromiseClient: (initialConfig?: PutioSdkOptions) =>
15575
15596
  readonly locale?: string | null | undefined;
15576
15597
  readonly login_mails_enabled?: boolean | undefined;
15577
15598
  readonly next_episode?: boolean | undefined;
15599
+ readonly played_threshold_percent?: number | undefined;
15578
15600
  readonly product_analytics_enabled?: boolean | undefined;
15579
15601
  readonly pushover_token?: string | null | undefined;
15580
15602
  readonly show_optimistic_usage?: boolean | undefined;
@@ -18544,4 +18566,4 @@ declare global {
18544
18566
  var SchemaErrorTypeId: symbol;
18545
18567
  }
18546
18568
  export { ReannounceTransferError as $, RemoveFriendErrorSpec as $a, FileSearchResponse as $c, VerifyTOTPError as $d, PopularOAuthAppSchema as $f, PaymentProvider as $i, buildFileApiMp4DownloadUrl as $l, PutioKnownOperationErrorContract as $m, UnshareFileError as $n, listFamilyInvites as $o, AccountWarnings as $p, retryRssFeedItem as $r, ContinueSearchError as $s, TrashBulkInput as $t, getConfigKeyWith as $u, ListTunnelRoutesError as A, redeemPaymentVoucher as Aa, FileExtractionsError as Ac, OAuthAuthorizationCodeExchangeErrorCodeSchema as Ad, CreateOAuthAppError as Af, parseErrorBody as Ah, ListPaymentPlansError as Ai, FilesSearchQuery as Al, makePutioFetchClient as Am, ListSharedFilesError as An, IftttEventInput as Ao, deleteAllAppSpecificPasswords as Ap, RetryAllRssFeedItemsError as Ar, ListEventsErrorSpec as As, addTransferTrackers as At, listActiveMp4Conversions as Au, AddManyTransfersErrorSpec as B, Friend as Ba, FileMediaInfoFormatSchema as Bc, RegisterInputSchema as Bd, OAuthAppCreateInputSchema as Bf, PaymentHistoryQuery as Bi, QueryFilesError as Bl, selectJsonFields as Bm, SharedFileShare as Bn, FamilyInvitesResponse as Bo, AccountDiskSchema as Bp, RssFeedParamsSchema as Br, DownloadLinksInfoSchema as Bs, removeTransfers as Bt, searchFiles as Bu, ZipInfo as C, getPaymentInfo as Ca, FileCore as Cc, LinkDeviceErrorSpec as Cd, register as Cf, isPutioRateLimitError as Ch, GetPaymentVoucherInfoErrorSpec as Ci, FileXspfPlaylistUrlOptions as Cl, PutioSdkConfig as Cm, GetSharedWithErrorSpec as Cn, FriendInviteSchema as Co, DeleteAllAppSpecificPasswordsError as Cp, ListRssFeedItemsErrorSpec as Cr, HistoryTransferErrorEventSchema as Cs, TransfersContinueResponse as Ct, getFile as Cu, createZip as D, listPaymentOptions as Da, FileExtractionSchema as Dc, LoginResponse as Dd, revokeClient as Df, mapContractError as Dh, ListPaymentInvitesErrorSpec as Di, FilesListQuerySchema as Dl, PutioSecret as Dm, ListPublicShareFilesErrorSpec as Dn, listFriendInvites as Do, ListAppSpecificPasswordsError as Dp, PauseRssFeedErrorSpec as Dr, HistoryZipCreatedEvent as Ds, TransfersListResponseFor as Dt, getMp4Status as Du, cancelZip as E, listPaymentInvites as Ea, FileExtraction as Ec, LoginInput as Ed, revokeApp as Ef, mapConfigurationError as Eh, ListPaymentInvitesError as Ei, FilesListQuery as El, PutioSdkResolvedConfig as Em, ListPublicShareFilesError as En, createFriendInvite as Eo, DeleteAppSpecificPasswordErrorSpec as Ep, PauseRssFeedError as Er, HistoryVoucherEventSchema as Es, TransfersListResponse as Et, getHlsStreamUrl as Eu, RemoveRateLimitBanError as F, ApproveFriendRequestErrorSpec as Fa, FileHlsStreamUrlOptions as Fc, RegenerateRecoveryCodesError as Fd, GetOAuthAppErrorSpec as Ff, PaymentChangePlanSubmitInput as Fi, GetFileChildErrorSpec as Fl, requestArrayBuffer as Fm, PublicShareSchema as Fn, sendIftttEvent as Fo, AccountConfirmation as Fp, RssFeedItem as Fr, CreateDownloadLinksError as Fs, getTransfer as Ft, putMp4ToMyFiles as Fu, ContinueTransfersError as G, FriendSharedFolderErrorSpec as Ga, FileMp4Error as Gc, RevokeOAuthClientError as Gd, OAuthAppUpdateInput as Gf, PaymentInviteSchema as Gi, SearchFilesError as Gl, PutioAuthErrorValue as Gm, SharingCloneInfoSchema as Gn, ListFamilyInvitesError as Go, AccountInfoQuery as Gp, createRssFeed as Gr, GetDownloadLinksError as Gs, DeleteTrashError as Gt, uploadFile as Gu, AddTransferErrorSpec as H, FriendBaseSchema as Ha, FileMediaInfoStreamSchema as Hc, ResetPasswordErrorSpec as Hd, OAuthAppSchema as Hf, PaymentInfoPlanSchema as Hi, RenameFileError as Hl, PutioApiError as Hm, SharedFileSharedWith as Hn, FamilyMemberSchema as Ho, AccountInfoBaseSchema as Hp, UpdateRssFeedError as Hr, DownloadLinksPayloadSchema as Hs, stopTransferRecording as Ht, setFilesWatchStatus as Hu, RemoveRateLimitBanErrorSpec as I, CountWaitingRequestsError as Ia, FileListContinuationResponse as Ic, RegenerateRecoveryCodesErrorSpec as Id, MyOAuthApp as If, PaymentChangePlanSubmitResponse as Ii, GetFileError as Il, requestJson as Im, ShareFilesError as In, CreateFamilyInviteError as Io, AccountConfirmationSchema as Ip, RssFeedItemFailedSchema as Ir, CreateDownloadLinksErrorSpec as Is, getTransferInfo as It, queryFiles as Iu, GetTransferErrorSpec as J, ListSentRequestsError as Ja, FileMp4MutationErrorSpec as Jc, RevokeOAuthGrantErrorSpec as Jd, OAuthSetIconInput as Jf, PaymentOptionSchema as Ji, StartFromErrorSpec as Jl, PutioContractError as Jm, SharingCloneStatusSchema as Jn, ListFamilyMembersErrorSpec as Jo, AccountSettings as Jp, listRssFeedItems as Jr, getDownloadLinks as Js, EmptyTrashErrorSpec as Jt, PutioJsonObject as Ju, ContinueTransfersErrorSpec as K, ListFriendsError as Ka, FileMp4ErrorSpec as Kc, RevokeOAuthClientErrorSpec as Kd, OAuthAppUpdateInputSchema as Kf, PaymentOption as Ki, SearchFilesErrorSpec as Kl, PutioConfigurationError as Km, SharingCloneInput as Kn, ListFamilyInvitesErrorSpec as Ko, AccountInfoQuerySchema as Kp, deleteRssFeed as Kr, GetDownloadLinksErrorSpec as Ks, DeleteTrashErrorSpec as Kt, JsonObjectSchema as Ku, RemoveRateLimitBanInput as L, CountWaitingRequestsErrorSpec as La, FileListResponse as Lc, RegisterError as Ld, MyOAuthAppSchema as Lf, PaymentChangePlanSubmitSchema as Li, GetFileErrorSpec as Ll, requestText as Lm, ShareFilesErrorSpec as Ln, CreateFamilyInviteErrorSpec as Lo, AccountConfirmationsError as Lp, RssFeedItemSchema as Lr, DownloadLinksCreateInput as Ls, getTransferTorrent as Lt, renameFile as Lu, TunnelRoute as M, stopPaymentSubscription as Ma, FileGetChildInput as Mc, OAuthAuthorizationCodeExchangeInputSchema as Md, DeleteOAuthAppError as Mf, toPutioResponseError as Mh, PaymentChangePlanPreview as Mi, FolderType as Ml, normalizePutioSdkOptions as Mm, PublicShare as Mn, SendIftttEventError as Mo, listAppSpecificPasswords as Mp, RetryRssFeedItemError as Mr, deleteEvent as Ms, cleanTransfers as Mt, listFileSubtitles as Mu, TunnelRouteSchema as N, submitPaymentChangePlan as Na, FileGetChildInputSchema as Nc, RecoveryCodesError as Nd, DeleteOAuthAppErrorSpec as Nf, withOperationErrors as Nh, PaymentChangePlanPreviewInput as Ni, FolderTypeSchema as Nl, putioSdkLayer as Nm, PublicShareListQuery as Nn, SendIftttEventErrorSpec as No, AccountClearOptions as Np, RetryRssFeedItemErrorSpec as Nr, getEventTorrent as Ns, continueTransfers as Nt, moveFileSelection as Nu, getZip as O, listPaymentPlans as Oa, FileExtractionStatus as Oc, LoginResponseSchema as Od, validateToken as Of, mapTransportError as Oh, ListPaymentOptionsError as Oi, FilesMoveError as Ol, buildPutioUrl as Om, ListPublicSharesError as On, GetIftttStatusError as Oo, ListAppSpecificPasswordsErrorSpec as Op, ResumeRssFeedError as Or, HistoryZipCreatedEventSchema as Os, addManyTransfers as Ot, getStartFrom as Ou, listTunnelRoutes as P, ApproveFriendRequestError as Pa, FileHlsMasterPlaylistOptions as Pc, RecoveryCodesErrorSpec as Pd, GetOAuthAppError as Pf, PaymentChangePlanPreviewSchema as Pi, GetFileChildError as Pl, putioSdkLiveLayer as Pm, PublicShareListQuerySchema as Pn, getIftttStatus as Po, AccountClearOptionsSchema as Pp, RssFeed as Pr, listEvents as Ps, countTransfers as Pt, moveFiles as Pu, ListTransfersErrorSpec as Q, RemoveFriendError as Qa, FileResponseFor as Qc, ValidateTokenResponseSchema as Qd, PopularOAuthApp as Qf, PaymentPlanTypeSchema as Qi, buildFileApiDownloadUrl as Ql, PutioKnownErrorContract as Qm, SharingUnshareInputSchema as Qn, joinFamily as Qo, AccountTwoFactorSettingsSchema as Qp, retryAllRssFeedItems as Qr, ContinueFilesErrorSpec as Qs, RestoreTrashErrorSpec as Qt, getConfigKey as Qu, removeRateLimitBan as R, DenyFriendRequestError as Ra, FileListResponseFor as Rc, RegisterErrorSpec as Rd, OAuthApp as Rf, PaymentHistoryItem as Ri, GetHlsMasterPlaylistError as Rl, requestVoid as Rm, SharedFile as Rn, FamilyInvite as Ro, AccountConfirmationsErrorSpec as Rp, RssFeedItemSucceededSchema as Rr, DownloadLinksCreateInputSchema as Rs, listTransfers as Rt, resetFileSortSettings as Ru, ZipCreateResponse as S, getPaddleBillingInvoiceUrl as Sa, FileCopyInputSchema as Sc, LinkDeviceError as Sd, regenerateRecoveryCodes as Sf, isPutioOperationError as Sh, GetPaymentVoucherInfoError as Si, FileWatchStatusErrorSpec as Sl, PutioQueryValue as Sm, GetSharedWithError as Sn, FriendInviteJoinedUserStatusSchema as So, CreateAppSpecificPasswordResult as Sp, ListRssFeedItemsError as Sr, HistoryTransferCompletedEventSchema as Ss, TransfersAddMultiError as St, getDownloadUrl as Su, ZipSummary as T, listPaymentHistory as Ta, FileDirectAccessOptions as Tc, LoginErrorSpec as Td, revokeAllClients as Tf, isPutioValidationError as Th, ListPaymentHistoryErrorSpec as Ti, FilesListEnvelopeSchema as Tl, PutioSdkOptions as Tm, GetSharingCloneInfoErrorSpec as Tn, ListFriendInvitesErrorSpec as To, DeleteAppSpecificPasswordError as Tp, ListRssFeedsErrorSpec as Tr, HistoryUploadEventSchema as Ts, TransfersListQuerySchema as Tt, getHlsMasterPlaylist as Tu, AddTransferTrackersError as U, FriendSchema as Ua, FileMediaMetadata as Uc, RevokeAllOAuthClientsError as Ud, OAuthAppSession as Uf, PaymentInfoSchema as Ui, RenameFileErrorSpec as Ul, PutioApiErrorValue as Um, SharedFileSharedWithSchema as Un, JoinFamilyError as Uo, AccountInfoBroad as Up, UpdateRssFeedErrorSpec as Ur, DownloadLinksStatus as Us, ContinueTrashError as Ut, setStartFrom as Uu, AddTransferError as V, FriendBase as Va, FileMediaInfoSchema as Vc, ResetPasswordError as Vd, OAuthAppIconRequestDescriptor as Vf, PaymentInfo as Vi, QueryFilesErrorSpec as Vl, AnyPutioOperationError as Vm, SharedFileShareSchema as Vn, FamilyMember as Vo, AccountInfoBase as Vp, RssFeedSchema as Vr, DownloadLinksPayload as Vs, retryTransfer as Vt, setFileSort as Vu, AddTransferTrackersErrorSpec as W, FriendSharedFolderError as Wa, FileMediaMetadataSchema as Wc, RevokeAllOAuthClientsErrorSpec as Wd, OAuthAppSessionSchema as Wf, PaymentInvite as Wi, SHARED_WITH_YOU_ROOT_ID as Wl, PutioAuthError as Wm, SharingCloneInfo as Wn, JoinFamilyErrorSpec as Wo, AccountInfoBroadSchema as Wp, clearRssFeedLogs as Wr, DownloadLinksStatusSchema as Ws, ContinueTrashErrorSpec as Wt, touchFiles as Wu, GetTransferTorrentErrorSpec as X, ListWaitingRequestsError as Xa, FileQuerySchema as Xc, TwoFactorRecoveryCodesSchema as Xd, OwnedOAuthApp as Xf, PaymentPlanGroup as Xi, TouchFilesErrorSpec as Xl, PutioErrorEnvelope as Xm, SharingShareInputSchema as Xn, RemoveFamilyMemberErrorSpec as Xo, AccountSubtitleLanguage as Xp, pauseRssFeed as Xr, CanWriteFileErrorSpec as Xs, ListTrashErrorSpec as Xt, PutioJsonValue as Xu, GetTransferTorrentError as Y, ListSentRequestsErrorSpec as Ya, FileQuery as Yc, TwoFactorRecoveryCodes as Yd, OAuthSetIconInputSchema as Yf, PaymentPaddleWaitingPaymentInput as Yi, TouchFilesError as Yl, PutioContractErrorValue as Ym, SharingShareInput as Yn, RemoveFamilyMemberError as Yo, AccountSettingsSchema as Yp, listRssFeeds as Yr, CanWriteFileError as Ys, ListTrashError as Yt, PutioJsonPrimitive as Yu, ListTransfersError as Z, ListWaitingRequestsErrorSpec as Za, FileRenameInput as Zc, ValidateTokenResponse as Zd, OwnedOAuthAppSchema as Zf, PaymentPlanGroupSchema as Zi, buildFileApiContentUrl as Zl, PutioErrorEnvelopeSchema as Zm, SharingUnshareInput as Zn, createFamilyInvite as Zo, AccountSubtitleLanguageSchema as Zp, resumeRssFeed as Zr, ContinueFilesError as Zs, RestoreTrashError as Zt, deleteConfigKey as Zu, CreateZipInput as _, classifyPaymentChangePlanResponse as _a, FileBroad as _c, GenerateTOTPResponseSchema as _d, getVoucher as _f, isPutioApiError as _h, CreatePaddleWaitingPaymentErrorSpec as _i, FileUploadRequestDescriptor as _l, PutioHttpClientService as _m, DeletePublicShareErrorSpec as _n, CreateFriendInviteErrorSpec as _o, AppSpecificPasswordSchema as _p, CreateRssFeedErrorSpec as _r, HistoryKnownEventTypeSchema as _s, TransferSchema as _t, findNextFile as _u, PutioSdkEffectClient as a, PaymentVoucherInfoSchema as aa, DownloadUrlError as ac, AuthorizationCodeSchema as ad, buildAuthLoginUrl as af, PutioRateLimitError as ah, PodcastLinks as ai, FileSubtitle as al, SaveAccountSettingsPayload as am, continueTrash as an, UserSearchResultSchema as ao, UpdateOAuthAppErrorSpec as ap, getPublicShare as ar, DeleteEventErrorSpec as as, StopRecordingTransferError as at, convertFileSelectionToMp4 as au, ListZipsError as b, createPaddleBillingUpdatePaymentMethodTransaction as ba, FileConversionStatusSchema as bc, GrantsError as bd, login as bf, isPutioContractError as bh, GetPaymentInfoError as bi, FileVideoMetadata as bl, PutioPathSegment as bm, GetPublicShareFileUrlError as bn, FriendInviteJoinedUserSchema as bo, CreateAppSpecificPasswordInput as bp, GetRssFeedError as br, HistoryTransferCallbackErrorEventSchema as bs, TransferType as bt, getApiDownloadUrl as bu, PutioSdkService as c, RedeemPaymentVoucherError as ca, FileActiveConversionSchema as cc, FamilyInviteLookupError as cd, exchangeOAuthAuthorizationCode as cf, PutioTransportError as ch, getPodcastLinks as ci, FileSubtitlesErrorSpec as cl, destroyAccount as cm, listTrash as cn, denyFriendRequest as co, createOAuthApp as cp, getSharingCloneInfo as cr, EventsListResponse as cs, TransferAddInput as ct, copyFile as cu, makePutioSdkEffectClientLayer as d, ReportPaymentsErrorSpec as da, FileApiDownloadUrlOptions as dc, ForgotPasswordErrorSpec as dd, generateTOTP as df, PutioUnhandledSdkError as dh, ConfirmFastspringOrderErrorSpec as di, FileType as dl, listAccountConfirmations as dm, ContinuePublicShareFilesErrorSpec as dn, listSentRequests as do, getPopularOAuthApps as dp, listSharedFiles as dr, HistoryEvent as ds, TransferAddTrackersInputSchema as dt, createFolder as du, PaymentProviderNameSchema as ea, ContinueSearchErrorSpec as ec, readConfig as ed, VerifyTOTPErrorSpec as ef, PutioOperationError as eh, updateRssFeed as ei, FileSetSortInput as el, AccountWarningsSchema as em, TrashContinueResponse as en, SearchFriendsError as eo, QueryOAuthAppsError as ep, UnshareFileErrorSpec as er, listFamilyMembers as es, ReannounceTransferErrorSpec as et, buildFileHlsStreamUrl as eu, makePutioSdkLiveClientLayer as f, StopSubscriptionError as fa, FileApiMp4DownloadUrlOptions as fc, FriendInviteLookupError as fd, getCode as ff, PutioValidationError as fh, CreateOpenNodeChargeError as fi, FileTypeSchema as fl, listAccountSubtitleLanguages as fm, CreatePublicShareError as fn, listWaitingRequests as fo, queryOAuthApps as fp, shareFiles as fr, HistoryEventSchema as fs, TransferBaseSchema as ft, deleteFileExtraction as fu, CreateZipErrorSpec as g, UserSubscriptionStatusSchema as ga, FileBreadcrumbSchema as gc, GenerateTOTPResponse as gd, getRecoveryCodes as gf, fallbackPutioErrorEnvelope as gh, CreatePaddleWaitingPaymentError as gi, FileUploadInput as gl, PutioHttpClient as gm, DeletePublicShareError as gn, CreateFriendInviteError as go, AppSpecificPassword as gp, CreateRssFeedError as gr, HistoryKnownEventType as gs, TransferRemoveInputSchema as gt, extractFiles as gu, CreateZipError as h, SubmitPaymentChangePlanErrorSpec as ha, FileBreadcrumb as hc, GenerateTOTPErrorSpec as hd, getGiftCard as hf, definePutioOperationErrorSpec as hh, CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec as hi, FileUploadErrorSpec as hl, PutioAuth as hm, CreateSharingCloneErrorSpec as hn, sendFriendRequest as ho, updateOAuthApp as hp, ClearRssFeedLogsErrorSpec as hr, HistoryFileSharedEventSchema as hs, TransferRemoveInput as ht, deleteFiles as hu, PutioSdk as i, PaymentVoucherInfo as ia, CreateFolderErrorSpec as ic, AuthGetCodeInput as id, VoucherLookupErrorSpec as if, PutioOperationFailure as ih, PodcastLinkTypeSchema as ii, FileStartFromSetInput as il, SaveAccountSettingsErrorSpec as im, TrashListResponse as in, UserSearchResult as io, UpdateOAuthAppError as ip, deletePublicShare as ir, DeleteEventError as is, RetryTransferErrorSpec as it, continueSearch as iu, ListTunnelRoutesErrorSpec as j, reportPayments as ja, FileExtractionsErrorSpec as jc, OAuthAuthorizationCodeExchangeInput as jd, CreateOAuthAppErrorSpec as jf, responseRateLimitHeaders as jh, ListPaymentPlansErrorSpec as ji, FilesSearchQuerySchema as jl, makePutioFetchLayer as jm, ListSharedFilesErrorSpec as jn, IftttEventType as jo, deleteAppSpecificPassword as jp, RetryAllRssFeedItemsErrorSpec as jr, clearEvents as js, cancelTransfers as jt, listFileExtractions as ju, listZips as k, previewPaymentChangePlan as ka, FileExtractionStatusSchema as kc, OAuthAuthorizationCodeExchangeError as kd, verifyTOTP as kf, mapValidationError as kh, ListPaymentOptionsErrorSpec as ki, FilesMoveErrorSchema as kl, encodePathSegment as km, ListPublicSharesErrorSpec as kn, GetIftttStatusErrorSpec as ko, createAppSpecificPassword as kp, ResumeRssFeedErrorSpec as kr, ListEventsError as ks, addTransfer as kt, getXspfPlaylistUrl as ku, createPutioSdkEffectClient as l, RedeemPaymentVoucherErrorSpec as la, FileActiveConversionsError as lc, FamilyInviteLookupErrorSpec as ld, exists as lf, PutioTransportErrorValue as lh, ClassifiedPaymentChangePlanSubmitResponse as li, FileTouchInput as ll, getAccountInfo as lm, restoreTrash as ln, getFriendSharedFolder as lo, deleteOAuthApp as lp, listPublicShareFiles as lr, GetEventTorrentError as ls, TransferAddInputSchema as lt, createFileUploadFormData as lu, CancelZipErrorSpec as m, SubmitPaymentChangePlanError as ma, FileBaseSchema as mc, GenerateTOTPError as md, getFriendInvite as mf, decodePutioErrorEnvelope as mh, CreatePaddleBillingUpdatePaymentMethodTransactionError as mi, FileUploadError as ml, OkResponseSchema as mm, CreateSharingCloneError as mn, searchFriends as mo, setOAuthAppIcon as mp, ClearRssFeedLogsError as mr, HistoryFileSharedEvent as ms, TransferLink as mt, deleteFileSelection as mu, DEFAULT_PUTIO_UPLOAD_BASE_URL as n, PaymentSubscriptionInfoSchema as na, CopyFileErrorSpec as nc, setConfigKey as nd, VerifyTOTPResponseSchema as nf, PutioOperationErrorSpec as nh, PodcastGetLinksInputSchema as ni, FileSort as nl, PasInfoSchema as nm, TrashFileSchema as nn, SendFriendRequestError as no, RegenerateOAuthAppTokenError as np, continuePublicShareFiles as nr, ClearEventsError as ns, RemoveTransfersErrorSpec as nt, canWriteFile as nu, PutioSdkPromiseClient as o, PreviewPaymentChangePlanError as oa, DownloadUrlErrorSpec as oc, ClientsError as od, checkCodeMatch as of, PutioRateLimitErrorValue as oh, PodcastLinksResponse as oi, FileSubtitleSchema as ol, SaveAccountSettingsPayloadSchema as om, deleteTrash as on, approveFriendRequest as oo, buildOAuthAppIconRequest as op, getPublicShareFileUrl as or, EventsListQuery as os, StopRecordingTransferErrorSpec as ot, convertFileToMp4 as ou, CancelZipError as p, StopSubscriptionErrorSpec as pa, FileBase as pc, FriendInviteLookupErrorSpec as pd, getFamilyInvite as pf, PutioValidationErrorValue as ph, CreateOpenNodeChargeErrorSpec as pi, FileUploadEnvelope as pl, saveAccountSettings as pm, CreatePublicShareErrorSpec as pn, removeFriend as po, regenerateOAuthAppToken as pp, unshareFile as pr, HistoryFileFromRssDeletedEventSchema as ps, TransferInfoItem as pt, deleteFileMp4 as pu, GetTransferError as q, ListFriendsErrorSpec as qa, FileMp4MutationError as qc, RevokeOAuthGrantError as qd, OAuthAppWithTokenSchema as qf, PaymentOptionPlanTypeSchema as qi, StartFromError as ql, PutioConfigurationErrorValue as qm, SharingCloneInputSchema as qn, ListFamilyMembersError as qo, AccountInfoResponseFor as qp, getRssFeed as qr, createDownloadLinks as qs, EmptyTrashError as qt, JsonValueSchema as qu, DEFAULT_PUTIO_WEB_APP_URL as r, PaymentTypeSchema as ra, CreateFolderError as rc, writeConfig as rd, VoucherLookupError as rf, PutioOperationErrorValue as rh, PodcastLinkType as ri, FileSortSchema as rl, SaveAccountSettingsError as rm, TrashListQuery as rn, SendFriendRequestErrorSpec as ro, RegenerateOAuthAppTokenErrorSpec as rp, createPublicShare as rr, ClearEventsErrorSpec as rs, RetryTransferError as rt, continueFiles as ru, PutioSdkPromiseOperations as s, PreviewPaymentChangePlanErrorSpec as sa, FileActiveConversion as sc, ClientsErrorSpec as sd, clients as sf, PutioSdkError as sh, PodcastLinksSchema as si, FileSubtitlesError as sl, clearAccount as sm, emptyTrash as sn, countWaitingRequests as so, buildOAuthAuthorizeUrl as sp, getSharedWith as sr, EventsListQuerySchema as ss, Transfer as st, convertFilesToMp4 as su, DEFAULT_PUTIO_API_BASE_URL as t, PaymentProviderSchema as ta, CopyFileError as tc, readConfigWith as td, VerifyTOTPResponse as tf, PutioOperationErrorFromSpec as th, PodcastGetLinksInput as ti, FileSetSortInputSchema as tl, PasInfo as tm, TrashFile as tn, SearchFriendsErrorSpec as to, QueryOAuthAppsErrorSpec as tp, cloneSharedFiles as tr, removeFamilyMember as ts, RemoveTransfersError as tt, buildFileXspfPlaylistUrl as tu, createPutioSdkPromiseClient as u, ReportPaymentsError as ua, FileActiveConversionsErrorSpec as uc, ForgotPasswordError as ud, forgotPassword as uf, PutioTypedErrorEnvelope as uh, ConfirmFastspringOrderError as ui, FileTouchInputSchema as ul, getAccountSettings as um, ContinuePublicShareFilesError as un, listFriends as uo, getOAuthApp as up, listPublicShares as ur, GetEventTorrentErrorSpec as us, TransferAddTrackersInput as ut, createFileUploadRequest as uu, GetZipError as v, confirmFastspringOrder as va, FileBroadSchema as vc, GiftCardLookupError as vd, grants as vf, isPutioAuthError as vh, GetPaddleBillingInvoiceUrlError as vi, FileUploadResult as vl, PutioHttpRequest as vm, GetPublicShareError as vn, FriendInvite as vo, CreateAppSpecificPasswordError as vp, DeleteRssFeedError as vr, HistoryPrivateTorrentPinEventSchema as vs, TransferStatus as vt, findNextVideo as vu, ZipStatusSchema as w, getPaymentVoucherInfo as wa, FileCreateFolderInput as wc, LoginError as wd, resetPassword as wf, isPutioTransportError as wh, ListPaymentHistoryError as wi, FilesBulkSelection as wl, PutioSdkContext as wm, GetSharingCloneInfoError as wn, ListFriendInvitesError as wo, DeleteAllAppSpecificPasswordsErrorSpec as wp, ListRssFeedsError as wr, HistoryTransferFromRssErrorEventSchema as ws, TransfersListQuery as wt, getFileChild as wu, ListZipsErrorSpec as x, createPaddleWaitingPayment as xa, FileCopyInput as xc, GrantsErrorSpec as xd, logout as xf, isPutioErrorEnvelope as xh, GetPaymentInfoErrorSpec as xi, FileWatchStatusError as xl, PutioQuery as xm, GetPublicShareFileUrlErrorSpec as xn, FriendInviteJoinedUserStatus as xo, CreateAppSpecificPasswordInputSchema as xp, GetRssFeedErrorSpec as xr, HistoryTransferCompletedEvent as xs, TransferTypeSchema as xt, getApiMp4DownloadUrl as xu, GetZipErrorSpec as y, createOpenNodeCharge as ya, FileConversionStatus as yc, GiftCardLookupErrorSpec as yd, linkDevice as yf, isPutioConfigurationError as yh, GetPaddleBillingInvoiceUrlErrorSpec as yi, FileUploadTransfer as yl, PutioHttpResponse as ym, GetPublicShareErrorSpec as yn, FriendInviteJoinedUser as yo, CreateAppSpecificPasswordErrorSpec as yp, DeleteRssFeedErrorSpec as yr, HistoryRssFilterPausedEventSchema as ys, TransferStatusSchema as yt, getApiContentUrl as yu, AddManyTransfersError as z, DenyFriendRequestErrorSpec as za, FileMediaInfo as zc, RegisterInput as zd, OAuthAppCreateInput as zf, PaymentHistoryItemSchema as zi, GetHlsMasterPlaylistErrorSpec as zl, selectJsonField as zm, SharedFileSchema as zn, FamilyInviteSchema as zo, AccountDisk as zp, RssFeedParams as zr, DownloadLinksInfo as zs, reannounceTransfer as zt, resetStartFrom as zu };
18547
- //# sourceMappingURL=index-Nv-wxd2l.d.ts.map
18569
+ //# sourceMappingURL=index-B4Vt5XNs.d.ts.map