Skip to content

Extra urlPrefix parameter in ITwinSavedViewsClientParams? #141

@jsnaras

Description

@jsnaras

Feature

It would be great if I could supply an optional API urlPrefix parameter to ITwinSavedViewsClient for QA, dev, etc use.
Currently the whole baseUrl needs to be passed in which is risky because it can get out of sync in the future if the default URL changes.
The baseUrl could still take precedence and override urlPrefix to retain compatibility.

Examples

export interface ITwinSavedViewsClientParams {
  /** @default "https://api.bentley.com/savedviews"  */
  baseUrl?: string;

  /** @default "" */
  urlPrefix?: string; // <-- proposed new parameter

  /** Authorization token that grants access to iTwin Platform API. */
  getAccessToken: () => Promise<string>;
}
constructor(args: ITwinSavedViewsClientParams) {
  this.baseUrl = args.baseUrl ?? `https://${args.urlPrefix ?? ""}api.bentley.com/savedviews`;
  ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions