Skip to content

[cli] feat: add sync support for purposes, preferences, and consent workflow triggers#13

Draft
bencmbrook wants to merge 2 commits intomainfrom
bencmbrook/migrate-cli-pr-519
Draft

[cli] feat: add sync support for purposes, preferences, and consent workflow triggers#13
bencmbrook wants to merge 2 commits intomainfrom
bencmbrook/migrate-cli-pr-519

Conversation

@bencmbrook
Copy link
Copy Markdown
Member

@bencmbrook bencmbrook commented Mar 19, 2026

Port of transcend-io/cli#519

Summary

  • port the resource sync work from transcend-io/cli#519 into packages/cli, including new pull/push wiring for purposes, preference options, and consent workflow triggers
  • add the supporting GraphQL queries, paginated fetchers, sync helpers, enum/codec/constants wiring, and an example consent-workflow-triggers.yml
  • regenerate the CLI README and transcend-yml schema outputs, and add a minor changeset for the new sync capability

Test plan

  • pnpm -F @transcend-io/cli genfiles
  • pnpm -F @transcend-io/cli typecheck
  • pnpm -F @transcend-io/cli build
  • pnpm -F @transcend-io/cli test
  • pnpm -F @transcend-io/cli check-exports
  • pnpm quality

Made with Cursor

Port the legacy CLI work for purposes, preference options, and consent workflow triggers into the monorepo, including the new GraphQL sync helpers, resource wiring, generated docs, and schema updates.

Made-with: Cursor
@bencmbrook bencmbrook changed the title Add CLI sync support for purposes and consent workflow triggers [cli] feat: add sync support for purposes, preferences, and consent workflow triggers Mar 19, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 19, 2026

Open in StackBlitz

npm i https://pkg.pr.new/transcend-io/tools/@transcend-io/cli@13
npm i https://pkg.pr.new/transcend-io/tools/@transcend-io/core@13
npm i https://pkg.pr.new/transcend-io/tools/@transcend-io/utils@13

commit: 72b8fb1

@bencmbrook
Copy link
Copy Markdown
Member Author

Below is a migration summary for CLI PR #519. This reflects the final state of that branch, including the later preferenceOptions work that was added on top of the original PR description.

Area Original PR scope Monorepo result What changed in the port
Resource enum surface src/enums.ts packages/cli/src/enums.ts Added PreferenceOptions and ConsentWorkflowTriggers to TranscendPullResource.
YAML field + scope mapping src/constants.ts packages/cli/src/constants.ts Added pull/push scope mappings and YAML field name mappings for preference-options and consent-workflow-triggers.
Input codecs src/codecs.ts packages/cli/src/codecs.ts Added ConsentWorkflowTriggerInput, and added 'consent-workflow-triggers' plus 'preference-options' to TranscendInput.
Pull docs metadata src/lib/docgen/createPullResourceScopesTable.ts packages/cli/src/lib/docgen/createPullResourceScopesTable.ts Updated the generated pull resource scopes table so the new resources appear in docs.
GraphQL definitions src/lib/graphql/gqls/consentWorkflowTrigger.ts, gqls/purpose.ts, gqls/preferenceTopic.ts, gqls/index.ts Same files under packages/cli/src/lib/graphql/gqls/ Added the consent workflow trigger query/mutation, plus purpose create/update and preference-topic create/update mutations, and exported them from the GQL index.
New fetch helpers src/lib/graphql/fetchAllConsentWorkflowTriggers.ts, fetchAllPreferenceOptionValues.ts Same files under packages/cli/src/lib/graphql/ Ported the paginated fetchers used by pull and sync.
Pull wiring src/lib/graphql/pullTranscendConfiguration.ts packages/cli/src/lib/graphql/pullTranscendConfiguration.ts Wired pull support for purposes, preference-options, and consent-workflow-triggers.
Push wiring src/lib/graphql/syncConfigurationToTranscend.ts packages/cli/src/lib/graphql/syncConfigurationToTranscend.ts Wired sync support for preference-options, purposes, and consent-workflow-triggers, in the correct dependency order.
Purpose sync implementation src/lib/graphql/syncPurposes.ts packages/cli/src/lib/graphql/syncPurposes.ts Added create/update sync keyed by trackingType; syncs nested preference topics and resolves option value slugs to IDs before mutation.
Preference option sync implementation src/lib/graphql/syncPreferenceOptionValues.ts packages/cli/src/lib/graphql/syncPreferenceOptionValues.ts Added bulk create/update sync keyed by slug for standalone preference option values.
Consent workflow trigger sync implementation src/lib/graphql/syncConsentWorkflowTriggers.ts packages/cli/src/lib/graphql/syncConsentWorkflowTriggers.ts Added name-based trigger sync that resolves action-type, data-subject-type, and purpose tracking-type to IDs. It also preserves the source PR’s fixes: default trigger-condition to '{}', and do a second mutation to attach purposes on newly created triggers.
Example config examples/consent-workflow-triggers.yml packages/cli/examples/consent-workflow-triggers.yml Ported the example YAML into the monorepo example directory.
GraphQL export surface src/lib/graphql/index.ts packages/cli/src/lib/graphql/index.ts Re-exported the new fetch/sync helpers so the rest of the CLI can use them.
Generated docs not directly tracked in old PR file list packages/cli/README.md Regenerated from the updated docgen/codecs in monorepo style instead of hand-copying README changes.
Generated schemas not directly tracked in old PR file list packages/cli/schema/transcend-yml-schema-latest.json, packages/cli/schema/transcend-yml-schema-v9.json Regenerated because the CLI input schema changed.
Release metadata not present in old standalone PR .changeset/tame-years-pull.md Added a monorepo-native Changesets entry so the feature can release correctly here.
Monorepo adaptation all migrated TS files all migrated TS files under packages/cli Normalized relative imports to the monorepo’s .js specifier convention and kept everything inside packages/cli without touching repo-wide config.

Dropped Or Intentionally Not Carried Over

Item Original location Status Why
test-pull-triggers.yml repo root in old cli repo Dropped It was just {} and looked like scratch/test data rather than a real example, fixture, or runtime input. It did not fit the monorepo layout and had no wiring in the CLI package.
Any other functional source files from the PR branch various Not dropped All meaningful runtime code from the final branch state was ported. That includes the later preferenceOptions additions that were present on the branch, even though they were broader than the original Feb 25 PR summary in CLI PR #519.

@bencmbrook bencmbrook marked this pull request as draft March 29, 2026 03:18
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.

2 participants