@transcodely/sdk 0.3.12 → 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/dist/index.mjs CHANGED
@@ -4426,6 +4426,7 @@ var WebhookEndpoint = class _WebhookEndpoint extends Message {
4426
4426
  * "job.insights.failed", "output.created", "output.ready",
4427
4427
  * "output.failed", "output.progress", "video.uploaded", "video.ready",
4428
4428
  * "video.failed", "video.deleted", "video.source_scheduled_for_deletion",
4429
+ * "video.insights.ready", "video.insights.failed",
4429
4430
  * "app.created", "app.updated", "app.spend_limit_warning",
4430
4431
  * "app.spend_limit_exceeded", or "*".
4431
4432
  * Keep in sync with domain.WebhookEventTypes() ("job.updated" does not exist).
@@ -7361,6 +7362,17 @@ proto3.util.setEnumType(TranscriptFormat, "transcodely.v1.TranscriptFormat", [
7361
7362
  { no: 2, name: "TRANSCRIPT_FORMAT_TXT" },
7362
7363
  { no: 3, name: "TRANSCRIPT_FORMAT_MD" }
7363
7364
  ]);
7365
+ var InsightsSource = /* @__PURE__ */ ((InsightsSource2) => {
7366
+ InsightsSource2[InsightsSource2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
7367
+ InsightsSource2[InsightsSource2["JOB"] = 1] = "JOB";
7368
+ InsightsSource2[InsightsSource2["VIDEO"] = 2] = "VIDEO";
7369
+ return InsightsSource2;
7370
+ })(InsightsSource || {});
7371
+ proto3.util.setEnumType(InsightsSource, "transcodely.v1.InsightsSource", [
7372
+ { no: 0, name: "INSIGHTS_SOURCE_UNSPECIFIED" },
7373
+ { no: 1, name: "INSIGHTS_SOURCE_JOB" },
7374
+ { no: 2, name: "INSIGHTS_SOURCE_VIDEO" }
7375
+ ]);
7364
7376
  var InsightsStatus = /* @__PURE__ */ ((InsightsStatus2) => {
7365
7377
  InsightsStatus2[InsightsStatus2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
7366
7378
  InsightsStatus2[InsightsStatus2["PENDING"] = 1] = "PENDING";
@@ -8253,7 +8265,8 @@ var InsightsHighlight = class _InsightsHighlight extends Message {
8253
8265
  };
8254
8266
  var TranscriptInsights = class _TranscriptInsights extends Message {
8255
8267
  /**
8256
- * The out_… output the generate track was configured on.
8268
+ * The out_… output the generate track was configured on. Empty for source
8269
+ * "video".
8257
8270
  *
8258
8271
  * @generated from field: string output_id = 1;
8259
8272
  */
@@ -8398,6 +8411,38 @@ var TranscriptInsights = class _TranscriptInsights extends Message {
8398
8411
  * @generated from field: string hint = 23;
8399
8412
  */
8400
8413
  hint = "";
8414
+ /**
8415
+ * Unique identifier of this insights entry (ins_…).
8416
+ *
8417
+ * @generated from field: string id = 24;
8418
+ */
8419
+ id = "";
8420
+ /**
8421
+ * job | video: requested on a captions job, or on a hosted video's existing
8422
+ * captions with VideoService.GenerateInsights.
8423
+ *
8424
+ * @generated from field: transcodely.v1.InsightsSource source = 25;
8425
+ */
8426
+ source = 0 /* UNSPECIFIED */;
8427
+ /**
8428
+ * The hosted video (vid_…) the insights belong to, for source "video".
8429
+ * Empty for source "job" (see Video.insights for a hosted video's
8430
+ * job-sourced insights).
8431
+ *
8432
+ * @generated from field: string video_id = 26;
8433
+ */
8434
+ videoId = "";
8435
+ /**
8436
+ * Price of this entry in EUR, for source "video": EUR 0.02 per video plus
8437
+ * EUR 0.005 per minute of source, fixed when the entry was created. Charged
8438
+ * only when status becomes "ready"; nothing is charged when it fails. An
8439
+ * entry that becomes "ready" after a newer entry for the same language was
8440
+ * already shown on the video is not charged either, and shows 0.
8441
+ * Absent for source "job", whose insights fees are listed on Job.fees.
8442
+ *
8443
+ * @generated from field: optional double fee_eur = 27;
8444
+ */
8445
+ feeEur;
8401
8446
  constructor(data) {
8402
8447
  super();
8403
8448
  proto3.util.initPartial(data, this);
@@ -8493,7 +8538,23 @@ var TranscriptInsights = class _TranscriptInsights extends Message {
8493
8538
  kind: "scalar",
8494
8539
  T: 9
8495
8540
  /* ScalarType.STRING */
8496
- }
8541
+ },
8542
+ {
8543
+ no: 24,
8544
+ name: "id",
8545
+ kind: "scalar",
8546
+ T: 9
8547
+ /* ScalarType.STRING */
8548
+ },
8549
+ { no: 25, name: "source", kind: "enum", T: proto3.getEnumType(InsightsSource) },
8550
+ {
8551
+ no: 26,
8552
+ name: "video_id",
8553
+ kind: "scalar",
8554
+ T: 9
8555
+ /* ScalarType.STRING */
8556
+ },
8557
+ { no: 27, name: "fee_eur", kind: "scalar", T: 1, opt: true }
8497
8558
  ]);
8498
8559
  static fromBinary(bytes, options) {
8499
8560
  return new _TranscriptInsights().fromBinary(bytes, options);
@@ -14304,7 +14365,8 @@ var CreateJobRequest = class _CreateJobRequest extends Message {
14304
14365
  * Optional target app. API-key callers may omit it (their key's app is used)
14305
14366
  * or pass their own app; a different app is rejected with PermissionDenied.
14306
14367
  * Portal/JWT callers pass it to create in a specific app in their org;
14307
- * omitted selects the org's first active app.
14368
+ * omitted selects the org's first active app, or, when input_video_id
14369
+ * names a video in the org, that video's app.
14308
14370
  *
14309
14371
  * @generated from field: optional string app_id = 21;
14310
14372
  */
@@ -14977,9 +15039,14 @@ var Video = class _Video extends Message {
14977
15039
  textTracks = [];
14978
15040
  /**
14979
15041
  * AI insights for this video, one per transcript language, from the
14980
- * captions job that requested them (SubtitleTrack.insights). Each moves
14981
- * from "pending" to "ready" or "failed". Signed URLs are computed per
14982
- * request under the same rules as text track URLs and are never stored.
15042
+ * captions job that requested them (SubtitleTrack.insights) or from
15043
+ * GenerateInsights. Each moves from "pending" to "ready" or "failed". A
15044
+ * GenerateInsights entry still pending for a language that already has
15045
+ * ready insights is listed first, ahead of the ready entry it will replace.
15046
+ * If that entry fails, the ready insights stay and the failed entry is no
15047
+ * longer listed; video.insights.failed reports it.
15048
+ * Signed URLs are computed per request under the same rules as text track
15049
+ * URLs and are never stored.
14983
15050
  *
14984
15051
  * @generated from field: repeated transcodely.v1.TranscriptInsights insights = 53;
14985
15052
  */
@@ -15022,12 +15089,13 @@ var Video = class _Video extends Message {
15022
15089
  /**
15023
15090
  * Everything this video has cost, in EUR: the sum of the settled totals of
15024
15091
  * every job billed for it — the transcode that produced it plus any later
15025
- * job that took it as input (retro captions, for example).
15092
+ * job that took it as input (retro captions, for example) — plus the fee of
15093
+ * every ready GenerateInsights entry (TranscriptInsights.fee_eur).
15026
15094
  *
15027
15095
  * This is the authoritative per-video figure and the one to display. It is
15028
- * built from the same job totals the billing ledger is written from, so it
15096
+ * built from the same amounts the billing ledger is written from, so it
15029
15097
  * reconciles with the invoice; captions_cost is a breakdown inside it.
15030
- * Absent while no linked job has settled yet.
15098
+ * Absent while nothing linked to the video has been billed yet.
15031
15099
  *
15032
15100
  * @generated from field: optional double total_cost = 52;
15033
15101
  */
@@ -17788,6 +17856,100 @@ var GetSeoMarkupResponse = class _GetSeoMarkupResponse extends Message {
17788
17856
  return proto3.util.equals(_GetSeoMarkupResponse, a, b);
17789
17857
  }
17790
17858
  };
17859
+ var GenerateInsightsRequest = class _GenerateInsightsRequest extends Message {
17860
+ /**
17861
+ * Video ID.
17862
+ *
17863
+ * @generated from field: string id = 1;
17864
+ */
17865
+ id = "";
17866
+ /**
17867
+ * ISO 639-2 language of the AI caption track to use (e.g. "eng"). Optional
17868
+ * when the video has exactly one AI caption track; required when it has
17869
+ * several (refused with code parameter_required, listing the available
17870
+ * languages).
17871
+ *
17872
+ * @generated from field: optional string language = 2;
17873
+ */
17874
+ language;
17875
+ /**
17876
+ * Optional free-text guidance about the content, its audience or the tone
17877
+ * you want, at most 300 characters. Same meaning as InsightsOptions.hint.
17878
+ *
17879
+ * @generated from field: optional string hint = 3;
17880
+ */
17881
+ hint;
17882
+ /**
17883
+ * Optional app the video belongs to. API-key callers may omit it (their
17884
+ * key's app is used) or pass their own app; a different app is rejected
17885
+ * with PermissionDenied. Portal/JWT callers may pass it; omitted, the app
17886
+ * is resolved from the video.
17887
+ *
17888
+ * @generated from field: optional string app_id = 4;
17889
+ */
17890
+ appId;
17891
+ constructor(data) {
17892
+ super();
17893
+ proto3.util.initPartial(data, this);
17894
+ }
17895
+ static runtime = proto3;
17896
+ static typeName = "transcodely.v1.GenerateInsightsRequest";
17897
+ static fields = proto3.util.newFieldList(() => [
17898
+ {
17899
+ no: 1,
17900
+ name: "id",
17901
+ kind: "scalar",
17902
+ T: 9
17903
+ /* ScalarType.STRING */
17904
+ },
17905
+ { no: 2, name: "language", kind: "scalar", T: 9, opt: true },
17906
+ { no: 3, name: "hint", kind: "scalar", T: 9, opt: true },
17907
+ { no: 4, name: "app_id", kind: "scalar", T: 9, opt: true }
17908
+ ]);
17909
+ static fromBinary(bytes, options) {
17910
+ return new _GenerateInsightsRequest().fromBinary(bytes, options);
17911
+ }
17912
+ static fromJson(jsonValue, options) {
17913
+ return new _GenerateInsightsRequest().fromJson(jsonValue, options);
17914
+ }
17915
+ static fromJsonString(jsonString, options) {
17916
+ return new _GenerateInsightsRequest().fromJsonString(jsonString, options);
17917
+ }
17918
+ static equals(a, b) {
17919
+ return proto3.util.equals(_GenerateInsightsRequest, a, b);
17920
+ }
17921
+ };
17922
+ var GenerateInsightsResponse = class _GenerateInsightsResponse extends Message {
17923
+ /**
17924
+ * The insights entry: newly created, or the one already pending for this
17925
+ * video and language. Status is "pending"; poll VideoService.Get (or
17926
+ * Watch) or subscribe to video.insights.ready / video.insights.failed.
17927
+ *
17928
+ * @generated from field: transcodely.v1.TranscriptInsights insights = 1;
17929
+ */
17930
+ insights;
17931
+ constructor(data) {
17932
+ super();
17933
+ proto3.util.initPartial(data, this);
17934
+ }
17935
+ static runtime = proto3;
17936
+ static typeName = "transcodely.v1.GenerateInsightsResponse";
17937
+ static fields = proto3.util.newFieldList(() => [
17938
+ { no: 1, name: "insights", kind: "message", T: TranscriptInsights }
17939
+ ]);
17940
+ static fromBinary(bytes, options) {
17941
+ return new _GenerateInsightsResponse().fromBinary(bytes, options);
17942
+ }
17943
+ static fromJson(jsonValue, options) {
17944
+ return new _GenerateInsightsResponse().fromJson(jsonValue, options);
17945
+ }
17946
+ static fromJsonString(jsonString, options) {
17947
+ return new _GenerateInsightsResponse().fromJsonString(jsonString, options);
17948
+ }
17949
+ static equals(a, b) {
17950
+ return proto3.util.equals(_GenerateInsightsResponse, a, b);
17951
+ }
17952
+ };
17791
17953
 
17792
17954
  // src/webhooks/types.ts
17793
17955
  var WEBHOOK_EVENT_TYPES = [
@@ -17807,6 +17969,8 @@ var WEBHOOK_EVENT_TYPES = [
17807
17969
  "video.failed",
17808
17970
  "video.deleted",
17809
17971
  "video.source_scheduled_for_deletion",
17972
+ "video.insights.ready",
17973
+ "video.insights.failed",
17810
17974
  "app.created",
17811
17975
  "app.updated",
17812
17976
  "app.spend_limit_warning",
@@ -17829,8 +17993,14 @@ var NOTIFICATION_EVENT_TYPES = /* @__PURE__ */ new Set([
17829
17993
  "app.spend_limit_warning",
17830
17994
  "app.spend_limit_exceeded"
17831
17995
  ]);
17996
+ var EXACT_TYPE_DECODERS = /* @__PURE__ */ new Map([
17997
+ ["video.insights.ready", (json) => fromJson(json, TranscriptInsights)],
17998
+ ["video.insights.failed", (json) => fromJson(json, TranscriptInsights)]
17999
+ ]);
17832
18000
  function decoderForType(type) {
17833
18001
  if (NOTIFICATION_EVENT_TYPES.has(type)) return void 0;
18002
+ const exact = EXACT_TYPE_DECODERS.get(type);
18003
+ if (exact) return exact;
17834
18004
  for (const entry of RESOURCE_DECODERS) {
17835
18005
  if (type.startsWith(entry.prefix)) return entry.decode;
17836
18006
  }
@@ -19980,7 +20150,7 @@ function backoff(attempt) {
19980
20150
  }
19981
20151
 
19982
20152
  // src/version.ts
19983
- var SDK_VERSION = "0.3.12";
20153
+ var SDK_VERSION = "0.3.13";
19984
20154
  var API_VERSION = "2026-05-03";
19985
20155
  var DEFAULT_BASE_URL = "https://api.transcodely.com";
19986
20156
 
@@ -23789,6 +23959,31 @@ var VideoService = {
23789
23959
  I: GetSeoMarkupRequest,
23790
23960
  O: GetSeoMarkupResponse,
23791
23961
  kind: MethodKind.Unary
23962
+ },
23963
+ /**
23964
+ * Generate AI insights (title suggestions, summary, key points, chapters,
23965
+ * questions, key terms, highlights, topics) from a hosted video's existing
23966
+ * AI captions, without transcribing again. Billed EUR 0.02 per video plus
23967
+ * EUR 0.005 per minute of source, charged only when the insights become
23968
+ * ready. Returns the entry in "pending"; it also appears on Video.insights,
23969
+ * and video.insights.ready or video.insights.failed fires when it finishes.
23970
+ *
23971
+ * While an entry for the same video and language is pending, the call
23972
+ * returns that entry and bills nothing new. Once it is ready or failed, a
23973
+ * new call generates (and bills) a new entry; it replaces the ready one
23974
+ * only when it becomes ready itself.
23975
+ *
23976
+ * Refused with failed_precondition and code captions_required when the
23977
+ * video has no AI captions, and insights_transcript_unavailable when the
23978
+ * caption track has no transcript.
23979
+ *
23980
+ * @generated from rpc transcodely.v1.VideoService.GenerateInsights
23981
+ */
23982
+ generateInsights: {
23983
+ name: "GenerateInsights",
23984
+ I: GenerateInsightsRequest,
23985
+ O: GenerateInsightsResponse,
23986
+ kind: MethodKind.Unary
23792
23987
  }
23793
23988
  }
23794
23989
  };
@@ -23961,6 +24156,29 @@ var Videos = class {
23961
24156
  opts
23962
24157
  );
23963
24158
  }
24159
+ /**
24160
+ * Generate AI insights (title suggestions, summary, key points, chapters,
24161
+ * questions, key terms, highlights, topics) from a hosted video's existing
24162
+ * AI captions, without transcribing again. Returns the TranscriptInsights
24163
+ * entry in "pending"; it also appears on `video.insights`, and
24164
+ * `video.insights.ready` or `video.insights.failed` fires when it finishes.
24165
+ * Billed EUR 0.02 per video plus EUR 0.005 per minute of source, charged
24166
+ * only when the insights become ready.
24167
+ *
24168
+ * While an entry for the same video and language is pending, the call
24169
+ * returns that entry and bills nothing new. Pass `language` when the video
24170
+ * has several AI caption tracks. A video without AI captions is refused with
24171
+ * failed_precondition (code captions_required).
24172
+ */
24173
+ async generateInsights(req, opts) {
24174
+ const res = await this.transport.unary(
24175
+ VideoService,
24176
+ VideoService.methods.generateInsights,
24177
+ new GenerateInsightsRequest(req),
24178
+ opts
24179
+ );
24180
+ return res.insights;
24181
+ }
23964
24182
  };
23965
24183
 
23966
24184
  // src/resources/uploads.ts
@@ -25314,6 +25532,6 @@ var Transcodely = class {
25314
25532
  Transcodely.API_VERSION = API_VERSION;
25315
25533
  Transcodely.SDK_VERSION = SDK_VERSION;
25316
25534
 
25317
- export { APIConnectionError, APIError, API_VERSION, AppStatus, AudioCodec, AuthenticationError, BillingStanding, BillingTreatment, BitrateMode, ConflictError, Container, ContentAwareMode, ContentType, DEFAULT_BASE_URL, DEFAULT_CONCURRENCY, DEFAULT_MAX_RETRIES, DEFAULT_PART_SIZE, DEFAULT_RETRY_BASE_DELAY_MS, DEFAULT_TOLERANCE_SECONDS, DRMSystem, DeliveryFormat, DunningStage, EVENT_ID_HEADER, EncryptionScheme, ExposureThresholdSource, GOPAlignmentMode, HDRFormat, HDRMode, HLSPlaylistType, HLSSegmentFormat, HealthStatus, InsightsStatus, InvalidRequestError, InvoiceLineType, InvoiceStatus, JobCostLineType, JobPriority, JobStatus, MAX_PARTS, MAX_UPLOAD_SIZE_BYTES, MIN_PART_SIZE, MembershipRole, MembershipStatus, NotFoundError, OrganizationStatus, OriginPermission, OriginProvider, OriginStatus, OutputFormat, OutputStatus, Page, PaymentMethodState, PermissionError, PreconditionError, QualityTier, R2Jurisdiction, RateLimitError, Resolution, SDK_VERSION, SIGNATURE_HEADER, StorageEventSource, StorageEventStatus, SubtitleFormat, SubtitleOperation, ThumbnailFormat, ThumbnailMode, ToneMapping, Transcodely, TranscodelyError, TranscriptFormat, TranscriptStyle, TrustTier, UploadAbortedError, UploadError, Uploads, UserApprovalStatus, UserStatus, VideoCodec, VideoStatus, VideoVisibility, WEBHOOK_EVENT_TYPES, WatchEventType, WatermarkAnchor, WebhookError, WebhookPayloadError, WebhookSignatureError, WebhookTimestampError, Webhooks, calculatePartSize, calculateTotalParts, constructEvent, contentTypeForFilename, isEventType, isKnownEvent, toWireJson, verifySignature };
25535
+ export { APIConnectionError, APIError, API_VERSION, AppStatus, AudioCodec, AuthenticationError, BillingStanding, BillingTreatment, BitrateMode, ConflictError, Container, ContentAwareMode, ContentType, DEFAULT_BASE_URL, DEFAULT_CONCURRENCY, DEFAULT_MAX_RETRIES, DEFAULT_PART_SIZE, DEFAULT_RETRY_BASE_DELAY_MS, DEFAULT_TOLERANCE_SECONDS, DRMSystem, DeliveryFormat, DunningStage, EVENT_ID_HEADER, EncryptionScheme, ExposureThresholdSource, GOPAlignmentMode, HDRFormat, HDRMode, HLSPlaylistType, HLSSegmentFormat, HealthStatus, InsightsSource, InsightsStatus, InvalidRequestError, InvoiceLineType, InvoiceStatus, JobCostLineType, JobPriority, JobStatus, MAX_PARTS, MAX_UPLOAD_SIZE_BYTES, MIN_PART_SIZE, MembershipRole, MembershipStatus, NotFoundError, OrganizationStatus, OriginPermission, OriginProvider, OriginStatus, OutputFormat, OutputStatus, Page, PaymentMethodState, PermissionError, PreconditionError, QualityTier, R2Jurisdiction, RateLimitError, Resolution, SDK_VERSION, SIGNATURE_HEADER, StorageEventSource, StorageEventStatus, SubtitleFormat, SubtitleOperation, ThumbnailFormat, ThumbnailMode, ToneMapping, Transcodely, TranscodelyError, TranscriptFormat, TranscriptStyle, TrustTier, UploadAbortedError, UploadError, Uploads, UserApprovalStatus, UserStatus, VideoCodec, VideoStatus, VideoVisibility, WEBHOOK_EVENT_TYPES, WatchEventType, WatermarkAnchor, WebhookError, WebhookPayloadError, WebhookSignatureError, WebhookTimestampError, Webhooks, calculatePartSize, calculateTotalParts, constructEvent, contentTypeForFilename, isEventType, isKnownEvent, toWireJson, verifySignature };
25318
25536
  //# sourceMappingURL=index.mjs.map
25319
25537
  //# sourceMappingURL=index.mjs.map