-
Notifications
You must be signed in to change notification settings - Fork 1
Develop #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Jipperism
wants to merge
59
commits into
v1
Choose a base branch
from
develop
base: v1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Refactors the base supabase service to apply strategies from `QueryStrategies.ts` when queried. This simplifies the architecture of the base service to have cleaner code and improve the testability and typing of the codebase. This is a setup for introducing more robust tests and removes the abundance of any-typed fields
…rgument generation Introduces a new `argGenerator.ts` to centralize and streamline GraphQL argument generation across different entity types. - Created a dynamic argument generation utility that reduces boilerplate - Removed multiple (or all) input type files in favor of a more generic approach - Standardized argument generation for where, sort, and pagination - Improved type safety and reduced code duplication - Updated resolvers and type definitions to use the new argument generation method - basic tests for argGenerator method
The big one. This commit refactors all away the supabase services in favor of services per entity. Query strategies are generated for every tables query. When query args are detected to referenced tables, the query building is applied accordingly. Creating a service for an entity defines the default getSingle and getMany methods including the argumentation. Field resolvers are implemented by using injected services and pass the query args. The created services also provide specific CRUD like methods, for example getting collection admins by calling the collection_admins table via the collections entity service. The resolver classes are updated to use injected services for the base type and fields resolvers where need. As the services were also applied in the API flow, those are updates following a similar approach. This commit is the big refactor, subsequent commits add documentation and test cases.
basic guide on how to add entities to the API
The createSortArgs, applySort and queryModifiers handled the sort fields input differently. This commit implements: - sort fields can only be primitive type (i.e. not reference fields) - sortBy is an optional fields - undefined values in sort options
Refactored metadata-related files to use 'hypercerts' instead of 'claims' in query strategies and type definitions. Updated resolvers and type definitions to reflect the new relationship between metadata and hypercerts.
The item_ids consist of token ids of a fraction. Changed the sales query strategy to use 'item_ids' array containment instead of 'token_id'.
Refined the type filtering for addresses by using a type predicate to ensure only non-null string values are included in the address list.
Refined the type definition for query arguments to explicitly include sort order types instead of just object
Adjusted blueprint ID handling to use number type instead of string in multiple files: - Updated BlueprintController to remove toString() conversion - Modified WhereFieldDefinitions to change blueprint ID type - Updated CollectionEntityService to preserve blueprint ID type
Updated UserWhereInput to use WhereFieldDefinitions for User entity. Replaced user input with with type shorthand in upsertUsers.
…ategy removing the optional metadata join condition, which was unnecessary. Metadata can be fetched via hypercert
Fixed type arguments in CollectionsQueryStrategy to use GetCollectionsArgs instead of GetContractsArgs
Added support for filtering signature requests by status, including: - Updated signatureRequestArgs to include status field - Extended SearchOptionType and SearchOptionMap to handle enum search options
…verage and documentation Improved the createEntitySortArgs utility with: - Detailed JSDoc documentation explaining function purpose and usage - Expanded test suite covering edge cases like empty definitions, special characters, and complex field types
…entation and test coverage Improved the createEntityWhereArgs utility with: - Detailed JSDoc documentation explaining function purpose, usage, and type handling - Expanded test suite covering primitive fields, nested reference fields, and error scenarios - Added comprehensive test cases for field initialization and complex nested structures
…ion and test coverage Improved the createEntityArgs utility with: - Detailed JSDoc documentation explaining function purpose, usage, and type handling - Expanded test suite and added more structure
…and test coverage Improved the TypeRegistry utility with: - Detailed JSDoc documentation explaining class purpose, methods, and type handling - Added clear() method to reset registry state - Enhanced type safety with generic type parameters - Expanded test suite covering edge cases, type creation, and registry operations - Updated import and usage of EntityTypeDefs for consistent type references
…proved testing Converted TypeRegistry to a tsyringe singleton: - Added @singleton decorator to TypeRegistry - Updated import and usage of container from tsyringe - Refactored test suite to use container.resolve() for registry instances - Removed manual singleton export in favor of container resolution - Enhanced singleton behavior tests to verify instance consistency
Updated BaseQueryArgs utility with: - Detailed JSDoc documentation explaining function purpose, usage, and type handling - Remaning of test suite to match lib filename
…d table relations Improved the buildWhereCondition utility with: - Updated definitions for complex filtering - Refactored support for custom nested relations to new tableRelations module to manage custom table join conditions - Extensive test coverage for various filtering scenarios - Enhanced SQL generation for different filter operators leveraging query parameters instead of inline injection of sql string (sql injection anyone?)
…and usage example Improved the DataResponse utility with: - Detailed JSDoc documentation explaining function purpose, usage, and type handling - Added comprehensive example demonstrating how to create and use the generic response type - Enhanced inline comments to clarify the purpose of each field and method
Enhanced the WhereFieldDefinitions utility with: - Detailed JSDoc documentation explaining the purpose and structure of field definitions - Added type documentation for WhereFieldDefinition to ensure type safety - Clarified the use case for defining filterable fields across different entities
…d improved testing Improved the applyPagination utility with: - Detailed JSDoc documentation explaining function purpose, type parameters, and usage - Enhanced type definitions for pagination arguments - Comprehensive test suite covering various pagination scenarios, edge cases, and query builder integration - Updated testing using pg-mem for in-memory database simulation
…ust testing Improved the applyWhere utility with: - Detailed JSDoc documentation explaining function purpose, type parameters, and usage - Comprehensive test suite covering various filtering scenarios, comparison operators, and query builder integration - Enhanced testing using pg-mem for in-memory database simulation
…st testing Improved the applySort utility with: - Detailed JSDoc documentation explaining function purpose, type parameters, and usage - Comprehensive test suite covering various sorting scenarios, query builder integration, and data validation - Enhanced testing using pg-mem for in-memory database simulation - Removed error handling try-catch block to simplify implementation
… robust testing Improved the queryModifiers utility with: - Detailed JSDoc documentation for QueryModifier type, composeQueryModifiers, and createStandardQueryModifier - Enhanced type safety and flexibility for query modification functions - Comprehensive test suite using pg-mem for in-memory database simulation - Added graceful handling of undefined modifier returns - Verified modifier composition order and individual modifier behaviors
Migrated the following db related method the to appropriate lib
…related components Refactored the attestation schema resolver and related components to improve code organization and maintainability: - Moved AttestationSchemaResolver from graphql to services directory - Updated import paths in composed resolver and type definitions - Enhanced type definitions with comprehensive documentation - Added detailed JSDoc comments for classes and methods - Introduced comprehensive test coverage for AttestationSchemaService, SupportedSchemasQueryStrategy, and AttestationSchemaResolver - Improved type safety and code clarity across related files
Refactored contract-related code to improve organization and maintainability: - Moved ContractResolver from graphql to services directory - Updated import paths in composed resolver - Modified WhereFieldDefinitions for contract fields so that chain_id is bigint not number - Enhanced ContractEntityService with comprehensive documentation - Added detailed JSDoc comments for ContractService and ContractsQueryStrategy - Updated field types and naming conventions for improved type safety
Refactored fraction-related code to improve organization and maintainability: - Moved FractionResolver from graphql to services directory - Updated import paths in composed resolver - Relocated fractionResolver from local to services directory - Enhanced FractionEntityService with comprehensive documentation - Added detailed JSDoc comments for FractionService and FractionsQueryStrategy - Introduced comprehensive test coverage for FractionService, FractionsQueryStrategy, and FractionResolver - Improved type safety and code clarity across related files - updated error handling to not throw in failed resolved fields queries - introduced test utils for recurring methods
…returns Implemented consistent error handling across multiple GraphQL resolvers: - Updated AllowlistRecordResolver, AttestationResolver, AttestationSchemaResolver, ContractResolver, and FractionResolver - Replaced error throwing with null returns for failed resolver queries - Added detailed console error logging for debugging - Updated corresponding test cases to expect null instead of thrown errors - Improved resilience of GraphQL endpoint by preventing query failures
…lated services Restructured metadata-related components to improve code organization: - Removed MetadataResolver from graphql schemas - Updated HypercertsEntityService to include metadata retrieval methods - Modified MetadataQueryStrategy to simplify query generation - Updated import paths in composed resolver and other resolvers - Removed hypercert-specific filtering from metadata query strategy - Relocated metadata-related methods to HypercertsService - Updated test cases to reflect new metadata retrieval approach
…nents Refactored hypercert-related code to improve organization and maintainability: - Moved HypercertResolver from graphql to services directory - Updated import paths in composed resolver - Enhanced HypercertsEntityService with comprehensive documentation - Added detailed JSDoc comments for HypercertService and ClaimsQueryStrategy - Introduced comprehensive test coverage for HypercertsService, ClaimsQueryStrategy, and HypercertResolver - Improved error handling to return null for failed resolver queries - Updated schema to add new fields and improve type safety
Restructured sales-related components to improve code organization and maintainability: - Moved SalesResolver from graphql to services directory - Updated import paths in composed resolver - Enhanced SalesEntityService with comprehensive documentation - Added detailed JSDoc comments for SalesService and SalesQueryStrategy - Introduced comprehensive test coverage for SalesService, SalesQueryStrategy, and SalesResolver - Improved error handling to return null for failed resolver queries - Standardized code structure with other similar resolvers
…nents Refactored blueprint-related code to improve organization and maintainability: - Moved BlueprintResolver from graphql to services directory - Updated import paths in composed resolver - Enhanced BlueprintsEntityService with comprehensive documentation - Added detailed JSDoc comments for BlueprintsService and BlueprintResolver - Introduced comprehensive test coverage for BlueprintsService, BlueprintResolver - Updated Vitest configuration to adjust code coverage thresholds - Improved error handling to return null for failed resolver queries - Standardized code structure with other similar resolvers - Introduced data database test utility for support the more complex interactions. For example the blueprint entityservice which interacts with multiple tables surin some method executions
…ponents Restructured user-related code to improve organization and maintainability: - Moved UserResolver from graphql to services directory - Updated import paths in composed resolver - Enhanced UsersEntityService with comprehensive documentation - Added detailed JSDoc comments for UserService, UsersQueryStrategy, and UserResolver - Introduced comprehensive test coverage for UsersService, UsersQueryStrategy, and UserResolver - Improved error handling to return null for failed resolver queries - Standardized code structure with other similar resolvers - Added test utilities for generating mock user and signature request data
…ated services Refactored collection-related components to improve organization and maintainability: - moved CollectionResolver and updated import paths in composed resolver - Enhanced CollectionService with comprehensive documentation and JSDoc comments - Updated Vitest configuration to adjust code coverage thresholds - Added new methods for managing collections, including CRUD operations and relationships - Introduced test utilities for generating mock collection data - Improved error handling and type safety across collection-related services - Introduced test suite for resolver, entity service and query strategy
- Implements and polishes marketplace order entities handlers. - Enhanced MarketplaceOrdersService with comprehensive documentation and new methods for order management - Updated test coverage for OrderResolver and MarketplaceOrdersService, including error handling and mock data generation - Introduced new utility functions for generating mock orders and collections
…lated components - Introduced new fields in hyperboardArgs for collections and improved type definitions in hyperboardTypeDefs. - Migrated HyperboardResolver to services directory - Updated HyperboardService with comprehensive documentation and new methods for managing hyperboard collections and admins. - Documented and tested HyperboardsQueryStrategy for optimized query handling with filtering capabilities. - Added extensive test coverage for HyperboardResolver, HyperboardService, and HyperboardsQueryStrategy, ensuring robust functionality and error handling. - Improved mock data generation utilities for hyperboards and related entities.
…nd enhance related components - Moved signature request resolver and composed resolver to services dir - Updaed SignatureRequestResolver with docs - Enhanced SignatureRequestsService with detailed documentation and methods for managing signature requests. - Added extensive test coverage for SignatureRequestsService and SignatureRequestResolver, ensuring robust functionality and error handling. - Updated database schema to support signature requests and improved mock data generation utilities.
Makes the hyperboard owners and sections response type consistent with other return types.
- Removed metadata image service, this has been split in the resolver - Updated Order invalidation cron job to use injected marketplace order service - Refactored order invalidation cron job to be singleton usin tsyringe - Updated tests
Add missing fields to order requests: created_at, invalidated and invalidation codes
coverage threshold v2 monitoring
- Updated GraphQL endpoint references from v1 to v2 in README and development documentation. - Adjusted API routes in various controllers to reflect the new v2 structure. - Added new response types in schema.graphql for hyperboard and section entries. - Updated test descriptions to align with the new v2 endpoints.
…rvices Refactor supabase services
- removes __generated__ from src code - added /src/__generated/ to .gitignore - removes unused dependencies found with npx depcheck
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.
No description provided.