@transcodely/sdk 0.3.5 → 0.3.6

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
@@ -147,6 +147,21 @@ proto3.util.setEnumType(BitrateMode, "transcodely.v1.BitrateMode", [
147
147
  { no: 2, name: "BITRATE_MODE_CBR" },
148
148
  { no: 3, name: "BITRATE_MODE_VBR" }
149
149
  ]);
150
+ var BillingStanding = /* @__PURE__ */ ((BillingStanding2) => {
151
+ BillingStanding2[BillingStanding2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
152
+ BillingStanding2[BillingStanding2["FREE"] = 1] = "FREE";
153
+ BillingStanding2[BillingStanding2["ACTIVE"] = 2] = "ACTIVE";
154
+ BillingStanding2[BillingStanding2["GRACE"] = 3] = "GRACE";
155
+ BillingStanding2[BillingStanding2["DELINQUENT"] = 4] = "DELINQUENT";
156
+ return BillingStanding2;
157
+ })(BillingStanding || {});
158
+ proto3.util.setEnumType(BillingStanding, "transcodely.v1.BillingStanding", [
159
+ { no: 0, name: "BILLING_STANDING_UNSPECIFIED" },
160
+ { no: 1, name: "BILLING_STANDING_FREE" },
161
+ { no: 2, name: "BILLING_STANDING_ACTIVE" },
162
+ { no: 3, name: "BILLING_STANDING_GRACE" },
163
+ { no: 4, name: "BILLING_STANDING_DELINQUENT" }
164
+ ]);
150
165
  var PaginationRequest = class _PaginationRequest extends Message {
151
166
  /**
152
167
  * Maximum number of items to return (default: 20, max: 100).
@@ -2267,6 +2282,17 @@ proto3.util.setEnumType(InvoiceLineType, "transcodely.v1.InvoiceLineType", [
2267
2282
  { no: 3, name: "INVOICE_LINE_TYPE_MIN_CHARGE" },
2268
2283
  { no: 4, name: "INVOICE_LINE_TYPE_ADJUSTMENT" }
2269
2284
  ]);
2285
+ var PaymentMethodState = /* @__PURE__ */ ((PaymentMethodState2) => {
2286
+ PaymentMethodState2[PaymentMethodState2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
2287
+ PaymentMethodState2[PaymentMethodState2["NONE"] = 1] = "NONE";
2288
+ PaymentMethodState2[PaymentMethodState2["ON_FILE"] = 2] = "ON_FILE";
2289
+ return PaymentMethodState2;
2290
+ })(PaymentMethodState || {});
2291
+ proto3.util.setEnumType(PaymentMethodState, "transcodely.v1.PaymentMethodState", [
2292
+ { no: 0, name: "PAYMENT_METHOD_STATE_UNSPECIFIED" },
2293
+ { no: 1, name: "PAYMENT_METHOD_STATE_NONE" },
2294
+ { no: 2, name: "PAYMENT_METHOD_STATE_ON_FILE" }
2295
+ ]);
2270
2296
  var Invoice = class _Invoice extends Message {
2271
2297
  /**
2272
2298
  * Unique identifier (e.g., "inv_a1b2c3d4e5f6").
@@ -2533,6 +2559,298 @@ var InvoiceLineItem = class _InvoiceLineItem extends Message {
2533
2559
  return proto3.util.equals(_InvoiceLineItem, a, b);
2534
2560
  }
2535
2561
  };
2562
+ var BillingProfile = class _BillingProfile extends Message {
2563
+ /**
2564
+ * Object type, always "billing_profile".
2565
+ *
2566
+ * @generated from field: string object = 1;
2567
+ */
2568
+ object = "";
2569
+ /**
2570
+ * Organization this profile describes.
2571
+ *
2572
+ * @generated from field: string org_id = 2;
2573
+ */
2574
+ orgId = "";
2575
+ /**
2576
+ * Whether a payment method is on file. Determined by whether the payment
2577
+ * provider holds any payment method for this organization, and by nothing
2578
+ * else — in particular, a method missing its card details is still a
2579
+ * payment method.
2580
+ *
2581
+ * @generated from field: transcodely.v1.PaymentMethodState payment_method_state = 3;
2582
+ */
2583
+ paymentMethodState = 0 /* UNSPECIFIED */;
2584
+ /**
2585
+ * The methods the provider holds, for display only. Empty when the state is
2586
+ * "none", and never empty when the state is "on_file".
2587
+ *
2588
+ * @generated from field: repeated transcodely.v1.BillingPaymentMethod payment_methods = 4;
2589
+ */
2590
+ paymentMethods = [];
2591
+ /**
2592
+ * The organization's billing email, which the payment provider requires
2593
+ * before it will accept a payment method. Absent when unset.
2594
+ *
2595
+ * @generated from field: optional string billing_email = 5;
2596
+ */
2597
+ billingEmail;
2598
+ /**
2599
+ * The organization's derived payment health, and what its usage limits
2600
+ * resolve from. See BillingStanding.
2601
+ *
2602
+ * @generated from field: transcodely.v1.BillingStanding standing = 6;
2603
+ */
2604
+ standing = 0 /* UNSPECIFIED */;
2605
+ /**
2606
+ * When the current grace window closes. Present if and only if standing is
2607
+ * BILLING_STANDING_GRACE. At this instant the account is already past it —
2608
+ * the deadline is inclusive — and what it becomes is determined by
2609
+ * standing_reason: a card problem decays to FREE, an unpaid invoice to
2610
+ * DELINQUENT.
2611
+ *
2612
+ * @generated from field: optional google.protobuf.Timestamp grace_until = 7;
2613
+ */
2614
+ graceUntil;
2615
+ /**
2616
+ * Why standing is what it is, as a stable token to switch on rather than
2617
+ * copy to display:
2618
+ *
2619
+ * "" nothing is wrong
2620
+ * "exempt" the org is not required to hold a payment
2621
+ * method, so standing is always active
2622
+ * "no_payment_method" none has ever been on file
2623
+ * "card_expired" one is on file and its expiry has passed
2624
+ * "card_removed" one we had observed is gone
2625
+ * "invoice_past_due" an invoice failed to collect
2626
+ * "repeated_invoice_failure" a second consecutive failure, which earns no
2627
+ * grace window at all
2628
+ *
2629
+ * New tokens may be added; treat an unrecognized one as a generic billing
2630
+ * problem rather than failing.
2631
+ *
2632
+ * @generated from field: string standing_reason = 8;
2633
+ */
2634
+ standingReason = "";
2635
+ /**
2636
+ * Whether this organization must hold a payment method. FALSE means it is
2637
+ * exempt — organizations predating the requirement are, and an operator may
2638
+ * exempt one deliberately — in which case standing is always
2639
+ * BILLING_STANDING_ACTIVE and no banner or prompt about payment methods
2640
+ * should be shown.
2641
+ *
2642
+ * Exempt is not free service: the organization still accrues usage and is
2643
+ * still invoiced. It simply is not limited for lacking a card on file.
2644
+ *
2645
+ * @generated from field: bool payment_method_required = 9;
2646
+ */
2647
+ paymentMethodRequired = false;
2648
+ constructor(data) {
2649
+ super();
2650
+ proto3.util.initPartial(data, this);
2651
+ }
2652
+ static runtime = proto3;
2653
+ static typeName = "transcodely.v1.BillingProfile";
2654
+ static fields = proto3.util.newFieldList(() => [
2655
+ {
2656
+ no: 1,
2657
+ name: "object",
2658
+ kind: "scalar",
2659
+ T: 9
2660
+ /* ScalarType.STRING */
2661
+ },
2662
+ {
2663
+ no: 2,
2664
+ name: "org_id",
2665
+ kind: "scalar",
2666
+ T: 9
2667
+ /* ScalarType.STRING */
2668
+ },
2669
+ { no: 3, name: "payment_method_state", kind: "enum", T: proto3.getEnumType(PaymentMethodState) },
2670
+ { no: 4, name: "payment_methods", kind: "message", T: BillingPaymentMethod, repeated: true },
2671
+ { no: 5, name: "billing_email", kind: "scalar", T: 9, opt: true },
2672
+ { no: 6, name: "standing", kind: "enum", T: proto3.getEnumType(BillingStanding) },
2673
+ { no: 7, name: "grace_until", kind: "message", T: Timestamp, opt: true },
2674
+ {
2675
+ no: 8,
2676
+ name: "standing_reason",
2677
+ kind: "scalar",
2678
+ T: 9
2679
+ /* ScalarType.STRING */
2680
+ },
2681
+ {
2682
+ no: 9,
2683
+ name: "payment_method_required",
2684
+ kind: "scalar",
2685
+ T: 8
2686
+ /* ScalarType.BOOL */
2687
+ }
2688
+ ]);
2689
+ static fromBinary(bytes, options) {
2690
+ return new _BillingProfile().fromBinary(bytes, options);
2691
+ }
2692
+ static fromJson(jsonValue, options) {
2693
+ return new _BillingProfile().fromJson(jsonValue, options);
2694
+ }
2695
+ static fromJsonString(jsonString, options) {
2696
+ return new _BillingProfile().fromJsonString(jsonString, options);
2697
+ }
2698
+ static equals(a, b) {
2699
+ return proto3.util.equals(_BillingProfile, a, b);
2700
+ }
2701
+ };
2702
+ var BillingPaymentMethod = class _BillingPaymentMethod extends Message {
2703
+ /**
2704
+ * The payment provider's identifier for this method.
2705
+ *
2706
+ * @generated from field: string id = 1;
2707
+ */
2708
+ id = "";
2709
+ /**
2710
+ * Method family: "card", or "generic" for everything else the provider
2711
+ * supports (direct debit and similar). Always present.
2712
+ *
2713
+ * @generated from field: string type = 2;
2714
+ */
2715
+ type = "";
2716
+ /**
2717
+ * Card network, e.g. "visa" or "mastercard". Cards only, and only when the
2718
+ * provider exposes it.
2719
+ *
2720
+ * @generated from field: optional string brand = 3;
2721
+ */
2722
+ brand;
2723
+ /**
2724
+ * Last four digits of the card number. Cards only, and only when the
2725
+ * provider exposes it.
2726
+ *
2727
+ * @generated from field: optional string last4 = 4;
2728
+ */
2729
+ last4;
2730
+ /**
2731
+ * Expiry month, 1-12. Cards only, and only when the provider exposes it.
2732
+ *
2733
+ * @generated from field: optional int32 exp_month = 5;
2734
+ */
2735
+ expMonth;
2736
+ /**
2737
+ * Expiry year, four digits. Cards only, and only when the provider exposes
2738
+ * it.
2739
+ *
2740
+ * @generated from field: optional int32 exp_year = 6;
2741
+ */
2742
+ expYear;
2743
+ /**
2744
+ * Whether this is the method the provider charges by default. Advisory: the
2745
+ * provider does not always mark a default, so false here does not mean the
2746
+ * method is unused, and it is never a signal about the organization's
2747
+ * payment standing.
2748
+ *
2749
+ * @generated from field: bool is_default = 7;
2750
+ */
2751
+ isDefault = false;
2752
+ constructor(data) {
2753
+ super();
2754
+ proto3.util.initPartial(data, this);
2755
+ }
2756
+ static runtime = proto3;
2757
+ static typeName = "transcodely.v1.BillingPaymentMethod";
2758
+ static fields = proto3.util.newFieldList(() => [
2759
+ {
2760
+ no: 1,
2761
+ name: "id",
2762
+ kind: "scalar",
2763
+ T: 9
2764
+ /* ScalarType.STRING */
2765
+ },
2766
+ {
2767
+ no: 2,
2768
+ name: "type",
2769
+ kind: "scalar",
2770
+ T: 9
2771
+ /* ScalarType.STRING */
2772
+ },
2773
+ { no: 3, name: "brand", kind: "scalar", T: 9, opt: true },
2774
+ { no: 4, name: "last4", kind: "scalar", T: 9, opt: true },
2775
+ { no: 5, name: "exp_month", kind: "scalar", T: 5, opt: true },
2776
+ { no: 6, name: "exp_year", kind: "scalar", T: 5, opt: true },
2777
+ {
2778
+ no: 7,
2779
+ name: "is_default",
2780
+ kind: "scalar",
2781
+ T: 8
2782
+ /* ScalarType.BOOL */
2783
+ }
2784
+ ]);
2785
+ static fromBinary(bytes, options) {
2786
+ return new _BillingPaymentMethod().fromBinary(bytes, options);
2787
+ }
2788
+ static fromJson(jsonValue, options) {
2789
+ return new _BillingPaymentMethod().fromJson(jsonValue, options);
2790
+ }
2791
+ static fromJsonString(jsonString, options) {
2792
+ return new _BillingPaymentMethod().fromJsonString(jsonString, options);
2793
+ }
2794
+ static equals(a, b) {
2795
+ return proto3.util.equals(_BillingPaymentMethod, a, b);
2796
+ }
2797
+ };
2798
+ var BillingPortalSession = class _BillingPortalSession extends Message {
2799
+ /**
2800
+ * Object type, always "billing_portal_session".
2801
+ *
2802
+ * @generated from field: string object = 1;
2803
+ */
2804
+ object = "";
2805
+ /**
2806
+ * Where to send the browser. Single-use and short-lived; request a new
2807
+ * session rather than storing this.
2808
+ *
2809
+ * @generated from field: string url = 2;
2810
+ */
2811
+ url = "";
2812
+ /**
2813
+ * When the session stops working.
2814
+ *
2815
+ * @generated from field: google.protobuf.Timestamp expires_at = 3;
2816
+ */
2817
+ expiresAt;
2818
+ constructor(data) {
2819
+ super();
2820
+ proto3.util.initPartial(data, this);
2821
+ }
2822
+ static runtime = proto3;
2823
+ static typeName = "transcodely.v1.BillingPortalSession";
2824
+ static fields = proto3.util.newFieldList(() => [
2825
+ {
2826
+ no: 1,
2827
+ name: "object",
2828
+ kind: "scalar",
2829
+ T: 9
2830
+ /* ScalarType.STRING */
2831
+ },
2832
+ {
2833
+ no: 2,
2834
+ name: "url",
2835
+ kind: "scalar",
2836
+ T: 9
2837
+ /* ScalarType.STRING */
2838
+ },
2839
+ { no: 3, name: "expires_at", kind: "message", T: Timestamp }
2840
+ ]);
2841
+ static fromBinary(bytes, options) {
2842
+ return new _BillingPortalSession().fromBinary(bytes, options);
2843
+ }
2844
+ static fromJson(jsonValue, options) {
2845
+ return new _BillingPortalSession().fromJson(jsonValue, options);
2846
+ }
2847
+ static fromJsonString(jsonString, options) {
2848
+ return new _BillingPortalSession().fromJsonString(jsonString, options);
2849
+ }
2850
+ static equals(a, b) {
2851
+ return proto3.util.equals(_BillingPortalSession, a, b);
2852
+ }
2853
+ };
2536
2854
  var ListInvoicesRequest = class _ListInvoicesRequest extends Message {
2537
2855
  /**
2538
2856
  * Pagination parameters.
@@ -2714,6 +3032,106 @@ var GetUpcomingInvoiceResponse = class _GetUpcomingInvoiceResponse extends Messa
2714
3032
  return proto3.util.equals(_GetUpcomingInvoiceResponse, a, b);
2715
3033
  }
2716
3034
  };
3035
+ var GetBillingProfileRequest = class _GetBillingProfileRequest extends Message {
3036
+ constructor(data) {
3037
+ super();
3038
+ proto3.util.initPartial(data, this);
3039
+ }
3040
+ static runtime = proto3;
3041
+ static typeName = "transcodely.v1.GetBillingProfileRequest";
3042
+ static fields = proto3.util.newFieldList(() => []);
3043
+ static fromBinary(bytes, options) {
3044
+ return new _GetBillingProfileRequest().fromBinary(bytes, options);
3045
+ }
3046
+ static fromJson(jsonValue, options) {
3047
+ return new _GetBillingProfileRequest().fromJson(jsonValue, options);
3048
+ }
3049
+ static fromJsonString(jsonString, options) {
3050
+ return new _GetBillingProfileRequest().fromJsonString(jsonString, options);
3051
+ }
3052
+ static equals(a, b) {
3053
+ return proto3.util.equals(_GetBillingProfileRequest, a, b);
3054
+ }
3055
+ };
3056
+ var GetBillingProfileResponse = class _GetBillingProfileResponse extends Message {
3057
+ /**
3058
+ * The organization's payment standing, read live from the payment provider.
3059
+ *
3060
+ * @generated from field: transcodely.v1.BillingProfile profile = 1;
3061
+ */
3062
+ profile;
3063
+ constructor(data) {
3064
+ super();
3065
+ proto3.util.initPartial(data, this);
3066
+ }
3067
+ static runtime = proto3;
3068
+ static typeName = "transcodely.v1.GetBillingProfileResponse";
3069
+ static fields = proto3.util.newFieldList(() => [
3070
+ { no: 1, name: "profile", kind: "message", T: BillingProfile }
3071
+ ]);
3072
+ static fromBinary(bytes, options) {
3073
+ return new _GetBillingProfileResponse().fromBinary(bytes, options);
3074
+ }
3075
+ static fromJson(jsonValue, options) {
3076
+ return new _GetBillingProfileResponse().fromJson(jsonValue, options);
3077
+ }
3078
+ static fromJsonString(jsonString, options) {
3079
+ return new _GetBillingProfileResponse().fromJsonString(jsonString, options);
3080
+ }
3081
+ static equals(a, b) {
3082
+ return proto3.util.equals(_GetBillingProfileResponse, a, b);
3083
+ }
3084
+ };
3085
+ var CreateBillingPortalSessionRequest = class _CreateBillingPortalSessionRequest extends Message {
3086
+ constructor(data) {
3087
+ super();
3088
+ proto3.util.initPartial(data, this);
3089
+ }
3090
+ static runtime = proto3;
3091
+ static typeName = "transcodely.v1.CreateBillingPortalSessionRequest";
3092
+ static fields = proto3.util.newFieldList(() => []);
3093
+ static fromBinary(bytes, options) {
3094
+ return new _CreateBillingPortalSessionRequest().fromBinary(bytes, options);
3095
+ }
3096
+ static fromJson(jsonValue, options) {
3097
+ return new _CreateBillingPortalSessionRequest().fromJson(jsonValue, options);
3098
+ }
3099
+ static fromJsonString(jsonString, options) {
3100
+ return new _CreateBillingPortalSessionRequest().fromJsonString(jsonString, options);
3101
+ }
3102
+ static equals(a, b) {
3103
+ return proto3.util.equals(_CreateBillingPortalSessionRequest, a, b);
3104
+ }
3105
+ };
3106
+ var CreateBillingPortalSessionResponse = class _CreateBillingPortalSessionResponse extends Message {
3107
+ /**
3108
+ * The session. Redirect the browser to its url.
3109
+ *
3110
+ * @generated from field: transcodely.v1.BillingPortalSession session = 1;
3111
+ */
3112
+ session;
3113
+ constructor(data) {
3114
+ super();
3115
+ proto3.util.initPartial(data, this);
3116
+ }
3117
+ static runtime = proto3;
3118
+ static typeName = "transcodely.v1.CreateBillingPortalSessionResponse";
3119
+ static fields = proto3.util.newFieldList(() => [
3120
+ { no: 1, name: "session", kind: "message", T: BillingPortalSession }
3121
+ ]);
3122
+ static fromBinary(bytes, options) {
3123
+ return new _CreateBillingPortalSessionResponse().fromBinary(bytes, options);
3124
+ }
3125
+ static fromJson(jsonValue, options) {
3126
+ return new _CreateBillingPortalSessionResponse().fromJson(jsonValue, options);
3127
+ }
3128
+ static fromJsonString(jsonString, options) {
3129
+ return new _CreateBillingPortalSessionResponse().fromJsonString(jsonString, options);
3130
+ }
3131
+ static equals(a, b) {
3132
+ return proto3.util.equals(_CreateBillingPortalSessionResponse, a, b);
3133
+ }
3134
+ };
2717
3135
  var BillingService = {
2718
3136
  typeName: "transcodely.v1.BillingService",
2719
3137
  methods: {
@@ -2759,6 +3177,40 @@ var BillingService = {
2759
3177
  I: GetUpcomingInvoiceRequest,
2760
3178
  O: GetUpcomingInvoiceResponse,
2761
3179
  kind: MethodKind.Unary
3180
+ },
3181
+ /**
3182
+ * Retrieve the organization's billing profile: whether a payment method is
3183
+ * on file, and the card details the payment provider exposes for display.
3184
+ *
3185
+ * Read-only and side-effect free: it never creates provider resources. An
3186
+ * organization that has never touched billing gets payment_method_state
3187
+ * "none" and an empty payment_methods list.
3188
+ *
3189
+ * @generated from rpc transcodely.v1.BillingService.GetBillingProfile
3190
+ */
3191
+ getBillingProfile: {
3192
+ name: "GetBillingProfile",
3193
+ I: GetBillingProfileRequest,
3194
+ O: GetBillingProfileResponse,
3195
+ kind: MethodKind.Unary
3196
+ },
3197
+ /**
3198
+ * Create a short-lived session for the payment provider's hosted billing
3199
+ * portal and return its URL. The portal is where a payment method is added
3200
+ * or replaced and where receipts live; card details never touch the
3201
+ * Transcodely API.
3202
+ *
3203
+ * First call for an organization also links it to the payment provider
3204
+ * (customer + subscription), so the returned portal is already attached to
3205
+ * this organization's billing account. Safe to call repeatedly.
3206
+ *
3207
+ * @generated from rpc transcodely.v1.BillingService.CreateBillingPortalSession
3208
+ */
3209
+ createBillingPortalSession: {
3210
+ name: "CreateBillingPortalSession",
3211
+ I: CreateBillingPortalSessionRequest,
3212
+ O: CreateBillingPortalSessionResponse,
3213
+ kind: MethodKind.Unary
2762
3214
  }
2763
3215
  }
2764
3216
  };
@@ -2822,6 +3274,49 @@ var Billing = class {
2822
3274
  );
2823
3275
  return res.invoice;
2824
3276
  }
3277
+ /**
3278
+ * Retrieve the organization's payment standing: whether the payment provider
3279
+ * holds a chargeable method, and what it will say about it for display.
3280
+ *
3281
+ * Read-only and side-effect free — it never creates provider resources. An
3282
+ * organization that has never touched billing reports
3283
+ * `PaymentMethodState.NONE` and no payment methods.
3284
+ *
3285
+ * `paymentMethodState` is the only reliable signal. A method's `brand` and
3286
+ * `last4` are frequently absent even for a working card, because the provider
3287
+ * does not always expose card metadata; render such a method as "Card on
3288
+ * file" rather than treating the missing digits as an error.
3289
+ */
3290
+ async retrieveProfile(opts) {
3291
+ const res = await this.transport.unary(
3292
+ BillingService,
3293
+ BillingService.methods.getBillingProfile,
3294
+ new GetBillingProfileRequest({}),
3295
+ opts
3296
+ );
3297
+ return res.profile;
3298
+ }
3299
+ /**
3300
+ * Create a short-lived session for the payment provider's hosted billing
3301
+ * portal and return it. The portal is where a payment method is added or
3302
+ * replaced and where receipts live — card details never touch this SDK.
3303
+ *
3304
+ * The first call for an organization also links it to the payment provider,
3305
+ * so the returned portal is already attached to this organization's billing
3306
+ * account. Safe to call repeatedly.
3307
+ *
3308
+ * The session is single-use and expires; request a fresh one per visit rather
3309
+ * than storing the URL.
3310
+ */
3311
+ async createPortalSession(opts) {
3312
+ const res = await this.transport.unary(
3313
+ BillingService,
3314
+ BillingService.methods.createBillingPortalSession,
3315
+ new CreateBillingPortalSessionRequest({}),
3316
+ opts
3317
+ );
3318
+ return res.session;
3319
+ }
2825
3320
  };
2826
3321
  var WebhookEndpoint = class _WebhookEndpoint extends Message {
2827
3322
  /**
@@ -10517,17 +11012,26 @@ var Job = class _Job extends Message {
10517
11012
  *
10518
11013
  * Only completed outputs are billable, and what happened to the job as a
10519
11014
  * whole decides whether they are billed at all:
10520
- * - completed: the sum of its outputs' actual costs, raised to
10521
- * minimum_charge_eur if that minimum is in effect.
10522
- * - canceled: the sum of the outputs that had already completed and been
10523
- * delivered when the cancel landed. Identical whether the job was
10524
- * canceled through CancelJob or observed as canceled by the worker. The
10525
- * minimum charge never applies.
10526
- * - failed: zero. A job that ends failed is not billed, even if some of
10527
- * its outputs completed before the failure.
10528
- * - partial: the sum of the outputs that completed, un-floored.
10529
- * Additive fees (see fees) are included on top, and are charged only on jobs
10530
- * that ended completed or partial.
11015
+ * - completed: the sum of its outputs' actual costs, plus the fees below.
11016
+ * - partial: the sum of the outputs that completed, plus the fees below.
11017
+ * - canceled: the processing fee, if an encoder had already begun work,
11018
+ * plus the outputs that had already completed and been delivered when
11019
+ * the cancel landed. Canceling a job that was still queued bills
11020
+ * nothing. Identical whether the job was canceled through CancelJob or
11021
+ * observed as canceled by the worker.
11022
+ * - failed: zero. A job that ends failed is not billed at all — not for
11023
+ * outputs that completed before the failure, and not for the machine it
11024
+ * ran on.
11025
+ *
11026
+ * Fees (see fees) are included on top of the output costs. Which ones are
11027
+ * charged depends on the fee: the flat processing fee is charged on every
11028
+ * job an encoder began, including a canceled one, while a metered add-on
11029
+ * such as AI captions is charged only when a completed or partial job
11030
+ * actually delivered its artifact.
11031
+ *
11032
+ * Jobs created before the processing-fee model (August 2026) are billed
11033
+ * max(sum of output costs, minimum_charge_eur) + fees when completed, and
11034
+ * their canceled/partial totals are un-floored.
10531
11035
  *
10532
11036
  * @generated from field: optional double total_actual_cost = 9;
10533
11037
  */
@@ -10664,44 +11168,62 @@ var Job = class _Job extends Message {
10664
11168
  */
10665
11169
  object = "";
10666
11170
  /**
10667
- * Minimum charge for this job in EUR, locked at creation and never changed
10668
- * retroactively. It is derived from the job's assigned billing class — a size
10669
- * band (small/medium/large/extra-large) reflecting the compute the job is
10670
- * guaranteed to cover — or, in legacy configurations, from the recommended
10671
- * machine size; either way it is a stable quote, not re-derived from the
10672
- * machine the job ultimately runs on. When the minimum charge is in effect,
10673
- * the billed total for a successfully completed job is
10674
- * max(sum of output costs, minimum_charge_eur) — see minimum_charge_applied
10675
- * for whether it determined this job's total. The minimum applies only to
10676
- * jobs that reach completed: a failed job is billed zero, and a canceled or
10677
- * partial job is billed the un-floored sum of the outputs it did complete.
10678
- * Absent when no minimum was computed for this job.
10679
- *
10680
- * @generated from field: optional double minimum_charge_eur = 30;
11171
+ * HISTORICAL — jobs created before the processing-fee model (August 2026)
11172
+ * only. Always absent on jobs created since; use fees (fee_type
11173
+ * "processing") instead.
11174
+ *
11175
+ * The per-job minimum charge, locked at creation and never changed
11176
+ * retroactively. It was derived from the job's assigned billing class — a
11177
+ * size band (small/medium/large/extra-large) reflecting the compute the job
11178
+ * is guaranteed to cover — or, in earlier configurations, from the
11179
+ * recommended machine size; either way a stable quote, not re-derived from
11180
+ * the machine the job ultimately ran on. When in effect, the billed total for
11181
+ * a successfully completed job was max(sum of output costs,
11182
+ * minimum_charge_eur) — see minimum_charge_applied for whether it determined
11183
+ * this job's total. It applied only to jobs that reached completed: a failed
11184
+ * job was billed zero, and a canceled or partial job the un-floored sum of
11185
+ * the outputs it did complete.
11186
+ *
11187
+ * Jobs quoted under this model keep settling under it, so the field is
11188
+ * populated forever on those jobs and is never removed from the API.
11189
+ *
11190
+ * @generated from field: optional double minimum_charge_eur = 30 [deprecated = true];
11191
+ * @deprecated
10681
11192
  */
10682
11193
  minimumChargeEur;
10683
11194
  /**
11195
+ * HISTORICAL — jobs created before the processing-fee model (August 2026)
11196
+ * only. Always false on jobs created since.
11197
+ *
10684
11198
  * Whether minimum_charge_eur determined the job's most recently computed
10685
11199
  * total — true when the sum of output costs came in below the minimum and
10686
11200
  * the total was raised to it (estimated total after probe; actual total
10687
11201
  * after successful completion). When true, total_estimated_cost or
10688
11202
  * total_actual_cost exceeds the sum of the per-output cost fields, which
10689
- * are never raised themselves. The minimum is a stable quote locked at
10690
- * creation (from the job's billing class, or the recommended machine size in
10691
- * legacy configurations); it is never re-derived from the machine the job
10692
- * ultimately runs on.
11203
+ * were never raised themselves.
10693
11204
  *
10694
- * @generated from field: bool minimum_charge_applied = 31;
11205
+ * @generated from field: bool minimum_charge_applied = 31 [deprecated = true];
11206
+ * @deprecated
10695
11207
  */
10696
11208
  minimumChargeApplied = false;
10697
11209
  /**
10698
- * Additive fee line items (v1: AI caption generation). Fees are charged ON
10699
- * TOP of the encode bill and sit OUTSIDE the minimum-charge floor:
10700
- * billed total = max(sum of output costs, minimum_charge_eur) + sum of fees.
11210
+ * Fee line items on the job. Two kinds appear here:
11211
+ *
11212
+ * "processing" — the flat per-job processing fee, charged once for the
11213
+ * encoder the job ran on, scaled by the job's size class. Present on every
11214
+ * job an encoder began processing. Quantity is always 1.
11215
+ * "captions" — AI caption generation, metered per source minute.
11216
+ *
11217
+ * Fees are charged ON TOP of the encode bill:
11218
+ * billed total = sum of output costs + sum of fees. (On historical jobs that
11219
+ * carry a minimum_charge_eur, the output sum is raised to that floor first;
11220
+ * fees have always sat outside the clamp.)
11221
+ *
10701
11222
  * total_estimated_cost / total_actual_cost INCLUDE fees; this list exposes
10702
- * the decomposition. Only live fees are listed — a fee that was voided
10703
- * (job failed/canceled, or the artifact was never produced) is dropped
10704
- * from the list and never charged. Server-set; read-only.
11223
+ * the decomposition. Only live fees are listed — a fee that was voided is
11224
+ * dropped from the list and never charged. A job that failed, or that was
11225
+ * canceled while still queued, therefore reports no fees at all.
11226
+ * Server-set; read-only.
10705
11227
  *
10706
11228
  * @generated from field: repeated transcodely.v1.JobFee fees = 33;
10707
11229
  */
@@ -10740,10 +11262,10 @@ var Job = class _Job extends Message {
10740
11262
  videoId;
10741
11263
  /**
10742
11264
  * Itemized decomposition of total_estimated_cost and total_actual_cost:
10743
- * one line per output, one per fee, and the minimum-charge top-up when the
10744
- * per-job minimum raised a total. The lines always sum to the totals, so
10745
- * this is the field to render a cost from — the per-output cost fields
10746
- * alone do not add up to the bill whenever the minimum charge is in effect.
11265
+ * one line per output, one per fee, and — on jobs old enough to have a
11266
+ * minimum charge — the top-up it added. The lines always sum to the totals,
11267
+ * so this is the field to render a cost from: the per-output cost fields
11268
+ * alone do not add up to the bill, because fees are charged on top of them.
10747
11269
  * Always present. Server-set; read-only.
10748
11270
  *
10749
11271
  * @generated from field: transcodely.v1.JobCostBreakdown cost_breakdown = 38;
@@ -10868,40 +11390,47 @@ var Job = class _Job extends Message {
10868
11390
  };
10869
11391
  var JobFee = class _JobFee extends Message {
10870
11392
  /**
10871
- * Fee discriminator — the fee pricing rule's key. v1: "captions".
11393
+ * Fee discriminator:
11394
+ * "processing" — the flat per-job processing fee (see Job.fees).
11395
+ * "captions" — AI caption generation.
10872
11396
  *
10873
11397
  * @generated from field: string fee_type = 1;
10874
11398
  */
10875
11399
  feeType = "";
10876
11400
  /**
10877
11401
  * Human-readable description of what the fee is for
10878
- * (e.g., "AI Caption Generation").
11402
+ * (e.g., "Processing fee", "AI Caption Generation").
10879
11403
  *
10880
11404
  * @generated from field: string description = 2;
10881
11405
  */
10882
11406
  description = "";
10883
11407
  /**
10884
- * Metering unit. v1: "source_minute" (input duration in minutes).
11408
+ * Metering unit:
11409
+ * "job" — a flat per-job charge; quantity is always 1.
11410
+ * "source_minute" — input duration in minutes.
10885
11411
  *
10886
11412
  * @generated from field: string unit = 3;
10887
11413
  */
10888
11414
  unit = "";
10889
11415
  /**
10890
11416
  * Metered quantity in `unit`s — the exact fraction, e.g. a 90-second
10891
- * source is 1.5 source minutes. 0 until the input probe completes.
11417
+ * source is 1.5 source minutes. For a "source_minute" fee this is 0 until
11418
+ * the input probe completes; a "job" fee is always 1, from creation.
10892
11419
  *
10893
11420
  * @generated from field: double quantity = 4;
10894
11421
  */
10895
11422
  quantity = 0;
10896
11423
  /**
10897
- * Price per unit in `currency`, locked at job creation from the
10898
- * then-effective fee pricing rule (e.g., 0.05).
11424
+ * Price per unit in `currency`, locked at job creation (e.g., 0.05). For the
11425
+ * processing fee this is the job's size class's rate at the moment the job
11426
+ * was created; later rate changes never re-price an existing job.
10899
11427
  *
10900
11428
  * @generated from field: double rate = 5;
10901
11429
  */
10902
11430
  rate = 0;
10903
11431
  /**
10904
- * quantity x rate, in `currency`. 0 until the input probe completes.
11432
+ * quantity x rate, in `currency`. For a "source_minute" fee this is 0 until
11433
+ * the input probe completes; for a "job" fee it equals rate from creation.
10905
11434
  *
10906
11435
  * @generated from field: double amount = 6;
10907
11436
  */
@@ -14986,7 +15515,7 @@ function backoff(attempt) {
14986
15515
  }
14987
15516
 
14988
15517
  // src/version.ts
14989
- var SDK_VERSION = "0.3.5";
15518
+ var SDK_VERSION = "0.3.6";
14990
15519
  var API_VERSION = "2026-05-03";
14991
15520
  var DEFAULT_BASE_URL = "https://api.transcodely.com";
14992
15521
 
@@ -15769,6 +16298,78 @@ var Organization = class _Organization extends Message {
15769
16298
  * @generated from field: google.protobuf.Timestamp updated_at = 8;
15770
16299
  */
15771
16300
  updatedAt;
16301
+ /**
16302
+ * Plan assigned to the organization, applying to every app under it that has
16303
+ * no plan of its own. Absent when the org carries none.
16304
+ *
16305
+ * @generated from field: optional string plan_id = 9;
16306
+ */
16307
+ planId;
16308
+ /**
16309
+ * Display name of the org's plan. Absent exactly when plan_id is.
16310
+ *
16311
+ * @generated from field: optional string plan_name = 10;
16312
+ */
16313
+ planName;
16314
+ /**
16315
+ * Whether this org must have a payment method on file. NOT ENFORCED: no
16316
+ * create, dispatch or delivery path reads this today. It records intent
16317
+ * ahead of the release that starts requiring one, at which point orgs
16318
+ * already carrying false are the grandfathered population.
16319
+ *
16320
+ * @generated from field: bool payment_method_required = 11;
16321
+ */
16322
+ paymentMethodRequired = false;
16323
+ /**
16324
+ * When the org was explicitly exempted from the payment-method requirement —
16325
+ * stamped when payment_method_required is turned off, cleared when it is
16326
+ * turned on. Absent for an org that has never been exempted, which today is
16327
+ * every org. Reflects the CURRENT exemption only; the change history lives in
16328
+ * the admin audit log.
16329
+ *
16330
+ * @generated from field: optional google.protobuf.Timestamp grandfathered_at = 12;
16331
+ */
16332
+ grandfatheredAt;
16333
+ /**
16334
+ * Derived payment health. Always BILLING_STANDING_ACTIVE when
16335
+ * payment_method_required is false, whatever the facts below say.
16336
+ *
16337
+ * @generated from field: transcodely.v1.BillingStanding billing_standing = 13;
16338
+ */
16339
+ billingStanding = 0 /* UNSPECIFIED */;
16340
+ /**
16341
+ * When the current grace window closes, present only while billing_standing
16342
+ * is BILLING_STANDING_GRACE.
16343
+ *
16344
+ * @generated from field: optional google.protobuf.Timestamp grace_until = 14;
16345
+ */
16346
+ graceUntil;
16347
+ /**
16348
+ * Stable token explaining billing_standing; same vocabulary as
16349
+ * BillingProfile.standing_reason.
16350
+ *
16351
+ * @generated from field: string standing_reason = 15;
16352
+ */
16353
+ standingReason = "";
16354
+ /**
16355
+ * Whether a dunning episode is open right now — the payment provider has an
16356
+ * unpaid invoice for this org and is retrying it. TRUE together with
16357
+ * payment_method_required = false is the case that needs a human: the org is
16358
+ * exempt, so nothing will limit it, and the unpaid invoice will otherwise sit
16359
+ * there indefinitely.
16360
+ *
16361
+ * @generated from field: bool in_dunning = 16;
16362
+ */
16363
+ inDunning = false;
16364
+ /**
16365
+ * How many dunning episodes have run without a clean cycle in between. At 2 a
16366
+ * new episode gets no grace window at all. Reset only by an invoice that pays
16367
+ * while no episode is open — recovering INSIDE dunning does not earn the
16368
+ * window back.
16369
+ *
16370
+ * @generated from field: int32 consecutive_dunned_cycles = 17;
16371
+ */
16372
+ consecutiveDunnedCycles = 0;
15772
16373
  constructor(data) {
15773
16374
  super();
15774
16375
  proto3.util.initPartial(data, this);
@@ -15807,7 +16408,40 @@ var Organization = class _Organization extends Message {
15807
16408
  },
15808
16409
  { no: 6, name: "status", kind: "enum", T: proto3.getEnumType(OrganizationStatus) },
15809
16410
  { no: 7, name: "created_at", kind: "message", T: Timestamp },
15810
- { no: 8, name: "updated_at", kind: "message", T: Timestamp }
16411
+ { no: 8, name: "updated_at", kind: "message", T: Timestamp },
16412
+ { no: 9, name: "plan_id", kind: "scalar", T: 9, opt: true },
16413
+ { no: 10, name: "plan_name", kind: "scalar", T: 9, opt: true },
16414
+ {
16415
+ no: 11,
16416
+ name: "payment_method_required",
16417
+ kind: "scalar",
16418
+ T: 8
16419
+ /* ScalarType.BOOL */
16420
+ },
16421
+ { no: 12, name: "grandfathered_at", kind: "message", T: Timestamp, opt: true },
16422
+ { no: 13, name: "billing_standing", kind: "enum", T: proto3.getEnumType(BillingStanding) },
16423
+ { no: 14, name: "grace_until", kind: "message", T: Timestamp, opt: true },
16424
+ {
16425
+ no: 15,
16426
+ name: "standing_reason",
16427
+ kind: "scalar",
16428
+ T: 9
16429
+ /* ScalarType.STRING */
16430
+ },
16431
+ {
16432
+ no: 16,
16433
+ name: "in_dunning",
16434
+ kind: "scalar",
16435
+ T: 8
16436
+ /* ScalarType.BOOL */
16437
+ },
16438
+ {
16439
+ no: 17,
16440
+ name: "consecutive_dunned_cycles",
16441
+ kind: "scalar",
16442
+ T: 5
16443
+ /* ScalarType.INT32 */
16444
+ }
15811
16445
  ]);
15812
16446
  static fromBinary(bytes, options) {
15813
16447
  return new _Organization().fromBinary(bytes, options);
@@ -19618,6 +20252,6 @@ var Transcodely = class {
19618
20252
  Transcodely.API_VERSION = API_VERSION;
19619
20253
  Transcodely.SDK_VERSION = SDK_VERSION;
19620
20254
 
19621
- export { APIConnectionError, APIError, API_VERSION, AppStatus, AudioCodec, AuthenticationError, BitrateMode, ConflictError, Container, ContentAwareMode, ContentType, DEFAULT_BASE_URL, DEFAULT_TOLERANCE_SECONDS, DRMSystem, DeliveryFormat, EVENT_ID_HEADER, EncryptionScheme, GOPAlignmentMode, HDRFormat, HDRMode, HLSPlaylistType, HLSSegmentFormat, InvalidRequestError, InvoiceLineType, InvoiceStatus, JobCostLineType, JobPriority, JobStatus, MembershipRole, MembershipStatus, NotFoundError, OrganizationStatus, OriginPermission, OriginProvider, OriginStatus, OutputFormat, OutputStatus, Page, PermissionError, PreconditionError, QualityTier, R2Jurisdiction, RateLimitError, Resolution, SDK_VERSION, SIGNATURE_HEADER, SubtitleFormat, SubtitleOperation, ThumbnailFormat, ThumbnailMode, ToneMapping, Transcodely, TranscodelyError, UserApprovalStatus, UserStatus, VideoCodec, VideoStatus, VideoVisibility, WEBHOOK_EVENT_TYPES, WatchEventType, WatermarkAnchor, WebhookError, WebhookPayloadError, WebhookSignatureError, WebhookTimestampError, Webhooks, constructEvent, isEventType, isKnownEvent, verifySignature };
20255
+ export { APIConnectionError, APIError, API_VERSION, AppStatus, AudioCodec, AuthenticationError, BillingStanding, BitrateMode, ConflictError, Container, ContentAwareMode, ContentType, DEFAULT_BASE_URL, DEFAULT_TOLERANCE_SECONDS, DRMSystem, DeliveryFormat, EVENT_ID_HEADER, EncryptionScheme, GOPAlignmentMode, HDRFormat, HDRMode, HLSPlaylistType, HLSSegmentFormat, InvalidRequestError, InvoiceLineType, InvoiceStatus, JobCostLineType, JobPriority, JobStatus, MembershipRole, MembershipStatus, NotFoundError, OrganizationStatus, OriginPermission, OriginProvider, OriginStatus, OutputFormat, OutputStatus, Page, PaymentMethodState, PermissionError, PreconditionError, QualityTier, R2Jurisdiction, RateLimitError, Resolution, SDK_VERSION, SIGNATURE_HEADER, SubtitleFormat, SubtitleOperation, ThumbnailFormat, ThumbnailMode, ToneMapping, Transcodely, TranscodelyError, UserApprovalStatus, UserStatus, VideoCodec, VideoStatus, VideoVisibility, WEBHOOK_EVENT_TYPES, WatchEventType, WatermarkAnchor, WebhookError, WebhookPayloadError, WebhookSignatureError, WebhookTimestampError, Webhooks, constructEvent, isEventType, isKnownEvent, verifySignature };
19622
20256
  //# sourceMappingURL=index.mjs.map
19623
20257
  //# sourceMappingURL=index.mjs.map