coda_docs 0.1.1 → 1.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 +4 -4
- data/.codeclimate.yml +19 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +2 -2
- data/.travis.yml +13 -4
- data/Gemfile +8 -2
- data/Gemfile.lock +50 -13
- data/README.md +4 -3
- data/Rakefile +7 -1
- data/bin/console +4 -4
- data/coda_docs.gemspec +8 -6
- data/lib/coda_docs/client.rb +17 -31
- data/lib/coda_docs/connection.rb +7 -0
- data/lib/coda_docs/entities/account.rb +9 -0
- data/lib/coda_docs/entities/categories.rb +10 -0
- data/lib/coda_docs/entities/columns.rb +14 -0
- data/lib/coda_docs/entities/controls.rb +14 -0
- data/lib/coda_docs/entities/docs.rb +36 -0
- data/lib/coda_docs/entities/entity.rb +26 -0
- data/lib/coda_docs/entities/formulas.rb +14 -0
- data/lib/coda_docs/{client → entities}/miscellaneous.rb +3 -3
- data/lib/coda_docs/entities/pages.rb +21 -0
- data/lib/coda_docs/entities/rows.rb +18 -0
- data/lib/coda_docs/entities/tables.rb +14 -0
- data/lib/coda_docs/version.rb +1 -1
- metadata +53 -38
- data/lib/coda_docs/client/account.rb +0 -9
- data/lib/coda_docs/client/columns.rb +0 -14
- data/lib/coda_docs/client/controls.rb +0 -14
- data/lib/coda_docs/client/docs.rb +0 -24
- data/lib/coda_docs/client/folders.rb +0 -14
- data/lib/coda_docs/client/formulas.rb +0 -14
- data/lib/coda_docs/client/rows.rb +0 -18
- data/lib/coda_docs/client/sections.rb +0 -14
- data/lib/coda_docs/client/tables.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6c86d0f9b3f01c8d4c676832e3d3184f0d5574beb7718d58a2a8fd92f8226ac
|
4
|
+
data.tar.gz: 6df83a22d5323097e7403af15b54105cd9823e8e69ffd9476ecc1a6456ee4f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e50493d68a522e10bbe4b59ed0333506ae25dc81d4548bc842a97a1ac9b4de7900bc0701d7d03985ad13a94862366272abf154e3d960a7ae8db7f9438e6d8474
|
7
|
+
data.tar.gz: 40f00dd2fcd119e05cded8bdb80475b0674812ae88afebaa8c197ed12baf82c0dbe045b60956039351108e49b1f83028ff300f3ea90c20213c47030cefeeb05a
|
data/.codeclimate.yml
ADDED
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,7 +1,16 @@
|
|
1
|
-
---
|
2
1
|
sudo: false
|
3
2
|
language: ruby
|
4
|
-
cache: bundler
|
5
3
|
rvm:
|
6
|
-
|
7
|
-
|
4
|
+
- 2.4
|
5
|
+
- 2.5
|
6
|
+
- 2.6
|
7
|
+
before_install:
|
8
|
+
- gem install bundler -v '< 2'
|
9
|
+
cache: bundler
|
10
|
+
deploy:
|
11
|
+
provider: rubygems
|
12
|
+
api_key:
|
13
|
+
secure: C9e6OluEe/RMUFY6JDmw5HLoXMiD4w+Gu5yGLyLF4UezkKdyy08y4z1HqooKYR33ePf65tn1EMgQf+2yTJgnh6FLWGe6Kn77+5NozSUqD/LdFeHG3+qq8VQR2fZv5Lf0j433Yyl5if9NOvpTxaVEjtyPZ45ykDoRCz+d1meXDQeEjp8KloBHcJXIWtvSp4nylS34TU+fUaYiiLEPluqIFyrpjHhXQgKb6JuShKZ48/0qRIWcAYeMbrx3ppOZDov41yrkK6XbkKqCPbr+CC9BSX8ObE/kJf68od2XfNH39pgLgp+uxTuGOciZNHfRLbWIxq1PV6or2MB6t19pkLpPzcBkSc3PZopjBCxmXhEOEsDllCTOXwbWcqJj/QB6oQKXLhnVN5I5n84POXKSUmQ/dfZYFnU5surHxMrZBA31QJhS0DImpCsUmY8oo4dJzmN0Iu8WkWUD5myXh8KQ9rJ/jLxlFofcefOz0dfTIvHUrT2D3UBWOfHu0KP0q2JLzMRv0LFS0brvV4hQDxjJJtMMLOj8mmX3dO7iIT33mBVPiO/XiIl/ItZbO5W5rh0iJVLZBTJnyqS4i1m1vkV/MHCR6fl5zGroySaRO2Eg2m1azVT1k/lVSW0pBt4oB70isU3opxldi8LFz30MWhN5mIgtw4GO/TkYmAjV5AMEVb38C0E=
|
14
|
+
on:
|
15
|
+
tags: true
|
16
|
+
branch: master
|
data/Gemfile
CHANGED
@@ -1,10 +1,16 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
3
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in coda_docs.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
8
|
group :test do
|
9
9
|
gem 'rspec'
|
10
|
+
gem 'vcr'
|
11
|
+
gem 'webmock'
|
12
|
+
end
|
13
|
+
|
14
|
+
group :tools do
|
15
|
+
gem 'rubocop'
|
10
16
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,41 +1,55 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
coda_docs (0.1
|
4
|
+
coda_docs (1.0.1)
|
5
5
|
activesupport
|
6
6
|
httparty
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (
|
11
|
+
activesupport (6.0.3.2)
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
13
|
i18n (>= 0.7, < 2)
|
14
14
|
minitest (~> 5.1)
|
15
15
|
tzinfo (~> 1.1)
|
16
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
17
|
+
addressable (2.7.0)
|
18
|
+
public_suffix (>= 2.0.2, < 5.0)
|
19
|
+
ast (2.4.1)
|
16
20
|
byebug (10.0.2)
|
17
21
|
coderay (1.1.2)
|
18
|
-
concurrent-ruby (1.1.
|
22
|
+
concurrent-ruby (1.1.7)
|
23
|
+
crack (0.4.3)
|
24
|
+
safe_yaml (~> 1.0.0)
|
19
25
|
diff-lcs (1.3)
|
20
26
|
dotenv (2.5.0)
|
21
|
-
|
27
|
+
hashdiff (1.0.0)
|
28
|
+
httparty (0.18.1)
|
22
29
|
mime-types (~> 3.0)
|
23
30
|
multi_xml (>= 0.5.2)
|
24
|
-
i18n (1.
|
31
|
+
i18n (1.8.5)
|
25
32
|
concurrent-ruby (~> 1.0)
|
26
33
|
method_source (0.9.2)
|
27
|
-
mime-types (3.
|
34
|
+
mime-types (3.3.1)
|
28
35
|
mime-types-data (~> 3.2015)
|
29
|
-
mime-types-data (3.
|
30
|
-
minitest (5.
|
36
|
+
mime-types-data (3.2020.0512)
|
37
|
+
minitest (5.14.1)
|
31
38
|
multi_xml (0.6.0)
|
39
|
+
parallel (1.19.1)
|
40
|
+
parser (2.7.1.4)
|
41
|
+
ast (~> 2.4.1)
|
32
42
|
pry (0.12.2)
|
33
43
|
coderay (~> 1.1.0)
|
34
44
|
method_source (~> 0.9.0)
|
35
45
|
pry-byebug (3.6.0)
|
36
46
|
byebug (~> 10.0)
|
37
47
|
pry (~> 0.10)
|
38
|
-
|
48
|
+
public_suffix (4.0.2)
|
49
|
+
rainbow (3.0.0)
|
50
|
+
rake (13.0.1)
|
51
|
+
regexp_parser (1.7.1)
|
52
|
+
rexml (3.2.4)
|
39
53
|
rspec (3.8.0)
|
40
54
|
rspec-core (~> 3.8.0)
|
41
55
|
rspec-expectations (~> 3.8.0)
|
@@ -49,21 +63,44 @@ GEM
|
|
49
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
50
64
|
rspec-support (~> 3.8.0)
|
51
65
|
rspec-support (3.8.0)
|
66
|
+
rubocop (0.89.1)
|
67
|
+
parallel (~> 1.10)
|
68
|
+
parser (>= 2.7.1.1)
|
69
|
+
rainbow (>= 2.2.2, < 4.0)
|
70
|
+
regexp_parser (>= 1.7)
|
71
|
+
rexml
|
72
|
+
rubocop-ast (>= 0.3.0, < 1.0)
|
73
|
+
ruby-progressbar (~> 1.7)
|
74
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
75
|
+
rubocop-ast (0.3.0)
|
76
|
+
parser (>= 2.7.1.4)
|
77
|
+
ruby-progressbar (1.10.1)
|
78
|
+
safe_yaml (1.0.5)
|
52
79
|
thread_safe (0.3.6)
|
53
|
-
tzinfo (1.2.
|
80
|
+
tzinfo (1.2.7)
|
54
81
|
thread_safe (~> 0.1)
|
82
|
+
unicode-display_width (1.7.0)
|
83
|
+
vcr (5.0.0)
|
84
|
+
webmock (3.7.6)
|
85
|
+
addressable (>= 2.3.6)
|
86
|
+
crack (>= 0.3.2)
|
87
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
88
|
+
zeitwerk (2.4.0)
|
55
89
|
|
56
90
|
PLATFORMS
|
57
91
|
ruby
|
58
92
|
|
59
93
|
DEPENDENCIES
|
60
|
-
bundler
|
94
|
+
bundler
|
61
95
|
coda_docs!
|
62
96
|
dotenv (~> 2.5)
|
63
97
|
pry
|
64
98
|
pry-byebug
|
65
|
-
rake (~>
|
99
|
+
rake (~> 13.0)
|
66
100
|
rspec
|
101
|
+
rubocop
|
102
|
+
vcr
|
103
|
+
webmock
|
67
104
|
|
68
105
|
BUNDLED WITH
|
69
|
-
1.
|
106
|
+
2.1.4
|
data/README.md
CHANGED
@@ -23,20 +23,21 @@ Or install it yourself as:
|
|
23
23
|
The library needs to be configured with your account's secret key which is available in your [Coda Docs Dashboard](https://coda.io/account). You can set the required key with the `CODA_DOCS_API_KEY` environment variable
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
CODA_DOCS_API_KEY=
|
26
|
+
CODA_DOCS_API_KEY=my_secret_key
|
27
27
|
|
28
28
|
# New Coda Docs Client
|
29
29
|
client = CodaDocs::Client.new
|
30
30
|
```
|
31
|
-
or
|
31
|
+
or by instantiating a new client with your secret key.
|
32
32
|
|
33
33
|
```ruby
|
34
34
|
require "coda_docs"
|
35
35
|
|
36
36
|
# New Coda Docs Client
|
37
|
-
client = CodaDocs::Client.new(
|
37
|
+
client = CodaDocs::Client.new(my_secret_key)
|
38
38
|
```
|
39
39
|
|
40
|
+
Click [here](https://github.com/cmunozgar/coda_docs/wiki) for more usage info.
|
40
41
|
## Development
|
41
42
|
|
42
43
|
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.
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
|
1
|
+
# !/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'coda_docs'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "coda_docs"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start(__FILE__)
|
data/coda_docs.gemspec
CHANGED
@@ -9,8 +9,9 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ['carlos@monday.vc']
|
10
10
|
|
11
11
|
spec.summary = 'Coda Docs Api Gem'
|
12
|
-
spec.description = '
|
12
|
+
spec.description = 'Coda Docs Api Gem'
|
13
13
|
spec.homepage = 'https://github.com/joinmonday/coda_docs'
|
14
|
+
spec.required_ruby_version = '>= 2.4'
|
14
15
|
|
15
16
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
16
17
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
@@ -33,11 +34,12 @@ Gem::Specification.new do |spec|
|
|
33
34
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
34
35
|
spec.require_paths = ['lib']
|
35
36
|
|
36
|
-
spec.add_development_dependency 'bundler', '~> 1.16'
|
37
|
+
spec.add_development_dependency 'bundler' # , '~> 1.16'
|
37
38
|
spec.add_development_dependency 'dotenv', '~> 2.5'
|
38
|
-
spec.add_development_dependency 'pry'
|
39
|
-
spec.add_development_dependency 'pry-byebug'
|
40
|
-
spec.add_development_dependency 'rake', '~>
|
39
|
+
spec.add_development_dependency 'pry'
|
40
|
+
spec.add_development_dependency 'pry-byebug'
|
41
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
41
42
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
42
|
-
spec.add_dependency '
|
43
|
+
spec.add_dependency 'activesupport'
|
44
|
+
spec.add_dependency 'httparty'
|
43
45
|
end
|
data/lib/coda_docs/client.rb
CHANGED
@@ -1,38 +1,24 @@
|
|
1
|
-
require '
|
2
|
-
require 'coda_docs/
|
3
|
-
require 'coda_docs/
|
4
|
-
|
5
|
-
require 'coda_docs/client/rows'
|
6
|
-
require 'coda_docs/client/columns'
|
7
|
-
require 'coda_docs/client/formulas'
|
8
|
-
require 'coda_docs/client/controls'
|
9
|
-
require 'coda_docs/client/account'
|
10
|
-
require 'coda_docs/client/miscellaneous'
|
1
|
+
require 'active_support/core_ext/string'
|
2
|
+
require 'coda_docs/connection'
|
3
|
+
require 'coda_docs/entities/entity'
|
4
|
+
Dir[File.join(__dir__, 'entities', '*.rb')].each { |f| require f }
|
11
5
|
|
12
6
|
module CodaDocs
|
13
7
|
class Client
|
14
|
-
include HTTParty
|
15
|
-
include CodaDocs::Client::Docs
|
16
|
-
include CodaDocs::Client::Sections
|
17
|
-
include CodaDocs::Client::Folders
|
18
|
-
include CodaDocs::Client::Tables
|
19
|
-
include CodaDocs::Client::Rows
|
20
|
-
include CodaDocs::Client::Columns
|
21
|
-
include CodaDocs::Client::Formulas
|
22
|
-
include CodaDocs::Client::Controls
|
23
|
-
include CodaDocs::Client::Account
|
24
|
-
include CodaDocs::Client::Miscellaneous
|
25
|
-
base_uri 'https://coda.io/apis/v1beta1'
|
26
|
-
format :json
|
27
|
-
|
28
8
|
def initialize(access_token = nil)
|
29
|
-
access_token
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
9
|
+
@access_token = access_token || ENV['CODA_DOCS_API_KEY']
|
10
|
+
end
|
11
|
+
|
12
|
+
def method_missing(method_name, *args, &block)
|
13
|
+
klass = "CodaDocs::Entities::#{method_name.to_s.capitalize}"
|
14
|
+
.constantize
|
15
|
+
if klass
|
16
|
+
klass.new(access_token)
|
17
|
+
end
|
36
18
|
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
attr_reader :access_token
|
37
23
|
end
|
38
24
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module CodaDocs
|
2
|
+
module Entities
|
3
|
+
class Columns < Entity
|
4
|
+
def all(doc_id, table_id, options = nil)
|
5
|
+
response = connection.get("/docs/#{doc_id}/tables/#{table_id}/columns", query: options)
|
6
|
+
parse_response(response)
|
7
|
+
end
|
8
|
+
|
9
|
+
def find(doc_id, table_id, column_id)
|
10
|
+
connection.get("/docs/#{doc_id}/tables/#{table_id}/columns/#{column_id}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module CodaDocs
|
2
|
+
module Entities
|
3
|
+
class Controls < Entity
|
4
|
+
def all(doc_id, options = nil)
|
5
|
+
response = connection.get("/docs/#{doc_id}/controls", query: options)
|
6
|
+
parse_response(response)
|
7
|
+
end
|
8
|
+
|
9
|
+
def find(doc_id, control_id)
|
10
|
+
connection.get("/docs/#{doc_id}/controls/#{control_id}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module CodaDocs
|
2
|
+
module Entities
|
3
|
+
class Docs < Entity
|
4
|
+
def all(options = nil)
|
5
|
+
response = connection.get('/docs', query: options)
|
6
|
+
parse_response(response)
|
7
|
+
end
|
8
|
+
|
9
|
+
def find(doc_id)
|
10
|
+
connection.get("/docs/#{doc_id}")
|
11
|
+
end
|
12
|
+
|
13
|
+
def create(options)
|
14
|
+
connection.post(
|
15
|
+
'/docs',
|
16
|
+
body: options.to_json
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
def delete(doc_id)
|
21
|
+
connection.delete("/docs/#{doc_id}")
|
22
|
+
end
|
23
|
+
|
24
|
+
def publish(doc_id, options)
|
25
|
+
connection.put(
|
26
|
+
"/docs/#{doc_id}/publish",
|
27
|
+
body: options.to_json
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
def unpublish(doc_id)
|
32
|
+
connection.delete("/docs/#{doc_id}/publish")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module CodaDocs
|
2
|
+
module Entities
|
3
|
+
class Entity
|
4
|
+
def initialize(access_token)
|
5
|
+
@access_token = access_token
|
6
|
+
end
|
7
|
+
|
8
|
+
def parse_response(response)
|
9
|
+
response.parsed_response['items']
|
10
|
+
end
|
11
|
+
|
12
|
+
def connection
|
13
|
+
conn = CodaDocs::Connection
|
14
|
+
conn.default_options.merge!(
|
15
|
+
headers: {
|
16
|
+
'Authorization' => "Bearer #{@access_token}",
|
17
|
+
'Content-Type' => 'application/json'
|
18
|
+
}
|
19
|
+
)
|
20
|
+
conn
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module CodaDocs
|
2
|
+
module Entities
|
3
|
+
class Formulas < Entity
|
4
|
+
def all(doc_id, options = nil)
|
5
|
+
response = connection.get("/docs/#{doc_id}/formulas", query: options)
|
6
|
+
parse_response(response)
|
7
|
+
end
|
8
|
+
|
9
|
+
def find(doc_id, formula_id)
|
10
|
+
connection.get("/docs/#{doc_id}/formulas/#{formula_id}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module CodaDocs
|
2
|
-
|
3
|
-
|
2
|
+
module Entities
|
3
|
+
class Miscellaneous < Entity
|
4
4
|
def resolve_browser_link(url, degrade_gracefully = true)
|
5
|
-
|
5
|
+
connection.get('/resolveBrowserLink', query: { url: url, degradeGracefully: degrade_gracefully })
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module CodaDocs
|
2
|
+
module Entities
|
3
|
+
class Pages < Entity
|
4
|
+
def all(doc_id, options = nil)
|
5
|
+
response = connection.get("/docs/#{doc_id}/pages", query: options)
|
6
|
+
parse_response(response)
|
7
|
+
end
|
8
|
+
|
9
|
+
def find(doc_id, page_id, options = nil)
|
10
|
+
connection.get("/docs/#{doc_id}/pages/#{page_id}", query: options)
|
11
|
+
end
|
12
|
+
|
13
|
+
def update(doc_id, page_id, options)
|
14
|
+
connection.put(
|
15
|
+
"/docs/#{doc_id}/pages/#{page_id}",
|
16
|
+
body: options.to_json
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module CodaDocs
|
2
|
+
module Entities
|
3
|
+
class Rows < Entity
|
4
|
+
def all(doc_id, table_id, options = nil)
|
5
|
+
response = connection.get("/docs/#{doc_id}/tables/#{table_id}/rows", query: options)
|
6
|
+
parse_response(response)
|
7
|
+
end
|
8
|
+
|
9
|
+
def find(doc_id, table_id, row_id)
|
10
|
+
connection.get("/docs/#{doc_id}/tables/#{table_id}/rows/#{row_id}")
|
11
|
+
end
|
12
|
+
|
13
|
+
def delete(doc_id, table_id, row_id)
|
14
|
+
connection.delete("/docs/#{doc_id}/tables/#{table_id}/rows/#{row_id}")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module CodaDocs
|
2
|
+
module Entities
|
3
|
+
class Tables < Entity
|
4
|
+
def all(doc_id, options = nil)
|
5
|
+
response = connection.get("/docs/#{doc_id}/tables", query: options)
|
6
|
+
parse_response(response)
|
7
|
+
end
|
8
|
+
|
9
|
+
def find(doc_id, table_id)
|
10
|
+
connection.get("/docs/#{doc_id}/tables/#{table_id}")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/coda_docs/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coda_docs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Muñoz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dotenv
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,44 +42,44 @@ dependencies:
|
|
42
42
|
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pry-byebug
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '13.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '13.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,28 +94,42 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: activesupport
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: httparty
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- - "
|
115
|
+
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0
|
117
|
+
version: '0'
|
104
118
|
type: :runtime
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- - "
|
122
|
+
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0
|
111
|
-
description:
|
112
|
-
in progress and everything is subject to change.
|
124
|
+
version: '0'
|
125
|
+
description: Coda Docs Api Gem
|
113
126
|
email:
|
114
127
|
- carlos@monday.vc
|
115
128
|
executables: []
|
116
129
|
extensions: []
|
117
130
|
extra_rdoc_files: []
|
118
131
|
files:
|
132
|
+
- ".codeclimate.yml"
|
119
133
|
- ".gitignore"
|
120
134
|
- ".rspec"
|
121
135
|
- ".rubocop.yml"
|
@@ -130,16 +144,18 @@ files:
|
|
130
144
|
- coda_docs.gemspec
|
131
145
|
- lib/coda_docs.rb
|
132
146
|
- lib/coda_docs/client.rb
|
133
|
-
- lib/coda_docs/
|
134
|
-
- lib/coda_docs/
|
135
|
-
- lib/coda_docs/
|
136
|
-
- lib/coda_docs/
|
137
|
-
- lib/coda_docs/
|
138
|
-
- lib/coda_docs/
|
139
|
-
- lib/coda_docs/
|
140
|
-
- lib/coda_docs/
|
141
|
-
- lib/coda_docs/
|
142
|
-
- lib/coda_docs/
|
147
|
+
- lib/coda_docs/connection.rb
|
148
|
+
- lib/coda_docs/entities/account.rb
|
149
|
+
- lib/coda_docs/entities/categories.rb
|
150
|
+
- lib/coda_docs/entities/columns.rb
|
151
|
+
- lib/coda_docs/entities/controls.rb
|
152
|
+
- lib/coda_docs/entities/docs.rb
|
153
|
+
- lib/coda_docs/entities/entity.rb
|
154
|
+
- lib/coda_docs/entities/formulas.rb
|
155
|
+
- lib/coda_docs/entities/miscellaneous.rb
|
156
|
+
- lib/coda_docs/entities/pages.rb
|
157
|
+
- lib/coda_docs/entities/rows.rb
|
158
|
+
- lib/coda_docs/entities/tables.rb
|
143
159
|
- lib/coda_docs/version.rb
|
144
160
|
homepage: https://github.com/joinmonday/coda_docs
|
145
161
|
licenses: []
|
@@ -148,7 +164,7 @@ metadata:
|
|
148
164
|
homepage_uri: https://github.com/joinmonday/coda_docs
|
149
165
|
source_code_uri: https://github.com/joinmonday/coda_docs
|
150
166
|
changelog_uri: https://github.com/joinmonday/coda_docs
|
151
|
-
post_install_message:
|
167
|
+
post_install_message:
|
152
168
|
rdoc_options: []
|
153
169
|
require_paths:
|
154
170
|
- lib
|
@@ -156,16 +172,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
172
|
requirements:
|
157
173
|
- - ">="
|
158
174
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
175
|
+
version: '2.4'
|
160
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
177
|
requirements:
|
162
178
|
- - ">="
|
163
179
|
- !ruby/object:Gem::Version
|
164
180
|
version: '0'
|
165
181
|
requirements: []
|
166
|
-
|
167
|
-
|
168
|
-
signing_key:
|
182
|
+
rubygems_version: 3.0.8
|
183
|
+
signing_key:
|
169
184
|
specification_version: 4
|
170
185
|
summary: Coda Docs Api Gem
|
171
186
|
test_files: []
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module CodaDocs
|
2
|
-
class Client
|
3
|
-
module Columns
|
4
|
-
def columns(doc_id, table_id, options = {})
|
5
|
-
response = self.class.get("/docs/#{doc_id}/tables/#{table_id}/columns", query: options)
|
6
|
-
response.parsed_response['items']
|
7
|
-
end
|
8
|
-
|
9
|
-
def column(doc_id, table_id, column_id, options = {})
|
10
|
-
self.class.get("/docs/#{doc_id}/tables/#{table_id}/columns/#{column_id}", query: options)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module CodaDocs
|
2
|
-
class Client
|
3
|
-
module Controls
|
4
|
-
def controls(doc_id, options = {})
|
5
|
-
response = self.class.get("/docs/#{doc_id}/controls", query: options)
|
6
|
-
response.parsed_response['items']
|
7
|
-
end
|
8
|
-
|
9
|
-
def formula(doc_id, control_id, options = {})
|
10
|
-
self.class.get("/docs/#{doc_id}/controls/#{control_id}", query: options)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module CodaDocs
|
2
|
-
class Client
|
3
|
-
module Docs
|
4
|
-
def docs(options = {})
|
5
|
-
response = self.class.get('/docs', query: options)
|
6
|
-
response.parsed_response['items']
|
7
|
-
end
|
8
|
-
|
9
|
-
def doc(doc_id, options = {})
|
10
|
-
self.class.get("/docs/#{doc_id}", query: options)
|
11
|
-
end
|
12
|
-
|
13
|
-
def create_doc(title = 'Untitled', source_doc = nil)
|
14
|
-
self.class.post(
|
15
|
-
'/docs',
|
16
|
-
body: {
|
17
|
-
'title' => title,
|
18
|
-
'sourceDoc' => source_doc
|
19
|
-
}.to_json
|
20
|
-
)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module CodaDocs
|
2
|
-
class Client
|
3
|
-
module Folders
|
4
|
-
def folders(doc_id, options = {})
|
5
|
-
response = self.class.get("/docs/#{doc_id}/folders", query: options)
|
6
|
-
response.parsed_response['items']
|
7
|
-
end
|
8
|
-
|
9
|
-
def folder(doc_id, folder_id, options = {})
|
10
|
-
self.class.get("/docs/#{doc_id}/folders/#{folder_id}", query: options)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module CodaDocs
|
2
|
-
class Client
|
3
|
-
module Formulas
|
4
|
-
def formulas(doc_id, options = {})
|
5
|
-
response = self.class.get("/docs/#{doc_id}/formulas", query: options)
|
6
|
-
response.parsed_response['items']
|
7
|
-
end
|
8
|
-
|
9
|
-
def formula(doc_id, formula_id, options = {})
|
10
|
-
self.class.get("/docs/#{doc_id}/formulas/#{formula_id}", query: options)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module CodaDocs
|
2
|
-
class Client
|
3
|
-
module Rows
|
4
|
-
def rows(doc_id, table_id, options = {})
|
5
|
-
response = self.class.get("/docs/#{doc_id}/tables/#{table_id}/rows", query: options)
|
6
|
-
response.parsed_response['items']
|
7
|
-
end
|
8
|
-
|
9
|
-
def row(doc_id, table_id, row_id, options = {})
|
10
|
-
self.class.get("/docs/#{doc_id}/tables/#{table_id}/rows/#{row_id}", query: options)
|
11
|
-
end
|
12
|
-
|
13
|
-
def delete_row(doc_id, table_id, row_id)
|
14
|
-
self.class.delete("/docs/#{doc_id}/tables/#{table_id}/rows/#{row_id}")
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module CodaDocs
|
2
|
-
class Client
|
3
|
-
module Sections
|
4
|
-
def sections(doc_id, options = {})
|
5
|
-
response = self.class.get("/docs/#{doc_id}/sections", query: options)
|
6
|
-
response.parsed_response['items']
|
7
|
-
end
|
8
|
-
|
9
|
-
def section(doc_id, section_id, options = {})
|
10
|
-
self.class.get("/docs/#{doc_id}/sections/#{section_id}", query: options)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module CodaDocs
|
2
|
-
class Client
|
3
|
-
module Tables
|
4
|
-
def tables(doc_id, options = {})
|
5
|
-
response = self.class.get("/docs/#{doc_id}/tables", query: options)
|
6
|
-
response.parsed_response['items']
|
7
|
-
end
|
8
|
-
|
9
|
-
def table(doc_id, table_id, options = {})
|
10
|
-
self.class.get("/docs/#{doc_id}/tables/#{table_id}", query: options)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|