kandji 0.1.0 → 0.1.1
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/CHANGELOG.md +10 -5
- data/README.md +19 -11
- data/lib/kandji/client.rb +14 -0
- data/lib/kandji/device/activities.rb +11 -0
- data/lib/kandji/logs.rb +9 -0
- data/lib/kandji/users.rb +13 -0
- data/lib/kandji/version.rb +1 -1
- data/lib/kandji.rb +5 -1
- metadata +6 -4
- data/lib/kandji/api.rb +0 -4
- /data/lib/kandji/{api/device → device}/applications.rb +0 -0
- /data/lib/kandji/{api/devices.rb → devices.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 528755a882fcf3d4e1f739f3d5aeb050eeccb82078925308eaae01fe47cdf041
|
4
|
+
data.tar.gz: 5ade57831d6f73d679f03ef2f8ea3dcc4b8512a2d5ea7fa4d456f19b308ef395
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf06423f2138261895b74dc7c17c7407783c2a9a739fa013b32cd69d248657709a918bc14441b993db6af9ecbc31b987d57ff05874abbe5cbf52e050971b5243
|
7
|
+
data.tar.gz: cac4df83de21b0b546bd5960456992d250de0a5844d85b658c70015cd6ad67e6de21723cd560ed46b03b5e7043bd04bcf27f1e8a7735273e803c69a927ba820a
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,16 @@
|
|
1
|
-
## [
|
1
|
+
## [0.1.1]
|
2
2
|
|
3
|
-
- Setup configuration
|
4
3
|
- Implement endpoints:
|
5
|
-
- Devices.all
|
6
|
-
-
|
7
|
-
-
|
4
|
+
- Devices::Activities.all
|
5
|
+
- Logs.all
|
6
|
+
- Users.all
|
7
|
+
- Users.find(id)
|
8
8
|
|
9
9
|
## [0.1.0] - 2025-05-06
|
10
10
|
|
11
11
|
- Initial release
|
12
|
+
- Setup configuration
|
13
|
+
- Implement endpoints:
|
14
|
+
- Devices.all
|
15
|
+
- Devices.find(device_id)
|
16
|
+
- Device::Applications.all
|
data/README.md
CHANGED
@@ -1,28 +1,36 @@
|
|
1
1
|
# Kandji
|
2
2
|
|
3
|
-
TODO: Delete this and the text below, and describe your gem
|
4
|
-
|
5
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/kandji`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
|
-
|
7
3
|
## Installation
|
8
4
|
|
9
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
10
|
-
|
11
5
|
Install the gem and add to the application's Gemfile by executing:
|
12
6
|
|
13
7
|
```bash
|
14
|
-
bundle add
|
8
|
+
bundle add kandji
|
15
9
|
```
|
16
10
|
|
17
11
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
18
12
|
|
19
13
|
```bash
|
20
|
-
gem install
|
14
|
+
gem install kandji
|
21
15
|
```
|
22
16
|
|
23
17
|
## Usage
|
24
18
|
|
25
|
-
|
19
|
+
First you will have to confige the gem. You need to setup an API key on Kandji. Once you've retrieved that, you are ready:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
Kandji.configure do |config|
|
23
|
+
config.api_token = 'your-api-token'
|
24
|
+
config.organization_url = 'your-kanjdi-api-url'
|
25
|
+
end
|
26
|
+
```
|
27
|
+
|
28
|
+
Then once you have the client setup, you can call the API. Some examples:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
Kandji::Applications.all
|
32
|
+
Kandji::Users.find(user_id)
|
33
|
+
```
|
26
34
|
|
27
35
|
## Development
|
28
36
|
|
@@ -32,7 +40,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
40
|
|
33
41
|
## Contributing
|
34
42
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
43
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/monarchmoney/kandji. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/monarchmoney/kandji/blob/main/CODE_OF_CONDUCT.md).
|
36
44
|
|
37
45
|
## License
|
38
46
|
|
@@ -40,4 +48,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
48
|
|
41
49
|
## Code of Conduct
|
42
50
|
|
43
|
-
Everyone interacting in the Kandji project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
51
|
+
Everyone interacting in the Kandji project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/monarchmoney/kandji/blob/main/CODE_OF_CONDUCT.md).
|
data/lib/kandji/client.rb
CHANGED
@@ -27,6 +27,20 @@ module Kandji
|
|
27
27
|
all_results
|
28
28
|
end
|
29
29
|
|
30
|
+
def self.paginated_cursor_get(path, params = {})
|
31
|
+
params[:limit] = params[:limit] || 500
|
32
|
+
url = build_url(path, params)
|
33
|
+
|
34
|
+
all_results = []
|
35
|
+
loop do
|
36
|
+
response = JSON.parse(RestClient.get(url, headers))
|
37
|
+
all_results.concat(response["results"])
|
38
|
+
url = response["next"]
|
39
|
+
break unless url
|
40
|
+
end
|
41
|
+
all_results
|
42
|
+
end
|
43
|
+
|
30
44
|
def self.build_url(path, params)
|
31
45
|
url = "#{Kandji.organization_url}/api/#{API_VERSION}/#{path}"
|
32
46
|
url += "?#{URI.encode_www_form(params)}" unless params.empty?
|
data/lib/kandji/logs.rb
ADDED
data/lib/kandji/users.rb
ADDED
data/lib/kandji/version.rb
CHANGED
data/lib/kandji.rb
CHANGED
@@ -3,7 +3,11 @@
|
|
3
3
|
require_relative "kandji/version"
|
4
4
|
require_relative "kandji/configuration"
|
5
5
|
require_relative "kandji/client"
|
6
|
-
require_relative "kandji/
|
6
|
+
require_relative "kandji/devices"
|
7
|
+
require_relative "kandji/device/applications"
|
8
|
+
require_relative "kandji/logs"
|
9
|
+
require_relative "kandji/device/activities"
|
10
|
+
require_relative "kandji/users"
|
7
11
|
|
8
12
|
module Kandji
|
9
13
|
extend Configuration
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kandji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lien Van Den Steen
|
@@ -52,11 +52,13 @@ files:
|
|
52
52
|
- README.md
|
53
53
|
- Rakefile
|
54
54
|
- lib/kandji.rb
|
55
|
-
- lib/kandji/api.rb
|
56
|
-
- lib/kandji/api/device/applications.rb
|
57
|
-
- lib/kandji/api/devices.rb
|
58
55
|
- lib/kandji/client.rb
|
59
56
|
- lib/kandji/configuration.rb
|
57
|
+
- lib/kandji/device/activities.rb
|
58
|
+
- lib/kandji/device/applications.rb
|
59
|
+
- lib/kandji/devices.rb
|
60
|
+
- lib/kandji/logs.rb
|
61
|
+
- lib/kandji/users.rb
|
60
62
|
- lib/kandji/version.rb
|
61
63
|
- sig/kandji.rbs
|
62
64
|
homepage: https://github.com/monarchmoney/kandji
|
data/lib/kandji/api.rb
DELETED
File without changes
|
File without changes
|