docusign_monitor 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,14 @@
1
+ =begin
2
+ #DocuSign Monitor API - v2
3
+
4
+ #An API for an integrator to access the features of DocuSign Monitor
5
+
6
+ OpenAPI spec version: v2.0
7
+ Contact: devcenter@docusign.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ module DocuSign_Monitor
13
+ VERSION = '1.0.0.beta1'
14
+ end
data/tests/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rspec'
4
+
5
+ gem 'docusign_monitor', path: '../'
@@ -0,0 +1,46 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ docusign_monitor (1.0.0.beta1)
5
+ addressable (~> 2.7, >= 2.7.0)
6
+ json (~> 2.1, >= 2.1.0)
7
+ jwt (~> 2.2, >= 2.2.1)
8
+ typhoeus (~> 1.0, >= 1.0.1)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ addressable (2.7.0)
14
+ public_suffix (>= 2.0.2, < 5.0)
15
+ diff-lcs (1.4.4)
16
+ ethon (0.12.0)
17
+ ffi (>= 1.3.0)
18
+ ffi (1.13.1)
19
+ json (2.3.1)
20
+ jwt (2.2.2)
21
+ public_suffix (4.0.6)
22
+ rspec (3.9.0)
23
+ rspec-core (~> 3.9.0)
24
+ rspec-expectations (~> 3.9.0)
25
+ rspec-mocks (~> 3.9.0)
26
+ rspec-core (3.9.3)
27
+ rspec-support (~> 3.9.3)
28
+ rspec-expectations (3.9.3)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.9.0)
31
+ rspec-mocks (3.9.1)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.9.0)
34
+ rspec-support (3.9.4)
35
+ typhoeus (1.4.0)
36
+ ethon (>= 0.9.0)
37
+
38
+ PLATFORMS
39
+ ruby
40
+
41
+ D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gYEAttAK
16
+ 2ZKPozlWTP6GO1v3ekm+QwUftvJ43XyZ59Pzhegjm2hkIEbUuIPCVfuQIVCvfPIB
17
+ yAoTC+9i4rAPmCvYXoGYAx8l5YuwfiUh8ajTavzgrCk9u9/xOH2ypIxRnHzpe99t
18
+ V+kLEEuW+uLcN9+D10bP04qTHo+DIGh9Muj23lsCgYAkXqy2/VnRtju0vr1tT91D
19
+ 7x1PAkR8cPnXDAB57NhaLfvb5DnPEm1chkgDKgvZBNe7E48gNFmAFg91V+CKnMnP
20
+ 2K5WLLXjMpSCgy3XLLzC9OD6q1AjnrzqotVm16AQKDOzOoFTFemiNi7sgebSgNoO
21
+ ZFLV+dbbfUWh0Pntp3UHKQKBgF1/9DypUBusZK5Gc4MCm4WJF+2RPlJEm3q0ksbW
22
+ SbQQMb33W1aCw6OHiCqP2nyfltGxuSWFuY4eJpZIdAFhU22qnIPkN266zk8GUOEX
23
+ duI+ae7DvRZNCEPbTjYIqmj+HjDD6lnPEGCKOLMiun09LWI6jmrkcjBsOCWoK3iR
24
+ XEoHAoGAOSXO1kM6p0MZEhKxrVunF6HpW8aHRjcdcjjJJRFgap3hxCT1OZ9YB+SD
25
+ Prn+cjFJ7WSMrHpIRt56FZGUUgmp+97WqYsIuAJx56ETKdAVx6C7RuEtbJoqdTER
26
+ hS4vaGq+EWmjVc/pSMbBzZ99lpIEbyYBk2jD3GpCWgSd9CDrxGY=
27
+ -----END RSA PRIVATE KEY-----
@@ -0,0 +1,125 @@
1
+ require 'docusign_monitor'
2
+ require 'base64'
3
+ require 'uri'
4
+ require 'addressable/uri'
5
+
6
+ describe 'DocuSign Ruby Client Tests' do
7
+ def login
8
+ begin
9
+ if $api_client.nil?
10
+ configuration = DocuSign_Monitor::Configuration.new
11
+ configuration.host = $host
12
+
13
+ $api_client = DocuSign_Monitor::ApiClient.new(configuration)
14
+ $api_client.set_oauth_base_path(DocuSign_Monitor::OAuth::DEMO_OAUTH_BASE_PATH)
15
+
16
+ # $api_client.get_authorization_uri($integrator_key,'signature',$return_url,'code')
17
+ # $api_client.request_jwt_application_token($integrator_key,File.read($private_key_filename),$expires_in_seconds,'' )
18
+ # code = 'code_here'
19
+ # $api_client.generate_access_token($integrator_key,$secret,code)
20
+ end
21
+
22
+ decode_base64_content = Base64.decode64(ENV["PRIVATE_KEY"])
23
+ File.open($private_key_filename, "wb") do |f|
24
+ f.write(decode_base64_content)
25
+ end
26
+ token_obj = $api_client.request_jwt_user_token(ENV["INTEGRATOR_KEY_JWT"],ENV["USER_ID"], File.read($private_key_filename),$expires_in_seconds,$scopes)
27
+ user_info = $api_client.get_user_info(token_obj.access_token)
28
+
29
+ if !user_info.nil?
30
+ user_info.accounts.each do |account|
31
+ if account.is_default == "true"
32
+ $base_uri = account.base_uri
33
+ $account_id = account.account_id
34
+
35
+ # IMPORTANT: Use the base url from the login account to instantiant the api_client
36
+ base_uri = Addressable::URI.parse($base_uri)
37
+ # $api_client.set_base_path( "%s://%s/restapi" % [base_uri.scheme, base_uri.host])
38
+
39
+ return account
40
+ end
41
+ end
42
+ end
43
+ rescue => e
44
+ puts "Error during processing: #{$!}"
45
+ # puts "Backtrace:\n\t#{e.backtrace.join("\n\t")}"
46
+ end
47
+
48
+ return nil
49
+ end
50
+
51
+ def create_api_client
52
+ if $api_client.nil?
53
+ self.login()
54
+ end
55
+
56
+ return $api_client
57
+ end
58
+
59
+ before(:all) do
60
+ # run before each test
61
+ $host = "https://lens-d.docusign.net"
62
+
63
+ $expires_in_seconds = 3600 #1 hour
64
+ $auth_server = 'account-d.docusign.com'
65
+ $private_key_filename = '../docs/private.pem'
66
+
67
+ $recipient_name = "Ruby SDK"
68
+
69
+ # Required for embedded signing url
70
+ $client_user_id = '1234'
71
+ $return_url = 'https://developers.docusign.com/'
72
+ $authentication_method = 'email'
73
+
74
+ $template_id = ''
75
+ $envelope_id = nil
76
+
77
+ $base_uri = nil
78
+ $account_id = nil
79
+ $api_client = nil
80
+
81
+ $scopes = ["signature"]
82
+ end
83
+
84
+ after do
85
+ # run after each test
86
+ end
87
+
88
+ describe DocuSign_Monitor::OAuth do
89
+ describe '.login' do
90
+ context 'given correct credentials' do
91
+ it 'return Account' do
92
+ account = login()
93
+
94
+ if !account.nil?
95
+ $base_uri = account.base_uri
96
+ $account_id = account.account_id
97
+ end
98
+
99
+ expect($account_id).to be_truthy
100
+ expect($base_uri).to be_truthy
101
+ end
102
+ end
103
+ end
104
+ end
105
+
106
+ describe DocuSign_Monitor::DataSetApi do
107
+ describe '.get' do
108
+ context 'datasets' do
109
+ it 'successfully returns monitor' do
110
+ api_client = create_api_client()
111
+ dataset_api = DocuSign_Monitor::DataSetApi.new(api_client)
112
+
113
+ data_set_name = 'monitor'
114
+ version = '2.0'
115
+
116
+ getStreamOptions = DocuSign_Monitor::GetStreamOptions.new
117
+
118
+ dataset_stream = dataset_api.get_stream(data_set_name, version, getStreamOptions)
119
+
120
+ expect(dataset_stream).to be_truthy
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
metadata ADDED
@@ -0,0 +1,291 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: docusign_monitor
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.beta1
5
+ platform: ruby
6
+ authors:
7
+ - DocuSign
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-05-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jwt
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.2.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '2.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 2.2.1
33
+ - !ruby/object:Gem::Dependency
34
+ name: addressable
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 2.7.0
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '2.7'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 2.7.0
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '2.7'
53
+ - !ruby/object:Gem::Dependency
54
+ name: typhoeus
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '1.0'
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 1.0.1
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '1.0'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 1.0.1
73
+ - !ruby/object:Gem::Dependency
74
+ name: json
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 2.1.0
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.1'
83
+ type: :runtime
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 2.1.0
90
+ - - "~>"
91
+ - !ruby/object:Gem::Version
92
+ version: '2.1'
93
+ - !ruby/object:Gem::Dependency
94
+ name: rspec
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: 3.6.0
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '3.6'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 3.6.0
110
+ - - "~>"
111
+ - !ruby/object:Gem::Version
112
+ version: '3.6'
113
+ - !ruby/object:Gem::Dependency
114
+ name: vcr
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: '3.0'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 3.0.1
123
+ type: :development
124
+ prerelease: false
125
+ version_requirements: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '3.0'
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 3.0.1
133
+ - !ruby/object:Gem::Dependency
134
+ name: webmock
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '1.24'
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: 1.24.3
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '1.24'
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: 1.24.3
153
+ - !ruby/object:Gem::Dependency
154
+ name: autotest
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '4.4'
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: 4.4.6
163
+ type: :development
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - "~>"
168
+ - !ruby/object:Gem::Version
169
+ version: '4.4'
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: 4.4.6
173
+ - !ruby/object:Gem::Dependency
174
+ name: autotest-rails-pure
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '4.1'
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: 4.1.2
183
+ type: :development
184
+ prerelease: false
185
+ version_requirements: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - "~>"
188
+ - !ruby/object:Gem::Version
189
+ version: '4.1'
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: 4.1.2
193
+ - !ruby/object:Gem::Dependency
194
+ name: autotest-growl
195
+ requirement: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - "~>"
198
+ - !ruby/object:Gem::Version
199
+ version: '0.2'
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: 0.2.16
203
+ type: :development
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - "~>"
208
+ - !ruby/object:Gem::Version
209
+ version: '0.2'
210
+ - - ">="
211
+ - !ruby/object:Gem::Version
212
+ version: 0.2.16
213
+ - !ruby/object:Gem::Dependency
214
+ name: autotest-fsevent
215
+ requirement: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - "~>"
218
+ - !ruby/object:Gem::Version
219
+ version: '0.2'
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: 0.2.12
223
+ type: :development
224
+ prerelease: false
225
+ version_requirements: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '0.2'
230
+ - - ">="
231
+ - !ruby/object:Gem::Version
232
+ version: 0.2.12
233
+ description: The DocuSign package makes integrating DocuSign into your apps and websites
234
+ a super fast and painless process. The library is open sourced on GitHub, look for
235
+ the docusign-monitor-ruby-client repository.
236
+ email:
237
+ - devcenter@docusign.com
238
+ executables: []
239
+ extensions: []
240
+ extra_rdoc_files: []
241
+ files:
242
+ - CHANGELOG.md
243
+ - Gemfile
244
+ - LICENSE
245
+ - README.md
246
+ - Rakefile
247
+ - docusign_monitor-1.0.0.pre.alpha.gem
248
+ - docusign_monitor-1.0.1.pre.alpha.gem
249
+ - docusign_monitor.gemspec
250
+ - git_push.sh
251
+ - lib/docusign_monitor.rb
252
+ - lib/docusign_monitor/api/data_set_api.rb
253
+ - lib/docusign_monitor/client/api_client.rb
254
+ - lib/docusign_monitor/client/api_error.rb
255
+ - lib/docusign_monitor/client/auth/oauth.rb
256
+ - lib/docusign_monitor/configuration.rb
257
+ - lib/docusign_monitor/models/aggregation.rb
258
+ - lib/docusign_monitor/models/cursored_result.rb
259
+ - lib/docusign_monitor/models/filter.rb
260
+ - lib/docusign_monitor/models/raw_request.rb
261
+ - lib/docusign_monitor/models/web_query.rb
262
+ - lib/docusign_monitor/version.rb
263
+ - tests/Gemfile
264
+ - tests/Gemfile.lock
265
+ - tests/docs/Test.pdf
266
+ - tests/docs/private.pem
267
+ - tests/spec/unit_tests_using_jwt_spec.rb
268
+ homepage: https://github.com/docusign/docusign-monitor-ruby-client
269
+ licenses:
270
+ - MIT
271
+ metadata: {}
272
+ post_install_message:
273
+ rdoc_options: []
274
+ require_paths:
275
+ - lib
276
+ required_ruby_version: !ruby/object:Gem::Requirement
277
+ requirements:
278
+ - - ">="
279
+ - !ruby/object:Gem::Version
280
+ version: '1.9'
281
+ required_rubygems_version: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ">"
284
+ - !ruby/object:Gem::Version
285
+ version: 1.3.1
286
+ requirements: []
287
+ rubygems_version: 3.0.3
288
+ signing_key:
289
+ specification_version: 4
290
+ summary: DocuSign Monitor API Ruby Gem
291
+ test_files: []