omnievent-outlook 0.1.0.pre1 → 0.1.0.pre2

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: 1bdff83325c93dd063851312331521252065778a198cba34a020cbf586eb7ddc
4
- data.tar.gz: caba4e605a84b7e060252ec8ca839af927d2b6d68cd67b4550aad6c55926934a
3
+ metadata.gz: 110be6c15bfe7032d8b0515f2273c71380e77d4ef089de895f4baf53be0dcd8e
4
+ data.tar.gz: 7efd60bb802eb86f9ba1be5b27d02a82ee69750a72e1c3f59e63f70526ecca6a
5
5
  SHA512:
6
- metadata.gz: 1e3a2a4fd77a55b0f366661bb56957f4756353b950d66c044068a52edad8b2e3a8a8b7469a21f73d5e87573c8621b3f02a7bee353af5285c4c6fe6e54cf58ead
7
- data.tar.gz: c2b521073a42278b57d622eca2868b1db7f26682e00e77deab87b35a20d0daf1f79ede628833d9c3bf7e543df40c38fd1912217565a608f5fcf2d7589bb15096
6
+ metadata.gz: 5001b87f3265eacf74bcdbef5a37f1ea6083cd0b53da7d7955c70fa59096559c6c28d25a32b8058ef34fc63d4e2c5d1b1ea0903f857f8b913877d04ef0aea098
7
+ data.tar.gz: 63e0ae827a676b843de1254623da2e7cbdf21112c940b0d816317c549d3469765a82b6f39ef438f00791ba61ed2837b7d9dc407fe4a7bb34dc2dca0af9fd37b8
data/Gemfile CHANGED
@@ -9,6 +9,4 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
11
11
 
12
- gem "rubocop", "~> 1.21"
13
-
14
- gem "omnievent", path: "/Users/angus/omnievent/omnievent"
12
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock CHANGED
@@ -5,14 +5,6 @@ PATH
5
5
  omnievent
6
6
  omnievent-api
7
7
 
8
- PATH
9
- remote: /Users/angus/omnievent/omnievent
10
- specs:
11
- omnievent (0.1.0.pre3)
12
- hashie (>= 3.4.6)
13
- iso-639 (~> 0.3.5)
14
- tzinfo (~> 2.0)
15
-
16
8
  GEM
17
9
  remote: https://rubygems.org/
18
10
  specs:
@@ -32,6 +24,10 @@ GEM
32
24
  iso-639 (0.3.6)
33
25
  json (2.7.2)
34
26
  language_server-protocol (3.17.0.3)
27
+ omnievent (0.1.0.pre3)
28
+ hashie (>= 3.4.6)
29
+ iso-639 (~> 0.3.5)
30
+ tzinfo (~> 2.0)
35
31
  omnievent-api (0.1.0.pre2)
36
32
  excon
37
33
  omnievent
@@ -87,7 +83,6 @@ PLATFORMS
87
83
 
88
84
  DEPENDENCIES
89
85
  byebug
90
- omnievent!
91
86
  omnievent-outlook!
92
87
  rake (~> 13.0)
93
88
  rspec (~> 3.0)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniEvent
4
4
  module Outlook
5
- VERSION = "0.1.0.pre1"
5
+ VERSION = "0.1.0.pre2"
6
6
  end
7
7
  end
@@ -14,7 +14,7 @@ module OmniEvent
14
14
  API_VERSION = "v1.0"
15
15
 
16
16
  def raw_events
17
- response = perform_request(path: request_path)
17
+ response = perform_request(path: events_request_path)
18
18
  events = response["value"]
19
19
  next_link = response["@odata.nextLink"]
20
20
 
@@ -29,8 +29,8 @@ module OmniEvent
29
29
 
30
30
  def event_hash(raw_event)
31
31
  data = {
32
- start_time: format_time(raw_event["start"]["dateTime"]),
33
- end_time: format_time(raw_event["end"]["dateTime"]),
32
+ start_time: format_outlook_datetime(raw_event["start"]["dateTime"]),
33
+ end_time: format_outlook_datetime(raw_event["end"]["dateTime"]),
34
34
  name: raw_event["subject"],
35
35
  description: raw_event["bodyPreview"],
36
36
  url: raw_event["webLink"]
@@ -39,6 +39,8 @@ module OmniEvent
39
39
  metadata = {
40
40
  uid: raw_event["id"],
41
41
  status: convert_status(raw_event),
42
+ # created and modified datetime are already in ISO format
43
+ # https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0#properties
42
44
  created_at: format_time(raw_event["createdDateTime"]),
43
45
  updated_at: format_time(raw_event["lastModifiedDateTime"])
44
46
  }
@@ -56,8 +58,8 @@ module OmniEvent
56
58
  "https://graph.microsoft.com"
57
59
  end
58
60
 
59
- def request_path
60
- @request_path ||= begin
61
+ def events_request_path
62
+ @events_request_path ||= begin
61
63
  path = "/#{API_VERSION}"
62
64
 
63
65
  # endpoint
@@ -83,6 +85,14 @@ module OmniEvent
83
85
 
84
86
  "published"
85
87
  end
88
+
89
+ # All start and end times are returned in UTC
90
+ # See https://learn.microsoft.com/en-us/graph/api/calendar-list-events?view=graph-rest-1.0&tabs=http#request-headers
91
+ def format_outlook_datetime(datetime)
92
+ # DateTime parses to UTC by default
93
+ utc_datetime = DateTime.parse(datetime)
94
+ format_time(utc_datetime.to_s)
95
+ end
86
96
  end
87
97
  end
88
98
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnievent-outlook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre1
4
+ version: 0.1.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angus McLeod
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-22 00:00:00.000000000 Z
11
+ date: 2024-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omnievent