Skip to content

feat(cli): add consent-workflow-triggers pull and push#281

Open
michaelfarrell76 wants to merge 11 commits into
mainfrom
michaelfarrell76/pull-consent-workflow-triggers
Open

feat(cli): add consent-workflow-triggers pull and push#281
michaelfarrell76 wants to merge 11 commits into
mainfrom
michaelfarrell76/pull-consent-workflow-triggers

Conversation

@michaelfarrell76

@michaelfarrell76 michaelfarrell76 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Adds top-level consent-workflow-triggers for consent automation triggers that fire DSR actions when consent state matches (Preferences → Consent Workflows).

  • SDK: fetchAllConsentWorkflowTriggers, syncConsentWorkflowTriggers
  • CLI: ConsentWorkflowTriggerInput codec, pull resource, push sync
  • Example: packages/cli/examples/consent-workflow-triggers.yml
  • Purposes are the source of truthtriggerCondition is derived on push as { And: [{ [tracking-type]: matching-state }, ...] } (same as admin UI). YAML does not accept/emit trigger-condition.

Base branch: main

Required scopes

Operation Scopes
Pull ViewPreferenceStoreSettings
Push ManagePreferenceStoreSettings, ViewDataSubjectRequestSettings, ViewConsentManager, ViewDataMap

Push related fetches: actions/subjects (ViewDataSubjectRequestSettings), purposes (ViewConsentManager), data silos when data-silo-titles present (ViewDataMap).

Admin UI: https://app.transcend.io/preference-store/consent-workflows

Test plan

Manual — pull existing triggers

export TRANSCEND_URL=https://multi-tenant.synthetics.transcend.io
export TRANSCEND_API_KEY=... # ViewPreferenceStoreSettings

pnpm exec transcend inventory pull \
  --resources consentWorkflowTriggers \
  --file ./pulled-triggers.yml \
  --auth "$TRANSCEND_API_KEY" \
  --transcendUrl "$TRANSCEND_URL"

Expected YAML shape:

consent-workflow-triggers:
  - name: MarketingOptOutErasure
    action-type: ERASURE
    data-subject-type: Customer
    is-silent: false
    allow-unauthenticated: false
    is-active: true
    data-silo-titles:
      - Salesforce CRM
    purposes:
      - tracking-type: Marketing
        matching-state: false

Manual — push from example

cp packages/cli/examples/consent-workflow-triggers.yml ./test-triggers.yml
# Edit: use action-type + data-subject-type that exist in your org
# Edit: data-silo-titles must match existing data silo titles exactly
# Edit: purposes[].tracking-type must match an existing purpose slug

pnpm exec transcend inventory push \
  --file ./test-triggers.yml \
  --auth "$TRANSCEND_API_KEY" \
  --transcendUrl "$TRANSCEND_URL"

Expected: success; re-pull shows purposes preserved (no trigger-condition key).

Negative — missing purposes / create fields

consent-workflow-triggers:
  - name: BadTrigger
    action-type: ERASURE
    data-subject-type: Customer

Expected: push fails with clear error requiring non-empty purposes.

consent-workflow-triggers:
  - name: NewTrigger
    purposes:
      - tracking-type: Marketing
        matching-state: false

Expected: push fails requiring action-type and data-subject-type on create.

Made with Cursor

@pkg-pr-new

pkg-pr-new Bot commented Jul 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

@transcend-io/airgap.js-types

pnpm add https://pkg.pr.new/@transcend-io/airgap.js-types@281
yarn add https://pkg.pr.new/@transcend-io/airgap.js-types@281.tgz

@transcend-io/cli

pnpm add https://pkg.pr.new/@transcend-io/cli@281
yarn add https://pkg.pr.new/@transcend-io/cli@281.tgz

@transcend-io/internationalization

pnpm add https://pkg.pr.new/@transcend-io/internationalization@281
yarn add https://pkg.pr.new/@transcend-io/internationalization@281.tgz

@transcend-io/privacy-types

pnpm add https://pkg.pr.new/@transcend-io/privacy-types@281
yarn add https://pkg.pr.new/@transcend-io/privacy-types@281.tgz

@transcend-io/sdk

pnpm add https://pkg.pr.new/@transcend-io/sdk@281
yarn add https://pkg.pr.new/@transcend-io/sdk@281.tgz

@transcend-io/type-utils

pnpm add https://pkg.pr.new/@transcend-io/type-utils@281
yarn add https://pkg.pr.new/@transcend-io/type-utils@281.tgz

@transcend-io/utils

pnpm add https://pkg.pr.new/@transcend-io/utils@281
yarn add https://pkg.pr.new/@transcend-io/utils@281.tgz

@transcend-io/mcp

pnpm add https://pkg.pr.new/@transcend-io/mcp@281
yarn add https://pkg.pr.new/@transcend-io/mcp@281.tgz

@transcend-io/mcp-server-admin

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-admin@281
yarn add https://pkg.pr.new/@transcend-io/mcp-server-admin@281.tgz

@transcend-io/mcp-server-assessment

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-assessment@281
yarn add https://pkg.pr.new/@transcend-io/mcp-server-assessment@281.tgz

@transcend-io/mcp-server-base

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-base@281
yarn add https://pkg.pr.new/@transcend-io/mcp-server-base@281.tgz

@transcend-io/mcp-server-consent

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-consent@281
yarn add https://pkg.pr.new/@transcend-io/mcp-server-consent@281.tgz

@transcend-io/mcp-server-discovery

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-discovery@281
yarn add https://pkg.pr.new/@transcend-io/mcp-server-discovery@281.tgz

@transcend-io/mcp-server-docs

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-docs@281
yarn add https://pkg.pr.new/@transcend-io/mcp-server-docs@281.tgz

@transcend-io/mcp-server-dsr

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-dsr@281
yarn add https://pkg.pr.new/@transcend-io/mcp-server-dsr@281.tgz

@transcend-io/mcp-server-inventory

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-inventory@281
yarn add https://pkg.pr.new/@transcend-io/mcp-server-inventory@281.tgz

@transcend-io/mcp-server-preferences

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-preferences@281
yarn add https://pkg.pr.new/@transcend-io/mcp-server-preferences@281.tgz

@transcend-io/mcp-server-workflows

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-workflows@281
yarn add https://pkg.pr.new/@transcend-io/mcp-server-workflows@281.tgz

commit: 4cdb898

Base automatically changed from michaelfarrell76/push-sync-result to main July 8, 2026 04:38
michaelfarrell76 and others added 2 commits July 7, 2026 21:42
Add consent-workflow-triggers top-level field with SDK fetch/sync,
tr-pull resource, and tr-push sync for consent automation triggers.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@michaelfarrell76 michaelfarrell76 force-pushed the michaelfarrell76/pull-consent-workflow-triggers branch from 5b3c96e to 019e353 Compare July 8, 2026 04:44
@michaelfarrell76 michaelfarrell76 marked this pull request as ready for review July 8, 2026 04:49
giacaglia
giacaglia previously approved these changes Jul 8, 2026
Resolve conflicts by keeping both consent-workflow-triggers and
preference-options pull/push support.
Derive triggerCondition from purposes (admin UI shape), drop YAML
trigger-condition, fix pull round-trip, and use View/Manage Preference
Store Settings scopes.
Comment thread packages/cli/examples/consent-workflow-triggers.yml Outdated
Comment thread packages/cli/src/lib/docgen/createPullResourceScopesTable.ts Outdated
Comment thread packages/cli/README.md Outdated
Use CONTACT_OPT_OUT/IN in the example, rename nav to Workflows → Preference Workflows, and restore the integrations dashboard link.
Comment thread packages/cli/README.md
Comment thread packages/sdk/src/consent/syncConsentWorkflowTriggers.ts Outdated
Comment thread packages/sdk/src/consent/syncConsentWorkflowTriggers.ts
Comment thread packages/sdk/src/consent/syncConsentWorkflowTriggers.ts
Restore the integrations Manage-at URL, type action-type as RequestAction
in the codec and SDK, and expand unit coverage for triggerCondition parsing.
Allow consent-workflow-triggers to link a DSR workflow via workflow-title
while keeping legacy action-type / data-silo-titles mode mutually exclusive.
Comment thread packages/cli/README.md Outdated
Docgen was run with TRANSCEND_API_KEY exported, which leaked the key into
generated --auth [default = ...] help text. Regenerate without that env.
request approve export checks can exceed the default 5s under load;
bump the leaf-export suite timeout so pre-push is not flaky.
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