Skip to content

Implemented preview token generation #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2025
Merged

Conversation

sunil-lakshman
Copy link
Contributor

No description provided.

@sunil-lakshman sunil-lakshman requested a review from a team as a code owner May 13, 2025 11:40
@sunil-lakshman sunil-lakshman requested review from aman19K, Copilot and harshithad0703 and removed request for a team May 13, 2025 11:41
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements preview token generation for delivery tokens. Key changes include:

  • Adding test assertions to verify that a preview_token is generated.
  • Updating the delivery token creation logic in both the DeliveryToken class and the entity module to include support for preview tokens.
  • Bumping the package version and updating the changelog accordingly.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/sanity-check/api/deliveryToken-test.js Added assertions to verify preview_token is not null in delivery token responses.
package.json Updated version number from 1.21.1 to 1.21.2.
lib/stack/deliveryToken/index.js Modified the create function call to include create_with_preview_token flag.
lib/entity.js Updated the create function to accept and merge a create_with_preview_token flag.
CHANGELOG.md Documented the enhancement related to preview token generation.

Copy link

github-actions bot commented May 13, 2025

Coverage report for commit: 64c04eb
File: coverage/clover.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  10% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  60% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  70% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  80% │ ██████████░░░░░░░░░░░░░ │ 20.4%
  90% │ ███████████████████████ │ 46.9%
 100% │ ████████████████░░░░░░░ │ 32.7%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution 
Summary - Lines: 89.12% | Methods: 98.58% | Branches: 72.38%
FilesLinesMethodsBranches
lib/app/authorization
   index.js91.67%100.00%72.09%
lib/app/hosting
   deployment.js85.29%100.00%65.79%
   index.js80.70%100.00%59.09%
lib/app
   index.js92.78%100.00%66.12%
lib/app/installation
   index.js84.62%100.00%59.55%
lib/app/request
   index.js91.43%100.00%65.85%
lib
   contentstack.js83.33%100.00%84.62%
   contentstackClient.js80.85%92.86%64.15%
   contentstackCollection.js94.12%100.00%93.33%
   entity.js82.98%100.00%68.39%
lib/core
   Util.js96.36%100.00%83.64%
   concurrency-queue.js86.01%87.18%76.00%
   contentstackError.js100.00%100.00%100.00%
   contentstackHTTPClient.js96.77%100.00%93.65%
   oauthHandler.js92.54%100.00%70.07%
lib/organization
   index.js83.33%100.00%60.67%
lib/organization/teams
   index.js92.11%100.00%68.42%
lib/organization/teams/stackRoleMappings
   index.js89.29%100.00%58.14%
lib/organization/teams/teamUsers
   index.js100.00%100.00%93.75%
lib/query
   index.js80.43%100.00%67.27%
lib/stack/asset/folders
   index.js100.00%100.00%100.00%
lib/stack/asset
   index.js93.06%100.00%81.18%
lib/stack/auditlog
   index.js95.83%100.00%75.00%
lib/stack/branch
   compare.js81.82%100.00%71.88%
   index.js97.44%100.00%80.56%
   mergeQueue.js100.00%100.00%73.68%
lib/stack/branchAlias
   index.js86.21%100.00%65.85%
lib/stack/contentType/entry
   index.js88.39%100.00%64.60%
lib/stack/contentType/entry/variants
   index.js86.21%100.00%68.57%
lib/stack/contentType
   index.js89.23%100.00%74.03%
lib/stack/deliveryToken
   index.js100.00%100.00%94.44%
lib/stack/environment
   index.js100.00%100.00%100.00%
lib/stack/extension
   index.js95.92%100.00%87.76%
lib/stack/globalField
   index.js94.59%100.00%82.22%
lib/stack
   index.js84.92%92.86%72.76%
lib/stack/label
   index.js100.00%100.00%100.00%
lib/stack/locale
   index.js100.00%100.00%100.00%
lib/stack/managementToken
   index.js100.00%100.00%94.44%
lib/stack/release
   index.js91.11%100.00%72.34%
lib/stack/roles
   index.js100.00%100.00%100.00%
lib/stack/taxonomy
   index.js88.00%100.00%64.52%
lib/stack/taxonomy/terms
   index.js92.31%100.00%72.55%
lib/stack/variantGroup
   index.js86.84%100.00%65.12%
lib/stack/variantGroup/variants
   index.js85.00%100.00%60.78%
lib/stack/variants
   index.js84.21%100.00%59.57%
lib/stack/webhook
   index.js89.66%100.00%72.88%
lib/stack/workflow
   index.js89.09%100.00%72.31%
lib/stack/workflow/publishRules
   index.js100.00%100.00%100.00%
lib/user
   index.js94.29%100.00%82.14%

🤖 comment via lucassabreu/comment-coverage-clover

@sunil-lakshman sunil-lakshman requested a review from aman19K May 14, 2025 04:50
@sunil-lakshman sunil-lakshman merged commit 7a5e905 into development May 14, 2025
13 checks passed
@sunil-lakshman sunil-lakshman deleted the Enh/dx-2922 branch May 14, 2025 05:09
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