@use-stall/types 0.0.6 → 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 CHANGED
@@ -23,3 +23,4 @@ export * from "./src/users";
23
23
  export * from "./src/fulfillment";
24
24
  export * from "./src/extensions";
25
25
  export * from "./src/integrations";
26
+ export * from "./src/pin-auth";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use-stall/types",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Type declarations for Stall SDKs",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
@@ -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 { AuthObject } from "pin-auth";
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
- createdAt: string;
9
- updatedAt: string;
10
- id: string;
11
- role_id: string;
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 PosProfileType {
15
+ export interface OrganizationUserType {
17
16
  id: string;
18
- name: string;
19
- email?: string;
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 interface RoleType {
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 PosRoleType {
27
+ export interface RoleType {
37
28
  id: string;
38
29
  role: string;
39
- permissions: { [key: string]: any };
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
  }