Skip to content

Allow ISbLinksParams to StoryblokClient.getAll method #944

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

Open
shabab477 opened this issue Mar 3, 2025 · 0 comments
Open

Allow ISbLinksParams to StoryblokClient.getAll method #944

shabab477 opened this issue Mar 3, 2025 · 0 comments
Assignees
Labels
feature [Issue] New feature or request v8

Comments

@shabab477
Copy link

shabab477 commented Mar 3, 2025

StoryblokClient#getAll method supports params for ISbStoryData, ISbMultipleStoriesData, ISbAssetsParams but not params for ISbLinksParams. This is a big problem because for creating sitemaps with lastmod elements.


Expected Behavior

await storyBlokClient.getAll('cdn/links', {
      starts_with: 'some-path',
      version: 'published',
      resolve_links: 'link',
      include_dates: 1 // this should not throw TS error
    });

Current Behavior

await storyBlokClient.getAll('cdn/links', {
      starts_with: 'some-path',
      version: 'published',
      resolve_links: 'link',
      include_dates: 1 // this throws TS error
    });

Steps to Reproduce

See current behavior

Note:

  1. The get method is overloaded correctly.
  2. Would expect the same for getAll method.
  3. At the very least allow include_dates to be allowed.
shabab477 added a commit to shabab477/storyblok-js-client that referenced this issue Mar 4, 2025
Problem:
- Developers may need to `getAll` when getting an unpaginated response from `cdn/links`

Solution:
- Extend interface of IsbStoriesParam with ISbLinksParams on getAll call signature

Closes: storyblok#944
@edodusi edodusi self-assigned this Mar 7, 2025
@edodusi edodusi added feature [Issue] New feature or request v7 labels Mar 7, 2025
shabab477 added a commit to shabab477/storyblok-js-client that referenced this issue Mar 16, 2025
…ksParams

Problem:
- Developers may need to `getAll` when getting an unpaginated response from `cdn/links`
- Currently when calling `cdn/links` with ISbLinksParams results with compile time error when using ISbLinksParams specific params like: include_dates

Solution:
- Make `getAll` function generic to make it type aware of the intention of the developer
- Updated the function to not allow developers to modify the number of round trips for fetching all results
- Updated unit tests and e2e tests

Closes: storyblok#944
shabab477 added a commit to shabab477/storyblok-js-client that referenced this issue Mar 16, 2025
…ksParams

Problem:
- Developers may need to `getAll` when getting an unpaginated response from `cdn/links`
- Currently when calling `cdn/links` with ISbLinksParams results with compile time error when using ISbLinksParams specific params like: include_dates

Solution:
- Make `getAll` function generic to make it type aware of the intention of the developer
- Updated the function to not allow developers to modify the number of round trips for fetching all results
- Updated unit tests and e2e tests

Closes: storyblok#944
shabab477 added a commit to shabab477/storyblok-js-client that referenced this issue Mar 22, 2025
…ksParams

Problem:
- Developers may need to `getAll` when getting an unpaginated response from `cdn/links`
- Currently when calling `cdn/links` with ISbLinksParams results with compile time error when using ISbLinksParams specific params like: include_dates

Solution:
- Make `getAll` function generic to make it type aware of the intention of the developer
- Updated unit tests and e2e tests

Closes: storyblok#944
shabab477 added a commit to shabab477/storyblok-js-client that referenced this issue Mar 22, 2025
…ksParams

Problem:
- Developers may need to `getAll` when getting an unpaginated response from `cdn/links`
- Currently when calling `cdn/links` with ISbLinksParams results with compile time error when using ISbLinksParams specific params like: include_dates

Solution:
- Make `getAll` function generic to make it type aware of the intention of the developer
- Updated unit tests and e2e tests

Closes: storyblok#944
@alvarosabu alvarosabu added this to the v7 milestone May 7, 2025
@edodusi edodusi removed this from the v7 milestone May 7, 2025
@edodusi edodusi added v8 and removed v7 labels May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature [Issue] New feature or request v8
Projects
None yet
3 participants