@transcodely/sdk 0.3.14 → 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/CHANGELOG.md CHANGED
@@ -4,6 +4,31 @@ All notable changes to the Transcodely JavaScript / TypeScript SDK will be docum
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Breaking changes are allowed on minor bumps until 1.0.0.
6
6
 
7
+ ## [0.3.16](https://github.com/transcodely/transcodely-js/compare/v0.3.15...v0.3.16) (2026-10-31)
8
+
9
+
10
+ ### Features
11
+
12
+ * resync protos — auto_abr accepted, tone-mapping refusal rule, validation error envelope ([8f88507](https://github.com/transcodely/transcodely-js/commit/8f8850782adc63ef789ec852a5feac5aeebb1c12))
13
+ * resync protos — auto_abr accepted, tone-mapping refusal rule, validation error envelope ([de3f67b](https://github.com/transcodely/transcodely-js/commit/de3f67b48ffc8c472674bc5f03850616d796d41a))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * read the ErrorDetails detail by type, and document type as the Connect code ([f6af4e9](https://github.com/transcodely/transcodely-js/commit/f6af4e9c80398768f8fe5883d18e199ca746b386))
19
+
20
+
21
+ ### Documentation
22
+
23
+ * describe the validation error envelope and pin it with a test ([1c44049](https://github.com/transcodely/transcodely-js/commit/1c4404907b4a01577960e1d832c9c25928fc5db3))
24
+
25
+ ## [0.3.15](https://github.com/transcodely/transcodely-js/compare/v0.3.14...v0.3.15) (2026-10-30)
26
+
27
+
28
+ ### Features
29
+
30
+ * resync protos to api master — usage hosting_estimated_from, encoding_mode echo ([f1f6bee](https://github.com/transcodely/transcodely-js/commit/f1f6bee811da5c86e3a74021ba42fcab8bffb6a8))
31
+
7
32
  ## [0.3.14](https://github.com/transcodely/transcodely-js/compare/v0.3.13...v0.3.14) (2026-10-27)
8
33
 
9
34
 
package/README.md CHANGED
@@ -652,6 +652,14 @@ try {
652
652
  }
653
653
  ```
654
654
 
655
+ Every validation refusal, whether the request schema, a codec check or a feature
656
+ rule caught it, comes back as an `InvalidRequestError` listing every bad field
657
+ at once. Each violation's `description` starts with that field's error code in
658
+ brackets, for example `[parameter_out_of_range] value must be ...`, and `code`
659
+ holds the error type, such as `validation_error`, `invalid_request_error`,
660
+ `codec_error` or `feature_error`. A refusal that names no field carries no
661
+ detail, so its code is empty. `type` holds the Connect code, `invalid_argument`.
662
+
655
663
  The hierarchy:
656
664
 
657
665
  | Class | Status | When |
package/dist/index.cjs CHANGED
@@ -1918,9 +1918,10 @@ var AutoProfileDefaults = class _AutoProfileDefaults extends protobuf.Message {
1918
1918
  */
1919
1919
  qualityTier;
1920
1920
  /**
1921
- * Encoding mode: "fixed" (default, static CRF) or "auto" (input-aware constrained CRF).
1921
+ * Encoding mode: "auto" (default, input-aware constrained CRF) or "fixed" (static CRF).
1922
1922
  * In "auto" mode, the worker caps each variant's bitrate based on the input's bitrate
1923
- * and resolution ratio, preventing output from exceeding the input's quality ceiling.
1923
+ * and resolution ratio, preventing output from exceeding the input's quality ceiling,
1924
+ * and skips any ladder rung larger than the source instead of upscaling it.
1924
1925
  *
1925
1926
  * @generated from field: optional string encoding_mode = 5;
1926
1927
  */
@@ -7303,7 +7304,11 @@ protobuf.proto3.util.setEnumType(ToneMapping, "transcodely.v1.ToneMapping", [
7303
7304
  ]);
7304
7305
  var HDRConfig = class _HDRConfig extends protobuf.Message {
7305
7306
  /**
7306
- * Target HDR format (required for passthrough and force modes).
7307
+ * Target HDR format (required for passthrough and force modes). In tonemap
7308
+ * mode it names the HDR format of the source.
7309
+ * `dolby_vision_5` and `dolby_vision_8` are refused at create until the
7310
+ * worker produces Dolby Vision output; a refused request creates no job and
7311
+ * is neither quoted nor billed.
7307
7312
  *
7308
7313
  * @generated from field: transcodely.v1.HDRFormat format = 1;
7309
7314
  */
@@ -7315,14 +7320,17 @@ var HDRConfig = class _HDRConfig extends protobuf.Message {
7315
7320
  */
7316
7321
  mode = 0 /* HDR_MODE_UNSPECIFIED */;
7317
7322
  /**
7318
- * Tone mapping algorithm (for tonemap mode).
7323
+ * Tone mapping algorithm (tonemap mode only). Unset means `bt2390`, which,
7324
+ * like an explicit `bt2390`, is approximated with `hable` on CPU.
7319
7325
  *
7320
7326
  * @generated from field: transcodely.v1.ToneMapping tone_mapping = 3;
7321
7327
  */
7322
7328
  toneMapping = 0 /* UNSPECIFIED */;
7323
7329
  /**
7324
- * Target peak brightness in nits (for tonemap and force modes).
7325
- * Range: 100-10000.
7330
+ * Target peak brightness in nits. Range: 100-10000. Applies to HDR output
7331
+ * only: refused with `parameter_forbidden` in tonemap mode, whose SDR target
7332
+ * has a fixed peak. Accepted in passthrough and force modes, where the
7333
+ * encoder does not currently read it, so it has no effect on the output.
7326
7334
  *
7327
7335
  * @generated from field: optional int32 target_peak_nits = 4;
7328
7336
  */
@@ -7342,7 +7350,9 @@ var HDRConfig = class _HDRConfig extends protobuf.Message {
7342
7350
  */
7343
7351
  contentLightLevel;
7344
7352
  /**
7345
- * Dolby Vision RPU file URL (for DV metadata injection).
7353
+ * Dolby Vision RPU file URL. Only accepted with a `dolby_vision_*` format,
7354
+ * which is refused at create until the worker produces Dolby Vision output,
7355
+ * so this field is currently unreachable.
7346
7356
  *
7347
7357
  * @generated from field: optional string rpu_url = 7;
7348
7358
  */
@@ -9052,27 +9062,43 @@ protobuf.proto3.util.setEnumType(ContentAwareMode, "transcodely.v1.ContentAwareM
9052
9062
  ]);
9053
9063
  var AutoABRConfig = class _AutoABRConfig extends protobuf.Message {
9054
9064
  /**
9055
- * Minimum number of variants in the ladder.
9056
- * Default: 2.
9065
+ * Fewest rungs the ladder may be pruned to. Default: 2.
9066
+ *
9067
+ * A ladder can never hold more rungs than the source allows: only one tier
9068
+ * at or above the source's short side is kept, so a 480-line source yields
9069
+ * one rung whatever this says. When pruning would leave fewer rungs than
9070
+ * this, rungs are put back from the bottom of the ladder up. Set it to 1 to
9071
+ * say a single rung is an acceptable result for any source. Must not exceed
9072
+ * max_variants, nor the number of standard rungs between min_resolution and
9073
+ * max_resolution.
9057
9074
  *
9058
9075
  * @generated from field: optional int32 min_variants = 1;
9059
9076
  */
9060
9077
  minVariants;
9061
9078
  /**
9062
- * Maximum number of variants in the ladder.
9063
- * Default: 8.
9079
+ * Most rungs the ladder may hold. A ceiling longer than this keeps its TOP
9080
+ * rung (quality) and its BOTTOM rung (reach) and drops interior rungs from
9081
+ * the highest down: 2160p..480p capped at 3 is 2160p, 720p, 480p. Default:
9082
+ * no cap beyond the standard rungs in range (at most five).
9064
9083
  *
9065
9084
  * @generated from field: optional int32 max_variants = 2;
9066
9085
  */
9067
9086
  maxVariants;
9068
9087
  /**
9069
- * Lowest resolution in the generated ladder.
9088
+ * Lowest rung the ladder may contain. Default: 480p. When the source's short
9089
+ * side is below this, the ladder is one rung: the smallest tier at or above
9090
+ * the source's short side, rendered at the source's own size.
9070
9091
  *
9071
9092
  * @generated from field: transcodely.v1.Resolution min_resolution = 3;
9072
9093
  */
9073
9094
  minResolution = 0 /* RESOLUTION_UNSPECIFIED */;
9074
9095
  /**
9075
- * Highest resolution in the generated ladder.
9096
+ * Highest rung the ladder may contain. Default: 1080p, NOT the highest the
9097
+ * source allows — 1440p and 2160p rungs must be asked for here. The worker
9098
+ * that renders the job is sized from this ceiling before the source is
9099
+ * known, and a default that sized every job for 4K would bill nobody more
9100
+ * but waste a large machine on most sources. 4320p is accepted and behaves
9101
+ * as 2160p, the largest standard rung.
9076
9102
  *
9077
9103
  * @generated from field: transcodely.v1.Resolution max_resolution = 4;
9078
9104
  */
@@ -9104,8 +9130,7 @@ var AutoABRConfig = class _AutoABRConfig extends protobuf.Message {
9104
9130
  };
9105
9131
  var ContentAwareConfig = class _ContentAwareConfig extends protobuf.Message {
9106
9132
  /**
9107
- * Encoding mode (required). `per_title` is accepted; `auto_abr` is rejected
9108
- * at create.
9133
+ * Encoding mode (required): `per_title` or `auto_abr`.
9109
9134
  *
9110
9135
  * @generated from field: transcodely.v1.ContentAwareMode mode = 1;
9111
9136
  */
@@ -9126,8 +9151,8 @@ var ContentAwareConfig = class _ContentAwareConfig extends protobuf.Message {
9126
9151
  */
9127
9152
  vmafTarget;
9128
9153
  /**
9129
- * Auto ABR constraints (only for auto_abr mode). NOT YET ACCEPTED — an
9130
- * auto_abr request is rejected at create whatever these say.
9154
+ * Ladder bounds, only for `auto_abr` mode. Refused with
9155
+ * `parameter_forbidden` on `per_title`.
9131
9156
  *
9132
9157
  * @generated from field: optional transcodely.v1.AutoABRConfig auto_abr = 3;
9133
9158
  */
@@ -12070,7 +12095,9 @@ var OutputSpec = class _OutputSpec extends protobuf.Message {
12070
12095
  * Enables per-title encoding, which tunes this output's CRF to the source
12071
12096
  * rather than to its quality tier. Requires at least one video rendition that
12072
12097
  * is not pinned to an explicit bitrate, and a source of at least 120 seconds.
12073
- * `auto_abr` mode is not accepted yet.
12098
+ * `auto_abr` mode (choose which rungs of a standard ladder to render, for
12099
+ * streaming outputs) is defined but not accepted yet: it is rejected with
12100
+ * `parameter_unsupported`.
12074
12101
  *
12075
12102
  * @generated from field: optional transcodely.v1.ContentAwareConfig content_aware = 13;
12076
12103
  */
@@ -12079,6 +12106,10 @@ var OutputSpec = class _OutputSpec extends protobuf.Message {
12079
12106
  * Encoding mode: "fixed" (default, static CRF) or "auto" (input-aware constrained CRF).
12080
12107
  * In "auto" mode, the worker caps each variant's bitrate based on the input's bitrate
12081
12108
  * and resolution ratio, preventing output from exceeding the input's quality ceiling.
12109
+ * "auto" also skips any ABR rung larger than the source instead of upscaling it.
12110
+ * A skipped rung is reported with status "skipped" and is not billed.
12111
+ * Outputs created since 2026-10-27 echo the resolved mode on responses (unset
12112
+ * resolves to "fixed"). Outputs created before then omit it: their mode was not stored.
12082
12113
  *
12083
12114
  * @generated from field: optional string encoding_mode = 14;
12084
12115
  */
@@ -12387,7 +12418,10 @@ var VariantPricingSnapshot = class _VariantPricingSnapshot extends protobuf.Mess
12387
12418
  */
12388
12419
  actualCost;
12389
12420
  /**
12390
- * Variant encoding status: "pending", "processing", "completed", "failed".
12421
+ * Variant encoding status: "pending", "processing", "completed", "failed",
12422
+ * "canceled", or "skipped". A rung is "skipped" when `encoding_mode: auto`
12423
+ * left it unencoded because it would have upscaled the source. A skipped
12424
+ * rung has actual_cost 0 and is not billed.
12391
12425
  *
12392
12426
  * @generated from field: string status = 20;
12393
12427
  */
@@ -17326,6 +17360,13 @@ var UsageSummary = class _UsageSummary extends protobuf.Message {
17326
17360
  */
17327
17361
  storageGbAvg = 0;
17328
17362
  /**
17363
+ * Storage cost of the period so far, as your invoice will carry it. Each
17364
+ * day is one GB-day: the day's stored bytes at the day's monthly price
17365
+ * divided by the days in that month. Days already billed are reported at
17366
+ * the rate they were billed at, so a later price or rate-card change never
17367
+ * re-prices them; the remaining days (see hosting_estimated_from) are
17368
+ * estimated the same way at your current rate.
17369
+ *
17329
17370
  * @generated from field: double storage_cost = 11;
17330
17371
  */
17331
17372
  storageCost = 0;
@@ -17340,6 +17381,10 @@ var UsageSummary = class _UsageSummary extends protobuf.Message {
17340
17381
  */
17341
17382
  egressGb = 0;
17342
17383
  /**
17384
+ * Delivery cost of the period so far, as your invoice will carry it:
17385
+ * billed delivery at the rate it was billed at, delivery not billed yet
17386
+ * estimated at your current rate.
17387
+ *
17343
17388
  * @generated from field: double egress_cost = 21;
17344
17389
  */
17345
17390
  egressCost = 0;
@@ -17359,6 +17404,18 @@ var UsageSummary = class _UsageSummary extends protobuf.Message {
17359
17404
  * @generated from field: string currency = 31;
17360
17405
  */
17361
17406
  currency = "";
17407
+ /**
17408
+ * First day (YYYY-MM-DD, UTC) whose storage or delivery cost is an
17409
+ * estimate rather than billed usage. Hosting is billed daily, through the
17410
+ * previous day, so while you store or deliver video the current period has
17411
+ * an estimated tail, and the estimate turns into the billed amount as each
17412
+ * day is billed. Empty when no day with hosting usage in the period is
17413
+ * still unbilled, which is when storage_cost and egress_cost match your
17414
+ * invoice (to within the sub-cent remainder carried to the next charge).
17415
+ *
17416
+ * @generated from field: string hosting_estimated_from = 32;
17417
+ */
17418
+ hostingEstimatedFrom = "";
17362
17419
  /**
17363
17420
  * Per-day usage breakdown for the billing period identified by
17364
17421
  * billing_month, oldest day first. With a billing anchor day other than 1,
@@ -17463,6 +17520,13 @@ var UsageSummary = class _UsageSummary extends protobuf.Message {
17463
17520
  T: 9
17464
17521
  /* ScalarType.STRING */
17465
17522
  },
17523
+ {
17524
+ no: 32,
17525
+ name: "hosting_estimated_from",
17526
+ kind: "scalar",
17527
+ T: 9
17528
+ /* ScalarType.STRING */
17529
+ },
17466
17530
  { no: 40, name: "daily", kind: "message", T: DailyUsage, repeated: true }
17467
17531
  ]);
17468
17532
  static fromBinary(bytes, options) {
@@ -20301,9 +20365,9 @@ var JobService = {
20301
20365
 
20302
20366
  // src/errors.ts
20303
20367
  var TranscodelyError = class extends Error {
20304
- /** Server-side error code (e.g. "JOB_NOT_FOUND"). */
20368
+ /** Server-side error code (e.g. "validation_error"). */
20305
20369
  code;
20306
- /** Top-level error type (e.g. "validation_error"). */
20370
+ /** Connect error code (e.g. "invalid_argument"). */
20307
20371
  type;
20308
20372
  /** Field-level validation violations. */
20309
20373
  errors;
@@ -20401,7 +20465,7 @@ function backoff(attempt) {
20401
20465
  }
20402
20466
 
20403
20467
  // src/version.ts
20404
- var SDK_VERSION = "0.3.14";
20468
+ var SDK_VERSION = "0.3.16";
20405
20469
  var API_VERSION = "2026-05-03";
20406
20470
  var DEFAULT_BASE_URL = "https://api.transcodely.com";
20407
20471
 
@@ -25226,7 +25290,7 @@ function mapHttpError({ status, body, headers }) {
25226
25290
  const requestId = headers.get("x-request-id") ?? void 0;
25227
25291
  const parsed = parseBody(body);
25228
25292
  const message = parsed.message ?? `HTTP ${status}`;
25229
- const detail = parsed.details?.[0]?.debug;
25293
+ const detail = parsed.details?.find(isErrorDetails)?.debug;
25230
25294
  const code = detail?.code;
25231
25295
  const violations = detail?.field_violations ?? detail?.fieldViolations ?? [];
25232
25296
  const opts = {
@@ -25257,6 +25321,10 @@ function connectionError(cause, message) {
25257
25321
  const msg = (cause instanceof Error ? cause.message : "network request failed");
25258
25322
  return new APIConnectionError({ message: msg, cause });
25259
25323
  }
25324
+ var ERROR_DETAILS_TYPE = "transcodely.v1.ErrorDetails";
25325
+ function isErrorDetails(d) {
25326
+ return d.type === void 0 || d.type === ERROR_DETAILS_TYPE || d.type.endsWith(`/${ERROR_DETAILS_TYPE}`);
25327
+ }
25260
25328
  function parseBody(body) {
25261
25329
  if (typeof body === "string") {
25262
25330
  try {