@solidstarters/solid-core-ui 1.1.211 → 1.1.212
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.
- package/dist/components/Svg/DevDocs.tsx +9 -0
- package/dist/components/Svg/DocsSvg.tsx +9 -0
- package/dist/components/Svg/ExcelSvg.tsx +15 -0
- package/dist/components/Svg/FieldSvg.tsx +9 -0
- package/dist/components/Svg/FileSvg.tsx +18 -0
- package/dist/components/Svg/HomePageModuleSvg.tsx +179 -0
- package/dist/components/Svg/ModelSvg.tsx +9 -0
- package/dist/components/Svg/ModuleSvg.tsx +9 -0
- package/dist/components/Svg/PDFSvg.tsx +15 -0
- package/dist/components/Svg/RightArrowSvg.tsx +9 -0
- package/dist/components/Svg/SettingsSvg.tsx +9 -0
- package/dist/components/auth/AuthLayout.tsx +223 -0
- package/dist/components/auth/ForgotPasswordThankYou.tsx +33 -0
- package/dist/components/auth/GoogleAuthChecking.tsx +63 -0
- package/dist/components/auth/SolidChangeForcePassword.tsx +222 -0
- package/dist/components/auth/SolidForgotPassword.tsx +127 -0
- package/dist/components/auth/SolidInitialLoginOtp.tsx +271 -0
- package/dist/components/auth/SolidInitiateRegisterOtp.tsx +218 -0
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +14 -8
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +428 -0
- package/dist/components/auth/SolidOTPVerify.tsx +133 -0
- package/dist/components/auth/SolidRegister.tsx +454 -0
- package/dist/components/auth/SolidResetPassword.tsx +194 -0
- package/dist/components/common/AuthBanner.tsx +41 -0
- package/dist/components/common/AutoCompleteField.tsx +79 -0
- package/dist/components/common/BackButton.tsx +72 -0
- package/dist/components/common/CancelButton.tsx +61 -0
- package/dist/components/common/CodeEditor.tsx +38 -0
- package/dist/components/common/CreateButton.tsx +17 -0
- package/dist/components/common/DownloadProgressToast.tsx +55 -0
- package/dist/components/common/DropzonePlaceholder.tsx +31 -0
- package/dist/components/common/DropzoneUpload.tsx +11 -0
- package/dist/components/common/FileReaderExt.tsx +20 -0
- package/dist/components/common/GeneralSettings.tsx +1225 -0
- package/dist/components/common/HeaderDynamicTitles.tsx +13 -0
- package/dist/components/common/MarkdownViewer.tsx +84 -0
- package/dist/components/common/MultipleSelectAutoCompleteField.tsx +64 -0
- package/dist/components/common/NotFound.tsx +22 -0
- package/dist/components/common/SingleSelectAutoCompleteField.tsx +73 -0
- package/dist/components/common/SocialMediaLogin.tsx +53 -0
- package/dist/components/common/SolidAdmin.tsx +6 -0
- package/dist/components/common/SolidBreadcrumb.tsx +129 -0
- package/dist/components/common/SolidExport.tsx +563 -0
- package/dist/components/common/SolidExportStepper.tsx +135 -0
- package/dist/components/common/SolidFieldTooltip.tsx +23 -0
- package/dist/components/common/SolidFormHeader.tsx +25 -0
- package/dist/components/common/SolidFormStepper.tsx +350 -0
- package/dist/components/common/SolidModuleHome.tsx +128 -0
- package/dist/components/common/SolidPopupContainer.tsx +37 -0
- package/dist/components/common/SolidSettings/LlmSettings/AnthropicProviderComponent.tsx +45 -0
- package/dist/components/common/SolidSettings/LlmSettings/OpenAiProviderComponent.tsx +45 -0
- package/dist/components/common/SolidSettings/SettingDropzoneActivePlaceholder.tsx +20 -0
- package/dist/components/common/SolidSettings/SettingsImageRemoveButton.tsx +15 -0
- package/dist/components/common/SolidSettings/SolidUploadedImage.tsx +16 -0
- package/dist/components/common/SolidThemeLink.tsx +6 -0
- package/dist/components/common/SolidThemeProvider.tsx +44 -0
- package/dist/components/common/StepperArrows/ActiveArrowStep.tsx +18 -0
- package/dist/components/common/StepperArrows/ActiveBeforeStepArrow.tsx +18 -0
- package/dist/components/common/StepperArrows/InactiveStepArrow.tsx +19 -0
- package/dist/components/common/error.tsx +30 -0
- package/dist/components/common/useHandleFormCustomButtonClick.ts +40 -0
- package/dist/components/common/useHandleListCustomButtonClick.ts +42 -0
- package/dist/components/core/chatter/SolidChatter.tsx +248 -0
- package/dist/components/core/chatter/SolidChatterAuditMessage.tsx +35 -0
- package/dist/components/core/chatter/SolidChatterCustomMessage.tsx +46 -0
- package/dist/components/core/chatter/SolidChatterDateDivider.tsx +16 -0
- package/dist/components/core/chatter/SolidChatterHeader.tsx +218 -0
- package/dist/components/core/chatter/SolidChatterMessageBox.tsx +163 -0
- package/dist/components/core/chatter/SolidMessageComposer.tsx +146 -0
- package/dist/components/core/common/AvatarWidget.tsx +55 -0
- package/dist/components/core/common/DateFieldViewComponent.tsx +36 -0
- package/dist/components/core/common/FilterComponent.tsx +458 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
- package/dist/components/core/common/PDFViewer.tsx +117 -0
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.tsx +89 -0
- package/dist/components/core/common/SolidAccountSettings/SolidChangePassword.tsx +188 -0
- package/dist/components/core/common/SolidAccountSettings/SolidNotifications.tsx +139 -0
- package/dist/components/core/common/SolidAccountSettings/SolidPersonalInfo.tsx +311 -0
- package/dist/components/core/common/SolidCreateButton.tsx +48 -0
- package/dist/components/core/common/SolidGenericImport/DocumentSvg.tsx +15 -0
- package/dist/components/core/common/SolidGenericImport/SolidGenericImport.tsx +64 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportDropzone.tsx +125 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportInstructions.tsx +122 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportStepper.tsx +217 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +205 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportTransactionStatus.tsx +158 -0
- package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.tsx +29 -0
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +1470 -0
- package/dist/components/core/common/SolidLayoutViews.tsx +87 -0
- package/dist/components/core/common/SolidListViewOptions.tsx +31 -0
- package/dist/components/core/common/SolidLoaders/SolidCircularLoader.tsx +7 -0
- package/dist/components/core/common/SolidPasswordHelperText.tsx +34 -0
- package/dist/components/core/common/SolidSaveCustomFilterForm.tsx +75 -0
- package/dist/components/core/common/SolidSearchBox.tsx +17 -0
- package/dist/components/core/common/SolidViewLayoutManager.ts +421 -0
- package/dist/components/core/common/SolidXAiIframe.tsx +77 -0
- package/dist/components/core/dashboard/SolidDashboard.tsx +332 -0
- package/dist/components/core/dashboard/SolidDashboardBody.tsx +117 -0
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.tsx +28 -0
- package/dist/components/core/dashboard/SolidDashboardHeader.tsx +10 -0
- package/dist/components/core/dashboard/SolidDashboardLoading.tsx +55 -0
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.tsx +32 -0
- package/dist/components/core/dashboard/SolidDashboardRenderError.tsx +29 -0
- package/dist/components/core/dashboard/SolidDashboardVariable.tsx +256 -0
- package/dist/components/core/dashboard/SolidQuestionRenderer.tsx +78 -0
- package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.tsx +18 -0
- package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.tsx +54 -0
- package/dist/components/core/dashboard/chart-renderers/init-chartjs.ts +25 -0
- package/dist/components/core/dashboard/dashboard-utils.ts +39 -0
- package/dist/components/core/extension/solid-core/CustomIcon/StatusIcon.tsx +17 -0
- package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.tsx +36 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeChangeHandler.ts +18 -0
- package/dist/components/core/extension/solid-core/emailTemplate/emailFormTypeLoad.ts +18 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +114 -0
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +213 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/DeleteModuleRowAction.tsx +138 -0
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.tsx +209 -0
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +131 -0
- package/dist/components/core/field/FieldListViewData.tsx +313 -0
- package/dist/components/core/filter/SolidBooleanFilterElement.tsx +30 -0
- package/dist/components/core/filter/SolidFilterFields.tsx +131 -0
- package/dist/components/core/filter/SolidManyToManyFilterElement.tsx +64 -0
- package/dist/components/core/filter/SolidManyToOneFilterElement.tsx +61 -0
- package/dist/components/core/filter/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/filter/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/filter/SolidVarInputsFilterElement.tsx +209 -0
- package/dist/components/core/filter/fields/SolidBigintField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidBooleanField.tsx +68 -0
- package/dist/components/core/filter/fields/SolidComputedField.tsx +23 -0
- package/dist/components/core/filter/fields/SolidDateField.tsx +63 -0
- package/dist/components/core/filter/fields/SolidDatetimeField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidDecimalField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidExternalIdField.tsx +52 -0
- package/dist/components/core/filter/fields/SolidFloatField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidIdField.tsx +46 -0
- package/dist/components/core/filter/fields/SolidIntField.tsx +61 -0
- package/dist/components/core/filter/fields/SolidLongTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidMediaMultipleField.tsx +60 -0
- package/dist/components/core/filter/fields/SolidMediaSingleField.tsx +62 -0
- package/dist/components/core/filter/fields/SolidRelationField.tsx +17 -0
- package/dist/components/core/filter/fields/SolidRichTextField.tsx +9 -0
- package/dist/components/core/filter/fields/SolidSelectionDynamicField.tsx +52 -0
- package/dist/components/core/filter/fields/SolidSelectionStaticField.tsx +54 -0
- package/dist/components/core/filter/fields/SolidShortTextField.tsx +60 -0
- package/dist/components/core/filter/fields/SolidTimeField.tsx +48 -0
- package/dist/components/core/filter/fields/SolidUuidField.tsx +51 -0
- package/dist/components/core/filter/fields/relations/SolidRelationManyToManyField.tsx +62 -0
- package/dist/components/core/filter/fields/relations/SolidRelationManyToOneField.tsx +84 -0
- package/dist/components/core/form/SolidFormActionHeader.tsx +497 -0
- package/dist/components/core/form/SolidFormFieldRender.tsx +53 -0
- package/dist/components/core/form/SolidFormFieldRenderExtension.tsx +26 -0
- package/dist/components/core/form/SolidFormFooter.tsx +162 -0
- package/dist/components/core/form/SolidFormLayouts.tsx +104 -0
- package/dist/components/core/form/SolidFormUserViewLayout.tsx +84 -0
- package/dist/components/core/form/SolidFormView.tsx +1856 -0
- package/dist/components/core/form/SolidFormViewContextMenuHeaderButton.tsx +52 -0
- package/dist/components/core/form/SolidFormViewNormalHeaderButton.tsx +52 -0
- package/dist/components/core/form/SolidFormViewShimmerLoading.tsx +109 -0
- package/dist/components/core/form/fields/ISolidField.tsx +71 -0
- package/dist/components/core/form/fields/SolidBooleanField.tsx +434 -0
- package/dist/components/core/form/fields/SolidDateField.tsx +247 -0
- package/dist/components/core/form/fields/SolidDateTimeField.tsx +229 -0
- package/dist/components/core/form/fields/SolidDecimalField.tsx +171 -0
- package/dist/components/core/form/fields/SolidEmailField.tsx +176 -0
- package/dist/components/core/form/fields/SolidIntegerField.tsx +282 -0
- package/dist/components/core/form/fields/SolidJsonField.tsx +185 -0
- package/dist/components/core/form/fields/SolidLongTextField.tsx +618 -0
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +663 -0
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +547 -0
- package/dist/components/core/form/fields/SolidPasswordField.tsx +390 -0
- package/dist/components/core/form/fields/SolidRelationField.tsx +56 -0
- package/dist/components/core/form/fields/SolidRichTextField.tsx +188 -0
- package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +340 -0
- package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +462 -0
- package/dist/components/core/form/fields/SolidShortTextField.tsx +399 -0
- package/dist/components/core/form/fields/SolidTimeField.tsx +245 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +453 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +1036 -0
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +627 -0
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +38 -0
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts +64 -0
- package/dist/components/core/form/fields/widgets/SolidAiInteractionMessageFieldFormWidget.tsx +135 -0
- package/dist/components/core/form/fields/widgets/SolidAiInteractionMetadataFieldFormWidget.tsx +144 -0
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +265 -0
- package/dist/components/core/form/fields/widgets/SolidIconViewWidget.tsx +32 -0
- package/dist/components/core/form/fields/widgets/SolidRelationFieldAvatarFormWidget.tsx +50 -0
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.tsx +222 -0
- package/dist/components/core/form/fields/widgets/SolidShortTextFieldAvatarWidget.tsx +70 -0
- package/dist/components/core/form/widgets/CustomHtml.tsx +20 -0
- package/dist/components/core/kanban/KanbanBoard.tsx +150 -0
- package/dist/components/core/kanban/KanbanCard.tsx +279 -0
- package/dist/components/core/kanban/KanbanColumn.tsx +139 -0
- package/dist/components/core/kanban/KanbanUserViewLayout.tsx +84 -0
- package/dist/components/core/kanban/SolidKanbanView.tsx +894 -0
- package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +154 -0
- package/dist/components/core/kanban/SolidKanbanViewFields.tsx +164 -0
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +59 -0
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/kanban/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.tsx +16 -0
- package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.tsx +23 -0
- package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.tsx +20 -0
- package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +140 -0
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +164 -0
- package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.tsx +9 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.tsx +14 -0
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +121 -0
- package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.tsx +12 -0
- package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.tsx +13 -0
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +16 -0
- package/dist/components/core/list/ListViewRowActionPopup.tsx +41 -0
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.tsx +242 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +111 -0
- package/dist/components/core/list/SolidListView.tsx +2007 -0
- package/dist/components/core/list/SolidListViewColumn.tsx +165 -0
- package/dist/components/core/list/SolidListViewConfigure.tsx +339 -0
- package/dist/components/core/list/SolidListViewHeaderButton.tsx +31 -0
- package/dist/components/core/list/SolidListViewHeaderContextMenuButton.tsx +30 -0
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +41 -0
- package/dist/components/core/list/SolidListViewShimmerLoading.tsx +78 -0
- package/dist/components/core/list/SolidListingHeader.tsx +42 -0
- package/dist/components/core/list/SolidManyToOneFilterElement.tsx +60 -0
- package/dist/components/core/list/SolidSelectionDynamicFilterElement.tsx +50 -0
- package/dist/components/core/list/SolidSelectionStaticFilterElement.tsx +32 -0
- package/dist/components/core/list/SolidTableRowCell.tsx +35 -0
- package/dist/components/core/list/SolidVarInputsFilterElement.tsx +184 -0
- package/dist/components/core/list/columns/SolidBigintColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidBooleanColumn.tsx +90 -0
- package/dist/components/core/list/columns/SolidComputedColumn.tsx +27 -0
- package/dist/components/core/list/columns/SolidDateColumn.tsx +90 -0
- package/dist/components/core/list/columns/SolidDatetimeColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidDecimalColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidExternalIdColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidFloatColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidIdColumn.tsx +79 -0
- package/dist/components/core/list/columns/SolidIntColumn.tsx +87 -0
- package/dist/components/core/list/columns/SolidLongTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +301 -0
- package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +170 -0
- package/dist/components/core/list/columns/SolidRelationColumn.tsx +21 -0
- package/dist/components/core/list/columns/SolidRichTextColumn.tsx +9 -0
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.tsx +80 -0
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.tsx +81 -0
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +160 -0
- package/dist/components/core/list/columns/SolidTimeColumn.tsx +78 -0
- package/dist/components/core/list/columns/SolidUuidColumn.tsx +79 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +106 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +117 -0
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +110 -0
- package/dist/components/core/list/widgets/SolidManyToManyRelationAvatarListWidget.tsx +30 -0
- package/dist/components/core/list/widgets/SolidManyToOneRelationAvatarListWidget.tsx +30 -0
- package/dist/components/core/list/widgets/SolidShortTextAvatarWidget.tsx +70 -0
- package/dist/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget.tsx +21 -0
- package/dist/components/core/locales/SolidChatterLocaleTabView.tsx +91 -0
- package/dist/components/core/locales/SolidLocale.tsx +127 -0
- package/dist/components/core/model/CreateModel.tsx +495 -0
- package/dist/components/core/model/FieldMetaData.tsx +263 -0
- package/dist/components/core/model/FieldMetaDataForm.tsx +3509 -0
- package/dist/components/core/model/FieldSelector.tsx +62 -0
- package/dist/components/core/model/ModelListViewData.tsx +384 -0
- package/dist/components/core/model/ModelMetaData.tsx +921 -0
- package/dist/components/core/module/CreateModule.tsx +617 -0
- package/dist/components/core/module/ModuleListViewData.tsx +431 -0
- package/dist/components/core/solid-ai/SolidAiMainWrapper.tsx +8 -0
- package/dist/components/core/solid-ai/SolidXAIIcon.tsx +37 -0
- package/dist/components/core/users/CreateUser.tsx +467 -0
- package/dist/components/core/users/CreateUserRole.tsx +212 -0
- package/dist/components/core/users/UserListView.tsx +376 -0
- package/dist/components/layout/AdminLayout.tsx +57 -0
- package/dist/components/layout/AdminSidebar.tsx +65 -0
- package/dist/components/layout/AppConfig.tsx +104 -0
- package/dist/components/layout/AppSidebar.tsx +232 -0
- package/dist/components/layout/ButtonLoader.tsx +7 -0
- package/dist/components/layout/CustomPagination.tsx +55 -0
- package/dist/components/layout/DashboardHeader.tsx +89 -0
- package/dist/components/layout/FilterMenu.tsx +122 -0
- package/dist/components/layout/Footer.tsx +13 -0
- package/dist/components/layout/GlobalSearch.tsx +37 -0
- package/dist/components/layout/Header.tsx +8 -0
- package/dist/components/layout/Layout.tsx +205 -0
- package/dist/components/layout/ListingHeader.tsx +204 -0
- package/dist/components/layout/Loader.tsx +16 -0
- package/dist/components/layout/UserSidebar.tsx +53 -0
- package/dist/components/layout/context/layoutcontext.tsx +52 -0
- package/dist/components/layout/navbar-one.tsx +258 -0
- package/dist/components/layout/navbar-two-menu.tsx +72 -0
- package/dist/components/layout/navbar-two.tsx +37 -0
- package/dist/components/layout/user-profile-menu.tsx +213 -0
- package/dist/components/layout/user-profile.tsx +7 -0
- package/dist/components/modelsComponents/filterIcon.tsx +9 -0
- package/dist/constants/error-messages.ts +238 -0
- package/dist/declarations.d.ts +22 -0
- package/dist/helpers/AppTitle.tsx +12 -0
- package/dist/helpers/ToastContainer.tsx +94 -0
- package/dist/helpers/autoCompleteVirtualScroll.ts +41 -0
- package/dist/helpers/countries.tsx +260 -0
- package/dist/helpers/downloadFileWithProgress.ts +91 -0
- package/dist/helpers/downloadMediaFile.tsx +21 -0
- package/dist/helpers/getAcceptedFileTypes.tsx +22 -0
- package/dist/helpers/getRandomColors.tsx +68 -0
- package/dist/helpers/helpers.ts +61 -0
- package/dist/helpers/hydrateRelationRules.ts +120 -0
- package/dist/helpers/permissions.ts +7 -0
- package/dist/helpers/registry.ts +337 -0
- package/dist/helpers/resendOtpHelper.tsx +5 -0
- package/dist/helpers/revalidate.ts +7 -0
- package/dist/helpers/rolesHelper.ts +17 -0
- package/dist/helpers/solidIcons.tsx +1831 -0
- package/dist/helpers/updatePasswordField.ts +41 -0
- package/dist/index.ts +421 -0
- package/dist/nextAuth/authProviders.d.ts.map +1 -1
- package/dist/nextAuth/authProviders.js +6 -5
- package/dist/nextAuth/authProviders.js.map +1 -1
- package/dist/nextAuth/authProviders.tsx +232 -0
- package/dist/nextAuth/handleLogout.tsx +39 -0
- package/dist/nextAuth/refreshAccessToken.tsx +28 -0
- package/dist/redux/api/aiInteractionApi.ts +59 -0
- package/dist/redux/api/authApi.ts +131 -0
- package/dist/redux/api/dashboardApi.ts +56 -0
- package/dist/redux/api/dashboardQuestionApi.ts +17 -0
- package/dist/redux/api/exportTemplateApi.tsx +59 -0
- package/dist/redux/api/fetchBaseQuery.tsx +118 -0
- package/dist/redux/api/fieldApi.ts +86 -0
- package/dist/redux/api/importTransactionApi.tsx +69 -0
- package/dist/redux/api/mediaApi.ts +55 -0
- package/dist/redux/api/mediaStorageProviderApi.ts +55 -0
- package/dist/redux/api/modelApi.ts +80 -0
- package/dist/redux/api/moduleApi.ts +72 -0
- package/dist/redux/api/permissionApi.ts +32 -0
- package/dist/redux/api/pincodeApi.tsx +56 -0
- package/dist/redux/api/roleApi.ts +58 -0
- package/dist/redux/api/solidActionApi.ts +66 -0
- package/dist/redux/api/solidChatterMessageApi.ts +25 -0
- package/dist/redux/api/solidEntityApi.tsx +164 -0
- package/dist/redux/api/solidMenuApi.ts +71 -0
- package/dist/redux/api/solidServiceApi.ts +31 -0
- package/dist/redux/api/solidSettingsApi.tsx +83 -0
- package/dist/redux/api/solidViewApi.ts +73 -0
- package/dist/redux/api/stateApi.tsx +56 -0
- package/dist/redux/api/testApi.ts +21 -0
- package/dist/redux/api/userApi.ts +135 -0
- package/dist/redux/features/authSlice.ts +19 -0
- package/dist/redux/features/dataViewSlice.ts +26 -0
- package/dist/redux/features/navbarSlice.ts +21 -0
- package/dist/redux/features/popupSlice.ts +37 -0
- package/dist/redux/features/settingsSlice.ts +60 -0
- package/dist/redux/features/themeSlice.ts +17 -0
- package/dist/redux/features/userSlice.ts +28 -0
- package/dist/redux/hooks/useSolidPopup.ts +20 -0
- package/dist/redux/store/defaultStoreConfig.ts +62 -0
- package/dist/styles.ts +4 -0
- package/dist/types/handlebars.d.ts +4 -0
- package/dist/types/index.d.ts +76 -0
- package/dist/types/layout.d.ts +94 -0
- package/dist/types/next-auth.d.ts +0 -0
- package/dist/types/next.d.ts +46 -0
- package/dist/types/solid-core.d.ts +320 -0
- package/package.json +1 -1
- package/src/components/auth/SolidLogin.tsx +26 -13
- package/src/nextAuth/authProviders.tsx +9 -5
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ERROR_MESSAGES } from "../constants/error-messages";
|
|
2
|
+
import { getSession } from "next-auth/react";
|
|
3
|
+
|
|
4
|
+
export async function updatePasswordField({
|
|
5
|
+
url,
|
|
6
|
+
id,
|
|
7
|
+
fieldName,
|
|
8
|
+
fieldValue,
|
|
9
|
+
confirmFieldName,
|
|
10
|
+
confirmFieldValue,
|
|
11
|
+
}: {
|
|
12
|
+
url: string;
|
|
13
|
+
id: string | number;
|
|
14
|
+
fieldName: string;
|
|
15
|
+
fieldValue: string;
|
|
16
|
+
confirmFieldName: string;
|
|
17
|
+
confirmFieldValue: string;
|
|
18
|
+
}): Promise<void> {
|
|
19
|
+
const baseUrl = `${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api`;
|
|
20
|
+
const session = await getSession();
|
|
21
|
+
|
|
22
|
+
const headers = new Headers();
|
|
23
|
+
headers.set("Content-Type", "application/json");
|
|
24
|
+
if (session?.user?.accessToken) {
|
|
25
|
+
headers.set("Authorization", `Bearer ${session.user.accessToken}`);
|
|
26
|
+
}
|
|
27
|
+
const body = {
|
|
28
|
+
[fieldName]: fieldValue,
|
|
29
|
+
[confirmFieldName]: confirmFieldValue,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const response = await fetch(`${baseUrl}/${url}/${id}`, {
|
|
33
|
+
method: "PATCH",
|
|
34
|
+
headers,
|
|
35
|
+
body: JSON.stringify(body),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
if (!response.ok) {
|
|
39
|
+
throw new Error(ERROR_MESSAGES.FAILED_TO_UPDATE_PASSWORD);
|
|
40
|
+
}
|
|
41
|
+
}
|
package/dist/index.ts
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
// export * from './components/common/AuthBanner';
|
|
2
|
+
export { AutoCompleteField } from './components/common/AutoCompleteField';
|
|
3
|
+
export { CancelButton, SolidCancelButton } from './components/common/CancelButton';
|
|
4
|
+
// export * from './components/common/CodeEditor';
|
|
5
|
+
export { CreateButton } from './components/common/CreateButton';
|
|
6
|
+
export { DropzonePlaceholder } from './components/common/DropzonePlaceholder';
|
|
7
|
+
export { DropzoneUpload } from './components/common/DropzoneUpload';
|
|
8
|
+
// export * from './components/common/FilterComponent';
|
|
9
|
+
export { HeaderDynamicTitles } from './components/common/HeaderDynamicTitles';
|
|
10
|
+
// export * from './components/common/MarkdownViewer';
|
|
11
|
+
export { MultipleSelectAutoCompleteField } from './components/common/MultipleSelectAutoCompleteField';
|
|
12
|
+
export { SingleSelectAutoCompleteField } from './components/common/SingleSelectAutoCompleteField';
|
|
13
|
+
export { SocialMediaLogin } from './components/common/SocialMediaLogin';
|
|
14
|
+
export { BackButton } from './components/common/BackButton';
|
|
15
|
+
export { FileReaderExt } from './components/common/FileReaderExt';
|
|
16
|
+
export { NotFound } from './components/common/NotFound';
|
|
17
|
+
|
|
18
|
+
import Error from './components/common/error';
|
|
19
|
+
export { Error };
|
|
20
|
+
|
|
21
|
+
export { SolidFormStepper } from './components/common/SolidFormStepper';
|
|
22
|
+
export { SolidViewLayoutManager } from './components/core/common/SolidViewLayoutManager';
|
|
23
|
+
|
|
24
|
+
// export { SolidListViewOptions } from './components/core/common/SolidListViewOptions';
|
|
25
|
+
export { SolidListViewConfigure } from './components/core/list/SolidListViewConfigure';
|
|
26
|
+
export { SolidCreateButton } from './components/core/common/SolidCreateButton';
|
|
27
|
+
export { SolidGlobalSearchElement } from './components/core/common/SolidGlobalSearchElement';
|
|
28
|
+
export { SolidSaveCustomFilterForm } from './components/core/common/SolidSaveCustomFilterForm';
|
|
29
|
+
export { SolidSearchBox } from './components/core/common/SolidSearchBox';
|
|
30
|
+
|
|
31
|
+
// export type {ModelMetaData} from './components/core/field/FieldListViewData';
|
|
32
|
+
export { FieldListViewData } from './components/core/field/FieldListViewData';
|
|
33
|
+
|
|
34
|
+
export type { SolidFormViewProps } from './components/core/form/SolidFormView';
|
|
35
|
+
|
|
36
|
+
export type { FormikObject, ISolidField, SolidFieldProps } from './components/core/form/fields/ISolidField';
|
|
37
|
+
export { SolidBooleanField } from './components/core/form/fields/SolidBooleanField';
|
|
38
|
+
export { SolidDateField } from './components/core/form/fields/SolidDateField';
|
|
39
|
+
export { SolidDateTimeField } from './components/core/form/fields/SolidDateTimeField';
|
|
40
|
+
export { SolidDecimalField } from './components/core/form/fields/SolidDecimalField';
|
|
41
|
+
export { SolidIntegerField } from './components/core/form/fields/SolidIntegerField';
|
|
42
|
+
export { SolidJsonField } from './components/core/form/fields/SolidJsonField';
|
|
43
|
+
export { SolidLongTextField } from './components/core/form/fields/SolidLongTextField';
|
|
44
|
+
export { SolidMediaMultipleField } from './components/core/form/fields/SolidMediaMultipleField';
|
|
45
|
+
export { SolidMediaSingleField } from './components/core/form/fields/SolidMediaSingleField';
|
|
46
|
+
export { SolidRelationField } from './components/core/form/fields/SolidRelationField';
|
|
47
|
+
export { SolidRichTextField } from './components/core/form/fields/SolidRichTextField';
|
|
48
|
+
export { SolidSelectionDynamicField } from './components/core/form/fields/SolidSelectionDynamicField';
|
|
49
|
+
export { SolidSelectionStaticField } from './components/core/form/fields/SolidSelectionStaticField';
|
|
50
|
+
export { SolidShortTextField } from './components/core/form/fields/SolidShortTextField';
|
|
51
|
+
export { SolidTimeField } from './components/core/form/fields/SolidTimeField';
|
|
52
|
+
|
|
53
|
+
export { SolidRelationManyToManyField } from './components/core/form/fields/relations/SolidRelationManyToManyField';
|
|
54
|
+
export { SolidRelationManyToOneField } from './components/core/form/fields/relations/SolidRelationManyToOneField';
|
|
55
|
+
export { SolidRelationOneToManyField } from './components/core/form/fields/relations/SolidRelationOneToManyField';
|
|
56
|
+
|
|
57
|
+
export { SolidChatter } from './components/core/chatter/SolidChatter';
|
|
58
|
+
|
|
59
|
+
// export * from './components/core/kanban/KanbanBoard';
|
|
60
|
+
// export * from './components/core/kanban/KanbanCard';
|
|
61
|
+
// export * from './components/core/kanban/KanbanColumn';
|
|
62
|
+
export { SolidKanbanView } from './components/core/kanban/SolidKanbanView';
|
|
63
|
+
|
|
64
|
+
export { SolidModuleHome } from './components/common/SolidModuleHome';
|
|
65
|
+
export { SolidListView } from './components/core/list/SolidListView';
|
|
66
|
+
export { SolidListViewColumn, getNumberOfInputs } from './components/core/list/SolidListViewColumn';
|
|
67
|
+
export type { SolidListViewColumnParams } from './components/core/list/SolidListViewColumn';
|
|
68
|
+
|
|
69
|
+
// export * from './components/core/list/SolidListingHeader';
|
|
70
|
+
export { SolidManyToOneFilterElement } from './components/core/list/SolidManyToOneFilterElement';
|
|
71
|
+
export { SolidSelectionDynamicFilterElement } from './components/core/list/SolidSelectionDynamicFilterElement';
|
|
72
|
+
export { SolidSelectionStaticFilterElement } from './components/core/list/SolidSelectionStaticFilterElement';
|
|
73
|
+
export { SolidVarInputsFilterElement } from './components/core/list/SolidVarInputsFilterElement';
|
|
74
|
+
|
|
75
|
+
export { default as SolidDashboard } from './components/core/dashboard/SolidDashboard';
|
|
76
|
+
|
|
77
|
+
export { dateFilterMatchModeOptions } from './components/core/list/columns/SolidDateColumn';
|
|
78
|
+
|
|
79
|
+
export { ModelListViewData } from './components/core/model/ModelListViewData';
|
|
80
|
+
export { ModuleListViewData } from './components/core/module/ModuleListViewData';
|
|
81
|
+
|
|
82
|
+
export { UserListView } from './components/core/users/UserListView';
|
|
83
|
+
|
|
84
|
+
export { GlobalSearch } from './components/layout/GlobalSearch';
|
|
85
|
+
export { LayoutContext, LayoutProvider } from './components/layout/context/layoutcontext';
|
|
86
|
+
export { Layout } from './components/layout/Layout';
|
|
87
|
+
|
|
88
|
+
export { FilterIcon } from './components/modelsComponents/filterIcon';
|
|
89
|
+
|
|
90
|
+
export { ToastContainer, handleError, handleSuccess } from './helpers/ToastContainer';
|
|
91
|
+
// export { getAuthCookieName, getAuthHeader } from './helpers/authHeader';
|
|
92
|
+
export { AppTitle } from './helpers/AppTitle';
|
|
93
|
+
export { addCommasToAmount, calculateDaysOfStay, getSingularAndPlural } from './helpers/helpers';
|
|
94
|
+
export { permissionExpression } from './helpers/permissions';
|
|
95
|
+
export { revalidateTag } from './helpers/revalidate';
|
|
96
|
+
export { useHasAllRoles, useHasAnyRole, hasAnyRole } from './helpers/rolesHelper';
|
|
97
|
+
export { registerExtensionComponent, registerExtensionFunction } from './helpers/registry';
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
authApi,
|
|
101
|
+
useForgotPasswordMutation,
|
|
102
|
+
useRegisterMutation,
|
|
103
|
+
useRegisterPrivateMutation,
|
|
104
|
+
useResetPasswordMutation,
|
|
105
|
+
useUpdateUserMutation,
|
|
106
|
+
useInitateLoginMutation,
|
|
107
|
+
useConfirmOtpLoginMutation,
|
|
108
|
+
useInitateRegisterMutation,
|
|
109
|
+
useConfirmOtpRegisterMutation
|
|
110
|
+
} from './redux/api/authApi';
|
|
111
|
+
|
|
112
|
+
export { baseQueryWithAuth } from './redux/api/fetchBaseQuery';
|
|
113
|
+
|
|
114
|
+
export {
|
|
115
|
+
fieldsApi,
|
|
116
|
+
useCreatefieldMutation,
|
|
117
|
+
useDeletefieldMutation,
|
|
118
|
+
useGetFieldDefaultMetaDataQuery,
|
|
119
|
+
useGetSelectionDynamicValueQuery,
|
|
120
|
+
useGetSelectionDynamicValuesQuery,
|
|
121
|
+
useGetfieldByIdQuery,
|
|
122
|
+
useGetfieldsQuery,
|
|
123
|
+
useLazyGetFieldDefaultMetaDataQuery,
|
|
124
|
+
useLazyGetSelectionDynamicValueQuery,
|
|
125
|
+
useLazyGetSelectionDynamicValuesQuery,
|
|
126
|
+
useLazyGetfieldByIdQuery,
|
|
127
|
+
useLazyGetfieldsQuery
|
|
128
|
+
} from './redux/api/fieldApi';
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
mediaApi,
|
|
132
|
+
useCreateMediaMutation,
|
|
133
|
+
useDeleteMediaMutation,
|
|
134
|
+
useDeleteMultipleMediasMutation,
|
|
135
|
+
useGetMediaByIdQuery,
|
|
136
|
+
useGetMediasQuery,
|
|
137
|
+
useLazyGetMediaByIdQuery,
|
|
138
|
+
useLazyGetMediasQuery,
|
|
139
|
+
useUpdateMediaMutation
|
|
140
|
+
} from './redux/api/mediaApi';
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
mediaStorageProviderApi,
|
|
144
|
+
useCreateMediaStorageProivderMutation,
|
|
145
|
+
useDeleteMediaStorageProivderMutation,
|
|
146
|
+
useDeleteMultipleMediaStorageProvidersMutation,
|
|
147
|
+
useGetMediaStorageProivderByIdQuery,
|
|
148
|
+
useGetMediaStorageProvidersQuery,
|
|
149
|
+
useLazyGetMediaStorageProivderByIdQuery,
|
|
150
|
+
useLazyGetMediaStorageProvidersQuery,
|
|
151
|
+
useUpdateMediaStorageProivderMutation
|
|
152
|
+
} from './redux/api/mediaStorageProviderApi';
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
modelsApi,
|
|
156
|
+
useCreatemodelMutation,
|
|
157
|
+
useDeleteMultipleModelsMutation,
|
|
158
|
+
useDeletemodelMutation,
|
|
159
|
+
useGenerateCodeForModelMutation,
|
|
160
|
+
useGetModelsQuery,
|
|
161
|
+
useGetmodelByIdQuery,
|
|
162
|
+
useLazyGetModelsQuery,
|
|
163
|
+
useLazyGetmodelByIdQuery,
|
|
164
|
+
useUpdatemodelMutation
|
|
165
|
+
} from './redux/api/modelApi';
|
|
166
|
+
|
|
167
|
+
export {
|
|
168
|
+
modulesApi,
|
|
169
|
+
useCreatemoduleMutation,
|
|
170
|
+
useDeleteMultiplemodulesMutation,
|
|
171
|
+
useDeletemoduleMutation,
|
|
172
|
+
useGenerateCodeFormoduleMutation,
|
|
173
|
+
useGetDefaultDataSourceQuery,
|
|
174
|
+
useGetmoduleByIdQuery,
|
|
175
|
+
useGetmodulesQuery,
|
|
176
|
+
useLazyGetDefaultDataSourceQuery,
|
|
177
|
+
useLazyGetmoduleByIdQuery,
|
|
178
|
+
useLazyGetmodulesQuery,
|
|
179
|
+
useRefreshPermissionsMutation,
|
|
180
|
+
useUpdatemoduleMutation
|
|
181
|
+
} from './redux/api/moduleApi';
|
|
182
|
+
|
|
183
|
+
export { solidServiceApi, useSeederMutation } from './redux/api/solidServiceApi';
|
|
184
|
+
export { solidChatterMessageApi, useGetchatterMessageQuery, useLazyGetchatterMessageQuery } from './redux/api/solidChatterMessageApi';
|
|
185
|
+
|
|
186
|
+
export {
|
|
187
|
+
roleApi,
|
|
188
|
+
useGetrolesQuery,
|
|
189
|
+
useGetroleByIdQuery,
|
|
190
|
+
useCreateroleMutation,
|
|
191
|
+
useLazyGetrolesQuery,
|
|
192
|
+
useUpdateroleMutation,
|
|
193
|
+
useDeleteroleMutation
|
|
194
|
+
} from './redux/api/roleApi';
|
|
195
|
+
|
|
196
|
+
export {
|
|
197
|
+
exportTemplateApi,
|
|
198
|
+
useCreateExportTemplateMutation,
|
|
199
|
+
useGetExportTemplatesQuery,
|
|
200
|
+
useCreateExportSyncMutation,
|
|
201
|
+
useCreateExportAsyncMutation
|
|
202
|
+
} from './redux/api/exportTemplateApi';
|
|
203
|
+
|
|
204
|
+
export {
|
|
205
|
+
importTransactionApi,
|
|
206
|
+
useGetImportInstructionsQuery,
|
|
207
|
+
useLazyGetImportInstructionsQuery,
|
|
208
|
+
useGetImportTemplateQuery,
|
|
209
|
+
useLazyGetImportTemplateQuery,
|
|
210
|
+
useCreateImportTransactionMutation,
|
|
211
|
+
usePatchUpdateImportTransactionMutation,
|
|
212
|
+
useGetImportMappingInfoQuery,
|
|
213
|
+
useLazyGetImportMappingInfoQuery,
|
|
214
|
+
useCreateImportAsyncMutation,
|
|
215
|
+
useCreateImportSyncMutation
|
|
216
|
+
} from './redux/api/importTransactionApi';
|
|
217
|
+
|
|
218
|
+
export {
|
|
219
|
+
solidActionsApi,
|
|
220
|
+
useCreateSolidActionMutation,
|
|
221
|
+
useDeleteMultipleSolidActionsMutation,
|
|
222
|
+
useDeleteSolidActionMutation,
|
|
223
|
+
useGetSolidActionByIdQuery,
|
|
224
|
+
useGetSolidActionsQuery,
|
|
225
|
+
useLazyGetSolidActionByIdQuery,
|
|
226
|
+
useLazyGetSolidActionsQuery,
|
|
227
|
+
useUpdateSolidActionMutation
|
|
228
|
+
} from './redux/api/solidActionApi';
|
|
229
|
+
|
|
230
|
+
export { createSolidEntityApi } from './redux/api/solidEntityApi';
|
|
231
|
+
|
|
232
|
+
export {
|
|
233
|
+
solidMenusApi,
|
|
234
|
+
useCreateSolidMenuMutation,
|
|
235
|
+
useDeleteMultipleSolidMenusMutation,
|
|
236
|
+
useDeleteSolidMenuMutation,
|
|
237
|
+
useGetSolidMenuBasedOnRoleQuery,
|
|
238
|
+
useGetSolidMenuByIdQuery,
|
|
239
|
+
useGetSolidMenusQuery,
|
|
240
|
+
useLazyGetSolidMenuBasedOnRoleQuery,
|
|
241
|
+
useLazyGetSolidMenuByIdQuery,
|
|
242
|
+
useLazyGetSolidMenusQuery,
|
|
243
|
+
useUpdateSolidMenuMutation
|
|
244
|
+
} from './redux/api/solidMenuApi';
|
|
245
|
+
|
|
246
|
+
export {
|
|
247
|
+
solidViewsApi,
|
|
248
|
+
useCreateSolidViewMutation,
|
|
249
|
+
useDeleteMultipleSolidViewsMutation,
|
|
250
|
+
useDeleteSolidViewMutation,
|
|
251
|
+
useGetSolidViewByIdQuery,
|
|
252
|
+
useGetSolidViewLayoutQuery,
|
|
253
|
+
useGetSolidViewsQuery,
|
|
254
|
+
useLazyGetSolidViewByIdQuery,
|
|
255
|
+
useLazyGetSolidViewsQuery,
|
|
256
|
+
useUpdateSolidViewMutation
|
|
257
|
+
} from './redux/api/solidViewApi';
|
|
258
|
+
|
|
259
|
+
export { dashboardApi } from './redux/api/dashboardApi';
|
|
260
|
+
export { dashboardQuestionApi } from './redux/api/dashboardQuestionApi';
|
|
261
|
+
export { aiInteractionApi } from './redux/api/aiInteractionApi';
|
|
262
|
+
|
|
263
|
+
export {
|
|
264
|
+
useCreateuserroleMutation,
|
|
265
|
+
useCreateuserrolebulkMutation,
|
|
266
|
+
useDeleteMultipleUsersMutation,
|
|
267
|
+
useDeleteUserMutation,
|
|
268
|
+
useGetusersByIdQuery,
|
|
269
|
+
useGetusersQuery,
|
|
270
|
+
useLazyCheckIfPermissionExistsQuery,
|
|
271
|
+
useLazyGetusersByIdQuery,
|
|
272
|
+
useLazyGetusersQuery,
|
|
273
|
+
useLazyUpdateSessionQuery,
|
|
274
|
+
useRegisterUserMutation,
|
|
275
|
+
useUpdatePasswordMutation,
|
|
276
|
+
useUpdateProfileMutation,
|
|
277
|
+
useUpdateSessionQuery,
|
|
278
|
+
useUploadAvatarMutation,
|
|
279
|
+
userApi
|
|
280
|
+
} from './redux/api/userApi';
|
|
281
|
+
|
|
282
|
+
export {
|
|
283
|
+
solidSettingsApi,
|
|
284
|
+
useCreateSolidSettingsMutation,
|
|
285
|
+
useGetSolidSettingsByIdQuery,
|
|
286
|
+
useGetSolidSettingsQuery,
|
|
287
|
+
useGetAuthSettingsQuery,
|
|
288
|
+
useLazyGetAuthSettingsQuery,
|
|
289
|
+
useLazyGetSolidSettingsQuery,
|
|
290
|
+
useLazyGetSolidSettingsByIdQuery,
|
|
291
|
+
useUpdateSolidSettingsMutation
|
|
292
|
+
} from './redux/api/solidSettingsApi';
|
|
293
|
+
|
|
294
|
+
export { logout, setToken } from './redux/features/authSlice';
|
|
295
|
+
export { gridView, listView } from './redux/features/dataViewSlice';
|
|
296
|
+
export { hideNavbar, showNavbar, toggleNavbar } from './redux/features/navbarSlice';
|
|
297
|
+
export { toggleTheme } from './redux/features/themeSlice';
|
|
298
|
+
export { setIsAuthenticated, setUser } from './redux/features/userSlice';
|
|
299
|
+
|
|
300
|
+
// Admin Parent Layout
|
|
301
|
+
export { AdminLayout } from './components/layout/AdminLayout';
|
|
302
|
+
export { SolidAdmin } from './components/common/SolidAdmin';
|
|
303
|
+
|
|
304
|
+
// Re-export default exports
|
|
305
|
+
export { default as AuthBanner } from './components/common/AuthBanner';
|
|
306
|
+
export { default as CodeEditor } from './components/common/CodeEditor';
|
|
307
|
+
export { default as MarkdownViewer } from './components/common/MarkdownViewer';
|
|
308
|
+
|
|
309
|
+
export { default as SolidFormLayouts } from './components/core/form/SolidFormLayouts';
|
|
310
|
+
export { default as SolidFormView } from './components/core/form/SolidFormView';
|
|
311
|
+
export { default as KanbanBoard } from './components/core/kanban/KanbanBoard';
|
|
312
|
+
export { default as KanbanCard } from './components/core/kanban/KanbanCard';
|
|
313
|
+
export { default as KanbanColumn } from './components/core/kanban/KanbanColumn';
|
|
314
|
+
export { default as SolidListingHeader } from './components/core/list/SolidListingHeader';
|
|
315
|
+
export { default as SolidBigintColumn } from './components/core/list/columns/SolidBigintColumn';
|
|
316
|
+
export { default as SolidBooleanColumn } from './components/core/list/columns/SolidBooleanColumn';
|
|
317
|
+
export { default as SolidComputedColumn } from './components/core/list/columns/SolidComputedColumn';
|
|
318
|
+
export { default as SolidDateColumn } from './components/core/list/columns/SolidDateColumn';
|
|
319
|
+
export { default as SolidDatetimeColumn } from './components/core/list/columns/SolidDatetimeColumn';
|
|
320
|
+
export { default as SolidDecimalColumn } from './components/core/list/columns/SolidDecimalColumn';
|
|
321
|
+
export { default as SolidExternalIdColumn } from './components/core/list/columns/SolidExternalIdColumn';
|
|
322
|
+
export { default as SolidFloatColumn } from './components/core/list/columns/SolidFloatColumn';
|
|
323
|
+
export { default as SolidIdColumn } from './components/core/list/columns/SolidIdColumn';
|
|
324
|
+
export { default as SolidIntColumn } from './components/core/list/columns/SolidIntColumn';
|
|
325
|
+
export { default as SolidLongTextColumn } from './components/core/list/columns/SolidLongTextColumn';
|
|
326
|
+
export { default as SolidMediaMultipleColumn } from './components/core/list/columns/SolidMediaMultipleColumn';
|
|
327
|
+
export { default as SolidMediaSingleColumn } from './components/core/list/columns/SolidMediaSingleColumn';
|
|
328
|
+
export { default as SolidRelationColumn } from './components/core/list/columns/SolidRelationColumn';
|
|
329
|
+
export { default as SolidRichTextColumn } from './components/core/list/columns/SolidRichTextColumn';
|
|
330
|
+
export { default as SolidSelectionDynamicColumn } from './components/core/list/columns/SolidSelectionDynamicColumn';
|
|
331
|
+
export { default as SolidSelectionStaticColumn } from './components/core/list/columns/SolidSelectionStaticColumn';
|
|
332
|
+
export { default as SolidShortTextColumn } from './components/core/list/columns/SolidShortTextColumn';
|
|
333
|
+
export { default as SolidTimeColumn } from './components/core/list/columns/SolidTimeColumn';
|
|
334
|
+
export { default as SolidUuidColumn } from './components/core/list/columns/SolidUuidColumn';
|
|
335
|
+
export { default as SolidRelationManyToOneColumn } from './components/core/list/columns/relations/SolidRelationManyToOneColumn';
|
|
336
|
+
|
|
337
|
+
export { default as CreateModel } from './components/core/model/CreateModel';
|
|
338
|
+
export { default as FieldMetaData } from './components/core/model/FieldMetaData';
|
|
339
|
+
export { default as FieldMetaDataForm } from './components/core/model/FieldMetaDataForm';
|
|
340
|
+
export { default as FieldSelector } from './components/core/model/FieldSelector';
|
|
341
|
+
export { default as ModelMetaData } from './components/core/model/ModelMetaData';
|
|
342
|
+
|
|
343
|
+
export { default as CreateModule } from './components/core/module/CreateModule';
|
|
344
|
+
|
|
345
|
+
export { default as CreateUser } from './components/core/users/CreateUser';
|
|
346
|
+
export { default as CreateUserRole } from './components/core/users/CreateUserRole';
|
|
347
|
+
|
|
348
|
+
export { default as AdminSidebar } from './components/layout/AdminSidebar';
|
|
349
|
+
export { default as ButtonLoader } from './components/layout/ButtonLoader';
|
|
350
|
+
export { default as DashboardHeader } from './components/layout/DashboardHeader';
|
|
351
|
+
export { default as FilterMenu } from './components/layout/FilterMenu';
|
|
352
|
+
export { default as Footer } from './components/layout/Footer';
|
|
353
|
+
export { default as Header } from './components/layout/Header';
|
|
354
|
+
export { default as ListingHeader } from './components/layout/ListingHeader';
|
|
355
|
+
export { default as Loader } from './components/layout/Loader';
|
|
356
|
+
export { default as NavbarOne } from './components/layout/navbar-one';
|
|
357
|
+
export { default as NavbarTwoMenu } from './components/layout/navbar-two-menu';
|
|
358
|
+
export { default as NavbarTwo } from './components/layout/navbar-two';
|
|
359
|
+
export { default as UserProfileMenu } from './components/layout/user-profile-menu';
|
|
360
|
+
export { default as UserProfile } from './components/layout/user-profile';
|
|
361
|
+
export { default as UserSidebar } from './components/layout/UserSidebar';
|
|
362
|
+
export { default as SolidPopupContainer } from './components/common/SolidPopupContainer';
|
|
363
|
+
|
|
364
|
+
// Auth
|
|
365
|
+
export { AuthLayout } from './components/auth/AuthLayout';
|
|
366
|
+
export { default as SolidForgotPassword } from './components/auth/SolidForgotPassword';
|
|
367
|
+
export { default as SolidLogin } from './components/auth/SolidLogin';
|
|
368
|
+
export { default as SolidOTPVerify } from './components/auth/SolidOTPVerify';
|
|
369
|
+
export { default as SolidRegister } from './components/auth/SolidRegister';
|
|
370
|
+
export { default as SolidResetPassword } from './components/auth/SolidResetPassword';
|
|
371
|
+
export { default as SolidChangeForcePassword } from './components/auth/SolidChangeForcePassword';
|
|
372
|
+
export { default as SolidInitialLoginOtp } from './components/auth/SolidInitialLoginOtp';
|
|
373
|
+
export { default as SolidInitiateRegisterOtp } from './components/auth/SolidInitiateRegisterOtp';
|
|
374
|
+
export { GoogleAuthChecking } from './components/auth/GoogleAuthChecking';
|
|
375
|
+
export { ForgotPasswordThankYou } from './components/auth/ForgotPasswordThankYou';
|
|
376
|
+
|
|
377
|
+
// redux
|
|
378
|
+
export { default as authenticationReducer } from './redux/features/authSlice';
|
|
379
|
+
export { default as dataViewReducer } from './redux/features/dataViewSlice';
|
|
380
|
+
export { default as navbarReducer } from './redux/features/navbarSlice';
|
|
381
|
+
export { default as popupReducer } from './redux/features/popupSlice';
|
|
382
|
+
export { closePopup, openPopup } from './redux/features/popupSlice';
|
|
383
|
+
export { default as themeReducer } from './redux/features/themeSlice';
|
|
384
|
+
export { default as userReducer } from './redux/features/userSlice';
|
|
385
|
+
export { default as useSolidPopup } from './redux/hooks/useSolidPopup';
|
|
386
|
+
export { solidApiSlices, solidReducers } from './redux/store/defaultStoreConfig';
|
|
387
|
+
|
|
388
|
+
export { default as GenerateModelCodeRowAction } from './components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction';
|
|
389
|
+
|
|
390
|
+
// types
|
|
391
|
+
export type {
|
|
392
|
+
LayoutConfig,
|
|
393
|
+
CommonEntity,
|
|
394
|
+
ModelMetadata,
|
|
395
|
+
ModuleMetadata,
|
|
396
|
+
FieldMetadata,
|
|
397
|
+
FieldsMetadata,
|
|
398
|
+
SolidView,
|
|
399
|
+
LayoutAttribute,
|
|
400
|
+
LayoutNode,
|
|
401
|
+
LayoutNodeType,
|
|
402
|
+
SolidUiEvents,
|
|
403
|
+
SolidUiEvent,
|
|
404
|
+
SolidUiEventResponse,
|
|
405
|
+
SolidLoadList,
|
|
406
|
+
SolidListUiEventResponse,
|
|
407
|
+
SolidListUiEvent,
|
|
408
|
+
SolidLoadForm,
|
|
409
|
+
SolidFormWidgetProps,
|
|
410
|
+
SolidFormFieldWidgetProps,
|
|
411
|
+
SolidChartRendererProps,
|
|
412
|
+
SolidBeforeListDataLoad
|
|
413
|
+
} from './types';
|
|
414
|
+
|
|
415
|
+
export { GeneralSettings } from './components/common/GeneralSettings';
|
|
416
|
+
|
|
417
|
+
export { default as authProviders } from './nextAuth/authProviders';
|
|
418
|
+
export { SolidThemeLink } from './components/common/SolidThemeLink';
|
|
419
|
+
export { SolidThemeProvider } from './components/common/SolidThemeProvider';
|
|
420
|
+
|
|
421
|
+
export * from "./styles";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authProviders.d.ts","sourceRoot":"./","sources":["nextAuth/authProviders.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"authProviders.d.ts","sourceRoot":"./","sources":["nextAuth/authProviders.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAW5C,QAAA,MAAM,aAAa,EAAE,eAqNpB,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -16,7 +16,8 @@ const authProviders = {
|
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
async authorize(credentials, req) {
|
|
18
18
|
const userAgent = req.headers['user-agent'];
|
|
19
|
-
const { username, email, password, accessToken, accessCode } = credentials;
|
|
19
|
+
const { username, email, password, identifier, accessToken, accessCode } = credentials;
|
|
20
|
+
console.log(credentials, '=========================');
|
|
20
21
|
try {
|
|
21
22
|
if (accessCode) {
|
|
22
23
|
let config = {
|
|
@@ -46,8 +47,8 @@ const authProviders = {
|
|
|
46
47
|
else {
|
|
47
48
|
if (accessToken) {
|
|
48
49
|
let data = JSON.stringify({
|
|
49
|
-
username:
|
|
50
|
-
email:
|
|
50
|
+
username: identifier,
|
|
51
|
+
email: identifier.includes('@') ? identifier : null,
|
|
51
52
|
password: password
|
|
52
53
|
});
|
|
53
54
|
let config = {
|
|
@@ -78,8 +79,8 @@ const authProviders = {
|
|
|
78
79
|
}
|
|
79
80
|
else {
|
|
80
81
|
let data = JSON.stringify({
|
|
81
|
-
username:
|
|
82
|
-
email:
|
|
82
|
+
username: identifier,
|
|
83
|
+
email: identifier.includes('@') ? identifier : null,
|
|
83
84
|
password: password
|
|
84
85
|
});
|
|
85
86
|
let config = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authProviders.js","sourceRoot":"./","sources":["nextAuth/authProviders.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,iCAAiC,CAAC;AAClE,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAW1D,MAAM,aAAa,GAAoB;IACnC,OAAO,EAAE;QACL,QAAQ,EAAE,KAAK;KAClB;IACD,SAAS,EAAE;QACP,cAAc,CAAC;YACX,QAAQ,EA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;QACD,aAAa;QACb,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;YAClC,0CAA0C;YAE1C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAE,0DAA0D;YAC1F,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;YACjD,qBAAqB;YACrB,gBAAgB;YAChB,IAAI;YACJ,OAAO,CAAC,IAAI,GAAG;gBACX,GAAG,IAAI;gBACP,WAAW,EAAE,KAAK,EAAE,WAAW;gBAC/B,YAAY,EAAE,KAAK,EAAE,YAAY;gBACjC,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,IAAI,KAAK,EAAE,kBAAkB,EAAG,wBAAwB;aACxG,CAAC;YACF,OAAO,OAAO,CAAC;QAEnB,CAAC;KACJ;IACD,KAAK,EAAE;QACH,MAAM,EAAE,aAAa;KACxB;IACD,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe;CACtC,CAAA;AAED,eAAe,aAAa,CAAA","sourcesContent":["import CredentialsProvider from \"next-auth/providers/credentials\";\nimport GoogleProvider from \"next-auth/providers/google\";\nimport { NextRequest } from \"next/server\";\nimport { jwtDecode } from \"jwt-decode\";\nimport { JWT } from \"next-auth/jwt\";\nimport axios from \"axios\";\nimport { signOut } from \"next-auth/react\";\nimport { refreshAccessToken } from \"./refreshAccessToken\";\nimport { NextAuthOptions } from \"next-auth\";\n\ntype Credentials = {\n username: string,\n email: string,\n password: string,\n accessToken: string,\n accessCode: string,\n};\n\nconst authProviders: NextAuthOptions = {\n session: {\n strategy: \"jwt\",\n },\n providers: [\n GoogleProvider({\n clientId: process.env.GOOGLE_ID!,\n clientSecret: process.env.GOOGLE_CLIENT_SECRET!\n }),\n CredentialsProvider({\n // @ts-ignore\n async authorize(credentials: Credentials, req: any) {\n const userAgent = req.headers['user-agent'];\n\n const { username, email, password, accessToken, accessCode } = credentials;\n try {\n if (accessCode) {\n let config = {\n method: 'get',\n url: `${process.env.API_URL}/api/iam/google/authenticate?accessCode=${accessCode}`,\n headers: {\n 'User-Agent': userAgent,\n }\n };\n const loginResponse = await axios.request(config);\n if (loginResponse.status == 400) {\n throw new Error(loginResponse.data.message);\n }\n if (loginResponse.status == 401) {\n throw new Error(loginResponse.data.message);\n }\n\n let base64decoded = jwtDecode(loginResponse.data.data.accessToken);\n // let accessTokenExpires = base64decoded.exp;\n let accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000;\n\n return {\n accessToken: loginResponse.data.data.accessToken,\n refreshToken: loginResponse.data.data.refreshToken,\n accessTokenExpires: accessTokenExpires,\n ...loginResponse.data.data,\n };\n\n } else {\n if (accessToken) {\n let data = JSON.stringify({\n username: email,\n email: email,\n password: password\n });\n\n let config = {\n method: 'get',\n url: `${process.env.API_URL}/api/iam/me`,\n headers: {\n 'accept': '*/*',\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${accessToken}`\n }\n };\n\n\n const loginResponse = await axios.request(config);\n\n if (loginResponse.status == 400) {\n throw new Error(loginResponse.data.message);\n }\n if (loginResponse.status == 401) {\n throw new Error(loginResponse.data.message);\n }\n \n let base64decoded = jwtDecode(accessToken);\n // let accessTokenExpires = base64decoded.exp;\n let accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000;\n\n return {\n accessToken: accessToken,\n refreshToken: loginResponse.data.data.refreshToken,\n accessTokenExpires: accessTokenExpires,\n ...loginResponse.data.data,\n };\n\n } else {\n\n let data = JSON.stringify({\n username: username,\n email: email,\n password: password\n });\n\n let config = {\n method: 'post',\n maxBodyLength: Infinity,\n url: `${process.env.API_URL}/api/iam/authenticate`,\n headers: {\n 'accept': '*/*',\n 'Content-Type': 'application/json',\n 'User-Agent': userAgent,\n },\n data: data\n };\n\n\n const loginResponse = await axios.request(config);\n\n // const authenticateResponse = await fetch(\n // `${process.env.API_URL}/api/iam/authenticate`,\n // {\n // method: \"Post\",\n // headers: {\n // 'accept': '*/*', \n // \"Content-Type\": \"application/json\"\n // },\n // body: JSON.stringify({\n // username: email,\n // email: email,\n // password: password\n // })\n // }\n // );\n\n // const loginResponse = await authenticateResponse.json();\n\n // const response = await fetch(\n // `${process.env.API_URL}/api/iam/me`,\n // {\n // method: \"Get\",\n // headers: {\n // \"Content-Type\": \"application/json\",\n // \"Authorization\": `Bearer ${loginResponse.data.accessToken}`,\n // },\n // }\n // );\n\n // const responseData = await response.json();\n\n if (loginResponse.status == 400) {\n throw new Error(loginResponse.data.message);\n }\n if (loginResponse.status == 401) {\n throw new Error(loginResponse.data.data.message);\n }\n let base64decoded = jwtDecode(loginResponse.data.data.accessToken);\n // let accessTokenExpires = base64decoded.exp;\n let accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000;\n const returnResponse = {\n accessToken: loginResponse.data.data.accessToken,\n refreshToken: loginResponse.data.data.refreshToken,\n accessTokenExpires: accessTokenExpires,\n ...loginResponse.data.data,\n }\n return returnResponse;\n }\n }\n } catch (error: any) {\n throw new Error(error?.response?.data?.message);\n }\n },\n }),\n ],\n callbacks: {\n // @ts-ignore\n jwt: async ({ token, user }) => {\n // console.log(\"JWT callback called\");\n const bufferTime = 60000;\n if (Date.now() >= (token.accessTokenExpires as number - bufferTime)) {\n // Call the refresh token function\n return await refreshAccessToken(token);\n }\n\n // If there is no user (first time login or session), we return the user data\n if (user) {\n // const base64decoded = jwtDecode(user.accessToken);\n // Convert from seconds to milliseconds\n // const accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000; \n // const accessTokenExpires = user.accessTokenExpires * 1000; \n return {\n ...token,\n accessToken: user.accessToken,\n refreshToken: user.refreshToken,\n accessTokenExpires: user.accessTokenExpires,\n user: user, // Include the user data here\n };\n }\n\n return token; // If no update needed, just return the existing token\n },\n // @ts-ignore\n session: async ({ session, token }) => {\n // console.log(\"Session callback called\");\n\n const user = token.user || {}; // Default to an empty object if user is undefined or null\n session.error = token.error ? token.error : null;\n // if (token.error) {\n // return null\n // }\n session.user = {\n ...user, // Include the user info from the token\n accessToken: token?.accessToken, // Add the access token to session for client use\n refreshToken: token?.refreshToken, // Add refresh token to session for future use\n accessTokenExpires: token?.accessTokenExpires && token?.accessTokenExpires, // Store the expiry time\n };\n return session;\n\n },\n },\n pages: {\n signIn: \"/auth/login\",\n },\n secret: process.env.NEXTAUTH_SECRET,\n}\n\nexport default authProviders"]}
|
|
1
|
+
{"version":3,"file":"authProviders.js","sourceRoot":"./","sources":["nextAuth/authProviders.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,iCAAiC,CAAC;AAClE,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAY1D,MAAM,aAAa,GAAoB;IACnC,OAAO,EAAE;QACL,QAAQ,EAAE,KAAK;KAClB;IACD,SAAS,EAAE;QACP,cAAc,CAAC;YACX,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,SAAU;YAChC,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAqB;SAClD,CAAC;QACF,mBAAmB,CAAC;YAChB,aAAa;YACb,KAAK,CAAC,SAAS,CAAC,WAAwB,EAAE,GAAQ;gBAC9C,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;gBAE5C,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;gBAEvF,OAAO,CAAC,GAAG,CAAC,WAAW,EAAG,2BAA2B,CAAC,CAAC;gBAEvD,IAAI;oBACA,IAAI,UAAU,EAAE;wBACZ,IAAI,MAAM,GAAG;4BACT,MAAM,EAAE,KAAK;4BACb,GAAG,EAAE,G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qBAAqB;YACrB,gBAAgB;YAChB,IAAI;YACJ,OAAO,CAAC,IAAI,GAAG;gBACX,GAAG,IAAI;gBACP,WAAW,EAAE,KAAK,EAAE,WAAW;gBAC/B,YAAY,EAAE,KAAK,EAAE,YAAY;gBACjC,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,IAAI,KAAK,EAAE,kBAAkB,EAAG,wBAAwB;aACxG,CAAC;YACF,OAAO,OAAO,CAAC;QAEnB,CAAC;KACJ;IACD,KAAK,EAAE;QACH,MAAM,EAAE,aAAa;KACxB;IACD,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe;CACtC,CAAA;AAED,eAAe,aAAa,CAAA","sourcesContent":["import CredentialsProvider from \"next-auth/providers/credentials\";\nimport GoogleProvider from \"next-auth/providers/google\";\nimport { NextRequest } from \"next/server\";\nimport { jwtDecode } from \"jwt-decode\";\nimport { JWT } from \"next-auth/jwt\";\nimport axios from \"axios\";\nimport { signOut } from \"next-auth/react\";\nimport { refreshAccessToken } from \"./refreshAccessToken\";\nimport { NextAuthOptions } from \"next-auth\";\n\ntype Credentials = {\n username: string,\n email: string,\n password: string,\n identifier:string,\n accessToken: string,\n accessCode: string,\n};\n\nconst authProviders: NextAuthOptions = {\n session: {\n strategy: \"jwt\",\n },\n providers: [\n GoogleProvider({\n clientId: process.env.GOOGLE_ID!,\n clientSecret: process.env.GOOGLE_CLIENT_SECRET!\n }),\n CredentialsProvider({\n // @ts-ignore\n async authorize(credentials: Credentials, req: any) {\n const userAgent = req.headers['user-agent'];\n\n const { username, email, password, identifier, accessToken, accessCode } = credentials;\n\n console.log(credentials , '=========================');\n \n try {\n if (accessCode) {\n let config = {\n method: 'get',\n url: `${process.env.API_URL}/api/iam/google/authenticate?accessCode=${accessCode}`,\n headers: {\n 'User-Agent': userAgent,\n }\n };\n const loginResponse = await axios.request(config);\n if (loginResponse.status == 400) {\n throw new Error(loginResponse.data.message);\n }\n if (loginResponse.status == 401) {\n throw new Error(loginResponse.data.message);\n }\n\n let base64decoded = jwtDecode(loginResponse.data.data.accessToken);\n // let accessTokenExpires = base64decoded.exp;\n let accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000;\n\n return {\n accessToken: loginResponse.data.data.accessToken,\n refreshToken: loginResponse.data.data.refreshToken,\n accessTokenExpires: accessTokenExpires,\n ...loginResponse.data.data,\n };\n\n } else {\n if (accessToken) {\n let data = JSON.stringify({\n username: identifier,\n email: identifier.includes('@')? identifier : null,\n password: password\n });\n\n let config = {\n method: 'get',\n url: `${process.env.API_URL}/api/iam/me`,\n headers: {\n 'accept': '*/*',\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${accessToken}`\n }\n };\n\n\n const loginResponse = await axios.request(config);\n\n if (loginResponse.status == 400) {\n throw new Error(loginResponse.data.message);\n }\n if (loginResponse.status == 401) {\n throw new Error(loginResponse.data.message);\n }\n \n let base64decoded = jwtDecode(accessToken);\n // let accessTokenExpires = base64decoded.exp;\n let accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000;\n\n return {\n accessToken: accessToken,\n refreshToken: loginResponse.data.data.refreshToken,\n accessTokenExpires: accessTokenExpires,\n ...loginResponse.data.data,\n };\n\n } else {\n\n let data = JSON.stringify({\n username: identifier,\n email: identifier.includes('@')? identifier : null,\n password: password\n });\n\n let config = {\n method: 'post',\n maxBodyLength: Infinity,\n url: `${process.env.API_URL}/api/iam/authenticate`,\n headers: {\n 'accept': '*/*',\n 'Content-Type': 'application/json',\n 'User-Agent': userAgent,\n },\n data: data\n };\n\n\n const loginResponse = await axios.request(config);\n\n // const authenticateResponse = await fetch(\n // `${process.env.API_URL}/api/iam/authenticate`,\n // {\n // method: \"Post\",\n // headers: {\n // 'accept': '*/*', \n // \"Content-Type\": \"application/json\"\n // },\n // body: JSON.stringify({\n // username: email,\n // email: email,\n // password: password\n // })\n // }\n // );\n\n // const loginResponse = await authenticateResponse.json();\n\n // const response = await fetch(\n // `${process.env.API_URL}/api/iam/me`,\n // {\n // method: \"Get\",\n // headers: {\n // \"Content-Type\": \"application/json\",\n // \"Authorization\": `Bearer ${loginResponse.data.accessToken}`,\n // },\n // }\n // );\n\n // const responseData = await response.json();\n\n if (loginResponse.status == 400) {\n throw new Error(loginResponse.data.message);\n }\n if (loginResponse.status == 401) {\n throw new Error(loginResponse.data.data.message);\n }\n let base64decoded = jwtDecode(loginResponse.data.data.accessToken);\n // let accessTokenExpires = base64decoded.exp;\n let accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000;\n const returnResponse = {\n accessToken: loginResponse.data.data.accessToken,\n refreshToken: loginResponse.data.data.refreshToken,\n accessTokenExpires: accessTokenExpires,\n ...loginResponse.data.data,\n }\n return returnResponse;\n }\n }\n } catch (error: any) {\n throw new Error(error?.response?.data?.message);\n }\n },\n }),\n ],\n callbacks: {\n // @ts-ignore\n jwt: async ({ token, user }) => {\n // console.log(\"JWT callback called\");\n const bufferTime = 60000;\n if (Date.now() >= (token.accessTokenExpires as number - bufferTime)) {\n // Call the refresh token function\n return await refreshAccessToken(token);\n }\n\n // If there is no user (first time login or session), we return the user data\n if (user) {\n // const base64decoded = jwtDecode(user.accessToken);\n // Convert from seconds to milliseconds\n // const accessTokenExpires = base64decoded.exp && base64decoded.exp * 1000; \n // const accessTokenExpires = user.accessTokenExpires * 1000; \n return {\n ...token,\n accessToken: user.accessToken,\n refreshToken: user.refreshToken,\n accessTokenExpires: user.accessTokenExpires,\n user: user, // Include the user data here\n };\n }\n\n return token; // If no update needed, just return the existing token\n },\n // @ts-ignore\n session: async ({ session, token }) => {\n // console.log(\"Session callback called\");\n\n const user = token.user || {}; // Default to an empty object if user is undefined or null\n session.error = token.error ? token.error : null;\n // if (token.error) {\n // return null\n // }\n session.user = {\n ...user, // Include the user info from the token\n accessToken: token?.accessToken, // Add the access token to session for client use\n refreshToken: token?.refreshToken, // Add refresh token to session for future use\n accessTokenExpires: token?.accessTokenExpires && token?.accessTokenExpires, // Store the expiry time\n };\n return session;\n\n },\n },\n pages: {\n signIn: \"/auth/login\",\n },\n secret: process.env.NEXTAUTH_SECRET,\n}\n\nexport default authProviders"]}
|