embed_workflow 0.0.1 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50470d806c76f8fec49b69641c744584af88283540280c638f66852466765672
4
- data.tar.gz: 9851ef47251788644528ab4c61f8f499b8e0e2a107ac2a80a87f0a6ca7e517c9
3
+ metadata.gz: 717e1c85b3770bacf587eb370eddbe69ffaac074a5182bdf94dae5e56348a649
4
+ data.tar.gz: 764e7e19115acdadc26ef4f920ab739b9093ca5c0aa920aeb6fffa428ea21ec9
5
5
  SHA512:
6
- metadata.gz: fb89462e3bf6ccd86625e79350aed45111e2bed6715b21acc8d26380ce4277a5e18be3c6320db043bb5b0cce20225183f318ecd21598fada159cb33a4b11b366
7
- data.tar.gz: 32533f7fb689caf90ad62a4c8ccaae900a47d25c20407923f144d83595b17766e7ead4b24559e9447732a8504ea970d14cd368e5b375a2fac5a154c762d26490
6
+ metadata.gz: 697d945cf5497ea65dc33ddf092915ec6daa463ed286ae2642851db9c8dbd5e1fd49056249090acd5ada8571b0c9bfdd0e005316fa607eec388ce51ee4d373d5
7
+ data.tar.gz: 03356e11fa28e2e56506370eb4de98d3884c45aad1dda98678877968754d5de722951de62cff70de678619b812b8cb283f22ac5dfdefd31ed99b31c44352139b
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "net/http"
4
+ require "uri"
5
+
6
+ module EmbedWorkflow
7
+ module AppConnections
8
+ class << self
9
+ include Base
10
+ include Client
11
+
12
+ RESOURCE_BASE_PATH = "#{BASE_API_PATH}/app_connections".freeze
13
+
14
+ def list(user_key: nil, starting_after: nil, ending_before: nil, limit: nil)
15
+ params = {
16
+ user_key: user_key,
17
+ starting_after: starting_after,
18
+ ending_before: ending_before,
19
+ limit: limit
20
+ }.compact
21
+
22
+ get_request(
23
+ path: RESOURCE_BASE_PATH,
24
+ params: params
25
+ )
26
+ end
27
+
28
+ def fetch(id:, user_key: nil)
29
+ params = { user_key: user_key }.compact
30
+
31
+ get_request(
32
+ path: "#{RESOURCE_BASE_PATH}/#{id}",
33
+ params: params
34
+ )
35
+ end
36
+
37
+ def create(name:, app_type:, config:, user_key: nil)
38
+ attrs = {
39
+ name: name,
40
+ app_type: app_type,
41
+ config: config,
42
+ user_key: user_key
43
+ }.compact
44
+
45
+ post_request(
46
+ path: RESOURCE_BASE_PATH,
47
+ body: attrs
48
+ )
49
+ end
50
+
51
+ def update(id:, name: nil, app_type: nil, config: nil, user_key: nil)
52
+ attrs = {
53
+ name: name,
54
+ app_type: app_type,
55
+ config: config,
56
+ user_key: user_key
57
+ }.compact
58
+
59
+ put_request(
60
+ path: "#{RESOURCE_BASE_PATH}/#{id}",
61
+ body: attrs
62
+ )
63
+ end
64
+
65
+ def delete(id:, user_key: nil)
66
+ params = { user_key: user_key }.compact
67
+
68
+ delete_request(
69
+ path: "#{RESOURCE_BASE_PATH}/#{id}",
70
+ params: params
71
+ )
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "net/http"
4
+ require "uri"
5
+
6
+ module EmbedWorkflow
7
+ module CatchHook
8
+ class << self
9
+ include Base
10
+ include Client
11
+
12
+ RESOURCE_BASE_PATH = "#{BASE_API_PATH}/hooks".freeze
13
+
14
+ def create(hook_id:, user_key:, **rest)
15
+ attrs = { user_key: user_key }.merge(rest).compact
16
+
17
+ post_request(
18
+ path: "#{RESOURCE_BASE_PATH}/#{hook_id}/catch",
19
+ body: attrs
20
+ )
21
+ end
22
+ end
23
+ end
24
+ end
@@ -28,6 +28,23 @@ module EmbedWorkflow
28
28
  def fetch(key:)
29
29
  get_request(path: "#{RESOURCE_BASE_PATH}/#{key}")
30
30
  end
31
+
32
+ def list(starting_after: nil, ending_before: nil, limit: nil)
33
+ params = {
34
+ starting_after: starting_after,
35
+ ending_before: ending_before,
36
+ limit: limit
37
+ }.compact
38
+
39
+ get_request(
40
+ path: RESOURCE_BASE_PATH,
41
+ params: params
42
+ )
43
+ end
44
+
45
+ def delete(key:)
46
+ delete_request(path: "#{RESOURCE_BASE_PATH}/#{key}")
47
+ end
31
48
  end
32
49
  end
33
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EmbedWorkflow
4
- VERSION = "0.0.1"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -11,13 +11,13 @@ module EmbedWorkflow
11
11
 
12
12
  RESOURCE_BASE_PATH = "#{BASE_API_PATH}/workflows"
13
13
 
14
- def create(name:, template: nil, context: nil, auto_start: nil, tenant_key: nil)
14
+ def create(name:, template: nil, user_key: nil, event_trigger: nil, trigger_conditions: nil)
15
15
  attrs = {
16
16
  name: name,
17
17
  template: template,
18
- auto_start: auto_start,
19
- tenant_key: tenant_key,
20
- context: context
18
+ event_trigger: event_trigger,
19
+ trigger_conditions: trigger_conditions,
20
+ user_key: user_key
21
21
  }
22
22
 
23
23
  post_request(
@@ -32,12 +32,11 @@ module EmbedWorkflow
32
32
  )
33
33
  end
34
34
 
35
- def update(hashid:, name: nil, template: nil, tenant_key: nil, context: nil, auto_start: nil)
35
+ def update(hashid:, name: nil, template: nil, user_key: nil)
36
36
  attrs = {
37
37
  name: name,
38
38
  template: template,
39
- tenant_key: tenant_key,
40
- context: context
39
+ user_key: user_key
41
40
  }.compact
42
41
 
43
42
  put_request(
@@ -46,10 +45,17 @@ module EmbedWorkflow
46
45
  )
47
46
  end
48
47
 
49
- def list(user_key: nil, starting_after: nil, ending_before: nil)
48
+ def list(user_key: nil, starting_after: nil, ending_before: nil, limit: nil)
49
+ params = {
50
+ user_key: user_key,
51
+ starting_after: starting_after,
52
+ ending_before: ending_before,
53
+ limit: limit
54
+ }.compact
55
+
50
56
  get_request(
51
57
  path: RESOURCE_BASE_PATH,
52
- params: { user_key: user_key, starting_after: starting_after, ending_before: ending_before }.compact
58
+ params: params
53
59
  )
54
60
  end
55
61
 
@@ -20,8 +20,10 @@ module EmbedWorkflow
20
20
  autoload :Client, "embed_workflow/client"
21
21
 
22
22
  autoload :Actions, "embed_workflow/actions"
23
+ autoload :AppConnections, "embed_workflow/app_connections"
23
24
  autoload :Executions, "embed_workflow/executions"
24
25
  autoload :Trigger, "embed_workflow/trigger"
26
+ autoload :CatchHook, "embed_workflow/catch_hook"
25
27
  autoload :Users, "embed_workflow/users"
26
28
  autoload :Workflows, "embed_workflow/workflows"
27
29
 
@@ -32,4 +34,8 @@ module EmbedWorkflow
32
34
  def self.trigger(**args)
33
35
  Trigger.create(**args)
34
36
  end
37
+
38
+ def self.catch_hook(**args)
39
+ CatchHook.create(**args)
40
+ end
35
41
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embed_workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Embed Workflow
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-04 00:00:00.000000000 Z
10
+ date: 2025-03-07 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -61,7 +60,9 @@ extra_rdoc_files: []
61
60
  files:
62
61
  - lib/embed_workflow.rb
63
62
  - lib/embed_workflow/actions.rb
63
+ - lib/embed_workflow/app_connections.rb
64
64
  - lib/embed_workflow/base.rb
65
+ - lib/embed_workflow/catch_hook.rb
65
66
  - lib/embed_workflow/client.rb
66
67
  - lib/embed_workflow/errors.rb
67
68
  - lib/embed_workflow/executions.rb
@@ -73,8 +74,7 @@ homepage: https://github.com/embedworkflow/embed-workflow-ruby
73
74
  licenses:
74
75
  - MIT
75
76
  metadata:
76
- documentation_uri: https://api-docs.embedworkflow.com
77
- post_install_message:
77
+ documentation_uri: https://docs.embedworkflow.com
78
78
  rdoc_options: []
79
79
  require_paths:
80
80
  - lib
@@ -89,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.1.4
93
- signing_key:
92
+ rubygems_version: 3.6.2
94
93
  specification_version: 4
95
94
  summary: API client for Embed Workflow
96
95
  test_files: []