planningcenter_orbit 0.0.1 → 0.0.2
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/Gemfile.lock +3 -3
- data/lib/planningcenter_orbit/planningcenter.rb +8 -23
- data/lib/planningcenter_orbit/version.rb +1 -1
- data/planningcenter_orbit.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09bf43330f19510626739d4909cb24b419e3c2f24ac9fe100a3c17aa4771b6fc'
|
|
4
|
+
data.tar.gz: bffb2da031d7551ab624d3a24fa3d541d5bf2e6cefb329fe3b65d899dedde5ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c9259693c23dcb24479b021567dc8145fff8497bbd618e623dd4b40895486114f486b0afe5d95bcd2a39104b4e0f21e8e861024d8ded1bd67eaec00992f0bb24
|
|
7
|
+
data.tar.gz: f2c514c45f3cd941ff81f0e2aa744c67408eae5cc3e246b00833da18a78464b55584e6aaec8f88e5f26c54f0f9bf178bf94577d5d0f6f00186f604718e362361
|
data/Gemfile.lock
CHANGED
|
@@ -6,14 +6,14 @@ PATH
|
|
|
6
6
|
dotenv (~> 2.7)
|
|
7
7
|
http (~> 4.4)
|
|
8
8
|
json (~> 2.5)
|
|
9
|
-
orbit_activities (~> 0.
|
|
9
|
+
orbit_activities (~> 0.2.2)
|
|
10
10
|
thor (~> 1.1)
|
|
11
11
|
zeitwerk (~> 2.4)
|
|
12
12
|
|
|
13
13
|
GEM
|
|
14
14
|
remote: https://rubygems.org/
|
|
15
15
|
specs:
|
|
16
|
-
activesupport (6.1.
|
|
16
|
+
activesupport (6.1.4)
|
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
18
18
|
i18n (>= 1.6, < 2)
|
|
19
19
|
minitest (>= 5.1)
|
|
@@ -49,7 +49,7 @@ GEM
|
|
|
49
49
|
concurrent-ruby (~> 1.0)
|
|
50
50
|
json (2.5.1)
|
|
51
51
|
minitest (5.14.4)
|
|
52
|
-
orbit_activities (0.
|
|
52
|
+
orbit_activities (0.2.2)
|
|
53
53
|
http (~> 4.4)
|
|
54
54
|
json (~> 2.5)
|
|
55
55
|
rake (~> 13.0)
|
|
@@ -24,7 +24,7 @@ module PlanningcenterOrbit
|
|
|
24
24
|
|
|
25
25
|
times = 0
|
|
26
26
|
checkins.each do |checkin|
|
|
27
|
-
unless @historical_import
|
|
27
|
+
unless @historical_import && last_orbit_activity_timestamp
|
|
28
28
|
next if checkin["attributes"]["created_at"] < last_orbit_activity_timestamp
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -94,28 +94,13 @@ module PlanningcenterOrbit
|
|
|
94
94
|
|
|
95
95
|
def last_orbit_activity_timestamp
|
|
96
96
|
@last_orbit_activity_timestamp ||= begin
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
http = Net::HTTP.new(url.host, url.port)
|
|
105
|
-
http.use_ssl = true
|
|
106
|
-
req = Net::HTTP::Get.new(url)
|
|
107
|
-
req["Accept"] = "application/json"
|
|
108
|
-
req["Content-Type"] = "application/json"
|
|
109
|
-
req["Authorization"] = "Bearer #{@orbit_api_key}"
|
|
110
|
-
req["User-Agent"] = "community-ruby-planningcenter-orbit/#{PlanningcenterOrbit::VERSION}"
|
|
111
|
-
|
|
112
|
-
response = http.request(req)
|
|
113
|
-
|
|
114
|
-
response = JSON.parse(response.body)
|
|
115
|
-
|
|
116
|
-
return nil if response["data"].nil? || response["data"].empty?
|
|
117
|
-
|
|
118
|
-
response["data"][0]["attributes"]["created_at"]
|
|
97
|
+
OrbitActivities::Request.new(
|
|
98
|
+
api_key: @orbit_api_key,
|
|
99
|
+
workspace_id: @orbit_workspace,
|
|
100
|
+
user_agent: "community-ruby-planningcenter-orbit/#{PlanningcenterOrbit::VERSION}",
|
|
101
|
+
action: "latest_activity_timestamp",
|
|
102
|
+
filters: { activity_type: "custom:planning_center:check_in" }
|
|
103
|
+
).response
|
|
119
104
|
end
|
|
120
105
|
end
|
|
121
106
|
end
|
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
|
31
31
|
spec.add_dependency "zeitwerk", "~> 2.4"
|
|
32
32
|
spec.add_dependency "thor", "~> 1.1"
|
|
33
33
|
spec.add_dependency "dotenv", "~> 2.7"
|
|
34
|
-
spec.add_dependency "orbit_activities", "~> 0.
|
|
34
|
+
spec.add_dependency "orbit_activities", "~> 0.2.2"
|
|
35
35
|
spec.add_dependency "activesupport", "~> 6.1"
|
|
36
36
|
spec.add_development_dependency "rspec", "~> 3.4"
|
|
37
37
|
spec.add_development_dependency "webmock", "~> 3.12"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: planningcenter_orbit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Orbit DevRel
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2021-06-
|
|
12
|
+
date: 2021-06-25 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: http
|
|
@@ -87,14 +87,14 @@ dependencies:
|
|
|
87
87
|
requirements:
|
|
88
88
|
- - "~>"
|
|
89
89
|
- !ruby/object:Gem::Version
|
|
90
|
-
version:
|
|
90
|
+
version: 0.2.2
|
|
91
91
|
type: :runtime
|
|
92
92
|
prerelease: false
|
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
|
94
94
|
requirements:
|
|
95
95
|
- - "~>"
|
|
96
96
|
- !ruby/object:Gem::Version
|
|
97
|
-
version:
|
|
97
|
+
version: 0.2.2
|
|
98
98
|
- !ruby/object:Gem::Dependency
|
|
99
99
|
name: activesupport
|
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|