Skip to content

Commit

Permalink
feat(doc): add docs documentationšŸ¤«šŸ˜‚
Browse files Browse the repository at this point in the history
  • Loading branch information
mrilyew committed Jan 12, 2025
1 parent 14b0120 commit d086bc3
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/openvk_engine/api/methods/docs/add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### `docs.add` šŸ”°

Adds document to user collection

**Params**:

|Name|Value|Description|
|--|--|--|
|`owner_id`|unsigned int|ID of owner|
|`doc_id`|unsigned int|ID of document|
|`access_key`|string|Access key|

**Result**

Returns id of new document

**Possible errors**:

|Code|Description|
|--|--|
|1150|Invalid document id|
|100|One of the parameters specified was missing or invalid: this document already added|
21 changes: 21 additions & 0 deletions docs/openvk_engine/api/methods/docs/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### `docs.delete` šŸ”°

Deletes document from user collection.

**Params**:

|Name|Value|Description|
|--|--|--|
|`owner_id`|unsigned int|ID of owner|
|`doc_id`|unsigned int|ID of document|

**Result**

Returns 1 on success.

**Possible errors**:

|Code|Description|
|--|--|
|1150|Invalid document id|
|1153|Access to document is denied|
18 changes: 18 additions & 0 deletions docs/openvk_engine/api/methods/docs/edit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### `docs.edit` šŸ”°

Edits document

**Params**:

|Name|Value|Description|
|--|--|--|
|`owner_id`|unsigned int|ID of owner|
|`doc_id`|unsigned int|ID of document|
|`title`|string|New title|
|`tags`|csv|New tags|
|`folder_id`|int|New folder id (0, 3)|
|`owner_hidden`|bool (0,1)|Is owner hidden|

**Result**

Returns 1 on success.
18 changes: 18 additions & 0 deletions docs/openvk_engine/api/methods/docs/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### `docs.get` šŸ”°

Edits document

**Params**:

|Name|Value|Description|
|--|--|--|
|`count`|unsigned int|Count|
|`offset`|unsigned int|Offset|
|`type`|int|VK API type of document|
|`owner_id`|int|Owner ID|
|`return_tags`|bool (0, 1)|Return "tags" field|
|`order`|int (0,1,2)| |

**Result**

Returns `count` and `items` fields.
14 changes: 14 additions & 0 deletions docs/openvk_engine/api/methods/docs/getById.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### `docs.getById` šŸ”°

Gets docs by ids

**Params**:

|Name|Value|Description|
|--|--|--|
|`docs`|csv array|Ids of documents|
|`return_tags`|bool (0, 1)|Return "tags" fields|

**Result**

Returns documents objects array.
12 changes: 12 additions & 0 deletions docs/openvk_engine/api/methods/docs/getTags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### `docs.getTags` šŸ”°

**Non-standart method**

Returns tags array from user/club documents.

**Params**:

|Name|Value|Description|
|--|--|--|
|`owner_id`|unsigned int|Owner id|
|`type`|unsigned int|type (0ā€”8)|
13 changes: 13 additions & 0 deletions docs/openvk_engine/api/methods/docs/getTypes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### `docs.getTypes` šŸ”°

Returns types of uploaded documents

**Params**:

|Name|Value|Description|
|--|--|--|
|`owner_id`|unsigned int|Owner id|

**Result**

Returns `count` and `items` fields.
16 changes: 16 additions & 0 deletions docs/openvk_engine/api/methods/docs/search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### `docs.search` šŸ”°

Searches public documents

**Params**:

|Name|Value|Description|
|--|--|--|
|`q`|string|Query|
|`search_own`|bool|Search by own documents|
|`order`|unsigned int|Order (0, 1, 2)|
|`count`|unsigned int|Count|
|`offset`|unsigned int|Offset|
|`return_tags`|bool|Return "tags" fields|
|`type`|unsigned int|VK API type of document|
|`tags`|string|Include "tags" to the search|
18 changes: 18 additions & 0 deletions docs/openvk_engine/api/objects/doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Document object

| Property | Value | Description |
|---|---|---|
|`id`|int|Document id|
|`owner_id`|int|Document owner id|
|`title`|string|Document title|
|`size`|int|Document size|
|`ext`|string|Document extension|
|`url`|string|Document URL|
|`date`|timestamp|Document upload time|
|`type`|range(1-8)|Document VK API type|
|`is_hidden`|bool|Is owner hidden|
|`folder_id`|int|0 ā€” private, 3 ā€” public|
|`access_key`|string|Access key|
|`can_manage`|bool|Can current user modify this document|
|`preview`|array|Contains photo object with preview (on images)|
|`tags`|array|Tags array|
10 changes: 10 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ nav:
- 'Objects':
- 'Audio Genres': 'openvk_engine/api/objects/audio_genres.md'
- 'Audio': 'openvk_engine/api/objects/audio.md'
- 'Document': 'openvk_engine/api/objects/doc.md'
- 'Playlist': 'openvk_engine/api/objects/playlist.md'
- 'User': 'openvk_engine/api/objects/user.md'
- 'Group': 'openvk_engine/api/objects/group.md'
Expand Down Expand Up @@ -88,6 +89,15 @@ nav:
- 'board.getTopics': 'openvk_engine/api/methods/board/getTopics.md'
- 'board.openTopic': 'openvk_engine/api/methods/board/openTopic.md'
- 'board.unfixTopic': 'openvk_engine/api/methods/board/unfixTopic.md'
- 'Docs':
- 'docs.add': 'openvk_engine/api/methods/docs/add.md'
- 'docs.delete': 'openvk_engine/api/methods/docs/delete.md'
- 'docs.edit': 'openvk_engine/api/methods/docs/edit.md'
- 'docs.get': 'openvk_engine/api/methods/docs/get.md'
- 'docs.getById': 'openvk_engine/api/methods/docs/getById.md'
- 'docs.getTypes': 'openvk_engine/api/methods/docs/getTypes.md'
- 'docs.getTags': 'openvk_engine/api/methods/docs/getTags.md'
- 'docs.search': 'openvk_engine/api/methods/docs/search.md'
- 'Friends':
- 'friends.add': 'openvk_engine/api/methods/friends/add.md'
- 'friends.areFriends': 'openvk_engine/api/methods/friends/areFriends.md'
Expand Down

0 comments on commit d086bc3

Please sign in to comment.