parseapi 1.9.2 → 1.9.3

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: 9305f04eec9c9f1ed484906fb69244df03127edae6b7466c023e5855631ec6dd
4
- data.tar.gz: 2adccd9a7bfc7a456b7f0b4b5bab86f3d8b30bb4fa744b2c510a14933b99b4bf
3
+ metadata.gz: 645ae90d9f3d07bce20b3b674c484c125455c0eb59ffb9b53d60b2f91f534345
4
+ data.tar.gz: e0abb6505d9d74b82d65319d851e0c025776f71e45d7b8dbd8bc114f6e1f75df
5
5
  SHA512:
6
- metadata.gz: 4f71799f8c0304a0281fd4b3e50c08d66e4123243515eb85d0077acedbd420bb753ac5a67040e73382005d88cb8f7fd891cc495af7c958c553b8206399e8bf7f
7
- data.tar.gz: 98f12a7c2d8ef6886cd78587a9a2578c1858aa85bf33e1be6d2ba407d2185f705a0e385b1d6c1da010246b2750c9614850a8f9d7c3a1d580290aa47d8f396a4b
6
+ metadata.gz: 50f152ec92980405a45c0885f4c77830f95eaf4c5785047992463dbc56a448c2adb8c720b378465136434d8672178c7081c69ce56446baca6631bf7b05a3ded1
7
+ data.tar.gz: 225a706fa638520715044d6eb31b0cb3dea107a525bfe1de5eaecb0f23f5ed310202d1996b3eff15981d318431e3021a22d65844fdbf31ecd3d80c768a1cb90e
data/README.md CHANGED
@@ -257,7 +257,7 @@ parse.weather(40.7128, -74.006, deep: true, date: '2026-08-15')
257
257
 
258
258
  Tariff starts with the general schedule line. Paid deep adds units and the special and other schedule columns. An optional origin then resolves country-specific measures. The three calls below show those successive choices. Without origin, schedule detail is still returned and origin-dependent fields are null. A null effective rate is not a zero rate.
259
259
 
260
- Tariff lookup and search accept an optional `edition` fingerprint and `date` (`YYYY-MM-DD`). The edition pins exact immutable source bytes. A date is accepted only when verified source coverage exists. An edition without a date returns undated schedule context (`date: null`). Default requests use today. Paid detail exposes an open-string `reason` when `effective_rate` is null, including `incomplete_coverage`. A null rate never means zero. Explicit selections fail with `tariff_selection_mismatch` if an older server ignores the requested scope.
260
+ Tariff lookup and search accept the `edition` ID returned by Tariff, such as `ted_3`, and an optional `date` (`YYYY-MM-DD`). The edition pins exact immutable source bytes. A date is accepted only when verified source coverage exists. An edition without a date returns undated schedule context (`date: null`). Default requests use today. Paid detail exposes an open-string `reason` when `effective_rate` is null, including `incomplete_coverage`. A null rate never means zero. Explicit selections fail with `tariff_selection_mismatch` if an older server ignores the requested scope.
261
261
 
262
262
  Origin means where the goods originate, not where they ship from. The effective rate covers matched stored schedule measures only. It is not complete duty or landed cost.
263
263
 
@@ -465,8 +465,12 @@ module ParseAPI
465
465
  targets.join(',')
466
466
  end
467
467
 
468
+ def tariff_edition_id?(value)
469
+ value.is_a?(String) && (/\A[a-f0-9]{64}\z/.match?(value) || (/\Ated_[1-9][0-9]{0,19}\z/.match?(value) && (value.bytesize < 24 || value[4..-1] <= '18446744073709551615')))
470
+ end
471
+
468
472
  def tariff_selection(result, edition, date)
469
- if (!edition.nil? || !date.nil?) && (!result['edition'].is_a?(String) || !/\A[a-f0-9]{64}\z/.match?(result['edition']) || (!edition.nil? && result['edition'] != edition) || result['date'] != date)
473
+ if (!edition.nil? || !date.nil?) && (!tariff_edition_id?(result['edition']) || (!edition.nil? && result['edition'] != edition) || result['date'] != date)
470
474
  raise Error.new(status: 0, code: 'tariff_selection_mismatch', message: 'Tariff response did not confirm the requested edition/date. The server may not support this selection.')
471
475
  end
472
476
  result
@@ -1,3 +1,3 @@
1
1
  module ParseAPI
2
- VERSION = '1.9.2'.freeze
2
+ VERSION = '1.9.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parseapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ParseAPI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-14 00:00:00.000000000 Z
11
+ date: 2026-10-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: