import { ApiTokenManager } from './classes.apitokenmanager.js';
import * as plugins from '../plugins.js';

@plugins.smartdata.Manager(() => {
  return (this as any).manager;
})
export class ApiToken extends plugins.smartdata.SmartDataDbDoc<
  ApiToken,
  ApiToken,
  ApiTokenManager
> {
  static clearOldApiTokens() {}

  static clearApiTokensForUserId(userId: string) {}

  @plugins.smartdata.unI()
  public id: string;

  @plugins.smartdata.unI()
  public ownerEntityId: string;

  @plugins.smartdata.svDb()
  data: {
    token: string;
    scopes: string[];
  } = {
    token: null,
    scopes: null,
  };

  constructor() {
    super();
  }
}
