nexus-invision 1.3.0 → 1.4.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: 9dfc03f743220a4f2ae8fb6b2fd755c63e49ea095df92cf474412bc9990ccf0f
4
- data.tar.gz: 2fe6a5cce6d8c3f85977e104c403fbb523f57be436bbe03e50987289d2bdaa59
3
+ metadata.gz: bb7f4dd7508c2bf74120eba302eb5ef420fc6addc1311a5a1724a276dfa9800f
4
+ data.tar.gz: e310ad149e4dbf3266317bdcd5de47c629f9b72efa3529e158d0cec482766cc7
5
5
  SHA512:
6
- metadata.gz: cd77093c767ee079d39b39ca7afc108c2fb381ba0098d0d0268236ece92b0c1cd62bffec97210597704858f8a9f4c46ba70a7e454e426a1c7acfa1035da48c65
7
- data.tar.gz: 68693f8c5081158012e7bc89ccbf0764909a60779404c4fff2da5c965d5f32b0ab1a31f6000fba256df4448d274b1ce954c7e4f7b765cf6c9012ac9e1bd55a63
6
+ metadata.gz: 7e6993e879605622f22b5c1d379324314e83dd52d017f07c420e25f6fcec4885abeac2f82b78b6fe6b9309639d10030ae1e64e549b1a3addb8a258bf36bd3a5f
7
+ data.tar.gz: c673134f613edd339ceb8e1d721d8a487b9ba305ef71f26ffa9e21f56db492291d2bc08d21013b7c181e15dc61a2585a7103ad5f2f620c48c484f07e9adabfb2
@@ -8,11 +8,14 @@ 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/list_forum_topics"
12
- require "nexus/invision/requests/remove_member_from_secondary_group"
13
11
  require "nexus/invision/requests/delete_member"
14
12
  require "nexus/invision/requests/edit_member"
13
+ require "nexus/invision/requests/list_forum_topics"
14
+ require "nexus/invision/requests/remove_member_from_secondary_group"
15
+ require "nexus/invision/requests/edit_member_primary_group"
16
+ require "nexus/invision/resources/group"
15
17
  require "nexus/invision/resources/login_link"
18
+ require "nexus/invision/resources/member"
16
19
  require "nexus/invision/resources/page"
17
20
  require "nexus/invision/resources/post"
18
21
  require "nexus/invision/resources/topic"
@@ -112,6 +115,26 @@ module Nexus
112
115
  Resources::LoginLink.from_hash(response.body)
113
116
  end
114
117
 
118
+ sig { params(nexusmods_member_id: Integer).returns(Resources::Member) }
119
+ def get_member(nexusmods_member_id)
120
+ response = request(
121
+ http_method: HTTPMethod::GET,
122
+ endpoint: URI("core/members/#{nexusmods_member_id}"),
123
+ )
124
+
125
+ Resources::Member.from_hash(response.body)
126
+ end
127
+
128
+ sig { params(request: Requests::EditMemberPrimaryGroup).returns(Resources::Member) }
129
+ def edit_member_primary_group(request)
130
+ response = request(
131
+ http_method: HTTPMethod::POST,
132
+ endpoint: URI("core/members/#{request.member_id}"),
133
+ params: request.serialize.except("member_id"),
134
+ )
135
+ Resources::Member.from_hash(response.body)
136
+ end
137
+
115
138
  sig { params(request: Requests::AddMemberToSecondaryGroup).returns(Resources::User) }
116
139
  def add_member_to_secondary_group(request)
117
140
  response = request(
@@ -166,8 +189,7 @@ module Nexus
166
189
  sig { params(request: Requests::DeleteMember).void }
167
190
  def delete_member(request)
168
191
  # 1 is keep member name, 0 is anonymize content
169
- values = request.serialize.except("member_id")
170
- .merge({ "contentAnonymize" => request.keep_member_name ? 1 : 0 })
192
+ values = request.serialize.except("member_id").merge({ "contentAnonymize" => request.keep_member_name ? 1 : 0 })
171
193
  request(
172
194
  http_method: HTTPMethod::DELETE,
173
195
  endpoint: URI("core/members/#{request.member_id}"),
@@ -0,0 +1,18 @@
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 EditMemberPrimaryGroup < T::Struct
11
+ include ValueObject
12
+
13
+ const :member_id, Integer
14
+ const :group, Integer
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
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 Resources
10
+ class Group < T::Struct
11
+ include ValueObject
12
+
13
+ const :id, Integer
14
+ const :name, String
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
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 Resources
10
+ # Member is a User with additional information about their membership.
11
+ class Member < T::Struct
12
+ include ValueObject
13
+
14
+ const :id, Integer
15
+ const :primaryGroup, Group
16
+ end
17
+ end
18
+ end
19
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Nexus
5
5
  module Invision
6
- # Leave this as 1.3.0 in order for CI process to replace with the tagged version.
7
- VERSION = "1.3.0"
6
+ # Leave this as 1.4.0 in order for CI process to replace with the tagged version.
7
+ VERSION = "1.4.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.3.0
4
+ version: 1.4.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: 2023-11-14 00:00:00.000000000 Z
11
+ date: 2023-12-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -32,9 +32,12 @@ files:
32
32
  - lib/nexus/invision/requests/create_member_warning.rb
33
33
  - lib/nexus/invision/requests/delete_member.rb
34
34
  - lib/nexus/invision/requests/edit_member.rb
35
+ - lib/nexus/invision/requests/edit_member_primary_group.rb
35
36
  - lib/nexus/invision/requests/list_forum_topics.rb
36
37
  - lib/nexus/invision/requests/remove_member_from_secondary_group.rb
38
+ - lib/nexus/invision/resources/group.rb
37
39
  - lib/nexus/invision/resources/login_link.rb
40
+ - lib/nexus/invision/resources/member.rb
38
41
  - lib/nexus/invision/resources/page.rb
39
42
  - lib/nexus/invision/resources/post.rb
40
43
  - lib/nexus/invision/resources/topic.rb