pike13 0.1.0.beta

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.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +134 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +634 -0
  5. data/lib/pike13/api/v2/account/base.rb +31 -0
  6. data/lib/pike13/api/v2/account/business.rb +23 -0
  7. data/lib/pike13/api/v2/account/confirmation.rb +18 -0
  8. data/lib/pike13/api/v2/account/me.rb +20 -0
  9. data/lib/pike13/api/v2/account/password.rb +18 -0
  10. data/lib/pike13/api/v2/account/person.rb +18 -0
  11. data/lib/pike13/api/v2/desk/appointment.rb +28 -0
  12. data/lib/pike13/api/v2/desk/base.rb +30 -0
  13. data/lib/pike13/api/v2/desk/booking.rb +43 -0
  14. data/lib/pike13/api/v2/desk/business.rb +23 -0
  15. data/lib/pike13/api/v2/desk/custom_field.rb +23 -0
  16. data/lib/pike13/api/v2/desk/event.rb +23 -0
  17. data/lib/pike13/api/v2/desk/event_occurrence.rb +33 -0
  18. data/lib/pike13/api/v2/desk/event_occurrence_note.rb +38 -0
  19. data/lib/pike13/api/v2/desk/event_occurrence_visit.rb +18 -0
  20. data/lib/pike13/api/v2/desk/event_occurrence_waitlist_entry.rb +18 -0
  21. data/lib/pike13/api/v2/desk/form_of_payment.rb +38 -0
  22. data/lib/pike13/api/v2/desk/invoice.rb +83 -0
  23. data/lib/pike13/api/v2/desk/location.rb +23 -0
  24. data/lib/pike13/api/v2/desk/make_up.rb +36 -0
  25. data/lib/pike13/api/v2/desk/note.rb +38 -0
  26. data/lib/pike13/api/v2/desk/pack.rb +28 -0
  27. data/lib/pike13/api/v2/desk/pack_product.rb +43 -0
  28. data/lib/pike13/api/v2/desk/payment.rb +31 -0
  29. data/lib/pike13/api/v2/desk/person.rb +48 -0
  30. data/lib/pike13/api/v2/desk/person_plan.rb +18 -0
  31. data/lib/pike13/api/v2/desk/person_visit.rb +18 -0
  32. data/lib/pike13/api/v2/desk/person_waitlist_entry.rb +18 -0
  33. data/lib/pike13/api/v2/desk/person_waiver.rb +18 -0
  34. data/lib/pike13/api/v2/desk/plan.rb +28 -0
  35. data/lib/pike13/api/v2/desk/plan_product.rb +23 -0
  36. data/lib/pike13/api/v2/desk/punch.rb +33 -0
  37. data/lib/pike13/api/v2/desk/refund.rb +23 -0
  38. data/lib/pike13/api/v2/desk/revenue_category.rb +23 -0
  39. data/lib/pike13/api/v2/desk/sales_tax.rb +23 -0
  40. data/lib/pike13/api/v2/desk/service.rb +28 -0
  41. data/lib/pike13/api/v2/desk/staff_member.rb +28 -0
  42. data/lib/pike13/api/v2/desk/visit.rb +43 -0
  43. data/lib/pike13/api/v2/desk/waitlist_entry.rb +38 -0
  44. data/lib/pike13/api/v2/front/appointment.rb +28 -0
  45. data/lib/pike13/api/v2/front/base.rb +30 -0
  46. data/lib/pike13/api/v2/front/booking.rb +53 -0
  47. data/lib/pike13/api/v2/front/branding.rb +18 -0
  48. data/lib/pike13/api/v2/front/business.rb +23 -0
  49. data/lib/pike13/api/v2/front/event.rb +23 -0
  50. data/lib/pike13/api/v2/front/event_occurrence.rb +33 -0
  51. data/lib/pike13/api/v2/front/event_occurrence_note.rb +23 -0
  52. data/lib/pike13/api/v2/front/event_occurrence_waitlist_eligibility.rb +18 -0
  53. data/lib/pike13/api/v2/front/form_of_payment.rb +43 -0
  54. data/lib/pike13/api/v2/front/invoice.rb +58 -0
  55. data/lib/pike13/api/v2/front/location.rb +23 -0
  56. data/lib/pike13/api/v2/front/note.rb +24 -0
  57. data/lib/pike13/api/v2/front/payment.rb +23 -0
  58. data/lib/pike13/api/v2/front/person.rb +23 -0
  59. data/lib/pike13/api/v2/front/person_plan.rb +18 -0
  60. data/lib/pike13/api/v2/front/person_visit.rb +18 -0
  61. data/lib/pike13/api/v2/front/person_waitlist_entry.rb +18 -0
  62. data/lib/pike13/api/v2/front/person_waiver.rb +18 -0
  63. data/lib/pike13/api/v2/front/plan.rb +28 -0
  64. data/lib/pike13/api/v2/front/plan_product.rb +23 -0
  65. data/lib/pike13/api/v2/front/plan_terms.rb +28 -0
  66. data/lib/pike13/api/v2/front/service.rb +28 -0
  67. data/lib/pike13/api/v2/front/staff_member.rb +23 -0
  68. data/lib/pike13/api/v2/front/visit.rb +33 -0
  69. data/lib/pike13/api/v2/front/waitlist_entry.rb +33 -0
  70. data/lib/pike13/configuration.rb +58 -0
  71. data/lib/pike13/errors.rb +104 -0
  72. data/lib/pike13/http_client.rb +175 -0
  73. data/lib/pike13/version.rb +5 -0
  74. data/lib/pike13.rb +159 -0
  75. metadata +131 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 40ff200316bf806e4894c0689a8ca85b9eb607354bc63afafa62a8d1251b32d6
4
+ data.tar.gz: 577c1d5e9ac786fedaf0f80251e600b927304c4ce5fdc4e110f4f6ad10033073
5
+ SHA512:
6
+ metadata.gz: 1617471ee88b05382f2f8f16e9ad7c7fa436bf8fec5e213cade375dbd804e2775c5f46fc0069a58b74c6c4cc4b2b01ab59fe3d56d602da0196cf536ab2c519bb
7
+ data.tar.gz: 44ff76cbb187f072d898c4d13484242c3f08a5a8981f454b71e0d01eb86f0d2526f58749f0911a9cbb162d4b1a48fdac41527981efd86c903066cbd6717e66f0
data/CHANGELOG.md ADDED
@@ -0,0 +1,134 @@
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
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2025-01-27
11
+
12
+ ### Added
13
+
14
+ #### Core Infrastructure
15
+ - HTTP client with Faraday and automatic retry (max 2 retries, exponential backoff)
16
+ - Bearer token authentication
17
+ - Automatic JSON response parsing
18
+ - Global configuration management via `Pike13.configure`
19
+ - URL validation supporting HTTP/HTTPS schemes and custom ports
20
+ - Support for production (`mybiz.pike13.com`) and development (`http://mybiz.pike13.test:3000`) environments
21
+
22
+ #### Error Handling
23
+ - `Pike13::Error` - Base error class
24
+ - `Pike13::ConfigurationError` - Configuration validation errors
25
+ - `Pike13::APIError` - Base for HTTP errors
26
+ - `Pike13::AuthenticationError` (401)
27
+ - `Pike13::NotFoundError` (404)
28
+ - `Pike13::ValidationError` (422)
29
+ - `Pike13::RateLimitError` (429) with rate limit reset header tracking
30
+ - `Pike13::ServerError` (5xx)
31
+
32
+ #### Account Scope Resources
33
+ Base URL: `https://pike13.com/api/v2`
34
+
35
+ - **Account::Me** - Get current account details
36
+ - **Account::Business** - List and find businesses
37
+ - **Account::Person** - List and find people
38
+ - **Account::Password** - Password reset/creation
39
+ - **Account::Confirmation** - Email confirmation
40
+
41
+ #### Desk Scope Resources (Staff Interface)
42
+ Base URL: `https://[base_url]/api/v2`
43
+
44
+ **People Management:**
45
+ - **Desk::Person** - Full CRUD operations
46
+ - List all people, find by ID, search, get authenticated user
47
+ - Create, update, and delete people
48
+
49
+ **Business & Locations:**
50
+ - **Desk::Business** - Get business information
51
+ - **Desk::Location** - List and find locations
52
+
53
+ **Events & Scheduling:**
54
+ - **Desk::Event** - List and find events
55
+ - **Desk::EventOccurrence** - List and find occurrences, summaries, enrollment eligibility
56
+ - **Desk::Appointment** - Find available slots and availability summaries
57
+
58
+ **Bookings & Visits:**
59
+ - **Desk::Booking** - Full CRUD operations for bookings
60
+ - **Desk::Visit** - List and find visits, get visit summaries
61
+
62
+ **Services & Staff:**
63
+ - **Desk::Service** - List and find services, enrollment eligibility
64
+ - **Desk::StaffMember** - List and find staff members, get authenticated staff
65
+
66
+ **Plans & Products:**
67
+ - **Desk::Plan** - List and find plans
68
+ - **Desk::PlanProduct** - List and find plan products
69
+ - **Desk::PackProduct** - List and find pack products
70
+ - **Desk::Pack** - Find packs by ID
71
+ - **Desk::Punch** - Find punches by ID
72
+
73
+ **Financial:**
74
+ - **Desk::Invoice** - List and find invoices
75
+ - **Desk::Payment** - Find payments, void payments, get payment configuration
76
+ - **Desk::Refund** - Find refunds, void refunds
77
+ - **Desk::RevenueCategory** - List and find revenue categories
78
+ - **Desk::SalesTax** - List and find sales taxes
79
+
80
+ **Notes & Communication:**
81
+ - **Desk::Note** - Full CRUD operations for person notes
82
+ - List notes for a person
83
+ - Create, update, and delete notes
84
+
85
+ **Other Resources:**
86
+ - **Desk::MakeUp** - Find make-ups, list reasons, generate make-up credits
87
+ - **Desk::WaitlistEntry** - List and find waitlist entries
88
+ - **Desk::CustomField** - List and find custom fields
89
+
90
+ #### Front Scope Resources (Client Interface)
91
+ Base URL: `https://[base_url]/api/v2`
92
+
93
+ **Business & Branding:**
94
+ - **Front::Business** - Get business information
95
+ - **Front::Branding** - Get branding information
96
+
97
+ **People:**
98
+ - **Front::Person** - Get authenticated client user only
99
+
100
+ **Events & Scheduling:**
101
+ - **Front::Event** - List and find events
102
+ - **Front::EventOccurrence** - List and find occurrences, summaries, enrollment eligibility
103
+ - **Front::Appointment** - Find available slots and availability summaries
104
+
105
+ **Bookings & Visits:**
106
+ - **Front::Booking** - Full CRUD operations, find leases
107
+ - **Front::Visit** - List and find visits
108
+
109
+ **Services & Staff:**
110
+ - **Front::Service** - List and find services, enrollment eligibility
111
+ - **Front::StaffMember** - List and find staff members
112
+ - **Front::Location** - List and find locations
113
+
114
+ **Plans & Products:**
115
+ - **Front::Plan** - List and find plans
116
+ - **Front::PlanProduct** - List and find plan products
117
+
118
+ **Financial:**
119
+ - **Front::Invoice** - Find invoices by ID
120
+ - **Front::Payment** - Find payments, get payment configuration
121
+
122
+ **Other Resources:**
123
+ - **Front::Note** - List and find person notes (read-only)
124
+ - **Front::WaitlistEntry** - List and find waitlist entries
125
+
126
+ ### Dependencies
127
+ - `faraday` (~> 2.0) - HTTP client
128
+ - `faraday-retry` (~> 2.0) - Automatic retry middleware
129
+ - Ruby >= 3.0.0 required
130
+
131
+ ### Development
132
+ - RuboCop configuration for code quality
133
+ - Minitest test suite with 99 tests, 93% line coverage
134
+ - SimpleCov for test coverage reporting
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Juan Huttemann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.