message: feat: add types for RecordClient
diff: @@ -4,6 +4,10 @@ type AppID = string | number;
  type RecordID = string | number;
  type Revision = string | number;
  +type Record = {
  + [fieldCode: string]: any;
  +};
  +
  export class RecordClient {
  private client: HttpClient;
  @@ -11,12 +15,18 @@ export class RecordClient {
  this.client = client;
  }
  - public async getRecord(app: AppID, id: RecordID) {
  + public async getRecord<T extends { record: Record }>(
  + app: AppID,
  + id: RecordID
  + ) {
  const path = "/k/v1/record.json";
  - return this.client.get(path, { app, id });
  + return this.client.get<T>(path, { app, id });
  }
  - public async addRecord(app: AppID, record?: object) {
  + public async addRecord(
  + app: AppID,
  + record?: object
  + ): Promise<{ id: RecordID; revision: Revision }> {
  const path = "/k/v1/record.json";
  return this.client.post(path, { app, record });
  }
  @@ -26,7 +36,7 @@ export class RecordClient {
  params:
  | { id: RecordID; record?: object; revision?: Revision }
  | { updateKey: object; record?: object; revision?: Revision }
  - ) {
  + ): Promise<{ revision: Revision }> {
  const path = "/k/v1/record.json";
  return this.client.put(path, { app, ...params });
  }
  @@ -35,7 +45,7 @@ export class RecordClient {
  app: AppID,
  ids: RecordID[],
  revisions?: Revision[]
  - ) {
  + ): Promise<{}> {
  const path = "/k/v1/records.json";
  return this.client.delete(path, { app, ids, revisions });
  }
  