use_paragon 0.1.0 → 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 +4 -4
- data/README.md +23 -11
- data/changelog.md +32 -0
- data/lib/use_paragon/version.rb +1 -1
- data/lib/use_paragon/workflow.rb +9 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff30dcf20714965b441a2ff110f76b27a522a431ae60596e8681461eec8ca4ff
|
4
|
+
data.tar.gz: 0a1461e9fb7cbb95928fac27bbdfc6f050b5dc407c9db6dcb8fc5711e40659fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b65e72fb8ff956ae65c05d8e194a0bd3b32896dabaf0c61be4a961de10cd186d9e5afed131742d2ad47acf70043ceda24f69e1b003727d089b3514fb48a00315
|
7
|
+
data.tar.gz: dbe58987afc08fce64792bfb503e0962501ccb40a31437e9ece7a2d382df46bfbcd7e1e0e61aa55d8714efe3d1a88f155fe67986c4a1531816c2f978423baf32
|
data/README.md
CHANGED
@@ -48,43 +48,55 @@ UseParagon.configure do |config|
|
|
48
48
|
config.private_key = YOUR_PRIVATE_KEY
|
49
49
|
config.project_id = YOUR_PROJECT_ID
|
50
50
|
# Additional configurations available and defaults.
|
51
|
-
# config.base_url = "https://zeus.useparagon.com"
|
51
|
+
# config.base_url = "https://zeus.useparagon.com" # Change this for on-prem installations
|
52
52
|
# config.logger = Logger.new(STDOUT)
|
53
53
|
# config.logger_enabled = true
|
54
54
|
end
|
55
55
|
```
|
56
56
|
|
57
|
+
### On-Premise Installations
|
58
|
+
|
59
|
+
For on-premise Paragon installations, you can configure a custom base URL:
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
UseParagon.configure do |config|
|
63
|
+
config.private_key = YOUR_PRIVATE_KEY
|
64
|
+
config.project_id = YOUR_PROJECT_ID
|
65
|
+
config.base_url = "https://paragon.yourcompany.com" # Your on-prem Paragon instance
|
66
|
+
end
|
67
|
+
```
|
68
|
+
|
57
69
|
## How to use
|
58
70
|
### Disable Workflow
|
59
|
-
|
71
|
+
[Paragon Documentation](https://docs.useparagon.com/api/api-reference#disableworkflow-workflowid-string-greater-than-promise)
|
60
72
|
|
61
73
|
Call disable Workflow to turn off a workflow for a user by ID.
|
62
74
|
|
63
75
|
UseParagon::Workflow.new(user_id).disable("workflow_id")
|
64
76
|
|
65
77
|
### Get Integrations Metadata
|
66
|
-
|
78
|
+
[Paragon Documentation](https://docs.useparagon.com/api/api-reference#getintegrationmetadata)
|
67
79
|
|
68
80
|
Get the name, brandColor, and icon, for any of your active integration providers.
|
69
81
|
|
70
82
|
UseParagon::Integration.new(user_id).metadata
|
71
83
|
|
72
84
|
### Get User
|
73
|
-
|
85
|
+
[Paragon Documentation](https://docs.useparagon.com/api/api-reference#getuser-paragonuser)
|
74
86
|
|
75
87
|
Retrieve the currently authenticated user and their connected integration state.
|
76
88
|
|
77
89
|
UseParagon::User.new(user_id).get
|
78
90
|
|
79
91
|
### Workflow Event (App Events)
|
80
|
-
|
92
|
+
[Paragon Documentation](https://docs.useparagon.com/api/api-reference#event-name-string-json-json)
|
81
93
|
|
82
94
|
App Events can be sent from your application using the Paragon REST API.
|
83
95
|
|
84
96
|
UseParagon::Workflow.new(user_id).event(event_name, payload = {})
|
85
97
|
|
86
98
|
### Proxy Request
|
87
|
-
|
99
|
+
[Paragon Documentation](https://docs.useparagon.com/api/api-reference#request-integrationtype-string-path-string-requestoptions-requestinit-promise-less-than-unknown-gre)
|
88
100
|
|
89
101
|
Call proxy_request to send an API request to a third-party integration on behalf of one of your users
|
90
102
|
|
@@ -94,35 +106,35 @@ post, get, put, patch or delete.
|
|
94
106
|
UseParagon::Integration.new(user_id).proxy_request(request_method, integration_type, integration_path, payload = {})
|
95
107
|
|
96
108
|
### Set User Metadata
|
97
|
-
|
109
|
+
[Paragon Documentation](https://docs.useparagon.com/api/api-reference#setusermetadata-meta-object)
|
98
110
|
|
99
111
|
Associate the authenticated user with metadata from your application. This metadata can be accessed with "Get User"
|
100
112
|
|
101
113
|
UseParagon::User.new(user_id).metadata=({email: "example@example.com"})
|
102
114
|
|
103
115
|
### Uninstall Integration
|
104
|
-
|
116
|
+
[Paragon Documentation](https://docs.useparagon.com/api/api-reference#workflow)
|
105
117
|
|
106
118
|
Disconnect an integration for the authenticated user
|
107
119
|
|
108
120
|
UseParagon::Integration.new(user_id).uninstall(integration_id)
|
109
121
|
|
110
122
|
### Workflow Request (Trigger)
|
111
|
-
|
123
|
+
[Paragon Documentation](https://docs.useparagon.com/api/api-reference#workflow-1)
|
112
124
|
|
113
125
|
Trigger a Paragon workflow that sends a custom response back to your app. Note: The workflow must be enabled and use a Request-type trigger.
|
114
126
|
|
115
127
|
UseParagon::Workflow.new(user_id).request(workflow_id, payload = {})
|
116
128
|
|
117
129
|
### Get Project's Integrations
|
118
|
-
|
130
|
+
[Paragon Documentation](https://docs.useparagon.com/api/api-reference#get-projects-integrations)
|
119
131
|
|
120
132
|
Returns a list of the integrations enabled for the Paragon project by the ID in the URL.
|
121
133
|
|
122
134
|
UseParagon::Integration.new(user_id).list
|
123
135
|
|
124
136
|
### Get User's Connect Credentials
|
125
|
-
|
137
|
+
[Paragon Documentation](https://docs.useparagon.com/api/api-reference#get-users-connect-credentials)
|
126
138
|
|
127
139
|
Returns a list of the user's Connect credentials (i.e., the accounts connected and authorized by the end user).
|
128
140
|
|
data/changelog.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [0.2.0] - 2024-10-21
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Added an optional `header` kwarg to Workflow#request method
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
-
|
17
|
+
|
18
|
+
### Deprecated
|
19
|
+
|
20
|
+
-
|
21
|
+
|
22
|
+
### Removed
|
23
|
+
|
24
|
+
-
|
25
|
+
|
26
|
+
### Fixed
|
27
|
+
|
28
|
+
-
|
29
|
+
|
30
|
+
### Security
|
31
|
+
|
32
|
+
-
|
data/lib/use_paragon/version.rb
CHANGED
data/lib/use_paragon/workflow.rb
CHANGED
@@ -5,11 +5,14 @@ require "use_paragon/base"
|
|
5
5
|
module UseParagon
|
6
6
|
# API calls for workflows
|
7
7
|
class Workflow < Base
|
8
|
-
def request(workflow_id, payload
|
8
|
+
def request(workflow_id, payload, headers: {})
|
9
|
+
# connection.headers = connection.headers.merge(headers)
|
10
|
+
self.headers = headers
|
9
11
|
connection.post(path("sdk/triggers/#{workflow_id}"), payload)
|
10
12
|
end
|
11
13
|
|
12
|
-
def event(event_name, payload = {})
|
14
|
+
def event(event_name, payload = {}, headers: {})
|
15
|
+
self.headers = headers
|
13
16
|
connection.post(path("sdk/events/trigger"), event_payload(event_name, payload))
|
14
17
|
end
|
15
18
|
|
@@ -25,5 +28,9 @@ module UseParagon
|
|
25
28
|
payload: payload
|
26
29
|
}
|
27
30
|
end
|
31
|
+
|
32
|
+
def headers=(headers)
|
33
|
+
connection.headers = connection.headers.merge(headers)
|
34
|
+
end
|
28
35
|
end
|
29
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: use_paragon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Candanedo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- Rakefile
|
60
60
|
- bin/console
|
61
61
|
- bin/setup
|
62
|
+
- changelog.md
|
62
63
|
- lib/use_paragon.rb
|
63
64
|
- lib/use_paragon/base.rb
|
64
65
|
- lib/use_paragon/configuration.rb
|