camundapi 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +11 -10
- data/lib/camunda/base_api.rb +22 -0
- data/lib/camunda/tasklist/api.rb +5 -10
- data/lib/camunda/tasklist/user_tasks.rb +8 -23
- data/lib/camunda/version.rb +1 -1
- data/lib/camunda/zeebe/process_instances.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a9a80f74a40b0a353fa872cb1b00b6fb87545097ff6338a56954210ed2100f3
|
4
|
+
data.tar.gz: c760415520a8e03d0caf266c5d26edb4b9a9d67b6341032b212ac51d51b53883
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d80dba9fe8a1336b323a00ec8ff6634243ce57622e46215cd24a390be95acc3dc832b7711139dbd6410250ca1422ef7b6cda42375314ad6786145c115618607
|
7
|
+
data.tar.gz: 34510bbe8e7de92622b38701ad3514abb5823c64b4ae0b176a8f5a4755ca7a5899fe96e9d666f22383e165a5d335140382877ac38e808a79a6e95561805c887a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
camundapi (0.
|
4
|
+
camundapi (0.3.0)
|
5
5
|
json
|
6
6
|
net-sftp
|
7
7
|
rest-client (~> 2.0)
|
@@ -14,22 +14,22 @@ GEM
|
|
14
14
|
diff-lcs (1.5.0)
|
15
15
|
domain_name (0.5.20190701)
|
16
16
|
unf (>= 0.0.5, < 1.0.0)
|
17
|
-
google-protobuf (3.
|
18
|
-
googleapis-common-protos-types (1.
|
17
|
+
google-protobuf (3.23.2-x86_64-darwin)
|
18
|
+
googleapis-common-protos-types (1.6.0)
|
19
19
|
google-protobuf (~> 3.14)
|
20
|
-
grpc (1.
|
21
|
-
google-protobuf (~> 3.
|
20
|
+
grpc (1.55.0-x86_64-darwin)
|
21
|
+
google-protobuf (~> 3.23)
|
22
22
|
googleapis-common-protos-types (~> 1.0)
|
23
23
|
http-accept (1.7.0)
|
24
24
|
http-cookie (1.0.5)
|
25
25
|
domain_name (~> 0.5)
|
26
|
-
json (2.6.
|
26
|
+
json (2.6.3)
|
27
27
|
mime-types (3.4.1)
|
28
28
|
mime-types-data (~> 3.2015)
|
29
|
-
mime-types-data (3.
|
30
|
-
net-sftp (
|
31
|
-
net-ssh (>= 5.0.0, <
|
32
|
-
net-ssh (
|
29
|
+
mime-types-data (3.2023.0218.1)
|
30
|
+
net-sftp (4.0.0)
|
31
|
+
net-ssh (>= 5.0.0, < 8.0.0)
|
32
|
+
net-ssh (7.1.0)
|
33
33
|
netrc (0.11.0)
|
34
34
|
parallel (1.22.1)
|
35
35
|
parser (3.1.2.0)
|
@@ -81,6 +81,7 @@ GEM
|
|
81
81
|
|
82
82
|
PLATFORMS
|
83
83
|
x86_64-darwin-20
|
84
|
+
x86_64-darwin-21
|
84
85
|
|
85
86
|
DEPENDENCIES
|
86
87
|
camundapi!
|
data/lib/camunda/base_api.rb
CHANGED
@@ -16,6 +16,7 @@ module Camunda
|
|
16
16
|
|
17
17
|
def self.post(endpoint, params = {})
|
18
18
|
url = build_url(endpoint)
|
19
|
+
|
19
20
|
response = RestClient.post(
|
20
21
|
url,
|
21
22
|
params.to_json,
|
@@ -25,6 +26,18 @@ module Camunda
|
|
25
26
|
JSON.parse(response.body) if response.code == 200
|
26
27
|
end
|
27
28
|
|
29
|
+
def self.patch(endpoint, params = {})
|
30
|
+
url = build_url(endpoint)
|
31
|
+
|
32
|
+
response = RestClient.patch(
|
33
|
+
url,
|
34
|
+
params.to_json,
|
35
|
+
headers
|
36
|
+
)
|
37
|
+
|
38
|
+
JSON.parse(response.body)
|
39
|
+
end
|
40
|
+
|
28
41
|
def self.build_url(endpoint, params = {})
|
29
42
|
url = "#{base_url}/#{Camunda.api_version}/#{endpoint}"
|
30
43
|
url += "?#{URI.encode_www_form(params)}" unless params.empty?
|
@@ -41,3 +54,12 @@ module Camunda
|
|
41
54
|
end
|
42
55
|
end
|
43
56
|
end
|
57
|
+
|
58
|
+
# Zeebe::Client::GatewayProtocol::ActivatedJob: key: 4503599775908706,
|
59
|
+
# type: "pre-offboarding-inform-slack-dev",
|
60
|
+
# processInstanceKey: 4503599775908700,
|
61
|
+
# bpmnProcessId: "pre-offboarding-automated-steps-dev",
|
62
|
+
# processDefinitionVersion: 2, processDefinitionKey: 2251799962638940,
|
63
|
+
# elementId: "Activity_1yisk0d", elementInstanceKey: 4503599775908705, customHeaders: "{}",
|
64
|
+
# worker: "offboarding:inform_offboarding_channel", retries: 1, deadline: 1686334733449,
|
65
|
+
# variables: "{"employee_id":2641841204932640877}">
|
data/lib/camunda/tasklist/api.rb
CHANGED
@@ -2,18 +2,13 @@
|
|
2
2
|
|
3
3
|
module Camunda
|
4
4
|
module Tasklist
|
5
|
-
class API
|
6
|
-
def self.
|
7
|
-
|
8
|
-
JSON.parse(response.body)
|
5
|
+
class API < ::Camunda::BaseAPI
|
6
|
+
def self.base_url
|
7
|
+
Camunda.tasklist_base_url
|
9
8
|
end
|
10
9
|
|
11
|
-
def self.
|
12
|
-
|
13
|
-
{
|
14
|
-
authorization: "Bearer #{oauth_token['access_token']}",
|
15
|
-
'Content-Type': 'application/json'
|
16
|
-
}
|
10
|
+
def self.oauth_token
|
11
|
+
Camunda::Tasklist::OAuthToken.create['access_token']
|
17
12
|
end
|
18
13
|
end
|
19
14
|
end
|
@@ -3,31 +3,16 @@
|
|
3
3
|
module Camunda
|
4
4
|
module Tasklist
|
5
5
|
class UserTasks < API
|
6
|
-
def self.all
|
7
|
-
|
8
|
-
tasks(query: { state: CREATED })
|
9
|
-
{
|
10
|
-
id
|
11
|
-
taskDefinitionId
|
12
|
-
name
|
13
|
-
taskState
|
14
|
-
assignee
|
15
|
-
taskState
|
16
|
-
formKey
|
17
|
-
processDefinitionId
|
18
|
-
completionTime
|
19
|
-
processName
|
20
|
-
variables {
|
21
|
-
name
|
22
|
-
value
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}"
|
26
|
-
post(query: query)['data']['tasks']
|
6
|
+
def self.all(params = {})
|
7
|
+
post('tasks/search', params)
|
27
8
|
end
|
28
9
|
|
29
|
-
def self.
|
30
|
-
|
10
|
+
def self.complete_task(task_id, variables = {})
|
11
|
+
patch("tasks/#{task_id}/complete", variables)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.variables(task_id, params = {})
|
15
|
+
post("tasks/#{task_id}/variables/search", params)
|
31
16
|
end
|
32
17
|
end
|
33
18
|
end
|
data/lib/camunda/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: camundapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lien Van Den Steen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
- !ruby/object:Gem::Version
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
|
-
rubygems_version: 3.
|
139
|
+
rubygems_version: 3.3.26
|
140
140
|
signing_key:
|
141
141
|
specification_version: 4
|
142
142
|
summary: Ruby wrapper for Camunda's API's
|