@use-stall/types 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/device.d.ts +0 -1
- package/src/pin-auth.d.ts +24 -0
- package/src/users.d.ts +40 -24
package/index.d.ts
CHANGED
package/package.json
CHANGED
package/src/device.d.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface PinAuthConfig {
|
|
2
|
+
orgId: string;
|
|
3
|
+
salt?: Uint8Array;
|
|
4
|
+
deviceKeyRaw?: Uint8Array;
|
|
5
|
+
deviceKeyString?: string;
|
|
6
|
+
localDbName?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AuthObject {
|
|
10
|
+
h: string; // HMAC hash
|
|
11
|
+
s: string; // Salt
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AuthDataType {
|
|
15
|
+
auth: AuthObject;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PinAuthRecord {
|
|
20
|
+
id: any;
|
|
21
|
+
iv: string;
|
|
22
|
+
ciphertext: string;
|
|
23
|
+
}
|
|
24
|
+
|
package/src/users.d.ts
CHANGED
|
@@ -1,40 +1,56 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ModuleKey } from "./integrations";
|
|
2
|
+
import { AuthObject } from "./pin-auth";
|
|
2
3
|
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
4
|
export interface UserType {
|
|
5
|
+
id: string;
|
|
5
6
|
fullname: string;
|
|
6
7
|
email: string;
|
|
7
8
|
organizations: string[];
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
phone_number: string;
|
|
13
|
-
profile_picture?: string;
|
|
9
|
+
created_at: string;
|
|
10
|
+
updated_at: string;
|
|
11
|
+
phone: string;
|
|
12
|
+
profile: string;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
export interface
|
|
15
|
+
export interface OrganizationUserType {
|
|
17
16
|
id: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
createdAt: string;
|
|
21
|
-
updatedAt: string;
|
|
22
|
-
role_id: string;
|
|
23
|
-
linked_devices: string[];
|
|
24
|
-
profile?: string;
|
|
17
|
+
uid: string;
|
|
18
|
+
role: string;
|
|
25
19
|
locations: string[];
|
|
26
|
-
locations_enabled?: boolean;
|
|
27
20
|
auth: AuthObject;
|
|
21
|
+
created_at: string;
|
|
22
|
+
updated_at: string;
|
|
28
23
|
}
|
|
29
24
|
|
|
30
|
-
export
|
|
31
|
-
id: string;
|
|
32
|
-
role: string;
|
|
33
|
-
permissions: { [key: string]: any };
|
|
34
|
-
}
|
|
25
|
+
export type PermissionsKeys = ModuleKey | "users" | "roles" | "integrations";
|
|
35
26
|
|
|
36
|
-
export interface
|
|
27
|
+
export interface RoleType {
|
|
37
28
|
id: string;
|
|
38
29
|
role: string;
|
|
39
|
-
|
|
30
|
+
created_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
permissions: {
|
|
33
|
+
apps: {
|
|
34
|
+
stall_connect: boolean;
|
|
35
|
+
stall_flex: boolean;
|
|
36
|
+
};
|
|
37
|
+
[key: PermissionsKeys]: {
|
|
38
|
+
create: boolean;
|
|
39
|
+
update: boolean;
|
|
40
|
+
read: boolean;
|
|
41
|
+
delete: boolean;
|
|
42
|
+
};
|
|
43
|
+
devices: {
|
|
44
|
+
create: boolean;
|
|
45
|
+
update: boolean;
|
|
46
|
+
delete: boolean;
|
|
47
|
+
read: boolean;
|
|
48
|
+
pair: boolean;
|
|
49
|
+
unpair: boolean;
|
|
50
|
+
};
|
|
51
|
+
organization: {
|
|
52
|
+
manage: boolean;
|
|
53
|
+
billing: boolean;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
40
56
|
}
|