digiwin_dsp 0.2.0 → 0.2.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: ce7484e03d7d931e7b16d56ac6be5c6842414da91b22a559d4d298aaa69c25e7
4
- data.tar.gz: d250ea83a0f9516d49679311ab960e0009f3597ac46b553e6efdc0e344d280ed
3
+ metadata.gz: cf609190d9515001cb6540d2bbf8a88c8e1f6a5294ea21edbe1408bad4305fc4
4
+ data.tar.gz: 61f86d3485d0322c3bd0af81bddcdf0ae3105327d9de63a038dbab6854a3901b
5
5
  SHA512:
6
- metadata.gz: 2b496c0024aacf110d67fdb273d5f22b93c3825685dd0acedea7e235efa6cfd2aee4cb0cc247edf96272fe1de58a5da95ae233200b3cbb0dfc4f8333cc987fd8
7
- data.tar.gz: 43641ec002ecd264abf8d3734234ea0bd66674608c8c499c74f5264a9d577181c0ba97664a9140ca3fa68a033e6055e368c2680ef7f3248ea199e36ffc7e2b08
6
+ metadata.gz: 977f1b3a3e31e5de38b1bc48327ef5427cbedeb12b60949f1812c964a768fc96ab1810ca4b1aae7f4427c38b85c6fe108f296082ec0b202052bab76578901a31
7
+ data.tar.gz: 9301f03f1af6630147a6d1ad88fd7db41fdd70c329886b5b526a75bbf4f2492643852f353115f5c65e22c759656d1cb86708620d28199f3d9b4514360f69da90
data/CHANGELOG.md CHANGED
@@ -6,6 +6,28 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.2.1] - 2026-05-21
10
+
11
+ ### Fixed
12
+
13
+ - **Envelope failure-message regexes now match anywhere in the string**
14
+ (dropped the `\A` anchor). Discovered via live UAT smoke test: DSP
15
+ prepends the offending `form_no` to `Message`, so the actual response
16
+ is e.g. `"ORDER-123:Duplicated:訂單不可重複"` rather than the
17
+ OpenAPI-example shape `"Duplicated:訂單不可重複"`. Previously the
18
+ prefix caused `DuplicateRequestError` / `RateLimitError` /
19
+ `ValidationError` / `ServerError` classifications to fall through to
20
+ generic `DigiwinDsp::Error`, defeating typed-rescue logic in callers.
21
+
22
+ ### Changed
23
+
24
+ - CI CVE audit switched from the `bundler-audit` Ruby gem to the
25
+ `7a6163/gem-audit-action@v1` GitHub Action (which wraps the
26
+ `gem-audit` Rust binary). Faster, no runtime gem to keep updated, and
27
+ the action handles platform/version selection. Dropped `bundler-audit`
28
+ from the dev/test Gemfile group.
29
+ - Rubocop now excludes `scripts/**/*` (operator scripts; not gem source).
30
+
9
31
  ## [0.2.0] - 2026-05-21
10
32
 
11
33
  Security + correctness release. Addresses every HIGH and MEDIUM finding
@@ -118,7 +140,8 @@ Initial release. Covers the four Self-hosted Website Module (自有官網模組)
118
140
  - The gem is **synchronous on purpose**. Callers wrap requests in their own background job runner (e.g. ActiveJob) when needed.
119
141
  - Idempotency: clients can send `X-Idempotency-Key` via the `idempotency_key:` kwarg. DSP also dedupes server-side by `form_no + platform_id`.
120
142
 
121
- [Unreleased]: https://github.com/7a6163/digiwin_dsp/compare/v0.2.0...HEAD
143
+ [Unreleased]: https://github.com/7a6163/digiwin_dsp/compare/v0.2.1...HEAD
144
+ [0.2.1]: https://github.com/7a6163/digiwin_dsp/compare/v0.2.0...v0.2.1
122
145
  [0.2.0]: https://github.com/7a6163/digiwin_dsp/compare/v0.1.1...v0.2.0
123
146
  [0.1.1]: https://github.com/7a6163/digiwin_dsp/compare/v0.1.0...v0.1.1
124
147
  [0.1.0]: https://github.com/7a6163/digiwin_dsp/releases/tag/v0.1.0
@@ -25,13 +25,15 @@ module DigiwinDsp
25
25
 
26
26
  # Patterns DSP returns in the response body's `Message` field on Status=Failure.
27
27
  # The Chinese substrings are verbatim DSP responses — see docs/dsp-api-spec.md.
28
- # Order matters: more-specific patterns first.
28
+ # Live DSP prepends the offending form_no to Message (e.g.
29
+ # "ORDER-123:Duplicated:訂單不可重複"), so we substring-match rather than
30
+ # anchor with \A. Order matters: more-specific patterns first.
29
31
  ENVELOPE_FAILURE_MAP = [
30
- [/\ADuplicated:/, DuplicateRequestError], # order already exists
31
- [/\AProcessing:資料處理中/, RateLimitError], # transient; retry later
32
- [/\AProcessing:取消訂單處理中/, ValidationError], # cancel in flight
33
- [/\AWrongStatus:/, ValidationError], # bad payload
34
- [/\A系統異常:/, ServerError] # DSP internal error
32
+ [/Duplicated:/, DuplicateRequestError], # order already exists
33
+ [/Processing:資料處理中/, RateLimitError], # transient; retry later
34
+ [/Processing:取消訂單處理中/, ValidationError], # cancel in flight
35
+ [/WrongStatus:/, ValidationError], # bad payload
36
+ [/系統異常:/, ServerError] # DSP internal error
35
37
  ].freeze
36
38
 
37
39
  def initialize(configuration: DigiwinDsp.configuration, authenticator: nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DigiwinDsp
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digiwin_dsp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zac