Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
uses: actions/setup-node@v3.7.0
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: |
rm -rf node_modules package-lock.json
npm i
- run: npm test
env:
TOKEN: ${{secrets.TOKEN}}
Expand Down
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fileignoreconfig:
ignore_detectors:
- filecontent
- filename: package-lock.json
checksum: c855b257f787ae58c64f68315bfcffaad9910f67a0b797bb7d3b1b7c225aabb4
checksum: 5bdaa34571226c6201c3b6fe2ff213180f0ce06b1afbc9565cb89e0562fb74db
- filename: .husky/pre-commit
checksum: 5baabd7d2c391648163f9371f0e5e9484f8fb90fa2284cfc378732ec3192c193
version: "1.0"
51 changes: 51 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Migrating from v2 to v3

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;
}
```
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ This library helps to generate TypeScript type definition for the content types

`$ npm install @contentstack/types-generator`


## Migration
Refer to the [Migration Guide](https://github.com/contentstack/types-generator/blob/main/MIGRATION.md) version 3 if you are migrating from version 2 or older.


## Usage

### In NodeJs
Expand Down
Loading