umami-ruby 0.1.2 → 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/.env.test +9 -0
- data/.simplecov +36 -0
- data/CHANGELOG.md +83 -1
- data/CLAUDE.md +45 -0
- data/README.md +397 -26
- data/Rakefile +10 -1
- data/docs/Umami/APIError.html +2 -2
- data/docs/Umami/AuthenticationError.html +2 -2
- data/docs/Umami/Client.html +11047 -1855
- data/docs/Umami/ClientError.html +2 -2
- data/docs/Umami/Configuration.html +401 -81
- data/docs/Umami/ConfigurationError.html +2 -2
- data/docs/Umami/Error.html +2 -2
- data/docs/Umami/NotFoundError.html +2 -2
- data/docs/Umami/ServerError.html +2 -2
- data/docs/Umami.html +3 -3
- data/docs/_index.html +2 -2
- data/docs/file.CHANGELOG.html +117 -3
- data/docs/file.LICENSE.html +2 -2
- data/docs/file.README.html +465 -30
- data/docs/index.html +465 -30
- data/docs/method_list.html +395 -19
- data/docs/top-level-namespace.html +2 -2
- data/lib/umami/client.rb +989 -192
- data/lib/umami/configuration.rb +62 -0
- data/lib/umami/version.rb +1 -1
- data/lib/umami-ruby.rb +1 -0
- metadata +7 -62
|
@@ -99,7 +99,57 @@
|
|
|
99
99
|
|
|
100
100
|
</div>
|
|
101
101
|
|
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
|
103
|
+
<div class="discussion">
|
|
104
|
+
<p>Configuration class for the Umami client.</p>
|
|
105
|
+
|
|
102
106
|
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="tags">
|
|
110
|
+
|
|
111
|
+
<div class="examples">
|
|
112
|
+
<p class="tag_title">Examples:</p>
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<p class="example_title"><div class='inline'><p>Configure for Umami Cloud</p>
|
|
116
|
+
</div></p>
|
|
117
|
+
|
|
118
|
+
<pre class="example code"><code><span class='const'><span class='object_link'><a href="../Umami.html" title="Umami (module)">Umami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="../Umami.html#configure-class_method" title="Umami.configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
|
|
119
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>your_api_key</span><span class='tstring_end'>"</span></span>
|
|
120
|
+
<span class='kw'>end</span></code></pre>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<p class="example_title"><div class='inline'><p>Configure for self-hosted with access token</p>
|
|
124
|
+
</div></p>
|
|
125
|
+
|
|
126
|
+
<pre class="example code"><code><span class='const'><span class='object_link'><a href="../Umami.html" title="Umami (module)">Umami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="../Umami.html#configure-class_method" title="Umami.configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
|
|
127
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_uri_base'>uri_base</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://your-umami-instance.com</span><span class='tstring_end'>"</span></span>
|
|
128
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>your_access_token</span><span class='tstring_end'>"</span></span>
|
|
129
|
+
<span class='kw'>end</span></code></pre>
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<p class="example_title"><div class='inline'><p>Configure for self-hosted with credentials</p>
|
|
133
|
+
</div></p>
|
|
134
|
+
|
|
135
|
+
<pre class="example code"><code><span class='const'><span class='object_link'><a href="../Umami.html" title="Umami (module)">Umami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="../Umami.html#configure-class_method" title="Umami.configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
|
|
136
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_uri_base'>uri_base</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://your-umami-instance.com</span><span class='tstring_end'>"</span></span>
|
|
137
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_credentials'>credentials</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>username:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>user</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>password:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pass</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
|
138
|
+
<span class='kw'>end</span></code></pre>
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
<p class="example_title"><div class='inline'><p>Configure with custom timeout</p>
|
|
142
|
+
</div></p>
|
|
143
|
+
|
|
144
|
+
<pre class="example code"><code><span class='const'><span class='object_link'><a href="../Umami.html" title="Umami (module)">Umami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="../Umami.html#configure-class_method" title="Umami.configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
|
|
145
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>your_api_key</span><span class='tstring_end'>"</span></span>
|
|
146
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_request_timeout'>request_timeout</span> <span class='op'>=</span> <span class='int'>60</span> <span class='comment'># 60 seconds instead of default 120
|
|
147
|
+
</span><span class='kw'>end</span></code></pre>
|
|
148
|
+
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
</div>
|
|
103
153
|
|
|
104
154
|
<h2>
|
|
105
155
|
Constant Summary
|
|
@@ -109,10 +159,68 @@
|
|
|
109
159
|
<dl class="constants">
|
|
110
160
|
|
|
111
161
|
<dt id="UMAMI_CLOUD_URL-constant" class="">UMAMI_CLOUD_URL =
|
|
112
|
-
|
|
162
|
+
<div class="docstring">
|
|
163
|
+
<div class="discussion">
|
|
164
|
+
<p>Base URL for Umami Cloud API (used for most API calls)</p>
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
<div class="tags">
|
|
170
|
+
|
|
171
|
+
<p class="tag_title">Returns:</p>
|
|
172
|
+
<ul class="return">
|
|
173
|
+
|
|
174
|
+
<li>
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
</li>
|
|
182
|
+
|
|
183
|
+
</ul>
|
|
184
|
+
|
|
185
|
+
</div>
|
|
113
186
|
</dt>
|
|
114
187
|
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://api.umami.is</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
115
188
|
|
|
189
|
+
<dt id="UMAMI_CLOUD_SEND_URL-constant" class="">UMAMI_CLOUD_SEND_URL =
|
|
190
|
+
<div class="docstring">
|
|
191
|
+
<div class="discussion">
|
|
192
|
+
|
|
193
|
+
<div class="note notetag">
|
|
194
|
+
<strong>Note:</strong>
|
|
195
|
+
<div class='inline'><p>The send endpoint uses a different base URL than other API calls</p>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<p>Base URL for Umami Cloud send endpoint (used only for send_event)</p>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
<div class="tags">
|
|
205
|
+
|
|
206
|
+
<p class="tag_title">Returns:</p>
|
|
207
|
+
<ul class="return">
|
|
208
|
+
|
|
209
|
+
<li>
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
</li>
|
|
217
|
+
|
|
218
|
+
</ul>
|
|
219
|
+
|
|
220
|
+
</div>
|
|
221
|
+
</dt>
|
|
222
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://cloud.umami.is</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
223
|
+
|
|
116
224
|
</dl>
|
|
117
225
|
|
|
118
226
|
|
|
@@ -125,7 +233,7 @@
|
|
|
125
233
|
<li class="public ">
|
|
126
234
|
<span class="summary_signature">
|
|
127
235
|
|
|
128
|
-
<a href="#access_token-instance_method" title="#access_token (instance method)">#<strong>access_token</strong> ⇒
|
|
236
|
+
<a href="#access_token-instance_method" title="#access_token (instance method)">#<strong>access_token</strong> ⇒ String<sup>?</sup> </a>
|
|
129
237
|
|
|
130
238
|
|
|
131
239
|
|
|
@@ -142,7 +250,7 @@
|
|
|
142
250
|
|
|
143
251
|
|
|
144
252
|
|
|
145
|
-
<span class="summary_desc"><div class='inline'><p>
|
|
253
|
+
<span class="summary_desc"><div class='inline'><p>Access token for API authentication.</p>
|
|
146
254
|
</div></span>
|
|
147
255
|
|
|
148
256
|
</li>
|
|
@@ -179,7 +287,7 @@
|
|
|
179
287
|
<li class="public ">
|
|
180
288
|
<span class="summary_signature">
|
|
181
289
|
|
|
182
|
-
<a href="#request_timeout-instance_method" title="#request_timeout (instance method)">#<strong>request_timeout</strong> ⇒
|
|
290
|
+
<a href="#request_timeout-instance_method" title="#request_timeout (instance method)">#<strong>request_timeout</strong> ⇒ Integer </a>
|
|
183
291
|
|
|
184
292
|
|
|
185
293
|
|
|
@@ -188,8 +296,6 @@
|
|
|
188
296
|
|
|
189
297
|
|
|
190
298
|
|
|
191
|
-
<span class="note title readonly">readonly</span>
|
|
192
|
-
|
|
193
299
|
|
|
194
300
|
|
|
195
301
|
|
|
@@ -198,7 +304,7 @@
|
|
|
198
304
|
|
|
199
305
|
|
|
200
306
|
|
|
201
|
-
<span class="summary_desc"><div class='inline'><p>
|
|
307
|
+
<span class="summary_desc"><div class='inline'><p>Request timeout in seconds (default: 120).</p>
|
|
202
308
|
</div></span>
|
|
203
309
|
|
|
204
310
|
</li>
|
|
@@ -207,7 +313,7 @@
|
|
|
207
313
|
<li class="public ">
|
|
208
314
|
<span class="summary_signature">
|
|
209
315
|
|
|
210
|
-
<a href="#uri_base-instance_method" title="#uri_base (instance method)">#<strong>uri_base</strong> ⇒
|
|
316
|
+
<a href="#uri_base-instance_method" title="#uri_base (instance method)">#<strong>uri_base</strong> ⇒ String<sup>?</sup> </a>
|
|
211
317
|
|
|
212
318
|
|
|
213
319
|
|
|
@@ -224,7 +330,7 @@
|
|
|
224
330
|
|
|
225
331
|
|
|
226
332
|
|
|
227
|
-
<span class="summary_desc"><div class='inline'><p>
|
|
333
|
+
<span class="summary_desc"><div class='inline'><p>Base URL for the Umami API.</p>
|
|
228
334
|
</div></span>
|
|
229
335
|
|
|
230
336
|
</li>
|
|
@@ -233,7 +339,7 @@
|
|
|
233
339
|
<li class="public ">
|
|
234
340
|
<span class="summary_signature">
|
|
235
341
|
|
|
236
|
-
<a href="#username-instance_method" title="#username (instance method)">#<strong>username</strong> ⇒
|
|
342
|
+
<a href="#username-instance_method" title="#username (instance method)">#<strong>username</strong> ⇒ String<sup>?</sup> </a>
|
|
237
343
|
|
|
238
344
|
|
|
239
345
|
|
|
@@ -252,7 +358,7 @@
|
|
|
252
358
|
|
|
253
359
|
|
|
254
360
|
|
|
255
|
-
<span class="summary_desc"><div class='inline'><p>
|
|
361
|
+
<span class="summary_desc"><div class='inline'><p>Username for self-hosted authentication (set via credentials=).</p>
|
|
256
362
|
</div></span>
|
|
257
363
|
|
|
258
364
|
</li>
|
|
@@ -288,7 +394,8 @@
|
|
|
288
394
|
|
|
289
395
|
|
|
290
396
|
|
|
291
|
-
<span class="summary_desc"><div class='inline'
|
|
397
|
+
<span class="summary_desc"><div class='inline'><p>Check if configured for Umami Cloud.</p>
|
|
398
|
+
</div></span>
|
|
292
399
|
|
|
293
400
|
</li>
|
|
294
401
|
|
|
@@ -310,7 +417,8 @@
|
|
|
310
417
|
|
|
311
418
|
|
|
312
419
|
|
|
313
|
-
<span class="summary_desc"><div class='inline'
|
|
420
|
+
<span class="summary_desc"><div class='inline'><p>Set username/password credentials for self-hosted authentication.</p>
|
|
421
|
+
</div></span>
|
|
314
422
|
|
|
315
423
|
</li>
|
|
316
424
|
|
|
@@ -334,7 +442,30 @@
|
|
|
334
442
|
|
|
335
443
|
|
|
336
444
|
|
|
337
|
-
<span class="summary_desc"><div class='inline'><p>
|
|
445
|
+
<span class="summary_desc"><div class='inline'><p>Initialize a new Configuration with default values.</p>
|
|
446
|
+
</div></span>
|
|
447
|
+
|
|
448
|
+
</li>
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
<li class="public ">
|
|
452
|
+
<span class="summary_signature">
|
|
453
|
+
|
|
454
|
+
<a href="#validate!-instance_method" title="#validate! (instance method)">#<strong>validate!</strong> ⇒ Object </a>
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
</span>
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
<span class="summary_desc"><div class='inline'><p>Validate the configuration and apply defaults.</p>
|
|
338
469
|
</div></span>
|
|
339
470
|
|
|
340
471
|
</li>
|
|
@@ -357,7 +488,7 @@
|
|
|
357
488
|
|
|
358
489
|
</h3><div class="docstring">
|
|
359
490
|
<div class="discussion">
|
|
360
|
-
<p>
|
|
491
|
+
<p>Initialize a new Configuration with default values</p>
|
|
361
492
|
|
|
362
493
|
|
|
363
494
|
</div>
|
|
@@ -371,16 +502,17 @@
|
|
|
371
502
|
<pre class="lines">
|
|
372
503
|
|
|
373
504
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
505
|
+
49
|
|
506
|
+
50
|
|
507
|
+
51
|
|
508
|
+
52
|
|
509
|
+
53
|
|
510
|
+
54
|
|
511
|
+
55
|
|
512
|
+
56</pre>
|
|
381
513
|
</td>
|
|
382
514
|
<td>
|
|
383
|
-
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line
|
|
515
|
+
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line 49</span>
|
|
384
516
|
|
|
385
517
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
|
386
518
|
<span class='ivar'>@uri_base</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
@@ -388,6 +520,7 @@
|
|
|
388
520
|
<span class='ivar'>@access_token</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
389
521
|
<span class='ivar'>@username</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
390
522
|
<span class='ivar'>@password</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
523
|
+
<span class='ivar'>@dirty</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
391
524
|
<span class='kw'>end</span></pre>
|
|
392
525
|
</td>
|
|
393
526
|
</tr>
|
|
@@ -404,7 +537,7 @@
|
|
|
404
537
|
<div class="method_details first">
|
|
405
538
|
<h3 class="signature first" id="access_token-instance_method">
|
|
406
539
|
|
|
407
|
-
#<strong>access_token</strong> ⇒ <tt>
|
|
540
|
+
#<strong>access_token</strong> ⇒ <tt>String</tt><sup>?</sup>
|
|
408
541
|
|
|
409
542
|
|
|
410
543
|
|
|
@@ -412,13 +545,30 @@
|
|
|
412
545
|
|
|
413
546
|
</h3><div class="docstring">
|
|
414
547
|
<div class="discussion">
|
|
415
|
-
<p>Returns
|
|
548
|
+
<p>Returns Access token for API authentication.</p>
|
|
416
549
|
|
|
417
550
|
|
|
418
551
|
</div>
|
|
419
552
|
</div>
|
|
420
553
|
<div class="tags">
|
|
421
554
|
|
|
555
|
+
<p class="tag_title">Returns:</p>
|
|
556
|
+
<ul class="return">
|
|
557
|
+
|
|
558
|
+
<li>
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
—
|
|
566
|
+
<div class='inline'><p>Access token for API authentication</p>
|
|
567
|
+
</div>
|
|
568
|
+
|
|
569
|
+
</li>
|
|
570
|
+
|
|
571
|
+
</ul>
|
|
422
572
|
|
|
423
573
|
</div><table class="source_code">
|
|
424
574
|
<tr>
|
|
@@ -426,16 +576,12 @@
|
|
|
426
576
|
<pre class="lines">
|
|
427
577
|
|
|
428
578
|
|
|
429
|
-
|
|
430
|
-
6
|
|
431
|
-
7</pre>
|
|
579
|
+
46</pre>
|
|
432
580
|
</td>
|
|
433
581
|
<td>
|
|
434
|
-
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line
|
|
582
|
+
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line 46</span>
|
|
435
583
|
|
|
436
|
-
<span class='
|
|
437
|
-
<span class='ivar'>@access_token</span>
|
|
438
|
-
<span class='kw'>end</span></pre>
|
|
584
|
+
<span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:uri_base</span><span class='comma'>,</span> <span class='symbol'>:request_timeout</span><span class='comma'>,</span> <span class='symbol'>:access_token</span><span class='comma'>,</span> <span class='symbol'>:username</span><span class='comma'>,</span> <span class='symbol'>:password</span></pre>
|
|
439
585
|
</td>
|
|
440
586
|
</tr>
|
|
441
587
|
</table>
|
|
@@ -468,27 +614,23 @@
|
|
|
468
614
|
<pre class="lines">
|
|
469
615
|
|
|
470
616
|
|
|
471
|
-
|
|
472
|
-
6
|
|
473
|
-
7</pre>
|
|
617
|
+
46</pre>
|
|
474
618
|
</td>
|
|
475
619
|
<td>
|
|
476
|
-
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line
|
|
620
|
+
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line 46</span>
|
|
477
621
|
|
|
478
|
-
<span class='
|
|
479
|
-
<span class='ivar'>@password</span>
|
|
480
|
-
<span class='kw'>end</span></pre>
|
|
622
|
+
<span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:uri_base</span><span class='comma'>,</span> <span class='symbol'>:request_timeout</span><span class='comma'>,</span> <span class='symbol'>:access_token</span><span class='comma'>,</span> <span class='symbol'>:username</span><span class='comma'>,</span> <span class='symbol'>:password</span></pre>
|
|
481
623
|
</td>
|
|
482
624
|
</tr>
|
|
483
625
|
</table>
|
|
484
626
|
</div>
|
|
485
627
|
|
|
486
628
|
|
|
487
|
-
<span id=""></span>
|
|
629
|
+
<span id="request_timeout=-instance_method"></span>
|
|
488
630
|
<div class="method_details ">
|
|
489
631
|
<h3 class="signature " id="request_timeout-instance_method">
|
|
490
632
|
|
|
491
|
-
#<strong>request_timeout</strong> ⇒ <tt>
|
|
633
|
+
#<strong>request_timeout</strong> ⇒ <tt>Integer</tt>
|
|
492
634
|
|
|
493
635
|
|
|
494
636
|
|
|
@@ -496,13 +638,30 @@
|
|
|
496
638
|
|
|
497
639
|
</h3><div class="docstring">
|
|
498
640
|
<div class="discussion">
|
|
499
|
-
<p>Returns
|
|
641
|
+
<p>Returns Request timeout in seconds (default: 120).</p>
|
|
500
642
|
|
|
501
643
|
|
|
502
644
|
</div>
|
|
503
645
|
</div>
|
|
504
646
|
<div class="tags">
|
|
505
647
|
|
|
648
|
+
<p class="tag_title">Returns:</p>
|
|
649
|
+
<ul class="return">
|
|
650
|
+
|
|
651
|
+
<li>
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
—
|
|
659
|
+
<div class='inline'><p>Request timeout in seconds (default: 120)</p>
|
|
660
|
+
</div>
|
|
661
|
+
|
|
662
|
+
</li>
|
|
663
|
+
|
|
664
|
+
</ul>
|
|
506
665
|
|
|
507
666
|
</div><table class="source_code">
|
|
508
667
|
<tr>
|
|
@@ -510,16 +669,12 @@
|
|
|
510
669
|
<pre class="lines">
|
|
511
670
|
|
|
512
671
|
|
|
513
|
-
|
|
514
|
-
6
|
|
515
|
-
7</pre>
|
|
672
|
+
46</pre>
|
|
516
673
|
</td>
|
|
517
674
|
<td>
|
|
518
|
-
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line
|
|
675
|
+
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line 46</span>
|
|
519
676
|
|
|
520
|
-
<span class='
|
|
521
|
-
<span class='ivar'>@request_timeout</span>
|
|
522
|
-
<span class='kw'>end</span></pre>
|
|
677
|
+
<span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:uri_base</span><span class='comma'>,</span> <span class='symbol'>:request_timeout</span><span class='comma'>,</span> <span class='symbol'>:access_token</span><span class='comma'>,</span> <span class='symbol'>:username</span><span class='comma'>,</span> <span class='symbol'>:password</span></pre>
|
|
523
678
|
</td>
|
|
524
679
|
</tr>
|
|
525
680
|
</table>
|
|
@@ -530,7 +685,7 @@
|
|
|
530
685
|
<div class="method_details ">
|
|
531
686
|
<h3 class="signature " id="uri_base-instance_method">
|
|
532
687
|
|
|
533
|
-
#<strong>uri_base</strong> ⇒ <tt>
|
|
688
|
+
#<strong>uri_base</strong> ⇒ <tt>String</tt><sup>?</sup>
|
|
534
689
|
|
|
535
690
|
|
|
536
691
|
|
|
@@ -538,13 +693,30 @@
|
|
|
538
693
|
|
|
539
694
|
</h3><div class="docstring">
|
|
540
695
|
<div class="discussion">
|
|
541
|
-
<p>Returns
|
|
696
|
+
<p>Returns Base URL for the Umami API.</p>
|
|
542
697
|
|
|
543
698
|
|
|
544
699
|
</div>
|
|
545
700
|
</div>
|
|
546
701
|
<div class="tags">
|
|
547
702
|
|
|
703
|
+
<p class="tag_title">Returns:</p>
|
|
704
|
+
<ul class="return">
|
|
705
|
+
|
|
706
|
+
<li>
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
—
|
|
714
|
+
<div class='inline'><p>Base URL for the Umami API</p>
|
|
715
|
+
</div>
|
|
716
|
+
|
|
717
|
+
</li>
|
|
718
|
+
|
|
719
|
+
</ul>
|
|
548
720
|
|
|
549
721
|
</div><table class="source_code">
|
|
550
722
|
<tr>
|
|
@@ -552,12 +724,12 @@
|
|
|
552
724
|
<pre class="lines">
|
|
553
725
|
|
|
554
726
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
727
|
+
46
|
|
728
|
+
47
|
|
729
|
+
48</pre>
|
|
558
730
|
</td>
|
|
559
731
|
<td>
|
|
560
|
-
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line
|
|
732
|
+
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line 46</span>
|
|
561
733
|
|
|
562
734
|
<span class='kw'>def</span> <span class='id identifier rubyid_uri_base'>uri_base</span>
|
|
563
735
|
<span class='ivar'>@uri_base</span>
|
|
@@ -572,7 +744,7 @@
|
|
|
572
744
|
<div class="method_details ">
|
|
573
745
|
<h3 class="signature " id="username-instance_method">
|
|
574
746
|
|
|
575
|
-
#<strong>username</strong> ⇒ <tt>
|
|
747
|
+
#<strong>username</strong> ⇒ <tt>String</tt><sup>?</sup> <span class="extras">(readonly)</span>
|
|
576
748
|
|
|
577
749
|
|
|
578
750
|
|
|
@@ -580,13 +752,30 @@
|
|
|
580
752
|
|
|
581
753
|
</h3><div class="docstring">
|
|
582
754
|
<div class="discussion">
|
|
583
|
-
<p>Returns
|
|
755
|
+
<p>Returns Username for self-hosted authentication (set via credentials=).</p>
|
|
584
756
|
|
|
585
757
|
|
|
586
758
|
</div>
|
|
587
759
|
</div>
|
|
588
760
|
<div class="tags">
|
|
589
761
|
|
|
762
|
+
<p class="tag_title">Returns:</p>
|
|
763
|
+
<ul class="return">
|
|
764
|
+
|
|
765
|
+
<li>
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
—
|
|
773
|
+
<div class='inline'><p>Username for self-hosted authentication (set via credentials=)</p>
|
|
774
|
+
</div>
|
|
775
|
+
|
|
776
|
+
</li>
|
|
777
|
+
|
|
778
|
+
</ul>
|
|
590
779
|
|
|
591
780
|
</div><table class="source_code">
|
|
592
781
|
<tr>
|
|
@@ -594,16 +783,12 @@
|
|
|
594
783
|
<pre class="lines">
|
|
595
784
|
|
|
596
785
|
|
|
597
|
-
|
|
598
|
-
6
|
|
599
|
-
7</pre>
|
|
786
|
+
46</pre>
|
|
600
787
|
</td>
|
|
601
788
|
<td>
|
|
602
|
-
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line
|
|
789
|
+
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line 46</span>
|
|
603
790
|
|
|
604
|
-
<span class='
|
|
605
|
-
<span class='ivar'>@username</span>
|
|
606
|
-
<span class='kw'>end</span></pre>
|
|
791
|
+
<span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:uri_base</span><span class='comma'>,</span> <span class='symbol'>:request_timeout</span><span class='comma'>,</span> <span class='symbol'>:access_token</span><span class='comma'>,</span> <span class='symbol'>:username</span><span class='comma'>,</span> <span class='symbol'>:password</span></pre>
|
|
607
792
|
</td>
|
|
608
793
|
</tr>
|
|
609
794
|
</table>
|
|
@@ -627,7 +812,8 @@
|
|
|
627
812
|
|
|
628
813
|
</h3><div class="docstring">
|
|
629
814
|
<div class="discussion">
|
|
630
|
-
|
|
815
|
+
<p>Check if configured for Umami Cloud</p>
|
|
816
|
+
|
|
631
817
|
|
|
632
818
|
</div>
|
|
633
819
|
</div>
|
|
@@ -643,6 +829,10 @@
|
|
|
643
829
|
|
|
644
830
|
|
|
645
831
|
|
|
832
|
+
—
|
|
833
|
+
<div class='inline'><p>true if using Umami Cloud (access token without custom URI)</p>
|
|
834
|
+
</div>
|
|
835
|
+
|
|
646
836
|
</li>
|
|
647
837
|
|
|
648
838
|
</ul>
|
|
@@ -653,12 +843,12 @@
|
|
|
653
843
|
<pre class="lines">
|
|
654
844
|
|
|
655
845
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
846
|
+
97
|
|
847
|
+
98
|
|
848
|
+
99</pre>
|
|
659
849
|
</td>
|
|
660
850
|
<td>
|
|
661
|
-
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line
|
|
851
|
+
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line 97</span>
|
|
662
852
|
|
|
663
853
|
<span class='kw'>def</span> <span class='id identifier rubyid_cloud?'>cloud?</span>
|
|
664
854
|
<span class='ivar'>@access_token</span> <span class='op'>&&</span> <span class='ivar'>@uri_base</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
@@ -680,11 +870,38 @@
|
|
|
680
870
|
</h3><div class="docstring">
|
|
681
871
|
<div class="discussion">
|
|
682
872
|
|
|
873
|
+
<div class="note notetag">
|
|
874
|
+
<strong>Note:</strong>
|
|
875
|
+
<div class='inline'><p>Setting credentials clears any access token</p>
|
|
876
|
+
</div>
|
|
877
|
+
</div>
|
|
878
|
+
|
|
879
|
+
<p>Set username/password credentials for self-hosted authentication</p>
|
|
880
|
+
|
|
683
881
|
|
|
684
882
|
</div>
|
|
685
883
|
</div>
|
|
686
884
|
<div class="tags">
|
|
885
|
+
<p class="tag_title">Parameters:</p>
|
|
886
|
+
<ul class="param">
|
|
887
|
+
|
|
888
|
+
<li>
|
|
889
|
+
|
|
890
|
+
<span class='name'>creds</span>
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
—
|
|
898
|
+
<div class='inline'><p>Credentials hash with :username and :password keys</p>
|
|
899
|
+
</div>
|
|
900
|
+
|
|
901
|
+
</li>
|
|
687
902
|
|
|
903
|
+
</ul>
|
|
904
|
+
|
|
688
905
|
<p class="tag_title">Raises:</p>
|
|
689
906
|
<ul class="raise">
|
|
690
907
|
|
|
@@ -695,6 +912,10 @@
|
|
|
695
912
|
|
|
696
913
|
|
|
697
914
|
|
|
915
|
+
—
|
|
916
|
+
<div class='inline'><p>if username or password is missing</p>
|
|
917
|
+
</div>
|
|
918
|
+
|
|
698
919
|
</li>
|
|
699
920
|
|
|
700
921
|
</ul>
|
|
@@ -705,17 +926,17 @@
|
|
|
705
926
|
<pre class="lines">
|
|
706
927
|
|
|
707
928
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
929
|
+
79
|
|
930
|
+
80
|
|
931
|
+
81
|
|
932
|
+
82
|
|
933
|
+
83
|
|
934
|
+
84
|
|
935
|
+
85
|
|
936
|
+
86</pre>
|
|
716
937
|
</td>
|
|
717
938
|
<td>
|
|
718
|
-
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line
|
|
939
|
+
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line 79</span>
|
|
719
940
|
|
|
720
941
|
<span class='kw'>def</span> <span class='id identifier rubyid_credentials='>credentials=</span><span class='lparen'>(</span><span class='id identifier rubyid_creds'>creds</span><span class='rparen'>)</span>
|
|
721
942
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Umami.html" title="Umami (module)">Umami</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConfigurationError.html" title="Umami::ConfigurationError (class)">ConfigurationError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Both username and password are required</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_creds'>creds</span><span class='lbracket'>[</span><span class='symbol'>:username</span><span class='rbracket'>]</span> <span class='op'>&&</span> <span class='id identifier rubyid_creds'>creds</span><span class='lbracket'>[</span><span class='symbol'>:password</span><span class='rbracket'>]</span>
|
|
@@ -723,7 +944,106 @@
|
|
|
723
944
|
<span class='ivar'>@username</span> <span class='op'>=</span> <span class='id identifier rubyid_creds'>creds</span><span class='lbracket'>[</span><span class='symbol'>:username</span><span class='rbracket'>]</span>
|
|
724
945
|
<span class='ivar'>@password</span> <span class='op'>=</span> <span class='id identifier rubyid_creds'>creds</span><span class='lbracket'>[</span><span class='symbol'>:password</span><span class='rbracket'>]</span>
|
|
725
946
|
<span class='ivar'>@access_token</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
726
|
-
<span class='
|
|
947
|
+
<span class='ivar'>@dirty</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
948
|
+
<span class='kw'>end</span></pre>
|
|
949
|
+
</td>
|
|
950
|
+
</tr>
|
|
951
|
+
</table>
|
|
952
|
+
</div>
|
|
953
|
+
|
|
954
|
+
<div class="method_details ">
|
|
955
|
+
<h3 class="signature " id="validate!-instance_method">
|
|
956
|
+
|
|
957
|
+
#<strong>validate!</strong> ⇒ <tt>Object</tt>
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
</h3><div class="docstring">
|
|
964
|
+
<div class="discussion">
|
|
965
|
+
<p>Validate the configuration and apply defaults</p>
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
</div>
|
|
969
|
+
</div>
|
|
970
|
+
<div class="tags">
|
|
971
|
+
|
|
972
|
+
<p class="tag_title">Raises:</p>
|
|
973
|
+
<ul class="raise">
|
|
974
|
+
|
|
975
|
+
<li>
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
<span class='type'>(<tt><span class='object_link'><a href="ConfigurationError.html" title="Umami::ConfigurationError (class)">Umami::ConfigurationError</a></span></tt>)</span>
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
—
|
|
983
|
+
<div class='inline'><p>if configuration is invalid</p>
|
|
984
|
+
</div>
|
|
985
|
+
|
|
986
|
+
</li>
|
|
987
|
+
|
|
988
|
+
</ul>
|
|
989
|
+
|
|
990
|
+
</div><table class="source_code">
|
|
991
|
+
<tr>
|
|
992
|
+
<td>
|
|
993
|
+
<pre class="lines">
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
103
|
|
997
|
+
104
|
|
998
|
+
105
|
|
999
|
+
106
|
|
1000
|
+
107
|
|
1001
|
+
108
|
|
1002
|
+
109
|
|
1003
|
+
110
|
|
1004
|
+
111
|
|
1005
|
+
112
|
|
1006
|
+
113
|
|
1007
|
+
114
|
|
1008
|
+
115
|
|
1009
|
+
116
|
|
1010
|
+
117
|
|
1011
|
+
118
|
|
1012
|
+
119
|
|
1013
|
+
120
|
|
1014
|
+
121
|
|
1015
|
+
122
|
|
1016
|
+
123
|
|
1017
|
+
124
|
|
1018
|
+
125
|
|
1019
|
+
126</pre>
|
|
1020
|
+
</td>
|
|
1021
|
+
<td>
|
|
1022
|
+
<pre class="code"><span class="info file"># File 'lib/umami/configuration.rb', line 103</span>
|
|
1023
|
+
|
|
1024
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_validate!'>validate!</span>
|
|
1025
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='ivar'>@dirty</span>
|
|
1026
|
+
|
|
1027
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_cloud?'>cloud?</span>
|
|
1028
|
+
<span class='ivar'>@uri_base</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#UMAMI_CLOUD_URL-constant" title="Umami::Configuration::UMAMI_CLOUD_URL (constant)">UMAMI_CLOUD_URL</a></span></span>
|
|
1029
|
+
<span class='const'><span class='object_link'><a href="../Umami.html" title="Umami (module)">Umami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Umami.html#logger-class_method" title="Umami.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Using Umami Cloud (</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#UMAMI_CLOUD_URL-constant" title="Umami::Configuration::UMAMI_CLOUD_URL (constant)">UMAMI_CLOUD_URL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
|
1030
|
+
<span class='kw'>end</span>
|
|
1031
|
+
|
|
1032
|
+
<span class='kw'>if</span> <span class='ivar'>@uri_base</span> <span class='op'>==</span> <span class='const'><span class='object_link'><a href="#UMAMI_CLOUD_URL-constant" title="Umami::Configuration::UMAMI_CLOUD_URL (constant)">UMAMI_CLOUD_URL</a></span></span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='ivar'>@username</span> <span class='op'>||</span> <span class='ivar'>@password</span><span class='rparen'>)</span>
|
|
1033
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Umami.html" title="Umami (module)">Umami</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConfigurationError.html" title="Umami::ConfigurationError (class)">ConfigurationError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Username/password authentication is not supported for Umami Cloud</span><span class='tstring_end'>"</span></span>
|
|
1034
|
+
<span class='kw'>end</span>
|
|
1035
|
+
|
|
1036
|
+
<span class='kw'>if</span> <span class='ivar'>@access_token</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='ivar'>@username</span> <span class='op'>||</span> <span class='ivar'>@password</span><span class='rparen'>)</span>
|
|
1037
|
+
<span class='const'><span class='object_link'><a href="../Umami.html" title="Umami (module)">Umami</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Umami.html#logger-class_method" title="Umami.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Both access token and credentials provided. Access token will be used.</span><span class='tstring_end'>"</span></span>
|
|
1038
|
+
<span class='ivar'>@username</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
1039
|
+
<span class='ivar'>@password</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
1040
|
+
<span class='kw'>end</span>
|
|
1041
|
+
|
|
1042
|
+
<span class='kw'>if</span> <span class='ivar'>@uri_base</span> <span class='op'>&&</span> <span class='ivar'>@uri_base</span> <span class='op'>!=</span> <span class='const'><span class='object_link'><a href="#UMAMI_CLOUD_URL-constant" title="Umami::Configuration::UMAMI_CLOUD_URL (constant)">UMAMI_CLOUD_URL</a></span></span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@access_token</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@username</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@password</span>
|
|
1043
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Umami.html" title="Umami (module)">Umami</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConfigurationError.html" title="Umami::ConfigurationError (class)">ConfigurationError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Authentication is required for self-hosted instances</span><span class='tstring_end'>"</span></span>
|
|
1044
|
+
<span class='kw'>end</span>
|
|
1045
|
+
|
|
1046
|
+
<span class='ivar'>@dirty</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
727
1047
|
<span class='kw'>end</span></pre>
|
|
728
1048
|
</td>
|
|
729
1049
|
</tr>
|
|
@@ -735,9 +1055,9 @@
|
|
|
735
1055
|
</div>
|
|
736
1056
|
|
|
737
1057
|
<div id="footer">
|
|
738
|
-
Generated on
|
|
1058
|
+
Generated on Tue Feb 3 01:30:16 2026 by
|
|
739
1059
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
740
|
-
0.9.36 (ruby-3.
|
|
1060
|
+
0.9.36 (ruby-3.4.2).
|
|
741
1061
|
</div>
|
|
742
1062
|
|
|
743
1063
|
</div>
|