feat: explicitly export for extensions from __init__.py (#2669)
* feat: explicitly export for extensions from `__init__.py` makes it clear what extensions are expected to use and also makes future changes to the structure of core safer because extension can just depend on ```from lnbits import require_admin_key``` for example
This commit is contained in:
parent
b83c2e9368
commit
ecc62b0011
1 changed files with 24 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
||||||
|
from .core.services import create_invoice, pay_invoice
|
||||||
|
from .decorators import (
|
||||||
|
check_admin,
|
||||||
|
check_super_user,
|
||||||
|
check_user_exists,
|
||||||
|
require_admin_key,
|
||||||
|
require_invoice_key,
|
||||||
|
)
|
||||||
|
from .exceptions import InvoiceError, PaymentError
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
# decorators
|
||||||
|
"require_admin_key",
|
||||||
|
"require_invoice_key",
|
||||||
|
"check_admin",
|
||||||
|
"check_super_user",
|
||||||
|
"check_user_exists",
|
||||||
|
# services
|
||||||
|
"pay_invoice",
|
||||||
|
"create_invoice",
|
||||||
|
# exceptions
|
||||||
|
"PaymentError",
|
||||||
|
"InvoiceError",
|
||||||
|
]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue