ruby-office365 0.1.9 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ae4eff73f21d319447f7b789178a0befbc9f480631c72b9556e091f395c2905
4
- data.tar.gz: b2eeb9e486a6cace523a577c1c08453f6a0061b05d7212302b4fc7cc918f6d7a
3
+ metadata.gz: 3513de92b0360a54e0d374123fcf895427f951c47bb69b2f3e467898656ab943
4
+ data.tar.gz: '0600429d86539062c53f5507c02b9b711475ed40ddf2b69bdbad5aabe4f77042'
5
5
  SHA512:
6
- metadata.gz: f4f935c0fb140ef8e7758f6d2f481a9f38ca5acc256a58b1f9679c0efd1d37a60ec1bf06b22be7fd9812c909cde5162e0c4bcc9bd10b3cd1d3badc90e885132a
7
- data.tar.gz: a19af99ccc99cacf0beaddca0fa5288d8d0e3020dc01dd6c4eef183a38f1dee0b9144011471d966b16f72a72a400dc6b8e9afc80aced0f9eea1ae08d289cad15
6
+ metadata.gz: f2a8a7ab82422310f3a2abcc14efe98cc009b137e543f3c3001846a5649f933730baddcf98c9341eda9992042b6d3fe85959d8c650dac94965ca549ee1389e90
7
+ data.tar.gz: c7fcbf2ad9effed4e531c805de17a023c77a3b067e18ea467057956209aeb9109dc06c9542c401b4e28c73fc5e0aada76f71e52dbe3ae4dd28f72fa67188b60d
data/CHANGELOG.md CHANGED
@@ -1,27 +1,25 @@
1
1
  # Office365 Library Changelog
2
2
 
3
- ## [0.1.0] - (2022-10-19)
3
+ ## [0.2.0] - (2024-11-14)
4
4
 
5
- - Project setup and push to rubugems
5
+ - New feature on events: Allows users to get events by expected dates
6
+ - get events for the next week `client.events({ startdatetime: "2024-11-14T00:00:00.000Z", enddatetime: "2024-11-21T00:00:00.000Z" })`
6
7
 
7
- ## [0.1.1] - (2022-10-21)
8
+ ## [0.1.9] - (2024-08-08)
8
9
 
9
- - Integrate REST API to get data from Graph API
10
- - get profile `client.me`
11
- - get mailbox `client.messages`
12
- - get calenders `client.calenders`
10
+ - able to get event by identifier `client.event('xxxxxxxx')`
13
11
 
14
- ## [0.1.2] - (2022-10-21)
12
+ ## [0.1.7] - (2022-11-11)
15
13
 
16
- - Integrate REST API to get mailbox with pagination
17
- - get mailbox data with next link `client.messages({next_link: 'xxx'})`
18
- - get calenders data with next link `client.calenders({next_link: 'xxx'})`
14
+ - Improve performance: supports select and sort in REST APIs
15
+ - get messages by select fields `client.messages({ select: %[id] })`
16
+ - get messages by custom order `client.messages({ order: 'id asc' })`
19
17
 
20
- ## [0.1.3] - (2022-10-26)
18
+ ## [0.1.6] - (2022-11-01)
21
19
 
22
- - Integrate REST API to get contacts
23
- - get contacts `client.contacts`
24
- - get contacts data with next link `client.contacts({next_link: 'xxx'})`
20
+ - Integrate REST API to get events
21
+ - get events `client.events`
22
+ - get events data with next link `client.events({next_link: 'xxx'})`
25
23
 
26
24
  ## [0.1.5] - (2022-10-27)
27
25
 
@@ -30,14 +28,25 @@
30
28
  - get token URL `client.token_url`
31
29
  - be able to refresh token `client.refresh_token!`
32
30
 
33
- ## [0.1.6] - (2022-11-01)
31
+ ## [0.1.3] - (2022-10-26)
34
32
 
35
- - Integrate REST API to get events
36
- - get events `client.events`
37
- - get events data with next link `client.events({next_link: 'xxx'})`
33
+ - Integrate REST API to get contacts
34
+ - get contacts `client.contacts`
35
+ - get contacts data with next link `client.contacts({next_link: 'xxx'})`
38
36
 
39
- ## [0.1.7] - (2022-11-11)
37
+ ## [0.1.2] - (2022-10-21)
40
38
 
41
- - Improve performance: supports select and sort in REST APIs
42
- - get messages by select fields `client.messages({ select: %[id] })`
43
- - get messages by custom order `client.messages({ order: 'id asc' })`
39
+ - Integrate REST API to get mailbox with pagination
40
+ - get mailbox data with next link `client.messages({next_link: 'xxx'})`
41
+ - get calenders data with next link `client.calenders({next_link: 'xxx'})`
42
+
43
+ ## [0.1.1] - (2022-10-21)
44
+
45
+ - Integrate REST API to get data from Graph API
46
+ - get profile `client.me`
47
+ - get mailbox `client.messages`
48
+ - get calenders `client.calenders`
49
+
50
+ ## [0.1.0] - (2022-10-19)
51
+
52
+ - Project setup and push to rubugems
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-office365 (0.1.9)
4
+ ruby-office365 (0.2.0)
5
5
  faraday
6
6
  faraday_middleware
7
7
 
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # Office 365 (2022) <img src="https://i.ibb.co/g3mpswn/microsoft-office-365-logo-2016-100727915-large.webp" align="right" width="250" height="150">
1
+ # Office 365 (2024) <img src="https://i.ibb.co/g3mpswn/microsoft-office-365-logo-2016-100727915-large.webp" align="right" width="250" height="150">
2
+
2
3
  A simple ruby library to interact with Microsoft Graph **[Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer)** and Office 365 API
3
4
 
4
5
  ## Installation
@@ -100,6 +101,14 @@ irb(main):005:0> client.events[:results]
100
101
  irb(main):005:0> client.events[:next_link]
101
102
  ```
102
103
 
104
+ **Get my events for the next week**
105
+
106
+ ```ruby
107
+ irb(main):005:0> client.events({ startdatetime: "2024-11-14T00:00:00.000Z", enddatetime: "2024-11-21T00:00:00.000Z" })
108
+ irb(main):005:0> client.events[:results]
109
+ irb(main):005:0> client.events[:next_link]
110
+ ```
111
+
103
112
  **Get my event by id**
104
113
 
105
114
  ```ruby
@@ -107,7 +116,7 @@ irb(main):005:0> client.event('identifier')
107
116
  irb(main):005:0> client.event('identifier')[:results]
108
117
  ```
109
118
 
110
- Results will return an array even if it is a single result.
119
+ Results will return an array even if it is a single result.
111
120
 
112
121
  **Get my mails by access token**
113
122
 
@@ -210,7 +219,6 @@ irb(main):005:0> subscription = client.renew_subscription(args)
210
219
 
211
220
  will return the subscription object `Office365::Models::Subscription`
212
221
 
213
-
214
222
  ## Development
215
223
 
216
224
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -7,11 +7,23 @@ module Office365
7
7
  module Event
8
8
  include Concerns::Base
9
9
  BASE_URI = "/me/events"
10
+ CALENDARVIEW_URL = "/me/calendarview"
10
11
 
11
12
  # params: args => { next_link: (nil / next_page_url) }
13
+ # startdatetime: 2024-11-14T07:59:41.313Z
14
+ # enddatetime: 2024-11-21T07:59:41.313Z
12
15
  # response { results: [], next_link: '...' }
13
16
  def events(args = {})
14
- wrap_results(args.merge(kclass: Models::Event, base_uri: BASE_URI))
17
+ if args[:startdatetime] && args[:enddatetime]
18
+ wrap_results(
19
+ kclass: Models::Event,
20
+ base_uri: CALENDARVIEW_URL,
21
+ startdatetime: args[:startdatetime],
22
+ enddatetime: args[:enddatetime]
23
+ )
24
+ else
25
+ wrap_results(args.merge(kclass: Models::Event, base_uri: BASE_URI))
26
+ end
15
27
  end
16
28
 
17
29
  def event(identifier)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Office365
4
- VERSION = "0.1.9"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-office365
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Encore Shao
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-08 00:00:00.000000000 Z
11
+ date: 2024-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday