ruby-office365 0.1.9 → 0.2.1

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: 5ae4eff73f21d319447f7b789178a0befbc9f480631c72b9556e091f395c2905
4
- data.tar.gz: b2eeb9e486a6cace523a577c1c08453f6a0061b05d7212302b4fc7cc918f6d7a
3
+ metadata.gz: ac3b26253e6a59472941c7cb2a1cbedf4903e04ecd0a6b3e1408411379baa7d8
4
+ data.tar.gz: aae5b8d7c74d3dd4e2bc79bcdc1b031eb7c2acbec3ca0c87e88df72225cf1fc0
5
5
  SHA512:
6
- metadata.gz: f4f935c0fb140ef8e7758f6d2f481a9f38ca5acc256a58b1f9679c0efd1d37a60ec1bf06b22be7fd9812c909cde5162e0c4bcc9bd10b3cd1d3badc90e885132a
7
- data.tar.gz: a19af99ccc99cacf0beaddca0fa5288d8d0e3020dc01dd6c4eef183a38f1dee0b9144011471d966b16f72a72a400dc6b8e9afc80aced0f9eea1ae08d289cad15
6
+ metadata.gz: c305b0ba9f23a42028cbcbbf4b00f9fd359ae6bd0a8e020b49a3ad0a31116c096910fbad48907f51b2273ab935e7a43f46f3c26dd9891516179c65cfd04aff01
7
+ data.tar.gz: a581cbcc394e4c92dcc8c9c4b8fae51531f94fb267dda5813091d4b4108d77819f20b430e336055e2ba72edfc2faac5e19171834106cef8a4f8229e6a6b3b85d
data/CHANGELOG.md CHANGED
@@ -1,27 +1,29 @@
1
1
  # Office365 Library Changelog
2
2
 
3
- ## [0.1.0] - (2022-10-19)
3
+ ## [0.2.1] - (2024-12-11)
4
4
 
5
- - Project setup and push to rubugems
5
+ - FIX events: Manage correctly next_link
6
6
 
7
- ## [0.1.1] - (2022-10-21)
7
+ ## [0.2.0] - (2024-11-14)
8
8
 
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`
9
+ - New feature on events: Allows users to get events by expected dates
10
+ - get events for the next week `client.events({ startdatetime: "2024-11-14T00:00:00.000Z", enddatetime: "2024-11-21T00:00:00.000Z" })`
13
11
 
14
- ## [0.1.2] - (2022-10-21)
12
+ ## [0.1.9] - (2024-08-08)
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
+ - able to get event by identifier `client.event('xxxxxxxx')`
19
15
 
20
- ## [0.1.3] - (2022-10-26)
16
+ ## [0.1.7] - (2022-11-11)
21
17
 
22
- - Integrate REST API to get contacts
23
- - get contacts `client.contacts`
24
- - get contacts data with next link `client.contacts({next_link: 'xxx'})`
18
+ - Improve performance: supports select and sort in REST APIs
19
+ - get messages by select fields `client.messages({ select: %[id] })`
20
+ - get messages by custom order `client.messages({ order: 'id asc' })`
21
+
22
+ ## [0.1.6] - (2022-11-01)
23
+
24
+ - Integrate REST API to get events
25
+ - get events `client.events`
26
+ - get events data with next link `client.events({next_link: 'xxx'})`
25
27
 
26
28
  ## [0.1.5] - (2022-10-27)
27
29
 
@@ -30,14 +32,25 @@
30
32
  - get token URL `client.token_url`
31
33
  - be able to refresh token `client.refresh_token!`
32
34
 
33
- ## [0.1.6] - (2022-11-01)
35
+ ## [0.1.3] - (2022-10-26)
34
36
 
35
- - Integrate REST API to get events
36
- - get events `client.events`
37
- - get events data with next link `client.events({next_link: 'xxx'})`
37
+ - Integrate REST API to get contacts
38
+ - get contacts `client.contacts`
39
+ - get contacts data with next link `client.contacts({next_link: 'xxx'})`
38
40
 
39
- ## [0.1.7] - (2022-11-11)
41
+ ## [0.1.2] - (2022-10-21)
40
42
 
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' })`
43
+ - Integrate REST API to get mailbox with pagination
44
+ - get mailbox data with next link `client.messages({next_link: 'xxx'})`
45
+ - get calenders data with next link `client.calenders({next_link: 'xxx'})`
46
+
47
+ ## [0.1.1] - (2022-10-21)
48
+
49
+ - Integrate REST API to get data from Graph API
50
+ - get profile `client.me`
51
+ - get mailbox `client.messages`
52
+ - get calenders `client.calenders`
53
+
54
+ ## [0.1.0] - (2022-10-19)
55
+
56
+ - 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.1)
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,25 @@ 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
+ args.merge(
20
+ kclass: Models::Event,
21
+ base_uri: CALENDARVIEW_URL,
22
+ startdatetime: args[:startdatetime],
23
+ enddatetime: args[:enddatetime]
24
+ )
25
+ )
26
+ else
27
+ wrap_results(args.merge(kclass: Models::Event, base_uri: BASE_URI))
28
+ end
15
29
  end
16
30
 
17
31
  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.1"
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.1
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-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday