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

Missing interface's property #2464

Closed
olishevskii opened this issue May 12, 2024 · 4 comments · Fixed by #2466
Closed

Missing interface's property #2464

olishevskii opened this issue May 12, 2024 · 4 comments · Fixed by #2466
Assignees
Labels
api: storage Issues related to the googleapis/nodejs-storage API. type: question Request for information or clarification. Not an issue.

Comments

@olishevskii
Copy link
Contributor

Why doesn't the second element of the array have the property pageToken?

export type GetFilesResponse = [File[], {}, unknown];

Screenshot 2024-05-12 at 21 11 41

This property will be present if you pass { autoPaginate: false } into Storage.getFiles.

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label May 12, 2024
@bajajneha27
Copy link

Hi @olishevskii
That's probably because you don't have enough objects for the next page. By default, we return 1000 objects. If you do want to limit the number of objects returned, use maxResults option and then you should be able to see nextPage as well.

let [files, nextPage] = await bucket.getFiles({autoPaginate: false, maxResults: 10});

Hope this helps. I'm closing the issue now. Please feel free to re-open it if there's any other issue.

@olishevskii
Copy link
Contributor Author

olishevskii commented May 14, 2024

Hi @bajajneha27. Thank you for your answer.

Unfortunately, it's not working because there's a problem with the type.
Screenshot 2024-05-14 at 15 30 10
Screenshot 2024-05-14 at 15 30 30

Moreover, I have around 11,500 files in my bucket.

@bajajneha27
Copy link

I see.
Well, I'm getting the nextPage populated. Can you help me with a code snippet so that I can try to reproduce this?

@bajajneha27 bajajneha27 reopened this May 14, 2024
@bajajneha27 bajajneha27 added the type: question Request for information or clarification. Not an issue. label May 14, 2024
@ddelgrosso1
Copy link
Contributor

@bajajneha27 no need to reproduce, the currently defined type is just a generic object. The issue is that it should be more clearly typed which is what @olishevskii is working on in the linked PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. type: question Request for information or clarification. Not an issue.
Projects
None yet
3 participants