feat(SOSO-249): v3.0.0 - Factory Injection & Schema Introspection#8
Merged
feat(SOSO-249): v3.0.0 - Factory Injection & Schema Introspection#8
Conversation
…port Add comprehensive concept document for breaking changes in v3.0.0: - Factory pattern for AppSheetClient creation (DI support) - AppSheetClient now accepts full ConnectionDefinition with getTable() - DynamicTableFactory delegates to client.getTable() for TableDefinition - ConnectionManager redesign with factory injection - SchemaManager delegates to factories - Per-request user context (runAsUserEmail) now required - Schema validation flow documented (unchanged in DynamicTable) - All examples use JSON format - 7-phase implementation plan with 21 files to modify 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…able() BREAKING CHANGES: - AppSheetClient constructor now takes (connectionDef, runAsUserEmail) instead of single config object - MockAppSheetClient constructor signature also updated - runAsUserEmail is now a required parameter (previously optional) - Removed getConfig() method, replaced with getTable() Changes: - AppSheetClient: New constructor (ConnectionDefinition, runAsUserEmail) - MockAppSheetClient: New constructor with optional MockDataProvider - AppSheetClientInterface: Added getTable() method - DynamicTable: Now accepts AppSheetClientInterface (enables DI) This enables: - Dependency injection with interface-based clients - Easy testing with MockAppSheetClient - Factory pattern support (Phase 2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
New types: - AppSheetClientFactoryInterface: Factory for creating clients - DynamicTableFactoryInterface: Factory for creating tables New factory classes: - AppSheetClientFactory: Creates real AppSheetClient instances - MockAppSheetClientFactory: Creates mock clients for testing - DynamicTableFactory: Creates DynamicTable instances from schema These factories enable: - Dependency injection in ConnectionManager and SchemaManager - Easy testing by swapping real factory with mock factory - Pre-seeded test data via MockDataProvider 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
BREAKING CHANGES:
- AppSheetClient: new constructor(connectionDef, runAsUserEmail)
- MockAppSheetClient: new constructor(connectionDef, runAsUserEmail, dataProvider?)
- ConnectionManager: new constructor(clientFactory, schema) + get(name, userEmail)
- SchemaManager: new constructor(clientFactory, schema) + table(conn, table, userEmail)
- runAsUserEmail is now required (not optional)
- Removed: getConfig(), register(), remove(), clear(), ping(), healthCheck(),
reload(), getConnectionManager()
- Added: getTable(), list(), has(), hasConnection(), hasTable()
Added:
- AppSheetClientFactory: Creates real AppSheetClient instances
- MockAppSheetClientFactory: Creates MockAppSheetClient instances for testing
- DynamicTableFactory: Creates DynamicTable instances from schema
- AppSheetClientFactoryInterface: Interface for custom factory implementations
- DynamicTableFactoryInterface: Interface for custom table factory implementations
Migration:
- Old: new AppSheetClient({ appId, applicationAccessKey, runAsUserEmail? })
- New: new AppSheetClient(connectionDef, runAsUserEmail)
- Old: new SchemaManager(schema) + table('conn', 'table')
- New: new SchemaManager(factory, schema) + table('conn', 'table', userEmail)
Test coverage: 205 tests across 8 test suites
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add convenience methods to access schema metadata directly: - getTableDefinition(connection, table): Returns TableDefinition - getFieldDefinition(connection, table, field): Returns FieldDefinition - getAllowedValues(connection, table, field): Returns string[] for Enum/EnumList Use cases: Zod schema generation, OpenAPI spec, UI dropdowns, validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- CHANGELOG.md: Add schema introspection methods (#7), update test count - README.md: Update examples for v3.0.0 factory pattern and required userEmail - MIGRATION.md: Add v2.x → v3.0.0 migration guide with breaking changes - SOSO-249 concept: Add implementation status and schema introspection section 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Nov 30, 2025
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.
Summary
runAsUserEmailnow requiredChanges
Factory Injection (#6)
AppSheetClientFactory/MockAppSheetClientFactoryfor DISchemaManagerandConnectionManageraccept factory in constructorSchema Introspection (#7)
getTableDefinition(connection, table)→ TableDefinitiongetFieldDefinition(connection, table, field)→ FieldDefinitiongetAllowedValues(connection, table, field)→ string[] for Enum/EnumListBreaking Changes
AppSheetClient: New constructor(connectionDef, runAsUserEmail)SchemaManager: New constructor(clientFactory, schema)runAsUserEmailis now required (not optional)Test plan
Closes #6
Closes #7
🤖 Generated with Claude Code