Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

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

Closed
michaelfarrell76 wants to merge 6 commits intomainfrom
michaelfarrell76/pull-prefs
Closed

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

Conversation

@michaelfarrell76
Copy link
Copy Markdown
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>
michaelfarrell76 and others added 2 commits March 18, 2026 14:51
- Add preferenceOptions as standalone pull/push resource with paginated
  fetch, bulk create/update sync, GQL queries, scope maps, and docgen
- Replace simple syncPurposes with concurrent version that resolves
  preference option value slugs to IDs and extracts reusable
  createOrUpdatePreferenceTopics helper

Made-with: Cursor
@bencmbrook
Copy link
Copy Markdown
Member

Migrated to transcend-io/tools#13

@bencmbrook bencmbrook closed this Mar 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants