schematichq 1.4.8 → 1.4.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36bcd47c40d3cd4cf1406cd9c468fdb825e820ea052dd6375b06fd0fd2a28026
4
- data.tar.gz: a9469ee307dcd2f19271d563a948b33d8abafffae8efa933b80eeeaa71c3708e
3
+ metadata.gz: 5d171ff79b7e78a9a60d576805e1c8d4b679b08a69d87414759421e7b5c58db5
4
+ data.tar.gz: 1a042b9844338a76b885fcb14f19f003663f234fc64077c9ed55e57e85bf0553
5
5
  SHA512:
6
- metadata.gz: 266d456ba8ee109c9e666fd1754b4f88f2b2de54cd893a5f1341265e58dd5da8b399dcf217c56e875fed6db60cbbeee34c400a30a47afdcd4828da9644e5d582
7
- data.tar.gz: 18a408a807a8c49766a96bf2fa84633810ec06119552298e67afc991ce66d1cedb44203d75a247ae8d79c2d12c22f9d32632febff24102bc0a7808d00bbdee58
6
+ metadata.gz: 10072bf845fc063191774457072a90f0be6da68cb8e4bfdfa381481e0fa9ac3ac9cfd3cb8ed6c416fcf4f6d73a63fafcf2f7587f92f27cd147494ef9d87f8db9
7
+ data.tar.gz: dc208fa7352fede21e1fa3577bb7837a85c5968cb0a904be863636f568b73b4949a397408d40ee589d25f83d8a7bc5fb995fea2c358be2e6d296d88b72980bcf
data/.fern/metadata.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "cliVersion": "5.6.0",
2
+ "cliVersion": "5.50.0",
3
3
  "generatorName": "fernapi/fern-ruby-sdk",
4
4
  "generatorVersion": "1.1.13",
5
5
  "generatorConfig": {
@@ -13,6 +13,6 @@
13
13
  "webrick": ">= 1.0"
14
14
  }
15
15
  },
16
- "originGitCommit": "1c3370c354acf100ad68319d09b964e93635a3d5",
17
- "sdkVersion": "1.4.8"
16
+ "originGitCommit": "19cafdf92ab056ef6ba803bf1e352b0422a8ec45",
17
+ "sdkVersion": "1.4.9"
18
18
  }
data/.fern/replay.lock CHANGED
@@ -30,5 +30,11 @@ generations:
30
30
  cli_version: unknown
31
31
  generator_versions:
32
32
  fernapi/fern-ruby-sdk: 1.1.13
33
- current_generation: 8487841eae05855059210650ab3ee913538f1afc
33
+ - commit_sha: c93862aca1a52c6c033c908ebab873ca9ef6e401
34
+ tree_hash: 8af2113b2953c214b34eb7360fb741106399623c
35
+ timestamp: 2026-07-14T14:45:31.832Z
36
+ cli_version: unknown
37
+ generator_versions:
38
+ fernapi/fern-ruby-sdk: 1.1.13
39
+ current_generation: c93862aca1a52c6c033c908ebab873ca9ef6e401
34
40
  patches: []
data/WASM_VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.5.0
@@ -11,8 +11,10 @@ module Schematic
11
11
  field :currency, -> { String }, optional: false, nullable: false
12
12
  field :customer_external_id, -> { String }, optional: false, nullable: false
13
13
  field :due_date, -> { String }, optional: true, nullable: false
14
+ field :ending_balance, -> { Integer }, optional: true, nullable: false
14
15
  field :external_id, -> { String }, optional: true, nullable: false
15
16
  field :payment_method_external_id, -> { String }, optional: true, nullable: false
17
+ field :starting_balance, -> { Integer }, optional: true, nullable: false
16
18
  field :status, -> { Schematic::Types::InvoiceStatus }, optional: true, nullable: false
17
19
  field :subscription_external_id, -> { String }, optional: true, nullable: false
18
20
  field :subtotal, -> { Integer }, optional: false, nullable: false
@@ -10,7 +10,7 @@ module Schematic
10
10
  @raw_client = Schematic::Internal::Http::RawClient.new(
11
11
  base_url: base_url || Schematic::Environment::DEFAULT,
12
12
  headers: {
13
- "User-Agent" => "schematichq/1.4.8",
13
+ "User-Agent" => "schematichq/1.4.9",
14
14
  "X-Fern-Language" => "Ruby",
15
15
  "X-Schematic-Api-Key" => api_key.to_s
16
16
  }
@@ -35,6 +35,7 @@ module Schematic
35
35
  field :value_numeric, -> { Integer }, optional: true, nullable: false
36
36
  field :value_trait_id, -> { String }, optional: true, nullable: false
37
37
  field :value_type, -> { Schematic::Types::EntitlementValueType }, optional: false, nullable: false
38
+ field :warning_tiers, -> { Internal::Types::Array[Schematic::Types::WarningTierRequestBody] }, optional: true, nullable: false
38
39
  field :yearly_metered_price_id, -> { String }, optional: true, nullable: false
39
40
  field :yearly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
40
41
  field :yearly_unit_price, -> { Integer }, optional: true, nullable: false
@@ -33,6 +33,7 @@ module Schematic
33
33
  field :value_numeric, -> { Integer }, optional: true, nullable: false
34
34
  field :value_trait_id, -> { String }, optional: true, nullable: false
35
35
  field :value_type, -> { Schematic::Types::EntitlementValueType }, optional: false, nullable: false
36
+ field :warning_tiers, -> { Internal::Types::Array[Schematic::Types::WarningTierRequestBody] }, optional: true, nullable: false
36
37
  field :yearly_metered_price_id, -> { String }, optional: true, nullable: false
37
38
  field :yearly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
38
39
  field :yearly_unit_price, -> { Integer }, optional: true, nullable: false
@@ -31,6 +31,7 @@ module Schematic
31
31
  field :value_numeric, -> { Integer }, optional: true, nullable: false
32
32
  field :value_trait_id, -> { String }, optional: true, nullable: false
33
33
  field :value_type, -> { Schematic::Types::EntitlementValueType }, optional: false, nullable: false
34
+ field :warning_tiers, -> { Internal::Types::Array[Schematic::Types::WarningTierRequestBody] }, optional: true, nullable: false
34
35
  field :yearly_metered_price_id, -> { String }, optional: true, nullable: false
35
36
  field :yearly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
36
37
  field :yearly_unit_price, -> { Integer }, optional: true, nullable: false
@@ -8,7 +8,6 @@ module Schematic
8
8
  field :credit_grants, -> { Internal::Types::Array[Schematic::Types::PlanBundleCreditGrantRequestBody] }, optional: true, nullable: false
9
9
  field :entitlements, -> { Internal::Types::Array[Schematic::Types::PlanBundleEntitlementRequestBody] }, optional: false, nullable: false
10
10
  field :plan, -> { Schematic::Types::CreatePlanRequestBody }, optional: true, nullable: false
11
- field :traits, -> { Internal::Types::Array[Schematic::Types::UpdatePlanTraitTraitRequestBody] }, optional: true, nullable: false
12
11
  end
13
12
  end
14
13
  end
@@ -10,7 +10,6 @@ module Schematic
10
10
  field :entitlements, -> { Internal::Types::Array[Schematic::Types::PlanBundleEntitlementRequestBody] }, optional: false, nullable: false
11
11
  field :plan, -> { Schematic::Types::UpdatePlanRequestBody }, optional: true, nullable: false
12
12
  field :plan_version_id, -> { String }, optional: true, nullable: false
13
- field :traits, -> { Internal::Types::Array[Schematic::Types::UpdatePlanTraitTraitRequestBody] }, optional: true, nullable: false
14
13
  end
15
14
  end
16
15
  end
@@ -15,6 +15,7 @@ module Schematic
15
15
  @alloc_fn = nil
16
16
  @dealloc_fn = nil
17
17
  @check_flag_fn = nil
18
+ @set_time_fn = nil
18
19
  @get_result_json_fn = nil
19
20
  @get_result_json_length_fn = nil
20
21
  @get_version_key_fn = nil
@@ -47,6 +48,11 @@ module Schematic
47
48
  @alloc_fn = export_func("alloc")
48
49
  @dealloc_fn = export_func("dealloc")
49
50
  @check_flag_fn = export_func("checkFlagCombined")
51
+ # Optional: feed the wasm the current wall-clock time before each check.
52
+ # The raw wasm32-unknown-unknown build has no clock under wasmtime
53
+ # (SCHY-471); without this, metric-period reset timestamps are omitted.
54
+ # Absent on older wasm — hence the safe-navigation call below.
55
+ @set_time_fn = @instance.export("setCurrentTimeMillis")&.to_func
50
56
  @get_result_json_fn = export_func("getResultJson")
51
57
  @get_result_json_length_fn = export_func("getResultJsonLength")
52
58
  @get_version_key_fn = export_func("get_version_key_wasm")
@@ -80,6 +86,11 @@ module Schematic
80
86
  ptr = @alloc_fn.call(json_bytes.bytesize)
81
87
  begin
82
88
  @memory.write(ptr, json_bytes)
89
+
90
+ # Supply the host's current time so the engine can compute
91
+ # metric-period reset timestamps (SCHY-471). No-op on older wasm.
92
+ @set_time_fn&.call((Time.now.to_f * 1000).to_i)
93
+
83
94
  result_len = @check_flag_fn.call(ptr, json_bytes.bytesize)
84
95
 
85
96
  raise "WASM checkFlagCombined returned error" if result_len.negative?
@@ -8,6 +8,7 @@ module Schematic
8
8
  COMPANIES_EDIT = "companies_edit"
9
9
  COMPANY_USERS_EDIT = "company_users_edit"
10
10
  COMPONENTS_EDIT = "components_edit"
11
+ CUSTOM_PLANS_EDIT = "custom_plans_edit"
11
12
  DATA_EXPORTS_EDIT = "data_exports_edit"
12
13
  FEATURES_EDIT = "features_edit"
13
14
  FLAG_RULES_EDIT = "flag_rules_edit"
@@ -6,7 +6,9 @@ module Schematic
6
6
  extend Schematic::Internal::Types::Enum
7
7
 
8
8
  DAILY = "daily"
9
+ EVERY_6_MONTHS = "every_6_months"
9
10
  MONTHLY = "monthly"
11
+ QUARTERLY = "quarterly"
10
12
  WEEKLY = "weekly"
11
13
  YEARLY = "yearly"
12
14
  end
@@ -8,6 +8,7 @@ module Schematic
8
8
  member -> { Schematic::Types::EventBodyTrack }
9
9
  member -> { Schematic::Types::EventBodyFlagCheck }
10
10
  member -> { Schematic::Types::EventBodyIdentify }
11
+ member -> { Schematic::Types::EventBodyInference }
11
12
  end
12
13
  end
13
14
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class EventBodyInference < Internal::Types::Model
6
+ field :cached_input_tokens, -> { Integer }, optional: true, nullable: false
7
+ field :company, -> { Internal::Types::Hash[String, String] }, optional: false, nullable: false
8
+ field :cost, -> { String }, optional: true, nullable: false
9
+ field :currency, -> { String }, optional: true, nullable: false
10
+ field :event, -> { String }, optional: true, nullable: false
11
+ field :input_tokens, -> { Integer }, optional: false, nullable: false
12
+ field :operation, -> { String }, optional: true, nullable: false
13
+ field :output_tokens, -> { Integer }, optional: false, nullable: false
14
+ field :provider, -> { String }, optional: false, nullable: false
15
+ field :reasoning_tokens, -> { Integer }, optional: true, nullable: false
16
+ field :request_model, -> { String }, optional: true, nullable: false
17
+ field :requests, -> { Integer }, optional: true, nullable: false
18
+ field :response_model, -> { String }, optional: false, nullable: false
19
+ field :user, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
20
+ end
21
+ end
22
+ end
@@ -7,6 +7,7 @@ module Schematic
7
7
 
8
8
  FLAG_CHECK = "flag_check"
9
9
  IDENTIFY = "identify"
10
+ INFERENCE = "inference"
10
11
  TRACK = "track"
11
12
  end
12
13
  end
@@ -10,7 +10,9 @@ module Schematic
10
10
  field :currency, -> { String }, optional: false, nullable: false
11
11
  field :customer_external_id, -> { String }, optional: false, nullable: false
12
12
  field :due_date, -> { String }, optional: true, nullable: false
13
+ field :ending_balance, -> { Integer }, optional: true, nullable: false
13
14
  field :payment_method_external_id, -> { String }, optional: true, nullable: false
15
+ field :starting_balance, -> { Integer }, optional: true, nullable: false
14
16
  field :status, -> { Schematic::Types::InvoiceStatus }, optional: true, nullable: false
15
17
  field :subscription_external_id, -> { String }, optional: true, nullable: false
16
18
  field :subtotal, -> { Integer }, optional: false, nullable: false
@@ -12,11 +12,13 @@ module Schematic
12
12
  field :currency, -> { String }, optional: false, nullable: false
13
13
  field :customer_external_id, -> { String }, optional: false, nullable: false
14
14
  field :due_date, -> { String }, optional: true, nullable: false
15
+ field :ending_balance, -> { Integer }, optional: false, nullable: false
15
16
  field :environment_id, -> { String }, optional: false, nullable: false
16
17
  field :external_id, -> { String }, optional: true, nullable: false
17
18
  field :id, -> { String }, optional: false, nullable: false
18
19
  field :payment_method_external_id, -> { String }, optional: true, nullable: false
19
20
  field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
21
+ field :starting_balance, -> { Integer }, optional: false, nullable: false
20
22
  field :status, -> { Schematic::Types::InvoiceStatus }, optional: true, nullable: false
21
23
  field :subscription_external_id, -> { String }, optional: true, nullable: false
22
24
  field :subtotal, -> { Integer }, optional: false, nullable: false
@@ -7,7 +7,6 @@ module Schematic
7
7
  field :credit_grants, -> { Internal::Types::Array[Schematic::Types::BillingPlanCreditGrantResponseData] }, optional: true, nullable: false
8
8
  field :entitlements, -> { Internal::Types::Array[Schematic::Types::PlanEntitlementResponseData] }, optional: true, nullable: false
9
9
  field :plan, -> { Schematic::Types::PlanResponseData }, optional: true, nullable: false
10
- field :traits, -> { Internal::Types::Array[Schematic::Types::PlanTraitResponseData] }, optional: true, nullable: false
11
10
  end
12
11
  end
13
12
  end
@@ -32,6 +32,7 @@ module Schematic
32
32
  field :value_trait, -> { Schematic::Types::EntityTraitDefinitionResponseData }, optional: true, nullable: false
33
33
  field :value_trait_id, -> { String }, optional: true, nullable: false
34
34
  field :value_type, -> { Schematic::Types::EntitlementValueType }, optional: false, nullable: false
35
+ field :warning_tiers, -> { Internal::Types::Array[Schematic::Types::WarningTierResponseData] }, optional: false, nullable: false
35
36
  end
36
37
  end
37
38
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class WarningTierRequestBody < Internal::Types::Model
6
+ field :key, -> { String }, optional: false, nullable: false
7
+ field :value, -> { Integer }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class WarningTierResponseData < Internal::Types::Model
6
+ field :id, -> { String }, optional: false, nullable: false
7
+ field :key, -> { String }, optional: false, nullable: false
8
+ field :value, -> { Integer }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Schematic
4
- VERSION = "1.4.8"
4
+ VERSION = "1.4.9"
5
5
  end
Binary file
data/lib/schematic.rb CHANGED
@@ -270,6 +270,7 @@ require_relative "schematic/types/feature_in_plan_response_data"
270
270
  require_relative "schematic/types/plan_icon"
271
271
  require_relative "schematic/types/plan_type"
272
272
  require_relative "schematic/types/plan_response_data"
273
+ require_relative "schematic/types/warning_tier_response_data"
273
274
  require_relative "schematic/types/plan_entitlement_response_data"
274
275
  require_relative "schematic/types/feature_usage_response_data"
275
276
  require_relative "schematic/types/feature_usage_detail_response_data"
@@ -668,6 +669,7 @@ require_relative "schematic/types/create_entitlement_req_common"
668
669
  require_relative "schematic/types/event_body_flag_check"
669
670
  require_relative "schematic/types/event_body_identify_company"
670
671
  require_relative "schematic/types/event_body_identify"
672
+ require_relative "schematic/types/event_body_inference"
671
673
  require_relative "schematic/types/event_body_track"
672
674
  require_relative "schematic/types/event_body"
673
675
  require_relative "schematic/types/create_event_request_body"
@@ -743,6 +745,7 @@ require_relative "schematic/types/upsert_trait_request_body"
743
745
  require_relative "schematic/types/upsert_user_request_body"
744
746
  require_relative "schematic/types/upsert_user_sub_request_body"
745
747
  require_relative "schematic/types/usage_based_entitlement_request_body"
748
+ require_relative "schematic/types/warning_tier_request_body"
746
749
  require_relative "schematic/types/web_feature_usage_webhook_output"
747
750
  require_relative "schematic/types/web_scheduled_downgrade_webhook_output"
748
751
  require_relative "schematic/types/webhook_event_response_data"
data/reference.md CHANGED
@@ -2017,6 +2017,14 @@ client.billing.upsert_invoice(
2017
2017
  <dl>
2018
2018
  <dd>
2019
2019
 
2020
+ **ending_balance:** `Integer`
2021
+
2022
+ </dd>
2023
+ </dl>
2024
+
2025
+ <dl>
2026
+ <dd>
2027
+
2020
2028
  **external_id:** `String`
2021
2029
 
2022
2030
  </dd>
@@ -2033,6 +2041,14 @@ client.billing.upsert_invoice(
2033
2041
  <dl>
2034
2042
  <dd>
2035
2043
 
2044
+ **starting_balance:** `Integer`
2045
+
2046
+ </dd>
2047
+ </dl>
2048
+
2049
+ <dl>
2050
+ <dd>
2051
+
2036
2052
  **status:** `Schematic::Types::InvoiceStatus`
2037
2053
 
2038
2054
  </dd>
@@ -11335,6 +11351,14 @@ client.entitlements.create_plan_entitlement(
11335
11351
  <dl>
11336
11352
  <dd>
11337
11353
 
11354
+ **warning_tiers:** `Internal::Types::Array[Schematic::Types::WarningTierRequestBody]`
11355
+
11356
+ </dd>
11357
+ </dl>
11358
+
11359
+ <dl>
11360
+ <dd>
11361
+
11338
11362
  **yearly_metered_price_id:** `String`
11339
11363
 
11340
11364
  </dd>
@@ -11674,6 +11698,14 @@ client.entitlements.update_plan_entitlement(
11674
11698
  <dl>
11675
11699
  <dd>
11676
11700
 
11701
+ **warning_tiers:** `Internal::Types::Array[Schematic::Types::WarningTierRequestBody]`
11702
+
11703
+ </dd>
11704
+ </dl>
11705
+
11706
+ <dl>
11707
+ <dd>
11708
+
11677
11709
  **yearly_metered_price_id:** `String`
11678
11710
 
11679
11711
  </dd>
@@ -12048,6 +12080,14 @@ client.entitlements.upsert_plan_entitlement_for_billing_product(
12048
12080
  <dl>
12049
12081
  <dd>
12050
12082
 
12083
+ **warning_tiers:** `Internal::Types::Array[Schematic::Types::WarningTierRequestBody]`
12084
+
12085
+ </dd>
12086
+ </dl>
12087
+
12088
+ <dl>
12089
+ <dd>
12090
+
12051
12091
  **yearly_metered_price_id:** `String`
12052
12092
 
12053
12093
  </dd>
@@ -14430,14 +14470,6 @@ client.planbundle.create_plan_bundle(entitlements: [{
14430
14470
  <dl>
14431
14471
  <dd>
14432
14472
 
14433
- **traits:** `Internal::Types::Array[Schematic::Types::UpdatePlanTraitTraitRequestBody]`
14434
-
14435
- </dd>
14436
- </dl>
14437
-
14438
- <dl>
14439
- <dd>
14440
-
14441
14473
  **request_options:** `Schematic::Planbundle::RequestOptions`
14442
14474
 
14443
14475
  </dd>
@@ -14531,14 +14563,6 @@ client.planbundle.update_plan_bundle(
14531
14563
  <dl>
14532
14564
  <dd>
14533
14565
 
14534
- **traits:** `Internal::Types::Array[Schematic::Types::UpdatePlanTraitTraitRequestBody]`
14535
-
14536
- </dd>
14537
- </dl>
14538
-
14539
- <dl>
14540
- <dd>
14541
-
14542
14566
  **request_options:** `Schematic::Planbundle::RequestOptions`
14543
14567
 
14544
14568
  </dd>
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.4.8
4
+ version: 1.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Schematic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-07 00:00:00.000000000 Z
11
+ date: 2026-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wasmtime
@@ -776,6 +776,7 @@ files:
776
776
  - lib/schematic/types/event_body_flag_check.rb
777
777
  - lib/schematic/types/event_body_identify.rb
778
778
  - lib/schematic/types/event_body_identify_company.rb
779
+ - lib/schematic/types/event_body_inference.rb
779
780
  - lib/schematic/types/event_body_track.rb
780
781
  - lib/schematic/types/event_detail_response_data.rb
781
782
  - lib/schematic/types/event_response_data.rb
@@ -956,6 +957,8 @@ files:
956
957
  - lib/schematic/types/usage_time_series_point_response_data.rb
957
958
  - lib/schematic/types/user_detail_response_data.rb
958
959
  - lib/schematic/types/user_response_data.rb
960
+ - lib/schematic/types/warning_tier_request_body.rb
961
+ - lib/schematic/types/warning_tier_response_data.rb
959
962
  - lib/schematic/types/web_feature_usage_webhook_output.rb
960
963
  - lib/schematic/types/web_scheduled_downgrade_webhook_output.rb
961
964
  - lib/schematic/types/webhook_event_detail_response_data.rb