notion-ruby-client 0.0.8 → 0.1.0.pre.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +1 -0
  3. data/.gitignore +7 -0
  4. data/.rubocop.yml +9 -0
  5. data/CHANGELOG.md +19 -0
  6. data/Gemfile.lock +29 -7
  7. data/README.md +245 -55
  8. data/bin/console +31 -0
  9. data/lib/notion/api/endpoints/blocks.rb +35 -7
  10. data/lib/notion/api/endpoints/databases.rb +65 -37
  11. data/lib/notion/api/endpoints/pages.rb +6 -6
  12. data/lib/notion/api/endpoints/search.rb +41 -0
  13. data/lib/notion/api/endpoints/users.rb +6 -3
  14. data/lib/notion/api/endpoints.rb +3 -1
  15. data/lib/notion/api/errors/too_many_requests.rb +15 -0
  16. data/lib/notion/api/errors.rb +0 -2
  17. data/lib/notion/config.rb +2 -0
  18. data/lib/notion/pagination/cursor.rb +5 -2
  19. data/lib/notion/version.rb +2 -2
  20. data/lib/notion-ruby-client.rb +2 -0
  21. data/notion-ruby-client.gemspec +3 -1
  22. data/spec/fixtures/notion/block.yml +146 -0
  23. data/spec/fixtures/notion/block_append_children.yml +76 -62
  24. data/spec/fixtures/notion/block_children.yml +80 -65
  25. data/spec/fixtures/notion/create_database.yml +67 -58
  26. data/spec/fixtures/notion/create_page.yml +68 -59
  27. data/spec/fixtures/notion/database.yml +78 -61
  28. data/spec/fixtures/notion/database_query.yml +81 -62
  29. data/spec/fixtures/notion/databases_list.yml +77 -60
  30. data/spec/fixtures/notion/page.yml +70 -57
  31. data/spec/fixtures/notion/paginated_block_children.yml +296 -242
  32. data/spec/fixtures/notion/paginated_database_query.yml +79 -62
  33. data/spec/fixtures/notion/paginated_databases_list.yml +78 -61
  34. data/spec/fixtures/notion/paginated_search.yml +301 -0
  35. data/spec/fixtures/notion/paginated_users_list.yml +143 -130
  36. data/spec/fixtures/notion/search.yml +160 -0
  37. data/spec/fixtures/notion/search_with_query.yml +152 -0
  38. data/spec/fixtures/notion/update_block.yml +148 -0
  39. data/spec/fixtures/notion/update_database.yml +152 -0
  40. data/spec/fixtures/notion/update_page.yml +71 -59
  41. data/spec/fixtures/notion/users.yml +69 -56
  42. data/spec/fixtures/notion/users_list.yml +143 -130
  43. data/spec/notion/api/endpoints/blocks_spec.rb +37 -11
  44. data/spec/notion/api/endpoints/databases_spec.rb +25 -17
  45. data/spec/notion/api/endpoints/pages_spec.rb +7 -16
  46. data/spec/notion/api/endpoints/search_spec.rb +26 -0
  47. data/spec/notion/api/endpoints/users_spec.rb +4 -4
  48. data/spec/notion/pagination/cursor_spec.rb +126 -0
  49. metadata +52 -8
  50. data/.rspec_status +0 -19
  51. data/notion-ruby-client-0.0.4.gem +0 -0
  52. data/scratchpad.rb +0 -22
  53. data/screenshots/create_notion_bot.png +0 -0
data/.rspec_status DELETED
@@ -1,19 +0,0 @@
1
- example_id | status | run_time |
2
- ---------------------------------------------------- | ------ | --------------- |
3
- ./spec/notion/api/endpoints/blocks_spec.rb[1:1:1] | passed | 0.03873 seconds |
4
- ./spec/notion/api/endpoints/blocks_spec.rb[1:1:2] | passed | 0.0494 seconds |
5
- ./spec/notion/api/endpoints/blocks_spec.rb[1:1:3] | passed | 0.02657 seconds |
6
- ./spec/notion/api/endpoints/databases_spec.rb[1:1:1] | passed | 0.02458 seconds |
7
- ./spec/notion/api/endpoints/databases_spec.rb[1:1:2] | passed | 0.02588 seconds |
8
- ./spec/notion/api/endpoints/databases_spec.rb[1:1:3] | passed | 0.0268 seconds |
9
- ./spec/notion/api/endpoints/databases_spec.rb[1:1:4] | passed | 0.01669 seconds |
10
- ./spec/notion/api/endpoints/databases_spec.rb[1:1:5] | passed | 0.01661 seconds |
11
- ./spec/notion/api/endpoints/databases_spec.rb[1:1:6] | passed | 0.0173 seconds |
12
- ./spec/notion/api/endpoints/pages_spec.rb[1:1:1] | passed | 0.01728 seconds |
13
- ./spec/notion/api/endpoints/pages_spec.rb[1:1:2] | passed | 0.01656 seconds |
14
- ./spec/notion/api/endpoints/pages_spec.rb[1:1:3] | passed | 0.0206 seconds |
15
- ./spec/notion/api/endpoints/users_spec.rb[1:1:1] | passed | 0.02992 seconds |
16
- ./spec/notion/api/endpoints/users_spec.rb[1:1:2] | passed | 0.02664 seconds |
17
- ./spec/notion/api/endpoints/users_spec.rb[1:1:3] | passed | 0.02533 seconds |
18
- ./spec/notion/config_spec.rb[1:1:1] | passed | 0.00016 seconds |
19
- ./spec/notion/version_spec.rb[1:1] | passed | 0.00016 seconds |
Binary file
data/scratchpad.rb DELETED
@@ -1,22 +0,0 @@
1
- Notion.configure do |config|
2
- config.token = ENV['NOTION_API_TOKEN']
3
- end
4
-
5
- client = Notion::Client.new(token: 'token')
6
-
7
-
8
- client = Notion::Client.new
9
- client.auth_test
10
-
11
- client.database(id)
12
- client.database_query(id, options)
13
-
14
- client.page(id)
15
- client.create_page(options)
16
- client.update_page(id, options)
17
-
18
- client.user(id)
19
- client.list_users(options)
20
-
21
-
22
- # https://c15c8970-daea-4c88-9bcd-93726522a93e.mock.pstmn.io
Binary file