@transcodely/sdk 0.3.3 → 0.3.5

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,20 @@ 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.5](https://github.com/transcodely/transcodely-js/compare/v0.3.4...v0.3.5) (2026-08-08)
8
+
9
+
10
+ ### Features
11
+
12
+ * job cost breakdown + video_id from api 4.9.0 ([#46](https://github.com/transcodely/transcodely-js/issues/46)) ([efe79e2](https://github.com/transcodely/transcodely-js/commit/efe79e24e0e7115d591722a303e2bd3986ceeeae))
13
+
14
+ ## [0.3.4](https://github.com/transcodely/transcodely-js/compare/v0.3.3...v0.3.4) (2026-08-02)
15
+
16
+
17
+ ### Features
18
+
19
+ * **client:** auto_captions on video uploads + captions_cost on Video ([dfaa6c8](https://github.com/transcodely/transcodely-js/commit/dfaa6c876fc236c7c3565ebe1f5140d865e8b00d))
20
+
7
21
  ## [0.3.3](https://github.com/transcodely/transcodely-js/compare/v0.3.2...v0.3.3) (2026-08-02)
8
22
 
9
23
 
package/dist/index.cjs CHANGED
@@ -9065,6 +9065,21 @@ protobuf.proto3.util.setEnumType(WatchEventType, "transcodely.v1.WatchEventType"
9065
9065
  { no: 4, name: "WATCH_EVENT_TYPE_COMPLETED" },
9066
9066
  { no: 5, name: "WATCH_EVENT_TYPE_HEARTBEAT" }
9067
9067
  ]);
9068
+ var JobCostLineType = /* @__PURE__ */ ((JobCostLineType2) => {
9069
+ JobCostLineType2[JobCostLineType2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
9070
+ JobCostLineType2[JobCostLineType2["OUTPUT"] = 1] = "OUTPUT";
9071
+ JobCostLineType2[JobCostLineType2["MINIMUM_CHARGE"] = 2] = "MINIMUM_CHARGE";
9072
+ JobCostLineType2[JobCostLineType2["FEE"] = 3] = "FEE";
9073
+ JobCostLineType2[JobCostLineType2["ADJUSTMENT"] = 4] = "ADJUSTMENT";
9074
+ return JobCostLineType2;
9075
+ })(JobCostLineType || {});
9076
+ protobuf.proto3.util.setEnumType(JobCostLineType, "transcodely.v1.JobCostLineType", [
9077
+ { no: 0, name: "JOB_COST_LINE_TYPE_UNSPECIFIED" },
9078
+ { no: 1, name: "JOB_COST_LINE_TYPE_OUTPUT" },
9079
+ { no: 2, name: "JOB_COST_LINE_TYPE_MINIMUM_CHARGE" },
9080
+ { no: 3, name: "JOB_COST_LINE_TYPE_FEE" },
9081
+ { no: 4, name: "JOB_COST_LINE_TYPE_ADJUSTMENT" }
9082
+ ]);
9068
9083
  var AudioTrackConfig = class _AudioTrackConfig extends protobuf.Message {
9069
9084
  /**
9070
9085
  * ISO 639-2 language code (e.g., "eng", "spa", "jpn", "fra").
@@ -10716,6 +10731,26 @@ var Job = class _Job extends protobuf.Message {
10716
10731
  * @generated from field: optional transcodely.v1.ClipConfig clip = 36;
10717
10732
  */
10718
10733
  clip;
10734
+ /**
10735
+ * Hosted video this job's managed output belongs to ("vid_..."). Set when
10736
+ * the job writes to Transcodely-managed hosting storage (created with
10737
+ * managed=true, or with input_video_id targeting an existing video); absent
10738
+ * for jobs delivering to your own origin. Server-set; read-only.
10739
+ *
10740
+ * @generated from field: optional string video_id = 37;
10741
+ */
10742
+ videoId;
10743
+ /**
10744
+ * Itemized decomposition of total_estimated_cost and total_actual_cost:
10745
+ * one line per output, one per fee, and the minimum-charge top-up when the
10746
+ * per-job minimum raised a total. The lines always sum to the totals, so
10747
+ * this is the field to render a cost from — the per-output cost fields
10748
+ * alone do not add up to the bill whenever the minimum charge is in effect.
10749
+ * Always present. Server-set; read-only.
10750
+ *
10751
+ * @generated from field: transcodely.v1.JobCostBreakdown cost_breakdown = 38;
10752
+ */
10753
+ costBreakdown;
10719
10754
  constructor(data) {
10720
10755
  super();
10721
10756
  protobuf.proto3.util.initPartial(data, this);
@@ -10816,7 +10851,9 @@ var Job = class _Job extends protobuf.Message {
10816
10851
  /* ScalarType.STRING */
10817
10852
  },
10818
10853
  { no: 35, name: "chapter_results", kind: "message", T: ChapterResult, repeated: true },
10819
- { no: 36, name: "clip", kind: "message", T: ClipConfig, opt: true }
10854
+ { no: 36, name: "clip", kind: "message", T: ClipConfig, opt: true },
10855
+ { no: 37, name: "video_id", kind: "scalar", T: 9, opt: true },
10856
+ { no: 38, name: "cost_breakdown", kind: "message", T: JobCostBreakdown }
10820
10857
  ]);
10821
10858
  static fromBinary(bytes, options) {
10822
10859
  return new _Job().fromBinary(bytes, options);
@@ -10878,6 +10915,13 @@ var JobFee = class _JobFee extends protobuf.Message {
10878
10915
  * @generated from field: string currency = 7;
10879
10916
  */
10880
10917
  currency = "";
10918
+ /**
10919
+ * Fee id ("fee_..."). This is what a cost-breakdown fee line's
10920
+ * `reference_id` points at (see JobCostBreakdown).
10921
+ *
10922
+ * @generated from field: string id = 8;
10923
+ */
10924
+ id = "";
10881
10925
  constructor(data) {
10882
10926
  super();
10883
10927
  protobuf.proto3.util.initPartial(data, this);
@@ -10933,6 +10977,13 @@ var JobFee = class _JobFee extends protobuf.Message {
10933
10977
  kind: "scalar",
10934
10978
  T: 9
10935
10979
  /* ScalarType.STRING */
10980
+ },
10981
+ {
10982
+ no: 8,
10983
+ name: "id",
10984
+ kind: "scalar",
10985
+ T: 9
10986
+ /* ScalarType.STRING */
10936
10987
  }
10937
10988
  ]);
10938
10989
  static fromBinary(bytes, options) {
@@ -10948,6 +10999,137 @@ var JobFee = class _JobFee extends protobuf.Message {
10948
10999
  return protobuf.proto3.util.equals(_JobFee, a, b);
10949
11000
  }
10950
11001
  };
11002
+ var JobCostLine = class _JobCostLine extends protobuf.Message {
11003
+ /**
11004
+ * What kind of charge this line is: output, minimum_charge, fee or
11005
+ * adjustment.
11006
+ *
11007
+ * @generated from field: transcodely.v1.JobCostLineType type = 1;
11008
+ */
11009
+ type = 0 /* UNSPECIFIED */;
11010
+ /**
11011
+ * The thing the line is for: an output id ("out_...") on output lines, a
11012
+ * fee id ("fee_...") on fee lines. Empty on the minimum-charge and
11013
+ * adjustment lines, which belong to the job as a whole rather than to any
11014
+ * one part of it.
11015
+ *
11016
+ * @generated from field: string reference_id = 2;
11017
+ */
11018
+ referenceId = "";
11019
+ /**
11020
+ * Human-readable label: "1080p h264 hls", "Minimum job charge",
11021
+ * "AI Caption Generation". Wording is documentation, not API surface, and
11022
+ * may be reworded in any release — key off `type` and `reference_id`.
11023
+ *
11024
+ * @generated from field: string description = 3;
11025
+ */
11026
+ description = "";
11027
+ /**
11028
+ * What this line contributed to total_estimated_cost. Absent until the
11029
+ * input probe supplies a duration.
11030
+ *
11031
+ * @generated from field: optional double estimated_amount_eur = 4;
11032
+ */
11033
+ estimatedAmountEur;
11034
+ /**
11035
+ * What this line contributed to total_actual_cost. Absent until the job
11036
+ * settles; 0 for a line that settled at no charge (a failed job's outputs,
11037
+ * a fee whose artifact was never produced). Absent and zero are different
11038
+ * answers: one is "not known yet", the other is "free".
11039
+ *
11040
+ * Negative only on an adjustment line.
11041
+ *
11042
+ * @generated from field: optional double actual_amount_eur = 5;
11043
+ */
11044
+ actualAmountEur;
11045
+ constructor(data) {
11046
+ super();
11047
+ protobuf.proto3.util.initPartial(data, this);
11048
+ }
11049
+ static runtime = protobuf.proto3;
11050
+ static typeName = "transcodely.v1.JobCostLine";
11051
+ static fields = protobuf.proto3.util.newFieldList(() => [
11052
+ { no: 1, name: "type", kind: "enum", T: protobuf.proto3.getEnumType(JobCostLineType) },
11053
+ {
11054
+ no: 2,
11055
+ name: "reference_id",
11056
+ kind: "scalar",
11057
+ T: 9
11058
+ /* ScalarType.STRING */
11059
+ },
11060
+ {
11061
+ no: 3,
11062
+ name: "description",
11063
+ kind: "scalar",
11064
+ T: 9
11065
+ /* ScalarType.STRING */
11066
+ },
11067
+ { no: 4, name: "estimated_amount_eur", kind: "scalar", T: 1, opt: true },
11068
+ { no: 5, name: "actual_amount_eur", kind: "scalar", T: 1, opt: true }
11069
+ ]);
11070
+ static fromBinary(bytes, options) {
11071
+ return new _JobCostLine().fromBinary(bytes, options);
11072
+ }
11073
+ static fromJson(jsonValue, options) {
11074
+ return new _JobCostLine().fromJson(jsonValue, options);
11075
+ }
11076
+ static fromJsonString(jsonString, options) {
11077
+ return new _JobCostLine().fromJsonString(jsonString, options);
11078
+ }
11079
+ static equals(a, b) {
11080
+ return protobuf.proto3.util.equals(_JobCostLine, a, b);
11081
+ }
11082
+ };
11083
+ var JobCostBreakdown = class _JobCostBreakdown extends protobuf.Message {
11084
+ /**
11085
+ * Lines in reading order: outputs, then fees, then the minimum charge, then
11086
+ * the adjustment.
11087
+ *
11088
+ * @generated from field: repeated transcodely.v1.JobCostLine lines = 1;
11089
+ */
11090
+ lines = [];
11091
+ /**
11092
+ * The totals the lines explain. Same values as Job.total_estimated_cost /
11093
+ * Job.total_actual_cost, repeated here so a breakdown can be verified
11094
+ * without carrying the job around.
11095
+ *
11096
+ * One deliberate difference: a failed job reports total_actual_cost as 0
11097
+ * here even in the rare case where no total was ever written for it (a job
11098
+ * the control plane failed after its worker vanished). A failed job bills
11099
+ * nothing, and "unknown" would be a worse answer than the one the policy
11100
+ * already guarantees.
11101
+ *
11102
+ * @generated from field: optional double total_estimated_cost = 2;
11103
+ */
11104
+ totalEstimatedCost;
11105
+ /**
11106
+ * @generated from field: optional double total_actual_cost = 3;
11107
+ */
11108
+ totalActualCost;
11109
+ constructor(data) {
11110
+ super();
11111
+ protobuf.proto3.util.initPartial(data, this);
11112
+ }
11113
+ static runtime = protobuf.proto3;
11114
+ static typeName = "transcodely.v1.JobCostBreakdown";
11115
+ static fields = protobuf.proto3.util.newFieldList(() => [
11116
+ { no: 1, name: "lines", kind: "message", T: JobCostLine, repeated: true },
11117
+ { no: 2, name: "total_estimated_cost", kind: "scalar", T: 1, opt: true },
11118
+ { no: 3, name: "total_actual_cost", kind: "scalar", T: 1, opt: true }
11119
+ ]);
11120
+ static fromBinary(bytes, options) {
11121
+ return new _JobCostBreakdown().fromBinary(bytes, options);
11122
+ }
11123
+ static fromJson(jsonValue, options) {
11124
+ return new _JobCostBreakdown().fromJson(jsonValue, options);
11125
+ }
11126
+ static fromJsonString(jsonString, options) {
11127
+ return new _JobCostBreakdown().fromJsonString(jsonString, options);
11128
+ }
11129
+ static equals(a, b) {
11130
+ return protobuf.proto3.util.equals(_JobCostBreakdown, a, b);
11131
+ }
11132
+ };
10951
11133
  var ClipConfig = class _ClipConfig extends protobuf.Message {
10952
11134
  /**
10953
11135
  * Where the clip starts, in seconds from the beginning of the input.
@@ -11812,6 +11994,19 @@ var Video = class _Video extends protobuf.Message {
11812
11994
  * @generated from field: optional double encoding_cost = 31;
11813
11995
  */
11814
11996
  encodingCost;
11997
+ /**
11998
+ * Sum of confirmed AI-caption fees, in EUR, across all of this video's jobs
11999
+ * — captions generated inline with the transcode (the auto_captions upload
12000
+ * flag) and retro captions-only jobs that used this video as their input
12001
+ * (input_video_id). Absent until a captions fee is confirmed; fees are
12002
+ * confirmed only when a caption artifact is actually delivered, so voided
12003
+ * and still-estimated fees are never counted. This is a per-feature
12004
+ * breakdown of already-billed job totals, not an extra charge on top of
12005
+ * them.
12006
+ *
12007
+ * @generated from field: optional double captions_cost = 50;
12008
+ */
12009
+ captionsCost;
11815
12010
  /**
11816
12011
  * Timestamps.
11817
12012
  *
@@ -11925,6 +12120,7 @@ var Video = class _Video extends protobuf.Message {
11925
12120
  /* ScalarType.INT64 */
11926
12121
  },
11927
12122
  { no: 31, name: "encoding_cost", kind: "scalar", T: 1, opt: true },
12123
+ { no: 50, name: "captions_cost", kind: "scalar", T: 1, opt: true },
11928
12124
  { no: 40, name: "created_at", kind: "message", T: protobuf.Timestamp },
11929
12125
  { no: 41, name: "updated_at", kind: "message", T: protobuf.Timestamp },
11930
12126
  { no: 42, name: "ready_at", kind: "message", T: protobuf.Timestamp, opt: true },
@@ -12282,6 +12478,19 @@ var CreateUploadRequest = class _CreateUploadRequest extends protobuf.Message {
12282
12478
  * @generated from field: bool hover_previews = 10;
12283
12479
  */
12284
12480
  hoverPreviews = false;
12481
+ /**
12482
+ * When true, generate AI captions inline with the transcode: the managed
12483
+ * job's output carries a "generate" subtitle track (language auto-detected,
12484
+ * WebVTT), produced by the same job — and on the same worker — as the
12485
+ * encode, and listed in the video's streaming manifest so players discover
12486
+ * it natively. Billed as the per-source-minute captions fee on that job;
12487
+ * the fee is only charged when a caption track is actually delivered. The
12488
+ * track surfaces as Video.text_tracks once ready. Unset or false = no
12489
+ * captions.
12490
+ *
12491
+ * @generated from field: optional bool auto_captions = 11;
12492
+ */
12493
+ autoCaptions;
12285
12494
  constructor(data) {
12286
12495
  super();
12287
12496
  protobuf.proto3.util.initPartial(data, this);
@@ -12328,7 +12537,8 @@ var CreateUploadRequest = class _CreateUploadRequest extends protobuf.Message {
12328
12537
  kind: "scalar",
12329
12538
  T: 8
12330
12539
  /* ScalarType.BOOL */
12331
- }
12540
+ },
12541
+ { no: 11, name: "auto_captions", kind: "scalar", T: 8, opt: true }
12332
12542
  ]);
12333
12543
  static fromBinary(bytes, options) {
12334
12544
  return new _CreateUploadRequest().fromBinary(bytes, options);
@@ -12515,6 +12725,19 @@ var CreateFromUrlRequest = class _CreateFromUrlRequest extends protobuf.Message
12515
12725
  * @generated from field: bool hover_previews = 8;
12516
12726
  */
12517
12727
  hoverPreviews = false;
12728
+ /**
12729
+ * When true, generate AI captions inline with the transcode: the managed
12730
+ * job's output carries a "generate" subtitle track (language auto-detected,
12731
+ * WebVTT), produced by the same job — and on the same worker — as the
12732
+ * encode, and listed in the video's streaming manifest so players discover
12733
+ * it natively. Billed as the per-source-minute captions fee on that job;
12734
+ * the fee is only charged when a caption track is actually delivered. The
12735
+ * track surfaces as Video.text_tracks once ready. Unset or false = no
12736
+ * captions.
12737
+ *
12738
+ * @generated from field: optional bool auto_captions = 9;
12739
+ */
12740
+ autoCaptions;
12518
12741
  constructor(data) {
12519
12742
  super();
12520
12743
  protobuf.proto3.util.initPartial(data, this);
@@ -12547,7 +12770,8 @@ var CreateFromUrlRequest = class _CreateFromUrlRequest extends protobuf.Message
12547
12770
  kind: "scalar",
12548
12771
  T: 8
12549
12772
  /* ScalarType.BOOL */
12550
- }
12773
+ },
12774
+ { no: 9, name: "auto_captions", kind: "scalar", T: 8, opt: true }
12551
12775
  ]);
12552
12776
  static fromBinary(bytes, options) {
12553
12777
  return new _CreateFromUrlRequest().fromBinary(bytes, options);
@@ -12767,6 +12991,19 @@ var CreateMultipartUploadRequest = class _CreateMultipartUploadRequest extends p
12767
12991
  * @generated from field: bool hover_previews = 15;
12768
12992
  */
12769
12993
  hoverPreviews = false;
12994
+ /**
12995
+ * When true, generate AI captions inline with the transcode: the managed
12996
+ * job's output carries a "generate" subtitle track (language auto-detected,
12997
+ * WebVTT), produced by the same job — and on the same worker — as the
12998
+ * encode, and listed in the video's streaming manifest so players discover
12999
+ * it natively. Billed as the per-source-minute captions fee on that job;
13000
+ * the fee is only charged when a caption track is actually delivered. The
13001
+ * track surfaces as Video.text_tracks once ready. Unset or false = no
13002
+ * captions.
13003
+ *
13004
+ * @generated from field: optional bool auto_captions = 16;
13005
+ */
13006
+ autoCaptions;
12770
13007
  constructor(data) {
12771
13008
  super();
12772
13009
  protobuf.proto3.util.initPartial(data, this);
@@ -12821,7 +13058,8 @@ var CreateMultipartUploadRequest = class _CreateMultipartUploadRequest extends p
12821
13058
  kind: "scalar",
12822
13059
  T: 8
12823
13060
  /* ScalarType.BOOL */
12824
- }
13061
+ },
13062
+ { no: 16, name: "auto_captions", kind: "scalar", T: 8, opt: true }
12825
13063
  ]);
12826
13064
  static fromBinary(bytes, options) {
12827
13065
  return new _CreateMultipartUploadRequest().fromBinary(bytes, options);
@@ -14750,7 +14988,7 @@ function backoff(attempt) {
14750
14988
  }
14751
14989
 
14752
14990
  // src/version.ts
14753
- var SDK_VERSION = "0.3.3";
14991
+ var SDK_VERSION = "0.3.5";
14754
14992
  var API_VERSION = "2026-05-03";
14755
14993
  var DEFAULT_BASE_URL = "https://api.transcodely.com";
14756
14994
 
@@ -19407,6 +19645,7 @@ exports.HLSSegmentFormat = HLSSegmentFormat;
19407
19645
  exports.InvalidRequestError = InvalidRequestError;
19408
19646
  exports.InvoiceLineType = InvoiceLineType;
19409
19647
  exports.InvoiceStatus = InvoiceStatus;
19648
+ exports.JobCostLineType = JobCostLineType;
19410
19649
  exports.JobPriority = JobPriority;
19411
19650
  exports.JobStatus = JobStatus;
19412
19651
  exports.MembershipRole = MembershipRole;