@pyric/ui 0.1.0-alpha.10
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/LICENSE +216 -0
- package/README.md +79 -0
- package/dist/agents/ContextWindowUsage.d.ts +67 -0
- package/dist/agents/ContextWindowUsage.d.ts.map +1 -0
- package/dist/agents/ContextWindowUsage.js +115 -0
- package/dist/agents/ContextWindowUsage.js.map +1 -0
- package/dist/agents/EmptyState.d.ts +18 -0
- package/dist/agents/EmptyState.d.ts.map +1 -0
- package/dist/agents/EmptyState.js +11 -0
- package/dist/agents/EmptyState.js.map +1 -0
- package/dist/agents/Fold.d.ts +37 -0
- package/dist/agents/Fold.d.ts.map +1 -0
- package/dist/agents/Fold.js +18 -0
- package/dist/agents/Fold.js.map +1 -0
- package/dist/agents/Modal.d.ts +25 -0
- package/dist/agents/Modal.d.ts.map +1 -0
- package/dist/agents/Modal.js +28 -0
- package/dist/agents/Modal.js.map +1 -0
- package/dist/agents/PulsingDot.d.ts +21 -0
- package/dist/agents/PulsingDot.d.ts.map +1 -0
- package/dist/agents/PulsingDot.js +18 -0
- package/dist/agents/PulsingDot.js.map +1 -0
- package/dist/agents/index.d.ts +15 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +15 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/auth/authApi.d.ts +32 -0
- package/dist/auth/authApi.d.ts.map +1 -0
- package/dist/auth/authApi.js +27 -0
- package/dist/auth/authApi.js.map +1 -0
- package/dist/auth/claims.d.ts +27 -0
- package/dist/auth/claims.d.ts.map +1 -0
- package/dist/auth/claims.js +58 -0
- package/dist/auth/claims.js.map +1 -0
- package/dist/auth/components/AuthProviderToggles.d.ts +31 -0
- package/dist/auth/components/AuthProviderToggles.d.ts.map +1 -0
- package/dist/auth/components/AuthProviderToggles.js +48 -0
- package/dist/auth/components/AuthProviderToggles.js.map +1 -0
- package/dist/auth/components/AuthSignInHelper.d.ts +57 -0
- package/dist/auth/components/AuthSignInHelper.d.ts.map +1 -0
- package/dist/auth/components/AuthSignInHelper.js +69 -0
- package/dist/auth/components/AuthSignInHelper.js.map +1 -0
- package/dist/auth/components/AuthUserForm.d.ts +84 -0
- package/dist/auth/components/AuthUserForm.d.ts.map +1 -0
- package/dist/auth/components/AuthUserForm.js +89 -0
- package/dist/auth/components/AuthUserForm.js.map +1 -0
- package/dist/auth/components/AuthUserList.d.ts +62 -0
- package/dist/auth/components/AuthUserList.d.ts.map +1 -0
- package/dist/auth/components/AuthUserList.js +46 -0
- package/dist/auth/components/AuthUserList.js.map +1 -0
- package/dist/auth/components/ClaimsField.d.ts +22 -0
- package/dist/auth/components/ClaimsField.d.ts.map +1 -0
- package/dist/auth/components/ClaimsField.js +11 -0
- package/dist/auth/components/ClaimsField.js.map +1 -0
- package/dist/auth/components/confirmActions.d.ts +40 -0
- package/dist/auth/components/confirmActions.d.ts.map +1 -0
- package/dist/auth/components/confirmActions.js +49 -0
- package/dist/auth/components/confirmActions.js.map +1 -0
- package/dist/auth/controller.d.ts +73 -0
- package/dist/auth/controller.d.ts.map +1 -0
- package/dist/auth/controller.js +139 -0
- package/dist/auth/controller.js.map +1 -0
- package/dist/auth/hooks/index.d.ts +7 -0
- package/dist/auth/hooks/index.d.ts.map +1 -0
- package/dist/auth/hooks/index.js +7 -0
- package/dist/auth/hooks/index.js.map +1 -0
- package/dist/auth/hooks/useAuthFlowHelper.d.ts +30 -0
- package/dist/auth/hooks/useAuthFlowHelper.d.ts.map +1 -0
- package/dist/auth/hooks/useAuthFlowHelper.js +30 -0
- package/dist/auth/hooks/useAuthFlowHelper.js.map +1 -0
- package/dist/auth/hooks/useAuthProviderConfig.d.ts +37 -0
- package/dist/auth/hooks/useAuthProviderConfig.d.ts.map +1 -0
- package/dist/auth/hooks/useAuthProviderConfig.js +98 -0
- package/dist/auth/hooks/useAuthProviderConfig.js.map +1 -0
- package/dist/auth/hooks/useAuthUserEditor.d.ts +30 -0
- package/dist/auth/hooks/useAuthUserEditor.d.ts.map +1 -0
- package/dist/auth/hooks/useAuthUserEditor.js +27 -0
- package/dist/auth/hooks/useAuthUserEditor.js.map +1 -0
- package/dist/auth/hooks/useAuthUsers.d.ts +38 -0
- package/dist/auth/hooks/useAuthUsers.d.ts.map +1 -0
- package/dist/auth/hooks/useAuthUsers.js +111 -0
- package/dist/auth/hooks/useAuthUsers.js.map +1 -0
- package/dist/auth/index.d.ts +11 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +13 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/providers.d.ts +11 -0
- package/dist/auth/providers.d.ts.map +1 -0
- package/dist/auth/providers.js +28 -0
- package/dist/auth/providers.js.map +1 -0
- package/dist/auth/reducers/userEditor.d.ts +55 -0
- package/dist/auth/reducers/userEditor.d.ts.map +1 -0
- package/dist/auth/reducers/userEditor.js +136 -0
- package/dist/auth/reducers/userEditor.js.map +1 -0
- package/dist/events/components/ActivityActionItems.d.ts +45 -0
- package/dist/events/components/ActivityActionItems.d.ts.map +1 -0
- package/dist/events/components/ActivityActionItems.js +68 -0
- package/dist/events/components/ActivityActionItems.js.map +1 -0
- package/dist/events/components/ActivityGrid.d.ts +65 -0
- package/dist/events/components/ActivityGrid.d.ts.map +1 -0
- package/dist/events/components/ActivityGrid.js +61 -0
- package/dist/events/components/ActivityGrid.js.map +1 -0
- package/dist/events/components/ActivityGridRow.d.ts +31 -0
- package/dist/events/components/ActivityGridRow.d.ts.map +1 -0
- package/dist/events/components/ActivityGridRow.js +23 -0
- package/dist/events/components/ActivityGridRow.js.map +1 -0
- package/dist/events/components/ProposedChangeDiff.d.ts +46 -0
- package/dist/events/components/ProposedChangeDiff.d.ts.map +1 -0
- package/dist/events/components/ProposedChangeDiff.js +60 -0
- package/dist/events/components/ProposedChangeDiff.js.map +1 -0
- package/dist/events/components/format.d.ts +11 -0
- package/dist/events/components/format.d.ts.map +1 -0
- package/dist/events/components/format.js +26 -0
- package/dist/events/components/format.js.map +1 -0
- package/dist/events/components/index.d.ts +6 -0
- package/dist/events/components/index.d.ts.map +1 -0
- package/dist/events/components/index.js +6 -0
- package/dist/events/components/index.js.map +1 -0
- package/dist/events/digest.d.ts +167 -0
- package/dist/events/digest.d.ts.map +1 -0
- package/dist/events/digest.js +426 -0
- package/dist/events/digest.js.map +1 -0
- package/dist/events/hooks/index.d.ts +3 -0
- package/dist/events/hooks/index.d.ts.map +1 -0
- package/dist/events/hooks/index.js +3 -0
- package/dist/events/hooks/index.js.map +1 -0
- package/dist/events/hooks/useActivityDigest.d.ts +27 -0
- package/dist/events/hooks/useActivityDigest.d.ts.map +1 -0
- package/dist/events/hooks/useActivityDigest.js +18 -0
- package/dist/events/hooks/useActivityDigest.js.map +1 -0
- package/dist/events/hooks/useActivityStream.d.ts +44 -0
- package/dist/events/hooks/useActivityStream.d.ts.map +1 -0
- package/dist/events/hooks/useActivityStream.js +38 -0
- package/dist/events/hooks/useActivityStream.js.map +1 -0
- package/dist/events/index.d.ts +15 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +14 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/types.d.ts +160 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/events/types.js +21 -0
- package/dist/events/types.js.map +1 -0
- package/dist/firestore/components/CollectionList.d.ts +22 -0
- package/dist/firestore/components/CollectionList.d.ts.map +1 -0
- package/dist/firestore/components/CollectionList.js +21 -0
- package/dist/firestore/components/CollectionList.js.map +1 -0
- package/dist/firestore/components/DeleteWithConfirm.d.ts +38 -0
- package/dist/firestore/components/DeleteWithConfirm.d.ts.map +1 -0
- package/dist/firestore/components/DeleteWithConfirm.js +33 -0
- package/dist/firestore/components/DeleteWithConfirm.js.map +1 -0
- package/dist/firestore/components/DocumentEditor.d.ts +47 -0
- package/dist/firestore/components/DocumentEditor.d.ts.map +1 -0
- package/dist/firestore/components/DocumentEditor.js +176 -0
- package/dist/firestore/components/DocumentEditor.js.map +1 -0
- package/dist/firestore/components/DocumentList.d.ts +63 -0
- package/dist/firestore/components/DocumentList.d.ts.map +1 -0
- package/dist/firestore/components/DocumentList.js +53 -0
- package/dist/firestore/components/DocumentList.js.map +1 -0
- package/dist/firestore/components/DocumentPreview.d.ts +68 -0
- package/dist/firestore/components/DocumentPreview.d.ts.map +1 -0
- package/dist/firestore/components/DocumentPreview.js +76 -0
- package/dist/firestore/components/DocumentPreview.js.map +1 -0
- package/dist/firestore/components/FieldRenderer.d.ts +17 -0
- package/dist/firestore/components/FieldRenderer.d.ts.map +1 -0
- package/dist/firestore/components/FieldRenderer.js +16 -0
- package/dist/firestore/components/FieldRenderer.js.map +1 -0
- package/dist/firestore/components/QueryBuilder.d.ts +25 -0
- package/dist/firestore/components/QueryBuilder.d.ts.map +1 -0
- package/dist/firestore/components/QueryBuilder.js +78 -0
- package/dist/firestore/components/QueryBuilder.js.map +1 -0
- package/dist/firestore/components/ReferencePicker.d.ts +33 -0
- package/dist/firestore/components/ReferencePicker.d.ts.map +1 -0
- package/dist/firestore/components/ReferencePicker.js +42 -0
- package/dist/firestore/components/ReferencePicker.js.map +1 -0
- package/dist/firestore/components/TreeEntry.d.ts +15 -0
- package/dist/firestore/components/TreeEntry.d.ts.map +1 -0
- package/dist/firestore/components/TreeEntry.js +23 -0
- package/dist/firestore/components/TreeEntry.js.map +1 -0
- package/dist/firestore/components/context.d.ts +18 -0
- package/dist/firestore/components/context.d.ts.map +1 -0
- package/dist/firestore/components/context.js +7 -0
- package/dist/firestore/components/context.js.map +1 -0
- package/dist/firestore/fieldEditors/array.d.ts +3 -0
- package/dist/firestore/fieldEditors/array.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/array.js +16 -0
- package/dist/firestore/fieldEditors/array.js.map +1 -0
- package/dist/firestore/fieldEditors/boolean.d.ts +3 -0
- package/dist/firestore/fieldEditors/boolean.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/boolean.js +13 -0
- package/dist/firestore/fieldEditors/boolean.js.map +1 -0
- package/dist/firestore/fieldEditors/bytes.d.ts +4 -0
- package/dist/firestore/fieldEditors/bytes.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/bytes.js +31 -0
- package/dist/firestore/fieldEditors/bytes.js.map +1 -0
- package/dist/firestore/fieldEditors/geopoint.d.ts +4 -0
- package/dist/firestore/fieldEditors/geopoint.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/geopoint.js +32 -0
- package/dist/firestore/fieldEditors/geopoint.js.map +1 -0
- package/dist/firestore/fieldEditors/map.d.ts +3 -0
- package/dist/firestore/fieldEditors/map.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/map.js +19 -0
- package/dist/firestore/fieldEditors/map.js.map +1 -0
- package/dist/firestore/fieldEditors/null.d.ts +3 -0
- package/dist/firestore/fieldEditors/null.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/null.js +17 -0
- package/dist/firestore/fieldEditors/null.js.map +1 -0
- package/dist/firestore/fieldEditors/number.d.ts +3 -0
- package/dist/firestore/fieldEditors/number.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/number.js +24 -0
- package/dist/firestore/fieldEditors/number.js.map +1 -0
- package/dist/firestore/fieldEditors/reference.d.ts +4 -0
- package/dist/firestore/fieldEditors/reference.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/reference.js +49 -0
- package/dist/firestore/fieldEditors/reference.js.map +1 -0
- package/dist/firestore/fieldEditors/registry.d.ts +16 -0
- package/dist/firestore/fieldEditors/registry.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/registry.js +42 -0
- package/dist/firestore/fieldEditors/registry.js.map +1 -0
- package/dist/firestore/fieldEditors/string.d.ts +3 -0
- package/dist/firestore/fieldEditors/string.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/string.js +13 -0
- package/dist/firestore/fieldEditors/string.js.map +1 -0
- package/dist/firestore/fieldEditors/timestamp.d.ts +4 -0
- package/dist/firestore/fieldEditors/timestamp.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/timestamp.js +52 -0
- package/dist/firestore/fieldEditors/timestamp.js.map +1 -0
- package/dist/firestore/fieldEditors/types.d.ts +64 -0
- package/dist/firestore/fieldEditors/types.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/types.js +2 -0
- package/dist/firestore/fieldEditors/types.js.map +1 -0
- package/dist/firestore/fieldEditors/vector.d.ts +29 -0
- package/dist/firestore/fieldEditors/vector.d.ts.map +1 -0
- package/dist/firestore/fieldEditors/vector.js +93 -0
- package/dist/firestore/fieldEditors/vector.js.map +1 -0
- package/dist/firestore/firestoreApi.d.ts +35 -0
- package/dist/firestore/firestoreApi.d.ts.map +1 -0
- package/dist/firestore/firestoreApi.js +29 -0
- package/dist/firestore/firestoreApi.js.map +1 -0
- package/dist/firestore/hooks/coerceError.d.ts +17 -0
- package/dist/firestore/hooks/coerceError.d.ts.map +1 -0
- package/dist/firestore/hooks/coerceError.js +41 -0
- package/dist/firestore/hooks/coerceError.js.map +1 -0
- package/dist/firestore/hooks/index.d.ts +10 -0
- package/dist/firestore/hooks/index.d.ts.map +1 -0
- package/dist/firestore/hooks/index.js +10 -0
- package/dist/firestore/hooks/index.js.map +1 -0
- package/dist/firestore/hooks/useCollectionList.d.ts +37 -0
- package/dist/firestore/hooks/useCollectionList.d.ts.map +1 -0
- package/dist/firestore/hooks/useCollectionList.js +51 -0
- package/dist/firestore/hooks/useCollectionList.js.map +1 -0
- package/dist/firestore/hooks/useDocumentEditor.d.ts +61 -0
- package/dist/firestore/hooks/useDocumentEditor.d.ts.map +1 -0
- package/dist/firestore/hooks/useDocumentEditor.js +71 -0
- package/dist/firestore/hooks/useDocumentEditor.js.map +1 -0
- package/dist/firestore/hooks/useDocumentList.d.ts +50 -0
- package/dist/firestore/hooks/useDocumentList.d.ts.map +1 -0
- package/dist/firestore/hooks/useDocumentList.js +162 -0
- package/dist/firestore/hooks/useDocumentList.js.map +1 -0
- package/dist/firestore/hooks/useDocumentSubcollections.d.ts +29 -0
- package/dist/firestore/hooks/useDocumentSubcollections.d.ts.map +1 -0
- package/dist/firestore/hooks/useDocumentSubcollections.js +48 -0
- package/dist/firestore/hooks/useDocumentSubcollections.js.map +1 -0
- package/dist/firestore/hooks/useFirestoreCollection.d.ts +14 -0
- package/dist/firestore/hooks/useFirestoreCollection.d.ts.map +1 -0
- package/dist/firestore/hooks/useFirestoreCollection.js +36 -0
- package/dist/firestore/hooks/useFirestoreCollection.js.map +1 -0
- package/dist/firestore/hooks/useFirestoreDoc.d.ts +17 -0
- package/dist/firestore/hooks/useFirestoreDoc.d.ts.map +1 -0
- package/dist/firestore/hooks/useFirestoreDoc.js +35 -0
- package/dist/firestore/hooks/useFirestoreDoc.js.map +1 -0
- package/dist/firestore/hooks/useQueryBuilder.d.ts +51 -0
- package/dist/firestore/hooks/useQueryBuilder.d.ts.map +1 -0
- package/dist/firestore/hooks/useQueryBuilder.js +110 -0
- package/dist/firestore/hooks/useQueryBuilder.js.map +1 -0
- package/dist/firestore/hooks/useRecursiveDelete.d.ts +40 -0
- package/dist/firestore/hooks/useRecursiveDelete.d.ts.map +1 -0
- package/dist/firestore/hooks/useRecursiveDelete.js +44 -0
- package/dist/firestore/hooks/useRecursiveDelete.js.map +1 -0
- package/dist/firestore/hooks/useReferencePicker.d.ts +70 -0
- package/dist/firestore/hooks/useReferencePicker.d.ts.map +1 -0
- package/dist/firestore/hooks/useReferencePicker.js +140 -0
- package/dist/firestore/hooks/useReferencePicker.js.map +1 -0
- package/dist/firestore/import/parseImport.d.ts +55 -0
- package/dist/firestore/import/parseImport.d.ts.map +1 -0
- package/dist/firestore/import/parseImport.js +101 -0
- package/dist/firestore/import/parseImport.js.map +1 -0
- package/dist/firestore/index.d.ts +21 -0
- package/dist/firestore/index.d.ts.map +1 -0
- package/dist/firestore/index.js +29 -0
- package/dist/firestore/index.js.map +1 -0
- package/dist/firestore/reducers/defaults.d.ts +10 -0
- package/dist/firestore/reducers/defaults.d.ts.map +1 -0
- package/dist/firestore/reducers/defaults.js +37 -0
- package/dist/firestore/reducers/defaults.js.map +1 -0
- package/dist/firestore/reducers/documentEditor.d.ts +23 -0
- package/dist/firestore/reducers/documentEditor.d.ts.map +1 -0
- package/dist/firestore/reducers/documentEditor.js +201 -0
- package/dist/firestore/reducers/documentEditor.js.map +1 -0
- package/dist/firestore/reducers/tree.d.ts +28 -0
- package/dist/firestore/reducers/tree.d.ts.map +1 -0
- package/dist/firestore/reducers/tree.js +129 -0
- package/dist/firestore/reducers/tree.js.map +1 -0
- package/dist/firestore/reducers/types.d.ts +115 -0
- package/dist/firestore/reducers/types.d.ts.map +1 -0
- package/dist/firestore/reducers/types.js +2 -0
- package/dist/firestore/reducers/types.js.map +1 -0
- package/dist/firestore/reducers/validation.d.ts +25 -0
- package/dist/firestore/reducers/validation.d.ts.map +1 -0
- package/dist/firestore/reducers/validation.js +121 -0
- package/dist/firestore/reducers/validation.js.map +1 -0
- package/dist/firestore/types.d.ts +77 -0
- package/dist/firestore/types.d.ts.map +1 -0
- package/dist/firestore/types.js +196 -0
- package/dist/firestore/types.js.map +1 -0
- package/dist/firestore/validation/ids.d.ts +23 -0
- package/dist/firestore/validation/ids.d.ts.map +1 -0
- package/dist/firestore/validation/ids.js +46 -0
- package/dist/firestore/validation/ids.js.map +1 -0
- package/dist/firestore/valueEquality.d.ts +4 -0
- package/dist/firestore/valueEquality.d.ts.map +1 -0
- package/dist/firestore/valueEquality.js +44 -0
- package/dist/firestore/valueEquality.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/primitives/Badge.d.ts +28 -0
- package/dist/primitives/Badge.d.ts.map +1 -0
- package/dist/primitives/Badge.js +11 -0
- package/dist/primitives/Badge.js.map +1 -0
- package/dist/primitives/ConfirmDialog.d.ts +42 -0
- package/dist/primitives/ConfirmDialog.d.ts.map +1 -0
- package/dist/primitives/ConfirmDialog.js +61 -0
- package/dist/primitives/ConfirmDialog.js.map +1 -0
- package/dist/primitives/CopyButton.d.ts +28 -0
- package/dist/primitives/CopyButton.d.ts.map +1 -0
- package/dist/primitives/CopyButton.js +27 -0
- package/dist/primitives/CopyButton.js.map +1 -0
- package/dist/primitives/JsonView.d.ts +29 -0
- package/dist/primitives/JsonView.d.ts.map +1 -0
- package/dist/primitives/JsonView.js +56 -0
- package/dist/primitives/JsonView.js.map +1 -0
- package/dist/primitives/SegmentedControl.d.ts +37 -0
- package/dist/primitives/SegmentedControl.d.ts.map +1 -0
- package/dist/primitives/SegmentedControl.js +18 -0
- package/dist/primitives/SegmentedControl.js.map +1 -0
- package/dist/primitives/Toast.d.ts +48 -0
- package/dist/primitives/Toast.d.ts.map +1 -0
- package/dist/primitives/Toast.js +60 -0
- package/dist/primitives/Toast.js.map +1 -0
- package/dist/primitives/VirtualList.d.ts +37 -0
- package/dist/primitives/VirtualList.d.ts.map +1 -0
- package/dist/primitives/VirtualList.js +47 -0
- package/dist/primitives/VirtualList.js.map +1 -0
- package/dist/primitives/hooks/useContainerSize.d.ts +29 -0
- package/dist/primitives/hooks/useContainerSize.d.ts.map +1 -0
- package/dist/primitives/hooks/useContainerSize.js +45 -0
- package/dist/primitives/hooks/useContainerSize.js.map +1 -0
- package/dist/primitives/hooks/useUpdateHighlights.d.ts +18 -0
- package/dist/primitives/hooks/useUpdateHighlights.d.ts.map +1 -0
- package/dist/primitives/hooks/useUpdateHighlights.js +84 -0
- package/dist/primitives/hooks/useUpdateHighlights.js.map +1 -0
- package/dist/primitives/index.d.ts +11 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +11 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/useConfirm.d.ts +34 -0
- package/dist/primitives/useConfirm.d.ts.map +1 -0
- package/dist/primitives/useConfirm.js +63 -0
- package/dist/primitives/useConfirm.js.map +1 -0
- package/dist/rtdb/components/RtdbPathBar.d.ts +31 -0
- package/dist/rtdb/components/RtdbPathBar.d.ts.map +1 -0
- package/dist/rtdb/components/RtdbPathBar.js +47 -0
- package/dist/rtdb/components/RtdbPathBar.js.map +1 -0
- package/dist/rtdb/components/RtdbTree.d.ts +38 -0
- package/dist/rtdb/components/RtdbTree.d.ts.map +1 -0
- package/dist/rtdb/components/RtdbTree.js +104 -0
- package/dist/rtdb/components/RtdbTree.js.map +1 -0
- package/dist/rtdb/editor.d.ts +25 -0
- package/dist/rtdb/editor.d.ts.map +1 -0
- package/dist/rtdb/editor.js +79 -0
- package/dist/rtdb/editor.js.map +1 -0
- package/dist/rtdb/hooks/useRtdbTree.d.ts +33 -0
- package/dist/rtdb/hooks/useRtdbTree.d.ts.map +1 -0
- package/dist/rtdb/hooks/useRtdbTree.js +67 -0
- package/dist/rtdb/hooks/useRtdbTree.js.map +1 -0
- package/dist/rtdb/index.d.ts +17 -0
- package/dist/rtdb/index.d.ts.map +1 -0
- package/dist/rtdb/index.js +21 -0
- package/dist/rtdb/index.js.map +1 -0
- package/dist/rtdb/pathInput.d.ts +28 -0
- package/dist/rtdb/pathInput.d.ts.map +1 -0
- package/dist/rtdb/pathInput.js +40 -0
- package/dist/rtdb/pathInput.js.map +1 -0
- package/dist/rtdb/reducers/tree.d.ts +86 -0
- package/dist/rtdb/reducers/tree.d.ts.map +1 -0
- package/dist/rtdb/reducers/tree.js +131 -0
- package/dist/rtdb/reducers/tree.js.map +1 -0
- package/dist/rtdb/rtdbApi.d.ts +20 -0
- package/dist/rtdb/rtdbApi.d.ts.map +1 -0
- package/dist/rtdb/rtdbApi.js +2 -0
- package/dist/rtdb/rtdbApi.js.map +1 -0
- package/dist/rtdb/values.d.ts +50 -0
- package/dist/rtdb/values.d.ts.map +1 -0
- package/dist/rtdb/values.js +186 -0
- package/dist/rtdb/values.js.map +1 -0
- package/dist/rules/components/DenialInspector.d.ts +18 -0
- package/dist/rules/components/DenialInspector.d.ts.map +1 -0
- package/dist/rules/components/DenialInspector.js +58 -0
- package/dist/rules/components/DenialInspector.js.map +1 -0
- package/dist/rules/components/format.d.ts +56 -0
- package/dist/rules/components/format.d.ts.map +1 -0
- package/dist/rules/components/format.js +137 -0
- package/dist/rules/components/format.js.map +1 -0
- package/dist/rules/components/index.d.ts +4 -0
- package/dist/rules/components/index.d.ts.map +1 -0
- package/dist/rules/components/index.js +4 -0
- package/dist/rules/components/index.js.map +1 -0
- package/dist/rules/components/scope.d.ts +10 -0
- package/dist/rules/components/scope.d.ts.map +1 -0
- package/dist/rules/components/scope.js +72 -0
- package/dist/rules/components/scope.js.map +1 -0
- package/dist/rules/hooks/index.d.ts +2 -0
- package/dist/rules/hooks/index.d.ts.map +1 -0
- package/dist/rules/hooks/index.js +2 -0
- package/dist/rules/hooks/index.js.map +1 -0
- package/dist/rules/hooks/useDenialTrace.d.ts +51 -0
- package/dist/rules/hooks/useDenialTrace.d.ts.map +1 -0
- package/dist/rules/hooks/useDenialTrace.js +58 -0
- package/dist/rules/hooks/useDenialTrace.js.map +1 -0
- package/dist/rules/index.d.ts +14 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +13 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/types.d.ts +75 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/rules/types.js +2 -0
- package/dist/rules/types.js.map +1 -0
- package/dist/storage/collisionRename.d.ts +73 -0
- package/dist/storage/collisionRename.d.ts.map +1 -0
- package/dist/storage/collisionRename.js +113 -0
- package/dist/storage/collisionRename.js.map +1 -0
- package/dist/storage/components/DeleteSelectionWithConfirm.d.ts +66 -0
- package/dist/storage/components/DeleteSelectionWithConfirm.d.ts.map +1 -0
- package/dist/storage/components/DeleteSelectionWithConfirm.js +82 -0
- package/dist/storage/components/DeleteSelectionWithConfirm.js.map +1 -0
- package/dist/storage/components/ObjectBrowser.d.ts +78 -0
- package/dist/storage/components/ObjectBrowser.d.ts.map +1 -0
- package/dist/storage/components/ObjectBrowser.js +60 -0
- package/dist/storage/components/ObjectBrowser.js.map +1 -0
- package/dist/storage/components/ObjectInspector.d.ts +43 -0
- package/dist/storage/components/ObjectInspector.d.ts.map +1 -0
- package/dist/storage/components/ObjectInspector.js +92 -0
- package/dist/storage/components/ObjectInspector.js.map +1 -0
- package/dist/storage/components/PathBreadcrumb.d.ts +30 -0
- package/dist/storage/components/PathBreadcrumb.d.ts.map +1 -0
- package/dist/storage/components/PathBreadcrumb.js +26 -0
- package/dist/storage/components/PathBreadcrumb.js.map +1 -0
- package/dist/storage/components/UploadDropzone.d.ts +50 -0
- package/dist/storage/components/UploadDropzone.d.ts.map +1 -0
- package/dist/storage/components/UploadDropzone.js +109 -0
- package/dist/storage/components/UploadDropzone.js.map +1 -0
- package/dist/storage/folderPlaceholder.d.ts +20 -0
- package/dist/storage/folderPlaceholder.d.ts.map +1 -0
- package/dist/storage/folderPlaceholder.js +34 -0
- package/dist/storage/folderPlaceholder.js.map +1 -0
- package/dist/storage/hooks/index.d.ts +9 -0
- package/dist/storage/hooks/index.d.ts.map +1 -0
- package/dist/storage/hooks/index.js +9 -0
- package/dist/storage/hooks/index.js.map +1 -0
- package/dist/storage/hooks/useMetadataEditor.d.ts +114 -0
- package/dist/storage/hooks/useMetadataEditor.d.ts.map +1 -0
- package/dist/storage/hooks/useMetadataEditor.js +193 -0
- package/dist/storage/hooks/useMetadataEditor.js.map +1 -0
- package/dist/storage/hooks/useObjectUpload.d.ts +105 -0
- package/dist/storage/hooks/useObjectUpload.d.ts.map +1 -0
- package/dist/storage/hooks/useObjectUpload.js +134 -0
- package/dist/storage/hooks/useObjectUpload.js.map +1 -0
- package/dist/storage/hooks/usePathState.d.ts +43 -0
- package/dist/storage/hooks/usePathState.d.ts.map +1 -0
- package/dist/storage/hooks/usePathState.js +42 -0
- package/dist/storage/hooks/usePathState.js.map +1 -0
- package/dist/storage/hooks/useStorageDelete.d.ts +74 -0
- package/dist/storage/hooks/useStorageDelete.d.ts.map +1 -0
- package/dist/storage/hooks/useStorageDelete.js +120 -0
- package/dist/storage/hooks/useStorageDelete.js.map +1 -0
- package/dist/storage/hooks/useStorageList.d.ts +72 -0
- package/dist/storage/hooks/useStorageList.d.ts.map +1 -0
- package/dist/storage/hooks/useStorageList.js +164 -0
- package/dist/storage/hooks/useStorageList.js.map +1 -0
- package/dist/storage/hooks/useStorageObject.d.ts +33 -0
- package/dist/storage/hooks/useStorageObject.d.ts.map +1 -0
- package/dist/storage/hooks/useStorageObject.js +114 -0
- package/dist/storage/hooks/useStorageObject.js.map +1 -0
- package/dist/storage/hooks/useStorageRulesGate.d.ts +116 -0
- package/dist/storage/hooks/useStorageRulesGate.d.ts.map +1 -0
- package/dist/storage/hooks/useStorageRulesGate.js +150 -0
- package/dist/storage/hooks/useStorageRulesGate.js.map +1 -0
- package/dist/storage/hooks/useStorageSelection.d.ts +32 -0
- package/dist/storage/hooks/useStorageSelection.d.ts.map +1 -0
- package/dist/storage/hooks/useStorageSelection.js +55 -0
- package/dist/storage/hooks/useStorageSelection.js.map +1 -0
- package/dist/storage/index.d.ts +11 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +17 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/pendingPrefixes.d.ts +77 -0
- package/dist/storage/pendingPrefixes.d.ts.map +1 -0
- package/dist/storage/pendingPrefixes.js +104 -0
- package/dist/storage/pendingPrefixes.js.map +1 -0
- package/dist/storage/previews.d.ts +51 -0
- package/dist/storage/previews.d.ts.map +1 -0
- package/dist/storage/previews.js +73 -0
- package/dist/storage/previews.js.map +1 -0
- package/dist/storage/storageApi.d.ts +30 -0
- package/dist/storage/storageApi.d.ts.map +1 -0
- package/dist/storage/storageApi.js +20 -0
- package/dist/storage/storageApi.js.map +1 -0
- package/dist/traffic/components/RuleHeatmap.d.ts +34 -0
- package/dist/traffic/components/RuleHeatmap.d.ts.map +1 -0
- package/dist/traffic/components/RuleHeatmap.js +40 -0
- package/dist/traffic/components/RuleHeatmap.js.map +1 -0
- package/dist/traffic/components/TrafficDetail.d.ts +33 -0
- package/dist/traffic/components/TrafficDetail.d.ts.map +1 -0
- package/dist/traffic/components/TrafficDetail.js +28 -0
- package/dist/traffic/components/TrafficDetail.js.map +1 -0
- package/dist/traffic/components/TrafficGroupRow.d.ts +28 -0
- package/dist/traffic/components/TrafficGroupRow.d.ts.map +1 -0
- package/dist/traffic/components/TrafficGroupRow.js +25 -0
- package/dist/traffic/components/TrafficGroupRow.js.map +1 -0
- package/dist/traffic/components/TrafficLineChart.d.ts +37 -0
- package/dist/traffic/components/TrafficLineChart.d.ts.map +1 -0
- package/dist/traffic/components/TrafficLineChart.js +49 -0
- package/dist/traffic/components/TrafficLineChart.js.map +1 -0
- package/dist/traffic/components/TrafficLog.d.ts +52 -0
- package/dist/traffic/components/TrafficLog.d.ts.map +1 -0
- package/dist/traffic/components/TrafficLog.js +34 -0
- package/dist/traffic/components/TrafficLog.js.map +1 -0
- package/dist/traffic/components/TrafficMetricCards.d.ts +26 -0
- package/dist/traffic/components/TrafficMetricCards.d.ts.map +1 -0
- package/dist/traffic/components/TrafficMetricCards.js +24 -0
- package/dist/traffic/components/TrafficMetricCards.js.map +1 -0
- package/dist/traffic/components/TrafficRow.d.ts +40 -0
- package/dist/traffic/components/TrafficRow.d.ts.map +1 -0
- package/dist/traffic/components/TrafficRow.js +27 -0
- package/dist/traffic/components/TrafficRow.js.map +1 -0
- package/dist/traffic/components/TrafficStats.d.ts +18 -0
- package/dist/traffic/components/TrafficStats.d.ts.map +1 -0
- package/dist/traffic/components/TrafficStats.js +19 -0
- package/dist/traffic/components/TrafficStats.js.map +1 -0
- package/dist/traffic/components/TrafficTimeline.d.ts +88 -0
- package/dist/traffic/components/TrafficTimeline.d.ts.map +1 -0
- package/dist/traffic/components/TrafficTimeline.js +86 -0
- package/dist/traffic/components/TrafficTimeline.js.map +1 -0
- package/dist/traffic/components/format.d.ts +13 -0
- package/dist/traffic/components/format.d.ts.map +1 -0
- package/dist/traffic/components/format.js +24 -0
- package/dist/traffic/components/format.js.map +1 -0
- package/dist/traffic/components/index.d.ts +11 -0
- package/dist/traffic/components/index.d.ts.map +1 -0
- package/dist/traffic/components/index.js +11 -0
- package/dist/traffic/components/index.js.map +1 -0
- package/dist/traffic/hooks/index.d.ts +8 -0
- package/dist/traffic/hooks/index.d.ts.map +1 -0
- package/dist/traffic/hooks/index.js +8 -0
- package/dist/traffic/hooks/index.js.map +1 -0
- package/dist/traffic/hooks/useRuleHeatmap.d.ts +33 -0
- package/dist/traffic/hooks/useRuleHeatmap.d.ts.map +1 -0
- package/dist/traffic/hooks/useRuleHeatmap.js +54 -0
- package/dist/traffic/hooks/useRuleHeatmap.js.map +1 -0
- package/dist/traffic/hooks/useTrafficBuckets.d.ts +71 -0
- package/dist/traffic/hooks/useTrafficBuckets.d.ts.map +1 -0
- package/dist/traffic/hooks/useTrafficBuckets.js +74 -0
- package/dist/traffic/hooks/useTrafficBuckets.js.map +1 -0
- package/dist/traffic/hooks/useTrafficFilter.d.ts +40 -0
- package/dist/traffic/hooks/useTrafficFilter.d.ts.map +1 -0
- package/dist/traffic/hooks/useTrafficFilter.js +33 -0
- package/dist/traffic/hooks/useTrafficFilter.js.map +1 -0
- package/dist/traffic/hooks/useTrafficGroups.d.ts +47 -0
- package/dist/traffic/hooks/useTrafficGroups.d.ts.map +1 -0
- package/dist/traffic/hooks/useTrafficGroups.js +73 -0
- package/dist/traffic/hooks/useTrafficGroups.js.map +1 -0
- package/dist/traffic/hooks/useTrafficMetrics.d.ts +66 -0
- package/dist/traffic/hooks/useTrafficMetrics.d.ts.map +1 -0
- package/dist/traffic/hooks/useTrafficMetrics.js +156 -0
- package/dist/traffic/hooks/useTrafficMetrics.js.map +1 -0
- package/dist/traffic/hooks/useTrafficMonitor.d.ts +56 -0
- package/dist/traffic/hooks/useTrafficMonitor.d.ts.map +1 -0
- package/dist/traffic/hooks/useTrafficMonitor.js +58 -0
- package/dist/traffic/hooks/useTrafficMonitor.js.map +1 -0
- package/dist/traffic/hooks/useTrafficStats.d.ts +32 -0
- package/dist/traffic/hooks/useTrafficStats.d.ts.map +1 -0
- package/dist/traffic/hooks/useTrafficStats.js +45 -0
- package/dist/traffic/hooks/useTrafficStats.js.map +1 -0
- package/dist/traffic/index.d.ts +4 -0
- package/dist/traffic/index.d.ts.map +1 -0
- package/dist/traffic/index.js +3 -0
- package/dist/traffic/index.js.map +1 -0
- package/dist/traffic/types.d.ts +72 -0
- package/dist/traffic/types.d.ts.map +1 -0
- package/dist/traffic/types.js +10 -0
- package/dist/traffic/types.js.map +1 -0
- package/package.json +127 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RTDB path + value helpers (pure). Paths are ALWAYS normalized to the
|
|
3
|
+
* `'/'`-rooted form (`'/'` for the root, `'/a/b'` otherwise) so every module in
|
|
4
|
+
* this package — the tree reducer, the path bar, the viewer components — agrees
|
|
5
|
+
* on what a path is.
|
|
6
|
+
*/
|
|
7
|
+
export function normalizeRtdbPath(path) {
|
|
8
|
+
const segments = path.split('/').filter(Boolean);
|
|
9
|
+
return segments.length === 0 ? '/' : `/${segments.join('/')}`;
|
|
10
|
+
}
|
|
11
|
+
export function rtdbPathSegments(path) {
|
|
12
|
+
return normalizeRtdbPath(path).split('/').filter(Boolean);
|
|
13
|
+
}
|
|
14
|
+
export function joinRtdbPath(base, child) {
|
|
15
|
+
return normalizeRtdbPath([...rtdbPathSegments(base), ...child.split('/').filter(Boolean)].join('/'));
|
|
16
|
+
}
|
|
17
|
+
export function parentRtdbPath(path) {
|
|
18
|
+
const segments = rtdbPathSegments(path);
|
|
19
|
+
if (segments.length <= 1)
|
|
20
|
+
return '/';
|
|
21
|
+
return `/${segments.slice(0, -1).join('/')}`;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The path of `target` RELATIVE to `base`, or `null` when `target` is not
|
|
25
|
+
* `base` or one of its descendants. `'/'` means "target IS base". Lets the
|
|
26
|
+
* tree address nodes by absolute database path while the loaded value sits at
|
|
27
|
+
* the view root.
|
|
28
|
+
*/
|
|
29
|
+
export function relativeRtdbPath(base, target) {
|
|
30
|
+
const baseSegs = rtdbPathSegments(base);
|
|
31
|
+
const targetSegs = rtdbPathSegments(target);
|
|
32
|
+
if (targetSegs.length < baseSegs.length)
|
|
33
|
+
return null;
|
|
34
|
+
for (let i = 0; i < baseSegs.length; i++) {
|
|
35
|
+
if (targetSegs[i] !== baseSegs[i])
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const rest = targetSegs.slice(baseSegs.length);
|
|
39
|
+
return rest.length === 0 ? '/' : `/${rest.join('/')}`;
|
|
40
|
+
}
|
|
41
|
+
export function isRtdbObjectValue(value) {
|
|
42
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Normalize a snapshot value to RTDB semantics before it enters tree state:
|
|
46
|
+
* an empty object IS null (RTDB has no empty containers — the server prunes
|
|
47
|
+
* them), so `{}` — and any object whose children all normalize away — becomes
|
|
48
|
+
* `null`. Without this, an empty database's root value `{}` fails
|
|
49
|
+
* `hasRtdbChildren` and renders as a scalar leaf (`String({})` →
|
|
50
|
+
* `"[object Object]"`). Reuses the input object when nothing changed.
|
|
51
|
+
*/
|
|
52
|
+
export function normalizeRtdbSnapshotValue(value) {
|
|
53
|
+
if (value === null || value === undefined)
|
|
54
|
+
return null;
|
|
55
|
+
if (typeof value !== 'object')
|
|
56
|
+
return value;
|
|
57
|
+
const record = value;
|
|
58
|
+
let changed = false;
|
|
59
|
+
const next = {};
|
|
60
|
+
for (const [key, child] of Object.entries(record)) {
|
|
61
|
+
const normalized = normalizeRtdbSnapshotValue(child);
|
|
62
|
+
if (normalized === null) {
|
|
63
|
+
changed = true;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (normalized !== child)
|
|
67
|
+
changed = true;
|
|
68
|
+
next[key] = normalized;
|
|
69
|
+
}
|
|
70
|
+
if (Object.keys(next).length === 0)
|
|
71
|
+
return null;
|
|
72
|
+
return changed ? next : value;
|
|
73
|
+
}
|
|
74
|
+
/** Leaf value text, console style: strings quoted, primitives literal.
|
|
75
|
+
* Defensive on objects: never `String`-coerce (that's `[object Object]`) —
|
|
76
|
+
* fall back to JSON. Object values should have been normalized/expanded away
|
|
77
|
+
* before reaching a leaf label; this keeps the label honest if one slips in. */
|
|
78
|
+
export function formatRtdbValueLabel(value) {
|
|
79
|
+
if (typeof value === 'string')
|
|
80
|
+
return JSON.stringify(value);
|
|
81
|
+
if (value === null || value === undefined)
|
|
82
|
+
return 'null';
|
|
83
|
+
if (typeof value === 'object') {
|
|
84
|
+
try {
|
|
85
|
+
return JSON.stringify(value) ?? 'null';
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return 'null';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return String(value);
|
|
92
|
+
}
|
|
93
|
+
/** Does this value render as a PARENT node (has child keys)? RTDB has no true
|
|
94
|
+
* arrays — an array is an object with numeric keys, and renders as one. */
|
|
95
|
+
export function hasRtdbChildren(value) {
|
|
96
|
+
if (value === null || typeof value !== 'object')
|
|
97
|
+
return false;
|
|
98
|
+
return Object.keys(value).length > 0;
|
|
99
|
+
}
|
|
100
|
+
/** Child entries sorted RTDB-console style: numeric-aware key order
|
|
101
|
+
* (`2` before `10`), then lexicographic. */
|
|
102
|
+
export function rtdbChildEntries(value) {
|
|
103
|
+
if (value === null || typeof value !== 'object')
|
|
104
|
+
return [];
|
|
105
|
+
return Object.entries(value).sort(([a], [b]) => a.localeCompare(b, undefined, { numeric: true }));
|
|
106
|
+
}
|
|
107
|
+
export function rtdbValueAt(root, path) {
|
|
108
|
+
let value = root ?? null;
|
|
109
|
+
for (const segment of rtdbPathSegments(path)) {
|
|
110
|
+
if (value === null || typeof value !== 'object')
|
|
111
|
+
return null;
|
|
112
|
+
value = value[segment] ?? null;
|
|
113
|
+
}
|
|
114
|
+
return value;
|
|
115
|
+
}
|
|
116
|
+
export function formatRtdbJson(value) {
|
|
117
|
+
return JSON.stringify(value ?? null, null, 2);
|
|
118
|
+
}
|
|
119
|
+
export function parseRtdbJson(value) {
|
|
120
|
+
const text = value.trim();
|
|
121
|
+
return text.length === 0 ? null : JSON.parse(text);
|
|
122
|
+
}
|
|
123
|
+
export function rtdbValueKind(value) {
|
|
124
|
+
if (value === null || value === undefined)
|
|
125
|
+
return 'null';
|
|
126
|
+
if (Array.isArray(value))
|
|
127
|
+
return 'array';
|
|
128
|
+
return typeof value;
|
|
129
|
+
}
|
|
130
|
+
/** Structural equality for JSON-shaped RTDB snapshots and row fingerprints. */
|
|
131
|
+
export function rtdbValuesEqual(previous, next) {
|
|
132
|
+
if (Object.is(previous, next))
|
|
133
|
+
return true;
|
|
134
|
+
if (Array.isArray(previous) || Array.isArray(next)) {
|
|
135
|
+
if (!Array.isArray(previous) || !Array.isArray(next))
|
|
136
|
+
return false;
|
|
137
|
+
if (previous.length !== next.length)
|
|
138
|
+
return false;
|
|
139
|
+
return previous.every((value, index) => rtdbValuesEqual(value, next[index]));
|
|
140
|
+
}
|
|
141
|
+
if (previous === null ||
|
|
142
|
+
next === null ||
|
|
143
|
+
typeof previous !== 'object' ||
|
|
144
|
+
typeof next !== 'object') {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
const previousRecord = previous;
|
|
148
|
+
const nextRecord = next;
|
|
149
|
+
const previousKeys = Object.keys(previousRecord);
|
|
150
|
+
const nextKeys = Object.keys(nextRecord);
|
|
151
|
+
if (previousKeys.length !== nextKeys.length)
|
|
152
|
+
return false;
|
|
153
|
+
return previousKeys.every((key) => key in nextRecord && rtdbValuesEqual(previousRecord[key], nextRecord[key]));
|
|
154
|
+
}
|
|
155
|
+
/** One comparison fingerprint per RTDB row. Parent fingerprints contain only
|
|
156
|
+
* direct child keys, so leaf changes remain local while additions/removals
|
|
157
|
+
* also light the immediate parent. */
|
|
158
|
+
export function rtdbUpdateEntries(value, rootPath) {
|
|
159
|
+
const entries = new Map();
|
|
160
|
+
const visit = (current, path) => {
|
|
161
|
+
if (!hasRtdbChildren(current)) {
|
|
162
|
+
entries.set(path, ['leaf', current ?? null]);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const children = rtdbChildEntries(current);
|
|
166
|
+
entries.set(path, ['parent', children.map(([key]) => key)]);
|
|
167
|
+
for (const [key, child] of children)
|
|
168
|
+
visit(child, joinRtdbPath(path, key));
|
|
169
|
+
};
|
|
170
|
+
visit(value, normalizeRtdbPath(rootPath));
|
|
171
|
+
return entries;
|
|
172
|
+
}
|
|
173
|
+
export function previewRtdbValue(value) {
|
|
174
|
+
if (value === null || value === undefined)
|
|
175
|
+
return 'null';
|
|
176
|
+
if (Array.isArray(value))
|
|
177
|
+
return `${value.length} items`;
|
|
178
|
+
if (isRtdbObjectValue(value)) {
|
|
179
|
+
const count = Object.keys(value).length;
|
|
180
|
+
return count === 1 ? '1 child' : `${count} children`;
|
|
181
|
+
}
|
|
182
|
+
if (typeof value === 'string')
|
|
183
|
+
return JSON.stringify(value);
|
|
184
|
+
return String(value);
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/rtdb/values.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAA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AAG,EAAE,KAAK,CAAC,IAAI,QAAQ;YAAE,KAAK,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC;IACF,KAAK,CAAC,KAAK,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACzD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;IACzD,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;QACxC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,WAAW,CAAC;IACvD,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DenialInspectorProps } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Headless inspector for a single denied Firestore request. Renders, per
|
|
4
|
+
* the `denial-inspector-spec`:
|
|
5
|
+
* - the plain-language reason (`data-pyric-denial-reason`)
|
|
6
|
+
* - the rule source, line-marked (`data-pyric-rule-source`, per-line
|
|
7
|
+
* `data-pyric-line-verdict="deny|allow|skip"`)
|
|
8
|
+
* - the expression step-through (`data-pyric-trace` + per-node hooks)
|
|
9
|
+
* - data in scope (`data-pyric-scope`, `-scope-var`, `-scope-hit`)
|
|
10
|
+
* - the re-run / verify loop (`data-pyric-rerun`)
|
|
11
|
+
* - the cluster of sibling denials (`data-pyric-denial-cluster`)
|
|
12
|
+
* - path resolution for no-match denials (`data-pyric-path-resolution`)
|
|
13
|
+
*
|
|
14
|
+
* Zero styling — every visual decision is a consumer's via the
|
|
15
|
+
* `data-pyric-*` hooks. `mocks/c-debug.html` is the CSS spec.
|
|
16
|
+
*/
|
|
17
|
+
export declare function DenialInspector({ denial, cluster, onRerunAs, onTestEditedRule, onSelectCluster, className, }: DenialInspectorProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=DenialInspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DenialInspector.d.ts","sourceRoot":"","sources":["../../../src/rules/components/DenialInspector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAU,oBAAoB,EAAkB,MAAM,aAAa,CAAC;AAyEhF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,SAAS,GACV,EAAE,oBAAoB,+BAkItB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { denialReason, markRuleLines, decidingEvaluation, formatValue, traceDepth, } from './format.js';
|
|
3
|
+
import { scopeVars } from './scope.js';
|
|
4
|
+
function lensUid(denial) {
|
|
5
|
+
const lens = denial.lens;
|
|
6
|
+
if (lens && typeof lens === 'object' && 'as' in lens)
|
|
7
|
+
return lens.as;
|
|
8
|
+
return denial.auth?.uid;
|
|
9
|
+
}
|
|
10
|
+
/** Render one scope value, underlining the keys the rule read. */
|
|
11
|
+
function ScopeValue({ value, hits }) {
|
|
12
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) {
|
|
13
|
+
return _jsx(_Fragment, { children: formatValue(value) });
|
|
14
|
+
}
|
|
15
|
+
const entries = Object.entries(value);
|
|
16
|
+
const hitSet = new Set(hits);
|
|
17
|
+
return (_jsxs(_Fragment, { children: ['{ ', entries.map(([k, v], i) => (_jsxs("span", { children: [i > 0 ? ', ' : '', k, ":", ' ', hitSet.has(k) ? (_jsx("span", { "data-pyric-scope-hit": "", children: formatValue(v) })) : (formatValue(v))] }, k))), ' }'] }));
|
|
18
|
+
}
|
|
19
|
+
/** The step-through evaluation: each sub-expression and its real value. */
|
|
20
|
+
function EvaluationTrace({ trace }) {
|
|
21
|
+
return (_jsx("div", { "data-pyric-trace": "", children: trace.map((node, i) => {
|
|
22
|
+
const depth = traceDepth(trace, i);
|
|
23
|
+
const isFalse = node.value === false;
|
|
24
|
+
return (_jsxs("div", { "data-pyric-trace-node": "", "data-pyric-depth": depth, ...(node.skipped ? { 'data-pyric-skipped': '' } : {}), ...(node.letBinding ? { 'data-pyric-let': node.letBinding.name } : {}), ...(node.inlinedFrom ? { 'data-pyric-frame': node.inlinedFrom.name } : {}), children: [_jsx("span", { "data-pyric-trace-source": "", children: node.source }), _jsx("span", { "data-pyric-trace-value": "", ...(isFalse ? { 'data-pyric-false': '' } : {}), children: node.skipped
|
|
25
|
+
? 'skipped'
|
|
26
|
+
: node.error != null
|
|
27
|
+
? `error: ${node.error}`
|
|
28
|
+
: formatValue(node.value) })] }, i));
|
|
29
|
+
}) }));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Headless inspector for a single denied Firestore request. Renders, per
|
|
33
|
+
* the `denial-inspector-spec`:
|
|
34
|
+
* - the plain-language reason (`data-pyric-denial-reason`)
|
|
35
|
+
* - the rule source, line-marked (`data-pyric-rule-source`, per-line
|
|
36
|
+
* `data-pyric-line-verdict="deny|allow|skip"`)
|
|
37
|
+
* - the expression step-through (`data-pyric-trace` + per-node hooks)
|
|
38
|
+
* - data in scope (`data-pyric-scope`, `-scope-var`, `-scope-hit`)
|
|
39
|
+
* - the re-run / verify loop (`data-pyric-rerun`)
|
|
40
|
+
* - the cluster of sibling denials (`data-pyric-denial-cluster`)
|
|
41
|
+
* - path resolution for no-match denials (`data-pyric-path-resolution`)
|
|
42
|
+
*
|
|
43
|
+
* Zero styling — every visual decision is a consumer's via the
|
|
44
|
+
* `data-pyric-*` hooks. `mocks/c-debug.html` is the CSS spec.
|
|
45
|
+
*/
|
|
46
|
+
export function DenialInspector({ denial, cluster, onRerunAs, onTestEditedRule, onSelectCluster, className, }) {
|
|
47
|
+
const deciding = decidingEvaluation(denial.evaluation);
|
|
48
|
+
const lines = markRuleLines(denial.rulesSource, denial.evaluation, denial.method);
|
|
49
|
+
const scope = scopeVars(denial);
|
|
50
|
+
const rerunUid = lensUid(denial);
|
|
51
|
+
const isNoMatch = denial.evaluation.length === 0;
|
|
52
|
+
return (_jsxs("div", { className: className, "data-pyric-ui": "denial-inspector", children: [_jsxs("header", { "data-pyric-denial-header": "", children: [_jsxs("p", { "data-pyric-denial-title": "", children: ["Denied: ", _jsx("span", { "data-pyric-denial-method": "", children: denial.method }), ' ', _jsx("span", { "data-pyric-denial-path": "", children: denial.path })] }), _jsxs("p", { "data-pyric-denial-context": "", children: [denial.auth ? `by ${denial.auth.uid}` : 'unauthenticated', denial.lens && typeof denial.lens === 'object' && 'as' in denial.lens
|
|
53
|
+
? ` · acting as ${denial.lens.as}`
|
|
54
|
+
: denial.lens === 'admin'
|
|
55
|
+
? ' · admin'
|
|
56
|
+
: ''] })] }), _jsx("p", { "data-pyric-denial-reason": "", children: denialReason(denial.evaluation, denial.method, denial.path) }), _jsx("section", { "data-pyric-rule-source": "", children: lines.map((line) => (_jsxs("div", { "data-pyric-rule-line": "", "data-pyric-line-number": line.number, ...(line.verdict ? { 'data-pyric-line-verdict': line.verdict } : {}), children: [_jsx("span", { "data-pyric-line-gutter": "", children: line.number }), _jsx("span", { "data-pyric-line-text": "", children: line.text }), line.note ? _jsx("span", { "data-pyric-line-note": "", children: line.note }) : null, line.verdict === 'deny' ? (_jsx("span", { "data-pyric-line-badge": "", children: "denied" })) : null] }, line.number))) }), deciding?.expressionTrace && deciding.expressionTrace.length > 0 ? (_jsx(EvaluationTrace, { trace: deciding.expressionTrace })) : null, scope.length > 0 ? (_jsx("section", { "data-pyric-scope": "", children: scope.map((v) => (_jsxs("div", { "data-pyric-scope-var": v.name, children: [_jsx("span", { "data-pyric-scope-name": "", children: v.name }), _jsx("span", { "data-pyric-scope-tag": "", children: v.tag }), _jsx("span", { "data-pyric-scope-value": "", children: _jsx(ScopeValue, { value: v.value, hits: v.hits }) })] }, v.name))) })) : null, isNoMatch && denial.pathResolution ? (_jsx("section", { "data-pyric-path-resolution": "", children: denial.pathResolution.attempts.map((attempt, i) => (_jsxs("div", { "data-pyric-path-attempt": "", "data-pyric-matched-segments": `${attempt.matchedSegments}/${attempt.totalSegments}`, ...(attempt.matched ? { 'data-pyric-matched': '' } : {}), ...(attempt.reason ? { 'data-pyric-reason': attempt.reason } : {}), children: [_jsx("span", { "data-pyric-attempt-path": "", children: attempt.blockPath }), attempt.reason ? (_jsx("span", { "data-pyric-attempt-reason": "", children: attempt.reason })) : null] }, i))) })) : null, onRerunAs || onTestEditedRule ? (_jsxs("section", { "data-pyric-rerun": "", children: [onRerunAs && rerunUid ? (_jsxs("button", { type: "button", "data-pyric-rerun-as": "", "data-pyric-rerun-uid": rerunUid, onClick: () => onRerunAs(rerunUid), children: ["Re-run as ", rerunUid] })) : null, onTestEditedRule ? (_jsx("button", { type: "button", "data-pyric-test-edited-rule": "", onClick: () => onTestEditedRule(), children: "Test against an edited rule" })) : null] })) : null, cluster && cluster.length > 0 ? (_jsx("section", { "data-pyric-denial-cluster": "", children: cluster.map((sibling, i) => (_jsx("button", { type: "button", "data-pyric-cluster-item": "", onClick: () => onSelectCluster?.(sibling), children: _jsx("span", { "data-pyric-cluster-path": "", children: sibling.path }) }, i))) })) : null] }));
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=DenialInspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAC,CAAC,CAAC,IAAI,EAGP,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC/B,+CAAmC,EAAE,YAClC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3B,iBAEE,IAAI,EAAC,QAAQ,6BACW,EAAE,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,YAEzC,0CAA8B,EAAE,YAAE,OAAO,CAAC,IAAI,GAAQ,IALjD,CAAC,CAMC,CACV,CAAC,GACM,CACX,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { RuleEvaluation, ExprTraceEntry, LineVerdict, FirestoreMethod } from '../types.js';
|
|
2
|
+
/** Operations a request method satisfies — `update` matches `update` and
|
|
3
|
+
* `write`, etc. Mirrors the simulator's `methodToOperations`. */
|
|
4
|
+
export declare function methodOperations(method: FirestoreMethod): string[];
|
|
5
|
+
/**
|
|
6
|
+
* The allow rule that decided the denial: the last rule actually
|
|
7
|
+
* evaluated (DENY/ERROR). Under OR semantics the simulator stops at the
|
|
8
|
+
* first ALLOW; on a denial no rule allowed, so the deciding rule is the
|
|
9
|
+
* last evaluated one — the closest miss the user should reason about.
|
|
10
|
+
*/
|
|
11
|
+
export declare function decidingEvaluation(evaluation: RuleEvaluation[]): RuleEvaluation | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* A plain-language reason for the denial, derived from the deciding
|
|
14
|
+
* `RuleEvaluation`. Falls back to a no-match explanation when no allow
|
|
15
|
+
* rule was evaluated.
|
|
16
|
+
*/
|
|
17
|
+
export declare function denialReason(evaluation: RuleEvaluation[], method: FirestoreMethod, path: string): string;
|
|
18
|
+
export interface RuleLine {
|
|
19
|
+
number: number;
|
|
20
|
+
text: string;
|
|
21
|
+
verdict?: LineVerdict;
|
|
22
|
+
/** A short note for skipped lines, e.g. "not checked, this is an update". */
|
|
23
|
+
note?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Split the rules source into numbered lines and mark each `allow` line
|
|
27
|
+
* with a verdict per the spec:
|
|
28
|
+
* - the deciding rule's line → `deny`
|
|
29
|
+
* - an allow line whose operations don't include the method → `skip`
|
|
30
|
+
* - any other allow line → `allow`
|
|
31
|
+
*
|
|
32
|
+
* Verdicts are matched to source lines via `RuleEvaluation.line` (1-indexed
|
|
33
|
+
* `allow` keyword). Lines without a matching evaluation entry get no verdict.
|
|
34
|
+
*/
|
|
35
|
+
export declare function markRuleLines(rulesSource: string, evaluation: RuleEvaluation[], method: FirestoreMethod): RuleLine[];
|
|
36
|
+
/** Render a trace value the way the mock shows it: JSON-ish, quoted
|
|
37
|
+
* strings, `false`/`true`/`null` bare. */
|
|
38
|
+
export declare function formatValue(value: unknown): string;
|
|
39
|
+
/** Depth of a trace node from its `parent` chain (0 for roots). */
|
|
40
|
+
export declare function traceDepth(entries: ExprTraceEntry[], index: number): number;
|
|
41
|
+
/**
|
|
42
|
+
* The set of scope variable roots whose deciding values appear in the
|
|
43
|
+
* trace — `request.auth`, `request.resource.data`, `resource.data`.
|
|
44
|
+
* Used to underline the values the rule actually read.
|
|
45
|
+
*/
|
|
46
|
+
export interface ScopeVar {
|
|
47
|
+
/** The dotted path, e.g. `request.auth`. */
|
|
48
|
+
name: string;
|
|
49
|
+
/** A short human tag, e.g. "who made the request". */
|
|
50
|
+
tag: string;
|
|
51
|
+
/** The value to render. */
|
|
52
|
+
value: unknown;
|
|
53
|
+
/** Leaf keys whose values the rule read (for the `hit` underline). */
|
|
54
|
+
hits: string[];
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/rules/components/format.ts"],"names":[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|
+
/** Operations a request method satisfies — `update` matches `update` and
|
|
3
|
+
* `write`, etc. Mirrors the simulator's `methodToOperations`. */
|
|
4
|
+
export function methodOperations(method) {
|
|
5
|
+
switch (method) {
|
|
6
|
+
case 'get': return ['get', 'read'];
|
|
7
|
+
case 'list': return ['list', 'read'];
|
|
8
|
+
case 'create': return ['create', 'write'];
|
|
9
|
+
case 'update': return ['update', 'write'];
|
|
10
|
+
case 'delete': return ['delete', 'write'];
|
|
11
|
+
default: return [method];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The allow rule that decided the denial: the last rule actually
|
|
16
|
+
* evaluated (DENY/ERROR). Under OR semantics the simulator stops at the
|
|
17
|
+
* first ALLOW; on a denial no rule allowed, so the deciding rule is the
|
|
18
|
+
* last evaluated one — the closest miss the user should reason about.
|
|
19
|
+
*/
|
|
20
|
+
export function decidingEvaluation(evaluation) {
|
|
21
|
+
if (evaluation.length === 0)
|
|
22
|
+
return undefined;
|
|
23
|
+
// Prefer the last non-skipped (i.e. actually-evaluated) entry. Every
|
|
24
|
+
// entry in `evaluation` was matched by method, so they're all
|
|
25
|
+
// evaluated; the last is the deciding one.
|
|
26
|
+
return evaluation[evaluation.length - 1];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A plain-language reason for the denial, derived from the deciding
|
|
30
|
+
* `RuleEvaluation`. Falls back to a no-match explanation when no allow
|
|
31
|
+
* rule was evaluated.
|
|
32
|
+
*/
|
|
33
|
+
export function denialReason(evaluation, method, path) {
|
|
34
|
+
const deciding = decidingEvaluation(evaluation);
|
|
35
|
+
if (!deciding) {
|
|
36
|
+
return `No security rule matched ${method} ${path}, so the request was denied by default.`;
|
|
37
|
+
}
|
|
38
|
+
if (deciding.verdict === 'UNSUPPORTED') {
|
|
39
|
+
return (`The simulator couldn't evaluate the ${deciding.operations.join('/')} rule` +
|
|
40
|
+
(deciding.message ? ` (${deciding.message})` : '') +
|
|
41
|
+
' — this is a gap in the local simulator, not necessarily your rule.');
|
|
42
|
+
}
|
|
43
|
+
if (deciding.verdict === 'ERROR') {
|
|
44
|
+
return (`The ${deciding.operations.join('/')} rule threw while evaluating` +
|
|
45
|
+
(deciding.message ? `: ${deciding.message}` : '') +
|
|
46
|
+
', which denies the request.');
|
|
47
|
+
}
|
|
48
|
+
const cond = deciding.conditionText
|
|
49
|
+
? `The ${deciding.operations.join('/')} rule requires ${deciding.conditionText}, which evaluated to false`
|
|
50
|
+
: `The ${deciding.operations.join('/')} rule's condition evaluated to false`;
|
|
51
|
+
return `${cond}, so the request was denied.`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Split the rules source into numbered lines and mark each `allow` line
|
|
55
|
+
* with a verdict per the spec:
|
|
56
|
+
* - the deciding rule's line → `deny`
|
|
57
|
+
* - an allow line whose operations don't include the method → `skip`
|
|
58
|
+
* - any other allow line → `allow`
|
|
59
|
+
*
|
|
60
|
+
* Verdicts are matched to source lines via `RuleEvaluation.line` (1-indexed
|
|
61
|
+
* `allow` keyword). Lines without a matching evaluation entry get no verdict.
|
|
62
|
+
*/
|
|
63
|
+
export function markRuleLines(rulesSource, evaluation, method) {
|
|
64
|
+
const deciding = decidingEvaluation(evaluation);
|
|
65
|
+
const ops = methodOperations(method);
|
|
66
|
+
// line → verdict, from the evaluated rules.
|
|
67
|
+
const byLine = new Map();
|
|
68
|
+
const noteByLine = new Map();
|
|
69
|
+
for (const e of evaluation) {
|
|
70
|
+
if (e.line == null)
|
|
71
|
+
continue;
|
|
72
|
+
if (e === deciding)
|
|
73
|
+
byLine.set(e.line, 'deny');
|
|
74
|
+
else
|
|
75
|
+
byLine.set(e.line, 'allow');
|
|
76
|
+
}
|
|
77
|
+
// Detect skipped allow lines by scanning the source for `allow <ops>:`
|
|
78
|
+
// declarations whose operations don't intersect the request method.
|
|
79
|
+
const rawLines = rulesSource.split('\n');
|
|
80
|
+
const allowRe = /^\s*allow\s+([a-z,\s]+?)\s*:/;
|
|
81
|
+
return rawLines.map((text, i) => {
|
|
82
|
+
const number = i + 1;
|
|
83
|
+
const line = { number, text };
|
|
84
|
+
const fromEval = byLine.get(number);
|
|
85
|
+
if (fromEval) {
|
|
86
|
+
line.verdict = fromEval;
|
|
87
|
+
return line;
|
|
88
|
+
}
|
|
89
|
+
const m = allowRe.exec(text);
|
|
90
|
+
if (m) {
|
|
91
|
+
const declared = m[1].split(',').map(s => s.trim()).filter(Boolean);
|
|
92
|
+
const matches = declared.some(op => ops.includes(op));
|
|
93
|
+
if (!matches) {
|
|
94
|
+
line.verdict = 'skip';
|
|
95
|
+
line.note = `not checked, this is a ${method}`;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// Declared for this method but not in the evaluation trace
|
|
99
|
+
// (e.g. a different match block). Treat as a normal allow line.
|
|
100
|
+
line.verdict = 'allow';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return line;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/** Render a trace value the way the mock shows it: JSON-ish, quoted
|
|
107
|
+
* strings, `false`/`true`/`null` bare. */
|
|
108
|
+
export function formatValue(value) {
|
|
109
|
+
if (value === undefined)
|
|
110
|
+
return '∅';
|
|
111
|
+
if (typeof value === 'string')
|
|
112
|
+
return JSON.stringify(value);
|
|
113
|
+
if (value === null || typeof value === 'boolean' || typeof value === 'number') {
|
|
114
|
+
return String(value);
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
// Truncate vectors so a real embedding never dumps its full array into a trace.
|
|
118
|
+
return JSON.stringify(truncateVectorsForDisplay(value));
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return String(value);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/** Depth of a trace node from its `parent` chain (0 for roots). */
|
|
125
|
+
export function traceDepth(entries, index) {
|
|
126
|
+
let depth = 0;
|
|
127
|
+
let cur = entries[index]?.parent ?? null;
|
|
128
|
+
// Guard against malformed chains.
|
|
129
|
+
let guard = 0;
|
|
130
|
+
while (cur != null && guard < entries.length + 1) {
|
|
131
|
+
depth++;
|
|
132
|
+
cur = entries[cur]?.parent ?? null;
|
|
133
|
+
guard++;
|
|
134
|
+
}
|
|
135
|
+
return depth;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/rules/components/format.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE;kEACkE;AAClE,MAAM,UAAU,gBAAgB,CAAC,MAAuB;IACtD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACnC,KAAK,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACrC,KAAK,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC1C,KAAK,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC1C,KAAK,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC1C,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAA4B;IAC7D,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9C,qEAAqE;IACrE,8DAA8D;IAC9D,2CAA2C;IAC3C,OAAO,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC1B,UAA4B,EAC5B,MAAuB,EACvB,IAAY;IAEZ,MAAM,QAAQ,GA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AC;QACjD,KAAK,EAAE,CAAC;QACR,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,IAAI,CAAC;QACnC,KAAK,EAAE,CAAC;IACV,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DenialInspector } from './DenialInspector.js';
|
|
2
|
+
export { denialReason, markRuleLines, decidingEvaluation, methodOperations, formatValue, traceDepth, type RuleLine, type ScopeVar, } from './format.js';
|
|
3
|
+
export { scopeVars } from './scope.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,QAAQ,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,UAAU,GAGX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Denial } from '../types.js';
|
|
2
|
+
import { type ScopeVar } from './format.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build the "data in scope" rows for a denial: `request.auth`,
|
|
5
|
+
* `request.resource.data`, and `resource.data` — each present only when
|
|
6
|
+
* the denial carries that payload. `hits` marks the leaf keys the
|
|
7
|
+
* deciding rule actually read.
|
|
8
|
+
*/
|
|
9
|
+
export declare function scopeVars(denial: Denial): ScopeVar[];
|
|
10
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/rules/components/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAqChE;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CA8BpD"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { decidingEvaluation } from './format.js';
|
|
2
|
+
/**
|
|
3
|
+
* Leaf keys the rule read off each scope root, discovered from the
|
|
4
|
+
* deciding rule's expression trace. We scan every trace node's `source`
|
|
5
|
+
* for accessors rooted at one of the three scope roots and record the
|
|
6
|
+
* first segment after the root (e.g. `request.auth.uid` → root
|
|
7
|
+
* `request.auth`, hit `uid`). These drive the `data-pyric-scope-hit`
|
|
8
|
+
* underline so the user sees exactly which fields the rule compared.
|
|
9
|
+
*/
|
|
10
|
+
const SCOPE_ROOTS = [
|
|
11
|
+
{ root: 'request.resource.data', key: 'requestData' },
|
|
12
|
+
{ root: 'resource.data', key: 'resourceData' },
|
|
13
|
+
{ root: 'request.auth', key: 'auth' },
|
|
14
|
+
];
|
|
15
|
+
function collectHits(entries) {
|
|
16
|
+
const hits = new Map();
|
|
17
|
+
for (const entry of entries) {
|
|
18
|
+
const src = entry.source;
|
|
19
|
+
// Longest root first so `request.resource.data` wins over a bare
|
|
20
|
+
// `request` prefix.
|
|
21
|
+
for (const { root } of SCOPE_ROOTS) {
|
|
22
|
+
if (src === root || src.startsWith(root + '.')) {
|
|
23
|
+
const rest = src.slice(root.length).replace(/^\./, '');
|
|
24
|
+
const leaf = rest.split(/[.[]/)[0];
|
|
25
|
+
if (leaf) {
|
|
26
|
+
if (!hits.has(root))
|
|
27
|
+
hits.set(root, new Set());
|
|
28
|
+
hits.get(root).add(leaf);
|
|
29
|
+
}
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return hits;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Build the "data in scope" rows for a denial: `request.auth`,
|
|
38
|
+
* `request.resource.data`, and `resource.data` — each present only when
|
|
39
|
+
* the denial carries that payload. `hits` marks the leaf keys the
|
|
40
|
+
* deciding rule actually read.
|
|
41
|
+
*/
|
|
42
|
+
export function scopeVars(denial) {
|
|
43
|
+
const deciding = decidingEvaluation(denial.evaluation);
|
|
44
|
+
const hits = deciding?.expressionTrace ? collectHits(deciding.expressionTrace) : new Map();
|
|
45
|
+
const rows = [];
|
|
46
|
+
if (denial.auth !== null) {
|
|
47
|
+
rows.push({
|
|
48
|
+
name: 'request.auth',
|
|
49
|
+
tag: 'who made the request',
|
|
50
|
+
value: denial.auth,
|
|
51
|
+
hits: [...(hits.get('request.auth') ?? [])],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (denial.requestData !== undefined) {
|
|
55
|
+
rows.push({
|
|
56
|
+
name: 'request.resource.data',
|
|
57
|
+
tag: 'what was written',
|
|
58
|
+
value: denial.requestData,
|
|
59
|
+
hits: [...(hits.get('request.resource.data') ?? [])],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (denial.resourceData != null) {
|
|
63
|
+
rows.push({
|
|
64
|
+
name: 'resource.data',
|
|
65
|
+
tag: 'the existing document',
|
|
66
|
+
value: denial.resourceData,
|
|
67
|
+
hits: [...(hits.get('resource.data') ?? [])],
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return rows;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=scope.js.map
|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AC7C,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GAGf,MAAM,qBAAqB,CAAC"}
|