schematichq 1.5.0 → 1.5.2
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.
- checksums.yaml +4 -4
- data/.fern/metadata.json +4 -4
- data/.fern/replay.lock +21 -3
- data/WASM_VERSION +1 -1
- data/lib/schematic/billing/types/create_invoice_request_body.rb +2 -0
- data/lib/schematic/client.rb +1 -1
- data/lib/schematic/credits/types/extend_credit_lease_request_body.rb +2 -0
- data/lib/schematic/entitlements/types/create_billing_linked_plan_entitlement_request_body.rb +4 -0
- data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +4 -0
- data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +4 -0
- data/lib/schematic/errors/server_error.rb +1 -1
- data/lib/schematic/features/types/check_and_reserve_flag_request_body.rb +2 -0
- data/lib/schematic/planmigrations/client.rb +8 -2
- data/lib/schematic/planmigrations/types/count_migrations_params.rb +2 -0
- data/lib/schematic/planmigrations/types/count_migrations_request.rb +3 -1
- data/lib/schematic/planmigrations/types/list_migrations_params.rb +2 -0
- data/lib/schematic/planmigrations/types/list_migrations_request.rb +3 -1
- data/lib/schematic/plans/client.rb +12 -0
- data/lib/schematic/plans/types/count_plans_params.rb +4 -0
- data/lib/schematic/plans/types/count_plans_request.rb +4 -0
- data/lib/schematic/plans/types/list_plans_params.rb +4 -0
- data/lib/schematic/plans/types/list_plans_request.rb +4 -0
- data/lib/schematic/types/billing_arrears_cadence.rb +1 -0
- data/lib/schematic/types/billing_credit_grant_reason.rb +3 -0
- data/lib/schematic/types/billing_credit_response_data.rb +2 -0
- data/lib/schematic/types/billing_plan_credit_grant_billing_mode.rb +12 -0
- data/lib/schematic/types/billing_plan_credit_grant_price_tier_response_data.rb +15 -0
- data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +12 -0
- data/lib/schematic/types/change_subscription_internal_request_body.rb +2 -0
- data/lib/schematic/types/change_subscription_request_body.rb +2 -0
- data/lib/schematic/types/company_feature_usage_export_metadata_visible_columns_item.rb +1 -0
- data/lib/schematic/types/company_plan_credit_grant_view.rb +6 -0
- data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +10 -0
- data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +4 -0
- data/lib/schematic/types/credit_event_ledger_response_data.rb +4 -0
- data/lib/schematic/types/credit_grant_price_tier_request_body.rb +13 -0
- data/lib/schematic/types/credit_transfer_reason.rb +14 -0
- data/lib/schematic/types/invoice_request_body.rb +2 -0
- data/lib/schematic/types/invoice_response_data.rb +2 -0
- data/lib/schematic/types/manage_plan_request.rb +2 -0
- data/lib/schematic/types/plan_credit_grant_view.rb +6 -0
- data/lib/schematic/types/plan_entitlement_response_data.rb +4 -0
- data/lib/schematic/types/plan_version_migration_response_data.rb +4 -0
- data/lib/schematic/types/preview_subscription_finance_response_data.rb +2 -0
- data/lib/schematic/types/rulesengine_comparable_operator.rb +18 -0
- data/lib/schematic/types/rulesengine_condition.rb +1 -1
- data/lib/schematic/types/upcoming_invoice_response_data.rb +2 -0
- data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +10 -0
- data/lib/schematic/types/usage_based_entitlement_request_body.rb +4 -0
- data/lib/schematic/version.rb +1 -1
- data/lib/schematic/wasm/rulesengine.wasm +0 -0
- data/lib/schematic.rb +6 -1
- data/reference.md +133 -7
- data/scripts/e2e-pack.sh +74 -0
- data/testapp/app.rb +11 -1
- metadata +8 -2
|
@@ -37,6 +37,10 @@ module Schematic
|
|
|
37
37
|
|
|
38
38
|
field :billing_credit_postpaid_rate_per_unit_decimal, -> { String }, optional: true, nullable: false
|
|
39
39
|
|
|
40
|
+
field :billing_mode, -> { Schematic::Types::BillingPlanCreditGrantBillingMode }, optional: false, nullable: false
|
|
41
|
+
|
|
42
|
+
field :billing_product_price_id, -> { String }, optional: true, nullable: false
|
|
43
|
+
|
|
40
44
|
field :company_credit_amount, -> { Integer }, optional: false, nullable: false
|
|
41
45
|
|
|
42
46
|
field :created_at, -> { String }, optional: false, nullable: false
|
|
@@ -71,6 +75,8 @@ module Schematic
|
|
|
71
75
|
|
|
72
76
|
field :plural_name, -> { String }, optional: true, nullable: false
|
|
73
77
|
|
|
78
|
+
field :price, -> { Schematic::Types::BillingPriceView }, optional: true, nullable: false
|
|
79
|
+
|
|
74
80
|
field :reset_cadence, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: true, nullable: false
|
|
75
81
|
|
|
76
82
|
field :reset_start, -> { Schematic::Types::BillingPlanCreditGrantResetStart }, optional: true, nullable: false
|
|
@@ -31,6 +31,10 @@ module Schematic
|
|
|
31
31
|
|
|
32
32
|
field :metric_period_month_reset, -> { Schematic::Types::MetricPeriodMonthReset }, optional: true, nullable: false
|
|
33
33
|
|
|
34
|
+
field :overage_billing_cadence, -> { Schematic::Types::BillingArrearsCadence }, optional: true, nullable: false
|
|
35
|
+
|
|
36
|
+
field :overage_invoice_anchor, -> { Schematic::Types::BillingArrearsAnchor }, optional: true, nullable: false
|
|
37
|
+
|
|
34
38
|
field :plan, -> { Schematic::Types::PlanResponseData }, optional: true, nullable: false
|
|
35
39
|
|
|
36
40
|
field :plan_id, -> { String }, optional: false, nullable: false
|
|
@@ -13,6 +13,10 @@ module Schematic
|
|
|
13
13
|
|
|
14
14
|
field :failed_companies, -> { Integer }, optional: false, nullable: false
|
|
15
15
|
|
|
16
|
+
field :feature_id, -> { String }, optional: true, nullable: false
|
|
17
|
+
|
|
18
|
+
field :feature_plan_rollout_id, -> { String }, optional: true, nullable: false
|
|
19
|
+
|
|
16
20
|
field :id, -> { String }, optional: false, nullable: false
|
|
17
21
|
|
|
18
22
|
field :next_due_at, -> { String }, optional: true, nullable: false
|
|
@@ -5,6 +5,8 @@ module Schematic
|
|
|
5
5
|
class PreviewSubscriptionFinanceResponseData < Internal::Types::Model
|
|
6
6
|
field :amount_off, -> { Integer }, optional: false, nullable: false
|
|
7
7
|
|
|
8
|
+
field :currency, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
8
10
|
field :discount_amount, -> { Integer }, optional: false, nullable: false
|
|
9
11
|
|
|
10
12
|
field :discounts, -> { Internal::Types::Array[Schematic::Types::PreviewSubscriptionDiscountResponseData] }, optional: false, nullable: false
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Types
|
|
5
|
+
module RulesengineComparableOperator
|
|
6
|
+
extend Schematic::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
EQ = "eq"
|
|
9
|
+
GT = "gt"
|
|
10
|
+
GTE = "gte"
|
|
11
|
+
IS_EMPTY = "is_empty"
|
|
12
|
+
LT = "lt"
|
|
13
|
+
LTE = "lte"
|
|
14
|
+
NOT_EMPTY = "not_empty"
|
|
15
|
+
NE = "ne"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -25,7 +25,7 @@ module Schematic
|
|
|
25
25
|
|
|
26
26
|
field :metric_value, -> { Integer }, optional: true, nullable: false
|
|
27
27
|
|
|
28
|
-
field :operator, -> { Schematic::Types::
|
|
28
|
+
field :operator, -> { Schematic::Types::RulesengineComparableOperator }, optional: false, nullable: false
|
|
29
29
|
|
|
30
30
|
field :resource_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false
|
|
31
31
|
|
|
@@ -39,6 +39,8 @@ module Schematic
|
|
|
39
39
|
|
|
40
40
|
field :subtotal, -> { Integer }, optional: false, nullable: false
|
|
41
41
|
|
|
42
|
+
field :total, -> { Integer }, optional: true, nullable: false
|
|
43
|
+
|
|
42
44
|
field :updated_at, -> { String }, optional: false, nullable: false
|
|
43
45
|
|
|
44
46
|
field :url, -> { String }, optional: true, nullable: false
|
|
@@ -29,6 +29,8 @@ module Schematic
|
|
|
29
29
|
|
|
30
30
|
field :auto_topup_threshold_percent, -> { Integer }, optional: true, nullable: false
|
|
31
31
|
|
|
32
|
+
field :billing_mode, -> { Schematic::Types::BillingPlanCreditGrantBillingMode }, optional: true, nullable: false
|
|
33
|
+
|
|
32
34
|
field :can_buy_bundles, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
33
35
|
|
|
34
36
|
field :company_credit_amount, -> { Integer }, optional: true, nullable: false
|
|
@@ -51,6 +53,8 @@ module Schematic
|
|
|
51
53
|
|
|
52
54
|
field :postpaid_rate_per_unit_decimal, -> { String }, optional: true, nullable: false
|
|
53
55
|
|
|
56
|
+
field :price_tiers, -> { Internal::Types::Array[Schematic::Types::CreditGrantPriceTierRequestBody] }, optional: true, nullable: false
|
|
57
|
+
|
|
54
58
|
field :reset_cadence, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: false, nullable: false
|
|
55
59
|
|
|
56
60
|
field :reset_start, -> { Schematic::Types::BillingPlanCreditGrantResetStart }, optional: false, nullable: false
|
|
@@ -60,6 +64,12 @@ module Schematic
|
|
|
60
64
|
field :rollover_percentage, -> { Integer }, optional: true, nullable: false
|
|
61
65
|
|
|
62
66
|
field :scaling, -> { Schematic::Types::PlanCreditGrantScaling }, optional: true, nullable: false
|
|
67
|
+
|
|
68
|
+
field :tier_mode, -> { Schematic::Types::BillingTiersMode }, optional: true, nullable: false
|
|
69
|
+
|
|
70
|
+
field :unit_price, -> { Integer }, optional: true, nullable: false
|
|
71
|
+
|
|
72
|
+
field :unit_price_decimal, -> { String }, optional: true, nullable: false
|
|
63
73
|
end
|
|
64
74
|
end
|
|
65
75
|
end
|
|
@@ -19,8 +19,12 @@ module Schematic
|
|
|
19
19
|
|
|
20
20
|
field :monthly_unit_price_decimal, -> { String }, optional: true, nullable: false
|
|
21
21
|
|
|
22
|
+
field :overage_billing_cadence, -> { Schematic::Types::BillingArrearsCadence }, optional: true, nullable: false
|
|
23
|
+
|
|
22
24
|
field :overage_billing_product_id, -> { String }, optional: true, nullable: false
|
|
23
25
|
|
|
26
|
+
field :overage_invoice_anchor, -> { Schematic::Types::BillingArrearsAnchor }, optional: true, nullable: false
|
|
27
|
+
|
|
24
28
|
field :price_behavior, -> { Schematic::Types::EntitlementPriceBehavior }, optional: true, nullable: false
|
|
25
29
|
|
|
26
30
|
field :price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
|
data/lib/schematic/version.rb
CHANGED
|
Binary file
|
data/lib/schematic.rb
CHANGED
|
@@ -157,6 +157,7 @@ require_relative "schematic/billing/types/upsert_billing_subscription_response"
|
|
|
157
157
|
require_relative "schematic/credits/types/list_billing_credits_params"
|
|
158
158
|
require_relative "schematic/types/billing_credit_burn_strategy"
|
|
159
159
|
require_relative "schematic/types/billing_credit_expiry_unit"
|
|
160
|
+
require_relative "schematic/types/billing_credit_ledger_authority"
|
|
160
161
|
require_relative "schematic/types/billing_credit_rollover_policy"
|
|
161
162
|
require_relative "schematic/types/credit_currency_price_response_data"
|
|
162
163
|
require_relative "schematic/types/billing_credit_response_data"
|
|
@@ -208,6 +209,8 @@ require_relative "schematic/credits/types/list_billing_plan_credit_grants_params
|
|
|
208
209
|
require_relative "schematic/types/billing_arrears_anchor"
|
|
209
210
|
require_relative "schematic/types/billing_arrears_cadence"
|
|
210
211
|
require_relative "schematic/types/billing_credit_auto_topup_availability"
|
|
212
|
+
require_relative "schematic/types/billing_plan_credit_grant_billing_mode"
|
|
213
|
+
require_relative "schematic/types/billing_plan_credit_grant_price_tier_response_data"
|
|
211
214
|
require_relative "schematic/types/billing_plan_credit_grant_reset_start"
|
|
212
215
|
require_relative "schematic/types/billing_plan_credit_grant_reset_type"
|
|
213
216
|
require_relative "schematic/types/plan_credit_grant_scaling"
|
|
@@ -238,6 +241,7 @@ require_relative "schematic/types/credit_event_type"
|
|
|
238
241
|
require_relative "schematic/credits/types/list_credit_event_ledger_params"
|
|
239
242
|
require_relative "schematic/types/billing_credit_ledger_response_data"
|
|
240
243
|
require_relative "schematic/types/company_ledger_response_data"
|
|
244
|
+
require_relative "schematic/types/credit_transfer_reason"
|
|
241
245
|
require_relative "schematic/types/credit_usage_reason"
|
|
242
246
|
require_relative "schematic/types/feature_ledger_response_data"
|
|
243
247
|
require_relative "schematic/types/credit_event_ledger_response_data"
|
|
@@ -304,7 +308,6 @@ require_relative "schematic/types/catalog_plan_i_ds_response_data"
|
|
|
304
308
|
require_relative "schematic/catalogs/types/get_plans_in_catalog_response"
|
|
305
309
|
require_relative "schematic/types/checkout_subscription"
|
|
306
310
|
require_relative "schematic/checkout/types/checkout_internal_response"
|
|
307
|
-
require_relative "schematic/types/billing_credit_ledger_authority"
|
|
308
311
|
require_relative "schematic/types/billing_product_record_response_data"
|
|
309
312
|
require_relative "schematic/types/credit_currency_price"
|
|
310
313
|
require_relative "schematic/types/billing_credit_view"
|
|
@@ -798,6 +801,7 @@ require_relative "schematic/types/condition_group_view"
|
|
|
798
801
|
require_relative "schematic/types/condition_response_data"
|
|
799
802
|
require_relative "schematic/types/coupon_request_body"
|
|
800
803
|
require_relative "schematic/types/credit_auto_topup_amount_type"
|
|
804
|
+
require_relative "schematic/types/credit_grant_price_tier_request_body"
|
|
801
805
|
require_relative "schematic/types/create_billing_plan_credit_grant_request_body"
|
|
802
806
|
require_relative "schematic/types/create_billing_price_tier_request_body"
|
|
803
807
|
require_relative "schematic/types/create_custom_plan_bundle_plan_request_body"
|
|
@@ -865,6 +869,7 @@ require_relative "schematic/types/rulesengine_feature_entitlement"
|
|
|
865
869
|
require_relative "schematic/types/rulesengine_rule_type"
|
|
866
870
|
require_relative "schematic/types/rulesengine_check_flag_result"
|
|
867
871
|
require_relative "schematic/types/rulesengine_company_metric"
|
|
872
|
+
require_relative "schematic/types/rulesengine_comparable_operator"
|
|
868
873
|
require_relative "schematic/types/rulesengine_condition_type"
|
|
869
874
|
require_relative "schematic/types/rulesengine_entity_type"
|
|
870
875
|
require_relative "schematic/types/rulesengine_trait_definition_comparable_type"
|
data/reference.md
CHANGED
|
@@ -2235,6 +2235,14 @@ client.billing.upsert_invoice(
|
|
|
2235
2235
|
<dl>
|
|
2236
2236
|
<dd>
|
|
2237
2237
|
|
|
2238
|
+
**total:** `Integer`
|
|
2239
|
+
|
|
2240
|
+
</dd>
|
|
2241
|
+
</dl>
|
|
2242
|
+
|
|
2243
|
+
<dl>
|
|
2244
|
+
<dd>
|
|
2245
|
+
|
|
2238
2246
|
**url:** `String`
|
|
2239
2247
|
|
|
2240
2248
|
</dd>
|
|
@@ -5975,7 +5983,7 @@ client.credits.acquire_credit_lease(
|
|
|
5975
5983
|
<dl>
|
|
5976
5984
|
<dd>
|
|
5977
5985
|
|
|
5978
|
-
**expires_at:** `String`
|
|
5986
|
+
**expires_at:** `String` — When the hold lapses if the lease is never released; defaults to five minutes from now and may be at most one hour out. The unspent hold is refunded on expiry
|
|
5979
5987
|
|
|
5980
5988
|
</dd>
|
|
5981
5989
|
</dl>
|
|
@@ -6050,7 +6058,15 @@ client.credits.extend_credit_lease(
|
|
|
6050
6058
|
<dl>
|
|
6051
6059
|
<dd>
|
|
6052
6060
|
|
|
6053
|
-
**expires_at:** `String`
|
|
6061
|
+
**expires_at:** `String` — Pushes the lease's expiry out; may be at most one hour from now. Leave unset to keep the expiry the lease already has
|
|
6062
|
+
|
|
6063
|
+
</dd>
|
|
6064
|
+
</dl>
|
|
6065
|
+
|
|
6066
|
+
<dl>
|
|
6067
|
+
<dd>
|
|
6068
|
+
|
|
6069
|
+
**idempotency_key:** `String` — A caller-chosen key for safe retries: a second request with the same key returns the lease as it stands instead of growing it again. Keys are unique per environment across every extend
|
|
6054
6070
|
|
|
6055
6071
|
</dd>
|
|
6056
6072
|
</dl>
|
|
@@ -13587,6 +13603,14 @@ client.entitlements.create_plan_entitlement(
|
|
|
13587
13603
|
<dl>
|
|
13588
13604
|
<dd>
|
|
13589
13605
|
|
|
13606
|
+
**overage_billing_cadence:** `Schematic::Types::BillingArrearsCadence` — How often overage charges are assessed and invoiced. Defaults to end_of_billing_period, where the billing provider aggregates usage over the subscription's own period and bills it at period end. Set to monthly or quarterly to have overage assessed each month or quarter and billed on its own invoice, which is the point of the setting on annual plans. A quarter charges each month's usage against that month's allowance. Only applies to overage price behavior.
|
|
13607
|
+
|
|
13608
|
+
</dd>
|
|
13609
|
+
</dl>
|
|
13610
|
+
|
|
13611
|
+
<dl>
|
|
13612
|
+
<dd>
|
|
13613
|
+
|
|
13590
13614
|
**overage_billing_product_id:** `String`
|
|
13591
13615
|
|
|
13592
13616
|
</dd>
|
|
@@ -13595,6 +13619,14 @@ client.entitlements.create_plan_entitlement(
|
|
|
13595
13619
|
<dl>
|
|
13596
13620
|
<dd>
|
|
13597
13621
|
|
|
13622
|
+
**overage_invoice_anchor:** `Schematic::Types::BillingArrearsAnchor` — Which boundary closes a monthly or quarterly overage window: the subscription's own recurrence (billing_period_start) or the calendar month (month_end). Quarterly windows run in three-month blocks from the billing period start, held to the subscription's own period, or in calendar quarters at month_end. Only applies when overage_billing_cadence is monthly or quarterly, and must match metric_period_month_reset so each window closes when the allowance resets: billing_period_start for billing_cycle, month_end for first_of_month. Defaults to the anchor that matches the reset.
|
|
13623
|
+
|
|
13624
|
+
</dd>
|
|
13625
|
+
</dl>
|
|
13626
|
+
|
|
13627
|
+
<dl>
|
|
13628
|
+
<dd>
|
|
13629
|
+
|
|
13598
13630
|
**plan_id:** `String`
|
|
13599
13631
|
|
|
13600
13632
|
</dd>
|
|
@@ -13675,7 +13707,7 @@ client.entitlements.create_plan_entitlement(
|
|
|
13675
13707
|
<dl>
|
|
13676
13708
|
<dd>
|
|
13677
13709
|
|
|
13678
|
-
**usage_quantity:** `Integer` — The committed unit quantity for this entitlement. For custom plans this is the
|
|
13710
|
+
**usage_quantity:** `Integer` — The committed unit quantity for this entitlement. For custom plans this is the minimum the company is contractually committed to: the company can buy more, and finalizing a new plan version sets the subscription quantity to the larger of this value and what the subscription already holds. For standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements.
|
|
13679
13711
|
|
|
13680
13712
|
</dd>
|
|
13681
13713
|
</dl>
|
|
@@ -13950,6 +13982,14 @@ client.entitlements.update_plan_entitlement(
|
|
|
13950
13982
|
<dl>
|
|
13951
13983
|
<dd>
|
|
13952
13984
|
|
|
13985
|
+
**overage_billing_cadence:** `Schematic::Types::BillingArrearsCadence` — How often overage charges are assessed and invoiced. Defaults to end_of_billing_period, where the billing provider aggregates usage over the subscription's own period and bills it at period end. Set to monthly or quarterly to have overage assessed each month or quarter and billed on its own invoice, which is the point of the setting on annual plans. A quarter charges each month's usage against that month's allowance. Only applies to overage price behavior.
|
|
13986
|
+
|
|
13987
|
+
</dd>
|
|
13988
|
+
</dl>
|
|
13989
|
+
|
|
13990
|
+
<dl>
|
|
13991
|
+
<dd>
|
|
13992
|
+
|
|
13953
13993
|
**overage_billing_product_id:** `String`
|
|
13954
13994
|
|
|
13955
13995
|
</dd>
|
|
@@ -13958,6 +13998,14 @@ client.entitlements.update_plan_entitlement(
|
|
|
13958
13998
|
<dl>
|
|
13959
13999
|
<dd>
|
|
13960
14000
|
|
|
14001
|
+
**overage_invoice_anchor:** `Schematic::Types::BillingArrearsAnchor` — Which boundary closes a monthly or quarterly overage window: the subscription's own recurrence (billing_period_start) or the calendar month (month_end). Quarterly windows run in three-month blocks from the billing period start, held to the subscription's own period, or in calendar quarters at month_end. Only applies when overage_billing_cadence is monthly or quarterly, and must match metric_period_month_reset so each window closes when the allowance resets: billing_period_start for billing_cycle, month_end for first_of_month. Defaults to the anchor that matches the reset.
|
|
14002
|
+
|
|
14003
|
+
</dd>
|
|
14004
|
+
</dl>
|
|
14005
|
+
|
|
14006
|
+
<dl>
|
|
14007
|
+
<dd>
|
|
14008
|
+
|
|
13961
14009
|
**price_behavior:** `Schematic::Types::EntitlementPriceBehavior`
|
|
13962
14010
|
|
|
13963
14011
|
</dd>
|
|
@@ -14022,7 +14070,7 @@ client.entitlements.update_plan_entitlement(
|
|
|
14022
14070
|
<dl>
|
|
14023
14071
|
<dd>
|
|
14024
14072
|
|
|
14025
|
-
**usage_quantity:** `Integer` — The committed unit quantity for this entitlement. For custom plans this is the
|
|
14073
|
+
**usage_quantity:** `Integer` — The committed unit quantity for this entitlement. For custom plans this is the minimum the company is contractually committed to: the company can buy more, and finalizing a new plan version sets the subscription quantity to the larger of this value and what the subscription already holds. For standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements.
|
|
14026
14074
|
|
|
14027
14075
|
</dd>
|
|
14028
14076
|
</dl>
|
|
@@ -14316,6 +14364,14 @@ client.entitlements.upsert_plan_entitlement_for_billing_product(
|
|
|
14316
14364
|
<dl>
|
|
14317
14365
|
<dd>
|
|
14318
14366
|
|
|
14367
|
+
**overage_billing_cadence:** `Schematic::Types::BillingArrearsCadence` — How often overage charges are assessed and invoiced. Defaults to end_of_billing_period, where the billing provider aggregates usage over the subscription's own period and bills it at period end. Set to monthly or quarterly to have overage assessed each month or quarter and billed on its own invoice, which is the point of the setting on annual plans. A quarter charges each month's usage against that month's allowance. Only applies to overage price behavior.
|
|
14368
|
+
|
|
14369
|
+
</dd>
|
|
14370
|
+
</dl>
|
|
14371
|
+
|
|
14372
|
+
<dl>
|
|
14373
|
+
<dd>
|
|
14374
|
+
|
|
14319
14375
|
**overage_billing_product_id:** `String`
|
|
14320
14376
|
|
|
14321
14377
|
</dd>
|
|
@@ -14324,6 +14380,14 @@ client.entitlements.upsert_plan_entitlement_for_billing_product(
|
|
|
14324
14380
|
<dl>
|
|
14325
14381
|
<dd>
|
|
14326
14382
|
|
|
14383
|
+
**overage_invoice_anchor:** `Schematic::Types::BillingArrearsAnchor` — Which boundary closes a monthly or quarterly overage window: the subscription's own recurrence (billing_period_start) or the calendar month (month_end). Quarterly windows run in three-month blocks from the billing period start, held to the subscription's own period, or in calendar quarters at month_end. Only applies when overage_billing_cadence is monthly or quarterly, and must match metric_period_month_reset so each window closes when the allowance resets: billing_period_start for billing_cycle, month_end for first_of_month. Defaults to the anchor that matches the reset.
|
|
14384
|
+
|
|
14385
|
+
</dd>
|
|
14386
|
+
</dl>
|
|
14387
|
+
|
|
14388
|
+
<dl>
|
|
14389
|
+
<dd>
|
|
14390
|
+
|
|
14327
14391
|
**plan_id:** `String`
|
|
14328
14392
|
|
|
14329
14393
|
</dd>
|
|
@@ -14404,7 +14468,7 @@ client.entitlements.upsert_plan_entitlement_for_billing_product(
|
|
|
14404
14468
|
<dl>
|
|
14405
14469
|
<dd>
|
|
14406
14470
|
|
|
14407
|
-
**usage_quantity:** `Integer` — The committed unit quantity for this entitlement. For custom plans this is the
|
|
14471
|
+
**usage_quantity:** `Integer` — The committed unit quantity for this entitlement. For custom plans this is the minimum the company is contractually committed to: the company can buy more, and finalizing a new plan version sets the subscription quantity to the larger of this value and what the subscription already holds. For standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements.
|
|
14408
14472
|
|
|
14409
14473
|
</dd>
|
|
14410
14474
|
</dl>
|
|
@@ -15358,6 +15422,8 @@ client.plans.list_plans(
|
|
|
15358
15422
|
q: "q",
|
|
15359
15423
|
scoped_to_company_id: "scoped_to_company_id",
|
|
15360
15424
|
with_entitlements: true,
|
|
15425
|
+
with_published_version: true,
|
|
15426
|
+
without_entitlement_for_include_drafts: true,
|
|
15361
15427
|
without_entitlement_for: "without_entitlement_for",
|
|
15362
15428
|
without_paid_product_id: true,
|
|
15363
15429
|
limit: 1000000,
|
|
@@ -15489,6 +15555,22 @@ client.plans.list_plans(
|
|
|
15489
15555
|
<dl>
|
|
15490
15556
|
<dd>
|
|
15491
15557
|
|
|
15558
|
+
**with_published_version:** `Internal::Types::Boolean` — Only return plans that have a published version
|
|
15559
|
+
|
|
15560
|
+
</dd>
|
|
15561
|
+
</dl>
|
|
15562
|
+
|
|
15563
|
+
<dl>
|
|
15564
|
+
<dd>
|
|
15565
|
+
|
|
15566
|
+
**without_entitlement_for_include_drafts:** `Internal::Types::Boolean` — With without_entitlement_for, also treat an entitlement on a plan's draft version as existing
|
|
15567
|
+
|
|
15568
|
+
</dd>
|
|
15569
|
+
</dl>
|
|
15570
|
+
|
|
15571
|
+
<dl>
|
|
15572
|
+
<dd>
|
|
15573
|
+
|
|
15492
15574
|
**without_entitlement_for:** `String` — Filter out plans that already have a plan entitlement for the specified feature ID
|
|
15493
15575
|
|
|
15494
15576
|
</dd>
|
|
@@ -16093,6 +16175,8 @@ client.plans.count_plans(
|
|
|
16093
16175
|
q: "q",
|
|
16094
16176
|
scoped_to_company_id: "scoped_to_company_id",
|
|
16095
16177
|
with_entitlements: true,
|
|
16178
|
+
with_published_version: true,
|
|
16179
|
+
without_entitlement_for_include_drafts: true,
|
|
16096
16180
|
without_entitlement_for: "without_entitlement_for",
|
|
16097
16181
|
without_paid_product_id: true,
|
|
16098
16182
|
limit: 1000000,
|
|
@@ -16224,6 +16308,22 @@ client.plans.count_plans(
|
|
|
16224
16308
|
<dl>
|
|
16225
16309
|
<dd>
|
|
16226
16310
|
|
|
16311
|
+
**with_published_version:** `Internal::Types::Boolean` — Only return plans that have a published version
|
|
16312
|
+
|
|
16313
|
+
</dd>
|
|
16314
|
+
</dl>
|
|
16315
|
+
|
|
16316
|
+
<dl>
|
|
16317
|
+
<dd>
|
|
16318
|
+
|
|
16319
|
+
**without_entitlement_for_include_drafts:** `Internal::Types::Boolean` — With without_entitlement_for, also treat an entitlement on a plan's draft version as existing
|
|
16320
|
+
|
|
16321
|
+
</dd>
|
|
16322
|
+
</dl>
|
|
16323
|
+
|
|
16324
|
+
<dl>
|
|
16325
|
+
<dd>
|
|
16326
|
+
|
|
16227
16327
|
**without_entitlement_for:** `String` — Filter out plans that already have a plan entitlement for the specified feature ID
|
|
16228
16328
|
|
|
16229
16329
|
</dd>
|
|
@@ -19351,7 +19451,15 @@ client.features.check_and_reserve_flag(key: "key")
|
|
|
19351
19451
|
<dl>
|
|
19352
19452
|
<dd>
|
|
19353
19453
|
|
|
19354
|
-
**
|
|
19454
|
+
**idempotency_key:** `String` — A caller-chosen key for safe retries: a second request with the same key returns the original reservation instead of taking another hold
|
|
19455
|
+
|
|
19456
|
+
</dd>
|
|
19457
|
+
</dl>
|
|
19458
|
+
|
|
19459
|
+
<dl>
|
|
19460
|
+
<dd>
|
|
19461
|
+
|
|
19462
|
+
**preflight:** `Schematic::Types::PreflightRequestBody` — Hypothetical usage to evaluate the flag against. When credit_cost names the entitlement's credit, that cost is what gets held; otherwise the hold is the entitlement's consumption rate times quantity, or, when quantity is omitted, times the usage stated here
|
|
19355
19463
|
|
|
19356
19464
|
</dd>
|
|
19357
19465
|
</dl>
|
|
@@ -19359,7 +19467,7 @@ client.features.check_and_reserve_flag(key: "key")
|
|
|
19359
19467
|
<dl>
|
|
19360
19468
|
<dd>
|
|
19361
19469
|
|
|
19362
|
-
**quantity:** `Integer` — Units of the feature the operation will consume
|
|
19470
|
+
**quantity:** `Integer` — Units of the feature the operation will consume. Sets the hold size together with the entitlement's consumption rate, and is echoed back on the reservation for the settling track event. When it is omitted the units come from preflight.event_usage.quantity, if that event subtype is the entitlement's, else from preflight.usage, else 1
|
|
19363
19471
|
|
|
19364
19472
|
</dd>
|
|
19365
19473
|
</dl>
|
|
@@ -21937,6 +22045,7 @@ client.planmigrations.count_company_migrations(
|
|
|
21937
22045
|
|
|
21938
22046
|
```ruby
|
|
21939
22047
|
client.planmigrations.list_migrations(
|
|
22048
|
+
feature_id: "feature_id",
|
|
21940
22049
|
plan_version_id: "plan_version_id",
|
|
21941
22050
|
status: "cancelled",
|
|
21942
22051
|
limit: 1000000,
|
|
@@ -21956,6 +22065,14 @@ client.planmigrations.list_migrations(
|
|
|
21956
22065
|
<dl>
|
|
21957
22066
|
<dd>
|
|
21958
22067
|
|
|
22068
|
+
**feature_id:** `String`
|
|
22069
|
+
|
|
22070
|
+
</dd>
|
|
22071
|
+
</dl>
|
|
22072
|
+
|
|
22073
|
+
<dl>
|
|
22074
|
+
<dd>
|
|
22075
|
+
|
|
21959
22076
|
**plan_version_id:** `String`
|
|
21960
22077
|
|
|
21961
22078
|
</dd>
|
|
@@ -22334,6 +22451,7 @@ client.planmigrations.retry_migration(
|
|
|
22334
22451
|
|
|
22335
22452
|
```ruby
|
|
22336
22453
|
client.planmigrations.count_migrations(
|
|
22454
|
+
feature_id: "feature_id",
|
|
22337
22455
|
plan_version_id: "plan_version_id",
|
|
22338
22456
|
status: "cancelled",
|
|
22339
22457
|
limit: 1000000,
|
|
@@ -22353,6 +22471,14 @@ client.planmigrations.count_migrations(
|
|
|
22353
22471
|
<dl>
|
|
22354
22472
|
<dd>
|
|
22355
22473
|
|
|
22474
|
+
**feature_id:** `String`
|
|
22475
|
+
|
|
22476
|
+
</dd>
|
|
22477
|
+
</dl>
|
|
22478
|
+
|
|
22479
|
+
<dl>
|
|
22480
|
+
<dd>
|
|
22481
|
+
|
|
22356
22482
|
**plan_version_id:** `String`
|
|
22357
22483
|
|
|
22358
22484
|
</dd>
|
data/scripts/e2e-pack.sh
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Builds and installs the schematichq gem from the working tree, for the SDK E2E
|
|
5
|
+
# harness running with SDK_SOURCE=pack.
|
|
6
|
+
#
|
|
7
|
+
# `local` mode loads the SDK straight from lib/ and so never exercises packaging:
|
|
8
|
+
# the gemspec file list, and the gitignored WASM binary that custom.gemspec.rb
|
|
9
|
+
# appends to it. This script builds the real gem, verifies the WASM binary is
|
|
10
|
+
# inside it, and installs it, so `ruby testapp/app.rb` resolves the installed gem
|
|
11
|
+
# the way an end user would. A gem that would be broken once published fails here
|
|
12
|
+
# instead.
|
|
13
|
+
#
|
|
14
|
+
# Usage (from anywhere):
|
|
15
|
+
# ./scripts/e2e-pack.sh
|
|
16
|
+
|
|
17
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
18
|
+
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
19
|
+
cd "$REPO_ROOT"
|
|
20
|
+
|
|
21
|
+
WASM_FILE="lib/schematic/wasm/rulesengine.wasm"
|
|
22
|
+
ARTIFACT_DIR="artifacts"
|
|
23
|
+
GEM_FILE="$ARTIFACT_DIR/schematichq-e2e.gem"
|
|
24
|
+
|
|
25
|
+
# --- WASM binary ---
|
|
26
|
+
|
|
27
|
+
if [ -f "$WASM_FILE" ]; then
|
|
28
|
+
echo "WASM binary already present at $WASM_FILE, skipping download."
|
|
29
|
+
else
|
|
30
|
+
echo "WASM binary missing at $WASM_FILE, downloading..."
|
|
31
|
+
./scripts/download-wasm.sh
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
if [ ! -f "$WASM_FILE" ]; then
|
|
35
|
+
echo "ERROR: $WASM_FILE still missing after ./scripts/download-wasm.sh"
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# --- Build ---
|
|
40
|
+
|
|
41
|
+
mkdir -p "$ARTIFACT_DIR"
|
|
42
|
+
rm -f "$GEM_FILE"
|
|
43
|
+
echo "Building gem -> $GEM_FILE"
|
|
44
|
+
gem build schematic.gemspec -o "$GEM_FILE"
|
|
45
|
+
|
|
46
|
+
# --- Verify the WASM binary made it into the gem ---
|
|
47
|
+
#
|
|
48
|
+
# It is gitignored, so it is in the gem only because custom.gemspec.rb appends it.
|
|
49
|
+
# Without it the installed gem cannot run the rules engine.
|
|
50
|
+
|
|
51
|
+
echo "Verifying $GEM_FILE contains $WASM_FILE..."
|
|
52
|
+
GEM_CONTENTS="$(tar -xOf "$GEM_FILE" data.tar.gz | tar -tzf -)"
|
|
53
|
+
|
|
54
|
+
if ! printf '%s\n' "$GEM_CONTENTS" | grep -qF "$WASM_FILE"; then
|
|
55
|
+
echo "ERROR: $GEM_FILE does not contain $WASM_FILE."
|
|
56
|
+
echo "The published gem would be unable to load the rules engine."
|
|
57
|
+
echo "Check that custom.gemspec.rb still appends the binary, and that"
|
|
58
|
+
echo "$WASM_FILE exists when 'gem build' runs."
|
|
59
|
+
echo "Gem contents:"
|
|
60
|
+
printf '%s\n' "$GEM_CONTENTS"
|
|
61
|
+
exit 1
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
echo "OK: $WASM_FILE is in the gem."
|
|
65
|
+
|
|
66
|
+
# --- Install ---
|
|
67
|
+
|
|
68
|
+
echo "Installing $GEM_FILE..."
|
|
69
|
+
gem install --local "$GEM_FILE"
|
|
70
|
+
|
|
71
|
+
echo "Installing test app dependencies..."
|
|
72
|
+
(cd testapp && bundle install)
|
|
73
|
+
|
|
74
|
+
echo "Done. Run the test app with: SDK_SOURCE=pack ruby testapp/app.rb"
|
data/testapp/app.rb
CHANGED
|
@@ -11,12 +11,18 @@
|
|
|
11
11
|
#
|
|
12
12
|
# SDK source is controlled by SDK_SOURCE env var:
|
|
13
13
|
# - "local" (default): loads from ../lib
|
|
14
|
+
# - "pack": requires the 'schematichq' gem built from this working tree and
|
|
15
|
+
# installed by ./scripts/e2e-pack.sh
|
|
14
16
|
# - "published": requires the 'schematichq' gem from RubyGems
|
|
15
17
|
#
|
|
16
18
|
# Usage:
|
|
17
19
|
# # Local build (default)
|
|
18
20
|
# ruby testapp/app.rb
|
|
19
21
|
#
|
|
22
|
+
# # Gem built from this working tree
|
|
23
|
+
# ./scripts/e2e-pack.sh
|
|
24
|
+
# SDK_SOURCE=pack ruby testapp/app.rb
|
|
25
|
+
#
|
|
20
26
|
# # Published version
|
|
21
27
|
# cd testapp && bundle install
|
|
22
28
|
# SDK_SOURCE=published ruby app.rb
|
|
@@ -28,7 +34,11 @@ require "redis"
|
|
|
28
34
|
|
|
29
35
|
# --- SDK Loading ---
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
# Only "local" (the default) loads the SDK from the working tree. "pack" and
|
|
38
|
+
# "published" must resolve the installed gem, the way an end user would.
|
|
39
|
+
sdk_source = ENV["SDK_SOURCE"].to_s
|
|
40
|
+
sdk_source = "local" if sdk_source.empty?
|
|
41
|
+
$LOAD_PATH.unshift(File.join(__dir__, "..", "lib")) if sdk_source == "local"
|
|
32
42
|
require "schematichq"
|
|
33
43
|
|
|
34
44
|
# --- Constants ---
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: schematichq
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Schematic
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: wasmtime
|
|
@@ -716,6 +716,8 @@ files:
|
|
|
716
716
|
- lib/schematic/types/billing_customer_with_subscriptions_response_data.rb
|
|
717
717
|
- lib/schematic/types/billing_linked_resource_response_data.rb
|
|
718
718
|
- lib/schematic/types/billing_meter_response_data.rb
|
|
719
|
+
- lib/schematic/types/billing_plan_credit_grant_billing_mode.rb
|
|
720
|
+
- lib/schematic/types/billing_plan_credit_grant_price_tier_response_data.rb
|
|
719
721
|
- lib/schematic/types/billing_plan_credit_grant_reset_cadence.rb
|
|
720
722
|
- lib/schematic/types/billing_plan_credit_grant_reset_start.rb
|
|
721
723
|
- lib/schematic/types/billing_plan_credit_grant_reset_type.rb
|
|
@@ -847,11 +849,13 @@ files:
|
|
|
847
849
|
- lib/schematic/types/credit_event_type.rb
|
|
848
850
|
- lib/schematic/types/credit_grant_detail.rb
|
|
849
851
|
- lib/schematic/types/credit_grant_expiry_request_body.rb
|
|
852
|
+
- lib/schematic/types/credit_grant_price_tier_request_body.rb
|
|
850
853
|
- lib/schematic/types/credit_grant_sort_order.rb
|
|
851
854
|
- lib/schematic/types/credit_lease_response_data.rb
|
|
852
855
|
- lib/schematic/types/credit_reservation_response_data.rb
|
|
853
856
|
- lib/schematic/types/credit_spend_policy_response_data.rb
|
|
854
857
|
- lib/schematic/types/credit_spend_policy_scope.rb
|
|
858
|
+
- lib/schematic/types/credit_transfer_reason.rb
|
|
855
859
|
- lib/schematic/types/credit_transfer_response_data.rb
|
|
856
860
|
- lib/schematic/types/credit_transfer_view.rb
|
|
857
861
|
- lib/schematic/types/credit_trigger_config.rb
|
|
@@ -1057,6 +1061,7 @@ files:
|
|
|
1057
1061
|
- lib/schematic/types/rulesengine_check_flag_result.rb
|
|
1058
1062
|
- lib/schematic/types/rulesengine_company.rb
|
|
1059
1063
|
- lib/schematic/types/rulesengine_company_metric.rb
|
|
1064
|
+
- lib/schematic/types/rulesengine_comparable_operator.rb
|
|
1060
1065
|
- lib/schematic/types/rulesengine_condition.rb
|
|
1061
1066
|
- lib/schematic/types/rulesengine_condition_group.rb
|
|
1062
1067
|
- lib/schematic/types/rulesengine_condition_type.rb
|
|
@@ -1175,6 +1180,7 @@ files:
|
|
|
1175
1180
|
- lib/schematichq.rb
|
|
1176
1181
|
- reference.md
|
|
1177
1182
|
- scripts/download-wasm.sh
|
|
1183
|
+
- scripts/e2e-pack.sh
|
|
1178
1184
|
- scripts/webhook_test_server.rb
|
|
1179
1185
|
- testapp/Gemfile
|
|
1180
1186
|
- testapp/app.rb
|