zendesk_help_center_api 0.4.1 → 0.5.0
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 +5 -5
- data/README.md +8 -8
- data/lib/ext/zendesk_api/client.rb +17 -0
- data/lib/zendesk_api/help_center/version.rb +5 -0
- data/lib/zendesk_api/help_center.rb +12 -10
- metadata +32 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7ed85475efb380d953a50bbee43795e0025174d2b27153244bbb1133e0c2258d
|
4
|
+
data.tar.gz: 0f6419e714506af213caf5b0f0004a5b9339b9da1e366647d1f7d7a72b69df31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0c39aadb7fcb668a7ab2f62f879310d9e9c547c1fc01f8d41f3e3b4ecc36a22529fd53cdcd9e533bc60703662052f01b31cd0e060682c4f09cf014654ab109f
|
7
|
+
data.tar.gz: 5a337093bf7c7d86854365002a7cf78b27f62b784ce2fc1ea0c7d45bfcb604056e9b15b92eef8495c8cf10337711b8f493b22f245ee8b7733b02bf54b9e8c31e
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@ This gem added support for [Zendesk Help Center](https://developer.zendesk.com/r
|
|
4
4
|
|
5
5
|
To experiment with that code, run `bin/console` for an interactive prompt.
|
6
6
|
|
7
|
-
|
8
7
|
## Installation
|
9
8
|
|
10
9
|
Add this line to your application's Gemfile:
|
@@ -15,14 +14,14 @@ gem 'zendesk_help_center_api'
|
|
15
14
|
|
16
15
|
And then execute:
|
17
16
|
|
18
|
-
```
|
19
|
-
|
17
|
+
```console
|
18
|
+
bundle
|
20
19
|
```
|
21
20
|
|
22
21
|
Or install it yourself as:
|
23
22
|
|
24
|
-
```
|
25
|
-
|
23
|
+
```console
|
24
|
+
gem install zendesk_help_center_api
|
26
25
|
```
|
27
26
|
|
28
27
|
## Usage
|
@@ -30,7 +29,8 @@ $ gem install zendesk_help_center_api
|
|
30
29
|
```ruby
|
31
30
|
require 'zendesk_api/help_center'
|
32
31
|
```
|
33
|
-
|
32
|
+
|
33
|
+
### Zendesk Client
|
34
34
|
|
35
35
|
```ruby
|
36
36
|
client = ZendeskAPI::Client.new do |config|
|
@@ -116,7 +116,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
116
116
|
|
117
117
|
## Contributing
|
118
118
|
|
119
|
-
1. Fork it (
|
119
|
+
1. Fork it (<https://github.com/mamantoha/zendesk_help_center_api_client_rb/fork>)
|
120
120
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
121
121
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
122
122
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -124,6 +124,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
124
124
|
|
125
125
|
## License and Author
|
126
126
|
|
127
|
-
Copyright: 2015-
|
127
|
+
Copyright: 2015-2019 [Anton Maminov](anton.maminov@gmail.com)
|
128
128
|
|
129
129
|
This project is licensed under the Apache License, a copy of which can be found in the LICENSE file.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'faraday_middleware'
|
2
|
+
|
3
|
+
module ZendeskAPI
|
4
|
+
class Client
|
5
|
+
# overwrite to follow redirections
|
6
|
+
# https://github.com/zendesk/zendesk_api_client_rb/blob/master/lib/zendesk_api/client.rb
|
7
|
+
def connection
|
8
|
+
@connection ||= build_connection
|
9
|
+
|
10
|
+
unless @connection.builder.handlers.include?(FaradayMiddleware::FollowRedirects)
|
11
|
+
@connection.builder.insert(0, FaradayMiddleware::FollowRedirects)
|
12
|
+
end
|
13
|
+
|
14
|
+
return @connection
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'zendesk_api'
|
2
|
+
require 'ext/zendesk_api/client'
|
3
|
+
require 'zendesk_api/help_center/version'
|
2
4
|
|
3
5
|
module ZendeskAPI
|
4
6
|
module HelpCenter
|
@@ -39,13 +41,13 @@ module ZendeskAPI
|
|
39
41
|
include Destroy
|
40
42
|
|
41
43
|
def initialize(client, attributes = {})
|
42
|
-
attributes[
|
44
|
+
attributes['category_id'] ||= attributes.delete('source_id')
|
43
45
|
super
|
44
46
|
end
|
45
47
|
|
46
48
|
def destroy!
|
47
49
|
super do |req|
|
48
|
-
req.path = @client.config.url +
|
50
|
+
req.path = @client.config.url + '/help_center/translations/' + id.to_s
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
@@ -63,13 +65,13 @@ module ZendeskAPI
|
|
63
65
|
include Destroy
|
64
66
|
|
65
67
|
def initialize(client, attributes = {})
|
66
|
-
attributes[
|
68
|
+
attributes['section_id'] ||= attributes.delete('source_id')
|
67
69
|
super
|
68
70
|
end
|
69
71
|
|
70
72
|
def destroy!
|
71
73
|
super do |req|
|
72
|
-
req.path = @client.config.url +
|
74
|
+
req.path = @client.config.url + '/help_center/translations/' + id.to_s
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
@@ -87,13 +89,13 @@ module ZendeskAPI
|
|
87
89
|
include Destroy
|
88
90
|
|
89
91
|
def initialize(client, attributes = {})
|
90
|
-
attributes[
|
92
|
+
attributes['article_id'] ||= attributes.delete('source_id')
|
91
93
|
super
|
92
94
|
end
|
93
95
|
|
94
96
|
def destroy!
|
95
97
|
super do |req|
|
96
|
-
req.path = @client.config.url +
|
98
|
+
req.path = @client.config.url + '/help_center/translations/' + id.to_s
|
97
99
|
end
|
98
100
|
end
|
99
101
|
|
@@ -104,14 +106,14 @@ module ZendeskAPI
|
|
104
106
|
end
|
105
107
|
|
106
108
|
class HcCategory < Resource
|
107
|
-
namespace
|
109
|
+
namespace 'help_center'
|
108
110
|
|
109
111
|
has_many Section
|
110
112
|
has_many Article
|
111
113
|
end
|
112
114
|
|
113
115
|
class Section < Resource
|
114
|
-
namespace
|
116
|
+
namespace 'help_center'
|
115
117
|
|
116
118
|
has HcCategory
|
117
119
|
has_many Article
|
@@ -125,7 +127,7 @@ module ZendeskAPI
|
|
125
127
|
end
|
126
128
|
|
127
129
|
class Article < Resource
|
128
|
-
namespace
|
130
|
+
namespace 'help_center'
|
129
131
|
|
130
132
|
has HcCategory
|
131
133
|
has Section
|
@@ -134,7 +136,7 @@ module ZendeskAPI
|
|
134
136
|
super do |req|
|
135
137
|
case req.method
|
136
138
|
when :post # create article
|
137
|
-
req.path = "help_center/sections/#{association.options[
|
139
|
+
req.path = "help_center/sections/#{association.options['parent'].id}/articles"
|
138
140
|
when :put # update article
|
139
141
|
# do nothing
|
140
142
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_help_center_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Maminov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zendesk_api
|
@@ -16,78 +16,82 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 1.13.4
|
19
|
+
version: '1.16'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '1.
|
30
|
-
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday_middleware
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.13'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
31
39
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
40
|
+
version: '0.13'
|
33
41
|
- !ruby/object:Gem::Dependency
|
34
42
|
name: bundler
|
35
43
|
requirement: !ruby/object:Gem::Requirement
|
36
44
|
requirements:
|
37
45
|
- - "~>"
|
38
46
|
- !ruby/object:Gem::Version
|
39
|
-
version: '1.
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 1.14.6
|
47
|
+
version: '1.17'
|
43
48
|
type: :development
|
44
49
|
prerelease: false
|
45
50
|
version_requirements: !ruby/object:Gem::Requirement
|
46
51
|
requirements:
|
47
52
|
- - "~>"
|
48
53
|
- !ruby/object:Gem::Version
|
49
|
-
version: '1.
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 1.14.6
|
54
|
+
version: '1.17'
|
53
55
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
56
|
+
name: pry
|
55
57
|
requirement: !ruby/object:Gem::Requirement
|
56
58
|
requirements:
|
57
59
|
- - "~>"
|
58
60
|
- !ruby/object:Gem::Version
|
59
|
-
version: '12
|
61
|
+
version: '0.12'
|
60
62
|
type: :development
|
61
63
|
prerelease: false
|
62
64
|
version_requirements: !ruby/object:Gem::Requirement
|
63
65
|
requirements:
|
64
66
|
- - "~>"
|
65
67
|
- !ruby/object:Gem::Version
|
66
|
-
version: '12
|
68
|
+
version: '0.12'
|
67
69
|
- !ruby/object:Gem::Dependency
|
68
|
-
name:
|
70
|
+
name: rake
|
69
71
|
requirement: !ruby/object:Gem::Requirement
|
70
72
|
requirements:
|
71
|
-
- - "
|
73
|
+
- - "~>"
|
72
74
|
- !ruby/object:Gem::Version
|
73
|
-
version: '0'
|
75
|
+
version: '12.0'
|
74
76
|
type: :development
|
75
77
|
prerelease: false
|
76
78
|
version_requirements: !ruby/object:Gem::Requirement
|
77
79
|
requirements:
|
78
|
-
- - "
|
80
|
+
- - "~>"
|
79
81
|
- !ruby/object:Gem::Version
|
80
|
-
version: '0'
|
82
|
+
version: '12.0'
|
81
83
|
description: Ruby wrapper for the REST API at http://www.zendesk.com. Documentation
|
82
84
|
at https://developer.zendesk.com/rest_api/docs/help_center/introduction.
|
83
85
|
email:
|
84
|
-
- anton.
|
86
|
+
- anton.maminov@gmail.com
|
85
87
|
executables: []
|
86
88
|
extensions: []
|
87
89
|
extra_rdoc_files: []
|
88
90
|
files:
|
89
91
|
- README.md
|
92
|
+
- lib/ext/zendesk_api/client.rb
|
90
93
|
- lib/zendesk_api/help_center.rb
|
94
|
+
- lib/zendesk_api/help_center/version.rb
|
91
95
|
homepage: https://github.com/mamantoha/zendesk_help_center_api_client_rb
|
92
96
|
licenses:
|
93
97
|
- Apache-2.0
|
@@ -100,15 +104,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
100
104
|
requirements:
|
101
105
|
- - ">="
|
102
106
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.
|
107
|
+
version: 2.2.0
|
104
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
109
|
requirements:
|
106
110
|
- - ">="
|
107
111
|
- !ruby/object:Gem::Version
|
108
112
|
version: '0'
|
109
113
|
requirements: []
|
110
|
-
|
111
|
-
rubygems_version: 2.6.13
|
114
|
+
rubygems_version: 3.0.1
|
112
115
|
signing_key:
|
113
116
|
specification_version: 4
|
114
117
|
summary: Zendesk Help Center REST API Client
|