Skip to content

Conversation

cs-raj
Copy link
Contributor

@cs-raj cs-raj commented Sep 25, 2023

Version Bump: 2.1.7
This PR is for issue: #7

@cs-raj cs-raj marked this pull request as ready for review September 26, 2023 12:05
@petedegraw
Copy link

Hi @cs-raj, is it possible to update this to include all the properties that come through from the API response?

I'm seeing more than _content_type_uid and _version`. Maybe these are unique to our content but we're already needing to convert undefined to null in order to serialize for JSON on static page builds (could be a future improvement to the TSGen script). In addition, we have to add these types, not sure why they aren't included in the type definitions.

_content_type_uid: string,
_version: number,
locale: string,
uid: TUID,
ACL: Record<string, any>,
_in_progress: boolean,
created_at: string,
created_by: TUID,
updated_at: string,
updated_by: TUID,
publish_details: {
  environment: TUID,
  locale: string,
  time: string,
  user: TUID
},
tags: TTags,
title: string

@antonyagustine
Copy link
Contributor

Hi @cs-raj, is it possible to update this to include all the properties that come through from the API response?

I'm seeing more than _content_type_uid and _version`. Maybe these are unique to our content but we're already needing to convert undefined to null in order to serialize for JSON on static page builds (could be a future improvement to the TSGen script). In addition, we have to add these types, not sure why they aren't included in the type definitions.

_content_type_uid: string,
_version: number,
locale: string,
uid: TUID,
ACL: Record<string, any>,
_in_progress: boolean,
created_at: string,
created_by: TUID,
updated_at: string,
updated_by: TUID,
publish_details: {
  environment: TUID,
  locale: string,
  time: string,
  user: TUID
},
tags: TTags,
title: string

Hi @petedegraw,

Thank you for bringing this to our attention. We have already taken this as a task, and our team is currently working on enhancing it to include the system fields. We will do our best to roll it out as soon as possible.

@petedegraw
Copy link

@antonyagustine that's fantastic! The code gen has proven quite useful. Thanks for the reply.

@netrajpatel netrajpatel changed the base branch from master to development October 4, 2023 13:42
@netrajpatel netrajpatel merged commit e09a77c into development Oct 4, 2023
@netrajpatel netrajpatel deleted the bugfix/CS-41248 branch October 4, 2023 13:43
@AniketDev7
Copy link

Hi @petedegraw We have now added support in tsgen plugin to include system fields in typings. You can use --include-system-fields flag for system fields.

@petedegraw
Copy link

petedegraw commented Oct 31, 2023

This is great! Thanks @AniketDev7

Should publish_details be ICSPublishDetails instead ICSPublishDetails[]

@abhinav-from-contentstack
Copy link
Contributor

Hi @petedegraw , publish_details is always an array of objects. That's why it's type is always <prefix>PublishDetails[].

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.

7 participants