refactor: deduplicate enums and replace inline strings with shared privacy-types#79
Merged
michaelfarrell76 merged 4 commits intomainfrom Apr 10, 2026
Merged
refactor: deduplicate enums and replace inline strings with shared privacy-types#79michaelfarrell76 merged 4 commits intomainfrom
michaelfarrell76 merged 4 commits intomainfrom
Conversation
…ivacy-types - Add CookieOrderField, DataFlowOrderField, DataFlowType, TriageAction, ConsentTrackerType to @transcend-io/privacy-types - Create shared schemas.ts in mcp-server-consent and mcp-server-dsr to deduplicate z.nativeEnum wrappers (ConsentTrackerStatusEnum, OrderDirectionEnum, RequestTypeEnum) - Replace z.string() with z.nativeEnum() for order_field params in consent_list_cookies and consent_list_data_flows - Replace inline z.enum(['APPROVE','JUNK']) and z.enum(['cookie','data_flow']) with shared TriageAction and ConsentTrackerType enums - Replace z.enum(['DRAFT','PUBLISHED']) with AssessmentFormTemplateStatus - Replace z.array(z.string()) scopes with z.array(z.nativeEnum(ScopeName)) - Replace z.string() identifierType with z.nativeEnum(IdentifierType) in preferences tools - Add @transcend-io/privacy-types dependency to mcp-server-admin and mcp-server-preferences
@transcend-io/cli
@transcend-io/privacy-types
@transcend-io/sdk
@transcend-io/utils
@transcend-io/mcp-server
@transcend-io/mcp-server-admin
@transcend-io/mcp-server-assessments
@transcend-io/mcp-server-consent
@transcend-io/mcp-server-core
@transcend-io/mcp-server-discovery
@transcend-io/mcp-server-dsr
@transcend-io/mcp-server-inventory
@transcend-io/mcp-server-preferences
@transcend-io/mcp-server-workflows
commit: |
…reate_api_key - Remove schemas.ts from mcp-server-consent and mcp-server-dsr; inline z.nativeEnum() directly in each tool file - Enrich admin_create_api_key tool description with TRANSCEND_SCOPES metadata (title, description, dependency info for every scope)
dsklyar
approved these changes
Apr 10, 2026
michaelfarrell76
added a commit
that referenced
this pull request
Apr 10, 2026
…ivacy-types (#79) * refactor: deduplicate enums and replace inline strings with shared privacy-types - Add CookieOrderField, DataFlowOrderField, DataFlowType, TriageAction, ConsentTrackerType to @transcend-io/privacy-types - Create shared schemas.ts in mcp-server-consent and mcp-server-dsr to deduplicate z.nativeEnum wrappers (ConsentTrackerStatusEnum, OrderDirectionEnum, RequestTypeEnum) - Replace z.string() with z.nativeEnum() for order_field params in consent_list_cookies and consent_list_data_flows - Replace inline z.enum(['APPROVE','JUNK']) and z.enum(['cookie','data_flow']) with shared TriageAction and ConsentTrackerType enums - Replace z.enum(['DRAFT','PUBLISHED']) with AssessmentFormTemplateStatus - Replace z.array(z.string()) scopes with z.array(z.nativeEnum(ScopeName)) - Replace z.string() identifierType with z.nativeEnum(IdentifierType) in preferences tools - Add @transcend-io/privacy-types dependency to mcp-server-admin and mcp-server-preferences * chore: add changeset for privacy-types enum additions * refactor: inline z.nativeEnum, remove shared schemas, enhance admin_create_api_key - Remove schemas.ts from mcp-server-consent and mcp-server-dsr; inline z.nativeEnum() directly in each tool file - Enrich admin_create_api_key tool description with TRANSCEND_SCOPES metadata (title, description, dependency info for every scope) * revert: keep identifierType as z.string() in preferences tools
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
@transcend-io/privacy-types(consentManager.ts):CookieOrderField,DataFlowOrderField,DataFlowType,TriageAction,ConsentTrackerTypez.nativeEnum()wrappers by creating sharedschemas.tsinmcp-server-consentandmcp-server-dsr(eliminates 6 duplicate definitions across tool files)z.string()with proper enums in tool input schemas:order_fieldin cookie/data flow list tools →CookieOrderField/DataFlowOrderFieldscopesinadmin_create_api_key→ScopeNameidentifierType/typein preferences tools →IdentifierTypestatusinassessments_create_template→AssessmentFormTemplateStatusaction/typeinconsent_bulk_triage→TriageAction/ConsentTrackerType@transcend-io/privacy-typesdependency tomcp-server-adminandmcp-server-preferencesTest plan
tsc --noEmit)mcp-serverpackage typechecks cleanMade with Cursor