w3c_api 0.1.0 → 0.1.2
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 +4 -4
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +40 -0
- data/LICENSE.md +1 -1
- data/README.adoc +1032 -439
- data/Rakefile +7 -3
- data/lib/w3c_api/cli.rb +20 -20
- data/lib/w3c_api/client.rb +57 -237
- data/lib/w3c_api/commands/affiliation.rb +33 -33
- data/lib/w3c_api/commands/ecosystem.rb +47 -47
- data/lib/w3c_api/commands/group.rb +68 -68
- data/lib/w3c_api/commands/output_formatter.rb +11 -11
- data/lib/w3c_api/commands/participation.rb +20 -22
- data/lib/w3c_api/commands/series.rb +26 -26
- data/lib/w3c_api/commands/specification.rb +77 -52
- data/lib/w3c_api/commands/translation.rb +18 -18
- data/lib/w3c_api/commands/user.rb +60 -60
- data/lib/w3c_api/hal.rb +294 -0
- data/lib/w3c_api/models/account.rb +46 -0
- data/lib/w3c_api/models/affiliation.rb +54 -65
- data/lib/w3c_api/models/affiliation_index.rb +11 -0
- data/lib/w3c_api/models/call_for_translation.rb +15 -39
- data/lib/w3c_api/models/chair_index.rb +11 -0
- data/lib/w3c_api/models/charter.rb +48 -89
- data/lib/w3c_api/models/charter_index.rb +11 -0
- data/lib/w3c_api/models/connected_account.rb +21 -30
- data/lib/w3c_api/models/ecosystem.rb +20 -42
- data/lib/w3c_api/models/{ecosystems.rb → ecosystem_index.rb} +4 -10
- data/lib/w3c_api/models/evangelist_index.rb +11 -0
- data/lib/w3c_api/models/extension.rb +5 -7
- data/lib/w3c_api/models/group.rb +63 -142
- data/lib/w3c_api/models/group_index.rb +12 -0
- data/lib/w3c_api/models/group_link_set.rb +24 -0
- data/lib/w3c_api/models/join_emails.rb +5 -7
- data/lib/w3c_api/models/participant_index.rb +11 -0
- data/lib/w3c_api/models/participation.rb +31 -90
- data/lib/w3c_api/models/participation_index.rb +11 -0
- data/lib/w3c_api/models/photo.rb +28 -0
- data/lib/w3c_api/models/serie.rb +21 -51
- data/lib/w3c_api/models/{series.rb → serie_index.rb} +22 -13
- data/lib/w3c_api/models/spec_version.rb +69 -83
- data/lib/w3c_api/models/spec_version_index.rb +14 -0
- data/lib/w3c_api/models/spec_version_ref.rb +11 -13
- data/lib/w3c_api/models/specification.rb +54 -66
- data/lib/w3c_api/models/specification_index.rb +12 -0
- data/lib/w3c_api/models/team_contact_index.rb +11 -0
- data/lib/w3c_api/models/testimonial.rb +19 -0
- data/lib/w3c_api/models/translation.rb +33 -72
- data/lib/w3c_api/models/{translations.rb → translation_index.rb} +5 -11
- data/lib/w3c_api/models/user.rb +95 -165
- data/lib/w3c_api/models/user_index.rb +11 -0
- data/lib/w3c_api/models.rb +36 -12
- data/lib/w3c_api/version.rb +1 -1
- data/lib/w3c_api.rb +3 -2
- metadata +38 -19
- data/lib/w3c_api/models/affiliations.rb +0 -33
- data/lib/w3c_api/models/base.rb +0 -39
- data/lib/w3c_api/models/call_for_translation_ref.rb +0 -15
- data/lib/w3c_api/models/charters.rb +0 -17
- data/lib/w3c_api/models/collection_base.rb +0 -79
- data/lib/w3c_api/models/delegate_enumerable.rb +0 -54
- data/lib/w3c_api/models/groups.rb +0 -38
- data/lib/w3c_api/models/link.rb +0 -17
- data/lib/w3c_api/models/participations.rb +0 -17
- data/lib/w3c_api/models/series_collection.rb +0 -17
- data/lib/w3c_api/models/spec_versions.rb +0 -17
- data/lib/w3c_api/models/specifications.rb +0 -17
- data/lib/w3c_api/models/users.rb +0 -44
@@ -5,83 +5,83 @@ require_relative 'output_formatter'
|
|
5
5
|
require_relative '../client'
|
6
6
|
|
7
7
|
module W3cApi
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
module Commands
|
9
|
+
# Thor CLI command for group operations
|
10
|
+
class Group < Thor
|
11
|
+
include OutputFormatter
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
desc 'fetch [OPTIONS]', 'Fetch groups'
|
14
|
+
option :id, type: :string, desc: 'Group ID'
|
15
|
+
option :type, type: :string, desc: 'Group type'
|
16
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
17
|
+
def fetch
|
18
|
+
client = W3cApi::Client.new
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
20
|
+
groups = if options[:id]
|
21
|
+
# Single group
|
22
|
+
client.group(options[:id])
|
23
|
+
elsif options[:type]
|
24
|
+
client.groups(type: options[:type])
|
25
|
+
else
|
26
|
+
client.groups
|
27
|
+
end
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
output_results(groups, options[:format])
|
30
|
+
end
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
desc 'users', 'Fetch users in a group'
|
33
|
+
option :id, type: :numeric, required: true, desc: 'Group ID'
|
34
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
35
|
+
def users
|
36
|
+
client = W3cApi::Client.new
|
37
|
+
users = client.group_users(options[:id])
|
38
|
+
output_results(users, options[:format])
|
39
|
+
end
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
41
|
+
desc 'specifications', 'Fetch specifications produced by a group'
|
42
|
+
option :id, type: :numeric, required: true, desc: 'Group ID'
|
43
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
44
|
+
def specifications
|
45
|
+
client = W3cApi::Client.new
|
46
|
+
specifications = client.group_specifications(options[:id])
|
47
|
+
output_results(specifications, options[:format])
|
48
|
+
end
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
50
|
+
desc 'charters', 'Fetch charters of a group'
|
51
|
+
option :id, type: :numeric, required: true, desc: 'Group ID'
|
52
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
53
|
+
def charters
|
54
|
+
client = W3cApi::Client.new
|
55
|
+
charters = client.group_charters(options[:id])
|
56
|
+
output_results(charters, options[:format])
|
57
|
+
end
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
59
|
+
desc 'chairs', 'Fetch chairs of a group'
|
60
|
+
option :id, type: :numeric, required: true, desc: 'Group ID'
|
61
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
62
|
+
def chairs
|
63
|
+
client = W3cApi::Client.new
|
64
|
+
chairs = client.group_chairs(options[:id])
|
65
|
+
output_results(chairs, options[:format])
|
66
|
+
end
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
68
|
+
desc 'team-contacts', 'Fetch team contacts of a group'
|
69
|
+
option :id, type: :numeric, required: true, desc: 'Group ID'
|
70
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
71
|
+
def team_contacts
|
72
|
+
client = W3cApi::Client.new
|
73
|
+
team_contacts = client.group_team_contacts(options[:id])
|
74
|
+
output_results(team_contacts, options[:format])
|
75
|
+
end
|
76
76
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
end
|
77
|
+
desc 'participations', 'Fetch participations in a group'
|
78
|
+
option :id, type: :numeric, required: true, desc: 'Group ID'
|
79
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
80
|
+
def participations
|
81
|
+
client = W3cApi::Client.new
|
82
|
+
participations = client.group_participations(options[:id])
|
83
|
+
output_results(participations, options[:format])
|
85
84
|
end
|
86
85
|
end
|
86
|
+
end
|
87
87
|
end
|
@@ -1,18 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module W3cApi
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
4
|
+
module Commands
|
5
|
+
module OutputFormatter
|
6
|
+
# Format and output results based on the specified format
|
7
|
+
def output_results(results, format)
|
8
|
+
case format
|
9
|
+
when 'yaml'
|
10
|
+
puts results.to_yaml
|
11
|
+
else
|
12
|
+
# Default to JSON if format is not recognized
|
13
|
+
puts results.to_json
|
15
14
|
end
|
16
15
|
end
|
17
16
|
end
|
17
|
+
end
|
18
18
|
end
|
@@ -5,30 +5,28 @@ require_relative 'output_formatter'
|
|
5
5
|
require_relative '../client'
|
6
6
|
|
7
7
|
module W3cApi
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
module Commands
|
9
|
+
# Thor CLI command for participation operations
|
10
|
+
class Participation < Thor
|
11
|
+
include OutputFormatter
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
output_results(participations, options[:format])
|
22
|
-
end
|
13
|
+
desc 'fetch', 'Fetch a participation by ID'
|
14
|
+
option :id, type: :numeric, required: true, desc: 'Participation ID'
|
15
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
16
|
+
def fetch
|
17
|
+
client = W3cApi::Client.new
|
18
|
+
participation = client.participation(options[:id])
|
19
|
+
output_results(participation, options[:format])
|
20
|
+
end
|
23
21
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end
|
22
|
+
desc 'participants', 'Fetch participants in a participation'
|
23
|
+
option :id, type: :numeric, required: true, desc: 'Participation ID'
|
24
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
25
|
+
def participants
|
26
|
+
client = W3cApi::Client.new
|
27
|
+
participants = client.participation_participants(options[:id])
|
28
|
+
output_results(participants, options[:format])
|
32
29
|
end
|
33
30
|
end
|
31
|
+
end
|
34
32
|
end
|
@@ -5,36 +5,36 @@ require_relative 'output_formatter'
|
|
5
5
|
require_relative '../client'
|
6
6
|
|
7
7
|
module W3cApi
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
module Commands
|
9
|
+
# Thor CLI command for series operations
|
10
|
+
class Series < Thor
|
11
|
+
include OutputFormatter
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
desc 'fetch [OPTIONS]', 'Fetch specification series'
|
14
|
+
option :shortname, type: :string, desc: 'Series shortname'
|
15
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
16
|
+
def fetch
|
17
|
+
client = W3cApi::Client.new
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
series = if options[:shortname]
|
20
|
+
# Single series
|
21
|
+
client.series_by_shortname(options[:shortname])
|
22
|
+
else
|
23
|
+
# All series
|
24
|
+
client.series
|
25
|
+
end
|
26
26
|
|
27
|
-
|
28
|
-
|
27
|
+
output_results(series, options[:format])
|
28
|
+
end
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
30
|
+
desc 'specifications', 'Fetch specifications in a series'
|
31
|
+
option :shortname, type: :string, required: true, desc: 'Series shortname'
|
32
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
33
|
+
def specifications
|
34
|
+
client = W3cApi::Client.new
|
35
|
+
specifications = client.series_specifications(options[:shortname])
|
36
|
+
output_results(specifications, options[:format])
|
38
37
|
end
|
39
38
|
end
|
39
|
+
end
|
40
40
|
end
|
@@ -5,64 +5,89 @@ require_relative 'output_formatter'
|
|
5
5
|
require_relative '../client'
|
6
6
|
|
7
7
|
module W3cApi
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
module Commands
|
9
|
+
# Thor CLI command for specification operations
|
10
|
+
class Specification < Thor
|
11
|
+
include OutputFormatter
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
desc 'fetch [OPTIONS]', 'Fetch specifications'
|
14
|
+
option :shortname, type: :string, desc: 'Filter by shortname'
|
15
|
+
option :version, type: :string, desc: 'Specific version of the specification'
|
16
|
+
option :status, type: :string, desc: 'Filter by status'
|
17
|
+
option :resolve, type: :array, desc: 'Links to resolve (e.g. version-history, latest-version, series)'
|
18
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
19
|
+
def fetch
|
20
|
+
client = W3cApi::Client.new
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
22
|
+
specifications = if options[:shortname] && options[:version]
|
23
|
+
# Single specification version
|
24
|
+
client.specification_version(options[:shortname], options[:version])
|
25
|
+
elsif options[:shortname]
|
26
|
+
# Single specification
|
27
|
+
client.specification(options[:shortname])
|
28
|
+
elsif options[:status]
|
29
|
+
# Specifications by status
|
30
|
+
client.specifications_by_status(options[:status])
|
31
|
+
else
|
32
|
+
# All specifications
|
33
|
+
client.specifications
|
34
|
+
end
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
# # Resolve links if specified
|
37
|
+
# if options[:resolve] && specifications.respond_to?(:realize_links)
|
38
|
+
# specifications.realize_links(options[:resolve], client)
|
39
|
+
# end
|
37
40
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
output_results(specifications, options[:format])
|
42
|
+
end
|
43
|
+
|
44
|
+
desc 'versions', 'Fetch versions of a specification'
|
45
|
+
option :shortname, type: :string, required: true, desc: 'Specification shortname'
|
46
|
+
option :resolve, type: :array, desc: 'Links to resolve on each version'
|
47
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
48
|
+
def versions
|
49
|
+
client = W3cApi::Client.new
|
50
|
+
versions = client.specification_versions(options[:shortname])
|
51
|
+
output_results(versions, options[:format])
|
52
|
+
end
|
53
|
+
|
54
|
+
desc 'supersedes', 'Fetch specifications that this specification supersedes'
|
55
|
+
option :shortname, type: :string, required: true, desc: 'Specification shortname'
|
56
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
57
|
+
def supersedes
|
58
|
+
# We need to add client.specification_supersedes method in the client
|
59
|
+
client = W3cApi::Client.new
|
60
|
+
specifications = client.specification_supersedes(options[:shortname])
|
61
|
+
output_results(specifications, options[:format])
|
62
|
+
end
|
63
|
+
|
64
|
+
desc 'superseded-by', 'Fetch specifications that supersede this specification'
|
65
|
+
option :shortname, type: :string, required: true, desc: 'Specification shortname'
|
66
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
67
|
+
def superseded_by
|
68
|
+
# We need to add client.specification_superseded_by method in the client
|
69
|
+
client = W3cApi::Client.new
|
70
|
+
specifications = client.specification_superseded_by(options[:shortname])
|
71
|
+
output_results(specifications, options[:format])
|
72
|
+
end
|
46
73
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
74
|
+
desc 'editors', 'Fetch editors of a specification'
|
75
|
+
option :shortname, type: :string, required: true, desc: 'Specification shortname'
|
76
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
77
|
+
def editors
|
78
|
+
client = W3cApi::Client.new
|
79
|
+
editors = client.specification_editors(options[:shortname])
|
80
|
+
output_results(editors, options[:format])
|
81
|
+
end
|
56
82
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
output_results(specifications, options[:format])
|
65
|
-
end
|
83
|
+
desc 'deliverers', 'Fetch deliverers (working groups) of a specification'
|
84
|
+
option :shortname, type: :string, required: true, desc: 'Specification shortname'
|
85
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
86
|
+
def deliverers
|
87
|
+
client = W3cApi::Client.new
|
88
|
+
deliverers = client.specification_deliverers(options[:shortname])
|
89
|
+
output_results(deliverers, options[:format])
|
66
90
|
end
|
67
91
|
end
|
92
|
+
end
|
68
93
|
end
|
@@ -5,27 +5,27 @@ require_relative 'output_formatter'
|
|
5
5
|
require_relative '../client'
|
6
6
|
|
7
7
|
module W3cApi
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
module Commands
|
9
|
+
# Thor CLI command for translation operations
|
10
|
+
class Translation < Thor
|
11
|
+
include OutputFormatter
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
desc 'fetch [OPTIONS]', 'Fetch a translation by ID'
|
14
|
+
option :id, type: :string, desc: 'Translation ID'
|
15
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
16
|
+
def fetch
|
17
|
+
client = W3cApi::Client.new
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
translations = if options[:id]
|
20
|
+
# Single specification version
|
21
|
+
client.translation(options[:id])
|
22
|
+
else
|
23
|
+
# All translations
|
24
|
+
client.translations
|
25
|
+
end
|
26
26
|
|
27
|
-
|
28
|
-
end
|
27
|
+
output_results(translations, options[:format])
|
29
28
|
end
|
30
29
|
end
|
30
|
+
end
|
31
31
|
end
|
@@ -5,73 +5,73 @@ require_relative 'output_formatter'
|
|
5
5
|
require_relative '../client'
|
6
6
|
|
7
7
|
module W3cApi
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
module Commands
|
9
|
+
# Thor CLI command for user operations
|
10
|
+
class User < Thor
|
11
|
+
include OutputFormatter
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
desc 'fetch [OPTIONS]', 'Fetch a user by ID'
|
14
|
+
option :id, type: :string, required: true, desc: 'User ID (required)'
|
15
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
16
|
+
def fetch
|
17
|
+
client = W3cApi::Client.new
|
18
|
+
user = client.user(options[:id])
|
19
|
+
output_results(user, options[:format])
|
20
|
+
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
desc 'groups', 'Fetch groups a user is a member of'
|
23
|
+
option :id, type: :string, required: true, desc: 'User ID'
|
24
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
25
|
+
def groups
|
26
|
+
client = W3cApi::Client.new
|
27
|
+
groups = client.user_groups(options[:id])
|
28
|
+
output_results(groups, options[:format])
|
29
|
+
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
31
|
+
desc 'specifications', 'Fetch specifications a user has contributed to'
|
32
|
+
option :id, type: :string, required: true, desc: 'User ID (string or numeric)'
|
33
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
34
|
+
def specifications
|
35
|
+
client = W3cApi::Client.new
|
36
|
+
specifications = client.user_specifications(options[:id])
|
37
|
+
output_results(specifications, options[:format])
|
38
|
+
end
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
40
|
+
desc 'affiliations', 'Fetch affiliations of a user'
|
41
|
+
option :id, type: :string, required: true, desc: 'User ID (string or numeric)'
|
42
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
43
|
+
def affiliations
|
44
|
+
client = W3cApi::Client.new
|
45
|
+
affiliations = client.user_affiliations(options[:id])
|
46
|
+
output_results(affiliations, options[:format])
|
47
|
+
end
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
49
|
+
desc 'participations', 'Fetch participations of a user'
|
50
|
+
option :id, type: :string, required: true, desc: 'User ID (string or numeric)'
|
51
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
52
|
+
def participations
|
53
|
+
client = W3cApi::Client.new
|
54
|
+
participations = client.user_participations(options[:id])
|
55
|
+
output_results(participations, options[:format])
|
56
|
+
end
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
58
|
+
desc 'chair-of-groups', 'Fetch groups a user chairs'
|
59
|
+
option :id, type: :string, required: true, desc: 'User ID (string or numeric)'
|
60
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
61
|
+
def chair_of_groups
|
62
|
+
client = W3cApi::Client.new
|
63
|
+
groups = client.user_chair_of_groups(options[:id])
|
64
|
+
output_results(groups, options[:format])
|
65
|
+
end
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
end
|
67
|
+
desc 'team-contact-of-groups', 'Fetch groups a user is a team contact of'
|
68
|
+
option :id, type: :string, required: true, desc: 'User ID (string or numeric)'
|
69
|
+
option :format, type: :string, default: 'yaml', enum: %w[json yaml], desc: 'Output format'
|
70
|
+
def team_contact_of_groups
|
71
|
+
client = W3cApi::Client.new
|
72
|
+
groups = client.user_team_contact_of_groups(options[:id])
|
73
|
+
output_results(groups, options[:format])
|
75
74
|
end
|
76
75
|
end
|
76
|
+
end
|
77
77
|
end
|