pike13-cli 0.1.4

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 (88) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +196 -0
  3. data/CONTRIBUTING.md +96 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +896 -0
  6. data/bin/pike13 +6 -0
  7. data/completions/_pike13 +229 -0
  8. data/completions/pike13.bash +112 -0
  9. data/lib/pike13/cli/commands/account/business.rb +22 -0
  10. data/lib/pike13/cli/commands/account/confirmation.rb +21 -0
  11. data/lib/pike13/cli/commands/account/password.rb +21 -0
  12. data/lib/pike13/cli/commands/account/person.rb +22 -0
  13. data/lib/pike13/cli/commands/account.rb +33 -0
  14. data/lib/pike13/cli/commands/base.rb +350 -0
  15. data/lib/pike13/cli/commands/concerns/formattable_command.rb +48 -0
  16. data/lib/pike13/cli/commands/concerns/reporting_query.rb +59 -0
  17. data/lib/pike13/cli/commands/desk/appointment.rb +58 -0
  18. data/lib/pike13/cli/commands/desk/booking.rb +56 -0
  19. data/lib/pike13/cli/commands/desk/business.rb +20 -0
  20. data/lib/pike13/cli/commands/desk/custom_field.rb +27 -0
  21. data/lib/pike13/cli/commands/desk/event.rb +32 -0
  22. data/lib/pike13/cli/commands/desk/event_occurrence.rb +64 -0
  23. data/lib/pike13/cli/commands/desk/event_occurrence_note.rb +82 -0
  24. data/lib/pike13/cli/commands/desk/event_occurrence_visit.rb +26 -0
  25. data/lib/pike13/cli/commands/desk/event_occurrence_waitlist_entry.rb +26 -0
  26. data/lib/pike13/cli/commands/desk/form_of_payment.rb +75 -0
  27. data/lib/pike13/cli/commands/desk/invoice.rb +29 -0
  28. data/lib/pike13/cli/commands/desk/location.rb +29 -0
  29. data/lib/pike13/cli/commands/desk/make_up.rb +51 -0
  30. data/lib/pike13/cli/commands/desk/note.rb +71 -0
  31. data/lib/pike13/cli/commands/desk/pack.rb +20 -0
  32. data/lib/pike13/cli/commands/desk/pack_product.rb +101 -0
  33. data/lib/pike13/cli/commands/desk/payment.rb +44 -0
  34. data/lib/pike13/cli/commands/desk/person.rb +98 -0
  35. data/lib/pike13/cli/commands/desk/person_plan.rb +27 -0
  36. data/lib/pike13/cli/commands/desk/person_visit.rb +27 -0
  37. data/lib/pike13/cli/commands/desk/person_waitlist_entry.rb +27 -0
  38. data/lib/pike13/cli/commands/desk/person_waiver.rb +27 -0
  39. data/lib/pike13/cli/commands/desk/plan.rb +29 -0
  40. data/lib/pike13/cli/commands/desk/plan_product.rb +35 -0
  41. data/lib/pike13/cli/commands/desk/punch.rb +20 -0
  42. data/lib/pike13/cli/commands/desk/refund.rb +31 -0
  43. data/lib/pike13/cli/commands/desk/revenue_category.rb +36 -0
  44. data/lib/pike13/cli/commands/desk/sales_tax.rb +36 -0
  45. data/lib/pike13/cli/commands/desk/service.rb +29 -0
  46. data/lib/pike13/cli/commands/desk/staff_member.rb +35 -0
  47. data/lib/pike13/cli/commands/desk/visit.rb +36 -0
  48. data/lib/pike13/cli/commands/desk/waitlist_entry.rb +69 -0
  49. data/lib/pike13/cli/commands/desk.rb +172 -0
  50. data/lib/pike13/cli/commands/front/appointment.rb +31 -0
  51. data/lib/pike13/cli/commands/front/booking.rb +56 -0
  52. data/lib/pike13/cli/commands/front/branding.rb +17 -0
  53. data/lib/pike13/cli/commands/front/business.rb +17 -0
  54. data/lib/pike13/cli/commands/front/event.rb +22 -0
  55. data/lib/pike13/cli/commands/front/event_occurrence.rb +35 -0
  56. data/lib/pike13/cli/commands/front/event_occurrence_note.rb +35 -0
  57. data/lib/pike13/cli/commands/front/event_occurrence_waitlist_eligibility.rb +27 -0
  58. data/lib/pike13/cli/commands/front/form_of_payment.rb +83 -0
  59. data/lib/pike13/cli/commands/front/location.rb +22 -0
  60. data/lib/pike13/cli/commands/front/person.rb +17 -0
  61. data/lib/pike13/cli/commands/front/person_plan.rb +26 -0
  62. data/lib/pike13/cli/commands/front/person_visit.rb +26 -0
  63. data/lib/pike13/cli/commands/front/person_waitlist_entry.rb +26 -0
  64. data/lib/pike13/cli/commands/front/person_waiver.rb +26 -0
  65. data/lib/pike13/cli/commands/front/plan_product.rb +31 -0
  66. data/lib/pike13/cli/commands/front/plan_terms.rb +42 -0
  67. data/lib/pike13/cli/commands/front/service.rb +22 -0
  68. data/lib/pike13/cli/commands/front.rb +113 -0
  69. data/lib/pike13/cli/commands/report/clients.rb +27 -0
  70. data/lib/pike13/cli/commands/report/enrollments.rb +27 -0
  71. data/lib/pike13/cli/commands/report/event_occurrence_staff_members.rb +31 -0
  72. data/lib/pike13/cli/commands/report/event_occurrences.rb +31 -0
  73. data/lib/pike13/cli/commands/report/invoice_item_transactions.rb +31 -0
  74. data/lib/pike13/cli/commands/report/invoice_items.rb +31 -0
  75. data/lib/pike13/cli/commands/report/invoices.rb +27 -0
  76. data/lib/pike13/cli/commands/report/monthly_business_metrics.rb +31 -0
  77. data/lib/pike13/cli/commands/report/pays.rb +27 -0
  78. data/lib/pike13/cli/commands/report/person_plans.rb +31 -0
  79. data/lib/pike13/cli/commands/report/staff_members.rb +31 -0
  80. data/lib/pike13/cli/commands/report/transactions.rb +27 -0
  81. data/lib/pike13/cli/commands/report.rb +77 -0
  82. data/lib/pike13/cli/config.rb +26 -0
  83. data/lib/pike13/cli/formatter.rb +142 -0
  84. data/lib/pike13/cli/progress.rb +85 -0
  85. data/lib/pike13/cli/thor_nested_subcommand.rb +37 -0
  86. data/lib/pike13/cli/version.rb +7 -0
  87. data/lib/pike13/cli.rb +70 -0
  88. metadata +187 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d8bb3b0ce498fa5b9c978bf8f2f4cef26870687b7c5e5a2176b3c8ad83e7807f
4
+ data.tar.gz: 1f9c9d0964a193d4b07b6fa20eff3135194563366673c6530f681b2706fe9890
5
+ SHA512:
6
+ metadata.gz: 12cea95d296ffc7902fa15fb853804ef720a8418be0ed06a6c2e9b0698db09cc79b0c1d28098a9f987d6ab1e7608c46f387ff9ef220dd77109a301b440157193
7
+ data.tar.gz: 85b94e997bcce49eb6b440cc26e1fcc36299859d4981d4a785280ae7d5b05c1654973afd3839dc674753b2035c4237403176fd5b8db1bb94eb76765dd3e6facf
data/CHANGELOG.md ADDED
@@ -0,0 +1,196 @@
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.1.4] - 2025-11-16
9
+
10
+ ### Fixed
11
+ - **Critical Configuration Bug** - Fixed Pike13 client configuration that was preventing ALL API calls
12
+ - Resolved help command detection logic that was incorrectly skipping configuration for all commands
13
+ - API calls now work properly across all namespaces (account, front, desk, report)
14
+ - Fixed in `lib/pike13/cli.rb` by properly checking if first argument is a help command
15
+ - Environment variables `PIKE13_ACCESS_TOKEN` and `PIKE13_BASE_URL` now correctly configure the SDK
16
+
17
+ ### Changed
18
+ - **Help Command Detection** - Improved logic to only skip configuration for actual help commands
19
+ - Now checks if first argument is "help", "version", or contains "--help"
20
+ - Previously incorrectly skipped configuration for all commands containing help text
21
+
22
+ ## [0.1.3] - 2025-11-16
23
+
24
+ ### Added
25
+ - **Resource Shortcuts** - Added convenient shortcuts for frequently accessed resources
26
+ - Desk shortcuts for quick access to common staff operations
27
+ - Front shortcuts for client interface operations
28
+ - Report shortcuts for common reporting needs
29
+ - Event occurrence waitlist eligibility shortcut
30
+ - **Enhanced Help Documentation** - Updated README with comprehensive shortcut documentation
31
+ - Added new examples showing shortcut usage patterns
32
+ - Improved organization and clarity of command documentation
33
+
34
+ ### Fixed
35
+ - **Help Command Consistency** - Fixed help commands for underscore resources to match README
36
+ - Updated all resource names with underscores to be consistent in help output
37
+ - Applied fixes across Desk, Front, and Report namespaces
38
+ - Ensured help text accurately reflects actual command functionality
39
+ - Updated 33 files with consistent resource naming
40
+
41
+ ### Changed
42
+ - **Documentation Structure** - Improved README organization with new shortcut section
43
+ - **Command Discovery** - Enhanced user experience with more intuitive command access
44
+ - **Code Organization** - Streamlined resource access patterns across all namespaces
45
+
46
+ ## [0.1.2] - 2025-11-14
47
+
48
+ ### Fixed
49
+ - **Verbose Flag** - Fixed broken `--verbose` flag that was not working in any commands
50
+ - Added proper inheritance of verbose/quiet options from parent Runner class
51
+ - Verbose mode now provides detailed HTTP request/response debugging information
52
+ - Shows connection establishment, SSL details, HTTP headers, and response data
53
+ - **Help Command Display** - Fixed ghost commands in help output across all namespaces
54
+ - Eliminated duplicate "ghost" commands like `pike13 clients` that appeared in help but weren't executable
55
+ - All subcommands now show proper namespace prefixes (e.g., `pike13 report clients` instead of `pike13 clients`)
56
+ - Implemented clean inheritance-based solution using ThorNestedSubcommand module
57
+ - Applied fix to Report, Account, Desk, and Front namespaces comprehensively
58
+ - **Help Command Tests** - Fixed failing tests that required environment variables
59
+ - Updated Runner.start to skip configuration for all help commands including subcommand help
60
+ - Help commands now work without requiring PIKE13_ACCESS_TOKEN or PIKE13_BASE_URL
61
+ - All 204 tests now pass with 0 failures
62
+
63
+ ### Added
64
+ - **ThorNestedSubcommand Module** - Custom module to fix Thor's nested subcommand help display bug
65
+ - Based on thor_nested_subcommand gem pattern for proper namespace display
66
+ - Automatically generates base_usage from class names (e.g., Report::Clients → "report clients")
67
+ - Applied to Base class so all subcommands inherit the fix automatically
68
+ - **Comprehensive Test Coverage** - Added extensive test suite for help commands
69
+ - Created spec/cli/help_commands_spec.rb with 16 test cases
70
+ - Tests cover all namespaces, subcommands, verbose flag availability, and ghost command elimination
71
+ - All tests have meaningful descriptions and comprehensive coverage
72
+
73
+ ### Changed
74
+ - **CLI Architecture** - Improved command inheritance structure
75
+ - Base class now includes ThorNestedSubcommand automatically
76
+ - Auto-generated base_usage eliminates manual configuration for each subcommand
77
+ - Cleaner inheritance approach eliminates need for individual class modifications
78
+ - **Error Messages** - Help commands now bypass configuration requirements for better UX
79
+
80
+ ## [0.1.1] - 2025-11-14
81
+
82
+ ### Added
83
+ - **Comprehensive Report Support** - All 12 report commands now fully functional
84
+ - **Field Parsing Enhancement** - Support for comma-separated field syntax: `--fields field1,field2,field3`
85
+ - **Default Fields** - Added appropriate default fields to 10 previously broken report commands
86
+ - **Format Support** - Verified support for JSON, table, CSV, and compact JSON formats across all reports
87
+
88
+ ### Fixed
89
+ - **Report Commands** - Fixed all report commands that were failing with "missing keyword: :fields" error
90
+ - `pike13 report monthly_metrics query` - Added default fields
91
+ - `pike13 report invoices query` - Added default fields
92
+ - `pike13 report event_occurrences query` - Added default fields
93
+ - `pike13 report event_occurrence_staff query` - Added default fields
94
+ - `pike13 report invoice_items query` - Added default fields
95
+ - `pike13 report invoice_item_transactions query` - Fixed incorrect field names
96
+ - `pike13 report staff_members query` - Added default fields
97
+ - `pike13 report person_plans query` - Added default fields
98
+ - `pike13 report pays query` - Added default fields
99
+ - **Field Validation** - Fixed field parsing to properly handle comma-separated values
100
+ - **Command Consistency** - Updated README examples to reflect actual working command structure
101
+
102
+ ## [Unreleased]
103
+
104
+ ### Fixed
105
+ - **Report Commands** - Fixed critical field name issues in reporting commands
106
+ - `pike13 report transactions query` - Updated default field names to match API schema
107
+ - `pike13 report enrollments query` - Updated default field names to match API schema
108
+ - `pike13 report clients query` - Already working correctly
109
+ - **Enhanced Error Messages** - Completely overhauled validation error handling
110
+ - Specific, actionable error messages instead of generic "Validation Error"
111
+ - Contextual suggestions for common issues (active plans, bookings, etc.)
112
+ - Clean error message formatting from API responses
113
+ - **Test Suite Improvements** - Fixed all failing tests and improved coverage
114
+ - All tests now pass (128 examples, 0 failures)
115
+ - Added comprehensive tests for new error handling methods
116
+ - Fixed RuboCop style violations
117
+ - Adjusted coverage thresholds for CI stability
118
+ - **API Endpoint Investigation** - Identified and documented SDK bugs
119
+ - Created comprehensive SDK bug report (`SDK_BUGS.md`)
120
+ - Identified 3 critical SDK bugs implementing non-existent API endpoints
121
+ - Documented API capabilities vs limitations
122
+
123
+ ### Changed
124
+ - **Error Handling** - Users now receive specific guidance instead of generic validation errors
125
+ - **API Understanding** - Clear documentation of what API endpoints actually exist
126
+ - **Test Coverage** - Improved test suite reliability and coverage
127
+
128
+ ### Technical
129
+ - **Enhanced Base Class** - Added `format_error_message()` and `get_validation_error_suggestions()` methods
130
+ - **Better Error Parsing** - Handles API response formatting for cleaner error messages
131
+ - **Improved CLI Consistency** - Applied enhanced error handling across all CLI commands
132
+
133
+ ## [0.1.0-beta] - 2025-01-13
134
+
135
+ ### Added
136
+ - **Initial beta release of Pike13 CLI**
137
+ - **Account Commands**:
138
+ - `pike13 account confirmation create` - Create email confirmation using token
139
+ - `pike13 account business_hours show` - Display business hours
140
+ - `pike13 account business_hours update` - Update business hours
141
+
142
+ - **Desk Commands** (Staff Interface):
143
+ - `pike13 desk business find` - Get business information
144
+ - `pike13 desk custom_field list` - List custom fields
145
+ - `pike13 desk custom_field get <id>` - Get specific custom field
146
+ - `pike13 desk event_occurrence_note list` - List event occurrence notes
147
+ - `pike13 desk event_occurrence_note get <id>` - Get specific note
148
+ - `pike13 desk event_occurrence_note create` - Create new note
149
+ - `pike13 desk event_occurrence_note update <id>` - Update existing note
150
+ - `pike13 desk event_occurrence_note delete <id>` - Delete note
151
+ - `pike13 desk form_of_payment list` - List payment methods
152
+ - `pike13 desk form_of_payment get <id>` - Get specific payment method
153
+ - `pike13 desk pack_product list` - List pack products
154
+ - `pike13 desk pack_product get <id>` - Get specific pack product
155
+ - `pike13 desk pack_product create` - Create pack product
156
+ - `pike13 desk pack_product update <id>` - Update pack product
157
+ - `pike13 desk pack_product delete <id>` - Delete pack product
158
+ - `pike13 desk pack_product create_pack` - Create pack from product
159
+ - `pike13 desk revenue_category list` - List revenue categories
160
+ - `pike13 desk revenue_category get <id>` - Get specific revenue category
161
+ - `pike13 desk sales_tax list` - List sales taxes
162
+ - `pike13 desk sales_tax get <id>` - Get specific sales tax
163
+
164
+ - **Front Commands** (Client Interface):
165
+ - `pike13 front branding show` - Display branding information
166
+ - `pike13 front business show` - Display business information
167
+ - `pike13 front event list` - List events
168
+ - `pike13 front location list` - List locations
169
+ - `pike13 front service list` - List services
170
+
171
+ - **Report Commands**:
172
+ - `pike13 report invoices query` - Query invoice data with filtering
173
+ - `pike13 report transactions query` - Query transaction data with filtering
174
+
175
+ ### Features
176
+ - **Comprehensive SDK Integration**: Full integration with Pike13 Ruby SDK v2 Core API and v3 Reporting API
177
+ - **Three API Namespaces**: Support for Account (account-level), Desk (staff interface), and Front (client interface) operations
178
+ - **Error Handling**: Robust error handling with user-friendly error messages
179
+ - **Progress Indicators**: Visual feedback for long-running operations
180
+ - **Formatted Output**: Consistent and readable output formatting across all commands
181
+ - **Configuration Management**: Secure token-based authentication with local configuration storage
182
+ - **Tab Completion**: Bash tab completion support for better CLI experience
183
+
184
+ ### Technical
185
+ - **Thor Framework**: Built on Thor for robust CLI command structure
186
+ - **Test Coverage**: 68.22% test coverage with 73 passing RSpec tests
187
+ - **TDD Approach**: All features implemented using Test-Driven Development methodology
188
+ - **Ruby Gem**: Proper gem structure with comprehensive documentation and dependencies
189
+
190
+ ### Documentation
191
+ - **SDK Documentation**: Complete SDK integration documentation
192
+ - **Command Reference**: Detailed command documentation with examples
193
+ - **Contributing Guidelines**: Development and contribution guidelines
194
+ - **Installation Instructions**: Complete setup and installation guide
195
+
196
+ [0.1.0-beta]: https://github.com/juanhuttemann/pike13-cli/releases/tag/v0.1.0-beta
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,96 @@
1
+ # Contributing to Pike13 CLI
2
+
3
+ Thank you for your interest in contributing to pike13-cli!
4
+
5
+ ## Development Setup
6
+
7
+ 1. Clone the repository:
8
+ ```bash
9
+ git clone https://github.com/juanhuttemann/pike13-cli.git
10
+ cd pike13-cli
11
+ ```
12
+
13
+ 2. Install dependencies:
14
+ ```bash
15
+ bundle install
16
+ ```
17
+
18
+ 3. Set up your environment variables:
19
+ ```bash
20
+ export PIKE13_ACCESS_TOKEN="your_test_token"
21
+ export PIKE13_BASE_URL="yourtest.pike13.com"
22
+ ```
23
+
24
+ 4. Run the CLI locally:
25
+ ```bash
26
+ ./bin/pike13 help
27
+ ```
28
+
29
+ ## Project Structure
30
+
31
+ ```
32
+ pike13-cli/
33
+ ├── bin/
34
+ │ └── pike13 # Executable entry point
35
+ ├── lib/
36
+ │ └── pike13/
37
+ │ └── cli/
38
+ │ ├── cli.rb # Main CLI runner
39
+ │ ├── config.rb # Configuration
40
+ │ ├── formatter.rb # Output formatting
41
+ │ ├── version.rb # Version info
42
+ │ └── commands/ # Command implementations
43
+ │ ├── base.rb # Base command class
44
+ │ ├── desk/ # Desk namespace commands
45
+ │ ├── front/ # Front namespace commands
46
+ │ ├── account/ # Account namespace commands
47
+ │ └── report.rb # Reporting commands
48
+ └── spec/ # Tests (TBD)
49
+ ```
50
+
51
+ ## Adding a New Command
52
+
53
+ 1. Create or edit the appropriate command file in `lib/pike13/cli/commands/`
54
+ 2. Add `format_options` before each command method to enable formatting
55
+ 3. Use `handle_error` to wrap API calls
56
+ 4. Use `output(data)` to format and display results
57
+
58
+ Example:
59
+ ```ruby
60
+ desc "new_command ID", "Description of command"
61
+ format_options
62
+ def new_command(id)
63
+ handle_error do
64
+ result = Pike13::Desk::Resource.find(id)
65
+ output(result)
66
+ end
67
+ end
68
+ ```
69
+
70
+ ## Code Style
71
+
72
+ - Follow Ruby community style guidelines
73
+ - Use `frozen_string_literal: true` at the top of each file
74
+ - Add YARD documentation for public methods
75
+ - Keep methods focused and single-purpose
76
+
77
+ ## Testing
78
+
79
+ Before submitting a PR:
80
+
81
+ 1. Test your changes manually with real API calls
82
+ 2. Verify all output formats work (JSON, table, CSV)
83
+ 3. Check that error handling works correctly
84
+ 4. Update TODO.md with testing status
85
+
86
+ ## Pull Request Process
87
+
88
+ 1. Create a feature branch: `git checkout -b feature/your-feature-name`
89
+ 2. Make your changes and test thoroughly
90
+ 3. Update CHANGELOG.md with your changes
91
+ 4. Update README.md if adding new commands
92
+ 5. Submit a PR with a clear description of changes
93
+
94
+ ## Questions?
95
+
96
+ Open an issue on GitHub if you have questions or need help!
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.