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