notion_ruby_mapping 2.0.0 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac7180c69212c47d60456deee3790f5cdd2b7f2074f7c5e244ccf2aae102b371
4
- data.tar.gz: d7c88e0ab4d4afdb30cf1d95d285ea2f4a533353886bd0d33c9a3eea5e19ea35
3
+ metadata.gz: 472fc98d3f7d94d134deced4cbbfb36810d0d2ea47c03922eee72e43e8c8b4fe
4
+ data.tar.gz: 227bd9482a3c65879114de1c980be9de0153fd7d4e79c39f012f1b59206a043e
5
5
  SHA512:
6
- metadata.gz: 2e5aec4c569a646464f20f57a96c6cb714425faacd96d3be8f1413f67531d4c887e2fc5f21f5bfabe95a2614fdc31abed5e638337b64269ad460b99c089ffd78
7
- data.tar.gz: 54639e4104e52699c1b26b92e07b934f6902a74210ef7652f79ce2db420e611e91bc61bcd6dffef48aeda2360a0fda2c165d5b967638ca9816aed2e96f80f066
6
+ metadata.gz: 910cab62b6fddad81b690b370664eca958130809aac2ff877eac6f6a8c75e2fa74db2de0d6adc9e00f396337d4fc05002b86493e2182bc74a20c4b70cdfa9a4e
7
+ data.tar.gz: ce540ca17fdbec6c5793cfa45c0d15556d328c3b28e86e942612c295cd8fdf3601bf76675c2bf6fe345da4dd7bfe9135ba3dab46ec334dfe0cdc4e7d8cc38564
data/README.md CHANGED
@@ -127,6 +127,9 @@ NotionRubyMapping.configuration { |c| c.notion_token = ENV["NOTION_API_TOKEN"] }
127
127
 
128
128
  ## 3. ChangeLog
129
129
 
130
+ - 2025/6/29 [v2.0.1] add creating FileUploadObject with external url
131
+ - 2025/6/26 [v2.0.0] [FIX] remove symbolize_names: true (only use String)
132
+ - 2025/6/11 [v1.0.0] Update Faraday to 2.13.1 and Change symbolize_names: true (Broken version)
130
133
  - 2025/2/11 [v0.8.9] Add verification_property
131
134
  - 2024/9/15 [v0.8.8] Add link_mention support
132
135
  - 2024/5/29 [v0.8.7] Change file attribute for button_property
@@ -188,13 +188,13 @@ module NotionRubyMapping
188
188
  # @param [String] id
189
189
  # @param [Hash] options
190
190
  # @return [Hash]
191
- def file_upload_request(fname, id, options = {})
192
- multipart_request(file_upload_path(id), fname, options)
191
+ def send_file_upload_request(fname, id, options = {})
192
+ multipart_request(send_file_upload_path(id), fname, options)
193
193
  end
194
194
 
195
195
  # @param [String] id
196
196
  # @return [String]
197
- def file_upload_path(id)
197
+ def send_file_upload_path(id)
198
198
  "v1/file_uploads/#{id}/send"
199
199
  end
200
200
 
@@ -303,6 +303,14 @@ module NotionRubyMapping
303
303
  request :get, retrieve_comments_path(block_id), (query&.query_json || {})
304
304
  end
305
305
 
306
+ def file_upload_request(file_id)
307
+ request :get, file_upload_path(file_id)
308
+ end
309
+
310
+ def file_upload_path(file_id)
311
+ "v1/file_uploads/#{file_id}"
312
+ end
313
+
306
314
  # @param [Symbol] method
307
315
  # @param [String] path
308
316
  # @param [Hash] options
@@ -33,13 +33,21 @@ class FileUploadObject
33
33
  end
34
34
  end
35
35
  end
36
- attr_reader :id, :fname
36
+ attr_reader :id, :fname, :status
37
37
 
38
38
  # @return [FileUploadObject]
39
39
  def create(payload)
40
40
  nc = NotionRubyMapping::NotionCache.instance
41
41
  response = nc.create_file_upload_request(payload)
42
42
  @id = nc.hex_id response["id"]
43
+ @status = response["status"]
44
+ end
45
+
46
+ def reload
47
+ nc = NotionRubyMapping::NotionCache.instance
48
+ response = nc.file_upload_request @id
49
+ @status = response["status"]
50
+ self
43
51
  end
44
52
 
45
53
  # @param [String] fname
@@ -53,7 +61,7 @@ class FileUploadObject
53
61
  status = "uploaded"
54
62
  end
55
63
  nc = NotionRubyMapping::NotionCache.instance
56
- response = nc.file_upload_request fname, @id, options
64
+ response = nc.send_file_upload_request fname, @id, options
57
65
  return if nc.hex_id(response["id"]) == @id && response["status"] == status
58
66
 
59
67
  raise StandardError, "File upload failed: #{response}"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NotionRubyMapping
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.1"
5
5
  NOTION_VERSION = "2022-06-28"
6
6
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notion_ruby_mapping
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroyuki KOBAYASHI
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-06-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: faraday
@@ -280,7 +279,6 @@ homepage: https://github.com/hkob/notion_ruby_mapping.git
280
279
  licenses:
281
280
  - MIT
282
281
  metadata: {}
283
- post_install_message:
284
282
  rdoc_options: []
285
283
  require_paths:
286
284
  - lib
@@ -295,8 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
293
  - !ruby/object:Gem::Version
296
294
  version: '0'
297
295
  requirements: []
298
- rubygems_version: 3.5.11
299
- signing_key:
296
+ rubygems_version: 3.6.9
300
297
  specification_version: 4
301
298
  summary: Notion Ruby mapping tool
302
299
  test_files: []