@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,156 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Billable-metrics + rules-metrics aggregation (Traffic tab: "Billable
|
|
4
|
+
* metrics" and "Rules"). Mirrors the Firebase Console
|
|
5
|
+
* Usage tab's shape (per-series totals + a bucketed time series), built
|
|
6
|
+
* on top of the same half-open `[window.start, window.end)` bucketing
|
|
7
|
+
* kernel {@link bucketTraffic} already uses.
|
|
8
|
+
*
|
|
9
|
+
* ── Billable mapping (documented; verified against the sandbox source) ──
|
|
10
|
+
* reads = get + list
|
|
11
|
+
* writes = create + update + set
|
|
12
|
+
* deletes = delete + remove
|
|
13
|
+
*
|
|
14
|
+
* A `list` event does NOT carry the number of documents the query
|
|
15
|
+
* returned — `local-environment.ts` emits ONE `allow` event per query
|
|
16
|
+
* before it computes/constrains the doc set, and the returned doc array
|
|
17
|
+
* never rides back onto the event. Real Firestore bills a list as one
|
|
18
|
+
* read PER RETURNED DOCUMENT; this stream can only honestly count list
|
|
19
|
+
* OPERATIONS, not documents. So this series is "read ops", not "billable
|
|
20
|
+
* reads" — an op-count proxy, not a byte-accurate bill. See the gap note
|
|
21
|
+
* in the Traffic feature's tracking issue.
|
|
22
|
+
*
|
|
23
|
+
* An op only bills if it actually ran against data: a `deny`/`error`/
|
|
24
|
+
* `unsupported`/`not-applicable` result means nothing was read or
|
|
25
|
+
* written, so those never count toward billable totals. An `admin`
|
|
26
|
+
* (rules-bypassed) op DOES run — admin reads/writes still bill in real
|
|
27
|
+
* Firestore — so admin ops count toward billable totals even though they
|
|
28
|
+
* never touch the rules-metrics series below.
|
|
29
|
+
*
|
|
30
|
+
* ── Rules metrics ──
|
|
31
|
+
* Allows / denies / errors are rules-ENGINE verdicts: how many times the
|
|
32
|
+
* rules engine actually ran and what it decided. An admin (bypassed) op
|
|
33
|
+
* never reaches rules, so it must never inflate "allows" — that would
|
|
34
|
+
* misrepresent the rules engine as having evaluated something it never
|
|
35
|
+
* saw. `unsupported` / `not-applicable` results aren't rules verdicts
|
|
36
|
+
* either (the simulator declined to evaluate) and are excluded too.
|
|
37
|
+
*
|
|
38
|
+
* ── Admin classification ──
|
|
39
|
+
* The base `TrafficEvent` carries only `origin` (no `detail` field — the
|
|
40
|
+
* sandbox-layer `RequestEvent.detail.admin` doesn't survive the
|
|
41
|
+
* `operation`-kind adapter path, and rides untyped through the
|
|
42
|
+
* `request`-kind cast). `origin === 'admin'` is the one signal declared
|
|
43
|
+
* on the public type, so it's the default `isAdmin` predicate here.
|
|
44
|
+
* Firestore's admin-lens ops don't currently set `origin: 'admin'`
|
|
45
|
+
* (RTDB's do) — callers that can see the richer Studio provenance
|
|
46
|
+
* (`authLens.mode === 'admin'`, as `verdict.ts#verdictFor` already
|
|
47
|
+
* checks) should pass their own `isAdmin` predicate to close that gap.
|
|
48
|
+
*/
|
|
49
|
+
const READ_METHODS = new Set(['get', 'list']);
|
|
50
|
+
const WRITE_METHODS = new Set(['create', 'update', 'set']);
|
|
51
|
+
const DELETE_METHODS = new Set(['delete', 'remove']);
|
|
52
|
+
export const BILLABLE_SERIES_DEFS = [
|
|
53
|
+
{ key: 'reads', label: 'Read ops' },
|
|
54
|
+
{ key: 'writes', label: 'Writes' },
|
|
55
|
+
{ key: 'deletes', label: 'Deletes' },
|
|
56
|
+
];
|
|
57
|
+
export const RULES_SERIES_DEFS = [
|
|
58
|
+
{ key: 'allows', label: 'Allows' },
|
|
59
|
+
{ key: 'denies', label: 'Denies' },
|
|
60
|
+
{ key: 'errors', label: 'Errors' },
|
|
61
|
+
];
|
|
62
|
+
/** Default admin predicate: the one signal the public `TrafficEvent`
|
|
63
|
+
* type declares. See the module doc for the known Firestore gap. */
|
|
64
|
+
export function isAdminEvent(event) {
|
|
65
|
+
return event.origin === 'admin';
|
|
66
|
+
}
|
|
67
|
+
/** Classify a billable op, or `null` if it isn't one / never ran. */
|
|
68
|
+
export function classifyBillable(event, isAdmin = isAdminEvent) {
|
|
69
|
+
const executed = event.result === 'allow' || isAdmin(event);
|
|
70
|
+
if (!executed)
|
|
71
|
+
return null;
|
|
72
|
+
if (READ_METHODS.has(event.method))
|
|
73
|
+
return 'reads';
|
|
74
|
+
if (WRITE_METHODS.has(event.method))
|
|
75
|
+
return 'writes';
|
|
76
|
+
if (DELETE_METHODS.has(event.method))
|
|
77
|
+
return 'deletes';
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
/** Classify a rules-engine verdict, or `null` if it isn't one (bypassed,
|
|
81
|
+
* unsupported, or not-applicable). */
|
|
82
|
+
export function classifyRules(event, isAdmin = isAdminEvent) {
|
|
83
|
+
if (isAdmin(event))
|
|
84
|
+
return null;
|
|
85
|
+
if (event.result === 'allow')
|
|
86
|
+
return 'allows';
|
|
87
|
+
if (event.result === 'deny')
|
|
88
|
+
return 'denies';
|
|
89
|
+
if (event.result === 'error')
|
|
90
|
+
return 'errors';
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const EMPTY = (seriesDefs) => ({
|
|
94
|
+
points: [],
|
|
95
|
+
series: seriesDefs.map((d) => ({ key: d.key, label: d.label, values: [], total: 0 })),
|
|
96
|
+
maxValue: 0,
|
|
97
|
+
});
|
|
98
|
+
/** The shared bucketing kernel behind both metric hooks below. */
|
|
99
|
+
function bucketMetrics(events, window, bucketCount, seriesDefs, classify) {
|
|
100
|
+
const span = window.end - window.start;
|
|
101
|
+
if (bucketCount <= 0 || span <= 0)
|
|
102
|
+
return EMPTY(seriesDefs);
|
|
103
|
+
const width = span / bucketCount;
|
|
104
|
+
const valuesByKey = new Map(seriesDefs.map((d) => [d.key, new Array(bucketCount).fill(0)]));
|
|
105
|
+
const totals = new Map(seriesDefs.map((d) => [d.key, 0]));
|
|
106
|
+
for (const event of events) {
|
|
107
|
+
const at = event.at;
|
|
108
|
+
if (at < window.start || at >= window.end)
|
|
109
|
+
continue;
|
|
110
|
+
const key = classify(event);
|
|
111
|
+
if (key == null)
|
|
112
|
+
continue;
|
|
113
|
+
let i = Math.floor((at - window.start) / width);
|
|
114
|
+
if (i >= bucketCount)
|
|
115
|
+
i = bucketCount - 1;
|
|
116
|
+
const bucketValues = valuesByKey.get(key);
|
|
117
|
+
bucketValues[i]++;
|
|
118
|
+
totals.set(key, (totals.get(key) ?? 0) + 1);
|
|
119
|
+
}
|
|
120
|
+
let maxValue = 0;
|
|
121
|
+
for (const values of valuesByKey.values()) {
|
|
122
|
+
for (const v of values)
|
|
123
|
+
if (v > maxValue)
|
|
124
|
+
maxValue = v;
|
|
125
|
+
}
|
|
126
|
+
const points = new Array(bucketCount);
|
|
127
|
+
for (let i = 0; i < bucketCount; i++) {
|
|
128
|
+
points[i] = { index: i, start: window.start + i * width, end: window.start + (i + 1) * width };
|
|
129
|
+
}
|
|
130
|
+
const series = seriesDefs.map((d) => ({
|
|
131
|
+
key: d.key,
|
|
132
|
+
label: d.label,
|
|
133
|
+
values: valuesByKey.get(d.key),
|
|
134
|
+
total: totals.get(d.key) ?? 0,
|
|
135
|
+
}));
|
|
136
|
+
return { points, series, maxValue };
|
|
137
|
+
}
|
|
138
|
+
/** Pure kernel behind {@link useBillableMetrics} — usable outside React. */
|
|
139
|
+
export function bucketBillableMetrics(events, window, bucketCount = 24, isAdmin = isAdminEvent) {
|
|
140
|
+
return bucketMetrics(events, window, bucketCount, BILLABLE_SERIES_DEFS, (e) => classifyBillable(e, isAdmin));
|
|
141
|
+
}
|
|
142
|
+
/** Pure kernel behind {@link useRulesMetrics} — usable outside React. */
|
|
143
|
+
export function bucketRulesMetrics(events, window, bucketCount = 24, isAdmin = isAdminEvent) {
|
|
144
|
+
return bucketMetrics(events, window, bucketCount, RULES_SERIES_DEFS, (e) => classifyRules(e, isAdmin));
|
|
145
|
+
}
|
|
146
|
+
/** Reads / writes / deletes, bucketed over `window`. See the module doc
|
|
147
|
+
* for the billable mapping + the "read ops, not billable reads" caveat. */
|
|
148
|
+
export function useBillableMetrics({ events, window, bucketCount = 24, isAdmin, }) {
|
|
149
|
+
return useMemo(() => bucketBillableMetrics(events, window, bucketCount, isAdmin), [events, window.start, window.end, bucketCount, isAdmin]);
|
|
150
|
+
}
|
|
151
|
+
/** Allows / denies / errors, bucketed over `window`. Excludes
|
|
152
|
+
* rules-bypassed (admin) ops — see the module doc. */
|
|
153
|
+
export function useRulesMetrics({ events, window, bucketCount = 24, isAdmin, }) {
|
|
154
|
+
return useMemo(() => bucketRulesMetrics(events, window, bucketCount, isAdmin), [events, window.start, window.end, bucketCount, isAdmin]);
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=useTrafficMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTrafficMetrics.js","sourceRoot":"","sources":["../../../src/traffic/hooks/useTrafficMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAIhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9C,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AAC3D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAKrD,MAAM,CAAC,MAAM,oBAAoB,GAA6D;IAC5F,EAAE,GAAG,EAAE,OAAO,EAAE,KA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EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,CACzD,CAAC;AACJ,CAAC;AAED;uDACuD;AACvD,MAAM,UAAU,eAAe,CAAC,EAC9B,MAAM,EACN,MAAM,EACN,WAAW,GAAG,EAAE,EAChB,OAAO,GACkB;IACzB,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAC9D,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,CACzD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { TrafficEvent, TrafficSource } from '../types.js';
|
|
2
|
+
export interface UseTrafficMonitorOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The subscription function — `sandbox.onRequest` satisfies this
|
|
5
|
+
* directly. Pass a stable reference; the hook re-subscribes on
|
|
6
|
+
* identity change.
|
|
7
|
+
*/
|
|
8
|
+
source: TrafficSource;
|
|
9
|
+
/**
|
|
10
|
+
* Ring-buffer cap. Once exceeded, the oldest events are dropped.
|
|
11
|
+
* Default 5000 (~3 MB worst case — see the traffic-monitor probe
|
|
12
|
+
* findings).
|
|
13
|
+
*/
|
|
14
|
+
bufferSize?: number;
|
|
15
|
+
/** Whether the buffer starts paused. Default false. */
|
|
16
|
+
paused?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Runs per event before buffering — return a (possibly trimmed)
|
|
19
|
+
* event. Lets the consumer shrink oversized payloads without the
|
|
20
|
+
* library knowing payload semantics. Identity is read fresh on
|
|
21
|
+
* each event, so it need not be memoized.
|
|
22
|
+
*/
|
|
23
|
+
transform?: (event: TrafficEvent) => TrafficEvent;
|
|
24
|
+
}
|
|
25
|
+
export interface TrafficCounts {
|
|
26
|
+
/** Events currently in the buffer. */
|
|
27
|
+
total: number;
|
|
28
|
+
/** Of those, how many were denied. */
|
|
29
|
+
denied: number;
|
|
30
|
+
/** Of those, how many are listener re-evals. */
|
|
31
|
+
listener: number;
|
|
32
|
+
}
|
|
33
|
+
export interface UseTrafficMonitorResult {
|
|
34
|
+
/** The buffered events, oldest first. */
|
|
35
|
+
events: TrafficEvent[];
|
|
36
|
+
counts: TrafficCounts;
|
|
37
|
+
isPaused: boolean;
|
|
38
|
+
/** Stop appending — incoming events are dropped while paused. */
|
|
39
|
+
pause: () => void;
|
|
40
|
+
/** Resume appending. */
|
|
41
|
+
resume: () => void;
|
|
42
|
+
/** Empty the buffer. */
|
|
43
|
+
clear: () => void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Buffers a traffic stream into a capped ring buffer with
|
|
47
|
+
* pause/resume/clear. Decoupled from `pyric/sandbox` — `source` is
|
|
48
|
+
* just a `(cb) => unsubscribe` function.
|
|
49
|
+
*
|
|
50
|
+
* Pause is consumer-side: while paused, the subscription stays
|
|
51
|
+
* attached but incoming events are dropped (not queued). This
|
|
52
|
+
* matches the probe decision — a `load-test`-shaped session can emit
|
|
53
|
+
* 100k+ events, so queueing-while-paused would defeat the point.
|
|
54
|
+
*/
|
|
55
|
+
export declare function useTrafficMonitor({ source, bufferSize, paused, transform, }: UseTrafficMonitorOptions): UseTrafficMonitorResult;
|
|
56
|
+
//# sourceMappingURL=useTrafficMonitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTrafficMonitor.d.ts","sourceRoot":"","sources":["../../../src/traffic/hooks/useTrafficMonitor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,MAAM,EAAE,aAAa,CAAC;IACtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,YAAY,CAAC;CACnD;AAED,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,yCAAyC;IACzC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,wBAAwB;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,wBAAwB;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,UAAiB,EACjB,MAAc,EACd,SAAS,GACV,EAAE,wBAAwB,GAAG,uBAAuB,CA8CpD"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Buffers a traffic stream into a capped ring buffer with
|
|
4
|
+
* pause/resume/clear. Decoupled from `pyric/sandbox` — `source` is
|
|
5
|
+
* just a `(cb) => unsubscribe` function.
|
|
6
|
+
*
|
|
7
|
+
* Pause is consumer-side: while paused, the subscription stays
|
|
8
|
+
* attached but incoming events are dropped (not queued). This
|
|
9
|
+
* matches the probe decision — a `load-test`-shaped session can emit
|
|
10
|
+
* 100k+ events, so queueing-while-paused would defeat the point.
|
|
11
|
+
*/
|
|
12
|
+
export function useTrafficMonitor({ source, bufferSize = 5000, paused = false, transform, }) {
|
|
13
|
+
const [events, setEvents] = useState([]);
|
|
14
|
+
const [isPaused, setIsPaused] = useState(paused);
|
|
15
|
+
// The subscription callback closes over these once. Refs keep it
|
|
16
|
+
// reading the live values without forcing a re-subscribe.
|
|
17
|
+
const pausedRef = useRef(isPaused);
|
|
18
|
+
pausedRef.current = isPaused;
|
|
19
|
+
const bufferSizeRef = useRef(bufferSize);
|
|
20
|
+
bufferSizeRef.current = bufferSize;
|
|
21
|
+
const transformRef = useRef(transform);
|
|
22
|
+
transformRef.current = transform;
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const unsubscribe = source((event) => {
|
|
25
|
+
if (pausedRef.current)
|
|
26
|
+
return;
|
|
27
|
+
const shaped = transformRef.current
|
|
28
|
+
? transformRef.current(event)
|
|
29
|
+
: event;
|
|
30
|
+
setEvents((prev) => {
|
|
31
|
+
const next = prev.length >= bufferSizeRef.current ? prev.slice(1) : prev.slice();
|
|
32
|
+
next.push(shaped);
|
|
33
|
+
return next;
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
return unsubscribe;
|
|
37
|
+
}, [source]);
|
|
38
|
+
const counts = useMemo(() => {
|
|
39
|
+
let denied = 0;
|
|
40
|
+
let listener = 0;
|
|
41
|
+
for (const e of events) {
|
|
42
|
+
if (e.result === 'deny')
|
|
43
|
+
denied++;
|
|
44
|
+
if (e.origin === 'listener')
|
|
45
|
+
listener++;
|
|
46
|
+
}
|
|
47
|
+
return { total: events.length, denied, listener };
|
|
48
|
+
}, [events]);
|
|
49
|
+
return {
|
|
50
|
+
events,
|
|
51
|
+
counts,
|
|
52
|
+
isPaused,
|
|
53
|
+
pause: () => setIsPaused(true),
|
|
54
|
+
resume: () => setIsPaused(false),
|
|
55
|
+
clear: () => setEvents([]),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=useTrafficMonitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTrafficMonitor.js","sourceRoot":"","sources":["../../../src/traffic/hooks/useTrafficMonitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,E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AC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,WAAW,CAAC;IACrB,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,MAAM,MAAM,GAAG,OAAO,CAAgB,GAAG,EAAE;QACzC,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM;gBAAE,MAAM,EAAE,CAAC;YAClC,IAAI,CAAC,CAAC,MAAM,KAAK,UAAU;gBAAE,QAAQ,EAAE,CAAC;QAC1C,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACpD,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO;QACL,MAAM;QACN,MAAM;QACN,QAAQ;QACR,KAAK,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;QAC9B,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC;QAChC,KAAK,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TrafficEvent } from '../types.js';
|
|
2
|
+
export interface TrafficStatBucket {
|
|
3
|
+
key: string;
|
|
4
|
+
count: number;
|
|
5
|
+
}
|
|
6
|
+
export interface TrafficStatsSummary {
|
|
7
|
+
total: number;
|
|
8
|
+
allows: number;
|
|
9
|
+
denies: number;
|
|
10
|
+
unsupported: number;
|
|
11
|
+
/** `denies / total` — 0 for an empty buffer. */
|
|
12
|
+
denyRate: number;
|
|
13
|
+
/** Counts by method, sorted descending. */
|
|
14
|
+
byMethod: TrafficStatBucket[];
|
|
15
|
+
/** Counts by origin, sorted descending. */
|
|
16
|
+
byOrigin: TrafficStatBucket[];
|
|
17
|
+
/** Counts by path, sorted descending, capped at `topPaths`. */
|
|
18
|
+
byPath: TrafficStatBucket[];
|
|
19
|
+
}
|
|
20
|
+
export interface UseTrafficStatsOptions {
|
|
21
|
+
events: TrafficEvent[];
|
|
22
|
+
/** Cap on `byPath` entries — paths are unbounded. Default 10. */
|
|
23
|
+
topPaths?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Aggregations over a traffic buffer: totals, deny rate, and counts
|
|
27
|
+
* broken down by method, origin, and path. Pure derivation — feed it
|
|
28
|
+
* the filtered or full event list depending on what the panel
|
|
29
|
+
* should reflect.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useTrafficStats({ events, topPaths, }: UseTrafficStatsOptions): TrafficStatsSummary;
|
|
32
|
+
//# sourceMappingURL=useTrafficStats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTrafficStats.d.ts","sourceRoot":"","sources":["../../../src/traffic/hooks/useTrafficStats.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,+DAA+D;IAC/D,MAAM,EAAE,iBAAiB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAkBD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,QAAa,GACd,EAAE,sBAAsB,GAAG,mBAAmB,CAsB9C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
function buckets(events, pick, limit) {
|
|
3
|
+
const counts = new Map();
|
|
4
|
+
for (const event of events) {
|
|
5
|
+
const key = pick(event);
|
|
6
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
7
|
+
}
|
|
8
|
+
const sorted = [...counts.entries()]
|
|
9
|
+
.map(([key, count]) => ({ key, count }))
|
|
10
|
+
.sort((a, b) => b.count - a.count || a.key.localeCompare(b.key));
|
|
11
|
+
return limit === undefined ? sorted : sorted.slice(0, limit);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Aggregations over a traffic buffer: totals, deny rate, and counts
|
|
15
|
+
* broken down by method, origin, and path. Pure derivation — feed it
|
|
16
|
+
* the filtered or full event list depending on what the panel
|
|
17
|
+
* should reflect.
|
|
18
|
+
*/
|
|
19
|
+
export function useTrafficStats({ events, topPaths = 10, }) {
|
|
20
|
+
return useMemo(() => {
|
|
21
|
+
let allows = 0;
|
|
22
|
+
let denies = 0;
|
|
23
|
+
let unsupported = 0;
|
|
24
|
+
for (const event of events) {
|
|
25
|
+
if (event.result === 'allow')
|
|
26
|
+
allows++;
|
|
27
|
+
else if (event.result === 'deny')
|
|
28
|
+
denies++;
|
|
29
|
+
else
|
|
30
|
+
unsupported++;
|
|
31
|
+
}
|
|
32
|
+
const total = events.length;
|
|
33
|
+
return {
|
|
34
|
+
total,
|
|
35
|
+
allows,
|
|
36
|
+
denies,
|
|
37
|
+
unsupported,
|
|
38
|
+
denyRate: total === 0 ? 0 : denies / total,
|
|
39
|
+
byMethod: buckets(events, (e) => e.method),
|
|
40
|
+
byOrigin: buckets(events, (e) => e.origin),
|
|
41
|
+
byPath: buckets(events, (e) => e.path, topPaths),
|
|
42
|
+
};
|
|
43
|
+
}, [events, topPaths]);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=useTrafficStats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTrafficStats.js","sourceRoot":"","sources":["../../../src/traffic/hooks/useTrafficStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AA6BhC,SAAS,OAAO,CACd,MAAsB,EACtB,IAAqC,EACrC,KAAc;IAEd,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;SACjC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;SACvC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnE,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,MAAM,EACN,QAAQ,GAAG,EAAE,GACU;IACvB,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,IAAI,WAAW,GAAG,CAAC,CAAC;QACpB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO;gBAAE,MAAM,EAAE,CAAC;iBAClC,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM;gBAAE,MAAM,EAAE,CAAC;;gBACtC,WAAW,EAAE,CAAC;QACrB,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,OAAO;YACL,KAAK;YACL,MAAM;YACN,MAAM;YACN,WAAW;YACX,QAAQ,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK;YAC1C,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;YAC1C,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;YAC1C,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC;SACjD,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from './hooks/index.js';
|
|
2
|
+
export * from './components/index.js';
|
|
3
|
+
export type { TrafficEvent, TrafficSource, TrafficMethod, TrafficResult, TrafficOrigin, TrafficAuthState, TrafficResourceState, TrafficMatchedRule, } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/traffic/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AAEtC,YAAY,EACV,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/traffic/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The traffic domain types. `TrafficEvent` is structurally identical
|
|
3
|
+
* to `pyric/sandbox`'s `RequestEvent` (locked in
|
|
4
|
+
* the design rationale) — but the library defines its
|
|
5
|
+
* own copy so it never imports `pyric/sandbox`. `sandbox.onRequest`
|
|
6
|
+
* is assignable as a `TrafficSource` with zero adapter code; a prod
|
|
7
|
+
* log feed can satisfy the same shape.
|
|
8
|
+
*/
|
|
9
|
+
export type TrafficMethod = 'get' | 'list' | 'create' | 'update' | 'set' | 'delete' | 'remove' | 'push' | 'listen' | 'transaction' | (string & {});
|
|
10
|
+
export type TrafficResult = 'allow' | 'deny' | 'unsupported' | 'error' | 'not-applicable';
|
|
11
|
+
export type TrafficOrigin = 'user' | 'listener' | 'transaction' | 'batch' | 'admin' | 'system';
|
|
12
|
+
export interface TrafficAuthState {
|
|
13
|
+
uid: string;
|
|
14
|
+
token?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export interface TrafficResourceState {
|
|
17
|
+
data: unknown;
|
|
18
|
+
exists: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface TrafficMatchedRule {
|
|
21
|
+
ruleIndex: number;
|
|
22
|
+
operations: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface TrafficEvent {
|
|
25
|
+
/** Unique per emission. */
|
|
26
|
+
id: string;
|
|
27
|
+
/** Source event kind. Firestore request events omit this in older adapters. */
|
|
28
|
+
kind?: 'request' | 'operation';
|
|
29
|
+
/** Service that emitted the event. Omitted means Firestore. */
|
|
30
|
+
service?: 'firestore' | 'auth' | 'storage' | 'rtdb' | (string & {});
|
|
31
|
+
/** `Date.now()` at op start. */
|
|
32
|
+
at: number;
|
|
33
|
+
/** Simulator eval duration in ms. De-featured in the UI (local
|
|
34
|
+
* simulator) — present for the detail panel only. */
|
|
35
|
+
evalMs?: number;
|
|
36
|
+
/** Canonical service-operation duration. */
|
|
37
|
+
durationMs?: number;
|
|
38
|
+
method: TrafficMethod;
|
|
39
|
+
path: string;
|
|
40
|
+
auth: TrafficAuthState | null;
|
|
41
|
+
result: TrafficResult;
|
|
42
|
+
/** Simulator debug messages — `Rule #N (op) → ALLOW` format. */
|
|
43
|
+
reasons: string[];
|
|
44
|
+
/** Proposed write payload — absent on reads + delete. */
|
|
45
|
+
request?: {
|
|
46
|
+
data?: unknown;
|
|
47
|
+
resourceData?: unknown;
|
|
48
|
+
query?: unknown;
|
|
49
|
+
};
|
|
50
|
+
/** Existing doc state before the write (or the read target). */
|
|
51
|
+
resourceBefore?: TrafficResourceState;
|
|
52
|
+
/** Projected doc state after the write — absent on reads. */
|
|
53
|
+
resourceAfter?: TrafficResourceState;
|
|
54
|
+
/** Parsed from the matched `Rule #N` debug line — absent if none. */
|
|
55
|
+
matchedRule?: TrafficMatchedRule;
|
|
56
|
+
origin: TrafficOrigin;
|
|
57
|
+
/** Shared across ops in one batch or transaction. */
|
|
58
|
+
groupId?: string;
|
|
59
|
+
groupKind?: 'batch' | 'transaction' | (string & {});
|
|
60
|
+
/** For listener re-evals — the originating user op. */
|
|
61
|
+
triggeredBy?: {
|
|
62
|
+
method: string;
|
|
63
|
+
path?: string;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A subscription function: register a callback, get back an
|
|
68
|
+
* unsubscribe. `pyric/sandbox`'s `Sandbox.onRequest` matches this
|
|
69
|
+
* signature exactly.
|
|
70
|
+
*/
|
|
71
|
+
export type TrafficSource = (cb: (event: TrafficEvent) => void) => () => void;
|
|
72
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/traffic/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,aAAa,GACrB,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,aAAa,GACb,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,GAAG,gBAAgB,CAAC;AAE1F,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE/F,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,+EAA+E;IAC/E,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B,+DAA+D;IAC/D,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACpE,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX;0DACsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,aAAa,CAAC;IACtB,gEAAgE;IAChE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yDAAyD;IACzD,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACtE,gEAAgE;IAChE,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,6DAA6D;IAC7D,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,qEAAqE;IACrE,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,MAAM,EAAE,aAAa,CAAC;IACtB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACpD,uDAAuD;IACvD,WAAW,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,EAAE,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,KAC9B,MAAM,IAAI,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The traffic domain types. `TrafficEvent` is structurally identical
|
|
3
|
+
* to `pyric/sandbox`'s `RequestEvent` (locked in
|
|
4
|
+
* the design rationale) — but the library defines its
|
|
5
|
+
* own copy so it never imports `pyric/sandbox`. `sandbox.onRequest`
|
|
6
|
+
* is assignable as a `TrafficSource` with zero adapter code; a prod
|
|
7
|
+
* log feed can satisfy the same shape.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/traffic/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pyric/ui",
|
|
3
|
+
"version": "0.1.0-alpha.10",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"homepage": "https://pyric.dev",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/davideast/pyric.git",
|
|
9
|
+
"directory": "packages/ui"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/davideast/pyric/issues"
|
|
13
|
+
},
|
|
14
|
+
"description": "Headless React data-admin components and hooks for Firebase apps built on pyric. Same components work in sandbox (pyric/firestore against pyric/sandbox) and production (firebase/firestore against real Firebase) via a single Firestore handle prop. Ships zero visual styling — consumers bring their own design system via className + data-* attributes.",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
"./auth": {
|
|
18
|
+
"types": "./dist/auth/index.d.ts",
|
|
19
|
+
"import": "./dist/auth/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./auth/hooks": {
|
|
22
|
+
"types": "./dist/auth/hooks/index.d.ts",
|
|
23
|
+
"import": "./dist/auth/hooks/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./primitives": {
|
|
26
|
+
"types": "./dist/primitives/index.d.ts",
|
|
27
|
+
"import": "./dist/primitives/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./firestore": {
|
|
30
|
+
"types": "./dist/firestore/index.d.ts",
|
|
31
|
+
"import": "./dist/firestore/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./firestore/hooks": {
|
|
34
|
+
"types": "./dist/firestore/hooks/index.d.ts",
|
|
35
|
+
"import": "./dist/firestore/hooks/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./rtdb": {
|
|
38
|
+
"types": "./dist/rtdb/index.d.ts",
|
|
39
|
+
"import": "./dist/rtdb/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./storage": {
|
|
42
|
+
"types": "./dist/storage/index.d.ts",
|
|
43
|
+
"import": "./dist/storage/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./storage/hooks": {
|
|
46
|
+
"types": "./dist/storage/hooks/index.d.ts",
|
|
47
|
+
"import": "./dist/storage/hooks/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./traffic": {
|
|
50
|
+
"types": "./dist/traffic/index.d.ts",
|
|
51
|
+
"import": "./dist/traffic/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./traffic/hooks": {
|
|
54
|
+
"types": "./dist/traffic/hooks/index.d.ts",
|
|
55
|
+
"import": "./dist/traffic/hooks/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./events": {
|
|
58
|
+
"types": "./dist/events/index.d.ts",
|
|
59
|
+
"import": "./dist/events/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./events/hooks": {
|
|
62
|
+
"types": "./dist/events/hooks/index.d.ts",
|
|
63
|
+
"import": "./dist/events/hooks/index.js"
|
|
64
|
+
},
|
|
65
|
+
"./agents": {
|
|
66
|
+
"types": "./dist/agents/index.d.ts",
|
|
67
|
+
"import": "./dist/agents/index.js"
|
|
68
|
+
},
|
|
69
|
+
"./rules": {
|
|
70
|
+
"types": "./dist/rules/index.d.ts",
|
|
71
|
+
"import": "./dist/rules/index.js"
|
|
72
|
+
},
|
|
73
|
+
"./rules/hooks": {
|
|
74
|
+
"types": "./dist/rules/hooks/index.d.ts",
|
|
75
|
+
"import": "./dist/rules/hooks/index.js"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"files": [
|
|
79
|
+
"dist",
|
|
80
|
+
"README.md",
|
|
81
|
+
"LICENSE"
|
|
82
|
+
],
|
|
83
|
+
"scripts": {
|
|
84
|
+
"build": "tsc",
|
|
85
|
+
"test": "bun run test:no-dom && bun run test:dom",
|
|
86
|
+
"test:no-dom": "bun test test/auth/claims test/auth/controller test/auth/hooks test/firestore/hooks test/firestore/inference test/firestore/reducers test/firestore/validation test/firestore/import test/storage/hooks test/storage/logic test/traffic/hooks test/rules/hooks test/rules/logic test/events/hooks test/rtdb/logic test/rtdb/reducers",
|
|
87
|
+
"test:dom": "bun test test/auth/components test/firestore/components test/primitives test/storage/components test/traffic/components test/rules/components test/events/components test/agents test/rtdb/components",
|
|
88
|
+
"typecheck": "bun x tsc -p tsconfig.json --noEmit"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"@inbrowser/agent": "0.4.2",
|
|
92
|
+
"react": ">=19",
|
|
93
|
+
"react-dom": ">=19",
|
|
94
|
+
"firebase": ">=12",
|
|
95
|
+
"pyric": "^0.1.0-alpha.10"
|
|
96
|
+
},
|
|
97
|
+
"peerDependenciesMeta": {
|
|
98
|
+
"@inbrowser/agent": {
|
|
99
|
+
"optional": true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"devDependencies": {
|
|
103
|
+
"@testing-library/react": "^16.1.0",
|
|
104
|
+
"@types/bun": "latest",
|
|
105
|
+
"@types/react": "^19.0.0",
|
|
106
|
+
"@types/react-dom": "^19.0.0",
|
|
107
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
108
|
+
"fake-indexeddb": "^6.0.0",
|
|
109
|
+
"firebase": "^12.12.0",
|
|
110
|
+
"jsdom": "^29.1.1",
|
|
111
|
+
"pyric": "^0.1.0-alpha.10",
|
|
112
|
+
"pyric-admin": "^0.1.0-alpha.10",
|
|
113
|
+
"react": "^19.0.0",
|
|
114
|
+
"react-dom": "^19.0.0",
|
|
115
|
+
"react-test-renderer": "^19.2.6",
|
|
116
|
+
"typescript": "^5.7.0"
|
|
117
|
+
},
|
|
118
|
+
"dependencies": {
|
|
119
|
+
"@tanstack/react-virtual": "3.13.24"
|
|
120
|
+
},
|
|
121
|
+
"engines": {
|
|
122
|
+
"node": ">=22"
|
|
123
|
+
},
|
|
124
|
+
"publishConfig": {
|
|
125
|
+
"access": "public"
|
|
126
|
+
}
|
|
127
|
+
}
|