Informatiqal / qlik-repo-api

Package to interact with Qlik Sense Repository API (QSEoW)
https://informatiqal.com/qlik-repository-api/
MIT License
5 stars 0 forks source link

Interface/type changes #274

Open countnazgul opened 1 year ago

countnazgul commented 1 year ago

At the moment for (almost) each entity there are 3 interfaces - IEntity, IEntityCreate and IEntityUpdate.

The 3 interfaces are described independently of each other but create and update ones can be derived from the main interface by:

Not a problem if this is not done at the end but the interfaces/types will look nicer this way

countnazgul commented 1 year ago

For example

export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;

export interface ICommonCreateUpdate {
  customProperties?: string[];
  owner?: string;
  tags?: string[];
}

export type IStreamCreate = Omit<
  IStream,
  | "customProperties"
  | "createdDate"
  | "modifiedDate"
  | "schemaPath"
  | "privileges"
  | "modifiedByUserName"
  | "id"
  | "owner"
  | "tags"
> &
  ICommonCreateUpdate;

export type IStreamUpdate = Optional<
  Omit<
    IStream,
    | "customProperties"
    | "createdDate"
    | "modifiedDate"
    | "schemaPath"
    | "privileges"
    | "modifiedByUserName"
    | "id"
    | "owner"
    | "tags"
  >,
  "name"
> &
  ICommonCreateUpdate;