pescheck-client 0.5.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3219453366a2a5a933e8c68a140bcda403fb709bf32cf7345dd321cffe42b3a
4
- data.tar.gz: 6a501462898efc7701eab177479103905193506e4f2010c982488950d7182571
3
+ metadata.gz: 243d140166fd9c39d585cd5d3eee97ee6e26f2a45dec15a90f7044a99a08d614
4
+ data.tar.gz: 68fbc0e037ce4742db376d028459cfc3018ea6a6b2b90d0c100971fdbda0949d
5
5
  SHA512:
6
- metadata.gz: 7f1d54aa142c18f632561ad05d8492b87503019a324bd93011f87465eb7d104b1aa3a103b0e3cda48abe7bb2d537e487d01dc9c3acce62d1d322e3d362156157
7
- data.tar.gz: 147eb452b96b2b2a77c9f8d24eeb5f1339048f94ac1a5610abb004899f497d3054c6141d8a3f8a3931bd0567a0e598087bbe268b4caa38180c6b0743e366bee2
6
+ metadata.gz: 1065e3ace53d9fa575148223cd67320620f1f4fd07126f00eb71781afcdc86fd7a178a7fa4713548f088b2d53d76591a32fac72cb95b99fa262c5958123e116c
7
+ data.tar.gz: 4f094bdf5518b7876f6e5ba5899983452ae31097ac3d927135182dfa956a68f68dbb1732d31729e8f4c49ea151bd2ef7c48fbb190813d14d365170f853eebb3e
data/README.md CHANGED
@@ -1,6 +1,44 @@
1
1
  > **Official Pescheck API client** - part of the [pescheck-clients](https://github.com/pescheckit/pescheck-clients) SDKs.
2
2
 
3
- > **Choosing the environment:** the default host is read from the `PESCHECK_BASE_URL` environment variable and falls back to production (`https://api.pescheck.io`). Set `PESCHECK_BASE_URL=https://api-staging.pescheck.io` while integrating, then unset it to go live, with no code change. Request your OAuth2 token from the same host (`$PESCHECK_BASE_URL/api/o/token/`). Setting the host explicitly in code, as some examples below do, overrides the variable.
3
+ <!-- pescheck-quickstart:start (generated by scripts/postprocess.mjs) -->
4
+
5
+ ## Quickstart
6
+
7
+ **1. Get API credentials.** Create a test account at [dashboard-staging.pescheck.io](https://dashboard-staging.pescheck.io/). In the dashboard, enable the **API & MCP Access** add-on (*Settings → Add-ons*), then create an app under *Development → Add app*. You get a client ID and a client secret.
8
+
9
+ **2. Get an access token** from the environment you want to use (staging while you integrate):
10
+
11
+ ```bash
12
+ curl -X POST https://api-staging.pescheck.io/api/o/token/ \
13
+ -d grant_type=client_credentials \
14
+ -d client_id=YOUR_CLIENT_ID \
15
+ -d client_secret=YOUR_CLIENT_SECRET
16
+ ```
17
+
18
+ Copy the `access_token` from the response (it is valid for one hour), and point the client at the same environment:
19
+
20
+ ```bash
21
+ export PESCHECK_BASE_URL=https://api-staging.pescheck.io
22
+ export PESCHECK_ACCESS_TOKEN=paste-the-access-token-here
23
+ ```
24
+
25
+ **3. Make your first call:**
26
+
27
+ ```ruby
28
+ require 'pescheck-client'
29
+
30
+ config = Pescheck::Configuration.new # host from PESCHECK_BASE_URL
31
+ config.access_token = ENV.fetch('PESCHECK_ACCESS_TOKEN')
32
+
33
+ checks = Pescheck::ChecksApi.new(Pescheck::ApiClient.new(config)).v2_checks_list
34
+ puts "#{checks.length} check types available"
35
+ ```
36
+
37
+ **4. Go live.** Use your production credentials and request the token from `https://api.pescheck.io/api/o/token/`. Then unset `PESCHECK_BASE_URL`: the client uses production by default. Your code does not change.
38
+
39
+ Setting the host in code (as some examples below do) overrides `PESCHECK_BASE_URL`.
40
+
41
+ <!-- pescheck-quickstart:end -->
4
42
 
5
43
  # pescheck-client
6
44
 
@@ -11,5 +11,5 @@ Generator version: 7.23.0
11
11
  =end
12
12
 
13
13
  module Pescheck
14
- VERSION = '0.5.0'
14
+ VERSION = '0.5.1'
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pescheck-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pescheck