Skip to content

Commit 1d89f19

Browse files
Merge branch 'staging' into fix/upgrade-types-gen-package
2 parents cae0135 + c41c71f commit 1d89f19

File tree

6 files changed

+1677
-842
lines changed

6 files changed

+1677
-842
lines changed

.github/workflows/policy-scan.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,23 @@ jobs:
2424
- uses: actions/checkout@master
2525
- name: Checks for License file
2626
run: |
27-
if ! [[ -f "LICENSE" || -f "License.txt" || -f "LICENSE.md" ]]; then exit 1; fi
27+
expected_license_files=("LICENSE" "LICENSE.txt" "LICENSE.md" "License.txt")
28+
license_file_found=false
29+
current_year=$(date +"%Y")
30+
31+
for license_file in "${expected_license_files[@]}"; do
32+
if [ -f "$license_file" ]; then
33+
license_file_found=true
34+
# check the license file for the current year, if not exists, exit with error
35+
if ! grep -q "$current_year" "$license_file"; then
36+
echo "License file $license_file does not contain the current year."
37+
exit 2
38+
fi
39+
break
40+
fi
41+
done
42+
43+
if [ "$license_file_found" = false ]; then
44+
echo "No license file found. Please add a license file to the repository."
45+
exit 1
46+
fi

.github/workflows/secrets-scan.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Secrets Scan
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
security-secrets:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: '2'
12+
ref: '${{ github.event.pull_request.head.ref }}'
13+
- run: |
14+
git reset --soft HEAD~1
15+
- name: Install Talisman
16+
run: |
17+
# Download Talisman
18+
wget https://github.com/thoughtworks/talisman/releases/download/v1.37.0/talisman_linux_amd64 -O talisman
19+
20+
# Checksum verification
21+
checksum=$(sha256sum ./talisman | awk '{print $1}')
22+
if [ "$checksum" != "8e0ae8bb7b160bf10c4fa1448beb04a32a35e63505b3dddff74a092bccaaa7e4" ]; then exit 1; fi
23+
24+
# Make it executable
25+
chmod +x talisman
26+
- name: Run talisman
27+
run: |
28+
# Run Talisman with the pre-commit hook
29+
./talisman --githook pre-commit

.talismanrc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
fileignoreconfig:
2-
- filename: lib/commands/tsgen.js
3-
checksum: 02bab20fef5508565dbf38b5c12192c48ec27249b89d48c70303abaae17984ce
4-
- filename: package-lock.json
5-
checksum: f69fb633369ac69c08b707b17c96fffb89198944fae8d6f6bcf590bda960f26a
2+
- filename: .github/workflows/secrets-scan.yml
3+
ignore_detectors:
4+
- filecontent
5+
- filename: lib/commands/tsgen.js
6+
checksum: 02bab20fef5508565dbf38b5c12192c48ec27249b89d48c70303abaae17984ce
7+
- filename: package-lock.json
8+
checksum: e7ea94799c4afab6e55935c79ac40d3cac38e2ce6e9882dbd4c2e5a3c551e087
69
version: "1.0"

MIGRATION.md

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,61 @@
1+
## Migrating from v3 to v4
2+
3+
This changelog documents a breaking change to the `ISystemFields` interface, specifically related to the `publish_details` field.
4+
5+
## What Changed
6+
7+
The `publish_details` field is no longer an array of objects. It is now represented as a single `IPublishDetails` object.
8+
9+
This update aligns the generated types with the actual [Contentstack API](https://www.contentstack.com/docs/developers/apis/content-delivery-api) response.
10+
11+
## Before
12+
13+
```typescript
14+
export interface ISystemFields {
15+
uid?: string;
16+
created_at?: string;
17+
updated_at?: string;
18+
created_by?: string;
19+
updated_by?: string;
20+
_content_type_uid?: string;
21+
tags?: string[];
22+
ACL?: any[];
23+
_version?: number;
24+
_in_progress?: boolean;
25+
locale?: string;
26+
publish_details?: IPublishDetails[]; // Incorrect: Array of IPublishDetails
27+
title?: string;
28+
}
29+
```
30+
31+
## After
32+
33+
```typescript
34+
export interface ISystemFields {
35+
uid?: string;
36+
created_at?: string;
37+
updated_at?: string;
38+
created_by?: string;
39+
updated_by?: string;
40+
_content_type_uid?: string;
41+
tags?: string[];
42+
ACL?: any[];
43+
_version?: number;
44+
_in_progress?: boolean;
45+
locale?: string;
46+
publish_details?: IPublishDetails; // Corrected: Single IPublishDetails object
47+
title?: string;
48+
}
49+
```
50+
51+
---
52+
153
## Migrating from v2 to v3
54+
255
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.
356

4-
## Before
57+
## Before
58+
559
```typescript
660
export interface Test {
761
/** Version */
@@ -27,8 +81,8 @@ export interface Test {
2781
}
2882
```
2983

30-
3184
## After
85+
3286
```typescript
3387
export interface Test {
3488
/** Version */
@@ -39,7 +93,6 @@ export interface Test {
3993
modular_blocks?: ModularBlocks[];
4094
}
4195

42-
4396
export interface ModularBlocks {
4497
/** Multi Line Textbox */
4598
multi_line?: string;
@@ -53,4 +106,4 @@ export interface ModularBlocks1 {
53106
/** Multi Line Textbox */
54107
multi_line?: string;
55108
}
56-
```
109+
```

0 commit comments

Comments
 (0)