Skip to content

feat: add sync support for purposes, preferences, and consent workflow triggers#519

Open
michaelfarrell76 wants to merge 4 commits intomainfrom
michaelfarrell76/pull-prefs
Open

feat: add sync support for purposes, preferences, and consent workflow triggers#519
michaelfarrell76 wants to merge 4 commits intomainfrom
michaelfarrell76/pull-prefs

Conversation

@michaelfarrell76
Copy link
Member

Summary

  • Consent Workflow Triggers — new pullable/pushable resource (ConsentWorkflowTriggers). Adds enum, io-ts codec, GraphQL queries/mutations, paginated fetch, pull mapping, and sync function with name-based matching that resolves action-type, data-subject-type, and purpose tracking-type to IDs.
  • Purposes — adds push/sync support (previously pull-only). Matches by trackingType, calls createPurpose/updatePurpose mutations, and syncs nested preference topics via createOrUpdatePreferenceTopic.
  • Wiring — both resources are wired into pullTranscendConfiguration and syncConfigurationToTranscend. Scope mappings, YAML field name mappings, and docgen entries added.

Linear: https://linear.app/transcend/issue/EPD-11849

File changes

File Change
src/enums.ts Add ConsentWorkflowTriggers to TranscendPullResource
src/codecs.ts Add ConsentWorkflowTriggerInput codec + add to TranscendInput
src/constants.ts Add YML field name, pull scope, push scope mappings
src/lib/graphql/gqls/consentWorkflowTrigger.ts New — GraphQL query + mutations
src/lib/graphql/gqls/purpose.ts Add CREATE_PURPOSE, UPDATE_PURPOSE mutations
src/lib/graphql/gqls/preferenceTopic.ts Add CREATE_OR_UPDATE_PREFERENCE_TOPIC mutation
src/lib/graphql/fetchAllConsentWorkflowTriggers.ts New — paginated fetch
src/lib/graphql/syncConsentWorkflowTriggers.ts New — push/sync logic
src/lib/graphql/syncPurposes.ts New — push/sync for purposes + preference topics
src/lib/graphql/pullTranscendConfiguration.ts Add consent workflow triggers pull block
src/lib/graphql/syncConfigurationToTranscend.ts Wire up syncPurposes + syncConsentWorkflowTriggers
src/lib/docgen/createPullResourceScopesTable.ts Add docs entry for new resource
examples/consent-workflow-triggers.yml New — example YAML

Test plan

  • Pull consent workflow triggers: npx tr-pull --resources=consentWorkflowTriggers
  • Push consent workflow triggers from YAML: npx tr-push with consent-workflow-triggers in config
  • Pull purposes: npx tr-pull --resources=purposes (existing, verify unchanged)
  • Push purposes with preference topics: npx tr-push with purposes in config
  • Round-trip: pull → push → pull and verify equivalence for both resources
  • Verify new resource appears in generated docs table

Made with Cursor

michaelfarrell76 and others added 4 commits February 24, 2026 18:06
…w triggers

Adds full pull/push CLI support for:
- Consent Workflow Triggers (new resource): pull, push with name-based matching,
  resolves action-type/data-subject-type/purposes to IDs
- Purposes (previously pull-only): push via createPurpose/updatePurpose mutations,
  matched by trackingType, with nested preference topic sync
- Preference Topics: synced as nested children of purposes via
  createOrUpdatePreferenceTopic

Closes EPD-11849

Co-authored-by: Cursor <cursoragent@cursor.com>
The backend schema doesn't expose consentWorkflowTriggerPurposes as a
queryable field on ConsentWorkflowTrigger — it is only available as a
mutation input. Purposes can still be pushed but are not pulled.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Default triggerCondition to '{}' when not specified (fixes notNull violation)
- Two-step create for new triggers: create first, then attach purposes
- Add ViewDataSubjectRequestSettings and ViewConsentManager to push scopes
- Update example YAML with correct action-type, data-subject-type, and purposes

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant