Skip to content

back merge #196

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 24 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2291831
Merge pull request #186 from contentstack/staging
shafeeqd959 Apr 16, 2025
0429b4b
policy-scan.yml
aravindbuilt Apr 23, 2025
86ca413
[DX-2403], major version bump
Apr 29, 2025
9e98508
[DX-2403], added version bump
Apr 29, 2025
5b50793
policy-scan.yml
aravindbuilt May 5, 2025
be049e4
issues-jira.yml
aravindbuilt May 5, 2025
ebec585
secrets-scan.yml
aravindbuilt May 5, 2025
2decedb
Updated codeowners
aravindbuilt May 5, 2025
e84e177
talismanrc file updated
aravindbuilt May 5, 2025
b2971dd
updated the migration doc
May 9, 2025
7ca7cc6
Merge branch 'master' into fix/DX-2403
May 9, 2025
863a58d
upgraded type-gen package
May 12, 2025
8a173be
upgrade types-generator package
harshithad0703 May 12, 2025
5bde1d1
update checksum for package-lock.json in .talismanrc
harshithad0703 May 12, 2025
3eb1513
Merge pull request #192 from contentstack/update/patch
harshithad0703 May 12, 2025
f52dcbf
Merge branch 'master' into fix/DX-2403
harshithad0703 May 12, 2025
f193510
update checksum for package-lock.json in .talismanrc
harshithad0703 May 12, 2025
46865ae
Merge pull request #190 from contentstack/fix/DX-2403
harshithad0703 May 12, 2025
c41c71f
Merge pull request #193 from contentstack/master
harshithad0703 May 13, 2025
1d89f19
Merge branch 'staging' into fix/upgrade-types-gen-package
harshithad0703 May 19, 2025
bf0d668
bump version to 4.0.1 and update types-generator dependency to 3.0.1
harshithad0703 May 19, 2025
dd8e3b3
update checksum for package-lock.json in .talismanrc
harshithad0703 May 19, 2025
46c0d4b
Merge pull request #194 from contentstack/fix/upgrade-types-gen-package
harshithad0703 May 19, 2025
68163f9
Merge pull request #195 from contentstack/master
harshithad0703 May 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/policy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,23 @@ jobs:
- uses: actions/checkout@master
- name: Checks for License file
run: |
if ! [[ -f "LICENSE" || -f "License.txt" || -f "LICENSE.md" ]]; then exit 1; fi
expected_license_files=("LICENSE" "LICENSE.txt" "LICENSE.md" "License.txt")
license_file_found=false
current_year=$(date +"%Y")

for license_file in "${expected_license_files[@]}"; do
if [ -f "$license_file" ]; then
license_file_found=true
# check the license file for the current year, if not exists, exit with error
if ! grep -q "$current_year" "$license_file"; then
echo "License file $license_file does not contain the current year."
exit 2
fi
break
fi
done

if [ "$license_file_found" = false ]; then
echo "No license file found. Please add a license file to the repository."
exit 1
fi
29 changes: 29 additions & 0 deletions .github/workflows/secrets-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Secrets Scan
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
security-secrets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '2'
ref: '${{ github.event.pull_request.head.ref }}'
- run: |
git reset --soft HEAD~1
- name: Install Talisman
run: |
# Download Talisman
wget https://github.com/thoughtworks/talisman/releases/download/v1.37.0/talisman_linux_amd64 -O talisman

# Checksum verification
checksum=$(sha256sum ./talisman | awk '{print $1}')
if [ "$checksum" != "8e0ae8bb7b160bf10c4fa1448beb04a32a35e63505b3dddff74a092bccaaa7e4" ]; then exit 1; fi

# Make it executable
chmod +x talisman
- name: Run talisman
run: |
# Run Talisman with the pre-commit hook
./talisman --githook pre-commit
11 changes: 7 additions & 4 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
fileignoreconfig:
- filename: lib/commands/tsgen.js
checksum: 02bab20fef5508565dbf38b5c12192c48ec27249b89d48c70303abaae17984ce
- filename: package-lock.json
checksum: f69fb633369ac69c08b707b17c96fffb89198944fae8d6f6bcf590bda960f26a
- filename: .github/workflows/secrets-scan.yml
ignore_detectors:
- filecontent
- filename: lib/commands/tsgen.js
checksum: 02bab20fef5508565dbf38b5c12192c48ec27249b89d48c70303abaae17984ce
- filename: package-lock.json
checksum: 1f1a4fadf906f4cb5749dc61b782a87fddafcc56dcc6e5b17449e77ca4eb39da
version: "1.0"
61 changes: 57 additions & 4 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,61 @@
## Migrating from v3 to v4

This changelog documents a breaking change to the `ISystemFields` interface, specifically related to the `publish_details` field.

## What Changed

The `publish_details` field is no longer an array of objects. It is now represented as a single `IPublishDetails` object.

This update aligns the generated types with the actual [Contentstack API](https://www.contentstack.com/docs/developers/apis/content-delivery-api) response.

## Before

```typescript
export interface ISystemFields {
uid?: string;
created_at?: string;
updated_at?: string;
created_by?: string;
updated_by?: string;
_content_type_uid?: string;
tags?: string[];
ACL?: any[];
_version?: number;
_in_progress?: boolean;
locale?: string;
publish_details?: IPublishDetails[]; // Incorrect: Array of IPublishDetails
title?: string;
}
```

## After

```typescript
export interface ISystemFields {
uid?: string;
created_at?: string;
updated_at?: string;
created_by?: string;
updated_by?: string;
_content_type_uid?: string;
tags?: string[];
ACL?: any[];
_version?: number;
_in_progress?: boolean;
locale?: string;
publish_details?: IPublishDetails; // Corrected: Single IPublishDetails object
title?: string;
}
```

---

## Migrating from v2 to v3

This document outlines the necessary changes to separate nested modular blocks into distinct interfaces. This update will affect how modular blocks are structured and used throughout the codebase.

## Before
## Before

```typescript
export interface Test {
/** Version */
Expand All @@ -27,8 +81,8 @@ export interface Test {
}
```


## After

```typescript
export interface Test {
/** Version */
Expand All @@ -39,7 +93,6 @@ export interface Test {
modular_blocks?: ModularBlocks[];
}


export interface ModularBlocks {
/** Multi Line Textbox */
multi_line?: string;
Expand All @@ -53,4 +106,4 @@ export interface ModularBlocks1 {
/** Multi Line Textbox */
multi_line?: string;
}
```
```
Loading
Loading