seatsio 48.6.0 → 48.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +1 -1
- data/.github/workflows/release.yml +5 -7
- data/Gemfile.lock +16 -19
- data/lib/seatsio/chart_reports.rb +8 -0
- data/lib/seatsio/charts.rb +25 -4
- data/lib/seatsio/domain.rb +38 -3
- data/lib/seatsio/event_reports.rb +12 -0
- data/lib/seatsio/events/change_best_available_object_status_request.rb +4 -1
- data/lib/seatsio/events.rb +7 -7
- data/lib/seatsio/pagination/cursor.rb +1 -1
- data/lib/seatsio/version.rb +1 -1
- data/release.mjs +4 -4
- data/seatsio.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 265673654065736f58842c8b4583375cabcc228612812b3174f50578298c5137
|
4
|
+
data.tar.gz: 04de0076bd1f3552a4dbcc3ee52ee998e973df1a5bc0d92f48052b2d5be4bbe2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21d5ab48516a7a740fc081cce956a8dbc19c343f5f9ddb122e106d02dde86c42dd31df1b2f561b4d6136726435a4467ca394642aacab1ae9880225ffb38e4461
|
7
|
+
data.tar.gz: 3076a4bd78fda08d4e41c4433aa10ea89e6cff162d23b33212f704db1426fedb2baf8411a588454a2cf3718c1c63a6d02bf5eb368ac67a76adae2540104673c6
|
data/.github/workflows/build.yml
CHANGED
@@ -27,13 +27,11 @@ jobs:
|
|
27
27
|
- uses: actions/setup-node@v4
|
28
28
|
with:
|
29
29
|
node-version: 20
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
chmod +x /usr/local/bin/semver
|
36
|
-
- run: zx ./release.mjs -v $VERSION_TO_BUMP
|
30
|
+
registry-url: https://registry.npmjs.org/
|
31
|
+
- name: Install dependencies
|
32
|
+
run: yarn add -D -E zx@8.1.4 semver@7.6.3
|
33
|
+
- name: Run release script
|
34
|
+
run: yarn zx ./release.mjs -v $VERSION_TO_BUMP
|
37
35
|
env:
|
38
36
|
VERSION_TO_BUMP: ${{ inputs.versionToBump }}
|
39
37
|
GH_TOKEN: ${{ github.token }}
|
data/Gemfile.lock
CHANGED
@@ -1,44 +1,41 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
seatsio (48.
|
4
|
+
seatsio (48.8.0)
|
5
5
|
rest-client (~> 2.0, >= 2.0.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
addressable (2.8.
|
11
|
-
public_suffix (>= 2.0.2, <
|
10
|
+
addressable (2.8.7)
|
11
|
+
public_suffix (>= 2.0.2, < 7.0)
|
12
12
|
bigdecimal (3.1.8)
|
13
13
|
crack (1.0.0)
|
14
14
|
bigdecimal
|
15
15
|
rexml
|
16
|
-
domain_name (0.
|
17
|
-
unf (>= 0.0.5, < 1.0.0)
|
16
|
+
domain_name (0.6.20240107)
|
18
17
|
hashdiff (1.1.0)
|
19
18
|
http-accept (1.7.0)
|
20
|
-
http-cookie (1.0.
|
19
|
+
http-cookie (1.0.6)
|
21
20
|
domain_name (~> 0.5)
|
22
|
-
mime-types (3.
|
21
|
+
mime-types (3.5.2)
|
23
22
|
mime-types-data (~> 3.2015)
|
24
|
-
mime-types-data (3.
|
25
|
-
minitest (5.
|
26
|
-
minitest-parallel_fork (2.0.0)
|
27
|
-
minitest (>= 5.15.0)
|
23
|
+
mime-types-data (3.2024.0702)
|
24
|
+
minitest (5.25.1)
|
28
25
|
netrc (0.11.0)
|
29
|
-
|
26
|
+
parallel (1.25.1)
|
27
|
+
parallel_tests (4.7.1)
|
28
|
+
parallel
|
29
|
+
public_suffix (6.0.0)
|
30
30
|
rake (13.2.1)
|
31
31
|
rest-client (2.1.0)
|
32
32
|
http-accept (>= 1.7.0, < 2.0)
|
33
33
|
http-cookie (>= 1.0.2, < 2.0)
|
34
34
|
mime-types (>= 1.16, < 4.0)
|
35
35
|
netrc (~> 0.8)
|
36
|
-
rexml (3.
|
37
|
-
strscan
|
36
|
+
rexml (3.3.6)
|
37
|
+
strscan
|
38
38
|
strscan (3.1.0)
|
39
|
-
unf (0.1.4)
|
40
|
-
unf_ext
|
41
|
-
unf_ext (0.0.7.7)
|
42
39
|
webmock (3.23.1)
|
43
40
|
addressable (>= 2.8.0)
|
44
41
|
crack (>= 0.3.2)
|
@@ -50,10 +47,10 @@ PLATFORMS
|
|
50
47
|
DEPENDENCIES
|
51
48
|
bundler (~> 2.2)
|
52
49
|
minitest (~> 5.0)
|
53
|
-
|
50
|
+
parallel_tests (~> 4.7.1)
|
54
51
|
rake (~> 13.0)
|
55
52
|
seatsio!
|
56
53
|
webmock (~> 3.4, >= 3.4.2)
|
57
54
|
|
58
55
|
BUNDLED WITH
|
59
|
-
2.
|
56
|
+
2.5.3
|
@@ -47,6 +47,14 @@ module Seatsio
|
|
47
47
|
fetch_summary_report('bySection', event_key, book_whole_tables, version)
|
48
48
|
end
|
49
49
|
|
50
|
+
def by_zone(chart_key, book_whole_tables = nil, version = nil)
|
51
|
+
fetch_chart_report('byZone', chart_key, book_whole_tables, version)
|
52
|
+
end
|
53
|
+
|
54
|
+
def summary_by_zone(event_key, book_whole_tables = nil, version = nil)
|
55
|
+
fetch_summary_report('byZone', event_key, book_whole_tables, version)
|
56
|
+
end
|
57
|
+
|
50
58
|
private
|
51
59
|
|
52
60
|
def fetch_chart_report(report_type, chart_key, book_whole_tables, version)
|
data/lib/seatsio/charts.rb
CHANGED
@@ -113,17 +113,38 @@ module Seatsio
|
|
113
113
|
@http_client.post("charts/#{chart_key}/version/draft/actions/publish")
|
114
114
|
end
|
115
115
|
|
116
|
-
def list(chart_filter: nil, tag: nil, expand_events:
|
116
|
+
def list(chart_filter: nil, tag: nil, expand_events: false, expand_validation: false, expand_venue_type: false, expand_zones: false)
|
117
117
|
cursor = Pagination::Cursor.new(Chart, 'charts', @http_client)
|
118
118
|
cursor.set_query_param('filter', chart_filter)
|
119
119
|
cursor.set_query_param('tag', tag)
|
120
120
|
|
121
|
-
|
122
|
-
cursor.set_query_param('
|
123
|
-
|
121
|
+
expand_params = list_expand_params(expand_events, expand_validation, expand_venue_type, expand_zones)
|
122
|
+
cursor.set_query_param('expand', expand_params) unless expand_params.empty?
|
124
123
|
cursor
|
125
124
|
end
|
126
125
|
|
126
|
+
def list_expand_params(expand_events, expand_validation, expand_venue_type, expand_zones)
|
127
|
+
result = []
|
128
|
+
|
129
|
+
if expand_events
|
130
|
+
result.push('events')
|
131
|
+
end
|
132
|
+
|
133
|
+
if expand_validation
|
134
|
+
result.push('validation')
|
135
|
+
end
|
136
|
+
|
137
|
+
if expand_venue_type
|
138
|
+
result.push('venueType')
|
139
|
+
end
|
140
|
+
|
141
|
+
if expand_zones
|
142
|
+
result.push('zones')
|
143
|
+
end
|
144
|
+
|
145
|
+
result
|
146
|
+
end
|
147
|
+
|
127
148
|
def list_all_tags
|
128
149
|
response = @http_client.get('charts/tags')
|
129
150
|
response['tags']
|
data/lib/seatsio/domain.rb
CHANGED
@@ -8,7 +8,7 @@ module Seatsio
|
|
8
8
|
|
9
9
|
attr_reader :id, :key, :status, :name, :published_version_thumbnail_url,
|
10
10
|
:draft_version_thumbnail_url, :events, :tags, :archived,
|
11
|
-
:categories, :validation, :venue_type
|
11
|
+
:categories, :validation, :venue_type, :zones
|
12
12
|
|
13
13
|
def initialize(data)
|
14
14
|
@id = data['id']
|
@@ -22,6 +22,38 @@ module Seatsio
|
|
22
22
|
@archived = data['archived']
|
23
23
|
@validation = data['validation']
|
24
24
|
@venue_type = data['venueType']
|
25
|
+
@zones = Zone.create_list(data['zones']) if data['zones']
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class Zone
|
30
|
+
|
31
|
+
attr_reader :key, :label
|
32
|
+
|
33
|
+
def initialize(key, label)
|
34
|
+
@key = key
|
35
|
+
@label = label
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.from_json(data)
|
39
|
+
if data
|
40
|
+
Zone.new(data['key'], data['label'])
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def == (other)
|
45
|
+
key == other.key &&
|
46
|
+
label == other.label
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.create_list(list = [])
|
50
|
+
result = []
|
51
|
+
|
52
|
+
list.each do |item|
|
53
|
+
result << Zone.from_json(item)
|
54
|
+
end
|
55
|
+
|
56
|
+
result
|
25
57
|
end
|
26
58
|
end
|
27
59
|
|
@@ -316,7 +348,7 @@ module Seatsio
|
|
316
348
|
|
317
349
|
attr_reader :label, :labels, :ids, :category_key, :category_label, :section, :entrance, :capacity, :object_type,
|
318
350
|
:left_neighbour, :right_neighbour, :book_as_a_whole, :distance_to_focal_point, :num_seats, :is_accessible,
|
319
|
-
:is_companion_seat, :has_restricted_view
|
351
|
+
:is_companion_seat, :has_restricted_view, :zone
|
320
352
|
|
321
353
|
def initialize(data)
|
322
354
|
@label = data['label']
|
@@ -336,6 +368,7 @@ module Seatsio
|
|
336
368
|
@is_accessible = data['isAccessible']
|
337
369
|
@is_companion_seat = data['isCompanionSeat']
|
338
370
|
@has_restricted_view = data['hasRestrictedView']
|
371
|
+
@zone = data['zone']
|
339
372
|
end
|
340
373
|
end
|
341
374
|
|
@@ -392,7 +425,8 @@ module Seatsio
|
|
392
425
|
:is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
|
393
426
|
:left_neighbour, :right_neighbour, :is_available, :channel,
|
394
427
|
:book_as_a_whole, :distance_to_focal_point, :holds, :num_seats, :variable_occupancy,
|
395
|
-
:min_occupancy, :max_occupancy, :season_status_overridden_quantity, :num_not_for_sale
|
428
|
+
:min_occupancy, :max_occupancy, :season_status_overridden_quantity, :num_not_for_sale,
|
429
|
+
:zone
|
396
430
|
|
397
431
|
def initialize(data)
|
398
432
|
@status = data['status']
|
@@ -430,6 +464,7 @@ module Seatsio
|
|
430
464
|
@max_occupancy = data['maxOccupancy']
|
431
465
|
@season_status_overridden_quantity = data['seasonStatusOverriddenQuantity']
|
432
466
|
@num_not_for_sale = data['numNotForSale']
|
467
|
+
@zone = data['zone']
|
433
468
|
end
|
434
469
|
end
|
435
470
|
|
@@ -71,6 +71,18 @@ module Seatsio
|
|
71
71
|
fetch_deep_summary_report('bySection', event_key)
|
72
72
|
end
|
73
73
|
|
74
|
+
def by_zone(event_key, zone = nil)
|
75
|
+
fetch_report('byZone', event_key, zone)
|
76
|
+
end
|
77
|
+
|
78
|
+
def summary_by_zone(event_key)
|
79
|
+
fetch_summary_report('byZone', event_key)
|
80
|
+
end
|
81
|
+
|
82
|
+
def deep_summary_by_zone(event_key)
|
83
|
+
fetch_deep_summary_report('byZone', event_key)
|
84
|
+
end
|
85
|
+
|
74
86
|
def by_availability(event_key, availability = nil)
|
75
87
|
fetch_report('byAvailability', event_key, availability)
|
76
88
|
end
|
@@ -1,10 +1,13 @@
|
|
1
|
-
def create_change_best_available_object_status_request(number, status, categories, extra_data, ticket_types, hold_token, order_id, keep_extra_data,
|
1
|
+
def create_change_best_available_object_status_request(number, status, categories, zone, extra_data, ticket_types, hold_token, order_id, keep_extra_data,
|
2
|
+
ignore_channels, channel_keys, try_to_prevent_orphan_seats, accessible_seats)
|
2
3
|
result = {}
|
3
4
|
best_available = {'number': number}
|
4
5
|
best_available[:categories] = categories if categories != nil
|
6
|
+
best_available[:zone] = zone if zone != nil
|
5
7
|
best_available[:extraData] = extra_data if extra_data != nil
|
6
8
|
best_available[:ticketTypes] = ticket_types if ticket_types != nil
|
7
9
|
best_available[:tryToPreventOrphanSeats] = try_to_prevent_orphan_seats if try_to_prevent_orphan_seats != nil
|
10
|
+
best_available[:accessibleSeats] = accessible_seats if accessible_seats != nil
|
8
11
|
result[:status] = status
|
9
12
|
result[:bestAvailable] = best_available
|
10
13
|
result[:holdToken] = hold_token if hold_token != nil
|
data/lib/seatsio/events.rb
CHANGED
@@ -64,7 +64,7 @@ module Seatsio
|
|
64
64
|
|
65
65
|
def retrieve_object_infos(key:, labels:)
|
66
66
|
url = "events/#{key}/objects"
|
67
|
-
query_params = URI.encode_www_form(
|
67
|
+
query_params = URI.encode_www_form({ label: labels })
|
68
68
|
response = @http_client.get(url, query_params)
|
69
69
|
response.each do |key, value|
|
70
70
|
response[key] = EventObjectInfo.new(value)
|
@@ -98,18 +98,18 @@ module Seatsio
|
|
98
98
|
change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::HELD, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
99
99
|
end
|
100
100
|
|
101
|
-
def change_best_available_object_status(key, number, status, categories: nil, hold_token: nil, extra_data: nil, ticket_types: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil)
|
102
|
-
request = create_change_best_available_object_status_request(number, status, categories, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys, try_to_prevent_orphan_seats)
|
101
|
+
def change_best_available_object_status(key, number, status, categories: nil, hold_token: nil, extra_data: nil, ticket_types: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil, zone: nil, accessible_seats: nil)
|
102
|
+
request = create_change_best_available_object_status_request(number, status, categories, zone, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys, try_to_prevent_orphan_seats, accessible_seats)
|
103
103
|
response = @http_client.post("events/#{key}/actions/change-object-status", request)
|
104
104
|
BestAvailableObjects.new(response)
|
105
105
|
end
|
106
106
|
|
107
|
-
def book_best_available(key, number, categories: nil, hold_token: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil)
|
108
|
-
change_best_available_object_status(key, number, Seatsio::EventObjectInfo::BOOKED, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys, try_to_prevent_orphan_seats: try_to_prevent_orphan_seats)
|
107
|
+
def book_best_available(key, number, categories: nil, hold_token: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil, zone: nil)
|
108
|
+
change_best_available_object_status(key, number, Seatsio::EventObjectInfo::BOOKED, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys, try_to_prevent_orphan_seats: try_to_prevent_orphan_seats, zone: zone)
|
109
109
|
end
|
110
110
|
|
111
|
-
def hold_best_available(key, number, hold_token, categories: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil)
|
112
|
-
change_best_available_object_status(key, number, Seatsio::EventObjectInfo::HELD, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys, try_to_prevent_orphan_seats: try_to_prevent_orphan_seats)
|
111
|
+
def hold_best_available(key, number, hold_token, categories: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil, zone: nil)
|
112
|
+
change_best_available_object_status(key, number, Seatsio::EventObjectInfo::HELD, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys, try_to_prevent_orphan_seats: try_to_prevent_orphan_seats, zone: zone)
|
113
113
|
end
|
114
114
|
|
115
115
|
def release(event_key_or_keys, object_or_objects, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil)
|
data/lib/seatsio/version.rb
CHANGED
data/release.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env zx
|
2
2
|
|
3
3
|
/*
|
4
|
-
* Script to release the seats.io
|
4
|
+
* Script to release the seats.io ruby lib.
|
5
5
|
* - changes the version number in README.md
|
6
6
|
* - changes the version number in build.gradle
|
7
7
|
* - creates the release in Gihub (using gh cli)
|
@@ -10,15 +10,15 @@
|
|
10
10
|
* Prerequisites:
|
11
11
|
* - zx installed (https://github.com/google/zx)
|
12
12
|
* - gh cli installed (https://cli.github.com/)
|
13
|
-
* - semver cli installed (https://github.com/fsaintjacques/semver-tool)
|
14
13
|
*
|
15
14
|
* Usage:
|
16
|
-
* zx ./release.mjs -v major/minor -n "release notes"
|
15
|
+
* yarn zx ./release.mjs -v major/minor -n "release notes"
|
17
16
|
* */
|
18
17
|
|
19
18
|
// don't output the commands themselves
|
20
19
|
$.verbose = false
|
21
20
|
|
21
|
+
const semver = require('semver')
|
22
22
|
const versionToBump = getVersionToBump()
|
23
23
|
const latestReleaseTag = await fetchLatestReleasedVersionNumber()
|
24
24
|
const latestVersion = removeLeadingV(latestReleaseTag)
|
@@ -49,7 +49,7 @@ async function fetchLatestReleasedVersionNumber() {
|
|
49
49
|
}
|
50
50
|
|
51
51
|
async function determineNextVersionNumber(previous) {
|
52
|
-
return (
|
52
|
+
return semver.inc(previous, versionToBump)
|
53
53
|
}
|
54
54
|
|
55
55
|
async function bumpVersionInFiles() {
|
data/seatsio.gemspec
CHANGED
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency "rake", "~> 13.0"
|
27
27
|
spec.add_development_dependency "minitest", "~> 5.0"
|
28
28
|
spec.add_development_dependency 'webmock', '~> 3.4', '>= 3.4.2'
|
29
|
-
spec.add_development_dependency '
|
29
|
+
spec.add_development_dependency 'parallel_tests', '~> 4.7.1'
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seatsio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 48.
|
4
|
+
version: 48.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seats.io
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -93,19 +93,19 @@ dependencies:
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: 3.4.2
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
96
|
+
name: parallel_tests
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
99
|
- - "~>"
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
101
|
+
version: 4.7.1
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
108
|
+
version: 4.7.1
|
109
109
|
description: This is the official Ruby client library for the Seats.io V2 REST API
|
110
110
|
email:
|
111
111
|
- nahuel@seats.io
|