Skip to content

fixed management token support in export query, fixed mapping of asse…#156

Merged
shafeeqd959 merged 4 commits into
developmentfrom
fix/query-export
May 22, 2026
Merged

fixed management token support in export query, fixed mapping of asse…#156
shafeeqd959 merged 4 commits into
developmentfrom
fix/query-export

Conversation

@shafeeqd959
Copy link
Copy Markdown
Contributor

@shafeeqd959 shafeeqd959 commented May 21, 2026

Summary

Fixes two issues in the query export / import flow on branch fix/query-export:

  • Management token auth in query export — When exporting via a management token, the CLI was passing the token value to -a instead of the stack alias. The alias from --alias is now stored on QueryExportConfig and passed to the underlying export command, so auth works correctly with management tokens.
  • Asset URLs in plain text fields — During import, asset URL discovery only ran for text fields with markdown/rich_text metadata. URLs in plain text fields were skipped. findFileUrls is now invoked once on the full entry so asset URLs are collected regardless of schema shape.

Changes

Package | File | Change -- | -- | -- contentstack-query-export | config-handler.ts, types/index.ts | Persist alias from CLI flags contentstack-query-export | module-exporter.ts | Use alias (not managementToken) for -a when token auth is used contentstack-import | asset-helper.ts | Unconditional findFileUrls scan after schema-based lookup

Test plan

  •  Run query export with --alias <alias> and management token; confirm export completes and uses the correct stack alias (not the raw token) in the spawned export CLI.
  •  Export entries that reference assets via plain text fields (no markdown/rich text metadata).
  •  Import those entries and verify asset URLs in plain text fields are mapped and assets resolve correctly.
  •  Regression: export/import with markdown/rich text fields still maps assets as before.
  •  Regression: export with explicit -a / alias option in module options still behaves as expected.

@github-actions
Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@shafeeqd959 shafeeqd959 marked this pull request as ready for review May 21, 2026 04:53
@shafeeqd959 shafeeqd959 requested a review from a team as a code owner May 21, 2026 04:53
@github-actions
Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions
Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions
Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

Copy link
Copy Markdown
Contributor

@sunil-lakshman sunil-lakshman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shafeeqd959 shafeeqd959 merged commit 3c9eff7 into development May 22, 2026
9 checks passed
@shafeeqd959 shafeeqd959 deleted the fix/query-export branch May 22, 2026 10:46
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.

3 participants