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 +4 -4
- data/CHANGELOG.md +24 -1
- data/lib/digiwin_dsp/client.rb +8 -6
- data/lib/digiwin_dsp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cf609190d9515001cb6540d2bbf8a88c8e1f6a5294ea21edbe1408bad4305fc4
|
|
4
|
+
data.tar.gz: 61f86d3485d0322c3bd0af81bddcdf0ae3105327d9de63a038dbab6854a3901b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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
|
data/lib/digiwin_dsp/client.rb
CHANGED
|
@@ -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
|
-
#
|
|
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
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
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)
|
data/lib/digiwin_dsp/version.rb
CHANGED