Currently it looks like follow(rel, options) only support templated URIs. It would be good to add a way to follow a link by title.
Also, for HAL links, these are useful fields in the spec that could be part of the follow() options:
- name
- type
- profile
- deprecation
- hreflang
Here is my workaround, using deprecated methods:
public async followListEntry(name: string) {
// NOTE: links() is deprecated in Ketting
const entryLinks = await this.resource.links("https://level3.rest/patterns/list#list-entry")
// @ts-ignore
const entry = entryLinks.find((l) => l.name === name)
assert(entry !== undefined, `cannot find link named '${name}' in list: ${JSON.stringify(entryLinks)}`)
this.resource = await this.client.go(entry)
}
Currently it looks like
follow(rel, options)only support templated URIs. It would be good to add a way to follow a link bytitle.Also, for HAL links, these are useful fields in the spec that could be part of the follow() options:
Here is my workaround, using deprecated methods: