notion_orbit 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/.env.sample +5 -0
  3. data/.github/CODE_OF_CONDUCT.md +134 -0
  4. data/.github/CONTRIBUTING.md +69 -0
  5. data/.github/workflows/CI.yml +25 -0
  6. data/.gitignore +34 -0
  7. data/Gemfile +11 -0
  8. data/Gemfile.lock +115 -0
  9. data/LICENSE +21 -0
  10. data/README.md +108 -0
  11. data/bin/console +16 -0
  12. data/bin/notion_orbit +28 -0
  13. data/bin/setup +8 -0
  14. data/docs/database-id-location.png +0 -0
  15. data/docs/new-note-screenshot.png +0 -0
  16. data/docs/setup-table-for-orbit.png +0 -0
  17. data/docs/setup.md +17 -0
  18. data/docs/ways-to-use.png +0 -0
  19. data/lib/notion_orbit.rb +12 -0
  20. data/lib/notion_orbit/client.rb +55 -0
  21. data/lib/notion_orbit/interactions/note.rb +37 -0
  22. data/lib/notion_orbit/notion.rb +42 -0
  23. data/lib/notion_orbit/notion_objects/block.rb +60 -0
  24. data/lib/notion_orbit/notion_objects/block_types/bulleted_list_item.rb +15 -0
  25. data/lib/notion_orbit/notion_objects/block_types/heading_1.rb +11 -0
  26. data/lib/notion_orbit/notion_objects/block_types/heading_2.rb +11 -0
  27. data/lib/notion_orbit/notion_objects/block_types/heading_3.rb +11 -0
  28. data/lib/notion_orbit/notion_objects/block_types/numbered_list_item.rb +15 -0
  29. data/lib/notion_orbit/notion_objects/block_types/paragraph.rb +15 -0
  30. data/lib/notion_orbit/notion_objects/block_types/to_do.rb +11 -0
  31. data/lib/notion_orbit/notion_objects/block_types/unsupported.rb +11 -0
  32. data/lib/notion_orbit/notion_objects/blocks.rb +18 -0
  33. data/lib/notion_orbit/notion_objects/rich_text.rb +36 -0
  34. data/lib/notion_orbit/orbit.rb +16 -0
  35. data/lib/notion_orbit/services/notion.rb +57 -0
  36. data/lib/notion_orbit/services/orbit.rb +73 -0
  37. data/lib/notion_orbit/version.rb +5 -0
  38. data/notion_orbit.gemspec +43 -0
  39. data/scripts/check_notes.rb +17 -0
  40. metadata +201 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e232465c58461d0a1b158c2ec05d2789ddfa6b1d18b4561cf46a3b672636cccb
4
+ data.tar.gz: e7c7f41748225b10b21344dc646341d8bb922d55d4707cecb58aa7c7cc2053ad
5
+ SHA512:
6
+ metadata.gz: de6d07fc1abae73549f1e4480fa09f33252649442c2f6b561fce60177712878f769077541e5d9de49377bb268bda9ad489e913d0736691bc501c5f5cfab18382
7
+ data.tar.gz: 55e3a0148df8e5f9cc5061d6fd74e40b3e060f2b89e4b28eecce95b2da4bd278673e16bbcd4de3646e00bc6d557cd82c15b5c572a3657d1b179ad9062179836b
data/.env.sample ADDED
@@ -0,0 +1,5 @@
1
+ ORBIT_API_KEY=
2
+ ORBIT_WORKSPACE_ID=
3
+ NOTION_API_KEY=
4
+ NOTION_WORKSPACE_SLUG=
5
+ NOTION_DATABASE_ID=
@@ -0,0 +1,134 @@
1
+ <small><a href="../README.md">Back to README</a></small>
2
+
3
+ # Code of Conduct
4
+
5
+ ## Our Pledge
6
+
7
+ We as members, contributors, and leaders pledge to make participation in our
8
+ community a harassment-free experience for everyone, regardless of age, body
9
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
10
+ identity and expression, level of experience, education, socio-economic status,
11
+ nationality, personal appearance, race, caste, color, religion, or sexual identity
12
+ and orientation.
13
+
14
+ We pledge to act and interact in ways that contribute to an open, welcoming,
15
+ diverse, inclusive, and healthy community.
16
+
17
+ ## Our Standards
18
+
19
+ Examples of behavior that contributes to a positive environment for our
20
+ community include:
21
+
22
+ * Demonstrating empathy and kindness toward other people
23
+ * Being respectful of differing opinions, viewpoints, and experiences
24
+ * Giving and gracefully accepting constructive feedback
25
+ * Accepting responsibility and apologizing to those affected by our mistakes,
26
+ and learning from the experience
27
+ * Focusing on what is best not just for us as individuals, but for the
28
+ overall community
29
+
30
+ Examples of unacceptable behavior include:
31
+
32
+ * The use of sexualized language or imagery, and sexual attention or
33
+ advances of any kind
34
+ * Trolling, insulting or derogatory comments, and personal or political attacks
35
+ * Public or private harassment
36
+ * Publishing others' private information, such as a physical or email
37
+ address, without their explicit permission
38
+ * Other conduct which could reasonably be considered inappropriate in a
39
+ professional setting
40
+
41
+ ## Enforcement Responsibilities
42
+
43
+ Community leaders are responsible for clarifying and enforcing our standards of
44
+ acceptable behavior and will take appropriate and fair corrective action in
45
+ response to any behavior that they deem inappropriate, threatening, offensive,
46
+ or harmful.
47
+
48
+ Community leaders have the right and responsibility to remove, edit, or reject
49
+ comments, commits, code, wiki edits, issues, and other contributions that are
50
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
51
+ decisions when appropriate.
52
+
53
+ ## Scope
54
+
55
+ This Code of Conduct applies within all community spaces, and also applies when
56
+ an individual is officially representing the community in public spaces.
57
+ Examples of representing our community include using an official e-mail address,
58
+ posting via an official social media account, or acting as an appointed
59
+ representative at an online or offline event.
60
+
61
+ ## Enforcement
62
+
63
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
64
+ reported to the community leaders responsible for enforcement at
65
+ team@orbit.love.
66
+ All complaints will be reviewed and investigated promptly and fairly.
67
+
68
+ All community leaders are obligated to respect the privacy and security of the
69
+ reporter of any incident.
70
+
71
+ ## Enforcement Guidelines
72
+
73
+ Community leaders will follow these Community Impact Guidelines in determining
74
+ the consequences for any action they deem in violation of this Code of Conduct:
75
+
76
+ ### 1. Correction
77
+
78
+ **Community Impact**: Use of inappropriate language or other behavior deemed
79
+ unprofessional or unwelcome in the community.
80
+
81
+ **Consequence**: A private, written warning from community leaders, providing
82
+ clarity around the nature of the violation and an explanation of why the
83
+ behavior was inappropriate. A public apology may be requested.
84
+
85
+ ### 2. Warning
86
+
87
+ **Community Impact**: A violation through a single incident or series
88
+ of actions.
89
+
90
+ **Consequence**: A warning with consequences for continued behavior. No
91
+ interaction with the people involved, including unsolicited interaction with
92
+ those enforcing the Code of Conduct, for a specified period of time. This
93
+ includes avoiding interactions in community spaces as well as external channels
94
+ like social media. Violating these terms may lead to a temporary or
95
+ permanent ban.
96
+
97
+ ### 3. Temporary Ban
98
+
99
+ **Community Impact**: A serious violation of community standards, including
100
+ sustained inappropriate behavior.
101
+
102
+ **Consequence**: A temporary ban from any sort of interaction or public
103
+ communication with the community for a specified period of time. No public or
104
+ private interaction with the people involved, including unsolicited interaction
105
+ with those enforcing the Code of Conduct, is allowed during this period.
106
+ Violating these terms may lead to a permanent ban.
107
+
108
+ ### 4. Permanent Ban
109
+
110
+ **Community Impact**: Demonstrating a pattern of violation of community
111
+ standards, including sustained inappropriate behavior, harassment of an
112
+ individual, or aggression toward or disparagement of classes of individuals.
113
+
114
+ **Consequence**: A permanent ban from any sort of public interaction within
115
+ the community.
116
+
117
+ ## Attribution
118
+
119
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
120
+ version 2.0, available at
121
+ [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
122
+
123
+ Community Impact Guidelines were inspired by
124
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available
128
+ at [https://www.contributor-covenant.org/translations][translations].
129
+
130
+ [homepage]: https://www.contributor-covenant.org
131
+ [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
132
+ [Mozilla CoC]: https://github.com/mozilla/diversity
133
+ [FAQ]: https://www.contributor-covenant.org/faq
134
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,69 @@
1
+ <small><a href="../README.md">Back to README</a></small>
2
+
3
+ # Contributing Guidelines
4
+
5
+ We 💜 contributions from everyone! 🎉
6
+
7
+ It is a good idea to [talk to us on Discord](https://discord.orbit.love/) first if you plan to add any new functionality. Otherwise, bug reports, bug fixes and feedback on this project is always appreciated.
8
+
9
+ ![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat "Contributions Welcome")
10
+
11
+ The following is a set of guidelines for contributing to this project, which are hosted on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
12
+
13
+ Please take the time to review the [Code of Conduct](CODE_OF_CONDUCT.md), which all contributors are subject to on this project.
14
+
15
+ **Table of Contents**
16
+
17
+ - [Reporting Bugs](#reporting-bugs)
18
+ - [Suggesting Enhancements](#suggesting-enhancements)
19
+ - [Pull Requests](#pull-requests)
20
+
21
+ ## Reporting Bugs
22
+
23
+ This section guides you through submitting a bug report. Following these guidelines helps maintainers and the community understand your report , reproduce the behavior, and find related reports.
24
+
25
+ Before creating bug reports, please do a quick search of existing issues as you might find out that you don't need to create one.
26
+
27
+ When you are creating a bug report, please include as many details as possible. Fill out the required template, the information it asks for helps us resolve issues faster.
28
+
29
+ ### How Do I Submit A (Good) Bug Report?
30
+
31
+ Bugs are tracked as GitHub issues. Create an issue and provide the following information by filling in the provided template which appears when you try and open an issue.
32
+
33
+ Explain the problem and include additional details to help maintainers reproduce the problem:
34
+
35
+ * **Use a clear and descriptive title** for the issue to identify the problem.
36
+ * **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you started. When listing steps, **don't just say what you did, but explain how you did it**.
37
+ * **Provide specific examples to demonstrate the steps**. Include links to files or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use Markdown code blocks.
38
+ * **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
39
+ * **Explain which behavior you expected to see instead and why.**
40
+ * **Include screenshots and animated GIFs** where possible. Show how you follow the described steps and clearly demonstrate the problem.
41
+ * **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
42
+ * **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
43
+ Include details about your configuration and environment:
44
+
45
+ ## Suggesting Enhancements
46
+
47
+ This section guides you through submitting a suggestion, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions.
48
+
49
+ Before creating a suggestion, please do a quick search of existing issues as you might find out that you don't need to create one.
50
+
51
+ ### How Do I Submit A (Good) Enhancement Suggestion?
52
+
53
+ Enhancement suggestions are tracked as GitHub issues. Create an issue and provide the following information by filling in the provided template which appears when you try and open an issue.
54
+
55
+ * **Use a clear and descriptive title** for the issue to identify the suggestion.
56
+ * **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
57
+ * **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as Markdown code blocks.
58
+ * **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
59
+ * **Explain why this enhancement would be useful** to most users.
60
+
61
+ ## Pull Requests
62
+
63
+ Please follow these steps to have your contribution considered by the maintainers:
64
+
65
+ 1. Follow all instructions in the template.
66
+ 2. Adhear the Code of Conduct.
67
+ 3. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing.
68
+
69
+ While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
@@ -0,0 +1,25 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ strategy:
12
+ matrix:
13
+ os: [ubuntu-latest, macos-latest]
14
+ ruby: [2.7, 3.0]
15
+ runs-on: ${{ matrix.os }}
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+ - name: Install dependencies
23
+ run: bundle install
24
+ - name: Run tests
25
+ run: bundle exec rspec
data/.gitignore ADDED
@@ -0,0 +1,34 @@
1
+ .env
2
+ *.db
3
+ .DS_Store
4
+ node_modules
5
+ *.gem
6
+ *.rbc
7
+ *.sassc
8
+ .bundle
9
+ .config
10
+ .yardoc
11
+ .rvmrc
12
+ .rspec
13
+ .sass-cache
14
+ .DS_Store
15
+ Gemfile.lock # gem projects only!
16
+ InstalledFiles
17
+ _yardoc
18
+ coverage
19
+ lib/bundler/man
20
+ capybara-*.html
21
+ pkg
22
+ rdoc
23
+ spec/reports
24
+ spec/tmp
25
+ test/tmp
26
+ test/version_tmp
27
+ tmp
28
+ logs
29
+ *.log
30
+ npm-debug.log*
31
+ yarn-debug.log*
32
+ yarn-error.log*
33
+ .npm
34
+ .byebug_history
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
6
+
7
+ gem "rake", "~> 13.0"
8
+
9
+ gem "rubocop", "~> 1.7"
10
+
11
+ gem "byebug"
data/Gemfile.lock ADDED
@@ -0,0 +1,115 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ notion_orbit (0.0.1)
5
+ dotenv
6
+ http (~> 4.4)
7
+ json (~> 2.5)
8
+ notion-ruby-client
9
+ thor (~> 1.1)
10
+ zeitwerk (~> 2.4)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ addressable (2.7.0)
16
+ public_suffix (>= 2.0.2, < 5.0)
17
+ ast (2.4.2)
18
+ byebug (11.1.3)
19
+ crack (0.4.5)
20
+ rexml
21
+ diff-lcs (1.4.4)
22
+ domain_name (0.5.20190701)
23
+ unf (>= 0.0.5, < 1.0.0)
24
+ dotenv (2.7.6)
25
+ faraday (1.4.1)
26
+ faraday-excon (~> 1.1)
27
+ faraday-net_http (~> 1.0)
28
+ faraday-net_http_persistent (~> 1.1)
29
+ multipart-post (>= 1.2, < 3)
30
+ ruby2_keywords (>= 0.0.4)
31
+ faraday-excon (1.1.0)
32
+ faraday-net_http (1.0.1)
33
+ faraday-net_http_persistent (1.1.0)
34
+ faraday_middleware (1.0.0)
35
+ faraday (~> 1.0)
36
+ ffi (1.15.0)
37
+ ffi-compiler (1.0.1)
38
+ ffi (>= 1.0.0)
39
+ rake
40
+ hashdiff (1.0.1)
41
+ hashie (4.1.0)
42
+ http (4.4.1)
43
+ addressable (~> 2.3)
44
+ http-cookie (~> 1.0)
45
+ http-form_data (~> 2.2)
46
+ http-parser (~> 1.2.0)
47
+ http-cookie (1.0.3)
48
+ domain_name (~> 0.5)
49
+ http-form_data (2.3.0)
50
+ http-parser (1.2.3)
51
+ ffi-compiler (>= 1.0, < 2.0)
52
+ json (2.5.1)
53
+ multipart-post (2.1.1)
54
+ notion-ruby-client (0.0.5)
55
+ faraday (>= 1.0)
56
+ faraday_middleware
57
+ hashie
58
+ parallel (1.20.1)
59
+ parser (3.0.1.1)
60
+ ast (~> 2.4.1)
61
+ public_suffix (4.0.6)
62
+ rainbow (3.0.0)
63
+ rake (13.0.3)
64
+ regexp_parser (2.1.1)
65
+ rexml (3.2.5)
66
+ rspec (3.10.0)
67
+ rspec-core (~> 3.10.0)
68
+ rspec-expectations (~> 3.10.0)
69
+ rspec-mocks (~> 3.10.0)
70
+ rspec-core (3.10.1)
71
+ rspec-support (~> 3.10.0)
72
+ rspec-expectations (3.10.1)
73
+ diff-lcs (>= 1.2.0, < 2.0)
74
+ rspec-support (~> 3.10.0)
75
+ rspec-mocks (3.10.2)
76
+ diff-lcs (>= 1.2.0, < 2.0)
77
+ rspec-support (~> 3.10.0)
78
+ rspec-support (3.10.2)
79
+ rubocop (1.15.0)
80
+ parallel (~> 1.10)
81
+ parser (>= 3.0.0.0)
82
+ rainbow (>= 2.2.2, < 4.0)
83
+ regexp_parser (>= 1.8, < 3.0)
84
+ rexml
85
+ rubocop-ast (>= 1.5.0, < 2.0)
86
+ ruby-progressbar (~> 1.7)
87
+ unicode-display_width (>= 1.4.0, < 3.0)
88
+ rubocop-ast (1.6.0)
89
+ parser (>= 3.0.1.1)
90
+ ruby-progressbar (1.11.0)
91
+ ruby2_keywords (0.0.4)
92
+ thor (1.1.0)
93
+ unf (0.1.4)
94
+ unf_ext
95
+ unf_ext (0.0.7.7)
96
+ unicode-display_width (2.0.0)
97
+ webmock (3.13.0)
98
+ addressable (>= 2.3.6)
99
+ crack (>= 0.3.2)
100
+ hashdiff (>= 0.4.0, < 2.0.0)
101
+ zeitwerk (2.4.2)
102
+
103
+ PLATFORMS
104
+ arm64-darwin-20
105
+
106
+ DEPENDENCIES
107
+ byebug
108
+ notion_orbit!
109
+ rake (~> 13.0)
110
+ rspec (~> 3.4)
111
+ rubocop (~> 1.7)
112
+ webmock (~> 3.12)
113
+
114
+ BUNDLED WITH
115
+ 2.2.16
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Orbit Labs, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # Notion Notes to Orbit Workspace
2
+
3
+
4
+ ![Build Status](https://github.com/orbit-love/community-ruby-notion-orbit/workflows/CI/badge.svg)
5
+ [![Gem Version](https://badge.fury.io/rb/notion_orbit.svg)](https://badge.fury.io/rb/notion_orbit)
6
+ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](.github/CODE_OF_CONDUCT.md)
7
+
8
+ Add your Notion notes into your Orbit workspace with this community-built integration.
9
+
10
+ ![Screenshot of a new note in Orbit](docs/new-note-screenshot.png)
11
+
12
+ | <p align="left">:sparkles:</p> This is a _community project_. The Orbit team does its best to maintain it and keep it up to date with any recent API changes.<br/><br/>We welcome community contributions to make sure that it stays current. <p align="right">:sparkles:</p> |
13
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
14
+
15
+ ![There are three ways to use this integration. Install package - build and run your own applications. Run the CLI - run on-demand directly from your terminal. Schedule an automation with GitHub - get started in minutes - no coding required](docs/ways-to-use.png)
16
+
17
+ ## First Time Setup
18
+
19
+ To set up this integration you will need some details from Notion. To get these details please follow the [First Time Setup guide](docs/setup.md).
20
+
21
+ ## Application Credentials
22
+
23
+ The application requires the following environment variables:
24
+
25
+ | Variable | Description | More Info |
26
+ | ----------------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------- |
27
+ | `NOTION_API_KEY` | The secret Notion API key | Follow the [First Time Setup Guide](docs/setup.md) for instructions on finding the API key |
28
+ | `NOTION_WORKSPACE_SLUG` | Your Notion workspace name | If your website address is `https://notion.so/my-workspace/` then your slug is `my-workspace` |
29
+ | `NOTION_DATABASE_ID` | The ID of the Notion database this integration is tracking | Your database ID the part of your Notion database URL that follows after your workspace slug and before the question mark (`?`). The ID is 32 characters long, containing numbers and letters.<br/>![Screenshot of how to identify the database ID](docs/database-id-location.png) |
30
+ | `ORBIT_API_KEY` | API key for Orbit | Found in `Account Settings` in your Orbit workspace |
31
+ | `ORBIT_WORKSPACE_ID` | ID for your Orbit workspace | Last part of the Orbit workspace URL, i.e. `https://app.orbit.love/my-workspace`, the ID is `my-workspace` |
32
+
33
+ ## Package Usage
34
+
35
+ Install the package with the following command
36
+
37
+ ```
38
+ $ gem install notion_orbit
39
+ ```
40
+
41
+ Then, run `bundle install` from your terminal.
42
+
43
+ You can instantiate a client by either passing in the required credentials during instantiation or by providing them in your `.env` file.
44
+
45
+ ### Instantiation with credentials:
46
+
47
+ ```ruby
48
+ client = NotionOrbit::Client.new(
49
+ orbit_api_key: YOUR_API_KEY,
50
+ orbit_workspace_id: YOUR_ORBIT_WORKSPACE_ID,
51
+ notion_api_key: YOUR_NOTION_API_KEY,
52
+ notion_database_id: YOUR_NOTION_DATABASE_ID,
53
+ notion_workspace_slug: YOUR_NOTION_WORKSPACE_SLUG
54
+ )
55
+ ```
56
+
57
+ ### Instantiation with credentials in dotenv file:
58
+
59
+ ```ruby
60
+ client = NotionOrbit::Client.new
61
+ ```
62
+
63
+ ### Fetching New Notes
64
+
65
+ Once you have an instantiated client, you can fetch new notes and add them to your Orbit workspace by invoking the `#notes` method on the client.
66
+
67
+ New notes will be added to the respective member profiles located by email address. If a member cannot be found by the email address, a new member will be created.
68
+
69
+ The database entry must have the two following properties in order for the note to be sent to Orbit:
70
+
71
+ * `Send to Orbit` as a **selected checkbox**
72
+ * `Member Email` with the Orbit member's email address
73
+
74
+ ![Database Properties Setup](docs/setup-table-for-orbit.png)
75
+
76
+ Then, once those fields are set up, the method can be called as follows:
77
+
78
+ ```ruby
79
+ client.notes
80
+ ```
81
+
82
+ ## CLI Usage
83
+
84
+ You can also use this package with the included CLI. To use the CLI pass in the required environment variables on the command line before invoking the CLI.
85
+
86
+ To check for new notes:
87
+
88
+ ```bash
89
+ $ ORBIT_API_KEY=... ORBIT_WORKSPACE_ID=... NOTION_API_KEY=... NOTION_DATABASE_ID=... NOTION_WORKSPACE_SLUG=... bundle exec notion_orbit --check-notes
90
+ ```
91
+
92
+ ## GitHub Actions Automation Setup
93
+
94
+ ⚡ You can set up this integration in a matter of minutes using our GitHub Actions template. It will run regularly to add new activities to your Orbit workspace. All you need is a GitHub account.
95
+
96
+ [See our guide for setting up this automation](https://github.com/orbit-love/github-actions-templates/blob/main/Notion/README.md)
97
+
98
+ ## Contributing
99
+
100
+ We 💜 contributions from everyone! Check out the [Contributing Guidelines](.github/CONTRIBUTING.md) for more information.
101
+
102
+ ## License
103
+
104
+ This project is under the [MIT License](./LICENSE).
105
+
106
+ ## Code of Conduct
107
+
108
+ This project uses the [Contributor Code of Conduct](.github/CODE_OF_CONDUCT.md). We ask everyone to please adhere by its guidelines.