Skip to content

🪪 [3/3] feat(cli)!: multi-identifier preference uploads - #702

Draft
michaelfarrell76 wants to merge 1 commit into
michaelfarrell76/pref-upload-cli-statefrom
michaelfarrell76/multi-identifier-preference-uploads
Draft

michaelfarrell76 wants to merge 1 commit into
michaelfarrell76/pref-upload-cli-statefrom
michaelfarrell76/multi-identifier-preference-uploads

Conversation

@michaelfarrell76

Copy link
Copy Markdown
Member

Note

⚠️ AI DRAFT Michael: review/edit, then delete this line
Preference uploads need to work with more than one identifier per row (email + phone), and the old single file flow can't do that. Going to test this on the pkg.pr.new preview build and run the e2e script against a staging partition before merging, then ship it as cli 14 / sdk 3.

Stack (replaces #11)

Step PR Merge base ← head
1/3 #700 main ← michaelfarrell76/pref-upload-sdk-building-blocks
2/3 #701 michaelfarrell76/pref-upload-sdk-building-blocks ← michaelfarrell76/pref-upload-cli-state
3/3 This PR michaelfarrell76/pref-upload-cli-state ← michaelfarrell76/multi-identifier-preference-uploads

Merge in order: #700 → #701 → this PR. This is the breaking change (CLI 14.0.0, SDK 3.0.0). Migration steps are in .changeset/multi-identifier-preference-uploads.md.

Summary

  • New transcend consent configure-preference-upload command. It scans every CSV in a directory and saves a reusable column-mapping config.
  • upload-preferences takes --directory only. It runs files in a worker pool, auto-chunks files over --chunkSizeMB, and writes per-file receipts.
  • SDK getPreferencesForIdentifiers requires identifier names, splits groups that fail validation, and reports { successDelta, successTotal, fileTotal } progress. FileMetadataState and PreferenceState are removed.

Changes vs #11

  • Rewrote both impl.ts files to use this.logger, this.fs, this.process, and createPoolingCommandUi. The configure CSV scanner moved to configure-preference-upload/helpers.ts.
  • Fixed duplicate uploads after auto-chunking. [cli] multi identifier preference record uploads #11 re-scanned the directory and queued the oversized original next to its chunks.
  • Fixed a missing config falling through to the upload after exit(1).
  • --uploadConcurrency default is 25, per the FIXME 25 in [cli] multi identifier preference record uploads #11 (it was 75).
  • Removed the dead --receiptFilepath flag and the --file wording in help text.
  • Kept the SDK logger optional with the NOOP_LOGGER default.
  • Dropped progress.ts and the receipt status field. Nothing read them.
  • NONE_PREFERENCE_MAP now comes from the SDK instead of a CLI copy.

Test plan

  • pnpm -F @transcend-io/sdk typecheck test build
  • pnpm -F @transcend-io/cli typecheck test build (worker bundle emitted at dist/commands/consent/upload-preferences/worker.mjs)
  • New tests: upload-preferences/tests/impl.test.ts (missing config, queue, dry run totals, chunking, regenerate, Ctrl+C exits 130) and configure-preference-upload/tests/helpers.test.ts
  • codebase.test.ts
  • Install the pkg.pr.new preview, then run configure-preference-upload against a staging partition
  • upload-preferences --dryRun, real upload, then a re-run that skips unchanged rows
  • A file over 11MB auto-chunks and uploads once
  • Ctrl+C exits 130, and --viewerMode works
  • TRANSCEND_API_KEY=… PARTITION=… bash packages/cli/scripts/e2e-test-upload-preferences.sh (now uses --directory, an email + phone config, and a re-run check)

…ence-upload

- upload-preferences: --directory only, parallel worker pool, auto-chunking,
  per-file receipts, requires a column-mapping config
- new consent configure-preference-upload command
- sdk: getPreferencesForIdentifiers requires identifier names, split-on-validation,
  new onProgress shape; drop FileMetadataState and PreferenceState
@pkg-pr-new

pkg-pr-new Bot commented Nov 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

@transcend-io/airgap.js-types

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

@transcend-io/cli

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

@transcend-io/custom-function-types

pnpm add https://pkg.pr.new/@transcend-io/custom-function-types@820c6f2
yarn add https://pkg.pr.new/@transcend-io/custom-function-types@820c6f2.tgz

@transcend-io/design-tokens

pnpm add https://pkg.pr.new/@transcend-io/design-tokens@820c6f2
yarn add https://pkg.pr.new/@transcend-io/design-tokens@820c6f2.tgz

@transcend-io/internationalization

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

@transcend-io/privacy-types

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

@transcend-io/sdk

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

@transcend-io/secret-value

pnpm add https://pkg.pr.new/@transcend-io/secret-value@820c6f2
yarn add https://pkg.pr.new/@transcend-io/secret-value@820c6f2.tgz

@transcend-io/type-utils

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

@transcend-io/utils

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

commit: 820c6f2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant