xcore-doctype 0.3.0__tar.gz
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.
- xcore_doctype-0.3.0/PKG-INFO +175 -0
- xcore_doctype-0.3.0/README.md +135 -0
- xcore_doctype-0.3.0/pyproject.toml +115 -0
- xcore_doctype-0.3.0/src/xcore_doctype/__init__.py +64 -0
- xcore_doctype-0.3.0/src/xcore_doctype/aggregation.py +268 -0
- xcore_doctype-0.3.0/src/xcore_doctype/api/__init__.py +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/api/collab.py +201 -0
- xcore_doctype-0.3.0/src/xcore_doctype/api/desk.py +317 -0
- xcore_doctype-0.3.0/src/xcore_doctype/api/files.py +143 -0
- xcore_doctype-0.3.0/src/xcore_doctype/api/http.py +375 -0
- xcore_doctype-0.3.0/src/xcore_doctype/api/print.py +167 -0
- xcore_doctype-0.3.0/src/xcore_doctype/builder.py +504 -0
- xcore_doctype-0.3.0/src/xcore_doctype/channels.py +213 -0
- xcore_doctype-0.3.0/src/xcore_doctype/cli.py +480 -0
- xcore_doctype-0.3.0/src/xcore_doctype/collaboration.py +627 -0
- xcore_doctype-0.3.0/src/xcore_doctype/compute.py +313 -0
- xcore_doctype-0.3.0/src/xcore_doctype/context.py +179 -0
- xcore_doctype-0.3.0/src/xcore_doctype/csv_import.py +308 -0
- xcore_doctype-0.3.0/src/xcore_doctype/dashboards.py +318 -0
- xcore_doctype-0.3.0/src/xcore_doctype/db/__init__.py +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/db/access.py +68 -0
- xcore_doctype-0.3.0/src/xcore_doctype/db/rls.py +72 -0
- xcore_doctype-0.3.0/src/xcore_doctype/db/tables.py +286 -0
- xcore_doctype-0.3.0/src/xcore_doctype/decimals.py +50 -0
- xcore_doctype-0.3.0/src/xcore_doctype/desk_extensions.py +92 -0
- xcore_doctype-0.3.0/src/xcore_doctype/desk_template/README.md +34 -0
- xcore_doctype-0.3.0/src/xcore_doctype/desk_template/index.js +52 -0
- xcore_doctype-0.3.0/src/xcore_doctype/devtools.py +87 -0
- xcore_doctype-0.3.0/src/xcore_doctype/directory.py +107 -0
- xcore_doctype-0.3.0/src/xcore_doctype/document.py +3383 -0
- xcore_doctype-0.3.0/src/xcore_doctype/errors.py +115 -0
- xcore_doctype-0.3.0/src/xcore_doctype/expr.py +358 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/__init__.py +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/pubsub/README.md +122 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/pubsub/__init__.py +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/pubsub/provider/__init__.py +16 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/pubsub/provider/base.py +49 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/pubsub/provider/hyvemq.py +276 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/pubsub/provider/memory.py +53 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/pubsub/provider/redis.py +148 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/pubsub/provider/section.py +43 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/pubsub/service.py +163 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xpay/LICENSE +21 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xpay/README.md +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xpay/__init__.py +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xpay/providers/__init__.py +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xpay/providers/base.py +306 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xpay/providers/stripes/__init__.py +465 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xpay/providers/stripes/config.py +43 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xpay/service.py +152 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xstorage/__init__.py +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xstorage/backends.py +586 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xstorage/main.py +167 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xstorage/tenant_paths.py +77 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xstorage/uploader.py +273 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xwebsocket/CONTRIBUTORS.yml +10 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xwebsocket/INTEGRATION.md +87 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xwebsocket/README.md +74 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xwebsocket/__init__.py +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xwebsocket/main.py +121 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xwebsocket/service.yaml +9 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ext/xwebsocket/ws.py +102 -0
- xcore_doctype-0.3.0/src/xcore_doctype/extensions.py +143 -0
- xcore_doctype-0.3.0/src/xcore_doctype/fieldtypes.py +258 -0
- xcore_doctype-0.3.0/src/xcore_doctype/file_library.py +207 -0
- xcore_doctype-0.3.0/src/xcore_doctype/file_service.py +268 -0
- xcore_doctype-0.3.0/src/xcore_doctype/files.py +182 -0
- xcore_doctype-0.3.0/src/xcore_doctype/flow_nodes_service.py +89 -0
- xcore_doctype-0.3.0/src/xcore_doctype/flownodes.py +203 -0
- xcore_doctype-0.3.0/src/xcore_doctype/flows.py +101 -0
- xcore_doctype-0.3.0/src/xcore_doctype/grants.py +54 -0
- xcore_doctype-0.3.0/src/xcore_doctype/hooks.py +389 -0
- xcore_doctype-0.3.0/src/xcore_doctype/integrity.py +72 -0
- xcore_doctype-0.3.0/src/xcore_doctype/mapping.py +203 -0
- xcore_doctype-0.3.0/src/xcore_doctype/memory.py +209 -0
- xcore_doctype-0.3.0/src/xcore_doctype/mount.py +61 -0
- xcore_doctype-0.3.0/src/xcore_doctype/naming.py +81 -0
- xcore_doctype-0.3.0/src/xcore_doctype/notification_rules.py +500 -0
- xcore_doctype-0.3.0/src/xcore_doctype/notifier.py +62 -0
- xcore_doctype-0.3.0/src/xcore_doctype/overrides.py +976 -0
- xcore_doctype-0.3.0/src/xcore_doctype/pdf.py +167 -0
- xcore_doctype-0.3.0/src/xcore_doctype/permissions.py +161 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/INTEGRATION.md +729 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/README.md +258 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/docs/api-reference.md +121 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/docs/examples.md +124 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/docs/getting-started.md +139 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/docs/installation.md +88 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/docs/ipc-registry.md +49 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/docs/plugin-integration.md +84 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/docs/security.md +37 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/docs/troubleshooting.md +56 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/docs/workflow-dsl.md +241 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/examples/ai_pipeline.yaml +105 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/examples/onboarding_client.yaml +66 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/examples/relance_facture.yaml +58 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/migrations/env.py +91 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/migrations/script.py.mako +28 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/migrations/versions/952584a8d052_first_migration.py +81 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/migrations/versions/c7a1e5d2f904_webhook_secrets.py +43 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/plugin.yaml +167 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/requirements.txt +25 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/__init__.py +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/main.py +890 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/repositories/__init__.py +25 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/repositories/models.py +147 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/repositories/workflow.py +444 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/runtime/__init__.py +12 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/runtime/condition.py +119 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/runtime/engine.py +529 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/runtime/retry.py +82 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/schemas/__init__.py +71 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/schemas/composite.py +90 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/schemas/events.py +47 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/schemas/workflow.py +370 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/services/__init__.py +15 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/services/ai_gen.py +111 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/services/composites.py +185 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/services/discovery.py +156 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/services/event_catalog.py +95 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/services/registry.py +77 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/services/scheduler.py +123 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/services/webhook_auth.py +220 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/services/webhooks.py +92 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/workers/__init__.py +3 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xflow/src/workers/local_queue.py +49 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/CONTRIBUTORS.yaml +29 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/INTEGRATION.md +80 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/README.md +59 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/doctypes/license.yaml +33 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/doctypes/module.yaml +39 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/doctypes/tenant_module.yaml +38 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/migrations/env.py +71 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/migrations/versions/0001_initial.py +69 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/migrations/versions/0002_plan_modules.py +36 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/migrations/versions/0003_license_last_rotated_at.py +36 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/migrations/versions/0004_license_key_length.py +32 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/migrations/versions/0005_license_modules.py +51 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/migrations/versions/0006_tenant_modules.py +55 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/plugin.yaml +173 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/requirements.txt +3 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/doctypes.py +263 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/main.py +773 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/middleware.py +348 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/models/license.py +244 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/repositories/base.py +42 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/repositories/license.py +201 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/routes.py +962 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/schema_upgrade.py +31 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/schemas.py +49 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/services/__init__.py +5 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/services/events.py +128 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/services/jwt.py +134 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/services/license.py +750 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/services/seed.py +252 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/services/webhook.py +94 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/src/state_machine.py +141 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xlicense/workspaces/xlicense.yaml +18 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xprint/README.md +40 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xprint/plugin.yaml +17 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xprint/print/Delivery Note/standard.yaml +27 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xprint/print/Payment Entry/standard.yaml +22 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xprint/print/Purchase Order/standard.yaml +32 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xprint/print/Quotation/standard.yaml +34 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xprint/print/Sales Invoice/standard.yaml +38 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xprint/print/Sales Order/standard.yaml +31 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xprint/src/main.py +28 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/INTEGRATION.md +340 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/README.md +61 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/contributor.yaml +26 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/plugin.yaml +84 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/requirements.txt +8 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/src/bridge/__init__.py +3 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/src/bridge/billing.py +179 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/src/bridge/handlers.py +204 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/src/bridge/ipc.py +185 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/src/main.py +129 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/src/routes/__init__.py +20 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/src/routes/sse.py +201 -0
- xcore_doctype-0.3.0/src/xcore_doctype/platform/xpulse/src/utils.py +104 -0
- xcore_doctype-0.3.0/src/xcore_doctype/plugin.py +1132 -0
- xcore_doctype-0.3.0/src/xcore_doctype/plugin_dir/plugin.yaml +67 -0
- xcore_doctype-0.3.0/src/xcore_doctype/plugin_dir/src/main.py +7 -0
- xcore_doctype-0.3.0/src/xcore_doctype/preferences.py +77 -0
- xcore_doctype-0.3.0/src/xcore_doctype/print_document.py +436 -0
- xcore_doctype-0.3.0/src/xcore_doctype/print_service.py +485 -0
- xcore_doctype-0.3.0/src/xcore_doctype/printing.py +820 -0
- xcore_doctype-0.3.0/src/xcore_doctype/query.py +1585 -0
- xcore_doctype-0.3.0/src/xcore_doctype/realtime.py +68 -0
- xcore_doctype-0.3.0/src/xcore_doctype/registry.py +1138 -0
- xcore_doctype-0.3.0/src/xcore_doctype/schema.py +1378 -0
- xcore_doctype-0.3.0/src/xcore_doctype/sealing.py +53 -0
- xcore_doctype-0.3.0/src/xcore_doctype/sources.py +103 -0
- xcore_doctype-0.3.0/src/xcore_doctype/system_plugin_dir/doctypes/notification_rule.yaml +36 -0
- xcore_doctype-0.3.0/src/xcore_doctype/system_plugin_dir/doctypes/notification_rule_recipient.yaml +7 -0
- xcore_doctype-0.3.0/src/xcore_doctype/system_plugin_dir/doctypes/system_settings.yaml +28 -0
- xcore_doctype-0.3.0/src/xcore_doctype/system_plugin_dir/doctypes/user_permission.yaml +23 -0
- xcore_doctype-0.3.0/src/xcore_doctype/system_plugin_dir/plugin.yaml +8 -0
- xcore_doctype-0.3.0/src/xcore_doctype/system_plugin_dir/src/main.py +25 -0
- xcore_doctype-0.3.0/src/xcore_doctype/system_plugin_dir/translations/en.yaml +80 -0
- xcore_doctype-0.3.0/src/xcore_doctype/system_plugin_dir/translations/fr.yaml +4 -0
- xcore_doctype-0.3.0/src/xcore_doctype/system_plugin_dir/workspaces/system.yaml +13 -0
- xcore_doctype-0.3.0/src/xcore_doctype/tags.py +45 -0
- xcore_doctype-0.3.0/src/xcore_doctype/translations.py +189 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/AccountSettings-DbBT9Sb3.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/ApiDocsView-C9aAbqlf.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/ApiDocsView-tegXkOfu.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/ApiSettings-Bdf7oWyH.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/AuditSettings-DV1SjGKs.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/AutomationsView-GcY3kdz8.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/AutomationsView-QRHi1BXA.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/BillingReturnView-ClHxccyt.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/BillingReturnView-DVLIzha2.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/BlockEditor-8yuCDvGt.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/BlockEditor-qoDD8GDM.js +251 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/BlockGrid-CLFFObbc.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/BlockGrid-Rlx4lkHi.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/CanvasControls-DzeGdtNK.js +26 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/CanvasControls-KAul5iyb.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/DoctypeBuilderView-Bdfz4OdS.js +3 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/FieldControl-BCFHDOH_.js +309 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/FieldControl-C76Il2qP.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/FilesView-CIkvgfER.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/FilesView-sfX5slpb.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/FlowBuilderView-Aw2lBAuR.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/FlowNodesView-Chg0y9c3.js +3 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/ForgotPasswordView-C3l3J6Go.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/FormBuilderView-YDuCee4h.js +4 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/FormView-BoNYRlb7.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/FormView-CQzR77y6.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/HomeView-DMFv9TTZ.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/HomeView-LXYalOIO.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/InviteView-ivSaAHdF.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/ListView-C7n988S9.js +52 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/ListView-DxWVzx8O.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/LoginView-Dp4VcXee.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/LoginView-Pon1rnWR.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/MailSettings-CLh3HLoA.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/ModulesView-CLjLJnW8.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/ModulesView-DEmx4gh0.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/NotFoundView-DlQiXKSL.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/OAuthCallbackView-DSlvI0Vm.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/OnboardingView-7SMOmggr.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/OrganisationSettings-CI1lt7PA.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/PermissionsCatalog-qHwjxsf2.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/PlatformAccounts-ChZXE8Ha.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/PrintBuilderView-CbENofmf.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/PrintBuilderView-LsgTnYmy.js +13 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/ProfileView-B-XkZ3IF.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/RegisterView-BModgkY7.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/ResetPasswordView-Cb7scXzf.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/RichTextField-Dp5rnitZ.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/RolesSettings-qbqoqxAZ.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/SectionPanel-DYREM0cd.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/SettingsView-pbZ3b0oC.js +2 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/SharedView-Bs0IvurZ.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/SharedView-wZOdbmxJ.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/TasksView-CjGRBA0E.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/TrashView-CZc2I25L.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/TrashView-CanjxEgn.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/UsersSettings-DvRpZF95.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/WorkflowBuilderView-BhQaLQDt.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/WorkspaceView-BGm6-OAJ.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/automations-hhDKXkp6.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/brand-CNTnXVwI.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/checkbox-ef0y1kzn.js +142 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/chip-DADHHEbU.js +532 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/commands-C66pYMgo.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/datatable-DN_NHK2H.js +783 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/devtools-CxgSYwGp-CFZdhifa.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/dist-CULTfZAs.js +130 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/docstatus-BpU1uF2g.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/download-D4dig1ly.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/feed-BQBwhFiT.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/flowcatalog-BNgMmaFY.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/host-BrtqNGfZ.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/host-DGiTWmyR.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/index-BvChwCD-.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/index-Cp9ZkRhM.js +398 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/inputnumber-BsXb8eOF.js +196 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/inputtext-oq2nczMW.js +79 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/links-D17LZCPu.js +1040 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/menu-DHipytHn.js +84 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/message-Z-k_YRYE.js +316 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/navstate-C6swSvNR.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/paginator-0XRqpflA.js +126 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/password-DEwoUl03.js +101 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/preferences-y97M_zZr.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/primeicons-C6QP2o4f.woff2 +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/primeicons-DMOk5skT.eot +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/primeicons-Dr5RGzOO.svg +345 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/primeicons-MpK4pl85.ttf +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/primeicons-WjwUDZjB.woff +0 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/profile-CXi_Q171.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/progressspinner-DOLCuzfk.js +74 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/recents-D6_VGybi.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/router-DjppRwu3.js +2 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/runtime-dom.esm-bundler-s_FaoJf2.js +4 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/select-D4g7v3dO.js +360 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/selectbutton-BJDpAdcS.js +164 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/session-P2yPOYPm.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/tags-DbqUJmyX.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/tasks-onnxPH8z.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/textarea-D6vS6Msa.js +84 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/units-DN6Pu1t7.css +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/units-HQzRc9T3.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/useAuth-BVFtKvqf.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/useLive-C1ArRUjY.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/useconfirm-0TwEId56.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/users-B_7N1yU2.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/vue-router-Ba5enW5N.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/workspaces-BbKV_QlK.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/xauth-mkWpqw7L.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/assets/xlicense-DJaSnq1j.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/index.html +38 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/shared/sdk.js +85 -0
- xcore_doctype-0.3.0/src/xcore_doctype/ui/dist/shared/vue.js +1 -0
- xcore_doctype-0.3.0/src/xcore_doctype/user_permissions.py +73 -0
- xcore_doctype-0.3.0/src/xcore_doctype/versions.py +37 -0
- xcore_doctype-0.3.0/src/xcore_doctype/workspaces.py +146 -0
- xcore_doctype-0.3.0/src/xcore_doctype/writer.py +151 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xcore-doctype
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Moteur de DocTypes et interface Desk pour xcore : définissez un document une fois (YAML/JSON), obtenez stockage, API, permissions, hooks et UI Vue.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Keywords: xcore,doctype,erp,low-code,fastapi,vue
|
|
7
|
+
Author: traoreera
|
|
8
|
+
Requires-Python: >=3.14,<4.0
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Framework :: FastAPI
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Topic :: Office/Business
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
17
|
+
Provides-Extra: pdf
|
|
18
|
+
Provides-Extra: postgres
|
|
19
|
+
Requires-Dist: aiomqtt (>=2.5.1,<3.0.0)
|
|
20
|
+
Requires-Dist: asyncpg (>=0.31.0,<1.0.0) ; extra == "postgres"
|
|
21
|
+
Requires-Dist: cryptography (>=44.0.0,<51.0.0)
|
|
22
|
+
Requires-Dist: jmespath (>=1.0.1,<2.0.0)
|
|
23
|
+
Requires-Dist: plutoprint (>=0.23.0,<0.24.0) ; extra == "pdf"
|
|
24
|
+
Requires-Dist: pydantic (>=2.13.5,<3.0.0)
|
|
25
|
+
Requires-Dist: pyjwt[crypto] (>=2.15.1,<3.0.0)
|
|
26
|
+
Requires-Dist: pypdf (>=6.21.3,<7.0.0) ; extra == "pdf"
|
|
27
|
+
Requires-Dist: python-multipart (>=0.0.20,<1.0.0)
|
|
28
|
+
Requires-Dist: pyyaml (>=6.0.3,<7.0.0)
|
|
29
|
+
Requires-Dist: redis[asyncio] (>=8.1.0,<9.0.0)
|
|
30
|
+
Requires-Dist: stripe (>=16.1.0)
|
|
31
|
+
Requires-Dist: xcdk (>=0.2.0,<0.3.0)
|
|
32
|
+
Requires-Dist: xcorecli (>=2.3.0,<3.0.0)
|
|
33
|
+
Requires-Dist: xcoreruntime[sqlite] (>=2.9.1,<3.0.0)
|
|
34
|
+
Project-URL: Documentation, https://github.com/traoreera/doctype/blob/master/docs/guide.md
|
|
35
|
+
Project-URL: Homepage, https://github.com/traoreera/doctype
|
|
36
|
+
Project-URL: Issues, https://github.com/traoreera/doctype/issues
|
|
37
|
+
Project-URL: Repository, https://github.com/traoreera/doctype
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# xcore-doctype
|
|
41
|
+
|
|
42
|
+
Un moteur de **DocTypes** pour [xcore](https://pypi.org/project/xcoreruntime/), inspiré de Frappe : on décrit un document une fois (YAML),
|
|
43
|
+
on obtient le stockage, l'API, les permissions, les hooks, l'historique et une interface (le **Desk**, Vue 3 + PrimeVue). Des documents
|
|
44
|
+
**soumettables** (brouillon → soumis → annulé → amendé) et des quantités **exactes** (`Decimal`) permettent d'écrire un vrai métier :
|
|
45
|
+
le plugin `tests/support/plugins/stock` en est la démonstration (réceptions, sorties, transferts, journal immuable, stock jamais négatif). Le Desk
|
|
46
|
+
est utilisable au téléphone, a un mode sombre, renouvelle la session d'xauth tout seul et adapte ses formulaires au document (colonnes
|
|
47
|
+
de lignes selon la nature, unités, date du jour) : voir `process/desk-revue.md`.
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
name: Invoice
|
|
51
|
+
module: sales
|
|
52
|
+
naming: { series: "FA-{YYYY}-{#####}" } # FA-2026-00001, sans doublon ni trou
|
|
53
|
+
fields:
|
|
54
|
+
- { fieldname: customer, fieldtype: Link, options: Customer, required: true }
|
|
55
|
+
- { fieldname: items, fieldtype: Table, options: InvoiceLine, required: true }
|
|
56
|
+
- { fieldname: total, fieldtype: Number, read_only_depends_on: "true" }
|
|
57
|
+
hooks: { before_save: [sales.invoice_totals] }
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Installer
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install xcore-doctype # le wheel embarque le Desk ; extra [postgres] pour asyncpg
|
|
64
|
+
pip install "xcore-doctype[pdf]" # + l'impression PDF (plutoprint, pypdf) : optionnelle, voir plus bas
|
|
65
|
+
xcore-doctype install ./app # pose le plugin dans l'instance xcore et la vérifie
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**L'impression PDF est une dépendance optionnelle** (`process/impression.md`). Sans l'extra `[pdf]`, tout
|
|
69
|
+
fonctionne sauf la génération du fichier : l'aperçu HTML d'un document (`GET /print/{type}/{nom}`) répond
|
|
70
|
+
normalement, et seule la route PDF répond `503 pdf_engine_missing` en nommant le paquet à installer. C'est
|
|
71
|
+
délibéré : le moteur embarqué pèse une vingtaine de méga-octets, et une instance qui n'imprime pas ne les porte
|
|
72
|
+
pas.
|
|
73
|
+
|
|
74
|
+
xcore ne découvre aujourd'hui que des **dossiers** de plugins : `install` dépose `app/xcore-doctype/` (manifeste + shim) et lit votre
|
|
75
|
+
`integration.yaml` pour signaler ce qui empêcherait le plugin de répondre. Sur une instance neuve (`xcli init`), il relève :
|
|
76
|
+
|
|
77
|
+
- `services.databases.default.type: sqlite` → adaptateur **synchrone** : mettez `sqlite+aio` ;
|
|
78
|
+
- `main.py` sans `xcore.setup(app)` → toute requête répond 500 `tenant_middleware_missing` ;
|
|
79
|
+
- `plugins.strict_trusted` actif → signez le plugin : `xcli plugin security sign app/xcore-doctype`.
|
|
80
|
+
|
|
81
|
+
`xcore-doctype doctor` refait la vérification à tout moment. Les réglages du plugin (fuseau des numéros de série, Desk, RLS…) sont le
|
|
82
|
+
bloc `doctype:` de `app/xcore-doctype/plugin.yaml` : c'est **votre** copie, `install` ne l'écrase pas (sauf `--force`).
|
|
83
|
+
|
|
84
|
+
Le paquet déclare aussi l'entry point `xcore.plugins` ; xcore ne le lit pas encore (voir `process/xcore-issues.md`).
|
|
85
|
+
Le Desk est servi sous `<plugin_prefix>/xcore-doctype/desk/`.
|
|
86
|
+
|
|
87
|
+
## Apporter vos DocTypes (module métier)
|
|
88
|
+
|
|
89
|
+
Un plugin métier déclare `requires: [xcore-doctype]` et apporte ses DocTypes ; leur `module` doit être **le nom du plugin** (c'est
|
|
90
|
+
le premier segment de leurs grants, `sales:invoice:write`) :
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
class Plugin(TrustedBase):
|
|
94
|
+
async def on_load(self):
|
|
95
|
+
self.get_service("doctype_hooks").register("sales.invoice_totals", self.invoice_totals, owner=self.ctx.name)
|
|
96
|
+
self.get_service("doctype_registry").load_dir(self.ctx.name, DOCTYPES_DIR)
|
|
97
|
+
grants = self.get_service("doctype_grants").for_plugin(self.ctx.name) # source unique : le YAML
|
|
98
|
+
await self.ctx.events.emit("rbac.declare", {"plugin": self.ctx.name, "grants": grants}, source=self.ctx.name)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`xcore-doctype check tests/support/plugins/sales/doctypes --owner sales --with tests/support/plugins/stock/doctypes` valide le dossier (types, liens, module, grants, hooks à
|
|
102
|
+
enregistrer) : à mettre dans la CI du plugin (`--with` : les DocTypes des plugins dont il dépend, cibles de ses liens). Deux exemples
|
|
103
|
+
complets sont livrés : `tests/support/plugins/sales/` (clients, factures à lignes) et `tests/support/plugins/stock/` (articles, entrepôts, mouvements soumettables) ; ce sont des jeux d'essai du moteur, pas des produits.
|
|
104
|
+
|
|
105
|
+
### Étendre un autre plugin, étendre le Desk
|
|
106
|
+
|
|
107
|
+
Un plugin peut aller au-delà de ses propres DocTypes (détails et règles : `process/extensions.md`) :
|
|
108
|
+
|
|
109
|
+
- **ajouter des champs et des hooks au DocType d'un plugin dont il dépend**, sans toucher à son YAML : `extends/*.yaml`
|
|
110
|
+
(`doctype: Stock Entry`, champs `sales_…`, `hooks: {on_submit: [sales.on_stock_entry]}`), chargé par
|
|
111
|
+
`doctype_registry.load_extensions(self.ctx.name, dossier)` ;
|
|
112
|
+
- **ajouter des blocs à l'espace d'un autre module** : un fichier de `workspaces/` avec `contributes_to: stock` au lieu de `name` ;
|
|
113
|
+
- **livrer une extension JavaScript du Desk** (pages, panneaux et actions de fiche, actions de liste, blocs d'espace, commandes) :
|
|
114
|
+
un module ES `desk/index.js` déclaré par `doctype_registry.load_desk(self.ctx.name, dossier)` et chargé d'office (l'opérateur peut
|
|
115
|
+
restreindre ou fermer par `doctype.desk.extensions`). Il importe `vue` et `@xcore-doctype/desk` (la copie du Desk, par une import map), est
|
|
116
|
+
servi depuis la même origine sous la CSP stricte, et une panne de l'extension n'arrête jamais le Desk.
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
import { defineExtension } from '@xcore-doctype/desk'
|
|
120
|
+
|
|
121
|
+
export default defineExtension({
|
|
122
|
+
name: 'sales',
|
|
123
|
+
apiVersion: 1,
|
|
124
|
+
setup(desk) {
|
|
125
|
+
desk.form.action({ doctype: 'Customer', label: 'Nouvelle facture', run: ({ record, router }) =>
|
|
126
|
+
router.push({ name: 'new', params: { doctype: 'Invoice' }, query: { customer: record.name } }) })
|
|
127
|
+
},
|
|
128
|
+
})
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Un document soumettable
|
|
132
|
+
|
|
133
|
+
```yaml
|
|
134
|
+
name: Stock Entry
|
|
135
|
+
module: stock
|
|
136
|
+
submittable: true # brouillon -> soumis (figé) -> annulé ; un annulé s'amende
|
|
137
|
+
hooks: { on_submit: [stock.post_entry], on_cancel: [stock.reverse_entry] }
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
`on_submit` / `on_cancel` tournent **dans la transaction** de la soumission et écrivent par `event.tx` (créer, créer-si-absent, modifier
|
|
141
|
+
avec contrôle de version, lire avec verrou) : un refus défait l'état et tout ce que le hook avait écrit. Les droits `submit` et `cancel`
|
|
142
|
+
sont des grants à part (`stock:stock_entry:submit`). Voir `process/phase-a.md` et `tests/support/plugins/stock/src/ledger.py`.
|
|
143
|
+
|
|
144
|
+
## Développer
|
|
145
|
+
|
|
146
|
+
Le jeu de DocTypes ERP est un sous-module Git public dans `doctypes/` (`traoreera01/erpDoctype`). Sur un clone neuf,
|
|
147
|
+
initialisez-le avant les tests qui vérifient les définitions ERP :
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
git submodule update --init --recursive
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Sa documentation, sa provenance et sa licence sont dans `doctypes/README.md` et `doctypes/docs/`.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
make install # Poetry + pnpm
|
|
157
|
+
make dev # backend :8000 et Desk :5173 avec rechargement ; connexion : ADMIN_EMAIL / ADMIN_PASSWORD de .env (créé par make env)
|
|
158
|
+
make check # types, build du Desk, tests Python (SQLite), vitest, navigateur, installation du wheel
|
|
159
|
+
make test-pg PG_URL=postgresql+asyncpg://postgres@127.0.0.1:5432/xdt # + PostgreSQL
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
`make help` liste tout. **Authentification : xauth (`app/auth` sur le poste de développement, hors dépôt, voir `process/xauth.md`)** : utilisateurs, organisations, rôles et grants,
|
|
163
|
+
connexion par nom d'utilisateur ou e-mail et mot de passe (MFA, OAuth, invitations). `make env` crée `.env` (administrateur `admin@example.com`, mot de passe aléatoire) et les clés
|
|
164
|
+
JWT `conf/` ; xauth crée ce compte au premier démarrage. `make token` donne un jeton d'accès pour les scripts, `make member EMAIL=… PASSWORD=…` un utilisateur de plus. Dans le Desk, **Paramètres > Système** réunit tout xauth : compte (mot de passe, MFA, sessions, comptes liés, invitations reçues), organisations, utilisateurs, rôles et
|
|
165
|
+
permissions, catalogue et comptes de la plateforme (administrateur), courrier sortant (extension `ext.email`, simulée tant qu'aucun SMTP n'est configuré), journal d'audit,
|
|
166
|
+
accès API ; la cloche de la barre du haut montre les notifications. Le plugin `iam` (`tests/support/plugins/iam`, `process/iam.md`) présente les **permissions, rôles et membres d'xauth comme des DocTypes** (liste,
|
|
167
|
+
filtres, rapport, fiches ; xauth reste l'unique source), le profil de chaque utilisateur (« Mon profil »), et la fiche d'un employé (`tests/support/plugins/hr`) pointe vers son compte : un employé qui part ferme son accès.
|
|
168
|
+
|
|
169
|
+
## Documentation
|
|
170
|
+
|
|
171
|
+
`process/doctype.md` (le contrat de conception, v3), puis un rapport par phase : `process/spike-phase0.md`, `process/phase1.md` (permissions, hooks),
|
|
172
|
+
`process/phase2.md` (le Desk), `process/phase3.md` (liens, tables, numérotation, historique), `process/phase4.md` (livraison, RLS, CI). Le second palier a
|
|
173
|
+
son contrat, `process/palier40.md` (feuille de route A à F), et sa première phase, `process/phase-a.md` (documents soumettables, module Stock).
|
|
174
|
+
`CLAUDE.md` résume l'architecture et les pièges pour qui reprend le code.
|
|
175
|
+
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# xcore-doctype
|
|
2
|
+
|
|
3
|
+
Un moteur de **DocTypes** pour [xcore](https://pypi.org/project/xcoreruntime/), inspiré de Frappe : on décrit un document une fois (YAML),
|
|
4
|
+
on obtient le stockage, l'API, les permissions, les hooks, l'historique et une interface (le **Desk**, Vue 3 + PrimeVue). Des documents
|
|
5
|
+
**soumettables** (brouillon → soumis → annulé → amendé) et des quantités **exactes** (`Decimal`) permettent d'écrire un vrai métier :
|
|
6
|
+
le plugin `tests/support/plugins/stock` en est la démonstration (réceptions, sorties, transferts, journal immuable, stock jamais négatif). Le Desk
|
|
7
|
+
est utilisable au téléphone, a un mode sombre, renouvelle la session d'xauth tout seul et adapte ses formulaires au document (colonnes
|
|
8
|
+
de lignes selon la nature, unités, date du jour) : voir `process/desk-revue.md`.
|
|
9
|
+
|
|
10
|
+
```yaml
|
|
11
|
+
name: Invoice
|
|
12
|
+
module: sales
|
|
13
|
+
naming: { series: "FA-{YYYY}-{#####}" } # FA-2026-00001, sans doublon ni trou
|
|
14
|
+
fields:
|
|
15
|
+
- { fieldname: customer, fieldtype: Link, options: Customer, required: true }
|
|
16
|
+
- { fieldname: items, fieldtype: Table, options: InvoiceLine, required: true }
|
|
17
|
+
- { fieldname: total, fieldtype: Number, read_only_depends_on: "true" }
|
|
18
|
+
hooks: { before_save: [sales.invoice_totals] }
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Installer
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install xcore-doctype # le wheel embarque le Desk ; extra [postgres] pour asyncpg
|
|
25
|
+
pip install "xcore-doctype[pdf]" # + l'impression PDF (plutoprint, pypdf) : optionnelle, voir plus bas
|
|
26
|
+
xcore-doctype install ./app # pose le plugin dans l'instance xcore et la vérifie
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**L'impression PDF est une dépendance optionnelle** (`process/impression.md`). Sans l'extra `[pdf]`, tout
|
|
30
|
+
fonctionne sauf la génération du fichier : l'aperçu HTML d'un document (`GET /print/{type}/{nom}`) répond
|
|
31
|
+
normalement, et seule la route PDF répond `503 pdf_engine_missing` en nommant le paquet à installer. C'est
|
|
32
|
+
délibéré : le moteur embarqué pèse une vingtaine de méga-octets, et une instance qui n'imprime pas ne les porte
|
|
33
|
+
pas.
|
|
34
|
+
|
|
35
|
+
xcore ne découvre aujourd'hui que des **dossiers** de plugins : `install` dépose `app/xcore-doctype/` (manifeste + shim) et lit votre
|
|
36
|
+
`integration.yaml` pour signaler ce qui empêcherait le plugin de répondre. Sur une instance neuve (`xcli init`), il relève :
|
|
37
|
+
|
|
38
|
+
- `services.databases.default.type: sqlite` → adaptateur **synchrone** : mettez `sqlite+aio` ;
|
|
39
|
+
- `main.py` sans `xcore.setup(app)` → toute requête répond 500 `tenant_middleware_missing` ;
|
|
40
|
+
- `plugins.strict_trusted` actif → signez le plugin : `xcli plugin security sign app/xcore-doctype`.
|
|
41
|
+
|
|
42
|
+
`xcore-doctype doctor` refait la vérification à tout moment. Les réglages du plugin (fuseau des numéros de série, Desk, RLS…) sont le
|
|
43
|
+
bloc `doctype:` de `app/xcore-doctype/plugin.yaml` : c'est **votre** copie, `install` ne l'écrase pas (sauf `--force`).
|
|
44
|
+
|
|
45
|
+
Le paquet déclare aussi l'entry point `xcore.plugins` ; xcore ne le lit pas encore (voir `process/xcore-issues.md`).
|
|
46
|
+
Le Desk est servi sous `<plugin_prefix>/xcore-doctype/desk/`.
|
|
47
|
+
|
|
48
|
+
## Apporter vos DocTypes (module métier)
|
|
49
|
+
|
|
50
|
+
Un plugin métier déclare `requires: [xcore-doctype]` et apporte ses DocTypes ; leur `module` doit être **le nom du plugin** (c'est
|
|
51
|
+
le premier segment de leurs grants, `sales:invoice:write`) :
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
class Plugin(TrustedBase):
|
|
55
|
+
async def on_load(self):
|
|
56
|
+
self.get_service("doctype_hooks").register("sales.invoice_totals", self.invoice_totals, owner=self.ctx.name)
|
|
57
|
+
self.get_service("doctype_registry").load_dir(self.ctx.name, DOCTYPES_DIR)
|
|
58
|
+
grants = self.get_service("doctype_grants").for_plugin(self.ctx.name) # source unique : le YAML
|
|
59
|
+
await self.ctx.events.emit("rbac.declare", {"plugin": self.ctx.name, "grants": grants}, source=self.ctx.name)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`xcore-doctype check tests/support/plugins/sales/doctypes --owner sales --with tests/support/plugins/stock/doctypes` valide le dossier (types, liens, module, grants, hooks à
|
|
63
|
+
enregistrer) : à mettre dans la CI du plugin (`--with` : les DocTypes des plugins dont il dépend, cibles de ses liens). Deux exemples
|
|
64
|
+
complets sont livrés : `tests/support/plugins/sales/` (clients, factures à lignes) et `tests/support/plugins/stock/` (articles, entrepôts, mouvements soumettables) ; ce sont des jeux d'essai du moteur, pas des produits.
|
|
65
|
+
|
|
66
|
+
### Étendre un autre plugin, étendre le Desk
|
|
67
|
+
|
|
68
|
+
Un plugin peut aller au-delà de ses propres DocTypes (détails et règles : `process/extensions.md`) :
|
|
69
|
+
|
|
70
|
+
- **ajouter des champs et des hooks au DocType d'un plugin dont il dépend**, sans toucher à son YAML : `extends/*.yaml`
|
|
71
|
+
(`doctype: Stock Entry`, champs `sales_…`, `hooks: {on_submit: [sales.on_stock_entry]}`), chargé par
|
|
72
|
+
`doctype_registry.load_extensions(self.ctx.name, dossier)` ;
|
|
73
|
+
- **ajouter des blocs à l'espace d'un autre module** : un fichier de `workspaces/` avec `contributes_to: stock` au lieu de `name` ;
|
|
74
|
+
- **livrer une extension JavaScript du Desk** (pages, panneaux et actions de fiche, actions de liste, blocs d'espace, commandes) :
|
|
75
|
+
un module ES `desk/index.js` déclaré par `doctype_registry.load_desk(self.ctx.name, dossier)` et chargé d'office (l'opérateur peut
|
|
76
|
+
restreindre ou fermer par `doctype.desk.extensions`). Il importe `vue` et `@xcore-doctype/desk` (la copie du Desk, par une import map), est
|
|
77
|
+
servi depuis la même origine sous la CSP stricte, et une panne de l'extension n'arrête jamais le Desk.
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
import { defineExtension } from '@xcore-doctype/desk'
|
|
81
|
+
|
|
82
|
+
export default defineExtension({
|
|
83
|
+
name: 'sales',
|
|
84
|
+
apiVersion: 1,
|
|
85
|
+
setup(desk) {
|
|
86
|
+
desk.form.action({ doctype: 'Customer', label: 'Nouvelle facture', run: ({ record, router }) =>
|
|
87
|
+
router.push({ name: 'new', params: { doctype: 'Invoice' }, query: { customer: record.name } }) })
|
|
88
|
+
},
|
|
89
|
+
})
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Un document soumettable
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
name: Stock Entry
|
|
96
|
+
module: stock
|
|
97
|
+
submittable: true # brouillon -> soumis (figé) -> annulé ; un annulé s'amende
|
|
98
|
+
hooks: { on_submit: [stock.post_entry], on_cancel: [stock.reverse_entry] }
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`on_submit` / `on_cancel` tournent **dans la transaction** de la soumission et écrivent par `event.tx` (créer, créer-si-absent, modifier
|
|
102
|
+
avec contrôle de version, lire avec verrou) : un refus défait l'état et tout ce que le hook avait écrit. Les droits `submit` et `cancel`
|
|
103
|
+
sont des grants à part (`stock:stock_entry:submit`). Voir `process/phase-a.md` et `tests/support/plugins/stock/src/ledger.py`.
|
|
104
|
+
|
|
105
|
+
## Développer
|
|
106
|
+
|
|
107
|
+
Le jeu de DocTypes ERP est un sous-module Git public dans `doctypes/` (`traoreera01/erpDoctype`). Sur un clone neuf,
|
|
108
|
+
initialisez-le avant les tests qui vérifient les définitions ERP :
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
git submodule update --init --recursive
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Sa documentation, sa provenance et sa licence sont dans `doctypes/README.md` et `doctypes/docs/`.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
make install # Poetry + pnpm
|
|
118
|
+
make dev # backend :8000 et Desk :5173 avec rechargement ; connexion : ADMIN_EMAIL / ADMIN_PASSWORD de .env (créé par make env)
|
|
119
|
+
make check # types, build du Desk, tests Python (SQLite), vitest, navigateur, installation du wheel
|
|
120
|
+
make test-pg PG_URL=postgresql+asyncpg://postgres@127.0.0.1:5432/xdt # + PostgreSQL
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`make help` liste tout. **Authentification : xauth (`app/auth` sur le poste de développement, hors dépôt, voir `process/xauth.md`)** : utilisateurs, organisations, rôles et grants,
|
|
124
|
+
connexion par nom d'utilisateur ou e-mail et mot de passe (MFA, OAuth, invitations). `make env` crée `.env` (administrateur `admin@example.com`, mot de passe aléatoire) et les clés
|
|
125
|
+
JWT `conf/` ; xauth crée ce compte au premier démarrage. `make token` donne un jeton d'accès pour les scripts, `make member EMAIL=… PASSWORD=…` un utilisateur de plus. Dans le Desk, **Paramètres > Système** réunit tout xauth : compte (mot de passe, MFA, sessions, comptes liés, invitations reçues), organisations, utilisateurs, rôles et
|
|
126
|
+
permissions, catalogue et comptes de la plateforme (administrateur), courrier sortant (extension `ext.email`, simulée tant qu'aucun SMTP n'est configuré), journal d'audit,
|
|
127
|
+
accès API ; la cloche de la barre du haut montre les notifications. Le plugin `iam` (`tests/support/plugins/iam`, `process/iam.md`) présente les **permissions, rôles et membres d'xauth comme des DocTypes** (liste,
|
|
128
|
+
filtres, rapport, fiches ; xauth reste l'unique source), le profil de chaque utilisateur (« Mon profil »), et la fiche d'un employé (`tests/support/plugins/hr`) pointe vers son compte : un employé qui part ferme son accès.
|
|
129
|
+
|
|
130
|
+
## Documentation
|
|
131
|
+
|
|
132
|
+
`process/doctype.md` (le contrat de conception, v3), puis un rapport par phase : `process/spike-phase0.md`, `process/phase1.md` (permissions, hooks),
|
|
133
|
+
`process/phase2.md` (le Desk), `process/phase3.md` (liens, tables, numérotation, historique), `process/phase4.md` (livraison, RLS, CI). Le second palier a
|
|
134
|
+
son contrat, `process/palier40.md` (feuille de route A à F), et sa première phase, `process/phase-a.md` (documents soumettables, module Stock).
|
|
135
|
+
`CLAUDE.md` résume l'architecture et les pièges pour qui reprend le code.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "xcore-doctype"
|
|
3
|
+
version = "0.3.0"
|
|
4
|
+
description = "Moteur de DocTypes et interface Desk pour xcore : définissez un document une fois (YAML/JSON), obtenez stockage, API, permissions, hooks et UI Vue."
|
|
5
|
+
authors = [
|
|
6
|
+
{name = "traoreera"},
|
|
7
|
+
{email = "traoreera@gmail.com"}
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
license = "MIT"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.14,<4.0"
|
|
14
|
+
keywords = ["xcore", "doctype", "erp", "low-code", "fastapi", "vue"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Framework :: FastAPI",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.14",
|
|
22
|
+
"Topic :: Office/Business",
|
|
23
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
# [sqlite] apporte SQLAlchemy asyncio + aiosqlite (développement)
|
|
27
|
+
"xcoreruntime[sqlite] (>=2.9.1,<3.0.0)",
|
|
28
|
+
"xcdk (>=0.2.0,<0.3.0)",
|
|
29
|
+
"xcorecli (>=2.3.0,<3.0.0)",
|
|
30
|
+
"pydantic (>=2.13.5,<3.0.0)",
|
|
31
|
+
"pyyaml (>=6.0.3,<7.0.0)",
|
|
32
|
+
# Téléversement de fichiers (champs Image et Attach) : FastAPI exige python-multipart pour lire un formulaire multipart
|
|
33
|
+
"python-multipart (>=0.0.20,<1.0.0)",
|
|
34
|
+
"redis[asyncio] (>=8.1.0,<9.0.0)",
|
|
35
|
+
# Les champs Password sont scellés par Fernet (sealing.py). Le paquet n'arrivait ici que par le groupe `host` (python-jose) :
|
|
36
|
+
# un plugin installé HORS de ce dépôt (le dépôt erp) n'importait plus le moteur.
|
|
37
|
+
"cryptography (>=44.0.0,<51.0.0)",
|
|
38
|
+
"pyjwt[crypto] (>=2.15.1,<3.0.0)",
|
|
39
|
+
"stripe>=16.1.0",
|
|
40
|
+
"aiomqtt (>=2.5.1,<3.0.0)",
|
|
41
|
+
# xflow (plugin de plateforme, platform/xflow) : les expressions `transform`/`switch` de ses étapes
|
|
42
|
+
"jmespath (>=1.0.1,<2.0.0)",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[project.urls]
|
|
46
|
+
Homepage = "https://github.com/traoreera/doctype"
|
|
47
|
+
Repository = "https://github.com/traoreera/doctype"
|
|
48
|
+
Documentation = "https://github.com/traoreera/doctype/blob/master/docs/guide.md"
|
|
49
|
+
Issues = "https://github.com/traoreera/doctype/issues"
|
|
50
|
+
|
|
51
|
+
[project.scripts]
|
|
52
|
+
xcore-doctype = "xcore_doctype.cli:main"
|
|
53
|
+
|
|
54
|
+
# D1 : le plugin se déclare au groupe `xcore.plugins`. INERTE tant qu'xcore ne lit pas ce groupe (il ne découvre que des
|
|
55
|
+
# dossiers) : la valeur est une fonction qui rend le dossier du plugin, `xcore-doctype install` en pose une copie (process/phase4.md).
|
|
56
|
+
[project.entry-points."xcore.plugins"]
|
|
57
|
+
xcore-doctype = "xcore_doctype:plugin_dir"
|
|
58
|
+
|
|
59
|
+
[project.optional-dependencies]
|
|
60
|
+
# L'extra [postgres] d'xcore apporte psycopg2 (synchrone) : il faut asyncpg pour l'accès async (D11)
|
|
61
|
+
postgres = ["asyncpg (>=0.31.0,<1.0.0)"]
|
|
62
|
+
# Impression PDF (process/impression.md §1). OPTIONNEL par décision : sans l'extra, l'aperçu HTML fonctionne et
|
|
63
|
+
# seule la route PDF répond `503 pdf_engine_missing` en nommant le paquet. C'est ce qui rend l'engagement
|
|
64
|
+
# réversible — rien d'autre dans le moteur ne dépend de PlutoPrint.
|
|
65
|
+
# plutoprint : MIT, wheels précompilés (cp314 manylinux), moteur embarqué, ~20,5 Mo, aucun binaire système.
|
|
66
|
+
# Épinglé au MINEUR parce qu'il est en 0.x : chaque 0.x+1 doit être re-mesuré (le `@page` suivi, l'URL
|
|
67
|
+
# `data:` qui échappe au récupérateur de ressources, l'en-tête de tableau répété), pas adopté à l'aveugle.
|
|
68
|
+
# pypdf : BSD-3, Python pur, 409 Ko. Ne sert QU'au fond PDF d'un papier à en-tête (§5) ; son absence
|
|
69
|
+
# n'empêche pas les autres gabarits d'imprimer, le code sonde les deux paquets séparément.
|
|
70
|
+
pdf = ["plutoprint (>=0.23.0,<0.24.0)", "pypdf (>=6.21.3,<7.0.0)"]
|
|
71
|
+
|
|
72
|
+
[tool.poetry]
|
|
73
|
+
packages = [{include = "xcore_doctype", from = "src"}]
|
|
74
|
+
# Le Desk construit (`pnpm build` dans ui/) est ignoré par .gitignore (dist/) mais doit partir dans le wheel. Les shims `plugin_dir/src/main.py` et `system_plugin_dir/src/main.py` aussi : le motif
|
|
75
|
+
# `main.py` de .gitignore (pensé pour le `main.py` de la racine, l'hôte de développement) le retire sinon du wheel, et `xcore-doctype install` n'aurait plus rien à poser.
|
|
76
|
+
# Les modules embarqués sont générés depuis `vendor/` (`make vendor-sync`) et donc ignorés par git : ils doivent être listés ici comme le Desk.
|
|
77
|
+
include = [
|
|
78
|
+
{ path = "src/xcore_doctype/ui/dist", format = ["sdist", "wheel"] },
|
|
79
|
+
{ path = "src/xcore_doctype/plugin_dir/src/main.py", format = ["sdist", "wheel"] },
|
|
80
|
+
{ path = "src/xcore_doctype/system_plugin_dir/src/main.py", format = ["sdist", "wheel"] },
|
|
81
|
+
{ path = "src/xcore_doctype/platform/xflow", format = ["sdist", "wheel"] },
|
|
82
|
+
{ path = "src/xcore_doctype/platform/xlicense", format = ["sdist", "wheel"] },
|
|
83
|
+
{ path = "src/xcore_doctype/platform/xpulse", format = ["sdist", "wheel"] },
|
|
84
|
+
{ path = "src/xcore_doctype/platform/xprint", format = ["sdist", "wheel"] },
|
|
85
|
+
{ path = "src/xcore_doctype/ext/pubsub", format = ["sdist", "wheel"] },
|
|
86
|
+
{ path = "src/xcore_doctype/ext/xstorage", format = ["sdist", "wheel"] },
|
|
87
|
+
{ path = "src/xcore_doctype/ext/xwebsocket", format = ["sdist", "wheel"] },
|
|
88
|
+
{ path = "src/xcore_doctype/ext/xpay", format = ["sdist", "wheel"] },
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
[dependency-groups]
|
|
92
|
+
dev = [
|
|
93
|
+
"mkdocs (>=1.6.1,<2.0.0)",
|
|
94
|
+
"pytest (>=9.0.0,<10.0.0)",
|
|
95
|
+
"pytest-asyncio (>=1.3.0,<2.0.0)",
|
|
96
|
+
"asyncpg (>=0.31.0,<1.0.0)"
|
|
97
|
+
]
|
|
98
|
+
host = [
|
|
99
|
+
"python-jose[cryptography] (>=3.5.0,<4.0.0)",
|
|
100
|
+
"passlib[argon2] (>=1.7.4,<2.0.0)",
|
|
101
|
+
"pyotp (>=2.10.0,<3.0.0)",
|
|
102
|
+
"qrcode (>=8.2,<9.0)",
|
|
103
|
+
"aiosmtplib (>=5.1.3,<6.0.0)"
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
[tool.pytest.ini_options]
|
|
107
|
+
asyncio_mode = "auto"
|
|
108
|
+
testpaths = ["tests"]
|
|
109
|
+
markers = [
|
|
110
|
+
"postgres: nécessite XCORE_DOCTYPE_TEST_PG_URL (postgresql+asyncpg://...)",
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
[build-system]
|
|
114
|
+
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
115
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""xcore-doctype : moteur de DocTypes pour xcore.
|
|
2
|
+
|
|
3
|
+
API publique pour les auteurs de hooks (process/doctype.md D2, D16) :
|
|
4
|
+
|
|
5
|
+
from xcore_doctype import DocumentValidationError, HookEvent
|
|
6
|
+
|
|
7
|
+
async def check_credit(event: HookEvent) -> None:
|
|
8
|
+
if event.data.get("credit_limit", 0) > 100_000:
|
|
9
|
+
raise DocumentValidationError("Plafond trop élevé")
|
|
10
|
+
|
|
11
|
+
# dans on_load d'un plugin qui déclare `requires: [xcore-doctype]` :
|
|
12
|
+
self.get_service("doctype_hooks").register("sales.check_credit", check_credit, owner=self.ctx.name)
|
|
13
|
+
# dans on_unload :
|
|
14
|
+
self.get_service("doctype_hooks").unregister_owner(self.ctx.name)
|
|
15
|
+
|
|
16
|
+
Puis, dans la définition du DocType : `hooks: {validate: ["sales.check_credit"]}`.
|
|
17
|
+
|
|
18
|
+
Un plugin métier apporte aussi ses DocTypes (leur `module` doit être le nom du plugin) :
|
|
19
|
+
|
|
20
|
+
self.get_service("doctype_registry").load_dir(self.ctx.name, Path(__file__).parent.parent / "doctypes") # on_load
|
|
21
|
+
self.get_service("doctype_registry").unregister_owner(self.ctx.name) # on_unload
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from importlib import metadata, resources
|
|
25
|
+
from pathlib import Path
|
|
26
|
+
|
|
27
|
+
from .errors import DocumentValidationError, HookRegistrationError
|
|
28
|
+
from .hooks import HookEvent, HookRegistry
|
|
29
|
+
from .mount import Config, mount_desk
|
|
30
|
+
|
|
31
|
+
try:
|
|
32
|
+
__version__ = metadata.version("xcore-doctype")
|
|
33
|
+
except metadata.PackageNotFoundError: # exécuté depuis des sources non installées
|
|
34
|
+
__version__ = "0+unknown"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def plugin_dir() -> Path:
|
|
38
|
+
"""Le dossier de plugin embarqué (`plugin.yaml` + `src/main.py`), dans le paquet installé.
|
|
39
|
+
|
|
40
|
+
C'est aussi la cible de l'entry point `xcore.plugins` que le paquet déclare (process/doctype.md D1) : xcore ne le lit pas
|
|
41
|
+
encore (il ne découvre que des dossiers), `xcore-doctype install` pose donc une copie dans l'instance. Voir process/phase4.md.
|
|
42
|
+
"""
|
|
43
|
+
return Path(str(resources.files("xcore_doctype") / "plugin_dir"))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def system_plugin_dir() -> Path:
|
|
47
|
+
"""Le plugin `system` embarqué (réglages globaux : `System Settings`), que `xcore-doctype install` dépose à côté du moteur."""
|
|
48
|
+
return Path(str(resources.files("xcore_doctype") / "system_plugin_dir"))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
PLATFORM_PLUGINS = ("xlicense", "xpulse", "xprint", "xflow") # livrés par le paquet, posés par `xcore-doctype install` à côté du moteur
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def platform_plugins_dir() -> Path:
|
|
55
|
+
"""Les plugins de la PLATEFORME embarqués (`xlicense` : licences, modules et abonnements ; `xpulse` : notifications en temps réel,
|
|
56
|
+
SSE), que `xcore-doctype install` dépose à côté du moteur. Leurs extensions de service sont, elles, importées depuis le paquet
|
|
57
|
+
(`xcore_doctype.ext.*`, à nommer dans `services.extensions` d'integration.yaml) : rien à copier pour elles."""
|
|
58
|
+
return Path(str(resources.files("xcore_doctype") / "platform"))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
__all__ = [
|
|
62
|
+
"Config", "DocumentValidationError", "HookEvent", "HookRegistrationError", "HookRegistry",
|
|
63
|
+
"mount_desk", "platform_plugins_dir", "plugin_dir", "system_plugin_dir", "__version__",
|
|
64
|
+
]
|