dynalist 1.0.1 → 1.0.2
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/Gemfile.lock +1 -1
- data/README.md +78 -6
- data/lib/dynalist/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2b29ad34ed2fc6381a7e824f8d4aa089b3d6debc2651854948c42b1517fb5b3
|
4
|
+
data.tar.gz: dbcbf2523a2739dc332f6a02f7f98abd91d3c152855d407eee825177cc49a6fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d8447fb178c0b2f9de886d242f7f728b2eecab8574f6b6279c1556af6bd1f63d97b635b47099ad526a5fa2160004bc6f70b89218cc3783e4c153f3e5de6f2e0
|
7
|
+
data.tar.gz: 717bc6e7e1baa495f06abeb6ce9634e2bc5717a2c2a795d8a76440b239c7e5bf4e4b88a3259ad56cdf0ff15d14cb05e68ccea27136dd5c377bd8f4f425eed945
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
# Dynalist
|
2
2
|
|
3
|
-
|
3
|
+
Dynalist is outlining app. there can write as tree structure and simply to control your ideas.
|
4
4
|
|
5
|
-
|
5
|
+
This is dynalist api client gem. support dynalist api version 1. [Api document](https://apidocs.dynalist.io/)
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
Add this line to your application's Gemfile:
|
10
9
|
|
11
10
|
```ruby
|
12
11
|
gem 'dynalist'
|
@@ -22,7 +21,80 @@ Or install it yourself as:
|
|
22
21
|
|
23
22
|
## Usage
|
24
23
|
|
25
|
-
|
24
|
+
### setup
|
25
|
+
|
26
|
+
### File-level Api
|
27
|
+
|
28
|
+
#### Access to file information
|
29
|
+
|
30
|
+
File information store FileTree class. FileTree find file to use find_by, where.
|
31
|
+
|
32
|
+
```
|
33
|
+
# Get files information.
|
34
|
+
FileApiClient.get_files
|
35
|
+
|
36
|
+
document = FileTree.where(title: 'document')
|
37
|
+
# => [#<Document: ... title: 'document'>]
|
38
|
+
|
39
|
+
folder = FileTree.find_by(title: 'diary')
|
40
|
+
# => [#<Folder: ... title: 'diary'>]
|
41
|
+
```
|
42
|
+
|
43
|
+
#### Update files
|
44
|
+
|
45
|
+
Edit query update document or folder title.
|
46
|
+
Move query change to file move down parent folder.
|
47
|
+
|
48
|
+
Update succeeded when return true, and failed return false.
|
49
|
+
|
50
|
+
```
|
51
|
+
queries = [
|
52
|
+
FileApiClient::Edit.new(document, 'new_doument_title'),
|
53
|
+
FileApiClient::Move.new(document, folder)
|
54
|
+
]
|
55
|
+
|
56
|
+
FileApiClient.new.move_file(queries)
|
57
|
+
# => [true, true]
|
58
|
+
```
|
59
|
+
|
60
|
+
### Document-level Api
|
61
|
+
|
62
|
+
#### Get information
|
63
|
+
|
64
|
+
Document information access read method, and stored NodeTree class. NodeTree have find_by and where class.
|
65
|
+
|
66
|
+
```
|
67
|
+
NodeApiClient.new.read(document)
|
68
|
+
nodes = NodeTree.where(context: ['context01', 'some message'])
|
69
|
+
```
|
70
|
+
|
71
|
+
### Check update
|
72
|
+
|
73
|
+
Check document update versions.
|
74
|
+
|
75
|
+
```
|
76
|
+
NodeApiClient.new.check_updates([document])
|
77
|
+
# => [document_id_01: 12, document_id_02: 32]
|
78
|
+
```
|
79
|
+
|
80
|
+
### Update document
|
81
|
+
|
82
|
+
Support Insert, Move, Edit, Delete queries.
|
83
|
+
Return new node ids.
|
84
|
+
|
85
|
+
```
|
86
|
+
insert_node = Node.new(context: 'new message')
|
87
|
+
|
88
|
+
queries = [
|
89
|
+
NodeApiClient::Insert.new(root_node, insert_node),
|
90
|
+
NodeApiClient::Move.new(root_node, move_node),
|
91
|
+
NodeApiClient::Edit.new(edit_node),
|
92
|
+
NodeApiClient::Delete.new(delete_node)
|
93
|
+
]
|
94
|
+
|
95
|
+
NodeApiClient.new.edit(document, queries)
|
96
|
+
# => ['insert_node_id']
|
97
|
+
```
|
26
98
|
|
27
99
|
## Development
|
28
100
|
|
@@ -32,7 +104,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
104
|
|
33
105
|
## Contributing
|
34
106
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
107
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/4geru/dynalist. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
108
|
|
37
109
|
## License
|
38
110
|
|
@@ -40,4 +112,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
112
|
|
41
113
|
## Code of Conduct
|
42
114
|
|
43
|
-
Everyone interacting in the Dynalist project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
115
|
+
Everyone interacting in the Dynalist project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/4geru/dynalist/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/dynalist/version.rb
CHANGED