e-invoice-api 0.5.0 → 0.5.2
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 +31 -0
- data/README.md +1 -1
- data/lib/e_invoice_api/file_part.rb +10 -7
- data/lib/e_invoice_api/internal/type/file_input.rb +7 -4
- data/lib/e_invoice_api/internal/util.rb +2 -1
- data/lib/e_invoice_api/version.rb +1 -1
- data/rbi/e_invoice_api/file_part.rbi +1 -1
- data/sig/e_invoice_api/file_part.rbs +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 438b75b71296823e500d9b3c1b24b6cf127222237107a15e412ac746e5bae37c
|
4
|
+
data.tar.gz: f87581a3ab2ce3616f068d8ffac4fc403de0ca488a0b02402ce16e4e1993439d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeb1f588e88631e17d59b10706dc237c34f035d448cf66502a261eb0bb9b0704ebf1108c841029c5c7e45f32bd7935eed700953e2d791e3403d47f7495a094ea
|
7
|
+
data.tar.gz: 7d07de513ce62e598f7cac78f9784992fbc51857ff5a0f7c10d827f82989bec611b3b6aa5e96d9ec941d699a8d666d724585969465783573b9b59bf4ef092eb8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,36 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.5.2 (2025-09-30)
|
4
|
+
|
5
|
+
Full Changelog: [v0.5.1...v0.5.2](https://github.com/e-invoice-be/e-invoice-rb/compare/v0.5.1...v0.5.2)
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
* always send `filename=...` for multipart requests where a file is expected ([e4ff666](https://github.com/e-invoice-be/e-invoice-rb/commit/e4ff6665e73982d21afb468a3b14dc9a4e9ac404))
|
10
|
+
|
11
|
+
|
12
|
+
### Chores
|
13
|
+
|
14
|
+
* allow fast-format to use bsd sed as well ([bfe57c8](https://github.com/e-invoice-be/e-invoice-rb/commit/bfe57c8ef9ccd2875fdf93180009f2f98fcdba7b))
|
15
|
+
|
16
|
+
## 0.5.1 (2025-09-27)
|
17
|
+
|
18
|
+
Full Changelog: [v0.5.0...v0.5.1](https://github.com/e-invoice-be/e-invoice-rb/compare/v0.5.0...v0.5.1)
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* shorten multipart boundary sep to less than RFC specificed max length ([336fbe2](https://github.com/e-invoice-be/e-invoice-rb/commit/336fbe2d7932708e0ac0eb3d6f2d96bfa52cf165))
|
23
|
+
|
24
|
+
|
25
|
+
### Performance Improvements
|
26
|
+
|
27
|
+
* faster code formatting ([1180d4a](https://github.com/e-invoice-be/e-invoice-rb/commit/1180d4a4ebcca49f99aa860ecdb88ea312d25fb6))
|
28
|
+
|
29
|
+
|
30
|
+
### Chores
|
31
|
+
|
32
|
+
* **internal:** codegen related update ([c4a13d4](https://github.com/e-invoice-be/e-invoice-rb/commit/c4a13d47fa4210a2e0849a5b94a53d3fdc26e7d4))
|
33
|
+
|
3
34
|
## 0.5.0 (2025-09-23)
|
4
35
|
|
5
36
|
Full Changelog: [v0.4.0...v0.5.0](https://github.com/e-invoice-be/e-invoice-rb/compare/v0.4.0...v0.5.0)
|
data/README.md
CHANGED
@@ -38,18 +38,21 @@ module EInvoiceAPI
|
|
38
38
|
def to_yaml(*a) = read.to_yaml(*a)
|
39
39
|
|
40
40
|
# @param content [Pathname, StringIO, IO, String]
|
41
|
-
# @param filename [String, nil]
|
41
|
+
# @param filename [Pathname, String, nil]
|
42
42
|
# @param content_type [String, nil]
|
43
43
|
def initialize(content, filename: nil, content_type: nil)
|
44
|
-
@
|
44
|
+
@content_type = content_type
|
45
45
|
@filename =
|
46
|
-
case content
|
47
|
-
in Pathname
|
48
|
-
|
46
|
+
case [filename, (@content = content)]
|
47
|
+
in [String | Pathname, _]
|
48
|
+
::File.basename(filename)
|
49
|
+
in [nil, Pathname]
|
50
|
+
content.basename.to_path
|
51
|
+
in [nil, IO]
|
52
|
+
content.to_path
|
49
53
|
else
|
50
|
-
filename
|
54
|
+
filename
|
51
55
|
end
|
52
|
-
@content_type = content_type
|
53
56
|
end
|
54
57
|
end
|
55
58
|
end
|
@@ -82,17 +82,20 @@ module EInvoiceAPI
|
|
82
82
|
#
|
83
83
|
# @return [Pathname, StringIO, IO, String, Object]
|
84
84
|
def dump(value, state:)
|
85
|
-
# rubocop:disable Lint/DuplicateBranch
|
86
85
|
case value
|
86
|
+
in StringIO | String
|
87
|
+
# https://datatracker.ietf.org/doc/html/rfc7578#section-4.2
|
88
|
+
# while not required, a filename is recommended, and in practice many servers do expect this
|
89
|
+
EInvoiceAPI::FilePart.new(value, filename: "upload")
|
87
90
|
in IO
|
88
91
|
state[:can_retry] = false
|
92
|
+
value.to_path.nil? ? EInvoiceAPI::FilePart.new(value, filename: "upload") : value
|
89
93
|
in EInvoiceAPI::FilePart if value.content.is_a?(IO)
|
90
94
|
state[:can_retry] = false
|
95
|
+
value
|
91
96
|
else
|
97
|
+
value
|
92
98
|
end
|
93
|
-
# rubocop:enable Lint/DuplicateBranch
|
94
|
-
|
95
|
-
value
|
96
99
|
end
|
97
100
|
|
98
101
|
# @api private
|
@@ -566,7 +566,8 @@ module EInvoiceAPI
|
|
566
566
|
#
|
567
567
|
# @return [Array(String, Enumerable<String>)]
|
568
568
|
private def encode_multipart_streaming(body)
|
569
|
-
|
569
|
+
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
|
570
|
+
boundary = SecureRandom.urlsafe_base64(46)
|
570
571
|
|
571
572
|
closing = []
|
572
573
|
strio = writable_enum do |y|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: e-invoice-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- e-invoice
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|