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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb7f4dd7508c2bf74120eba302eb5ef420fc6addc1311a5a1724a276dfa9800f
|
4
|
+
data.tar.gz: e310ad149e4dbf3266317bdcd5de47c629f9b72efa3529e158d0cec482766cc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
|
+
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
|