@wildo-ai/saas-frontend-lib 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/actions/action-bar.d.ts +15 -0
- package/dist/esm/components/actions/action-bar.d.ts.map +1 -1
- package/dist/esm/components/actions/action-bar.js +15 -0
- package/dist/esm/components/actions/action-bar.js.map +1 -1
- package/dist/esm/components/ai-elements/decision/approval.d.ts +97 -7
- package/dist/esm/components/ai-elements/decision/approval.d.ts.map +1 -1
- package/dist/esm/components/ai-elements/decision/approval.js.map +1 -1
- package/dist/esm/components/app/AppLayout_AuthenticatedRoute.d.ts.map +1 -1
- package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js +8 -3
- package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js.map +1 -1
- package/dist/esm/components/auth/Auth_EnrollmentRequired.d.ts.map +1 -1
- package/dist/esm/components/auth/Auth_EnrollmentRequired.js +5 -1
- package/dist/esm/components/auth/Auth_EnrollmentRequired.js.map +1 -1
- package/dist/esm/components/auth/Auth_Main.d.ts.map +1 -1
- package/dist/esm/components/auth/Auth_Main.js +1 -4
- package/dist/esm/components/auth/Auth_Main.js.map +1 -1
- package/dist/esm/components/auth/Auth_Register.d.ts.map +1 -1
- package/dist/esm/components/auth/Auth_Register.js +1 -3
- package/dist/esm/components/auth/Auth_Register.js.map +1 -1
- package/dist/esm/components/auth/StepUpAuthDialog.d.ts +7 -0
- package/dist/esm/components/auth/StepUpAuthDialog.d.ts.map +1 -1
- package/dist/esm/components/auth/StepUpAuthDialog.js +13 -7
- package/dist/esm/components/auth/StepUpAuthDialog.js.map +1 -1
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.d.ts.map +1 -1
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.js +32 -33
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.js.map +1 -1
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.d.ts.map +1 -1
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js +18 -20
- package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js.map +1 -1
- package/dist/esm/components/auth/methods/ExternalOAuth2AuthMethod.d.ts.map +1 -1
- package/dist/esm/components/auth/methods/ExternalOAuth2AuthMethod.js +2 -3
- package/dist/esm/components/auth/methods/ExternalOAuth2AuthMethod.js.map +1 -1
- package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.d.ts +13 -16
- package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.d.ts.map +1 -1
- package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.js +18 -15
- package/dist/esm/components/auth/utils/oauth-provider-display-label.frontend.utils.js.map +1 -1
- package/dist/esm/components/billing/billing-invoice-history.js +2 -2
- package/dist/esm/components/billing/billing-invoice-history.js.map +1 -1
- package/dist/esm/components/billing/billing-portal-link.js +2 -2
- package/dist/esm/components/billing/billing-portal-link.js.map +1 -1
- package/dist/esm/components/billing/billing-pricing-table.d.ts +33 -1
- package/dist/esm/components/billing/billing-pricing-table.d.ts.map +1 -1
- package/dist/esm/components/billing/billing-pricing-table.js +34 -5
- package/dist/esm/components/billing/billing-pricing-table.js.map +1 -1
- package/dist/esm/components/billing/billing-subscription-status.js +2 -2
- package/dist/esm/components/billing/billing-subscription-status.js.map +1 -1
- package/dist/esm/components/billing/billing-usage-dashboard.d.ts +2 -0
- package/dist/esm/components/billing/billing-usage-dashboard.d.ts.map +1 -1
- package/dist/esm/components/billing/billing-usage-dashboard.js +1 -0
- package/dist/esm/components/billing/billing-usage-dashboard.js.map +1 -1
- package/dist/esm/components/data-display/DisplayField.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayField.js +15 -1
- package/dist/esm/components/data-display/DisplayField.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldArray.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldArray.js +11 -0
- package/dist/esm/components/data-display/DisplayFieldArray.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldEditable.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldEditable.js +2 -2
- package/dist/esm/components/data-display/DisplayFieldEditable.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldEditableArray.d.ts +12 -2
- package/dist/esm/components/data-display/DisplayFieldEditableArray.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldEditableArray.js +3 -2
- package/dist/esm/components/data-display/DisplayFieldEditableArray.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldReadOnly.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldReadOnly.js +2 -2
- package/dist/esm/components/data-display/DisplayFieldReadOnly.js.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldReadOnlyArraySection.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayFieldReadOnlyArraySection.js +8 -2
- package/dist/esm/components/data-display/DisplayFieldReadOnlyArraySection.js.map +1 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.js +18 -4
- package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.d.ts.map +1 -1
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js +61 -3
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
- package/dist/esm/components/data-display/ResourceSummaryDisplayer.d.ts +7 -5
- package/dist/esm/components/data-display/ResourceSummaryDisplayer.d.ts.map +1 -1
- package/dist/esm/components/data-display/ResourceSummaryDisplayer.js.map +1 -1
- package/dist/esm/components/data-display/chromes/DisplayFieldChrome.d.ts +11 -1
- package/dist/esm/components/data-display/chromes/DisplayFieldChrome.d.ts.map +1 -1
- package/dist/esm/components/data-display/chromes/DisplayFieldChrome.js +36 -11
- package/dist/esm/components/data-display/chromes/DisplayFieldChrome.js.map +1 -1
- package/dist/esm/components/data-display/display-field-resolved-props.d.ts +6 -0
- package/dist/esm/components/data-display/display-field-resolved-props.d.ts.map +1 -1
- package/dist/esm/components/data-display/display-field-resolved-props.js.map +1 -1
- package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.d.ts +23 -0
- package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.d.ts.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.js +35 -0
- package/dist/esm/components/data-display/external-data-provenance/DisplayFieldProvenanceNote.js.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts +47 -0
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +124 -0
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.d.ts +8 -0
- package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.d.ts.map +1 -0
- package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.js +46 -0
- package/dist/esm/components/data-display/external-data-provenance/useExternalDataFieldProvenance.js.map +1 -0
- package/dist/esm/components/feedback/resource-empty-state.d.ts +21 -8
- package/dist/esm/components/feedback/resource-empty-state.d.ts.map +1 -1
- package/dist/esm/components/feedback/resource-empty-state.js +56 -26
- package/dist/esm/components/feedback/resource-empty-state.js.map +1 -1
- package/dist/esm/components/flows-actors/approval.d.ts +29 -7
- package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.js +231 -101
- package/dist/esm/components/flows-actors/approval.js.map +1 -1
- package/dist/esm/components/flows-actors/approval.labels.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.labels.js +57 -0
- package/dist/esm/components/flows-actors/approval.labels.js.map +1 -1
- package/dist/esm/components/flows-actors/system-catalog.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/system-catalog.js +4 -4
- package/dist/esm/components/flows-actors/system-catalog.js.map +1 -1
- package/dist/esm/components/flows-actors/system-catalog.labels.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/system-catalog.labels.js +0 -5
- package/dist/esm/components/flows-actors/system-catalog.labels.js.map +1 -1
- package/dist/esm/components/form/Form.d.ts +2 -2
- package/dist/esm/components/form/Form.js +2 -2
- package/dist/esm/components/form/Form.js.map +1 -1
- package/dist/esm/components/form/automated/AutomatedArrayField.d.ts +28 -3
- package/dist/esm/components/form/automated/AutomatedArrayField.d.ts.map +1 -1
- package/dist/esm/components/form/automated/AutomatedArrayField.js +43 -14
- package/dist/esm/components/form/automated/AutomatedArrayField.js.map +1 -1
- package/dist/esm/components/form/automated/FormField.d.ts +3 -0
- package/dist/esm/components/form/automated/FormField.d.ts.map +1 -1
- package/dist/esm/components/form/automated/FormField.js +60 -21
- package/dist/esm/components/form/automated/FormField.js.map +1 -1
- package/dist/esm/components/form/automated/FormFieldArray.d.ts +6 -3
- package/dist/esm/components/form/automated/FormFieldArray.d.ts.map +1 -1
- package/dist/esm/components/form/automated/FormFieldArray.js +3 -2
- package/dist/esm/components/form/automated/FormFieldArray.js.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts +5 -4
- package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js +148 -55
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
- package/dist/esm/components/form/automated/ResourceFormActionsContext.d.ts +30 -0
- package/dist/esm/components/form/automated/ResourceFormActionsContext.d.ts.map +1 -1
- package/dist/esm/components/form/automated/ResourceFormActionsContext.js +30 -1
- package/dist/esm/components/form/automated/ResourceFormActionsContext.js.map +1 -1
- package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.d.ts +79 -0
- package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.d.ts.map +1 -0
- package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.js +203 -0
- package/dist/esm/components/form/automated/TemplatePlacedFieldsContext.js.map +1 -0
- package/dist/esm/components/form/automated/automated-form-submit.utils.d.ts +12 -0
- package/dist/esm/components/form/automated/automated-form-submit.utils.d.ts.map +1 -1
- package/dist/esm/components/form/automated/automated-form-submit.utils.js +11 -0
- package/dist/esm/components/form/automated/automated-form-submit.utils.js.map +1 -1
- package/dist/esm/components/form/chromes/FormFieldChrome.d.ts.map +1 -1
- package/dist/esm/components/form/chromes/FormFieldChrome.js +2 -2
- package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
- package/dist/esm/components/form/combobox.d.ts +7 -0
- package/dist/esm/components/form/combobox.d.ts.map +1 -1
- package/dist/esm/components/form/combobox.js.map +1 -1
- package/dist/esm/components/form/controls/form-field-checkbox-group.d.ts.map +1 -1
- package/dist/esm/components/form/controls/form-field-checkbox-group.js +13 -0
- package/dist/esm/components/form/controls/form-field-checkbox-group.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-address.d.ts +58 -0
- package/dist/esm/components/form/fields/form-field-address.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-address.js +34 -6
- package/dist/esm/components/form/fields/form-field-address.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-address.labels.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-address.labels.js +60 -1
- package/dist/esm/components/form/fields/form-field-address.labels.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.d.ts +0 -12
- package/dist/esm/components/form/fields/form-field-file.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.js +34 -13
- package/dist/esm/components/form/fields/form-field-file.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.labels.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.labels.js +46 -0
- package/dist/esm/components/form/fields/form-field-file.labels.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-string-organization-role.d.ts +73 -0
- package/dist/esm/components/form/fields/form-field-string-organization-role.d.ts.map +1 -0
- package/dist/esm/components/form/fields/form-field-string-organization-role.js +64 -0
- package/dist/esm/components/form/fields/form-field-string-organization-role.js.map +1 -0
- package/dist/esm/components/form/fields/form-field-string.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-string.js +8 -1
- package/dist/esm/components/form/fields/form-field-string.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-string.labels.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-string.labels.js +4 -0
- package/dist/esm/components/form/fields/form-field-string.labels.js.map +1 -1
- package/dist/esm/components/form/validation-errors/FormErrorSummary.js +1 -1
- package/dist/esm/components/form/validation-errors/FormErrorSummary.js.map +1 -1
- package/dist/esm/components/form/validation-errors/resolver-error-nesting.d.ts +31 -0
- package/dist/esm/components/form/validation-errors/resolver-error-nesting.d.ts.map +1 -0
- package/dist/esm/components/form/validation-errors/resolver-error-nesting.js +81 -0
- package/dist/esm/components/form/validation-errors/resolver-error-nesting.js.map +1 -0
- package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts +14 -1
- package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js +14 -0
- package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js.map +1 -1
- package/dist/esm/components/form/validation-errors/zod-issue-resolver.d.ts +22 -0
- package/dist/esm/components/form/validation-errors/zod-issue-resolver.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/zod-issue-resolver.js +1 -22
- package/dist/esm/components/form/validation-errors/zod-issue-resolver.js.map +1 -1
- package/dist/esm/components/layout/resizable.d.ts +11 -0
- package/dist/esm/components/layout/resizable.d.ts.map +1 -1
- package/dist/esm/components/layout/resizable.js.map +1 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.d.ts +11 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js +15 -3
- package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js.map +1 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_StatusBar.d.ts +2 -2
- package/dist/esm/components/navigation/app-level/ApplicationLevel_StatusBar.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/ApplicationLevel_StatusBar.js.map +1 -1
- package/dist/esm/components/navigation/app-level/HostedComponentInteractionsProvider.d.ts +2 -2
- package/dist/esm/components/navigation/app-level/HostedComponentInteractionsProvider.js +2 -2
- package/dist/esm/components/navigation/app-level/HostedComponentInteractionsProvider.js.map +1 -1
- package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js +18 -20
- package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js +7 -1
- package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js +4 -1
- package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js +18 -2
- package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useSidebarBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useSidebarBehavior.js +82 -10
- package/dist/esm/components/navigation/app-level/useSidebarBehavior.js.map +1 -1
- package/dist/esm/components/navigation/app-level/useStatusBarBehavior.d.ts +2 -2
- package/dist/esm/components/navigation/app-level/useStatusBarBehavior.d.ts.map +1 -1
- package/dist/esm/components/navigation/app-level/useStatusBarBehavior.js.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionQuickFilterTabs.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionQuickFilterTabs.js +8 -1
- package/dist/esm/components/resources/ResourceCollectionQuickFilterTabs.js.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionToolbar.d.ts +8 -2
- package/dist/esm/components/resources/ResourceCollectionToolbar.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionToolbar.js +6 -2
- package/dist/esm/components/resources/ResourceCollectionToolbar.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Breadcrumb.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Breadcrumb.js +31 -16
- package/dist/esm/components/resources/ResourceLayout_Breadcrumb.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ContainerDialogs.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ContainerDialogs.js +23 -8
- package/dist/esm/components/resources/ResourceLayout_ContainerDialogs.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ContainerNested.js +2 -2
- package/dist/esm/components/resources/ResourceLayout_ContainerNested.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Header.d.ts +13 -0
- package/dist/esm/components/resources/ResourceLayout_Header.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Header.js +55 -28
- package/dist/esm/components/resources/ResourceLayout_Header.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.js +41 -20
- package/dist/esm/components/resources/ResourceLayout_List.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.labels.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_List.labels.js +1 -2
- package/dist/esm/components/resources/ResourceLayout_List.labels.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Read.d.ts +9 -4
- package/dist/esm/components/resources/ResourceLayout_Read.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Read.js +30 -11
- package/dist/esm/components/resources/ResourceLayout_Read.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ReadSummary.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ReadSummary.js +4 -2
- package/dist/esm/components/resources/ResourceLayout_ReadSummary.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ReadSummary_TableRow.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_ReadSummary_TableRow.js +6 -2
- package/dist/esm/components/resources/ResourceLayout_ReadSummary_TableRow.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Search.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Search.js +30 -14
- package/dist/esm/components/resources/ResourceLayout_Search.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_SemanticOperationFallback.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_SemanticOperationFallback.js +14 -198
- package/dist/esm/components/resources/ResourceLayout_SemanticOperationFallback.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_Update.d.ts +2 -2
- package/dist/esm/components/resources/ResourceLayout_Update.js +2 -2
- package/dist/esm/components/resources/ResourceLayout_Update.js.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.js +69 -39
- package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
- package/dist/esm/components/resources/ResourceOperationActionDropdown.d.ts +32 -0
- package/dist/esm/components/resources/ResourceOperationActionDropdown.d.ts.map +1 -0
- package/dist/esm/components/resources/ResourceOperationActionDropdown.js +130 -0
- package/dist/esm/components/resources/ResourceOperationActionDropdown.js.map +1 -0
- package/dist/esm/components/resources/collection-create-placement.utils.d.ts +32 -0
- package/dist/esm/components/resources/collection-create-placement.utils.d.ts.map +1 -0
- package/dist/esm/components/resources/collection-create-placement.utils.js +37 -0
- package/dist/esm/components/resources/collection-create-placement.utils.js.map +1 -0
- package/dist/esm/components/resources/embeds/RelatedResourcePreview.d.ts.map +1 -1
- package/dist/esm/components/resources/embeds/RelatedResourcePreview.js +5 -1
- package/dist/esm/components/resources/embeds/RelatedResourcePreview.js.map +1 -1
- package/dist/esm/components/resources/embeds/RelatedResourceSections.d.ts +8 -1
- package/dist/esm/components/resources/embeds/RelatedResourceSections.d.ts.map +1 -1
- package/dist/esm/components/resources/embeds/RelatedResourceSections.js +49 -2
- package/dist/esm/components/resources/embeds/RelatedResourceSections.js.map +1 -1
- package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts +22 -0
- package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts.map +1 -1
- package/dist/esm/components/resources/embeds/ResourceEmbeds.js +85 -2
- package/dist/esm/components/resources/embeds/ResourceEmbeds.js.map +1 -1
- package/dist/esm/components/resources/resourceLayout.utils.d.ts +14 -0
- package/dist/esm/components/resources/resourceLayout.utils.d.ts.map +1 -1
- package/dist/esm/components/resources/resourceLayout.utils.js +22 -0
- package/dist/esm/components/resources/resourceLayout.utils.js.map +1 -1
- package/dist/esm/components/resources/skeleton/ArrayField.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/ArrayField.js +3 -0
- package/dist/esm/components/resources/skeleton/ArrayField.js.map +1 -1
- package/dist/esm/components/resources/skeleton/FormLayout.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/FormLayout.js +33 -1
- package/dist/esm/components/resources/skeleton/FormLayout.js.map +1 -1
- package/dist/esm/components/resources/skeleton/ObjectScope.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/ObjectScope.js +3 -0
- package/dist/esm/components/resources/skeleton/ObjectScope.js.map +1 -1
- package/dist/esm/components/resources/skeleton/Section.d.ts +12 -0
- package/dist/esm/components/resources/skeleton/Section.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/Section.js +28 -2
- package/dist/esm/components/resources/skeleton/Section.js.map +1 -1
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts +70 -0
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.js +157 -1
- package/dist/esm/components/resources/skeleton/SectionFieldsContext.js.map +1 -1
- package/dist/esm/components/resources/skeleton/WizardLayout.d.ts +6 -0
- package/dist/esm/components/resources/skeleton/WizardLayout.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/WizardLayout.js +13 -2
- package/dist/esm/components/resources/skeleton/WizardLayout.js.map +1 -1
- package/dist/esm/components/resources/skeleton/WizardStep.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/WizardStep.js +2 -1
- package/dist/esm/components/resources/skeleton/WizardStep.js.map +1 -1
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +61 -15
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
- package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.d.ts +24 -2
- package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.d.ts.map +1 -1
- package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.js +69 -1
- package/dist/esm/components/resources-fields/resource-reference/resource-reference.shared.utils.js.map +1 -1
- package/dist/esm/components/resources-fields/resource-reference/useResourceSearch.d.ts.map +1 -1
- package/dist/esm/components/resources-fields/resource-reference/useResourceSearch.js +18 -19
- package/dist/esm/components/resources-fields/resource-reference/useResourceSearch.js.map +1 -1
- package/dist/esm/components/sections/ContentSectionContainer.d.ts.map +1 -1
- package/dist/esm/components/sections/ContentSectionContainer.js +5 -4
- package/dist/esm/components/sections/ContentSectionContainer.js.map +1 -1
- package/dist/esm/components/sections/stepper.d.ts +5 -0
- package/dist/esm/components/sections/stepper.d.ts.map +1 -1
- package/dist/esm/components/sections/stepper.js.map +1 -1
- package/dist/esm/components/sections/surface.d.ts.map +1 -1
- package/dist/esm/components/sections/surface.js +12 -3
- package/dist/esm/components/sections/surface.js.map +1 -1
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.d.ts +43 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.d.ts.map +1 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.js +129 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.js.map +1 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.d.ts +3 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.d.ts.map +1 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.js +34 -0
- package/dist/esm/components/settings/AppPage_AgentWorkOverrideRateSettings.labels.js.map +1 -0
- package/dist/esm/components/settings/AppPage_AppearanceSettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_AppearanceSettings.js +9 -11
- package/dist/esm/components/settings/AppPage_AppearanceSettings.js.map +1 -1
- package/dist/esm/components/settings/AppPage_AppearanceSettings.labels.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_AppearanceSettings.labels.js +3 -2
- package/dist/esm/components/settings/AppPage_AppearanceSettings.labels.js.map +1 -1
- package/dist/esm/components/settings/AppPage_BillingSettings.d.ts +4 -2
- package/dist/esm/components/settings/AppPage_BillingSettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_BillingSettings.js +21 -3
- package/dist/esm/components/settings/AppPage_BillingSettings.js.map +1 -1
- package/dist/esm/components/settings/AppPage_BillingSettings.labels.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_BillingSettings.labels.js +5 -10
- package/dist/esm/components/settings/AppPage_BillingSettings.labels.js.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts +58 -0
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js +243 -40
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.js +67 -6
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.js.map +1 -1
- package/dist/esm/components/settings/AppPage_InvitationsSettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_InvitationsSettings.js +19 -11
- package/dist/esm/components/settings/AppPage_InvitationsSettings.js.map +1 -1
- package/dist/esm/components/settings/AppPage_InvitationsSettings.labels.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_InvitationsSettings.labels.js +4 -2
- package/dist/esm/components/settings/AppPage_InvitationsSettings.labels.js.map +1 -1
- package/dist/esm/components/settings/SettingsHub.d.ts.map +1 -1
- package/dist/esm/components/settings/SettingsHub.js +3 -0
- package/dist/esm/components/settings/SettingsHub.js.map +1 -1
- package/dist/esm/components/settings/SettingsResourceOperationPanel.d.ts.map +1 -1
- package/dist/esm/components/settings/SettingsResourceOperationPanel.js +16 -1
- package/dist/esm/components/settings/SettingsResourceOperationPanel.js.map +1 -1
- package/dist/esm/components/settings/useOwnerProviderConnections.d.ts +59 -0
- package/dist/esm/components/settings/useOwnerProviderConnections.d.ts.map +1 -0
- package/dist/esm/components/settings/useOwnerProviderConnections.js +136 -0
- package/dist/esm/components/settings/useOwnerProviderConnections.js.map +1 -0
- package/dist/esm/components/views/chart-view/chart-view.utils.d.ts +5 -0
- package/dist/esm/components/views/chart-view/chart-view.utils.d.ts.map +1 -1
- package/dist/esm/components/views/chart-view/chart-view.utils.js +5 -0
- package/dist/esm/components/views/chart-view/chart-view.utils.js.map +1 -1
- package/dist/esm/components/views/chart-view/useResourceChartData.d.ts +50 -0
- package/dist/esm/components/views/chart-view/useResourceChartData.d.ts.map +1 -0
- package/dist/esm/components/views/chart-view/useResourceChartData.js +72 -0
- package/dist/esm/components/views/chart-view/useResourceChartData.js.map +1 -0
- package/dist/esm/components/views/composite-view/CompositeLayout.d.ts.map +1 -1
- package/dist/esm/components/views/composite-view/CompositeLayout.js +2 -1
- package/dist/esm/components/views/composite-view/CompositeLayout.js.map +1 -1
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.d.ts +86 -0
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.d.ts.map +1 -0
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.js +187 -0
- package/dist/esm/core/app-shell/AppShellBuildingBlocks.js.map +1 -0
- package/dist/esm/core/app-shell/PortalContainerContext.d.ts +5 -2
- package/dist/esm/core/app-shell/PortalContainerContext.d.ts.map +1 -1
- package/dist/esm/core/app-shell/PortalContainerContext.js +5 -2
- package/dist/esm/core/app-shell/PortalContainerContext.js.map +1 -1
- package/dist/esm/core/app-shell/app-shell.schemas.d.ts +18 -9
- package/dist/esm/core/app-shell/app-shell.schemas.d.ts.map +1 -1
- package/dist/esm/core/app-shell/app-shell.schemas.js +1 -0
- package/dist/esm/core/app-shell/app-shell.schemas.js.map +1 -1
- package/dist/esm/core/app-shell/useAppShellLayout.d.ts +10 -0
- package/dist/esm/core/app-shell/useAppShellLayout.d.ts.map +1 -1
- package/dist/esm/core/app-shell/useAppShellLayout.js +28 -5
- package/dist/esm/core/app-shell/useAppShellLayout.js.map +1 -1
- package/dist/esm/core/app-shell/usePublicShellLayout.d.ts.map +1 -1
- package/dist/esm/core/app-shell/usePublicShellLayout.js +38 -0
- package/dist/esm/core/app-shell/usePublicShellLayout.js.map +1 -1
- package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts +15 -1
- package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js +47 -13
- package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js.map +1 -1
- package/dist/esm/core/billing/BillingContext.d.ts +25 -2
- package/dist/esm/core/billing/BillingContext.d.ts.map +1 -1
- package/dist/esm/core/billing/BillingContext.js +16 -25
- package/dist/esm/core/billing/BillingContext.js.map +1 -1
- package/dist/esm/core/billing/billing-provider-display.frontend.utils.d.ts +11 -3
- package/dist/esm/core/billing/billing-provider-display.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/billing/billing-provider-display.frontend.utils.js +14 -8
- package/dist/esm/core/billing/billing-provider-display.frontend.utils.js.map +1 -1
- package/dist/esm/core/billing/useBillingPlanChange.d.ts.map +1 -1
- package/dist/esm/core/billing/useBillingPlanChange.js +2 -0
- package/dist/esm/core/billing/useBillingPlanChange.js.map +1 -1
- package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.d.ts.map +1 -1
- package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js +1 -0
- package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js.map +1 -1
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.d.ts +29 -229
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.js +29 -327
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.js.map +1 -1
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.d.ts +17 -27
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.d.ts.map +1 -1
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.js +28 -48
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.js.map +1 -1
- package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts +21 -11
- package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/app-configuration-frontend.schemas.js +4 -4
- package/dist/esm/core/config/app-configuration-frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/app-level-components.frontend.schemas.d.ts +17 -0
- package/dist/esm/core/config/app-level-components.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/app-level-components.frontend.schemas.js +17 -0
- package/dist/esm/core/config/app-level-components.frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/chart-view.frontend.schemas.d.ts +10 -10
- package/dist/esm/core/config/engine-settings-destinations.d.ts.map +1 -1
- package/dist/esm/core/config/engine-settings-destinations.js +221 -6
- package/dist/esm/core/config/engine-settings-destinations.js.map +1 -1
- package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts +8 -0
- package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/launcher-items.frontend.schemas.js +1 -0
- package/dist/esm/core/config/launcher-items.frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts +10 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.js +9 -0
- package/dist/esm/core/config/settings-hub.frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/verify-launcher-content.d.ts.map +1 -1
- package/dist/esm/core/config/verify-launcher-content.js +30 -19
- package/dist/esm/core/config/verify-launcher-content.js.map +1 -1
- package/dist/esm/core/errors/ErrorContext.d.ts.map +1 -1
- package/dist/esm/core/errors/ErrorContext.js +9 -1
- package/dist/esm/core/errors/ErrorContext.js.map +1 -1
- package/dist/esm/core/errors/GlobalErrorHandler.d.ts.map +1 -1
- package/dist/esm/core/errors/GlobalErrorHandler.js +5 -4
- package/dist/esm/core/errors/GlobalErrorHandler.js.map +1 -1
- package/dist/esm/core/errors/RouterErrorBoundary.js +1 -1
- package/dist/esm/core/errors/RouterErrorBoundary.js.map +1 -1
- package/dist/esm/core/errors/errors-builder.frontend.services.d.ts +2 -2
- package/dist/esm/core/errors/errors-builder.frontend.services.d.ts.map +1 -1
- package/dist/esm/core/errors/errors-builder.frontend.services.js +4 -4
- package/dist/esm/core/errors/errors-builder.frontend.services.js.map +1 -1
- package/dist/esm/core/errors/user-facing-error-message.frontend.utils.js +1 -1
- package/dist/esm/core/errors/user-facing-error-message.frontend.utils.js.map +1 -1
- package/dist/esm/core/events/NotificationContext.d.ts.map +1 -1
- package/dist/esm/core/events/NotificationContext.js +23 -5
- package/dist/esm/core/events/NotificationContext.js.map +1 -1
- package/dist/esm/core/events/events.frontend.schemas.d.ts +110 -43
- package/dist/esm/core/events/events.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/events/events.frontend.schemas.js +89 -15
- package/dist/esm/core/events/events.frontend.schemas.js.map +1 -1
- package/dist/esm/core/execution/useExecutionParticipationRMM.d.ts +2 -0
- package/dist/esm/core/execution/useExecutionParticipationRMM.d.ts.map +1 -1
- package/dist/esm/core/execution/useExecutionParticipationRMM.js +2 -1
- package/dist/esm/core/execution/useExecutionParticipationRMM.js.map +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationSurface.d.ts +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationSurface.d.ts.map +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationSurface.js +5 -2
- package/dist/esm/core/execution/useExecutionResourceOperationSurface.js.map +1 -1
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.d.ts +63 -0
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.d.ts.map +1 -0
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js +131 -0
- package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js.map +1 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.d.ts +61 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.d.ts.map +1 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.js +178 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupCombobox.js.map +1 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupHost.d.ts +52 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupHost.d.ts.map +1 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupHost.js +144 -0
- package/dist/esm/core/external-providers/ProviderAddressLookupHost.js.map +1 -0
- package/dist/esm/core/external-providers/ProviderFilePickerHost.d.ts +22 -1
- package/dist/esm/core/external-providers/ProviderFilePickerHost.d.ts.map +1 -1
- package/dist/esm/core/external-providers/ProviderFilePickerHost.js +23 -3
- package/dist/esm/core/external-providers/ProviderFilePickerHost.js.map +1 -1
- package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.d.ts +55 -0
- package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.d.ts.map +1 -0
- package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.js +65 -0
- package/dist/esm/core/external-providers/provider-address-lookup-selection.frontend.utils.js.map +1 -0
- package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.d.ts +63 -0
- package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.d.ts.map +1 -0
- package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.js +100 -0
- package/dist/esm/core/external-providers/provider-scope-reauthorization-offers.frontend.js.map +1 -0
- package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts +45 -7
- package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts.map +1 -1
- package/dist/esm/core/flows-actors/FlowsActorsContext.js +112 -28
- package/dist/esm/core/flows-actors/FlowsActorsContext.js.map +1 -1
- package/dist/esm/core/flows-actors/usePendingDecisions.d.ts +32 -0
- package/dist/esm/core/flows-actors/usePendingDecisions.d.ts.map +1 -0
- package/dist/esm/core/flows-actors/usePendingDecisions.js +91 -0
- package/dist/esm/core/flows-actors/usePendingDecisions.js.map +1 -0
- package/dist/esm/core/guidance/GuidanceRenderer.d.ts.map +1 -1
- package/dist/esm/core/guidance/GuidanceRenderer.js +3 -2
- package/dist/esm/core/guidance/GuidanceRenderer.js.map +1 -1
- package/dist/esm/core/i18n/I18nContext.d.ts +22 -8
- package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
- package/dist/esm/core/i18n/I18nContext.js +21 -9
- package/dist/esm/core/i18n/I18nContext.js.map +1 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.d.ts +5 -3
- package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.js +5 -3
- package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
- package/dist/esm/core/i18n/useI18n.d.ts +2 -1
- package/dist/esm/core/i18n/useI18n.d.ts.map +1 -1
- package/dist/esm/core/i18n/useI18n.js +2 -1
- package/dist/esm/core/i18n/useI18n.js.map +1 -1
- package/dist/esm/core/loading/LoadingContext.d.ts.map +1 -1
- package/dist/esm/core/loading/LoadingContext.js +7 -1
- package/dist/esm/core/loading/LoadingContext.js.map +1 -1
- package/dist/esm/core/loading/LoadingGate.d.ts.map +1 -1
- package/dist/esm/core/loading/LoadingGate.js +19 -1
- package/dist/esm/core/loading/LoadingGate.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +15 -2
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +183 -20
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +2 -2
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.d.ts +7 -15
- package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.js +8 -26
- package/dist/esm/core/monitoring/analytics/analytics-provider-registry.frontend.service.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.d.ts +12 -3
- package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.js +3 -2
- package/dist/esm/core/monitoring/analytics/analytics-provider.frontend.interface.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.d.ts +42 -0
- package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.js +89 -5
- package/dist/esm/core/monitoring/analytics/providers/backend-proxy-analytics.provider.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.d.ts +2 -0
- package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.js +2 -0
- package/dist/esm/core/monitoring/analytics/providers/console-analytics.provider.js.map +1 -1
- package/dist/esm/core/navigation/NavigationContentAreas.d.ts +78 -0
- package/dist/esm/core/navigation/NavigationContentAreas.d.ts.map +1 -1
- package/dist/esm/core/navigation/NavigationContentAreas.js +264 -16
- package/dist/esm/core/navigation/NavigationContentAreas.js.map +1 -1
- package/dist/esm/core/navigation/NavigationContext.d.ts +8 -0
- package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
- package/dist/esm/core/navigation/NavigationContext.js +137 -30
- package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.d.ts +2 -0
- package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.js +1 -0
- package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
- package/dist/esm/core/navigation/navigation-cascade.d.ts +46 -0
- package/dist/esm/core/navigation/navigation-cascade.d.ts.map +1 -0
- package/dist/esm/core/navigation/navigation-cascade.js +222 -0
- package/dist/esm/core/navigation/navigation-cascade.js.map +1 -0
- package/dist/esm/core/navigation/navigation-clean-break.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation-clean-break.frontend.utils.js +21 -2
- package/dist/esm/core/navigation/navigation-clean-break.frontend.utils.js.map +1 -1
- package/dist/esm/core/navigation/navigation-controller-internals.d.ts +71 -0
- package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -0
- package/dist/esm/core/navigation/navigation-controller-internals.js +84 -0
- package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -0
- package/dist/esm/core/navigation/navigation-policy-resolver.service.d.ts +86 -2
- package/dist/esm/core/navigation/navigation-policy-resolver.service.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation-policy-resolver.service.js +242 -124
- package/dist/esm/core/navigation/navigation-policy-resolver.service.js.map +1 -1
- package/dist/esm/core/navigation/navigation.schemas.d.ts +170 -8
- package/dist/esm/core/navigation/navigation.schemas.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation.schemas.js +121 -2
- package/dist/esm/core/navigation/navigation.schemas.js.map +1 -1
- package/dist/esm/core/navigation/navigation.utils.d.ts +102 -6
- package/dist/esm/core/navigation/navigation.utils.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation.utils.js +283 -34
- package/dist/esm/core/navigation/navigation.utils.js.map +1 -1
- package/dist/esm/core/navigation/useIsStackEntryActive.d.ts +0 -10
- package/dist/esm/core/navigation/useIsStackEntryActive.d.ts.map +0 -1
- package/dist/esm/core/navigation/useIsStackEntryActive.js.map +0 -1
- package/dist/esm/core/navigation/useNavigationController.d.ts +28 -157
- package/dist/esm/core/navigation/useNavigationController.d.ts.map +1 -1
- package/dist/esm/core/navigation/useNavigationController.js +211 -1189
- package/dist/esm/core/navigation/useNavigationController.js.map +1 -1
- package/dist/esm/core/navigation/useNavigationRouterSync.d.ts +174 -0
- package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -0
- package/dist/esm/core/navigation/useNavigationRouterSync.js +977 -0
- package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -0
- package/dist/esm/core/navigation/useOverlayTitle.d.ts +13 -1
- package/dist/esm/core/navigation/useOverlayTitle.d.ts.map +1 -1
- package/dist/esm/core/navigation/useOverlayTitle.js +15 -10
- package/dist/esm/core/navigation/useOverlayTitle.js.map +1 -1
- package/dist/esm/core/navigation/useResponsiveZoneMigration.d.ts +43 -0
- package/dist/esm/core/navigation/useResponsiveZoneMigration.d.ts.map +1 -0
- package/dist/esm/core/navigation/useResponsiveZoneMigration.js +44 -0
- package/dist/esm/core/navigation/useResponsiveZoneMigration.js.map +1 -0
- package/dist/esm/core/navigation/zone-collapse-migration.d.ts +83 -0
- package/dist/esm/core/navigation/zone-collapse-migration.d.ts.map +1 -0
- package/dist/esm/core/navigation/zone-collapse-migration.js +116 -0
- package/dist/esm/core/navigation/zone-collapse-migration.js.map +1 -0
- package/dist/esm/core/navigation/zone-collapse.d.ts +51 -0
- package/dist/esm/core/navigation/zone-collapse.d.ts.map +1 -0
- package/dist/esm/core/navigation/zone-collapse.js +59 -0
- package/dist/esm/core/navigation/zone-collapse.js.map +1 -0
- package/dist/esm/core/navigation/zone-emphasis.d.ts +3 -0
- package/dist/esm/core/navigation/zone-emphasis.d.ts.map +1 -1
- package/dist/esm/core/navigation/zone-emphasis.js +26 -4
- package/dist/esm/core/navigation/zone-emphasis.js.map +1 -1
- package/dist/esm/core/navigation/zone-visible-entry.d.ts +22 -0
- package/dist/esm/core/navigation/zone-visible-entry.d.ts.map +1 -1
- package/dist/esm/core/navigation/zone-visible-entry.js +25 -0
- package/dist/esm/core/navigation/zone-visible-entry.js.map +1 -1
- package/dist/esm/core/requests/websockets/WebSocketContext.d.ts.map +1 -1
- package/dist/esm/core/requests/websockets/WebSocketContext.js +53 -18
- package/dist/esm/core/requests/websockets/WebSocketContext.js.map +1 -1
- package/dist/esm/core/requests/websockets/WebSocketEventBridge.d.ts.map +1 -1
- package/dist/esm/core/requests/websockets/WebSocketEventBridge.js +3 -1
- package/dist/esm/core/requests/websockets/WebSocketEventBridge.js.map +1 -1
- package/dist/esm/core/requests/websockets/useNotificationBadges.d.ts +22 -0
- package/dist/esm/core/requests/websockets/useNotificationBadges.d.ts.map +1 -1
- package/dist/esm/core/requests/websockets/useNotificationBadges.js +72 -3
- package/dist/esm/core/requests/websockets/useNotificationBadges.js.map +1 -1
- package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.d.ts +28 -0
- package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.d.ts.map +1 -0
- package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.js +86 -0
- package/dist/esm/core/requests/websockets/usePublishNotificationBadgeCount.js.map +1 -0
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +38 -3
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +57 -2
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.js +4 -2
- package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.js.map +1 -1
- package/dist/esm/core/requests/wildo-http-client.frontend.service.d.ts +30 -1
- package/dist/esm/core/requests/wildo-http-client.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/requests/wildo-http-client.frontend.service.js +47 -4
- package/dist/esm/core/requests/wildo-http-client.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/ResourceRegistryContext.d.ts.map +1 -1
- package/dist/esm/core/resources/ResourceRegistryContext.js +22 -1
- package/dist/esm/core/resources/ResourceRegistryContext.js.map +1 -1
- package/dist/esm/core/resources/context-resource-identifiers.frontend.utils.js +1 -1
- package/dist/esm/core/resources/context-resource-identifiers.frontend.utils.js.map +1 -1
- package/dist/esm/core/resources/frontend-resource.utils.d.ts +22 -1
- package/dist/esm/core/resources/frontend-resource.utils.d.ts.map +1 -1
- package/dist/esm/core/resources/frontend-resource.utils.js +25 -2
- package/dist/esm/core/resources/frontend-resource.utils.js.map +1 -1
- package/dist/esm/core/resources/operation-semantics.frontend.utils.d.ts +113 -13
- package/dist/esm/core/resources/operation-semantics.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/resources/operation-semantics.frontend.utils.js +173 -20
- package/dist/esm/core/resources/operation-semantics.frontend.utils.js.map +1 -1
- package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.d.ts +11 -0
- package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.js +7 -0
- package/dist/esm/core/resources/relationship-surface-runtime.frontend.utils.js.map +1 -1
- package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.d.ts +3 -2
- package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.js +13 -5
- package/dist/esm/core/resources/resource-label-field-paths.frontend.utils.js.map +1 -1
- package/dist/esm/core/resources/resources-repository.frontend.service.d.ts +6 -0
- package/dist/esm/core/resources/resources-repository.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/resources/resources-repository.frontend.service.js +90 -1
- package/dist/esm/core/resources/resources-repository.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/resources.frontend.schemas.d.ts +139 -16
- package/dist/esm/core/resources/resources.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/resources/resources.frontend.schemas.js +110 -11
- package/dist/esm/core/resources/resources.frontend.schemas.js.map +1 -1
- package/dist/esm/core/resources/rmm/ResourceMutationManager.d.ts.map +1 -1
- package/dist/esm/core/resources/rmm/ResourceMutationManager.js +3 -1
- package/dist/esm/core/resources/rmm/ResourceMutationManager.js.map +1 -1
- package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.d.ts +10 -0
- package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.d.ts.map +1 -1
- package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.js +8 -0
- package/dist/esm/core/resources/rmm/update-like-mutation-fallback.frontend.js.map +1 -1
- package/dist/esm/core/resources/rmm/useResourceRMM.d.ts +7 -0
- package/dist/esm/core/resources/rmm/useResourceRMM.d.ts.map +1 -1
- package/dist/esm/core/resources/rmm/useResourceRMM.js +9 -2
- package/dist/esm/core/resources/rmm/useResourceRMM.js.map +1 -1
- package/dist/esm/core/resources/useOperationDirectExecution.d.ts +59 -0
- package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -0
- package/dist/esm/core/resources/useOperationDirectExecution.js +278 -0
- package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -0
- package/dist/esm/core/resources/useResourceOperationActions.d.ts +1 -1
- package/dist/esm/core/resources/useResourceOperationActions.d.ts.map +1 -1
- package/dist/esm/core/resources/useResourceOperationActions.js +69 -22
- package/dist/esm/core/resources/useResourceOperationActions.js.map +1 -1
- package/dist/esm/core/resources/useResourceOperationSurface.d.ts +8 -6
- package/dist/esm/core/resources/useResourceOperationSurface.d.ts.map +1 -1
- package/dist/esm/core/resources/useResourceOperationSurface.js +3 -2
- package/dist/esm/core/resources/useResourceOperationSurface.js.map +1 -1
- package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
- package/dist/esm/core/runtime/AppRouter.js +23 -2
- package/dist/esm/core/runtime/AppRouter.js.map +1 -1
- package/dist/esm/core/runtime/ApplicationContext.shared.d.ts +4 -2
- package/dist/esm/core/runtime/ApplicationContext.shared.d.ts.map +1 -1
- package/dist/esm/core/runtime/ApplicationContext.shared.js.map +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.d.ts +12 -2
- package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.js +5 -2
- package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
- package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts +25 -1
- package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts.map +1 -1
- package/dist/esm/core/runtime/domain-module.frontend.definitions.js +37 -1
- package/dist/esm/core/runtime/domain-module.frontend.definitions.js.map +1 -1
- package/dist/esm/core/runtime/start-application.frontend.service.d.ts +21 -2
- package/dist/esm/core/runtime/start-application.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/start-application.frontend.service.js +51 -4
- package/dist/esm/core/runtime/start-application.frontend.service.js.map +1 -1
- package/dist/esm/core/security/AuthSessionContext.d.ts +11 -0
- package/dist/esm/core/security/AuthSessionContext.d.ts.map +1 -1
- package/dist/esm/core/security/AuthSessionContext.js +70 -22
- package/dist/esm/core/security/AuthSessionContext.js.map +1 -1
- package/dist/esm/core/security/StepUpAuthContext.d.ts.map +1 -1
- package/dist/esm/core/security/StepUpAuthContext.js +10 -2
- package/dist/esm/core/security/StepUpAuthContext.js.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.js +72 -8
- package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
- package/dist/esm/core/security/route-organization-access.frontend.utils.d.ts +7 -0
- package/dist/esm/core/security/route-organization-access.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/security/route-organization-access.frontend.utils.js +8 -2
- package/dist/esm/core/security/route-organization-access.frontend.utils.js.map +1 -1
- package/dist/esm/core/security/useGrantedConsentPurposes.d.ts +30 -0
- package/dist/esm/core/security/useGrantedConsentPurposes.d.ts.map +1 -0
- package/dist/esm/core/security/useGrantedConsentPurposes.js +38 -0
- package/dist/esm/core/security/useGrantedConsentPurposes.js.map +1 -0
- package/dist/esm/core/ui/UIContext.d.ts.map +1 -1
- package/dist/esm/core/ui/UIContext.js +10 -6
- package/dist/esm/core/ui/UIContext.js.map +1 -1
- package/dist/esm/core/ui/color-conversion.utils.d.ts +20 -0
- package/dist/esm/core/ui/color-conversion.utils.d.ts.map +1 -1
- package/dist/esm/core/ui/color-conversion.utils.js +39 -5
- package/dist/esm/core/ui/color-conversion.utils.js.map +1 -1
- package/dist/esm/core/ui/themes/default.theme.d.ts.map +1 -1
- package/dist/esm/core/ui/themes/default.theme.js +22 -2
- package/dist/esm/core/ui/themes/default.theme.js.map +1 -1
- package/dist/esm/core/ui/ui.frontend.schemas.d.ts +6 -6
- package/dist/esm/core/ui/ui.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/ui/ui.frontend.schemas.js +3 -3
- package/dist/esm/core/ui/ui.frontend.schemas.js.map +1 -1
- package/dist/esm/index.d.ts +10 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +19 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/testing/app-shell-placement-coverage.d.ts +43 -0
- package/dist/esm/testing/app-shell-placement-coverage.d.ts.map +1 -0
- package/dist/esm/testing/app-shell-placement-coverage.js +114 -0
- package/dist/esm/testing/app-shell-placement-coverage.js.map +1 -0
- package/dist/esm/testing/mock-builders.d.ts.map +1 -1
- package/dist/esm/testing/mock-builders.js +5 -0
- package/dist/esm/testing/mock-builders.js.map +1 -1
- package/dist/esm/testing.d.ts +1 -0
- package/dist/esm/testing.d.ts.map +1 -1
- package/dist/esm/testing.js +1 -0
- package/dist/esm/testing.js.map +1 -1
- package/package.json +9 -7
- package/dist/esm/core/navigation/useIsStackEntryActive.js +0 -15
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsResourceOperationPanel.js","sourceRoot":"","sources":["../../../../../src/components/settings/SettingsResourceOperationPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAc,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4DAA4D,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAKnG,OAA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AQ,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAE1F,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,CACL,KAAC,2BAA2B,IAC1B,OAAO,EAAE,oCAAoC,YAAY,KAAK,SAAS,IAAI,GAC3E,CACH,CAAC;IACJ,CAAC;IAED,yEAAyE;IACzE,8EAA8E;IAC9E,6EAA6E;IAC7E,wEAAwE;IACxE,mEAAmE;IACnE,OAAO,KAAC,6BAA6B,IAAC,WAAW,EAAE,eAAe,GAAI,CAAC;AACzE,CAAC","sourcesContent":["/**\n * SettingsResourceOperationPanel — renders an auto-generated resource surface\n * inside a Settings Hub section.\n *\n * This is the `RESOURCE_OPERATION` target renderer. It produces the exact same\n * `FrontendResourceOperationContext` a routed resource page would, but sources\n * the scope identifiers from live `AppScope` instead of URL params — that is the\n * whole reason org-scoped resources (members, API keys, billing) can render here\n * without a `/organizations/:organizationId/...` route. The recipe mirrors\n * `ResourcePageWrapper` (core/runtime/AppRouter.tsx) minus URL handling:\n *\n * 1. resolve the resource config + the operation object from the registry\n * 2. build `contextResourceIdentifiers` via the SAME\n * `ScopeUtilsService.buildResourceOperationContextIdentifiers` routed pages\n * use — primary-scope defaults injected from `currentOrganizationId` /\n * `currentUserId`, so an `ORGANIZATIONS`-scoped resource gets\n * `{ organizations: <id> }` automatically\n * 3. derive `parentResourcesRequirements` from those identifiers (the\n * context-identifier variant, since there are no route params to walk)\n * 4. build the operation context and hand it to `SettingsSectionNavigationHost`\n * as the section's ROOT surface\n *\n * The host wraps the surface in a per-section navigation stack so related actions\n * (view/edit/create + their back/post-action) drill WITHIN the panel instead of\n * escaping the hub to the global zones. The hub is overlay content, so the\n * surfaces run in the OVERLAY navigation zone, but the host's scoped controller\n * intercepts their navigation — see `SettingsSectionNavigationHost`.\n *\n * @see SettingsSectionNavigationHost.tsx — the per-section navigation stack\n * @see settings-hub.frontend.schemas.ts — `SettingsResourceOperationTarget`\n * @see core/runtime/AppRouter.tsx — `ResourcePageWrapper`, the routed counterpart\n */\nimport React, { useContext, useMemo } from 'react';\n\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { ApplicationContext } from '~wildo-frontend-lib/core/runtime/ApplicationContext.shared';\nimport { ScopeUtilsService } from '~wildo-frontend-lib/core/scope/scope.utils.frontend.service';\nimport { frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport type {\n AnyFrontendResourceConfiguration,\n FrontendResourceConfiguration_Operation,\n} from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { SettingsSectionNavigationHost } from './SettingsSectionNavigationHost';\n\nexport interface SettingsResourceOperationPanelProps {\n /** Registry resource type (e.g. `organizationMembers`). */\n resourceType: string;\n /** Operation identifier to render (e.g. `list`, `read`). */\n operation: string;\n /** Disambiguates when several operations share the identifier (variant key). */\n operationVariant?: string;\n}\n\n/**\n * Select the operation object matching `operationIdentifier` (+ optional\n * `variantKey`) from a resource config. Mirrors the resolution in\n * `launcher-resolution.ts` (`resolveResourceOperation`): an explicit variant key\n * wins; otherwise prefer the single default, then the single match, else\n * ambiguous → undefined.\n */\nfunction findResourceConfigOperation(\n config: AnyFrontendResourceConfiguration,\n operationIdentifier: string,\n variantKey?: string,\n): FrontendResourceConfiguration_Operation | undefined {\n const operations = Array.isArray(config.operations) ? config.operations : [];\n const matching = operations.filter(op => String(op.operationIdentifier) === operationIdentifier);\n if (matching.length === 0) return undefined;\n\n if (variantKey) {\n return matching.find(op => op.variantKey === variantKey);\n }\n\n const defaults = matching.filter(op => op.isOperationDefault === true);\n if (defaults.length === 1) return defaults[0];\n if (matching.length === 1) return matching[0];\n return undefined;\n}\n\n/** Boundary guard — a misconfigured section must not crash the whole hub. */\nfunction SettingsResourceUnavailable({ message }: { message: string }): React.JSX.Element {\n return <div className=\"p-card text-sm text-muted-foreground\">{message}</div>;\n}\n\nexport function SettingsResourceOperationPanel({\n resourceType,\n operation,\n operationVariant,\n}: SettingsResourceOperationPanelProps): React.JSX.Element {\n const { registry } = useResourceRegistry();\n const appScope = useAppScopeSafe();\n /*\n * The application id comes from APP CONFIG, not from the scope.\n *\n * `AppScopeContext` derives `currentApplicationId` by decoding the access token, and the token's\n * claims carry `userId` and no `applicationId` (measured on the running stack, issue #283), so\n * that value is null in every session. The comment below this hook has always said it injects\n * \"(org/user/app)\" identifiers; the app third never had a value to inject.\n *\n * That was invisible while nothing application-scoped was placed in the hub, and it stops being\n * invisible the moment something is: `primaryScopeToContextIdentifiers` turns the id into the\n * `{ applications: <id> }` context identifier, which is what `buildParentResourcesRequirements`\n * needs to build an APPLICATION-scoped resource's parent edge. Without it the section renders a\n * query with no scope — the section exists, and shows nothing that belongs to this application.\n *\n * Read through `useContext` rather than `useApplication()` because that hook THROWS outside its\n * provider, and a settings panel must not crash the tree that hosts it. The scope value stays as\n * a fallback so adding the claim to the token later needs no second edit here.\n */\n const applicationContext = useContext(ApplicationContext);\n const currentApplicationId = applicationContext?.appIdentity?.applicationId\n ?? appScope?.currentApplicationId\n ?? null;\n\n const resourceContext = useMemo(() => {\n const config = registry.resourceConfigurations[resourceType] as\n | AnyFrontendResourceConfiguration\n | undefined;\n if (!config) return undefined;\n\n const resolvedOperation = findResourceConfigOperation(config, operation, operationVariant);\n if (!resolvedOperation) return undefined;\n\n // Inject the live primary-scope identifiers (org/user/app) so an org-scoped\n // resource resolves to the current organization without a URL param.\n const contextResourceIdentifiers = ScopeUtilsService.buildResourceOperationContextIdentifiers({\n currentUserId: appScope?.currentUserId,\n currentOrganizationId: appScope?.currentOrganizationId,\n currentApplicationId,\n currentAnonymousUserId: appScope?.currentAnonymousUserId,\n primaryScope: config.resourcePrimaryScope,\n liveAppScopeContextResourceIdentifiers: appScope?.buildContextResourceIdentifiers?.(),\n explicitContextResourceIdentifiers: {},\n });\n\n // Derive parent requirements from the injected identifiers (no route params\n // to walk here), so the scoped LIST/READ query carries its org parent edge.\n const parentResourcesRequirements = frontendResourceUtils.buildParentResourcesRequirements(\n resourceType,\n contextResourceIdentifiers,\n registry,\n );\n\n return frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation: resolvedOperation,\n contextResourceIdentifiers,\n parentResourcesRequirements,\n });\n }, [registry, resourceType, operation, operationVariant, appScope, currentApplicationId]);\n\n if (!resourceContext) {\n return (\n <SettingsResourceUnavailable\n message={`Settings surface unavailable for ${resourceType} (${operation}).`}\n />\n );\n }\n\n // Host the surface inside the section's own navigation stack, so related\n // actions (view/edit/create + their back/post-action) drill WITHIN this panel\n // instead of escaping the hub to the global zones (and 404-ing on org-scoped\n // routes that aren't registered). The host installs a scoped navigation\n // controller; the surface beneath renders the current stack level.\n return <SettingsSectionNavigationHost rootContext={resourceContext} />;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SettingsResourceOperationPanel.js","sourceRoot":"","sources":["../../../../../src/components/settings/SettingsResourceOperationPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAc,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4DAA4D,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAKnG,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAWhF;;;;;;GAMG;AACH,SAAS,2BAA2B,CAClC,MAAwC,EACxC,mBAA2B,EAC3B,UAAmB;IAEnB,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CA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E,wEAAwE;IACxE,mEAAmE;IACnE,EAAE;IACF,kGAAkG;IAClG,iGAAiG;IACjG,mGAAmG;IACnG,4FAA4F;IAC5F,8FAA8F;IAC9F,uCAAuC;IACvC,MAAM,OAAO,GAAG;QACd,YAAY;QACZ,SAAS;QACT,gBAAgB,IAAI,EAAE;QACtB,QAAQ,EAAE,qBAAqB,IAAI,EAAE;QACrC,QAAQ,EAAE,aAAa,IAAI,EAAE;QAC7B,oBAAoB,IAAI,EAAE;KAC3B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,OAAO,KAAC,6BAA6B,IAAe,WAAW,EAAE,eAAe,IAArC,OAAO,CAAkC,CAAC;AACvF,CAAC","sourcesContent":["/**\n * SettingsResourceOperationPanel — renders an auto-generated resource surface\n * inside a Settings Hub section.\n *\n * This is the `RESOURCE_OPERATION` target renderer. It produces the exact same\n * `FrontendResourceOperationContext` a routed resource page would, but sources\n * the scope identifiers from live `AppScope` instead of URL params — that is the\n * whole reason org-scoped resources (members, API keys, billing) can render here\n * without a `/organizations/:organizationId/...` route. The recipe mirrors\n * `ResourcePageWrapper` (core/runtime/AppRouter.tsx) minus URL handling:\n *\n * 1. resolve the resource config + the operation object from the registry\n * 2. build `contextResourceIdentifiers` via the SAME\n * `ScopeUtilsService.buildResourceOperationContextIdentifiers` routed pages\n * use — primary-scope defaults injected from `currentOrganizationId` /\n * `currentUserId`, so an `ORGANIZATIONS`-scoped resource gets\n * `{ organizations: <id> }` automatically\n * 3. derive `parentResourcesRequirements` from those identifiers (the\n * context-identifier variant, since there are no route params to walk)\n * 4. build the operation context and hand it to `SettingsSectionNavigationHost`\n * as the section's ROOT surface\n *\n * The host wraps the surface in a per-section navigation stack so related actions\n * (view/edit/create + their back/post-action) drill WITHIN the panel instead of\n * escaping the hub to the global zones. The hub is overlay content, so the\n * surfaces run in the OVERLAY navigation zone, but the host's scoped controller\n * intercepts their navigation — see `SettingsSectionNavigationHost`.\n *\n * @see SettingsSectionNavigationHost.tsx — the per-section navigation stack\n * @see settings-hub.frontend.schemas.ts — `SettingsResourceOperationTarget`\n * @see core/runtime/AppRouter.tsx — `ResourcePageWrapper`, the routed counterpart\n */\nimport React, { useContext, useMemo } from 'react';\n\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { ApplicationContext } from '~wildo-frontend-lib/core/runtime/ApplicationContext.shared';\nimport { ScopeUtilsService } from '~wildo-frontend-lib/core/scope/scope.utils.frontend.service';\nimport { frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport type {\n AnyFrontendResourceConfiguration,\n FrontendResourceConfiguration_Operation,\n} from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { SettingsSectionNavigationHost } from './SettingsSectionNavigationHost';\n\nexport interface SettingsResourceOperationPanelProps {\n /** Registry resource type (e.g. `organizationMembers`). */\n resourceType: string;\n /** Operation identifier to render (e.g. `list`, `read`). */\n operation: string;\n /** Disambiguates when several operations share the identifier (variant key). */\n operationVariant?: string;\n}\n\n/**\n * Select the operation object matching `operationIdentifier` (+ optional\n * `variantKey`) from a resource config. Mirrors the resolution in\n * `launcher-resolution.ts` (`resolveResourceOperation`): an explicit variant key\n * wins; otherwise prefer the single default, then the single match, else\n * ambiguous → undefined.\n */\nfunction findResourceConfigOperation(\n config: AnyFrontendResourceConfiguration,\n operationIdentifier: string,\n variantKey?: string,\n): FrontendResourceConfiguration_Operation | undefined {\n const operations = Array.isArray(config.operations) ? config.operations : [];\n const matching = operations.filter(op => String(op.operationIdentifier) === operationIdentifier);\n if (matching.length === 0) return undefined;\n\n if (variantKey) {\n return matching.find(op => op.variantKey === variantKey);\n }\n\n const defaults = matching.filter(op => op.isOperationDefault === true);\n if (defaults.length === 1) return defaults[0];\n if (matching.length === 1) return matching[0];\n return undefined;\n}\n\n/** Boundary guard — a misconfigured section must not crash the whole hub. */\nfunction SettingsResourceUnavailable({ message }: { message: string }): React.JSX.Element {\n return <div className=\"p-card text-sm text-muted-foreground\">{message}</div>;\n}\n\nexport function SettingsResourceOperationPanel({\n resourceType,\n operation,\n operationVariant,\n}: SettingsResourceOperationPanelProps): React.JSX.Element {\n const { registry } = useResourceRegistry();\n const appScope = useAppScopeSafe();\n /*\n * The application id comes from APP CONFIG, not from the scope.\n *\n * `AppScopeContext` derives `currentApplicationId` by decoding the access token, and the token's\n * claims carry `userId` and no `applicationId` (measured on the running stack, issue #283), so\n * that value is null in every session. The comment below this hook has always said it injects\n * \"(org/user/app)\" identifiers; the app third never had a value to inject.\n *\n * That was invisible while nothing application-scoped was placed in the hub, and it stops being\n * invisible the moment something is: `primaryScopeToContextIdentifiers` turns the id into the\n * `{ applications: <id> }` context identifier, which is what `buildParentResourcesRequirements`\n * needs to build an APPLICATION-scoped resource's parent edge. Without it the section renders a\n * query with no scope — the section exists, and shows nothing that belongs to this application.\n *\n * Read through `useContext` rather than `useApplication()` because that hook THROWS outside its\n * provider, and a settings panel must not crash the tree that hosts it. The scope value stays as\n * a fallback so adding the claim to the token later needs no second edit here.\n */\n const applicationContext = useContext(ApplicationContext);\n const currentApplicationId = applicationContext?.appIdentity?.applicationId\n ?? appScope?.currentApplicationId\n ?? null;\n\n const resourceContext = useMemo(() => {\n const config = registry.resourceConfigurations[resourceType] as\n | AnyFrontendResourceConfiguration\n | undefined;\n if (!config) return undefined;\n\n const resolvedOperation = findResourceConfigOperation(config, operation, operationVariant);\n if (!resolvedOperation) return undefined;\n\n // Inject the live primary-scope identifiers (org/user/app) so an org-scoped\n // resource resolves to the current organization without a URL param.\n const contextResourceIdentifiers = ScopeUtilsService.buildResourceOperationContextIdentifiers({\n currentUserId: appScope?.currentUserId,\n currentOrganizationId: appScope?.currentOrganizationId,\n currentApplicationId,\n currentAnonymousUserId: appScope?.currentAnonymousUserId,\n primaryScope: config.resourcePrimaryScope,\n liveAppScopeContextResourceIdentifiers: appScope?.buildContextResourceIdentifiers?.(),\n explicitContextResourceIdentifiers: {},\n });\n\n // Derive parent requirements from the injected identifiers (no route params\n // to walk here), so the scoped LIST/READ query carries its org parent edge.\n const parentResourcesRequirements = frontendResourceUtils.buildParentResourcesRequirements(\n resourceType,\n contextResourceIdentifiers,\n registry,\n );\n\n return frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation: resolvedOperation,\n contextResourceIdentifiers,\n parentResourcesRequirements,\n });\n }, [registry, resourceType, operation, operationVariant, appScope, currentApplicationId]);\n\n if (!resourceContext) {\n return (\n <SettingsResourceUnavailable\n message={`Settings surface unavailable for ${resourceType} (${operation}).`}\n />\n );\n }\n\n // Host the surface inside the section's own navigation stack, so related\n // actions (view/edit/create + their back/post-action) drill WITHIN this panel\n // instead of escaping the hub to the global zones (and 404-ing on org-scoped\n // routes that aren't registered). The host installs a scoped navigation\n // controller; the surface beneath renders the current stack level.\n //\n // Keyed on what the root ADDRESSES — the scope ids and the operation — because the host seeds its\n // stack from `rootContext` once. The root is rebuilt when the application identity arrives after\n // the hub has mounted (`currentApplicationId` falls back to null until it does), and without a key\n // stack[0] kept the context it mounted with: an application-scoped section querying with no\n // application. Keyed on VALUES, not object identity, so an unrelated re-render never resets a\n // section the reader has drilled into.\n const hostKey = [\n resourceType,\n operation,\n operationVariant ?? '',\n appScope?.currentOrganizationId ?? '',\n appScope?.currentUserId ?? '',\n currentApplicationId ?? '',\n ].join('|');\n return <SettingsSectionNavigationHost key={hostKey} rootContext={resourceContext} />;\n}\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The connections one owner holds, and the one way this screen ends one (#1727).
|
|
3
|
+
*
|
|
4
|
+
* Separated from `AppPage_ConnectedAccountsSettings.tsx` so the component file keeps exporting components (React Fast
|
|
5
|
+
* Refresh) and so the two acts — listing and disconnecting — can be read and pinned apart from the rendering.
|
|
6
|
+
*
|
|
7
|
+
* ## Listed per CONNECTION
|
|
8
|
+
*
|
|
9
|
+
* `GET /connections/linked` answers one entry per connection, not per ref: a vendor served by several refs holds one
|
|
10
|
+
* grant (#1670, #1725), and the credential resource's rows expose only the ref that CREATED each row, which is how a
|
|
11
|
+
* person came to see one Microsoft account per ref.
|
|
12
|
+
*
|
|
13
|
+
* ## Disconnected through the credential resource's OWN delete — never a second door
|
|
14
|
+
*
|
|
15
|
+
* Each row the listing names is deleted with the credential resource's DELETE operation, resolved from the resource
|
|
16
|
+
* registry exactly as any resource surface resolves it. That door already authorizes, asks for step-up where the
|
|
17
|
+
* operation requires it (the resources client's step-up handler), records who revoked the grant, and withdraws it at a
|
|
18
|
+
* vendor that accepts a withdrawal (#545). A bespoke disconnect route would have to repeat each of those, and the first
|
|
19
|
+
* one it forgot would be the gap. One grant is one row for a granted connection, so a disconnect ends one grant.
|
|
20
|
+
*/
|
|
21
|
+
import { CoreResourceType, type LinkedProviderConnectionView } from '@wildo-ai/saas-models';
|
|
22
|
+
import { ExternalProvider_Connection_OwnerScope } from '@wildo-ai/external-connectors-models';
|
|
23
|
+
import type { ResourceRegistryContextType } from '../../core/resources/ResourceRegistryContext';
|
|
24
|
+
import { frontendResourceUtils } from '../../core/resources/frontend-resource.utils';
|
|
25
|
+
/**
|
|
26
|
+
* The credential resource that holds an owner's rows. Total over the two scopes a person can hold connections at; the
|
|
27
|
+
* APPLICATION's credential is authored in the deployment environment and has no rows, so it has no resource here.
|
|
28
|
+
*/
|
|
29
|
+
export declare function credentialResourceTypeForOwner(ownerScope: ExternalProvider_Connection_OwnerScope): CoreResourceType | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The resource DELETE call that removes ONE credential row of this owner — the operation path and the parameters the
|
|
32
|
+
* resources client builds its URL from. `undefined` when the resource or its default API DELETE is not registered in
|
|
33
|
+
* this frontend, which the caller reports rather than guessing a URL.
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildCredentialDeleteCall(input: {
|
|
36
|
+
readonly registry: ResourceRegistryContextType['registry'];
|
|
37
|
+
readonly ownerScope: ExternalProvider_Connection_OwnerScope;
|
|
38
|
+
readonly ownerId: string;
|
|
39
|
+
readonly credentialId: string;
|
|
40
|
+
}): {
|
|
41
|
+
operationPathKey: string;
|
|
42
|
+
contextualParameters: Record<string, string | number>;
|
|
43
|
+
parentResourcesRequirements: ReturnType<typeof frontendResourceUtils.buildParentResourcesRequirements>;
|
|
44
|
+
} | undefined;
|
|
45
|
+
export interface OwnerProviderConnections {
|
|
46
|
+
readonly connections: readonly LinkedProviderConnectionView[];
|
|
47
|
+
readonly loading: boolean;
|
|
48
|
+
/** The listing could not be read — a distinct state from "nothing connected". */
|
|
49
|
+
readonly failed: boolean;
|
|
50
|
+
/** Read the listing again, after anything that changed it. */
|
|
51
|
+
readonly reload: () => void;
|
|
52
|
+
/**
|
|
53
|
+
* End one connection: delete every row it is made of through the credential resource's DELETE, then read the
|
|
54
|
+
* listing again. Rejects when a row could not be deleted — the caller reports it; rows already deleted stay deleted.
|
|
55
|
+
*/
|
|
56
|
+
readonly disconnect: (connection: LinkedProviderConnectionView) => Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
export declare function useOwnerProviderConnections(ownerScope: ExternalProvider_Connection_OwnerScope, ownerId: string | null): OwnerProviderConnections;
|
|
59
|
+
//# sourceMappingURL=useOwnerProviderConnections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOwnerProviderConnections.d.ts","sourceRoot":"","sources":["../../../../../src/components/settings/useOwnerProviderConnections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAEL,gBAAgB,EAIhB,KAAK,4BAA4B,EAClC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAG9F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4DAA4D,CAAC;AAE9G,OAAO,EAAyB,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAI1H;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,sCAAsC,GAAG,gBAAgB,GAAG,SAAS,CAS/H;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAC3D,QAAQ,CAAC,UAAU,EAAE,sCAAsC,CAAC;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,GAAG;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAAC,2BAA2B,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,gCAAgC,CAAC,CAAA;CAAE,GAAG,SAAS,CA2B1M;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,EAAE,SAAS,4BAA4B,EAAE,CAAC;IAC9D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,CAAC,UAAU,EAAE,4BAA4B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAClF;AAED,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,sCAAsC,EAClD,OAAO,EAAE,MAAM,GAAG,IAAI,GACrB,wBAAwB,CAuD1B"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The connections one owner holds, and the one way this screen ends one (#1727).
|
|
3
|
+
*
|
|
4
|
+
* Separated from `AppPage_ConnectedAccountsSettings.tsx` so the component file keeps exporting components (React Fast
|
|
5
|
+
* Refresh) and so the two acts — listing and disconnecting — can be read and pinned apart from the rendering.
|
|
6
|
+
*
|
|
7
|
+
* ## Listed per CONNECTION
|
|
8
|
+
*
|
|
9
|
+
* `GET /connections/linked` answers one entry per connection, not per ref: a vendor served by several refs holds one
|
|
10
|
+
* grant (#1670, #1725), and the credential resource's rows expose only the ref that CREATED each row, which is how a
|
|
11
|
+
* person came to see one Microsoft account per ref.
|
|
12
|
+
*
|
|
13
|
+
* ## Disconnected through the credential resource's OWN delete — never a second door
|
|
14
|
+
*
|
|
15
|
+
* Each row the listing names is deleted with the credential resource's DELETE operation, resolved from the resource
|
|
16
|
+
* registry exactly as any resource surface resolves it. That door already authorizes, asks for step-up where the
|
|
17
|
+
* operation requires it (the resources client's step-up handler), records who revoked the grant, and withdraws it at a
|
|
18
|
+
* vendor that accepts a withdrawal (#545). A bespoke disconnect route would have to repeat each of those, and the first
|
|
19
|
+
* one it forgot would be the gap. One grant is one row for a granted connection, so a disconnect ends one grant.
|
|
20
|
+
*/
|
|
21
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
22
|
+
import { CoreResourceOperation, CoreResourceType, ResourceOperationVariantType, ResourcesConfig_OperationPathUtils, isWildoBackendError, } from '@wildo-ai/saas-models';
|
|
23
|
+
import { ExternalProvider_Connection_OwnerScope } from '@wildo-ai/external-connectors-models';
|
|
24
|
+
import { useResourceRegistry } from '../../core/resources/useResourceRegistry.js';
|
|
25
|
+
import { ScopeUtilsService } from '../../core/scope/scope.utils.frontend.service.js';
|
|
26
|
+
import { FrontendResourceUtils, frontendResourceUtils } from '../../core/resources/frontend-resource.utils.js';
|
|
27
|
+
import { getManualCallsHttpClient } from '../../core/requests/wildo-http-client-manual-calls.frontend.service.js';
|
|
28
|
+
import { clearProviderScopeReauthorizationOffer } from '../../core/external-providers/provider-scope-reauthorization-offers.frontend.js';
|
|
29
|
+
/**
|
|
30
|
+
* The credential resource that holds an owner's rows. Total over the two scopes a person can hold connections at; the
|
|
31
|
+
* APPLICATION's credential is authored in the deployment environment and has no rows, so it has no resource here.
|
|
32
|
+
*/
|
|
33
|
+
export function credentialResourceTypeForOwner(ownerScope) {
|
|
34
|
+
switch (ownerScope) {
|
|
35
|
+
case ExternalProvider_Connection_OwnerScope.USER:
|
|
36
|
+
return CoreResourceType.USER_PROVIDER_CREDENTIALS;
|
|
37
|
+
case ExternalProvider_Connection_OwnerScope.ORGANIZATION:
|
|
38
|
+
return CoreResourceType.ORG_PROVIDER_CREDENTIALS;
|
|
39
|
+
case ExternalProvider_Connection_OwnerScope.APPLICATION:
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The resource DELETE call that removes ONE credential row of this owner — the operation path and the parameters the
|
|
45
|
+
* resources client builds its URL from. `undefined` when the resource or its default API DELETE is not registered in
|
|
46
|
+
* this frontend, which the caller reports rather than guessing a URL.
|
|
47
|
+
*/
|
|
48
|
+
export function buildCredentialDeleteCall(input) {
|
|
49
|
+
const resourceType = credentialResourceTypeForOwner(input.ownerScope);
|
|
50
|
+
if (resourceType === undefined)
|
|
51
|
+
return undefined;
|
|
52
|
+
const config = input.registry.resourceConfigurations[resourceType];
|
|
53
|
+
if (!config)
|
|
54
|
+
return undefined;
|
|
55
|
+
const operation = config.operations.find((candidate) => candidate.operationIdentifier === CoreResourceOperation.DELETE
|
|
56
|
+
&& candidate.isOperationDefault === true
|
|
57
|
+
&& candidate.isBulkOperation !== true
|
|
58
|
+
&& candidate.variantType === ResourceOperationVariantType.API_CALL);
|
|
59
|
+
if (!operation)
|
|
60
|
+
return undefined;
|
|
61
|
+
// The owner is the scope the row lives under, then the row itself — the same identifiers a resource surface of this
|
|
62
|
+
// owner carries, built by the same scope utility.
|
|
63
|
+
const contextResourceIdentifiers = {
|
|
64
|
+
...ScopeUtilsService.buildResourceOperationContextIdentifiers({
|
|
65
|
+
...(input.ownerScope === ExternalProvider_Connection_OwnerScope.USER ? { currentUserId: input.ownerId } : { currentOrganizationId: input.ownerId }),
|
|
66
|
+
primaryScope: config.resourcePrimaryScope,
|
|
67
|
+
explicitContextResourceIdentifiers: {},
|
|
68
|
+
}),
|
|
69
|
+
[resourceType]: input.credentialId,
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
operationPathKey: ResourcesConfig_OperationPathUtils.buildOperationPathKeyFromOperation(operation),
|
|
73
|
+
contextualParameters: FrontendResourceUtils.buildContextualParameters(contextResourceIdentifiers, input.registry),
|
|
74
|
+
parentResourcesRequirements: frontendResourceUtils.buildParentResourcesRequirements(resourceType, contextResourceIdentifiers, input.registry),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export function useOwnerProviderConnections(ownerScope, ownerId) {
|
|
78
|
+
const { registry, doOperation } = useResourceRegistry();
|
|
79
|
+
const [connections, setConnections] = useState([]);
|
|
80
|
+
const [loading, setLoading] = useState(true);
|
|
81
|
+
const [failed, setFailed] = useState(false);
|
|
82
|
+
const [generation, setGeneration] = useState(0);
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (ownerId === null) {
|
|
85
|
+
setConnections([]);
|
|
86
|
+
setLoading(false);
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
let cancelled = false;
|
|
90
|
+
setLoading(true);
|
|
91
|
+
(async () => {
|
|
92
|
+
try {
|
|
93
|
+
const answer = await getManualCallsHttpClient().listLinkedProviderConnections({ ownerScope, ownerId });
|
|
94
|
+
if (!cancelled) {
|
|
95
|
+
setConnections(answer.connections ?? []);
|
|
96
|
+
setFailed(false);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (isWildoBackendError(error))
|
|
101
|
+
throw error;
|
|
102
|
+
if (!cancelled)
|
|
103
|
+
setFailed(true);
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
if (!cancelled)
|
|
107
|
+
setLoading(false);
|
|
108
|
+
}
|
|
109
|
+
})();
|
|
110
|
+
return () => { cancelled = true; };
|
|
111
|
+
}, [ownerScope, ownerId, generation]);
|
|
112
|
+
const reload = useCallback(() => setGeneration((value) => value + 1), []);
|
|
113
|
+
const disconnect = useCallback(async (connection) => {
|
|
114
|
+
if (ownerId === null)
|
|
115
|
+
return;
|
|
116
|
+
try {
|
|
117
|
+
for (const credential of connection.credentials) {
|
|
118
|
+
const call = buildCredentialDeleteCall({ registry, ownerScope, ownerId, credentialId: credential.credentialId });
|
|
119
|
+
if (call === undefined) {
|
|
120
|
+
throw new Error(`No DELETE operation is registered for the ${ownerScope} credential resource in this frontend.`);
|
|
121
|
+
}
|
|
122
|
+
await doOperation(call.operationPathKey, {
|
|
123
|
+
contextualParameters: call.contextualParameters,
|
|
124
|
+
parentResourcesRequirements: call.parentResourcesRequirements,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// An offer to grow a grant that no longer exists is an offer nobody can take.
|
|
128
|
+
clearProviderScopeReauthorizationOffer({ ownerScope, ownerId }, connection.connectionRef);
|
|
129
|
+
}
|
|
130
|
+
finally {
|
|
131
|
+
reload();
|
|
132
|
+
}
|
|
133
|
+
}, [doOperation, ownerId, ownerScope, registry, reload]);
|
|
134
|
+
return { connections, loading, failed, reload, disconnect };
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=useOwnerProviderConnections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOwnerProviderConnections.js","sourceRoot":"","sources":["../../../../../src/components/settings/useOwnerProviderConnections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,4BAA4B,EAC5B,kCAAkC,EAClC,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAE9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F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C,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;gBACjH,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBACvB,MAAM,IAAI,KAAK,CAAC,6CAA6C,UAAU,wCAAwC,CAAC,CAAC;gBACnH,CAAC;gBACD,MAAM,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE;oBACvC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;oBAC/C,2BAA2B,EAAE,IAAI,CAAC,2BAA2B;iBAC9D,CAAC,CAAC;YACL,CAAC;YACD,8EAA8E;YAC9E,sCAAsC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;QAC5F,CAAC;gBAAS,CAAC;YACT,MAAM,EAAE,CAAC;QACX,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAEzD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAC9D,CAAC","sourcesContent":["/**\n * The connections one owner holds, and the one way this screen ends one (#1727).\n *\n * Separated from `AppPage_ConnectedAccountsSettings.tsx` so the component file keeps exporting components (React Fast\n * Refresh) and so the two acts — listing and disconnecting — can be read and pinned apart from the rendering.\n *\n * ## Listed per CONNECTION\n *\n * `GET /connections/linked` answers one entry per connection, not per ref: a vendor served by several refs holds one\n * grant (#1670, #1725), and the credential resource's rows expose only the ref that CREATED each row, which is how a\n * person came to see one Microsoft account per ref.\n *\n * ## Disconnected through the credential resource's OWN delete — never a second door\n *\n * Each row the listing names is deleted with the credential resource's DELETE operation, resolved from the resource\n * registry exactly as any resource surface resolves it. That door already authorizes, asks for step-up where the\n * operation requires it (the resources client's step-up handler), records who revoked the grant, and withdraws it at a\n * vendor that accepts a withdrawal (#545). A bespoke disconnect route would have to repeat each of those, and the first\n * one it forgot would be the gap. One grant is one row for a granted connection, so a disconnect ends one grant.\n */\n\nimport { useCallback, useEffect, useState } from 'react';\nimport {\n CoreResourceOperation,\n CoreResourceType,\n ResourceOperationVariantType,\n ResourcesConfig_OperationPathUtils,\n isWildoBackendError,\n type LinkedProviderConnectionView,\n} from '@wildo-ai/saas-models';\nimport { ExternalProvider_Connection_OwnerScope } from '@wildo-ai/external-connectors-models';\n\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport type { ResourceRegistryContextType } from '~wildo-frontend-lib/core/resources/ResourceRegistryContext';\nimport { ScopeUtilsService } from '~wildo-frontend-lib/core/scope/scope.utils.frontend.service';\nimport { FrontendResourceUtils, frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { getManualCallsHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client-manual-calls.frontend.service';\nimport { clearProviderScopeReauthorizationOffer } from '~wildo-frontend-lib/core/external-providers/provider-scope-reauthorization-offers.frontend';\n\n/**\n * The credential resource that holds an owner's rows. Total over the two scopes a person can hold connections at; the\n * APPLICATION's credential is authored in the deployment environment and has no rows, so it has no resource here.\n */\nexport function credentialResourceTypeForOwner(ownerScope: ExternalProvider_Connection_OwnerScope): CoreResourceType | undefined {\n switch (ownerScope) {\n case ExternalProvider_Connection_OwnerScope.USER:\n return CoreResourceType.USER_PROVIDER_CREDENTIALS;\n case ExternalProvider_Connection_OwnerScope.ORGANIZATION:\n return CoreResourceType.ORG_PROVIDER_CREDENTIALS;\n case ExternalProvider_Connection_OwnerScope.APPLICATION:\n return undefined;\n }\n}\n\n/**\n * The resource DELETE call that removes ONE credential row of this owner — the operation path and the parameters the\n * resources client builds its URL from. `undefined` when the resource or its default API DELETE is not registered in\n * this frontend, which the caller reports rather than guessing a URL.\n */\nexport function buildCredentialDeleteCall(input: {\n readonly registry: ResourceRegistryContextType['registry'];\n readonly ownerScope: ExternalProvider_Connection_OwnerScope;\n readonly ownerId: string;\n readonly credentialId: string;\n}): { operationPathKey: string; contextualParameters: Record<string, string | number>; parentResourcesRequirements: ReturnType<typeof frontendResourceUtils.buildParentResourcesRequirements> } | undefined {\n const resourceType = credentialResourceTypeForOwner(input.ownerScope);\n if (resourceType === undefined) return undefined;\n const config = input.registry.resourceConfigurations[resourceType];\n if (!config) return undefined;\n const operation = config.operations.find((candidate) =>\n candidate.operationIdentifier === CoreResourceOperation.DELETE\n && candidate.isOperationDefault === true\n && candidate.isBulkOperation !== true\n && candidate.variantType === ResourceOperationVariantType.API_CALL);\n if (!operation) return undefined;\n\n // The owner is the scope the row lives under, then the row itself — the same identifiers a resource surface of this\n // owner carries, built by the same scope utility.\n const contextResourceIdentifiers = {\n ...ScopeUtilsService.buildResourceOperationContextIdentifiers({\n ...(input.ownerScope === ExternalProvider_Connection_OwnerScope.USER ? { currentUserId: input.ownerId } : { currentOrganizationId: input.ownerId }),\n primaryScope: config.resourcePrimaryScope,\n explicitContextResourceIdentifiers: {},\n }),\n [resourceType]: input.credentialId,\n };\n return {\n operationPathKey: ResourcesConfig_OperationPathUtils.buildOperationPathKeyFromOperation(operation),\n contextualParameters: FrontendResourceUtils.buildContextualParameters(contextResourceIdentifiers, input.registry),\n parentResourcesRequirements: frontendResourceUtils.buildParentResourcesRequirements(resourceType, contextResourceIdentifiers, input.registry),\n };\n}\n\nexport interface OwnerProviderConnections {\n readonly connections: readonly LinkedProviderConnectionView[];\n readonly loading: boolean;\n /** The listing could not be read — a distinct state from \"nothing connected\". */\n readonly failed: boolean;\n /** Read the listing again, after anything that changed it. */\n readonly reload: () => void;\n /**\n * End one connection: delete every row it is made of through the credential resource's DELETE, then read the\n * listing again. Rejects when a row could not be deleted — the caller reports it; rows already deleted stay deleted.\n */\n readonly disconnect: (connection: LinkedProviderConnectionView) => Promise<void>;\n}\n\nexport function useOwnerProviderConnections(\n ownerScope: ExternalProvider_Connection_OwnerScope,\n ownerId: string | null,\n): OwnerProviderConnections {\n const { registry, doOperation } = useResourceRegistry();\n const [connections, setConnections] = useState<readonly LinkedProviderConnectionView[]>([]);\n const [loading, setLoading] = useState(true);\n const [failed, setFailed] = useState(false);\n const [generation, setGeneration] = useState(0);\n\n useEffect(() => {\n if (ownerId === null) {\n setConnections([]);\n setLoading(false);\n return undefined;\n }\n let cancelled = false;\n setLoading(true);\n (async () => {\n try {\n const answer = await getManualCallsHttpClient().listLinkedProviderConnections({ ownerScope, ownerId });\n if (!cancelled) {\n setConnections(answer.connections ?? []);\n setFailed(false);\n }\n } catch (error: unknown) {\n if (isWildoBackendError(error)) throw error;\n if (!cancelled) setFailed(true);\n } finally {\n if (!cancelled) setLoading(false);\n }\n })();\n return () => { cancelled = true; };\n }, [ownerScope, ownerId, generation]);\n\n const reload = useCallback(() => setGeneration((value) => value + 1), []);\n\n const disconnect = useCallback(async (connection: LinkedProviderConnectionView) => {\n if (ownerId === null) return;\n try {\n for (const credential of connection.credentials) {\n const call = buildCredentialDeleteCall({ registry, ownerScope, ownerId, credentialId: credential.credentialId });\n if (call === undefined) {\n throw new Error(`No DELETE operation is registered for the ${ownerScope} credential resource in this frontend.`);\n }\n await doOperation(call.operationPathKey, {\n contextualParameters: call.contextualParameters,\n parentResourcesRequirements: call.parentResourcesRequirements,\n });\n }\n // An offer to grow a grant that no longer exists is an offer nobody can take.\n clearProviderScopeReauthorizationOffer({ ownerScope, ownerId }, connection.connectionRef);\n } finally {\n reload();\n }\n }, [doOperation, ownerId, ownerScope, registry, reload]);\n\n return { connections, loading, failed, reload, disconnect };\n}\n"]}
|
|
@@ -17,6 +17,11 @@ export interface ChartError {
|
|
|
17
17
|
* Hook to fetch chart data from the backend.
|
|
18
18
|
* Handles loading, error states, and optional auto-refresh.
|
|
19
19
|
*
|
|
20
|
+
* This is the TRANSPORT: it sends exactly the context it is handed and resolves no scope of its own.
|
|
21
|
+
* An organization-scoped chart fetched with no `contextResourceIdentifiers` is refused
|
|
22
|
+
* (`aggregation_scope_unresolved`). To read a resource's declared chart outside a `ChartView`, use
|
|
23
|
+
* `useResourceChartData`, which scopes it the way the rendered chart is scoped (#1944).
|
|
24
|
+
*
|
|
20
25
|
* Uses WildoBackendHttpClient (via getManualCallsHttpClient) which provides:
|
|
21
26
|
* - Correct base URL from environment config
|
|
22
27
|
* - Authentication headers (JWT/session)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-view.utils.d.ts","sourceRoot":"","sources":["../../../../../../src/components/views/chart-view/chart-view.utils.ts"],"names":[],"mappings":"AAAA;;oEAEoE;AAGpE,OAAO,EAAkC,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtG,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQ/E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,wBAAwB,GAAG,IAAI,CAAC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AA0FD
|
|
1
|
+
{"version":3,"file":"chart-view.utils.d.ts","sourceRoot":"","sources":["../../../../../../src/components/views/chart-view/chart-view.utils.ts"],"names":[],"mappings":"AAAA;;oEAEoE;AAGpE,OAAO,EAAkC,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtG,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQ/E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,wBAAwB,GAAG,IAAI,CAAC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AA0FD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,eAAe,GAAG,SAAS,EACvC,iBAAiB,EAAE,MAAM,GAAG,SAAS,EACrC,MAAM,CAAC,EAAE,gBAAgB,EACzB,0BAA0B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;AACvC;;;;;GAKG;AACH,cAAc,GAAE,OAAe,GAC9B,cAAc,CAmJhB"}
|
|
@@ -81,6 +81,11 @@ function buildChartQueryKey(parts) {
|
|
|
81
81
|
* Hook to fetch chart data from the backend.
|
|
82
82
|
* Handles loading, error states, and optional auto-refresh.
|
|
83
83
|
*
|
|
84
|
+
* This is the TRANSPORT: it sends exactly the context it is handed and resolves no scope of its own.
|
|
85
|
+
* An organization-scoped chart fetched with no `contextResourceIdentifiers` is refused
|
|
86
|
+
* (`aggregation_scope_unresolved`). To read a resource's declared chart outside a `ChartView`, use
|
|
87
|
+
* `useResourceChartData`, which scopes it the way the rendered chart is scoped (#1944).
|
|
88
|
+
*
|
|
84
89
|
* Uses WildoBackendHttpClient (via getManualCallsHttpClient) which provides:
|
|
85
90
|
* - Correct base URL from environment config
|
|
86
91
|
* - Authentication headers (JWT/session)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-view.utils.js","sourceRoot":"","sources":["../../../../../../src/components/views/chart-view/chart-view.utils.ts"],"names":[],"mappings":"AAAA;;oEAEoE;AAEpE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAiC,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAA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GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC;IAE7C,2FAA2F;IAC3F,kEAAkE;IAClE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,YAAY,EAAE,CAAC;IAC3C,MAAM,YAAY,GAAG,UAAU,EAAE,SAAS,EAAE,gBAAgB,CAAC;IAC7D,MAAM,aAAa,GAAG,MAAM,CAA4C,SAAS,CAAC,CAAC;IAEnF,SAAS,CAAC,GAAG,EAAE;QACb,6EAA6E;QAC7E,6EAA6E;QAC7E,8EAA8E;QAC9E,2CAA2C;QAC3C,IAAI,CAAC,WAAW,IAAI,CAAC,YAAY;YAAE,OAAO;QAE1C,0EAA0E;QAC1E,8EAA8E;QAC9E,MAAM,WAAW,GAAG,EAAE,CACpB,kBAAkB,CAAC,gBAAgB,EACnC,CAAC,OAAkC,EAAE,EAAE;YACrC,IAAI,OAAO,CAAC,YAAY,KAAK,YAAY,EAAE,CAAC;gBAC1C,0DAA0D;gBAC1D,mDAAmD;gBACnD,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;gBACpC,aAAa,CAAC,OAAO,GAAG,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;YACrD,CAAC;QACH,CAAC,CACF,CAAC;QAEF,OAAO,GAAG,EAAE;YACV,WAAW,EAAE,CAAC;YACd,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;IAE/C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AACtD,CAAC","sourcesContent":["/** ──────────────────────────────────────────────────────────────\n * Chart View Utilities — Data fetching hook + helpers\n * ────────────────────────────────────────────────────────────── */\n\nimport { useState, useEffect, useCallback, useMemo, useRef } from 'react';\nimport { AggregationQueryResponseSchema, type AggregationQueryResponse } from '@wildo-ai/saas-models';\nimport { CoreResourceType } from '@wildo-ai/saas-models';\nimport type { ChartDefinition, ChartInputValues } from '@wildo-ai/saas-models';\nimport { AggregationErrorCode, CoreWebSocketEvent } from '@wildo-ai/saas-models';\nimport { useWebSocket } from '~wildo-frontend-lib/core/requests/websockets/useWebSocket';\nimport { getManualCallsHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client-manual-calls.frontend.service';\nimport { isAbortOrCancelError } from '~wildo-frontend-lib/core/requests/request-cancellation.frontend.utils';\n\n// ── Types ────────────────────────────────────────────────────\n\nexport interface ChartDataState {\n data: AggregationQueryResponse | null;\n loading: boolean;\n error: ChartError | null;\n refetch: () => void;\n}\n\nexport interface ChartError {\n code: string;\n message: string;\n}\n\nfunction resolveOrganizationIdFromContextResourceIdentifiers(\n contextResourceIdentifiers?: Record<string, string>,\n): string | undefined {\n if (!contextResourceIdentifiers) {\n return undefined;\n }\n\n const exactOrganizationId = contextResourceIdentifiers[CoreResourceType.ORGANIZATIONS];\n if (exactOrganizationId) {\n return exactOrganizationId;\n }\n\n const normalizedOrganizationKey = CoreResourceType.ORGANIZATIONS.toLowerCase();\n for (const [key, value] of Object.entries(contextResourceIdentifiers)) {\n if (key.toLowerCase() === normalizedOrganizationKey && value) {\n return value;\n }\n }\n\n return undefined;\n}\n\n// ── Error Parsing ────────────────────────────────────────────\n\nfunction parseChartError(error: unknown): ChartError {\n // Handle errors from WildoBackendHttpClient (already unwrapped from axios)\n if (error && typeof error === 'object') {\n const err = error as Record<string, unknown>;\n const wildoError = err.wildoError as Record<string, unknown> | undefined;\n // Use the FRAMEWORK-classified `customMessageReference` (e.g. `'authorization'`\n // for a 403) as the error code — the interceptor sets it on the error (or on\n // `err.wildoError`). Do NOT read axios's `err.code`: axios assigns the generic\n // `'ERR_BAD_REQUEST'` to EVERY 4xx (403 included), which is not a real\n // `ErrorCustomMessageReference` and resolves no i18n label — so a 403 rendered\n // as `errors_messages.ERR_BAD_REQUEST.msg` (raw key). Fall back to the\n // WildoBackendHttpClient-unwrapped `errorRef`, then `'unknown'`.\n const code = (\n err.customMessageReference\n ?? wildoError?.customMessageReference\n ?? err.errorRef\n ?? 'unknown'\n ) as string;\n const message = (err.message || String(error)) as string;\n return { code, message };\n }\n return { code: 'unknown', message: String(error) };\n}\n\n/**\n * Build an order-independent, value-based key for the inputs that actually\n * determine the chart query (`POST /charts/:ref/data`). The query is defined by\n * the execution ref plus the request payload VALUES — not by the object\n * references that carry them.\n *\n * `ChartView` is a reusable framework surface embedded by hosts (composite\n * views, resource workspaces) that re-render frequently as i18n labels, app\n * scope, and parent data settle. Those hosts hand `useChartData` fresh-but-\n * value-equal `contextResourceIdentifiers` / `inputs` / `urlParamValues`\n * objects on every render. Keying the fetch effect on object identity would\n * therefore abort the in-flight request and fire a new POST on every render —\n * a 6-7×-per-load refetch storm that multiplies every transient backend error\n * into that many user-facing toasts. Keying on this stable VALUE digest makes\n * the hook refetch only when the query genuinely changes.\n */\nfunction buildChartQueryKey(parts: {\n executionChartRef?: string;\n inputs?: ChartInputValues;\n contextResourceIdentifiers?: Record<string, string>;\n urlParamValues?: Record<string, string>;\n}): string {\n const normalizeRecord = (record?: Record<string, unknown>): string =>\n record\n ? Object.keys(record)\n .sort()\n .map((key) => `${key}=${String(record[key])}`)\n .join('&')\n : '';\n\n return [\n parts.executionChartRef ?? '',\n normalizeRecord(parts.inputs as Record<string, unknown> | undefined),\n normalizeRecord(parts.contextResourceIdentifiers),\n normalizeRecord(parts.urlParamValues),\n ].join('|');\n}\n\n// ── Data Fetching Hook ───────────────────────────────────────\n\n/**\n * Hook to fetch chart data from the backend.\n * Handles loading, error states, and optional auto-refresh.\n *\n * Uses WildoBackendHttpClient (via getManualCallsHttpClient) which provides:\n * - Correct base URL from environment config\n * - Authentication headers (JWT/session)\n * - Request interception and error handling\n * - Retry logic and network queue\n */\nexport function useChartData(\n definition: ChartDefinition | undefined,\n executionChartRef: string | undefined,\n inputs?: ChartInputValues,\n contextResourceIdentifiers?: Record<string, string>,\n urlParamValues?: Record<string, string>,\n /**\n * When true, a data-fetch failure degrades LOCALLY (shown in this chart card)\n * without raising the global error toast — for EMBEDDED charts (a tile inside a\n * composite/detail page). See the `silent` note at the fetch call. Default\n * `false`: a STANDALONE chart page keeps surfacing errors globally.\n */\n localErrorOnly: boolean = false,\n): ChartDataState {\n const [data, setData] = useState<AggregationQueryResponse | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<ChartError | null>(null);\n const abortRef = useRef<AbortController | null>(null);\n\n // Latest fetch inputs kept in a ref so the stable `fetchData` callback reads\n // current values WITHOUT being recreated every render. Recreating it on every\n // render is what previously re-fired the fetch effect (refetch storm); see\n // `buildChartQueryKey`.\n const latestFetchInputsRef = useRef({ definition, executionChartRef, inputs, contextResourceIdentifiers, urlParamValues, localErrorOnly });\n latestFetchInputsRef.current = { definition, executionChartRef, inputs, contextResourceIdentifiers, urlParamValues, localErrorOnly };\n\n const fetchData = useCallback(async () => {\n const {\n definition: currentDefinition,\n executionChartRef: currentExecutionChartRef,\n inputs: currentInputs,\n contextResourceIdentifiers: currentContextResourceIdentifiers,\n urlParamValues: currentUrlParamValues,\n localErrorOnly: currentLocalErrorOnly,\n } = latestFetchInputsRef.current;\n\n if (!currentDefinition || !currentExecutionChartRef) {\n abortRef.current?.abort();\n setData(null);\n setError(null);\n setLoading(false);\n return;\n }\n\n // Cancel previous request\n abortRef.current?.abort();\n const controller = new AbortController();\n abortRef.current = controller;\n\n setLoading(true);\n setError(null);\n\n try {\n const httpClient = getManualCallsHttpClient();\n const organizationId = resolveOrganizationIdFromContextResourceIdentifiers(currentContextResourceIdentifiers);\n const queryParams = {\n ...(currentUrlParamValues ?? {}),\n ...(organizationId ? { organizationId } : {}),\n };\n const requestBody = {\n ...(currentInputs && Object.keys(currentInputs).length > 0 ? { inputs: currentInputs } : {}),\n ...(currentContextResourceIdentifiers && Object.keys(currentContextResourceIdentifiers).length > 0\n ? { contextResourceIdentifiers: currentContextResourceIdentifiers }\n : {}),\n };\n const response = await httpClient.getChartData(\n currentExecutionChartRef,\n Object.keys(requestBody).length > 0 ? requestBody : undefined,\n // `silent` is EMBEDDED-vs-STANDALONE, not \"hide errors\":\n // - EMBEDDED chart (a tile inside a composite/detail page; `localErrorOnly`\n // true) → `silent: true` suppresses the global error TOAST so one\n // sub-surface's 403/5xx does not raise a page-level \"Authorization error\".\n // The failure still renders LOCALLY in this chart card (`ChartErrorState`,\n // with retry) — per-widget dashboard error isolation. `silent` suppresses\n // only the user-facing DISPLAY; the error is still EMITTED/logged, so\n // nothing is hidden from observability.\n // - STANDALONE chart page (`localErrorOnly` false) → keeps surfacing through\n // the standard global pipeline: there the chart IS the page, so a\n // page-level error is appropriate.\n //\n // Cancellations never toast in EITHER mode: the response interceptor ignores\n // `axios.isCancel` rejections, so a refetch/unmount `controller.abort()` or a\n // React StrictMode mount→unmount→mount produces no toast and no error. The\n // local `isAbortOrCancelError` guard below is defense-in-depth (the cancel is\n // still rejected to this catch).\n { signal: controller.signal, silent: currentLocalErrorOnly },\n Object.keys(queryParams).length > 0 ? queryParams : undefined,\n );\n const parsedResponse = AggregationQueryResponseSchema.safeParse(response);\n if (!parsedResponse.success) {\n throw new Error(`Invalid aggregation response for chart \"${currentExecutionChartRef}\".`);\n }\n setData(parsedResponse.data);\n } catch (err) {\n // Ignore aborted/cancelled requests (superseded by a newer fetch, or the\n // component unmounted) — they are not real failures. See isAbortOrCancelError:\n // axios rejects a cancellation with `ERR_CANCELED`, not a DOMException, so\n // this must catch the axios shape too or the chart sticks on a cancel error.\n if (isAbortOrCancelError(err)) return;\n setError(parseChartError(err));\n } finally {\n setLoading(false);\n }\n }, []);\n\n // Refetch only when the QUERY changes by VALUE — not when a re-rendering host\n // hands ChartView referentially-fresh but value-equal objects.\n const fetchKey = useMemo(\n () => buildChartQueryKey({ executionChartRef, inputs, contextResourceIdentifiers, urlParamValues }),\n [executionChartRef, inputs, contextResourceIdentifiers, urlParamValues],\n );\n\n useEffect(() => {\n fetchData();\n return () => abortRef.current?.abort();\n }, [fetchKey, fetchData]);\n\n // Auto-refresh (interval-based)\n useEffect(() => {\n const interval = definition?.refreshInterval;\n if (!interval || interval <= 0) return;\n\n const timer = setInterval(fetchData, interval);\n return () => clearInterval(timer);\n }, [definition?.refreshInterval, fetchData]);\n\n // WebSocket real-time re-fetch — subscribe to resource mutations on the main resource type\n // Debounced to prevent excessive refetches during bulk operations\n const { on, isConnected } = useWebSocket();\n const resourceType = definition?.dataQuery?.mainResourceType;\n const wsDebounceRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n useEffect(() => {\n // `resourceType` is derived from `definition.dataQuery.mainResourceType`, so\n // it is truthy iff a definition exists — gating on it alone avoids depending\n // on the referentially-unstable `definition` object (which would re-subscribe\n // the WebSocket listener on every render).\n if (!isConnected || !resourceType) return;\n\n // Subscribe to resource:updated events for the chart's main resource type\n // This ensures the chart refreshes when data changes (create, update, delete)\n const unsubscribe = on(\n CoreWebSocketEvent.RESOURCE_UPDATED,\n (payload: { resourceType?: string }) => {\n if (payload.resourceType === resourceType) {\n // Debounce: wait 500ms after last event before refetching\n // Prevents 50 HTTP requests during bulk operations\n clearTimeout(wsDebounceRef.current);\n wsDebounceRef.current = setTimeout(fetchData, 500);\n }\n },\n );\n\n return () => {\n unsubscribe();\n clearTimeout(wsDebounceRef.current);\n };\n }, [isConnected, resourceType, on, fetchData]);\n\n return { data, loading, error, refetch: fetchData };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chart-view.utils.js","sourceRoot":"","sources":["../../../../../../src/components/views/chart-view/chart-view.utils.ts"],"names":[],"mappings":"AAAA;;oEAEoE;AAEpE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EA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AC;AACtD,CAAC","sourcesContent":["/** ──────────────────────────────────────────────────────────────\n * Chart View Utilities — Data fetching hook + helpers\n * ────────────────────────────────────────────────────────────── */\n\nimport { useState, useEffect, useCallback, useMemo, useRef } from 'react';\nimport { AggregationQueryResponseSchema, type AggregationQueryResponse } from '@wildo-ai/saas-models';\nimport { CoreResourceType } from '@wildo-ai/saas-models';\nimport type { ChartDefinition, ChartInputValues } from '@wildo-ai/saas-models';\nimport { AggregationErrorCode, CoreWebSocketEvent } from '@wildo-ai/saas-models';\nimport { useWebSocket } from '~wildo-frontend-lib/core/requests/websockets/useWebSocket';\nimport { getManualCallsHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client-manual-calls.frontend.service';\nimport { isAbortOrCancelError } from '~wildo-frontend-lib/core/requests/request-cancellation.frontend.utils';\n\n// ── Types ────────────────────────────────────────────────────\n\nexport interface ChartDataState {\n data: AggregationQueryResponse | null;\n loading: boolean;\n error: ChartError | null;\n refetch: () => void;\n}\n\nexport interface ChartError {\n code: string;\n message: string;\n}\n\nfunction resolveOrganizationIdFromContextResourceIdentifiers(\n contextResourceIdentifiers?: Record<string, string>,\n): string | undefined {\n if (!contextResourceIdentifiers) {\n return undefined;\n }\n\n const exactOrganizationId = contextResourceIdentifiers[CoreResourceType.ORGANIZATIONS];\n if (exactOrganizationId) {\n return exactOrganizationId;\n }\n\n const normalizedOrganizationKey = CoreResourceType.ORGANIZATIONS.toLowerCase();\n for (const [key, value] of Object.entries(contextResourceIdentifiers)) {\n if (key.toLowerCase() === normalizedOrganizationKey && value) {\n return value;\n }\n }\n\n return undefined;\n}\n\n// ── Error Parsing ────────────────────────────────────────────\n\nfunction parseChartError(error: unknown): ChartError {\n // Handle errors from WildoBackendHttpClient (already unwrapped from axios)\n if (error && typeof error === 'object') {\n const err = error as Record<string, unknown>;\n const wildoError = err.wildoError as Record<string, unknown> | undefined;\n // Use the FRAMEWORK-classified `customMessageReference` (e.g. `'authorization'`\n // for a 403) as the error code — the interceptor sets it on the error (or on\n // `err.wildoError`). Do NOT read axios's `err.code`: axios assigns the generic\n // `'ERR_BAD_REQUEST'` to EVERY 4xx (403 included), which is not a real\n // `ErrorCustomMessageReference` and resolves no i18n label — so a 403 rendered\n // as `errors_messages.ERR_BAD_REQUEST.msg` (raw key). Fall back to the\n // WildoBackendHttpClient-unwrapped `errorRef`, then `'unknown'`.\n const code = (\n err.customMessageReference\n ?? wildoError?.customMessageReference\n ?? err.errorRef\n ?? 'unknown'\n ) as string;\n const message = (err.message || String(error)) as string;\n return { code, message };\n }\n return { code: 'unknown', message: String(error) };\n}\n\n/**\n * Build an order-independent, value-based key for the inputs that actually\n * determine the chart query (`POST /charts/:ref/data`). The query is defined by\n * the execution ref plus the request payload VALUES — not by the object\n * references that carry them.\n *\n * `ChartView` is a reusable framework surface embedded by hosts (composite\n * views, resource workspaces) that re-render frequently as i18n labels, app\n * scope, and parent data settle. Those hosts hand `useChartData` fresh-but-\n * value-equal `contextResourceIdentifiers` / `inputs` / `urlParamValues`\n * objects on every render. Keying the fetch effect on object identity would\n * therefore abort the in-flight request and fire a new POST on every render —\n * a 6-7×-per-load refetch storm that multiplies every transient backend error\n * into that many user-facing toasts. Keying on this stable VALUE digest makes\n * the hook refetch only when the query genuinely changes.\n */\nfunction buildChartQueryKey(parts: {\n executionChartRef?: string;\n inputs?: ChartInputValues;\n contextResourceIdentifiers?: Record<string, string>;\n urlParamValues?: Record<string, string>;\n}): string {\n const normalizeRecord = (record?: Record<string, unknown>): string =>\n record\n ? Object.keys(record)\n .sort()\n .map((key) => `${key}=${String(record[key])}`)\n .join('&')\n : '';\n\n return [\n parts.executionChartRef ?? '',\n normalizeRecord(parts.inputs as Record<string, unknown> | undefined),\n normalizeRecord(parts.contextResourceIdentifiers),\n normalizeRecord(parts.urlParamValues),\n ].join('|');\n}\n\n// ── Data Fetching Hook ───────────────────────────────────────\n\n/**\n * Hook to fetch chart data from the backend.\n * Handles loading, error states, and optional auto-refresh.\n *\n * This is the TRANSPORT: it sends exactly the context it is handed and resolves no scope of its own.\n * An organization-scoped chart fetched with no `contextResourceIdentifiers` is refused\n * (`aggregation_scope_unresolved`). To read a resource's declared chart outside a `ChartView`, use\n * `useResourceChartData`, which scopes it the way the rendered chart is scoped (#1944).\n *\n * Uses WildoBackendHttpClient (via getManualCallsHttpClient) which provides:\n * - Correct base URL from environment config\n * - Authentication headers (JWT/session)\n * - Request interception and error handling\n * - Retry logic and network queue\n */\nexport function useChartData(\n definition: ChartDefinition | undefined,\n executionChartRef: string | undefined,\n inputs?: ChartInputValues,\n contextResourceIdentifiers?: Record<string, string>,\n urlParamValues?: Record<string, string>,\n /**\n * When true, a data-fetch failure degrades LOCALLY (shown in this chart card)\n * without raising the global error toast — for EMBEDDED charts (a tile inside a\n * composite/detail page). See the `silent` note at the fetch call. Default\n * `false`: a STANDALONE chart page keeps surfacing errors globally.\n */\n localErrorOnly: boolean = false,\n): ChartDataState {\n const [data, setData] = useState<AggregationQueryResponse | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<ChartError | null>(null);\n const abortRef = useRef<AbortController | null>(null);\n\n // Latest fetch inputs kept in a ref so the stable `fetchData` callback reads\n // current values WITHOUT being recreated every render. Recreating it on every\n // render is what previously re-fired the fetch effect (refetch storm); see\n // `buildChartQueryKey`.\n const latestFetchInputsRef = useRef({ definition, executionChartRef, inputs, contextResourceIdentifiers, urlParamValues, localErrorOnly });\n latestFetchInputsRef.current = { definition, executionChartRef, inputs, contextResourceIdentifiers, urlParamValues, localErrorOnly };\n\n const fetchData = useCallback(async () => {\n const {\n definition: currentDefinition,\n executionChartRef: currentExecutionChartRef,\n inputs: currentInputs,\n contextResourceIdentifiers: currentContextResourceIdentifiers,\n urlParamValues: currentUrlParamValues,\n localErrorOnly: currentLocalErrorOnly,\n } = latestFetchInputsRef.current;\n\n if (!currentDefinition || !currentExecutionChartRef) {\n abortRef.current?.abort();\n setData(null);\n setError(null);\n setLoading(false);\n return;\n }\n\n // Cancel previous request\n abortRef.current?.abort();\n const controller = new AbortController();\n abortRef.current = controller;\n\n setLoading(true);\n setError(null);\n\n try {\n const httpClient = getManualCallsHttpClient();\n const organizationId = resolveOrganizationIdFromContextResourceIdentifiers(currentContextResourceIdentifiers);\n const queryParams = {\n ...(currentUrlParamValues ?? {}),\n ...(organizationId ? { organizationId } : {}),\n };\n const requestBody = {\n ...(currentInputs && Object.keys(currentInputs).length > 0 ? { inputs: currentInputs } : {}),\n ...(currentContextResourceIdentifiers && Object.keys(currentContextResourceIdentifiers).length > 0\n ? { contextResourceIdentifiers: currentContextResourceIdentifiers }\n : {}),\n };\n const response = await httpClient.getChartData(\n currentExecutionChartRef,\n Object.keys(requestBody).length > 0 ? requestBody : undefined,\n // `silent` is EMBEDDED-vs-STANDALONE, not \"hide errors\":\n // - EMBEDDED chart (a tile inside a composite/detail page; `localErrorOnly`\n // true) → `silent: true` suppresses the global error TOAST so one\n // sub-surface's 403/5xx does not raise a page-level \"Authorization error\".\n // The failure still renders LOCALLY in this chart card (`ChartErrorState`,\n // with retry) — per-widget dashboard error isolation. `silent` suppresses\n // only the user-facing DISPLAY; the error is still EMITTED/logged, so\n // nothing is hidden from observability.\n // - STANDALONE chart page (`localErrorOnly` false) → keeps surfacing through\n // the standard global pipeline: there the chart IS the page, so a\n // page-level error is appropriate.\n //\n // Cancellations never toast in EITHER mode: the response interceptor ignores\n // `axios.isCancel` rejections, so a refetch/unmount `controller.abort()` or a\n // React StrictMode mount→unmount→mount produces no toast and no error. The\n // local `isAbortOrCancelError` guard below is defense-in-depth (the cancel is\n // still rejected to this catch).\n { signal: controller.signal, silent: currentLocalErrorOnly },\n Object.keys(queryParams).length > 0 ? queryParams : undefined,\n );\n const parsedResponse = AggregationQueryResponseSchema.safeParse(response);\n if (!parsedResponse.success) {\n throw new Error(`Invalid aggregation response for chart \"${currentExecutionChartRef}\".`);\n }\n setData(parsedResponse.data);\n } catch (err) {\n // Ignore aborted/cancelled requests (superseded by a newer fetch, or the\n // component unmounted) — they are not real failures. See isAbortOrCancelError:\n // axios rejects a cancellation with `ERR_CANCELED`, not a DOMException, so\n // this must catch the axios shape too or the chart sticks on a cancel error.\n if (isAbortOrCancelError(err)) return;\n setError(parseChartError(err));\n } finally {\n setLoading(false);\n }\n }, []);\n\n // Refetch only when the QUERY changes by VALUE — not when a re-rendering host\n // hands ChartView referentially-fresh but value-equal objects.\n const fetchKey = useMemo(\n () => buildChartQueryKey({ executionChartRef, inputs, contextResourceIdentifiers, urlParamValues }),\n [executionChartRef, inputs, contextResourceIdentifiers, urlParamValues],\n );\n\n useEffect(() => {\n fetchData();\n return () => abortRef.current?.abort();\n }, [fetchKey, fetchData]);\n\n // Auto-refresh (interval-based)\n useEffect(() => {\n const interval = definition?.refreshInterval;\n if (!interval || interval <= 0) return;\n\n const timer = setInterval(fetchData, interval);\n return () => clearInterval(timer);\n }, [definition?.refreshInterval, fetchData]);\n\n // WebSocket real-time re-fetch — subscribe to resource mutations on the main resource type\n // Debounced to prevent excessive refetches during bulk operations\n const { on, isConnected } = useWebSocket();\n const resourceType = definition?.dataQuery?.mainResourceType;\n const wsDebounceRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n useEffect(() => {\n // `resourceType` is derived from `definition.dataQuery.mainResourceType`, so\n // it is truthy iff a definition exists — gating on it alone avoids depending\n // on the referentially-unstable `definition` object (which would re-subscribe\n // the WebSocket listener on every render).\n if (!isConnected || !resourceType) return;\n\n // Subscribe to resource:updated events for the chart's main resource type\n // This ensures the chart refreshes when data changes (create, update, delete)\n const unsubscribe = on(\n CoreWebSocketEvent.RESOURCE_UPDATED,\n (payload: { resourceType?: string }) => {\n if (payload.resourceType === resourceType) {\n // Debounce: wait 500ms after last event before refetching\n // Prevents 50 HTTP requests during bulk operations\n clearTimeout(wsDebounceRef.current);\n wsDebounceRef.current = setTimeout(fetchData, 500);\n }\n },\n );\n\n return () => {\n unsubscribe();\n clearTimeout(wsDebounceRef.current);\n };\n }, [isConnected, resourceType, on, fetchData]);\n\n return { data, loading, error, refetch: fetchData };\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ChartInputValues } from '@wildo-ai/saas-models';
|
|
2
|
+
import { type ChartDataState } from './chart-view.utils';
|
|
3
|
+
/** @wildo_source:part:start saas.frontend.chart-view.resource-chart-data facet:layer:frontend facet:family:chart-view facet:audience:app-developer */
|
|
4
|
+
/**
|
|
5
|
+
* Read the DATA of a resource's declared chart view, scoped exactly as the rendered chart is.
|
|
6
|
+
*
|
|
7
|
+
* Import from `@wildo-ai/saas-frontend-lib`. Use it when a view needs a chart's numbers without its
|
|
8
|
+
* canvas: KPI tiles, a summary sentence, a count on a badge. It resolves the chart the way an
|
|
9
|
+
* embedded chart does. It finds the resource's `chartViews` entry, turns the entry's declared
|
|
10
|
+
* `primaryScope` (for example the organization) into context from the signed-in session, then
|
|
11
|
+
* fetches.
|
|
12
|
+
*
|
|
13
|
+
* Do not call `useChartData` with a bare `ChartDefinition` for this. That hook is the transport and
|
|
14
|
+
* sends only the context you pass it, so a chart scoped to an organization is refused by the
|
|
15
|
+
* backend with `aggregation_scope_unresolved`.
|
|
16
|
+
*
|
|
17
|
+
* Throws when the resource declares no chart view with that `ref`, the same configuration error an
|
|
18
|
+
* embedded chart raises.
|
|
19
|
+
*
|
|
20
|
+
* @param params.resourceType - the resource whose `chartViews` declares the chart
|
|
21
|
+
* @param params.viewRef - that chart view's `ref`
|
|
22
|
+
* @param params.contextResourceIdentifiers - context you already hold (a parent record's id); merged
|
|
23
|
+
* with what the chart's scope resolves
|
|
24
|
+
* @param params.localErrorOnly - `true` when your view shows the failure itself (a tile), so no
|
|
25
|
+
* page-level error toast is raised
|
|
26
|
+
* @returns `{ data, loading, error, refetch }`; `data.data` holds one row per dimension value, keyed by
|
|
27
|
+
* the query's dimension and measure refs
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const { data, loading, error } = useResourceChartData({
|
|
31
|
+
* resourceType: MyModule_ResourceType.TODOS,
|
|
32
|
+
* viewRef: todosByStatusChartDefinition.ref,
|
|
33
|
+
* localErrorOnly: true,
|
|
34
|
+
* });
|
|
35
|
+
* const total = (data?.data ?? []).reduce((sum, row) => sum + Number(row.count ?? 0), 0);
|
|
36
|
+
*/
|
|
37
|
+
export declare function useResourceChartData(params: {
|
|
38
|
+
/** The resource whose `frontendConfiguration.chartViews` declares the chart. */
|
|
39
|
+
resourceType: string;
|
|
40
|
+
/** The chart view's `ref` on that resource. */
|
|
41
|
+
viewRef: string;
|
|
42
|
+
/** Context the caller already holds; merged with what the chart's scope resolves. */
|
|
43
|
+
contextResourceIdentifiers?: Record<string, string>;
|
|
44
|
+
inputs?: ChartInputValues;
|
|
45
|
+
urlParamValues?: Record<string, string>;
|
|
46
|
+
/** `true` when the caller shows the failure itself (a tile), so no global error toast is raised. */
|
|
47
|
+
localErrorOnly?: boolean;
|
|
48
|
+
}): ChartDataState;
|
|
49
|
+
/** @wildo_source:part:end saas.frontend.chart-view.resource-chart-data */
|
|
50
|
+
//# sourceMappingURL=useResourceChartData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResourceChartData.d.ts","sourceRoot":"","sources":["../../../../../../src/components/views/chart-view/useResourceChartData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQ9D,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAUvE,sJAAsJ;AACtJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAC3C,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,0BAA0B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,oGAAoG;IACpG,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,cAAc,CAmCjB;AACD,0EAA0E"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useResourceRegistry } from '../../../core/resources/useResourceRegistry.js';
|
|
3
|
+
import { buildResolvedInsertedChartDescriptor, buildResourceInsertedChartIdentity, } from '../../../core/config/chart-view.frontend.schemas.js';
|
|
4
|
+
import { useResolvedChartRuntimeDescriptor } from './chart-runtime.utils.js';
|
|
5
|
+
import { useChartData } from './chart-view.utils.js';
|
|
6
|
+
/*
|
|
7
|
+
* Why this exists (framework maintainers, not shipped): `useChartData` is the transport and sends only
|
|
8
|
+
* the context it is handed. Wonder Todos' home KPI tiles read an organization-scoped chart through it,
|
|
9
|
+
* the request went out as `{}`, and the backend answered `403 aggregation_scope_unresolved` while the
|
|
10
|
+
* donut for the SAME chart rendered through `ChartView` two cells away (#1944). The scope resolution
|
|
11
|
+
* lived only inside `ChartView`; this hook is the public door to it.
|
|
12
|
+
*/
|
|
13
|
+
/** @wildo_source:part:start saas.frontend.chart-view.resource-chart-data facet:layer:frontend facet:family:chart-view facet:audience:app-developer */
|
|
14
|
+
/**
|
|
15
|
+
* Read the DATA of a resource's declared chart view, scoped exactly as the rendered chart is.
|
|
16
|
+
*
|
|
17
|
+
* Import from `@wildo-ai/saas-frontend-lib`. Use it when a view needs a chart's numbers without its
|
|
18
|
+
* canvas: KPI tiles, a summary sentence, a count on a badge. It resolves the chart the way an
|
|
19
|
+
* embedded chart does. It finds the resource's `chartViews` entry, turns the entry's declared
|
|
20
|
+
* `primaryScope` (for example the organization) into context from the signed-in session, then
|
|
21
|
+
* fetches.
|
|
22
|
+
*
|
|
23
|
+
* Do not call `useChartData` with a bare `ChartDefinition` for this. That hook is the transport and
|
|
24
|
+
* sends only the context you pass it, so a chart scoped to an organization is refused by the
|
|
25
|
+
* backend with `aggregation_scope_unresolved`.
|
|
26
|
+
*
|
|
27
|
+
* Throws when the resource declares no chart view with that `ref`, the same configuration error an
|
|
28
|
+
* embedded chart raises.
|
|
29
|
+
*
|
|
30
|
+
* @param params.resourceType - the resource whose `chartViews` declares the chart
|
|
31
|
+
* @param params.viewRef - that chart view's `ref`
|
|
32
|
+
* @param params.contextResourceIdentifiers - context you already hold (a parent record's id); merged
|
|
33
|
+
* with what the chart's scope resolves
|
|
34
|
+
* @param params.localErrorOnly - `true` when your view shows the failure itself (a tile), so no
|
|
35
|
+
* page-level error toast is raised
|
|
36
|
+
* @returns `{ data, loading, error, refetch }`; `data.data` holds one row per dimension value, keyed by
|
|
37
|
+
* the query's dimension and measure refs
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const { data, loading, error } = useResourceChartData({
|
|
41
|
+
* resourceType: MyModule_ResourceType.TODOS,
|
|
42
|
+
* viewRef: todosByStatusChartDefinition.ref,
|
|
43
|
+
* localErrorOnly: true,
|
|
44
|
+
* });
|
|
45
|
+
* const total = (data?.data ?? []).reduce((sum, row) => sum + Number(row.count ?? 0), 0);
|
|
46
|
+
*/
|
|
47
|
+
export function useResourceChartData(params) {
|
|
48
|
+
const { resourceType, viewRef, contextResourceIdentifiers, inputs, urlParamValues, localErrorOnly = false } = params;
|
|
49
|
+
const { registry } = useResourceRegistry();
|
|
50
|
+
const chartView = registry.resourceConfigurations[resourceType]
|
|
51
|
+
?.frontendConfiguration
|
|
52
|
+
?.chartViews
|
|
53
|
+
?.find((candidate) => candidate.ref === viewRef);
|
|
54
|
+
if (!chartView) {
|
|
55
|
+
throw new Error(`useResourceChartData: resource "${resourceType}" declares no chart view "${viewRef}".`);
|
|
56
|
+
}
|
|
57
|
+
const runtimeDescriptor = useMemo(() => buildResolvedInsertedChartDescriptor({
|
|
58
|
+
identity: buildResourceInsertedChartIdentity(resourceType, { ref: viewRef }),
|
|
59
|
+
chartView,
|
|
60
|
+
contextResourceIdentifiers: contextResourceIdentifiers ?? {},
|
|
61
|
+
}), [resourceType, viewRef, chartView, contextResourceIdentifiers]);
|
|
62
|
+
const runtime = useResolvedChartRuntimeDescriptor({
|
|
63
|
+
surfaceDefinition: chartView,
|
|
64
|
+
runtimeDescriptor,
|
|
65
|
+
explicitContextResourceIdentifiers: contextResourceIdentifiers,
|
|
66
|
+
explicitInputs: inputs,
|
|
67
|
+
urlParamValues,
|
|
68
|
+
});
|
|
69
|
+
return useChartData(runtime?.chartDefinition, runtime?.executionChartRef, runtime?.resolvedInputs, runtime?.contextResourceIdentifiers, urlParamValues, localErrorOnly);
|
|
70
|
+
}
|
|
71
|
+
/** @wildo_source:part:end saas.frontend.chart-view.resource-chart-data */
|
|
72
|
+
//# sourceMappingURL=useResourceChartData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResourceChartData.js","sourceRoot":"","sources":["../../../../../../src/components/views/chart-view/useResourceChartData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EACL,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAuB,MAAM,oBAAoB,CAAC;AAEvE;;;;;;GAMG;AAEH,sJAAsJ;AACtJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAWpC;IACC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,0BAA0B,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;IACrH,MAAM,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC3C,MAAM,SAAS,GAAG,QAAQ,CAAC,sBAAsB,CAAC,YAAY,CAAC;QAC7D,EAAE,qBAAqB;QACvB,EAAE,UAAU;QACZ,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC;IACnD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,mCAAmC,YAAY,6BAA6B,OAAO,IAAI,CAAC,CAAC;IAC3G,CAAC;IAED,MAAM,iBAAiB,GAAG,OAAO,CAC/B,GAAG,EAAE,CAAC,oCAAoC,CAAC;QACzC,QAAQ,EAAE,kCAAkC,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;QAC5E,SAAS;QACT,0BAA0B,EAAE,0BAA0B,IAAI,EAAE;KAC7D,CAAC,EACF,CAAC,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,0BAA0B,CAAC,CAC/D,CAAC;IACF,MAAM,OAAO,GAAG,iCAAiC,CAAC;QAChD,iBAAiB,EAAE,SAAS;QAC5B,iBAAiB;QACjB,kCAAkC,EAAE,0BAA0B;QAC9D,cAAc,EAAE,MAAM;QACtB,cAAc;KACf,CAAC,CAAC;IAEH,OAAO,YAAY,CACjB,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,0BAA0B,EACnC,cAAc,EACd,cAAc,CACf,CAAC;AACJ,CAAC;AACD,0EAA0E","sourcesContent":["import { useMemo } from 'react';\nimport type { ChartInputValues } from '@wildo-ai/saas-models';\n\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport {\n buildResolvedInsertedChartDescriptor,\n buildResourceInsertedChartIdentity,\n} from '~wildo-frontend-lib/core/config/chart-view.frontend.schemas';\nimport { useResolvedChartRuntimeDescriptor } from './chart-runtime.utils';\nimport { useChartData, type ChartDataState } from './chart-view.utils';\n\n/*\n * Why this exists (framework maintainers, not shipped): `useChartData` is the transport and sends only\n * the context it is handed. Wonder Todos' home KPI tiles read an organization-scoped chart through it,\n * the request went out as `{}`, and the backend answered `403 aggregation_scope_unresolved` while the\n * donut for the SAME chart rendered through `ChartView` two cells away (#1944). The scope resolution\n * lived only inside `ChartView`; this hook is the public door to it.\n */\n\n/** @wildo_source:part:start saas.frontend.chart-view.resource-chart-data facet:layer:frontend facet:family:chart-view facet:audience:app-developer */\n/**\n * Read the DATA of a resource's declared chart view, scoped exactly as the rendered chart is.\n *\n * Import from `@wildo-ai/saas-frontend-lib`. Use it when a view needs a chart's numbers without its\n * canvas: KPI tiles, a summary sentence, a count on a badge. It resolves the chart the way an\n * embedded chart does. It finds the resource's `chartViews` entry, turns the entry's declared\n * `primaryScope` (for example the organization) into context from the signed-in session, then\n * fetches.\n *\n * Do not call `useChartData` with a bare `ChartDefinition` for this. That hook is the transport and\n * sends only the context you pass it, so a chart scoped to an organization is refused by the\n * backend with `aggregation_scope_unresolved`.\n *\n * Throws when the resource declares no chart view with that `ref`, the same configuration error an\n * embedded chart raises.\n *\n * @param params.resourceType - the resource whose `chartViews` declares the chart\n * @param params.viewRef - that chart view's `ref`\n * @param params.contextResourceIdentifiers - context you already hold (a parent record's id); merged\n * with what the chart's scope resolves\n * @param params.localErrorOnly - `true` when your view shows the failure itself (a tile), so no\n * page-level error toast is raised\n * @returns `{ data, loading, error, refetch }`; `data.data` holds one row per dimension value, keyed by\n * the query's dimension and measure refs\n *\n * @example\n * const { data, loading, error } = useResourceChartData({\n * resourceType: MyModule_ResourceType.TODOS,\n * viewRef: todosByStatusChartDefinition.ref,\n * localErrorOnly: true,\n * });\n * const total = (data?.data ?? []).reduce((sum, row) => sum + Number(row.count ?? 0), 0);\n */\nexport function useResourceChartData(params: {\n /** The resource whose `frontendConfiguration.chartViews` declares the chart. */\n resourceType: string;\n /** The chart view's `ref` on that resource. */\n viewRef: string;\n /** Context the caller already holds; merged with what the chart's scope resolves. */\n contextResourceIdentifiers?: Record<string, string>;\n inputs?: ChartInputValues;\n urlParamValues?: Record<string, string>;\n /** `true` when the caller shows the failure itself (a tile), so no global error toast is raised. */\n localErrorOnly?: boolean;\n}): ChartDataState {\n const { resourceType, viewRef, contextResourceIdentifiers, inputs, urlParamValues, localErrorOnly = false } = params;\n const { registry } = useResourceRegistry();\n const chartView = registry.resourceConfigurations[resourceType]\n ?.frontendConfiguration\n ?.chartViews\n ?.find((candidate) => candidate.ref === viewRef);\n if (!chartView) {\n throw new Error(`useResourceChartData: resource \"${resourceType}\" declares no chart view \"${viewRef}\".`);\n }\n\n const runtimeDescriptor = useMemo(\n () => buildResolvedInsertedChartDescriptor({\n identity: buildResourceInsertedChartIdentity(resourceType, { ref: viewRef }),\n chartView,\n contextResourceIdentifiers: contextResourceIdentifiers ?? {},\n }),\n [resourceType, viewRef, chartView, contextResourceIdentifiers],\n );\n const runtime = useResolvedChartRuntimeDescriptor({\n surfaceDefinition: chartView,\n runtimeDescriptor,\n explicitContextResourceIdentifiers: contextResourceIdentifiers,\n explicitInputs: inputs,\n urlParamValues,\n });\n\n return useChartData(\n runtime?.chartDefinition,\n runtime?.executionChartRef,\n runtime?.resolvedInputs,\n runtime?.contextResourceIdentifiers,\n urlParamValues,\n localErrorOnly,\n );\n}\n/** @wildo_source:part:end saas.frontend.chart-view.resource-chart-data */\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/components/views/composite-view/CompositeLayout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,KAAK,EAAE,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"CompositeLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/components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C;IACpB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,QAAQ,EACR,eAAe,EACf,eAAe,EACf,eAAe,GAChB,EAAE,oBAAoB,GAAG,SAAS,CAsElC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import { LabellingTypes } from '@wildo-ai/presets-components-models';
|
|
5
|
+
import { cn } from '../../../core/ui/cn.js';
|
|
5
6
|
import { ContentSectionContainer, } from '../../../components/sections/ContentSectionContainer.js';
|
|
6
7
|
import { buildSectionConfigFromGroup, groupSectionsByAppearance, } from '../../../components/resources/skeleton/section-consolidation.utils.js';
|
|
7
8
|
import { GroupedSectionBody } from '../../../components/resources/skeleton/Section.js';
|
|
@@ -53,7 +54,7 @@ export function CompositeLayout({ className, children, containerConfig, sectionM
|
|
|
53
54
|
tCompositeViewSection,
|
|
54
55
|
]);
|
|
55
56
|
const renderedChildren = useMemo(() => renderGroupedChildren(children, containerConfig, sectionPresentation, sectionMetadata, onSectionChange), [children, containerConfig, sectionPresentation, sectionMetadata, onSectionChange]);
|
|
56
|
-
return (_jsx(SectionPresentationProvider, { value: { sectionEntries: sectionPresentation }, children: _jsx("div", { className: className, "data-composite-layout": true, children: renderedChildren }) }));
|
|
57
|
+
return (_jsx(SectionPresentationProvider, { value: { sectionEntries: sectionPresentation }, children: _jsx("div", { className: cn('flex flex-col gap-section', className), "data-composite-layout": true, children: renderedChildren }) }));
|
|
57
58
|
}
|
|
58
59
|
function renderGroupedChildren(children, containerConfig, sectionPresentation, sectionMetadata, onSectionChange) {
|
|
59
60
|
const grouped = groupSectionsByAppearance(children);
|