webflow-rb 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: caf289ff080b55720bef55a8fe1ff021d43a3c44ae0fb94ee7c6517c6495af44
4
- data.tar.gz: e44d6b178c268e754a7d2c7653f7bcb6eb78daddef16bcba0156d8a8dbc43092
3
+ metadata.gz: 2665b14b916cf27c16e8048c0999510e67f78218498c129a5418147b2b7f1fb9
4
+ data.tar.gz: 80a0f625df655493c0ba8bd6f5e56f0941690019bebd83c7d09334c04c92da11
5
5
  SHA512:
6
- metadata.gz: '00918cd8a2991b4e64478b6695a93e828ac7b89a40be5fc03617c5d7d50580743ff9d3a62f36c76c4b41aaeabcb0e9611cecce6155cce698fa52b4f714ed8230'
7
- data.tar.gz: 0dfdce4df3b8b8fd246796313e0e0e4c7d529d6b58d81dd668b0f764f8dc298b1c35729b0fd9edc43eb472e73d37ab84ec9cde143340a8b45fdb4e7af3eb502e
6
+ metadata.gz: 17f659d54439c3736b0a128dfb63d2e6ad37cc7aa44c2ce76340fd72061e4c1433728d5f6eb515894ab69d8d94c7d36c8a2f809296d19d44ee0520b34023a55e
7
+ data.tar.gz: 3cb940cf715f7660f863ceeb2d8c6ba14e96fa1ed2b3ebced7eac82e439101475df180428086319ffba51527039fa102d5068c85b8462a851c82b9af37ee9d69
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webflow-rb (1.0.0)
4
+ webflow-rb (1.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Webflow [![Build Status](https://github.com/vfonic/webflow-rb/workflows/build/badge.svg)](https://github.com/vfonic/webflow-rb/actions)
2
2
 
3
+ ## Note
4
+
5
+ This is an active fork of the great [webflow-ruby](https://github.com/penseo/webflow-ruby) gem. [webflow-ruby](https://github.com/penseo/webflow-ruby) gem still works for Webflow API v1. If you're looking for a similar gem API (method names) but for Webflow API v2, try webflow-rb [api-v2](https://github.com/vfonic/webflow-rb/tree/api-v2) branch.
6
+
3
7
  ## Installation
4
8
 
5
9
  Add this line to your application's Gemfile:
@@ -24,7 +28,7 @@ gem install webflow-rb
24
28
 
25
29
  Check out [lib/webflow/client.rb](lib/webflow/client.rb).
26
30
 
27
- Check the documentation at: https://developers.webflow.com/reference/list-collection-items
31
+ Check the official Webflow API v2 documentation at: https://developers.webflow.com/reference/list-collection-items
28
32
 
29
33
  Basic usage:
30
34
 
@@ -52,6 +56,9 @@ def delete_item(collection_id, item_id)
52
56
  ## Contributing
53
57
 
54
58
  Bug reports and pull requests are welcome!
59
+ If you're missing certain functionality, please open an issue or create a pull request.
60
+
61
+ To run all the tests (RuboCop linter and minitest tests), run `bundle exec rake`.
55
62
 
56
63
  ## Plugins
57
64
 
@@ -71,15 +71,18 @@ module Webflow
71
71
  get("/collections/#{collection_id}/items/#{item_id}")
72
72
  end
73
73
 
74
- def create_item(collection_id, data)
75
- result = post("/collections/#{collection_id}/items", { isArchived: false, isDraft: false, fieldData: data })
76
- publish_item(collection_id, result.fetch(:id))
74
+ def create_item(collection_id, data, is_draft: false, is_archived: false)
75
+ result = post("/collections/#{collection_id}/items", { isArchived: is_archived, isDraft: is_draft, fieldData: data })
76
+ publish_item(collection_id, result.fetch(:id)) unless result[:isDraft]
77
77
  result
78
78
  end
79
79
 
80
- def update_item(collection_id, item_id, data)
81
- result = patch("/collections/#{collection_id}/items/#{item_id}", { isArchived: false, isDraft: false, fieldData: data }.compact)
82
- publish_item(collection_id, item_id)
80
+ def update_item(collection_id, item_id, data, is_draft: false, is_archived: false)
81
+ result = patch(
82
+ "/collections/#{collection_id}/items/#{item_id}",
83
+ { isArchived: is_archived, isDraft: is_draft, fieldData: data }.compact
84
+ )
85
+ publish_item(collection_id, item_id) unless result[:isDraft]
83
86
  result
84
87
  end
85
88
 
@@ -1,3 +1,3 @@
1
1
  module Webflow
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webflow-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - phoet
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-12-05 00:00:00.000000000 Z
12
+ date: 2023-12-21 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Webflow API wrapper
15
15
  email: