@darkfrost-1107/scaff-z-react 0.1.7
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.md +5 -0
- package/README.md +75 -0
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/action-processor.d.ts +2 -0
- package/dist/app/config/sqlite.registry.cjs +1 -0
- package/dist/app/config/sqlite.registry.esm +37 -0
- package/dist/app.config.d.ts +1 -0
- package/dist/async-combobox.input.d.ts +4 -0
- package/dist/async-multi-select.input.d.ts +4 -0
- package/dist/async-select.input.d.ts +4 -0
- package/dist/audit-view.d.ts +2 -0
- package/dist/back-button.action.d.ts +6 -0
- package/dist/badge.d.ts +2 -0
- package/dist/base.connector.d.ts +4 -0
- package/dist/base.entity.d.ts +2 -0
- package/dist/base.node.d.ts +2 -0
- package/dist/base.service.d.ts +4 -0
- package/dist/breadcrumb.d.ts +2 -0
- package/dist/build.router.d.ts +4 -0
- package/dist/builder-device.guard.d.ts +2 -0
- package/dist/builder.d.ts +2 -0
- package/dist/button.d.ts +2 -0
- package/dist/calendar.d.ts +2 -0
- package/dist/canvas-view.layout.d.ts +2 -0
- package/dist/card.d.ts +2 -0
- package/dist/checkbox-inline.input.d.ts +4 -0
- package/dist/checkbox.d.ts +2 -0
- package/dist/checkbox.input.d.ts +4 -0
- package/dist/code.input.d.ts +4 -0
- package/dist/color.input.d.ts +4 -0
- package/dist/combobox.d.ts +2 -0
- package/dist/combobox.input.d.ts +4 -0
- package/dist/command.d.ts +2 -0
- package/dist/component.factory.d.ts +4 -0
- package/dist/component.guard.d.ts +2 -0
- package/dist/components.registry.d.ts +2 -0
- package/dist/context.guard.d.ts +2 -0
- package/dist/context.verifier.d.ts +2 -0
- package/dist/crypto.service.d.ts +2 -0
- package/dist/dark.style.d.ts +2 -0
- package/dist/data-table.component.d.ts +2 -0
- package/dist/data-table.provider.d.ts +1 -0
- package/dist/date.input.d.ts +2 -0
- package/dist/deckgl-overlay.d.ts +2 -0
- package/dist/detail-tabs.layout.d.ts +6 -0
- package/dist/detail-view.layout.d.ts +6 -0
- package/dist/device-artifact.guard.d.ts +2 -0
- package/dist/device.guard.d.ts +2 -0
- package/dist/device.verifier.registry.d.ts +2 -0
- package/dist/dialog.d.ts +2 -0
- package/dist/dnd.provider.d.ts +2 -0
- package/dist/draggeable.d.ts +2 -0
- package/dist/droppable.d.ts +2 -0
- package/dist/droppeable.d.ts +2 -0
- package/dist/dynamic-device.guard.d.ts +2 -0
- package/dist/dynamic-icon.d.ts +6 -0
- package/dist/email.input.d.ts +4 -0
- package/dist/enum.verifier.d.ts +2 -0
- package/dist/env.manager.d.ts +2 -0
- package/dist/feedback.layout.d.ts +2 -0
- package/dist/field.d.ts +2 -0
- package/dist/file.input.d.ts +4 -0
- package/dist/flow-canvas.d.ts +2 -0
- package/dist/flow.renderer.d.ts +2 -0
- package/dist/flow.types.d.ts +1 -0
- package/dist/form-dialog-layout.d.ts +4 -0
- package/dist/form-tab-layout.d.ts +4 -0
- package/dist/form.component.d.ts +2 -0
- package/dist/grid.layout.d.ts +2 -0
- package/dist/guard.d.ts +2 -0
- package/dist/hover.d.ts +2 -0
- package/dist/icon-box.d.ts +2 -0
- package/dist/icon-button.d.ts +2 -0
- package/dist/image.input.d.ts +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/indexeddb.service.d.ts +6 -0
- package/dist/input-group.d.ts +2 -0
- package/dist/input.d.ts +2 -0
- package/dist/interceptor.builder.d.ts +2 -0
- package/dist/label.d.ts +2 -0
- package/dist/language-toggle.d.ts +2 -0
- package/dist/list-select.input.d.ts +4 -0
- package/dist/logger.d.ts +2 -0
- package/dist/main.connector.d.ts +2 -0
- package/dist/main.service.d.ts +6 -0
- package/dist/maps.renderer.d.ts +4 -0
- package/dist/marker.factory.d.ts +2 -0
- package/dist/marker.guard.d.ts +2 -0
- package/dist/markers.meta.d.ts +1 -0
- package/dist/modules/actions/entities/action.entity.cjs +1 -0
- package/dist/modules/actions/entities/action.entity.esm +139 -0
- package/dist/modules/artifacts/entities/artifact.entity.cjs +1 -0
- package/dist/modules/artifacts/entities/artifact.entity.esm +82 -0
- package/dist/modules/integrations/entities/integration.entity.cjs +1 -0
- package/dist/modules/integrations/entities/integration.entity.esm +75 -0
- package/dist/modules/inventory/entities/category.entity.cjs +1 -0
- package/dist/modules/inventory/entities/category.entity.esm +50 -0
- package/dist/modules/inventory/entities/inventory-item.entity.cjs +1 -0
- package/dist/modules/inventory/entities/inventory-item.entity.esm +68 -0
- package/dist/modules/inventory/entities/product-item.entity.cjs +1 -0
- package/dist/modules/inventory/entities/product-item.entity.esm +69 -0
- package/dist/modules/inventory/entities/zone.entity.cjs +1 -0
- package/dist/modules/inventory/entities/zone.entity.esm +50 -0
- package/dist/modules/memberships/entities/membership.entity.cjs +1 -0
- package/dist/modules/memberships/entities/membership.entity.esm +53 -0
- package/dist/modules/organizations/entities/organization.entity.cjs +1 -0
- package/dist/modules/organizations/entities/organization.entity.esm +75 -0
- package/dist/modules/projects/entities/project.entity.cjs +1 -0
- package/dist/modules/projects/entities/project.entity.esm +100 -0
- package/dist/modules/test/entities/experiment.entity.cjs +1 -0
- package/dist/modules/test/entities/experiment.entity.esm +71 -0
- package/dist/modules/tickets/entities/ticket.entity.cjs +1 -0
- package/dist/modules/tickets/entities/ticket.entity.esm +92 -0
- package/dist/modules/tools/entities/tool.entity.cjs +1 -0
- package/dist/modules/tools/entities/tool.entity.esm +129 -0
- package/dist/modules/users/entities/user-role.enum.cjs +1 -0
- package/dist/modules/users/entities/user-role.enum.esm +6 -0
- package/dist/modules/users/entities/user.entity.cjs +1 -0
- package/dist/modules/users/entities/user.entity.esm +88 -0
- package/dist/nfc.service.d.ts +6 -0
- package/dist/nosql.repo.d.ts +2 -0
- package/dist/nosql.repo.service.d.ts +4 -0
- package/dist/packages/capacitor/app.config.cjs +1 -0
- package/dist/packages/capacitor/app.config.d.ts +1 -0
- package/dist/packages/capacitor/app.config.esm +7 -0
- package/dist/packages/crypto/crypto.service.cjs +1 -0
- package/dist/packages/crypto/crypto.service.d.ts +6 -0
- package/dist/packages/crypto/crypto.service.esm +17 -0
- package/dist/packages/crypto/index.cjs +1 -0
- package/dist/packages/crypto/index.d.ts +1 -0
- package/dist/packages/crypto/index.esm +2 -0
- package/dist/packages/dnd/dnd.provider.cjs +1 -0
- package/dist/packages/dnd/dnd.provider.d.ts +3 -0
- package/dist/packages/dnd/dnd.provider.esm +8 -0
- package/dist/packages/dnd/draggeable.cjs +1 -0
- package/dist/packages/dnd/draggeable.d.ts +4 -0
- package/dist/packages/dnd/draggeable.esm +12 -0
- package/dist/packages/dnd/droppable.cjs +1 -0
- package/dist/packages/dnd/droppable.d.ts +8 -0
- package/dist/packages/dnd/droppable.esm +14 -0
- package/dist/packages/dnd/droppeable.cjs +1 -0
- package/dist/packages/dnd/droppeable.d.ts +5 -0
- package/dist/packages/dnd/droppeable.esm +13 -0
- package/dist/packages/dnd/sortable.cjs +1 -0
- package/dist/packages/dnd/sortable.d.ts +11 -0
- package/dist/packages/dnd/sortable.esm +18 -0
- package/dist/packages/env/env.manager.cjs +1 -0
- package/dist/packages/env/env.manager.d.ts +11 -0
- package/dist/packages/env/env.manager.esm +69 -0
- package/dist/packages/env/index.cjs +1 -0
- package/dist/packages/env/index.d.ts +1 -0
- package/dist/packages/env/index.esm +2 -0
- package/dist/packages/flow/flow.renderer.cjs +1 -0
- package/dist/packages/flow/flow.renderer.d.ts +13 -0
- package/dist/packages/flow/flow.renderer.esm +50 -0
- package/dist/packages/flow/flow.types.cjs +0 -0
- package/dist/packages/flow/flow.types.d.ts +30 -0
- package/dist/packages/flow/flow.types.esm +0 -0
- package/dist/packages/formatters/qr-code/qr.encoder.service.cjs +1 -0
- package/dist/packages/formatters/qr-code/qr.encoder.service.d.ts +5 -0
- package/dist/packages/formatters/qr-code/qr.encoder.service.esm +17 -0
- package/dist/packages/formatters/qr-code/qr.renderer.cjs +1 -0
- package/dist/packages/formatters/qr-code/qr.renderer.d.ts +3 -0
- package/dist/packages/formatters/qr-code/qr.renderer.esm +16 -0
- package/dist/packages/formatters/text-code/text-coder.service.cjs +1 -0
- package/dist/packages/formatters/text-code/text-coder.service.d.ts +9 -0
- package/dist/packages/formatters/text-code/text-coder.service.esm +36 -0
- package/dist/packages/i18n/index.cjs +1 -0
- package/dist/packages/i18n/index.d.ts +10 -0
- package/dist/packages/i18n/index.esm +18 -0
- package/dist/packages/i18n/language-toggle.cjs +1 -0
- package/dist/packages/i18n/language-toggle.d.ts +9 -0
- package/dist/packages/i18n/language-toggle.esm +73 -0
- package/dist/packages/indexeddb/builder.cjs +1 -0
- package/dist/packages/indexeddb/builder.d.ts +13 -0
- package/dist/packages/indexeddb/builder.esm +35 -0
- package/dist/packages/indexeddb/index.cjs +1 -0
- package/dist/packages/indexeddb/index.d.ts +5 -0
- package/dist/packages/indexeddb/index.esm +5 -0
- package/dist/packages/indexeddb/indexeddb.service.cjs +1 -0
- package/dist/packages/indexeddb/indexeddb.service.d.ts +21 -0
- package/dist/packages/indexeddb/indexeddb.service.esm +59 -0
- package/dist/packages/indexeddb/nosql.repo.cjs +1 -0
- package/dist/packages/indexeddb/nosql.repo.d.ts +33 -0
- package/dist/packages/indexeddb/nosql.repo.esm +69 -0
- package/dist/packages/indexeddb/nosql.repo.service.cjs +1 -0
- package/dist/packages/indexeddb/nosql.repo.service.d.ts +46 -0
- package/dist/packages/indexeddb/nosql.repo.service.esm +87 -0
- package/dist/packages/indexeddb/registry.cjs +1 -0
- package/dist/packages/indexeddb/registry.d.ts +21 -0
- package/dist/packages/indexeddb/registry.esm +22 -0
- package/dist/packages/indexeddb/types.cjs +0 -0
- package/dist/packages/indexeddb/types.d.ts +33 -0
- package/dist/packages/indexeddb/types.esm +0 -0
- package/dist/packages/logger/index.cjs +1 -0
- package/dist/packages/logger/index.d.ts +2 -0
- package/dist/packages/logger/index.esm +3 -0
- package/dist/packages/logger/logger.cjs +1 -0
- package/dist/packages/logger/logger.d.ts +137 -0
- package/dist/packages/logger/logger.esm +186 -0
- package/dist/packages/logger/registry.cjs +1 -0
- package/dist/packages/logger/registry.d.ts +9 -0
- package/dist/packages/logger/registry.esm +17 -0
- package/dist/packages/maps/deckgl-overlay.cjs +1 -0
- package/dist/packages/maps/deckgl-overlay.d.ts +9 -0
- package/dist/packages/maps/deckgl-overlay.esm +12 -0
- package/dist/packages/maps/maps.renderer.cjs +1 -0
- package/dist/packages/maps/maps.renderer.d.ts +19 -0
- package/dist/packages/maps/maps.renderer.esm +25 -0
- package/dist/packages/maps/markers/marker.factory.cjs +1 -0
- package/dist/packages/maps/markers/marker.factory.d.ts +8 -0
- package/dist/packages/maps/markers/marker.factory.esm +58 -0
- package/dist/packages/maps/markers/marker.guard.cjs +1 -0
- package/dist/packages/maps/markers/marker.guard.d.ts +22 -0
- package/dist/packages/maps/markers/marker.guard.esm +37 -0
- package/dist/packages/maps/markers/markers.meta.cjs +0 -0
- package/dist/packages/maps/markers/markers.meta.d.ts +12 -0
- package/dist/packages/maps/markers/markers.meta.esm +0 -0
- package/dist/packages/maps/styles/dark.style.cjs +1 -0
- package/dist/packages/maps/styles/dark.style.d.ts +1 -0
- package/dist/packages/maps/styles/dark.style.esm +93 -0
- package/dist/packages/nfc/nfc.service.cjs +1 -0
- package/dist/packages/nfc/nfc.service.d.ts +41 -0
- package/dist/packages/nfc/nfc.service.esm +104 -0
- package/dist/packages/requests/axios/base.connector.cjs +1 -0
- package/dist/packages/requests/axios/base.connector.d.ts +37 -0
- package/dist/packages/requests/axios/base.connector.esm +25 -0
- package/dist/packages/requests/axios/base.service.cjs +1 -0
- package/dist/packages/requests/axios/base.service.d.ts +41 -0
- package/dist/packages/requests/axios/base.service.esm +11 -0
- package/dist/packages/requests/axios/interceptor.builder.cjs +1 -0
- package/dist/packages/requests/axios/interceptor.builder.d.ts +26 -0
- package/dist/packages/requests/axios/interceptor.builder.esm +20 -0
- package/dist/packages/router/build.router.cjs +1 -0
- package/dist/packages/router/build.router.d.ts +6 -0
- package/dist/packages/router/build.router.esm +9 -0
- package/dist/packages/router/route.builder.cjs +1 -0
- package/dist/packages/router/route.builder.d.ts +46 -0
- package/dist/packages/router/route.builder.esm +50 -0
- package/dist/packages/scanner/scanner.formats.cjs +1 -0
- package/dist/packages/scanner/scanner.formats.d.ts +51 -0
- package/dist/packages/scanner/scanner.formats.esm +96 -0
- package/dist/packages/scanner/scanner.service.cjs +1 -0
- package/dist/packages/scanner/scanner.service.d.ts +32 -0
- package/dist/packages/scanner/scanner.service.esm +32 -0
- package/dist/packages/sheets/index.cjs +1 -0
- package/dist/packages/sheets/index.d.ts +2 -0
- package/dist/packages/sheets/index.esm +3 -0
- package/dist/packages/sheets/sheets.connector.cjs +1 -0
- package/dist/packages/sheets/sheets.connector.d.ts +6 -0
- package/dist/packages/sheets/sheets.connector.esm +21 -0
- package/dist/packages/sheets/sheets.service.cjs +1 -0
- package/dist/packages/sheets/sheets.service.d.ts +21 -0
- package/dist/packages/sheets/sheets.service.esm +38 -0
- package/dist/packages/sqlite/base/base.entity.cjs +1 -0
- package/dist/packages/sqlite/base/base.entity.d.ts +5 -0
- package/dist/packages/sqlite/base/base.entity.esm +41 -0
- package/dist/packages/sqlite/repo.service.cjs +1 -0
- package/dist/packages/sqlite/repo.service.d.ts +22 -0
- package/dist/packages/sqlite/repo.service.esm +52 -0
- package/dist/packages/sqlite/sqlite.service.cjs +1 -0
- package/dist/packages/sqlite/sqlite.service.d.ts +40 -0
- package/dist/packages/sqlite/sqlite.service.esm +77 -0
- package/dist/packages/sqlite/templates/test.entity.cjs +1 -0
- package/dist/packages/sqlite/templates/test.entity.d.ts +6 -0
- package/dist/packages/sqlite/templates/test.entity.esm +62 -0
- package/dist/packages/sqlite/templates/test.repo.service.cjs +1 -0
- package/dist/packages/sqlite/templates/test.repo.service.d.ts +8 -0
- package/dist/packages/sqlite/templates/test.repo.service.esm +26 -0
- package/dist/packages/stores/storage.service.cjs +1 -0
- package/dist/packages/stores/storage.service.d.ts +5 -0
- package/dist/packages/stores/storage.service.esm +22 -0
- package/dist/packages/stores/store.hook.cjs +1 -0
- package/dist/packages/stores/store.hook.d.ts +23 -0
- package/dist/packages/stores/store.hook.esm +22 -0
- package/dist/packages/stores/store.service.cjs +1 -0
- package/dist/packages/stores/store.service.d.ts +12 -0
- package/dist/packages/stores/store.service.esm +48 -0
- package/dist/packages/theme/theme-builder.cjs +1 -0
- package/dist/packages/theme/theme-builder.d.ts +19 -0
- package/dist/packages/theme/theme-builder.esm +25 -0
- package/dist/packages/theme/theme-provider.cjs +1 -0
- package/dist/packages/theme/theme-provider.d.ts +7 -0
- package/dist/packages/theme/theme-provider.esm +17 -0
- package/dist/packages/theme/theme-toggle.cjs +1 -0
- package/dist/packages/theme/theme-toggle.d.ts +6 -0
- package/dist/packages/theme/theme-toggle.esm +33 -0
- package/dist/packages/w3/tron/index.cjs +1 -0
- package/dist/packages/w3/tron/index.d.ts +4 -0
- package/dist/packages/w3/tron/index.esm +4 -0
- package/dist/packages/w3/tron/tron-assets.service.cjs +1 -0
- package/dist/packages/w3/tron/tron-assets.service.d.ts +38 -0
- package/dist/packages/w3/tron/tron-assets.service.esm +116 -0
- package/dist/packages/w3/tron/tron-wallet.entity.cjs +1 -0
- package/dist/packages/w3/tron/tron-wallet.entity.d.ts +15 -0
- package/dist/packages/w3/tron/tron-wallet.entity.esm +88 -0
- package/dist/packages/w3/tron/tron-wallet.repo.cjs +1 -0
- package/dist/packages/w3/tron/tron-wallet.repo.d.ts +30 -0
- package/dist/packages/w3/tron/tron-wallet.repo.esm +52 -0
- package/dist/packages/w3/tron/tron.service.cjs +1 -0
- package/dist/packages/w3/tron/tron.service.d.ts +124 -0
- package/dist/packages/w3/tron/tron.service.esm +406 -0
- package/dist/packages/w3/tron/tron.types.cjs +0 -0
- package/dist/packages/w3/tron/tron.types.d.ts +129 -0
- package/dist/packages/w3/tron/tron.types.esm +0 -0
- package/dist/page-container.d.ts +2 -0
- package/dist/popover.d.ts +2 -0
- package/dist/qr.encoder.service.d.ts +4 -0
- package/dist/qr.renderer.d.ts +4 -0
- package/dist/registry.d.ts +2 -0
- package/dist/repo.service.d.ts +4 -0
- package/dist/repository.contract.d.ts +1 -0
- package/dist/route.builder.d.ts +4 -0
- package/dist/scanner.formats.d.ts +2 -0
- package/dist/scanner.service.d.ts +2 -0
- package/dist/scroll-area.d.ts +2 -0
- package/dist/secret.input.d.ts +4 -0
- package/dist/select.d.ts +2 -0
- package/dist/select.input.d.ts +4 -0
- package/dist/separator.d.ts +2 -0
- package/dist/shared/assets/social-icons.cjs +1 -0
- package/dist/shared/assets/social-icons.d.ts +2 -0
- package/dist/shared/assets/social-icons.esm +30 -0
- package/dist/shared/constants/connectors/main.connector.cjs +1 -0
- package/dist/shared/constants/connectors/main.connector.d.ts +8 -0
- package/dist/shared/constants/connectors/main.connector.esm +38 -0
- package/dist/shared/constants/services/main.service.cjs +1 -0
- package/dist/shared/constants/services/main.service.d.ts +7 -0
- package/dist/shared/constants/services/main.service.esm +26 -0
- package/dist/shared/contracts/repository.contract.cjs +0 -0
- package/dist/shared/contracts/repository.contract.d.ts +26 -0
- package/dist/shared/contracts/repository.contract.esm +0 -0
- package/dist/shared/custom/actions/back-button.action.cjs +1 -0
- package/dist/shared/custom/actions/back-button.action.d.ts +13 -0
- package/dist/shared/custom/actions/back-button.action.esm +20 -0
- package/dist/shared/custom/audit/audit-view.cjs +1 -0
- package/dist/shared/custom/audit/audit-view.d.ts +46 -0
- package/dist/shared/custom/audit/audit-view.esm +73 -0
- package/dist/shared/custom/confirm/use-confirm.cjs +1 -0
- package/dist/shared/custom/confirm/use-confirm.d.ts +15 -0
- package/dist/shared/custom/confirm/use-confirm.esm +57 -0
- package/dist/shared/custom/data-table/data-table.component.cjs +1 -0
- package/dist/shared/custom/data-table/data-table.component.d.ts +9 -0
- package/dist/shared/custom/data-table/data-table.component.esm +26 -0
- package/dist/shared/custom/data-table/data-table.provider.cjs +0 -0
- package/dist/shared/custom/data-table/data-table.provider.d.ts +1 -0
- package/dist/shared/custom/data-table/data-table.provider.esm +0 -0
- package/dist/shared/custom/flow/flow-canvas.cjs +1 -0
- package/dist/shared/custom/flow/flow-canvas.d.ts +10 -0
- package/dist/shared/custom/flow/flow-canvas.esm +23 -0
- package/dist/shared/custom/flow/nodes/base.node.cjs +1 -0
- package/dist/shared/custom/flow/nodes/base.node.d.ts +9 -0
- package/dist/shared/custom/flow/nodes/base.node.esm +51 -0
- package/dist/shared/custom/form/form.component.cjs +1 -0
- package/dist/shared/custom/form/form.component.d.ts +13 -0
- package/dist/shared/custom/form/form.component.esm +26 -0
- package/dist/shared/custom/form/index.cjs +1 -0
- package/dist/shared/custom/form/index.d.ts +17 -0
- package/dist/shared/custom/form/index.esm +2 -0
- package/dist/shared/custom/form/inputs/async-combobox.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/async-combobox.input.d.ts +18 -0
- package/dist/shared/custom/form/inputs/async-combobox.input.esm +91 -0
- package/dist/shared/custom/form/inputs/async-multi-select.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/async-multi-select.input.d.ts +20 -0
- package/dist/shared/custom/form/inputs/async-multi-select.input.esm +127 -0
- package/dist/shared/custom/form/inputs/async-select.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/async-select.input.d.ts +15 -0
- package/dist/shared/custom/form/inputs/async-select.input.esm +71 -0
- package/dist/shared/custom/form/inputs/checkbox-inline.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/checkbox-inline.input.d.ts +15 -0
- package/dist/shared/custom/form/inputs/checkbox-inline.input.esm +41 -0
- package/dist/shared/custom/form/inputs/checkbox.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/checkbox.input.d.ts +21 -0
- package/dist/shared/custom/form/inputs/checkbox.input.esm +50 -0
- package/dist/shared/custom/form/inputs/code.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/code.input.d.ts +11 -0
- package/dist/shared/custom/form/inputs/code.input.esm +58 -0
- package/dist/shared/custom/form/inputs/color.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/color.input.d.ts +11 -0
- package/dist/shared/custom/form/inputs/color.input.esm +47 -0
- package/dist/shared/custom/form/inputs/combobox.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/combobox.input.d.ts +18 -0
- package/dist/shared/custom/form/inputs/combobox.input.esm +73 -0
- package/dist/shared/custom/form/inputs/date.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/date.input.d.ts +11 -0
- package/dist/shared/custom/form/inputs/date.input.esm +52 -0
- package/dist/shared/custom/form/inputs/email.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/email.input.d.ts +12 -0
- package/dist/shared/custom/form/inputs/email.input.esm +47 -0
- package/dist/shared/custom/form/inputs/file.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/file.input.d.ts +11 -0
- package/dist/shared/custom/form/inputs/file.input.esm +95 -0
- package/dist/shared/custom/form/inputs/image.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/image.input.d.ts +11 -0
- package/dist/shared/custom/form/inputs/image.input.esm +90 -0
- package/dist/shared/custom/form/inputs/list-select.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/list-select.input.d.ts +17 -0
- package/dist/shared/custom/form/inputs/list-select.input.esm +53 -0
- package/dist/shared/custom/form/inputs/secret.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/secret.input.d.ts +11 -0
- package/dist/shared/custom/form/inputs/secret.input.esm +53 -0
- package/dist/shared/custom/form/inputs/select.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/select.input.d.ts +17 -0
- package/dist/shared/custom/form/inputs/select.input.esm +44 -0
- package/dist/shared/custom/form/inputs/tags.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/tags.input.d.ts +16 -0
- package/dist/shared/custom/form/inputs/tags.input.esm +80 -0
- package/dist/shared/custom/form/inputs/text.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/text.input.d.ts +13 -0
- package/dist/shared/custom/form/inputs/text.input.esm +47 -0
- package/dist/shared/custom/form/inputs/textarea.input.cjs +1 -0
- package/dist/shared/custom/form/inputs/textarea.input.d.ts +12 -0
- package/dist/shared/custom/form/inputs/textarea.input.esm +36 -0
- package/dist/shared/custom/form/layout/form-dialog-layout.cjs +1 -0
- package/dist/shared/custom/form/layout/form-dialog-layout.d.ts +25 -0
- package/dist/shared/custom/form/layout/form-dialog-layout.esm +37 -0
- package/dist/shared/custom/form/layout/form-tab-layout.cjs +1 -0
- package/dist/shared/custom/form/layout/form-tab-layout.d.ts +30 -0
- package/dist/shared/custom/form/layout/form-tab-layout.esm +69 -0
- package/dist/shared/custom/hover/hover.cjs +1 -0
- package/dist/shared/custom/hover/hover.d.ts +6 -0
- package/dist/shared/custom/hover/hover.esm +20 -0
- package/dist/shared/custom/layouts/canvas-view.layout.cjs +1 -0
- package/dist/shared/custom/layouts/canvas-view.layout.d.ts +18 -0
- package/dist/shared/custom/layouts/canvas-view.layout.esm +15 -0
- package/dist/shared/custom/layouts/detail-tabs.layout.cjs +1 -0
- package/dist/shared/custom/layouts/detail-tabs.layout.d.ts +27 -0
- package/dist/shared/custom/layouts/detail-tabs.layout.esm +32 -0
- package/dist/shared/custom/layouts/detail-view.layout.cjs +1 -0
- package/dist/shared/custom/layouts/detail-view.layout.d.ts +33 -0
- package/dist/shared/custom/layouts/detail-view.layout.esm +64 -0
- package/dist/shared/custom/layouts/feedback.layout.cjs +1 -0
- package/dist/shared/custom/layouts/feedback.layout.d.ts +14 -0
- package/dist/shared/custom/layouts/feedback.layout.esm +20 -0
- package/dist/shared/custom/layouts/grid.layout.cjs +1 -0
- package/dist/shared/custom/layouts/grid.layout.d.ts +38 -0
- package/dist/shared/custom/layouts/grid.layout.esm +39 -0
- package/dist/shared/custom/layouts/page-container.cjs +1 -0
- package/dist/shared/custom/layouts/page-container.d.ts +6 -0
- package/dist/shared/custom/layouts/page-container.esm +12 -0
- package/dist/shared/custom/ui/icon-box.cjs +1 -0
- package/dist/shared/custom/ui/icon-box.d.ts +12 -0
- package/dist/shared/custom/ui/icon-box.esm +21 -0
- package/dist/shared/custom/ui/typography.cjs +1 -0
- package/dist/shared/custom/ui/typography.d.ts +11 -0
- package/dist/shared/custom/ui/typography.esm +30 -0
- package/dist/shared/hooks/use-device.cjs +1 -0
- package/dist/shared/hooks/use-device.d.ts +10 -0
- package/dist/shared/hooks/use-device.esm +37 -0
- package/dist/shared/hooks/use-i18n.cjs +1 -0
- package/dist/shared/hooks/use-i18n.d.ts +10 -0
- package/dist/shared/hooks/use-i18n.esm +15 -0
- package/dist/shared/hooks/use-mobile.cjs +1 -0
- package/dist/shared/hooks/use-mobile.d.ts +1 -0
- package/dist/shared/hooks/use-mobile.esm +14 -0
- package/dist/shared/lib/utils.cjs +1 -0
- package/dist/shared/lib/utils.d.ts +2 -0
- package/dist/shared/lib/utils.esm +8 -0
- package/dist/shared/logic/action/action-processor.cjs +1 -0
- package/dist/shared/logic/action/action-processor.d.ts +86 -0
- package/dist/shared/logic/action/action-processor.esm +30 -0
- package/dist/shared/logic/components/components.registry.cjs +1 -0
- package/dist/shared/logic/components/components.registry.d.ts +16 -0
- package/dist/shared/logic/components/components.registry.esm +26 -0
- package/dist/shared/logic/events/startable.cjs +1 -0
- package/dist/shared/logic/events/startable.d.ts +7 -0
- package/dist/shared/logic/events/startable.esm +32 -0
- package/dist/shared/logic/events/use-on-start.hook.cjs +1 -0
- package/dist/shared/logic/events/use-on-start.hook.d.ts +12 -0
- package/dist/shared/logic/events/use-on-start.hook.esm +15 -0
- package/dist/shared/logic/factory/component.factory.cjs +1 -0
- package/dist/shared/logic/factory/component.factory.d.ts +9 -0
- package/dist/shared/logic/factory/component.factory.esm +28 -0
- package/dist/shared/logic/guards/builder-device.guard.cjs +1 -0
- package/dist/shared/logic/guards/builder-device.guard.d.ts +5 -0
- package/dist/shared/logic/guards/builder-device.guard.esm +10 -0
- package/dist/shared/logic/guards/component.guard.cjs +1 -0
- package/dist/shared/logic/guards/component.guard.d.ts +5 -0
- package/dist/shared/logic/guards/component.guard.esm +13 -0
- package/dist/shared/logic/guards/context.guard.cjs +1 -0
- package/dist/shared/logic/guards/context.guard.d.ts +13 -0
- package/dist/shared/logic/guards/context.guard.esm +9 -0
- package/dist/shared/logic/guards/device-artifact.guard.cjs +1 -0
- package/dist/shared/logic/guards/device-artifact.guard.d.ts +16 -0
- package/dist/shared/logic/guards/device-artifact.guard.esm +44 -0
- package/dist/shared/logic/guards/device.guard.cjs +1 -0
- package/dist/shared/logic/guards/device.guard.d.ts +17 -0
- package/dist/shared/logic/guards/device.guard.esm +40 -0
- package/dist/shared/logic/guards/dynamic-device.guard.cjs +1 -0
- package/dist/shared/logic/guards/dynamic-device.guard.d.ts +5 -0
- package/dist/shared/logic/guards/dynamic-device.guard.esm +10 -0
- package/dist/shared/logic/guards/guard.cjs +1 -0
- package/dist/shared/logic/guards/guard.d.ts +24 -0
- package/dist/shared/logic/guards/guard.esm +18 -0
- package/dist/shared/logic/service/base.service.cjs +1 -0
- package/dist/shared/logic/service/base.service.d.ts +3 -0
- package/dist/shared/logic/service/base.service.esm +5 -0
- package/dist/shared/logic/verifiers/context.verifier.cjs +1 -0
- package/dist/shared/logic/verifiers/context.verifier.d.ts +7 -0
- package/dist/shared/logic/verifiers/context.verifier.esm +31 -0
- package/dist/shared/logic/verifiers/device.verifier.registry.cjs +1 -0
- package/dist/shared/logic/verifiers/device.verifier.registry.d.ts +13 -0
- package/dist/shared/logic/verifiers/device.verifier.registry.esm +36 -0
- package/dist/shared/logic/verifiers/enum.verifier.cjs +1 -0
- package/dist/shared/logic/verifiers/enum.verifier.d.ts +4 -0
- package/dist/shared/logic/verifiers/enum.verifier.esm +9 -0
- package/dist/shared/logic/verifiers/value.verifier.cjs +1 -0
- package/dist/shared/logic/verifiers/value.verifier.d.ts +5 -0
- package/dist/shared/logic/verifiers/value.verifier.esm +9 -0
- package/dist/shared/ui/badge.cjs +1 -0
- package/dist/shared/ui/badge.d.ts +9 -0
- package/dist/shared/ui/badge.esm +27 -0
- package/dist/shared/ui/breadcrumb.cjs +1 -0
- package/dist/shared/ui/breadcrumb.d.ts +11 -0
- package/dist/shared/ui/breadcrumb.esm +70 -0
- package/dist/shared/ui/button.cjs +1 -0
- package/dist/shared/ui/button.d.ts +11 -0
- package/dist/shared/ui/button.esm +47 -0
- package/dist/shared/ui/calendar.cjs +1 -0
- package/dist/shared/ui/calendar.d.ts +10 -0
- package/dist/shared/ui/calendar.esm +92 -0
- package/dist/shared/ui/card.cjs +1 -0
- package/dist/shared/ui/card.d.ts +11 -0
- package/dist/shared/ui/card.esm +56 -0
- package/dist/shared/ui/checkbox.cjs +1 -0
- package/dist/shared/ui/checkbox.d.ts +4 -0
- package/dist/shared/ui/checkbox.esm +20 -0
- package/dist/shared/ui/combobox.cjs +1 -0
- package/dist/shared/ui/combobox.d.ts +24 -0
- package/dist/shared/ui/combobox.esm +163 -0
- package/dist/shared/ui/command.cjs +1 -0
- package/dist/shared/ui/command.d.ts +18 -0
- package/dist/shared/ui/command.esm +87 -0
- package/dist/shared/ui/custom/dynamic-icon.cjs +1 -0
- package/dist/shared/ui/custom/dynamic-icon.d.ts +13 -0
- package/dist/shared/ui/custom/dynamic-icon.esm +15 -0
- package/dist/shared/ui/dialog.cjs +1 -0
- package/dist/shared/ui/dialog.d.ts +17 -0
- package/dist/shared/ui/dialog.esm +95 -0
- package/dist/shared/ui/field.cjs +1 -0
- package/dist/shared/ui/field.d.ts +24 -0
- package/dist/shared/ui/field.esm +107 -0
- package/dist/shared/ui/icon-button.cjs +1 -0
- package/dist/shared/ui/icon-button.d.ts +6 -0
- package/dist/shared/ui/icon-button.esm +14 -0
- package/dist/shared/ui/index.cjs +1 -0
- package/dist/shared/ui/index.d.ts +23 -0
- package/dist/shared/ui/index.esm +24 -0
- package/dist/shared/ui/input-group.cjs +1 -0
- package/dist/shared/ui/input-group.d.ts +16 -0
- package/dist/shared/ui/input-group.esm +77 -0
- package/dist/shared/ui/input.cjs +1 -0
- package/dist/shared/ui/input.d.ts +3 -0
- package/dist/shared/ui/input.esm +14 -0
- package/dist/shared/ui/label.cjs +1 -0
- package/dist/shared/ui/label.d.ts +4 -0
- package/dist/shared/ui/label.esm +14 -0
- package/dist/shared/ui/popover.cjs +1 -0
- package/dist/shared/ui/popover.d.ts +7 -0
- package/dist/shared/ui/popover.esm +35 -0
- package/dist/shared/ui/scroll-area.cjs +1 -0
- package/dist/shared/ui/scroll-area.d.ts +5 -0
- package/dist/shared/ui/scroll-area.esm +36 -0
- package/dist/shared/ui/select.cjs +1 -0
- package/dist/shared/ui/select.d.ts +15 -0
- package/dist/shared/ui/select.esm +99 -0
- package/dist/shared/ui/separator.cjs +1 -0
- package/dist/shared/ui/separator.d.ts +4 -0
- package/dist/shared/ui/separator.esm +16 -0
- package/dist/shared/ui/sheet.cjs +1 -0
- package/dist/shared/ui/sheet.d.ts +14 -0
- package/dist/shared/ui/sheet.esm +89 -0
- package/dist/shared/ui/sidebar.cjs +1 -0
- package/dist/shared/ui/sidebar.d.ts +69 -0
- package/dist/shared/ui/sidebar.esm +348 -0
- package/dist/shared/ui/skeleton.cjs +1 -0
- package/dist/shared/ui/skeleton.d.ts +2 -0
- package/dist/shared/ui/skeleton.esm +12 -0
- package/dist/shared/ui/sonner.cjs +1 -0
- package/dist/shared/ui/sonner.d.ts +3 -0
- package/dist/shared/ui/sonner.esm +29 -0
- package/dist/shared/ui/table.cjs +1 -0
- package/dist/shared/ui/table.d.ts +10 -0
- package/dist/shared/ui/table.esm +66 -0
- package/dist/shared/ui/tabs.cjs +1 -0
- package/dist/shared/ui/tabs.d.ts +11 -0
- package/dist/shared/ui/tabs.esm +45 -0
- package/dist/shared/ui/textarea.cjs +1 -0
- package/dist/shared/ui/textarea.d.ts +3 -0
- package/dist/shared/ui/textarea.esm +13 -0
- package/dist/shared/ui/tooltip.cjs +1 -0
- package/dist/shared/ui/tooltip.d.ts +7 -0
- package/dist/shared/ui/tooltip.esm +36 -0
- package/dist/sheet.d.ts +2 -0
- package/dist/sheets.connector.d.ts +2 -0
- package/dist/sheets.service.d.ts +2 -0
- package/dist/sidebar.d.ts +2 -0
- package/dist/skeleton.d.ts +2 -0
- package/dist/social-icons.d.ts +2 -0
- package/dist/sonner.d.ts +2 -0
- package/dist/sortable.d.ts +2 -0
- package/dist/sqlite.service.d.ts +6 -0
- package/dist/startable.d.ts +4 -0
- package/dist/storage.service.d.ts +4 -0
- package/dist/store.hook.d.ts +4 -0
- package/dist/store.service.d.ts +4 -0
- package/dist/table.d.ts +2 -0
- package/dist/tabs.d.ts +2 -0
- package/dist/tags.input.d.ts +4 -0
- package/dist/test.entity.d.ts +2 -0
- package/dist/test.repo.service.d.ts +6 -0
- package/dist/text-coder.service.d.ts +2 -0
- package/dist/text.input.d.ts +4 -0
- package/dist/textarea.d.ts +2 -0
- package/dist/textarea.input.d.ts +4 -0
- package/dist/theme-builder.d.ts +2 -0
- package/dist/theme-provider.d.ts +2 -0
- package/dist/theme-toggle.d.ts +2 -0
- package/dist/tooltip.d.ts +2 -0
- package/dist/tron-assets.service.d.ts +2 -0
- package/dist/tron-wallet.entity.d.ts +2 -0
- package/dist/tron-wallet.repo.d.ts +2 -0
- package/dist/tron.service.d.ts +2 -0
- package/dist/tron.types.d.ts +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/typography.d.ts +2 -0
- package/dist/use-confirm.d.ts +2 -0
- package/dist/use-device.d.ts +2 -0
- package/dist/use-i18n.d.ts +2 -0
- package/dist/use-mobile.d.ts +2 -0
- package/dist/use-on-start.hook.d.ts +2 -0
- package/dist/utils.d.ts +2 -0
- package/dist/value.verifier.d.ts +4 -0
- package/package.json +155 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { INDEXEDDB_REGISTRY as e } from "./registry.esm";
|
|
2
|
+
//#region src/packages/indexeddb/builder.ts
|
|
3
|
+
var t = class {
|
|
4
|
+
constructor(e) {
|
|
5
|
+
this.config = void 0, this.config = {
|
|
6
|
+
name: e,
|
|
7
|
+
keyPath: "id",
|
|
8
|
+
autoIncrement: !1,
|
|
9
|
+
indexes: []
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
setKeyPath(e) {
|
|
13
|
+
return this.config.keyPath = e, this;
|
|
14
|
+
}
|
|
15
|
+
setAutoIncrement(e = !0) {
|
|
16
|
+
return this.config.autoIncrement = e, this;
|
|
17
|
+
}
|
|
18
|
+
addIndex(e, t, n) {
|
|
19
|
+
let r = {
|
|
20
|
+
name: e,
|
|
21
|
+
keyPath: t,
|
|
22
|
+
unique: n?.unique ?? !1,
|
|
23
|
+
multiEntry: n?.multiEntry ?? !1
|
|
24
|
+
};
|
|
25
|
+
return this.config.indexes?.push(r), this;
|
|
26
|
+
}
|
|
27
|
+
build() {
|
|
28
|
+
return { ...this.config };
|
|
29
|
+
}
|
|
30
|
+
register() {
|
|
31
|
+
return e.register(this.build());
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { t as StoreBuilder };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./registry.cjs`),t=require(`./builder.cjs`),n=require(`./nosql.repo.cjs`),r=require(`./indexeddb.service.cjs`);exports.INDEXEDDB_REGISTRY=e.INDEXEDDB_REGISTRY,exports.INDEXEDDB_SERVICE=r.INDEXEDDB_SERVICE,exports.IndexedDbService=r,exports.NoSqlRepository=n.NoSqlRepository,exports.StoreBuilder=t.StoreBuilder;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { INDEXEDDB_REGISTRY as e } from "./registry.esm";
|
|
2
|
+
import { StoreBuilder as t } from "./builder.esm";
|
|
3
|
+
import { NoSqlRepository as n } from "./nosql.repo.esm";
|
|
4
|
+
import r, { INDEXEDDB_SERVICE as i } from "./indexeddb.service.esm";
|
|
5
|
+
export { e as INDEXEDDB_REGISTRY, i as INDEXEDDB_SERVICE, r as IndexedDbService, n as NoSqlRepository, t as StoreBuilder };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../shared/logic/service/base.service.cjs`),t=require(`../logger/logger.cjs`),n=require(`./nosql.repo.cjs`);let r=require(`sonner`);var i=t.GLOBAL_LOGGER.child(`[IndexedDB]`),a=class t extends e{constructor(){super(),this._db=null,this._config=null,i.debug(`Initializing IndexedDB Service...`)}static get instance(){return this._instance||=new t,this._instance}async initialize(e){return i.info(`Starting initialization for Database "${e.name}" (v${e.version})...`),this._config=e,new Promise((t,n)=>{let a=indexedDB.open(e.name,e.version);a.onupgradeneeded=t=>{let n=t.target.result,r=t.oldVersion,a=t.newVersion;i.info(`Upgrading Database "${e.name}" from v${r} to v${a}`),e.stores.forEach(e=>{if(!n.objectStoreNames.contains(e.name)){i.debug(`Creating object store: ${e.name}`);let t=n.createObjectStore(e.name,{keyPath:e.keyPath,autoIncrement:e.autoIncrement??!1});e.indexes?.forEach(n=>{i.debug(`- Creating index: ${n.name} for ${e.name}`),t.createIndex(n.name,n.keyPath,{unique:n.unique??!1,multiEntry:n.multiEntry??!1})})}})},a.onsuccess=n=>{this._db=n.target.result,i.info(`Database "${e.name}" connected successfully (v${this._db.version})`),this._db.onversionchange=()=>{this._db?.close(),i.warn(`Database version changed in another tab. Closing connection to allow upgrade.`),window.location.reload()},this.setReady(),t()},a.onblocked=()=>{i.warn(`Upgrade blocked! Please close other tabs of "${e.name}" to allow version upgrade.`),r.toast.warning(`Actualización bloqueada`,{description:`Por favor, cierra otras pestañas de la aplicación para completar la migración de datos.`})},a.onerror=t=>{let r=t.target.error;i.error(`Failed to connect to Database "${e.name}"`,r),n(r)}})}getRepository(e){return new n.NoSqlRepository(e)}get db(){if(!this._db)throw Error(`Database not initialized`);return this._db}get config(){return this._config}};a._instance=void 0;var o=a.instance;exports.INDEXEDDB_SERVICE=o,exports.default=a;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as BaseService } from '../../shared/logic/service/base.service';
|
|
2
|
+
import { DatabaseConfig } from './types';
|
|
3
|
+
import { NoSqlRepository } from './nosql.repo';
|
|
4
|
+
export default class IndexedDbService extends BaseService {
|
|
5
|
+
private _db;
|
|
6
|
+
private _config;
|
|
7
|
+
private constructor();
|
|
8
|
+
private static _instance;
|
|
9
|
+
static get instance(): IndexedDbService;
|
|
10
|
+
/**
|
|
11
|
+
* Initializes the database connection
|
|
12
|
+
*/
|
|
13
|
+
initialize(config: DatabaseConfig): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Gets a repository for a specific object store
|
|
16
|
+
*/
|
|
17
|
+
getRepository<T>(storeName: string): NoSqlRepository<T>;
|
|
18
|
+
get db(): IDBDatabase;
|
|
19
|
+
get config(): DatabaseConfig | null;
|
|
20
|
+
}
|
|
21
|
+
export declare const INDEXEDDB_SERVICE: IndexedDbService;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import e from "../../shared/logic/service/base.service.esm";
|
|
2
|
+
import { GLOBAL_LOGGER as t } from "../logger/logger.esm";
|
|
3
|
+
import { NoSqlRepository as n } from "./nosql.repo.esm";
|
|
4
|
+
import { toast as r } from "sonner";
|
|
5
|
+
//#region src/packages/indexeddb/indexeddb.service.ts
|
|
6
|
+
var i = t.child("[IndexedDB]"), a = class t extends e {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(), this._db = null, this._config = null, i.debug("Initializing IndexedDB Service...");
|
|
9
|
+
}
|
|
10
|
+
static get instance() {
|
|
11
|
+
return this._instance ||= new t(), this._instance;
|
|
12
|
+
}
|
|
13
|
+
async initialize(e) {
|
|
14
|
+
return i.info(`Starting initialization for Database "${e.name}" (v${e.version})...`), this._config = e, new Promise((t, n) => {
|
|
15
|
+
let a = indexedDB.open(e.name, e.version);
|
|
16
|
+
a.onupgradeneeded = (t) => {
|
|
17
|
+
let n = t.target.result, r = t.oldVersion, a = t.newVersion;
|
|
18
|
+
i.info(`Upgrading Database "${e.name}" from v${r} to v${a}`), e.stores.forEach((e) => {
|
|
19
|
+
if (!n.objectStoreNames.contains(e.name)) {
|
|
20
|
+
i.debug(`Creating object store: ${e.name}`);
|
|
21
|
+
let t = n.createObjectStore(e.name, {
|
|
22
|
+
keyPath: e.keyPath,
|
|
23
|
+
autoIncrement: e.autoIncrement ?? !1
|
|
24
|
+
});
|
|
25
|
+
e.indexes?.forEach((n) => {
|
|
26
|
+
i.debug(`- Creating index: ${n.name} for ${e.name}`), t.createIndex(n.name, n.keyPath, {
|
|
27
|
+
unique: n.unique ?? !1,
|
|
28
|
+
multiEntry: n.multiEntry ?? !1
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}, a.onsuccess = (n) => {
|
|
34
|
+
this._db = n.target.result, i.info(`Database "${e.name}" connected successfully (v${this._db.version})`), this._db.onversionchange = () => {
|
|
35
|
+
this._db?.close(), i.warn("Database version changed in another tab. Closing connection to allow upgrade."), window.location.reload();
|
|
36
|
+
}, this.setReady(), t();
|
|
37
|
+
}, a.onblocked = () => {
|
|
38
|
+
i.warn(`Upgrade blocked! Please close other tabs of "${e.name}" to allow version upgrade.`), r.warning("Actualización bloqueada", { description: "Por favor, cierra otras pestañas de la aplicación para completar la migración de datos." });
|
|
39
|
+
}, a.onerror = (t) => {
|
|
40
|
+
let r = t.target.error;
|
|
41
|
+
i.error(`Failed to connect to Database "${e.name}"`, r), n(r);
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getRepository(e) {
|
|
46
|
+
return new n(e);
|
|
47
|
+
}
|
|
48
|
+
get db() {
|
|
49
|
+
if (!this._db) throw Error("Database not initialized");
|
|
50
|
+
return this._db;
|
|
51
|
+
}
|
|
52
|
+
get config() {
|
|
53
|
+
return this._config;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
a._instance = void 0;
|
|
57
|
+
var o = a.instance;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { o as INDEXEDDB_SERVICE, a as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../logger/logger.cjs`),t=require(`./indexeddb.service.cjs`);var n=e.GLOBAL_LOGGER.child(`[NoSqlRepo]`),r=class{constructor(e){this.storeName=e}get db(){return t.INDEXEDDB_SERVICE.db}async save(e){return new Promise((t,r)=>{let i=this.db.transaction([this.storeName],`readwrite`).objectStore(this.storeName).put(e);i.onsuccess=()=>t(e),i.onerror=()=>{n.error(`Error saving item in ${this.storeName}`,i.error),r(i.error)}})}async get(e){return new Promise((t,r)=>{let i=this.db.transaction([this.storeName],`readonly`).objectStore(this.storeName).get(e);i.onsuccess=()=>t(i.result||null),i.onerror=()=>{n.error(`Error getting item ${e} from ${this.storeName}`,i.error),r(i.error)}})}async getAll(){return new Promise((e,t)=>{let r=this.db.transaction([this.storeName],`readonly`).objectStore(this.storeName).getAll();r.onsuccess=()=>e(r.result),r.onerror=()=>{n.error(`Error getting all items from ${this.storeName}`,r.error),t(r.error)}})}async delete(e){return new Promise((t,r)=>{let i=this.db.transaction([this.storeName],`readwrite`).objectStore(this.storeName).delete(e);i.onsuccess=()=>t(),i.onerror=()=>{n.error(`Error deleting item ${e} from ${this.storeName}`,i.error),r(i.error)}})}async clear(){return new Promise((e,t)=>{let r=this.db.transaction([this.storeName],`readwrite`).objectStore(this.storeName).clear();r.onsuccess=()=>e(),r.onerror=()=>{n.error(`Error clearing store ${this.storeName}`,r.error),t(r.error)}})}async findByIndex(e,t){return new Promise((r,i)=>{let a=this.db.transaction([this.storeName],`readonly`).objectStore(this.storeName).index(e).get(t);a.onsuccess=()=>r(a.result||null),a.onerror=()=>{n.error(`Error finding item in ${this.storeName} by index ${e}`,a.error),i(a.error)}})}async findAllByIndex(e,t){return new Promise((r,i)=>{let a=this.db.transaction([this.storeName],`readonly`).objectStore(this.storeName).index(e).getAll(t);a.onsuccess=()=>r(a.result||[]),a.onerror=()=>{n.error(`Error finding items in ${this.storeName} by index ${e}`,a.error),i(a.error)}})}};exports.NoSqlRepository=r;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare class NoSqlRepository<T> {
|
|
2
|
+
private storeName;
|
|
3
|
+
constructor(storeName: string);
|
|
4
|
+
private get db();
|
|
5
|
+
/**
|
|
6
|
+
* Saves or updates an item in the store
|
|
7
|
+
*/
|
|
8
|
+
save(item: T): Promise<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Gets an item by its key
|
|
11
|
+
*/
|
|
12
|
+
get(id: string | number): Promise<T | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Gets all items from the store
|
|
15
|
+
*/
|
|
16
|
+
getAll(): Promise<T[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Deletes an item by its key
|
|
19
|
+
*/
|
|
20
|
+
delete(id: string | number): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Clears all items from the store
|
|
23
|
+
*/
|
|
24
|
+
clear(): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Finds an item using an index
|
|
27
|
+
*/
|
|
28
|
+
findByIndex(indexName: string, value: any): Promise<T | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Finds all items using an index
|
|
31
|
+
*/
|
|
32
|
+
findAllByIndex(indexName: string, value: any): Promise<T[]>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { GLOBAL_LOGGER as e } from "../logger/logger.esm";
|
|
2
|
+
import { INDEXEDDB_SERVICE as t } from "./indexeddb.service.esm";
|
|
3
|
+
//#region src/packages/indexeddb/nosql.repo.ts
|
|
4
|
+
var n = e.child("[NoSqlRepo]"), r = class {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
this.storeName = e;
|
|
7
|
+
}
|
|
8
|
+
get db() {
|
|
9
|
+
return t.db;
|
|
10
|
+
}
|
|
11
|
+
async save(e) {
|
|
12
|
+
return new Promise((t, r) => {
|
|
13
|
+
let i = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).put(e);
|
|
14
|
+
i.onsuccess = () => t(e), i.onerror = () => {
|
|
15
|
+
n.error(`Error saving item in ${this.storeName}`, i.error), r(i.error);
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
async get(e) {
|
|
20
|
+
return new Promise((t, r) => {
|
|
21
|
+
let i = this.db.transaction([this.storeName], "readonly").objectStore(this.storeName).get(e);
|
|
22
|
+
i.onsuccess = () => t(i.result || null), i.onerror = () => {
|
|
23
|
+
n.error(`Error getting item ${e} from ${this.storeName}`, i.error), r(i.error);
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
async getAll() {
|
|
28
|
+
return new Promise((e, t) => {
|
|
29
|
+
let r = this.db.transaction([this.storeName], "readonly").objectStore(this.storeName).getAll();
|
|
30
|
+
r.onsuccess = () => e(r.result), r.onerror = () => {
|
|
31
|
+
n.error(`Error getting all items from ${this.storeName}`, r.error), t(r.error);
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async delete(e) {
|
|
36
|
+
return new Promise((t, r) => {
|
|
37
|
+
let i = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).delete(e);
|
|
38
|
+
i.onsuccess = () => t(), i.onerror = () => {
|
|
39
|
+
n.error(`Error deleting item ${e} from ${this.storeName}`, i.error), r(i.error);
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async clear() {
|
|
44
|
+
return new Promise((e, t) => {
|
|
45
|
+
let r = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).clear();
|
|
46
|
+
r.onsuccess = () => e(), r.onerror = () => {
|
|
47
|
+
n.error(`Error clearing store ${this.storeName}`, r.error), t(r.error);
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
async findByIndex(e, t) {
|
|
52
|
+
return new Promise((r, i) => {
|
|
53
|
+
let a = this.db.transaction([this.storeName], "readonly").objectStore(this.storeName).index(e).get(t);
|
|
54
|
+
a.onsuccess = () => r(a.result || null), a.onerror = () => {
|
|
55
|
+
n.error(`Error finding item in ${this.storeName} by index ${e}`, a.error), i(a.error);
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
async findAllByIndex(e, t) {
|
|
60
|
+
return new Promise((r, i) => {
|
|
61
|
+
let a = this.db.transaction([this.storeName], "readonly").objectStore(this.storeName).index(e).getAll(t);
|
|
62
|
+
a.onsuccess = () => r(a.result || []), a.onerror = () => {
|
|
63
|
+
n.error(`Error finding items in ${this.storeName} by index ${e}`, a.error), i(a.error);
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { r as NoSqlRepository };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../shared/logic/service/base.service.cjs`),t=require(`../logger/logger.cjs`),n=require(`./indexeddb.service.cjs`);var r=class extends e{constructor(e){super(),this.storeName=e,this._repository=void 0,this.defaultLog=t.GLOBAL_LOGGER.child(`[NoSqlRepo]`),n.INDEXEDDB_SERVICE.onReady(()=>{this._repository=n.INDEXEDDB_SERVICE.getRepository(this.storeName),this.setReady()})}async ensureReady(){if(!this.isReady())return new Promise(e=>this.onReady(e))}get isInitialized(){return this._repository!==void 0}get repository(){if(!this.isInitialized)throw Error(`Repository for ${this.storeName} not initialized`);return this._repository}async persist(e,t=this.defaultLog){await this.ensureReady();let n=t.trace(`persist:${this.constructor.name}`);try{return await this.repository.save(e)}finally{n.end()}}async remove(e,t=this.defaultLog){await this.ensureReady();let n=t.trace(`remove:${this.constructor.name}`);try{if(e.id===void 0)throw Error(`Cannot remove entity without ID`);return await this.repository.delete(e.id),e}finally{n.end()}}async findById(e,t=this.defaultLog){await this.ensureReady();let n=t.trace(`findById:${this.constructor.name}`);try{return await this.repository.get(e)}finally{n.end()}}async findAll(e,t=this.defaultLog){await this.ensureReady();let n=t.trace(`findAll:${this.constructor.name}`);try{return await this.repository.getAll()}finally{n.end()}}async clear(e,t=this.defaultLog){await this.ensureReady();let n=t.trace(`clear:${this.constructor.name}`);try{await this.repository.clear()}finally{n.end()}}async findByIndex(e,t=this.defaultLog){await this.ensureReady();let n=t.trace(`findByIndex:${this.constructor.name}`);try{return await this.repository.findByIndex(e.indexName,e.value)}finally{n.end()}}async findAllByIndex(e,t=this.defaultLog){await this.ensureReady();let n=t.trace(`findAllByIndex:${this.constructor.name}`);try{return await this.repository.findAllByIndex(e.indexName,e.value)}finally{n.end()}}};module.exports=r;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { default as BaseService } from '../../shared/logic/service/base.service';
|
|
2
|
+
import { NoSqlRepository } from './nosql.repo';
|
|
3
|
+
import { Logger } from '../logger/logger';
|
|
4
|
+
import { IRepository } from '../../shared/contracts/repository.contract';
|
|
5
|
+
/**
|
|
6
|
+
* NoSqlRepoService
|
|
7
|
+
*
|
|
8
|
+
* Clase base para servicios de persistencia basados en IndexedDB (NoSQL).
|
|
9
|
+
* Implementa IRepository y sigue la convención (payload, logger?).
|
|
10
|
+
*/
|
|
11
|
+
export default class NoSqlRepoService<T extends {
|
|
12
|
+
id?: string | number;
|
|
13
|
+
}> extends BaseService implements IRepository<T> {
|
|
14
|
+
private storeName;
|
|
15
|
+
private _repository;
|
|
16
|
+
protected defaultLog: Logger;
|
|
17
|
+
protected constructor(storeName: string);
|
|
18
|
+
/**
|
|
19
|
+
* Garantiza que el servicio esté listo antes de operar
|
|
20
|
+
*/
|
|
21
|
+
protected ensureReady(): Promise<void>;
|
|
22
|
+
get isInitialized(): boolean;
|
|
23
|
+
protected get repository(): NoSqlRepository<T>;
|
|
24
|
+
persist(entity: T, logger?: Logger): Promise<T>;
|
|
25
|
+
remove(entity: T, logger?: Logger): Promise<T>;
|
|
26
|
+
findById(id: string | number, logger?: Logger): Promise<T | null>;
|
|
27
|
+
findAll(_?: any, logger?: Logger): Promise<T[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Limpia todo el almacén
|
|
30
|
+
*/
|
|
31
|
+
clear(_?: any, logger?: Logger): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Busca por índice
|
|
34
|
+
*/
|
|
35
|
+
protected findByIndex(payload: {
|
|
36
|
+
indexName: string;
|
|
37
|
+
value: any;
|
|
38
|
+
}, logger?: Logger): Promise<T | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Busca todos por índice
|
|
41
|
+
*/
|
|
42
|
+
protected findAllByIndex(payload: {
|
|
43
|
+
indexName: string;
|
|
44
|
+
value: any;
|
|
45
|
+
}, logger?: Logger): Promise<T[]>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import e from "../../shared/logic/service/base.service.esm";
|
|
2
|
+
import { GLOBAL_LOGGER as t } from "../logger/logger.esm";
|
|
3
|
+
import { INDEXEDDB_SERVICE as n } from "./indexeddb.service.esm";
|
|
4
|
+
//#region src/packages/indexeddb/nosql.repo.service.ts
|
|
5
|
+
var r = class extends e {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
super(), this.storeName = e, this._repository = void 0, this.defaultLog = t.child("[NoSqlRepo]"), n.onReady(() => {
|
|
8
|
+
this._repository = n.getRepository(this.storeName), this.setReady();
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
async ensureReady() {
|
|
12
|
+
if (!this.isReady()) return new Promise((e) => this.onReady(e));
|
|
13
|
+
}
|
|
14
|
+
get isInitialized() {
|
|
15
|
+
return this._repository !== void 0;
|
|
16
|
+
}
|
|
17
|
+
get repository() {
|
|
18
|
+
if (!this.isInitialized) throw Error(`Repository for ${this.storeName} not initialized`);
|
|
19
|
+
return this._repository;
|
|
20
|
+
}
|
|
21
|
+
async persist(e, t = this.defaultLog) {
|
|
22
|
+
await this.ensureReady();
|
|
23
|
+
let n = t.trace(`persist:${this.constructor.name}`);
|
|
24
|
+
try {
|
|
25
|
+
return await this.repository.save(e);
|
|
26
|
+
} finally {
|
|
27
|
+
n.end();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async remove(e, t = this.defaultLog) {
|
|
31
|
+
await this.ensureReady();
|
|
32
|
+
let n = t.trace(`remove:${this.constructor.name}`);
|
|
33
|
+
try {
|
|
34
|
+
if (e.id === void 0) throw Error("Cannot remove entity without ID");
|
|
35
|
+
return await this.repository.delete(e.id), e;
|
|
36
|
+
} finally {
|
|
37
|
+
n.end();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async findById(e, t = this.defaultLog) {
|
|
41
|
+
await this.ensureReady();
|
|
42
|
+
let n = t.trace(`findById:${this.constructor.name}`);
|
|
43
|
+
try {
|
|
44
|
+
return await this.repository.get(e);
|
|
45
|
+
} finally {
|
|
46
|
+
n.end();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async findAll(e, t = this.defaultLog) {
|
|
50
|
+
await this.ensureReady();
|
|
51
|
+
let n = t.trace(`findAll:${this.constructor.name}`);
|
|
52
|
+
try {
|
|
53
|
+
return await this.repository.getAll();
|
|
54
|
+
} finally {
|
|
55
|
+
n.end();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async clear(e, t = this.defaultLog) {
|
|
59
|
+
await this.ensureReady();
|
|
60
|
+
let n = t.trace(`clear:${this.constructor.name}`);
|
|
61
|
+
try {
|
|
62
|
+
await this.repository.clear();
|
|
63
|
+
} finally {
|
|
64
|
+
n.end();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async findByIndex(e, t = this.defaultLog) {
|
|
68
|
+
await this.ensureReady();
|
|
69
|
+
let n = t.trace(`findByIndex:${this.constructor.name}`);
|
|
70
|
+
try {
|
|
71
|
+
return await this.repository.findByIndex(e.indexName, e.value);
|
|
72
|
+
} finally {
|
|
73
|
+
n.end();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async findAllByIndex(e, t = this.defaultLog) {
|
|
77
|
+
await this.ensureReady();
|
|
78
|
+
let n = t.trace(`findAllByIndex:${this.constructor.name}`);
|
|
79
|
+
try {
|
|
80
|
+
return await this.repository.findAllByIndex(e.indexName, e.value);
|
|
81
|
+
} finally {
|
|
82
|
+
n.end();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
export { r as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=class e{constructor(){this._stores=new Map}static get instance(){return this._instance||=new e,this._instance}register(e){return this._stores.set(e.name,e),e}getStores(){return Array.from(this._stores.values())}getStore(e){return this._stores.get(e)}};e._instance=void 0;var t=e.instance;exports.INDEXEDDB_REGISTRY=t;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ObjectStoreConfig } from './types';
|
|
2
|
+
declare class IndexedDbRegistry {
|
|
3
|
+
private static _instance;
|
|
4
|
+
private _stores;
|
|
5
|
+
private constructor();
|
|
6
|
+
static get instance(): IndexedDbRegistry;
|
|
7
|
+
/**
|
|
8
|
+
* Registers an object store configuration
|
|
9
|
+
*/
|
|
10
|
+
register(config: ObjectStoreConfig): ObjectStoreConfig;
|
|
11
|
+
/**
|
|
12
|
+
* Gets all registered stores
|
|
13
|
+
*/
|
|
14
|
+
getStores(): ObjectStoreConfig[];
|
|
15
|
+
/**
|
|
16
|
+
* Gets a specific store configuration by name
|
|
17
|
+
*/
|
|
18
|
+
getStore(name: string): ObjectStoreConfig | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare const INDEXEDDB_REGISTRY: IndexedDbRegistry;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/packages/indexeddb/registry.ts
|
|
2
|
+
var e = class e {
|
|
3
|
+
constructor() {
|
|
4
|
+
this._stores = /* @__PURE__ */ new Map();
|
|
5
|
+
}
|
|
6
|
+
static get instance() {
|
|
7
|
+
return this._instance ||= new e(), this._instance;
|
|
8
|
+
}
|
|
9
|
+
register(e) {
|
|
10
|
+
return this._stores.set(e.name, e), e;
|
|
11
|
+
}
|
|
12
|
+
getStores() {
|
|
13
|
+
return Array.from(this._stores.values());
|
|
14
|
+
}
|
|
15
|
+
getStore(e) {
|
|
16
|
+
return this._stores.get(e);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
e._instance = void 0;
|
|
20
|
+
var t = e.instance;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as INDEXEDDB_REGISTRY };
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for an IndexedDB Object Store
|
|
3
|
+
*/
|
|
4
|
+
export interface ObjectStoreConfig {
|
|
5
|
+
name: string;
|
|
6
|
+
keyPath: string;
|
|
7
|
+
autoIncrement?: boolean;
|
|
8
|
+
indexes?: IndexConfig[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for an IndexedDB Index
|
|
12
|
+
*/
|
|
13
|
+
export interface IndexConfig {
|
|
14
|
+
name: string;
|
|
15
|
+
keyPath: string | string[];
|
|
16
|
+
unique?: boolean;
|
|
17
|
+
multiEntry?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Configuration for an IndexedDB Database
|
|
21
|
+
*/
|
|
22
|
+
export interface DatabaseConfig {
|
|
23
|
+
name: string;
|
|
24
|
+
version: number;
|
|
25
|
+
stores: ObjectStoreConfig[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Generic interface for NoSQL entities
|
|
29
|
+
*/
|
|
30
|
+
export interface BaseEntity {
|
|
31
|
+
id?: string | number;
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./registry.cjs`),t=require(`./logger.cjs`);exports.GLOBAL_LOGGER=t.GLOBAL_LOGGER,exports.Logger=t.Logger,exports.TRACE_REGISTRY=e.TRACE_REGISTRY;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./registry.cjs`);var t={debug:0,info:1,success:2,warn:3,error:4,silent:99},n={debug:`color:#94a3b8;font-weight:600;`,info:`color:#38bdf8;font-weight:600;`,success:`color:#4ade80;font-weight:600;`,warn:`color:#fb923c;font-weight:600;`,error:`color:#f87171;font-weight:600;`,context:`color:#a78bfa;font-weight:700;background:#1e1b4b;padding:1px 4px;border-radius:3px;`,trace:`color:#f0abfc;font-weight:700;background:#4a044e;padding:1px 4px;border-radius:3px;`,ended:`color:#f87171;font-weight:700;`,dim:`color:#475569;`},r={debug:`[⬡ DEBUG ]`,info:`[◈ INFO ]`,success:`[◉ SUCCESS]`,warn:`[⚠ WARN ]`,error:`[✖ ERROR ]`,silent:``},i=class i{constructor(e){this.context=void 0,this.minLevel=void 0,this.capture=void 0,this.broadcast=void 0,this.traceId=void 0,this.parent=void 0,this.startedAt=void 0,this.history=void 0,this.traces=[],this.ended=!1,this.context=e.context,this.capture=e.capture??!1,this.broadcast=e.broadcast??!1,this.traceId=e._traceId,this.parent=e._parent,this.startedAt=e._startedAt,this.history=e._history??[],this.minLevel=t[e.minLevel??`warn`]}debug(e,t){this._log(`debug`,e,t)}info(e,t){this._log(`info`,e,t)}success(e,t){this._log(`success`,e,t)}warn(e,t){this._log(`warn`,e,t)}error(e,t){this._log(`error`,e,t)}trace(e){let t=e??this._generateTraceId(),n=new Date().toISOString();return new i({context:this.context,minLevel:this._levelName(),capture:this.capture,broadcast:this.broadcast,_traceId:t,_history:[],_parent:this,_startedAt:n})}child(e){return new i({context:`${this.context} › ${e}`,minLevel:this._levelName(),capture:this.capture,broadcast:this.broadcast,_traceId:this.traceId,_history:this.history,_parent:this.parent,_startedAt:this.startedAt})}end(e=`ok`){if(!this.traceId){console.warn(`[Logger] end() llamado en un logger de módulo, no en un trace. Ignorado.`);return}if(this.ended){console.warn(`[Logger] end() llamado más de una vez en trace #${this.traceId}. Ignorado.`);return}this.ended=!0;let t=new Date().toISOString(),r=this.startedAt??t,i=new Date(t).getTime()-new Date(r).getTime(),a={traceId:this.traceId,context:this.context,startedAt:r,endedAt:t,durationMs:i,status:e,entries:[...this.history]};this.parent?._receiveTrace(a);let o=e===`ok`?`◎`:`✖`,s=e===`ok`?n.success:n.error;console.log(`%c${o} %c${this.context}%c #${this.traceId}%c trace ended — ${i}ms [${e}]`,s,n.context,n.trace,n.dim)}async timeAsync(e,t){let n=this.child(e),r=performance.now();n.debug(`starting`);try{let e=await t(n),i=(performance.now()-r).toFixed(1);return n.success(`done ${i}ms`),e}catch(e){let t=(performance.now()-r).toFixed(1);throw n.error(`failed ${t}ms`,e),e}}time(e,t){let n=this.child(e),r=performance.now();n.debug(`starting`);try{let e=t(n),i=(performance.now()-r).toFixed(1);return n.success(`done ${i}ms`),e}catch(e){let t=(performance.now()-r).toFixed(1);throw n.error(`failed ${t}ms`,e),e}}group(e,t){let r=this.traceId?` #${this.traceId}`:``;console.groupCollapsed(`%c${this.context}%c${r}%c ${e}`,n.context,n.trace,n.dim),t(),console.groupEnd()}getTraces(){return this.traces}dumpTraces(){return JSON.stringify(this.traces,null,2)}getFailedTraces(){return this.traces.filter(e=>e.status===`error`)}clearTraces(){this.traces.length=0}getHistory(){return this.history}dumpHistory(){return JSON.stringify(this.history,null,2)}getTraceId(){return this.traceId}_receiveTrace(t){this.traces.push(t),e.TRACE_REGISTRY.register(t)}_log(e,r,i){if(this.ended){console.warn(`%c[Logger] log ignorado — trace #${this.traceId} ya fue cerrado con end()`,n.ended);return}if(t[e]<this.minLevel)return;let a=new Date().toISOString(),o={level:e,context:this.context,message:r,timestamp:a,...this.traceId!==void 0&&{traceId:this.traceId},...i!==void 0&&{data:i}};(this.capture||this.traceId!==void 0)&&this.history.push(o),this.broadcast&&this._emit(o),this._print(e,r,a,i)}_print(e,t,i,a){let o=r[e],s=i.slice(11,23),c=this.traceId?`#${this.traceId}`:``,l=e===`error`?console.error:e===`warn`?console.warn:console.log,u=c?`%c${o} %c${this.context}%c ${c}%c ${t} %c${s}`:`%c${o} %c${this.context}%c ${t} %c${s}`,d=c?[n[e],n.context,n.trace,``,n.dim]:[n[e],n.context,``,n.dim];a===void 0?l(u,...d):l(u,...d,a)}_emit(e){window.dispatchEvent(new CustomEvent(`app:log`,{detail:e}))}_levelName(){return Object.keys(t).find(e=>t[e]===this.minLevel)??`debug`}_generateTraceId(){return Math.random().toString(16).slice(2,10)}},a=new i({context:`GLOBAL`});exports.GLOBAL_LOGGER=a,exports.Logger=i;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export type LogLevel = 'debug' | 'info' | 'success' | 'warn' | 'error' | 'silent';
|
|
2
|
+
export interface LogEntry {
|
|
3
|
+
level: LogLevel;
|
|
4
|
+
context: string;
|
|
5
|
+
message: string;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
traceId?: string;
|
|
8
|
+
data?: unknown;
|
|
9
|
+
}
|
|
10
|
+
/** Snapshot que el padre guarda al recibir un flush */
|
|
11
|
+
export interface TraceRecord {
|
|
12
|
+
traceId: string;
|
|
13
|
+
context: string;
|
|
14
|
+
startedAt: string;
|
|
15
|
+
endedAt: string;
|
|
16
|
+
durationMs: number;
|
|
17
|
+
status: 'ok' | 'error';
|
|
18
|
+
entries: LogEntry[];
|
|
19
|
+
}
|
|
20
|
+
export interface LoggerOptions {
|
|
21
|
+
context: string;
|
|
22
|
+
minLevel?: LogLevel;
|
|
23
|
+
capture?: boolean;
|
|
24
|
+
broadcast?: boolean;
|
|
25
|
+
_traceId?: string;
|
|
26
|
+
_history?: LogEntry[];
|
|
27
|
+
_parent?: Logger;
|
|
28
|
+
_startedAt?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare class Logger {
|
|
31
|
+
private readonly context;
|
|
32
|
+
private readonly minLevel;
|
|
33
|
+
private readonly capture;
|
|
34
|
+
private readonly broadcast;
|
|
35
|
+
private readonly traceId;
|
|
36
|
+
private readonly parent;
|
|
37
|
+
private readonly startedAt;
|
|
38
|
+
private readonly history;
|
|
39
|
+
private readonly traces;
|
|
40
|
+
private ended;
|
|
41
|
+
constructor(options: LoggerOptions);
|
|
42
|
+
debug(message: string, data?: unknown): void;
|
|
43
|
+
info(message: string, data?: unknown): void;
|
|
44
|
+
success(message: string, data?: unknown): void;
|
|
45
|
+
warn(message: string, data?: unknown): void;
|
|
46
|
+
error(message: string, data?: unknown): void;
|
|
47
|
+
/**
|
|
48
|
+
* Crea un logger de operación.
|
|
49
|
+
* - Genera un traceId único (o reutiliza uno externo)
|
|
50
|
+
* - Guarda referencia al padre (this) para el flush en end()
|
|
51
|
+
* - Comparte una historia vacía entre todos sus children
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* const op = authLogger.trace()
|
|
55
|
+
* // ... operación ...
|
|
56
|
+
* op.end() // ← flush al padre al terminar
|
|
57
|
+
*/
|
|
58
|
+
trace(externalTraceId?: string): Logger;
|
|
59
|
+
/**
|
|
60
|
+
* Crea un sub-logger con contexto anidado.
|
|
61
|
+
* Hereda traceId, historia y padre — es parte del mismo trace.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* const op = authLogger.trace() // [auth] #a3f9
|
|
65
|
+
* const apiOp = op.child('api') // [auth › api] #a3f9 — mismo trace
|
|
66
|
+
*/
|
|
67
|
+
child(subContext: string): Logger;
|
|
68
|
+
/**
|
|
69
|
+
* Cierra el trace y hace flush al padre.
|
|
70
|
+
*
|
|
71
|
+
* El padre (logger de módulo) guarda un TraceRecord con:
|
|
72
|
+
* - traceId, contexto, timestamps, duración, status, y todos los entries
|
|
73
|
+
*
|
|
74
|
+
* Después de end(), cualquier intento de loguear emite un warning y no-op.
|
|
75
|
+
*
|
|
76
|
+
* @param status - 'ok' (default) o 'error' si el use case terminó con fallo
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* const op = authLogger.trace()
|
|
80
|
+
* try {
|
|
81
|
+
* await doSomething(op)
|
|
82
|
+
* op.success('done')
|
|
83
|
+
* op.end() // flush con status 'ok'
|
|
84
|
+
* } catch (err) {
|
|
85
|
+
* op.error('failed', err)
|
|
86
|
+
* op.end('error') // flush con status 'error'
|
|
87
|
+
* throw err
|
|
88
|
+
* }
|
|
89
|
+
*/
|
|
90
|
+
end(status?: 'ok' | 'error'): void;
|
|
91
|
+
/**
|
|
92
|
+
* Mide el tiempo de ejecución de una función async.
|
|
93
|
+
* Propaga traceId y padre automáticamente.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* const user = await op.timeAsync('fetchUser', async (scoped) => {
|
|
97
|
+
* scoped.debug('calling endpoint')
|
|
98
|
+
* return api.getUser(id)
|
|
99
|
+
* })
|
|
100
|
+
*/
|
|
101
|
+
timeAsync<T>(label: string, fn: (scoped: Logger) => Promise<T>): Promise<T>;
|
|
102
|
+
time<T>(label: string, fn: (scoped: Logger) => T): T;
|
|
103
|
+
/**
|
|
104
|
+
* Agrupa logs visualmente en devtools.
|
|
105
|
+
*/
|
|
106
|
+
group(label: string, fn: () => void): void;
|
|
107
|
+
/**
|
|
108
|
+
* Retorna todos los TraceRecords completados que este módulo ha recibido.
|
|
109
|
+
* Solo disponible en loggers de módulo (sin traceId).
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* authLogger.getTraces()
|
|
113
|
+
* // → [{ traceId: 'a3f9', status: 'ok', durationMs: 143, entries: [...] }, ...]
|
|
114
|
+
*/
|
|
115
|
+
getTraces(): ReadonlyArray<TraceRecord>;
|
|
116
|
+
/**
|
|
117
|
+
* Dump estructurado de todo el audit log del módulo.
|
|
118
|
+
* Ideal para mandar a Sentry, DataDog, o una IA para análisis post-mortem.
|
|
119
|
+
*/
|
|
120
|
+
dumpTraces(): string;
|
|
121
|
+
/**
|
|
122
|
+
* Retorna solo los traces fallidos.
|
|
123
|
+
*/
|
|
124
|
+
getFailedTraces(): ReadonlyArray<TraceRecord>;
|
|
125
|
+
clearTraces(): void;
|
|
126
|
+
getHistory(): ReadonlyArray<LogEntry>;
|
|
127
|
+
dumpHistory(): string;
|
|
128
|
+
getTraceId(): string | undefined;
|
|
129
|
+
/** Llamado por end() del trace hijo — no usar directamente */
|
|
130
|
+
_receiveTrace(record: TraceRecord): void;
|
|
131
|
+
private _log;
|
|
132
|
+
private _print;
|
|
133
|
+
private _emit;
|
|
134
|
+
private _levelName;
|
|
135
|
+
private _generateTraceId;
|
|
136
|
+
}
|
|
137
|
+
export declare const GLOBAL_LOGGER: Logger;
|