/ src / api / users / create.ts
create.ts
 1  import { appVersion, macosVersion } from "../app/status";
 2  import { json } from "../call";
 3  
 4  export interface PostUsersUpsert201 {
 5    id: string;
 6    ipAddress: string;
 7    hwid: string;
 8    email: string | null;
 9    userName: string | null;
10    licenseId: string | null;
11    hasLicense: boolean;
12    licenseActivatedAt: string | null;
13    deviceName: string;
14    deviceType: string;
15    macosVersion: string;
16    appVersion: string;
17    role: "User";
18    isBanned: boolean;
19    createdAt: string;
20    updatedAt: string;
21    firstSeen: string;
22    lastSeen: string;
23    trialStartedAt: string;
24  }
25  
26  export const post_users_upsert = async (
27    hwid: string,
28    deviceName: string,
29    deviceType = "Unknown",
30  ): Promise<PostUsersUpsert201> =>
31    json("POST", "/users/upsert", {
32      hwid,
33      deviceName,
34      macosVersion,
35      appVersion,
36      deviceType,
37    });