@feedmepos/mf-hrm-portal 2.3.2-dev.15 → 2.3.2-dev.17

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.
Files changed (108) hide show
  1. package/dist/{ApprovalCodeList-qB2eycv0.js → ApprovalCodeList-Bo8IbNxV.js} +15 -14
  2. package/dist/{AuditLogList-DaqYMXFA.js → AuditLogList-C7CjPILA.js} +833 -823
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C-4BaMN-.js +438 -0
  4. package/dist/EmployeeList-BOP-gaTp.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-BEOR-8QD.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-DqeHBPqr.js → GrantUserList-CXWGr3Wo.js} +16 -15
  8. package/dist/Main-BrP1frfO.js +96 -0
  9. package/dist/{Main-8SeOYhVr.js → Main-DeuWov9n.js} +5 -5
  10. package/dist/{Main-DnWIkti6.js → Main-bru10M5U.js} +2097 -2102
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-Bh0o_HFX.js → PermissionSetList--xt0piQz.js} +137 -136
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-D5nvRsW3.js +4167 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DiNDrCy0.js +35 -0
  15. package/dist/RoleList-BEE-8EQK.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-BSmFLxZS.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Cqo5kHcF.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-C0Y9XHXR.js → ScheduleGeneralPage-DxhgBLix.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-B1293tLU.js → ScheduleModal.vue_vue_type_script_setup_true_lang-DGPwmNQb.js} +186 -187
  19. package/dist/{SchedulePage-Cqp0mIOQ.js → SchedulePage-oBdEvGWN.js} +20 -20
  20. package/dist/{SchedulePositionPage-DpF7fZ2G.js → SchedulePositionPage-BZps-kKs.js} +3 -3
  21. package/dist/{SelectFilter-jjUAj29l.js → SelectFilter-Bs_LCk3L.js} +1 -1
  22. package/dist/TeamMemberList-DCgNcs4P.js +1154 -0
  23. package/dist/{TimesheetList-CzUVfPGT.js → TimesheetList-BW6iCigo.js} +9 -9
  24. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-CZ6axjWg.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-Dv66Af5C.js} +3 -3
  25. package/dist/{app-IdmhLBBn.js → app-B8xnhtVI.js} +3706 -7569
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-BOfGQEGW.js → approval-code-B0jU1bvk.js} +1 -1
  28. package/dist/{dayjs.min-DkHZ47ah.js → dayjs.min-CdpSCqn1.js} +34 -34
  29. package/dist/{employee-CJXt2fuN.js → employee-DlFGiUgI.js} +47 -48
  30. package/dist/{grant-user-Bj6DpBWc.js → grant-user-C3C6glCk.js} +1 -1
  31. package/dist/{iteration-BRk48OAH.js → iteration-BM0iyDBd.js} +1 -1
  32. package/dist/{lodash-CDREeRGa.js → lodash-KK9U7NAy.js} +1 -1
  33. package/dist/restaurant-C7o2Yk6j.js +2688 -0
  34. package/dist/{role-CtYVs62K.js → role-DYCorsOh.js} +20 -19
  35. package/dist/rule-BhGHZqKO.js +783 -0
  36. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  37. package/dist/src/helpers/permission-set.d.ts +102 -1
  38. package/dist/src/helpers/rule.d.ts +2 -2
  39. package/dist/src/helpers/string.d.ts +1 -10
  40. package/dist/src/router/shared.d.ts +1 -3
  41. package/dist/src/stores/restaurant.d.ts +7 -7
  42. package/dist/src/stores/team.d.ts +1 -31
  43. package/dist/src/types/team.d.ts +1 -17
  44. package/dist/src/views/audit-log/locales/index.d.ts +0 -12
  45. package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +1 -1
  46. package/dist/src/views/hr/locales/index.d.ts +0 -20
  47. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  48. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  49. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  50. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  51. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  52. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  53. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  54. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  55. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  56. package/dist/src/views/team/locales/index.d.ts +0 -716
  57. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  58. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  59. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  60. package/dist/string-VNuQNweN.js +15 -0
  61. package/dist/style.css +1 -1
  62. package/dist/tsconfig.app.tsbuildinfo +1 -1
  63. package/dist/{useAppStore-DAW1zVPH.js → useAppStore-C1lk2Q2j.js} +1 -1
  64. package/dist/{useLoading-C-AZgSLr.js → useLoading-CXdGsnHm.js} +1 -1
  65. package/dist/useReportPermissions-D_I4rFVo.js +82 -0
  66. package/package.json +3 -3
  67. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-orzPqq0L.js +0 -459
  68. package/dist/EmployeeList-h0fWCjea.js +0 -896
  69. package/dist/FormSection.vue_vue_type_script_setup_true_lang-rg4r9aRR.js +0 -90
  70. package/dist/Main-s-s803fq.js +0 -101
  71. package/dist/MyPosProfile-ChVMjpLY.js +0 -360
  72. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  73. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-05XZu7a9.js +0 -4212
  74. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-rb5MPBnA.js +0 -1797
  75. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-CwzYGZNY.js +0 -547
  76. package/dist/RoleList-BjcuUCyF.js +0 -274
  77. package/dist/TeamMemberList-B2wxF6Yn.js +0 -2082
  78. package/dist/member-grant-BkZ_oF44.js +0 -54
  79. package/dist/restaurant-BEdgW6Se.js +0 -49
  80. package/dist/rule-CWR80AmG.js +0 -839
  81. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  82. package/dist/src/api/sso-provider/index.d.ts +0 -5
  83. package/dist/src/api/staff-invite/index.d.ts +0 -16
  84. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  85. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  86. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  87. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  88. package/dist/src/composables/useTenant.d.ts +0 -11
  89. package/dist/src/helpers/member-grant.d.ts +0 -36
  90. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  91. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  92. package/dist/src/helpers/staff-invite.d.ts +0 -54
  93. package/dist/src/router/courtGuard.d.ts +0 -4
  94. package/dist/src/router/menu-access-guard.d.ts +0 -17
  95. package/dist/src/types/my-pos-profile.d.ts +0 -24
  96. package/dist/src/types/sso-provider.d.ts +0 -10
  97. package/dist/src/types/staff-invite.d.ts +0 -100
  98. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  99. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  100. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -236
  101. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  102. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  103. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  104. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  105. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  106. package/dist/string-DZQ1uNjn.js +0 -22
  107. package/dist/useReportPermissions-ld6buoVe.js +0 -80
  108. package/dist/useSsoProviders-DeTogbyW.js +0 -41
@@ -1,236 +0,0 @@
1
- import * as enUS from './en-US.json';
2
- export type AppMessagesSchema = typeof enUS;
3
- export declare const i18nMessages: {
4
- 'en-US': {
5
- myPosProfile: {
6
- title: string;
7
- subtitle: string;
8
- table: {
9
- columns: {
10
- name: string;
11
- contact: string;
12
- restaurant: string;
13
- role: string;
14
- };
15
- };
16
- passcode: {
17
- title: string;
18
- updated: string;
19
- updatedJustNow: string;
20
- show: string;
21
- hide: string;
22
- change: string;
23
- empty: string;
24
- emptyHint: string;
25
- generate: string;
26
- };
27
- change: {
28
- title: string;
29
- message: string;
30
- failed: string;
31
- exhausted: string;
32
- inProgress: string;
33
- incomplete: string;
34
- };
35
- generate: {
36
- failed: string;
37
- };
38
- changed: {
39
- title: string;
40
- message: string;
41
- done: string;
42
- };
43
- generated: {
44
- title: string;
45
- message: string;
46
- };
47
- manageAccount: {
48
- message: string;
49
- link: string;
50
- failed: string;
51
- };
52
- noPosUser: {
53
- title: string;
54
- description: string;
55
- };
56
- loadFailed: string;
57
- shared: {
58
- message: string;
59
- };
60
- };
61
- };
62
- 'zh-CN': {
63
- myPosProfile: {
64
- title: string;
65
- subtitle: string;
66
- table: {
67
- columns: {
68
- name: string;
69
- contact: string;
70
- restaurant: string;
71
- role: string;
72
- };
73
- };
74
- passcode: {
75
- title: string;
76
- updated: string;
77
- updatedJustNow: string;
78
- show: string;
79
- hide: string;
80
- change: string;
81
- empty: string;
82
- emptyHint: string;
83
- generate: string;
84
- };
85
- change: {
86
- title: string;
87
- message: string;
88
- failed: string;
89
- exhausted: string;
90
- inProgress: string;
91
- incomplete: string;
92
- };
93
- generate: {
94
- failed: string;
95
- };
96
- changed: {
97
- title: string;
98
- message: string;
99
- done: string;
100
- };
101
- generated: {
102
- title: string;
103
- message: string;
104
- };
105
- manageAccount: {
106
- message: string;
107
- link: string;
108
- failed: string;
109
- };
110
- noPosUser: {
111
- title: string;
112
- description: string;
113
- };
114
- loadFailed: string;
115
- shared: {
116
- message: string;
117
- };
118
- };
119
- };
120
- 'th-TH': {
121
- myPosProfile: {
122
- title: string;
123
- subtitle: string;
124
- table: {
125
- columns: {
126
- name: string;
127
- contact: string;
128
- restaurant: string;
129
- role: string;
130
- };
131
- };
132
- passcode: {
133
- title: string;
134
- updated: string;
135
- updatedJustNow: string;
136
- show: string;
137
- hide: string;
138
- change: string;
139
- empty: string;
140
- emptyHint: string;
141
- generate: string;
142
- };
143
- change: {
144
- title: string;
145
- message: string;
146
- failed: string;
147
- exhausted: string;
148
- inProgress: string;
149
- incomplete: string;
150
- };
151
- generate: {
152
- failed: string;
153
- };
154
- changed: {
155
- title: string;
156
- message: string;
157
- done: string;
158
- };
159
- generated: {
160
- title: string;
161
- message: string;
162
- };
163
- manageAccount: {
164
- message: string;
165
- link: string;
166
- failed: string;
167
- };
168
- noPosUser: {
169
- title: string;
170
- description: string;
171
- };
172
- loadFailed: string;
173
- shared: {
174
- message: string;
175
- };
176
- };
177
- };
178
- 'zh-Hant': {
179
- myPosProfile: {
180
- title: string;
181
- subtitle: string;
182
- table: {
183
- columns: {
184
- name: string;
185
- contact: string;
186
- restaurant: string;
187
- role: string;
188
- };
189
- };
190
- passcode: {
191
- title: string;
192
- updated: string;
193
- updatedJustNow: string;
194
- show: string;
195
- hide: string;
196
- change: string;
197
- empty: string;
198
- emptyHint: string;
199
- generate: string;
200
- };
201
- change: {
202
- title: string;
203
- message: string;
204
- failed: string;
205
- exhausted: string;
206
- inProgress: string;
207
- incomplete: string;
208
- };
209
- generate: {
210
- failed: string;
211
- };
212
- changed: {
213
- title: string;
214
- message: string;
215
- done: string;
216
- };
217
- generated: {
218
- title: string;
219
- message: string;
220
- };
221
- manageAccount: {
222
- message: string;
223
- link: string;
224
- failed: string;
225
- };
226
- noPosUser: {
227
- title: string;
228
- description: string;
229
- };
230
- loadFailed: string;
231
- shared: {
232
- message: string;
233
- };
234
- };
235
- };
236
- };
@@ -1,51 +0,0 @@
1
- import type { RawRule } from '@casl/ability';
2
- import { type PropType } from 'vue';
3
- import { FdoPermissionRule } from '@feedmepos/core/entity';
4
- import { type MemberGrantPayload } from '@/helpers/member-grant';
5
- import { type IFdtoPermissionPosUser } from '@/types/team';
6
- /** The saved grant being edited. A new `id` resets the form. */
7
- export interface MemberGrantInitialValue {
8
- id: string;
9
- isOwner?: boolean;
10
- name: string;
11
- permissions: RawRule[] | FdoPermissionRule[];
12
- permissionSetIds: string[];
13
- posUser?: IFdtoPermissionPosUser;
14
- posUserId?: string;
15
- }
16
- declare function isModified(): boolean;
17
- declare function readGrantData(): MemberGrantPayload;
18
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
19
- initialValue: {
20
- type: PropType<MemberGrantInitialValue | null>;
21
- };
22
- /** Name to fall back on when neither the saved grant nor the POS user has one. */
23
- fallbackName: {
24
- type: StringConstructor;
25
- default: string;
26
- };
27
- loading: {
28
- type: BooleanConstructor;
29
- default: boolean;
30
- };
31
- }>, {
32
- readGrantData: typeof readGrantData;
33
- isModified: typeof isModified;
34
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
35
- initialValue: {
36
- type: PropType<MemberGrantInitialValue | null>;
37
- };
38
- /** Name to fall back on when neither the saved grant nor the POS user has one. */
39
- fallbackName: {
40
- type: StringConstructor;
41
- default: string;
42
- };
43
- loading: {
44
- type: BooleanConstructor;
45
- default: boolean;
46
- };
47
- }>> & Readonly<{}>, {
48
- loading: boolean;
49
- fallbackName: string;
50
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
51
- export default _default;
@@ -1,44 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import type { HrmRestaurant } from '@/types/restaurant';
3
- import type { Role } from '@/types/role';
4
- import type { IFdtoPermissionPosUserRole } from '@/types/team';
5
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
- modelValue: {
7
- type: PropType<IFdtoPermissionPosUserRole[]>;
8
- required: true;
9
- };
10
- restaurants: {
11
- type: PropType<HrmRestaurant[]>;
12
- required: true;
13
- };
14
- roles: {
15
- type: PropType<Role[]>;
16
- required: true;
17
- };
18
- isRoleUsable: {
19
- type: PropType<(role: Role) => boolean>;
20
- required: true;
21
- };
22
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
23
- "update:modelValue": (roles: IFdtoPermissionPosUserRole[]) => any;
24
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
25
- modelValue: {
26
- type: PropType<IFdtoPermissionPosUserRole[]>;
27
- required: true;
28
- };
29
- restaurants: {
30
- type: PropType<HrmRestaurant[]>;
31
- required: true;
32
- };
33
- roles: {
34
- type: PropType<Role[]>;
35
- required: true;
36
- };
37
- isRoleUsable: {
38
- type: PropType<(role: Role) => boolean>;
39
- required: true;
40
- };
41
- }>> & Readonly<{
42
- "onUpdate:modelValue"?: ((roles: IFdtoPermissionPosUserRole[]) => any) | undefined;
43
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
44
- export default _default;
@@ -1,11 +0,0 @@
1
- import type { IFdtoStaffInviteLookup, StaffInviteMatch } from '@/types/staff-invite';
2
- type __VLS_Props = {
3
- existing: IFdtoStaffInviteLookup;
4
- match: StaffInviteMatch;
5
- };
6
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
- update: () => any;
8
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- onUpdate?: (() => any) | undefined;
10
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
- export default _default;
@@ -1,35 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import type { IFdtoStaffInviteLookup, IFdtoStaffInviteProvider, StaffInviteMatch } from '@/types/staff-invite';
3
- /** What the Member details card contributes to an invite. */
4
- export interface MemberDetails {
5
- provider: string;
6
- match: StaffInviteMatch;
7
- mobile?: string;
8
- email?: string;
9
- displayName: string;
10
- employeeId?: string;
11
- }
12
- declare function readDetails(): MemberDetails;
13
- declare function isModified(): boolean;
14
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
15
- providers: {
16
- type: PropType<IFdtoStaffInviteProvider[]>;
17
- required: true;
18
- };
19
- }>, {
20
- readDetails: typeof readDetails;
21
- isModified: typeof isModified;
22
- /** Add is blocked while the key belongs to someone already. */
23
- hasExisting: import("vue").ComputedRef<boolean>;
24
- providerLabel: import("vue").ComputedRef<string>;
25
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
26
- "update-existing": (existing: IFdtoStaffInviteLookup) => any;
27
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
28
- providers: {
29
- type: PropType<IFdtoStaffInviteProvider[]>;
30
- required: true;
31
- };
32
- }>> & Readonly<{
33
- "onUpdate-existing"?: ((existing: IFdtoStaffInviteLookup) => any) | undefined;
34
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
35
- export default _default;
@@ -1,19 +0,0 @@
1
- import type { TeamMemberStatus } from '@/types/team';
2
- type __VLS_Props = {
3
- name: string;
4
- status: TeamMemberStatus;
5
- email?: string;
6
- phoneNumber?: string;
7
- };
8
- declare var __VLS_4: {};
9
- type __VLS_Slots = {} & {
10
- default?: (props: typeof __VLS_4) => any;
11
- };
12
- declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
14
- export default _default;
15
- type __VLS_WithSlots<T, S> = T & {
16
- new (): {
17
- $slots: S;
18
- };
19
- };
@@ -1,22 +0,0 @@
1
- function a(r, t) {
2
- let n = "", e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
3
- const l = e.length;
4
- for (let i = 0; i < r; i++)
5
- n += e.charAt(Math.floor(Math.random() * l));
6
- return n;
7
- }
8
- function c(r, t, n = 2) {
9
- if (r === null) return t.all;
10
- if (r.length === 0) return t.none;
11
- const e = r.slice(0, n).join(", ");
12
- return r.length > n ? `${e} ${t.more(r.length - n)}` : e;
13
- }
14
- function o(r) {
15
- const t = (r ?? "").trim().split(/\s+/).filter(Boolean);
16
- return t.length === 0 ? "" : t.length === 1 ? t[0].slice(0, 2) : t[0].charAt(0) + t[1].charAt(0);
17
- }
18
- export {
19
- o as n,
20
- a as r,
21
- c as s
22
- };
@@ -1,80 +0,0 @@
1
- import { computed as a, ref as o } from "vue";
2
- import { e as d } from "./iteration-BRk48OAH.js";
3
- import { u as K, n as S } from "./app-IdmhLBBn.js";
4
- import { i as g } from "./rule-CWR80AmG.js";
5
- const i = o([]), r = o(!1), l = o(!1), f = o(null), p = o(null), u = o(!1);
6
- function J() {
7
- const v = K();
8
- async function m() {
9
- const s = v.id.value;
10
- if (!s) return;
11
- f.value !== s && (i.value = [], r.value = !1, l.value = !1, f.value = s, u.value = !1);
12
- const n = localStorage.getItem("locale");
13
- if (!(r.value && p.value === n)) {
14
- if (l.value) {
15
- u.value = !0;
16
- return;
17
- }
18
- l.value = !0;
19
- try {
20
- i.value = await g.fetchReportPermissions(
21
- s,
22
- n
23
- ), r.value = !0, p.value = n;
24
- } catch (e) {
25
- console.warn("Failed to fetch dynamic report permissions, keeping last known list:", e), r.value = !1;
26
- } finally {
27
- l.value = !1, u.value && (u.value = !1, await m());
28
- }
29
- }
30
- }
31
- const c = S.filter(
32
- (s) => s.subject === d.F_RULE_SUBJECT.enum.report && s.conditions
33
- ), y = a(() => {
34
- const s = new Set(
35
- c.map((e) => {
36
- const t = typeof e.conditions == "string" ? JSON.parse(e.conditions) : e.conditions;
37
- return t == null ? void 0 : t.name;
38
- })
39
- ), n = i.value.filter((e) => !s.has(e.permissionKey)).map((e) => ({
40
- label: e.name,
41
- subject: d.F_RULE_SUBJECT.enum.report,
42
- actions: ["read"],
43
- conditions: { name: e.permissionKey },
44
- inverted: !1,
45
- reason: ""
46
- }));
47
- return [...c, ...n];
48
- }), R = a(() => {
49
- const s = new Set(
50
- c.map((n) => {
51
- const e = typeof n.conditions == "string" ? JSON.parse(n.conditions) : n.conditions;
52
- return e == null ? void 0 : e.name;
53
- })
54
- );
55
- for (const n of i.value)
56
- s.add(n.permissionKey);
57
- return s;
58
- }), h = a(() => {
59
- const s = new Set(
60
- c.map((e) => {
61
- const t = typeof e.conditions == "string" ? JSON.parse(e.conditions) : e.conditions;
62
- return t == null ? void 0 : t.name;
63
- })
64
- ), n = /* @__PURE__ */ new Set();
65
- for (const e of i.value)
66
- s.has(e.permissionKey) || n.add(e.permissionKey);
67
- return n;
68
- });
69
- return {
70
- fetchReportPermissions: m,
71
- allReportPermissions: y,
72
- availableReportKeys: R,
73
- customReportKeys: h,
74
- isLoading: a(() => l.value),
75
- isLoaded: a(() => r.value)
76
- };
77
- }
78
- export {
79
- J as u
80
- };
@@ -1,41 +0,0 @@
1
- import { computed as v, ref as u } from "vue";
2
- import { useCoreStore as f } from "@feedmepos/mf-common";
3
- import { g as p, b as m } from "./app-IdmhLBBn.js";
4
- const P = {
5
- async readProviders() {
6
- return p(await m("sso-providers").get(""));
7
- }
8
- }, n = u([]), t = u(null);
9
- let s = null;
10
- function g() {
11
- const i = f();
12
- async function a() {
13
- var r, o;
14
- const e = (r = i.currentBusiness.value) == null ? void 0 : r.id;
15
- if (!(!e || s === e)) {
16
- s = e, n.value = [], t.value = null;
17
- try {
18
- const c = await P.readProviders();
19
- s === e && (n.value = c);
20
- } catch {
21
- s === e && (s = null);
22
- } finally {
23
- ((o = i.currentBusiness.value) == null ? void 0 : o.id) === e && (t.value = e);
24
- }
25
- }
26
- }
27
- const l = v(
28
- () => {
29
- var e;
30
- return !!t.value && t.value === ((e = i.currentBusiness.value) == null ? void 0 : e.id);
31
- }
32
- );
33
- function d(e) {
34
- var r;
35
- return ((r = n.value.find((o) => o.slug === e)) == null ? void 0 : r.label) ?? e;
36
- }
37
- return { providers: n, isLoaded: l, loadProviders: a, providerLabel: d };
38
- }
39
- export {
40
- g as u
41
- };