@transcodely/sdk 0.3.15 → 0.3.16

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.mjs CHANGED
@@ -7302,7 +7302,8 @@ proto3.util.setEnumType(ToneMapping, "transcodely.v1.ToneMapping", [
7302
7302
  ]);
7303
7303
  var HDRConfig = class _HDRConfig extends Message {
7304
7304
  /**
7305
- * Target HDR format (required for passthrough and force modes).
7305
+ * Target HDR format (required for passthrough and force modes). In tonemap
7306
+ * mode it names the HDR format of the source.
7306
7307
  * `dolby_vision_5` and `dolby_vision_8` are refused at create until the
7307
7308
  * worker produces Dolby Vision output; a refused request creates no job and
7308
7309
  * is neither quoted nor billed.
@@ -7317,14 +7318,17 @@ var HDRConfig = class _HDRConfig extends Message {
7317
7318
  */
7318
7319
  mode = 0 /* HDR_MODE_UNSPECIFIED */;
7319
7320
  /**
7320
- * Tone mapping algorithm (for tonemap mode).
7321
+ * Tone mapping algorithm (tonemap mode only). Unset means `bt2390`, which,
7322
+ * like an explicit `bt2390`, is approximated with `hable` on CPU.
7321
7323
  *
7322
7324
  * @generated from field: transcodely.v1.ToneMapping tone_mapping = 3;
7323
7325
  */
7324
7326
  toneMapping = 0 /* UNSPECIFIED */;
7325
7327
  /**
7326
- * Target peak brightness in nits (for tonemap and force modes).
7327
- * Range: 100-10000.
7328
+ * Target peak brightness in nits. Range: 100-10000. Applies to HDR output
7329
+ * only: refused with `parameter_forbidden` in tonemap mode, whose SDR target
7330
+ * has a fixed peak. Accepted in passthrough and force modes, where the
7331
+ * encoder does not currently read it, so it has no effect on the output.
7328
7332
  *
7329
7333
  * @generated from field: optional int32 target_peak_nits = 4;
7330
7334
  */
@@ -9056,27 +9060,43 @@ proto3.util.setEnumType(ContentAwareMode, "transcodely.v1.ContentAwareMode", [
9056
9060
  ]);
9057
9061
  var AutoABRConfig = class _AutoABRConfig extends Message {
9058
9062
  /**
9059
- * Minimum number of variants in the ladder.
9060
- * Default: 2.
9063
+ * Fewest rungs the ladder may be pruned to. Default: 2.
9064
+ *
9065
+ * A ladder can never hold more rungs than the source allows: only one tier
9066
+ * at or above the source's short side is kept, so a 480-line source yields
9067
+ * one rung whatever this says. When pruning would leave fewer rungs than
9068
+ * this, rungs are put back from the bottom of the ladder up. Set it to 1 to
9069
+ * say a single rung is an acceptable result for any source. Must not exceed
9070
+ * max_variants, nor the number of standard rungs between min_resolution and
9071
+ * max_resolution.
9061
9072
  *
9062
9073
  * @generated from field: optional int32 min_variants = 1;
9063
9074
  */
9064
9075
  minVariants;
9065
9076
  /**
9066
- * Maximum number of variants in the ladder.
9067
- * Default: 8.
9077
+ * Most rungs the ladder may hold. A ceiling longer than this keeps its TOP
9078
+ * rung (quality) and its BOTTOM rung (reach) and drops interior rungs from
9079
+ * the highest down: 2160p..480p capped at 3 is 2160p, 720p, 480p. Default:
9080
+ * no cap beyond the standard rungs in range (at most five).
9068
9081
  *
9069
9082
  * @generated from field: optional int32 max_variants = 2;
9070
9083
  */
9071
9084
  maxVariants;
9072
9085
  /**
9073
- * Lowest resolution in the generated ladder.
9086
+ * Lowest rung the ladder may contain. Default: 480p. When the source's short
9087
+ * side is below this, the ladder is one rung: the smallest tier at or above
9088
+ * the source's short side, rendered at the source's own size.
9074
9089
  *
9075
9090
  * @generated from field: transcodely.v1.Resolution min_resolution = 3;
9076
9091
  */
9077
9092
  minResolution = 0 /* RESOLUTION_UNSPECIFIED */;
9078
9093
  /**
9079
- * Highest resolution in the generated ladder.
9094
+ * Highest rung the ladder may contain. Default: 1080p, NOT the highest the
9095
+ * source allows — 1440p and 2160p rungs must be asked for here. The worker
9096
+ * that renders the job is sized from this ceiling before the source is
9097
+ * known, and a default that sized every job for 4K would bill nobody more
9098
+ * but waste a large machine on most sources. 4320p is accepted and behaves
9099
+ * as 2160p, the largest standard rung.
9080
9100
  *
9081
9101
  * @generated from field: transcodely.v1.Resolution max_resolution = 4;
9082
9102
  */
@@ -9108,8 +9128,7 @@ var AutoABRConfig = class _AutoABRConfig extends Message {
9108
9128
  };
9109
9129
  var ContentAwareConfig = class _ContentAwareConfig extends Message {
9110
9130
  /**
9111
- * Encoding mode (required). `per_title` is accepted; `auto_abr` is rejected
9112
- * at create.
9131
+ * Encoding mode (required): `per_title` or `auto_abr`.
9113
9132
  *
9114
9133
  * @generated from field: transcodely.v1.ContentAwareMode mode = 1;
9115
9134
  */
@@ -9130,8 +9149,8 @@ var ContentAwareConfig = class _ContentAwareConfig extends Message {
9130
9149
  */
9131
9150
  vmafTarget;
9132
9151
  /**
9133
- * Auto ABR constraints (only for auto_abr mode). NOT YET ACCEPTED — an
9134
- * auto_abr request is rejected at create whatever these say.
9152
+ * Ladder bounds, only for `auto_abr` mode. Refused with
9153
+ * `parameter_forbidden` on `per_title`.
9135
9154
  *
9136
9155
  * @generated from field: optional transcodely.v1.AutoABRConfig auto_abr = 3;
9137
9156
  */
@@ -12074,7 +12093,9 @@ var OutputSpec = class _OutputSpec extends Message {
12074
12093
  * Enables per-title encoding, which tunes this output's CRF to the source
12075
12094
  * rather than to its quality tier. Requires at least one video rendition that
12076
12095
  * is not pinned to an explicit bitrate, and a source of at least 120 seconds.
12077
- * `auto_abr` mode is not accepted yet.
12096
+ * `auto_abr` mode (choose which rungs of a standard ladder to render, for
12097
+ * streaming outputs) is defined but not accepted yet: it is rejected with
12098
+ * `parameter_unsupported`.
12078
12099
  *
12079
12100
  * @generated from field: optional transcodely.v1.ContentAwareConfig content_aware = 13;
12080
12101
  */
@@ -20342,9 +20363,9 @@ var JobService = {
20342
20363
 
20343
20364
  // src/errors.ts
20344
20365
  var TranscodelyError = class extends Error {
20345
- /** Server-side error code (e.g. "JOB_NOT_FOUND"). */
20366
+ /** Server-side error code (e.g. "validation_error"). */
20346
20367
  code;
20347
- /** Top-level error type (e.g. "validation_error"). */
20368
+ /** Connect error code (e.g. "invalid_argument"). */
20348
20369
  type;
20349
20370
  /** Field-level validation violations. */
20350
20371
  errors;
@@ -20442,7 +20463,7 @@ function backoff(attempt) {
20442
20463
  }
20443
20464
 
20444
20465
  // src/version.ts
20445
- var SDK_VERSION = "0.3.15";
20466
+ var SDK_VERSION = "0.3.16";
20446
20467
  var API_VERSION = "2026-05-03";
20447
20468
  var DEFAULT_BASE_URL = "https://api.transcodely.com";
20448
20469
 
@@ -25267,7 +25288,7 @@ function mapHttpError({ status, body, headers }) {
25267
25288
  const requestId = headers.get("x-request-id") ?? void 0;
25268
25289
  const parsed = parseBody(body);
25269
25290
  const message = parsed.message ?? `HTTP ${status}`;
25270
- const detail = parsed.details?.[0]?.debug;
25291
+ const detail = parsed.details?.find(isErrorDetails)?.debug;
25271
25292
  const code = detail?.code;
25272
25293
  const violations = detail?.field_violations ?? detail?.fieldViolations ?? [];
25273
25294
  const opts = {
@@ -25298,6 +25319,10 @@ function connectionError(cause, message) {
25298
25319
  const msg = (cause instanceof Error ? cause.message : "network request failed");
25299
25320
  return new APIConnectionError({ message: msg, cause });
25300
25321
  }
25322
+ var ERROR_DETAILS_TYPE = "transcodely.v1.ErrorDetails";
25323
+ function isErrorDetails(d) {
25324
+ return d.type === void 0 || d.type === ERROR_DETAILS_TYPE || d.type.endsWith(`/${ERROR_DETAILS_TYPE}`);
25325
+ }
25301
25326
  function parseBody(body) {
25302
25327
  if (typeof body === "string") {
25303
25328
  try {