@webiny/app-admin 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2
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/base/Admin.d.ts +2 -4
- package/base/Admin.js +26 -13
- package/base/Admin.js.map +1 -1
- package/base/Base/DefaultFieldRenderers.js +4 -0
- package/base/Base/DefaultFieldRenderers.js.map +1 -1
- package/base/Base/FieldRenderers/AutoCompleteRenderer.js +1 -0
- package/base/Base/FieldRenderers/AutoCompleteRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/BirthdayInputRenderer.d.ts +21 -0
- package/base/Base/FieldRenderers/BirthdayInputRenderer.js +39 -0
- package/base/Base/FieldRenderers/BirthdayInputRenderer.js.map +1 -0
- package/base/Base/FieldRenderers/BirthdayInputRenderer.test.d.ts +1 -0
- package/base/Base/FieldRenderers/BirthdayInputRenderer.test.js +123 -0
- package/base/Base/FieldRenderers/BirthdayInputRenderer.test.js.map +1 -0
- package/base/Base/FieldRenderers/HorizontalTabsRenderer.d.ts +2 -2
- package/base/Base/FieldRenderers/InputRenderer.js +1 -0
- package/base/Base/FieldRenderers/InputRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.d.ts +2 -2
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.js +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.d.ts +10 -4
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js +13 -5
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js +8 -26
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.d.ts +2 -2
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/{TemplatePicker.d.ts → TemplatePicker/AddTemplateButton.d.ts} +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/AddTemplateButton.js +24 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/AddTemplateButton.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/SelectableTemplate.d.ts +13 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/SelectableTemplate.js +21 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/SelectableTemplate.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateCard.d.ts +3 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateCard.js +35 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateCard.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGallery.d.ts +8 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGallery.js +22 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGallery.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGalleryToolbar.d.ts +10 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGalleryToolbar.js +52 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGalleryToolbar.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateIcon.d.ts +8 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateIcon.js +16 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateIcon.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.d.ts +10 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.js +22 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.d.ts +3 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.js +35 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/index.d.ts +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/index.js +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/types.d.ts +6 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/types.js +0 -0
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.d.ts +8 -3
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js +25 -17
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.test.d.ts +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.test.js +106 -0
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.test.js.map +1 -0
- package/base/Base/FieldRenderers/SelectRenderer.js +1 -0
- package/base/Base/FieldRenderers/SelectRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/VerticalTabsRenderer.d.ts +2 -2
- package/base/Base/Menus.js +4 -4
- package/base/Base/Menus.js.map +1 -1
- package/base/Base.js +2 -1
- package/base/Base.js.map +1 -1
- package/base/createRootContainer.js +10 -5
- package/base/createRootContainer.js.map +1 -1
- package/base/resolveApiUrl.d.ts +13 -0
- package/base/resolveApiUrl.js +26 -0
- package/base/resolveApiUrl.js.map +1 -0
- package/base/ui/AssumedPermissionsSelector.d.ts +47 -0
- package/base/ui/AssumedPermissionsSelector.js +7 -0
- package/base/ui/AssumedPermissionsSelector.js.map +1 -0
- package/base/ui/DebuggerIndicator.d.ts +23 -0
- package/base/ui/DebuggerIndicator.js +5 -0
- package/base/ui/DebuggerIndicator.js.map +1 -0
- package/components/DeveloperMode/DeveloperMode.d.ts +1 -3
- package/components/DeveloperMode/DeveloperMode.js.map +1 -1
- package/components/Filters/Filters.js +7 -1
- package/components/Filters/Filters.js.map +1 -1
- package/components/IconPicker/IconPickerComponent.d.ts +2 -2
- package/components/IconPicker/plugins/customPlugin.js +4 -19
- package/components/IconPicker/plugins/customPlugin.js.map +1 -1
- package/components/ListView/ListViewBulkActions.d.ts +2 -2
- package/components/ListView/ListViewContent.d.ts +2 -2
- package/components/ListView/ListViewFilters.d.ts +2 -2
- package/components/ListView/index.d.ts +6 -6
- package/components/Permissions/Permissions.js +2 -1
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/Permissions/index.d.ts +1 -0
- package/components/Permissions/index.js +1 -0
- package/components/Permissions/mergeByName.d.ts +11 -0
- package/components/Permissions/mergeByName.js +33 -0
- package/components/Permissions/mergeByName.js.map +1 -0
- package/components/RolesMultiAutocomplete/index.d.ts +5 -1
- package/components/RolesMultiAutocomplete/index.js +18 -19
- package/components/RolesMultiAutocomplete/index.js.map +1 -1
- package/components/SplitView/SplitView.d.ts +2 -2
- package/components/SplitView/SplitView.js +8 -8
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/Table/components/Table/TableInner.d.ts +2 -2
- package/components/TeamAutocomplete/index.d.ts +5 -1
- package/components/TeamAutocomplete/index.js +13 -14
- package/components/TeamAutocomplete/index.js.map +1 -1
- package/components/TeamsMultiAutocomplete/index.d.ts +5 -1
- package/components/TeamsMultiAutocomplete/index.js +18 -19
- package/components/TeamsMultiAutocomplete/index.js.map +1 -1
- package/components/index.d.ts +0 -1
- package/components/index.js +0 -1
- package/config/AdminConfig/Breadcrumbs.d.ts +42 -0
- package/config/AdminConfig/Breadcrumbs.js +24 -0
- package/config/AdminConfig/Breadcrumbs.js.map +1 -0
- package/config/AdminConfig/SecurityPermissions.js +2 -1
- package/config/AdminConfig/SecurityPermissions.js.map +1 -1
- package/config/AdminConfig/Widget.d.ts +9 -1
- package/config/AdminConfig/Widget.js +6 -2
- package/config/AdminConfig/Widget.js.map +1 -1
- package/config/AdminConfig.d.ts +3 -0
- package/config/AdminConfig.js +3 -0
- package/config/AdminConfig.js.map +1 -1
- package/errors/ErrorOverlayNetworkErrorHandler.js +4 -4
- package/errors/ErrorOverlayNetworkErrorHandler.js.map +1 -1
- package/features/accessManagement/permissions/feature.d.ts +1 -1
- package/features/accessManagement/types.d.ts +3 -3
- package/features/adminAssistant/AdminAssistantGateway.d.ts +30 -0
- package/features/adminAssistant/AdminAssistantGateway.js +41 -0
- package/features/adminAssistant/AdminAssistantGateway.js.map +1 -0
- package/features/adminAssistant/AdminAssistantPresenter.d.ts +32 -0
- package/features/adminAssistant/AdminAssistantPresenter.js +220 -0
- package/features/adminAssistant/AdminAssistantPresenter.js.map +1 -0
- package/features/adminAssistant/abstractions.d.ts +124 -0
- package/features/adminAssistant/abstractions.js +6 -0
- package/features/adminAssistant/abstractions.js.map +1 -0
- package/features/adminAssistant/feature.d.ts +3 -0
- package/features/adminAssistant/feature.js +19 -0
- package/features/adminAssistant/feature.js.map +1 -0
- package/features/adminAssistant/index.d.ts +6 -0
- package/features/adminAssistant/index.js +3 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserGateway.d.ts +11 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserGateway.js +44 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserGateway.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserUseCase.d.ts +10 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserUseCase.js +19 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserUseCase.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserGateway.d.ts +16 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserGateway.js +5 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserGateway.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserUseCase.d.ts +10 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js +5 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/index.d.ts +6 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/index.js +2 -0
- package/features/adminUsers/account/getCurrentUser/feature.d.ts +3 -0
- package/features/adminUsers/account/getCurrentUser/feature.js +19 -0
- package/features/adminUsers/account/getCurrentUser/feature.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/index.d.ts +1 -0
- package/features/adminUsers/account/getCurrentUser/index.js +1 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserGateway.d.ts +11 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserGateway.js +48 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserGateway.js.map +1 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserUseCase.d.ts +10 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserUseCase.js +19 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserUseCase.js.map +1 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.d.ts +26 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js +5 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js.map +1 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.d.ts +13 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js +5 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js.map +1 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/index.d.ts +8 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/index.js +2 -0
- package/features/adminUsers/account/updateCurrentUser/feature.d.ts +3 -0
- package/features/adminUsers/account/updateCurrentUser/feature.js +19 -0
- package/features/adminUsers/account/updateCurrentUser/feature.js.map +1 -0
- package/features/adminUsers/account/updateCurrentUser/index.d.ts +1 -0
- package/features/adminUsers/account/updateCurrentUser/index.js +1 -0
- package/features/adminUsers/passwordPolicy/RulesPasswordPolicy.d.ts +6 -0
- package/features/adminUsers/passwordPolicy/RulesPasswordPolicy.js +22 -0
- package/features/adminUsers/passwordPolicy/RulesPasswordPolicy.js.map +1 -0
- package/features/adminUsers/passwordPolicy/abstractions.d.ts +20 -0
- package/features/adminUsers/passwordPolicy/abstractions.js +5 -0
- package/features/adminUsers/passwordPolicy/abstractions.js.map +1 -0
- package/features/adminUsers/passwordPolicy/feature.d.ts +8 -0
- package/features/adminUsers/passwordPolicy/feature.js +18 -0
- package/features/adminUsers/passwordPolicy/feature.js.map +1 -0
- package/features/adminUsers/passwordPolicy/index.d.ts +3 -0
- package/features/adminUsers/passwordPolicy/index.js +3 -0
- package/features/adminUsers/passwordPolicy/readPasswordPolicyRules.d.ts +10 -0
- package/features/adminUsers/passwordPolicy/readPasswordPolicyRules.js +11 -0
- package/features/adminUsers/passwordPolicy/readPasswordPolicyRules.js.map +1 -0
- package/features/adminUsers/permissions/abstractions.d.ts +17 -0
- package/features/adminUsers/permissions/abstractions.js +6 -0
- package/features/adminUsers/permissions/abstractions.js.map +1 -0
- package/features/adminUsers/permissions/feature.d.ts +14 -0
- package/features/adminUsers/permissions/feature.js +7 -0
- package/features/adminUsers/permissions/feature.js.map +1 -0
- package/features/adminUsers/permissionsSchema.d.ts +10 -0
- package/features/adminUsers/permissionsSchema.js +18 -0
- package/features/adminUsers/permissionsSchema.js.map +1 -0
- package/features/adminUsers/users/createUser/CreateUserGateway.d.ts +11 -0
- package/features/adminUsers/users/createUser/CreateUserGateway.js +49 -0
- package/features/adminUsers/users/createUser/CreateUserGateway.js.map +1 -0
- package/features/adminUsers/users/createUser/CreateUserUseCase.d.ts +10 -0
- package/features/adminUsers/users/createUser/CreateUserUseCase.js +18 -0
- package/features/adminUsers/users/createUser/CreateUserUseCase.js.map +1 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserGateway.d.ts +21 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserGateway.js +5 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserGateway.js.map +1 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserUseCase.d.ts +14 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserUseCase.js +5 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserUseCase.js.map +1 -0
- package/features/adminUsers/users/createUser/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/createUser/abstractions/index.js +2 -0
- package/features/adminUsers/users/createUser/feature.d.ts +3 -0
- package/features/adminUsers/users/createUser/feature.js +19 -0
- package/features/adminUsers/users/createUser/feature.js.map +1 -0
- package/features/adminUsers/users/createUser/index.d.ts +2 -0
- package/features/adminUsers/users/createUser/index.js +2 -0
- package/features/adminUsers/users/deleteUser/DeleteUserGateway.d.ts +11 -0
- package/features/adminUsers/users/deleteUser/DeleteUserGateway.js +40 -0
- package/features/adminUsers/users/deleteUser/DeleteUserGateway.js.map +1 -0
- package/features/adminUsers/users/deleteUser/DeleteUserUseCase.d.ts +10 -0
- package/features/adminUsers/users/deleteUser/DeleteUserUseCase.js +18 -0
- package/features/adminUsers/users/deleteUser/DeleteUserUseCase.js.map +1 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserGateway.d.ts +11 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserGateway.js +5 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserGateway.js.map +1 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserUseCase.d.ts +11 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserUseCase.js +5 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserUseCase.js.map +1 -0
- package/features/adminUsers/users/deleteUser/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/deleteUser/abstractions/index.js +2 -0
- package/features/adminUsers/users/deleteUser/feature.d.ts +3 -0
- package/features/adminUsers/users/deleteUser/feature.js +19 -0
- package/features/adminUsers/users/deleteUser/feature.js.map +1 -0
- package/features/adminUsers/users/deleteUser/index.d.ts +2 -0
- package/features/adminUsers/users/deleteUser/index.js +2 -0
- package/features/adminUsers/users/getUser/GetUserGateway.d.ts +11 -0
- package/features/adminUsers/users/getUser/GetUserGateway.js +57 -0
- package/features/adminUsers/users/getUser/GetUserGateway.js.map +1 -0
- package/features/adminUsers/users/getUser/GetUserUseCase.d.ts +10 -0
- package/features/adminUsers/users/getUser/GetUserUseCase.js +18 -0
- package/features/adminUsers/users/getUser/GetUserUseCase.js.map +1 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserGateway.d.ts +32 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserGateway.js +5 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserGateway.js.map +1 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserUseCase.d.ts +14 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserUseCase.js +5 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserUseCase.js.map +1 -0
- package/features/adminUsers/users/getUser/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/getUser/abstractions/index.js +2 -0
- package/features/adminUsers/users/getUser/feature.d.ts +3 -0
- package/features/adminUsers/users/getUser/feature.js +19 -0
- package/features/adminUsers/users/getUser/feature.js.map +1 -0
- package/features/adminUsers/users/getUser/index.d.ts +2 -0
- package/features/adminUsers/users/getUser/index.js +2 -0
- package/features/adminUsers/users/listUsers/ListUsersGateway.d.ts +11 -0
- package/features/adminUsers/users/listUsers/ListUsersGateway.js +39 -0
- package/features/adminUsers/users/listUsers/ListUsersGateway.js.map +1 -0
- package/features/adminUsers/users/listUsers/ListUsersUseCase.d.ts +10 -0
- package/features/adminUsers/users/listUsers/ListUsersUseCase.js +18 -0
- package/features/adminUsers/users/listUsers/ListUsersUseCase.js.map +1 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersGateway.d.ts +17 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersGateway.js +5 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersGateway.js.map +1 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersUseCase.d.ts +10 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersUseCase.js +5 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersUseCase.js.map +1 -0
- package/features/adminUsers/users/listUsers/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/listUsers/abstractions/index.js +2 -0
- package/features/adminUsers/users/listUsers/feature.d.ts +3 -0
- package/features/adminUsers/users/listUsers/feature.js +19 -0
- package/features/adminUsers/users/listUsers/feature.js.map +1 -0
- package/features/adminUsers/users/listUsers/index.d.ts +2 -0
- package/features/adminUsers/users/listUsers/index.js +2 -0
- package/features/adminUsers/users/updateUser/UpdateUserGateway.d.ts +11 -0
- package/features/adminUsers/users/updateUser/UpdateUserGateway.js +59 -0
- package/features/adminUsers/users/updateUser/UpdateUserGateway.js.map +1 -0
- package/features/adminUsers/users/updateUser/UpdateUserUseCase.d.ts +10 -0
- package/features/adminUsers/users/updateUser/UpdateUserUseCase.js +18 -0
- package/features/adminUsers/users/updateUser/UpdateUserUseCase.js.map +1 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserGateway.d.ts +33 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserGateway.js +5 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserGateway.js.map +1 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserUseCase.d.ts +15 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserUseCase.js +5 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserUseCase.js.map +1 -0
- package/features/adminUsers/users/updateUser/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/updateUser/abstractions/index.js +2 -0
- package/features/adminUsers/users/updateUser/feature.d.ts +3 -0
- package/features/adminUsers/users/updateUser/feature.js +19 -0
- package/features/adminUsers/users/updateUser/feature.js.map +1 -0
- package/features/adminUsers/users/updateUser/index.d.ts +2 -0
- package/features/adminUsers/users/updateUser/index.js +2 -0
- package/features/assumePermissions/ApiStreamClientDecorator.d.ts +16 -0
- package/features/assumePermissions/ApiStreamClientDecorator.js +29 -0
- package/features/assumePermissions/ApiStreamClientDecorator.js.map +1 -0
- package/features/assumePermissions/AssumePermissionsContext.d.ts +17 -0
- package/features/assumePermissions/AssumePermissionsContext.js +32 -0
- package/features/assumePermissions/AssumePermissionsContext.js.map +1 -0
- package/features/assumePermissions/AssumePermissionsUseCase.d.ts +33 -0
- package/features/assumePermissions/AssumePermissionsUseCase.js +48 -0
- package/features/assumePermissions/AssumePermissionsUseCase.js.map +1 -0
- package/features/assumePermissions/GraphQLClientDecorator.d.ts +16 -0
- package/features/assumePermissions/GraphQLClientDecorator.js +29 -0
- package/features/assumePermissions/GraphQLClientDecorator.js.map +1 -0
- package/features/assumePermissions/ListAssumableTargetsGateway.d.ts +13 -0
- package/features/assumePermissions/ListAssumableTargetsGateway.js +74 -0
- package/features/assumePermissions/ListAssumableTargetsGateway.js.map +1 -0
- package/features/assumePermissions/ListAssumableTargetsUseCase.d.ts +16 -0
- package/features/assumePermissions/ListAssumableTargetsUseCase.js +38 -0
- package/features/assumePermissions/ListAssumableTargetsUseCase.js.map +1 -0
- package/features/assumePermissions/LogInUseCaseDecorator.d.ts +33 -0
- package/features/assumePermissions/LogInUseCaseDecorator.js +36 -0
- package/features/assumePermissions/LogInUseCaseDecorator.js.map +1 -0
- package/features/assumePermissions/LogOutUseCaseDecorator.d.ts +16 -0
- package/features/assumePermissions/LogOutUseCaseDecorator.js +21 -0
- package/features/assumePermissions/LogOutUseCaseDecorator.js.map +1 -0
- package/features/assumePermissions/abstractions.d.ts +78 -0
- package/features/assumePermissions/abstractions.js +8 -0
- package/features/assumePermissions/abstractions.js.map +1 -0
- package/features/assumePermissions/assumePermissionsHeader.d.ts +3 -0
- package/features/assumePermissions/assumePermissionsHeader.js +7 -0
- package/features/assumePermissions/assumePermissionsHeader.js.map +1 -0
- package/features/assumePermissions/feature.d.ts +4 -0
- package/features/assumePermissions/feature.js +32 -0
- package/features/assumePermissions/feature.js.map +1 -0
- package/features/assumePermissions/index.d.ts +4 -0
- package/features/assumePermissions/index.js +2 -0
- package/features/banners/Banners.d.ts +15 -0
- package/features/banners/Banners.js +39 -0
- package/features/banners/Banners.js.map +1 -0
- package/features/banners/abstractions.d.ts +34 -0
- package/features/banners/abstractions.js +5 -0
- package/features/banners/abstractions.js.map +1 -0
- package/features/banners/feature.d.ts +3 -0
- package/features/banners/feature.js +17 -0
- package/features/banners/feature.js.map +1 -0
- package/features/banners/index.d.ts +2 -0
- package/features/banners/index.js +2 -0
- package/features/debugger/DebugSessionsRepository.d.ts +35 -0
- package/features/debugger/DebugSessionsRepository.js +57 -0
- package/features/debugger/DebugSessionsRepository.js.map +1 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.d.ts +17 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.js +21 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.js.map +1 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.test.d.ts +1 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.test.js +112 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.test.js.map +1 -0
- package/features/debugger/abstractions.d.ts +50 -0
- package/features/debugger/abstractions.js +5 -0
- package/features/debugger/abstractions.js.map +1 -0
- package/features/debugger/constants.d.ts +1 -0
- package/features/debugger/constants.js +4 -0
- package/features/debugger/constants.js.map +1 -0
- package/features/debugger/feature.d.ts +3 -0
- package/features/debugger/feature.js +19 -0
- package/features/debugger/feature.js.map +1 -0
- package/features/debugger/index.d.ts +3 -0
- package/features/debugger/index.js +3 -0
- package/features/featureFlags/FeatureFlagsGateway.d.ts +10 -0
- package/features/featureFlags/FeatureFlagsGateway.js +40 -0
- package/features/featureFlags/FeatureFlagsGateway.js.map +1 -0
- package/features/featureFlags/FeatureFlagsService.d.ts +16 -0
- package/features/featureFlags/FeatureFlagsService.js +64 -0
- package/features/featureFlags/FeatureFlagsService.js.map +1 -0
- package/features/featureFlags/abstractions.d.ts +19 -0
- package/features/featureFlags/abstractions.js +6 -0
- package/features/featureFlags/abstractions.js.map +1 -0
- package/features/featureFlags/feature.d.ts +3 -0
- package/features/featureFlags/feature.js +19 -0
- package/features/featureFlags/feature.js.map +1 -0
- package/features/formModel/AccessControlRuleEvaluator.d.ts +12 -0
- package/features/formModel/AccessControlRuleEvaluator.js +30 -0
- package/features/formModel/AccessControlRuleEvaluator.js.map +1 -0
- package/features/formModel/AccessControlRuleEvaluator.test.d.ts +1 -0
- package/features/formModel/AccessControlRuleEvaluator.test.js +219 -0
- package/features/formModel/AccessControlRuleEvaluator.test.js.map +1 -0
- package/features/formModel/ConditionRuleEvaluator.js +34 -4
- package/features/formModel/ConditionRuleEvaluator.js.map +1 -1
- package/features/formModel/Field.d.ts +13 -1
- package/features/formModel/Field.js +25 -5
- package/features/formModel/Field.js.map +1 -1
- package/features/formModel/FieldBuilder.d.ts +1 -0
- package/features/formModel/FieldBuilder.js +4 -0
- package/features/formModel/FieldBuilder.js.map +1 -1
- package/features/formModel/FieldBuilder.test.js +153 -1
- package/features/formModel/FieldBuilder.test.js.map +1 -1
- package/features/formModel/FormErrors.d.ts +2 -2
- package/features/formModel/FormErrors.js +1 -1
- package/features/formModel/FormErrors.js.map +1 -1
- package/features/formModel/FormModel.d.ts +2 -0
- package/features/formModel/FormModel.js +25 -0
- package/features/formModel/FormModel.js.map +1 -1
- package/features/formModel/FormModel.test.js +591 -4
- package/features/formModel/FormModel.test.js.map +1 -1
- package/features/formModel/FormView.d.ts +8 -4
- package/features/formModel/ObjectField.d.ts +11 -1
- package/features/formModel/ObjectField.js +45 -20
- package/features/formModel/ObjectField.js.map +1 -1
- package/features/formModel/PresenterErrors.d.ts +2 -2
- package/features/formModel/Rules.test.js +224 -16
- package/features/formModel/Rules.test.js.map +1 -1
- package/features/formModel/abstractions.d.ts +51 -3
- package/features/formModel/abstractions.js +2 -1
- package/features/formModel/abstractions.js.map +1 -1
- package/features/formModel/createFieldRenderer.js +3 -4
- package/features/formModel/createFieldRenderer.js.map +1 -1
- package/features/formModel/demo/FormModelDemo.d.ts +2 -2
- package/features/formModel/feature.js +2 -0
- package/features/formModel/feature.js.map +1 -1
- package/features/formModel/fieldTypes/DateTimeFieldType.d.ts +67 -4
- package/features/formModel/fieldTypes/DateTimeFieldType.js +88 -22
- package/features/formModel/fieldTypes/DateTimeFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/ObjectFieldType.d.ts +3 -1
- package/features/formModel/fieldTypes/ObjectFieldType.js +23 -1
- package/features/formModel/fieldTypes/ObjectFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/dateLimits.d.ts +37 -0
- package/features/formModel/fieldTypes/dateLimits.js +64 -0
- package/features/formModel/fieldTypes/dateLimits.js.map +1 -0
- package/features/formModel/fieldTypes/dateLimits.test.d.ts +1 -0
- package/features/formModel/fieldTypes/dateLimits.test.js +60 -0
- package/features/formModel/fieldTypes/dateLimits.test.js.map +1 -0
- package/features/formModel/index.d.ts +2 -2
- package/features/formModel/index.js +1 -1
- package/features/formModel/jsonSchema/JsonSchema.d.ts +18 -0
- package/features/formModel/jsonSchema/JsonSchema.js +0 -0
- package/features/formModel/jsonSchema/JsonSchemaFieldOptions.d.ts +4 -0
- package/features/formModel/jsonSchema/JsonSchemaFieldOptions.js +0 -0
- package/features/formModel/jsonSchema/JsonSchemaIssue.d.ts +4 -0
- package/features/formModel/jsonSchema/JsonSchemaIssue.js +0 -0
- package/features/formModel/jsonSchema/JsonSchemaValidationResult.d.ts +5 -0
- package/features/formModel/jsonSchema/JsonSchemaValidationResult.js +0 -0
- package/features/formModel/jsonSchema/JsonSchemaValidator.d.ts +4 -0
- package/features/formModel/jsonSchema/JsonSchemaValidator.js +0 -0
- package/features/formModel/jsonSchema/PlainObject.d.ts +1 -0
- package/features/formModel/jsonSchema/PlainObject.js +0 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.d.ts +5 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.js +154 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.js.map +1 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.test.d.ts +1 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.test.js +643 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.test.js.map +1 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.d.ts +3 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.js +40 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.js.map +1 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.test.d.ts +1 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.test.js +141 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.test.js.map +1 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.d.ts +3 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.js +52 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.js.map +1 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.test.d.ts +1 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.test.js +250 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.test.js.map +1 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.d.ts +3 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.js +31 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.js.map +1 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.test.d.ts +1 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.test.js +123 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.test.js.map +1 -0
- package/features/formModel/jsonSchema/isPlainObject.d.ts +2 -0
- package/features/formModel/jsonSchema/isPlainObject.js +4 -0
- package/features/formModel/jsonSchema/isPlainObject.js.map +1 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.d.ts +3 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.js +30 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.js.map +1 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.test.d.ts +1 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.test.js +207 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.test.js.map +1 -0
- package/features/formModel/jsonSchema/normalizeJsonSchema.d.ts +2 -0
- package/features/formModel/jsonSchema/normalizeJsonSchema.js +10 -0
- package/features/formModel/jsonSchema/normalizeJsonSchema.js.map +1 -0
- package/features/formModel/renderers.d.ts +1 -0
- package/features/formModel/renderers.js +1 -0
- package/features/iconPicker/listCustomIcons/ListCustomIconsGateway.d.ts +11 -0
- package/features/iconPicker/listCustomIcons/ListCustomIconsGateway.js +49 -0
- package/features/iconPicker/listCustomIcons/ListCustomIconsGateway.js.map +1 -0
- package/features/iconPicker/listCustomIcons/abstractions.d.ts +12 -0
- package/features/iconPicker/listCustomIcons/abstractions.js +5 -0
- package/features/iconPicker/listCustomIcons/abstractions.js.map +1 -0
- package/features/iconPicker/listCustomIcons/feature.d.ts +1 -0
- package/features/iconPicker/listCustomIcons/feature.js +11 -0
- package/features/iconPicker/listCustomIcons/feature.js.map +1 -0
- package/features/iconPicker/listCustomIcons/index.d.ts +3 -0
- package/features/iconPicker/listCustomIcons/index.js +2 -0
- package/features/notifications/Notifications.d.ts +1 -0
- package/features/notifications/Notifications.js +3 -0
- package/features/notifications/Notifications.js.map +1 -1
- package/features/notifications/Notifications.test.d.ts +1 -0
- package/features/notifications/Notifications.test.js +106 -0
- package/features/notifications/Notifications.test.js.map +1 -0
- package/features/notifications/NotificationsRenderer.d.ts +3 -2
- package/features/notifications/NotificationsRenderer.js +23 -4
- package/features/notifications/NotificationsRenderer.js.map +1 -1
- package/features/notifications/NotificationsRenderer.test.d.ts +1 -0
- package/features/notifications/NotificationsRenderer.test.js +261 -0
- package/features/notifications/NotificationsRenderer.test.js.map +1 -0
- package/features/notifications/abstractions.d.ts +13 -2
- package/features/notifications/abstractions.js.map +1 -1
- package/features/security/AuthenticationContext/ApiStreamClientDecorator.d.ts +22 -0
- package/features/security/AuthenticationContext/ApiStreamClientDecorator.js +32 -0
- package/features/security/AuthenticationContext/ApiStreamClientDecorator.js.map +1 -0
- package/features/security/AuthenticationContext/feature.js +2 -0
- package/features/security/AuthenticationContext/feature.js.map +1 -1
- package/features/security/LogIn/LogInUseCase.d.ts +0 -1
- package/features/security/LogIn/LogInUseCase.js +2 -5
- package/features/security/LogIn/LogInUseCase.js.map +1 -1
- package/features/security/LogIn/hasAppPermissions.d.ts +2 -0
- package/features/security/LogIn/hasAppPermissions.js +8 -0
- package/features/security/LogIn/hasAppPermissions.js.map +1 -0
- package/features/slugify/DefaultSlugify.d.ts +8 -0
- package/features/slugify/DefaultSlugify.js +20 -0
- package/features/slugify/DefaultSlugify.js.map +1 -0
- package/features/slugify/abstractions.d.ts +12 -0
- package/features/slugify/abstractions.js +5 -0
- package/features/slugify/abstractions.js.map +1 -0
- package/features/slugify/feature.d.ts +1 -0
- package/features/slugify/feature.js +11 -0
- package/features/slugify/feature.js.map +1 -0
- package/features/slugify/index.d.ts +3 -0
- package/features/slugify/index.js +3 -0
- package/features/stringFormatter/DefaultStringFormatter.d.ts +17 -0
- package/features/stringFormatter/DefaultStringFormatter.js +19 -0
- package/features/stringFormatter/DefaultStringFormatter.js.map +1 -0
- package/features/stringFormatter/abstractions.d.ts +11 -0
- package/features/stringFormatter/abstractions.js +5 -0
- package/features/stringFormatter/abstractions.js.map +1 -0
- package/features/stringFormatter/feature.d.ts +3 -0
- package/features/stringFormatter/feature.js +19 -0
- package/features/stringFormatter/feature.js.map +1 -0
- package/features/stringFormatter/index.d.ts +4 -0
- package/features/stringFormatter/index.js +4 -0
- package/features/stringFormatter/useStringFormatter.d.ts +5 -0
- package/features/stringFormatter/useStringFormatter.js +8 -0
- package/features/stringFormatter/useStringFormatter.js.map +1 -0
- package/features/tenancy/ApiStreamClientDecorator.d.ts +16 -0
- package/features/tenancy/ApiStreamClientDecorator.js +30 -0
- package/features/tenancy/ApiStreamClientDecorator.js.map +1 -0
- package/features/tenancy/feature.js +2 -0
- package/features/tenancy/feature.js.map +1 -1
- package/features/wcp/ReactLicense.d.ts +8 -0
- package/features/wcp/ReactLicense.js +24 -0
- package/features/wcp/ReactLicense.js.map +1 -1
- package/features/wcp/WcpGateway.js +7 -0
- package/features/wcp/WcpGateway.js.map +1 -1
- package/features/webinySdk/WebinySdk.d.ts +2 -1
- package/features/webinySdk/WebinySdk.js.map +1 -1
- package/hooks/useHotkeys.js +7 -5
- package/hooks/useHotkeys.js.map +1 -1
- package/hooks/useSnackbar.js.map +1 -1
- package/index.d.ts +30 -3
- package/index.js +31 -13
- package/modules/AccessManagementExtension.js +55 -23
- package/modules/AccessManagementExtension.js.map +1 -1
- package/modules/DebuggerExtension.d.ts +2 -0
- package/modules/DebuggerExtension.js +55 -0
- package/modules/DebuggerExtension.js.map +1 -0
- package/package.json +32 -39
- package/permissions/createPermissions.js.map +1 -1
- package/presentation/accessManagement/SecurityPermissions.js +3 -3
- package/presentation/accessManagement/SecurityPermissions.js.map +1 -1
- package/presentation/accessManagement/apiKeys/ApiKeysPresenter.d.ts +3 -1
- package/presentation/accessManagement/apiKeys/ApiKeysPresenter.js +13 -16
- package/presentation/accessManagement/apiKeys/ApiKeysPresenter.js.map +1 -1
- package/presentation/accessManagement/apiKeys/components/ApiKeysView.d.ts +2 -2
- package/presentation/accessManagement/apiKeys/components/ApiKeysView.js +13 -7
- package/presentation/accessManagement/apiKeys/components/ApiKeysView.js.map +1 -1
- package/presentation/accessManagement/roles/RolesPresenter.d.ts +3 -1
- package/presentation/accessManagement/roles/RolesPresenter.js +11 -14
- package/presentation/accessManagement/roles/RolesPresenter.js.map +1 -1
- package/presentation/accessManagement/roles/components/RolesDataList.d.ts +10 -0
- package/presentation/accessManagement/roles/components/RolesDataList.js +146 -0
- package/presentation/accessManagement/roles/components/RolesDataList.js.map +1 -0
- package/presentation/accessManagement/roles/components/RolesForm.d.ts +13 -0
- package/presentation/accessManagement/roles/components/RolesForm.js +114 -0
- package/presentation/accessManagement/roles/components/RolesForm.js.map +1 -0
- package/presentation/accessManagement/roles/components/RolesView.d.ts +2 -2
- package/presentation/accessManagement/roles/components/RolesView.js +6 -212
- package/presentation/accessManagement/roles/components/RolesView.js.map +1 -1
- package/presentation/accessManagement/roles/rolesAutocomplete/RolesAutocompletePresenter.d.ts +15 -0
- package/presentation/accessManagement/roles/rolesAutocomplete/RolesAutocompletePresenter.js +42 -0
- package/presentation/accessManagement/roles/rolesAutocomplete/RolesAutocompletePresenter.js.map +1 -0
- package/presentation/accessManagement/roles/rolesAutocomplete/abstractions.d.ts +18 -0
- package/presentation/accessManagement/roles/rolesAutocomplete/abstractions.js +5 -0
- package/presentation/accessManagement/roles/rolesAutocomplete/abstractions.js.map +1 -0
- package/presentation/accessManagement/roles/rolesAutocomplete/feature.d.ts +3 -0
- package/presentation/accessManagement/roles/rolesAutocomplete/feature.js +17 -0
- package/presentation/accessManagement/roles/rolesAutocomplete/feature.js.map +1 -0
- package/presentation/accessManagement/roles/rolesAutocomplete/index.d.ts +3 -0
- package/presentation/accessManagement/roles/rolesAutocomplete/index.js +2 -0
- package/presentation/accessManagement/teams/TeamsPresenter.d.ts +3 -1
- package/presentation/accessManagement/teams/TeamsPresenter.js +11 -14
- package/presentation/accessManagement/teams/TeamsPresenter.js.map +1 -1
- package/presentation/accessManagement/teams/components/TeamsDataList.d.ts +10 -0
- package/presentation/accessManagement/teams/components/TeamsDataList.js +146 -0
- package/presentation/accessManagement/teams/components/TeamsDataList.js.map +1 -0
- package/presentation/accessManagement/teams/components/TeamsForm.d.ts +13 -0
- package/presentation/accessManagement/teams/components/TeamsForm.js +96 -0
- package/presentation/accessManagement/teams/components/TeamsForm.js.map +1 -0
- package/presentation/accessManagement/teams/components/TeamsView.d.ts +2 -2
- package/presentation/accessManagement/teams/components/TeamsView.js +6 -194
- package/presentation/accessManagement/teams/components/TeamsView.js.map +1 -1
- package/presentation/accessManagement/teams/teamsAutocomplete/TeamsAutocompletePresenter.d.ts +15 -0
- package/presentation/accessManagement/teams/teamsAutocomplete/TeamsAutocompletePresenter.js +42 -0
- package/presentation/accessManagement/teams/teamsAutocomplete/TeamsAutocompletePresenter.js.map +1 -0
- package/presentation/accessManagement/teams/teamsAutocomplete/abstractions.d.ts +18 -0
- package/presentation/accessManagement/teams/teamsAutocomplete/abstractions.js +5 -0
- package/presentation/accessManagement/teams/teamsAutocomplete/abstractions.js.map +1 -0
- package/presentation/accessManagement/teams/teamsAutocomplete/feature.d.ts +3 -0
- package/presentation/accessManagement/teams/teamsAutocomplete/feature.js +17 -0
- package/presentation/accessManagement/teams/teamsAutocomplete/feature.js.map +1 -0
- package/presentation/accessManagement/teams/teamsAutocomplete/index.d.ts +3 -0
- package/presentation/accessManagement/teams/teamsAutocomplete/index.js +2 -0
- package/presentation/adminUsers/AdminUsers.d.ts +10 -0
- package/presentation/adminUsers/AdminUsers.js +77 -0
- package/presentation/adminUsers/AdminUsers.js.map +1 -0
- package/presentation/adminUsers/SecurityPermission.d.ts +2 -0
- package/presentation/adminUsers/SecurityPermission.js +15 -0
- package/presentation/adminUsers/SecurityPermission.js.map +1 -0
- package/presentation/adminUsers/UserItem.d.ts +10 -0
- package/presentation/adminUsers/UserItem.js +0 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImage.d.ts +3 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImage.js +31 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImage.js.map +1 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImagePreview.d.ts +10 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImagePreview.js +53 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImagePreview.js.map +1 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImageTrigger.d.ts +7 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImageTrigger.js +28 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImageTrigger.js.map +1 -0
- package/presentation/adminUsers/components/AvatarImage/index.d.ts +1 -0
- package/presentation/adminUsers/components/AvatarImage/index.js +1 -0
- package/presentation/adminUsers/routes.d.ts +10 -0
- package/presentation/adminUsers/routes.js +20 -0
- package/presentation/adminUsers/routes.js.map +1 -0
- package/presentation/adminUsers/userMenu/AccountDetails.d.ts +6 -0
- package/presentation/adminUsers/userMenu/AccountDetails.js +20 -0
- package/presentation/adminUsers/userMenu/AccountDetails.js.map +1 -0
- package/presentation/adminUsers/userMenu/useIsDefaultTenant.d.ts +1 -0
- package/presentation/adminUsers/userMenu/useIsDefaultTenant.js +9 -0
- package/presentation/adminUsers/userMenu/useIsDefaultTenant.js.map +1 -0
- package/presentation/adminUsers/views/Account/Account.d.ts +2 -0
- package/presentation/adminUsers/views/Account/Account.js +137 -0
- package/presentation/adminUsers/views/Account/Account.js.map +1 -0
- package/presentation/adminUsers/views/Account/index.d.ts +1 -0
- package/presentation/adminUsers/views/Account/index.js +1 -0
- package/presentation/adminUsers/views/Users/UsersDataList.d.ts +3 -0
- package/presentation/adminUsers/views/Users/UsersDataList.js +180 -0
- package/presentation/adminUsers/views/Users/UsersDataList.js.map +1 -0
- package/presentation/adminUsers/views/Users/UsersForm.d.ts +5 -0
- package/presentation/adminUsers/views/Users/UsersForm.js +175 -0
- package/presentation/adminUsers/views/Users/UsersForm.js.map +1 -0
- package/presentation/adminUsers/views/Users/UsersView.d.ts +2 -0
- package/presentation/adminUsers/views/Users/UsersView.js +15 -0
- package/presentation/adminUsers/views/Users/UsersView.js.map +1 -0
- package/presentation/adminUsers/views/Users/components/DeleteAction.d.ts +7 -0
- package/presentation/adminUsers/views/Users/components/DeleteAction.js +29 -0
- package/presentation/adminUsers/views/Users/components/DeleteAction.js.map +1 -0
- package/presentation/adminUsers/views/Users/hooks/useUserForm.d.ts +27 -0
- package/presentation/adminUsers/views/Users/hooks/useUserForm.js +101 -0
- package/presentation/adminUsers/views/Users/hooks/useUserForm.js.map +1 -0
- package/presentation/adminUsers/views/Users/search.js +21 -0
- package/presentation/adminUsers/views/Users/search.js.map +1 -0
- package/presentation/adminUsers/views/Users/search.svg +20 -0
- package/presentation/adminUsers/views/utils.d.ts +3 -0
- package/presentation/adminUsers/views/utils.js +12 -0
- package/presentation/adminUsers/views/utils.js.map +1 -0
- package/presentation/assumePermissions/AssumePermissionsPresenter.d.ts +36 -0
- package/presentation/assumePermissions/AssumePermissionsPresenter.js +153 -0
- package/presentation/assumePermissions/AssumePermissionsPresenter.js.map +1 -0
- package/presentation/assumePermissions/abstractions.d.ts +30 -0
- package/presentation/assumePermissions/abstractions.js +5 -0
- package/presentation/assumePermissions/abstractions.js.map +1 -0
- package/presentation/assumePermissions/components/AssumePermissionsButton.d.ts +14 -0
- package/presentation/assumePermissions/components/AssumePermissionsButton.js +42 -0
- package/presentation/assumePermissions/components/AssumePermissionsButton.js.map +1 -0
- package/presentation/assumePermissions/components/AssumedPermissionsBanner.d.ts +11 -0
- package/presentation/assumePermissions/components/AssumedPermissionsBanner.js +25 -0
- package/presentation/assumePermissions/components/AssumedPermissionsBanner.js.map +1 -0
- package/presentation/assumePermissions/components/AssumedPermissionsSelector.d.ts +2 -0
- package/presentation/assumePermissions/components/AssumedPermissionsSelector.js +68 -0
- package/presentation/assumePermissions/components/AssumedPermissionsSelector.js.map +1 -0
- package/presentation/assumePermissions/feature.d.ts +3 -0
- package/presentation/assumePermissions/feature.js +17 -0
- package/presentation/assumePermissions/feature.js.map +1 -0
- package/presentation/assumePermissions/index.d.ts +4 -0
- package/presentation/assumePermissions/index.js +4 -0
- package/presentation/banners/BannersPresenter.d.ts +14 -0
- package/presentation/banners/BannersPresenter.js +60 -0
- package/presentation/banners/BannersPresenter.js.map +1 -0
- package/presentation/banners/abstractions.d.ts +24 -0
- package/presentation/banners/abstractions.js +5 -0
- package/presentation/banners/abstractions.js.map +1 -0
- package/presentation/banners/components/Banner.d.ts +10 -0
- package/presentation/banners/components/Banner.js +32 -0
- package/presentation/banners/components/Banner.js.map +1 -0
- package/presentation/banners/components/BannerBar.d.ts +11 -0
- package/presentation/banners/components/BannerBar.js +51 -0
- package/presentation/banners/components/BannerBar.js.map +1 -0
- package/presentation/banners/feature.d.ts +3 -0
- package/presentation/banners/feature.js +17 -0
- package/presentation/banners/feature.js.map +1 -0
- package/presentation/banners/index.d.ts +6 -0
- package/presentation/banners/index.js +4 -0
- package/presentation/banners/useBanner.d.ts +10 -0
- package/presentation/banners/useBanner.js +15 -0
- package/presentation/banners/useBanner.js.map +1 -0
- package/presentation/commandPalette/CommandPalettePresenter.d.ts +5 -0
- package/presentation/commandPalette/CommandPalettePresenter.js +25 -4
- package/presentation/commandPalette/CommandPalettePresenter.js.map +1 -1
- package/presentation/commandPalette/abstractions.d.ts +17 -1
- package/presentation/commandPalette/abstractions.js.map +1 -1
- package/presentation/commandPalette/commands/AskAiCommand.d.ts +25 -0
- package/presentation/commandPalette/commands/AskAiCommand.js +33 -0
- package/presentation/commandPalette/commands/AskAiCommand.js.map +1 -0
- package/presentation/commandPalette/commands/SendMessageCommand.js +1 -1
- package/presentation/commandPalette/commands/SendMessageCommand.js.map +1 -1
- package/presentation/commandPalette/commands/feature.js +2 -0
- package/presentation/commandPalette/commands/feature.js.map +1 -1
- package/presentation/createReactiveComponent.d.ts +1 -0
- package/presentation/createReactiveComponent.js +1 -0
- package/presentation/debugger/DebuggerPresenter.d.ts +14 -0
- package/presentation/debugger/DebuggerPresenter.js +45 -0
- package/presentation/debugger/DebuggerPresenter.js.map +1 -0
- package/presentation/debugger/abstractions.d.ts +17 -0
- package/presentation/debugger/abstractions.js +5 -0
- package/presentation/debugger/abstractions.js.map +1 -0
- package/presentation/debugger/components/DebuggerIndicator.d.ts +2 -0
- package/presentation/debugger/components/DebuggerIndicator.js +45 -0
- package/presentation/debugger/components/DebuggerIndicator.js.map +1 -0
- package/presentation/debugger/components/DebuggerView.d.ts +4 -0
- package/presentation/debugger/components/DebuggerView.js +44 -0
- package/presentation/debugger/components/DebuggerView.js.map +1 -0
- package/presentation/debugger/downloadJson.d.ts +7 -0
- package/presentation/debugger/downloadJson.js +17 -0
- package/presentation/debugger/downloadJson.js.map +1 -0
- package/presentation/debugger/feature.d.ts +3 -0
- package/presentation/debugger/feature.js +17 -0
- package/presentation/debugger/feature.js.map +1 -0
- package/presentation/debugger/routes.d.ts +4 -0
- package/presentation/debugger/routes.js +10 -0
- package/presentation/debugger/routes.js.map +1 -0
- package/presentation/featureFlags/FeatureFlagsProvider.d.ts +7 -0
- package/presentation/featureFlags/FeatureFlagsProvider.js +22 -0
- package/presentation/featureFlags/FeatureFlagsProvider.js.map +1 -0
- package/presentation/featureFlags/useFeatureFlags.d.ts +2 -0
- package/presentation/featureFlags/useFeatureFlags.js +17 -0
- package/presentation/featureFlags/useFeatureFlags.js.map +1 -0
- package/presentation/iconPicker/customIcons/CustomIconsPresenter.d.ts +16 -0
- package/presentation/iconPicker/customIcons/CustomIconsPresenter.js +40 -0
- package/presentation/iconPicker/customIcons/CustomIconsPresenter.js.map +1 -0
- package/presentation/iconPicker/customIcons/abstractions.d.ts +14 -0
- package/presentation/iconPicker/customIcons/abstractions.js +5 -0
- package/presentation/iconPicker/customIcons/abstractions.js.map +1 -0
- package/presentation/iconPicker/customIcons/feature.d.ts +3 -0
- package/presentation/iconPicker/customIcons/feature.js +17 -0
- package/presentation/iconPicker/customIcons/feature.js.map +1 -0
- package/presentation/iconPicker/customIcons/index.d.ts +3 -0
- package/presentation/iconPicker/customIcons/index.js +2 -0
- package/presentation/installation/components/SystemInstaller/SystemInstaller.d.ts +2 -2
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js +9 -7
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleStartUsing.js +0 -3
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleStartUsing.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js +1 -1
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js +7 -5
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js.map +1 -1
- package/presentation/listPresenter/FolderAwareDataSource.d.ts +5 -0
- package/presentation/listPresenter/FolderAwareDataSource.js +4 -3
- package/presentation/listPresenter/FolderAwareDataSource.js.map +1 -1
- package/presentation/listPresenter/QueryMatcher.d.ts +28 -5
- package/presentation/listPresenter/QueryMatcher.js +74 -4
- package/presentation/listPresenter/QueryMatcher.js.map +1 -1
- package/presentation/listPresenter/QueryMatcher.test.d.ts +1 -0
- package/presentation/listPresenter/QueryMatcher.test.js +345 -0
- package/presentation/listPresenter/QueryMatcher.test.js.map +1 -0
- package/presentation/tenancy/TenancyProvider.js +0 -4
- package/presentation/tenancy/TenancyProvider.js.map +1 -1
- package/presentation/trashBin/TrashBinPresenter.js +3 -1
- package/presentation/trashBin/TrashBinPresenter.js.map +1 -1
- package/presentation/trashBin/TrashBinPresenter.test.d.ts +1 -0
- package/presentation/trashBin/TrashBinPresenter.test.js +91 -0
- package/presentation/trashBin/TrashBinPresenter.test.js.map +1 -0
- package/presentation/trashBin/abstractions.d.ts +1 -1
- package/presentation/trashBin/abstractions.js.map +1 -1
- package/presentation/trashBin/components/BulkActions/DeleteItems.d.ts +2 -2
- package/presentation/trashBin/components/BulkActions/DeleteItems.js +5 -1
- package/presentation/trashBin/components/BulkActions/DeleteItems.js.map +1 -1
- package/presentation/trashBin/components/BulkActions/DeleteItems.test.d.ts +1 -0
- package/presentation/trashBin/components/BulkActions/DeleteItems.test.js +100 -0
- package/presentation/trashBin/components/BulkActions/DeleteItems.test.js.map +1 -0
- package/presentation/trashBin/components/BulkActions/RestoreItems.d.ts +2 -2
- package/presentation/trashBin/components/TrashBinOverlay.d.ts +2 -2
- package/presentation/trashBin/hooks/useDeleteTrashBinItem.js +2 -1
- package/presentation/trashBin/hooks/useDeleteTrashBinItem.js.map +1 -1
- package/presentation/trashBin/hooks/useDeleteTrashBinItem.test.d.ts +1 -0
- package/presentation/trashBin/hooks/useDeleteTrashBinItem.test.js +67 -0
- package/presentation/trashBin/hooks/useDeleteTrashBinItem.test.js.map +1 -0
- package/static/svg/search.43fa797c.svg +20 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js +0 -68
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js.map +0 -1
- package/base/Base/Menus/WebinyVersion.d.ts +0 -2
- package/base/Base/Menus/WebinyVersion.js +0 -23
- package/base/Base/Menus/WebinyVersion.js.map +0 -1
- package/base/WebinyVersion.d.ts +0 -2
- package/base/WebinyVersion.js +0 -23
- package/base/WebinyVersion.js.map +0 -1
- package/base/plugins/AddGraphQLQuerySelection.d.ts +0 -8
- package/base/plugins/AddGraphQLQuerySelection.js +0 -19
- package/base/plugins/AddGraphQLQuerySelection.js.map +0 -1
- package/base/providers/ApolloProvider.d.ts +0 -13
- package/base/providers/ApolloProvider.js +0 -10
- package/base/providers/ApolloProvider.js.map +0 -1
- package/components/IconPicker/plugins/graphql.d.ts +0 -20
- package/components/IconPicker/plugins/graphql.js +0 -22
- package/components/IconPicker/plugins/graphql.js.map +0 -1
- package/components/RolesMultiAutocomplete/graphql.d.ts +0 -1
- package/components/RolesMultiAutocomplete/graphql.js +0 -24
- package/components/RolesMultiAutocomplete/graphql.js.map +0 -1
- package/components/TeamAutocomplete/graphql.d.ts +0 -1
- package/components/TeamAutocomplete/graphql.js +0 -19
- package/components/TeamAutocomplete/graphql.js.map +0 -1
- package/components/TeamsMultiAutocomplete/graphql.d.ts +0 -1
- package/components/TeamsMultiAutocomplete/graphql.js +0 -24
- package/components/TeamsMultiAutocomplete/graphql.js.map +0 -1
- package/components/Wcp.d.ts +0 -19
- package/components/Wcp.js +0 -37
- package/components/Wcp.js.map +0 -1
- package/features/apolloClient/abstraction.d.ts +0 -5
- package/features/apolloClient/abstraction.js +0 -5
- package/features/apolloClient/abstraction.js.map +0 -1
- package/features/apolloClient/feature.d.ts +0 -2
- package/features/apolloClient/feature.js +0 -31
- package/features/apolloClient/feature.js.map +0 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.d.ts +0 -8
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js +0 -17
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js.map +0 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.d.ts +0 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js +0 -16
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/notifications/Notifications.js","sources":["../../../src/features/notifications/Notifications.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport {\n Notifications as Abstraction,\n type INotification,\n type INotificationInput,\n type NotificationVariant\n} from \"./abstractions.js\";\n\nclass NotificationsImpl implements Abstraction.Interface {\n private notifications: INotification[] = [];\n private counter = 0;\n\n constructor() {\n makeAutoObservable(this);\n }\n\n notify(input: INotificationInput): void {\n this.push(input, \"default\");\n }\n\n success(input: INotificationInput): void {\n this.push(input, \"success\");\n }\n\n warning(input: INotificationInput): void {\n this.push(input, \"warning\");\n }\n\n getNotifications(): INotification[] {\n return this.notifications;\n }\n\n remove(id: string): void {\n this.notifications = this.notifications.filter(notification => notification.id !== id);\n }\n\n private push(input: INotificationInput, variant: NotificationVariant): void {\n this.counter++;\n this.notifications.push({ id: `notification-${this.counter}`, variant, ...input });\n }\n}\n\nexport const Notifications = Abstraction.createImplementation({\n implementation: NotificationsImpl,\n dependencies: []\n});\n"],"names":["NotificationsImpl","makeAutoObservable","input","id","notification","variant","Notifications","Abstraction"],"mappings":";;AAQA,MAAMA;IAIF,aAAc;aAHN,aAAa,GAAoB,EAAE;aACnC,OAAO,GAAG;QAGdC,mBAAmB,IAAI;IAC3B;IAEA,OAAOC,KAAyB,EAAQ;QACpC,IAAI,CAAC,IAAI,CAACA,OAAO;IACrB;IAEA,QAAQA,KAAyB,EAAQ;QACrC,IAAI,CAAC,IAAI,CAACA,OAAO;IACrB;IAEA,QAAQA,KAAyB,EAAQ;QACrC,IAAI,CAAC,IAAI,CAACA,OAAO;IACrB;IAEA,mBAAoC;QAChC,OAAO,IAAI,CAAC,aAAa;IAC7B;IAEA,OAAOC,EAAU,EAAQ;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAACC,CAAAA,eAAgBA,aAAa,EAAE,KAAKD;IACvF;IAEQ,KAAKD,KAAyB,EAAEG,OAA4B,EAAQ;QACxE,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,EAAE;YAAEA;YAAS,GAAGH,KAAK;QAAC;IACpF;AACJ;AAEO,MAAMI,8BAAgBC,cAAAA,oBAAgC,CAAC;IAC1D,gBAAgBP;IAChB,cAAc,EAAE;AACpB"}
|
|
1
|
+
{"version":3,"file":"features/notifications/Notifications.js","sources":["../../../src/features/notifications/Notifications.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport {\n Notifications as Abstraction,\n type INotification,\n type INotificationInput,\n type NotificationVariant\n} from \"./abstractions.js\";\n\nclass NotificationsImpl implements Abstraction.Interface {\n private notifications: INotification[] = [];\n private counter = 0;\n\n constructor() {\n makeAutoObservable(this);\n }\n\n notify(input: INotificationInput): void {\n this.push(input, \"default\");\n }\n\n success(input: INotificationInput): void {\n this.push(input, \"success\");\n }\n\n warning(input: INotificationInput): void {\n this.push(input, \"warning\");\n }\n\n error(input: INotificationInput): void {\n this.push(input, \"error\");\n }\n\n getNotifications(): INotification[] {\n return this.notifications;\n }\n\n remove(id: string): void {\n this.notifications = this.notifications.filter(notification => notification.id !== id);\n }\n\n private push(input: INotificationInput, variant: NotificationVariant): void {\n this.counter++;\n this.notifications.push({ id: `notification-${this.counter}`, variant, ...input });\n }\n}\n\nexport const Notifications = Abstraction.createImplementation({\n implementation: NotificationsImpl,\n dependencies: []\n});\n"],"names":["NotificationsImpl","makeAutoObservable","input","id","notification","variant","Notifications","Abstraction"],"mappings":";;AAQA,MAAMA;IAIF,aAAc;aAHN,aAAa,GAAoB,EAAE;aACnC,OAAO,GAAG;QAGdC,mBAAmB,IAAI;IAC3B;IAEA,OAAOC,KAAyB,EAAQ;QACpC,IAAI,CAAC,IAAI,CAACA,OAAO;IACrB;IAEA,QAAQA,KAAyB,EAAQ;QACrC,IAAI,CAAC,IAAI,CAACA,OAAO;IACrB;IAEA,QAAQA,KAAyB,EAAQ;QACrC,IAAI,CAAC,IAAI,CAACA,OAAO;IACrB;IAEA,MAAMA,KAAyB,EAAQ;QACnC,IAAI,CAAC,IAAI,CAACA,OAAO;IACrB;IAEA,mBAAoC;QAChC,OAAO,IAAI,CAAC,aAAa;IAC7B;IAEA,OAAOC,EAAU,EAAQ;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAACC,CAAAA,eAAgBA,aAAa,EAAE,KAAKD;IACvF;IAEQ,KAAKD,KAAyB,EAAEG,OAA4B,EAAQ;QACxE,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,EAAE;YAAEA;YAAS,GAAGH,KAAK;QAAC;IACpF;AACJ;AAEO,MAAMI,8BAAgBC,cAAAA,oBAAgC,CAAC;IAC1D,gBAAgBP;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
+
import { Container } from "@webiny/di";
|
|
3
|
+
import { NotificationsFeature } from "./feature.js";
|
|
4
|
+
import { Notifications } from "./abstractions.js";
|
|
5
|
+
const createNotifications = ()=>{
|
|
6
|
+
const container = new Container();
|
|
7
|
+
NotificationsFeature.register(container);
|
|
8
|
+
return container.resolve(Notifications);
|
|
9
|
+
};
|
|
10
|
+
describe("Notifications", ()=>{
|
|
11
|
+
let notifications;
|
|
12
|
+
beforeEach(()=>{
|
|
13
|
+
notifications = createNotifications();
|
|
14
|
+
});
|
|
15
|
+
it("queues a plain notification with exactly its own fields", ()=>{
|
|
16
|
+
notifications.notify({
|
|
17
|
+
title: "Saved",
|
|
18
|
+
description: "All good."
|
|
19
|
+
});
|
|
20
|
+
expect(notifications.getNotifications()).toEqual([
|
|
21
|
+
{
|
|
22
|
+
id: "notification-1",
|
|
23
|
+
variant: "default",
|
|
24
|
+
title: "Saved",
|
|
25
|
+
description: "All good."
|
|
26
|
+
}
|
|
27
|
+
]);
|
|
28
|
+
});
|
|
29
|
+
it("queues success and warning notifications with their variant", ()=>{
|
|
30
|
+
notifications.success({
|
|
31
|
+
title: "Done"
|
|
32
|
+
});
|
|
33
|
+
notifications.warning({
|
|
34
|
+
title: "Careful"
|
|
35
|
+
});
|
|
36
|
+
const queued = notifications.getNotifications();
|
|
37
|
+
expect(queued.map((item)=>item.variant)).toEqual([
|
|
38
|
+
"success",
|
|
39
|
+
"warning"
|
|
40
|
+
]);
|
|
41
|
+
expect(queued.map((item)=>item.id)).toEqual([
|
|
42
|
+
"notification-1",
|
|
43
|
+
"notification-2"
|
|
44
|
+
]);
|
|
45
|
+
});
|
|
46
|
+
it("queues an error notification with the error variant", ()=>{
|
|
47
|
+
notifications.error({
|
|
48
|
+
title: "Failed",
|
|
49
|
+
description: "Try again."
|
|
50
|
+
});
|
|
51
|
+
expect(notifications.getNotifications()).toEqual([
|
|
52
|
+
{
|
|
53
|
+
id: "notification-1",
|
|
54
|
+
variant: "error",
|
|
55
|
+
title: "Failed",
|
|
56
|
+
description: "Try again."
|
|
57
|
+
}
|
|
58
|
+
]);
|
|
59
|
+
});
|
|
60
|
+
it("keeps link, duration, position and dismissible on the queued notification", ()=>{
|
|
61
|
+
notifications.success({
|
|
62
|
+
title: "Requested",
|
|
63
|
+
description: "Spring launch",
|
|
64
|
+
link: {
|
|
65
|
+
label: "Open Content Reviews",
|
|
66
|
+
url: "/cms/content-reviews"
|
|
67
|
+
},
|
|
68
|
+
duration: 8000,
|
|
69
|
+
position: "bottom-right",
|
|
70
|
+
dismissible: true
|
|
71
|
+
});
|
|
72
|
+
expect(notifications.getNotifications()).toEqual([
|
|
73
|
+
{
|
|
74
|
+
id: "notification-1",
|
|
75
|
+
variant: "success",
|
|
76
|
+
title: "Requested",
|
|
77
|
+
description: "Spring launch",
|
|
78
|
+
link: {
|
|
79
|
+
label: "Open Content Reviews",
|
|
80
|
+
url: "/cms/content-reviews"
|
|
81
|
+
},
|
|
82
|
+
duration: 8000,
|
|
83
|
+
position: "bottom-right",
|
|
84
|
+
dismissible: true
|
|
85
|
+
}
|
|
86
|
+
]);
|
|
87
|
+
});
|
|
88
|
+
it("removes a notification by id and leaves the others", ()=>{
|
|
89
|
+
notifications.notify({
|
|
90
|
+
title: "One"
|
|
91
|
+
});
|
|
92
|
+
notifications.error({
|
|
93
|
+
title: "Two"
|
|
94
|
+
});
|
|
95
|
+
notifications.warning({
|
|
96
|
+
title: "Three"
|
|
97
|
+
});
|
|
98
|
+
notifications.remove("notification-2");
|
|
99
|
+
expect(notifications.getNotifications().map((item)=>item.title)).toEqual([
|
|
100
|
+
"One",
|
|
101
|
+
"Three"
|
|
102
|
+
]);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=Notifications.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/notifications/Notifications.test.js","sources":["../../../src/features/notifications/Notifications.test.ts"],"sourcesContent":["import { beforeEach } from \"vitest\";\nimport { describe } from \"vitest\";\nimport { expect } from \"vitest\";\nimport { it } from \"vitest\";\nimport { Container } from \"@webiny/di\";\nimport { NotificationsFeature } from \"./feature.js\";\nimport { Notifications } from \"./abstractions.js\";\n\nconst createNotifications = (): Notifications.Interface => {\n const container = new Container();\n NotificationsFeature.register(container);\n return container.resolve(Notifications);\n};\n\ndescribe(\"Notifications\", () => {\n let notifications: Notifications.Interface;\n\n beforeEach(() => {\n notifications = createNotifications();\n });\n\n it(\"queues a plain notification with exactly its own fields\", () => {\n notifications.notify({ title: \"Saved\", description: \"All good.\" });\n\n expect(notifications.getNotifications()).toEqual([\n { id: \"notification-1\", variant: \"default\", title: \"Saved\", description: \"All good.\" }\n ]);\n });\n\n it(\"queues success and warning notifications with their variant\", () => {\n notifications.success({ title: \"Done\" });\n notifications.warning({ title: \"Careful\" });\n\n const queued = notifications.getNotifications();\n expect(queued.map(item => item.variant)).toEqual([\"success\", \"warning\"]);\n expect(queued.map(item => item.id)).toEqual([\"notification-1\", \"notification-2\"]);\n });\n\n it(\"queues an error notification with the error variant\", () => {\n notifications.error({ title: \"Failed\", description: \"Try again.\" });\n\n expect(notifications.getNotifications()).toEqual([\n { id: \"notification-1\", variant: \"error\", title: \"Failed\", description: \"Try again.\" }\n ]);\n });\n\n it(\"keeps link, duration, position and dismissible on the queued notification\", () => {\n notifications.success({\n title: \"Requested\",\n description: \"Spring launch\",\n link: { label: \"Open Content Reviews\", url: \"/cms/content-reviews\" },\n duration: 8000,\n position: \"bottom-right\",\n dismissible: true\n });\n\n expect(notifications.getNotifications()).toEqual([\n {\n id: \"notification-1\",\n variant: \"success\",\n title: \"Requested\",\n description: \"Spring launch\",\n link: { label: \"Open Content Reviews\", url: \"/cms/content-reviews\" },\n duration: 8000,\n position: \"bottom-right\",\n dismissible: true\n }\n ]);\n });\n\n it(\"removes a notification by id and leaves the others\", () => {\n notifications.notify({ title: \"One\" });\n notifications.error({ title: \"Two\" });\n notifications.warning({ title: \"Three\" });\n\n notifications.remove(\"notification-2\");\n\n expect(notifications.getNotifications().map(item => item.title)).toEqual([\"One\", \"Three\"]);\n });\n});\n"],"names":["createNotifications","container","Container","NotificationsFeature","Notifications","describe","notifications","beforeEach","it","expect","queued","item"],"mappings":";;;;AAQA,MAAMA,sBAAsB;IACxB,MAAMC,YAAY,IAAIC;IACtBC,qBAAqB,QAAQ,CAACF;IAC9B,OAAOA,UAAU,OAAO,CAACG;AAC7B;AAEAC,SAAS,iBAAiB;IACtB,IAAIC;IAEJC,WAAW;QACPD,gBAAgBN;IACpB;IAEAQ,GAAG,2DAA2D;QAC1DF,cAAc,MAAM,CAAC;YAAE,OAAO;YAAS,aAAa;QAAY;QAEhEG,OAAOH,cAAc,gBAAgB,IAAI,OAAO,CAAC;YAC7C;gBAAE,IAAI;gBAAkB,SAAS;gBAAW,OAAO;gBAAS,aAAa;YAAY;SACxF;IACL;IAEAE,GAAG,+DAA+D;QAC9DF,cAAc,OAAO,CAAC;YAAE,OAAO;QAAO;QACtCA,cAAc,OAAO,CAAC;YAAE,OAAO;QAAU;QAEzC,MAAMI,SAASJ,cAAc,gBAAgB;QAC7CG,OAAOC,OAAO,GAAG,CAACC,CAAAA,OAAQA,KAAK,OAAO,GAAG,OAAO,CAAC;YAAC;YAAW;SAAU;QACvEF,OAAOC,OAAO,GAAG,CAACC,CAAAA,OAAQA,KAAK,EAAE,GAAG,OAAO,CAAC;YAAC;YAAkB;SAAiB;IACpF;IAEAH,GAAG,uDAAuD;QACtDF,cAAc,KAAK,CAAC;YAAE,OAAO;YAAU,aAAa;QAAa;QAEjEG,OAAOH,cAAc,gBAAgB,IAAI,OAAO,CAAC;YAC7C;gBAAE,IAAI;gBAAkB,SAAS;gBAAS,OAAO;gBAAU,aAAa;YAAa;SACxF;IACL;IAEAE,GAAG,6EAA6E;QAC5EF,cAAc,OAAO,CAAC;YAClB,OAAO;YACP,aAAa;YACb,MAAM;gBAAE,OAAO;gBAAwB,KAAK;YAAuB;YACnE,UAAU;YACV,UAAU;YACV,aAAa;QACjB;QAEAG,OAAOH,cAAc,gBAAgB,IAAI,OAAO,CAAC;YAC7C;gBACI,IAAI;gBACJ,SAAS;gBACT,OAAO;gBACP,aAAa;gBACb,MAAM;oBAAE,OAAO;oBAAwB,KAAK;gBAAuB;gBACnE,UAAU;gBACV,UAAU;gBACV,aAAa;YACjB;SACH;IACL;IAEAE,GAAG,sDAAsD;QACrDF,cAAc,MAAM,CAAC;YAAE,OAAO;QAAM;QACpCA,cAAc,KAAK,CAAC;YAAE,OAAO;QAAM;QACnCA,cAAc,OAAO,CAAC;YAAE,OAAO;QAAQ;QAEvCA,cAAc,MAAM,CAAC;QAErBG,OAAOH,cAAc,gBAAgB,GAAG,GAAG,CAACK,CAAAA,OAAQA,KAAK,KAAK,GAAG,OAAO,CAAC;YAAC;YAAO;SAAQ;IAC7F;AACJ"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
/**
|
|
2
3
|
* Standalone consumer of the Notifications queue. Drains queued notifications oldest-first
|
|
3
4
|
* and shows each one as a toast, then removes it from the queue. Mounted once, app-wide.
|
|
4
5
|
*/
|
|
5
|
-
export declare const NotificationsRenderer: (() => null) & {
|
|
6
|
-
|
|
6
|
+
export declare const NotificationsRenderer: (() => null) & React.NamedExoticComponent<unknown> & {
|
|
7
|
+
readonly type: () => null;
|
|
7
8
|
};
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
1
|
+
import react, { useEffect } from "react";
|
|
2
2
|
import { observer } from "mobx-react-lite";
|
|
3
|
-
import { useFeature } from "@webiny/app";
|
|
4
|
-
import { useToast } from "@webiny/admin-ui";
|
|
3
|
+
import { SimpleLink, useFeature } from "@webiny/app";
|
|
4
|
+
import { Icon, useToast } from "@webiny/admin-ui";
|
|
5
|
+
import { ReactComponent } from "@webiny/icons/error.svg";
|
|
5
6
|
import { NotificationsFeature } from "./feature.js";
|
|
6
|
-
const
|
|
7
|
+
const getToastParams = (notification)=>{
|
|
7
8
|
const params = {
|
|
8
9
|
title: notification.title,
|
|
9
10
|
description: notification.description
|
|
10
11
|
};
|
|
12
|
+
if (void 0 !== notification.duration) params.duration = notification.duration;
|
|
13
|
+
if (void 0 !== notification.position) params.position = notification.position;
|
|
14
|
+
if (void 0 !== notification.dismissible) params.dismissible = notification.dismissible;
|
|
15
|
+
if (notification.link) params.actions = /*#__PURE__*/ react.createElement(SimpleLink, {
|
|
16
|
+
to: notification.link.url
|
|
17
|
+
}, notification.link.label);
|
|
18
|
+
return params;
|
|
19
|
+
};
|
|
20
|
+
const showNotification = (toast, notification)=>{
|
|
21
|
+
const params = getToastParams(notification);
|
|
11
22
|
switch(notification.variant){
|
|
12
23
|
case "success":
|
|
13
24
|
toast.showSuccessToast(params);
|
|
@@ -15,6 +26,14 @@ const showNotification = (toast, notification)=>{
|
|
|
15
26
|
case "warning":
|
|
16
27
|
toast.showWarningToast(params);
|
|
17
28
|
break;
|
|
29
|
+
case "error":
|
|
30
|
+
params.icon = /*#__PURE__*/ react.createElement(Icon, {
|
|
31
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
32
|
+
label: "",
|
|
33
|
+
className: "fill-destructive"
|
|
34
|
+
});
|
|
35
|
+
toast.showToast(params);
|
|
36
|
+
break;
|
|
18
37
|
default:
|
|
19
38
|
toast.showToast(params);
|
|
20
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/notifications/NotificationsRenderer.js","sources":["../../../src/features/notifications/NotificationsRenderer.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { useFeature } from \"@webiny/app\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { NotificationsFeature } from \"./feature.js\";\nimport type { INotification } from \"./abstractions.js\";\n\ntype Toast = ReturnType<typeof useToast>;\n\nconst
|
|
1
|
+
{"version":3,"file":"features/notifications/NotificationsRenderer.js","sources":["../../../src/features/notifications/NotificationsRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { useEffect } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { SimpleLink } from \"@webiny/app\";\nimport { useFeature } from \"@webiny/app\";\nimport { Icon } from \"@webiny/admin-ui\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport type { ShowToastParams } from \"@webiny/admin-ui\";\nimport { ReactComponent as ErrorIcon } from \"@webiny/icons/error.svg\";\nimport { NotificationsFeature } from \"./feature.js\";\nimport type { INotification } from \"./abstractions.js\";\n\ntype Toast = ReturnType<typeof useToast>;\n\nconst getToastParams = (notification: INotification): ShowToastParams => {\n const params: ShowToastParams = {\n title: notification.title,\n description: notification.description\n };\n\n if (notification.duration !== undefined) {\n params.duration = notification.duration;\n }\n\n if (notification.position !== undefined) {\n params.position = notification.position;\n }\n\n if (notification.dismissible !== undefined) {\n params.dismissible = notification.dismissible;\n }\n\n if (notification.link) {\n params.actions = (\n <SimpleLink to={notification.link.url}>{notification.link.label}</SimpleLink>\n );\n }\n\n return params;\n};\n\nconst showNotification = (toast: Toast, notification: INotification) => {\n const params = getToastParams(notification);\n\n switch (notification.variant) {\n case \"success\":\n toast.showSuccessToast(params);\n break;\n case \"warning\":\n toast.showWarningToast(params);\n break;\n case \"error\":\n params.icon = <Icon icon={<ErrorIcon />} label={\"\"} className={\"fill-destructive\"} />;\n toast.showToast(params);\n break;\n default:\n toast.showToast(params);\n }\n};\n\n/**\n * Standalone consumer of the Notifications queue. Drains queued notifications oldest-first\n * and shows each one as a toast, then removes it from the queue. Mounted once, app-wide.\n */\nexport const NotificationsRenderer = observer(() => {\n const { presenter } = useFeature(NotificationsFeature);\n const toast = useToast();\n\n const ids = presenter.vm.notifications.map(notification => notification.id).join(\"|\");\n\n useEffect(() => {\n presenter.vm.notifications.forEach(notification => {\n showNotification(toast, notification);\n presenter.markShown(notification.id);\n });\n // `ids` captures queue changes; `toast`/`presenter` are stable singletons.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [ids]);\n\n return null;\n});\n"],"names":["getToastParams","notification","params","undefined","SimpleLink","showNotification","toast","Icon","ErrorIcon","NotificationsRenderer","observer","presenter","useFeature","NotificationsFeature","useToast","ids","useEffect"],"mappings":";;;;;;AAcA,MAAMA,iBAAiB,CAACC;IACpB,MAAMC,SAA0B;QAC5B,OAAOD,aAAa,KAAK;QACzB,aAAaA,aAAa,WAAW;IACzC;IAEA,IAAIA,AAA0BE,WAA1BF,aAAa,QAAQ,EACrBC,OAAO,QAAQ,GAAGD,aAAa,QAAQ;IAG3C,IAAIA,AAA0BE,WAA1BF,aAAa,QAAQ,EACrBC,OAAO,QAAQ,GAAGD,aAAa,QAAQ;IAG3C,IAAIA,AAA6BE,WAA7BF,aAAa,WAAW,EACxBC,OAAO,WAAW,GAAGD,aAAa,WAAW;IAGjD,IAAIA,aAAa,IAAI,EACjBC,OAAO,OAAO,GAAG,WAAH,GACV,oBAACE,YAAUA;QAAC,IAAIH,aAAa,IAAI,CAAC,GAAG;OAAGA,aAAa,IAAI,CAAC,KAAK;IAIvE,OAAOC;AACX;AAEA,MAAMG,mBAAmB,CAACC,OAAcL;IACpC,MAAMC,SAASF,eAAeC;IAE9B,OAAQA,aAAa,OAAO;QACxB,KAAK;YACDK,MAAM,gBAAgB,CAACJ;YACvB;QACJ,KAAK;YACDI,MAAM,gBAAgB,CAACJ;YACvB;QACJ,KAAK;YACDA,OAAO,IAAI,GAAG,WAAH,GAAG,oBAACK,MAAIA;gBAAC,oBAAM,oBAACC,gBAASA;gBAAK,OAAO;gBAAI,WAAW;;YAC/DF,MAAM,SAAS,CAACJ;YAChB;QACJ;YACII,MAAM,SAAS,CAACJ;IACxB;AACJ;AAMO,MAAMO,wBAAwBC,SAAS;IAC1C,MAAM,EAAEC,SAAS,EAAE,GAAGC,WAAWC;IACjC,MAAMP,QAAQQ;IAEd,MAAMC,MAAMJ,UAAU,EAAE,CAAC,aAAa,CAAC,GAAG,CAACV,CAAAA,eAAgBA,aAAa,EAAE,EAAE,IAAI,CAAC;IAEjFe,UAAU;QACNL,UAAU,EAAE,CAAC,aAAa,CAAC,OAAO,CAACV,CAAAA;YAC/BI,iBAAiBC,OAAOL;YACxBU,UAAU,SAAS,CAACV,aAAa,EAAE;QACvC;IAGJ,GAAG;QAACc;KAAI;IAER,OAAO;AACX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import react_0 from "react";
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { cleanup, render, screen } from "@testing-library/react";
|
|
4
|
+
import { NotificationsRenderer } from "./NotificationsRenderer.js";
|
|
5
|
+
const mocks = vi.hoisted(()=>({
|
|
6
|
+
toast: {
|
|
7
|
+
showToast: vi.fn(),
|
|
8
|
+
showSuccessToast: vi.fn(),
|
|
9
|
+
showWarningToast: vi.fn()
|
|
10
|
+
},
|
|
11
|
+
presenter: {
|
|
12
|
+
vm: {
|
|
13
|
+
notifications: []
|
|
14
|
+
},
|
|
15
|
+
markShown: vi.fn()
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
18
|
+
vi.mock("@webiny/admin-ui", async ()=>{
|
|
19
|
+
const react = await import("react");
|
|
20
|
+
return {
|
|
21
|
+
useToast: ()=>mocks.toast,
|
|
22
|
+
Icon: (props)=>react.createElement("span", {
|
|
23
|
+
"data-testid": "toast-icon",
|
|
24
|
+
className: props.className
|
|
25
|
+
})
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
vi.mock("@webiny/app", async ()=>{
|
|
29
|
+
const react = await import("react");
|
|
30
|
+
return {
|
|
31
|
+
useFeature: ()=>({
|
|
32
|
+
presenter: mocks.presenter
|
|
33
|
+
}),
|
|
34
|
+
SimpleLink: (props)=>react.createElement("a", {
|
|
35
|
+
href: props.to
|
|
36
|
+
}, props.children)
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
vi.mock("@webiny/icons/error.svg", ()=>({
|
|
40
|
+
ReactComponent: ()=>null
|
|
41
|
+
}));
|
|
42
|
+
vi.mock("./feature.js", ()=>({
|
|
43
|
+
NotificationsFeature: {}
|
|
44
|
+
}));
|
|
45
|
+
const notificationOf = (overrides)=>({
|
|
46
|
+
id: "notification-1",
|
|
47
|
+
variant: "default",
|
|
48
|
+
title: "Title",
|
|
49
|
+
...overrides
|
|
50
|
+
});
|
|
51
|
+
const renderQueue = (notifications)=>{
|
|
52
|
+
mocks.presenter.vm = {
|
|
53
|
+
notifications
|
|
54
|
+
};
|
|
55
|
+
render(/*#__PURE__*/ react_0.createElement(NotificationsRenderer, null));
|
|
56
|
+
};
|
|
57
|
+
describe("NotificationsRenderer", ()=>{
|
|
58
|
+
beforeEach(()=>{
|
|
59
|
+
mocks.toast.showToast.mockReset();
|
|
60
|
+
mocks.toast.showSuccessToast.mockReset();
|
|
61
|
+
mocks.toast.showWarningToast.mockReset();
|
|
62
|
+
mocks.presenter.markShown.mockReset();
|
|
63
|
+
});
|
|
64
|
+
afterEach(()=>{
|
|
65
|
+
cleanup();
|
|
66
|
+
});
|
|
67
|
+
describe("a notification without the new fields keeps today's call", ()=>{
|
|
68
|
+
it("default calls showToast with title and description only", ()=>{
|
|
69
|
+
renderQueue([
|
|
70
|
+
notificationOf({
|
|
71
|
+
description: "Body"
|
|
72
|
+
})
|
|
73
|
+
]);
|
|
74
|
+
expect(mocks.toast.showToast).toHaveBeenCalledTimes(1);
|
|
75
|
+
expect(mocks.toast.showToast.mock.calls[0][0]).toStrictEqual({
|
|
76
|
+
title: "Title",
|
|
77
|
+
description: "Body"
|
|
78
|
+
});
|
|
79
|
+
expect(mocks.toast.showSuccessToast).not.toHaveBeenCalled();
|
|
80
|
+
expect(mocks.toast.showWarningToast).not.toHaveBeenCalled();
|
|
81
|
+
expect(mocks.presenter.markShown).toHaveBeenCalledTimes(1);
|
|
82
|
+
expect(mocks.presenter.markShown).toHaveBeenCalledWith("notification-1");
|
|
83
|
+
});
|
|
84
|
+
it("default without a description keeps the description key undefined", ()=>{
|
|
85
|
+
renderQueue([
|
|
86
|
+
notificationOf({})
|
|
87
|
+
]);
|
|
88
|
+
expect(mocks.toast.showToast.mock.calls[0][0]).toStrictEqual({
|
|
89
|
+
title: "Title",
|
|
90
|
+
description: void 0
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
it("success calls showSuccessToast with title and description only", ()=>{
|
|
94
|
+
renderQueue([
|
|
95
|
+
notificationOf({
|
|
96
|
+
variant: "success",
|
|
97
|
+
description: "Body"
|
|
98
|
+
})
|
|
99
|
+
]);
|
|
100
|
+
expect(mocks.toast.showSuccessToast).toHaveBeenCalledTimes(1);
|
|
101
|
+
expect(mocks.toast.showSuccessToast.mock.calls[0][0]).toStrictEqual({
|
|
102
|
+
title: "Title",
|
|
103
|
+
description: "Body"
|
|
104
|
+
});
|
|
105
|
+
expect(mocks.toast.showToast).not.toHaveBeenCalled();
|
|
106
|
+
expect(mocks.presenter.markShown).toHaveBeenCalledTimes(1);
|
|
107
|
+
});
|
|
108
|
+
it("warning calls showWarningToast with title and description only", ()=>{
|
|
109
|
+
renderQueue([
|
|
110
|
+
notificationOf({
|
|
111
|
+
variant: "warning",
|
|
112
|
+
description: "Body"
|
|
113
|
+
})
|
|
114
|
+
]);
|
|
115
|
+
expect(mocks.toast.showWarningToast).toHaveBeenCalledTimes(1);
|
|
116
|
+
expect(mocks.toast.showWarningToast.mock.calls[0][0]).toStrictEqual({
|
|
117
|
+
title: "Title",
|
|
118
|
+
description: "Body"
|
|
119
|
+
});
|
|
120
|
+
expect(mocks.toast.showToast).not.toHaveBeenCalled();
|
|
121
|
+
expect(mocks.presenter.markShown).toHaveBeenCalledTimes(1);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
describe("a notification with the new fields", ()=>{
|
|
125
|
+
it("passes duration, position and dismissible through", ()=>{
|
|
126
|
+
renderQueue([
|
|
127
|
+
notificationOf({
|
|
128
|
+
variant: "success",
|
|
129
|
+
description: "Body",
|
|
130
|
+
duration: 8000,
|
|
131
|
+
position: "bottom-right",
|
|
132
|
+
dismissible: true
|
|
133
|
+
})
|
|
134
|
+
]);
|
|
135
|
+
expect(mocks.toast.showSuccessToast.mock.calls[0][0]).toStrictEqual({
|
|
136
|
+
title: "Title",
|
|
137
|
+
description: "Body",
|
|
138
|
+
duration: 8000,
|
|
139
|
+
position: "bottom-right",
|
|
140
|
+
dismissible: true
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
it("forwards an explicit dismissible false and a zero duration", ()=>{
|
|
144
|
+
renderQueue([
|
|
145
|
+
notificationOf({
|
|
146
|
+
dismissible: false,
|
|
147
|
+
duration: 0
|
|
148
|
+
})
|
|
149
|
+
]);
|
|
150
|
+
expect(mocks.toast.showToast.mock.calls[0][0]).toStrictEqual({
|
|
151
|
+
title: "Title",
|
|
152
|
+
description: void 0,
|
|
153
|
+
duration: 0,
|
|
154
|
+
dismissible: false
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
it("passes only the fields that are set", ()=>{
|
|
158
|
+
renderQueue([
|
|
159
|
+
notificationOf({
|
|
160
|
+
position: "top-center"
|
|
161
|
+
})
|
|
162
|
+
]);
|
|
163
|
+
expect(mocks.toast.showToast.mock.calls[0][0]).toStrictEqual({
|
|
164
|
+
title: "Title",
|
|
165
|
+
description: void 0,
|
|
166
|
+
position: "top-center"
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
it("renders the link as an in-app link action", ()=>{
|
|
170
|
+
renderQueue([
|
|
171
|
+
notificationOf({
|
|
172
|
+
variant: "success",
|
|
173
|
+
link: {
|
|
174
|
+
label: "Open Content Reviews",
|
|
175
|
+
url: "/cms/content-reviews"
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
]);
|
|
179
|
+
const params = mocks.toast.showSuccessToast.mock.calls[0][0];
|
|
180
|
+
expect(/*#__PURE__*/ react_0.isValidElement(params.actions)).toBe(true);
|
|
181
|
+
render(/*#__PURE__*/ react_0.createElement("div", null, params.actions));
|
|
182
|
+
const link = screen.getByRole("link", {
|
|
183
|
+
name: "Open Content Reviews"
|
|
184
|
+
});
|
|
185
|
+
expect(link.getAttribute("href")).toBe("/cms/content-reviews");
|
|
186
|
+
});
|
|
187
|
+
it("adds no actions without a link", ()=>{
|
|
188
|
+
renderQueue([
|
|
189
|
+
notificationOf({
|
|
190
|
+
duration: 8000
|
|
191
|
+
})
|
|
192
|
+
]);
|
|
193
|
+
expect(mocks.toast.showToast.mock.calls[0][0]).not.toHaveProperty("actions");
|
|
194
|
+
});
|
|
195
|
+
it("error calls showToast with the destructive error icon and the other fields", ()=>{
|
|
196
|
+
renderQueue([
|
|
197
|
+
notificationOf({
|
|
198
|
+
variant: "error",
|
|
199
|
+
description: "Body",
|
|
200
|
+
duration: 8000,
|
|
201
|
+
position: "bottom-right",
|
|
202
|
+
dismissible: true
|
|
203
|
+
})
|
|
204
|
+
]);
|
|
205
|
+
expect(mocks.toast.showToast).toHaveBeenCalledTimes(1);
|
|
206
|
+
expect(mocks.toast.showSuccessToast).not.toHaveBeenCalled();
|
|
207
|
+
expect(mocks.toast.showWarningToast).not.toHaveBeenCalled();
|
|
208
|
+
const params = mocks.toast.showToast.mock.calls[0][0];
|
|
209
|
+
expect(params.title).toBe("Title");
|
|
210
|
+
expect(params.description).toBe("Body");
|
|
211
|
+
expect(params.duration).toBe(8000);
|
|
212
|
+
expect(params.position).toBe("bottom-right");
|
|
213
|
+
expect(params.dismissible).toBe(true);
|
|
214
|
+
expect(/*#__PURE__*/ react_0.isValidElement(params.icon)).toBe(true);
|
|
215
|
+
expect(params.icon.props.className).toBe("fill-destructive");
|
|
216
|
+
});
|
|
217
|
+
it("error without the new fields still shows through showToast with the icon", ()=>{
|
|
218
|
+
renderQueue([
|
|
219
|
+
notificationOf({
|
|
220
|
+
variant: "error"
|
|
221
|
+
})
|
|
222
|
+
]);
|
|
223
|
+
const params = mocks.toast.showToast.mock.calls[0][0];
|
|
224
|
+
expect(Object.keys(params).sort()).toEqual([
|
|
225
|
+
"description",
|
|
226
|
+
"icon",
|
|
227
|
+
"title"
|
|
228
|
+
]);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
it("shows every queued notification oldest first and marks each shown once", ()=>{
|
|
232
|
+
renderQueue([
|
|
233
|
+
notificationOf({
|
|
234
|
+
id: "notification-1",
|
|
235
|
+
title: "One"
|
|
236
|
+
}),
|
|
237
|
+
notificationOf({
|
|
238
|
+
id: "notification-2",
|
|
239
|
+
variant: "warning",
|
|
240
|
+
title: "Two"
|
|
241
|
+
}),
|
|
242
|
+
notificationOf({
|
|
243
|
+
id: "notification-3",
|
|
244
|
+
variant: "error",
|
|
245
|
+
title: "Three"
|
|
246
|
+
})
|
|
247
|
+
]);
|
|
248
|
+
expect(mocks.toast.showToast.mock.calls.map((call)=>call[0].title)).toEqual([
|
|
249
|
+
"One",
|
|
250
|
+
"Three"
|
|
251
|
+
]);
|
|
252
|
+
expect(mocks.toast.showWarningToast.mock.calls[0][0].title).toBe("Two");
|
|
253
|
+
expect(mocks.presenter.markShown.mock.calls.map((call)=>call[0])).toEqual([
|
|
254
|
+
"notification-1",
|
|
255
|
+
"notification-2",
|
|
256
|
+
"notification-3"
|
|
257
|
+
]);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
//# sourceMappingURL=NotificationsRenderer.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/notifications/NotificationsRenderer.test.js","sources":["../../../src/features/notifications/NotificationsRenderer.test.tsx"],"sourcesContent":["import React from \"react\";\nimport { afterEach } from \"vitest\";\nimport { beforeEach } from \"vitest\";\nimport { describe } from \"vitest\";\nimport { expect } from \"vitest\";\nimport { it } from \"vitest\";\nimport { vi } from \"vitest\";\nimport { cleanup } from \"@testing-library/react\";\nimport { render } from \"@testing-library/react\";\nimport { screen } from \"@testing-library/react\";\nimport { NotificationsRenderer } from \"./NotificationsRenderer.js\";\nimport type { INotification } from \"./abstractions.js\";\n\ninterface RendererMocks {\n toast: {\n showToast: ReturnType<typeof vi.fn>;\n showSuccessToast: ReturnType<typeof vi.fn>;\n showWarningToast: ReturnType<typeof vi.fn>;\n };\n presenter: {\n vm: { notifications: INotification[] };\n markShown: ReturnType<typeof vi.fn>;\n };\n}\n\nconst mocks = vi.hoisted((): RendererMocks => {\n return {\n toast: {\n showToast: vi.fn(),\n showSuccessToast: vi.fn(),\n showWarningToast: vi.fn()\n },\n presenter: {\n vm: { notifications: [] },\n markShown: vi.fn()\n }\n };\n});\n\nvi.mock(\"@webiny/admin-ui\", async () => {\n const react = await import(\"react\");\n return {\n useToast: () => mocks.toast,\n Icon: (props: { className?: string }) => {\n return react.createElement(\"span\", {\n \"data-testid\": \"toast-icon\",\n className: props.className\n });\n }\n };\n});\n\nvi.mock(\"@webiny/app\", async () => {\n const react = await import(\"react\");\n return {\n useFeature: () => ({ presenter: mocks.presenter }),\n SimpleLink: (props: { to: string; children?: React.ReactNode }) => {\n return react.createElement(\"a\", { href: props.to }, props.children);\n }\n };\n});\n\nvi.mock(\"@webiny/icons/error.svg\", () => {\n return { ReactComponent: () => null };\n});\n\nvi.mock(\"./feature.js\", () => {\n return { NotificationsFeature: {} };\n});\n\nconst notificationOf = (overrides: Partial<INotification>): INotification => {\n return { id: \"notification-1\", variant: \"default\", title: \"Title\", ...overrides };\n};\n\nconst renderQueue = (notifications: INotification[]): void => {\n mocks.presenter.vm = { notifications };\n render(<NotificationsRenderer />);\n};\n\ndescribe(\"NotificationsRenderer\", () => {\n beforeEach(() => {\n mocks.toast.showToast.mockReset();\n mocks.toast.showSuccessToast.mockReset();\n mocks.toast.showWarningToast.mockReset();\n mocks.presenter.markShown.mockReset();\n });\n\n afterEach(() => {\n cleanup();\n });\n\n describe(\"a notification without the new fields keeps today's call\", () => {\n it(\"default calls showToast with title and description only\", () => {\n renderQueue([notificationOf({ description: \"Body\" })]);\n\n expect(mocks.toast.showToast).toHaveBeenCalledTimes(1);\n expect(mocks.toast.showToast.mock.calls[0][0]).toStrictEqual({\n title: \"Title\",\n description: \"Body\"\n });\n expect(mocks.toast.showSuccessToast).not.toHaveBeenCalled();\n expect(mocks.toast.showWarningToast).not.toHaveBeenCalled();\n expect(mocks.presenter.markShown).toHaveBeenCalledTimes(1);\n expect(mocks.presenter.markShown).toHaveBeenCalledWith(\"notification-1\");\n });\n\n it(\"default without a description keeps the description key undefined\", () => {\n renderQueue([notificationOf({})]);\n\n expect(mocks.toast.showToast.mock.calls[0][0]).toStrictEqual({\n title: \"Title\",\n description: undefined\n });\n });\n\n it(\"success calls showSuccessToast with title and description only\", () => {\n renderQueue([notificationOf({ variant: \"success\", description: \"Body\" })]);\n\n expect(mocks.toast.showSuccessToast).toHaveBeenCalledTimes(1);\n expect(mocks.toast.showSuccessToast.mock.calls[0][0]).toStrictEqual({\n title: \"Title\",\n description: \"Body\"\n });\n expect(mocks.toast.showToast).not.toHaveBeenCalled();\n expect(mocks.presenter.markShown).toHaveBeenCalledTimes(1);\n });\n\n it(\"warning calls showWarningToast with title and description only\", () => {\n renderQueue([notificationOf({ variant: \"warning\", description: \"Body\" })]);\n\n expect(mocks.toast.showWarningToast).toHaveBeenCalledTimes(1);\n expect(mocks.toast.showWarningToast.mock.calls[0][0]).toStrictEqual({\n title: \"Title\",\n description: \"Body\"\n });\n expect(mocks.toast.showToast).not.toHaveBeenCalled();\n expect(mocks.presenter.markShown).toHaveBeenCalledTimes(1);\n });\n });\n\n describe(\"a notification with the new fields\", () => {\n it(\"passes duration, position and dismissible through\", () => {\n renderQueue([\n notificationOf({\n variant: \"success\",\n description: \"Body\",\n duration: 8000,\n position: \"bottom-right\",\n dismissible: true\n })\n ]);\n\n expect(mocks.toast.showSuccessToast.mock.calls[0][0]).toStrictEqual({\n title: \"Title\",\n description: \"Body\",\n duration: 8000,\n position: \"bottom-right\",\n dismissible: true\n });\n });\n\n it(\"forwards an explicit dismissible false and a zero duration\", () => {\n renderQueue([notificationOf({ dismissible: false, duration: 0 })]);\n\n expect(mocks.toast.showToast.mock.calls[0][0]).toStrictEqual({\n title: \"Title\",\n description: undefined,\n duration: 0,\n dismissible: false\n });\n });\n\n it(\"passes only the fields that are set\", () => {\n renderQueue([notificationOf({ position: \"top-center\" })]);\n\n expect(mocks.toast.showToast.mock.calls[0][0]).toStrictEqual({\n title: \"Title\",\n description: undefined,\n position: \"top-center\"\n });\n });\n\n it(\"renders the link as an in-app link action\", () => {\n renderQueue([\n notificationOf({\n variant: \"success\",\n link: { label: \"Open Content Reviews\", url: \"/cms/content-reviews\" }\n })\n ]);\n\n const params = mocks.toast.showSuccessToast.mock.calls[0][0];\n expect(React.isValidElement(params.actions)).toBe(true);\n\n render(<div>{params.actions}</div>);\n\n const link = screen.getByRole(\"link\", { name: \"Open Content Reviews\" });\n expect(link.getAttribute(\"href\")).toBe(\"/cms/content-reviews\");\n });\n\n it(\"adds no actions without a link\", () => {\n renderQueue([notificationOf({ duration: 8000 })]);\n\n expect(mocks.toast.showToast.mock.calls[0][0]).not.toHaveProperty(\"actions\");\n });\n\n it(\"error calls showToast with the destructive error icon and the other fields\", () => {\n renderQueue([\n notificationOf({\n variant: \"error\",\n description: \"Body\",\n duration: 8000,\n position: \"bottom-right\",\n dismissible: true\n })\n ]);\n\n expect(mocks.toast.showToast).toHaveBeenCalledTimes(1);\n expect(mocks.toast.showSuccessToast).not.toHaveBeenCalled();\n expect(mocks.toast.showWarningToast).not.toHaveBeenCalled();\n\n const params = mocks.toast.showToast.mock.calls[0][0];\n expect(params.title).toBe(\"Title\");\n expect(params.description).toBe(\"Body\");\n expect(params.duration).toBe(8000);\n expect(params.position).toBe(\"bottom-right\");\n expect(params.dismissible).toBe(true);\n expect(React.isValidElement(params.icon)).toBe(true);\n expect(params.icon.props.className).toBe(\"fill-destructive\");\n });\n\n it(\"error without the new fields still shows through showToast with the icon\", () => {\n renderQueue([notificationOf({ variant: \"error\" })]);\n\n const params = mocks.toast.showToast.mock.calls[0][0];\n expect(Object.keys(params).sort()).toEqual([\"description\", \"icon\", \"title\"]);\n });\n });\n\n it(\"shows every queued notification oldest first and marks each shown once\", () => {\n renderQueue([\n notificationOf({ id: \"notification-1\", title: \"One\" }),\n notificationOf({ id: \"notification-2\", variant: \"warning\", title: \"Two\" }),\n notificationOf({ id: \"notification-3\", variant: \"error\", title: \"Three\" })\n ]);\n\n expect(mocks.toast.showToast.mock.calls.map(call => call[0].title)).toEqual([\n \"One\",\n \"Three\"\n ]);\n expect(mocks.toast.showWarningToast.mock.calls[0][0].title).toBe(\"Two\");\n expect(mocks.presenter.markShown.mock.calls.map(call => call[0])).toEqual([\n \"notification-1\",\n \"notification-2\",\n \"notification-3\"\n ]);\n });\n});\n"],"names":["mocks","vi","react","props","notificationOf","overrides","renderQueue","notifications","render","NotificationsRenderer","describe","beforeEach","afterEach","cleanup","it","expect","undefined","params","React","link","screen","Object","call"],"mappings":"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"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
export type NotificationVariant = "default" | "success" | "warning";
|
|
1
|
+
export type NotificationVariant = "default" | "success" | "warning" | "error";
|
|
2
|
+
export type NotificationPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
3
|
+
export interface INotificationLink {
|
|
4
|
+
label: string;
|
|
5
|
+
url: string;
|
|
6
|
+
}
|
|
2
7
|
export interface INotificationInput {
|
|
3
8
|
title: string;
|
|
4
9
|
description?: string;
|
|
10
|
+
link?: INotificationLink;
|
|
11
|
+
duration?: number;
|
|
12
|
+
position?: NotificationPosition;
|
|
13
|
+
dismissible?: boolean;
|
|
5
14
|
}
|
|
6
15
|
export interface INotification extends INotificationInput {
|
|
7
16
|
id: string;
|
|
@@ -9,12 +18,14 @@ export interface INotification extends INotificationInput {
|
|
|
9
18
|
}
|
|
10
19
|
/**
|
|
11
20
|
* App-wide notification queue. Any feature can inject this and call `notify()` / `success()` /
|
|
12
|
-
* `warning()` to surface a notification on screen, without depending on React or the
|
|
21
|
+
* `warning()` / `error()` to surface a notification on screen, without depending on React or the
|
|
22
|
+
* toast UI.
|
|
13
23
|
*/
|
|
14
24
|
export interface INotifications {
|
|
15
25
|
notify(notification: INotificationInput): void;
|
|
16
26
|
success(notification: INotificationInput): void;
|
|
17
27
|
warning(notification: INotificationInput): void;
|
|
28
|
+
error(notification: INotificationInput): void;
|
|
18
29
|
getNotifications(): INotification[];
|
|
19
30
|
remove(id: string): void;
|
|
20
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/notifications/abstractions.js","sources":["../../../src/features/notifications/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport type NotificationVariant = \"default\" | \"success\" | \"warning\";\n\nexport interface INotificationInput {\n title: string;\n description?: string;\n}\n\nexport interface INotification extends INotificationInput {\n id: string;\n variant: NotificationVariant;\n}\n\n/**\n * App-wide notification queue. Any feature can inject this and call `notify()` / `success()` /\n * `warning()` to surface a notification on screen, without depending on React or the toast UI.\n */\nexport interface INotifications {\n notify(notification: INotificationInput): void;\n success(notification: INotificationInput): void;\n warning(notification: INotificationInput): void;\n getNotifications(): INotification[];\n remove(id: string): void;\n}\n\nexport const Notifications = createAbstraction<INotifications>(\"Notifications\");\n\nexport namespace Notifications {\n export type Interface = INotifications;\n}\n\nexport interface INotificationsViewModel {\n notifications: INotification[];\n}\n\n/**\n * Presents queued notifications (oldest first) to the UI layer, which renders them in order.\n */\nexport interface INotificationsPresenter {\n readonly vm: INotificationsViewModel;\n markShown(id: string): void;\n}\n\nexport const NotificationsPresenter =\n createAbstraction<INotificationsPresenter>(\"NotificationsPresenter\");\n\nexport namespace NotificationsPresenter {\n export type Interface = INotificationsPresenter;\n}\n"],"names":["Notifications","createAbstraction","NotificationsPresenter"],"mappings":";
|
|
1
|
+
{"version":3,"file":"features/notifications/abstractions.js","sources":["../../../src/features/notifications/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport type NotificationVariant = \"default\" | \"success\" | \"warning\" | \"error\";\n\nexport type NotificationPosition =\n | \"top-left\"\n | \"top-center\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-center\"\n | \"bottom-right\";\n\nexport interface INotificationLink {\n label: string;\n url: string;\n}\n\nexport interface INotificationInput {\n title: string;\n description?: string;\n link?: INotificationLink;\n duration?: number;\n position?: NotificationPosition;\n dismissible?: boolean;\n}\n\nexport interface INotification extends INotificationInput {\n id: string;\n variant: NotificationVariant;\n}\n\n/**\n * App-wide notification queue. Any feature can inject this and call `notify()` / `success()` /\n * `warning()` / `error()` to surface a notification on screen, without depending on React or the\n * toast UI.\n */\nexport interface INotifications {\n notify(notification: INotificationInput): void;\n success(notification: INotificationInput): void;\n warning(notification: INotificationInput): void;\n error(notification: INotificationInput): void;\n getNotifications(): INotification[];\n remove(id: string): void;\n}\n\nexport const Notifications = createAbstraction<INotifications>(\"Notifications\");\n\nexport namespace Notifications {\n export type Interface = INotifications;\n}\n\nexport interface INotificationsViewModel {\n notifications: INotification[];\n}\n\n/**\n * Presents queued notifications (oldest first) to the UI layer, which renders them in order.\n */\nexport interface INotificationsPresenter {\n readonly vm: INotificationsViewModel;\n markShown(id: string): void;\n}\n\nexport const NotificationsPresenter =\n createAbstraction<INotificationsPresenter>(\"NotificationsPresenter\");\n\nexport namespace NotificationsPresenter {\n export type Interface = INotificationsPresenter;\n}\n"],"names":["Notifications","createAbstraction","NotificationsPresenter"],"mappings":";AA6CO,MAAMA,gBAAgBC,kBAAkC;AAkBxD,MAAMC,yBACTD,kBAA2C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ApiStreamClient } from "@webiny/app/features/apiStreamClient/index.js";
|
|
2
|
+
import { InternalIdTokenProvider } from "../../../features/security/AuthenticationContext/abstractions.js";
|
|
3
|
+
export declare const WEBINY_AUTHORIZATION_HEADER = "x-webiny-authorization";
|
|
4
|
+
/**
|
|
5
|
+
* Attaches the admin id token to streaming API requests. Mirrors `GraphQLClientDecorator` — the two
|
|
6
|
+
* clients are separate abstractions, so neither decorator covers the other.
|
|
7
|
+
*
|
|
8
|
+
* Uses `x-webiny-authorization` rather than `Authorization`, because on AWS the streaming route is
|
|
9
|
+
* served by a Lambda Function URL behind CloudFront with Origin Access Control: OAC signs the request
|
|
10
|
+
* with SigV4, which occupies the `Authorization` header, so a bearer token there would not survive to
|
|
11
|
+
* the origin. Both the AWS and the self-hosted identity extractors read this header first.
|
|
12
|
+
*/
|
|
13
|
+
declare class ApiStreamClientWithIdToken implements ApiStreamClient.Interface {
|
|
14
|
+
private idTokenProvider;
|
|
15
|
+
private decoratee;
|
|
16
|
+
constructor(idTokenProvider: InternalIdTokenProvider.Interface, decoratee: ApiStreamClient.Interface);
|
|
17
|
+
execute(params: ApiStreamClient.Request): Promise<ApiStreamClient.Response>;
|
|
18
|
+
}
|
|
19
|
+
export declare const ApiStreamClientDecorator: typeof ApiStreamClientWithIdToken & {
|
|
20
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app/features/apiStreamClient/abstractions").IApiStreamClient>;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ApiStreamClient } from "@webiny/app/features/apiStreamClient/index.js";
|
|
2
|
+
import { InternalIdTokenProvider } from "./abstractions.js";
|
|
3
|
+
const WEBINY_AUTHORIZATION_HEADER = "x-webiny-authorization";
|
|
4
|
+
class ApiStreamClientWithIdToken {
|
|
5
|
+
constructor(idTokenProvider, decoratee){
|
|
6
|
+
this.idTokenProvider = idTokenProvider;
|
|
7
|
+
this.decoratee = decoratee;
|
|
8
|
+
}
|
|
9
|
+
async execute(params) {
|
|
10
|
+
if (params.headers?.[WEBINY_AUTHORIZATION_HEADER]) return this.decoratee.execute(params);
|
|
11
|
+
const idToken = await this.idTokenProvider.getTokenProvider()();
|
|
12
|
+
const authHeaders = idToken ? {
|
|
13
|
+
[WEBINY_AUTHORIZATION_HEADER]: `Bearer ${idToken}`
|
|
14
|
+
} : {};
|
|
15
|
+
return this.decoratee.execute({
|
|
16
|
+
...params,
|
|
17
|
+
headers: {
|
|
18
|
+
...params.headers,
|
|
19
|
+
...authHeaders
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const ApiStreamClientDecorator = ApiStreamClient.createDecorator({
|
|
25
|
+
decorator: ApiStreamClientWithIdToken,
|
|
26
|
+
dependencies: [
|
|
27
|
+
InternalIdTokenProvider
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
export { ApiStreamClientDecorator, WEBINY_AUTHORIZATION_HEADER };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=ApiStreamClientDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/security/AuthenticationContext/ApiStreamClientDecorator.js","sources":["../../../../src/features/security/AuthenticationContext/ApiStreamClientDecorator.ts"],"sourcesContent":["import { ApiStreamClient } from \"@webiny/app/features/apiStreamClient/index.js\";\nimport { InternalIdTokenProvider } from \"~/features/security/AuthenticationContext/abstractions.js\";\n\nexport const WEBINY_AUTHORIZATION_HEADER = \"x-webiny-authorization\";\n\n/**\n * Attaches the admin id token to streaming API requests. Mirrors `GraphQLClientDecorator` — the two\n * clients are separate abstractions, so neither decorator covers the other.\n *\n * Uses `x-webiny-authorization` rather than `Authorization`, because on AWS the streaming route is\n * served by a Lambda Function URL behind CloudFront with Origin Access Control: OAC signs the request\n * with SigV4, which occupies the `Authorization` header, so a bearer token there would not survive to\n * the origin. Both the AWS and the self-hosted identity extractors read this header first.\n */\nclass ApiStreamClientWithIdToken implements ApiStreamClient.Interface {\n constructor(\n private idTokenProvider: InternalIdTokenProvider.Interface,\n private decoratee: ApiStreamClient.Interface\n ) {}\n\n async execute(params: ApiStreamClient.Request): Promise<ApiStreamClient.Response> {\n if (params.headers?.[WEBINY_AUTHORIZATION_HEADER]) {\n return this.decoratee.execute(params);\n }\n\n const idToken = await this.idTokenProvider.getTokenProvider()();\n\n const authHeaders = idToken ? { [WEBINY_AUTHORIZATION_HEADER]: `Bearer ${idToken}` } : {};\n\n return this.decoratee.execute({\n ...params,\n headers: { ...params.headers, ...authHeaders }\n });\n }\n}\n\nexport const ApiStreamClientDecorator = ApiStreamClient.createDecorator({\n decorator: ApiStreamClientWithIdToken,\n dependencies: [InternalIdTokenProvider]\n});\n"],"names":["WEBINY_AUTHORIZATION_HEADER","ApiStreamClientWithIdToken","idTokenProvider","decoratee","params","idToken","authHeaders","ApiStreamClientDecorator","ApiStreamClient","InternalIdTokenProvider"],"mappings":";;AAGO,MAAMA,8BAA8B;AAW3C,MAAMC;IACF,YACYC,eAAkD,EAClDC,SAAoC,CAC9C;aAFUD,eAAe,GAAfA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,MAA+B,EAAqC;QAC9E,IAAIA,OAAO,OAAO,EAAE,CAACJ,4BAA4B,EAC7C,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACI;QAGlC,MAAMC,UAAU,MAAM,IAAI,CAAC,eAAe,CAAC,gBAAgB;QAE3D,MAAMC,cAAcD,UAAU;YAAE,CAACL,4BAA4B,EAAE,CAAC,OAAO,EAAEK,SAAS;QAAC,IAAI,CAAC;QAExF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YAC1B,GAAGD,MAAM;YACT,SAAS;gBAAE,GAAGA,OAAO,OAAO;gBAAE,GAAGE,WAAW;YAAC;QACjD;IACJ;AACJ;AAEO,MAAMC,2BAA2BC,gBAAgB,eAAe,CAAC;IACpE,WAAWP;IACX,cAAc;QAACQ;KAAwB;AAC3C"}
|