nexus-shared 1.1.21 → 3.0.0

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 (376) hide show
  1. package/CHANGELOG.md +262 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1000 -0
  4. package/dist/Client.Index.d.ts +55 -0
  5. package/dist/Client.Index.js +60 -0
  6. package/dist/Components/Chats/Chat.d.ts +28 -0
  7. package/dist/Components/Chats/Chat.js +19 -0
  8. package/dist/Components/Chats/ChatButton.d.ts +26 -0
  9. package/dist/Components/Chats/ChatButton.js +41 -0
  10. package/dist/Components/Chats/ChatComposer.d.ts +41 -0
  11. package/dist/Components/Chats/ChatComposer.js +177 -0
  12. package/dist/Components/Chats/ChatConversations.d.ts +35 -0
  13. package/dist/Components/Chats/ChatConversations.js +38 -0
  14. package/dist/Components/Chats/ChatPanel.d.ts +66 -0
  15. package/dist/Components/Chats/ChatPanel.js +94 -0
  16. package/dist/Components/Chats/ChatParts.d.ts +87 -0
  17. package/dist/Components/Chats/ChatParts.js +100 -0
  18. package/dist/Components/Chats/ChatThread.d.ts +22 -0
  19. package/dist/Components/Chats/ChatThread.js +96 -0
  20. package/dist/Components/Documents/Button.d.ts +29 -0
  21. package/dist/Components/Documents/Button.js +11 -0
  22. package/dist/Components/Documents/Menu.d.ts +102 -0
  23. package/dist/Components/Documents/Menu.js +242 -0
  24. package/dist/Components/Documents/SplitButton.d.ts +64 -0
  25. package/dist/Components/Documents/SplitButton.js +129 -0
  26. package/dist/Components/Documents/TabButtons.d.ts +80 -0
  27. package/dist/Components/Documents/TabButtons.js +38 -0
  28. package/dist/Components/Forms/ApiForm.d.ts +23 -0
  29. package/dist/Components/Forms/ApiForm.js +100 -0
  30. package/dist/Components/Forms/Crud.d.ts +17 -0
  31. package/dist/Components/Forms/Crud.js +708 -0
  32. package/dist/Components/Forms/CrudParts.d.ts +15 -0
  33. package/dist/Components/Forms/CrudParts.js +36 -0
  34. package/dist/Components/Forms/ExcelImport.d.ts +42 -0
  35. package/dist/Components/Forms/ExcelImport.js +190 -0
  36. package/dist/Components/Forms/Form.d.ts +52 -0
  37. package/dist/Components/Forms/Form.js +323 -0
  38. package/dist/Components/Forms/SubmitForm.d.ts +65 -0
  39. package/dist/Components/Forms/SubmitForm.js +198 -0
  40. package/dist/Components/Inputs/Calendar.d.ts +69 -0
  41. package/dist/Components/Inputs/Calendar.js +258 -0
  42. package/dist/Components/Inputs/CheckBox.d.ts +53 -0
  43. package/dist/Components/Inputs/CheckBox.js +87 -0
  44. package/dist/Components/Inputs/CheckBoxGroup.d.ts +20 -0
  45. package/dist/Components/Inputs/CheckBoxGroup.js +80 -0
  46. package/dist/Components/Inputs/ChoiceField.d.ts +122 -0
  47. package/dist/Components/Inputs/ChoiceField.js +169 -0
  48. package/dist/Components/Inputs/DatePicker.d.ts +54 -0
  49. package/dist/Components/Inputs/DatePicker.js +246 -0
  50. package/dist/Components/Inputs/DateRangePicker.d.ts +62 -0
  51. package/dist/Components/Inputs/DateRangePicker.js +283 -0
  52. package/dist/Components/Inputs/DateTimePicker.d.ts +75 -0
  53. package/dist/Components/Inputs/DateTimePicker.js +400 -0
  54. package/dist/Components/Inputs/Dropdown.d.ts +117 -0
  55. package/dist/Components/Inputs/Dropdown.js +839 -0
  56. package/dist/Components/Inputs/DropdownParts.d.ts +84 -0
  57. package/dist/Components/Inputs/DropdownParts.js +102 -0
  58. package/dist/Components/Inputs/EditorShell.d.ts +45 -0
  59. package/dist/Components/Inputs/EditorShell.js +214 -0
  60. package/dist/Components/Inputs/Field.d.ts +53 -0
  61. package/dist/Components/Inputs/Field.js +16 -0
  62. package/dist/Components/Inputs/GroupForm.d.ts +20 -0
  63. package/dist/Components/Inputs/GroupForm.js +172 -0
  64. package/dist/Components/Inputs/InputField.d.ts +59 -0
  65. package/dist/Components/Inputs/InputField.js +169 -0
  66. package/dist/Components/Inputs/InputRenderer.d.ts +37 -0
  67. package/dist/Components/Inputs/InputRenderer.js +99 -0
  68. package/dist/Components/Inputs/MarkdownEditor.d.ts +67 -0
  69. package/dist/Components/Inputs/MarkdownEditor.js +289 -0
  70. package/dist/Components/Inputs/NumberBox.d.ts +53 -0
  71. package/dist/Components/Inputs/NumberBox.js +228 -0
  72. package/dist/Components/Inputs/RadioGroup.d.ts +20 -0
  73. package/dist/Components/Inputs/RadioGroup.js +43 -0
  74. package/dist/Components/Inputs/ReadOnlyNotice.d.ts +36 -0
  75. package/dist/Components/Inputs/ReadOnlyNotice.js +117 -0
  76. package/dist/Components/Inputs/RichTextEditor.d.ts +103 -0
  77. package/dist/Components/Inputs/RichTextEditor.js +1170 -0
  78. package/dist/Components/Inputs/RichTextParts.d.ts +63 -0
  79. package/dist/Components/Inputs/RichTextParts.js +157 -0
  80. package/dist/Components/Inputs/RowsInput.d.ts +115 -0
  81. package/dist/Components/Inputs/RowsInput.js +308 -0
  82. package/dist/Components/Inputs/Slider.d.ts +87 -0
  83. package/dist/Components/Inputs/Slider.js +216 -0
  84. package/dist/Components/Inputs/TabularForm.d.ts +27 -0
  85. package/dist/Components/Inputs/TabularForm.js +348 -0
  86. package/dist/Components/Inputs/TextArea.d.ts +43 -0
  87. package/dist/Components/Inputs/TextArea.js +31 -0
  88. package/dist/Components/Inputs/TextBox.d.ts +52 -0
  89. package/dist/Components/Inputs/TextBox.js +58 -0
  90. package/dist/Components/Inputs/TextField.d.ts +31 -0
  91. package/dist/Components/Inputs/TextField.js +35 -0
  92. package/dist/Components/Inputs/TimePanel.d.ts +34 -0
  93. package/dist/Components/Inputs/TimePanel.js +288 -0
  94. package/dist/Components/Inputs/TimePicker.d.ts +54 -0
  95. package/dist/Components/Inputs/TimePicker.js +240 -0
  96. package/dist/Components/Inputs/TreeView.d.ts +160 -0
  97. package/dist/Components/Inputs/TreeView.js +947 -0
  98. package/dist/Components/Layouts/MessageBox.d.ts +71 -0
  99. package/dist/Components/Layouts/MessageBox.js +104 -0
  100. package/dist/Components/Layouts/Popup.d.ts +92 -0
  101. package/dist/Components/Layouts/Popup.js +376 -0
  102. package/dist/Components/Layouts/PopupContext.d.ts +2 -0
  103. package/dist/Components/Layouts/PopupContext.js +4 -0
  104. package/dist/Components/Layouts/PopupDock.d.ts +22 -0
  105. package/dist/Components/Layouts/PopupDock.js +121 -0
  106. package/dist/Components/Layouts/PopupHost.d.ts +56 -0
  107. package/dist/Components/Layouts/PopupHost.js +163 -0
  108. package/dist/Components/Layouts/PopupRules.d.ts +30 -0
  109. package/dist/Components/Layouts/PopupRules.js +63 -0
  110. package/dist/Components/Layouts/ThemePicker.d.ts +13 -0
  111. package/dist/Components/Layouts/ThemePicker.js +22 -0
  112. package/dist/Components/Layouts/ThemeScript.d.ts +14 -0
  113. package/dist/Components/Layouts/ThemeScript.js +13 -0
  114. package/dist/Components/Layouts/ThemeSwitcher.d.ts +13 -0
  115. package/dist/Components/Layouts/ThemeSwitcher.js +49 -0
  116. package/dist/Components/Layouts/Toaster.d.ts +76 -0
  117. package/dist/Components/Layouts/Toaster.js +172 -0
  118. package/dist/Components/Viewers/DataTable.d.ts +25 -0
  119. package/dist/Components/Viewers/DataTable.js +596 -0
  120. package/dist/Components/Viewers/DataTableColumns.d.ts +28 -0
  121. package/dist/Components/Viewers/DataTableColumns.js +243 -0
  122. package/dist/Components/Viewers/DataTableParts.d.ts +138 -0
  123. package/dist/Components/Viewers/DataTableParts.js +157 -0
  124. package/dist/Components/Viewers/MarkdownView.d.ts +26 -0
  125. package/dist/Components/Viewers/MarkdownView.js +79 -0
  126. package/dist/Components/Viewers/RichTextView.d.ts +18 -0
  127. package/dist/Components/Viewers/RichTextView.js +17 -0
  128. package/dist/Helpers/AnimationHelpers.d.ts +6 -0
  129. package/dist/Helpers/AnimationHelpers.js +35 -0
  130. package/dist/Helpers/ApiClient.d.ts +96 -0
  131. package/dist/Helpers/ApiClient.js +200 -0
  132. package/dist/Helpers/ApiFormHelpers.d.ts +49 -0
  133. package/dist/Helpers/ApiFormHelpers.js +120 -0
  134. package/dist/Helpers/ApiModules.d.ts +131 -0
  135. package/dist/Helpers/ApiModules.js +195 -0
  136. package/dist/Helpers/ApiResponses.d.ts +51 -0
  137. package/dist/Helpers/ApiResponses.js +250 -0
  138. package/dist/Helpers/ApiRoutes.d.ts +140 -0
  139. package/dist/Helpers/ApiRoutes.js +183 -0
  140. package/dist/Helpers/ApiToasts.d.ts +21 -0
  141. package/dist/Helpers/ApiToasts.js +22 -0
  142. package/dist/Helpers/ChatBackend.d.ts +134 -0
  143. package/dist/Helpers/ChatBackend.js +332 -0
  144. package/dist/Helpers/ChatHelpers.d.ts +189 -0
  145. package/dist/Helpers/ChatHelpers.js +486 -0
  146. package/dist/Helpers/ChatHooks.d.ts +81 -0
  147. package/dist/Helpers/ChatHooks.js +175 -0
  148. package/dist/Helpers/ChatStore.d.ts +132 -0
  149. package/dist/Helpers/ChatStore.js +394 -0
  150. package/dist/Helpers/ChatSummaries.d.ts +39 -0
  151. package/dist/Helpers/ChatSummaries.js +118 -0
  152. package/dist/Helpers/ClassHelpers.d.ts +3 -0
  153. package/dist/Helpers/ClassHelpers.js +4 -0
  154. package/dist/Helpers/CrudBackend.d.ts +98 -0
  155. package/dist/Helpers/CrudBackend.js +214 -0
  156. package/dist/Helpers/CrudHelpers.d.ts +111 -0
  157. package/dist/Helpers/CrudHelpers.js +267 -0
  158. package/dist/Helpers/DateHelpers.d.ts +88 -0
  159. package/dist/Helpers/DateHelpers.js +363 -0
  160. package/dist/Helpers/DatePreferences.d.ts +14 -0
  161. package/dist/Helpers/DatePreferences.js +94 -0
  162. package/dist/Helpers/DateTimeHelpers.d.ts +87 -0
  163. package/dist/Helpers/DateTimeHelpers.js +286 -0
  164. package/dist/Helpers/DragHelpers.d.ts +129 -0
  165. package/dist/Helpers/DragHelpers.js +281 -0
  166. package/dist/Helpers/DropdownHelpers.d.ts +56 -0
  167. package/dist/Helpers/DropdownHelpers.js +180 -0
  168. package/dist/Helpers/ExcelBackend.d.ts +106 -0
  169. package/dist/Helpers/ExcelBackend.js +290 -0
  170. package/dist/Helpers/ExcelHelpers.d.ts +98 -0
  171. package/dist/Helpers/ExcelHelpers.js +302 -0
  172. package/dist/Helpers/FormDrafts.d.ts +18 -0
  173. package/dist/Helpers/FormDrafts.js +76 -0
  174. package/dist/Helpers/FormStore.d.ts +233 -0
  175. package/dist/Helpers/FormStore.js +752 -0
  176. package/dist/Helpers/InputParamsHelpers.d.ts +79 -0
  177. package/dist/Helpers/InputParamsHelpers.js +388 -0
  178. package/dist/Helpers/MarkdownEditing.d.ts +27 -0
  179. package/dist/Helpers/MarkdownEditing.js +250 -0
  180. package/dist/Helpers/MarkdownHelpers.d.ts +82 -0
  181. package/dist/Helpers/MarkdownHelpers.js +775 -0
  182. package/dist/Helpers/MessageBuilder.d.ts +74 -0
  183. package/dist/Helpers/MessageBuilder.js +252 -0
  184. package/dist/Helpers/NepaliCalendar.d.ts +25 -0
  185. package/dist/Helpers/NepaliCalendar.js +107 -0
  186. package/dist/Helpers/NumberHelpers.d.ts +71 -0
  187. package/dist/Helpers/NumberHelpers.js +202 -0
  188. package/dist/Helpers/Permissions.d.ts +62 -0
  189. package/dist/Helpers/Permissions.js +133 -0
  190. package/dist/Helpers/PopoverHelpers.d.ts +68 -0
  191. package/dist/Helpers/PopoverHelpers.js +195 -0
  192. package/dist/Helpers/RichTextHelpers.d.ts +77 -0
  193. package/dist/Helpers/RichTextHelpers.js +1072 -0
  194. package/dist/Helpers/RowsStore.d.ts +166 -0
  195. package/dist/Helpers/RowsStore.js +606 -0
  196. package/dist/Helpers/TableColumns.d.ts +47 -0
  197. package/dist/Helpers/TableColumns.js +282 -0
  198. package/dist/Helpers/TableExport.d.ts +30 -0
  199. package/dist/Helpers/TableExport.js +97 -0
  200. package/dist/Helpers/TableHelpers.d.ts +110 -0
  201. package/dist/Helpers/TableHelpers.js +301 -0
  202. package/dist/Helpers/TableStore.d.ts +142 -0
  203. package/dist/Helpers/TableStore.js +530 -0
  204. package/dist/Helpers/ThemeHelpers.d.ts +15 -0
  205. package/dist/Helpers/ThemeHelpers.js +16 -0
  206. package/dist/Helpers/TimeHelpers.d.ts +73 -0
  207. package/dist/Helpers/TimeHelpers.js +253 -0
  208. package/dist/Helpers/TreeStore.d.ts +188 -0
  209. package/dist/Helpers/TreeStore.js +577 -0
  210. package/dist/Helpers/ValidationHelpers.d.ts +124 -0
  211. package/dist/Helpers/ValidationHelpers.js +301 -0
  212. package/dist/Interfaces/ApiInterfaces.d.ts +174 -0
  213. package/dist/Interfaces/ApiInterfaces.js +30 -0
  214. package/dist/Interfaces/ChatInterfaces.d.ts +240 -0
  215. package/{src/sso-client.tsx → dist/Interfaces/ChatInterfaces.js} +1 -1
  216. package/dist/Interfaces/CrudInterfaces.d.ts +232 -0
  217. package/dist/Interfaces/CrudInterfaces.js +1 -0
  218. package/dist/Interfaces/DateInterfaces.d.ts +154 -0
  219. package/dist/Interfaces/DateInterfaces.js +29 -0
  220. package/dist/Interfaces/ExcelInterfaces.d.ts +215 -0
  221. package/dist/Interfaces/ExcelInterfaces.js +45 -0
  222. package/dist/Interfaces/FormInterfaces.d.ts +402 -0
  223. package/dist/Interfaces/FormInterfaces.js +1 -0
  224. package/dist/Interfaces/InputInterfaces.d.ts +141 -0
  225. package/dist/Interfaces/InputInterfaces.js +1 -0
  226. package/dist/Interfaces/MessageInterfaces.d.ts +111 -0
  227. package/dist/Interfaces/MessageInterfaces.js +5 -0
  228. package/dist/Interfaces/TableInterfaces.d.ts +351 -0
  229. package/dist/Interfaces/TableInterfaces.js +1 -0
  230. package/dist/Interfaces/ThemeInterfaces.d.ts +17 -0
  231. package/dist/Interfaces/ThemeInterfaces.js +17 -0
  232. package/dist/Interfaces/TypeInterfaces.d.ts +4 -0
  233. package/dist/Interfaces/TypeInterfaces.js +1 -0
  234. package/dist/Server.Index.d.ts +2 -0
  235. package/dist/Server.Index.js +5 -0
  236. package/dist/Services/ApiProxy.d.ts +32 -0
  237. package/dist/Services/ApiProxy.js +111 -0
  238. package/dist/Services/BrowserApi.d.ts +95 -0
  239. package/dist/Services/BrowserApi.js +129 -0
  240. package/dist/Services/ChatApi.d.ts +37 -0
  241. package/dist/Services/ChatApi.js +98 -0
  242. package/dist/Services/ExcelApi.d.ts +46 -0
  243. package/dist/Services/ExcelApi.js +196 -0
  244. package/dist/Services/ServerApi.d.ts +54 -0
  245. package/dist/Services/ServerApi.js +78 -0
  246. package/dist/Services/ThemeService.d.ts +17 -0
  247. package/dist/Services/ThemeService.js +83 -0
  248. package/dist/Shared.Index.d.ts +51 -0
  249. package/dist/Shared.Index.js +55 -0
  250. package/package.json +85 -33
  251. package/src/Styles/Nexus.Base.css +70 -0
  252. package/src/Styles/Nexus.Button.css +153 -0
  253. package/src/Styles/Nexus.Calendar.css +275 -0
  254. package/src/Styles/Nexus.Chat.css +1489 -0
  255. package/src/Styles/Nexus.Choice.css +345 -0
  256. package/src/Styles/Nexus.Crud.css +161 -0
  257. package/src/Styles/Nexus.DateTime.css +81 -0
  258. package/src/Styles/Nexus.Dropdown.css +774 -0
  259. package/src/Styles/Nexus.Editor.css +297 -0
  260. package/src/Styles/Nexus.Excel.css +370 -0
  261. package/src/Styles/Nexus.Form.css +321 -0
  262. package/src/Styles/Nexus.Index.css +36 -0
  263. package/src/Styles/Nexus.Input.css +637 -0
  264. package/src/Styles/Nexus.Markdown.css +265 -0
  265. package/src/Styles/Nexus.Menu.css +259 -0
  266. package/src/Styles/Nexus.Popup.css +731 -0
  267. package/src/Styles/Nexus.RichText.css +463 -0
  268. package/src/Styles/Nexus.Rows.css +596 -0
  269. package/src/Styles/Nexus.Slider.css +278 -0
  270. package/src/Styles/Nexus.Tab.Buttons.css +419 -0
  271. package/src/Styles/Nexus.Table.css +1296 -0
  272. package/src/Styles/Nexus.Theme.Picker.css +232 -0
  273. package/src/Styles/Nexus.Themes.css +194 -0
  274. package/src/Styles/Nexus.Time.css +147 -0
  275. package/src/Styles/Nexus.Toast.css +265 -0
  276. package/src/Styles/Nexus.Tokens.css +72 -0
  277. package/src/Styles/Nexus.Tree.css +435 -0
  278. package/src/api-services/authentication-service.tsx +0 -23
  279. package/src/api-services/preference-service.tsx +0 -5
  280. package/src/api-services/system-service.tsx +0 -29
  281. package/src/client.ts +0 -31
  282. package/src/components/documents/button.tsx +0 -133
  283. package/src/components/documents/icon-box.tsx +0 -93
  284. package/src/components/documents/page-title.tsx +0 -7
  285. package/src/components/documents/tab-button.tsx +0 -172
  286. package/src/components/documents/tag.tsx +0 -30
  287. package/src/components/index.js +0 -0
  288. package/src/components/inputs/checkbox-input.tsx +0 -66
  289. package/src/components/inputs/input-box.tsx +0 -48
  290. package/src/components/inputs/input-element.tsx +0 -65
  291. package/src/components/inputs/input-form.tsx +0 -164
  292. package/src/components/inputs/input.tsx +0 -181
  293. package/src/components/inputs/number-input.tsx +0 -108
  294. package/src/components/inputs/radiobox-input.tsx +0 -53
  295. package/src/components/inputs/textarea-input.tsx +0 -47
  296. package/src/components/inputs/textbox-input.tsx +0 -45
  297. package/src/components/layouts/global-dialogbox.tsx +0 -431
  298. package/src/components/layouts/global-layout.tsx +0 -64
  299. package/src/components/layouts/layout-helpers.tsx +0 -20
  300. package/src/components/layouts/panels/user-panel.tsx +0 -112
  301. package/src/components/layouts/utility-menu.tsx +0 -49
  302. package/src/components/panels/theme-panel.tsx +0 -46
  303. package/src/helpers/bitwise-helpers.tsx +0 -11
  304. package/src/helpers/browser-helpers.tsx +0 -156
  305. package/src/helpers/datasource-helpers.tsx +0 -99
  306. package/src/helpers/element-helpers.tsx +0 -123
  307. package/src/helpers/input-helpers.tsx +0 -74
  308. package/src/helpers/string-helpers.tsx +0 -28
  309. package/src/helpers/utility-helpers.tsx +0 -45
  310. package/src/helpers/validation-helpers.tsx +0 -302
  311. package/src/index.ts +0 -26
  312. package/src/interface.ts +0 -19
  313. package/src/interfaces/auth-token-interfaces.tsx +0 -6
  314. package/src/interfaces/browser-interfaces.tsx +0 -36
  315. package/src/interfaces/button-interfaces.tsx +0 -63
  316. package/src/interfaces/datasource-interfaces.tsx +0 -22
  317. package/src/interfaces/datatable-interfaces.tsx +0 -25
  318. package/src/interfaces/dialogbox-interfaces.tsx +0 -5
  319. package/src/interfaces/exception-interfaces.tsx +0 -99
  320. package/src/interfaces/http-interfaces.tsx +0 -129
  321. package/src/interfaces/icon-interfaces.tsx +0 -129
  322. package/src/interfaces/input-interfaces.tsx +0 -410
  323. package/src/interfaces/layout-interfaces.tsx +0 -191
  324. package/src/interfaces/menu-interfaces.tsx +0 -53
  325. package/src/interfaces/message-interfaces.tsx +0 -32
  326. package/src/interfaces/permission-interfaces.tsx +0 -9
  327. package/src/interfaces/storage-interfaces.tsx +0 -5
  328. package/src/interfaces/system-interfaces.tsx +0 -22
  329. package/src/interfaces/theme-interfaces.tsx +0 -123
  330. package/src/interfaces/type-interfaces.tsx +0 -28
  331. package/src/interfaces/user-interfaces.tsx +0 -47
  332. package/src/nexus-client.tsx +0 -21
  333. package/src/nexus.environments.tsx +0 -66
  334. package/src/proxy-api/proxy-backend.tsx +0 -60
  335. package/src/proxy-api/proxy-constants.tsx +0 -28
  336. package/src/proxy-api/proxy-helpers.tsx +0 -91
  337. package/src/proxy-api-client.tsx +0 -1
  338. package/src/proxy-api-server.tsx +0 -2
  339. package/src/services/http-client-services.tsx +0 -75
  340. package/src/services/http-services.tsx +0 -158
  341. package/src/services/loader-service.tsx +0 -185
  342. package/src/services/localstorage-service.tsx +0 -119
  343. package/src/services/message-services.tsx +0 -383
  344. package/src/services/theme-service.tsx +0 -163
  345. package/src/services/user-services.tsx +0 -10
  346. package/src/sso-config/auth-token-validation.ts +0 -16
  347. package/src/sso-config/callback-route.tsx +0 -35
  348. package/src/sso-config/cookie-encryption.ts +0 -51
  349. package/src/sso-config/cookie-helpers.tsx +0 -102
  350. package/src/sso-config/forgot-password-route.tsx +0 -36
  351. package/src/sso-config/oauth-callback-state.ts +0 -61
  352. package/src/sso-config/pkce-helpers.ts +0 -9
  353. package/src/sso-config/provider-complete-route.tsx +0 -18
  354. package/src/sso-config/redirect-context-actions.tsx +0 -45
  355. package/src/sso-config/redirect-context-helpers.tsx +0 -159
  356. package/src/sso-config/redirect-context-persist.tsx +0 -18
  357. package/src/sso-config/redirect-context-route.tsx +0 -45
  358. package/src/sso-config/refresh-route.tsx +0 -23
  359. package/src/sso-config/sign-in-route.tsx +0 -74
  360. package/src/sso-config/sign-out-route.tsx +0 -57
  361. package/src/sso-config/sign-up-route.tsx +0 -57
  362. package/src/sso-config/sso-backend-flow.ts +0 -38
  363. package/src/sso-config/sso-complete-route.tsx +0 -50
  364. package/src/sso-config/sso-config.ts +0 -59
  365. package/src/sso-config/sso-interfaces.tsx +0 -99
  366. package/src/sso-config/sso-response-helpers.tsx +0 -20
  367. package/src/sso-server.tsx +0 -21
  368. package/src/styles/nexus.animation.css +0 -269
  369. package/src/styles/nexus.core.css +0 -119
  370. package/src/styles/nexus.dialog.css +0 -144
  371. package/src/styles/nexus.grid-view.css +0 -42
  372. package/src/styles/nexus.icon.css +0 -51
  373. package/src/styles/nexus.input.css +0 -207
  374. package/src/styles/nexus.loader.css +0 -11
  375. package/src/styles/nexus.logic.css +0 -47
  376. package/src/styles/nexus.utility.css +0 -347
@@ -1,191 +0,0 @@
1
- import { IAccessAction } from "./permission-interfaces";
2
-
3
- import { IThemeInformation } from "./theme-interfaces";
4
-
5
- export const ROOT_LOADER_IDENTITY = "root-loader";
6
- export const DEFAULT_FONT_WEIGHTS = ["300", "400", "500", "600", "700", "800"];
7
- export const DEFAULT_ANIMATION_DURATION = 300;
8
- export const COLUMN_SIZE_ATTRIBUTE_KEY = "data-column-size";
9
-
10
- export enum EFontWeights {
11
- /** Light:300 */
12
-
13
- LIGHT = "300",
14
-
15
- /** Regular:400 */
16
-
17
- REGULAR = "400",
18
-
19
- /** Medium:500 */
20
-
21
- MEDIUM = "500",
22
-
23
- /** Semi Bold:600 */
24
-
25
- SEMI_BOLD = "600",
26
-
27
- /** Bold:700 */
28
-
29
- BOLD = "700",
30
-
31
- /** Extra Bold:800 */
32
-
33
- EXTRA_BOLD = "800",
34
- }
35
-
36
- export interface IGlobalLayout {
37
- /** Document Title */
38
-
39
- defaultDocumentTitle: string;
40
-
41
- /** Document Description */
42
-
43
- defaultDocumentDescription: string;
44
-
45
- /** Document Keywords LIKE: "nexus, solutions, software, development" */
46
-
47
- defaultDocumentKeywords: string[];
48
-
49
- /** Is admin or client layout? */
50
-
51
- isAdminLayout: boolean;
52
-
53
- /** Access actions */
54
-
55
- accessActions?: IAccessAction[];
56
-
57
- /** System themes */
58
-
59
- systemThemes: IThemeInformation[];
60
-
61
- /** Should menu be dark? */
62
-
63
- shouldMenuDark: boolean;
64
- }
65
-
66
- export const GetGlobalLayout = (
67
- defaultDocumentTitle: string,
68
-
69
- defaultDocumentDescription: string,
70
-
71
- defaultDocumentKeywords: string[],
72
- ): IGlobalLayout => {
73
- return {
74
- defaultDocumentTitle: defaultDocumentTitle,
75
-
76
- defaultDocumentDescription: defaultDocumentDescription,
77
-
78
- defaultDocumentKeywords: defaultDocumentKeywords,
79
- } as IGlobalLayout;
80
- };
81
-
82
- /** Keyframe / class string names for CSS `animation-name` or matching utility classes. */
83
-
84
- export enum EAnimations {
85
- FADE_IN = "fadeIn",
86
- FADE_OUT = "fadeOut",
87
- FADE_IN_OUT = "fadeInOut",
88
-
89
- /** Vertical motion loop only (no enter/exit variant). */
90
- BOUNCE = "bounce",
91
-
92
- PULSE_IN = "pulseIn",
93
-
94
- PULSE_OUT = "pulseOut",
95
-
96
- PULSE_IN_OUT = "pulseInOut",
97
-
98
- /** Circular border loop; theme border-top tint cycles like a loader. */
99
- SPIN = "spin",
100
-
101
- /** Indeterminate track: segment sweeps left → right (e.g. form submitting). */
102
- SLIDE_BAR = "slideBar",
103
-
104
- /** Segment starts at 0, travels to the far wall, reverses back (two-wall bounce). */
105
- BOUNCE_BAR = "bounceBar",
106
- }
107
-
108
- /** Short utility classes applied with `className`. */
109
-
110
- export enum EAnimationClasses {
111
- FADE_IN = "an-fa",
112
-
113
- FADE_OUT = "an-fo",
114
-
115
- FADE_IN_OUT = "an-fio",
116
-
117
- BOUNCE = "an-bounce",
118
-
119
- PULSE_IN = "an-pi",
120
-
121
- PULSE_OUT = "an-po",
122
-
123
- PULSE_IN_OUT = "an-pio",
124
-
125
- SPIN = "an-spin",
126
-
127
- SLIDE_BAR = "an-sbar",
128
-
129
- BOUNCE_BAR = "an-bbar",
130
- }
131
-
132
- export enum ESizes {
133
- VeryTiny = "xxs",
134
-
135
- Tiny = "xs",
136
-
137
- VerySmall = "ssm",
138
-
139
- Small = "sm",
140
-
141
- Normal = "nr",
142
-
143
- Medium = "med",
144
-
145
- Large = "lg",
146
-
147
- ExtraLarge = "xl",
148
-
149
- VeryExtraLarge = "xxl",
150
-
151
- FullSize = "fs",
152
- }
153
-
154
- export enum EBadgeTypes {
155
- Dot = "dot",
156
-
157
- Count = "count",
158
- }
159
-
160
- export enum EOpacity {
161
- O05 = "o05",
162
-
163
- O06 = "o06",
164
-
165
- O07 = "o07",
166
-
167
- O08 = "o08",
168
-
169
- O09 = "o09",
170
-
171
- FULL = "o1",
172
-
173
- NONE = "o0",
174
- }
175
- export enum EPositions {
176
- Left = "left",
177
- Right = "right",
178
- Top = "top",
179
- Bottom = "bottom",
180
- Center = "center",
181
- }
182
- export enum ETextPositions {
183
- Left = "tl",
184
- Right = "tr",
185
- Center = "tc",
186
- }
187
- export enum EFlexPositions {
188
- Left = "jl",
189
- Right = "jr",
190
- Center = "jc",
191
- }
@@ -1,53 +0,0 @@
1
- import { EIcons } from "./icon-interfaces";
2
- import { UN } from "./type-interfaces";
3
-
4
- export const UTILITIES_BUTTON_PREFIX = "btn-utility-";
5
- export const GetUtilityMenuCode = (utilityCode: string) => `${UTILITIES_BUTTON_PREFIX}${utilityCode}`;
6
-
7
- export enum EMenuTargets {
8
- ClientModule = 1 << 0, // 1
9
- PublicAdminModule = 1 << 1, // 2
10
- AdminModule = 1 << 2, // 4
11
- }
12
- export enum EMenuVisibility {
13
- GuestOnly = 1 << 0, // 1
14
- AuthenticatedOnly = 1 << 1, // 2
15
- }
16
- export interface IMenuBase {
17
- id?: string | number;
18
- menuVisibilities: EMenuVisibility | UN;
19
- menuName: string;
20
- menuCode: string;
21
- menuIcon: EIcons;
22
- menuTooltip?: string;
23
- displayOrder: number;
24
- }
25
-
26
- export type IUtilityMenu = IMenuBase;
27
- export interface IPanelMenu extends IMenuBase {
28
- groupOrder: number;
29
- menuUrl?: string;
30
- defaultValue?: string;
31
- }
32
- export interface IClientMenu extends IMenuBase {
33
- menuUrl: string;
34
- documentTitle: string;
35
- pageTitle: string;
36
- breadcrumbTitle?: string;
37
- }
38
- export interface IAdminMenu extends IClientMenu {
39
- parentId?: string | number;
40
- }
41
- export const BUTTON_IDENTITY = (isneedPrefix: boolean) => {
42
- const _ = isneedPrefix ? UTILITIES_BUTTON_PREFIX : "";
43
- return {
44
- PROFILE_BOX: `${_}profile`,
45
- SEARCH_BOX: `${_}root-search`,
46
- FAVORITE_BOX: `${_}favorite-menu`,
47
- CARD_BOX: `${_}cart-menu`,
48
- THEME_BOX: `${_}switch-theme`,
49
- MEGA_BOX: `${_}mega-menu`,
50
- SIGN_IN_BUTTON: `${_}sign-in`,
51
- SIGN_OUT_BUTTON: `${_}sign-out`,
52
- };
53
- };
@@ -1,32 +0,0 @@
1
- import { EIcons } from "./icon-interfaces";
2
- import { EBackgrounds } from "./theme-interfaces";
3
-
4
- export enum EMessageTypes {
5
- Information = EBackgrounds.InfoColor,
6
- Success = EBackgrounds.SuccessColor,
7
- Warning = EBackgrounds.WarningColor,
8
- Error = EBackgrounds.ErrorColor,
9
- }
10
- export enum EMessageIcons {
11
- Information = EIcons.INFORMATION,
12
- Success = EIcons.CHECKMARK_DOUBLE,
13
- Warning = EIcons.WARNING,
14
- Error = EIcons.CLOSE,
15
- Question = EIcons.HELP,
16
- Delete = EIcons.TRASH,
17
- Bin = EIcons.TRASH_BIN,
18
- }
19
- export enum EMessageResult {
20
- OK = "OK",
21
- Yes = "Yes",
22
- No = "No",
23
- Cancel = "Cancel",
24
- Undefined = "Undefined",
25
- }
26
-
27
- export enum EMessageBoxButtons {
28
- OK = "OK",
29
- YES_NO = "Yes_No",
30
- YES_CANCEL = "Yes_Cancel",
31
- YES_NO_CANCEL = "Yes_No_Cancel",
32
- }
@@ -1,9 +0,0 @@
1
- import { EActions } from "./http-interfaces";
2
- import { EModules } from "./system-interfaces";
3
-
4
- export interface IAccessAction {
5
- controllerName: string;
6
- actionName: string;
7
- actionMethod: EActions;
8
- nexusModule: EModules;
9
- }
@@ -1,5 +0,0 @@
1
- export const LOCAL_STORAGE_KEYS = {
2
- ACTIVE_THEME: "nexus-themes",
3
- CURRENT_USER: "nexus-current-user",
4
- FORM_BUTTON_POSITION: "nexus-form-button-position",
5
- };
@@ -1,22 +0,0 @@
1
- export enum EModules {
2
- None = 0,
3
-
4
- Migrations = 1 << 0, // 1 | 1
5
- Configuration = 1 << 1, // 2 | 2
6
- Authentication = 1 << 2, // 3 | 4
7
- Enterprise = 1 << 3, // 4 | 8
8
- Drive = 1 << 4, // 5 | 16
9
- Message = 1 << 5, // 6 | 32
10
- Accounting = 1 << 6, // 7 | 64
11
- Report = 1 << 7, // 8 | 128
12
- Portfolio = 1 << 8, // 9 | 256
13
- Subscription = 1 << 9, // 10 | 512
14
- Reservation = 1 << 10, // 11 | 1024
15
- }
16
- export enum EPreferenceTargets {
17
- Company = 1 << 0, // 1
18
- Branch = 1 << 1, // 2
19
- User = 1 << 2, // 4
20
- Application = 1 << 3, // 8
21
- Compiler = 1 << 4, // 16
22
- }
@@ -1,123 +0,0 @@
1
- import { EIcons } from "./icon-interfaces";
2
- import { UN } from "./type-interfaces";
3
-
4
- export const DEFAULT_THEME_NAME = "light";
5
-
6
- export enum EBackgroundColors {
7
- Background1 = "var(--B1)",
8
- Background2 = "var(--B2)",
9
- Background3 = "var(--B3)",
10
- SuccessColor = "var(--B10)",
11
- WarningColor = "var(--B11)",
12
- InfoColor = "var(--B12)",
13
- ErrorColor = "var(--B13)",
14
- PrimaryColor = "var(--B20)",
15
- BorderColor = "var(--B30)",
16
- BoxShadowColor = "var(--B41)",
17
- PopupBackgroundColor = "var(--B51)",
18
- AlwaysDarkBackgroundColor = "var(--B52)",
19
- ThemeColor100 = "var(--B100)",
20
- ThemeColor200 = "var(--B200)",
21
- ThemeColor400 = "var(--B400)",
22
- ThemeColor600 = "var(--B600)",
23
- ThemeColor800 = "var(--B800)",
24
- ThemeColor950 = "var(--B950)",
25
- }
26
- export enum EBackgrounds {
27
- None = "no-background",
28
- Background1 = "bg1",
29
- Background2 = "bg2",
30
- Background3 = "bg3",
31
- SuccessColor = "bg10",
32
- WarningColor = "bg11",
33
- InfoColor = "bg12",
34
- ErrorColor = "bg13",
35
- PrimaryColor = "bg20",
36
- BorderColor = "bg30",
37
- BoxShadowColor = "bg41",
38
- PopupBackgroundColor = "bg51",
39
- AlwaysDarkBackgroundColor = "bg52",
40
- ThemeColor100 = "bg100",
41
- ThemeColor200 = "bg200",
42
- ThemeColor400 = "bg400",
43
- ThemeColor600 = "bg600",
44
- ThemeColor800 = "bg800",
45
- ThemeColor950 = "bg950",
46
- }
47
- export enum ETextColors {
48
- TextColor1 = "var(--T1)",
49
- TextColor2 = "var(--T2)",
50
- TextColor3 = "var(--T3)",
51
- TextColor10 = "var(--T10)",
52
- TextColor11 = "var(--T11)",
53
- TextColor12 = "var(--T12)",
54
- TextColor13 = "var(--T13)",
55
- TextColor20 = "var(--T20)",
56
- TextColor30 = "var(--T30)",
57
- TextColor41 = "var(--T41)",
58
- TextColor51 = "var(--T51)",
59
- TextColor52 = "var(--T52)",
60
- TextColor100 = "var(--T100)",
61
- TextColor200 = "var(--T200)",
62
- TextColor400 = "var(--T400)",
63
- TextColor600 = "var(--T600)",
64
- TextColor800 = "var(--T800)",
65
- TextColor950 = "var(--T950)",
66
- }
67
- export enum EColorTypes {
68
- Background = "--B",
69
- Hover = "--H",
70
- Focus = "--F",
71
- Text = "--T",
72
- }
73
-
74
- export interface IThemeInformation {
75
- displayName: string;
76
- systemName: string;
77
- displayOrder: number;
78
- iconName: EIcons;
79
- id?: string | UN;
80
-
81
- /** Background Color 1 */
82
- C1: string;
83
- /** Background Color 2 */
84
- C2: string;
85
- /** Background Color 3 */
86
- C3: string;
87
-
88
- /** Success Color */
89
- C10: string;
90
- /** Warning/Reset/Clear Color */
91
- C11: string;
92
- /** Info Color */
93
- C12: string;
94
- /** Error/Delete/Remove Color */
95
- C13: string;
96
-
97
- /** Primary/Submit/Link Button Color */
98
- C20: string;
99
-
100
- /** Border Color 1 */
101
- C30: string;
102
-
103
- /** Box Shadow Color 1 */
104
- C41: string;
105
-
106
- /** Popup/Model Background Color 1 */
107
- C51: string;
108
- /** Always Dark Background Color 1 */
109
- C52: string;
110
-
111
- /** Theme Color 100 */
112
- C100: string;
113
- /** Theme Color 200 */
114
- C200: string;
115
- /** Theme Color 400 */
116
- C400: string;
117
- /** Theme Color 600 */
118
- C600: string;
119
- /** Theme Color 800 */
120
- C800: string;
121
- /** Theme Color 950 */
122
- C950: string;
123
- }
@@ -1,28 +0,0 @@
1
- export type UN = undefined | null;
2
- export type U = undefined;
3
- export type N = null;
4
- export type SUN = undefined | null | string;
5
- export type CallbackHandler<PARAM, RETURN> = (param?: PARAM) => RETURN;
6
- export type ClickHandler = (event: React.MouseEvent<HTMLElement> | Event | UN, element?: HTMLElement | UN, data?: any | UN, index?: number | UN) => void;
7
- export type EmptyClickHandler = () => void;
8
- export type StringCallbackHandler = CallbackHandler<string, string>;
9
- export type StringNullCallbackHandler = CallbackHandler<string | UN, string | UN>;
10
- export type NumberCallbackHandler = CallbackHandler<number, number>;
11
- export type NumberNullCallbackHandler = CallbackHandler<number | UN, number | UN>;
12
- export type BooleanCallbackHandler = CallbackHandler<boolean, boolean>;
13
- export type BooleanNullCallbackHandler = CallbackHandler<boolean | UN, boolean | UN>;
14
- export type ObjectCallbackHandler<T> = CallbackHandler<T, T>;
15
- export type ObjectNullCallbackHandler<T> = CallbackHandler<T | UN, T | UN>;
16
- export type ArrayCallbackHandler<T> = CallbackHandler<T[], T[]>;
17
- export type ArrayNullCallbackHandler<T> = CallbackHandler<T[] | UN, T[] | UN>;
18
- export type VoidCallbackHandler = CallbackHandler<void | any | any[] | UN, void>;
19
- export type PopupMessageCallback = (type: ECallbackTypes) => void;
20
- export interface IInterface {
21
- // Blank Interface
22
- }
23
-
24
- export enum ECallbackTypes {
25
- Initialize = 0,
26
- Destroy = 1,
27
- ForceChangeValue = 2,
28
- }
@@ -1,47 +0,0 @@
1
- import { EModules } from "./system-interfaces";
2
- import { UN } from "./type-interfaces";
3
-
4
- export enum EUserRoles {
5
- Guest = 0,
6
- User = 1,
7
- Admin = 2,
8
- SuperAdmin = 3,
9
- }
10
- export const IsAdmin = (userRole: EUserRoles | string | UN) => userRole === EUserRoles.Admin || EUserRoles[EUserRoles.Admin] === userRole;
11
- export const IsSuperAdmin = (userRole: EUserRoles | string | UN) => userRole === EUserRoles.SuperAdmin || EUserRoles[EUserRoles.SuperAdmin] === userRole;
12
- export const IsAdmin_SuperAdmin = (userRole: EUserRoles | string | UN) => IsAdmin(userRole) || IsSuperAdmin(userRole);
13
- export const IsUser = (userRole: EUserRoles | string | UN) => userRole === EUserRoles.User || EUserRoles[EUserRoles.User] === userRole;
14
- export const IsGuest = (userRole: EUserRoles | string | UN) => userRole === EUserRoles.Guest || EUserRoles[EUserRoles.Guest] === userRole;
15
- export const IsUser_Guest = (userRole: EUserRoles | string | UN) => IsUser(userRole) || IsGuest(userRole);
16
-
17
- export interface IUserValidationResponse {
18
- isValidUser: boolean;
19
- isValidCompany: boolean;
20
- isValidBranch: boolean;
21
- isValidFiscalYear: boolean;
22
- userRole: EUserRoles;
23
- assignedModules: EModules;
24
- }
25
- export interface ICurrentUser {
26
- id: string;
27
- fullname: string;
28
- username: string;
29
- roleName: string;
30
- profilePicture: string | UN;
31
- emailAddress: string | UN;
32
- contactNumber: string | UN;
33
- isImpersonating: boolean | UN;
34
- isMultiTenant: boolean | UN;
35
- enableAuditHistory: boolean | UN;
36
- rootAccess: boolean | UN;
37
- branchId: string | UN;
38
- companyId: string | UN;
39
- fiscalYearId: string | UN;
40
- modules: EModules | UN;
41
- }
42
- export enum ESigninRequestMode {
43
- DEFAULT = "0",
44
- SIGN_OUT = "1",
45
- SWITCH_BRANCH = "2",
46
- SWITCH_FISCAL_YEAR = "3",
47
- }
@@ -1,21 +0,0 @@
1
- import { IAccessAction } from "./interfaces/permission-interfaces";
2
- import { IThemeInformation } from "./interfaces/theme-interfaces";
3
-
4
- export interface IGlobalObject {
5
- systemThemes?: IThemeInformation[];
6
- accessActions?: IAccessAction[];
7
- isAdminModule?: boolean;
8
- }
9
- const _globalObject: IGlobalObject = {
10
- systemThemes: undefined,
11
- };
12
- export const NEXUS_OBJECT = (systemThemes: IThemeInformation[], access?: IAccessAction[], isAdminModule?: boolean) => {
13
- if (!_globalObject.systemThemes && systemThemes) {
14
- _globalObject.accessActions = access ?? [];
15
- _globalObject.systemThemes = systemThemes;
16
- _globalObject.isAdminModule = isAdminModule;
17
- }
18
- return _globalObject;
19
- };
20
-
21
- export const O = _globalObject;
@@ -1,66 +0,0 @@
1
- import { EModules } from "./interfaces/system-interfaces";
2
- import { EBackgrounds } from "./interfaces/theme-interfaces";
3
-
4
- // @ts-ignore
5
- const processEnv = process.env;
6
-
7
- export const APIS = {
8
- DRIVE: processEnv.API_DRIVE as string,
9
- AUTHENTICATION: processEnv.API_AUTHENTICATION as string,
10
- CONFIGURATION: processEnv.API_CONFIGURATION as string,
11
- CURRENT: processEnv.API_CURRENT as string,
12
- ENTERPRISE: processEnv.API_ENTERPRISE as string,
13
- MESSAGE: processEnv.API_MESSAGE as string,
14
- ACCOUNTING: processEnv.API_ACCOUNTING as string,
15
- REPORT: processEnv.API_REPORT as string,
16
- };
17
-
18
- export const URLS = {
19
- GLOBAL_SIGNIN: `${processEnv.URL_AUTHENTICATION}/api/auth/redirect-context`,
20
- CURRENT: processEnv.URL_CURRENT as string,
21
- AUTHENTICATION: processEnv.URL_AUTHENTICATION as string,
22
- SIGN_IN: processEnv.URL_AUTHENTICATION_SIGN_IN as string,
23
- ALLOWED_ORIGINS: (processEnv.ALLOWED_ORIGINS ?? "")
24
- .split(",")
25
- .map((origin: string) => origin.trim())
26
- .filter(Boolean),
27
- };
28
- const FILE = (apiName: string, filePath: string, fileName: string) => `${processEnv.API_RESOURCES_BASE_PATH ?? `/api/app/${EModules.Drive}/Resources`}/${apiName}/${encodeURIComponent(filePath)}/${encodeURIComponent(fileName)}`;
29
- export const FILES = {
30
- LOGO: {
31
- ICON: FILE("Image", "logos", "icon-logo"),
32
- FULL: FILE("Image", "logos", "full-logo"),
33
- FULL_TEXT: FILE("Image", "logos", "full-text-logo"),
34
- },
35
- ICONS: {
36
- USER: FILE("Image", "icons", "user"),
37
- NO_IMAGE: FILE("Image", "icons", "no-image"),
38
- },
39
- SCRIPT: (fileName: string, isStyles: boolean = false) => FILE("Script", isStyles ? "css" : "js", fileName),
40
- };
41
- export const NEXUS_INFO = {
42
- IS_ADMIN_MODULE: processEnv.IS_ADMIN_MODULE !== "false",
43
- CURRENT_MODULE: processEnv.CURRENT_MODULE !== undefined ? (parseInt(processEnv.CURRENT_MODULE) as EModules) : undefined,
44
- CURRENT_MODULE_NAME: processEnv.CURRENT_MODULE_NAME as string,
45
- CURRENT_MODULE_SHORT_NAME: processEnv.CURRENT_MODULE_SHORT_NAME as string,
46
- IS_PRODUCTION: processEnv.NODE_ENV === "production",
47
- SOFTWARE_COMPANY_SHORT_NAME: processEnv.SOFTWARE_COMPANY_SHORT_NAME as string,
48
- SOFTWARE_COMPANY_FULL_NAME: processEnv.SOFTWARE_COMPANY_FULL_NAME as string,
49
- SOFTWARE_VERSION: processEnv.SOFTWARE_VERSION as string,
50
- SOFTWARE_LAST_UPDATE_DATE: processEnv.SOFTWARE_LAST_UPDATE_DATE as string,
51
- SOFTWARE_COMPANY_WEBSITE: processEnv.SOFTWARE_COMPANY_WEBSITE as string,
52
- IS_PROXY_SERVER: processEnv.IS_PROXY_SERVER !== "false",
53
- };
54
- export const NEXUS_CONFIG = {
55
- /** Default revalidate time for static generation (in minutes) */
56
- DEFAULT_REVALIDATE_TIME: NEXUS_INFO.IS_PRODUCTION ? 60 * 24 : 0,
57
- DEFAULT_REVALIDATE_TIME_ONE_HOUR: NEXUS_INFO.IS_PRODUCTION ? 60 : 0,
58
- DEFAULT_REVALIDATE_TIME_ONE_DAY: NEXUS_INFO.IS_PRODUCTION ? 60 * 24 : 0,
59
- DEFAULT_REVALIDATE_TIME_ONE_WEEK: NEXUS_INFO.IS_PRODUCTION ? 60 * 24 * 7 : 0,
60
- DEFAULT_REVALIDATE_TIME_ONE_MONTH: NEXUS_INFO.IS_PRODUCTION ? 60 * 24 * 30 : 0,
61
- DEFAULT_REVALIDATE_TIME_ONE_YEAR: NEXUS_INFO.IS_PRODUCTION ? 60 * 24 * 365 : 0,
62
- /** Default timeout for HTTP requests (in milliseconds) */
63
- DEFAULT_HTTP_REQUEST_TIMEOUT: NEXUS_INFO.IS_PRODUCTION ? 60000 : 1000000,
64
-
65
- DEFAULT_BACKGROUND: (processEnv.DEFAULT_BACKGROUND as EBackgrounds) ?? EBackgrounds.Background1,
66
- };
@@ -1,60 +0,0 @@
1
- import { NextRequest, NextResponse } from "next/server";
2
- import { EErrorCodes } from "../interfaces/exception-interfaces";
3
- import { GetRootApi } from "../services/http-services";
4
- import { DecryptCookieValue } from "../sso-config/cookie-encryption";
5
- import { ALLOWED_MODULES, PROXY_ALLOWED_METHODS } from "./proxy-constants";
6
- import { BuildBackendUrl, BuildForwardHeaders, ProxyErrorResponse, ReadRequestBody, SanitizeResponseHeaders } from "./proxy-helpers";
7
-
8
- const GENERIC_PROXY_ERROR = "Unable to reach the backend service.";
9
- const MODULE_NOT_ALLOWED_ERROR = "This module is not allowed for proxy requests.";
10
-
11
- const ACCESS_TOKEN_COOKIE = "access_token";
12
-
13
- export async function ProxyToBackend(req: NextRequest, moduleParam: string, pathSegments: string[]): Promise<NextResponse> {
14
- const method = req.method.toUpperCase();
15
-
16
- if (!PROXY_ALLOWED_METHODS.has(method)) {
17
- return ProxyErrorResponse(`Method ${method} is not supported.`, 405, "METHOD_NOT_SUPPORTED", EErrorCodes.Forbidden);
18
- }
19
-
20
- const module = ALLOWED_MODULES.includes(moduleParam) ? parseInt(moduleParam) : null;
21
- if (!module) return ProxyErrorResponse(MODULE_NOT_ALLOWED_ERROR, 400, "INVALID_MODULE");
22
- const backendBase = GetRootApi(module);
23
- const backendUrl = BuildBackendUrl(backendBase, pathSegments, req.nextUrl.searchParams);
24
-
25
- return ProxyToBackendRequest(backendUrl, backendBase, module, method, req);
26
- }
27
-
28
- export async function ProxyToBackendRequest(backendFullUrl: string, backendUrlBase: string, module: number, method: string, req: NextRequest): Promise<NextResponse> {
29
- // BuildForwardHeaders already strips the Cookie header (see PROXY_REQUEST_HEADERS_TO_SKIP).
30
- const headers = BuildForwardHeaders(req);
31
-
32
- // Decrypt the access token from the httpOnly cookie and inject it as a Bearer token.
33
- // The raw encrypted blob is never forwarded — only the plaintext token reaches the backend.
34
- const encryptedToken = req.cookies.get(ACCESS_TOKEN_COOKIE)?.value;
35
- if (encryptedToken) {
36
- const token = DecryptCookieValue(encryptedToken);
37
- if (token) headers.set("Authorization", `Bearer ${token}`);
38
- }
39
-
40
- const body = await ReadRequestBody(req, method);
41
-
42
- let backendResponse: Response;
43
- try {
44
- backendResponse = await fetch(backendFullUrl, {
45
- method,
46
- headers,
47
- body,
48
- redirect: "manual",
49
- });
50
- } catch {
51
- return ProxyErrorResponse(GENERIC_PROXY_ERROR, 502, "BACKEND_UNREACHABLE");
52
- }
53
- const responseHeaders = SanitizeResponseHeaders(backendResponse.headers, backendUrlBase, module);
54
- const responseBody = await backendResponse.arrayBuffer();
55
-
56
- return new NextResponse(responseBody, {
57
- status: backendResponse.status,
58
- headers: responseHeaders,
59
- });
60
- }