bundleup-sdk 0.6.0 → 0.7.0
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/README.md +76 -14
- data/lib/bundleup/auth.rb +14 -1
- data/lib/bundleup/unify/helpdesk.rb +40 -0
- data/lib/bundleup/unify/tasks.rb +54 -0
- data/lib/bundleup/unify.rb +10 -4
- data/lib/bundleup/version.rb +1 -1
- data/lib/bundleup.rb +7 -1
- data/sig/bundleup/auth.rbs +18 -0
- data/sig/bundleup/unify/helpdesk.rbs +33 -0
- data/sig/bundleup/unify/{ticketing.rbs → tasks.rbs} +7 -7
- data/sig/bundleup/unify.rbs +2 -1
- metadata +6 -4
- data/lib/bundleup/unify/ticketing.rb +0 -54
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a3feaef0f54fcef0ff3dba477b926513d0ed0801e2f383a80b0ca13f44218c5a
|
|
4
|
+
data.tar.gz: d44bc81b00d6afa88e0b4d58de1f832a98d81538f00a6169d3f5838e52865d1f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 95b41fa793e45e3aaa62f01beda29dce8172b5547da1e5959c0c4cf6927de71fca5892f9c2d8d2a87a1fecc3a43af53c7cc2139e1afff4a215f3c5287a057a9d
|
|
7
|
+
data.tar.gz: e597e588f6cd074e365660d54908ef489e456fcec0b9f5238c87ad946be29b007e636fb541439429fd25a6b6486fa89c535eab2d4c76e5dd824d0427248d8b6d
|
data/README.md
CHANGED
|
@@ -84,7 +84,7 @@ Runnable examples are available in the [`examples/`](./examples) directory:
|
|
|
84
84
|
|
|
85
85
|
- [`examples/basic_usage.rb`](./examples/basic_usage.rb) - Client setup, connections, integrations, and webhooks
|
|
86
86
|
- [`examples/proxy_api.rb`](./examples/proxy_api.rb) - Proxy API GET request with a connection
|
|
87
|
-
- [`examples/unify_api.rb`](./examples/unify_api.rb) - Unify Chat, Git,
|
|
87
|
+
- [`examples/unify_api.rb`](./examples/unify_api.rb) - Unify Chat, Git, Tasks, Helpdesk, Drive, and Calendar endpoint usage
|
|
88
88
|
- [`examples/README.md`](./examples/README.md) - Setup and execution instructions
|
|
89
89
|
|
|
90
90
|
## Quick Start
|
|
@@ -542,6 +542,16 @@ url = client.auth.build_authorization_url(
|
|
|
542
542
|
# Redirect the user to `url`
|
|
543
543
|
```
|
|
544
544
|
|
|
545
|
+
The URL needs no API key, so you can also build it without a client:
|
|
546
|
+
|
|
547
|
+
```ruby
|
|
548
|
+
url = BundleUp.build_authorization_url(
|
|
549
|
+
client_id: 'your-client-id',
|
|
550
|
+
integration_id: 'github',
|
|
551
|
+
redirect_uri: 'https://app.example.com/callback'
|
|
552
|
+
)
|
|
553
|
+
```
|
|
554
|
+
|
|
545
555
|
**Parameters:**
|
|
546
556
|
|
|
547
557
|
- `client_id` (String, required): Your workspace client ID
|
|
@@ -1084,20 +1094,20 @@ provider's default branch is used.
|
|
|
1084
1094
|
}
|
|
1085
1095
|
```
|
|
1086
1096
|
|
|
1087
|
-
####
|
|
1097
|
+
#### Tasks API
|
|
1088
1098
|
|
|
1089
|
-
The
|
|
1099
|
+
The Tasks API provides a unified interface for issue trackers and project management tools like Jira, Linear, Asana, Trello, ClickUp, monday.com, Basecamp, Wrike, and Todoist.
|
|
1090
1100
|
|
|
1091
|
-
##### List
|
|
1101
|
+
##### List Tasks
|
|
1092
1102
|
|
|
1093
1103
|
```ruby
|
|
1094
|
-
result = unify.
|
|
1104
|
+
result = unify.tasks.tasks(
|
|
1095
1105
|
limit: 100,
|
|
1096
1106
|
after: nil,
|
|
1097
1107
|
include_raw: false
|
|
1098
1108
|
)
|
|
1099
1109
|
|
|
1100
|
-
puts "
|
|
1110
|
+
puts "Tasks: #{result['data']}"
|
|
1101
1111
|
```
|
|
1102
1112
|
|
|
1103
1113
|
**Response:**
|
|
@@ -1124,18 +1134,18 @@ puts "Tickets: #{result['data']}"
|
|
|
1124
1134
|
**Filtering and sorting:**
|
|
1125
1135
|
|
|
1126
1136
|
```ruby
|
|
1127
|
-
|
|
1128
|
-
sorted_by_date = result['data'].sort_by { |
|
|
1137
|
+
open_tasks = result['data'].select { |task| task['status'] == 'open' }
|
|
1138
|
+
sorted_by_date = result['data'].sort_by { |task| Time.parse(task['created_at']) }.reverse
|
|
1129
1139
|
```
|
|
1130
1140
|
|
|
1131
|
-
##### Get a
|
|
1141
|
+
##### Get a Task
|
|
1132
1142
|
|
|
1133
|
-
Fetch one
|
|
1143
|
+
Fetch one task by ID. Not supported by Basecamp, whose API only serves a to-do underneath its project.
|
|
1134
1144
|
|
|
1135
1145
|
```ruby
|
|
1136
|
-
result = unify.
|
|
1146
|
+
result = unify.tasks.task('PROJ-123')
|
|
1137
1147
|
|
|
1138
|
-
puts "
|
|
1148
|
+
puts "Task: #{result['data']}"
|
|
1139
1149
|
```
|
|
1140
1150
|
|
|
1141
1151
|
**Response:**
|
|
@@ -1159,7 +1169,7 @@ A single resource carries no pagination, so there is no `metadata` on this respo
|
|
|
1159
1169
|
##### List Projects
|
|
1160
1170
|
|
|
1161
1171
|
```ruby
|
|
1162
|
-
result = unify.
|
|
1172
|
+
result = unify.tasks.projects(
|
|
1163
1173
|
limit: 100,
|
|
1164
1174
|
after: nil,
|
|
1165
1175
|
include_raw: false
|
|
@@ -1191,6 +1201,57 @@ puts "Projects: #{result['data']}"
|
|
|
1191
1201
|
|
|
1192
1202
|
**Note:** Not every platform returns every field. Jira does not expose creation or update timestamps for projects, so `created_at` and `updated_at` are `nil` for Jira connections, and `status` is only set when Jira reports whether the project is archived.
|
|
1193
1203
|
|
|
1204
|
+
#### Helpdesk API
|
|
1205
|
+
|
|
1206
|
+
The Helpdesk API provides a unified interface for customer support tools like Zendesk, ServiceNow, Zoho Desk, Gorgias, and Help Scout.
|
|
1207
|
+
|
|
1208
|
+
##### List Tickets
|
|
1209
|
+
|
|
1210
|
+
```ruby
|
|
1211
|
+
result = unify.helpdesk.tickets(
|
|
1212
|
+
limit: 100,
|
|
1213
|
+
after: nil,
|
|
1214
|
+
include_raw: false
|
|
1215
|
+
)
|
|
1216
|
+
|
|
1217
|
+
puts "Tickets: #{result['data']}"
|
|
1218
|
+
```
|
|
1219
|
+
|
|
1220
|
+
**Response:**
|
|
1221
|
+
|
|
1222
|
+
```ruby
|
|
1223
|
+
{
|
|
1224
|
+
'data' => [
|
|
1225
|
+
{
|
|
1226
|
+
'id' => '4182',
|
|
1227
|
+
'title' => 'Refund for order #1043',
|
|
1228
|
+
'description' => 'Hi, my order arrived damaged...',
|
|
1229
|
+
'status' => 'open',
|
|
1230
|
+
'priority' => 'high',
|
|
1231
|
+
'requester' => { 'id' => '381920', 'name' => 'Dana Ruiz', 'email' => 'dana@example.com' },
|
|
1232
|
+
'url' => 'https://acme.zendesk.com/agent/tickets/4182',
|
|
1233
|
+
'created_at' => '2024-01-15T10:30:00Z',
|
|
1234
|
+
'updated_at' => '2024-01-20T14:22:00Z'
|
|
1235
|
+
}
|
|
1236
|
+
],
|
|
1237
|
+
'metadata' => {
|
|
1238
|
+
'next' => 'cursor_def456'
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
```
|
|
1242
|
+
|
|
1243
|
+
##### Get a Ticket
|
|
1244
|
+
|
|
1245
|
+
Fetch one support ticket by ID. On ServiceNow the ID is the incident's `sys_id`.
|
|
1246
|
+
|
|
1247
|
+
```ruby
|
|
1248
|
+
result = unify.helpdesk.ticket('4182')
|
|
1249
|
+
|
|
1250
|
+
puts "Ticket: #{result['data']}"
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
A single resource carries no pagination, so there is no `metadata` on this response.
|
|
1254
|
+
|
|
1194
1255
|
#### CRM API
|
|
1195
1256
|
|
|
1196
1257
|
The CRM API provides a unified interface for CRM platforms like Attio, HubSpot, PipeDrive, Salesforce and Zoho.
|
|
@@ -1552,7 +1613,8 @@ lib/
|
|
|
1552
1613
|
│ ├── base.rb # Base Unify class
|
|
1553
1614
|
│ ├── chat.rb # Chat Unify API
|
|
1554
1615
|
│ ├── git.rb # Git Unify API
|
|
1555
|
-
│ ├──
|
|
1616
|
+
│ ├── tasks.rb # Tasks Unify API
|
|
1617
|
+
│ ├── helpdesk.rb # Helpdesk Unify API
|
|
1556
1618
|
│ ├── crm.rb # CRM Unify API
|
|
1557
1619
|
│ ├── drive.rb # Drive Unify API
|
|
1558
1620
|
│ └── calendar.rb # Calendar Unify API
|
data/lib/bundleup/auth.rb
CHANGED
|
@@ -14,7 +14,10 @@ module BundleUp
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
# Builds the hosted authorization URL to send the end user to.
|
|
17
|
-
|
|
17
|
+
#
|
|
18
|
+
# Needs no API key: /authorize only takes the public client and
|
|
19
|
+
# integration ids, so this is safe to call where the key must not live.
|
|
20
|
+
def self.build_authorization_url(client_id:, integration_id:, redirect_uri:, external_id: nil, state: nil)
|
|
18
21
|
raise ArgumentError, 'client_id is required' if blank?(client_id)
|
|
19
22
|
raise ArgumentError, 'integration_id is required' if blank?(integration_id)
|
|
20
23
|
raise ArgumentError, 'redirect_uri is required' if blank?(redirect_uri)
|
|
@@ -30,6 +33,16 @@ module BundleUp
|
|
|
30
33
|
"#{BASE_URL}/authorize?#{URI.encode_www_form(params)}"
|
|
31
34
|
end
|
|
32
35
|
|
|
36
|
+
def self.blank?(value)
|
|
37
|
+
value.nil? || value.to_s.empty?
|
|
38
|
+
end
|
|
39
|
+
private_class_method :blank?
|
|
40
|
+
|
|
41
|
+
# Builds the hosted authorization URL to send the end user to.
|
|
42
|
+
def build_authorization_url(**params)
|
|
43
|
+
self.class.build_authorization_url(**params)
|
|
44
|
+
end
|
|
45
|
+
|
|
33
46
|
# Exchanges the one-time code from the redirect for the connection.
|
|
34
47
|
# Call this server-side; the code expires after 5 minutes and works once.
|
|
35
48
|
# Returns { 'connection_id', 'external_id', 'integration_id' }.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BundleUp
|
|
4
|
+
module Unify
|
|
5
|
+
# Client for helpdesk Unify endpoints (customer support tools).
|
|
6
|
+
class Helpdesk < Base
|
|
7
|
+
# Fetches support tickets from the connected helpdesk.
|
|
8
|
+
def tickets(params = {})
|
|
9
|
+
response = connection.get('helpdesk/tickets') do |req|
|
|
10
|
+
req.params = params
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
raise "Failed to fetch helpdesk/tickets: #{response.status}" unless response.success?
|
|
14
|
+
|
|
15
|
+
response.body
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Fetches a single support ticket by ID (a sys_id on ServiceNow).
|
|
19
|
+
def ticket(ticket_id, params = {})
|
|
20
|
+
raise ArgumentError, 'ticket_id is required to fetch a ticket.' if blank?(ticket_id)
|
|
21
|
+
|
|
22
|
+
encoded_id = URI.encode_www_form_component(ticket_id)
|
|
23
|
+
|
|
24
|
+
response = connection.get("helpdesk/tickets/#{encoded_id}") do |req|
|
|
25
|
+
req.params = params
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
raise "Failed to fetch helpdesk/tickets/#{encoded_id}: #{response.status}" unless response.success?
|
|
29
|
+
|
|
30
|
+
response.body
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def blank?(value)
|
|
36
|
+
value.nil? || value.to_s.empty?
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BundleUp
|
|
4
|
+
module Unify
|
|
5
|
+
# Client for tasks Unify endpoints (issue trackers and project tools).
|
|
6
|
+
class Tasks < Base
|
|
7
|
+
# Fetches tasks from the connected issue tracker or project tool.
|
|
8
|
+
def tasks(params = {})
|
|
9
|
+
response = connection.get('tasks/tasks') do |req|
|
|
10
|
+
req.params = params
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
raise "Failed to fetch tasks/tasks: #{response.status}" unless response.success?
|
|
14
|
+
|
|
15
|
+
response.body
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Fetches a single task by ID from the connected issue tracker or project tool.
|
|
19
|
+
#
|
|
20
|
+
# Not supported by Basecamp, whose API only serves a to-do underneath its
|
|
21
|
+
# project — an id on its own cannot address one.
|
|
22
|
+
def task(task_id, params = {})
|
|
23
|
+
raise ArgumentError, 'task_id is required to fetch a task.' if blank?(task_id)
|
|
24
|
+
|
|
25
|
+
encoded_id = URI.encode_www_form_component(task_id)
|
|
26
|
+
|
|
27
|
+
response = connection.get("tasks/tasks/#{encoded_id}") do |req|
|
|
28
|
+
req.params = params
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
raise "Failed to fetch tasks/tasks/#{encoded_id}: #{response.status}" unless response.success?
|
|
32
|
+
|
|
33
|
+
response.body
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Fetches projects from the connected issue tracker or project tool.
|
|
37
|
+
def projects(params = {})
|
|
38
|
+
response = connection.get('tasks/projects') do |req|
|
|
39
|
+
req.params = params
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
raise "Failed to fetch tasks/projects: #{response.status}" unless response.success?
|
|
43
|
+
|
|
44
|
+
response.body
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def blank?(value)
|
|
50
|
+
value.nil? || value.to_s.empty?
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
data/lib/bundleup/unify.rb
CHANGED
|
@@ -7,7 +7,8 @@ module BundleUp
|
|
|
7
7
|
attr_reader :api_key, :connection_id
|
|
8
8
|
|
|
9
9
|
def initialize(api_key, connection_id)
|
|
10
|
-
@
|
|
10
|
+
@tasks = BundleUp::Unify::Tasks.new(api_key, connection_id)
|
|
11
|
+
@helpdesk = BundleUp::Unify::Helpdesk.new(api_key, connection_id)
|
|
11
12
|
@chat = BundleUp::Unify::Chat.new(api_key, connection_id)
|
|
12
13
|
@git = BundleUp::Unify::Git.new(api_key, connection_id)
|
|
13
14
|
@crm = BundleUp::Unify::CRM.new(api_key, connection_id)
|
|
@@ -32,9 +33,14 @@ module BundleUp
|
|
|
32
33
|
@crm ||= BundleUp::Unify::CRM.new(api_key, connection_id)
|
|
33
34
|
end
|
|
34
35
|
|
|
35
|
-
# Access the
|
|
36
|
-
def
|
|
37
|
-
@
|
|
36
|
+
# Access the Tasks API (issue trackers and project tools) for the connection.
|
|
37
|
+
def tasks
|
|
38
|
+
@tasks ||= BundleUp::Unify::Tasks.new(api_key, connection_id)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Access the Helpdesk API (customer support tools) for the connection.
|
|
42
|
+
def helpdesk
|
|
43
|
+
@helpdesk ||= BundleUp::Unify::Helpdesk.new(api_key, connection_id)
|
|
38
44
|
end
|
|
39
45
|
|
|
40
46
|
# Access the Drive API for the connection.
|
data/lib/bundleup/version.rb
CHANGED
data/lib/bundleup.rb
CHANGED
|
@@ -19,7 +19,8 @@ require_relative 'bundleup/resources/webhook'
|
|
|
19
19
|
require_relative 'bundleup/unify/base'
|
|
20
20
|
require_relative 'bundleup/unify/chat'
|
|
21
21
|
require_relative 'bundleup/unify/git'
|
|
22
|
-
require_relative 'bundleup/unify/
|
|
22
|
+
require_relative 'bundleup/unify/tasks'
|
|
23
|
+
require_relative 'bundleup/unify/helpdesk'
|
|
23
24
|
require_relative 'bundleup/unify/crm'
|
|
24
25
|
require_relative 'bundleup/unify/drive'
|
|
25
26
|
require_relative 'bundleup/unify/calendar'
|
|
@@ -27,4 +28,9 @@ require_relative 'bundleup/unify/me'
|
|
|
27
28
|
|
|
28
29
|
# Main module for the BundleUp SDK.
|
|
29
30
|
module BundleUp
|
|
31
|
+
# Builds the hosted authorization URL without an API key.
|
|
32
|
+
# See BundleUp::Auth.build_authorization_url.
|
|
33
|
+
def self.build_authorization_url(**params)
|
|
34
|
+
Auth.build_authorization_url(**params)
|
|
35
|
+
end
|
|
30
36
|
end
|
data/sig/bundleup/auth.rbs
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
module BundleUp
|
|
2
|
+
def self.build_authorization_url: (
|
|
3
|
+
client_id: String,
|
|
4
|
+
integration_id: String,
|
|
5
|
+
redirect_uri: String,
|
|
6
|
+
?external_id: String?,
|
|
7
|
+
?state: String?
|
|
8
|
+
) -> String
|
|
9
|
+
|
|
2
10
|
class Auth
|
|
3
11
|
BASE_URL: String
|
|
4
12
|
|
|
@@ -12,6 +20,16 @@ module BundleUp
|
|
|
12
20
|
|
|
13
21
|
def initialize: (String api_key) -> void
|
|
14
22
|
|
|
23
|
+
def self.blank?: (untyped value) -> bool
|
|
24
|
+
|
|
25
|
+
def self.build_authorization_url: (
|
|
26
|
+
client_id: String,
|
|
27
|
+
integration_id: String,
|
|
28
|
+
redirect_uri: String,
|
|
29
|
+
?external_id: String?,
|
|
30
|
+
?state: String?
|
|
31
|
+
) -> String
|
|
32
|
+
|
|
15
33
|
def build_authorization_url: (
|
|
16
34
|
client_id: String,
|
|
17
35
|
integration_id: String,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module BundleUp
|
|
2
|
+
module Unify
|
|
3
|
+
class Helpdesk < Base
|
|
4
|
+
type requester = {
|
|
5
|
+
id: String?,
|
|
6
|
+
name: String?,
|
|
7
|
+
email: String?
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type ticket = {
|
|
11
|
+
id: String,
|
|
12
|
+
title: String?,
|
|
13
|
+
description: String?,
|
|
14
|
+
status: String?,
|
|
15
|
+
priority: String?,
|
|
16
|
+
requester: requester?,
|
|
17
|
+
url: String?,
|
|
18
|
+
created_at: String?,
|
|
19
|
+
updated_at: String?
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type metadata = { next: String? }
|
|
23
|
+
|
|
24
|
+
def tickets: (?Hash[Symbol, untyped] params) -> { data: Array[ticket], metadata: metadata }
|
|
25
|
+
|
|
26
|
+
def ticket: (String ticket_id, ?Hash[Symbol, untyped] params) -> { data: ticket }
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def blank?: (untyped) -> bool
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module BundleUp
|
|
2
2
|
module Unify
|
|
3
|
-
class
|
|
4
|
-
type
|
|
3
|
+
class Tasks < Base
|
|
4
|
+
type task_item = {
|
|
5
5
|
id: String,
|
|
6
6
|
title: String,
|
|
7
7
|
status: String,
|
|
@@ -11,7 +11,7 @@ module BundleUp
|
|
|
11
11
|
updated_at: String
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
type
|
|
14
|
+
type task = {
|
|
15
15
|
id: String,
|
|
16
16
|
title: String,
|
|
17
17
|
status: String?,
|
|
@@ -21,7 +21,7 @@ module BundleUp
|
|
|
21
21
|
updated_at: String?
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
type
|
|
24
|
+
type project = {
|
|
25
25
|
id: String,
|
|
26
26
|
name: String,
|
|
27
27
|
status: String?,
|
|
@@ -33,11 +33,11 @@ module BundleUp
|
|
|
33
33
|
|
|
34
34
|
type metadata = { next: String? }
|
|
35
35
|
|
|
36
|
-
def
|
|
36
|
+
def tasks: (?Hash[Symbol, untyped] params) -> { data: Array[task_item], metadata: metadata }
|
|
37
37
|
|
|
38
|
-
def
|
|
38
|
+
def task: (String task_id, ?Hash[Symbol, untyped] params) -> { data: task }
|
|
39
39
|
|
|
40
|
-
def projects: (?Hash[Symbol, untyped] params) -> { data: Array[
|
|
40
|
+
def projects: (?Hash[Symbol, untyped] params) -> { data: Array[project], metadata: metadata }
|
|
41
41
|
|
|
42
42
|
private
|
|
43
43
|
|
data/sig/bundleup/unify.rbs
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bundleup-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- BundleUp
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -182,8 +182,9 @@ files:
|
|
|
182
182
|
- lib/bundleup/unify/crm.rb
|
|
183
183
|
- lib/bundleup/unify/drive.rb
|
|
184
184
|
- lib/bundleup/unify/git.rb
|
|
185
|
+
- lib/bundleup/unify/helpdesk.rb
|
|
185
186
|
- lib/bundleup/unify/me.rb
|
|
186
|
-
- lib/bundleup/unify/
|
|
187
|
+
- lib/bundleup/unify/tasks.rb
|
|
187
188
|
- lib/bundleup/version.rb
|
|
188
189
|
- sig/bundleup/auth.rbs
|
|
189
190
|
- sig/bundleup/unify.rbs
|
|
@@ -193,8 +194,9 @@ files:
|
|
|
193
194
|
- sig/bundleup/unify/crm.rbs
|
|
194
195
|
- sig/bundleup/unify/drive.rbs
|
|
195
196
|
- sig/bundleup/unify/git.rbs
|
|
197
|
+
- sig/bundleup/unify/helpdesk.rbs
|
|
196
198
|
- sig/bundleup/unify/me.rbs
|
|
197
|
-
- sig/bundleup/unify/
|
|
199
|
+
- sig/bundleup/unify/tasks.rbs
|
|
198
200
|
homepage: https://github.com/bundleup/bundleup-sdk-ruby
|
|
199
201
|
licenses:
|
|
200
202
|
- MIT
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module BundleUp
|
|
4
|
-
module Unify
|
|
5
|
-
# Client for ticketing Unify endpoints.
|
|
6
|
-
class Ticketing < Base
|
|
7
|
-
# Fetches tickets from the connected ticketing tool.
|
|
8
|
-
def tickets(params = {})
|
|
9
|
-
response = connection.get('ticketing/tickets') do |req|
|
|
10
|
-
req.params = params
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
raise "Failed to fetch ticketing/tickets: #{response.status}" unless response.success?
|
|
14
|
-
|
|
15
|
-
response.body
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# Fetches a single ticket by ID from the connected ticketing tool.
|
|
19
|
-
#
|
|
20
|
-
# Not supported by Basecamp, whose API only serves a to-do underneath its
|
|
21
|
-
# project — an id on its own cannot address one.
|
|
22
|
-
def ticket(ticket_id, params = {})
|
|
23
|
-
raise ArgumentError, 'ticket_id is required to fetch a ticket.' if blank?(ticket_id)
|
|
24
|
-
|
|
25
|
-
encoded_id = URI.encode_www_form_component(ticket_id)
|
|
26
|
-
|
|
27
|
-
response = connection.get("ticketing/tickets/#{encoded_id}") do |req|
|
|
28
|
-
req.params = params
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
raise "Failed to fetch ticketing/tickets/#{encoded_id}: #{response.status}" unless response.success?
|
|
32
|
-
|
|
33
|
-
response.body
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# Fetches projects from the connected ticketing tool.
|
|
37
|
-
def projects(params = {})
|
|
38
|
-
response = connection.get('ticketing/projects') do |req|
|
|
39
|
-
req.params = params
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
raise "Failed to fetch ticketing/projects: #{response.status}" unless response.success?
|
|
43
|
-
|
|
44
|
-
response.body
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
def blank?(value)
|
|
50
|
-
value.nil? || value.to_s.empty?
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|