@putdotio/sdk 10.1.0 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A as definePutioOperationErrorSpec, B as mapTransportError, C as PutioConfigurationError, D as PutioTransportError, E as PutioRateLimitError, F as isPutioOperationError, H as responseRateLimitHeaders, I as isPutioRateLimitError, L as makeResponseError, M as isPutioApiError, N as isPutioAuthError, O as PutioValidationError, P as isPutioErrorEnvelope, R as mapConfigurationError, S as PutioAuthError, T as PutioOperationError, U as withOperationErrors, V as parseErrorBody, _ as selectJsonFields, a as PutioSdkConfig, b as DEFAULT_PUTIO_WEB_APP_URL, c as makePutioFetchClient, d as makePutioSdkLayer, f as makePutioSdkLiveLayer, g as selectJsonField, h as requestVoid, i as PutioHttpClient, j as fallbackPutioErrorEnvelope, k as decodePutioErrorEnvelope, l as makePutioFetchLayer, m as requestJson, n as toCursorSelectionForm, o as buildPutioUrl, p as requestArrayBuffer, r as OkResponseSchema, s as encodePathSegment, t as joinCsv, u as makePutioSdkConfig, v as DEFAULT_PUTIO_API_BASE_URL, w as PutioErrorEnvelopeSchema, x as PutioApiError, y as DEFAULT_PUTIO_UPLOAD_BASE_URL, z as mapDecodeErrorToValidationError } from "./forms-B3vYpwnj.js";
2
- import { Cause, Context, Effect, Exit, Layer, ManagedRuntime, Schema } from "effect";
1
+ import { A as definePutioOperationErrorSpec, B as mapTransportError, C as PutioConfigurationError, D as PutioTransportError, E as PutioRateLimitError, F as isPutioOperationError, H as responseRateLimitHeaders, I as isPutioRateLimitError, L as makeResponseError, M as isPutioApiError, N as isPutioAuthError, O as PutioValidationError, P as isPutioErrorEnvelope, R as mapConfigurationError, S as PutioAuthError, T as PutioOperationError, U as withOperationErrors, V as parseErrorBody, _ as selectJsonFields, a as PutioSdkConfig, b as DEFAULT_PUTIO_WEB_APP_URL, c as makePutioFetchClient, d as makePutioSdkLayer, f as makePutioSdkLiveLayer, g as selectJsonField, h as requestVoid, i as PutioHttpClient, j as fallbackPutioErrorEnvelope, k as decodePutioErrorEnvelope, l as makePutioFetchLayer, m as requestJson, n as toCursorSelectionForm, o as buildPutioUrl, p as requestArrayBuffer, r as OkResponseSchema, s as encodePathSegment, t as joinCsv, u as makePutioSdkConfig, v as DEFAULT_PUTIO_API_BASE_URL, w as PutioErrorEnvelopeSchema, x as PutioApiError, y as DEFAULT_PUTIO_UPLOAD_BASE_URL, z as mapDecodeErrorToValidationError } from "./forms-SpjrUB4N.js";
2
+ import { Cause, Context, Effect, Exit, Layer, ManagedRuntime, Option, Schema, SchemaIssue, SchemaParser } from "effect";
3
3
  //#region src/domains/account.ts
4
4
  const RequestedFlag$1 = Schema.Literal(1);
5
5
  const AccountDiskSchema = Schema.Struct({
@@ -76,14 +76,14 @@ const AccountInfoQuerySchema = Schema.Struct({
76
76
  features: Schema.optional(RequestedFlag$1),
77
77
  intercom: Schema.optional(RequestedFlag$1),
78
78
  pas: Schema.optional(RequestedFlag$1),
79
- platform: Schema.optional(Schema.String),
79
+ platform: Schema.optional(Schema.Literals(["web", "ios"])),
80
80
  profitwell: Schema.optional(RequestedFlag$1),
81
81
  push_token: Schema.optional(RequestedFlag$1)
82
82
  });
83
83
  const AccountInfoBroadSchema = AccountInfoBaseSchema.pipe(Schema.fieldsAssign({
84
84
  download_token: Schema.optional(Schema.String),
85
85
  features: Schema.optional(AccountFeaturesSchema),
86
- paddle_user_id: Schema.optional(Schema.NullOr(Schema.Int)),
86
+ paddle_user_id: Schema.optional(Schema.NullOr(Schema.Union([Schema.Int, Schema.String]))),
87
87
  pas: Schema.optional(PasInfoSchema),
88
88
  push_token: Schema.optional(Schema.String),
89
89
  user_hash: Schema.optional(Schema.String)
@@ -108,7 +108,7 @@ const AccountTwoFactorSettingsSchema = Schema.Struct({
108
108
  code: Schema.String,
109
109
  enable: Schema.Boolean
110
110
  });
111
- const AccountSettingsPatchSchema = Schema.Struct({
111
+ const SaveAccountSettingsCommonFields = {
112
112
  beta_user: Schema.optional(AccountSettingsFields.beta_user),
113
113
  callback_url: Schema.optional(AccountSettingsFields.callback_url),
114
114
  dark_theme: Schema.optional(AccountSettingsFields.dark_theme),
@@ -134,20 +134,24 @@ const AccountSettingsPatchSchema = Schema.Struct({
134
134
  two_factor_enabled: Schema.optional(AccountSettingsFields.two_factor_enabled),
135
135
  use_private_download_ip: Schema.optional(AccountSettingsFields.use_private_download_ip),
136
136
  use_start_from: Schema.optional(AccountSettingsFields.use_start_from),
137
- video_player: Schema.optional(AccountSettingsFields.video_player)
138
- });
137
+ video_player: Schema.optional(AccountSettingsFields.video_player),
138
+ two_factor_enabled: Schema.optional(AccountTwoFactorSettingsSchema),
139
+ username: Schema.optional(Schema.String)
140
+ };
139
141
  const SaveAccountSettingsPayloadSchema = Schema.Union([
140
- AccountSettingsPatchSchema,
141
- Schema.Struct({ username: Schema.String }),
142
+ Schema.Struct(SaveAccountSettingsCommonFields),
142
143
  Schema.Struct({
144
+ ...SaveAccountSettingsCommonFields,
143
145
  current_password: Schema.String,
144
- mail: Schema.String
146
+ mail: Schema.String,
147
+ password: Schema.optional(Schema.String)
145
148
  }),
146
149
  Schema.Struct({
150
+ ...SaveAccountSettingsCommonFields,
147
151
  current_password: Schema.String,
152
+ mail: Schema.optional(Schema.String),
148
153
  password: Schema.String
149
- }),
150
- Schema.Struct({ two_factor_enabled: AccountTwoFactorSettingsSchema })
154
+ })
151
155
  ]);
152
156
  const AccountClearOptionsSchema = Schema.Struct({
153
157
  active_transfers: Schema.Boolean,
@@ -159,13 +163,14 @@ const AccountClearOptionsSchema = Schema.Struct({
159
163
  rss_logs: Schema.Boolean,
160
164
  trash: Schema.Boolean
161
165
  });
166
+ const AccountConfirmationSubjectSchema = Schema.Literals([
167
+ "mail_change",
168
+ "password_change",
169
+ "subscription_upgrade"
170
+ ]);
162
171
  const AccountConfirmationSchema = Schema.Struct({
163
172
  created_at: Schema.String,
164
- subject: Schema.Literals([
165
- "mail_change",
166
- "password_change",
167
- "subscription_upgrade"
168
- ])
173
+ subject: AccountConfirmationSubjectSchema
169
174
  });
170
175
  const AccountConfirmationsEnvelopeSchema = Schema.Struct({
171
176
  confirmations: Schema.Array(AccountConfirmationSchema),
@@ -174,9 +179,13 @@ const AccountConfirmationsEnvelopeSchema = Schema.Struct({
174
179
  const missingFieldError$1 = (field) => new PutioValidationError({ cause: `Expected put.io to include "${field}" because it was requested` });
175
180
  const failMissingField$1 = (field) => Effect.fail(missingFieldError$1(field));
176
181
  const widenValidationError$1 = (effect) => effect;
182
+ const mapSensitiveAccountDecodeError = (operation) => () => new PutioValidationError({ cause: {
183
+ domain: "account",
184
+ operation,
185
+ reason: "Invalid request input"
186
+ } });
177
187
  const hasDownloadToken = (value) => typeof value.download_token === "string";
178
188
  const hasFeatures = (value) => typeof value.features === "object" && value.features !== null;
179
- const hasIntercomUserHash = (value) => typeof value.user_hash === "string";
180
189
  const hasPas = (value) => typeof value.pas === "object" && value.pas !== null && typeof value.pas.user_hash === "string";
181
190
  const hasPaddleUserId = (value) => "paddle_user_id" in value;
182
191
  const hasPushToken = (value) => typeof value.push_token === "string";
@@ -184,7 +193,6 @@ const ensureAccountInfoFields = (effect, query) => Effect.gen(function* () {
184
193
  const info = yield* widenValidationError$1(effect);
185
194
  if (query.download_token === 1 && !hasDownloadToken(info)) return yield* failMissingField$1("download_token");
186
195
  if (query.features === 1 && !hasFeatures(info)) return yield* failMissingField$1("features");
187
- if (query.intercom === 1 && !hasIntercomUserHash(info)) return yield* failMissingField$1("user_hash");
188
196
  if (query.pas === 1 && !hasPas(info)) return yield* failMissingField$1("pas");
189
197
  if (query.profitwell === 1 && !hasPaddleUserId(info)) return yield* failMissingField$1("paddle_user_id");
190
198
  if (query.push_token === 1 && !hasPushToken(info)) return yield* failMissingField$1("push_token");
@@ -277,12 +285,14 @@ const AccountConfirmationsErrorSpec = definePutioOperationErrorSpec({
277
285
  }]
278
286
  });
279
287
  function getAccountInfo(query = {}) {
280
- const effect = requestJson(AccountInfoEnvelopeSchema, {
281
- method: "GET",
282
- path: "/v2/account/info",
283
- query
284
- }).pipe(selectJsonField("info"));
285
- return ensureAccountInfoFields(effect, query);
288
+ return Schema.decodeUnknownEffect(AccountInfoQuerySchema, { onExcessProperty: "error" })(query).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedQuery) => {
289
+ const effect = requestJson(AccountInfoEnvelopeSchema, {
290
+ method: "GET",
291
+ path: "/v2/account/info",
292
+ query: decodedQuery
293
+ }).pipe(selectJsonField("info"));
294
+ return ensureAccountInfoFields(effect, decodedQuery);
295
+ }));
286
296
  }
287
297
  const getAccountSettings = () => requestJson(AccountSettingsEnvelopeSchema, {
288
298
  method: "GET",
@@ -292,35 +302,124 @@ const listAccountSubtitleLanguages = () => requestJson(AccountSubtitleLanguagesE
292
302
  method: "GET",
293
303
  path: "/v2/account/subtitle_languages"
294
304
  }).pipe(selectJsonField("languages"));
295
- const saveAccountSettings = (payload) => requestJson(OkResponseSchema, {
305
+ const saveAccountSettings = (payload) => Schema.decodeUnknownEffect(SaveAccountSettingsPayloadSchema, { onExcessProperty: "error" })(payload).pipe(Effect.mapError(mapSensitiveAccountDecodeError("saveSettings")), Effect.flatMap((decodedPayload) => requestJson(OkResponseSchema, {
296
306
  body: {
297
307
  type: "json",
298
- value: payload
308
+ value: decodedPayload
299
309
  },
300
310
  method: "POST",
301
311
  path: "/v2/account/settings"
302
- }).pipe(withOperationErrors(SaveAccountSettingsErrorSpec));
303
- const clearAccount = (options) => requestJson(OkResponseSchema, {
312
+ })), withOperationErrors(SaveAccountSettingsErrorSpec));
313
+ const clearAccount = (options) => Schema.decodeUnknownEffect(AccountClearOptionsSchema, { onExcessProperty: "error" })(options).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedOptions) => requestJson(OkResponseSchema, {
304
314
  body: {
305
315
  type: "form",
306
- value: options
316
+ value: decodedOptions
307
317
  },
308
318
  method: "POST",
309
319
  path: "/v2/account/clear"
310
- });
311
- const destroyAccount = (currentPassword) => requestJson(OkResponseSchema, {
320
+ })));
321
+ const destroyAccount = (currentPassword) => Schema.decodeUnknownEffect(Schema.String.check(Schema.isMinLength(1)))(currentPassword).pipe(Effect.mapError(mapSensitiveAccountDecodeError("destroy")), Effect.flatMap((decodedPassword) => requestJson(OkResponseSchema, {
312
322
  body: {
313
323
  type: "form",
314
- value: { current_password: currentPassword }
324
+ value: { current_password: decodedPassword }
315
325
  },
316
326
  method: "POST",
317
327
  path: "/v2/account/destroy"
318
- });
319
- const listAccountConfirmations = (subject) => requestJson(AccountConfirmationsEnvelopeSchema, {
328
+ })));
329
+ const listAccountConfirmations = (subject) => Schema.decodeUnknownEffect(Schema.UndefinedOr(AccountConfirmationSubjectSchema))(subject).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedSubject) => requestJson(AccountConfirmationsEnvelopeSchema, {
320
330
  method: "GET",
321
331
  path: "/v2/account/confirmation/list",
322
- query: subject ? { type: subject } : void 0
323
- }).pipe(selectJsonField("confirmations"), withOperationErrors(AccountConfirmationsErrorSpec));
332
+ query: decodedSubject ? { type: decodedSubject } : void 0
333
+ })), selectJsonField("confirmations"), withOperationErrors(AccountConfirmationsErrorSpec));
334
+ //#endregion
335
+ //#region src/domains/app-specific-passwords.ts
336
+ const AppSpecificPasswordIdSchema = Schema.Int.check(Schema.isGreaterThan(0));
337
+ const AppSpecificPasswordNoteSchema = Schema.Trim.check(Schema.isMinLength(1), Schema.isMaxLength(255));
338
+ const MaskedIpv4AddressPattern = /^(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}XXX$/;
339
+ const Ipv6HextetPattern = /^[\dA-Fa-f]{1,4}$/;
340
+ const isMaskedIpv6Address = (value) => {
341
+ const compressedParts = value.split("::");
342
+ if (compressedParts.length > 2) return false;
343
+ const hextets = compressedParts.flatMap((part) => part === "" ? [] : part.split(":"));
344
+ if (hextets.at(-1) !== "X" || !hextets.slice(0, -1).every((part) => Ipv6HextetPattern.test(part))) return false;
345
+ return compressedParts.length === 2 ? hextets.length < 8 : hextets.length === 8;
346
+ };
347
+ const MaskedIpAddressSchema = Schema.String.check(Schema.makeFilter((value) => MaskedIpv4AddressPattern.test(value) || isMaskedIpv6Address(value) ? void 0 : "Expected a masked IP address"));
348
+ const AppSpecificPasswordSchema = Schema.Struct({
349
+ created_at: Schema.String,
350
+ id: AppSpecificPasswordIdSchema,
351
+ ip_address: Schema.NullOr(MaskedIpAddressSchema),
352
+ last_used_at: Schema.NullOr(Schema.String),
353
+ note: Schema.String
354
+ });
355
+ const CreateAppSpecificPasswordInputSchema = Schema.Struct({ note: AppSpecificPasswordNoteSchema });
356
+ const CreateAppSpecificPasswordEnvelopeSchema = AppSpecificPasswordSchema.pipe(Schema.fieldsAssign({
357
+ password: Schema.String,
358
+ status: Schema.Literal("OK")
359
+ }));
360
+ const ListAppSpecificPasswordsEnvelopeSchema = Schema.Struct({
361
+ passwords: Schema.Array(AppSpecificPasswordSchema),
362
+ status: Schema.Literal("OK")
363
+ });
364
+ const RestrictedAppSpecificPasswordError = {
365
+ errorType: "invalid_scope",
366
+ statusCode: 401
367
+ };
368
+ const CreateAppSpecificPasswordErrorSpec = definePutioOperationErrorSpec({
369
+ domain: "account",
370
+ operation: "appSpecificPasswords.create",
371
+ knownErrors: [
372
+ {
373
+ errorType: "NOTE_REQUIRED",
374
+ statusCode: 400
375
+ },
376
+ {
377
+ errorType: "NOTE_TOO_LONG",
378
+ statusCode: 400
379
+ },
380
+ {
381
+ bodySchema: PutioErrorEnvelopeSchema.pipe(Schema.fieldsAssign({ extra: Schema.Struct({ limit: Schema.Int }) })),
382
+ errorType: "TOO_MANY_APP_SPECIFIC_PASSWORDS",
383
+ statusCode: 403
384
+ },
385
+ RestrictedAppSpecificPasswordError
386
+ ]
387
+ });
388
+ const ListAppSpecificPasswordsErrorSpec = definePutioOperationErrorSpec({
389
+ domain: "account",
390
+ operation: "appSpecificPasswords.list",
391
+ knownErrors: [RestrictedAppSpecificPasswordError]
392
+ });
393
+ const DeleteAppSpecificPasswordErrorSpec = definePutioOperationErrorSpec({
394
+ domain: "account",
395
+ operation: "appSpecificPasswords.delete",
396
+ knownErrors: [RestrictedAppSpecificPasswordError]
397
+ });
398
+ const DeleteAllAppSpecificPasswordsErrorSpec = definePutioOperationErrorSpec({
399
+ domain: "account",
400
+ operation: "appSpecificPasswords.deleteAll",
401
+ knownErrors: [RestrictedAppSpecificPasswordError]
402
+ });
403
+ const createAppSpecificPassword = (input) => Schema.decodeUnknownEffect(CreateAppSpecificPasswordInputSchema)(input).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(CreateAppSpecificPasswordEnvelopeSchema, {
404
+ body: {
405
+ type: "form",
406
+ value: decodedInput
407
+ },
408
+ method: "POST",
409
+ path: "/v2/app_specific_password/create"
410
+ })), selectJsonFields("created_at", "id", "ip_address", "last_used_at", "note", "password"), withOperationErrors(CreateAppSpecificPasswordErrorSpec));
411
+ const listAppSpecificPasswords = () => requestJson(ListAppSpecificPasswordsEnvelopeSchema, {
412
+ method: "GET",
413
+ path: "/v2/app_specific_password/list"
414
+ }).pipe(selectJsonField("passwords"), withOperationErrors(ListAppSpecificPasswordsErrorSpec));
415
+ const deleteAppSpecificPassword = (id) => Schema.decodeUnknownEffect(AppSpecificPasswordIdSchema)(id).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedId) => requestJson(OkResponseSchema, {
416
+ method: "POST",
417
+ path: `/v2/app_specific_password/${encodePathSegment(decodedId)}/delete`
418
+ })), Effect.asVoid, withOperationErrors(DeleteAppSpecificPasswordErrorSpec));
419
+ const deleteAllAppSpecificPasswords = () => requestJson(OkResponseSchema, {
420
+ method: "POST",
421
+ path: "/v2/app_specific_password/delete_all"
422
+ }).pipe(Effect.asVoid, withOperationErrors(DeleteAllAppSpecificPasswordsErrorSpec));
324
423
  //#endregion
325
424
  //#region src/domains/oauth.ts
326
425
  const OAuthAppBaseSchema = Schema.Struct({
@@ -1039,65 +1138,193 @@ const regenerateRecoveryCodes = () => requestJson(RecoveryCodesEnvelopeSchema, {
1039
1138
  }).pipe(selectJsonField("recovery_codes"), withOperationErrors(RegenerateRecoveryCodesErrorSpec));
1040
1139
  //#endregion
1041
1140
  //#region src/domains/config.ts
1042
- const isJsonValue = (value) => {
1043
- if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") return true;
1044
- if (Array.isArray(value)) return value.every(isJsonValue);
1045
- if (typeof value === "object") return Object.values(value).every(isJsonValue);
1046
- return false;
1141
+ const nativeObjectConstructorSource = Function.prototype.toString.call(Object);
1142
+ const nativeArrayConstructorSource = Function.prototype.toString.call(Array);
1143
+ const hasMatchingNativeConstructor = (prototype, constructorSource) => {
1144
+ const constructor = Object.getOwnPropertyDescriptor(prototype, "constructor")?.value;
1145
+ const constructorPrototype = typeof constructor === "function" ? Object.getOwnPropertyDescriptor(constructor, "prototype")?.value : void 0;
1146
+ return typeof constructor === "function" && constructorPrototype === prototype && Function.prototype.toString.call(constructor) === constructorSource;
1047
1147
  };
1048
- const isJsonObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && isJsonValue(value);
1049
- const JsonValueSchema = Schema.Unknown.pipe(Schema.refine(isJsonValue, { expected: "a JSON-compatible value" }));
1050
- const JsonObjectSchema = Schema.Unknown.pipe(Schema.refine(isJsonObject, { expected: "a JSON object" }));
1051
- const ConfigEnvelopeSchema = Schema.Struct({
1052
- config: JsonObjectSchema,
1053
- status: Schema.Literal("OK")
1054
- });
1055
- const ConfigValueEnvelopeSchema = Schema.Struct({
1056
- status: Schema.Literal("OK"),
1148
+ const isPlainRecord = (value) => {
1149
+ try {
1150
+ const prototype = Object.getPrototypeOf(value);
1151
+ if (prototype === null) return true;
1152
+ if (Object.getPrototypeOf(prototype) !== null) return false;
1153
+ return hasMatchingNativeConstructor(prototype, nativeObjectConstructorSource);
1154
+ } catch {
1155
+ return false;
1156
+ }
1157
+ };
1158
+ const isPlainArray = (value) => {
1159
+ try {
1160
+ const prototype = Object.getPrototypeOf(value);
1161
+ return prototype !== null && Object.getPrototypeOf(prototype) !== null && hasMatchingNativeConstructor(prototype, nativeArrayConstructorSource);
1162
+ } catch {
1163
+ return false;
1164
+ }
1165
+ };
1166
+ const invalidJsonWalk = { _tag: "Invalid" };
1167
+ const validatedJsonWalk = { _tag: "Validated" };
1168
+ const walkJsonValue = (value, mode, ancestors = /* @__PURE__ */ new Set()) => {
1169
+ if (value === null || typeof value === "string" || typeof value === "boolean") return mode === "snapshot" ? {
1170
+ _tag: "Snapshot",
1171
+ value
1172
+ } : validatedJsonWalk;
1173
+ if (typeof value === "number") return Number.isFinite(value) ? mode === "snapshot" ? {
1174
+ _tag: "Snapshot",
1175
+ value
1176
+ } : validatedJsonWalk : invalidJsonWalk;
1177
+ if (typeof value !== "object" || ancestors.has(value)) return invalidJsonWalk;
1178
+ ancestors.add(value);
1179
+ try {
1180
+ if (Array.isArray(value)) {
1181
+ if (!isPlainArray(value)) return invalidJsonWalk;
1182
+ const descriptors = Object.getOwnPropertyDescriptors(value);
1183
+ const lengthDescriptor = descriptors["length"];
1184
+ if (lengthDescriptor === void 0 || !("value" in lengthDescriptor) || !Number.isSafeInteger(lengthDescriptor.value) || lengthDescriptor.value < 0) return invalidJsonWalk;
1185
+ const output = mode === "snapshot" ? [] : void 0;
1186
+ for (let index = 0; index < lengthDescriptor.value; index += 1) {
1187
+ const descriptor = descriptors[String(index)];
1188
+ if (descriptor === void 0 || !("value" in descriptor)) return invalidJsonWalk;
1189
+ const item = walkJsonValue(descriptor.value, mode, ancestors);
1190
+ if (item._tag === "Invalid") return item;
1191
+ if (output === void 0) {
1192
+ if (item._tag !== "Validated") return invalidJsonWalk;
1193
+ } else {
1194
+ if (item._tag !== "Snapshot") return invalidJsonWalk;
1195
+ output.push(item.value);
1196
+ }
1197
+ }
1198
+ return output === void 0 ? validatedJsonWalk : {
1199
+ _tag: "Snapshot",
1200
+ value: output
1201
+ };
1202
+ }
1203
+ if (!isPlainRecord(value)) return invalidJsonWalk;
1204
+ const output = mode === "snapshot" ? {} : void 0;
1205
+ for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {
1206
+ if (!descriptor.enumerable) continue;
1207
+ if (!("value" in descriptor)) return invalidJsonWalk;
1208
+ const item = walkJsonValue(descriptor.value, mode, ancestors);
1209
+ if (item._tag === "Invalid") return item;
1210
+ if (output === void 0) {
1211
+ if (item._tag !== "Validated") return invalidJsonWalk;
1212
+ continue;
1213
+ }
1214
+ if (item._tag !== "Snapshot") return invalidJsonWalk;
1215
+ Object.defineProperty(output, key, {
1216
+ configurable: true,
1217
+ enumerable: true,
1218
+ value: item.value,
1219
+ writable: true
1220
+ });
1221
+ }
1222
+ return output === void 0 ? validatedJsonWalk : {
1223
+ _tag: "Snapshot",
1224
+ value: output
1225
+ };
1226
+ } catch {
1227
+ return invalidJsonWalk;
1228
+ } finally {
1229
+ ancestors.delete(value);
1230
+ }
1231
+ };
1232
+ const snapshotJsonValue = (value) => {
1233
+ const result = walkJsonValue(value, "snapshot");
1234
+ return result._tag === "Snapshot" ? result.value : void 0;
1235
+ };
1236
+ const snapshotJsonObject = (value) => {
1237
+ const snapshot = snapshotJsonValue(value);
1238
+ return typeof snapshot === "object" && snapshot !== null && !Array.isArray(snapshot) ? snapshot : void 0;
1239
+ };
1240
+ const isJsonValue = (value) => walkJsonValue(value, "validate")._tag === "Validated";
1241
+ const isJsonObject = (value) => typeof value === "object" && value !== null && isJsonValue(value) && !Array.isArray(value);
1242
+ const JsonValueSchema = Schema.declareConstructor()([], () => (input, ast) => {
1243
+ const snapshot = snapshotJsonValue(input);
1244
+ return snapshot === void 0 ? Effect.fail(new SchemaIssue.InvalidType(ast, Option.none())) : Effect.succeed(snapshot);
1245
+ }, { expected: "a JSON-compatible value" });
1246
+ const JsonValueResponseSchema = Schema.declareConstructor()([], () => (input, ast) => isJsonValue(input) ? Effect.succeed(input) : Effect.fail(new SchemaIssue.InvalidType(ast, Option.none())), { expected: "a JSON-compatible value" });
1247
+ const JsonObjectResponseSchema = Schema.declareConstructor()([], () => (input, ast) => isJsonObject(input) ? Effect.succeed(input) : Effect.fail(new SchemaIssue.InvalidType(ast, Option.none())), { expected: "a JSON object" });
1248
+ const JsonObjectSchema = Schema.declareConstructor()([], () => (input, ast) => {
1249
+ const snapshot = snapshotJsonObject(input);
1250
+ return snapshot === void 0 ? Effect.fail(new SchemaIssue.InvalidType(ast, Option.none())) : Effect.succeed(snapshot);
1251
+ }, { expected: "a JSON object" });
1252
+ const ConfigKeySchema = Schema.String.check(Schema.isMinLength(1), Schema.isPattern(/^(?!\.{1,2}$)/), Schema.makeFilter((key) => key.isWellFormed(), { expected: "a well-formed Unicode config key" }));
1253
+ const ConfigSetKeyInputSchema = Schema.Struct({
1254
+ key: ConfigKeySchema,
1057
1255
  value: JsonValueSchema
1058
1256
  });
1257
+ const getResponseEnvelopeFields = (input, valueField) => {
1258
+ if (typeof input !== "object" || input === null || !isPlainRecord(input)) return;
1259
+ try {
1260
+ const statusDescriptor = Object.getOwnPropertyDescriptor(input, "status");
1261
+ const valueDescriptor = Object.getOwnPropertyDescriptor(input, valueField);
1262
+ if (statusDescriptor === void 0 || !("value" in statusDescriptor) || valueDescriptor === void 0 || !("value" in valueDescriptor)) return;
1263
+ return {
1264
+ status: statusDescriptor.value,
1265
+ value: valueDescriptor.value
1266
+ };
1267
+ } catch {
1268
+ return;
1269
+ }
1270
+ };
1271
+ const makeConfigEnvelopeSchema = (schema) => Schema.declareConstructor()([schema], ([configSchema]) => (input, ast, options) => {
1272
+ const fields = getResponseEnvelopeFields(input, "config");
1273
+ if (fields === void 0 || fields.status !== "OK") return Effect.fail(new SchemaIssue.InvalidType(ast, Option.none()));
1274
+ return SchemaParser.decodeUnknownEffect(configSchema)(fields.value, options).pipe(Effect.map((config) => ({
1275
+ config,
1276
+ status: "OK"
1277
+ })));
1278
+ });
1279
+ const makeConfigValueEnvelopeSchema = (schema) => Schema.declareConstructor()([schema], ([valueSchema]) => (input, ast, options) => {
1280
+ const fields = getResponseEnvelopeFields(input, "value");
1281
+ if (fields === void 0 || fields.status !== "OK") return Effect.fail(new SchemaIssue.InvalidType(ast, Option.none()));
1282
+ return SchemaParser.decodeUnknownEffect(valueSchema)(fields.value, options).pipe(Effect.map((value) => ({
1283
+ status: "OK",
1284
+ value
1285
+ })));
1286
+ });
1287
+ const ConfigEnvelopeSchema = makeConfigEnvelopeSchema(JsonObjectResponseSchema);
1288
+ const ConfigValueEnvelopeSchema = makeConfigValueEnvelopeSchema(JsonValueResponseSchema);
1059
1289
  const readConfig = () => requestJson(ConfigEnvelopeSchema, {
1060
1290
  method: "GET",
1061
1291
  path: "/v2/config"
1062
1292
  }).pipe(selectJsonField("config"));
1063
- const readConfigWith = (schema) => requestJson(Schema.Struct({
1064
- config: schema,
1065
- status: Schema.Literal("OK")
1066
- }), {
1293
+ const readConfigWith = (schema) => requestJson(makeConfigEnvelopeSchema(JsonObjectResponseSchema.pipe(Schema.decodeTo(schema))), {
1067
1294
  method: "GET",
1068
1295
  path: "/v2/config"
1069
1296
  }).pipe(Effect.map((envelope) => envelope["config"]));
1070
- const writeConfig = (config) => requestJson(OkResponseSchema, {
1297
+ const writeConfig = (config) => Schema.decodeUnknownEffect(JsonObjectSchema)(config).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedConfig) => requestJson(OkResponseSchema, {
1071
1298
  body: {
1072
1299
  type: "json",
1073
- value: { config }
1300
+ value: { config: decodedConfig }
1074
1301
  },
1075
1302
  method: "PUT",
1076
1303
  path: "/v2/config"
1077
- });
1078
- const getConfigKey = (key) => requestJson(ConfigValueEnvelopeSchema, {
1304
+ })));
1305
+ const getConfigKey = (key) => Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedKey) => requestJson(ConfigValueEnvelopeSchema, {
1079
1306
  method: "GET",
1080
- path: `/v2/config/${encodePathSegment(key)}`
1081
- }).pipe(selectJsonField("value"));
1082
- const getConfigKeyWith = (key, schema) => requestJson(Schema.Struct({
1083
- status: Schema.Literal("OK"),
1084
- value: schema
1085
- }), {
1307
+ path: `/v2/config/${encodePathSegment(decodedKey)}`
1308
+ })), selectJsonField("value"));
1309
+ const getConfigKeyWith = (key, schema) => Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedKey) => requestJson(makeConfigValueEnvelopeSchema(JsonValueResponseSchema.pipe(Schema.decodeTo(schema))), {
1086
1310
  method: "GET",
1087
- path: `/v2/config/${encodePathSegment(key)}`
1088
- }).pipe(Effect.map((envelope) => envelope["value"]));
1089
- const setConfigKey = (key, value) => requestJson(OkResponseSchema, {
1311
+ path: `/v2/config/${encodePathSegment(decodedKey)}`
1312
+ })), Effect.map((envelope) => envelope["value"]));
1313
+ const setConfigKey = (key, value) => Schema.decodeUnknownEffect(ConfigSetKeyInputSchema)({
1314
+ key,
1315
+ value
1316
+ }).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedInput) => requestJson(OkResponseSchema, {
1090
1317
  body: {
1091
1318
  type: "json",
1092
- value: { value }
1319
+ value: { value: decodedInput.value }
1093
1320
  },
1094
1321
  method: "PUT",
1095
- path: `/v2/config/${encodePathSegment(key)}`
1096
- });
1097
- const deleteConfigKey = (key) => requestJson(OkResponseSchema, {
1322
+ path: `/v2/config/${encodePathSegment(decodedInput.key)}`
1323
+ })));
1324
+ const deleteConfigKey = (key) => Schema.decodeUnknownEffect(ConfigKeySchema)(key).pipe(Effect.mapError(mapDecodeErrorToValidationError), Effect.flatMap((decodedKey) => requestJson(OkResponseSchema, {
1098
1325
  method: "DELETE",
1099
- path: `/v2/config/${encodePathSegment(key)}`
1100
- });
1326
+ path: `/v2/config/${encodePathSegment(decodedKey)}`
1327
+ })));
1101
1328
  //#endregion
1102
1329
  //#region src/domains/download-links.ts
1103
1330
  const DownloadLinksStatusSchema = Schema.Literals([
@@ -1724,7 +1951,7 @@ const FileConversionNotAvailableSchema = Schema.Struct({
1724
1951
  });
1725
1952
  const FileConversionInQueueSchema = Schema.Struct({
1726
1953
  id: Schema.Int,
1727
- percent_done: Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)),
1954
+ percent_done: Schema.optional(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),
1728
1955
  status: Schema.Literal("IN_QUEUE")
1729
1956
  });
1730
1957
  const FileConversionConvertingSchema = Schema.Struct({
@@ -2269,10 +2496,10 @@ const setStartFrom = (input) => requestJson(OkResponseSchema, {
2269
2496
  value: { time: input.time }
2270
2497
  },
2271
2498
  method: "POST",
2272
- path: `/v2/files/${encodePathSegment(input.file_id)}/start-from/set`
2499
+ path: `/v2/files/${encodePathSegment(input.file_id)}/start-from`
2273
2500
  }).pipe(withOperationErrors(StartFromErrorSpec));
2274
2501
  const resetStartFrom = (fileId) => requestJson(OkResponseSchema, {
2275
- method: "GET",
2502
+ method: "POST",
2276
2503
  path: `/v2/files/${encodePathSegment(fileId)}/start-from/delete`
2277
2504
  }).pipe(withOperationErrors(StartFromErrorSpec));
2278
2505
  const getMp4Status = (fileId) => requestJson(FileConversionStatusEnvelopeSchema, {
@@ -4644,19 +4871,19 @@ const cancelZip = (id) => requestJson(OkResponseSchema, {
4644
4871
  //#endregion
4645
4872
  //#region src/core/client.ts
4646
4873
  const promiseClientRuntimeCache = /* @__PURE__ */ new WeakMap();
4647
- const disposedPromiseClientConfigs = /* @__PURE__ */ new WeakSet();
4648
- const getPromiseClientRuntime = (config) => {
4649
- if (disposedPromiseClientConfigs.has(config)) throw mapConfigurationError("This Promise client has been disposed and can no longer execute SDK effects");
4650
- const cachedRuntime = promiseClientRuntimeCache.get(config);
4874
+ const disposedPromiseClientStates = /* @__PURE__ */ new WeakSet();
4875
+ const getPromiseClientRuntime = (state) => {
4876
+ if (disposedPromiseClientStates.has(state)) throw mapConfigurationError("This Promise client has been disposed and can no longer execute SDK effects");
4877
+ const cachedRuntime = promiseClientRuntimeCache.get(state);
4651
4878
  if (cachedRuntime) return cachedRuntime;
4652
- const runtime = ManagedRuntime.make(makePutioSdkLiveLayer(config));
4653
- promiseClientRuntimeCache.set(config, runtime);
4879
+ const runtime = ManagedRuntime.make(makePutioSdkLiveLayer(state.runtimeConfig));
4880
+ promiseClientRuntimeCache.set(state, runtime);
4654
4881
  return runtime;
4655
4882
  };
4656
- const disposePromiseClientRuntime = async (config) => {
4657
- disposedPromiseClientConfigs.add(config);
4658
- const runtime = promiseClientRuntimeCache.get(config);
4659
- promiseClientRuntimeCache.delete(config);
4883
+ const disposePromiseClientRuntime = async (state) => {
4884
+ disposedPromiseClientStates.add(state);
4885
+ const runtime = promiseClientRuntimeCache.get(state);
4886
+ promiseClientRuntimeCache.delete(state);
4660
4887
  if (!runtime) return;
4661
4888
  await runtime.dispose();
4662
4889
  };
@@ -4668,9 +4895,23 @@ const rejectWithSdkFailure = (exit) => Exit.match(exit, {
4668
4895
  return Promise.reject(Cause.squash(cause));
4669
4896
  }
4670
4897
  });
4671
- const provideSdk = async (config, effect) => rejectWithSdkFailure(await getPromiseClientRuntime(config).runPromiseExit(effect));
4898
+ const provideSdk = async (state, effect) => {
4899
+ const operationConfig = {
4900
+ ...state.runtimeConfig,
4901
+ accessToken: state.accessToken
4902
+ };
4903
+ const operation = Effect.provideService(effect, PutioSdkConfig, operationConfig);
4904
+ return rejectWithSdkFailure(await getPromiseClientRuntime(state).runPromiseExit(operation));
4905
+ };
4906
+ const snapshotUrl = (value) => typeof value === "string" || value === void 0 ? value : new URL(value.href);
4672
4907
  const createPutioSdkEffectClient = () => ({
4673
4908
  account: {
4909
+ appSpecificPasswords: {
4910
+ create: createAppSpecificPassword,
4911
+ delete: deleteAppSpecificPassword,
4912
+ deleteAll: deleteAllAppSpecificPasswords,
4913
+ list: listAppSpecificPasswords
4914
+ },
4674
4915
  clear: clearAccount,
4675
4916
  destroy: destroyAccount,
4676
4917
  getInfo: getAccountInfo,
@@ -4893,8 +5134,22 @@ var PutioSdk = class extends Context.Service()("PutioSdk") {};
4893
5134
  const makePutioSdkEffectClientLayer = () => Layer.succeed(PutioSdk, createPutioSdkEffectClient());
4894
5135
  const makePutioSdkLiveClientLayer = (config) => Layer.mergeAll(makePutioSdkEffectClientLayer(), makePutioSdkLiveLayer(config));
4895
5136
  const createPutioSdkPromiseClient = (initialConfig = {}) => {
4896
- const config = { ...initialConfig };
4897
- function getInfo(query) {
5137
+ const normalizedConfig = makePutioSdkConfig({
5138
+ ...initialConfig,
5139
+ baseUrl: snapshotUrl(initialConfig.baseUrl),
5140
+ uploadBaseUrl: snapshotUrl(initialConfig.uploadBaseUrl),
5141
+ webAppUrl: snapshotUrl(initialConfig.webAppUrl)
5142
+ });
5143
+ const runtimeConfig = {
5144
+ baseUrl: normalizedConfig.baseUrl,
5145
+ uploadBaseUrl: normalizedConfig.uploadBaseUrl,
5146
+ webAppUrl: normalizedConfig.webAppUrl
5147
+ };
5148
+ const config = {
5149
+ accessToken: initialConfig.accessToken,
5150
+ runtimeConfig
5151
+ };
5152
+ function getInfo(query = {}) {
4898
5153
  return provideSdk(config, getAccountInfo(query));
4899
5154
  }
4900
5155
  function getFileById(input) {
@@ -4902,7 +5157,16 @@ const createPutioSdkPromiseClient = (initialConfig = {}) => {
4902
5157
  }
4903
5158
  return {
4904
5159
  dispose: () => disposePromiseClientRuntime(config),
5160
+ setAccessToken: (accessToken) => {
5161
+ config.accessToken = accessToken;
5162
+ },
4905
5163
  account: {
5164
+ appSpecificPasswords: {
5165
+ create: (input) => provideSdk(config, createAppSpecificPassword(input)),
5166
+ delete: (id) => provideSdk(config, deleteAppSpecificPassword(id)),
5167
+ deleteAll: () => provideSdk(config, deleteAllAppSpecificPasswords()),
5168
+ list: () => provideSdk(config, listAppSpecificPasswords())
5169
+ },
4906
5170
  clear: (options) => provideSdk(config, clearAccount(options)),
4907
5171
  destroy: (currentPassword) => provideSdk(config, destroyAccount(currentPassword)),
4908
5172
  getInfo,
@@ -4912,7 +5176,10 @@ const createPutioSdkPromiseClient = (initialConfig = {}) => {
4912
5176
  saveSettings: (payload) => provideSdk(config, saveAccountSettings(payload))
4913
5177
  },
4914
5178
  auth: {
4915
- buildLoginUrl: buildAuthLoginUrl,
5179
+ buildLoginUrl: (options) => buildAuthLoginUrl({
5180
+ ...options,
5181
+ webAppUrl: options.webAppUrl ?? config.runtimeConfig.webAppUrl
5182
+ }),
4916
5183
  checkCodeMatch: (code) => provideSdk(config, checkCodeMatch(code)),
4917
5184
  clients: () => provideSdk(config, clients()),
4918
5185
  exists: (key, value) => provideSdk(config, exists(key, value)),
@@ -5124,6 +5391,6 @@ const createPutioSdkPromiseClient = (initialConfig = {}) => {
5124
5391
  };
5125
5392
  };
5126
5393
  //#endregion
5127
- export { AccountClearOptionsSchema, AccountConfirmationSchema, AccountConfirmationsErrorSpec, AccountDiskSchema, AccountInfoBaseSchema, AccountInfoBroadSchema, AccountInfoQuerySchema, AccountSettingsSchema, AccountSubtitleLanguageSchema, AccountTwoFactorSettingsSchema, AccountWarningsSchema, AddManyTransfersErrorSpec, AddTransferErrorSpec, ApproveFriendRequestErrorSpec, AuthorizationCodeSchema, CancelZipErrorSpec, ClearEventsErrorSpec, ClearRssFeedLogsErrorSpec, ClientsErrorSpec, ConfirmFastspringOrderErrorSpec, ContinueFilesErrorSpec, ContinuePublicShareFilesErrorSpec, ContinueTrashErrorSpec, CountWaitingRequestsErrorSpec, CreateCoinbaseChargeErrorSpec, CreateDownloadLinksErrorSpec, CreateFamilyInviteErrorSpec, CreateFolderErrorSpec, CreateFriendInviteErrorSpec, CreateOAuthAppErrorSpec, CreateOpenNodeChargeErrorSpec, CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec, CreatePaddleWaitingPaymentErrorSpec, CreatePublicShareErrorSpec, CreateRssFeedErrorSpec, CreateSharingCloneErrorSpec, CreateZipErrorSpec, DEFAULT_PUTIO_API_BASE_URL, DEFAULT_PUTIO_UPLOAD_BASE_URL, DEFAULT_PUTIO_WEB_APP_URL, DeleteEventErrorSpec, DeleteOAuthAppErrorSpec, DeletePublicShareErrorSpec, DeleteRssFeedErrorSpec, DeleteTrashErrorSpec, DenyFriendRequestErrorSpec, DownloadLinksCreateInputSchema, DownloadLinksInfoSchema, DownloadLinksPayloadSchema, DownloadLinksStatusSchema, DownloadUrlErrorSpec, EmptyTrashErrorSpec, EventsListQuerySchema, FamilyInviteLookupErrorSpec, FamilyInviteSchema, FamilyMemberSchema, FileActiveConversionSchema, FileActiveConversionsErrorSpec, FileBaseSchema, FileBreadcrumbSchema, FileBroadSchema, FileConversionStatusSchema, FileExtractionSchema, FileExtractionStatusSchema, FileExtractionsErrorSpec, FileMediaInfoFormatSchema, FileMediaInfoSchema, FileMediaInfoStreamSchema, FileMediaMetadataSchema, FileMp4ErrorSpec, FileMp4MutationErrorSpec, FileQuerySchema, FileSortSchema, FileSubtitleSchema, FileSubtitlesErrorSpec, FileTypeSchema, FileUploadErrorSpec, FileWatchStatusErrorSpec, FilesListEnvelopeSchema, FilesListQuerySchema, FilesMoveErrorSchema, FilesSearchQuerySchema, FolderTypeSchema, ForgotPasswordErrorSpec, FriendBaseSchema, FriendInviteJoinedUserSchema, FriendInviteJoinedUserStatusSchema, FriendInviteLookupErrorSpec, FriendInviteSchema, FriendSchema, FriendSharedFolderErrorSpec, GenerateTOTPErrorSpec, GenerateTOTPResponseSchema, GetDownloadLinksErrorSpec, GetEventTorrentErrorSpec, GetFileErrorSpec, GetIftttStatusErrorSpec, GetOAuthAppErrorSpec, GetPaddleBillingInvoiceUrlErrorSpec, GetPaymentInfoErrorSpec, GetPaymentVoucherInfoErrorSpec, GetPublicShareErrorSpec, GetPublicShareFileUrlErrorSpec, GetRssFeedErrorSpec, GetSharedWithErrorSpec, GetSharingCloneInfoErrorSpec, GetTransferErrorSpec, GetZipErrorSpec, GiftCardLookupErrorSpec, GrantsErrorSpec, HistoryEventSchema, HistoryFileFromRssDeletedEventSchema, HistoryFileSharedEventSchema, HistoryKnownEventTypeSchema, HistoryPrivateTorrentPinEventSchema, HistoryRssFilterPausedEventSchema, HistoryTransferCallbackErrorEventSchema, HistoryTransferCompletedEventSchema, HistoryTransferErrorEventSchema, HistoryTransferFromRssErrorEventSchema, HistoryUploadEventSchema, HistoryVoucherEventSchema, HistoryZipCreatedEventSchema, JoinFamilyErrorSpec, JsonObjectSchema, JsonValueSchema, LinkDeviceErrorSpec, ListEventsErrorSpec, ListFamilyInvitesErrorSpec, ListFamilyMembersErrorSpec, ListFriendInvitesErrorSpec, ListFriendsErrorSpec, ListPaymentHistoryErrorSpec, ListPaymentInvitesErrorSpec, ListPaymentOptionsErrorSpec, ListPaymentPlansErrorSpec, ListPublicShareFilesErrorSpec, ListPublicSharesErrorSpec, ListRssFeedItemsErrorSpec, ListRssFeedsErrorSpec, ListSentRequestsErrorSpec, ListSharedFilesErrorSpec, ListTransfersErrorSpec, ListTrashErrorSpec, ListTunnelRoutesErrorSpec, ListWaitingRequestsErrorSpec, ListZipsErrorSpec, LoginErrorSpec, LoginResponseSchema, MyOAuthAppSchema, OAuthAppCreateInputSchema, OAuthAppSchema, OAuthAppSessionSchema, OAuthAppUpdateInputSchema, OAuthAppWithTokenSchema, OAuthSetIconInputSchema, OkResponseSchema, OwnedOAuthAppSchema, PasInfoSchema, PauseRssFeedErrorSpec, PaymentChangePlanPreviewSchema, PaymentChangePlanSubmitSchema, PaymentHistoryItemSchema, PaymentInfoPlanSchema, PaymentInfoSchema, PaymentInviteSchema, PaymentOptionPlanTypeSchema, PaymentOptionSchema, PaymentPlanGroupSchema, PaymentPlanTypeSchema, PaymentProviderNameSchema, PaymentProviderSchema, PaymentSubscriptionInfoSchema, PaymentTypeSchema, PaymentVoucherInfoSchema, PopularOAuthAppSchema, PreviewPaymentChangePlanErrorSpec, PublicShareListQuerySchema, PublicShareSchema, PutioApiError, PutioAuthError, PutioConfigurationError, PutioErrorEnvelopeSchema, PutioHttpClient, PutioOperationError, PutioRateLimitError, PutioSdk, PutioSdkConfig, PutioTransportError, PutioValidationError, QueryFilesErrorSpec, QueryOAuthAppsErrorSpec, ReannounceTransferErrorSpec, RecoveryCodesErrorSpec, RedeemPaymentVoucherErrorSpec, RegenerateOAuthAppTokenErrorSpec, RegenerateRecoveryCodesErrorSpec, RegisterErrorSpec, RegisterInputSchema, RemoveFamilyMemberErrorSpec, RemoveFriendErrorSpec, RenameFileErrorSpec, ReportPaymentsErrorSpec, ResetPasswordErrorSpec, RestoreTrashErrorSpec, ResumeRssFeedErrorSpec, RetryAllRssFeedItemsErrorSpec, RetryRssFeedItemErrorSpec, RetryTransferErrorSpec, RevokeAllOAuthClientsErrorSpec, RevokeOAuthClientErrorSpec, RevokeOAuthGrantErrorSpec, RssFeedItemFailedSchema, RssFeedItemSchema, RssFeedItemSucceededSchema, RssFeedParamsSchema, RssFeedSchema, SaveAccountSettingsErrorSpec, SaveAccountSettingsPayloadSchema, SearchFilesErrorSpec, SearchFriendsErrorSpec, SendFriendRequestErrorSpec, SendIftttEventErrorSpec, ShareFilesErrorSpec, SharedFileSchema, SharedFileShareSchema, SharedFileSharedWithSchema, SharingCloneInfoSchema, SharingCloneInputSchema, SharingCloneStatusSchema, SharingShareInputSchema, SharingUnshareInputSchema, StartFromErrorSpec, StopRecordingTransferErrorSpec, StopSubscriptionErrorSpec, SubmitPaymentChangePlanErrorSpec, TransferAddInputSchema, TransferBaseSchema, TransferSchema, TransferStatusSchema, TransferTypeSchema, TransfersListQuerySchema, TrashFileSchema, TunnelRouteSchema, TwoFactorRecoveryCodesSchema, UnshareFileErrorSpec, UpdateOAuthAppErrorSpec, UpdateRssFeedErrorSpec, UserSearchResultSchema, UserSubscriptionStatusSchema, ValidateTokenResponseSchema, VerifyTOTPErrorSpec, VerifyTOTPResponseSchema, VoucherLookupErrorSpec, ZipStatusSchema, addManyTransfers, addTransfer, approveFriendRequest, buildAuthLoginUrl, buildFileApiContentUrl, buildFileApiDownloadUrl, buildFileApiMp4DownloadUrl, buildFileHlsStreamUrl, buildOAuthAppIconUrl, buildOAuthAuthorizeUrl, buildPutioUrl, cancelTransfers, cancelZip, checkCodeMatch, classifyPaymentChangePlanResponse, cleanTransfers, clearAccount, clearEvents, clearRssFeedLogs, clients, cloneSharedFiles, confirmFastspringOrder, continueFiles, continuePublicShareFiles, continueSearch, continueTransfers, continueTrash, convertFileSelectionToMp4, convertFileToMp4, convertFilesToMp4, countTransfers, countWaitingRequests, createCoinbaseCharge, createDownloadLinks, createFamilyInvite, createFileUploadFormData, createFileUploadRequest, createFolder, createFriendInvite, createOAuthApp, createOpenNodeCharge, createPaddleBillingUpdatePaymentMethodTransaction, createPaddleWaitingPayment, createPublicShare, createPutioSdkEffectClient, createPutioSdkPromiseClient, createRssFeed, createZip, decodePutioErrorEnvelope, definePutioOperationErrorSpec, deleteConfigKey, deleteEvent, deleteFileExtraction, deleteFileMp4, deleteFileSelection, deleteFiles, deleteOAuthApp, deletePublicShare, deleteRssFeed, deleteTrash, denyFriendRequest, destroyAccount, emptyTrash, encodePathSegment, exists, extractFiles, fallbackPutioErrorEnvelope, findNextFile, findNextVideo, forgotPassword, generateTOTP, getAccountInfo, getAccountSettings, getApiContentUrl, getApiDownloadUrl, getApiMp4DownloadUrl, getCode, getConfigKey, getConfigKeyWith, getDownloadLinks, getDownloadUrl, getEventTorrent, getFamilyInvite, getFile, getFriendInvite, getFriendSharedFolder, getGiftCard, getHlsStreamUrl, getIftttStatus, getMp4Status, getOAuthApp, getPaddleBillingInvoiceUrl, getPaymentInfo, getPaymentVoucherInfo, getPopularOAuthApps, getPublicShare, getPublicShareFileUrl, getRecoveryCodes, getRssFeed, getSharedWith, getSharingCloneInfo, getStartFrom, getTransfer, getTransferInfo, getVoucher, getZip, grants, isPutioApiError, isPutioAuthError, isPutioErrorEnvelope, isPutioOperationError, isPutioRateLimitError, joinFamily, linkDevice, listAccountConfirmations, listAccountSubtitleLanguages, listActiveMp4Conversions, listEvents, listFamilyInvites, listFamilyMembers, listFileExtractions, listFileSubtitles, listFriendInvites, listFriends, listPaymentHistory, listPaymentInvites, listPaymentOptions, listPaymentPlans, listPublicShareFiles, listPublicShares, listRssFeedItems, listRssFeeds, listSentRequests, listSharedFiles, listTransfers, listTrash, listTunnelRoutes, listWaitingRequests, listZips, login, logout, makePutioFetchClient, makePutioFetchLayer, makePutioSdkConfig, makePutioSdkEffectClientLayer, makePutioSdkLayer, makePutioSdkLiveClientLayer, makePutioSdkLiveLayer, makeResponseError, mapConfigurationError, mapDecodeErrorToValidationError, mapTransportError, moveFileSelection, moveFiles, parseErrorBody, pauseRssFeed, previewPaymentChangePlan, putMp4ToMyFiles, queryFiles, queryOAuthApps, readConfig, readConfigWith, reannounceTransfer, redeemPaymentVoucher, regenerateOAuthAppToken, regenerateRecoveryCodes, register, removeFamilyMember, removeFriend, renameFile, reportPayments, requestArrayBuffer, requestJson, requestVoid, resetPassword, resetStartFrom, responseRateLimitHeaders, restoreTrash, resumeRssFeed, retryAllRssFeedItems, retryRssFeedItem, retryTransfer, revokeAllClients, revokeApp, revokeClient, saveAccountSettings, searchFiles, searchFriends, selectJsonField, selectJsonFields, sendFriendRequest, sendIftttEvent, setConfigKey, setFilesWatchStatus, setOAuthAppIcon, setStartFrom, shareFiles, stopPaymentSubscription, stopTransferRecording, submitPaymentChangePlan, unshareFile, updateOAuthApp, updateRssFeed, uploadFile, validateToken, verifyTOTP, withOperationErrors, writeConfig };
5394
+ export { AccountClearOptionsSchema, AccountConfirmationSchema, AccountConfirmationsErrorSpec, AccountDiskSchema, AccountInfoBaseSchema, AccountInfoBroadSchema, AccountInfoQuerySchema, AccountSettingsSchema, AccountSubtitleLanguageSchema, AccountTwoFactorSettingsSchema, AccountWarningsSchema, AddManyTransfersErrorSpec, AddTransferErrorSpec, AppSpecificPasswordSchema, ApproveFriendRequestErrorSpec, AuthorizationCodeSchema, CancelZipErrorSpec, ClearEventsErrorSpec, ClearRssFeedLogsErrorSpec, ClientsErrorSpec, ConfirmFastspringOrderErrorSpec, ContinueFilesErrorSpec, ContinuePublicShareFilesErrorSpec, ContinueTrashErrorSpec, CountWaitingRequestsErrorSpec, CreateAppSpecificPasswordErrorSpec, CreateAppSpecificPasswordInputSchema, CreateCoinbaseChargeErrorSpec, CreateDownloadLinksErrorSpec, CreateFamilyInviteErrorSpec, CreateFolderErrorSpec, CreateFriendInviteErrorSpec, CreateOAuthAppErrorSpec, CreateOpenNodeChargeErrorSpec, CreatePaddleBillingUpdatePaymentMethodTransactionErrorSpec, CreatePaddleWaitingPaymentErrorSpec, CreatePublicShareErrorSpec, CreateRssFeedErrorSpec, CreateSharingCloneErrorSpec, CreateZipErrorSpec, DEFAULT_PUTIO_API_BASE_URL, DEFAULT_PUTIO_UPLOAD_BASE_URL, DEFAULT_PUTIO_WEB_APP_URL, DeleteAllAppSpecificPasswordsErrorSpec, DeleteAppSpecificPasswordErrorSpec, DeleteEventErrorSpec, DeleteOAuthAppErrorSpec, DeletePublicShareErrorSpec, DeleteRssFeedErrorSpec, DeleteTrashErrorSpec, DenyFriendRequestErrorSpec, DownloadLinksCreateInputSchema, DownloadLinksInfoSchema, DownloadLinksPayloadSchema, DownloadLinksStatusSchema, DownloadUrlErrorSpec, EmptyTrashErrorSpec, EventsListQuerySchema, FamilyInviteLookupErrorSpec, FamilyInviteSchema, FamilyMemberSchema, FileActiveConversionSchema, FileActiveConversionsErrorSpec, FileBaseSchema, FileBreadcrumbSchema, FileBroadSchema, FileConversionStatusSchema, FileExtractionSchema, FileExtractionStatusSchema, FileExtractionsErrorSpec, FileMediaInfoFormatSchema, FileMediaInfoSchema, FileMediaInfoStreamSchema, FileMediaMetadataSchema, FileMp4ErrorSpec, FileMp4MutationErrorSpec, FileQuerySchema, FileSortSchema, FileSubtitleSchema, FileSubtitlesErrorSpec, FileTypeSchema, FileUploadErrorSpec, FileWatchStatusErrorSpec, FilesListEnvelopeSchema, FilesListQuerySchema, FilesMoveErrorSchema, FilesSearchQuerySchema, FolderTypeSchema, ForgotPasswordErrorSpec, FriendBaseSchema, FriendInviteJoinedUserSchema, FriendInviteJoinedUserStatusSchema, FriendInviteLookupErrorSpec, FriendInviteSchema, FriendSchema, FriendSharedFolderErrorSpec, GenerateTOTPErrorSpec, GenerateTOTPResponseSchema, GetDownloadLinksErrorSpec, GetEventTorrentErrorSpec, GetFileErrorSpec, GetIftttStatusErrorSpec, GetOAuthAppErrorSpec, GetPaddleBillingInvoiceUrlErrorSpec, GetPaymentInfoErrorSpec, GetPaymentVoucherInfoErrorSpec, GetPublicShareErrorSpec, GetPublicShareFileUrlErrorSpec, GetRssFeedErrorSpec, GetSharedWithErrorSpec, GetSharingCloneInfoErrorSpec, GetTransferErrorSpec, GetZipErrorSpec, GiftCardLookupErrorSpec, GrantsErrorSpec, HistoryEventSchema, HistoryFileFromRssDeletedEventSchema, HistoryFileSharedEventSchema, HistoryKnownEventTypeSchema, HistoryPrivateTorrentPinEventSchema, HistoryRssFilterPausedEventSchema, HistoryTransferCallbackErrorEventSchema, HistoryTransferCompletedEventSchema, HistoryTransferErrorEventSchema, HistoryTransferFromRssErrorEventSchema, HistoryUploadEventSchema, HistoryVoucherEventSchema, HistoryZipCreatedEventSchema, JoinFamilyErrorSpec, JsonObjectSchema, JsonValueSchema, LinkDeviceErrorSpec, ListAppSpecificPasswordsErrorSpec, ListEventsErrorSpec, ListFamilyInvitesErrorSpec, ListFamilyMembersErrorSpec, ListFriendInvitesErrorSpec, ListFriendsErrorSpec, ListPaymentHistoryErrorSpec, ListPaymentInvitesErrorSpec, ListPaymentOptionsErrorSpec, ListPaymentPlansErrorSpec, ListPublicShareFilesErrorSpec, ListPublicSharesErrorSpec, ListRssFeedItemsErrorSpec, ListRssFeedsErrorSpec, ListSentRequestsErrorSpec, ListSharedFilesErrorSpec, ListTransfersErrorSpec, ListTrashErrorSpec, ListTunnelRoutesErrorSpec, ListWaitingRequestsErrorSpec, ListZipsErrorSpec, LoginErrorSpec, LoginResponseSchema, MyOAuthAppSchema, OAuthAppCreateInputSchema, OAuthAppSchema, OAuthAppSessionSchema, OAuthAppUpdateInputSchema, OAuthAppWithTokenSchema, OAuthSetIconInputSchema, OkResponseSchema, OwnedOAuthAppSchema, PasInfoSchema, PauseRssFeedErrorSpec, PaymentChangePlanPreviewSchema, PaymentChangePlanSubmitSchema, PaymentHistoryItemSchema, PaymentInfoPlanSchema, PaymentInfoSchema, PaymentInviteSchema, PaymentOptionPlanTypeSchema, PaymentOptionSchema, PaymentPlanGroupSchema, PaymentPlanTypeSchema, PaymentProviderNameSchema, PaymentProviderSchema, PaymentSubscriptionInfoSchema, PaymentTypeSchema, PaymentVoucherInfoSchema, PopularOAuthAppSchema, PreviewPaymentChangePlanErrorSpec, PublicShareListQuerySchema, PublicShareSchema, PutioApiError, PutioAuthError, PutioConfigurationError, PutioErrorEnvelopeSchema, PutioHttpClient, PutioOperationError, PutioRateLimitError, PutioSdk, PutioSdkConfig, PutioTransportError, PutioValidationError, QueryFilesErrorSpec, QueryOAuthAppsErrorSpec, ReannounceTransferErrorSpec, RecoveryCodesErrorSpec, RedeemPaymentVoucherErrorSpec, RegenerateOAuthAppTokenErrorSpec, RegenerateRecoveryCodesErrorSpec, RegisterErrorSpec, RegisterInputSchema, RemoveFamilyMemberErrorSpec, RemoveFriendErrorSpec, RenameFileErrorSpec, ReportPaymentsErrorSpec, ResetPasswordErrorSpec, RestoreTrashErrorSpec, ResumeRssFeedErrorSpec, RetryAllRssFeedItemsErrorSpec, RetryRssFeedItemErrorSpec, RetryTransferErrorSpec, RevokeAllOAuthClientsErrorSpec, RevokeOAuthClientErrorSpec, RevokeOAuthGrantErrorSpec, RssFeedItemFailedSchema, RssFeedItemSchema, RssFeedItemSucceededSchema, RssFeedParamsSchema, RssFeedSchema, SaveAccountSettingsErrorSpec, SaveAccountSettingsPayloadSchema, SearchFilesErrorSpec, SearchFriendsErrorSpec, SendFriendRequestErrorSpec, SendIftttEventErrorSpec, ShareFilesErrorSpec, SharedFileSchema, SharedFileShareSchema, SharedFileSharedWithSchema, SharingCloneInfoSchema, SharingCloneInputSchema, SharingCloneStatusSchema, SharingShareInputSchema, SharingUnshareInputSchema, StartFromErrorSpec, StopRecordingTransferErrorSpec, StopSubscriptionErrorSpec, SubmitPaymentChangePlanErrorSpec, TransferAddInputSchema, TransferBaseSchema, TransferSchema, TransferStatusSchema, TransferTypeSchema, TransfersListQuerySchema, TrashFileSchema, TunnelRouteSchema, TwoFactorRecoveryCodesSchema, UnshareFileErrorSpec, UpdateOAuthAppErrorSpec, UpdateRssFeedErrorSpec, UserSearchResultSchema, UserSubscriptionStatusSchema, ValidateTokenResponseSchema, VerifyTOTPErrorSpec, VerifyTOTPResponseSchema, VoucherLookupErrorSpec, ZipStatusSchema, addManyTransfers, addTransfer, approveFriendRequest, buildAuthLoginUrl, buildFileApiContentUrl, buildFileApiDownloadUrl, buildFileApiMp4DownloadUrl, buildFileHlsStreamUrl, buildOAuthAppIconUrl, buildOAuthAuthorizeUrl, buildPutioUrl, cancelTransfers, cancelZip, checkCodeMatch, classifyPaymentChangePlanResponse, cleanTransfers, clearAccount, clearEvents, clearRssFeedLogs, clients, cloneSharedFiles, confirmFastspringOrder, continueFiles, continuePublicShareFiles, continueSearch, continueTransfers, continueTrash, convertFileSelectionToMp4, convertFileToMp4, convertFilesToMp4, countTransfers, countWaitingRequests, createAppSpecificPassword, createCoinbaseCharge, createDownloadLinks, createFamilyInvite, createFileUploadFormData, createFileUploadRequest, createFolder, createFriendInvite, createOAuthApp, createOpenNodeCharge, createPaddleBillingUpdatePaymentMethodTransaction, createPaddleWaitingPayment, createPublicShare, createPutioSdkEffectClient, createPutioSdkPromiseClient, createRssFeed, createZip, decodePutioErrorEnvelope, definePutioOperationErrorSpec, deleteAllAppSpecificPasswords, deleteAppSpecificPassword, deleteConfigKey, deleteEvent, deleteFileExtraction, deleteFileMp4, deleteFileSelection, deleteFiles, deleteOAuthApp, deletePublicShare, deleteRssFeed, deleteTrash, denyFriendRequest, destroyAccount, emptyTrash, encodePathSegment, exists, extractFiles, fallbackPutioErrorEnvelope, findNextFile, findNextVideo, forgotPassword, generateTOTP, getAccountInfo, getAccountSettings, getApiContentUrl, getApiDownloadUrl, getApiMp4DownloadUrl, getCode, getConfigKey, getConfigKeyWith, getDownloadLinks, getDownloadUrl, getEventTorrent, getFamilyInvite, getFile, getFriendInvite, getFriendSharedFolder, getGiftCard, getHlsStreamUrl, getIftttStatus, getMp4Status, getOAuthApp, getPaddleBillingInvoiceUrl, getPaymentInfo, getPaymentVoucherInfo, getPopularOAuthApps, getPublicShare, getPublicShareFileUrl, getRecoveryCodes, getRssFeed, getSharedWith, getSharingCloneInfo, getStartFrom, getTransfer, getTransferInfo, getVoucher, getZip, grants, isPutioApiError, isPutioAuthError, isPutioErrorEnvelope, isPutioOperationError, isPutioRateLimitError, joinFamily, linkDevice, listAccountConfirmations, listAccountSubtitleLanguages, listActiveMp4Conversions, listAppSpecificPasswords, listEvents, listFamilyInvites, listFamilyMembers, listFileExtractions, listFileSubtitles, listFriendInvites, listFriends, listPaymentHistory, listPaymentInvites, listPaymentOptions, listPaymentPlans, listPublicShareFiles, listPublicShares, listRssFeedItems, listRssFeeds, listSentRequests, listSharedFiles, listTransfers, listTrash, listTunnelRoutes, listWaitingRequests, listZips, login, logout, makePutioFetchClient, makePutioFetchLayer, makePutioSdkConfig, makePutioSdkEffectClientLayer, makePutioSdkLayer, makePutioSdkLiveClientLayer, makePutioSdkLiveLayer, makeResponseError, mapConfigurationError, mapDecodeErrorToValidationError, mapTransportError, moveFileSelection, moveFiles, parseErrorBody, pauseRssFeed, previewPaymentChangePlan, putMp4ToMyFiles, queryFiles, queryOAuthApps, readConfig, readConfigWith, reannounceTransfer, redeemPaymentVoucher, regenerateOAuthAppToken, regenerateRecoveryCodes, register, removeFamilyMember, removeFriend, renameFile, reportPayments, requestArrayBuffer, requestJson, requestVoid, resetPassword, resetStartFrom, responseRateLimitHeaders, restoreTrash, resumeRssFeed, retryAllRssFeedItems, retryRssFeedItem, retryTransfer, revokeAllClients, revokeApp, revokeClient, saveAccountSettings, searchFiles, searchFriends, selectJsonField, selectJsonFields, sendFriendRequest, sendIftttEvent, setConfigKey, setFilesWatchStatus, setOAuthAppIcon, setStartFrom, shareFiles, stopPaymentSubscription, stopTransferRecording, submitPaymentChangePlan, unshareFile, updateOAuthApp, updateRssFeed, uploadFile, validateToken, verifyTOTP, withOperationErrors, writeConfig };
5128
5395
 
5129
5396
  //# sourceMappingURL=index.js.map