tcat 0.1.7 → 0.1.9

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: 30282cc204d33385f1c2ad59b0c48a46e1365b6094bc2d0673b1f75b95f4ee40
4
- data.tar.gz: 02b5cc602a18a28411a89c330d99af2a62fc61cdb0b21db6c29c5ce9c6fafd58
3
+ metadata.gz: d08abb934b373088d1c95b04871fa30e9feb3a380b3e9fbed9011b659cb5da4a
4
+ data.tar.gz: ab23c8913af3b3ec2c0687f9715a0f7e983e3349183cd42c66e0d040208acd90
5
5
  SHA512:
6
- metadata.gz: 0a319a1f8fb97586fffd1154107b0c3e75994a669301061afaf6f53a9aa065a8a2f522d2b3173d7391fc1cdadbb011549b6120a32f1b4bb004e2a29b4c850ed9
7
- data.tar.gz: fc47408a9feeaddf3cf2ec956940bf3a0835f4824faa1c6ca0c41a315dcd4e04efb171e1fc05e9c84685a17f355d0db680e557c9806ce2370e984f38ab3526af
6
+ metadata.gz: 26e31aeaa06a46d31d7bea49fd46999bd446d47d29e73011a3262627a0658f0344123085b4f67000dde3f4aeb14611019d10463215f672413ed64b74717561a1
7
+ data.tar.gz: d6634d7f3ecfb4a14795d55e6a7ae42d38002d52382fa89620461edd5a35b858dec1526db2ea24d1689aa78e22aa942f196cd13632cd45688da4ab3e6f2f3152
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.3.6
1
+ ruby 3.3.8
data/README.md CHANGED
@@ -56,6 +56,12 @@ status = query.status_code
56
56
  # :delivering - Out for delivery
57
57
  # :collected - Package collected
58
58
  # :in_transit - In transit
59
+ # :returned - Return completed
60
+ # :held - Held at post office
61
+ # :forwarding - Being forwarded
62
+ # :investigation - Under investigation
63
+ # :rejected - Delivery rejected
64
+ # :returning - In return process
59
65
  # :unknown - Unknown status
60
66
 
61
67
  # Get latest status details
@@ -84,6 +90,12 @@ end
84
90
  - `:delivering` - Out for delivery
85
91
  - `:collected` - Package collected
86
92
  - `:in_transit` - In transit
93
+ - `:returned` - Return completed
94
+ - `:held` - Package is being held at post office
95
+ - `:forwarding` - Package is being forwarded
96
+ - `:investigation` - Package is under investigation (e.g., address change, rejection)
97
+ - `:rejected` - Delivery was rejected
98
+ - `:returning` - Package is in return process
87
99
  - `:unknown` - Unknown status
88
100
 
89
101
  ## Development
@@ -5,13 +5,13 @@ require 'net/http'
5
5
  module Tcat
6
6
  class HttpClient
7
7
  DEFAULT_HEADERS = {
8
- 'User-Agent' => 'BlackCat/2.49 (iPhone; iOS 17.6.1; Scale/3.00)',
8
+ 'User-Agent' => 'BlackCat/2.49.1 (iPhone; iOS 18.4.1; Scale/3.00)',
9
9
  'Accept-Language' => 'zh-Hant-TW;q=1, en-TW;q=0.9',
10
10
  'Cookie' => 'citrix_ns_id=AAE7go4rZDusCRcEAAAAADuVBLGLdqo1FolMO02r_jOEnjNmr4u9sIYwtllmmfsOOw==KJArZA==AQJLxyeLYOXPo3Uzfh_rWrr_NcU=; ASP.NET_SessionId=p4v1z4nijrynbortgf4iqml4'
11
11
  }.freeze
12
12
 
13
13
  API_ENDPOINT = 'https://www.t-cat.com.tw/iPhone/TCatApp.aspx'
14
- API_VERSION = '24.26'
14
+ API_VERSION = '25'
15
15
 
16
16
  class RequestError < StandardError; end
17
17
 
@@ -22,7 +22,7 @@ module Tcat
22
22
  def post(params)
23
23
  uri = URI("#{API_ENDPOINT}?ver=#{API_VERSION}")
24
24
  http = setup_http_client(uri)
25
-
25
+
26
26
  request = Net::HTTP::Post.new(uri)
27
27
  DEFAULT_HEADERS.each { |key, value| request[key] = value }
28
28
  request.body = URI.encode_www_form(params)
data/lib/tcat/query.rb CHANGED
@@ -162,7 +162,14 @@ module Tcat
162
162
  '順利送達' => :done,
163
163
  '配送中' => :delivering,
164
164
  '已集貨' => :collected,
165
- '轉運中' => :in_transit
165
+ '轉運中' => :in_transit,
166
+ '退貨完成' => :returned,
167
+ '暫置營業所保管中' => :held,
168
+ '轉寄配送中' => :forwarding,
169
+ '搬家(調查處理中)' => :investigation,
170
+ '拒收(調查處理中)' => :investigation,
171
+ '拒收' => :rejected,
172
+ '客樂得貨物退回中' => :returning
166
173
  }.freeze
167
174
 
168
175
  def parse_status_message(statuses)
data/lib/tcat/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tcat
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zac
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-11-19 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: ox
@@ -65,7 +64,6 @@ licenses:
65
64
  - MIT
66
65
  metadata:
67
66
  homepage_uri: https://rubygems.org/gems/tcat
68
- post_install_message:
69
67
  rdoc_options: []
70
68
  require_paths:
71
69
  - lib
@@ -80,8 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
78
  - !ruby/object:Gem::Version
81
79
  version: '0'
82
80
  requirements: []
83
- rubygems_version: 3.5.22
84
- signing_key:
81
+ rubygems_version: 3.6.7
85
82
  specification_version: 4
86
83
  summary: A Ruby gem for tracking packages using the Tcat system.
87
84
  test_files: []