QNE 0.8.0 → 0.9.0

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: bfcb0bccef66061d74adbb48ecf4ea2257706c617e2f81a3d74e64840a6bfb7d
4
- data.tar.gz: 7ab084026ffc578fa66cc753c23289576651163747dbdf5c53e721f47c6d19ef
3
+ metadata.gz: 005b4b681b57f747b4facfa512ba79d6613fd8a0b854bdaba728490b66e73ded
4
+ data.tar.gz: c65fd9566cf9f484a429a506a8bf779f21fb5ef5154f8323980d68712e646b08
5
5
  SHA512:
6
- metadata.gz: 6055f791496d3dfb202b3c8a300e8469e740b1900bf982a242271c1dd33284965704c1554e13e5982b79f719b6b613e046bcd96a4db1b3f1adfcbdd8d948273f
7
- data.tar.gz: cee1b456d4af726070df6a1229614444b55b58e8f28fd946ecb2e91531075d95807e7a0a1a419ee4b7ff2a02ce10cd25a7a2f4cafe1ec9f63bd38e5e95d3d53d
6
+ metadata.gz: 35292c61522f77d4f9048990c677a37300c6c6130851efbcaa62bf8d21216e50236d656d80128adc6dcc0613f27cd3803191f907535fdc7213bfe75b4943ab5a
7
+ data.tar.gz: 9c1a2578c61abcdd8d18cd0e8ba5cbc596171a73b85fd908d2eef893c6ea24ea3f105023bc7d38bb2aeaa18373e56f8a42b2d353e9035fc52c485aef99b13954
data/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.9.0] - 2026-09-29
9
+
10
+ - Support connecting to a local QNE server: `Connection` now accepts `app_port` and `proxy` options, and when both are set, requests go to `<proxy>:<app_port>` instead of the cloud `BASE_URI` (an `http://` scheme is added when the proxy has none, and trailing slashes are removed)
11
+ - Bump regexp_parser, unicode-display_width, and unicode-emoji dependency versions
12
+
13
+ ## [0.8.0] - 2026-09-16
14
+
15
+ - Add Customer Receipts resource (`Connection#customer_receipts`) with a `create` method that posts to `/api/CustomerReceipts`
16
+ - Bump bigdecimal, faraday, json (2.x → 3.x), parallel, rubocop, and webmock dependency versions
17
+
8
18
  ## [0.7.2] - 2026-07-28
9
19
 
10
20
  - Bump json, parser, and rubocop dependency versions
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- QNE (0.8.0)
4
+ QNE (0.9.0)
5
5
  faraday (>= 1.10)
6
6
  faraday-net_http_persistent (>= 1.2)
7
7
  faraday-retry
@@ -48,7 +48,7 @@ GEM
48
48
  racc (1.8.1)
49
49
  rainbow (3.1.1)
50
50
  rake (13.4.2)
51
- regexp_parser (2.12.0)
51
+ regexp_parser (2.13.1)
52
52
  rexml (3.4.4)
53
53
  rspec (3.13.2)
54
54
  rspec-core (~> 3.13.0)
@@ -78,9 +78,9 @@ GEM
78
78
  parser (>= 3.3.7.2)
79
79
  prism (~> 1.7)
80
80
  ruby-progressbar (1.13.0)
81
- unicode-display_width (3.2.0)
82
- unicode-emoji (~> 4.1)
83
- unicode-emoji (4.2.0)
81
+ unicode-display_width (3.3.0)
82
+ unicode-emoji (~> 4.3)
83
+ unicode-emoji (4.3.0)
84
84
  uri (1.1.1)
85
85
  webmock (3.26.4)
86
86
  addressable (>= 2.8.0)
data/lib/QNE/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QNE
4
- VERSION = '0.8.0'
4
+ VERSION = '0.9.0'
5
5
  end
data/lib/connection.rb CHANGED
@@ -16,6 +16,7 @@ require_relative 'uoms'
16
16
  require_relative 'tax_codes'
17
17
  require_relative 'users'
18
18
 
19
+ # rubocop:disable Metrics/ClassLength
19
20
  module QNE
20
21
  class Connection
21
22
  BASE_URI = 'https://dev-api.qne.cloud'
@@ -24,6 +25,7 @@ module QNE
24
25
  def initialize(options = {}, &retry_block)
25
26
  @db_code = options.fetch(:db_code, nil) || ENV['QNE_DB_CODE']
26
27
  @api_token = options.fetch(:api_token, nil)
28
+ @app_port, @proxy = options.values_at(:app_port, :proxy)
27
29
  @retry_block = retry_block
28
30
  end
29
31
 
@@ -84,7 +86,7 @@ module QNE
84
86
  end
85
87
 
86
88
  def users
87
- @users ||= QNE::Users.new(Faraday.new(url: BASE_URI))
89
+ @users ||= QNE::Users.new(Faraday.new(url: base_uri))
88
90
  end
89
91
 
90
92
  def connected?
@@ -110,12 +112,20 @@ module QNE
110
112
 
111
113
  def faraday_params
112
114
  @faraday_params ||= {
113
- url: BASE_URI,
115
+ url: base_uri,
114
116
  headers: auth_method,
115
117
  request: request_options
116
118
  }
117
119
  end
118
120
 
121
+ def base_uri
122
+ return BASE_URI if @app_port.to_s.strip.empty? || @proxy.to_s.strip.empty?
123
+
124
+ proxy = @proxy.to_s.strip.sub(%r{/*\z}, '').sub(%r{\A(?!https?://)}i, 'http://')
125
+
126
+ "#{proxy}:#{@app_port}"
127
+ end
128
+
119
129
  def retry_options
120
130
  @retry_options ||= {
121
131
  retry_statuses: [401, 409, 500],
@@ -147,3 +157,4 @@ module QNE
147
157
  end
148
158
  end
149
159
  end
160
+ # rubocop:enable Metrics/ClassLength
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: QNE
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nujian Den Mark Meralpis