Skip to content

Deprecate KeyValueStore.getPublicUrl(key) and introduce KeyValueStore.getRecordPublicUrl(key) #433

@danpoletaev

Description

@danpoletaev

Feature

  1. Deprecate the synchronous method KeyValueStore.getPublicUrl(key: string).
  2. Introduce a new asynchronous method KeyValueStore.getRecordPublicUrl(key: string).

Motivation

The current KeyValueStore.getPublicUrl(key) method has several issues that impact developer experience, performance, and maintainability 👇

  • Synchronous: The method is synchronous.
  • Confusing name 🤔: With the recent addition of a public URL for the list of keys, the name getPublicUrl is ambiguous.
  • Lack of code reuse: The method manually constructs the URL string instead of calling the apify-client. This creates redundant logic.

Introducing an async method with a more specific name (getRecordPublicUrl) that leverages the apify-client will solve these issues.

Ideal solution or implementation, and any additional constraints

  1. Mark the existing KeyValueStore.getPublicUrl(key) method as deprecated. The deprecation message should advise users to switch to the new getRecordPublicUrl method.

  2. Implement the new method async getRecordPublicUrl(key: string) within the KeyValueStore class. This new method will call the appropriate apify-client function, keyValueStore(id).getRecordUrl(key), and return the resulting URL.

Alternative solutions or implementations

No response

Other context

No response

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions