@transcodely/sdk 0.3.11 → 0.3.13

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.13](https://github.com/transcodely/transcodely-js/compare/v0.3.12...v0.3.13) (2026-10-26)
8
+
9
+
10
+ ### Features
11
+
12
+ * generate_insights from existing captions (api 5.26.0) ([#82](https://github.com/transcodely/transcodely-js/issues/82)) ([a3b4a8d](https://github.com/transcodely/transcodely-js/commit/a3b4a8da9db11748db6f9b9dd34900fb18b5e2be))
13
+
14
+ ## [0.3.12](https://github.com/transcodely/transcodely-js/compare/v0.3.11...v0.3.12) (2026-10-25)
15
+
16
+
17
+ ### Features
18
+
19
+ * auto_insights upload option (api 5.25.0) ([#80](https://github.com/transcodely/transcodely-js/issues/80)) ([fccd526](https://github.com/transcodely/transcodely-js/commit/fccd52644fb83d347be99621ed5de93f40612584))
20
+
7
21
  ## [0.3.11](https://github.com/transcodely/transcodely-js/compare/v0.3.10...v0.3.11) (2026-10-25)
8
22
 
9
23
 
package/README.md CHANGED
@@ -64,6 +64,11 @@ comes back already `processing`. Follow it with `client.videos.watch(video.id)`
64
64
  until it reaches `ready` (or `error`, or `deleted`), or subscribe to the
65
65
  `video.ready` webhook.
66
66
 
67
+ Pass `autoCaptions: true` to generate captions inline with the transcode, and
68
+ add `autoInsights: true` to also run AI insights over those captions (requires
69
+ `autoCaptions`; EUR 0.02 per video + EUR 0.005 per source minute on top of
70
+ captions).
71
+
67
72
  **The app does not need managed hosting turned on first.** An app that has never
68
73
  hosted anything is provisioned by the create call itself — bucket, managed
69
74
  origin and CDN pull zone — which is why a first upload takes a few seconds
@@ -277,6 +282,20 @@ Jobs carry the same data on `job.subtitleResults[i].transcriptRenditions` and
277
282
  `job.insights`. The `job.insights.ready` and `job.insights.failed` webhook events
278
283
  tell you when an insights pass finishes.
279
284
 
285
+ A hosted video that already has AI captions can get insights without
286
+ transcribing again (EUR 0.02 per video + EUR 0.005 per source minute, charged
287
+ only when ready):
288
+
289
+ ```ts
290
+ // `language` is needed only when the video has several AI caption tracks.
291
+ const ins = await client.videos.generateInsights({ id: "vid_a1b2c3d4e5f6g7" });
292
+ console.log(ins.id, ins.status); // ins_..., InsightsStatus.PENDING
293
+ ```
294
+
295
+ The entry also appears on `video.insights`. The `video.insights.ready` and
296
+ `video.insights.failed` webhook events carry the entry itself as a
297
+ `TranscriptInsights` in `event.data`.
298
+
280
299
  ## Authentication
281
300
 
282
301
  Pass your API key in the constructor:
package/dist/index.cjs CHANGED
@@ -4428,6 +4428,7 @@ var WebhookEndpoint = class _WebhookEndpoint extends protobuf.Message {
4428
4428
  * "job.insights.failed", "output.created", "output.ready",
4429
4429
  * "output.failed", "output.progress", "video.uploaded", "video.ready",
4430
4430
  * "video.failed", "video.deleted", "video.source_scheduled_for_deletion",
4431
+ * "video.insights.ready", "video.insights.failed",
4431
4432
  * "app.created", "app.updated", "app.spend_limit_warning",
4432
4433
  * "app.spend_limit_exceeded", or "*".
4433
4434
  * Keep in sync with domain.WebhookEventTypes() ("job.updated" does not exist).
@@ -7363,6 +7364,17 @@ protobuf.proto3.util.setEnumType(TranscriptFormat, "transcodely.v1.TranscriptFor
7363
7364
  { no: 2, name: "TRANSCRIPT_FORMAT_TXT" },
7364
7365
  { no: 3, name: "TRANSCRIPT_FORMAT_MD" }
7365
7366
  ]);
7367
+ var InsightsSource = /* @__PURE__ */ ((InsightsSource2) => {
7368
+ InsightsSource2[InsightsSource2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
7369
+ InsightsSource2[InsightsSource2["JOB"] = 1] = "JOB";
7370
+ InsightsSource2[InsightsSource2["VIDEO"] = 2] = "VIDEO";
7371
+ return InsightsSource2;
7372
+ })(InsightsSource || {});
7373
+ protobuf.proto3.util.setEnumType(InsightsSource, "transcodely.v1.InsightsSource", [
7374
+ { no: 0, name: "INSIGHTS_SOURCE_UNSPECIFIED" },
7375
+ { no: 1, name: "INSIGHTS_SOURCE_JOB" },
7376
+ { no: 2, name: "INSIGHTS_SOURCE_VIDEO" }
7377
+ ]);
7366
7378
  var InsightsStatus = /* @__PURE__ */ ((InsightsStatus2) => {
7367
7379
  InsightsStatus2[InsightsStatus2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
7368
7380
  InsightsStatus2[InsightsStatus2["PENDING"] = 1] = "PENDING";
@@ -8255,7 +8267,8 @@ var InsightsHighlight = class _InsightsHighlight extends protobuf.Message {
8255
8267
  };
8256
8268
  var TranscriptInsights = class _TranscriptInsights extends protobuf.Message {
8257
8269
  /**
8258
- * The out_… output the generate track was configured on.
8270
+ * The out_… output the generate track was configured on. Empty for source
8271
+ * "video".
8259
8272
  *
8260
8273
  * @generated from field: string output_id = 1;
8261
8274
  */
@@ -8400,6 +8413,38 @@ var TranscriptInsights = class _TranscriptInsights extends protobuf.Message {
8400
8413
  * @generated from field: string hint = 23;
8401
8414
  */
8402
8415
  hint = "";
8416
+ /**
8417
+ * Unique identifier of this insights entry (ins_…).
8418
+ *
8419
+ * @generated from field: string id = 24;
8420
+ */
8421
+ id = "";
8422
+ /**
8423
+ * job | video: requested on a captions job, or on a hosted video's existing
8424
+ * captions with VideoService.GenerateInsights.
8425
+ *
8426
+ * @generated from field: transcodely.v1.InsightsSource source = 25;
8427
+ */
8428
+ source = 0 /* UNSPECIFIED */;
8429
+ /**
8430
+ * The hosted video (vid_…) the insights belong to, for source "video".
8431
+ * Empty for source "job" (see Video.insights for a hosted video's
8432
+ * job-sourced insights).
8433
+ *
8434
+ * @generated from field: string video_id = 26;
8435
+ */
8436
+ videoId = "";
8437
+ /**
8438
+ * Price of this entry in EUR, for source "video": EUR 0.02 per video plus
8439
+ * EUR 0.005 per minute of source, fixed when the entry was created. Charged
8440
+ * only when status becomes "ready"; nothing is charged when it fails. An
8441
+ * entry that becomes "ready" after a newer entry for the same language was
8442
+ * already shown on the video is not charged either, and shows 0.
8443
+ * Absent for source "job", whose insights fees are listed on Job.fees.
8444
+ *
8445
+ * @generated from field: optional double fee_eur = 27;
8446
+ */
8447
+ feeEur;
8403
8448
  constructor(data) {
8404
8449
  super();
8405
8450
  protobuf.proto3.util.initPartial(data, this);
@@ -8495,7 +8540,23 @@ var TranscriptInsights = class _TranscriptInsights extends protobuf.Message {
8495
8540
  kind: "scalar",
8496
8541
  T: 9
8497
8542
  /* ScalarType.STRING */
8498
- }
8543
+ },
8544
+ {
8545
+ no: 24,
8546
+ name: "id",
8547
+ kind: "scalar",
8548
+ T: 9
8549
+ /* ScalarType.STRING */
8550
+ },
8551
+ { no: 25, name: "source", kind: "enum", T: protobuf.proto3.getEnumType(InsightsSource) },
8552
+ {
8553
+ no: 26,
8554
+ name: "video_id",
8555
+ kind: "scalar",
8556
+ T: 9
8557
+ /* ScalarType.STRING */
8558
+ },
8559
+ { no: 27, name: "fee_eur", kind: "scalar", T: 1, opt: true }
8499
8560
  ]);
8500
8561
  static fromBinary(bytes, options) {
8501
8562
  return new _TranscriptInsights().fromBinary(bytes, options);
@@ -14306,7 +14367,8 @@ var CreateJobRequest = class _CreateJobRequest extends protobuf.Message {
14306
14367
  * Optional target app. API-key callers may omit it (their key's app is used)
14307
14368
  * or pass their own app; a different app is rejected with PermissionDenied.
14308
14369
  * Portal/JWT callers pass it to create in a specific app in their org;
14309
- * omitted selects the org's first active app.
14370
+ * omitted selects the org's first active app, or, when input_video_id
14371
+ * names a video in the org, that video's app.
14310
14372
  *
14311
14373
  * @generated from field: optional string app_id = 21;
14312
14374
  */
@@ -14979,9 +15041,14 @@ var Video = class _Video extends protobuf.Message {
14979
15041
  textTracks = [];
14980
15042
  /**
14981
15043
  * AI insights for this video, one per transcript language, from the
14982
- * captions job that requested them (SubtitleTrack.insights). Each moves
14983
- * from "pending" to "ready" or "failed". Signed URLs are computed per
14984
- * request under the same rules as text track URLs and are never stored.
15044
+ * captions job that requested them (SubtitleTrack.insights) or from
15045
+ * GenerateInsights. Each moves from "pending" to "ready" or "failed". A
15046
+ * GenerateInsights entry still pending for a language that already has
15047
+ * ready insights is listed first, ahead of the ready entry it will replace.
15048
+ * If that entry fails, the ready insights stay and the failed entry is no
15049
+ * longer listed; video.insights.failed reports it.
15050
+ * Signed URLs are computed per request under the same rules as text track
15051
+ * URLs and are never stored.
14985
15052
  *
14986
15053
  * @generated from field: repeated transcodely.v1.TranscriptInsights insights = 53;
14987
15054
  */
@@ -15024,12 +15091,13 @@ var Video = class _Video extends protobuf.Message {
15024
15091
  /**
15025
15092
  * Everything this video has cost, in EUR: the sum of the settled totals of
15026
15093
  * every job billed for it — the transcode that produced it plus any later
15027
- * job that took it as input (retro captions, for example).
15094
+ * job that took it as input (retro captions, for example) — plus the fee of
15095
+ * every ready GenerateInsights entry (TranscriptInsights.fee_eur).
15028
15096
  *
15029
15097
  * This is the authoritative per-video figure and the one to display. It is
15030
- * built from the same job totals the billing ledger is written from, so it
15098
+ * built from the same amounts the billing ledger is written from, so it
15031
15099
  * reconciles with the invoice; captions_cost is a breakdown inside it.
15032
- * Absent while no linked job has settled yet.
15100
+ * Absent while nothing linked to the video has been billed yet.
15033
15101
  *
15034
15102
  * @generated from field: optional double total_cost = 52;
15035
15103
  */
@@ -15552,6 +15620,22 @@ var CreateUploadRequest = class _CreateUploadRequest extends protobuf.Message {
15552
15620
  * @generated from field: optional bool auto_captions = 11;
15553
15621
  */
15554
15622
  autoCaptions;
15623
+ /**
15624
+ * When true, also run AI insights over the inline captions: title
15625
+ * suggestions, a summary, key points, chapters, questions the content
15626
+ * answers, key terms, quotable highlights and topics (the generate track
15627
+ * carries insights.enabled = true; see SubtitleTrack.insights). Requires
15628
+ * auto_captions = true; rejected otherwise with `invalid_argument`, error
15629
+ * code `parameter_incompatible` on auto_insights. Billed as the
15630
+ * `insights_job` (EUR 0.02 per video) and `insights` (EUR 0.005 per source
15631
+ * minute) fees on the transcode job, on top of the captions fee; not
15632
+ * charged when the insights fail. The insights surface as Video.insights.
15633
+ * Deployments without the feature reject it with `invalid_argument`, error
15634
+ * code `parameter_unsupported`. Unset or false = no insights.
15635
+ *
15636
+ * @generated from field: optional bool auto_insights = 12;
15637
+ */
15638
+ autoInsights;
15555
15639
  constructor(data) {
15556
15640
  super();
15557
15641
  protobuf.proto3.util.initPartial(data, this);
@@ -15599,7 +15683,8 @@ var CreateUploadRequest = class _CreateUploadRequest extends protobuf.Message {
15599
15683
  T: 8
15600
15684
  /* ScalarType.BOOL */
15601
15685
  },
15602
- { no: 11, name: "auto_captions", kind: "scalar", T: 8, opt: true }
15686
+ { no: 11, name: "auto_captions", kind: "scalar", T: 8, opt: true },
15687
+ { no: 12, name: "auto_insights", kind: "scalar", T: 8, opt: true }
15603
15688
  ]);
15604
15689
  static fromBinary(bytes, options) {
15605
15690
  return new _CreateUploadRequest().fromBinary(bytes, options);
@@ -15808,6 +15893,22 @@ var CreateFromUrlRequest = class _CreateFromUrlRequest extends protobuf.Message
15808
15893
  * @generated from field: optional bool auto_captions = 9;
15809
15894
  */
15810
15895
  autoCaptions;
15896
+ /**
15897
+ * When true, also run AI insights over the inline captions: title
15898
+ * suggestions, a summary, key points, chapters, questions the content
15899
+ * answers, key terms, quotable highlights and topics (the generate track
15900
+ * carries insights.enabled = true; see SubtitleTrack.insights). Requires
15901
+ * auto_captions = true; rejected otherwise with `invalid_argument`, error
15902
+ * code `parameter_incompatible` on auto_insights. Billed as the
15903
+ * `insights_job` (EUR 0.02 per video) and `insights` (EUR 0.005 per source
15904
+ * minute) fees on the transcode job, on top of the captions fee; not
15905
+ * charged when the insights fail. The insights surface as Video.insights.
15906
+ * Deployments without the feature reject it with `invalid_argument`, error
15907
+ * code `parameter_unsupported`. Unset or false = no insights.
15908
+ *
15909
+ * @generated from field: optional bool auto_insights = 10;
15910
+ */
15911
+ autoInsights;
15811
15912
  constructor(data) {
15812
15913
  super();
15813
15914
  protobuf.proto3.util.initPartial(data, this);
@@ -15841,7 +15942,8 @@ var CreateFromUrlRequest = class _CreateFromUrlRequest extends protobuf.Message
15841
15942
  T: 8
15842
15943
  /* ScalarType.BOOL */
15843
15944
  },
15844
- { no: 9, name: "auto_captions", kind: "scalar", T: 8, opt: true }
15945
+ { no: 9, name: "auto_captions", kind: "scalar", T: 8, opt: true },
15946
+ { no: 10, name: "auto_insights", kind: "scalar", T: 8, opt: true }
15845
15947
  ]);
15846
15948
  static fromBinary(bytes, options) {
15847
15949
  return new _CreateFromUrlRequest().fromBinary(bytes, options);
@@ -16083,6 +16185,22 @@ var CreateMultipartUploadRequest = class _CreateMultipartUploadRequest extends p
16083
16185
  * @generated from field: optional bool auto_captions = 16;
16084
16186
  */
16085
16187
  autoCaptions;
16188
+ /**
16189
+ * When true, also run AI insights over the inline captions: title
16190
+ * suggestions, a summary, key points, chapters, questions the content
16191
+ * answers, key terms, quotable highlights and topics (the generate track
16192
+ * carries insights.enabled = true; see SubtitleTrack.insights). Requires
16193
+ * auto_captions = true; rejected otherwise with `invalid_argument`, error
16194
+ * code `parameter_incompatible` on auto_insights. Billed as the
16195
+ * `insights_job` (EUR 0.02 per video) and `insights` (EUR 0.005 per source
16196
+ * minute) fees on the transcode job, on top of the captions fee; not
16197
+ * charged when the insights fail. The insights surface as Video.insights.
16198
+ * Deployments without the feature reject it with `invalid_argument`, error
16199
+ * code `parameter_unsupported`. Unset or false = no insights.
16200
+ *
16201
+ * @generated from field: optional bool auto_insights = 17;
16202
+ */
16203
+ autoInsights;
16086
16204
  constructor(data) {
16087
16205
  super();
16088
16206
  protobuf.proto3.util.initPartial(data, this);
@@ -16138,7 +16256,8 @@ var CreateMultipartUploadRequest = class _CreateMultipartUploadRequest extends p
16138
16256
  T: 8
16139
16257
  /* ScalarType.BOOL */
16140
16258
  },
16141
- { no: 16, name: "auto_captions", kind: "scalar", T: 8, opt: true }
16259
+ { no: 16, name: "auto_captions", kind: "scalar", T: 8, opt: true },
16260
+ { no: 17, name: "auto_insights", kind: "scalar", T: 8, opt: true }
16142
16261
  ]);
16143
16262
  static fromBinary(bytes, options) {
16144
16263
  return new _CreateMultipartUploadRequest().fromBinary(bytes, options);
@@ -17739,6 +17858,100 @@ var GetSeoMarkupResponse = class _GetSeoMarkupResponse extends protobuf.Message
17739
17858
  return protobuf.proto3.util.equals(_GetSeoMarkupResponse, a, b);
17740
17859
  }
17741
17860
  };
17861
+ var GenerateInsightsRequest = class _GenerateInsightsRequest extends protobuf.Message {
17862
+ /**
17863
+ * Video ID.
17864
+ *
17865
+ * @generated from field: string id = 1;
17866
+ */
17867
+ id = "";
17868
+ /**
17869
+ * ISO 639-2 language of the AI caption track to use (e.g. "eng"). Optional
17870
+ * when the video has exactly one AI caption track; required when it has
17871
+ * several (refused with code parameter_required, listing the available
17872
+ * languages).
17873
+ *
17874
+ * @generated from field: optional string language = 2;
17875
+ */
17876
+ language;
17877
+ /**
17878
+ * Optional free-text guidance about the content, its audience or the tone
17879
+ * you want, at most 300 characters. Same meaning as InsightsOptions.hint.
17880
+ *
17881
+ * @generated from field: optional string hint = 3;
17882
+ */
17883
+ hint;
17884
+ /**
17885
+ * Optional app the video belongs to. API-key callers may omit it (their
17886
+ * key's app is used) or pass their own app; a different app is rejected
17887
+ * with PermissionDenied. Portal/JWT callers may pass it; omitted, the app
17888
+ * is resolved from the video.
17889
+ *
17890
+ * @generated from field: optional string app_id = 4;
17891
+ */
17892
+ appId;
17893
+ constructor(data) {
17894
+ super();
17895
+ protobuf.proto3.util.initPartial(data, this);
17896
+ }
17897
+ static runtime = protobuf.proto3;
17898
+ static typeName = "transcodely.v1.GenerateInsightsRequest";
17899
+ static fields = protobuf.proto3.util.newFieldList(() => [
17900
+ {
17901
+ no: 1,
17902
+ name: "id",
17903
+ kind: "scalar",
17904
+ T: 9
17905
+ /* ScalarType.STRING */
17906
+ },
17907
+ { no: 2, name: "language", kind: "scalar", T: 9, opt: true },
17908
+ { no: 3, name: "hint", kind: "scalar", T: 9, opt: true },
17909
+ { no: 4, name: "app_id", kind: "scalar", T: 9, opt: true }
17910
+ ]);
17911
+ static fromBinary(bytes, options) {
17912
+ return new _GenerateInsightsRequest().fromBinary(bytes, options);
17913
+ }
17914
+ static fromJson(jsonValue, options) {
17915
+ return new _GenerateInsightsRequest().fromJson(jsonValue, options);
17916
+ }
17917
+ static fromJsonString(jsonString, options) {
17918
+ return new _GenerateInsightsRequest().fromJsonString(jsonString, options);
17919
+ }
17920
+ static equals(a, b) {
17921
+ return protobuf.proto3.util.equals(_GenerateInsightsRequest, a, b);
17922
+ }
17923
+ };
17924
+ var GenerateInsightsResponse = class _GenerateInsightsResponse extends protobuf.Message {
17925
+ /**
17926
+ * The insights entry: newly created, or the one already pending for this
17927
+ * video and language. Status is "pending"; poll VideoService.Get (or
17928
+ * Watch) or subscribe to video.insights.ready / video.insights.failed.
17929
+ *
17930
+ * @generated from field: transcodely.v1.TranscriptInsights insights = 1;
17931
+ */
17932
+ insights;
17933
+ constructor(data) {
17934
+ super();
17935
+ protobuf.proto3.util.initPartial(data, this);
17936
+ }
17937
+ static runtime = protobuf.proto3;
17938
+ static typeName = "transcodely.v1.GenerateInsightsResponse";
17939
+ static fields = protobuf.proto3.util.newFieldList(() => [
17940
+ { no: 1, name: "insights", kind: "message", T: TranscriptInsights }
17941
+ ]);
17942
+ static fromBinary(bytes, options) {
17943
+ return new _GenerateInsightsResponse().fromBinary(bytes, options);
17944
+ }
17945
+ static fromJson(jsonValue, options) {
17946
+ return new _GenerateInsightsResponse().fromJson(jsonValue, options);
17947
+ }
17948
+ static fromJsonString(jsonString, options) {
17949
+ return new _GenerateInsightsResponse().fromJsonString(jsonString, options);
17950
+ }
17951
+ static equals(a, b) {
17952
+ return protobuf.proto3.util.equals(_GenerateInsightsResponse, a, b);
17953
+ }
17954
+ };
17742
17955
 
17743
17956
  // src/webhooks/types.ts
17744
17957
  var WEBHOOK_EVENT_TYPES = [
@@ -17758,6 +17971,8 @@ var WEBHOOK_EVENT_TYPES = [
17758
17971
  "video.failed",
17759
17972
  "video.deleted",
17760
17973
  "video.source_scheduled_for_deletion",
17974
+ "video.insights.ready",
17975
+ "video.insights.failed",
17761
17976
  "app.created",
17762
17977
  "app.updated",
17763
17978
  "app.spend_limit_warning",
@@ -17780,8 +17995,14 @@ var NOTIFICATION_EVENT_TYPES = /* @__PURE__ */ new Set([
17780
17995
  "app.spend_limit_warning",
17781
17996
  "app.spend_limit_exceeded"
17782
17997
  ]);
17998
+ var EXACT_TYPE_DECODERS = /* @__PURE__ */ new Map([
17999
+ ["video.insights.ready", (json) => fromJson(json, TranscriptInsights)],
18000
+ ["video.insights.failed", (json) => fromJson(json, TranscriptInsights)]
18001
+ ]);
17783
18002
  function decoderForType(type) {
17784
18003
  if (NOTIFICATION_EVENT_TYPES.has(type)) return void 0;
18004
+ const exact = EXACT_TYPE_DECODERS.get(type);
18005
+ if (exact) return exact;
17785
18006
  for (const entry of RESOURCE_DECODERS) {
17786
18007
  if (type.startsWith(entry.prefix)) return entry.decode;
17787
18008
  }
@@ -19931,7 +20152,7 @@ function backoff(attempt) {
19931
20152
  }
19932
20153
 
19933
20154
  // src/version.ts
19934
- var SDK_VERSION = "0.3.11";
20155
+ var SDK_VERSION = "0.3.13";
19935
20156
  var API_VERSION = "2026-05-03";
19936
20157
  var DEFAULT_BASE_URL = "https://api.transcodely.com";
19937
20158
 
@@ -23389,7 +23610,8 @@ var UploadEngine = class {
23389
23610
  ...opts.visibility !== void 0 ? { visibility: opts.visibility } : {},
23390
23611
  ...opts.preset !== void 0 ? { preset: opts.preset } : {},
23391
23612
  ...opts.hoverPreviews !== void 0 ? { hoverPreviews: opts.hoverPreviews } : {},
23392
- ...opts.autoCaptions !== void 0 ? { autoCaptions: opts.autoCaptions } : {}
23613
+ ...opts.autoCaptions !== void 0 ? { autoCaptions: opts.autoCaptions } : {},
23614
+ ...opts.autoInsights !== void 0 ? { autoInsights: opts.autoInsights } : {}
23393
23615
  };
23394
23616
  return totalParts === 1 ? await this.single(src, opts, meta, report) : await this.multipart(src, opts, meta, partSize, totalParts, report);
23395
23617
  }
@@ -23739,6 +23961,31 @@ var VideoService = {
23739
23961
  I: GetSeoMarkupRequest,
23740
23962
  O: GetSeoMarkupResponse,
23741
23963
  kind: protobuf.MethodKind.Unary
23964
+ },
23965
+ /**
23966
+ * Generate AI insights (title suggestions, summary, key points, chapters,
23967
+ * questions, key terms, highlights, topics) from a hosted video's existing
23968
+ * AI captions, without transcribing again. Billed EUR 0.02 per video plus
23969
+ * EUR 0.005 per minute of source, charged only when the insights become
23970
+ * ready. Returns the entry in "pending"; it also appears on Video.insights,
23971
+ * and video.insights.ready or video.insights.failed fires when it finishes.
23972
+ *
23973
+ * While an entry for the same video and language is pending, the call
23974
+ * returns that entry and bills nothing new. Once it is ready or failed, a
23975
+ * new call generates (and bills) a new entry; it replaces the ready one
23976
+ * only when it becomes ready itself.
23977
+ *
23978
+ * Refused with failed_precondition and code captions_required when the
23979
+ * video has no AI captions, and insights_transcript_unavailable when the
23980
+ * caption track has no transcript.
23981
+ *
23982
+ * @generated from rpc transcodely.v1.VideoService.GenerateInsights
23983
+ */
23984
+ generateInsights: {
23985
+ name: "GenerateInsights",
23986
+ I: GenerateInsightsRequest,
23987
+ O: GenerateInsightsResponse,
23988
+ kind: protobuf.MethodKind.Unary
23742
23989
  }
23743
23990
  }
23744
23991
  };
@@ -23911,6 +24158,29 @@ var Videos = class {
23911
24158
  opts
23912
24159
  );
23913
24160
  }
24161
+ /**
24162
+ * Generate AI insights (title suggestions, summary, key points, chapters,
24163
+ * questions, key terms, highlights, topics) from a hosted video's existing
24164
+ * AI captions, without transcribing again. Returns the TranscriptInsights
24165
+ * entry in "pending"; it also appears on `video.insights`, and
24166
+ * `video.insights.ready` or `video.insights.failed` fires when it finishes.
24167
+ * Billed EUR 0.02 per video plus EUR 0.005 per minute of source, charged
24168
+ * only when the insights become ready.
24169
+ *
24170
+ * While an entry for the same video and language is pending, the call
24171
+ * returns that entry and bills nothing new. Pass `language` when the video
24172
+ * has several AI caption tracks. A video without AI captions is refused with
24173
+ * failed_precondition (code captions_required).
24174
+ */
24175
+ async generateInsights(req, opts) {
24176
+ const res = await this.transport.unary(
24177
+ VideoService,
24178
+ VideoService.methods.generateInsights,
24179
+ new GenerateInsightsRequest(req),
24180
+ opts
24181
+ );
24182
+ return res.insights;
24183
+ }
23914
24184
  };
23915
24185
 
23916
24186
  // src/resources/uploads.ts
@@ -25295,6 +25565,7 @@ exports.HDRMode = HDRMode;
25295
25565
  exports.HLSPlaylistType = HLSPlaylistType;
25296
25566
  exports.HLSSegmentFormat = HLSSegmentFormat;
25297
25567
  exports.HealthStatus = HealthStatus;
25568
+ exports.InsightsSource = InsightsSource;
25298
25569
  exports.InsightsStatus = InsightsStatus;
25299
25570
  exports.InvalidRequestError = InvalidRequestError;
25300
25571
  exports.InvoiceLineType = InvoiceLineType;