Add Google Sheets client and context helper - #21
Merged
Conversation
- Add R3x::Client::GoogleSheets::Client to read spreadsheet rows via API - Implement header-to-hash mapping in `read_rows` for convenient rows - Add `google_sheets` helper to Workflow::Context to build client from env - Load credentials with MultiJson and R3x::Env.secure_fetch; readonly scope
- Replace nested `R3x::Client::GoogleSheets::Client` with `R3x::Client::GoogleSheets` to simplify the client API - Add `read_rows(range:, headers: true)` that returns hashes when `headers` is true for easier row consumption in workflows - Ensure header names are made unique on duplicates and pad short rows with `nil` so zipped hashes stay aligned - Switch to `R3x::Client::GoogleAuth.from_json` for service auth setup - Update `R3x::Workflow::Context#google_sheets` to use the new client - Add `# frozen_string_literal: true` to `lib/r3x/workflow/context.rb`
- Rename planned class to `R3x::Client::GoogleSheets` for clarity - Switch to `R3x::Client::GoogleAuth.from_json` in service setup - Inline credential parsing in `ClientProxy` with `MultiJson.load` - Remove doc's `fetch_google_credentials` helper function - Update `docs/todo/plan-google-sheets-client.md`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
read_rowsfor convenient rowsgoogle_sheetshelper to Workflow::Context to build client from env