e-invoice-api 0.2.3 → 0.2.5
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 +23 -0
- data/README.md +1 -1
- data/lib/e_invoice_api/internal/transport/base_client.rb +1 -1
- data/lib/e_invoice_api/internal/type/array_of.rb +1 -0
- data/lib/e_invoice_api/internal/type/base_model.rb +3 -1
- data/lib/e_invoice_api/internal/type/converter.rb +27 -0
- data/lib/e_invoice_api/internal/type/hash_of.rb +1 -0
- data/lib/e_invoice_api/internal/type/union.rb +9 -7
- data/lib/e_invoice_api/models/unit_of_measure_code.rb +1 -0
- data/lib/e_invoice_api/version.rb +1 -1
- data/rbi/e_invoice_api/internal/transport/base_client.rbi +1 -1
- data/rbi/e_invoice_api/internal/type/converter.rbi +54 -0
- data/rbi/e_invoice_api/internal/type/union.rbi +9 -2
- data/rbi/e_invoice_api/models/unit_of_measure_code.rbi +1 -0
- data/sig/e_invoice_api/internal/transport/base_client.rbs +1 -1
- data/sig/e_invoice_api/internal/type/converter.rbs +17 -0
- data/sig/e_invoice_api/internal/type/union.rbs +2 -2
- data/sig/e_invoice_api/models/unit_of_measure_code.rbs +2 -0
- 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: de3c2c283c888eb3c50885da33575dc4070f649a689eb741d9c917ea8e8f004a
|
4
|
+
data.tar.gz: 4da6fcc80fb668994728e7a9531b43e054d7517e3e33581e24d1de1aeaaa67bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 234a03ed2d3bf8444ee4167e2bd3a893f666f623bc8e151d847dd69da23eb5509a68c96781bd96f292807e59e3cef542bb260c49d3462807f2ece7f8a8bf2bcc
|
7
|
+
data.tar.gz: d40f8165cf96375f069483fd753272ebdcc06e740b7e4e7798a062b11eedf930d1fdf13e2aadb701f9a57e9c0aea2bc40925b606c6377948cf88d7fa027b6447
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.2.5 (2025-08-10)
|
4
|
+
|
5
|
+
Full Changelog: [v0.2.4...v0.2.5](https://github.com/e-invoice-be/e-invoice-rb/compare/v0.2.4...v0.2.5)
|
6
|
+
|
7
|
+
### Chores
|
8
|
+
|
9
|
+
* collect metadata from type DSL ([65e6d57](https://github.com/e-invoice-be/e-invoice-rb/commit/65e6d57250407fbd6e9db60bdd42c9ebed56d53f))
|
10
|
+
* **internal:** update comment in script ([576f84b](https://github.com/e-invoice-be/e-invoice-rb/commit/576f84bd8d42b7cb793bc4a27cfe5dec0a11bc91))
|
11
|
+
* update @stainless-api/prism-cli to v5.15.0 ([dbf02d8](https://github.com/e-invoice-be/e-invoice-rb/commit/dbf02d8bbfe18ea6a6dfb22d1affac4de7b56a29))
|
12
|
+
|
13
|
+
## 0.2.4 (2025-08-08)
|
14
|
+
|
15
|
+
Full Changelog: [v0.2.3...v0.2.4](https://github.com/e-invoice-be/e-invoice-rb/compare/v0.2.3...v0.2.4)
|
16
|
+
|
17
|
+
### Features
|
18
|
+
|
19
|
+
* **api:** api update ([e4a4f0c](https://github.com/e-invoice-be/e-invoice-rb/commit/e4a4f0c4ed0bbbd6e48756b992c37dc84511d378))
|
20
|
+
|
21
|
+
|
22
|
+
### Chores
|
23
|
+
|
24
|
+
* **internal:** increase visibility of internal helper method ([ada75de](https://github.com/e-invoice-be/e-invoice-rb/commit/ada75de190ee5689ac623187ea89d917820beb8c))
|
25
|
+
|
3
26
|
## 0.2.3 (2025-07-29)
|
4
27
|
|
5
28
|
Full Changelog: [v0.2.2...v0.2.3](https://github.com/e-invoice-be/e-invoice-rb/compare/v0.2.2...v0.2.3)
|
data/README.md
CHANGED
@@ -365,7 +365,7 @@ module EInvoiceAPI
|
|
365
365
|
#
|
366
366
|
# @raise [EInvoiceAPI::Errors::APIError]
|
367
367
|
# @return [Array(Integer, Net::HTTPResponse, Enumerable<String>)]
|
368
|
-
|
368
|
+
def send_request(request, redirect_count:, retry_count:, send_retry_header:)
|
369
369
|
url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout)
|
370
370
|
input = {**request.except(:timeout), deadline: EInvoiceAPI::Internal::Util.monotonic_secs + timeout}
|
371
371
|
|
@@ -148,6 +148,7 @@ module EInvoiceAPI
|
|
148
148
|
# @option spec [Boolean] :"nil?"
|
149
149
|
def initialize(type_info, spec = {})
|
150
150
|
@item_type_fn = EInvoiceAPI::Internal::Type::Converter.type_info(type_info || spec)
|
151
|
+
@meta = EInvoiceAPI::Internal::Type::Converter.meta_info(type_info, spec)
|
151
152
|
@nilable = spec.fetch(:nil?, false)
|
152
153
|
end
|
153
154
|
|
@@ -52,6 +52,7 @@ module EInvoiceAPI
|
|
52
52
|
#
|
53
53
|
# @option spec [Boolean] :"nil?"
|
54
54
|
private def add_field(name_sym, required:, type_info:, spec:)
|
55
|
+
meta = EInvoiceAPI::Internal::Type::Converter.meta_info(type_info, spec)
|
55
56
|
type_fn, info =
|
56
57
|
case type_info
|
57
58
|
in Proc | EInvoiceAPI::Internal::Type::Converter | Class
|
@@ -81,7 +82,8 @@ module EInvoiceAPI
|
|
81
82
|
required: required,
|
82
83
|
nilable: nilable,
|
83
84
|
const: const,
|
84
|
-
type_fn: type_fn
|
85
|
+
type_fn: type_fn,
|
86
|
+
meta: meta
|
85
87
|
}
|
86
88
|
|
87
89
|
define_method(setter) do |value|
|
@@ -98,6 +98,33 @@ module EInvoiceAPI
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
+
# @api private
|
102
|
+
#
|
103
|
+
# @param type_info [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class] .
|
104
|
+
#
|
105
|
+
# @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
106
|
+
#
|
107
|
+
# @option type_info [Proc] :enum
|
108
|
+
#
|
109
|
+
# @option type_info [Proc] :union
|
110
|
+
#
|
111
|
+
# @option type_info [Boolean] :"nil?"
|
112
|
+
#
|
113
|
+
# @param spec [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class] .
|
114
|
+
#
|
115
|
+
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
116
|
+
#
|
117
|
+
# @option spec [Proc] :enum
|
118
|
+
#
|
119
|
+
# @option spec [Proc] :union
|
120
|
+
#
|
121
|
+
# @option spec [Boolean] :"nil?"
|
122
|
+
#
|
123
|
+
# @return [Hash{Symbol=>Object}]
|
124
|
+
def meta_info(type_info, spec)
|
125
|
+
[spec, type_info].grep(Hash).first.to_h.except(:const, :enum, :union, :nil?)
|
126
|
+
end
|
127
|
+
|
101
128
|
# @api private
|
102
129
|
#
|
103
130
|
# @param translate_names [Boolean]
|
@@ -168,6 +168,7 @@ module EInvoiceAPI
|
|
168
168
|
# @option spec [Boolean] :"nil?"
|
169
169
|
def initialize(type_info, spec = {})
|
170
170
|
@item_type_fn = EInvoiceAPI::Internal::Type::Converter.type_info(type_info || spec)
|
171
|
+
@meta = EInvoiceAPI::Internal::Type::Converter.meta_info(type_info, spec)
|
171
172
|
@nilable = spec.fetch(:nil?, false)
|
172
173
|
end
|
173
174
|
|
@@ -12,20 +12,20 @@ module EInvoiceAPI
|
|
12
12
|
#
|
13
13
|
# All of the specified variant info for this union.
|
14
14
|
#
|
15
|
-
# @return [Array<Array(Symbol, Proc)>]
|
15
|
+
# @return [Array<Array(Symbol, Proc, Hash{Symbol=>Object})>]
|
16
16
|
private def known_variants = (@known_variants ||= [])
|
17
17
|
|
18
18
|
# @api private
|
19
19
|
#
|
20
|
-
# @return [Array<Array(Symbol, Object)>]
|
20
|
+
# @return [Array<Array(Symbol, Object, Hash{Symbol=>Object})>]
|
21
21
|
protected def derefed_variants
|
22
|
-
known_variants.map { |key, variant_fn| [key, variant_fn.call] }
|
22
|
+
known_variants.map { |key, variant_fn, meta| [key, variant_fn.call, meta] }
|
23
23
|
end
|
24
24
|
|
25
25
|
# All of the specified variants for this union.
|
26
26
|
#
|
27
27
|
# @return [Array<Object>]
|
28
|
-
def variants = derefed_variants.map
|
28
|
+
def variants = derefed_variants.map { _2 }
|
29
29
|
|
30
30
|
# @api private
|
31
31
|
#
|
@@ -51,12 +51,13 @@ module EInvoiceAPI
|
|
51
51
|
#
|
52
52
|
# @option spec [Boolean] :"nil?"
|
53
53
|
private def variant(key, spec = nil)
|
54
|
+
meta = EInvoiceAPI::Internal::Type::Converter.meta_info(nil, spec)
|
54
55
|
variant_info =
|
55
56
|
case key
|
56
57
|
in Symbol
|
57
|
-
[key, EInvoiceAPI::Internal::Type::Converter.type_info(spec)]
|
58
|
+
[key, EInvoiceAPI::Internal::Type::Converter.type_info(spec), meta]
|
58
59
|
in Proc | EInvoiceAPI::Internal::Type::Converter | Class | Hash
|
59
|
-
[nil, EInvoiceAPI::Internal::Type::Converter.type_info(key)]
|
60
|
+
[nil, EInvoiceAPI::Internal::Type::Converter.type_info(key), meta]
|
60
61
|
end
|
61
62
|
|
62
63
|
known_variants << variant_info
|
@@ -79,7 +80,8 @@ module EInvoiceAPI
|
|
79
80
|
return nil if key == EInvoiceAPI::Internal::OMIT
|
80
81
|
|
81
82
|
key = key.to_sym if key.is_a?(String)
|
82
|
-
known_variants.find { |k,| k == key }
|
83
|
+
_, found = known_variants.find { |k,| k == key }
|
84
|
+
found&.call
|
83
85
|
else
|
84
86
|
nil
|
85
87
|
end
|
@@ -90,6 +90,60 @@ module EInvoiceAPI
|
|
90
90
|
def self.type_info(spec)
|
91
91
|
end
|
92
92
|
|
93
|
+
# @api private
|
94
|
+
sig do
|
95
|
+
params(
|
96
|
+
type_info:
|
97
|
+
T.any(
|
98
|
+
{
|
99
|
+
const:
|
100
|
+
T.nilable(
|
101
|
+
T.any(NilClass, T::Boolean, Integer, Float, Symbol)
|
102
|
+
),
|
103
|
+
enum:
|
104
|
+
T.nilable(
|
105
|
+
T.proc.returns(
|
106
|
+
EInvoiceAPI::Internal::Type::Converter::Input
|
107
|
+
)
|
108
|
+
),
|
109
|
+
union:
|
110
|
+
T.nilable(
|
111
|
+
T.proc.returns(
|
112
|
+
EInvoiceAPI::Internal::Type::Converter::Input
|
113
|
+
)
|
114
|
+
)
|
115
|
+
},
|
116
|
+
T.proc.returns(EInvoiceAPI::Internal::Type::Converter::Input),
|
117
|
+
EInvoiceAPI::Internal::Type::Converter::Input
|
118
|
+
),
|
119
|
+
spec:
|
120
|
+
T.any(
|
121
|
+
{
|
122
|
+
const:
|
123
|
+
T.nilable(
|
124
|
+
T.any(NilClass, T::Boolean, Integer, Float, Symbol)
|
125
|
+
),
|
126
|
+
enum:
|
127
|
+
T.nilable(
|
128
|
+
T.proc.returns(
|
129
|
+
EInvoiceAPI::Internal::Type::Converter::Input
|
130
|
+
)
|
131
|
+
),
|
132
|
+
union:
|
133
|
+
T.nilable(
|
134
|
+
T.proc.returns(
|
135
|
+
EInvoiceAPI::Internal::Type::Converter::Input
|
136
|
+
)
|
137
|
+
)
|
138
|
+
},
|
139
|
+
T.proc.returns(EInvoiceAPI::Internal::Type::Converter::Input),
|
140
|
+
EInvoiceAPI::Internal::Type::Converter::Input
|
141
|
+
)
|
142
|
+
).returns(EInvoiceAPI::Internal::AnyHash)
|
143
|
+
end
|
144
|
+
def self.meta_info(type_info, spec)
|
145
|
+
end
|
146
|
+
|
93
147
|
# @api private
|
94
148
|
sig do
|
95
149
|
params(translate_names: T::Boolean).returns(
|
@@ -16,7 +16,8 @@ module EInvoiceAPI
|
|
16
16
|
T::Array[
|
17
17
|
[
|
18
18
|
T.nilable(Symbol),
|
19
|
-
T.proc.returns(EInvoiceAPI::Internal::Type::Converter::Input)
|
19
|
+
T.proc.returns(EInvoiceAPI::Internal::Type::Converter::Input),
|
20
|
+
EInvoiceAPI::Internal::AnyHash
|
20
21
|
]
|
21
22
|
]
|
22
23
|
)
|
@@ -25,7 +26,13 @@ module EInvoiceAPI
|
|
25
26
|
end
|
26
27
|
|
27
28
|
# @api private
|
28
|
-
sig
|
29
|
+
sig do
|
30
|
+
returns(
|
31
|
+
T::Array[
|
32
|
+
[T.nilable(Symbol), T.anything, EInvoiceAPI::Internal::AnyHash]
|
33
|
+
]
|
34
|
+
)
|
35
|
+
end
|
29
36
|
protected def derefed_variants
|
30
37
|
end
|
31
38
|
|
@@ -138,6 +138,7 @@ module EInvoiceAPI
|
|
138
138
|
ZZ = T.let(:ZZ, EInvoiceAPI::UnitOfMeasureCode::TaggedSymbol)
|
139
139
|
NAR = T.let(:NAR, EInvoiceAPI::UnitOfMeasureCode::TaggedSymbol)
|
140
140
|
C62 = T.let(:C62, EInvoiceAPI::UnitOfMeasureCode::TaggedSymbol)
|
141
|
+
LTR = T.let(:LTR, EInvoiceAPI::UnitOfMeasureCode::TaggedSymbol)
|
141
142
|
|
142
143
|
sig do
|
143
144
|
override.returns(T::Array[EInvoiceAPI::UnitOfMeasureCode::TaggedSymbol])
|
@@ -39,6 +39,23 @@ module EInvoiceAPI
|
|
39
39
|
| EInvoiceAPI::Internal::Type::Converter::input spec
|
40
40
|
) -> (^-> top)
|
41
41
|
|
42
|
+
def self.meta_info: (
|
43
|
+
{
|
44
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
45
|
+
enum: ^-> EInvoiceAPI::Internal::Type::Converter::input?,
|
46
|
+
union: ^-> EInvoiceAPI::Internal::Type::Converter::input?
|
47
|
+
}
|
48
|
+
| ^-> EInvoiceAPI::Internal::Type::Converter::input
|
49
|
+
| EInvoiceAPI::Internal::Type::Converter::input type_info,
|
50
|
+
{
|
51
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
52
|
+
enum: ^-> EInvoiceAPI::Internal::Type::Converter::input?,
|
53
|
+
union: ^-> EInvoiceAPI::Internal::Type::Converter::input?
|
54
|
+
}
|
55
|
+
| ^-> EInvoiceAPI::Internal::Type::Converter::input
|
56
|
+
| EInvoiceAPI::Internal::Type::Converter::input spec
|
57
|
+
) -> ::Hash[Symbol, top]
|
58
|
+
|
42
59
|
def self.new_coerce_state: (
|
43
60
|
?translate_names: bool
|
44
61
|
) -> EInvoiceAPI::Internal::Type::Converter::coerce_state
|
@@ -5,9 +5,9 @@ module EInvoiceAPI
|
|
5
5
|
include EInvoiceAPI::Internal::Type::Converter
|
6
6
|
include EInvoiceAPI::Internal::Util::SorbetRuntimeSupport
|
7
7
|
|
8
|
-
private def self.known_variants: -> ::Array[[Symbol?, (^-> EInvoiceAPI::Internal::Type::Converter::input)]]
|
8
|
+
private def self.known_variants: -> ::Array[[Symbol?, (^-> EInvoiceAPI::Internal::Type::Converter::input), ::Hash[Symbol, top]]]
|
9
9
|
|
10
|
-
def self.derefed_variants: -> ::Array[[Symbol?, top]]
|
10
|
+
def self.derefed_variants: -> ::Array[[Symbol?, top, ::Hash[Symbol, top]]]
|
11
11
|
|
12
12
|
def self.variants: -> ::Array[top]
|
13
13
|
|
@@ -91,6 +91,7 @@ module EInvoiceAPI
|
|
91
91
|
| :ZZ
|
92
92
|
| :NAR
|
93
93
|
| :C62
|
94
|
+
| :LTR
|
94
95
|
|
95
96
|
module UnitOfMeasureCode
|
96
97
|
extend EInvoiceAPI::Internal::Type::Enum
|
@@ -185,6 +186,7 @@ module EInvoiceAPI
|
|
185
186
|
ZZ: :ZZ
|
186
187
|
NAR: :NAR
|
187
188
|
C62: :C62
|
189
|
+
LTR: :LTR
|
188
190
|
|
189
191
|
def self?.values: -> ::Array[EInvoiceAPI::Models::unit_of_measure_code]
|
190
192
|
end
|
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.2.
|
4
|
+
version: 0.2.5
|
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-
|
11
|
+
date: 2025-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|