onlyoffice_api 0.7 → 0.8.0

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: 1830c70d5adb88be136ed8754fbab4237f09215af5044e0c7fc19b595ee9b7a2
4
- data.tar.gz: 58be0866eede5603be83fd7fcb2e6dc0ea91240c168ef7d2d64640e83f80688b
3
+ metadata.gz: 80712a1d13121fa312863177086da1018235ddf74353beb7d92e9b76f76f0b90
4
+ data.tar.gz: 5fcf364edb2a54f340ea760f8d1577eafc1e7fb890ca2149512d920589a46c96
5
5
  SHA512:
6
- metadata.gz: 0ccb2919484583fee863be395d0cfa34149e4c8264cb2abd1d665dfcac939a8b6992a11586792693129efd4de9d082749a1048bfbefe656390e004d4079bdb6d
7
- data.tar.gz: 5069dc9a84c740ee1888c3950cb93bc4d10ea8643d3a176ae91bce70855f9b80950500b31b34632f9b02baac393bfee563a26d5e7af6df7820afc5dcf51678ae
6
+ metadata.gz: 62375a210771f5eedd6e8cd9b0143df8f7f8dbcadb521c0166b159479addaac997b7fadff391b89f7aa2878cb4cebbfcc720d5c3907407967aad5b1e9312d8a3
7
+ data.tar.gz: eff718e4e4be80b25eb6e9a850ec9507dd98c29a37bad80746e758b60f8666651dc6e7609582101b489ad175dd28f3b088607fa0a51b252745c7f10a4d2d53ff
@@ -14,6 +14,7 @@ require_relative 'teamlab/modules/crm'
14
14
  require_relative 'teamlab/modules/community'
15
15
  require_relative 'teamlab/modules/calendar'
16
16
  require_relative 'teamlab/modules/mail'
17
+ require_relative 'teamlab/modules/mailserver'
17
18
  require_relative 'teamlab/modules/feed'
18
19
 
19
20
  module Teamlab
@@ -57,6 +58,10 @@ module Teamlab
57
58
  @mail ||= Teamlab::Mail.new
58
59
  end
59
60
 
61
+ def self.mailserver
62
+ @mailserver ||= Teamlab::MailServer.new
63
+ end
64
+
60
65
  def self.feed
61
66
  @feed ||= Teamlab::Feed.new
62
67
  end
@@ -5,9 +5,9 @@ require_relative 'request'
5
5
  module Teamlab
6
6
  attr_reader :config
7
7
 
8
- def self.configure(&_block)
8
+ def self.configure(&block)
9
9
  @config ||= Config.new
10
- yield @config if block_given?
10
+ yield @config if block
11
11
  auth_response = Teamlab::Request.new('authentication').post('', userName: @config.username, password: @config.password).body
12
12
  raise "Cannot get response token for #{auth_response}" if auth_response['response'].nil? || auth_response['response']['token'].nil?
13
13
 
@@ -28,7 +28,7 @@ module Teamlab
28
28
  end
29
29
 
30
30
  def get_bookmarks_by_tag(tag)
31
- @request.get(['bookmark', 'tag', tag.to_s])
31
+ @request.get(['bookmark', "bytag?tag=#{tag.to_s.gsub(' ', '%20')}"])
32
32
  end
33
33
 
34
34
  def get_recently_added_bookmarks
@@ -62,7 +62,6 @@ module Teamlab
62
62
  end
63
63
 
64
64
  def update_invoice(id, options = {})
65
- options[:id] = id
66
65
  @request.put(['invoice', id.to_s], options)
67
66
  end
68
67
 
@@ -83,7 +82,6 @@ module Teamlab
83
82
  end
84
83
 
85
84
  def update_invoice_line(invoice_line_id, invoice_id, options = {})
86
- options[:id] = invoice_line_id
87
85
  options[:invoiceId] = invoice_id
88
86
  @request.put(['invoiceline', invoice_line_id], options)
89
87
  end
@@ -111,7 +109,7 @@ module Teamlab
111
109
  end
112
110
 
113
111
  def delete_invoice_line(id)
114
- @request.delete(['invoiceline', id.to_s], id: id)
112
+ @request.delete(['invoiceline', id.to_s])
115
113
  end
116
114
 
117
115
  # @param invoice_item_id [Integer] id of invoice
@@ -28,5 +28,10 @@ module Teamlab
28
28
  def initialize
29
29
  @request = Teamlab::Request.new('mail')
30
30
  end
31
+
32
+ # @return [Teamlab::Response] Returns all Mail running operations (only complex)
33
+ def operations
34
+ @request.get(%w[operations])
35
+ end
31
36
  end
32
37
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'mailserver/domains'
4
+ require_relative 'mailserver/mailboxes'
5
+
6
+ module Teamlab
7
+ # API for MailServer api namespace
8
+ # For example
9
+ # https://api.onlyoffice.com/portals/section/mailserver/addressdata
10
+ class MailServer
11
+ include MailserverDomains
12
+ include MailserverMailboxes
13
+
14
+ def initialize
15
+ @request = Teamlab::Request.new('mailserver')
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Teamlab
4
+ # Methods for working with mailserver domains
5
+ module MailserverDomains
6
+ # @return [Hash] Returns list of the web domains associated with tenant
7
+ def tenant_domain_list
8
+ @request.get(%w[domains get])
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Teamlab
4
+ # Methods for working with mailserver mailboxes
5
+ module MailserverMailboxes
6
+ # @param name [String] name of mailbox
7
+ # @param local_part [String] local part of mailbox
8
+ # @param domain_id [Integer] id of domain
9
+ # @param user_id [Integer] id of user
10
+ # @param notify_current [True, False] Send message to creating mailbox's address
11
+ # @param notify_profile [True, False] Send message to email from user profile
12
+ # @return [Hash] Add mailbox
13
+ def add_mailbox(name: nil,
14
+ local_part: nil,
15
+ domain_id: nil,
16
+ user_id: nil,
17
+ notify_current: true,
18
+ notify_profile: true)
19
+ @request.post(%w[mailboxes add],
20
+ name: name,
21
+ local_part: local_part,
22
+ domain_id: domain_id,
23
+ user_id: user_id,
24
+ notifyCurrent: notify_current,
25
+ notifyProfile: notify_profile)
26
+ end
27
+
28
+ # @return [Hash] mailboxes list
29
+ def mailboxes
30
+ @request.get(%w[mailboxes get])
31
+ end
32
+
33
+ # Deletes the selected mailbox
34
+ # @param id [Integer] id of mailbox
35
+ # @return [Hash] result of mailbox deletion
36
+ def delete_mailbox(id)
37
+ @request.delete(['mailboxes', 'remove', id.to_s])
38
+ end
39
+ end
40
+ end
@@ -54,7 +54,7 @@ module Teamlab
54
54
  end
55
55
 
56
56
  def parse_args(args, type)
57
- command = args.first.instance_of?(Array) ? '/' + args.shift.join('/') : args.shift.to_s
57
+ command = args.first.instance_of?(Array) ? "/#{args.shift.join('/')}" : args.shift.to_s
58
58
  opts = {}
59
59
  opts[:body] = args.last.instance_of?(Hash) ? args.pop : {}
60
60
  opts[:body].delete_if { |_key, value| value == [] }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Teamlab
4
- VERSION = '0.7'
4
+ VERSION = '0.8.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onlyoffice_api
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-04-30 00:00:00.000000000 Z
14
+ date: 2021-03-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: httparty
@@ -27,20 +27,146 @@ dependencies:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0.16'
30
+ - !ruby/object:Gem::Dependency
31
+ name: codecov
32
+ requirement: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - "~>"
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ - !ruby/object:Gem::Dependency
45
+ name: faker
46
+ requirement: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - "~>"
49
+ - !ruby/object:Gem::Version
50
+ version: '2'
51
+ type: :development
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '2'
58
+ - !ruby/object:Gem::Dependency
59
+ name: overcommit
60
+ requirement: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - "~>"
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
30
72
  - !ruby/object:Gem::Dependency
31
73
  name: rake
32
74
  requirement: !ruby/object:Gem::Requirement
33
75
  requirements:
34
76
  - - "~>"
35
77
  - !ruby/object:Gem::Version
36
- version: '13.0'
78
+ version: '13'
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: '13'
86
+ - !ruby/object:Gem::Dependency
87
+ name: rspec
88
+ requirement: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - "~>"
91
+ - !ruby/object:Gem::Version
92
+ version: '3'
93
+ type: :development
94
+ prerelease: false
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '3'
100
+ - !ruby/object:Gem::Dependency
101
+ name: rubocop
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 0.49.0
107
+ type: :development
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: 0.49.0
114
+ - !ruby/object:Gem::Dependency
115
+ name: rubocop-performance
116
+ requirement: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - "~>"
119
+ - !ruby/object:Gem::Version
120
+ version: '1'
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - "~>"
126
+ - !ruby/object:Gem::Version
127
+ version: '1'
128
+ - !ruby/object:Gem::Dependency
129
+ name: rubocop-rake
130
+ requirement: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ type: :development
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: rubocop-rspec
144
+ requirement: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - "~>"
147
+ - !ruby/object:Gem::Version
148
+ version: '2'
37
149
  type: :development
38
150
  prerelease: false
39
151
  version_requirements: !ruby/object:Gem::Requirement
40
152
  requirements:
41
153
  - - "~>"
42
154
  - !ruby/object:Gem::Version
43
- version: '13.0'
155
+ version: '2'
156
+ - !ruby/object:Gem::Dependency
157
+ name: yard
158
+ requirement: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: 0.9.20
163
+ type: :development
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: 0.9.20
44
170
  description: Ruby Framework to interact with OnlyOffice API 2.0
45
171
  email:
46
172
  - rzagudaev@gmail.com
@@ -87,6 +213,9 @@ files:
87
213
  - lib/teamlab/modules/mail/mail_settings.rb
88
214
  - lib/teamlab/modules/mail/mail_signature.rb
89
215
  - lib/teamlab/modules/mail/mail_tags.rb
216
+ - lib/teamlab/modules/mailserver.rb
217
+ - lib/teamlab/modules/mailserver/domains.rb
218
+ - lib/teamlab/modules/mailserver/mailboxes.rb
90
219
  - lib/teamlab/modules/people.rb
91
220
  - lib/teamlab/modules/people/people_reassign.rb
92
221
  - lib/teamlab/modules/portals.rb
@@ -126,14 +255,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
255
  requirements:
127
256
  - - ">="
128
257
  - !ruby/object:Gem::Version
129
- version: '0'
258
+ version: '2.5'
130
259
  required_rubygems_version: !ruby/object:Gem::Requirement
131
260
  requirements:
132
261
  - - ">="
133
262
  - !ruby/object:Gem::Version
134
263
  version: '0'
135
264
  requirements: []
136
- rubygems_version: 3.1.2
265
+ rubygems_version: 3.2.14
137
266
  signing_key:
138
267
  specification_version: 4
139
268
  summary: Ruby gem for OnlyOffice. Formerly known as `teamlab`.