@chopkola/common 1.0.167 → 1.0.169

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.
@@ -1,4 +1,5 @@
1
1
  import { RoleIconEnum, RoleRiskLevelEnum } from "./enum/collection";
2
+ import { UUID } from "./global";
2
3
  export type ResourceType = "users" | "roles" | "vendors" | "orders" | "products" | "*";
3
4
  export type VendorResourceType = "$";
4
5
  export type ActionType = "create" | "read" | "update" | "delete";
@@ -6,7 +7,7 @@ export type AdministratorActionType = ActionType | "*";
6
7
  export type VendorActionType = ActionType | "$";
7
8
  export type PermissionKey = `${ResourceType}:${ActionType}`;
8
9
  export interface Permission {
9
- id: string;
10
+ id: UUID;
10
11
  resource: ResourceType | VendorResourceType;
11
12
  action: AdministratorActionType | VendorActionType;
12
13
  /**
@@ -21,7 +22,7 @@ export interface Permission {
21
22
  updated_at: Date;
22
23
  }
23
24
  export interface Role {
24
- id: string;
25
+ id: UUID;
25
26
  name: string;
26
27
  slug: string;
27
28
  description: string | null;
@@ -31,8 +32,8 @@ export interface Role {
31
32
  updated_at: Date;
32
33
  }
33
34
  export interface RolePermission {
34
- role_id: string;
35
- permission_id: string;
35
+ role_id: UUID;
36
+ permission_id: UUID;
36
37
  }
37
38
  export interface RoleWithPermissions extends Role {
38
39
  permissions: Permission[];
@@ -40,13 +41,13 @@ export interface RoleWithPermissions extends Role {
40
41
  export type CreatePermissionInput = Omit<Permission, "id" | "created_at" | "updated_at">;
41
42
  export type UpdatePermissionInput = Partial<Omit<Permission, "id" | "created_at" | "updated_at">>;
42
43
  export type CreateRoleInput = Omit<Role, "id" | "created_at" | "updated_at"> & {
43
- permission_ids?: string[];
44
+ permission_ids?: UUID[];
44
45
  };
45
46
  export type UpdateRoleInput = Partial<Omit<Role, "id" | "created_at" | "updated_at">> & {
46
- permission_ids?: string[];
47
+ permission_ids?: UUID[];
47
48
  };
48
49
  export interface AuthorizationContext {
49
- user_id: string;
50
+ user_id: UUID;
50
51
  role: RoleWithPermissions;
51
52
  }
52
53
  export interface PermissionCheck {
@@ -1,9 +1,10 @@
1
1
  import { AddressI } from "./address";
2
2
  import { UserAccountStatusEnum, UserAccountTypeEnum, UserGenderEnum, VerificationPurposeEnum } from "./enum/collection";
3
+ import { UUID } from "./global";
3
4
  import { RoleWithPermissions } from "./role_n_permission";
4
5
  import { Vendor } from "./vendor";
5
6
  export interface User {
6
- id: string;
7
+ id: UUID;
7
8
  first_name: string;
8
9
  last_name: string;
9
10
  email: string;
@@ -26,7 +27,7 @@ export interface User {
26
27
  updated_at: Date;
27
28
  }
28
29
  export interface UserSecurity {
29
- password: string;
30
+ password?: string;
30
31
  refresh_token_hash: string | null;
31
32
  mfa_enabled: boolean;
32
33
  mfa_secret: string | null;
@@ -1,13 +1,13 @@
1
1
  import { AddressI } from "./address";
2
2
  import { PromotionTypeEnum, VendorBusinessTypeEnum, VendorStatusEnum } from "./enum/collection";
3
- import { AddressPayloadType } from "./global";
3
+ import { AddressPayloadType, UUID } from "./global";
4
4
  export type CuisineType = "African" | "Asian" | "Continental" | "Mediterranean" | "American";
5
5
  export type AmbienceType = "Casual" | "Fine Dining" | "Family Friendly" | "Romantic" | "Outdoor" | "Rooftop";
6
6
  export type StoreType = "Supermarket" | "Organic Store" | "Wholesale" | "Convenience Store" | "Mini Mart";
7
7
  export type GroceryCategory = "Fresh Produce" | "Frozen Foods" | "Household Items" | "Beverages" | "Snacks" | "Meat & Poultry" | "Dairy";
8
8
  export interface Vendor {
9
- id: string;
10
- owner_id: string;
9
+ id: UUID;
10
+ owner_id: UUID;
11
11
  business_name: string;
12
12
  slug: string;
13
13
  sku_prefix: string;
@@ -33,8 +33,8 @@ export interface Vendor {
33
33
  updated_at: Date;
34
34
  }
35
35
  export interface RestaurantInfo {
36
- id: string;
37
- vendor_id: string;
36
+ id: UUID;
37
+ vendor_id: UUID;
38
38
  seating_capacity: number | null;
39
39
  cuisines: CuisineType[];
40
40
  ambience: AmbienceType[] | null;
@@ -57,8 +57,8 @@ export interface RestaurantInfo {
57
57
  updated_at: Date;
58
58
  }
59
59
  export interface GroceryInfo {
60
- id: string;
61
- vendor_id: string;
60
+ id: UUID;
61
+ vendor_id: UUID;
62
62
  store_type: StoreType[];
63
63
  product_categories: GroceryCategory[];
64
64
  tags: string[] | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chopkola/common",
3
- "version": "1.0.167",
3
+ "version": "1.0.169",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "akrosoft technology ltd",