parseapi 1.12.0 → 1.13.1
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/README.md +14 -6
- data/lib/parseapi/client.rb +22 -9
- data/lib/parseapi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 236cc7aa6c8454d15e1b4a2a8841d51fcc052365f2b400d79e86a27d838a631a
|
|
4
|
+
data.tar.gz: fc96b7613354a75e28afb2ec19c56078f34a20aaa0fa6d8d3d2a7f760a5267cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a4d692e52ae113e6083ad824ddee30bbc4003a548670867456ee66e7199198a1dbe8c65d666e3269827047a038bcfbe91712f0e0d8c3a495cc71f12f5babdd71
|
|
7
|
+
data.tar.gz: b13b12f73e790124160d0f13c634799afecab20082e08781a9d46a9c75978b19c28c18704c7bfba563047532cabe5d20b564f787ee0552f10038ed041d41381e
|
data/README.md
CHANGED
|
@@ -13,7 +13,9 @@ Get a key at [parseapi.com](https://parseapi.com). The client also reads `PARSEA
|
|
|
13
13
|
|
|
14
14
|
## API versions
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
State and County use `iso_code` for the full ISO 3166-2 code of the exact returned place, including County items in State lists. A null means unassigned or unknown. National `state` and `county` identifiers are unchanged. Update State readers from `iso_subdivision` to `iso_code`. Responses keep the server's keys without adding legacy duplicates.
|
|
17
|
+
|
|
18
|
+
This SDK explicitly selects the API contract supported by this SDK. It sends `X-API-Version: 2.2.0` on every lookup so responses match the API contract supported by the package. Your key and the team's saved default stay the same. The API still accepts earlier `Parse-Version` request pins.
|
|
17
19
|
|
|
18
20
|
Upgrade the dependency in staging, review the [release notes](https://parseapi.com/docs/releases), and test the application before deploying the same code and dependency version to production. Commit your dependency lockfile so the tested package travels with your deployment. Future major SDK upgrades can select a newer API contract.
|
|
19
21
|
|
|
@@ -77,7 +79,7 @@ Supply `industry` and `industry_type` together. The supported namespace is `sic`
|
|
|
77
79
|
## ISO identifiers
|
|
78
80
|
|
|
79
81
|
Country uses `iso_alpha3` and `iso_numeric`, State uses the full
|
|
80
|
-
`
|
|
82
|
+
`iso_code` code such as `US-CA`, Language uses `iso_alpha3`, and Currency
|
|
81
83
|
uses `iso_numeric`. Primary `country`, `state`, `language` and `currency` codes
|
|
82
84
|
keep their meaning. Results retain the selected API contract's exact keys,
|
|
83
85
|
values, nulls and nesting. Earlier server contracts retain their earlier ISO
|
|
@@ -116,8 +118,8 @@ parse.country('US')
|
|
|
116
118
|
parse.country_states('US')
|
|
117
119
|
parse.state('colorado')
|
|
118
120
|
parse.state('NC', country: 'US')
|
|
119
|
-
parse.
|
|
120
|
-
parse.
|
|
121
|
+
parse.state_counties('NC', country: 'US')
|
|
122
|
+
parse.county('37081')
|
|
121
123
|
parse.continent('NA')
|
|
122
124
|
parse.continent_countries('NA')
|
|
123
125
|
parse.language('en')
|
|
@@ -266,7 +268,7 @@ Call the API and get everything your plan includes. API 2.1 paid plans include t
|
|
|
266
268
|
| Phone, Time, Date, Emoji, Point | Optional detail on paid plans in the same pooled request. Existing accounts retain their current Deep access. |
|
|
267
269
|
| Language | All language facts are in Core; Deep adds no fields. |
|
|
268
270
|
| Currency | Currency lookup facts are complete in Core; Deep adds no fields. Lookup and exchange-rate conversion use pooled requests. |
|
|
269
|
-
| Country, State,
|
|
271
|
+
| Country, State, County, City, Postal | The place profile on paid plans, including demographic and tax facts where held. |
|
|
270
272
|
| Name, Industry | Name evidence or the industry definition profile on paid plans. |
|
|
271
273
|
| Company | The complete product detail bag on paid plans. |
|
|
272
274
|
| Weather | Specialist current measurements and the existing forecast, alert, air and history bag on paid plans. |
|
|
@@ -470,7 +472,7 @@ API 2.1 Time returns the clock first and the matched place in `location`. Read t
|
|
|
470
472
|
|
|
471
473
|
This client targets ParseAPI 2.1.0. Upgrading requires response-reader changes: optional detail now lives on its resource. Read `population` instead of `deep.population`. Deep remains an explicit request for optional detail. Without the request or access, optional fields are absent. A returned null still means unknown. User-Agent device, OS and browser are objects in every mode. Postal tax is one `tax` object. Specialist Weather measurements live in `current`. Metered Carrier and HLR return the complete purchased result without a Deep switch.
|
|
472
474
|
|
|
473
|
-
Use `parse.email_verify(email)` for mailbox verification. It
|
|
475
|
+
Use `parse.email_verify(email)` for mailbox verification. It uses GET `/email/verify?email=person%40example.com` by default, with no automatic retries. The SDK chooses POST before dispatch for inputs that cannot safely fit in a URL; existing POST requests remain supported. The earlier Email deep argument is accepted only as a migration alias for that same operation. App keys receive `permission_denied`. Bulk exports retain their existing column names and saved-job recovery.
|
|
474
476
|
|
|
475
477
|
The 2.0 API is a temporary migration bridge for older installed clients. There is one maintained SDK line using the 2.1 structure.
|
|
476
478
|
|
|
@@ -479,3 +481,9 @@ The 2.0 API is a temporary migration bridge for older installed clients. There i
|
|
|
479
481
|
This version selects API `2.1.0`. Update existing `.deep` property reads to the fields at their natural homes, such as `country.population`. User-Agent identities are objects; Postal tax and Weather observations keep their documented object homes. Paid plans include their profile detail automatically in API 2.1. Free keeps its complete routine answer, and existing explicit `deep` options remain supported. Mailbox verification stays explicit.
|
|
480
482
|
|
|
481
483
|
**This minor version changes existing field reads.** Upgrade the SDK and your application reads together. Existing factories remain. Email verification is explicit and includes basic validation; Carrier/HLR need no extra detail request. Preserve missing values, `null`, `false` and `0`.
|
|
484
|
+
|
|
485
|
+
## County migration: HTTP API 2.2
|
|
486
|
+
|
|
487
|
+
This source selects HTTP API `2.2.0`. County is the public name for counties and comparable administrative areas internationally. Use `county` and the State counties operation. Read `county`, `county_name`, `county_name_local` and `counties` in affected geography results; City `capital_of` uses `county` for this administrative level. Actual local types such as `department` and `district` retain their meaning.
|
|
488
|
+
|
|
489
|
+
This is a breaking field-read upgrade from earlier contracts. Deprecated District callable names remain source aliases, but SDK results use the canonical County fields. Update property reads before upgrading. Older installed packages keep their existing API contract, and this client does not change an account's saved default.
|
data/lib/parseapi/client.rb
CHANGED
|
@@ -19,7 +19,7 @@ module ParseAPI
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
class Client
|
|
22
|
-
API_VERSION = '2.
|
|
22
|
+
API_VERSION = '2.2.0'.freeze
|
|
23
23
|
private def city_format(value)
|
|
24
24
|
raise ArgumentError, 'Use format=geojson or omit format.' unless value.nil? || value == 'geojson'
|
|
25
25
|
value
|
|
@@ -97,14 +97,18 @@ module ParseAPI
|
|
|
97
97
|
get("/state/#{seg(code)}", country: country, deep: deep, lang: lang)
|
|
98
98
|
end
|
|
99
99
|
|
|
100
|
-
def
|
|
101
|
-
get("/state/#{seg(code)}/
|
|
100
|
+
def state_counties(code, country: nil, deep: false, lang: nil)
|
|
101
|
+
get("/state/#{seg(code)}/counties", country: country, deep: deep, lang: lang)
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
def
|
|
105
|
-
get("/
|
|
104
|
+
def county(code, country: nil, state: nil, deep: false, lang: nil)
|
|
105
|
+
get("/county/#{seg(code)}", country: country, state: state, deep: deep, lang: lang)
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
+
# Deprecated source aliases. API 2.2 results use county/counties fields.
|
|
109
|
+
alias_method :state_districts, :state_counties
|
|
110
|
+
alias_method :district, :county
|
|
111
|
+
|
|
108
112
|
def city(name, country: nil, state: nil, deep: false, lang: nil, type: nil, grain: nil, hierarchy: false, aliases: false, ambiguity: nil, format: nil, romanized: false)
|
|
109
113
|
get("/city/#{seg(name)}", country: country, state: state, deep: deep, lang: lang, type: type, grain: grain, hierarchy: hierarchy, aliases: aliases, ambiguity: ambiguity, romanized: romanized, format: city_format(format))
|
|
110
114
|
end
|
|
@@ -217,7 +221,7 @@ module ParseAPI
|
|
|
217
221
|
|
|
218
222
|
# Run one explicit metered mailbox check, without automatic retries.
|
|
219
223
|
def email_verify(email)
|
|
220
|
-
get('/email/verify', {
|
|
224
|
+
get('/email/verify', { email: email })
|
|
221
225
|
end
|
|
222
226
|
|
|
223
227
|
|
|
@@ -363,7 +367,7 @@ module ParseAPI
|
|
|
363
367
|
get('/elevation', lat: lat, lon: lon)
|
|
364
368
|
end
|
|
365
369
|
|
|
366
|
-
# Resolve the country, state,
|
|
370
|
+
# Resolve the country, state, county and timezone at coordinates. Deep adds terrain and
|
|
367
371
|
# compact nearest-city context on every plan. The timezone ID stays in core. The nearest city is
|
|
368
372
|
# null when none is within 200 km.
|
|
369
373
|
def point(lat, lon, deep: false, lang: nil)
|
|
@@ -401,11 +405,11 @@ module ParseAPI
|
|
|
401
405
|
|
|
402
406
|
# Positions are UTF-16 code units; end is exclusive.
|
|
403
407
|
def emoji_parse(text, deep: false, lang: nil)
|
|
404
|
-
get('/emoji/parse', { deep: deep, lang: lang }
|
|
408
|
+
get('/emoji/parse', { text: text, deep: deep, lang: lang })
|
|
405
409
|
end
|
|
406
410
|
|
|
407
411
|
def emoji_convert(text, direction:, shortcode_source:)
|
|
408
|
-
get('/emoji/convert', {direction: direction, shortcode_source: shortcode_source}
|
|
412
|
+
get('/emoji/convert', {text: text, direction: direction, shortcode_source: shortcode_source})
|
|
409
413
|
end
|
|
410
414
|
|
|
411
415
|
|
|
@@ -441,9 +445,18 @@ module ParseAPI
|
|
|
441
445
|
def get(path, params = {}, headers = {}, json = nil)
|
|
442
446
|
retries = retries_for(path, params)
|
|
443
447
|
query = params.reject { |_name, value| value.nil? || value == false }
|
|
448
|
+
field = path == '/email/verify' ? :email : ['/emoji/parse', '/emoji/convert'].include?(path) ? :text : nil
|
|
449
|
+
value = field ? params[field] : nil
|
|
450
|
+
if json.nil? && field && (!value.is_a?(String) || !value.valid_encoding?)
|
|
451
|
+
json = { field => value }; query.delete(field)
|
|
452
|
+
end
|
|
444
453
|
uri = @base_url.dup
|
|
445
454
|
uri.path = path
|
|
446
455
|
uri.query = URI.encode_www_form(query) unless query.empty?
|
|
456
|
+
if json.nil? && field && uri.to_s.bytesize > 8000
|
|
457
|
+
json = { field => value }; query.delete(field)
|
|
458
|
+
uri.query = query.empty? ? nil : URI.encode_www_form(query)
|
|
459
|
+
end
|
|
447
460
|
|
|
448
461
|
encoded = json.nil? ? nil : JSON.generate(json)
|
|
449
462
|
attempt = 0
|
data/lib/parseapi/version.rb
CHANGED
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.
|
|
4
|
+
version: 1.13.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ParseAPI
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|