@syzy/apphost 1.0.1 → 1.0.2

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 (213) hide show
  1. package/dist/App.js +83 -0
  2. package/dist/AppHostProvider.js +4 -0
  3. package/dist/AppHostRoutes.js +7 -0
  4. package/dist/api/image-api.js +45 -0
  5. package/dist/api/mapping-api.js +427 -0
  6. package/dist/bookingModule/components/AmenityForm.js +19 -0
  7. package/dist/bookingModule/components/BillingManagement.js +17 -0
  8. package/dist/bookingModule/components/CreateRoomForm.js +19 -0
  9. package/dist/bookingModule/components/ExtraRequirementForm.js +19 -0
  10. package/dist/bookingModule/components/ReservationForm.js +18 -0
  11. package/dist/bookingModule/components/RoomCategoryForm.js +19 -0
  12. package/dist/bookingModule/components/RoomCategoryPriceForm.js +20 -0
  13. package/dist/bookingModule/components/RoomExtraRequirementCapture.js +18 -0
  14. package/dist/bookingModule/components/RoomFacilityForm.js +19 -0
  15. package/dist/bookingModule/components/RoomReservationAction.js +18 -0
  16. package/dist/components/Home/Home.js +14 -0
  17. package/dist/components/Loader/Loader.js +5 -0
  18. package/dist/components/Login/Login.js +149 -0
  19. package/dist/components/Login/loginSchema.js +41 -0
  20. package/dist/components/Mappings/BranchMapping/Branch.js +135 -0
  21. package/dist/components/Mappings/BranchMapping/BranchTableColumns.js +21 -0
  22. package/dist/components/Mappings/BranchMapping/MappingFormBranchUser.js +150 -0
  23. package/dist/components/Mappings/BranchMapping/MappingTableColumns.js +29 -0
  24. package/dist/components/Mappings/BranchMapping/branchSchema.js +34 -0
  25. package/dist/components/Mappings/ComponentMapping/ComponentRoleMapping.js +98 -0
  26. package/dist/components/Mappings/ComponentMapping/componentRoleColumns.js +29 -0
  27. package/dist/components/Mappings/MappingForm/MappingForm.js +142 -0
  28. package/dist/components/Mappings/MappingForm/mappingSchema.js +32 -0
  29. package/dist/components/Mappings/RoleMapping/MappingFormUserRole.js +194 -0
  30. package/dist/components/Mappings/RoleMapping/UserRoleTableColumns.js +33 -0
  31. package/dist/components/NavBar/Sidebar.js +56 -0
  32. package/dist/components/ProfileForm/ProfileForm.js +190 -0
  33. package/dist/components/ProfileForm/ProfileList.js +33 -0
  34. package/dist/components/ProfileForm/profileColumns.js +67 -0
  35. package/dist/components/ProfileForm/profileSchema.js +50 -0
  36. package/dist/components/SettingsPage/SettingsPage.js +240 -0
  37. package/dist/components/api/settings-api.js +131 -0
  38. package/dist/components/common/Form/FormActionButtons.js +6 -0
  39. package/dist/components/common/Form/FormLabel.js +6 -0
  40. package/dist/components/common/ListTable/ListHeader.js +5 -0
  41. package/dist/components/common/ListTable/ListTable.js +31 -0
  42. package/dist/components/common/Modal/Modal.js +6 -0
  43. package/dist/config/EnvConfig.js +13 -0
  44. package/dist/config/amplifyConfig.js +45 -0
  45. package/dist/configureAppHost.js +5 -0
  46. package/dist/customGraphQL/customMutations.js +53 -0
  47. package/dist/customGraphQL/customQueries.js +104 -0
  48. package/dist/domain/input/input-types.js +1 -0
  49. package/dist/domain/model/BranchDto.js +8 -0
  50. package/dist/domain/model/ComponentMappingDto.js +19 -0
  51. package/dist/domain/model/MappingDto.js +16 -0
  52. package/dist/domain/model/PrefixDescriptionDto.js +13 -0
  53. package/dist/domain/model/ProfileDto.js +20 -0
  54. package/dist/domain/model/RoleMappingDto.js +19 -0
  55. package/dist/domain/model/SettingsDto.js +7 -0
  56. package/dist/domain/model/UserMappingDto.js +28 -0
  57. package/dist/domain/model/imageDto.js +1 -0
  58. package/dist/domain/type/EntityTypes.js +6 -0
  59. package/dist/domain/type/MappingOptions.js +1 -0
  60. package/dist/domain/type/MappingTypes.js +7 -0
  61. package/dist/domain/type/Nullable.js +1 -0
  62. package/dist/domain/type/ResettingPeriodOptions.js +8 -0
  63. package/dist/domain/type/RolesEnum.js +7 -0
  64. package/dist/domain/type/SelectType.js +1 -0
  65. package/dist/domain/type/StatusEnum.js +6 -0
  66. package/dist/domain/type/signUpOptions.js +4 -0
  67. package/dist/domain/type/statusOptions.js +4 -0
  68. package/dist/graphql/profileQueries.js +89 -0
  69. package/dist/hoc/withSyzyAuth.js +87 -0
  70. package/dist/hooks/useCurrentUser.js +6 -0
  71. package/dist/hooks/useDispatch.js +7 -0
  72. package/dist/hooks/usePermission.js +7 -0
  73. package/dist/index.js +3 -15
  74. package/dist/main.js +60 -0
  75. package/dist/services/Client.Service.js +96 -0
  76. package/dist/services/Storage-service.js +26 -0
  77. package/dist/services/navigationMenu.js +9 -0
  78. package/dist/static/constants.js +34 -0
  79. package/dist/store/AppAction.js +5 -0
  80. package/dist/store/AppContext.js +3 -0
  81. package/dist/store/AppContextType.js +6 -0
  82. package/dist/store/AppProvider.js +32 -0
  83. package/dist/store/HostedInContainerContext.js +11 -0
  84. package/dist/store/SesssionReducer.js +16 -0
  85. package/dist/types/App.d.ts +4 -0
  86. package/dist/types/AppHostProvider.d.ts +6 -0
  87. package/dist/types/AppHostRoutes.d.ts +1 -0
  88. package/dist/types/api/image-api.d.ts +8 -0
  89. package/dist/types/api/mapping-api.d.ts +80 -0
  90. package/dist/types/bookingModule/components/AmenityForm.d.ts +3 -0
  91. package/dist/types/bookingModule/components/BillingManagement.d.ts +3 -0
  92. package/dist/types/bookingModule/components/CreateRoomForm.d.ts +3 -0
  93. package/dist/types/bookingModule/components/ExtraRequirementForm.d.ts +3 -0
  94. package/dist/types/bookingModule/components/ReservationForm.d.ts +3 -0
  95. package/dist/types/bookingModule/components/RoomCategoryForm.d.ts +3 -0
  96. package/dist/types/bookingModule/components/RoomCategoryPriceForm.d.ts +3 -0
  97. package/dist/types/bookingModule/components/RoomExtraRequirementCapture.d.ts +3 -0
  98. package/dist/types/bookingModule/components/RoomFacilityForm.d.ts +3 -0
  99. package/dist/types/bookingModule/components/RoomReservationAction.d.ts +3 -0
  100. package/dist/types/components/Home/Home.d.ts +3 -0
  101. package/dist/types/components/Loader/Loader.d.ts +2 -0
  102. package/dist/types/components/Login/Login.d.ts +7 -0
  103. package/dist/types/components/Login/loginSchema.d.ts +27 -0
  104. package/dist/types/components/Mappings/BranchMapping/Branch.d.ts +5 -0
  105. package/dist/types/components/Mappings/BranchMapping/BranchTableColumns.d.ts +10 -0
  106. package/dist/types/components/Mappings/BranchMapping/MappingFormBranchUser.d.ts +3 -0
  107. package/dist/types/components/Mappings/BranchMapping/MappingTableColumns.d.ts +14 -0
  108. package/dist/types/components/Mappings/BranchMapping/branchSchema.d.ts +37 -0
  109. package/dist/types/components/Mappings/ComponentMapping/ComponentRoleMapping.d.ts +3 -0
  110. package/dist/types/components/Mappings/ComponentMapping/componentRoleColumns.d.ts +3 -0
  111. package/dist/types/components/Mappings/MappingForm/MappingForm.d.ts +35 -0
  112. package/dist/types/components/Mappings/MappingForm/mappingSchema.d.ts +23 -0
  113. package/dist/types/components/Mappings/RoleMapping/MappingFormUserRole.d.ts +5 -0
  114. package/dist/types/components/Mappings/RoleMapping/UserRoleTableColumns.d.ts +3 -0
  115. package/dist/types/components/NavBar/Sidebar.d.ts +4 -0
  116. package/dist/types/components/ProfileForm/ProfileForm.d.ts +3 -0
  117. package/dist/types/components/ProfileForm/ProfileList.d.ts +3 -0
  118. package/dist/types/components/ProfileForm/profileColumns.d.ts +3 -0
  119. package/dist/types/components/ProfileForm/profileSchema.d.ts +52 -0
  120. package/dist/types/components/SettingsPage/SettingsPage.d.ts +3 -0
  121. package/dist/types/components/api/settings-api.d.ts +26 -0
  122. package/dist/types/components/common/Form/FormActionButtons.d.ts +11 -0
  123. package/dist/types/components/common/Form/FormLabel.d.ts +8 -0
  124. package/dist/types/components/common/ListTable/ListHeader.d.ts +8 -0
  125. package/dist/types/components/common/ListTable/ListTable.d.ts +17 -0
  126. package/dist/types/components/common/Modal/Modal.d.ts +11 -0
  127. package/dist/types/config/EnvConfig.d.ts +13 -0
  128. package/dist/types/config/amplifyConfig.d.ts +1 -0
  129. package/dist/types/configureAppHost.d.ts +6 -0
  130. package/dist/types/customGraphQL/customMutations.d.ts +3 -0
  131. package/dist/types/customGraphQL/customQueries.d.ts +7 -0
  132. package/dist/types/domain/input/input-types.d.ts +47 -0
  133. package/dist/types/domain/model/BranchDto.d.ts +9 -0
  134. package/dist/types/domain/model/ComponentMappingDto.d.ts +24 -0
  135. package/dist/types/domain/model/MappingDto.d.ts +30 -0
  136. package/dist/types/domain/model/PrefixDescriptionDto.d.ts +16 -0
  137. package/dist/types/domain/model/ProfileDto.d.ts +21 -0
  138. package/dist/types/domain/model/RoleMappingDto.d.ts +14 -0
  139. package/dist/types/domain/model/SettingsDto.d.ts +8 -0
  140. package/dist/types/domain/model/UserMappingDto.d.ts +14 -0
  141. package/dist/types/domain/model/imageDto.d.ts +4 -0
  142. package/dist/types/domain/type/EntityTypes.d.ts +5 -0
  143. package/dist/types/domain/type/MappingOptions.d.ts +5 -0
  144. package/dist/types/domain/type/MappingTypes.d.ts +6 -0
  145. package/dist/types/domain/type/Nullable.d.ts +13 -0
  146. package/dist/types/domain/type/ResettingPeriodOptions.d.ts +2 -0
  147. package/dist/types/domain/type/RolesEnum.d.ts +6 -0
  148. package/dist/types/domain/type/SelectType.d.ts +16 -0
  149. package/dist/types/domain/type/StatusEnum.d.ts +5 -0
  150. package/dist/types/domain/type/signUpOptions.d.ts +2 -0
  151. package/dist/types/domain/type/statusOptions.d.ts +2 -0
  152. package/dist/types/graphql/profileQueries.d.ts +4 -0
  153. package/dist/types/hoc/withSyzyAuth.d.ts +2 -0
  154. package/dist/types/hooks/useCurrentUser.d.ts +3 -0
  155. package/dist/types/hooks/useDispatch.d.ts +3 -0
  156. package/dist/types/hooks/usePermission.d.ts +1 -0
  157. package/dist/types/index.d.ts +3 -0
  158. package/dist/types/main.d.ts +4 -0
  159. package/dist/types/services/Client.Service.d.ts +12 -0
  160. package/dist/types/services/Storage-service.d.ts +2 -0
  161. package/dist/types/services/navigationMenu.d.ts +1 -0
  162. package/dist/types/static/constants.d.ts +34 -0
  163. package/dist/types/store/AppAction.d.ts +11 -0
  164. package/dist/types/store/AppContext.d.ts +3 -0
  165. package/dist/types/store/AppContextType.d.ts +12 -0
  166. package/dist/types/store/AppProvider.d.ts +7 -0
  167. package/dist/types/store/HostedInContainerContext.d.ts +5 -0
  168. package/dist/types/store/SesssionReducer.d.ts +4 -0
  169. package/dist/types/types.d.ts +26 -0
  170. package/dist/types/util/AuthUtils.d.ts +1 -0
  171. package/dist/types/util/LogEnum.d.ts +6 -0
  172. package/dist/types/util/Logger.d.ts +6 -0
  173. package/dist/types/util/SyzyDate.d.ts +69 -0
  174. package/dist/types/util/dateUtils.d.ts +10 -0
  175. package/dist/types/util/hostedinContainer.d.ts +1 -0
  176. package/dist/types/util/model-types.d.ts +96 -0
  177. package/dist/types/util/prefixAndResettingValidation.d.ts +9 -0
  178. package/dist/types/util/transformToData.d.ts +1 -0
  179. package/dist/types.js +14 -0
  180. package/dist/util/AuthUtils.js +10 -0
  181. package/dist/util/LogEnum.js +7 -0
  182. package/dist/util/Logger.js +18 -0
  183. package/dist/util/SyzyDate.js +265 -0
  184. package/dist/util/dateUtils.js +24 -0
  185. package/dist/util/hostedinContainer.js +9 -0
  186. package/dist/util/model-types.js +18 -0
  187. package/dist/util/prefixAndResettingValidation.js +54 -0
  188. package/dist/util/transformToData.js +9 -0
  189. package/package.json +14 -9
  190. package/dist/__federation_shared_@tanstack/react-query-DHuUsaNz.js +0 -2517
  191. package/dist/__federation_shared_react-CikWE6qG.js +0 -7
  192. package/dist/__federation_shared_react-bootstrap-BKlZRvMR.js +0 -7516
  193. package/dist/__federation_shared_react-dom-vrQ70Ay8.js +0 -372
  194. package/dist/__federation_shared_react-router-dom-BKminmS4.js +0 -10448
  195. package/dist/__federation_shared_react-select-B6kehBDI.js +0 -4056
  196. package/dist/__federation_shared_react-toastify-B0S0UGr3.js +0 -412
  197. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  198. package/dist/_virtual___federation_fn_import-XZCKozko.js +0 -217
  199. package/dist/favicon.ico +0 -0
  200. package/dist/index-DgtWMtjZ.js +0 -184
  201. package/dist/index-eZknuYwc.js +0 -1219
  202. package/dist/jsx-runtime-D_t4bG-_.js +0 -264
  203. package/dist/manifest.webmanifest +0 -1
  204. package/dist/pwa/Hotel-icon.jpg +0 -0
  205. package/dist/pwa/apple-touch-icon-180x180.png +0 -0
  206. package/dist/pwa/favicon.ico +0 -0
  207. package/dist/pwa/maskable-icon-512x512.png +0 -0
  208. package/dist/pwa/pwa-192x192.png +0 -0
  209. package/dist/pwa/pwa-512x512.png +0 -0
  210. package/dist/pwa/pwa-64x64.png +0 -0
  211. package/dist/registerSW.js +0 -1
  212. package/dist/sw.js +0 -1
  213. package/dist/workbox-1ef09536.js +0 -1
@@ -0,0 +1,14 @@
1
+ export interface UserMappingDto {
2
+ pk: string;
3
+ sk: string;
4
+ entity: string;
5
+ userId: string;
6
+ userName: string;
7
+ roleId: string;
8
+ roleName: string;
9
+ disabledDt: string;
10
+ createdDt: string;
11
+ status: string;
12
+ }
13
+ export declare const initUserMappingDto: UserMappingDto;
14
+ export declare const transformtoUserMappingDto: (userData: any) => UserMappingDto;
@@ -0,0 +1,4 @@
1
+ export interface ImageDto {
2
+ imageKey: string;
3
+ file: File;
4
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum EntityTypes {
2
+ USER = "USER",
3
+ ROLE = "ROLE",
4
+ COMPONENT = "COMPONENT"
5
+ }
@@ -0,0 +1,5 @@
1
+ export interface MappingOptions {
2
+ id: string;
3
+ name: string;
4
+ branchName?: string;
5
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum MappingTypes {
2
+ Users = "Users",
3
+ Roles = "Roles",
4
+ Plans = "Plans",
5
+ Components = "Accessibility"
6
+ }
@@ -0,0 +1,13 @@
1
+ import { SelectOptionNumber, SelectOptionStr, SelectOptNumber } from "./SelectType";
2
+ export type UndefinedDate = Date | undefined;
3
+ export type UndefinedString = string | undefined;
4
+ export type UndefinedNumber = number | undefined;
5
+ export type UndefinedBoolean = boolean | undefined;
6
+ export type NullableFile = File | null;
7
+ export type NullableDate = Date | null;
8
+ export type NullableNumber = number | null;
9
+ export type NullableFilterInput<T> = T | undefined | null;
10
+ export type NullableSelectOptNumber = SelectOptNumber | null;
11
+ export type NullableSelectOptionStr = SelectOptionStr | null;
12
+ export type NullableSelectOptionNumber = SelectOptionNumber | null;
13
+ export type ColumnDataType = string | number | boolean | string[] | Date | null;
@@ -0,0 +1,2 @@
1
+ import { SelectOptionStr } from "./SelectType";
2
+ export declare const ResettingPeriodOptions: SelectOptionStr[];
@@ -0,0 +1,6 @@
1
+ export declare enum Roles {
2
+ SuperAdmin = "SUPERADMIN",
3
+ SupportAdmin = "SUPPORTADMIN",
4
+ Admin = "ADMIN",
5
+ User = "USER"
6
+ }
@@ -0,0 +1,16 @@
1
+ export interface SelectOptionStr extends SelectOption<string> {
2
+ }
3
+ export interface SelectOptionBool extends SelectOption<boolean> {
4
+ }
5
+ export interface SelectOptNumber extends SelectOption<number> {
6
+ }
7
+ export interface SelectOption<T> {
8
+ value: T;
9
+ label: string;
10
+ }
11
+ export interface SelectOptionNumber extends SelectOptionType<number> {
12
+ }
13
+ export interface SelectOptionType<T> {
14
+ value: string;
15
+ label: T;
16
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum Status {
2
+ New = "New",
3
+ Active = "ACTIVE",
4
+ Inactive = "INACTIVE"
5
+ }
@@ -0,0 +1,2 @@
1
+ import { SelectOptionStr } from "./SelectType";
2
+ export declare const sighUpOptions: SelectOptionStr[];
@@ -0,0 +1,2 @@
1
+ import { SelectOptionStr } from "./SelectType";
2
+ export declare const statusOptions: SelectOptionStr[];
@@ -0,0 +1,4 @@
1
+ export declare const createProfile = "\n mutation CreateProfile($input: ProfileInput!) {\n createProfile(input: $input) {\n pk\n sk\n name\n email\n phoneNumber\n address\n dob\n contactRelation\n contactPersonName\n contactPersonNumber\n aadhaarNumber\n aadhaarFile\n isAdmin\n status\n createdDt\n createdBy\n }\n }\n";
2
+ export declare const updateProfile = "\n mutation UpdateProfile($input: ProfileInput!) {\n updateProfile(input: $input) {\n pk\n sk\n name\n email\n phoneNumber\n address\n dob\n contactRelation\n contactPersonName\n contactPersonNumber\n aadhaarNumber\n aadhaarFile\n isAdmin\n status\n createdDt\n createdBy\n }\n }\n";
3
+ export declare const listProfiles = "\n query ListProfiles {\n listProfiles {\n pk\n sk\n name\n email\n phoneNumber\n address\n dob\n contactRelation\n contactPersonName\n contactPersonNumber\n aadhaarNumber\n aadhaarFile\n isAdmin\n status\n createdDt\n createdBy\n }\n }\n";
4
+ export declare const getProfile = "\n query GetProfile($pk: ID!) {\n getProfile(pk: $pk) {\n pk\n sk\n name\n email\n phoneNumber\n address\n dob\n contactRelation\n contactPersonName\n contactPersonNumber\n aadhaarNumber\n aadhaarFile\n isAdmin\n status\n createdDt\n createdBy\n }\n }\n";
@@ -0,0 +1,2 @@
1
+ import './withSyzyAuth.css';
2
+ export declare function withSyzyAuth<P extends object>(WrappedComponent: React.ComponentType<P>): (props: P) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const useCurrentUser: () => {
2
+ user: import("../store/AppContextType").AppSession;
3
+ };
@@ -0,0 +1,3 @@
1
+ export declare const useDispatch: () => {
2
+ dispatch: import("react").Dispatch<import("../store/AppAction").AppAction> | undefined;
3
+ };
@@ -0,0 +1 @@
1
+ export declare function AmIPermitted(componentName: string): boolean;
@@ -0,0 +1,3 @@
1
+ export { AppHostProvider } from "./AppHostProvider";
2
+ export { AppHostRoutes } from "./AppHostRoutes";
3
+ export { configureAppHost } from "./configureAppHost";
@@ -0,0 +1,4 @@
1
+ import './index.css';
2
+ import 'bootstrap/dist/css/bootstrap.min.css';
3
+ import 'react-toastify/dist/ReactToastify.css';
4
+ import './styles/typography.css';
@@ -0,0 +1,12 @@
1
+ import { V6Client } from '@aws-amplify/api-graphql';
2
+ import { GraphQLClient } from "graphql-request";
3
+ type UndefinedString = string | undefined;
4
+ export declare class Client {
5
+ static client: any;
6
+ static subClient: any;
7
+ static getToken(): Promise<UndefinedString>;
8
+ static getClient(forceRefresh?: boolean): Promise<V6Client>;
9
+ static getCustomGraphqlClient(endPoint: string): Promise<GraphQLClient>;
10
+ static startClientResetScheduler(): () => void;
11
+ }
12
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const getImageUrl: (imageKey: string | undefined | null) => Promise<string | undefined>;
2
+ export declare const uploadImage: (imageKey: string, image: File) => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const getSidebarMenu: () => Promise<unknown>;
@@ -0,0 +1,34 @@
1
+ export declare const VITE_API_AUTHMODE = "userPool";
2
+ export declare const INVOICE_PREFIX_FORMAT = "invoice-prefix-format-settings";
3
+ export declare const INVOICE_RESETTING_PERIOD = "invoice-resetting-period";
4
+ export declare const INVOICE_SEQUENCE_PADDING = "invoice-sequence-padding";
5
+ export declare const INVOICE_SERIES_NUMBER = "invoice-series-number-setting";
6
+ export declare const BOOKING_RECEIPT_PREFIX_FORMAT = "booking-receipt-prefix-format-settings";
7
+ export declare const BOOKING_RECEIPT_RESETTING_PERIOD = "booking-receipt-resetting-period";
8
+ export declare const BOOKING_RECEIPT_SEQUENCE_PADDING = "booking-receipt-sequence-padding";
9
+ export declare const BOOKING_RECEIPT_SERIES_NUMBER = "booking-receipt-series-number-setting";
10
+ export declare const PURCHASE_ORDER_PREFIX_FORMAT = "purchase-order-prefix-format-settings";
11
+ export declare const PURCHASE_ORDER_RESETTING_PERIOD = "purchase-order-resetting-period";
12
+ export declare const PURCHASE_ORDER_SEQUENCE_PADDING = "purchase-order-sequence-padding";
13
+ export declare const PREFIX_CONSTANT_FY = "{FY}";
14
+ export declare const PREFIX_CONSTANT_fy = "{fy}";
15
+ export declare const PREFIX_CONSTANT_FYPLUS1 = "{FYPLUS1}";
16
+ export declare const PREFIX_CONSTANT_fyplus1 = "{fyplus1}";
17
+ export declare const PREFIX_CONSTANT_FYMINUS1 = "{FYMINUS1}";
18
+ export declare const PREFIX_CONSTANT_fyminus1 = "{fyminus1}";
19
+ export declare const PREFIX_CONSTANT_Y = "{Y}";
20
+ export declare const PREFIX_CONSTANT_y = "{y}";
21
+ export declare const PREFIX_CONSTANT_M = "{M}";
22
+ export declare const PREFIX_CONSTANT_D = "{D}";
23
+ export declare const FINANCIAL_YEARLY = "FINANCIAL YEARLY";
24
+ export declare const YEARLY = "YEARLY";
25
+ export declare const MONTHLY = "MONTHLY";
26
+ export declare const DAILY = "DAILY";
27
+ export declare const NEVER = "NEVER";
28
+ export declare const RESERVATION_PREFIX_FORMAT = "reservation-prefix-format";
29
+ export declare const RESERVATION_RESETTING_PERIOD = "reservation-resetting-period";
30
+ export declare const RESERVATION_SEQUENCE_PADDING = "reservation-sequence-padding";
31
+ export declare const ALL = "All";
32
+ export declare const HIDE_SIGN_UP = "hide-sign-up";
33
+ export declare const HIDE_SIGN_UP_IS_YES = "Yes";
34
+ export declare const HIDE_SIGN_UP_IS_NO = "No";
@@ -0,0 +1,11 @@
1
+ import { AppSession } from "./AppContextType";
2
+ export declare enum AppActionEnum {
3
+ SignIn = "SIGNIN",
4
+ SignOut = "SIGNOUT"
5
+ }
6
+ export type AppAction = {
7
+ type: AppActionEnum.SignIn;
8
+ session: AppSession;
9
+ } | {
10
+ type: AppActionEnum.SignOut;
11
+ };
@@ -0,0 +1,3 @@
1
+ import { AppContextProps } from './AppContextType';
2
+ declare const AppContext: import("react").Context<AppContextProps | undefined>;
3
+ export default AppContext;
@@ -0,0 +1,12 @@
1
+ import { AppAction } from "./AppAction";
2
+ export interface AppSession {
3
+ userName: string;
4
+ branchId?: string;
5
+ roles: string[];
6
+ allowedComponents?: string[];
7
+ }
8
+ export declare const defaultSession: AppSession;
9
+ export interface AppContextProps {
10
+ user: AppSession;
11
+ dispatch: React.Dispatch<AppAction>;
12
+ }
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from "react";
2
+ import 'react-toastify/dist/ReactToastify.css';
3
+ interface AppProviderProps {
4
+ children: ReactNode;
5
+ }
6
+ declare const AppProvider: React.FC<AppProviderProps>;
7
+ export default AppProvider;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const HostedInContainerProvider: React.FC<{
3
+ children: React.ReactNode;
4
+ }>;
5
+ export declare const useHostedInContainer: () => boolean;
@@ -0,0 +1,4 @@
1
+ import { Reducer, Dispatch } from 'react';
2
+ import { AppSession } from './AppContextType';
3
+ export declare const APPHOSTSESSION_KEY = "AppHostSession";
4
+ export declare const useSessionReducer: <T extends AppSession, A>(reducer: Reducer<T, A>, initialState: T, storageKey: string) => [T, Dispatch<A>];
@@ -0,0 +1,26 @@
1
+ export interface Route {
2
+ path: string;
3
+ component: React.ComponentType<any>;
4
+ title: string;
5
+ requiredComponent?: string;
6
+ exact?: boolean;
7
+ acl?: {
8
+ [key in Role]: {
9
+ type: DecisionType;
10
+ meta?: string;
11
+ };
12
+ };
13
+ props?: any;
14
+ }
15
+ export declare enum Role {
16
+ GUEST = "GUEST",
17
+ MEMBER = "MEMBER",
18
+ CHAPTERADMIN = "CHAPTERADMIN",
19
+ SUPPORTADMIN = "SUPPORTADMIN",
20
+ SUPERADMIN = "SUPERADMIN"
21
+ }
22
+ export declare enum DecisionType {
23
+ ALLOW = "allow",
24
+ DENY = "deny",
25
+ REDIRECT = "redirect"
26
+ }
@@ -0,0 +1 @@
1
+ export declare function isSignedIn(): Promise<boolean>;
@@ -0,0 +1,6 @@
1
+ export declare enum LogCategoryEnum {
2
+ Info = "info",
3
+ Warning = "warning",
4
+ Error = "error",
5
+ Warn = "Warn"
6
+ }
@@ -0,0 +1,6 @@
1
+ export declare const logger: {
2
+ debug: (...args: any[]) => false | void;
3
+ info: (...args: any[]) => false | void;
4
+ warn: (...args: any[]) => false | void;
5
+ error: (...args: any[]) => false | void;
6
+ };
@@ -0,0 +1,69 @@
1
+ export declare class SyzyDate extends Date {
2
+ static months: string[];
3
+ addDays: (days: number) => Date;
4
+ reduceDays: (days: number) => Date;
5
+ isSameDate: (date: Date) => boolean;
6
+ isToday: () => boolean;
7
+ clone: () => Date;
8
+ isAnotherMonth: (date: Date) => boolean;
9
+ isWeekend: () => boolean;
10
+ toISODate: () => string;
11
+ /**
12
+ *
13
+ * @returns Current Date as ISO string with T between date and time
14
+ */
15
+ toISODateTime: () => string;
16
+ toISODateString(): string;
17
+ /***
18
+ * To Given Format
19
+ * DD- Date
20
+ * MM- Month in 2 digits
21
+ * Mon- Month in 3 letters
22
+ * mm- Minutes
23
+ * HH- Hours in 24 hour format
24
+ * hh- Hours in 12 hour format
25
+ * ss- Seconds
26
+ * YYYY- Year in 4 digits
27
+ * YY- Year in 2 digits
28
+ */
29
+ toDateFormatString(format: string): string;
30
+ getCurrentISODate: () => string;
31
+ toDate: () => Date;
32
+ getCurrentDate: () => SyzyDate;
33
+ currentWeek: () => number;
34
+ currentTerm: () => number;
35
+ currentQuarter: () => number;
36
+ getCurrentYrAndMonAndQuarterAndTerm: () => {
37
+ currentYr: number;
38
+ currentMon: number;
39
+ currTerm: number;
40
+ currentQuarter: number;
41
+ };
42
+ getWeekNo: () => number;
43
+ getcurrentTerm: () => number;
44
+ getCurrentQuarter: () => number;
45
+ getCurrentMonthStartAndEnd: () => {
46
+ startOfMonth: Date;
47
+ endOfMonth: Date;
48
+ };
49
+ getCurrentTermStartAndEnd: () => {
50
+ startOfTerm: Date;
51
+ endDateOfTerm: Date;
52
+ };
53
+ getCurrentYearStartAndEnd: () => {
54
+ startOfYear: Date;
55
+ endOfYear: Date;
56
+ };
57
+ getCurrentQuarterStartAndEnd: () => {
58
+ startDateOfQuarter: Date;
59
+ endDateOfQuarter: Date;
60
+ };
61
+ getCurrentWeekStartAndEnd: () => {
62
+ startDateOfWeek: Date;
63
+ endDateOfWeek: Date;
64
+ };
65
+ getSelectedMonthStartAndEnd: (month: number) => {
66
+ startOfSelectedMonth: Date;
67
+ endOfSelectedMonth: Date;
68
+ };
69
+ }
@@ -0,0 +1,10 @@
1
+ import { SyzyDate } from "./SyzyDate";
2
+ export declare const DATE_FORMAT_ISO_DD_MON_YYYY = "DD-Mon-YYYY";
3
+ export declare const DATE_FORMAT_ISO_YYYY_MM_DD = "YYYY-MM-DD";
4
+ export declare const DATE_FORMAT_DD_MM_YYYY = "DD-MM-YYYY";
5
+ export declare const DATE_FORMAT_ISO_YYYY_MM_DD_HH_MM = "YYYY-MM-DD HH:mm";
6
+ export declare const DATE_FORMAT_ISO_YYYY_MM_DD_HH_MM_SS = "YYYY-MM-DD HH:mm:ss";
7
+ export declare const DATE_FORMAT_ISO_DD_MON_YYYY_HH_MM = "DD-Mon-YYYY HH:mm";
8
+ export declare const DATE_FORMAT_ISO_DD_MON_YYYY_HH_MM_SS = "DD-Mon-YYYY HH:mm:ss";
9
+ export declare const formatDateWithShortMonth: (isoDateString: string) => string;
10
+ export declare const compareDate: (date1: SyzyDate, date2: SyzyDate) => boolean;
@@ -0,0 +1 @@
1
+ export declare const isHostedInContainer: () => boolean;
@@ -0,0 +1,96 @@
1
+ export type ModelStringKeyConditionInput = {
2
+ eq?: string | null;
3
+ le?: string | null;
4
+ lt?: string | null;
5
+ ge?: string | null;
6
+ gt?: string | null;
7
+ between?: Array<string | null> | null;
8
+ beginsWith?: string | null;
9
+ };
10
+ export declare enum ModelSortDirection {
11
+ ASC = "ASC",
12
+ DESC = "DESC"
13
+ }
14
+ export declare enum ModelAttributeTypes {
15
+ binary = "binary",
16
+ binarySet = "binarySet",
17
+ bool = "bool",
18
+ list = "list",
19
+ map = "map",
20
+ number = "number",
21
+ numberSet = "numberSet",
22
+ string = "string",
23
+ stringSet = "stringSet",
24
+ _null = "_null"
25
+ }
26
+ export type ModelSizeInput = {
27
+ ne?: number | null;
28
+ eq?: number | null;
29
+ le?: number | null;
30
+ lt?: number | null;
31
+ ge?: number | null;
32
+ gt?: number | null;
33
+ between?: Array<number | null> | null;
34
+ };
35
+ export type ModelIDInput = {
36
+ ne?: string | null;
37
+ eq?: string | null;
38
+ le?: string | null;
39
+ lt?: string | null;
40
+ ge?: string | null;
41
+ gt?: string | null;
42
+ contains?: string | null;
43
+ notContains?: string | null;
44
+ between?: Array<string | null> | null;
45
+ in?: Array<string | null> | null;
46
+ beginsWith?: string | null;
47
+ attributeExists?: boolean | null;
48
+ attributeType?: ModelAttributeTypes | null;
49
+ size?: ModelSizeInput | null;
50
+ };
51
+ export type ModelStringInput = {
52
+ ne?: string | null;
53
+ eq?: string | null;
54
+ le?: string | null;
55
+ lt?: string | null;
56
+ ge?: string | null;
57
+ gt?: string | null;
58
+ contains?: string | null;
59
+ notContains?: string | null;
60
+ between?: Array<string | null> | null;
61
+ in?: Array<string | null> | null;
62
+ beginsWith?: string | null;
63
+ attributeExists?: boolean | null;
64
+ attributeType?: ModelAttributeTypes | null;
65
+ size?: ModelSizeInput | null;
66
+ };
67
+ export type ModelIntInput = {
68
+ ne?: number | null;
69
+ eq?: number | null;
70
+ le?: number | null;
71
+ lt?: number | null;
72
+ ge?: number | null;
73
+ gt?: number | null;
74
+ between?: Array<number | null> | null;
75
+ in?: Array<number | null> | null;
76
+ attributeExists?: boolean | null;
77
+ attributeType?: ModelAttributeTypes | null;
78
+ };
79
+ export type ModelFloatInput = {
80
+ ne?: number | null;
81
+ eq?: number | null;
82
+ le?: number | null;
83
+ lt?: number | null;
84
+ ge?: number | null;
85
+ gt?: number | null;
86
+ between?: Array<number | null> | null;
87
+ in?: Array<number | null> | null;
88
+ attributeExists?: boolean | null;
89
+ attributeType?: ModelAttributeTypes | null;
90
+ };
91
+ export type ModelBooleanInput = {
92
+ ne?: boolean | null;
93
+ eq?: boolean | null;
94
+ attributeExists?: boolean | null;
95
+ attributeType?: ModelAttributeTypes | null;
96
+ };
@@ -0,0 +1,9 @@
1
+ export declare const validateFullWrapper: (val: string) => string | undefined;
2
+ export declare const validateFirstOccurance: (val: string) => {
3
+ firstWrapper: string | null;
4
+ validTokens: string[];
5
+ };
6
+ export declare const resettingOptions: (prefix: string) => {
7
+ index: number;
8
+ periods: string[];
9
+ } | null;
@@ -0,0 +1 @@
1
+ export declare const transformToData: <T>(data: any) => T;
package/dist/types.js ADDED
@@ -0,0 +1,14 @@
1
+ export var Role;
2
+ (function (Role) {
3
+ Role["GUEST"] = "GUEST";
4
+ Role["MEMBER"] = "MEMBER";
5
+ Role["CHAPTERADMIN"] = "CHAPTERADMIN";
6
+ Role["SUPPORTADMIN"] = "SUPPORTADMIN";
7
+ Role["SUPERADMIN"] = "SUPERADMIN";
8
+ })(Role || (Role = {}));
9
+ export var DecisionType;
10
+ (function (DecisionType) {
11
+ DecisionType["ALLOW"] = "allow";
12
+ DecisionType["DENY"] = "deny";
13
+ DecisionType["REDIRECT"] = "redirect";
14
+ })(DecisionType || (DecisionType = {}));
@@ -0,0 +1,10 @@
1
+ import { getCurrentUser } from "aws-amplify/auth";
2
+ export async function isSignedIn() {
3
+ try {
4
+ const session = await getCurrentUser();
5
+ return session !== null && session !== undefined && session.userId !== undefined;
6
+ }
7
+ catch {
8
+ return false;
9
+ }
10
+ }
@@ -0,0 +1,7 @@
1
+ export var LogCategoryEnum;
2
+ (function (LogCategoryEnum) {
3
+ LogCategoryEnum["Info"] = "info";
4
+ LogCategoryEnum["Warning"] = "warning";
5
+ LogCategoryEnum["Error"] = "error";
6
+ LogCategoryEnum["Warn"] = "Warn";
7
+ })(LogCategoryEnum || (LogCategoryEnum = {}));
@@ -0,0 +1,18 @@
1
+ const levels = {
2
+ debug: 1,
3
+ info: 2,
4
+ warn: 3,
5
+ error: 4,
6
+ none: 5,
7
+ };
8
+ // Current log level (from env)
9
+ const currentLevel = (import.meta.env.VITE_LOG_LEVEL || 'info');
10
+ function shouldLog(level) {
11
+ return levels[level] >= levels[currentLevel];
12
+ }
13
+ export const logger = {
14
+ debug: (...args) => shouldLog('debug') && console.debug('[DEBUG]', ...args),
15
+ info: (...args) => shouldLog('info') && console.info('[INFO]', ...args),
16
+ warn: (...args) => shouldLog('warn') && console.warn('[WARN]', ...args),
17
+ error: (...args) => shouldLog('error') && console.error('[ERROR]', ...args),
18
+ };