kintone_rb 1.0.0 → 1.0.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 +7 -0
- data/README.md +3 -3
- data/lib/kintone/api/guest.rb +0 -1
- data/lib/kintone/kintone_error.rb +3 -0
- data/lib/kintone/version.rb +1 -1
- data/spec/kintone/kintone_error_spec.rb +50 -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: 3ae5148c27456f95dacc5f1aa0883909b3afe14b5fed2577ba33106e34278ccc
         | 
| 4 | 
            +
              data.tar.gz: 67d1a7e626dcf11bc501e298cef1f614c8eea4ad787df003a1f037566a57ed51
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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' | 
| 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 | 
            -
             | 
| 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]( | 
| 361 | 
            +
            see also [kintone developers](https://developer.kintone.io/hc/en-us)
         | 
    
        data/lib/kintone/api/guest.rb
    CHANGED
    
    
| @@ -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']
         | 
    
        data/lib/kintone/version.rb
    CHANGED
    
    
| @@ -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. | 
| 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- | 
| 11 | 
            +
            date: 2022-06-28 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: faraday
         |