<commit_before>import {Client} from '../mnubo';
import {authenticate} from '../decorators';

export class Owners {
  private path: string;

  constructor(private client: Client) {
    this.path = '/api/v3/owners';
  }

  @authenticate
  create(payload: any): Promise<any> {
    return this.client.post(this.path, payload);
  }

  @authenticate
  update(username: string, payload: any): Promise<any> {
    return this.client.put(`${this.path}/${username}`, payload);
  }

  @authenticate
  delete (username: string): Promise<any> {
    return this.client.delete(`${this.path}/${username}`);
  }

  @authenticate
  claim(username: string, deviceId: string): Promise<any> {
    return this.client.post(`${this.path}/${username}/objects/${deviceId}/claim`, {});
  }<commit_msg>feat(owners): add create or update in batch<commit_after>import {Client} from '../mnubo';
import {authenticate} from '../decorators';

export class Owners {
  private path: string;

  constructor(private client: Client) {
    this.path = '/api/v3/owners';
  }

  @authenticate
  create(payload: any): Promise<any> {
    return this.client.post(this.path, payload);
  }

  @authenticate
  update(username: string, payload: any): Promise<any> {
    return this.client.put(`${this.path}/${username}`, payload);
  }

  @authenticate
  createUpdate(payload: Array<any>): Promise<any> {
    return this.client.put(`${this.path}`, payload);
  }

  @authenticate
  delete (username: string): Promise<any> {
    return this.client.delete(`${this.path}/${username}`);
  }

  @authenticate
  claim(username: string, deviceId: string): Promise<any> {
    return this.client.post(`${this.path}/${username}/objects/${deviceId}/claim`, {});
  }
{'fraction_non_alphanumeric': 0.1762632197414806, 'fraction_numerical': 0.0011750881316098707, 'mean_word_length': 4.288819875776397, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2608198', 'n_tokens_mistral': 558, 'n_tokens_neox': 538, 'n_words': 113}