nexus-invision 1.7.0 → 1.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: dc3abfd481d2b5fdaa763ee984b827f3b09f9fc21ad027777b6c33967d5cd2c9
4
- data.tar.gz: 666880edfe82f85580442a03516fe358739061414a84cbbeaeba7f187e872b8c
3
+ metadata.gz: e12876cd9dc6575ac0a9381681df61604e7c0be30913ad9f0fef3d449342bd21
4
+ data.tar.gz: 6bdb6bd9fd8fa1f2d0feeb37f378d9bd16fe6aa714ed00fd00ae908a47c9cc49
5
5
  SHA512:
6
- metadata.gz: cb4abb4a20ef8ffa74d0fa8f5e0f1733f7362792092bb40948c84d6c8b2e7e6606a0a1a3d207844c2ddf2278249ec694167c33d660cafb3f9afba77fa867442c
7
- data.tar.gz: 119d8c6b8ee38f13bb151d04be07a69bd14e05c3f9f564ac2ccd2500b32184d4774834b0973e1144d4a1aa896d75b0673eab0e0e33cbba53e30818edb3948df9
6
+ metadata.gz: f8afae523606c24163b2a0f280dc5271da534512e1b5ba7f3d403b73406dd346fd0133164a6c6928536d17e2c4c21a9c24392b4d049654ab167bfd1faa0c7e18
7
+ data.tar.gz: bc0cfc1b124b1601f4e35423e3749e6a9d6ab2bd2a74c09a0af503c48890de8f6dc6dfce9cb4391994a2567a7e862e9ce7aaf00dcf7551a03eb347a64e298131
@@ -8,6 +8,7 @@ require "nexus/invision/requests/add_member_to_secondary_group"
8
8
  require "nexus/invision/requests/create_forum_post"
9
9
  require "nexus/invision/requests/create_forum_topic"
10
10
  require "nexus/invision/requests/create_member_warning"
11
+ require "nexus/invision/requests/create_message"
11
12
  require "nexus/invision/requests/delete_member"
12
13
  require "nexus/invision/requests/edit_member"
13
14
  require "nexus/invision/requests/list_forum_topics"
@@ -160,18 +161,26 @@ module Nexus
160
161
  response = request(
161
162
  http_method: HTTPMethod::GET,
162
163
  endpoint: URI("core/ensuremember/#{request.id}"),
163
- params: request.serialize,
164
+ params: request.serialize.except("id"),
164
165
  )
165
166
 
166
167
  Resources::EnsureMember.from_hash(response.body)
167
168
  end
168
169
 
170
+ sig { params(request: Requests::CreateMessage).void }
171
+ def create_message(request)
172
+ request(
173
+ http_method: HTTPMethod::POST,
174
+ endpoint: URI("core/messages"),
175
+ params: request.serialize,
176
+ )
177
+ end
178
+
169
179
  sig { params(request: Requests::UnreadCount).returns(Resources::UnreadCount) }
170
180
  def unread_count(request)
171
181
  response = request(
172
182
  http_method: HTTPMethod::GET,
173
183
  endpoint: URI("core/unreadcount/#{request.id}"),
174
- params: request.serialize,
175
184
  )
176
185
 
177
186
  Resources::UnreadCount.from_hash(response.body)
@@ -0,0 +1,31 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ require "nexus/invision/value_object"
5
+ require "sorbet-runtime"
6
+
7
+ module Nexus
8
+ module Invision
9
+ module Requests
10
+ class CreateMessage < T::Struct
11
+ extend T::Sig
12
+ include ValueObject
13
+
14
+ const :from, Integer
15
+ const :to, T::Array[Integer]
16
+ const :title, String
17
+ const :body, String
18
+
19
+ sig { override.returns(T::Hash[String, T.untyped]) }
20
+ def serialize
21
+ {
22
+ "from" => @from,
23
+ "to" => @to.map(&:to_s).join(","),
24
+ "title" => @title,
25
+ "body" => @body,
26
+ }
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Nexus
5
5
  module Invision
6
- # Leave this as 1.7.0 in order for CI process to replace with the tagged version.
7
- VERSION = "1.7.0"
6
+ # Leave this as 1.8.0 in order for CI process to replace with the tagged version.
7
+ VERSION = "1.8.0"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexus-invision
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Robertson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-07 00:00:00.000000000 Z
11
+ date: 2024-02-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -30,6 +30,7 @@ files:
30
30
  - lib/nexus/invision/requests/create_forum_post.rb
31
31
  - lib/nexus/invision/requests/create_forum_topic.rb
32
32
  - lib/nexus/invision/requests/create_member_warning.rb
33
+ - lib/nexus/invision/requests/create_message.rb
33
34
  - lib/nexus/invision/requests/delete_member.rb
34
35
  - lib/nexus/invision/requests/edit_member.rb
35
36
  - lib/nexus/invision/requests/edit_member_primary_group.rb