apify-client-js icon indicating copy to clipboard operation
apify-client-js copied to clipboard

Several typing issues found in the client

Open vladfrangu opened this issue 1 year ago • 0 comments

While rewriting the tests for apify-cli, I've encountered several issues with the types for ActorVersion (and I am partly to blame):

  • enums are not exported but are used in concrete types (this is very bad as we don't provide string fallbacks, and thus people require casts)
    • solutions: either export the enum and use it, reference the types as imported from @apify/consts, or move to raw strings only
  • ActorVersionSourceFile seems to be missing the folder boolean (this type is used in ActorVersionSourceFiles, and seems to signal a folder of files)
  • keyValueStore(store.id).setRecord doesn't allow buffers
  • version(version).update has a wrong type (also reported https://apify.slack.com/archives/C0L33UM7Z/p1709550430797429)
  • builds lack newer fields, like buildNumber, build.stats?.computeUnits and build.stats?.imageSizeBytes being concretely typed

vladfrangu avatar Mar 05 '24 22:03 vladfrangu