notion-sdk-ruby 0.3.0 → 0.3.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/.github/workflows/ci.yml +34 -0
- data/.gitignore +13 -13
- data/.rspec +3 -3
- data/.travis.yml +6 -6
- data/.vscode/settings.json +3 -3
- data/Gemfile.lock +1 -1
- data/LICENSE.txt +21 -21
- data/README.md +35 -0
- data/bin/console +0 -1
- data/bin/setup +8 -8
- data/lib/notion-sdk-ruby.rb +1 -0
- data/lib/notion-sdk-ruby/client.rb +2 -1
- data/lib/notion-sdk-ruby/config.rb +1 -1
- data/lib/notion-sdk-ruby/request_client.rb +1 -0
- data/lib/notion-sdk-ruby/version.rb +1 -1
- metadata +4 -4
- data/.github/workflows/ruby.yml +0 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 006e8ac9f857ad0644041bd3ba45608730e72095c021e19034254ed0d75372ad
|
|
4
|
+
data.tar.gz: 8ba2f237a80ca3aebb2532d52f3d5ffa58337181278062dd0f31c01d66d8a5a5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e2bf9572dd3947686b40b734a642b782fd0ef0efb94f6714b66d7d4815e9625453febb5ae1f5c44588289266c1ca43fa7c24c15aba9bd0bc12f6bceebff1334d
|
|
7
|
+
data.tar.gz: 2d850b377b632e59c533fcdac1a52b1989f72c7fd64c340332b9c0a7cb752b5e7fb4459b30b43a1b4047dd948b1a86d58cbb7ff5774a734dfdf872df081eb2d8
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
2
|
+
# They are provided by a third-party and are governed by
|
|
3
|
+
# separate terms of service, privacy policy, and support
|
|
4
|
+
# documentation.
|
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
|
7
|
+
|
|
8
|
+
name: ci
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
branches: [main]
|
|
13
|
+
pull_request:
|
|
14
|
+
branches: [main]
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
strategy:
|
|
20
|
+
matrix:
|
|
21
|
+
ruby-version: ["2.6", "2.7", "3.0"]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v2
|
|
25
|
+
- name: Set up Ruby
|
|
26
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
|
27
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
|
28
|
+
# uses: ruby/setup-ruby@v1
|
|
29
|
+
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
|
30
|
+
with:
|
|
31
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
32
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
33
|
+
- name: Run tests
|
|
34
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/.bundle/
|
|
2
|
-
/.yardoc
|
|
3
|
-
/_yardoc/
|
|
4
|
-
/coverage/
|
|
5
|
-
/doc/
|
|
6
|
-
/pkg/
|
|
7
|
-
/spec/reports/
|
|
8
|
-
/tmp/
|
|
9
|
-
|
|
10
|
-
# rspec failure tracking
|
|
11
|
-
.rspec_status
|
|
12
|
-
|
|
13
|
-
.env
|
|
1
|
+
/.bundle/
|
|
2
|
+
/.yardoc
|
|
3
|
+
/_yardoc/
|
|
4
|
+
/coverage/
|
|
5
|
+
/doc/
|
|
6
|
+
/pkg/
|
|
7
|
+
/spec/reports/
|
|
8
|
+
/tmp/
|
|
9
|
+
|
|
10
|
+
# rspec failure tracking
|
|
11
|
+
.rspec_status
|
|
12
|
+
|
|
13
|
+
.env
|
data/.rspec
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
--format documentation
|
|
2
|
-
--color
|
|
3
|
-
--require spec_helper
|
|
1
|
+
--format documentation
|
|
2
|
+
--color
|
|
3
|
+
--require spec_helper
|
data/.travis.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
language: ruby
|
|
3
|
-
cache: bundler
|
|
4
|
-
rvm:
|
|
5
|
-
- 2.6.5
|
|
6
|
-
before_install: gem install bundler -v 2.1.4
|
|
1
|
+
---
|
|
2
|
+
language: ruby
|
|
3
|
+
cache: bundler
|
|
4
|
+
rvm:
|
|
5
|
+
- 2.6.5
|
|
6
|
+
before_install: gem install bundler -v 2.1.4
|
data/.vscode/settings.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"editor.formatOnSave": true,
|
|
3
|
-
"editor.tabSize": 2
|
|
1
|
+
{
|
|
2
|
+
"editor.formatOnSave": true,
|
|
3
|
+
"editor.tabSize": 2
|
|
4
4
|
}
|
data/Gemfile.lock
CHANGED
data/LICENSE.txt
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Graham Marlow
|
|
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.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Graham Marlow
|
|
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
CHANGED
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
# Notion Ruby SDK
|
|
2
2
|
|
|
3
|
+
[](https://github.com/mgmarlow/notion-sdk-ruby/actions/workflows/ci.yml)
|
|
4
|
+
[](https://badge.fury.io/rb/notion-sdk-ruby)
|
|
5
|
+
|
|
3
6
|
Unofficial Ruby client for the [Notion APIs](https://developers.notion.com/).
|
|
4
7
|
|
|
8
|
+
- [Notion Ruby SDK](#notion-ruby-sdk)
|
|
9
|
+
- [Installation](#installation)
|
|
10
|
+
- [Usage](#usage)
|
|
11
|
+
- [API reference](#api-reference)
|
|
12
|
+
- [Databases](#databases)
|
|
13
|
+
- [databases#retrieve](#databasesretrieve)
|
|
14
|
+
- [databases#list](#databaseslist)
|
|
15
|
+
- [databases#query](#databasesquery)
|
|
16
|
+
- [Pages](#pages)
|
|
17
|
+
- [pages#retrieve](#pagesretrieve)
|
|
18
|
+
- [pages#create](#pagescreate)
|
|
19
|
+
- [pages#update](#pagesupdate)
|
|
20
|
+
- [Blocks](#blocks)
|
|
21
|
+
- [blocks#children#list](#blockschildrenlist)
|
|
22
|
+
- [blocks#children#append](#blockschildrenappend)
|
|
23
|
+
- [Users](#users)
|
|
24
|
+
- [users#retrieve](#usersretrieve)
|
|
25
|
+
- [users#list](#userslist)
|
|
26
|
+
- [Search](#search)
|
|
27
|
+
- [#search](#search-1)
|
|
28
|
+
- [Development](#development)
|
|
29
|
+
- [Contributing](#contributing)
|
|
30
|
+
- [License](#license)
|
|
31
|
+
|
|
5
32
|
## Installation
|
|
6
33
|
|
|
7
34
|
Add this line to your application's Gemfile:
|
|
@@ -217,6 +244,14 @@ client.search({
|
|
|
217
244
|
|
|
218
245
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
219
246
|
|
|
247
|
+
Before using `bin/console` you need to create a new file, `.env`, at the root project directory. This will enable you to run commands directly against your [Notion integration](https://developers.notion.com/docs/getting-started).
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
cat > .env <<EOF
|
|
251
|
+
API_SECRET=<YOUR NOTION API SECRET HERE>
|
|
252
|
+
EOF
|
|
253
|
+
```
|
|
254
|
+
|
|
220
255
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
221
256
|
|
|
222
257
|
## Contributing
|
data/bin/console
CHANGED
data/bin/setup
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
IFS=$'\n\t'
|
|
4
|
-
set -vx
|
|
5
|
-
|
|
6
|
-
bundle install
|
|
7
|
-
|
|
8
|
-
# Do any other automated setup that you need to do here
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
IFS=$'\n\t'
|
|
4
|
+
set -vx
|
|
5
|
+
|
|
6
|
+
bundle install
|
|
7
|
+
|
|
8
|
+
# Do any other automated setup that you need to do here
|
data/lib/notion-sdk-ruby.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: notion-sdk-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Graham Marlow
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-06-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|
|
@@ -115,7 +115,7 @@ executables: []
|
|
|
115
115
|
extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
|
117
117
|
files:
|
|
118
|
-
- ".github/workflows/
|
|
118
|
+
- ".github/workflows/ci.yml"
|
|
119
119
|
- ".gitignore"
|
|
120
120
|
- ".rspec"
|
|
121
121
|
- ".travis.yml"
|
|
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
161
161
|
- !ruby/object:Gem::Version
|
|
162
162
|
version: '0'
|
|
163
163
|
requirements: []
|
|
164
|
-
rubygems_version: 3.
|
|
164
|
+
rubygems_version: 3.1.2
|
|
165
165
|
signing_key:
|
|
166
166
|
specification_version: 4
|
|
167
167
|
summary: Notion SDK
|
data/.github/workflows/ruby.yml
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# This workflow uses actions that are not certified by GitHub.
|
|
2
|
-
# They are provided by a third-party and are governed by
|
|
3
|
-
# separate terms of service, privacy policy, and support
|
|
4
|
-
# documentation.
|
|
5
|
-
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
|
6
|
-
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
|
7
|
-
|
|
8
|
-
name: Ruby
|
|
9
|
-
|
|
10
|
-
on:
|
|
11
|
-
push:
|
|
12
|
-
branches: [ main ]
|
|
13
|
-
pull_request:
|
|
14
|
-
branches: [ main ]
|
|
15
|
-
|
|
16
|
-
jobs:
|
|
17
|
-
test:
|
|
18
|
-
|
|
19
|
-
runs-on: ubuntu-latest
|
|
20
|
-
strategy:
|
|
21
|
-
matrix:
|
|
22
|
-
ruby-version: ['2.6', '2.7', '3.0']
|
|
23
|
-
|
|
24
|
-
steps:
|
|
25
|
-
- uses: actions/checkout@v2
|
|
26
|
-
- name: Set up Ruby
|
|
27
|
-
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
|
28
|
-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
|
29
|
-
# uses: ruby/setup-ruby@v1
|
|
30
|
-
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
|
31
|
-
with:
|
|
32
|
-
ruby-version: ${{ matrix.ruby-version }}
|
|
33
|
-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
34
|
-
- name: Run tests
|
|
35
|
-
run: bundle exec rake
|