w3c_api 0.1.2 → 0.1.4
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_todo.yml +24 -8
- data/README.adoc +334 -970
- data/demo/test_embed_functionality.rb +87 -0
- data/lib/w3c_api/cli.rb +4 -0
- data/lib/w3c_api/client.rb +46 -5
- data/lib/w3c_api/commands/specification_version.rb +38 -0
- data/lib/w3c_api/embed.rb +40 -0
- data/lib/w3c_api/hal.rb +422 -196
- data/lib/w3c_api/models/affiliation.rb +12 -0
- data/lib/w3c_api/models/affiliation_index.rb +1 -0
- data/lib/w3c_api/models/deliverer_index.rb +12 -0
- data/lib/w3c_api/models/editor_index.rb +12 -0
- data/lib/w3c_api/models/group.rb +25 -1
- data/lib/w3c_api/models/groups.rb +32 -0
- data/lib/w3c_api/models/serie.rb +12 -0
- data/lib/w3c_api/models/spec_version.rb +4 -4
- data/lib/w3c_api/models/spec_version_index.rb +0 -3
- data/lib/w3c_api/models/spec_version_predecessor_index.rb +11 -0
- data/lib/w3c_api/models/spec_version_successor_index.rb +11 -0
- data/lib/w3c_api/models/specification.rb +7 -0
- data/lib/w3c_api/models/user.rb +12 -0
- data/lib/w3c_api/models.rb +41 -33
- data/lib/w3c_api/version.rb +1 -1
- data/lib/w3c_api.rb +1 -0
- metadata +12 -19
- data/lib/w3c_api/models/group_link_set.rb +0 -24
@@ -70,6 +70,18 @@ module W3cApi
|
|
70
70
|
map key.to_s.tr('_', '-'), to: key
|
71
71
|
end
|
72
72
|
end
|
73
|
+
|
74
|
+
def participants(client = nil)
|
75
|
+
return nil unless client
|
76
|
+
|
77
|
+
client.affiliation_participants(id)
|
78
|
+
end
|
79
|
+
|
80
|
+
def participations(client = nil)
|
81
|
+
return nil unless client
|
82
|
+
|
83
|
+
client.affiliation_participations(id)
|
84
|
+
end
|
73
85
|
end
|
74
86
|
end
|
75
87
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'group'
|
4
|
+
|
5
|
+
module W3cApi
|
6
|
+
module Models
|
7
|
+
# Collection of deliverers (working groups)
|
8
|
+
class DelivererIndex < Lutaml::Hal::Page
|
9
|
+
hal_link :deliverers, key: 'deliverers', realize_class: 'Group', collection: true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/w3c_api/models/group.rb
CHANGED
@@ -55,7 +55,7 @@ module W3cApi
|
|
55
55
|
module Models
|
56
56
|
# Group model representing a W3C working group
|
57
57
|
class Group < Lutaml::Hal::Resource
|
58
|
-
attribute :id, :
|
58
|
+
attribute :id, :integer
|
59
59
|
attribute :type, :string
|
60
60
|
attribute :name, :string
|
61
61
|
attribute :is_closed, :boolean
|
@@ -89,6 +89,30 @@ module W3cApi
|
|
89
89
|
map key.to_s.tr('_', '-'), to: key
|
90
90
|
end
|
91
91
|
end
|
92
|
+
|
93
|
+
def users(client = nil)
|
94
|
+
return nil unless client
|
95
|
+
|
96
|
+
client.group_users(id)
|
97
|
+
end
|
98
|
+
|
99
|
+
def specifications(client = nil)
|
100
|
+
return nil unless client
|
101
|
+
|
102
|
+
client.group_specifications(id)
|
103
|
+
end
|
104
|
+
|
105
|
+
def chairs(client = nil)
|
106
|
+
return nil unless client
|
107
|
+
|
108
|
+
client.group_chairs(id)
|
109
|
+
end
|
110
|
+
|
111
|
+
def team_contacts(client = nil)
|
112
|
+
return nil unless client
|
113
|
+
|
114
|
+
client.group_team_contacts(id)
|
115
|
+
end
|
92
116
|
end
|
93
117
|
end
|
94
118
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module W3cApi
|
4
|
+
module Models
|
5
|
+
# Collection wrapper for groups
|
6
|
+
class Groups
|
7
|
+
include Enumerable
|
8
|
+
|
9
|
+
attr_accessor :groups
|
10
|
+
|
11
|
+
def initialize(groups = [])
|
12
|
+
@groups = groups
|
13
|
+
end
|
14
|
+
|
15
|
+
def each(&block)
|
16
|
+
@groups.each(&block)
|
17
|
+
end
|
18
|
+
|
19
|
+
def first
|
20
|
+
@groups.first
|
21
|
+
end
|
22
|
+
|
23
|
+
def size
|
24
|
+
@groups.size
|
25
|
+
end
|
26
|
+
|
27
|
+
def empty?
|
28
|
+
@groups.empty?
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/w3c_api/models/serie.rb
CHANGED
@@ -53,6 +53,18 @@ module W3cApi
|
|
53
53
|
map key.to_s.tr('_', '-'), to: key
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
def specifications(client = nil)
|
58
|
+
return nil unless client
|
59
|
+
|
60
|
+
client.series_specifications(shortname)
|
61
|
+
end
|
62
|
+
|
63
|
+
def current_specification(client = nil)
|
64
|
+
return nil unless client
|
65
|
+
|
66
|
+
client.specification(shortname)
|
67
|
+
end
|
56
68
|
end
|
57
69
|
end
|
58
70
|
end
|
@@ -49,11 +49,11 @@ module W3cApi
|
|
49
49
|
attribute :process_rules, :string
|
50
50
|
|
51
51
|
hal_link :self, key: 'self', realize_class: 'SpecVersion'
|
52
|
-
hal_link :editors, key: 'editors', realize_class: '
|
53
|
-
hal_link :deliverers, key: 'deliverers', realize_class: '
|
52
|
+
hal_link :editors, key: 'editors', realize_class: 'EditorIndex'
|
53
|
+
hal_link :deliverers, key: 'deliverers', realize_class: 'DelivererIndex'
|
54
54
|
hal_link :specification, key: 'specification', realize_class: 'Specification'
|
55
|
-
hal_link :
|
56
|
-
hal_link :
|
55
|
+
hal_link :predecessor_versions, key: 'predecessor-version', realize_class: 'SpecVersionPredecessorIndex'
|
56
|
+
hal_link :successor_versions, key: 'successor-version', realize_class: 'SpecVersionSuccessorIndex'
|
57
57
|
|
58
58
|
key_value do
|
59
59
|
%i[
|
@@ -5,10 +5,7 @@ require_relative 'spec_version'
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class SpecVersionIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :versions, key: 'versions', realize_class: 'SpecVersion', collection: true
|
9
8
|
hal_link :spec_versions, key: 'version-history', realize_class: 'SpecVersion', collection: true
|
10
|
-
hal_link :predecessor_version, key: 'predecessor-version', realize_class: 'SpecVersion', collection: true
|
11
|
-
hal_link :successor_version, key: 'successor-version', realize_class: 'SpecVersion', collection: true
|
12
9
|
end
|
13
10
|
end
|
14
11
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'spec_version'
|
4
|
+
|
5
|
+
module W3cApi
|
6
|
+
module Models
|
7
|
+
class SpecVersionPredecessorIndex < Lutaml::Hal::Page
|
8
|
+
hal_link :predecessor_versions, key: 'predecessor-version', realize_class: 'SpecVersion', collection: true
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'spec_version'
|
4
|
+
|
5
|
+
module W3cApi
|
6
|
+
module Models
|
7
|
+
class SpecVersionSuccessorIndex < Lutaml::Hal::Page
|
8
|
+
hal_link :successor_versions, key: 'successor-version', realize_class: 'SpecVersion', collection: true
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -48,6 +48,7 @@ module W3cApi
|
|
48
48
|
hal_link :latest_version, key: 'latest-version', realize_class: 'SpecVersion'
|
49
49
|
hal_link :supersedes, key: 'supersedes', realize_class: 'SpecificationIndex', collection: true
|
50
50
|
hal_link :series, key: 'series', realize_class: 'Serie'
|
51
|
+
hal_link :spec_versions, key: 'version-history', realize_class: 'SpecVersionIndex'
|
51
52
|
|
52
53
|
key_value do
|
53
54
|
%i[
|
@@ -62,6 +63,12 @@ module W3cApi
|
|
62
63
|
map key.to_s.tr('_', '-'), to: key
|
63
64
|
end
|
64
65
|
end
|
66
|
+
|
67
|
+
def versions(client = nil)
|
68
|
+
return nil unless client
|
69
|
+
|
70
|
+
client.specification_versions(shortname)
|
71
|
+
end
|
65
72
|
end
|
66
73
|
end
|
67
74
|
end
|
data/lib/w3c_api/models/user.rb
CHANGED
@@ -103,6 +103,18 @@ module W3cApi
|
|
103
103
|
map key.to_s.tr('_', '-'), to: key
|
104
104
|
end
|
105
105
|
end
|
106
|
+
|
107
|
+
def groups(client = nil)
|
108
|
+
return nil unless client
|
109
|
+
|
110
|
+
client.user_groups(id)
|
111
|
+
end
|
112
|
+
|
113
|
+
def specifications(client = nil)
|
114
|
+
return nil unless client
|
115
|
+
|
116
|
+
client.user_specifications(id)
|
117
|
+
end
|
106
118
|
end
|
107
119
|
end
|
108
120
|
end
|
data/lib/w3c_api/models.rb
CHANGED
@@ -2,38 +2,46 @@
|
|
2
2
|
|
3
3
|
module W3cApi
|
4
4
|
module Models
|
5
|
+
# Use autoload to defer class loading until first access
|
6
|
+
# This eliminates the class loading order dependency that caused
|
7
|
+
# inconsistent type names in HAL output
|
8
|
+
|
9
|
+
autoload :Account, File.expand_path('models/account', __dir__)
|
10
|
+
autoload :Affiliation, File.expand_path('models/affiliation', __dir__)
|
11
|
+
autoload :AffiliationIndex, File.expand_path('models/affiliation_index', __dir__)
|
12
|
+
autoload :CallForTranslation, File.expand_path('models/call_for_translation', __dir__)
|
13
|
+
autoload :ChairIndex, File.expand_path('models/chair_index', __dir__)
|
14
|
+
autoload :Charter, File.expand_path('models/charter', __dir__)
|
15
|
+
autoload :CharterIndex, File.expand_path('models/charter_index', __dir__)
|
16
|
+
autoload :ConnectedAccount, File.expand_path('models/connected_account', __dir__)
|
17
|
+
autoload :DelivererIndex, File.expand_path('models/deliverer_index', __dir__)
|
18
|
+
autoload :Ecosystem, File.expand_path('models/ecosystem', __dir__)
|
19
|
+
autoload :EcosystemIndex, File.expand_path('models/ecosystem_index', __dir__)
|
20
|
+
autoload :EditorIndex, File.expand_path('models/editor_index', __dir__)
|
21
|
+
autoload :EvangelistIndex, File.expand_path('models/evangelist_index', __dir__)
|
22
|
+
autoload :Extension, File.expand_path('models/extension', __dir__)
|
23
|
+
autoload :Group, File.expand_path('models/group', __dir__)
|
24
|
+
autoload :GroupIndex, File.expand_path('models/group_index', __dir__)
|
25
|
+
autoload :Groups, File.expand_path('models/groups', __dir__)
|
26
|
+
autoload :JoinEmailIndex, File.expand_path('models/join_emails', __dir__)
|
27
|
+
autoload :ParticipantIndex, File.expand_path('models/participant_index', __dir__)
|
28
|
+
autoload :Participation, File.expand_path('models/participation', __dir__)
|
29
|
+
autoload :ParticipationIndex, File.expand_path('models/participation_index', __dir__)
|
30
|
+
autoload :Photo, File.expand_path('models/photo', __dir__)
|
31
|
+
autoload :Serie, File.expand_path('models/serie', __dir__)
|
32
|
+
autoload :SerieIndex, File.expand_path('models/serie_index', __dir__)
|
33
|
+
autoload :SpecVersion, File.expand_path('models/spec_version', __dir__)
|
34
|
+
autoload :SpecVersionIndex, File.expand_path('models/spec_version_index', __dir__)
|
35
|
+
autoload :SpecVersionPredecessorIndex, File.expand_path('models/spec_version_predecessor_index', __dir__)
|
36
|
+
autoload :SpecVersionSuccessorIndex, File.expand_path('models/spec_version_successor_index', __dir__)
|
37
|
+
autoload :SpecVersionRef, File.expand_path('models/spec_version_ref', __dir__)
|
38
|
+
autoload :Specification, File.expand_path('models/specification', __dir__)
|
39
|
+
autoload :SpecificationIndex, File.expand_path('models/specification_index', __dir__)
|
40
|
+
autoload :TeamContactIndex, File.expand_path('models/team_contact_index', __dir__)
|
41
|
+
autoload :Testimonial, File.expand_path('models/testimonial', __dir__)
|
42
|
+
autoload :Translation, File.expand_path('models/translation', __dir__)
|
43
|
+
autoload :TranslationIndex, File.expand_path('models/translation_index', __dir__)
|
44
|
+
autoload :User, File.expand_path('models/user', __dir__)
|
45
|
+
autoload :UserIndex, File.expand_path('models/user_index', __dir__)
|
5
46
|
end
|
6
47
|
end
|
7
|
-
|
8
|
-
# Load specific model implementations
|
9
|
-
require_relative 'models/affiliation'
|
10
|
-
require_relative 'models/affiliation_index'
|
11
|
-
require_relative 'models/call_for_translation'
|
12
|
-
require_relative 'models/charter'
|
13
|
-
require_relative 'models/charter_index'
|
14
|
-
require_relative 'models/chair_index'
|
15
|
-
require_relative 'models/connected_account'
|
16
|
-
require_relative 'models/ecosystem'
|
17
|
-
require_relative 'models/ecosystem_index'
|
18
|
-
require_relative 'models/evangelist_index'
|
19
|
-
require_relative 'models/extension'
|
20
|
-
require_relative 'models/group'
|
21
|
-
require_relative 'models/group_index'
|
22
|
-
require_relative 'models/group_link_set'
|
23
|
-
require_relative 'models/join_emails'
|
24
|
-
require_relative 'models/participant_index'
|
25
|
-
require_relative 'models/participation'
|
26
|
-
require_relative 'models/participation_index'
|
27
|
-
require_relative 'models/serie'
|
28
|
-
require_relative 'models/serie_index'
|
29
|
-
require_relative 'models/spec_version'
|
30
|
-
require_relative 'models/spec_version_index'
|
31
|
-
require_relative 'models/spec_version_ref'
|
32
|
-
require_relative 'models/specification'
|
33
|
-
require_relative 'models/specification_index'
|
34
|
-
require_relative 'models/team_contact_index'
|
35
|
-
require_relative 'models/testimonial'
|
36
|
-
require_relative 'models/translation'
|
37
|
-
require_relative 'models/translation_index'
|
38
|
-
require_relative 'models/user'
|
39
|
-
require_relative 'models/user_index'
|
data/lib/w3c_api/version.rb
CHANGED
data/lib/w3c_api.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: w3c_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -44,28 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.1.
|
47
|
+
version: 0.1.9
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.1.
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: lutaml-model
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
54
|
+
version: 0.1.9
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rainbow
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,6 +93,7 @@ files:
|
|
107
93
|
- LICENSE.md
|
108
94
|
- README.adoc
|
109
95
|
- Rakefile
|
96
|
+
- demo/test_embed_functionality.rb
|
110
97
|
- exe/w3c_api
|
111
98
|
- lib/w3c_api.rb
|
112
99
|
- lib/w3c_api/cli.rb
|
@@ -118,8 +105,10 @@ files:
|
|
118
105
|
- lib/w3c_api/commands/participation.rb
|
119
106
|
- lib/w3c_api/commands/series.rb
|
120
107
|
- lib/w3c_api/commands/specification.rb
|
108
|
+
- lib/w3c_api/commands/specification_version.rb
|
121
109
|
- lib/w3c_api/commands/translation.rb
|
122
110
|
- lib/w3c_api/commands/user.rb
|
111
|
+
- lib/w3c_api/embed.rb
|
123
112
|
- lib/w3c_api/hal.rb
|
124
113
|
- lib/w3c_api/models.rb
|
125
114
|
- lib/w3c_api/models/account.rb
|
@@ -130,13 +119,15 @@ files:
|
|
130
119
|
- lib/w3c_api/models/charter.rb
|
131
120
|
- lib/w3c_api/models/charter_index.rb
|
132
121
|
- lib/w3c_api/models/connected_account.rb
|
122
|
+
- lib/w3c_api/models/deliverer_index.rb
|
133
123
|
- lib/w3c_api/models/ecosystem.rb
|
134
124
|
- lib/w3c_api/models/ecosystem_index.rb
|
125
|
+
- lib/w3c_api/models/editor_index.rb
|
135
126
|
- lib/w3c_api/models/evangelist_index.rb
|
136
127
|
- lib/w3c_api/models/extension.rb
|
137
128
|
- lib/w3c_api/models/group.rb
|
138
129
|
- lib/w3c_api/models/group_index.rb
|
139
|
-
- lib/w3c_api/models/
|
130
|
+
- lib/w3c_api/models/groups.rb
|
140
131
|
- lib/w3c_api/models/join_emails.rb
|
141
132
|
- lib/w3c_api/models/participant_index.rb
|
142
133
|
- lib/w3c_api/models/participation.rb
|
@@ -146,7 +137,9 @@ files:
|
|
146
137
|
- lib/w3c_api/models/serie_index.rb
|
147
138
|
- lib/w3c_api/models/spec_version.rb
|
148
139
|
- lib/w3c_api/models/spec_version_index.rb
|
140
|
+
- lib/w3c_api/models/spec_version_predecessor_index.rb
|
149
141
|
- lib/w3c_api/models/spec_version_ref.rb
|
142
|
+
- lib/w3c_api/models/spec_version_successor_index.rb
|
150
143
|
- lib/w3c_api/models/specification.rb
|
151
144
|
- lib/w3c_api/models/specification_index.rb
|
152
145
|
- lib/w3c_api/models/team_contact_index.rb
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'specification_index'
|
4
|
-
|
5
|
-
module W3cApi
|
6
|
-
module Models
|
7
|
-
# Manual GroupLinkSet class to fix collection issue
|
8
|
-
class GroupLinkSet < Lutaml::Hal::LinkSet
|
9
|
-
# Define the specifications attribute with collection: true
|
10
|
-
# This is needed because the Group model's specifications link
|
11
|
-
# realizes to a SpecificationIndex which contains a collection
|
12
|
-
attribute :specifications, SpecificationIndexLink, collection: true
|
13
|
-
|
14
|
-
key_value do
|
15
|
-
map 'specifications', to: :specifications
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
# Define the link class for SpecificationIndex
|
20
|
-
class SpecificationIndexLink < Lutaml::Hal::Link
|
21
|
-
attribute :type, :string, default: 'SpecificationIndex'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|