mintsoft 0.1.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 +7 -0
- data/.rspec +3 -0
- data/.serena/memories/code_style_conventions.md +35 -0
- data/.serena/memories/codebase_structure.md +35 -0
- data/.serena/memories/development_environment.md +37 -0
- data/.serena/memories/project_overview.md +28 -0
- data/.serena/memories/suggested_commands.md +63 -0
- data/.serena/memories/task_completion_checklist.md +46 -0
- data/.serena/project.yml +68 -0
- data/.standard.yml +3 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE.txt +21 -0
- data/README.md +165 -0
- data/Rakefile +10 -0
- data/claudedocs/AUTH_CLIENT_DESIGN.md +294 -0
- data/claudedocs/FINAL_SIMPLIFIED_DESIGN.md +553 -0
- data/claudedocs/IMPLEMENTATION_SUMMARY.md +140 -0
- data/claudedocs/INDEX.md +83 -0
- data/claudedocs/MINIMAL_IMPLEMENTATION_PLAN.md +316 -0
- data/claudedocs/TOKEN_ONLY_CLIENT_DESIGN.md +408 -0
- data/claudedocs/USAGE_EXAMPLES.md +482 -0
- data/examples/complete_workflow.rb +146 -0
- data/lib/mintsoft/auth_client.rb +104 -0
- data/lib/mintsoft/base.rb +44 -0
- data/lib/mintsoft/client.rb +37 -0
- data/lib/mintsoft/errors.rb +9 -0
- data/lib/mintsoft/objects/order.rb +16 -0
- data/lib/mintsoft/objects/return.rb +26 -0
- data/lib/mintsoft/objects/return_reason.rb +11 -0
- data/lib/mintsoft/resources/base_resource.rb +53 -0
- data/lib/mintsoft/resources/orders.rb +36 -0
- data/lib/mintsoft/resources/returns.rb +90 -0
- data/lib/mintsoft/version.rb +5 -0
- data/lib/mintsoft.rb +17 -0
- data/sig/mintsoft.rbs +4 -0
- metadata +161 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 489ff03aa24f063091490ef90057d880e2ae2f181627e9a6bea31ceefdb30149
|
4
|
+
data.tar.gz: '0291ff21beb0f80946eeb3795ee7c98e8e1e45cf7a504fb6995229d72eca6f81'
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2c6a650aa2ad9a7c3fc2269763fc8cdcf7bc62f19b24af653500c4c27d56e2cb52e6147b8662a7b8705580976aef6b4a70f1d6063069debbcf6cd49865a4c36a
|
7
|
+
data.tar.gz: 7b8722786821c4d3adabfb7b7fdb7495af8cb0a08c0bdc8272a0667fe2f39e227e846885cfdbae7720568943ebf203fd5279aca49c05517b90851fd910ef2e08
|
data/.rspec
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Code Style Conventions
|
2
|
+
|
3
|
+
## Ruby Style Guide
|
4
|
+
- **Linter**: StandardRB (standard gem ~> 1.3)
|
5
|
+
- **Ruby Version**: >= 3.0.0 (configured in .standard.yml)
|
6
|
+
- **String Literals**: frozen_string_literal: true (enforced in all files)
|
7
|
+
|
8
|
+
## Naming Conventions
|
9
|
+
- **Module/Class**: PascalCase (e.g., `Mintsoft`, `Mintsoft::Error`)
|
10
|
+
- **Methods/Variables**: snake_case
|
11
|
+
- **Constants**: SCREAMING_SNAKE_CASE
|
12
|
+
- **Files**: snake_case matching class/module names
|
13
|
+
|
14
|
+
## File Organization
|
15
|
+
- One class/module per file
|
16
|
+
- File paths match module structure (lib/mintsoft/version.rb → Mintsoft::VERSION)
|
17
|
+
- All source files in lib/ directory
|
18
|
+
- Test files mirror lib/ structure in spec/
|
19
|
+
|
20
|
+
## Code Patterns
|
21
|
+
- Use `require_relative` for internal dependencies
|
22
|
+
- Inherit custom errors from StandardError
|
23
|
+
- Follow standard gem patterns for version management
|
24
|
+
- Use proper module namespacing
|
25
|
+
|
26
|
+
## Documentation Style
|
27
|
+
- Use YARD-style documentation comments
|
28
|
+
- Include examples in method documentation
|
29
|
+
- Keep README.md updated with usage instructions
|
30
|
+
|
31
|
+
## Testing Conventions
|
32
|
+
- RSpec with expect syntax (no should syntax)
|
33
|
+
- Disable monkey patching (`config.disable_monkey_patching!`)
|
34
|
+
- Use descriptive test names
|
35
|
+
- Store test status in `.rspec_status` file
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Codebase Structure
|
2
|
+
|
3
|
+
## Directory Layout
|
4
|
+
```
|
5
|
+
mintsoft/
|
6
|
+
├── bin/ # Executable scripts
|
7
|
+
│ ├── console # Interactive Ruby console
|
8
|
+
│ └── setup # Setup script for dependencies
|
9
|
+
├── lib/ # Main source code
|
10
|
+
│ ├── mintsoft.rb # Main entry point
|
11
|
+
│ └── mintsoft/ # Gem modules
|
12
|
+
│ └── version.rb # Version definition
|
13
|
+
├── spec/ # Test files
|
14
|
+
│ ├── spec_helper.rb # RSpec configuration
|
15
|
+
│ └── mintsoft_spec.rb # Main spec file
|
16
|
+
├── sig/ # Type signatures (if using Sorbet/RBS)
|
17
|
+
├── .github/ # GitHub workflows and templates
|
18
|
+
├── .serena/ # Serena project configuration
|
19
|
+
└── .ruby-lsp/ # Ruby LSP cache
|
20
|
+
```
|
21
|
+
|
22
|
+
## Key Files
|
23
|
+
- `mintsoft.gemspec` - Gem specification and dependencies
|
24
|
+
- `Gemfile` - Development dependencies
|
25
|
+
- `Rakefile` - Build and task definitions
|
26
|
+
- `README.md` - Project documentation (needs updating)
|
27
|
+
- `.rspec` - RSpec configuration
|
28
|
+
- `.standard.yml` - StandardRB configuration
|
29
|
+
- `CHANGELOG.md` - Version history
|
30
|
+
- `LICENSE.txt` - MIT license
|
31
|
+
|
32
|
+
## Entry Points
|
33
|
+
- `lib/mintsoft.rb` - Main module requiring version and defining base Error class
|
34
|
+
- `bin/console` - Interactive development console
|
35
|
+
- `bin/setup` - Development environment setup
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Development Environment
|
2
|
+
|
3
|
+
## System Requirements
|
4
|
+
- **OS**: macOS (Darwin 24.6.0)
|
5
|
+
- **Ruby**: >= 3.0.0 (as specified in gemspec and .standard.yml)
|
6
|
+
- **Bundler**: For dependency management
|
7
|
+
- **Git**: Version control
|
8
|
+
|
9
|
+
## IDE/Editor Setup
|
10
|
+
- **Ruby LSP**: Cache directory at `.ruby-lsp/`
|
11
|
+
- **Cursor**: Connected IDE with project integration
|
12
|
+
- **Serena**: Project configuration in `.serena/project.yml`
|
13
|
+
|
14
|
+
## Key Configuration Files
|
15
|
+
- `.rspec` - RSpec output format and options
|
16
|
+
- `.standard.yml` - StandardRB configuration (Ruby 3.0 target)
|
17
|
+
- `Gemfile` - Development dependencies
|
18
|
+
- `Rakefile` - Task definitions (default: spec + standard)
|
19
|
+
|
20
|
+
## Development Workflow
|
21
|
+
1. **Setup**: Run `bin/setup` to install dependencies
|
22
|
+
2. **Code**: Edit files in `lib/` directory
|
23
|
+
3. **Test**: Run `bundle exec rake spec`
|
24
|
+
4. **Lint**: Run `bundle exec rake standard`
|
25
|
+
5. **Console**: Use `bin/console` for interactive testing
|
26
|
+
6. **Commit**: Run full `bundle exec rake` before committing
|
27
|
+
|
28
|
+
## Dependencies
|
29
|
+
- **rspec** (~> 3.0) - Testing framework
|
30
|
+
- **standard** (~> 1.3) - Code formatting and linting
|
31
|
+
- **rake** (~> 13.0) - Build automation
|
32
|
+
|
33
|
+
## Project Patterns
|
34
|
+
- Follows standard Ruby gem conventions
|
35
|
+
- Uses frozen string literals
|
36
|
+
- RSpec with modern configuration (no monkey patching)
|
37
|
+
- StandardRB for consistent code style
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Mintsoft Project Overview
|
2
|
+
|
3
|
+
## Purpose
|
4
|
+
Mintsoft is a Ruby gem that serves as an API wrapper for interacting with the Mintsoft API. This is a freshly generated gem project that's ready for development.
|
5
|
+
|
6
|
+
## Tech Stack
|
7
|
+
- **Language**: Ruby (>= 3.0.0)
|
8
|
+
- **Gem Framework**: Standard Ruby gem structure using Bundler
|
9
|
+
- **Testing**: RSpec (~> 3.0)
|
10
|
+
- **Code Style**: StandardRB (~> 1.3)
|
11
|
+
- **Build Tool**: Rake (~> 13.0)
|
12
|
+
|
13
|
+
## Project Status
|
14
|
+
- Early development stage (v0.1.0)
|
15
|
+
- Basic gem structure is set up
|
16
|
+
- Ready for API wrapper implementation
|
17
|
+
- Contains placeholder TODOs in README that need to be updated
|
18
|
+
|
19
|
+
## Key Dependencies
|
20
|
+
- bundler (gem management)
|
21
|
+
- rspec (testing framework)
|
22
|
+
- standard (Ruby linting/formatting)
|
23
|
+
- rake (build tasks)
|
24
|
+
|
25
|
+
## Repository Information
|
26
|
+
- Homepage: https://github.com/Postco/mintsoft
|
27
|
+
- License: MIT
|
28
|
+
- Author: Andy Chong (andygg1996personal@gmail.com)
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Suggested Commands
|
2
|
+
|
3
|
+
## Development Setup
|
4
|
+
```bash
|
5
|
+
# Initial setup (run once)
|
6
|
+
bin/setup # Install dependencies and setup environment
|
7
|
+
bundle install # Install/update gem dependencies
|
8
|
+
|
9
|
+
# Interactive development
|
10
|
+
bin/console # Start IRB console with gem loaded
|
11
|
+
```
|
12
|
+
|
13
|
+
## Testing
|
14
|
+
```bash
|
15
|
+
# Run all tests
|
16
|
+
bundle exec rake spec # Run RSpec test suite
|
17
|
+
bundle exec rspec # Alternative way to run tests
|
18
|
+
bundle exec rspec spec/path/to/specific_spec.rb # Run specific test file
|
19
|
+
|
20
|
+
# Test with coverage
|
21
|
+
bundle exec rspec --format documentation # Detailed test output
|
22
|
+
```
|
23
|
+
|
24
|
+
## Code Quality
|
25
|
+
```bash
|
26
|
+
# Linting and formatting
|
27
|
+
bundle exec rake standard # Run StandardRB linter
|
28
|
+
bundle exec standardrb # Alternative StandardRB command
|
29
|
+
bundle exec standardrb --fix # Auto-fix style issues
|
30
|
+
|
31
|
+
# Run default task (tests + linting)
|
32
|
+
bundle exec rake # Runs both spec and standard tasks
|
33
|
+
rake # Shorthand if rake is in PATH
|
34
|
+
```
|
35
|
+
|
36
|
+
## Build and Release
|
37
|
+
```bash
|
38
|
+
# Local development
|
39
|
+
bundle exec rake install # Install gem locally for testing
|
40
|
+
gem uninstall mintsoft # Remove local installation
|
41
|
+
|
42
|
+
# Release process (when ready)
|
43
|
+
# 1. Update version in lib/mintsoft/version.rb
|
44
|
+
# 2. Update CHANGELOG.md
|
45
|
+
bundle exec rake release # Create git tag and push to RubyGems
|
46
|
+
```
|
47
|
+
|
48
|
+
## Git Workflow
|
49
|
+
```bash
|
50
|
+
git status # Check current state
|
51
|
+
git add . # Stage changes
|
52
|
+
git commit -m "message" # Commit with descriptive message
|
53
|
+
git push origin main # Push to remote
|
54
|
+
```
|
55
|
+
|
56
|
+
## macOS-Specific Commands
|
57
|
+
```bash
|
58
|
+
# File operations
|
59
|
+
ls -la # List files with details
|
60
|
+
find . -name "*.rb" # Find Ruby files
|
61
|
+
grep -r "pattern" lib/ # Search for patterns in code
|
62
|
+
open . # Open current directory in Finder
|
63
|
+
```
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Task Completion Checklist
|
2
|
+
|
3
|
+
## Before Committing Code
|
4
|
+
- [ ] **Tests Pass**: Run `bundle exec rake spec` - all tests must pass
|
5
|
+
- [ ] **Code Style**: Run `bundle exec rake standard` - no linting errors
|
6
|
+
- [ ] **Full Validation**: Run `bundle exec rake` (runs both spec + standard)
|
7
|
+
|
8
|
+
## Code Quality Gates
|
9
|
+
- [ ] **No Syntax Errors**: Ruby files parse correctly
|
10
|
+
- [ ] **Proper Requires**: All dependencies properly required
|
11
|
+
- [ ] **Frozen String Literals**: All new files include `# frozen_string_literal: true`
|
12
|
+
- [ ] **Naming Conventions**: Follow snake_case for files, PascalCase for classes
|
13
|
+
|
14
|
+
## Documentation Updates
|
15
|
+
- [ ] **README.md**: Update if public API changes
|
16
|
+
- [ ] **CHANGELOG.md**: Add entries for notable changes
|
17
|
+
- [ ] **Version**: Update `lib/mintsoft/version.rb` if releasing
|
18
|
+
- [ ] **Comments**: Add YARD documentation for new public methods
|
19
|
+
|
20
|
+
## Testing Requirements
|
21
|
+
- [ ] **Test Coverage**: New code has corresponding specs
|
22
|
+
- [ ] **Test Naming**: Descriptive spec names using expect syntax
|
23
|
+
- [ ] **No Monkey Patching**: Tests use modern RSpec configuration
|
24
|
+
|
25
|
+
## Release Preparation (when applicable)
|
26
|
+
- [ ] **Version Bump**: Update VERSION constant
|
27
|
+
- [ ] **Changelog**: Document changes
|
28
|
+
- [ ] **Gemspec**: Verify metadata is current
|
29
|
+
- [ ] **Git Clean**: Working directory clean before release
|
30
|
+
|
31
|
+
## Emergency Fixes
|
32
|
+
If urgent fix needed:
|
33
|
+
1. Run `bundle exec rspec` (faster than full rake)
|
34
|
+
2. Fix failing tests
|
35
|
+
3. Run `bundle exec standardrb --fix` (auto-fix style)
|
36
|
+
4. Commit and push
|
37
|
+
|
38
|
+
## Standard Development Loop
|
39
|
+
```bash
|
40
|
+
# Quick validation
|
41
|
+
bundle exec rake # Full test + lint suite
|
42
|
+
|
43
|
+
# Fast iteration
|
44
|
+
bundle exec rspec # Tests only
|
45
|
+
bundle exec standardrb # Linting only
|
46
|
+
```
|
data/.serena/project.yml
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby)
|
2
|
+
# * For C, use cpp
|
3
|
+
# * For JavaScript, use typescript
|
4
|
+
# Special requirements:
|
5
|
+
# * csharp: Requires the presence of a .sln file in the project folder.
|
6
|
+
language: ruby
|
7
|
+
|
8
|
+
# whether to use the project's gitignore file to ignore files
|
9
|
+
# Added on 2025-04-07
|
10
|
+
ignore_all_files_in_gitignore: true
|
11
|
+
# list of additional paths to ignore
|
12
|
+
# same syntax as gitignore, so you can use * and **
|
13
|
+
# Was previously called `ignored_dirs`, please update your config if you are using that.
|
14
|
+
# Added (renamed) on 2025-04-07
|
15
|
+
ignored_paths: []
|
16
|
+
|
17
|
+
# whether the project is in read-only mode
|
18
|
+
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
|
19
|
+
# Added on 2025-04-18
|
20
|
+
read_only: false
|
21
|
+
|
22
|
+
|
23
|
+
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
|
24
|
+
# Below is the complete list of tools for convenience.
|
25
|
+
# To make sure you have the latest list of tools, and to view their descriptions,
|
26
|
+
# execute `uv run scripts/print_tool_overview.py`.
|
27
|
+
#
|
28
|
+
# * `activate_project`: Activates a project by name.
|
29
|
+
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
|
30
|
+
# * `create_text_file`: Creates/overwrites a file in the project directory.
|
31
|
+
# * `delete_lines`: Deletes a range of lines within a file.
|
32
|
+
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
|
33
|
+
# * `execute_shell_command`: Executes a shell command.
|
34
|
+
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
|
35
|
+
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
|
36
|
+
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
|
37
|
+
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
|
38
|
+
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
|
39
|
+
# * `initial_instructions`: Gets the initial instructions for the current project.
|
40
|
+
# Should only be used in settings where the system prompt cannot be set,
|
41
|
+
# e.g. in clients you have no control over, like Claude Desktop.
|
42
|
+
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
|
43
|
+
# * `insert_at_line`: Inserts content at a given line in a file.
|
44
|
+
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
|
45
|
+
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
|
46
|
+
# * `list_memories`: Lists memories in Serena's project-specific memory store.
|
47
|
+
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
|
48
|
+
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
|
49
|
+
# * `read_file`: Reads a file within the project directory.
|
50
|
+
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
|
51
|
+
# * `remove_project`: Removes a project from the Serena configuration.
|
52
|
+
# * `replace_lines`: Replaces a range of lines within a file with new content.
|
53
|
+
# * `replace_symbol_body`: Replaces the full definition of a symbol.
|
54
|
+
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
|
55
|
+
# * `search_for_pattern`: Performs a search for a pattern in the project.
|
56
|
+
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
|
57
|
+
# * `switch_modes`: Activates modes by providing a list of their names
|
58
|
+
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
|
59
|
+
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
|
60
|
+
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
|
61
|
+
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
|
62
|
+
excluded_tools: []
|
63
|
+
|
64
|
+
# initial prompt for the project. It will always be given to the LLM upon activating the project
|
65
|
+
# (contrary to the memories, which are loaded on demand).
|
66
|
+
initial_prompt: ""
|
67
|
+
|
68
|
+
project_name: "mintsoft"
|
data/.standard.yml
ADDED
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
10
|
+
identity and orientation.
|
11
|
+
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
diverse, inclusive, and healthy community.
|
14
|
+
|
15
|
+
## Our Standards
|
16
|
+
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
18
|
+
community include:
|
19
|
+
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
+
and learning from the experience
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
26
|
+
community
|
27
|
+
|
28
|
+
Examples of unacceptable behavior include:
|
29
|
+
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
31
|
+
any kind
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
+
* Public or private harassment
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
35
|
+
without their explicit permission
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
37
|
+
professional setting
|
38
|
+
|
39
|
+
## Enforcement Responsibilities
|
40
|
+
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
+
or harmful.
|
45
|
+
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
+
decisions when appropriate.
|
50
|
+
|
51
|
+
## Scope
|
52
|
+
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
an individual is officially representing the community in public spaces.
|
55
|
+
Examples of representing our community include using an official email address,
|
56
|
+
posting via an official social media account, or acting as an appointed
|
57
|
+
representative at an online or offline event.
|
58
|
+
|
59
|
+
## Enforcement
|
60
|
+
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
+
reported to the community leaders responsible for enforcement at
|
63
|
+
[INSERT CONTACT METHOD].
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
65
|
+
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
reporter of any incident.
|
68
|
+
|
69
|
+
## Enforcement Guidelines
|
70
|
+
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
+
|
74
|
+
### 1. Correction
|
75
|
+
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
unprofessional or unwelcome in the community.
|
78
|
+
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
82
|
+
|
83
|
+
### 2. Warning
|
84
|
+
|
85
|
+
**Community Impact**: A violation through a single incident or series of
|
86
|
+
actions.
|
87
|
+
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
92
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
93
|
+
ban.
|
94
|
+
|
95
|
+
### 3. Temporary Ban
|
96
|
+
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
98
|
+
sustained inappropriate behavior.
|
99
|
+
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
communication with the community for a specified period of time. No public or
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
+
Violating these terms may lead to a permanent ban.
|
105
|
+
|
106
|
+
### 4. Permanent Ban
|
107
|
+
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
+
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
113
|
+
community.
|
114
|
+
|
115
|
+
## Attribution
|
116
|
+
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
+
version 2.1, available at
|
119
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
120
|
+
|
121
|
+
Community Impact Guidelines were inspired by
|
122
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
123
|
+
|
124
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
125
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
126
|
+
[https://www.contributor-covenant.org/translations][translations].
|
127
|
+
|
128
|
+
[homepage]: https://www.contributor-covenant.org
|
129
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
130
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
131
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
132
|
+
[translations]: https://www.contributor-covenant.org/translations
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2025 Andy Chong
|
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
|
13
|
+
all 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
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
# Mintsoft Ruby Gem
|
2
|
+
|
3
|
+
A Ruby wrapper for the Mintsoft API that provides simple token-based authentication and access to essential warehouse management functions.
|
4
|
+
|
5
|
+
## Features
|
6
|
+
|
7
|
+
- **Token-only authentication**: Manual token management for full control
|
8
|
+
- **5 Essential API endpoints**: Authentication, Order Search, Return Reasons, Create Returns, Add Return Items
|
9
|
+
- **OpenStruct-based objects**: Flexible response handling with automatic attribute conversion
|
10
|
+
- **Faraday HTTP client**: Robust HTTP handling with JSON support
|
11
|
+
- **Comprehensive error handling**: Clear error messages for common scenarios
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
Add this line to your application's Gemfile:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
gem 'mintsoft'
|
19
|
+
```
|
20
|
+
|
21
|
+
And then execute:
|
22
|
+
|
23
|
+
$ bundle install
|
24
|
+
|
25
|
+
Or install it yourself as:
|
26
|
+
|
27
|
+
$ gem install mintsoft
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
### Basic Workflow
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
require 'mintsoft'
|
35
|
+
|
36
|
+
# Step 1: Get authentication token
|
37
|
+
auth_client = Mintsoft::AuthClient.new
|
38
|
+
auth_response = auth_client.auth.authenticate("username", "password")
|
39
|
+
|
40
|
+
# Step 2: Initialize client with token
|
41
|
+
client = Mintsoft::Client.new(token: auth_response.token)
|
42
|
+
|
43
|
+
# Step 3: Search for orders
|
44
|
+
orders = client.orders.search("ORD-2024-001")
|
45
|
+
order = orders.first
|
46
|
+
|
47
|
+
# Step 4: Get return reasons
|
48
|
+
reasons = client.returns.reasons
|
49
|
+
damage_reason = reasons.find { |r| r.name.include?("Damage") }
|
50
|
+
|
51
|
+
# Step 5: Create return
|
52
|
+
return_obj = client.returns.create(order.id)
|
53
|
+
|
54
|
+
# Step 6: Add item to return
|
55
|
+
success = client.returns.add_item(return_obj.id, {
|
56
|
+
product_id: 123,
|
57
|
+
quantity: 2,
|
58
|
+
reason_id: damage_reason.id,
|
59
|
+
unit_value: 25.00,
|
60
|
+
notes: "Damaged in shipping"
|
61
|
+
})
|
62
|
+
```
|
63
|
+
|
64
|
+
### API Reference
|
65
|
+
|
66
|
+
#### AuthClient
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
# Initialize authentication client
|
70
|
+
auth_client = Mintsoft::AuthClient.new
|
71
|
+
|
72
|
+
# Authenticate and get token
|
73
|
+
auth_response = auth_client.auth.authenticate("username", "password")
|
74
|
+
puts auth_response.token
|
75
|
+
puts auth_response.expires_at
|
76
|
+
puts auth_response.expired?
|
77
|
+
```
|
78
|
+
|
79
|
+
#### Client
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
# Initialize with token
|
83
|
+
client = Mintsoft::Client.new(token: "your_token_here")
|
84
|
+
|
85
|
+
# Custom base URL (optional)
|
86
|
+
client = Mintsoft::Client.new(
|
87
|
+
token: "your_token_here",
|
88
|
+
base_url: "https://custom.api.com"
|
89
|
+
)
|
90
|
+
```
|
91
|
+
|
92
|
+
#### Orders
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
# Search for orders by order number
|
96
|
+
orders = client.orders.search("ORD-123")
|
97
|
+
|
98
|
+
# Access order properties
|
99
|
+
order = orders.first
|
100
|
+
puts order.id
|
101
|
+
puts order.order_number
|
102
|
+
puts order.customer_id
|
103
|
+
```
|
104
|
+
|
105
|
+
#### Returns
|
106
|
+
|
107
|
+
```ruby
|
108
|
+
# Get return reasons
|
109
|
+
reasons = client.returns.reasons
|
110
|
+
active_reasons = reasons.select(&:active?)
|
111
|
+
|
112
|
+
# Create return for order
|
113
|
+
return_obj = client.returns.create(order_id)
|
114
|
+
|
115
|
+
# Add item to return
|
116
|
+
client.returns.add_item(return_id, {
|
117
|
+
product_id: 123,
|
118
|
+
quantity: 2,
|
119
|
+
reason_id: reason_id,
|
120
|
+
unit_value: 25.00,
|
121
|
+
notes: "Optional notes"
|
122
|
+
})
|
123
|
+
```
|
124
|
+
|
125
|
+
### Error Handling
|
126
|
+
|
127
|
+
```ruby
|
128
|
+
begin
|
129
|
+
orders = client.orders.search("ORD-123")
|
130
|
+
rescue Mintsoft::AuthenticationError => e
|
131
|
+
# Token expired or invalid
|
132
|
+
puts "Authentication failed: #{e.message}"
|
133
|
+
rescue Mintsoft::ValidationError => e
|
134
|
+
# Invalid request data
|
135
|
+
puts "Validation error: #{e.message}"
|
136
|
+
rescue Mintsoft::NotFoundError => e
|
137
|
+
# Resource not found
|
138
|
+
puts "Not found: #{e.message}"
|
139
|
+
rescue Mintsoft::APIError => e
|
140
|
+
# General API error
|
141
|
+
puts "API error: #{e.message}"
|
142
|
+
end
|
143
|
+
```
|
144
|
+
|
145
|
+
### Complete Example
|
146
|
+
|
147
|
+
See [examples/complete_workflow.rb](examples/complete_workflow.rb) for a full working example.
|
148
|
+
|
149
|
+
## Development
|
150
|
+
|
151
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
152
|
+
|
153
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
154
|
+
|
155
|
+
## Contributing
|
156
|
+
|
157
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mintsoft. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/mintsoft/blob/main/CODE_OF_CONDUCT.md).
|
158
|
+
|
159
|
+
## License
|
160
|
+
|
161
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
162
|
+
|
163
|
+
## Code of Conduct
|
164
|
+
|
165
|
+
Everyone interacting in the Mintsoft project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/mintsoft/blob/main/CODE_OF_CONDUCT.md).
|