kintone_rb 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b8182c7791ee8596bf2bd0317ef11308369ed1f88e0958e8efc3bacecf20de3
4
- data.tar.gz: 1f9add3df139ff19c6cc5a967994be3592a38d4a088829b1bcd34f8d0f065be4
3
+ metadata.gz: 3ae5148c27456f95dacc5f1aa0883909b3afe14b5fed2577ba33106e34278ccc
4
+ data.tar.gz: 67d1a7e626dcf11bc501e298cef1f614c8eea4ad787df003a1f037566a57ed51
5
5
  SHA512:
6
- metadata.gz: 7c07ecaba30e8038b956705bca54a4a6a33ab260ca2c3af720891d238eb4f68a5980fd6e492797c197773871230346ba95b89279fad43ac521d0f716766e9a1d
7
- data.tar.gz: 502112ccc0c9e772e8827541939afbf87a30c5c3393be264b1f2492a34345ee64828ac14dfc293d1b35b14702de1325a0ff92c09cb8ab421e44c60aca14a548a
6
+ metadata.gz: 7351a9b86641a3df3fe8dd00c5627c941aba3ee186ed0ebd7f688a6b1d4f52023b1c2acb3e33d2462734713ffb4a34a24e1a79f040195b65be0fc0e0461b30b9
7
+ data.tar.gz: 9d96b497fd0688867b5e370694e3a9bd1a31536945110b8b0e67ce5520b4435a238c4c0626287bd78831866649f259fd768969708906c0262102096cbb20e3a7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 1.0.1
2
+
3
+ - fix developer site url (https://github.com/jue58/kintone/pull/16)
4
+ - Avoid circular require (https://github.com/jue58/kintone/pull/20)
5
+ - bulk request実行時のエラーレスポンスが取得できるように (https://github.com/jue58/kintone/pull/17)
6
+ - fix developer site url (https://github.com/jue58/kintone/pull/16)
7
+
1
8
  ## 1.0.0
2
9
 
3
10
  - Drop support faraday v1
data/README.md CHANGED
@@ -13,7 +13,7 @@ forked from [jue58/kintone](https://github.com/jue58/kintone)
13
13
  Add this line to your application's Gemfile:
14
14
 
15
15
  ```ruby
16
- gem 'kintone_rb', github: 'SonicGarden/kintone_rb'
16
+ gem 'kintone_rb'
17
17
  ```
18
18
 
19
19
  And then execute:
@@ -110,7 +110,7 @@ end
110
110
 
111
111
  operator symbol | query helper
112
112
  --- | ---
113
- = | field(:code) == other
113
+ == | field(:code) == other
114
114
  != | field(:code) != other
115
115
  > | field(:code) > other
116
116
  < | field(:code) < other
@@ -358,4 +358,4 @@ api.post(url, body) # => {"ids" => ["100","101"]}
358
358
  api.guest(1).record.get(8, 100)
359
359
  ```
360
360
 
361
- see also [kintone developers](http://developers.kintone.com/)
361
+ see also [kintone developers](https://developer.kintone.io/hc/en-us)
@@ -1,5 +1,4 @@
1
1
  require 'forwardable'
2
- require 'kintone/api'
3
2
  require 'kintone/command/accessor'
4
3
 
5
4
  class Kintone::Api
@@ -2,6 +2,9 @@ class Kintone::KintoneError < StandardError
2
2
  attr_reader :message_text, :id, :code, :http_status, :errors
3
3
 
4
4
  def initialize(messages, http_status)
5
+ if messages.is_a?(Hash) && messages.has_key?('results')
6
+ messages = messages['results'].find { |message| message.has_key?('message') }
7
+ end
5
8
  @message_text = messages['message']
6
9
  @id = messages['id']
7
10
  @code = messages['code']
@@ -1,3 +1,3 @@
1
1
  module Kintone
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
@@ -89,5 +89,55 @@ describe Kintone::KintoneError do
89
89
  it { is_expected.to eq '必須です。' }
90
90
  end
91
91
  end
92
+
93
+ context 'bulk requestでValidation Errorが発生した場合' do
94
+ let(:messages) do
95
+ {
96
+ 'results' =>
97
+ [
98
+ {
99
+ "code" => "CB_VA01",
100
+ "id" => "49ZYc7Nv0dbvJ7N4lVEu",
101
+ "message" => "入力内容が正しくありません。",
102
+ "errors" => {
103
+ "record.取消"=> {
104
+ "messages"=>["必須です。"]
105
+ }
106
+ }
107
+ },
108
+ {}
109
+ ]
110
+ }
111
+ end
112
+
113
+ let(:http_status) { 400 }
114
+
115
+ it { is_expected.to eq '400 [CB_VA01] 入力内容が正しくありません。(49ZYc7Nv0dbvJ7N4lVEu)' }
116
+
117
+ describe '#message_text' do
118
+ subject { target.message_text }
119
+ it { is_expected.to eq '入力内容が正しくありません。' }
120
+ end
121
+
122
+ describe '#id' do
123
+ subject { target.id }
124
+ it { is_expected.to eq '49ZYc7Nv0dbvJ7N4lVEu' }
125
+ end
126
+
127
+ describe '#code' do
128
+ subject { target.code }
129
+ it { is_expected.to eq 'CB_VA01' }
130
+ end
131
+
132
+ describe '#http_status' do
133
+ subject { target.http_status }
134
+ it { is_expected.to eq 400 }
135
+ end
136
+
137
+ describe '#errors' do
138
+ subject { target.errors['record.取消']['messages'].first }
139
+ it { is_expected.to eq '必須です。' }
140
+ end
141
+ end
92
142
  end
93
143
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kintone_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - aki77
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-24 00:00:00.000000000 Z
11
+ date: 2022-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday