onlyoffice_api 0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/onlyoffice_api.rb +65 -0
- data/lib/teamlab/config.rb +39 -0
- data/lib/teamlab/modules/calendar.rb +111 -0
- data/lib/teamlab/modules/community.rb +20 -0
- data/lib/teamlab/modules/community/community_blogs.rb +54 -0
- data/lib/teamlab/modules/community/community_bookmarks.rb +60 -0
- data/lib/teamlab/modules/community/community_events.rb +50 -0
- data/lib/teamlab/modules/community/community_forums.rb +70 -0
- data/lib/teamlab/modules/community/community_wiki.rb +66 -0
- data/lib/teamlab/modules/crm.rb +32 -0
- data/lib/teamlab/modules/crm/crm_cases.rb +72 -0
- data/lib/teamlab/modules/crm/crm_common.rb +42 -0
- data/lib/teamlab/modules/crm/crm_contacts.rb +243 -0
- data/lib/teamlab/modules/crm/crm_files.rb +44 -0
- data/lib/teamlab/modules/crm/crm_history.rb +42 -0
- data/lib/teamlab/modules/crm/crm_invoices.rb +123 -0
- data/lib/teamlab/modules/crm/crm_opportunities.rb +93 -0
- data/lib/teamlab/modules/crm/crm_organisation.rb +14 -0
- data/lib/teamlab/modules/crm/crm_tags.rb +54 -0
- data/lib/teamlab/modules/crm/crm_tasks.rb +62 -0
- data/lib/teamlab/modules/crm/crm_user_fields.rb +34 -0
- data/lib/teamlab/modules/feed.rb +23 -0
- data/lib/teamlab/modules/files.rb +256 -0
- data/lib/teamlab/modules/group.rb +53 -0
- data/lib/teamlab/modules/group/group_helper.rb +15 -0
- data/lib/teamlab/modules/mail.rb +32 -0
- data/lib/teamlab/modules/mail/mail_accounts.rb +55 -0
- data/lib/teamlab/modules/mail/mail_alerts.rb +14 -0
- data/lib/teamlab/modules/mail/mail_contacts.rb +14 -0
- data/lib/teamlab/modules/mail/mail_conversations.rb +54 -0
- data/lib/teamlab/modules/mail/mail_folders.rb +18 -0
- data/lib/teamlab/modules/mail/mail_helpcenter.rb +10 -0
- data/lib/teamlab/modules/mail/mail_images.rb +18 -0
- data/lib/teamlab/modules/mail/mail_messages.rb +74 -0
- data/lib/teamlab/modules/mail/mail_settings.rb +17 -0
- data/lib/teamlab/modules/mail/mail_signature.rb +14 -0
- data/lib/teamlab/modules/mail/mail_tags.rb +30 -0
- data/lib/teamlab/modules/people.rb +104 -0
- data/lib/teamlab/modules/people/people_reassign.rb +26 -0
- data/lib/teamlab/modules/portals.rb +17 -0
- data/lib/teamlab/modules/project.rb +37 -0
- data/lib/teamlab/modules/projects/projects_comments.rb +34 -0
- data/lib/teamlab/modules/projects/projects_contacts.rb +18 -0
- data/lib/teamlab/modules/projects/projects_discussions.rb +46 -0
- data/lib/teamlab/modules/projects/projects_files.rb +34 -0
- data/lib/teamlab/modules/projects/projects_milestones.rb +46 -0
- data/lib/teamlab/modules/projects/projects_projects.rb +82 -0
- data/lib/teamlab/modules/projects/projects_reports.rb +18 -0
- data/lib/teamlab/modules/projects/projects_settings.rb +11 -0
- data/lib/teamlab/modules/projects/projects_tags.rb +18 -0
- data/lib/teamlab/modules/projects/projects_tasks.rb +94 -0
- data/lib/teamlab/modules/projects/projects_team.rb +30 -0
- data/lib/teamlab/modules/projects/projects_templates.rb +26 -0
- data/lib/teamlab/modules/projects/projects_time.rb +34 -0
- data/lib/teamlab/modules/settings.rb +100 -0
- data/lib/teamlab/name.rb +5 -0
- data/lib/teamlab/request.rb +79 -0
- data/lib/teamlab/response.rb +41 -0
- data/lib/teamlab/version.rb +5 -0
- metadata +140 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects comments methods
|
5
|
+
module ProjectsComments
|
6
|
+
def get_comment(comment_id)
|
7
|
+
@request.get(['comment', comment_id.to_s])
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_task_comments(task_id)
|
11
|
+
@request.get(['task', task_id.to_s, 'comment'])
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_message_comments(message_id)
|
15
|
+
@request.get(['message', message_id.to_s, 'comment'])
|
16
|
+
end
|
17
|
+
|
18
|
+
def add_task_comment(task_id, content, options = {})
|
19
|
+
@request.post(['task', task_id.to_s, 'comment'], { content: content }.merge(options))
|
20
|
+
end
|
21
|
+
|
22
|
+
def add_message_comment(message_id, content, options = {})
|
23
|
+
@request.post(['message', message_id.to_s, 'comment'], { content: content }.merge(options))
|
24
|
+
end
|
25
|
+
|
26
|
+
def update_comment(comment_id, content)
|
27
|
+
@request.put(['comment', comment_id.to_s], content: content)
|
28
|
+
end
|
29
|
+
|
30
|
+
def delete_comment(comment_id)
|
31
|
+
@request.delete(['comment', comment_id.to_s])
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects contacts methods
|
5
|
+
module ProjectsContacts
|
6
|
+
def get_projects_for_contact(contact_id)
|
7
|
+
@request.get(['contact', contact_id.to_s])
|
8
|
+
end
|
9
|
+
|
10
|
+
def add_project_contact(project_id, contact_id)
|
11
|
+
@request.post([project_id.to_s, 'contact'], contactId: contact_id)
|
12
|
+
end
|
13
|
+
|
14
|
+
def delete_project_contact(project_id, contact_id)
|
15
|
+
@request.delete([project_id.to_s, 'contact'], contactId: contact_id)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects discussions methods
|
5
|
+
module ProjectsDiscussions
|
6
|
+
def get_latest_discussion_messages
|
7
|
+
@request.get(['message'])
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_message_by_filter(options = {})
|
11
|
+
@request.get(%w[message filter], options)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_messages(project_id)
|
15
|
+
@request.get([project_id.to_s, 'message'])
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_project_message(message_id)
|
19
|
+
@request.get(['message', message_id.to_s])
|
20
|
+
end
|
21
|
+
|
22
|
+
def check_subscription_to_discussion(message_id)
|
23
|
+
@request.get(['message', message_id.to_s, 'subscribe'])
|
24
|
+
end
|
25
|
+
|
26
|
+
def add_message(project_id, title, content, participants, options = {})
|
27
|
+
@request.post([project_id.to_s, 'message'], { title: title, content: content, participants: participants }.merge(options))
|
28
|
+
end
|
29
|
+
|
30
|
+
def update_message(message_id, project_id, title, content, options = {})
|
31
|
+
@request.put(['message', message_id.to_s], { projectid: project_id, title: title, content: content }.merge(options))
|
32
|
+
end
|
33
|
+
|
34
|
+
def update_message_status(message_id, status)
|
35
|
+
@request.put(['message', message_id.to_s, 'status'], status: status)
|
36
|
+
end
|
37
|
+
|
38
|
+
def subscribe_to_message_action(message_id)
|
39
|
+
@request.put(['message', message_id.to_s, 'subscribe'])
|
40
|
+
end
|
41
|
+
|
42
|
+
def delete_message(message_id)
|
43
|
+
@request.delete(['message', message_id.to_s])
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects files methods
|
5
|
+
module ProjectsFiles
|
6
|
+
def get_task_files(task_id)
|
7
|
+
@request.get(['task', task_id.to_s, 'files'])
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_entity_files(entity_id, entity_type)
|
11
|
+
@request.get([entity_id.to_s, 'entityfiles'], entityType: entity_type)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_message_files(message_id)
|
15
|
+
@request.get(['message', message_id.to_s, 'files'])
|
16
|
+
end
|
17
|
+
|
18
|
+
def upload_file_to_task(task_id, *files)
|
19
|
+
@request.post(['task', task_id.to_s, 'files'], files: files.flatten)
|
20
|
+
end
|
21
|
+
|
22
|
+
def upload_file_to_message(message_id, *files)
|
23
|
+
@request.post(['message', message_id.to_s, 'files'], files: files.flatten)
|
24
|
+
end
|
25
|
+
|
26
|
+
def detach_file_from_task(task_id, file_id)
|
27
|
+
@request.delete(['task', task_id.to_s, 'files'], fileid: file_id)
|
28
|
+
end
|
29
|
+
|
30
|
+
def detach_file_from_message(message_id, file_id)
|
31
|
+
@request.delete(['message', message_id.to_s, 'files'], fileid: file_id)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects milestones methods
|
5
|
+
module ProjectsMilestones
|
6
|
+
def get_upcoming_milestones
|
7
|
+
@request.get(%w[milestone])
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_overdue_milestones
|
11
|
+
@request.get(%w[milestone late])
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_milestone(id)
|
15
|
+
@request.get(['milestone', id.to_s])
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_milestones_by_filter(options = {})
|
19
|
+
@request.get(%w[milestone filter], options)
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_milestone_tasks(id)
|
23
|
+
@request.get(['milestone', id.to_s, 'task'])
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_milestones_by_month(year, month)
|
27
|
+
@request.get(['milestone', year.to_s, month.to_s])
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_milestones_by_full_date(year, month, day)
|
31
|
+
@request.get(['milestone', year.to_s, month.to_s, day.to_s])
|
32
|
+
end
|
33
|
+
|
34
|
+
def update_milestone(id, title, deadline, options = {})
|
35
|
+
@request.put(['milestone', id.to_s], { title: title, deadline: deadline }.merge(options))
|
36
|
+
end
|
37
|
+
|
38
|
+
def update_milestone_status(id, status)
|
39
|
+
@request.put(['milestone', id.to_s, 'status'], status: status)
|
40
|
+
end
|
41
|
+
|
42
|
+
def delete_milestone(id)
|
43
|
+
@request.delete(['milestone', id.to_s])
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects projects methods
|
5
|
+
module ProjectsProjects
|
6
|
+
def get_projects
|
7
|
+
@request.get
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_project(id)
|
11
|
+
@request.get([id.to_s])
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_participated_projects
|
15
|
+
@request.get(['@self'])
|
16
|
+
end
|
17
|
+
|
18
|
+
def filter_projects(options = {})
|
19
|
+
@request.get(['filter'], options)
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_followed_projects
|
23
|
+
@request.get(['@follow'])
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_project_by_status(status)
|
27
|
+
@request.get([status.to_s])
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_spent_time(project_id)
|
31
|
+
@request.get([project_id.to_s, 'time'])
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_project_files(project_id)
|
35
|
+
@request.get([project_id.to_s, 'files'])
|
36
|
+
end
|
37
|
+
|
38
|
+
def get_milestones(project_id)
|
39
|
+
@request.get([project_id.to_s, 'milestone'])
|
40
|
+
end
|
41
|
+
|
42
|
+
def search_all_projects(query)
|
43
|
+
@request.get(['@search', query.to_s])
|
44
|
+
end
|
45
|
+
|
46
|
+
def search_project(project_id, query)
|
47
|
+
@request.get([project_id.to_s, '@search', query.to_s])
|
48
|
+
end
|
49
|
+
|
50
|
+
def get_milestones_with_status(project_id, status)
|
51
|
+
@request.get([project_id.to_s, 'milestone', status.to_s])
|
52
|
+
end
|
53
|
+
|
54
|
+
def create_project(title, description, responsible_id, tags, private, options = {})
|
55
|
+
@request.post('', { title: title, description: description, responsibleid: responsible_id, tags: tags, private: private }.merge(options))
|
56
|
+
end
|
57
|
+
|
58
|
+
def add_milestone(project_id, title, deadline, responsible_id, options = {})
|
59
|
+
@request.post([project_id.to_s, 'milestone'], { title: title, deadline: deadline, responsible: responsible_id }.merge(options))
|
60
|
+
end
|
61
|
+
|
62
|
+
def update_project(id, title, responsible_id, options = {})
|
63
|
+
@request.put([id.to_s], { title: title, responsibleId: responsible_id }.merge(options))
|
64
|
+
end
|
65
|
+
|
66
|
+
def update_project_tags(id, tags)
|
67
|
+
@request.put([id.to_s, 'tag'], tags: tags)
|
68
|
+
end
|
69
|
+
|
70
|
+
def update_project_status(id, status)
|
71
|
+
@request.put([id.to_s, 'status'], status: status)
|
72
|
+
end
|
73
|
+
|
74
|
+
def follow_unfollow_project(project_id)
|
75
|
+
@request.put([project_id.to_s, 'follow'])
|
76
|
+
end
|
77
|
+
|
78
|
+
def delete_project(id)
|
79
|
+
@request.delete([id.to_s])
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects reports methods
|
5
|
+
module ProjectsReports
|
6
|
+
def create_report_template(name, options = {})
|
7
|
+
@request.post(['report'], { name: name }.merge(options))
|
8
|
+
end
|
9
|
+
|
10
|
+
def update_report_template(report_id, name, options = {})
|
11
|
+
@request.put(['report', report_id.to_s], { name: name }.merge(options))
|
12
|
+
end
|
13
|
+
|
14
|
+
def delete_report_template(report_id)
|
15
|
+
@request.delete(['report', report_id.to_s])
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects tags methods
|
5
|
+
module ProjectsTags
|
6
|
+
def get_project_tags
|
7
|
+
@request.get(%w[tag])
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_project_by_tag(tag)
|
11
|
+
@request.get(['tag', tag.to_s])
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_tags_by_name(tag_name)
|
15
|
+
@request.get(%w[tag search], tagName: tag_name)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects tasks methods
|
5
|
+
module ProjectsTasks
|
6
|
+
def get_my_tasks
|
7
|
+
@request.get(%w[task @self])
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_task_by_filter(options = {})
|
11
|
+
@request.get(%w[task filter], options)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_task(id)
|
15
|
+
@request.get(['task', id.to_s])
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_tasks(project_id)
|
19
|
+
@request.get([project_id.to_s, 'task'])
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_my_tasks_by_status(status)
|
23
|
+
@request.get(['task', '@self', status.to_s])
|
24
|
+
end
|
25
|
+
|
26
|
+
def notify_task_responsible(task_id)
|
27
|
+
@request.get(['task', task_id.to_s, 'notify'])
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_all_tasks(project_id)
|
31
|
+
@request.get([project_id.to_s, 'task'])
|
32
|
+
end
|
33
|
+
|
34
|
+
def check_subscription_to_task_action(task_id)
|
35
|
+
@request.get(['task', task_id.to_s, 'subscribe'])
|
36
|
+
end
|
37
|
+
|
38
|
+
def get_tasks_with_status(project_id, status)
|
39
|
+
@request.get([project_id.to_s, 'task', status.to_s])
|
40
|
+
end
|
41
|
+
|
42
|
+
def get_my_tasks_with_status(project_id, status)
|
43
|
+
@request.get([project_id.to_s, 'task', '@self', status.to_s])
|
44
|
+
end
|
45
|
+
|
46
|
+
def create_subtask(task_id, responsible_id, title)
|
47
|
+
@request.post(['task', task_id.to_s], responsible: responsible_id, title: title)
|
48
|
+
end
|
49
|
+
|
50
|
+
def add_link(parent_task_id, dependence_task_id, link_type)
|
51
|
+
@request.post(['task', parent_task_id.to_s, 'link'], dependenceTaskId: dependence_task_id, linkType: link_type)
|
52
|
+
end
|
53
|
+
|
54
|
+
def add_task(project_id, title, options = {})
|
55
|
+
@request.post([project_id.to_s, 'task'], { title: title }.merge(options))
|
56
|
+
end
|
57
|
+
|
58
|
+
def add_task_from_discussion(project_id, message_id)
|
59
|
+
@request.post([project_id.to_s, 'task', message_id.to_s])
|
60
|
+
end
|
61
|
+
|
62
|
+
def update_task_status(task_id, status)
|
63
|
+
@request.put(['task', task_id.to_s, 'status'], status: status)
|
64
|
+
end
|
65
|
+
|
66
|
+
def update_project_task(task_id, title, options = {})
|
67
|
+
@request.put(['task', task_id.to_s], { title: title.to_s }.merge(options))
|
68
|
+
end
|
69
|
+
|
70
|
+
def update_task_milestone(task_id, milestone_id)
|
71
|
+
@request.put(['task', task_id.to_s, 'milestone'], milestoneId: milestone_id)
|
72
|
+
end
|
73
|
+
|
74
|
+
def subscribe_to_task_action(task_id)
|
75
|
+
@request.put(['task', task_id.to_s, 'subscribe'])
|
76
|
+
end
|
77
|
+
|
78
|
+
def update_subtask(task_id, subtask_id, responsible_id, title)
|
79
|
+
@request.put(['task', task_id.to_s, subtask_id.to_s], responsible: responsible_id, title: title)
|
80
|
+
end
|
81
|
+
|
82
|
+
def update_subtask_status(task_id, subtask_id, status)
|
83
|
+
@request.put(['task', task_id.to_s, subtask_id.to_s, 'status'], status: status)
|
84
|
+
end
|
85
|
+
|
86
|
+
def delete_subtask(task_id, subtask_id)
|
87
|
+
@request.delete(['task', task_id.to_s, subtask_id.to_s])
|
88
|
+
end
|
89
|
+
|
90
|
+
def delete_task(id)
|
91
|
+
@request.delete(['task', id.to_s])
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects team methods
|
5
|
+
module ProjectsTeam
|
6
|
+
def get_project_team(project_id)
|
7
|
+
@request.get([project_id.to_s, 'team'])
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_projects_teams(*project_ids)
|
11
|
+
@request.post(%w[team], ids: project_ids.flatten)
|
12
|
+
end
|
13
|
+
|
14
|
+
def add_to_team(project_id, user_id)
|
15
|
+
@request.post([project_id.to_s, 'team'], userid: user_id)
|
16
|
+
end
|
17
|
+
|
18
|
+
def update_project_team(project_id, participants_ids, options = {})
|
19
|
+
@request.put([project_id.to_s, 'team'], { participants: participants_ids }.merge(options))
|
20
|
+
end
|
21
|
+
|
22
|
+
def set_team_security(project_id, user_id, security, options = {})
|
23
|
+
@request.put([project_id.to_s, 'team', 'security'], { userId: user_id, security: security }.merge(options))
|
24
|
+
end
|
25
|
+
|
26
|
+
def remove_from_team(project_id, user_id)
|
27
|
+
@request.delete([project_id.to_s, 'team'], userId: user_id)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Teamlab
|
4
|
+
# Module for projects templates methods
|
5
|
+
module ProjectsTemplates
|
6
|
+
def get_templates
|
7
|
+
@request.get(['template'])
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_template(template_id)
|
11
|
+
@request.get(['template', template_id.to_s])
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_template(title, options = {})
|
15
|
+
@request.post(['template'], { title: title }.merge(options))
|
16
|
+
end
|
17
|
+
|
18
|
+
def update_template(id, title)
|
19
|
+
@request.put(['template', id.to_s], title: title)
|
20
|
+
end
|
21
|
+
|
22
|
+
def delete_template(id)
|
23
|
+
@request.delete(['template', id.to_s])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|