@feedmepos/mf-common 1.8.38-beta.1 → 1.8.38
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/app.d.ts +0 -2
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +6831 -7572
- package/dist/components/Portal/PortalMobile.vue.d.ts.map +1 -1
- package/dist/components/Portal/PortalTablet.vue.d.ts.map +1 -1
- package/dist/components/Portal/index.vue.d.ts.map +1 -1
- package/dist/store.d.ts +0 -16
- package/dist/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +2 -3
- package/dist/permission/permission.d.ts +0 -101
- package/dist/permission/permission.d.ts.map +0 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@feedmepos/mf-common",
|
3
|
-
"version": "1.8.38
|
3
|
+
"version": "1.8.38",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -26,8 +26,7 @@
|
|
26
26
|
"libphonenumber-js": "^1.11.1",
|
27
27
|
"pinia": "^2.1.6",
|
28
28
|
"vue": "^3.4.27",
|
29
|
-
"vue-router": "^4.2.5"
|
30
|
-
"@casl/ability": "^3.2.0"
|
29
|
+
"vue-router": "^4.2.5"
|
31
30
|
},
|
32
31
|
"devDependencies": {
|
33
32
|
"@tsconfig/node18": "^18.2.2",
|
@@ -1,101 +0,0 @@
|
|
1
|
-
import { type RawRule, Ability } from "@casl/ability";
|
2
|
-
import { type RouteLocationNormalizedLoaded, type Router } from "vue-router";
|
3
|
-
import type { FmpUser } from "@/store";
|
4
|
-
export declare namespace Permission {
|
5
|
-
enum Level {
|
6
|
-
feedMe = 0,
|
7
|
-
business = 1,
|
8
|
-
restaurant = 2
|
9
|
-
}
|
10
|
-
enum Action {
|
11
|
-
manage = "manage",
|
12
|
-
create = "create",
|
13
|
-
read = "read",
|
14
|
-
update = "update",
|
15
|
-
delete = "delete"
|
16
|
-
}
|
17
|
-
}
|
18
|
-
export declare namespace Permission.Subject {
|
19
|
-
enum Feedme {
|
20
|
-
all = "all",
|
21
|
-
restaurant = "restaurant",
|
22
|
-
business = "business",
|
23
|
-
delivery = "delivery",
|
24
|
-
agent = "agent"
|
25
|
-
}
|
26
|
-
enum FeedmeBusinessField {
|
27
|
-
quota = "quota",
|
28
|
-
owner = "owner"
|
29
|
-
}
|
30
|
-
enum Business {
|
31
|
-
profile = "business::profile",
|
32
|
-
restaurant = "business::restaurant",
|
33
|
-
menu = "business::menu",
|
34
|
-
promotion = "business::promotion",
|
35
|
-
voucher = "business::voucher",
|
36
|
-
membership = "business::membership",
|
37
|
-
stock = "business::stock",
|
38
|
-
permission = "business::permission",
|
39
|
-
role = "business::role"
|
40
|
-
}
|
41
|
-
enum Restaurant {
|
42
|
-
restaurant = "restaurant"
|
43
|
-
}
|
44
|
-
}
|
45
|
-
export interface AbilityConstructOption {
|
46
|
-
userId: string;
|
47
|
-
level: number;
|
48
|
-
role: string;
|
49
|
-
businessId?: string;
|
50
|
-
restaurantId?: string;
|
51
|
-
}
|
52
|
-
export interface PermissionLevelDetail {
|
53
|
-
isAdmin: (perviousLevel: Ability, option: AbilityConstructOption) => boolean;
|
54
|
-
getRules: (options: AbilityConstructOption) => Promise<RawRule[]>;
|
55
|
-
}
|
56
|
-
export declare const fullPermission: {
|
57
|
-
[key: string]: IFdtoPortalPermission;
|
58
|
-
};
|
59
|
-
export interface IFdtoPortalPermission extends RawRule {
|
60
|
-
label: string;
|
61
|
-
}
|
62
|
-
export interface IPermissionUser {
|
63
|
-
businessId: string;
|
64
|
-
userId: string;
|
65
|
-
/** @deprecated */
|
66
|
-
email?: string;
|
67
|
-
/** @deprecated */
|
68
|
-
phoneNumber?: string;
|
69
|
-
permissions: RawRule[];
|
70
|
-
}
|
71
|
-
export type Role = "admin" | "staff" | "agent" | "debug";
|
72
|
-
export interface CaslPermission {
|
73
|
-
action: Permission.Action;
|
74
|
-
subject: Permission.Subject.Business | Permission.Subject.Restaurant | Permission.Subject.Feedme | Permission.Subject.FeedmeBusinessField;
|
75
|
-
field?: string;
|
76
|
-
}
|
77
|
-
export interface ValidationResult {
|
78
|
-
canAccess: boolean;
|
79
|
-
message?: string;
|
80
|
-
}
|
81
|
-
export interface ValidationManifest {
|
82
|
-
requiredRoles?: Role[];
|
83
|
-
requiredCaslPermissions?: CaslPermission[];
|
84
|
-
customValidationFunction?: () => Promise<ValidationResult>;
|
85
|
-
}
|
86
|
-
export interface ValidationParams {
|
87
|
-
sessionUser: FmpUser | null | undefined;
|
88
|
-
validationManifest: ValidationManifest;
|
89
|
-
}
|
90
|
-
export declare function validate(params: ValidationParams): Promise<ValidationResult>;
|
91
|
-
export interface RouteValidationResult extends ValidationResult {
|
92
|
-
redirectTo?: string;
|
93
|
-
}
|
94
|
-
declare module "vue-router" {
|
95
|
-
interface RouteMeta {
|
96
|
-
validationManifest?: ValidationManifest;
|
97
|
-
}
|
98
|
-
}
|
99
|
-
export declare function validateRoute(route: RouteLocationNormalizedLoaded): Promise<RouteValidationResult>;
|
100
|
-
export declare function installRouteValidation(router: Router): void;
|
101
|
-
//# sourceMappingURL=permission.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../../src/permission/permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,KAAK,6BAA6B,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGtC,yBAAiB,UAAU,CAAC;IAC1B,KAAY,KAAK;QACf,MAAM,IAAI;QACV,QAAQ,IAAI;QACZ,UAAU,IAAI;KACf;IAED,KAAY,MAAM;QAChB,MAAM,WAAW;QACjB,MAAM,WAAW;QACjB,IAAI,SAAS;QACb,MAAM,WAAW;QACjB,MAAM,WAAW;KAClB;CACF;AAED,yBAA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