Skip to content
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

with_slug missing in types in Management API (also others params missing) #528

Open
marckraw opened this issue Apr 12, 2023 · 13 comments
Open
Labels
bug Something isn't working p3-significant [Priority] Moderate issues, major enhancements

Comments

@marckraw
Copy link


Expected Behavior

Documentation for management api and delivery api should be in sync with actual storyblok-js-client and its typescript types.
If it's not, its hard to understand what is the current API.

Current Behavior

https://www.storyblok.com/docs/api/management#core-resources/stories/retrieve-multiple-stories

Documentation said that i can use with_slug param, but it looks like types are not aware of that:
CleanShot 2023-04-12 at 09 39 15@2x

Other params not existing in type:

  • text_search
  • contain_component
  • pinned
  • by_ids
  • folder_only
  • story_only
  • with_parent
  • with_slug
  • search
  • in_release
  • is_published

It looks like, it is just type problem, becasue when I do it with @ts-ignore:

const storiesWithoutContent: any = await sbApi
        .get(`spaces/${spaceId}/stories/`, {
            per_page: 100,
            // @ts-ignore
            with_slug: 'folder/story-inside-folder'
        })
        .then((res: any) => res.data.stories)
        .catch((err: any) => console.error(err));

than it returns filtered result.

Steps to Reproduce

Just create a repo with [email protected], use typescript, and try to make request with with_slug param.

@marckraw
Copy link
Author

marckraw commented Apr 12, 2023

well, didn't realize that i've created duplicated of this #477 🤦🏻 documented others missing types, so I guess will not close it yet :P

@marckraw
Copy link
Author

Actually not a duplicate, but also about types, but this time the missing types for params not a result.

@thiagosaife
Copy link

@marckraw Hello, sir. We have an open pull request ready to be QA'd that solves this issues. I'll keep you posted here. Thanks for the heads up.

@javierdebug
Copy link

Hey, in the end, this wasn't resolved. I had issues with that; the solution was to use .js instead of .ts. Are there any updates about it?

@thiagosaife
Copy link

@javierdebug Not yet, sir. We'll close this issue when done. I'll keep you posted here.

@rasmusbe
Copy link

Any news about getting correct types for the Management API Client?

@thiagosaife
Copy link

@rasmusbe Yes, pull request is opened extending all these missing types. Keep you posted.

@thiagosaife
Copy link

@rasmusbe Please, try out the latest version. I'll close this thread, but feel free to re open it if this wasn't solved.

@rasmusbe
Copy link

I need to try it more next week when I'm back at work I tried it quickly and it seems like the put and post input parameters and response is still wrong.

image

@rasmusbe
Copy link

And I dont seems to be able to reopen the issue

@thiagosaife
Copy link

thiagosaife commented Jan 26, 2024

@rasmusbe That's weird. post and put they have ISbStoriesParams as their interface to params, which was extended with the missing types. Can you please share a test case when you have the time? Please do not share any sensitive data.

@thiagosaife thiagosaife reopened this Jan 26, 2024
@rasmusbe
Copy link

rasmusbe commented Apr 2, 2024

I'm sorry for the delay. i haven't had the time to do a test case but here's some stuff I found:

  • Slug is wrongly required in the types for post/put when is_startpage is true.
  • parent_id is number when reading (GET and POST/PUT responses) but a string on write.
  • published is missing in the types for translated_slugs (used when the setting publish per language is active in the space)

@alvarosabu alvarosabu added the pending-triage [Issue] Ticket is pending to be prioritised label Aug 21, 2024
@alvarosabu
Copy link
Contributor

alvarosabu commented Aug 21, 2024

Hi @marckraw @rasmusbe @javierdebug I just found this issue while triaging and cleaning out issues

I would assume this is still relevant, so I will add it to my priorities.

Thanks a lot, everyone for your patience 🙏🏻

@alvarosabu alvarosabu added bug Something isn't working p4-important [Priority] Violate documented behavior or significantly improve performance (priority) p3-significant [Priority] Moderate issues, major enhancements and removed pending-triage [Issue] Ticket is pending to be prioritised p4-important [Priority] Violate documented behavior or significantly improve performance (priority) labels Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p3-significant [Priority] Moderate issues, major enhancements
Projects
None yet
Development

No branches or pull requests

5 participants