notionrb 1.3.0

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.
Files changed (93) hide show
  1. checksums.yaml +7 -0
  2. data/.devcontainer/Dockerfile +5 -0
  3. data/.devcontainer/boot.sh +1 -0
  4. data/.devcontainer/devcontainer.json +30 -0
  5. data/.github/workflows/ci.yml +15 -0
  6. data/.github/workflows/rubocop.yml +17 -0
  7. data/.gitignore +7 -0
  8. data/.rspec +2 -0
  9. data/.rubocop.yml +55 -0
  10. data/.rubocop_todo.yml +86 -0
  11. data/CHANGELOG.md +144 -0
  12. data/CODE_OF_CONDUCT.md +128 -0
  13. data/CONTRIBUTING.md +51 -0
  14. data/Gemfile +4 -0
  15. data/Gemfile.lock +95 -0
  16. data/LICENSE.md +21 -0
  17. data/README.md +677 -0
  18. data/Rakefile +18 -0
  19. data/bin/console +31 -0
  20. data/lib/notion/api/endpoints/blocks.rb +100 -0
  21. data/lib/notion/api/endpoints/comments.rb +61 -0
  22. data/lib/notion/api/endpoints/data_sources.rb +102 -0
  23. data/lib/notion/api/endpoints/databases.rb +134 -0
  24. data/lib/notion/api/endpoints/pages.rb +95 -0
  25. data/lib/notion/api/endpoints/search.rb +41 -0
  26. data/lib/notion/api/endpoints/users.rb +48 -0
  27. data/lib/notion/api/endpoints.rb +23 -0
  28. data/lib/notion/api/error.rb +6 -0
  29. data/lib/notion/api/errors/internal_error.rb +12 -0
  30. data/lib/notion/api/errors/notion_error.rb +15 -0
  31. data/lib/notion/api/errors/too_many_requests.rb +15 -0
  32. data/lib/notion/api/errors.rb +23 -0
  33. data/lib/notion/client.rb +28 -0
  34. data/lib/notion/config.rb +54 -0
  35. data/lib/notion/faraday/connection.rb +37 -0
  36. data/lib/notion/faraday/request.rb +45 -0
  37. data/lib/notion/faraday/response/raise_error.rb +31 -0
  38. data/lib/notion/faraday/response/wrap_error.rb +22 -0
  39. data/lib/notion/logger.rb +14 -0
  40. data/lib/notion/messages/message.rb +17 -0
  41. data/lib/notion/pagination/cursor.rb +53 -0
  42. data/lib/notion/version.rb +5 -0
  43. data/lib/notion-ruby-client.rb +28 -0
  44. data/lib/notion.rb +2 -0
  45. data/lib/notion_ruby_client.rb +2 -0
  46. data/notionrb.gemspec +31 -0
  47. data/spec/fixtures/notion/block.yml +146 -0
  48. data/spec/fixtures/notion/block_append_children.yml +149 -0
  49. data/spec/fixtures/notion/block_children.yml +152 -0
  50. data/spec/fixtures/notion/create_data_source.yml +29 -0
  51. data/spec/fixtures/notion/create_database.yml +149 -0
  52. data/spec/fixtures/notion/create_discussion_comment.yml +110 -0
  53. data/spec/fixtures/notion/create_page.yml +152 -0
  54. data/spec/fixtures/notion/create_page_comment.yml +110 -0
  55. data/spec/fixtures/notion/create_page_with_data_source.yml +29 -0
  56. data/spec/fixtures/notion/create_page_with_parent_page.yml +128 -0
  57. data/spec/fixtures/notion/data_source.yml +27 -0
  58. data/spec/fixtures/notion/data_source_query.yml +29 -0
  59. data/spec/fixtures/notion/database.yml +150 -0
  60. data/spec/fixtures/notion/database_query.yml +154 -0
  61. data/spec/fixtures/notion/delete_block.yml +145 -0
  62. data/spec/fixtures/notion/page.yml +150 -0
  63. data/spec/fixtures/notion/page_property_item.yml +143 -0
  64. data/spec/fixtures/notion/paginated_block_children.yml +575 -0
  65. data/spec/fixtures/notion/paginated_data_source_query.yml +29 -0
  66. data/spec/fixtures/notion/paginated_database_query.yml +152 -0
  67. data/spec/fixtures/notion/paginated_databases_list.yml +150 -0
  68. data/spec/fixtures/notion/paginated_search.yml +301 -0
  69. data/spec/fixtures/notion/paginated_users_list.yml +146 -0
  70. data/spec/fixtures/notion/retrieve_comments.yml +106 -0
  71. data/spec/fixtures/notion/search.yml +160 -0
  72. data/spec/fixtures/notion/search_with_query.yml +152 -0
  73. data/spec/fixtures/notion/update_block.yml +148 -0
  74. data/spec/fixtures/notion/update_data_source.yml +29 -0
  75. data/spec/fixtures/notion/update_database.yml +152 -0
  76. data/spec/fixtures/notion/update_page.yml +152 -0
  77. data/spec/fixtures/notion/users.yml +145 -0
  78. data/spec/fixtures/notion/users_list.yml +146 -0
  79. data/spec/fixtures/notion/users_me.yml +144 -0
  80. data/spec/notion/api/endpoints/blocks_spec.rb +72 -0
  81. data/spec/notion/api/endpoints/comments_spec.rb +49 -0
  82. data/spec/notion/api/endpoints/data_sources_spec.rb +61 -0
  83. data/spec/notion/api/endpoints/databases_spec.rb +70 -0
  84. data/spec/notion/api/endpoints/pages_spec.rb +127 -0
  85. data/spec/notion/api/endpoints/search_spec.rb +26 -0
  86. data/spec/notion/api/endpoints/users_spec.rb +31 -0
  87. data/spec/notion/config_spec.rb +16 -0
  88. data/spec/notion/pagination/cursor_spec.rb +126 -0
  89. data/spec/notion/version_spec.rb +8 -0
  90. data/spec/spec_helper.rb +22 -0
  91. data/spec/support/token.rb +10 -0
  92. data/spec/support/vcr.rb +16 -0
  93. metadata +358 -0
metadata ADDED
@@ -0,0 +1,358 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: notionrb
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Nicolas Goutay
8
+ - Ivan Lyubchenko
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 1980-01-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday-mashify
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: faraday-multipart
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 1.0.4
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 1.0.4
55
+ - !ruby/object:Gem::Dependency
56
+ name: hashie
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '5'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: dotenv
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '13'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '13'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.82.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.82.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-performance
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 1.5.2
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 1.5.2
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-rspec
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 1.39.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 1.39.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: timecop
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: vcr
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: webmock
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ email: lubchenko2044@gmail.com
196
+ executables: []
197
+ extensions: []
198
+ extra_rdoc_files: []
199
+ files:
200
+ - ".devcontainer/Dockerfile"
201
+ - ".devcontainer/boot.sh"
202
+ - ".devcontainer/devcontainer.json"
203
+ - ".github/workflows/ci.yml"
204
+ - ".github/workflows/rubocop.yml"
205
+ - ".gitignore"
206
+ - ".rspec"
207
+ - ".rubocop.yml"
208
+ - ".rubocop_todo.yml"
209
+ - CHANGELOG.md
210
+ - CODE_OF_CONDUCT.md
211
+ - CONTRIBUTING.md
212
+ - Gemfile
213
+ - Gemfile.lock
214
+ - LICENSE.md
215
+ - README.md
216
+ - Rakefile
217
+ - bin/console
218
+ - lib/notion-ruby-client.rb
219
+ - lib/notion.rb
220
+ - lib/notion/api/endpoints.rb
221
+ - lib/notion/api/endpoints/blocks.rb
222
+ - lib/notion/api/endpoints/comments.rb
223
+ - lib/notion/api/endpoints/data_sources.rb
224
+ - lib/notion/api/endpoints/databases.rb
225
+ - lib/notion/api/endpoints/pages.rb
226
+ - lib/notion/api/endpoints/search.rb
227
+ - lib/notion/api/endpoints/users.rb
228
+ - lib/notion/api/error.rb
229
+ - lib/notion/api/errors.rb
230
+ - lib/notion/api/errors/internal_error.rb
231
+ - lib/notion/api/errors/notion_error.rb
232
+ - lib/notion/api/errors/too_many_requests.rb
233
+ - lib/notion/client.rb
234
+ - lib/notion/config.rb
235
+ - lib/notion/faraday/connection.rb
236
+ - lib/notion/faraday/request.rb
237
+ - lib/notion/faraday/response/raise_error.rb
238
+ - lib/notion/faraday/response/wrap_error.rb
239
+ - lib/notion/logger.rb
240
+ - lib/notion/messages/message.rb
241
+ - lib/notion/pagination/cursor.rb
242
+ - lib/notion/version.rb
243
+ - lib/notion_ruby_client.rb
244
+ - notionrb.gemspec
245
+ - spec/fixtures/notion/block.yml
246
+ - spec/fixtures/notion/block_append_children.yml
247
+ - spec/fixtures/notion/block_children.yml
248
+ - spec/fixtures/notion/create_data_source.yml
249
+ - spec/fixtures/notion/create_database.yml
250
+ - spec/fixtures/notion/create_discussion_comment.yml
251
+ - spec/fixtures/notion/create_page.yml
252
+ - spec/fixtures/notion/create_page_comment.yml
253
+ - spec/fixtures/notion/create_page_with_data_source.yml
254
+ - spec/fixtures/notion/create_page_with_parent_page.yml
255
+ - spec/fixtures/notion/data_source.yml
256
+ - spec/fixtures/notion/data_source_query.yml
257
+ - spec/fixtures/notion/database.yml
258
+ - spec/fixtures/notion/database_query.yml
259
+ - spec/fixtures/notion/delete_block.yml
260
+ - spec/fixtures/notion/page.yml
261
+ - spec/fixtures/notion/page_property_item.yml
262
+ - spec/fixtures/notion/paginated_block_children.yml
263
+ - spec/fixtures/notion/paginated_data_source_query.yml
264
+ - spec/fixtures/notion/paginated_database_query.yml
265
+ - spec/fixtures/notion/paginated_databases_list.yml
266
+ - spec/fixtures/notion/paginated_search.yml
267
+ - spec/fixtures/notion/paginated_users_list.yml
268
+ - spec/fixtures/notion/retrieve_comments.yml
269
+ - spec/fixtures/notion/search.yml
270
+ - spec/fixtures/notion/search_with_query.yml
271
+ - spec/fixtures/notion/update_block.yml
272
+ - spec/fixtures/notion/update_data_source.yml
273
+ - spec/fixtures/notion/update_database.yml
274
+ - spec/fixtures/notion/update_page.yml
275
+ - spec/fixtures/notion/users.yml
276
+ - spec/fixtures/notion/users_list.yml
277
+ - spec/fixtures/notion/users_me.yml
278
+ - spec/notion/api/endpoints/blocks_spec.rb
279
+ - spec/notion/api/endpoints/comments_spec.rb
280
+ - spec/notion/api/endpoints/data_sources_spec.rb
281
+ - spec/notion/api/endpoints/databases_spec.rb
282
+ - spec/notion/api/endpoints/pages_spec.rb
283
+ - spec/notion/api/endpoints/search_spec.rb
284
+ - spec/notion/api/endpoints/users_spec.rb
285
+ - spec/notion/config_spec.rb
286
+ - spec/notion/pagination/cursor_spec.rb
287
+ - spec/notion/version_spec.rb
288
+ - spec/spec_helper.rb
289
+ - spec/support/token.rb
290
+ - spec/support/vcr.rb
291
+ homepage: https://github.com/lyubchenko-ivan/notion-ruby-client
292
+ licenses:
293
+ - MIT
294
+ metadata: {}
295
+ rdoc_options: []
296
+ require_paths:
297
+ - lib
298
+ required_ruby_version: !ruby/object:Gem::Requirement
299
+ requirements:
300
+ - - ">="
301
+ - !ruby/object:Gem::Version
302
+ version: '0'
303
+ required_rubygems_version: !ruby/object:Gem::Requirement
304
+ requirements:
305
+ - - ">="
306
+ - !ruby/object:Gem::Version
307
+ version: 1.3.6
308
+ requirements: []
309
+ rubygems_version: 4.0.10
310
+ specification_version: 4
311
+ summary: Notion API client for Ruby.
312
+ test_files:
313
+ - spec/fixtures/notion/block.yml
314
+ - spec/fixtures/notion/block_append_children.yml
315
+ - spec/fixtures/notion/block_children.yml
316
+ - spec/fixtures/notion/create_data_source.yml
317
+ - spec/fixtures/notion/create_database.yml
318
+ - spec/fixtures/notion/create_discussion_comment.yml
319
+ - spec/fixtures/notion/create_page.yml
320
+ - spec/fixtures/notion/create_page_comment.yml
321
+ - spec/fixtures/notion/create_page_with_data_source.yml
322
+ - spec/fixtures/notion/create_page_with_parent_page.yml
323
+ - spec/fixtures/notion/data_source.yml
324
+ - spec/fixtures/notion/data_source_query.yml
325
+ - spec/fixtures/notion/database.yml
326
+ - spec/fixtures/notion/database_query.yml
327
+ - spec/fixtures/notion/delete_block.yml
328
+ - spec/fixtures/notion/page.yml
329
+ - spec/fixtures/notion/page_property_item.yml
330
+ - spec/fixtures/notion/paginated_block_children.yml
331
+ - spec/fixtures/notion/paginated_data_source_query.yml
332
+ - spec/fixtures/notion/paginated_database_query.yml
333
+ - spec/fixtures/notion/paginated_databases_list.yml
334
+ - spec/fixtures/notion/paginated_search.yml
335
+ - spec/fixtures/notion/paginated_users_list.yml
336
+ - spec/fixtures/notion/retrieve_comments.yml
337
+ - spec/fixtures/notion/search.yml
338
+ - spec/fixtures/notion/search_with_query.yml
339
+ - spec/fixtures/notion/update_block.yml
340
+ - spec/fixtures/notion/update_data_source.yml
341
+ - spec/fixtures/notion/update_database.yml
342
+ - spec/fixtures/notion/update_page.yml
343
+ - spec/fixtures/notion/users.yml
344
+ - spec/fixtures/notion/users_list.yml
345
+ - spec/fixtures/notion/users_me.yml
346
+ - spec/notion/api/endpoints/blocks_spec.rb
347
+ - spec/notion/api/endpoints/comments_spec.rb
348
+ - spec/notion/api/endpoints/data_sources_spec.rb
349
+ - spec/notion/api/endpoints/databases_spec.rb
350
+ - spec/notion/api/endpoints/pages_spec.rb
351
+ - spec/notion/api/endpoints/search_spec.rb
352
+ - spec/notion/api/endpoints/users_spec.rb
353
+ - spec/notion/config_spec.rb
354
+ - spec/notion/pagination/cursor_spec.rb
355
+ - spec/notion/version_spec.rb
356
+ - spec/spec_helper.rb
357
+ - spec/support/token.rb
358
+ - spec/support/vcr.rb