feat: introduce data interfaces#866
Merged
Merged
Conversation
Introduce ConfigurableData, InsertableData, and QueryableData.
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a set of narrower Data-related interfaces (ConfigurableData, InsertableData, QueryableData) and updates the server/client layers to consume them, including a new endpoint + client method to fetch all matching payloads for a given name.
Changes:
- Added
ConfigurableData,InsertableData, andQueryableDatainterfaces and refactoredIDatainto an intersection of those interfaces. - Updated
DataandPromisedDatato implement the new interfaces. - Added
GET /:name/allon the server andClient.getPayloads()on the client to retrieve all matching payloads for a name.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/server/src/index.ts | Adds GET /:name/all route to return all matching payloads for a specific payload name. |
| packages/client/src/index.ts | Makes Client implement QueryableData and adds getPayloads(); updates query typing for existing methods. |
| packages/api/src/ConfigurableData.ts | New interface for configuration-related methods (usePayload, useTargeting, useFallThroughTargeting). |
| packages/api/src/InsertableData.ts | New interface for insert-related method (insert). |
| packages/api/src/QueryableData.ts | New interface for query-related methods (getPayload, getPayloadForEachName, getPayloads). |
| packages/api/src/IData.ts | Replaces the old IData interface with an intersection type of the three new interfaces. |
| packages/api/src/Data.ts | Updates Data to implement the new interfaces (no functional behavior change intended). |
| packages/api/src/PromisedData.ts | Updates PromisedData to implement the new interfaces. |
| packages/api/src/index.ts | Re-exports the new interfaces from the public API entrypoint. |
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.
Introduce ConfigurableData, InsertableData, and QueryableData.