Skip to content

Add configure-preference-upload CLI command#41

Open
michaelfarrell76 wants to merge 13 commits into
mainfrom
bencmbrook/configure-preference-upload
Open

Add configure-preference-upload CLI command#41
michaelfarrell76 wants to merge 13 commits into
mainfrom
bencmbrook/configure-preference-upload

Conversation

@michaelfarrell76
Copy link
Copy Markdown
Member

Summary

  • Adds a new transcend consent configure-preference-upload CLI command that interactively configures the column mapping for preference CSV uploads
  • Scans all CSV files in a directory to discover headers and unique values, then walks through a 6-step interactive wizard to build the full mapping config (identifiers, timestamps, purpose/preference value mappings, metadata columns)
  • The resulting config JSON is reusable by upload-preferences for fully non-interactive uploads

SDK additions

  • FileFormatState codec — schema-only file format type (identifiers, purposes, timestamps, metadata) without upload receipts
  • RequestUploadReceipts codec — upload receipt tracking type
  • getPreferenceIdentifiersFromRow — extracts identifiers from a CSV row given a column-to-identifier mapping
  • loadReferenceData — fetches purposes, preference topics, and identifiers from the org in parallel

CLI additions

  • configure-preference-upload command + implementation
  • parsePreferenceFileFormatFromCsv — interactive timestamp column selection using FileFormatState
  • parsePreferenceIdentifiersInteractive — multi-identifier column mapping with FileFormatState
  • parsePreferenceAndPurposeValuesInteractive — purpose/preference value mapping with FileFormatState

Test plan

  • Verify SDK and CLI build cleanly (pnpm run --dir packages/sdk build && pnpm run --dir packages/cli build)
  • Verify existing upload-preferences command still works (no breaking changes to existing types/exports)
  • Test transcend consent configure-preference-upload against a directory of CSV files

Made with Cursor

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 31, 2026

Open in StackBlitz

@transcend-io/cli

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

@transcend-io/privacy-types

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

@transcend-io/sdk

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

@transcend-io/utils

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

commit: c14769e

- FileFormatState codec (schema-only CSV column mapping)
- RequestUploadReceipts codec (upload progress tracking)
- loadReferenceData (fetches purposes, topics, identifiers in parallel)
- getPreferenceIdentifiersFromRow + getUniquePreferenceIdentifierNamesFromRow
- Tests for both identifier helpers

Made-with: Cursor
@michaelfarrell76 michaelfarrell76 force-pushed the bencmbrook/configure-preference-upload branch from d86e008 to 9261b61 Compare March 31, 2026 01:35
@michaelfarrell76 michaelfarrell76 changed the base branch from main to bencmbrook/sdk-preference-format-types March 31, 2026 01:35
Introduces a new interactive command for configuring the column mapping
for preference CSV uploads. Scans all CSV files in a directory to discover
headers and unique values, then walks through an interactive wizard to
build the full mapping config (identifiers, timestamps, purpose/preference
value mappings, metadata).

SDK additions:
- FileFormatState codec (schema-only file format, no upload receipts)
- RequestUploadReceipts codec
- getPreferenceIdentifiersFromRow helper
- loadReferenceData (fetches purposes, topics, identifiers in parallel)

CLI additions:
- configure-preference-upload command + implementation
- parsePreferenceFileFormatFromCsv (timestamp column selection)
- parsePreferenceIdentifiersInteractive (multi-identifier column mapping)
- parsePreferenceAndPurposeValuesInteractive (purpose/preference value mapping)

Made-with: Cursor
Extract getPreferenceIdentifiersFromRow and
getUniquePreferenceIdentifierNamesFromRow into their own modules.

Made-with: Cursor
@michaelfarrell76 michaelfarrell76 force-pushed the bencmbrook/configure-preference-upload branch from 9261b61 to 06f3f54 Compare March 31, 2026 01:53
…ions

- Import NONE_PREFERENCE_MAP from parsePreferenceTimestampsFromCsv instead of redefining
- Add @deprecated to parsePreferenceIdentifiersFromCsv (use parsePreferenceIdentifiersInteractive)
- Add @deprecated to parsePreferenceAndPurposeValuesFromCsv (use parsePreferenceAndPurposeValuesInteractive)
- Add @deprecated to parsePreferenceTimestampsFromCsv (use parsePreferenceFileFormatFromCsv)

Made-with: Cursor
Base automatically changed from bencmbrook/sdk-preference-format-types to main March 31, 2026 18:39
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