use_paragon 0.1.0 → 0.2.1

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: 4977ae9bf55dabf8686da9a46c7cf7bcf9fd7f162721a08b49899a9df3b08807
4
- data.tar.gz: 790d1f453420f72bc196bbe29d4323cc04d559a0175fff436520deadf3580435
3
+ metadata.gz: 4eea99462114a73de8cdbaab838804f101429b1501c47e6f5f539f58ef0c6e4d
4
+ data.tar.gz: 6985b1ed30f785a7636e90df9cfa97cdb2a100742052b3f302b6ff4b3141bc7e
5
5
  SHA512:
6
- metadata.gz: 560649657f7ecb06819b324347183695301d733f420e257fd5beb197f10f99d997be3184b61c9122a9a0c0bb935e88d0a0d700e51c6a05a10e7b481d06af182f
7
- data.tar.gz: 57ea9e04630f118197f49c5f9a8ec3c362f6867d994da518d117db7833cb7b7c27e887b5440d3c077746b9cc6aaf9b3278d69bc207d962fadd3fb5af686ef22c
6
+ metadata.gz: 19441c40b4bed8fbd22d8dc001f623ff42009720dca8105066e434ebe14ee5ed23424616d440cc3ce65a1ff9fe062362297c79d5cdbce43b289b9964a0724ac8
7
+ data.tar.gz: 1a6ac16ae3785ea272efbeebd4b29448a2d7df4fcc5b8a2dcf4a57d316cd4fe5329293e9571e93dded724188a1d08416b2597e426a3a26d25be65545aa30bd86
data/README.md CHANGED
@@ -48,43 +48,59 @@ 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
- (Paragon Documentation)[https://docs.useparagon.com/api/api-reference#disableworkflow-workflowid-string-greater-than-promise]
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
- (Paragon Documentation)[https://docs.useparagon.com/api/api-reference#getintegrationmetadata]
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
- (Paragon Documentation)[https://docs.useparagon.com/api/api-reference#getuser-paragonuser]
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
- (Paragon Documentation)[https://docs.useparagon.com/api/api-reference#event-name-string-json-json]
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
 
98
+ You can also pass custom headers:
99
+
100
+ UseParagon::Workflow.new(user_id).event(event_name, payload = {}, headers: { "X-Custom-Header" => "value" })
101
+
86
102
  ### Proxy Request
87
- (Paragon Documentation)[https://docs.useparagon.com/api/api-reference#request-integrationtype-string-path-string-requestoptions-requestinit-promise-less-than-unknown-gre]
103
+ [Paragon Documentation](https://docs.useparagon.com/api/api-reference#request-integrationtype-string-path-string-requestoptions-requestinit-promise-less-than-unknown-gre)
88
104
 
89
105
  Call proxy_request to send an API request to a third-party integration on behalf of one of your users
90
106
 
@@ -94,35 +110,39 @@ post, get, put, patch or delete.
94
110
  UseParagon::Integration.new(user_id).proxy_request(request_method, integration_type, integration_path, payload = {})
95
111
 
96
112
  ### Set User Metadata
97
- (Paragon Documentation)[https://docs.useparagon.com/api/api-reference#setusermetadata-meta-object]
113
+ [Paragon Documentation](https://docs.useparagon.com/api/api-reference#setusermetadata-meta-object)
98
114
 
99
115
  Associate the authenticated user with metadata from your application. This metadata can be accessed with "Get User"
100
116
 
101
117
  UseParagon::User.new(user_id).metadata=({email: "example@example.com"})
102
118
 
103
119
  ### Uninstall Integration
104
- (Paragon Documentation)[https://docs.useparagon.com/api/api-reference#workflow]
120
+ [Paragon Documentation](https://docs.useparagon.com/api/api-reference#workflow)
105
121
 
106
122
  Disconnect an integration for the authenticated user
107
123
 
108
124
  UseParagon::Integration.new(user_id).uninstall(integration_id)
109
125
 
110
126
  ### Workflow Request (Trigger)
111
- (Paragon Documentation)[https://docs.useparagon.com/api/api-reference#workflow-1]
127
+ [Paragon Documentation](https://docs.useparagon.com/api/api-reference#workflow-1)
112
128
 
113
129
  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
130
 
115
131
  UseParagon::Workflow.new(user_id).request(workflow_id, payload = {})
116
132
 
133
+ You can also pass custom headers:
134
+
135
+ UseParagon::Workflow.new(user_id).request(workflow_id, payload = {}, headers: { "X-Custom-Header" => "value" })
136
+
117
137
  ### Get Project's Integrations
118
- (Paragon Documentation)[https://docs.useparagon.com/api/api-reference#get-projects-integrations]
138
+ [Paragon Documentation](https://docs.useparagon.com/api/api-reference#get-projects-integrations)
119
139
 
120
140
  Returns a list of the integrations enabled for the Paragon project by the ID in the URL.
121
141
 
122
142
  UseParagon::Integration.new(user_id).list
123
143
 
124
144
  ### Get User's Connect Credentials
125
- (Paragon Documentation)[https://docs.useparagon.com/api/api-reference#get-users-connect-credentials]
145
+ [Paragon Documentation](https://docs.useparagon.com/api/api-reference#get-users-connect-credentials)
126
146
 
127
147
  Returns a list of the user's Connect credentials (i.e., the accounts connected and authorized by the end user).
128
148
 
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] - 2025-07-15
9
+
10
+ ### Added
11
+
12
+ - Added an optional `headers` kwarg to `Workflow#request` and `Workflow#event` methods
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
+ -
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UseParagon
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -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.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Candanedo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-13 00:00:00.000000000 Z
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